From eb89d7b53ab95623ab454186a602e1cafc7391f0 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Wed, 21 Mar 2012 10:10:17 -0500 Subject: [svn-r22105] Description: Bring r20557:22085 from trunk to this branch, also fixing some other issues/failures in the branch simultaneously. The h5repack tests are still failing, but Neil will be checking into those, so the branch can be fully functional again. Tested on: Mac OSX/64 10.7.3 (amazon) w/debug --- CMakeLists.txt | 286 +- COPYING | 2 +- CTestConfig.cmake | 18 +- MANIFEST | 301 +- Makefile.am | 0 Makefile.in | 3 + README.txt | 2 +- bin/make_vers | 80 +- bin/output_filter.sh | 101 + bin/release | 3 +- bin/trace | 7 + c++/CMakeLists.txt | 2 +- c++/Makefile.in | 3 + c++/examples/CMakeLists.txt | 3 +- c++/examples/Makefile.in | 3 + c++/examples/run-c++-ex.sh.in | 4 +- c++/src/CMakeLists.txt | 4 +- c++/src/H5Object.cpp | 2 +- c++/src/Makefile.in | 5 +- c++/test/CMakeLists.txt | 3 +- c++/test/Makefile.in | 3 + config/cmake/CPack.cmake | 520 + config/cmake/CTest.cmake | 289 - config/cmake/CTestCustom.cmake | 54 +- config/cmake/ConfigureChecks.cmake | 141 +- config/cmake/FindHDF5.cmake | 4 +- config/cmake/FindMPI.cmake | 880 +- config/cmake/H5pubconf.h.in | 33 +- config/cmake/HDF5Macros.cmake | 9 +- config/cmake/HDF5Tests.c | 73 +- config/cmake/HDF5UseFortran.cmake | 9 + config/cmake/HDFLibMacros.cmake | 323 + config/cmake/HDFMacros.cmake | 274 +- config/cmake/NSIS.InstallOptions.ini.in | 37 + config/cmake/NSIS.template.in | 949 ++ config/cmake/cacheinit.cmake | 12 +- config/cmake/hdf5-config.cmake.build.in | 4 +- config/cmake/hdf5-config.cmake.install.in | 46 +- config/cmake/libhdf5.settings.cmake.in | 89 +- config/cmake/mccacheinit.cmake | 4 +- config/cmake/prunTest.cmake | 121 + config/gnu-flags | 12 +- config/i686-pc-cygwin | 9 +- config/ia64-linux-gnu | 9 - config/ibm-aix | 86 +- config/ibm-flags | 32 +- config/intel-flags | 2 +- config/irix6.x | 20 - config/linux-gnulibc1 | 17 - config/lt_vers.am | 2 +- config/mpich | 83 - config/x86_64-redstorm-linux-gnu | 2 - configure | 492 +- configure.in | 270 +- examples/CMakeLists.txt | 4 +- examples/Makefile.am | 4 +- examples/Makefile.in | 6 +- examples/h5_elink_unix2win.c | 14 +- examples/h5_ref2reg.c | 4 +- examples/h5_reference.c | 2 +- examples/run-all-ex.sh | 4 +- examples/run-c-ex.sh.in | 4 +- fortran/CMakeLists.txt | 10 +- fortran/Makefile.in | 3 + fortran/doc/DevelGuide/masterindex.html | 589 + fortran/doc/DevelGuide/robo_functions.html | 39 + fortran/doc/DevelGuide/robo_modules.html | 117 + fortran/doc/DevelGuide/robo_programs.html | 39 + fortran/doc/DevelGuide/robo_sourcefiles.html | 309 + fortran/doc/DevelGuide/robo_subroutines.html | 421 + fortran/doc/DevelGuide/robodoc.css | 302 + fortran/doc/DevelGuide/src/H5Af_c.html | 41 + fortran/doc/DevelGuide/src/H5Aff_F03_f90.html | 130 + fortran/doc/DevelGuide/src/H5Aff_F90_f90.html | 56 + fortran/doc/DevelGuide/src/H5Aff_f90.html | 1102 ++ fortran/doc/DevelGuide/src/H5Df_c.html | 41 + fortran/doc/DevelGuide/src/H5Dff_F03_f90.html | 138 + fortran/doc/DevelGuide/src/H5Dff_F90_f90.html | 116 + fortran/doc/DevelGuide/src/H5Dff_f90.html | 506 + fortran/doc/DevelGuide/src/H5Ef_c.html | 41 + fortran/doc/DevelGuide/src/H5Eff_f90.html | 197 + fortran/doc/DevelGuide/src/H5FDmpiof_c.html | 41 + fortran/doc/DevelGuide/src/H5FDmpioff_f90.html | 253 + fortran/doc/DevelGuide/src/H5Ff_c.html | 41 + fortran/doc/DevelGuide/src/H5Fff_f90.html | 653 ++ fortran/doc/DevelGuide/src/H5Gf_c.html | 41 + fortran/doc/DevelGuide/src/H5Gff_f90.html | 840 ++ fortran/doc/DevelGuide/src/H5If_c.html | 41 + fortran/doc/DevelGuide/src/H5Iff_f90.html | 304 + fortran/doc/DevelGuide/src/H5Lf_c.html | 41 + fortran/doc/DevelGuide/src/H5Lff_F03_f90.html | 181 + fortran/doc/DevelGuide/src/H5Lff_F90_f90.html | 50 + fortran/doc/DevelGuide/src/H5Lff_f90.html | 637 ++ fortran/doc/DevelGuide/src/H5Of_c.html | 41 + fortran/doc/DevelGuide/src/H5Off_f90.html | 198 + fortran/doc/DevelGuide/src/H5Pf_c.html | 41 + fortran/doc/DevelGuide/src/H5Pff_F03_f90.html | 832 ++ fortran/doc/DevelGuide/src/H5Pff_F90_f90.html | 715 ++ fortran/doc/DevelGuide/src/H5Pff_f90.html | 4752 ++++++++ fortran/doc/DevelGuide/src/H5Rf_c.html | 41 + fortran/doc/DevelGuide/src/H5Rff_F03_f90.html | 492 + fortran/doc/DevelGuide/src/H5Rff_F90_f90.html | 305 + fortran/doc/DevelGuide/src/H5Rff_f90.html | 148 + fortran/doc/DevelGuide/src/H5Sf_c.html | 41 + fortran/doc/DevelGuide/src/H5Sff_f90.html | 1165 ++ fortran/doc/DevelGuide/src/H5Tf_c.html | 41 + fortran/doc/DevelGuide/src/H5Tff_f90.html | 2378 ++++ fortran/doc/DevelGuide/src/H5Zf_c.html | 41 + fortran/doc/DevelGuide/src/H5Zff_f90.html | 173 + .../src/H5_DBLE_InterfaceExclude_f90.html | 53 + .../src/H5_DBLE_InterfaceInclude_f90.html | 54 + fortran/doc/DevelGuide/src/H5_f_c.html | 41 + fortran/doc/DevelGuide/src/H5_ff_F03_f90.html | 83 + fortran/doc/DevelGuide/src/H5_ff_F90_f90.html | 48 + fortran/doc/DevelGuide/src/H5_ff_f90.html | 269 + fortran/doc/DevelGuide/src/H5f90global_f90.html | 61 + fortran/doc/DevelGuide/src/H5f90kit_c.html | 44 + fortran/doc/DevelGuide/src/H5match_types_c.html | 49 + .../doc/DevelGuide/src/H5test_kind_SIZEOF_f90.html | 61 + fortran/doc/DevelGuide/src/H5test_kind_f90.html | 62 + fortran/doc/DevelGuide/src/HDF5_f90.html | 47 + fortran/doc/DevelGuide/src/HDF5mpio_f90.html | 45 + fortran/doc/DevelGuide/test/fflush1_f90.html | 47 + fortran/doc/DevelGuide/test/fflush2_f90.html | 47 + .../DevelGuide/test/fortranlib_test_1_8_f90.html | 44 + .../DevelGuide/test/fortranlib_test_F03_f90.html | 45 + .../doc/DevelGuide/test/fortranlib_test_f90.html | 44 + fortran/doc/DevelGuide/test/tF2003_f90.html | 53 + fortran/doc/DevelGuide/test/tH5A_1_8_f90.html | 51 + fortran/doc/DevelGuide/test/tH5A_f90.html | 47 + fortran/doc/DevelGuide/test/tH5D_f90.html | 52 + fortran/doc/DevelGuide/test/tH5E_f90.html | 51 + fortran/doc/DevelGuide/test/tH5F_f90.html | 47 + fortran/doc/DevelGuide/test/tH5G_1_8_f90.html | 49 + fortran/doc/DevelGuide/test/tH5G_f90.html | 47 + fortran/doc/DevelGuide/test/tH5I_f90.html | 47 + fortran/doc/DevelGuide/test/tH5O_f90.html | 47 + fortran/doc/DevelGuide/test/tH5P_f90.html | 47 + fortran/doc/DevelGuide/test/tH5R_f90.html | 51 + fortran/doc/DevelGuide/test/tH5S_f90.html | 54 + fortran/doc/DevelGuide/test/tH5Sselect_f90.html | 56 + fortran/doc/DevelGuide/test/tH5T_f90.html | 47 + fortran/doc/DevelGuide/test/tH5VL_f90.html | 47 + fortran/doc/DevelGuide/test/tH5Z_f90.html | 47 + fortran/doc/DevelGuide/test/t_c.html | 44 + fortran/doc/DevelGuide/test/tf_f90.html | 48 + fortran/doc/DevelGuide/toc_index.html | 552 + fortran/examples/CMakeLists.txt | 51 +- fortran/examples/Makefile.am | 32 +- fortran/examples/Makefile.in | 35 +- fortran/examples/compound_complex_fortran2003.f90 | 117 + fortran/examples/compound_fortran2003.f90 | 208 + fortran/examples/nested_derived_type.f90 | 212 + fortran/examples/run-fortran-ex.sh.in | 4 +- fortran/examples/rwdset_fortran2003.f90 | 181 + fortran/robodoc.rc | 73 + fortran/src/CMakeLists.txt | 93 +- fortran/src/H5Af.c | 913 +- fortran/src/H5Aff.f90 | 2961 ++--- fortran/src/H5Aff_F03.f90 | 1274 +++ fortran/src/H5Aff_F90.f90 | 1618 +++ fortran/src/H5Df.c | 978 +- fortran/src/H5Dff.f90 | 5027 ++------ fortran/src/H5Dff_F03.f90 | 2404 ++++ fortran/src/H5Dff_F90.f90 | 3002 +++++ fortran/src/H5Ef.c | 262 +- fortran/src/H5Eff.f90 | 284 +- fortran/src/H5Eff_F03.f90 | 110 + fortran/src/H5Eff_F90.f90 | 89 + fortran/src/H5FDmpiof.c | 163 +- fortran/src/H5FDmpioff.f90 | 457 +- fortran/src/H5Ff.c | 392 +- fortran/src/H5Fff.f90 | 1675 ++- fortran/src/H5Gf.c | 479 +- fortran/src/H5Gff.f90 | 1673 ++- fortran/src/H5If.c | 181 +- fortran/src/H5Iff.f90 | 684 +- fortran/src/H5Lf.c | 617 +- fortran/src/H5Lff.f90 | 814 +- fortran/src/H5Lff_F03.f90 | 245 + fortran/src/H5Lff_F90.f90 | 39 + fortran/src/H5Of.c | 288 +- fortran/src/H5Off.f90 | 195 +- fortran/src/H5Off_F03.f90 | 242 + fortran/src/H5Off_F90.f90 | 39 + fortran/src/H5Pf.c | 3327 ++++-- fortran/src/H5Pff.f90 | 11342 +++++++++---------- fortran/src/H5Pff_F03.f90 | 1185 ++ fortran/src/H5Pff_F90.f90 | 950 ++ fortran/src/H5Rf.c | 434 +- fortran/src/H5Rff.f90 | 662 +- fortran/src/H5Rff_F03.f90 | 655 ++ fortran/src/H5Rff_F90.f90 | 449 + fortran/src/H5Sf.c | 824 +- fortran/src/H5Sff.f90 | 1880 ++- fortran/src/H5Tf.c | 1615 ++- fortran/src/H5Tff.f90 | 3379 +++--- fortran/src/H5Tff_F03.f90 | 118 + fortran/src/H5Tff_F90.f90 | 39 + fortran/src/H5Zf.c | 92 +- fortran/src/H5Zff.f90 | 369 +- fortran/src/H5_DBLE_InterfaceExclude.f90 | 2 +- fortran/src/H5_DBLE_InterfaceInclude.f90 | 237 +- fortran/src/H5_f.c | 430 +- fortran/src/H5_ff.f90 | 326 +- fortran/src/H5_ff_F03.f90 | 75 + fortran/src/H5_ff_F90.f90 | 34 + fortran/src/H5f90global.f90 | 236 +- fortran/src/H5f90kit.c | 96 +- fortran/src/H5f90proto.h | 1162 +- fortran/src/H5match_types.c | 284 +- fortran/src/H5test_kind.f90 | 119 +- fortran/src/H5test_kind_SIZEOF.f90 | 94 +- fortran/src/HDF5.f90 | 23 +- fortran/src/HDF5mpio.f90 | 86 +- fortran/src/Makefile.am | 64 +- fortran/src/Makefile.in | 91 +- fortran/src/hdf5_fortrandll.def | 258 +- fortran/src/phdf5_fortrandll.def | 530 + fortran/test/CMakeLists.txt | 50 +- fortran/test/Makefile.am | 23 +- fortran/test/Makefile.in | 45 +- fortran/test/fflush1.f90 | 19 +- fortran/test/fflush2.f90 | 21 +- fortran/test/fortranlib_test.f90 | 17 +- fortran/test/fortranlib_test_1_8.f90 | 353 +- fortran/test/fortranlib_test_F03.f90 | 164 + fortran/test/t.c | 16 +- fortran/test/tH5A.f90 | 15 + fortran/test/tH5A_1_8.f90 | 590 +- fortran/test/tH5D.f90 | 33 +- fortran/test/tH5E.f90 | 18 + fortran/test/tH5E_F03.f90 | 210 + fortran/test/tH5F.f90 | 23 +- fortran/test/tH5G.f90 | 15 + fortran/test/tH5G_1_8.f90 | 150 +- fortran/test/tH5I.f90 | 30 +- fortran/test/tH5L_F03.f90 | 321 + fortran/test/tH5O.f90 | 14 + fortran/test/tH5P.f90 | 55 +- fortran/test/tH5P_F03.f90 | 364 + fortran/test/tH5R.f90 | 63 +- fortran/test/tH5S.f90 | 24 +- fortran/test/tH5Sselect.f90 | 143 +- fortran/test/tH5T.f90 | 18 +- fortran/test/tH5T_F03.f90 | 2803 +++++ fortran/test/tH5VL.f90 | 22 +- fortran/test/tH5Z.f90 | 14 + fortran/test/tf.f90 | 63 +- fortran/testpar/CMakeLists.txt | 4 +- fortran/testpar/Makefile.in | 3 + hl/CMakeLists.txt | 2 +- hl/Makefile.in | 3 + hl/c++/CMakeLists.txt | 2 +- hl/c++/Makefile.in | 3 + hl/c++/examples/CMakeLists.txt | 4 +- hl/c++/examples/Makefile.in | 3 + hl/c++/examples/run-hlc++-ex.sh.in | 4 +- hl/c++/src/CMakeLists.txt | 3 +- hl/c++/src/Makefile.in | 5 +- hl/c++/test/CMakeLists.txt | 3 +- hl/c++/test/Makefile.in | 3 + hl/c++/test/ptableTest.cpp | 18 + hl/examples/CMakeLists.txt | 7 +- hl/examples/Makefile.am | 4 +- hl/examples/Makefile.in | 6 +- hl/examples/run-hlc-ex.sh.in | 4 +- hl/fortran/CMakeLists.txt | 2 +- hl/fortran/Makefile.in | 3 + hl/fortran/examples/CMakeLists.txt | 4 +- hl/fortran/examples/Makefile.am | 4 +- hl/fortran/examples/Makefile.in | 7 +- hl/fortran/examples/ex_ds1.f90 | 192 + hl/fortran/examples/run-hlfortran-ex.sh.in | 4 +- hl/fortran/src/CMakeLists.txt | 41 +- hl/fortran/src/H5DSfc.c | 377 + hl/fortran/src/H5DSff.f90 | 536 + hl/fortran/src/H5IMcc.c | 2 +- hl/fortran/src/H5LTf90proto.h | 390 +- hl/fortran/src/H5LTfc.c | 51 + hl/fortran/src/H5LTff.f90 | 67 + hl/fortran/src/Makefile.am | 5 +- hl/fortran/src/Makefile.in | 15 +- hl/fortran/test/CMakeLists.txt | 15 +- hl/fortran/test/Makefile.am | 5 +- hl/fortran/test/Makefile.in | 29 +- hl/fortran/test/tstds.f90 | 347 + hl/fortran/test/tstlite.f90 | 87 +- hl/src/CMakeLists.txt | 4 +- hl/src/H5DS.c | 51 +- hl/src/H5IM.c | 4 +- hl/src/H5LT.c | 581 +- hl/src/H5LTprivate.h | 2 +- hl/src/H5LTpublic.h | 3 +- hl/src/Makefile.in | 5 +- hl/test/CMakeLists.txt | 4 +- hl/test/Makefile.in | 3 + hl/test/test_ds.c | 1061 +- hl/test/test_image.c | 54 +- hl/test/test_lite.c | 609 +- hl/test/test_packet.c | 14 +- hl/test/test_table.c | 56 +- hl/tools/CMakeLists.txt | 5 +- hl/tools/Makefile.in | 3 + hl/tools/gif2h5/Makefile.in | 3 + hl/tools/gif2h5/gif2hdf.c | 4 + hl/tools/gif2h5/gif2mem.c | 2 +- hl/tools/gif2h5/hdf2gif.c | 4 + hl/tools/h5watch/Makefile.in | 3 + perform/CMakeLists.txt | 55 +- perform/Makefile.in | 3 + perform/benchpar.c | 13 +- perform/iopipe.c | 306 +- perform/mpi-perf.c | 13 +- perform/overhead.c | 309 +- perform/perf.c | 113 +- perform/pio_engine.c | 142 +- perform/pio_perf.c | 11 +- perform/pio_perf.h | 3 +- perform/pio_standalone.h | 56 +- perform/pio_timer.c | 72 +- perform/pio_timer.h | 4 +- perform/sio_engine.c | 28 +- perform/sio_perf.c | 5 + perform/sio_perf.h | 29 +- perform/sio_standalone.h | 48 +- perform/sio_timer.c | 36 +- perform/sio_timer.h | 6 +- perform/zip_perf.c | 29 +- release_docs/CMake.txt | 81 +- release_docs/COPYING | 0 release_docs/INSTALL_Cygwin.txt | 2 +- release_docs/INSTALL_Windows.txt | 3 + release_docs/INSTALL_Windows_From_Command_Line.txt | 0 release_docs/INSTALL_Windows_Short_NET.TXT | 0 release_docs/INSTALL_Windows_Short_VS2005.TXT | 0 release_docs/INSTALL_Windows_Short_VS2008.TXT | 0 release_docs/RELEASE.txt | 400 +- release_docs/USING_Windows.txt | 19 +- release_docs/Using_CMake.txt | 181 + src/CMakeLists.txt | 280 +- src/COPYING | 0 src/H5.c | 16 +- src/H5A.c | 94 +- src/H5AC.c | 132 +- src/H5Abtree2.c | 22 +- src/H5Adense.c | 38 +- src/H5Adeprec.c | 14 +- src/H5Aint.c | 239 +- src/H5Apkg.h | 2 - src/H5Atest.c | 4 +- src/H5B.c | 42 +- src/H5B2.c | 28 +- src/H5B2cache.c | 30 +- src/H5B2dbg.c | 6 +- src/H5B2hdr.c | 20 +- src/H5B2int.c | 50 +- src/H5B2stat.c | 4 +- src/H5B2test.c | 22 +- src/H5Bcache.c | 12 +- src/H5Bdbg.c | 4 +- src/H5C.c | 136 +- src/H5CS.c | 14 +- src/H5D.c | 42 +- src/H5Dbtree.c | 62 +- src/H5Dbtree2.c | 68 +- src/H5Dchunk.c | 133 +- src/H5Dcompact.c | 16 +- src/H5Dcontig.c | 38 +- src/H5Ddbg.c | 4 +- src/H5Ddeprec.c | 12 +- src/H5Dearray.c | 66 +- src/H5Defl.c | 20 +- src/H5Dfarray.c | 56 +- src/H5Dfill.c | 12 +- src/H5Dint.c | 113 +- src/H5Dio.c | 50 +- src/H5Dlayout.c | 14 +- src/H5Dmpio.c | 594 +- src/H5Dnone.c | 22 +- src/H5Doh.c | 16 +- src/H5Dpkg.h | 2 +- src/H5Dprivate.h | 2 + src/H5Dproxy.c | 22 +- src/H5Dscatgath.c | 16 +- src/H5Dselect.c | 6 +- src/H5Dtest.c | 8 +- src/H5E.c | 79 +- src/H5Edeprec.c | 18 +- src/H5Eint.c | 35 +- src/H5Eprivate.h | 2 +- src/H5F.c | 263 +- src/H5FD.c | 165 +- src/H5FDcore.c | 79 +- src/H5FDcore.h | 6 +- src/H5FDdirect.c | 854 +- src/H5FDdirect.h | 4 +- src/H5FDfamily.c | 87 +- src/H5FDfamily.h | 4 +- src/H5FDint.c | 12 +- src/H5FDlog.c | 383 +- src/H5FDlog.h | 3 - src/H5FDmpi.c | 23 +- src/H5FDmpi.h | 4 - src/H5FDmpio.c | 118 +- src/H5FDmpio.h | 2 +- src/H5FDmpiposix.c | 709 +- src/H5FDmpiposix.h | 1 - src/H5FDmulti.c | 39 +- src/H5FDmulti.h | 6 +- src/H5FDpublic.h | 16 +- src/H5FDsec2.c | 375 +- src/H5FDsec2.h | 3 - src/H5FDspace.c | 14 +- src/H5FDstdio.c | 436 +- src/H5FDstdio.h | 1 - src/H5FDwindows.c | 1079 +- src/H5FDwindows.h | 81 +- src/H5FL.c | 90 +- src/H5FO.c | 28 +- src/H5FS.c | 34 +- src/H5FScache.c | 24 +- src/H5FSdbg.c | 6 +- src/H5FSsection.c | 60 +- src/H5FSstat.c | 3 +- src/H5FStest.c | 6 +- src/H5Faccum.c | 12 +- src/H5Fcwfs.c | 323 + src/H5Fdbg.c | 8 +- src/H5Fdeprec.c | 4 +- src/H5Fefc.c | 24 +- src/H5Ffake.c | 6 +- src/H5Fio.c | 8 +- src/H5Fmount.c | 107 +- src/H5Fmpi.c | 6 +- src/H5Fpkg.h | 4 +- src/H5Fprivate.h | 134 +- src/H5Fpublic.h | 29 +- src/H5Fquery.c | 335 +- src/H5Fsfile.c | 8 +- src/H5Fsuper.c | 24 +- src/H5Fsuper_cache.c | 12 +- src/H5Ftest.c | 8 +- src/H5G.c | 1352 +-- src/H5Gbtree2.c | 22 +- src/H5Gcache.c | 18 +- src/H5Gcompact.c | 88 +- src/H5Gdense.c | 144 +- src/H5Gdeprec.c | 64 +- src/H5Gent.c | 114 +- src/H5Gint.c | 1116 +- src/H5Glink.c | 205 +- src/H5Gloc.c | 44 +- src/H5Gname.c | 225 +- src/H5Gnode.c | 155 +- src/H5Gobj.c | 169 +- src/H5Goh.c | 18 +- src/H5Gpkg.h | 240 +- src/H5Gprivate.h | 93 +- src/H5Groot.c | 51 +- src/H5Gstab.c | 224 +- src/H5Gtest.c | 102 +- src/H5Gtraverse.c | 174 +- src/H5HF.c | 29 +- src/H5HFbtree2.c | 60 +- src/H5HFcache.c | 34 +- src/H5HFdbg.c | 14 +- src/H5HFdblock.c | 14 +- src/H5HFdtable.c | 12 +- src/H5HFhdr.c | 48 +- src/H5HFhuge.c | 24 +- src/H5HFiblock.c | 38 +- src/H5HFiter.c | 22 +- src/H5HFman.c | 12 +- src/H5HFsection.c | 120 +- src/H5HFspace.c | 16 +- src/H5HFstat.c | 4 +- src/H5HFtest.c | 24 +- src/H5HFtiny.c | 14 +- src/H5HG.c | 169 +- src/H5HGcache.c | 42 +- src/H5HGdbg.c | 60 +- src/H5HGpkg.h | 6 - src/H5HGprivate.h | 32 +- src/H5HGquery.c | 145 + src/H5HL.c | 46 +- src/H5HLcache.c | 52 +- src/H5HLdbg.c | 2 +- src/H5HLint.c | 16 +- src/H5HLpkg.h | 6 +- src/H5HLprivate.h | 2 +- src/H5HP.c | 26 +- src/H5I.c | 90 +- src/H5Itest.c | 2 +- src/H5L.c | 248 +- src/H5Lexternal.c | 19 +- src/H5Lpkg.h | 3 + src/H5MF.c | 28 +- src/H5MFaggr.c | 18 +- src/H5MFdbg.c | 6 +- src/H5MFsection.c | 18 +- src/H5MM.c | 85 +- src/H5MP.c | 10 +- src/H5MPtest.c | 10 +- src/H5O.c | 148 +- src/H5Oainfo.c | 35 +- src/H5Oalloc.c | 74 +- src/H5Oattr.c | 28 +- src/H5Oattribute.c | 76 +- src/H5Obtreek.c | 10 +- src/H5Ocache.c | 28 +- src/H5Ochunk.c | 12 +- src/H5Ocont.c | 12 +- src/H5Ocopy.c | 37 +- src/H5Odbg.c | 39 +- src/H5Odrvinfo.c | 12 +- src/H5Odtype.c | 28 +- src/H5Oefl.c | 16 +- src/H5Ofill.c | 30 +- src/H5Oflush.c | 24 +- src/H5Ofsinfo.c | 12 +- src/H5Oginfo.c | 12 +- src/H5Olayout.c | 30 +- src/H5Olinfo.c | 32 +- src/H5Olink.c | 27 +- src/H5Omessage.c | 117 +- src/H5Omtime.c | 88 +- src/H5Oname.c | 18 +- src/H5Opkg.h | 6 +- src/H5Opline.c | 20 +- src/H5Oprivate.h | 20 +- src/H5Opublic.h | 2 +- src/H5Orefcount.c | 14 +- src/H5Osdspace.c | 18 +- src/H5Oshared.c | 133 +- src/H5Oshared.h | 38 +- src/H5Oshmesg.c | 10 +- src/H5Ostab.c | 31 +- src/H5Ostorage.c | 20 +- src/H5Otest.c | 20 +- src/H5Ounknown.c | 4 +- src/H5P.c | 74 +- src/H5Pdapl.c | 10 +- src/H5Pdcpl.c | 62 +- src/H5Pdeprec.c | 12 +- src/H5Pdxpl.c | 149 +- src/H5Pfapl.c | 164 +- src/H5Pfcpl.c | 64 +- src/H5Pfmpl.c | 2 +- src/H5Pgcpl.c | 18 +- src/H5Pint.c | 124 +- src/H5Plapl.c | 34 +- src/H5Plcpl.c | 6 +- src/H5Pocpl.c | 50 +- src/H5Pocpypl.c | 6 +- src/H5Ppublic.h | 36 + src/H5Pstrcpl.c | 10 +- src/H5Ptest.c | 8 +- src/H5R.c | 70 +- src/H5RC.c | 4 +- src/H5RS.c | 24 +- src/H5Rdeprec.c | 58 +- src/H5Rpkg.h | 2 + src/H5Rpublic.h | 3 +- src/H5S.c | 102 +- src/H5SL.c | 182 +- src/H5SLprivate.h | 8 +- src/H5SM.c | 474 +- src/H5SMbtree2.c | 12 +- src/H5SMcache.c | 33 +- src/H5SMmessage.c | 14 +- src/H5SMpkg.h | 2 +- src/H5SMprivate.h | 12 +- src/H5SMtest.c | 12 +- src/H5ST.c | 34 +- src/H5Sall.c | 80 +- src/H5Sdbg.c | 2 +- src/H5Shyper.c | 174 +- src/H5Smpio.c | 14 +- src/H5Snone.c | 50 +- src/H5Spoint.c | 58 +- src/H5Sselect.c | 68 +- src/H5Stest.c | 4 +- src/H5T.c | 260 +- src/H5TS.c | 55 +- src/H5Tarray.c | 18 +- src/H5Tbit.c | 36 +- src/H5Tcommit.c | 34 +- src/H5Tcompound.c | 26 +- src/H5Tconv.c | 1186 +- src/H5Tcset.c | 6 +- src/H5Tdbg.c | 4 +- src/H5Tdeprec.c | 8 +- src/H5Tenum.c | 22 +- src/H5Tfields.c | 16 +- src/H5Tfixed.c | 8 +- src/H5Tfloat.c | 18 +- src/H5Tnative.c | 14 +- src/H5Toffset.c | 10 +- src/H5Toh.c | 10 +- src/H5Topaque.c | 6 +- src/H5Torder.c | 10 +- src/H5Tpad.c | 6 +- src/H5Tpkg.h | 2 +- src/H5Tprecis.c | 10 +- src/H5Tprivate.h | 1 + src/H5Tstrpad.c | 6 +- src/H5Tvisit.c | 2 +- src/H5Tvlen.c | 52 +- src/H5V.c | 51 +- src/H5Vprivate.h | 20 +- src/H5WB.c | 8 +- src/H5Z.c | 53 +- src/H5Zdeflate.c | 2 +- src/H5Zfletcher32.c | 2 +- src/H5Znbit.c | 18 +- src/H5Zpkg.h | 3 - src/H5Zscaleoffset.c | 14 +- src/H5Zshuffle.c | 4 +- src/H5Zszip.c | 6 +- src/H5Ztrans.c | 237 +- src/H5api_adpt.h | 22 +- src/H5checksum.c | 14 +- src/H5config.h.in | 13 +- src/H5dbg.c | 2 +- src/H5detect.c | 2 +- src/H5private.h | 1419 ++- src/H5public.h | 4 +- src/H5system.c | 715 +- src/H5trace.c | 128 + src/H5vers.txt | 1 + src/H5version.h | 423 +- src/H5win32defs.h | 61 +- src/Makefile.am | 5 +- src/Makefile.in | 96 +- src/hdf5.h | 2 +- src/libhdf5.settings.in | 1 + test/CMakeLists.txt | 149 +- test/Makefile.am | 5 +- test/Makefile.in | 62 +- test/be_data.h5 | Bin 40320 -> 72368 bytes test/big.c | 578 +- test/cross_read.c | 932 +- test/dsets.c | 129 +- test/dt_arith.c | 18 +- test/dtransform.c | 180 +- test/dtypes.c | 658 +- test/enum.c | 3 - test/error_test.c | 95 +- test/filter_error.h5 | Bin 0 -> 3576 bytes test/flush2.c | 4 +- test/gen_cross.c | 608 +- test/gen_filters.c | 157 +- test/getname.c | 26 +- test/h5test.c | 650 +- test/h5test.h | 54 +- test/le_data.h5 | Bin 40320 -> 72368 bytes test/links.c | 464 +- test/mount.c | 22 +- test/multi_file_v16-r.h5 | Bin 0 -> 65536 bytes test/multi_file_v16-s.h5 | Bin 0 -> 2048 bytes test/ntypes.c | 6 +- test/objcopy.c | 1044 +- test/stab.c | 98 +- test/tattr.c | 342 +- test/testfiles/error_test_1 | 24 +- test/testlinks_env.sh.in | 2 +- test/tfile.c | 152 +- test/th5o.c | 2 + test/th5s.c | 962 +- test/tmisc.c | 168 +- test/trefer.c | 152 +- test/tskiplist.c | 284 +- test/tunicode.c | 4 +- test/unlink.c | 12 +- test/vfd.c | 299 +- test/vms_data.h5 | Bin 40320 -> 0 bytes testpar/CMakeLists.txt | 23 +- testpar/Makefile.in | 3 + testpar/t_cache.c | 3 + testpar/t_chunk_alloc.c | 4 +- testpar/t_dset.c | 549 + testpar/t_mpi.c | 265 +- testpar/t_posix_compliant.c | 2 + testpar/t_shapesame.c | 5309 ++++----- testpar/testphdf5.c | 5 +- testpar/testphdf5.h | 16 +- tools/CMakeLists.txt | 3 +- tools/Makefile.in | 3 + tools/h5copy/CMakeLists.txt | 84 +- tools/h5copy/Makefile.in | 3 + tools/h5copy/h5copy.c | 9 +- tools/h5copy/h5copygentest.c | 65 +- tools/h5copy/testfiles/h5copy_extlinks_src.out.ls | 3 - tools/h5copy/testfiles/h5copy_misc1.out | 2 +- tools/h5copy/testfiles/h5copy_ref.out.ls | 3 - tools/h5copy/testfiles/h5copytst.out.ls | 177 +- tools/h5copy/testh5copy.sh | 138 +- tools/h5diff/CMakeLists.txt | 262 +- tools/h5diff/Makefile.in | 3 + tools/h5diff/h5diff_common.c | 263 +- tools/h5diff/h5diff_common.h | 5 +- tools/h5diff/h5diff_main.c | 30 +- tools/h5diff/h5diffgentest.c | 1148 +- tools/h5diff/ph5diff_main.c | 37 +- tools/h5diff/testfiles/compounds_array_vlen1.h5 | Bin 0 -> 26912 bytes tools/h5diff/testfiles/compounds_array_vlen2.h5 | Bin 0 -> 26912 bytes tools/h5diff/testfiles/h5diff_10.txt | 175 +- tools/h5diff/testfiles/h5diff_17.txt | 3 + tools/h5diff/testfiles/h5diff_171.txt | 2 +- tools/h5diff/testfiles/h5diff_172.txt | 2 +- tools/h5diff/testfiles/h5diff_20.txt | 2 +- tools/h5diff/testfiles/h5diff_202.txt | 1 - tools/h5diff/testfiles/h5diff_205.txt | 1 - tools/h5diff/testfiles/h5diff_208.txt | 5 + tools/h5diff/testfiles/h5diff_21.txt | 2 +- tools/h5diff/testfiles/h5diff_22.txt | 2 +- tools/h5diff/testfiles/h5diff_220.txt | 8 + tools/h5diff/testfiles/h5diff_221.txt | 12 + tools/h5diff/testfiles/h5diff_222.txt | 19 + tools/h5diff/testfiles/h5diff_30.txt | 9 + tools/h5diff/testfiles/h5diff_465.txt | 1 + tools/h5diff/testfiles/h5diff_466.txt | 5 + tools/h5diff/testfiles/h5diff_467.txt | 3 + tools/h5diff/testfiles/h5diff_468.txt | 5 + tools/h5diff/testfiles/h5diff_469.txt | 3 + tools/h5diff/testfiles/h5diff_505.txt | 2 +- tools/h5diff/testfiles/h5diff_507.txt | 2 +- tools/h5diff/testfiles/h5diff_509.txt | 2 +- tools/h5diff/testfiles/h5diff_530.txt | 24 +- tools/h5diff/testfiles/h5diff_540.txt | 86 + tools/h5diff/testfiles/h5diff_57.txt | 2 +- tools/h5diff/testfiles/h5diff_600.txt | 175 +- tools/h5diff/testfiles/h5diff_603.txt | 175 +- tools/h5diff/testfiles/h5diff_606.txt | 175 +- tools/h5diff/testfiles/h5diff_612.txt | 175 +- tools/h5diff/testfiles/h5diff_615.txt | 175 +- tools/h5diff/testfiles/h5diff_621.txt | 175 +- tools/h5diff/testfiles/h5diff_622.txt | 175 +- tools/h5diff/testfiles/h5diff_623.txt | 175 +- tools/h5diff/testfiles/h5diff_624.txt | 175 +- tools/h5diff/testfiles/h5diff_630.txt | 3 + tools/h5diff/testfiles/h5diff_631.txt | 3 + tools/h5diff/testfiles/h5diff_640.txt | 4 + tools/h5diff/testfiles/h5diff_641.txt | 4 + tools/h5diff/testfiles/h5diff_642.txt | 4 + tools/h5diff/testfiles/h5diff_643.txt | 4 + tools/h5diff/testfiles/h5diff_644.txt | 4 + tools/h5diff/testfiles/h5diff_645.txt | 4 + tools/h5diff/testfiles/h5diff_646.txt | 4 + tools/h5diff/testfiles/h5diff_70.txt | 2 +- tools/h5diff/testfiles/h5diff_700.txt | 2 +- tools/h5diff/testfiles/h5diff_701.txt | 2 +- tools/h5diff/testfiles/h5diff_702.txt | 2 +- tools/h5diff/testfiles/h5diff_703.txt | 2 +- tools/h5diff/testfiles/h5diff_80.txt | 2 +- tools/h5diff/testfiles/h5diff_90.txt | 6 - tools/h5diff/testfiles/h5diff_basic1.h5 | Bin 11432 -> 12248 bytes tools/h5diff/testfiles/h5diff_comp_vl_strs.h5 | Bin 18536 -> 37952 bytes .../h5diff/testfiles/h5diff_dset_zero_dim_size1.h5 | Bin 0 -> 1672 bytes .../h5diff/testfiles/h5diff_dset_zero_dim_size2.h5 | Bin 0 -> 1672 bytes .../h5diff/testfiles/h5diff_enum_invalid_values.h5 | Bin 0 -> 2192 bytes tools/h5diff/testfiles/non_comparables1.h5 | Bin 0 -> 6568 bytes tools/h5diff/testfiles/non_comparables2.h5 | Bin 0 -> 6584 bytes tools/h5diff/testh5diff.sh | 769 +- tools/h5dump/CMakeLists.txt | 739 +- tools/h5dump/Makefile.am | 3 + tools/h5dump/Makefile.in | 17 +- tools/h5dump/h5dump.c | 7610 ++----------- tools/h5dump/h5dump.h | 214 +- tools/h5dump/h5dump_ddl.c | 1932 ++++ tools/h5dump/h5dump_ddl.h | 50 + tools/h5dump/h5dump_defines.h | 54 + tools/h5dump/h5dump_extern.h | 112 + tools/h5dump/h5dump_xml.c | 4456 ++++++++ tools/h5dump/h5dump_xml.h | 129 + tools/h5dump/h5dumpgentest.c | 848 +- tools/h5dump/testh5dump.sh.in | 889 +- tools/h5dump/testh5dumpxml.sh.in | 7 +- tools/h5import/CMakeLists.txt | 58 +- tools/h5import/Makefile.in | 3 + tools/h5import/h5import.c | 4382 ++++--- tools/h5import/h5import.h | 179 +- tools/h5import/h5importtest.c | 94 +- tools/h5import/h5importtestutil.sh | 148 +- tools/h5import/testfiles/in64.txt | 2 - tools/h5import/testfiles/test15.h5 | Bin 2064 -> 0 bytes tools/h5import/testfiles/textpfe.h5 | Bin 0 -> 2064 bytes tools/h5import/testfiles/textpfe64.txt | 2 + tools/h5jam/CMakeLists.txt | 90 +- tools/h5jam/Makefile.in | 3 + tools/h5jam/getub.c | 28 +- tools/h5jam/h5jam.c | 499 +- tools/h5jam/h5jamgentest.c | 24 +- tools/h5jam/h5unjam.c | 251 +- tools/h5jam/tellub.c | 26 +- tools/h5jam/testfiles/h5jam-help.txt | 24 + tools/h5jam/testfiles/h5jam-ub-nohdf5.txt | 2 + tools/h5jam/testfiles/h5unjam-help.txt | 27 + tools/h5jam/testh5jam.sh.in | 315 +- tools/h5ls/CMakeLists.txt | 249 +- tools/h5ls/Makefile.in | 3 + tools/h5ls/h5ls.c | 1142 +- tools/h5ls/testh5ls.sh.in | 209 +- tools/h5repack/CMakeLists.txt | 873 +- tools/h5repack/Makefile.in | 3 + tools/h5repack/h5repack.c | 86 +- tools/h5repack/h5repack.sh.in | 353 +- tools/h5repack/h5repack_copy.c | 456 +- tools/h5repack/h5repack_filters.c | 7 +- tools/h5repack/h5repack_main.c | 68 +- tools/h5repack/h5repack_opttable.c | 15 +- tools/h5repack/h5repack_parse.c | 107 +- tools/h5repack/h5repack_refs.c | 442 +- tools/h5repack/h5repack_verify.c | 15 +- tools/h5repack/h5repacktst.c | 149 +- tools/h5repack/testfiles/h5repack_layout.h5 | Bin 29384 -> 27280 bytes tools/h5repack/testh5repack_detect_szip.c | 4 + tools/h5stat/CMakeLists.txt | 41 +- tools/h5stat/Makefile.in | 3 + tools/h5stat/h5stat.c | 922 +- tools/h5stat/h5stat_gentest.c | 4 +- tools/h5stat/testh5stat.sh.in | 85 +- tools/lib/CMakeLists.txt | 19 +- tools/lib/Makefile.am | 2 +- tools/lib/Makefile.in | 14 +- tools/lib/h5diff.c | 263 +- tools/lib/h5diff.h | 24 +- tools/lib/h5diff_array.c | 573 +- tools/lib/h5diff_attr.c | 11 +- tools/lib/h5diff_dset.c | 85 +- tools/lib/h5diff_util.c | 33 +- tools/lib/h5tools.c | 3048 +---- tools/lib/h5tools.h | 107 +- tools/lib/h5tools_dump.c | 3919 +++++++ tools/lib/h5tools_dump.h | 85 + tools/lib/h5tools_error.h | 7 +- tools/lib/h5tools_ref.c | 2 +- tools/lib/h5tools_str.c | 463 +- tools/lib/h5tools_str.h | 26 +- tools/lib/h5tools_type.c | 226 +- tools/lib/h5tools_utils.c | 242 +- tools/lib/h5tools_utils.h | 41 +- tools/lib/h5trav.c | 24 +- tools/lib/h5trav.h | 3 + tools/lib/ph5diff.h | 34 +- tools/misc/CMakeLists.txt | 26 +- tools/misc/Makefile.in | 3 + tools/misc/h5debug.c | 162 +- tools/misc/h5mkgrp.c | 8 +- tools/misc/testh5mkgrp.sh | 10 +- tools/testfiles/file_space.ddl | 9 +- tools/testfiles/filter_fail.ddl | 11 +- tools/testfiles/h5dump-help.txt | 100 + tools/testfiles/help-1.ls | 3 - tools/testfiles/help-2.ls | 3 - tools/testfiles/help-3.ls | 3 - tools/testfiles/nosuchfile.ls | 3 - tools/testfiles/packedbits.ddl | 3 - tools/testfiles/tall-1.ddl | 3 - tools/testfiles/tall-1.ls | 3 - tools/testfiles/tall-2.ddl | 3 - tools/testfiles/tall-2.ls | 3 - tools/testfiles/tall-2A.ddl | 3 - tools/testfiles/tall-2A.h5.xml | 96 +- tools/testfiles/tall-2B.ddl | 7 +- tools/testfiles/tall-3.ddl | 3 - tools/testfiles/tall-4s.ddl | 3 - tools/testfiles/tall-5s.ddl | 3 - tools/testfiles/tall.h5.xml | 256 +- tools/testfiles/tallfilters.ddl | 7 +- tools/testfiles/tarray1.ddl | 3 - tools/testfiles/tarray1.h5.xml | 14 +- tools/testfiles/tarray1.ls | 3 - tools/testfiles/tarray1_big.ddl | 3 - tools/testfiles/tarray2.ddl | 3 - tools/testfiles/tarray2.h5.xml | 61 +- tools/testfiles/tarray3.ddl | 39 +- tools/testfiles/tarray3.h5.xml | 109 +- tools/testfiles/tarray4.ddl | 3 - tools/testfiles/tarray5.ddl | 39 +- tools/testfiles/tarray6.ddl | 3 - tools/testfiles/tarray6.h5 | Bin 6400 -> 6400 bytes tools/testfiles/tarray6.h5.xml | 17 +- tools/testfiles/tarray7.ddl | 23 +- tools/testfiles/tarray7.h5.xml | 29 +- tools/testfiles/tarray8.ddl | 3 - tools/testfiles/tattr-1.ddl | 15 +- tools/testfiles/tattr-2.ddl | 17 +- tools/testfiles/tattr-3.ddl | 18 +- tools/testfiles/tattr-4_be.ddl | 119 + tools/testfiles/tattr.h5 | Bin 3024 -> 3024 bytes tools/testfiles/tattr.h5.xml | 55 +- tools/testfiles/tattr2.ls | 450 +- tools/testfiles/tattr4_be.h5 | Bin 0 -> 3124 bytes tools/testfiles/tattrreg.ddl | 3 - tools/testfiles/tattrregR.ddl | 5 +- tools/testfiles/tattrreg_be.ls | 26 + tools/testfiles/tattrreg_le.ls | 26 + tools/testfiles/tbigdims.ddl | 3 - tools/testfiles/tbitfields.h5.xml | 66 +- tools/testfiles/tboot1.ddl | 9 +- tools/testfiles/tboot2.ddl | 9 +- tools/testfiles/tchar1.ddl | 13 +- tools/testfiles/tchunked.ddl | 7 +- tools/testfiles/tcomp-1.ddl | 3 - tools/testfiles/tcomp-1.ls | 3 - tools/testfiles/tcomp-2.ddl | 3 - tools/testfiles/tcomp-3.ddl | 3 - tools/testfiles/tcomp-4.ddl | 3 - tools/testfiles/tcompact.ddl | 5 +- tools/testfiles/tcompound.h5.xml | 157 +- tools/testfiles/tcompound2.h5.xml | 41 +- tools/testfiles/tcompound_complex.h5.xml | 51 +- tools/testfiles/tcontents.ddl | 3 - tools/testfiles/tcontiguos.ddl | 5 +- tools/testfiles/tdatareg.ddl | 3 - tools/testfiles/tdatareg.h5.xml | 123 +- tools/testfiles/tdataregR.ddl | 5 +- tools/testfiles/tdataregbe.ls | 3 - tools/testfiles/tdataregle.ls | 3 - tools/testfiles/tdeflate.ddl | 7 +- tools/testfiles/tdset-1.ddl | 3 - tools/testfiles/tdset-1.ls | 3 - tools/testfiles/tdset-2.ddl | 39 +- tools/testfiles/tdset-3s.ddl | 3 - tools/testfiles/tdset.h5.xml | 903 +- tools/testfiles/tdset2.h5.xml | 549 +- tools/testfiles/tdset_idx.ls | 3 - tools/testfiles/tempty-dtd-2.h5.xml | 50 +- tools/testfiles/tempty-dtd-uri.h5.xml | 48 +- tools/testfiles/tempty-dtd.h5.xml | 50 +- tools/testfiles/tempty-nons-2.h5.xml | 50 +- tools/testfiles/tempty-nons-uri.h5.xml | 48 +- tools/testfiles/tempty-nons.h5.xml | 50 +- tools/testfiles/tempty-ns-2.h5.xml | 50 +- tools/testfiles/tempty-ns.h5.xml | 50 +- tools/testfiles/tempty.ddl | 3 - tools/testfiles/tempty.h5.xml | 50 +- tools/testfiles/tempty.ls | 3 - tools/testfiles/tenum.h5.xml | 33 +- tools/testfiles/texternal.ddl | 5 +- tools/testfiles/textlink-1.ls | 3 - tools/testfiles/textlink.ddl | 53 +- tools/testfiles/textlink.h5.xml | 5 +- tools/testfiles/textlinkfar.ddl | 22 +- tools/testfiles/textlinksrc-1-old.ls | 7 +- tools/testfiles/textlinksrc-1.ls | 7 +- tools/testfiles/textlinksrc-2-old.ls | 3 - tools/testfiles/textlinksrc-2.ls | 3 - tools/testfiles/textlinksrc-3-old.ls | 5 +- tools/testfiles/textlinksrc-3.ls | 5 +- tools/testfiles/textlinksrc-4.ls | 5 +- tools/testfiles/textlinksrc-5.ls | 3 - tools/testfiles/textlinksrc-6-old.ls | 5 +- tools/testfiles/textlinksrc-6.ls | 5 +- tools/testfiles/textlinksrc-7-old.ls | 3 - tools/testfiles/textlinksrc-7.ls | 3 - tools/testfiles/textlinksrc-nodangle-1.ls | 3 - tools/testfiles/textlinksrc-nodangle-2.ls | 5 +- tools/testfiles/textlinksrc.ddl | 22 +- tools/testfiles/textlinksrc.h5 | Bin 1104 -> 1224 bytes tools/testfiles/tfamily.ddl | 3 - tools/testfiles/tfill.ddl | 21 +- tools/testfiles/tfletcher32.ddl | 7 +- tools/testfiles/tfpformat.ddl | 17 +- tools/testfiles/tfpformat.h5.xml | 27 +- tools/testfiles/tgroup-1.ddl | 3 - tools/testfiles/tgroup-1.ls | 3 - tools/testfiles/tgroup-2.ddl | 3 - tools/testfiles/tgroup-2.ls | 3 - tools/testfiles/tgroup-3.ls | 3 - tools/testfiles/tgroup.h5.xml | 5 +- tools/testfiles/tgroup.ls | 3 - tools/testfiles/tgrp_comments.ddl | 3 - tools/testfiles/tgrp_comments.ls | 3 - tools/testfiles/thlink-1.ddl | 3 - tools/testfiles/thlink-1.ls | 3 - tools/testfiles/thlink-2.ddl | 3 - tools/testfiles/thlink-3.ddl | 3 - tools/testfiles/thlink-4.ddl | 3 - tools/testfiles/thlink-5.ddl | 3 - tools/testfiles/thlink.h5.xml | 19 +- tools/testfiles/thlinks-nodangle-1.ls | 3 - tools/testfiles/thyperslab.ddl | 415 +- tools/testfiles/tindicesno.ddl | 3 - tools/testfiles/tindicessub1.ddl | 3 - tools/testfiles/tindicessub2.ddl | 3 - tools/testfiles/tindicessub3.ddl | 3 - tools/testfiles/tindicessub4.ddl | 3 - tools/testfiles/tindicesyes.ddl | 3 - tools/testfiles/tlarge_objname.ddl | 3 - tools/testfiles/tlonglinks.ddl | 3 - tools/testfiles/tloop-1.ddl | 3 - tools/testfiles/tloop-1.ls | 3 - tools/testfiles/tloop.h5.xml | 9 +- tools/testfiles/tloop2.h5.xml | 7 +- tools/testfiles/tmany.h5.xml | 401 +- tools/testfiles/tmulti.ddl | 3 - tools/testfiles/tmultifile.ddl | 42 + tools/testfiles/tmultifile.ls | 6 + tools/testfiles/tname-amp.h5.xml | 130 +- tools/testfiles/tname-apos.h5.xml | 130 +- tools/testfiles/tname-gt.h5.xml | 130 +- tools/testfiles/tname-lt.h5.xml | 130 +- tools/testfiles/tname-quot.h5.xml | 130 +- tools/testfiles/tname-sp.h5.xml | 130 +- tools/testfiles/tnamed_dtype_attr.ddl | 5 - tools/testfiles/tnamed_dtype_attr.h5.xml | 9 +- tools/testfiles/tnbit.ddl | 7 +- tools/testfiles/tnestcomp-1.ddl | 3 - tools/testfiles/tnestcomp-1.ls | 3 - tools/testfiles/tnestcomp-2.ls | 3 - tools/testfiles/tnestcomp-3.ls | 3 - tools/testfiles/tnestcomp-4.ls | 3 - tools/testfiles/tnestedcomp.h5.xml | 24 +- tools/testfiles/tno-subset.ddl | 9 + tools/testfiles/tno-subset.h5 | Bin 0 -> 1400 bytes tools/testfiles/tnodata.h5.xml | 15 +- tools/testfiles/tnofilename-with-packed-bits.ddl | 101 + tools/testfiles/tnofilename.ddl | 87 - tools/testfiles/tnullspace.ddl | 3 - tools/testfiles/tobjref.h5.xml | 27 +- tools/testfiles/topaque.h5.xml | 9 +- tools/testfiles/torderattr1.ddl | 5 - tools/testfiles/torderattr1.h5.xml | 13 +- tools/testfiles/torderattr2.ddl | 5 - tools/testfiles/torderattr2.h5.xml | 13 +- tools/testfiles/torderattr3.ddl | 5 - tools/testfiles/torderattr3.h5.xml | 13 +- tools/testfiles/torderattr4.ddl | 5 - tools/testfiles/torderattr4.h5.xml | 13 +- tools/testfiles/tordergr1.ddl | 3 - tools/testfiles/tordergr2.ddl | 3 - tools/testfiles/tordergr3.ddl | 3 - tools/testfiles/tordergr4.ddl | 3 - tools/testfiles/tordergr5.ddl | 3 - tools/testfiles/tpbitsArray.ddl | 14 + tools/testfiles/tpbitsCharLengthExceeded.ddl | 18 + tools/testfiles/tpbitsCharOffsetExceeded.ddl | 18 + tools/testfiles/tpbitsCompound.ddl | 66 + tools/testfiles/tpbitsIncomplete.ddl | 101 + tools/testfiles/tpbitsIntLengthExceeded.ddl | 18 + tools/testfiles/tpbitsIntOffsetExceeded.ddl | 18 + tools/testfiles/tpbitsLengthExceeded.ddl | 101 + tools/testfiles/tpbitsLengthPositive.ddl | 101 + tools/testfiles/tpbitsLongLengthExceeded.ddl | 26 + tools/testfiles/tpbitsLongOffsetExceeded.ddl | 26 + tools/testfiles/tpbitsMax.ddl | 94 + tools/testfiles/tpbitsMaxExceeded.ddl | 101 + tools/testfiles/tpbitsOffsetExceeded.ddl | 101 + tools/testfiles/tpbitsOffsetNegative.ddl | 101 + tools/testfiles/tpbitsOverlapped.ddl | 50 + tools/testfiles/tpbitsSigned.ddl | 28 + tools/testfiles/tpbitsSigned2.ddl | 50 + tools/testfiles/tpbitsSigned4.ddl | 28 + tools/testfiles/tpbitsSignedInt.ddl | 28 + tools/testfiles/tpbitsSignedInt4.ddl | 50 + tools/testfiles/tpbitsSignedInt8.ddl | 34 + tools/testfiles/tpbitsSignedIntWhole.ddl | 25 + tools/testfiles/tpbitsSignedLong.ddl | 44 + tools/testfiles/tpbitsSignedLong16.ddl | 67 + tools/testfiles/tpbitsSignedLong8.ddl | 96 + tools/testfiles/tpbitsSignedLongLong.ddl | 68 + tools/testfiles/tpbitsSignedLongLong16.ddl | 196 + tools/testfiles/tpbitsSignedLongLong32.ddl | 175 + tools/testfiles/tpbitsSignedLongLongWhole.ddl | 121 + tools/testfiles/tpbitsSignedLongLongWhole1.ddl | 175 + tools/testfiles/tpbitsSignedLongLongWhole63.ddl | 172 + tools/testfiles/tpbitsSignedLongWhole.ddl | 46 + tools/testfiles/tpbitsSignedWhole.ddl | 17 + tools/testfiles/tpbitsUnsigned.ddl | 28 + tools/testfiles/tpbitsUnsigned2.ddl | 50 + tools/testfiles/tpbitsUnsigned4.ddl | 28 + tools/testfiles/tpbitsUnsignedInt.ddl | 28 + tools/testfiles/tpbitsUnsignedInt4.ddl | 50 + tools/testfiles/tpbitsUnsignedInt8.ddl | 34 + tools/testfiles/tpbitsUnsignedIntWhole.ddl | 25 + tools/testfiles/tpbitsUnsignedLong.ddl | 44 + tools/testfiles/tpbitsUnsignedLong16.ddl | 67 + tools/testfiles/tpbitsUnsignedLong8.ddl | 96 + tools/testfiles/tpbitsUnsignedLongLong.ddl | 68 + tools/testfiles/tpbitsUnsignedLongLong16.ddl | 196 + tools/testfiles/tpbitsUnsignedLongLong32.ddl | 175 + tools/testfiles/tpbitsUnsignedLongLongWhole.ddl | 176 + tools/testfiles/tpbitsUnsignedLongLongWhole1.ddl | 175 + tools/testfiles/tpbitsUnsignedLongLongWhole63.ddl | 172 + tools/testfiles/tpbitsUnsignedLongWhole.ddl | 59 + tools/testfiles/tpbitsUnsignedWhole.ddl | 17 + tools/testfiles/tperror.ddl | 39 +- tools/testfiles/tqmarkfile.ddl | 83 + tools/testfiles/tref-escapes-at.h5.xml | 142 +- tools/testfiles/tref-escapes.h5.xml | 72 +- tools/testfiles/tref.h5.xml | 27 +- tools/testfiles/treference.ddl | 279 +- tools/testfiles/tsaf.ddl | 3 - tools/testfiles/tsaf.h5.xml | 6740 ++++++++++- tools/testfiles/tsaf.ls | 3 - tools/testfiles/tscaleoffset.ddl | 7 +- tools/testfiles/tshuffle.ddl | 7 +- tools/testfiles/tslink-1.ddl | 3 - tools/testfiles/tslink-1.ls | 3 - tools/testfiles/tslink-2.ddl | 3 - tools/testfiles/tslink-D.ddl | 30 + tools/testfiles/tslink.h5.xml | 5 +- tools/testfiles/tsoftlinks-1.ls | 3 - tools/testfiles/tsoftlinks-2.ls | 3 - tools/testfiles/tsoftlinks-3.ls | 3 - tools/testfiles/tsoftlinks-4.ls | 3 - tools/testfiles/tsoftlinks-5.ls | 3 - tools/testfiles/tsoftlinks-nodangle-1.ls | 3 - tools/testfiles/tsplit_file.ddl | 13 +- tools/testfiles/tstarfile.ddl | 89 + tools/testfiles/tstr-1.ddl | 43 +- tools/testfiles/tstr-1.ls | 3 - tools/testfiles/tstr-2.ddl | 73 +- tools/testfiles/tstr.h5.xml | 223 +- tools/testfiles/tstr2.h5.xml | 29 +- tools/testfiles/tstring-at.h5.xml | 9 +- tools/testfiles/tstring.ddl | 23 +- tools/testfiles/tstring.h5.xml | 9 +- tools/testfiles/tstring2.ddl | 7 +- tools/testfiles/tstringe.ddl | 23 +- tools/testfiles/tszip.ddl | 7 +- tools/testfiles/tudlink-1.ddl | 3 - tools/testfiles/tudlink-1.ls | 3 - tools/testfiles/tudlink-2.ddl | 3 - tools/testfiles/tudlink.h5.xml | 5 +- tools/testfiles/tuserfilter.ddl | 20 +- tools/testfiles/tvldtypes1.ddl | 3 - tools/testfiles/tvldtypes1.h5.xml | 27 +- tools/testfiles/tvldtypes1.ls | 3 - tools/testfiles/tvldtypes2.ddl | 3 - tools/testfiles/tvldtypes2.h5.xml | 13 +- tools/testfiles/tvldtypes2be.ls | 3 - tools/testfiles/tvldtypes2le.ls | 3 - tools/testfiles/tvldtypes3.ddl | 3 - tools/testfiles/tvldtypes3.h5.xml | 14 +- tools/testfiles/tvldtypes4.ddl | 3 - tools/testfiles/tvldtypes4.h5.xml | 19 +- tools/testfiles/tvldtypes5.ddl | 3 - tools/testfiles/tvldtypes5.h5.xml | 20 +- tools/testfiles/tvlstr.ddl | 24 +- tools/testfiles/tvlstr.h5.xml | 15 +- tools/testfiles/tvms.ddl | 3 - tools/testfiles/zerodim.ddl | 16 + tools/testfiles/zerodim.h5 | Bin 0 -> 1528 bytes vms/src/h5pubconf.h | 149 +- vms/src/make.com | 8 +- vms/test/H5srcdir_str.h | 2 +- vms/test/check.com | 7 + vms/test/make.com | 6 + windows/proj/hdf5_hl_cpp/hdf5_hl_cpp.vcproj | 656 +- windows/src/H5pubconf.h | 143 +- windows/tools/h5diff/testh5diff.bat | 67 +- windows/tools/h5dump/testh5dump.bat | 83 +- windows/tools/h5import/h5importtestutil.bat | 27 +- 1157 files changed, 133208 insertions(+), 66934 deletions(-) mode change 100755 => 100644 Makefile.am create mode 100644 bin/output_filter.sh create mode 100644 config/cmake/CPack.cmake delete mode 100644 config/cmake/CTest.cmake create mode 100644 config/cmake/HDFLibMacros.cmake create mode 100644 config/cmake/NSIS.InstallOptions.ini.in create mode 100644 config/cmake/NSIS.template.in create mode 100644 config/cmake/prunTest.cmake delete mode 100644 config/mpich create mode 100644 fortran/doc/DevelGuide/masterindex.html create mode 100644 fortran/doc/DevelGuide/robo_functions.html create mode 100644 fortran/doc/DevelGuide/robo_modules.html create mode 100644 fortran/doc/DevelGuide/robo_programs.html create mode 100644 fortran/doc/DevelGuide/robo_sourcefiles.html create mode 100644 fortran/doc/DevelGuide/robo_subroutines.html create mode 100644 fortran/doc/DevelGuide/robodoc.css create mode 100644 fortran/doc/DevelGuide/src/H5Af_c.html create mode 100644 fortran/doc/DevelGuide/src/H5Aff_F03_f90.html create mode 100644 fortran/doc/DevelGuide/src/H5Aff_F90_f90.html create mode 100644 fortran/doc/DevelGuide/src/H5Aff_f90.html create mode 100644 fortran/doc/DevelGuide/src/H5Df_c.html create mode 100644 fortran/doc/DevelGuide/src/H5Dff_F03_f90.html create mode 100644 fortran/doc/DevelGuide/src/H5Dff_F90_f90.html create mode 100644 fortran/doc/DevelGuide/src/H5Dff_f90.html create mode 100644 fortran/doc/DevelGuide/src/H5Ef_c.html create mode 100644 fortran/doc/DevelGuide/src/H5Eff_f90.html create mode 100644 fortran/doc/DevelGuide/src/H5FDmpiof_c.html create mode 100644 fortran/doc/DevelGuide/src/H5FDmpioff_f90.html create mode 100644 fortran/doc/DevelGuide/src/H5Ff_c.html create mode 100644 fortran/doc/DevelGuide/src/H5Fff_f90.html create mode 100644 fortran/doc/DevelGuide/src/H5Gf_c.html create mode 100644 fortran/doc/DevelGuide/src/H5Gff_f90.html create mode 100644 fortran/doc/DevelGuide/src/H5If_c.html create mode 100644 fortran/doc/DevelGuide/src/H5Iff_f90.html create mode 100644 fortran/doc/DevelGuide/src/H5Lf_c.html create mode 100644 fortran/doc/DevelGuide/src/H5Lff_F03_f90.html create mode 100644 fortran/doc/DevelGuide/src/H5Lff_F90_f90.html create mode 100644 fortran/doc/DevelGuide/src/H5Lff_f90.html create mode 100644 fortran/doc/DevelGuide/src/H5Of_c.html create mode 100644 fortran/doc/DevelGuide/src/H5Off_f90.html create mode 100644 fortran/doc/DevelGuide/src/H5Pf_c.html create mode 100644 fortran/doc/DevelGuide/src/H5Pff_F03_f90.html create mode 100644 fortran/doc/DevelGuide/src/H5Pff_F90_f90.html create mode 100644 fortran/doc/DevelGuide/src/H5Pff_f90.html create mode 100644 fortran/doc/DevelGuide/src/H5Rf_c.html create mode 100644 fortran/doc/DevelGuide/src/H5Rff_F03_f90.html create mode 100644 fortran/doc/DevelGuide/src/H5Rff_F90_f90.html create mode 100644 fortran/doc/DevelGuide/src/H5Rff_f90.html create mode 100644 fortran/doc/DevelGuide/src/H5Sf_c.html create mode 100644 fortran/doc/DevelGuide/src/H5Sff_f90.html create mode 100644 fortran/doc/DevelGuide/src/H5Tf_c.html create mode 100644 fortran/doc/DevelGuide/src/H5Tff_f90.html create mode 100644 fortran/doc/DevelGuide/src/H5Zf_c.html create mode 100644 fortran/doc/DevelGuide/src/H5Zff_f90.html create mode 100644 fortran/doc/DevelGuide/src/H5_DBLE_InterfaceExclude_f90.html create mode 100644 fortran/doc/DevelGuide/src/H5_DBLE_InterfaceInclude_f90.html create mode 100644 fortran/doc/DevelGuide/src/H5_f_c.html create mode 100644 fortran/doc/DevelGuide/src/H5_ff_F03_f90.html create mode 100644 fortran/doc/DevelGuide/src/H5_ff_F90_f90.html create mode 100644 fortran/doc/DevelGuide/src/H5_ff_f90.html create mode 100644 fortran/doc/DevelGuide/src/H5f90global_f90.html create mode 100644 fortran/doc/DevelGuide/src/H5f90kit_c.html create mode 100644 fortran/doc/DevelGuide/src/H5match_types_c.html create mode 100644 fortran/doc/DevelGuide/src/H5test_kind_SIZEOF_f90.html create mode 100644 fortran/doc/DevelGuide/src/H5test_kind_f90.html create mode 100644 fortran/doc/DevelGuide/src/HDF5_f90.html create mode 100644 fortran/doc/DevelGuide/src/HDF5mpio_f90.html create mode 100644 fortran/doc/DevelGuide/test/fflush1_f90.html create mode 100644 fortran/doc/DevelGuide/test/fflush2_f90.html create mode 100644 fortran/doc/DevelGuide/test/fortranlib_test_1_8_f90.html create mode 100644 fortran/doc/DevelGuide/test/fortranlib_test_F03_f90.html create mode 100644 fortran/doc/DevelGuide/test/fortranlib_test_f90.html create mode 100644 fortran/doc/DevelGuide/test/tF2003_f90.html create mode 100644 fortran/doc/DevelGuide/test/tH5A_1_8_f90.html create mode 100644 fortran/doc/DevelGuide/test/tH5A_f90.html create mode 100644 fortran/doc/DevelGuide/test/tH5D_f90.html create mode 100644 fortran/doc/DevelGuide/test/tH5E_f90.html create mode 100644 fortran/doc/DevelGuide/test/tH5F_f90.html create mode 100644 fortran/doc/DevelGuide/test/tH5G_1_8_f90.html create mode 100644 fortran/doc/DevelGuide/test/tH5G_f90.html create mode 100644 fortran/doc/DevelGuide/test/tH5I_f90.html create mode 100644 fortran/doc/DevelGuide/test/tH5O_f90.html create mode 100644 fortran/doc/DevelGuide/test/tH5P_f90.html create mode 100644 fortran/doc/DevelGuide/test/tH5R_f90.html create mode 100644 fortran/doc/DevelGuide/test/tH5S_f90.html create mode 100644 fortran/doc/DevelGuide/test/tH5Sselect_f90.html create mode 100644 fortran/doc/DevelGuide/test/tH5T_f90.html create mode 100644 fortran/doc/DevelGuide/test/tH5VL_f90.html create mode 100644 fortran/doc/DevelGuide/test/tH5Z_f90.html create mode 100644 fortran/doc/DevelGuide/test/t_c.html create mode 100644 fortran/doc/DevelGuide/test/tf_f90.html create mode 100644 fortran/doc/DevelGuide/toc_index.html create mode 100644 fortran/examples/compound_complex_fortran2003.f90 create mode 100644 fortran/examples/compound_fortran2003.f90 create mode 100644 fortran/examples/nested_derived_type.f90 create mode 100644 fortran/examples/rwdset_fortran2003.f90 create mode 100644 fortran/robodoc.rc create mode 100644 fortran/src/H5Aff_F03.f90 create mode 100644 fortran/src/H5Aff_F90.f90 create mode 100644 fortran/src/H5Dff_F03.f90 create mode 100644 fortran/src/H5Dff_F90.f90 create mode 100644 fortran/src/H5Eff_F03.f90 create mode 100644 fortran/src/H5Eff_F90.f90 create mode 100644 fortran/src/H5Lff_F03.f90 create mode 100644 fortran/src/H5Lff_F90.f90 create mode 100644 fortran/src/H5Off_F03.f90 create mode 100644 fortran/src/H5Off_F90.f90 create mode 100644 fortran/src/H5Pff_F03.f90 create mode 100644 fortran/src/H5Pff_F90.f90 create mode 100644 fortran/src/H5Rff_F03.f90 create mode 100644 fortran/src/H5Rff_F90.f90 create mode 100644 fortran/src/H5Tff_F03.f90 create mode 100644 fortran/src/H5Tff_F90.f90 create mode 100644 fortran/src/H5_ff_F03.f90 create mode 100644 fortran/src/H5_ff_F90.f90 create mode 100644 fortran/src/phdf5_fortrandll.def create mode 100644 fortran/test/fortranlib_test_F03.f90 create mode 100644 fortran/test/tH5E_F03.f90 create mode 100644 fortran/test/tH5L_F03.f90 create mode 100644 fortran/test/tH5P_F03.f90 create mode 100644 fortran/test/tH5T_F03.f90 create mode 100644 hl/fortran/examples/ex_ds1.f90 create mode 100755 hl/fortran/src/H5DSfc.c create mode 100755 hl/fortran/src/H5DSff.f90 create mode 100644 hl/fortran/test/tstds.f90 mode change 100755 => 100644 release_docs/CMake.txt mode change 100755 => 100644 release_docs/COPYING mode change 100755 => 100644 release_docs/INSTALL_Windows_From_Command_Line.txt mode change 100755 => 100644 release_docs/INSTALL_Windows_Short_NET.TXT mode change 100755 => 100644 release_docs/INSTALL_Windows_Short_VS2005.TXT mode change 100755 => 100644 release_docs/INSTALL_Windows_Short_VS2008.TXT create mode 100644 release_docs/Using_CMake.txt mode change 100755 => 100644 src/COPYING create mode 100644 src/H5Fcwfs.c create mode 100644 src/H5HGquery.c create mode 100644 test/filter_error.h5 create mode 100644 test/multi_file_v16-r.h5 create mode 100644 test/multi_file_v16-s.h5 delete mode 100644 test/vms_data.h5 create mode 100644 tools/h5diff/testfiles/compounds_array_vlen1.h5 create mode 100644 tools/h5diff/testfiles/compounds_array_vlen2.h5 create mode 100644 tools/h5diff/testfiles/h5diff_208.txt create mode 100644 tools/h5diff/testfiles/h5diff_220.txt create mode 100644 tools/h5diff/testfiles/h5diff_221.txt create mode 100644 tools/h5diff/testfiles/h5diff_222.txt create mode 100644 tools/h5diff/testfiles/h5diff_30.txt create mode 100644 tools/h5diff/testfiles/h5diff_465.txt create mode 100644 tools/h5diff/testfiles/h5diff_466.txt create mode 100644 tools/h5diff/testfiles/h5diff_467.txt create mode 100644 tools/h5diff/testfiles/h5diff_468.txt create mode 100644 tools/h5diff/testfiles/h5diff_469.txt create mode 100644 tools/h5diff/testfiles/h5diff_540.txt create mode 100644 tools/h5diff/testfiles/h5diff_630.txt create mode 100644 tools/h5diff/testfiles/h5diff_631.txt create mode 100644 tools/h5diff/testfiles/h5diff_640.txt create mode 100644 tools/h5diff/testfiles/h5diff_641.txt create mode 100644 tools/h5diff/testfiles/h5diff_642.txt create mode 100644 tools/h5diff/testfiles/h5diff_643.txt create mode 100644 tools/h5diff/testfiles/h5diff_644.txt create mode 100644 tools/h5diff/testfiles/h5diff_645.txt create mode 100644 tools/h5diff/testfiles/h5diff_646.txt create mode 100644 tools/h5diff/testfiles/h5diff_dset_zero_dim_size1.h5 create mode 100644 tools/h5diff/testfiles/h5diff_dset_zero_dim_size2.h5 create mode 100755 tools/h5diff/testfiles/h5diff_enum_invalid_values.h5 create mode 100644 tools/h5diff/testfiles/non_comparables1.h5 create mode 100644 tools/h5diff/testfiles/non_comparables2.h5 create mode 100644 tools/h5dump/h5dump_ddl.c create mode 100644 tools/h5dump/h5dump_ddl.h create mode 100644 tools/h5dump/h5dump_defines.h create mode 100644 tools/h5dump/h5dump_extern.h create mode 100644 tools/h5dump/h5dump_xml.c create mode 100644 tools/h5dump/h5dump_xml.h delete mode 100644 tools/h5import/testfiles/in64.txt delete mode 100644 tools/h5import/testfiles/test15.h5 create mode 100644 tools/h5import/testfiles/textpfe.h5 create mode 100644 tools/h5import/testfiles/textpfe64.txt create mode 100644 tools/h5jam/testfiles/h5jam-help.txt create mode 100644 tools/h5jam/testfiles/h5jam-ub-nohdf5.txt create mode 100644 tools/h5jam/testfiles/h5unjam-help.txt create mode 100644 tools/lib/h5tools_dump.c create mode 100644 tools/lib/h5tools_dump.h create mode 100644 tools/testfiles/h5dump-help.txt create mode 100644 tools/testfiles/tattr-4_be.ddl create mode 100644 tools/testfiles/tattr4_be.h5 create mode 100644 tools/testfiles/tattrreg_be.ls create mode 100644 tools/testfiles/tattrreg_le.ls create mode 100644 tools/testfiles/tmultifile.ddl create mode 100644 tools/testfiles/tmultifile.ls create mode 100644 tools/testfiles/tno-subset.ddl create mode 100644 tools/testfiles/tno-subset.h5 create mode 100644 tools/testfiles/tnofilename-with-packed-bits.ddl delete mode 100644 tools/testfiles/tnofilename.ddl create mode 100644 tools/testfiles/tpbitsArray.ddl create mode 100644 tools/testfiles/tpbitsCharLengthExceeded.ddl create mode 100644 tools/testfiles/tpbitsCharOffsetExceeded.ddl create mode 100644 tools/testfiles/tpbitsCompound.ddl create mode 100644 tools/testfiles/tpbitsIncomplete.ddl create mode 100644 tools/testfiles/tpbitsIntLengthExceeded.ddl create mode 100644 tools/testfiles/tpbitsIntOffsetExceeded.ddl create mode 100644 tools/testfiles/tpbitsLengthExceeded.ddl create mode 100644 tools/testfiles/tpbitsLengthPositive.ddl create mode 100644 tools/testfiles/tpbitsLongLengthExceeded.ddl create mode 100644 tools/testfiles/tpbitsLongOffsetExceeded.ddl create mode 100644 tools/testfiles/tpbitsMax.ddl create mode 100644 tools/testfiles/tpbitsMaxExceeded.ddl create mode 100644 tools/testfiles/tpbitsOffsetExceeded.ddl create mode 100644 tools/testfiles/tpbitsOffsetNegative.ddl create mode 100644 tools/testfiles/tpbitsOverlapped.ddl create mode 100644 tools/testfiles/tpbitsSigned.ddl create mode 100644 tools/testfiles/tpbitsSigned2.ddl create mode 100644 tools/testfiles/tpbitsSigned4.ddl create mode 100644 tools/testfiles/tpbitsSignedInt.ddl create mode 100644 tools/testfiles/tpbitsSignedInt4.ddl create mode 100644 tools/testfiles/tpbitsSignedInt8.ddl create mode 100644 tools/testfiles/tpbitsSignedIntWhole.ddl create mode 100644 tools/testfiles/tpbitsSignedLong.ddl create mode 100644 tools/testfiles/tpbitsSignedLong16.ddl create mode 100644 tools/testfiles/tpbitsSignedLong8.ddl create mode 100644 tools/testfiles/tpbitsSignedLongLong.ddl create mode 100644 tools/testfiles/tpbitsSignedLongLong16.ddl create mode 100644 tools/testfiles/tpbitsSignedLongLong32.ddl create mode 100644 tools/testfiles/tpbitsSignedLongLongWhole.ddl create mode 100644 tools/testfiles/tpbitsSignedLongLongWhole1.ddl create mode 100644 tools/testfiles/tpbitsSignedLongLongWhole63.ddl create mode 100644 tools/testfiles/tpbitsSignedLongWhole.ddl create mode 100644 tools/testfiles/tpbitsSignedWhole.ddl create mode 100644 tools/testfiles/tpbitsUnsigned.ddl create mode 100644 tools/testfiles/tpbitsUnsigned2.ddl create mode 100644 tools/testfiles/tpbitsUnsigned4.ddl create mode 100644 tools/testfiles/tpbitsUnsignedInt.ddl create mode 100644 tools/testfiles/tpbitsUnsignedInt4.ddl create mode 100644 tools/testfiles/tpbitsUnsignedInt8.ddl create mode 100644 tools/testfiles/tpbitsUnsignedIntWhole.ddl create mode 100644 tools/testfiles/tpbitsUnsignedLong.ddl create mode 100644 tools/testfiles/tpbitsUnsignedLong16.ddl create mode 100644 tools/testfiles/tpbitsUnsignedLong8.ddl create mode 100644 tools/testfiles/tpbitsUnsignedLongLong.ddl create mode 100644 tools/testfiles/tpbitsUnsignedLongLong16.ddl create mode 100644 tools/testfiles/tpbitsUnsignedLongLong32.ddl create mode 100644 tools/testfiles/tpbitsUnsignedLongLongWhole.ddl create mode 100644 tools/testfiles/tpbitsUnsignedLongLongWhole1.ddl create mode 100644 tools/testfiles/tpbitsUnsignedLongLongWhole63.ddl create mode 100644 tools/testfiles/tpbitsUnsignedLongWhole.ddl create mode 100644 tools/testfiles/tpbitsUnsignedWhole.ddl create mode 100644 tools/testfiles/tqmarkfile.ddl create mode 100644 tools/testfiles/tslink-D.ddl create mode 100644 tools/testfiles/tstarfile.ddl create mode 100644 tools/testfiles/zerodim.ddl create mode 100644 tools/testfiles/zerodim.h5 mode change 100755 => 100644 windows/src/H5pubconf.h diff --git a/CMakeLists.txt b/CMakeLists.txt index d17ec97..fe8a5f8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8) +cmake_minimum_required (VERSION 2.8.6) PROJECT (HDF5 C CXX) #----------------------------------------------------------------------------- @@ -69,11 +69,21 @@ PROJECT (HDF5 C CXX) # # Add the sub project # ADD_SUBDIRECTORY(Utilities/hdf5-1.8) #----------------------------------------------------------------------------- -IF (BUILD_SHARED_LIBS) - SET (BUILD_NAME_EXT "SHARED") -ELSE (BUILD_SHARED_LIBS) - SET (BUILD_NAME_EXT "STATIC") -ENDIF (BUILD_SHARED_LIBS) + +#----------------------------------------------------------------------------- +# Allow Visual Studio solution directories +#----------------------------------------------------------------------------- +# Provide a way for Visual Studio Express users to turn OFF the new FOLDER +# organization feature. Default to ON for non-Express users. Express users must +# explicitly turn off this option to build HDF5 in the Express IDE... +# +OPTION (HDF5_USE_FOLDERS "Enable folder grouping of projects in IDEs." ON) +MARK_AS_ADVANCED (HDF5_USE_FOLDERS) +IF (HDF5_USE_FOLDERS) + SET_PROPERTY (GLOBAL PROPERTY USE_FOLDERS ON) +ENDIF (HDF5_USE_FOLDERS) +OPTION (HDF5_NO_PACKAGES "CPACK - Disable packaging" OFF) +MARK_AS_ADVANCED (HDF5_NO_PACKAGES) #----------------------------------------------------------------------------- # Set the core names of all the libraries @@ -163,6 +173,18 @@ STRING (REGEX REPLACE ".*#define[ \t]+H5_VERS_RELEASE[ \t]+([0-9]*).*$" #MESSAGE (STATUS "VERSION: ${H5_VERS_MAJOR}.${H5_VERS_MINOR}.${H5_VERS_RELEASE}-${H5_VERS_SUBRELEASE}") #----------------------------------------------------------------------------- +# parse the full soversion number from config/lt_vers.am and include in H5_SOVERS_INFO +#----------------------------------------------------------------------------- +FILE (READ ${HDF5_SOURCE_DIR}/config/lt_vers.am _lt_vers_am_contents) +STRING (REGEX REPLACE ".*LT_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" + "\\1" H5_SOVERS_MAJOR ${_lt_vers_am_contents}) +STRING (REGEX REPLACE ".*LT_VERS_REVISION[ \t]+=[ \t]+([0-9]*).*$" + "\\1" H5_SOVERS_MINOR ${_lt_vers_am_contents}) +STRING (REGEX REPLACE ".*LT_VERS_AGE[ \t]+=[ \t]+([0-9]*).*$" + "\\1" H5_SOVERS_RELEASE ${_lt_vers_am_contents}) +MESSAGE (STATUS "SOVERSION: ${H5_SOVERS_MAJOR}.${H5_SOVERS_MINOR}.${H5_SOVERS_RELEASE}") + +#----------------------------------------------------------------------------- # Basic HDF5 stuff here #----------------------------------------------------------------------------- SET (HDF5_PACKAGE "hdf5") @@ -171,6 +193,7 @@ SET (HDF5_PACKAGE_VERSION "${H5_VERS_MAJOR}.${H5_VERS_MINOR}.${H5_VERS_RELEASE}" SET (HDF5_PACKAGE_VERSION_MAJOR "${H5_VERS_MAJOR}.${H5_VERS_MINOR}") SET (HDF5_PACKAGE_VERSION_MINOR "${H5_VERS_RELEASE}") SET (HDF5_PACKAGE_VERSION_STRING "${HDF5_PACKAGE_VERSION}") +SET (HDF5_PACKAGE_SOVERSION "${H5_SOVERS_MAJOR}.${H5_SOVERS_MINOR}.${H5_SOVERS_RELEASE}") SET (HDF5_PACKAGE_STRING "${HDF5_PACKAGE_NAME} ${HDF5_PACKAGE_VERSION_STRING}") SET (HDF5_PACKAGE_TARNAME "hdf5") SET (HDF5_PACKAGE_URL "http://www.hdfgroup.org") @@ -180,6 +203,7 @@ SET (HDF5_PACKAGE_BUGREPORT "help@hdfgroup.org") # Include some macros for reusable code #----------------------------------------------------------------------------- INCLUDE (${HDF5_RESOURCES_DIR}/HDFMacros.cmake) +INCLUDE (${HDF5_RESOURCES_DIR}/HDFLibMacros.cmake) INCLUDE (${HDF5_RESOURCES_DIR}/HDF5Macros.cmake) #----------------------------------------------------------------------------- @@ -220,6 +244,9 @@ ENDIF (NOT HDF5_EXPORTED_TARGETS) # which include hdf5 as a sub-project within their build tree #----------------------------------------------------------------------------- SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "") +SET (EXTERNAL_HEADER_LIST "") +SET (EXTERNAL_LIBRARY_LIST "") +SET (EXTERNAL_LIBRARYDLL_LIST "") #----------------------------------------------------------------------------- # Run all the CMake configuration tests for our build environment @@ -227,22 +254,19 @@ SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "") INCLUDE (${HDF5_RESOURCES_DIR}/ConfigureChecks.cmake) #----------------------------------------------------------------------------- -# Option to use legacy naming for windows libs/programs, default is legacy -#----------------------------------------------------------------------------- -IF (WIN32 AND NOT CYGWIN) - OPTION (HDF_LEGACY_NAMING "Use Legacy Names for Libraries and Programs" OFF) -ENDIF (WIN32 AND NOT CYGWIN) - -#----------------------------------------------------------------------------- # Option to Build Shared/Static libs, default is static #----------------------------------------------------------------------------- OPTION (BUILD_SHARED_LIBS "Build Shared Libraries" OFF) SET (LIB_TYPE STATIC) +SET (H5_ENABLE_SHARED_LIB NO) +SET (H5_ENABLE_STATIC_LIB NO) IF (BUILD_SHARED_LIBS) SET (LIB_TYPE SHARED) SET (H5_BUILT_AS_DYNAMIC_LIB 1) + SET (H5_ENABLE_SHARED_LIB YES) ELSE (BUILD_SHARED_LIBS) SET (H5_BUILT_AS_STATIC_LIB 1) + SET (H5_ENABLE_STATIC_LIB YES) IF (NOT WIN32) # should this be a user setting : Everyone uses it anyway ? ADD_DEFINITIONS (-DPIC) @@ -349,8 +373,27 @@ ENDIF (CMAKE_BUILD_TYPE MATCHES Debug) # Compiler specific flags : Shouldn't there be compiler tests for these #----------------------------------------------------------------------------- IF (CMAKE_COMPILER_IS_GNUCC) - SET (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS} -std=c99 -fomit-frame-pointer -finline-functions -fno-common") + IF (CMAKE_BUILD_TYPE MATCHES Debug) + SET (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS} -std=c99 -finline-functions -fno-common") + ELSE (CMAKE_BUILD_TYPE MATCHES Debug) + SET (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS} -std=c99 -fomit-frame-pointer -finline-functions -fno-common") + ENDIF (CMAKE_BUILD_TYPE MATCHES Debug) ENDIF (CMAKE_COMPILER_IS_GNUCC) +IF (CMAKE_COMPILER_IS_GNUCXX) + IF (CMAKE_BUILD_TYPE MATCHES Debug) + SET (CMAKE_CXX_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_CXX_FLAGS} -finline-functions -fno-common") + ELSE (CMAKE_BUILD_TYPE MATCHES Debug) + SET (CMAKE_CXX_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_CXX_FLAGS} -fomit-frame-pointer -finline-functions -fno-common") + ENDIF (CMAKE_BUILD_TYPE MATCHES Debug) +ENDIF (CMAKE_COMPILER_IS_GNUCXX) + +#----------------------------------------------------------------------------- +# Option to embed library info into executables +#----------------------------------------------------------------------------- +OPTION (HDF5_ENABLE_EMBEDDED_LIBINFO "embed library info into executables" ON) +IF (HDF5_ENABLE_EMBEDDED_LIBINFO) + SET (H5_HAVE_EMBEDDED_LIBINFO 1) +ENDIF (HDF5_ENABLE_EMBEDDED_LIBINFO) #----------------------------------------------------------------------------- # Option to allow the user to disable compiler warnings @@ -361,9 +404,10 @@ IF (HDF5_DISABLE_COMPILER_WARNINGS) # warning level is given, so remove it. IF (MSVC) SET (HDF5_WARNINGS_BLOCKED 1) - STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " - CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") + STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /w") + STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /w") ENDIF (MSVC) IF (WIN32 AND NOT CYGWIN) ADD_DEFINITIONS (-D_CRT_SECURE_NO_WARNINGS) @@ -377,6 +421,7 @@ IF (HDF5_DISABLE_COMPILER_WARNINGS) # Most compilers use -w to suppress warnings. IF (NOT HDF5_WARNINGS_BLOCKED) SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w") + SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w") ENDIF (NOT HDF5_WARNINGS_BLOCKED) ENDIF (HDF5_DISABLE_COMPILER_WARNINGS) @@ -403,28 +448,25 @@ SET (CMAKE_MODULE_PATH ${HDF5_RESOURCES_DIR} ${CMAKE_MODULE_PATH}) OPTION (HDF5_ENABLE_PARALLEL "Enable parallel build (requires MPI)" OFF) IF (HDF5_ENABLE_PARALLEL) INCLUDE (FindMPI) - INCLUDE_DIRECTORIES (${MPI_INCLUDE_PATH}) - IF (MPI_FOUND) + INCLUDE_DIRECTORIES (${MPI_C_INCLUDE_PATH}) + IF (MPI_C_FOUND) SET (H5_HAVE_PARALLEL 1) - # MPI checks, only do these if MPI_FOUND is true, otherwise they always fail + # MPI checks, only do these if MPI_C_FOUND is true, otherwise they always fail # and once set, they are cached as false and not regenerated - SET (CMAKE_REQUIRED_LIBRARIES "${MPI_LIBRARY};${MPI_EXTRA_LIBRARY}" ) + SET (CMAKE_REQUIRED_LIBRARIES "${MPI_C_LIBRARIES}" ) CHECK_FUNCTION_EXISTS (MPI_File_get_size H5_HAVE_MPI_GET_SIZE) # Used by Fortran + MPI - CHECK_SYMBOL_EXISTS (MPI_Comm_c2f "${MPI_INCLUDE_PATH}/mpi.h" H5_HAVE_MPI_MULTI_LANG_Comm) - CHECK_SYMBOL_EXISTS (MPI_Info_c2f "${MPI_INCLUDE_PATH}/mpi.h" H5_HAVE_MPI_MULTI_LANG_Info) - ENDIF (MPI_FOUND) + CHECK_SYMBOL_EXISTS (MPI_Comm_c2f "${MPI_C_INCLUDE_PATH}/mpi.h" H5_HAVE_MPI_MULTI_LANG_Comm) + CHECK_SYMBOL_EXISTS (MPI_Info_c2f "${MPI_C_INCLUDE_PATH}/mpi.h" H5_HAVE_MPI_MULTI_LANG_Info) + ENDIF (MPI_C_FOUND) ENDIF (HDF5_ENABLE_PARALLEL) # Parallel IO usage requires MPI to be Linked and Included IF (H5_HAVE_PARALLEL) - SET (LINK_LIBS ${LINK_LIBS} ${MPI_LIBRARY}) - IF (MPI_LINK_FLAGS) - SET (CMAKE_EXE_LINKER_FLAGS ${MPI_LINK_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}) - ENDIF (MPI_LINK_FLAGS) - IF (MPI_EXTRA_LIBRARY) - SET (LINK_LIBS ${LINK_LIBS} ${MPI_EXTRA_LIBRARY}) - ENDIF (MPI_EXTRA_LIBRARY) + SET (LINK_LIBS ${LINK_LIBS} ${MPI_C_LIBRARIES}) + IF (MPI_C_LINK_FLAGS) + SET (CMAKE_EXE_LINKER_FLAGS ${MPI_C_LINK_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}) + ENDIF (MPI_C_LINK_FLAGS) ENDIF (H5_HAVE_PARALLEL) #----------------------------------------------------------------------------- @@ -437,12 +479,22 @@ IF (HDF5_USE_16_API_DEFAULT) ENDIF (HDF5_USE_16_API_DEFAULT) #----------------------------------------------------------------------------- +# Option to use 1.8.x API +#----------------------------------------------------------------------------- +OPTION (HDF5_USE_18_API_DEFAULT "Use the HDF5 1.8.x API by default" OFF) +SET (H5_USE_18_API_DEFAULT 0) +IF (HDF5_USE_18_API_DEFAULT) + SET (H5_USE_18_API_DEFAULT 1) +ENDIF (HDF5_USE_18_API_DEFAULT) + +#----------------------------------------------------------------------------- # Options for HDF5 Filters #----------------------------------------------------------------------------- MACRO (HDF5_SETUP_FILTERS FILTER) OPTION (HDF5_USE_FILTER_${FILTER} "Use the ${FILTER} Filter" ON) IF (HDF5_USE_FILTER_${FILTER}) SET (H5_HAVE_FILTER_${FILTER} 1) + SET (FILTERS "${FILTERS} ${FILTER}") ENDIF (HDF5_USE_FILTER_${FILTER}) # MESSAGE (STATUS "Filter ${FILTER} is ${HDF5_USE_FILTER_${FILTER}}") ENDMACRO (HDF5_SETUP_FILTERS) @@ -503,6 +555,9 @@ IF (HDF5_ENABLE_Z_LIB_SUPPORT) SET (H5_HAVE_ZLIB_H 1) SET (H5_HAVE_LIBZ 1) ENDIF (NOT H5_ZLIB_HEADER) + IF (H5_HAVE_FILTER_DEFLATE) + SET (EXTERNAL_FILTERS "${EXTERNAL_FILTERS} DEFLATE") + ENDIF (H5_HAVE_FILTER_DEFLATE) SET (LINK_LIBS ${LINK_LIBS} ${ZLIB_LIBRARIES}) INCLUDE_DIRECTORIES (${ZLIB_INCLUDE_DIRS}) MESSAGE (STATUS "Filter ZLIB is ON") @@ -511,7 +566,6 @@ ENDIF (HDF5_ENABLE_Z_LIB_SUPPORT) #----------------------------------------------------------------------------- # Option for SzLib support #----------------------------------------------------------------------------- -SET (CMAKE_MODULE_PATH ${HDF5_RESOURCES_DIR} ${CMAKE_MODULE_PATH}) OPTION (HDF5_ENABLE_SZIP_SUPPORT "Use SZip Filter" OFF) IF (HDF5_ENABLE_SZIP_SUPPORT) OPTION (HDF5_ENABLE_SZIP_ENCODING "Use SZip Encoding" OFF) @@ -537,8 +591,12 @@ IF (HDF5_ENABLE_SZIP_SUPPORT) SET (LINK_LIBS ${LINK_LIBS} ${SZIP_LIBRARIES}) INCLUDE_DIRECTORIES (${SZIP_INCLUDE_DIRS}) MESSAGE (STATUS "Filter SZIP is ON") + IF (H5_HAVE_FILTER_SZIP) + SET (EXTERNAL_FILTERS "${EXTERNAL_FILTERS} DECODE") + ENDIF (H5_HAVE_FILTER_SZIP) IF (HDF5_ENABLE_SZIP_ENCODING) SET (H5_HAVE_SZIP_ENCODER 1) + SET (EXTERNAL_FILTERS "${EXTERNAL_FILTERS} ENCODE") ENDIF (HDF5_ENABLE_SZIP_ENCODING) ENDIF (HDF5_ENABLE_SZIP_SUPPORT) @@ -548,53 +606,15 @@ ENDIF (HDF5_ENABLE_SZIP_SUPPORT) OPTION (HDF5_PACKAGE_EXTLIBS "CPACK - include external libraries" OFF) IF (NOT HDF5_EXTERNALLY_CONFIGURED) IF (HDF5_PACKAGE_EXTLIBS) - SET (EXTERNAL_HEADER_LIST "") - SET (EXTERNAL_LIBRARY_LIST "") - SET (EXTERNAL_LIBRARYDLL_LIST "") - FILE (MAKE_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${BLDTYPE}) - + SET (HDF5_NO_PACKAGES OFF CACHE BOOL "CPACK - Disable packaging" FORCE) IF (HDF5_ENABLE_Z_LIB_SUPPORT AND ZLIB_FOUND) - PACKAGE_ZLIB_LIBRARY (${HDF5_ALLOW_EXTERNAL_SUPPORT} ${LIB_TYPE}) + PACKAGE_ZLIB_LIBRARY (${HDF5_ALLOW_EXTERNAL_SUPPORT}) ENDIF (HDF5_ENABLE_Z_LIB_SUPPORT AND ZLIB_FOUND) IF (HDF5_ENABLE_SZIP_SUPPORT AND SZIP_FOUND) - PACKAGE_SZIP_LIBRARY (${HDF5_ALLOW_EXTERNAL_SUPPORT} ${LIB_TYPE}) + PACKAGE_SZIP_LIBRARY (${HDF5_ALLOW_EXTERNAL_SUPPORT}) ENDIF (HDF5_ENABLE_SZIP_SUPPORT AND SZIP_FOUND) ENDIF (HDF5_PACKAGE_EXTLIBS) - - IF (WIN32 AND NOT CYGWIN) - IF (BUILD_SHARED_LIBS) - FILE (MAKE_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${BLDTYPE}) - IF (HDF5_ENABLE_Z_LIB_SUPPORT AND ZLIB_FOUND) - GET_FILENAME_COMPONENT(ZLIB_DLL_NAME ${ZLIB_LIBRARY} NAME_WE) - # MESSAGE (STATUS "ZLIB_DLL_NAME: ${ZLIB_DLL_NAME}") - GET_FILENAME_COMPONENT(ZLIB_BIN_PATH ${ZLIB_LIBRARY} PATH) - # MESSAGE (STATUS "ZLIB_BIN_PATH: ${ZLIB_BIN_PATH}") - ADD_CUSTOM_TARGET (ZLIB-Release-Copy ALL - COMMAND ${CMAKE_COMMAND} -E copy_if_different ${ZLIB_BIN_PATH}/${ZLIB_DLL_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/ - COMMENT "Copying ${ZLIB_BIN_PATH}/${ZLIB_DLL_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX} to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/" - ) - IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") - ADD_DEPENDENCIES (ZLIB-Release-Copy ZLIB) - ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") - ENDIF (HDF5_ENABLE_Z_LIB_SUPPORT AND ZLIB_FOUND) - - IF (HDF5_ENABLE_SZIP_SUPPORT AND SZIP_FOUND) - GET_FILENAME_COMPONENT(SZIP_DLL_NAME ${SZIP_LIBRARY} NAME_WE) - # MESSAGE (STATUS "SZIP_DLL_NAME: ${SZIP_DLL_NAME}") - GET_FILENAME_COMPONENT(SZIP_BIN_PATH ${SZIP_LIBRARY} PATH) - # MESSAGE (STATUS "SZIP_BIN_PATH: ${SZIP_BIN_PATH}") - ADD_CUSTOM_TARGET (SZIP-Release-Copy ALL - COMMAND ${CMAKE_COMMAND} -E copy_if_different ${SZIP_BIN_PATH}/${SZIP_DLL_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/ - COMMENT "Copying ${SZIP_BIN_PATH}/${SZIP_DLL_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX} to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/" - ) - IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") - ADD_DEPENDENCIES (SZIP-Release-Copy SZIP) - ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") - ENDIF (HDF5_ENABLE_SZIP_SUPPORT AND SZIP_FOUND) - - ENDIF (BUILD_SHARED_LIBS) - ENDIF (WIN32 AND NOT CYGWIN) ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED) #----------------------------------------------------------------------------- @@ -609,21 +629,19 @@ IF (WIN32 AND NOT CYGWIN) MESSAGE (FATAL " **** Parallel and Threadsafe options are mutually exclusive **** ") ENDIF (HDF5_ENABLE_PARALLEL) SET (H5_HAVE_THREADSAFE 1) - SET (H5_HAVE_WIN_THREADS 1) - MESSAGE (STATUS " **** Windows Threads only available in WINVER>=0x600 (Vista or Windows 7)**** ") + IF (H5_HAVE_IOEO) + MESSAGE (STATUS " **** Windows Threads only available in WINVER>=0x600 (Vista or Windows 7) **** ") + SET (H5_HAVE_WIN_THREADS 1) + ELSE (H5_HAVE_IOEO) + IF (NOT H5_HAVE_PTHREAD_H) + SET (H5_HAVE_THREADSAFE 0) + MESSAGE (FATAL " **** Threadsafe option requires thread library **** ") + ENDIF (NOT H5_HAVE_PTHREAD_H) + ENDIF (H5_HAVE_IOEO) ENDIF (HDF5_ENABLE_THREADSAFE) ENDIF (WIN32 AND NOT CYGWIN) #----------------------------------------------------------------------------- -# Option to use PACKED BITS SUPPORT -#----------------------------------------------------------------------------- -OPTION (HDF5_USE_H5DUMP_PACKED_BITS "Use the PACKED BITS feature in h5dump" OFF) -SET (H5_HAVE_H5DUMP_PACKED_BITS 0) -IF (HDF5_USE_H5DUMP_PACKED_BITS) - SET (H5_HAVE_H5DUMP_PACKED_BITS 1) -ENDIF (HDF5_USE_H5DUMP_PACKED_BITS) - -#----------------------------------------------------------------------------- # Add the HDF5 Library Target to the build #----------------------------------------------------------------------------- ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/src ${PROJECT_BINARY_DIR}/src) @@ -693,6 +711,7 @@ SET (H5_FC_FUNC_ "H5_FC_FUNC_(name,NAME) name ## _") IF (EXISTS "${HDF5_SOURCE_DIR}/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/fortran") OPTION (HDF5_BUILD_FORTRAN "Build FORTRAN support" OFF) IF (HDF5_BUILD_FORTRAN) + OPTION (HDF5_ENABLE_F2003 "Enable FORTRAN 2003 Standard" OFF) INCLUDE (${HDF5_RESOURCES_DIR}/HDF5UseFortran.cmake) ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/fortran ${PROJECT_BINARY_DIR}/fortran) IF (HDF5_BUILD_HL_LIB) @@ -766,52 +785,14 @@ IF (NOT HDF5_INSTALL_NO_DEVELOPMENT) ENDIF (NOT HDF5_INSTALL_NO_DEVELOPMENT) #----------------------------------------------------------------------------- -# Option for external libraries -#----------------------------------------------------------------------------- -IF (NOT HDF5_EXTERNALLY_CONFIGURED) - IF (HDF5_PACKAGE_EXTLIBS) - IF (HDF5_ENABLE_Z_LIB_SUPPORT AND ZLIB_FOUND) - INSTALL ( - FILES ${ZLIB_INCLUDE_DIR}/zlib.h - DESTINATION ${HDF5_INSTALL_INCLUDE_DIR} - COMPONENT headers - ) - ENDIF (HDF5_ENABLE_Z_LIB_SUPPORT AND ZLIB_FOUND) - IF (HDF5_ENABLE_SZIP_SUPPORT AND SZIP_FOUND) - INSTALL ( - FILES ${SZIP_INCLUDE_DIR}/szlib.h ${SZIP_INCLUDE_DIR}/szip_adpt.h ${SZIP_INCLUDE_DIR}/ricehdf.h - DESTINATION ${HDF5_INSTALL_INCLUDE_DIR} - COMPONENT headers - ) - ENDIF (HDF5_ENABLE_SZIP_SUPPORT AND SZIP_FOUND) - INSTALL ( - FILES ${EXTERNAL_HEADER_LIST} - DESTINATION ${HDF5_INSTALL_INCLUDE_DIR} - COMPONENT headers - ) - INSTALL( - FILES ${EXTERNAL_LIBRARY_LIST} - DESTINATION ${HDF5_INSTALL_LIB_DIR} - COMPONENT libraries - ) - IF (WIN32 AND BUILD_SHARED_LIBS) - INSTALL( - FILES ${EXTERNAL_LIBRARYDLL_LIST} - DESTINATION ${HDF5_INSTALL_BIN_DIR} - COMPONENT libraries - ) - ENDIF (WIN32 AND BUILD_SHARED_LIBS) - ENDIF (HDF5_PACKAGE_EXTLIBS) -ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED) - -#----------------------------------------------------------------------------- # Add Target(s) to CMake Install for import into other projects #----------------------------------------------------------------------------- IF (NOT HDF5_EXTERNALLY_CONFIGURED) INSTALL ( EXPORT ${HDF5_EXPORTED_TARGETS} - DESTINATION ${HDF5_INSTALL_DATA_DIR}/cmake/hdf5-${HDF5_PACKAGE_VERSION} + DESTINATION ${HDF5_INSTALL_DATA_DIR}/cmake/hdf5 FILE hdf5-targets.cmake + COMPONENT configinstall ) ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED) @@ -851,7 +832,8 @@ IF (NOT HDF5_EXTERNALLY_CONFIGURED) ) INSTALL ( FILES ${HDF5_BINARY_DIR}/CMakeFiles/hdf5-config.cmake - DESTINATION ${HDF5_INSTALL_DATA_DIR}/cmake/hdf5-${HDF5_PACKAGE_VERSION} + DESTINATION ${HDF5_INSTALL_DATA_DIR}/cmake/hdf5 + COMPONENT configinstall ) ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED) @@ -865,11 +847,25 @@ IF (NOT HDF5_EXTERNALLY_CONFIGURED) ) INSTALL ( FILES ${HDF5_BINARY_DIR}/CMakeFiles/hdf5-config-version.cmake - DESTINATION ${HDF5_INSTALL_DATA_DIR}/cmake/hdf5-${HDF5_PACKAGE_VERSION} + DESTINATION ${HDF5_INSTALL_DATA_DIR}/cmake/hdf5 + COMPONENT configinstall ) ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED) #----------------------------------------------------------------------------- +# Configure the libhdf5.settings file for the lib info +#----------------------------------------------------------------------------- +IF (H5_WORDS_BIGENDIAN) + SET (BYTESEX big-endian) +ELSE (H5_WORDS_BIGENDIAN) + SET (BYTESEX little-endian) +ENDIF (H5_WORDS_BIGENDIAN) +CONFIGURE_FILE ( + ${HDF5_RESOURCES_DIR}/libhdf5.settings.cmake.in + ${HDF5_BINARY_DIR}/libhdf5.settings @ONLY +) + +#----------------------------------------------------------------------------- # Add Document File(s) to CMake Install #----------------------------------------------------------------------------- IF (NOT HDF5_EXTERNALLY_CONFIGURED) @@ -884,6 +880,7 @@ IF (NOT HDF5_EXTERNALLY_CONFIGURED) IF (EXISTS "${HDF5_SOURCE_DIR}/release_docs" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/release_docs") SET (release_files ${HDF5_SOURCE_DIR}/release_docs/CMake.txt + ${HDF5_SOURCE_DIR}/release_docs/Using_CMake.txt ${HDF5_SOURCE_DIR}/release_docs/COPYING ${HDF5_SOURCE_DIR}/release_docs/HISTORY-1_9.txt ${HDF5_SOURCE_DIR}/release_docs/INSTALL @@ -898,14 +895,13 @@ IF (NOT HDF5_EXTERNALLY_CONFIGURED) SET (release_files ${release_files} ${HDF5_SOURCE_DIR}/release_docs/INSTALL_Cygwin.txt - ${HDF5_SOURCE_DIR}/release_docs/INSTALL_MinGW.txt ${HDF5_SOURCE_DIR}/release_docs/INSTALL_VMS.txt ) ENDIF (WIN32 AND NOT CYGWIN) IF (HDF5_ENABLE_PARALLEL) SET (release_files ${release_files} - ${HDF5_SOURCE_DIR}/release_docs/INSTALL_parallel.txt + ${HDF5_SOURCE_DIR}/release_docs/INSTALL_parallel ) ENDIF (HDF5_ENABLE_PARALLEL) INSTALL ( @@ -919,10 +915,10 @@ ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED) #----------------------------------------------------------------------------- # Set the cpack variables #----------------------------------------------------------------------------- -IF (NOT HDF5_EXTERNALLY_CONFIGURED) - SET (CPACK_PACKAGE_VENDOR "The HDF Group") +IF (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES) + SET (CPACK_PACKAGE_VENDOR "HDF Group") SET (CPACK_PACKAGE_NAME "${HDF5_PACKAGE_NAME}") - SET (CPACK_PACKAGE_INSTALL_DIRECTORY "HDFGroup/${HDF5_PACKAGE_NAME}") + SET (CPACK_PACKAGE_INSTALL_DIRECTORY "${HDF5_PACKAGE_NAME}") SET (CPACK_PACKAGE_VERSION "${HDF5_PACKAGE_VERSION}") SET (CPACK_PACKAGE_VERSION_MAJOR "${HDF5_PACKAGE_VERSION_MAJOR}") SET (CPACK_PACKAGE_VERSION_MINOR "${HDF5_PACKAGE_VERSION_MINOR}") @@ -933,8 +929,6 @@ IF (NOT HDF5_EXTERNALLY_CONFIGURED) SET (CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/release_docs/RELEASE.txt") ENDIF (EXISTS "${HDF5_SOURCE_DIR}/release_docs") SET (CPACK_PACKAGE_RELOCATABLE TRUE) - #only needed for cmake 2.8.3 - SET (CPACK_MONOLITHIC_INSTALL 1) IF (WIN32) SET (CPACK_NSIS_CONTACT "help@hdfgroup.org") SET (CPACK_NSIS_MODIFY_PATH ON) @@ -942,10 +936,29 @@ IF (NOT HDF5_EXTERNALLY_CONFIGURED) ELSE (WIN32) SET (CPACK_RPM_COMPONENT_INSTALL ON) ENDIF (WIN32) + SET (CPACK_MONOLITHIC_INSTALL ON) - INCLUDE (CPack) INCLUDE(InstallRequiredSystemLibraries) + SET (CPACK_INSTALL_CMAKE_PROJECTS "${HDF5_BINARY_DIR};HDF5;ALL;/") + + IF (HDF5_PACKAGE_EXTLIBS) + IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") + IF (ZLIB_FOUND AND ZLIB_USE_EXTERNAL) + SET (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${ZLIB_INCLUDE_DIR_GEN};ZLIB;libraries;/") + SET (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${ZLIB_INCLUDE_DIR_GEN};ZLIB;headers;/") + SET (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${ZLIB_INCLUDE_DIR_GEN};ZLIB;configinstall;/") + ENDIF (ZLIB_FOUND AND ZLIB_USE_EXTERNAL) + IF (SZIP_FOUND AND SZIP_USE_EXTERNAL) + SET (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${SZIP_INCLUDE_DIR_GEN};SZIP;libraries;/") + SET (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${SZIP_INCLUDE_DIR_GEN};SZIP;headers;/") + SET (CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${SZIP_INCLUDE_DIR_GEN};SZIP;configinstall;/") + ENDIF (SZIP_FOUND AND SZIP_USE_EXTERNAL) + ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") + ENDIF (HDF5_PACKAGE_EXTLIBS) + + INCLUDE (CPack) + #--------------------------------------------------------------------------- # Now list the cpack commands #--------------------------------------------------------------------------- @@ -967,6 +980,11 @@ IF (NOT HDF5_EXTERNALLY_CONFIGURED) DISPLAY_NAME "HDF5 Documents" GROUP Documents ) + CPACK_ADD_COMPONENT (configinstall + DISPLAY_NAME "HDF5 CMake files" + DEPENDS libraries + GROUP Development + ) IF (HDF5_BUILD_FORTRAN) CPACK_ADD_COMPONENT (fortlibraries @@ -1045,4 +1063,4 @@ IF (NOT HDF5_EXTERNALLY_CONFIGURED) ) ENDIF (HDF5_BUILD_HL_LIB) -ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED) +ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES) diff --git a/COPYING b/COPYING index 616432c..9e816c8 100644 --- a/COPYING +++ b/COPYING @@ -4,7 +4,7 @@ HDF5 (Hierarchical Data Format 5) Software Library and Utilities ----------------------------------------------------------------------------- HDF5 (Hierarchical Data Format 5) Software Library and Utilities -Copyright 2006-2011 by The HDF Group. +Copyright 2006-2012 by The HDF Group. NCSA HDF5 (Hierarchical Data Format 5) Software Library and Utilities Copyright 1998-2006 by the Board of Trustees of the University of Illinois. diff --git a/CTestConfig.cmake b/CTestConfig.cmake index 7d17f60..8d00095 100644 --- a/CTestConfig.cmake +++ b/CTestConfig.cmake @@ -4,15 +4,14 @@ ## # The following are required to uses Dart and the Cdash dashboard ## ENABLE_TESTING() ## INCLUDE(CTest) -SET (CTEST_PROJECT_NAME "HDF5 Trunk") +SET (CTEST_PROJECT_NAME "HDF5") +SET (CTEST_NIGHTLY_START_TIME "18:00:00 CST") SET (CTEST_DROP_METHOD "http") IF (CDASH_LOCAL) - SET (CTEST_NIGHTLY_START_TIME "20:00:00 CST") SET (CTEST_DROP_SITE "nei.hdfgroup.uiuc.edu") SET (CTEST_DROP_LOCATION "/cdash/submit.php?project=HDF5+Trunk") ELSE (CDASH_LOCAL) - SET (CTEST_NIGHTLY_START_TIME "00:00:00 EST") SET (CTEST_DROP_SITE "cdash.hdfgroup.uiuc.edu") SET (CTEST_DROP_LOCATION "/submit.php?project=HDF5+Trunk") ENDIF (CDASH_LOCAL) @@ -21,10 +20,11 @@ SET (CTEST_DROP_SITE_CDASH TRUE) SET (UPDATE_TYPE svn) SET (VALGRIND_COMMAND "/usr/bin/valgrind") SET (VALGRIND_COMMAND_OPTIONS "-v --tool=memcheck --leak-check=full --track-fds=yes --num-callers=50 --show-reachable=yes --track-origins=yes --malloc-fill=0xff --free-fill=0xfe") -SET (MEMORYCHECK_COMMAND "/usr/bin/valgrind") -SET (MEMORYCHECKCOMMAND "/usr/bin/valgrind") -SET (CTEST_MEMORYCHECK_COMMAND_OPTIONS "-v --tool=memcheck --leak-check=full --track-fds=yes --num-callers=50 --show-reachable=yes --track-origins=yes --malloc-fill=0xff --free-fill=0xfe") -SET (CTEST_MEMORYCHECKCOMMAND_OPTIONS "-v --tool=memcheck --leak-check=full --track-fds=yes --num-callers=50 --show-reachable=yes --track-origins=yes --malloc-fill=0xff --free-fill=0xfe") -SET (CTEST_TESTING_TIMEOUT 1200) -SET (DART_TESTING_TIMEOUT 1200) +SET (CTEST_TEST_TIMEOUT 3600 CACHE STRING + "Maximum time allowed before CTest will kill the test.") +SET (DART_TESTING_TIMEOUT 3600 CACHE STRING + "Maximum time allowed before CTest will kill the test." FORCE) + +SET(CTEST_SUBMIT_RETRY_DELAY 20 CACHE STRING + "How long to wait between timed-out CTest submissions.") diff --git a/MANIFEST b/MANIFEST index 8fa2acb..24da67a 100644 --- a/MANIFEST +++ b/MANIFEST @@ -20,8 +20,8 @@ # in column one with a '#'. #------------------------------------------------------------------------------ -./.autom4te.cfg _DO_NOT_DISTRIBUTE_ -./.h5chkright.ini _DO_NOT_DISTRIBUTE_ +./.autom4te.cfg _DO_NOT_DISTRIBUTE_ +./.h5chkright.ini _DO_NOT_DISTRIBUTE_ ./ACKNOWLEDGMENTS ./COPYING ./MANIFEST @@ -41,21 +41,21 @@ ./bin/COPYING ./bin/buildhdf5 -./bin/checkapi _DO_NOT_DISTRIBUTE_ -./bin/checkposix _DO_NOT_DISTRIBUTE_ -./bin/chkconfigure _DO_NOT_DISTRIBUTE_ -./bin/chkcopyright _DO_NOT_DISTRIBUTE_ +./bin/checkapi _DO_NOT_DISTRIBUTE_ +./bin/checkposix _DO_NOT_DISTRIBUTE_ +./bin/chkconfigure _DO_NOT_DISTRIBUTE_ +./bin/chkcopyright _DO_NOT_DISTRIBUTE_ ./bin/chkmanifest ./bin/compile ./bin/config.guess ./bin/config.sub -./bin/debug-ohdr _DO_NOT_DISTRIBUTE_ +./bin/debug-ohdr _DO_NOT_DISTRIBUTE_ ./bin/dependencies ./bin/depcomp ./bin/deploy ./bin/distdep -./bin/errors _DO_NOT_DISTRIBUTE_ -./bin/gcov_script _DO_NOT_DISTRIBUTE_ +./bin/errors _DO_NOT_DISTRIBUTE_ +./bin/gcov_script _DO_NOT_DISTRIBUTE_ ./bin/h5vers ./bin/install-sh ./bin/iostats @@ -69,13 +69,14 @@ ./bin/mkdirs ./bin/mkinstalldirs ./bin/newer -./bin/reconfigure _DO_NOT_DISTRIBUTE_ -./bin/README _DO_NOT_DISTRIBUTE_ +./bin/reconfigure _DO_NOT_DISTRIBUTE_ +./bin/output_filter.sh +./bin/README _DO_NOT_DISTRIBUTE_ ./bin/release -./bin/runtest _DO_NOT_DISTRIBUTE_ +./bin/runtest _DO_NOT_DISTRIBUTE_ ./bin/snapshot -./bin/snapshot_version _DO_NOT_DISTRIBUTE_ -./bin/timekeeper _DO_NOT_DISTRIBUTE_ +./bin/snapshot_version _DO_NOT_DISTRIBUTE_ +./bin/timekeeper _DO_NOT_DISTRIBUTE_ ./bin/trace ./bin/yodconfigure @@ -104,7 +105,6 @@ ./config/linux-gnulibc1 ./config/linux-gnulibc2 ./config/lt_vers.am -./config/mpich ./config/nec-superux14.1 ./config/Makefile.am.blank ./config/pgi-fflags @@ -151,10 +151,97 @@ ./fortran/Makefile.am ./fortran/Makefile.in +./fortran/robodoc.rc +./fortran/doc/DevelGuide/toc_index.html +./fortran/doc/DevelGuide/masterindex.html +./fortran/doc/DevelGuide/robo_subroutines.html +./fortran/doc/DevelGuide/robo_sourcefiles.html +./fortran/doc/DevelGuide/robo_functions.html +./fortran/doc/DevelGuide/robo_modules.html +./fortran/doc/DevelGuide/robo_programs.html +./fortran/doc/DevelGuide/robodoc.css +./fortran/doc/DevelGuide/test/fortranlib_test_f90.html +./fortran/doc/DevelGuide/test/tH5A_f90.html +./fortran/doc/DevelGuide/test/tH5VL_f90.html +./fortran/doc/DevelGuide/test/tH5D_f90.html +./fortran/doc/DevelGuide/test/tH5E_f90.html +./fortran/doc/DevelGuide/test/tH5F_f90.html +./fortran/doc/DevelGuide/test/tH5G_f90.html +./fortran/doc/DevelGuide/test/fflush1_f90.html +./fortran/doc/DevelGuide/test/fortranlib_test_1_8_f90.html +./fortran/doc/DevelGuide/test/tH5A_1_8_f90.html +./fortran/doc/DevelGuide/test/tf_f90.html +./fortran/doc/DevelGuide/test/fflush2_f90.html +./fortran/doc/DevelGuide/test/fortranlib_test_F03_f90.html +./fortran/doc/DevelGuide/test/tH5I_f90.html +./fortran/doc/DevelGuide/test/tH5G_1_8_f90.html +./fortran/doc/DevelGuide/test/tF2003_f90.html +./fortran/doc/DevelGuide/test/tH5O_f90.html +./fortran/doc/DevelGuide/test/tH5P_f90.html +./fortran/doc/DevelGuide/test/tH5R_f90.html +./fortran/doc/DevelGuide/test/tH5S_f90.html +./fortran/doc/DevelGuide/test/tH5Sselect_f90.html +./fortran/doc/DevelGuide/test/tH5T_f90.html +./fortran/doc/DevelGuide/test/t_c.html +./fortran/doc/DevelGuide/test/tH5Z_f90.html +./fortran/doc/DevelGuide/src/H5Fff_f90.html +./fortran/doc/DevelGuide/src/H5Zf_c.html +./fortran/doc/DevelGuide/src/H5Pff_F90_f90.html +./fortran/doc/DevelGuide/src/H5Aff_F03_f90.html +./fortran/doc/DevelGuide/src/H5match_types_c.html +./fortran/doc/DevelGuide/src/H5Rff_F90_f90.html +./fortran/doc/DevelGuide/src/H5Lff_f90.html +./fortran/doc/DevelGuide/src/H5FDmpiof_c.html +./fortran/doc/DevelGuide/src/H5_f_c.html +./fortran/doc/DevelGuide/src/H5Pff_f90.html +./fortran/doc/DevelGuide/src/H5Rff_f90.html +./fortran/doc/DevelGuide/src/H5Tff_f90.html +./fortran/doc/DevelGuide/src/H5test_kind_f90.html +./fortran/doc/DevelGuide/src/H5Aff_F90_f90.html +./fortran/doc/DevelGuide/src/H5Zff_f90.html +./fortran/doc/DevelGuide/src/HDF5_f90.html +./fortran/doc/DevelGuide/src/H5_DBLE_InterfaceInclude_f90.html +./fortran/doc/DevelGuide/src/H5f90kit_c.html +./fortran/doc/DevelGuide/src/H5Aff_f90.html +./fortran/doc/DevelGuide/src/H5_DBLE_InterfaceExclude_f90.html +./fortran/doc/DevelGuide/src/H5Eff_f90.html +./fortran/doc/DevelGuide/src/H5_ff_F03_f90.html +./fortran/doc/DevelGuide/src/H5Gff_f90.html +./fortran/doc/DevelGuide/src/H5test_kind_SIZEOF_f90.html +./fortran/doc/DevelGuide/src/H5Iff_f90.html +./fortran/doc/DevelGuide/src/H5Dff_F03_f90.html +./fortran/doc/DevelGuide/src/H5Af_c.html +./fortran/doc/DevelGuide/src/H5Off_f90.html +./fortran/doc/DevelGuide/src/H5Df_c.html +./fortran/doc/DevelGuide/src/H5Sff_f90.html +./fortran/doc/DevelGuide/src/H5Ef_c.html +./fortran/doc/DevelGuide/src/HDF5mpio_f90.html +./fortran/doc/DevelGuide/src/H5Lff_F03_f90.html +./fortran/doc/DevelGuide/src/H5Ff_c.html +./fortran/doc/DevelGuide/src/H5f90global_f90.html +./fortran/doc/DevelGuide/src/H5Gf_c.html +./fortran/doc/DevelGuide/src/H5If_c.html +./fortran/doc/DevelGuide/src/H5Pff_F03_f90.html +./fortran/doc/DevelGuide/src/H5_ff_F90_f90.html +./fortran/doc/DevelGuide/src/H5Rff_F03_f90.html +./fortran/doc/DevelGuide/src/H5Lf_c.html +./fortran/doc/DevelGuide/src/H5Of_c.html +./fortran/doc/DevelGuide/src/H5Dff_F90_f90.html +./fortran/doc/DevelGuide/src/H5Pf_c.html +./fortran/doc/DevelGuide/src/H5FDmpioff_f90.html +./fortran/doc/DevelGuide/src/H5_ff_f90.html +./fortran/doc/DevelGuide/src/H5Rf_c.html +./fortran/doc/DevelGuide/src/H5Sf_c.html +./fortran/doc/DevelGuide/src/H5Tf_c.html +./fortran/doc/DevelGuide/src/H5Dff_f90.html +./fortran/doc/DevelGuide/src/H5Lff_F90_f90.html + ./fortran/examples/Makefile.am ./fortran/examples/Makefile.in ./fortran/examples/attrexample.f90 ./fortran/examples/compound.f90 +./fortran/examples/compound_fortran2003.f90 +./fortran/examples/compound_complex_fortran2003.f90 ./fortran/examples/dsetexample.f90 ./fortran/examples/fileexample.f90 ./fortran/examples/groupexample.f90 @@ -170,17 +257,27 @@ ./fortran/examples/rwdsetexample.f90 ./fortran/examples/selectele.f90 ./fortran/examples/testh5fc.sh.in +./fortran/examples/nested_derived_type.f90 +./fortran/examples/rwdset_fortran2003.f90 ./fortran/src/H5_f.c ./fortran/src/H5_ff.f90 +./fortran/src/H5_ff_F90.f90 +./fortran/src/H5_ff_F03.f90 ./fortran/src/H5_DBLE_InterfaceInclude.f90 ./fortran/src/H5_DBLE_InterfaceExclude.f90 ./fortran/src/H5Af.c ./fortran/src/H5Aff.f90 +./fortran/src/H5Aff_F90.f90 +./fortran/src/H5Aff_F03.f90 ./fortran/src/H5Df.c ./fortran/src/H5Dff.f90 +./fortran/src/H5Dff_F90.f90 +./fortran/src/H5Dff_F03.f90 ./fortran/src/H5Ef.c ./fortran/src/H5Eff.f90 +./fortran/src/H5Eff_F90.f90 +./fortran/src/H5Eff_F03.f90 ./fortran/src/H5FDmpiof.c ./fortran/src/H5FDmpioff.f90 ./fortran/src/H5Ff.c @@ -191,16 +288,26 @@ ./fortran/src/H5Iff.f90 ./fortran/src/H5Lf.c ./fortran/src/H5Lff.f90 +./fortran/src/H5Lff_F90.f90 +./fortran/src/H5Lff_F03.f90 ./fortran/src/H5Of.c ./fortran/src/H5Off.f90 +./fortran/src/H5Off_F90.f90 +./fortran/src/H5Off_F03.f90 ./fortran/src/H5Pf.c ./fortran/src/H5Pff.f90 +./fortran/src/H5Pff_F90.f90 +./fortran/src/H5Pff_F03.f90 ./fortran/src/H5Rf.c ./fortran/src/H5Rff.f90 +./fortran/src/H5Rff_F90.f90 +./fortran/src/H5Rff_F03.f90 ./fortran/src/H5Sf.c ./fortran/src/H5Sff.f90 ./fortran/src/H5Tf.c ./fortran/src/H5Tff.f90 +./fortran/src/H5Tff_F90.f90 +./fortran/src/H5Tff_F03.f90 ./fortran/src/H5Zf.c ./fortran/src/H5Zff.f90 ./fortran/src/H5f90.h @@ -216,9 +323,10 @@ ./fortran/src/Makefile.am ./fortran/src/Makefile.in ./fortran/src/README -./fortran/src/README_DEVELOPEMENT _DO_NOT_DISTRIBUTE_ +./fortran/src/README_DEVELOPEMENT _DO_NOT_DISTRIBUTE_ ./fortran/src/h5fc.in ./fortran/src/hdf5_fortrandll.def +./fortran/src/phdf5_fortrandll.def ./fortran/test/Makefile.am ./fortran/test/Makefile.in @@ -226,22 +334,27 @@ ./fortran/test/fflush2.f90 ./fortran/test/fortranlib_test.f90 ./fortran/test/fortranlib_test_1_8.f90 +./fortran/test/fortranlib_test_F03.f90 ./fortran/test/t.c ./fortran/test/t.h ./fortran/test/tf.f90 ./fortran/test/tH5A.f90 ./fortran/test/tH5A_1_8.f90 ./fortran/test/tH5D.f90 +./fortran/test/tH5E_F03.f90 ./fortran/test/tH5E.f90 ./fortran/test/tH5F.f90 ./fortran/test/tH5G.f90 ./fortran/test/tH5G_1_8.f90 ./fortran/test/tH5I.f90 +./fortran/test/tH5L_F03.f90 ./fortran/test/tH5O.f90 +./fortran/test/tH5P_F03.f90 ./fortran/test/tH5P.f90 ./fortran/test/tH5R.f90 ./fortran/test/tH5S.f90 ./fortran/test/tH5Sselect.f90 +./fortran/test/tH5T_F03.f90 ./fortran/test/tH5T.f90 ./fortran/test/tH5VL.f90 ./fortran/test/tH5Z.f90 @@ -416,11 +529,12 @@ ./release_docs/CMake.txt ./release_docs/INSTALL_parallel ./release_docs/RELEASE.txt +./release_docs/Using_CMake.txt -./src/.indent.pro _DO_NOT_DISTRIBUTE_ -./src/hdf5.lnt _DO_NOT_DISTRIBUTE_ -./src/hdf5-win.lnt _DO_NOT_DISTRIBUTE_ -./src/hdf5-lin.lnt _DO_NOT_DISTRIBUTE_ +./src/.indent.pro _DO_NOT_DISTRIBUTE_ +./src/hdf5.lnt _DO_NOT_DISTRIBUTE_ +./src/hdf5-win.lnt _DO_NOT_DISTRIBUTE_ +./src/hdf5-lin.lnt _DO_NOT_DISTRIBUTE_ ./src/COPYING ./src/H5.c ./src/H5checksum.c @@ -457,7 +571,7 @@ ./src/H5Bdbg.c ./src/H5Bpkg.h ./src/H5Bprivate.h -./src/H5Bpublic.h +./src/H5Bpublic.h ./src/H5B2.c ./src/H5B2cache.c ./src/H5B2dbg.c @@ -465,7 +579,7 @@ ./src/H5B2int.c ./src/H5B2pkg.h ./src/H5B2private.h -./src/H5B2public.h +./src/H5B2public.h ./src/H5B2stat.c ./src/H5B2test.c ./src/H5C.c @@ -524,6 +638,7 @@ ./src/H5EAtest.c ./src/H5F.c ./src/H5Faccum.c +./src/H5Fcwfs.c ./src/H5Fdbg.c ./src/H5Fdeprec.c ./src/H5Fefc.c @@ -624,7 +739,7 @@ ./src/H5HFman.c ./src/H5HFpkg.h ./src/H5HFprivate.h -./src/H5HFpublic.h +./src/H5HFpublic.h ./src/H5HFsection.c ./src/H5HFspace.c ./src/H5HFstat.c @@ -636,6 +751,7 @@ ./src/H5HGpkg.h ./src/H5HGprivate.h ./src/H5HGpublic.h +./src/H5HGquery.c ./src/H5HL.c ./src/H5HLcache.c ./src/H5HLdbg.c @@ -845,6 +961,7 @@ ./test/external.c ./test/error_test.c ./test/err_compat.c +./test/filter_error.h5 ./test/links_env.c ./test/family_v16_00000.h5 ./test/family_v16_00001.h5 @@ -865,7 +982,7 @@ ./test/gen_bad_compound.c _DO_NOT_DISTRIBUTE_ ./test/gen_bogus.c _DO_NOT_DISTRIBUTE_ ./test/gen_cross.c _DO_NOT_DISTRIBUTE_ -./test/gen_deflate.c _DO_NOT_DISTRIBUTE_ +./test/gen_deflate.c _DO_NOT_DISTRIBUTE_ ./test/gen_filespace.c _DO_NOT_DISTRIBUTE_ ./test/gen_idx.c _DO_NOT_DISTRIBUTE_ ./test/gen_mergemsg.c _DO_NOT_DISTRIBUTE_ @@ -881,8 +998,8 @@ ./test/gen_old_layout.c _DO_NOT_DISTRIBUTE_ ./test/gen_old_mtime.c _DO_NOT_DISTRIBUTE_ ./test/gen_sizes_lheap.c _DO_NOT_DISTRIBUTE_ -./test/gen_specmetaread.c _DO_NOT_DISTRIBUTE_ -./test/gen_udlinks.c _DO_NOT_DISTRIBUTE_ +./test/gen_specmetaread.c _DO_NOT_DISTRIBUTE_ +./test/gen_udlinks.c _DO_NOT_DISTRIBUTE_ ./test/getname.c ./test/gheap.c ./test/group_old.h5 @@ -899,6 +1016,8 @@ ./test/mf.c ./test/mount.c ./test/mtime.c +./test/multi_file_v16-r.h5 +./test/multi_file_v16-s.h5 ./test/noencoder.h5 ./test/ntypes.c ./test/ohdr.c @@ -906,7 +1025,7 @@ ./test/reserved.c ./test/pool.c ./test/set_extent.c -./test/space_overflow.c _DO_NOT_DISTRIBUTE_ +./test/space_overflow.c _DO_NOT_DISTRIBUTE_ ./test/specmetaread.h5 ./test/stab.c ./test/swmr_common.c @@ -965,7 +1084,6 @@ ./test/tvltypes.c ./test/unlink.c ./test/vfd.c -./test/vms_data.h5 ./test/test_filters_le.hdf5 ./test/test_filters_be.hdf5 ./test/gen_filters.c @@ -1007,6 +1125,12 @@ ./tools/h5dump/Makefile.in ./tools/h5dump/h5dump.c ./tools/h5dump/h5dump.h +./tools/h5dump/h5dump_defines.h +./tools/h5dump/h5dump_extern.h +./tools/h5dump/h5dump_ddl.c +./tools/h5dump/h5dump_ddl.h +./tools/h5dump/h5dump_xml.c +./tools/h5dump/h5dump_xml.h ./tools/h5dump/h5dumpgentest.c ./tools/h5dump/testh5dump.sh.in ./tools/h5dump/testh5dumpxml.sh.in @@ -1058,8 +1182,8 @@ ./tools/h5import/testfiles/txtuin32.h5 ./tools/h5import/testfiles/txtuin16.h5 ./tools/h5import/testfiles/textpfe.conf -./tools/h5import/testfiles/in64.txt -./tools/h5import/testfiles/test15.h5 +./tools/h5import/testfiles/textpfe64.txt +./tools/h5import/testfiles/textpfe.h5 # h5diff sources ./tools/h5diff/Makefile.am @@ -1114,6 +1238,8 @@ ./tools/lib/h5trav.h ./tools/lib/h5tools.c ./tools/lib/h5tools.h +./tools/lib/h5tools_dump.c +./tools/lib/h5tools_dump.h ./tools/lib/h5tools_filters.c ./tools/lib/h5tools_str.c ./tools/lib/h5tools_str.h @@ -1189,10 +1315,10 @@ ./tools/testfiles/family_file00017.h5 ./tools/testfiles/filter_fail.h5 ./tools/testfiles/filter_fail.ddl -./tools/testfiles/packedbits.h5 ./tools/testfiles/packedbits.ddl ./tools/testfiles/file_space.h5 ./tools/testfiles/file_space.ddl +./tools/testfiles/h5dump-help.txt ./tools/testfiles/tall-1.ddl ./tools/testfiles/tall-2.ddl ./tools/testfiles/tall-3.ddl @@ -1221,7 +1347,9 @@ ./tools/testfiles/tattr-1.ddl ./tools/testfiles/tattr-2.ddl ./tools/testfiles/tattr-3.ddl +./tools/testfiles/tattr-4_be.ddl ./tools/testfiles/tattr.h5 +./tools/testfiles/tattr4_be.h5 ./tools/testfiles/tattrreg.h5 ./tools/testfiles/tattrreg.ddl ./tools/testfiles/tattrregR.ddl @@ -1303,10 +1431,15 @@ ./tools/testfiles/tmulti-o.h5 ./tools/testfiles/tmulti-r.h5 ./tools/testfiles/tmulti-s.h5 +./tools/testfiles/tmultifile.ls +./tools/testfiles/tmultifile.ddl +./tools/testfiles/tqmarkfile.ddl +./tools/testfiles/tstarfile.ddl ./tools/testfiles/tnbit.ddl ./tools/testfiles/tnestcomp-1.ddl ./tools/testfiles/tnestedcomp.h5 -./tools/testfiles/tnofilename.ddl +./tools/testfiles/tno-subset.h5 +./tools/testfiles/tno-subset.ddl ./tools/testfiles/tnullspace.h5 ./tools/testfiles/tnullspace.ddl ./tools/testfiles/tobjref.h5 @@ -1316,6 +1449,7 @@ ./tools/testfiles/tscaleoffset.ddl ./tools/testfiles/tslink-1.ddl ./tools/testfiles/tslink-2.ddl +./tools/testfiles/tslink-D.ddl ./tools/testfiles/tslink.h5 ./tools/testfiles/tsplit_file-m.h5 ./tools/testfiles/tsplit_file-r.h5 @@ -1386,6 +1520,61 @@ ./tools/testfiles/tbigdims.ddl ./tools/testfiles/tbigdims.h5 ./tools/testfiles/thyperslab.h5 +# h5dump packed bits validation +./tools/testfiles/tnofilename-with-packed-bits.ddl +./tools/testfiles/tpbitsLengthPositive.ddl +./tools/testfiles/tpbitsMaxExceeded.ddl +./tools/testfiles/tpbitsSigned.ddl +./tools/testfiles/tpbitsSigned2.ddl +./tools/testfiles/tpbitsSigned4.ddl +./tools/testfiles/tpbitsSignedWhole.ddl +./tools/testfiles/tpbitsSignedInt.ddl +./tools/testfiles/tpbitsSignedInt4.ddl +./tools/testfiles/tpbitsSignedInt8.ddl +./tools/testfiles/tpbitsSignedIntWhole.ddl +./tools/testfiles/tpbitsSignedLong.ddl +./tools/testfiles/tpbitsSignedLong8.ddl +./tools/testfiles/tpbitsSignedLong16.ddl +./tools/testfiles/tpbitsSignedLongWhole.ddl +./tools/testfiles/tpbitsSignedLongLong.ddl +./tools/testfiles/tpbitsSignedLongLong16.ddl +./tools/testfiles/tpbitsSignedLongLong32.ddl +./tools/testfiles/tpbitsSignedLongLongWhole.ddl +./tools/testfiles/tpbitsSignedLongLongWhole1.ddl +./tools/testfiles/tpbitsSignedLongLongWhole63.ddl +./tools/testfiles/tpbitsOffsetNegative.ddl +./tools/testfiles/tpbitsUnsigned.ddl +./tools/testfiles/tpbitsUnsigned2.ddl +./tools/testfiles/tpbitsUnsigned4.ddl +./tools/testfiles/tpbitsUnsignedWhole.ddl +./tools/testfiles/tpbitsUnsignedInt.ddl +./tools/testfiles/tpbitsUnsignedInt4.ddl +./tools/testfiles/tpbitsUnsignedInt8.ddl +./tools/testfiles/tpbitsUnsignedIntWhole.ddl +./tools/testfiles/tpbitsUnsignedLong.ddl +./tools/testfiles/tpbitsUnsignedLong8.ddl +./tools/testfiles/tpbitsUnsignedLong16.ddl +./tools/testfiles/tpbitsUnsignedLongWhole.ddl +./tools/testfiles/tpbitsUnsignedLongLong.ddl +./tools/testfiles/tpbitsUnsignedLongLong16.ddl +./tools/testfiles/tpbitsUnsignedLongLong32.ddl +./tools/testfiles/tpbitsUnsignedLongLongWhole.ddl +./tools/testfiles/tpbitsUnsignedLongLongWhole1.ddl +./tools/testfiles/tpbitsUnsignedLongLongWhole63.ddl +./tools/testfiles/tpbitsMax.ddl +./tools/testfiles/packedbits.h5 +./tools/testfiles/tpbitsArray.ddl +./tools/testfiles/tpbitsCompound.ddl +./tools/testfiles/tpbitsIncomplete.ddl +./tools/testfiles/tpbitsLengthExceeded.ddl +./tools/testfiles/tpbitsCharLengthExceeded.ddl +./tools/testfiles/tpbitsIntLengthExceeded.ddl +./tools/testfiles/tpbitsLongLengthExceeded.ddl +./tools/testfiles/tpbitsOffsetExceeded.ddl +./tools/testfiles/tpbitsCharOffsetExceeded.ddl +./tools/testfiles/tpbitsIntOffsetExceeded.ddl +./tools/testfiles/tpbitsLongOffsetExceeded.ddl +./tools/testfiles/tpbitsOverlapped.ddl # h5dump h5import validation ./tools/testfiles/out3.h5import ./tools/testfiles/tordergr.h5 @@ -1403,7 +1592,8 @@ ./tools/testfiles/tfpformat.h5 # h5dump h5repack validation ./tools/testfiles/h5repack_filters.h5.ddl - +./tools/testfiles/zerodim.ddl +./tools/testfiles/zerodim.h5 # Expected output from h5ls tests ./tools/testfiles/nosuchfile.ls @@ -1426,6 +1616,8 @@ ./tools/testfiles/tsaf.ls ./tools/testfiles/tstr-1.ls ./tools/testfiles/tattr2.ls +./tools/testfiles/tattrreg_le.ls +./tools/testfiles/tattrreg_be.ls ./tools/testfiles/tvldtypes1.ls ./tools/testfiles/tvldtypes2le.ls ./tools/testfiles/tvldtypes2be.ls @@ -1564,6 +1756,7 @@ ./tools/h5diff/testfiles/h5diff_26.txt ./tools/h5diff/testfiles/h5diff_27.txt ./tools/h5diff/testfiles/h5diff_28.txt +./tools/h5diff/testfiles/h5diff_30.txt ./tools/h5diff/testfiles/h5diff_50.txt ./tools/h5diff/testfiles/h5diff_51.txt ./tools/h5diff/testfiles/h5diff_52.txt @@ -1600,6 +1793,15 @@ ./tools/h5diff/testfiles/h5diff_627.txt ./tools/h5diff/testfiles/h5diff_628.txt ./tools/h5diff/testfiles/h5diff_629.txt +./tools/h5diff/testfiles/h5diff_630.txt +./tools/h5diff/testfiles/h5diff_631.txt +./tools/h5diff/testfiles/h5diff_640.txt +./tools/h5diff/testfiles/h5diff_641.txt +./tools/h5diff/testfiles/h5diff_642.txt +./tools/h5diff/testfiles/h5diff_643.txt +./tools/h5diff/testfiles/h5diff_644.txt +./tools/h5diff/testfiles/h5diff_645.txt +./tools/h5diff/testfiles/h5diff_646.txt ./tools/h5diff/testfiles/h5diff_70.txt ./tools/h5diff/testfiles/h5diff_700.txt ./tools/h5diff/testfiles/h5diff_701.txt @@ -1632,6 +1834,10 @@ ./tools/h5diff/testfiles/h5diff_205.txt ./tools/h5diff/testfiles/h5diff_206.txt ./tools/h5diff/testfiles/h5diff_207.txt +./tools/h5diff/testfiles/h5diff_208.txt +./tools/h5diff/testfiles/h5diff_220.txt +./tools/h5diff/testfiles/h5diff_221.txt +./tools/h5diff/testfiles/h5diff_222.txt ./tools/h5diff/testfiles/h5diff_300.txt ./tools/h5diff/testfiles/h5diff_400.txt ./tools/h5diff/testfiles/h5diff_401.txt @@ -1670,6 +1876,11 @@ ./tools/h5diff/testfiles/h5diff_458.txt ./tools/h5diff/testfiles/h5diff_459.txt ./tools/h5diff/testfiles/h5diff_idx.txt +./tools/h5diff/testfiles/h5diff_465.txt +./tools/h5diff/testfiles/h5diff_466.txt +./tools/h5diff/testfiles/h5diff_467.txt +./tools/h5diff/testfiles/h5diff_468.txt +./tools/h5diff/testfiles/h5diff_469.txt ./tools/h5diff/testfiles/h5diff_480.txt ./tools/h5diff/testfiles/h5diff_481.txt ./tools/h5diff/testfiles/h5diff_482.txt @@ -1695,6 +1906,7 @@ ./tools/h5diff/testfiles/h5diff_517.txt ./tools/h5diff/testfiles/h5diff_518.txt ./tools/h5diff/testfiles/h5diff_530.txt +./tools/h5diff/testfiles/h5diff_540.txt ./tools/h5diff/testfiles/h5diff_attr1.h5 ./tools/h5diff/testfiles/h5diff_attr2.h5 @@ -1731,7 +1943,13 @@ ./tools/h5diff/testfiles/h5diff_exclude2-1.h5 ./tools/h5diff/testfiles/h5diff_exclude2-2.h5 ./tools/h5diff/testfiles/h5diff_comp_vl_strs.h5 - +./tools/h5diff/testfiles/h5diff_dset_zero_dim_size1.h5 +./tools/h5diff/testfiles/h5diff_dset_zero_dim_size2.h5 +./tools/h5diff/testfiles/h5diff_enum_invalid_values.h5 +./tools/h5diff/testfiles/compounds_array_vlen1.h5 +./tools/h5diff/testfiles/compounds_array_vlen2.h5 +./tools/h5diff/testfiles/non_comparables1.h5 +./tools/h5diff/testfiles/non_comparables2.h5 #test files for h5repack ./tools/h5repack/testfiles/h5repack_fill.h5 @@ -1769,12 +1987,15 @@ # test files for jam ./tools/h5jam/testfiles/twithub.h5 +./tools/h5jam/testfiles/twithub513.h5 +./tools/h5jam/testfiles/h5jam-help.txt +./tools/h5jam/testfiles/h5unjam-help.txt ./tools/h5jam/testfiles/u10.txt ./tools/h5jam/testfiles/tall.h5 ./tools/h5jam/testfiles/u511.txt ./tools/h5jam/testfiles/u512.txt -./tools/h5jam/testfiles/twithub513.h5 ./tools/h5jam/testfiles/u513.txt +./tools/h5jam/testfiles/h5jam-ub-nohdf5.txt # test files for h5copy ./tools/h5copy/testfiles/h5copytst.h5 @@ -1979,8 +2200,11 @@ ./hl/fortran/Makefile.in ./hl/fortran/examples/Makefile.am ./hl/fortran/examples/Makefile.in +./hl/fortran/examples/ex_ds1.f90 ./hl/fortran/examples/exlite.f90 ./hl/fortran/examples/run-hlfortran-ex.sh.in +./hl/fortran/src/H5DSfc.c +./hl/fortran/src/H5DSff.f90 ./hl/fortran/src/H5IMcc.c ./hl/fortran/src/H5IMcc.h ./hl/fortran/src/H5IMfc.c @@ -1994,6 +2218,7 @@ ./hl/fortran/src/Makefile.in ./hl/fortran/test/Makefile.am ./hl/fortran/test/Makefile.in +./hl/fortran/test/tstds.f90 ./hl/fortran/test/tstimage.f90 ./hl/fortran/test/tstlite.f90 ./hl/fortran/test/tsttable.f90 @@ -2080,18 +2305,22 @@ ./config/cmake/hdf5-config.cmake.install.in ./config/cmake/hdf5-config-version.cmake.in ./config/cmake/HDFMacros.cmake +./config/cmake/HDFLibMacros.cmake ./config/cmake/HDF5Macros.cmake ./config/cmake/HDF5UseFortran.cmake ./config/cmake/libhdf5.settings.cmake.in ./config/cmake/cacheinit.cmake ./config/cmake/mccacheinit.cmake -./config/cmake/CTest.cmake ./config/cmake/grepTest.cmake +./config/cmake/prunTest.cmake ./config/cmake/runTest.cmake ./config/cmake/userblockTest.cmake ./config/cmake/vfdTest.cmake ./config/cmake/CTestCustom.cmake ./config/cmake/ConfigureChecks.cmake +./config/cmake/CPack.cmake +./config/cmake/NSIS.template.in +./config/cmake/NSIS.InstallOptions.ini.in ./CMakeLists.txt ./CTestConfig.cmake ./c++/CMakeLists.txt diff --git a/Makefile.am b/Makefile.am old mode 100755 new mode 100644 diff --git a/Makefile.in b/Makefile.in index f1852aa..19219f6 100644 --- a/Makefile.in +++ b/Makefile.in @@ -205,6 +205,7 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ +FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ @@ -225,10 +226,12 @@ H5_LONE_COLON = @H5_LONE_COLON@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ +HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ +HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ diff --git a/README.txt b/README.txt index 2743eed..31e8024 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.81-FA_a5 currently under development +HDF5 version 1.9.111-FA_a5 currently under development Please refer to the release_docs/INSTALL file for installation instructions. ------------------------------------------------------------------------------ diff --git a/bin/make_vers b/bin/make_vers index 8541501..0bc3b62 100755 --- a/bin/make_vers +++ b/bin/make_vers @@ -2,6 +2,10 @@ require 5.003; # Global settings +# (The max_idx parameter is the only thing that needs to be changed when adding +# support for a new major release. If support for a prior major release +# is added (like support for 1.4, etc), the min_sup_idx parameter will +# need to be decremented. - QAK) # Max. library "index" (0 = v1.0, 1 = 1.2, etc) $max_idx = 5; @@ -9,6 +13,9 @@ $max_idx = 5; # Min. supported previous library version "index" (0 = v1.0, 1 = 1.2, etc) $min_sup_idx = 3; +# Number of spaces to indent preprocessor commands inside ifdefs +$indent = 2; + # # Copyright by The HDF Group. # Copyright by the Board of Trustees of the University of Illinois. @@ -82,13 +89,34 @@ sub print_startprotect ($$) { # Print check for conflicting version macro settings # sub print_checkoptions ($) { - my $fh = shift; + my $fh = shift; # File handle for output file + my $curr_idx; # Current API version index # Print the option checking print $fh "\n/* Issue error if contradicting macros have been defined. */\n"; - print $fh "#if (defined(H5_USE_16_API) || defined(H5_USE_18_API)) && defined(H5_NO_DEPRECATED_SYMBOLS)\n"; - print $fh "#error \"Can't choose old API versions when deprecated APIs are disabled\"\n"; - print $fh "#endif /* (defined(H5_USE_16_API) || defined(H5_USE_18_API)) && defined(H5_NO_DEPRECATED_SYMBOLS) */\n"; + + # Print the #ifdef + print $fh "#if ("; + for $curr_idx ($min_sup_idx .. ($max_idx - 1)) { + print $fh "defined(H5_USE_1", ($curr_idx * 2), "_API)"; + if($curr_idx < ($max_idx - 1)) { + print $fh " || "; + } + } + print $fh ") && defined(H5_NO_DEPRECATED_SYMBOLS)\n"; + + # Print the error for bad API version chosen + print $fh ' ' x $indent, "#error \"Can't choose old API versions when deprecated APIs are disabled\"\n"; + + # Print the #endif + print $fh "#endif /* ("; + for $curr_idx ($min_sup_idx .. ($max_idx - 1)) { + print $fh "defined(H5_USE_1", ($curr_idx * 2), "_API)"; + if($curr_idx < ($max_idx - 1)) { + print $fh " || "; + } + } + print $fh ") && defined(H5_NO_DEPRECATED_SYMBOLS) */\n"; } ############################################################################## @@ -110,7 +138,7 @@ sub print_globalapivers ($) { # Print API version ifdef print $fh "#if defined(H5_USE_1", ($curr_idx * 2), "_API_DEFAULT) && !defined(H5_USE_1", ($curr_idx * 2), "_API)\n"; # Print API version definition - print $fh "#define H5_USE_1", ($curr_idx * 2), "_API 1\n"; + print $fh " " x $indent, "#define H5_USE_1", ($curr_idx * 2), "_API 1\n"; # Print API version endif print $fh "#endif /* H5_USE_1", ($curr_idx * 2), "_API_DEFAULT && !H5_USE_1", ($curr_idx * 2), "_API */\n\n"; } @@ -127,7 +155,7 @@ sub print_globalapivers ($) { print $fh "/*************/\n"; for $name (sort keys %{$func_vers[$curr_idx]}) { print $fh "\n#if !defined(", $name, "_vers)\n"; - print $fh "#define ", $name, "_vers $func_vers[$curr_idx]{$name}\n"; + print $fh " " x $indent, "#define ", $name, "_vers $func_vers[$curr_idx]{$name}\n"; print $fh "#endif /* !defined(", $name, "_vers) */\n"; } @@ -138,7 +166,7 @@ sub print_globalapivers ($) { print $fh "/************/\n"; for $name (sort keys %{$type_vers[$curr_idx]}) { print $fh "\n#if !defined(", $name, "_t_vers)\n"; - print $fh "#define ", $name, "_t_vers $type_vers[$curr_idx]{$name}\n"; + print $fh " " x $indent, "#define ", $name, "_t_vers $type_vers[$curr_idx]{$name}\n"; print $fh "#endif /* !defined(", $name, "_t_vers) */\n"; } @@ -180,25 +208,25 @@ sub print_defaultapivers ($) { # Set up default/latest version name mapping print $fh "\n#if !defined($curr_vers_name) || $curr_vers_name == $curr_vers\n"; - print $fh "#ifndef $curr_vers_name\n"; - print $fh "#define $curr_vers_name $curr_vers\n"; - print $fh "#endif /* $curr_vers_name */\n"; - print $fh "#define $curr_name $curr_name$curr_vers\n"; + print $fh " " x $indent, "#ifndef $curr_vers_name\n"; + print $fh " " x ($indent * 2), "#define $curr_vers_name $curr_vers\n"; + print $fh " " x $indent, "#endif /* $curr_vers_name */\n"; + print $fh " " x $indent, "#define $curr_name $curr_name$curr_vers\n"; # Print function's dependent parameter types foreach(sort(@param_list)) { - print $fh "#define ${_}_t $_${curr_vers}_t\n"; + print $fh " " x $indent, "#define ${_}_t $_${curr_vers}_t\n"; } # Loop to print earlier version name mappings $curr_vers--; while($curr_vers > 0) { print $fh "#elif $curr_vers_name == $curr_vers\n"; - print $fh "#define $curr_name $curr_name$curr_vers\n"; + print $fh " " x $indent, "#define $curr_name $curr_name$curr_vers\n"; # Print function's dependent parameter types foreach(sort(@param_list)) { - print $fh "#define ${_}_t $_${curr_vers}_t\n"; + print $fh " " x $indent, "#define ${_}_t $_${curr_vers}_t\n"; } $curr_vers--; @@ -206,7 +234,7 @@ sub print_defaultapivers ($) { # Finish up with error for unknown version and endif print $fh "#else /* $curr_vers_name */\n"; - print $fh "#error \"$curr_vers_name set to invalid value\"\n"; + print $fh " " x $indent, "#error \"$curr_vers_name set to invalid value\"\n"; print $fh "#endif /* $curr_vers_name */\n"; } @@ -224,22 +252,22 @@ sub print_defaultapivers ($) { # Set up default/latest version name mapping print $fh "\n#if !defined($curr_vers_name) || $curr_vers_name == $curr_vers\n"; - print $fh "#ifndef $curr_vers_name\n"; - print $fh "#define $curr_vers_name $curr_vers\n"; - print $fh "#endif /* $curr_vers_name */\n"; - print $fh "#define ${curr_name}_t $curr_name${curr_vers}_t\n"; + print $fh " " x $indent, "#ifndef $curr_vers_name\n"; + print $fh " " x ($indent * 2), "#define $curr_vers_name $curr_vers\n"; + print $fh " " x $indent, "#endif /* $curr_vers_name */\n"; + print $fh " " x $indent, "#define ${curr_name}_t $curr_name${curr_vers}_t\n"; # Loop to print earlier version name mappings $curr_vers--; while($curr_vers > 0) { print $fh "#elif $curr_vers_name == $curr_vers\n"; - print $fh "#define ${curr_name}_t $curr_name${curr_vers}_t\n"; + print $fh " " x $indent, "#define ${curr_name}_t $curr_name${curr_vers}_t\n"; $curr_vers--; } # Finish up with error for unknown version and endif print $fh "#else /* $curr_vers_name */\n"; - print $fh "#error \"$curr_vers_name set to invalid value\"\n"; + print $fh " " x $indent, "#error \"$curr_vers_name set to invalid value\"\n"; print $fh "#endif /* $curr_vers_name */\n\n"; } } @@ -436,7 +464,13 @@ for $file (@ARGV) { my $prefix; # Local prefix for generated files #print "file = '$file'\n"; - ($prefix) = ($file =~ /(^.*\/)/); + # Check for directory prefix on input file + if($file =~ /\//) { + ($prefix) = ($file =~ /(^.*\/)/); + } + else { + $prefix = ""; + } #print "prefix = '$prefix'\n"; # Read in the entire file open SOURCE, $file or die "$file: $!\n"; @@ -450,7 +484,7 @@ for $file (@ARGV) { close SOURCE; # Create header files - print "Generating 'H5version.h'\n"; + print "Generating '", $prefix, "H5version.h'\n"; create_public($prefix); #for $name (sort keys %functions) { diff --git a/bin/output_filter.sh b/bin/output_filter.sh new file mode 100644 index 0000000..58f1c48 --- /dev/null +++ b/bin/output_filter.sh @@ -0,0 +1,101 @@ +## Copyright by The HDF Group. +## All rights reserved. +## +## This file is part of HDF5. The full HDF5 copyright notice, including +## terms governing use, modification, and redistribution, is contained in +## the files COPYING and Copyright.html. COPYING can be found at the root +## of the source code distribution tree; Copyright.html can be found at the +## root level of an installed copy of the electronic HDF5 document set and +## is linked from the top-level documents page. It can also be found at +## http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have +## access to either file, you may request a copy from help@hdfgroup.org. + +# This contains function definitions of output filtering. +# This file should only be sourced in by another shell script. +# +# Programmer: Albert Cheng +# Created Date: 2011/5/3 + + +# Some systems will dump some messages to stdout for various reasons. +# Remove them from the stdout result file. +# $1 is the file name of the file to be filtered. +# Cases of filter needed: +# 1. Sandia Red-Storm +# yod always prints these two lines at the beginning. +# LibLustre: NAL NID: 0004a605 (5) +# Lustre: OBD class driver Build Version: 1, info@clusterfs.com +# 2. LANL Lambda +# mpijob mirun -np always add an extra line at the end like: +# P4 procgroup file is /users/acheng/.lsbatch/host10524.l82 +STDOUT_FILTER() { + result_file=$1 + tmp_file=/tmp/h5test_tmp_$$ + # Filter Sandia Red-Storm yod messages. + cp $result_file $tmp_file + sed -e '/^LibLustre:/d' -e '/^Lustre:/d' \ + < $tmp_file > $result_file + # Filter LANL Lambda mpirun message. + cp $result_file $tmp_file + sed -e '/^P4 procgroup file is/d' \ + < $tmp_file > $result_file + # cleanup + rm -f $tmp_file +} + + +# Some systems will dump some messages to stderr for various reasons. +# Remove them from the stderr result file. +# $1 is the file name of the file to be filtered. +# Cases of filter needed: +# 1. MPE: +# In parallel mode and if MPE library is used, it prints the following +# two message lines whether the MPE tracing is used or not. +# Writing logfile. +# Finished writing logfile. +# 2. LANL MPI: +# The LANL MPI will print some messages like the following, +# LA-MPI: *** mpirun (1.5.10) +# LA-MPI: *** 3 process(es) on 2 host(s): 2*fln21 1*fln22 +# LA-MPI: *** libmpi (1.5.10) +# LA-MPI: *** Copyright 2001-2004, ACL, Los Alamos National Laboratory +# 3. h5diff debug output: +# Debug output all have prefix "h5diff debug: ". +# 4. AIX system prints messages like these when it is aborting: +# ERROR: 0031-300 Forcing all remote tasks to exit due to exit code 1 in task 0 +# ERROR: 0031-250 task 4: Terminated +# ERROR: 0031-250 task 3: Terminated +# ERROR: 0031-250 task 2: Terminated +# ERROR: 0031-250 task 1: Terminated +# 5. LLNL Blue-Gene mpirun prints messages like there when it exit non-zero: +# BE_MPI (ERROR): The error message in the job record is as follows: +# BE_MPI (ERROR): "killed by exit(1) on node 0" +STDERR_FILTER() { + result_file=$1 + tmp_file=/tmp/h5test_tmp_$$ + # Filter LLNL Blue-Gene error messages in both serial and parallel modes + # since mpirun is used in both modes. + cp $result_file $tmp_file + sed -e '/ BE_MPI (ERROR): /d' \ + < $tmp_file > $result_file + # Filter MPE messages + if test -n "$pmode"; then + cp $result_file $tmp_file + sed -e '/^Writing logfile./d' -e '/^Finished writing logfile./d' \ + < $tmp_file > $result_file + fi + # Filter LANL MPI messages + # and LLNL srun messages + # and AIX error messages + if test -n "$pmode"; then + cp $result_file $tmp_file + sed -e '/^LA-MPI:/d' -e '/^srun:/d' -e '/^ERROR:/d' \ + < $tmp_file > $result_file + fi + # Filter h5diff debug output + cp $result_file $tmp_file + sed -e '/^h5diff debug: /d' \ + < $tmp_file > $result_file + # clean up temporary files. + rm -f $tmp_file +} diff --git a/bin/release b/bin/release index c335028..be8eb14 100755 --- a/bin/release +++ b/bin/release @@ -93,6 +93,7 @@ VERS_OLD= test "$VERS" || exit 1 verbose=yes check=yes +release_date=`date +%F` today=`date +%Y%m%d` pmode='no' tmpdir="../#release_tmp.$$" # tmp work directory @@ -203,7 +204,7 @@ cp -p Makefile.dist Makefile # Update README.txt and release_docs/RELEASE.txt with release information in # line 1. for f in README.txt release_docs/RELEASE.txt; do - echo "HDF5 version $VERS released on `date`" >$f.x + echo "HDF5 version $VERS released on $release_date" >$f.x sed -e 1d $f >>$f.x mv $f.x $f # Make sure new files are of the right access mode diff --git a/bin/trace b/bin/trace index e0a4dd0..bfaae19 100755 --- a/bin/trace +++ b/bin/trace @@ -36,7 +36,9 @@ $Source = ""; "H5D_fill_time_t" => "Df", "H5D_fill_value_t" => "DF", "H5FD_mpio_chunk_opt_t" => "Dh", + "H5D_mpio_actual_io_mode_t" => "Di", "H5D_layout_t" => "Dl", + "H5D_mpio_actual_chunk_opt_mode_t" => "Do", "H5D_space_status_t" => "Ds", "H5FD_mpio_xfer_t" => "Dt", "herr_t" => "e", @@ -86,6 +88,8 @@ $Source = ""; "H5T_sign_t" => "Ts", "H5T_class_t" => "Tt", "H5T_str_t" => "Tz", + "unsigned long" => "Ul", + "unsigned long long" => "UL", "void" => "x", "FILE" => "x", "H5A_operator_t" => "x", @@ -217,6 +221,9 @@ sub rewrite_func ($$$$$) { my %names; for $arg (@args) { + if($arg=~/\w*\.{3}\w*/){ + next; + } unless ($arg=~/^(([a-z_A-Z]\w*\s+)+\**) ([a-z_A-Z]\w*)(\[.*?\])? (\s*\/\*\s*(in|out|in_out)\s*\*\/)?\s*$/x) { diff --git a/c++/CMakeLists.txt b/c++/CMakeLists.txt index 26c9521..dad98f8 100644 --- a/c++/CMakeLists.txt +++ b/c++/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8) +cmake_minimum_required (VERSION 2.8.6) PROJECT (HDF5_CPP) #----------------------------------------------------------------------------- diff --git a/c++/Makefile.in b/c++/Makefile.in index 93d29d9..0263607 100644 --- a/c++/Makefile.in +++ b/c++/Makefile.in @@ -178,6 +178,7 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ +FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ @@ -198,10 +199,12 @@ H5_LONE_COLON = @H5_LONE_COLON@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ +HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ +HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ diff --git a/c++/examples/CMakeLists.txt b/c++/examples/CMakeLists.txt index ebeff57..f60d96e 100644 --- a/c++/examples/CMakeLists.txt +++ b/c++/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8) +cmake_minimum_required (VERSION 2.8.6) # -------------------------------------------------------------------- # Notes: When creating examples they should be prefixed # with "cpp_ex_". This allows for easier filtering of the examples. @@ -24,6 +24,7 @@ FOREACH (example ${examples}) ADD_EXECUTABLE (cpp_ex_${example} ${HDF5_CPP_EXAMPLES_SOURCE_DIR}/${example}.cpp) TARGET_NAMING (cpp_ex_${example} ${LIB_TYPE}) TARGET_LINK_LIBRARIES (cpp_ex_${example} ${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET}) + SET_TARGET_PROPERTIES (cpp_ex_${example} PROPERTIES FOLDER examples/cpp) ENDFOREACH (example ${examples}) IF (BUILD_TESTING) diff --git a/c++/examples/Makefile.in b/c++/examples/Makefile.in index 08ff8f1..479747e 100644 --- a/c++/examples/Makefile.in +++ b/c++/examples/Makefile.in @@ -145,6 +145,7 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ +FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ @@ -165,10 +166,12 @@ H5_LONE_COLON = @H5_LONE_COLON@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ +HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ +HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ diff --git a/c++/examples/run-c++-ex.sh.in b/c++/examples/run-c++-ex.sh.in index 21db584..6b33577 100755 --- a/c++/examples/run-c++-ex.sh.in +++ b/c++/examples/run-c++-ex.sh.in @@ -33,8 +33,8 @@ EXIT_SUCCESS=0 EXIT_FAILURE=1 # Where the tool is installed. -# Note: no '/' after DESTDIR. Explanation in commence.am -prefix="${prefix:-${DESTDIR}@prefix@}" +# default is relative path to installed location of the tools +prefix="${prefix:-../../../}" AR="@AR@" RANLIB="@RANLIB@" H5TOOL="h5c++" # The tool name diff --git a/c++/src/CMakeLists.txt b/c++/src/CMakeLists.txt index ffc2da3..d2bc71a 100644 --- a/c++/src/CMakeLists.txt +++ b/c++/src/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8) +cmake_minimum_required (VERSION 2.8.6) PROJECT (HDF5_CPP_SRC) #----------------------------------------------------------------------------- @@ -85,6 +85,7 @@ ADD_LIBRARY (${HDF5_CPP_LIB_TARGET} ${LIB_TYPE} ${CPP_SRCS} ${CPP_HDRS}) TARGET_LINK_LIBRARIES (${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET}) SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_CPP_LIB_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_CPP_LIB_TARGET} ${HDF5_CPP_LIB_NAME} ${LIB_TYPE}) +SET_TARGET_PROPERTIES (${HDF5_CPP_LIB_TARGET} PROPERTIES FOLDER libraries/cpp) #----------------------------------------------------------------------------- # Add file(s) to CMake Install @@ -112,4 +113,3 @@ IF (HDF5_EXPORTED_TARGETS) RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT cpplibraries ) ENDIF (HDF5_EXPORTED_TARGETS) - diff --git a/c++/src/H5Object.cpp b/c++/src/H5Object.cpp index 693bb11..e25c255 100644 --- a/c++/src/H5Object.cpp +++ b/c++/src/H5Object.cpp @@ -437,7 +437,7 @@ void H5Object::reference(void* ref, const H5std_string& name) const hid_t H5Object::p_dereference(hid_t loc_id, const void* ref, H5R_type_t ref_type) { hid_t temp_id; - temp_id = H5Rdereference(loc_id, ref_type, ref); + temp_id = H5Rdereference2(loc_id, H5P_DEFAULT, ref_type, ref); if (temp_id < 0) { throw ReferenceException("", "H5Rdereference failed"); diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in index 72f1695..f3e8e5d 100644 --- a/c++/src/Makefile.in +++ b/c++/src/Makefile.in @@ -211,6 +211,7 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ +FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ @@ -231,10 +232,12 @@ H5_LONE_COLON = @H5_LONE_COLON@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ +HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ +HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ @@ -428,7 +431,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 = 71 +LT_VERS_REVISION = 101 LT_VERS_AGE = 0 # Include src directory diff --git a/c++/test/CMakeLists.txt b/c++/test/CMakeLists.txt index b6e645a4..fa5e2fd 100644 --- a/c++/test/CMakeLists.txt +++ b/c++/test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8) +cmake_minimum_required (VERSION 2.8.6) PROJECT (HDF5_CPP_TEST) # -------------------------------------------------------------------- # Notes: When creating unit test executables they should be prefixed @@ -42,6 +42,7 @@ TARGET_LINK_LIBRARIES (cpp_testhdf5 ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET} ) +SET_TARGET_PROPERTIES (cpp_testhdf5 PROPERTIES FOLDER test/cpp) ADD_TEST (NAME cpp_testhdf5 COMMAND $) diff --git a/c++/test/Makefile.in b/c++/test/Makefile.in index 096e33a..f7e4958 100644 --- a/c++/test/Makefile.in +++ b/c++/test/Makefile.in @@ -177,6 +177,7 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ +FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ @@ -197,10 +198,12 @@ H5_LONE_COLON = @H5_LONE_COLON@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ +HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ +HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ diff --git a/config/cmake/CPack.cmake b/config/cmake/CPack.cmake new file mode 100644 index 0000000..2e6b23a --- /dev/null +++ b/config/cmake/CPack.cmake @@ -0,0 +1,520 @@ +# - Build binary and source package installers +# +# The CPack module generates binary and source installers in a variety +# of formats using the cpack program. Inclusion of the CPack module +# adds two new targets to the resulting makefiles, package and +# package_source, which build the binary and source installers, +# respectively. The generated binary installers contain everything +# installed via CMake's INSTALL command (and the deprecated +# INSTALL_FILES, INSTALL_PROGRAMS, and INSTALL_TARGETS commands). +# +# For certain kinds of binary installers (including the graphical +# installers on Mac OS X and Windows), CPack generates installers that +# allow users to select individual application components to +# install. See CPackComponent module for that. +# +# The CPACK_GENERATOR variable has different meanings in different +# contexts. In your CMakeLists.txt file, CPACK_GENERATOR is a +# *list of generators*: when run with no other arguments, CPack +# will iterate over that list and produce one package for each +# generator. In a CPACK_PROJECT_CONFIG_FILE, though, CPACK_GENERATOR +# is a *string naming a single generator*. If you need per-cpack- +# generator logic to control *other* cpack settings, then you need +# a CPACK_PROJECT_CONFIG_FILE. +# +# The CMake source tree itself contains a CPACK_PROJECT_CONFIG_FILE. +# See the top level file CMakeCPackOptions.cmake.in for an example. +# +# If set, the CPACK_PROJECT_CONFIG_FILE is included automatically +# on a per-generator basis. It only need contain overrides. +# +# Here's how it works: +# - cpack runs +# - it includes CPackConfig.cmake +# - it iterates over the generators listed in that file's +# CPACK_GENERATOR list variable (unless told to use just a +# specific one via -G on the command line...) +# +# - foreach generator, it then +# - sets CPACK_GENERATOR to the one currently being iterated +# - includes the CPACK_PROJECT_CONFIG_FILE +# - produces the package for that generator +# +# This is the key: For each generator listed in CPACK_GENERATOR +# in CPackConfig.cmake, cpack will *reset* CPACK_GENERATOR +# internally to *the one currently being used* and then include +# the CPACK_PROJECT_CONFIG_FILE. +# +# Before including this CPack module in your CMakeLists.txt file, +# there are a variety of variables that can be set to customize +# the resulting installers. The most commonly-used variables are: +# +# CPACK_PACKAGE_NAME - The name of the package (or application). If +# not specified, defaults to the project name. +# +# CPACK_PACKAGE_VENDOR - The name of the package vendor (e.g., +# "Kitware"). +# +# CPACK_PACKAGE_VERSION_MAJOR - Package major Version +# +# CPACK_PACKAGE_VERSION_MINOR - Package minor Version +# +# CPACK_PACKAGE_VERSION_PATCH - Package patch Version +# +# CPACK_PACKAGE_DESCRIPTION_FILE - A text file used to describe the +# project. Used, for example, the introduction screen of a +# CPack-generated Windows installer to describe the project. +# +# CPACK_PACKAGE_DESCRIPTION_SUMMARY - Short description of the +# project (only a few words). +# +# CPACK_PACKAGE_FILE_NAME - The name of the package file to generate, +# not including the extension. For example, cmake-2.6.1-Linux-i686. +# +# CPACK_PACKAGE_INSTALL_DIRECTORY - Installation directory on the +# target system, e.g., "CMake 2.5". +# +# CPACK_PROJECT_CONFIG_FILE - File included at cpack time, once per +# generator after setting CPACK_GENERATOR to the actual generator +# being used. Allows per-generator setting of CPACK_* variables at +# cpack time. +# +# CPACK_RESOURCE_FILE_LICENSE - License file for the project, which +# will typically be displayed to the user (often with an explicit +# "Accept" button, for graphical installers) prior to installation. +# +# CPACK_RESOURCE_FILE_README - ReadMe file for the project, which +# typically describes in some detail +# +# CPACK_RESOURCE_FILE_WELCOME - Welcome file for the project, which +# welcomes users to this installer. Typically used in the graphical +# installers on Windows and Mac OS X. +# +# CPACK_MONOLITHIC_INSTALL - Disables the component-based +# installation mechanism, so that all components are always installed. +# +# CPACK_GENERATOR - List of CPack generators to use. If not +# specified, CPack will create a set of options (e.g., +# CPACK_BINARY_NSIS) allowing the user to enable/disable individual +# generators. +# +# CPACK_OUTPUT_CONFIG_FILE - The name of the CPack configuration file +# for binary installers that will be generated by the CPack +# module. Defaults to CPackConfig.cmake. +# +# CPACK_PACKAGE_EXECUTABLES - Lists each of the executables along +# with a text label, to be used to create Start Menu shortcuts on +# Windows. For example, setting this to the list ccmake;CMake will +# create a shortcut named "CMake" that will execute the installed +# executable ccmake. +# +# CPACK_STRIP_FILES - List of files to be stripped. Starting with +# CMake 2.6.0 CPACK_STRIP_FILES will be a boolean variable which +# enables stripping of all files (a list of files evaluates to TRUE +# in CMake, so this change is compatible). +# +# The following CPack variables are specific to source packages, and +# will not affect binary packages: +# +# CPACK_SOURCE_PACKAGE_FILE_NAME - The name of the source package, +# e.g., cmake-2.6.1 +# +# CPACK_SOURCE_STRIP_FILES - List of files in the source tree that +# will be stripped. Starting with CMake 2.6.0 +# CPACK_SOURCE_STRIP_FILES will be a boolean variable which enables +# stripping of all files (a list of files evaluates to TRUE in CMake, +# so this change is compatible). +# +# CPACK_SOURCE_GENERATOR - List of generators used for the source +# packages. As with CPACK_GENERATOR, if this is not specified then +# CPack will create a set of options (e.g., CPACK_SOURCE_ZIP) +# allowing users to select which packages will be generated. +# +# CPACK_SOURCE_OUTPUT_CONFIG_FILE - The name of the CPack +# configuration file for source installers that will be generated by +# the CPack module. Defaults to CPackSourceConfig.cmake. +# +# CPACK_SOURCE_IGNORE_FILES - Pattern of files in the source tree +# that won't be packaged when building a source package. This is a +# list of patterns, e.g., /CVS/;/\\.svn/;\\.swp$;\\.#;/#;.*~;cscope.* +# +# The following variables are specific to the DragNDrop installers +# built on Mac OS X: +# +# CPACK_DMG_VOLUME_NAME - The volume name of the generated disk +# image. Defaults to CPACK_PACKAGE_FILE_NAME. +# +# CPACK_DMG_FORMAT - The disk image format. Common values are UDRO +# (UDIF read-only), UDZO (UDIF zlib-compressed) or UDBZ (UDIF +# bzip2-compressed). Refer to hdiutil(1) for more information on +# other available formats. +# +# CPACK_DMG_DS_STORE - Path to a custom .DS_Store file which e.g. +# can be used to specify the Finder window position/geometry and +# layout (such as hidden toolbars, placement of the icons etc.). +# This file has to be generated by the Finder (either manually or +# through OSA-script) using a normal folder from which the .DS_Store +# file can then be extracted. +# +# CPACK_DMG_BACKGROUND_IMAGE - Path to an image file which is to be +# used as the background for the Finder Window when the disk image +# is opened. By default no background image is set. The background +# image is applied after applying the custom .DS_Store file. +# +# CPACK_COMMAND_HDIUTIL - Path to the hdiutil(1) command used to +# operate on disk image files on Mac OS X. This variable can be used +# to override the automatically detected command (or specify its +# location if the auto-detection fails to find it.) +# +# CPACK_COMMAND_SETFILE - Path to the SetFile(1) command used to set +# extended attributes on files and directories on Mac OS X. This +# variable can be used to override the automatically detected +# command (or specify its location if the auto-detection fails to +# find it.) +# +# CPACK_COMMAND_REZ - Path to the Rez(1) command used to compile +# resources on Mac OS X. This variable can be used to override the +# automatically detected command (or specify its location if the +# auto-detection fails to find it.) +# +# The following variable is specific to installers build on Mac OS X +# using PackageMaker: +# +# CPACK_OSX_PACKAGE_VERSION - The version of Mac OS X that the +# resulting PackageMaker archive should be compatible +# with. Different versions of Mac OS X support different +# features. For example, CPack can only build component-based +# installers for Mac OS X 10.4 or newer, and can only build +# installers that download component son-the-fly for Mac OS X 10.5 +# or newer. If left blank, this value will be set to the minimum +# version of Mac OS X that supports the requested features. Set this +# variable to some value (e.g., 10.4) only if you want to guarantee +# that your installer will work on that version of Mac OS X, and +# don't mind missing extra features available in the installer +# shipping with later versions of Mac OS X. +# +# The following variables are for advanced uses of CPack: +# +# CPACK_CMAKE_GENERATOR - What CMake generator should be used if the +# project is CMake project. Defaults to the value of CMAKE_GENERATOR; +# few users will want to change this setting. +# +# CPACK_INSTALL_CMAKE_PROJECTS - List of four values that specify +# what project to install. The four values are: Build directory, +# Project Name, Project Component, Directory. If omitted, CPack will +# build an installer that installers everything. +# +# CPACK_SYSTEM_NAME - System name, defaults to the value of +# ${CMAKE_SYSTEM_NAME}. +# +# CPACK_PACKAGE_VERSION - Package full version, used internally. By +# default, this is built from CPACK_PACKAGE_VERSION_MAJOR, +# CPACK_PACKAGE_VERSION_MINOR, and CPACK_PACKAGE_VERSION_PATCH. +# +# CPACK_TOPLEVEL_TAG - Directory for the installed files. +# +# CPACK_INSTALL_COMMANDS - Extra commands to install components. +# +# CPACK_INSTALLED_DIRECTORIES - Extra directories to install. +# + +#============================================================================= +# Copyright 2006-2009 Kitware, Inc. +# +# Distributed under the OSI-approved BSD License (the "License"); +# see accompanying file Copyright.txt for details. +# +# This software is distributed WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the License for more information. +#============================================================================= +# (To distribute this file outside of CMake, substitute the full +# License text for the above reference.) + +# Define this var in order to avoid (or warn) concerning multiple inclusion +IF(CPack_CMake_INCLUDED) + MESSAGE(WARNING "CPack.cmake has already been included!!") +ELSE(CPack_CMake_INCLUDED) + SET(CPack_CMake_INCLUDED 1) +ENDIF(CPack_CMake_INCLUDED) + +# Pick a configuration file +SET(cpack_input_file "${CMAKE_ROOT}/Templates/CPackConfig.cmake.in") +IF(EXISTS "${CMAKE_SOURCE_DIR}/CPackConfig.cmake.in") + SET(cpack_input_file "${CMAKE_SOURCE_DIR}/CPackConfig.cmake.in") +ENDIF(EXISTS "${CMAKE_SOURCE_DIR}/CPackConfig.cmake.in") +SET(cpack_source_input_file "${CMAKE_ROOT}/Templates/CPackConfig.cmake.in") +IF(EXISTS "${CMAKE_SOURCE_DIR}/CPackSourceConfig.cmake.in") + SET(cpack_source_input_file "${CMAKE_SOURCE_DIR}/CPackSourceConfig.cmake.in") +ENDIF(EXISTS "${CMAKE_SOURCE_DIR}/CPackSourceConfig.cmake.in") + +# Backward compatibility +# Include CPackComponent macros if it has not already been included before. +include(CPackComponent) + +# Macro for setting values if a user did not overwrite them +MACRO(cpack_set_if_not_set name value) + IF(NOT DEFINED "${name}") + SET(${name} "${value}") + ENDIF(NOT DEFINED "${name}") +ENDMACRO(cpack_set_if_not_set) + +# Macro to encode variables for the configuration file +# find any variable that starts with CPACK and create a variable +# _CPACK_OTHER_VARIABLES_ that contains SET commands for +# each cpack variable. _CPACK_OTHER_VARIABLES_ is then +# used as an @ replacment in configure_file for the CPackConfig. +MACRO(cpack_encode_variables) + SET(_CPACK_OTHER_VARIABLES_) + GET_CMAKE_PROPERTY(res VARIABLES) + FOREACH(var ${res}) + IF("xxx${var}" MATCHES "xxxCPACK") + SET(_CPACK_OTHER_VARIABLES_ + "${_CPACK_OTHER_VARIABLES_}\nSET(${var} \"${${var}}\")") + ENDIF("xxx${var}" MATCHES "xxxCPACK") + ENDFOREACH(var ${res}) +ENDMACRO(cpack_encode_variables) + +# Set the package name +cpack_set_if_not_set(CPACK_PACKAGE_NAME "${CMAKE_PROJECT_NAME}") +cpack_set_if_not_set(CPACK_PACKAGE_VERSION_MAJOR "0") +cpack_set_if_not_set(CPACK_PACKAGE_VERSION_MINOR "1") +cpack_set_if_not_set(CPACK_PACKAGE_VERSION_PATCH "1") +cpack_set_if_not_set(CPACK_PACKAGE_VERSION + "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}") +cpack_set_if_not_set(CPACK_PACKAGE_VENDOR "Humanity") +cpack_set_if_not_set(CPACK_PACKAGE_DESCRIPTION_SUMMARY + "${CMAKE_PROJECT_NAME} built using CMake") + +cpack_set_if_not_set(CPACK_PACKAGE_DESCRIPTION_FILE + "${CMAKE_ROOT}/Templates/CPack.GenericDescription.txt") +cpack_set_if_not_set(CPACK_RESOURCE_FILE_LICENSE + "${CMAKE_ROOT}/Templates/CPack.GenericLicense.txt") +cpack_set_if_not_set(CPACK_RESOURCE_FILE_README + "${CMAKE_ROOT}/Templates/CPack.GenericDescription.txt") +cpack_set_if_not_set(CPACK_RESOURCE_FILE_WELCOME + "${CMAKE_ROOT}/Templates/CPack.GenericWelcome.txt") + +cpack_set_if_not_set(CPACK_MODULE_PATH "${CMAKE_MODULE_PATH}") + +IF(CPACK_NSIS_MODIFY_PATH) + SET(CPACK_NSIS_MODIFY_PATH ON) +ENDIF(CPACK_NSIS_MODIFY_PATH) + +SET(__cpack_system_name ${CMAKE_SYSTEM_NAME}) +IF(${__cpack_system_name} MATCHES Windows) + IF(CMAKE_CL_64) + SET(__cpack_system_name win64) + ELSE(CMAKE_CL_64) + SET(__cpack_system_name win32) + ENDIF(CMAKE_CL_64) +ENDIF(${__cpack_system_name} MATCHES Windows) +cpack_set_if_not_set(CPACK_SYSTEM_NAME "${__cpack_system_name}") + +# Root dir: default value should be the string literal "$PROGRAMFILES" +# for backwards compatibility. Projects may set this value to anything. +if(CMAKE_CL_64) +set(__cpack_root_default "$PROGRAMFILES64") +else(CMAKE_CL_64) +set(__cpack_root_default "$PROGRAMFILES") +endif(CMAKE_CL_64) +cpack_set_if_not_set(CPACK_NSIS_INSTALL_ROOT "${__cpack_root_default}") + +# -..--. +cpack_set_if_not_set(CPACK_PACKAGE_FILE_NAME + "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_SYSTEM_NAME}") +cpack_set_if_not_set(CPACK_PACKAGE_INSTALL_DIRECTORY + "${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_VERSION}") +cpack_set_if_not_set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY + "${CPACK_PACKAGE_INSTALL_DIRECTORY}") +cpack_set_if_not_set(CPACK_PACKAGE_DEFAULT_LOCATION "/") +cpack_set_if_not_set(CPACK_PACKAGE_RELOCATABLE "true") + +# always force to exactly "true" or "false" for CPack.Info.plist.in: +if(CPACK_PACKAGE_RELOCATABLE) + set(CPACK_PACKAGE_RELOCATABLE "true") +else(CPACK_PACKAGE_RELOCATABLE) + set(CPACK_PACKAGE_RELOCATABLE "false") +endif(CPACK_PACKAGE_RELOCATABLE) + +macro(cpack_check_file_exists file description) + if(NOT EXISTS "${file}") + message(SEND_ERROR "CPack ${description} file: \"${file}\" could not be found.") + endif(NOT EXISTS "${file}") +endmacro(cpack_check_file_exists) + +cpack_check_file_exists("${CPACK_PACKAGE_DESCRIPTION_FILE}" "package description") +cpack_check_file_exists("${CPACK_RESOURCE_FILE_LICENSE}" "license resource") +cpack_check_file_exists("${CPACK_RESOURCE_FILE_README}" "readme resource") +cpack_check_file_exists("${CPACK_RESOURCE_FILE_WELCOME}" "welcome resource") + +macro(cpack_optional_append _list _cond _item) + if(${_cond}) + set(${_list} ${${_list}} ${_item}) + endif(${_cond}) +endmacro(cpack_optional_append _list _cond _item) + +# Provide options to choose generators +# we might check here if the required tools for the generates exist +# and set the defaults according to the results +if(NOT CPACK_GENERATOR) + if(UNIX) + if(CYGWIN) + option(CPACK_BINARY_CYGWIN "Enable to build Cygwin binary packages" ON) + else(CYGWIN) + if(APPLE) + option(CPACK_BINARY_BUNDLE "Enable to build OSX bundles" OFF) + option(CPACK_BINARY_DRAGNDROP "Enable to build OSX Drag And Drop package" OFF) + option(CPACK_BINARY_PACKAGEMAKER "Enable to build PackageMaker packages" ON) + option(CPACK_BINARY_OSXX11 "Enable to build OSX X11 packages" OFF) + else(APPLE) + option(CPACK_BINARY_TZ "Enable to build TZ packages" ON) + endif(APPLE) + option(CPACK_BINARY_STGZ "Enable to build STGZ packages" ON) + option(CPACK_BINARY_TGZ "Enable to build TGZ packages" ON) + option(CPACK_BINARY_TBZ2 "Enable to build TBZ2 packages" OFF) + option(CPACK_BINARY_DEB "Enable to build Debian packages" OFF) + option(CPACK_BINARY_RPM "Enable to build RPM packages" OFF) + option(CPACK_BINARY_NSIS "Enable to build NSIS packages" OFF) + endif(CYGWIN) + else(UNIX) + option(CPACK_BINARY_NSIS "Enable to build NSIS packages" ON) + option(CPACK_BINARY_ZIP "Enable to build ZIP packages" OFF) + endif(UNIX) + + cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_BUNDLE Bundle) + cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_DRAGNDROP DragNDrop) + cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_PACKAGEMAKER PackageMaker) + cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_OSXX11 OSXX11) + cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_CYGWIN CygwinBinary) + cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_DEB DEB) + cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_RPM RPM) + cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_NSIS NSIS) + cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_STGZ STGZ) + cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_TGZ TGZ) + cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_TBZ2 TBZ2) + cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_TZ TZ) + cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_ZIP ZIP) + +endif(NOT CPACK_GENERATOR) + +# Provide options to choose source generators +if(NOT CPACK_SOURCE_GENERATOR) + if(UNIX) + if(CYGWIN) + option(CPACK_SOURCE_CYGWIN "Enable to build Cygwin source packages" ON) + else(CYGWIN) + option(CPACK_SOURCE_TBZ2 "Enable to build TBZ2 source packages" ON) + option(CPACK_SOURCE_TGZ "Enable to build TGZ source packages" ON) + option(CPACK_SOURCE_TZ "Enable to build TZ source packages" ON) + option(CPACK_SOURCE_ZIP "Enable to build ZIP source packages" OFF) + endif(CYGWIN) + else(UNIX) + option(CPACK_SOURCE_ZIP "Enable to build ZIP source packages" ON) + endif(UNIX) + + cpack_optional_append(CPACK_SOURCE_GENERATOR CPACK_SOURCE_CYGWIN CygwinSource) + cpack_optional_append(CPACK_SOURCE_GENERATOR CPACK_SOURCE_TGZ TGZ) + cpack_optional_append(CPACK_SOURCE_GENERATOR CPACK_SOURCE_TBZ2 TBZ2) + cpack_optional_append(CPACK_SOURCE_GENERATOR CPACK_SOURCE_TZ TZ) + cpack_optional_append(CPACK_SOURCE_GENERATOR CPACK_SOURCE_ZIP ZIP) +endif(NOT CPACK_SOURCE_GENERATOR) + +# mark the above options as advanced +mark_as_advanced(CPACK_BINARY_CYGWIN CPACK_BINARY_PACKAGEMAKER CPACK_BINARY_OSXX11 + CPACK_BINARY_STGZ CPACK_BINARY_TGZ CPACK_BINARY_TBZ2 + CPACK_BINARY_DEB CPACK_BINARY_RPM CPACK_BINARY_TZ + CPACK_BINARY_NSIS CPACK_BINARY_ZIP CPACK_BINARY_BUNDLE + CPACK_SOURCE_CYGWIN CPACK_SOURCE_TBZ2 CPACK_SOURCE_TGZ + CPACK_SOURCE_TZ CPACK_SOURCE_ZIP CPACK_BINARY_DRAGNDROP) + +# Set some other variables +cpack_set_if_not_set(CPACK_INSTALL_CMAKE_PROJECTS + "${CMAKE_BINARY_DIR};${CMAKE_PROJECT_NAME};ALL;/") +cpack_set_if_not_set(CPACK_CMAKE_GENERATOR "${CMAKE_GENERATOR}") +cpack_set_if_not_set(CPACK_TOPLEVEL_TAG "${CPACK_SYSTEM_NAME}") +# if the user has set CPACK_NSIS_DISPLAY_NAME remember it +if(DEFINED CPACK_NSIS_DISPLAY_NAME) + SET(CPACK_NSIS_DISPLAY_NAME_SET TRUE) +endif() +# if the user has set CPACK_NSIS_DISPLAY +# explicitly, then use that as the default +# value of CPACK_NSIS_PACKAGE_NAME instead +# of CPACK_PACKAGE_INSTALL_DIRECTORY +cpack_set_if_not_set(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY}") + +if(CPACK_NSIS_DISPLAY_NAME_SET) + string(REPLACE "\\" "\\\\" + _NSIS_DISPLAY_NAME_TMP "${CPACK_NSIS_DISPLAY_NAME}") + cpack_set_if_not_set(CPACK_NSIS_PACKAGE_NAME "${_NSIS_DISPLAY_NAME_TMP}") +else() + cpack_set_if_not_set(CPACK_NSIS_PACKAGE_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY}") +endif() + +cpack_set_if_not_set(CPACK_OUTPUT_CONFIG_FILE + "${CMAKE_BINARY_DIR}/CPackConfig.cmake") + +cpack_set_if_not_set(CPACK_SOURCE_OUTPUT_CONFIG_FILE + "${CMAKE_BINARY_DIR}/CPackSourceConfig.cmake") + +cpack_set_if_not_set(CPACK_SET_DESTDIR OFF) +cpack_set_if_not_set(CPACK_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") + +cpack_set_if_not_set(CPACK_NSIS_INSTALLER_ICON_CODE "") +cpack_set_if_not_set(CPACK_NSIS_INSTALLER_MUI_ICON_CODE "") + +IF(DEFINED CPACK_COMPONENTS_ALL) + IF(CPACK_MONOLITHIC_INSTALL) + MESSAGE("CPack warning: both CPACK_COMPONENTS_ALL and CPACK_MONOLITHIC_INSTALL have been set.\nDefaulting to a monolithic installation.") + SET(CPACK_COMPONENTS_ALL) + ELSE(CPACK_MONOLITHIC_INSTALL) + # The user has provided the set of components to be installed as + # part of a component-based installation; trust her. + SET(CPACK_COMPONENTS_ALL_SET_BY_USER TRUE) + ENDIF(CPACK_MONOLITHIC_INSTALL) +ELSE(DEFINED CPACK_COMPONENTS_ALL) + # If the user has not specifically requested a monolithic installer + # but has specified components in various "install" commands, tell + # CPack about those components. + IF(NOT CPACK_MONOLITHIC_INSTALL) + GET_CMAKE_PROPERTY(CPACK_COMPONENTS_ALL COMPONENTS) + LIST(LENGTH CPACK_COMPONENTS_ALL CPACK_COMPONENTS_LEN) + IF(CPACK_COMPONENTS_LEN EQUAL 1) + # Only one component: this is not a component-based installation + # (at least, it isn't a component-based installation, but may + # become one later if the user uses the cpack_add_* commands). + SET(CPACK_COMPONENTS_ALL) + ENDIF(CPACK_COMPONENTS_LEN EQUAL 1) + SET(CPACK_COMPONENTS_LEN) + ENDIF(NOT CPACK_MONOLITHIC_INSTALL) +ENDIF(DEFINED CPACK_COMPONENTS_ALL) + +# CMake always generates a component named "Unspecified", which is +# used to install everything that doesn't have an explicitly-provided +# component. Since these files should always be installed, we'll make +# them hidden and required. +set(CPACK_COMPONENT_UNSPECIFIED_HIDDEN TRUE) +set(CPACK_COMPONENT_UNSPECIFIED_REQUIRED TRUE) + +cpack_encode_variables() +configure_file("${cpack_input_file}" "${CPACK_OUTPUT_CONFIG_FILE}" @ONLY IMMEDIATE) + +# Generate source file +cpack_set_if_not_set(CPACK_SOURCE_INSTALLED_DIRECTORIES + "${CMAKE_SOURCE_DIR};/") +cpack_set_if_not_set(CPACK_SOURCE_TOPLEVEL_TAG "${CPACK_SYSTEM_NAME}-Source") +cpack_set_if_not_set(CPACK_SOURCE_PACKAGE_FILE_NAME + "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-Source") +cpack_set_if_not_set(CPACK_SOURCE_IGNORE_FILES + "/CVS/;/\\\\\\\\.svn/;/\\\\\\\\.bzr/;/\\\\\\\\.hg/;/\\\\\\\\.git/;\\\\\\\\.swp$;\\\\\\\\.#;/#") +SET(CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_SOURCE_INSTALL_CMAKE_PROJECTS}") +SET(CPACK_INSTALLED_DIRECTORIES "${CPACK_SOURCE_INSTALLED_DIRECTORIES}") +SET(CPACK_GENERATOR "${CPACK_SOURCE_GENERATOR}") +SET(CPACK_TOPLEVEL_TAG "${CPACK_SOURCE_TOPLEVEL_TAG}") +SET(CPACK_PACKAGE_FILE_NAME "${CPACK_SOURCE_PACKAGE_FILE_NAME}") +SET(CPACK_IGNORE_FILES "${CPACK_SOURCE_IGNORE_FILES}") +SET(CPACK_STRIP_FILES "${CPACK_SOURCE_STRIP_FILES}") + +cpack_encode_variables() +configure_file("${cpack_source_input_file}" + "${CPACK_SOURCE_OUTPUT_CONFIG_FILE}" @ONLY IMMEDIATE) diff --git a/config/cmake/CTest.cmake b/config/cmake/CTest.cmake deleted file mode 100644 index 518f61e..0000000 --- a/config/cmake/CTest.cmake +++ /dev/null @@ -1,289 +0,0 @@ -# - Configure a project for testing with CTest/CDash -# Include this module in the top CMakeLists.txt file of a project to -# enable testing with CTest and dashboard submissions to CDash: -# project(MyProject) -# ... -# include(CTest) -# The module automatically creates a BUILD_TESTING option that selects -# whether to enable testing support (ON by default). After including -# the module, use code like -# if(BUILD_TESTING) -# # ... CMake code to create tests ... -# endif() -# to creating tests when testing is enabled. -# -# To enable submissions to a CDash server, create a CTestConfig.cmake -# file at the top of the project with content such as -# set(CTEST_PROJECT_NAME "MyProject") -# set(CTEST_NIGHTLY_START_TIME "01:00:00 UTC") -# set(CTEST_DROP_METHOD "http") -# set(CTEST_DROP_SITE "my.cdash.org") -# set(CTEST_DROP_LOCATION "/submit.php?project=MyProject") -# set(CTEST_DROP_SITE_CDASH TRUE) -# (the CDash server can provide the file to a project administrator -# who configures 'MyProject'). -# Settings in the config file are shared by both this CTest module and -# the CTest command-line tool's dashboard script mode (ctest -S). -# -# While building a project for submission to CDash, CTest scans the -# build output for errors and warnings and reports them with -# surrounding context from the build log. This generic approach works -# for all build tools, but does not give details about the command -# invocation that produced a given problem. One may get more detailed -# reports by adding -# set(CTEST_USE_LAUNCHERS 1) -# to the CTestConfig.cmake file. When this option is enabled, the -# CTest module tells CMake's Makefile generators to invoke every -# command in the generated build system through a CTest launcher -# program. (Currently the CTEST_USE_LAUNCHERS option is ignored on -# non-Makefile generators.) During a manual build each launcher -# transparently runs the command it wraps. During a CTest-driven -# build for submission to CDash each launcher reports detailed -# information when its command fails or warns. -# (Setting CTEST_USE_LAUNCHERS in CTestConfig.cmake is convenient, but -# also adds the launcher overhead even for manual builds. One may -# instead set it in a CTest dashboard script and add it to the CMake -# cache for the build tree.) - -#============================================================================= -# Copyright 2005-2009 Kitware, Inc. -# -# Distributed under the OSI-approved BSD License (the "License"); -# see accompanying file Copyright.txt for details. -# -# This software is distributed WITHOUT ANY WARRANTY; without even the -# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# See the License for more information. -#============================================================================= -# (To distribute this file outside of CMake, substitute the full -# License text for the above reference.) - -OPTION(BUILD_TESTING "Build the testing tree." ON) - -# function to turn generator name into a version string -# like vs7 vs71 vs8 vs9 -FUNCTION(GET_VS_VERSION_STRING generator var) - STRING(REGEX REPLACE "Visual Studio ([0-9][0-9]?)($|.*)" "\\1" NUMBER "${generator}") - IF("${generator}" MATCHES "Visual Studio 7 .NET 2003") - SET(ver_string "vs71") - ELSE("${generator}" MATCHES "Visual Studio 7 .NET 2003") - SET(ver_string "vs${NUMBER}") - ENDIF("${generator}" MATCHES "Visual Studio 7 .NET 2003") - SET(${var} ${ver_string} PARENT_SCOPE) -ENDFUNCTION(GET_VS_VERSION_STRING) - -IF(BUILD_TESTING) - # Setup some auxilary macros - MACRO(SET_IF_NOT_SET var val) - IF(NOT DEFINED "${var}") - SET("${var}" "${val}") - ENDIF(NOT DEFINED "${var}") - ENDMACRO(SET_IF_NOT_SET) - - MACRO(SET_IF_SET var val) - IF(NOT "${val}" MATCHES "^$") - SET("${var}" "${val}") - ENDIF(NOT "${val}" MATCHES "^$") - ENDMACRO(SET_IF_SET) - - MACRO(SET_IF_SET_AND_NOT_SET var val) - IF(NOT "${val}" MATCHES "^$") - SET_IF_NOT_SET("${var}" "${val}") - ENDIF(NOT "${val}" MATCHES "^$") - ENDMACRO(SET_IF_SET_AND_NOT_SET) - - # Make sure testing is enabled - ENABLE_TESTING() - - IF(EXISTS "${PROJECT_SOURCE_DIR}/CTestConfig.cmake") - INCLUDE("${PROJECT_SOURCE_DIR}/CTestConfig.cmake") - SET_IF_SET_AND_NOT_SET(NIGHTLY_START_TIME "${CTEST_NIGHTLY_START_TIME}") - SET_IF_SET_AND_NOT_SET(DROP_METHOD "${CTEST_DROP_METHOD}") - SET_IF_SET_AND_NOT_SET(DROP_SITE "${CTEST_DROP_SITE}") - SET_IF_SET_AND_NOT_SET(DROP_SITE_USER "${CTEST_DROP_SITE_USER}") - SET_IF_SET_AND_NOT_SET(DROP_SITE_PASSWORD "${CTEST_DROP_SITE_PASWORD}") - SET_IF_SET_AND_NOT_SET(DROP_SITE_MODE "${CTEST_DROP_SITE_MODE}") - SET_IF_SET_AND_NOT_SET(DROP_LOCATION "${CTEST_DROP_LOCATION}") - SET_IF_SET_AND_NOT_SET(TRIGGER_SITE "${CTEST_TRIGGER_SITE}") - SET_IF_SET_AND_NOT_SET(UPDATE_TYPE "${CTEST_UPDATE_TYPE}") - ENDIF(EXISTS "${PROJECT_SOURCE_DIR}/CTestConfig.cmake") - - # the project can have a DartConfig.cmake file - IF(EXISTS "${PROJECT_SOURCE_DIR}/DartConfig.cmake") - INCLUDE("${PROJECT_SOURCE_DIR}/DartConfig.cmake") - ELSE(EXISTS "${PROJECT_SOURCE_DIR}/DartConfig.cmake") - # Dashboard is opened for submissions for a 24 hour period starting at - # the specified NIGHTLY_START_TIME. Time is specified in 24 hour format. - SET_IF_NOT_SET (NIGHTLY_START_TIME "00:00:00 EDT") - SET_IF_NOT_SET(DROP_METHOD "http") - SET_IF_NOT_SET (COMPRESS_SUBMISSION ON) - ENDIF(EXISTS "${PROJECT_SOURCE_DIR}/DartConfig.cmake") - SET_IF_NOT_SET (NIGHTLY_START_TIME "00:00:00 EDT") - - FIND_PROGRAM(CVSCOMMAND cvs ) - SET(CVS_UPDATE_OPTIONS "-d -A -P" CACHE STRING - "Options passed to the cvs update command.") - FIND_PROGRAM(SVNCOMMAND svn) - FIND_PROGRAM(BZRCOMMAND bzr) - FIND_PROGRAM(HGCOMMAND hg) - FIND_PROGRAM(GITCOMMAND git) - - IF(NOT UPDATE_TYPE) - IF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CVS") - SET(UPDATE_TYPE cvs) - ELSEIF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.svn") - SET(UPDATE_TYPE svn) - ELSEIF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.bzr") - SET(UPDATE_TYPE bzr) - ELSEIF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.hg") - SET(UPDATE_TYPE hg) - ELSEIF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git") - SET(UPDATE_TYPE git) - ENDIF() - ENDIF(NOT UPDATE_TYPE) - - STRING(TOLOWER "${UPDATE_TYPE}" _update_type) - IF("${_update_type}" STREQUAL "cvs") - SET(UPDATE_COMMAND "${CVSCOMMAND}") - SET(UPDATE_OPTIONS "${CVS_UPDATE_OPTIONS}") - ELSEIF("${_update_type}" STREQUAL "svn") - SET(UPDATE_COMMAND "${SVNCOMMAND}") - SET(UPDATE_OPTIONS "${SVN_UPDATE_OPTIONS}") - ELSEIF("${_update_type}" STREQUAL "bzr") - SET(UPDATE_COMMAND "${BZRCOMMAND}") - SET(UPDATE_OPTIONS "${BZR_UPDATE_OPTIONS}") - ELSEIF("${_update_type}" STREQUAL "hg") - SET(UPDATE_COMMAND "${HGCOMMAND}") - SET(UPDATE_OPTIONS "${HG_UPDATE_OPTIONS}") - ELSEIF("${_update_type}" STREQUAL "git") - SET(UPDATE_COMMAND "${GITCOMMAND}") - SET(UPDATE_OPTIONS "${GIT_UPDATE_OPTIONS}") - ENDIF() - - SET(DART_TESTING_TIMEOUT 1500 CACHE STRING - "Maximum time allowed before CTest will kill the test.") - - SET(CTEST_SUBMIT_RETRY_DELAY 5 CACHE STRING - "How long to wait between timed-out CTest submissions.") - SET(CTEST_SUBMIT_RETRY_COUNT 3 CACHE STRING - "How many times to retry timed-out CTest submissions.") - - FIND_PROGRAM(MEMORYCHECK_COMMAND - NAMES purify valgrind boundscheck - PATHS - "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Rational Software\\Purify\\Setup;InstallFolder]" - DOC "Path to the memory checking command, used for memory error detection." - ) - FIND_PROGRAM(SLURM_SBATCH_COMMAND sbatch DOC - "Path to the SLURM sbatch executable" - ) - FIND_PROGRAM(SLURM_SRUN_COMMAND srun DOC - "Path to the SLURM srun executable" - ) - SET(MEMORYCHECK_SUPPRESSIONS_FILE "" CACHE FILEPATH - "File that contains suppressions for the memory checker") - FIND_PROGRAM(SCPCOMMAND scp DOC - "Path to scp command, used by CTest for submitting results to a Dart server" - ) - FIND_PROGRAM(COVERAGE_COMMAND gcov DOC - "Path to the coverage program that CTest uses for performing coverage inspection" - ) - - # set the site name - SITE_NAME(SITE) - # set the build name - IF(NOT BUILDNAME) - SET(DART_COMPILER "${CMAKE_CXX_COMPILER}") - IF(NOT DART_COMPILER) - SET(DART_COMPILER "${CMAKE_C_COMPILER}") - ENDIF(NOT DART_COMPILER) - IF(NOT DART_COMPILER) - SET(DART_COMPILER "unknown") - ENDIF(NOT DART_COMPILER) - IF(WIN32) - SET(DART_NAME_COMPONENT "NAME_WE") - ELSE(WIN32) - SET(DART_NAME_COMPONENT "NAME") - ENDIF(WIN32) - IF(NOT BUILD_NAME_SYSTEM_NAME) - SET(BUILD_NAME_SYSTEM_NAME "${CMAKE_SYSTEM_NAME}") - ENDIF(NOT BUILD_NAME_SYSTEM_NAME) - IF(WIN32) - SET(BUILD_NAME_SYSTEM_NAME "Win32") - ENDIF(WIN32) - IF(UNIX OR BORLAND) - GET_FILENAME_COMPONENT(DART_CXX_NAME - "${CMAKE_CXX_COMPILER}" ${DART_NAME_COMPONENT}) - ELSE(UNIX OR BORLAND) - GET_FILENAME_COMPONENT(DART_CXX_NAME - "${CMAKE_BUILD_TOOL}" ${DART_NAME_COMPONENT}) - ENDIF(UNIX OR BORLAND) - IF(DART_CXX_NAME MATCHES "msdev") - SET(DART_CXX_NAME "vs60") - ENDIF(DART_CXX_NAME MATCHES "msdev") - IF(DART_CXX_NAME MATCHES "devenv") - GET_VS_VERSION_STRING("${CMAKE_GENERATOR}" DART_CXX_NAME) - ENDIF(DART_CXX_NAME MATCHES "devenv") - IF (SYSTEM_NAME_EXT) - SET (BUILD_NAME_SYSTEM_NAME "${BUILD_NAME_SYSTEM_NAME}_${SYSTEM_NAME_EXT}") - ENDIF (SYSTEM_NAME_EXT) - IF(BUILD_NAME_EXT) - SET(BUILDNAME "${BUILD_NAME_SYSTEM_NAME}-${DART_CXX_NAME}-${BUILD_NAME_EXT}") - ELSE(BUILD_NAME_EXT) - SET(BUILDNAME "${BUILD_NAME_SYSTEM_NAME}-${DART_CXX_NAME}") - ENDIF( BUILD_NAME_EXT) - ENDIF(NOT BUILDNAME) - - # the build command - BUILD_COMMAND(MAKECOMMAND_DEFAULT_VALUE - CONFIGURATION "\${CTEST_CONFIGURATION_TYPE}") - SET(MAKECOMMAND ${MAKECOMMAND_DEFAULT_VALUE} - CACHE STRING "Command to build the project") - - # the default build configuration the ctest build handler will use - # if there is no -C arg given to ctest: - SET(DEFAULT_CTEST_CONFIGURATION_TYPE "$ENV{CMAKE_CONFIG_TYPE}") - IF(DEFAULT_CTEST_CONFIGURATION_TYPE STREQUAL "") - SET(DEFAULT_CTEST_CONFIGURATION_TYPE "Release") - ENDIF(DEFAULT_CTEST_CONFIGURATION_TYPE STREQUAL "") - - IF(NOT "${CMAKE_GENERATOR}" MATCHES "Make") - SET(CTEST_USE_LAUNCHERS 0) - ENDIF(NOT "${CMAKE_GENERATOR}" MATCHES "Make") - IF(CTEST_USE_LAUNCHERS) - SET(CTEST_LAUNCH_COMPILE "\"${CMAKE_CTEST_COMMAND}\" --launch --target-name --build-dir --output --source --language --") - SET(CTEST_LAUNCH_LINK "\"${CMAKE_CTEST_COMMAND}\" --launch --target-name --build-dir --output --target-type --language --") - SET(CTEST_LAUNCH_CUSTOM "\"${CMAKE_CTEST_COMMAND}\" --launch --target-name --build-dir --output --") - SET_PROPERTY(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CTEST_LAUNCH_COMPILE}") - SET_PROPERTY(GLOBAL PROPERTY RULE_LAUNCH_LINK "${CTEST_LAUNCH_LINK}") - SET_PROPERTY(GLOBAL PROPERTY RULE_LAUNCH_CUSTOM "${CTEST_LAUNCH_CUSTOM}") - ENDIF(CTEST_USE_LAUNCHERS) - - MARK_AS_ADVANCED( - COVERAGE_COMMAND - CVSCOMMAND - SVNCOMMAND - BZRCOMMAND - HGCOMMAND - GITCOMMAND - CVS_UPDATE_OPTIONS - SVN_UPDATE_OPTIONS - BZR_UPDATE_OPTIONS - MAKECOMMAND - MEMORYCHECK_COMMAND - MEMORYCHECK_SUPPRESSIONS_FILE - PURIFYCOMMAND - SCPCOMMAND - SLURM_SBATCH_COMMAND - SLURM_SRUN_COMMAND - SITE - CTEST_SUBMIT_RETRY_DELAY - CTEST_SUBMIT_RETRY_COUNT - ) - # BUILDNAME - IF(NOT RUN_FROM_DART) - SET(RUN_FROM_CTEST_OR_DART 1) - INCLUDE(CTestTargets) - SET(RUN_FROM_CTEST_OR_DART) - ENDIF(NOT RUN_FROM_DART) -ENDIF(BUILD_TESTING) diff --git a/config/cmake/CTestCustom.cmake b/config/cmake/CTestCustom.cmake index 1ae77bc..43ef451 100755 --- a/config/cmake/CTestCustom.cmake +++ b/config/cmake/CTestCustom.cmake @@ -2,9 +2,10 @@ SET (CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS 1500) SET (CTEST_CUSTOM_WARNING_EXCEPTION ${CTEST_CUSTOM_WARNING_EXCEPTION} - "H5detect.c.[0-9]+.[ \t]*:[ \t]*warning C4090" + "H5detect.c.[0-9]+.[ \t]*:[ \t]*warning C4090:" "H5detect.c.[0-9]+.[ \t]*:[ \t]*warning:[ \t]*passing argument" "H5detect.c[0-9 \t:]*warning:[ \t]*passing argument" + "note:[ \t]*expected .void .. but argument is of type .volatile" "H5Tconv.c[0-9 \t:]*warning:[ \t]*comparison is always false due to limited range of data type" "testhdf5.h.[0-9]+.[ \t]*:[ \t]*warning C4005" "H5Ztrans.c.[0-9]+.[ \t]*:[ \t]*warning C4244" @@ -20,8 +21,17 @@ SET (CTEST_CUSTOM_MEMCHECK_IGNORE error_test #uses runTest.cmake err_compat #uses runTest.cmake links_env #uses runTest.cmake + testlibinfo #uses grepTest.cmake + h5test-clear-testhdf5-objects h5test-clear-objects - h5perform-clear-objects + h5test-clear-cache-objects + h5test-clear-cache_api-objects + h5test-clear-cache_tagging-objects + h5test-clear-ttsafe-objects + h5test-clear-err_compat-objects + h5test-clear-error_test-objects + h5test-clear-links_env-objects + PERFORM_h5perform-clear-objects hl_test-clear-objects hl_fortran_test-clear-objects ######### tools/h5copy ######### @@ -41,22 +51,6 @@ SET (CTEST_CUSTOM_MEMCHECK_IGNORE H5DUMP-XML-clearall-objects ######### tools/h5import ######### H5IMPORT-clear-objects - H5IMPORT-ASCII_F32-clear-objects - H5IMPORT-ASCII_UI16-clear-objects - H5IMPORT-ASCII_UI32-clear-objects - H5IMPORT-ASCII_I8-clear-objects - H5IMPORT-ASCII_I16-clear-objects - H5IMPORT-ASCII_I32-clear-objects - H5IMPORT-ASCII_F64_R1-clear-objects - H5IMPORT-BINARY_I8_EOF-clear-objects - H5IMPORT-STR-clear-objects - H5IMPORT-BINARY_UI32-clear-objects - H5IMPORT-BINARY_UI16-clear-objects - H5IMPORT-BINARY_I32-clear-objects - H5IMPORT-BINARY_I8-clear-objects - H5IMPORT-BINARY_I16-clear-objects - H5IMPORT-BINARY_F64-clear-objects - H5IMPORT-ASCII_F64-clear-objects ######### tools/h5jam ######### H5JAM-SETUP-N_twithub_u10_c-clear-objects H5JAM-SETUP-N_twithub_u10_c @@ -222,40 +216,40 @@ SET (CTEST_CUSTOM_MEMCHECK_IGNORE H5MKGRP_CMP-clear-h5mkgrp_version H5MKGRP-clear-h5mkgrp_single H5MKGRP-h5mkgrp_single #uses runTest.cmake - H5MKGRP-H5LS-h5mkgrp_single #uses runTest.cmake + H5MKGRP-h5ls-h5mkgrp_single #uses runTest.cmake H5MKGRP-clear-h5mkgrp_single-v H5MKGRP-h5mkgrp_single-v #uses runTest.cmake - H5MKGRP-H5LS-h5mkgrp_single-v #uses runTest.cmake + H5MKGRP-h5ls-h5mkgrp_single-v #uses runTest.cmake H5MKGRP-clear-h5mkgrp_single-p H5MKGRP-h5mkgrp_single-p #uses runTest.cmake - H5MKGRP-H5LS-h5mkgrp_single-p #uses runTest.cmake + H5MKGRP-h5ls-h5mkgrp_single-p #uses runTest.cmake H5MKGRP-clear-h5mkgrp_single_latest-l H5MKGRP-h5mkgrp_single_latest-l #uses runTest.cmake - H5MKGRP-H5LS-h5mkgrp_single_latest-l #uses runTest.cmake + H5MKGRP-h5ls-h5mkgrp_single_latest-l #uses runTest.cmake H5MKGRP-clear-h5mkgrp_several H5MKGRP-h5mkgrp_several #uses runTest.cmake - H5MKGRP-H5LS-h5mkgrp_several #uses runTest.cmake + H5MKGRP-h5ls-h5mkgrp_several #uses runTest.cmake H5MKGRP-clear-h5mkgrp_several-v H5MKGRP-h5mkgrp_several-v #uses runTest.cmake - H5MKGRP-H5LS-h5mkgrp_several-v #uses runTest.cmake + H5MKGRP-h5ls-h5mkgrp_several-v #uses runTest.cmake H5MKGRP-clear-h5mkgrp_several-p H5MKGRP-h5mkgrp_several-p #uses runTest.cmake - H5MKGRP-H5LS-h5mkgrp_several-p #uses runTest.cmake + H5MKGRP-h5ls-h5mkgrp_several-p #uses runTest.cmake H5MKGRP-clear-h5mkgrp_several_latest-l H5MKGRP-h5mkgrp_several_latest-l #uses runTest.cmake - H5MKGRP-H5LS-h5mkgrp_several_latest-l #uses runTest.cmake + H5MKGRP-h5ls-h5mkgrp_several_latest-l #uses runTest.cmake H5MKGRP-clear-h5mkgrp_nested-p H5MKGRP-h5mkgrp_nested-p #uses runTest.cmake - H5MKGRP-H5LS-h5mkgrp_nested-p #uses runTest.cmake + H5MKGRP-h5ls-h5mkgrp_nested-p #uses runTest.cmake H5MKGRP-clear-h5mkgrp_nested_latest-lp H5MKGRP-h5mkgrp_nested_latest-lp #uses runTest.cmake - H5MKGRP-H5LS-h5mkgrp_nested_latest-lp #uses runTest.cmake + H5MKGRP-h5ls-h5mkgrp_nested_latest-lp #uses runTest.cmake H5MKGRP-clear-h5mkgrp_nested_mult-p H5MKGRP-h5mkgrp_nested_mult-p #uses runTest.cmake - H5MKGRP-H5LS-h5mkgrp_nested_mult-p #uses runTest.cmake + H5MKGRP-h5ls-h5mkgrp_nested_mult-p #uses runTest.cmake H5MKGRP-clear-h5mkgrp_nested_mult_latest-lp H5MKGRP-h5mkgrp_nested_mult_latest-lp #uses runTest.cmake - H5MKGRP-H5LS-h5mkgrp_nested_mult_latest-lp #uses runTest.cmake + H5MKGRP-h5ls-h5mkgrp_nested_mult_latest-lp #uses runTest.cmake ######### examples ######### EXAMPLES-clear-objects cpp_ex-clear-objects diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake index f1883cd..963152c 100644 --- a/config/cmake/ConfigureChecks.cmake +++ b/config/cmake/ConfigureChecks.cmake @@ -10,6 +10,7 @@ INCLUDE (${CMAKE_ROOT}/Modules/CheckSymbolExists.cmake) INCLUDE (${CMAKE_ROOT}/Modules/CheckTypeSize.cmake) INCLUDE (${CMAKE_ROOT}/Modules/CheckVariableExists.cmake) INCLUDE (${CMAKE_ROOT}/Modules/CheckFortranFunctionExists.cmake) +INCLUDE (${CMAKE_ROOT}/Modules/TestBigEndian.cmake) #----------------------------------------------------------------------------- # Always SET this for now IF we are on an OS X box @@ -128,8 +129,12 @@ ENDMACRO (CHECK_LIBRARY_EXISTS_CONCAT) SET (WINDOWS) IF (WIN32) + SET (H5_HAVE_WIN32_API 1) IF (NOT UNIX AND NOT CYGWIN AND NOT MINGW) SET (WINDOWS 1) + IF (MSVC) + SET (H5_HAVE_VISUAL_STUDIO 1) + ENDIF (MSVC) ENDIF (NOT UNIX AND NOT CYGWIN AND NOT MINGW) ENDIF (WIN32) @@ -146,18 +151,14 @@ ENDIF (WIN32) # IF (WINDOWS) SET (H5_HAVE_WINDOWS 1) -# SET (H5_WINDOWS_USE_STDIO 0) # ---------------------------------------------------------------------- # Set the flag to indicate that the machine has window style pathname, # that is, "drive-letter:\" (e.g. "C:") or "drive-letter:/" (e.g. "C:/"). # (This flag should be _unset_ for all machines, except for Windows) - # SET (H5_HAVE_WINDOW_PATH 1) - SET (WINDOWS_MAX_BUF (1024 * 1024 * 1024)) - SET (H5_DEFAULT_VFD H5FD_WINDOWS) -ELSE (WINDOWS) - SET (H5_DEFAULT_VFD H5FD_SEC2) + SET (LINK_LIBS ${LINK_LIBS} "kernel32") ENDIF (WINDOWS) +SET (H5_DEFAULT_VFD H5FD_SEC2) IF (WINDOWS) SET (H5_HAVE_IO_H 1) @@ -208,7 +209,6 @@ ENDIF (NOT WINDOWS) CHECK_LIBRARY_EXISTS_CONCAT ("ws2_32" WSAStartup H5_HAVE_LIBWS2_32) CHECK_LIBRARY_EXISTS_CONCAT ("wsock32" gethostbyname H5_HAVE_LIBWSOCK32) -#CHECK_LIBRARY_EXISTS_CONCAT ("dl" dlopen H5_HAVE_LIBDL) CHECK_LIBRARY_EXISTS_CONCAT ("ucb" gethostname H5_HAVE_LIBUCB) CHECK_LIBRARY_EXISTS_CONCAT ("socket" connect H5_HAVE_LIBSOCKET) CHECK_LIBRARY_EXISTS ("c" gethostbyname "" NOT_NEED_LIBNSL) @@ -219,6 +219,12 @@ ENDIF (NOT NOT_NEED_LIBNSL) SET (USE_INCLUDES "") +IF (WINDOWS) + SET (USE_INCLUDES ${USE_INCLUDES} "windows.h") +ENDIF (WINDOWS) + +TEST_BIG_ENDIAN(H5_WORDS_BIGENDIAN) + #----------------------------------------------------------------------------- # Check IF header file exists and add it to the list. #----------------------------------------------------------------------------- @@ -255,10 +261,12 @@ ELSE (CMAKE_SYSTEM_NAME MATCHES "OSF") ENDIF (CMAKE_SYSTEM_NAME MATCHES "OSF") CHECK_INCLUDE_FILE_CONCAT ("sys/time.h" H5_HAVE_SYS_TIME_H) CHECK_INCLUDE_FILE_CONCAT ("time.h" H5_HAVE_TIME_H) +CHECK_INCLUDE_FILE_CONCAT ("mach/mach_time.h" H5_HAVE_MACH_MACH_TIME_H) CHECK_INCLUDE_FILE_CONCAT ("sys/timeb.h" H5_HAVE_SYS_TIMEB_H) CHECK_INCLUDE_FILE_CONCAT ("sys/types.h" H5_HAVE_SYS_TYPES_H) CHECK_INCLUDE_FILE_CONCAT ("unistd.h" H5_HAVE_UNISTD_H) CHECK_INCLUDE_FILE_CONCAT ("stdlib.h" H5_HAVE_STDLIB_H) +CHECK_INCLUDE_FILE_CONCAT ("memory.h" H5_HAVE_MEMORY_H) CHECK_INCLUDE_FILE_CONCAT ("dlfcn.h" H5_HAVE_DLFCN_H) CHECK_INCLUDE_FILE_CONCAT ("features.h" H5_HAVE_FEATURES_H) CHECK_INCLUDE_FILE_CONCAT ("inttypes.h" H5_HAVE_INTTYPES_H) @@ -275,6 +283,7 @@ IF (H5_HAVE_STDINT_H AND CMAKE_CXX_COMPILER_LOADED) CHECK_INCLUDE_FILE_CXX ("stdint.h" H5_HAVE_STDINT_H_CXX) IF (NOT H5_HAVE_STDINT_H_CXX) SET (H5_HAVE_STDINT_H "" CACHE INTERNAL "Have includes HAVE_STDINT_H") + SET (USE_INCLUDES ${USE_INCLUDES} "stdint.h") ENDIF (NOT H5_HAVE_STDINT_H_CXX) ENDIF (H5_HAVE_STDINT_H AND CMAKE_CXX_COMPILER_LOADED) @@ -286,16 +295,43 @@ ENDIF (H5_HAVE_STDINT_H AND CMAKE_CXX_COMPILER_LOADED) SET (LINUX_LFS 0) SET (HDF5_EXTRA_FLAGS) -IF (CMAKE_SYSTEM MATCHES "Linux-([3-9]\\.[0-9]|2\\.[4-9])\\.") +#IF (CMAKE_SYSTEM MATCHES "Linux-([3-9]\\.[0-9]|2\\.[4-9])\\.") +IF (NOT WINDOWS) # Linux Specific flags SET (HDF5_EXTRA_FLAGS -D_POSIX_SOURCE -D_BSD_SOURCE) OPTION (HDF5_ENABLE_LARGE_FILE "Enable support for large (64-bit) files on Linux." ON) IF (HDF5_ENABLE_LARGE_FILE) - SET (LARGEFILE 1) - SET (HDF5_EXTRA_FLAGS ${HDF5_EXTRA_FLAGS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE) + SET (msg "Performing TEST_LFS_WORKS") + TRY_RUN (TEST_LFS_WORKS_RUN TEST_LFS_WORKS_COMPILE + ${HDF5_BINARY_DIR}/CMake + ${HDF5_RESOURCES_DIR}/HDF5Tests.c + CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=-DTEST_LFS_WORKS + OUTPUT_VARIABLE OUTPUT + ) + IF (TEST_LFS_WORKS_COMPILE) + IF (TEST_LFS_WORKS_RUN MATCHES 0) + SET (TEST_LFS_WORKS 1 CACHE INTERNAL ${msg}) + SET (LARGEFILE 1) + SET (HDF5_EXTRA_FLAGS ${HDF5_EXTRA_FLAGS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE) + MESSAGE (STATUS "${msg}... yes") + ELSE (TEST_LFS_WORKS_RUN MATCHES 0) + SET (TEST_LFS_WORKS "" CACHE INTERNAL ${msg}) + MESSAGE (STATUS "${msg}... no") + FILE (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log + "Test TEST_LFS_WORKS Run failed with the following output and exit code:\n ${OUTPUT}\n" + ) + ENDIF (TEST_LFS_WORKS_RUN MATCHES 0) + ELSE (TEST_LFS_WORKS_COMPILE ) + SET (TEST_LFS_WORKS "" CACHE INTERNAL ${msg}) + MESSAGE (STATUS "${msg}... no") + FILE (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log + "Test TEST_LFS_WORKS Compile failed with the following output:\n ${OUTPUT}\n" + ) + ENDIF (TEST_LFS_WORKS_COMPILE) ENDIF (HDF5_ENABLE_LARGE_FILE) SET (CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} ${HDF5_EXTRA_FLAGS}) -ENDIF (CMAKE_SYSTEM MATCHES "Linux-([3-9]\\.[0-9]|2\\.[4-9])\\.") +ENDIF (NOT WINDOWS) +#ENDIF (CMAKE_SYSTEM MATCHES "Linux-([3-9]\\.[0-9]|2\\.[4-9])\\.") ADD_DEFINITIONS (${HDF5_EXTRA_FLAGS}) @@ -367,6 +403,21 @@ IF (NOT H5_SIZEOF_OFF64_T) SET (H5_SIZEOF_OFF64_T 0) ENDIF (NOT H5_SIZEOF_OFF64_T) +# Find the library containing clock_gettime() +IF (NOT WINDOWS) + CHECK_FUNCTION_EXISTS(clock_gettime CLOCK_GETTIME_IN_LIBC) + CHECK_LIBRARY_EXISTS(rt clock_gettime "" CLOCK_GETTIME_IN_LIBRT) + CHECK_LIBRARY_EXISTS(posix4 clock_gettime "" CLOCK_GETTIME_IN_LIBPOSIX4) + IF(CLOCK_GETTIME_IN_LIBC) + SET(H5_HAVE_CLOCK_GETTIME 1) + ELSEIF(CLOCK_GETTIME_IN_LIBRT) + SET(H5_HAVE_CLOCK_GETTIME 1) + LIST(APPEND LINK_LIBS rt) + ELSEIF(CLOCK_GETTIME_IN_LIBPOSIX4) + SET(H5_HAVE_CLOCK_GETTIME 1) + LIST(APPEND LINK_LIBS posix4) + ENDIF(CLOCK_GETTIME_IN_LIBC) +ENDIF (NOT WINDOWS) # For other tests to use the same libraries SET (CMAKE_REQUIRED_LIBRARIES ${LINK_LIBS}) @@ -573,12 +624,76 @@ IF (NOT WINDOWS) HDF5_FUNCTION_TEST (${test}) ENDFOREACH (test) IF (NOT CYGWIN AND NOT MINGW) - HDF5_FUNCTION_TEST (HAVE_TIMEZONE) + HDF5_FUNCTION_TEST (HAVE_TIMEZONE) # HDF5_FUNCTION_TEST (HAVE_STAT_ST_BLOCKS) ENDIF (NOT CYGWIN AND NOT MINGW) ENDIF (NOT WINDOWS) #----------------------------------------------------------------------------- +# Check if InitOnceExecuteOnce is available +#----------------------------------------------------------------------------- +IF (WINDOWS AND NOT HDF5_NO_IOEO_TEST) + MESSAGE (STATUS "Checking for InitOnceExecuteOnce:") + IF("${H5_HAVE_IOEO}" MATCHES "^${H5_HAVE_IOEO}$") + IF (LARGEFILE) + SET (CMAKE_REQUIRED_DEFINITIONS + "${CURRENT_TEST_DEFINITIONS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE" + ) + ENDIF (LARGEFILE) + SET(MACRO_CHECK_FUNCTION_DEFINITIONS + "-DHAVE_IOEO ${CMAKE_REQUIRED_FLAGS}") + IF(CMAKE_REQUIRED_LIBRARIES) + SET(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES + "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") + ELSE(CMAKE_REQUIRED_LIBRARIES) + SET(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES) + ENDIF(CMAKE_REQUIRED_LIBRARIES) + IF(CMAKE_REQUIRED_INCLUDES) + SET(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES + "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}") + ELSE(CMAKE_REQUIRED_INCLUDES) + SET(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES) + ENDIF(CMAKE_REQUIRED_INCLUDES) + + TRY_RUN(HAVE_IOEO_EXITCODE HAVE_IOEO_COMPILED + ${CMAKE_BINARY_DIR} + ${HDF5_RESOURCES_DIR}/HDF5Tests.c + COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} + CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS} + -DCMAKE_SKIP_RPATH:BOOL=${CMAKE_SKIP_RPATH} + "${CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES}" + "${CHECK_C_SOURCE_COMPILES_ADD_INCLUDES}" + COMPILE_OUTPUT_VARIABLE OUTPUT) + # if it did not compile make the return value fail code of 1 + IF(NOT HAVE_IOEO_COMPILED) + SET(HAVE_IOEO_EXITCODE 1) + ENDIF(NOT HAVE_IOEO_COMPILED) + # if the return value was 0 then it worked + IF("${HAVE_IOEO_EXITCODE}" EQUAL 0) + SET(H5_HAVE_IOEO 1 CACHE INTERNAL "Test InitOnceExecuteOnce") + MESSAGE(STATUS "Performing Test InitOnceExecuteOnce - Success") + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "Performing C SOURCE FILE Test InitOnceExecuteOnce succeded with the following output:\n" + "${OUTPUT}\n" + "Return value: ${HAVE_IOEO}\n") + ELSE("${HAVE_IOEO_EXITCODE}" EQUAL 0) + IF(CMAKE_CROSSCOMPILING AND "${HAVE_IOEO_EXITCODE}" MATCHES "FAILED_TO_RUN") + SET(H5_HAVE_IOEO "${HAVE_IOEO_EXITCODE}") + ELSE(CMAKE_CROSSCOMPILING AND "${HAVE_IOEO_EXITCODE}" MATCHES "FAILED_TO_RUN") + SET(H5_HAVE_IOEO "" CACHE INTERNAL "Test InitOnceExecuteOnce") + ENDIF(CMAKE_CROSSCOMPILING AND "${HAVE_IOEO_EXITCODE}" MATCHES "FAILED_TO_RUN") + + MESSAGE(STATUS "Performing Test InitOnceExecuteOnce - Failed") + FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log + "Performing InitOnceExecuteOnce Test failed with the following output:\n" + "${OUTPUT}\n" + "Return value: ${HAVE_IOEO_EXITCODE}\n") + ENDIF("${HAVE_IOEO_EXITCODE}" EQUAL 0) + ENDIF("${H5_HAVE_IOEO}" MATCHES "^${H5_HAVE_IOEO}$") +ENDIF (WINDOWS AND NOT HDF5_NO_IOEO_TEST) + + +#----------------------------------------------------------------------------- # Option to see if GPFS is available on this filesystem --enable-gpfs #----------------------------------------------------------------------------- OPTION (HDF5_ENABLE_GPFS "Enable GPFS hints for the MPI/POSIX file driver" OFF) @@ -851,4 +966,4 @@ H5ConversionTests (H5_NO_ALIGNMENT_RESTRICTIONS "Checking IF alignment restricti # problem converting from unsigned long long to long double */ IF (CYGWIN) SET (H5_CYGWIN_ULLONG_TO_LDOUBLE_ROUND_PROBLEM 1) -ENDIF (CYGWIN) +ENDIF (CYGWIN) \ No newline at end of file diff --git a/config/cmake/FindHDF5.cmake b/config/cmake/FindHDF5.cmake index a705d5b..33532b0 100644 --- a/config/cmake/FindHDF5.cmake +++ b/config/cmake/FindHDF5.cmake @@ -63,8 +63,8 @@ FIND_PATH (HDF5_ROOT_DIR "hdf5-config.cmake" HINTS ${_HDF5_HINTS} PATHS ${_HDF5_PATHS} PATH_SUFFIXES - lib/cmake/hdf5-1.9 - share/cmake/hdf5-1.9 + lib/cmake/hdf5 + share/cmake/hdf5 ) FIND_PATH (HDF5_INCLUDE_DIRS "H5public.h" diff --git a/config/cmake/FindMPI.cmake b/config/cmake/FindMPI.cmake index 555d2d5..b16c9c3 100644 --- a/config/cmake/FindMPI.cmake +++ b/config/cmake/FindMPI.cmake @@ -1,59 +1,70 @@ -# - Message Passing Interface (MPI) module. -# +# - Find a Message Passing Interface (MPI) implementation # The Message Passing Interface (MPI) is a library used to write -# high-performance parallel applications that use message passing, and +# high-performance distributed-memory parallel applications, and # is typically deployed on a cluster. MPI is a standard interface # (defined by the MPI forum) for which many implementations are -# available. All of these implementations have somewhat different -# compilation approaches (different include paths, libraries to link -# against, etc.), and this module tries to smooth out those differences. -# -# This module will set the following variables: -# MPI_FOUND TRUE if we have found MPI -# MPI_COMPILE_FLAGS Compilation flags for MPI programs -# MPI_INCLUDE_PATH Include path(s) for MPI header -# MPI_LINK_FLAGS Linking flags for MPI programs -# MPI_LIBRARY First MPI library to link against (cached) -# MPI_EXTRA_LIBRARY Extra MPI libraries to link against (cached) -# MPI_LIBRARIES All libraries to link MPI programs against -# MPIEXEC Executable for running MPI programs -# MPIEXEC_NUMPROC_FLAG Flag to pass to MPIEXEC before giving it the -# number of processors to run on -# MPIEXEC_PREFLAGS Flags to pass to MPIEXEC directly before the -# executable to run. -# MPIEXEC_POSTFLAGS Flags to pass to MPIEXEC after all other flags. +# available. All of them have somewhat different include paths, +# libraries to link against, etc., and this module tries to smooth +# out those differences. # -# This module will attempt to auto-detect these settings, first by -# looking for a MPI compiler, which many MPI implementations provide -# as a pass-through to the native compiler to simplify the compilation -# of MPI programs. The MPI compiler is stored in the cache variable -# MPI_COMPILER, and will attempt to look for commonly-named drivers -# mpic++, mpicxx, mpiCC, or mpicc. If the compiler driver is found and -# recognized, it will be used to set all of the module variables. To -# skip this auto-detection, set MPI_LIBRARY and MPI_INCLUDE_PATH in -# the CMake cache. +# === Variables === # -# If no compiler driver is found or the compiler driver is not -# recognized, this module will then search for common include paths -# and library names to try to detect MPI. +# This module will set the following variables per language in your project, +# where is one of C, CXX, or Fortran: +# MPI__FOUND TRUE if FindMPI found MPI flags for +# MPI__COMPILER MPI Compiler wrapper for +# MPI__COMPILE_FLAGS Compilation flags for MPI programs +# MPI__INCLUDE_PATH Include path(s) for MPI header +# MPI__LINK_FLAGS Linking flags for MPI programs +# MPI__LIBRARIES All libraries to link MPI programs against +# Additionally, FindMPI sets the following variables for running MPI +# programs from the command line: +# MPIEXEC Executable for running MPI programs +# MPIEXEC_NUMPROC_FLAG Flag to pass to MPIEXEC before giving +# it the number of processors to run on +# MPIEXEC_PREFLAGS Flags to pass to MPIEXEC directly +# before the executable to run. +# MPIEXEC_POSTFLAGS Flags to pass to MPIEXEC after other flags +# === Usage === # -# If CMake initially finds a different MPI than was intended, and you -# want to use the MPI compiler auto-detection for a different MPI -# implementation, set MPI_COMPILER to the MPI compiler driver you want -# to use (e.g., mpicxx) and then set MPI_LIBRARY to the string -# MPI_LIBRARY-NOTFOUND. When you re-configure, auto-detection of MPI -# will run again with the newly-specified MPI_COMPILER. +# To use this module, simply call FindMPI from a CMakeLists.txt file, or +# run find_package(MPI), then run CMake. If you are happy with the auto- +# detected configuration for your language, then you're done. If not, you +# have two options: +# 1. Set MPI__COMPILER to the MPI wrapper (mpicc, etc.) of your +# choice and reconfigure. FindMPI will attempt to determine all the +# necessary variables using THAT compiler's compile and link flags. +# 2. If this fails, or if your MPI implementation does not come with +# a compiler wrapper, then set both MPI__LIBRARIES and +# MPI__INCLUDE_PATH. You may also set any other variables +# listed above, but these two are required. This will circumvent +# autodetection entirely. +# When configuration is successful, MPI__COMPILER will be set to the +# compiler wrapper for , if it was found. MPI__FOUND and other +# variables above will be set if any MPI implementation was found for , +# regardless of whether a compiler was found. # -# When using MPIEXEC to execute MPI applications, you should typically -# use all of the MPIEXEC flags as follows: -# ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} PROCS ${MPIEXEC_PREFLAGS} EXECUTABLE -# ${MPIEXEC_POSTFLAGS} ARGS +# When using MPIEXEC to execute MPI applications, you should typically use +# all of the MPIEXEC flags as follows: +# ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} PROCS +# ${MPIEXEC_PREFLAGS} EXECUTABLE ${MPIEXEC_POSTFLAGS} ARGS # where PROCS is the number of processors on which to execute the program, # EXECUTABLE is the MPI program, and ARGS are the arguments to pass to the # MPI program. +# +# === Backward Compatibility === +# +# For backward compatibility with older versions of FindMPI, these +# variables are set, but deprecated: +# MPI_FOUND MPI_COMPILER MPI_LIBRARY +# MPI_COMPILE_FLAGS MPI_INCLUDE_PATH MPI_EXTRA_LIBRARY +# MPI_LINK_FLAGS MPI_LIBRARIES +# In new projects, please use the MPI__XXX equivalents. #============================================================================= -# Copyright 2001-2009 Kitware, Inc. +# Copyright 2001-2011 Kitware, Inc. +# Copyright 2010-2011 Todd Gamblin tgamblin@llnl.gov +# Copyright 2001-2009 Dave Partyka # # Distributed under the OSI-approved BSD License (the "License"); # see accompanying file Copyright.txt for details. @@ -62,303 +73,556 @@ # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # See the License for more information. #============================================================================= -# (To distributed this file outside of CMake, substitute the full +# (To distribute this file outside of CMake, substitute the full # License text for the above reference.) -# This module is maintained by David Partyka . +# include this to handle the QUIETLY and REQUIRED arguments +include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake) +include(GetPrerequisites) + +# +# This part detects MPI compilers, attempting to wade through the mess of compiler names in +# a sensible way. +# +# The compilers are detected in this order: +# +# 1. Try to find the most generic availble MPI compiler, as this is usually set up by +# cluster admins. e.g., if plain old mpicc is available, we'll use it and assume it's +# the right compiler. +# +# 2. If a generic mpicc is NOT found, then we attempt to find one that matches +# CMAKE__COMPILER_ID. e.g. if you are using XL compilers, we'll try to find mpixlc +# and company, but not mpiicc. This hopefully prevents toolchain mismatches. +# +# If you want to force a particular MPI compiler other than what we autodetect (e.g. if you +# want to compile regular stuff with GNU and parallel stuff with Intel), you can always set +# your favorite MPI__COMPILER explicitly and this stuff will be ignored. +# + +# Start out with the generic MPI compiler names, as these are most commonly used. +set(_MPI_C_COMPILER_NAMES mpicc mpcc mpicc_r mpcc_r) +set(_MPI_CXX_COMPILER_NAMES mpicxx mpiCC mpcxx mpCC mpic++ mpc++ + mpicxx_r mpiCC_r mpcxx_r mpCC_r mpic++_r mpc++_r) +set(_MPI_Fortran_COMPILER_NAMES mpif95 mpif95_r mpf95 mpf95_r + mpif90 mpif90_r mpf90 mpf90_r + mpif77 mpif77_r mpf77 mpf77_r) + +# GNU compiler names +set(_MPI_GNU_C_COMPILER_NAMES mpigcc mpgcc mpigcc_r mpgcc_r) +set(_MPI_GNU_CXX_COMPILER_NAMES mpig++ mpg++ mpig++_r mpg++_r) +set(_MPI_GNU_Fortran_COMPILER_NAMES mpigfortran mpgfortran mpigfortran_r mpgfortran_r + mpig77 mpig77_r mpg77 mpg77_r) + +# Intel MPI compiler names +set(_MPI_Intel_C_COMPILER_NAMES mpiicc) +set(_MPI_Intel_CXX_COMPILER_NAMES mpiicpc mpiicxx mpiic++ mpiiCC) +set(_MPI_Intel_Fortran_COMPILER_NAMES mpiifort mpiif95 mpiif90 mpiif77) + +# PGI compiler names +set(_MPI_PGI_C_COMPILER_NAMES mpipgcc mppgcc) +set(_MPI_PGI_CXX_COMPILER_NAMES mpipgCC mppgCC) +set(_MPI_PGI_Fortran_COMPILER_NAMES mpipgf95 mpipgf90 mppgf95 mppgf90 mpipgf77 mppgf77) + +# XLC MPI Compiler names +set(_MPI_XL_C_COMPILER_NAMES mpxlc mpxlc_r mpixlc mpixlc_r) +set(_MPI_XL_CXX_COMPILER_NAMES mpixlcxx mpixlC mpixlc++ mpxlcxx mpxlc++ mpixlc++ mpxlCC + mpixlcxx_r mpixlC_r mpixlc++_r mpxlcxx_r mpxlc++_r mpixlc++_r mpxlCC_r) +set(_MPI_XL_Fortran_COMPILER_NAMES mpixlf95 mpixlf95_r mpxlf95 mpxlf95_r + mpixlf90 mpixlf90_r mpxlf90 mpxlf90_r + mpixlf77 mpixlf77_r mpxlf77 mpxlf77_r + mpixlf mpixlf_r mpxlf mpxlf_r) + +# append vendor-specific compilers to the list if we either don't know the compiler id, +# or if we know it matches the regular compiler. +foreach (lang C CXX Fortran) + foreach (id GNU Intel PGI XL) + if (NOT CMAKE_${lang}_COMPILER_ID OR "${CMAKE_${lang}_COMPILER_ID}" STREQUAL "${id}") + list(APPEND _MPI_${lang}_COMPILER_NAMES ${_MPI_${id}_${lang}_COMPILER_NAMES}) + endif() + unset(_MPI_${id}_${lang}_COMPILER_NAMES) # clean up the namespace here + endforeach() +endforeach() -# A set of directories to search through in addition to the standard system paths -# that find_program will search through. -# Microsoft HPC SDK is automatically added to the system path -# Argonne National Labs MPICH2 sets a registry key that we can use. -set(_MPI_PACKAGE_DIR - mpi - mpich - openmpi - lib/mpi - lib/mpich - lib/openmpi - "MPICH/SDK" - "Microsoft Compute Cluster Pack" - ) +# Names to try for MPI exec +set(_MPI_EXEC_NAMES mpiexec mpirun lamexec srun) +# Grab the path to MPI from the registry if we're on windows. set(_MPI_PREFIX_PATH) if(WIN32) list(APPEND _MPI_PREFIX_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MPICH\\SMPD;binary]/..") list(APPEND _MPI_PREFIX_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MPICH2;Path]") + list(APPEND _MPI_PREFIX_PATH "$ENV{ProgramW6432}/MPICH2/") endif() +# Build a list of prefixes to search for MPI. foreach(SystemPrefixDir ${CMAKE_SYSTEM_PREFIX_PATH}) foreach(MpiPackageDir ${_MPI_PREFIX_PATH}) if(EXISTS ${SystemPrefixDir}/${MpiPackageDir}) list(APPEND _MPI_PREFIX_PATH "${SystemPrefixDir}/${MpiPackageDir}") endif() - endforeach(MpiPackageDir) -endforeach(SystemPrefixDir) + endforeach() +endforeach() + + +# +# interrogate_mpi_compiler(lang try_libs) +# +# Attempts to extract compiler and linker args from an MPI compiler. The arguments set +# by this function are: +# +# MPI__INCLUDE_PATH MPI__LINK_FLAGS MPI__FOUND +# MPI__COMPILE_FLAGS MPI__LIBRARIES +# +# MPI__COMPILER must be set beforehand to the absolute path to an MPI compiler for +# . Additionally, MPI__INCLUDE_PATH and MPI__LIBRARIES may be set +# to skip autodetection. +# +# If try_libs is TRUE, this will also attempt to find plain MPI libraries in the usual +# way. In general, this is not as effective as interrogating the compilers, as it +# ignores language-specific flags and libraries. However, some MPI implementations +# (Windows implementations) do not have compiler wrappers, so this approach must be used. +# +function (interrogate_mpi_compiler lang try_libs) + # MPI_${lang}_NO_INTERROGATE will be set to a compiler name when the *regular* compiler was + # discovered to be the MPI compiler. This happens on machines like the Cray XE6 that use + # modules to set cc, CC, and ftn to the MPI compilers. If the user force-sets another MPI + # compiler, MPI_${lang}_COMPILER won't be equal to MPI_${lang}_NO_INTERROGATE, and we'll + # inspect that compiler anew. This allows users to set new compilers w/o rm'ing cache. + string(COMPARE NOTEQUAL "${MPI_${lang}_NO_INTERROGATE}" "${MPI_${lang}_COMPILER}" interrogate) + + # If MPI is set already in the cache, don't bother with interrogating the compiler. + if (interrogate AND ((NOT MPI_${lang}_INCLUDE_PATH) OR (NOT MPI_${lang}_LIBRARIES))) + if (MPI_${lang}_COMPILER) + # Check whether the -showme:compile option works. This indicates that we have either OpenMPI + # or a newer version of LAM-MPI, and implies that -showme:link will also work. + execute_process( + COMMAND ${MPI_${lang}_COMPILER} -showme:compile + OUTPUT_VARIABLE MPI_COMPILE_CMDLINE OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_VARIABLE MPI_COMPILE_CMDLINE ERROR_STRIP_TRAILING_WHITESPACE + RESULT_VARIABLE MPI_COMPILER_RETURN) + + if (MPI_COMPILER_RETURN EQUAL 0) + # If we appear to have -showme:compile, then we should + # also have -showme:link. Try it. + execute_process( + COMMAND ${MPI_${lang}_COMPILER} -showme:link + OUTPUT_VARIABLE MPI_LINK_CMDLINE OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_VARIABLE MPI_LINK_CMDLINE ERROR_STRIP_TRAILING_WHITESPACE + RESULT_VARIABLE MPI_COMPILER_RETURN) + + if (MPI_COMPILER_RETURN EQUAL 0) + # We probably have -showme:incdirs and -showme:libdirs as well, + # so grab that while we're at it. + execute_process( + COMMAND ${MPI_${lang}_COMPILER} -showme:incdirs + OUTPUT_VARIABLE MPI_INCDIRS OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_VARIABLE MPI_INCDIRS ERROR_STRIP_TRAILING_WHITESPACE) + + execute_process( + COMMAND ${MPI_${lang}_COMPILER} -showme:libdirs + OUTPUT_VARIABLE MPI_LIBDIRS OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_VARIABLE MPI_LIBDIRS ERROR_STRIP_TRAILING_WHITESPACE) + + else() + # reset things here if something went wrong. + set(MPI_COMPILE_CMDLINE) + set(MPI_LINK_CMDLINE) + endif() + endif () + + # Older versions of LAM-MPI have "-showme". Try to find that. + if (NOT MPI_COMPILER_RETURN EQUAL 0) + execute_process( + COMMAND ${MPI_${lang}_COMPILER} -showme + OUTPUT_VARIABLE MPI_COMPILE_CMDLINE OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_VARIABLE MPI_COMPILE_CMDLINE ERROR_STRIP_TRAILING_WHITESPACE + RESULT_VARIABLE MPI_COMPILER_RETURN) + endif() + + # MVAPICH uses -compile-info and -link-info. Try them. + if (NOT MPI_COMPILER_RETURN EQUAL 0) + execute_process( + COMMAND ${MPI_${lang}_COMPILER} -compile-info + OUTPUT_VARIABLE MPI_COMPILE_CMDLINE OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_VARIABLE MPI_COMPILE_CMDLINE ERROR_STRIP_TRAILING_WHITESPACE + RESULT_VARIABLE MPI_COMPILER_RETURN) + + # If we have compile-info, also have link-info. + if (MPI_COMPILER_RETURN EQUAL 0) + execute_process( + COMMAND ${MPI_${lang}_COMPILER} -link-info + OUTPUT_VARIABLE MPI_LINK_CMDLINE OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_VARIABLE MPI_LINK_CMDLINE ERROR_STRIP_TRAILING_WHITESPACE + RESULT_VARIABLE MPI_COMPILER_RETURN) + endif() + + # make sure we got compile and link. Reset vars if something's wrong. + if (NOT MPI_COMPILER_RETURN EQUAL 0) + set(MPI_COMPILE_CMDLINE) + set(MPI_LINK_CMDLINE) + endif() + endif() + + # MPICH just uses "-show". Try it. + if (NOT MPI_COMPILER_RETURN EQUAL 0) + execute_process( + COMMAND ${MPI_${lang}_COMPILER} -show + OUTPUT_VARIABLE MPI_COMPILE_CMDLINE OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_VARIABLE MPI_COMPILE_CMDLINE ERROR_STRIP_TRAILING_WHITESPACE + RESULT_VARIABLE MPI_COMPILER_RETURN) + endif() + + if (MPI_COMPILER_RETURN EQUAL 0) + # We have our command lines, but we might need to copy MPI_COMPILE_CMDLINE + # into MPI_LINK_CMDLINE, if we didn't find the link line. + if (NOT MPI_LINK_CMDLINE) + set(MPI_LINK_CMDLINE ${MPI_COMPILE_CMDLINE}) + endif() + else() + message(STATUS "Unable to determine MPI from MPI driver ${MPI_${lang}_COMPILER}") + set(MPI_COMPILE_CMDLINE) + set(MPI_LINK_CMDLINE) + endif() + + # Here, we're done with the interrogation part, and we'll try to extract args we care + # about from what we learned from the compiler wrapper scripts. + + # If interrogation came back with something, extract our variable from the MPI command line + if (MPI_COMPILE_CMDLINE OR MPI_LINK_CMDLINE) + # Extract compile flags from the compile command line. + string(REGEX MATCHALL "(^| )-[Df]([^\" ]+|\"[^\"]+\")" MPI_ALL_COMPILE_FLAGS "${MPI_COMPILE_CMDLINE}") + set(MPI_COMPILE_FLAGS_WORK) + + foreach(FLAG ${MPI_ALL_COMPILE_FLAGS}) + if (MPI_COMPILE_FLAGS_WORK) + set(MPI_COMPILE_FLAGS_WORK "${MPI_COMPILE_FLAGS_WORK} ${FLAG}") + else() + set(MPI_COMPILE_FLAGS_WORK ${FLAG}) + endif() + endforeach() + + # Extract include paths from compile command line + string(REGEX MATCHALL "(^| )-I([^\" ]+|\"[^\"]+\")" MPI_ALL_INCLUDE_PATHS "${MPI_COMPILE_CMDLINE}") + foreach(IPATH ${MPI_ALL_INCLUDE_PATHS}) + string(REGEX REPLACE "^ ?-I" "" IPATH ${IPATH}) + string(REGEX REPLACE "//" "/" IPATH ${IPATH}) + list(APPEND MPI_INCLUDE_PATH_WORK ${IPATH}) + endforeach() + + # try using showme:incdirs if extracting didn't work. + if (NOT MPI_INCLUDE_PATH_WORK) + set(MPI_INCLUDE_PATH_WORK ${MPI_INCDIRS}) + separate_arguments(MPI_INCLUDE_PATH_WORK) + endif() + + # If all else fails, just search for mpi.h in the normal include paths. + if (NOT MPI_INCLUDE_PATH_WORK) + set(MPI_HEADER_PATH "MPI_HEADER_PATH-NOTFOUND" CACHE FILEPATH "Cleared" FORCE) + find_path(MPI_HEADER_PATH mpi.h + HINTS ${_MPI_BASE_DIR} ${_MPI_PREFIX_PATH} + PATH_SUFFIXES include) + set(MPI_INCLUDE_PATH_WORK ${MPI_HEADER_PATH}) + endif() + + # Extract linker paths from the link command line + string(REGEX MATCHALL "(^| |-Wl,)-L([^\" ]+|\"[^\"]+\")" MPI_ALL_LINK_PATHS "${MPI_LINK_CMDLINE}") + set(MPI_LINK_PATH) + foreach(LPATH ${MPI_ALL_LINK_PATHS}) + string(REGEX REPLACE "^(| |-Wl,)-L" "" LPATH ${LPATH}) + string(REGEX REPLACE "//" "/" LPATH ${LPATH}) + list(APPEND MPI_LINK_PATH ${LPATH}) + endforeach() + + # try using showme:libdirs if extracting didn't work. + if (NOT MPI_LINK_PATH) + set(MPI_LINK_PATH ${MPI_LIBDIRS}) + separate_arguments(MPI_LINK_PATH) + endif() + + # Extract linker flags from the link command line + string(REGEX MATCHALL "(^| )-Wl,([^\" ]+|\"[^\"]+\")" MPI_ALL_LINK_FLAGS "${MPI_LINK_CMDLINE}") + set(MPI_LINK_FLAGS_WORK) + foreach(FLAG ${MPI_ALL_LINK_FLAGS}) + if (MPI_LINK_FLAGS_WORK) + set(MPI_LINK_FLAGS_WORK "${MPI_LINK_FLAGS_WORK} ${FLAG}") + else() + set(MPI_LINK_FLAGS_WORK ${FLAG}) + endif() + endforeach() + + # Extract the set of libraries to link against from the link command + # line + string(REGEX MATCHALL "(^| )-l([^\" ]+|\"[^\"]+\")" MPI_LIBNAMES "${MPI_LINK_CMDLINE}") + + # Determine full path names for all of the libraries that one needs + # to link against in an MPI program + foreach(LIB ${MPI_LIBNAMES}) + string(REGEX REPLACE "^ ?-l" "" LIB ${LIB}) + # MPI_LIB is cached by find_library, but we don't want that. Clear it first. + set(MPI_LIB "MPI_LIB-NOTFOUND" CACHE FILEPATH "Cleared" FORCE) + find_library(MPI_LIB NAMES ${LIB} HINTS ${MPI_LINK_PATH}) + + if (MPI_LIB) + list(APPEND MPI_LIBRARIES_WORK ${MPI_LIB}) + elseif (NOT MPI_FIND_QUIETLY) + message(WARNING "Unable to find MPI library ${LIB}") + endif() + endforeach() + + # Sanity check MPI_LIBRARIES to make sure there are enough libraries + list(LENGTH MPI_LIBRARIES_WORK MPI_NUMLIBS) + list(LENGTH MPI_LIBNAMES MPI_NUMLIBS_EXPECTED) + if (NOT MPI_NUMLIBS EQUAL MPI_NUMLIBS_EXPECTED) + set(MPI_LIBRARIES_WORK "MPI_${lang}_LIBRARIES-NOTFOUND") + endif() + endif() + + elseif(try_libs) + # If we didn't have an MPI compiler script to interrogate, attempt to find everything + # with plain old find functions. This is nasty because MPI implementations have LOTS of + # different library names, so this section isn't going to be very generic. We need to + # make sure it works for MS MPI, though, since there are no compiler wrappers for that. + find_path(MPI_HEADER_PATH mpi.h + HINTS ${_MPI_BASE_DIR} ${_MPI_PREFIX_PATH} + PATH_SUFFIXES include Inc) + set(MPI_INCLUDE_PATH_WORK ${MPI_HEADER_PATH}) + + # Decide between 32-bit and 64-bit libraries for Microsoft's MPI + if("${CMAKE_SIZEOF_VOID_P}" EQUAL 8) + set(MS_MPI_ARCH_DIR amd64) + else() + set(MS_MPI_ARCH_DIR i386) + endif() + + set(MPI_LIB "MPI_LIB-NOTFOUND" CACHE FILEPATH "Cleared" FORCE) + find_library(MPI_LIB + NAMES mpi mpich mpich2 msmpi + HINTS ${_MPI_BASE_DIR} ${_MPI_PREFIX_PATH} + PATH_SUFFIXES lib lib/${MS_MPI_ARCH_DIR} Lib Lib/${MS_MPI_ARCH_DIR}) + set(MPI_LIBRARIES_WORK ${MPI_LIB}) + + # Right now, we only know about the extra libs for C++. + # We could add Fortran here (as there is usually libfmpich, etc.), but + # this really only has to work with MS MPI on Windows. + # Assume that other MPI's are covered by the compiler wrappers. + if (${lang} STREQUAL CXX) + set(MPI_LIB "MPI_LIB-NOTFOUND" CACHE FILEPATH "Cleared" FORCE) + find_library(MPI_LIB + NAMES mpi++ mpicxx cxx mpi_cxx + HINTS ${_MPI_BASE_DIR} ${_MPI_PREFIX_PATH} + PATH_SUFFIXES lib) + if (MPI_LIBRARIES_WORK AND MPI_LIB) + set(MPI_LIBRARIES_WORK ${MPI_LIBRARIES_WORK} ${MPI_LIB}) + endif() + endif() + + if (${lang} STREQUAL Fortran) + set(MPI_LIB "MPI_LIB-NOTFOUND" CACHE FILEPATH "Cleared" FORCE) + find_library(MPI_LIB + NAMES fmpi fmpich fmpich2 fmpich2g + HINTS ${_MPI_BASE_DIR} ${_MPI_PREFIX_PATH} + PATH_SUFFIXES lib) + if (MPI_LIBRARIES_WORK AND MPI_LIB) + set(MPI_LIBRARIES_WORK ${MPI_LIBRARIES_WORK} ${MPI_LIB}) + endif() + endif() + + if (NOT MPI_LIBRARIES_WORK) + set(MPI_LIBRARIES_WORK "MPI_${lang}_LIBRARIES-NOTFOUND") + endif() + endif() + + # If we found MPI, set up all of the appropriate cache entries + set(MPI_${lang}_COMPILE_FLAGS ${MPI_COMPILE_FLAGS_WORK} CACHE STRING "MPI ${lang} compilation flags" FORCE) + set(MPI_${lang}_INCLUDE_PATH ${MPI_INCLUDE_PATH_WORK} CACHE STRING "MPI ${lang} include path" FORCE) + set(MPI_${lang}_LINK_FLAGS ${MPI_LINK_FLAGS_WORK} CACHE STRING "MPI ${lang} linking flags" FORCE) + set(MPI_${lang}_LIBRARIES ${MPI_LIBRARIES_WORK} CACHE STRING "MPI ${lang} libraries to link against" FORCE) + mark_as_advanced(MPI_${lang}_COMPILE_FLAGS MPI_${lang}_INCLUDE_PATH MPI_${lang}_LINK_FLAGS MPI_${lang}_LIBRARIES) + + # clear out our temporary lib/header detectionv variable here. + set(MPI_LIB "MPI_LIB-NOTFOUND" CACHE INTERNAL "Scratch variable for MPI lib detection" FORCE) + set(MPI_HEADER_PATH "MPI_HEADER_PATH-NOTFOUND" CACHE INTERNAL "Scratch variable for MPI header detection" FORCE) + endif() + + # finally set a found variable for each MPI language + if (MPI_${lang}_INCLUDE_PATH AND MPI_${lang}_LIBRARIES) + set(MPI_${lang}_FOUND TRUE PARENT_SCOPE) + else() + set(MPI_${lang}_FOUND FALSE PARENT_SCOPE) + endif() +endfunction() + + +# This function attempts to compile with the regular compiler, to see if MPI programs +# work with it. This is a last ditch attempt after we've tried interrogating mpicc and +# friends, and after we've tried to find generic libraries. Works on machines like +# Cray XE6, where the modules environment changes what MPI version cc, CC, and ftn use. +function(try_regular_compiler lang success) + set(scratch_directory ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}) + if (${lang} STREQUAL Fortran) + set(test_file ${scratch_directory}/cmake_mpi_test.f90) + file(WRITE ${test_file} + "program hello\n" + "include 'mpif.h'\n" + "integer ierror\n" + "call MPI_INIT(ierror)\n" + "call MPI_FINALIZE(ierror)\n" + "end\n") + else() + if (${lang} STREQUAL CXX) + set(test_file ${scratch_directory}/cmake_mpi_test.cpp) + else() + set(test_file ${scratch_directory}/cmake_mpi_test.c) + endif() + file(WRITE ${test_file} + "#include \n" + "int main(int argc, char **argv) {\n" + " MPI_Init(&argc, &argv);\n" + " MPI_Finalize();\n" + "}\n") + endif() + try_compile(compiler_has_mpi ${scratch_directory} ${test_file}) + if (compiler_has_mpi) + set(MPI_${lang}_NO_INTERROGATE ${CMAKE_${lang}_COMPILER} CACHE STRING "Whether to interrogate MPI ${lang} compiler" FORCE) + set(MPI_${lang}_COMPILER ${CMAKE_${lang}_COMPILER} CACHE STRING "MPI ${lang} compiler" FORCE) + set(MPI_${lang}_COMPILE_FLAGS "" CACHE STRING "MPI ${lang} compilation flags" FORCE) + set(MPI_${lang}_INCLUDE_PATH "" CACHE STRING "MPI ${lang} include path" FORCE) + set(MPI_${lang}_LINK_FLAGS "" CACHE STRING "MPI ${lang} linking flags" FORCE) + set(MPI_${lang}_LIBRARIES "" CACHE STRING "MPI ${lang} libraries to link against" FORCE) + endif() + set(${success} ${compiler_has_mpi} PARENT_SCOPE) + unset(compiler_has_mpi CACHE) +endfunction() + +# End definitions, commence real work here. # Most mpi distros have some form of mpiexec which gives us something we can reliably look for. find_program(MPIEXEC - NAMES mpiexec mpirun lamexec + NAMES ${_MPI_EXEC_NAMES} PATHS ${_MPI_PREFIX_PATH} PATH_SUFFIXES bin - DOC "Executable for running MPI programs." - ) + DOC "Executable for running MPI programs.") # call get_filename_component twice to remove mpiexec and the directory it exists in (typically bin). # This gives us a fairly reliable base directory to search for /bin /lib and /include from. get_filename_component(_MPI_BASE_DIR "${MPIEXEC}" PATH) get_filename_component(_MPI_BASE_DIR "${_MPI_BASE_DIR}" PATH) -# If there is an mpi compiler find it and interogate (farther below) it for the include -# and lib dirs otherwise we will continue to search from ${_MPI_BASE_DIR}. -find_program(MPI_COMPILER - NAMES mpiCC mpicc mpic++ mpicxx - HINTS "${_MPI_BASE_DIR}" - PATH_SUFFIXES bin - DOC "MPI compiler. Used only to detect MPI compilation flags.") -mark_as_advanced(MPI_COMPILER) - set(MPIEXEC_NUMPROC_FLAG "-np" CACHE STRING "Flag used by MPI to specify the number of processes for MPIEXEC; the next option will be the number of processes.") -set(MPIEXEC_PREFLAGS "" CACHE STRING "These flags will be directly before the executable that is being run by MPIEXEC.") -set(MPIEXEC_POSTFLAGS "" CACHE STRING "These flags will come after all flags given to MPIEXEC.") -set(MPIEXEC_MAX_NUMPROCS "2" CACHE STRING "Maximum number of processors available to run MPI applications.") -mark_as_advanced(MPIEXEC MPIEXEC_NUMPROC_FLAG MPIEXEC_PREFLAGS - MPIEXEC_POSTFLAGS MPIEXEC_MAX_NUMPROCS) - -if (MPI_INCLUDE_PATH AND MPI_LIBRARY) - # Do nothing: we already have MPI_INCLUDE_PATH and MPI_LIBRARY in - # the cache, and we don't want to override those settings. -elseif (MPI_COMPILER) - # Check whether the -showme:compile option works. This indicates - # that we have either Open MPI or a newer version of LAM-MPI, and - # implies that -showme:link will also work. - # Note that Windows distros do not have an mpi compiler to interogate. - exec_program(${MPI_COMPILER} - ARGS -showme:compile - OUTPUT_VARIABLE MPI_COMPILE_CMDLINE - RETURN_VALUE MPI_COMPILER_RETURN) - - if (MPI_COMPILER_RETURN EQUAL 0) - # If we appear to have -showme:compile, then we should also have - # -showme:link. Try it. - exec_program(${MPI_COMPILER} - ARGS -showme:link - OUTPUT_VARIABLE MPI_LINK_CMDLINE - RETURN_VALUE MPI_COMPILER_RETURN) - - # Note that we probably have -showme:incdirs and -showme:libdirs - # as well. - set(MPI_COMPILER_MAY_HAVE_INCLIBDIRS TRUE) - endif (MPI_COMPILER_RETURN EQUAL 0) - - if (MPI_COMPILER_RETURN EQUAL 0) - # Do nothing: we have our command lines now - else (MPI_COMPILER_RETURN EQUAL 0) - # Older versions of LAM-MPI have "-showme". Try it. - exec_program(${MPI_COMPILER} - ARGS -showme - OUTPUT_VARIABLE MPI_COMPILE_CMDLINE - RETURN_VALUE MPI_COMPILER_RETURN) - endif (MPI_COMPILER_RETURN EQUAL 0) - - if (MPI_COMPILER_RETURN EQUAL 0) - # Do nothing: we have our command lines now - else (MPI_COMPILER_RETURN EQUAL 0) - # MPICH uses "-show". Try it. - exec_program(${MPI_COMPILER} - ARGS -show - OUTPUT_VARIABLE MPI_COMPILE_CMDLINE - RETURN_VALUE MPI_COMPILER_RETURN) - endif (MPI_COMPILER_RETURN EQUAL 0) - - if (MPI_COMPILER_RETURN EQUAL 0) - # We have our command lines, but we might need to copy - # MPI_COMPILE_CMDLINE into MPI_LINK_CMDLINE, if the underlying - if (NOT MPI_LINK_CMDLINE) - SET(MPI_LINK_CMDLINE ${MPI_COMPILE_CMDLINE}) - endif (NOT MPI_LINK_CMDLINE) - else (MPI_COMPILER_RETURN EQUAL 0) - message(STATUS "Unable to determine MPI from MPI driver ${MPI_COMPILER}") - endif (MPI_COMPILER_RETURN EQUAL 0) -endif (MPI_INCLUDE_PATH AND MPI_LIBRARY) - -if (MPI_INCLUDE_PATH AND MPI_LIBRARY) - # Do nothing: we already have MPI_INCLUDE_PATH and MPI_LIBRARY in - # the cache, and we don't want to override those settings. -elseif (MPI_COMPILE_CMDLINE) - # Extract compile flags from the compile command line. - string(REGEX MATCHALL "-D([^\" ]+|\"[^\"]+\")" MPI_ALL_COMPILE_FLAGS "${MPI_COMPILE_CMDLINE}") - set(MPI_COMPILE_FLAGS_WORK) - foreach(FLAG ${MPI_ALL_COMPILE_FLAGS}) - if (MPI_COMPILE_FLAGS_WORK) - set(MPI_COMPILE_FLAGS_WORK "${MPI_COMPILE_FLAGS_WORK} ${FLAG}") - else(MPI_COMPILE_FLAGS_WORK) - set(MPI_COMPILE_FLAGS_WORK ${FLAG}) - endif(MPI_COMPILE_FLAGS_WORK) - endforeach(FLAG) - - # Extract include paths from compile command line - string(REGEX MATCHALL "-I([^\" ]+|\"[^\"]+\")" MPI_ALL_INCLUDE_PATHS "${MPI_COMPILE_CMDLINE}") - set(MPI_INCLUDE_PATH_WORK) - foreach(IPATH ${MPI_ALL_INCLUDE_PATHS}) - string(REGEX REPLACE "^-I" "" IPATH ${IPATH}) - string(REGEX REPLACE "//" "/" IPATH ${IPATH}) - list(APPEND MPI_INCLUDE_PATH_WORK ${IPATH}) - endforeach(IPATH) - - if (NOT MPI_INCLUDE_PATH_WORK) - if (MPI_COMPILER_MAY_HAVE_INCLIBDIRS) - # The compile command line didn't have any include paths on it, - # but we may have -showme:incdirs. Use it. - exec_program(${MPI_COMPILER} - ARGS -showme:incdirs - OUTPUT_VARIABLE MPI_INCLUDE_PATH_WORK - RETURN_VALUE MPI_COMPILER_RETURN) - separate_arguments(MPI_INCLUDE_PATH_WORK) - endif (MPI_COMPILER_MAY_HAVE_INCLIBDIRS) - endif (NOT MPI_INCLUDE_PATH_WORK) - - if (NOT MPI_INCLUDE_PATH_WORK) - # If all else fails, just search for mpi.h in the normal include - # paths. - find_path(MPI_INCLUDE_PATH mpi.h - HINTS ${_MPI_BASE_DIR} ${_MPI_PREFIX_PATH} - PATH_SUFFIXES include - ) - set(MPI_INCLUDE_PATH_WORK ${MPI_INCLUDE_PATH}) - endif (NOT MPI_INCLUDE_PATH_WORK) - - # Extract linker paths from the link command line - string(REGEX MATCHALL "-L([^\" ]+|\"[^\"]+\")" MPI_ALL_LINK_PATHS "${MPI_LINK_CMDLINE}") - set(MPI_LINK_PATH) - foreach(LPATH ${MPI_ALL_LINK_PATHS}) - string(REGEX REPLACE "^-L" "" LPATH ${LPATH}) - string(REGEX REPLACE "//" "/" LPATH ${LPATH}) - list(APPEND MPI_LINK_PATH ${LPATH}) - endforeach(LPATH) - - if (NOT MPI_LINK_PATH) - if (MPI_COMPILER_MAY_HAVE_INCLIBDIRS) - # The compile command line didn't have any linking paths on it, - # but we may have -showme:libdirs. Use it. - exec_program(${MPI_COMPILER} - ARGS -showme:libdirs - OUTPUT_VARIABLE MPI_LINK_PATH - RETURN_VALUE MPI_COMPILER_RETURN) - separate_arguments(MPI_LINK_PATH) - endif (MPI_COMPILER_MAY_HAVE_INCLIBDIRS) - endif (NOT MPI_LINK_PATH) - - # Extract linker flags from the link command line - string(REGEX MATCHALL "-Wl,([^\" ]+|\"[^\"]+\")" MPI_ALL_LINK_FLAGS "${MPI_LINK_CMDLINE}") - set(MPI_LINK_FLAGS_WORK) - foreach(FLAG ${MPI_ALL_LINK_FLAGS}) - if (MPI_LINK_FLAGS_WORK) - set(MPI_LINK_FLAGS_WORK "${MPI_LINK_FLAGS_WORK} ${FLAG}") - else(MPI_LINK_FLAGS_WORK) - set(MPI_LINK_FLAGS_WORK ${FLAG}) - endif(MPI_LINK_FLAGS_WORK) - endforeach(FLAG) - - # Extract the set of libraries to link against from the link command - # line - string(REGEX MATCHALL "-l([^\" ]+|\"[^\"]+\")" MPI_LIBNAMES "${MPI_LINK_CMDLINE}") - - # Determine full path names for all of the libraries that one needs - # to link against in an MPI program - set(MPI_LIBRARIES) - foreach(LIB ${MPI_LIBNAMES}) - string(REGEX REPLACE "^-l" "" LIB ${LIB}) - set(MPI_LIB "MPI_LIB-NOTFOUND" CACHE FILEPATH "Cleared" FORCE) - find_library(MPI_LIB ${LIB} HINTS ${MPI_LINK_PATH}) - if (MPI_LIB) - list(APPEND MPI_LIBRARIES ${MPI_LIB}) - else (MPI_LIB) - message(SEND_ERROR "Unable to find MPI library ${LIB}") - endif (MPI_LIB) - endforeach(LIB) - set(MPI_LIB "MPI_LIB-NOTFOUND" CACHE INTERNAL "Scratch variable for MPI detection" FORCE) - - # Chop MPI_LIBRARIES into the old-style MPI_LIBRARY and - # MPI_EXTRA_LIBRARY. - list(LENGTH MPI_LIBRARIES MPI_NUMLIBS) - list(LENGTH MPI_LIBNAMES MPI_NUMLIBS_EXPECTED) - if (MPI_NUMLIBS EQUAL MPI_NUMLIBS_EXPECTED) - list(GET MPI_LIBRARIES 0 MPI_LIBRARY_WORK) - set(MPI_LIBRARY ${MPI_LIBRARY_WORK} CACHE FILEPATH "MPI library to link against" FORCE) - else (MPI_NUMLIBS EQUAL MPI_NUMLIBS_EXPECTED) - set(MPI_LIBRARY "MPI_LIBRARY-NOTFOUND" CACHE FILEPATH "MPI library to link against" FORCE) - endif (MPI_NUMLIBS EQUAL MPI_NUMLIBS_EXPECTED) - if (MPI_NUMLIBS GREATER 1) - set(MPI_EXTRA_LIBRARY_WORK ${MPI_LIBRARIES}) - list(REMOVE_AT MPI_EXTRA_LIBRARY_WORK 0) - set(MPI_EXTRA_LIBRARY ${MPI_EXTRA_LIBRARY_WORK} CACHE STRING "Extra MPI libraries to link against" FORCE) - else (MPI_NUMLIBS GREATER 1) - set(MPI_EXTRA_LIBRARY "MPI_EXTRA_LIBRARY-NOTFOUND" CACHE STRING "Extra MPI libraries to link against" FORCE) - endif (MPI_NUMLIBS GREATER 1) - - # Set up all of the appropriate cache entries - set(MPI_COMPILE_FLAGS ${MPI_COMPILE_FLAGS_WORK} CACHE STRING "MPI compilation flags" FORCE) - set(MPI_INCLUDE_PATH ${MPI_INCLUDE_PATH_WORK} CACHE STRING "MPI include path" FORCE) - set(MPI_LINK_FLAGS ${MPI_LINK_FLAGS_WORK} CACHE STRING "MPI linking flags" FORCE) -else (MPI_COMPILE_CMDLINE) -# No MPI compiler to interogate so attempt to find everything with find functions. - find_path(MPI_INCLUDE_PATH mpi.h - HINTS ${_MPI_BASE_DIR} ${_MPI_PREFIX_PATH} - PATH_SUFFIXES include - ) - - # Decide between 32-bit and 64-bit libraries for Microsoft's MPI - if("${CMAKE_SIZEOF_VOID_P}" EQUAL 8) - set(MS_MPI_ARCH_DIR amd64) - else() - set(MS_MPI_ARCH_DIR i386) +set(MPIEXEC_PREFLAGS "" CACHE STRING "These flags will be directly before the executable that is being run by MPIEXEC.") +set(MPIEXEC_POSTFLAGS "" CACHE STRING "These flags will come after all flags given to MPIEXEC.") +set(MPIEXEC_MAX_NUMPROCS "2" CACHE STRING "Maximum number of processors available to run MPI applications.") +mark_as_advanced(MPIEXEC MPIEXEC_NUMPROC_FLAG MPIEXEC_PREFLAGS MPIEXEC_POSTFLAGS MPIEXEC_MAX_NUMPROCS) + + +#============================================================================= +# Backward compatibility input hacks. Propagate the FindMPI hints to C and +# CXX if the respective new versions are not defined. Translate the old +# MPI_LIBRARY and MPI_EXTRA_LIBRARY to respective MPI_${lang}_LIBRARIES. +# +# Once we find the new variables, we translate them back into their old +# equivalents below. +foreach (lang C CXX) + # Old input variables. + set(_MPI_OLD_INPUT_VARS COMPILER COMPILE_FLAGS INCLUDE_PATH LINK_FLAGS) + + # Set new vars based on their old equivalents, if the new versions are not already set. + foreach (var ${_MPI_OLD_INPUT_VARS}) + if (NOT MPI_${lang}_${var} AND MPI_${var}) + set(MPI_${lang}_${var} "${MPI_${var}}") + endif() + endforeach() + + # Special handling for MPI_LIBRARY and MPI_EXTRA_LIBRARY, which we nixed in the + # new FindMPI. These need to be merged into MPI__LIBRARIES + if (NOT MPI_${lang}_LIBRARIES AND (MPI_LIBRARY OR MPI_EXTRA_LIBRARY)) + set(MPI_${lang}_LIBRARIES ${MPI_LIBRARY} ${MPI_EXTRA_LIBRARY}) + endif() +endforeach() +#============================================================================= + + +# This loop finds the compilers and sends them off for interrogation. +foreach (lang C CXX Fortran) + if (CMAKE_${lang}_COMPILER_WORKS) + # If the user supplies a compiler *name* instead of an absolute path, assume that we need to find THAT compiler. + if (MPI_${lang}_COMPILER) + is_file_executable(MPI_${lang}_COMPILER MPI_COMPILER_IS_EXECUTABLE) + if (NOT MPI_COMPILER_IS_EXECUTABLE) + # Get rid of our default list of names and just search for the name the user wants. + set(_MPI_${lang}_COMPILER_NAMES ${MPI_${lang}_COMPILER}) + set(MPI_${lang}_COMPILER "MPI_${lang}_COMPILER-NOTFOUND" CACHE FILEPATH "Cleared" FORCE) + # If the user specifies a compiler, we don't want to try to search libraries either. + set(try_libs FALSE) + endif() + else() + set(try_libs TRUE) + endif() + + find_program(MPI_${lang}_COMPILER + NAMES ${_MPI_${lang}_COMPILER_NAMES} + PATHS "${MPI_HOME}/bin" "$ENV{MPI_HOME}/bin" ${_MPI_PREFIX_PATH}) + interrogate_mpi_compiler(${lang} ${try_libs}) + mark_as_advanced(MPI_${lang}_COMPILER) + + # last ditch try -- if nothing works so far, just try running the regular compiler and + # see if we can create an MPI executable. + set(regular_compiler_worked 0) + if (NOT MPI_${lang}_LIBRARIES OR NOT MPI_${lang}_INCLUDE_PATH) + try_regular_compiler(${lang} regular_compiler_worked) + endif() + + if (regular_compiler_worked) + find_package_handle_standard_args(MPI_${lang} DEFAULT_MSG MPI_${lang}_COMPILER) + else() + find_package_handle_standard_args(MPI_${lang} DEFAULT_MSG MPI_${lang}_LIBRARIES MPI_${lang}_INCLUDE_PATH) + endif() endif() +endforeach() - find_library(MPI_LIBRARY - NAMES mpi mpich msmpi - HINTS ${_MPI_BASE_DIR} ${_MPI_PREFIX_PATH} - PATH_SUFFIXES lib lib/${MS_MPI_ARCH_DIR} Lib Lib/${MS_MPI_ARCH_DIR} - ) - - find_library(MPI_EXTRA_LIBRARY - NAMES mpi++ - HINTS ${_MPI_BASE_DIR} ${_MPI_PREFIX_PATH} - PATH_SUFFIXES lib - DOC "Extra MPI libraries to link against.") - - set(MPI_COMPILE_FLAGS "" CACHE STRING "MPI compilation flags") - set(MPI_LINK_FLAGS "" CACHE STRING "MPI linking flags") -endif (MPI_INCLUDE_PATH AND MPI_LIBRARY) - -# on BlueGene/L the MPI lib is named libmpich.rts.a, there also these additional libs are required -if("${MPI_LIBRARY}" MATCHES "mpich.rts") - set(MPI_EXTRA_LIBRARY ${MPI_EXTRA_LIBRARY} msglayer.rts devices.rts rts.rts devices.rts) - set(MPI_LIBRARY ${MPI_LIBRARY} msglayer.rts devices.rts rts.rts devices.rts) -endif("${MPI_LIBRARY}" MATCHES "mpich.rts") - -# Set up extra variables to conform to -if (MPI_EXTRA_LIBRARY) - set(MPI_LIBRARIES ${MPI_LIBRARY} ${MPI_EXTRA_LIBRARY}) -else (MPI_EXTRA_LIBRARY) - set(MPI_LIBRARIES ${MPI_LIBRARY}) -endif (MPI_EXTRA_LIBRARY) - -if (MPI_INCLUDE_PATH AND MPI_LIBRARY) - set(MPI_FOUND TRUE) -else (MPI_INCLUDE_PATH AND MPI_LIBRARY) + +#============================================================================= +# More backward compatibility stuff +# +# Bare MPI sans ${lang} vars are set to CXX then C, depending on what was found. +# This mimics the behavior of the old language-oblivious FindMPI. +set(_MPI_OLD_VARS FOUND COMPILER INCLUDE_PATH COMPILE_FLAGS LINK_FLAGS LIBRARIES) +if (MPI_CXX_FOUND) + foreach (var ${_MPI_OLD_VARS}) + set(MPI_${var} ${MPI_CXX_${var}}) + endforeach() +elseif (MPI_C_FOUND) + foreach (var ${_MPI_OLD_VARS}) + set(MPI_${var} ${MPI_C_${var}}) + endforeach() +else() + # Note that we might still have found Fortran, but you'll need to use MPI_Fortran_FOUND set(MPI_FOUND FALSE) -endif (MPI_INCLUDE_PATH AND MPI_LIBRARY) +endif() -include(FindPackageHandleStandardArgs) -# handle the QUIETLY and REQUIRED arguments -find_package_handle_standard_args(MPI DEFAULT_MSG MPI_LIBRARY MPI_INCLUDE_PATH) +# Chop MPI_LIBRARIES into the old-style MPI_LIBRARY and MPI_EXTRA_LIBRARY, and set them in cache. +if (MPI_LIBRARIES) + list(GET MPI_LIBRARIES 0 MPI_LIBRARY_WORK) + set(MPI_LIBRARY ${MPI_LIBRARY_WORK} CACHE FILEPATH "MPI library to link against" FORCE) +else() + set(MPI_LIBRARY "MPI_LIBRARY-NOTFOUND" CACHE FILEPATH "MPI library to link against" FORCE) +endif() -mark_as_advanced(MPI_INCLUDE_PATH MPI_COMPILE_FLAGS MPI_LINK_FLAGS MPI_LIBRARY - MPI_EXTRA_LIBRARY) +list(LENGTH MPI_LIBRARIES MPI_NUMLIBS) +if (MPI_NUMLIBS GREATER 1) + set(MPI_EXTRA_LIBRARY_WORK ${MPI_LIBRARIES}) + list(REMOVE_AT MPI_EXTRA_LIBRARY_WORK 0) + set(MPI_EXTRA_LIBRARY ${MPI_EXTRA_LIBRARY_WORK} CACHE STRING "Extra MPI libraries to link against" FORCE) +else() + set(MPI_EXTRA_LIBRARY "MPI_EXTRA_LIBRARY-NOTFOUND" CACHE STRING "Extra MPI libraries to link against" FORCE) +endif() +#============================================================================= -# unset to cleanup namespace -unset(_MPI_PACKAGE_DIR) +# unset these vars to cleanup namespace +unset(_MPI_OLD_VARS) unset(_MPI_PREFIX_PATH) unset(_MPI_BASE_DIR) +foreach (lang C CXX Fortran) + unset(_MPI_${lang}_COMPILER_NAMES) +endforeach() diff --git a/config/cmake/H5pubconf.h.in b/config/cmake/H5pubconf.h.in index df9c3a8..b2567b5 100644 --- a/config/cmake/H5pubconf.h.in +++ b/config/cmake/H5pubconf.h.in @@ -6,12 +6,11 @@ /* Define if the Windows virtual file driver should be compiled */ #cmakedefine H5_HAVE_WINDOWS @H5_HAVE_WINDOWS@ -/* Define if the Windows virtual file driver should use buffered IO functions */ -/* #undef WINDOWS_USE_STDIO */ +/* Define if on the Windows platform and default WIN32 API */ +#cmakedefine H5_HAVE_WIN32_API @H5_HAVE_WIN32_API@ -/* Define the maximum write size for the Windows file driver. Larger writes - will be split into many writes. Safe values are 1 <= WINDOWS_MAX_BUF <= 2GB-1. */ -#cmakedefine WINDOWS_MAX_BUF (1024 * 1024 * 1024) +/* Define if using a Windows compiler (i.e. Visual Studio) */ +#cmakedefine H5_HAVE_VISUAL_STUDIO @H5_HAVE_VISUAL_STUDIO@ /* Defined if HDF5 was built with CMake AND build as a shared library */ #cmakedefine H5_BUILT_AS_DYNAMIC_LIB @H5_BUILT_AS_DYNAMIC_LIB@ @@ -103,6 +102,9 @@ /* Define if the compiler understands the __func__ keyword */ #cmakedefine H5_HAVE_C99_FUNC @H5_HAVE_C99_FUNC@ +/* Define to 1 if you have the `clock_gettime' function. */ +#cmakedefine H5_HAVE_CLOCK_GETTIME @H5_HAVE_CLOCK_GETTIME@ + /* Define if the function stack tracing code is to be compiled in */ #cmakedefine H5_HAVE_CODESTACK @H5_HAVE_CODESTACK@ @@ -209,9 +211,6 @@ /* Define to 1 if you have the header file. */ #cmakedefine H5_HAVE_GPFS_H @H5_HAVE_GPFS_H@ -/* Define if h5dump packed bits feature is enabled */ -#cmakedefine H5_HAVE_H5DUMP_PACKED_BITS @H5_HAVE_H5DUMP_PACKED_BITS@ - /* Define if library will contain instrumentation to detect correct optimization operation */ #cmakedefine H5_HAVE_INSTRUMENTED_LIBRARY @H5_HAVE_INSTRUMENTED_LIBRARY@ @@ -270,6 +269,12 @@ /* Define to 1 if you have the `lstat' function. */ #cmakedefine H5_HAVE_LSTAT @H5_HAVE_LSTAT@ +/* Define to 1 if you have the header file. */ +#cmakedefine H5_HAVE_MACH_MACH_TIME_H @H5_HAVE_MACH_MACH_TIME_H@ + +/* Define to 1 if you have the header file. */ +#cmakedefine H5_HAVE_MEMORY_H @H5_HAVE_MEMORY_H@ + /* Define if we have MPE support */ #cmakedefine H5_HAVE_MPE @H5_HAVE_MPE@ @@ -514,17 +519,10 @@ /* Define if the metadata trace file code is to be compiled in */ #cmakedefine H5_METADATA_TRACE_FILE @H5_METADATA_TRACE_FILE@ -/* Define if your system can handle complicated MPI derived datatype - correctly. */ -#cmakedefine H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS @H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS@ - /* Define if your system's `MPI_File_set_size' function works for files over 2GB. */ #cmakedefine H5_MPI_FILE_SET_SIZE_BIG @H5_MPI_FILE_SET_SIZE_BIG@ -/* Define if your system can handle special collective IO properly. */ -#cmakedefine H5_MPI_SPECIAL_COLLECTIVE_IO_WORKS @H5_MPI_SPECIAL_COLLECTIVE_IO_WORKS@ - /* Define if we can violate pointer alignment restrictions */ #cmakedefine H5_NO_ALIGNMENT_RESTRICTIONS @H5_NO_ALIGNMENT_RESTRICTIONS@ @@ -729,6 +727,9 @@ /* Define using v1.6 public API symbols by default */ #cmakedefine H5_USE_16_API_DEFAULT @H5_USE_16_API_DEFAULT@ +/* Define using v1.8 public API symbols by default */ +#cmakedefine H5_USE_18_API_DEFAULT @H5_USE_18_API_DEFAULT@ + /* Define if a memory checking tool will be used on the library, to cause library to be very picky about memory operations and also disable the internal free list manager code. */ @@ -759,6 +760,8 @@ # endif #endif +#cmakedefine WORDS_BIGENDIAN @H5_WORDS_BIGENDIANR@ + /* Number of bits in a file offset, on hosts where this is settable. */ #cmakedefine _FILE_OFFSET_BITS diff --git a/config/cmake/HDF5Macros.cmake b/config/cmake/HDF5Macros.cmake index b9e37bb..3e6ee18 100644 --- a/config/cmake/HDF5Macros.cmake +++ b/config/cmake/HDF5Macros.cmake @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------- MACRO (H5_SET_LIB_OPTIONS libtarget libname libtype) - HDF_SET_LIB_OPTIONS (${libtarget} ${libname} ${libtype}) + SET (LIB_OUT_NAME "${libname}") IF (${libtype} MATCHES "SHARED") IF (WIN32) SET (LIBHDF_VERSION ${HDF5_PACKAGE_VERSION_MAJOR}) @@ -8,8 +8,13 @@ MACRO (H5_SET_LIB_OPTIONS libtarget libname libtype) SET (LIBHDF_VERSION ${HDF5_PACKAGE_VERSION}) ENDIF (WIN32) SET_TARGET_PROPERTIES (${libtarget} PROPERTIES VERSION ${LIBHDF_VERSION}) - SET_TARGET_PROPERTIES (${libtarget} PROPERTIES SOVERSION ${LIBHDF_VERSION}) + IF (WIN32) + SET (${LIB_OUT_NAME} "${LIB_OUT_NAME}-${HDF5_PACKAGE_SOVERSION}") + ELSE (WIN32) + SET_TARGET_PROPERTIES (${libtarget} PROPERTIES SOVERSION ${HDF5_PACKAGE_SOVERSION}) + ENDIF (WIN32) ENDIF (${libtype} MATCHES "SHARED") + HDF_SET_LIB_OPTIONS (${libtarget} ${LIB_OUT_NAME} ${libtype}) #-- Apple Specific install_name for libraries IF (APPLE) diff --git a/config/cmake/HDF5Tests.c b/config/cmake/HDF5Tests.c index 55e91a4..79741a8 100644 --- a/config/cmake/HDF5Tests.c +++ b/config/cmake/HDF5Tests.c @@ -327,16 +327,6 @@ int main () #endif /* DEV_T_IS_SCALAR */ -#if defined( INLINE_TEST_inline ) || defined( INLINE_TEST___inline__ ) || defined( INLINE_TEST___inline ) -#ifndef __cplusplus -typedef int foo_t; -static INLINE_TEST_INLINE foo_t static_foo () { return 0; } -INLINE_TEST_INLINE foo_t foo () {return 0; } -int main() { return 0; } -#endif - -#endif /* INLINE_TEST */ - #ifdef HAVE_OFF64_T #include int main() @@ -346,6 +336,37 @@ int main() } #endif +#ifdef TEST_LFS_WORKS +/* Return 0 when LFS is available and 1 otherwise. */ +#define _LARGEFILE_SOURCE +#define _LARGEFILE64_SOURCE +#define _LARGE_FILES +#define _FILE_OFFSET_BITS 64 +#include +#include +#include +#include + +int main(int argc, char **argv) +{ + /* check that off_t can hold 2^63 - 1 and perform basic operations... */ +#define OFF_T_64 (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + if (OFF_T_64 % 2147483647 != 1) + return 1; + + // stat breaks on SCO OpenServer + struct stat buf; + stat( argv[0], &buf ); + if (!S_ISREG(buf.st_mode)) + return 2; + + FILE *file = fopen( argv[0], "r" ); + off_t offset = ftello( file ); + fseek( file, offset, SEEK_CUR ); + fclose( file ); + return 0; +} +#endif #ifdef GETTIMEOFDAY_GIVES_TZ #ifdef HAVE_SYS_TIME_H @@ -384,21 +405,31 @@ int main () #endif /* HAVE_GPFS */ -#ifdef HAVE_WIN_THREADS +#ifdef HAVE_IOEO #include +typedef void (WINAPI *PGNSI)(LPSYSTEM_INFO); int main () { - BOOL first_init_g=INIT_ONCE_STATIC_INIT; - BOOL CALLBACK win32_first_thread_init(PINIT_ONCE InitOnce, PVOID Parameter, PVOID *lpContext); - BOOL ret=FALSE; - - ret=InitOnceExecuteOnce(&first_init_g, win32_first_thread_init, NULL, NULL); - exit(ret ? 0 : 1); + PGNSI pGNSI; + pGNSI = (PGNSI) GetProcAddress( + GetModuleHandle(TEXT("kernel32.dll")), + "InitOnceExecuteOnce"); + if(NULL == pGNSI) + return 1; + else + return 0; } -BOOL CALLBACK -win32_first_thread_init(PINIT_ONCE InitOnce, PVOID Parameter, PVOID *lpContext) -{return TRUE;} -#endif /* HAVE_WIN_THREADS */ +#endif /* HAVE_IOEO */ + + +#if defined( INLINE_TEST_inline ) || defined( INLINE_TEST___inline__ ) || defined( INLINE_TEST___inline ) +#ifndef __cplusplus +typedef int foo_t; +static INLINE_TEST_INLINE foo_t static_foo () { return 0; } +INLINE_TEST_INLINE foo_t foo () {return 0; } +int main() { return 0; } +#endif +#endif /* INLINE_TEST */ diff --git a/config/cmake/HDF5UseFortran.cmake b/config/cmake/HDF5UseFortran.cmake index 1f429f5..c1c5acb 100644 --- a/config/cmake/HDF5UseFortran.cmake +++ b/config/cmake/HDF5UseFortran.cmake @@ -110,6 +110,15 @@ CHECK_FORTRAN_FEATURE(RealIsNotDouble FORTRAN_DEFAULT_REAL_NOT_DOUBLE ) +CHECK_FORTRAN_FEATURE(iso_c_binding + " + PROGRAM main + USE iso_c_binding + END PROGRAM + " + FORTRAN_HAVE_ISO_C_BINDING +) + #----------------------------------------------------------------------------- # Add debug information (intel Fortran : JB) #----------------------------------------------------------------------------- diff --git a/config/cmake/HDFLibMacros.cmake b/config/cmake/HDFLibMacros.cmake new file mode 100644 index 0000000..23c81da --- /dev/null +++ b/config/cmake/HDFLibMacros.cmake @@ -0,0 +1,323 @@ +#------------------------------------------------------------------------------- +MACRO (EXTERNAL_JPEG_LIBRARY compress_type libtype jpeg_pic) + # May need to build JPEG with PIC on x64 machines with gcc + # Need to use CMAKE_ANSI_CFLAGS define so that compiler test works + + IF (${compress_type} MATCHES "SVN") + EXTERNALPROJECT_ADD (JPEG + SVN_REPOSITORY ${JPEG_URL} + # [SVN_REVISION rev] + INSTALL_COMMAND "" + CMAKE_ARGS + -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS} + -DJPEG_EXTERNALLY_CONFIGURED:BOOL=OFF + -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} + -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX} + -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} + -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} + -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} + -DCMAKE_ANSI_CFLAGS:STRING=${jpeg_pic} + ) + ELSEIF (${compress_type} MATCHES "TGZ") + EXTERNALPROJECT_ADD (JPEG + URL ${JPEG_URL} + URL_MD5 "" + INSTALL_COMMAND "" + CMAKE_ARGS + -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS} + -DJPEG_EXTERNALLY_CONFIGURED:BOOL=OFF + -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} + -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX} + -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} + -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} + -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} + -DCMAKE_ANSI_CFLAGS:STRING=${jpeg_pic} + ) + ENDIF (${compress_type} MATCHES "SVN") + EXTERNALPROJECT_GET_PROPERTY (JPEG BINARY_DIR SOURCE_DIR) + + IF (${CMAKE_BUILD_TYPE} MATCHES "Debug") + IF (WIN32 AND NOT MINGW) + SET (JPEG_LIB_NAME "jpeg_D") + ELSE (WIN32 AND NOT MINGW) + SET (JPEG_LIB_NAME "jpeg_debug") + ENDIF (WIN32 AND NOT MINGW) + ELSE (${CMAKE_BUILD_TYPE} MATCHES "Debug") + SET (JPEG_LIB_NAME "jpeg") + ENDIF (${CMAKE_BUILD_TYPE} MATCHES "Debug") + + # Create imported target szip + ADD_LIBRARY(jpeg ${libtype} IMPORTED) + ADD_DEPENDENCIES (jpeg JPEG) + + IF (${libtype} MATCHES "SHARED") + IF (WIN32 AND NOT MINGW) + SET_TARGET_PROPERTIES(jpeg PROPERTIES + IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${BLDTYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${JPEG_LIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}" + IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${BLDTYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${JPEG_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" + ) + ELSE (WIN32 AND NOT MINGW) + IF (CYGWIN) + SET_TARGET_PROPERTIES(jpeg PROPERTIES + IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_IMPORT_LIBRARY_PREFIX}${JPEG_LIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}" + IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_IMPORT_LIBRARY_PREFIX}${JPEG_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" + ) + ELSE (CYGWIN) + SET_TARGET_PROPERTIES(jpeg PROPERTIES + IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_SHARED_LIBRARY_PREFIX}${JPEG_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" + IMPORTED_SONAME "${CMAKE_SHARED_LIBRARY_PREFIX}${JPEG_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}.${JPEG_VERSION_STRING}" + SOVERSION "${JPEG_VERSION_STRING}" + ) + ENDIF (CYGWIN) + ENDIF (WIN32 AND NOT MINGW) + ELSE (${libtype} MATCHES "SHARED") + IF (WIN32 AND NOT MINGW) + SET_TARGET_PROPERTIES(jpeg PROPERTIES + IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${BLDTYPE}/lib${JPEG_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}" + IMPORTED_LINK_INTERFACE_LANGUAGES "C" + ) + ELSE (WIN32 AND NOT MINGW) + SET_TARGET_PROPERTIES(jpeg PROPERTIES + IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/lib${JPEG_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}" + IMPORTED_LINK_INTERFACE_LANGUAGES "C" + ) + ENDIF (WIN32 AND NOT MINGW) + ENDIF (${libtype} MATCHES "SHARED") + +# INCLUDE (${BINARY_DIR}/JPEG-targets.cmake) + SET (JPEG_LIBRARY "jpeg") + + SET (JPEG_INCLUDE_DIR_GEN "${BINARY_DIR}") + SET (JPEG_INCLUDE_DIR "${SOURCE_DIR}/src") + SET (JPEG_FOUND 1) + SET (JPEG_LIBRARIES ${JPEG_LIBRARY}) + SET (JPEG_INCLUDE_DIRS ${JPEG_INCLUDE_DIR_GEN} ${JPEG_INCLUDE_DIR}) +ENDMACRO (EXTERNAL_JPEG_LIBRARY) + +#------------------------------------------------------------------------------- +MACRO (PACKAGE_JPEG_LIBRARY compress_type) + ADD_CUSTOM_TARGET (JPEG-GenHeader-Copy ALL + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${JPEG_INCLUDE_DIR_GEN}/jconfig.h ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ + COMMENT "Copying ${JPEG_INCLUDE_DIR_GEN}/jconfig.h to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/" + ) + SET (EXTERNAL_HEADER_LIST ${EXTERNAL_HEADER_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/jconfig.h) + IF (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") + ADD_DEPENDENCIES (JPEG-GenHeader-Copy JPEG) + ENDIF (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") +ENDMACRO (PACKAGE_JPEG_LIBRARY) + +#------------------------------------------------------------------------------- +MACRO (EXTERNAL_SZIP_LIBRARY compress_type libtype encoding) + IF (${compress_type} MATCHES "SVN") + EXTERNALPROJECT_ADD (SZIP + SVN_REPOSITORY ${SZIP_URL} + # [SVN_REVISION rev] + INSTALL_COMMAND "" + CMAKE_ARGS + -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS} + -DSZIP_EXTERNALLY_CONFIGURED:BOOL=OFF + -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} + -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX} + -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} + -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} + -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} + -DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS} + -DSZIP_ENABLE_ENCODING:BOOL=${encoding} + ) + ELSEIF (${compress_type} MATCHES "TGZ") + EXTERNALPROJECT_ADD (SZIP + URL ${SZIP_URL} + URL_MD5 "" + INSTALL_COMMAND "" + CMAKE_ARGS + -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS} + -DSZIP_EXTERNALLY_CONFIGURED:BOOL=OFF + -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} + -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX} + -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} + -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} + -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} + -DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS} + -DSZIP_ENABLE_ENCODING:BOOL=${encoding} + ) + ENDIF (${compress_type} MATCHES "SVN") + EXTERNALPROJECT_GET_PROPERTY (SZIP BINARY_DIR SOURCE_DIR) + + IF (${CMAKE_BUILD_TYPE} MATCHES "Debug") + IF (WIN32 AND NOT MINGW) + SET (SZIP_LIB_NAME "szip_D") + ELSE (WIN32 AND NOT MINGW) + SET (SZIP_LIB_NAME "szip_debug") + ENDIF (WIN32 AND NOT MINGW) + ELSE (${CMAKE_BUILD_TYPE} MATCHES "Debug") + SET (SZIP_LIB_NAME "szip") + ENDIF (${CMAKE_BUILD_TYPE} MATCHES "Debug") + + # Create imported target szip + ADD_LIBRARY(szip ${libtype} IMPORTED) + ADD_DEPENDENCIES (szip SZIP) + + IF (${libtype} MATCHES "SHARED") + IF (WIN32 AND NOT MINGW) + SET_TARGET_PROPERTIES(szip PROPERTIES + IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${BLDTYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${SZIP_LIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}" + IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${BLDTYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${SZIP_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" + ) + ELSE (WIN32 AND NOT MINGW) + IF (CYGWIN) + SET_TARGET_PROPERTIES(szip PROPERTIES + IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_IMPORT_LIBRARY_PREFIX}${SZIP_LIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}" + IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_IMPORT_LIBRARY_PREFIX}${SZIP_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" + ) + ELSE (CYGWIN) + SET_TARGET_PROPERTIES(szip PROPERTIES + IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_SHARED_LIBRARY_PREFIX}${SZIP_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" + IMPORTED_SONAME "${CMAKE_SHARED_LIBRARY_PREFIX}${SZIP_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}.${SZIP_VERSION_STRING}" + SOVERSION "${SZIP_VERSION_STRING}" + ) + ENDIF (CYGWIN) + ENDIF (WIN32 AND NOT MINGW) + ELSE (${libtype} MATCHES "SHARED") + IF (WIN32 AND NOT MINGW) + SET_TARGET_PROPERTIES(szip PROPERTIES + IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${BLDTYPE}/lib${SZIP_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}" + IMPORTED_LINK_INTERFACE_LANGUAGES "C" + ) + ELSE (WIN32 AND NOT MINGW) + SET_TARGET_PROPERTIES(szip PROPERTIES + IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/lib${SZIP_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}" + IMPORTED_LINK_INTERFACE_LANGUAGES "C" + ) + ENDIF (WIN32 AND NOT MINGW) + ENDIF (${libtype} MATCHES "SHARED") + +# INCLUDE (${BINARY_DIR}/SZIP-targets.cmake) + SET (SZIP_LIBRARY "szip") + + SET (SZIP_INCLUDE_DIR_GEN "${BINARY_DIR}") + SET (SZIP_INCLUDE_DIR "${SOURCE_DIR}/src") + SET (SZIP_FOUND 1) + SET (SZIP_LIBRARIES ${SZIP_LIBRARY}) + SET (SZIP_INCLUDE_DIRS ${SZIP_INCLUDE_DIR_GEN} ${SZIP_INCLUDE_DIR}) +ENDMACRO (EXTERNAL_SZIP_LIBRARY) + +#------------------------------------------------------------------------------- +MACRO (PACKAGE_SZIP_LIBRARY compress_type) + ADD_CUSTOM_TARGET (SZIP-GenHeader-Copy ALL + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${SZIP_INCLUDE_DIR_GEN}/SZconfig.h ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ + COMMENT "Copying ${SZIP_INCLUDE_DIR_GEN}/SZconfig.h to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/" + ) + SET (EXTERNAL_HEADER_LIST ${EXTERNAL_HEADER_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/SZconfig.h) + IF (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") + ADD_DEPENDENCIES (SZIP-GenHeader-Copy SZIP) + ENDIF (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") +ENDMACRO (PACKAGE_SZIP_LIBRARY) + +#------------------------------------------------------------------------------- +MACRO (EXTERNAL_ZLIB_LIBRARY compress_type libtype) + IF (${compress_type} MATCHES "SVN") + EXTERNALPROJECT_ADD (ZLIB + SVN_REPOSITORY ${ZLIB_URL} + # [SVN_REVISION rev] + INSTALL_COMMAND "" + CMAKE_ARGS + -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS} + -DZLIB_EXTERNALLY_CONFIGURED:BOOL=OFF + -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} + -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX} + -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} + -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} + -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} + -DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS} + ) + ELSEIF (${compress_type} MATCHES "TGZ") + EXTERNALPROJECT_ADD (ZLIB + URL ${ZLIB_URL} + URL_MD5 "" + INSTALL_COMMAND "" + CMAKE_ARGS + -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS} + -DZLIB_EXTERNALLY_CONFIGURED:BOOL=OFF + -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} + -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX} + -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} + -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} + -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} + -DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS} + ) + ENDIF (${compress_type} MATCHES "SVN") + EXTERNALPROJECT_GET_PROPERTY (ZLIB BINARY_DIR SOURCE_DIR) + + IF (${CMAKE_BUILD_TYPE} MATCHES "Debug") + IF (WIN32 AND NOT MINGW) + SET (ZLIB_LIB_NAME "zlib_D") + ELSE (WIN32 AND NOT MINGW) + SET (ZLIB_LIB_NAME "z_debug") + ENDIF (WIN32 AND NOT MINGW) + ELSE (${CMAKE_BUILD_TYPE} MATCHES "Debug") + IF (WIN32 AND NOT MINGW) + SET (ZLIB_LIB_NAME "zlib") + ELSE (WIN32 AND NOT MINGW) + SET (ZLIB_LIB_NAME "z") + ENDIF (WIN32 AND NOT MINGW) + ENDIF (${CMAKE_BUILD_TYPE} MATCHES "Debug") + + # Create imported target szip + ADD_LIBRARY(zlib ${libtype} IMPORTED) + ADD_DEPENDENCIES (zlib ZLIB) + + IF (${libtype} MATCHES "SHARED") + IF (WIN32 AND NOT MINGW) + SET_TARGET_PROPERTIES(zlib PROPERTIES + IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${BLDTYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${ZLIB_LIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}" + IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${BLDTYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${ZLIB_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" + ) + ELSE (WIN32 AND NOT MINGW) + IF (CYGWIN) + SET_TARGET_PROPERTIES(zlib PROPERTIES + IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_IMPORT_LIBRARY_PREFIX}${ZLIB_LIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}" + IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_IMPORT_LIBRARY_PREFIX}${ZLIB_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" + ) + ELSE (CYGWIN) + SET_TARGET_PROPERTIES(zlib PROPERTIES + IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_SHARED_LIBRARY_PREFIX}${ZLIB_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" + IMPORTED_SONAME "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_SHARED_LIBRARY_PREFIX}${ZLIB_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}.${ZLIB_VERSION_STRING}" + SOVERSION "${ZLIB_VERSION_STRING}" + ) + ENDIF (CYGWIN) + ENDIF (WIN32 AND NOT MINGW) + ELSE (${libtype} MATCHES "SHARED") + IF (WIN32 AND NOT MINGW) + SET_TARGET_PROPERTIES(zlib PROPERTIES + IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${BLDTYPE}/lib${ZLIB_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}" + IMPORTED_LINK_INTERFACE_LANGUAGES "C" + ) + ELSE (WIN32 AND NOT MINGW) + SET_TARGET_PROPERTIES(zlib PROPERTIES + IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/lib${ZLIB_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}" + IMPORTED_LINK_INTERFACE_LANGUAGES "C" + ) + ENDIF (WIN32 AND NOT MINGW) + ENDIF (${libtype} MATCHES "SHARED") + +# INCLUDE (${BINARY_DIR}/ZLIB-targets.cmake) + SET (ZLIB_LIBRARY "zlib") + + SET (ZLIB_INCLUDE_DIR_GEN "${BINARY_DIR}") + SET (ZLIB_INCLUDE_DIR "${SOURCE_DIR}") + SET (ZLIB_FOUND 1) + SET (ZLIB_LIBRARIES ${ZLIB_LIBRARY}) + SET (ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR_GEN} ${ZLIB_INCLUDE_DIR}) +ENDMACRO (EXTERNAL_ZLIB_LIBRARY) + +#------------------------------------------------------------------------------- +MACRO (PACKAGE_ZLIB_LIBRARY compress_type) + ADD_CUSTOM_TARGET (ZLIB-GenHeader-Copy ALL + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${ZLIB_INCLUDE_DIR_GEN}/zconf.h ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ + COMMENT "Copying ${ZLIB_INCLUDE_DIR_GEN}/zconf.h to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/" + ) + SET (EXTERNAL_HEADER_LIST ${EXTERNAL_HEADER_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/zconf.h) + IF (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") + ADD_DEPENDENCIES (ZLIB-GenHeader-Copy ZLIB) + ENDIF (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") +ENDMACRO (PACKAGE_ZLIB_LIBRARY) diff --git a/config/cmake/HDFMacros.cmake b/config/cmake/HDFMacros.cmake index cf23846..6a1ead7 100644 --- a/config/cmake/HDFMacros.cmake +++ b/config/cmake/HDFMacros.cmake @@ -4,241 +4,6 @@ MACRO (SET_GLOBAL_VARIABLE name value) ENDMACRO (SET_GLOBAL_VARIABLE) #------------------------------------------------------------------------------- -MACRO (EXTERNAL_JPEG_LIBRARY compress_type jpeg_pic) - # May need to build JPEG with PIC on x64 machines with gcc - # Need to use CMAKE_ANSI_CFLAGS define so that compiler test works - - IF (${compress_type} MATCHES "SVN") - EXTERNALPROJECT_ADD (JPEG - SVN_REPOSITORY ${JPEG_URL} - # [SVN_REVISION rev] - INSTALL_COMMAND "" - CMAKE_ARGS - -DBUILD_SHARED_LIBS:BOOL=OFF - -DJPEG_EXTERNALLY_CONFIGURED:BOOL=ON - -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX} - -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} - -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} - -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} - -DCMAKE_ANSI_CFLAGS:STRING="${jpeg_pic}" - ) - ELSEIF (${compress_type} MATCHES "TGZ") - EXTERNALPROJECT_ADD (JPEG - URL ${JPEG_URL} - URL_MD5 "" - INSTALL_COMMAND "" - CMAKE_ARGS - -DBUILD_SHARED_LIBS:BOOL=OFF - -DJPEG_EXTERNALLY_CONFIGURED:BOOL=ON - -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX} - -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} - -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} - -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} - -DCMAKE_ANSI_CFLAGS:STRING="${jpeg_pic}" - ) - ENDIF (${compress_type} MATCHES "SVN") - EXTERNALPROJECT_GET_PROPERTY (JPEG BINARY_DIR SOURCE_DIR) - - IF (${BLDTYPE} MATCHES "Debug") - IF (WIN32 AND NOT MINGW) - SET (DBG_EXT "_D") - ELSE (WIN32 AND NOT MINGW) - SET (DBG_EXT "_debug") - ENDIF (WIN32 AND NOT MINGW) - ELSE (${BLDTYPE} MATCHES "Debug") - SET (DBG_EXT "") - ENDIF (${BLDTYPE} MATCHES "Debug") - - SET (JPEG_LIBRARY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/libjpeg${DBG_EXT}${CMAKE_STATIC_LIBRARY_SUFFIX}") - SET (JPEG_INCLUDE_DIR_GEN "${BINARY_DIR}") - SET (JPEG_INCLUDE_DIR "${SOURCE_DIR}/src") - SET (JPEG_FOUND 1) - SET (JPEG_LIBRARIES ${JPEG_LIBRARY}) - SET (JPEG_INCLUDE_DIRS ${JPEG_INCLUDE_DIR_GEN} ${JPEG_INCLUDE_DIR}) -ENDMACRO (EXTERNAL_JPEG_LIBRARY) - -#------------------------------------------------------------------------------- -MACRO (PACKAGE_JPEG_LIBRARY compress_type) - ADD_CUSTOM_TARGET (JPEG-GenHeader-Copy ALL - COMMAND ${CMAKE_COMMAND} -E copy_if_different ${JPEG_INCLUDE_DIR_GEN}/jconfig.h ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ - COMMENT "Copying ${JPEG_INCLUDE_DIR_GEN}/jconfig.h to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/" - ) - SET (EXTERNAL_HEADER_LIST ${EXTERNAL_HEADER_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/jconfig.h) - GET_FILENAME_COMPONENT(JPEG_LIB_NAME ${JPEG_LIBRARY} NAME) - SET (EXTERNAL_LIBRARY_LIST ${EXTERNAL_LIBRARY_LIST} ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${JPEG_LIB_NAME}) - IF (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") - ADD_DEPENDENCIES (JPEG-GenHeader-Copy JPEG) - ENDIF (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") -ENDMACRO (PACKAGE_JPEG_LIBRARY) - -#------------------------------------------------------------------------------- -MACRO (EXTERNAL_SZIP_LIBRARY compress_type libtype encoding) - IF (${compress_type} MATCHES "SVN") - EXTERNALPROJECT_ADD (SZIP - SVN_REPOSITORY ${SZIP_URL} - # [SVN_REVISION rev] - INSTALL_COMMAND "" - CMAKE_ARGS - -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS} - -DSZIP_EXTERNALLY_CONFIGURED:BOOL=ON - -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX} - -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} - -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} - -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} - -DSZIP_ENABLE_ENCODING:BOOL=${encoding} - ) - ELSEIF (${compress_type} MATCHES "TGZ") - EXTERNALPROJECT_ADD (SZIP - URL ${SZIP_URL} - URL_MD5 "" - INSTALL_COMMAND "" - CMAKE_ARGS - -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS} - -DSZIP_EXTERNALLY_CONFIGURED:BOOL=ON - -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX} - -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} - -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} - -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} - -DSZIP_ENABLE_ENCODING:BOOL=${encoding} - ) - ENDIF (${compress_type} MATCHES "SVN") - EXTERNALPROJECT_GET_PROPERTY (SZIP BINARY_DIR SOURCE_DIR) - - IF (${BLDTYPE} MATCHES "Debug") - IF (WIN32 AND NOT MINGW) - SET (DBG_EXT "_D") - ELSE (WIN32 AND NOT MINGW) - SET (DBG_EXT "_debug") - ENDIF (WIN32 AND NOT MINGW) - ELSE (${BLDTYPE} MATCHES "Debug") - SET (DBG_EXT "") - ENDIF (${BLDTYPE} MATCHES "Debug") - - IF (${libtype} MATCHES "SHARED") - IF (WIN32 AND NOT MINGW) - SET (SZIP_LIBRARY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${CMAKE_IMPORT_LIBRARY_PREFIX}szip${DBG_EXT}${CMAKE_IMPORT_LIBRARY_SUFFIX}") - ELSE (WIN32 AND NOT MINGW) - SET (SZIP_LIBRARY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${CMAKE_SHARED_LIBRARY_PREFIX}szip${DBG_EXT}${CMAKE_SHARED_LIBRARY_SUFFIX}") - ENDIF (WIN32 AND NOT MINGW) - ELSE (${libtype} MATCHES "SHARED") - SET (SZIP_LIBRARY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/libszip${DBG_EXT}${CMAKE_STATIC_LIBRARY_SUFFIX}") - ENDIF (${libtype} MATCHES "SHARED") - SET (SZIP_INCLUDE_DIR_GEN "${BINARY_DIR}") - SET (SZIP_INCLUDE_DIR "${SOURCE_DIR}/src") - SET (SZIP_FOUND 1) - SET (SZIP_LIBRARIES ${SZIP_LIBRARY}) - SET (SZIP_INCLUDE_DIRS ${SZIP_INCLUDE_DIR_GEN} ${SZIP_INCLUDE_DIR}) -ENDMACRO (EXTERNAL_SZIP_LIBRARY) - -#------------------------------------------------------------------------------- -MACRO (PACKAGE_SZIP_LIBRARY compress_type libtype) - ADD_CUSTOM_TARGET (SZIP-GenHeader-Copy ALL - COMMAND ${CMAKE_COMMAND} -E copy_if_different ${SZIP_INCLUDE_DIR_GEN}/SZconfig.h ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ - COMMENT "Copying ${SZIP_INCLUDE_DIR_GEN}/SZconfig.h to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/" - ) - SET (EXTERNAL_HEADER_LIST ${EXTERNAL_HEADER_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/SZconfig.h) - GET_FILENAME_COMPONENT(SZIP_LIB_NAME ${SZIP_LIBRARY} NAME) - SET (EXTERNAL_LIBRARY_LIST ${EXTERNAL_LIBRARY_LIST} ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${SZIP_LIB_NAME}) - IF (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") - ADD_DEPENDENCIES (SZIP-GenHeader-Copy SZIP) - ENDIF (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") - IF (WIN32 AND NOT CYGWIN) - IF (${libtype} MATCHES "SHARED") - GET_FILENAME_COMPONENT(SZIP_DLL_NAME ${SZIP_LIBRARY} NAME_WE) - SET (EXTERNAL_LIBRARYDLL_LIST ${EXTERNAL_LIBRARYDLL_LIST} ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${SZIP_DLL_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}) - ENDIF (${libtype} MATCHES "SHARED") - ENDIF (WIN32 AND NOT CYGWIN) -ENDMACRO (PACKAGE_SZIP_LIBRARY) - -#------------------------------------------------------------------------------- -MACRO (EXTERNAL_ZLIB_LIBRARY compress_type libtype) - IF (${compress_type} MATCHES "SVN") - EXTERNALPROJECT_ADD (ZLIB - SVN_REPOSITORY ${ZLIB_URL} - # [SVN_REVISION rev] - INSTALL_COMMAND "" - CMAKE_ARGS - -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS} - -DZLIB_EXTERNALLY_CONFIGURED:BOOL=ON - -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX} - -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} - -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} - -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} - -DHDF_LEGACY_NAMING:BOOL=${HDF_LEGACY_NAMING} - ) - ELSEIF (${compress_type} MATCHES "TGZ") - EXTERNALPROJECT_ADD (ZLIB - URL ${ZLIB_URL} - URL_MD5 "" - INSTALL_COMMAND "" - CMAKE_ARGS - -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS} - -DZLIB_EXTERNALLY_CONFIGURED:BOOL=ON - -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX} - -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} - -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} - -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} - -DHDF_LEGACY_NAMING:BOOL=${HDF_LEGACY_NAMING} - ) - ENDIF (${compress_type} MATCHES "SVN") - EXTERNALPROJECT_GET_PROPERTY (ZLIB BINARY_DIR SOURCE_DIR) - - IF (${BLDTYPE} MATCHES "Debug") - IF (WIN32 AND NOT MINGW) - SET (DBG_EXT "_D") - ELSE (WIN32 AND NOT MINGW) - SET (DBG_EXT "_debug") - ENDIF (WIN32 AND NOT MINGW) - ELSE (${BLDTYPE} MATCHES "Debug") - SET (DBG_EXT "") - ENDIF (${BLDTYPE} MATCHES "Debug") - - IF (${libtype} MATCHES "SHARED") - IF (WIN32 AND NOT MINGW) - SET (ZLIB_LIBRARY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${CMAKE_IMPORT_LIBRARY_PREFIX}zlib1${DBG_EXT}${CMAKE_IMPORT_LIBRARY_SUFFIX}") - ELSE (WIN32 AND NOT MINGW) - SET (ZLIB_LIBRARY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${CMAKE_SHARED_LIBRARY_PREFIX}z${DBG_EXT}${CMAKE_SHARED_LIBRARY_SUFFIX}") - ENDIF (WIN32 AND NOT MINGW) - ELSE (${libtype} MATCHES "SHARED") - IF (WIN32 AND NOT MINGW) - IF (HDF_LEGACY_NAMING) - SET (ZLIB_LIBRARY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/zlib${DBG_EXT}${CMAKE_STATIC_LIBRARY_SUFFIX}") - ELSE (HDF_LEGACY_NAMING) - SET (ZLIB_LIBRARY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/libzlib${DBG_EXT}${CMAKE_STATIC_LIBRARY_SUFFIX}") - ENDIF (HDF_LEGACY_NAMING) - ELSE (WIN32 AND NOT MINGW) - SET (ZLIB_LIBRARY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/libz${DBG_EXT}${CMAKE_STATIC_LIBRARY_SUFFIX}") - ENDIF (WIN32 AND NOT MINGW) - ENDIF (${libtype} MATCHES "SHARED") - - SET (ZLIB_INCLUDE_DIR_GEN "${BINARY_DIR}") - SET (ZLIB_INCLUDE_DIR "${SOURCE_DIR}/src") - SET (ZLIB_FOUND 1) - SET (ZLIB_LIBRARIES ${ZLIB_LIBRARY}) - SET (ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR_GEN} ${ZLIB_INCLUDE_DIR}) -ENDMACRO (EXTERNAL_ZLIB_LIBRARY) - -#------------------------------------------------------------------------------- -MACRO (PACKAGE_ZLIB_LIBRARY compress_type libtype) - ADD_CUSTOM_TARGET (ZLIB-GenHeader-Copy ALL - COMMAND ${CMAKE_COMMAND} -E copy_if_different ${ZLIB_INCLUDE_DIR_GEN}/zconf.h ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ - COMMENT "Copying ${ZLIB_INCLUDE_DIR_GEN}/zconf.h to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/" - ) - SET (EXTERNAL_HEADER_LIST ${EXTERNAL_HEADER_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/zconf.h) - GET_FILENAME_COMPONENT(ZLIB_LIB_NAME ${ZLIB_LIBRARY} NAME) - SET (EXTERNAL_LIBRARY_LIST ${EXTERNAL_LIBRARY_LIST} ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${ZLIB_LIB_NAME}) - IF (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") - ADD_DEPENDENCIES (ZLIB-GenHeader-Copy ZLIB) - ENDIF (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ") - IF (WIN32 AND NOT CYGWIN) - IF (${libtype} MATCHES "SHARED") - GET_FILENAME_COMPONENT(ZLIB_DLL_NAME ${ZLIB_LIBRARY} NAME_WE) - SET (EXTERNAL_LIBRARYDLL_LIST ${EXTERNAL_LIBRARYDLL_LIST} ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${ZLIB_DLL_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}) - ENDIF (${libtype} MATCHES "SHARED") - ENDIF (WIN32 AND NOT CYGWIN) -ENDMACRO (PACKAGE_ZLIB_LIBRARY) - -#------------------------------------------------------------------------------- MACRO (IDE_GENERATED_PROPERTIES SOURCE_PATH HEADERS SOURCES) #set(source_group_path "Source/AIM/${NAME}") STRING (REPLACE "/" "\\\\" source_group_path ${SOURCE_PATH}) @@ -272,12 +37,7 @@ ENDMACRO (IDE_SOURCE_PROPERTIES) MACRO (TARGET_NAMING target libtype) IF (WIN32 AND NOT MINGW) IF (${libtype} MATCHES "SHARED") - IF (HDF_LEGACY_NAMING) - SET_TARGET_PROPERTIES (${target} PROPERTIES OUTPUT_NAME "dll") - SET_TARGET_PROPERTIES (${target} PROPERTIES PREFIX "${target}") - ELSE (HDF_LEGACY_NAMING) - SET_TARGET_PROPERTIES (${target} PROPERTIES OUTPUT_NAME "${target}dll") - ENDIF (HDF_LEGACY_NAMING) + SET_TARGET_PROPERTIES (${target} PROPERTIES OUTPUT_NAME "${target}dll") ENDIF (${libtype} MATCHES "SHARED") ENDIF (WIN32 AND NOT MINGW) ENDMACRO (TARGET_NAMING) @@ -287,26 +47,16 @@ MACRO (HDF_SET_LIB_OPTIONS libtarget libname libtype) # message (STATUS "${libname} libtype: ${libtype}") IF (${libtype} MATCHES "SHARED") IF (WIN32 AND NOT MINGW) - IF (HDF_LEGACY_NAMING) - SET (LIB_RELEASE_NAME "${libname}dll") - SET (LIB_DEBUG_NAME "${libname}ddll") - ELSE (HDF_LEGACY_NAMING) - SET (LIB_RELEASE_NAME "${libname}") - SET (LIB_DEBUG_NAME "${libname}_D") - ENDIF (HDF_LEGACY_NAMING) + SET (LIB_RELEASE_NAME "${libname}") + SET (LIB_DEBUG_NAME "${libname}_D") ELSE (WIN32 AND NOT MINGW) SET (LIB_RELEASE_NAME "${libname}") SET (LIB_DEBUG_NAME "${libname}_debug") ENDIF (WIN32 AND NOT MINGW) ELSE (${libtype} MATCHES "SHARED") IF (WIN32 AND NOT MINGW) - IF (HDF_LEGACY_NAMING) - SET (LIB_RELEASE_NAME "${libname}") - SET (LIB_DEBUG_NAME "${libname}d") - ELSE (HDF_LEGACY_NAMING) - SET (LIB_RELEASE_NAME "lib${libname}") - SET (LIB_DEBUG_NAME "lib${libname}_D") - ENDIF (HDF_LEGACY_NAMING) + SET (LIB_RELEASE_NAME "lib${libname}") + SET (LIB_DEBUG_NAME "lib${libname}_D") ELSE (WIN32 AND NOT MINGW) # if the generator supports configuration types or if the CMAKE_BUILD_TYPE has a value IF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) @@ -341,13 +91,19 @@ ENDMACRO (HDF_SET_LIB_OPTIONS) #------------------------------------------------------------------------------- MACRO (TARGET_FORTRAN_WIN_PROPERTIES target addlinkflags) - IF (WIN32) - IF (MSVC) + IF (WIN32 AND MSVC) + IF (BUILD_SHARED_LIBS) SET_TARGET_PROPERTIES (${target} PROPERTIES COMPILE_FLAGS "/dll" LINK_FLAGS "/SUBSYSTEM:CONSOLE ${addlinkflags}" ) - ENDIF (MSVC) - ENDIF (WIN32) + ELSE (BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES (${target} + PROPERTIES + COMPILE_FLAGS "/MD" + LINK_FLAGS "/SUBSYSTEM:CONSOLE ${addlinkflags}" + ) + ENDIF (BUILD_SHARED_LIBS) + ENDIF (WIN32 AND MSVC) ENDMACRO (TARGET_FORTRAN_WIN_PROPERTIES) diff --git a/config/cmake/NSIS.InstallOptions.ini.in b/config/cmake/NSIS.InstallOptions.ini.in new file mode 100644 index 0000000..83ca053 --- /dev/null +++ b/config/cmake/NSIS.InstallOptions.ini.in @@ -0,0 +1,37 @@ +[Settings] +NumFields=5 + +[Field 1] +Type=label +Text=By default @CPACK_PACKAGE_INSTALL_DIRECTORY@ does add its directory to the system PATH. +Left=0 +Right=-1 +Top=0 +Bottom=20 + +[Field 2] +Type=radiobutton +Text=Do not add @CPACK_PACKAGE_NAME@ to the system PATH +Left=0 +Right=-1 +Top=30 +Bottom=40 +State=0 + +[Field 3] +Type=radiobutton +Text=Add @CPACK_PACKAGE_NAME@ to the system PATH for all users +Left=0 +Right=-1 +Top=40 +Bottom=50 +State=1 + +[Field 4] +Type=radiobutton +Text=Add @CPACK_PACKAGE_NAME@ to the system PATH for current user +Left=0 +Right=-1 +Top=50 +Bottom=60 +State=0 diff --git a/config/cmake/NSIS.template.in b/config/cmake/NSIS.template.in new file mode 100644 index 0000000..f28db0f --- /dev/null +++ b/config/cmake/NSIS.template.in @@ -0,0 +1,949 @@ +; CPack install script designed for a nmake build + +;-------------------------------- +; You must define these values + + !define VERSION "@CPACK_PACKAGE_VERSION@" + !define PATCH "@CPACK_PACKAGE_VERSION_PATCH@" + !define INST_DIR "@CPACK_TEMPORARY_DIRECTORY@" + +;-------------------------------- +;Variables + + Var MUI_TEMP + Var STARTMENU_FOLDER + Var SV_ALLUSERS + Var START_MENU + Var DO_NOT_ADD_TO_PATH + Var ADD_TO_PATH_ALL_USERS + Var ADD_TO_PATH_CURRENT_USER + Var INSTALL_DESKTOP + Var IS_DEFAULT_INSTALLDIR +;-------------------------------- +;Include Modern UI + + !include "MUI.nsh" + + ;Default installation folder + InstallDir "@CPACK_NSIS_INSTALL_ROOT@\@CPACK_PACKAGE_VENDOR@\@CPACK_PACKAGE_INSTALL_DIRECTORY@\@CPACK_PACKAGE_VERSION@" + +;-------------------------------- +;General + + ;Name and file + Name "@CPACK_NSIS_PACKAGE_NAME@" + OutFile "@CPACK_TOPLEVEL_DIRECTORY@/@CPACK_OUTPUT_FILE_NAME@" + + ;Set compression + SetCompressor @CPACK_NSIS_COMPRESSOR@ + +@CPACK_NSIS_DEFINES@ + + !include Sections.nsh + +;--- Component support macros: --- +; The code for the add/remove functionality is from: +; http://nsis.sourceforge.net/Add/Remove_Functionality +; It has been modified slightly and extended to provide +; inter-component dependencies. +Var AR_SecFlags +Var AR_RegFlags +@CPACK_NSIS_SECTION_SELECTED_VARS@ + +; Loads the "selected" flag for the section named SecName into the +; variable VarName. +!macro LoadSectionSelectedIntoVar SecName VarName + SectionGetFlags ${${SecName}} $${VarName} + IntOp $${VarName} $${VarName} & ${SF_SELECTED} ;Turn off all other bits +!macroend + +; Loads the value of a variable... can we get around this? +!macro LoadVar VarName + IntOp $R0 0 + $${VarName} +!macroend + +; Sets the value of a variable +!macro StoreVar VarName IntValue + IntOp $${VarName} 0 + ${IntValue} +!macroend + +!macro InitSection SecName + ; This macro reads component installed flag from the registry and + ;changes checked state of the section on the components page. + ;Input: section index constant name specified in Section command. + + ClearErrors + ;Reading component status from registry + ReadRegDWORD $AR_RegFlags HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@\Components\${SecName}" "Installed" + IfErrors "default_${SecName}" + ;Status will stay default if registry value not found + ;(component was never installed) + IntOp $AR_RegFlags $AR_RegFlags & ${SF_SELECTED} ;Turn off all other bits + SectionGetFlags ${${SecName}} $AR_SecFlags ;Reading default section flags + IntOp $AR_SecFlags $AR_SecFlags & 0xFFFE ;Turn lowest (enabled) bit off + IntOp $AR_SecFlags $AR_RegFlags | $AR_SecFlags ;Change lowest bit + + ; Note whether this component was installed before + !insertmacro StoreVar ${SecName}_was_installed $AR_RegFlags + IntOp $R0 $AR_RegFlags & $AR_RegFlags + + ;Writing modified flags + SectionSetFlags ${${SecName}} $AR_SecFlags + + "default_${SecName}:" + !insertmacro LoadSectionSelectedIntoVar ${SecName} ${SecName}_selected +!macroend + +!macro FinishSection SecName + ; This macro reads section flag set by user and removes the section + ;if it is not selected. + ;Then it writes component installed flag to registry + ;Input: section index constant name specified in Section command. + + SectionGetFlags ${${SecName}} $AR_SecFlags ;Reading section flags + ;Checking lowest bit: + IntOp $AR_SecFlags $AR_SecFlags & ${SF_SELECTED} + IntCmp $AR_SecFlags 1 "leave_${SecName}" + ;Section is not selected: + ;Calling Section uninstall macro and writing zero installed flag + !insertmacro "Remove_${${SecName}}" + WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@\Components\${SecName}" \ + "Installed" 0 + Goto "exit_${SecName}" + + "leave_${SecName}:" + ;Section is selected: + WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@\Components\${SecName}" \ + "Installed" 1 + + "exit_${SecName}:" +!macroend + +!macro RemoveSection SecName + ; This macro is used to call section's Remove_... macro + ;from the uninstaller. + ;Input: section index constant name specified in Section command. + + !insertmacro "Remove_${${SecName}}" +!macroend + +; Determine whether the selection of SecName changed +!macro MaybeSelectionChanged SecName + !insertmacro LoadVar ${SecName}_selected + SectionGetFlags ${${SecName}} $R1 + IntOp $R1 $R1 & ${SF_SELECTED} ;Turn off all other bits + + ; See if the status has changed: + IntCmp $R0 $R1 "${SecName}_unchanged" + !insertmacro LoadSectionSelectedIntoVar ${SecName} ${SecName}_selected + + IntCmp $R1 ${SF_SELECTED} "${SecName}_was_selected" + !insertmacro "Deselect_required_by_${SecName}" + goto "${SecName}_unchanged" + + "${SecName}_was_selected:" + !insertmacro "Select_${SecName}_depends" + + "${SecName}_unchanged:" +!macroend +;--- End of Add/Remove macros --- + +;-------------------------------- +;Interface Settings + + !define MUI_HEADERIMAGE + !define MUI_ABORTWARNING + +;-------------------------------- +; path functions + +!verbose 3 +!include "WinMessages.NSH" +!verbose 4 + +;---------------------------------------- +; based upon a script of "Written by KiCHiK 2003-01-18 05:57:02" +;---------------------------------------- +!verbose 3 +!include "WinMessages.NSH" +!verbose 4 +;==================================================== +; get_NT_environment +; Returns: the selected environment +; Output : head of the stack +;==================================================== +!macro select_NT_profile UN +Function ${UN}select_NT_profile + StrCmp $ADD_TO_PATH_ALL_USERS "1" 0 environment_single + DetailPrint "Selected environment for all users" + Push "all" + Return + environment_single: + DetailPrint "Selected environment for current user only." + Push "current" + Return +FunctionEnd +!macroend +!insertmacro select_NT_profile "" +!insertmacro select_NT_profile "un." +;---------------------------------------------------- +!define NT_current_env 'HKCU "Environment"' +!define NT_all_env 'HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"' + +!ifndef WriteEnvStr_RegKey + !ifdef ALL_USERS + !define WriteEnvStr_RegKey \ + 'HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"' + !else + !define WriteEnvStr_RegKey 'HKCU "Environment"' + !endif +!endif + +; AddToPath - Adds the given dir to the search path. +; Input - head of the stack +; Note - Win9x systems requires reboot + +Function AddToPath + Exch $0 + Push $1 + Push $2 + Push $3 + + # don't add if the path doesn't exist + IfFileExists "$0\*.*" "" AddToPath_done + + ReadEnvStr $1 PATH + ; if the path is too long for a NSIS variable NSIS will return a 0 + ; length string. If we find that, then warn and skip any path + ; modification as it will trash the existing path. + StrLen $2 $1 + IntCmp $2 0 CheckPathLength_ShowPathWarning CheckPathLength_Done CheckPathLength_Done + CheckPathLength_ShowPathWarning: + Messagebox MB_OK|MB_ICONEXCLAMATION "Warning! PATH too long installer unable to modify PATH!" + Goto AddToPath_done + CheckPathLength_Done: + Push "$1;" + Push "$0;" + Call StrStr + Pop $2 + StrCmp $2 "" "" AddToPath_done + Push "$1;" + Push "$0\;" + Call StrStr + Pop $2 + StrCmp $2 "" "" AddToPath_done + GetFullPathName /SHORT $3 $0 + Push "$1;" + Push "$3;" + Call StrStr + Pop $2 + StrCmp $2 "" "" AddToPath_done + Push "$1;" + Push "$3\;" + Call StrStr + Pop $2 + StrCmp $2 "" "" AddToPath_done + + Call IsNT + Pop $1 + StrCmp $1 1 AddToPath_NT + ; Not on NT + StrCpy $1 $WINDIR 2 + FileOpen $1 "$1\autoexec.bat" a + FileSeek $1 -1 END + FileReadByte $1 $2 + IntCmp $2 26 0 +2 +2 # DOS EOF + FileSeek $1 -1 END # write over EOF + FileWrite $1 "$\r$\nSET PATH=%PATH%;$3$\r$\n" + FileClose $1 + SetRebootFlag true + Goto AddToPath_done + + AddToPath_NT: + StrCmp $ADD_TO_PATH_ALL_USERS "1" ReadAllKey + ReadRegStr $1 ${NT_current_env} "PATH" + Goto DoTrim + ReadAllKey: + ReadRegStr $1 ${NT_all_env} "PATH" + DoTrim: + StrCmp $1 "" AddToPath_NTdoIt + Push $1 + Call Trim + Pop $1 + StrCpy $0 "$1;$0" + AddToPath_NTdoIt: + StrCmp $ADD_TO_PATH_ALL_USERS "1" WriteAllKey + WriteRegExpandStr ${NT_current_env} "PATH" $0 + Goto DoSend + WriteAllKey: + WriteRegExpandStr ${NT_all_env} "PATH" $0 + DoSend: + SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000 + + AddToPath_done: + Pop $3 + Pop $2 + Pop $1 + Pop $0 +FunctionEnd + + +; RemoveFromPath - Remove a given dir from the path +; Input: head of the stack + +Function un.RemoveFromPath + Exch $0 + Push $1 + Push $2 + Push $3 + Push $4 + Push $5 + Push $6 + + IntFmt $6 "%c" 26 # DOS EOF + + Call un.IsNT + Pop $1 + StrCmp $1 1 unRemoveFromPath_NT + ; Not on NT + StrCpy $1 $WINDIR 2 + FileOpen $1 "$1\autoexec.bat" r + GetTempFileName $4 + FileOpen $2 $4 w + GetFullPathName /SHORT $0 $0 + StrCpy $0 "SET PATH=%PATH%;$0" + Goto unRemoveFromPath_dosLoop + + unRemoveFromPath_dosLoop: + FileRead $1 $3 + StrCpy $5 $3 1 -1 # read last char + StrCmp $5 $6 0 +2 # if DOS EOF + StrCpy $3 $3 -1 # remove DOS EOF so we can compare + StrCmp $3 "$0$\r$\n" unRemoveFromPath_dosLoopRemoveLine + StrCmp $3 "$0$\n" unRemoveFromPath_dosLoopRemoveLine + StrCmp $3 "$0" unRemoveFromPath_dosLoopRemoveLine + StrCmp $3 "" unRemoveFromPath_dosLoopEnd + FileWrite $2 $3 + Goto unRemoveFromPath_dosLoop + unRemoveFromPath_dosLoopRemoveLine: + SetRebootFlag true + Goto unRemoveFromPath_dosLoop + + unRemoveFromPath_dosLoopEnd: + FileClose $2 + FileClose $1 + StrCpy $1 $WINDIR 2 + Delete "$1\autoexec.bat" + CopyFiles /SILENT $4 "$1\autoexec.bat" + Delete $4 + Goto unRemoveFromPath_done + + unRemoveFromPath_NT: + StrCmp $ADD_TO_PATH_ALL_USERS "1" unReadAllKey + ReadRegStr $1 ${NT_current_env} "PATH" + Goto unDoTrim + unReadAllKey: + ReadRegStr $1 ${NT_all_env} "PATH" + unDoTrim: + StrCpy $5 $1 1 -1 # copy last char + StrCmp $5 ";" +2 # if last char != ; + StrCpy $1 "$1;" # append ; + Push $1 + Push "$0;" + Call un.StrStr ; Find `$0;` in $1 + Pop $2 ; pos of our dir + StrCmp $2 "" unRemoveFromPath_done + ; else, it is in path + # $0 - path to add + # $1 - path var + StrLen $3 "$0;" + StrLen $4 $2 + StrCpy $5 $1 -$4 # $5 is now the part before the path to remove + StrCpy $6 $2 "" $3 # $6 is now the part after the path to remove + StrCpy $3 $5$6 + + StrCpy $5 $3 1 -1 # copy last char + StrCmp $5 ";" 0 +2 # if last char == ; + StrCpy $3 $3 -1 # remove last char + + StrCmp $ADD_TO_PATH_ALL_USERS "1" unWriteAllKey + WriteRegExpandStr ${NT_current_env} "PATH" $3 + Goto unDoSend + unWriteAllKey: + WriteRegExpandStr ${NT_all_env} "PATH" $3 + unDoSend: + SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000 + + unRemoveFromPath_done: + Pop $6 + Pop $5 + Pop $4 + Pop $3 + Pop $2 + Pop $1 + Pop $0 +FunctionEnd + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Uninstall sutff +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +########################################### +# Utility Functions # +########################################### + +;==================================================== +; IsNT - Returns 1 if the current system is NT, 0 +; otherwise. +; Output: head of the stack +;==================================================== +; IsNT +; no input +; output, top of the stack = 1 if NT or 0 if not +; +; Usage: +; Call IsNT +; Pop $R0 +; ($R0 at this point is 1 or 0) + +!macro IsNT un +Function ${un}IsNT + Push $0 + ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion + StrCmp $0 "" 0 IsNT_yes + ; we are not NT. + Pop $0 + Push 0 + Return + + IsNT_yes: + ; NT!!! + Pop $0 + Push 1 +FunctionEnd +!macroend +!insertmacro IsNT "" +!insertmacro IsNT "un." + +; StrStr +; input, top of stack = string to search for +; top of stack-1 = string to search in +; output, top of stack (replaces with the portion of the string remaining) +; modifies no other variables. +; +; Usage: +; Push "this is a long ass string" +; Push "ass" +; Call StrStr +; Pop $R0 +; ($R0 at this point is "ass string") + +!macro StrStr un +Function ${un}StrStr +Exch $R1 ; st=haystack,old$R1, $R1=needle + Exch ; st=old$R1,haystack + Exch $R2 ; st=old$R1,old$R2, $R2=haystack + Push $R3 + Push $R4 + Push $R5 + StrLen $R3 $R1 + StrCpy $R4 0 + ; $R1=needle + ; $R2=haystack + ; $R3=len(needle) + ; $R4=cnt + ; $R5=tmp + loop: + StrCpy $R5 $R2 $R3 $R4 + StrCmp $R5 $R1 done + StrCmp $R5 "" done + IntOp $R4 $R4 + 1 + Goto loop +done: + StrCpy $R1 $R2 "" $R4 + Pop $R5 + Pop $R4 + Pop $R3 + Pop $R2 + Exch $R1 +FunctionEnd +!macroend +!insertmacro StrStr "" +!insertmacro StrStr "un." + +Function Trim ; Added by Pelaca + Exch $R1 + Push $R2 +Loop: + StrCpy $R2 "$R1" 1 -1 + StrCmp "$R2" " " RTrim + StrCmp "$R2" "$\n" RTrim + StrCmp "$R2" "$\r" RTrim + StrCmp "$R2" ";" RTrim + GoTo Done +RTrim: + StrCpy $R1 "$R1" -1 + Goto Loop +Done: + Pop $R2 + Exch $R1 +FunctionEnd + +Function ConditionalAddToRegisty + Pop $0 + Pop $1 + StrCmp "$0" "" ConditionalAddToRegisty_EmptyString + WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@" \ + "$1" "$0" + ;MessageBox MB_OK "Set Registry: '$1' to '$0'" + DetailPrint "Set install registry entry: '$1' to '$0'" + ConditionalAddToRegisty_EmptyString: +FunctionEnd + +;-------------------------------- + +!ifdef CPACK_USES_DOWNLOAD +Function DownloadFile + IfFileExists $INSTDIR\* +2 + CreateDirectory $INSTDIR + Pop $0 + + ; Skip if already downloaded + IfFileExists $INSTDIR\$0 0 +2 + Return + + StrCpy $1 "@CPACK_DOWNLOAD_SITE@" + + try_again: + NSISdl::download "$1/$0" "$INSTDIR\$0" + + Pop $1 + StrCmp $1 "success" success + StrCmp $1 "Cancelled" cancel + MessageBox MB_OK "Download failed: $1" + cancel: + Return + success: +FunctionEnd +!endif + +;-------------------------------- +; Installation types +@CPACK_NSIS_INSTALLATION_TYPES@ + +;-------------------------------- +; Component sections +@CPACK_NSIS_COMPONENT_SECTIONS@ + +;-------------------------------- +; Define some macro setting for the gui +@CPACK_NSIS_INSTALLER_MUI_ICON_CODE@ +@CPACK_NSIS_INSTALLER_ICON_CODE@ +@CPACK_NSIS_INSTALLER_MUI_COMPONENTS_DESC@ +@CPACK_NSIS_INSTALLER_MUI_FINISHPAGE_RUN_CODE@ + +;-------------------------------- +;Pages + !insertmacro MUI_PAGE_WELCOME + + !insertmacro MUI_PAGE_LICENSE "@CPACK_RESOURCE_FILE_LICENSE@" + Page custom InstallOptionsPage + !insertmacro MUI_PAGE_DIRECTORY + + ;Start Menu Folder Page Configuration + !define MUI_STARTMENUPAGE_REGISTRY_ROOT "SHCTX" + !define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\@CPACK_PACKAGE_VENDOR@\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@" + !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder" + !insertmacro MUI_PAGE_STARTMENU Application $STARTMENU_FOLDER + + @CPACK_NSIS_PAGE_COMPONENTS@ + + !insertmacro MUI_PAGE_INSTFILES + !insertmacro MUI_PAGE_FINISH + + !insertmacro MUI_UNPAGE_CONFIRM + !insertmacro MUI_UNPAGE_INSTFILES + +;-------------------------------- +;Languages + + !insertmacro MUI_LANGUAGE "English" ;first language is the default language + !insertmacro MUI_LANGUAGE "Albanian" + !insertmacro MUI_LANGUAGE "Arabic" + !insertmacro MUI_LANGUAGE "Basque" + !insertmacro MUI_LANGUAGE "Belarusian" + !insertmacro MUI_LANGUAGE "Bosnian" + !insertmacro MUI_LANGUAGE "Breton" + !insertmacro MUI_LANGUAGE "Bulgarian" + !insertmacro MUI_LANGUAGE "Croatian" + !insertmacro MUI_LANGUAGE "Czech" + !insertmacro MUI_LANGUAGE "Danish" + !insertmacro MUI_LANGUAGE "Dutch" + !insertmacro MUI_LANGUAGE "Estonian" + !insertmacro MUI_LANGUAGE "Farsi" + !insertmacro MUI_LANGUAGE "Finnish" + !insertmacro MUI_LANGUAGE "French" + !insertmacro MUI_LANGUAGE "German" + !insertmacro MUI_LANGUAGE "Greek" + !insertmacro MUI_LANGUAGE "Hebrew" + !insertmacro MUI_LANGUAGE "Hungarian" + !insertmacro MUI_LANGUAGE "Icelandic" + !insertmacro MUI_LANGUAGE "Indonesian" + !insertmacro MUI_LANGUAGE "Irish" + !insertmacro MUI_LANGUAGE "Italian" + !insertmacro MUI_LANGUAGE "Japanese" + !insertmacro MUI_LANGUAGE "Korean" + !insertmacro MUI_LANGUAGE "Kurdish" + !insertmacro MUI_LANGUAGE "Latvian" + !insertmacro MUI_LANGUAGE "Lithuanian" + !insertmacro MUI_LANGUAGE "Luxembourgish" + !insertmacro MUI_LANGUAGE "Macedonian" + !insertmacro MUI_LANGUAGE "Malay" + !insertmacro MUI_LANGUAGE "Mongolian" + !insertmacro MUI_LANGUAGE "Norwegian" + !insertmacro MUI_LANGUAGE "Polish" + !insertmacro MUI_LANGUAGE "Portuguese" + !insertmacro MUI_LANGUAGE "PortugueseBR" + !insertmacro MUI_LANGUAGE "Romanian" + !insertmacro MUI_LANGUAGE "Russian" + !insertmacro MUI_LANGUAGE "Serbian" + !insertmacro MUI_LANGUAGE "SerbianLatin" + !insertmacro MUI_LANGUAGE "SimpChinese" + !insertmacro MUI_LANGUAGE "Slovak" + !insertmacro MUI_LANGUAGE "Slovenian" + !insertmacro MUI_LANGUAGE "Spanish" + !insertmacro MUI_LANGUAGE "Swedish" + !insertmacro MUI_LANGUAGE "Thai" + !insertmacro MUI_LANGUAGE "TradChinese" + !insertmacro MUI_LANGUAGE "Turkish" + !insertmacro MUI_LANGUAGE "Ukrainian" + !insertmacro MUI_LANGUAGE "Welsh" + + +;-------------------------------- +;Reserve Files + + ;These files should be inserted before other files in the data block + ;Keep these lines before any File command + ;Only for solid compression (by default, solid compression is enabled for BZIP2 and LZMA) + + ReserveFile "NSIS.InstallOptions.ini" + !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS + +;-------------------------------- +;Installer Sections + +Section "-Core installation" + ;Use the entire tree produced by the INSTALL target. Keep the + ;list of directories here in sync with the RMDir commands below. + SetOutPath "$INSTDIR" + @CPACK_NSIS_FULL_INSTALL@ + + ;Store installation folder + WriteRegStr SHCTX "Software\@CPACK_PACKAGE_VENDOR@\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@" "" $INSTDIR + + ;Create uninstaller + WriteUninstaller "$INSTDIR\Uninstall.exe" + Push "DisplayName" + Push "@CPACK_NSIS_DISPLAY_NAME@" + Call ConditionalAddToRegisty + Push "DisplayVersion" + Push "@CPACK_PACKAGE_VERSION@" + Call ConditionalAddToRegisty + Push "Publisher" + Push "@CPACK_PACKAGE_VENDOR@" + Call ConditionalAddToRegisty + Push "UninstallString" + Push "$INSTDIR\Uninstall.exe" + Call ConditionalAddToRegisty + Push "NoRepair" + Push "1" + Call ConditionalAddToRegisty + + !ifdef CPACK_NSIS_ADD_REMOVE + ;Create add/remove functionality + Push "ModifyPath" + Push "$INSTDIR\AddRemove.exe" + Call ConditionalAddToRegisty + !else + Push "NoModify" + Push "1" + Call ConditionalAddToRegisty + !endif + + ; Optional registration + Push "DisplayIcon" + Push "$INSTDIR\@CPACK_NSIS_INSTALLED_ICON_NAME@" + Call ConditionalAddToRegisty + Push "HelpLink" + Push "@CPACK_NSIS_HELP_LINK@" + Call ConditionalAddToRegisty + Push "URLInfoAbout" + Push "@CPACK_NSIS_URL_INFO_ABOUT@" + Call ConditionalAddToRegisty + Push "Contact" + Push "@CPACK_NSIS_CONTACT@" + Call ConditionalAddToRegisty + !insertmacro MUI_INSTALLOPTIONS_READ $INSTALL_DESKTOP "NSIS.InstallOptions.ini" "Field 5" "State" + !insertmacro MUI_STARTMENU_WRITE_BEGIN Application + + ;Create shortcuts + CreateDirectory "$SMPROGRAMS\$STARTMENU_FOLDER" +@CPACK_NSIS_CREATE_ICONS@ +@CPACK_NSIS_CREATE_ICONS_EXTRA@ + CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Uninstall.lnk" "$INSTDIR\Uninstall.exe" + + ;Read a value from an InstallOptions INI file + !insertmacro MUI_INSTALLOPTIONS_READ $DO_NOT_ADD_TO_PATH "NSIS.InstallOptions.ini" "Field 2" "State" + !insertmacro MUI_INSTALLOPTIONS_READ $ADD_TO_PATH_ALL_USERS "NSIS.InstallOptions.ini" "Field 3" "State" + !insertmacro MUI_INSTALLOPTIONS_READ $ADD_TO_PATH_CURRENT_USER "NSIS.InstallOptions.ini" "Field 4" "State" + + ; Write special uninstall registry entries + Push "StartMenu" + Push "$STARTMENU_FOLDER" + Call ConditionalAddToRegisty + Push "DoNotAddToPath" + Push "$DO_NOT_ADD_TO_PATH" + Call ConditionalAddToRegisty + Push "AddToPathAllUsers" + Push "$ADD_TO_PATH_ALL_USERS" + Call ConditionalAddToRegisty + Push "AddToPathCurrentUser" + Push "$ADD_TO_PATH_CURRENT_USER" + Call ConditionalAddToRegisty + Push "InstallToDesktop" + Push "$INSTALL_DESKTOP" + Call ConditionalAddToRegisty + + !insertmacro MUI_STARTMENU_WRITE_END + +@CPACK_NSIS_EXTRA_INSTALL_COMMANDS@ + +SectionEnd + +Section "-Add to path" + Push $INSTDIR\bin + StrCmp "@CPACK_NSIS_MODIFY_PATH@" "ON" 0 doNotAddToPath + StrCmp $DO_NOT_ADD_TO_PATH "1" doNotAddToPath 0 + Call AddToPath + doNotAddToPath: +SectionEnd + +;-------------------------------- +; Create custom pages +Function InstallOptionsPage + !insertmacro MUI_HEADER_TEXT "Install Options" "Choose options for installing @CPACK_NSIS_PACKAGE_NAME@" + !insertmacro MUI_INSTALLOPTIONS_DISPLAY "NSIS.InstallOptions.ini" + +FunctionEnd + +;-------------------------------- +; determine admin versus local install +Function un.onInit + + ClearErrors + UserInfo::GetName + IfErrors noLM + Pop $0 + UserInfo::GetAccountType + Pop $1 + StrCmp $1 "Admin" 0 +3 + SetShellVarContext all + ;MessageBox MB_OK 'User "$0" is in the Admin group' + Goto done + StrCmp $1 "Power" 0 +3 + SetShellVarContext all + ;MessageBox MB_OK 'User "$0" is in the Power Users group' + Goto done + + noLM: + ;Get installation folder from registry if available + + done: + +FunctionEnd + +;--- Add/Remove callback functions: --- +!macro SectionList MacroName + ;This macro used to perform operation on multiple sections. + ;List all of your components in following manner here. +@CPACK_NSIS_COMPONENT_SECTION_LIST@ +!macroend + +Section -FinishComponents + ;Removes unselected components and writes component status to registry + !insertmacro SectionList "FinishSection" + +!ifdef CPACK_NSIS_ADD_REMOVE + ; Get the name of the installer executable + System::Call 'kernel32::GetModuleFileNameA(i 0, t .R0, i 1024) i r1' + StrCpy $R3 $R0 + + ; Strip off the last 13 characters, to see if we have AddRemove.exe + StrLen $R1 $R0 + IntOp $R1 $R0 - 13 + StrCpy $R2 $R0 13 $R1 + StrCmp $R2 "AddRemove.exe" addremove_installed + + ; We're not running AddRemove.exe, so install it + CopyFiles $R3 $INSTDIR\AddRemove.exe + + addremove_installed: +!endif +SectionEnd +;--- End of Add/Remove callback functions --- + +;-------------------------------- +; Component dependencies +Function .onSelChange + !insertmacro SectionList MaybeSelectionChanged +FunctionEnd + +;-------------------------------- +;Uninstaller Section + +Section "Uninstall" + ReadRegStr $START_MENU SHCTX \ + "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@" "StartMenu" + ;MessageBox MB_OK "Start menu is in: $START_MENU" + ReadRegStr $DO_NOT_ADD_TO_PATH SHCTX \ + "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@" "DoNotAddToPath" + ReadRegStr $ADD_TO_PATH_ALL_USERS SHCTX \ + "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@" "AddToPathAllUsers" + ReadRegStr $ADD_TO_PATH_CURRENT_USER SHCTX \ + "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@" "AddToPathCurrentUser" + ;MessageBox MB_OK "Add to path: $DO_NOT_ADD_TO_PATH all users: $ADD_TO_PATH_ALL_USERS" + ReadRegStr $INSTALL_DESKTOP SHCTX \ + "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@" "InstallToDesktop" + ;MessageBox MB_OK "Install to desktop: $INSTALL_DESKTOP " + +@CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS@ + + ;Remove files we installed. + ;Keep the list of directories here in sync with the File commands above. +@CPACK_NSIS_DELETE_FILES@ +@CPACK_NSIS_DELETE_DIRECTORIES@ + +!ifdef CPACK_NSIS_ADD_REMOVE + ;Remove the add/remove program + Delete "$INSTDIR\AddRemove.exe" +!endif + + ;Remove the uninstaller itself. + Delete "$INSTDIR\Uninstall.exe" + DeleteRegKey SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@" + + ;Remove the installation directory if it is empty. + RMDir "$INSTDIR" + + ; Remove the registry entries. + DeleteRegKey SHCTX "Software\@CPACK_PACKAGE_VENDOR@\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@" + + ; Removes all optional components + !insertmacro SectionList "RemoveSection" + + !insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP + + Delete "$SMPROGRAMS\$MUI_TEMP\Uninstall.lnk" +@CPACK_NSIS_DELETE_ICONS@ +@CPACK_NSIS_DELETE_ICONS_EXTRA@ + + ;Delete empty start menu parent diretories + StrCpy $MUI_TEMP "$SMPROGRAMS\$MUI_TEMP" + + startMenuDeleteLoop: + ClearErrors + RMDir $MUI_TEMP + GetFullPathName $MUI_TEMP "$MUI_TEMP\.." + + IfErrors startMenuDeleteLoopDone + + StrCmp "$MUI_TEMP" "$SMPROGRAMS" startMenuDeleteLoopDone startMenuDeleteLoop + startMenuDeleteLoopDone: + + ; If the user changed the shortcut, then untinstall may not work. This should + ; try to fix it. + StrCpy $MUI_TEMP "$START_MENU" + Delete "$SMPROGRAMS\$MUI_TEMP\Uninstall.lnk" +@CPACK_NSIS_DELETE_ICONS_EXTRA@ + + ;Delete empty start menu parent diretories + StrCpy $MUI_TEMP "$SMPROGRAMS\$MUI_TEMP" + + secondStartMenuDeleteLoop: + ClearErrors + RMDir $MUI_TEMP + GetFullPathName $MUI_TEMP "$MUI_TEMP\.." + + IfErrors secondStartMenuDeleteLoopDone + + StrCmp "$MUI_TEMP" "$SMPROGRAMS" secondStartMenuDeleteLoopDone secondStartMenuDeleteLoop + secondStartMenuDeleteLoopDone: + + DeleteRegKey /ifempty SHCTX "Software\@CPACK_PACKAGE_VENDOR@\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@" + + Push $INSTDIR\bin + StrCmp $DO_NOT_ADD_TO_PATH_ "1" doNotRemoveFromPath 0 + Call un.RemoveFromPath + doNotRemoveFromPath: +SectionEnd + +;-------------------------------- +; determine admin versus local install +; Is install for "AllUsers" or "JustMe"? +; Default to "JustMe" - set to "AllUsers" if admin or on Win9x +; This function is used for the very first "custom page" of the installer. +; This custom page does not show up visibly, but it executes prior to the +; first visible page and sets up $INSTDIR properly... +; Choose different default installation folder based on SV_ALLUSERS... +; "Program Files" for AllUsers, "My Documents" for JustMe... + +Function .onInit + ; Reads components status for registry + !insertmacro SectionList "InitSection" + + ; check to see if /D has been used to change + ; the install directory by comparing it to the + ; install directory that is expected to be the + ; default + StrCpy $IS_DEFAULT_INSTALLDIR 0 + StrCmp "$INSTDIR" "@CPACK_NSIS_INSTALL_ROOT@\@CPACK_PACKAGE_VENDOR@\@CPACK_PACKAGE_INSTALL_DIRECTORY@\@CPACK_PACKAGE_VERSION@" 0 +2 + StrCpy $IS_DEFAULT_INSTALLDIR 1 + + StrCpy $SV_ALLUSERS "JustMe" + ; if default install dir then change the default + ; if it is installed for JustMe + StrCmp "$IS_DEFAULT_INSTALLDIR" "1" 0 +2 + StrCpy $INSTDIR "$DOCUMENTS\@CPACK_PACKAGE_VENDOR@\@CPACK_PACKAGE_INSTALL_DIRECTORY@\@CPACK_PACKAGE_VERSION@" + + ClearErrors + UserInfo::GetName + IfErrors noLM + Pop $0 + UserInfo::GetAccountType + Pop $1 + StrCmp $1 "Admin" 0 +3 + SetShellVarContext all + ;MessageBox MB_OK 'User "$0" is in the Admin group' + StrCpy $SV_ALLUSERS "AllUsers" + Goto done + StrCmp $1 "Power" 0 +3 + SetShellVarContext all + ;MessageBox MB_OK 'User "$0" is in the Power Users group' + StrCpy $SV_ALLUSERS "AllUsers" + Goto done + + noLM: + StrCpy $SV_ALLUSERS "AllUsers" + ;Get installation folder from registry if available + + done: + StrCmp $SV_ALLUSERS "AllUsers" 0 +3 + StrCmp "$IS_DEFAULT_INSTALLDIR" "1" 0 +2 + StrCpy $INSTDIR "@CPACK_NSIS_INSTALL_ROOT@\@CPACK_PACKAGE_VENDOR@\@CPACK_PACKAGE_INSTALL_DIRECTORY@\@CPACK_PACKAGE_VERSION@" + + StrCmp "@CPACK_NSIS_MODIFY_PATH@" "ON" 0 noOptionsPage + !insertmacro MUI_INSTALLOPTIONS_EXTRACT "NSIS.InstallOptions.ini" + + noOptionsPage: +FunctionEnd diff --git a/config/cmake/cacheinit.cmake b/config/cmake/cacheinit.cmake index 3375c2b..1ab3432 100755 --- a/config/cmake/cacheinit.cmake +++ b/config/cmake/cacheinit.cmake @@ -14,6 +14,8 @@ SET (HDF5_BUILD_EXAMPLES ON CACHE BOOL "Build HDF5 Library Examples" FORCE) SET (HDF5_BUILD_FORTRAN ON CACHE BOOL "Build FORTRAN support" FORCE) +SET (HDF5_ENABLE_F2003 OFF CACHE BOOL "Enable FORTRAN 2003 Standard" FORCE) + SET (HDF5_BUILD_HL_LIB ON CACHE BOOL "Build HIGH Level HDF5 Library" FORCE) SET (HDF5_BUILD_TOOLS ON CACHE BOOL "Build HDF5 Tools" FORCE) @@ -24,26 +26,32 @@ SET (HDF5_ENABLE_SZIP_SUPPORT ON CACHE BOOL "Use SZip Filter" FORCE) SET (HDF5_ENABLE_SZIP_ENCODING ON CACHE BOOL "Use SZip Encoding" FORCE) -SET (HDF5_USE_H5DUMP_PACKED_BITS OFF CACHE BOOL "Use the PACKED BITS feature in h5dump" FORCE) - SET (HDF5_ENABLE_HSIZET ON CACHE BOOL "Enable datasets larger than memory" FORCE) SET (HDF5_ENABLE_DEPRECATED_SYMBOLS ON CACHE BOOL "Enable deprecated public API symbols" FORCE) SET (HDF5_ENABLE_PARALLEL OFF CACHE BOOL "Enable parallel build (requires MPI)" FORCE) +SET (MPIEXEC_MAX_NUMPROCS "3" CACHE STRING "Minimum number of processes for HDF parallel tests" FORCE) + SET (HDF5_ENABLE_COVERAGE OFF CACHE BOOL "Enable code coverage for Libraries and Programs" FORCE) SET (HDF5_ENABLE_USING_MEMCHECKER OFF CACHE BOOL "Indicate that a memory checker is used" FORCE) SET (HDF5_DISABLE_COMPILER_WARNINGS OFF CACHE BOOL "Disable compiler warnings" FORCE) +SET (HDF5_USE_FOLDERS ON CACHE BOOL "Enable folder grouping of projects in IDEs." FORCE) + SET (HDF5_USE_16_API_DEFAULT OFF CACHE BOOL "Use the HDF5 1.6.x API by default" FORCE) +SET (HDF5_USE_18_API_DEFAULT OFF CACHE BOOL "Use the HDF5 1.8.x API by default" FORCE) + SET (HDF5_ENABLE_THREADSAFE OFF CACHE BOOL "(WINDOWS)Enable Threadsafety" FORCE) SET (HDF5_PACKAGE_EXTLIBS OFF CACHE BOOL "(WINDOWS)CPACK - include external libraries" FORCE) +SET (HDF5_NO_PACKAGES OFF CACHE BOOL "CPACK - Disable packaging" FORCE) + SET (HDF5_ALLOW_EXTERNAL_SUPPORT "NO" CACHE STRING "Allow External Library Building" FORCE) SET (ZLIB_SVN_URL "http://svn.hdfgroup.uiuc.edu/zlib/trunk" CACHE STRING "Use ZLib from HDF repository" FORCE) diff --git a/config/cmake/hdf5-config.cmake.build.in b/config/cmake/hdf5-config.cmake.build.in index 47a119a..ccf5e67 100644 --- a/config/cmake/hdf5-config.cmake.build.in +++ b/config/cmake/hdf5-config.cmake.build.in @@ -8,13 +8,14 @@ GET_FILENAME_COMPONENT (SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) #----------------------------------------------------------------------------- SET (HDF5_ENABLE_PARALLEL @HDF5_ENABLE_PARALLEL@) SET (HDF5_BUILD_FORTRAN @HDF5_BUILD_FORTRAN@) +SET (HDF5_ENABLE_F2003 @HDF5_ENABLE_F2003@) SET (HDF5_BUILD_CPP_LIB @HDF5_BUILD_CPP_LIB@) SET (HDF5_BUILD_TOOLS @HDF5_BUILD_TOOLS@) SET (HDF5_BUILD_HL_LIB @HDF5_BUILD_HL_LIB@) SET (HDF5_ENABLE_Z_LIB_SUPPORT @HDF5_ENABLE_Z_LIB_SUPPORT@) SET (HDF5_ENABLE_SZIP_SUPPORT @HDF5_ENABLE_SZIP_SUPPORT@) SET (HDF5_ENABLE_SZIP_ENCODING @HDF5_ENABLE_SZIP_ENCODING@) -SET (BUILD_SHARED_LIBS @BUILD_SHARED_LIBS@) +SET (HDF5_BUILD_SHARED_LIBS @BUILD_SHARED_LIBS@) #----------------------------------------------------------------------------- # Directories @@ -54,4 +55,5 @@ SET (HDF5_VERSION_MINOR @HDF5_VERSION_MINOR@) #----------------------------------------------------------------------------- IF (NOT TARGET "hdf5") INCLUDE (${SELF_DIR}/hdf5-targets.cmake) + SET (HDF5_LIBRARIES "@HDF5_LIBRARIES_TO_EXPORT@") ENDIF (NOT TARGET "hdf5") diff --git a/config/cmake/hdf5-config.cmake.install.in b/config/cmake/hdf5-config.cmake.install.in index 8dcd86f..268d5ed 100644 --- a/config/cmake/hdf5-config.cmake.install.in +++ b/config/cmake/hdf5-config.cmake.install.in @@ -2,44 +2,49 @@ # HDF5 Config file for compiling against hdf5 install directory #----------------------------------------------------------------------------- GET_FILENAME_COMPONENT (SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) +GET_FILENAME_COMPONENT(_IMPORT_PREFIX "${SELF_DIR}" PATH) +GET_FILENAME_COMPONENT(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) +GET_FILENAME_COMPONENT(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) #----------------------------------------------------------------------------- # User Options #----------------------------------------------------------------------------- SET (HDF5_ENABLE_PARALLEL @HDF5_ENABLE_PARALLEL@) SET (HDF5_BUILD_FORTRAN @HDF5_BUILD_FORTRAN@) +SET (HDF5_ENABLE_F2003 @HDF5_ENABLE_F2003@) SET (HDF5_BUILD_CPP_LIB @HDF5_BUILD_CPP_LIB@) SET (HDF5_BUILD_TOOLS @HDF5_BUILD_TOOLS@) SET (HDF5_BUILD_HL_LIB @HDF5_BUILD_HL_LIB@) SET (HDF5_ENABLE_Z_LIB_SUPPORT @HDF5_ENABLE_Z_LIB_SUPPORT@) SET (HDF5_ENABLE_SZIP_SUPPORT @HDF5_ENABLE_SZIP_SUPPORT@) SET (HDF5_ENABLE_SZIP_ENCODING @HDF5_ENABLE_SZIP_ENCODING@) -SET (BUILD_SHARED_LIBS @BUILD_SHARED_LIBS@) +SET (HDF5_BUILD_SHARED_LIBS @BUILD_SHARED_LIBS@) +SET (HDF5_PACKAGE_EXTLIBS @HDF5_PACKAGE_EXTLIBS@) #----------------------------------------------------------------------------- # Directories #----------------------------------------------------------------------------- -SET (HDF5_INCLUDE_DIR "@CMAKE_INSTALL_PREFIX@/include" ) +SET (HDF5_INCLUDE_DIR "${_IMPORT_PREFIX}/include" ) IF (HDF5_BUILD_FORTRAN) - SET (HDF5_INCLUDE_DIR_FORTRAN "@CMAKE_INSTALL_PREFIX@/include/fortran" ) + SET (HDF5_INCLUDE_DIR_FORTRAN "${_IMPORT_PREFIX}/include/fortran" ) ENDIF (HDF5_BUILD_FORTRAN) IF (HDF5_BUILD_CPP_LIB) - SET (HDF5_INCLUDE_DIR_CPP "@CMAKE_INSTALL_PREFIX@/include/cpp" ) + SET (HDF5_INCLUDE_DIR_CPP "${_IMPORT_PREFIX}/include/cpp" ) ENDIF (HDF5_BUILD_CPP_LIB) IF (HDF5_BUILD_HL_LIB) - SET (HDF5_INCLUDE_DIR_HL "@CMAKE_INSTALL_PREFIX@/include/hl" ) + SET (HDF5_INCLUDE_DIR_HL "${_IMPORT_PREFIX}/include/hl" ) ENDIF (HDF5_BUILD_HL_LIB) IF (HDF5_BUILD_HL_LIB AND HDF5_BUILD_CPP_LIB) - SET (HDF5_INCLUDE_DIR_HL_CPP "@CMAKE_INSTALL_PREFIX@/include/hl/cpp" ) + SET (HDF5_INCLUDE_DIR_HL_CPP "${_IMPORT_PREFIX}/include/hl/cpp" ) ENDIF (HDF5_BUILD_HL_LIB AND HDF5_BUILD_CPP_LIB) IF (HDF5_BUILD_TOOLS) - SET (HDF5_INCLUDE_DIR_TOOLS "@CMAKE_INSTALL_PREFIX@/include/tools" ) - SET (HDF5_TOOLS_DIR "@CMAKE_INSTALL_PREFIX@/bin/tools" ) + SET (HDF5_INCLUDE_DIR_TOOLS "${_IMPORT_PREFIX}/include/tools" ) + SET (HDF5_TOOLS_DIR "${_IMPORT_PREFIX}/bin/tools" ) ENDIF (HDF5_BUILD_TOOLS) #----------------------------------------------------------------------------- @@ -54,7 +59,14 @@ SET (HDF5_VERSION_MINOR @HDF5_VERSION_MINOR@) # project which has already built hdf5 as a subproject #----------------------------------------------------------------------------- IF (NOT TARGET "hdf5") + IF (HDF5_ENABLE_Z_LIB_SUPPORT AND HDF5_PACKAGE_EXTLIBS AND NOT TARGET "zlib") + INCLUDE (${SELF_DIR}/../ZLIB/ZLIB-targets.cmake) + ENDIF (HDF5_ENABLE_Z_LIB_SUPPORT AND HDF5_PACKAGE_EXTLIBS AND NOT TARGET "zlib") + IF (HDF5_ENABLE_SZIP_SUPPORT AND HDF5_PACKAGE_EXTLIBS AND NOT TARGET "szip") + INCLUDE (${SELF_DIR}/../SZIP/SZIP-targets.cmake) + ENDIF (HDF5_ENABLE_SZIP_SUPPORT AND HDF5_PACKAGE_EXTLIBS AND NOT TARGET "szip") INCLUDE (${SELF_DIR}/hdf5-targets.cmake) + SET (HDF5_LIBRARIES "@HDF5_LIBRARIES_TO_EXPORT@") ENDIF (NOT TARGET "hdf5") #----------------------------------------------------------------------------- @@ -64,16 +76,16 @@ ENDIF (NOT TARGET "hdf5") # To be continued (maybe) ... # # XXX_INCLUDE_DIRS no, use one per library as in HDF5_FORTRAN_INCLUDE_DIR -# XXX_LIBRARIES not needed - see hdf5-targets.cmake -# XXX_DEFINITIONS Definitions to use when compiling code that uses XXX. This really shouldn't include options such as (-DHAS_JPEG) that a client source-code file uses to decide whether to #include -# XXX_EXECUTABLE Where to find the XXX tool. -# XXX_YYY_EXECUTABLE Where to find the YYY tool that comes with XXX. +# XXX_LIBRARIES not needed - see hdf5-targets.cmake +# XXX_DEFINITIONS Definitions to use when compiling code that uses XXX. This really shouldn't include options such as (-DHAS_JPEG) that a client source-code file uses to decide whether to #include +# XXX_EXECUTABLE Where to find the XXX tool. +# XXX_YYY_EXECUTABLE Where to find the YYY tool that comes with XXX. # XXX_LIBRARY_DIRS Optionally, the final set of library directories listed in one variable for use by client code. This should not be a cache entry. -# XXX_ROOT_DIR Where to find the base directory of XXX. -# XXX_VERSION_YY Expect Version YY if true. Make sure at most one of these is ever true. -# XXX_WRAP_YY If False, do not try to use the relevent CMake wrapping command. -# XXX_YY_FOUND If False, optional YY part of XXX sytem is not available. -# XXX_FOUND Set to false, or undefined, if we haven't found, or don't want to use XXX. +# XXX_ROOT_DIR Where to find the base directory of XXX. +# XXX_VERSION_YY Expect Version YY if true. Make sure at most one of these is ever true. +# XXX_WRAP_YY If False, do not try to use the relevent CMake wrapping command. +# XXX_YY_FOUND If False, optional YY part of XXX sytem is not available. +# XXX_FOUND Set to false, or undefined, if we haven't found, or don't want to use XXX. # XXX_RUNTIME_LIBRARY_DIRS Optionally, the runtime library search path for use when running an executable linked to shared libraries. # The list should be used by user code to create the PATH on windows or LD_LIBRARY_PATH on unix. # This should not be a cache entry. diff --git a/config/cmake/libhdf5.settings.cmake.in b/config/cmake/libhdf5.settings.cmake.in index ba233e8..4027c55 100644 --- a/config/cmake/libhdf5.settings.cmake.in +++ b/config/cmake/libhdf5.settings.cmake.in @@ -1,68 +1,69 @@ - SUMMARY OF THE HDF5 CONFIGURATION - ================================= + SUMMARY OF THE HDF5 CONFIGURATION + ================================= General Information: ------------------- - HDF5 Version: @H5_VERSION@ - Configured on: @CONFIG_DATE@ - Configured by: @CONFIG_USER@ - Configure mode: @CONFIG_MODE@ - Host system: @host_cpu@-@host_vendor@-@host_os@ - Uname information: @UNAME_INFO@ - Byte sex: @BYTESEX@ - Libraries: @STATIC_SHARED@ - Installation point: @prefix@ + HDF5 Version: @HDF5_PACKAGE_VERSION@ + Configured on: @CONFIG_DATE@ + Configured by: @CMAKE_GENERATOR@ + Configure mode: CMAKE @CMAKE_VERSION@ + Host system: @CMAKE_HOST_SYSTEM@ + Uname information: @CMAKE_SYSTEM_NAME@ + Byte sex: @BYTESEX@ + Libraries: @BUILD_NAME_EXT@ + Installation point: @CMAKE_INSTALL_PREFIX@ Compiling Options: ------------------ - Compilation Mode: @CONFIG_MODE@ - C Compiler: @CC_VERSION@ - CFLAGS: @CFLAGS@ + Compilation Mode: @CMAKE_BUILD_TYPE@ + C Compiler: @CMAKE_C_COMPILER@ + CFLAGS: @CMAKE_C_FLAGS@ H5_CFLAGS: @H5_CFLAGS@ AM_CFLAGS: @AM_CFLAGS@ - CPPFLAGS: @CPPFLAGS@ + CPPFLAGS: @CMAKE_CXX_FLAGS@ H5_CPPFLAGS: @H5_CPPFLAGS@ AM_CPPFLAGS: @AM_CPPFLAGS@ - Shared Libraries: @enable_shared@ - Static Libraries: @enable_static@ - Statically Linked Executables: @STATIC_EXEC@ - LDFLAGS: @LDFLAGS@ + Shared Libraries: @H5_ENABLE_SHARED_LIB@ + Static Libraries: @H5_ENABLE_STATIC_LIB@ + Statically Linked Executables: @BUILD_STATIC_EXECS@ + LDFLAGS: @CMAKE_SHARED_LINKER_FLAGS@ AM_LDFLAGS: @AM_LDFLAGS@ - Extra libraries: @LIBS@ - Archiver: @AR@ - Ranlib: @RANLIB@ - Debugged Packages: @DEBUG_PKG@ - API Tracing: @TRACE_API@ + Extra libraries: @LINK_LIBS@ + Archiver: @CMAKE_AR@ + Ranlib: @CMAKE_RANLIB@ + Debugged Packages: @DEBUG_PKG@ + API Tracing: @HDF5_ENABLE_TRACE@ Languages: ---------- - Fortran: @HDF_FORTRAN@ -@BUILD_FORTRAN_CONDITIONAL_TRUE@ Fortran Compiler: @FC@ -@BUILD_FORTRAN_CONDITIONAL_TRUE@ Fortran Flags: @FCFLAGS@ + Fortran: @HDF5_BUILD_FORTRAN@ +@BUILD_FORTRAN_CONDITIONAL_TRUE@ Fortran Compiler: @CMAKE_Fortran_COMPILER@ +@BUILD_FORTRAN_CONDITIONAL_TRUE@ Fortran 2003 Compiler: @HDF5_ENABLE_F2003@ +@BUILD_FORTRAN_CONDITIONAL_TRUE@ Fortran Flags: @CMAKE_Fortran_FLAGS@ @BUILD_FORTRAN_CONDITIONAL_TRUE@ H5 Fortran Flags: @H5_FCFLAGS@ @BUILD_FORTRAN_CONDITIONAL_TRUE@ AM Fortran Flags: @AM_FCFLAGS@ - C++: @HDF_CXX@ -@BUILD_CXX_CONDITIONAL_TRUE@ C++ Compiler: @CXX@ -@BUILD_CXX_CONDITIONAL_TRUE@ C++ Flags: @CXXFLAGS@ + C++: @HDF5_BUILD_CPP_LIB@ +@BUILD_CXX_CONDITIONAL_TRUE@ C++ Compiler: @CMAKE_CXX_COMPILER@ +@BUILD_CXX_CONDITIONAL_TRUE@ C++ Flags: @CMAKE_CXX_FLAGS@ @BUILD_CXX_CONDITIONAL_TRUE@ H5 C++ Flags: @H5_CXXFLAGS@ @BUILD_CXX_CONDITIONAL_TRUE@ AM C++ Flags: @AM_CXXFLAGS@ Features: --------- - Parallel HDF5: @PARALLEL@ - High Level library: @HDF5_HL@ - Threadsafety: @THREADSAFE@ + Parallel HDF5: @HDF5_ENABLE_PARALLEL@ + High Level library: @HDF5_BUILD_HL_LIB@ + Threadsafety: @HDF5_ENABLE_THREADSAFE@ Default API Mapping: @DEFAULT_API_VERSION@ - With Deprecated Public Symbols: @DEPRECATED_SYMBOLS@ + With Deprecated Public Symbols: @HDF5_ENABLE_DEPRECATED_SYMBOLS@ I/O filters (external): @EXTERNAL_FILTERS@ I/O filters (internal): @FILTERS@ - MPE: @MPE@ - Direct VFD: @DIRECT_VFD@ - dmalloc: @HAVE_DMALLOC@ -Clear file buffers before write: @CLEARFILEBUF@ - Using memory checker: @USINGMEMCHECKER@ - Function Stack Tracing: @CODESTACK@ - GPFS: @GPFS@ - Strict File Format Checks: @STRICT_FORMAT_CHECKS@ - Optimization Instrumentation: @INSTRUMENT@ - Large File Support (LFS): @LARGEFILE@ + MPE: @H5_HAVE_LIBLMPE@ + Direct VFD: @H5_HAVE_DIRECT@ + dmalloc: @H5_HAVE_LIBDMALLOC@ +Clear file buffers before write: @HDF5_Enable_Clear_File_Buffers@ + Using memory checker: @HDF5_ENABLE_USING_MEMCHECKER@ + Function Stack Tracing: @HDF5_ENABLE_CODESTACK@ + GPFS: @HDF5_ENABLE_GPFS@ + Strict File Format Checks: @HDF5_STRICT_FORMAT_CHECKS@ + Optimization Instrumentation: @HDF5_Enable_Instrument@ + Large File Support (LFS): @HDF5_ENABLE_LARGE_FILE@ diff --git a/config/cmake/mccacheinit.cmake b/config/cmake/mccacheinit.cmake index 2086991..10b2824 100755 --- a/config/cmake/mccacheinit.cmake +++ b/config/cmake/mccacheinit.cmake @@ -24,8 +24,6 @@ SET (HDF5_ENABLE_SZIP_SUPPORT ON CACHE BOOL "Use SZip Filter" FORCE) SET (HDF5_ENABLE_SZIP_ENCODING ON CACHE BOOL "Use SZip Encoding" FORCE) -SET (HDF5_USE_H5DUMP_PACKED_BITS OFF CACHE BOOL "Use the PACKED BITS feature in h5dump" FORCE) - SET (HDF5_ENABLE_HSIZET ON CACHE BOOL "Enable datasets larger than memory" FORCE) SET (HDF5_ENABLE_DEPRECATED_SYMBOLS ON CACHE BOOL "Enable deprecated public API symbols" FORCE) @@ -56,3 +54,5 @@ SET (SZIP_TGZ_NAME "SZip.tar.gz" CACHE STRING "Use SZip from compressed file" FO SET (CMAKE_BUILD_TYPE "Debug" CACHE STRING "Build Debug" FORCE) +SET (CTEST_BUILD_CONFIGURATION "Debug" CACHE STRING "Build Debug" FORCE) + diff --git a/config/cmake/prunTest.cmake b/config/cmake/prunTest.cmake new file mode 100644 index 0000000..8bcf729 --- /dev/null +++ b/config/cmake/prunTest.cmake @@ -0,0 +1,121 @@ +# runTest.cmake executes a command and captures the output in a file. File is then compared +# against a reference file. Exit status of command can also be compared. + +# arguments checking +IF (NOT TEST_PROGRAM) + MESSAGE (FATAL_ERROR "Require TEST_PROGRAM to be defined") +ENDIF (NOT TEST_PROGRAM) +#IF (NOT TEST_ARGS) +# MESSAGE (STATUS "Require TEST_ARGS to be defined") +#ENDIF (NOT TEST_ARGS) +IF (NOT TEST_FOLDER) + MESSAGE ( FATAL_ERROR "Require TEST_FOLDER to be defined") +ENDIF (NOT TEST_FOLDER) +IF (NOT TEST_OUTPUT) + MESSAGE (FATAL_ERROR "Require TEST_OUTPUT to be defined") +ENDIF (NOT TEST_OUTPUT) +#IF (NOT TEST_EXPECT) +# MESSAGE (STATUS "Require TEST_EXPECT to be defined") +#ENDIF (NOT TEST_EXPECT) +#IF (NOT TEST_FILTER) +# MESSAGE (STATUS "Require TEST_FILTER to be defined") +#ENDIF (NOT TEST_FILTER) +IF (NOT TEST_SKIP_COMPARE AND NOT TEST_REFERENCE) + MESSAGE (FATAL_ERROR "Require TEST_REFERENCE to be defined") +ENDIF (NOT TEST_SKIP_COMPARE AND NOT TEST_REFERENCE) + +SET (ERROR_APPEND 1) + +MESSAGE (STATUS "COMMAND: ${TEST_PROGRAM} ${TEST_ARGS}") + +IF (TEST_ENV_VAR) + SET (ENV{${TEST_ENV_VAR}} "${TEST_ENV_VALUE}") +ENDIF (TEST_ENV_VAR) + +# run the test program, capture the stdout/stderr and the result var +EXECUTE_PROCESS ( + COMMAND ${TEST_PROGRAM} ${TEST_ARGS} + WORKING_DIRECTORY ${TEST_FOLDER} + RESULT_VARIABLE TEST_RESULT + OUTPUT_FILE ${TEST_OUTPUT} + ERROR_FILE ${TEST_OUTPUT}.err + OUTPUT_VARIABLE TEST_ERROR + ERROR_VARIABLE TEST_ERROR +) + +MESSAGE (STATUS "COMMAND Result: ${TEST_RESULT}") + +FILE (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM) +FILE (WRITE ${TEST_FOLDER}/P_${TEST_REFERENCE} "${TEST_STREAM}") + +IF (ERROR_APPEND) + FILE (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_STREAM) + FILE (APPEND ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") +ENDIF (ERROR_APPEND) + +IF (TEST_APPEND) + FILE (APPEND ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_APPEND} ${TEST_ERROR}\n") +ENDIF (TEST_APPEND) + +MESSAGE (STATUS "COMMAND Error: ${TEST_ERROR}") + +IF (TEST_MASK) + FILE (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) + STRING(REGEX REPLACE "Storage:[^\n]+\n" "Storage:
\n" TEST_STREAM "${TEST_STREAM}") + FILE (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") +ENDIF (TEST_MASK) + +IF (TEST_MASK_MOD) + FILE (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) + STRING(REGEX REPLACE "Modified:[^\n]+\n" "Modified: XXXX-XX-XX XX:XX:XX XXX\n" TEST_STREAM "${TEST_STREAM}") + FILE (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") +ENDIF (TEST_MASK_MOD) + +IF (TEST_MASK_ERROR) + FILE (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) + STRING(REGEX REPLACE "thread [0-9]*:" "thread (IDs):" TEST_STREAM "${TEST_STREAM}") + STRING(REGEX REPLACE ": ([^\n]*)[.]c " ": (file name) " TEST_STREAM "${TEST_STREAM}") + STRING(REGEX REPLACE " line [0-9]*" " line (number)" TEST_STREAM "${TEST_STREAM}") + STRING(REGEX REPLACE "v[1-9]*[.][0-9]*[.]" "version (number)." TEST_STREAM "${TEST_STREAM}") + STRING(REGEX REPLACE "[1-9]*[.][0-9]*[.][0-9]*[^)]*" "version (number)" TEST_STREAM "${TEST_STREAM}") + STRING(REGEX REPLACE "H5Eget_auto[1-2]*" "H5Eget_auto(1 or 2)" TEST_STREAM "${TEST_STREAM}") + STRING(REGEX REPLACE "H5Eset_auto[1-2]*" "H5Eset_auto(1 or 2)" TEST_STREAM "${TEST_STREAM}") + FILE (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") +ENDIF (TEST_MASK_ERROR) + +IF (TEST_FILTER) + FILE (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) + STRING(REGEX REPLACE "${TEST_FILTER}" "" TEST_STREAM "${TEST_STREAM}") + FILE (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") +ENDIF (TEST_FILTER) + +#IF (TEST_REF_FILTER) +# MESSAGE (STATUS "TEST_REF_FILTER: ${TEST_APPEND}${TEST_REF_FILTER}") +# FILE (READ ${TEST_FOLDER}/P_${TEST_REFERENCE} TEST_STREAM) +# STRING(REGEX REPLACE "${TEST_APPEND}" "${TEST_REF_FILTER}" TEST_STREAM "${TEST_STREAM}") +# FILE (WRITE ${TEST_FOLDER}/P_${TEST_REFERENCE} "${TEST_STREAM}") +#ENDIF (TEST_REF_FILTER) + +IF (NOT TEST_SKIP_COMPARE) + IF (WIN32 AND NOT MINGW) + FILE (READ ${TEST_FOLDER}/P_${TEST_REFERENCE} TEST_STREAM) + FILE (WRITE ${TEST_FOLDER}/P_${TEST_REFERENCE} "${TEST_STREAM}") + ENDIF (WIN32 AND NOT MINGW) + + # now compare the output with the reference + EXECUTE_PROCESS ( + COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_FOLDER}/P_${TEST_REFERENCE} + RESULT_VARIABLE TEST_RESULT + ) + + MESSAGE (STATUS "COMPARE Result: ${TEST_RESULT}") + + # again, if return value is !=0 scream and shout + IF (NOT ${TEST_RESULT} STREQUAL 0) + MESSAGE (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did not match P_${TEST_REFERENCE}") + ENDIF (NOT ${TEST_RESULT} STREQUAL 0) +ENDIF (NOT TEST_SKIP_COMPARE) + +# everything went fine... +MESSAGE ("Passed: The output of ${TEST_PROGRAM} matches P_${TEST_REFERENCE}") + diff --git a/config/gnu-flags b/config/gnu-flags index 2ef29e5..38ea4e4 100644 --- a/config/gnu-flags +++ b/config/gnu-flags @@ -28,8 +28,14 @@ if test X = "X$cc_flags_set"; then # PathScale compiler spits out gcc version string too. Need to # filter it out. + # icc beginning with version 12 includes a "gcc version compatiblilty" + # string, causing the gcc H5_CFLAGS to be erroneously added. The line + # "grep -v 'icc version'" causes the discarding of any output + # containing 'icc version'. The cc_version for icc is correctly determined + # and flags added in the intel-flags script. cc_version="`$CC $CFLAGS $H5_CFLAGS -v 2>&1 | grep -v 'PathScale' |\ - grep 'gcc version' | sed 's/.*gcc version \([-a-z0-9\.]*\).*/\1/'`" + grep -v 'icc version' |\ + grep 'gcc version' | sed 's/.*gcc version \([-a-z0-9\.]*\).*/\1/'`" cc_vendor=`echo $cc_version |sed 's/\([a-z]*\).*/\1/'` cc_version=`echo $cc_version |sed 's/[-a-z]//g'` if test X = "X$cc_vendor" -a X != "X$cc_version"; then @@ -236,7 +242,7 @@ case "$cc_vendor-$cc_version" in H5_CFLAGS="$H5_CFLAGS -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat" # Append more extra warning flags that only gcc 4.5+ know about - H5_CFLAGS="$H5_CFLAGS -Wstrict-aliasing -Wstrict-overflow=5 -Wc++0x-compat -Wjump-misses-init -Wunsuffixed-float-constants" + H5_CFLAGS="$H5_CFLAGS -Wstrict-aliasing -Wstrict-overflow=5 -Wjump-misses-init -Wunsuffixed-float-constants" # Append more extra warning flags that only gcc 4.6+ know about H5_CFLAGS="$H5_CFLAGS -Wdouble-promotion -Wsuggest-attribute=const -Wtrampolines" @@ -300,7 +306,7 @@ case "$cc_vendor-$cc_version" in H5_CFLAGS="$H5_CFLAGS -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat" # Append more extra warning flags that only gcc 4.5+ know about - H5_CFLAGS="$H5_CFLAGS -Wstrict-aliasing -Wstrict-overflow=5 -Wc++0x-compat -Wjump-misses-init -Wunsuffixed-float-constants" + H5_CFLAGS="$H5_CFLAGS -Wstrict-aliasing -Wstrict-overflow=5 -Wjump-misses-init -Wunsuffixed-float-constants" # Try out the new "stack protector" feature in gcc 4.1 # (Strictly speaking this isn't really a "warning" flag, so it's added to diff --git a/config/i686-pc-cygwin b/config/i686-pc-cygwin index a51adc3..9b1ab74 100644 --- a/config/i686-pc-cygwin +++ b/config/i686-pc-cygwin @@ -1,4 +1,4 @@ -# -*- shell-script -*- +# -*- shell-script -*- # # Copyright by The HDF Group. # Copyright by the Board of Trustees of the University of Illinois. @@ -39,9 +39,9 @@ fi if test "X-" = "X-$FC"; then case $CC_BASENAME in gcc*) - FC=g95 + FC=gfortran FCLIBS=-lgcc - FC_BASENAME=g95 + FC_BASENAME=gfortran ;; pgcc*) FC=pgf90 @@ -61,6 +61,9 @@ else # The PGI and Intel compilers are automatically detected below ifc*|ifort*|pgf90*) ;; + gfortran) + FCLIBS=-lgcc + ;; g95) FCLIBS=-lgcc ;; diff --git a/config/ia64-linux-gnu b/config/ia64-linux-gnu index 519d0fc..9f1b262 100644 --- a/config/ia64-linux-gnu +++ b/config/ia64-linux-gnu @@ -142,12 +142,3 @@ case $CXX_BASENAME in PROFILE_CPPFLAGS= ;; esac - -# Check MPICH settings -. $srcdir/config/mpich -#Uncomment the next line if your system doesn't support MPI complex derived datatype. -#hdf5_cv_mpi_complex_derived_datatype_works=${hdf5_cv_mpi_complex_derived_datatype_works='no'} -#Comment out the following line if your system supports collective IO when some processes -#don't have any contributions to IOs. -hdf5_cv_mpi_special_collective_io_works=${hdf5_cv_mpi_special_collective_io_works='no'} - diff --git a/config/ibm-aix b/config/ibm-aix index ab934a7..c8b1fc3 100644 --- a/config/ibm-aix +++ b/config/ibm-aix @@ -36,12 +36,45 @@ fi # Ask for more memory so that "make check" will pass. Not necessary for -q64 # mode but it does no harm. if test "X-$enable_parallel" = "X-yes" -o X-$CC_BASENAME = X-mpcc_r; then - RUNPARALLEL=${RUNPARALLEL="env LDR_CNTRL=MAXDATA=0x20000000@DSA MP_PROCS=\$\${NPROCS:=6} MP_TASKS_PER_NODE=\$\${NPROCS:=6} poe"} - RUNSERIAL=${RUNSERIAL="env LDR_CNTRL=MAXDATA=0x20000000@DSA MP_PROCS=1 MP_TASKS_PER_NODE=1 poe"} -else - RUNSERIAL=${RUNSERIAL="env LDR_CNTRL=MAXDATA=0x20000000@DSA"} + RUNPARALLEL=${RUNPARALLEL="env MP_PROCS=\$\${NPROCS:=6} MP_TASKS_PER_NODE=\$\${NPROCS:=6} poe"} fi +# The default Fortran 90 compiler + +if test "X-" = "X-$FC"; then + if test "X-$enable_parallel" = "X-yes"; then + FC=mpxlf90_r + else + FC=xlf90 + fi +fi + +# While we try to avoid setting FCFLAGS directly for use in compilation, in +# this case we need the -k flag present for some configure checks. As such, +# the configure script saves the user's set FCFLAGS before running, and +# restores them when complete. We must then set up both FCFLAGS and H5_FCFLAGS +# to ensure the flag is present for both configure as well as for the build. +if test "X-" = "X-$f9x_flags_set"; then + F9XSUFFIXFLAG="-qsuffix=f=f90" + FCFLAGS="$FCFLAGS -O ${F9XSUFFIXFLAG}" + H5_FCFLAGS="$H5_FCFLAGS -O ${F9XSUFFIXFLAG}" + FSEARCH_DIRS="-I./ -I../src" + DEBUG_FCFLAGS="-O" + PROD_FCFLAGS="-O" + PROFILE_FCFLAGS="-O" + f9x_flags_set=yes +fi + +# The default C++ compiler + +# Use AIX supplied C++ compiler by default. +CXX=${CXX=xlC} + +# Added -qweaksymbol to suppress linker messages warning of duplicate +# symbols; these warnings are harmless. - BMR +H5_CXXFLAGS="$H5_CXXFLAGS -qweaksymbol" +AM_CXXFLAGS="$AM_CXXFLAGS" + #---------------------------------------------------------------------------- # Compiler flags. The CPPFLAGS values should not include package debug @@ -49,7 +82,7 @@ fi # `--enable-debug' switch of configure. case $CC_BASENAME in - xlc|xlc-*|mpcc_r|mpcc_r-*) + xlc|xlc-*|xlc_r|xlc_r-*|mpcc_r|mpcc_r-*) . $srcdir/config/ibm-flags ;; @@ -115,46 +148,3 @@ ac_cv_sizeof_uint_fast64_t=${ac_cv_sizeof_uint_fast64_t=8} # Don't cache long since it varies between 32 and 64 bits #ac_cv_sizeof_long=${ac_cv_sizeof_long=4} - -# The default Fortran 90 compiler - -if test "X-" = "X-$FC"; then - if test "X-$enable_parallel" = "X-yes"; then - FC=mpxlf90_r - else - FC=xlf90 - fi -fi - -# While we try to avoid setting FCFLAGS directly for use in compilation, in -# this case we need the -k flag present for some configure checks. As such, -# the configure script saves the user's set FCFLAGS before running, and -# restores them when complete. We must then set up both FCFLAGS and H5_FCFLAGS -# to ensure the flag is present for both configure as well as for the build. -if test "X-" = "X-$f9x_flags_set"; then - F9XSUFFIXFLAG="-qsuffix=f=f90" - FCFLAGS="$FCFLAGS -O ${F9XSUFFIXFLAG}" - H5_FCFLAGS="$H5_FCFLAGS -O ${F9XSUFFIXFLAG}" - FSEARCH_DIRS="-I./ -I../src" - DEBUG_FCFLAGS="-O" - PROD_FCFLAGS="-O" - PROFILE_FCFLAGS="-O" - f9x_flags_set=yes -fi - -# With poe version 3.2.0.19 or lower(using lpp -l all | grep ppe.poe to check the version number, -# IBM MPI-IO implementation has a bug, -#it cannot generate correct MPI derived datatype. Please uncomment the following line: -#hdf5_cv_mpi_complex_derived_datatype_works=${hdf5_cv_mpi_complex_derived_datatype_works='no'} - -# The default C++ compiler - -# Use AIX supplied C++ compiler by default. -CXX=${CXX=xlC} - -# Added -qweaksymbol to suppress linker messages warning of duplicate -# symbols; these warnings are harmless. - BMR -H5_CXXFLAGS="$H5_CXXFLAGS -qweaksymbol" -AM_CXXFLAGS="$AM_CXXFLAGS" - - diff --git a/config/ibm-flags b/config/ibm-flags index 5e092b8..a1dfa2a 100644 --- a/config/ibm-flags +++ b/config/ibm-flags @@ -19,8 +19,8 @@ # if the compiler is not IBM; otherwise `cc_flags_set' is set to `yes' # -# Get the compiler version in a way that works for pgcc -# pgcc unless a compiler version is already known +# Get the compiler version in a way that works for XL compiler +# unless a compiler version is already defined. # # cc_vendor: The compiler product name: XL # cc_version: Version number: 10.1 @@ -75,3 +75,31 @@ if test "X-$cc_flags_set" = "X-"; then cc_version= cc_version_info= fi + + +# get fortran version info +if test X != X$FC; then + # Verify this is an IBM XL compiler + fc_version="`$FC $FCFLAGS -qversion 2>&1 | grep 'IBM XL Fortran'`" + if test X != "X$fc_version"; then + fc_vendor="XL" + fc_version="`$FC $FCFLAGS -qversion 2>&1 | sed -n 's/Version: \([0-9\.]*\).*/\1/p'`" + fc_version_info="IBM XL Fortran $fc_version" + echo "compiler '$FC' is IBM $fc_vendor-$fc_version" + + fi +fi + + +# get c++ version info +if test X != X$CXX; then + # Verify this is an IBM XL compiler + cxx_version="`$CXX $CXXFLAGS -qversion 2>&1 | grep 'IBM XL C/C++'`" + if test X != "X$cxx_version"; then + cxx_vendor="XL" + cxx_version="`$CXX $CXXFLAGS -qversion 2>&1 | sed -n 's/Version: \([0-9\.]*\).*/\1/p'`" + cxx_version_info="IBM XL C/C++ $cxx_version" + echo "compiler '$CXX' is IBM $cxx_vendor-$cxx_version" + + fi +fi diff --git a/config/intel-flags b/config/intel-flags index e6a9c31..1d01d7f 100644 --- a/config/intel-flags +++ b/config/intel-flags @@ -93,7 +93,7 @@ fi # Please follow the pattern below by adding new versions at the top, copying # the information from the previous version and adding modifications to that. case "$cc_vendor-$cc_version" in - icc-11*) + icc-11* | icc-12*) # -s became obsolete; we also fixed bugs that allow us to enable higher level # of optimization starting with 1.8.7 PROD_CFLAGS="-O3" diff --git a/config/irix6.x b/config/irix6.x index 9bd9c4c..8179b86 100644 --- a/config/irix6.x +++ b/config/irix6.x @@ -171,26 +171,6 @@ hdf5_cv_ulong_to_fp_bottom_bit_accurate=${hdf5_cv_ulong_to_fp_bottom_bit_accurat hdf5_cv_ldouble_to_integer_accurate=${hdf5_cv_ldouble_to_integer_accurate='no'} hdf5_cv_integer_to_ldouble_accurate=${hdf5_cv_integer_to_ldouble_accurate='no'} -# For IRIX 6.5, any version that is older than MIPSpro 7.3.1.3m, -# the MPI derived datatype is not working. -# Versions 7.4.2m or newer work. -# Up to version 7.4.4m, it cannot handle collective IO with non-contribution -# of some processes. -# Fix $hdf5_cv_mpi_complex_derived_datatype_works if it is not set and is using cc. -if [ -z "$hdf5_cv_mpi_complex_derived_datatype_works" -a $CC_BASENAME = cc ]; then - ccversion=`$CC -version 2>&1 | sed -e 's/.*Version //p'` - ccversion1=`echo $ccversion | cut -f1 -d.` - ccversion2=`echo $ccversion | cut -f2 -d.` - # Assume all versions 7.4.* or newer are okay - # and assume ccversion2 is never larger than 99. - ccversionval=`expr $ccversion1 \* 100 + $ccversion2` - hdf5_cv_mpi_special_collective_io_works='no' - if [ $ccversionval -lt 704 ]; then - hdf5_cv_mpi_complex_derived_datatype_works='no' -# hdf5_cv_mpi_special_collective_io_works='no' - fi -fi - # Set flag to generate alternate code for H5V_log2_gen, to avoid # problems with the MIPSpro compiler 7.30 and IRIX64 6.5 (ie. other # combinations might work, but haven't been tested) diff --git a/config/linux-gnulibc1 b/config/linux-gnulibc1 index 8f04cf0..9dcc411 100644 --- a/config/linux-gnulibc1 +++ b/config/linux-gnulibc1 @@ -125,23 +125,6 @@ if test -z "$CXX"; then CXX_BASENAME=g++ fi -# Check MPICH settings -. $srcdir/config/mpich - -# The ChaMPIon on NCSA tungsten doesn't work correctly for either of the following -# cases: -# 1. collective I/O when some processes don't have any contributions; -# 2. complex derived MPI data type. -if test $CC_BASENAME = cmpicc; then - hdf5_cv_mpi_special_collective_io_works=${hdf5_cv_mpi_special_collective_io_works='no'} - hdf5_cv_mpi_complex_derived_datatype_works=${hdf5_cv_mpi_complex_derived_datatype_works='no'} -fi - -#Comment out the following line if your system supports collective IO when some processes -#don't have any contributions to IOs. -hdf5_cv_mpi_special_collective_io_works=${hdf5_cv_mpi_special_collective_io_works='no'} -hdf5_cv_mpi_complex_derived_datatype_works=${hdf5_cv_mpi_complex_derived_datatype_works='no'} - # compiler version strings case $CC in # whatever matches *pgcc* will also match *gcc*, so this one must come first diff --git a/config/lt_vers.am b/config/lt_vers.am index 0aea0b4..c137d57 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 = 71 +LT_VERS_REVISION = 101 LT_VERS_AGE = 0 ## If the API changes *at all*, increment LT_VERS_INTERFACE and diff --git a/config/mpich b/config/mpich deleted file mode 100644 index 575859e..0000000 --- a/config/mpich +++ /dev/null @@ -1,83 +0,0 @@ -# -*- shell-script -*- -# -# Copyright by The HDF Group. -# Copyright by the Board of Trustees of the University of Illinois. -# All rights reserved. -# -# This file is part of HDF5. The full HDF5 copyright notice, including -# terms governing use, modification, and redistribution, is contained in -# the files COPYING and Copyright.html. COPYING can be found at the root -# of the source code distribution tree; Copyright.html can be found at the -# root level of an installed copy of the electronic HDF5 document set and -# is linked from the top-level documents page. It can also be found at -# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have -# access to either file, you may request a copy from help@hdfgroup.org. - -# This file should be sourced into configure if the compiler is the -# MPICH compiler script. It is careful not to do anything if the compiler -# is not MPICH. - -# Check if mpicc can support complicated derived datatype correctly. -# We know that mpich 1.2.4 and 1.2.5 do not support it correctly. We assume -# older versions do not work either. We don't know of a way of testing its -# correctness without the risk of hanging the configure process. So, we -# set the configure variable hdf5_cv_mpi_complex_derived_datatype_works to no. -# Notice that this code works only if the mpicc compiler shows its $MPIVERSION -# properly. It is confirmed mpicc does that as far back as v1.2.3. - -# mpich2 do not support it correctly. But mpich2 reports small version number -# indistiguishable from mpich. Some mpich2 reports blank, some reports 1.0.2. - -if [ -z "$hdf5_cv_mpi_complex_derived_datatype_works" ]; then - ccversion=`$CC -v 2>/dev/null` - # mpich compiler will give "mpicc for 1.2.x ..." - if echo "$ccversion" | grep '^mpicc for' > /dev/null ; then - # $CC is an MPICH compiler. Grab the version numbers. - ccversion=`echo $ccversion | cut -f3 -d' '` - case "$ccversion" in - 1.2.[0-5]*) - hdf5_cv_mpi_complex_derived_datatype_works='no' - ;; - 1.0.2) - # mpich2 is recycling the version number, some report - # 1.0.2, some report blank. - hdf5_cv_mpi_complex_derived_datatype_works='no' - ;; - "") - # got blank ccversion. Assume it is bad a mpich2. - hdf5_cv_mpi_complex_derived_datatype_works='no' - ;; - *) - # assume okay - ;; - esac - fi -fi - -if [ -z "$hdf5_cv_mpi_special_collective_io_works" ]; then - ccversion=`$CC -v 2>/dev/null` - # mpich compiler will give "mpicc for 1.2.x ..." - if echo "$ccversion" | grep '^mpicc for' > /dev/null ; then - # $CC is an MPICH compiler. Grab the version numbers. - ccversion=`echo $ccversion | cut -f3 -d' '` - case "$ccversion" in - 1.2.[0-6]*) - hdf5_cv_mpi_special_collective_io_works='no' - ;; - 1.0.2) - # mpich2 is recycling the version number, some report - # 1.0.2, some report blank. - hdf5_cv_mpi_special_collective_io_works='no' - ;; - "") - # got blank ccversion. Assume it is bad a mpich2. - hdf5_cv_mpi_special_collective_io_works='no' - ;; - *) - # assume okay - ;; - esac - fi -fi - - diff --git a/config/x86_64-redstorm-linux-gnu b/config/x86_64-redstorm-linux-gnu index 0cd2d73..76f9711 100644 --- a/config/x86_64-redstorm-linux-gnu +++ b/config/x86_64-redstorm-linux-gnu @@ -162,5 +162,3 @@ hdf5_cv_ullong_to_fp_cast_works=${hdf5_cv_ullong_to_fp_cast_works='yes'} hdf5_cv_ullong_to_ldouble_precision_works=${hdf5_cv_ullong_to_ldouble_precision_works='yes'} hdf5_cv_vsnprintf_works=${hdf5_cv_vsnprintf_works='yes'} hdf5_cv_fp_to_integer_overflow_works=${hdf5_cv_fp_to_integer_overflow_works='yes'} -# mpich2 used has derived datatype errors. -hdf5_cv_mpi_complex_derived_datatype_works=${hdf5_cv_mpi_complex_derived_datatype_works='no'} diff --git a/configure b/configure index f07fde3..60a4cd2 100755 --- a/configure +++ b/configure @@ -1,7 +1,7 @@ #! /bin/sh # From configure.in Id: configure.in 21544 2011-10-13 13:28:44Z derobins . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for HDF5 1.9.81-FA_a5. +# Generated by GNU Autoconf 2.68 for HDF5 1.9.111-FA_a5. # # Report bugs to . # @@ -571,8 +571,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='HDF5' PACKAGE_TARNAME='hdf5' -PACKAGE_VERSION='1.9.81-FA_a5' -PACKAGE_STRING='HDF5 1.9.81-FA_a5' +PACKAGE_VERSION='1.9.111-FA_a5' +PACKAGE_STRING='HDF5 1.9.111-FA_a5' PACKAGE_BUGREPORT='help@hdfgroup.org' PACKAGE_URL='' @@ -662,8 +662,8 @@ TRACE_API DEBUG_PKG H5_LONE_COLON PTHREAD -BUILD_SZIP_CONDITIONAL_FALSE -BUILD_SZIP_CONDITIONAL_TRUE +BUILD_SHARED_SZIP_CONDITIONAL_FALSE +BUILD_SHARED_SZIP_CONDITIONAL_TRUE LL_PATH USE_FILTER_SZIP USE_FILTER_DEFLATE @@ -713,6 +713,8 @@ ac_ct_CXX CXXFLAGS FORTRAN_DEFAULT_REALisDBLE_F_FALSE FORTRAN_DEFAULT_REALisDBLE_F_TRUE +FORTRAN_2003_CONDITIONAL_F_FALSE +FORTRAN_2003_CONDITIONAL_F_TRUE FORTRAN_HAVE_SIZEOF_FALSE FORTRAN_HAVE_SIZEOF_TRUE FCLIBS @@ -731,6 +733,7 @@ HSIZE_T HADDR_T R_INTEGER R_LARGE +HAVE_FORTRAN_2003 HDF5_INTERFACES am__fastdepCC_FALSE am__fastdepCC_TRUE @@ -761,7 +764,9 @@ GPFS HDF5_HL CXX HDF_CXX +FC2003 FC +HDF_FORTRAN2003 HDF_FORTRAN STATIC_EXEC MPE @@ -859,6 +864,7 @@ enable_maintainer_mode enable_dependency_tracking enable_unsupported enable_fortran +enable_fortran2003 enable_cxx enable_shared enable_static @@ -1457,7 +1463,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.81-FA_a5 to adapt to many kinds of systems. +\`configure' configures HDF5 1.9.111-FA_a5 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1527,7 +1533,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of HDF5 1.9.81-FA_a5:";; + short | recursive ) echo "Configuration of HDF5 1.9.111-FA_a5:";; esac cat <<\_ACEOF @@ -1542,7 +1548,9 @@ Optional Features: --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-unsupported Allow unsupported combinations of configure options - --enable-fortran Compile the Fortran interface [default=no] + --enable-fortran Compile the Fortran 77/90/95 interface [default=no] + --enable-fortran2003 Compile the Fortran 2003 interface, must also + specify --enable-fortran [default=no] --enable-cxx Compile the C++ interface [default=no] --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] @@ -1718,7 +1726,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -HDF5 configure 1.9.81-FA_a5 +HDF5 configure 1.9.111-FA_a5 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -2677,21 +2685,23 @@ rm -f conftest.val } # ac_fn_c_compute_int -# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES -# ---------------------------------------------------- -# Tries to find if the field MEMBER exists in type AGGR, after including -# INCLUDES, setting cache variable VAR accordingly. -ac_fn_c_check_member () +# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES +# --------------------------------------------- +# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR +# accordingly. +ac_fn_c_check_decl () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 -$as_echo_n "checking for $2.$3... " >&6; } -if eval \${$4+:} false; then : + as_decl_name=`echo $2|sed 's/ *(.*//'` + as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 +$as_echo_n "checking whether $as_decl_name is declared... " >&6; } +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$5 +$4 #ifdef FC_DUMMY_MAIN #ifndef FC_DUMMY_MAIN_EQ_F77 # ifdef __cplusplus @@ -2703,15 +2713,43 @@ $5 int main () { -static $2 ac_aggr; -if (ac_aggr.$3) -return 0; +#ifndef $as_decl_name +#ifdef __cplusplus + (void) $as_decl_use; +#else + (void) $as_decl_name; +#endif +#endif + ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - eval "$4=yes" + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_decl + +# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES +# ---------------------------------------------------- +# Tries to find if the field MEMBER exists in type AGGR, after including +# INCLUDES, setting cache variable VAR accordingly. +ac_fn_c_check_member () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 +$as_echo_n "checking for $2.$3... " >&6; } +if eval \${$4+:} false; then : + $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -2728,7 +2766,7 @@ int main () { static $2 ac_aggr; -if (sizeof ac_aggr.$3) +if (ac_aggr.$3) return 0; ; return 0; @@ -2737,36 +2775,9 @@ _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$4=yes" else - eval "$4=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$4 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_member - -# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES -# --------------------------------------------- -# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR -# accordingly. -ac_fn_c_check_decl () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - as_decl_name=`echo $2|sed 's/ *(.*//'` - as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 -$as_echo_n "checking whether $as_decl_name is declared... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$4 +$5 #ifdef FC_DUMMY_MAIN #ifndef FC_DUMMY_MAIN_EQ_F77 # ifdef __cplusplus @@ -2778,36 +2789,33 @@ $4 int main () { -#ifndef $as_decl_name -#ifdef __cplusplus - (void) $as_decl_use; -#else - (void) $as_decl_name; -#endif -#endif - +static $2 ac_aggr; +if (sizeof ac_aggr.$3) +return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - eval "$3=yes" + eval "$4=yes" else - eval "$3=no" + eval "$4=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -eval ac_res=\$$3 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$4 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno -} # ac_fn_c_check_decl +} # ac_fn_c_check_member 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.81-FA_a5, which was +It was created by HDF5 $as_me 1.9.111-FA_a5, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -3628,7 +3636,7 @@ fi # Define the identity of the package. PACKAGE='hdf5' - VERSION='1.9.81-FA_a5' + VERSION='1.9.111-FA_a5' cat >>confdefs.h <<_ACEOF @@ -3835,7 +3843,9 @@ $as_echo "done" >&6; } MPE=no STATIC_EXEC=no HDF_FORTRAN=no + HDF_FORTRAN2003=no HDF_FORTRAN=no + HDF_FORTRAN2003=no HDF_CXX=no HDF_CXX=no HDF5_HL=yes @@ -4984,15 +4994,42 @@ if test "${enable_fortran+set}" = set; then : fi +if test "X$HDF_FORTRAN" = "Xyes"; then + echo "yes" +else + echo "no" +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if Fortran 2003 interface enabled" >&5 +$as_echo_n "checking if Fortran 2003 interface enabled... " >&6; } +# Check whether --enable-fortran2003 was given. +if test "${enable_fortran2003+set}" = set; then : + enableval=$enable_fortran2003; HDF_FORTRAN2003=$enableval +fi + + + +if test "X$HDF_FORTRAN2003" = "Xyes" && test "X$HDF_FORTRAN" = "Xno"; then + echo "no" + as_fn_error $? "--enable-fortran must be used with --enable-fortran2003" "$LINENO" 5 +else + echo "yes" +fi HAVE_SIZEOF="no" FORTRAN_DEFAULT_REALisDBLE="no" if test "X$HDF_FORTRAN" = "Xyes"; then - echo "yes" + + HDF_FORTRAN=yes + HDF5_INTERFACES="$HDF5_INTERFACES fortran" + HAVE_FORTRAN_2003="no" + HAVE_F2003_REQUIREMENTS="no" + @@ -6248,8 +6285,6 @@ fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if Fortran default REAL is DOUBLE PRECISION" >&5 $as_echo_n "checking if Fortran default REAL is DOUBLE PRECISION... " >&6; } @@ -6295,16 +6330,56 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi - ac_ext=c + + if test "X$HDF_FORTRAN2003" = "Xyes"; then + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if Fortran compiler version compatible with Fortran 2003 HDF" >&5 +$as_echo_n "checking if Fortran compiler version compatible with Fortran 2003 HDF... " >&6; } + HAVE_FORTRAN_2003="no" + + cat > conftest.$ac_ext <<_ACEOF + program main + + + USE iso_c_binding + IMPLICIT NONE + TYPE(C_PTR) :: ptr + TYPE(C_FUNPTR) :: funptr + CHARACTER(LEN=80, KIND=c_char), TARGET :: ichr + + ptr = C_LOC(ichr(1:1)) + + + end +_ACEOF +if ac_fn_fc_try_compile "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + HAVE_F2003_REQUIREMENTS=yes +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + + if test "X$HAVE_F2003_REQUIREMENTS" = "Xno"; then + as_fn_error $? "Fortran compiler lacks required Fortran 2003 features; unsupported Fortran 2003 compiler, remove --enable-fortran2003" "$LINENO" 5 + else + HAVE_FORTRAN_2003="yes" + fi + + fi +else + FC="no" +fi + +ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -else - echo "no" - FC="no" -fi if test "X$HAVE_SIZEOF" = "Xyes"; then FORTRAN_HAVE_SIZEOF_TRUE= @@ -6314,6 +6389,14 @@ else FORTRAN_HAVE_SIZEOF_FALSE= fi + if test "X$HAVE_FORTRAN_2003" = "Xyes"; then + FORTRAN_2003_CONDITIONAL_F_TRUE= + FORTRAN_2003_CONDITIONAL_F_FALSE='#' +else + FORTRAN_2003_CONDITIONAL_F_TRUE='#' + FORTRAN_2003_CONDITIONAL_F_FALSE= +fi + if test "X$FORTRAN_DEFAULT_REALisDBLE" = "Xyes"; then FORTRAN_DEFAULT_REALisDBLE_F_TRUE= FORTRAN_DEFAULT_REALisDBLE_F_FALSE='#' @@ -7363,7 +7446,7 @@ $as_echo "none" >&6; } ;; esac -if test "X$HDF_FORTRAN" = "Xyes"; then +if test "X$HDF_FORTRAN" = "Xyes" ; then ac_ext=${ac_fc_srcext-f} ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' @@ -21676,7 +21759,7 @@ $as_echo "profile" >&6; } enable_production="user-defined" { $as_echo "$as_me:${as_lineno-$LINENO}: result: user-defined" >&5 $as_echo "user-defined" >&6; } - CONFIG_MODE="$X-enableval" + CONFIG_MODE="$enableval" ;; esac @@ -22032,6 +22115,83 @@ else fi done +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing clock_gettime" >&5 +$as_echo_n "checking for library containing clock_gettime... " >&6; } +if ${ac_cv_search_clock_gettime+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char clock_gettime (); +#ifdef FC_DUMMY_MAIN +#ifndef FC_DUMMY_MAIN_EQ_F77 +# ifdef __cplusplus + extern "C" +# endif + int FC_DUMMY_MAIN() { return 1; } +#endif +#endif +int +main () +{ +return clock_gettime (); + ; + return 0; +} +_ACEOF +for ac_lib in '' rt posix4; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_clock_gettime=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_clock_gettime+:} false; then : + break +fi +done +if ${ac_cv_search_clock_gettime+:} false; then : + +else + ac_cv_search_clock_gettime=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_clock_gettime" >&5 +$as_echo "$ac_cv_search_clock_gettime" >&6; } +ac_res=$ac_cv_search_clock_gettime +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + +for ac_func in clock_gettime +do : + ac_fn_c_check_func "$LINENO" "clock_gettime" "ac_cv_func_clock_gettime" +if test "x$ac_cv_func_clock_gettime" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_CLOCK_GETTIME 1 +_ACEOF + have_clock_gettime="yes" +else + have_clock_gettime="no" +fi +done + for ac_header in sys/resource.h sys/time.h unistd.h sys/ioctl.h sys/stat.h do : @@ -22085,6 +22245,19 @@ fi done +for ac_header in mach/mach_time.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "mach/mach_time.h" "ac_cv_header_mach_mach_time_h" "$ac_includes_default" +if test "x$ac_cv_header_mach_mach_time_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_MACH_MACH_TIME_H 1 +_ACEOF + +fi + +done + + case "`uname`" in CYGWIN*) for ac_header in io.h sys/timeb.h @@ -22490,13 +22663,14 @@ case "$host_cpu-$host_vendor-$host_os" in AM_CPPFLAGS="-D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE $AM_CPPFLAGS" fi - H5_CPPFLAGS="-D_POSIX_SOURCE $H5_CPPFLAGS" + H5_CPPFLAGS="-D_POSIX_C_SOURCE=199506L $H5_CPPFLAGS" - AM_CPPFLAGS="-D_BSD_SOURCE $AM_CPPFLAGS" + AM_CPPFLAGS="-D_BSD_SOURCE $AM_CPPFLAGS" ;; esac -CPPFLAGS="$AM_CPPFLAGS $CPPFLAGS" +CPPFLAGS="$H5_CPPFLAGS $AM_CPPFLAGS $CPPFLAGS" +CFLAGS="$H5_CFLAGS $AM_CFLAGS $CFLAGS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -25144,12 +25318,12 @@ $as_echo "no" >&6; } fi - if test "X$USE_FILTER_SZIP" = "Xyes"; then - BUILD_SZIP_CONDITIONAL_TRUE= - BUILD_SZIP_CONDITIONAL_FALSE='#' + if test "X$USE_FILTER_SZIP" = "Xyes" && test "X$LL_PATH" != "X"; then + BUILD_SHARED_SZIP_CONDITIONAL_TRUE= + BUILD_SHARED_SZIP_CONDITIONAL_FALSE='#' else - BUILD_SZIP_CONDITIONAL_TRUE='#' - BUILD_SZIP_CONDITIONAL_FALSE= + BUILD_SHARED_SZIP_CONDITIONAL_TRUE='#' + BUILD_SHARED_SZIP_CONDITIONAL_FALSE= fi @@ -25263,9 +25437,9 @@ fi done - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5 -$as_echo_n "checking for pthread_create in -lpthread... " >&6; } -if ${ac_cv_lib_pthread_pthread_create+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_self in -lpthread" >&5 +$as_echo_n "checking for pthread_self in -lpthread... " >&6; } +if ${ac_cv_lib_pthread_pthread_self+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -25279,7 +25453,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #ifdef __cplusplus extern "C" #endif -char pthread_create (); +char pthread_self (); #ifdef FC_DUMMY_MAIN #ifndef FC_DUMMY_MAIN_EQ_F77 # ifdef __cplusplus @@ -25291,23 +25465,23 @@ char pthread_create (); int main () { -return pthread_create (); +return pthread_self (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_pthread_pthread_create=yes + ac_cv_lib_pthread_pthread_self=yes else - ac_cv_lib_pthread_pthread_create=no + ac_cv_lib_pthread_pthread_self=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_create" >&5 -$as_echo "$ac_cv_lib_pthread_pthread_create" >&6; } -if test "x$ac_cv_lib_pthread_pthread_create" = xyes; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_self" >&5 +$as_echo "$ac_cv_lib_pthread_pthread_self" >&6; } +if test "x$ac_cv_lib_pthread_pthread_self" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBPTHREAD 1 _ACEOF @@ -25388,9 +25562,9 @@ done saved_AM_LDFLAGS="$AM_LDFLAGS" LDFLAGS="$LDFLAGS -L$pthread_lib" AM_LDFLAGS="$AM_LDFLAGS -L$pthread_lib" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5 -$as_echo_n "checking for pthread_create in -lpthread... " >&6; } -if ${ac_cv_lib_pthread_pthread_create+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_self in -lpthread" >&5 +$as_echo_n "checking for pthread_self in -lpthread... " >&6; } +if ${ac_cv_lib_pthread_pthread_self+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -25404,7 +25578,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #ifdef __cplusplus extern "C" #endif -char pthread_create (); +char pthread_self (); #ifdef FC_DUMMY_MAIN #ifndef FC_DUMMY_MAIN_EQ_F77 # ifdef __cplusplus @@ -25416,23 +25590,23 @@ char pthread_create (); int main () { -return pthread_create (); +return pthread_self (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_pthread_pthread_create=yes + ac_cv_lib_pthread_pthread_self=yes else - ac_cv_lib_pthread_pthread_create=no + ac_cv_lib_pthread_pthread_self=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_create" >&5 -$as_echo "$ac_cv_lib_pthread_pthread_create" >&6; } -if test "x$ac_cv_lib_pthread_pthread_create" = xyes; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_self" >&5 +$as_echo "$ac_cv_lib_pthread_pthread_self" >&6; } +if test "x$ac_cv_lib_pthread_pthread_self" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBPTHREAD 1 _ACEOF @@ -25445,9 +25619,9 @@ fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5 -$as_echo_n "checking for pthread_create in -lpthread... " >&6; } -if ${ac_cv_lib_pthread_pthread_create+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_self in -lpthread" >&5 +$as_echo_n "checking for pthread_self in -lpthread... " >&6; } +if ${ac_cv_lib_pthread_pthread_self+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -25461,7 +25635,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #ifdef __cplusplus extern "C" #endif -char pthread_create (); +char pthread_self (); #ifdef FC_DUMMY_MAIN #ifndef FC_DUMMY_MAIN_EQ_F77 # ifdef __cplusplus @@ -25473,23 +25647,23 @@ char pthread_create (); int main () { -return pthread_create (); +return pthread_self (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_pthread_pthread_create=yes + ac_cv_lib_pthread_pthread_self=yes else - ac_cv_lib_pthread_pthread_create=no + ac_cv_lib_pthread_pthread_self=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_create" >&5 -$as_echo "$ac_cv_lib_pthread_pthread_create" >&6; } -if test "x$ac_cv_lib_pthread_pthread_create" = xyes; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_self" >&5 +$as_echo "$ac_cv_lib_pthread_pthread_self" >&6; } +if test "x$ac_cv_lib_pthread_pthread_self" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBPTHREAD 1 _ACEOF @@ -25532,7 +25706,7 @@ $as_echo "no" >&6; } int main () { -pthread_create() +pthread_self() ; return 0; } @@ -25559,6 +25733,15 @@ $as_echo "#define HAVE_THREADSAFE 1" >>confdefs.h fi +ac_fn_c_check_decl "$LINENO" "CLOCK_MONOTONIC" "ac_cv_have_decl_CLOCK_MONOTONIC" "#include +" +if test "x$ac_cv_have_decl_CLOCK_MONOTONIC" = xyes; then : + have_clock_monotonic="yes" +else + have_clock_monotonic="no" +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tm_gmtoff in struct tm" >&5 $as_echo_n "checking for tm_gmtoff in struct tm... " >&6; } @@ -27997,74 +28180,31 @@ $as_echo "yes" >&6; } $as_echo "no" >&6; } fi -# Check whether --enable-mpi-size was given. + # Check whether --enable-mpi-size was given. if test "${enable_mpi_size+set}" = set; then : enableval=$enable_mpi_size; MPI_GET_SIZE=$enableval fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if MPI_File_get_size is enabled" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if MPI_File_get_size is enabled" >&5 $as_echo_n "checking if MPI_File_get_size is enabled... " >&6; } -case "X-$MPI_GET_SIZE" in - X-no) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + case "X-$MPI_GET_SIZE" in + X-no) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } - MPI_GET_SIZE=no - ;; - X-yes|*) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 + MPI_GET_SIZE=no + ;; + X-yes|*) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } - MPI_GET_SIZE=yes + MPI_GET_SIZE=yes $as_echo "#define HAVE_MPI_GET_SIZE 1" >>confdefs.h - ;; -esac - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if irregular hyperslab optimization code works inside MPI-IO" >&5 -$as_echo_n "checking if irregular hyperslab optimization code works inside MPI-IO... " >&6; } - -if ${hdf5_cv_mpi_complex_derived_datatype_works+:} false; then : - $as_echo_n "(cached) " >&6 -else - hdf5_cv_mpi_complex_derived_datatype_works=yes -fi - - -if test ${hdf5_cv_mpi_complex_derived_datatype_works} = "yes"; then - -$as_echo "#define MPI_COMPLEX_DERIVED_DATATYPE_WORKS 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if MPI-IO can do collective IO when one or more processes don't do IOs" >&5 -$as_echo_n "checking if MPI-IO can do collective IO when one or more processes don't do IOs... " >&6; } - -if ${hdf5_cv_mpi_special_collective_io_works+:} false; then : - $as_echo_n "(cached) " >&6 -else - hdf5_cv_mpi_special_collective_io_works=yes -fi - - -if test ${hdf5_cv_mpi_special_collective_io_works} = "yes"; then - -$as_echo "#define MPI_SPECIAL_COLLECTIVE_IO_WORKS 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi + ;; + esac fi @@ -30010,6 +30150,10 @@ if test -z "${FORTRAN_HAVE_SIZEOF_TRUE}" && test -z "${FORTRAN_HAVE_SIZEOF_FALSE as_fn_error $? "conditional \"FORTRAN_HAVE_SIZEOF\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${FORTRAN_2003_CONDITIONAL_F_TRUE}" && test -z "${FORTRAN_2003_CONDITIONAL_F_FALSE}"; then + as_fn_error $? "conditional \"FORTRAN_2003_CONDITIONAL_F\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${FORTRAN_DEFAULT_REALisDBLE_F_TRUE}" && test -z "${FORTRAN_DEFAULT_REALisDBLE_F_FALSE}"; then as_fn_error $? "conditional \"FORTRAN_DEFAULT_REALisDBLE_F\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -30027,8 +30171,8 @@ if test -z "${CXX_SHARED_CONDITIONAL_TRUE}" && test -z "${CXX_SHARED_CONDITIONAL Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${BUILD_SZIP_CONDITIONAL_TRUE}" && test -z "${BUILD_SZIP_CONDITIONAL_FALSE}"; then - as_fn_error $? "conditional \"BUILD_SZIP_CONDITIONAL\" was never defined. +if test -z "${BUILD_SHARED_SZIP_CONDITIONAL_TRUE}" && test -z "${BUILD_SHARED_SZIP_CONDITIONAL_FALSE}"; then + as_fn_error $? "conditional \"BUILD_SHARED_SZIP_CONDITIONAL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${DIRECT_VFD_CONDITIONAL_TRUE}" && test -z "${DIRECT_VFD_CONDITIONAL_FALSE}"; then @@ -30464,7 +30608,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by HDF5 $as_me 1.9.81-FA_a5, which was +This file was extended by HDF5 $as_me 1.9.111-FA_a5, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -30530,7 +30674,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -HDF5 config.status 1.9.81-FA_a5 +HDF5 config.status 1.9.111-FA_a5 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" @@ -33328,7 +33472,7 @@ Usage: $0 [OPTIONS] Report bugs to ." lt_cl_version="\ -HDF5 config.lt 1.9.81-FA_a5 +HDF5 config.lt 1.9.111-FA_a5 configured by $0, generated by GNU Autoconf 2.68. Copyright (C) 2010 Free Software Foundation, Inc. diff --git a/configure.in b/configure.in index 3f0993e..0fb5290 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.81-FA_a5], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.9.111-FA_a5], [help@hdfgroup.org]) AC_CONFIG_SRCDIR([src/H5.c]) AM_CONFIG_HEADER([src/H5config.h]) @@ -155,6 +155,7 @@ dnl EXTERNAL_FILTERS equals all external filters. Default none. dnl MPE: whether MPE option is enabled. Default no. dnl STATIC_EXEC: whether static-exec is enabled. Default no. dnl HDF_FORTRAN: whether Fortran is enabled. Default no. +dnl HDF_FORTRAN2003: whether Fortran 2003 is enabled. Default no. dnl FC: Fortran compiler. dnl HDF_CXX: whether C++ is enabled. Default no. dnl CXX: C++ compiler. @@ -175,7 +176,9 @@ AC_SUBST(EXTERNAL_FILTERS) AC_SUBST(MPE) MPE=no AC_SUBST(STATIC_EXEC) STATIC_EXEC=no AC_SUBST(HDF_FORTRAN) HDF_FORTRAN=no +AC_SUBST(HDF_FORTRAN2003) HDF_FORTRAN2003=no AC_SUBST(FC) HDF_FORTRAN=no +AC_SUBST(FC2003) HDF_FORTRAN2003=no AC_SUBST(HDF_CXX) HDF_CXX=no AC_SUBST(CXX) HDF_CXX=no AC_SUBST(HDF5_HL) HDF5_HL=yes @@ -370,19 +373,53 @@ AC_SUBST([HDF5_INTERFACES]) HDF5_INTERFACES="" AC_MSG_CHECKING([if Fortran interface enabled]) AC_ARG_ENABLE([fortran], [AC_HELP_STRING([--enable-fortran], - [Compile the Fortran interface [default=no]])], + [Compile the Fortran 77/90/95 interface [default=no]])], [HDF_FORTRAN=$enableval]) +if test "X$HDF_FORTRAN" = "Xyes"; then + echo "yes" +else + echo "no" +fi + + +dnl ---------------------------------------------------------------------- +dnl Check if they would like the Fortran 2003 interface compiled +dnl +AC_MSG_CHECKING([if Fortran 2003 interface enabled]) +AC_ARG_ENABLE([fortran2003], + [AC_HELP_STRING([--enable-fortran2003], + [Compile the Fortran 2003 interface, must also specify --enable-fortran [default=no]])], + [HDF_FORTRAN2003=$enableval]) + +dnl ---------------------------------------------------------------------- +dnl Check to make sure --enable-fortran is present if --enable-fortran2003 +dnl was specified + +if test "X$HDF_FORTRAN2003" = "Xyes" && test "X$HDF_FORTRAN" = "Xno"; then + echo "no" + AC_MSG_ERROR([--enable-fortran must be used with --enable-fortran2003]) +else + echo "yes" +fi HAVE_SIZEOF="no" -FORTRAN_DEFAULT_REALisDBLE="no" +FORTRAN_DEFAULT_REALisDBLE="no" if test "X$HDF_FORTRAN" = "Xyes"; then - echo "yes" + AC_SUBST(FC) HDF_FORTRAN=yes + AC_SUBST([HAVE_FORTRAN_2003]) + HDF5_INTERFACES="$HDF5_INTERFACES fortran" dnl -------------------------------------------------------------------- + dnl Default for FORTRAN 2003 compliant compilers + dnl + HAVE_FORTRAN_2003="no" + HAVE_F2003_REQUIREMENTS="no" + + dnl -------------------------------------------------------------------- dnl HDF5 integer variables for the H5fortran_types.f90 file. dnl AC_SUBST([R_LARGE]) @@ -430,19 +467,19 @@ if test "X$HDF_FORTRAN" = "Xyes"; then dnl -------------------------------------------------------------------- dnl See if the compiler will support the "-I." option dnl -dnl AM_FCFLAGS_saved=$AM_FCFLAGS -dnl AM_FCFLAGS="${AM_FCFLAGS} -I." + dnl AM_FCFLAGS_saved=$AM_FCFLAGS + dnl AM_FCFLAGS="${AM_FCFLAGS} -I." -dnl AC_MSG_CHECKING(if compiler supports -I. option) -dnl AC_TRY_FCOMPILE([ -dnl program conftest -dnl end -dnl ], AC_MSG_RESULT(yes), -dnl AC_MSG_RESULT(no) -dnl AM_FCFLAGS="$AM_FCFLAGS_saved") + dnl AC_MSG_CHECKING(if compiler supports -I. option) + dnl AC_TRY_FCOMPILE([ + dnl program conftest + dnl end + dnl ], AC_MSG_RESULT(yes), + dnl AC_MSG_RESULT(no) + dnl AM_FCFLAGS="$AM_FCFLAGS_saved") -dnl -------------------------------------------------------------------- -dnl See if the fortran compiler supports the intrinsic function "SIZEOF" + dnl -------------------------------------------------------------------- + dnl See if the fortran compiler supports the intrinsic function "SIZEOF" AC_MSG_CHECKING([if Fortran compiler supports intrinsic SIZEOF]) AC_TRY_RUN([ @@ -453,10 +490,8 @@ dnl See if the fortran compiler supports the intrinsic function "SIZEOF" HAVE_SIZEOF="yes"], AC_MSG_RESULT(no)) - -dnl Check to see if -r8 was specified to determine if we need to -dnl compile the DOUBLE PRECISION interfaces. - + dnl Check to see if -r8 was specified to determine if we need to + dnl compile the DOUBLE PRECISION interfaces. AC_MSG_CHECKING([if Fortran default REAL is DOUBLE PRECISION]) @@ -485,14 +520,48 @@ dnl compile the DOUBLE PRECISION interfaces. AC_MSG_RESULT(no), [AC_MSG_RESULT(yes) FORTRAN_DEFAULT_REALisDBLE="yes"]) - dnl Change back to the C language - AC_LANG_POP(Fortran) + + if test "X$HDF_FORTRAN2003" = "Xyes"; then + + dnl Checking if the compiler supports the required Fortran 2003 features and + dnl disable Fortran 2003 if it does not. + + AC_MSG_CHECKING([if Fortran compiler version compatible with Fortran 2003 HDF]) + HAVE_FORTRAN_2003="no" + + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[ + + USE iso_c_binding + IMPLICIT NONE + TYPE(C_PTR) :: ptr + TYPE(C_FUNPTR) :: funptr + CHARACTER(LEN=80, KIND=c_char), TARGET :: ichr + + ptr = C_LOC(ichr(1:1)) + + ])], + [AC_MSG_RESULT(yes) + HAVE_F2003_REQUIREMENTS=[yes]], + [AC_MSG_RESULT(no)]) + + if test "X$HAVE_F2003_REQUIREMENTS" = "Xno"; then + dnl echo $HAVE_FORTRAN_2003 + AC_MSG_ERROR([Fortran compiler lacks required Fortran 2003 features; unsupported Fortran 2003 compiler, remove --enable-fortran2003]) + else + HAVE_FORTRAN_2003="yes" + dnl echo $HAVE_FORTRAN_2003 + fi + + fi else - echo "no" FC="no" fi +dnl Change back to the C language +AC_LANG_POP(Fortran) + AM_CONDITIONAL([FORTRAN_HAVE_SIZEOF], [test "X$HAVE_SIZEOF" = "Xyes"]) +AM_CONDITIONAL([FORTRAN_2003_CONDITIONAL_F], [test "X$HAVE_FORTRAN_2003" = "Xyes"]) AM_CONDITIONAL([FORTRAN_DEFAULT_REALisDBLE_F], [test "X$FORTRAN_DEFAULT_REALisDBLE" = "Xyes"]) dnl ---------------------------------------------------------------------- @@ -776,7 +845,7 @@ dnl Furthermore, the name of the compiler might tell us how to run the dnl resulting executable. For `mpif90' the executable should be run with dnl `mpiexec' from the same directory as mpif90 if it exists. dnl -if test "X$HDF_FORTRAN" = "Xyes"; then +if test "X$HDF_FORTRAN" = "Xyes" ; then dnl Change to the Fortran 90 language AC_LANG_PUSH(Fortran) @@ -1173,7 +1242,7 @@ case "X-$enable_production" in *) enable_production="user-defined" AC_MSG_RESULT([user-defined]) - CONFIG_MODE="$X-enableval" + CONFIG_MODE="$enableval" ;; esac @@ -1197,11 +1266,14 @@ AC_HEADER_STDC AC_HEADER_TIME dnl ---------------------------------------------------------------------- -dnl Check for these two functions before is checked for, otherwise -dnl they are not detected correctly on Solaris [2.6]. +dnl Check for these two functions before the time headers are checked +dnl for, otherwise they are not detected correctly on Solaris (the +dnl configure test will fail due to multiply-defined symbols). dnl AC_CHECK_FUNCS(difftime) AC_CHECK_FUNCS(gettimeofday, [have_gettime="yes"], [have_gettime="no"]) +AC_SEARCH_LIBS([clock_gettime], [rt posix4]) +AC_CHECK_FUNCS([clock_gettime],[have_clock_gettime="yes"],[have_clock_gettime="no"]) dnl Unix AC_CHECK_HEADERS([sys/resource.h sys/time.h unistd.h sys/ioctl.h sys/stat.h]) @@ -1209,6 +1281,9 @@ AC_CHECK_HEADERS([sys/socket.h sys/types.h]) AC_CHECK_HEADERS([stddef.h setjmp.h features.h]) AC_CHECK_HEADERS([stdint.h], [C9x=yes]) +dnl Darwin +AC_CHECK_HEADERS([mach/mach_time.h]) + dnl Windows case "`uname`" in CYGWIN*) @@ -1370,25 +1445,32 @@ case "$host_cpu-$host_vendor-$host_os" in dnl H5_CPPFLAGS because fdopen and HDfdopen fail without it. HDfdopen dnl is used only by H5_debug_mask which is used only when debugging in dnl H5_init_library (all in H5.c). When the flag was removed this was - dnl the only compile failure noted; however, defining the Macro - dnl makes available the functionality from the POSIX.1 standard as well - dnl as all or the ISO C facilities, according to a discussion of - dnl defining the _POSIX_SOURCE, _BSD_SOURCE, and _POSIX_C_SOURCE Macros - dnl and their interaction found at - dnl http://www.gnu.org/s/libc/manual/html_node/Feature-Test-Macros.html. - H5_CPPFLAGS="-D_POSIX_SOURCE $H5_CPPFLAGS" + dnl the only compile failure noted. + dnl This was originally defined as _POSIX_SOURCE which was updated to + dnl _POSIX_C_SOURCE=199506L to expose a greater amount of POSIX + dnl functionality so clock_gettime and CLOCK_MONOTONIC are defined + dnl correctly. + dnl POSIX feature information can be found in the gcc manual at: + dnl http://www.gnu.org/s/libc/manual/html_node/Feature-Test-Macros.html + H5_CPPFLAGS="-D_POSIX_C_SOURCE=199506L $H5_CPPFLAGS" dnl Also add BSD support on Linux systems, so defines dnl __USE_BSD, which is required to get the prototype for strdup dnl defined correctly in and snprintf & vsnprintf defined dnl correctly in + dnl Linking to the bsd-compat library is required as per the gcc manual: + dnl http://www.gnu.org/s/libc/manual/html_node/Feature-Test-Macros.html + dnl however, we do not do this since it breaks the big test on some + dnl older platforms. AM_CPPFLAGS="-D_BSD_SOURCE $AM_CPPFLAGS" ;; esac -dnl Need to add AM_CPPFLAGS into CPPFLAGS to make them visible for configure checks. -dnl Note: CPPFLAGS will be restored by the end of configure. -CPPFLAGS="$AM_CPPFLAGS $CPPFLAGS" +dnl Need to add the AM_ and H5_ into CPFLAGS/CPPFLAGS to make them visible +dnl for configure checks. +dnl Note: Both will be restored by the end of configure. +CPPFLAGS="$H5_CPPFLAGS $AM_CPPFLAGS $CPPFLAGS" +CFLAGS="$H5_CFLAGS $AM_CFLAGS $CFLAGS" AC_TRY_COMPILE([#include ], [off64_t n = 0;], @@ -1813,7 +1895,7 @@ if test "x$HAVE_SZLIB" = "xyes" -a "x$HAVE_SZLIB_H" = "xyes"; then fi -AM_CONDITIONAL([BUILD_SZIP_CONDITIONAL], [test "X$USE_FILTER_SZIP" = "Xyes"]) +AM_CONDITIONAL([BUILD_SHARED_SZIP_CONDITIONAL], [test "X$USE_FILTER_SZIP" = "Xyes" && test "X$LL_PATH" != "X"]) dnl Checkpoint the cache AC_CACHE_SAVE @@ -1834,7 +1916,7 @@ AC_ARG_WITH([pthread], case "$withval" in yes) AC_CHECK_HEADERS([pthread.h]) - AC_CHECK_LIB([pthread], [pthread_create],, [unset PTHREAD]) + AC_CHECK_LIB([pthread], [pthread_self],, [unset PTHREAD]) ;; no) AC_MSG_CHECKING([for pthread]) @@ -1879,11 +1961,11 @@ case "$withval" in saved_AM_LDFLAGS="$AM_LDFLAGS" LDFLAGS="$LDFLAGS -L$pthread_lib" AM_LDFLAGS="$AM_LDFLAGS -L$pthread_lib" - AC_CHECK_LIB([pthread], [pthread_create],, + AC_CHECK_LIB([pthread], [pthread_self],, [LDFLAGS="$saved_LDFLAGS"; AM_LDFLAGS="$saved_AM_LDFLAGS"; unset PTHREAD]) else - AC_CHECK_LIB([pthread], [pthread_create],, [unset PTHREAD]) + AC_CHECK_LIB([pthread], [pthread_self],, [unset PTHREAD]) fi ;; esac @@ -1903,7 +1985,7 @@ case "X-$THREADSAFE" in ;; X-yes) dnl Check that we can link a simple Pthread program. - AC_TRY_LINK(, [pthread_create()], + AC_TRY_LINK(, [pthread_self()], [AC_MSG_RESULT([yes]); THREADSAFE=yes], [AC_MSG_ERROR([needed pthread library not available])]) ;; @@ -1918,6 +2000,12 @@ if test "X$THREADSAFE" = "Xyes"; then fi dnl ---------------------------------------------------------------------- +dnl Check for MONOTONIC_TIMER support (used in clock_gettime). This has +dnl to be done after any POSIX/BSD defines to ensure that the test gets +dnl the correct POSIX level on linux. +AC_CHECK_DECL(CLOCK_MONOTONIC,[have_clock_monotonic="yes"],[have_clock_monotonic="no"],[[#include ]]) + +dnl ---------------------------------------------------------------------- dnl How does one figure out the local time zone? Anyone know of a dnl Posix way to do this? dnl @@ -2782,76 +2870,36 @@ if test -n "$PARALLEL"; then AC_MSG_RESULT([no]) fi -dnl ---------------------------------------------------------------------- -dnl Set the flag to indicate that the MPI_File_get_size() function -dnl works. The default is enabled unless the user knows the function -dnl doesn't work on the system and disables it. (This flag should be set -dnl for all machines except for SGI Altix Propack 4 where the function -dnl doesn't return correct file size.) -dnl -AC_ARG_ENABLE([mpi-size], - [AC_HELP_STRING([--enable-mpi-size], - [Some systems (only SGI Altix Propack 4 so far) return wrong value - from MPI_File_get_size. By disabling this function, the library - will replace it with stat to get the correct file size. - [default=yes]])], - [MPI_GET_SIZE=$enableval]) - -AC_MSG_CHECKING([if MPI_File_get_size is enabled]) - -AC_SUBST(MPI_GET_SIZE) -case "X-$MPI_GET_SIZE" in - X-no) - AC_MSG_RESULT([no]) - MPI_GET_SIZE=no - ;; - X-yes|*) - AC_MSG_RESULT([yes]) - MPI_GET_SIZE=yes - AC_DEFINE([HAVE_MPI_GET_SIZE], [1], - [Define if MPI_File_get_size works correctly]) - ;; -esac - -dnl ---------------------------------------------------------------------- -dnl Check to see whether the complicate MPI derived datatype works. -dnl In Dec. 20th, 2004, we found that IBM's MPIO implemention didn't -dnl handle with the displacement of the complicate MPI type derived datatype -dnl correctly. So we add the check here. -dnl IBM fixed this bug in their new version that supported MPI-IO around spring 2005. -dnl We find that mpich 1.2.5 has the similar bug. The same -dnl bug also occurs at SGI IRIX 6.5 C with compiler version lower than or equal to 7.3. -dnl In case people still use the old compiler, we keep this flag. -AC_MSG_CHECKING([if irregular hyperslab optimization code works inside MPI-IO]) - -AC_CACHE_VAL([hdf5_cv_mpi_complex_derived_datatype_works],[hdf5_cv_mpi_complex_derived_datatype_works=yes]) - -if test ${hdf5_cv_mpi_complex_derived_datatype_works} = "yes"; then - AC_DEFINE([MPI_COMPLEX_DERIVED_DATATYPE_WORKS], [1], - [Define if your system can handle complicated MPI derived datatype correctly.]) - AC_MSG_RESULT([yes]) -else - AC_MSG_RESULT([no]) -fi - - -dnl ---------------------------------------------------------------------- -dnl Check to see whether MPI-IO can do collective IO successfully when one or more processes don't do -dnl any IOs. -dnl Up to now(Feb. 8th, 2006), we find that it will cause program hung with mpich 1.2.x version -dnl and SGI altix. For those systems, we have to turn off this feature and use independent IO instead. -dnl -AC_MSG_CHECKING([if MPI-IO can do collective IO when one or more processes don't do IOs]) - -AC_CACHE_VAL([hdf5_cv_mpi_special_collective_io_works],[hdf5_cv_mpi_special_collective_io_works=yes]) - -if test ${hdf5_cv_mpi_special_collective_io_works} = "yes"; then - AC_DEFINE([MPI_SPECIAL_COLLECTIVE_IO_WORKS], [1], - [Define if your system can handle special collective IO properly.]) - AC_MSG_RESULT([yes]) -else - AC_MSG_RESULT([no]) -fi + dnl ---------------------------------------------------------------------- + dnl Set the flag to indicate that the MPI_File_get_size() function + dnl works. The default is enabled unless the user knows the function + dnl doesn't work on the system and disables it. (This flag should be set + dnl for all machines except for SGI Altix Propack 4 where the function + dnl doesn't return correct file size.) + dnl + AC_ARG_ENABLE([mpi-size], + [AC_HELP_STRING([--enable-mpi-size], + [Some systems (only SGI Altix Propack 4 so far) return wrong value + from MPI_File_get_size. By disabling this function, the library + will replace it with stat to get the correct file size. + [default=yes]])], + [MPI_GET_SIZE=$enableval]) + + AC_MSG_CHECKING([if MPI_File_get_size is enabled]) + + AC_SUBST(MPI_GET_SIZE) + case "X-$MPI_GET_SIZE" in + X-no) + AC_MSG_RESULT([no]) + MPI_GET_SIZE=no + ;; + X-yes|*) + AC_MSG_RESULT([yes]) + MPI_GET_SIZE=yes + AC_DEFINE([HAVE_MPI_GET_SIZE], [1], + [Define if MPI_File_get_size works correctly]) + ;; + esac fi dnl ---------------------------------------------------------------------- diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 2bc8aac..56206a5 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8) +cmake_minimum_required (VERSION 2.8.6) PROJECT (HDF5_EXAMPLES) #----------------------------------------------------------------------------- @@ -26,12 +26,14 @@ FOREACH (example ${examples}) ADD_EXECUTABLE (${example} ${HDF5_EXAMPLES_SOURCE_DIR}/${example}.c) TARGET_NAMING (${example} ${LIB_TYPE}) TARGET_LINK_LIBRARIES (${example} ${HDF5_LIB_TARGET}) + SET_TARGET_PROPERTIES (${example} PROPERTIES FOLDER examples) ENDFOREACH (example ${examples}) IF (H5_HAVE_PARALLEL) ADD_EXECUTABLE (ph5example ${HDF5_EXAMPLES_SOURCE_DIR}/ph5example.c) TARGET_NAMING (ph5example ${LIB_TYPE}) TARGET_LINK_LIBRARIES (ph5example ${HDF5_LIB_TARGET}) + SET_TARGET_PROPERTIES (ph5example PROPERTIES FOLDER examples) ENDIF (H5_HAVE_PARALLEL) IF (BUILD_TESTING) diff --git a/examples/Makefile.am b/examples/Makefile.am index 8a428ae..9ec6a85 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -97,8 +97,8 @@ h5_extlink: $(srcdir)/h5_extlink.c $(EXTLINK_DIRS) h5_elink_unix2win: $(srcdir)/h5_elink_unix2win.c $(EXTLINK_DIRS) h5_shared_mesg: $(srcdir)/h5_shared_mesg.c -if BUILD_SZIP_CONDITIONAL -export LD_LIBRARY_PATH=$(LL_PATH) +if BUILD_SHARED_SZIP_CONDITIONAL +LD_LIBRARY_PATH=$(LL_PATH) endif include $(top_srcdir)/config/examples.am diff --git a/examples/Makefile.in b/examples/Makefile.in index 6c03f02..c93ad12 100644 --- a/examples/Makefile.in +++ b/examples/Makefile.in @@ -145,6 +145,7 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ +FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ @@ -165,10 +166,12 @@ H5_LONE_COLON = @H5_LONE_COLON@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ +HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ +HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ @@ -388,6 +391,7 @@ EXTLINK_DIRS = red blue u2w # Note: no '/' after DESTDIR. Explanation in commence.am EXAMPLEDIR = ${DESTDIR}$(exec_prefix)/share/hdf5_examples/c EXAMPLETOPDIR = ${DESTDIR}$(exec_prefix)/share/hdf5_examples +@BUILD_SHARED_SZIP_CONDITIONAL_TRUE@LD_LIBRARY_PATH = $(LL_PATH) # Assume that all tests in this directory are examples, and tell # conclude.am when to build them. @@ -657,8 +661,6 @@ h5_extlink: $(srcdir)/h5_extlink.c $(EXTLINK_DIRS) h5_elink_unix2win: $(srcdir)/h5_elink_unix2win.c $(EXTLINK_DIRS) h5_shared_mesg: $(srcdir)/h5_shared_mesg.c -@BUILD_SZIP_CONDITIONAL_TRUE@export LD_LIBRARY_PATH=$(LL_PATH) - # How to create EXAMPLEDIR if it doesn't already exist $(EXAMPLEDIR): -$(top_srcdir)/bin/mkdirs $@ diff --git a/examples/h5_elink_unix2win.c b/examples/h5_elink_unix2win.c index bcbb65f..9c0918c 100644 --- a/examples/h5_elink_unix2win.c +++ b/examples/h5_elink_unix2win.c @@ -138,11 +138,11 @@ const H5L_class_t elink_unix2win_class[1] = {{ static int unix2win_example(void) { - hid_t fid = (-1); /* File ID */ - hid_t gid = (-1); /* Group ID */ + hid_t fid = (-1); /* File ID */ + hid_t gid = (-1); /* Group ID */ /* Create the target file. */ -#ifdef _WIN32 +#ifdef H5_HAVE_WIN32_API if((fid=H5Fcreate("u2w\\u2w_target.h5", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT))<0) goto error; #else if((fid=H5Fcreate("u2w/u2w_target.h5", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT))<0) goto error; @@ -161,7 +161,7 @@ unix2win_example(void) * that external links can be traversed. */ -#ifdef _WIN32 +#ifdef H5_HAVE_WIN32_API /* Register the elink_unix2win class defined above to replace default * external links */ @@ -181,8 +181,8 @@ unix2win_example(void) error: printf("Error!\n"); H5E_BEGIN_TRY { - H5Gclose (gid); - H5Fclose (fid); + H5Gclose (gid); + H5Fclose (fid); } H5E_END_TRY; return -1; } @@ -195,7 +195,7 @@ unix2win_example(void) int main(void) { - int ret; + int ret; printf("Testing unix2win external links.\n"); ret = unix2win_example(); diff --git a/examples/h5_ref2reg.c b/examples/h5_ref2reg.c index 17ec724..c4e8d3d 100644 --- a/examples/h5_ref2reg.c +++ b/examples/h5_ref2reg.c @@ -130,7 +130,7 @@ int main(void) /* * Dereference the first reference. */ - dsetv_id = H5Rdereference(dsetr_id, H5R_DATASET_REGION, &ref_out[0]); + dsetv_id = H5Rdereference2(dsetr_id, H5P_DEFAULT, H5R_DATASET_REGION, &ref_out[0]); /* * Get name of the dataset the first region reference points to * using H5Rget_name @@ -177,7 +177,7 @@ int main(void) /* * Dereference the second reference. */ - dsetv_id = H5Rdereference(dsetr_id, H5R_DATASET_REGION, &ref_out[1]); + dsetv_id = H5Rdereference2(dsetr_id, H5P_DEFAULT, H5R_DATASET_REGION, &ref_out[1]); space_id = H5Rget_region(dsetv_id, H5R_DATASET_REGION,&ref_out[1]); /* diff --git a/examples/h5_reference.c b/examples/h5_reference.c index 31aa2cf..758002f 100644 --- a/examples/h5_reference.c +++ b/examples/h5_reference.c @@ -128,7 +128,7 @@ main(void) { /* * Get datatype of the dataset "B" */ - did_b = H5Rdereference(did_r, H5R_OBJECT, &rbuf[1]); + did_b = H5Rdereference2(did_r, H5P_DEFAULT, H5R_OBJECT, &rbuf[1]); tid_b = H5Dget_type(did_b); if(H5Tequal(tid_b, H5T_NATIVE_FLOAT)) printf("Datatype of the dataset is H5T_NATIVE_FLOAT.\n"); diff --git a/examples/run-all-ex.sh b/examples/run-all-ex.sh index 6837c7e..4ff2c55 100755 --- a/examples/run-all-ex.sh +++ b/examples/run-all-ex.sh @@ -24,8 +24,8 @@ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # -if (echo "Run c examples" && \ - (cd c; sh ./run-c-ex.sh) && \ +echo "Run c examples" +if ((cd c; sh ./run-c-ex.sh) && \ (if test -d fortran; then echo "Run fortran examples" cd fortran; sh ./run-fortran-ex.sh diff --git a/examples/run-c-ex.sh.in b/examples/run-c-ex.sh.in index 0627eb8..8d0bdcd 100755 --- a/examples/run-c-ex.sh.in +++ b/examples/run-c-ex.sh.in @@ -32,8 +32,8 @@ EXIT_SUCCESS=0 EXIT_FAILURE=1 # Where the tool is installed. -# Note: no '/' after DESTDIR. Explanation in commence.am -prefix="${prefix:-${DESTDIR}@prefix@}" +# default is relative path to installed location of the tools +prefix="${prefix:-../../../}" PARALLEL=@PARALLEL@ # Am I in parallel mode? AR="@AR@" RANLIB="@RANLIB@" diff --git a/fortran/CMakeLists.txt b/fortran/CMakeLists.txt index 1a6329f..d18cdb4 100644 --- a/fortran/CMakeLists.txt +++ b/fortran/CMakeLists.txt @@ -1,6 +1,10 @@ -cmake_minimum_required (VERSION 2.8) +cmake_minimum_required (VERSION 2.8.6) PROJECT (HDF5_F90 C CXX Fortran) +IF (H5_HAVE_PARALLEL) + FIND_PACKAGE (MPI) +ENDIF (H5_HAVE_PARALLEL) + #----------------------------------------------------------------------------- # Traverse source subdirectory #----------------------------------------------------------------------------- @@ -18,7 +22,7 @@ ENDIF (HDF5_BUILD_EXAMPLES) #----------------------------------------------------------------------------- IF (BUILD_TESTING) ADD_SUBDIRECTORY (${HDF5_F90_SOURCE_DIR}/test ${HDF5_F90_BINARY_DIR}/test) - IF (H5_HAVE_PARALLEL) + IF (MPI_Fortran_FOUND) ADD_SUBDIRECTORY (${HDF5_F90_SOURCE_DIR}/testpar ${HDF5_F90_BINARY_DIR}/testpar) - ENDIF (H5_HAVE_PARALLEL) + ENDIF (MPI_Fortran_FOUND) ENDIF (BUILD_TESTING) diff --git a/fortran/Makefile.in b/fortran/Makefile.in index 1bb45c9..9f006f0 100644 --- a/fortran/Makefile.in +++ b/fortran/Makefile.in @@ -182,6 +182,7 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ +FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ @@ -202,10 +203,12 @@ H5_LONE_COLON = @H5_LONE_COLON@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ +HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ +HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ diff --git a/fortran/doc/DevelGuide/masterindex.html b/fortran/doc/DevelGuide/masterindex.html new file mode 100644 index 0000000..9765ea0 --- /dev/null +++ b/fortran/doc/DevelGuide/masterindex.html @@ -0,0 +1,589 @@ + + + + + + + +Index + + + + +
+
+ +
+

Index

+

A - B - C - D - E - F - G - H - I - J - K - L - M - N - O - P - Q - R - S - T - U - V - W - X - Y - Z - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9

+ h5pget_double + h5pget_hyper_vector_size_f + h5pset_family_offset_f + h5pset_fapl_family_f + h5pset_meta_block_size_f +

F

fflush1.f90 +fflush2.f90 +fortran/test/fflush1.f90 +fortran/test/fflush2.f90 +fortran/test/fortranlib_test.f90 +fortran/test/fortranlib_test_1_8.f90 +fortran/test/fortranlib_test_F03.f90 +fortran/test/tc.c +fortran/test/tf.f90 +fortran/test/tH5A.f90 +fortran/test/tH5A_1_8.f90 +fortran/test/tH5D.f90 +fortran/test/tH5E.f90 +fortran/test/tH5E_F03.f90 +fortran/test/tH5F.f90 +fortran/test/tH5G.f90 +fortran/test/tH5G_1_8.f90 +fortran/test/tH5I.f90 +fortran/test/tH5L_F03.f90 +fortran/test/tH5O.f90 +fortran/test/tH5P.f90 +fortran/test/tH5P_F03.f90 +fortran/test/tH5R.f90 +fortran/test/tH5S.f90 +fortran/test/tH5Sselect.f90 +fortran/test/tH5T.f90 +fortran/test/tH5T_F03.f90 +fortran/test/tH5VL.f90 +fortran/test/tH5Z.f90 +fortranlib_test.f90 +fortranlib_test_1_8.f90 +fortranlib_test_F03.f90 +

H

H5_DBLE_InterfaceExclude.f90 +H5_DBLE_InterfaceInclude.f90 +H5_ff.f90 +H5_ff_F03.f90 +H5_ff_F90.f90 +H5A +H5A (F03) +H5A (F90) +h5aclose_f +h5acreate_by_name_f +h5acreate_f +h5adelete_by_idx_f +h5adelete_by_name_f +h5adelete_f +H5Aexists_by_name_f +H5Aexists_f +H5Af +H5Af.c +H5Aff.f90 +H5Aff_F03.f90 +H5Aff_F90.f90 +h5aget_create_plist_f +h5aget_info_by_idx_f +h5aget_info_by_name_f +h5aget_info_f +h5aget_name_by_idx_f +h5aget_name_f +h5aget_num_attrs_f +h5aget_space_f +h5aget_storage_size_f +h5aget_type_f +h5aopen_by_idx_f +H5Aopen_by_name_f +h5aopen_f +h5aopen_idx_f +h5aopen_name_f +h5aread_f +h5arename_by_name_f +h5arename_f +h5check_version_f +h5close_f +H5D +H5D (F03) +H5D (F90) +h5dclose_f +h5dcreate_anon_f +h5dcreate_f +H5Df +H5Df.c +H5Dff.f90 +H5Dff_F03.f90 +H5Dff_F90.f90 +h5dget_access_plist_f +h5dget_create_plist_f +h5dget_space_f +h5dget_space_status_f +h5dget_storage_size_f +h5dget_type_f +h5dont_atexit_f +h5dopen_f +h5dread_f +h5dset_extent +h5dvlen_get_max_len_f +h5dvlen_reclaim +H5E +H5E (F03) +H5E (F90) +h5eclear_f +H5Ef +H5Ef.c +H5Eff.f90 +H5Eff_F03.f90 +H5Eff_F90.f90 +h5eget_auto_f +h5eget_major_f +h5eget_minor_f +h5eprint_f +h5eset_auto2_f +h5eset_auto_f +H5F +H5f90global.f90 +H5f90kit +H5f90kit.c +h5fclose_f +h5fcreate_f +H5FDMPIO +H5FDmpiof +H5FDmpiof.c +H5FDmpioff.f90 +H5Ff +H5Ff.c +H5Fff.f90 +h5fflush_f +h5fget_access_plist_f +h5fget_create_plist_f +h5fget_filesize_f +h5fget_freespace_f +h5fget_name_f +h5fget_obj_count_f +h5fget_obj_ids_f +h5fis_hdf5_f +h5fmount_f +h5fopen_f +h5freopen_f +h5funmount_f +H5G +h5garbage_collect_f +h5gclose_f +H5Gcreate_anon_f +h5gcreate_f +h5get_libversion_f +H5Gf +H5Gf.c +H5Gff.f90 +h5gget_comment_f +H5Gget_create_plist_f +h5gget_info_by_idx_f +h5gget_info_by_name_f +h5gget_info_f +h5gget_linkval_f +h5gget_obj_info_idx_f +h5glink2_f +h5glink_f +H5GLOBAL +h5gmove2_f +h5gmove_f +h5gn_members_f +h5gopen_f +h5gset_comment_f +h5gunlink_f +H5I +h5idec_ref_f +H5If +H5If.c +H5Iff.f90 +h5iget_file_id_f +h5iget_name_f +h5iget_ref_f +h5iget_type_f +h5iinc_ref_f +h5iis_valid_f +h5kind_to_type +H5L +H5L (F03) +H5L (F90) +h5lcopy_f +H5Lcreate_external_f +H5Lcreate_hard_f +H5Lcreate_soft_f +h5ldelete_by_idx_f +h5ldelete_f +H5Lexists_f +H5Lf +H5Lf.c +H5Lff.f90 +H5Lff_F03.f90 +H5Lff_F90.f90 +h5lget_info_by_idx_f +h5lget_info_f +h5lget_name_by_idx_f +H5LIB +H5LIB_PROVISIONAL +H5LIB_PROVISIONAL (F90) +h5lis_registered_f +h5literate_by_name_f +h5literate_f +h5lmove_f +H5match_types +H5match_types.c +H5O +H5O (F03) +H5O (F90) +h5oclose_f +H5Of +H5Of.c +H5Off.f90 +H5Off_F03.f90 +H5Off_F90.f90 +h5offsetof +h5olink_f +h5oopen_f +h5open_by_addr_f +h5open_f +h5ovisit_f +H5P (_F90) +H5P (F03) +H5P (F90) +h5pall_filters_avail_f +h5pclose_class_f +h5pclose_f +h5pcopy_f +h5pcopy_prop_f +h5pcreate_class_f +h5pcreate_class_f +h5pcreate_f +h5pequal_f +h5pexist_f +H5Pf +H5Pf.c +H5Pff.f90 +H5Pff_F03.f90 +H5Pff_F90.f90 +h5pfill_value_defined_f +h5pget_alignment_f +h5pget_alloc_time_f +H5Pget_attr_creation_order_f +H5Pget_attr_phase_change_f +h5pget_btree_ratios_f +h5pget_buffer_f +h5pget_cache_f +h5pget_char +h5pget_char +H5Pget_char_encoding_f +H5Pget_chunk_cache_f +h5pget_chunk_f +h5pget_class_f +h5pget_class_name_f +h5pget_class_parent_f +h5pget_copy_object_f +H5Pget_create_inter_group_f +h5pget_data_transform_f +h5pget_double +h5pget_driver_f +h5pget_dxpl_mpio_f +h5pget_edc_check_f +H5Pget_est_link_info_f +h5pget_external_count_f +h5pget_external_f +h5pget_fapl_core_f +h5pget_fapl_direct_f +h5pget_fapl_family_f +h5pget_fapl_mpio_f +h5pget_fapl_mpiposix_f +h5pget_fapl_multi_f +h5pget_fclose_degree_f +h5pget_fill_time_f +h5pget_filter_by_id_f +h5pget_filter_f +h5pget_gc_references_f +h5pget_integer +h5pget_integer +h5pget_istore_k_f +h5pget_layout_f +H5Pget_link_creation_order_f +H5Pget_link_phase_change_f +H5Pget_local_heap_size_hint_f +h5pget_meta_block_size_f +h5pget_nfilters_f +h5pget_nlinks_f +h5pget_npros_f +H5Pget_obj_track_times_f +h5pget_preserve_f +h5pget_real +h5pget_real +h5pget_sec2_f +h5pget_sieve_buf_size_f +h5pget_size_f +h5pget_sizes_f +h5pget_small_data_block_size_f +h5pget_split_f +h5pget_stdio_f +h5pget_sym_k_f +h5pget_userblock_f +h5pget_version_f +h5pinsert_char +h5pinsert_char +h5pinsert_double +h5pinsert_double +h5pinsert_integer +h5pinsert_integer +h5pinsert_ptr +h5pinsert_real +h5pinsert_real +h5pisa_class_f +h5pmodify_filter_f +h5pregister_char +h5pregister_char +h5pregister_double +h5pregister_double +h5pregister_integer +h5pregister_integer +h5pregister_ptr +h5pregister_real +h5pregister_real +h5premove_f +h5premove_filter_f +h5pset(get)fill_value_f +h5pset(get)fill_value_f +h5pset_alignment_f +h5pset_alloc_time_f +H5Pset_attr_creation_order_f +H5Pset_attr_phase_change_f +h5pset_btree_ratios_f +h5pset_buffer_f +h5pset_cache_f +h5pset_char +h5pset_char +H5Pset_char_encoding_f +H5Pset_chunk_cache_f +h5pset_chunk_f +h5pset_copy_object_f +H5Pset_create_inter_group_f +h5pset_data_transform_f +h5pset_deflate_f +h5pset_double +h5pset_double +h5pset_dxpl_mpio_f +h5pset_edc_check_f +h5pset_est_link_info_f +h5pset_external_f +h5pset_fapl_core_f +h5pset_fapl_direct_f +h5pset_fapl_mpio_f +h5pset_fapl_mpiposix_f +h5pset_fapl_multi_l +h5pset_fapl_multi_s +h5pset_fapl_sec2_f +h5pset_fapl_split_f +h5pset_fapl_stdio_f +h5pset_fclose_degree_f +h5pset_fill_time_f +h5pset_filter_f +h5pset_fletcher32_f +h5pset_gc_references_f +h5pset_hyper_vector_size_f +h5pset_integer +h5pset_integer +h5pset_istore_k_f +h5pset_layout_f +H5Pset_libver_bounds_f +H5Pset_link_creation_order_f +h5pset_link_phase_change_f +H5Pset_local_heap_size_hint_f +H5Pset_nbit_f +h5pset_nlinks_f +H5Pset_obj_track_times_f +h5pset_preserve_f +h5pset_real +h5pset_real +h5pset_scaleoffset_f +H5Pset_shared_mesg_index_f +H5Pset_shared_mesg_nindexes_f +h5pset_shuffle_f +h5pset_sieve_buf_size_f +h5pset_sizes_f +h5pset_small_data_block_size_f +h5pset_sym_k_f +h5pset_szip_f +h5pset_userblock_f +h5punregister_f +H5R +H5R (F03) +H5R (F90) +h5rcreate_object_f +h5rcreate_object_f +h5rcreate_ptr_f +h5rcreate_region_f +h5rcreate_region_f +h5rdereference_object_f +h5rdereference_object_f +h5rdereference_ptr_f +h5rdereference_region_f +h5rdereference_region_f +H5Rf +H5Rf.c +H5Rff.f90 +H5Rff_F03.f90 +H5Rff_F90.f90 +h5rget_name_object_f +h5rget_name_object_f +h5rget_name_ptr_f +h5rget_name_region_f +h5rget_name_region_f +h5rget_obj_type_f +h5rget_object_type_obj_f +h5rget_region_region_f +H5S +h5sclose_f +h5scopy_f +h5screate_f +h5screate_simple_f +H5Sdecode_f +H5Sencode_f +h5sextent_copy_f +h5sextent_equal_f +H5Sf +H5Sf.c +H5Sff.f90 +h5sget_select_bounds_f +h5sget_select_elem_npoints_f +h5sget_select_elem_pointlist_f +h5sget_select_hyper_blocklist_f +h5sget_select_hyper_nblocks_f +h5sget_select_npoints_f +h5sget_select_type_f +h5sget_simple_extent_dims_f +h5sget_simple_extent_ndims_f +h5sget_simple_extent_npoints_f +h5sget_simple_extent_type_f +h5sis_simple_f +h5soffset_simple_f +h5sselect_all_f +h5sselect_elements_f +h5sselect_hyperslab_f +h5sselect_none_f +h5sselect_valid_f +h5sset_extent_none_f +h5sset_extent_simple_f +H5T +H5T (F03) +H5T (F90) +h5tarray_create_f +h5tclose_f +h5tcommit_anon_f +h5tcommit_f +h5tcommitted_f +h5tcompiler_conv_f +H5Tconvert_f +h5tcopy_f +h5tcreate_f +H5Tdecode_f +h5tenaum_insert_f +H5Tencode_f +h5tenum_create_f +h5tenum_nameof_f +h5tenum_valuof_f +h5tequal_f +H5test_kind +H5test_kind.f90 +H5test_kind_SIZEOF +H5test_kind_SIZEOF.f90 +H5Tf +H5Tf.c +H5Tff.f90 +H5Tff_F03.f90 +H5Tff_F90.f90 +h5tget_array_dims_f +h5tget_array_ndims_f +h5tget_class_f +h5tget_create_plist_f +h5tget_cset_f +h5tget_ebias_f +h5tget_fields_f +h5tget_inpad_f +h5tget_member_class_f +h5tget_member_index_f +h5tget_member_name_f +h5tget_member_offset_f +h5tget_member_type_f +h5tget_member_value_f +h5tget_native_type_f +h5tget_nmembers_f +h5tget_norm_f +h5tget_offset_f +h5tget_order_f +h5tget_pad_f +h5tget_precision_f +h5tget_sign_f +h5tget_size_f +h5tget_strpad_f +h5tget_super_f +h5tget_tag_f +h5tinsert_f +h5tis_variable_str_f +h5topen_f +h5tpack_f +h5tset_cset_f +h5tset_ebias_f +h5tset_fields_f +h5tset_inpad_f +h5tset_norm_f +h5tset_offset_f +h5tset_order_f +h5tset_pad_f +h5tset_precision_f +h5tset_sign_f +h5tset_size_f +h5tset_strpad_f +h5tset_tag_f +h5tvlen_create_f +H5Z +H5Zf +H5Zf.c +H5Zff.f90 +h5zfilter_avail_f +h5zget_filter_info_f +h5zunregister_f +HDF5 +HDF5 (mpio) +HDF5.f90 +HDF5mpio.f90 +

S

src/H5_DBLE_InterfaceExclude.f90 +src/H5_DBLE_InterfaceInclude.f90 +

T

t.c +tf.f90 +tH5A.f90 +tH5A_1_8.f90 +tH5D.f90 +tH5E.f90 +tH5E_F03.f90 +tH5F.f90 +tH5G.f90 +tH5G_1_8.f90 +tH5I.f90 +tH5L_F03.f90 +tH5O.f90 +tH5P.f90 +tH5P_F03.f90 +tH5R.f90 +tH5S.f90 +tH5Sselect.f90 +tH5T.f90 +tH5T_F03.f90 +tH5VL.f90 +tH5Z.f90 +

A - B - C - D - E - F - G - H - I - J - K - L - M - N - O - P - Q - R - S - T - U - V - W - X - Y - Z - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9

+
+ + + diff --git a/fortran/doc/DevelGuide/robo_functions.html b/fortran/doc/DevelGuide/robo_functions.html new file mode 100644 index 0000000..e4f253a --- /dev/null +++ b/fortran/doc/DevelGuide/robo_functions.html @@ -0,0 +1,39 @@ + + + + + + + +Functions + + + + +
+
+ +
+

Functions

+

A - B - C - D - E - F - G - H - I - J - K - L - M - N - O - P - Q - R - S - T - U - V - W - X - Y - Z - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9

+

H

h5kind_to_type +h5offsetof +

A - B - C - D - E - F - G - H - I - J - K - L - M - N - O - P - Q - R - S - T - U - V - W - X - Y - Z - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9

+
+ + + diff --git a/fortran/doc/DevelGuide/robo_modules.html b/fortran/doc/DevelGuide/robo_modules.html new file mode 100644 index 0000000..8e57f38 --- /dev/null +++ b/fortran/doc/DevelGuide/robo_modules.html @@ -0,0 +1,117 @@ + + + + + + + +Modules + + + + +
+
+ + + + + diff --git a/fortran/doc/DevelGuide/robo_programs.html b/fortran/doc/DevelGuide/robo_programs.html new file mode 100644 index 0000000..8c35230 --- /dev/null +++ b/fortran/doc/DevelGuide/robo_programs.html @@ -0,0 +1,39 @@ + + + + + + + +Programs + + + + +
+
+ +
+

Programs

+

A - B - C - D - E - F - G - H - I - J - K - L - M - N - O - P - Q - R - S - T - U - V - W - X - Y - Z - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9

+

H

H5test_kind +H5test_kind_SIZEOF +

A - B - C - D - E - F - G - H - I - J - K - L - M - N - O - P - Q - R - S - T - U - V - W - X - Y - Z - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9

+
+ + + diff --git a/fortran/doc/DevelGuide/robo_sourcefiles.html b/fortran/doc/DevelGuide/robo_sourcefiles.html new file mode 100644 index 0000000..63a8637 --- /dev/null +++ b/fortran/doc/DevelGuide/robo_sourcefiles.html @@ -0,0 +1,309 @@ + + + + + + + +Sourcefiles + + + + +
+
+ + + + + diff --git a/fortran/doc/DevelGuide/robo_subroutines.html b/fortran/doc/DevelGuide/robo_subroutines.html new file mode 100644 index 0000000..0846c77 --- /dev/null +++ b/fortran/doc/DevelGuide/robo_subroutines.html @@ -0,0 +1,421 @@ + + + + + + + +Subroutines + + + + +
+
+ +
+

Subroutines

+

A - B - C - D - E - F - G - H - I - J - K - L - M - N - O - P - Q - R - S - T - U - V - W - X - Y - Z - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9

+ h5pget_double + h5pget_hyper_vector_size_f + h5pset_family_offset_f + h5pset_fapl_family_f + h5pset_meta_block_size_f +

H

h5aclose_f +h5acreate_by_name_f +h5acreate_f +h5adelete_by_idx_f +h5adelete_by_name_f +h5adelete_f +H5Aexists_by_name_f +H5Aexists_f +h5aget_create_plist_f +h5aget_info_by_idx_f +h5aget_info_by_name_f +h5aget_info_f +h5aget_name_by_idx_f +h5aget_name_f +h5aget_num_attrs_f +h5aget_space_f +h5aget_storage_size_f +h5aget_type_f +h5aopen_by_idx_f +H5Aopen_by_name_f +h5aopen_f +h5aopen_idx_f +h5aopen_name_f +h5aread_f +h5arename_by_name_f +h5arename_f +h5check_version_f +h5close_f +h5dclose_f +h5dcreate_anon_f +h5dcreate_f +h5dget_access_plist_f +h5dget_create_plist_f +h5dget_space_f +h5dget_space_status_f +h5dget_storage_size_f +h5dget_type_f +h5dont_atexit_f +h5dopen_f +h5dread_f +h5dset_extent +h5dvlen_get_max_len_f +h5dvlen_reclaim +h5eclear_f +h5eget_auto_f +h5eget_major_f +h5eget_minor_f +h5eprint_f +h5eset_auto2_f +h5eset_auto_f +h5fclose_f +h5fcreate_f +h5fflush_f +h5fget_access_plist_f +h5fget_create_plist_f +h5fget_filesize_f +h5fget_freespace_f +h5fget_name_f +h5fget_obj_count_f +h5fget_obj_ids_f +h5fis_hdf5_f +h5fmount_f +h5fopen_f +h5freopen_f +h5funmount_f +h5garbage_collect_f +h5gclose_f +H5Gcreate_anon_f +h5gcreate_f +h5get_libversion_f +h5gget_comment_f +H5Gget_create_plist_f +h5gget_info_by_idx_f +h5gget_info_by_name_f +h5gget_info_f +h5gget_linkval_f +h5gget_obj_info_idx_f +h5glink2_f +h5glink_f +h5gmove2_f +h5gmove_f +h5gn_members_f +h5gopen_f +h5gset_comment_f +h5gunlink_f +h5idec_ref_f +h5iget_file_id_f +h5iget_name_f +h5iget_ref_f +h5iget_type_f +h5iinc_ref_f +h5iis_valid_f +h5lcopy_f +H5Lcreate_external_f +H5Lcreate_hard_f +H5Lcreate_soft_f +h5ldelete_by_idx_f +h5ldelete_f +H5Lexists_f +h5lget_info_by_idx_f +h5lget_info_f +h5lget_name_by_idx_f +h5lis_registered_f +h5literate_by_name_f +h5literate_f +h5lmove_f +h5oclose_f +h5olink_f +h5oopen_f +h5open_by_addr_f +h5open_f +h5ovisit_f +h5pall_filters_avail_f +h5pclose_class_f +h5pclose_f +h5pcopy_f +h5pcopy_prop_f +h5pcreate_class_f +h5pcreate_class_f +h5pcreate_f +h5pequal_f +h5pexist_f +h5pfill_value_defined_f +h5pget_alignment_f +h5pget_alloc_time_f +H5Pget_attr_creation_order_f +H5Pget_attr_phase_change_f +h5pget_btree_ratios_f +h5pget_buffer_f +h5pget_cache_f +h5pget_char +h5pget_char +H5Pget_char_encoding_f +H5Pget_chunk_cache_f +h5pget_chunk_f +h5pget_class_f +h5pget_class_name_f +h5pget_class_parent_f +h5pget_copy_object_f +H5Pget_create_inter_group_f +h5pget_data_transform_f +h5pget_double +h5pget_driver_f +h5pget_dxpl_mpio_f +h5pget_edc_check_f +H5Pget_est_link_info_f +h5pget_external_count_f +h5pget_external_f +h5pget_fapl_core_f +h5pget_fapl_direct_f +h5pget_fapl_family_f +h5pget_fapl_mpio_f +h5pget_fapl_mpiposix_f +h5pget_fapl_multi_f +h5pget_fclose_degree_f +h5pget_fill_time_f +h5pget_filter_by_id_f +h5pget_filter_f +h5pget_gc_references_f +h5pget_integer +h5pget_integer +h5pget_istore_k_f +h5pget_layout_f +H5Pget_link_creation_order_f +H5Pget_link_phase_change_f +H5Pget_local_heap_size_hint_f +h5pget_meta_block_size_f +h5pget_nfilters_f +h5pget_nlinks_f +h5pget_npros_f +H5Pget_obj_track_times_f +h5pget_preserve_f +h5pget_real +h5pget_real +h5pget_sec2_f +h5pget_sieve_buf_size_f +h5pget_size_f +h5pget_sizes_f +h5pget_small_data_block_size_f +h5pget_split_f +h5pget_stdio_f +h5pget_sym_k_f +h5pget_userblock_f +h5pget_version_f +h5pinsert_char +h5pinsert_char +h5pinsert_double +h5pinsert_double +h5pinsert_integer +h5pinsert_integer +h5pinsert_ptr +h5pinsert_real +h5pinsert_real +h5pisa_class_f +h5pmodify_filter_f +h5pregister_char +h5pregister_char +h5pregister_double +h5pregister_double +h5pregister_integer +h5pregister_integer +h5pregister_ptr +h5pregister_real +h5pregister_real +h5premove_f +h5premove_filter_f +h5pset(get)fill_value_f +h5pset(get)fill_value_f +h5pset_alignment_f +h5pset_alloc_time_f +H5Pset_attr_creation_order_f +H5Pset_attr_phase_change_f +h5pset_btree_ratios_f +h5pset_buffer_f +h5pset_cache_f +h5pset_char +h5pset_char +H5Pset_char_encoding_f +H5Pset_chunk_cache_f +h5pset_chunk_f +h5pset_copy_object_f +H5Pset_create_inter_group_f +h5pset_data_transform_f +h5pset_deflate_f +h5pset_double +h5pset_double +h5pset_dxpl_mpio_f +h5pset_edc_check_f +h5pset_est_link_info_f +h5pset_external_f +h5pset_fapl_core_f +h5pset_fapl_direct_f +h5pset_fapl_mpio_f +h5pset_fapl_mpiposix_f +h5pset_fapl_multi_l +h5pset_fapl_multi_s +h5pset_fapl_sec2_f +h5pset_fapl_split_f +h5pset_fapl_stdio_f +h5pset_fclose_degree_f +h5pset_fill_time_f +h5pset_filter_f +h5pset_fletcher32_f +h5pset_gc_references_f +h5pset_hyper_vector_size_f +h5pset_integer +h5pset_integer +h5pset_istore_k_f +h5pset_layout_f +H5Pset_libver_bounds_f +H5Pset_link_creation_order_f +h5pset_link_phase_change_f +H5Pset_local_heap_size_hint_f +H5Pset_nbit_f +h5pset_nlinks_f +H5Pset_obj_track_times_f +h5pset_preserve_f +h5pset_real +h5pset_real +h5pset_scaleoffset_f +H5Pset_shared_mesg_index_f +H5Pset_shared_mesg_nindexes_f +h5pset_shuffle_f +h5pset_sieve_buf_size_f +h5pset_sizes_f +h5pset_small_data_block_size_f +h5pset_sym_k_f +h5pset_szip_f +h5pset_userblock_f +h5punregister_f +h5rcreate_object_f +h5rcreate_object_f +h5rcreate_ptr_f +h5rcreate_region_f +h5rcreate_region_f +h5rdereference_object_f +h5rdereference_object_f +h5rdereference_ptr_f +h5rdereference_region_f +h5rdereference_region_f +h5rget_name_object_f +h5rget_name_object_f +h5rget_name_ptr_f +h5rget_name_region_f +h5rget_name_region_f +h5rget_obj_type_f +h5rget_object_type_obj_f +h5rget_region_region_f +h5sclose_f +h5scopy_f +h5screate_f +h5screate_simple_f +H5Sdecode_f +H5Sencode_f +h5sextent_copy_f +h5sextent_equal_f +h5sget_select_bounds_f +h5sget_select_elem_npoints_f +h5sget_select_elem_pointlist_f +h5sget_select_hyper_blocklist_f +h5sget_select_hyper_nblocks_f +h5sget_select_npoints_f +h5sget_select_type_f +h5sget_simple_extent_dims_f +h5sget_simple_extent_ndims_f +h5sget_simple_extent_npoints_f +h5sget_simple_extent_type_f +h5sis_simple_f +h5soffset_simple_f +h5sselect_all_f +h5sselect_elements_f +h5sselect_hyperslab_f +h5sselect_none_f +h5sselect_valid_f +h5sset_extent_none_f +h5sset_extent_simple_f +h5tarray_create_f +h5tclose_f +h5tcommit_anon_f +h5tcommit_f +h5tcommitted_f +h5tcompiler_conv_f +H5Tconvert_f +h5tcopy_f +h5tcreate_f +H5Tdecode_f +h5tenaum_insert_f +H5Tencode_f +h5tenum_create_f +h5tenum_nameof_f +h5tenum_valuof_f +h5tequal_f +h5tget_array_dims_f +h5tget_array_ndims_f +h5tget_class_f +h5tget_create_plist_f +h5tget_cset_f +h5tget_ebias_f +h5tget_fields_f +h5tget_inpad_f +h5tget_member_class_f +h5tget_member_index_f +h5tget_member_name_f +h5tget_member_offset_f +h5tget_member_type_f +h5tget_member_value_f +h5tget_native_type_f +h5tget_nmembers_f +h5tget_norm_f +h5tget_offset_f +h5tget_order_f +h5tget_pad_f +h5tget_precision_f +h5tget_sign_f +h5tget_size_f +h5tget_strpad_f +h5tget_super_f +h5tget_tag_f +h5tinsert_f +h5tis_variable_str_f +h5topen_f +h5tpack_f +h5tset_cset_f +h5tset_ebias_f +h5tset_fields_f +h5tset_inpad_f +h5tset_norm_f +h5tset_offset_f +h5tset_order_f +h5tset_pad_f +h5tset_precision_f +h5tset_sign_f +h5tset_size_f +h5tset_strpad_f +h5tset_tag_f +h5tvlen_create_f +h5zfilter_avail_f +h5zget_filter_info_f +h5zunregister_f +

A - B - C - D - E - F - G - H - I - J - K - L - M - N - O - P - Q - R - S - T - U - V - W - X - Y - Z - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9

+
+ + + diff --git a/fortran/doc/DevelGuide/robodoc.css b/fortran/doc/DevelGuide/robodoc.css new file mode 100644 index 0000000..207a172 --- /dev/null +++ b/fortran/doc/DevelGuide/robodoc.css @@ -0,0 +1,302 @@ +/****h* ROBODoc/ROBODoc Cascading Style Sheet + * FUNCTION + * This is the default cascading style sheet for documentation + * generated with ROBODoc. + * You can edit this file to your own liking and then use + * it with the option + * --css + * + * This style-sheet defines the following layout + * +----------------------------------------+ + * | logo | + * +----------------------------------------+ + * | extra | + * +----------------------------------------+ + * | | navi- | + * | | gation | + * | content | | + * | | | + * +----------------------------------------+ + * | footer | + * +----------------------------------------+ + * + * This style-sheet is based on a style-sheet that was automatically + * generated with the Strange Banana stylesheet generator. + * See http://www.strangebanana.com/generator.aspx + * + ****** + * $Id: html_generator.c,v 1.94 2008/06/17 11:49:27 gumpu Exp $ + */ + +body +{ + background-color: rgb(255,255,255); + color: rgb(98,84,55); + font-family: Arial, serif; + border-color: rgb(226,199,143); +} + +pre +{ + font-family: monospace; + margin: 15px; + padding: 5px; + white-space: pre; + color: #000; +} + +pre.source +{ + background-color: #ffe; + border: dashed #aa9 1px; +} + +p +{ + margin:15px; +} + +p.item_name +{ + font-weight: bolder; + margin:5px; + font-size: 120%; +} + +#content +{ + font-size: 100%; + color: rgb(0,0,0); + background-color: rgb(255,255,255); + border-left-width: 0px; + border-right-width: 0px; + border-top-width: 0px; + border-bottom-width: 0px; + border-left-style: none; + border-right-style: none; + border-top-style: none; + border-bottom-style: none; + padding: 40px 31px 14px 17px; + border-color: rgb(0,0,0); + text-align: justify; +} + +#navigation +{ + background-color: rgb(98,84,55); + color: rgb(230,221,202); + font-family: "Times New Roman", serif; + font-style: normal; + border-color: rgb(0,0,0); +} + +a.menuitem +{ + font-size: 120%; + background-color: rgb(0,0,0); + color: rgb(195,165,100); + font-variant: normal; + text-transform: none; + font-weight: normal; + padding: 1px 8px 3px 1px; + margin-left: 5px; + margin-right: 5px; + margin-top: 5px; + margin-bottom: 5px; + border-color: rgb(159,126,57); + text-align: right; +} + +#logo, #logo a +{ + font-size: 130%; + background-color: rgb(198,178,135); + color: rgb(98,84,55); + font-family: Georgia, serif; + font-style: normal; + font-variant: normal; + text-transform: none; + font-weight: bold; + padding: 20px 18px 20px 18px; + border-color: rgb(255,255,255); + text-align: right; +} + +#extra, #extra a +{ + font-size: 128%; + background-color: rgb(0,0,0); + color: rgb(230,221,202); + font-style: normal; + font-variant: normal; + text-transform: none; + font-weight: normal; + border-left-width: 0px; + border-right-width: 0px; + border-top-width: 0px; + border-bottom-width: 0px; + border-left-style: none; + border-right-style: none; + border-top-style: none; + border-bottom-style: none; + padding: 12px 12px 12px 12px; + border-color: rgb(195,165,100); + text-align: center; +} + +#content a +{ + color: rgb(159,126,57); + text-decoration: none; +} + +#content a:hover, #content a:active +{ + color: rgb(255,255,255); + background-color: rgb(159,126,57); +} + +a.indexitem +{ + display: block; +} + +h1, h2, h3, h4, h5, h6 +{ + background-color: rgb(221,221,221); + font-family: Arial, serif; + font-style: normal; + font-variant: normal; + text-transform: none; + font-weight: normal; +} + +h1 +{ + font-size: 151%; +} + +h2 +{ + font-size: 142%; +} + +h3 +{ + font-size: 133%; +} + +h4 +{ + font-size: 124%; +} + +h5 +{ + font-size: 115%; +} + +h6 +{ + font-size: 106%; +} + +#navigation a +{ + text-decoration: none; +} + +.menuitem:hover +{ + background-color: rgb(195,165,100); + color: rgb(0,0,0); +} + +#extra a +{ + text-decoration: none; +} + +#logo a +{ + text-decoration: none; +} + +#extra a:hover +{ +} + +/* layout */ +#navigation +{ + width: 22%; + position: relative; + top: 0; + right: 0; + float: right; + text-align: center; + margin-left: 10px; +} + +.menuitem {width: auto;} +#content {width: auto;} +.menuitem {display: block;} + + +div#footer +{ + background-color: rgb(198,178,135); + color: rgb(98,84,55); + clear: left; + width: 100%; + font-size: 71%; +} + +div#footer a +{ + background-color: rgb(198,178,135); + color: rgb(98,84,55); +} + +div#footer p +{ + margin:0; + padding:5px 10px +} + +span.keyword +{ + color: #00F; +} + +span.comment +{ + color: #080; +} + +span.quote +{ + color: #F00; +} + +span.squote +{ + color: #F0F; +} + +span.sign +{ + color: #008B8B; +} + +span.line_number +{ + color: #808080; +} + +@media print +{ + #navigation {display: none;} + #content {padding: 0px;} + #content a {text-decoration: underline;} +} diff --git a/fortran/doc/DevelGuide/src/H5Af_c.html b/fortran/doc/DevelGuide/src/H5Af_c.html new file mode 100644 index 0000000..7fcecc1 --- /dev/null +++ b/fortran/doc/DevelGuide/src/H5Af_c.html @@ -0,0 +1,41 @@ + + + + + + + +./src/H5Af.c + + + + + +
+
+ +

H5Af

+ +

[ Top ] [ Modules ]

+

PURPOSE

+
   This file contains C stubs for H5A Fortran APIs
+
+ +
+ + + diff --git a/fortran/doc/DevelGuide/src/H5Aff_F03_f90.html b/fortran/doc/DevelGuide/src/H5Aff_F03_f90.html new file mode 100644 index 0000000..9e503f4 --- /dev/null +++ b/fortran/doc/DevelGuide/src/H5Aff_F03_f90.html @@ -0,0 +1,130 @@ + + + + + + + +./src/H5Aff_F03.f90 + + + + + +
+
+ +

H5A (F03)

+ +

[ Top ] [ Modules ]

+

NAME

+
  H5A_PROVISIONAL
+
+

FILE

+
  src/fortran/src/H5Aff_F03.f90
+
+

PURPOSE

+
  This file contains Fortran 90 and Fortran 2003 interfaces for H5A functions.
+  It contains the same functions as H5Aff_F90.f90 but includes the
+  Fortran 2003 functions and the interface listings. This file will be compiled
+  instead of H5Aff_F90.f90 if Fortran 2003 functions are enabled.
+
+

NOTES

+
  (A) C_LOC and character strings according to the Fortran 2003 standard:
+
+  15.1.2.5 C_LOC(X)
+
+  Argument. X shall either
+
+  (1) have interoperable type and type parameters and be
+    (a) a variable that has the TARGET attribute and is interoperable,
+    (b) an allocated allocatable variable that has the TARGET attribute
+        and is not an array of zero size, or
+    (c) an associated scalar pointer, or
+  (2) be a nonpolymorphic scalar, have no length type parameters, and be
+    (a) a nonallocatable, nonpointer variable that has the TARGET attribute,
+    (b) an allocated allocatable variable that has the TARGET attribute, or
+    (c) an associated pointer.
+
+  - When X is a character, for interoperability the standard is:
+
+  15.2.1 Interoperability of intrinsic types
+
+  ...if the type is character, interoperability also requires that the length type parameter
+  be omitted or be specified by an initialization expression whose value is one.
+
+  THEREFORE compilers that have not extended the standard  require
+
+  CHARACTER(LEN=1), TARGET :: chr
+  or
+  CHARACTER, TARGET :: chr
+
+  (B)
+                         *** IMPORTANT ***
+  If you add a new H5A function you must add the function name to the
+  Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory.
+  This is needed for Windows based operating systems.
+
+ +
+ +

h5aread_f

+ +

[ Top ] [ H5A (F03) ] [ Subroutines ]

+

NAME

+
  h5aread_f
+
+

PURPOSE

+
  Reads an attribute.
+
+

INPUTS

+
  attr_id       - attribute identifier
+  memtype_id    - attribute memory type identifier
+  dims          - 1D array of size 7, stores sizes of the
+                - buf array dimensions.
+
+

OUTPUTS

+
  buf           - buffer to read attribute data in
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces are added for
+  called C functions (it is needed for Windows
+  port).  February 27, 2001
+
+  dims parameter was added to make code portable;
+  Aprile 4, 2001
+
+  Changed buf intent to INOUT to be consistant
+  with how the C functions handles it. The pg
+  compiler will return 0 if a buf value is not set.
+  February, 2008
+
+

NOTES

+
  This function is overloaded to write INTEGER,
+  REAL, DOUBLE PRECISION and CHARACTER buffers
+  up to 7 dimensions.
+
+ +
+ + + diff --git a/fortran/doc/DevelGuide/src/H5Aff_F90_f90.html b/fortran/doc/DevelGuide/src/H5Aff_F90_f90.html new file mode 100644 index 0000000..aa01b49 --- /dev/null +++ b/fortran/doc/DevelGuide/src/H5Aff_F90_f90.html @@ -0,0 +1,56 @@ + + + + + + + +./src/H5Aff_F90.f90 + + + + + +
+
+ +

H5A (F90)

+ +

[ Top ] [ Modules ]

+

NAME

+
  H5A_PROVISIONAL
+
+

FILE

+
  fortran/src/H5Aff_F90.f90
+
+

PURPOSE

+
  This file contains Fortran 90 interfaces for H5A functions. It contains
+  the same functions as H5Aff_F03.f90 but excludes the Fortran 2003 functions
+  and the interface listings. This file will be compiled instead of H5Aff_F03.f90
+  if Fortran 2003 functions are not enabled.
+
+

NOTES

+
                         *** IMPORTANT ***
+  If you add a new H5A function you must add the function name to the
+  Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory.
+  This is needed for Windows based operating systems.
+
+ +
+ + + diff --git a/fortran/doc/DevelGuide/src/H5Aff_f90.html b/fortran/doc/DevelGuide/src/H5Aff_f90.html new file mode 100644 index 0000000..268c1db --- /dev/null +++ b/fortran/doc/DevelGuide/src/H5Aff_f90.html @@ -0,0 +1,1102 @@ + + + + + + + +./src/H5Aff.f90 + + + + + +
+
+ +

H5A

+ +

[ Top ] [ Modules ]

+

NAME

+
  MODULE H5A
+
+

PURPOSE

+
  This file contains Fortran interfaces for H5A functions. It includes
+  all the functions that are independent on whether the Fortran 2003 functions
+  are enabled or disabled.
+
+

NOTES

+
                         *** IMPORTANT ***
+  If you add a new H5A function you must add the function name to the
+  Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory.
+  This is needed for Windows based operating systems.
+
+ +
+ +

h5aclose_f

+ +

[ Top ] [ H5A ] [ Subroutines ]

+

NAME

+
  h5aclose_f
+
+

PURPOSE

+
  Closes the specified attribute.
+
+

INPUTS

+
  attr_id  - attribute identifier
+
+

OUTPUTS

+
  hdferr   - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces are added for
+  called C functions (it is needed for Windows
+  port).  February 27, 2001
+
+

SOURCE

+
  SUBROUTINE h5aclose_f(attr_id, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: attr_id  ! Attribute identifier
+    INTEGER, INTENT(OUT) :: hdferr         ! Error code
+
+ +
+ +

h5acreate_by_name_f

+ +

[ Top ] [ H5A ] [ Subroutines ]

+

NAME

+
  h5acreate_by_name_f
+
+

PURPOSE

+
  Creates an attribute attached to a specified object
+
+

INPUTS

+
  loc_id        - Location or object identifier; may be dataset or group
+  obj_name      - Name, relative to loc_id, of object that attribute is to be attached to
+  attr_name     - Attribute name
+  type_id       - Attribute datatype identifier
+  space_id      - Attribute dataspace identifier
+
+

OUTPUTS

+
  attr          - an attribute identifier
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

OPTIONAL PARAMETERS

+
  acpl_id       - Attribute creation property list identifier (Currently not used.)
+  aapl_id       - Attribute access property list identifier (Currently not used.)
+  lapl_id       - Link access property list
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  February, 2008
+
+

SOURCE

+
  SUBROUTINE h5acreate_by_name_f(loc_id, obj_name, attr_name, type_id, space_id, attr, hdferr, &
+       acpl_id, aapl_id, lapl_id)
+    IMPLICIT NONE
+    INTEGER(HID_T),   INTENT(IN)  :: loc_id
+    CHARACTER(LEN=*), INTENT(IN)  :: obj_name
+    CHARACTER(LEN=*), INTENT(IN)  :: attr_name
+    INTEGER(HID_T),   INTENT(IN)  :: type_id
+    INTEGER(HID_T),   INTENT(IN)  :: space_id
+    INTEGER(HID_T),   INTENT(OUT) :: attr
+    INTEGER,          INTENT(OUT) :: hdferr
+
+    INTEGER(HID_T),   INTENT(IN), OPTIONAL :: acpl_id
+    INTEGER(HID_T),   INTENT(IN), OPTIONAL :: aapl_id
+    INTEGER(HID_T),   INTENT(IN), OPTIONAL :: lapl_id
+
+ +
+ +

h5acreate_f

+ +

[ Top ] [ H5A ] [ Subroutines ]

+

NAME

+
  h5acreate_f
+
+

PURPOSE

+
  Creates a dataset as an attribute of a group, dataset, or named datatype
+
+

INPUTS

+
  loc_id        - identifier of an object (group, dataset,
+                  or named datatype) attribute is attached to
+  name          - attribute name
+  type_id       - attribute datatype identifier
+  space_id      - attribute dataspace identifier
+
+

OUTPUTS

+
  attr_id       - attribute identifier
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

OPTIONAL PARAMETERS

+
  acpl_id       - Attribute creation property list identifier
+  appl_id       - Attribute access property list identifier
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces are added for
+  called C functions (it is needed for Windows
+  port).  February 27, 2001
+
+

SOURCE

+
  SUBROUTINE h5acreate_f(loc_id, name, type_id, space_id, attr_id, &
+                                 hdferr, acpl_id, aapl_id )
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: loc_id   ! Object identifier
+    CHARACTER(LEN=*), INTENT(IN) :: name   ! Attribute name
+    INTEGER(HID_T), INTENT(IN) :: type_id  ! Attribute datatype identifier
+    INTEGER(HID_T), INTENT(IN) :: space_id ! Attribute dataspace identifier
+    INTEGER(HID_T), INTENT(OUT) :: attr_id ! Attribute identifier
+    INTEGER, INTENT(OUT) :: hdferr         ! Error code:
+                                           ! 0 on success and -1 on failure
+
+ +
+ +

h5adelete_by_idx_f

+ +

[ Top ] [ H5A ] [ Subroutines ]

+

NAME

+
  h5adelete_by_idx_f
+
+

PURPOSE

+
  Deletes an attribute from an object according to index order
+
+

INPUTS

+
  loc_id        - Location or object identifier; may be dataset or group
+  obj_name      - Name of object, relative to location, from which attribute is to be removed
+  idx_type      - Type of index; Possible values are:
+                   H5_INDEX_UNKNOWN_F = -1  - Unknown index type
+                   H5_INDEX_NAME_F          - Index on names
+                   H5_INDEX_CRT_ORDER_F     - Index on creation order
+                   H5_INDEX_N_F             - Number of indices defined
+
+  order         - Order in which to iterate over index; Possible values are:
+                   H5_ITER_UNKNOWN_F    - Unknown order
+                   H5_ITER_INC_F        - Increasing order
+                   H5_ITER_DEC_F        - Decreasing order
+                   H5_ITER_NATIVE_F     - No particular order, whatever is fastest
+                   H5_ITER_N_F          - Number of iteration orders
+
+  n             - Offset within index
+
+

OUTPUTS

+
  hdferr        - Returns 0 if successful and -1 if fails
+
+

OPTIONAL PARAMETERS

+
  lapl_id       - Link access property list
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  January, 2008
+
+

SOURCE

+
  SUBROUTINE h5adelete_by_idx_f(loc_id, obj_name, idx_type, order, n, hdferr, lapl_id)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: loc_id      ! Identifer for object to which attribute is attached
+    CHARACTER(LEN=*), INTENT(IN) :: obj_name  ! Name of object, relative to location,
+                                              !  from which attribute is to be removed
+    INTEGER, INTENT(IN) :: idx_type           ! Type of index; Possible values are:
+                                              !    H5_INDEX_UNKNOWN_F   - Unknown index type
+                                              !    H5_INDEX_NAME_F      - Index on names
+                                              !    H5_INDEX_CRT_ORDER_F - Index on creation order
+                                              !    H5_INDEX_N_F       - Number of indices defined
+
+    INTEGER, INTENT(IN) :: order              ! Order in which to iterate over index; Possible values are:
+                                              !    H5_ITER_UNKNOWN_F  - Unknown order
+                                              !    H5_ITER_INC_F      - Increasing order
+                                              !    H5_ITER_DEC_F      - Decreasing order
+                                              !    H5_ITER_NATIVE_F   - No particular order, whatever is fastest
+                                              !    H5_ITER_N_F      - Number of iteration orders
+    INTEGER(HSIZE_T), INTENT(IN) :: n         ! Offset within index
+    INTEGER, INTENT(OUT) :: hdferr         ! Error code:
+                                           ! 0 on success and -1 on failure
+    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list
+
+ +
+ +

h5adelete_by_name_f

+ +

[ Top ] [ H5A ] [ Subroutines ]

+

NAME

+
  h5adelete_by_name_f
+
+

PURPOSE

+
  Removes an attribute from a specified location
+
+

INPUTS

+
  loc_id        - Identifer for object to which attribute is attached
+  obj_name      - Name of attribute to open
+  attr_name     - Attribute access property list
+  lapl_id       - Link access property list
+
+

OUTPUTS

+
  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  January, 2008
+
+

SOURCE

+
  SUBROUTINE h5adelete_by_name_f(loc_id, obj_name, attr_name, hdferr, lapl_id)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: loc_id      ! Identifer for object to which attribute is attached
+    CHARACTER(LEN=*), INTENT(IN) :: obj_name  ! Name of object, relative to location,
+                                              !  from which attribute is to be removed
+    CHARACTER(LEN=*), INTENT(IN) :: attr_name ! Name of attribute to delete
+    INTEGER, INTENT(OUT) :: hdferr            ! Error code:
+                                              ! 0 on success and -1 on failure
+    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list
+
+ +
+ +

h5adelete_f

+ +

[ Top ] [ H5A ] [ Subroutines ]

+

NAME

+
  h5adelete_f
+
+

PURPOSE

+
  Deletes an attribute of an object (group, dataset or
+  named datatype)
+
+

INPUTS

+
  obj_id        - object identifier
+  name          - attribute name
+
+

OUTPUTS

+
  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces are added for
+  called C functions (it is needed for Windows
+  port).  February 27, 2001
+
+

SOURCE

+
  SUBROUTINE h5adelete_f(obj_id, name, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: obj_id  ! Object identifier
+    CHARACTER(LEN=*), INTENT(IN) :: name  ! Attribute name
+    INTEGER, INTENT(OUT) :: hdferr        ! Error code
+
+ +
+ +

H5Aexists_by_name_f

+ +

[ Top ] [ H5A ] [ Subroutines ]

+

NAME

+
  H5Aexists_by_name_f
+
+

PURPOSE

+
  Determines whether an attribute with a given name exists on an object
+
+

INPUTS

+
  loc_id        - Location identifier
+  obj_name      - Object name either relative to loc_id, absolute from the file’s root group, or '.' (a dot)
+  attr_name     - Attribute name
+
+

OUTPUTS

+
  attr_exists   - attribute exists status
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

OPTIONAL PARAMETERS

+
  lapl_id       - Link access property list identifier
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  February, 2008
+
+

SOURCE

+
  SUBROUTINE h5aexists_by_name_f(loc_id, obj_name, attr_name, attr_exists, hdferr, lapl_id)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: loc_id     ! Location identifier
+    CHARACTER(LEN=*), INTENT(IN) :: obj_name ! Object name either relative to loc_id,
+                                             ! absolute from the fileâs root group, or '.'
+    CHARACTER(LEN=*), INTENT(IN) :: attr_name ! Attribute name
+    LOGICAL, INTENT(OUT) :: attr_exists ! .TRUE. if exists, .FALSE. otherwise
+    INTEGER, INTENT(OUT) :: hdferr      ! Error code:
+                                        ! 0 on success and -1 on failure
+    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list identifier
+
+ +
+ +

H5Aexists_f

+ +

[ Top ] [ H5A ] [ Subroutines ]

+

NAME

+
  H5Aexists_f
+
+

PURPOSE

+
  Determines whether an attribute with a given name exists on an object
+
+

INPUTS

+
  obj_id        - Object identifier
+  attr_name     - Attribute name
+
+

OUTPUTS

+
  attr_exists   - attribute exists status
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  February, 2008
+
+

SOURCE

+
  SUBROUTINE h5aexists_f(obj_id, attr_name, attr_exists, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: obj_id      ! Object identifier
+    CHARACTER(LEN=*), INTENT(IN) :: attr_name ! Attribute name
+    LOGICAL, INTENT(OUT) :: attr_exists  ! .TRUE. if exists, .FALSE. otherwise
+    INTEGER, INTENT(OUT) :: hdferr       ! Error code:
+                                         ! 0 on success and -1 on failure
+
+ +
+ +

h5aget_create_plist_f

+ +

[ Top ] [ H5A ] [ Subroutines ]

+

NAME

+
  h5aget_create_plist_f
+
+

PURPOSE

+
  Gets an attribute creation property list identifier
+
+

INPUTS

+
  attr_id          - Identifier of the attribute
+
+

OUTPUTS

+
  creation_prop_id - Identifier for the attribute’s creation property
+  hdferr           - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  January, 2008
+
+

SOURCE

+
  SUBROUTINE h5aget_create_plist_f(attr_id, creation_prop_id, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: attr_id  ! Identifier of the attribute
+    INTEGER(HID_T), INTENT(OUT) :: creation_prop_id   ! Identifier for the attributeâs creation property
+    INTEGER, INTENT(OUT) :: hdferr       ! Error code
+                                         ! 0 on success and -1 on failure
+
+ +
+ +

h5aget_info_by_idx_f

+ +

[ Top ] [ H5A ] [ Subroutines ]

+

NAME

+
  h5aget_info_by_idx_f
+
+

PURPOSE

+
  Retrieves attribute information, by attribute index position
+
+

INPUTS

+
  loc_id        - Location of object to which attribute is attached
+  obj_name      - Name of object to which attribute is attached, relative to location
+  idx_type      - Type of index
+  order         - Index traversal order
+  n             - Attribute’s position in index
+
+ OUTPUTS  NOTE: In C it is defined as a structure: H5A_info_t
+  corder_valid  - indicates whether the creation order data is valid for this attribute
+  corder        - is a positive integer containing the creation order of the attribute
+  cset          - indicates the character set used for the attribute’s name
+  data_size     - indicates the size, in the number of characters, of the attribute
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

OPTIONAL PARAMETERS

+
  lapl_id       - Link access property list
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  January, 2008
+
+

SOURCE

+
  SUBROUTINE h5aget_info_by_idx_f(loc_id, obj_name, idx_type, order, n, &
+       f_corder_valid, corder, cset, data_size, hdferr, lapl_id)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: loc_id      ! Object identifier
+    CHARACTER(LEN=*), INTENT(IN) :: obj_name  ! Name of object to which attribute is attached
+    INTEGER, INTENT(IN) :: idx_type           ! Type of index; Possible values are:
+                                              !    H5_INDEX_UNKNOWN_F   - Unknown index type
+                                              !    H5_INDEX_NAME_F      - Index on names
+                                              !    H5_INDEX_CRT_ORDER_F - Index on creation order
+                                              !    H5_INDEX_N_F       - Number of indices defined
+    INTEGER, INTENT(IN) :: order              ! Order in which to iterate over index; Possible values are:
+                                              !    H5_ITER_UNKNOWN_F  - Unknown order
+                                              !    H5_ITER_INC_F      - Increasing order
+                                              !    H5_ITER_DEC_F      - Decreasing order
+                                              !    H5_ITER_NATIVE_F   - No particular order, whatever is fastest
+
+    INTEGER(HSIZE_T), INTENT(IN) :: n         ! Attributeâs position in index
+
+
+    LOGICAL, INTENT(OUT) :: f_corder_valid ! Indicates whether the creation order data is valid for this attribute
+    INTEGER, INTENT(OUT) :: corder ! Is a positive integer containing the creation order of the attribute
+    INTEGER, INTENT(OUT) :: cset   ! Indicates the character set used for the attributeâs name
+    INTEGER(HSIZE_T), INTENT(OUT) :: data_size ! Indicates the size, in the number of characters, of the attribute
+    INTEGER, INTENT(OUT) :: hdferr       ! Error code:
+                                         ! 0 on success and -1 on failure
+    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id  ! Link access property list
+
+ +
+ +

h5aget_info_by_name_f

+ +

[ Top ] [ H5A ] [ Subroutines ]

+

NAME

+
  h5aget_info_by_name_f
+
+

PURPOSE

+
  Retrieves attribute information, by attribute name
+
+

INPUTS

+
  loc_id        - Location of object to which attribute is attached
+  obj_name      - Name of object to which attribute is attached, relative to location
+  attr_name     - Attribute name
+
+ OUTPUTS  NOTE: In C it is defined as a structure: H5A_info_t
+  corder_valid  - indicates whether the creation order data is valid for this attribute
+  corder        - is a positive integer containing the creation order of the attribute
+  cset          - indicates the character set used for the attribute’s name
+  data_size     - indicates the size, in the number of characters, of the attribute
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

OPTIONAL PARAMETERS

+
  lapl_id       - Link access property list
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  January, 2008
+
+

SOURCE

+
  SUBROUTINE h5aget_info_by_name_f(loc_id, obj_name, attr_name, &
+       f_corder_valid, corder, cset, data_size, hdferr, lapl_id)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: loc_id    ! Object identifier
+    CHARACTER(LEN=*), INTENT(IN) :: obj_name ! Name of object to which attribute is attached
+    CHARACTER(LEN=*), INTENT(IN) :: attr_name ! Attribute name
+
+
+    LOGICAL, INTENT(OUT) :: f_corder_valid ! Indicates whether the creation order data is valid for this attribute
+    INTEGER, INTENT(OUT) :: corder ! Is a positive integer containing the creation order of the attribute
+    INTEGER, INTENT(OUT) :: cset ! Indicates the character set used for the attributeâs name
+    INTEGER(HSIZE_T), INTENT(OUT) :: data_size   ! Indicates the size, in the number of characters, of the attribute
+    INTEGER, INTENT(OUT) :: hdferr         ! Error code:
+                                           ! 0 on success and -1 on failure
+    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id  ! Link access property list
+
+ +
+ +

h5aget_info_f

+ +

[ Top ] [ H5A ] [ Subroutines ]

+

NAME

+
  h5aget_info_f
+
+

PURPOSE

+
  Retrieves attribute information, by attribute identifier
+
+

INPUTS

+
  attr_id       - attribute identifier
+
+

OUTPUTS

+
  NOTE: In C it is defined as a structure: H5A_info_t
+
+  corder_valid  - indicates whether the creation order data is valid for this attribute
+  corder        - is a positive integer containing the creation order of the attribute
+  cset          - indicates the character set used for the attribute’s name
+  data_size     - indicates the size, in the number of characters, of the attribute
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  January, 2008
+
+

SOURCE

+
  SUBROUTINE h5aget_info_f(attr_id, f_corder_valid, corder, cset, data_size, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: attr_id  ! Attribute identifier
+
+    LOGICAL, INTENT(OUT) :: f_corder_valid ! Indicates whether the creation order data is valid for this attribute
+    INTEGER, INTENT(OUT) :: corder ! Is a positive integer containing the creation order of the attribute
+    INTEGER, INTENT(OUT) :: cset   ! Indicates the character set used for the attributeâs name
+    INTEGER(HSIZE_T), INTENT(OUT) :: data_size ! Indicates the size, in the number of characters, of the attribute
+    INTEGER, INTENT(OUT) :: hdferr       ! Error code:
+                                         ! 0 on success and -1 on failure
+
+ +
+ +

h5aget_name_by_idx_f

+ +

[ Top ] [ H5A ] [ Subroutines ]

+

NAME

+
  h5aget_name_by_idx_f
+
+

PURPOSE

+
  Gets an attribute name, by attribute index position.
+
+

INPUTS

+
  loc_id        - Location of object to which attribute is attached
+  obj_name      - Name of object to which attribute is attached, relative to location
+  idx_type      - Type of index; Possible values are:
+                   H5_INDEX_UNKNOWN_F = -1  - Unknown index type
+                   H5_INDEX_NAME_F          - Index on names
+                   H5_INDEX_CRT_ORDER_F     - Index on creation order
+                   H5_INDEX_N_F             - Number of indices defined
+
+  order         - Order in which to iterate over index; Possible values are:
+                   H5_ITER_UNKNOWN_F    - Unknown order
+                   H5_ITER_INC_F        - Increasing order
+                   H5_ITER_DEC_F        - Decreasing order
+                   H5_ITER_NATIVE_F     - No particular order, whatever is fastest
+                   H5_ITER_N_F          - Number of iteration orders
+  order         - Index traversal order
+  n             - Attribute’s position in index
+
+

OUTPUTS

+
  name          - Attribute name
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

OPTIONAL PARAMETERS

+
  lapl_id       - Link access property list
+  size          - Size, in bytes, of attribute name
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  January, 2008
+
+

SOURCE

+
  SUBROUTINE h5aget_name_by_idx_f(loc_id, obj_name, idx_type, order, &
+       n, name, hdferr, size, lapl_id)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: loc_id      ! Identifer for object to which attribute is attached
+    CHARACTER(LEN=*), INTENT(IN) :: obj_name  ! Name of object, relative to location,
+                                              !  from which attribute is to be removed *TEST* check NULL
+    INTEGER, INTENT(IN) :: idx_type ! Type of index; Possible values are:
+                                    !    H5_INDEX_UNKNOWN_F   - Unknown index type
+                                    !    H5_INDEX_NAME_F       - Index on names
+                                    !    H5_INDEX_CRT_ORDER_F  - Index on creation order
+                                    !    H5_INDEX_N_F         - Number of indices defined
+
+    INTEGER, INTENT(IN) :: order    ! Order in which to iterate over index; Possible values are:
+                                    !    H5_ITER_UNKNOWN_F   - Unknown order
+                                    !    H5_ITER_INC_F      - Increasing order
+                                    !    H5_ITER_DEC_F       - Decreasing order
+                                    !    H5_ITER_NATIVE_F    - No particular order, whatever is fastest
+                                    !    H5_ITER_N_F        - Number of iteration orders
+    INTEGER(HSIZE_T), INTENT(IN) :: n !  Attributeâs position in index
+    CHARACTER(LEN=*), INTENT(OUT) :: name ! Attribute name
+    INTEGER, INTENT(OUT) :: hdferr    ! Error code:
+                                      ! Returns attribute name size,
+                                      ! -1 if fail
+    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list
+    INTEGER(SIZE_T), OPTIONAL, INTENT(OUT) :: size  ! Indicates the size, in the number of characters, 
+                                                    ! of the attribute
+
+ +
+ +

h5aget_name_f

+ +

[ Top ] [ H5A ] [ Subroutines ]

+

NAME

+
  h5aget_name_f
+
+

PURPOSE

+
  Gets an attribute name.
+
+

INPUTS

+
  attr_id       - attribute identifier
+  size          - size of a buffer to read name in
+
+

OUTPUTS

+
  buf           - buffer to read name in
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces are added for
+  called C functions (it is needed for Windows
+  port).  February 27, 2001
+
+

SOURCE

+
  SUBROUTINE h5aget_name_f(attr_id, size, buf, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: attr_id  ! Attribute identifier
+    INTEGER(SIZE_T), INTENT(IN) :: size    ! Buffer size
+    CHARACTER(LEN=*), INTENT(INOUT) :: buf ! Buffer to hold attribute name
+    INTEGER, INTENT(OUT) :: hdferr ! Error code:
+                                   ! name length is successful, -1 if fail
+
+ +
+ +

h5aget_num_attrs_f

+ +

[ Top ] [ H5A ] [ Subroutines ]

+

NAME

+
  h5aget_num_attrs_f
+
+

PURPOSE

+
  Determines the number of attributes attached to an object.
+
+

INPUTS

+
  obj_id        - object (group, dataset, or named datatype)
+  identifier
+
+

OUTPUTS

+
  attr_num      - number of attributes attached to the object
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces are added for
+  called C functions (it is needed for Windows
+  port).  February 27, 2001
+
+

SOURCE

+
  SUBROUTINE h5aget_num_attrs_f(obj_id, attr_num, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: obj_id  ! Object identifier
+    INTEGER, INTENT(OUT) :: attr_num      ! Number of attributes of the object
+    INTEGER, INTENT(OUT) :: hdferr        ! Error code
+
+ +
+ +

h5aget_space_f

+ +

[ Top ] [ H5A ] [ Subroutines ]

+

NAME

+
  h5aget_space_f
+
+

PURPOSE

+
  Gets a copy of the dataspace for an attribute.
+
+

INPUTS

+
  attr_id       - attribute identifier
+
+

OUTPUTS

+
  space_id      - attribite dataspace identifier
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces are added for
+  called C functions (it is needed for Windows
+  port).  February 27, 2001
+
+

SOURCE

+
  SUBROUTINE h5aget_space_f(attr_id, space_id, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: attr_id   ! Attribute identifier
+    INTEGER(HID_T), INTENT(OUT) :: space_id ! Attribute dataspace identifier
+    INTEGER, INTENT(OUT) :: hdferr          ! Error code
+
+ +
+ +

h5aget_storage_size_f

+ +

[ Top ] [ H5A ] [ Subroutines ]

+

NAME

+
  h5aget_storage_size_f
+
+

PURPOSE

+
  Returns the amount of storage required for an attribute.
+
+

INPUTS

+
  attr_id       - attribute identifier
+
+

OUTPUTS

+
  size          - attribute storage size
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  January, 2008
+
+

SOURCE

+
  SUBROUTINE h5aget_storage_size_f(attr_id, size, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: attr_id  ! Attribute identifier
+    INTEGER(HSIZE_T), INTENT(OUT) :: size  ! Attribute storage requirement
+    INTEGER, INTENT(OUT) :: hdferr         ! Error code
+
+ +
+ +

h5aget_type_f

+ +

[ Top ] [ H5A ] [ Subroutines ]

+

NAME

+
  h5aget_type_f
+
+

PURPOSE

+
  Gets an attribute datatype.
+
+

INPUTS

+
  attr_id       - attribute identifier
+
+

OUTPUTS

+
  type_id       - attribute datatype identifier
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces are added for
+  called C functions (it is needed for Windows
+  port).  February 27, 2001
+
+

SOURCE

+
  SUBROUTINE h5aget_type_f(attr_id, type_id, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: attr_id  ! Attribute identifier
+    INTEGER(HID_T), INTENT(OUT) :: type_id ! Attribute datatype identifier
+    INTEGER, INTENT(OUT) :: hdferr         ! Error code
+
+ +
+ +

h5aopen_by_idx_f

+ +

[ Top ] [ H5A ] [ Subroutines ]

+

NAME

+
  h5aopen_by_idx_f
+
+

PURPOSE

+
  Opens an existing attribute that is attached to an object specified by location and name
+
+

INPUTS

+
  loc_id        - Location of object to which attribute is attached
+  obj_name      - Name of object to which attribute is attached, relative to location
+  idx_type      - Type of index
+  order         - Index traversal order
+  n             - Attribute’s position in index
+
+

OUTPUTS

+
  hdferr        - Returns 0 if successful and -1 if fails
+
+

OPTIONAL PARAMETERS

+
  aapl_id       - Attribute access property list
+  lapl_id       - Link access property list
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  January, 2008
+
+

SOURCE

+
  SUBROUTINE h5aopen_by_idx_f(loc_id, obj_name, idx_type, order, n, attr_id, hdferr, aapl_id, lapl_id)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: loc_id      ! Object identifier
+    CHARACTER(LEN=*), INTENT(IN) :: obj_name  ! Name of object to which attribute is attached
+    INTEGER, INTENT(IN) :: idx_type           ! Type of index; Possible values are:
+                                              !    H5_INDEX_UNKNOWN_F   - Unknown index type
+                                              !    H5_INDEX_NAME_F      - Index on names
+                                              !    H5_INDEX_CRT_ORDER_F - Index on creation order
+                                              !    H5_INDEX_N_F       - Number of indices defined
+    INTEGER, INTENT(IN) :: order              ! Order in which to iterate over index; Possible values are:
+                                              !    H5_ITER_UNKNOWN_F  - Unknown order
+                                              !    H5_ITER_INC_F      - Increasing order
+                                              !    H5_ITER_DEC_F      - Decreasing order
+                                              !    H5_ITER_NATIVE_F   - No particular order, whatever is fastest
+
+    INTEGER(HSIZE_T), INTENT(IN) :: n       ! Attributeâs position in index
+
+    INTEGER(HID_T), INTENT(OUT) :: attr_id  ! Attribute identifier
+    INTEGER, INTENT(OUT) :: hdferr          ! Error code:
+                                            ! 0 on success and -1 on failure
+    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: aapl_id  ! Attribute access property list
+    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id  ! Link access property list
+
+ +
+ +

H5Aopen_by_name_f

+ +

[ Top ] [ H5A ] [ Subroutines ]

+

NAME

+
  H5Aopen_by_name_f
+
+

PURPOSE

+
  Opens an attribute for an object by object name and attribute name.
+
+

INPUTS

+
  loc_id        - Location from which to find object to which attribute is attached
+  obj_name      - Object name either relative to loc_id, absolute from the file’s root group, or '.' (a dot)
+  attr_name     - Attribute name
+
+

OUTPUTS

+
  attr_id       - attribute identifier
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

OPTIONAL PARAMETERS

+
  aapl_id       - Attribute access property list (Currently unused; should be passed in as H5P_DEFAULT.)
+  lapl_id       - Link access property list identifier
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  February, 2008
+
+

SOURCE

+
  SUBROUTINE h5aopen_by_name_f(loc_id, obj_name, attr_name, attr_id, hdferr, aapl_id, lapl_id)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: loc_id    ! Location identifier
+    CHARACTER(LEN=*), INTENT(IN) :: obj_name ! Object name either relative to loc_id,
+                                             ! absolute from the fileâs root group, or '.'
+    CHARACTER(LEN=*), INTENT(IN) :: attr_name ! Attribute name
+    INTEGER(HID_T), INTENT(OUT) :: attr_id ! Attribute identifier
+    INTEGER, INTENT(OUT) :: hdferr         ! Error code:
+                                           ! 0 on success and -1 on failure
+    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: aapl_id ! Attribute access property list
+                                                    ! (Currently unused; should be passed in as H5P_DEFAULT_F)
+    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list identifier
+
+ +
+ +

h5aopen_f

+ +

[ Top ] [ H5A ] [ Subroutines ]

+

NAME

+
  h5aopen_f
+
+

PURPOSE

+
  Opens an attribute for an object specified by object
+  identifier and attribute name
+
+

INPUTS

+
  obj_id        - Identifer for object to which attribute is attached
+  attr_name     - Name of attribute to open
+
+

OUTPUTS

+
  attr_id       - attribute identifier
+
+

OPTIONAL PARAMETERS

+
  aapl_id       - Attribute access property list
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  January, 2008
+
+

SOURCE

+
  SUBROUTINE h5aopen_f(obj_id, attr_name, attr_id, hdferr, aapl_id)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: obj_id      ! Object identifier
+    CHARACTER(LEN=*), INTENT(IN) :: attr_name ! Attribute name
+    INTEGER(HID_T), INTENT(OUT) :: attr_id    ! Attribute identifier
+    INTEGER, INTENT(OUT) :: hdferr            ! Error code
+                                              !   Success:  0
+                                              !   Failure: -1
+    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: aapl_id     ! Attribute access property list
+
+ +
+ +

h5aopen_idx_f

+ +

[ Top ] [ H5A ] [ Subroutines ]

+

NAME

+
  h5aopen_idx_f
+
+

PURPOSE

+
  Opens the attribute specified by its index.
+
+

INPUTS

+
  obj_id        - identifier of a group, dataset, or named
+                  datatype an attribute to be attached to
+  index         - index of the attribute to open (zero-based)
+
+

OUTPUTS

+
  attr_id       - attribute identifier
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces are added for
+  called C functions (it is needed for Windows
+  port).  February 27, 2001
+
+

SOURCE

+
  SUBROUTINE h5aopen_idx_f(obj_id, index, attr_id, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: obj_id    ! Object identifier
+    INTEGER, INTENT(IN) :: index            ! Attribute index
+    INTEGER(HID_T), INTENT(OUT) :: attr_id  ! Attribute identifier
+    INTEGER, INTENT(OUT) :: hdferr          ! Error code
+
+ +
+ +

h5aopen_name_f

+ +

[ Top ] [ H5A ] [ Subroutines ]

+

NAME

+
  h5aopen_name_f
+
+

PURPOSE

+
  Opens an attribute specified by name.
+
+

INPUTS

+
  obj_id        - identifier of a group, dataset, or named
+                  datatype atttribute to be attached to
+  name          - attribute name
+
+

OUTPUTS

+
  attr_id       - attribute identifier
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces are added for
+  called C functions (it is needed for Windows
+  port).  February 27, 2001
+
+

SOURCE

+
  SUBROUTINE h5aopen_name_f(obj_id, name, attr_id, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: obj_id    ! Object identifier
+    CHARACTER(LEN=*), INTENT(IN) :: name    ! Attribute name
+    INTEGER(HID_T), INTENT(OUT) :: attr_id  ! Attribute identifier
+    INTEGER, INTENT(OUT) :: hdferr          ! Error code
+
+ +
+ +

h5arename_by_name_f

+ +

[ Top ] [ H5A ] [ Subroutines ]

+

NAME

+
  h5arename_by_name_f
+
+

PURPOSE

+
  Renames an attribute
+
+

INPUTS

+
  loc_id        - Location or object identifier; may be dataset or group
+  obj_name      - Name of object, relative to location,
+                  whose attribute is to be renamed
+  old_attr_name - Prior attribute name
+  new_attr_name - New attribute name
+  lapl_id       - Link access property list identifier
+
+

OUTPUTS

+
  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  January, 2008
+
+

SOURCE

+
  SUBROUTINE h5arename_by_name_f(loc_id, obj_name, old_attr_name, new_attr_name, &
+        hdferr, lapl_id)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: loc_id    ! Object identifier
+    CHARACTER(LEN=*), INTENT(IN) :: obj_name  ! Name of object, relative to location,
+                                              !  whose attribute is to be renamed
+    CHARACTER(LEN=*), INTENT(IN) :: old_attr_name ! Prior attribute name
+    CHARACTER(LEN=*), INTENT(IN) :: new_attr_name ! New attribute name
+
+    INTEGER, INTENT(OUT) :: hdferr       ! Error code:
+                                         ! 0 on success and -1 on failure
+    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list identifier
+
+ +
+ +

h5arename_f

+ +

[ Top ] [ H5A ] [ Subroutines ]

+

NAME

+
  h5arename_f
+
+

PURPOSE

+
  Renames an attribute
+
+

INPUTS

+
  loc_id        - Location or object identifier; may be dataset or group
+  old_attr_name - Prior attribute name
+  new_attr_name - New attribute name
+
+

OUTPUTS

+
  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  January, 2008
+
+

HISTORY

+
  N/A
+
+

SOURCE

+
  SUBROUTINE h5arename_f(loc_id, old_attr_name, new_attr_name, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: loc_id    ! Object identifier
+    CHARACTER(LEN=*), INTENT(IN) :: old_attr_name ! Prior attribute name
+    CHARACTER(LEN=*), INTENT(IN) :: new_attr_name ! New attribute name
+    INTEGER, INTENT(OUT) :: hdferr       ! Error code:
+                                         ! 0 on success and -1 on failure
+
+ +
+ + + diff --git a/fortran/doc/DevelGuide/src/H5Df_c.html b/fortran/doc/DevelGuide/src/H5Df_c.html new file mode 100644 index 0000000..1e163f2 --- /dev/null +++ b/fortran/doc/DevelGuide/src/H5Df_c.html @@ -0,0 +1,41 @@ + + + + + + + +./src/H5Df.c + + + + + +
+
+ +

H5Df

+ +

[ Top ] [ Modules ]

+

PURPOSE

+
   This file contains C stubs for H5D Fortran APIs
+
+ +
+ + + diff --git a/fortran/doc/DevelGuide/src/H5Dff_F03_f90.html b/fortran/doc/DevelGuide/src/H5Dff_F03_f90.html new file mode 100644 index 0000000..0bb4173 --- /dev/null +++ b/fortran/doc/DevelGuide/src/H5Dff_F03_f90.html @@ -0,0 +1,138 @@ + + + + + + + +./src/H5Dff_F03.f90 + + + + + +
+
+ +

H5D (F03)

+ +

[ Top ] [ Modules ]

+

NAME

+
  H5D_PROVISIONAL
+
+

PURPOSE

+
  This file contains Fortran 90 and Fortran 2003 interfaces for H5D functions.
+  It contains the same functions as H5Dff_DEPRECIATE.f90 but includes the
+  Fortran 2003 functions and the interface listings. This file will be compiled
+  instead of H5Dff_DEPRECIATE.f90 if Fortran 2003 functions are enabled.
+
+

NOTES

+
  (1) The maximum rank of an array allowed in Fortran is 7, therefore
+  we only provide an interface for arrays up to and including rank 7.
+
+  (2) Unfortunately we are using a generic interface and one of the factors
+  used in determining the proper routine to select is that of the array
+  rank being passed. Therefore, we can not create just one subroutine for
+  each array type (integer, real, etc...) and use a
+  rank 1 array of assumed size to handle multiple ranks, i.e.
+  (i.e. integer, dimension(*) :: ... )
+  (i.e. real   , dimension(*) :: ... ) etc...
+
+  (3) Could not place the USE ISO_C_BINDING in the module header because it may
+  conflict with the USE ISO_C_BINDING included in the user's program. Moved
+  the statement instead to each subroutine.
+
+
+  (4) C_LOC and character strings according to the Fortran 2003 standard:
+
+  15.1.2.5 C_LOC(X)
+
+  Argument. X shall either
+
+  (A) have interoperable type and type parameters and be
+  (a) a variable that has the TARGET attribute and is interoperable,
+  (b) an allocated allocatable variable that has the TARGET attribute
+  and is not an array of zero size, or
+  (c) an associated scalar pointer, or
+  (B) be a nonpolymorphic scalar, have no length type parameters, and be
+  (a) a nonallocatable, nonpointer variable that has the TARGET attribute,
+  (b) an allocated allocatable variable that has the TARGET attribute, or
+  (c) an associated pointer.
+
+        - When X is a character, for interoperability the standard is:
+
+  15.2.1 Interoperability of intrinsic types
+
+  ...if the type is character, interoperability also requires that the length type parameter
+  be omitted or be specified by an initialization expression whose value is one.
+
+  THEREFORE compilers that have not extended the standard require the
+  argument in C_LOC to be of the variant:
+
+  CHARACTER(LEN=1), TARGET :: chr
+  or
+  CHARACTER, TARGET :: chr
+  (B)
+                         *** IMPORTANT ***
+  If you add a new H5D function you must add the function name to the
+  Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory.
+  This is needed for Windows based operating systems.
+
+ +
+ +

h5dvlen_reclaim

+ +

[ Top ] [ H5D ] [ Subroutines ]

+

NAME

+
  h5dvlen_reclaim
+
+

PURPOSE

+
  Reclaims VL datatype memory buffers. 
+
+

INPUTS

+
  type_id  - Identifier of the datatype. 
+  space_id - Identifier of the dataspace. 
+  plist_id - Identifier of the property list used to create the buffer. 
+       buf - Pointer to the buffer to be reclaimed. 
+
+

OUTPUTS

+
  hdferr   - error code
+               Success:  0
+               Failure: -1
+
+

AUTHOR

+
 M. Scot Breitenfeld
+ January 11, 2011
+
+

SOURCE

+
  SUBROUTINE H5Dvlen_reclaim_f(type_id, space_id, plist_id, buf, hdferr)
+
+    USE ISO_C_BINDING
+    IMPLICIT NONE
+
+    INTEGER(HID_T), INTENT(IN) :: type_id   ! Identifier of the datatype. 
+    INTEGER(HID_T), INTENT(IN) :: space_id  ! Identifier of the dataspace. 
+    INTEGER(HID_T), INTENT(IN) :: plist_id  ! Identifier of the property list used to create the buffer. 
+    TYPE(C_PTR), INTENT(INOUT) :: buf       ! Pointer to the buffer to be reclaimed. 
+    INTEGER, INTENT(OUT) :: hdferr          ! Error code.
+
+ +
+ + + diff --git a/fortran/doc/DevelGuide/src/H5Dff_F90_f90.html b/fortran/doc/DevelGuide/src/H5Dff_F90_f90.html new file mode 100644 index 0000000..afebdd8 --- /dev/null +++ b/fortran/doc/DevelGuide/src/H5Dff_F90_f90.html @@ -0,0 +1,116 @@ + + + + + + + +./src/H5Dff_F90.f90 + + + + + +
+
+ +

H5D (F90)

+ +

[ Top ] [ Modules ]

+

NAME

+
  H5D_PROVISIONAL
+
+

PURPOSE

+
  This file contains Fortran 90 interfaces for H5D functions. It contains
+  the same functions as H5Dff_F03.f90 but excludes the Fortran 2003 functions
+  and the interface listings. This file will be compiled instead of H5Dff_F03.f90
+  if Fortran 2003 functions are not enabled.
+
+

NOTES

+
  (1) The maximum rank of an array allowed in Fortran is 7, therefore
+  we only provide an interface for arrays up to and including rank 7.
+
+  (2) Unfortunately we are using a generic interface and one of the factors
+  used in determining the proper routine to select is that of the array
+  rank being passed, therefore we can not create just one subroutine for
+  each array type (integer, real, etc...) of various ranks and then use a
+  rank 1 array of assumed size in the just one subroutine,
+  (i.e. integer, dimension(*) :: ... )
+  (i.e. real   , dimension(*) :: ... ) etc...
+
+  (3)
+                         *** IMPORTANT ***
+  If you add a new H5D function you must add the function name to the
+  Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory.
+  This is needed for Windows based operating systems.
+
+ +
+ +

h5dread_f

+ +

[ Top ] [ H5D ] [ Subroutines ]

+

NAME

+
  h5dread_f
+
+

PURPOSE

+
  Reads raw data from the specified dataset into buf,
+  converting from file datatype and dataspace to memory
+  datatype and dataspace.
+
+

INPUTS

+
  dset_id       - dataset identifier
+  mem_type_id   - memory type identifier
+  dims          - 1-dim array of size 7; dims(k) has the size
+                  of k-th dimension of the buf array
+
+

OUTPUTS

+
  buf     - buffer to read data in
+  hdferr: - error code
+             Success:  0
+             Failure: -1
+
+

OPTIONAL PARAMETERS

+
  mem_space_id  - memory dataspace identifier
+  file_space_id - file dataspace identifier
+  xfer_prp      - trasfer property list identifier
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  February 28, 2001
+
+  dims parameter was added to make code portable;
+  n parameter was replaced with dims parameter in
+  the h5dwrite_reference_obj and h5dwrite_reference_dsetreg
+  functions.  April 2, 2001
+
+

NOTES

+
  This function is overloaded to read INTEGER,
+  REAL, DOUBLE PRECISION and CHARACTER buffers
+  up to 7 dimensions, and one dimensional buffers
+  of the TYPE(hobj_ref_t_f) and TYPE(hdset_reg_ref_t_f) types.
+
+ +
+ + + diff --git a/fortran/doc/DevelGuide/src/H5Dff_f90.html b/fortran/doc/DevelGuide/src/H5Dff_f90.html new file mode 100644 index 0000000..5444a93 --- /dev/null +++ b/fortran/doc/DevelGuide/src/H5Dff_f90.html @@ -0,0 +1,506 @@ + + + + + + + +./src/H5Dff.f90 + + + + + +
+
+ +

H5D

+ +

[ Top ] [ Modules ]

+

NAME

+
  MODULE H5D
+
+

FILE

+
  fortran/src/H5Dff.f90
+
+

PURPOSE

+
  This file contains Fortran interfaces for H5D functions. It includes
+  all the functions that are independent on whether the Fortran 2003 functions
+  are enabled or disabled.
+
+

NOTES

+
                         *** IMPORTANT ***
+  If you add a new H5D function you must add the function name to the
+  Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory.
+  This is needed for Windows based operating systems.
+
+ +
+ +

h5dclose_f

+ +

[ Top ] [ H5D ] [ Subroutines ]

+

NAME

+
  h5dclose_f
+
+

PURPOSE

+
  Closes a dataset.
+
+

INPUTS

+
  dset_id       - dataset identifier
+
+

OUTPUTS

+
  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  February 28, 2001
+
+

SOURCE

+
  SUBROUTINE h5dclose_f(dset_id, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier
+    INTEGER, INTENT(OUT) :: hdferr        ! Error code
+
+ +
+ +

h5dcreate_anon_f

+ +

[ Top ] [ H5D ] [ Subroutines ]

+

NAME

+
  h5dcreate_anon_f
+
+

PURPOSE

+
  Creates a dataset in a file without linking it into the file structure
+
+

INPUTS

+
  loc_id        - Identifier of the file or group within which to create the dataset.
+  type_id       - Identifier of the datatype to use when creating the dataset.
+  space_id      - Identifier of the dataspace to use when creating the dataset.
+
+

OUTPUTS

+
  dset_id       - dataset identifier
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

OPTIONAL PARAMETERS

+
  dcpl_id       - Dataset creation property list identifier.
+  dapl_id       - Dataset access property list identifier.
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  February 11, 2008
+
+

SOURCE

+
  SUBROUTINE h5dcreate_anon_f(loc_id, type_id, space_id, dset_id, hdferr, dcpl_id, dapl_id)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: loc_id   ! File or group identifier.
+    INTEGER(HID_T), INTENT(IN) :: type_id  ! Datatype identifier.
+    INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier.
+    INTEGER(HID_T), INTENT(OUT) :: dset_id ! Dataset identifier.
+    INTEGER, INTENT(OUT) :: hdferr         ! Error code.
+    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: dcpl_id  ! Dataset creation property list identifier.
+    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: dapl_id  ! Dataset access property list identifier.
+
+ +
+ +

h5dcreate_f

+ +

[ Top ] [ H5D ] [ Subroutines ]

+

NAME

+
  h5dcreate_f
+
+

PURPOSE

+
  Creates a dataset at the specified location
+
+

INPUTS

+
  loc_id        - file or group identifier
+  name          - dataset name
+  type_id       - dataset datatype identifier
+  space_id      - dataset dataspace identifier
+
+

OUTPUTS

+
  dset_id       - dataset identifier
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

OPTIONAL PARAMETERS

+
  creation_prp  - Dataset creation property list
+  lcpl_id       - Link creation property list
+  dapl_id       - Dataset access property list
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  - Explicit Fortran interfaces were added for
+    called C functions (it is needed for Windows
+    port).  February 28, 2001
+
+  - Added version's 1.8 new optional parameters
+    February, 2008
+
+

SOURCE

+
  SUBROUTINE h5dcreate_f(loc_id, name, type_id, space_id, dset_id, &
+       hdferr, dcpl_id, lcpl_id, dapl_id)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: loc_id   ! File or group identifier
+    CHARACTER(LEN=*), INTENT(IN) :: name   ! Name of the dataset
+    INTEGER(HID_T), INTENT(IN) :: type_id  ! Datatype identifier
+    INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier
+    INTEGER(HID_T), INTENT(OUT) :: dset_id ! Dataset identifier
+    INTEGER, INTENT(OUT) :: hdferr         ! Error code
+
+ +
+ +

h5dget_access_plist_f

+ +

[ Top ] [ H5D ] [ Subroutines ]

+

NAME

+
  h5dget_access_plist_f
+
+

PURPOSE

+
  Returns a copy of the dataset creation property list.
+
+

INPUTS

+
  dset_id       - Dataset identifier
+
+

OUTPUTS

+
  plist_id      - Dataset access property list identifier
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  April 13, 2009
+
+

SOURCE

+
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  
+
+ +
+ +

h5dget_create_plist_f

+ +

[ Top ] [ H5D ] [ Subroutines ]

+

NAME

+
  h5dget_create_plist_f
+
+

PURPOSE

+
  Returns an identifier for a copy of the dataset creation
+  property list for a dataset.
+
+

INPUTS

+
  dataset_id    - dataset identifier
+
+

OUTPUTS

+
  plist_id      - creation property list identifier
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  February 28, 2001
+
+

SOURCE

+
  SUBROUTINE h5dget_create_plist_f(dataset_id, plist_id, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: dataset_id   ! Dataset identifier
+    INTEGER(HID_T), INTENT(OUT) :: plist_id    ! Dataset creation
+                                               ! property list identifier
+    INTEGER, INTENT(OUT) :: hdferr             ! Error code
+
+ +
+ +

h5dget_space_f

+ +

[ Top ] [ H5D ] [ Subroutines ]

+

NAME

+
  h5dget_space_f
+
+

PURPOSE

+
  Returns an identifier for a copy of the dataspace for a
+  dataset.
+
+

INPUTS

+
  dataset_id    - dataset identifier
+
+

OUTPUTS

+
  dataspace_id  - dataspace identifier
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  February 28, 2001
+
+

SOURCE

+
  SUBROUTINE h5dget_space_f(dataset_id, dataspace_id, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: dataset_id      ! Dataset identifier
+    INTEGER(HID_T), INTENT(OUT) :: dataspace_id   ! Dataspace identifier
+    INTEGER, INTENT(OUT) :: hdferr                ! Error code
+
+ +
+ +

h5dget_space_status_f

+ +

[ Top ] [ H5D ] [ Subroutines ]

+

NAME

+
  h5dget_space_status_f
+
+

PURPOSE

+
  Returns the status of data space allocation.
+
+

INPUTS

+
  dset_id       - dataset identifier
+
+

OUTPUTS

+
  flag          - status; may have one of the following values:
+                   H5D_SPACE_STS_ERROR_F
+                   H5D_SPACE_STS_NOT_ALLOCATED_F
+                   H5D_SPACE_STS_PART_ALLOCATED_F
+                   H5D_SPACE_STS_ALLOCATED_F
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  March 12, 2003
+
+

SOURCE

+
  SUBROUTINE h5dget_space_status_f(dset_id, flag, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: dset_id  ! Dataspace identifier
+    INTEGER, INTENT(IN)        :: flag     ! Memory buffer to fill in
+    INTEGER, INTENT(OUT)       :: hdferr   ! Error code
+
+ +
+ +

h5dget_storage_size_f

+ +

[ Top ] [ H5D ] [ Subroutines ]

+

NAME

+
  h5dget_storage_size_f
+
+

PURPOSE

+
  Returns the amount of storage requires by a dataset
+
+

INPUTS

+
  dataset_id    - dataset identifier
+
+

OUTPUTS

+
  size          - datastorage size
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  October 15, 2002
+
+

SOURCE

+
  SUBROUTINE h5dget_storage_size_f(dataset_id, size, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: dataset_id ! Dataset identifier
+    INTEGER(HSIZE_T),  INTENT(OUT)  :: size  ! Amount of storage
+                                             ! allocated for dataset
+    INTEGER, INTENT(OUT) :: hdferr           ! Error code
+
+ +
+ +

h5dget_type_f

+ +

[ Top ] [ H5D ] [ Subroutines ]

+

NAME

+
  h5dget_type_f
+
+

PURPOSE

+
  Returns an identifier for a copy of the datatype for a
+  dataset.
+
+

INPUTS

+
  dataset_id    - dataset identifier
+
+

OUTPUTS

+
  datatype_id   - dataspace identifier
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  February 28, 2001
+
+

NOTES

+

SOURCE

+
  SUBROUTINE h5dget_type_f(dataset_id, datatype_id, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: dataset_id      ! Dataset identifier
+    INTEGER(HID_T), INTENT(OUT) :: datatype_id    ! Datatype identifier
+    INTEGER, INTENT(OUT) :: hdferr                ! Error code
+
+ +
+ +

h5dopen_f

+ +

[ Top ] [ H5D ] [ Subroutines ]

+

NAME

+
  h5dopen_f
+
+

PURPOSE

+
  Opens an existing dataset.
+
+

INPUTS

+
  loc_id        - file or group identifier
+  name          - dataset name
+
+

OUTPUTS

+
  dset_id       - dataset identifier
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

OPTIONAL PARAMETERS

+
  dapl_id       - Dataset access property list
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  -Explicit Fortran interfaces were added for
+   called C functions (it is needed for Windows
+   port).  February 28, 2001
+
+  -Added 1.8 (optional) parameter dapl_id
+   February, 2008, M. Scot Breitenfeld
+
+

SOURCE

+
  SUBROUTINE h5dopen_f(loc_id, name, dset_id, hdferr, dapl_id)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: loc_id   ! File or group identifier
+    CHARACTER(LEN=*), INTENT(IN) :: name   ! Name of the dataset
+    INTEGER(HID_T), INTENT(OUT) :: dset_id ! Dataset identifier
+    INTEGER, INTENT(OUT) :: hdferr         ! Error code
+    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: dapl_id ! Dataset access property list
+
+ +
+ +

h5dset_extent

+ +

[ Top ] [ H5D ] [ Subroutines ]

+

NAME

+
  h5dset_extent (instead of obsolete name: h5dextend_f)
+
+

PURPOSE

+
  Extends a dataset with unlimited dimension.
+
+

INPUTS

+
  dataset_id    - dataset identifier
+  size          - array containing the new magnitude of
+                  each dimension
+
+

OUTPUTS

+
  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  February 28, 2001
+
+  Changed name from the now obsolete h5dextend_f
+  to h5dset_extent_f. Provided interface to old name
+  for backward compatability. -MSB- March 14, 2008
+
+

SOURCE

+
  SUBROUTINE h5dset_extent_f(dataset_id, size, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: dataset_id      ! Dataset identifier
+    INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN)  :: size
+    ! Array containing
+    ! dimensions' sizes
+    INTEGER, INTENT(OUT) :: hdferr                ! Error code
+
+ +
+ +

h5dvlen_get_max_len_f

+ +

[ Top ] [ H5D ] [ Subroutines ]

+

NAME

+
  h5dvlen_get_max_len_f
+
+

PURPOSE

+
  Returns maximum length of the VL array elements
+
+

INPUTS

+
  dataset_id    - dataset identifier
+  type_id       - datatype identifier
+  space_id      - dataspace identifier
+
+

OUTPUTS

+
  size          - buffer size
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

OPTIONAL PARAMETERS

+
  NONE
+
+

AUTHOR

+
  Elena Pourmal
+  October 15, 2002
+
+

SOURCE

+
  SUBROUTINE h5dvlen_get_max_len_f(dataset_id, type_id, space_id, len,  hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: dataset_id      ! Dataset identifier
+    INTEGER(HID_T), INTENT(IN) :: type_id         ! Datatype identifier
+    INTEGER(HID_T), INTENT(IN) :: space_id        ! Dataspace identifier
+    INTEGER(SIZE_T),  INTENT(OUT)  :: len         ! Maximum length of the element
+    INTEGER, INTENT(OUT) :: hdferr                ! Error code
+
+ +
+ + + diff --git a/fortran/doc/DevelGuide/src/H5Ef_c.html b/fortran/doc/DevelGuide/src/H5Ef_c.html new file mode 100644 index 0000000..79b7914 --- /dev/null +++ b/fortran/doc/DevelGuide/src/H5Ef_c.html @@ -0,0 +1,41 @@ + + + + + + + +./src/H5Ef.c + + + + + +
+
+ +

H5Ef

+ +

[ Top ] [ Modules ]

+

PURPOSE

+
   This file contains C stubs for H5E Fortran APIs
+
+ +
+ + + diff --git a/fortran/doc/DevelGuide/src/H5Eff_f90.html b/fortran/doc/DevelGuide/src/H5Eff_f90.html new file mode 100644 index 0000000..7eb95e6 --- /dev/null +++ b/fortran/doc/DevelGuide/src/H5Eff_f90.html @@ -0,0 +1,197 @@ + + + + + + + +./src/H5Eff.f90 + + + + + +
+
+ +

H5E

+ +

[ Top ] [ Modules ]

+

NAME

+
  MODULE H5E
+
+

FILE

+
  fortran/src/H5Eff.f90
+
+

PURPOSE

+
  This Module contains Fortran interfaces for H5E functions.
+
+

NOTES

+
                         *** IMPORTANT ***
+  If you add a new H5E function to the module you must add the function name
+  to the Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory.
+  This is needed for Windows based operating systems.
+
+ +
+ +

h5eclear_f

+ +

[ Top ] [ H5E ] [ Subroutines ]

+

NAME

+
  h5eclear_f
+
+

PURPOSE

+
  Clears the error stack for the current thread.
+
+

OUTPUTS

+
  hdferr        - Returns 0 if successful and -1 if fails
+
+

OPTIONAL PARAMETERS

+
  estack_id     - Error Stack id
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  April 6, 2001
+
+  Added optional error stack identifier in order to bring
+  the function in line with the h5eclear2 routine.
+  MSB, July 9, 2009
+
+

SOURCE

+
  SUBROUTINE h5eclear_f(hdferr, estack_id)
+    IMPLICIT NONE
+    INTEGER, INTENT(OUT) :: hdferr  ! Error code
+    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: estack_id
+
+ +
+ +

h5eget_major_f

+ +

[ Top ] [ H5E ] [ Subroutines ]

+

NAME

+
  h5eget_major_f
+
+

PURPOSE

+
  Returns a character string describing an error specified
+  by a major error number.
+
+

INPUTS

+
  error_no      - major error number
+
+

OUTPUTS

+
  name          - character string describing the error
+  namelen       - number of characters in the name buffer
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  April 6, 2001
+
+

SOURCE

+
  SUBROUTINE h5eget_major_f(error_no, name, namelen, hdferr)
+    INTEGER, INTENT(IN) :: error_no        ! Major error number
+    CHARACTER(LEN=*), INTENT(OUT) :: name  ! Character string describing
+                                           ! the error.
+    INTEGER(SIZE_T), INTENT(IN) :: namelen ! Anticipated number of characters
+                                           ! in name.
+    INTEGER, INTENT(OUT) :: hdferr         ! Error code
+
+ +
+ +

h5eget_minor_f

+ +

[ Top ] [ H5E ] [ Subroutines ]

+

NAME

+
  h5eget_minor_f
+
+

PURPOSE

+
  Returns a character string describing an error specified
+  by a minor error number.
+
+

INPUTS

+
  error_no      - minor error number
+
+

OUTPUTS

+
  name          - character string describing the error
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  April 6, 2001
+
+

SOURCE

+
  SUBROUTINE h5eget_minor_f(error_no, name, hdferr)
+    INTEGER, INTENT(IN) :: error_no       ! Major error number
+    CHARACTER(LEN=*), INTENT(OUT) :: name ! Character string describing
+                                          ! the error
+    INTEGER, INTENT(OUT) :: hdferr        ! Error code
+
+ +
+ +

h5eprint_f

+ +

[ Top ] [ H5E ] [ Subroutines ]

+

NAME

+
  h5eprint_f
+
+

PURPOSE

+
  Prints the error stack in a default manner.
+
+

OUTPUTS

+
  hdferr        - Returns 0 if successful and -1 if fails
+
+

OPTIONAL PARAMETERS

+
  name          - name of the file that contains print output
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  April 6, 2001
+
+

SOURCE

+
  SUBROUTINE h5eprint_f(hdferr, name)
+    CHARACTER(LEN=*), OPTIONAL, INTENT(IN) :: name ! File name
+    INTEGER, INTENT(OUT) :: hdferr          ! Error code
+
+ +
+ + + diff --git a/fortran/doc/DevelGuide/src/H5FDmpiof_c.html b/fortran/doc/DevelGuide/src/H5FDmpiof_c.html new file mode 100644 index 0000000..74143d2 --- /dev/null +++ b/fortran/doc/DevelGuide/src/H5FDmpiof_c.html @@ -0,0 +1,41 @@ + + + + + + + +./src/H5FDmpiof.c + + + + + +
+
+ +

H5FDmpiof

+ +

[ Top ] [ Modules ]

+

PURPOSE

+
   This file contains C stubs for Parallel Fortran APIs
+
+ +
+ + + diff --git a/fortran/doc/DevelGuide/src/H5FDmpioff_f90.html b/fortran/doc/DevelGuide/src/H5FDmpioff_f90.html new file mode 100644 index 0000000..473b5db --- /dev/null +++ b/fortran/doc/DevelGuide/src/H5FDmpioff_f90.html @@ -0,0 +1,253 @@ + + + + + + + +./src/H5FDmpioff.f90 + + + + + +
+
+ +

H5FDMPIO

+ +

[ Top ] [ Modules ]

+

NAME

+
  MODULE H5FDMPIO
+
+

PURPOSE

+
  This file contains Fortran interfaces for H5P functions needed by
+  parallel MPI programs.
+
+

NOTES

+
                         *** IMPORTANT ***
+  If you add a new H5P function you must add the function name to the
+  Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory.
+  This is needed for Windows based operating systems.
+
+ +
+ +

h5pget_dxpl_mpio_f

+ +

[ Top ] [ H5FDMPIO ] [ Subroutines ]

+

NAME

+
  h5pget_dxpl_mpio_f
+
+

PURPOSE

+
  Returns the data transfer mode.
+
+

INPUTS

+
  prp_id        - data transfer property list identifier
+
+

OUTPUTS

+
  data_xfer_mode- transfer mode; possible values are:
+                     H5FD_MPIO_INDEPENDENT_F
+                     H5FD_MPIO_COLLECTIVE_F
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  November, 2000
+
+

SOURCE

+
  SUBROUTINE h5pget_dxpl_mpio_f(prp_id, data_xfer_mode, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id   ! Property list identifier
+    INTEGER, INTENT(OUT) :: data_xfer_mode ! Data transfer mode. Possible values are:
+                                           ! H5FD_MPIO_INDEPENDENT_F
+                                           ! H5FD_MPIO_COLLECTIVE_F
+    INTEGER, INTENT(OUT) :: hdferr         ! Error code
+
+ +
+ +

h5pget_fapl_mpio_f

+ +

[ Top ] [ H5FDMPIO ] [ Subroutines ]

+

NAME

+
  h5pget_fapl_mpio_f
+
+

PURPOSE

+
  Returns MPI communicator information.
+
+

INPUTS

+
  prp_id        - file access property list identifier
+
+

OUTPUTS

+
  comm          - MPI-2 communicator
+  info          - MPI-2 info object
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  November, 2000
+
+

SOURCE

+
  SUBROUTINE h5pget_fapl_mpio_f(prp_id, comm, info, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
+    INTEGER, INTENT(OUT) :: comm ! buffer to return communicator
+    INTEGER, INTENT(OUT) :: info ! buffer to return info object
+                                 ! as defined in MPI_FILE_OPEN of MPI-2
+    INTEGER, INTENT(OUT) :: hdferr  ! Error code
+
+ +
+ +

h5pget_fapl_mpiposix_f

+ +

[ Top ] [ H5FDMPIO ] [ Subroutines ]

+

NAME

+
  h5pget_fapl_mpiposix_f
+
+

PURPOSE

+
  Returns MPI communicator information.
+
+

INPUTS

+
  prp_id        - file access property list identifier
+
+

OUTPUTS

+
  comm          - MPI-2 communicator
+  use_gpfs      - flag to use GPFS hints
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  May 6, 2003
+
+

SOURCE

+
  SUBROUTINE h5pget_fapl_mpiposix_f(prp_id, comm, use_gpfs, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
+    INTEGER, INTENT(OUT) :: comm         ! Buffer to return communicator
+    LOGICAL, INTENT(OUT) :: use_gpfs
+    INTEGER, INTENT(OUT) :: hdferr       ! Error code
+
+ +
+ +

h5pset_dxpl_mpio_f

+ +

[ Top ] [ H5FDMPIO ] [ Subroutines ]

+

NAME

+
  h5pset_dxpl_mpio_f
+
+

PURPOSE

+
  Sets data transfer mode.
+
+

INPUTS

+
  prp_id         - data transfer property list identifier
+  data_xfer_mode - transfer mode; possible values are:
+                     H5FD_MPIO_INDEPENDENT_F
+                     H5FD_MPIO_COLLECTIVE_F
+
+

OUTPUTS

+
  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  November, 2000
+
+

SOURCE

+
  SUBROUTINE h5pset_dxpl_mpio_f(prp_id, data_xfer_mode, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id  ! Property list identifier
+    INTEGER, INTENT(IN) :: data_xfer_mode ! Data transfer mode. Possible values are:
+                                          ! H5FD_MPIO_INDEPENDENT_F
+                                          ! H5FD_MPIO_COLLECTIVE_F
+    INTEGER, INTENT(OUT) :: hdferr        ! Error code
+
+ +
+ +

h5pset_fapl_mpio_f

+ +

[ Top ] [ H5FDMPIO ] [ Subroutines ]

+

NAME

+
  h5pset_fapl_mpio_f
+
+

PURPOSE

+
  Stores MPI IO communicator information to the file
+  access property list.
+
+

INPUTS

+
  prp_id        - file access property list identifier
+  comm          - MPI-2 communicator
+  info          - MPI-2 info object
+
+

OUTPUTS

+
  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  November, 2000
+
+

SOURCE

+
  SUBROUTINE h5pset_fapl_mpio_f(prp_id, comm, info, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
+    INTEGER, INTENT(IN) :: comm ! MPI communicator to be used for file open
+                                ! as defined in MPI_FILE_OPEN of MPI-2
+    INTEGER, INTENT(IN) :: info ! MPI info object to be used for file open
+                                ! as defined in MPI_FILE_OPEN of MPI-2
+    INTEGER, INTENT(OUT) :: hdferr ! Error code
+
+ +
+ +

h5pset_fapl_mpiposix_f

+ +

[ Top ] [ H5FDMPIO ] [ Subroutines ]

+

NAME

+
  h5pset_fapl_mpiposix_f
+
+

PURPOSE

+
  Stores MPI IO communicator information to the file
+  access property list.
+
+

INPUTS

+
  prp_id        - file access property list identifier
+  comm          - MPI-2 communicator
+  use_gpfs      - logical flag to use the GPFS hints
+
+

OUTPUTS

+
  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  May 6, 2003
+
+

SOURCE

+
  SUBROUTINE h5pset_fapl_mpiposix_f(prp_id, comm, use_gpfs, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
+    INTEGER, INTENT(IN) :: comm ! MPI communicator to be used for file open
+                                ! as defined in MPI_FILE_OPEN of MPI-2
+    LOGICAL, INTENT(IN) :: use_gpfs
+    INTEGER, INTENT(OUT) :: hdferr  ! Error code
+
+ +
+ + + diff --git a/fortran/doc/DevelGuide/src/H5Ff_c.html b/fortran/doc/DevelGuide/src/H5Ff_c.html new file mode 100644 index 0000000..c91a62d --- /dev/null +++ b/fortran/doc/DevelGuide/src/H5Ff_c.html @@ -0,0 +1,41 @@ + + + + + + + +./src/H5Ff.c + + + + + +
+
+ +

H5Ff

+ +

[ Top ] [ Modules ]

+

PURPOSE

+
   This file contains C stubs for H5F Fortran APIs
+
+ +
+ + + diff --git a/fortran/doc/DevelGuide/src/H5Fff_f90.html b/fortran/doc/DevelGuide/src/H5Fff_f90.html new file mode 100644 index 0000000..b0164c9 --- /dev/null +++ b/fortran/doc/DevelGuide/src/H5Fff_f90.html @@ -0,0 +1,653 @@ + + + + + + + +./src/H5Fff.f90 + + + + + +
+
+ +

H5F

+ +

[ Top ] [ Modules ]

+

NAME

+
  MODULE H5F
+
+

FILE

+
  H5Fff.f90
+
+

PURPOSE

+
  This file contains Fortran interfaces for H5F functions.
+
+

NOTES

+
                         *** IMPORTANT ***
+  If you add a new H5F function you must add the function name to the
+  Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory.
+  This is needed for Windows based operating systems.
+
+ +
+ +

h5fclose_f

+ +

[ Top ] [ H5F ] [ Subroutines ]

+

NAME

+
  h5fclose_f
+
+

PURPOSE

+
  Closes HDF5 file.
+
+

INPUTS

+
  file_id       - file identifier
+
+

OUTPUTS

+
  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  February 28, 2001
+
+

SOURCE

+
  SUBROUTINE h5fclose_f(file_id, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: file_id ! File identifier
+    INTEGER, INTENT(OUT) :: hdferr        ! Error code
+
+ +
+ +

h5fcreate_f

+ +

[ Top ] [ H5F ] [ Subroutines ]

+

NAME

+
  h5fcreate_f
+
+

PURPOSE

+
  Creates HDF5 files.
+
+

INPUTS

+
  name          - name of the file to create
+  access_flags  - File access flags. Allowable values are:
+                   H5F_ACC_TRUNC_F
+                   H5F_ACC_EXCL_F
+
+

OUTPUTS

+
  file_id       - file identifier
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

OPTIONAL PARAMETERS

+
  creation_prp  - file creation property list identifier
+  access_prp    - file access property list identifier
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  February 28, 2001
+
+

SOURCE

+
  SUBROUTINE h5fcreate_f(name, access_flags, file_id, hdferr, &
+       creation_prp, access_prp)
+    IMPLICIT NONE
+    CHARACTER(LEN=*), INTENT(IN) :: name   ! Name of the file
+    INTEGER, INTENT(IN) :: access_flags    ! File access flags
+    INTEGER(HID_T), INTENT(OUT) :: file_id ! File identifier
+    INTEGER, INTENT(OUT) :: hdferr         ! Error code
+    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: creation_prp
+                                           ! File creation propertly
+                                           ! list identifier
+    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: access_prp
+                                           ! File access property list
+                                           ! identifier
+
+ +
+ +

h5fflush_f

+ +

[ Top ] [ H5F ] [ Subroutines ]

+

NAME

+
  h5fflush_f
+
+

PURPOSE

+
  Flushes all buffers associated WITH a file to disk
+
+

INPUTS

+
  object_id     - identifier of object used to identify the file.
+  scope         - specifies the scope of the flushing action.
+                  Possible values are:
+                    H5F_SCOPE_GLOBAL_F
+                    H5F_SCOPE_LOCAL_F
+
+

OUTPUTS

+
  hdferr        - Returns 0 if successful and -1 if fails
+
+

OPTIONAL PARAMETERS

+
  creation_prp  - file creation property list identifier
+  access_prp    - file access property list identifier
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  February 28, 2001
+
+

SOURCE

+
  SUBROUTINE h5fflush_f(object_id, scope, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: object_id !identifier for any object
+                                            !associate with a file,
+                                            !including the file itself,
+                                            !a dataset, a group, an
+                                            !attribute, or a named
+                                            !data type
+
+    INTEGER, INTENT(IN) :: scope            !scope of the flushing
+                                            !action, possible values
+                                            !are: H5F_SCOPE_GLOBAL_F
+                                            ! which flushes the entire
+                                            !virtual file,
+                                            !and H5F_SCOPE_LOCAL_F
+                                            !which flushes only the
+                                            !specified file.
+
+    INTEGER, INTENT(OUT) :: hdferr          ! Error code
+
+ +
+ +

h5fget_access_plist_f

+ +

[ Top ] [ H5F ] [ Subroutines ]

+

NAME

+
  h5fget_access_plist_f
+
+

PURPOSE

+
  Returns a file access property list identifier.
+
+

INPUTS

+
  file_id       - identifier of a file to creation property list of
+
+

OUTPUTS

+
  access_id     - access property list identifier
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  February 28, 2001
+
+

SOURCE

+
  SUBROUTINE h5fget_access_plist_f(file_id, access_id, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: file_id      ! File identifier
+    INTEGER(HID_T), INTENT(OUT) :: access_id   ! File access property
+                                               ! list identifier
+    INTEGER, INTENT(OUT) :: hdferr             ! Error code
+
+ +
+ +

h5fget_create_plist_f

+ +

[ Top ] [ H5F ] [ Subroutines ]

+

NAME

+
  h5fget_create_plist_f
+
+

PURPOSE

+
  Returns a file creation property list identifier.
+
+

INPUTS

+
  file_id       - identifier of a file to creation property list of
+
+

OUTPUTS

+
  prop_id       - creation property list identifier
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  February 28, 2001
+
+

SOURCE

+
  SUBROUTINE h5fget_create_plist_f(file_id, prop_id, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: file_id    ! File identifier
+    INTEGER(HID_T), INTENT(OUT) :: prop_id   ! File creation property
+                                             ! list identifier
+    INTEGER, INTENT(OUT) :: hdferr           ! Error code
+
+ +
+ +

h5fget_filesize_f

+ +

[ Top ] [ H5F ] [ Subroutines ]

+

NAME

+
  h5fget_filesize_f
+
+

PURPOSE

+
  Retrieves the file size of the HDF5 file.
+
+

INPUTS

+
  file_id       - file identifier
+
+

OUTPUTS

+
  size          - file size
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  July 7, 2004
+
+

SOURCE

+
  SUBROUTINE h5fget_filesize_f(file_id, size, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: file_id  ! file identifier
+    INTEGER(HSIZE_T), INTENT(OUT) :: size  ! Size of the file
+    INTEGER, INTENT(OUT) :: hdferr         ! Error code: 0 on success,
+                                           !     -1 if fail
+
+ +
+ +

h5fget_freespace_f

+ +

[ Top ] [ H5F ] [ Subroutines ]

+

NAME

+
  h5fget_freespace_f
+
+

PURPOSE

+
  Get amount of free space within a file
+
+

INPUTS

+
  file_id       - file identifier
+
+

OUTPUTS

+
  free_space    - amount of free space in file
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Quincey Koziol
+  October 7, 2003
+
+

SOURCE

+
  SUBROUTINE h5fget_freespace_f(file_id, free_space, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: file_id ! File identifier
+    INTEGER(HSSIZE_T), INTENT(OUT) :: free_space
+                                          ! amount of free space in file
+    INTEGER, INTENT(OUT) :: hdferr        ! Error code
+
+ +
+ +

h5fget_name_f

+ +

[ Top ] [ H5F ] [ Subroutines ]

+

NAME

+
  h5fget_name_f
+
+

PURPOSE

+
  Gets the name of the file from the object identifier
+
+

INPUTS

+
  obj_id        - object identifier
+
+

OUTPUTS

+
  buf           - buffer to store the read name
+  size          - actual size of the name
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  July 6, 2004
+
+

SOURCE

+
  SUBROUTINE h5fget_name_f(obj_id, buf, size, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: obj_id   ! Object identifier
+    CHARACTER(LEN=*), INTENT(INOUT) :: buf
+                                           ! Buffer to hold file name
+    INTEGER(SIZE_T), INTENT(OUT) :: size   ! Size of the file name
+    INTEGER, INTENT(OUT) :: hdferr         ! Error code: 0 on success,
+                                           !     -1 if fail
+
+ +
+ +

h5fget_obj_count_f

+ +

[ Top ] [ H5F ] [ Subroutines ]

+

NAME

+
  h5fget_obj_count_f
+
+

PURPOSE

+
  Gets number of the objects open within a file
+
+

INPUTS

+
  file_id       - file identifier
+  obj_type      - type of the object; possible values are:
+                    H5F_OBJ_FILE_F
+                    H5F_OBJ_DATASET_F
+                    H5F_OBJ_GROUP_F
+                    H5F_OBJ_DATATYPE_F
+                    H5F_OBJ_ALL_F
+
+

OUTPUTS

+
  obj_count     - number of open objects
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  September 30, 2002
+
+

HISTORY

+
  Changed the type of obj_count to INTEGER(SIZE_T)
+  September 25, 2008 EIP
+
+

SOURCE

+
  SUBROUTINE h5fget_obj_count_f(file_id, obj_type, obj_count, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: file_id ! File identifier
+    INTEGER, INTENT(IN)  :: obj_type      ! Object type
+    INTEGER(SIZE_T), INTENT(OUT) :: obj_count
+                                          ! Number of open objects
+    INTEGER, INTENT(OUT) :: hdferr        ! Error code
+
+ +
+ +

h5fget_obj_ids_f

+ +

[ Top ] [ H5F ] [ Subroutines ]

+

NAME

+
  h5fget_obj_ids_f
+
+

PURPOSE

+
  Get list of open objects identifiers within a file
+
+

INPUTS

+
  file_id       - file identifier
+  obj_type      - type of the object; possible values are:
+                    H5F_OBJ_FILE_F
+                    H5F_OBJ_DATASET_F
+                    H5F_OBJ_GROUP_F
+                    H5F_OBJ_DATATYPE_F
+                    H5F_OBJ_ALL_F
+
+

OUTPUTS

+
  obj_ids       - array of open object identifiers
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

OPTIONAL PARAMETERS

+
  num_objs      - number of open objects
+
+

AUTHOR

+
  Elena Pourmal
+  September 30, 2002
+
+

HISTORY

+
  Added optional parameter num_objs for number of open objects
+  of the specified type and changed type of max_obj to
+  INTEGER(SIZE_T)
+  September 25, 2008 EIP
+
+

SOURCE

+
  SUBROUTINE h5fget_obj_ids_f(file_id, obj_type, max_objs, obj_ids, hdferr, num_objs)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: file_id      ! File identifier
+    INTEGER, INTENT(IN)  :: obj_type           ! Object type
+    INTEGER(SIZE_T), INTENT(IN)  :: max_objs   ! Maximum # of objects to retrieve
+    INTEGER(HID_T), DIMENSION(*), INTENT(INOUT) :: obj_ids
+                                               ! Array of open objects iidentifiers
+    INTEGER, INTENT(OUT) :: hdferr             ! Error code
+    INTEGER(SIZE_T), INTENT(OUT), OPTIONAL :: num_objs ! number of open objects
+
+ +
+ +

h5fis_hdf5_f

+ +

[ Top ] [ H5F ] [ Subroutines ]

+

NAME

+
  h5fis_hdf5_f
+
+

PURPOSE

+
  Determines whether a file is in the HDF5 format.
+
+

INPUTS

+
  name          - name of the file to check
+
+

OUTPUTS

+
  status        - indicates if file is and HDF5 file
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  February 28, 2001
+
+

SOURCE

+
  SUBROUTINE h5fis_hdf5_f(name, status, hdferr)
+    IMPLICIT NONE
+    CHARACTER(LEN=*), INTENT(IN) :: name   ! Name of the file
+    LOGICAL, INTENT(OUT) :: status         ! Indicates if file
+                                           ! is an HDF5 file
+    INTEGER, INTENT(OUT) :: hdferr         ! Error code
+
+ +
+ +

h5fmount_f

+ +

[ Top ] [ H5F ] [ Subroutines ]

+

NAME

+
  h5fmount_f
+
+

PURPOSE

+
  Mounts a file.
+
+

INPUTS

+
  loc_id        - the identifier for of file or group in
+                  which name is defined
+  name          - the name of the group onto which the file
+                  specified by child_id is to be mounted.
+  child_id      - the identifier of the file to be mounted.
+
+

OUTPUTS

+
  hdferr        - Returns 0 if successful and -1 if fails
+
+

OPTIONAL PARAMETERS

+
  access_prp    - the identifier of the property list to be used
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  February 28, 2001
+
+

SOURCE

+
  SUBROUTINE h5fmount_f(loc_id, name, child_id, hdferr, access_prp)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: loc_id   ! Identifier for file or group
+                                           ! in which dsetname is defined
+    CHARACTER(LEN=*), INTENT(IN) :: name   ! Name of the group
+    INTEGER(HID_T), INTENT(IN) :: child_id ! File identifier for the
+                                           ! file to be mounted
+    INTEGER, INTENT(OUT) :: hdferr         ! Error code
+    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: access_prp
+                                           ! File access property list
+                                           ! identifier
+
+ +
+ +

h5fopen_f

+ +

[ Top ] [ H5F ] [ Subroutines ]

+

NAME

+
  h5fopen_f
+
+

PURPOSE

+
  Opens HDF5 file.
+
+

INPUTS

+
  name          - name of the file to acecss
+  access_flags  - File access flags. Allowable values are:
+                   H5F_ACC_RDWR_F
+                   H5F_ACC_RDONLY_F
+
+

OUTPUTS

+
  file_id       - file identifier
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

OPTIONAL PARAMETERS

+
  access_prp    - file access property list identifier
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  February 28, 2001
+
+

SOURCE

+
  SUBROUTINE h5fopen_f(name, access_flags, file_id, hdferr, access_prp)
+    IMPLICIT NONE
+    CHARACTER(LEN=*), INTENT(IN) :: name   ! Name of the file
+    INTEGER, INTENT(IN) :: access_flags    ! File access flags
+    INTEGER(HID_T), INTENT(OUT) :: file_id ! File identifier
+    INTEGER, INTENT(OUT) :: hdferr         ! Error code
+    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: access_prp
+                                           ! File access property list
+                                           ! identifier
+
+ +
+ +

h5freopen_f

+ +

[ Top ] [ H5F ] [ Subroutines ]

+

NAME

+
  h5freopen_f
+
+

PURPOSE

+
  Reopens HDF5 file.
+
+

INPUTS

+
  file_id       - identifier of a file for which an
+                  additional identifier is required
+
+

OUTPUTS

+
  ret_file_id   - new file identifier
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  February 28, 2001
+
+

SOURCE

+
  SUBROUTINE h5freopen_f(file_id, ret_file_id, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: file_id      ! File identifier
+    INTEGER(HID_T), INTENT(OUT) :: ret_file_id ! New File identifier
+    INTEGER, INTENT(OUT) :: hdferr             ! Error code
+
+ +
+ +

h5funmount_f

+ +

[ Top ] [ H5F ] [ Subroutines ]

+

NAME

+
  h5funmount_f
+
+

PURPOSE

+
  Unmounts a file.
+
+

INPUTS

+
  loc_id        - the identifier for of file or group in
+                  which name is defined
+  name          - the name of the mount point
+
+

OUTPUTS

+
  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  February 28, 2001
+
+

SOURCE

+
  SUBROUTINE h5funmount_f(loc_id, name, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: loc_id   ! Identifier for file or group
+                                           ! at which the specified file
+                                           ! is to be unmounted
+    CHARACTER(LEN=*), INTENT(IN) :: name   ! Name of the mount point
+    INTEGER, INTENT(OUT) :: hdferr         ! Error code
+
+ +
+ + + diff --git a/fortran/doc/DevelGuide/src/H5Gf_c.html b/fortran/doc/DevelGuide/src/H5Gf_c.html new file mode 100644 index 0000000..a71f0e8 --- /dev/null +++ b/fortran/doc/DevelGuide/src/H5Gf_c.html @@ -0,0 +1,41 @@ + + + + + + + +./src/H5Gf.c + + + + + +
+
+ +

H5Gf

+ +

[ Top ] [ Modules ]

+

PURPOSE

+
   This file contains C stubs for H5G Fortran APIs
+
+ +
+ + + diff --git a/fortran/doc/DevelGuide/src/H5Gff_f90.html b/fortran/doc/DevelGuide/src/H5Gff_f90.html new file mode 100644 index 0000000..74ec2f4 --- /dev/null +++ b/fortran/doc/DevelGuide/src/H5Gff_f90.html @@ -0,0 +1,840 @@ + + + + + + + +./src/H5Gff.f90 + + + + + +
+
+ +

H5G

+ +

[ Top ] [ Modules ]

+

NAME

+
  MODULE H5G
+
+

FILE

+
  fortran/src/H5Gff.f90
+
+

PURPOSE

+
  This file contains Fortran interfaces for H5G functions.
+
+

NOTES

+
                         *** IMPORTANT ***
+  If you add a new H5G function you must add the function name to the
+  Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory.
+  This is needed for Windows based operating systems.
+
+ +
+ +

h5gclose_f

+ +

[ Top ] [ H5G ] [ Subroutines ]

+

NAME

+
  h5gclose_f
+
+

PURPOSE

+
  Closes the specified group.
+
+

INPUTS

+
  grp_id        - group identifier
+
+

OUTPUTS

+
  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 5, 2001
+
+

SOURCE

+
  SUBROUTINE h5gclose_f(grp_id, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: grp_id  ! Group identifier
+    INTEGER, INTENT(OUT) :: hdferr        ! Error code
+
+ +
+ +

H5Gcreate_anon_f

+ +

[ Top ] [ H5G ] [ Subroutines ]

+

NAME

+
  H5Gcreate_anon_f
+
+

PURPOSE

+
  Creates a new empty group without linking it into the file structure.
+
+

INPUTS

+
  loc_id        - Location identifier
+
+

OUTPUTS

+
  grp_id        - group identifier
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

OPTIONAL PARAMETERS

+
  gcpl_id       - Group creation property list identifier
+  gapl_id       - Group access property list identifier
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  February 15, 2008
+
+

SOURCE

+
  SUBROUTINE h5Gcreate_anon_f(loc_id, grp_id, hdferr, gcpl_id, gapl_id)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: loc_id   ! File or group identifier
+    INTEGER(HID_T), INTENT(OUT) :: grp_id  ! Group identifier
+    INTEGER, INTENT(OUT) :: hdferr         ! Error code
+    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: gcpl_id  ! Property list for group creation
+    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: gapl_id  ! Property list for group access
+
+ +
+ +

h5gcreate_f

+ +

[ Top ] [ H5G ] [ Subroutines ]

+

NAME

+
  h5gcreate_f
+
+

PURPOSE

+
  Creates a new group.
+
+

INPUTS

+
  loc_id        - location identifier
+  name          - group name at the specified location
+
+

OUTPUTS

+
  grp_id        - group identifier
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

OPTIONAL PARAMETERS

+
  size_hint     - a parameter indicating the number of bytes to
+                  reserve for the names that will appear in the group
+  lcpl_id       - Property list for link creation
+  gcpl_id       - Property list for group creation
+  gapl_id       - Property list for group access
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 5, 2001
+
+  Added additional optional paramaters in 1.8
+  MSB - February 27, 2008
+
+

SOURCE

+
  SUBROUTINE h5gcreate_f(loc_id, name, grp_id, hdferr, size_hint, lcpl_id, gcpl_id, gapl_id)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: loc_id   ! File or group identifier
+    CHARACTER(LEN=*), INTENT(IN) :: name   ! Name of the group
+    INTEGER(HID_T), INTENT(OUT) :: grp_id  ! Group identifier
+    INTEGER, INTENT(OUT) :: hdferr         ! Error code
+    INTEGER(SIZE_T), OPTIONAL, INTENT(IN) :: size_hint
+                                           ! Parameter indicating
+                                           ! the number of bytes
+                                           ! to reserve for the
+                                           ! names that will appear
+                                           ! in the group. Set to OBJECT_NAMELEN_DEFAULT_F
+                                           ! if using any of the optional
+                                           ! parameters lcpl_id, gcpl_id, and/or gapl_id when not
+                                           ! using keywords in specifying the optional parameters
+    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lcpl_id  ! Property list for link creation
+    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: gcpl_id  ! Property list for group creation
+    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: gapl_id  ! Property list for group access
+
+ +
+ +

h5gget_comment_f

+ +

[ Top ] [ H5G ] [ Subroutines ]

+

NAME

+
  h5gget_comment_f
+
+

PURPOSE

+
  Retrieves comment for specified object.
+
+

INPUTS

+
  loc_id        - location identifier
+  name          - name of the object at specified location
+  size          - size of the buffer required to hold comment
+
+

OUTPUTS

+
  buffer        - buffer to hold object's comment
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 5, 2001
+
+

SOURCE

+
  SUBROUTINE h5gget_comment_f(loc_id, name, size, buffer, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: loc_id   ! File or group identifier
+    CHARACTER(LEN=*), INTENT(IN) :: name   ! Current name of an object
+    INTEGER(SIZE_T), INTENT(IN) :: size    ! Maximum number of buffer
+    CHARACTER(LEN=size), INTENT(OUT) :: buffer
+                                           ! Buffer to hold a comment
+    INTEGER, INTENT(OUT) :: hdferr         ! Error code
+
+ +
+ +

H5Gget_create_plist_f

+ +

[ Top ] [ H5G ] [ Subroutines ]

+

NAME

+
  H5Gget_create_plist_f
+
+

PURPOSE

+
  Gets a group creation property list identifier.
+
+

INPUTS

+
  grp_id        - group identifier
+
+

OUTPUTS

+
  gcpl_id       - Group creation property list identifier
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  February 15, 2008
+
+

SOURCE

+
  SUBROUTINE h5gget_create_plist_f(grp_id, gcpl_id, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN)  :: grp_id  ! Group identifier
+    INTEGER(HID_T), INTENT(OUT) :: gcpl_id ! Property list for group creation
+    INTEGER, INTENT(OUT) :: hdferr         ! Error code
+
+ +
+ +

h5gget_info_by_idx_f

+ +

[ Top ] [ H5G ] [ Subroutines ]

+

NAME

+
  h5gget_info_by_idx_f
+
+

PURPOSE

+
  Retrieves information about a group, according to the group’s position within an index.
+
+

INPUTS

+
  loc_id        - File or group identifier
+  group_name    - Name of group containing group for which information is to be retrieved
+  index_type    - Index type
+  order         - Order of the count in the index
+  n             - Position in the index of the group for which information is retrieved
+
+

OUTPUTS

+
  storage_type  - Type of storage for links in group
+                    H5G_STORAGE_TYPE_COMPACT: Compact storage
+                    H5G_STORAGE_TYPE_DENSE: Indexed storage
+                    H5G_STORAGE_TYPE_SYMBOL_TABLE: Symbol tables, the original HDF5 structure
+  nlinks        - Number of links in group
+  max_corder    - Current maximum creation order value for group
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

OPTIONAL PARAMETERS

+
  lapl_id       - Link access property list
+  mounted       - Whether group has a file mounted on it
+
+

NOTES

+
  In C the output is defined as a structure: H5G_info_t
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  February 18, 2008
+
+

HISTORY

+
  Added 'mounted' paramater
+  M. Scot Breitenfeld
+  July 16, 2008
+
+

SOURCE

+
  SUBROUTINE h5gget_info_by_idx_f(loc_id, group_name, index_type, order, n, &
+       storage_type, nlinks, max_corder, hdferr, lapl_id, mounted)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: loc_id       ! File or group identifier
+    CHARACTER(LEN=*), INTENT(IN) :: group_name ! Name of group containing group for which information is to be retrieved
+    INTEGER, INTENT(IN) :: index_type ! Index type
+    INTEGER, INTENT(IN) :: order      ! Order of the count in the index
+    INTEGER(HSIZE_T), INTENT(IN) :: n ! Position in the index of the group for which information is retrieved
+
+    INTEGER, INTENT(OUT) :: storage_type ! Type of storage for links in group:
+                                         !   H5G_STORAGE_TYPE_COMPACT_F: Compact storage
+                                         !   H5G_STORAGE_TYPE_DENSE_F: Indexed storage
+                                         !   H5G_STORAGE_TYPE_SYMBOL_TABLE_F: Symbol tables, the original HDF5 structure
+    INTEGER, INTENT(OUT) :: nlinks      ! Number of links in group
+    INTEGER, INTENT(OUT) :: max_corder  ! Current maximum creation order value for group
+    INTEGER, INTENT(OUT) :: hdferr      ! Error code:
+                                        ! 0 on success and -1 on failure
+    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list
+    LOGICAL, INTENT(OUT), OPTIONAL :: mounted       ! Whether group has a file mounted on it
+
+ +
+ +

h5gget_info_by_name_f

+ +

[ Top ] [ H5G ] [ Subroutines ]

+

NAME

+
  h5gget_info_by_name_f
+
+

PURPOSE

+
  Retrieves information about a group.
+
+

INPUTS

+
  loc_id        - File or group identifier
+  group_name    - Name of group containing group for which information is to be retrieved
+
+

OUTPUTS

+
  storage_type  - Type of storage for links in group
+                    H5G_STORAGE_TYPE_COMPACT: Compact storage
+                    H5G_STORAGE_TYPE_DENSE: Indexed storage
+                    H5G_STORAGE_TYPE_SYMBOL_TABLE: Symbol tables, the original HDF5 structure
+  nlinks        - Number of links in group
+  max_corder    - Current maximum creation order value for group
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

OPTIONAL PARAMETERS

+
  lapl_id       - Link access property list
+  mounted       - Whether group has a file mounted on it
+
+

NOTES

+
  In C the output is defined as a structure: H5G_info_t
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  February 18, 2008
+
+

HISTORY

+
  Added 'mounted' paramater
+  M. Scot Breitenfeld
+  July 16, 2008
+
+

SOURCE

+
  SUBROUTINE h5gget_info_by_name_f(loc_id, group_name, &
+       storage_type, nlinks, max_corder, hdferr, lapl_id, mounted)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: loc_id       ! File or group identifier
+    CHARACTER(LEN=*), INTENT(IN) :: group_name ! Name of group containing group for which information is to be retrieved
+
+    INTEGER, INTENT(OUT) :: storage_type  ! Type of storage for links in group:
+                                          ! H5G_STORAGE_TYPE_COMPACT_F: Compact storage
+                                          ! H5G_STORAGE_TYPE_DENSE_F: Indexed storage
+                                          ! H5G_STORAGE_TYPE_SYMBOL_TABLE_F: Symbol tables, the original HDF5 structure
+    INTEGER, INTENT(OUT) :: nlinks        ! Number of links in group
+    INTEGER, INTENT(OUT) :: max_corder    ! Current maximum creation order value for group
+    INTEGER, INTENT(OUT) :: hdferr        ! Error code:
+                                          !   0 on success and -1 on failure
+    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list
+    LOGICAL, INTENT(OUT), OPTIONAL :: mounted       ! Whether group has a file mounted on it
+
+ +
+ +

h5gget_info_f

+ +

[ Top ] [ H5G ] [ Subroutines ]

+

NAME

+
  h5gget_info_f
+
+

PURPOSE

+
  Retrieves information about a group
+
+

INPUTS

+
  group_id      - Group identifier
+
+

OUTPUTS

+
  storage_type  - Type of storage for links in group
+                    H5G_STORAGE_TYPE_COMPACT: Compact storage
+                    H5G_STORAGE_TYPE_DENSE: Indexed storage
+                    H5G_STORAGE_TYPE_SYMBOL_TABLE: Symbol tables, the original HDF5 structure
+  nlinks        - Number of links in group
+  max_corder    - Current maximum creation order value for group
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

OPTIONAL PARAMETERS

+
  mounted       - Whether group has a file mounted on it
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  February 15, 2008
+
+

NOTES

+
  In C the output is defined as a structure: H5G_info_t
+
+

HISTORY

+
  - Added 'mounted' paramater
+    M. Scot Breitenfeld
+    July 16, 2008
+
+

SOURCE

+
  SUBROUTINE h5gget_info_f(group_id, storage_type, nlinks, max_corder, hdferr, mounted)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: group_id ! Group identifier
+
+    INTEGER, INTENT(OUT) :: storage_type  ! Type of storage for links in group:
+                                          ! H5G_STORAGE_TYPE_COMPACT_F: Compact storage
+                                          ! H5G_STORAGE_TYPE_DENSE_F: Indexed storage
+                                          ! H5G_STORAGE_TYPE_SYMBOL_TABLE_F: Symbol tables, the original HDF5 structure
+    INTEGER, INTENT(OUT) :: nlinks        ! Number of links in group
+    INTEGER, INTENT(OUT) :: max_corder    ! Current maximum creation order value for group
+    INTEGER, INTENT(OUT) :: hdferr        ! Error code:
+                                          ! 0 on success and -1 on failure
+    LOGICAL, INTENT(OUT), OPTIONAL :: mounted  ! Whether group has a file mounted on it
+
+ +
+ +

h5gget_linkval_f

+ +

[ Top ] [ H5G ] [ Subroutines ]

+

NAME

+
  h5gget_linkval_f
+
+

PURPOSE

+
  Returns the name of the object that the symbolic link
+  points to.
+
+

INPUTS

+
  loc_id        - location identifier
+  name          - symbolic link to the object whose name
+                  is to be returned.
+  size          - maximum number of characters to be returned
+
+

OUTPUTS

+
  buffer        - a buffer to hold the name of the object
+  being sought
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 5, 2001
+
+

SOURCE

+
  SUBROUTINE h5gget_linkval_f(loc_id, name, size, buffer, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: loc_id   ! File or group identifier
+    CHARACTER(LEN=*), INTENT(IN) :: name   ! Current name of an object
+    INTEGER(SIZE_T), INTENT(IN) :: size    ! Maximum number of buffer
+    CHARACTER(LEN=size), INTENT(OUT) :: buffer
+                                           ! Buffer to hold a name of
+                                           ! the object symbolic link
+                                           ! points to
+    INTEGER, INTENT(OUT) :: hdferr         ! Error code
+
+ +
+ +

h5gget_obj_info_idx_f

+ +

[ Top ] [ H5G ] [ Subroutines ]

+

NAME

+
  h5gget_obj_info_idx_f
+
+

PURPOSE

+
  Returns name and type of the group member identified by
+  its index.
+
+

INPUTS

+
  loc_id        - location identifier
+  name          - name of the group at the specified location
+  idx           - object index (zero-based)
+
+

OUTPUTS

+
  obj_name      - object name
+  obj_type      - object type
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 5, 2001
+
+

SOURCE

+
  SUBROUTINE h5gget_obj_info_idx_f(loc_id, name, idx, &
+       obj_name, obj_type, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: loc_id   ! File or group identifier
+    CHARACTER(LEN=*), INTENT(IN) :: name   ! Name of the group
+    INTEGER, INTENT(IN) :: idx             ! Index of member object
+    CHARACTER(LEN=*), INTENT(OUT) :: obj_name   ! Name of the object
+    INTEGER, INTENT(OUT) :: obj_type       ! Object type
+    INTEGER, INTENT(OUT) :: hdferr         ! Error code
+
+ +
+ +

h5glink2_f

+ +

[ Top ] [ H5G ] [ Subroutines ]

+

NAME

+
  h5glink2_f
+
+

PURPOSE

+
  Creates a link of the specified type from new_name
+  to current_name. current_name and new_name are interpreted
+  releative to current and new location identifiers.
+
+

INPUTS

+
  cur_loc_id    - location identifier
+  cur_name      - name of the existing object if link is a
+                  hard link. Can be anything for the soft link.
+  link_type     - link type; possible values are:
+                    H5G_LINK_HARD_F (0)
+                    H5G_LINK_SOFT_F (1)
+  new_loc_id    - new location identifier
+  new_name      - new name for the object
+
+

OUTPUTS

+
  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  September 25, 2002
+
+

SOURCE

+
  SUBROUTINE h5glink2_f(cur_loc_id, cur_name, link_type, new_loc_id, &
+       new_name, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: cur_loc_id ! File or group identifier
+    CHARACTER(LEN=*), INTENT(IN) :: cur_name
+                                             ! Current name of an object
+    INTEGER, INTENT(IN) :: link_type         ! link type
+                                                 ! Possible values are:
+                                                 ! H5G_LINK_HARD_F (0) or
+                                                 ! H5G_LINK_SOFT_F (1)
+
+    INTEGER(HID_T), INTENT(IN) :: new_loc_id ! File or group identifier
+    CHARACTER(LEN=*), INTENT(IN) :: new_name ! New name of an object
+    INTEGER, INTENT(OUT) :: hdferr           ! Error code
+
+ +
+ +

h5glink_f

+ +

[ Top ] [ H5G ] [ Subroutines ]

+

NAME

+
  h5glink_f
+
+

PURPOSE

+
  Creates a link of the specified type from new_name
+  to current_name.
+
+

INPUTS

+
  loc_id        - location identifier
+  link_type     - link type; possible values are:
+                    H5G_LINK_HARD_F (0)
+                    H5G_LINK_SOFT_F (1)
+  current_name  - name of the existing object if link is a
+                  hard link. Can be anything for the soft link
+  new_name      - new name for the object
+
+

OUTPUTS

+
  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 5, 2001
+
+

SOURCE

+
  SUBROUTINE h5glink_f(loc_id, link_type, current_name, &
+       new_name, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: loc_id   ! File or group identifier
+    INTEGER, INTENT(IN) :: link_type       ! link type
+                                                   ! Possible values are:
+                                                   ! H5G_LINK_HARD_F (0) or
+                                                   ! H5G_LINK_SOFT_F (1)
+
+    CHARACTER(LEN=*), INTENT(IN) :: current_name
+                                                   ! Current name of an object
+    CHARACTER(LEN=*), INTENT(IN) :: new_name ! New name of an object
+    INTEGER, INTENT(OUT) :: hdferr         ! Error code
+
+ +
+ +

h5gmove2_f

+ +

[ Top ] [ H5G ] [ Subroutines ]

+

NAME

+
  h5gmove2_f
+
+

PURPOSE

+
  Renames an object within an HDF5 file.
+
+

INPUTS

+
  src_loc_id    - original location identifier
+  src_name      - object's name at specified original location
+  dst_loc_id    - original location identifier
+  dst_name      - object's new name
+
+

OUTPUTS

+
  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  September 25, 2002
+
+

SOURCE

+
  SUBROUTINE h5gmove2_f(src_loc_id, src_name, dst_loc_id, dst_name, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN)   :: src_loc_id  ! File or group identifier
+    CHARACTER(LEN=*), INTENT(IN) :: src_name    ! Original name of an object
+    INTEGER(HID_T), INTENT(IN)   :: dst_loc_id  ! File or group identifier
+    CHARACTER(LEN=*), INTENT(IN) :: dst_name    ! New name of an object
+    INTEGER, INTENT(OUT)         :: hdferr      ! Error code
+
+ +
+ +

h5gmove_f

+ +

[ Top ] [ H5G ] [ Subroutines ]

+

NAME

+
  h5gmove_f
+
+

PURPOSE

+
  Renames an object within an HDF5 file.
+
+

INPUTS

+
  loc_id        - location identifier
+  name          - object's name at specified location
+  new_name      - object's new name
+
+

OUTPUTS

+
  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 5, 2001
+
+

SOURCE

+
  SUBROUTINE h5gmove_f(loc_id, name, new_name, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: loc_id     ! File or group identifier
+    CHARACTER(LEN=*), INTENT(IN) :: name     ! Current name of an object
+    CHARACTER(LEN=*), INTENT(IN) :: new_name ! New name of an object
+    INTEGER, INTENT(OUT) :: hdferr           ! Error code
+
+ +
+ +

h5gn_members_f

+ +

[ Top ] [ H5G ] [ Subroutines ]

+

NAME

+
  h5gn_members_f
+
+

PURPOSE

+
  Returns the number of group members.
+
+

INPUTS

+
  loc_id        - location identifier
+  name          - name of the group at the specified location
+
+

OUTPUTS

+
  nmembers      - number of group members
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 5, 2001
+
+

SOURCE

+
  SUBROUTINE h5gn_members_f(loc_id, name, nmembers, hdferr)
+            IMPLICIT NONE
+            INTEGER(HID_T), INTENT(IN) :: loc_id   ! File or group identifier
+            CHARACTER(LEN=*), INTENT(IN) :: name   ! Name of the group
+            INTEGER, INTENT(OUT) :: nmembers       ! Number of members in the
+                                                   ! group
+            INTEGER, INTENT(OUT) :: hdferr         ! Error code
+
+ +
+ +

h5gopen_f

+ +

[ Top ] [ H5G ] [ Subroutines ]

+

NAME

+
  h5gopen_f
+
+

PURPOSE

+
  Opens an existing group.
+
+

INPUTS

+
  loc_id        - location identifier
+  name          - name of the group to open
+
+

OUTPUTS

+
  grp_id        - group identifier
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

OPTIONAL PARAMETERS

+
  gapl_id       - Group access property list identifier
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 5, 2001
+
+  Added 1.8 (optional) parameter gapl_id
+  February, 2008 M. Scot Breitenfeld
+
+

SOURCE

+
  SUBROUTINE h5gopen_f(loc_id, name, grp_id, hdferr, gapl_id)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: loc_id   ! File or group identifier
+    CHARACTER(LEN=*), INTENT(IN) :: name   ! Name of the group
+    INTEGER(HID_T), INTENT(OUT) :: grp_id  ! File identifier
+    INTEGER, INTENT(OUT) :: hdferr         ! Error code
+    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: gapl_id  ! Group access property list identifier
+
+ +
+ +

h5gset_comment_f

+ +

[ Top ] [ H5G ] [ Subroutines ]

+

NAME

+
  h5gset_comment_f
+
+

PURPOSE

+
  Sets comment for specified object.
+
+

INPUTS

+
  loc_id        - location identifier
+  name          - name of the object
+  comment       - comment to set for the object
+
+

OUTPUTS

+
  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 5, 2001
+
+

SOURCE

+
  SUBROUTINE h5gset_comment_f(loc_id, name, comment, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: loc_id   ! File or group identifier
+    CHARACTER(LEN=*), INTENT(IN) :: name   ! Current name of an object
+    CHARACTER(LEN=*), INTENT(IN) :: comment ! New name of an object
+    INTEGER, INTENT(OUT) :: hdferr         ! Error code
+
+ +
+ +

h5gunlink_f

+ +

[ Top ] [ H5G ] [ Subroutines ]

+

NAME

+
  h5gunlink_f
+
+

PURPOSE

+
  Removes the specified name from the group graph and
+  decrements the link count for the object to which name
+  points
+
+

INPUTS

+
  loc_id        - location identifier
+  name          - name of the object to unlink
+
+

OUTPUTS

+
  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 5, 2001
+
+

SOURCE

+
  SUBROUTINE h5gunlink_f(loc_id, name, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: loc_id   ! File or group identifier
+    CHARACTER(LEN=*), INTENT(IN) :: name   ! Name of an object
+    INTEGER, INTENT(OUT) :: hdferr         ! Error code
+
+ +
+ + + diff --git a/fortran/doc/DevelGuide/src/H5If_c.html b/fortran/doc/DevelGuide/src/H5If_c.html new file mode 100644 index 0000000..8dccce7 --- /dev/null +++ b/fortran/doc/DevelGuide/src/H5If_c.html @@ -0,0 +1,41 @@ + + + + + + + +./src/H5If.c + + + + + +
+
+ +

H5If

+ +

[ Top ] [ Modules ]

+

PURPOSE

+
   This file contains C stubs for H5I Fortran APIs
+
+ +
+ + + diff --git a/fortran/doc/DevelGuide/src/H5Iff_f90.html b/fortran/doc/DevelGuide/src/H5Iff_f90.html new file mode 100644 index 0000000..5987581 --- /dev/null +++ b/fortran/doc/DevelGuide/src/H5Iff_f90.html @@ -0,0 +1,304 @@ + + + + + + + +./src/H5Iff.f90 + + + + + +
+
+ +

H5I

+ +

[ Top ] [ Modules ]

+

NAME

+
  MODULE H5I
+
+

FILE

+
  fortran/src/H5Iff.f90
+
+

PURPOSE

+
  This file contains Fortran interfaces for H5I functions.
+
+

NOTES

+
                         *** IMPORTANT ***
+  If you add a new H5I function you must add the function name to the
+  Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory.
+  This is needed for Windows based operating systems.
+
+ +
+ +

h5idec_ref_f

+ +

[ Top ] [ H5I ] [ Subroutines ]

+

NAME

+
  h5idec_ref_f
+
+

PURPOSE

+
  Decrements the reference count of an ID
+
+

INPUTS

+
  obj_id        - Object identifier
+
+

OUTPUTS

+
  ref_count     - Current reference count of the ID
+  hdferr:       - Error code
+                   Success:  0
+                   Failure: -1
+
+

AUTHOR

+
  Quincey Koziol
+  December  9, 2003
+
+

SOURCE

+
  SUBROUTINE h5idec_ref_f(obj_id, ref_count, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: obj_id ! Object identifier
+    INTEGER, INTENT(OUT) :: ref_count    ! Current reference count of ID
+    INTEGER, INTENT(OUT) :: hdferr       ! Error code
+
+ +
+ +

h5iget_file_id_f

+ +

[ Top ] [ H5I ] [ Subroutines ]

+

NAME

+
  h5iget_file_id_f
+
+

PURPOSE

+
  Obtains file identifier from the object identifier
+
+

INPUTS

+
  obj_id        - object identifier
+
+

OUTPUTS

+
  file_id       - file identifier
+  hdferr:       - error code
+                    Success:  0
+                    Failure: -1
+
+

AUTHOR

+
  Elena Pourmal
+  August 23, 2004
+
+

SOURCE

+
  SUBROUTINE h5iget_file_id_f(obj_id, file_id, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN)  :: obj_id   ! Object identifier
+    INTEGER(HID_T), INTENT(OUT) :: file_id  ! File identifier
+    INTEGER, INTENT(OUT) :: hdferr          ! Error code
+
+ +
+ +

h5iget_name_f

+ +

[ Top ] [ H5I ] [ Subroutines ]

+

NAME

+
  h5iget_name_f
+
+

PURPOSE

+
  Gets a name of an object specified by its idetifier.
+
+

INPUTS

+
  obj_id    - attribute identifier
+  buf_size  - size of a buffer to read name in
+
+

OUTPUTS

+
  buf       - buffer to read name in, name will be truncated if
+              buffer is not big enough
+  name_size - name size
+  hdferr:   - error code
+               Success:  0
+               Failure: -1
+
+

AUTHOR

+
  Elena Pourmal
+  March 12, 2003
+
+

SOURCE

+
  SUBROUTINE h5iget_name_f(obj_id, buf, buf_size, name_size, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: obj_id      ! Object identifier
+    INTEGER(SIZE_T), INTENT(IN) :: buf_size   ! Buffer size
+    CHARACTER(LEN=*), INTENT(OUT) :: buf      ! Buffer to hold object name
+    INTEGER(SIZE_T), INTENT(OUT) :: name_size ! Actual name size
+    INTEGER, INTENT(OUT) :: hdferr            ! Error code:
+                                              !   0 if successful,
+                                              !   -1 if fail
+
+ +
+ +

h5iget_ref_f

+ +

[ Top ] [ H5I ] [ Subroutines ]

+

NAME

+
  h5iget_ref_f
+
+

PURPOSE

+
  Retrieves the reference count of an ID
+
+

INPUTS

+
  obj_id        - object identifier
+
+

OUTPUTS

+
  ref_count     - Current reference count of the ID
+  hdferr:         - error code
+  Success:  0
+  Failure: -1
+
+

AUTHOR

+
  Quincey Koziol
+  December  9, 2003
+
+

SOURCE

+
  SUBROUTINE h5iget_ref_f(obj_id, ref_count, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: obj_id ! Object identifier
+    INTEGER, INTENT(OUT) :: ref_count    ! Current reference count of ID
+    INTEGER, INTENT(OUT) :: hdferr       ! Error code
+
+ +
+ +

h5iget_type_f

+ +

[ Top ] [ H5I ] [ Subroutines ]

+

NAME

+
  h5iget_type_f
+
+

PURPOSE

+
  Retrieves the type of an object.
+
+

INPUTS

+
  obj_id   - object identifier
+
+

OUTPUTS

+
  type     - type of the object, possible values:
+              H5I_FILE_F
+              H5I_GROUP_F
+              H5I_DATATYPE_F
+              H5I_DATASPACE_F
+              H5I_DATASET_F
+              H5I_ATTR_F
+              H5I_BADID_F
+  hdferr:  - error code
+              Success:  0
+              Failure: -1
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 5, 2001
+
+

SOURCE

+
  SUBROUTINE h5iget_type_f(obj_id, TYPE, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: obj_id  ! Object identifier
+    INTEGER, INTENT(OUT) :: TYPE ! type of an object.
+                                 ! possible values are:
+                                 !   H5I_FILE_F
+                                 !   H5I_GROUP_F
+                                 !   H5I_DATATYPE_F
+                                 !   H5I_DATASPACE_F
+                                 !   H5I_DATASET_F
+                                 !   H5I_ATTR_F
+                                 !   H5I_BADID_F
+    INTEGER, INTENT(OUT) :: hdferr  ! Error code
+
+ +
+ +

h5iinc_ref_f

+ +

[ Top ] [ H5I ] [ Subroutines ]

+

NAME

+
  h5iinc_ref_f
+
+

PURPOSE

+
  Increments the reference count of an ID
+
+

INPUTS

+
  obj_id        - object identifier
+
+

OUTPUTS

+
  ref_count     - Current reference count of the ID
+  hdferr:              - error code
+  Success:  0
+  Failure: -1
+
+

AUTHOR

+
  Quincey Koziol
+  December  9, 2003
+
+

SOURCE

+
  SUBROUTINE h5iinc_ref_f(obj_id, ref_count, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: obj_id ! Object identifier
+    INTEGER, INTENT(OUT) :: ref_count    ! Current reference count of ID
+    INTEGER, INTENT(OUT) :: hdferr       ! Error code
+
+ +
+ +

h5iis_valid_f

+ +

[ Top ] [ H5I ] [ Subroutines ]

+

NAME

+
  h5iget_file_id_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
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  April 13, 2009
+
+

SOURCE

+
  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
+
+ +
+ + + diff --git a/fortran/doc/DevelGuide/src/H5Lf_c.html b/fortran/doc/DevelGuide/src/H5Lf_c.html new file mode 100644 index 0000000..9adb759 --- /dev/null +++ b/fortran/doc/DevelGuide/src/H5Lf_c.html @@ -0,0 +1,41 @@ + + + + + + + +./src/H5Lf.c + + + + + +
+
+ +

H5Lf

+ +

[ Top ] [ Modules ]

+

PURPOSE

+
   This file contains C stubs for H5L Fortran APIs
+
+ +
+ + + diff --git a/fortran/doc/DevelGuide/src/H5Lff_F03_f90.html b/fortran/doc/DevelGuide/src/H5Lff_F03_f90.html new file mode 100644 index 0000000..6b9640b --- /dev/null +++ b/fortran/doc/DevelGuide/src/H5Lff_F03_f90.html @@ -0,0 +1,181 @@ + + + + + + + +./src/H5Lff_F03.f90 + + + + + +
+
+ +

H5L (F03)

+ +

[ Top ] [ Modules ]

+

NAME

+
  H5L_PROVISIONAL
+
+

FILE

+
  src/fortran/src/H5Lff_F03.f90
+
+

PURPOSE

+
  This file contains Fortran 90 and Fortran 2003 interfaces for H5L functions.
+  It contains the same functions as H5Lff_DEPRECIATE.f90 but includes the
+  Fortran 2003 functions and the interface listings. This file will be compiled
+  instead of H5Lff_DEPRECIATE.f90 if Fortran 2003 functions are enabled.
+
+

NOTES

+
                         *** IMPORTANT ***
+  If you add a new H5A function you must add the function name to the
+  Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory.
+  This is needed for Windows based operating systems.
+
+ +
+ +

h5literate_by_name_f

+ +

[ Top ] [ H5L (F03) ] [ Subroutines ]

+

NAME

+
  h5literate_by_name_f
+
+

PURPOSE

+
  Iterates through links in a group.
+
+

INPUTS

+
  loc_id        - File or group identifier specifying location of subject group
+  group_name    - Name of subject group
+  index_type    - Type of index which determines the order
+  order         - Order within index
+  idx           - Iteration position at which to start
+  op            - Callback function passing data regarding the link to the calling application
+  op_data       - User-defined pointer to data required by the application for its processing of the link
+
+

OUTPUTS

+
  idx      - Position at which an interrupted iteration may be restarted
+  hdferr   - Error code:
+               Success:  0
+               Failure: -1
+
+

OPTIONAL PARAMETERS

+
  lapl_id  - Link access property list
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  Augest 18, 2008
+
+

SOURCE

+
  SUBROUTINE h5literate_by_name_f(loc_id, group_name, index_type, order, idx, op, op_data, return_value, hdferr, lapl_id)
+    USE ISO_C_BINDING
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: loc_id    ! Identifier specifying subject group
+    CHARACTER(LEN=*) :: group_name          ! Name of subject group
+    INTEGER, INTENT(IN) :: index_type       ! Type of index which determines the order:
+                                                ! H5_INDEX_NAME_F - Alpha-numeric index on name
+                                                ! H5_INDEX_CRT_ORDER_F - Index on creation order
+    INTEGER, INTENT(IN) :: order            ! Order within index:
+                                                ! H5_ITER_INC_F - Increasing order
+                                                ! H5_ITER_DEC_F - Decreasing order
+                                                ! H5_ITER_NATIVE_F - Fastest available order
+    INTEGER(HSIZE_T), INTENT(INOUT) :: idx  ! IN : Iteration position at which to start
+                                            ! OUT: Position at which an interrupted iteration may be restarted
+
+    TYPE(C_FUNPTR):: op      ! Callback function passing data regarding the link to the calling application
+    TYPE(C_PTR)   :: op_data ! User-defined pointer to data required by the application for its processing of the link
+
+    INTEGER, INTENT(OUT) :: return_value ! 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.
+
+    INTEGER, INTENT(OUT) :: hdferr       ! Error code:
+                                         ! 0 on success and -1 on failure
+
+    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list
+
+ +
+ +

h5literate_f

+ +

[ Top ] [ H5L (F03) ] [ Subroutines ]

+

NAME

+
  h5literate_f
+
+

PURPOSE

+
  Iterates through links in a group.
+
+

INPUTS

+
  group_id      - Identifier specifying subject group
+  index_type    - Type of index which determines the order
+  order         - Order within index
+  idx           - Iteration position at which to start
+  op            - Callback function passing data regarding the link to the calling application
+  op_data       - User-defined pointer to data required by the application for its processing of the link
+
+

OUTPUTS

+
  idx           - Position at which an interrupted iteration may be restarted
+  hdferr        - Error code:
+                    Success:  0
+                    Failure: -1
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  July 8, 2008
+
+

SOURCE

+
  SUBROUTINE h5literate_f(group_id, index_type, order, idx, op, op_data, return_value, hdferr)
+    USE ISO_C_BINDING
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: group_id  ! Identifier specifying subject group
+    INTEGER, INTENT(IN) :: index_type       ! Type of index which determines the order:
+                                                ! H5_INDEX_NAME_F - Alpha-numeric index on name
+                                                ! H5_INDEX_CRT_ORDER_F - Index on creation order
+    INTEGER, INTENT(IN) :: order            ! Order within index:
+                                                ! H5_ITER_INC_F - Increasing order
+                                                ! H5_ITER_DEC_F - Decreasing order
+                                                ! H5_ITER_NATIVE_F - Fastest available order
+    INTEGER(HSIZE_T), INTENT(INOUT) :: idx  ! IN : Iteration position at which to start
+                                            ! OUT: Position at which an interrupted iteration may be restarted
+
+    TYPE(C_FUNPTR):: op      ! Callback function passing data regarding the link to the calling application
+    TYPE(C_PTR)   :: op_data ! User-defined pointer to data required by the application for its processing of the link
+
+    INTEGER, INTENT(OUT) :: return_value ! 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.
+
+    INTEGER, INTENT(OUT) :: hdferr       ! Error code:
+                                         ! 0 on success and -1 on failure
+
+ +
+ + + diff --git a/fortran/doc/DevelGuide/src/H5Lff_F90_f90.html b/fortran/doc/DevelGuide/src/H5Lff_F90_f90.html new file mode 100644 index 0000000..6d1a9bb --- /dev/null +++ b/fortran/doc/DevelGuide/src/H5Lff_F90_f90.html @@ -0,0 +1,50 @@ + + + + + + + +./src/H5Lff_F90.f90 + + + + + +
+
+ +

H5L (F90)

+ +

[ Top ] [ Modules ]

+

NAME

+
  MODULE H5L_PROVISIONAL
+
+

PURPOSE

+
  This file contains Fortran 90 interfaces for H5L functions. It contains
+  the same functions as H5Lff_F03.f90 but excludes the Fortran 2003 functions
+  and the interface listings. This file will be compiled instead of H5Lff_F03.f90
+  if Fortran 2003 functions are not enabled.
+
+ NOTE
+  Currently contains no functions.
+
+ +
+ + + diff --git a/fortran/doc/DevelGuide/src/H5Lff_f90.html b/fortran/doc/DevelGuide/src/H5Lff_f90.html new file mode 100644 index 0000000..1a209f2 --- /dev/null +++ b/fortran/doc/DevelGuide/src/H5Lff_f90.html @@ -0,0 +1,637 @@ + + + + + + + +./src/H5Lff.f90 + + + + + +
+
+ +

H5L

+ +

[ Top ] [ Modules ]

+

NAME

+
  MODULE H5L
+
+

PURPOSE

+
  This file contains Fortran interfaces for H5L functions. It includes
+  all the functions that are independent on whether the Fortran 2003 functions
+  are enabled or disabled.
+
+

NOTES

+
                         *** IMPORTANT ***
+  If you add a new H5L function you must add the function name to the
+  Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory.
+  This is needed for Windows based operating systems.
+
+ +
+ +

h5lcopy_f

+ +

[ Top ] [ H5L ] [ Subroutines ]

+

NAME

+
  h5lcopy_f
+
+

PURPOSE

+
  Copies a link from one location to another.
+
+

INPUTS

+
  src_loc_id    - Location identifier of the source link
+  src_name      - Name of the link to be copied
+  dest_loc_id   - Location identifier specifying the destination of the copy
+  dest_name     - Name to be assigned to the NEW copy
+  loc_id        - Identifier of the file or group containing the object
+  name          - Name of the link to delete
+
+

OUTPUTS

+
  hdferr        - Returns 0 if successful and -1 if fails
+
+

OPTIONAL PARAMETERS

+
  lcpl_id       - Link creation property list identifier
+  lapl_id       - Link access property list identifier
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  February 27, 2008
+
+

SOURCE

+
  SUBROUTINE h5lcopy_f(src_loc_id, src_name, dest_loc_id, dest_name, hdferr, &
+       lcpl_id, lapl_id)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: src_loc_id  ! Location identifier of the source link
+    CHARACTER(LEN=*), INTENT(IN) :: src_name   ! Name of the link to be copied
+    INTEGER(HID_T), INTENT(IN) :: dest_loc_id ! Location identifier specifying the destination of the copy
+    CHARACTER(LEN=*), INTENT(IN) :: dest_name ! Name to be assigned to the NEW copy
+
+    INTEGER, INTENT(OUT) :: hdferr        ! Error code:
+                                          ! 0 on success and -1 on failure
+    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lcpl_id ! Link creation property list identifier
+    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list identifier
+
+ +
+ +

H5Lcreate_external_f

+ +

[ Top ] [ H5L ] [ Subroutines ]

+

NAME

+
  H5Lcreate_external_f
+
+

PURPOSE

+
  Creates a soft link to an object in a different file.
+
+

INPUTS

+
  file_name     - Name of the file containing the target object. Neither the file nor the target object is
+  required to exist. May be the file the link is being created in.
+  obj_name      - Path within the target file to the target object.
+  link_loc_id   - The file or group identifier for the new link.
+  link_name     - The name of the new link.
+
+

OUTPUTS

+
  hdferr        - Returns 0 if successful and -1 if fails
+
+

OPTIONAL PARAMETERS

+
  lcpl_id       - Link creation property list identifier.
+  lapl_id       - Link access property list identifier.
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  February 27, 2008
+
+

SOURCE

+
  SUBROUTINE h5lcreate_external_f(file_name, obj_name, link_loc_id, link_name, hdferr, lcpl_id, lapl_id)
+    IMPLICIT NONE
+    CHARACTER(LEN=*), INTENT(IN) :: file_name ! Name of the file containing the target object. Neither
+                                              ! the file nor the target object is required to exist.
+                                              ! May be the file the link is being created in.
+    CHARACTER(LEN=*), INTENT(IN) :: obj_name  ! Name of the target object, which must already exist.
+    INTEGER(HID_T), INTENT(IN) :: link_loc_id ! The file or group identifier for the new link.
+    CHARACTER(LEN=*), INTENT(IN) :: link_name ! The name of the new link.
+
+    INTEGER, INTENT(OUT) :: hdferr        ! Error code:
+                                          ! 0 on success and -1 on failure
+
+    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lcpl_id ! Link creation property list identifier.
+    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list identifier.
+
+ +
+ +

H5Lcreate_hard_f

+ +

[ Top ] [ H5L ] [ Subroutines ]

+

NAME

+
  H5Lcreate_hard_f
+
+

PURPOSE

+
  Creates a hard link to an object.
+
+

INPUTS

+
  obj_loc_id    - The file or group identifier for the target object.
+  obj_name      - Name of the target object, which must already exist.
+  link_loc_id   - The file or group identifier for the new link.
+  link_name     - The name of the new link.
+
+

OUTPUTS

+
  hdferr        - Returns 0 if successful and -1 if fails
+
+

OPTIONAL PARAMETERS

+
  lcpl_id       - Link creation property list identifier.
+  lapl_id       - Link access property list identifier.
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  February 27, 2008
+
+

SOURCE

+
  SUBROUTINE h5lcreate_hard_f(obj_loc_id, obj_name, link_loc_id, link_name, hdferr, lcpl_id, lapl_id)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: obj_loc_id  ! The file or group identifier for the target object.
+    CHARACTER(LEN=*), INTENT(IN) :: obj_name  ! Name of the target object, which must already exist.
+    INTEGER(HID_T), INTENT(IN) :: link_loc_id ! The file or group identifier for the new link.
+    CHARACTER(LEN=*), INTENT(IN) :: link_name ! The name of the new link.
+
+    INTEGER, INTENT(OUT) :: hdferr        ! Error code:
+                                          ! 0 on success and -1 on failure
+
+    INTEGER(HID_T), OPTIONAL, INTENT(IN) ::   lcpl_id         ! Link creation property list identifier.
+    INTEGER(HID_T), OPTIONAL, INTENT(IN) ::   lapl_id         ! Link access property list identifier.
+
+ +
+ +

H5Lcreate_soft_f

+ +

[ Top ] [ H5L ] [ Subroutines ]

+

NAME

+
  H5Lcreate_soft_f
+
+

PURPOSE

+
  Creates a soft link to an object.
+
+

INPUTS

+
  target_path   - Path to the target object, which is not required to exist.
+  link_loc_id   - The file or group identifier for the new link.
+  link_name     - The name of the new link.
+
+

OUTPUTS

+
  hdferr        - Returns 0 if successful and -1 if fails
+
+

OPTIONAL PARAMETERS

+
  lcpl_id       - Link creation property list identifier.
+  lapl_id       - Link access property list identifier.
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  February 20, 2008
+
+

SOURCE

+
  SUBROUTINE h5lcreate_soft_f(target_path, link_loc_id, link_name, hdferr, lcpl_id, lapl_id)
+    IMPLICIT NONE
+    CHARACTER(LEN=*), INTENT(IN) :: target_path   ! Path to the target object, which is not required to exist.
+    INTEGER(HID_T), INTENT(IN) :: link_loc_id     ! The file or group identifier for the new link.
+    CHARACTER(LEN=*), INTENT(IN) :: link_name     ! The name of the new link.
+    INTEGER, INTENT(OUT) :: hdferr                ! Error code:
+                                                  !   0 on success and -1 on failure
+    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lcpl_id ! Link creation property list identifier.
+    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list identifier.
+
+ +
+ +

h5ldelete_by_idx_f

+ +

[ Top ] [ H5L ] [ Subroutines ]

+

NAME

+
  h5ldelete_by_idx_f
+
+

PURPOSE

+
  Removes the nth link in a group.
+
+

INPUTS

+
  loc_id        - File or group identifier specifying location of subject group
+  group_name    - Name of subject group
+  index_field   - Type of index; Possible values are:
+                    H5_INDEX_UNKNOWN_F = -1  - Unknown index type
+                    H5_INDEX_NAME_F          - Index on names
+                    H5_INDEX_CRT_ORDER_F     - Index on creation order
+                    H5_INDEX_N_F             - Number of indices defined
+
+  order         - Order within field or index; Possible values are:
+                    H5_ITER_UNKNOWN_F   - Unknown order
+                    H5_ITER_INC_F       - Increasing order
+                    H5_ITER_DEC_F       - Decreasing order
+                    H5_ITER_NATIVE_F    - No particular order, whatever is fastest
+                    H5_ITER_N_F         - Number of iteration orders
+
+  n             - Link for which to retrieve information
+
+

OUTPUTS

+
  hdferr        - Returns 0 if successful and -1 if fails
+
+

OPTIONAL PARAMETERS

+
  lapl_id       - Link access property list
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  February 29, 2008
+
+

SOURCE

+
  SUBROUTINE h5ldelete_by_idx_f(loc_id, group_name, index_field, order, n, hdferr, lapl_id)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: loc_id       ! Identifer for object to which attribute is attached
+    CHARACTER(LEN=*), INTENT(IN) :: group_name ! Name of object, relative to location,
+                                               !  from which attribute is to be removed
+    INTEGER, INTENT(IN) :: index_field         ! Type of index; Possible values are:
+                                               !    H5_INDEX_UNKNOWN_F   - Unknown index type
+                                               !    H5_INDEX_NAME_F      - Index on names
+                                               !    H5_INDEX_CRT_ORDER_F - Index on creation order
+                                               !    H5_INDEX_N_F              - Number of indices defined
+    INTEGER, INTENT(IN) :: order               ! Order in which to iterate over index; Possible values are:
+                                               !    H5_ITER_UNKNOWN_F  - Unknown order
+                                               !    H5_ITER_INC_F      - Increasing order
+                                               !    H5_ITER_DEC_F      - Decreasing order
+                                               !    H5_ITER_NATIVE_F   - No particular order, whatever is fastest
+                                               !    H5_ITER_N_F     - Number of iteration orders
+    INTEGER(HSIZE_T), INTENT(IN) :: n      ! Offset within index
+    INTEGER, INTENT(OUT) :: hdferr         ! Error code:
+                                           ! 0 on success and -1 on failure
+    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id     ! Link access property list
+
+ +
+ +

h5ldelete_f

+ +

[ Top ] [ H5L ] [ Subroutines ]

+

NAME

+
  h5ldelete_f
+
+

PURPOSE

+
  Removes a link from a group.
+
+

INPUTS

+
  loc_id        - Identifier of the file or group containing the object
+  name          - Name of the link to delete
+
+

OUTPUTS

+
  hdferr        - Returns 0 if successful and -1 if fails
+
+

OPTIONAL PARAMETERS

+
  lapl_id       - Link access property list identifier
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  January, 2008
+
+

SOURCE

+
  SUBROUTINE h5ldelete_f(loc_id, name, hdferr, lapl_id)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: loc_id  ! Identifier of the file or group containing the object
+    CHARACTER(LEN=*), INTENT(IN) :: name  ! Name of the link to delete
+    INTEGER, INTENT(OUT) :: hdferr        ! Error code:
+                                          ! 0 on success and -1 on failure
+    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list identifier
+
+ +
+ +

H5Lexists_f

+ +

[ Top ] [ H5L ] [ Subroutines ]

+

NAME

+
  H5Lexists_f
+
+

PURPOSE

+
  Check if a link with a particular name exists in a group.
+
+

INPUTS

+
  loc_id        - Identifier of the file or group to query.
+  name          - Link name to check
+
+

OUTPUTS

+
  link_exists   - link exists status (.TRUE.,.FALSE.)
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

OPTIONAL PARAMETERS

+
  lapl_id       - Link access property list identifier.
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  February 29, 2008
+
+

SOURCE

+
  SUBROUTINE h5lexists_f(loc_id, name, link_exists, hdferr, lapl_id)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: loc_id  ! Identifier of the file or group to query.
+    CHARACTER(LEN=*), INTENT(IN) :: name  ! Link name to check.
+    LOGICAL, INTENT(OUT) :: link_exists   ! .TRUE. if exists, .FALSE. otherwise
+    INTEGER, INTENT(OUT) :: hdferr        ! Error code:
+                                          ! 0 on success and -1 on failure
+    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id
+                                          ! Link access property list identifier.
+
+ +
+ +

h5lget_info_by_idx_f

+ +

[ Top ] [ H5L ] [ Subroutines ]

+

NAME

+
  h5lget_info_by_idx_f
+
+

PURPOSE

+
  Retrieves metadata for a link in a group, according to the order within a field or index.
+
+

INPUTS

+
  loc_id        - File or group identifier specifying location of subject group
+  group_name    - Name of subject group
+  index_field   - Index or field which determines the order
+  order         - Order within field or index
+  n             - Link for which to retrieve information
+
+

OUTPUTS

+
            NOTE: In C these are defined as a structure: H5L_info_t
+  corder_valid  - Indicates whether the creation order data is valid for this attribute
+  corder        - Is a positive integer containing the creation order of the attribute
+  cset          - Indicates the character set used for the attribute’s name 
+ address        - If the link is a hard link, address specifies the file address that the link points to
+ val_size       - If the link is a symbolic link, val_size will be the length of the link value, e.g., 
+                  the length of the name of the pointed-to object with a null terminator.
+ hdferr         - Returns 0 if successful and -1 if fails
+
+

OPTIONAL PARAMETERS

+
  lapl_id       - Link access property list
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  February 29, 2008
+
+

HISTORY

+
   Changed the link_type names to match those in C (bug 1720) from,
+   H5L_LINK_HARD_F, H5L_LINK_SOFT_F,H5L_LINK_EXTERNAL_F,H5L_LINK_ERROR_F
+   to
+   H5L_TYPE_HARD_F, H5L_TYPE_SOFT_F,H5L_TYPE_EXTERNAL_F,H5L_TYPE_ERROR_F
+   MSB January 8, 2010.  
+
+

SOURCE

+
  SUBROUTINE h5lget_info_by_idx_f(loc_id, group_name, index_field, order, n, &
+       link_type, f_corder_valid, corder, cset, address, val_size, hdferr, lapl_id)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: loc_id       ! File or group identifier specifying location of subject group  
+    CHARACTER(LEN=*), INTENT(IN) :: group_name ! Name of subject group
+    INTEGER, INTENT(IN) :: index_field  ! Index or field which determines the order
+                                        !    H5_INDEX_UNKNOWN_F   - Unknown index type
+                                        !    H5_INDEX_NAME_F      - Index on names
+                                        !    H5_INDEX_CRT_ORDER_F - Index on creation order
+                                        !    H5_INDEX_N_F             - Number of indices defined
+    INTEGER, INTENT(IN) :: order        ! Order in which to iterate over index; Possible values are:
+                                        !    H5_ITER_UNKNOWN_F  - Unknown order
+                                        !    H5_ITER_INC_F      - Increasing order
+                                        !    H5_ITER_DEC_F      - Decreasing order
+                                        !    H5_ITER_NATIVE_F   - No particular order, whatever is fastest
+    INTEGER(HSIZE_T), INTENT(IN) :: n   ! Attributeâs position in index
+    INTEGER, INTENT(OUT) :: link_type ! Specifies the link class:
+                                      !  H5L_TYPE_HARD_F      - Hard link
+                                      !  H5L_TYPE_SOFT_F      - Soft link
+                                      !  H5L_TYPE_EXTERNAL_F  - External link
+                                      !  H5L_TYPE_ERROR _F    - Error
+    LOGICAL, INTENT(OUT) :: f_corder_valid ! Indicates whether the creation order data is valid for this attribute 
+    INTEGER, INTENT(OUT) :: corder         ! Is a positive integer containing the creation order of the attribute
+    INTEGER, INTENT(OUT) :: cset           ! Indicates the character set used for the attributeâs name
+    INTEGER(HADDR_T), INTENT(OUT) :: address  ! If the link is a hard link, address specifies the file address that the link points to
+    INTEGER(SIZE_T), INTENT(OUT) :: val_size  ! If the link is a symbolic link, val_size will be the length of the link value, e.g., 
+                                              ! the length of the name of the pointed-to object with a null terminator. 
+    INTEGER, INTENT(OUT) :: hdferr       ! Error code:
+                                         ! 0 on success and -1 on failure
+    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id  ! Link access property list
+
+ +
+ +

h5lget_info_f

+ +

[ Top ] [ H5L ] [ Subroutines ]

+

NAME

+
  h5lget_info_f
+
+

PURPOSE

+
  Returns information about a link.
+
+

INPUTS

+
  link_loc_id   - File or group identifier.
+  link_name     - Name of the link for which information is being sought
+
+

OUTPUTS

+
            NOTE: In C these are contained in the structure H5L_info_t
+
+  cset          - indicates the character set used for link’s name.
+  corder        - specifies the link’s creation order position.
+  corder_valid  - indicates whether the value in corder is valid.
+  link_type     - specifies the link class:
+                    H5L_TYPE_HARD_F     - Hard link
+                    H5L_TYPE_SOFT_F     - Soft link
+                    H5L_TYPE_EXTERNAL_F - External link
+                    H5L_TYPE_ERROR_ F   - Error
+  address       - If the link is a hard link, address specifies the file address that the link points to
+  val_size      - If the link is a symbolic link, val_size will be the length of the link value, e.g., 
+                  the length of the name of the pointed-to object with a null terminator. 
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

OPTIONAL PARAMETERS

+
  lapl_id       - Link access property list
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  February 29, 2008
+
+

HISTORY

+
   Changed the link_type names to match those in C (bug 1720) from,
+   H5L_LINK_HARD_F, H5L_LINK_SOFT_F,H5L_LINK_EXTERNAL_F,H5L_LINK_ERROR_F
+   to
+   H5L_TYPE_HARD_F, H5L_TYPE_SOFT_F,H5L_TYPE_EXTERNAL_F,H5L_TYPE_ERROR_F
+   MSB January 8, 2010.
+
+

SOURCE

+
  SUBROUTINE h5lget_info_f(link_loc_id, link_name, &
+       cset, corder, f_corder_valid, link_type, address, val_size, &
+       hdferr, lapl_id)
+    IMPLICIT NONE
+
+    INTEGER(HID_T), INTENT(IN) :: link_loc_id ! File or group identifier.
+    CHARACTER(LEN=*), INTENT(IN) :: link_name ! Name of the link for which information is being sought
+
+! OUTPUTS  NOTE: In C these are contained in the structure H5L_info_t
+    INTEGER, INTENT(OUT) :: cset ! Indicates the character set used for the linkâs name.
+    INTEGER, INTENT(OUT) :: corder ! Specifies the linkâs creation order position.
+    LOGICAL, INTENT(OUT) :: f_corder_valid ! Indicates whether the value in corder is valid.
+    INTEGER, INTENT(OUT) :: link_type ! Specifies the link class:
+                                      !  H5L_TYPE_HARD_F      - Hard link
+                                      !  H5L_TYPE_SOFT_F      - Soft link
+                                      !  H5L_TYPE_EXTERNAL_F  - External link
+                                      !  H5L_TYPE_ERROR _F    - Error
+    INTEGER(HADDR_T), INTENT(OUT) :: address ! If the link is a hard link, address specifies the file address that the link points to
+    INTEGER(SIZE_T), INTENT(OUT) :: val_size ! If the link is a symbolic link, val_size will be the length of the link value, e.g., 
+                                             ! the length of the name of the pointed-to object with a null terminator. 
+    INTEGER, INTENT(OUT) :: hdferr       ! Error code:
+                                         ! 0 on success and -1 on failure
+    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id  ! Link access property list
+
+ +
+ +

h5lget_name_by_idx_f

+ +

[ Top ] [ H5L ] [ Subroutines ]

+

NAME

+
  h5lget_name_by_idx_f
+
+

PURPOSE

+
  Retrieves name of the nth link in a group, according to the order within a specified field or index.
+
+

INPUTS

+
  loc_id        - File or group identifier specifying location of subject group
+  group_name    - Name of subject group
+  index_field   - Index or field which determines the order
+  order         - Order within field or index
+  n             - Link for which to retrieve information
+
+

OUTPUTS

+
  name          - Buffer in which link value is returned
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

OPTIONAL PARAMETERS

+
  lapl_id       - List access property list identifier.
+  size          - Maximum number of characters of link value to be returned.
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  March 10, 2008
+
+

SOURCE

+
  SUBROUTINE h5lget_name_by_idx_f(loc_id, group_name, index_field, order, n, &
+        name, hdferr, size, lapl_id)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: loc_id       ! File or group identifier specifying location of subject group
+    CHARACTER(LEN=*), INTENT(IN) :: group_name ! Name of subject group
+    INTEGER, INTENT(IN) :: index_field  ! Index or field which determines the order
+                                        !    H5_INDEX_UNKNOWN_F   - Unknown index type
+                                        !    H5_INDEX_NAME_F      - Index on names
+                                        !    H5_INDEX_CRT_ORDER_F - Index on creation order
+                                        !    H5_INDEX_N_F             - Number of indices defined
+    INTEGER, INTENT(IN) :: order        ! Order in which to iterate over index; Possible values are:
+                                        !    H5_ITER_UNKNOWN_F  - Unknown order
+                                        !    H5_ITER_INC_F      - Increasing order
+                                        !    H5_ITER_DEC_F      - Decreasing order
+                                        !    H5_ITER_NATIVE_F   - No particular order, whatever is fastest
+    INTEGER(HSIZE_T), INTENT(IN) :: n   ! Attributeâs position in index
+    CHARACTER(LEN=*), INTENT(OUT) :: name ! Buffer in which link value is returned
+    INTEGER, INTENT(OUT) :: hdferr        ! Error code:
+                                          ! 0 on success and -1 on failure
+
+ +
+ +

h5lis_registered_f

+ +

[ Top ] [ H5L ] [ Subroutines ]

+

NAME

+
  h5lis_registered_f
+
+

PURPOSE

+
  Determines whether a class of user-defined links is registered.
+
+

INPUTS

+
  link_cls_id   - User-defined link class identifier
+
+

OUTPUTS

+
  registered    - .TRUE.  - if the link class has been registered
+                  .FALSE. - if it is unregistered
+  hdferr        - Error code
+  Success:  0
+  Failure: -1
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  February 29, 2008
+
+

SOURCE

+
  SUBROUTINE h5lis_registered_f(link_cls_id, registered, hdferr)
+    IMPLICIT NONE
+    INTEGER, INTENT(IN) :: link_cls_id  ! User-defined link class identifier
+    LOGICAL, INTENT(OUT) :: registered  ! .TRUE. - if the link class has been registered and
+                                        ! .FALSE. - if it is unregistered
+    INTEGER, INTENT(OUT) :: hdferr      ! Error code:
+                                        ! 0 on success and -1 on failure
+
+ +
+ +

h5lmove_f

+ +

[ Top ] [ H5L ] [ Subroutines ]

+

NAME

+
  h5lmove_f
+
+

PURPOSE

+
  Renames a link within an HDF5 file.
+
+

INPUTS

+
  src_loc_id    - Original file or group identifier.
+  src_name      - Original link name.
+  dest_loc_id   - Destination file or group identifier.
+  dest_name     - NEW link name.
+
+

OUTPUTS

+
  hdferr        - Error code:
+                   0 on success and -1 on failure
+
+

OPTIONAL PARAMETERS

+
  lcpl_id       - Link creation property list identifier to be associated WITH the NEW link.
+  lapl_id       - Link access property list identifier to be associated WITH the NEW link.
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  March 3, 2008
+
+

SOURCE

+
  SUBROUTINE h5lmove_f(src_loc_id, src_name, dest_loc_id, dest_name, hdferr, lcpl_id, lapl_id)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: src_loc_id  ! Original file or group identifier.
+    CHARACTER(LEN=*), INTENT(IN) :: src_name  ! Original link name.
+    INTEGER(HID_T), INTENT(IN) :: dest_loc_id ! Destination file or group identifier.
+    CHARACTER(LEN=*), INTENT(IN) :: dest_name ! NEW link name.
+    INTEGER, INTENT(OUT) :: hdferr     ! Error code:
+                                              ! 0 on success and -1 on failure
+    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lcpl_id ! Link creation property list identifier
+                                                    ! to be associated WITH the NEW link.
+    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list identifier
+                                                    ! to be associated WITH the NEW link.
+
+ +
+ + + diff --git a/fortran/doc/DevelGuide/src/H5Of_c.html b/fortran/doc/DevelGuide/src/H5Of_c.html new file mode 100644 index 0000000..e4a97e9 --- /dev/null +++ b/fortran/doc/DevelGuide/src/H5Of_c.html @@ -0,0 +1,41 @@ + + + + + + + +./src/H5Of.c + + + + + +
+
+ +

H5Of

+ +

[ Top ] [ Modules ]

+

PURPOSE

+
   This file contains C stubs for H5O Fortran APIs
+
+ +
+ + + diff --git a/fortran/doc/DevelGuide/src/H5Off_f90.html b/fortran/doc/DevelGuide/src/H5Off_f90.html new file mode 100644 index 0000000..790810e --- /dev/null +++ b/fortran/doc/DevelGuide/src/H5Off_f90.html @@ -0,0 +1,198 @@ + + + + + + + +./src/H5Off.f90 + + + + + +
+
+ +

H5O

+ +

[ Top ] [ Modules ]

+

NAME

+
  MODULE H5O
+
+

FILE

+
  fortran/src/H5Off.f90
+
+

PURPOSE

+
  This file contains Fortran interfaces for H5O functions. It includes
+  all the functions that are independent on whether the Fortran 2003 functions
+  are enabled or disabled.
+
+

NOTES

+
                         *** IMPORTANT ***
+  If you add a new H5O function you must add the function name to the
+  Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory.
+  This is needed for Windows based operating systems.
+
+ +
+ +

h5oclose_f

+ +

[ Top ] [ H5O ] [ Subroutines ]

+

NAME

+
  h5oclose_f
+
+

PURPOSE

+
  Closes an object in an HDF5 file.
+
+

INPUTS

+
  object_id     - Object identifier
+
+

OUTPUTS

+
  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  December 17, 2008
+
+

SOURCE

+
  SUBROUTINE h5oclose_f(object_id, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN)  :: object_id
+    INTEGER,        INTENT(OUT) :: hdferr
+
+ +
+ +

h5olink_f

+ +

[ Top ] [ H5O ] [ Subroutines ]

+

NAME

+
  h5olink_f
+
+

PURPOSE

+
  Creates a hard link to an object in an HDF5 file.
+
+

INPUTS

+
  object_id     - Object to be linked.
+  new_loc_id    - File or group identifier specifying location at which object is to be linked.
+  new_link_name - Name of link to be created, relative to new_loc_id.
+
+

OUTPUTS

+
  hdferr:       - error code
+                   Success:  0
+                   Failure: -1
+
+

OPTIONAL PARAMETERS

+
  lcpl_id       - Link creation property list identifier.
+  lapl_id       - Link access property list identifier.
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  April 21, 2008
+
+

SOURCE

+
  SUBROUTINE h5olink_f(object_id, new_loc_id, new_link_name, hdferr, lcpl_id, lapl_id)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: object_id  ! Object to be linked
+    INTEGER(HID_T), INTENT(IN) :: new_loc_id ! File or group identifier specifying
+                                             ! location at which object is to be linked.
+    CHARACTER(LEN=*), INTENT(IN) :: new_link_name ! Name of link to be created, relative to new_loc_id.
+    INTEGER, INTENT(OUT) :: hdferr        ! Error code
+                                          !   Success:  0
+                                          !   Failure: -1
+    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lcpl_id ! Link creation property list identifier.
+    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link creation property list identifier.
+
+ +
+ +

h5oopen_f

+ +

[ Top ] [ H5O ] [ Subroutines ]

+

NAME

+
  h5oopen_f
+
+

PURPOSE

+
  Opens an object in an HDF5 file by location identifier and path name.
+
+

INPUTS

+
  loc_id        - File or group identifier
+  name          - Path to the object, relative to loc_id.
+
+

OUTPUTS

+
  obj_id        - Object identifier for the opened object
+  hdferr:       - error code
+                   Success:  0
+                   Failure: -1
+
+

OPTIONAL PARAMETERS

+
  lapl_id       - Access property list identifier for the link pointing to the object
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  April 18, 2008
+
+

SOURCE

+
  SUBROUTINE h5oopen_f(loc_id, name, obj_id, hdferr, lapl_id)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: loc_id  ! File or group identifier
+    CHARACTER(LEN=*), INTENT(IN) :: name  ! Path to the object, relative to loc_id
+    INTEGER(HID_T), INTENT(OUT) :: obj_id ! Object identifier for the opened object
+    INTEGER, INTENT(OUT) :: hdferr        ! Error code
+                                          !   Success:  0
+                                          !   Failure: -1
+    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id  ! Attribute access property list
+
+ +
+ +

h5open_by_addr_f

+ +

[ Top ] [ H5O ] [ Subroutines ]

+

NAME

+
  h5oopen_by_addr_f 
+
+

PURPOSE

+
  Opens an object using its address within an HDF5 file. 
+
+

INPUTS

+
    loc_id - File or group identifier
+    addr   - Object’s address in the file
+ OUTPUTS: 
+    obj_id - Object identifier for the opened object
+    hdferr - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  September 14, 2009
+
+

SOURCE

+
  SUBROUTINE h5oopen_by_addr_f(loc_id, addr, obj_id, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: loc_id  ! File or group identifier
+    INTEGER(HADDR_T), INTENT(IN) :: addr  ! Objectâs address in the file
+    INTEGER(HID_T), INTENT(OUT) :: obj_id ! Object identifier for the opened object
+    INTEGER, INTENT(OUT) :: hdferr        ! Error code:
+                                          ! 0 on success and -1 on failure
+
+ +
+ + + diff --git a/fortran/doc/DevelGuide/src/H5Pf_c.html b/fortran/doc/DevelGuide/src/H5Pf_c.html new file mode 100644 index 0000000..6b8079a --- /dev/null +++ b/fortran/doc/DevelGuide/src/H5Pf_c.html @@ -0,0 +1,41 @@ + + + + + + + +./src/H5Pf.c + + + + + +
+
+ +

H5Pf

+ +

[ Top ] [ Modules ]

+

PURPOSE

+
   This file contains C stubs for H5P Fortran APIs
+
+ +
+ + + diff --git a/fortran/doc/DevelGuide/src/H5Pff_F03_f90.html b/fortran/doc/DevelGuide/src/H5Pff_F03_f90.html new file mode 100644 index 0000000..51882ba --- /dev/null +++ b/fortran/doc/DevelGuide/src/H5Pff_F03_f90.html @@ -0,0 +1,832 @@ + + + + + + + +./src/H5Pff_F03.f90 + + + + + +
+
+ +

H5P (F03)

+ +

[ Top ] [ Modules ]

+

NAME

+
  H5P_PROVISIONAL
+
+

PURPOSE

+
  This file contains Fortran 90 and Fortran 2003 interfaces for H5P functions.
+  It contains the same functions as H5Pff_DEPRECIATE.f90 but includes the
+  Fortran 2003 functions and the interface listings. This file will be compiled
+  instead of H5Pff_DEPRECIATE.f90 if Fortran 2003 functions are enabled.
+
+

NOTES

+
                         *** IMPORTANT ***
+  If you add a new H5P function you must add the function name to the
+  Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory.
+  This is needed for Windows based operating systems.
+
+ +
+ +

h5pget_double

+ +

[ Top ] [ H5P (F03) ] [ Subroutines ]

+

NAME

+
  h5pget_double
+
+

PURPOSE

+
  Gets a property list value
+
+

INPUTS

+
  prp_id        - iproperty list identifier to modify
+  name          - name of property to modify
+
+

OUTPUTS

+
  value         - value of property
+  hdferr:       - error code
+                   Success:  0
+                   Failure: -1
+
+

AUTHOR

+
  Elena Pourmal
+  October 9, 2002
+
+

SOURCE

+
  SUBROUTINE h5pget_double(prp_id, name, value, hdferr)
+    USE, INTRINSIC :: ISO_C_BINDING
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id  ! Property list identifier
+    CHARACTER(LEN=*), INTENT(IN) :: name  ! Name of property to modify
+    DOUBLE PRECISION,   INTENT(OUT), TARGET :: value ! Property value
+    INTEGER, INTENT(OUT) :: hdferr        ! Error code
+
+ +
+ +

h5pcreate_class_f

+ +

[ Top ] [ H5P (F03) ] [ Subroutines ]

+

NAME

+
  h5pcreate_class_f
+
+

PURPOSE

+
  Create a new property list class
+
+

INPUTS

+
  parent        - Property list identifier of the parent class
+                  Possible values include:
+                   H5P_ROOT_F
+                   H5P_FILE_CREATE_F
+                   H5P_FILE_ACCESS_F
+                   H5P_DATASET_CREATE_F
+                   H5P_DATASET_XFER_F
+                   H5P_FILE_MOUNT_F
+  name          - name of the class we are creating
+
+

OUTPUTS

+
  class         - porperty list class identifier
+  hdferr:       - error code
+
+  Success: 0
+  Failure: -1
+
+

OPTIONAL PARAMETERS

+
  H5P_cls_create_func_t (create) - Callback routine called when a property list is created
+  create_data                    - User pointer to any class creation information needed
+  H5P_cls_copy_func_t   (copy)   - Callback routine called when a property list is copied
+  copy_data                      - User pointer to any class copy information needed
+  H5P_cls_close_func_t  (close)  - Callback routine called when a property list is being closed
+  close_data                     - User pointer to any class close information needed
+
+

AUTHOR

+
  Elena Pourmal
+  October 9, 2002
+
+

HISTORY

+
  Added callback arguments
+  M. Scot Breitenfeld, July 3, 2008
+
+

SOURCE

+
  SUBROUTINE h5pcreate_class_f(parent, name, class, hdferr, create, create_data, copy, copy_data, close, close_data)
+    USE iso_c_binding
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: parent  ! parent property list class identifier
+    CHARACTER(LEN=*), INTENT(IN) :: name  ! name of property tocreate
+    INTEGER(HID_T), INTENT(OUT) :: class  ! property list class identifier
+    INTEGER, INTENT(OUT) :: hdferr        ! Error code
+    TYPE(C_PTR), OPTIONAL :: create_data, copy_data, close_data
+    TYPE(C_FUNPTR), OPTIONAL :: create, copy, close
+
+ +
+ +

h5pget_char

+ +

[ Top ] [ H5P (F03) ] [ Subroutines ]

+

NAME

+
  h5pget_char
+
+

PURPOSE

+
  Gets a property list value
+
+

INPUTS

+
  prp_id        - iproperty list identifier to modify
+  name          - name of property to modify
+
+

OUTPUTS

+
  value         - value of property
+  hdferr:       - error code
+                   Success:  0
+                   Failure: -1
+
+

AUTHOR

+
  Elena Pourmal
+  October 9, 2002
+
+

SOURCE

+
  SUBROUTINE h5pget_char(prp_id, name, value, hdferr)
+    USE, INTRINSIC :: ISO_C_BINDING
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id   ! Property list identifier
+    CHARACTER(LEN=*), INTENT(IN) :: name   ! Name of property to modify
+    CHARACTER(LEN=*), INTENT(OUT) :: value ! Property value
+    INTEGER, INTENT(OUT) :: hdferr         ! Error code
+
+ +
+ +

h5pget_integer

+ +

[ Top ] [ H5P (F03) ] [ Subroutines ]

+

NAME

+
  h5pget_integer
+
+

PURPOSE

+
  Gets a property list value
+
+

INPUTS

+
  prp_id        - iproperty list identifier to modify
+  name          - name of property to modify
+
+

OUTPUTS

+
  value         - value of property
+  hdferr:       - error code
+                   Success:  0
+                   Failure: -1
+
+

AUTHOR

+
  Elena Pourmal
+  October 9, 2002
+
+

SOURCE

+
  SUBROUTINE h5pget_integer(prp_id, name, value, hdferr)
+    USE, INTRINSIC :: ISO_C_BINDING
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id    ! Property list identifier
+    CHARACTER(LEN=*), INTENT(IN) :: name    ! Name of property to modify
+    INTEGER,   INTENT(OUT), TARGET :: value ! Property value
+    INTEGER, INTENT(OUT) :: hdferr          ! Error code
+
+ +
+ +

h5pget_real

+ +

[ Top ] [ H5P (F03) ] [ Subroutines ]

+

NAME

+
  h5pget_real
+
+

PURPOSE

+
  Gets a property list value
+
+

INPUTS

+
  prp_id        - iproperty list identifier to modify
+  name          - name of property to modify
+
+

OUTPUTS

+
  value         - value of property
+  hdferr:       - error code
+                   Success:  0
+                   Failure: -1
+
+

AUTHOR

+
  Elena Pourmal
+  October 9, 2002
+
+

SOURCE

+
  SUBROUTINE h5pget_real(prp_id, name, value, hdferr)
+    USE, INTRINSIC :: ISO_C_BINDING
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
+    CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to modify
+    REAL,   INTENT(OUT), TARGET :: value ! Property value
+    INTEGER, INTENT(OUT) :: hdferr       ! Error code
+
+ +
+ +

h5pinsert_char

+ +

[ Top ] [ H5P (F03) ] [ Subroutines ]

+

NAME

+
  h5pinsert_char
+
+

PURPOSE

+
  Registers a temporary property with a property list class.
+
+

INPUTS

+
  plist         - property list identifier
+                  permanent property within
+  name          - name of property to insert
+  size          - size of property in bytes
+  value         - initial value for the property
+
+

OUTPUTS

+
  hdferr:       - error code
+                   Success:  0
+                   Failure: -1
+
+

AUTHOR

+
  Elena Pourmal
+  October 10, 2002
+
+

SOURCE

+
  SUBROUTINE h5pinsert_char(plist, name, size, value, hdferr)
+    USE iso_c_binding
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: plist      ! Property list identifier
+    CHARACTER(LEN=*), INTENT(IN) :: name     ! Name of property to insert
+    INTEGER(SIZE_T), INTENT(IN) :: size      ! Size of property value
+    CHARACTER(LEN=*),   INTENT(IN) :: value  ! Property value
+    INTEGER, INTENT(OUT) :: hdferr           ! Error code
+
+ +
+ +

h5pinsert_double

+ +

[ Top ] [ H5P (F03) ] [ Subroutines ]

+

NAME

+
  h5pinsert_double
+
+

PURPOSE

+
  Registers a temporary property with a property list class.
+
+

INPUTS

+
  plist         - property list identifier
+                  permanent property within
+  name          - name of property to insert
+  size          - size of property in bytes
+  value         - initial value for the property
+
+

OUTPUTS

+
  hdferr:       - error code
+                   Success:  0
+                   Failure: -1
+
+

OPTIONAL PARAMETERS

+
  NONE
+
+

AUTHOR

+
  Elena Pourmal
+  October 10, 2002
+
+

SOURCE

+
  SUBROUTINE h5pinsert_double(plist, name, size, value, hdferr)
+    USE iso_c_binding
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: plist   ! Property list identifier
+    CHARACTER(LEN=*), INTENT(IN) :: name  ! Name of property to insert
+    INTEGER(SIZE_T), INTENT(IN) :: size   ! Size of the property value
+    DOUBLE PRECISION, INTENT(IN), TARGET :: value ! Property value
+    INTEGER, INTENT(OUT) :: hdferr        ! Error code
+
+ +
+ +

h5pinsert_integer

+ +

[ Top ] [ H5P (F03) ] [ Subroutines ]

+

NAME

+
  h5pinsert_integer
+
+

PURPOSE

+
  Registers a temporary property with a property list class.
+
+

INPUTS

+
  plist         - property list identifier
+  name          - name of property to insert
+  size          - size of property in bytes
+  value         - initial value for the property
+
+

OUTPUTS

+
  hdferr:       - error code
+                   Success:  0
+                   Failure: -1
+
+

AUTHOR

+
  Elena Pourmal
+  October 10, 2002
+
+

SOURCE

+
  SUBROUTINE h5pinsert_integer(plist, name, size, value, hdferr)
+    USE iso_c_binding
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: plist    ! Property list identifier
+    CHARACTER(LEN=*), INTENT(IN) :: name   ! Name of property to insert
+    INTEGER(SIZE_T), INTENT(IN) :: size    ! Size of the property value
+    INTEGER,   INTENT(IN), TARGET :: value ! Property value
+    INTEGER, INTENT(OUT) :: hdferr         ! Error code
+
+ +
+ +

h5pinsert_ptr

+ +

[ Top ] [ H5P (F03) ] [ Subroutines ]

+

NAME

+
  h5pinsert_ptr
+
+

PURPOSE

+
  Registers a temporary property with a property list class.
+
+

INPUTS

+
  plist         - property list identifier
+                  permanent property within
+  name          - name of property to insert
+  size          - size of property in bytes
+  value         - initial value for the property
+
+

OUTPUTS

+
  hdferr:       - error code
+                   Success:  0
+                   Failure: -1
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  June 24, 2008
+
+

SOURCE

+
  SUBROUTINE h5pinsert_ptr(plist, name, size, value, hdferr)
+    USE iso_c_binding
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: plist  ! Property list identifier
+    CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to insert
+    INTEGER(SIZE_T), INTENT(IN) :: size  ! Size of property value
+    TYPE(c_ptr),   INTENT(IN) :: value   ! Property value
+    INTEGER, INTENT(OUT) :: hdferr       ! Error code
+
+ +
+ +

h5pinsert_real

+ +

[ Top ] [ H5P (F03) ] [ Subroutines ]

+

NAME

+
  h5pinsert_real
+
+

PURPOSE

+
  Registers a temporary property with a property list class.
+
+

INPUTS

+
  plist         - property list identifier
+                  permanent property within
+  name          - name of property to insert
+  size          - size of property in bytes
+  value         - initial value for the property
+
+

OUTPUTS

+
  hdferr:       - error code
+                   Success:  0
+                   Failure: -1
+
+

AUTHOR

+
  Elena Pourmal
+  October 10, 2002
+
+

SOURCE

+
  SUBROUTINE h5pinsert_real(plist, name, size, value, hdferr)
+    USE iso_c_binding
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: plist   ! Property list identifier
+    CHARACTER(LEN=*), INTENT(IN) :: name  ! Name of property to insert
+    INTEGER(SIZE_T), INTENT(IN) :: size   ! Size of the property value
+    REAL,   INTENT(IN), TARGET :: value   ! Property value
+    INTEGER, INTENT(OUT) :: hdferr        ! Error code
+
+ +
+ +

h5pregister_char

+ +

[ Top ] [ H5P (F03) ] [ Subroutines ]

+

NAME

+
  h5pregister_char
+
+

PURPOSE

+
  Registers a permanent property with a property list class.
+
+

INPUTS

+
  class         - property list class to register
+                  permanent property within
+  name          - name of property to register
+  size          - size of property in bytes
+  value         - default value for property in newly
+                  created property lists
+
+

OUTPUTS

+
  hdferr:       - error code
+                   Success:  0
+                   Failure: -1
+
+

AUTHOR

+
  Elena Pourmal
+  October 10, 2002
+
+

SOURCE

+
  SUBROUTINE h5pregister_char(class, name, size, value, hdferr)
+    USE ISO_C_BINDING
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: class     ! Property list class identifier
+    CHARACTER(LEN=*), INTENT(IN) :: name    ! Name of property to register
+    INTEGER(SIZE_T), INTENT(IN) :: size     ! size of the property value
+    CHARACTER(LEN=*),   INTENT(IN) :: value ! Property value
+    INTEGER, INTENT(OUT) :: hdferr          ! Error code
+
+ +
+ +

h5pregister_double

+ +

[ Top ] [ H5P (F03) ] [ Subroutines ]

+

NAME

+
  h5pregister_double
+
+

PURPOSE

+
  Registers a permanent property with a property list class.
+
+

INPUTS

+
  class         - property list class to register
+                  permanent property within
+  name          - name of property to register
+  size          - size of property in bytes
+  value         - default value for property in newly
+                  created property lists
+
+

OUTPUTS

+
  hdferr:       - error code
+                   Success:  0
+                   Failure: -1
+
+

AUTHOR

+
  Elena Pourmal
+  October 10, 2002
+
+

SOURCE

+
  SUBROUTINE h5pregister_double(class, name, size, value, hdferr)
+    USE ISO_C_BINDING
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: class  ! Property list class identifier
+    CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to register
+    INTEGER(SIZE_T), INTENT(IN) :: size  ! size of the property value
+    DOUBLE PRECISION,   INTENT(IN), TARGET :: value ! Property value
+    INTEGER, INTENT(OUT) :: hdferr       ! Error code
+
+ +
+ +

h5pregister_integer

+ +

[ Top ] [ H5P (F03) ] [ Subroutines ]

+

NAME

+
  h5pregister_integer
+
+

PURPOSE

+
  Registers a permanent property with a property list class.
+
+

INPUTS

+
  class         - property list class to register
+                  permanent property within
+  name          - name of property to register
+  size          - size of property in bytes
+  value         - default value for property in newly
+                  created property lists
+
+

OUTPUTS

+
  hdferr:       - error code
+                   Success:  0
+                   Failure: -1
+
+

AUTHOR

+
  Elena Pourmal
+  October 10, 2002
+
+

SOURCE

+
  SUBROUTINE h5pregister_integer(class, name, size, value, hdferr)
+    USE ISO_C_BINDING
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: class    ! Property list class identifier
+    CHARACTER(LEN=*), INTENT(IN) :: name   ! Name of property to register
+    INTEGER(SIZE_T), INTENT(IN) :: size    ! Size of the property value
+    INTEGER,   INTENT(IN), TARGET :: value ! Property value
+    INTEGER, INTENT(OUT) :: hdferr         ! Error code
+
+ +
+ +

h5pregister_ptr

+ +

[ Top ] [ H5P (F03) ] [ Subroutines ]

+

NAME

+
  h5pregister_ptr
+
+

PURPOSE

+
  Registers a permanent property with a property list class.
+
+

INPUTS

+
  class         - property list class to register
+                  permanent property within
+  name          - name of property to register
+  size          - size of property in bytes
+  value         - default value for property in newly
+                  created property lists
+
+

OUTPUTS

+
  hdferr:       - error code
+                   Success:  0
+                   Failure: -1
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  June 24, 2008
+
+

SOURCE

+
  SUBROUTINE h5pregister_ptr(class, name, size, value, hdferr)
+    USE ISO_C_BINDING
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: class   ! Property list class identifier
+    CHARACTER(LEN=*), INTENT(IN) :: name  ! Name of property to register
+    INTEGER(SIZE_T), INTENT(IN) :: size   ! Size of the property value
+    TYPE(C_PTR), INTENT(IN) :: value      ! Property value
+    INTEGER, INTENT(OUT) :: hdferr        ! Error code
+
+ +
+ +

h5pregister_real

+ +

[ Top ] [ H5P (F03) ] [ Subroutines ]

+

NAME

+
  h5pregister_real
+
+

PURPOSE

+
  Registers a permanent property with a property list class.
+
+

INPUTS

+
  class         - property list class to register
+                  permanent property within
+  name          - name of property to register
+  size          - size of property in bytes
+  value         - default value for property in newly
+                  created property lists
+
+

OUTPUTS

+
  hdferr:       - error code
+                   Success:  0
+                   Failure: -1
+
+

AUTHOR

+
  Elena Pourmal
+  October 10, 2002
+
+

SOURCE

+
  SUBROUTINE h5pregister_real(class, name, size, value, hdferr)
+    USE ISO_C_BINDING
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: class   ! Property list class identifier
+    CHARACTER(LEN=*), INTENT(IN) :: name  ! Name of property to register
+    INTEGER(SIZE_T), INTENT(IN) :: size   ! size of the property value
+    REAL,   INTENT(IN), TARGET :: value   ! Property value
+    INTEGER, INTENT(OUT) :: hdferr        ! Error code
+
+ +
+ +

h5pset(get)fill_value_f

+ +

[ Top ] [ H5P (F03) ] [ Subroutines ]

+

NAME

+
  h5pset(get)fill_value_f
+
+

PURPOSE

+
  Sets(gets) fill value for a dataset creation property list
+
+

INPUTS

+
  prp_id        - dataset creation property list identifier
+  type_id       - datatype identifier for fill value
+  fillvalue     - fill value
+
+

OUTPUTS

+
  type_id       - datatype identifier for fill value
+  fillvalue     - fill value
+  hdferr:       - error code
+                   Success:  0
+                   Failure: -1
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 14, 2001
+
+  Added the recommended way of passing fillvalue
+  and that is by passing the C address, all other
+  ways are obsolete and should be avoided. June, 2008 MSB
+
+

NOTES

+
  h5pset(get)fill_value_f function is overloaded to support
+  INTEGER, REAL, DOUBLE PRECISION and CHARACTER dtatypes.
+
+

SOURCE

+
  SUBROUTINE h5pset_fill_value_integer(prp_id, type_id, fillvalue, hdferr)
+    USE, INTRINSIC :: ISO_C_BINDING
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id  ! Property list identifier
+    INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier of
+                                          ! of fillvalue datatype
+                                          ! (in memory)
+    INTEGER, INTENT(IN), TARGET :: fillvalue   ! Fillvalue
+    INTEGER, INTENT(OUT) :: hdferr  ! Error code
+
+ +
+ +

h5pset_char

+ +

[ Top ] [ H5P (F03) ] [ Subroutines ]

+

NAME

+
  h5pset_char
+
+

PURPOSE

+
  Sets a property list value
+
+

INPUTS

+
  prp_id        - iproperty list identifier to modify
+  name          - name of property to modify
+  value         - value to set property to
+
+

OUTPUTS

+
  hdferr:       - error code
+                   Success:  0
+                   Failure: -1
+
+

OPTIONAL PARAMETERS

+
  NONE
+
+

AUTHOR

+
  Elena Pourmal
+  October 9, 2002
+
+

SOURCE

+
  SUBROUTINE h5pset_char(prp_id, name, value, hdferr)
+    USE, INTRINSIC :: ISO_C_BINDING
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id    ! Property list identifier
+    CHARACTER(LEN=*), INTENT(IN) :: name    ! Name of property to modify
+    CHARACTER(LEN=*),   INTENT(IN) :: value ! Property value
+    INTEGER, INTENT(OUT) :: hdferr          ! Error code
+
+ +
+ +

h5pset_double

+ +

[ Top ] [ H5P (F03) ] [ Subroutines ]

+

NAME

+
  h5pset_double
+
+

PURPOSE

+
  Sets a property list value
+
+

INPUTS

+
  prp_id        - iproperty list identifier to modify
+  name          - name of property to modify
+  value         - value to set property to
+
+

OUTPUTS

+
  hdferr:       - error code
+                    Success:  0
+                    Failure: -1
+
+

AUTHOR

+
  Elena Pourmal
+  October 9, 2002
+
+

SOURCE

+
  SUBROUTINE h5pset_double(prp_id, name, value, hdferr)
+    USE, INTRINSIC :: ISO_C_BINDING
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id  ! Property list identifier
+    CHARACTER(LEN=*), INTENT(IN) :: name  ! Name of property to modify
+    DOUBLE PRECISION,   INTENT(IN), TARGET :: value ! Property value
+    INTEGER, INTENT(OUT) :: hdferr                  ! Error code
+
+ +
+ +

h5pset_integer

+ +

[ Top ] [ H5P (F03) ] [ Subroutines ]

+

NAME

+
  h5pset_integer
+
+

PURPOSE

+
  Sets a property list value
+
+

INPUTS

+
  prp_id        - iproperty list identifier to modify
+  name          - name of property to modify
+  value         - value to set property to
+
+

OUTPUTS

+
  hdferr:       - error code
+                   Success:  0
+                   Failure: -1
+
+

AUTHOR

+
  Elena Pourmal
+  October 9, 2002
+
+

SOURCE

+
  SUBROUTINE h5pset_integer(prp_id, name, value, hdferr)
+    USE, INTRINSIC :: ISO_C_BINDING
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id   ! Property list identifier
+    CHARACTER(LEN=*), INTENT(IN) :: name   ! Name of property to modify
+    INTEGER,   INTENT(IN), TARGET :: value ! Property value
+    INTEGER, INTENT(OUT) :: hdferr         ! Error code
+
+ +
+ +

h5pset_real

+ +

[ Top ] [ H5P (F03) ] [ Subroutines ]

+

NAME

+
  h5pset_real
+
+

PURPOSE

+
  Sets a property list value
+
+

INPUTS

+
  prp_id        - iproperty list identifier to modify
+  name          - name of property to modify
+  value         - value to set property to
+
+

OUTPUTS

+
  hdferr:       - error code
+                   Success:  0
+                    Failure: -1
+
+

AUTHOR

+
  Elena Pourmal
+  October 9, 2002
+
+

SOURCE

+
  SUBROUTINE h5pset_real(prp_id, name, value, hdferr)
+    USE, INTRINSIC :: ISO_C_BINDING
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
+    CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to modify
+    REAL,   INTENT(IN), TARGET :: value  ! Property value
+    INTEGER, INTENT(OUT) :: hdferr       ! Error code
+
+ +
+ + + diff --git a/fortran/doc/DevelGuide/src/H5Pff_F90_f90.html b/fortran/doc/DevelGuide/src/H5Pff_F90_f90.html new file mode 100644 index 0000000..5f8d579 --- /dev/null +++ b/fortran/doc/DevelGuide/src/H5Pff_F90_f90.html @@ -0,0 +1,715 @@ + + + + + + + +./src/H5Pff_F90.f90 + + + + + +
+
+ +

H5P (_F90)

+ +

[ Top ] [ Modules ]

+

NAME

+
  H5P_PROVISIONAL
+
+

PURPOSE

+
  This file contains Fortran 90 interfaces for H5P functions. It contains
+  the same functions as H5Pff_F03.f90 but excludes the Fortran 2003 functions
+  and the interface listings. This file will be compiled instead of H5Pff_F03.f90
+  if Fortran 2003 functions are not enabled.
+
+

NOTES

+
                         *** IMPORTANT ***
+  If you add a new H5P function you must add the function name to the
+  Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory.
+  This is needed for Windows based operating systems.
+
+ +
+ +

h5pcreate_class_f

+ +

[ Top ] [ H5P (F90) ] [ Subroutines ]

+

NAME

+
  h5pcreate_class_f
+
+

PURPOSE

+
  Create a new property list class
+
+

INPUTS

+
  parent        - Property list identifier of the parent class
+                  Possible values include:
+                    H5P_ROOT_F
+                    H5P_FILE_CREATE_F
+                    H5P_FILE_ACCESS_F
+                    H5P_DATASET_CREATE_F
+                    H5P_DATASET_XFER_F
+                    H5P_FILE_MOUNT_F
+  name          - name of the class we are creating
+
+

OUTPUTS

+
  class         - property list class identifier
+  hdferr        - error code
+                   Success: 0
+                   Failure: -1
+
+

AUTHOR

+
  Elena Pourmal
+  October 9, 2002
+
+

SOURCE

+
  SUBROUTINE h5pcreate_class_f(parent, name, class, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: parent  ! parent property list class
+                                          ! identifier
+    CHARACTER(LEN=*), INTENT(IN) :: name  ! name of property tocreate
+    INTEGER(HID_T), INTENT(OUT) :: class  ! property list class identifier
+    INTEGER, INTENT(OUT) :: hdferr        ! Error code
+
+ +
+ +

h5pget_char

+ +

[ Top ] [ H5P (F90) ] [ Subroutines ]

+

NAME

+
  h5pget_char
+
+

PURPOSE

+
  Gets a property list value
+
+

INPUTS

+
  prp_id        - iproperty list identifier to modify
+  name          - name of property to modify
+
+

OUTPUTS

+
  value         - value of property
+  hdferr        - error code
+                   Success:  0
+                   Failure: -1
+
+

AUTHOR

+
  Elena Pourmal
+  October 9, 2002
+
+

SOURCE

+
  SUBROUTINE h5pget_char(prp_id, name, value, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id     ! Property list identifier
+    CHARACTER(LEN=*), INTENT(IN) :: name     ! Name of property to modify
+    CHARACTER(LEN=*),   INTENT(OUT) :: value ! Property value
+    INTEGER, INTENT(OUT) :: hdferr           ! Error code
+
+ +
+ +

h5pget_double

+ +

[ Top ] [ H5P (F90) ] [ Subroutines ]

+

NAME

+
  h5pget_double
+
+

PURPOSE

+
  Gets a property list value
+
+

INPUTS

+
  prp_id        - iproperty list identifier to modify
+  name          - name of property to modify
+
+

OUTPUTS

+
  value         - value of property
+  hdferr        - error code
+                   Success:  0
+                   Failure: -1
+
+

AUTHOR

+
  Elena Pourmal
+  October 9, 2002
+
+

SOURCE

+
  SUBROUTINE h5pget_double(prp_id, name, value, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id     ! Property list identifier
+    CHARACTER(LEN=*), INTENT(IN) :: name     ! Name of property to modify
+    DOUBLE PRECISION,   INTENT(OUT) :: value ! Property value
+    INTEGER, INTENT(OUT) :: hdferr           ! Error code
+
+ +
+ +

h5pget_integer

+ +

[ Top ] [ H5P (F90) ] [ Subroutines ]

+

NAME

+
  h5pget_integer
+
+

PURPOSE

+
  Gets a property list value
+
+

INPUTS

+
  prp_id        - iproperty list identifier to modify
+  name          - name of property to modify
+
+

OUTPUTS

+
  value         - value of property
+  hdferr        - error code
+                   Success:  0
+                   Failure: -1
+
+

AUTHOR

+
  Elena Pourmal
+  October 9, 2002
+
+

SOURCE

+
  SUBROUTINE h5pget_integer(prp_id, name, value, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id  ! Property list identifier
+    CHARACTER(LEN=*), INTENT(IN) :: name  ! Name of property to modify
+    INTEGER,   INTENT(OUT) :: value       ! Property value
+    INTEGER, INTENT(OUT) :: hdferr        ! Error code
+
+ +
+ +

h5pget_real

+ +

[ Top ] [ H5P (F90) ] [ Subroutines ]

+

NAME

+
  h5pget_real
+
+

PURPOSE

+
  Gets a property list value
+
+

INPUTS

+
  prp_id        - iproperty list identifier to modify
+  name          - name of property to modify
+
+

OUTPUTS

+
  value         - value of property
+  hdferr        - error code
+                   Success:  0
+                   Failure: -1
+
+

AUTHOR

+
  Elena Pourmal
+  October 9, 2002
+
+

SOURCE

+
  SUBROUTINE h5pget_real(prp_id, name, value, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id  ! Property list identifier
+    CHARACTER(LEN=*), INTENT(IN) :: name  ! Name of property to modify
+    REAL,   INTENT(OUT) :: value          ! Property value
+    INTEGER, INTENT(OUT) :: hdferr        ! Error code
+
+ +
+ +

h5pinsert_char

+ +

[ Top ] [ H5P (F90) ] [ Subroutines ]

+

NAME

+
  h5pinsert_char
+
+

PURPOSE

+
  Registers a temporary property with a property list class.
+
+

INPUTS

+
  plist         - property list identifier
+                  permanent property within
+  name          - name of property to insert
+  size          - size of property in bytes
+  value         - initial value for the property
+
+

OUTPUTS

+
  hdferr        - error code
+                   Success:  0
+                   Failure: -1
+
+

AUTHOR

+
  Elena Pourmal
+  October 10, 2002
+
+

SOURCE

+
SUBROUTINE h5pinsert_char(plist, name, size, value, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: plist      ! Property list identifier
+    CHARACTER(LEN=*), INTENT(IN) :: name     ! Name of property to insert
+    INTEGER(SIZE_T), INTENT(IN) :: size      ! Size of property value
+    CHARACTER(LEN=*),   INTENT(IN) :: value  ! Property value
+    INTEGER, INTENT(OUT) :: hdferr           ! Error code
+
+ +
+ +

h5pinsert_double

+ +

[ Top ] [ H5P (F90) ] [ Subroutines ]

+

NAME

+
  h5pinsert_double
+
+

PURPOSE

+
  Registers a temporary property with a property list class.
+
+

INPUTS

+
  plist         - property list identifier
+                  permanent property within
+  name          - name of property to insert
+  size          - size of property in bytes
+  value         - initial value for the property
+
+

OUTPUTS

+
  hdferr        - error code
+                   Success:  0
+                   Failure: -1
+
+

AUTHOR

+
  Elena Pourmal
+  October 10, 2002
+
+

SOURCE

+
  SUBROUTINE h5pinsert_double(plist, name, size, value, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: plist   ! Property list identifier
+    CHARACTER(LEN=*), INTENT(IN) :: name  ! Name of property to insert
+    INTEGER(SIZE_T), INTENT(IN) :: size   ! Size of the property value
+    DOUBLE PRECISION, INTENT(IN) :: value ! Property value
+    INTEGER, INTENT(OUT) :: hdferr        ! Error code
+
+ +
+ +

h5pinsert_integer

+ +

[ Top ] [ H5P (F90) ] [ Subroutines ]

+

NAME

+
  h5pinsert_integer
+
+

PURPOSE

+
  Registers a temporary property with a property list class.
+
+

INPUTS

+
  plist         - property list identifier
+  name          - name of property to insert
+  size          - size of property in bytes
+  value         - initial value for the property
+
+

OUTPUTS

+
  hdferr        - error code
+                   Success:  0
+                   Failure: -1
+
+

AUTHOR

+
  Elena Pourmal
+  October 10, 2002
+
+

SOURCE

+
  SUBROUTINE h5pinsert_integer(plist, name, size, value, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: plist   ! Property list identifier
+    CHARACTER(LEN=*), INTENT(IN) :: name  ! Name of property to insert
+    INTEGER(SIZE_T), INTENT(IN) :: size   ! Size of the property value
+    INTEGER,   INTENT(IN) :: value        ! Property value
+    INTEGER, INTENT(OUT) :: hdferr        ! Error code
+
+ +
+ +

h5pinsert_real

+ +

[ Top ] [ H5P (F90) ] [ Subroutines ]

+

NAME

+
  h5pinsert_real
+
+

PURPOSE

+
  Registers a temporary property with a property list class.
+
+

INPUTS

+
  plist         - property list identifier
+                  permanent property within
+  name          - name of property to insert
+  size          - size of property in bytes
+  value         - initial value for the property
+
+

OUTPUTS

+
  hdferr        - error code
+                   Success:  0
+                   Failure: -1
+
+

AUTHOR

+
  Elena Pourmal
+  October 10, 2002
+
+

SOURCE

+
  SUBROUTINE h5pinsert_real(plist, name, size, value, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: plist   ! Property list identifier
+    CHARACTER(LEN=*), INTENT(IN) :: name  ! Name of property to insert
+    INTEGER(SIZE_T), INTENT(IN) :: size   ! Size of the property value
+    REAL,   INTENT(IN) :: value           ! Property value
+    INTEGER, INTENT(OUT) :: hdferr        ! Error code
+
+ +
+ +

h5pregister_char

+ +

[ Top ] [ H5P (F90) ] [ Subroutines ]

+

NAME

+
  h5pregister_char
+
+

PURPOSE

+
  Registers a permanent property with a property list class.
+
+

INPUTS

+
  class         - property list class to register
+                  permanent property within
+  name          - name of property to register
+  size          - size of property in bytes
+  value         - default value for property in newly
+                  created property lists
+
+

OUTPUTS

+
  hdferr        - error code
+                   Success:  0
+                   Failure: -1
+
+

AUTHOR

+
  Elena Pourmal
+  October 10, 2002
+
+

SOURCE

+
  SUBROUTINE h5pregister_char(class, name, size, value, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: class     ! Property list class identifier
+    CHARACTER(LEN=*), INTENT(IN) :: name    ! Name of property to register
+    INTEGER(SIZE_T), INTENT(IN) :: size     ! size of the property value
+    CHARACTER(LEN=*),   INTENT(IN) :: value ! Property value
+    INTEGER, INTENT(OUT) :: hdferr          ! Error code
+
+ +
+ +

h5pregister_double

+ +

[ Top ] [ H5P (F90) ] [ Subroutines ]

+

NAME

+
  h5pregister_double
+
+

PURPOSE

+
  Registers a permanent property with a property list class.
+
+

INPUTS

+
  class         - property list class to register
+                  permanent property within
+  name          - name of property to register
+  size          - size of property in bytes
+  value         - default value for property in newly
+                  created property lists
+
+

OUTPUTS

+
  hdferr        - error code
+                   Success:  0
+                   Failure: -1
+
+

AUTHOR

+
  Elena Pourmal
+  October 10, 2002
+
+

SOURCE

+
  SUBROUTINE h5pregister_double(class, name, size, value, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: class     ! Property list class identifier
+    CHARACTER(LEN=*), INTENT(IN) :: name    ! Name of property to register
+    INTEGER(SIZE_T), INTENT(IN) :: size     ! Size of the property value
+    DOUBLE PRECISION,   INTENT(IN) :: value ! Property value
+    INTEGER, INTENT(OUT) :: hdferr          ! Error code
+
+ +
+ +

h5pregister_integer

+ +

[ Top ] [ H5P (F90) ] [ Subroutines ]

+

NAME

+
  h5pregister_integer
+
+

PURPOSE

+
  Registers a permanent property with a property list class.
+
+

INPUTS

+
  class         - property list class to register
+  permanent property within
+  name          - name of property to register
+  size          - size of property in bytes
+  value         - default value for property in newly
+  created property lists
+
+

OUTPUTS

+
  hdferr        - error code
+                   Success:  0
+                   Failure: -1
+
+

AUTHOR

+
  Elena Pourmal
+  October 10, 2002
+
+

SOURCE

+
  SUBROUTINE h5pregister_integer(class, name, size, value, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: class   ! Property list class identifier
+    CHARACTER(LEN=*), INTENT(IN) :: name  ! Name of property to register
+    INTEGER(SIZE_T), INTENT(IN) :: size   ! Size of the property value
+    INTEGER,   INTENT(IN) :: value        ! Property value
+    INTEGER, INTENT(OUT) :: hdferr        ! Error code
+
+ +
+ +

h5pregister_real

+ +

[ Top ] [ H5P (F90) ] [ Subroutines ]

+

NAME

+
  h5pregister_real
+
+ PURPOSE       Registers a permanent property with a property list class.
+
+

INPUTS

+
  class         - property list class to register
+                  permanent property within
+  name          - name of property to register
+  size          - size of property in bytes
+  value         - default value for property in newly
+                  created property lists
+
+

OUTPUTS

+
  hdferr        - error code
+                   Success:  0
+                   Failure: -1
+
+

AUTHOR

+
  Elena Pourmal
+  October 10, 2002
+
+

SOURCE

+
  SUBROUTINE h5pregister_real(class, name, size, value, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: class   ! Property list class identifier
+    CHARACTER(LEN=*), INTENT(IN) :: name  ! Name of property to register
+    INTEGER(SIZE_T), INTENT(IN) :: size   ! size of the property value
+    REAL,   INTENT(IN) :: value           ! Property value
+    INTEGER, INTENT(OUT) :: hdferr        ! Error code
+
+ +
+ +

h5pset(get)fill_value_f

+ +

[ Top ] [ H5P (F90) ] [ Subroutines ]

+

NAME

+
  h5pset(get)fill_value_f
+
+

PURPOSE

+
  Sets(gets) fill value for a dataset creation property list
+
+

INPUTS

+
  prp_id        - dataset creation property list identifier
+  type_id       - datatype identifier for fill value
+  fillvalue     - fill value
+
+

OUTPUTS

+
  type_id      - datatype identifier for fill value
+  fillvalue    - fill value
+  hdferr       - error code
+                  Success:  0
+                  Failure: -1
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 14, 2001
+
+

NOTES

+
  h5pset(get)fill_value_f function is overloaded to support
+  INTEGER, REAL, DOUBLE PRECISION and CHARACTER dtatypes.
+
+

SOURCE

+
  SUBROUTINE h5pset_fill_value_integer(prp_id, type_id, fillvalue, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id  ! Property list identifier
+    INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier of
+                                          ! of fillvalue datatype
+                                          ! (in memory)
+    INTEGER, INTENT(IN) :: fillvalue      ! Fillvalue
+    INTEGER, INTENT(OUT) :: hdferr        ! Error code
+
+ +
+ +

h5pset_char

+ +

[ Top ] [ H5P (F90) ] [ Subroutines ]

+

NAME

+
  h5pset_char
+
+

PURPOSE

+
  Sets a property list value
+
+

INPUTS

+
  prp_id        - iproperty list identifier to modify
+  name          - name of property to modify
+  value         - value to set property to
+
+

OUTPUTS

+
  hdferr        - error code
+                   Success:  0
+                   Failure: -1
+
+

OPTIONAL PARAMETERS

+
  NONE
+
+

AUTHOR

+
  Elena Pourmal
+  October 9, 2002
+
+

SOURCE

+
  SUBROUTINE h5pset_char(prp_id, name, value, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id    ! Property list identifier
+    CHARACTER(LEN=*), INTENT(IN) :: name    ! Name of property to modify
+    CHARACTER(LEN=*),   INTENT(IN) :: value ! Property value
+    INTEGER, INTENT(OUT) :: hdferr          ! Error code
+
+ +
+ +

h5pset_double

+ +

[ Top ] [ H5P (F90) ] [ Subroutines ]

+

NAME

+
  h5pset_double
+
+

PURPOSE

+
  Sets a property list value
+
+

INPUTS

+
  prp_id        - iproperty list identifier to modify
+  name          - name of property to modify
+  value         - value to set property to
+
+

OUTPUTS

+
  hdferr:       - error code
+                   Success:  0
+                   Failure: -1
+
+

AUTHOR

+
  Elena Pourmal
+  October 9, 2002
+
+

SOURCE

+
  SUBROUTINE h5pset_double(prp_id, name, value, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id    ! Property list identifier
+    CHARACTER(LEN=*), INTENT(IN) :: name    ! Name of property to modify
+    DOUBLE PRECISION,   INTENT(IN) :: value ! Property value
+    INTEGER, INTENT(OUT) :: hdferr          ! Error code
+
+ +
+ +

h5pset_integer

+ +

[ Top ] [ H5P (F90) ] [ Subroutines ]

+

NAME

+
  h5pset_integer
+
+

PURPOSE

+
  Sets a property list value
+
+

INPUTS

+
  prp_id        - iproperty list identifier to modify
+  name          - name of property to modify
+  value         - value to set property to
+
+

OUTPUTS

+
  hdferr:       - error code
+                   Success:  0
+                   Failure: -1
+
+

AUTHOR

+
  Elena Pourmal
+  October 9, 2002
+
+

SOURCE

+
  SUBROUTINE h5pset_integer(prp_id, name, value, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id  ! Property list identifier
+    CHARACTER(LEN=*), INTENT(IN) :: name  ! Name of property to modify
+    INTEGER, INTENT(IN) :: value          ! Property value
+    INTEGER, INTENT(OUT) :: hdferr        ! Error code
+
+ +
+ +

h5pset_real

+ +

[ Top ] [ H5P (F90) ] [ Subroutines ]

+

NAME

+
  h5pset_real
+
+

PURPOSE

+
  Sets a property list value
+
+

INPUTS

+
  prp_id        - iproperty list identifier to modify
+  name          - name of property to modify
+  value         - value to set property to
+
+

OUTPUTS

+
  hdferr:       - error code
+                   Success:  0
+                   Failure: -1
+
+

AUTHOR

+
  Elena Pourmal
+  October 9, 2002
+
+

SOURCE

+
  SUBROUTINE h5pset_real(prp_id, name, value, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id  ! Property list identifier
+    CHARACTER(LEN=*), INTENT(IN) :: name  ! Name of property to modify
+    REAL, INTENT(IN) :: value             ! Property value
+    INTEGER, INTENT(OUT) :: hdferr        ! Error code
+
+ +
+ + + diff --git a/fortran/doc/DevelGuide/src/H5Pff_f90.html b/fortran/doc/DevelGuide/src/H5Pff_f90.html new file mode 100644 index 0000000..0e9ff5c --- /dev/null +++ b/fortran/doc/DevelGuide/src/H5Pff_f90.html @@ -0,0 +1,4752 @@ + + + + + + + +./src/H5Pff.f90 + + + + + +
+
+ +

H5P (F90)

+ +

[ Top ] [ Modules ]

+

NAME

+
  H5P_PROVISIONAL
+
+

PURPOSE

+
  This file contains Fortran interfaces for H5P functions. It includes
+  all the functions that are independent on whether the Fortran 2003 functions
+  are enabled or disabled.
+
+

NOTES

+
                         *** IMPORTANT ***
+  If you add a new H5P function you must add the function name to the
+  Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory.
+  This is needed for Windows based operating systems.
+
+ +
+ +

h5pget_hyper_vector_size_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  h5pget_hyper_vector_size_f 
+
+

PURPOSE

+
  Get the number of "I/O" vectors (vector size)
+
+

INPUTS

+
  plist_id     - dataset transfer property list identifier
+
+

OUTPUTS

+
  size         - vector size
+  hdferr       - error code            
+                  Success:  0
+                  Failure: -1
+
+

AUTHOR

+
  Elena Pourmal
+  October 7, 2002      
+
+

SOURCE

+
  SUBROUTINE h5pget_hyper_vector_size_f(plist_id, size, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: plist_id ! Dataset transfer property list identifier 
+    INTEGER(SIZE_T), INTENT(OUT) :: size   ! Vector size
+    INTEGER, INTENT(OUT) :: hdferr         ! Error code
+                                           ! 0 on success and -1 on failure
+
+ +
+ +

h5pset_family_offset_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  h5pset_family_offset_f 
+
+

PURPOSE

+
  Sets offset for family file driver.
+
+

INPUTS

+
  prp_id       - file creation property list identifier
+  offset       - file offset
+
+

OUTPUTS

+
  hdferr       - error code            
+                  Success:  0
+                  Failure: -1   
+
+

AUTHOR

+
  Elena Pourmal
+  19 March 2003
+
+

SOURCE

+
  SUBROUTINE h5pset_family_offset_f(prp_id, offset, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id   ! Property list identifier 
+    INTEGER(HSIZE_T), INTENT(IN) :: offset ! Offset in bytes
+    INTEGER, INTENT(OUT) :: hdferr         ! Error code
+                                           ! 0 on success and -1 on failure
+
+ +
+ +

h5pset_fapl_family_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
   h5pset_fapl_family_f 
+
+

PURPOSE

+
  Sets the file access property list to use the family driver. 
+
+

INPUTS

+
  prp_id       - file access property list identifier
+  memb_size    - size in bytes of each file member 
+  memb_plist   - identifier of the file access property 
+                 list to be used for each family member
+
+

OUTPUTS

+
  hdferr  - error code         
+             Success:  0
+             Failure: -1   
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999      
+
+

HISTORY

+
  Explicit Fortran interfaces were added for 
+  called C functions (it is needed for Windows
+  port).  March 14, 2001 
+               
+
+

SOURCE

+
  SUBROUTINE h5pset_fapl_family_f(prp_id, memb_size, memb_plist , hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id      ! Property list identifier 
+    INTEGER(HSIZE_T), INTENT(IN) :: memb_size ! Logical size, in bytes,
+                                              ! of each family member
+    INTEGER(HID_T), INTENT(IN) :: memb_plist  ! Identifier of the file 
+                                              ! access property list for 
+                                              ! each member of the family
+    INTEGER, INTENT(OUT) :: hdferr            ! Error code
+                                              ! 0 on success and -1 on failure
+
+ +
+ +

h5pset_meta_block_size_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  h5pset_meta_block_size_f 
+
+

PURPOSE

+
  Sets the minimum size of metadata block allocations 
+
+

INPUTS

+
  plist_id     - file access property list identifier
+  size         - metatdata block size
+
+

OUTPUTS

+
  hdferr       - error code            
+                  Success:  0
+                  Failure: -1
+
+

AUTHOR

+
  Elena Pourmal
+  October 7, 2002      
+
+

SOURCE

+
  SUBROUTINE h5pset_meta_block_size_f(plist_id, size, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: plist_id  ! File access property list identifier 
+    INTEGER(HSIZE_T), INTENT(IN) :: size    ! Block size in bytes; 
+    INTEGER, INTENT(OUT) :: hdferr          ! Error code
+                                            ! 0 on success and -1 on failure
+
+ +
+ +

h5pall_filters_avail_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  h5pall_filters_avail_f 
+
+

PURPOSE

+
  Checks if all filters set in the dataset creation
+  property list are available
+
+

INPUTS

+
  prp_id       - data creation property list identifier
+
+

OUTPUTS

+
  flag         - .TRUE. if all filters are available
+                 .FALSE. otherwise
+  hdferr       - error code            
+                  Success:  0
+                  Failure: -1   
+
+

AUTHOR

+
  Elena Pourmal
+  April 10 2003
+
+

SOURCE

+
  SUBROUTINE h5pall_filters_avail_f(prp_id, flag, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id ! Dataset creation property 
+                                         !  list identifier 
+    LOGICAL, INTENT(OUT) :: flag         ! .TRUE. if all filters are available
+                                         ! .FALSE. otherwise
+    INTEGER, INTENT(OUT) :: hdferr       ! Error code
+                                         ! 0 on success and -1 on failure
+
+ +
+ +

h5pclose_class_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  h5pclose_class_f 
+
+

PURPOSE

+
  Closes an existing property list class.
+
+

INPUTS

+
  class        - Property list class identifier
+
+

OUTPUTS

+
  hdferr       - error code         
+                  Success: 0 
+                  Failure: -1   
+
+

AUTHOR

+
  Elena Pourmal
+  October 9, 2002      
+
+

SOURCE

+
  SUBROUTINE h5pclose_class_f(class, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: class ! Property list class identifier
+    INTEGER, INTENT(OUT) :: hdferr      ! Error code
+                                        ! 0 on success and -1 on failure
+
+ +
+ +

h5pclose_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  h5pclose_f 
+
+

PURPOSE

+
  Terminates access to a property list. 
+
+

INPUTS

+
  prp_id - identifier of the property list to 
+           terminate access to. 
+
+

OUTPUTS

+
  hdferr - error code          
+           Success:  0
+           Failure: -1
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999      
+
+

HISTORY

+
  Explicit Fortran interfaces were added for 
+  called C functions (it is needed for Windows
+  port).  March 14, 2001 
+               
+
+

SOURCE

+
  SUBROUTINE h5pclose_f(prp_id, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id  ! Property list identifier 
+    INTEGER, INTENT(OUT) :: hdferr        ! Error code
+                                          ! 0 on success and -1 on failure
+
+ +
+ +

h5pcopy_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  h5pcopy_f 
+
+

PURPOSE

+
  Copies an existing property list to create a new 
+  property list
+
+

INPUTS

+
  prp_id       - property list identifier
+
+

OUTPUTS

+
  new_prp_id   - new property list identifier
+  hdferr:      - error code            
+                  Success:  0
+                  Failure: -1
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999      
+
+

HISTORY

+
  Explicit Fortran interfaces were added for 
+  called C functions (it is needed for Windows
+  port).  March 14, 2001
+
+

SOURCE

+
  SUBROUTINE h5pcopy_f(prp_id, new_prp_id, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id      ! Property list identifier 
+    INTEGER(HID_T), INTENT(OUT) :: new_prp_id ! Identifier of property list
+    INTEGER, INTENT(OUT) :: hdferr            ! Error code
+                                              ! 0 on success and -1 on failure
+
+ +
+ +

h5pcopy_prop_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
   h5pcopy_prop_f 
+
+

PURPOSE

+
  Copies a property from one list or class to another.
+
+

INPUTS

+
  dst_id               - Identifier of the destination property list
+  src_id               - Identifier of the source property list 
+  name                 - name of the property to copy
+
+

OUTPUTS

+
  hdferr:              - error code
+                          Success: 0 
+                          Failure: -1   
+
+

AUTHOR

+
  Elena Pourmal
+  October 9, 2002      
+
+

SOURCE

+
  SUBROUTINE h5pcopy_prop_f(dst_id, src_id, name, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: dst_id  ! Destination property list 
+                                          ! identifier 
+    INTEGER(HID_T), INTENT(IN) :: src_id  ! Source property list identifier 
+    CHARACTER(LEN=*), INTENT(IN) :: name  ! Property name
+    INTEGER, INTENT(OUT) :: hdferr        ! Error code
+                                          ! 0 on success and -1 on failure
+
+ +
+ +

h5pcreate_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
   h5pcreate_f 
+
+

PURPOSE

+
       Creates a new property as an instance of a property 
+       list class.
+
+

INPUTS

+
  class  - type of the property class to be created.
+           Possible values are:
+             H5P_FILE_CREATE_F
+             H5P_FILE_ACCESS_F
+             H5P_DATASET_CREATE_F
+             H5P_DATASET_XFER_F
+             H5P_FILE_MOUNT_F
+
+

OUTPUTS

+
  prp_id - property list identifier
+  hdferr - error code          
+            Success:  0
+            Failure: -1 
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999      
+
+

HISTORY

+
  Explicit Fortran interfaces were added for 
+  called C functions (it is needed for Windows
+  port).  March 14, 2001 
+
+

SOURCE

+
  SUBROUTINE h5pcreate_f(class, prp_id, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: class   ! The type of the property list 
+                                          ! to be created. Possible values are: 
+                                          !  H5P_FILE_CREATE_F
+                                          !  H5P_FILE_ACCESS_F
+                                          !  H5P_DATASET_CREATE_F
+                                          !  H5P_DATASET_XFER_F
+                                          !  H5P_FILE_MOUNT_F
+    INTEGER(HID_T), INTENT(OUT) :: prp_id ! Property list identifier 
+    INTEGER, INTENT(OUT) :: hdferr        ! Error code
+                                          ! 0 on success and -1 on failure
+
+ +
+ +

h5pequal_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  h5pequal_f 
+
+

PURPOSE

+
  Checks if two property lists are eqaul
+
+

INPUTS

+
  plist1_id    - property list identifier
+  plist2_id    - property list identifier
+
+

OUTPUTS

+
  flag         - flag, possible values
+                   .TRUE. or .FALSE.
+  hdferr:      - error code            
+                  Success:  0
+                  Failure: -1, flag is set to .FALSE.   
+
+

AUTHOR

+
  Elena Pourmal
+  September 30, 2002   
+
+

SOURCE

+
  SUBROUTINE h5pequal_f(plist1_id, plist2_id, flag, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: plist1_id ! Property list identifier 
+    INTEGER(HID_T), INTENT(IN) :: plist2_id ! Property list identifier 
+    LOGICAL, INTENT(OUT)       :: flag      ! Flag
+    INTEGER, INTENT(OUT)       :: hdferr    ! Error code
+                                            !  0 on success and -1 on failure
+
+ +
+ +

h5pexist_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
   h5pexist_f 
+
+

PURPOSE

+
  Queries whether a property name exists in a property list or class. 
+
+

INPUTS

+
  prp_id       - property list identifier to query
+  name         - name of property to check for
+
+

OUTPUTS

+
  flag         - logical flag
+  hdferr       - error code            
+                  Success:  0
+                  Failure: -1   
+
+

AUTHOR

+
  Elena Pourmal
+  October 9, 2002      
+
+

SOURCE

+
  SUBROUTINE h5pexist_f(prp_id, name, flag, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id  ! Property list identifier 
+    CHARACTER(LEN=*), INTENT(IN) :: name  ! Name of property to modify
+    LOGICAL, INTENT(OUT) :: flag          ! .TRUE. if exists, .FALSE. otherwise
+    INTEGER, INTENT(OUT) :: hdferr  ! Error code
+                                    ! 0 on success and -1 on failure
+
+ +
+ +

h5pfill_value_defined_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  h5pfill_value_defined_f
+
+

PURPOSE

+
  Check if fill value is defined.
+
+

INPUTS

+
  plist_id     - dataset creation property list identifier
+
+

OUTPUTS

+
  flag         - fill value status flag
+                 Possible values are:
+                   H5D_FILL_VALUE_ERROR_F
+                   H5D_FILL_VALUE_UNDEFINED_F
+                   H5D_FILL_VALUE_DEFAULT_F
+                   H5D_FILL_VALUE_USER_DEFINED_F
+  hdferr       - error code            
+                   Success:  0
+                   Failure: -1
+
+

AUTHOR

+
  Elena Pourmal
+  October 4, 2002
+
+

SOURCE

+
  SUBROUTINE h5pfill_value_defined_f(plist_id, flag, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: plist_id  ! Dataset creation property list identifier
+    INTEGER, INTENT(OUT) :: flag            ! Fill value status flag
+                                            !  H5D_FILL_VALUE_ERROR_F
+                                            !  H5D_FILL_VALUE_UNDEFINED_F
+                                            !  H5D_FILL_VALUE_DEFAULT_F
+                                            !  H5D_FILL_VALUE_USER_DEFINED_F
+    INTEGER, INTENT(OUT) :: hdferr          ! Error code
+                                            ! 0 on success and -1 on failure
+
+ +
+ +

h5pget_alignment_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
   h5pget_alignment_f 
+
+

PURPOSE

+
  Retrieves the current settings for alignment 
+  properties from a file access property list. 
+
+

INPUTS

+
  prp_id       - file access property list identifier
+
+

OUTPUTS

+
  threshold    - threshold value       
+  alignment    - alignment value
+  hdferr       - error code            
+                  Success:  0
+                  Failure: -1   
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999      
+
+

HISTORY

+
  Explicit Fortran interfaces were added for 
+  called C functions (it is needed for Windows
+  port).  March 14, 2001 
+               
+
+

SOURCE

+
  SUBROUTINE h5pget_alignment_f(prp_id, threshold,  alignment, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id       ! Property list identifier 
+    INTEGER(HSIZE_T), INTENT(OUT) :: threshold ! Threshold value
+    INTEGER(HSIZE_T), INTENT(OUT) :: alignment ! alignment value
+    INTEGER, INTENT(OUT) :: hdferr             ! Error code
+                                             ! 0 on success and -1 on failure
+
+ +
+ +

h5pget_alloc_time_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  h5pget_alloc_time_f
+
+

PURPOSE

+
  Get space allocation time for dataset during creation.
+
+

INPUTS

+
  plist_id     - dataset creation property list identifier
+
+

OUTPUTS

+
  flag         - allocation time flag:
+                   H5D_ALLOC_TIME_ERROR_F
+                   H5D_ALLOC_TIME_DEFAULT_F
+                   H5D_ALLOC_TIME_EARLY_F
+                   H5D_ALLOC_TIME_LATE_F
+                   H5D_ALLOC_TIME_INCR_F
+  hdferr:      - error code            
+                   Success:  0
+                   Failure: -1
+
+

AUTHOR

+
  Elena Pourmal
+  October 4, 2002      
+
+

SOURCE

+
  SUBROUTINE h5pget_alloc_time_f(plist_id, flag, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: plist_id  ! Dataset creation property list identifier
+    INTEGER, INTENT(OUT) :: flag   ! Allocation time flag:
+                                   !  H5D_ALLOC_TIME_ERROR_F
+                                   !  H5D_ALLOC_TIME_DEFAULT_F
+                                   !  H5D_ALLOC_TIME_EARLY_F
+                                   !  H5D_ALLOC_TIME_LATE_F
+                                   !  H5D_ALLOC_TIME_INCR_F
+    INTEGER, INTENT(OUT) :: hdferr ! Error code
+                                   ! 0 on success and -1 on failure
+
+ +
+ +

H5Pget_attr_creation_order_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  H5Pget_attr_creation_order_f
+
+

PURPOSE

+
  Retrieves tracking and indexing settings for attribute creation order
+
+

INPUTS

+
  ocpl_id         - Object (group or dataset) creation property list identifier
+
+

OUTPUTS

+
  crt_order_flags - Flags specifying whether to track and index attribute creation order
+  hdferr          - Error code         
+                       Success:  0
+                       Failure: -1   
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  February, 2008
+
+

SOURCE

+
  SUBROUTINE h5pget_attr_creation_order_f(ocpl_id, crt_order_flags, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: ocpl_id   ! Object (group or dataset) creation property list identifier 
+    INTEGER, INTENT(OUT) :: crt_order_flags ! Flags specifying whether to track and index attribute creation order 
+    INTEGER, INTENT(OUT) :: hdferr   ! Error code
+                                     ! 0 on success and -1 on failure
+
+ +
+ +

H5Pget_attr_phase_change_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  H5Pget_attr_phase_change_f 
+
+

PURPOSE

+
  Retrieves attribute storage phase change thresholds 
+
+

INPUTS

+
  ocpl_id         - Object (dataset or group) creation property list identifier
+
+

OUTPUTS

+
  max_compact     - Maximum number of attributes to be stored in compact storage
+                    (Default: 8)
+  min_dense       - Minimum number of attributes to be stored in dense storage
+                    (Default: 6)
+  hdferr          - Error code         
+                     Success:  0
+                     Failure: -1   
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  January, 2008
+
+

SOURCE

+
  SUBROUTINE h5pget_attr_phase_change_f(ocpl_id, max_compact, min_dense, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: ocpl_id ! Object (dataset or group) creation property list identifier
+    INTEGER, INTENT(OUT) :: max_compact   ! Maximum number of attributes to be stored in compact storage
+                                          ! (Default: 8)
+    INTEGER, INTENT(OUT) :: min_dense     ! Minimum number of attributes to be stored in dense storage
+                                          ! (Default: 6)
+    INTEGER, INTENT(OUT) :: hdferr        ! Error code
+                                          ! 0 on success and -1 on failure
+
+ +
+ +

h5pget_btree_ratios_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  h5pget_btree_ratios_f
+
+

PURPOSE

+
  Gets B-tree split ratios for a dataset transfer property list
+
+

INPUTS

+
  prp_id       - the dataset transfer property list 
+                 identifier 
+
+

OUTPUTS

+
  left         - the B-tree split ratio for left-most nodes 
+  middle       - the B-tree split ratio for all other nodes
+  right        - the B-tree split ratio for right-most nodes
+  hdferr       - error code            
+                  Success:  0
+                  Failure: -1   
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999      
+
+

HISTORY

+
  Explicit Fortran interfaces were added for 
+  called C functions (it is needed for Windows
+  port).  March 14, 2001 
+
+

SOURCE

+
  SUBROUTINE h5pget_btree_ratios_f(prp_id, left, middle, right, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
+    REAL, INTENT(OUT) :: left   ! The B-tree split ratio for left-most nodes.
+    REAL, INTENT(OUT) :: middle ! The B-tree split ratio for all other nodes 
+    REAL, INTENT(OUT) :: right  ! The B-tree split ratio for right-most 
+                                !  nodes and lone nodes.
+    INTEGER, INTENT(OUT) :: hdferr  ! Error code
+                                    ! 0 on success and -1 on failure
+
+ +
+ +

h5pget_buffer_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  h5pget_buffer_f 
+
+

PURPOSE

+
  Gets size for conversion buffer
+
+

INPUTS

+
  plist_id     - data transfer property list identifier
+
+

OUTPUTS

+
  size         - buffer size 
+  hdferr       - error code            
+                  Success:  0
+                  Failure: -1
+
+

AUTHOR

+
  Elena Pourmal
+  October 2, 2002      
+
+

SOURCE

+
  SUBROUTINE h5pget_buffer_f(plist_id, size, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: plist_id ! Data transfer property list identifier 
+    INTEGER(HSIZE_T), INTENT(OUT) :: size  ! Buffer size in bytes; 
+                                           !  buffer is allocated and freed by 
+                                           !  the library.
+    INTEGER, INTENT(OUT)       :: hdferr   ! Error code
+                                           ! 0 on success and -1 on failure
+
+ +
+ +

h5pget_cache_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
   h5pget_cache_f 
+
+

PURPOSE

+
  Queries the meta data cache and raw data chunk cache 
+  parameters.  
+
+

INPUTS

+
  prp_id       - file access property list identifier
+
+

OUTPUTS

+
  mdc_nelmts   - number of elements (objects) in the meta 
+                 data cache 
+  rdcc_nelmts  - number of elements (objects) in the raw 
+                 data chunk cache 
+  rdcc_nbytes  - total size of the raw data chunk cache, in bytes 
+  rdcc_w0      - preemption policy (0 or 1)
+  hdferr       - error code            
+                  Success:  0
+                  Failure: -1   
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999      
+
+

HISTORY

+
  Explicit Fortran interfaces were added for 
+  called C functions (it is needed for Windows
+  port).  March 14, 2001 
+
+  Bug fix: type of the rdcc_nelmts parameter should be INTEGER
+  instead of INTEGER(SIZE_T) October 10, 2003 
+               
+
+

SOURCE

+
  SUBROUTINE h5pget_cache_f(prp_id, mdc_nelmts, rdcc_nelmts, rdcc_nbytes, rdcc_w0, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier 
+    INTEGER, INTENT(OUT) :: mdc_nelmts   ! Number of elements (objects)
+                                         !  in the meta data cache
+    INTEGER(SIZE_T), INTENT(OUT) :: rdcc_nelmts  ! Number of elements (objects)
+                                                 !  in the meta data cache
+    INTEGER(SIZE_T), INTENT(OUT) :: rdcc_nbytes  ! Total size of the raw data 
+                                                 !  chunk cache, in bytes 
+    REAL, INTENT(OUT) :: rdcc_w0                 ! Preemption policy
+    INTEGER, INTENT(OUT) :: hdferr               ! Error code
+                                                 ! 0 on success and -1 on failure
+
+ +
+ +

H5Pget_char_encoding_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  H5Pget_char_encoding_f
+
+

PURPOSE

+
  Retrieves the character encoding used to create a string
+
+

INPUTS

+
  plist_id - Property list identifier
+
+

OUTPUTS

+
  encoding - Valid values for encoding are:
+               H5T_CSET_ASCII_F -> US ASCII
+               H5T_CSET_UTF8_F -> UTF-8 Unicode encoding
+  hdferr   - Error code                
+               Success:  0
+               Failure: -1   
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  March 3, 2008
+
+

SOURCE

+
  SUBROUTINE  h5pget_char_encoding_f(plist_id, encoding, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: plist_id ! Property list identifier
+
+    INTEGER, INTENT(OUT) :: encoding       ! Valid values for encoding are:
+                                           !  H5T_CSET_ASCII_F -> US ASCII
+                                           !  H5T_CSET_UTF8_F  -> UTF-8 Unicode encoding
+    INTEGER, INTENT(OUT) :: hdferr   ! Error code
+                                     ! 0 on success and -1 on failure
+
+ +
+ +

H5Pget_chunk_cache_f

+ +

[ Top ] [ Subroutines ]

+

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            - Dataset access property list identifier.
+
+

OUTPUTS

+
  rdcc_nslots        - Number of chunk slots in the raw data chunk cache hash table. 
+  rdcc_nbytes        - Total size of the raw data chunk cache, in bytes. 
+  rdcc_w0            - Preemption policy. 
+  hdferr             - Error code              
+                        Success:  0
+                        Failure: -1   
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  April 13, 2009
+
+

HISTORY

+

SOURCE

+
  SUBROUTINE h5pget_chunk_cache_f(dapl_id, rdcc_nslots, rdcc_nbytes, rdcc_w0, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: dapl_id       ! Dataset access property list identifier.
+    INTEGER(SIZE_T), INTENT(OUT) :: rdcc_nslots ! Number of chunk slots in the raw data chunk cache hash table.
+    INTEGER(SIZE_T), INTENT(OUT) :: rdcc_nbytes ! Total size of the raw data chunk cache, in bytes. 
+    REAL, INTENT(OUT) :: rdcc_w0                ! Preemption policy.
+    INTEGER, INTENT(OUT) :: hdferr              ! Error code:
+                                                ! 0 on success and -1 on failure
+
+ +
+ +

h5pget_chunk_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
   h5pget_chunk_f 
+
+

PURPOSE

+
  Retrieves the size of chunks for the raw data of a 
+  chunked layout dataset
+
+

INPUTS

+
  prp_id       - property list identifier
+  ndims        - size of dims array
+
+

OUTPUTS

+
  dims         - array with dimension sizes for each chunk
+  hdferr       - error code            
+                  Success:  number of chunk dimensions
+                  Failure: -1
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999      
+
+

HISTORY

+
  Explicit Fortran interfaces were added for 
+  called C functions (it is needed for Windows
+  port).  March 14, 2001 
+               
+
+

SOURCE

+
  SUBROUTINE h5pget_chunk_f(prp_id, ndims, dims, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier 
+    INTEGER, INTENT(IN) :: ndims         ! Number of chunk dimensions to
+                                         ! to return
+    INTEGER(HSIZE_T), DIMENSION(ndims), INTENT(OUT) :: dims    
+                                         ! Array containing sizes of
+                                         ! chunk dimensions
+    INTEGER, INTENT(OUT) :: hdferr       ! Error code:
+                                         !  number of chunk dimensions on success,
+                                         !  -1 on failure
+
+ +
+ +

h5pget_class_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  h5pget_class_f 
+
+

PURPOSE

+
  Returns the property list class for a property list.
+
+

INPUTS

+
  prp_id       - property list identifier
+
+

OUTPUTS

+
  classtype    - property list class
+                 Possible values are:
+                  H5P_ROOT_F
+                  H5P_FILE_CREATE_F
+                  H5P_FILE_ACCESS_F
+                  H5PE_DATASET_CREATE_F
+                  H5P_DATASET_XFER_F
+                  H5P_FILE_MOUNT_F
+  hdferr:      - error code            
+                  Success:  0
+                  Failure: -1 
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999      
+
+

HISTORY

+
  Explicit Fortran interfaces were added for 
+  called C functions (it is needed for Windows
+  port).  March 14, 2001 
+
+

SOURCE

+
  SUBROUTINE h5pget_class_f(prp_id, classtype, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier 
+    INTEGER, INTENT(OUT) :: classtype    ! The type of the property list 
+                                         ! to be created. Possible values are: 
+                                         !  H5P_ROOT_F
+                                         !  H5P_FILE_CREATE_F
+                                         !  H5P_FILE_ACCESS_F
+                                         !  H5PE_DATASET_CREATE_F 
+                                         !  H5P_DATASET_XFER_F
+                                         !  H5P_FILE_MOUNT_F
+    INTEGER, INTENT(OUT) :: hdferr       ! Error code
+                                         ! 0 on success and -1 on failure
+
+ +
+ +

h5pget_class_name_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  h5pget_class_name_f 
+
+

PURPOSE

+
  Queries the name of a class.
+
+

INPUTS

+
  prp_id       - property list identifier to query
+
+

OUTPUTS

+
  name         - name of a class
+  size         - Actual length of the class name
+                   NOTE: If provided buffer "name" is smaller,
+                   than name will be truncated to fit into
+                   provided user buffer
+  hdferr:      - error code
+                  Success: 0
+                  Failure: -1   
+
+

AUTHOR

+
  Elena Pourmal
+  October 9, 2002      
+
+

HISTORY

+
 Returned the size of name as an argument      
+
+

SOURCE

+
  SUBROUTINE h5pget_class_name_f(prp_id, name, size, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id  ! Property list identifier 
+    CHARACTER(LEN=*), INTENT(OUT) :: name ! Buffer to retireve class name
+    INTEGER, INTENT(OUT) :: size          ! Actual length of the class name
+    INTEGER, INTENT(OUT) :: hdferr        ! Error code
+                                          ! 0 on success and -1 on failure
+
+ +
+ +

h5pget_class_parent_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  h5pget_class_parent_f 
+
+

PURPOSE

+
  Retrieves the parent class of a genric property class. 
+
+

INPUTS

+
  prp_id       - property list identifier to query
+
+

OUTPUTS

+
  parent_id    - identifier of the parent class
+  hdferr:      - error code          
+                  Success:  0
+                  Failure: -1   
+
+

AUTHOR

+
  Elena Pourmal
+  October 9, 2002      
+
+

SOURCE

+
  SUBROUTINE h5pget_class_parent_f(prp_id, parent_id, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id     ! Property list identifier 
+    INTEGER(HID_T), INTENT(OUT) :: parent_id ! Parent class property list 
+                                             ! identifier 
+    INTEGER, INTENT(OUT) :: hdferr  ! Error code
+                                    ! 0 on success and -1 on failure
+
+ +
+ +

h5pget_copy_object_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  h5pget_copy_object_f 
+
+

PURPOSE

+
  Retrieves the properties to be used when an object is copied.
+
+

INPUTS

+
  ocp_plist_id - Object copy property list identifier
+
+

OUTPUTS

+
  copy_options - Copy option(s) to be get
+  hdferr       - Error code            
+                  Success:  0
+                  Failure: -1   
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  March 3, 2008
+
+

HISTORY

+

SOURCE

+
  SUBROUTINE h5pget_copy_object_f(ocp_plist_id, copy_options, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: ocp_plist_id ! Object copy property list identifier
+    INTEGER, INTENT(OUT) :: copy_options       ! Valid copy options returned are:
+                                               !   H5O_COPY_SHALLOW_HIERARCHY_F
+                                               !   H5O_COPY_EXPAND_SOFT_LINK_F 
+                                               !   H5O_COPY_EXPAND_EXT_LINK_F
+                                               !   H5O_COPY_EXPAND_REFERENCE_F
+                                               !   H5O_COPY_WITHOUT_ATTR_FLAG_F
+    INTEGER, INTENT(OUT) :: hdferr             ! Error code
+                                               ! 0 on success and -1 on failure
+
+ +
+ +

H5Pget_create_inter_group_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  H5Pget_create_inter_group_f
+
+

PURPOSE

+
  Determines whether property is set to enable creating missing intermediate groups.
+
+

INPUTS

+
  lcpl_id            - Link creation property list identifier
+  crt_intermed_group - Specifying whether to create intermediate groups upon 
+                       the creation of an object
+
+

OUTPUTS

+
  hdferr             - Error code              
+                        Success:  0
+                        Failure: -1   
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  April 4, 2008
+
+

HISTORY

+
 The long subroutine name (>31) on older f90 compilers causes problems
+          so the name was shortened
+
+

SOURCE

+
  SUBROUTINE h5pget_create_inter_group_f(lcpl_id, crt_intermed_group, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: lcpl_id      ! Link creation property list identifier
+    INTEGER, INTENT(IN) :: crt_intermed_group  ! Flag specifying whether to create intermediate groups
+                                               ! upon creation of an object
+    INTEGER, INTENT(OUT) :: hdferr             ! Error code
+                                               ! 0 on success and -1 on failure
+
+ +
+ +

h5pget_data_transform_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  h5pget_data_transform_f 
+
+

PURPOSE

+
  Retrieves a data transform expression.
+
+

INPUTS

+
  plist_id   - Identifier of the property list or class
+
+

OUTPUTS

+
  expression - buffer to hold transform expression
+  hdferr     - Error code
+                 Success:  Actual lenght of the expression
+                           If provided buffer "expression" is 
+                           smaller, than expression will be 
+                           truncated to fit into
+                           provided user buffer
+                 Failure: -1
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  March 19, 2008
+
+

HISTORY

+
 Should hdferr return just 0 or 1 and add another arguement for the size?
+
+

SOURCE

+
SUBROUTINE h5pget_data_transform_f(plist_id, expression, hdferr, size)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: plist_id         ! Identifier of the property list or class
+    CHARACTER(LEN=*), INTENT(OUT) :: expression    ! Buffer to hold transform expression
+    INTEGER(SIZE_T), INTENT(OUT), OPTIONAL :: size ! Registered size of the transform expression
+    INTEGER, INTENT(OUT) :: hdferr                 ! Error code
+                                                   !  0 on success and -1 on failure
+
+ +
+ +

h5pget_driver_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  h5pget_driver_f 
+
+

PURPOSE

+
  Returns low-lever driver identifier. 
+
+

INPUTS

+
  prp_id  - file access or data transfer property 
+            list identifier. 
+
+

OUTPUTS

+
  driver  - low-level driver identifier
+  hdferr  - error code         
+             Success:  0
+             Failure: -1   
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999      
+
+

HISTORY

+
  Explicit Fortran interfaces were added for 
+  called C functions (it is needed for Windows
+  port).  March 14, 2001 
+               
+
+

SOURCE

+
  SUBROUTINE h5pget_driver_f(prp_id, driver, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id  ! Property list identifier 
+    INTEGER(HID_T), INTENT(OUT) :: driver ! Low-level file driver identifier
+    INTEGER, INTENT(OUT) :: hdferr        ! Error code
+                                          ! 0 on success and -1 on failure
+
+ +
+ +

h5pget_edc_check_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  h5pget_edc_check_f 
+
+

PURPOSE

+
  Queries error detecting  
+
+

INPUTS

+
  prp_id       - dataset creation property list identifier
+
+

OUTPUTS

+
  hdferr       - error code            
+                  Success:  0
+                  Failure: -1   
+
+

AUTHOR

+
  Elena Pourmal
+  March 13, 2003
+
+

SOURCE

+
  SUBROUTINE h5pget_edc_check_f(prp_id, flag, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id ! Dataset transfer property list identifier 
+    INTEGER, INTENT(OUT) :: flag         ! Checksum filter flag
+                                         ! May have one of the following values:
+                                         !  H5Z_ERROR_EDC_F
+                                         !  H5Z_DISABLE_EDC_F
+                                         !  H5Z_ENABLE_EDC_F
+                                         !  H5Z_NO_EDC_F
+    INTEGER, INTENT(OUT) :: hdferr       ! Error code
+                                         ! 0 on success and -1 on failure
+
+ +
+ +

H5Pget_est_link_info_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  H5Pget_est_link_info_f 
+
+

PURPOSE

+
  Queries data required to estimate required local heap or object header size.
+
+

INPUTS

+
  gcpl_id         - Group creation property list identifier
+
+

OUTPUTS

+
  est_num_entries - Estimated number of links to be inserted into group
+  est_name_len    - Estimated average length of link names
+  hdferr          - Error code
+                     Success:  0
+                     Failure: -1
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  March 21, 2008
+
+

HISTORY

+

SOURCE

+
  SUBROUTINE h5pget_est_link_info_f(gcpl_id, est_num_entries, est_name_len, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: gcpl_id   ! Group creation property list identifier  
+    INTEGER, INTENT(OUT) :: est_num_entries ! Estimated number of links to be inserted into group
+    INTEGER, INTENT(OUT) :: est_name_len    ! Estimated average length of link names
+    INTEGER, INTENT(OUT) :: hdferr          ! Error code
+                                            ! 0 on success and -1 on failure
+
+ +
+ +

h5pget_external_count_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
   h5pget_external_count_f 
+
+

PURPOSE

+
  Returns the number of external files for a dataset. 
+
+

INPUTS

+
  prp_id       - dataset creation property list identifier
+
+

OUTPUTS

+
  count        - number of external files for the 
+                 specified dataset
+  hdferr       - error code            
+                   Success:  0
+                   Failure: -1   
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999      
+
+

HISTORY

+
  Explicit Fortran interfaces were added for 
+  called C functions (it is needed for Windows
+  port).  March 14, 2001 
+
+

SOURCE

+
  SUBROUTINE h5pget_external_count_f (prp_id, count, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier 
+    INTEGER, INTENT(OUT) :: count        ! Number of external files for the 
+                                         ! Specified dataset
+    INTEGER, INTENT(OUT) :: hdferr       ! Error code
+                                         ! 0 on success and -1 on failure
+
+ +
+ +

h5pget_external_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  h5pget_external_f 
+
+

PURPOSE

+
  Returns information about an external file. 
+
+

INPUTS

+
  prp_id       - dataset creation property list identifier
+
+

OUTPUTS

+
  idx          - external file index 
+  name_size    - maximum size of name array
+  name         - name of the external file     
+  name         - name of external file
+  offset       - offset in bytes from the beginning of the 
+                 file to the location in the file
+                 where the data starts
+  bytes        - size of the external file data
+  hdferr       - error code            
+                  Success:  0
+                   Failure: -1   
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999      
+
+

HISTORY

+
  Explicit Fortran interfaces were added for 
+  called C functions (it is needed for Windows
+  port).  March 14, 2001 
+
+

SOURCE

+
  SUBROUTINE h5pget_external_f(prp_id, idx, name_size, name, offset,bytes, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
+    INTEGER, INTENT(IN) :: idx           ! External file index.
+    INTEGER(SIZE_T), INTENT(IN) :: name_size ! Maximum length of name array 
+    CHARACTER(LEN=*), INTENT(OUT) :: name    ! Name of an external file
+    INTEGER, INTENT(OUT) :: offset           ! Offset, in bytes, from the beginning 
+                                             !  of the file to the location in the file 
+                                             !  where the data starts.
+    INTEGER(HSIZE_T), INTENT(OUT) :: bytes   ! Number of bytes reserved in the 
+                                             !  file for the data
+    INTEGER, INTENT(OUT) :: hdferr           ! Error code
+                                             ! 0 on success and -1 on failure
+
+ +
+ +

h5pget_fapl_core_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
   h5pget_fapl_core_f 
+
+

PURPOSE

+
  Queries core file driver properties. 
+
+

INPUTS

+
  prp_id        - file access property list identifier
+
+

OUTPUTS

+
  increment     - size, in bytes, of memory increments 
+  backing_store - boolean flag indicating whether to write 
+                  the file contents to disk when the file is closed. 
+  hdferr        - error code           
+                   Success:  0
+                   Failure: -1   
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999      
+
+

HISTORY

+
  Explicit Fortran interfaces were added for 
+  called C functions (it is needed for Windows
+  port).  March 14, 2001 
+               
+
+

SOURCE

+
  SUBROUTINE h5pget_fapl_core_f(prp_id, increment, backing_store, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id      ! Property list identifier 
+    INTEGER(SIZE_T), INTENT(OUT) :: increment ! File block size in bytes.
+    LOGICAL, INTENT(OUT) :: backing_store   ! Flag to indicate that
+                                            ! entire file contents are flushed to a file 
+                                            ! with the same name as this core file.
+    INTEGER, INTENT(OUT) :: hdferr          ! Error code
+                                            ! 0 on success and -1 on failure
+
+ +
+ +

h5pget_fapl_direct_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  h5pget_fapl_direct_f
+
+

PURPOSE

+
  Gets up use of the direct I/O driver.
+
+

INPUTS

+
  fapl_id      - File access property list identifier
+
+

OUTPUTS

+
  alignment    - Required memory alignment boundary
+  block_size   - File system block size
+  cbuf_size    - Copy buffer size
+  hdferr       - error code            
+                  Success:  0
+                  Failure: -1   
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  March 21, 2008
+
+

SOURCE

+
  SUBROUTINE h5pget_fapl_direct_f(fapl_id, alignment, block_size, cbuf_size, hdferr)
+    IMPLICIT NONE  
+    INTEGER(HID_T), INTENT(IN) :: fapl_id       ! File access property list identifier
+    INTEGER(SIZE_T), INTENT(OUT) :: alignment   ! Required memory alignment boundary!
+    INTEGER(SIZE_T), INTENT(OUT) :: block_size  ! File system block size
+    INTEGER(SIZE_T), INTENT(OUT) :: cbuf_size   ! Copy buffer size
+    INTEGER, INTENT(OUT) :: hdferr              ! Error code
+                                                ! 0 on success and -1 on failure
+
+ +
+ +

h5pget_fapl_family_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  h5pget_fapl_family_f 
+
+

PURPOSE

+
  Returns file access property list information.       
+
+

INPUTS

+
  prp_id       - file access property list identifier
+
+

OUTPUTS

+
  memb_size    - size in bytes of each file member 
+  memb_plist   - identifier of the file access property 
+                 list to be used for each family member
+  hdferr       - error code            
+                  Success:  0
+                  Failure: -1   
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999      
+
+

HISTORY

+
  Explicit Fortran interfaces were added for 
+  called C functions (it is needed for Windows
+  port).  March 14, 2001 
+               
+
+

SOURCE

+
  SUBROUTINE h5pget_fapl_family_f(prp_id, memb_size, memb_plist , hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id       ! Property list identifier 
+    INTEGER(HSIZE_T), INTENT(OUT) :: memb_size ! Logical size, in bytes,
+                                               ! of each family member
+    INTEGER(HID_T), INTENT(OUT) :: memb_plist  ! Identifier of the file 
+                                               ! access property list for 
+                                               ! each member of the family
+    INTEGER, INTENT(OUT) :: hdferr             ! Error code
+                                               ! 0 on success and -1 on failure
+
+ +
+ +

h5pget_fapl_multi_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  h5pget_fapl_multi_f 
+
+

PURPOSE

+
  Sets up use of the multi-file driver. 
+
+

INPUTS

+
  prp_id       - file creation property list identifier
+
+

OUTPUTS

+
  mem_map      - mapping array
+  memb_fapl    - property list for each memory usage type
+  memb_name    - names of member file
+  relax        - flag 
+  hdferr       - error code            
+                  Success:  0
+                  Failure: -1
+
+

OPTIONAL PARAMETERS

+
  maxlen_out   - maximum length for memb_name array element 
+
+

AUTHOR

+
  Elena Pourmal
+  24 March 2003
+
+

SOURCE

+
  SUBROUTINE h5pget_fapl_multi_f(prp_id, memb_map, memb_fapl, memb_name, memb_addr, relax, hdferr, maxlen_out)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id ! File creation property list identifier 
+    INTEGER, DIMENSION(0:H5FD_MEM_NTYPES_F-1), INTENT(OUT) :: memb_map
+    INTEGER(HID_T), DIMENSION(0:H5FD_MEM_NTYPES_F-1), INTENT(OUT) :: memb_fapl
+    CHARACTER(LEN=*), DIMENSION(0:H5FD_MEM_NTYPES_F-1), INTENT(OUT) :: memb_name
+    !INTEGER(HADDR_T), DIMENSION(0:H5FD_MEM_NTYPES_F-1), INTENT(OUT) :: memb_addr
+    REAL, DIMENSION(0:H5FD_MEM_NTYPES_F-1), INTENT(OUT) :: memb_addr
+    INTEGER, OPTIONAL, INTENT(OUT) :: maxlen_out 
+    LOGICAL, INTENT(OUT) :: relax
+    INTEGER, INTENT(OUT) :: hdferr       ! Error code
+                                         ! 0 on success and -1 on failure
+
+ +
+ +

h5pget_fclose_degree_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  h5pget_fclose_degree_f 
+
+

PURPOSE

+
  Returns the degree for the file close behavior.
+
+

INPUTS

+
  fapl_id      - File access property list identifier
+
+

OUTPUTS

+
  degree       - Possible values are:
+                  H5F_CLOSE_DEFAULT_F
+                  H5F_CLOSE_WEAK_F
+                  H5F_CLOSE_SEMI_F
+                  H5F_CLOSE_STRONG_F
+  hdferr       - error code            
+                  Success:  0
+                  Failure: -1   
+
+

AUTHOR

+
  Elena Pourmal
+  September 26, 2002   
+
+

HISTORY

+

SOURCE

+
  SUBROUTINE h5pget_fclose_degree_f(fapl_id, degree, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: fapl_id ! File Access Property list identifier 
+    INTEGER, INTENT(OUT) :: degree        ! Possible values are: 
+                                          !  H5F_CLOSE_DEFAULT_F
+                                          !  H5F_CLOSE_WEAK_F
+                                          !  H5F_CLOSE_SEMI_F
+                                          !  H5F_CLOSE_STRONG_F
+    INTEGER, INTENT(OUT) :: hdferr        ! Error code
+                                          ! 0 on success and -1 on failure
+
+ +
+ +

h5pget_fill_time_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
   h5pget_fill_time_f
+
+

PURPOSE

+
  Get fill value writing time for dataset
+
+

INPUTS

+
  plist_id     - dataset creation property list identifier
+
+

OUTPUTS

+
  hdferr:      - error code            
+                  Success:  0
+                  Failure: -1
+
+

OPTIONAL PARAMETERS

+
  flag         - fill time flag:
+                  H5D_FILL_TIME_ERROR_F
+                  H5D_FILL_TIME_ALLOC_F
+                  H5D_FILL_TIME_NEVER_F
+
+

AUTHOR

+
  Elena Pourmal
+  October 4, 2002      
+
+

SOURCE

+
  SUBROUTINE h5pget_fill_time_f(plist_id, flag, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: plist_id  ! Dataset creation property list identifier
+    INTEGER, INTENT(OUT) :: flag   ! Fill time flag:
+                                   !  H5D_FILL_TIME_ERROR_F
+                                   !  H5D_FILL_TIME_ALLOC_F
+                                   !  H5D_FILL_TIME_NEVER_F
+    INTEGER, INTENT(OUT) :: hdferr ! Error code
+                                   ! 0 on success and -1 on failure
+
+ +
+ +

h5pget_filter_by_id_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  h5pget_filter_by_id_f 
+
+

PURPOSE

+
  Returns information about a filter in a pipeline
+
+

INPUTS

+
  prp_id       - data creation or transfer property list 
+                 identifier
+
+

OUTPUTS

+
  filter_id    - filter identifier
+  flags        - bit vector specifying certain general
+                 properties of the filter
+  cd_nelmts    - number of elements in cd_values
+  cd_values    - auxiliary data for the filter
+  namelen      - number of characters in the name buffer
+  name         - buffer to retrieve filter name
+  hdferr       - error code            
+                  Success:  0
+                  Failure: -1   
+
+

AUTHOR

+
  Elena Pourmal
+  April 10 2003
+
+

SOURCE

+
  SUBROUTINE h5pget_filter_by_id_f(prp_id, filter_id, flags, cd_nelmts, cd_values, namelen, name, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id   ! Property list identifier 
+    INTEGER, INTENT(IN) :: filter_id       ! Filter identifier
+    INTEGER(SIZE_T), INTENT(INOUT) :: cd_nelmts     ! Number of elements in cd_values.
+    INTEGER, DIMENSION(*), INTENT(OUT) :: cd_values ! Auxiliary data for the filter.
+    INTEGER, INTENT(OUT) :: flags          ! Bit vector specifying certain general
+                                           ! properties of the filter.
+    INTEGER(SIZE_T), INTENT(IN) :: namelen ! Anticipated number of characters in name.
+    CHARACTER(LEN=*), INTENT(OUT) :: name  ! Name of the filter
+    INTEGER, INTENT(OUT) :: hdferr         ! Error code
+                                           ! 0 on success and -1 on failure
+
+ +
+ +

h5pget_filter_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
   h5pget_filter_f 
+
+

PURPOSE

+
  Returns information about a filter in a pipeline
+
+

INPUTS

+
  prp_id        - data creation or transfer property list 
+                  identifier
+  filter_number - sequence number within the filter
+                  pipeline of the filter for which 
+                  information is sought
+
+

OUTPUTS

+
  filter_id    - filter identification number
+  flags        - bit vector specifying certain general
+                 properties of the filter
+  cd_nelmts    - number of elements in cd_values
+  cd_values    - auxiliary data for the filter
+  namelen      - number of characters in the name buffer
+  name         - buffer to retrieve filter name
+  hdferr       - error code            
+                  Success:  0
+                  Failure: -1   
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999      
+
+

HISTORY

+
  Explicit Fortran interfaces were added for 
+  called C functions (it is needed for Windows
+  port).  March 14, 2001 
+
+

SOURCE

+
  SUBROUTINE h5pget_filter_f(prp_id, filter_number, flags, cd_nelmts, cd_values, namelen, name, filter_id, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier 
+    INTEGER, INTENT(IN) :: filter_number ! Sequence number within the filter
+                                         !  pipeline of the filter for which 
+                                         !  information is sought
+    INTEGER, DIMENSION(*), INTENT(OUT) :: cd_values  ! Auxiliary data for the filter.
+    INTEGER, INTENT(OUT) :: flags        ! Bit vector specifying certain general
+                                         !  properties of the filter.
+    INTEGER(SIZE_T), INTENT(INOUT) :: cd_nelmts  ! Number of elements in cd_values.
+    INTEGER(SIZE_T), INTENT(IN) :: namelen       ! Anticipated number of characters in name.
+    CHARACTER(LEN=*), INTENT(OUT) :: name        ! Name of the filter
+    INTEGER, INTENT(OUT) :: filter_id            ! Filter identification number  
+    INTEGER, INTENT(OUT) :: hdferr               ! Error code
+                                                 ! 0 on success and -1 on failure
+
+ +
+ +

h5pget_gc_references_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
   h5pget_gc_references_f 
+
+

PURPOSE

+
  Returns garbage collecting references setting.       
+
+

INPUTS

+
  prp_id       - file access property list identifier
+
+

OUTPUTS

+
  gc_reference - flag for stting garbage collection on 
+                 and off (1 or 0)
+  hdferr       - error code            
+                  Success:  0
+                  Failure: -1   
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999      
+
+

HISTORY

+
  Explicit Fortran interfaces were added for 
+  called C functions (it is needed for Windows
+  port).  March 14, 2001 
+               
+
+

SOURCE

+
  SUBROUTINE h5pget_gc_references_f(prp_id, gc_reference, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier 
+    INTEGER, INTENT(OUT) :: gc_reference ! The flag for garbage collecting
+                                         !  references for the file
+    INTEGER, INTENT(OUT) :: hdferr       ! Error code
+                                         ! 0 on success and -1 on failure
+
+ +
+ +

h5pget_istore_k_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  h5pget_istore_k_f 
+
+

PURPOSE

+
  Queries the 1/2 rank of an indexed storage B-tree. 
+
+

INPUTS

+
  prp_id       - file creation property list identifier
+
+

OUTPUTS

+
  ik           - 1/2 rank of chunked storage B-tree
+  hdferr       - error code            
+                  Success:  0
+                  Failure: -1   
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999      
+
+

HISTORY

+
  Explicit Fortran interfaces were added for 
+  called C functions (it is needed for Windows
+  port).  March 14, 2001 
+               
+
+

SOURCE

+
  SUBROUTINE h5pget_istore_k_f(prp_id, ik, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier 
+    INTEGER, INTENT(OUT) :: ik           ! 1/2 rank of chunked storage B-tree
+    INTEGER, INTENT(OUT) :: hdferr       ! Error code
+                                         ! 0 on success and -1 on failure
+
+ +
+ +

h5pget_layout_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
   h5pget_layout_f 
+
+

PURPOSE

+
  Returns the layout of the raw data for a dataset. 
+
+

INPUTS

+
  prp_id       - data creation property list identifier
+
+

OUTPUTS

+
  layout       - type of storage layout for raw data
+                 possible values are:
+                  H5D_COMPACT_F
+                  H5D_CONTIGUOUS_F
+                  H5D_CHUNKED_F
+  hdferr       - error code            
+                  Success:  0
+                  Failure: -1   
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999      
+
+

HISTORY

+
  Explicit Fortran interfaces were added for 
+  called C functions (it is needed for Windows
+  port).  March 14, 2001 
+
+

SOURCE

+
  SUBROUTINE h5pget_layout_f (prp_id, layout, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier 
+    INTEGER, INTENT(OUT) :: layout       ! Type of storage layout for raw data
+                                         ! possible values are:
+                                         !  H5D_COMPACT_F(0)
+                                         !  H5D_CONTIGUOUS_F(1)
+                                         !  H5D_CHUNKED_F(2)
+    INTEGER, INTENT(OUT) :: hdferr       ! Error code
+                                         ! 0 on success and -1 on failure
+
+ +
+ +

H5Pget_link_creation_order_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  H5Pget_link_creation_order_f
+
+

PURPOSE

+
  Queries whether link creation order is tracked and/or indexed in a group.
+
+

INPUTS

+
  gcpl_id - Group creation property list identifier
+
+

OUTPUTS

+
  crt_order_flags - Creation order flag(s)
+  hdferr          - Error code         
+                     Success:  0
+                     Failure: -1   
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  March 3, 2008
+
+

SOURCE

+
  SUBROUTINE h5pget_link_creation_order_f(gcpl_id, crt_order_flags, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: gcpl_id   ! Group creation property list identifier
+    INTEGER, INTENT(OUT) :: crt_order_flags ! Creation order flag(s)
+    INTEGER, INTENT(OUT) :: hdferr          ! Error code
+                                            ! 0 on success and -1 on failure
+
+ +
+ +

H5Pget_link_phase_change_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  H5Pget_link_phase_change_f
+
+

PURPOSE

+
  Queries the settings for conversion between compact and dense groups.
+
+

INPUTS

+
  gcpl_id      - Group creation property list identifier
+
+

OUTPUTS

+
  max_compact  - Maximum number of attributes to be stored in compact storage
+  min_dense    - Minimum number of attributes to be stored in dense storage
+  hdferr       - Error code            
+                  Success:  0
+                  Failure: -1   
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  February 20, 2008
+
+

SOURCE

+
  SUBROUTINE h5pget_link_phase_change_f(gcpl_id, max_compact, min_dense, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: gcpl_id ! Group creation property list identifier
+    INTEGER, INTENT(OUT) :: max_compact   ! Maximum number of attributes to be stored in compact storage
+    INTEGER, INTENT(OUT) :: min_dense     ! Minimum number of attributes to be stored in dense storage
+    INTEGER, INTENT(OUT) :: hdferr        ! Error code
+                                          ! 0 on success and -1 on failure
+
+ +
+ +

H5Pget_local_heap_size_hint_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  H5Pget_local_heap_size_hint_f 
+
+

PURPOSE

+
  Queries the local heap size hint for original-style groups.
+
+

INPUTS

+
  gcpl_id   - Group creation property list identifier
+
+

OUTPUTS

+
  size_hint - Hint for size of local heap
+  hdferr    - Error code
+               Success:  0
+               Failure: -1
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  March 21, 2008
+
+

SOURCE

+
  SUBROUTINE h5pget_local_heap_size_hint_f(gcpl_id, size_hint, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: gcpl_id     ! Group creation property list identifier
+    INTEGER(SIZE_T), INTENT(OUT) :: size_hint ! Hint for size of local heap
+    INTEGER, INTENT(OUT) :: hdferr            ! Error code
+                                              ! 0 on success and -1 on failure
+
+ +
+ +

h5pget_meta_block_size_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  h5pget_meta_block_size_f 
+
+

PURPOSE

+
  Gets the minimum size of metadata block allocations 
+
+

INPUTS

+
  plist_id     - file access property list identifier
+
+

OUTPUTS

+
  size         - metatdata block size
+  hdferr       - error code            
+                  Success:  0
+                  Failure: -1
+
+

AUTHOR

+
  Elena Pourmal
+  October 7, 2002      
+
+

SOURCE

+
  SUBROUTINE h5pget_meta_block_size_f(plist_id, size, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: plist_id  ! File access property list identifier 
+    INTEGER(HSIZE_T), INTENT(OUT) :: size   ! Block size in bytes; 
+    INTEGER, INTENT(OUT) :: hdferr          ! Error code
+                                            ! 0 on success and -1 on failure
+
+ +
+ +

h5pget_nfilters_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
   h5pget_nfilters_f 
+
+

PURPOSE

+
  Returns the number of filters in the pipeline. 
+
+

INPUTS

+
  prp_id       - data creation or transfer property list 
+                 identifier
+
+

OUTPUTS

+
  nfilters     - number of filters in the pipeline
+  hdferr       - error code            
+                  Success:  0
+                  Failure: -1   
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999      
+
+

HISTORY

+
  Explicit Fortran interfaces were added for 
+  called C functions (it is needed for Windows
+  port).  March 14, 2001 
+
+

SOURCE

+
  SUBROUTINE h5pget_nfilters_f (prp_id, nfilters, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier 
+    INTEGER, INTENT(OUT) :: nfilters     ! The number of filters in the pipeline
+    INTEGER, INTENT(OUT) :: hdferr       ! Error code
+                                         ! 0 on success and -1 on failure
+
+ +
+ +

h5pget_nlinks_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  h5pget_nlinks_f 
+
+

PURPOSE

+
  Gets maximum number of soft or user-defined link traversals.
+
+

INPUTS

+
  lapl_id - File access property list identifier
+  nlinks  - Maximum number of links to traverse
+
+

OUTPUTS

+
  hdferr  - error code
+             Success:  0
+             Failure: -1
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  March 24, 2008
+
+

SOURCE

+
  SUBROUTINE h5pget_nlinks_f(lapl_id, nlinks, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: lapl_id  ! File access property list identifier
+    INTEGER(SIZE_T), INTENT(OUT) :: nlinks ! Maximum number of links to traverse
+    INTEGER, INTENT(OUT) :: hdferr         ! Error code
+                                           ! 0 on success and -1 on failure
+
+ +
+ +

h5pget_npros_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
   h5pget_npros_f 
+
+

PURPOSE

+
  Queries number of properties in property list or class
+
+

INPUTS

+
  prp_id       - iproperty list identifier to query
+
+

OUTPUTS

+
  nprops       - number of properties in property object
+  hdferr       - error code            
+                  Success:  0
+                  Failure: -1   
+
+

AUTHOR

+
  Elena Pourmal
+  October 9, 2002      
+
+

SOURCE

+
  SUBROUTINE h5pget_nprops_f(prp_id, nprops, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id    ! Property list identifier 
+    INTEGER(SIZE_T), INTENT(OUT) :: nprops  ! Number of properties
+    INTEGER, INTENT(OUT) :: hdferr          ! Error code
+                                            ! 0 on success and -1 on failure
+
+ +
+ +

H5Pget_obj_track_times_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  H5Pget_obj_track_times_f 
+
+

PURPOSE

+
  Returns whether times are tracked for an object.
+
+

INPUTS

+
  plist_id     - property list id
+  flag         - object timestamp setting
+                 .TRUE.,.FALSE.
+
+

OUTPUTS

+
  hdferr       - error code            
+                 Success:  0
+                 Failure: -1   
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  February 22, 2008
+
+

SOURCE

+
  SUBROUTINE h5pget_obj_track_times_f(plist_id, flag, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: plist_id ! Dataset creation property 
+                                           ! list identifier 
+    LOGICAL, INTENT(OUT) :: flag   ! Object timestamp setting
+    INTEGER, INTENT(OUT) :: hdferr ! Error code
+                                   ! 0 on success and -1 on failure
+
+ +
+ +

h5pget_preserve_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  h5pget_preserve_f 
+
+

PURPOSE

+
  Checks status of the dataset transfer property list.
+
+

INPUTS

+
  prp_id  - property list identifier
+
+

OUTPUTS

+
  flag    - status flag
+  hdferr  - error code         
+       Success:  0
+       Failure: -1
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999      
+
+

HISTORY

+
  Explicit Fortran interfaces were added for 
+  called C functions (it is needed for Windows
+  port).  March 14, 2001
+ 
+  Datatype of the flag parameter is changed from 
+  INTEGER to LOGICAL 
+  June 4, 2003 
+
+

SOURCE

+
  SUBROUTINE h5pget_preserve_f(prp_id, flag, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier 
+    LOGICAL, INTENT(OUT) ::  flag        ! TRUE/FALSE flag. Shows status of the dataset's
+                                         ! transfer property for partial writing/reading
+                                         ! compound datatype
+    INTEGER, INTENT(OUT) :: hdferr       ! Error code
+                                         ! 0 on success and -1 on failure
+
+ +
+ +

h5pget_sec2_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
   h5pget_sec2_f 
+
+

PURPOSE

+
  NOT AVAILABLE
+
+

INPUTS

+

OUTPUTS

+
  hdferr  - error code         
+             Success:  0
+             Failure: -1   
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999      
+
+

HISTORY

+
  Explicit Fortran interfaces were added for 
+  called C functions (it is needed for Windows
+  port).  March 14, 2001 
+               
+ SOURCE!          SUBROUTINE h5pget_sec2_f (prp_id, sec2, hdferr) 
+            IMPLICIT NONE
+            INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
+            INTEGER, INTENT(OUT) :: sec2   ! value indicates whether the file
+            INTEGER, INTENT(OUT) :: hdferr  ! Error code
+ 0 on success and -1 on failure
+
+ +
+ +

h5pget_sieve_buf_size_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  h5pget_sieve_buf_size_f 
+
+

PURPOSE

+
  Gets the maximum size of the data sieve buffer
+
+

INPUTS

+
  plist_id     - file access property list identifier
+
+

OUTPUTS

+
  size         - sieve buffer size
+  hdferr       - error code            
+                  Success:  0
+                  Failure: -1
+
+

AUTHOR

+
  Elena Pourmal
+  October 7, 2002      
+
+

SOURCE

+
  SUBROUTINE h5pget_sieve_buf_size_f(plist_id, size, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: plist_id ! File access property list identifier 
+    INTEGER(SIZE_T), INTENT(OUT) :: size   ! Buffer size in bytes 
+    INTEGER, INTENT(OUT)       :: hdferr   ! Error code
+                                           ! 0 on success and -1 on failure
+
+ +
+ +

h5pget_size_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  h5pget_size_f 
+
+

PURPOSE

+
  Queries the size of a property value in bytes.
+
+

INPUTS

+
  prp_id       - property list identifier to query
+  name         - name of property to query
+
+

OUTPUTS

+
  size         - size of property in bytes
+  hdferr       - error code            
+                  Success:  0
+                  Failure: -1   
+
+

AUTHOR

+
  Elena Pourmal
+  October 9, 2002      
+
+

HISTORY

+

SOURCE

+
  SUBROUTINE h5pget_size_f(prp_id, name, size, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id  ! Property list identifier 
+    CHARACTER(LEN=*), INTENT(IN) :: name  ! Name of property to query
+    INTEGER(SIZE_T), INTENT(OUT) :: size  ! Size in bytes
+    INTEGER, INTENT(OUT) :: hdferr        ! Error code
+                                          ! 0 on success and -1 on failure
+
+ +
+ +

h5pget_sizes_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  h5pget_sizes_f 
+
+

PURPOSE

+
  Retrieves the size of the offsets and lengths used 
+  in an HDF5 file
+
+

INPUTS

+
  prp_id       - file creation property list identifier
+
+

OUTPUTS

+
  sizeof_addr  - size of an object offset in bytes 
+  sizeof_size  - size of an object length in bytes
+  hdferr       - error code            
+                  Success:  0
+                  Failure: -1   
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999      
+
+

HISTORY

+
  Explicit Fortran interfaces were added for 
+  called C functions (it is needed for Windows
+  port).  March 14, 2001 
+               
+
+

SOURCE

+
  SUBROUTINE h5pget_sizes_f(prp_id, sizeof_addr, sizeof_size, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id        ! Property list identifier 
+    INTEGER(SIZE_T), INTENT(OUT) :: sizeof_addr ! Size of an object
+                                                ! offset in bytes 
+    INTEGER(SIZE_T), INTENT(OUT) :: sizeof_size ! Size of an object
+                                                ! length in bytes 
+    INTEGER, INTENT(OUT) :: hdferr              ! Error code
+                                                ! 0 on success and -1 on failure
+
+ +
+ +

h5pget_small_data_block_size_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  h5pget_small_data_block_size_f 
+
+

PURPOSE

+
  Gets the minimum size of "small" raw data block
+
+

INPUTS

+
  plist_id     - file access property list identifier
+
+

OUTPUTS

+
  size         - small raw data block size
+  hdferr       - error code            
+                  Success:  0
+                  Failure: -1
+
+

AUTHOR

+
  Elena Pourmal
+  October 7, 2002      
+
+

SOURCE

+
  SUBROUTINE h5pget_small_data_block_size_f(plist_id, size, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: plist_id  ! File access property list identifier 
+    INTEGER(HSIZE_T), INTENT(OUT) :: size   ! Small raw data block size
+    INTEGER, INTENT(OUT) :: hdferr          ! Error code
+                                            ! 0 on success and -1 on failure
+
+ +
+ +

h5pget_split_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
   h5pget_split_f 
+
+

PURPOSE

+
  NOT AVAILABLE
+
+

INPUTS

+

OUTPUTS

+
  hdferr  - error code         
+             Success:  0
+             Failure: -1   
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999      
+
+

HISTORY

+
  Explicit Fortran interfaces were added for 
+  called C functions (it is needed for Windows
+  port).  March 14, 2001 
+               
+
+

SOURCE

+
!          SUBROUTINE h5pget_split_f(prp_id, meta_ext_size, meta_ext, meta_plist,raw_ext_size,&
+!                                     raw_ext, raw_plist, hdferr)
+!            IMPLICIT NONE
+!            INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
+!            INTEGER(SIZE_T), INTENT(IN) :: meta_ext_size ! Number of characters of the meta
+                                                         ! file extension to be copied to the
+                                                         ! meta_ext buffer
+
+!            CHARACTER(LEN=*), INTENT(OUT) :: meta_ext  !Name of the extension for
+                                                      !the metafile filename
+!            INTEGER(HID_T), INTENT(OUT) :: meta_plist  ! Identifier of the meta file
+                                                      ! access property list
+!            INTEGER(SIZE_T), INTENT(IN) :: raw_ext_size ! Number of characters of the raw
+                                                         ! file extension to be copied to the
+                                                         ! raw_ext buffer
+!            CHARACTER(LEN=*), INTENT(OUT) :: raw_ext  !Name extension for the raw file filename
+!            INTEGER(HID_T), INTENT(OUT) :: raw_plist  !Identifier of the raw file
+                                                     !access property list
+!            INTEGER, INTENT(OUT) :: hdferr  ! Error code
+                                     ! 0 on success and -1 on failure
+
+ +
+ +

h5pget_stdio_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  h5pget_stdio_f 
+
+

PURPOSE

+
  NOT AVAILABLE
+
+

INPUTS

+

OUTPUTS

+
  hdferr  - error code         
+             Success:  0
+             Failure: -1   
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999      
+
+

HISTORY

+
  Explicit Fortran interfaces were added for 
+  called C functions (it is needed for Windows
+  port).  March 14, 2001 
+               
+
+

SOURCE

+
!          SUBROUTINE h5pget_stdio_f (prp_id, io, hdferr)
+!
+!            IMPLICIT NONE
+!            INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
+!            INTEGER, INTENT(OUT) :: io   ! value indicates that the file
+                                         !access property list is set to
+                                         !the stdio driver
+!            INTEGER, INTENT(OUT) :: hdferr  ! Error code
+                                     ! 0 on success and -1 on failure
+
+ +
+ +

h5pget_sym_k_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  h5pget_sym_k_f 
+
+

PURPOSE

+
  Retrieves the size of the symbol table B-tree 1/2 rank
+  and the symbol table leaf node 1/2 size. 
+
+

INPUTS

+
  prp_id       - file creation property list identifier
+
+

OUTPUTS

+
  ik           - symbol table tree 1/2 rank
+  lk           - symbol table node 1/2 size
+  hdferr       - error code            
+                  Success:  0
+                  Failure: -1   
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999      
+
+

HISTORY

+
  Explicit Fortran interfaces were added for 
+  called C functions (it is needed for Windows
+  port).  March 14, 2001 
+               
+
+

SOURCE

+
  SUBROUTINE h5pget_sym_k_f(prp_id, ik, lk, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier 
+    INTEGER, INTENT(OUT) :: ik           ! Symbol table tree rank
+    INTEGER, INTENT(OUT) :: lk           ! Symbol table node size
+    INTEGER, INTENT(OUT) :: hdferr       ! Error code
+                                         ! 0 on success and -1 on failure
+
+ +
+ +

h5pget_userblock_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  h5pget_userblock_f 
+
+

PURPOSE

+
  Gets user block size.
+
+

INPUTS

+
  prp_id       - file creation property list identifier
+
+

OUTPUTS

+
  block_size   - size of the user block in bytes
+  hdferr       - error code            
+                  Success:  0
+                  Failure: -1   
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999      
+
+

HISTORY

+
  Explicit Fortran interfaces were added for 
+  called C functions (it is needed for Windows
+  port).  March 14, 2001 
+               
+
+

SOURCE

+
  SUBROUTINE h5pget_userblock_f(prp_id, block_size, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id         ! Property list identifier 
+    INTEGER(HSIZE_T), INTENT(OUT) ::  block_size ! Size of the 
+                                                 ! user-block in bytes 
+    INTEGER, INTENT(OUT) :: hdferr               ! Error code
+                                                 ! 0 on success and -1 on failure
+
+ +
+ +

h5pget_version_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  h5pget_version_f 
+
+

PURPOSE

+
  Retrieves the version information of various objects 
+  for a file creation property list
+
+

INPUTS

+
  prp_id       - file createion property list identifier
+
+

OUTPUTS

+
  boot         - super block version number
+  freelist     - global freelist version number
+  stab         - symbol table version number
+  shhdr        - shared object header version number
+  hdferr       - error code            
+                  Success:  0
+                  Failure: -1   
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999      
+
+

HISTORY

+
  Explicit Fortran interfaces were added for 
+  called C functions (it is needed for Windows
+  port).  March 14, 2001 
+               
+
+

SOURCE

+
  SUBROUTINE h5pget_version_f(prp_id, boot, freelist, &
+       stab, shhdr, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id        ! Property list identifier 
+    INTEGER, DIMENSION(:), INTENT(OUT) :: boot  ! Array to put boot
+                                                ! block version number
+    INTEGER, DIMENSION(:), INTENT(OUT) :: freelist  ! Array to put global
+                                                    ! Freelist version number
+
+    INTEGER, DIMENSION(:), INTENT(OUT) :: stab  ! Array to put symbol
+                                                ! table version number
+    INTEGER, DIMENSION(:), INTENT(OUT) :: shhdr ! Array to put shared
+                                                ! object header version number
+    INTEGER, INTENT(OUT) :: hdferr              ! Error code
+                                                ! 0 on success and -1 on failure
+
+ +
+ +

h5pisa_class_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
   h5pisa_class_f 
+
+

PURPOSE

+
  Determines whether a property list is a member of a class. 
+
+

INPUTS

+
  plist        - property list identifier 
+  pclass       - identifier of the property class
+
+

OUTPUTS

+
  flag         - .TRUE. if a member, .FALSE. otherwise
+  hdferr:      - error code           
+                  Success:  0
+                  Failure: -1   
+
+

AUTHOR

+
  Elena Pourmal
+  October 9, 2002      
+
+

SOURCE

+
  SUBROUTINE h5pisa_class_f(plist, pclass, flag, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: plist     ! Property list identifier 
+    INTEGER(HID_T), INTENT(IN) :: pclass    ! Class identifier
+    LOGICAL, INTENT(OUT) :: flag            ! logical flag
+    INTEGER, INTENT(OUT) :: hdferr  ! Error code
+                                    ! 0 on success and -1 on failure
+
+ +
+ +

h5pmodify_filter_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  h5pmodify_filter_f 
+
+

PURPOSE

+
  Adds a filter to the filter pipeline. 
+
+

INPUTS

+
  prp_id       - data creation or transfer property list 
+                 identifier
+  filter       - filter to be modified
+  flags        - bit vector specifying certain general
+                 properties of the filter
+  cd_nelmts    - number of elements in cd_values
+  cd_values    - auxiliary data for the filter
+
+

OUTPUTS

+
  hdferr       - error code            
+                  Success:  0
+                  Failure: -1   
+
+

AUTHOR

+
  Elena Pourmal
+  April 10 2003
+
+

SOURCE

+
  SUBROUTINE h5pmodify_filter_f(prp_id, filter, flags, cd_nelmts, cd_values,  hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier 
+    INTEGER, INTENT(IN) :: filter        ! Filter to be modified
+    INTEGER, INTENT(IN) :: flags         ! Bit vector specifying certain general
+                                         !  properties of the filter
+    INTEGER(SIZE_T), INTENT(IN) :: cd_nelmts       ! Number of elements in cd_values
+    INTEGER, DIMENSION(*), INTENT(IN) :: cd_values ! Auxiliary data for the filter
+    INTEGER, INTENT(OUT) :: hdferr       ! Error code
+                                         ! 0 on success and -1 on failure
+
+ +
+ +

h5premove_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
   h5premove_f 
+
+

PURPOSE

+
  Removes a property from a property list. 
+
+

INPUTS

+
  plid         - Property list identofoer
+  name         - name of the property to remove
+
+

OUTPUTS

+
  hdferr:      - error code
+                  Success: 0 
+                  Failure: -1   
+
+

AUTHOR

+
  Elena Pourmal
+  October 9, 2002      
+
+

SOURCE

+
  SUBROUTINE h5premove_f(plid, name, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: plid   ! Property list identifier
+    CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to remove
+    INTEGER, INTENT(OUT) :: hdferr       ! Error code
+                                         !  0 on success and -1 on failure
+
+ +
+ +

h5premove_filter_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  h5premove_filter_f 
+
+

PURPOSE

+
  Delete one or more filters from the filter pipeline. 
+
+

INPUTS

+
  prp_id       - data creation or transfer property list 
+                 identifier
+  filter       - filter to be removed
+
+

OUTPUTS

+
  hdferr       - error code            
+                  Success:  0
+                  Failure: -1   
+
+

AUTHOR

+
  Quincey Koziol
+  January 27 2004
+
+

SOURCE

+
  SUBROUTINE h5premove_filter_f(prp_id, filter, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id ! Dataset creation property list
+                                         ! identifier
+    INTEGER, INTENT(IN) :: filter        ! Filter to be removed
+    INTEGER, INTENT(OUT) :: hdferr       ! Error code
+                                         ! 0 on success and -1 on failure
+
+ +
+ +

h5pset_alignment_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  h5pset_alignment_f 
+
+

PURPOSE

+
  Sets alignment properties of a file access property list. 
+
+

INPUTS

+
  prp_id       - file access property list identifier
+  threshold    - threshold value       
+  alignment    - alignment value
+
+

OUTPUTS

+
  hdferr       - error code            
+                  Success:  0
+                  Failure: -1   
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999      
+
+

HISTORY

+
  Explicit Fortran interfaces were added for 
+  called C functions (it is needed for Windows
+  port).  March 14, 2001 
+               
+
+

SOURCE

+
  SUBROUTINE h5pset_alignment_f(prp_id, threshold,  alignment, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id      ! Property list identifier 
+    INTEGER(HSIZE_T), INTENT(IN) :: threshold ! Threshold value
+    INTEGER(HSIZE_T), INTENT(IN) :: alignment ! alignment value
+    INTEGER, INTENT(OUT) :: hdferr            ! Error code
+                                              ! 0 on success and -1 on failure
+
+ +
+ +

h5pset_alloc_time_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  h5pset_alloc_time_f
+
+

PURPOSE

+
  Set space allocation time for dataset during creation.
+
+

INPUTS

+
  plist_id     - dataset creation property list identifier
+  flag         - allocation time flag:
+                   H5D_ALLOC_TIME_ERROR_F
+                   H5D_ALLOC_TIME_DEFAULT_F
+                   H5D_ALLOC_TIME_EARLY_F
+                   H5D_ALLOC_TIME_LATE_F
+                   H5D_ALLOC_TIME_INCR_F
+
+

OUTPUTS

+
  hdferr       - error code            
+                  Success:  0
+                  Failure: -1
+
+

AUTHOR

+
  Elena Pourmal
+  October 4, 2002      
+
+

SOURCE

+
  SUBROUTINE h5pset_alloc_time_f(plist_id, flag, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: plist_id  ! Dataset creation property list identifier
+    INTEGER, INTENT(IN) :: flag             ! Allocation time flag:
+                                            !  H5D_ALLOC_TIME_ERROR_F
+                                            !  H5D_ALLOC_TIME_DEFAULT_F
+                                            !  H5D_ALLOC_TIME_EARLY_F
+                                            !  H5D_ALLOC_TIME_LATE_F
+                                            !  H5D_ALLOC_TIME_INCR_F
+    INTEGER, INTENT(OUT) :: hdferr          ! Error code
+                                            ! 0 on success and -1 on failure
+
+ +
+ +

H5Pset_attr_creation_order_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  H5Pset_attr_creation_order_f 
+
+

PURPOSE

+
  Sets tracking and indexing of attribute creation order
+
+

INPUTS

+
  ocpl_id         - Object creation property list identifier
+  crt_order_flags - Flags specifying whether to track and index attribute creation order
+
+

OUTPUTS

+
  hdferr          - Error code         
+                     Success:  0
+                     Failure: -1   
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  January, 2008
+
+

SOURCE

+
  SUBROUTINE h5pset_attr_creation_order_f(ocpl_id, crt_order_flags , hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: ocpl_id   ! Object (dataset or group) creation property list identifier
+    INTEGER, INTENT(IN) :: crt_order_flags  ! Flags specifying whether to track and index attribute creation order
+    INTEGER, INTENT(OUT) :: hdferr          ! Error code
+                                            ! 0 on success and -1 on failure
+
+ +
+ +

H5Pset_attr_phase_change_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  H5Pset_attr_phase_change_f 
+
+

PURPOSE

+
  Sets attribute storage phase change thresholds.
+
+

INPUTS

+
  ocpl_id - Object (dataset or group) creation property list identifier
+
+

OUTPUTS

+
  max_compact     - Maximum number of attributes to be stored in compact storage
+                    (Default: 8)
+  min_dense       - Minimum number of attributes to be stored in dense storage
+                    (Default: 6)
+  hdferr          - Error code         
+                     Success:  0
+                     Failure: -1   
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  January, 2008
+
+

SOURCE

+
SUBROUTINE h5pset_attr_phase_change_f(ocpl_id, max_compact, min_dense, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: ocpl_id ! Object (dataset or group) creation property list identifier
+    INTEGER, INTENT(IN) :: max_compact    ! Maximum number of attributes to be stored in compact storage
+                                          !(Default: 8)
+    INTEGER, INTENT(IN) :: min_dense      ! Minimum number of attributes to be stored in dense storage
+                                          ! (Default: 6)
+    INTEGER, INTENT(OUT) :: hdferr        ! Error code
+                                          ! 0 on success and -1 on failure
+
+ +
+ +

h5pset_btree_ratios_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
   h5pset_btree_ratios_f 
+
+

PURPOSE

+
  Sets B-tree split ratios for a dataset transfer 
+  property list. 
+
+

INPUTS

+
  prp_id       - the dataset transfer property list 
+                 identifier 
+  left         - the B-tree split ratio for left-most nodes 
+  middle       - the B-tree split ratio for all other nodes
+  right        - the B-tree split ratio for right-most nodes
+
+

OUTPUTS

+
  hdferr       - error code            
+                  Success:  0
+                  Failure: -1   
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999      
+
+

HISTORY

+
  Explicit Fortran interfaces were added for 
+  called C functions (it is needed for Windows
+  port).  March 14, 2001 
+
+

SOURCE

+
  SUBROUTINE h5pset_btree_ratios_f(prp_id, left, middle, right, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
+    REAL, INTENT(IN) :: left   ! The B-tree split ratio for left-most nodes.
+    REAL, INTENT(IN) :: middle ! The B-tree split ratio for all other nodes 
+    REAL, INTENT(IN) :: right  ! The B-tree split ratio for right-most 
+                               !  nodes and lone nodes. 
+    INTEGER, INTENT(OUT) :: hdferr  ! Error code
+                                    ! 0 on success and -1 on failure
+
+ +
+ +

h5pset_buffer_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  h5pset_buffer_f 
+
+

PURPOSE

+
  Sets sixe for conversion buffer
+
+

INPUTS

+
  plist_id     - data transfer property list identifier
+  size         - buffer size 
+
+

OUTPUTS

+
  hdferr:      - error code            
+                  Success:  0
+                  Failure: -1
+
+

AUTHOR

+
  Elena Pourmal
+  October 2, 2002      
+
+

SOURCE

+
  SUBROUTINE h5pset_buffer_f(plist_id, size, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: plist_id ! Data transfer property list identifier 
+    INTEGER(HSIZE_T), INTENT(IN) :: size   ! Buffer size in bytes; 
+                                           ! buffer is allocated and freed by 
+                                           ! the library.
+    INTEGER, INTENT(OUT)       :: hdferr   ! Error code
+                                           ! 0 on success and -1 on failure
+
+ +
+ +

h5pset_cache_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
   h5pset_cache_f 
+
+

PURPOSE

+
  Sets the meta data cache and raw data chunk 
+  cache parameters
+
+

INPUTS

+
  prp_id       - file access property list identifier
+  mdc_nelmts   - number of elements (objects) in the meta 
+                 data cache 
+  rdcc_nelmts  - number of elements (objects) in the raw 
+                 data chunk cache 
+  rdcc_nbytes  - total size of the raw data chunk cache, in bytes 
+  rdcc_w0      - preemption policy (0 or 1)
+
+

OUTPUTS

+
  hdferr       - error code            
+                  Success:  0
+                  Failure: -1   
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999      
+
+

HISTORY

+
  Explicit Fortran interfaces were added for 
+  called C functions (it is needed for Windows
+  port).  March 14, 2001 
+               
+
+

SOURCE

+
  SUBROUTINE h5pset_cache_f(prp_id, mdc_nelmts,rdcc_nelmts, rdcc_nbytes, rdcc_w0, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier 
+    INTEGER, INTENT(IN) :: mdc_nelmts    ! Number of elements (objects)
+                                         !  in the meta data cache
+    INTEGER(SIZE_T), INTENT(IN) :: rdcc_nelmts ! Number of elements (objects)
+                                               !  in the meta data cache
+    INTEGER(SIZE_T), INTENT(IN) :: rdcc_nbytes ! Total size of the raw data 
+                                               !  chunk cache, in bytes 
+    REAL, INTENT(IN) :: rdcc_w0                ! Preemption policy
+    INTEGER, INTENT(OUT) :: hdferr             ! Error code
+                                               !  0 on success and -1 on failure
+
+ +
+ +

H5Pset_char_encoding_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  H5Pset_char_encoding_f
+
+

PURPOSE

+
  Sets the character encoding used to encode a string.
+
+

INPUTS

+
  plist_id - Property list identifier
+  encoding - Valid values for encoding are:
+               H5T_CSET_ASCII_F -> US ASCII
+               H5T_CSET_UTF8_F -> UTF-8 Unicode encoding
+
+

OUTPUTS

+
  hdferr   - Error code                
+               Success:  0
+               Failure: -1   
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  March 3, 2008
+
+

SOURCE

+
  SUBROUTINE h5pset_char_encoding_f(plist_id, encoding, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: plist_id ! Property list identifier
+    INTEGER, INTENT(IN) :: encoding        ! String encoding character set:
+                                           !   H5T_CSET_ASCII_F -> US ASCII
+                                           !   H5T_CSET_UTF8_F  -> UTF-8 Unicode encoding
+    INTEGER, INTENT(OUT) :: hdferr         ! Error code
+                                           ! 0 on success and -1 on failure
+
+ +
+ +

H5Pset_chunk_cache_f

+ +

[ Top ] [ Subroutines ]

+

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          - Dataset access property list identifier.
+  rdcc_nslots      - The number of chunk slots in the raw data chunk cache for this dataset.
+  rdcc_nbytes      - The total size of the raw data chunk cache for this dataset.
+  rdcc_w0          - The chunk preemption policy for this dataset.
+
+

OUTPUTS

+
  hdferr           - Error code                
+                       Success:  0
+                       Failure: -1   
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  April 13, 2009
+
+

HISTORY

+

SOURCE

+
  SUBROUTINE h5pset_chunk_cache_f(dapl_id, rdcc_nslots, rdcc_nbytes, rdcc_w0, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: dapl_id      ! Dataset access property list identifier.
+    INTEGER(SIZE_T), INTENT(IN) :: rdcc_nslots ! The number of chunk slots in the raw data 
+                                               ! chunk cache for this dataset.
+    INTEGER(SIZE_T), INTENT(IN) :: rdcc_nbytes ! The total size of the raw data chunk cache 
+                                               ! for this dataset.
+    REAL, INTENT(IN) :: rdcc_w0                ! The chunk preemption policy for this dataset.
+    INTEGER, INTENT(OUT) :: hdferr             ! Error code
+                                               ! 0 on success and -1 on failure
+
+ +
+ +

h5pset_chunk_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
   h5pset_chunk_f 
+
+

PURPOSE

+
  Sets the size of the chunks used to store 
+  a chunked layout dataset. 
+
+

INPUTS

+
  prp_id  - datatset creation property list identifier
+  ndims   - number of dimensions for each chunk
+  dims    - array with dimension sizes for each chunk
+
+

OUTPUTS

+
  hdferr  - error code         
+             Success:  0
+             Failure: -1
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999      
+
+

HISTORY

+
   Explicit Fortran interfaces were added for 
+   called C functions (it is needed for Windows
+   port).  March 14, 2001 
+               
+
+

SOURCE

+
  SUBROUTINE h5pset_chunk_f(prp_id, ndims, dims, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier 
+    INTEGER, INTENT(IN) :: ndims         ! Number of chunk dimensions
+    INTEGER(HSIZE_T), DIMENSION(ndims), INTENT(IN) :: dims    
+                                         ! Array containing sizes of
+                                         ! chunk dimensions
+    INTEGER, INTENT(OUT) :: hdferr       ! Error code
+                                         ! 0 on success and -1 on failure
+
+ +
+ +

h5pset_copy_object_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  h5pset_copy_object_f 
+
+

PURPOSE

+
  Sets properties to be used when an object is copied.
+
+

INPUTS

+
  ocp_plist_id - Object copy property list identifier
+  copy_options - Copy option(s) to be set
+
+

OUTPUTS

+
  hdferr       - error code            
+                  Success:  0
+                  Failure: -1   
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  March 3, 2008
+
+

HISTORY

+

SOURCE

+
  SUBROUTINE h5pset_copy_object_f(ocp_plist_id, copy_options, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: ocp_plist_id ! Object copy property list identifier
+    INTEGER, INTENT(IN) :: copy_options ! Copy option(s) to be set, valid options are:
+                                        !   H5O_COPY_SHALLOW_HIERARCHY_F
+                                        !   H5O_COPY_EXPAND_SOFT_LINK_F
+                                        !   H5O_COPY_EXPAND_EXT_LINK_F
+                                        !   H5O_COPY_EXPAND_REFERENCE_F
+                                        !   H5O_COPY_WITHOUT_ATTR_FLAG_F
+    INTEGER, INTENT(OUT) :: hdferr      ! Error code
+                                        ! 0 on success and -1 on failure
+
+ +
+ +

H5Pset_create_inter_group_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  H5Pset_create_inter_group_f
+
+

PURPOSE

+
  Specifies in property list whether to create missing intermediate groups.
+
+

INPUTS

+
  lcpl_id            - Link creation property list identifier
+  crt_intermed_group - crt_intermed_group specifying whether 
+                       to create intermediate groups upon the creation 
+                       of an object
+
+

OUTPUTS

+
  hdferr             - Error code              
+                         Success:  0
+                         Failure: -1   
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  February 22, 2008
+
+

HISTORY

+
 The long subroutine name (>31) on older f90 compilers causes problems
+          so had to shorten the name
+
+

SOURCE

+
  SUBROUTINE h5pset_create_inter_group_f(lcpl_id, crt_intermed_group, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: lcpl_id      ! Link creation property list identifier
+    INTEGER, INTENT(IN) :: crt_intermed_group  ! specifying whether to create intermediate groups
+                                               ! upon the creation of an object
+    INTEGER, INTENT(OUT) :: hdferr ! Error code
+                                   ! 0 on success and -1 on failure
+
+ +
+ +

h5pset_data_transform_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  h5pset_data_transform_f 
+
+

PURPOSE

+
  Sets a data transform expression.
+
+

INPUTS

+
  plist_id   - Identifier of the property list or class 
+  expression - Buffer to hold transform expression
+
+

OUTPUTS

+
  hdferr     - error code
+                 Success:  0
+                 Failure: -1
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  March 19, 2008
+
+

SOURCE

+
  SUBROUTINE h5pset_data_transform_f(plist_id, expression, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: plist_id     ! Identifier of the property list or class
+    CHARACTER(LEN=*), INTENT(IN) :: expression ! Buffer to hold transform expression
+    INTEGER, INTENT(OUT) :: hdferr             ! Error code
+                                               ! 0 on success and -1 on failure
+
+ +
+ +

h5pset_deflate_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
   h5pset_deflate_f 
+
+

PURPOSE

+
   Sets compression method and compression level. 
+
+

INPUTS

+
   prp_id  - property list identifier
+   level   - compression level
+
+

OUTPUTS

+
  hdferr  - error code         
+             Success:  0
+             Failure: -1
+
+

AUTHOR

+
       Elena Pourmal
+               August 12, 1999
+
+

HISTORY

+
       Explicit Fortran interfaces were added for 
+                       called C functions (it is needed for Windows
+                       port).  March 14, 2001
+               
+
+

SOURCE

+
  SUBROUTINE h5pset_deflate_f(prp_id, level, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier 
+    INTEGER, INTENT(IN) :: level         ! Compression level 
+    INTEGER, INTENT(OUT) :: hdferr       ! Error code
+                                         ! 0 on success and -1 on failure
+
+ +
+ +

h5pset_edc_check_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  h5pset_edc_check_f 
+
+

PURPOSE

+
  Enables/disables error detecting  
+
+

INPUTS

+
  prp_id       - dataset creation property list identifier
+  flag         - EDC flag; possible values:
+                   H5Z_DISABLE_EDC_F
+                   H5Z_ENABLE_EDC_F
+
+

OUTPUTS

+
  hdferr       - error code            
+                  Success:  0
+                  Failure: -1   
+
+

AUTHOR

+
  Elena Pourmal
+  March 13, 2003
+
+

SOURCE

+
  SUBROUTINE h5pset_edc_check_f(prp_id, flag, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier 
+    INTEGER, INTENT(IN) :: flag          ! Checksum filter flag
+    INTEGER, INTENT(OUT) :: hdferr       ! Error code
+                                         ! 0 on success and -1 on failure
+
+ +
+ +

h5pset_est_link_info_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  h5pset_est_link_info_f 
+
+

PURPOSE

+
  Sets estimated number of links and length of link names in a group.
+
+

INPUTS

+
 gcpl_id         - Group creation property list identifier  
+ est_num_entries - Estimated number of links to be inserted into group
+ est_name_len    - Estimated average length of link names
+
+

OUTPUTS

+
  hdferr         - Error code
+                    Success:  0
+                    Failure: -1
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  March 21, 2008
+
+

SOURCE

+
  SUBROUTINE h5pset_est_link_info_f(gcpl_id, est_num_entries, est_name_len, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: gcpl_id  ! Group creation property list identifier  
+    INTEGER, INTENT(IN) :: est_num_entries ! Estimated number of links to be inserted into group
+    INTEGER, INTENT(IN) :: est_name_len    ! Estimated average length of link names
+    INTEGER, INTENT(OUT) :: hdferr         ! Error code
+                                           ! 0 on success and -1 on failure
+
+ +
+ +

h5pset_external_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
   h5pset_external_f 
+
+

PURPOSE

+
  Adds an external file to the list of external files. 
+
+

INPUTS

+
  prp_id       - dataset creation property list identifier
+  name         - name of external file
+  offset       - offset in bytes from the beginning of the 
+                 file to the location in the file
+                 where the data starts
+  bytes        - size of the external file data. 
+
+

OUTPUTS

+
  hdferr       - error code            
+                  Success:  0
+                  Failure: -1   
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999      
+
+

HISTORY

+
  Explicit Fortran interfaces were added for 
+  called C functions (it is needed for Windows
+  port).  March 14, 2001 
+
+

SOURCE

+
  SUBROUTINE h5pset_external_f(prp_id, name, offset,bytes, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id  ! Property list identifier
+    CHARACTER(LEN=*), INTENT(IN) :: name  ! Name of an external file
+    INTEGER, INTENT(IN) :: offset         ! Offset, in bytes, from the beginning 
+                                          !  of the file to the location in the file 
+                                          !  where the data starts.
+    INTEGER(HSIZE_T), INTENT(IN) :: bytes ! Number of bytes reserved in the 
+                                          !  file for the data
+    INTEGER, INTENT(OUT) :: hdferr        ! Error code
+                                          ! 0 on success and -1 on failure
+
+ +
+ +

h5pset_fapl_core_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
   h5pset_fapl_core_f 
+
+

PURPOSE

+
  Modifies the file access property list to use the 
+  H5FD_CORE driver. 
+
+

INPUTS

+
  prp_id           - file access property list identifier
+  increment        - size, in bytes, of memory increments 
+  backing_store    - boolean flag indicating whether to write 
+                     the file contents to disk when the file is closed. 
+
+

OUTPUTS

+
  hdferr           - error code                
+                       Success:  0
+                       Failure: -1   
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999      
+
+

HISTORY

+
  Explicit Fortran interfaces were added for 
+  called C functions (it is needed for Windows
+  port).  March 14, 2001 
+               
+
+

SOURCE

+
  SUBROUTINE h5pset_fapl_core_f(prp_id, increment, backing_store, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id     ! Property list identifier 
+    INTEGER(SIZE_T), INTENT(IN) :: increment ! File block size in bytes.
+    LOGICAL, INTENT(IN) :: backing_store ! Flag to indicate that
+                                         ! entire file contents are flushed to a file 
+                                         ! with the same name as this core file.
+    INTEGER, INTENT(OUT) :: hdferr       ! Error code
+                                         ! 0 on success and -1 on failure
+
+ +
+ +

h5pset_fapl_direct_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  h5pset_fapl_direct_f
+
+

PURPOSE

+
  Sets up use of the direct I/O driver.
+
+

INPUTS

+
  fapl_id      - File access property list identifier
+  alignment    - Required memory alignment boundary
+  block_size   - File system block size
+  cbuf_size    - Copy buffer size
+
+

OUTPUTS

+
  hdferr       - error code            
+                  Success:  0
+                  Failure: -1   
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  March 21, 2008
+
+

SOURCE

+
SUBROUTINE h5pset_fapl_direct_f(fapl_id, alignment, block_size, cbuf_size, hdferr)
+    IMPLICIT NONE  
+    INTEGER(HID_T), INTENT(IN) :: fapl_id     ! File access property list identifier
+    INTEGER(SIZE_T), INTENT(IN) :: alignment  ! Required memory alignment boundary!
+    INTEGER(SIZE_T), INTENT(IN) :: block_size ! File system block size
+    INTEGER(SIZE_T), INTENT(IN) :: cbuf_size  ! Copy buffer size
+    INTEGER, INTENT(OUT) :: hdferr            ! Error code
+                                              ! 0 on success and -1 on failure
+
+ +
+ +

h5pset_fapl_multi_l

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  h5pset_fapl_multi_l 
+
+

PURPOSE

+
  Sets up use of the multi-file driver. 
+
+

INPUTS

+
  prp_id       - file creation property list identifier
+  mem_map      - mapping array
+  memb_fapl    - property list for each memory usage type
+  memb_name    - names of member file
+  relax        - flag 
+
+

OUTPUTS

+
  hdferr       - error code            
+                  Success:  0
+                  Failure: -1   
+
+

AUTHOR

+
  Elena Pourmal
+  20 March 2003
+
+

SOURCE

+
  SUBROUTINE h5pset_fapl_multi_l(prp_id, memb_map, memb_fapl, memb_name, memb_addr, relax, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id ! File creation property list identifier 
+    INTEGER, DIMENSION(0:H5FD_MEM_NTYPES_F-1), INTENT(IN) :: memb_map ! Mapping array
+    INTEGER(HID_T), DIMENSION(0:H5FD_MEM_NTYPES_F-1), INTENT(IN) :: memb_fapl ! Property list for each memory usage type
+    CHARACTER(LEN=*), DIMENSION(0:H5FD_MEM_NTYPES_F-1), INTENT(IN) :: memb_name ! Names of member file
+    REAL, DIMENSION(0:H5FD_MEM_NTYPES_F-1), INTENT(IN) :: memb_addr 
+    LOGICAL, INTENT(IN) :: relax     ! Flag
+    INTEGER, INTENT(OUT) :: hdferr   ! Error code
+                                     ! 0 on success and -1 on failure
+
+ +
+ +

h5pset_fapl_multi_s

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  h5pset_fapl_multi_s 
+
+

PURPOSE

+
  Sets up use of the multi-file driver. 
+
+

INPUTS

+
  prp_id       - file creation property list identifier
+  relax        - flag 
+
+

OUTPUTS

+
  hdferr       - error code            
+                  Success:  0
+                  Failure: -1   
+
+

AUTHOR

+
  Elena Pourmal
+  31 March 2003
+
+

SOURCE

+
  SUBROUTINE h5pset_fapl_multi_s(prp_id, relax, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id ! File creation property list identifier 
+    LOGICAL, INTENT(IN) :: relax
+    INTEGER, INTENT(OUT) :: hdferr       ! Error code
+                                         ! 0 on success and -1 on failure
+
+ +
+ +

h5pset_fapl_sec2_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  h5pset_fapl_sec2_f 
+
+

PURPOSE

+
  Sets the sec2 driver. 
+
+

INPUTS

+
  prp_id  - file access property list identifier
+
+

OUTPUTS

+
  hdferr  - error code         
+             Success:  0
+             Failure: -1   
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999      
+
+

HISTORY

+
  Explicit Fortran interfaces were added for 
+  called C functions (it is needed for Windows
+  port).  March 14, 2001 
+               
+
+

SOURCE

+
  SUBROUTINE h5pset_fapl_sec2_f (prp_id, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier 
+    INTEGER, INTENT(OUT) :: hdferr       ! Error code
+                                         ! 0 on success and -1 on failure
+
+ +
+ +

h5pset_fapl_split_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
   h5pset_fapl_split_f 
+
+

PURPOSE

+
  Emulates the old split file driver. 
+
+

INPUTS

+
  prp_id       - file access property list identifier
+  meta_ext     - name of the extension for the metafile 
+                 filename
+  meta_plist   - identifier of the meta file access property 
+                 list
+  raw_ext      - name extension for the raw file filename
+  raw_plist    - identifier of the raw file access property list
+
+

OUTPUTS

+
  hdferr       - error code            
+                   Success:  0
+                   Failure: -1   
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999      
+
+

HISTORY

+
  Explicit Fortran interfaces were added for 
+  called C functions (it is needed for Windows
+  port).  March 14, 2001 
+               
+
+

SOURCE

+
  SUBROUTINE h5pset_fapl_split_f(prp_id, meta_ext, meta_plist, raw_ext, raw_plist, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id     ! Property list identifier 
+    CHARACTER(LEN=*), INTENT(IN) :: meta_ext ! Name of the extension for
+                                             !  the metafile filename
+    INTEGER(HID_T), INTENT(IN) :: meta_plist ! Identifier of the meta file
+                                             !  access property list
+    CHARACTER(LEN=*), INTENT(IN) :: raw_ext  ! Name extension for the raw file filename
+    INTEGER(HID_T), INTENT(IN) :: raw_plist  ! Identifier of the raw file 
+                                             !  access property list
+    INTEGER, INTENT(OUT) :: hdferr           ! Error code
+                                             ! 0 on success and -1 on failure
+
+ +
+ +

h5pset_fapl_stdio_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  h5pset_fapl_stdio_f 
+
+

PURPOSE

+
  Sets the standard I/O driver. 
+
+

INPUTS

+
  prp_id  - file access property list identifier
+
+

OUTPUTS

+
  hdferr  - error code         
+             Success:  0
+             Failure: -1   
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999      
+
+

HISTORY

+
  Explicit Fortran interfaces were added for 
+  called C functions (it is needed for Windows
+  port).  March 14, 2001 
+               
+
+

SOURCE

+
  SUBROUTINE h5pset_fapl_stdio_f (prp_id, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier 
+    INTEGER, INTENT(OUT) :: hdferr       ! Error code
+                                         ! 0 on success and -1 on failure
+
+ +
+ +

h5pset_fclose_degree_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  h5pset_fclose_degree_f 
+
+

PURPOSE

+
  Sets the degree for the file close behavior.
+
+

INPUTS

+
  fapl_id      - file access property list identifier
+  degree       - Possible values are:
+                   H5F_CLOSE_DEFAULT_F
+                   H5F_CLOSE_WEAK_F
+                   H5F_CLOSE_SEMI_F
+                   H5F_CLOSE_STRONG_F
+
+

OUTPUTS

+
  hdferr       - error code            
+                  Success:  0
+                  Failure: -1   
+
+

AUTHOR

+
  Elena Pourmal
+  September 26, 2002   
+
+

SOURCE

+
  SUBROUTINE h5pset_fclose_degree_f(fapl_id, degree, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: fapl_id ! File Access Property list identifier 
+    INTEGER, INTENT(IN) :: degree         ! Possible values are: 
+                                          !  H5F_CLOSE_DEFAULT_F
+                                          !  H5F_CLOSE_WEAK_F
+                                          !  H5F_CLOSE_SEMI_F
+                                          !  H5F_CLOSE_STRONG_F
+    INTEGER, INTENT(OUT) :: hdferr        ! Error code
+                                          ! 0 on success and -1 on failure
+
+ +
+ +

h5pset_fill_time_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  h5pset_fill_time_f
+
+

PURPOSE

+
  Set fill value writing time for dataset
+
+

INPUTS

+
  plist_id     - dataset creation property list identifier
+  flag         - fill time flag:
+                   H5D_FILL_TIME_ERROR_F
+                   H5D_FILL_TIME_ALLOC_F
+                   H5D_FILL_TIME_NEVER_F
+
+

OUTPUTS

+
  hdferr       - error code            
+                  Success:  0
+                  Failure: -1
+
+

AUTHOR

+
  Elena Pourmal
+  October 4, 2002      
+
+

SOURCE

+
  SUBROUTINE h5pset_fill_time_f(plist_id, flag, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: plist_id  ! Dataset creation property list identifier
+    INTEGER, INTENT(IN) :: flag             ! Fill time flag:
+                                            !  H5D_FILL_TIME_ERROR_F
+                                            !  H5D_FILL_TIME_ALLOC_F
+                                            !  H5D_FILL_TIME_NEVER_F
+    INTEGER, INTENT(OUT) :: hdferr          ! Error code
+                                            ! 0 on success and -1 on failure
+
+ +
+ +

h5pset_filter_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  h5pset_filter_f 
+
+

PURPOSE

+
  Adds a filter to the filter pipeline. 
+
+

INPUTS

+
  prp_id       - data creation or transfer property list 
+                 identifier
+  filter       - filter to be added to the pipeline 
+  flags        - bit vector specifying certain general
+                 properties of the filter
+  cd_nelmts    - number of elements in cd_values
+  cd_values    - auxiliary data for the filter
+
+

OUTPUTS

+
  hdferr       - error code            
+                  Success:  0
+                  Failure: -1   
+
+

AUTHOR

+
  Elena Pourmal
+  February, 2003
+
+

SOURCE

+
  SUBROUTINE h5pset_filter_f(prp_id, filter, flags, cd_nelmts, cd_values,  hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier 
+    INTEGER, INTENT(IN) :: filter        ! Filter to be added to the pipeline.
+    INTEGER, INTENT(IN) :: flags         ! Bit vector specifying certain general
+                                       !  properties of the filter.
+    INTEGER(SIZE_T), INTENT(IN) :: cd_nelmts       ! Number of elements in cd_values.
+    INTEGER, DIMENSION(*), INTENT(IN) :: cd_values ! Auxiliary data for the filter.
+    INTEGER, INTENT(OUT) :: hdferr                 ! Error code
+                                                 ! 0 on success and -1 on failure
+
+ +
+ +

h5pset_fletcher32_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  h5pset_fletcher32_f 
+
+

PURPOSE

+
  Sets Fletcher32 checksum of EDC for a dataset creation 
+  property list.
+
+

INPUTS

+
  prp_id       - dataset creation property list identifier
+
+

OUTPUTS

+
  hdferr       - error code            
+                  Success:  0
+                  Failure: -1   
+
+

AUTHOR

+
  Elena Pourmal
+  March 13, 2003
+
+

SOURCE

+
  SUBROUTINE h5pset_fletcher32_f(prp_id, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier 
+    INTEGER, INTENT(OUT) :: hdferr       ! Error code
+                                         ! 0 on success and -1 on failure
+
+ +
+ +

h5pset_gc_references_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
   h5pset_gc_references_f 
+
+

PURPOSE

+
  Sets garbage collecting references flag. 
+
+

INPUTS

+
  prp_id       - file access property list identifier
+  gc_reference - flag for stting garbage collection on 
+                 and off (1 or 0)
+
+

OUTPUTS

+
  hdferr       - error code            
+                  Success:  0
+                  Failure: -1   
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999      
+
+

HISTORY

+
  Explicit Fortran interfaces were added for 
+  called C functions (it is needed for Windows
+  port).  March 14, 2001 
+               
+
+

SOURCE

+
  SUBROUTINE h5pset_gc_references_f (prp_id, gc_reference, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier 
+    INTEGER, INTENT(IN) :: gc_reference  ! The flag for garbage collecting
+                                         !  references for the file
+    INTEGER, INTENT(OUT) :: hdferr       ! Error code
+                                         ! 0 on success and -1 on failure
+
+ +
+ +

h5pset_hyper_vector_size_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  h5pset_hyper_vector_size_f 
+
+

PURPOSE

+
  Set the number of "I/O" vectors (vector size)
+
+

INPUTS

+
  plist_id     - dataset transfer property list identifier
+  size         - vector size
+
+

OUTPUTS

+
  hdferr       - error code            
+                  Success:  0
+                  Failure: -1
+
+

AUTHOR

+
  Elena Pourmal
+  October 7, 2002      
+
+

SOURCE

+
  SUBROUTINE h5pset_hyper_vector_size_f(plist_id, size, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: plist_id ! Dataset transfer property list identifier 
+    INTEGER(SIZE_T), INTENT(IN) :: size    ! Vector size
+    INTEGER, INTENT(OUT) :: hdferr         ! Error code
+                                           ! 0 on success and -1 on failure
+
+ +
+ +

h5pset_istore_k_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  h5pset_istore_k_f 
+
+

PURPOSE

+
  Sets the size of the parameter used to control the 
+  B-trees for indexing chunked datasets
+
+

INPUTS

+
  prp_id       - file creation property list identifier
+  ik           - 1/2 rank of chunked storage B-tree
+
+

OUTPUTS

+
  hdferr       - error code            
+                  Success:  0
+                  Failure: -1   
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999      
+
+

HISTORY

+
  Explicit Fortran interfaces were added for 
+  called C functions (it is needed for Windows
+  port).  March 14, 2001 
+               
+
+

SOURCE

+
  SUBROUTINE h5pset_istore_k_f (prp_id, ik, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier 
+    INTEGER, INTENT(IN) :: ik            ! 1/2 rank of chunked storage B-tree
+    INTEGER, INTENT(OUT) :: hdferr       ! Error code
+                                         ! 0 on success and -1 on failure
+
+ +
+ +

h5pset_layout_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
   h5pset_layout_f 
+
+

PURPOSE

+
  Sets the type of storage used store the raw data 
+  for a dataset. 
+
+

INPUTS

+
  prp_id       - data creation property list identifier
+  layout       - type of storage layout for raw data
+                 possible values are:
+                   H5D_COMPACT_F
+                   H5D_CONTIGUOUS_F
+                   H5D_CHUNKED_F
+
+

OUTPUTS

+
  hdferr      - error code             
+                 Success:  0
+                 Failure: -1   
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999      
+
+

HISTORY

+
  Explicit Fortran interfaces were added for 
+  called C functions (it is needed for Windows
+  port).  March 14, 2001 
+
+

SOURCE

+
  SUBROUTINE h5pset_layout_f (prp_id, layout, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier 
+    INTEGER, INTENT(IN) :: layout        ! Type of storage layout for raw data
+                                         ! possible values are:
+                                         !   H5D_COMPACT_F
+                                         !   H5D_CONTIGUOUS_F
+                                         !   H5D_CHUNKED_F
+    INTEGER, INTENT(OUT) :: hdferr       ! Error code
+                                         ! 0 on success and -1 on failure
+
+ +
+ +

H5Pset_libver_bounds_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
             H5Pset_libver_bounds_f
+
+

PURPOSE

+
    Sets bounds on library versions, and indirectly format versions, to be used when creating objects.
+
+

INPUTS

+
  fapl_id - File access property list identifier
+  low     - The earliest version of the library that will be used for writing objects.
+  high    - The latest version of the library that will be used for writing objects.
+
+

OUTPUTS

+
  hdferr  - error code         
+             Success:  0
+             Failure: -1   
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  February 18, 2008
+
+

SOURCE

+
  SUBROUTINE h5pset_libver_bounds_f(fapl_id, low, high, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: fapl_id ! File access property list identifier
+    INTEGER, INTENT(IN) :: low   ! The earliest version of the library that will be used for writing objects.
+                                 ! Currently, low must be one of two pre-defined values:
+                                 !            HDF_LIBVER_EARLIEST_F
+                                 !            HDF_LIBVER_LATEST_F
+    INTEGER, INTENT(IN) :: high  ! The latest version of the library that will be used for writing objects.
+                                 ! Currently, low must set to the pre-defined value:
+                                 !            HDF_LIBVER_LATEST_F
+    INTEGER, INTENT(OUT) :: hdferr  ! Error code
+                                    ! 0 on success and -1 on failure
+
+ +
+ +

H5Pset_link_creation_order_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  H5Pset_link_creation_order_f 
+
+

PURPOSE

+
    Sets creation order tracking and indexing for links in a group.
+
+

INPUTS

+
  gcpl_id         - Group creation property list identifier
+  crt_order_flags - Creation order flag(s)
+
+

OUTPUTS

+
  hdferr           - Error code                
+                       Success:  0
+                       Failure: -1   
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  February 18, 2008
+
+

SOURCE

+
  SUBROUTINE h5pset_link_creation_order_f(gcpl_id, crt_order_flags, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: gcpl_id  ! File access property list identifier
+    INTEGER, INTENT(IN) :: crt_order_flags ! Creation order flag(s)
+    INTEGER, INTENT(OUT) :: hdferr   ! Error code
+                                     ! 0 on success and -1 on failure
+
+ +
+ +

h5pset_link_phase_change_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  h5pset_link_phase_change_f
+
+

PURPOSE

+
  Sets the parameters for conversion between compact and dense groups.
+
+

INPUTS

+
  gcpl_id         - Group creation property list identifier  
+  max_compact     - Maximum number of attributes to be stored in compact storage
+  min_dense       - Minimum number of attributes to be stored in dense storage
+
+

OUTPUTS

+
  hdferr          - error code         
+                     Success:  0
+                     Failure: -1   
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  March 21, 2008
+
+

SOURCE

+
SUBROUTINE h5pset_link_phase_change_f(gcpl_id, max_compact, min_dense, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: gcpl_id ! Group creation property list identifier
+    INTEGER, INTENT(IN) :: max_compact    ! Maximum number of attributes to be stored in compact storage
+    INTEGER, INTENT(IN) :: min_dense      ! Minimum number of attributes to be stored in dense storage
+    INTEGER, INTENT(OUT) :: hdferr        ! Error code
+                                          ! 0 on success and -1 on failure
+
+ +
+ +

H5Pset_local_heap_size_hint_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  H5Pset_local_heap_size_hint_f 
+
+

PURPOSE

+
  Sets the local heap size hint for original-style groups.
+
+

INPUTS

+
  gcpl_id   - Group creation property list identifier
+  size_hint - Hint for size of local heap
+
+

OUTPUTS

+
  hdferr    - Error code
+               Success:  0
+               Failure: -1
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  March 21, 2008
+
+

SOURCE

+
  SUBROUTINE h5pset_local_heap_size_hint_f(gcpl_id, size_hint, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: gcpl_id    ! Group creation property list identifier
+    INTEGER(SIZE_T), INTENT(IN) :: size_hint ! Hint for size of local heap
+    INTEGER, INTENT(OUT) :: hdferr           ! Error code
+                                             ! 0 on success and -1 on failure
+
+ +
+ +

H5Pset_nbit_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  H5Pset_nbit_f 
+
+

PURPOSE

+
  Sets up the use of the N-Bit filter.
+
+

INPUTS

+
  plist_id - Dataset creation property list identifier.
+
+

OUTPUTS

+
  hdferr   - Error code
+              Success:  0
+              Failure: -1
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  March 21, 2008
+
+

HISTORY

+

SOURCE

+
  SUBROUTINE h5pset_nbit_f(plist_id, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: plist_id ! Dataset creation property list identifier
+    INTEGER, INTENT(OUT) :: hdferr         ! Error code
+                                           ! 0 on success and -1 on failure
+
+ +
+ +

h5pset_nlinks_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  h5pset_nlinks_f 
+
+

PURPOSE

+
  Sets maximum number of soft or user-defined link traversals.
+
+

INPUTS

+
  lapl_id - File access property list identifier
+   nlinks - Maximum number of links to traverse
+
+

OUTPUTS

+
  hdferr  - Error code
+             Success:  0
+             Failure: -1
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  March 24, 2008
+
+

HISTORY

+

SOURCE

+
  SUBROUTINE h5pset_nlinks_f(lapl_id, nlinks, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: lapl_id ! File access property list identifier
+    INTEGER(SIZE_T), INTENT(IN) :: nlinks ! Maximum number of links to traverse
+    INTEGER, INTENT(OUT) :: hdferr        ! Error code   
+                                          ! 0 on success and -1 on failure
+
+ +
+ +

H5Pset_obj_track_times_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  H5Pset_obj_track_times_f 
+
+

PURPOSE

+
  Set whether the birth, access, modification & change times for
+  an object are stored.
+
+  Birth time is the time the object was created.  Access time is
+  the last time that metadata or raw data was read from this
+  object.  Modification time is the last time the data for
+  this object was changed (either writing raw data to a dataset
+  or inserting/modifying/deleting a link in a group).  Change
+  time is the last time the metadata for this object was written
+  (adding/modifying/deleting an attribute on an object, extending
+  the size of a dataset, etc).
+
+   If these times are not tracked, they will be reported as
+   12:00 AM UDT, Jan. 1, 1970 (i.e. 0 seconds past the UNIX
+   epoch) when queried.
+
+

INPUTS

+
  plist_id     - property list id
+  flag         - object timestamp setting
+                 .TRUE.,.FALSE.
+
+

OUTPUTS

+
  hdferr       - error code            
+                  Success:  0
+                  Failure: -1   
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  February 22, 2008
+       
+
+

SOURCE

+
  SUBROUTINE h5pset_obj_track_times_f(plist_id, flag, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: plist_id ! Dataset creation property
+                                           ! list identifier
+    LOGICAL, INTENT(IN) :: flag    ! Object timestamp setting
+    INTEGER, INTENT(OUT) :: hdferr ! Error code
+                                   ! 0 on success and -1 on failure
+
+ +
+ +

h5pset_preserve_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
   h5pset_preserve_f 
+
+

PURPOSE

+
  Sets the dataset transfer property list status to 
+  TRUE or FALSE for initializing compound datatype
+  members during write/read operations.
+
+

INPUTS

+
  prp_id       - property list identifier
+  flag         - status flag
+
+

OUTPUTS

+
  hdferr       - Returns 0 if successful and -1 if fails
+
+

OPTIONAL PARAMETERS

+
  NONE
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999      
+
+

HISTORY

+
  Explicit Fortran interfaces were added for 
+  called C functions (it is needed for Windows
+  port).  March 14, 2001 
+                       
+  Datatype of the flag parameter is changed from 
+  INTEGER to LOGICAL June 4, 2003
+
+

SOURCE

+
  SUBROUTINE h5pset_preserve_f(prp_id, flag, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier 
+    LOGICAL, INTENT(IN) ::  flag         ! TRUE/FALSE flag to set the dataset
+                                         ! transfer property for partila writing/reading
+                                         ! compound datatype
+    INTEGER, INTENT(OUT) :: hdferr       ! Error code
+                                         ! 0 on success and -1 on failure
+
+ +
+ +

h5pset_scaleoffset_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  h5pset_scaleoffset_f 
+
+

PURPOSE

+
  Sets up the use of the Scale-Offset filter.
+
+

INPUTS

+
  plist_id     - Dataset creation property list identifier.
+  scale_type   - Flag indicating compression method.
+  scale_factor - Parameter related to scale.
+
+

OUTPUTS

+
  hdferr        - Error code
+                   Success:  0
+                   Failure: -1
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  March 21, 2008
+
+

HISTORY

+

SOURCE

+
  SUBROUTINE h5pset_scaleoffset_f(plist_id, scale_type, scale_factor, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: plist_id ! Dataset creation property list identifier
+    INTEGER, INTENT(IN) :: scale_type      ! Flag indicating compression method.
+    INTEGER, INTENT(IN) :: scale_factor    ! Parameter related to scale.
+    INTEGER, INTENT(OUT) :: hdferr         ! Error code
+                                           ! 0 on success and -1 on failure
+
+ +
+ +

H5Pset_shared_mesg_index_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  H5Pset_shared_mesg_index_f
+
+

PURPOSE

+
  Configures the specified shared object header message index
+
+

INPUTS

+
  fcpl_id         - File creation property list identifier.
+  index_num       - Index being configured.
+  mesg_type_flags - Types of messages that should be stored in this index.
+  min_mesg_size   - Minimum message size.
+
+

OUTPUTS

+
  hdferr  - error code         
+             Success:  0
+             Failure: -1   
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  January, 2008
+
+

SOURCE

+
  SUBROUTINE h5pset_shared_mesg_index_f(fcpl_id, index_num, mesg_type_flags, min_mesg_size, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: fcpl_id  ! file creation property list
+    INTEGER, INTENT(IN) :: index_num       ! Index being configured.
+    INTEGER, INTENT(IN) :: mesg_type_flags ! Types of messages that should be stored in this index.
+    INTEGER, INTENT(IN) :: min_mesg_size   ! Minimum message size.
+    INTEGER, INTENT(OUT) :: hdferr         ! Error code
+                                           ! 0 on success and -1 on failure
+
+ +
+ +

H5Pset_shared_mesg_nindexes_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  H5Pset_shared_mesg_nindexes_f 
+
+

PURPOSE

+
  Sets number of shared object header message indexes 
+
+

INPUTS

+
  plist_id - file creation property list
+  nindexes - Number of shared object header message indexes to be available in files created with this property list
+
+

OUTPUTS

+
  hdferr  - error code         
+             Success:  0
+             Failure: -1   
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  January, 2008
+
+

SOURCE

+
  SUBROUTINE h5pset_shared_mesg_nindexes_f( plist_id, nindexes, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: plist_id ! File creation property list
+    INTEGER, INTENT(IN) :: nindexes  ! Number of shared object header message indexes 
+                                     !  available in files created WITH this property list
+    INTEGER, INTENT(OUT) :: hdferr   ! Error code
+                                     ! 0 on success and -1 on failure
+
+ +
+ +

h5pset_shuffle_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  h5pset_shuffle_f 
+
+

PURPOSE

+
  Sets shuffling filter
+
+

INPUTS

+
  prp_id       - dataset creation property list identifier
+
+

OUTPUTS

+
  hdferr       - error code            
+                  Success:  0
+                  Failure: -1   
+
+

AUTHOR

+
  Elena Pourmal
+  March 12, 2003
+
+

SOURCE

+
  SUBROUTINE h5pset_shuffle_f(prp_id, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier 
+    INTEGER, INTENT(OUT) :: hdferr       ! Error code
+                                         ! 0 on success and -1 on failure
+
+ +
+ +

h5pset_sieve_buf_size_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  h5pset_sieve_buf_size_f 
+
+

PURPOSE

+
  Sets the maximum size of the data sieve buffer
+
+

INPUTS

+
  plist_id     - file access property list identifier
+  size         - sieve buffer size
+
+

OUTPUTS

+
  hdferr       - error code            
+                  Success:  0
+                  Failure: -1
+
+

AUTHOR

+
  Elena Pourmal
+  October 7, 2002      
+
+

SOURCE

+
  SUBROUTINE h5pset_sieve_buf_size_f(plist_id, size, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: plist_id ! File access property list identifier 
+    INTEGER(SIZE_T), INTENT(IN) :: size    ! Buffer size in bytes; 
+    INTEGER, INTENT(OUT) :: hdferr         ! Error code
+                                           ! 0 on success and -1 on failure
+
+ +
+ +

h5pset_sizes_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  h5pset_sizes_f 
+
+

PURPOSE

+
  Sets the byte size of the offsets and lengths used 
+  to address objects in an HDF5 file.
+
+

INPUTS

+
  prp_id       - file creation property list identifier
+  sizeof_addr  - size of an object offset in bytes 
+  sizeof_size  - size of an object length in bytes
+
+

OUTPUTS

+
  hdferr       - error code            
+                  Success:  0
+                  Failure: -1   
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999      
+
+

HISTORY

+
  Explicit Fortran interfaces were added for 
+  called C functions (it is needed for Windows
+  port).  March 14, 2001 
+               
+
+

SOURCE

+
  SUBROUTINE h5pset_sizes_f (prp_id, sizeof_addr, sizeof_size, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id       ! Property list identifier 
+    INTEGER(SIZE_T), INTENT(IN) :: sizeof_addr ! Size of an object 
+                                               !  offset in bytes 
+    INTEGER(SIZE_T), INTENT(IN) :: sizeof_size ! Size of an object 
+                                               !  length in bytes 
+    INTEGER, INTENT(OUT) :: hdferr             ! Error code
+                                               ! 0 on success and -1 on failure
+
+ +
+ +

h5pset_small_data_block_size_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  h5pset_small_data_block_size_f 
+
+

PURPOSE

+
  Sets the minimum size of "small" raw data block
+
+

INPUTS

+
  plist_id     - file access property list identifier
+  size         - small raw data block size
+
+

OUTPUTS

+
  hdferr       - error code            
+                  Success:  0
+                  Failure: -1
+
+

AUTHOR

+
  Elena Pourmal
+  October 7, 2002      
+
+

SOURCE

+
  SUBROUTINE h5pset_small_data_block_size_f(plist_id, size, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: plist_id ! File access property list identifier 
+    INTEGER(HSIZE_T), INTENT(IN) :: size   ! Small raw data block size
+    INTEGER, INTENT(OUT) :: hdferr         ! Error code
+                                           ! 0 on success and -1 on failure
+
+ +
+ +

h5pset_sym_k_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  h5pset_sym_k_f 
+
+

PURPOSE

+
  Sets the size of parameters used to control the 
+
+

INPUTS

+
  prp_id  - file creation property list identifier
+  ik      - symbol table tree rank
+  lk      - symbol table node size
+
+

OUTPUTS

+
  hdferr  - error code         
+             Success:  0
+             Failure: -1   
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999      
+
+

HISTORY

+
  Explicit Fortran interfaces were added for 
+  called C functions (it is needed for Windows
+  port).  March 14, 2001 
+               
+
+

SOURCE

+
  SUBROUTINE h5pset_sym_k_f (prp_id, ik, lk, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier 
+    INTEGER, INTENT(IN) :: ik            ! Symbol table tree rank 
+    INTEGER, INTENT(IN) :: lk            ! Symbol table node size 
+    INTEGER, INTENT(OUT) :: hdferr       ! Error code
+                                         ! 0 on success and -1 on failure
+
+ +
+ +

h5pset_szip_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  h5pset_szip_f 
+
+

PURPOSE

+
  Sets up use of szip compression
+
+

INPUTS

+
  prp_id           - dataset creation property list identifier
+  options_mask     - A bit-mask conveying the desired SZIP options.
+                     Current valid values in Fortran are:
+                        H5_SZIP_EC_OM_F
+                        H5_SZIP_NN_OM_F
+  pixels_per_block - szip parameters
+
+

OUTPUTS

+
  hdferr           - error code                
+                       Success:  0
+                       Failure: -1   
+
+

AUTHOR

+
  Elena Pourmal
+  April 10 2003
+
+

SOURCE

+
  SUBROUTINE h5pset_szip_f(prp_id, options_mask, pixels_per_block, hdferr) 
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id ! Dataset creation property 
+                                         ! list identifier 
+    INTEGER, INTENT(IN) :: options_mask  ! A bit-mask conveying the desired
+                                         ! SZIP options
+                                         ! Current valid values in Fortran are:
+                                         !    H5_SZIP_EC_OM_F
+                                         !    H5_SZIP_NN_OM_F
+    INTEGER, INTENT(IN) :: pixels_per_block ! The number of pixels or data elements 
+                                            ! in each data block
+    INTEGER, INTENT(OUT) :: hdferr       ! Error code
+                                         ! 0 on success and -1 on failure
+
+ +
+ +

h5pset_userblock_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  h5pset_userblock_f 
+
+

PURPOSE

+
   Sets user block size
+
+

INPUTS

+
   prp_id - file creation property list to modify
+   size   - size of the user-block in bytes
+
+

OUTPUTS

+
  hdferr  - error code         
+             Success:  0
+             Failure: -1   
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999      
+
+

HISTORY

+
  Explicit Fortran interfaces were added for 
+  called C functions (it is needed for Windows
+  port).  March 14, 2001 
+
+

SOURCE

+
  SUBROUTINE h5pset_userblock_f (prp_id, size, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier 
+    INTEGER(HSIZE_T), INTENT(IN) :: size ! Size of the user-block in bytes 
+    INTEGER, INTENT(OUT) :: hdferr       ! Error code
+                                         ! 0 on success and -1 on failure
+
+ +
+ +

h5punregister_f

+ +

[ Top ] [ Subroutines ]

+

NAME

+
  h5punregister_f 
+
+

PURPOSE

+
  Removes a property from a property list class. 
+
+

INPUTS

+
  class        - Property list class identifier
+  name         - name of the property to remove
+
+

OUTPUTS

+
  hdferr:      - error code
+                  Success: 0 
+                  Failure: -1   
+
+

AUTHOR

+
  Elena Pourmal
+  October 9, 2002      
+
+

SOURCE

+
  SUBROUTINE h5punregister_f(class, name, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: class  ! property list class identifier
+    CHARACTER(LEN=*), INTENT(IN) :: name ! name of property to remove
+    INTEGER, INTENT(OUT) :: hdferr       ! Error code
+                                         ! 0 on success and -1 on failure
+
+ +
+ + + diff --git a/fortran/doc/DevelGuide/src/H5Rf_c.html b/fortran/doc/DevelGuide/src/H5Rf_c.html new file mode 100644 index 0000000..bba197e --- /dev/null +++ b/fortran/doc/DevelGuide/src/H5Rf_c.html @@ -0,0 +1,41 @@ + + + + + + + +./src/H5Rf.c + + + + + +
+
+ +

H5Rf

+ +

[ Top ] [ Modules ]

+

PURPOSE

+
   This file contains C stubs for H5R Fortran APIs
+
+ +
+ + + diff --git a/fortran/doc/DevelGuide/src/H5Rff_F03_f90.html b/fortran/doc/DevelGuide/src/H5Rff_F03_f90.html new file mode 100644 index 0000000..3202540 --- /dev/null +++ b/fortran/doc/DevelGuide/src/H5Rff_F03_f90.html @@ -0,0 +1,492 @@ + + + + + + + +./src/H5Rff_F03.f90 + + + + + +
+
+ +

H5R (F03)

+ +

[ Top ] [ Modules ]

+

NAME

+
  MODULE H5R_PROVISIONAL
+
+

FILE

+
  fortran/src/H5Rff_F03.f90
+
+

PURPOSE

+
  This file contains Fortran 90 and Fortran 2003 interfaces for H5R functions.
+  It contains the same functions as H5Rff_DEPRECIATE.f90 but includes the
+  Fortran 2003 functions and the interface listings. This file will be compiled
+  instead of H5Rff_DEPRECIATE.f90 if Fortran 2003 functions are enabled.
+
+

NOTES

+
                         *** IMPORTANT ***
+  If you add a new H5R function you must add the function name to the
+  Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory.
+  This is needed for Windows based operating systems.
+
+ +
+ +

h5rcreate_object_f

+ +

[ Top ] [ H5R (F03) ] [ Subroutines ]

+

NAME

+
  h5rcreate_object_f
+
+

PURPOSE

+
  Creates reference to the object
+
+

INPUTS

+
  loc_id    - location identifier
+  name      - name of the object at the specified location
+
+

OUTPUTS

+
  ref       - reference to the specified object
+  hdferr:   - error code
+               Success:  0
+               Failure: -1
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  February 28, 2001
+
+

NOTES

+
  This is a module procedure for the h5rcreate_f subroutine.
+
+

SOURCE

+
  SUBROUTINE h5rcreate_object_f(loc_id, name, ref, hdferr)
+    USE, INTRINSIC :: ISO_C_BINDING
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: loc_id   ! Location identifier
+    CHARACTER(LEN=*), INTENT(IN) :: name   ! Name of the object at location specified
+                                           ! by loc_id identifier
+    TYPE(hobj_ref_t_f), INTENT(INOUT), TARGET :: ref   ! Object reference
+    INTEGER, INTENT(OUT) :: hdferr         ! Error code
+
+ +
+ +

h5rcreate_ptr_f

+ +

[ Top ] [ H5R (F03) ] [ Subroutines ]

+

NAME

+
  h5rcreate_ptr_f
+
+

PURPOSE

+
  Creates a reference.
+
+

INPUTS

+
  loc_id     - location identifier
+  name       - name of the dataset at the specified location
+  ref_type   - type of reference:
+                H5R_OBJECT
+                H5T_STD_REF_DSETREG
+
+

OUTPUTS

+
  ref        - reference created by the function call.
+  hdferr     - error code
+                  Success:  0
+                  Failure: -1
+ OPTIONAL
+  space_id   - dataspace identifier that describes selected region
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  June 20, 2008
+
+

NOTES

+
  This is a module procedure for the h5rcreate_f
+  subroutine where the output is a pointer.
+
+

SOURCE

+
  SUBROUTINE h5rcreate_ptr_f(loc_id, name, ref_type, ref, hdferr, space_id)
+    USE, INTRINSIC :: ISO_C_BINDING
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: loc_id     ! Location identifier
+    CHARACTER(LEN=*), INTENT(IN) :: name     ! Name of the dataset at location specified
+                                             ! by loc_id identifier
+    INTEGER, INTENT(IN) :: ref_type          ! type of reference
+    TYPE(C_PTR), INTENT(INOUT) :: ref        ! Reference created by the function call
+    INTEGER, INTENT(OUT) :: hdferr           ! Error code
+    INTEGER(HID_T), INTENT(IN), OPTIONAL :: space_id ! Dataset's dataspace identifier
+
+ +
+ +

h5rcreate_region_f

+ +

[ Top ] [ H5R (F03) ] [ Subroutines ]

+

NAME

+
  h5rcreate_region_f
+
+

PURPOSE

+
  Creates reference to the dataset region
+
+

INPUTS

+
  loc_id        - location identifier
+  name          - name of the dataset at the specified location
+  space_id      - dataspace identifier that describes selected region
+
+

OUTPUTS

+
  ref           - reference to the dataset region
+  hdferr:       - error code
+                   Success:  0
+                   Failure: -1
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  February 28, 2001
+
+

NOTES

+
  This is a module procedure for the h5rcreate_f subroutine.
+
+

SOURCE

+
  SUBROUTINE h5rcreate_region_f(loc_id, name, space_id, ref, hdferr)
+    USE, INTRINSIC :: ISO_C_BINDING
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: loc_id   ! Location identifier
+    CHARACTER(LEN=*), INTENT(IN) :: name   ! Name of the dataset at location specified
+                                           ! by loc_id identifier
+    INTEGER(HID_T), INTENT(IN) :: space_id ! Dataset's dataspace identifier
+    TYPE(hdset_reg_ref_t_f), INTENT(INOUT), TARGET :: ref ! Dataset region reference
+    INTEGER, INTENT(OUT) :: hdferr         ! Error code
+
+ +
+ +

h5rdereference_object_f

+ +

[ Top ] [ H5R (F03) ] [ Subroutines ]

+

NAME

+
  h5rdereference_object_f
+
+

PURPOSE

+
  Opens the HDF5 object referenced
+
+

INPUTS

+
  dset_id  - identifier of the dataset containing
+             reference
+  ref      - reference to open
+
+

OUTPUTS

+
  obj_id   - object_identifier
+  hdferr:  - error code
+              Success:  0
+              Failure: -1
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  February 28, 2001
+
+

NOTES

+
  This is a module procedure for the h5rdereference_f subroutine.
+
+

SOURCE

+
  SUBROUTINE h5rdereference_object_f(obj_id, ref, ref_obj_id, hdferr)
+    USE, INTRINSIC :: ISO_C_BINDING
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: obj_id          ! Dataset identifier
+    TYPE(hobj_ref_t_f), INTENT(IN), TARGET :: ref ! Object reference
+    INTEGER(HID_T), INTENT(OUT) :: ref_obj_id     ! Object identifier
+    INTEGER, INTENT(OUT) :: hdferr                ! Error code
+
+ +
+ +

h5rdereference_ptr_f

+ +

[ Top ] [ H5R (F03) ] [ Subroutines ]

+

NAME

+
  h5rdereference_ptr_f
+
+

PURPOSE

+
  Opens the HDF5 object referenced.
+
+

INPUTS

+
  obj_id     - valid identifier for the file containing the
+               referenced object or any object in that file.
+  ref_type   - the reference type of ref.
+  ref        - Reference to open.
+
+

OUTPUTS

+
  ref_obj_id - identifier of referenced object
+  hdferr     - error code
+                Success:  0
+                Failure: -1
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  June 20, 2008
+
+

NOTES

+
  This is a module procedure for the h5rdereference_f
+  subroutine using pointers.
+
+

SOURCE

+
  SUBROUTINE h5rdereference_ptr_f(obj_id, ref_type, ref, ref_obj_id, hdferr)
+    USE, INTRINSIC :: ISO_C_BINDING
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: obj_id  ! Valid identifier for the file containing the
+                                          !  referenced object or any object in that file.
+    INTEGER, INTENT(IN) :: ref_type       ! The reference type of ref.
+    TYPE(C_PTR), INTENT(IN) :: ref        ! Object reference
+    INTEGER(HID_T), INTENT(OUT) :: ref_obj_id
+                                          ! Identifier of referenced object
+    INTEGER, INTENT(OUT) :: hdferr        ! Error code
+
+ +
+ +

h5rdereference_region_f

+ +

[ Top ] [ H5R (F03) ] [ Subroutines ]

+

NAME

+
  h5rdereference_region_f
+
+

PURPOSE

+
  Opens the dataset region
+
+

INPUTS

+
  dset_id       - identifier of the dataset containing
+                  reference to teh regions
+  ref           - reference to open
+
+

OUTPUTS

+
  obj_id        - dataspace identifier
+  hdferr:       - error code
+                   Success:  0
+                   Failure: -1
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  February 28, 2001
+
+

NOTES

+
  This is a module procedure for the h5rdereference_f subroutine.
+
+

SOURCE

+
  SUBROUTINE h5rdereference_region_f(obj_id, ref, ref_obj_id, hdferr)
+    USE, INTRINSIC :: ISO_C_BINDING
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: obj_id   ! Dataset identifier
+    TYPE(hdset_reg_ref_t_f), INTENT(IN), TARGET :: ref   ! Object reference
+    INTEGER(HID_T), INTENT(OUT) :: ref_obj_id  ! Dataspace identifier
+    INTEGER, INTENT(OUT) :: hdferr          ! Error code
+
+ +
+ +

h5rget_name_object_f

+ +

[ Top ] [ H5R (F03) ] [ Subroutines ]

+

NAME

+
  h5rget_name_object_f
+
+

PURPOSE

+
  Retrieves a name of a referenced object.
+
+

INPUTS

+
  loc_id    - Identifier for the dataset containing the reference or for the group that dataset is in.
+  ref       - An object or dataset region reference.
+
+

OUTPUTS

+
  name      - A name associated with the referenced object or dataset region.
+
+  hdferr:   - error code
+               Success:  0
+               Failure: -1
+
+

OPTIONAL PARAMETERS

+
  size     - The size of the name buffer.
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  March 28, 2008
+
+ SOURCES
+ or for the group that dataset is in.
+ returning 0 (zero) if no name is associated
+ with the identifier
+
+ +
+ +

h5rget_name_ptr_f

+ +

[ Top ] [ H5R (F03) ] [ Subroutines ]

+

NAME

+
  h5rget_name_ptr_f
+
+

PURPOSE

+
  Retrieves a name of a referenced object.
+
+

INPUTS

+
  loc_id   - Identifier for the dataset containing the reference or
+             for the group that dataset is in.
+  ref_type - Type of reference.
+  ref      - An object or dataset region reference.
+
+

OUTPUTS

+
  name     - A name associated with the referenced object or dataset ptr.
+
+  hdferr   - error code
+               Success:  0
+               Failure: -1
+
+

OPTIONAL PARAMETERS

+
   size   - The size of the name buffer.
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  March 28, 2008
+
+

SOURCE

+
  SUBROUTINE h5rget_name_ptr_f(loc_id, ref_type, ref, name, hdferr, size)
+    USE, INTRINSIC :: ISO_C_BINDING
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: loc_id   ! Identifier for the dataset containing the reference
+                                           !  or for the group that dataset is in.
+    INTEGER, INTENT(IN) :: ref_type ! Type of reference.
+    TYPE(C_PTR), INTENT(IN) :: ref  ! An object or dataset region reference.
+    CHARACTER(LEN=*), INTENT(OUT) :: name  ! A name associated with the referenced object or dataset ptr.
+    INTEGER, INTENT(OUT) :: hdferr         ! Error code
+    INTEGER(SIZE_T), OPTIONAL, INTENT(OUT) :: size   ! The size of the name buffer,
+                                                     ! returning 0 (zero) if no name is associated
+                                                     ! with the identifier
+
+ +
+ +

h5rget_name_region_f

+ +

[ Top ] [ H5R (F03) ] [ Subroutines ]

+

NAME

+
  h5rget_name_region_f
+
+

PURPOSE

+
  Retrieves a name of a dataset region.
+
+

INPUTS

+
  loc_id  - Identifier for the dataset containing the reference or
+            for the group that dataset is in.
+  ref     - An object or dataset region reference.
+
+

OUTPUTS

+
  name    - A name associated with the referenced object or dataset region.
+  hdferr  - error code
+              Success:  0
+              Failure: -1
+
+

OPTIONAL PARAMETERS

+
  size    - The size of the name buffer.
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  March 28, 2008
+
+

SOURCE

+
  SUBROUTINE h5rget_name_region_f(loc_id, ref, name, hdferr, size)
+    USE, INTRINSIC :: ISO_C_BINDING
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: loc_id   ! Identifier for the dataset containing the reference
+                                           ! or for the group that dataset is in.
+    TYPE(hdset_reg_ref_t_f), INTENT(IN), TARGET :: ref ! Object reference
+    INTEGER(SIZE_T), OPTIONAL, INTENT(OUT) :: size     ! The size of the name buffer,
+                                                       ! returning 0 (zero) if no name is associated with the identifier
+    CHARACTER(LEN=*), INTENT(OUT) :: name  ! A name associated with the referenced object or dataset region.
+    INTEGER, INTENT(OUT) :: hdferr         ! Error code
+
+ +
+ +

h5rget_obj_type_f

+ +

[ Top ] [ H5R (F03) ] [ Subroutines ]

+

NAME

+
  h5rget_obj_type_f
+
+

PURPOSE

+
  Retrieves the type of object that an object reference points to.
+
+

INPUTS

+
  loc_id   - Identifier for the dataset containing the reference or
+             for the group that dataset is in.
+  ref_type - Type of reference to query.
+  ref      - Reference to query.
+
+

OUTPUTS

+
  obj_type - Type of referenced object. 
+               H5G_UNKNOWN_F (-1)
+               H5G_LINK_F      0
+               H5G_GROUP_F     1
+               H5G_DATASET_F   2
+               H5G_TYPE_F      3
+              
+  hdferr   - error code
+               Success:  0
+               Failure: -1
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  Decemeber 17, 2008
+
+

SOURCE

+
  SUBROUTINE h5rget_obj_type_f(loc_id, ref_type, ref, obj_type, hdferr)
+    USE, INTRINSIC :: ISO_C_BINDING
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: loc_id
+    INTEGER, INTENT(IN) :: ref_type
+    TYPE(C_PTR), INTENT(IN) :: ref
+    INTEGER, INTENT(OUT) :: obj_type
+    INTEGER, INTENT(OUT) :: hdferr
+
+ +
+ + + diff --git a/fortran/doc/DevelGuide/src/H5Rff_F90_f90.html b/fortran/doc/DevelGuide/src/H5Rff_F90_f90.html new file mode 100644 index 0000000..7d20d0c --- /dev/null +++ b/fortran/doc/DevelGuide/src/H5Rff_F90_f90.html @@ -0,0 +1,305 @@ + + + + + + + +./src/H5Rff_F90.f90 + + + + + +
+
+ +

H5R (F90)

+ +

[ Top ] [ Modules ]

+

NAME

+
  MODULE H5R_PROVISIONAL
+
+

FILE

+
  fortran/src/H5Rff_F90.f90
+
+

PURPOSE

+
  This file contains Fortran 90 interfaces for H5R functions. It contains
+  the same functions as H5Rff_F03.f90 but excludes the Fortran 2003 functions
+  and the interface listings. This file will be compiled instead of H5Rff_F03.f90
+  if Fortran 2003 functions are not enabled.
+
+

NOTES

+
                         *** IMPORTANT ***
+  If you add a new H5R function you must add the function name to the
+  Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory.
+  This is needed for Windows based operating systems.
+
+ +
+ +

h5rcreate_object_f

+ +

[ Top ] [ H5R (F90) ] [ Subroutines ]

+

NAME

+
  h5rcreate_object_f
+
+

PURPOSE

+
  Creates reference to the object
+
+

INPUTS

+
  loc_id        - location identifier
+  name          - name of the object at the specified location
+
+

OUTPUTS

+
  ref           - reference to the specified object
+  hdferr:       - error code
+                   Success:  0
+                   Failure: -1
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  February 28, 2001
+
+

NOTES

+
  This is a module procedure for the h5rcreate_f subroutine.
+
+

SOURCE

+
  SUBROUTINE h5rcreate_object_f(loc_id, name, ref, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: loc_id   ! Location identifier
+    CHARACTER(LEN=*), INTENT(IN) :: name   ! Name of the object at location specified
+                                           ! by loc_id identifier
+    TYPE(hobj_ref_t_f), INTENT(OUT) :: ref ! Object reference
+    INTEGER, INTENT(OUT) :: hdferr         ! Error code
+
+ +
+ +

h5rcreate_region_f

+ +

[ Top ] [ H5R (F90) ] [ Subroutines ]

+

NAME

+
  h5rcreate_region_f
+
+

PURPOSE

+
  Creates reference to the dataset region
+
+

INPUTS

+
  loc_id        - location identifier
+  name          - name of the dataset at the specified location
+  space_id      - dataspace identifier that describes selected region
+
+

OUTPUTS

+
  ref           - reference to the dataset region
+  hdferr:       - error code
+                   Success:  0
+                   Failure: -1
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  February 28, 2001
+
+

NOTES

+
  This is a module procedure for the h5rcreate_f subroutine.
+
+

SOURCE

+
  SUBROUTINE h5rcreate_region_f(loc_id, name, space_id, ref, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: loc_id   ! Location identifier
+    CHARACTER(LEN=*), INTENT(IN) :: name   ! Name of the dataset at location specified
+                                           ! by loc_id identifier
+    INTEGER(HID_T), INTENT(IN) :: space_id ! Dataset's dataspace identifier
+    TYPE(hdset_reg_ref_t_f), INTENT(OUT) :: ref ! Dataset region reference
+    INTEGER, INTENT(OUT) :: hdferr         ! Error code
+
+ +
+ +

h5rdereference_object_f

+ +

[ Top ] [ H5R (F90) ] [ Subroutines ]

+

NAME

+
  h5rdereference_object_f
+
+

PURPOSE

+
  Opens the HDF5 object referenced
+
+

INPUTS

+
  dset_id  - identifier of the dataset containing reference
+  ref      - reference to open
+
+

OUTPUTS

+
  obj_id   - object_identifier
+  hdferr   - error code
+              Success:  0
+              Failure: -1
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  February 28, 2001
+
+

NOTES

+
  This is a module procedure for the h5rdereference_f subroutine.
+
+

SOURCE

+
  SUBROUTINE h5rdereference_object_f(dset_id, ref, obj_id, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: dset_id   ! Dataset identifier
+    TYPE(hobj_ref_t_f), INTENT(IN) :: ref   ! Object reference
+    INTEGER(HID_T), INTENT(OUT) :: obj_id   ! Object identifier
+    INTEGER, INTENT(OUT) :: hdferr          ! Error code
+
+ +
+ +

h5rdereference_region_f

+ +

[ Top ] [ H5R (F90) ] [ Subroutines ]

+

NAME

+
  h5rdereference_region_f
+
+

PURPOSE

+
  Opens the dataset region
+
+

INPUTS

+
  dset_id       - identifier of the dataset containing
+                  reference to teh regions
+  ref           - reference to open
+
+

OUTPUTS

+
  obj_id        - dataspace identifier
+  hdferr        - error code
+                   Success:  0
+                   Failure: -1
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  February 28, 2001
+
+

NOTES

+
  This is a module procedure for the h5rdereference_f subroutine.
+
+

SOURCE

+
  SUBROUTINE h5rdereference_region_f(dset_id, ref, obj_id, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: dset_id      ! Dataset identifier
+    TYPE(hdset_reg_ref_t_f), INTENT(IN) :: ref ! Object reference
+    INTEGER(HID_T), INTENT(OUT) :: obj_id   ! Dataspace identifier
+    INTEGER, INTENT(OUT) :: hdferr          ! Error code
+
+ +
+ +

h5rget_name_object_f

+ +

[ Top ] [ H5R (F90) ] [ Subroutines ]

+

NAME

+
  h5rget_name_object_f
+
+

PURPOSE

+
  Retrieves a name of a referenced object.
+
+

INPUTS

+
  loc_id  - Identifier for the dataset containing the reference or for the group that dataset is in.
+  ref     - An object or dataset region reference.
+
+

OUTPUTS

+
  name    - A name associated with the referenced object or dataset region.
+
+  hdferr  - error code
+             Success:  0
+             Failure: -1
+
+

OPTIONAL PARAMETERS

+
  size    - The size of the name buffer.
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  March 28, 2008
+
+ SOURCES
+ or for the group that dataset is in.
+ returning 0 (zero) if no name is associated with the identifier
+
+ +
+ +

h5rget_name_region_f

+ +

[ Top ] [ H5R (F90) ] [ Subroutines ]

+

NAME

+
  h5rget_name_region_f
+
+

PURPOSE

+
  Retrieves a name of a dataset region.
+
+

INPUTS

+
  loc_id        - Identifier for the dataset containing the reference or
+                  for the group that dataset is in.
+  ref           - An object or dataset region reference.
+
+

OUTPUTS

+
  name          - A name associated with the referenced object or dataset region.
+  hdferr        - error code
+                   Success:  0
+                   Failure: -1
+
+

OPTIONAL PARAMETERS

+
  size          - The size of the name buffer.
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  March 28, 2008
+
+

SOURCE

+
  SUBROUTINE h5rget_name_region_f(loc_id, ref, name, hdferr, size)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: loc_id   ! Identifier for the dataset containing the reference
+                                           ! or for the group that dataset is in.
+    TYPE(hdset_reg_ref_t_f), INTENT(IN) :: ref       ! Object reference
+    INTEGER(SIZE_T), OPTIONAL, INTENT(OUT) :: size   ! The size of the name buffer,
+                                                     ! returning 0 (zero) if no name is associated 
+                                                     ! with the identifier
+    CHARACTER(LEN=*), INTENT(OUT) :: name  ! A name associated with the referenced object or dataset region.
+    INTEGER, INTENT(OUT) :: hdferr         ! Error code
+
+ +
+ + + diff --git a/fortran/doc/DevelGuide/src/H5Rff_f90.html b/fortran/doc/DevelGuide/src/H5Rff_f90.html new file mode 100644 index 0000000..2b60b08 --- /dev/null +++ b/fortran/doc/DevelGuide/src/H5Rff_f90.html @@ -0,0 +1,148 @@ + + + + + + + +./src/H5Rff.f90 + + + + + +
+
+ +

H5R

+ +

[ Top ] [ Modules ]

+

NAME

+
  MODULE H5R
+
+

FILE

+
  fortran/src/H5Rff.f90
+
+

PURPOSE

+
  This file contains Fortran interfaces for H5R functions. It includes
+  all the functions that are independent on whether the Fortran 2003 functions
+  are enabled or disabled.
+
+

NOTES

+
                         *** IMPORTANT ***
+  If you add a new H5R function you must add the function name to the
+  Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory.
+  This is needed for Windows based operating systems.
+
+ +
+ +

h5rget_object_type_obj_f

+ +

[ Top ] [ H5R ] [ Subroutines ]

+

NAME

+
  h5rget_object_type_obj_f
+
+

PURPOSE

+
  Retrieves the type of object that an object reference points to.
+
+

INPUTS

+
  dset_id       - identifier of the dataset containing
+                  reference to the objects
+  ref           - reference to open
+
+

OUTPUTS

+
  obj_type      - object_type, possible values:
+                    H5G_UNKNOWN_F     (-1)
+                    H5G_GROUP_F        0
+                    H5G_DATASET_F      1
+                    H5G_TYPE_F         2
+                    H5G_LINK_F         3
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  February 28, 2001
+
+

NOTES

+
  This is a module procedure for the h5rget_object_type_f
+  subroutine.
+
+

SOURCE

+
  SUBROUTINE h5rget_object_type_obj_f(dset_id, ref, obj_type, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: dset_id   ! Dataset identifier
+    TYPE(hobj_ref_t_f), INTENT(IN) :: ref   ! Object reference
+    INTEGER, INTENT(OUT) :: obj_type     ! Object type
+                                         !  H5G_UNKNOWN_F     (-1)
+                                         !  H5G_GROUP_F        0
+                                         !  H5G_DATASET_F      1
+                                         !  H5G_TYPE_F         2
+                                         !  H5G_LINK_F         3
+    INTEGER, INTENT(OUT) :: hdferr       ! Error code
+
+ +
+ +

h5rget_region_region_f

+ +

[ Top ] [ H5R ] [ Subroutines ]

+

NAME

+
  h5rget_region_region_f
+
+

PURPOSE

+
  Retrieves a dataspace with the specified region selected
+
+

INPUTS

+
  dset_id       - identifier of the dataset containing
+                  reference to the regions
+  ref           - reference to open
+
+

OUTPUTS

+
  space_id      - dataspace identifier
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  February 28, 2001
+
+

NOTES

+
  This is a module procedure for the h5rget_region_f subroutine.
+
+

SOURCE

+
  SUBROUTINE h5rget_region_region_f(dset_id, ref, space_id, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: dset_id      ! Dataset identifier
+    TYPE(hdset_reg_ref_t_f), INTENT(IN) :: ref ! Dataset region reference
+    INTEGER(HID_T), INTENT(OUT) :: space_id    ! Space identifier
+    INTEGER, INTENT(OUT) :: hdferr             ! Error code
+
+ +
+ + + diff --git a/fortran/doc/DevelGuide/src/H5Sf_c.html b/fortran/doc/DevelGuide/src/H5Sf_c.html new file mode 100644 index 0000000..ebdedf7 --- /dev/null +++ b/fortran/doc/DevelGuide/src/H5Sf_c.html @@ -0,0 +1,41 @@ + + + + + + + +./src/H5Sf.c + + + + + +
+
+ +

H5Sf

+ +

[ Top ] [ Modules ]

+

PURPOSE

+
   This file contains C stubs for H5S Fortran APIs
+
+ +
+ + + diff --git a/fortran/doc/DevelGuide/src/H5Sff_f90.html b/fortran/doc/DevelGuide/src/H5Sff_f90.html new file mode 100644 index 0000000..c26b191 --- /dev/null +++ b/fortran/doc/DevelGuide/src/H5Sff_f90.html @@ -0,0 +1,1165 @@ + + + + + + + +./src/H5Sff.f90 + + + + + +
+
+ +

H5S

+ +

[ Top ] [ Modules ]

+

NAME

+
  MODULE H5S
+
+

FILE

+
  fortran/src/H5Sff.f90
+
+

PURPOSE

+
  This file contains Fortran interfaces for H5S functions. It includes
+  all the functions that are independent on whether the Fortran 2003 functions
+  are enabled or disabled.
+
+

NOTES

+
                         *** IMPORTANT ***
+  If you add a new H5S function you must add the function name to the
+  Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory.
+  This is needed for Windows based operating systems.
+
+ +
+ +

h5sclose_f

+ +

[ Top ] [ H5S ] [ Subroutines ]

+

NAME

+
  h5sclose_f
+
+

PURPOSE

+
  Releases and terminates access to a dataspace.
+
+

INPUTS

+
  space_id    - identifier of dataspace to release
+
+

OUTPUTS

+
  hdferr      - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 6, 2001
+
+

SOURCE

+
          SUBROUTINE h5sclose_f(space_id, hdferr)
+            IMPLICIT NONE
+            INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier
+            INTEGER, INTENT(OUT) :: hdferr         ! Error code
+
+ +
+ +

h5scopy_f

+ +

[ Top ] [ H5S ] [ Subroutines ]

+

NAME

+
  h5scopy_f
+
+

PURPOSE

+
  Creates an exact copy of a dataspace.
+
+

INPUTS

+
  space_id      - dataspace identifier
+
+

OUTPUTS

+
  new_space_id  - identifier of dataspace's copy
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 6, 2001
+
+

NOTES

+

SOURCE

+
          SUBROUTINE h5scopy_f(space_id, new_space_id, hdferr)
+            IMPLICIT NONE
+            INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier
+            INTEGER(HID_T), INTENT(OUT) :: new_space_id
+                                             ! Identifier of dataspace's copy
+            INTEGER, INTENT(OUT) :: hdferr   ! Error code
+
+ +
+ +

h5screate_f

+ +

[ Top ] [ H5S ] [ Subroutines ]

+

NAME

+
  h5screate_f
+
+

PURPOSE

+
  Creates a new dataspace of a specified type.
+
+

INPUTS

+
  classtype   - the type of the dataspace to be created
+
+

OUTPUTS

+
  space_id    - dataspace identifier
+  hdferr      - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 6, 2001
+
+

NOTES

+

SOURCE

+
          SUBROUTINE h5screate_f(classtype, space_id, hdferr)
+            IMPLICIT NONE
+            INTEGER, INTENT(IN) :: classtype     ! The type of the dataspace
+                                                 ! to be created.
+                                                 ! Possible values are:
+                                                 !  H5S_SCALAR_F (0)
+                                                 !  H5S_SIMPLE_F(1)
+                                                 !  H5S_NULL_F(2)
+            INTEGER(HID_T), INTENT(OUT) :: space_id ! Dataspace identifier
+            INTEGER, INTENT(OUT) :: hdferr          ! Error code
+
+ +
+ +

h5screate_simple_f

+ +

[ Top ] [ H5S ] [ Subroutines ]

+

NAME

+
  h5screate_simple_f
+
+

PURPOSE

+
  Creates a new simple data space and opens it for access      .
+
+

INPUTS

+
  rank        - number of dimensions
+  dims        - an array of the size of each dimension
+
+

OUTPUTS

+
  space_id    - dataspace identifier
+  hdferr      - Returns 0 if successful and -1 if fails
+
+

OPTIONAL PARAMETERS

+
  maxdims     - an array of the maximum size of each dimension
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 6, 2001
+
+

SOURCE

+
          SUBROUTINE h5screate_simple_f(rank, dims, space_id, hdferr, maxdims)
+
+            IMPLICIT NONE
+            INTEGER, INTENT(IN) :: rank             ! Number of dataspace dimensions
+            INTEGER(HSIZE_T), INTENT(IN) :: dims(rank)
+                                                    ! Array with the dimension
+                                                    ! sizes
+            INTEGER(HID_T), INTENT(OUT) :: space_id ! Dataspace identifier
+            INTEGER, INTENT(OUT) :: hdferr          ! Error code
+            INTEGER(HSIZE_T), OPTIONAL, INTENT(IN) :: maxdims(rank)
+                                                    ! Array with the maximum
+                                                    ! dimension sizes
+
+ +
+ +

H5Sdecode_f

+ +

[ Top ] [ H5S ] [ Subroutines ]

+

NAME

+
  H5Sdecode_f
+
+

PURPOSE

+
  Decode a binary object description of data space and return a new object handle.
+
+

INPUTS

+
  buf   -  Buffer for the data space object to be decoded.
+  obj_id        - Object ID
+
+

OUTPUTS

+
  hdferr      - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  March 26, 2008
+
+

SOURCE

+
  SUBROUTINE h5sdecode_f(buf, obj_id, hdferr)
+    IMPLICIT NONE
+    CHARACTER(LEN=*), INTENT(IN) :: buf ! Buffer for the data space object to be decoded.
+    INTEGER(HID_T), INTENT(OUT) :: obj_id  ! Object ID
+    INTEGER, INTENT(OUT) :: hdferr     ! Error code
+
+ +
+ +

H5Sencode_f

+ +

[ Top ] [ H5S ] [ Subroutines ]

+

NAME

+
  H5Sencode_f
+
+

PURPOSE

+
  Encode a data space object description into a binary buffer.
+
+

INPUTS

+
  obj_id        - Identifier of the object to be encoded.
+  buf   - Buffer for the object to be encoded into.
+  nalloc        - The size of the allocated buffer.
+
+

OUTPUTS

+
  nalloc        - The size of the buffer needed.
+  hdferr      - Returns 0 if successful and -1 if fails.
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  March 26, 2008
+
+

SOURCE

+
  SUBROUTINE h5sencode_f(obj_id, buf, nalloc, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: obj_id ! Identifier of the object to be encoded.
+    CHARACTER(LEN=*), INTENT(OUT) :: buf ! Buffer for the object to be encoded into.
+    INTEGER(SIZE_T), INTENT(INOUT) :: nalloc ! The size of the allocated buffer.
+    INTEGER, INTENT(OUT) :: hdferr     ! Error code
+
+ +
+ +

h5sextent_copy_f

+ +

[ Top ] [ H5S ] [ Subroutines ]

+

NAME

+
  h5sextent_copy_f
+
+

PURPOSE

+
  Copies the extent of a dataspace.
+
+

INPUTS

+
  dest_space_id         - the identifier for the dataspace to which
+  the extent is copied
+  source_space_id       - the identifier for the dataspace from
+  which the extent is copied
+
+

OUTPUTS

+
  hdferr      - Returns 0 if successful and -1 if fails
+
+

OPTIONAL PARAMETERS

+
  NONE
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 6, 2001
+
+

NOTES

+

SOURCE

+
          SUBROUTINE h5sextent_copy_f(dest_space_id, source_space_id, hdferr)
+            IMPLICIT NONE
+            INTEGER(HID_T), INTENT(IN) :: dest_space_id  ! Identifier of destination
+                                                         ! dataspace
+            INTEGER(HID_T), INTENT(IN) :: source_space_id ! Identifier of source
+                                                          ! dataspace
+            INTEGER, INTENT(OUT) :: hdferr                ! Error code
+
+ +
+ +

h5sextent_equal_f

+ +

[ Top ] [ H5S ] [ Subroutines ]

+

NAME

+
  h5sextent_equal_f
+
+

PURPOSE

+
  Determines whether two dataspace extents are equal.
+
+

INPUTS

+
  space1_id     - First dataspace identifier.
+  space2_id     - Second dataspace identifier.
+
+

OUTPUTS

+
  Equal         - .TRUE. if equal, .FALSE. if unequal.
+  hdferr      - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  April 2, 2008
+
+

SOURCE

+
  SUBROUTINE h5sextent_equal_f(space1_id, space2_id, equal, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: space1_id ! First dataspace identifier.
+    INTEGER(HID_T), INTENT(IN) :: space2_id ! Second dataspace identifier.
+    LOGICAL, INTENT(OUT) :: Equal ! .TRUE. if equal, .FALSE. if unequal.
+    INTEGER, INTENT(OUT) :: hdferr                ! Error code
+
+ +
+ +

h5sget_select_bounds_f

+ +

[ Top ] [ H5S ] [ Subroutines ]

+

NAME

+
  h5sget_select_bounds_f
+
+

PURPOSE

+
  Gets the bounding box containing the current selection.
+
+

INPUTS

+
  space_id    - dataspace identifier
+
+

OUTPUTS

+
  start       - starting coordinates of bounding box
+  end         - ending coordinates of bounding box
+  hdferr      - Returns 0 if successful and -1 if fails
+
+

OPTIONAL PARAMETERS

+
  NONE
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 6, 2001
+
+

SOURCE

+
  SUBROUTINE  h5sget_select_bounds_f(space_id, start, END, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier
+    INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: start
+                                           ! Starting coordinates of the bounding box.
+    INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: END
+                                           !Ending coordinates of the bounding box,
+                                           !i.e., the coordinates of the diagonally
+                                           !opposite corner
+    INTEGER, INTENT(OUT) :: hdferr         ! Error code
+
+ +
+ +

h5sget_select_elem_npoints_f

+ +

[ Top ] [ H5S ] [ Subroutines ]

+

NAME

+
  h5sget_select_elem_npoints_f
+
+

PURPOSE

+
  Gets the number of element points in the current selection
+
+

INPUTS

+
  space_id      - dataspace identifier
+
+

OUTPUTS

+
  num_points    - number of element points in the current
+                  dataspace selection
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 6, 2001
+
+

SOURCE

+
          SUBROUTINE h5sget_select_elem_npoints_f(space_id, num_points, hdferr)
+            IMPLICIT NONE
+            INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier
+            INTEGER(HSSIZE_T), INTENT(OUT) :: num_points
+                                             !number of element points
+                                             !in the current dataspace
+                                             !selection
+            INTEGER, INTENT(OUT) :: hdferr   ! Error code
+
+ +
+ +

h5sget_select_elem_pointlist_f

+ +

[ Top ] [ H5S ] [ Subroutines ]

+

NAME

+
  h5sget_select_elem_pointlist_f
+
+

PURPOSE

+
  Gets the list of element points currently selected.
+
+

INPUTS

+
  space_id    - dataspace identifier
+  startpoint  - element point to start with
+  num_points  - number of elemnt points to get
+
+

OUTPUTS

+
  buf         - buffer with element points selected
+  hdferr      - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 6, 2001
+
+

SOURCE

+
          SUBROUTINE h5sget_select_elem_pointlist_f(space_id, startpoint, &
+                                                    num_points, buf, hdferr)
+            IMPLICIT NONE
+            INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier
+            INTEGER(HSIZE_T), INTENT(IN) :: startpoint
+                                             !Element point to start with.
+            INTEGER(HSIZE_T), INTENT(IN) :: num_points
+                                             !Number of element points to get
+            INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: buf
+                                             !List of element points selected
+            INTEGER, INTENT(OUT) :: hdferr   ! Error code
+
+ +
+ +

h5sget_select_hyper_blocklist_f

+ +

[ Top ] [ H5S ] [ Subroutines ]

+

NAME

+
  h5sget_select_hyper_blocklist_f
+
+

PURPOSE

+
  Gets the list of hyperslab blocks currently selected.
+
+

INPUTS

+
  space_id    - dataspace identifier
+  startblock  - hyperslab block to start with
+  num_blocks  - number of blocks to get
+
+

OUTPUTS

+
  buf         - buffer to hold block list
+  hdferr      - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 6, 2001
+
+

SOURCE

+
          SUBROUTINE h5sget_select_hyper_blocklist_f(space_id, startblock, &
+                                                    num_blocks, buf, hdferr)
+            IMPLICIT NONE
+            INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier
+            INTEGER(HSIZE_T), INTENT(IN) :: startblock
+                                             !Hyperslab block to start with.
+            INTEGER(HSIZE_T), INTENT(IN) :: num_blocks
+                                             !number of hyperslab blocks
+                                             !to get in the current dataspace
+                                             !selection
+            INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: buf
+                                             !List of hyperslab blocks selected
+            INTEGER, INTENT(OUT) :: hdferr   ! Error code
+
+ +
+ +

h5sget_select_hyper_nblocks_f

+ +

[ Top ] [ H5S ] [ Subroutines ]

+

NAME

+
  h5sget_select_hyper_nblocks_f
+
+

PURPOSE

+
  Get number of hyperslab blocks.
+
+

INPUTS

+
  space_id    - dataspace identifier
+
+

OUTPUTS

+
  num_blocks  - number of hyperslab blocks in the current
+                hyperslab selection
+  hdferr      - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 6, 2001
+
+

SOURCE

+
          SUBROUTINE h5sget_select_hyper_nblocks_f(space_id, num_blocks, hdferr)
+            IMPLICIT NONE
+            INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier
+            INTEGER(HSSIZE_T), INTENT(OUT) :: num_blocks
+                                             !number of hyperslab blocks
+                                             !in the current dataspace
+                                             !selection
+            INTEGER, INTENT(OUT) :: hdferr   ! Error code
+
+ +
+ +

h5sget_select_npoints_f

+ +

[ Top ] [ H5S ] [ Subroutines ]

+

NAME

+
  h5sget_select_npoints_f
+
+

PURPOSE

+
  Determines the number of elements in a dataspace selection.
+
+

INPUTS

+
  space_id      - dataspace identifier
+
+

OUTPUTS

+
  npoints       - number of points in the dataspace selection
+  hdferr      - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 6, 2001
+
+

SOURCE

+
          SUBROUTINE h5sget_select_npoints_f(space_id, npoints, hdferr)
+            IMPLICIT NONE
+            INTEGER(HID_T), INTENT(IN) :: space_id     ! Dataspace identifier
+            INTEGER(HSSIZE_T), INTENT(OUT) :: npoints  ! Number of elements in the
+                                                       ! selection
+            INTEGER, INTENT(OUT) :: hdferr             ! Error code
+
+ +
+ +

h5sget_select_type_f

+ +

[ Top ] [ H5S ] [ Subroutines ]

+

NAME

+
  h5sget_select_type_f
+
+

PURPOSE

+
  Retrieve the type of selection
+
+

INPUTS

+
  space_id      - dataspace iidentifier with selection
+
+

OUTPUTS

+
  type          - flag, valid values are:
+                    H5S_SEL_ERROR_F
+                    H5S_SEL_NONE_F
+                    H5S_SEL_POINTS_F
+                    H5S_SEL_HYPERSLABS_F
+                    H5S_SEL_ALL_F
+  hdferr      - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  October 7, 2002
+
+

SOURCE

+
          SUBROUTINE h5sget_select_type_f(space_id, type, hdferr)
+            IMPLICIT NONE
+            INTEGER(HID_T), INTENT(INOUT) :: space_id ! Dataspace identifier to
+            INTEGER, INTENT(OUT) :: type        ! Selection type
+                                                !  H5S_SEL_ERROR_F
+                                                !  H5S_SEL_NONE_F
+                                                !  H5S_SEL_POINTS_F
+                                                !  H5S_SEL_HYPERSLABS_F
+                                                !  H5S_SEL_ALL_F
+            INTEGER, INTENT(OUT) :: hdferr     ! Error code
+
+ +
+ +

h5sget_simple_extent_dims_f

+ +

[ Top ] [ H5S ] [ Subroutines ]

+

NAME

+
  h5sget_simple_extent_dims_f
+
+

PURPOSE

+
  Retrieves dataspace dimension size and maximum size.
+
+

INPUTS

+
  space_id      - dataspace identifier
+
+

OUTPUTS

+
  dims          - array to store size of each dimension
+  maxdims       - array to store maximum size of each
+  dimension
+  hdferr      - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 6, 2001
+
+

SOURCE

+
          SUBROUTINE h5sget_simple_extent_dims_f(space_id, dims, maxdims, hdferr)
+            IMPLICIT NONE
+            INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier
+            INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: dims
+                                                   ! Array to store dimension sizes
+            INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: maxdims
+                                                   ! Array to store max dimension
+                                                   ! sizes
+            INTEGER, INTENT(OUT) :: hdferr         ! Error code: -1 on failure,
+                                                   ! number of dimensions on
+                                                   ! on success
+
+ +
+ +

h5sget_simple_extent_ndims_f

+ +

[ Top ] [ H5S ] [ Subroutines ]

+

NAME

+
  h5sget_simple_extent_ndims_f
+
+

PURPOSE

+
  Determines the dimensionality of a dataspace
+
+

INPUTS

+
  space_id      - dataspace identifier
+
+

OUTPUTS

+
  rank          - number of dataspace dimensions
+  hdferr      - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 6, 2001
+
+

SOURCE

+
          SUBROUTINE h5sget_simple_extent_ndims_f(space_id, rank, hdferr)
+            IMPLICIT NONE
+            INTEGER(HID_T), INTENT(IN) :: space_id     ! Dataspace identifier
+            INTEGER, INTENT(OUT) :: rank               ! Number of dimensions
+            INTEGER, INTENT(OUT) :: hdferr             ! Error code
+
+ +
+ +

h5sget_simple_extent_npoints_f

+ +

[ Top ] [ H5S ] [ Subroutines ]

+

NAME

+
  h5sget_simple_extent_npoints_f
+
+

PURPOSE

+
  Determines the number of elements in a dataspace.
+
+

INPUTS

+
  space_id      - dataspace identifier
+
+

OUTPUTS

+
  npoints       - number of elements in the dataspace
+  hdferr      - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 6, 2001
+
+

SOURCE

+
          SUBROUTINE h5sget_simple_extent_npoints_f(space_id, npoints, hdferr)
+            IMPLICIT NONE
+            INTEGER(HID_T), INTENT(IN) :: space_id     ! Dataspace identifier
+            INTEGER(HSIZE_T), INTENT(OUT) :: npoints  ! Number of elements in
+                                                       ! dataspace
+            INTEGER, INTENT(OUT) :: hdferr             ! Error code
+
+ +
+ +

h5sget_simple_extent_type_f

+ +

[ Top ] [ H5S ] [ Subroutines ]

+

NAME

+
  h5sget_simple_extent_type_f
+
+

PURPOSE

+
  Determine the current class of a dataspace
+
+

INPUTS

+
  space_id      - dataspace identifier
+
+

OUTPUTS

+
  classtype     - class type, possible values are:
+  H5S_NO_CLASS_F (-1)
+  H5S_SCALAR_F (0)
+  H5S_SIMPLE_F (1)
+  H5S_NULL_F   (2)
+  hdferr      - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 6, 2001
+
+

SOURCE

+
          SUBROUTINE h5sget_simple_extent_type_f(space_id, classtype, hdferr)
+            IMPLICIT NONE
+            INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier
+            INTEGER, INTENT(OUT) :: classtype      ! Class type , possible values
+                                                   ! are:
+                                                   !  H5S_NO_CLASS_F (-1)
+                                                   !  H5S_SCALAR_F (0)
+                                                   !  H5S_SIMPLE_F (1)
+                                                   !  H5S_NULL_F   (2)
+            INTEGER, INTENT(OUT) :: hdferr         ! Error code
+
+ +
+ +

h5sis_simple_f

+ +

[ Top ] [ H5S ] [ Subroutines ]

+

NAME

+
  h5sis_simple_f
+
+

PURPOSE

+
  Determines whether a dataspace is a simple dataspace.
+
+

INPUTS

+
  space_id      - dataspace identifier
+
+

OUTPUTS

+
  status        - flag to indicate if dataspace
+  is simple or not
+  hdferr      - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 6, 2001
+
+

SOURCE

+
          SUBROUTINE h5sis_simple_f(space_id, status, hdferr)
+            IMPLICIT NONE
+            INTEGER(HID_T), INTENT(IN) :: space_id  ! Dataspace identifier
+            LOGICAL, INTENT(OUT) :: status      ! Flag, idicates if dataspace
+                                                ! is simple or not ( TRUE or
+                                                ! FALSE)
+            INTEGER, INTENT(OUT) :: hdferr      ! Error code
+
+ +
+ +

h5soffset_simple_f

+ +

[ Top ] [ H5S ] [ Subroutines ]

+

NAME

+
  h5soffset_simple_f
+
+

PURPOSE

+
  Sets the offset of a simple dataspace.
+
+

INPUTS

+
  space_id      - dataspace identifier
+  offset        - the offset at which to position the
+  selection
+
+

OUTPUTS

+
  hdferr      - Returns 0 if successful and -1 if fails
+
+

OPTIONAL PARAMETERS

+
  NONE
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 6, 2001
+
+

SOURCE

+
          SUBROUTINE h5soffset_simple_f(space_id, offset, hdferr)
+            IMPLICIT NONE
+            INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier
+            INTEGER(HSSIZE_T), DIMENSION(*), INTENT(IN) ::  offset
+                                                   ! The offset at which to position
+                                                   ! the selection
+            INTEGER, INTENT(OUT) :: hdferr         ! Error code
+
+ +
+ +

h5sselect_all_f

+ +

[ Top ] [ H5S ] [ Subroutines ]

+

NAME

+
  h5sselect_all_f
+
+

PURPOSE

+
  Selects the entire dataspace.
+
+

INPUTS

+
  space_id    - Identifier for the dataspace in which
+                selection being made
+
+

OUTPUTS

+
  hdferr      - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 6, 2001
+
+

SOURCE

+
          SUBROUTINE h5sselect_all_f(space_id, hdferr)
+            IMPLICIT NONE
+            INTEGER(HID_T), INTENT(IN) :: space_id  ! Dataspace identifier
+            INTEGER, INTENT(OUT) :: hdferr          ! Error code
+
+ +
+ +

h5sselect_elements_f

+ +

[ Top ] [ H5S ] [ Subroutines ]

+

NAME

+
  h5sselect_elements_f
+
+

PURPOSE

+
  Selects elements to be included in the selection for
+  a dataspace
+
+

INPUTS

+
  space_id      - dataspace identifier
+  operator      - flag, valid values are:
+                   H5S_SELECT_SET_F 
+                   H5S_SELECT_APPEND_F 
+                   H5S_SELECT_PREPEND_F
+  rank          - number of dataspace dimensions
+  num_elements  - number of elements to be selected
+  coord         - 2D (rank x num_elements) array with the
+                  elements coordinates ( 1-based); in C the
+                  array is stored in 2D as (num_element x rank)
+
+

OUTPUTS

+
  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 6, 2001
+
+

SOURCE

+
  SUBROUTINE h5sselect_elements_f(space_id, OPERATOR, rank, &
+       num_elements, coord, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T),   INTENT(IN)                                :: space_id
+    INTEGER,          INTENT(IN)                                :: OPERATOR
+    INTEGER,          INTENT(IN)                                :: rank
+    INTEGER(SIZE_T),  INTENT(IN)                                :: num_elements
+    INTEGER(HSIZE_T), INTENT(IN) , DIMENSION(rank,num_elements) :: coord
+    INTEGER,          INTENT(OUT)                               :: hdferr 
+
+ +
+ +

h5sselect_hyperslab_f

+ +

[ Top ] [ H5S ] [ Subroutines ]

+

NAME

+
  h5sselect_hyperslab_f
+
+

PURPOSE

+
  Selects a hyperslab region to add to the current selected
+  region
+
+

INPUTS

+
  space_id      - dataspace identifier
+  operator      - flag, valid values are:
+  H5S_SELECT_SET_F (0)
+  H5S_SELECT_OR_F (1)
+  start         - array with hyperslab offsets
+  count         - number of blocks included in the
+  hyperslab
+
+

OUTPUTS

+
  hdferr      - Returns 0 if successful and -1 if fails
+
+

OPTIONAL PARAMETERS

+
  stride        - array with hyperslab strides
+  block         - array with hyperslab block sizes
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 6, 2001
+
+

SOURCE

+
          SUBROUTINE h5sselect_hyperslab_f(space_id, operator, start, count, &
+                                           hdferr, stride, block)
+            IMPLICIT NONE
+            INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier
+            INTEGER, INTENT(IN) :: operator     ! Flag, valid values are:
+                                                ! H5S_SELECT_SET_F (0)
+                                                ! H5S_SELECT_OR_F (1)
+                                                !
+            INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: start
+                                          ! Starting coordinates of the hyperslab
+            INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: count
+                                          ! Number of blocks to select
+                                          ! from dataspace
+            INTEGER, INTENT(OUT) :: hdferr     ! Error code
+            INTEGER(HSIZE_T), DIMENSION(:), OPTIONAL, INTENT(IN) :: stride
+                                          ! Array of how many elements to move
+                                          ! in each direction
+            INTEGER(HSIZE_T), DIMENSION(:), OPTIONAL, INTENT(IN) :: block
+                                          ! Sizes of element block
+
+ +
+ +

h5sselect_none_f

+ +

[ Top ] [ H5S ] [ Subroutines ]

+

NAME

+
  h5sselect_none_f
+
+

PURPOSE

+
  Resets the selection region to include no elements.
+
+

INPUTS

+
  space_id    - the identifier for the dataspace in which
+                the selection is being reset.
+
+

OUTPUTS

+
  hdferr      - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 6, 2001
+
+

SOURCE

+
          SUBROUTINE h5sselect_none_f(space_id, hdferr)
+            IMPLICIT NONE
+            INTEGER(HID_T), INTENT(IN) :: space_id  ! Dataspace identifier
+            INTEGER, INTENT(OUT) :: hdferr          ! Error code
+
+ +
+ +

h5sselect_valid_f

+ +

[ Top ] [ H5S ] [ Subroutines ]

+

NAME

+
  h5sselect_valid_f
+
+

PURPOSE

+
  Verifies that the selection is within the extent of
+  the dataspace.
+
+

INPUTS

+
  space_id      - identifier for the dataspace for which
+  selection is verified
+
+

OUTPUTS

+
  hdferr      - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 6, 2001
+
+

SOURCE

+
          SUBROUTINE h5sselect_valid_f(space_id, status, hdferr)
+            IMPLICIT NONE
+            INTEGER(HID_T), INTENT(IN) :: space_id  ! Dataspace identifier
+            LOGICAL, INTENT(OUT) :: status          ! TRUE if the selection is
+                                                    ! contained within the extent,
+                                                    ! FALSE otherwise.
+            INTEGER, INTENT(OUT) :: hdferr          ! Error code
+
+ +
+ +

h5sset_extent_none_f

+ +

[ Top ] [ H5S ] [ Subroutines ]

+

NAME

+
  h5sset_extent_none_f
+
+

PURPOSE

+
  Removes the extent from a dataspace.
+
+

INPUTS

+
  space_id      - dataspace identifier
+
+

OUTPUTS

+
  hdferr      - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 6, 2001
+
+

SOURCE

+
          SUBROUTINE h5sset_extent_none_f(space_id, hdferr)
+            IMPLICIT NONE
+            INTEGER(HID_T), INTENT(IN) :: space_id  ! Dataspace identifier
+            INTEGER, INTENT(OUT) :: hdferr          ! Error code
+
+ +
+ +

h5sset_extent_simple_f

+ +

[ Top ] [ H5S ] [ Subroutines ]

+

NAME

+
  h5sset_extent_simple_f
+
+

PURPOSE

+
  Sets or resets the size of an existing dataspace.
+
+

INPUTS

+
  space_id      - dataspace identifier
+  rank          - dataspace number of dimensions
+  current_size          - array with the new sizes of dimensions
+  maximum_size          - array with the new maximum sizes of
+  dimensions
+
+

OUTPUTS

+
  hdferr      - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 6, 2001
+
+

SOURCE

+
          SUBROUTINE h5sset_extent_simple_f(space_id, rank, current_size, &
+                                            maximum_size, hdferr)
+            IMPLICIT NONE
+            INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier
+            INTEGER, INTENT(IN) :: rank            ! Dataspace rank
+            INTEGER(HSIZE_T), DIMENSION(rank), INTENT(IN) :: current_size
+                                                   ! Array with the new sizes
+                                                   ! of dimensions
+            INTEGER(HSIZE_T), DIMENSION(rank), INTENT(IN) :: maximum_size
+                                                   ! Array with the new maximum
+                                                   ! sizes of dimensions
+                                                   ! sizes
+            INTEGER, INTENT(OUT) :: hdferr         ! Error code
+
+ +
+ + + diff --git a/fortran/doc/DevelGuide/src/H5Tf_c.html b/fortran/doc/DevelGuide/src/H5Tf_c.html new file mode 100644 index 0000000..b36c2a5 --- /dev/null +++ b/fortran/doc/DevelGuide/src/H5Tf_c.html @@ -0,0 +1,41 @@ + + + + + + + +./src/H5Tf.c + + + + + +
+
+ +

H5Tf

+ +

[ Top ] [ Modules ]

+

PURPOSE

+
   This file contains C stubs for H5T Fortran APIs
+
+ +
+ + + diff --git a/fortran/doc/DevelGuide/src/H5Tff_f90.html b/fortran/doc/DevelGuide/src/H5Tff_f90.html new file mode 100644 index 0000000..3b7dfe8 --- /dev/null +++ b/fortran/doc/DevelGuide/src/H5Tff_f90.html @@ -0,0 +1,2378 @@ + + + + + + + +./src/H5Tff.f90 + + + + + +
+
+ +

H5T

+ +

[ Top ] [ Modules ]

+

NAME

+
  MODULE H5T
+
+

PURPOSE

+
  This file contains Fortran interfaces for H5T functions. It includes
+  all the functions that are independent on whether the Fortran 2003 functions
+  are enabled or disabled.
+
+

NOTES

+
                         *** IMPORTANT ***
+  If you add a new H5T function you must add the function name to the
+  Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory.
+  This is needed for Windows based operating systems.
+
+ +
+ +

h5tarray_create_f

+ +

[ Top ] [ H5T ] [ Subroutines ]

+

NAME

+
  h5tarray_create_f
+
+

PURPOSE

+
  Creates an array datatype object.
+
+

INPUTS

+
  base_id       - datatype identifier for the array
+                  base datatype
+  rank          - rank of the array
+  dims          - array dimension sizes
+
+

OUTPUTS

+
  type_id       - array datatype identifier
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 7, 2001
+
+

SOURCE

+
  SUBROUTINE h5tarray_create_f(base_id, rank, dims, type_id, hdferr)
+            IMPLICIT NONE
+            INTEGER(HID_T), INTENT(IN) :: base_id ! identifier of array base datatype
+            INTEGER, INTENT(IN) ::  rank ! Rank of the array
+            INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: dims !Sizes of each array dimension
+            INTEGER(HID_T), INTENT(OUT) :: type_id ! identifier of the array datatype
+            INTEGER, INTENT(OUT) :: hdferr        ! Error code
+
+ +
+ +

h5tclose_f

+ +

[ Top ] [ H5T ] [ Subroutines ]

+

NAME

+
  h5tclose_f
+
+

PURPOSE

+
  Releases a datatype.
+
+

INPUTS

+
  type_id       - datatype identifier
+
+

OUTPUTS

+
  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 7, 2001
+
+

SOURCE

+
  SUBROUTINE h5tclose_f(type_id, hdferr)
+            IMPLICIT NONE
+            INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
+            INTEGER, INTENT(OUT) :: hdferr        ! Error code
+
+ +
+ +

h5tcommit_anon_f

+ +

[ Top ] [ H5T ] [ Subroutines ]

+

NAME

+
  h5tcommit_anon_f
+
+

PURPOSE

+
  Commits a transient datatype to a file,
+  creating a new named datatype,
+  but does not link it into the file structure.
+
+

INPUTS

+
  loc_id        - A file or group identifier specifying the file
+                  in which the new named datatype is to be created.
+  dtype_id      - A datatype identifier.
+
+

OUTPUTS

+
  hdferr        - Returns 0 if successful and -1 if fails
+
+

OPTIONAL PARAMETERS

+
  tcpl_id       - A datatype creation property list identifier.
+                  (H5P_DEFAULT_F for the default property list.)
+  tapl_id       - A datatype access property list identifier.
+                  should always be passed as the value H5P_DEFAULT_F.
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  February 25, 2008
+
+

SOURCE

+
  SUBROUTINE h5tcommit_anon_f(loc_id, dtype_id, hdferr, tcpl_id, tapl_id)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: loc_id  ! A file or group identifier specifying
+                                          ! the file in which the new named datatype
+                                          ! is to be created.
+    INTEGER(HID_T), INTENT(IN) :: dtype_id  ! Datatype identifier
+    INTEGER, INTENT(OUT) :: hdferr          ! Error code
+    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: tcpl_id ! A datatype creation property
+                                                    ! list identifier.
+                                                    ! (H5P_DEFAULT_F for the default property list.)
+    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: tapl_id ! A datatype access property list identifier.
+                                                    ! should always be passed as the value H5P_DEFAULT_F.
+
+ +
+ +

h5tcommit_f

+ +

[ Top ] [ H5T ] [ Subroutines ]

+

NAME

+
  h5tcommit_f
+
+

PURPOSE

+
  Commits a transient datatype to a file, creating a
+  new named datatype.
+
+

INPUTS

+
  loc_id        - location identifier
+  name          - name of the datatype to be stored
+                  at the specified location
+  type_id       - identifier of a datatype to be stored
+
+

OUTPUTS

+
  hdferr        - Returns 0 if successful and -1 if fails
+
+

OPTIONAL PARAMETERS

+
  lcpl_id       - Link creation property list
+  tcpl_id       - Datatype creation property list
+  tapl_id       - Datatype access property list
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
        - Explicit Fortran interfaces were added for
+          called C functions (it is needed for Windows
+          port).  March 7, 2001
+
+        - Added optional parameters introduced in version 1.8
+          M. Scot Breitenfeld
+
+

SOURCE

+
  SUBROUTINE h5tcommit_f(loc_id, name, type_id, hdferr, &
+       lcpl_id, tcpl_id, tapl_id  )
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: loc_id  ! File or group identifier
+    CHARACTER(LEN=*), INTENT(IN) :: name
+                                  ! Datatype name within file or group
+    INTEGER(HID_T), INTENT(IN) :: type_id  ! Datatype identifier
+    INTEGER, INTENT(OUT) :: hdferr          ! Error code
+    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lcpl_id ! Link creation property list
+    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: tcpl_id ! Datatype creation property list
+    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: tapl_id ! Datatype access property list
+
+ +
+ +

h5tcommitted_f

+ +

[ Top ] [ H5T ] [ Subroutines ]

+

NAME

+
  h5tcommitted_f
+
+

PURPOSE

+
  Determines whether a datatype is a named type or a transient type.
+
+

INPUTS

+
  dtype_id      - A datatype identifier.
+
+

OUTPUTS

+
  committed     - .TRUE., if the datatype has been committed
+                  .FALSE., if the datatype has not been committed.
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  February 25, 2008
+
+

SOURCE

+
  SUBROUTINE h5tcommitted_f(dtype_id, committed, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: dtype_id  ! A datatype identifier
+    LOGICAL, INTENT(OUT) :: committed ! .TRUE., if the datatype has been committed
+                                      !.FALSE., if the datatype has not been committed.
+    INTEGER, INTENT(OUT) :: hdferr     ! Error code:
+!  Success:  0
+!  Failure: -1
+
+ +
+ +

h5tcompiler_conv_f

+ +

[ Top ] [ H5T ] [ Subroutines ]

+

NAME

+
  h5tcompiler_conv_f
+
+

PURPOSE

+
  Check whether the library’s default conversion is hard conversion.R
+
+

INPUTS

+
  src_id        - Identifier for the source datatype.
+  dst_id        - Identifier for the destination datatype.
+
+

OUTPUTS

+
  flag          - TRUE for compiler conversion, FALSE for library conversion
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  April 9, 2008
+
+

SOURCE

+
  SUBROUTINE h5tcompiler_conv_f( src_id, dst_id, flag, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: src_id ! Identifier for the source datatype.
+    INTEGER(HID_T), INTENT(IN) :: dst_id ! Identifier for the destination datatype.
+    LOGICAL, INTENT(OUT) :: flag  ! .TRUE. for compiler conversion, .FALSE. for library conversion
+    INTEGER, INTENT(OUT) :: hdferr  ! Error code:
+                                    ! 0 on success and -1 on failure
+
+ +
+ +

h5tcopy_f

+ +

[ Top ] [ H5T ] [ Subroutines ]

+

NAME

+
  h5tcopy_f
+
+

PURPOSE

+
  Creates a copy of exisiting datatype.
+
+

INPUTS

+
  type_id       - datatype identifier
+
+

OUTPUTS

+
  new_type_id   - identifier of datatype's copy
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 7, 2001
+
+

SOURCE

+
  SUBROUTINE h5tcopy_f(type_id, new_type_id, hdferr)
+            IMPLICIT NONE
+            INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
+            INTEGER(HID_T), INTENT(OUT) :: new_type_id
+                                 ! Identifier of datatype's copy
+            INTEGER, INTENT(OUT) :: hdferr        ! Error code
+
+ +
+ +

h5tcreate_f

+ +

[ Top ] [ H5T ] [ Subroutines ]

+

NAME

+
  h5tcreate_f
+
+

PURPOSE

+
  Creates a new dataype
+
+

INPUTS

+
  class         - datatype class, possible values are:
+                    H5T_COMPOUND_F
+                    H5T_ENUM_F
+                    H5T_OPAQUE_F
+  size          - datattype size
+
+

OUTPUTS

+
  type_id       - datatype identifier
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 7, 2001
+
+

SOURCE

+
  SUBROUTINE h5tcreate_f(class, size, type_id, hdferr)
+            IMPLICIT NONE
+            INTEGER, INTENT(IN) :: class ! Datatype class can be one of
+                                         ! H5T_COMPOUND_F
+                                         ! H5T_ENUM_F
+                                         ! H5T_OPAQUE_F
+            INTEGER(SIZE_T), INTENT(IN) :: size ! Size of the datatype
+            INTEGER(HID_T), INTENT(OUT) :: type_id ! Datatype identifier
+            INTEGER, INTENT(OUT) :: hdferr        ! Error code
+
+ +
+ +

H5Tdecode_f

+ +

[ Top ] [ H5T ] [ Subroutines ]

+

NAME

+
  H5Tdecode_f
+
+

PURPOSE

+
  Decode a binary object description of data type and return a new object handle.
+
+

INPUTS

+
  buf           -  Buffer for the data space object to be decoded.
+  obj_id        - Object ID
+
+

OUTPUTS

+
  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  April 9, 2008
+
+

SOURCE

+
  SUBROUTINE h5tdecode_f(buf, obj_id, hdferr)
+    IMPLICIT NONE
+    CHARACTER(LEN=*), INTENT(IN) :: buf ! Buffer for the data space object to be decoded.
+    INTEGER(HID_T), INTENT(OUT) :: obj_id  ! Object ID
+    INTEGER, INTENT(OUT) :: hdferr     ! Error code
+
+ +
+ +

h5tenaum_insert_f

+ +

[ Top ] [ H5T ] [ Subroutines ]

+

NAME

+
  h5tenaum_insert_f
+
+

PURPOSE

+
  Inserts a new enumeration datatype member.
+
+

INPUTS

+
  type_id       - datatype identifier
+
+

OUTPUTS

+
  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 7, 2001
+
+

SOURCE

+
  SUBROUTINE h5tenum_insert_f(type_id,  name, value, hdferr)
+            IMPLICIT NONE
+            INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
+            CHARACTER(LEN=*), INTENT(IN) :: name  !Name of  the new member
+            INTEGER, INTENT(IN) :: value !value of the new member
+            INTEGER, INTENT(OUT) :: hdferr        ! Error code
+
+ +
+ +

H5Tencode_f

+ +

[ Top ] [ H5T ] [ Subroutines ]

+

NAME

+
  H5Tencode_f
+
+

PURPOSE

+
  Encode a data type object description into a binary buffer.
+
+

INPUTS

+
  obj_id        - Identifier of the object to be encoded.
+  buf           - Buffer for the object to be encoded into.
+  nalloc        - The size of the allocated buffer.
+
+

OUTPUTS

+
  nalloc        - The size of the buffer needed.
+  hdferr        - Returns 0 if successful and -1 if fails.
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  April 9, 2008
+
+

SOURCE

+
  SUBROUTINE h5tencode_f(obj_id, buf, nalloc, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: obj_id ! Identifier of the object to be encoded.
+    CHARACTER(LEN=*), INTENT(OUT) :: buf ! Buffer for the object to be encoded into.
+    INTEGER(SIZE_T), INTENT(INOUT) :: nalloc ! The size of the allocated buffer.
+    INTEGER, INTENT(OUT) :: hdferr     ! Error code
+
+ +
+ +

h5tenum_create_f

+ +

[ Top ] [ H5T ] [ Subroutines ]

+

NAME

+
  h5tenum_create_f
+
+

PURPOSE

+
  Creates a new enumeration datatype.
+
+

INPUTS

+
  parent_id     - datatype identifier for base datatype
+
+

OUTPUTS

+
  new_type_id   - datatype identifier for the enumeration datatype
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 7, 2001
+
+

SOURCE

+
  SUBROUTINE h5tenum_create_f(parent_id, new_type_id, hdferr)
+            IMPLICIT NONE
+            INTEGER(HID_T), INTENT(IN) :: parent_id  ! Datatype identifier for
+                                                     ! the  base datatype
+            INTEGER(HID_T), INTENT(OUT) :: new_type_id
+                                                     !datatype identifier for the
+                                                     ! new enumeration datatype
+            INTEGER, INTENT(OUT) :: hdferr        ! Error code
+
+ +
+ +

h5tenum_nameof_f

+ +

[ Top ] [ H5T ] [ Subroutines ]

+

NAME

+
  h5tenum_nameof_f
+
+

PURPOSE

+
  Returns the symbol name corresponding to a specified
+  member of an enumeration datatype.
+
+

INPUTS

+
  type_id       - datatype identifier
+  value         - value of the enumeration datatype
+  namelen       - name buffer size
+
+

OUTPUTS

+
  name          - buffer to hold symbol name
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 7, 2001
+
+ NOTE
+   According to the standard: Because an INTENT(OUT) variable is considered undefined 
+   on entry to the procedure, any default initialization specified for its type will 
+   be applied. So we need to blank out the "name" to be portable and eliminate any 
+   characters the "name' may contain upon entry, depending on compiler implementation.
+
+

SOURCE

+
  SUBROUTINE h5tenum_nameof_f(type_id,  value, namelen, name, hdferr)
+            IMPLICIT NONE
+            INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
+            CHARACTER(LEN=*), INTENT(OUT) :: name  !Name of the  enumeration datatype.
+            INTEGER(SIZE_T), INTENT(IN) :: namelen !length of the name
+            INTEGER, INTENT(IN) :: value !value of the  enumeration datatype.
+            INTEGER, INTENT(OUT) :: hdferr        ! Error code
+
+ +
+ +

h5tenum_valuof_f

+ +

[ Top ] [ H5T ] [ Subroutines ]

+

NAME

+
  h5tenum_valuof_f
+
+

PURPOSE

+
  Returns the value corresponding to a specified
+  member of an enumeration datatype.
+
+

INPUTS

+
  type_id       - datatype identifier
+  name          - symbol name
+
+

OUTPUTS

+
  value         - value of the enumeration datatype
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 7, 2001
+
+

SOURCE

+
  SUBROUTINE h5tenum_valueof_f(type_id,  name, value, hdferr)
+            IMPLICIT NONE
+            INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
+            CHARACTER(LEN=*), INTENT(IN) :: name  !Name of the  enumeration datatype.
+            INTEGER, INTENT(OUT) :: value !value of the  enumeration datatype.
+            INTEGER, INTENT(OUT) :: hdferr        ! Error code
+
+ +
+ +

h5tequal_f

+ +

[ Top ] [ H5T ] [ Subroutines ]

+

NAME

+
  h5tequal_f
+
+

PURPOSE

+
  Determines whether two datatype identifiers refer
+  to the same datatype.
+
+

INPUTS

+
  type1_id      - datatype identifier
+  type2_id      - datatype identifier
+
+

OUTPUTS

+
  flag          - TRUE/FALSE flag to indicate
+                  if two datatypes are equal
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 7, 2001
+
+

SOURCE

+
  SUBROUTINE h5tequal_f(type1_id, type2_id, flag, hdferr)
+            IMPLICIT NONE
+            INTEGER(HID_T), INTENT(IN) :: type1_id ! Datatype identifier
+            INTEGER(HID_T), INTENT(IN) :: type2_id ! Datatype identifier
+            LOGICAL, INTENT(OUT) :: flag ! TRUE/FALSE flag to indicate if two
+                                         ! datatypes are equal
+            INTEGER, INTENT(OUT) :: hdferr        ! Error code
+
+ +
+ +

h5tget_array_dims_f

+ +

[ Top ] [ H5T ] [ Subroutines ]

+

NAME

+
  h5tget_array_dims_f
+
+

PURPOSE

+
  Returns sizes of array dimensions.
+
+

INPUTS

+
  type_id       - array datatype identifier
+
+

OUTPUTS

+
  dims          - buffer to store array datatype dimensions
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 7, 2001
+
+

SOURCE

+
  SUBROUTINE h5tget_array_dims_f(type_id, dims, hdferr)
+            IMPLICIT NONE
+            INTEGER(HID_T), INTENT(IN) :: type_id ! Array datatype identifier
+            INTEGER(HSIZE_T),DIMENSION(*), INTENT(OUT) ::  dims !buffer to store array datatype
+                                                                ! dimensions
+            INTEGER, INTENT(OUT) :: hdferr        ! Error code
+
+ +
+ +

h5tget_array_ndims_f

+ +

[ Top ] [ H5T ] [ Subroutines ]

+

NAME

+
  h5tget_array_ndims_f
+
+

PURPOSE

+
  Returns the rank of an array datatype.
+
+

INPUTS

+
  type_id       - array datatype identifier
+
+

OUTPUTS

+
  ndims         - number of array dimensions
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 7, 2001
+
+

SOURCE

+
  SUBROUTINE h5tget_array_ndims_f(type_id, ndims, hdferr)
+            IMPLICIT NONE
+            INTEGER(HID_T), INTENT(IN) :: type_id ! Array datatype identifier
+            INTEGER, INTENT(OUT) ::  ndims ! number of array dimensions
+            INTEGER, INTENT(OUT) :: hdferr        ! Error code
+
+ +
+ +

h5tget_class_f

+ +

[ Top ] [ H5T ] [ Subroutines ]

+

NAME

+
  h5tget_class_f
+
+

PURPOSE

+
  Returns the datatype class identifier.
+
+

INPUTS

+
  type_id       - datatype identifier
+
+

OUTPUTS

+
  class         - class, possible values are:
+                   H5T_NO_CLASS_F (-1)
+                   H5T_INTEGER_F  (0)
+                   H5T_FLOAT_F (1)
+                   H5T_TIME_F  (2)
+                   H5T_STRING_F (3)
+                   H5T_BITFIELD_F (4)
+                   H5T_OPAQUE_F (5)
+                   H5T_COMPOUND_F (6)
+                   H5T_REFERENCE_F (7)
+                   H5T_ENUM_F (8)
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 7, 2001
+
+

SOURCE

+
  SUBROUTINE h5tget_class_f(type_id, class, hdferr)
+            IMPLICIT NONE
+            INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
+            INTEGER, INTENT(OUT) :: class
+                           ! Datatype class, possible values are:
+                                          ! H5T_NO_CLASS_F (-1)
+                                          ! H5T_INTEGER_F  (0)
+                                          ! H5T_FLOAT_F (1)
+                                          ! H5T_TIME_F  (2)
+                                          ! H5T_STRING_F (3)
+                                          ! H5T_BITFIELD_F (4)
+                                          ! H5T_OPAQUE_F (5)
+                                          ! H5T_COMPOUND_F (6)
+                                          ! H5T_REFERENCE_F (7)
+                                          ! H5T_ENUM_F (8)
+          INTEGER, INTENT(OUT) :: hdferr        ! Error code
+
+ +
+ +

h5tget_create_plist_f

+ +

[ Top ] [ H5T ] [ Subroutines ]

+

NAME

+
  h5tget_create_plist_f
+
+

PURPOSE

+
  Returns a copy of a datatype creation property list.
+
+

INPUTS

+
  dtype_id      - Datatype identifier
+
+

OUTPUTS

+
  dtpl_id       - Datatype property list identifier
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  April 9, 2008
+
+

SOURCE

+
  SUBROUTINE h5tget_create_plist_f(dtype_id, dtpl_id, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: dtype_id  ! Datatype identifier
+    INTEGER(HID_T), INTENT(OUT) :: dtpl_id  ! Datatype property list identifier.
+    INTEGER, INTENT(OUT) :: hdferr       ! Error code:
+                                         ! 0 on success and -1 on failure
+
+ +
+ +

h5tget_cset_f

+ +

[ Top ] [ H5T ] [ Subroutines ]

+

NAME

+
  h5tget_cset_f
+
+

PURPOSE

+
  Retrieves the character set type of a string datatype.
+
+

INPUTS

+
  type_id  - Datatype identifier
+
+

OUTPUTS

+
  cset     - Character set type of a string datatype
+              Possible values are:
+              H5T_CSET_ASCII_F = 0
+              H5T_CSET_UTF8_F
+  hdferr   - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 7, 2001
+
+

SOURCE

+
  SUBROUTINE h5tget_cset_f(type_id, cset, hdferr)
+            IMPLICIT NONE
+            INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
+            INTEGER, INTENT(OUT) :: cset   ! character set type of a string datatype
+                                           !  Possible values are:
+                                           !  H5T_CSET_ASCII_F = 0
+                                           !  H5T_CSET_UTF8_F
+            INTEGER, INTENT(OUT) :: hdferr ! Error code
+
+ +
+ +

h5tget_ebias_f

+ +

[ Top ] [ H5T ] [ Subroutines ]

+

NAME

+
  h5tget_ebias_f
+
+

PURPOSE

+
  Retrieves the exponent bias of a floating-point type.
+
+

INPUTS

+
  type_id       - datatype identifier
+
+

OUTPUTS

+
  ebias         - datatype exponent bias
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 7, 2001
+
+

SOURCE

+
  SUBROUTINE h5tget_ebias_f(type_id, ebias, hdferr)
+            IMPLICIT NONE
+            INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
+            INTEGER(SIZE_T), INTENT(OUT) :: ebias ! Datatype exponent bias of a floating-point type
+            INTEGER, INTENT(OUT) :: hdferr        ! Error code
+
+ +
+ +

h5tget_fields_f

+ +

[ Top ] [ H5T ] [ Subroutines ]

+

NAME

+
  h5tget_fields_f
+
+

PURPOSE

+
  Retrieves floating point datatype bit field information.
+
+

INPUTS

+
  type_id       - datatype identifier
+
+

OUTPUTS

+
  spos          - sign bit-position
+  epos          - exponent bit-position
+  esize         - size of exponent in bits
+  mpos          - mantissa position
+  msize         - size of mantissa in bits
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 7, 2001
+
+

SOURCE

+
  SUBROUTINE h5tget_fields_f(type_id, spos, epos, esize, mpos, msize, hdferr)
+            IMPLICIT NONE
+            INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
+            INTEGER(SIZE_T), INTENT(OUT) :: spos   ! sign bit-position
+            INTEGER(SIZE_T), INTENT(OUT) :: epos   ! exponent bit-position
+            INTEGER(SIZE_T), INTENT(OUT) :: esize  ! size of exponent in bits
+            INTEGER(SIZE_T), INTENT(OUT) :: mpos   ! mantissa bit-position
+            INTEGER(SIZE_T), INTENT(OUT) :: msize  ! size of mantissa in bits
+            INTEGER, INTENT(OUT) :: hdferr        ! Error code
+
+ +
+ +

h5tget_inpad_f

+ +

[ Top ] [ H5T ] [ Subroutines ]

+

NAME

+
  h5tget_inpad_f
+
+

PURPOSE

+
  Retrieves the internal padding type for unused bits
+  in floating-point datatypes.
+
+

INPUTS

+
  type_id       - datatype identifier
+
+

OUTPUTS

+
  padtype       - padding type for unused bits
+                  Possible values of padding type are:
+                    H5T_PAD_ZERO_F = 0
+                    H5T_PAD_ONE_F = 1
+                    H5T_PAD_BACKGROUND_F = 2
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 7, 2001
+
+

SOURCE

+
  SUBROUTINE h5tget_inpad_f(type_id, padtype, hdferr)
+            IMPLICIT NONE
+            INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
+            INTEGER, INTENT(OUT) :: padtype ! padding type for unused bits
+                                            ! in floating-point datatypes.
+                                            ! Possible values of padding type are:
+                                            ! H5T__PAD_ZERO_F = 0
+                                            ! H5T__PAD_ONE_F = 1
+                                            ! H5T__PAD_BACKGROUND_F = 2
+
+            INTEGER, INTENT(OUT) :: hdferr        ! Error code
+
+ +
+ +

h5tget_member_class_f

+ +

[ Top ] [ H5T ] [ Subroutines ]

+

NAME

+
  h5tget_member_class_f
+
+

PURPOSE

+
  Returns datatype class of compound datatype member.
+
+

INPUTS

+
  type_id       - datartpe identifier
+  member_no     - index of compound datatype member
+
+

OUTPUTS

+
  class         - class type for compound dadtype member
+                  Valid classes:
+                    H5T_NO_CLASS_F (error)
+                    H5T_INTEGER_F
+                    H5T_FLOAT_F
+                    H5T_TIME_F
+                    H5T_STRING_F
+                    H5T_BITFIELD_F
+                    H5T_OPAQUE_F
+                    H5T_COMPOUND_F
+                    H5T_REFERENCE_F
+                    H5T_ENUM_F
+                    H5T_VLEN_F
+                    H5T_ARRAY_F
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  April 6, 2005
+
+

SOURCE

+
  SUBROUTINE h5tget_member_class_f(type_id, member_no, class, hdferr)
+            IMPLICIT NONE
+            INTEGER(HID_T), INTENT(IN) :: type_id  ! Datatype identifier
+            INTEGER, INTENT(IN)       :: member_no  ! Member number
+            INTEGER, INTENT(OUT)     :: class      ! Member class
+            INTEGER, INTENT(OUT) :: hdferr      ! Error code
+
+ +
+ +

h5tget_member_index_f

+ +

[ Top ] [ H5T ] [ Subroutines ]

+

NAME

+
  h5tget_member_index_f
+
+

PURPOSE

+
  Retrieves the index of a compound or enumeration datatype member.
+
+

INPUTS

+
  type_id       - datatype identifier
+  name          - name of the field or member whose index to
+  to be retrieved from the datatype.
+
+

OUTPUTS

+
  index         - 0-based index of the filed or member (0 to N-1)
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  September 26, 2002
+
+

SOURCE

+
  SUBROUTINE h5tget_member_index_f(type_id, name, index, hdferr)
+            IMPLICIT NONE
+            INTEGER(HID_T), INTENT(IN) :: type_id  ! Datatype identifier
+            CHARACTER(LEN=*), INTENT(IN) :: name   ! Field or member name
+            INTEGER, INTENT(OUT) :: index          ! Field or member index
+            INTEGER, INTENT(OUT) :: hdferr          ! Error code
+
+ +
+ +

h5tget_member_name_f

+ +

[ Top ] [ H5T ] [ Subroutines ]

+

NAME

+
  h5tget_member_name_f
+
+

PURPOSE

+
  Retrieves the name of a field of a compound datatype.
+
+

INPUTS

+
  type_id       - datatype identifier
+  index         - filed index (0-based)
+
+

OUTPUTS

+
  member_name   - buffer to hold member's name
+  namelen       - name length
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 7, 2001
+
+

SOURCE

+
  SUBROUTINE h5tget_member_name_f(type_id, index, member_name,  namelen, hdferr)
+            IMPLICIT NONE
+            INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
+            INTEGER, INTENT(IN) :: index !Field index (0-based) of the field name to retrieve
+            CHARACTER(LEN=*), INTENT(OUT) :: member_name !name of a field of
+                                                         !a compound datatype
+            INTEGER, INTENT(OUT) :: namelen ! Length of the name
+            INTEGER, INTENT(OUT) :: hdferr        ! Error code
+
+ +
+ +

h5tget_member_offset_f

+ +

[ Top ] [ H5T ] [ Subroutines ]

+

NAME

+
  h5tget_member_offset_f
+
+

PURPOSE

+
  Retrieves the offset of a field of a compound datatype.
+
+

INPUTS

+
  type_id       - datatype identifier
+  member_no     - number of the field
+
+

OUTPUTS

+
  offset        - byte offset of the requested field
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 7, 2001
+
+

SOURCE

+
  SUBROUTINE h5tget_member_offset_f(type_id, member_no, offset, hdferr)
+            IMPLICIT NONE
+            INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
+            INTEGER, INTENT(IN) :: member_no !Number of the field
+                                                       !whose offset is requested
+            INTEGER(SIZE_T), INTENT(OUT) :: offset !byte offset of the beginning of the field
+            INTEGER, INTENT(OUT) :: hdferr        ! Error code
+
+ +
+ +

h5tget_member_type_f

+ +

[ Top ] [ H5T ] [ Subroutines ]

+

NAME

+
  h5tget_member_type_f
+
+

PURPOSE

+
  Returns the datatype of the specified member.
+
+

INPUTS

+
  type_id       - compound datatype identifier
+  field_idx     - field index (0-based)
+
+

OUTPUTS

+
  datatype      - idnetifier of the member's datatype
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 7, 2001
+
+

SOURCE

+
  SUBROUTINE h5tget_member_type_f(type_id,  field_idx, datatype, hdferr)
+            IMPLICIT NONE
+            INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
+            INTEGER, INTENT(IN) :: field_idx !Field index (0-based) of the field type to retrieve
+            INTEGER(HID_T), INTENT(OUT) :: datatype !identifier of a copy of
+                                                    !the datatype of the field
+            INTEGER, INTENT(OUT) :: hdferr        ! Error code
+
+ +
+ +

h5tget_member_value_f

+ +

[ Top ] [ H5T ] [ Subroutines ]

+

NAME

+
  h5tget_member_value_f
+
+

PURPOSE

+
  Returns the value of an enumeration datatype member.
+
+

INPUTS

+
  type_id       - datatype identifier
+  member_no     - number of the enumeration datatype member
+
+

OUTPUTS

+
  value         - value of the enumeration datatype
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 7, 2001
+
+

SOURCE

+
  SUBROUTINE h5tget_member_value_f(type_id,  member_no, value, hdferr)
+            IMPLICIT NONE
+            INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
+            INTEGER, INTENT(IN) :: member_no !Number of the enumeration datatype member
+            INTEGER, INTENT(OUT) :: value !value of the  enumeration datatype.
+            INTEGER, INTENT(OUT) :: hdferr        ! Error code
+
+ +
+ +

h5tget_native_type_f

+ +

[ Top ] [ H5T ] [ Subroutines ]

+

NAME

+
  h5tget_native_type_f
+
+

PURPOSE

+
  Returns the native datatype of a specified datatype.
+
+

INPUTS

+
  dtype_id      - Datatype identifier for the dataset datatype.
+  
+  direction     - Direction of search:
+                  H5T_DIR_DEFAULT     = 0,    /*default direction is inscendent */
+                  H5T_DIR_ASCEND      = 1,    /*in inscendent order             */
+                  H5T_DIR_DESCEND     = 2     /*in descendent order             */
+  * NOTE: In C it is defined as a structure: H5T_direction_t
+
+

OUTPUTS

+
  native_dtype_id - The native datatype identifier for the specified dataset datatype
+  hdferr          - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  June 18, 2008
+
+

SOURCE

+
  SUBROUTINE h5tget_native_type_f(dtype_id, direction, native_dtype_id, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: dtype_id  ! Datatype identifier
+    INTEGER, INTENT(IN) :: direction  ! Direction of search:
+                                      ! H5T_DIR_ASCEND_F      = 1  in inscendent order
+                                      ! H5T_DIR_DESCEND_F     = 2  in descendent order
+    INTEGER(HID_T), INTENT(OUT) :: native_dtype_id  ! The native datatype identifier
+    INTEGER, INTENT(OUT) :: hdferr    ! Error code:
+                                      ! 0 on success and -1 on failure
+
+ +
+ +

h5tget_nmembers_f

+ +

[ Top ] [ H5T ] [ Subroutines ]

+

NAME

+
  h5tget_nmembers_f
+
+

PURPOSE

+
  Retrieves the number of fields in a compound datatype.
+
+

INPUTS

+
  type_id       - datatype identifier
+
+

OUTPUTS

+
  num_members   - number of members
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 7, 2001
+
+

SOURCE

+
  SUBROUTINE h5tget_nmembers_f(type_id, num_members, hdferr)
+            IMPLICIT NONE
+            INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
+            INTEGER, INTENT(OUT) :: num_members !number of fields in a compound datatype
+            INTEGER, INTENT(OUT) :: hdferr        ! Error code
+
+ +
+ +

h5tget_norm_f

+ +

[ Top ] [ H5T ] [ Subroutines ]

+

NAME

+
  h5tget_norm_f
+
+

PURPOSE

+
  Retrieves mantissa normalization of a floating-point
+  datatype.
+
+

INPUTS

+
  type_id       - datatype identifier
+
+

OUTPUTS

+
  norm          - normalization types, valid values are:
+                    H5T_NORM_IMPLIED_F(0)
+                    H5T_NORM_MSBSET_F(1)
+                    H5T_NORM_NONE_F(2)
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 7, 2001
+
+

SOURCE

+
  SUBROUTINE h5tget_norm_f(type_id, norm, hdferr)
+            IMPLICIT NONE
+            INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
+            INTEGER, INTENT(OUT) :: norm !mantissa normalization of a floating-point datatype
+                                         !Valid normalization types are:
+                                         !H5T_NORM_IMPLIED_F(0),MSB of mantissa is not
+                                         !stored, always 1,  H5T_NORM_MSBSET_F(1), MSB of
+                                         !mantissa is always 1, H5T_NORM_NONE_F(2)
+                                         !Mantissa is not normalize
+            INTEGER, INTENT(OUT) :: hdferr        ! Error code
+
+ +
+ +

h5tget_offset_f

+ +

[ Top ] [ H5T ] [ Subroutines ]

+

NAME

+
  h5tget_offset_f
+
+

PURPOSE

+
  Retrieves the bit offset of the first significant bit.
+
+

INPUTS

+
  type_id       - datatype identifier
+
+

OUTPUTS

+
  offset        - offset value
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 7, 2001
+
+

SOURCE

+
  SUBROUTINE h5tget_offset_f(type_id, offset, hdferr)
+            IMPLICIT NONE
+            INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
+            INTEGER(SIZE_T), INTENT(OUT) :: offset ! Datatype bit offset of the
+                                           ! first significant bit
+            INTEGER, INTENT(OUT) :: hdferr        ! Error code
+
+ +
+ +

h5tget_order_f

+ +

[ Top ] [ H5T ] [ Subroutines ]

+

NAME

+
  h5tget_order_f
+
+

PURPOSE

+
  Returns the byte order of an atomic datatype.
+
+

INPUTS

+
  type_id       - datatype identifier
+
+

OUTPUTS

+
  order         - byte order for the datatype, possible
+                  values are:
+                    H5T_ORDER_LE_F
+                    H5T_ORDER_BE_F
+                    H5T_ORDER_VAX_F (not implemented yet)
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 7, 2001
+
+

SOURCE

+
  SUBROUTINE h5tget_order_f(type_id, order, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
+    INTEGER, INTENT(OUT) :: order
+                                    ! Datatype byte order, possible values are:
+                                    ! H5T_ORDER_LE_F
+                                    ! H5T_ORDER_BE_F
+                                    ! H5T_ORDER_VAX_F
+    INTEGER, INTENT(OUT) :: hdferr  ! Error code
+
+ +
+ +

h5tget_pad_f

+ +

[ Top ] [ H5T ] [ Subroutines ]

+

NAME

+
  h5tget_pad_f
+
+

PURPOSE

+
  Retrieves the padding type of the least and
+  most          -significant bit padding.
+
+

INPUTS

+
  type_id       - datatype identifier
+
+

OUTPUTS

+
  lsbpad        - least-significant bit padding type
+  msbpad        - most-significant bit padding type
+                  Possible values of padding type are:
+                    H5T_PAD_ERROR_F      = -1
+                    H5T_PAD_ZERO_F = 0
+                    H5T_PAD_ONE_F = 1
+                    H5T_PAD_BACKGROUND_F = 2
+                    H5T_PAD_NPAD_F      = 3
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 7, 2001
+
+

SOURCE

+
  SUBROUTINE h5tget_pad_f(type_id, lsbpad, msbpad, hdferr)
+            IMPLICIT NONE
+            INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
+            INTEGER, INTENT(OUT) :: lsbpad ! padding type of the
+                                           ! least significant bit
+            INTEGER, INTENT(OUT) :: msbpad ! padding type of the
+                                           ! most significant bit
+                                           ! Possible values of padding type are:
+                                           ! H5T__PAD_ZERO_F = 0
+                                           ! H5T__PAD_ONE_F = 1
+                                           ! H5T__PAD_BACKGROUND_F = 2
+                                           ! H5T_PAD_ERROR_F      = -1
+                                           ! H5T_PAD_NPAD_F      = 3
+
+            INTEGER, INTENT(OUT) :: hdferr        ! Error code
+
+ +
+ +

h5tget_precision_f

+ +

[ Top ] [ H5T ] [ Subroutines ]

+

NAME

+
  h5tget_precision_f
+
+

PURPOSE

+
  Returns the precision of an atomic datatype.
+
+

INPUTS

+
  type_id       - datatype identifier
+
+

OUTPUTS

+
  precision     - precision of the datatype
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 7, 2001
+
+

SOURCE

+
  SUBROUTINE h5tget_precision_f(type_id, precision, hdferr)
+            IMPLICIT NONE
+            INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
+            INTEGER(SIZE_T), INTENT(OUT) :: precision ! Datatype precision
+            INTEGER, INTENT(OUT) :: hdferr        ! Error code
+
+ +
+ +

h5tget_sign_f

+ +

[ Top ] [ H5T ] [ Subroutines ]

+

NAME

+
  h5tget_sign_f
+
+

PURPOSE

+
  Retrieves the sign type for an integer type.
+
+

INPUTS

+
  type_id       - datatype identifier
+
+

OUTPUTS

+
  sign          - sign type
+                  Possible values are:
+                    - Unsigned integer type 
+                        H5T_SGN_NONE_F = 0
+                    - Two's complement signed integer type
+                        H5T_SGN_2_F = 1
+                    - error value: H5T_SGN_ERROR_F=-1
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 7, 2001
+
+

SOURCE

+
  SUBROUTINE h5tget_sign_f(type_id, sign, hdferr)
+            IMPLICIT NONE
+            INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
+            INTEGER, INTENT(OUT) :: sign ! sign type for an integer type
+                                         !possible values are:
+                                         !Unsigned integer type H5T_SGN_NONE_F = 0
+                                         !Two's complement signed integer type
+                                         !H5T_SGN_2_F = 1
+                                         !or error value: H5T_SGN_ERROR_F=-1
+            INTEGER, INTENT(OUT) :: hdferr        ! Error code
+
+ +
+ +

h5tget_size_f

+ +

[ Top ] [ H5T ] [ Subroutines ]

+

NAME

+
  h5tget_size_f
+
+

PURPOSE

+
  Returns the size of a datatype.
+
+

INPUTS

+
  type_id       - datatype identifier
+
+

OUTPUTS

+
  size          - datatype size
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 7, 2001
+
+

SOURCE

+
  SUBROUTINE h5tget_size_f(type_id, size, hdferr)
+            IMPLICIT NONE
+            INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
+            INTEGER(SIZE_T), INTENT(OUT) :: size ! Datatype size
+            INTEGER, INTENT(OUT) :: hdferr        ! Error code
+
+ +
+ +

h5tget_strpad_f

+ +

[ Top ] [ H5T ] [ Subroutines ]

+

NAME

+
  h5tget_strpad_f
+
+

PURPOSE

+
  Retrieves the storage mechanism for a string datatype.
+
+

INPUTS

+
  type_id       - datatype identifier
+
+

OUTPUTS

+
  strpad        - storage method for a string datatype
+                  Possible values are:
+                    H5T_STR_NULLTERM_F,
+                    H5T_STR_NULLPAD_F,
+                    H5T_STR_SPACEPAD_F
+                    H5T_STR_ERROR_F
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 7, 2001
+
+

SOURCE

+
  SUBROUTINE h5tget_strpad_f(type_id, strpad, hdferr)
+            IMPLICIT NONE
+            INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
+            INTEGER, INTENT(OUT) :: strpad
+            INTEGER, INTENT(OUT) :: hdferr        ! Error code
+
+ +
+ +

h5tget_super_f

+ +

[ Top ] [ H5T ] [ Subroutines ]

+

NAME

+
  h5tget_super_f
+
+

PURPOSE

+
  Returns the base datatype from which a datatype is derived.
+
+

INPUTS

+
  type_id       - datatype identifier
+
+

OUTPUTS

+
  base_type_id          - identifier of the base type
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 7, 2001
+
+

SOURCE

+
  SUBROUTINE h5tget_super_f(type_id, base_type_id, hdferr)
+            IMPLICIT NONE
+            INTEGER(HID_T), INTENT(IN) :: type_id ! datatype identifier
+            INTEGER(HID_T), INTENT(OUT) :: base_type_id ! identifier of the datatype
+                                           ! from which datatype (type_id) was derived
+            INTEGER, INTENT(OUT) :: hdferr        ! Error code
+
+ +
+ +

h5tget_tag_f

+ +

[ Top ] [ H5T ] [ Subroutines ]

+

NAME

+
  h5tget_tag_f
+
+

PURPOSE

+
  Gets the tag associated with an opaque datatype.
+
+

INPUTS

+
  type_id       - identifier for opaque datatype
+
+

OUTPUTS

+
  tag           - unique ASCII string associated with opaque
+                  datatype
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 7, 2001
+
+

SOURCE

+
  SUBROUTINE h5tget_tag_f(type_id, tag,taglen, hdferr)
+            IMPLICIT NONE
+            INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
+            CHARACTER(LEN=*), INTENT(OUT) :: tag  ! Unique ASCII string with which
+                                                  !  the opaque datatype is to be tagged
+            INTEGER, INTENT(OUT) :: taglen        ! Length of tag
+            INTEGER(SIZE_T)      :: tag_size      ! Declared character length of tab 
+            INTEGER, INTENT(OUT) :: hdferr        ! Error code
+
+ +
+ +

h5tinsert_f

+ +

[ Top ] [ H5T ] [ Subroutines ]

+

NAME

+
  h5tinsert_f
+
+

PURPOSE

+
  Adds a new member to a compound datatype.
+
+

INPUTS

+
  type_id       - compound dattype identifier
+  name          - name of the field to insert
+  offset        - start of the member in an instance of
+                  the compound datatype
+  field_id      - datatype identifier of the field to insert
+
+

OUTPUTS

+
  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 7, 2001
+
+

SOURCE

+
  SUBROUTINE h5tinsert_f(type_id,  name, offset, field_id, hdferr)
+            IMPLICIT NONE
+            INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
+            CHARACTER(LEN=*), INTENT(IN) :: name !Name of the field to insert
+            INTEGER(SIZE_T), INTENT(IN) :: offset !start of the member in an instance of
+                                                   !the compound datatype
+            INTEGER(HID_T), INTENT(IN) :: field_id !datatype identifier of the new member
+
+            INTEGER, INTENT(OUT) :: hdferr        ! Error code
+
+ +
+ +

h5tis_variable_str_f

+ +

[ Top ] [ H5T ] [ Subroutines ]

+

NAME

+
  h5tis_variable_str_f
+
+

PURPOSE

+
  Determines whether a dattype is a variable string.
+
+

INPUTS

+
  type_id       - datartpe identifier
+
+

OUTPUTS

+
  status        - flag to indicate if datatype
+                  is a variable string
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  March 12, 2003
+
+

SOURCE

+
  SUBROUTINE h5tis_variable_str_f(type_id, status, hdferr)
+            IMPLICIT NONE
+            INTEGER(HID_T), INTENT(IN) :: type_id  ! Datatype identifier
+            LOGICAL, INTENT(OUT) :: status      ! Flag, idicates if datatype
+                                                ! is a variable string or not ( TRUE or
+                                                ! FALSE)
+            INTEGER, INTENT(OUT) :: hdferr      ! Error code
+
+ +
+ +

h5topen_f

+ +

[ Top ] [ H5T ] [ Subroutines ]

+

NAME

+
  h5topen_f
+
+

PURPOSE

+
  Opens named datatype.
+
+

INPUTS

+
  loc_id        - location identifier
+  name          - a datatype name
+
+

OUTPUTS

+
  type_id       - datatype identifier
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

OPTIONAL PARAMETERS

+
  tapl_id       - datatype access property list identifier.
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 7, 2001
+
+  Added optional parameter 'tapl_id' for compatability
+  with H5Topen2. April 9, 2009.
+
+

SOURCE

+
  SUBROUTINE h5topen_f(loc_id, name, type_id, hdferr, tapl_id)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: loc_id  ! File or group identifier
+    CHARACTER(LEN=*), INTENT(IN) :: name ! Datatype name within file or group
+    INTEGER(HID_T), INTENT(OUT) :: type_id  ! Datatype identifier
+    INTEGER, INTENT(OUT) :: hdferr ! Error code
+    INTEGER(HID_T), OPTIONAL, INTENT(IN) :: tapl_id ! datatype access property list identifier
+
+ +
+ +

h5tpack_f

+ +

[ Top ] [ H5T ] [ Subroutines ]

+

NAME

+
  h5tpack_f
+
+

PURPOSE

+
  Recursively removes padding from within a compound datatype.
+
+

INPUTS

+
  type_id       - compound datatype identifier
+
+

OUTPUTS

+
  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 7, 2001
+
+

SOURCE

+
  SUBROUTINE h5tpack_f(type_id, hdferr)
+            IMPLICIT NONE
+            INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
+            INTEGER, INTENT(OUT) :: hdferr        ! Error code
+
+ +
+ +

h5tset_cset_f

+ +

[ Top ] [ H5T ] [ Subroutines ]

+

NAME

+
  h5tset_cset_f
+
+

PURPOSE

+
  Sets character set to be used.
+
+

INPUTS

+
  type_id       - datatype identifier
+  cset          - character set type of a string datatype
+                    Possible values are:
+                     H5T_CSET_ASCII_F = 0
+                     H5T_CSET_UTF8_F
+
+

OUTPUTS

+
  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 7, 2001
+
+

SOURCE

+
  SUBROUTINE h5tset_cset_f(type_id, cset, hdferr)
+            IMPLICIT NONE
+            INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
+            INTEGER, INTENT(IN) :: cset !character set type of a string datatype
+                                           ! Possible values of padding type are:
+                                           ! H5T_CSET_ASCII_F = 0
+                                           ! H5T_CSET_UTF8_F
+            INTEGER, INTENT(OUT) :: hdferr        ! Error code
+
+ +
+ +

h5tset_ebias_f

+ +

[ Top ] [ H5T ] [ Subroutines ]

+

NAME

+
  h5tset_ebias_f
+
+

PURPOSE

+
  Sets the exponent bias of a floating-point type.
+
+

INPUTS

+
  type_id       - datatype identifier
+  ebias         - datatype exponent bias
+
+

OUTPUTS

+
  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 7, 2001
+
+

SOURCE

+
  SUBROUTINE h5tset_ebias_f(type_id, ebias, hdferr)
+            IMPLICIT NONE
+            INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
+            INTEGER(SIZE_T), INTENT(IN) :: ebias !Datatype exponent bias of a floating-point type
+            INTEGER, INTENT(OUT) :: hdferr        ! Error code
+
+ +
+ +

h5tset_fields_f

+ +

[ Top ] [ H5T ] [ Subroutines ]

+

NAME

+
  h5tset_fields_f
+
+

PURPOSE

+
  Sets locations and sizes of floating point bit fields.
+
+

INPUTS

+
  type_id       - datatype identifier
+  spos          - sign bit-position
+  epos          - exponent bit-position
+  esize         - size of exponent in bits
+  mpos          - mantissa position
+  msize         - size of mantissa in bits
+
+

OUTPUTS

+
  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 7, 2001
+
+

SOURCE

+
  SUBROUTINE h5tset_fields_f(type_id, spos, epos, esize, mpos, msize, hdferr)
+            IMPLICIT NONE
+            INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
+            INTEGER(SIZE_T), INTENT(IN) :: spos   ! sign bit-position
+            INTEGER(SIZE_T), INTENT(IN) :: epos   ! exponent bit-position
+            INTEGER(SIZE_T), INTENT(IN) :: esize  ! size of exponent in bits
+            INTEGER(SIZE_T), INTENT(IN) :: mpos   ! mantissa bit-position
+            INTEGER(SIZE_T), INTENT(IN) :: msize  ! size of mantissa in bits
+            INTEGER, INTENT(OUT) :: hdferr        ! Error code
+
+ +
+ +

h5tset_inpad_f

+ +

[ Top ] [ H5T ] [ Subroutines ]

+

NAME

+
  h5tset_inpad_f
+
+

PURPOSE

+
  Fills unused internal floating point bits.
+
+

INPUTS

+
  type_id       - datatype identifier
+  padtype       - padding type for unused bits
+                  Possible values of padding type are:
+                    H5T_PAD_ZERO_F = 0
+                    H5T_PAD_ONE_F = 1
+                    H5T_PAD_BACKGROUND_F = 2
+
+

OUTPUTS

+
  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 7, 2001
+
+

SOURCE

+
  SUBROUTINE h5tset_inpad_f(type_id, padtype, hdferr)
+            IMPLICIT NONE
+            INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
+            INTEGER, INTENT(IN) :: padtype ! padding type for unused bits
+                                           ! in floating-point datatypes.
+                                           ! Possible values of padding type are:
+                                           ! H5T__PAD_ZERO_F = 0
+                                           ! H5T__PAD_ONE_F = 1
+                                           ! H5T__PAD_BACKGROUND_F = 2
+            INTEGER, INTENT(OUT) :: hdferr        ! Error code
+
+ +
+ +

h5tset_norm_f

+ +

[ Top ] [ H5T ] [ Subroutines ]

+

NAME

+
  h5tset_norm_f
+
+

PURPOSE

+
  Sets the mantissa normalization of a floating-point datatype.
+
+

INPUTS

+
  type_id       - datatype identifier
+  norm          - normalization types, valid values are:
+                    H5T_NORM_IMPLIED_F(0)
+                    H5T_NORM_MSBSET_F(1)
+                    H5T_NORM_NONE_F(2)
+
+

OUTPUTS

+
  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 7, 2001
+
+

SOURCE

+
  SUBROUTINE h5tset_norm_f(type_id, norm, hdferr)
+            IMPLICIT NONE
+            INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
+            INTEGER, INTENT(IN) :: norm !mantissa normalization of a floating-point datatype
+                                         !Valid normalization types are:
+                                         !H5T_NORM_IMPLIED_F(0),MSB of mantissa is not
+                                         !stored, always 1,  H5T_NORM_MSBSET_F(1), MSB of
+                                         !mantissa is always 1, H5T_NORM_NONE_F(2)
+                                         !Mantissa is not normalize
+            INTEGER, INTENT(OUT) :: hdferr        ! Error code
+
+ +
+ +

h5tset_offset_f

+ +

[ Top ] [ H5T ] [ Subroutines ]

+

NAME

+
  h5tset_offset_f
+
+

PURPOSE

+
  Sets the bit offset of the first significant bit.
+
+

INPUTS

+
  type_id       - datatype identifier
+  offset        - offset value
+
+

OUTPUTS

+
  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 7, 2001
+
+

SOURCE

+
  SUBROUTINE h5tset_offset_f(type_id, offset, hdferr)
+            IMPLICIT NONE
+            INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
+            INTEGER(SIZE_T), INTENT(IN) :: offset ! Datatype bit offset of the
+                                           ! first significant bit
+            INTEGER, INTENT(OUT) :: hdferr        ! Error code
+
+ +
+ +

h5tset_order_f

+ +

[ Top ] [ H5T ] [ Subroutines ]

+

NAME

+
  h5tset_order_f
+
+

PURPOSE

+
  Sets the byte ordering of an atomic datatype.
+
+

INPUTS

+
  type_id       - datatype identifier
+  order         - datatype byte order Possible values are:
+                    H5T_ORDER_LE_F
+                    H5T_ORDER_BE_F
+                    H5T_ORDER_VAX_F (not implemented yet)
+
+

OUTPUTS

+
  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 7, 2001
+
+

SOURCE

+
  SUBROUTINE h5tset_order_f(type_id, order, hdferr)
+    IMPLICIT NONE
+    INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
+    INTEGER, INTENT(IN) :: order   ! Datatype byte order, possible values
+                                   ! are:
+                                   ! H5T_ORDER_LE_F
+                                   ! H5T_ORDER_BE_F
+                                   ! H5T_ORDER_VAX_F
+    INTEGER, INTENT(OUT) :: hdferr ! Error code
+
+ +
+ +

h5tset_pad_f

+ +

[ Top ] [ H5T ] [ Subroutines ]

+

NAME

+
  h5tset_pad_f
+
+

PURPOSE

+
  Sets the least and most-significant bits padding types.
+
+

INPUTS

+
  type_id       - datatype identifier
+  lsbpad        - least-significant bit padding type
+  msbpad        - most-significant bit padding type
+                  Possible values of padding type are:
+                    H5T_PAD_ERROR_F      = -1
+                    H5T_PAD_ZERO_F = 0
+                    H5T_PAD_ONE_F = 1
+                    H5T_PAD_BACKGROUND_F = 2
+                    H5T_PAD_NPAD_F      = 3
+
+

OUTPUTS

+
  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 7, 2001
+
+

SOURCE

+
  SUBROUTINE h5tset_pad_f(type_id, lsbpad, msbpad, hdferr)
+            IMPLICIT NONE
+            INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
+            INTEGER, INTENT(IN) :: lsbpad ! padding type of the
+                                           ! least significant bit
+            INTEGER, INTENT(IN) :: msbpad ! padding type of the
+                                           ! most significant bit
+                                           ! Possible values of padding type are:
+                                           ! H5T_PAD_ZERO_F = 0
+                                           ! H5T_PAD_ONE_F = 1
+                                           ! H5T_PAD_BACKGROUND_F = 2
+                                           ! H5T_PAD_ERROR_F      = -1
+                                           ! H5T_PAD_NPAD_F      = 3
+            INTEGER, INTENT(OUT) :: hdferr        ! Error code
+
+ +
+ +

h5tset_precision_f

+ +

[ Top ] [ H5T ] [ Subroutines ]

+

NAME

+
  h5tset_precision_f
+
+

PURPOSE

+
  Sets the precision of an atomic datatype.
+
+

INPUTS

+
  type_id       - datatype identifier
+  precision     - datatype precision
+
+

OUTPUTS

+
  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 7, 2001
+
+

SOURCE

+
  SUBROUTINE h5tset_precision_f(type_id, precision, hdferr)
+            IMPLICIT NONE
+            INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
+            INTEGER(SIZE_T), INTENT(IN) :: precision ! Datatype precision
+            INTEGER, INTENT(OUT) :: hdferr        ! Error code
+
+ +
+ +

h5tset_sign_f

+ +

[ Top ] [ H5T ] [ Subroutines ]

+

NAME

+
  h5tset_sign_f
+
+

PURPOSE

+
  Sets the sign proprety for an integer type.
+
+

INPUTS

+
  type_id       - datatype identifier
+  sign          - sign type
+                  Possible values are:
+                    - Unsigned integer type 
+                        H5T_SGN_NONE_F = 0
+                    - Two's complement signed integer type
+                        H5T_SGN_2_F = 1
+                    - error value: H5T_SGN_ERROR_F=-1
+
+

OUTPUTS

+
  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 7, 2001
+
+

SOURCE

+
  SUBROUTINE h5tset_sign_f(type_id, sign, hdferr)
+            IMPLICIT NONE
+            INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
+            INTEGER, INTENT(IN) :: sign !sign type for an integer type
+                                         !possible values are:
+                                         !Unsigned integer type H5T_SGN_NONE_F = 0
+                                         !Two's complement signed integer type
+                                         !H5T_SGN_2_F = 1
+                                         !or error value: H5T_SGN_ERROR_F=-1
+            INTEGER, INTENT(OUT) :: hdferr        ! Error code
+
+ +
+ +

h5tset_size_f

+ +

[ Top ] [ H5T ] [ Subroutines ]

+

NAME

+
  h5tset_size_f
+
+

PURPOSE

+
  Sets the total size for an atomic datatype.
+
+

INPUTS

+
  type_id       - datatype identifier
+  size          - size of the datatype
+
+

OUTPUTS

+
  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 7, 2001
+
+

SOURCE

+
  SUBROUTINE h5tset_size_f(type_id, size, hdferr)
+            IMPLICIT NONE
+            INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
+            INTEGER(SIZE_T), INTENT(IN) :: size ! Datatype size
+            INTEGER, INTENT(OUT) :: hdferr        ! Error code
+
+ +
+ +

h5tset_strpad_f

+ +

[ Top ] [ H5T ] [ Subroutines ]

+

NAME

+
  h5tset_strpad_f
+
+

PURPOSE

+
  Defines the storage mechanism for character strings.
+
+

INPUTS

+
  type_id       - datatype identifier
+  strpad        - storage method for a string datatype
+                  Possible values are:
+                    H5T_STR_NULLTERM_F,
+                    H5T_STR_NULLPAD_F,
+                    H5T_STR_SPACEPAD_F
+                    H5T_STR_ERROR_F
+
+

OUTPUTS

+
  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 7, 2001
+
+

SOURCE

+
  SUBROUTINE h5tset_strpad_f(type_id, strpad, hdferr)
+            IMPLICIT NONE
+            INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
+            INTEGER, INTENT(IN) :: strpad ! string padding method for a string datatype
+            INTEGER, INTENT(OUT) :: hdferr        ! Error code
+
+ +
+ +

h5tset_tag_f

+ +

[ Top ] [ H5T ] [ Subroutines ]

+

NAME

+
  h5tset_tag_f
+
+

PURPOSE

+
  Tags an opaque datatype.
+
+

INPUTS

+
  type_id       - identifier for opaque datatype
+  tag           - unique ASCII string with which the opaque
+                  datatype is to be tagged.
+
+

OUTPUTS

+
  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  March 7, 2001
+
+

SOURCE

+
  SUBROUTINE h5tset_tag_f(type_id, tag, hdferr)
+            IMPLICIT NONE
+            INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier
+            CHARACTER(LEN=*), INTENT(IN) :: tag !Unique ASCII string with which
+                                                !the opaque datatype is to be tagged
+            INTEGER, INTENT(OUT) :: hdferr        ! Error code
+
+ +
+ +

h5tvlen_create_f

+ +

[ Top ] [ H5T ] [ Subroutines ]

+

NAME

+
  h5tvlen_create_f
+
+

PURPOSE

+
  Creates a new variable-length datatype.
+
+

INPUTS

+
  type_id       - identifier iof base datatype
+
+

OUTPUTS

+
  vltype_id     - identifier for VL datatype
+  hdferr        - Returns 0 if successful and -1 if fails
+
+

AUTHOR

+
  Elena Pourmal
+  Wednesday, October 23, 2002
+
+

NOTES

+
  Only basic Fortran base datatypes are supported
+
+

SOURCE

+
  SUBROUTINE h5tvlen_create_f(type_id, vltype_id, hdferr)
+            IMPLICIT NONE
+            INTEGER(HID_T), INTENT(IN)  :: type_id    ! Datatype identifier
+            INTEGER(HID_T), INTENT(OUT) :: vltype_id  ! VL datatype identifier
+            INTEGER, INTENT(OUT) :: hdferr            ! Error code
+
+ +
+ + + diff --git a/fortran/doc/DevelGuide/src/H5Zf_c.html b/fortran/doc/DevelGuide/src/H5Zf_c.html new file mode 100644 index 0000000..2973548 --- /dev/null +++ b/fortran/doc/DevelGuide/src/H5Zf_c.html @@ -0,0 +1,41 @@ + + + + + + + +./src/H5Zf.c + + + + + +
+
+ +

H5Zf

+ +

[ Top ] [ Modules ]

+

PURPOSE

+
   This file contains C stubs for H5Z Fortran APIs
+
+ +
+ + + diff --git a/fortran/doc/DevelGuide/src/H5Zff_f90.html b/fortran/doc/DevelGuide/src/H5Zff_f90.html new file mode 100644 index 0000000..8ccd0ae --- /dev/null +++ b/fortran/doc/DevelGuide/src/H5Zff_f90.html @@ -0,0 +1,173 @@ + + + + + + + +./src/H5Zff.f90 + + + + + +
+
+ +

H5Z

+ +

[ Top ] [ Modules ]

+

NAME

+
  MODULE H5Z
+
+

PURPOSE

+
  This file contains Fortran interfaces for H5Z functions. It includes
+  all the functions that are independent on whether the Fortran 2003 functions
+  are enabled or disabled.
+
+

NOTES

+
                         *** IMPORTANT ***
+  If you add a new H5Z function you must add the function name to the
+  Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory.
+  This is needed for Windows based operating systems.
+
+ +
+ +

h5zfilter_avail_f

+ +

[ Top ] [ H5Z ] [ Subroutines ]

+

NAME

+
  h5zfilter_avail_f
+
+

PURPOSE

+
  Queries if filter is available
+
+

INPUTS

+
  filter        - filter
+
+

OUTPUTS

+
  status        - status; .TRUE. if filter is available,
+                  .FALSE. otherwise
+  hdferr:       - error code
+                   Success:  0
+                   Failure: -1
+
+

AUTHOR

+
  Elena Pourmal
+  March 12, 2003
+
+

SOURCE

+
  SUBROUTINE h5zfilter_avail_f(filter, status, hdferr)
+    IMPLICIT NONE
+    INTEGER, INTENT(IN)  :: filter      ! Filter; may be one of the following:
+                                        !   H5Z_FILTER_DEFLATE_F
+                                        !   H5Z_FILTER_SZIP_F
+                                        !   H5Z_FILTER_NBIT_F
+                                        !   H5Z_FILTER_SCALEOFFSET_F
+                                        !   H5Z_FILTER_SHUFFLE_F
+                                        !   H5Z_FILTER_FLETCHER32_F
+    LOGICAL, INTENT(OUT) :: status      ! Flag, idicates if filter
+                                        ! is availble  not ( TRUE or
+                                        ! FALSE)
+    INTEGER, INTENT(OUT) :: hdferr      ! Error code
+
+ +
+ +

h5zget_filter_info_f

+ +

[ Top ] [ H5Z ] [ Subroutines ]

+

NAME

+
  h5zget_filter_info_f
+
+

PURPOSE

+
  Queries if filter has its encoder and/or decoder
+  available
+
+

INPUTS

+
  filter        - filter
+
+

OUTPUTS

+
  config_flags  - Bit vector possibly containing the
+                  following values:
+                     H5Z_FILTER_ENCODE_ENABLED_F
+                     H5Z_FILTER_DECODE_ENABLED_F
+  hdferr:       - error code
+                   Success:  0
+                   Failure: -1
+
+

AUTHOR

+
  Nat Furrer and James Laird
+  June 16, 2004
+
+

SOURCE

+
  SUBROUTINE h5zget_filter_info_f(filter, config_flags, hdferr)
+    IMPLICIT NONE
+    INTEGER, INTENT(IN)  :: filter      ! Filter; may be one of the following:
+                                        !   H5Z_FILTER_DEFLATE_F
+                                        !   H5Z_FILTER_SZIP_F
+                                        !   H5Z_FILTER_NBIT_F
+                                        !   H5Z_FILTER_SCALEOFFSET_F
+                                        !   H5Z_FILTER_SHUFFLE_F
+                                        !   H5Z_FILTER_FLETCHER32_F
+    INTEGER, INTENT(OUT) :: config_flags! Flag, indicates if filter
+                                        ! has its encoder and/or decoder
+                                        ! available
+    INTEGER, INTENT(OUT) :: hdferr      ! Error code
+
+ +
+ +

h5zunregister_f

+ +

[ Top ] [ H5Z ] [ Subroutines ]

+

NAME

+
  h5zunregister_f
+
+

PURPOSE

+
  Unregisters specified filetr
+
+

INPUTS

+
  filter - filter; may have one of the following values:
+            H5Z_FILTER_DEFLATE_F
+            H5Z_FILTER_SZIP_F
+            H5Z_FILTER_NBIT_F
+            H5Z_FILTER_SCALEOFFSET_F
+            H5Z_FILTER_SHUFFLE_F
+            H5Z_FILTER_FLETCHER32_F
+
+

OUTPUTS

+
  hdferr - error code
+            Success:  0
+            Failure: -1
+
+

AUTHOR

+
  Elena Pourmal
+  March 12, 2003
+
+

SOURCE

+
  SUBROUTINE h5zunregister_f(filter, hdferr)
+    IMPLICIT NONE
+    INTEGER, INTENT(IN)  :: filter
+    INTEGER, INTENT(OUT) :: hdferr  ! Error code
+
+ +
+ + + diff --git a/fortran/doc/DevelGuide/src/H5_DBLE_InterfaceExclude_f90.html b/fortran/doc/DevelGuide/src/H5_DBLE_InterfaceExclude_f90.html new file mode 100644 index 0000000..4e51e7f --- /dev/null +++ b/fortran/doc/DevelGuide/src/H5_DBLE_InterfaceExclude_f90.html @@ -0,0 +1,53 @@ + + + + + + + +./src/H5_DBLE_InterfaceExclude.f90 + + + + + +
+
+ +

src/H5_DBLE_InterfaceExclude.f90

+ +

[ Top ] [ Modules ]

+

NAME

+
   H5_DBLE_INTERFACE
+
+

FUNCTION

+
   This module is used for when the default REAL is of type DOUBLE PRECISION.
+   We do not include the double precision interfaces if the defaut REAL is
+   DOUBLE PRECISION since this would lead to a non-unique conflict with the
+   generic interfaces declared as REAL and those declared as DOUBLE PRECISION.
+
+

NOTES

+
   Empty module.
+
+

AUTHOR

+
  M. Scot Breitenfeld
+
+ +
+ + + diff --git a/fortran/doc/DevelGuide/src/H5_DBLE_InterfaceInclude_f90.html b/fortran/doc/DevelGuide/src/H5_DBLE_InterfaceInclude_f90.html new file mode 100644 index 0000000..5a71d52 --- /dev/null +++ b/fortran/doc/DevelGuide/src/H5_DBLE_InterfaceInclude_f90.html @@ -0,0 +1,54 @@ + + + + + + + +./src/H5_DBLE_InterfaceInclude.f90 + + + + + +
+
+ +

src/H5_DBLE_InterfaceInclude.f90

+ +

[ Top ] [ Modules ]

+

NAME

+
   H5_DBLE_INTERFACE
+
+

FUNCTION

+
   This module is used for when the default REAL is not of the type DOUBLE PRECISION.
+   We only do not include the double precision interfaces if the defaut REAL is
+   DOUBLE PRECISION since this would lead to a non-unique conflict with the
+   generic interfaces declared as REAL. Otherwise it is okay to include the interfaces.
+
+

NOTES

+
   This module contains all the DOUBLE PRECISION interfaces and corresponding subroutines
+   from the HDF function catagory H5A, H5D and H5P.
+
+

AUTHOR

+
  M. Scot Breitenfeld
+
+ +
+ + + diff --git a/fortran/doc/DevelGuide/src/H5_f_c.html b/fortran/doc/DevelGuide/src/H5_f_c.html new file mode 100644 index 0000000..2bdbce1 --- /dev/null +++ b/fortran/doc/DevelGuide/src/H5_f_c.html @@ -0,0 +1,41 @@ + + + + + + + +./src/H5_f.c + + + + + +
+
+ +

fortran/src/H5_f.c

+ +

[ Top ] [ Modules ]

+

FUNCTION

+
   This file contains C stubs for H5 Fortran APIs
+
+ +
+ + + diff --git a/fortran/doc/DevelGuide/src/H5_ff_F03_f90.html b/fortran/doc/DevelGuide/src/H5_ff_F03_f90.html new file mode 100644 index 0000000..17f07c1 --- /dev/null +++ b/fortran/doc/DevelGuide/src/H5_ff_F03_f90.html @@ -0,0 +1,83 @@ + + + + + + + +./src/H5_ff_F03.f90 + + + + + +
+
+ +

H5LIB_PROVISIONAL

+ +

[ Top ] [ Modules ]

+

NAME

+
  MODULE H5LIB_PROVISIONAL
+
+

PURPOSE

+
  This file contains helper functions for Fortran 2003 features and is
+  only compiled when Fortran 2003 features are enabled, otherwise
+  the file H5_ff_F90.f90 is compiled.
+
+

NOTES

+
                         *** IMPORTANT ***
+  If you add a new function you must add the function name to the
+  Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory.
+  This is needed for Windows based operating systems.
+
+ +
+ +

h5offsetof

+ +

[ Top ] [ H5LIB_PROVISIONAL ] [ Functions ]

+

NAME

+
  h5offsetof
+
+

PURPOSE

+
  Computes the offset in memory
+
+

INPUTS

+
  start - starting pointer address
+  end   - ending pointer address
+
+

OUTPUTS

+
  offset - offset
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  Augest 25, 2008
+
+

SOURCE

+
  FUNCTION h5offsetof(start,end) RESULT(offset)
+    USE, INTRINSIC :: ISO_C_BINDING
+    USE H5GLOBAL
+    IMPLICIT NONE
+    INTEGER(SIZE_T) :: offset
+    TYPE(C_PTR), VALUE, INTENT(IN) :: start, end
+
+ +
+ + + diff --git a/fortran/doc/DevelGuide/src/H5_ff_F90_f90.html b/fortran/doc/DevelGuide/src/H5_ff_F90_f90.html new file mode 100644 index 0000000..c310ef2 --- /dev/null +++ b/fortran/doc/DevelGuide/src/H5_ff_F90_f90.html @@ -0,0 +1,48 @@ + + + + + + + +./src/H5_ff_F90.f90 + + + + + +
+
+ +

H5LIB_PROVISIONAL (F90)

+ +

[ Top ] [ Modules ]

+

NAME

+
  MODULE H5LIB_PROVISIONAL
+
+

FILE

+
  fortran/src/H5_ff_F90.f90
+
+

PURPOSE

+
  This file is a dummy module for when Fortran 2003 features are not enabled.
+  It is compiled in place of H5_ff_F03.f90 and is empty.
+
+ +
+ + + diff --git a/fortran/doc/DevelGuide/src/H5_ff_f90.html b/fortran/doc/DevelGuide/src/H5_ff_f90.html new file mode 100644 index 0000000..021c7c5 --- /dev/null +++ b/fortran/doc/DevelGuide/src/H5_ff_f90.html @@ -0,0 +1,269 @@ + + + + + + + +./src/H5_ff.f90 + + + + + +
+
+ +

H5LIB

+ +

[ Top ] [ Modules ]

+

NAME

+
  MODULE H5LIB
+
+

PURPOSE

+
  This module provides fortran specific helper functions for the HDF library
+
+

USES

+
  H5LIB_PROVISIONAL - This module provides helper functions for Fortran 2003
+                      only features. If Fortran 2003 functions are enabled then
+                      H5_ff_F03.f90 is compiled, else H5_ff_F90.f90,
+                      which is just a place holder blank module, is compiled.
+
+

NOTES

+
                         *** IMPORTANT ***
+  If you add a new function you must add the function name to the
+  Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory.
+  This is needed for Windows based operating systems.
+
+ +
+ +

h5check_version_f

+ +

[ Top ] [ H5LIB ] [ Subroutines ]

+

NAME

+
  h5check_version_f
+
+

PURPOSE

+
  Verifies that library versions are consistent.
+
+

INPUTS

+
  majnum               - major version of the library
+  minum                - minor version of the library
+  relnum               - release version of the library
+
+

OUTPUTS

+
  error                - error code
+                          Success:  0
+                          Failure:  application aborts
+
+

AUTHOR

+
  Elena Pourmal
+  September 24, 2002
+
+

SOURCE

+
  SUBROUTINE h5check_version_f(majnum, minnum, relnum, error)
+    USE H5GLOBAL
+    IMPLICIT NONE
+    INTEGER, INTENT(IN) :: majnum, minnum, relnum
+    INTEGER, INTENT(OUT) :: error
+
+ +
+ +

h5close_f

+ +

[ Top ] [ H5LIB ] [ Subroutines ]

+

NAME

+
  h5close_f
+
+

PURPOSE

+
  Closes the HDF5 library and Fortran90 interface.
+
+

OUTPUTS

+
  error - error code
+            Success:  0
+            Failure: -1
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  February 28, 2001
+
+

SOURCE

+
  SUBROUTINE h5close_f(error)
+    USE H5GLOBAL
+    IMPLICIT NONE
+    INTEGER, INTENT(OUT) :: error
+
+ +
+ +

h5dont_atexit_f

+ +

[ Top ] [ H5LIB ] [ Subroutines ]

+

NAME

+
  h5dont_atexit_f
+
+

PURPOSE

+
  Instructs library not to install atexit cleanup routine.
+
+

OUTPUTS

+
  error  - error code
+             Success:  0
+             Failure: -1
+
+

AUTHOR

+
  Elena Pourmal
+  September 24, 2002
+
+

SOURCE

+
  SUBROUTINE h5dont_atexit_f(error)
+    USE H5GLOBAL
+    IMPLICIT NONE
+    INTEGER, INTENT(OUT) :: error
+
+ +
+ +

h5garbage_collect_f

+ +

[ Top ] [ H5LIB ] [ Subroutines ]

+

NAME

+
  h5garbage_collect_f
+
+

PURPOSE

+
  Garbage collects on all free-lists of all types.
+
+

OUTPUTS

+
  error  - error code
+             Success:  0
+             Failure: -1
+
+

AUTHOR

+
  Elena Pourmal
+  September 24, 2002
+
+

SOURCE

+
  SUBROUTINE h5garbage_collect_f(error)
+    USE H5GLOBAL
+    IMPLICIT NONE
+    INTEGER, INTENT(OUT) :: error
+
+ +
+ +

h5get_libversion_f

+ +

[ Top ] [ H5LIB ] [ Subroutines ]

+

NAME

+
  h5get_libversion_f
+
+

PURPOSE

+
  Returns the HDF5 LIbrary release number
+
+

OUTPUTS

+
  majnum               - major version of the library
+  minum                - minor version of the library
+  relnum               - release version of the library
+  error                - error code
+                           Success:  0
+                           Failure: -1
+
+

AUTHOR

+
  Elena Pourmal
+  September 24, 2002
+
+

SOURCE

+
  SUBROUTINE h5get_libversion_f(majnum, minnum, relnum, error)
+    USE H5GLOBAL
+    IMPLICIT NONE
+    INTEGER, INTENT(OUT) :: majnum, minnum, relnum, error
+
+ +
+ +

h5kind_to_type

+ +

[ Top ] [ H5LIB ] [ Functions ]

+

NAME

+
  h5kind_to_type
+
+

PURPOSE

+
  Converts the KIND to the correct HDF type
+
+

INPUTS

+
  kind    - Fortran KIND parameter
+  flag    - whether KIND is of type INTEGER or REAL:
+              H5_INTEGER_KIND - integer
+              H5_REAL_KIND    - real
+
+

OUTPUTS

+
  h5_type - returns the type
+
+

AUTHOR

+
  M. Scot Breitenfeld
+  Augest 25, 2008
+
+

SOURCE

+
  INTEGER(HID_T) FUNCTION h5kind_to_type(kind, flag) RESULT(h5_type)
+    USE H5GLOBAL
+    IMPLICIT NONE
+    INTEGER, INTENT(IN) :: kind
+    INTEGER, INTENT(IN) :: flag
+
+ +
+ +

h5open_f

+ +

[ Top ] [ H5LIB ] [ Subroutines ]

+

NAME

+
  h5open_f
+
+

PURPOSE

+
  Initializes the HDF5 library and Fortran90 interface.
+
+

OUTPUTS

+
  error - error code
+            Success:  0
+            Failure: -1
+
+

AUTHOR

+
  Elena Pourmal
+  August 12, 1999
+
+

HISTORY

+
  Explicit Fortran interfaces were added for
+  called C functions (it is needed for Windows
+  port).  February 28, 2001
+
+

SOURCE

+
  SUBROUTINE h5open_f(error)
+    USE H5GLOBAL
+    IMPLICIT NONE
+    INTEGER, INTENT(OUT) :: error
+
+ +
+ + + diff --git a/fortran/doc/DevelGuide/src/H5f90global_f90.html b/fortran/doc/DevelGuide/src/H5f90global_f90.html new file mode 100644 index 0000000..587b6d0 --- /dev/null +++ b/fortran/doc/DevelGuide/src/H5f90global_f90.html @@ -0,0 +1,61 @@ + + + + + + + +./src/H5f90global.f90 + + + + + +
+
+ +

H5GLOBAL

+ +

[ Top ] [ Modules ]

+

NAME

+
  MODULE H5GLOBAL
+
+

FILE

+
  src/fortran/H5f90global.f90
+
+

PURPOSE

+
  This module is used to pass C stubs for H5 Fortran APIs. The C stubs are
+  packed into arrays in H5_f.c and these arrays are then passed to Fortran.
+  This module then uses EQUIVALENCE to assign elements of the arrays to
+  Fortran equivalent C stubs.
+
+

NOTES

+
  The size of the C arrays in H5_f.c has to match the values of the variables
+  declared as PARAMETER, hence if the size of an array in H5_f.c is changed
+  then the PARAMETER of that corresponding array in Fortran must also be changed.
+
+

USES

+
  H5FORTRAN_TYPES       - This module is generated at run time. See
+
+

AUTHOR

+
  Elena Pourmal
+
+ +
+ + + diff --git a/fortran/doc/DevelGuide/src/H5f90kit_c.html b/fortran/doc/DevelGuide/src/H5f90kit_c.html new file mode 100644 index 0000000..1329a87 --- /dev/null +++ b/fortran/doc/DevelGuide/src/H5f90kit_c.html @@ -0,0 +1,44 @@ + + + + + + + +./src/H5f90kit.c + + + + + +
+
+ +

H5f90kit

+ +

[ Top ] [ Modules ]

+

PURPOSE

+
   Routines from HDF4 to deal with C-FORTRAN issues:
+
+   HD5f2cstring   -- convert a Fortran string to a C string
+   HD5packFstring -- convert a C string into a Fortran string
+
+ +
+ + + diff --git a/fortran/doc/DevelGuide/src/H5match_types_c.html b/fortran/doc/DevelGuide/src/H5match_types_c.html new file mode 100644 index 0000000..083319a --- /dev/null +++ b/fortran/doc/DevelGuide/src/H5match_types_c.html @@ -0,0 +1,49 @@ + + + + + + + +./src/H5match_types.c + + + + + +
+
+ +

H5match_types

+ +

[ Top ] [ Procedures ]

+

NAME

+
  Executable: H5match_types
+
+

FILE

+
  fortran/src/H5match_types.c
+
+

PURPOSE

+
  C Program to match C types to Fortran types.
+  Creates the files H5f90i_gen.h for the C code and
+  H5fortran_types.f90 for the Fortran code.
+
+ +
+ + + diff --git a/fortran/doc/DevelGuide/src/H5test_kind_SIZEOF_f90.html b/fortran/doc/DevelGuide/src/H5test_kind_SIZEOF_f90.html new file mode 100644 index 0000000..3494db0 --- /dev/null +++ b/fortran/doc/DevelGuide/src/H5test_kind_SIZEOF_f90.html @@ -0,0 +1,61 @@ + + + + + + + +./src/H5test_kind_SIZEOF.f90 + + + + + +
+
+ +

H5test_kind_SIZEOF

+ +

[ Top ] [ Procedures ]

+

NAME

+
  Executable: H5test_kind
+
+

FILE

+
  fortran/src/H5test_kind_SIZEOF.f90
+
+

PURPOSE

+
  This stand alone program is used at build time to generate the program
+  H5fortran_detect.f90. It cycles through all the available KIND parameters for
+  integers and reals. The appropriate program and subroutines are then generated
+  depending on which of the KIND values are found.
+
+

NOTES

+
  This program is used in place of H5test_kind.f90 when the Fortran intrinsic
+  function SIZEOF is available. It generates code that makes use of SIZEOF in
+  H5fortran_detect.f90 which is a portable solution.
+
+  The availability of SIZEOF is checked at configure time and the TRUE/FALSE
+  condition is set in the configure variable "FORTRAN_HAVE_SIZEOF".
+
+

AUTHOR

+
  M. Scot Breitenfeld
+
+ +
+ + + diff --git a/fortran/doc/DevelGuide/src/H5test_kind_f90.html b/fortran/doc/DevelGuide/src/H5test_kind_f90.html new file mode 100644 index 0000000..c08e488 --- /dev/null +++ b/fortran/doc/DevelGuide/src/H5test_kind_f90.html @@ -0,0 +1,62 @@ + + + + + + + +./src/H5test_kind.f90 + + + + + +
+
+ +

H5test_kind

+ +

[ Top ] [ Procedures ]

+

NAME

+
  Executable: H5test_kind
+
+

FILE

+
  fortran/src/H5test_kind.f90
+
+

PURPOSE

+
  This stand alone program is used at build time to generate the program
+  H5fortran_detect.f90. It cycles through all the available KIND parameters for
+  integers and reals. The appropriate program and subroutines are then generated
+  depending on which of the KIND values are found.
+
+

NOTES

+
  This program is depreciated in favor of H5test_kind_SIZEOF.f90 and is only
+  used when the Fortran intrinsic function SIZEOF is not available. It generates
+  code that does not make use of SIZEOF in H5fortran_detect.f90 which is less
+  portable in comparison to using SIZEOF.
+
+  The availability of SIZEOF is checked at configure time and the TRUE/FALSE
+  condition is set in the configure variable "FORTRAN_HAVE_SIZEOF".
+
+

AUTHOR

+
  Elena Pourma
+
+ +
+ + + diff --git a/fortran/doc/DevelGuide/src/HDF5_f90.html b/fortran/doc/DevelGuide/src/HDF5_f90.html new file mode 100644 index 0000000..1490c7c --- /dev/null +++ b/fortran/doc/DevelGuide/src/HDF5_f90.html @@ -0,0 +1,47 @@ + + + + + + + +./src/HDF5.f90 + + + + + +
+
+ +

HDF5

+ +

[ Top ] [ Modules ]

+

NAME

+
  MODULE HDF5
+
+

FILE

+
  src/fortran/src/HDF5.f90
+
+

PURPOSE

+
  This is the main module used for linking to the Fortran HDF library.
+
+ +
+ + + diff --git a/fortran/doc/DevelGuide/src/HDF5mpio_f90.html b/fortran/doc/DevelGuide/src/HDF5mpio_f90.html new file mode 100644 index 0000000..9ef5f32 --- /dev/null +++ b/fortran/doc/DevelGuide/src/HDF5mpio_f90.html @@ -0,0 +1,45 @@ + + + + + + + +./src/HDF5mpio.f90 + + + + + +
+
+ +

HDF5 (mpio)

+ +

[ Top ] [ Modules ]

+

NAME

+
  HDF5
+
+

PURPOSE

+
  This is the main module used for linking to the Fortran parallel HDF library.
+  This file replaces HDF5.f90 when compiling the parallel library.
+
+ +
+ + + diff --git a/fortran/doc/DevelGuide/test/fflush1_f90.html b/fortran/doc/DevelGuide/test/fflush1_f90.html new file mode 100644 index 0000000..eaab841 --- /dev/null +++ b/fortran/doc/DevelGuide/test/fflush1_f90.html @@ -0,0 +1,47 @@ + + + + + + + +./test/fflush1.f90 + + + + + +
+
+ +

fortran/test/fflush1.f90

+ +

[ Top ] [ Modules ]

+

NAME

+
  FFLUSH1EXAMPLE
+
+

FUNCTION

+
  This is the first half of a two-part test that makes sure
+  that a file can be read after an application crashes as long
+  as the file was flushed first.  We simulate by exit the 
+  the program using stop statement
+
+ +
+ + + diff --git a/fortran/doc/DevelGuide/test/fflush2_f90.html b/fortran/doc/DevelGuide/test/fflush2_f90.html new file mode 100644 index 0000000..23b7797 --- /dev/null +++ b/fortran/doc/DevelGuide/test/fflush2_f90.html @@ -0,0 +1,47 @@ + + + + + + + +./test/fflush2.f90 + + + + + +
+
+ +

fortran/test/fflush2.f90

+ +

[ Top ] [ Modules ]

+

NAME

+
  fflush2.f90
+
+

FUNCTION

+
  This is the second half of a two-part test that makes sure
+  that a file can be read after an application crashes as long
+  as the file was flushed first.  This half tries to read the
+  file created by the first half.
+
+ +
+ + + diff --git a/fortran/doc/DevelGuide/test/fortranlib_test_1_8_f90.html b/fortran/doc/DevelGuide/test/fortranlib_test_1_8_f90.html new file mode 100644 index 0000000..3ce387d --- /dev/null +++ b/fortran/doc/DevelGuide/test/fortranlib_test_1_8_f90.html @@ -0,0 +1,44 @@ + + + + + + + +./test/fortranlib_test_1_8.f90 + + + + + +
+
+ +

fortran/test/fortranlib_test_1_8.f90

+ +

[ Top ] [ Modules ]

+

NAME

+
  fortranlib_test_1_8.f90
+
+

FUNCTION

+
  Basic testing of Fortran API's introduced in 1.8 release.
+
+ +
+ + + diff --git a/fortran/doc/DevelGuide/test/fortranlib_test_F03_f90.html b/fortran/doc/DevelGuide/test/fortranlib_test_F03_f90.html new file mode 100644 index 0000000..1a0c7be --- /dev/null +++ b/fortran/doc/DevelGuide/test/fortranlib_test_F03_f90.html @@ -0,0 +1,45 @@ + + + + + + + +./test/fortranlib_test_F03.f90 + + + + + +
+
+ +

fortran/test/fortranlib_test_F03.f90

+ +

[ Top ] [ Modules ]

+

NAME

+
  fortranlib_test_F03.f90
+
+

FUNCTION

+
  Basic testing of Fortran API's requiring Fortran 2003
+  compliance.
+
+ +
+ + + diff --git a/fortran/doc/DevelGuide/test/fortranlib_test_f90.html b/fortran/doc/DevelGuide/test/fortranlib_test_f90.html new file mode 100644 index 0000000..29fb2f1 --- /dev/null +++ b/fortran/doc/DevelGuide/test/fortranlib_test_f90.html @@ -0,0 +1,44 @@ + + + + + + + +./test/fortranlib_test.f90 + + + + + +
+
+ +

fortran/test/fortranlib_test.f90

+ +

[ Top ] [ Modules ]

+

NAME

+
  fortranlib_test.f90
+
+

FUNCTION

+
  Basic testing of Fortran API's functionality.
+
+ +
+ + + diff --git a/fortran/doc/DevelGuide/test/tF2003_f90.html b/fortran/doc/DevelGuide/test/tF2003_f90.html new file mode 100644 index 0000000..8101411 --- /dev/null +++ b/fortran/doc/DevelGuide/test/tF2003_f90.html @@ -0,0 +1,53 @@ + + + + + + + +./test/tF2003.f90 + + + + + +
+
+ +

fortran/test/tF2003.f90

+ +

[ Top ] [ Modules ]

+

NAME

+
  tF2003.f90
+
+

FUNCTION

+
  Test FORTRAN HDF5 APIs which are dependent on the FORTRAN 2003
+  features. Tests H5L, H5P, H5T APIs. 
+
+

USES

+
  liter_cb_mod, test_genprop_cls_cb1_mod
+
+

CONTAINS SUBROUTINES

+
  test_iter_group, test_create, test_genprop_class_callback,
+  test_array_compound_atomic, test_array_compound_array,
+  test_array_bkg 
+
+ +
+ + + diff --git a/fortran/doc/DevelGuide/test/tH5A_1_8_f90.html b/fortran/doc/DevelGuide/test/tH5A_1_8_f90.html new file mode 100644 index 0000000..c217d99 --- /dev/null +++ b/fortran/doc/DevelGuide/test/tH5A_1_8_f90.html @@ -0,0 +1,51 @@ + + + + + + + +./test/tH5A_1_8.f90 + + + + + +
+
+ +

fortran/test/tH5A_1_8.f90

+ +

[ Top ] [ Modules ]

+

NAME

+
  tH5A_1_8.f90
+
+

FUNCTION

+
  Basic testing of Fortran H5A APIs introduced in 1.8.
+
+

CONTAINS SUBROUTINES

+
  attribute_test_1_8, test_attr_corder_create_compact, test_attr_null_space,
+  test_attr_create_by_name, test_attr_info_by_idx, attr_info_by_idx_check,
+  test_attr_shared_rename, test_attr_delete_by_idx, test_attr_shared_delete,
+  test_attr_dense_open, test_attr_dense_verify, test_attr_corder_create_basic,
+  test_attr_basic_write, test_attr_many, attr_open_check, 
+
+ +
+ + + diff --git a/fortran/doc/DevelGuide/test/tH5A_f90.html b/fortran/doc/DevelGuide/test/tH5A_f90.html new file mode 100644 index 0000000..87c5a45 --- /dev/null +++ b/fortran/doc/DevelGuide/test/tH5A_f90.html @@ -0,0 +1,47 @@ + + + + + + + +./test/tH5A.f90 + + + + + +
+
+ +

fortran/test/tH5A.f90

+ +

[ Top ] [ Modules ]

+

NAME

+
  tH5A.f90
+
+

FUNCTION

+
  Basic testing of Fortran H5A APIs.
+
+

CONTAINS SUBROUTINES

+
  attribute_test 
+
+ +
+ + + diff --git a/fortran/doc/DevelGuide/test/tH5D_f90.html b/fortran/doc/DevelGuide/test/tH5D_f90.html new file mode 100644 index 0000000..c840425 --- /dev/null +++ b/fortran/doc/DevelGuide/test/tH5D_f90.html @@ -0,0 +1,52 @@ + + + + + + + +./test/tH5D.f90 + + + + + +
+
+ +

fortran/test/tH5D.f90

+ +

[ Top ] [ Modules ]

+

NAME

+
  tH5D.f90
+
+

FUNCTION

+
  Basic testing of Fortran H5D APIs.
+
+

NOTES

+
  Tests the H5D APIs functionalities of:
+   h5dcreate_f, h5dopen_f, h5dclose_f, h5dget_space_f, h5dget_type_f,
+   h5dread_f, and h5dwrite_f
+
+

CONTAINS SUBROUTINES

+
  datasettest, extenddsettest
+
+ +
+ + + diff --git a/fortran/doc/DevelGuide/test/tH5E_f90.html b/fortran/doc/DevelGuide/test/tH5E_f90.html new file mode 100644 index 0000000..6a1ef56 --- /dev/null +++ b/fortran/doc/DevelGuide/test/tH5E_f90.html @@ -0,0 +1,51 @@ + + + + + + + +./test/tH5E.f90 + + + + + +
+
+ +

fortran/test/tH5E.f90

+ +

[ Top ] [ Modules ]

+

NAME

+
  tH5E.f90
+
+

FUNCTION

+
  Basic testing of Fortran H5E APIs.
+
+

NOTES

+
  Tests the H5D APIs functionalities of:
+   h5eprint_f
+
+

CONTAINS SUBROUTINES

+
  error_report_test
+
+ +
+ + + diff --git a/fortran/doc/DevelGuide/test/tH5F_f90.html b/fortran/doc/DevelGuide/test/tH5F_f90.html new file mode 100644 index 0000000..d1aff59 --- /dev/null +++ b/fortran/doc/DevelGuide/test/tH5F_f90.html @@ -0,0 +1,47 @@ + + + + + + + +./test/tH5F.f90 + + + + + +
+
+ +

fortran/test/tH5F.f90

+ +

[ Top ] [ Modules ]

+

NAME

+
  tH5F.f90
+
+

FUNCTION

+
  Basic testing of Fortran H5F APIs.
+
+

CONTAINS SUBROUTINES

+
  mountingtest, reopentest, plisttest, file_close, file_space
+
+ +
+ + + diff --git a/fortran/doc/DevelGuide/test/tH5G_1_8_f90.html b/fortran/doc/DevelGuide/test/tH5G_1_8_f90.html new file mode 100644 index 0000000..81fdd3c --- /dev/null +++ b/fortran/doc/DevelGuide/test/tH5G_1_8_f90.html @@ -0,0 +1,49 @@ + + + + + + + +./test/tH5G_1_8.f90 + + + + + +
+
+ +

fortran/test/tH5G_1_8.f90

+ +

[ Top ] [ Modules ]

+

NAME

+
  tH5G_1_8.f90
+
+

FUNCTION

+
  Basic testing of Fortran H5G APIs introduced in 1.8.
+
+

CONTAINS SUBROUTINES

+
  group_test, group_info, timestamps, mklinks, test_move_preserves, lifecycle
+  cklinks, delete_by_idx, link_info_by_idx_check, test_lcpl, objcopy, 
+  lapl_nlinks
+
+ +
+ + + diff --git a/fortran/doc/DevelGuide/test/tH5G_f90.html b/fortran/doc/DevelGuide/test/tH5G_f90.html new file mode 100644 index 0000000..6c60a3c --- /dev/null +++ b/fortran/doc/DevelGuide/test/tH5G_f90.html @@ -0,0 +1,47 @@ + + + + + + + +./test/tH5G.f90 + + + + + +
+
+ +

fortran/test/tH5G.f90

+ +

[ Top ] [ Modules ]

+

NAME

+
  tH5G.f90
+
+

FUNCTION

+
  Basic testing of Fortran H5G APIs.
+
+

CONTAINS SUBROUTINES

+
  group_test
+
+ +
+ + + diff --git a/fortran/doc/DevelGuide/test/tH5I_f90.html b/fortran/doc/DevelGuide/test/tH5I_f90.html new file mode 100644 index 0000000..52e21fc --- /dev/null +++ b/fortran/doc/DevelGuide/test/tH5I_f90.html @@ -0,0 +1,47 @@ + + + + + + + +./test/tH5I.f90 + + + + + +
+
+ +

fortran/test/tH5I.f90

+ +

[ Top ] [ Modules ]

+

NAME

+
  tH5I.f90
+
+

FUNCTION

+
  Basic testing of Fortran H5I APIs.
+
+

CONTAINS SUBROUTINES

+
  identifier_test
+
+ +
+ + + diff --git a/fortran/doc/DevelGuide/test/tH5O_f90.html b/fortran/doc/DevelGuide/test/tH5O_f90.html new file mode 100644 index 0000000..a128da5 --- /dev/null +++ b/fortran/doc/DevelGuide/test/tH5O_f90.html @@ -0,0 +1,47 @@ + + + + + + + +./test/tH5O.f90 + + + + + +
+
+ +

fortran/test/tH5O.f90

+ +

[ Top ] [ Modules ]

+

NAME

+
  tH5O.f90
+
+

FUNCTION

+
  Basic testing of Fortran H5O APIs.
+
+

CONTAINS SUBROUTINES

+
  test_h5o, test_h5o_link, test_h5o_plist
+
+ +
+ + + diff --git a/fortran/doc/DevelGuide/test/tH5P_f90.html b/fortran/doc/DevelGuide/test/tH5P_f90.html new file mode 100644 index 0000000..edc0787 --- /dev/null +++ b/fortran/doc/DevelGuide/test/tH5P_f90.html @@ -0,0 +1,47 @@ + + + + + + + +./test/tH5P.f90 + + + + + +
+
+ +

fortran/test/tH5P.f90

+ +

[ Top ] [ Modules ]

+

NAME

+
  tH5P.f90
+
+

FUNCTION

+
  Basic testing of Fortran H5P APIs.
+
+

CONTAINS SUBROUTINES

+
  external_test, multi_file_test
+
+ +
+ + + diff --git a/fortran/doc/DevelGuide/test/tH5R_f90.html b/fortran/doc/DevelGuide/test/tH5R_f90.html new file mode 100644 index 0000000..fd44062 --- /dev/null +++ b/fortran/doc/DevelGuide/test/tH5R_f90.html @@ -0,0 +1,51 @@ + + + + + + + +./test/tH5R.f90 + + + + + +
+
+ +

fortran/test/tH5R.f90

+ +

[ Top ] [ Modules ]

+

NAME

+
  tH5R.f90
+
+

FUNCTION

+
  Basic testing of Fortran H5R, Reference Interface, APIs.
+
+

NOTES

+
  Tests h5rcreate_f, h5rdereference_f, h5rget_name_f 
+  and H5Rget_object_type functions
+
+

CONTAINS SUBROUTINES

+
  refobjtest, refregtest
+
+ +
+ + + diff --git a/fortran/doc/DevelGuide/test/tH5S_f90.html b/fortran/doc/DevelGuide/test/tH5S_f90.html new file mode 100644 index 0000000..5879d28 --- /dev/null +++ b/fortran/doc/DevelGuide/test/tH5S_f90.html @@ -0,0 +1,54 @@ + + + + + + + +./test/tH5S.f90 + + + + + +
+
+ +

fortran/test/tH5S.f90

+ +

[ Top ] [ Modules ]

+

NAME

+
  tH5S.f90
+
+

FUNCTION

+
  Basic testing of Fortran H5S, Dataspace Interface, APIs.
+
+

NOTES

+
  Tests the following functionalities:
+   h5screate_f, h5scopy_f, h5screate_simple_f, h5sis_simple_f,
+   h5sget_simple_extent_dims_f,h5sget_simple_extent_ndims_f
+   h5sget_simple_extent_npoints_f, h5sget_simple_extent_type_f,
+   h5sextent_copy_f, h5sset_extent_simple_f, h5sset_extent_none_f
+
+

CONTAINS SUBROUTINES

+
  dataspace_basic_test
+
+ +
+ + + diff --git a/fortran/doc/DevelGuide/test/tH5Sselect_f90.html b/fortran/doc/DevelGuide/test/tH5Sselect_f90.html new file mode 100644 index 0000000..e8eaa73 --- /dev/null +++ b/fortran/doc/DevelGuide/test/tH5Sselect_f90.html @@ -0,0 +1,56 @@ + + + + + + + +./test/tH5Sselect.f90 + + + + + +
+
+ +

fortran/test/tH5Sselect.f90

+ +

[ Top ] [ Modules ]

+

NAME

+
  tH5Sselect.f90
+
+

FUNCTION

+
  Basic testing of Fortran H5S, Selection-related Dataspace Interface, APIs.
+
+

NOTES

+
  Tests the following functionalities:
+    h5sget_select_npoints_f, h5sselect_elements_f, h5sselect_all_f,
+    h5sselect_none_f, h5sselect_valid_f, h5sselect_hyperslab_f,
+    h5sget_select_bounds_f, h5sget_select_elem_pointlist_f,
+    h5sget_select_elem_npoints_f, h5sget_select_hyper_blocklist_f,
+    h5sget_select_hyper_nblocks_f, h5sget_select_npoints_f   
+
+

CONTAINS SUBROUTINES

+
  test_select_hyperslab, test_select_element, test_basic_select,
+  test_select_point, test_select_combine, test_select_bounds
+
+ +
+ + + diff --git a/fortran/doc/DevelGuide/test/tH5T_f90.html b/fortran/doc/DevelGuide/test/tH5T_f90.html new file mode 100644 index 0000000..35006b3 --- /dev/null +++ b/fortran/doc/DevelGuide/test/tH5T_f90.html @@ -0,0 +1,47 @@ + + + + + + + +./test/tH5T.f90 + + + + + +
+
+ +

fortran/test/tH5T.f90

+ +

[ Top ] [ Modules ]

+

NAME

+
  tH5T.f90
+
+

FUNCTION

+
  Basic testing of Fortran H5T APIs.
+
+

CONTAINS SUBROUTINES

+
  compoundtest, basic_data_type_test, enumtest, test_derived_flt
+
+ +
+ + + diff --git a/fortran/doc/DevelGuide/test/tH5VL_f90.html b/fortran/doc/DevelGuide/test/tH5VL_f90.html new file mode 100644 index 0000000..a34a01d --- /dev/null +++ b/fortran/doc/DevelGuide/test/tH5VL_f90.html @@ -0,0 +1,47 @@ + + + + + + + +./test/tH5VL.f90 + + + + + +
+
+ +

fortran/test/tH5VL.f90

+ +

[ Top ] [ Modules ]

+

NAME

+
  tH5VL.f90
+
+

FUNCTION

+
  Basic testing of Fortran Variable_length datatypes APIs.
+
+

CONTAINS SUBROUTINES

+
  vl_test_integer, vl_test_real, vl_test_string 
+
+ +
+ + + diff --git a/fortran/doc/DevelGuide/test/tH5Z_f90.html b/fortran/doc/DevelGuide/test/tH5Z_f90.html new file mode 100644 index 0000000..94325b9 --- /dev/null +++ b/fortran/doc/DevelGuide/test/tH5Z_f90.html @@ -0,0 +1,47 @@ + + + + + + + +./test/tH5Z.f90 + + + + + +
+
+ +

fortran/test/tH5Z.f90

+ +

[ Top ] [ Modules ]

+

NAME

+
  tH5Z.f90
+
+

FUNCTION

+
  Basic testing of Fortran H5Z szip APIs.
+
+

CONTAINS SUBROUTINES

+
  filters_test, szip_test
+
+ +
+ + + diff --git a/fortran/doc/DevelGuide/test/t_c.html b/fortran/doc/DevelGuide/test/t_c.html new file mode 100644 index 0000000..c9512a7 --- /dev/null +++ b/fortran/doc/DevelGuide/test/t_c.html @@ -0,0 +1,44 @@ + + + + + + + +./test/t.c + + + + + +
+
+ +

fortran/test/tc.c

+ +

[ Top ] [ Modules ]

+

NAME

+
   tc.c
+
+

FUNCTION

+
   This file contains C routines needed for the test programs.
+
+ +
+ + + diff --git a/fortran/doc/DevelGuide/test/tf_f90.html b/fortran/doc/DevelGuide/test/tf_f90.html new file mode 100644 index 0000000..e3c51f4 --- /dev/null +++ b/fortran/doc/DevelGuide/test/tf_f90.html @@ -0,0 +1,48 @@ + + + + + + + +./test/tf.f90 + + + + + +
+
+ +

fortran/test/tf.f90

+ +

[ Top ] [ Modules ]

+

NAME

+
  tf.f90
+
+

FUNCTION

+
  Contains subroutines which are needed in all the hdf5 fortran tests
+
+

CONTAINS SUBROUTINES

+
  write_test_status, check, verify, verifyLogical, verifyString, h5_fixname_f,
+  h5_cleanup_f, h5_exit_f, h5_env_nocleanup_f
+
+ +
+ + + diff --git a/fortran/doc/DevelGuide/toc_index.html b/fortran/doc/DevelGuide/toc_index.html new file mode 100644 index 0000000..94a2792 --- /dev/null +++ b/fortran/doc/DevelGuide/toc_index.html @@ -0,0 +1,552 @@ + + + + + + + +Table of Contents + + + + +
+
+ +
+

TABLE OF CONTENTS

+ +
+ + + diff --git a/fortran/examples/CMakeLists.txt b/fortran/examples/CMakeLists.txt index ee459e1..814da48 100644 --- a/fortran/examples/CMakeLists.txt +++ b/fortran/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8) +cmake_minimum_required (VERSION 2.8.6) PROJECT (HDF5_F90_EXAMPLES C CXX Fortran) # -------------------------------------------------------------------- # Notes: When creating examples they should be prefixed @@ -30,6 +30,13 @@ SET (examples compound ) +SET (F2003_examples + rwdset_fortran2003 + nested_derived_type + compound_fortran2003 + compound_complex_fortran2003 +) + FOREACH (example ${examples}) ADD_EXECUTABLE (f90_ex_${example} ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) TARGET_NAMING (f90_ex_${example} ${LIB_TYPE}) @@ -37,7 +44,7 @@ FOREACH (example ${examples}) IF (WIN32 AND NOT CYGWIN) SET_PROPERTY (TARGET f90_ex_${example} APPEND PROPERTY COMPILE_DEFINITIONS - HDF5F90_WINDOWS + HDF5F90_WINDOWS ) ENDIF (WIN32 AND NOT CYGWIN) TARGET_LINK_LIBRARIES (f90_ex_${example} @@ -45,14 +52,46 @@ FOREACH (example ${examples}) ${HDF5_LIB_TARGET} ) SET_TARGET_PROPERTIES (f90_ex_${example} PROPERTIES LINKER_LANGUAGE Fortran) + SET_TARGET_PROPERTIES (f90_ex_${example} PROPERTIES FOLDER examples/fortran) IF (BUILD_TESTING) ADD_TEST (NAME f90_ex_${example} COMMAND $) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (f90_ex_${example} PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + SET (last_test "f90_ex_${example}") ENDIF (BUILD_TESTING) ENDFOREACH (example ${examples}) -IF (H5_HAVE_PARALLEL) +IF (FORTRAN_HAVE_ISO_C_BINDING AND HDF5_ENABLE_F2003) + FOREACH (example ${F2003_examples}) + ADD_EXECUTABLE (f03_ex_${example} ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) + TARGET_NAMING (f03_ex_${example} ${LIB_TYPE}) + TARGET_FORTRAN_WIN_PROPERTIES (f03_ex_${example} "") + IF (WIN32 AND NOT CYGWIN) + SET_PROPERTY (TARGET f03_ex_${example} + APPEND PROPERTY COMPILE_DEFINITIONS HDF5F90_WINDOWS + ) + ENDIF (WIN32 AND NOT CYGWIN) + TARGET_LINK_LIBRARIES (f03_ex_${example} + ${HDF5_F90_LIB_TARGET} + ${HDF5_LIB_TARGET} + ) + SET_TARGET_PROPERTIES (f03_ex_${example} PROPERTIES LINKER_LANGUAGE Fortran) + SET_TARGET_PROPERTIES (f03_ex_${example} PROPERTIES FOLDER examples/fortran03) + + IF (BUILD_TESTING) + ADD_TEST (NAME f03_ex_${example} COMMAND $) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (f03_ex_${example} PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + SET (last_test "f03_ex_${example}") + ENDIF (BUILD_TESTING) + ENDFOREACH (example ${F2003_examples}) +ENDIF (FORTRAN_HAVE_ISO_C_BINDING AND HDF5_ENABLE_F2003) + +IF (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) ADD_EXECUTABLE (f90_ex_ph5example ${HDF5_F90_EXAMPLES_SOURCE_DIR}/ph5example.f90) TARGET_NAMING (f90_ex_ph5example ${LIB_TYPE}) TARGET_FORTRAN_WIN_PROPERTIES (f90_ex_ph5example "") @@ -65,11 +104,13 @@ IF (H5_HAVE_PARALLEL) TARGET_LINK_LIBRARIES (f90_ex_ph5example ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} + ${MPI_Fortran_LIBRARIES} ) SET_TARGET_PROPERTIES (f90_ex_ph5example PROPERTIES LINKER_LANGUAGE Fortran) + SET_TARGET_PROPERTIES (f90_ex_ph5example PROPERTIES FOLDER examples/fortran) IF (BUILD_TESTING) - ADD_TEST (NAME f90_ex_ph5example COMMAND $) + ADD_TEST (NAME f90_ex_ph5example COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) ENDIF (BUILD_TESTING) -ENDIF (H5_HAVE_PARALLEL) +ENDIF (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) diff --git a/fortran/examples/Makefile.am b/fortran/examples/Makefile.am index 57a8f94..7465b98 100644 --- a/fortran/examples/Makefile.am +++ b/fortran/examples/Makefile.am @@ -31,18 +31,28 @@ endif # be run. # We don't tell automake about these programs so that it doesn't try to # compile them with the regular fortran compiler. -TEST_PROG=dsetexample fileexample rwdsetexample attrexample groupexample \ - grpsexample grpdsetexample hyperslab selectele grpit refobjexample \ - refregexample mountexample compound -TEST_SCRIPT=testh5fc.sh + +TEST_PROG=dsetexample fileexample rwdsetexample attrexample groupexample \ + grpsexample grpdsetexample hyperslab selectele grpit refobjexample \ + refregexample mountexample compound # List files to be installed here -INSTALL_FILES=dsetexample.f90 fileexample.f90 rwdsetexample.f90 \ - attrexample.f90 groupexample.f90 grpsexample.f90 grpdsetexample.f90 \ - hyperslab.f90 selectele.f90 grpit.f90 refobjexample.f90 \ - refregexample.f90 mountexample.f90 compound.f90 ph5example.f90 +INSTALL_FILES=dsetexample.f90 fileexample.f90 rwdsetexample.f90 \ + attrexample.f90 groupexample.f90 grpsexample.f90 grpdsetexample.f90 \ + hyperslab.f90 selectele.f90 grpit.f90 refobjexample.f90 \ + refregexample.f90 mountexample.f90 compound.f90 ph5example.f90 INSTALL_SCRIPT_FILES = run-fortran-ex.sh + +# Add attention tests for Fortran 2003 features +if FORTRAN_2003_CONDITIONAL_F + TEST_PROG += rwdset_fortran2003 nested_derived_type \ + compound_fortran2003 compound_complex_fortran2003 + INSTALL_FILES += rwdset_fortran2003.f90 nested_derived_type.f90 \ + compound_fortran2003.f90 compound_complex_fortran2003.f90 +endif +TEST_SCRIPT=testh5fc.sh + # Mark this directory as part of the Fortran API FORTRAN_API=yes @@ -89,6 +99,12 @@ refregexample: refregexample.f90 mountexample: mountexample.f90 compound: compound.f90 ph5example: ph5example.f90 +if FORTRAN_2003_CONDITIONAL_F +rwdset_fortran2003: rwdset_fortran2003.f90 +nested_derived_type: nested_derived_type.f90 +compound_fortran2003: compound_fortran2003.f90 +compound_complex_fortran2003: compound_complex_fortran2003.f90 +endif include $(top_srcdir)/config/examples.am include $(top_srcdir)/config/conclude.am diff --git a/fortran/examples/Makefile.in b/fortran/examples/Makefile.in index c0f89c3..12460f3 100644 --- a/fortran/examples/Makefile.in +++ b/fortran/examples/Makefile.in @@ -59,6 +59,14 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/config/commence.am \ $(top_srcdir)/config/conclude.am \ $(top_srcdir)/config/examples.am + +# Add attention tests for Fortran 2003 features +@FORTRAN_2003_CONDITIONAL_F_TRUE@am__append_1 = rwdset_fortran2003 nested_derived_type \ +@FORTRAN_2003_CONDITIONAL_F_TRUE@ compound_fortran2003 compound_complex_fortran2003 + +@FORTRAN_2003_CONDITIONAL_F_TRUE@am__append_2 = rwdset_fortran2003.f90 nested_derived_type.f90 \ +@FORTRAN_2003_CONDITIONAL_F_TRUE@ compound_fortran2003.f90 compound_complex_fortran2003.f90 + TESTS = subdir = fortran/examples ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -145,6 +153,7 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ +FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ @@ -165,10 +174,12 @@ H5_LONE_COLON = @H5_LONE_COLON@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ +HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ +HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ @@ -367,19 +378,19 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.h5 # be run. # We don't tell automake about these programs so that it doesn't try to # compile them with the regular fortran compiler. -TEST_PROG = dsetexample fileexample rwdsetexample attrexample groupexample \ - grpsexample grpdsetexample hyperslab selectele grpit refobjexample \ - refregexample mountexample compound - -TEST_SCRIPT = testh5fc.sh +TEST_PROG = dsetexample fileexample rwdsetexample attrexample \ + groupexample grpsexample grpdsetexample hyperslab selectele \ + grpit refobjexample refregexample mountexample compound \ + $(am__append_1) # List files to be installed here -INSTALL_FILES = dsetexample.f90 fileexample.f90 rwdsetexample.f90 \ - attrexample.f90 groupexample.f90 grpsexample.f90 grpdsetexample.f90 \ - hyperslab.f90 selectele.f90 grpit.f90 refobjexample.f90 \ - refregexample.f90 mountexample.f90 compound.f90 ph5example.f90 - +INSTALL_FILES = dsetexample.f90 fileexample.f90 rwdsetexample.f90 \ + attrexample.f90 groupexample.f90 grpsexample.f90 \ + grpdsetexample.f90 hyperslab.f90 selectele.f90 grpit.f90 \ + refobjexample.f90 refregexample.f90 mountexample.f90 \ + compound.f90 ph5example.f90 $(am__append_2) INSTALL_SCRIPT_FILES = run-fortran-ex.sh +TEST_SCRIPT = testh5fc.sh # Mark this directory as part of the Fortran API FORTRAN_API = yes @@ -654,6 +665,10 @@ refregexample: refregexample.f90 mountexample: mountexample.f90 compound: compound.f90 ph5example: ph5example.f90 +@FORTRAN_2003_CONDITIONAL_F_TRUE@rwdset_fortran2003: rwdset_fortran2003.f90 +@FORTRAN_2003_CONDITIONAL_F_TRUE@nested_derived_type: nested_derived_type.f90 +@FORTRAN_2003_CONDITIONAL_F_TRUE@compound_fortran2003: compound_fortran2003.f90 +@FORTRAN_2003_CONDITIONAL_F_TRUE@compound_complex_fortran2003: compound_complex_fortran2003.f90 # How to create EXAMPLEDIR if it doesn't already exist $(EXAMPLEDIR): diff --git a/fortran/examples/compound_complex_fortran2003.f90 b/fortran/examples/compound_complex_fortran2003.f90 new file mode 100644 index 0000000..19671f7 --- /dev/null +++ b/fortran/examples/compound_complex_fortran2003.f90 @@ -0,0 +1,117 @@ +! This is the F2003 version of the h5_compound.c example source code. +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! 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://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have * +! access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +! This example shows how to create an array of a compound datatype which +! contains an array of type complex and how to write it to hdf5 +! and how to read it back into a compound datatype for hdf5. +! + +PROGRAM compound_complex_fortran2003 + + USE hdf5 + USE ISO_C_BINDING + IMPLICIT NONE + + INTEGER, PARAMETER :: r_k8 = KIND(0.0d0) + INTEGER, PARAMETER :: NMAX = 3 + + TYPE sample + COMPLEX(KIND=r_k8), DIMENSION(1:NMAX) :: nlev + REAL(KIND=r_k8) :: N + END TYPE sample + + INTEGER(HID_T) :: sample_type_id, dset_id, dspace_id, file_id + INTEGER(HSIZE_T) :: dims(1) = (/NMAX/) + INTEGER :: error + + TYPE(sample), DIMENSION(1:NMAX), TARGET :: samples, read_samples + INTEGER :: i + + TYPE(C_PTR) :: f_ptr + INTEGER(HSIZE_T), DIMENSION(1) :: array_dims=(/2*NMAX/) ! complex is really (real,real) so double size of array + INTEGER(hid_t) :: array_type_id ! Nested Array Datatype ID + + ! Initialize data + DO i=1,NMAX + samples(i)%nlev(1:NMAX) = (3.14159_r_k8, 2.71828_r_k8) + samples(i)%N = i + END DO + + ! Initialize FORTRAN interface. + CALL h5open_f(error) + + ! Create a new file using default properties. + CALL h5fcreate_f("test.h5", H5F_ACC_TRUNC_F, file_id, error) + ! + ! Create the memory data type. + ! + CALL H5Tcreate_f(H5T_COMPOUND_F, H5OFFSETOF(C_LOC(samples(1)), C_LOC(samples(2))), sample_type_id, error) + + ! Create the array type + CALL h5Tarray_create_f(H5T_NATIVE_DOUBLE, 1, array_dims, array_type_id, error) + ! Then use that array type to insert values into + CALL H5Tinsert_f( sample_type_id, "nlev", & + H5OFFSETOF(C_LOC(samples(1)),C_LOC(samples(1)%nlev(1))), array_type_id, error) + CALL H5Tinsert_f( sample_type_id, "N", & + H5OFFSETOF(C_LOC(samples(1)),C_LOC(samples(1)%N)), h5kind_to_type(r_k8,H5_REAL_KIND), error) + ! + ! Create dataspace + ! + CALL h5screate_simple_f(1, dims, dspace_id, error) + ! + ! Create the dataset. + ! + CALL H5Dcreate_f(file_id, "samples", sample_type_id, dspace_id, dset_id, error) + ! + ! Write data to the dataset + ! + f_ptr = C_LOC(samples(1)) + CALL H5Dwrite_f(dset_id, sample_type_id, f_ptr, error) + ! Close up + CALL h5dclose_f(dset_id, error) + CALL h5sclose_f(dspace_id, error) + CALL h5fclose_f(file_id, error) + ! + ! Open the file and the dataset. + ! + CALL H5Fopen_f("test.h5", H5F_ACC_RDONLY_F, file_id, error) + + CALL H5Dopen_f(file_id, "samples", dset_id, error) + ! + ! Create the memory data type. + ! + CALL H5Tcreate_f(H5T_COMPOUND_F,H5OFFSETOF(C_LOC(samples(1)), C_LOC(samples(2))), sample_type_id,error) + + CALL H5Tinsert_f( sample_type_id, "nlev", & + H5OFFSETOF(C_LOC(samples(1)),C_LOC(samples(1)%nlev(1))), array_type_id, error) + CALL H5Tinsert_f( sample_type_id, "N", & + H5OFFSETOF(C_LOC(samples(1)),C_LOC(samples(1)%N)), h5kind_to_type(r_k8,H5_REAL_KIND), error) + + f_ptr = C_LOC(read_samples(1)) + CALL H5Dread_f(dset_id, sample_type_id, f_ptr, error) + + ! + ! Display the fields + ! + DO i=1,NMAX + WRITE(*,'(A,3(" (",F8.5,",",F8.5,")"))') "SAMPLES =",read_samples(i)%nlev(1:NMAX) + WRITE(*,'(A,F8.5)') "N =", read_samples(i)%N + END DO + + CALL H5Tclose_f(sample_type_id, error) + CALL H5Dclose_f(dset_id, error) + CALL H5Fclose_f(file_id, error) + +END PROGRAM compound_complex_fortran2003 diff --git a/fortran/examples/compound_fortran2003.f90 b/fortran/examples/compound_fortran2003.f90 new file mode 100644 index 0000000..a55d1a6 --- /dev/null +++ b/fortran/examples/compound_fortran2003.f90 @@ -0,0 +1,208 @@ +! This is the F2003 version of the h5_compound.c example source code. +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! 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://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have * +! access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +! This example shows how to create a compound data type, +! write an array which has the compound data type to the file, +! and read back fields' subsets. +! + +PROGRAM main + USE hdf5 + USE ISO_C_BINDING + IMPLICIT NONE + +! KIND parameters + + INTEGER, PARAMETER :: int_k1 = SELECTED_INT_KIND(1) ! This should map to INTEGER*1 on most modern processors + INTEGER, PARAMETER :: int_k2 = SELECTED_INT_KIND(4) ! This should map to INTEGER*2 on most modern processors + INTEGER, PARAMETER :: int_k4 = SELECTED_INT_KIND(8) ! This should map to INTEGER*4 on most modern processors + INTEGER, PARAMETER :: int_k8 = SELECTED_INT_KIND(16) ! This should map to INTEGER*8 on most modern processors + + INTEGER, PARAMETER :: r_k4 = SELECTED_REAL_KIND(5) ! This should map to REAL*4 on most modern processors + INTEGER, PARAMETER :: r_k8 = SELECTED_REAL_KIND(10) ! This should map to REAL*8 on most modern processors + +! FILES + + CHARACTER(LEN=*), PARAMETER :: H5FILE_NAME = "SDScompound.h5" + CHARACTER(LEN=*), PARAMETER :: DATASETNAME = "ArrayOfStructures" + + INTEGER, PARAMETER :: LENGTH = 10 + INTEGER, PARAMETER :: RANK = 1 + +!---------------------------------------------------------------- +! First derived-type and dataset + TYPE s1_t + CHARACTER(LEN=1), DIMENSION(1:13) :: chr + INTEGER(KIND=int_k1) :: a + REAL(KIND=r_k4) :: b + REAL(KIND=r_k8) :: c + END TYPE s1_t + + TYPE(s1_t), TARGET :: s1(LENGTH) + INTEGER(hid_t) :: s1_tid ! File datatype identifier + +!---------------------------------------------------------------- +! Second derived-type (subset of s1_t) and dataset + TYPE s2_t + CHARACTER(LEN=1), DIMENSION(1:13) :: chr + REAL(KIND=r_k8) :: c + INTEGER(KIND=int_k1) :: a + END TYPE s2_t + + type(s2_t), target :: s2(LENGTH) + integer(hid_t) :: s2_tid ! Memory datatype handle + +!---------------------------------------------------------------- +! Third "derived-type" (will be used to read float field of s1) + INTEGER(hid_t) :: s3_tid ! Memory datatype handle + REAL(KIND=r_k4), TARGET :: s3(LENGTH) + + INTEGER :: i + INTEGER(hid_t) :: file, dataset, space + !type(H5F_fileid_type) :: file + !type(H5D_dsetid_type) :: dataset + !type(H5S_spaceid_type) :: space + INTEGER(hsize_t) :: DIM(1) = (/LENGTH/) ! Dataspace dimensions + INTEGER(SIZE_T) :: type_size ! Size of the datatype + INTEGER(SIZE_T) :: offset, sizeof_compound + INTEGER :: hdferr + TYPE(C_PTR) :: f_ptr + + INTEGER(SIZE_T) :: type_sizei ! Size of the integer datatype + INTEGER(SIZE_T) :: type_sizer ! Size of the real datatype + INTEGER(SIZE_T) :: type_sized ! Size of the double datatype + INTEGER(hid_t) :: tid3 ! /* Nested Array Datatype ID */ + INTEGER(HSIZE_T), DIMENSION(1) :: tdims1=(/13/) + ! + ! Initialize FORTRAN interface. + ! + + CALL h5open_f(hdferr) + + ! + ! Initialize the data + ! + DO i = 0, LENGTH-1 + s1(i+1)%chr(1)(1:1) = 'a' + s1(i+1)%chr(2)(1:1) = 'b' + s1(i+1)%chr(3)(1:1) = 'c' + s1(i+1)%chr(4:12)(1:1) = ' ' + s1(i+1)%chr(13)(1:1) = 'd' + s1(i+1)%a = i + s1(i+1)%b = i*i + s1(i+1)%c = 1./REAL(i+1) + END DO + ! + ! Create the data space. + ! + ! + CALL H5Screate_simple_f(RANK, dim, space, hdferr) + + ! + ! Create the file. + ! + CALL H5Fcreate_f(H5FILE_NAME, H5F_ACC_TRUNC_F, file, hdferr) + + ! + ! Create the memory data type. + ! + CALL H5Tcreate_f(H5T_COMPOUND_F, H5OFFSETOF(C_LOC(s1(1)), C_LOC(s1(2))), s1_tid, hdferr) + + CALL h5tarray_create_f(H5T_NATIVE_CHARACTER, 1, tdims1, tid3, hdferr) + + CALL H5Tinsert_f(s1_tid, "chr_name", H5OFFSETOF(C_LOC(s1(1)),C_LOC(s1(1)%chr)),tid3, hdferr) + CALL H5Tinsert_f(s1_tid, "a_name", H5OFFSETOF(C_LOC(s1(1)),C_LOC(s1(1)%a)), h5kind_to_type(int_k1,H5_INTEGER_KIND), hdferr) + CALL H5Tinsert_f(s1_tid, "c_name", H5OFFSETOF(C_LOC(s1(1)),C_LOC(s1(1)%c)), h5kind_to_type(r_k8,H5_REAL_KIND), hdferr) + CALL H5Tinsert_f(s1_tid, "b_name", H5OFFSETOF(C_LOC(s1(1)),C_LOC(s1(1)%b)), h5kind_to_type(r_k4,H5_REAL_KIND), hdferr) + + ! + ! Create the dataset. + ! + CALL H5Dcreate_f(file, DATASETNAME, s1_tid, space, dataset, hdferr) + + ! + ! Write data to the dataset + ! + + f_ptr = C_LOC(s1(1)) + CALL H5Dwrite_f(dataset, s1_tid, f_ptr, hdferr) + + ! + ! Release resources + ! + CALL H5Tclose_f(s1_tid, hdferr) + CALL H5Sclose_f(space, hdferr) + CALL H5Dclose_f(dataset, hdferr) + CALL H5Fclose_f(file, hdferr) + + ! + ! Open the file and the dataset. + ! + + CALL H5Fopen_f(H5FILE_NAME, H5F_ACC_RDONLY_F, file, hdferr) + + CALL H5Dopen_f(file, DATASETNAME, dataset,hdferr) + + ! + ! Create a data type for s2 + ! + CALL H5Tcreate_f(H5T_COMPOUND_F, H5OFFSETOF(C_LOC(s2(1)), C_LOC(s2(2))), s2_tid, hdferr) + + CALL H5Tinsert_f(s2_tid, "chr_name", H5OFFSETOF(C_LOC(s2(1)),C_LOC(s2(1)%chr)), tid3, hdferr) + CALL H5Tinsert_f(s2_tid, "c_name", H5OFFSETOF(C_LOC(s2(1)),C_LOC(s2(1)%c)), h5kind_to_type(r_k8,H5_REAL_KIND), hdferr) + CALL H5Tinsert_f(s2_tid, "a_name", H5OFFSETOF(C_LOC(s2(1)),C_LOC(s2(1)%a)), h5kind_to_type(int_k1,H5_INTEGER_KIND), hdferr) + + ! + ! Read two fields c and a from s1 dataset. Fields in the file + ! are found by their names "c_name" and "a_name". + s2(:)%c=-1; s2(:)%a=-1; + + + f_ptr = C_LOC(s2(1)) + CALL H5Dread_f(dataset, s2_tid, f_ptr, hdferr) + + ! + ! Display the fields + ! + DO i = 1, length + WRITE(*,'(/,A,/,999(A,1X))') "Field chr :", s2(i)%chr(1:13)(1:1) + ENDDO + WRITE(*,'(/,A,/,999(F8.4,1X))') "Field c :", s2(:)%c + WRITE(*,'(/,A,/,999(I0,1X))') "Field a :", s2(:)%a + ! + ! Create a data type for s3. + ! + CALL H5Tcreate_f(H5T_COMPOUND_F, H5OFFSETOF(C_LOC(s3(1)),C_LOC(s3(2))),s3_tid, hdferr) + + CALL H5Tinsert_f(s3_tid, "b_name", 0_size_t, h5kind_to_type(r_k4,H5_REAL_KIND), hdferr) + ! + ! Read field b from s1 dataset. Field in the file is found by its name. + ! + s3(:)=-1 + f_ptr = C_LOC(s3(1)) + CALL H5Dread_f(dataset, s3_tid, f_ptr, hdferr) + ! + ! Display the field + ! + WRITE(*,'(/,A,/,999(F8.4,1X))') "Field b :",s3(:) + ! + ! Release resources + ! + CALL H5Tclose_f(s2_tid, hdferr) + CALL H5Tclose_f(s3_tid, hdferr) + CALL H5Dclose_f(dataset, hdferr) + CALL H5Fclose_f(file, hdferr) + +END PROGRAM main diff --git a/fortran/examples/nested_derived_type.f90 b/fortran/examples/nested_derived_type.f90 new file mode 100644 index 0000000..f806110 --- /dev/null +++ b/fortran/examples/nested_derived_type.f90 @@ -0,0 +1,212 @@ +! +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! 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://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have * +! access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +! This example shows how to create a nested compound data type, +! write an array which has the compound data type to the file, +! and read back fields' subsets. + +PROGRAM main + USE HDF5 + USE ISO_C_BINDING + IMPLICIT NONE + +! KIND parameters + INTEGER, PARAMETER :: int_k1 = SELECTED_INT_KIND(Fortran_INTEGER_1) ! This should map to INTEGER*1 on most modern processors + INTEGER, PARAMETER :: int_k4 = SELECTED_INT_KIND(Fortran_INTEGER_2) ! This should map to INTEGER*2 on most modern processors + INTEGER, PARAMETER :: int_k8 = SELECTED_INT_KIND(Fortran_INTEGER_4) ! This should map to INTEGER*4 on most modern processors + INTEGER, PARAMETER :: int_k16 = SELECTED_INT_KIND(Fortran_INTEGER_8) ! This should map to INTEGER*8 on most modern processors + + INTEGER, PARAMETER :: r_k4 = SELECTED_REAL_KIND(Fortran_REAL_4) ! This should map to REAL*4 on most modern processors + INTEGER, PARAMETER :: r_k8 = SELECTED_REAL_KIND(Fortran_REAL_8) ! This should map to REAL*8 on most modern processors + +! FILES + + CHARACTER(LEN=*), PARAMETER :: H5FILE_NAME = "SDScompound.h5" + CHARACTER(LEN=*), PARAMETER :: DATASETNAME = "ArrayOfStructures" + + INTEGER, PARAMETER :: LENGTH = 10 + INTEGER, PARAMETER :: RANK = 1 + +!---------------------------------------------------------------- +! Nested derived-type and dataset + + TYPE s4_t + INTEGER(int_k8), DIMENSION(1:4) :: x + ENDTYPE s4_t + + TYPE s1_t + CHARACTER(LEN=1), DIMENSION(1:7) :: chr + INTEGER(KIND=int_k1) :: a + REAL(KIND=r_k4) :: b + TYPE(s4_t) :: d + REAL(KIND=r_k8) :: c + END TYPE s1_t + + TYPE(s1_t), TARGET, DIMENSION(1:length) :: s1 + INTEGER(hid_t) :: s1_tid ! File datatype identifier + +!---------------------------------------------------------------- +! Second derived-type (subset of s1_t) and dataset + TYPE s2_t + CHARACTER(LEN=1), DIMENSION(1:7) :: chr + REAL(KIND=r_k8) :: c + INTEGER(KIND=int_k1) :: a + TYPE(s4_t) :: d + END TYPE s2_t + + TYPE(s2_t), TARGET :: s2(LENGTH) + integer(hid_t) :: s2_tid ! Memory datatype handle + INTEGER(hid_t) :: tid3a +!---------------------------------------------------------------- +! Third "derived-type" (will be used to read float field of s1) + INTEGER(hid_t) :: s3_tid ! Memory datatype handle + REAL(KIND=r_k4), TARGET :: s3(LENGTH) + + INTEGER :: i + INTEGER(hid_t) :: file, dataset, space + !type(H5F_fileid_type) :: file + !type(H5D_dsetid_type) :: dataset + !type(H5S_spaceid_type) :: space + INTEGER(hsize_t) :: DIM(1) = (/LENGTH/) ! Dataspace dimensions + INTEGER(SIZE_T) :: type_size ! Size of the datatype + INTEGER(SIZE_T) :: offset, sizeof_compound + INTEGER :: hdferr + TYPE(C_PTR) :: f_ptr + + INTEGER(SIZE_T) :: type_sizei ! Size of the integer datatype + INTEGER(SIZE_T) :: type_sizer ! Size of the real datatype + INTEGER(SIZE_T) :: type_sized ! Size of the double datatype + INTEGER(hid_t) :: tid3 ! /* Nested Array Datatype ID */ + INTEGER(HSIZE_T), DIMENSION(1) :: tdims1=(/7/) + INTEGER(HSIZE_T), DIMENSION(1) :: tdims1a=(/4/) + ! + ! Initialize FORTRAN interface. + ! + CALL h5open_f(hdferr) + ! + ! Initialize the data + ! + DO i = 0, LENGTH-1 + s1(i+1)%chr(1:7)(1:1) = (/'a','b','c',' ',' ',' ','d'/) + s1(i+1)%a = i + s1(i+1)%b = i*i + s1(i+1)%c = 1./REAL(i+1) + s1(i+1)%d%x(1:4) = (/i,i*10,i*100,i*1000/) + END DO + ! + ! Create the data space. + ! + ! + CALL H5Screate_simple_f(RANK, dim, space, hdferr) + ! + ! Create the file. + ! + CALL H5Fcreate_f(H5FILE_NAME, H5F_ACC_TRUNC_F, file, hdferr) + ! + ! Create the memory data type. + ! + CALL H5Tcreate_f(H5T_COMPOUND_F, H5OFFSETOF(C_LOC(s1(1)), C_LOC(s1(2))), s1_tid, hdferr) + + CALL h5tarray_create_f(H5T_NATIVE_CHARACTER, 1, tdims1, tid3, hdferr) + + CALL H5Tinsert_f(s1_tid, "chr_name", H5OFFSETOF(C_LOC(s1(1)),C_LOC(s1(1)%chr)),tid3, hdferr) + CALL H5Tinsert_f(s1_tid, "a_name", H5OFFSETOF(C_LOC(s1(1)),C_LOC(s1(1)%a)), h5kind_to_type(int_k1,H5_INTEGER_KIND), hdferr) + CALL H5Tinsert_f(s1_tid, "c_name", H5OFFSETOF(C_LOC(s1(1)),C_LOC(s1(1)%c)), h5kind_to_type(r_k8,H5_REAL_KIND), hdferr) + CALL H5Tinsert_f(s1_tid, "b_name", H5OFFSETOF(C_LOC(s1(1)),C_LOC(s1(1)%b)), h5kind_to_type(r_k4,H5_REAL_KIND), hdferr) + + ! Create an array of integer datatype + CALL h5tarray_create_f(h5kind_to_type(int_k8,H5_INTEGER_KIND), 1, tdims1a, tid3a, hdferr) + CALL H5Tinsert_f(s1_tid, "d_name", H5OFFSETOF(C_LOC(s1(1)),C_LOC(s1(1)%d%x)), tid3a, hdferr) + + ! + ! Create the dataset. + ! + CALL H5Dcreate_f(file, DATASETNAME, s1_tid, space, dataset, hdferr) + + ! + ! Write data to the dataset + ! + + f_ptr = C_LOC(s1(1)) + CALL H5Dwrite_f(dataset, s1_tid, f_ptr, hdferr) + + ! + ! Release resources + ! + CALL H5Tclose_f(s1_tid, hdferr) + CALL H5Sclose_f(space, hdferr) + CALL H5Dclose_f(dataset, hdferr) + CALL H5Fclose_f(file, hdferr) + + ! + ! Open the file and the dataset. + ! + + CALL H5Fopen_f(H5FILE_NAME, H5F_ACC_RDONLY_F, file, hdferr) + + CALL H5Dopen_f(file, DATASETNAME, dataset,hdferr) + ! + ! Create a data type for s2 + ! + CALL H5Tcreate_f(H5T_COMPOUND_F, H5OFFSETOF(C_LOC(s2(1)), C_LOC(s2(2))), s2_tid, hdferr) + + CALL H5Tinsert_f(s2_tid, "chr_name", H5OFFSETOF(C_LOC(s2(1)),C_LOC(s2(1)%chr)), tid3, hdferr) + CALL H5Tinsert_f(s2_tid, "c_name", H5OFFSETOF(C_LOC(s2(1)),C_LOC(s2(1)%c)), h5kind_to_type(r_k8,H5_REAL_KIND), hdferr) + CALL H5Tinsert_f(s2_tid, "a_name", H5OFFSETOF(C_LOC(s2(1)),C_LOC(s2(1)%a)), h5kind_to_type(int_k1,H5_INTEGER_KIND), hdferr) + CALL H5Tinsert_f(s2_tid, "d_name", H5OFFSETOF(C_LOC(s2(1)),C_LOC(s2(1)%d%x)), tid3a, hdferr) + + ! + ! Read two fields c and a from s1 dataset. Fields in the file + ! are found by their names "c_name" and "a_name". + + f_ptr = C_LOC(s2(1)) + CALL H5Dread_f(dataset, s2_tid, f_ptr, hdferr) + + ! + ! Display the fields + ! + DO i = 1, length + WRITE(*,'(/,A,/,999(A,1X))') "Field chr :", s2(i)%chr(1:7)(1:1) + ENDDO + WRITE(*,'(/,A,/,999(F8.4,1X))') "Field c :", s2(:)%c + WRITE(*,'(/,A,/,999(I0,1X))') "Field a :", s2(:)%a + DO i = 1, length + WRITE(*,'(/,A,/,999(I0,1X))') "Field d%x :", s2(i)%d%x(:) + ENDDO + ! + ! Create a data type for s3. + ! + CALL H5Tcreate_f(H5T_COMPOUND_F, H5OFFSETOF(C_LOC(s3(1)),C_LOC(s3(2))),s3_tid, hdferr) + + CALL H5Tinsert_f(s3_tid, "b_name", 0_size_t, h5kind_to_type(r_k4,H5_REAL_KIND), hdferr) + ! + ! Read field b from s1 dataset. Field in the file is found by its name. + ! + s3(:)=-1 + f_ptr = C_LOC(s3(1)) + CALL H5Dread_f(dataset, s3_tid, f_ptr, hdferr) + ! + ! Display the field + ! + WRITE(*,'(/,A,/,999(F8.4,1X))') "Field b :",s3(:) + ! + ! Release resources + ! + CALL H5Tclose_f(s2_tid, hdferr) + CALL H5Tclose_f(s3_tid, hdferr) + CALL H5Dclose_f(dataset, hdferr) + CALL H5Fclose_f(file, hdferr) + +END PROGRAM main diff --git a/fortran/examples/run-fortran-ex.sh.in b/fortran/examples/run-fortran-ex.sh.in index 2ab4aef..873669f 100755 --- a/fortran/examples/run-fortran-ex.sh.in +++ b/fortran/examples/run-fortran-ex.sh.in @@ -33,8 +33,8 @@ EXIT_SUCCESS=0 EXIT_FAILURE=1 # Where the tool is installed. -# Note: no '/' after DESTDIR. Explanation in commence.am -prefix="${prefix:-${DESTDIR}@prefix@}" +# default is relative path to installed location of the tools +prefix="${prefix:-../../../}" PARALLEL=@PARALLEL@ # Am I in parallel mode? AR="@AR@" RANLIB="@RANLIB@" diff --git a/fortran/examples/rwdset_fortran2003.f90 b/fortran/examples/rwdset_fortran2003.f90 new file mode 100644 index 0000000..74bda85 --- /dev/null +++ b/fortran/examples/rwdset_fortran2003.f90 @@ -0,0 +1,181 @@ +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +! +! The following example shows how to write and read to/from an existing dataset. +! It opens the file created in the previous example, obtains the dataset +! identifier, writes the data to the dataset in the file, +! then reads the dataset to memory. Uses updated Fortran 2003 interface +! with different KINDs of integers and reals. +! +PROGRAM RWDSET_FORTRAN2003 + + USE ISO_C_BINDING + + USE HDF5 ! This module contains all necessary modules + + IMPLICIT NONE + + INTEGER, PARAMETER :: int_kind_1 = SELECTED_INT_KIND(Fortran_INTEGER_1) !should map to INTEGER*1 on most modern processors + INTEGER, PARAMETER :: int_kind_4 = SELECTED_INT_KIND(Fortran_INTEGER_2) !should map to INTEGER*2 on most modern processors + INTEGER, PARAMETER :: int_kind_8 = SELECTED_INT_KIND(Fortran_INTEGER_4) !should map to INTEGER*4 on most modern processors + INTEGER, PARAMETER :: int_kind_16 = SELECTED_INT_KIND(Fortran_INTEGER_8) !should map to INTEGER*8 on most modern processors + + INTEGER, PARAMETER :: real_kind_7 = SELECTED_REAL_KIND(Fortran_REAL_4) !should map to REAL*4 on most modern processors + INTEGER, PARAMETER :: real_kind_15 = SELECTED_REAL_KIND(Fortran_REAL_8) !should map to REAL*8 on most modern processors + + CHARACTER(LEN=8), PARAMETER :: filename = "dsetf.h5" ! File name + CHARACTER(LEN=5), PARAMETER :: dsetname1 = "dset1" ! Dataset name + CHARACTER(LEN=5), PARAMETER :: dsetname2 = "dset2" ! Dataset name + CHARACTER(LEN=5), PARAMETER :: dsetname4 = "dset4" ! Dataset name + CHARACTER(LEN=5), PARAMETER :: dsetname8 = "dset8" ! Dataset name + CHARACTER(LEN=6), PARAMETER :: dsetnamer4 = "dsetr4" ! Dataset name + CHARACTER(LEN=6), PARAMETER :: dsetnamer8 = "dsetr8" ! Dataset name + + INTEGER(HID_T) :: file_id ! File identifier + INTEGER(HID_T) :: dset_id1 ! Dataset identifier + INTEGER(HID_T) :: dset_id4 ! Dataset identifier + INTEGER(HID_T) :: dset_id8 ! Dataset identifier + INTEGER(HID_T) :: dset_id16 ! Dataset identifier + INTEGER(HID_T) :: dset_idr4 ! Dataset identifier + INTEGER(HID_T) :: dset_idr8 ! Dataset identifier + + INTEGER :: error ! Error flag + INTEGER :: i, j + +! Data buffers: + + INTEGER, DIMENSION(1:4) :: dset_data + + INTEGER(int_kind_1), DIMENSION(1:4), TARGET :: dset_data_i1, data_out_i1 + INTEGER(int_kind_4), DIMENSION(1:4), TARGET :: dset_data_i4, data_out_i4 + INTEGER(int_kind_8), DIMENSION(1:4), TARGET :: dset_data_i8, data_out_i8 + INTEGER(int_kind_16), DIMENSION(1:4), TARGET :: dset_data_i16, data_out_i16 + + INTEGER(int_kind_8), DIMENSION(1:4), TARGET :: data_out_i8a + + REAL(real_kind_7), DIMENSION(1:4), TARGET :: dset_data_r7, data_out_r7 + REAL(real_kind_15), DIMENSION(1:4), TARGET :: dset_data_r15, data_out_r15 + + INTEGER(HSIZE_T), DIMENSION(1:1) :: data_dims = (/4/) + INTEGER(HID_T) :: dspace_id ! Dataspace identifier + + TYPE(C_PTR) :: f_ptr + INTEGER(hid_t) :: datatype !/* Common datatype ID */ + + ! + ! Initialize FORTRAN interface. + ! + CALL h5open_f(error) + ! + ! Initialize the dset_data array. + ! + DO i = 1, 4 + dset_data_i1(i) = i + dset_data_i4(i) = i + dset_data_i8(i) = i + dset_data_i16(i) = i + + dset_data_r7(i) = (i)*100. + dset_data_r15(i) = (i)*1000. + + END DO + + CALL h5fcreate_f(filename, H5F_ACC_TRUNC_F, file_id, error) + ! + ! Create dataspaces for datasets + ! + CALL h5screate_simple_f(1, data_dims , dspace_id, error) + ! + ! Create the dataset. + ! + CALL H5Dcreate_f(file_id, dsetname1, h5kind_to_type(int_kind_1,H5_INTEGER_KIND), dspace_id, dset_id1, error) + CALL H5Dcreate_f(file_id, dsetname2, h5kind_to_type(int_kind_4,H5_INTEGER_KIND), dspace_id, dset_id4, error) + CALL H5Dcreate_f(file_id, dsetname4, h5kind_to_type(int_kind_8,H5_INTEGER_KIND), dspace_id, dset_id8, error) + CALL H5Dcreate_f(file_id, dsetname8, h5kind_to_type(int_kind_16,H5_INTEGER_KIND), dspace_id, dset_id16, error) + + CALL H5Dcreate_f(file_id, dsetnamer4, h5kind_to_type(real_kind_7,H5_REAL_KIND), dspace_id, dset_idr4, error) + CALL H5Dcreate_f(file_id, dsetnamer8, h5kind_to_type(real_kind_15,H5_REAL_KIND), dspace_id, dset_idr8, error) + + ! + ! Write the dataset. + ! + f_ptr = C_LOC(dset_data_i1(1)) + CALL h5dwrite_f(dset_id1, h5kind_to_type(int_kind_1,H5_INTEGER_KIND), f_ptr, error) + f_ptr = C_LOC(dset_data_i4(1)) + CALL h5dwrite_f(dset_id4, h5kind_to_type(int_kind_4,H5_INTEGER_KIND), f_ptr, error) + f_ptr = C_LOC(dset_data_i8(1)) + CALL h5dwrite_f(dset_id8, h5kind_to_type(int_kind_8,H5_INTEGER_KIND), f_ptr, error) + f_ptr = C_LOC(dset_data_i16(1)) + CALL h5dwrite_f(dset_id16, h5kind_to_type(int_kind_16,H5_INTEGER_KIND), f_ptr, error) + f_ptr = C_LOC(dset_data_r7(1)) + CALL h5dwrite_f(dset_idr4, h5kind_to_type(real_kind_7,H5_REAL_KIND), f_ptr, error) + f_ptr = C_LOC(dset_data_r15(1)) + CALL h5dwrite_f(dset_idr8, h5kind_to_type(real_kind_15,H5_REAL_KIND), f_ptr, error) + ! + ! Close the file + ! + CALL h5fclose_f(file_id, error) + + ! Open the file + + CALL h5fopen_f(filename, H5F_ACC_RDWR_F, file_id, error) + ! + ! Read the dataset. + ! + ! Read data back into an integer size that is larger then the original size used for + ! writing the data + f_ptr = C_LOC(data_out_i8a(1)) + CALL h5dread_f(dset_id1, h5kind_to_type(int_kind_8,H5_INTEGER_KIND), f_ptr, error) + f_ptr = C_LOC(data_out_i4(1)) + CALL h5dread_f(dset_id4, h5kind_to_type(int_kind_4,H5_INTEGER_KIND), f_ptr, error) + f_ptr = C_LOC(data_out_i8(1)) + CALL h5dread_f(dset_id8, h5kind_to_type(int_kind_8,H5_INTEGER_KIND), f_ptr, error) + f_ptr = C_LOC(data_out_i16(1)) + CALL h5dread_f(dset_id16, h5kind_to_type(int_kind_16,H5_INTEGER_KIND), f_ptr, error) + f_ptr = C_LOC(data_out_r7(1)) + CALL h5dread_f(dset_idr4, h5kind_to_type(real_kind_7,H5_REAL_KIND), f_ptr, error) + f_ptr = C_LOC(data_out_r15(1)) + CALL h5dread_f(dset_idr8, h5kind_to_type(real_kind_15,H5_REAL_KIND), f_ptr, error) + +! memory type + WRITE(*,'(A,4i8)' )'SELECTED_INT_KIND(Fortran_INTEGER_1): ',data_out_i8a + WRITE(*,'(A,4i8)' )'SELECTED_INT_KIND(Fortran_INTEGER_4): ',data_out_i4 + WRITE(*,'(A,4i8)' )'SELECTED_INT_KIND(Fortran_INTEGER_8): ',data_out_i8 + WRITE(*,'(A,4i8)' )'SELECTED_INT_KIND(Fortran_INTEGER_16): ',data_out_i16 + WRITE(*,'(A,4(1x,f9.4))' )'SELECTED_REAL_KIND(Fortran_REAL_7): ',data_out_r7 + WRITE(*,'(A,4(1x,f16.10))' )'SELECTED_REAL_KIND(Fortran_REAL_15): ',data_out_r15 + ! + ! Close the dataset. + ! + CALL h5dclose_f(dset_id1, error) + CALL h5dclose_f(dset_id4, error) + CALL h5dclose_f(dset_id8, error) + CALL h5dclose_f(dset_id16, error) + CALL h5dclose_f(dset_idr4, error) + CALL h5dclose_f(dset_idr8, error) + ! + ! Close the file. + ! + CALL h5fclose_f(file_id, error) + ! + ! Close FORTRAN interface. + ! + CALL h5close_f(error) + +END PROGRAM RWDSET_FORTRAN2003 + + + diff --git a/fortran/robodoc.rc b/fortran/robodoc.rc new file mode 100644 index 0000000..1366f77 --- /dev/null +++ b/fortran/robodoc.rc @@ -0,0 +1,73 @@ +items: + NAME + COPYRIGHT + SYNOPSIS + USAGE + FUNCTION + DESCRIPTION + PURPOSE + AUTHOR + CREATION DATE + MODIFICATION HISTORY + HISTORY + INPUTS + ARGUMENTS + OPTIONS + PARAMETERS + SWITCHES + OUTPUTS + SIDE EFFECTS + RESULT + RETURN VALUE + EXAMPLE + NOTES + DIAGNOSTICS + WARNINGS + ERRORS + BUGS + TODO + IDEAS + PORTABILITY + SEE ALSO + METHODS + NEW METHODS + ATTRIBUTES + NEW ATTRIBUTES + TAGS + DERIVED FROM + DERIVED BY + USES + CHILDREN + USED BY + PARENTS + COMMANDS + SOURCE + CONTAINS SUBROUTINES + OPTIONAL PARAMETERS + FILE +ignore items: + COPYRIGHT +headertypes: + s Subroutines robo_subroutines +options: + --nogeneratedwith + --src ./ + --doc ./doc/DevelGuide + --html + --multidoc + --index + --tabsize 8 + --sections + --sectionnameonly + --documenttitle "HDF5 FORTRAN Developer's Guide" + --cmode +ignore files: + .svn + *~ + *.o + *e + *.mod +accept files: + *.c + *.f90 + *.h diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index d5cbc1b..3d1c127 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -1,16 +1,7 @@ -cmake_minimum_required (VERSION 2.8) +cmake_minimum_required (VERSION 2.8.6) PROJECT (HDF5_F90_SRC C CXX Fortran) #----------------------------------------------------------------------------- -# When building utility executables that generate other (source) files : -# we make use of the following variables defined in the root CMakeLists. -# Certain systems may add /Debug or /Release to output paths -# and we need to call the executable from inside the CMake configuration -#----------------------------------------------------------------------------- -#inherit EXE_EXT from parent HDF5 cmake project -#inherit CFG_INIT from parent HDF5 cmake project - -#----------------------------------------------------------------------------- # Setup the Fortran auto-detection utilities # H5test_kind(_SIZEOF).f90 used to generate H5fortran_detect.f90 # H5fortran_detect.f90 used to generate H5fort_type_defines.h @@ -39,7 +30,7 @@ IF (WIN32 AND MSVC) ENDIF (WIN32 AND MSVC) SET_TARGET_PROPERTIES (H5test_FortranHavekind PROPERTIES LINKER_LANGUAGE Fortran) -SET (CMD ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}${CFG_INIT}/H5test_FortranHavekind${EXE_EXT}) +SET (CMD $) ADD_CUSTOM_COMMAND ( OUTPUT ${HDF5_F90_BINARY_DIR}/H5fortran_detect.f90 COMMAND ${CMD} @@ -63,9 +54,9 @@ IF (WIN32 AND MSVC) LINK_FLAGS "/SUBSYSTEM:CONSOLE" ) ENDIF (WIN32 AND MSVC) -SET_TARGET_PROPERTIES (H5test_FortranHavekind PROPERTIES LINKER_LANGUAGE Fortran) +SET_TARGET_PROPERTIES (H5fortran_detect PROPERTIES LINKER_LANGUAGE Fortran) -SET (CMD ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}${CFG_INIT}/H5fortran_detect${EXE_EXT}) +SET (CMD $) ADD_CUSTOM_COMMAND ( OUTPUT ${HDF5_F90_BINARY_DIR}/H5fort_type_defines.h COMMAND ${CMD} @@ -80,7 +71,7 @@ ADD_EXECUTABLE (H5match_types ${HDF5_F90_BINARY_DIR}/H5fort_type_defines.h ${HDF5_F90_SRC_SOURCE_DIR}/H5match_types.c ) -SET (CMD ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}${CFG_INIT}/H5match_types${EXE_EXT}) +SET (CMD $) ADD_CUSTOM_COMMAND ( OUTPUT ${HDF5_F90_BINARY_DIR}/H5f90i_gen.h ${HDF5_F90_BINARY_DIR}/H5fortran_types.f90 @@ -124,9 +115,21 @@ ENDIF (H5_HAVE_PARALLEL) SET_SOURCE_FILES_PROPERTIES (${f90CStub_C_SRCS} PROPERTIES LANGUAGE C) ADD_LIBRARY (${HDF5_F90_C_LIB_TARGET} ${LIB_TYPE} ${f90CStub_C_SRCS}) -TARGET_LINK_LIBRARIES (${HDF5_F90_C_LIB_TARGET} ${HDF5_LIB_TARGET}) +TARGET_LINK_LIBRARIES (${HDF5_F90_C_LIB_TARGET} ${HDF5_LIB_TARGET} ${LINK_LIBS}) SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_F90_C_LIB_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_F90_C_LIB_TARGET} ${HDF5_F90_C_LIB_NAME} ${LIB_TYPE}) +SET_TARGET_PROPERTIES (${HDF5_F90_C_LIB_TARGET} PROPERTIES FOLDER libraries/fortran) + +#----------------------------------------------------------------------------- +# Fortran 2003 standard +#----------------------------------------------------------------------------- +IF (FORTRAN_HAVE_ISO_C_BINDING AND HDF5_ENABLE_F2003) + # default real is 4 bytes, so include double signatures + SET (F_STATUS "_F03") +ELSE (FORTRAN_HAVE_ISO_C_BINDING AND HDF5_ENABLE_F2003) + # default real is 8 bytes, so exclude double signatures + SET (F_STATUS "_F90") +ENDIF (FORTRAN_HAVE_ISO_C_BINDING AND HDF5_ENABLE_F2003) #----------------------------------------------------------------------------- # Fortran Real Size @@ -148,6 +151,7 @@ SET (f90_F_SRCS # normal distribution ${HDF5_F90_SRC_SOURCE_DIR}/H5f90global.f90 + ${HDF5_F90_SRC_SOURCE_DIR}/H5_ff${F_STATUS}.f90 ${HDF5_F90_SRC_SOURCE_DIR}/H5_ff.f90 ${HDF5_F90_SRC_SOURCE_DIR}/H5Aff.f90 ${HDF5_F90_SRC_SOURCE_DIR}/H5Dff.f90 @@ -162,24 +166,32 @@ SET (f90_F_SRCS ${HDF5_F90_SRC_SOURCE_DIR}/H5Sff.f90 ${HDF5_F90_SRC_SOURCE_DIR}/H5Tff.f90 ${HDF5_F90_SRC_SOURCE_DIR}/H5Zff.f90 + ${HDF5_F90_SRC_SOURCE_DIR}/H5Aff${F_STATUS}.f90 + ${HDF5_F90_SRC_SOURCE_DIR}/H5Dff${F_STATUS}.f90 + ${HDF5_F90_SRC_SOURCE_DIR}/H5Eff${F_STATUS}.f90 + ${HDF5_F90_SRC_SOURCE_DIR}/H5Lff${F_STATUS}.f90 + ${HDF5_F90_SRC_SOURCE_DIR}/H5Off${F_STATUS}.f90 + ${HDF5_F90_SRC_SOURCE_DIR}/H5Pff${F_STATUS}.f90 + ${HDF5_F90_SRC_SOURCE_DIR}/H5Rff${F_STATUS}.f90 + ${HDF5_F90_SRC_SOURCE_DIR}/H5Tff${F_STATUS}.f90 ${HDF5_F90_SRC_SOURCE_DIR}/H5_DBLE_Interface${F_DBLE}.f90 ) #----------------------------------------------------------------------------- # Add H5FDMPIO if parallel #----------------------------------------------------------------------------- -IF (H5_HAVE_PARALLEL) +IF (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) SET (f90_F_SRCS ${f90_F_SRCS} ${HDF5_F90_SRC_SOURCE_DIR}/HDF5mpio.f90 ${HDF5_F90_SRC_SOURCE_DIR}/H5FDmpioff.f90 ) -ELSE (H5_HAVE_PARALLEL) +ELSE (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) SET (f90_F_SRCS ${f90_F_SRCS} ${HDF5_F90_SRC_SOURCE_DIR}/HDF5.f90 ) -ENDIF (H5_HAVE_PARALLEL) +ENDIF (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) #----------------------------------------------------------------------------- # Add Main fortran library @@ -189,23 +201,31 @@ SET (SHARED_LINK_FLAGS " ") IF (WIN32 AND NOT CYGWIN) IF (BUILD_SHARED_LIBS) SET_PROPERTY (TARGET ${HDF5_F90_LIB_TARGET} - APPEND PROPERTY COMPILE_DEFINITIONS - BUILD_HDF5_DLL - ) + APPEND PROPERTY COMPILE_DEFINITIONS + BUILD_HDF5_DLL + ) IF (MSVC) - SET (SHARED_LINK_FLAGS "/DLL /DEF:${HDF5_F90_SRC_SOURCE_DIR}/hdf5_fortrandll.def") + IF (H5_HAVE_PARALLEL) + SET (SHARED_LINK_FLAGS "/DLL /DEF:${HDF5_F90_SRC_SOURCE_DIR}/phdf5_fortrandll.def") + ELSE (H5_HAVE_PARALLEL) + SET (SHARED_LINK_FLAGS "/DLL /DEF:${HDF5_F90_SRC_SOURCE_DIR}/hdf5_fortrandll.def") + ENDIF (H5_HAVE_PARALLEL) ENDIF (MSVC) ENDIF (BUILD_SHARED_LIBS) SET_PROPERTY (TARGET ${HDF5_F90_LIB_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS - HDF5F90_WINDOWS + HDF5F90_WINDOWS ) ENDIF (WIN32 AND NOT CYGWIN) TARGET_FORTRAN_WIN_PROPERTIES (${HDF5_F90_LIB_TARGET} ${SHARED_LINK_FLAGS}) SET_TARGET_PROPERTIES (${HDF5_F90_LIB_TARGET} PROPERTIES LINKER_LANGUAGE Fortran) TARGET_LINK_LIBRARIES (${HDF5_F90_LIB_TARGET} ${HDF5_F90_C_LIB_TARGET} ${HDF5_LIB_TARGET}) +IF (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) + TARGET_LINK_LIBRARIES (${HDF5_F90_LIB_TARGET} ${MPI_Fortran_LIBRARIES}) +ENDIF (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_F90_LIB_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_F90_LIB_TARGET} ${HDF5_F90_LIB_NAME} ${LIB_TYPE}) +SET_TARGET_PROPERTIES (${HDF5_F90_LIB_TARGET} PROPERTIES FOLDER libraries/fortran) #----------------------------------------------------------------------------- # Add file(s) to CMake Install @@ -223,14 +243,25 @@ INSTALL ( fortheaders ) -INSTALL ( - DIRECTORY - ${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/ - DESTINATION - ${HDF5_INSTALL_INCLUDE_DIR}/fortran - COMPONENT - fortheaders -) +IF (WIN32 AND NOT CYGWIN) + INSTALL ( + DIRECTORY + ${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/ + DESTINATION + ${HDF5_INSTALL_INCLUDE_DIR}/fortran + COMPONENT + fortheaders + ) +ELSE (WIN32 AND NOT CYGWIN) + INSTALL ( + DIRECTORY + ${CMAKE_Fortran_MODULE_DIRECTORY}/ + DESTINATION + ${HDF5_INSTALL_INCLUDE_DIR}/fortran + COMPONENT + fortheaders + ) +ENDIF (WIN32 AND NOT CYGWIN) #----------------------------------------------------------------------------- # Add Target(s) to CMake Install for import into other projects diff --git a/fortran/src/H5Af.c b/fortran/src/H5Af.c index 8e6158e..896736d 100644 --- a/fortran/src/H5Af.c +++ b/fortran/src/H5Af.c @@ -1,4 +1,9 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +/****h* H5Af/H5Af + * PURPOSE + * This file contains C stubs for H5A Fortran APIs + * + * COPYRIGHT + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * @@ -11,31 +16,41 @@ * is linked from the top-level documents page. It can also be found at * * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * * access to either file, you may request a copy from help@hdfgroup.org. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -/* This files contains C stubs for H5A Fortran APIs */ + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * + ****** +*/ #include "H5f90.h" #include "H5Eprivate.h" -/*---------------------------------------------------------------------------- - * Name: h5acreate_c - * Purpose: Call H5Acreate2 to create an attribute - * Inputs: obj_id - object identifier +/****if* H5Af/h5acreate_c + * NAME + * h5acreate_c + * PURPOSE + * Call H5Acreate2 to create an attribute + * INPUTS + * obj_id - object identifier * name - name of the attribute * namelen - name length * type_id - datatype identifier * space_id - dataspace identifier * crt_pr - identifier of creation property list - * Outputs: attr_id - attribute identifier - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * OUTPUTS + * attr_id - attribute identifier + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Thursday, August 12, 1999 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5acreate_c(hid_t_f *obj_id, _fcd name, size_t_f *namelen, hid_t_f *type_id, hid_t_f *space_id, hid_t_f *crt_prp, hid_t_f *aapl, hid_t_f *attr_id) +/*******/ { char *c_name = NULL; /* Buffer to hold C string */ int_f ret_value = 0; /* Return value */ @@ -58,20 +73,29 @@ done: return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5aopen_name _c - * Purpose: Call H5Aopen to open an attribute - * Inputs: obj_id - object identifier +/****if* H5Af/h5aopen_name_c + * NAME + * h5aopen_name_c + * PURPOSE + * Call H5Aopen to open an attribute + * INPUTS + * obj_id - object identifier * name - name of the attribute * namelen - name length - * Outputs: attr_id - dataset identifier - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * OUTPUTS + * attr_id - dataset identifier + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Thursday, August 12, 1999 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5aopen_name_c (hid_t_f *obj_id, _fcd name, size_t_f *namelen, hid_t_f *attr_id) +/*******/ { char *c_name = NULL; /* Buffer to hold C string */ int_f ret_value = 0; /* Return value */ @@ -94,22 +118,30 @@ done: return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5awritec_c - * Purpose: Call h5awrite_c to write a character attribute - * Inputs: attr_id - dataset identifier +/****if* H5Af/h5awritec_c + * NAME + * h5awritec_c + * PURPOSE + * Call h5awrite_c to write a character attribute + * INPUTS + * attr_id - dataset identifier * mem_type_id - memory datatype identifier * buf - character data buffer * dims - array to store dimensions sizes of buf; used only * by Fortran routine. - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Thursday , August 12, 1999 - * Modifications: dims paramete added. + * HISTORY + * dims paramete added. * April 4, 2001 - *---------------------------------------------------------------------------*/ + * SOURCE +*/ int_f nh5awritec_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims) +/******/ { /* * Call h5awrite_c function. @@ -118,6 +150,7 @@ nh5awritec_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims) } int_f nh5awritec_s_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims) +/******/ { /* * Call h5awrite_c function. @@ -127,6 +160,7 @@ nh5awritec_s_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims) int_f nh5awritec_1_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims) +/******/ { /* * Call h5awrite_c function. @@ -136,6 +170,7 @@ nh5awritec_1_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims) int_f nh5awritec_2_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims) +/******/ { /* * Call h5awrite_c function. @@ -145,6 +180,7 @@ nh5awritec_2_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims) int_f nh5awritec_3_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims) +/******/ { /* * Call h5awrite_c function. @@ -154,6 +190,7 @@ nh5awritec_3_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims) int_f nh5awritec_4_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims) +/******/ { /* * Call h5awrite_c function. @@ -163,6 +200,7 @@ nh5awritec_4_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims) int_f nh5awritec_5_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims) +/******/ { /* * Call h5awrite_c function. @@ -172,6 +210,7 @@ nh5awritec_5_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims) int_f nh5awritec_6_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims) +/******/ { /* * Call h5awrite_c function. @@ -181,6 +220,7 @@ nh5awritec_6_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims) int_f nh5awritec_7_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims) +/******/ { /* * Call h5awrite_c function. @@ -190,26 +230,34 @@ nh5awritec_7_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims) -/*---------------------------------------------------------------------------- - * Name: h5awrite_c - * Purpose: Call H5Awrite to write a attribute - * Inputs: attr_id - attribute identifier +/****if* H5Af/h5awrite_c + * NAME + * h5awrite_c + * PURPOSE + * Call H5Awrite to write a attribute + * INPUTS + * attr_id - attribute identifier * mem_type_id - memory datatype identifier * buf - data buffer * dims - array to store dimensions sizes of buf; used only * by Fortran routine. - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Thursday, August 12, 1999 - * Modifications: dims parameter added + * HISTORY + * dims parameter added * April 4, 2001 * Added nh5awrite_integer(real,double)_s,1-7 functions to eliminate * complains about wrong parameters types in h5awrite_c function * called by Fortran routines. * October 9, 2006 EIP - *---------------------------------------------------------------------------*/ + * SOURCE +*/ int_f nh5awrite_integer_s_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims) +/******/ { /* * Call h5awrite_c function. @@ -219,6 +267,7 @@ nh5awrite_integer_s_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void U int_f nh5awrite_integer_1_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims) +/******/ { /* * Call h5awrite_c function. @@ -228,6 +277,7 @@ nh5awrite_integer_1_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void U int_f nh5awrite_integer_2_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims) +/******/ { /* * Call h5awrite_c function. @@ -237,6 +287,7 @@ nh5awrite_integer_2_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void U int_f nh5awrite_integer_3_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims) +/******/ { /* * Call h5awrite_c function. @@ -246,6 +297,7 @@ nh5awrite_integer_3_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void U int_f nh5awrite_integer_4_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims) +/******/ { /* * Call h5awrite_c function. @@ -255,6 +307,7 @@ nh5awrite_integer_4_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void U int_f nh5awrite_integer_5_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims) +/******/ { /* * Call h5awrite_c function. @@ -264,6 +317,7 @@ nh5awrite_integer_5_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void U int_f nh5awrite_integer_6_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims) +/******/ { /* * Call h5awrite_c function. @@ -273,6 +327,7 @@ nh5awrite_integer_6_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void U int_f nh5awrite_integer_7_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims) +/******/ { /* * Call h5awrite_c function. @@ -282,6 +337,7 @@ nh5awrite_integer_7_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void U int_f nh5awrite_real_s_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims) +/******/ { /* * Call h5awrite_c function. @@ -291,6 +347,7 @@ nh5awrite_real_s_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUS int_f nh5awrite_real_1_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims) +/******/ { /* * Call h5awrite_c function. @@ -300,6 +357,7 @@ nh5awrite_real_1_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUS int_f nh5awrite_real_2_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims) +/******/ { /* * Call h5awrite_c function. @@ -309,6 +367,7 @@ nh5awrite_real_2_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUS int_f nh5awrite_real_3_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims) +/******/ { /* * Call h5awrite_c function. @@ -318,6 +377,7 @@ nh5awrite_real_3_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUS int_f nh5awrite_real_4_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims) +/******/ { /* * Call h5awrite_c function. @@ -327,6 +387,7 @@ nh5awrite_real_4_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUS int_f nh5awrite_real_5_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims) +/******/ { /* * Call h5awrite_c function. @@ -336,6 +397,7 @@ nh5awrite_real_5_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUS int_f nh5awrite_real_6_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims) +/******/ { /* * Call h5awrite_c function. @@ -345,6 +407,7 @@ nh5awrite_real_6_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUS int_f nh5awrite_real_7_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims) +/******/ { /* * Call h5awrite_c function. @@ -354,6 +417,7 @@ nh5awrite_real_7_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUS int_f nh5awrite_double_s_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims) +/******/ { /* * Call h5awrite_c function. @@ -363,6 +427,7 @@ nh5awrite_double_s_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UN int_f nh5awrite_double_1_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims) +/******/ { /* * Call h5awrite_c function. @@ -372,6 +437,7 @@ nh5awrite_double_1_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UN int_f nh5awrite_double_2_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims) +/******/ { /* * Call h5awrite_c function. @@ -381,6 +447,7 @@ nh5awrite_double_2_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UN int_f nh5awrite_double_3_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims) +/******/ { /* * Call h5awrite_c function. @@ -390,6 +457,7 @@ nh5awrite_double_3_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UN int_f nh5awrite_double_4_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims) +/******/ { /* * Call h5awrite_c function. @@ -399,6 +467,7 @@ nh5awrite_double_4_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UN int_f nh5awrite_double_5_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims) +/******/ { /* * Call h5awrite_c function. @@ -408,6 +477,7 @@ nh5awrite_double_5_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UN int_f nh5awrite_double_6_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims) +/******/ { /* * Call h5awrite_c function. @@ -417,6 +487,7 @@ nh5awrite_double_6_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UN int_f nh5awrite_double_7_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims) +/******/ { /* * Call h5awrite_c function. @@ -426,6 +497,7 @@ nh5awrite_double_7_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UN int_f nh5awrite_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims) +/******/ { int_f ret_value=0; /* Return value */ @@ -440,26 +512,35 @@ done: } -/*---------------------------------------------------------------------------- - * Name: h5areadc_c - * Purpose: Call h5aread_c to read character attribute - * Inputs: dset_id - dataset identifier +/****if* H5Af/h5areadc_c + * NAME + * h5areadc_c + * PURPOSE + * Call h5aread_c to read character attribute + * INPUTS + * dset_id - dataset identifier * mem_type_id - memory datatype identifier * dims - array to store dimensions sizes of buf; used only * by Fortran routine. - * Outputs: buf - character data buffer - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * OUTPUTS + * buf - character data buffer + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Thursday, August 12, 1999 - * Modifications: dims parameter added. + * HISTORY + * dims parameter added. * April 4, 2001 * Added nh5areadc_s,1-7 functions to eliminate * complains about wrong parameters types in h5awrite_c function * called by Fortran routines. * October 9, 2006 EIP - *---------------------------------------------------------------------------*/ + * SOURCE +*/ int_f nh5areadc_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims) +/******/ { /* * Call h5aread_c function. @@ -468,6 +549,7 @@ nh5areadc_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims) } int_f nh5areadc_s_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims) +/******/ { /* * Call h5aread_c function. @@ -477,6 +559,7 @@ nh5areadc_s_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims) int_f nh5areadc_1_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims) +/******/ { /* * Call h5aread_c function. @@ -486,6 +569,7 @@ nh5areadc_1_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims) int_f nh5areadc_2_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims) +/******/ { /* * Call h5aread_c function. @@ -495,6 +579,7 @@ nh5areadc_2_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims) int_f nh5areadc_3_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims) +/******/ { /* * Call h5aread_c function. @@ -504,6 +589,7 @@ nh5areadc_3_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims) int_f nh5areadc_4_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims) +/******/ { /* * Call h5aread_c function. @@ -513,6 +599,7 @@ nh5areadc_4_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims) int_f nh5areadc_5_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims) +/******/ { /* * Call h5aread_c function. @@ -522,6 +609,7 @@ nh5areadc_5_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims) int_f nh5areadc_6_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims) +/******/ { /* * Call h5aread_c function. @@ -530,6 +618,7 @@ nh5areadc_6_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims) } int_f nh5areadc_7_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims) +/******/ { /* * Call h5aread_c function. @@ -539,26 +628,35 @@ nh5areadc_7_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims) -/*---------------------------------------------------------------------------- - * Name: h5aread_c - * Purpose: Call H5Aread to read an attribute - * Inputs: dset_id - dataset identifier +/****if* H5Af/h5aread_c + * NAME + * h5aread_c + * PURPOSE + * Call H5Aread to read an attribute + * INPUTS + * dset_id - dataset identifier * mem_type_id - memory datatype identifier * dims - array to store dimensions sizes of buf; used only * by Fortran routine. - * Outputs: buf - data buffer - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * OUTPUTS + * buf - data buffer + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Thursday, August 12, 1999 - * Modifications: dims paramete added. + * HISTORY + * dims paramete added. * April 4, 2001 * Added nh5aread_integer(real,double)_s,1-7 functions to eliminate * complains about wrong parameters types in h5awrite_c function * called by Fortran routines. * October 9, 2006 EIP - *---------------------------------------------------------------------------*/ + * SOURCE +*/ int_f nh5aread_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED * dims) +/******/ { int_f ret_value=0; /* Return value */ @@ -574,6 +672,7 @@ done: int_f nh5aread_integer_s_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED * dims) +/******/ { /* * Call h5aread_c function. @@ -583,6 +682,7 @@ nh5aread_integer_s_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UN int_f nh5aread_integer_1_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED * dims) +/******/ { /* * Call h5aread_c function. @@ -592,6 +692,7 @@ nh5aread_integer_1_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UN int_f nh5aread_integer_2_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED * dims) +/******/ { /* * Call h5aread_c function. @@ -601,6 +702,7 @@ nh5aread_integer_2_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UN int_f nh5aread_integer_3_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED * dims) +/******/ { /* * Call h5aread_c function. @@ -610,6 +712,7 @@ nh5aread_integer_3_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UN int_f nh5aread_integer_4_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED * dims) +/******/ { /* * Call h5aread_c function. @@ -619,6 +722,7 @@ nh5aread_integer_4_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UN int_f nh5aread_integer_5_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED * dims) +/******/ { /* * Call h5aread_c function. @@ -628,6 +732,7 @@ nh5aread_integer_5_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UN int_f nh5aread_integer_6_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED * dims) +/******/ { /* * Call h5aread_c function. @@ -637,6 +742,7 @@ nh5aread_integer_6_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UN int_f nh5aread_integer_7_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED * dims) +/******/ { /* * Call h5aread_c function. @@ -646,6 +752,7 @@ nh5aread_integer_7_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UN int_f nh5aread_real_s_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED * dims) +/******/ { /* * Call h5aread_c function. @@ -655,6 +762,7 @@ nh5aread_real_s_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSE int_f nh5aread_real_1_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED * dims) +/******/ { /* * Call h5aread_c function. @@ -664,6 +772,7 @@ nh5aread_real_1_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSE int_f nh5aread_real_2_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED * dims) +/******/ { /* * Call h5aread_c function. @@ -673,6 +782,7 @@ nh5aread_real_2_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSE int_f nh5aread_real_3_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED * dims) +/******/ { /* * Call h5aread_c function. @@ -682,6 +792,7 @@ nh5aread_real_3_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSE int_f nh5aread_real_4_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED * dims) +/******/ { /* * Call h5aread_c function. @@ -691,6 +802,7 @@ nh5aread_real_4_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSE int_f nh5aread_real_5_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED * dims) +/******/ { /* * Call h5aread_c function. @@ -700,6 +812,7 @@ nh5aread_real_5_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSE int_f nh5aread_real_6_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED * dims) +/******/ { /* * Call h5aread_c function. @@ -709,6 +822,7 @@ nh5aread_real_6_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSE int_f nh5aread_real_7_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED * dims) +/******/ { /* * Call h5aread_c function. @@ -718,6 +832,7 @@ nh5aread_real_7_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSE int_f nh5aread_double_s_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED * dims) +/******/ { /* * Call h5aread_c function. @@ -727,6 +842,7 @@ nh5aread_double_s_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNU int_f nh5aread_double_1_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED * dims) +/******/ { /* * Call h5aread_c function. @@ -736,6 +852,7 @@ nh5aread_double_1_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNU int_f nh5aread_double_2_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED * dims) +/******/ { /* * Call h5aread_c function. @@ -745,6 +862,7 @@ nh5aread_double_2_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNU int_f nh5aread_double_3_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED * dims) +/******/ { /* * Call h5aread_c function. @@ -754,6 +872,7 @@ nh5aread_double_3_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNU int_f nh5aread_double_4_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED * dims) +/******/ { /* * Call h5aread_c function. @@ -763,6 +882,7 @@ nh5aread_double_4_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNU int_f nh5aread_double_5_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED * dims) +/******/ { /* * Call h5aread_c function. @@ -772,6 +892,7 @@ nh5aread_double_5_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNU int_f nh5aread_double_6_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED * dims) +/******/ { /* * Call h5aread_c function. @@ -781,6 +902,7 @@ nh5aread_double_6_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNU int_f nh5aread_double_7_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED * dims) +/******/ { /* * Call h5aread_c function. @@ -789,18 +911,26 @@ nh5aread_double_7_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNU } -/*---------------------------------------------------------------------------- - * Name: h5aclose_c - * Purpose: Call H5Aclose to close an attribute - * Inputs: attr_id - identifier of an attribute to be closed - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal +/****if* H5Af/h5aclose_c + * NAME + * h5aclose_c + * PURPOSE + * Call H5Aclose to close an attribute + * INPUTS + * attr_id - identifier of an attribute to be closed + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Thursday, August 12, 1999 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5aclose_c ( hid_t_f *attr_id ) +/******/ { int_f ret_value=0; /* Return value */ @@ -811,19 +941,27 @@ done: return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5adelete_c - * Purpose: Call H5Adelete to delete an attribute - * Inputs: obj_id - object identifier +/****if* H5Af/h5adelete_c + * NAME + * h5adelete_c + * PURPOSE + * Call H5Adelete to delete an attribute + * INPUTS + * obj_id - object identifier * name - name of the attribute * namelen - name length - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Thursday, August 12, 1999 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5adelete_c (hid_t_f *obj_id, _fcd name, size_t_f *namelen) +/******/ { char *c_name = NULL; /* Buffer to hold C string */ int_f ret_value = 0; /* Return value */ @@ -848,19 +986,28 @@ done: } -/*---------------------------------------------------------------------------- - * Name: h5aopen_idx_c - * Purpose: Call H5Aopen_by_idx to open an attribute - * Inputs: obj_id - object identifier +/****if* H5Af/h5aopen_idx_c + * NAME + * h5aopen_idx_c + * PURPOSE + * Call H5Aopen_by_idx to open an attribute + * INPUTS + * obj_id - object identifier * idx - attribute index ( zero based) - * Outputs: attr_id - attribute identifier - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * OUTPUTS + * attr_id - attribute identifier + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Thursday, August 12, 1999 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5aopen_idx_c (hid_t_f *obj_id, int_f *idx, hid_t_f *attr_id) +/******/ { int_f ret_value = 0; /* Return value */ @@ -875,18 +1022,27 @@ done: } -/*---------------------------------------------------------------------------- - * Name: h5aget_space_c - * Purpose: Call H5Aget_space to get attribute's dataspace - * Inputs: attr_id - attribute identifier - * Outputs: space_id - dataspace identifier - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal +/****if* H5Af/h5aget_space_c + * NAME + * h5aget_space_c + * PURPOSE + * Call H5Aget_space to get attribute's dataspace + * INPUTS + * attr_id - attribute identifier + * OUTPUTS + * space_id - dataspace identifier + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Thursday, August 12, 1999 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5aget_space_c (hid_t_f *attr_id, hid_t_f *space_id) +/******/ { int_f ret_value=0; /* Return value */ @@ -900,18 +1056,27 @@ done: return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5aget_type_c - * Purpose: Call H5Aget_space to get attribute's datatype - * Inputs: attr_id - attribute identifier - * Outputs: type_id - datatype identifier - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal +/****if* H5Af/h5aget_type_c + * NAME + * h5aget_type_c + * PURPOSE + * Call H5Aget_space to get attribute's datatype + * INPUTS + * attr_id - attribute identifier + * OUTPUTS + * type_id - datatype identifier + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Thursday, August 12, 1999 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5aget_type_c (hid_t_f *attr_id, hid_t_f *type_id) +/******/ { int_f ret_value=0; /* Return value */ @@ -925,19 +1090,27 @@ done: return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5aget_num_attrs_c - * Purpose: Call H5Oget_info to determine number of +/****if* H5Af/h5aget_num_attrs_c + * NAME + * h5aget_num_attrs_c + * PURPOSE + * Call H5Oget_info to determine number of * attributes of an object - * Inputs: obj_id - object identifier + * INPUTS + * obj_id - object identifier * attr_num - number of attributes - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Thursday, August 12, 1999 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5aget_num_attrs_c (hid_t_f *obj_id, int_f *attr_num) +/******/ { H5O_info_t oinfo; /* Object info */ int_f ret_value = 0; /* Return value */ @@ -955,19 +1128,28 @@ done: return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5aget_name_c - * Purpose: Call H5Aget_name to get attribute's name - * Inputs: attr_id - attribute identifier +/****if* H5Af/h5aget_name_c + * NAME + * h5aget_name_c + * PURPOSE + * Call H5Aget_name to get attribute's name + * INPUTS + * attr_id - attribute identifier * bufsize - size of the buffer - * Outputs: buf - buffer to hold the name - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * OUTPUTS + * buf - buffer to hold the name + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Thursday, August 12, 1999 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5aget_name_c(hid_t_f *attr_id, size_t_f *bufsize, _fcd buf) +/******/ { size_t c_bufsize; char *c_buf=NULL; /* Buffer to hold C string */ @@ -997,19 +1179,28 @@ done: return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5aget_storage_size_c - * Purpose: Call H5Aget_storage_size - * Inputs: attr_id - identifier of an attribute - * Outputs: size - attributes storage requirements - * Returns: 0 on success, -1 on failure - * Programmer: M. S. Breitenfeld +/****if* H5Af/h5aget_storage_size_c + * NAME + * h5aget_storage_size_c + * PURPOSE + * Call H5Aget_storage_size + * INPUTS + * attr_id - identifier of an attribute + * OUTPUTS + * size - attributes storage requirements + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld * January, 2008 - * Modifications: N/A - *---------------------------------------------------------------------------*/ + * HISTORY + * N/A + * SOURCE +*/ int_f nh5aget_storage_size_c ( hid_t_f *attr_id, hsize_t_f *size) +/******/ { int_f ret_value=0; /* Return value */ @@ -1020,19 +1211,28 @@ done: return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5aget_create_plist_c - * Purpose: Call H5Aget_create_plist - * Inputs: attr_id - identifier of an attribute - * Outputs: creation_prop_id - Identifier for the attribute’s creation property - * Returns: 0 on success, -1 on failure - * Programmer: M. S. Breitenfeld +/****if* H5Af/h5aget_create_plist_c + * NAME + * h5aget_create_plist_c + * PURPOSE + * Call H5Aget_create_plist + * INPUTS + * attr_id - identifier of an attribute + * OUTPUTS + * creation_prop_id - Identifier for the attribute’s creation property + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld * January, 2008 - * Modifications: N/A - *---------------------------------------------------------------------------*/ + * HISTORY + * N/A + * SOURCE +*/ int_f nh5aget_create_plist_c ( hid_t_f *attr_id, hid_t_f *creation_prop_id) +/******/ { int_f ret_value=0; /* Return value */ @@ -1043,10 +1243,13 @@ done: return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5arename_by_name_c - * Purpose: Calls H5Arename_by_name - * Inputs: loc_id - Object identifier +/****if* H5Af/h5arename_by_name_c + * NAME + * h5arename_by_name_c + * PURPOSE + * Calls H5Arename_by_name + * INPUTS + * loc_id - Object identifier * obj_name - Name of object, relative to location, * whose attribute is to be renamed * obj_name_len - Object name length @@ -1055,18 +1258,24 @@ done: * new_attr_name - New attribute name * new_attr_name_len - New attribute name length * lapl_id - Link access property list identifier - * Outputs: N/A - * Returns: 0 on success, -1 on failure - * Programmer: M. S. Breitenfeld + * OUTPUTS + * N/A + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld * January, 2008 - * Modifications: N/A - *---------------------------------------------------------------------------*/ + * HISTORY + * N/A + * SOURCE +*/ int_f nh5arename_by_name_c( hid_t_f *loc_id, _fcd obj_name, size_t_f *obj_namelen, _fcd old_attr_name, size_t_f *old_attr_namelen, _fcd new_attr_name, size_t_f *new_attr_namelen, hid_t_f *lapl_id ) +/******/ { char *c_obj_name = NULL; /* Buffer to hold C string */ char *c_old_attr_name = NULL; /* Buffer to hold C string */ @@ -1095,21 +1304,30 @@ done: return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5aopen_c - * Purpose: Call H5Aopen to open an attribute - * Inputs: obj_id - Identifer for object to which attribute is attached +/****if* H5Af/h5aopen_c + * NAME + * h5aopen_c + * PURPOSE + * Call H5Aopen to open an attribute + * INPUTS + * obj_id - Identifer for object to which attribute is attached * attr_name - Attribute access property list * attr_namelen - size of attr_name * aapl_id - Link access property list - * Outputs: attr_id - dataset identifier - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld + * OUTPUTS + * attr_id - dataset identifier + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld * January, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5aopen_c (hid_t_f *obj_id, _fcd attr_name, size_t_f *attr_namelen, hid_t_f *aapl_id, hid_t_f *attr_id) +/******/ { char *c_attr_name = NULL; /* Buffer to hold C string */ int_f ret_value = 0; /* Return value */ @@ -1131,24 +1349,33 @@ done: HDfree(c_attr_name); return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5adelete_by_name_c - * Purpose: Call h5adelete_by_name to remove an attribute from a specified location - * Inputs: loc_id - identifer for object to which attribute is attached +/****if* H5Af/h5adelete_by_name_c + * NAME + * h5adelete_by_name_c + * PURPOSE + * Call h5adelete_by_name to remove an attribute from a specified location + * INPUTS + * loc_id - identifer for object to which attribute is attached * obj_name - object identifier * obj_namelen - name length * attr_name - name of the attribute * attr_namelen - name length * lapl_id - link access property list * - * Outputs: N/A - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld + * OUTPUTS + * N/A + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld * January, 2008 - * Modifications: N/A - *---------------------------------------------------------------------------*/ + * HISTORY + * N/A + * SOURCE +*/ int_f nh5adelete_by_name_c (hid_t_f *loc_id, _fcd obj_name, size_t_f *obj_namelen, _fcd attr_name, size_t_f *attr_namelen, hid_t_f *lapl_id) +/******/ { char *c_obj_name = NULL; /* Buffer to hold C string */ char *c_attr_name = NULL; /* Buffer to hold C string */ @@ -1175,25 +1402,34 @@ done: HDfree(c_obj_name); return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5adelete_by_idx_c - * Purpose: Call h5adelete_by_idx - * Inputs: loc_id - Location or object identifier; may be dataset or group +/****if* H5Af/h5adelete_by_idx_c + * NAME + * h5adelete_by_idx_c + * PURPOSE + * Call h5adelete_by_idx + * INPUTS + * loc_id - Location or object identifier; may be dataset or group * obj_name - object identifier * obj_namelen - name length * attr_name - name of the attribute * attr_namelen - name length * lapl_id - link access property list * - * Outputs: N/A - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld + * OUTPUTS + * N/A + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld * January, 2008 - * Modifications: N/A - *---------------------------------------------------------------------------*/ + * HISTORY + * N/A + * SOURCE +*/ int_f nh5adelete_by_idx_c (hid_t_f *loc_id, _fcd obj_name, size_t_f *obj_namelen, int_f *idx_type, int_f *order, hsize_t_f *n, hid_t_f *lapl_id) +/******/ { char *c_obj_name = NULL; /* Buffer to hold C string */ int_f ret_value = 0; /* Return value */ @@ -1216,11 +1452,13 @@ done: return ret_value; } - -/*---------------------------------------------------------------------------- - * Name: h5aget_name_by_idx_c - * Purpose: Call h5aget_name_by_idx - * Inputs: +/****if* H5Af/h5aget_name_by_idx_c + * NAME + * h5aget_name_by_idx_c + * PURPOSE + * Call h5aget_name_by_idx + * INPUTS + * * * loc_id - Identifer for object to which attribute is attached * obj_name - Name of object, relative to location, @@ -1246,17 +1484,23 @@ done: * hdferr - Error code: * Returns attribute name size, -1 if fail * - * Outputs: name - Attribute name + * OUTPUTS + * name - Attribute name * - * Returns: Size of buffer on success, -1 on failure - * Programmer: M.S. Breitenfeld + * RETURNS + * Size of buffer on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld * January, 2008 - * Modifications: N/A - *---------------------------------------------------------------------------*/ + * HISTORY + * N/A + * SOURCE +*/ int_f nh5aget_name_by_idx_c (hid_t_f *loc_id, _fcd obj_name, size_t_f *obj_namelen, int_f *idx_type, int_f *order, hsize_t_f *n, _fcd name, size_t_f *size, hid_t_f *lapl_id) +/******/ { char *c_obj_name = NULL; /* Buffer to hold C string */ ssize_t c_size; @@ -1299,10 +1543,13 @@ done: return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5aopen_by_idx_c - * Purpose: Call H5Aopen_by_idx - * Inputs: loc_id - Object identifier +/****if* H5Af/h5aopen_by_idx_c + * NAME + * h5aopen_by_idx_c + * PURPOSE + * Call H5Aopen_by_idx + * INPUTS + * loc_id - Object identifier * obj_name - Name of object to which attribute is attached * obj_namelen - name length * idx_type - Type of index; Possible values are: @@ -1321,15 +1568,21 @@ done: * n - Attribute’s position in index * aapl_id - Attribute access property list * lapl_id - Link access property list - * Outputs: attr_id - attribute identifer - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld + * OUTPUTS + * attr_id - attribute identifer + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld * January, 2008 - * Modifications: N/A - *---------------------------------------------------------------------------*/ + * HISTORY + * N/A + * SOURCE +*/ int_f nh5aopen_by_idx_c (hid_t_f *loc_id, _fcd obj_name, size_t_f *obj_namelen, int_f *idx_type, int_f *order, hsize_t_f *n, hid_t_f *aapl_id, hid_t_f *lapl_id, hid_t_f *attr_id ) +/******/ { char *c_obj_name = NULL; /* Buffer to hold C string */ int_f ret_value = 0; /* Return value */ @@ -1353,24 +1606,33 @@ done: return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5aget_info_c - * Purpose: Call H5Aget_info - * Inputs: loc_id - Object identifier - * Outputs: +/****if* H5Af/h5aget_info_c + * NAME + * h5aget_info_c + * PURPOSE + * Call H5Aget_info + * INPUTS + * loc_id - Object identifier + * OUTPUTS + * * corder_valid - Indicates whether the the creation order data is valid for this attribute * corder - Is a positive integer containing the creation order of the attribute * cset - Indicates the character set used for the attribute’s name * data_size - indicates the size, in the number of characters, of the attribute * - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld * January, 2008 - * Modifications: N/A - *---------------------------------------------------------------------------*/ + * HISTORY + * N/A + * SOURCE +*/ int_f nh5aget_info_c (hid_t_f *loc_id, int_f *corder_valid, int_f *corder, int_f *cset, hsize_t_f *data_size ) +/******/ { int_f ret_value = 0; /* Return value */ @@ -1396,10 +1658,13 @@ done: return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5aget_info_by_idx_c - * Purpose: Call H5Aget_info_by_idx - * Inputs: loc_id - Object identifier +/****if* H5Af/h5aget_info_by_idx_c + * NAME + * h5aget_info_by_idx_c + * PURPOSE + * Call H5Aget_info_by_idx + * INPUTS + * loc_id - Object identifier * obj_name - Name of object to which attribute is attached * obj_namelen - name length * idx_type - Type of index; Possible values are: @@ -1417,22 +1682,28 @@ done: * * n - Attribute’s position in index * lapl_id - Link access property list - * Outputs: + * OUTPUTS + * * corder_valid - Indicates whether the the creation order data is valid for this attribute * corder - Is a positive integer containing the creation order of the attribute * cset - Indicates the character set used for the attribute’s name * data_size - indicates the size, in the number of characters, of the attribute * - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld * January, 2008 - * Modifications: N/A - *---------------------------------------------------------------------------*/ + * HISTORY + * N/A + * SOURCE +*/ int_f nh5aget_info_by_idx_c (hid_t_f *loc_id, _fcd obj_name, size_t_f *obj_namelen, int_f *idx_type, int_f *order, hsize_t_f *n, hid_t_f *lapl_id, int_f *corder_valid, int_f *corder, int_f *cset, hsize_t_f *data_size ) +/******/ { char *c_obj_name = NULL; /* Buffer to hold C string */ H5A_info_t ainfo; @@ -1466,31 +1737,40 @@ done: return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5aget_info_by_name_c - * Purpose: Call H5Aget_info_by_name - * Inputs: loc_id - Object identifier +/****if* H5Af/h5aget_info_by_name_c + * NAME + * h5aget_info_by_name_c + * PURPOSE + * Call H5Aget_info_by_name + * INPUTS + * loc_id - Object identifier * obj_name - Name of object to which attribute is attached * obj_namelen - name length * attr_name - Attribute name * attr_namelen - attribute name length * lapl_id - Link access property list - * Outputs: + * OUTPUTS + * * corder_valid - Indicates whether the the creation order data is valid for this attribute * corder - Is a positive integer containing the creation order of the attribute * cset - Indicates the character set used for the attribute’s name * data_size - indicates the size, in the number of characters, of the attribute * - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld * January, 2008 - * Modifications: N/A - *---------------------------------------------------------------------------*/ + * HISTORY + * N/A + * SOURCE +*/ int_f nh5aget_info_by_name_c (hid_t_f *loc_id, _fcd obj_name, size_t_f *obj_namelen, _fcd attr_name, size_t_f *attr_namelen, hid_t_f *lapl_id, int_f *corder_valid, int_f *corder, int_f *cset, hsize_t_f *data_size ) +/******/ { char *c_obj_name = NULL; /* Buffer to hold C string */ char *c_attr_name = NULL; /* Buffer to hold C string */ @@ -1528,11 +1808,14 @@ done: return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5acreate_by_name_c - * Purpose: Call h5acreate_by_name +/****if* H5Af/h5acreate_by_name_c + * NAME + * h5acreate_by_name_c + * PURPOSE + * Call h5acreate_by_name - * Inputs: + * INPUTS + * * loc_id - Object identifier * obj_name - Name of object to which attribute is attached * obj_namelen - name length @@ -1544,19 +1827,25 @@ done: * aapl_id - Attribute access property list identifier (Currently not used.) * lapl_id - Link access property list * - * Outputs: + * OUTPUTS + * * attr - an attribute identifier * - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld * February, 2008 - * Modifications: N/A - *---------------------------------------------------------------------------*/ + * HISTORY + * N/A + * SOURCE +*/ int_f nh5acreate_by_name_c(hid_t_f *loc_id, _fcd obj_name, size_t_f *obj_namelen, _fcd attr_name, size_t_f *attr_namelen, hid_t_f *type_id, hid_t_f *space_id, hid_t_f *acpl_id, hid_t_f *aapl_id, hid_t_f *lapl_id, hid_t_f *attr_id ) +/******/ { char *c_obj_name = NULL; /* Buffer to hold C string */ char *c_attr_name = NULL; /* Buffer to hold C string */ @@ -1585,21 +1874,30 @@ done: return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5aexists_c - * Purpose: CAll h5aexists - * Inputs: +/****if* H5Af/h5aexists_c + * NAME + * h5aexists_c + * PURPOSE + * CAll h5aexists + * INPUTS + * * obj_id - Object identifier * attr_name - Attribute name - * Outputs: + * OUTPUTS + * * attr_exists_c - returns a positive value, for TRUE, or 0 (zero), for FALSE. - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld * February, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5aexists_c (hid_t_f *obj_id, _fcd name, size_t_f *namelen, hid_t_f *attr_exists) +/******/ { char *c_name = NULL; /* Buffer to hold C string */ int_f ret_value = 0; /* Return value */ @@ -1622,24 +1920,33 @@ done: return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5aexists_by_name_c - * Purpose: CAll H5Aexists_by_name - * Inputs: +/****if* H5Af/h5aexists_by_name_c + * NAME + * h5aexists_by_name_c + * PURPOSE + * CAll H5Aexists_by_name + * INPUTS + * * loc_id - Location identifier * obj_name - Object name either relative to loc_id, absolute from the file’s root group, or '.' (a dot) * attr_name - Attribute name * lapl_id - Link access property list identifier - * Outputs: + * OUTPUTS + * * attr_exists_c - returns a positive value, for TRUE, or 0 (zero), for FALSE. - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld * February, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5aexists_by_name_c (hid_t_f *loc_id, _fcd obj_name, size_t_f *obj_namelen, _fcd attr_name, size_t_f *attr_namelen, hid_t_f *lapl_id, int_f *attr_exists) +/******/ { char *c_obj_name = NULL; /* Buffer to hold object name C string */ char *c_attr_name = NULL; /* Buffer to hold attribute name C string */ @@ -1667,25 +1974,34 @@ done: return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5aopen_by_name_c - * Purpose: Call H5Aopen_by_name - * Inputs: +/****if* H5Af/h5aopen_by_name_c + * NAME + * h5aopen_by_name_c + * PURPOSE + * Call H5Aopen_by_name + * INPUTS + * * loc_id - Location identifier * obj_name - Object name either relative to loc_id, absolute from the file’s root group, or '.' (a dot) * attr_name - Attribute name * aapl_id - Attribute access property list (Currently unused; should be passed in as H5P_DEFAULT.) * lapl_id - Link access property list identifier - * Outputs: + * OUTPUTS + * * attr_id - attribute identifier - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld * February, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5aopen_by_name_c (hid_t_f *loc_id, _fcd obj_name, size_t_f *obj_namelen, _fcd attr_name, size_t_f *attr_namelen, hid_t_f *aapl_id, hid_t_f *lapl_id, hid_t_f *attr_id) +/******/ { char *c_obj_name = NULL; /* Buffer to hold object name C string */ char *c_attr_name = NULL; /* Buffer to hold attribute name C string */ @@ -1713,25 +2029,34 @@ nh5aopen_by_name_c (hid_t_f *loc_id, _fcd obj_name, size_t_f *obj_namelen, _fcd return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5arename_c - * Purpose: Calls H5Arename - * Inputs: loc_id - Object identifier +/****if* H5Af/h5arename_c + * NAME + * h5arename_c + * PURPOSE + * Calls H5Arename + * INPUTS + * loc_id - Object identifier * old_attr_name - Prior attribute name * old_attr_name_len - Prior attribute name length * new_attr_name - New attribute name * new_attr_name_len - New attribute name length - * Outputs: N/A - * Returns: 0 on success, -1 on failure - * Programmer: M. S. Breitenfeld + * OUTPUTS + * N/A + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld * January, 2008 - * Modifications: N/A - *---------------------------------------------------------------------------*/ + * HISTORY + * N/A + * SOURCE +*/ int_f nh5arename_c( hid_t_f *loc_id, _fcd old_attr_name, size_t_f *old_attr_namelen, _fcd new_attr_name, size_t_f *new_attr_namelen) +/******/ { char *c_old_attr_name = NULL; /* Buffer to hold C string */ char *c_new_attr_name = NULL; /* Buffer to hold C string */ @@ -1754,3 +2079,69 @@ done: HDfree(c_new_attr_name); return ret_value; } +/****if* H5Af/h5awrite_f_c + * NAME + * h5awrite_f_c + * PURPOSE + * Call H5Awrite to write a dataset + * INPUTS + * attr_id - Identifier of an attribute to write. + * mem_type_id - Identifier of the attribute datatype (in memory). + * buf - data pointer buffer + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld + * June 11, 2008 + * HISTORY + * + * + * SOURCE +*/ +int_f +nh5awrite_f_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf) +/******/ +{ + int ret_value = -1; + herr_t ret; + + ret = H5Awrite( (hid_t)*attr_id, (hid_t)*mem_type_id, buf); + + if (ret < 0) return ret_value; + ret_value = 0; + return ret_value; +} + +/****if* H5Af/h5aread_f_c + * NAME + * h5aread_f_c + * PURPOSE + * Call H5Awrite to write a dataset + * INPUTS + * attr_id - Identifier of an attribute to write. + * mem_type_id - Identifier of the attribute datatype (in memory). + * buf - data pointer buffer + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld + * June 11, 2008 + * HISTORY + * + * + * SOURCE +*/ +int_f +nh5aread_f_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf) +/******/ +{ + int ret_value = -1; + herr_t ret; + + ret = H5Aread( (hid_t)*attr_id, (hid_t)*mem_type_id, buf); + + if (ret < 0) return ret_value; + ret_value = 0; + return ret_value; +} + diff --git a/fortran/src/H5Aff.f90 b/fortran/src/H5Aff.f90 index 49f3e70..1926dd1 100644 --- a/fortran/src/H5Aff.f90 +++ b/fortran/src/H5Aff.f90 @@ -1,3 +1,15 @@ +!****h* ROBODoc/H5A +! +! NAME +! MODULE H5A +! +! PURPOSE +! This file contains Fortran interfaces for H5A functions. It includes +! all the functions that are independent on whether the Fortran 2003 functions +! are enabled or disabled. +! +! +! COPYRIGHT ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! Copyright by The HDF Group. * ! Copyright by the Board of Trustees of the University of Illinois. * @@ -13,129 +25,77 @@ ! access to either file, you may request a copy from help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! +! NOTES +! *** IMPORTANT *** +! If you add a new H5A function you must add the function name to the +! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! This is needed for Windows based operating systems. ! -! This file contains Fortran90 interfaces for H5A functions. -! +!***** + MODULE H5A USE H5GLOBAL ! -!On Windows there are no big (integer*8) integers, so overloading -!for bug #670 does not work. I have to use DEC compilation directives to make -!Windows DEC Visual Fortran and OSF compilers happy and do right things. -! 05/01/02 EP -! - INTERFACE h5awrite_f - - MODULE PROCEDURE h5awrite_integer_scalar - MODULE PROCEDURE h5awrite_integer_1 - MODULE PROCEDURE h5awrite_integer_2 - MODULE PROCEDURE h5awrite_integer_3 - MODULE PROCEDURE h5awrite_integer_4 - MODULE PROCEDURE h5awrite_integer_5 - MODULE PROCEDURE h5awrite_integer_6 - MODULE PROCEDURE h5awrite_integer_7 - MODULE PROCEDURE h5awrite_char_scalar - MODULE PROCEDURE h5awrite_char_1 - MODULE PROCEDURE h5awrite_char_2 - MODULE PROCEDURE h5awrite_char_3 - MODULE PROCEDURE h5awrite_char_4 - MODULE PROCEDURE h5awrite_char_5 - MODULE PROCEDURE h5awrite_char_6 - MODULE PROCEDURE h5awrite_char_7 - MODULE PROCEDURE h5awrite_real_scalar - MODULE PROCEDURE h5awrite_real_1 - MODULE PROCEDURE h5awrite_real_2 - MODULE PROCEDURE h5awrite_real_3 - MODULE PROCEDURE h5awrite_real_4 - MODULE PROCEDURE h5awrite_real_5 - MODULE PROCEDURE h5awrite_real_6 - MODULE PROCEDURE h5awrite_real_7 - - END INTERFACE - - INTERFACE h5aread_f - - MODULE PROCEDURE h5aread_integer_scalar - MODULE PROCEDURE h5aread_integer_1 - MODULE PROCEDURE h5aread_integer_2 - MODULE PROCEDURE h5aread_integer_3 - MODULE PROCEDURE h5aread_integer_4 - MODULE PROCEDURE h5aread_integer_5 - MODULE PROCEDURE h5aread_integer_6 - MODULE PROCEDURE h5aread_integer_7 - MODULE PROCEDURE h5aread_char_scalar - MODULE PROCEDURE h5aread_char_1 - MODULE PROCEDURE h5aread_char_2 - MODULE PROCEDURE h5aread_char_3 - MODULE PROCEDURE h5aread_char_4 - MODULE PROCEDURE h5aread_char_5 - MODULE PROCEDURE h5aread_char_6 - MODULE PROCEDURE h5aread_char_7 - MODULE PROCEDURE h5aread_real_scalar - MODULE PROCEDURE h5aread_real_1 - MODULE PROCEDURE h5aread_real_2 - MODULE PROCEDURE h5aread_real_3 - MODULE PROCEDURE h5aread_real_4 - MODULE PROCEDURE h5aread_real_5 - MODULE PROCEDURE h5aread_real_6 - MODULE PROCEDURE h5aread_real_7 - - END INTERFACE +! On Windows there are no big (integer*8) integers, so overloading +! for bug #670 does not work. I have to use DEC compilation directives to make +! Windows DEC Visual Fortran and OSF compilers happy and do right things. +! 05/01/02 EP +! CONTAINS -!---------------------------------------------------------------------- -! Name: h5acreate_f ! -! Purpose: Creates a dataset as an attribute of a group, dataset, -! or named datatype +!****s* H5A/h5acreate_f +! +! NAME +! h5acreate_f +! +! PURPOSE +! Creates a dataset as an attribute of a group, dataset, or named datatype +! +! INPUTS +! loc_id - identifier of an object (group, dataset, +! or named datatype) attribute is attached to +! name - attribute name +! type_id - attribute datatype identifier +! space_id - attribute dataspace identifier ! -! Inputs: -! loc_id - identifier of an object (group, dataset, -! or named datatype) attribute is attached to -! name - attribute name -! type_id - attribute datatype identifier -! space_id - attribute dataspace identifier +! OUTPUTS +! attr_id - attribute identifier +! hdferr - Returns 0 if successful and -1 if fails +! OPTIONAL PARAMETERS +! acpl_id - Attribute creation property list identifier +! appl_id - Attribute access property list identifier ! -! Outputs: -! attr_id - attribute identifier -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! acpl_id - Attribute creation property list identifier -! appl_id - Attribute access property list identifier +! AUTHOR +! Elena Pourmal +! August 12, 1999 ! -! Programmer: Elena Pourmal -! August 12, 1999 +! HISTORY +! Explicit Fortran interfaces are added for +! called C functions (it is needed for Windows +! port). February 27, 2001 ! -! Modifications: Explicit Fortran interfaces are added for -! called C functions (it is needed for Windows -! port). February 27, 2001 ! -!---------------------------------------------------------------------- +! SOURCE SUBROUTINE h5acreate_f(loc_id, name, type_id, space_id, attr_id, & hdferr, acpl_id, aapl_id ) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! Object identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Attribute name - INTEGER(HID_T), INTENT(IN) :: type_id - ! Attribute datatype identifier - INTEGER(HID_T), INTENT(IN) :: space_id - ! Attribute dataspace identifier - INTEGER(HID_T), INTENT(OUT) :: attr_id ! Attribute identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code: - ! 0 on success and -1 on failure + INTEGER(HID_T), INTENT(IN) :: loc_id ! Object identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Attribute name + INTEGER(HID_T), INTENT(IN) :: type_id ! Attribute datatype identifier + INTEGER(HID_T), INTENT(IN) :: space_id ! Attribute dataspace identifier + INTEGER(HID_T), INTENT(OUT) :: attr_id ! Attribute identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code: + ! 0 on success and -1 on failure +!***** INTEGER(HID_T), OPTIONAL, INTENT(IN) :: acpl_id ! Attribute creation property list identifier INTEGER(HID_T), OPTIONAL, INTENT(IN) :: aapl_id ! Attribute access property list identifier INTEGER(HID_T) :: acpl_id_default INTEGER(HID_T) :: aapl_id_default INTEGER(SIZE_T) :: namelen -! INTEGER, EXTERNAL :: h5acreate_c -! MS FORTRAN needs explicit interface for C functions called here. -! INTERFACE INTEGER FUNCTION h5acreate_c(loc_id, name, namelen, type_id, & space_id, acpl_id_default, aapl_id_default, attr_id) @@ -157,7 +117,7 @@ CONTAINS acpl_id_default = H5P_DEFAULT_F aapl_id_default = H5P_DEFAULT_F - namelen = LEN(NAME) + namelen = LEN(name) IF (PRESENT(acpl_id)) acpl_id_default = acpl_id IF (PRESENT(aapl_id)) aapl_id_default = aapl_id @@ -167,43 +127,42 @@ CONTAINS END SUBROUTINE h5acreate_f -!---------------------------------------------------------------------- -! Name: h5aopen_name_f ! -! Purpose: Opens an attribute specified by name. +!****s* H5A/h5aopen_name_f ! -! Inputs: -! obj_id - identifier of a group, dataset, or named -! datatype atttribute to be attached to -! name - attribute name -! Outputs: -! attr_id - attribute identifier -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! NAME +! h5aopen_name_f ! -! Programmer: Elena Pourmal -! August 12, 1999 +! PURPOSE +! Opens an attribute specified by name. ! -! Modifications: Explicit Fortran interfaces are added for -! called C functions (it is needed for Windows -! port). February 27, 2001 +! INPUTS +! obj_id - identifier of a group, dataset, or named +! datatype atttribute to be attached to +! name - attribute name +! OUTPUTS +! attr_id - attribute identifier +! hdferr - Returns 0 if successful and -1 if fails ! -!---------------------------------------------------------------------- - +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces are added for +! called C functions (it is needed for Windows +! port). February 27, 2001 +! +! SOURCE SUBROUTINE h5aopen_name_f(obj_id, name, attr_id, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: obj_id ! Object identifier CHARACTER(LEN=*), INTENT(IN) :: name ! Attribute name INTEGER(HID_T), INTENT(OUT) :: attr_id ! Attribute identifier INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** INTEGER(SIZE_T) :: namelen -! INTEGER, EXTERNAL :: h5aopen_name_c -! MS FORTRAN needs explicit interface for C functions called here. -! INTERFACE INTEGER FUNCTION h5aopen_name_c(obj_id, name, namelen, attr_id) USE H5GLOBAL @@ -221,44 +180,41 @@ CONTAINS namelen = LEN(name) hdferr = h5aopen_name_c(obj_id, name, namelen, attr_id) END SUBROUTINE h5aopen_name_f - - -!---------------------------------------------------------------------- -! Name: h5aopen_idx_f ! -! Purpose: Opens the attribute specified by its index. +!****s* H5A/h5aopen_idx_f ! -! Inputs: -! obj_id - identifier of a group, dataset, or named -! datatype an attribute to be attached to -! index - index of the attribute to open (zero-based) -! Outputs: -! attr_id - attribute identifier -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! NAME +! h5aopen_idx_f ! -! Programmer: Elena Pourmal -! August 12, 1999 +! PURPOSE +! Opens the attribute specified by its index. ! -! Modifications: Explicit Fortran interfaces are added for -! called C functions (it is needed for Windows -! port). February 27, 2001 +! INPUTS +! obj_id - identifier of a group, dataset, or named +! datatype an attribute to be attached to +! index - index of the attribute to open (zero-based) +! OUTPUTS +! attr_id - attribute identifier +! hdferr - Returns 0 if successful and -1 if fails ! -!---------------------------------------------------------------------- - +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces are added for +! called C functions (it is needed for Windows +! port). February 27, 2001 +! +! SOURCE SUBROUTINE h5aopen_idx_f(obj_id, index, attr_id, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: obj_id ! Object identifier INTEGER, INTENT(IN) :: index ! Attribute index INTEGER(HID_T), INTENT(OUT) :: attr_id ! Attribute identifier INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** -! INTEGER, EXTERNAL :: h5aopen_idx_c -! MS FORTRAN needs explicit interface for C functions called here. -! INTERFACE INTEGER FUNCTION h5aopen_idx_c(obj_id, index, attr_id) USE H5GLOBAL @@ -273,1686 +229,131 @@ CONTAINS hdferr = h5aopen_idx_c(obj_id, index, attr_id) END SUBROUTINE h5aopen_idx_f - - - SUBROUTINE h5awrite_integer_scalar(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER, INTENT(IN) :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5awrite_integer_s_c -! MS FORTRAN needs explicit interface for C functions called here. ! - 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 - 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 - INTEGER, INTENT(IN)::buf - END FUNCTION h5awrite_integer_s_c - END INTERFACE - - hdferr = h5awrite_integer_s_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5awrite_integer_scalar - - SUBROUTINE h5awrite_integer_1(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER, INTENT(IN) , & - DIMENSION(dims(1)) :: buf - ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5awrite_integer_1_c -! MS FORTRAN needs explicit interface for C functions called here. +!****s* H5A/h5aget_space_f ! - 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 - 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 - INTEGER, INTENT(IN), DIMENSION(dims(1)) :: buf - END FUNCTION h5awrite_integer_1_c - END INTERFACE - - hdferr = h5awrite_integer_1_c(attr_id, memtype_id, buf, dims) - - END SUBROUTINE h5awrite_integer_1 - - - SUBROUTINE h5awrite_integer_2(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER, INTENT(IN) , & - DIMENSION(dims(1),dims(2)) :: buf - ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5awrite_integer_2_c -! MS FORTRAN needs explicit interface for C functions called here. +! NAME +! h5aget_space_f ! - 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 - 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 - INTEGER, INTENT(IN), DIMENSION(dims(1),dims(2)) :: buf - END FUNCTION h5awrite_integer_2_c - END INTERFACE - - hdferr = h5awrite_integer_2_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5awrite_integer_2 - - - SUBROUTINE h5awrite_integer_3(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER, INTENT(IN), DIMENSION(dims(1),dims(2),dims(3)) :: buf - ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5awrite_integer_3_c -! MS FORTRAN needs explicit interface for C functions called here. +! PURPOSE +! Gets a copy of the dataspace for an attribute. ! - 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 - 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 - INTEGER, INTENT(IN), DIMENSION(dims(1),dims(2),dims(3)) :: buf - END FUNCTION h5awrite_integer_3_c - END INTERFACE - - hdferr = h5awrite_integer_3_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5awrite_integer_3 - - - SUBROUTINE h5awrite_integer_4(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf - ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5awrite_integer_4_c -! MS FORTRAN needs explicit interface for C functions called here. +! INPUTS +! attr_id - attribute identifier ! - 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 - 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 - INTEGER, INTENT(IN), DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf - END FUNCTION h5awrite_integer_4_c - END INTERFACE - - hdferr = h5awrite_integer_4_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5awrite_integer_4 - - - SUBROUTINE h5awrite_integer_5(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER, INTENT(IN), DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf - ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5awrite_integer_5_c -! MS FORTRAN needs explicit interface for C functions called here. +! OUTPUTS +! space_id - attribite dataspace identifier +! hdferr - Returns 0 if successful and -1 if fails ! - 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 - 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 - INTEGER, INTENT(IN), DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf - END FUNCTION h5awrite_integer_5_c - END INTERFACE - - hdferr = h5awrite_integer_5_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5awrite_integer_5 - - - SUBROUTINE h5awrite_integer_6(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf - ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5awrite_integer_6_c -! MS FORTRAN needs explicit interface for C functions called here. +! AUTHOR +! Elena Pourmal +! August 12, 1999 ! - 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 - 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 - INTEGER, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf - END FUNCTION h5awrite_integer_6_c - END INTERFACE - - hdferr = h5awrite_integer_6_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5awrite_integer_6 - - - SUBROUTINE h5awrite_integer_7(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf - ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5awrite_integer_7_c -! MS FORTRAN needs explicit interface for C functions called here. +! HISTORY +! Explicit Fortran interfaces are added for +! called C functions (it is needed for Windows +! port). February 27, 2001 ! - 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 - 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 - INTEGER, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf - END FUNCTION h5awrite_integer_7_c - END INTERFACE - - hdferr = h5awrite_integer_7_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5awrite_integer_7 - - - SUBROUTINE h5awrite_real_scalar(attr_id, memtype_id, buf, dims, hdferr) +! +! SOURCE + SUBROUTINE h5aget_space_f(attr_id, space_id, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - REAL, INTENT(IN) :: buf ! Attribute data + INTEGER(HID_T), INTENT(OUT) :: space_id ! Attribute dataspace identifier INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5awrite_real_s_c -! MS FORTRAN needs explicit interface for C functions called here. -! +!***** INTERFACE - INTEGER FUNCTION h5awrite_real_s_c(attr_id, memtype_id, buf, dims) + INTEGER FUNCTION h5aget_space_c(attr_id, space_id) USE H5GLOBAL !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AWRITE_REAL_S_C'::h5awrite_real_s_c + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AGET_SPACE_C'::h5aget_space_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 - REAL, INTENT(IN)::buf - END FUNCTION h5awrite_real_s_c + INTEGER(HID_T), INTENT(OUT) :: space_id + END FUNCTION h5aget_space_c END INTERFACE - - hdferr = h5awrite_real_s_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5awrite_real_scalar - - SUBROUTINE h5awrite_real_1(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - REAL, INTENT(IN), & - DIMENSION(dims(1)) :: buf - ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5awrite_real_1_c -! MS FORTRAN needs explicit interface for C functions called here. + + hdferr = h5aget_space_c(attr_id, space_id) + END SUBROUTINE h5aget_space_f +! +!****s* H5A/h5aget_type_f +! +! NAME +! h5aget_type_f +! +! PURPOSE +! Gets an attribute datatype. ! +! INPUTS +! attr_id - attribute identifier +! OUTPUTS +! type_id - attribute datatype identifier +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces are added for +! called C functions (it is needed for Windows +! port). February 27, 2001 +! +! SOURCE + SUBROUTINE h5aget_type_f(attr_id, type_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(OUT) :: type_id ! Attribute datatype identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** INTERFACE - INTEGER FUNCTION h5awrite_real_1_c(attr_id, memtype_id, buf, dims) + INTEGER FUNCTION h5aget_type_c(attr_id, type_id) USE H5GLOBAL !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AWRITE_REAL_1_C'::h5awrite_real_1_c + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AGET_TYPE_C'::h5aget_type_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 - REAL, INTENT(IN), & - DIMENSION(dims(1)) :: buf - END FUNCTION h5awrite_real_1_c + INTEGER(HID_T), INTENT(OUT) :: type_id + END FUNCTION h5aget_type_c END INTERFACE - - hdferr = h5awrite_real_1_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5awrite_real_1 - - - SUBROUTINE h5awrite_real_2(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - REAL, INTENT(IN), & - DIMENSION(dims(1),dims(2)) :: buf - ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5awrite_real_2_c -! MS FORTRAN needs explicit interface for C functions called here. -! - 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 - 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 - REAL, INTENT(IN), & - DIMENSION(dims(1),dims(2)) :: buf - END FUNCTION h5awrite_real_2_c - END INTERFACE - - hdferr = h5awrite_real_2_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5awrite_real_2 - - - SUBROUTINE h5awrite_real_3(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - REAL, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3)) :: buf - ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5awrite_real_3_c -! MS FORTRAN needs explicit interface for C functions called here. -! - 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 - 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 - REAL, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3)) :: buf - END FUNCTION h5awrite_real_3_c - END INTERFACE - - hdferr = h5awrite_real_3_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5awrite_real_3 - - - SUBROUTINE h5awrite_real_4(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - REAL, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf - ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5awrite_real_4_c -! MS FORTRAN needs explicit interface for C functions called here. -! - 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 - 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 - REAL, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf - END FUNCTION h5awrite_real_4_c - END INTERFACE - - hdferr = h5awrite_real_4_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5awrite_real_4 - - - SUBROUTINE h5awrite_real_5(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - REAL, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf - ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5awrite_real_5_c -! MS FORTRAN needs explicit interface for C functions called here. -! - 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 - 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 - REAL, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf - END FUNCTION h5awrite_real_5_c - END INTERFACE - - hdferr = h5awrite_real_5_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5awrite_real_5 - - - SUBROUTINE h5awrite_real_6(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - REAL, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf - ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5awrite_real_6_c -! MS FORTRAN needs explicit interface for C functions called here. -! - 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 - 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 - REAL, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf - END FUNCTION h5awrite_real_6_c - END INTERFACE - - hdferr = h5awrite_real_6_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5awrite_real_6 - - - SUBROUTINE h5awrite_real_7(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - REAL, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf - ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5awrite_real_7_c -! MS FORTRAN needs explicit interface for C functions called here. -! - 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 - 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 - REAL, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf - END FUNCTION h5awrite_real_7_c - END INTERFACE - - hdferr = h5awrite_real_7_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5awrite_real_7 - - - SUBROUTINE h5awrite_char_scalar(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - CHARACTER(LEN=*),INTENT(IN) :: buf - ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code -! INTEGER, EXTERNAL :: h5awritec_s_c -! MS FORTRAN needs explicit interface for C functions called here. -! - 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 - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - !DEC$ATTRIBUTES reference :: buf - INTEGER(HID_T), INTENT(IN) :: attr_id - INTEGER(HID_T), INTENT(IN) :: memtype_id - CHARACTER(LEN=*), INTENT(IN)::buf - END FUNCTION h5awritec_s_c - END INTERFACE - - hdferr = h5awritec_s_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5awrite_char_scalar - - SUBROUTINE h5awrite_char_1(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - CHARACTER(LEN=*), INTENT(IN), & - DIMENSION(dims(1)) :: buf - ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code -! INTEGER, EXTERNAL :: h5awritec_1_c -! MS FORTRAN needs explicit interface for C functions called here. -! - 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$ATTRIBUTES reference :: buf - 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 - CHARACTER(LEN=*), INTENT(IN), DIMENSION(dims(1))::buf - END FUNCTION h5awritec_1_c - END INTERFACE - - hdferr = h5awritec_1_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5awrite_char_1 - - - SUBROUTINE h5awrite_char_2(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - CHARACTER(LEN=*), INTENT(IN), & - DIMENSION(dims(1),dims(2)) :: buf - ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5awritec_2_c -! MS FORTRAN needs explicit interface for C functions called here. -! - 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 - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - !DEC$ATTRIBUTES reference :: buf - INTEGER(HID_T), INTENT(IN) :: attr_id - INTEGER(HID_T), INTENT(IN) :: memtype_id - CHARACTER(LEN=*), INTENT(IN), & - DIMENSION(dims(1),dims(2)) :: buf - END FUNCTION h5awritec_2_c - END INTERFACE - - hdferr = h5awritec_2_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5awrite_char_2 - - - SUBROUTINE h5awrite_char_3(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - CHARACTER(LEN=*), INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3)) :: buf - ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code -! INTEGER, EXTERNAL :: h5awritec_3_c -! MS FORTRAN needs explicit interface for C functions called here. -! - 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$ATTRIBUTES reference :: buf - 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 - CHARACTER(LEN=*), INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3)) :: buf - END FUNCTION h5awritec_3_c - END INTERFACE - - hdferr = h5awritec_3_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5awrite_char_3 - - - SUBROUTINE h5awrite_char_4(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - CHARACTER(LEN=*), INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf - ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code -! INTEGER, EXTERNAL :: h5awritec_4_c -! MS FORTRAN needs explicit interface for C functions called here. -! - 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$ATTRIBUTES reference :: buf - 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 - CHARACTER(LEN=*), INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf - END FUNCTION h5awritec_4_c - END INTERFACE - - hdferr = h5awritec_4_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5awrite_char_4 - - - SUBROUTINE h5awrite_char_5(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - CHARACTER(LEN=*), INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf - ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code -! INTEGER, EXTERNAL :: h5awritec_5_c -! MS FORTRAN needs explicit interface for C functions called here. -! - 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$ATTRIBUTES reference :: buf - 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 - CHARACTER(LEN=*), INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf - END FUNCTION h5awritec_5_c - END INTERFACE - - hdferr = h5awritec_5_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5awrite_char_5 - - - SUBROUTINE h5awrite_char_6(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - CHARACTER(LEN=*), INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf - ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code -! INTEGER, EXTERNAL :: h5awritec_6_c -! MS FORTRAN needs explicit interface for C functions called here. -! - 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$ATTRIBUTES reference :: buf - 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 - CHARACTER(LEN=*), INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf - END FUNCTION h5awritec_6_c - END INTERFACE - - hdferr = h5awritec_6_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5awrite_char_6 - - - SUBROUTINE h5awrite_char_7(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - CHARACTER(LEN=*), INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf - ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code -! INTEGER, EXTERNAL :: h5awritec_7_c -! MS FORTRAN needs explicit interface for C functions called here. -! - 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$ATTRIBUTES reference :: buf - 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 - CHARACTER(LEN=*), INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf - END FUNCTION h5awritec_7_c - END INTERFACE - - hdferr = h5awritec_7_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5awrite_char_7 - -!---------------------------------------------------------------------- -! Name: h5aread_f -! -! Purpose: Reads an attribute. -! -! Inputs: -! attr_id - attribute identifier -! memtype_id - attribute memory type identifier -! dims - 1D array of size 7, stores sizes of the -! - buf array dimensions. -! Outputs: -! buf - buffer to read attribute data in -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces are added for -! called C functions (it is needed for Windows -! port). February 27, 2001 -! -! dims parameter was added to make code portable; -! Aprile 4, 2001 -! -! Changed buf intent to INOUT to be consistant -! with how the C functions handles it. The pg -! compiler will return 0 if a buf value is not set. -! February, 2008 -! -! Comment: This function is overloaded to write INTEGER, -! REAL, DOUBLE PRECISION and CHARACTER buffers -! up to 7 dimensions. -!---------------------------------------------------------------------- - - SUBROUTINE h5aread_integer_scalar(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER, INTENT(INOUT) :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5aread_integer_s_c -! MS FORTRAN needs explicit interface for C functions called here. -! - 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 - 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 - INTEGER, INTENT(INOUT)::buf - END FUNCTION h5aread_integer_s_c - END INTERFACE - hdferr = h5aread_integer_s_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5aread_integer_scalar - - SUBROUTINE h5aread_integer_1(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER, INTENT(INOUT), DIMENSION(dims(1)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5aread_integer_1_c -! MS FORTRAN needs explicit interface for C functions called here. -! - 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 - 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 - INTEGER, INTENT(INOUT), DIMENSION(dims(1)) :: buf - END FUNCTION h5aread_integer_1_c - END INTERFACE - - hdferr = h5aread_integer_1_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5aread_integer_1 - - - SUBROUTINE h5aread_integer_2(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER, INTENT(INOUT),DIMENSION(dims(1),dims(2)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5aread_integer_2_c -! MS FORTRAN needs explicit interface for C functions called here. -! - 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 - 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 - INTEGER, INTENT(INOUT), DIMENSION(dims(1),dims(2)) :: buf - END FUNCTION h5aread_integer_2_c - END INTERFACE - - hdferr = h5aread_integer_2_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5aread_integer_2 - - - SUBROUTINE h5aread_integer_3(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5aread_integer_3_c -! MS FORTRAN needs explicit interface for C functions called here. -! - 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 - 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 - INTEGER, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3)) :: buf - END FUNCTION h5aread_integer_3_c - END INTERFACE - - hdferr = h5aread_integer_3_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5aread_integer_3 - - - SUBROUTINE h5aread_integer_4(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf - ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5aread_integer_4_c -! MS FORTRAN needs explicit interface for C functions called here. -! - 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 - 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 - INTEGER, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf - END FUNCTION h5aread_integer_4_c - END INTERFACE - - hdferr = h5aread_integer_4_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5aread_integer_4 - - - SUBROUTINE h5aread_integer_5(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf - ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5aread_integer_5_c -! MS FORTRAN needs explicit interface for C functions called here. -! - 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 - 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 - INTEGER, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf - END FUNCTION h5aread_integer_5_c - END INTERFACE - - hdferr = h5aread_integer_5_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5aread_integer_5 - - - SUBROUTINE h5aread_integer_6(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf - ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5aread_integer_6_c -! MS FORTRAN needs explicit interface for C functions called here. -! - 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 - 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 - INTEGER, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf - END FUNCTION h5aread_integer_6_c - END INTERFACE - - hdferr = h5aread_integer_6_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5aread_integer_6 - - - SUBROUTINE h5aread_integer_7(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - INTEGER, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf - ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5aread_integer_7_c -! MS FORTRAN needs explicit interface for C functions called here. -! - 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 - 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 - INTEGER, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf - END FUNCTION h5aread_integer_7_c - END INTERFACE - - hdferr = h5aread_integer_7_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5aread_integer_7 - - - SUBROUTINE h5aread_real_scalar(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - REAL, INTENT(INOUT) :: buf ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5aread_real_s_c -! MS FORTRAN needs explicit interface for C functions called here. -! - 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 - 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 - REAL, INTENT(INOUT)::buf - END FUNCTION h5aread_real_s_c - END INTERFACE - - hdferr = h5aread_real_s_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5aread_real_scalar - - SUBROUTINE h5aread_real_1(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - REAL, INTENT(INOUT), & - DIMENSION(dims(1)) :: buf - ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5aread_real_1_c -! MS FORTRAN needs explicit interface for C functions called here. -! - 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 - 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 - REAL, INTENT(INOUT), & - DIMENSION(dims(1)) :: buf - END FUNCTION h5aread_real_1_c - END INTERFACE - - hdferr = h5aread_real_1_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5aread_real_1 - - - SUBROUTINE h5aread_real_2(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - REAL, INTENT(INOUT), & - DIMENSION(dims(1),dims(2)) :: buf - ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5aread_real_2_c -! MS FORTRAN needs explicit interface for C functions called here. -! - 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 - 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 - REAL, INTENT(INOUT), & - DIMENSION(dims(1),dims(2)) :: buf - END FUNCTION h5aread_real_2_c - END INTERFACE - - hdferr = h5aread_real_2_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5aread_real_2 - - - SUBROUTINE h5aread_real_3(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - REAL, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3)) :: buf - ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5aread_real_3_c -! MS FORTRAN needs explicit interface for C functions called here. -! - 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 - 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 - REAL, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3)) :: buf - END FUNCTION h5aread_real_3_c - END INTERFACE - - hdferr = h5aread_real_3_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5aread_real_3 - - - SUBROUTINE h5aread_real_4(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - REAL, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf - ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5aread_real_4_c -! MS FORTRAN needs explicit interface for C functions called here. -! - 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 - 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 - REAL, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf - END FUNCTION h5aread_real_4_c - END INTERFACE - - hdferr = h5aread_real_4_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5aread_real_4 - - - SUBROUTINE h5aread_real_5(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - REAL, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf - ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5aread_real_5_c -! MS FORTRAN needs explicit interface for C functions called here. -! - 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 - 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 - REAL, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf - END FUNCTION h5aread_real_5_c - END INTERFACE - - hdferr = h5aread_real_5_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5aread_real_5 - - - SUBROUTINE h5aread_real_6(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - REAL, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf - ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5aread_real_6_c -! MS FORTRAN needs explicit interface for C functions called here. -! - 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 - 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 - REAL, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf - END FUNCTION h5aread_real_6_c - END INTERFACE - - hdferr = h5aread_real_6_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5aread_real_6 - - - SUBROUTINE h5aread_real_7(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - REAL, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf - ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5aread_real_7_c -! MS FORTRAN needs explicit interface for C functions called here. -! - 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 - 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 - REAL, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf - END FUNCTION h5aread_real_7_c - END INTERFACE - - hdferr = h5aread_real_7_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5aread_real_7 - - SUBROUTINE h5aread_char_scalar(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - CHARACTER(LEN=*), INTENT(INOUT) :: buf - ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5areadc_s_c -! MS FORTRAN needs explicit interface for C functions called here. -! - 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$ATTRIBUTES reference :: buf - 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 - CHARACTER(LEN=*), INTENT(INOUT) :: buf - END FUNCTION h5areadc_s_c - END INTERFACE - - hdferr = h5areadc_s_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5aread_char_scalar - - SUBROUTINE h5aread_char_1(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - CHARACTER(LEN=*), INTENT(INOUT), & - DIMENSION(dims(1)) :: buf - ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5areadc_1_c -! MS FORTRAN needs explicit interface for C functions called here. -! - 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$ATTRIBUTES reference :: buf - 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 - CHARACTER(LEN=*), INTENT(INOUT), & - DIMENSION(dims(1)) :: buf - END FUNCTION h5areadc_1_c - END INTERFACE - - hdferr = h5areadc_1_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5aread_char_1 - - - SUBROUTINE h5aread_char_2(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - CHARACTER(LEN=*), INTENT(INOUT), & - DIMENSION(dims(1),dims(2)) :: buf - ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5areadc_2_c -! MS FORTRAN needs explicit interface for C functions called here. -! - 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$ATTRIBUTES reference :: buf - 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 - CHARACTER(LEN=*), INTENT(INOUT), & - DIMENSION(dims(1),dims(2)) :: buf - END FUNCTION h5areadc_2_c - END INTERFACE - - hdferr = h5areadc_2_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5aread_char_2 - - - SUBROUTINE h5aread_char_3(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - CHARACTER(LEN=*), INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3)) :: buf - ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5areadc_3_c -! MS FORTRAN needs explicit interface for C functions called here. -! - 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$ATTRIBUTES reference :: buf - 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 - CHARACTER(LEN=*), INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3)) :: buf - END FUNCTION h5areadc_3_c - END INTERFACE - - hdferr = h5areadc_3_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5aread_char_3 - - - SUBROUTINE h5aread_char_4(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - CHARACTER(LEN=*), INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf - ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5areadc_4_c -! MS FORTRAN needs explicit interface for C functions called here. -! - 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$ATTRIBUTES reference :: buf - 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 - CHARACTER(LEN=*), INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf - END FUNCTION h5areadc_4_c - END INTERFACE - - hdferr = h5areadc_4_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5aread_char_4 - - - SUBROUTINE h5aread_char_5(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - CHARACTER(LEN=*), INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf - ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5areadc_5_c -! MS FORTRAN needs explicit interface for C functions called here. -! - 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$ATTRIBUTES reference :: buf - 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 - CHARACTER(LEN=*), INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf - END FUNCTION h5areadc_5_c - END INTERFACE - - hdferr = h5areadc_5_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5aread_char_5 - - - SUBROUTINE h5aread_char_6(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - CHARACTER(LEN=*), INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf - ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5areadc_6_c -! MS FORTRAN needs explicit interface for C functions called here. -! - 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$ATTRIBUTES reference :: buf - 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 - CHARACTER(LEN=*), INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf - END FUNCTION h5areadc_6_c - END INTERFACE - - hdferr = h5areadc_6_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5aread_char_6 - - - SUBROUTINE h5aread_char_7(attr_id, memtype_id, buf, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype - ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes - CHARACTER(LEN=*), INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf - ! Attribute data - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5areadc_7_c -! MS FORTRAN needs explicit interface for C functions called here. -! - 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$ATTRIBUTES reference :: buf - 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 - CHARACTER(LEN=*), INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf - END FUNCTION h5areadc_7_c - END INTERFACE - - hdferr = h5areadc_7_c(attr_id, memtype_id, buf, dims) - END SUBROUTINE h5aread_char_7 - - -!---------------------------------------------------------------------- -! Name: h5aget_space_f -! -! Purpose: Gets a copy of the dataspace for an attribute. -! -! Inputs: -! attr_id - attribute identifier -! Outputs: -! space_id - attribite dataspace identifier -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces are added for -! called C functions (it is needed for Windows -! port). February 27, 2001 -! -!---------------------------------------------------------------------- - - SUBROUTINE h5aget_space_f(attr_id, space_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(OUT) :: space_id - ! Attribute dataspace identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL:: h5aget_space_c -! MS FORTRAN needs explicit interface for C functions called here. -! - 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 - INTEGER(HID_T), INTENT(IN) :: attr_id - INTEGER(HID_T), INTENT(OUT) :: space_id - END FUNCTION h5aget_space_c - END INTERFACE - - hdferr = h5aget_space_c(attr_id, space_id) - END SUBROUTINE h5aget_space_f - -!---------------------------------------------------------------------- -! Name: h5aget_type_f -! -! Purpose: Gets an attribute datatype. -! -! Inputs: -! attr_id - attribute identifier -! Outputs: -! type_id - attribute datatype identifier -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces are added for -! called C functions (it is needed for Windows -! port). February 27, 2001 -! -!---------------------------------------------------------------------- - - SUBROUTINE h5aget_type_f(attr_id, type_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HID_T), INTENT(OUT) :: type_id - ! Attribute datatype identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5aget_type_c -! MS FORTRAN needs explicit interface for C functions called here. -! - 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 - INTEGER(HID_T), INTENT(IN) :: attr_id - INTEGER(HID_T), INTENT(OUT) :: type_id - END FUNCTION h5aget_type_c - END INTERFACE - - hdferr = h5aget_type_c(attr_id, type_id) - END SUBROUTINE h5aget_type_f - -!---------------------------------------------------------------------- -! Name: h5aget_name_f -! -! Purpose: Gets an attribute name. -! -! Inputs: -! attr_id - attribute identifier -! size - size of a buffer to read name in -! Outputs: -! buf - buffer to read name in -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces are added for -! called C functions (it is needed for Windows -! port). February 27, 2001 -! -!---------------------------------------------------------------------- - - + + hdferr = h5aget_type_c(attr_id, type_id) + END SUBROUTINE h5aget_type_f +! +!****s* H5A/h5aget_name_f +! +! NAME +! h5aget_name_f +! +! PURPOSE +! Gets an attribute name. +! +! INPUTS +! attr_id - attribute identifier +! size - size of a buffer to read name in +! OUTPUTS +! buf - buffer to read name in +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces are added for +! called C functions (it is needed for Windows +! port). February 27, 2001 +! +! +! SOURCE SUBROUTINE h5aget_name_f(attr_id, size, buf, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier INTEGER(SIZE_T), INTENT(IN) :: size ! Buffer size - CHARACTER(LEN=*), INTENT(INOUT) :: buf - ! Buffer to hold attribute name + CHARACTER(LEN=*), INTENT(INOUT) :: buf ! Buffer to hold attribute name INTEGER, INTENT(OUT) :: hdferr ! Error code: - ! name length is successful, - ! -1 if fail - -! MS FORTRAN needs explicit interface for C functions called here. -! + ! name length is successful, -1 if fail +!***** INTERFACE INTEGER FUNCTION h5aget_name_c(attr_id, size, buf) USE H5GLOBAL @@ -1969,47 +370,46 @@ CONTAINS hdferr = h5aget_name_c(attr_id, size, buf) END SUBROUTINE h5aget_name_f -!---------------------------------------------------------------------- -! Name: h5aget_name_by_idx_f ! -! Purpose: Gets an attribute name, by attribute index position. +!****s* H5A/h5aget_name_by_idx_f ! -! Inputs: -! loc_id - Location of object to which attribute is attached -! obj_name - Name of object to which attribute is attached, relative to location -! idx_type - Type of index; Possible values are: +! NAME +! h5aget_name_by_idx_f ! -! H5_INDEX_UNKNOWN_F = -1 - Unknown index type -! H5_INDEX_NAME_F - Index on names -! H5_INDEX_CRT_ORDER_F - Index on creation order -! H5_INDEX_N_F - Number of indices defined +! PURPOSE +! Gets an attribute name, by attribute index position. ! -! order - Order in which to iterate over index; Possible values are: +! INPUTS +! loc_id - Location of object to which attribute is attached +! obj_name - Name of object to which attribute is attached, relative to location +! idx_type - Type of index; Possible values are: +! H5_INDEX_UNKNOWN_F = -1 - Unknown index type +! H5_INDEX_NAME_F - Index on names +! H5_INDEX_CRT_ORDER_F - Index on creation order +! H5_INDEX_N_F - Number of indices defined ! -! H5_ITER_UNKNOWN_F - Unknown order -! H5_ITER_INC_F - Increasing order -! H5_ITER_DEC_F - Decreasing order -! H5_ITER_NATIVE_F - No particular order, whatever is fastest -! H5_ITER_N_F - Number of iteration orders +! order - Order in which to iterate over index; Possible values are: +! H5_ITER_UNKNOWN_F - Unknown order +! H5_ITER_INC_F - Increasing order +! H5_ITER_DEC_F - Decreasing order +! H5_ITER_NATIVE_F - No particular order, whatever is fastest +! H5_ITER_N_F - Number of iteration orders +! order - Index traversal order +! n - Attribute’s position in index ! -! order - Index traversal order -! n - Attribute’s position in index +! OUTPUTS +! name - Attribute name +! hdferr - Returns 0 if successful and -1 if fails ! -! Outputs: -! name - Attribute name -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! lapl_id - Link access property list -! size - Size, in bytes, of attribute name +! OPTIONAL PARAMETERS +! lapl_id - Link access property list +! size - Size, in bytes, of attribute name ! -! Programmer: M.S. Breitenfeld -! January, 2008 +! AUTHOR +! M. Scot Breitenfeld +! January, 2008 ! -! Modifications: N/A -!---------------------------------------------------------------------- - +! SOURCE SUBROUTINE h5aget_name_by_idx_f(loc_id, obj_name, idx_type, order, & n, name, hdferr, size, lapl_id) IMPLICIT NONE @@ -2028,23 +428,19 @@ CONTAINS ! H5_ITER_DEC_F - Decreasing order ! H5_ITER_NATIVE_F - No particular order, whatever is fastest ! H5_ITER_N_F - Number of iteration orders - INTEGER(HSIZE_T), INTENT(IN) :: n ! Attribute’s position in index - CHARACTER(LEN=*), INTENT(OUT) :: name ! Attribute name - - INTEGER, INTENT(OUT) :: hdferr ! Error code: - ! Returns attribute name size, - ! -1 if fail - INTEGER(SIZE_T) :: obj_namelen - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list + ! Returns attribute name size, + ! -1 if fail + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list + INTEGER(SIZE_T), OPTIONAL, INTENT(OUT) :: size ! Indicates the size, in the number of characters, + ! of the attribute +!***** INTEGER(HID_T) :: lapl_id_default - INTEGER(SIZE_T), OPTIONAL, INTENT(OUT) :: size ! Indicates the size, in the number of characters, of the attribute + INTEGER(SIZE_T) :: obj_namelen INTEGER(SIZE_T) :: size_default -! -! MS FORTRAN needs explicit interface for C functions called here. -! + INTERFACE INTEGER FUNCTION h5aget_name_by_idx_c(loc_id, obj_name, obj_namelen, idx_type, order, & n, name, size_default, lapl_id_default) @@ -2079,43 +475,39 @@ CONTAINS END SUBROUTINE h5aget_name_by_idx_f - - -!---------------------------------------------------------------------- -! Name: h5aget_num_attrs_f ! -! Purpose: Determines the number of attributes attached to an object. +!****s* H5A/h5aget_num_attrs_f ! -! Inputs: -! obj_id - object (group, dataset, or named datatype) -! identifier -! Outputs: -! attr_num - number of attributes attached to the object -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! NAME +! h5aget_num_attrs_f ! -! Programmer: Elena Pourmal -! August 12, 1999 +! PURPOSE +! Determines the number of attributes attached to an object. ! -! Modifications: Explicit Fortran interfaces are added for -! called C functions (it is needed for Windows -! port). February 27, 2001 +! INPUTS +! obj_id - object (group, dataset, or named datatype) +! identifier +! OUTPUTS +! attr_num - number of attributes attached to the object +! hdferr - Returns 0 if successful and -1 if fails ! -!---------------------------------------------------------------------- - +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces are added for +! called C functions (it is needed for Windows +! port). February 27, 2001 +! +! SOURCE SUBROUTINE h5aget_num_attrs_f(obj_id, attr_num, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: obj_id ! Object identifier - INTEGER, INTENT(OUT) :: attr_num ! Number of attributes of the - ! object - INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER, INTENT(OUT) :: attr_num ! Number of attributes of the object + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** -! INTEGER, EXTERNAL :: h5aget_num_attrs_c -! MS FORTRAN needs explicit interface for C functions called here. -! INTERFACE INTEGER FUNCTION h5aget_num_attrs_c(obj_id, attr_num) USE H5GLOBAL @@ -2130,42 +522,40 @@ CONTAINS hdferr = h5aget_num_attrs_c(obj_id, attr_num) END SUBROUTINE h5aget_num_attrs_f -!---------------------------------------------------------------------- -! Name: h5adelete_f ! -! Purpose: Deletes an attribute of an object (group, dataset or -! named datatype) +!****s* H5A/h5adelete_f ! -! Inputs: -! obj_id - object identifier -! name - attribute name -! Outputs: +! NAME +! h5adelete_f ! -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! PURPOSE +! Deletes an attribute of an object (group, dataset or +! named datatype) ! -! Programmer: Elena Pourmal -! August 12, 1999 +! INPUTS +! obj_id - object identifier +! name - attribute name +! OUTPUTS ! -! Modifications: Explicit Fortran interfaces are added for -! called C functions (it is needed for Windows -! port). February 27, 2001 +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! Elena Pourmal +! August 12, 1999 ! -!---------------------------------------------------------------------- - +! HISTORY +! Explicit Fortran interfaces are added for +! called C functions (it is needed for Windows +! port). February 27, 2001 +! +! SOURCE SUBROUTINE h5adelete_f(obj_id, name, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: obj_id ! Object identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Attribute name - INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), INTENT(IN) :: obj_id ! Object identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Attribute name + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** INTEGER(SIZE_T) :: namelen -! INTEGER, EXTERNAL :: h5adelete_c -! MS FORTRAN needs explicit interface for C functions called here. -! INTERFACE INTEGER FUNCTION h5adelete_c(obj_id, name, namelen) USE H5GLOBAL @@ -2183,38 +573,36 @@ CONTAINS hdferr = h5adelete_c(obj_id, name, namelen) END SUBROUTINE h5adelete_f -!---------------------------------------------------------------------- -! Name: h5aclose_f ! -! Purpose: Closes the specified attribute. +!****s* H5A/h5aclose_f ! -! Inputs: -! attr_id - attribute identifier -! Outputs: +! NAME +! h5aclose_f ! -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! PURPOSE +! Closes the specified attribute. ! -! Programmer: Elena Pourmal -! August 12, 1999 +! INPUTS +! attr_id - attribute identifier +! OUTPUTS ! -! Modifications: Explicit Fortran interfaces are added for -! called C functions (it is needed for Windows -! port). February 27, 2001 +! hdferr - Returns 0 if successful and -1 if fails ! -!---------------------------------------------------------------------- - +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces are added for +! called C functions (it is needed for Windows +! port). February 27, 2001 +! SOURCE SUBROUTINE h5aclose_f(attr_id, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code: + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** -! INTEGER, EXTERNAL :: h5aclose_c -! MS FORTRAN needs explicit interface for C functions called here. -! INTERFACE INTEGER FUNCTION h5aclose_c(attr_id) USE H5GLOBAL @@ -2228,36 +616,32 @@ CONTAINS hdferr = h5aclose_c(attr_id) END SUBROUTINE h5aclose_f -!---------------------------------------------------------------------- -! Name: h5aget_storage_size_f ! -! Purpose: Returns the amount of storage required for an attribute. +!****s* H5A/h5aget_storage_size_f ! -! Inputs: -! attr_id - attribute identifier -! Outputs: -! size - attribute storage size -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! NAME +! h5aget_storage_size_f ! -! Programmer: M. S. Breitenfeld -! January, 2008 +! PURPOSE +! Returns the amount of storage required for an attribute. ! -! Modifications: N/A +! INPUTS +! attr_id - attribute identifier +! OUTPUTS +! size - attribute storage size +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! M. Scot Breitenfeld +! January, 2008 ! -!---------------------------------------------------------------------- - +! SOURCE SUBROUTINE h5aget_storage_size_f(attr_id, size, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier - INTEGER(HSIZE_T), INTENT(OUT) :: size ! Attribute storage requirement + INTEGER(HSIZE_T), INTENT(OUT) :: size ! Attribute storage requirement INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** -! MS FORTRAN needs explicit interface for C functions called here. -! INTERFACE INTEGER FUNCTION h5aget_storage_size_c(attr_id, size) USE H5GLOBAL @@ -2272,37 +656,34 @@ CONTAINS hdferr = h5aget_storage_size_c(attr_id, size) END SUBROUTINE h5aget_storage_size_f -!---------------------------------------------------------------------- -! Name: h5aget_create_plist_f ! -! Purpose: Gets an attribute creation property list identifier +!****s* H5A/h5aget_create_plist_f ! -! Inputs: -! attr_id - Identifier of the attribute -! Outputs: -! creation_prop_id - Identifier for the attribute’s creation property -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! NAME +! h5aget_create_plist_f ! -! Programmer: M. S. Breitenfeld -! January, 2008 +! PURPOSE +! Gets an attribute creation property list identifier ! -! Modifications: N/A +! INPUTS +! attr_id - Identifier of the attribute +! OUTPUTS +! creation_prop_id - Identifier for the attribute’s creation property +! hdferr - Returns 0 if successful and -1 if fails ! -!---------------------------------------------------------------------- - +! AUTHOR +! M. Scot Breitenfeld +! January, 2008 +! +! SOURCE SUBROUTINE h5aget_create_plist_f(attr_id, creation_prop_id, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: attr_id ! Identifier of the attribute INTEGER(HID_T), INTENT(OUT) :: creation_prop_id ! Identifier for the attribute’s creation property - INTEGER, INTENT(OUT) :: hdferr ! Error code: + INTEGER, INTENT(OUT) :: hdferr ! Error code ! 0 on success and -1 on failure +!***** -! MS FORTRAN needs explicit interface for C functions called here. -! INTERFACE INTEGER FUNCTION h5aget_create_plist_c(attr_id, creation_prop_id) USE H5GLOBAL @@ -2317,31 +698,31 @@ CONTAINS hdferr = h5aget_create_plist_c(attr_id, creation_prop_id) END SUBROUTINE h5aget_create_plist_f -!---------------------------------------------------------------------- -! Name: h5arename_by_name_f ! -! Purpose: Renames an attribute +!****s* H5A/h5arename_by_name_f ! -! Inputs: -! loc_id - Location or object identifier; may be dataset or group -! obj_name - Name of object, relative to location, -! whose attribute is to be renamed -! old_attr_name - Prior attribute name -! new_attr_name - New attribute name -! lapl_id - Link access property list identifier +! NAME +! h5arename_by_name_f ! -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 +! PURPOSE +! Renames an attribute ! -! Programmer: M.S. Breitenfeld -! January, 2008 +! INPUTS +! loc_id - Location or object identifier; may be dataset or group +! obj_name - Name of object, relative to location, +! whose attribute is to be renamed +! old_attr_name - Prior attribute name +! new_attr_name - New attribute name +! lapl_id - Link access property list identifier ! -! Modifications: N/A +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails ! -!---------------------------------------------------------------------- - +! AUTHOR +! M. Scot Breitenfeld +! January, 2008 +! +! SOURCE SUBROUTINE h5arename_by_name_f(loc_id, obj_name, old_attr_name, new_attr_name, & hdferr, lapl_id) IMPLICIT NONE @@ -2354,14 +735,12 @@ CONTAINS INTEGER, INTENT(OUT) :: hdferr ! Error code: ! 0 on success and -1 on failure INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list identifier - +!***** INTEGER(HID_T) :: lapl_id_default INTEGER(SIZE_T) :: obj_namelen INTEGER(SIZE_T) :: old_attr_namelen INTEGER(SIZE_T) :: new_attr_namelen -! MS FORTRAN needs explicit interface for C functions called here. -! INTERFACE INTEGER FUNCTION h5arename_by_name_c(loc_id, obj_name, obj_namelen, & old_attr_name, old_attr_namelen, new_attr_name, new_attr_namelen, & @@ -2370,7 +749,7 @@ CONTAINS !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 + !DEC$ATTRIBUTES reference :: obj_name, old_attr_name, new_attr_name INTEGER(HID_T), INTENT(IN) :: loc_id CHARACTER(LEN=*), INTENT(IN) :: obj_name INTEGER(SIZE_T) :: obj_namelen @@ -2396,30 +775,31 @@ CONTAINS END SUBROUTINE h5arename_by_name_f -!---------------------------------------------------------------------- -! Name: h5aopen_f ! -! Purpose: Opens an attribute for an object specified by object -! identifier and attribute name +!****s* H5A/h5aopen_f ! -! Inputs: -! obj_id - Identifer for object to which attribute is attached -! attr_name - Name of attribute to open -! Outputs: -! attr_id - attribute identifier -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! aapl_id - Attribute access property list +! NAME +! h5aopen_f ! -! Programmer: M.S. Breitenfeld -! January, 2008 +! PURPOSE +! Opens an attribute for an object specified by object +! identifier and attribute name ! -! Modifications: N/A -! -!---------------------------------------------------------------------- +! INPUTS +! obj_id - Identifer for object to which attribute is attached +! attr_name - Name of attribute to open +! OUTPUTS +! attr_id - attribute identifier +! OPTIONAL PARAMETERS +! aapl_id - Attribute access property list +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! M. Scot Breitenfeld +! January, 2008 +! +! SOURCE SUBROUTINE h5aopen_f(obj_id, attr_name, attr_id, hdferr, aapl_id) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: obj_id ! Object identifier @@ -2429,12 +809,11 @@ CONTAINS ! Success: 0 ! Failure: -1 INTEGER(HID_T), OPTIONAL, INTENT(IN) :: aapl_id ! Attribute access property list +!***** INTEGER(HID_T) :: aapl_id_default INTEGER(SIZE_T) :: attr_namelen -! MS FORTRAN needs explicit interface for C functions called here. -! INTERFACE INTEGER FUNCTION h5aopen_c(obj_id, attr_name, attr_namelen, aapl_id_default, attr_id) USE H5GLOBAL @@ -2459,43 +838,42 @@ CONTAINS END SUBROUTINE h5aopen_f -!---------------------------------------------------------------------- -! Name: h5adelete_by_idx_f -! -! Purpose: Deletes an attribute from an object according to index order ! -! Inputs: -! loc_id - Location or object identifier; may be dataset or group -! obj_name - Name of object, relative to location, from which attribute is to be removed -! idx_type - Type of index; Possible values are: +!****s* H5A/h5adelete_by_idx_f ! -! H5_INDEX_UNKNOWN_F = -1 - Unknown index type -! H5_INDEX_NAME_F - Index on names -! H5_INDEX_CRT_ORDER_F - Index on creation order -! H5_INDEX_N_F - Number of indices defined +! NAME +! h5adelete_by_idx_f ! -! order - Order in which to iterate over index; Possible values are: +! PURPOSE +! Deletes an attribute from an object according to index order ! -! H5_ITER_UNKNOWN_F - Unknown order -! H5_ITER_INC_F - Increasing order -! H5_ITER_DEC_F - Decreasing order -! H5_ITER_NATIVE_F - No particular order, whatever is fastest -! H5_ITER_N_F - Number of iteration orders +! INPUTS +! loc_id - Location or object identifier; may be dataset or group +! obj_name - Name of object, relative to location, from which attribute is to be removed +! idx_type - Type of index; Possible values are: +! H5_INDEX_UNKNOWN_F = -1 - Unknown index type +! H5_INDEX_NAME_F - Index on names +! H5_INDEX_CRT_ORDER_F - Index on creation order +! H5_INDEX_N_F - Number of indices defined ! -! n - Offset within index -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! lapl_id - Link access property list +! order - Order in which to iterate over index; Possible values are: +! H5_ITER_UNKNOWN_F - Unknown order +! H5_ITER_INC_F - Increasing order +! H5_ITER_DEC_F - Decreasing order +! H5_ITER_NATIVE_F - No particular order, whatever is fastest +! H5_ITER_N_F - Number of iteration orders ! -! Programmer: M.S. Breitenfeld -! January, 2008 +! n - Offset within index +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! OPTIONAL PARAMETERS +! lapl_id - Link access property list ! -! Modifications: N/A +! AUTHOR +! M. Scot Breitenfeld +! January, 2008 ! -!---------------------------------------------------------------------- +! SOURCE SUBROUTINE h5adelete_by_idx_f(loc_id, obj_name, idx_type, order, n, hdferr, lapl_id) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: loc_id ! Identifer for object to which attribute is attached @@ -2513,17 +891,14 @@ CONTAINS ! H5_ITER_DEC_F - Decreasing order ! H5_ITER_NATIVE_F - No particular order, whatever is fastest ! H5_ITER_N_F - Number of iteration orders -! INTEGER(HSIZE_T), INTENT(IN) :: n ! Offset within index INTEGER, INTENT(OUT) :: hdferr ! Error code: ! 0 on success and -1 on failure + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list +!***** INTEGER(SIZE_T) :: obj_namelen - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list - INTEGER(HID_T) :: lapl_id_default -! MS FORTRAN needs explicit interface for C functions called here. -! INTERFACE INTEGER FUNCTION h5adelete_by_idx_c(loc_id, obj_name, obj_namelen, idx_type, order, n, lapl_id_default) USE H5GLOBAL @@ -2549,45 +924,43 @@ CONTAINS END SUBROUTINE h5adelete_by_idx_f -!---------------------------------------------------------------------- -! Name: h5adelete_by_name_f ! -! Purpose: Removes an attribute from a specified location +!****s* H5A/h5adelete_by_name_f ! -! Inputs: -! loc_id - Identifer for object to which attribute is attached -! obj_name - Name of attribute to open -! attr_name - Attribute access property list -! lapl_id - Link access property list -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! NAME +! h5adelete_by_name_f ! -! Programmer: M.S. Breitenfeld -! January, 2008 +! PURPOSE +! Removes an attribute from a specified location ! -! Modifications: N/A +! INPUTS +! loc_id - Identifer for object to which attribute is attached +! obj_name - Name of attribute to open +! attr_name - Attribute access property list +! lapl_id - Link access property list +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails ! -!---------------------------------------------------------------------- +! AUTHOR +! M. Scot Breitenfeld +! January, 2008 +! +! SOURCE SUBROUTINE h5adelete_by_name_f(loc_id, obj_name, attr_name, hdferr, lapl_id) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: loc_id ! Identifer for object to which attribute is attached CHARACTER(LEN=*), INTENT(IN) :: obj_name ! Name of object, relative to location, ! from which attribute is to be removed CHARACTER(LEN=*), INTENT(IN) :: attr_name ! Name of attribute to delete - INTEGER, INTENT(OUT) :: hdferr ! Error code: - ! 0 on success and -1 on failure - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list + INTEGER, INTENT(OUT) :: hdferr ! Error code: + ! 0 on success and -1 on failure + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list +!***** INTEGER(SIZE_T) :: attr_namelen INTEGER(SIZE_T) :: obj_namelen INTEGER(HID_T) :: lapl_id_default -! MS FORTRAN needs explicit interface for C functions called here. -! INTERFACE INTEGER FUNCTION h5adelete_by_name_c(loc_id, obj_name, obj_namelen, attr_name, attr_namelen, lapl_id_default) USE H5GLOBAL @@ -2614,32 +987,32 @@ CONTAINS END SUBROUTINE h5adelete_by_name_f -!---------------------------------------------------------------------- -! Name: h5aopen_by_idx_f ! -! Purpose: Opens an existing attribute that is attached to an object specified by location and name +!****s* H5A/h5aopen_by_idx_f ! -! Inputs: -! loc_id - Location of object to which attribute is attached -! obj_name - Name of object to which attribute is attached, relative to location -! idx_type - Type of index -! order - Index traversal order -! n - Attribute’s position in index -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! aapl_id - Attribute access property list -! lapl_id - Link access property list +! NAME +! h5aopen_by_idx_f ! -! Programmer: M.S. Breitenfeld -! January, 2008 +! PURPOSE +! Opens an existing attribute that is attached to an object specified by location and name ! -! Modifications: N/A +! INPUTS +! loc_id - Location of object to which attribute is attached +! obj_name - Name of object to which attribute is attached, relative to location +! idx_type - Type of index +! order - Index traversal order +! n - Attribute’s position in index +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! OPTIONAL PARAMETERS +! aapl_id - Attribute access property list +! lapl_id - Link access property list ! -!---------------------------------------------------------------------- - +! AUTHOR +! M. Scot Breitenfeld +! January, 2008 +! +! SOURCE SUBROUTINE h5aopen_by_idx_f(loc_id, obj_name, idx_type, order, n, attr_id, hdferr, aapl_id, lapl_id) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: loc_id ! Object identifier @@ -2655,21 +1028,18 @@ CONTAINS ! H5_ITER_DEC_F - Decreasing order ! H5_ITER_NATIVE_F - No particular order, whatever is fastest - INTEGER(HSIZE_T), INTENT(IN) :: n ! Attribute’s position in index + INTEGER(HSIZE_T), INTENT(IN) :: n ! Attribute’s position in index INTEGER(HID_T), INTENT(OUT) :: attr_id ! Attribute identifier INTEGER, INTENT(OUT) :: hdferr ! Error code: ! 0 on success and -1 on failure INTEGER(HID_T), OPTIONAL, INTENT(IN) :: aapl_id ! Attribute access property list INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list - +!***** INTEGER(SIZE_T) :: obj_namelen INTEGER(HID_T) :: aapl_id_default INTEGER(HID_T) :: lapl_id_default -! -! MS FORTRAN needs explicit interface for C functions called here. -! INTERFACE INTEGER FUNCTION h5aopen_by_idx_c(loc_id, obj_name, obj_namelen, idx_type, order, n, & aapl_id_default, lapl_id_default, attr_id) @@ -2702,49 +1072,43 @@ CONTAINS END SUBROUTINE h5aopen_by_idx_f -!---------------------------------------------------------------------- -! Name: h5aget_info_f -! -! Purpose: Retrieves attribute information, by attribute identifier -! -! Inputs: -! attr_id - attribute identifier ! -! Outputs: NOTE: In C it is defined as a structure: H5A_info_t +!****s* H5A/h5aget_info_f ! -! corder_valid - indicates whether the creation order data is valid for this attribute -! corder - is a positive integer containing the creation order of the attribute -! cset - indicates the character set used for the attribute’s name -! data_size - indicates the size, in the number of characters, of the attribute +! NAME +! h5aget_info_f ! -! hdferr - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! PURPOSE +! Retrieves attribute information, by attribute identifier ! -! Programmer: M. S. Breitenfeld -! January, 2008 +! INPUTS +! attr_id - attribute identifier ! -! Modifications: N/A +! OUTPUTS +! NOTE: In C it is defined as a structure: H5A_info_t ! -!---------------------------------------------------------------------- - - SUBROUTINE h5aget_info_f(attr_id, f_corder_valid, corder, cset, data_size, hdferr) +! corder_valid - indicates whether the creation order data is valid for this attribute +! corder - is a positive integer containing the creation order of the attribute +! cset - indicates the character set used for the attribute’s name +! data_size - indicates the size, in the number of characters, of the attribute +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! M. Scot Breitenfeld +! January, 2008 +! SOURCE + SUBROUTINE h5aget_info_f(attr_id, f_corder_valid, corder, cset, data_size, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier LOGICAL, INTENT(OUT) :: f_corder_valid ! Indicates whether the creation order data is valid for this attribute INTEGER, INTENT(OUT) :: corder ! Is a positive integer containing the creation order of the attribute - INTEGER, INTENT(OUT) :: cset ! Indicates the character set used for the attribute’s name - INTEGER(HSIZE_T), INTENT(OUT) :: data_size ! Indicates the size, in the number of characters, of the attribute + INTEGER, INTENT(OUT) :: cset ! Indicates the character set used for the attribute’s name + INTEGER(HSIZE_T), INTENT(OUT) :: data_size ! Indicates the size, in the number of characters, of the attribute INTEGER, INTENT(OUT) :: hdferr ! Error code: ! 0 on success and -1 on failure - +!***** INTEGER :: corder_valid -! MS FORTRAN needs explicit interface for C functions called here. -! INTERFACE INTEGER FUNCTION h5aget_info_c(attr_id, corder_valid, corder, cset, data_size) USE H5GLOBAL @@ -2766,43 +1130,43 @@ CONTAINS IF (corder_valid .EQ. 1) f_corder_valid =.TRUE. - END SUBROUTINE h5aget_info_f -!---------------------------------------------------------------------- -! Name: h5aget_info_by_idx_f ! -! Purpose: Retrieves attribute information, by attribute index position +!****s* H5A/h5aget_info_by_idx_f ! -! Inputs: -! loc_id - Location of object to which attribute is attached -! obj_name - Name of object to which attribute is attached, relative to location -! idx_type - Type of index -! order - Index traversal order -! n - Attribute’s position in index +! NAME +! h5aget_info_by_idx_f ! -! Outputs: NOTE: In C it is defined as a structure: H5A_info_t -! corder_valid - indicates whether the creation order data is valid for this attribute -! corder - is a positive integer containing the creation order of the attribute -! cset - indicates the character set used for the attribute’s name -! data_size - indicates the size, in the number of characters, of the attribute -! hdferr - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! lapl_id - Link access property list +! PURPOSE +! Retrieves attribute information, by attribute index position ! -! Programmer: M. S. Breitenfeld -! January, 2008 +! INPUTS +! loc_id - Location of object to which attribute is attached +! obj_name - Name of object to which attribute is attached, relative to location +! idx_type - Type of index +! order - Index traversal order +! n - Attribute’s position in index ! -! Modifications: N/A +! OUTPUTS NOTE: In C it is defined as a structure: H5A_info_t +! corder_valid - indicates whether the creation order data is valid for this attribute +! corder - is a positive integer containing the creation order of the attribute +! cset - indicates the character set used for the attribute’s name +! data_size - indicates the size, in the number of characters, of the attribute +! hdferr - Returns 0 if successful and -1 if fails +! OPTIONAL PARAMETERS +! lapl_id - Link access property list ! -!---------------------------------------------------------------------- +! AUTHOR +! M. Scot Breitenfeld +! January, 2008 +! +! SOURCE SUBROUTINE h5aget_info_by_idx_f(loc_id, obj_name, idx_type, order, n, & f_corder_valid, corder, cset, data_size, hdferr, lapl_id) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! Object identifier - CHARACTER(LEN=*), INTENT(IN) :: obj_name ! Name of object to which attribute is attached + INTEGER(HID_T), INTENT(IN) :: loc_id ! Object identifier + CHARACTER(LEN=*), INTENT(IN) :: obj_name ! Name of object to which attribute is attached INTEGER, INTENT(IN) :: idx_type ! Type of index; Possible values are: ! H5_INDEX_UNKNOWN_F - Unknown index type ! H5_INDEX_NAME_F - Index on names @@ -2814,22 +1178,21 @@ CONTAINS ! H5_ITER_DEC_F - Decreasing order ! H5_ITER_NATIVE_F - No particular order, whatever is fastest - INTEGER(HSIZE_T), INTENT(IN) :: n ! Attribute’s position in index + INTEGER(HSIZE_T), INTENT(IN) :: n ! Attribute’s position in index LOGICAL, INTENT(OUT) :: f_corder_valid ! Indicates whether the creation order data is valid for this attribute INTEGER, INTENT(OUT) :: corder ! Is a positive integer containing the creation order of the attribute - INTEGER, INTENT(OUT) :: cset ! Indicates the character set used for the attribute’s name - INTEGER(HSIZE_T), INTENT(OUT) :: data_size ! Indicates the size, in the number of characters, of the attribute + INTEGER, INTENT(OUT) :: cset ! Indicates the character set used for the attribute’s name + INTEGER(HSIZE_T), INTENT(OUT) :: data_size ! Indicates the size, in the number of characters, of the attribute INTEGER, INTENT(OUT) :: hdferr ! Error code: ! 0 on success and -1 on failure + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list +!***** INTEGER :: corder_valid INTEGER(SIZE_T) :: obj_namelen - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list INTEGER(HID_T) :: lapl_id_default -! MS FORTRAN needs explicit interface for C functions called here. -! INTERFACE 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) @@ -2866,33 +1229,34 @@ CONTAINS END SUBROUTINE h5aget_info_by_idx_f -!---------------------------------------------------------------------- -! Name: h5aget_info_by_name_f ! -! Purpose: Retrieves attribute information, by attribute name +!****s* H5A/h5aget_info_by_name_f +! +! NAME +! h5aget_info_by_name_f ! -! Inputs: -! loc_id - Location of object to which attribute is attached -! obj_name - Name of object to which attribute is attached, relative to location -! attr_name - Attribute name +! PURPOSE +! Retrieves attribute information, by attribute name ! -! Outputs: NOTE: In C it is defined as a structure: H5A_info_t -! corder_valid - indicates whether the creation order data is valid for this attribute -! corder - is a positive integer containing the creation order of the attribute -! cset - indicates the character set used for the attribute’s name -! data_size - indicates the size, in the number of characters, of the attribute -! hdferr - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! lapl_id - Link access property list +! INPUTS +! loc_id - Location of object to which attribute is attached +! obj_name - Name of object to which attribute is attached, relative to location +! attr_name - Attribute name ! -! Programmer: M. S. Breitenfeld -! January, 2008 +! OUTPUTS NOTE: In C it is defined as a structure: H5A_info_t +! corder_valid - indicates whether the creation order data is valid for this attribute +! corder - is a positive integer containing the creation order of the attribute +! cset - indicates the character set used for the attribute’s name +! data_size - indicates the size, in the number of characters, of the attribute +! hdferr - Returns 0 if successful and -1 if fails +! OPTIONAL PARAMETERS +! lapl_id - Link access property list ! -! Modifications: N/A +! AUTHOR +! M. Scot Breitenfeld +! January, 2008 ! -!---------------------------------------------------------------------- +! SOURCE SUBROUTINE h5aget_info_by_name_f(loc_id, obj_name, attr_name, & f_corder_valid, corder, cset, data_size, hdferr, lapl_id) IMPLICIT NONE @@ -2907,15 +1271,13 @@ CONTAINS INTEGER(HSIZE_T), INTENT(OUT) :: data_size ! Indicates the size, in the number of characters, of the attribute INTEGER, INTENT(OUT) :: hdferr ! Error code: ! 0 on success and -1 on failure + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list +!***** INTEGER :: corder_valid INTEGER(SIZE_T) :: obj_namelen INTEGER(SIZE_T) :: attr_namelen - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list INTEGER(HID_T) :: lapl_id_default - -! MS FORTRAN needs explicit interface for C functions called here. -! INTERFACE 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) @@ -2952,52 +1314,49 @@ CONTAINS END SUBROUTINE h5aget_info_by_name_f -!---------------------------------------------------------------------- -! Name: H5Acreate_by_name_f ! -! Purpose: Creates an attribute attached to a specified object +!****s* H5A/h5acreate_by_name_f ! -! Inputs: -! loc_id - Location or object identifier; may be dataset or group -! obj_name - Name, relative to loc_id, of object that attribute is to be attached to -! attr_name - Attribute name -! type_id - Attribute datatype identifier -! space_id - Attribute dataspace identifier +! NAME +! h5acreate_by_name_f ! -! Outputs: -! attr - an attribute identifier -! hdferr - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! acpl_id - Attribute creation property list identifier (Currently not used.) -! aapl_id - Attribute access property list identifier (Currently not used.) -! lapl_id - Link access property list +! PURPOSE +! Creates an attribute attached to a specified object ! -! Programmer: M. S. Breitenfeld -! February, 2008 +! INPUTS +! loc_id - Location or object identifier; may be dataset or group +! obj_name - Name, relative to loc_id, of object that attribute is to be attached to +! attr_name - Attribute name +! type_id - Attribute datatype identifier +! space_id - Attribute dataspace identifier ! -! Modifications: N/A +! OUTPUTS +! attr - an attribute identifier +! hdferr - Returns 0 if successful and -1 if fails +! OPTIONAL PARAMETERS +! acpl_id - Attribute creation property list identifier (Currently not used.) +! aapl_id - Attribute access property list identifier (Currently not used.) +! lapl_id - Link access property list ! -!---------------------------------------------------------------------- +! AUTHOR +! M. Scot Breitenfeld +! February, 2008 +! SOURCE SUBROUTINE h5acreate_by_name_f(loc_id, obj_name, attr_name, type_id, space_id, attr, hdferr, & acpl_id, aapl_id, lapl_id) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! Object identifier - CHARACTER(LEN=*), INTENT(IN) :: obj_name ! Name of object to which attribute is attached - CHARACTER(LEN=*), INTENT(IN) :: attr_name ! Attribute name - - INTEGER(HID_T), INTENT(IN) :: type_id ! Attribute datatype identifier - INTEGER(HID_T), INTENT(IN) :: space_id ! Attribute dataspace identifier - - INTEGER(HID_T), INTENT(OUT) :: attr ! an attribute identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code: - ! 0 on success and -1 on failure - - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: acpl_id ! Attribute creation property list identifier (Currently not used.) - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: aapl_id ! Attribute access property list identifier (Currently not used.) - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list - + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(LEN=*), INTENT(IN) :: obj_name + CHARACTER(LEN=*), INTENT(IN) :: attr_name + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER(HID_T), INTENT(OUT) :: attr + INTEGER, INTENT(OUT) :: hdferr + + INTEGER(HID_T), INTENT(IN), OPTIONAL :: acpl_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: aapl_id + INTEGER(HID_T), INTENT(IN), OPTIONAL :: lapl_id +!***** INTEGER(SIZE_T) :: obj_namelen INTEGER(SIZE_T) :: attr_namelen @@ -3005,8 +1364,6 @@ CONTAINS INTEGER(HID_T) :: aapl_id_default INTEGER(HID_T) :: lapl_id_default -! MS FORTRAN needs explicit interface for C functions called here. -! INTERFACE 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) @@ -3045,41 +1402,39 @@ CONTAINS type_id, space_id, acpl_id_default, aapl_id_default, lapl_id_default, attr) END SUBROUTINE h5acreate_by_name_f -!---------------------------------------------------------------------- -! Name: H5Aexists_f ! -! Purpose: Determines whether an attribute with a given name exists on an object +!****s* H5A/H5Aexists_f +! +! NAME +! H5Aexists_f ! -! Inputs: -! obj_id - Object identifier -! attr_name - Attribute name +! PURPOSE +! Determines whether an attribute with a given name exists on an object ! -! Outputs: -! attr_exists - attribute exists status -! hdferr - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! INPUTS +! obj_id - Object identifier +! attr_name - Attribute name ! -! Programmer: M. S. Breitenfeld -! February, 2008 +! OUTPUTS +! attr_exists - attribute exists status +! hdferr - Returns 0 if successful and -1 if fails ! -! Modifications: N/A +! AUTHOR +! M. Scot Breitenfeld +! February, 2008 ! -!---------------------------------------------------------------------- +! SOURCE SUBROUTINE h5aexists_f(obj_id, attr_name, attr_exists, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: obj_id ! Object identifier + INTEGER(HID_T), INTENT(IN) :: obj_id ! Object identifier CHARACTER(LEN=*), INTENT(IN) :: attr_name ! Attribute name - LOGICAL, INTENT(OUT) :: attr_exists ! .TRUE. if exists, .FALSE. otherwise - INTEGER, INTENT(OUT) :: hdferr ! Error code: - ! 0 on success and -1 on failure + LOGICAL, INTENT(OUT) :: attr_exists ! .TRUE. if exists, .FALSE. otherwise + INTEGER, INTENT(OUT) :: hdferr ! Error code: + ! 0 on success and -1 on failure +!***** INTEGER(HID_T) :: attr_exists_c INTEGER(SIZE_T) :: attr_namelen -! -! MS FORTRAN needs explicit interface for C functions called here. -! + INTERFACE INTEGER FUNCTION h5aexists_c(obj_id, attr_name, attr_namelen, attr_exists_c) USE H5GLOBAL @@ -3103,55 +1458,55 @@ CONTAINS END SUBROUTINE h5aexists_f -!---------------------------------------------------------------------- -! Name: H5Aexists_by_name_f ! -! Purpose: Determines whether an attribute with a given name exists on an object +!****s* H5A/H5Aexists_by_name_f +! +! NAME +! H5Aexists_by_name_f ! -! Inputs: -! loc_id - Location identifier -! obj_name - Object name either relative to loc_id, absolute from the file’s root group, or '.' (a dot) -! attr_name - Attribute name +! PURPOSE +! Determines whether an attribute with a given name exists on an object ! -! Outputs: -! attr_exists - attribute exists status -! hdferr - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! lapl_id - Link access property list identifier +! INPUTS +! loc_id - Location identifier +! obj_name - Object name either relative to loc_id, absolute from the file’s root group, or '.' (a dot) +! attr_name - Attribute name ! -! Programmer: M. S. Breitenfeld -! February, 2008 +! OUTPUTS +! attr_exists - attribute exists status +! hdferr - Returns 0 if successful and -1 if fails +! OPTIONAL PARAMETERS +! lapl_id - Link access property list identifier ! -! Modifications: N/A +! AUTHOR +! M. Scot Breitenfeld +! February, 2008 ! -!---------------------------------------------------------------------- +! SOURCE SUBROUTINE h5aexists_by_name_f(loc_id, obj_name, attr_name, attr_exists, hdferr, lapl_id) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! Location identifier + INTEGER(HID_T), INTENT(IN) :: loc_id ! Location identifier CHARACTER(LEN=*), INTENT(IN) :: obj_name ! Object name either relative to loc_id, ! absolute from the file’s root group, or '.' CHARACTER(LEN=*), INTENT(IN) :: attr_name ! Attribute name LOGICAL, INTENT(OUT) :: attr_exists ! .TRUE. if exists, .FALSE. otherwise - INTEGER, INTENT(OUT) :: hdferr ! Error code: - ! 0 on success and -1 on failure + INTEGER, INTENT(OUT) :: hdferr ! Error code: + ! 0 on success and -1 on failure INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list identifier +!***** INTEGER :: attr_exists_c INTEGER(SIZE_T) :: obj_namelen INTEGER(SIZE_T) :: attr_namelen INTEGER(HID_T) :: lapl_id_default -! -! MS FORTRAN needs explicit interface for C functions called here. -! + 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$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 @@ -3174,31 +1529,31 @@ CONTAINS IF(attr_exists_c.GT.0) attr_exists = .TRUE. END SUBROUTINE h5aexists_by_name_f -!---------------------------------------------------------------------- -! Name: H5Aopen_by_name_f ! -! Purpose: Opens an attribute for an object by object name and attribute name. +!****s* H5A/H5Aopen_by_name_f ! -! Inputs: -! loc_id - Location from which to find object to which attribute is attached -! obj_name - Object name either relative to loc_id, absolute from the file’s root group, or '.' (a dot) -! attr_name - Attribute name +! NAME +! H5Aopen_by_name_f ! -! Outputs: -! attr_id - attribute identifier -! hdferr - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! aapl_id - Attribute access property list (Currently unused; should be passed in as H5P_DEFAULT.) -! lapl_id - Link access property list identifier +! PURPOSE +! Opens an attribute for an object by object name and attribute name. ! -! Programmer: M. S. Breitenfeld -! February, 2008 +! INPUTS +! loc_id - Location from which to find object to which attribute is attached +! obj_name - Object name either relative to loc_id, absolute from the file’s root group, or '.' (a dot) +! attr_name - Attribute name ! -! Modifications: N/A +! OUTPUTS +! attr_id - attribute identifier +! hdferr - Returns 0 if successful and -1 if fails +! OPTIONAL PARAMETERS +! aapl_id - Attribute access property list (Currently unused; should be passed in as H5P_DEFAULT.) +! lapl_id - Link access property list identifier ! -!---------------------------------------------------------------------- +! AUTHOR +! M. Scot Breitenfeld +! February, 2008 +! SOURCE SUBROUTINE h5aopen_by_name_f(loc_id, obj_name, attr_name, attr_id, hdferr, aapl_id, lapl_id) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: loc_id ! Location identifier @@ -3211,15 +1566,13 @@ CONTAINS INTEGER(HID_T), OPTIONAL, INTENT(IN) :: aapl_id ! Attribute access property list ! (Currently unused; should be passed in as H5P_DEFAULT_F) INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list identifier - +!***** INTEGER(HID_T) :: aapl_id_default INTEGER(HID_T) :: lapl_id_default INTEGER(SIZE_T) :: obj_namelen INTEGER(SIZE_T) :: attr_namelen -! -! MS FORTRAN needs explicit interface for C functions called here. -! + INTERFACE INTEGER FUNCTION h5aopen_by_name_c(loc_id, obj_name, obj_namelen, attr_name, attr_namelen, & aapl_id_default, lapl_id_default, attr_id) @@ -3252,28 +1605,33 @@ CONTAINS END SUBROUTINE h5aopen_by_name_f -!---------------------------------------------------------------------- -! Name: h5arename_f ! -! Purpose: Renames an attribute +!****s* H5A/h5arename_f ! -! Inputs: -! loc_id - Location or object identifier; may be dataset or group -! old_attr_name - Prior attribute name -! new_attr_name - New attribute name +! NAME +! h5arename_f ! -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 +! PURPOSE +! Renames an attribute ! -! Programmer: M.S. Breitenfeld -! January, 2008 +! INPUTS +! loc_id - Location or object identifier; may be dataset or group +! old_attr_name - Prior attribute name +! new_attr_name - New attribute name +! +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! M. Scot Breitenfeld +! January, 2008 +! +! HISTORY +! N/A ! -! Modifications: N/A ! -!---------------------------------------------------------------------- +! SOURCE SUBROUTINE h5arename_f(loc_id, old_attr_name, new_attr_name, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: loc_id ! Object identifier @@ -3281,11 +1639,10 @@ CONTAINS CHARACTER(LEN=*), INTENT(IN) :: new_attr_name ! New attribute name INTEGER, INTENT(OUT) :: hdferr ! Error code: ! 0 on success and -1 on failure +!***** INTEGER(SIZE_T) :: old_attr_namelen INTEGER(SIZE_T) :: new_attr_namelen -! MS FORTRAN needs explicit interface for C functions called here. -! INTERFACE INTEGER FUNCTION h5arename_c(loc_id, & old_attr_name, old_attr_namelen, new_attr_name, new_attr_namelen) diff --git a/fortran/src/H5Aff_F03.f90 b/fortran/src/H5Aff_F03.f90 new file mode 100644 index 0000000..b9e6c92 --- /dev/null +++ b/fortran/src/H5Aff_F03.f90 @@ -0,0 +1,1274 @@ +!****h* ROBODoc/H5A (F03) +! NAME +! H5A_PROVISIONAL +! +! FILE +! src/fortran/src/H5Aff_F03.f90 +! +! PURPOSE +! This file contains Fortran 90 and Fortran 2003 interfaces for H5A functions. +! It contains the same functions as H5Aff_F90.f90 but includes the +! Fortran 2003 functions and the interface listings. This file will be compiled +! instead of H5Aff_F90.f90 if Fortran 2003 functions are enabled. +! +! COPYRIGHT +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +! NOTES +! +! (A) C_LOC and character strings according to the Fortran 2003 standard: +! +! 15.1.2.5 C_LOC(X) +! +! Argument. X shall either +! +! (1) have interoperable type and type parameters and be +! (a) a variable that has the TARGET attribute and is interoperable, +! (b) an allocated allocatable variable that has the TARGET attribute +! and is not an array of zero size, or +! (c) an associated scalar pointer, or +! (2) be a nonpolymorphic scalar, have no length type parameters, and be +! (a) a nonallocatable, nonpointer variable that has the TARGET attribute, +! (b) an allocated allocatable variable that has the TARGET attribute, or +! (c) an associated pointer. +! +! - When X is a character, for interoperability the standard is: +! +! 15.2.1 Interoperability of intrinsic types +! +! ...if the type is character, interoperability also requires that the length type parameter +! be omitted or be specified by an initialization expression whose value is one. +! +! THEREFORE compilers that have not extended the standard require +! +! CHARACTER(LEN=1), TARGET :: chr +! or +! CHARACTER, TARGET :: chr +! +! (B) +! *** IMPORTANT *** +! If you add a new H5A function you must add the function name to the +! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! This is needed for Windows based operating systems. +! +!***** + +MODULE H5A_PROVISIONAL + + USE H5GLOBAL +! +! On Windows there are no big (integer*8) integers, so overloading +! for bug #670 does not work. I have to use DEC compilation directives to make +! Windows DEC Visual Fortran and OSF compilers happy and do right things. +! 05/01/02 EP +! + INTERFACE h5awrite_f + MODULE PROCEDURE h5awrite_integer_scalar + MODULE PROCEDURE h5awrite_integer_1 + MODULE PROCEDURE h5awrite_integer_2 + MODULE PROCEDURE h5awrite_integer_3 + MODULE PROCEDURE h5awrite_integer_4 + MODULE PROCEDURE h5awrite_integer_5 + MODULE PROCEDURE h5awrite_integer_6 + MODULE PROCEDURE h5awrite_integer_7 + MODULE PROCEDURE h5awrite_char_scalar + MODULE PROCEDURE h5awrite_char_1 + MODULE PROCEDURE h5awrite_char_2 + MODULE PROCEDURE h5awrite_char_3 + MODULE PROCEDURE h5awrite_char_4 + MODULE PROCEDURE h5awrite_char_5 + MODULE PROCEDURE h5awrite_char_6 + MODULE PROCEDURE h5awrite_char_7 + MODULE PROCEDURE h5awrite_real_scalar + MODULE PROCEDURE h5awrite_real_1 + MODULE PROCEDURE h5awrite_real_2 + MODULE PROCEDURE h5awrite_real_3 + MODULE PROCEDURE h5awrite_real_4 + MODULE PROCEDURE h5awrite_real_5 + MODULE PROCEDURE h5awrite_real_6 + MODULE PROCEDURE h5awrite_real_7 + ! This is the preferred way to call h5awrite + ! by passing an address + MODULE PROCEDURE h5awrite_ptr + + END INTERFACE + + INTERFACE h5aread_f + + MODULE PROCEDURE h5aread_integer_scalar + MODULE PROCEDURE h5aread_integer_1 + MODULE PROCEDURE h5aread_integer_2 + MODULE PROCEDURE h5aread_integer_3 + MODULE PROCEDURE h5aread_integer_4 + MODULE PROCEDURE h5aread_integer_5 + MODULE PROCEDURE h5aread_integer_6 + MODULE PROCEDURE h5aread_integer_7 + MODULE PROCEDURE h5aread_char_scalar + MODULE PROCEDURE h5aread_char_1 + MODULE PROCEDURE h5aread_char_2 + MODULE PROCEDURE h5aread_char_3 + MODULE PROCEDURE h5aread_char_4 + MODULE PROCEDURE h5aread_char_5 + MODULE PROCEDURE h5aread_char_6 + MODULE PROCEDURE h5aread_char_7 + MODULE PROCEDURE h5aread_real_scalar + MODULE PROCEDURE h5aread_real_1 + MODULE PROCEDURE h5aread_real_2 + MODULE PROCEDURE h5aread_real_3 + MODULE PROCEDURE h5aread_real_4 + MODULE PROCEDURE h5aread_real_5 + MODULE PROCEDURE h5aread_real_6 + MODULE PROCEDURE h5aread_real_7 + + ! This is the preferred way to call h5aread + ! by passing an address + MODULE PROCEDURE h5aread_ptr + + END INTERFACE + +! Interface for the function used to pass the C pointer of the buffer +! to the C H5Awrite routine + + INTERFACE + INTEGER FUNCTION h5awrite_f_c(attr_id, mem_type_id, buf) + USE H5GLOBAL + USE, INTRINSIC :: ISO_C_BINDING + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AWRITE_F_C'::h5awrite_f_c + !DEC$ENDIF + INTEGER(HID_T), INTENT(IN) :: attr_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + TYPE(C_PTR), VALUE :: buf + END FUNCTION h5awrite_f_c + END INTERFACE + +! Interface for the function used to pass the C pointer of the buffer +! to the C H5Aread routine + + INTERFACE + INTEGER FUNCTION h5aread_f_c(attr_id, mem_type_id, buf) + USE H5GLOBAL + USE, INTRINSIC :: ISO_C_BINDING + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5AREAD_F_C'::h5aread_f_c + !DEC$ENDIF + INTEGER(HID_T), INTENT(IN) :: attr_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + TYPE(C_PTR), VALUE :: buf + END FUNCTION h5aread_f_c + END INTERFACE + +CONTAINS + +!****s* H5A (F03)/h5awrite_f_F90 +! +! NAME +! h5awrite_f_F90 +! +! PURPOSE +! Writes an attribute. +! +! Inputs: +! attr_id - Attribute identifier +! memtype_id - Attribute datatype identifier (in memory) +! dims - Array to hold corresponding dimension sizes of data buffer buf; +! dim(k) has value of the k-th dimension of buffer buf; +! values are ignored if buf is a scalar +! buf - Data buffer; may be a scalar or an array +! +! Outputs: +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces are added for +! called C functions (it is needed for Windows +! port). February 27, 2001 +! +! dims parameter was added to make code portable; +! Aprile 4, 2001 +! +! Changed buf intent to INOUT to be consistant +! with how the C functions handles it. The pg +! compiler will return 0 if a buf value is not set. +! February, 2008 +! +! NOTES +! This function is overloaded to write INTEGER, +! REAL, DOUBLE PRECISION and CHARACTER buffers +! up to 7 dimensions. +! +! Fortran90 Interface: +!! SUBROUTINE h5awrite_f(attr_id, memtype_id, buf, dims, hdferr) +!! INTEGER(HID_T) , INTENT(IN) :: attr_id +!! INTEGER(HID_T) , INTENT(IN) :: memtype_id +!! TYPE , INTENT(IN) :: buf +!! INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims +!! INTEGER , INTENT(OUT) :: hdferr +!***** + + + SUBROUTINE h5awrite_integer_scalar(attr_id, memtype_id, buf, dims, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + INTEGER, INTENT(IN), TARGET :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf) + + hdferr = h5awrite_f_c(attr_id, memtype_id, f_ptr) + + END SUBROUTINE h5awrite_integer_scalar + + SUBROUTINE h5awrite_integer_1(attr_id, memtype_id, buf, dims, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + INTEGER, INTENT(IN) , & + DIMENSION(dims(1)), TARGET :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1)) + + hdferr = h5awrite_f_c(attr_id, memtype_id, f_ptr) + END SUBROUTINE h5awrite_integer_1 + + + SUBROUTINE h5awrite_integer_2(attr_id, memtype_id, buf, dims, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + INTEGER, INTENT(IN) , & + DIMENSION(dims(1),dims(2)), TARGET :: buf + ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1,1)) + + hdferr = h5awrite_f_c(attr_id, memtype_id, f_ptr) + + END SUBROUTINE h5awrite_integer_2 + + SUBROUTINE h5awrite_integer_3(attr_id, memtype_id, buf, dims, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + INTEGER, INTENT(IN), DIMENSION(dims(1),dims(2),dims(3)), TARGET :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1,1,1)) + + hdferr = h5awrite_f_c(attr_id, memtype_id, f_ptr) + + END SUBROUTINE h5awrite_integer_3 + + + SUBROUTINE h5awrite_integer_4(attr_id, memtype_id, buf, dims, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims! Array to story buf dimension sizes + INTEGER, INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3),dims(4)), TARGET :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1,1,1,1)) + + hdferr = h5awrite_f_c(attr_id, memtype_id, f_ptr) + + END SUBROUTINE h5awrite_integer_4 + + + SUBROUTINE h5awrite_integer_5(attr_id, memtype_id, buf, dims, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + INTEGER, INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)), TARGET :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1,1,1,1,1)) + + hdferr = h5awrite_f_c(attr_id, memtype_id, f_ptr) + + END SUBROUTINE h5awrite_integer_5 + + + SUBROUTINE h5awrite_integer_6(attr_id, memtype_id, buf, dims, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + INTEGER, INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)), TARGET :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1,1,1,1,1,1)) + + hdferr = h5awrite_f_c(attr_id, memtype_id, f_ptr) + END SUBROUTINE h5awrite_integer_6 + + + SUBROUTINE h5awrite_integer_7(attr_id, memtype_id, buf, dims, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + INTEGER, INTENT(IN), DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)), & + TARGET :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1,1,1,1,1,1,1)) + + hdferr = h5awrite_f_c(attr_id, memtype_id, f_ptr) + + END SUBROUTINE h5awrite_integer_7 + + + SUBROUTINE h5awrite_real_scalar(attr_id, memtype_id, buf, dims, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + REAL, INTENT(IN), TARGET :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf) + + hdferr = h5awrite_f_c(attr_id, memtype_id, f_ptr) + END SUBROUTINE h5awrite_real_scalar + + SUBROUTINE h5awrite_real_1(attr_id, memtype_id, buf, dims, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + REAL, INTENT(IN), & + DIMENSION(dims(1)), TARGET :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1)) + + hdferr = h5awrite_f_c(attr_id, memtype_id, f_ptr) + + END SUBROUTINE h5awrite_real_1 + + + SUBROUTINE h5awrite_real_2(attr_id, memtype_id, buf, dims, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + REAL, INTENT(IN), & + DIMENSION(dims(1),dims(2)), TARGET :: buf + ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1,1)) + + hdferr = h5awrite_f_c(attr_id, memtype_id, f_ptr) + + END SUBROUTINE h5awrite_real_2 + + + SUBROUTINE h5awrite_real_3(attr_id, memtype_id, buf, dims, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + REAL, INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3)), TARGET :: buf + ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1,1,1)) + + hdferr = h5awrite_f_c(attr_id, memtype_id, f_ptr) + END SUBROUTINE h5awrite_real_3 + + + SUBROUTINE h5awrite_real_4(attr_id, memtype_id, buf, dims, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + REAL, INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3),dims(4)), TARGET :: buf + ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1,1,1,1)) + + hdferr = h5awrite_f_c(attr_id, memtype_id, f_ptr) + END SUBROUTINE h5awrite_real_4 + + + SUBROUTINE h5awrite_real_5(attr_id, memtype_id, buf, dims, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + REAL, INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)), TARGET :: buf + ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf) + + hdferr = h5awrite_f_c(attr_id, memtype_id, f_ptr) + END SUBROUTINE h5awrite_real_5 + + + SUBROUTINE h5awrite_real_6(attr_id, memtype_id, buf, dims, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + REAL, INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)), TARGET :: buf + ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1,1,1,1,1,1)) + + hdferr = h5awrite_f_c(attr_id, memtype_id, f_ptr) + END SUBROUTINE h5awrite_real_6 + + + SUBROUTINE h5awrite_real_7(attr_id, memtype_id, buf, dims, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + REAL, INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)), TARGET :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1,1,1,1,1,1,1)) + + hdferr = h5awrite_f_c(attr_id, memtype_id, f_ptr) + END SUBROUTINE h5awrite_real_7 + + SUBROUTINE h5awrite_char_scalar(attr_id, memtype_id, buf, dims, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + CHARACTER(LEN=*), INTENT(IN) :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + + CALL h5awrite_char_scalar_fix(attr_id, memtype_id, buf, LEN(buf), dims, hdferr) + + END SUBROUTINE h5awrite_char_scalar + + SUBROUTINE h5awrite_char_scalar_fix(attr_id, memtype_id, buf, buf_len, dims, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + INTEGER, INTENT(IN) :: buf_len + CHARACTER(LEN=buf_len), INTENT(IN), TARGET :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1:1)) + + hdferr = h5awrite_f_c(attr_id, memtype_id, f_ptr) + + END SUBROUTINE h5awrite_char_scalar_fix + + SUBROUTINE h5awrite_char_1(attr_id, memtype_id, buf, dims, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + CHARACTER(LEN=*), INTENT(IN), DIMENSION(dims(1)), TARGET :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1)(1:1)) + + hdferr = h5awrite_f_c(attr_id, memtype_id, f_ptr) + + END SUBROUTINE h5awrite_char_1 + + SUBROUTINE h5awrite_char_2(attr_id, memtype_id, buf, dims, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + CHARACTER(LEN=*), INTENT(IN), & + DIMENSION(dims(1),dims(2)), TARGET :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1,1)(1:1)) + hdferr = h5awrite_f_c(attr_id, memtype_id, f_ptr) + + END SUBROUTINE h5awrite_char_2 + + SUBROUTINE h5awrite_char_3(attr_id, memtype_id, buf, dims, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + CHARACTER(LEN=*), INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3)), TARGET :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1,1,1)(1:1)) + + hdferr = h5awrite_f_c(attr_id, memtype_id, f_ptr) + + END SUBROUTINE h5awrite_char_3 + + SUBROUTINE h5awrite_char_4(attr_id, memtype_id, buf, dims, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + CHARACTER(LEN=*), INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3),dims(4)), TARGET :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1,1,1,1)(1:1)) + + hdferr = h5awrite_f_c(attr_id, memtype_id, f_ptr) + + END SUBROUTINE h5awrite_char_4 + + SUBROUTINE h5awrite_char_5(attr_id, memtype_id, buf, dims, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + CHARACTER(LEN=*), INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)), TARGET :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1,1,1,1,1)(1:1)) + + hdferr = h5awrite_f_c(attr_id, memtype_id, f_ptr) + + END SUBROUTINE h5awrite_char_5 + + + SUBROUTINE h5awrite_char_6(attr_id, memtype_id, buf, dims, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + CHARACTER(LEN=*), INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)), TARGET :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1,1,1,1,1,1)(1:1)) + + hdferr = h5awrite_f_c(attr_id, memtype_id, f_ptr) + + END SUBROUTINE h5awrite_char_6 + + SUBROUTINE h5awrite_char_7(attr_id, memtype_id, buf, dims, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + CHARACTER(LEN=*), INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)), TARGET :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1,1,1,1,1,1,1)(1:1)) + hdferr = h5awrite_f_c(attr_id, memtype_id, f_ptr) + + END SUBROUTINE h5awrite_char_7 + +!****s* H5A (F03)/h5awrite_f_F03 +! +! NAME +! h5awrite_f_F03 +! +! PURPOSE +! Writes an attribute. +! +! Inputs: +! attr_id - Attribute identifier +! memtype_id - Attribute datatype identifier (in memory) +! buf - Data buffer; may be a scalar or an array +! +! Outputs: +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces are added for +! called C functions (it is needed for Windows +! port). February 27, 2001 +! +! NOTES +! This function is overloaded to write INTEGER, +! REAL, DOUBLE PRECISION and CHARACTER buffers +! up to 7 dimensions. +! +! Fortran2003 Interface: +!! SUBROUTINE h5awrite_f(attr_id, memtype_id, buf, hdferr) +!! INTEGER(HID_T) , INTENT(IN) :: attr_id +!! INTEGER(HID_T) , INTENT(IN) :: memtype_id +!! TYPE(C_PTR) , INTENT(IN) :: buf +!! INTEGER , INTENT(OUT) :: hdferr +!***** + + SUBROUTINE h5awrite_ptr(attr_id, mem_type_id, buf, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + TYPE(C_PTR), INTENT(IN), TARGET :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + + hdferr = h5awrite_f_c(attr_id, mem_type_id, buf) + + END SUBROUTINE h5awrite_ptr + +!****s* H5A (F03)/h5aread_f_F90 +! +! NAME +! h5aread_f_F90 +! +! PURPOSE +! Reads an attribute. +! +! Inputs: +! attr_id - Attribute identifier +! memtype_id - Attribute datatype identifier (in memory) +! dims - Array to hold corresponding dimension sizes of data buffer buf; +! dim(k) has value of the k-th dimension of buffer buf; +! values are ignored if buf is a scalar +! +! Outputs: +! buf - Data buffer; may be a scalar or an array +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces are added for +! called C functions (it is needed for Windows +! port). February 27, 2001 +! +! dims parameter was added to make code portable; +! Aprile 4, 2001 +! +! Changed buf intent to INOUT to be consistant +! with how the C functions handles it. The pg +! compiler will return 0 if a buf value is not set. +! February, 2008 +! +! NOTES +! This function is overloaded to write INTEGER, +! REAL, DOUBLE PRECISION and CHARACTER buffers +! up to 7 dimensions. +! Fortran90 Interface: +!! SUBROUTINE h5aread_f(attr_id, memtype_id, buf, dims, hdferr) +!! INTEGER(HID_T) , INTENT(IN) :: attr_id +!! INTEGER(HID_T) , INTENT(IN) :: memtype_id +!! TYPE , INTENT(INOUT) :: buf +!! INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims +!! INTEGER , INTENT(OUT) :: hdferr +!***** + SUBROUTINE h5aread_integer_scalar(attr_id, memtype_id, buf, dims, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + INTEGER, INTENT(INOUT), TARGET :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf) + + hdferr = h5aread_f_c(attr_id, memtype_id, f_ptr) + END SUBROUTINE h5aread_integer_scalar + + SUBROUTINE h5aread_integer_1(attr_id, memtype_id, buf, dims, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + INTEGER, INTENT(INOUT), DIMENSION(dims(1)), TARGET :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1)) + + hdferr = h5aread_f_c(attr_id, memtype_id, f_ptr) + END SUBROUTINE h5aread_integer_1 + + + SUBROUTINE h5aread_integer_2(attr_id, memtype_id, buf, dims, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + INTEGER, INTENT(INOUT),DIMENSION(dims(1),dims(2)), TARGET :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1,1)) + + hdferr = h5aread_f_c(attr_id, memtype_id, f_ptr) + END SUBROUTINE h5aread_integer_2 + + + SUBROUTINE h5aread_integer_3(attr_id, memtype_id, buf, dims, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + INTEGER, INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3)), TARGET :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1,1,1)) + + hdferr = h5aread_f_c(attr_id, memtype_id, f_ptr) + END SUBROUTINE h5aread_integer_3 + + + SUBROUTINE h5aread_integer_4(attr_id, memtype_id, buf, dims, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + INTEGER, INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3),dims(4)), TARGET :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1,1,1,1)) + + hdferr = h5aread_f_c(attr_id, memtype_id, f_ptr) + END SUBROUTINE h5aread_integer_4 + + + SUBROUTINE h5aread_integer_5(attr_id, memtype_id, buf, dims, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + INTEGER, INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)), TARGET :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1,1,1,1,1)) + + hdferr = h5aread_f_c(attr_id, memtype_id, f_ptr) + END SUBROUTINE h5aread_integer_5 + + + SUBROUTINE h5aread_integer_6(attr_id, memtype_id, buf, dims, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + INTEGER, INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)), TARGET :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1,1,1,1,1,1)) + + hdferr = h5aread_f_c(attr_id, memtype_id, f_ptr) + END SUBROUTINE h5aread_integer_6 + + + SUBROUTINE h5aread_integer_7(attr_id, memtype_id, buf, dims, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + INTEGER, INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)), TARGET :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1,1,1,1,1,1,1)) + + hdferr = h5aread_f_c(attr_id, memtype_id, f_ptr) + END SUBROUTINE h5aread_integer_7 + + + SUBROUTINE h5aread_real_scalar(attr_id, memtype_id, buf, dims, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + REAL, INTENT(INOUT), TARGET :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf) + + hdferr = h5aread_f_c(attr_id, memtype_id, f_ptr) + END SUBROUTINE h5aread_real_scalar + + SUBROUTINE h5aread_real_1(attr_id, memtype_id, buf, dims, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + REAL, INTENT(INOUT), & + DIMENSION(dims(1)), TARGET :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1)) + + hdferr = h5aread_f_c(attr_id, memtype_id, f_ptr) + END SUBROUTINE h5aread_real_1 + + + SUBROUTINE h5aread_real_2(attr_id, memtype_id, buf, dims, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + REAL, INTENT(INOUT), & + DIMENSION(dims(1),dims(2)), TARGET :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1,1)) + + hdferr = h5aread_f_c(attr_id, memtype_id, f_ptr) + END SUBROUTINE h5aread_real_2 + + + SUBROUTINE h5aread_real_3(attr_id, memtype_id, buf, dims, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + REAL, INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3)), TARGET :: buf + ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1,1,1)) + + hdferr = h5aread_f_c(attr_id, memtype_id, f_ptr) + END SUBROUTINE h5aread_real_3 + + + SUBROUTINE h5aread_real_4(attr_id, memtype_id, buf, dims, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + REAL, INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3),dims(4)), TARGET :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1,1,1,1)) + + hdferr = h5aread_f_c(attr_id, memtype_id, f_ptr) + END SUBROUTINE h5aread_real_4 + + + SUBROUTINE h5aread_real_5(attr_id, memtype_id, buf, dims, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + REAL, INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)), TARGET :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1,1,1,1,1)) + + hdferr = h5aread_f_c(attr_id, memtype_id, f_ptr) + END SUBROUTINE h5aread_real_5 + + + SUBROUTINE h5aread_real_6(attr_id, memtype_id, buf, dims, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + REAL, INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)), TARGET :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1,1,1,1,1,1)) + + hdferr = h5aread_f_c(attr_id, memtype_id, f_ptr) + END SUBROUTINE h5aread_real_6 + + + SUBROUTINE h5aread_real_7(attr_id, memtype_id, buf, dims, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + REAL, INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)), TARGET :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1,1,1,1,1,1,1)) + + hdferr = h5aread_f_c(attr_id, memtype_id, f_ptr) + END SUBROUTINE h5aread_real_7 + + SUBROUTINE h5aread_char_scalar(attr_id, memtype_id, buf, dims, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + CHARACTER(LEN=*), INTENT(INOUT) :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + + CALL h5aread_char_scalar_fix(attr_id, memtype_id, buf, LEN(buf), dims, hdferr) + + END SUBROUTINE h5aread_char_scalar + + SUBROUTINE h5aread_char_scalar_fix(attr_id, memtype_id, buf, buf_len, dims, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + INTEGER, INTENT(IN) :: buf_len + CHARACTER(LEN=buf_len), INTENT(INOUT), TARGET :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1:1)) + + hdferr = h5aread_f_c(attr_id, memtype_id, f_ptr) + + END SUBROUTINE h5aread_char_scalar_fix + + SUBROUTINE h5aread_char_1(attr_id, memtype_id, buf, dims, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + CHARACTER(LEN=*), INTENT(INOUT), & + DIMENSION(dims(1)), TARGET :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1)(1:1)) + hdferr = h5aread_f_c(attr_id, memtype_id, f_ptr) + + END SUBROUTINE h5aread_char_1 + + + SUBROUTINE h5aread_char_2(attr_id, memtype_id, buf, dims, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + CHARACTER(LEN=*), INTENT(INOUT), & + DIMENSION(dims(1),dims(2)), TARGET :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1,1)(1:1)) + hdferr = h5aread_f_c(attr_id, memtype_id, f_ptr) + + END SUBROUTINE h5aread_char_2 + + + SUBROUTINE h5aread_char_3(attr_id, memtype_id, buf, dims, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + CHARACTER(LEN=*), INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3)), TARGET :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1,1,1)(1:1)) + hdferr = h5aread_f_c(attr_id, memtype_id, f_ptr) + + END SUBROUTINE h5aread_char_3 + + SUBROUTINE h5aread_char_4(attr_id, memtype_id, buf, dims, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + CHARACTER(LEN=*), INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3),dims(4)), TARGET :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1,1,1,1)(1:1)) + + hdferr = h5aread_f_c(attr_id, memtype_id, f_ptr) + + END SUBROUTINE h5aread_char_4 + + SUBROUTINE h5aread_char_5(attr_id, memtype_id, buf, dims, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + CHARACTER(LEN=*), INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)), TARGET :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1,1,1,1,1)(1:1)) + hdferr = h5aread_f_c(attr_id, memtype_id, f_ptr) + + END SUBROUTINE h5aread_char_5 + + + SUBROUTINE h5aread_char_6(attr_id, memtype_id, buf, dims, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + CHARACTER(LEN=*), INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)), TARGET :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1,1,1,1,1,1)(1:1)) + hdferr = h5aread_f_c(attr_id, memtype_id, f_ptr) + + END SUBROUTINE h5aread_char_6 + + + SUBROUTINE h5aread_char_7(attr_id, memtype_id, buf, dims, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + CHARACTER(LEN=*), INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)), TARGET :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(buf(1,1,1,1,1,1,1)(1:1)) + hdferr = h5aread_f_c(attr_id, memtype_id, f_ptr) + + END SUBROUTINE h5aread_char_7 + + +!****s* H5A (F03)/h5aread_f_F03 +! +! NAME +! h5aread_f_F03 +! +! PURPOSE +! Reads an attribute. +! +! Inputs: +! attr_id - Attribute identifier +! memtype_id - Attribute datatype identifier (in memory) +! +! Outputs: +! buf - Data buffer; may be a scalar or an array +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces are added for +! called C functions (it is needed for Windows +! port). February 27, 2001 +! +! dims parameter was added to make code portable; +! Aprile 4, 2001 +! +! Changed buf intent to INOUT to be consistant +! with how the C functions handles it. The pg +! compiler will return 0 if a buf value is not set. +! February, 2008 +! +! NOTES +! This function is overloaded to write INTEGER, +! REAL, DOUBLE PRECISION and CHARACTER buffers +! up to 7 dimensions. +! Fortran2003 Interface: +!! SUBROUTINE h5aread_f(attr_id, memtype_id, buf, hdferr) +!! INTEGER(HID_T) , INTENT(IN) :: attr_id +!! INTEGER(HID_T) , INTENT(IN) :: memtype_id +!! TYPE(C_PTR) , INTENT(INOUT) :: buf +!! INTEGER , INTENT(OUT) :: hdferr +!***** + + SUBROUTINE h5aread_ptr(attr_id, mem_type_id, buf, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + TYPE(C_PTR), INTENT(INOUT), TARGET :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + + hdferr = h5aread_f_c(attr_id, mem_type_id, buf) + + END SUBROUTINE h5aread_ptr + +END MODULE H5A_PROVISIONAL + + diff --git a/fortran/src/H5Aff_F90.f90 b/fortran/src/H5Aff_F90.f90 new file mode 100644 index 0000000..7e14f7a --- /dev/null +++ b/fortran/src/H5Aff_F90.f90 @@ -0,0 +1,1618 @@ +!****h* ROBODoc/H5A (F90) +! +! NAME +! H5A_PROVISIONAL +! +! FILE +! fortran/src/H5Aff_F90.f90 +! +! PURPOSE +! +! This file contains Fortran 90 interfaces for H5A functions. It contains +! the same functions as H5Aff_F03.f90 but excludes the Fortran 2003 functions +! and the interface listings. This file will be compiled instead of H5Aff_F03.f90 +! if Fortran 2003 functions are not enabled. +! +! +! COPYRIGHT +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +! NOTES +! *** IMPORTANT *** +! If you add a new H5A function you must add the function name to the +! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! This is needed for Windows based operating systems. +! +!***** + +MODULE H5A_PROVISIONAL + + USE H5GLOBAL + ! + !On Windows there are no big (integer*8) integers, so overloading + !for bug #670 does not work. I have to use DEC compilation directives to make + !Windows DEC Visual Fortran and OSF compilers happy and do right things. + ! 05/01/02 EP + ! + INTERFACE h5awrite_f + + MODULE PROCEDURE h5awrite_integer_scalar + MODULE PROCEDURE h5awrite_integer_1 + MODULE PROCEDURE h5awrite_integer_2 + MODULE PROCEDURE h5awrite_integer_3 + MODULE PROCEDURE h5awrite_integer_4 + MODULE PROCEDURE h5awrite_integer_5 + MODULE PROCEDURE h5awrite_integer_6 + MODULE PROCEDURE h5awrite_integer_7 + MODULE PROCEDURE h5awrite_char_scalar + MODULE PROCEDURE h5awrite_char_1 + MODULE PROCEDURE h5awrite_char_2 + MODULE PROCEDURE h5awrite_char_3 + MODULE PROCEDURE h5awrite_char_4 + MODULE PROCEDURE h5awrite_char_5 + MODULE PROCEDURE h5awrite_char_6 + MODULE PROCEDURE h5awrite_char_7 + MODULE PROCEDURE h5awrite_real_scalar + MODULE PROCEDURE h5awrite_real_1 + MODULE PROCEDURE h5awrite_real_2 + MODULE PROCEDURE h5awrite_real_3 + MODULE PROCEDURE h5awrite_real_4 + MODULE PROCEDURE h5awrite_real_5 + MODULE PROCEDURE h5awrite_real_6 + MODULE PROCEDURE h5awrite_real_7 + + END INTERFACE + + INTERFACE h5aread_f + + MODULE PROCEDURE h5aread_integer_scalar + MODULE PROCEDURE h5aread_integer_1 + MODULE PROCEDURE h5aread_integer_2 + MODULE PROCEDURE h5aread_integer_3 + MODULE PROCEDURE h5aread_integer_4 + MODULE PROCEDURE h5aread_integer_5 + MODULE PROCEDURE h5aread_integer_6 + MODULE PROCEDURE h5aread_integer_7 + MODULE PROCEDURE h5aread_char_scalar + MODULE PROCEDURE h5aread_char_1 + MODULE PROCEDURE h5aread_char_2 + MODULE PROCEDURE h5aread_char_3 + MODULE PROCEDURE h5aread_char_4 + MODULE PROCEDURE h5aread_char_5 + MODULE PROCEDURE h5aread_char_6 + MODULE PROCEDURE h5aread_char_7 + MODULE PROCEDURE h5aread_real_scalar + MODULE PROCEDURE h5aread_real_1 + MODULE PROCEDURE h5aread_real_2 + MODULE PROCEDURE h5aread_real_3 + MODULE PROCEDURE h5aread_real_4 + MODULE PROCEDURE h5aread_real_5 + MODULE PROCEDURE h5aread_real_6 + MODULE PROCEDURE h5aread_real_7 + END INTERFACE + +CONTAINS + + SUBROUTINE h5awrite_integer_scalar(attr_id, memtype_id, buf, dims, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + INTEGER, INTENT(IN) :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + + 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 + 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 + INTEGER, INTENT(IN)::buf + END FUNCTION h5awrite_integer_s_c + END INTERFACE + + hdferr = h5awrite_integer_s_c(attr_id, memtype_id, buf, dims) + END SUBROUTINE h5awrite_integer_scalar + + SUBROUTINE h5awrite_integer_1(attr_id, memtype_id, buf, dims, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + INTEGER, INTENT(IN) , & + DIMENSION(dims(1)) :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! INTEGER, EXTERNAL :: h5awrite_integer_1_c + ! MS FORTRAN needs explicit interface for C functions called here. + ! + 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 + 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 + INTEGER, INTENT(IN), DIMENSION(dims(1)) :: buf + END FUNCTION h5awrite_integer_1_c + END INTERFACE + + hdferr = h5awrite_integer_1_c(attr_id, memtype_id, buf, dims) + + END SUBROUTINE h5awrite_integer_1 + + + SUBROUTINE h5awrite_integer_2(attr_id, memtype_id, buf, dims, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + INTEGER, INTENT(IN) , & + DIMENSION(dims(1),dims(2)) :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + + ! INTEGER, EXTERNAL :: h5awrite_integer_2_c + ! MS FORTRAN needs explicit interface for C functions called here. + ! + 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 + 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 + INTEGER, INTENT(IN), DIMENSION(dims(1),dims(2)) :: buf + END FUNCTION h5awrite_integer_2_c + END INTERFACE + + hdferr = h5awrite_integer_2_c(attr_id, memtype_id, buf, dims) + END SUBROUTINE h5awrite_integer_2 + + + SUBROUTINE h5awrite_integer_3(attr_id, memtype_id, buf, dims, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + INTEGER, INTENT(IN), DIMENSION(dims(1),dims(2),dims(3)) :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + + ! INTEGER, EXTERNAL :: h5awrite_integer_3_c + ! MS FORTRAN needs explicit interface for C functions called here. + ! + 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 + 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 + INTEGER, INTENT(IN), DIMENSION(dims(1),dims(2),dims(3)) :: buf + END FUNCTION h5awrite_integer_3_c + END INTERFACE + + hdferr = h5awrite_integer_3_c(attr_id, memtype_id, buf, dims) + END SUBROUTINE h5awrite_integer_3 + + + SUBROUTINE h5awrite_integer_4(attr_id, memtype_id, buf, dims, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + INTEGER, INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + + ! INTEGER, EXTERNAL :: h5awrite_integer_4_c + ! MS FORTRAN needs explicit interface for C functions called here. + ! + 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 + 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 + INTEGER, INTENT(IN), DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf + END FUNCTION h5awrite_integer_4_c + END INTERFACE + + hdferr = h5awrite_integer_4_c(attr_id, memtype_id, buf, dims) + END SUBROUTINE h5awrite_integer_4 + + + SUBROUTINE h5awrite_integer_5(attr_id, memtype_id, buf, dims, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + INTEGER, INTENT(IN), DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + + ! INTEGER, EXTERNAL :: h5awrite_integer_5_c + ! MS FORTRAN needs explicit interface for C functions called here. + ! + 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 + 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 + INTEGER, INTENT(IN), DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf + END FUNCTION h5awrite_integer_5_c + END INTERFACE + + hdferr = h5awrite_integer_5_c(attr_id, memtype_id, buf, dims) + END SUBROUTINE h5awrite_integer_5 + + + SUBROUTINE h5awrite_integer_6(attr_id, memtype_id, buf, dims, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + INTEGER, INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + + ! INTEGER, EXTERNAL :: h5awrite_integer_6_c + ! MS FORTRAN needs explicit interface for C functions called here. + ! + 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 + 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 + INTEGER, INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf + END FUNCTION h5awrite_integer_6_c + END INTERFACE + + hdferr = h5awrite_integer_6_c(attr_id, memtype_id, buf, dims) + END SUBROUTINE h5awrite_integer_6 + + + SUBROUTINE h5awrite_integer_7(attr_id, memtype_id, buf, dims, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + INTEGER, INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + + ! INTEGER, EXTERNAL :: h5awrite_integer_7_c + ! MS FORTRAN needs explicit interface for C functions called here. + ! + 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 + 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 + INTEGER, INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf + END FUNCTION h5awrite_integer_7_c + END INTERFACE + + hdferr = h5awrite_integer_7_c(attr_id, memtype_id, buf, dims) + END SUBROUTINE h5awrite_integer_7 + + + SUBROUTINE h5awrite_real_scalar(attr_id, memtype_id, buf, dims, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + REAL, INTENT(IN) :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + + ! INTEGER, EXTERNAL :: h5awrite_real_s_c + ! MS FORTRAN needs explicit interface for C functions called here. + ! + 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 + 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 + REAL, INTENT(IN)::buf + END FUNCTION h5awrite_real_s_c + END INTERFACE + + hdferr = h5awrite_real_s_c(attr_id, memtype_id, buf, dims) + END SUBROUTINE h5awrite_real_scalar + + SUBROUTINE h5awrite_real_1(attr_id, memtype_id, buf, dims, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + REAL, INTENT(IN), & + DIMENSION(dims(1)) :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + + ! INTEGER, EXTERNAL :: h5awrite_real_1_c + ! MS FORTRAN needs explicit interface for C functions called here. + ! + 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 + 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 + REAL, INTENT(IN), & + DIMENSION(dims(1)) :: buf + END FUNCTION h5awrite_real_1_c + END INTERFACE + + hdferr = h5awrite_real_1_c(attr_id, memtype_id, buf, dims) + END SUBROUTINE h5awrite_real_1 + + + SUBROUTINE h5awrite_real_2(attr_id, memtype_id, buf, dims, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + REAL, INTENT(IN), & + DIMENSION(dims(1),dims(2)) :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + + ! INTEGER, EXTERNAL :: h5awrite_real_2_c + ! MS FORTRAN needs explicit interface for C functions called here. + ! + 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 + 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 + REAL, INTENT(IN), & + DIMENSION(dims(1),dims(2)) :: buf + END FUNCTION h5awrite_real_2_c + END INTERFACE + + hdferr = h5awrite_real_2_c(attr_id, memtype_id, buf, dims) + END SUBROUTINE h5awrite_real_2 + + + SUBROUTINE h5awrite_real_3(attr_id, memtype_id, buf, dims, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + REAL, INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3)) :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + + ! INTEGER, EXTERNAL :: h5awrite_real_3_c + ! MS FORTRAN needs explicit interface for C functions called here. + ! + 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 + 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 + REAL, INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3)) :: buf + END FUNCTION h5awrite_real_3_c + END INTERFACE + + hdferr = h5awrite_real_3_c(attr_id, memtype_id, buf, dims) + END SUBROUTINE h5awrite_real_3 + + + SUBROUTINE h5awrite_real_4(attr_id, memtype_id, buf, dims, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + REAL, INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + + ! INTEGER, EXTERNAL :: h5awrite_real_4_c + ! MS FORTRAN needs explicit interface for C functions called here. + ! + 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 + 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 + REAL, INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf + END FUNCTION h5awrite_real_4_c + END INTERFACE + + hdferr = h5awrite_real_4_c(attr_id, memtype_id, buf, dims) + END SUBROUTINE h5awrite_real_4 + + + SUBROUTINE h5awrite_real_5(attr_id, memtype_id, buf, dims, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + REAL, INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + + ! INTEGER, EXTERNAL :: h5awrite_real_5_c + ! MS FORTRAN needs explicit interface for C functions called here. + ! + 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 + 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 + REAL, INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf + END FUNCTION h5awrite_real_5_c + END INTERFACE + + hdferr = h5awrite_real_5_c(attr_id, memtype_id, buf, dims) + END SUBROUTINE h5awrite_real_5 + + + SUBROUTINE h5awrite_real_6(attr_id, memtype_id, buf, dims, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + REAL, INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + + ! INTEGER, EXTERNAL :: h5awrite_real_6_c + ! MS FORTRAN needs explicit interface for C functions called here. + ! + 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 + 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 + REAL, INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf + END FUNCTION h5awrite_real_6_c + END INTERFACE + + hdferr = h5awrite_real_6_c(attr_id, memtype_id, buf, dims) + END SUBROUTINE h5awrite_real_6 + + + SUBROUTINE h5awrite_real_7(attr_id, memtype_id, buf, dims, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + REAL, INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + + ! INTEGER, EXTERNAL :: h5awrite_real_7_c + ! MS FORTRAN needs explicit interface for C functions called here. + ! + 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 + 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 + REAL, INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf + END FUNCTION h5awrite_real_7_c + END INTERFACE + + hdferr = h5awrite_real_7_c(attr_id, memtype_id, buf, dims) + END SUBROUTINE h5awrite_real_7 + + SUBROUTINE h5awrite_char_scalar(attr_id, memtype_id, buf, dims, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + CHARACTER(LEN=*),INTENT(IN) :: buf + ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! INTEGER, EXTERNAL :: h5awritec_s_c + ! MS FORTRAN needs explicit interface for C functions called here. + ! + 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 + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + !DEC$ATTRIBUTES reference :: buf + INTEGER(HID_T), INTENT(IN) :: attr_id + INTEGER(HID_T), INTENT(IN) :: memtype_id + CHARACTER(LEN=*), INTENT(IN)::buf + END FUNCTION h5awritec_s_c + END INTERFACE + + hdferr = h5awritec_s_c(attr_id, memtype_id, buf, dims) + END SUBROUTINE h5awrite_char_scalar + + SUBROUTINE h5awrite_char_1(attr_id, memtype_id, buf, dims, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + CHARACTER(LEN=*), INTENT(IN), & + DIMENSION(dims(1)) :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! INTEGER, EXTERNAL :: h5awritec_1_c + ! MS FORTRAN needs explicit interface for C functions called here. + ! + 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$ATTRIBUTES reference :: buf + 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 + CHARACTER(LEN=*), INTENT(IN), DIMENSION(dims(1))::buf + END FUNCTION h5awritec_1_c + END INTERFACE + + hdferr = h5awritec_1_c(attr_id, memtype_id, buf, dims) + END SUBROUTINE h5awrite_char_1 + + + SUBROUTINE h5awrite_char_2(attr_id, memtype_id, buf, dims, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + CHARACTER(LEN=*), INTENT(IN), & + DIMENSION(dims(1),dims(2)) :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + + ! INTEGER, EXTERNAL :: h5awritec_2_c + ! MS FORTRAN needs explicit interface for C functions called here. + ! + 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 + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + !DEC$ATTRIBUTES reference :: buf + INTEGER(HID_T), INTENT(IN) :: attr_id + INTEGER(HID_T), INTENT(IN) :: memtype_id + CHARACTER(LEN=*), INTENT(IN), & + DIMENSION(dims(1),dims(2)) :: buf + END FUNCTION h5awritec_2_c + END INTERFACE + + hdferr = h5awritec_2_c(attr_id, memtype_id, buf, dims) + END SUBROUTINE h5awrite_char_2 + + + SUBROUTINE h5awrite_char_3(attr_id, memtype_id, buf, dims, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + CHARACTER(LEN=*), INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3)) :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! INTEGER, EXTERNAL :: h5awritec_3_c + ! MS FORTRAN needs explicit interface for C functions called here. + ! + 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$ATTRIBUTES reference :: buf + 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 + CHARACTER(LEN=*), INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3)) :: buf + END FUNCTION h5awritec_3_c + END INTERFACE + + hdferr = h5awritec_3_c(attr_id, memtype_id, buf, dims) + END SUBROUTINE h5awrite_char_3 + + + SUBROUTINE h5awrite_char_4(attr_id, memtype_id, buf, dims, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + CHARACTER(LEN=*), INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! INTEGER, EXTERNAL :: h5awritec_4_c + ! MS FORTRAN needs explicit interface for C functions called here. + ! + 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$ATTRIBUTES reference :: buf + 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 + CHARACTER(LEN=*), INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf + END FUNCTION h5awritec_4_c + END INTERFACE + + hdferr = h5awritec_4_c(attr_id, memtype_id, buf, dims) + END SUBROUTINE h5awrite_char_4 + + + SUBROUTINE h5awrite_char_5(attr_id, memtype_id, buf, dims, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + CHARACTER(LEN=*), INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! INTEGER, EXTERNAL :: h5awritec_5_c + ! MS FORTRAN needs explicit interface for C functions called here. + ! + 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$ATTRIBUTES reference :: buf + 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 + CHARACTER(LEN=*), INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf + END FUNCTION h5awritec_5_c + END INTERFACE + + hdferr = h5awritec_5_c(attr_id, memtype_id, buf, dims) + END SUBROUTINE h5awrite_char_5 + + + SUBROUTINE h5awrite_char_6(attr_id, memtype_id, buf, dims, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + CHARACTER(LEN=*), INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! INTEGER, EXTERNAL :: h5awritec_6_c + ! MS FORTRAN needs explicit interface for C functions called here. + ! + 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$ATTRIBUTES reference :: buf + 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 + CHARACTER(LEN=*), INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf + END FUNCTION h5awritec_6_c + END INTERFACE + + hdferr = h5awritec_6_c(attr_id, memtype_id, buf, dims) + END SUBROUTINE h5awrite_char_6 + + + SUBROUTINE h5awrite_char_7(attr_id, memtype_id, buf, dims, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + CHARACTER(LEN=*), INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! INTEGER, EXTERNAL :: h5awritec_7_c + ! MS FORTRAN needs explicit interface for C functions called here. + ! + 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$ATTRIBUTES reference :: buf + 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 + CHARACTER(LEN=*), INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf + END FUNCTION h5awritec_7_c + END INTERFACE + + hdferr = h5awritec_7_c(attr_id, memtype_id, buf, dims) + END SUBROUTINE h5awrite_char_7 + +! +! NAME +! h5aread_f +! +! PURPOSE +! Reads an attribute. +! +! INPUTS +! attr_id - attribute identifier +! memtype_id - attribute memory type identifier +! dims - 1D array of size 7, stores sizes of the +! - buf array dimensions. +! OUTPUTS +! buf - buffer to read attribute data in +! hdferr: - error code +! Success: 0 +! Failure: -1 +! OPTIONAL PARAMETERS +! NONE +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! +! Explicit Fortran interfaces are added for +! called C functions (it is needed for Windows +! port). February 27, 2001 +! +! dims parameter was added to make code portable; +! April 4, 2001 +! +! Changed buf intent to INOUT to be consistant +! with how the C functions handles it. The pg +! compiler will return 0 if a buf value is not set. +! February, 2008 +! +! NOTES +! This function is overloaded to write INTEGER, +! REAL, DOUBLE PRECISION and CHARACTER buffers +! up to 7 dimensions. +! + + SUBROUTINE h5aread_integer_scalar(attr_id, memtype_id, buf, dims, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + INTEGER, INTENT(INOUT) :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + + ! INTEGER, EXTERNAL :: h5aread_integer_s_c + ! MS FORTRAN needs explicit interface for C functions called here. + ! + 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 + 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 + INTEGER, INTENT(INOUT)::buf + END FUNCTION h5aread_integer_s_c + END INTERFACE + hdferr = h5aread_integer_s_c(attr_id, memtype_id, buf, dims) + END SUBROUTINE h5aread_integer_scalar + + SUBROUTINE h5aread_integer_1(attr_id, memtype_id, buf, dims, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + INTEGER, INTENT(INOUT), DIMENSION(dims(1)) :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + + ! INTEGER, EXTERNAL :: h5aread_integer_1_c + ! MS FORTRAN needs explicit interface for C functions called here. + ! + 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 + 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 + INTEGER, INTENT(INOUT), DIMENSION(dims(1)) :: buf + END FUNCTION h5aread_integer_1_c + END INTERFACE + + hdferr = h5aread_integer_1_c(attr_id, memtype_id, buf, dims) + END SUBROUTINE h5aread_integer_1 + + + SUBROUTINE h5aread_integer_2(attr_id, memtype_id, buf, dims, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + INTEGER, INTENT(INOUT),DIMENSION(dims(1),dims(2)) :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + + ! INTEGER, EXTERNAL :: h5aread_integer_2_c + ! MS FORTRAN needs explicit interface for C functions called here. + ! + 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 + 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 + INTEGER, INTENT(INOUT), DIMENSION(dims(1),dims(2)) :: buf + END FUNCTION h5aread_integer_2_c + END INTERFACE + + hdferr = h5aread_integer_2_c(attr_id, memtype_id, buf, dims) + END SUBROUTINE h5aread_integer_2 + + + SUBROUTINE h5aread_integer_3(attr_id, memtype_id, buf, dims, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + INTEGER, INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3)) :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + + ! INTEGER, EXTERNAL :: h5aread_integer_3_c + ! MS FORTRAN needs explicit interface for C functions called here. + ! + 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 + 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 + INTEGER, INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3)) :: buf + END FUNCTION h5aread_integer_3_c + END INTERFACE + + hdferr = h5aread_integer_3_c(attr_id, memtype_id, buf, dims) + END SUBROUTINE h5aread_integer_3 + + + SUBROUTINE h5aread_integer_4(attr_id, memtype_id, buf, dims, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + INTEGER, INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf ! Attribute data + ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + + ! INTEGER, EXTERNAL :: h5aread_integer_4_c + ! MS FORTRAN needs explicit interface for C functions called here. + ! + 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 + 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 + INTEGER, INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf + END FUNCTION h5aread_integer_4_c + END INTERFACE + + hdferr = h5aread_integer_4_c(attr_id, memtype_id, buf, dims) + END SUBROUTINE h5aread_integer_4 + + + SUBROUTINE h5aread_integer_5(attr_id, memtype_id, buf, dims, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + INTEGER, INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + + ! INTEGER, EXTERNAL :: h5aread_integer_5_c + ! MS FORTRAN needs explicit interface for C functions called here. + ! + 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 + 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 + INTEGER, INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf + END FUNCTION h5aread_integer_5_c + END INTERFACE + + hdferr = h5aread_integer_5_c(attr_id, memtype_id, buf, dims) + END SUBROUTINE h5aread_integer_5 + + + SUBROUTINE h5aread_integer_6(attr_id, memtype_id, buf, dims, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + INTEGER, INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + + ! INTEGER, EXTERNAL :: h5aread_integer_6_c + ! MS FORTRAN needs explicit interface for C functions called here. + ! + 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 + 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 + INTEGER, INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf + END FUNCTION h5aread_integer_6_c + END INTERFACE + + hdferr = h5aread_integer_6_c(attr_id, memtype_id, buf, dims) + END SUBROUTINE h5aread_integer_6 + + + SUBROUTINE h5aread_integer_7(attr_id, memtype_id, buf, dims, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + INTEGER, INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + + ! INTEGER, EXTERNAL :: h5aread_integer_7_c + ! MS FORTRAN needs explicit interface for C functions called here. + ! + 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 + 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 + INTEGER, INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf + END FUNCTION h5aread_integer_7_c + END INTERFACE + + hdferr = h5aread_integer_7_c(attr_id, memtype_id, buf, dims) + END SUBROUTINE h5aread_integer_7 + + + SUBROUTINE h5aread_real_scalar(attr_id, memtype_id, buf, dims, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + REAL, INTENT(INOUT) :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + + ! INTEGER, EXTERNAL :: h5aread_real_s_c + ! MS FORTRAN needs explicit interface for C functions called here. + ! + 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 + 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 + REAL, INTENT(INOUT)::buf + END FUNCTION h5aread_real_s_c + END INTERFACE + + hdferr = h5aread_real_s_c(attr_id, memtype_id, buf, dims) + END SUBROUTINE h5aread_real_scalar + + SUBROUTINE h5aread_real_1(attr_id, memtype_id, buf, dims, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + REAL, INTENT(INOUT), & + DIMENSION(dims(1)) :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + + ! INTEGER, EXTERNAL :: h5aread_real_1_c + ! MS FORTRAN needs explicit interface for C functions called here. + ! + 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 + 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 + REAL, INTENT(INOUT), & + DIMENSION(dims(1)) :: buf + END FUNCTION h5aread_real_1_c + END INTERFACE + + hdferr = h5aread_real_1_c(attr_id, memtype_id, buf, dims) + END SUBROUTINE h5aread_real_1 + + + SUBROUTINE h5aread_real_2(attr_id, memtype_id, buf, dims, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + REAL, INTENT(INOUT), & + DIMENSION(dims(1),dims(2)) :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + + ! INTEGER, EXTERNAL :: h5aread_real_2_c + ! MS FORTRAN needs explicit interface for C functions called here. + ! + 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 + 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 + REAL, INTENT(INOUT), & + DIMENSION(dims(1),dims(2)) :: buf + END FUNCTION h5aread_real_2_c + END INTERFACE + + hdferr = h5aread_real_2_c(attr_id, memtype_id, buf, dims) + END SUBROUTINE h5aread_real_2 + + + SUBROUTINE h5aread_real_3(attr_id, memtype_id, buf, dims, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + REAL, INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3)) :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + + ! INTEGER, EXTERNAL :: h5aread_real_3_c + ! MS FORTRAN needs explicit interface for C functions called here. + ! + 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 + 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 + REAL, INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3)) :: buf + END FUNCTION h5aread_real_3_c + END INTERFACE + + hdferr = h5aread_real_3_c(attr_id, memtype_id, buf, dims) + END SUBROUTINE h5aread_real_3 + + + SUBROUTINE h5aread_real_4(attr_id, memtype_id, buf, dims, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + REAL, INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + + ! INTEGER, EXTERNAL :: h5aread_real_4_c + ! MS FORTRAN needs explicit interface for C functions called here. + ! + 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 + 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 + REAL, INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf + END FUNCTION h5aread_real_4_c + END INTERFACE + + hdferr = h5aread_real_4_c(attr_id, memtype_id, buf, dims) + END SUBROUTINE h5aread_real_4 + + + SUBROUTINE h5aread_real_5(attr_id, memtype_id, buf, dims, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + REAL, INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + + ! INTEGER, EXTERNAL :: h5aread_real_5_c + ! MS FORTRAN needs explicit interface for C functions called here. + ! + 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 + 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 + REAL, INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf + END FUNCTION h5aread_real_5_c + END INTERFACE + + hdferr = h5aread_real_5_c(attr_id, memtype_id, buf, dims) + END SUBROUTINE h5aread_real_5 + + + SUBROUTINE h5aread_real_6(attr_id, memtype_id, buf, dims, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + REAL, INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + + ! INTEGER, EXTERNAL :: h5aread_real_6_c + ! MS FORTRAN needs explicit interface for C functions called here. + ! + 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 + 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 + REAL, INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf + END FUNCTION h5aread_real_6_c + END INTERFACE + + hdferr = h5aread_real_6_c(attr_id, memtype_id, buf, dims) + END SUBROUTINE h5aread_real_6 + + + SUBROUTINE h5aread_real_7(attr_id, memtype_id, buf, dims, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + REAL, INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + + ! INTEGER, EXTERNAL :: h5aread_real_7_c + ! MS FORTRAN needs explicit interface for C functions called here. + ! + 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 + 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 + REAL, INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf + END FUNCTION h5aread_real_7_c + END INTERFACE + + hdferr = h5aread_real_7_c(attr_id, memtype_id, buf, dims) + END SUBROUTINE h5aread_real_7 + + SUBROUTINE h5aread_char_scalar(attr_id, memtype_id, buf, dims, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + CHARACTER(LEN=*), INTENT(INOUT) :: buf + ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + + ! INTEGER, EXTERNAL :: h5areadc_s_c + ! MS FORTRAN needs explicit interface for C functions called here. + ! + 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$ATTRIBUTES reference :: buf + 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 + CHARACTER(LEN=*), INTENT(INOUT) :: buf + END FUNCTION h5areadc_s_c + END INTERFACE + + hdferr = h5areadc_s_c(attr_id, memtype_id, buf, dims) + END SUBROUTINE h5aread_char_scalar + + SUBROUTINE h5aread_char_1(attr_id, memtype_id, buf, dims, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + CHARACTER(LEN=*), INTENT(INOUT), & + DIMENSION(dims(1)) :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + + ! INTEGER, EXTERNAL :: h5areadc_1_c + ! MS FORTRAN needs explicit interface for C functions called here. + ! + 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$ATTRIBUTES reference :: buf + 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 + CHARACTER(LEN=*), INTENT(INOUT), & + DIMENSION(dims(1)) :: buf + END FUNCTION h5areadc_1_c + END INTERFACE + + hdferr = h5areadc_1_c(attr_id, memtype_id, buf, dims) + END SUBROUTINE h5aread_char_1 + + + SUBROUTINE h5aread_char_2(attr_id, memtype_id, buf, dims, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + CHARACTER(LEN=*), INTENT(INOUT), & + DIMENSION(dims(1),dims(2)) :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + + ! INTEGER, EXTERNAL :: h5areadc_2_c + ! MS FORTRAN needs explicit interface for C functions called here. + ! + 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$ATTRIBUTES reference :: buf + 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 + CHARACTER(LEN=*), INTENT(INOUT), & + DIMENSION(dims(1),dims(2)) :: buf + END FUNCTION h5areadc_2_c + END INTERFACE + + hdferr = h5areadc_2_c(attr_id, memtype_id, buf, dims) + END SUBROUTINE h5aread_char_2 + + + SUBROUTINE h5aread_char_3(attr_id, memtype_id, buf, dims, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + CHARACTER(LEN=*), INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3)) :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + + ! INTEGER, EXTERNAL :: h5areadc_3_c + ! MS FORTRAN needs explicit interface for C functions called here. + ! + 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$ATTRIBUTES reference :: buf + 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 + CHARACTER(LEN=*), INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3)) :: buf + END FUNCTION h5areadc_3_c + END INTERFACE + + hdferr = h5areadc_3_c(attr_id, memtype_id, buf, dims) + END SUBROUTINE h5aread_char_3 + + + SUBROUTINE h5aread_char_4(attr_id, memtype_id, buf, dims, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + CHARACTER(LEN=*), INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + + ! INTEGER, EXTERNAL :: h5areadc_4_c + ! MS FORTRAN needs explicit interface for C functions called here. + ! + 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$ATTRIBUTES reference :: buf + 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 + CHARACTER(LEN=*), INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf + END FUNCTION h5areadc_4_c + END INTERFACE + + hdferr = h5areadc_4_c(attr_id, memtype_id, buf, dims) + END SUBROUTINE h5aread_char_4 + + + SUBROUTINE h5aread_char_5(attr_id, memtype_id, buf, dims, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + CHARACTER(LEN=*), INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf + ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + + ! INTEGER, EXTERNAL :: h5areadc_5_c + ! MS FORTRAN needs explicit interface for C functions called here. + ! + 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$ATTRIBUTES reference :: buf + 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 + CHARACTER(LEN=*), INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf + END FUNCTION h5areadc_5_c + END INTERFACE + + hdferr = h5areadc_5_c(attr_id, memtype_id, buf, dims) + END SUBROUTINE h5aread_char_5 + + + SUBROUTINE h5aread_char_6(attr_id, memtype_id, buf, dims, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + CHARACTER(LEN=*), INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + + ! INTEGER, EXTERNAL :: h5areadc_6_c + ! MS FORTRAN needs explicit interface for C functions called here. + ! + 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$ATTRIBUTES reference :: buf + 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 + CHARACTER(LEN=*), INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf + END FUNCTION h5areadc_6_c + END INTERFACE + + hdferr = h5areadc_6_c(attr_id, memtype_id, buf, dims) + END SUBROUTINE h5aread_char_6 + + + SUBROUTINE h5aread_char_7(attr_id, memtype_id, buf, dims, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier + INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype + ! identifier (in memory) + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes + CHARACTER(LEN=*), INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf ! Attribute data + INTEGER, INTENT(OUT) :: hdferr ! Error code + + ! INTEGER, EXTERNAL :: h5areadc_7_c + ! MS FORTRAN needs explicit interface for C functions called here. + ! + 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$ATTRIBUTES reference :: buf + 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 + CHARACTER(LEN=*), INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf + END FUNCTION h5areadc_7_c + END INTERFACE + + hdferr = h5areadc_7_c(attr_id, memtype_id, buf, dims) + END SUBROUTINE h5aread_char_7 + +END MODULE H5A_PROVISIONAL + + diff --git a/fortran/src/H5Df.c b/fortran/src/H5Df.c index 573315a..e1aa98e 100644 --- a/fortran/src/H5Df.c +++ b/fortran/src/H5Df.c @@ -1,4 +1,9 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +/****h* H5Df/H5Df + * PURPOSE + * This file contains C stubs for H5D Fortran APIs + * + * COPYRIGHT + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * @@ -11,32 +16,42 @@ * is linked from the top-level documents page. It can also be found at * * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * * access to either file, you may request a copy from help@hdfgroup.org. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -/* This files contains C stubs for H5D Fortran APIs */ + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * + ****** +*/ #include "H5f90.h" -/*---------------------------------------------------------------------------- - * Name: h5dcreate_c - * Purpose: Call H5Dcreate2 to create a dataset - * Inputs: loc_id - file or group identifier +/****if* H5Df/h5dcreate_c + * NAME + * h5dcreate_c + * PURPOSE + * Call H5Dcreate2 to create a dataset + * INPUTS + * loc_id - file or group identifier * name - name of the dataset * namelen - name length * type_id - datatype identifier * space_id - dataspace identifier * crt_pr - identifier of creation property list - * Outputs: dset_id - dataset identifier - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * OUTPUTS + * dset_id - dataset identifier + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Wednesday, August 4, 1999 - * Modifications: + * HISTORY + * * - Added optional parameters introduced in version 1.8 * February, 2008 - *---------------------------------------------------------------------------*/ + * SOURCE +*/ int_f nh5dcreate_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id, hid_t_f *space_id, hid_t_f *lcpl_id, hid_t_f *dcpl_id, hid_t_f *dapl_id, hid_t_f *dset_id) +/******/ { char *c_name = NULL; hid_t c_dset_id; @@ -64,21 +79,30 @@ DONE: return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5dopen_c - * Purpose: Call H5Dopen2 to open a dataset - * Inputs: loc_id - file or group identifier +/****if* H5Df/h5dopen_c + * NAME + * h5dopen_c + * PURPOSE + * Call H5Dopen2 to open a dataset + * INPUTS + * loc_id - file or group identifier * name - name of the dataset * namelen - name length * dapl_id - Dataset access property list - * Outputs: dset_id - dataset identifier - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * OUTPUTS + * dset_id - dataset identifier + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Wednesday, August 4, 1999 - * Modifications: Added 1.8 parameter: dapl_id - *---------------------------------------------------------------------------*/ + * HISTORY + * Added 1.8 parameter: dapl_id + * SOURCE +*/ int_f nh5dopen_c(hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *dapl_id, hid_t_f *dset_id) +/******/ { char *c_name = NULL; hid_t c_dset_id; @@ -105,24 +129,33 @@ DONE: return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5dwritec_c - * Purpose: Call h5dwrite_c to write a dataset of characters - * Inputs: dset_id - dataset identifier + +/****if* H5Df/h5dwritec_c + * NAME + * h5dwritec_c + * PURPOSE + * Call h5dwrite_c to write a dataset of characters + * INPUTS + * dset_id - dataset identifier * mem_type_id - memory datatype identifier * mem_space_id - memory dataspace identifier * file_space_id - memory dataspace identifier * xfer_pr - identifier of transfer property list * buf - character data buffer - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Tuesday, May 14, 2002 - * Modifications: This function is added to accomodate oveloaded h5dwrite_f + * HISTORY + * This function is added to accomodate oveloaded h5dwrite_f * with the dims argument being of INTEGER(HSIZE_T) type - *---------------------------------------------------------------------------*/ + * SOURCE +*/ int_f nh5dwritec_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) +/******/ { int ret_value = -1; @@ -136,6 +169,7 @@ nh5dwritec_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid int_f nh5dwritec_s_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) + { int ret_value = -1; @@ -149,6 +183,7 @@ nh5dwritec_s_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, h int_f nh5dwritec_1_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) + { int ret_value = -1; @@ -162,6 +197,7 @@ nh5dwritec_1_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, h int_f nh5dwritec_2_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) + { int ret_value = -1; @@ -175,6 +211,7 @@ nh5dwritec_2_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, h int_f nh5dwritec_3_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) + { int ret_value = -1; @@ -188,6 +225,7 @@ nh5dwritec_3_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, h int_f nh5dwritec_4_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) + { int ret_value = -1; @@ -201,6 +239,7 @@ nh5dwritec_4_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, h int_f nh5dwritec_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) + { int ret_value = -1; @@ -214,6 +253,7 @@ nh5dwritec_5_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, h int_f nh5dwritec_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) + { int ret_value = -1; @@ -227,6 +267,7 @@ nh5dwritec_6_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, h int_f nh5dwritec_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) + { int ret_value = -1; @@ -238,19 +279,25 @@ nh5dwritec_7_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, h return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5dwrite_c - * Purpose: Call H5Dwrite to write a dataset - * Inputs: dset_id - dataset identifier +/****if* H5Df/h5dwrite_c + * NAME + * h5dwrite_c + * PURPOSE + * Call H5Dwrite to write a dataset + * INPUTS + * dset_id - dataset identifier * mem_type_id - memory datatype identifier * mem_space_id - memory dataspace identifier * file_space_id - memory dataspace identifier * xfer_pr - identifier of transfer property list * buf - data buffer - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Tuesday, May 14, 2002 - * Modifications: This function is added to accomodate oveloaded h5dwrite_f + * HISTORY + * This function is added to accomodate oveloaded h5dwrite_f * with the dims argument being of INTEGER(HSIZE_T) type * * Added nh5dwrite_integer(real,double)_s,1-7_c functions to eliminate @@ -258,9 +305,11 @@ nh5dwritec_7_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, h * called by Fortran rouitnes * October 10, 2006 EIP * - *---------------------------------------------------------------------------*/ + * SOURCE +*/ int_f nh5dwrite_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, void *buf, hsize_t_f UNUSED *dims) +/******/ { int ret_value = -1; herr_t ret; @@ -291,6 +340,7 @@ nh5dwrite_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_ int_f nh5dwrite_integer_s_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, void *buf, hsize_t_f *dims) + { /* * Call h5dwrite_c function. @@ -301,6 +351,7 @@ nh5dwrite_integer_s_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_spac int_f nh5dwrite_integer_1_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, void *buf, hsize_t_f *dims) + { /* * Call h5dwrite_c function. @@ -311,6 +362,7 @@ nh5dwrite_integer_1_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_spac int_f nh5dwrite_integer_2_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, void *buf, hsize_t_f *dims) + { /* * Call h5dwrite_c function. @@ -321,6 +373,7 @@ nh5dwrite_integer_2_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_spac int_f nh5dwrite_integer_3_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, void *buf, hsize_t_f *dims) + { /* * Call h5dwrite_c function. @@ -331,6 +384,7 @@ nh5dwrite_integer_3_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_spac int_f nh5dwrite_integer_4_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, void *buf, hsize_t_f *dims) + { /* * Call h5dwrite_c function. @@ -341,6 +395,7 @@ nh5dwrite_integer_4_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_spac int_f nh5dwrite_integer_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, void *buf, hsize_t_f *dims) + { /* * Call h5dwrite_c function. @@ -351,6 +406,7 @@ nh5dwrite_integer_5_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_spac int_f nh5dwrite_integer_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, void *buf, hsize_t_f *dims) + { /* * Call h5dwrite_c function. @@ -361,6 +417,7 @@ nh5dwrite_integer_6_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_spac int_f nh5dwrite_integer_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, void *buf, hsize_t_f *dims) + { /* * Call h5dwrite_c function. @@ -371,6 +428,7 @@ nh5dwrite_integer_7_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_spac int_f nh5dwrite_real_s_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, void *buf, hsize_t_f *dims) + { /* * Call h5dwrite_c function. @@ -380,6 +438,7 @@ nh5dwrite_real_s_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_i int_f nh5dwrite_real_1_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, void *buf, hsize_t_f *dims) + { /* * Call h5dwrite_c function. @@ -389,6 +448,7 @@ nh5dwrite_real_1_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_i int_f nh5dwrite_real_2_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, void *buf, hsize_t_f *dims) + { /* * Call h5dwrite_c function. @@ -398,6 +458,7 @@ nh5dwrite_real_2_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_i int_f nh5dwrite_real_3_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, void *buf, hsize_t_f *dims) + { /* * Call h5dwrite_c function. @@ -407,6 +468,7 @@ nh5dwrite_real_3_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_i int_f nh5dwrite_real_4_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, void *buf, hsize_t_f *dims) + { /* * Call h5dwrite_c function. @@ -416,6 +478,7 @@ nh5dwrite_real_4_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_i int_f nh5dwrite_real_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, void *buf, hsize_t_f *dims) + { /* * Call h5dwrite_c function. @@ -425,6 +488,7 @@ nh5dwrite_real_5_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_i int_f nh5dwrite_real_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, void *buf, hsize_t_f *dims) + { /* * Call h5dwrite_c function. @@ -434,6 +498,7 @@ nh5dwrite_real_6_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_i int_f nh5dwrite_real_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, void *buf, hsize_t_f *dims) + { /* * Call h5dwrite_c function. @@ -443,6 +508,7 @@ nh5dwrite_real_7_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_i int_f nh5dwrite_double_s_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, void *buf, hsize_t_f *dims) + { /* * Call h5dwrite_c function. @@ -452,6 +518,7 @@ nh5dwrite_double_s_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space int_f nh5dwrite_double_1_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, void *buf, hsize_t_f *dims) + { /* * Call h5dwrite_c function. @@ -461,6 +528,7 @@ nh5dwrite_double_1_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space int_f nh5dwrite_double_2_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, void *buf, hsize_t_f *dims) + { /* * Call h5dwrite_c function. @@ -470,6 +538,7 @@ nh5dwrite_double_2_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space int_f nh5dwrite_double_3_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, void *buf, hsize_t_f *dims) + { /* * Call h5dwrite_c function. @@ -479,6 +548,7 @@ nh5dwrite_double_3_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space int_f nh5dwrite_double_4_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, void *buf, hsize_t_f *dims) + { /* * Call h5dwrite_c function. @@ -488,6 +558,7 @@ nh5dwrite_double_4_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space int_f nh5dwrite_double_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, void *buf, hsize_t_f *dims) + { /* * Call h5dwrite_c function. @@ -497,6 +568,7 @@ nh5dwrite_double_5_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space int_f nh5dwrite_double_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, void *buf, hsize_t_f *dims) + { /* * Call h5dwrite_c function. @@ -506,6 +578,7 @@ nh5dwrite_double_6_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space int_f nh5dwrite_double_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, void *buf, hsize_t_f *dims) + { /* * Call h5dwrite_c function. @@ -514,24 +587,32 @@ nh5dwrite_double_7_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space } -/*---------------------------------------------------------------------------- - * Name: h5dwrite_ref_obj_c - * Purpose: Call H5Dwrite to write a dataset of object references - * Inputs: dset_id - dataset identifier +/****if* H5Df/h5dwrite_ref_obj_c + * NAME + * h5dwrite_ref_obj_c + * PURPOSE + * Call H5Dwrite to write a dataset of object references + * INPUTS + * dset_id - dataset identifier * mem_type_id - memory datatype identifier * mem_space_id - memory dataspace identifier * file_space_id - memory dataspace identifier * xfer_pr - identifier of transfer property list * buf - data buffer with references to the objects. * n - number of references to be stored. - * Returns: 0 on success,e-1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success,e-1 on failure + * AUTHOR + * Elena Pourmal * Tuesday, May 14, 2002 - * Modifications: This function was added to accomodate h5dwrite_f with the + * HISTORY + * This function was added to accomodate h5dwrite_f with the * dims argumnet being of INTEGER(HSIZE_T) type. - *---------------------------------------------------------------------------*/ + * SOURCE +*/ int_f nh5dwrite_ref_obj_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, haddr_t_f *buf, hsize_t_f *dims) +/******/ { int ret_value = -1; herr_t ret; @@ -573,24 +654,32 @@ nh5dwrite_ref_obj_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_ return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5dwrite_ref_reg_c - * Purpose: Call H5Dwrite to write a dataset of dataset region references - * Inputs: dset_id - dataset identifier +/****if* H5Df/h5dwrite_ref_reg_c + * NAME + * h5dwrite_ref_reg_c + * PURPOSE + * Call H5Dwrite to write a dataset of dataset region references + * INPUTS + * dset_id - dataset identifier * mem_type_id - memory datatype identifier * mem_space_id - memory dataspace identifier * file_space_id - memory dataspace identifier * xfer_pr - identifier of transfer property list * buf - data buffer with references to the objects. * n - number of references to be stored. - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Tuesday, May 14, 2002 - * Modifications: This function was added to accomodate h5dwrite_f with the + * HISTORY + * This function was added to accomodate h5dwrite_f with the * dims argument being of INTEGER(HSIZE_T) type - *---------------------------------------------------------------------------*/ + * SOURCE +*/ int_f nh5dwrite_ref_reg_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, int_f *buf, hsize_t_f *dims) +/******/ { int ret_value = -1; herr_t ret; @@ -637,23 +726,32 @@ nh5dwrite_ref_reg_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_ -/*---------------------------------------------------------------------------- - * Name: h5dreadc_c - * Purpose: Call h5dread_c to read a dataset of characters - * Inputs: dset_id - dataset identifier +/****if* H5Df/h5dreadc_c + * NAME + * h5dreadc_c + * PURPOSE + * Call h5dread_c to read a dataset of characters + * INPUTS + * dset_id - dataset identifier * mem_type_id - memory datatype identifier * mem_space_id - memory dataspace identifier * file_space_id - memory dataspace identifier * xfer_pr - identifier of transfer property list - * Outputs: buf - character data buffer - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * OUTPUTS + * buf - character data buffer + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Wednesday, May 15, 2002 - * Modifications: This function was added to accomodate h5dread_f subroutine + * HISTORY + * This function was added to accomodate h5dread_f subroutine * with the dims parameter being of INTEGER(HSIZE_T_F) size. - *---------------------------------------------------------------------------*/ + * SOURCE +*/ int_f nh5dreadc_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) +/******/ { int ret_value = -1; @@ -667,6 +765,7 @@ nh5dreadc_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_ int_f nh5dreadc_s_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) + { int ret_value = -1; @@ -680,6 +779,7 @@ nh5dreadc_s_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hi int_f nh5dreadc_1_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) + { int ret_value = -1; @@ -693,6 +793,7 @@ nh5dreadc_1_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hi int_f nh5dreadc_2_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) + { int ret_value = -1; @@ -706,6 +807,7 @@ nh5dreadc_2_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hi int_f nh5dreadc_3_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) + { int ret_value = -1; @@ -719,6 +821,7 @@ nh5dreadc_3_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hi int_f nh5dreadc_4_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) + { int ret_value = -1; @@ -732,6 +835,7 @@ nh5dreadc_4_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hi 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) + { int ret_value = -1; @@ -745,6 +849,7 @@ nh5dreadc_5_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hi 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) + { int ret_value = -1; @@ -758,6 +863,7 @@ nh5dreadc_6_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hi 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) + { int ret_value = -1; @@ -769,19 +875,26 @@ nh5dreadc_7_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hi return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5dread_c - * Purpose: Call H5Draed to read a dataset - * Inputs: dset_id - dataset identifier +/****if* H5Df/h5dread_c + * NAME + * h5dread_c + * PURPOSE + * Call H5Draed to read a dataset + * INPUTS + * dset_id - dataset identifier * mem_type_id - memory datatype identifier * mem_space_id - memory dataspace identifier * file_space_id - memory dataspace identifier * xfer_pr - identifier of transfer property list - * Outputs: buf - data buffer - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * OUTPUTS + * buf - data buffer + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Wednesday, May 15, 2002 - * Modifications: This function was added to accomodate h5dread_f subroutine + * HISTORY + * This function was added to accomodate h5dread_f subroutine * with the dims parameter being of INTEGER(HSIZE_T_F) size. * * Added nh5dread_integer(real,double)_s,1-7_c functions to eliminate @@ -789,9 +902,11 @@ nh5dreadc_7_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hi * called by Fortran rouitnes * October 10, 2006 EIP * - *---------------------------------------------------------------------------*/ + * SOURCE +*/ int_f nh5dread_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, void *buf, hsize_t_f UNUSED *dims) +/******/ { int ret_value = -1; herr_t ret; @@ -822,6 +937,7 @@ nh5dread_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t int_f nh5dread_integer_s_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, void *buf, hsize_t_f *dims) + { /* * Call h5dread_c function. @@ -831,6 +947,7 @@ nh5dread_integer_s_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space int_f nh5dread_integer_1_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, void *buf, hsize_t_f *dims) + { /* * Call h5dread_c function. @@ -840,6 +957,7 @@ nh5dread_integer_1_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space int_f nh5dread_integer_2_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, void *buf, hsize_t_f *dims) + { /* * Call h5dread_c function. @@ -849,6 +967,7 @@ nh5dread_integer_2_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space int_f nh5dread_integer_3_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, void *buf, hsize_t_f *dims) + { /* * Call h5dread_c function. @@ -858,6 +977,7 @@ nh5dread_integer_3_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space int_f nh5dread_integer_4_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, void *buf, hsize_t_f *dims) + { /* * Call h5dread_c function. @@ -867,6 +987,7 @@ nh5dread_integer_4_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space int_f nh5dread_integer_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, void *buf, hsize_t_f *dims) + { /* * Call h5dread_c function. @@ -876,6 +997,7 @@ nh5dread_integer_5_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space int_f nh5dread_integer_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, void *buf, hsize_t_f *dims) + { /* * Call h5dread_c function. @@ -885,6 +1007,7 @@ nh5dread_integer_6_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space int_f nh5dread_integer_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, void *buf, hsize_t_f *dims) + { /* * Call h5dread_c function. @@ -894,6 +1017,7 @@ nh5dread_integer_7_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space int_f nh5dread_real_s_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, void *buf, hsize_t_f *dims) + { /* * Call h5dread_c function. @@ -903,6 +1027,7 @@ nh5dread_real_s_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id int_f nh5dread_real_1_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, void *buf, hsize_t_f *dims) + { /* * Call h5dread_c function. @@ -912,6 +1037,7 @@ nh5dread_real_1_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id int_f nh5dread_real_2_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, void *buf, hsize_t_f *dims) + { /* * Call h5dread_c function. @@ -921,6 +1047,7 @@ nh5dread_real_2_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id int_f nh5dread_real_3_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, void *buf, hsize_t_f *dims) + { /* * Call h5dread_c function. @@ -930,6 +1057,7 @@ nh5dread_real_3_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id int_f nh5dread_real_4_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, void *buf, hsize_t_f *dims) + { /* * Call h5dread_c function. @@ -939,6 +1067,7 @@ nh5dread_real_4_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id int_f nh5dread_real_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, void *buf, hsize_t_f *dims) + { /* * Call h5dread_c function. @@ -948,6 +1077,7 @@ nh5dread_real_5_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id int_f nh5dread_real_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, void *buf, hsize_t_f *dims) + { /* * Call h5dread_c function. @@ -957,6 +1087,7 @@ nh5dread_real_6_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id int_f nh5dread_real_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, void *buf, hsize_t_f *dims) + { /* * Call h5dread_c function. @@ -966,6 +1097,7 @@ nh5dread_real_7_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id int_f nh5dread_double_s_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, void *buf, hsize_t_f *dims) + { /* * Call h5dread_c function. @@ -975,6 +1107,7 @@ nh5dread_double_s_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_ int_f nh5dread_double_1_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, void *buf, hsize_t_f *dims) + { /* * Call h5dread_c function. @@ -984,6 +1117,7 @@ nh5dread_double_1_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_ int_f nh5dread_double_2_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, void *buf, hsize_t_f *dims) + { /* * Call h5dread_c function. @@ -993,6 +1127,7 @@ nh5dread_double_2_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_ int_f nh5dread_double_3_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, void *buf, hsize_t_f *dims) + { /* * Call h5dread_c function. @@ -1002,6 +1137,7 @@ nh5dread_double_3_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_ int_f nh5dread_double_4_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, void *buf, hsize_t_f *dims) + { /* * Call h5dread_c function. @@ -1011,6 +1147,7 @@ nh5dread_double_4_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_ int_f nh5dread_double_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, void *buf, hsize_t_f *dims) + { /* * Call h5dread_c function. @@ -1020,6 +1157,7 @@ nh5dread_double_5_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_ int_f nh5dread_double_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, void *buf, hsize_t_f *dims) + { /* * Call h5dread_c function. @@ -1029,6 +1167,7 @@ nh5dread_double_6_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_ int_f nh5dread_double_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, void *buf, hsize_t_f *dims) + { /* * Call h5dread_c function. @@ -1036,24 +1175,32 @@ nh5dread_double_7_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_ return nh5dread_c(dset_id, mem_type_id, mem_space_id, file_space_id, xfer_prp, buf, dims); } -/*---------------------------------------------------------------------------- - * Name: h5dread_ref_obj_c - * Purpose: Call H5Dread to read a dataset of object references - * Inputs: dset_id - dataset identifier +/****if* H5Df/h5dread_ref_obj_c + * NAME + * h5dread_ref_obj_c + * PURPOSE + * Call H5Dread to read a dataset of object references + * INPUTS + * dset_id - dataset identifier * mem_type_id - memory datatype identifier * mem_space_id - memory dataspace identifier * file_space_id - memory dataspace identifier * xfer_pr - identifier of transfer property list * buf - data buffer to store references to the objects. * n - number of references to be stored. - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Wednesday, May 15, 2002 - * Modifications: This function was added to accomodate h5dread_f subroutine + * HISTORY + * This function was added to accomodate h5dread_f subroutine * with the dims parameter being of INTEGER(HSIZE_T_F) size. - *---------------------------------------------------------------------------*/ + * SOURCE +*/ int_f nh5dread_ref_obj_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, haddr_t_f * buf, hsize_t_f *dims) +/******/ { int ret_value = -1; herr_t ret = -1; @@ -1095,24 +1242,32 @@ nh5dread_ref_obj_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_i return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5dread_ref_reg_c - * Purpose: Call H5Dread to read a dataset of dataset region references - * Inputs: dset_id - dataset identifier +/****if* H5Df/h5dread_ref_reg_c + * NAME + * h5dread_ref_reg_c + * PURPOSE + * Call H5Dread to read a dataset of dataset region references + * INPUTS + * dset_id - dataset identifier * mem_type_id - memory datatype identifier * mem_space_id - memory dataspace identifier * file_space_id - memory dataspace identifier * xfer_pr - identifier of transfer property list * buf - data buffer to store references to the objects. * n - number of references to be stored. - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Wednesday, May 15, 2002 - * Modifications: This function was added to accomodate h5dread_f subroutine + * HISTORY + * This function was added to accomodate h5dread_f subroutine * with the dims parameter being of INTEGER(HSIZE_T_F) size. - *---------------------------------------------------------------------------*/ + * SOURCE +*/ int_f nh5dread_ref_reg_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, int_f * buf, hsize_t_f *dims) +/******/ { int ret_value = -1; herr_t ret = -1; @@ -1157,18 +1312,26 @@ nh5dread_ref_reg_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_i -/*---------------------------------------------------------------------------- - * Name: h5dclose_c - * Purpose: Call H5Dclose to close a dataset - * Inputs: dset_id - identifier of the dataset to be closed - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal +/****if* H5Df/h5dclose_c + * NAME + * h5dclose_c + * PURPOSE + * Call H5Dclose to close a dataset + * INPUTS + * dset_id - identifier of the dataset to be closed + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Wednesday, August 4, 1999 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5dclose_c ( hid_t_f *dset_id ) +/******/ { int ret_value = 0; hid_t c_dset_id; @@ -1177,19 +1340,28 @@ nh5dclose_c ( hid_t_f *dset_id ) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5dget_space_c - * Purpose: Call H5Dget_space to obtain dataspace of a dataset - * Inputs: dset_id - identifier of the dataset - * Outputs: space_id - identifier of the dataset's dataspace - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal +/****if* H5Df/h5dget_space_c + * NAME + * h5dget_space_c + * PURPOSE + * Call H5Dget_space to obtain dataspace of a dataset + * INPUTS + * dset_id - identifier of the dataset + * OUTPUTS + * space_id - identifier of the dataset's dataspace + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Thursday, August 19, 1999 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5dget_space_c ( hid_t_f *dset_id , hid_t_f *space_id) +/******/ { int ret_value = -1; hid_t c_dset_id; @@ -1203,19 +1375,28 @@ nh5dget_space_c ( hid_t_f *dset_id , hid_t_f *space_id) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5dget_type_c - * Purpose: Call H5Dget_type to obtain datatype of a dataset - * Inputs: dset_id - identifier of the dataset - * Outputs: type_id - identifier of the dataset's datatype - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal +/****if* H5Df/h5dget_type_c + * NAME + * h5dget_type_c + * PURPOSE + * Call H5Dget_type to obtain datatype of a dataset + * INPUTS + * dset_id - identifier of the dataset + * OUTPUTS + * type_id - identifier of the dataset's datatype + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Thursday, August 19, 1999 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5dget_type_c ( hid_t_f *dset_id , hid_t_f *type_id) +/******/ { int ret_value = -1; hid_t c_dset_id; @@ -1231,20 +1412,29 @@ nh5dget_type_c ( hid_t_f *dset_id , hid_t_f *type_id) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5dget_create_plist_c - * Purpose: Call H5Dget_create_plist to obtain creation property list +/****if* H5Df/h5dget_create_plist_c + * NAME + * h5dget_create_plist_c + * PURPOSE + * Call H5Dget_create_plist to obtain creation property list * of a dataset - * Inputs: dset_id - identifier of the dataset - * Outputs: plist_id - identifier of he dataset creation property list - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * INPUTS + * dset_id - identifier of the dataset + * OUTPUTS + * plist_id - identifier of he dataset creation property list + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Thursday, August 19, 1999 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5dget_create_plist_c ( hid_t_f *dset_id , hid_t_f *plist_id) +/******/ { int ret_value = -1; hid_t c_dset_id; @@ -1261,22 +1451,31 @@ nh5dget_create_plist_c ( hid_t_f *dset_id , hid_t_f *plist_id) } -/*---------------------------------------------------------------------------- - * Name: h5dset_extent_c - * Purpose: Call H5Dset_extent to extend dataset with unlimited dimensions - * Inputs: dset_id - identifier of the dataset - * Outputs: dims - array with the dimension sizes - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal +/****if* H5Df/h5dset_extent_c + * NAME + * h5dset_extent_c + * PURPOSE + * Call H5Dset_extent to extend dataset with unlimited dimensions + * INPUTS + * dset_id - identifier of the dataset + * OUTPUTS + * dims - array with the dimension sizes + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Thursday, August 19, 1999 * - * Modifications: Changed name from the now obsolete h5dextend + * HISTORY + * Changed name from the now obsolete h5dextend * to h5dset_extent in order to match new fortran interface. * -MSB- March 14, 2008 - *---------------------------------------------------------------------------*/ + * SOURCE +*/ int_f nh5dset_extent_c ( hid_t_f *dset_id , hsize_t_f *dims) +/******/ { hid_t c_space_id; hsize_t c_dims[H5S_MAX_RANK]; @@ -1305,20 +1504,29 @@ nh5dset_extent_c ( hid_t_f *dset_id , hsize_t_f *dims) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: nh5dget_storage_size_c - * Purpose: Call H5Dget_storage_size to return the amount of storage +/****if* H5Df/nh5dget_storage_size_c + * NAME + * nh5dget_storage_size_c + * PURPOSE + * Call H5Dget_storage_size to return the amount of storage * required for a dataset - * Inputs: dset_id - identifier of the dataset - * Outputs: size - the amount of storage required for a dataset - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * INPUTS + * dset_id - identifier of the dataset + * OUTPUTS + * size - the amount of storage required for a dataset + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Tuesday, October 22, 2002 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5dget_storage_size_c ( hid_t_f *dset_id , hsize_t_f *size) +/******/ { int ret_value = -1; hsize_t c_size; @@ -1332,21 +1540,30 @@ nh5dget_storage_size_c ( hid_t_f *dset_id , hsize_t_f *size) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: nh5dvlen_get_max_len_c - * Purpose: Get the maximum size of the VL dataset element - * Inputs: dset_id - identifier of the dataset +/****if* H5Df/nh5dvlen_get_max_len_c + * NAME + * nh5dvlen_get_max_len_c + * PURPOSE + * Get the maximum size of the VL dataset element + * INPUTS + * dset_id - identifier of the dataset * type_id - datatype identifier * space_id - dataspace identifier - * Outputs: len - maximum length of the VL dataset element - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * OUTPUTS + * len - maximum length of the VL dataset element + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Tuesday, October 22, 2002 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5dvlen_get_max_len_c ( hid_t_f *dset_id , hid_t_f *type_id, hid_t_f *space_id, size_t_f *len) +/******/ { int ret_value = -1; size_t c_len; @@ -1381,10 +1598,13 @@ DONE: free(c_buf); return ret_value; } -/*---------------------------------------------------------------------------- - * Name: nh5dwrite_vl_integer_c - * Purpose: Write variable length dataset - * Inputs: dset_id - identifier of the dataset +/****if* H5Df/nh5dwrite_vl_integer_c + * NAME + * nh5dwrite_vl_integer_c + * PURPOSE + * Write variable length dataset + * INPUTS + * dset_id - identifier of the dataset * mem_type_id - datatype identifier * mem_space_id - dataspace identifier * file_space_id - file dataspace identifier @@ -1394,14 +1614,19 @@ DONE: * dims[0] = MAXLENGTH * dims[1] = number of elements of VL type * len - array element lenghts - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Wednesday, October 23, 2002 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5dwrite_vl_integer_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, int_f *buf, hsize_t_f *dims, size_t_f *len) +/******/ { int ret_value = -1; hid_t c_dset_id; @@ -1446,10 +1671,13 @@ DONE: return ret_value; } -/*---------------------------------------------------------------------------- - * Name: nh5dread_vl_integer_c - * Purpose: Read variable length dataset - * Inputs: dset_id - identifier of the dataset +/****if* H5Df/nh5dread_vl_integer_c + * NAME + * nh5dread_vl_integer_c + * PURPOSE + * Read variable length dataset + * INPUTS + * dset_id - identifier of the dataset * mem_type_id - datatype identifier * mem_space_id - dataspace identifier * file_space_id - file dataspace identifier @@ -1457,16 +1685,22 @@ DONE: * dims - one-demnsional array of size 2 * dims[0] = MAXLENGTH * dims[1] = number of elements of VL type - * Outputs: buf - data buffer + * OUTPUTS + * buf - data buffer * len - array element lenghts - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Wednesday, October 24, 2002 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5dread_vl_integer_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, int_f *buf, hsize_t_f *dims, size_t_f *len) +/******/ { int ret_value = -1; hid_t c_dset_id; @@ -1509,10 +1743,13 @@ DONE: return ret_value; } -/*---------------------------------------------------------------------------- - * Name: nh5dwrite_vl_string_c - * Purpose: Write variable length strings from Fortran program - * Inputs: dset_id - identifier of the dataset +/****if* H5Df/nh5dwrite_vl_string_c + * NAME + * nh5dwrite_vl_string_c + * PURPOSE + * Write variable length strings from Fortran program + * INPUTS + * dset_id - identifier of the dataset * mem_type_id - datatype identifier * mem_space_id - dataspace identifier * file_space_id - file dataspace identifier @@ -1521,14 +1758,19 @@ DONE: * dims - one-demnsional array of size 2 * dims[0] = number of strings of size max_len * len - array of strings lengths - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Monday, October 28, 2002 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5dwrite_vl_string_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, size_t_f *len) +/******/ { int ret_value = -1; hid_t c_dset_id; @@ -1588,10 +1830,13 @@ DONE: free(tmp); return ret_value; } -/*---------------------------------------------------------------------------- - * Name: nh5dread_vl_string_c - * Purpose: Read variable length strings from Fortran program - * Inputs: dset_id - identifier of the dataset +/****if* H5Df/nh5dread_vl_string_c + * NAME + * nh5dread_vl_string_c + * PURPOSE + * Read variable length strings from Fortran program + * INPUTS + * dset_id - identifier of the dataset * mem_type_id - datatype identifier * mem_space_id - dataspace identifier * file_space_id - file dataspace identifier @@ -1600,14 +1845,19 @@ DONE: * dims[0] = number of strings of size max_len * Output: buf - data buffer * len - array of strings lengths - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Friday, November 1, 2002 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5dread_vl_string_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, size_t_f *len) +/******/ { int ret_value = -1; hid_t c_dset_id; @@ -1663,10 +1913,13 @@ nh5dread_vl_string_c( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_spa return ret_value; } -/*---------------------------------------------------------------------------- - * Name: nh5dwrite_vl_real_c - * Purpose: Write variable length dataset - * Inputs: dset_id - identifier of the dataset +/****if* H5Df/nh5dwrite_vl_real_c + * NAME + * nh5dwrite_vl_real_c + * PURPOSE + * Write variable length dataset + * INPUTS + * dset_id - identifier of the dataset * mem_type_id - datatype identifier * mem_space_id - dataspace identifier * file_space_id - file dataspace identifier @@ -1676,14 +1929,19 @@ nh5dread_vl_string_c( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_spa * dims[0] = MAXLENGTH * dims[1] = number of elements of VL type * len - array element lenghts - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Monday, November 11, 2002 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5dwrite_vl_real_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, real_f *buf, hsize_t_f *dims, size_t_f *len) +/******/ { int ret_value = -1; hid_t c_dset_id; @@ -1728,10 +1986,13 @@ DONE: return ret_value; } -/*---------------------------------------------------------------------------- - * Name: nh5dread_vl_real_c - * Purpose: Read variable length dataset - * Inputs: dset_id - identifier of the dataset +/****if* H5Df/nh5dread_vl_real_c + * NAME + * nh5dread_vl_real_c + * PURPOSE + * Read variable length dataset + * INPUTS + * dset_id - identifier of the dataset * mem_type_id - datatype identifier * mem_space_id - dataspace identifier * file_space_id - file dataspace identifier @@ -1739,16 +2000,22 @@ DONE: * dims - one-demnsional array of size 2 * dims[0] = MAXLENGTH * dims[1] = number of elements of VL type - * Outputs: buf - data buffer + * OUTPUTS + * buf - data buffer * len - array element lenghts - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Monday, November 11, 2002 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5dread_vl_real_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, real_f *buf, hsize_t_f *dims, size_t_f *len) +/******/ { int ret_value = -1; hid_t c_dset_id; @@ -1792,21 +2059,29 @@ DONE: return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5dfillc_c - * Purpose: Call h5fill_c to fill memory buffer with a fill value - * Inputs: fill_value - fill value +/****if* H5Df/h5dfillc_c + * NAME + * h5dfillc_c + * PURPOSE + * Call h5fill_c to fill memory buffer with a fill value + * INPUTS + * fill_value - fill value * fill_type_id - fill value datatype identifier * space_id - memory space selection identifier * buf - memory buffer to fill * mem_type_id - memory buffer dtatype identifier - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Wednesday, March 12, 2003 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5dfillc_c (_fcd fill_value, hid_t_f *fill_type_id, hid_t_f *space_id, _fcd buf, hid_t_f *mem_type_id) +/******/ { int ret_value = -1; @@ -1817,22 +2092,29 @@ nh5dfillc_c (_fcd fill_value, hid_t_f *fill_type_id, hid_t_f *space_id, _fcd buf return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5dfill_c - * Purpose: Call H5Dfill to fill memory buffer with a fill value - * Inputs: fill_value - fill value +/****if* H5Df/h5dfill_c + * NAME + * h5dfill_c + * PURPOSE + * Call H5Dfill to fill memory buffer with a fill value + * INPUTS + * fill_value - fill value * fill_type_id - fill value datatype identifier * space_id - memory space selection identifier * buf - memory buffer to fill * mem_type_id - memory buffer dtatype identifier - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Wednesday, March 12, 2003 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5dfill_c (void * fill_value, hid_t_f *fill_type_id, hid_t_f *space_id, void * buf, hid_t_f *mem_type_id) - +/******/ { int ret_value = -1; herr_t ret; @@ -1926,19 +2208,27 @@ nh5dfill_double_c (void * fill_value, hid_t_f *fill_type_id, hid_t_f *space_id, return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5dget_space_status_c - * Purpose: Call H5Dget_space_status to request dataspace allocation status - * Inputs: dset_id - dataset identifier - * Outputs: flag - status flag - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal +/****if* H5Df/h5dget_space_status_c + * NAME + * h5dget_space_status_c + * PURPOSE + * Call H5Dget_space_status to request dataspace allocation status + * INPUTS + * dset_id - dataset identifier + * OUTPUTS + * flag - status flag + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Wednesday, March 12, 2003 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5dget_space_status_c ( hid_t_f *dset_id, int_f *flag) - +/******/ { int ret_value = -1; herr_t ret; @@ -1957,25 +2247,33 @@ nh5dget_space_status_c ( hid_t_f *dset_id, int_f *flag) ret_value = 0; return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5dcreate_anon_c - * Purpose: Call H5Dcreate_anon - * Inputs: +/****if* H5Df/h5dcreate_anon_c + * NAME + * h5dcreate_anon_c + * PURPOSE + * Call H5Dcreate_anon + * INPUTS + * * loc_id - Identifier of the file or group within which to create the dataset. * type_id - Identifier of the datatype to use when creating the dataset. * space_id - Identifier of the dataspace to use when creating the dataset. * dcpl_id - Dataset creation property list identifier. * dapl_id - Dataset access property list identifier. - * Outputs: + * OUTPUTS + * * dset_id - dataset identifier * - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld * February, 2008 - *---------------------------------------------------------------------------*/ + * SOURCE +*/ int_f nh5dcreate_anon_c (hid_t_f *loc_id, hid_t_f *type_id, hid_t_f *space_id, hid_t_f *dcpl_id, hid_t_f *dapl_id, hid_t_f *dset_id) +/******/ { int ret_value = -1; @@ -1992,20 +2290,174 @@ 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. +/****if* H5Df/nh5dwrite_f_c + * NAME + * nh5dwrite_f_c + * PURPOSE + * Call H5Dwrite to write a dataset + * INPUTS + * dset_id - dataset identifier + * mem_type_id - memory datatype identifier + * mem_space_id - memory dataspace identifier + * file_space_id - memory dataspace identifier + * xfer_pr - identifier of transfer property list + * buf - data buffer + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld + * May 28, 2008 + * HISTORY + * + * + * SOURCE +*/ +int_f +nh5dwrite_f_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, void *buf) +/******/ +{ + int ret_value = -1; + herr_t ret; + hid_t c_dset_id; + hid_t c_mem_type_id; + hid_t c_mem_space_id; + hid_t c_file_space_id; + hid_t c_xfer_prp; + +/* int i, j; */ +/* typedef struct { */ +/* int x; */ +/* float y; */ +/* } r_dual_c; */ + +/* const r_dual_c *name=buf; */ + +/* r_dual_c access[4][4]; */ + +/* for ( i=0; i<4; ++i) */ +/* for (j = 0; j<4; ++j) { */ +/* access[i][j] = name[i*4+j]; */ +/* /\* access[i].x = access[i].x + 1; *\/ */ +/* printf("x = %i \n", access[i][j].x); */ +/* printf("y = %f \n", access[i][j].y); */ +/* } */ + + /* + * Define transfer property + */ + c_xfer_prp = (hid_t)*xfer_prp; + + /* + * Call H5Dwrite function. + */ + c_dset_id = (hid_t)*dset_id; + c_mem_type_id = (hid_t)*mem_type_id; + c_mem_space_id = (hid_t)*mem_space_id; + c_file_space_id = (hid_t)*file_space_id; + ret = H5Dwrite(c_dset_id, c_mem_type_id, c_mem_space_id, c_file_space_id, c_xfer_prp, buf); + + if (ret < 0) return ret_value; + ret_value = 0; + return ret_value; +} +/****if* H5Df/nh5dread_f_c + * NAME + * nh5dread_f_c + * PURPOSE + * Read variable length dataset + * INPUTS + * dset_id - identifier of the dataset + * mem_type_id - datatype identifier + * mem_space_id - dataspace identifier + * file_space_id - file dataspace identifier + * xfer - file transfer property + * dims - one-demnsional array of size 2 + * dims[0] = MAXLENGTH + * dims[1] = number of elements of VL type + * OUTPUTS + * buf - data buffer + * len - array element lenghts + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal + * Wednesday, October 24, 2002 + * HISTORY + * + * SOURCE +*/ + +int_f +nh5dread_f_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, void *buf) +/******/ +{ + int ret_value = -1; + hid_t c_dset_id; + hid_t c_mem_type_id; + hid_t c_mem_space_id; + hid_t c_file_space_id; + hid_t c_xfer_prp; + herr_t status; + +/* int i, j; */ +/* typedef struct { */ +/* int x; */ +/* float y; */ +/* } r_dual_c; */ + +/* r_dual_c *name=buf; */ + +/* r_dual_c access[4][4]; */ + + c_dset_id = (hid_t)*dset_id; + c_mem_type_id = (hid_t)*mem_type_id; + c_mem_space_id = (hid_t)*mem_space_id; + c_file_space_id = (hid_t)*file_space_id; + c_xfer_prp = (hid_t)*xfer_prp; + /* + * Call H5Dread function. + */ + +/* printf("%i %i %i %i %i \n",c_dset_id, c_mem_type_id, c_mem_space_id, c_file_space_id, c_xfer_prp); */ + + status = H5Dread(c_dset_id, c_mem_type_id, c_mem_space_id, c_file_space_id, c_xfer_prp, buf); + if ( status < 0 ) return ret_value; + +/* for ( i=0; i<4; ++i) */ +/* for (j = 0; j<4; ++j) { */ +/* access[i][j] = name[i*4+j]; */ +/* /\* access[i].x = access[i].x + 1; *\/ */ +/* printf("x = %i \n", access[i][j].x); */ +/* printf("y = %f \n", access[i][j].y); */ +/* } */ + + + ret_value = 1; + return ret_value; +} +/****if* H5Df/nh5dget_access_plist_c + * NAME + * nh5dget_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 + * AUTHOR + * M. Scot Breitenfeld + * April 13, 2009 * - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld - * April 13, 2009 - *---------------------------------------------------------------------------*/ + * SOURCE +*/ + int_f nh5dget_access_plist_c (hid_t_f *dset_id, hid_t_f *plist_id) +/******/ { int ret_value = -1; /* @@ -2020,4 +2472,38 @@ nh5dget_access_plist_c (hid_t_f *dset_id, hid_t_f *plist_id) return ret_value; } +/****if* H5Df/nh5dvlen_reclaim_c + * NAME + * nh5dvlen_reclaim_c + * PURPOSE + * Call H5Dvlen_reclaim + * INPUTS + * type_id - Identifier of the datatype. + * space_id - Identifier of the dataspace. + * plist_id - Identifier of the property list used to create the buffer. + * buf - Pointer to the buffer to be reclaimed. + * + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld + * January 15, 2011 + * + * SOURCE +*/ +int_f +nh5dvlen_reclaim_c(hid_t_f *type_id, hid_t_f *space_id, hid_t_f *plist_id, void *buf) +/******/ +{ + int ret_value = -1; + herr_t status; + + /* + * Call H5Dvlen_reclaim function. + */ + status = H5Dvlen_reclaim((hid_t)*type_id, (hid_t)*space_id, (hid_t)*plist_id, buf); + if ( status < 0 ) return ret_value; + ret_value = 0; + return ret_value; +} diff --git a/fortran/src/H5Dff.f90 b/fortran/src/H5Dff.f90 index c4810b3..b1e1df1 100644 --- a/fortran/src/H5Dff.f90 +++ b/fortran/src/H5Dff.f90 @@ -1,3 +1,17 @@ +!****h* ROBODoc/H5D +! +! NAME +! MODULE H5D +! +! FILE +! fortran/src/H5Dff.f90 +! +! PURPOSE +! This file contains Fortran interfaces for H5D functions. It includes +! all the functions that are independent on whether the Fortran 2003 functions +! are enabled or disabled. +! +! COPYRIGHT ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! Copyright by The HDF Group. * ! Copyright by the Board of Trustees of the University of Illinois. * @@ -13,76 +27,19 @@ ! access to either file, you may request a copy from help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! +! NOTES +! *** IMPORTANT *** +! If you add a new H5D function you must add the function name to the +! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! This is needed for Windows based operating systems. ! -! This file contains Fortran90 interfaces for H5D functions. -! +!***** + MODULE H5D USE H5GLOBAL - INTERFACE h5dwrite_f - - MODULE PROCEDURE h5dwrite_reference_obj - MODULE PROCEDURE h5dwrite_reference_dsetreg - MODULE PROCEDURE h5dwrite_integer_scalar - MODULE PROCEDURE h5dwrite_integer_1 - MODULE PROCEDURE h5dwrite_integer_2 - MODULE PROCEDURE h5dwrite_integer_3 - MODULE PROCEDURE h5dwrite_integer_4 - MODULE PROCEDURE h5dwrite_integer_5 - MODULE PROCEDURE h5dwrite_integer_6 - MODULE PROCEDURE h5dwrite_integer_7 - MODULE PROCEDURE h5dwrite_char_scalar - MODULE PROCEDURE h5dwrite_char_1 - MODULE PROCEDURE h5dwrite_char_2 - MODULE PROCEDURE h5dwrite_char_3 - MODULE PROCEDURE h5dwrite_char_4 - MODULE PROCEDURE h5dwrite_char_5 - MODULE PROCEDURE h5dwrite_char_6 - MODULE PROCEDURE h5dwrite_char_7 - MODULE PROCEDURE h5dwrite_real_scalar - MODULE PROCEDURE h5dwrite_real_1 - MODULE PROCEDURE h5dwrite_real_2 - MODULE PROCEDURE h5dwrite_real_3 - MODULE PROCEDURE h5dwrite_real_4 - MODULE PROCEDURE h5dwrite_real_5 - MODULE PROCEDURE h5dwrite_real_6 - MODULE PROCEDURE h5dwrite_real_7 - END INTERFACE - - INTERFACE h5dread_f - - MODULE PROCEDURE h5dread_reference_obj - MODULE PROCEDURE h5dread_reference_dsetreg - MODULE PROCEDURE h5dread_integer_scalar - MODULE PROCEDURE h5dread_integer_1 - MODULE PROCEDURE h5dread_integer_2 - MODULE PROCEDURE h5dread_integer_3 - MODULE PROCEDURE h5dread_integer_4 - MODULE PROCEDURE h5dread_integer_5 - MODULE PROCEDURE h5dread_integer_6 - MODULE PROCEDURE h5dread_integer_7 - MODULE PROCEDURE h5dread_char_scalar - MODULE PROCEDURE h5dread_char_1 - MODULE PROCEDURE h5dread_char_2 - MODULE PROCEDURE h5dread_char_3 - MODULE PROCEDURE h5dread_char_4 - MODULE PROCEDURE h5dread_char_5 - MODULE PROCEDURE h5dread_char_6 - MODULE PROCEDURE h5dread_char_7 - MODULE PROCEDURE h5dread_real_scalar - MODULE PROCEDURE h5dread_real_1 - MODULE PROCEDURE h5dread_real_2 - MODULE PROCEDURE h5dread_real_3 - MODULE PROCEDURE h5dread_real_4 - MODULE PROCEDURE h5dread_real_5 - MODULE PROCEDURE h5dread_real_6 - MODULE PROCEDURE h5dread_real_7 - END INTERFACE - - INTERFACE h5dwrite_vl_f - MODULE PROCEDURE h5dwrite_vl_integer - MODULE PROCEDURE h5dwrite_vl_real - MODULE PROCEDURE h5dwrite_vl_string + INTERFACE h5dextend_f + MODULE PROCEDURE h5dset_extent_f END INTERFACE INTERFACE h5dread_vl_f @@ -91,53 +48,50 @@ MODULE H5D MODULE PROCEDURE h5dread_vl_string END INTERFACE - INTERFACE h5dfill_f - MODULE PROCEDURE h5dfill_integer - MODULE PROCEDURE h5dfill_real - MODULE PROCEDURE h5dfill_char - END INTERFACE - - INTERFACE h5dextend_f - MODULE PROCEDURE h5dset_extent_f + INTERFACE h5dwrite_vl_f + MODULE PROCEDURE h5dwrite_vl_integer + MODULE PROCEDURE h5dwrite_vl_real + MODULE PROCEDURE h5dwrite_vl_string END INTERFACE - CONTAINS -!---------------------------------------------------------------------- -! Name: h5dcreate_f ! -! Purpose: Creates a dataset at the specified location +!****s* H5D/h5dcreate_f ! -! Inputs: -! loc_id - file or group identifier -! name - dataset name -! type_id - dataset datatype identifier -! space_id - dataset dataspace identifier -! Outputs: -! dset_id - dataset identifier -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! creation_prp - Dataset creation property list -! lcpl_id - Link creation property list -! dapl_id - Dataset access property list +! NAME +! h5dcreate_f ! -! Programmer: Elena Pourmal -! August 12, 1999 +! PURPOSE +! Creates a dataset at the specified location ! -! Modifications: -! - Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). February 28, 2001 +! INPUTS +! loc_id - file or group identifier +! name - dataset name +! type_id - dataset datatype identifier +! space_id - dataset dataspace identifier +! OUTPUTS +! dset_id - dataset identifier +! hdferr - Returns 0 if successful and -1 if fails +! OPTIONAL PARAMETERS +! creation_prp - Dataset creation property list +! lcpl_id - Link creation property list +! dapl_id - Dataset access property list ! -! - Added version's 1.8 new optional parameters -! February, 2008 +! AUTHOR +! Elena Pourmal +! August 12, 1999 ! -! Comment: -!---------------------------------------------------------------------- - +! HISTORY +! +! - Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). February 28, 2001 +! +! - Added version's 1.8 new optional parameters +! February, 2008 +! +! SOURCE SUBROUTINE h5dcreate_f(loc_id, name, type_id, space_id, dset_id, & hdferr, dcpl_id, lcpl_id, dapl_id) IMPLICIT NONE @@ -147,7 +101,7 @@ CONTAINS INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier INTEGER(HID_T), INTENT(OUT) :: dset_id ! Dataset identifier INTEGER, INTENT(OUT) :: hdferr ! Error code - +!***** INTEGER(HID_T), OPTIONAL, INTENT(IN) :: dcpl_id ! Dataset creation property list INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lcpl_id ! Link creation property list INTEGER(HID_T), OPTIONAL, INTENT(IN) :: dapl_id ! Dataset access property list @@ -156,7 +110,7 @@ CONTAINS INTEGER(HID_T) :: dcpl_id_default INTEGER(HID_T) :: dapl_id_default - INTEGER :: namelen ! Name length + INTEGER :: namelen ! Name length ! MS FORTRAN needs explicit interface for C functions called here. ! @@ -196,4176 +150,885 @@ CONTAINS END SUBROUTINE h5dcreate_f -!---------------------------------------------------------------------- -! Name: h5dopen_f ! -! Purpose: Opens an existing dataset. +!****s* H5D/h5dopen_f +! +! NAME +! h5dopen_f ! -! Inputs: -! loc_id - file or group identifier -! name - dataset name -! Outputs: -! dset_id - dataset identifier -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! dapl_id - Dataset access property list +! PURPOSE +! Opens an existing dataset. ! -! Programmer: Elena Pourmal -! August 12, 1999 +! INPUTS +! loc_id - file or group identifier +! name - dataset name +! OUTPUTS +! dset_id - dataset identifier +! hdferr - Returns 0 if successful and -1 if fails +! OPTIONAL PARAMETERS +! dapl_id - Dataset access property list ! -! Modifications: -Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). February 28, 2001 +! AUTHOR +! Elena Pourmal +! August 12, 1999 ! -! -Added 1.8 (optional) parameter dapl_id -! February, 2008, M. Scot Breitenfeld +! HISTORY +! -Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). February 28, 2001 ! -! Comment: -!---------------------------------------------------------------------- +! -Added 1.8 (optional) parameter dapl_id +! February, 2008, M. Scot Breitenfeld +! +! SOURCE + SUBROUTINE h5dopen_f(loc_id, name, dset_id, hdferr, dapl_id) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the dataset + INTEGER(HID_T), INTENT(OUT) :: dset_id ! Dataset identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: dapl_id ! Dataset access property list +!***** + INTEGER :: namelen ! Name length + + INTEGER(HID_T) :: dapl_id_default + + 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$ATTRIBUTES reference :: name + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER :: namelen + INTEGER(HID_T), INTENT(IN) :: dapl_id_default + INTEGER(HID_T), INTENT(OUT) :: dset_id + END FUNCTION h5dopen_c + END INTERFACE + + dapl_id_default = H5P_DEFAULT_F + IF(PRESENT(dapl_id)) dapl_id_default = dapl_id - SUBROUTINE h5dopen_f(loc_id, name, dset_id, hdferr, dapl_id) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the dataset - INTEGER(HID_T), INTENT(OUT) :: dset_id ! Dataset identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: dapl_id ! Dataset access property list - INTEGER :: namelen ! Name length + namelen = LEN(name) + hdferr = h5dopen_c(loc_id, name, namelen, dapl_id_default, dset_id) - INTEGER(HID_T) :: dapl_id_default + END SUBROUTINE h5dopen_f -! INTEGER, EXTERNAL :: h5dopen_c -! MS FORTRAN needs explicit interface for C functions called here. ! - 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$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER :: namelen - INTEGER(HID_T), INTENT(IN) :: dapl_id_default - INTEGER(HID_T), INTENT(OUT) :: dset_id - END FUNCTION h5dopen_c - END INTERFACE - - dapl_id_default = H5P_DEFAULT_F - IF(PRESENT(dapl_id)) dapl_id_default = dapl_id +!****s* H5D/h5dclose_f +! +! NAME +! h5dclose_f +! +! PURPOSE +! Closes a dataset. +! +! INPUTS +! dset_id - dataset identifier +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). February 28, 2001 +! +! SOURCE + SUBROUTINE h5dclose_f(dset_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + 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 + INTEGER(HID_T), INTENT(IN) :: dset_id + END FUNCTION h5dclose_c + END INTERFACE - namelen = LEN(name) - hdferr = h5dopen_c(loc_id, name, namelen, dapl_id_default, dset_id) + hdferr = h5dclose_c(dset_id) - END SUBROUTINE h5dopen_f + END SUBROUTINE h5dclose_f -!---------------------------------------------------------------------- -! Name: h5dclose_f ! -! Purpose: Closes a dataset. +!****s* H5D/h5dget_type_f +! +! NAME +! h5dget_type_f +! +! PURPOSE +! Returns an identifier for a copy of the datatype for a +! dataset. ! -! Inputs: -! dset_id - dataset identifier -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! INPUTS +! dataset_id - dataset identifier +! OUTPUTS +! datatype_id - dataspace identifier +! hdferr - Returns 0 if successful and -1 if fails ! -! Programmer: Elena Pourmal -! August 12, 1999 +! AUTHOR +! Elena Pourmal +! August 12, 1999 ! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). February 28, 2001 +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). February 28, 2001 ! -! Comment: -!---------------------------------------------------------------------- +! NOTES +! +! SOURCE + SUBROUTINE h5dget_type_f(dataset_id, datatype_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dataset_id ! Dataset identifier + INTEGER(HID_T), INTENT(OUT) :: datatype_id ! Datatype identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + 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 + INTEGER(HID_T), INTENT(IN) :: dataset_id + INTEGER(HID_T), INTENT(OUT) :: datatype_id + END FUNCTION h5dget_type_c + END INTERFACE - SUBROUTINE h5dclose_f(dset_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code + hdferr = h5dget_type_c (dataset_id, datatype_id) + END SUBROUTINE h5dget_type_f -! INTEGER, EXTERNAL :: h5dclose_c -! MS FORTRAN needs explicit interface for C functions called here. ! - 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 - INTEGER(HID_T), INTENT(IN) :: dset_id - END FUNCTION h5dclose_c - END INTERFACE +!****s* H5D/h5dset_extent +! +! NAME +! h5dset_extent (instead of obsolete name: h5dextend_f) +! +! PURPOSE +! Extends a dataset with unlimited dimension. +! +! INPUTS +! dataset_id - dataset identifier +! size - array containing the new magnitude of +! each dimension +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). February 28, 2001 +! +! Changed name from the now obsolete h5dextend_f +! to h5dset_extent_f. Provided interface to old name +! for backward compatability. -MSB- March 14, 2008 +! +! SOURCE + SUBROUTINE h5dset_extent_f(dataset_id, size, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dataset_id ! Dataset identifier + INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: size + ! Array containing + ! dimensions' sizes + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + 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 + INTEGER(HID_T), INTENT(IN) :: dataset_id + INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: size + END FUNCTION h5dset_extent_c + END INTERFACE + + hdferr = H5Dset_extent_c(dataset_id, size) + END SUBROUTINE h5dset_extent_f - hdferr = h5dclose_c(dset_id) +!****s* H5D/h5dget_create_plist_f +! +! NAME +! h5dget_create_plist_f +! +! PURPOSE +! Returns an identifier for a copy of the dataset creation +! property list for a dataset. +! +! INPUTS +! dataset_id - dataset identifier +! OUTPUTS +! plist_id - creation property list identifier +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). February 28, 2001 +! SOURCE + SUBROUTINE h5dget_create_plist_f(dataset_id, plist_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dataset_id ! Dataset identifier + INTEGER(HID_T), INTENT(OUT) :: plist_id ! Dataset creation + ! property list identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + 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 + INTEGER(HID_T), INTENT(IN) :: dataset_id + INTEGER(HID_T), INTENT(OUT) :: plist_id + END FUNCTION h5dget_create_plist_c + END INTERFACE - END SUBROUTINE h5dclose_f + hdferr = h5dget_create_plist_c(dataset_id, plist_id) + END SUBROUTINE h5dget_create_plist_f - SUBROUTINE h5dwrite_reference_obj(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: dims ! size of the bufffer buf - TYPE(hobj_ref_t_f), DIMENSION(dims(1)), INTENT(IN) :: buf ! Data buffer - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp - ! Transfer property list identifier +! +!****s* H5D/h5dget_storage_size_f +! +! NAME +! h5dget_storage_size_f +! +! PURPOSE +! Returns the amount of storage requires by a dataset +! +! INPUTS +! dataset_id - dataset identifier +! OUTPUTS +! size - datastorage size +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! October 15, 2002 +! SOURCE + SUBROUTINE h5dget_storage_size_f(dataset_id, size, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dataset_id ! Dataset identifier + INTEGER(HSIZE_T), INTENT(OUT) :: size ! Amount of storage + ! allocated for dataset + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + 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 + INTEGER(HID_T), INTENT(IN) :: dataset_id + INTEGER(HSIZE_T), INTENT(OUT) :: size + END FUNCTION h5dget_storage_size_c + END INTERFACE - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HADDR_T), ALLOCATABLE, DIMENSION(:) :: ref_buf - INTEGER :: j + hdferr = h5dget_storage_size_c(dataset_id, size) + END SUBROUTINE h5dget_storage_size_f -! INTEGER, EXTERNAL :: h5dwrite_ref_obj_c -! MS FORTRAN needs explicit interface for C functions called here. ! - INTERFACE - INTEGER FUNCTION h5dwrite_ref_obj_c(dset_id, mem_type_id,& - 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 - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HADDR_T), DIMENSION(*) :: ref_buf - INTEGER(HSIZE_T), DIMENSION(*) :: dims - END FUNCTION h5dwrite_ref_obj_c - END INTERFACE +!****s* H5D/h5dvlen_get_max_len_f +! +! NAME +! h5dvlen_get_max_len_f +! +! PURPOSE +! Returns maximum length of the VL array elements +! +! INPUTS +! dataset_id - dataset identifier +! type_id - datatype identifier +! space_id - dataspace identifier +! OUTPUTS +! size - buffer size +! hdferr - Returns 0 if successful and -1 if fails +! OPTIONAL PARAMETERS +! NONE +! +! AUTHOR +! Elena Pourmal +! October 15, 2002 +! +! SOURCE + SUBROUTINE h5dvlen_get_max_len_f(dataset_id, type_id, space_id, len, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dataset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier + INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier + INTEGER(SIZE_T), INTENT(OUT) :: len ! Maximum length of the element + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + 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 + INTEGER(HID_T), INTENT(IN) :: dataset_id + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER(SIZE_T), INTENT(OUT) :: len + END FUNCTION h5dvlen_get_max_len_c + END INTERFACE - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F + hdferr = h5dvlen_get_max_len_c(dataset_id, type_id, space_id, len) + END SUBROUTINE h5dvlen_get_max_len_f - if (present(xfer_prp)) xfer_prp_default = xfer_prp - if (present(mem_space_id)) mem_space_id_default = mem_space_id - if (present(file_space_id)) file_space_id_default = file_space_id +! +!****s* H5D/h5dget_space_status_f +! +! NAME +! h5dget_space_status_f +! +! PURPOSE +! Returns the status of data space allocation. +! +! INPUTS +! dset_id - dataset identifier +! OUTPUTS +! flag - status; may have one of the following values: +! H5D_SPACE_STS_ERROR_F +! H5D_SPACE_STS_NOT_ALLOCATED_F +! H5D_SPACE_STS_PART_ALLOCATED_F +! H5D_SPACE_STS_ALLOCATED_F +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! March 12, 2003 +! +! SOURCE + SUBROUTINE h5dget_space_status_f(dset_id, flag, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataspace identifier + INTEGER, INTENT(OUT) :: flag ! Memory buffer to fill in + INTEGER, INTENT(OUT) :: hdferr ! Error code + !***** + 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 + INTEGER(HID_T) :: dset_id + INTEGER :: flag + END FUNCTION h5dget_space_status_c + END INTERFACE - allocate(ref_buf(dims(1)), stat=hdferr) - if (hdferr .NE. 0 ) then - hdferr = -1 - return - else - do j = 1, dims(1) - ref_buf(j) = buf(j)%ref - enddo - endif - hdferr = h5dwrite_ref_obj_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, ref_buf, dims(1)) - deallocate(ref_buf) + hdferr = h5dget_space_status_c(dset_id, flag) + END SUBROUTINE h5dget_space_status_f - END SUBROUTINE h5dwrite_reference_obj +! +!****s* H5D/h5dcreate_anon_f +! +! NAME +! h5dcreate_anon_f +! +! PURPOSE +! Creates a dataset in a file without linking it into the file structure +! +! INPUTS +! loc_id - Identifier of the file or group within which to create the dataset. +! type_id - Identifier of the datatype to use when creating the dataset. +! space_id - Identifier of the dataspace to use when creating the dataset. +! OUTPUTS +! dset_id - dataset identifier +! hdferr - Returns 0 if successful and -1 if fails +! OPTIONAL PARAMETERS +! dcpl_id - Dataset creation property list identifier. +! dapl_id - Dataset access property list identifier. +! +! AUTHOR +! M. Scot Breitenfeld +! February 11, 2008 +! +! SOURCE + SUBROUTINE h5dcreate_anon_f(loc_id, type_id, space_id, dset_id, hdferr, dcpl_id, dapl_id) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier. + INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier. + INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier. + INTEGER(HID_T), INTENT(OUT) :: dset_id ! Dataset identifier. + INTEGER, INTENT(OUT) :: hdferr ! Error code. + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: dcpl_id ! Dataset creation property list identifier. + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: dapl_id ! Dataset access property list identifier. +!***** + INTEGER(HID_T) :: dcpl_id_default + INTEGER(HID_T) :: dapl_id_default - SUBROUTINE h5dwrite_reference_dsetreg(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: dims ! size of the bufffer buf - TYPE(hdset_reg_ref_t_f), DIMENSION(dims(1)), INTENT(IN) :: buf ! Data buffer - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp - ! Transfer property list identifier + ! + ! MS FORTRAN needs explicit interface for C functions called here. + ! + 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 + INTEGER(HID_T), INTENT(IN) :: loc_id + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER(HID_T) :: dcpl_id_default + INTEGER(HID_T) :: dapl_id_default + INTEGER(HID_T), INTENT(OUT) :: dset_id + END FUNCTION h5dcreate_anon_c + END INTERFACE - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER, ALLOCATABLE, DIMENSION(:) :: ref_buf - INTEGER :: i,j + dcpl_id_default = H5P_DEFAULT_F + dapl_id_default = H5P_DEFAULT_F -! INTEGER, EXTERNAL :: h5dwrite_ref_reg_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5dwrite_ref_reg_c(dset_id, mem_type_id,& - 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 - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER, DIMENSION(*) :: ref_buf - INTEGER(HSIZE_T), DIMENSION(*) :: dims - END FUNCTION h5dwrite_ref_reg_c - END INTERFACE + IF(PRESENT(dcpl_id)) dcpl_id_default = dcpl_id + IF(PRESENT(dapl_id)) dapl_id_default = dapl_id + hdferr = h5dcreate_anon_c(loc_id, type_id, space_id, dcpl_id_default, dapl_id_default, dset_id) - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F + END SUBROUTINE h5dcreate_anon_f - if (present(xfer_prp)) xfer_prp_default = xfer_prp - if (present(mem_space_id)) mem_space_id_default = mem_space_id - if (present(file_space_id)) file_space_id_default = file_space_id + SUBROUTINE h5dwrite_vl_integer(dset_id, mem_type_id, buf, dims, len, & + hdferr, & + mem_space_id, file_space_id, xfer_prp) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(2) :: dims ! MAX len x num_elem + INTEGER(SIZE_T), INTENT(IN), DIMENSION(*) :: len ! Array to store + ! the length of each + ! element + INTEGER, INTENT(IN), & + DIMENSION(dims(1),dims(2)), TARGET :: buf ! Data buffer + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default - allocate(ref_buf(REF_REG_BUF_LEN*dims(1)), stat=hdferr) - if (hdferr .NE. 0 ) then - hdferr = -1 - return - else - do j = 1, dims(1) - do i = 1, REF_REG_BUF_LEN - ref_buf(REF_REG_BUF_LEN*(j-1) + i) = buf(j)%ref(i) - enddo - enddo - endif - hdferr = h5dwrite_ref_reg_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, ref_buf, dims) - deallocate(ref_buf) + INTERFACE + INTEGER FUNCTION h5dwrite_vl_integer_c(dset_id, mem_type_id, & + mem_space_id_default, & + 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 + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + INTEGER(SIZE_T), INTENT(IN), DIMENSION(*) :: len + INTEGER, INTENT(IN), & + DIMENSION(dims(1),dims(2)) :: buf + END FUNCTION h5dwrite_vl_integer_c + END INTERFACE - END SUBROUTINE h5dwrite_reference_dsetreg + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF (PRESENT(file_space_id)) file_space_id_default = file_space_id - SUBROUTINE h5dwrite_integer_scalar(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER, INTENT(IN) :: buf ! Data buffer - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp - ! Transfer property list identifier + hdferr = h5dwrite_vl_integer_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, & + buf, dims, len) - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default + END SUBROUTINE h5dwrite_vl_integer -! INTEGER, EXTERNAL :: h5dwrite_integer_s_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5dwrite_integer_s_c(dset_id, mem_type_id, & - mem_space_id_default, & - 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 - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(IN) :: buf - END FUNCTION h5dwrite_integer_s_c - END INTERFACE + SUBROUTINE h5dread_vl_integer(dset_id, mem_type_id, buf, dims, len, & + hdferr, & + mem_space_id, file_space_id, xfer_prp) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(2) :: dims ! MAX len x num_elem + INTEGER(SIZE_T), INTENT(INOUT), DIMENSION(*) :: len ! Array to store + ! the length of each + ! element + INTEGER, INTENT(INOUT), & + DIMENSION(dims(1),dims(2)), TARGET :: buf ! Data buffer + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! -1 if failed, 0 otherwise + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HID_T) :: tmp + INTEGER :: error + INTERFACE + INTEGER FUNCTION h5dread_vl_integer_c(dset_id, mem_type_id, & + mem_space_id_default, & + 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 + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + INTEGER(SIZE_T), INTENT(INOUT), DIMENSION(*) :: len + INTEGER, INTENT(INOUT), & + DIMENSION(dims(1),dims(2)) :: buf + END FUNCTION h5dread_vl_integer_c + END INTERFACE - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F + CALL h5dget_space_f(dset_id, tmp, error) + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = tmp + file_space_id_default = tmp - if (present(xfer_prp)) xfer_prp_default = xfer_prp - if (present(mem_space_id)) mem_space_id_default = mem_space_id - if (present(file_space_id)) file_space_id_default = file_space_id + IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF (PRESENT(file_space_id)) file_space_id_default = file_space_id - hdferr = h5dwrite_integer_s_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) + hdferr = h5dread_vl_integer_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, & + buf, dims, len) - END SUBROUTINE h5dwrite_integer_scalar + END SUBROUTINE h5dread_vl_integer - SUBROUTINE h5dwrite_integer_1(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(IN), & - DIMENSION(dims(1)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp - ! Transfer property list identifier + SUBROUTINE h5dwrite_vl_real(dset_id, mem_type_id, buf, dims, len, & + hdferr, & + mem_space_id, file_space_id, xfer_prp) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(2) :: dims ! MAX len x num_elem + INTEGER(SIZE_T), INTENT(IN), DIMENSION(*) :: len ! Array to store + ! the length of each + ! element + REAL, INTENT(IN), & + DIMENSION(dims(1),dims(2)) :: buf ! Data buffer + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default -! INTEGER, EXTERNAL :: h5dwrite_integer_1_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5dwrite_integer_1_c(dset_id, mem_type_id, & - mem_space_id_default, & - 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 - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(IN), & - DIMENSION(dims(1)) :: buf - END FUNCTION h5dwrite_integer_1_c - END INTERFACE + INTERFACE + INTEGER FUNCTION h5dwrite_vl_real_c(dset_id, mem_type_id, & + mem_space_id_default, & + 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 + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + INTEGER(SIZE_T), INTENT(IN), DIMENSION(*) :: len + REAL, INTENT(IN), & + DIMENSION(dims(1),dims(2)) :: buf + END FUNCTION h5dwrite_vl_real_c + END INTERFACE - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F - if (present(xfer_prp)) xfer_prp_default = xfer_prp - if (present(mem_space_id)) mem_space_id_default = mem_space_id - if (present(file_space_id)) file_space_id_default = file_space_id + IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF (PRESENT(file_space_id)) file_space_id_default = file_space_id - hdferr = h5dwrite_integer_1_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) + hdferr = h5dwrite_vl_real_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, & + buf, dims, len) - END SUBROUTINE h5dwrite_integer_1 + END SUBROUTINE h5dwrite_vl_real - SUBROUTINE h5dwrite_integer_2(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(IN), & - DIMENSION(dims(1),dims(2)) :: buf ! Data buffer - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp - ! Transfer property list identifier + SUBROUTINE h5dread_vl_real(dset_id, mem_type_id, buf, dims, len, & + hdferr, & + mem_space_id, file_space_id, xfer_prp) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(2) :: dims ! MAX len x num_elem + INTEGER(SIZE_T), INTENT(INOUT), DIMENSION(*) :: len ! Array to store the length of each element + REAL, INTENT(INOUT), & + DIMENSION(dims(1),dims(2)) :: buf ! Data buffer + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! -1 if failed, 0 otherwise + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HID_T) :: tmp + INTEGER :: error -! INTEGER, EXTERNAL :: h5dwrite_integer_2_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5dwrite_integer_2_c(dset_id, mem_type_id, & - mem_space_id_default, & - 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 - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(IN), & + INTERFACE + INTEGER FUNCTION h5dread_vl_real_c(dset_id, mem_type_id, & + mem_space_id_default, & + 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 + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + INTEGER(SIZE_T), INTENT(INOUT), DIMENSION(*) :: len + REAL, INTENT(INOUT), & DIMENSION(dims(1),dims(2)) :: buf - END FUNCTION h5dwrite_integer_2_c - END INTERFACE + END FUNCTION h5dread_vl_real_c + END INTERFACE + CALL h5dget_space_f(dset_id, tmp, error) + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = tmp + file_space_id_default = tmp - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F + IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF (PRESENT(file_space_id)) file_space_id_default = file_space_id - if (present(xfer_prp)) xfer_prp_default = xfer_prp - if (present(mem_space_id)) mem_space_id_default = mem_space_id - if (present(file_space_id)) file_space_id_default = file_space_id - hdferr = h5dwrite_integer_2_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, & - buf, dims) + hdferr = h5dread_vl_real_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, & + buf, dims, len) - END SUBROUTINE h5dwrite_integer_2 + END SUBROUTINE h5dread_vl_real - SUBROUTINE h5dwrite_integer_3(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp - ! Transfer property list identifier + SUBROUTINE h5dwrite_vl_string(dset_id, mem_type_id, buf, dims, str_len, & + hdferr, & + mem_space_id, file_space_id, xfer_prp) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(2) :: dims ! Number of strings + INTEGER(SIZE_T), INTENT(IN), DIMENSION(*) :: str_len ! Array to store the length of each element + CHARACTER(LEN=*), INTENT(IN), & + DIMENSION(dims(2)) :: buf ! Data buffer + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default + INTERFACE + INTEGER FUNCTION h5dwrite_vl_string_c(dset_id, mem_type_id, & + mem_space_id_default, & + file_space_id_default, & + ! 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$ATTRIBUTES reference :: buf + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(2) :: dims + INTEGER(SIZE_T), INTENT(IN), DIMENSION(*) :: str_len + CHARACTER(LEN=*), DIMENSION(dims(2)) :: buf + END FUNCTION + END INTERFACE -! INTEGER, EXTERNAL :: h5dwrite_integer_3_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5dwrite_integer_3_c(dset_id, mem_type_id, & - mem_space_id_default, & - 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 - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3)) :: buf - END FUNCTION h5dwrite_integer_3_c - END INTERFACE + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F + IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF (PRESENT(file_space_id)) file_space_id_default = file_space_id - if (present(xfer_prp)) xfer_prp_default = xfer_prp - if (present(mem_space_id)) mem_space_id_default = mem_space_id - if (present(file_space_id)) file_space_id_default = file_space_id + hdferr = h5dwrite_vl_string_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, & + buf, dims, str_len) - hdferr = h5dwrite_integer_3_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, & - buf, dims) + END SUBROUTINE h5dwrite_vl_string - END SUBROUTINE h5dwrite_integer_3 - - SUBROUTINE h5dwrite_integer_4(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp - ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - -! INTEGER, EXTERNAL :: h5dwrite_integer_4_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5dwrite_integer_4_c(dset_id, mem_type_id, & - mem_space_id_default, & - 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 - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf - END FUNCTION h5dwrite_integer_4_c - END INTERFACE - - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - if (present(xfer_prp)) xfer_prp_default = xfer_prp - if (present(mem_space_id)) mem_space_id_default = mem_space_id - if (present(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dwrite_integer_4_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, & - buf, dims) - - END SUBROUTINE h5dwrite_integer_4 - - SUBROUTINE h5dwrite_integer_5(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp - ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - -! INTEGER, EXTERNAL :: h5dwrite_integer_5_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5dwrite_integer_5_c(dset_id, mem_type_id, & - mem_space_id_default, & - 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 - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf - END FUNCTION h5dwrite_integer_5_c - END INTERFACE - - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - - if (present(xfer_prp)) xfer_prp_default = xfer_prp - if (present(mem_space_id)) mem_space_id_default = mem_space_id - if (present(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dwrite_integer_5_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, & - buf, dims) - - END SUBROUTINE h5dwrite_integer_5 - - SUBROUTINE h5dwrite_integer_6(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp - ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - -! INTEGER, EXTERNAL :: h5dwrite_integer_6_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5dwrite_integer_6_c(dset_id, mem_type_id, & - mem_space_id_default, & - 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 - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf - END FUNCTION h5dwrite_integer_6_c - END INTERFACE - - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - if (present(xfer_prp)) xfer_prp_default = xfer_prp - if (present(mem_space_id)) mem_space_id_default = mem_space_id - if (present(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dwrite_integer_6_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, & - buf, dims) - - END SUBROUTINE h5dwrite_integer_6 - - SUBROUTINE h5dwrite_integer_7(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp - ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - -! INTEGER, EXTERNAL :: h5dwrite_integer_7_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5dwrite_integer_7_c(dset_id, mem_type_id, & - mem_space_id_default, & - 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 - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf - END FUNCTION h5dwrite_integer_7_c - END INTERFACE - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - if (present(xfer_prp)) xfer_prp_default = xfer_prp - if (present(mem_space_id)) mem_space_id_default = mem_space_id - if (present(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dwrite_integer_7_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, & - buf, dims) - - END SUBROUTINE h5dwrite_integer_7 - - - SUBROUTINE h5dwrite_char_scalar(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(IN) :: buf ! Data buffer - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp - ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - -! INTEGER, EXTERNAL :: h5dwritec_s_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5dwritec_s_c(dset_id, mem_type_id, & - mem_space_id_default, & - 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$ATTRIBUTES reference :: buf - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(IN) :: buf - END FUNCTION h5dwritec_s_c - END INTERFACE - - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - if (present(xfer_prp)) xfer_prp_default = xfer_prp - if (present(mem_space_id)) mem_space_id_default = mem_space_id - if (present(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dwritec_s_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dwrite_char_scalar - - SUBROUTINE h5dwrite_char_1(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(IN), & - DIMENSION(dims(1)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp - ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - -! INTEGER, EXTERNAL :: h5dwritec_1_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5dwritec_1_c(dset_id, mem_type_id, & - mem_space_id_default, & - 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$ATTRIBUTES reference :: buf - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(IN), & - DIMENSION(dims(1)) :: buf - END FUNCTION h5dwritec_1_c - END INTERFACE - - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - if (present(xfer_prp)) xfer_prp_default = xfer_prp - if (present(mem_space_id)) mem_space_id_default = mem_space_id - if (present(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dwritec_1_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dwrite_char_1 - - SUBROUTINE h5dwrite_char_2(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(IN), & - DIMENSION(dims(1),dims(2)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp - ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - -! INTEGER, EXTERNAL :: h5dwritec_2_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5dwritec_2_c(dset_id, mem_type_id, & - mem_space_id_default, & - 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$ATTRIBUTES reference :: buf - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(IN), & - DIMENSION(dims(1),dims(2)) :: buf - END FUNCTION h5dwritec_2_c - END INTERFACE - - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - if (present(xfer_prp)) xfer_prp_default = xfer_prp - if (present(mem_space_id)) mem_space_id_default = mem_space_id - if (present(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dwritec_2_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dwrite_char_2 - - SUBROUTINE h5dwrite_char_3(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp - ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - -! INTEGER, EXTERNAL :: h5dwritec_3_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5dwritec_3_c(dset_id, mem_type_id, & - mem_space_id_default, & - 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$ATTRIBUTES reference :: buf - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3)) :: buf - END FUNCTION h5dwritec_3_c - END INTERFACE - - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - if (present(xfer_prp)) xfer_prp_default = xfer_prp - if (present(mem_space_id)) mem_space_id_default = mem_space_id - if (present(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dwritec_3_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dwrite_char_3 - - SUBROUTINE h5dwrite_char_4(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp - ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - -! INTEGER, EXTERNAL :: h5dwritec_4_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5dwritec_4_c(dset_id, mem_type_id, & - mem_space_id_default, & - 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$ATTRIBUTES reference :: buf - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf - END FUNCTION h5dwritec_4_c - END INTERFACE - - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - if (present(xfer_prp)) xfer_prp_default = xfer_prp - if (present(mem_space_id)) mem_space_id_default = mem_space_id - if (present(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dwritec_4_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dwrite_char_4 - - SUBROUTINE h5dwrite_char_5(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp - ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - -! INTEGER, EXTERNAL :: h5dwritec_5_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5dwritec_5_c(dset_id, mem_type_id, & - mem_space_id_default, & - 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$ATTRIBUTES reference :: buf - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf - END FUNCTION h5dwritec_5_c - END INTERFACE - - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - if (present(xfer_prp)) xfer_prp_default = xfer_prp - if (present(mem_space_id)) mem_space_id_default = mem_space_id - if (present(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dwritec_5_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dwrite_char_5 - - SUBROUTINE h5dwrite_char_6(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp - ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - -! INTEGER, EXTERNAL :: h5dwritec_6_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5dwritec_6_c(dset_id, mem_type_id, & - mem_space_id_default, & - 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$ATTRIBUTES reference :: buf - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf - END FUNCTION h5dwritec_6_c - END INTERFACE - - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - if (present(xfer_prp)) xfer_prp_default = xfer_prp - if (present(mem_space_id)) mem_space_id_default = mem_space_id - if (present(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dwritec_6_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dwrite_char_6 - - SUBROUTINE h5dwrite_char_7(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp - ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - -! INTEGER, EXTERNAL :: h5dwritec_7_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5dwritec_7_c(dset_id, mem_type_id, & - mem_space_id_default, & - 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$ATTRIBUTES reference :: buf - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf - END FUNCTION h5dwritec_7_c - END INTERFACE - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - if (present(xfer_prp)) xfer_prp_default = xfer_prp - if (present(mem_space_id)) mem_space_id_default = mem_space_id - if (present(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dwritec_7_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dwrite_char_7 - - SUBROUTINE h5dwrite_real_scalar(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(IN) :: buf ! Data buffer - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp - ! Transfer property list identifier - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - -! INTEGER, EXTERNAL :: h5dwrite_real_s_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5dwrite_real_s_c(dset_id, mem_type_id, & - mem_space_id_default, & - 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 - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(IN) :: buf - END FUNCTION h5dwrite_real_s_c - END INTERFACE - - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - if (present(xfer_prp)) xfer_prp_default = xfer_prp - if (present(mem_space_id)) mem_space_id_default = mem_space_id - if (present(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dwrite_real_s_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dwrite_real_scalar - - SUBROUTINE h5dwrite_real_1(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(IN), & - DIMENSION(dims(1)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp - ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - -! INTEGER, EXTERNAL :: h5dwrite_real_1_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5dwrite_real_1_c(dset_id, mem_type_id, & - mem_space_id_default, & - 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 - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(IN), & - DIMENSION(dims(1)) :: buf - END FUNCTION h5dwrite_real_1_c - END INTERFACE - - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - if (present(xfer_prp)) xfer_prp_default = xfer_prp - if (present(mem_space_id)) mem_space_id_default = mem_space_id - if (present(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dwrite_real_1_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dwrite_real_1 - - SUBROUTINE h5dwrite_real_2(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(IN), & - DIMENSION(dims(1),dims(2)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp - ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - -! INTEGER, EXTERNAL :: h5dwrite_real_2_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5dwrite_real_2_c(dset_id, mem_type_id, & - mem_space_id_default, & - 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 - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(IN), & - DIMENSION(dims(1),dims(2)) :: buf - END FUNCTION h5dwrite_real_2_c - END INTERFACE - - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - if (present(xfer_prp)) xfer_prp_default = xfer_prp - if (present(mem_space_id)) mem_space_id_default = mem_space_id - if (present(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dwrite_real_2_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dwrite_real_2 - - SUBROUTINE h5dwrite_real_3(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp - ! Transfer property list identifier - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - -! INTEGER, EXTERNAL :: h5dwrite_real_3_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5dwrite_real_3_c(dset_id, mem_type_id, & - mem_space_id_default, & - 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 - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3)) :: buf - END FUNCTION h5dwrite_real_3_c - END INTERFACE - - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - if (present(xfer_prp)) xfer_prp_default = xfer_prp - if (present(mem_space_id)) mem_space_id_default = mem_space_id - if (present(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dwrite_real_3_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dwrite_real_3 - - SUBROUTINE h5dwrite_real_4(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp - ! Transfer property list identifier - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - -! INTEGER, EXTERNAL :: h5dwrite_real_4_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5dwrite_real_4_c(dset_id, mem_type_id, & - mem_space_id_default, & - 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 - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf - END FUNCTION h5dwrite_real_4_c - END INTERFACE - - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - if (present(xfer_prp)) xfer_prp_default = xfer_prp - if (present(mem_space_id)) mem_space_id_default = mem_space_id - if (present(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dwrite_real_4_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dwrite_real_4 - - SUBROUTINE h5dwrite_real_5(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp - ! Transfer property list identifier - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - -! INTEGER, EXTERNAL :: h5dwrite_real_5_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5dwrite_real_5_c(dset_id, mem_type_id, & - mem_space_id_default, & - 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 - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf - END FUNCTION h5dwrite_real_5_c - END INTERFACE - - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - if (present(xfer_prp)) xfer_prp_default = xfer_prp - if (present(mem_space_id)) mem_space_id_default = mem_space_id - if (present(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dwrite_real_5_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dwrite_real_5 - - SUBROUTINE h5dwrite_real_6(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp - ! Transfer property list identifier - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - -! INTEGER, EXTERNAL :: h5dwrite_real_6_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5dwrite_real_6_c(dset_id, mem_type_id, & - mem_space_id_default, & - 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 - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf - END FUNCTION h5dwrite_real_6_c - END INTERFACE - - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - if (present(xfer_prp)) xfer_prp_default = xfer_prp - if (present(mem_space_id)) mem_space_id_default = mem_space_id - if (present(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dwrite_real_6_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dwrite_real_6 - - SUBROUTINE h5dwrite_real_7(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp - ! Transfer property list identifier - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - -! INTEGER, EXTERNAL :: h5dwrite_real_7_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5dwrite_real_7_c(dset_id, mem_type_id, & - mem_space_id_default, & - 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 - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(IN), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf - END FUNCTION h5dwrite_real_7_c - END INTERFACE - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - if (present(xfer_prp)) xfer_prp_default = xfer_prp - if (present(mem_space_id)) mem_space_id_default = mem_space_id - if (present(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dwrite_real_7_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dwrite_real_7 - -!---------------------------------------------------------------------- -! Name: h5dread_f -! -! Purpose: Reads raw data from the specified dataset into buf, -! converting from file datatype and dataspace to memory -! datatype and dataspace. -! -! Inputs: -! dset_id - dataset identifier -! mem_type_id - memory type identifier -! dims - 1-dim array of size 7; dims(k) has the size -! - of k-th dimension of the buf array -! Outputs: -! buf - buffer to read data in -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! mem_space_id - memory dataspace identifier -! file_space_id - file dataspace identifier -! xfer_prp - trasfer property list identifier -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). February 28, 2001 -! -! dims parameter was added to make code portable; -! n parameter was replaced with dims parameter in -! the h5dwrite_reference_obj and h5dwrite_reference_dsetreg -! functions. April 2, 2001 -! -! Comment: This function is overloaded to read INTEGER, -! REAL, DOUBLE PRECISION and CHARACTER buffers -! up to 7 dimensions, and one dimensional buffers -! of the TYPE(hobj_ref_t_f) and TYPE(hdset_reg_ref_t_f) -! types. -!---------------------------------------------------------------------- - SUBROUTINE h5dread_reference_obj(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - TYPE(hobj_ref_t_f), INTENT(INOUT) , & - DIMENSION(dims(1)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp - ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HADDR_T), ALLOCATABLE, DIMENSION(:) :: ref_buf - INTEGER :: j - -! INTEGER, EXTERNAL :: h5dread_ref_obj_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5dread_ref_obj_c(dset_id, mem_type_id,& - 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 - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER(HADDR_T), DIMENSION(*) :: ref_buf - END FUNCTION h5dread_ref_obj_c - END INTERFACE - - allocate(ref_buf(dims(1)), stat=hdferr) - if (hdferr .NE. 0) then - hdferr = -1 - return - endif - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - if (present(xfer_prp)) xfer_prp_default = xfer_prp - if (present(mem_space_id)) mem_space_id_default = mem_space_id - if (present(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dread_ref_obj_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, ref_buf, dims) - do j = 1, dims(1) - buf(j)%ref = ref_buf(j) - enddo - deallocate(ref_buf) - END SUBROUTINE h5dread_reference_obj - - SUBROUTINE h5dread_reference_dsetreg(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - TYPE(hdset_reg_ref_t_f), INTENT(INOUT), & - DIMENSION(dims(1)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp - ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER, ALLOCATABLE, DIMENSION(:) :: ref_buf - INTEGER :: i,j - -! INTEGER, EXTERNAL :: h5dread_ref_reg_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5dread_ref_reg_c(dset_id, mem_type_id,& - 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 - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, DIMENSION(*) :: ref_buf - END FUNCTION h5dread_ref_reg_c - END INTERFACE - - allocate(ref_buf(REF_REG_BUF_LEN*dims(1)), stat=hdferr) - if (hdferr .NE. 0) then - hdferr = -1 - return - endif - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - if (present(xfer_prp)) xfer_prp_default = xfer_prp - if (present(mem_space_id)) mem_space_id_default = mem_space_id - if (present(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dread_ref_reg_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, ref_buf, dims) - - do j = 1, dims(1) - do i = 1, REF_REG_BUF_LEN - buf(j)%ref(i) = ref_buf(REF_REG_BUF_LEN*(j-1) + i) - enddo - enddo - deallocate(ref_buf) - END SUBROUTINE h5dread_reference_dsetreg - - - SUBROUTINE h5dread_integer_scalar(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(INOUT) :: buf ! Data buffer - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp - ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - -! INTEGER, EXTERNAL :: h5dread_integer_s_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5dread_integer_s_c(dset_id, mem_type_id, & - mem_space_id_default, & - 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 - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(OUT) :: buf - END FUNCTION h5dread_integer_s_c - END INTERFACE - - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - if (present(xfer_prp)) xfer_prp_default = xfer_prp - if (present(mem_space_id)) mem_space_id_default = mem_space_id - if (present(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dread_integer_s_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dread_integer_scalar - - SUBROUTINE h5dread_integer_1(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(INOUT), & - DIMENSION(dims(1)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp - ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - -! INTEGER, EXTERNAL :: h5dread_integer_1_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5dread_integer_1_c(dset_id, mem_type_id, & - mem_space_id_default, & - 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 - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(OUT), & - DIMENSION(dims(1)) :: buf - END FUNCTION h5dread_integer_1_c - END INTERFACE - - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - if (present(xfer_prp)) xfer_prp_default = xfer_prp - if (present(mem_space_id)) mem_space_id_default = mem_space_id - if (present(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dread_integer_1_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dread_integer_1 - - SUBROUTINE h5dread_integer_2(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(INOUT), & - DIMENSION(dims(1),dims(2)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp - ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - -! INTEGER, EXTERNAL :: h5dread_integer_2_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5dread_integer_2_c(dset_id, mem_type_id, & - mem_space_id_default, & - 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 - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(OUT), & - DIMENSION(dims(1),dims(2)) :: buf - END FUNCTION h5dread_integer_2_c - END INTERFACE - - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - if (present(xfer_prp)) xfer_prp_default = xfer_prp - if (present(mem_space_id)) mem_space_id_default = mem_space_id - if (present(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dread_integer_2_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, & - buf, dims) - - END SUBROUTINE h5dread_integer_2 - - SUBROUTINE h5dread_integer_3(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp - ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - -! INTEGER, EXTERNAL :: h5dread_integer_3_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5dread_integer_3_c(dset_id, mem_type_id, & - mem_space_id_default, & - 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 - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(OUT), & - DIMENSION(dims(1),dims(2),dims(3)) :: buf - END FUNCTION h5dread_integer_3_c - END INTERFACE - - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - if (present(xfer_prp)) xfer_prp_default = xfer_prp - if (present(mem_space_id)) mem_space_id_default = mem_space_id - if (present(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dread_integer_3_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, & - buf, dims) - - END SUBROUTINE h5dread_integer_3 - - SUBROUTINE h5dread_integer_4(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp - ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - -! INTEGER, EXTERNAL :: h5dread_integer_4_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5dread_integer_4_c(dset_id, mem_type_id, & - mem_space_id_default, & - 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 - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(OUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf - END FUNCTION h5dread_integer_4_c - END INTERFACE - - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - if (present(xfer_prp)) xfer_prp_default = xfer_prp - if (present(mem_space_id)) mem_space_id_default = mem_space_id - if (present(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dread_integer_4_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, & - buf, dims) - - END SUBROUTINE h5dread_integer_4 - - SUBROUTINE h5dread_integer_5(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp - ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - -! INTEGER, EXTERNAL :: h5dread_integer_5_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5dread_integer_5_c(dset_id, mem_type_id, & - mem_space_id_default, & - 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 - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf - END FUNCTION h5dread_integer_5_c - END INTERFACE - - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - if (present(xfer_prp)) xfer_prp_default = xfer_prp - if (present(mem_space_id)) mem_space_id_default = mem_space_id - if (present(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dread_integer_5_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, & - buf, dims) - - END SUBROUTINE h5dread_integer_5 - - SUBROUTINE h5dread_integer_6(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp - ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - -! INTEGER, EXTERNAL :: h5dread_integer_6_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5dread_integer_6_c(dset_id, mem_type_id, & - mem_space_id_default, & - 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 - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf - END FUNCTION h5dread_integer_6_c - END INTERFACE - - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - if (present(xfer_prp)) xfer_prp_default = xfer_prp - if (present(mem_space_id)) mem_space_id_default = mem_space_id - if (present(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dread_integer_6_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, & - buf, dims) - - END SUBROUTINE h5dread_integer_6 - - SUBROUTINE h5dread_integer_7(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp - ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - -! INTEGER, EXTERNAL :: h5dread_integer_7_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5dread_integer_7_c(dset_id, mem_type_id, & - mem_space_id_default, & - 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 - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf - END FUNCTION h5dread_integer_7_c - END INTERFACE - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - if (present(xfer_prp)) xfer_prp_default = xfer_prp - if (present(mem_space_id)) mem_space_id_default = mem_space_id - if (present(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dread_integer_7_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, & - buf, dims) - - END SUBROUTINE h5dread_integer_7 - - SUBROUTINE h5dread_char_scalar(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(INOUT) :: buf ! Data buffer - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp - ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - -! INTEGER, EXTERNAL :: h5dreadc_s_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5dreadc_s_c(dset_id, mem_type_id, & - mem_space_id_default, & - 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$ATTRIBUTES reference :: buf - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(OUT) :: buf - END FUNCTION h5dreadc_s_c - END INTERFACE - - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - if (present(xfer_prp)) xfer_prp_default = xfer_prp - if (present(mem_space_id)) mem_space_id_default = mem_space_id - if (present(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dreadc_s_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dread_char_scalar - - SUBROUTINE h5dread_char_1(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(INOUT), & - DIMENSION(dims(1)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp - ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - -! INTEGER, EXTERNAL :: h5dreadc_1_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5dreadc_1_c(dset_id, mem_type_id, & - mem_space_id_default, & - 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$ATTRIBUTES reference :: buf - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(INOUT), & - DIMENSION(dims(1)) :: buf - END FUNCTION h5dreadc_1_c - END INTERFACE - - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - if (present(xfer_prp)) xfer_prp_default = xfer_prp - if (present(mem_space_id)) mem_space_id_default = mem_space_id - if (present(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dreadc_1_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dread_char_1 - - SUBROUTINE h5dread_char_2(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(INOUT), & - DIMENSION(dims(1),dims(2)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp - ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - -! INTEGER, EXTERNAL :: h5dreadc_2_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5dreadc_2_c(dset_id, mem_type_id, & - mem_space_id_default, & - 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$ATTRIBUTES reference :: buf - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(INOUT), & - DIMENSION(dims(1),dims(2)) :: buf - END FUNCTION h5dreadc_2_c - END INTERFACE - - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - if (present(xfer_prp)) xfer_prp_default = xfer_prp - if (present(mem_space_id)) mem_space_id_default = mem_space_id - if (present(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dreadc_2_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dread_char_2 - - SUBROUTINE h5dread_char_3(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp - ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - -! INTEGER, EXTERNAL :: h5dreadc_3_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5dreadc_3_c(dset_id, mem_type_id, & - mem_space_id_default, & - 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$ATTRIBUTES reference :: buf - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3)) :: buf - END FUNCTION h5dreadc_3_c - END INTERFACE - - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - if (present(xfer_prp)) xfer_prp_default = xfer_prp - if (present(mem_space_id)) mem_space_id_default = mem_space_id - if (present(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dreadc_3_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dread_char_3 - - SUBROUTINE h5dread_char_4(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp - ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - -! INTEGER, EXTERNAL :: h5dreadc_4_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5dreadc_4_c(dset_id, mem_type_id, & - mem_space_id_default, & - 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$ATTRIBUTES reference :: buf - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf - END FUNCTION h5dreadc_4_c - END INTERFACE - - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - if (present(xfer_prp)) xfer_prp_default = xfer_prp - if (present(mem_space_id)) mem_space_id_default = mem_space_id - if (present(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dreadc_4_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dread_char_4 - - SUBROUTINE h5dread_char_5(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp - ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - -! INTEGER, EXTERNAL :: h5dreadc_5_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5dreadc_5_c(dset_id, mem_type_id, & - mem_space_id_default, & - 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$ATTRIBUTES reference :: buf - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf - END FUNCTION h5dreadc_5_c - END INTERFACE - - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - if (present(xfer_prp)) xfer_prp_default = xfer_prp - if (present(mem_space_id)) mem_space_id_default = mem_space_id - if (present(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dreadc_5_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dread_char_5 - - SUBROUTINE h5dread_char_6(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp - ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - -! INTEGER, EXTERNAL :: h5dreadc_6_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5dreadc_6_c(dset_id, mem_type_id, & - mem_space_id_default, & - 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$ATTRIBUTES reference :: buf - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf - END FUNCTION h5dreadc_6_c - END INTERFACE - - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - if (present(xfer_prp)) xfer_prp_default = xfer_prp - if (present(mem_space_id)) mem_space_id_default = mem_space_id - if (present(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dreadc_6_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dread_char_6 - - SUBROUTINE h5dread_char_7(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp - ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - -! INTEGER, EXTERNAL :: h5dreadc_7_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5dreadc_7_c(dset_id, mem_type_id, & - mem_space_id_default, & - 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$ATTRIBUTES reference :: buf - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - CHARACTER(LEN=*), INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf - END FUNCTION h5dreadc_7_c - END INTERFACE - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - if (present(xfer_prp)) xfer_prp_default = xfer_prp - if (present(mem_space_id)) mem_space_id_default = mem_space_id - if (present(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dreadc_7_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dread_char_7 - - SUBROUTINE h5dread_real_scalar(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(INOUT) :: buf ! Data buffer - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp - ! Transfer property list identifier - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - -! INTEGER, EXTERNAL :: h5dread_real_s_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5dread_real_s_c(dset_id, mem_type_id, & - mem_space_id_default, & - 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 - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(OUT) :: buf - END FUNCTION h5dread_real_s_c - END INTERFACE - - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - if (present(xfer_prp)) xfer_prp_default = xfer_prp - if (present(mem_space_id)) mem_space_id_default = mem_space_id - if (present(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dread_real_s_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dread_real_scalar - - SUBROUTINE h5dread_real_1(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(INOUT), & - DIMENSION(dims(1)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp - ! Transfer property list identifier - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - -! INTEGER, EXTERNAL :: h5dread_real_1_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5dread_real_1_c(dset_id, mem_type_id, & - mem_space_id_default, & - 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 - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(INOUT), & - DIMENSION(dims(1)) :: buf - END FUNCTION h5dread_real_1_c - END INTERFACE - - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - if (present(xfer_prp)) xfer_prp_default = xfer_prp - if (present(mem_space_id)) mem_space_id_default = mem_space_id - if (present(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dread_real_1_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dread_real_1 - - SUBROUTINE h5dread_real_2(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(INOUT), & - DIMENSION(dims(1),dims(2)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp - ! Transfer property list identifier - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - -! INTEGER, EXTERNAL :: h5dread_real_2_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5dread_real_2_c(dset_id, mem_type_id, & - mem_space_id_default, & - 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 - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(INOUT), & - DIMENSION(dims(1),dims(2)) :: buf - END FUNCTION h5dread_real_2_c - END INTERFACE - - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - if (present(xfer_prp)) xfer_prp_default = xfer_prp - if (present(mem_space_id)) mem_space_id_default = mem_space_id - if (present(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dread_real_2_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dread_real_2 - - SUBROUTINE h5dread_real_3(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp - ! Transfer property list identifier - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - -! INTEGER, EXTERNAL :: h5dread_real_3_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5dread_real_3_c(dset_id, mem_type_id, & - mem_space_id_default, & - 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 - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3)) :: buf - END FUNCTION h5dread_real_3_c - END INTERFACE - - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - if (present(xfer_prp)) xfer_prp_default = xfer_prp - if (present(mem_space_id)) mem_space_id_default = mem_space_id - if (present(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dread_real_3_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dread_real_3 - - SUBROUTINE h5dread_real_4(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3), dims(4)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp - ! Transfer property list identifier - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - -! INTEGER, EXTERNAL :: h5dread_real_4_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5dread_real_4_c(dset_id, mem_type_id, & - mem_space_id_default, & - 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 - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3), dims(4)) :: buf - END FUNCTION h5dread_real_4_c - END INTERFACE - - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - if (present(xfer_prp)) xfer_prp_default = xfer_prp - if (present(mem_space_id)) mem_space_id_default = mem_space_id - if (present(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dread_real_4_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dread_real_4 - - SUBROUTINE h5dread_real_5(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp - ! Transfer property list identifier - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - -! INTEGER, EXTERNAL :: h5dread_real_5_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5dread_real_5_c(dset_id, mem_type_id, & - mem_space_id_default, & - 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 - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf - END FUNCTION h5dread_real_5_c - END INTERFACE - - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - if (present(xfer_prp)) xfer_prp_default = xfer_prp - if (present(mem_space_id)) mem_space_id_default = mem_space_id - if (present(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dread_real_5_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dread_real_5 - - SUBROUTINE h5dread_real_6(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp - ! Transfer property list identifier - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - -! INTEGER, EXTERNAL :: h5dread_real_6_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5dread_real_6_c(dset_id, mem_type_id, & - mem_space_id_default, & - 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 - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf - END FUNCTION h5dread_real_6_c - END INTERFACE - - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - if (present(xfer_prp)) xfer_prp_default = xfer_prp - if (present(mem_space_id)) mem_space_id_default = mem_space_id - if (present(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dread_real_6_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dread_real_6 - - SUBROUTINE h5dread_real_7(dset_id, mem_type_id, buf, dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp - ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - -! INTEGER, EXTERNAL :: h5dread_real_7_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5dread_real_7_c(dset_id, mem_type_id, & - mem_space_id_default, & - 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 - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - REAL, INTENT(INOUT), & - DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf - END FUNCTION h5dread_real_7_c - END INTERFACE - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - if (present(xfer_prp)) xfer_prp_default = xfer_prp - if (present(mem_space_id)) mem_space_id_default = mem_space_id - if (present(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dread_real_7_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, buf, dims) - - END SUBROUTINE h5dread_real_7 - -!---------------------------------------------------------------------- -! Name: h5dget_space_f -! -! Purpose: Returns an identifier for a copy of the dataspace for a -! dataset. -! -! Inputs: -! dataset_id - dataset identifier -! Outputs: -! dataspace_id - dataspace identifier -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). February 28, 2001 -! -! Comment: -!---------------------------------------------------------------------- - SUBROUTINE h5dget_space_f(dataset_id, dataspace_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dataset_id ! Dataset identifier - INTEGER(HID_T), INTENT(OUT) :: dataspace_id ! Dataspace identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5dget_space_c -! MS FORTRAN needs explicit interface for C functions called here. -! - 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 - INTEGER(HID_T), INTENT(IN) :: dataset_id - INTEGER(HID_T), INTENT(OUT) :: dataspace_id - END FUNCTION h5dget_space_c - END INTERFACE - - hdferr = h5dget_space_c(dataset_id, dataspace_id) - END SUBROUTINE h5dget_space_f - -!---------------------------------------------------------------------- -! Name: h5dget_type_f -! -! Purpose: Returns an identifier for a copy of the datatype for a -! dataset. -! -! Inputs: -! dataset_id - dataset identifier -! Outputs: -! datatype_id - dataspace identifier -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). February 28, 2001 -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5dget_type_f(dataset_id, datatype_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dataset_id ! Dataset identifier - INTEGER(HID_T), INTENT(OUT) :: datatype_id ! Datatype identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code -! INTEGER, EXTERNAL :: h5dget_type_c -! MS FORTRAN needs explicit interface for C functions called here. -! - 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 - INTEGER(HID_T), INTENT(IN) :: dataset_id - INTEGER(HID_T), INTENT(OUT) :: datatype_id - END FUNCTION h5dget_type_c - END INTERFACE - - hdferr = h5dget_type_c (dataset_id, datatype_id) - END SUBROUTINE h5dget_type_f - -!---------------------------------------------------------------------- -! Name: h5dset_extent (instead of obsolete name: h5dextend_f) -! -! Purpose: Extends a dataset with unlimited dimension. -! -! Inputs: -! dataset_id - dataset identifier -! size - array containing the new magnitude of -! each dimension -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). February 28, 2001 -! -! Changed name from the now obsolete h5dextend_f -! to h5dset_extent_f. Provided interface to old name -! for backward compatability. -MSB- March 14, 2008 -! -! Comment: -!---------------------------------------------------------------------- - - - SUBROUTINE h5dset_extent_f(dataset_id, size, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dataset_id ! Dataset identifier - INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: size - ! Array containing - ! dimensions' sizes - INTEGER, INTENT(OUT) :: hdferr ! Error code - - ! - ! MS FORTRAN needs explicit interface for C functions called here. - ! - 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 - INTEGER(HID_T), INTENT(IN) :: dataset_id - INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: size - END FUNCTION h5dset_extent_c - END INTERFACE - - hdferr = H5Dset_extent_c(dataset_id, size) - END SUBROUTINE h5dset_extent_f - - -!---------------------------------------------------------------------- -! Name: h5dget_create_plist_f -! -! Purpose: Returns an identifier for a copy of the dataset creation -! property list for a dataset. -! -! Inputs: -! dataset_id - dataset identifier -! Outputs: -! plist_id - creation property list identifier -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). February 28, 2001 -! -! Comment: -!---------------------------------------------------------------------- - - - SUBROUTINE h5dget_create_plist_f(dataset_id, plist_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dataset_id ! Dataset identifier - INTEGER(HID_T), INTENT(OUT) :: plist_id ! Dataset creation - ! property list identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5dget_create_plist_c -! MS FORTRAN needs explicit interface for C functions called here. -! - 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 - INTEGER(HID_T), INTENT(IN) :: dataset_id - INTEGER(HID_T), INTENT(OUT) :: plist_id - END FUNCTION h5dget_create_plist_c - END INTERFACE - - hdferr = h5dget_create_plist_c(dataset_id, plist_id) - END SUBROUTINE h5dget_create_plist_f - -!---------------------------------------------------------------------- -! Name: h5dget_storage_size_f -! -! Purpose: Returns the amount of storage requires by a dataset -! -! Inputs: -! dataset_id - dataset identifier -! Outputs: -! size - datastorage size -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! October 15, 2002 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - - SUBROUTINE h5dget_storage_size_f(dataset_id, size, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dataset_id ! Dataset identifier - INTEGER(HSIZE_T), INTENT(OUT) :: size - ! Amount of storage - ! allocated for dataset - INTEGER, INTENT(OUT) :: hdferr ! Error code - - 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 - INTEGER(HID_T), INTENT(IN) :: dataset_id - INTEGER(HSIZE_T), INTENT(OUT) :: size - END FUNCTION h5dget_storage_size_c - END INTERFACE - - hdferr = h5dget_storage_size_c(dataset_id, size) - END SUBROUTINE h5dget_storage_size_f - -!---------------------------------------------------------------------- -! Name: h5dvlen_get_max_len_f -! -! Purpose: Returns maximum lenght of the VL array elements -! -! Inputs: -! dataset_id - dataset identifier -! type_id - datatype identifier -! space_id - dataspace identifier -! Outputs: -! size - buffer size -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! October 15, 2002 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - - SUBROUTINE h5dvlen_get_max_len_f(dataset_id, type_id, space_id, len, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dataset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier - INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier - INTEGER(SIZE_T), INTENT(OUT) :: len ! Maximum length of the element - INTEGER, INTENT(OUT) :: hdferr ! Error code - - 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 - INTEGER(HID_T), INTENT(IN) :: dataset_id - INTEGER(HID_T), INTENT(IN) :: type_id - INTEGER(HID_T), INTENT(IN) :: space_id - INTEGER(SIZE_T), INTENT(OUT) :: len - END FUNCTION h5dvlen_get_max_len_c - END INTERFACE - - hdferr = h5dvlen_get_max_len_c(dataset_id, type_id, space_id, len) - END SUBROUTINE h5dvlen_get_max_len_f - - SUBROUTINE h5dwrite_vl_integer(dset_id, mem_type_id, buf, dims, len, & - hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(2) :: dims ! MAX len x num_elem - INTEGER(SIZE_T), INTENT(IN), DIMENSION(*) :: len ! Array to store - ! the lenght of each - ! element - INTEGER, INTENT(IN), & - DIMENSION(dims(1),dims(2)) :: buf ! Data buffer - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp - ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - - INTERFACE - INTEGER FUNCTION h5dwrite_vl_integer_c(dset_id, mem_type_id, & - mem_space_id_default, & - 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 - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER(SIZE_T), INTENT(IN), DIMENSION(*) :: len - INTEGER, INTENT(IN), & - DIMENSION(dims(1),dims(2)) :: buf - END FUNCTION h5dwrite_vl_integer_c - END INTERFACE - - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - if (present(xfer_prp)) xfer_prp_default = xfer_prp - if (present(mem_space_id)) mem_space_id_default = mem_space_id - if (present(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dwrite_vl_integer_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, & - buf, dims, len) - - END SUBROUTINE h5dwrite_vl_integer - - SUBROUTINE h5dread_vl_integer(dset_id, mem_type_id, buf, dims, len, & - hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(2) :: dims ! MAX len x num_elem - INTEGER(SIZE_T), INTENT(INOUT), DIMENSION(*) :: len ! Array to store - ! the lenght of each - ! element - INTEGER, INTENT(INOUT), & - DIMENSION(dims(1),dims(2)) :: buf ! Data buffer - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! -1 if failed, 0 otherwise - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp - ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: tmp - INTEGER :: error - - INTERFACE - INTEGER FUNCTION h5dread_vl_integer_c(dset_id, mem_type_id, & - mem_space_id_default, & - 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 - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER(SIZE_T), INTENT(INOUT), DIMENSION(*) :: len - INTEGER, INTENT(INOUT), & - DIMENSION(dims(1),dims(2)) :: buf - END FUNCTION h5dread_vl_integer_c - END INTERFACE - - CALL h5dget_space_f(dset_id, tmp, error) - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = tmp - file_space_id_default = tmp - - if (present(xfer_prp)) xfer_prp_default = xfer_prp - if (present(mem_space_id)) mem_space_id_default = mem_space_id - if (present(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dread_vl_integer_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, & - buf, dims, len) - - END SUBROUTINE h5dread_vl_integer - - SUBROUTINE h5dwrite_vl_real(dset_id, mem_type_id, buf, dims, len, & - hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(2) :: dims ! MAX len x num_elem - INTEGER(SIZE_T), INTENT(IN), DIMENSION(*) :: len ! Array to store - ! the lenght of each - ! element - REAL, INTENT(IN), & - DIMENSION(dims(1),dims(2)) :: buf ! Data buffer - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp - ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - - INTERFACE - INTEGER FUNCTION h5dwrite_vl_real_c(dset_id, mem_type_id, & - mem_space_id_default, & - 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 - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER(SIZE_T), INTENT(IN), DIMENSION(*) :: len - REAL, INTENT(IN), & - DIMENSION(dims(1),dims(2)) :: buf - END FUNCTION h5dwrite_vl_real_c - END INTERFACE - - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - if (present(xfer_prp)) xfer_prp_default = xfer_prp - if (present(mem_space_id)) mem_space_id_default = mem_space_id - if (present(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dwrite_vl_real_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, & - buf, dims, len) - - END SUBROUTINE h5dwrite_vl_real - - SUBROUTINE h5dread_vl_real(dset_id, mem_type_id, buf, dims, len, & - hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(2) :: dims ! MAX len x num_elem - INTEGER(SIZE_T), INTENT(INOUT), DIMENSION(*) :: len ! Array to store - ! the lenght of each - ! element - REAL, INTENT(INOUT), & - DIMENSION(dims(1),dims(2)) :: buf ! Data buffer - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! -1 if failed, 0 otherwise - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp - ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: tmp - INTEGER :: error - - INTERFACE - INTEGER FUNCTION h5dread_vl_real_c(dset_id, mem_type_id, & - mem_space_id_default, & - 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 - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims - INTEGER(SIZE_T), INTENT(INOUT), DIMENSION(*) :: len - REAL, INTENT(INOUT), & - DIMENSION(dims(1),dims(2)) :: buf - END FUNCTION h5dread_vl_real_c - END INTERFACE - - CALL h5dget_space_f(dset_id, tmp, error) - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = tmp - file_space_id_default = tmp - - if (present(xfer_prp)) xfer_prp_default = xfer_prp - if (present(mem_space_id)) mem_space_id_default = mem_space_id - if (present(file_space_id)) file_space_id_default = file_space_id - - hdferr = h5dread_vl_real_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, & - buf, dims, len) - - END SUBROUTINE h5dread_vl_real - - SUBROUTINE h5dwrite_vl_string(dset_id, mem_type_id, buf, dims, str_len, & - hdferr, & - mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(2) :: dims ! number of strings - INTEGER(SIZE_T), INTENT(IN), DIMENSION(*) :: str_len ! Array to store - ! the lenght of each - ! element - CHARACTER(LEN=*), INTENT(IN), & - DIMENSION(dims(2)) :: buf ! Data buffer - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp - ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default -! CHARACTER, DIMENSION(dims(1)*dims(2)) :: tmp_buf - - INTERFACE - INTEGER FUNCTION h5dwrite_vl_string_c(dset_id, mem_type_id, & - mem_space_id_default, & - file_space_id_default, & -! 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$ATTRIBUTES reference :: buf - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(2) :: dims - INTEGER(SIZE_T), INTENT(IN), DIMENSION(*) :: str_len -! CHARACTER, INTENT(IN), & -! DIMENSION(dims(1)*dims(2)) :: tmp_buf - CHARACTER(LEN=*), DIMENSION(dims(2)) :: buf - END FUNCTION h5dwrite_vl_string_c - END INTERFACE - - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - if (present(xfer_prp)) xfer_prp_default = xfer_prp - if (present(mem_space_id)) mem_space_id_default = mem_space_id - if (present(file_space_id)) file_space_id_default = file_space_id -! do i = 1, dims(2) -! do j = 1, dims(1) -! tmp_buf((i-1)*dims(1) +j) = buf(i)(j:j) -! enddo -! enddo -! write(*,*) (tmp_buf(j:j), j=1,dims(1)*dims(2)) -! write(*,*) str_len(1), str_len(2), str_len(3), str_len(4) - - hdferr = h5dwrite_vl_string_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, & - buf, dims, str_len) - - END SUBROUTINE h5dwrite_vl_string - - SUBROUTINE h5dread_vl_string(dset_id, mem_type_id, buf, dims, str_len, & + SUBROUTINE h5dread_vl_string(dset_id, mem_type_id, buf, dims, str_len, & hdferr, & mem_space_id, file_space_id, xfer_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(2) :: dims ! number of strings - INTEGER(SIZE_T), INTENT(OUT), DIMENSION(*) :: str_len ! Array to store - ! the lenght of each - ! element - CHARACTER(LEN=*), INTENT(OUT), & - DIMENSION(dims(2)) :: buf ! Data buffer - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id - ! Memory dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id - ! File dataspace identfier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp - ! Transfer property list identifier - - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default -! CHARACTER, DIMENSION(dims(1)*dims(2)) :: tmp_buf -! integer i, j - - INTERFACE - INTEGER FUNCTION h5dread_vl_string_c(dset_id, mem_type_id, & - mem_space_id_default, & - file_space_id_default, & -! 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$ATTRIBUTES reference :: buf - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(IN) :: mem_type_id - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(2) :: dims - INTEGER(SIZE_T), INTENT(OUT), DIMENSION(*) :: str_len -! CHARACTER, INTENT(IN), & -! DIMENSION(dims(1)*dims(2)) :: tmp_buf - CHARACTER(LEN=*), DIMENSION(dims(2)) :: buf - END FUNCTION h5dread_vl_string_c - END INTERFACE - - - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - if (present(xfer_prp)) xfer_prp_default = xfer_prp - if (present(mem_space_id)) mem_space_id_default = mem_space_id - if (present(file_space_id)) file_space_id_default = file_space_id -! do i = 1, dims(2) -! do j = 1, dims(1) -! tmp_buf((i-1)*dims(1) +j) = buf(i)(j:j) -! enddo -! enddo -! write(*,*) (tmp_buf(j:j), j=1,dims(1)*dims(2)) -! write(*,*) str_len(1), str_len(2), str_len(3), str_len(4) - - hdferr = h5dread_vl_string_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, & - buf, dims, str_len) - RETURN - END SUBROUTINE h5dread_vl_string - -!---------------------------------------------------------------------- -! Name: h5dfill_integer -! -! Purpose: Fills dataspace elements with a fill value in a memory buffer. -! Only INTEGER, CHARACTER, REAL and DOUBLE PRECISION datatypes -! of the fillvalues and buffers are supported. Buffer and fillvalue -! are assumed to have the same datatype. -! Only one-dimesional buffers are supported. -! -! Inputs: -! fill_value - fill value -! space_id - memory space selection identifier -! buf - data buffer iin memory ro apply selection to -! - of k-th dimension of the buf array -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! -! Programmer: Elena Pourmal -! March 12, 2003 -! -!---------------------------------------------------------------------- - - SUBROUTINE h5dfill_integer(fill_value, space_id, buf, hdferr) - IMPLICIT NONE - INTEGER, INTENT(IN) :: fill_value ! Fill value - INTEGER(HID_T), INTENT(IN) :: space_id ! Memory dataspace selection identifier - INTEGER, INTENT(IN), DIMENSION(*) :: buf ! Memory buffer to fill in - INTEGER, INTENT(OUT) :: hdferr ! Error code - - INTEGER(HID_T) :: fill_type_id ! Fill value datatype identifier - INTEGER(HID_T) :: mem_type_id ! Buffer dadtype identifier - -! INTEGER, EXTERNAL :: h5dfill_integer_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - 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 - 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 - INTEGER, INTENT(IN), DIMENSION(*) :: buf ! Memory buffer to fill in - INTEGER(HID_T) :: mem_type_id ! Buffer dadtype identifier - END FUNCTION h5dfill_integer_c - END INTERFACE - fill_type_id = H5T_NATIVE_INTEGER - mem_type_id = H5T_NATIVE_INTEGER - - hdferr = h5dfill_integer_c(fill_value, fill_type_id, space_id, & - buf, mem_type_id) - - END SUBROUTINE h5dfill_integer - -!---------------------------------------------------------------------- -! Name: h5dfill_real -! -! Purpose: Fills dataspace elements with a fill value in a memory buffer. -! Only INTEGER, CHARACTER, REAL and DOUBLE PRECISION datatypes -! of the fillvalues and buffers are supported. Buffer and fillvalue -! are assumed to have the same datatype. -! Only one-dimesional buffers are supported. -! -! Inputs: -! fill_value - fill value -! space_id - memory space selection identifier -! buf - data buffer iin memory ro apply selection to -! - of k-th dimension of the buf array -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! -! Programmer: Elena Pourmal -! March 12, 2003 -! -!---------------------------------------------------------------------- - - SUBROUTINE h5dfill_real(fill_valuer, space_id, buf, hdferr) - IMPLICIT NONE - REAL, INTENT(IN) :: fill_valuer ! Fill value - INTEGER(HID_T), INTENT(IN) :: space_id ! Memory dataspace selection identifier - REAL, INTENT(IN), DIMENSION(*) :: buf ! Memory buffer to fill in - INTEGER, INTENT(OUT) :: hdferr ! Error code - - INTEGER(HID_T) :: fill_type_id ! Fill value datatype identifier - INTEGER(HID_T) :: mem_type_id ! Buffer dadtype identifier - -! INTEGER, EXTERNAL :: h5dfill_real_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - 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 - 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 - REAL, INTENT(IN), DIMENSION(*) :: buf ! Memory buffer to fill in - INTEGER(HID_T) :: mem_type_id ! Buffer dadtype identifier - END FUNCTION h5dfill_real_c - END INTERFACE - fill_type_id = H5T_NATIVE_REAL - mem_type_id = H5T_NATIVE_REAL - - hdferr = h5dfill_real_c(fill_valuer, fill_type_id, space_id, & - buf, mem_type_id) - END SUBROUTINE h5dfill_real - -!---------------------------------------------------------------------- -! Name: h5dfill_char -! -! Purpose: Fills dataspace elements with a fill value in a memory buffer. -! Only INTEGER, CHARACTER, REAL and DOUBLE PRECISION datatypes -! of the fillvalues and buffers are supported. Buffer and fillvalue -! are assumed to have the same datatype. -! Only one-dimesional buffers are supported. -! -! Inputs: -! fill_value - fill value -! space_id - memory space selection identifier -! buf - data buffer iin memory ro apply selection to -! - of k-th dimension of the buf array -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! -! Programmer: Elena Pourmal -! March 12, 2003 -! -!---------------------------------------------------------------------- - - SUBROUTINE h5dfill_char(fill_value, space_id, buf, hdferr) - IMPLICIT NONE - CHARACTER, INTENT(IN) :: fill_value ! Fill value - INTEGER(HID_T), INTENT(IN) :: space_id ! Memory dataspace selection identifier - CHARACTER, INTENT(IN), DIMENSION(*) :: buf ! Memory buffer to fill in - INTEGER, INTENT(OUT) :: hdferr ! Error code - - INTEGER(HID_T) :: fill_type_id ! Fill value datatype identifier - INTEGER(HID_T) :: mem_type_id ! Buffer dadtype identifier - -! INTEGER, EXTERNAL :: h5dfillc_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - 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 - 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 - CHARACTER, INTENT(IN), DIMENSION(*) :: buf ! Memory buffer to fill in - INTEGER(HID_T) :: mem_type_id ! Buffer dadtype identifier - END FUNCTION h5dfillc_c - END INTERFACE - fill_type_id = H5T_NATIVE_CHARACTER - mem_type_id = H5T_NATIVE_CHARACTER - - hdferr = h5dfillc_c(fill_value, fill_type_id, space_id, & - buf, mem_type_id) - - END SUBROUTINE h5dfill_char - -!---------------------------------------------------------------------- -! Name: h5dget_space_status_f -! -! Purpose: Returns the status of data space allocation. -! -! Inputs: -! dset_id - dataset identifier -! Outputs: -! flag - status; may have one of the following values: -! H5D_SPACE_STS_ERROR_F -! H5D_SPACE_STS_NOT_ALLOCATED_F -! H5D_SPACE_STS_PART_ALLOCATED_F -! H5D_SPACE_STS_ALLOCATED_F -! hdferr: - error code -! Success: 0 -! Failure: -1 -! -! Programmer: Elena Pourmal -! March 12, 2003 -! -!---------------------------------------------------------------------- - - SUBROUTINE h5dget_space_status_f(dset_id, flag, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataspace identifier - INTEGER, INTENT(IN) :: flag ! Memory buffer to fill in - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5dget_space_status_c -! MS FORTRAN needs explicit interface for C functions called here. -! - 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 - INTEGER(HID_T) :: dset_id - INTEGER :: flag - END FUNCTION h5dget_space_status_c - END INTERFACE - - hdferr = h5dget_space_status_c(dset_id, flag) - END SUBROUTINE h5dget_space_status_f - -!---------------------------------------------------------------------- -! Name: h5dcreate_anon_f -! -! Purpose: Creates a dataset in a file without linking it into the file structure -! -! Inputs: -! loc_id - Identifier of the file or group within which to create the dataset. -! type_id - Identifier of the datatype to use when creating the dataset. -! space_id - Identifier of the dataspace to use when creating the dataset. -! Outputs: -! dset_id - dataset identifier -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! dcpl_id - Dataset creation property list identifier. -! dapl_id - Dataset access property list identifier. -! -! Programmer: M. Scot Breitenfeld -! February 11, 2008 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5dcreate_anon_f(loc_id, type_id, space_id, dset_id, hdferr, dcpl_id, dapl_id) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier. - INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier. - INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier. - INTEGER(HID_T), INTENT(OUT) :: dset_id ! Dataset identifier. - INTEGER, INTENT(OUT) :: hdferr ! Error code. - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: dcpl_id ! Dataset creation property list identifier. - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: dapl_id ! Dataset access property list identifier. - - INTEGER(HID_T) :: dcpl_id_default - INTEGER(HID_T) :: dapl_id_default + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(2) :: dims ! number of strings + INTEGER(SIZE_T), INTENT(OUT), DIMENSION(*) :: str_len ! Array to store + ! the length of each + ! element + CHARACTER(LEN=*), INTENT(OUT), & + DIMENSION(dims(2)) :: buf ! Data buffer + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default -! -! MS FORTRAN needs explicit interface for C functions called here. -! INTERFACE - INTEGER FUNCTION h5dcreate_anon_c(loc_id, type_id, space_id, dcpl_id_default, dapl_id_default, dset_id) + INTEGER FUNCTION h5dread_vl_string_c(dset_id, mem_type_id, & + mem_space_id_default, & + file_space_id_default, & + xfer_prp_default, buf, dims, str_len) USE H5GLOBAL !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DCREATE_ANON_C'::h5dcreate_anon_c + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DREAD_VL_STRING_C'::h5dread_vl_string_c !DEC$ENDIF - INTEGER(HID_T), INTENT(IN) :: loc_id - INTEGER(HID_T), INTENT(IN) :: type_id - INTEGER(HID_T), INTENT(IN) :: space_id - INTEGER(HID_T) :: dcpl_id_default - INTEGER(HID_T) :: dapl_id_default - INTEGER(HID_T), INTENT(OUT) :: dset_id - END FUNCTION h5dcreate_anon_c + !DEC$ATTRIBUTES reference :: buf + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(2) :: dims + INTEGER(SIZE_T), INTENT(OUT), DIMENSION(*) :: str_len + CHARACTER(LEN=*), DIMENSION(dims(2)) :: buf + END FUNCTION h5dread_vl_string_c END INTERFACE - dcpl_id_default = H5P_DEFAULT_F - dapl_id_default = H5P_DEFAULT_F - - IF(PRESENT(dcpl_id)) dcpl_id_default = dcpl_id - IF(PRESENT(dapl_id)) dapl_id_default = dapl_id + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F - hdferr = h5dcreate_anon_c(loc_id, type_id, space_id, dcpl_id_default, dapl_id_default, dset_id) + IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF (PRESENT(file_space_id)) file_space_id_default = file_space_id - END SUBROUTINE h5dcreate_anon_f + hdferr = h5dread_vl_string_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, & + buf, dims, str_len) + RETURN + END SUBROUTINE h5dread_vl_string -!---------------------------------------------------------------------- -! Name: h5dget_access_plist_f ! -! Purpose: Returns a copy of the dataset creation property list. +!****s* H5D/h5dget_space_f ! -! Inputs: -! dset_id - dataset identifier. -! Outputs: -! plist_id - the dataset access property list identifier. -! hdferr: - error code -! Success: 0 -! Failure: -1 +! NAME +! h5dget_space_f ! -! Programmer: M. Scot Breitenfeld -! April 13, 2009 +! PURPOSE +! Returns an identifier for a copy of the dataspace for a +! dataset. ! -! Modifications: +! INPUTS +! dataset_id - dataset identifier +! OUTPUTS +! dataspace_id - dataspace identifier +! hdferr - Returns 0 if successful and -1 if fails ! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5dget_access_plist_f(dset_id, plist_id, hdferr) +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). February 28, 2001 +! +! SOURCE + SUBROUTINE h5dget_space_f(dataset_id, dataspace_id, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HID_T), INTENT(OUT) :: plist_id - INTEGER, INTENT(OUT) :: hdferr ! Error code. - + INTEGER(HID_T), INTENT(IN) :: dataset_id ! Dataset identifier + INTEGER(HID_T), INTENT(OUT) :: dataspace_id ! Dataspace identifier + 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) + 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 + INTEGER(HID_T), INTENT(IN) :: dataset_id + INTEGER(HID_T), INTENT(OUT) :: dataspace_id + END FUNCTION h5dget_space_c + END INTERFACE - END SUBROUTINE h5dget_access_plist_f + hdferr = h5dget_space_c(dataset_id, dataspace_id) +END SUBROUTINE h5dget_space_f + +!****s* H5D/h5dget_access_plist_f +! +! NAME +! h5dget_access_plist_f +! +! PURPOSE +! Returns a copy of the dataset creation property list. +! +! INPUTS +! dset_id - Dataset identifier +! +! OUTPUTS +! plist_id - Dataset access property list identifier +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! M. Scot Breitenfeld +! April 13, 2009 +! +! SOURCE +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 +!***** + 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/H5Dff_F03.f90 b/fortran/src/H5Dff_F03.f90 new file mode 100644 index 0000000..61d5dfc --- /dev/null +++ b/fortran/src/H5Dff_F03.f90 @@ -0,0 +1,2404 @@ +!****h* ROBODoc/H5D (F03) +! +! NAME +! H5D_PROVISIONAL +! +! PURPOSE +! This file contains Fortran 90 and Fortran 2003 interfaces for H5D functions. +! It contains the same functions as H5Dff_F90.f90 but includes the +! Fortran 2003 functions and the interface listings. This file will be compiled +! instead of H5Dff_F90.f90 if Fortran 2003 functions are enabled. +! +! COPYRIGHT +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +! NOTES +! (1) The maximum rank of an array allowed in Fortran is 7, therefore +! we only provide an interface for arrays up to and including rank 7. +! +! (2) Unfortunately we are using a generic interface and one of the factors +! used in determining the proper routine to select is that of the array +! rank being passed. Therefore, we can not create just one subroutine for +! each array type (integer, real, etc...) and use a +! rank 1 array of assumed size to handle multiple ranks, i.e. +! (i.e. integer, dimension(*) :: ... ) +! (i.e. real , dimension(*) :: ... ) etc... +! +! (3) Could not place the USE, INTRINSIC :: ISO_C_BINDING in the module header because it may +! conflict with the USE, INTRINSIC :: ISO_C_BINDING included in the user's program. Moved +! the statement instead to each subroutine. +! +! +! (4) C_LOC and character strings according to the Fortran 2003 standard: +! +! 15.1.2.5 C_LOC(X) +! +! Argument. X shall either +! +! (A) have interoperable type and type parameters and be +! (a) a variable that has the TARGET attribute and is interoperable, +! (b) an allocated allocatable variable that has the TARGET attribute +! and is not an array of zero size, or +! (c) an associated scalar pointer, or +! (B) be a nonpolymorphic scalar, have no length type parameters, and be +! (a) a nonallocatable, nonpointer variable that has the TARGET attribute, +! (b) an allocated allocatable variable that has the TARGET attribute, or +! (c) an associated pointer. +! +! - When X is a character, for interoperability the standard is: +! +! 15.2.1 Interoperability of intrinsic types +! +! ...if the type is character, interoperability also requires that the length type parameter +! be omitted or be specified by an initialization expression whose value is one. +! +! THEREFORE compilers that have not extended the standard require the +! argument in C_LOC to be of the variant: +! +! CHARACTER(LEN=1), TARGET :: chr +! or +! CHARACTER, TARGET :: chr +! +! *** IMPORTANT *** +! If you add a new H5D function you must add the function name to the +! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! This is needed for Windows based operating systems. +! +!***** + +MODULE H5D_PROVISIONAL + USE H5GLOBAL + + INTERFACE h5dwrite_f + + MODULE PROCEDURE h5dwrite_reference_obj + MODULE PROCEDURE h5dwrite_reference_dsetreg + MODULE PROCEDURE h5dwrite_integer_scalar + MODULE PROCEDURE h5dwrite_integer_1 + MODULE PROCEDURE h5dwrite_integer_2 + MODULE PROCEDURE h5dwrite_integer_3 + MODULE PROCEDURE h5dwrite_integer_4 + MODULE PROCEDURE h5dwrite_integer_5 + MODULE PROCEDURE h5dwrite_integer_6 + MODULE PROCEDURE h5dwrite_integer_7 + MODULE PROCEDURE h5dwrite_char_scalar + MODULE PROCEDURE h5dwrite_char_1 + MODULE PROCEDURE h5dwrite_char_2 + MODULE PROCEDURE h5dwrite_char_3 + MODULE PROCEDURE h5dwrite_char_4 + MODULE PROCEDURE h5dwrite_char_5 + MODULE PROCEDURE h5dwrite_char_6 + MODULE PROCEDURE h5dwrite_char_7 + MODULE PROCEDURE h5dwrite_real_scalar + MODULE PROCEDURE h5dwrite_real_1 + MODULE PROCEDURE h5dwrite_real_2 + MODULE PROCEDURE h5dwrite_real_3 + MODULE PROCEDURE h5dwrite_real_4 + MODULE PROCEDURE h5dwrite_real_5 + MODULE PROCEDURE h5dwrite_real_6 + MODULE PROCEDURE h5dwrite_real_7 + + ! This is the preferred way to call h5dwrite + ! by passing an address + MODULE PROCEDURE h5dwrite_ptr + + END INTERFACE + + INTERFACE h5dread_f + + MODULE PROCEDURE h5dread_reference_obj + MODULE PROCEDURE h5dread_reference_dsetreg + MODULE PROCEDURE h5dread_integer_scalar + MODULE PROCEDURE h5dread_integer_1 + MODULE PROCEDURE h5dread_integer_2 + MODULE PROCEDURE h5dread_integer_3 + MODULE PROCEDURE h5dread_integer_4 + MODULE PROCEDURE h5dread_integer_5 + MODULE PROCEDURE h5dread_integer_6 + MODULE PROCEDURE h5dread_integer_7 + MODULE PROCEDURE h5dread_char_scalar + MODULE PROCEDURE h5dread_char_1 + MODULE PROCEDURE h5dread_char_2 + MODULE PROCEDURE h5dread_char_3 + MODULE PROCEDURE h5dread_char_4 + MODULE PROCEDURE h5dread_char_5 + MODULE PROCEDURE h5dread_char_6 + MODULE PROCEDURE h5dread_char_7 + MODULE PROCEDURE h5dread_real_scalar + MODULE PROCEDURE h5dread_real_1 + MODULE PROCEDURE h5dread_real_2 + MODULE PROCEDURE h5dread_real_3 + MODULE PROCEDURE h5dread_real_4 + MODULE PROCEDURE h5dread_real_5 + MODULE PROCEDURE h5dread_real_6 + MODULE PROCEDURE h5dread_real_7 + + ! This is the preferred way to call h5dread + ! by passing an address + MODULE PROCEDURE h5dread_ptr + + END INTERFACE + +! Interface for the function used to pass the C pointer of the buffer +! to the C H5Dwrite routine + + INTERFACE + INTEGER FUNCTION h5dwrite_f_c(dset_id, mem_type_id, & + mem_space_id_default , & + file_space_id_default, & + xfer_prp_default, buf ) + USE H5GLOBAL + USE, INTRINSIC :: ISO_C_BINDING + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DWRITE_F_C'::h5dwrite_f_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 + INTEGER(HID_T) :: file_space_id_default + INTEGER(HID_T) :: xfer_prp_default + TYPE(C_PTR), VALUE :: buf + END FUNCTION h5dwrite_f_c + END INTERFACE + +! Interface for the function used to pass the C pointer of the buffer +! to the C H5Dread routine + + INTERFACE + INTEGER FUNCTION h5dread_f_c(dset_id, mem_type_id, & + mem_space_id_default, & + file_space_id_default, & + xfer_prp_default, buf) + USE H5GLOBAL + USE, INTRINSIC :: ISO_C_BINDING + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DREAD_F_C'::h5dread_f_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 + INTEGER(HID_T) :: file_space_id_default + INTEGER(HID_T) :: xfer_prp_default + TYPE(C_PTR), VALUE :: buf + END FUNCTION h5dread_f_c + END INTERFACE + + INTERFACE h5dfill_f + MODULE PROCEDURE h5dfill_integer + MODULE PROCEDURE h5dfill_real + MODULE PROCEDURE h5dfill_char + END INTERFACE + +! Interface for the function used to pass the C pointer of the buffer +! to the C H5Dfill routine + + INTERFACE + INTEGER FUNCTION h5dfill_c(f_ptr_fill_value, fill_type_id, space_id, & + f_ptr_buf, mem_type_id) + USE H5GLOBAL + USE, INTRINSIC :: ISO_C_BINDING + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DFILL_C'::h5dfill_c + !DEC$ENDIF + TYPE(C_PTR), VALUE :: f_ptr_fill_value + INTEGER(HID_T) :: fill_type_id ! Fill value datatype identifier + INTEGER(HID_T), INTENT(IN) :: space_id ! Memory dataspace selection identifier + TYPE(C_PTR), VALUE :: f_ptr_buf + INTEGER(HID_T) :: mem_type_id + END FUNCTION h5dfill_c + END INTERFACE + +CONTAINS + + SUBROUTINE h5dwrite_reference_obj(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: dims ! size of the bufffer buf + TYPE(hobj_ref_t_f), DIMENSION(dims(1)), INTENT(IN), TARGET :: buf ! Data buffer + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + TYPE(C_PTR) :: f_ptr + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF(PRESENT(file_space_id)) file_space_id_default = file_space_id + f_ptr = C_LOC(buf(1)) + + hdferr = h5dwrite_f_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, f_ptr) + + + END SUBROUTINE h5dwrite_reference_obj + + SUBROUTINE h5dwrite_reference_dsetreg(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: dims ! size of the bufffer buf + TYPE(hdset_reg_ref_t_f), DIMENSION(dims(1)), INTENT(IN), TARGET :: buf ! Data buffer + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER, ALLOCATABLE, DIMENSION(:) :: ref_buf + INTEGER :: i,j + TYPE(C_PTR) :: f_ptr + INTERFACE + INTEGER FUNCTION h5dwrite_ref_reg_c(dset_id, mem_type_id,& + 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 + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER, DIMENSION(*) :: ref_buf + INTEGER(HSIZE_T), DIMENSION(*) :: dims + END FUNCTION h5dwrite_ref_reg_c + END INTERFACE + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF(PRESENT(file_space_id)) file_space_id_default = file_space_id + f_ptr = C_LOC(buf(1)) + + ALLOCATE(ref_buf(REF_REG_BUF_LEN*dims(1)), stat=hdferr) + IF (hdferr .NE. 0 ) THEN + hdferr = -1 + RETURN + ELSE + DO j = 1, dims(1) + DO i = 1, REF_REG_BUF_LEN + ref_buf(REF_REG_BUF_LEN*(j-1) + i) = buf(j)%ref(i) + ENDDO + ENDDO + ENDIF + hdferr = h5dwrite_ref_reg_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, ref_buf, dims) + DEALLOCATE(ref_buf) + + END SUBROUTINE h5dwrite_reference_dsetreg + + + SUBROUTINE h5dwrite_integer_scalar(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER, INTENT(IN), TARGET :: buf ! Data buffer + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + TYPE(C_PTR) :: f_ptr + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF(PRESENT(file_space_id)) file_space_id_default = file_space_id + f_ptr = C_LOC(buf) + + hdferr = h5dwrite_f_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, f_ptr) + + END SUBROUTINE h5dwrite_integer_scalar + + SUBROUTINE h5dwrite_integer_1(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + INTEGER, INTENT(IN), & + DIMENSION(dims(1)), TARGET :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + TYPE(C_PTR) :: f_ptr + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF(PRESENT(file_space_id)) file_space_id_default = file_space_id + f_ptr = C_LOC(buf(1)) + + hdferr = h5dwrite_f_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, f_ptr) + + END SUBROUTINE h5dwrite_integer_1 + + SUBROUTINE h5dwrite_integer_2(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + INTEGER, INTENT(IN), & + DIMENSION(dims(1),dims(2)),TARGET :: buf ! Data buffer + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + TYPE(C_PTR) :: f_ptr + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF(PRESENT(file_space_id)) file_space_id_default = file_space_id + f_ptr = C_LOC(buf(1,1)) + + hdferr = h5dwrite_f_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, f_ptr) + + END SUBROUTINE h5dwrite_integer_2 + + SUBROUTINE h5dwrite_integer_3(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + INTEGER, INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3)), TARGET :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + TYPE(C_PTR) :: f_ptr + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF(PRESENT(file_space_id)) file_space_id_default = file_space_id + f_ptr = C_LOC(buf(1,1,1)) + + hdferr = h5dwrite_f_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, f_ptr) + + END SUBROUTINE h5dwrite_integer_3 + + SUBROUTINE h5dwrite_integer_4(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + INTEGER, INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3),dims(4)), TARGET :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + TYPE(C_PTR) :: f_ptr + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF(PRESENT(file_space_id)) file_space_id_default = file_space_id + f_ptr = C_LOC(buf(1,1,1,1)) + + hdferr = h5dwrite_f_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, f_ptr) + + END SUBROUTINE h5dwrite_integer_4 + + SUBROUTINE h5dwrite_integer_5(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + INTEGER, INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)), TARGET :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + TYPE(C_PTR) :: f_ptr + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF(PRESENT(file_space_id)) file_space_id_default = file_space_id + f_ptr = C_LOC(buf(1,1,1,1,1)) + + hdferr = h5dwrite_f_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, f_ptr) + + END SUBROUTINE h5dwrite_integer_5 + + SUBROUTINE h5dwrite_integer_6(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + INTEGER, INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)), TARGET :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + TYPE(C_PTR) :: f_ptr + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF(PRESENT(file_space_id)) file_space_id_default = file_space_id + f_ptr = C_LOC(buf(1,1,1,1,1,1)) + + hdferr = h5dwrite_f_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, f_ptr) + + END SUBROUTINE h5dwrite_integer_6 + + SUBROUTINE h5dwrite_integer_7(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + INTEGER, INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)), TARGET :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + TYPE(C_PTR) :: f_ptr + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF(PRESENT(file_space_id)) file_space_id_default = file_space_id + f_ptr = C_LOC(buf(1,1,1,1,1,1,1)) + + hdferr = h5dwrite_f_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, f_ptr) + + END SUBROUTINE h5dwrite_integer_7 + + SUBROUTINE h5dwrite_char_scalar(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + CHARACTER(*), INTENT(IN), TARGET :: buf ! Data buffer + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + CALL h5dwrite_char_scalar_fix(dset_id, mem_type_id, buf, LEN(buf), dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + + END SUBROUTINE h5dwrite_char_scalar + + SUBROUTINE h5dwrite_char_scalar_fix(dset_id, mem_type_id, buf, buf_len, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + INTEGER, INTENT(IN) :: buf_len + CHARACTER(LEN=buf_len), INTENT(IN), TARGET :: buf ! Data buffer + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + TYPE(C_PTR) :: f_ptr + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF(PRESENT(file_space_id)) file_space_id_default = file_space_id + + f_ptr = C_LOC(buf(1:1)) + + hdferr = h5dwrite_f_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, f_ptr) + + END SUBROUTINE h5dwrite_char_scalar_fix + + SUBROUTINE h5dwrite_char_1(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + CHARACTER(LEN=*), INTENT(IN), DIMENSION(dims(1)), TARGET :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + TYPE(C_PTR) :: f_ptr + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF(PRESENT(file_space_id)) file_space_id_default = file_space_id + + f_ptr = C_LOC(buf(1)(1:1)) + + hdferr = h5dwrite_f_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, f_ptr) + + END SUBROUTINE h5dwrite_char_1 + + SUBROUTINE h5dwrite_char_2(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + CHARACTER(LEN=*), INTENT(IN), & + DIMENSION(dims(1),dims(2)), TARGET :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + TYPE(C_PTR) :: f_ptr + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF(PRESENT(file_space_id)) file_space_id_default = file_space_id + + f_ptr = C_LOC(buf(1,1)(1:1)) + + hdferr = h5dwrite_f_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, f_ptr) + + END SUBROUTINE h5dwrite_char_2 + + SUBROUTINE h5dwrite_char_3(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + CHARACTER(LEN=*), INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3)), TARGET :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + TYPE(C_PTR) :: f_ptr + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF(PRESENT(file_space_id)) file_space_id_default = file_space_id + + f_ptr = C_LOC(buf(1,1,1)(1:1)) + + hdferr = h5dwrite_f_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, f_ptr) + + END SUBROUTINE h5dwrite_char_3 + + SUBROUTINE h5dwrite_char_4(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + CHARACTER(LEN=*), INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3),dims(4)), TARGET :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + TYPE(C_PTR) :: f_ptr + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF(PRESENT(file_space_id)) file_space_id_default = file_space_id + + f_ptr = C_LOC(buf(1,1,1,1)(1:1)) + + hdferr = h5dwrite_f_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, f_ptr) + + END SUBROUTINE h5dwrite_char_4 + + SUBROUTINE h5dwrite_char_5(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + CHARACTER(LEN=*), INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)), TARGET :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + TYPE(C_PTR) :: f_ptr + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF(PRESENT(file_space_id)) file_space_id_default = file_space_id + + f_ptr = C_LOC(buf(1,1,1,1,1)(1:1)) + hdferr = h5dwrite_f_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, f_ptr) + + END SUBROUTINE h5dwrite_char_5 + + SUBROUTINE h5dwrite_char_6(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + CHARACTER(LEN=*), INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)), TARGET :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + TYPE(C_PTR) :: f_ptr + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF(PRESENT(file_space_id)) file_space_id_default = file_space_id + + f_ptr = C_LOC(buf(1,1,1,1,1,1)(1:1)) + + hdferr = h5dwrite_f_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, f_ptr) + + END SUBROUTINE h5dwrite_char_6 + + SUBROUTINE h5dwrite_char_7(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + CHARACTER(LEN=*), INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)), TARGET :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + TYPE(C_PTR) :: f_ptr + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF(PRESENT(file_space_id)) file_space_id_default = file_space_id + + f_ptr = C_LOC(buf(1,1,1,1,1,1,1)(1:1)) + + hdferr = h5dwrite_f_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, f_ptr) + + END SUBROUTINE h5dwrite_char_7 + + + SUBROUTINE h5dwrite_real_scalar(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + REAL, INTENT(IN), TARGET :: buf ! Data buffer + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + TYPE(C_PTR) :: f_ptr + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF(PRESENT(file_space_id)) file_space_id_default = file_space_id + f_ptr = C_LOC(buf) + + hdferr = h5dwrite_f_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, f_ptr) + + END SUBROUTINE h5dwrite_real_scalar + + + SUBROUTINE h5dwrite_real_1(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + REAL, INTENT(IN), & + DIMENSION(dims(1)), TARGET :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + TYPE(C_PTR) :: f_ptr + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF(PRESENT(file_space_id)) file_space_id_default = file_space_id + f_ptr = C_LOC(buf(1)) + + hdferr = h5dwrite_f_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, f_ptr) + + END SUBROUTINE h5dwrite_real_1 + + SUBROUTINE h5dwrite_real_2(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + REAL, INTENT(IN), & + DIMENSION(dims(1),dims(2)), TARGET :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + TYPE(C_PTR) :: f_ptr + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF(PRESENT(file_space_id)) file_space_id_default = file_space_id + f_ptr = C_LOC(buf(1,1)) + + hdferr = h5dwrite_f_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, f_ptr) + + END SUBROUTINE h5dwrite_real_2 + + SUBROUTINE h5dwrite_real_3(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + REAL, INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3)), TARGET :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + TYPE(C_PTR) :: f_ptr + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF(PRESENT(file_space_id)) file_space_id_default = file_space_id + f_ptr = C_LOC(buf(1,1,1)) + + hdferr = h5dwrite_f_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, f_ptr) + + END SUBROUTINE h5dwrite_real_3 + + SUBROUTINE h5dwrite_real_4(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + REAL, INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3),dims(4)), TARGET :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + TYPE(C_PTR) :: f_ptr + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF(PRESENT(file_space_id)) file_space_id_default = file_space_id + f_ptr = C_LOC(buf(1,1,1,1)) + + hdferr = h5dwrite_f_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, f_ptr) + + END SUBROUTINE h5dwrite_real_4 + + SUBROUTINE h5dwrite_real_5(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + REAL, INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)), TARGET :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + TYPE(C_PTR) :: f_ptr + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF(PRESENT(file_space_id)) file_space_id_default = file_space_id + f_ptr = C_LOC(buf(1,1,1,1,1)) + + hdferr = h5dwrite_f_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, f_ptr) + + END SUBROUTINE h5dwrite_real_5 + + SUBROUTINE h5dwrite_real_6(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + REAL, INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)), TARGET :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + TYPE(C_PTR) :: f_ptr + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF(PRESENT(file_space_id)) file_space_id_default = file_space_id + f_ptr = C_LOC(buf(1,1,1,1,1,1)) + + hdferr = h5dwrite_f_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, f_ptr) + + END SUBROUTINE h5dwrite_real_6 + + SUBROUTINE h5dwrite_real_7(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + REAL, INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)), TARGET :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + TYPE(C_PTR) :: f_ptr + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF(PRESENT(file_space_id)) file_space_id_default = file_space_id + f_ptr = C_LOC(buf(1,1,1,1,1,1,1)) + + hdferr = h5dwrite_f_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, f_ptr) + + END SUBROUTINE h5dwrite_real_7 + +! +! NAME +! h5dread_f +! +! PURPOSE +! Reads raw data from the specified dataset into buf, +! converting from file datatype and dataspace to memory +! datatype and dataspace. +! +! Inputs: +! dset_id - dataset identifier +! mem_type_id - memory type identifier +! dims - 1-dim array of size 7; dims(k) has the size +! - of k-th dimension of the buf array +! Outputs: +! buf - buffer to read data in +! hdferr: - error code +! Success: 0 +! Failure: -1 +! Optional parameters: +! mem_space_id - memory dataspace identifier +! file_space_id - file dataspace identifier +! xfer_prp - trasfer property list identifier +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). February 28, 2001 +! +! dims parameter was added to make code portable; +! n parameter was replaced with dims parameter in +! the h5dwrite_reference_obj and h5dwrite_reference_dsetreg +! functions. April 2, 2001 +! +! NOTES +! This function is overloaded to read INTEGER, +! REAL, DOUBLE PRECISION and CHARACTER buffers +! up to 7 dimensions, and one dimensional buffers +! of the TYPE(hobj_ref_t_f) and TYPE(hdset_reg_ref_t_f) +! types. +! + SUBROUTINE h5dread_reference_obj(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + TYPE(hobj_ref_t_f), INTENT(INOUT) , & + DIMENSION(dims(1)), TARGET :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + TYPE(C_PTR) :: f_ptr + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF(PRESENT(file_space_id)) file_space_id_default = file_space_id + f_ptr = C_LOC(buf(1)) + + hdferr = h5dread_f_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, f_ptr) + + END SUBROUTINE h5dread_reference_obj + + SUBROUTINE h5dread_reference_dsetreg(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + TYPE(hdset_reg_ref_t_f), INTENT(INOUT), & + DIMENSION(dims(1)), TARGET :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + TYPE(C_PTR) :: f_ptr + + INTEGER, ALLOCATABLE, DIMENSION(:) :: ref_buf + INTEGER :: i,j + INTERFACE + INTEGER FUNCTION h5dread_ref_reg_c(dset_id, mem_type_id,& + 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 + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + INTEGER, DIMENSION(*) :: ref_buf + END FUNCTION h5dread_ref_reg_c + END INTERFACE + + ALLOCATE(ref_buf(REF_REG_BUF_LEN*dims(1)), stat=hdferr) + IF (hdferr .NE. 0) THEN + hdferr = -1 + RETURN + ENDIF + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF(PRESENT(file_space_id)) file_space_id_default = file_space_id + + hdferr = h5dread_ref_reg_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, ref_buf, dims) + + DO j = 1, dims(1) + DO i = 1, REF_REG_BUF_LEN + buf(j)%ref(i) = ref_buf(REF_REG_BUF_LEN*(j-1) + i) + ENDDO + ENDDO + DEALLOCATE(ref_buf) + + END SUBROUTINE h5dread_reference_dsetreg + + + SUBROUTINE h5dread_integer_scalar(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + INTEGER, INTENT(INOUT) , TARGET :: buf ! Data buffer + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + TYPE(C_PTR) :: f_ptr + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF(PRESENT(file_space_id)) file_space_id_default = file_space_id + f_ptr = C_LOC(buf) + + hdferr = h5dread_f_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, f_ptr) + + + END SUBROUTINE h5dread_integer_scalar + + SUBROUTINE h5dread_integer_1(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + INTEGER, INTENT(INOUT), & + DIMENSION(dims(1)) , TARGET :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + TYPE(C_PTR) :: f_ptr + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF(PRESENT(file_space_id)) file_space_id_default = file_space_id + f_ptr = C_LOC(buf(1)) + + hdferr = h5dread_f_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, f_ptr) + + END SUBROUTINE h5dread_integer_1 + + SUBROUTINE h5dread_integer_2(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + INTEGER, INTENT(INOUT), & + DIMENSION(dims(1),dims(2)) , TARGET :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + TYPE(C_PTR) :: f_ptr + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF(PRESENT(file_space_id)) file_space_id_default = file_space_id + f_ptr = C_LOC(buf(1,1)) + + hdferr = h5dread_f_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, f_ptr) + + END SUBROUTINE h5dread_integer_2 + + SUBROUTINE h5dread_integer_3(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + INTEGER, INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3)) , TARGET :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + TYPE(C_PTR) :: f_ptr + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF(PRESENT(file_space_id)) file_space_id_default = file_space_id + f_ptr = C_LOC(buf(1,1,1)) + + hdferr = h5dread_f_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, f_ptr) + + END SUBROUTINE h5dread_integer_3 + + SUBROUTINE h5dread_integer_4(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + INTEGER, INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3),dims(4)) , TARGET :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + TYPE(C_PTR) :: f_ptr + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF(PRESENT(file_space_id)) file_space_id_default = file_space_id + f_ptr = C_LOC(buf(1,1,1,1)) + + hdferr = h5dread_f_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, f_ptr) + + END SUBROUTINE h5dread_integer_4 + + SUBROUTINE h5dread_integer_5(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + INTEGER, INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) , TARGET :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + TYPE(C_PTR) :: f_ptr + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF(PRESENT(file_space_id)) file_space_id_default = file_space_id + f_ptr = C_LOC(buf(1,1,1,1,1)) + + hdferr = h5dread_f_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, f_ptr) + + END SUBROUTINE h5dread_integer_5 + + SUBROUTINE h5dread_integer_6(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + INTEGER, INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) , TARGET :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + TYPE(C_PTR) :: f_ptr + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF(PRESENT(file_space_id)) file_space_id_default = file_space_id + f_ptr = C_LOC(buf(1,1,1,1,1,1)) + + hdferr = h5dread_f_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, f_ptr) + + END SUBROUTINE h5dread_integer_6 + + SUBROUTINE h5dread_integer_7(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + INTEGER, INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) , TARGET :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + TYPE(C_PTR) :: f_ptr + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF(PRESENT(file_space_id)) file_space_id_default = file_space_id + f_ptr = C_LOC(buf(1,1,1,1,1,1,1)) + + hdferr = h5dread_f_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, f_ptr) + + END SUBROUTINE h5dread_integer_7 + + SUBROUTINE h5dread_char_scalar(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + CHARACTER(LEN=*), INTENT(INOUT) :: buf ! Data buffer + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + + CALL h5dread_char_scalar_fix(dset_id, mem_type_id, buf, LEN(buf), dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + + END SUBROUTINE h5dread_char_scalar + + SUBROUTINE h5dread_char_scalar_fix(dset_id, mem_type_id, buf, buf_len, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + INTEGER, INTENT(IN) :: buf_len + CHARACTER(LEN=buf_len), INTENT(INOUT), TARGET :: buf ! Data buffer + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + TYPE(C_PTR) :: f_ptr + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF(PRESENT(file_space_id)) file_space_id_default = file_space_id + + f_ptr = C_LOC(buf(1:1)) + + hdferr = h5dread_f_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, f_ptr) + + END SUBROUTINE h5dread_char_scalar_fix + + SUBROUTINE h5dread_char_1(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + CHARACTER(LEN=*), INTENT(INOUT), & + DIMENSION(dims(1)), TARGET :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + TYPE(C_PTR) :: f_ptr + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF(PRESENT(file_space_id)) file_space_id_default = file_space_id + + f_ptr = C_LOC(buf(1)(1:1)) + hdferr = h5dread_f_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, f_ptr) + + END SUBROUTINE h5dread_char_1 + + SUBROUTINE h5dread_char_2(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + CHARACTER(LEN=*), INTENT(INOUT), & + DIMENSION(dims(1),dims(2)), TARGET :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + TYPE(C_PTR) :: f_ptr + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF(PRESENT(file_space_id)) file_space_id_default = file_space_id + + f_ptr = C_LOC(buf(1,1)(1:1)) + + hdferr = h5dread_f_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, f_ptr) + + END SUBROUTINE h5dread_char_2 + + SUBROUTINE h5dread_char_3(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + CHARACTER(LEN=*), INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3)), TARGET :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + TYPE(C_PTR) :: f_ptr + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF(PRESENT(file_space_id)) file_space_id_default = file_space_id + + f_ptr = C_LOC(buf(1,1,1)(1:1)) + hdferr = h5dread_f_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, f_ptr) + + END SUBROUTINE h5dread_char_3 + + SUBROUTINE h5dread_char_4(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + CHARACTER(LEN=*), INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3),dims(4)), TARGET :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + TYPE(C_PTR) :: f_ptr + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF(PRESENT(file_space_id)) file_space_id_default = file_space_id + + f_ptr = C_LOC(buf(1,1,1,1)(1:1)) + + hdferr = h5dread_f_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, f_ptr) + + END SUBROUTINE h5dread_char_4 + + SUBROUTINE h5dread_char_5(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + CHARACTER(LEN=*), INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)), TARGET :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + TYPE(C_PTR) :: f_ptr + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF(PRESENT(file_space_id)) file_space_id_default = file_space_id + + f_ptr = C_LOC(buf(1,1,1,1,1)(1:1)) + + hdferr = h5dread_f_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, f_ptr) + + END SUBROUTINE h5dread_char_5 + + SUBROUTINE h5dread_char_6(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + CHARACTER(LEN=*), INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)), TARGET :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + TYPE(C_PTR) :: f_ptr + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF(PRESENT(file_space_id)) file_space_id_default = file_space_id + + f_ptr = C_LOC(buf(1,1,1,1,1,1)(1:1)) + + hdferr = h5dread_f_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, f_ptr) + + END SUBROUTINE h5dread_char_6 + + SUBROUTINE h5dread_char_7(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + CHARACTER(LEN=*), INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)), TARGET :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + TYPE(C_PTR) :: f_ptr + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF(PRESENT(file_space_id)) file_space_id_default = file_space_id + + f_ptr = C_LOC(buf(1,1,1,1,1,1,1)(1:1)) + + hdferr = h5dread_f_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, f_ptr) + + END SUBROUTINE h5dread_char_7 + + SUBROUTINE h5dread_real_scalar(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + REAL, INTENT(INOUT) , TARGET :: buf ! Data buffer + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + TYPE(C_PTR) :: f_ptr + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF(PRESENT(file_space_id)) file_space_id_default = file_space_id + f_ptr = C_LOC(buf) + + hdferr = h5dread_f_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, f_ptr) + + END SUBROUTINE h5dread_real_scalar + + SUBROUTINE h5dread_real_1(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + REAL, INTENT(INOUT), & + DIMENSION(dims(1)) , TARGET :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + TYPE(C_PTR) :: f_ptr + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF(PRESENT(file_space_id)) file_space_id_default = file_space_id + f_ptr = C_LOC(buf(1)) + + hdferr = h5dread_f_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, f_ptr) + + END SUBROUTINE h5dread_real_1 + + SUBROUTINE h5dread_real_2(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + REAL, INTENT(INOUT), & + DIMENSION(dims(1),dims(2)) , TARGET :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + TYPE(C_PTR) :: f_ptr + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF(PRESENT(file_space_id)) file_space_id_default = file_space_id + f_ptr = C_LOC(buf(1,1)) + + hdferr = h5dread_f_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, f_ptr) + + END SUBROUTINE h5dread_real_2 + + SUBROUTINE h5dread_real_3(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + REAL, INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3)) , TARGET :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + TYPE(C_PTR) :: f_ptr + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF(PRESENT(file_space_id)) file_space_id_default = file_space_id + f_ptr = C_LOC(buf(1,1,1)) + + hdferr = h5dread_f_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, f_ptr) + + END SUBROUTINE h5dread_real_3 + + SUBROUTINE h5dread_real_4(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + REAL, INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3), dims(4)) , TARGET :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + TYPE(C_PTR) :: f_ptr + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF(PRESENT(file_space_id)) file_space_id_default = file_space_id + f_ptr = C_LOC(buf(1,1,1,1)) + + hdferr = h5dread_f_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, f_ptr) + + END SUBROUTINE h5dread_real_4 + + SUBROUTINE h5dread_real_5(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + REAL, INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) , TARGET :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + TYPE(C_PTR) :: f_ptr + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF(PRESENT(file_space_id)) file_space_id_default = file_space_id + f_ptr = C_LOC(buf(1,1,1,1,1)) + + hdferr = h5dread_f_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, f_ptr) + + END SUBROUTINE h5dread_real_5 + + SUBROUTINE h5dread_real_6(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + REAL, INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) , TARGET :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + TYPE(C_PTR) :: f_ptr + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF(PRESENT(file_space_id)) file_space_id_default = file_space_id + f_ptr = C_LOC(buf(1,1,1,1,1,1)) + + hdferr = h5dread_f_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, f_ptr) + + END SUBROUTINE h5dread_real_6 + + SUBROUTINE h5dread_real_7(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + REAL, INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) , TARGET :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + TYPE(C_PTR) :: f_ptr + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF(PRESENT(file_space_id)) file_space_id_default = file_space_id + f_ptr = C_LOC(buf(1,1,1,1,1,1,1)) + + hdferr = h5dread_f_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, f_ptr) + + END SUBROUTINE h5dread_real_7 + +!****s* H5D (F03)/h5dwrite_f_F03 +! +! NAME +! h5dwrite_f_F03 +! +! PURPOSE +! Writes raw data from a dataset into a buffer. +! +! Inputs: +! dset_id - Identifier of the dataset to write to. +! mem_type_id - Identifier of the memory datatype. +! buf - Buffer with data to be written to the file. +! +! Outputs: +! hdferr - Returns 0 if successful and -1 if fails +! +! Optional parameters: +! mem_space_id - Identifier of the memory dataspace. +! file_space_id - Identifier of the dataset's dataspace in the file. +! xfer_prp - Identifier of a transfer property list for this I/O operation. +! +! AUTHOR +! M. Scot Breitenfeld +! September 17, 2011 +! +! Fortran2003 Interface: +!! SUBROUTINE h5dwrite_f(dset_id, mem_type_id, buf, hdferr, & +!! mem_space_id, file_space_id, xfer_prp) +!! INTEGER(HID_T), INTENT(IN) :: dset_id +!! INTEGER(HID_T), INTENT(IN) :: mem_type_id +!! TYPE(C_PTR) , INTENT(IN) :: buf +!! INTEGER , INTENT(OUT) :: hdferr +!! INTEGER(HID_T), INTENT(IN) , OPTIONAL :: mem_space_id +!! INTEGER(HID_T), INTENT(IN) , OPTIONAL :: file_space_id +!! INTEGER(HID_T), INTENT(IN) , OPTIONAL :: xfer_prp +!***** + SUBROUTINE h5dwrite_ptr(dset_id, mem_type_id, buf, hdferr, & + mem_space_id, file_space_id, xfer_prp) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + TYPE(C_PTR), INTENT(IN) :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF (PRESENT(file_space_id)) file_space_id_default = file_space_id + + hdferr = h5dwrite_f_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, buf) + + END SUBROUTINE h5dwrite_ptr +!****s* H5D (F03)/h5dread_f_F03 +! +! NAME +! h5dread_f_F03 +! +! PURPOSE +! Reads raw data from a dataset into a buffer. +! +! Inputs: +! dset_id - Identifier of the dataset read from. +! mem_type_id - Identifier of the memory datatype. +! +! Outputs: +! buf - Buffer to receive data read from file. +! hdferr - Returns 0 if successful and -1 if fails +! +! Optional parameters: +! mem_space_id - Identifier of the memory dataspace. +! file_space_id - Identifier of the dataset's dataspace in the file. +! xfer_prp - Identifier of a transfer property list for this I/O operation. +! +! AUTHOR +! M. Scot Breitenfeld +! September 17, 2011 +! +! Fortran2003 Interface: +!! SUBROUTINE h5dread_f(dset_id, mem_type_id, buf, hdferr, & +!! mem_space_id, file_space_id, xfer_prp) +!! INTEGER(HID_T), INTENT(IN) :: dset_id +!! INTEGER(HID_T), INTENT(IN) :: mem_type_id +!! TYPE(C_PTR) , INTENT(INOUT) :: buf +!! INTEGER , INTENT(OUT) :: hdferr +!! INTEGER(HID_T), INTENT(IN) , OPTIONAL :: mem_space_id +!! INTEGER(HID_T), INTENT(IN) , OPTIONAL :: file_space_id +!! INTEGER(HID_T), INTENT(IN) , OPTIONAL :: xfer_prp +!***** + SUBROUTINE h5dread_ptr(dset_id, mem_type_id, buf, hdferr, & + mem_space_id, file_space_id, xfer_prp) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + TYPE(C_PTR), INTENT(INOUT) :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF (PRESENT(file_space_id)) file_space_id_default = file_space_id + + hdferr = h5dread_f_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, buf) + + END SUBROUTINE h5dread_ptr + +! +! NAME +! h5dfill_integer +! +! PURPOSE +! Fills dataspace elements with a fill value in a memory buffer. +! Only INTEGER, CHARACTER, REAL and DOUBLE PRECISION datatypes +! of the fillvalues and buffers are supported. Buffer and fillvalue +! are assumed to have the same datatype. +! Only one-dimesional buffers are supported. +! +! Inputs: +! fill_value - fill value +! space_id - memory space selection identifier +! buf - data buffer iin memory ro apply selection to +! - of k-th dimension of the buf array +! Outputs: +! hdferr: - error code +! Success: 0 +! Failure: -1 +! AUTHOR +! Elena Pourmal +! March 12, 2003 +! +! + + SUBROUTINE h5dfill_integer(fill_value, space_id, buf, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER, INTENT(IN), TARGET :: fill_value ! Fill value + INTEGER(HID_T), INTENT(IN) :: space_id ! Memory dataspace selection identifier + INTEGER, INTENT(IN), DIMENSION(*), TARGET :: buf ! Memory buffer to fill in + INTEGER, INTENT(OUT) :: hdferr ! Error code + + INTEGER(HID_T) :: fill_type_id ! Fill value datatype identifier + INTEGER(HID_T) :: mem_type_id ! Buffer dadtype identifier + + TYPE(C_PTR) :: f_ptr_fill_value ! C pointer to fill_value + TYPE(C_PTR) :: f_ptr_buf ! C pointer to buf + + f_ptr_fill_value = C_LOC(fill_value) + f_ptr_buf = C_LOC(buf(1)) + + fill_type_id = H5T_NATIVE_INTEGER + mem_type_id = H5T_NATIVE_INTEGER + + hdferr = h5dfill_c(f_ptr_fill_value, fill_type_id, space_id, & + f_ptr_buf, mem_type_id) + + END SUBROUTINE h5dfill_integer + +! +! NAME +! h5dfill_real +! +! PURPOSE +! Fills dataspace elements with a fill value in a memory buffer. +! Only INTEGER, CHARACTER, REAL and DOUBLE PRECISION datatypes +! of the fillvalues and buffers are supported. Buffer and fillvalue +! are assumed to have the same datatype. +! Only one-dimesional buffers are supported. +! +! Inputs: +! fill_value - fill value +! space_id - memory space selection identifier +! buf - data buffer iin memory ro apply selection to +! - of k-th dimension of the buf array +! Outputs: +! hdferr: - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! March 12, 2003 +! + SUBROUTINE h5dfill_real(fill_valuer, space_id, buf, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + REAL, INTENT(IN), TARGET :: fill_valuer ! Fill value + INTEGER(HID_T), INTENT(IN) :: space_id ! Memory dataspace selection identifier + REAL, INTENT(IN), DIMENSION(*), TARGET :: buf ! Memory buffer to fill in + INTEGER, INTENT(OUT) :: hdferr ! Error code + + INTEGER(HID_T) :: fill_type_id ! Fill value datatype identifier + INTEGER(HID_T) :: mem_type_id ! Buffer dadtype identifier + + TYPE(C_PTR) :: f_ptr_fill_valuer ! C pointer to fill_value + TYPE(C_PTR) :: f_ptr_buf ! C pointer to buf + + f_ptr_fill_valuer = C_LOC(fill_valuer) + f_ptr_buf = C_LOC(buf(1)) + + fill_type_id = H5T_NATIVE_REAL + mem_type_id = H5T_NATIVE_REAL + + hdferr = h5dfill_c(f_ptr_fill_valuer, fill_type_id, space_id, & + f_ptr_buf, mem_type_id) + + END SUBROUTINE h5dfill_real + +! +! NAME +! h5dfill_char +! +! PURPOSE +! Fills dataspace elements with a fill value in a memory buffer. +! Only INTEGER, CHARACTER, REAL and DOUBLE PRECISION datatypes +! of the fillvalues and buffers are supported. Buffer and fillvalue +! are assumed to have the same datatype. +! Only one-dimesional buffers are supported. +! +! Inputs: +! fill_value - fill value +! space_id - memory space selection identifier +! buf - data buffer iin memory ro apply selection to +! - of k-th dimension of the buf array +! Outputs: +! hdferr: - error code +! Success: 0 +! Failure: -1 +! AUTHOR +! Elena Pourmal +! March 12, 2003 +! + SUBROUTINE h5dfill_char(fill_value, space_id, buf, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + CHARACTER, INTENT(IN), TARGET :: fill_value ! Fill value + INTEGER(HID_T), INTENT(IN) :: space_id ! Memory dataspace selection identifier + CHARACTER, INTENT(IN), DIMENSION(*), TARGET :: buf ! Memory buffer to fill in + INTEGER, INTENT(OUT) :: hdferr ! Error code + + INTEGER(HID_T) :: fill_type_id ! Fill value datatype identifier + INTEGER(HID_T) :: mem_type_id ! Buffer dadtype identifier + + TYPE(C_PTR) :: f_ptr_fill_value ! C pointer to fill_value + TYPE(C_PTR) :: f_ptr_buf ! C pointer to buf + + f_ptr_fill_value = C_LOC(fill_value) + f_ptr_buf = C_LOC(buf(1)) + + hdferr = h5dfill_c(f_ptr_fill_value, fill_type_id, space_id, & + f_ptr_buf, mem_type_id) + + END SUBROUTINE h5dfill_char +! +!****s* H5D (F03)/h5dvlen_reclaim_f +! NAME +! h5dvlen_reclaim_f +! +! PURPOSE +! Reclaims VL datatype memory buffers. +! +! Inputs: +! +! type_id - Identifier of the datatype. +! space_id - Identifier of the dataspace. +! plist_id - Identifier of the property list used to create the buffer. +! buf - Pointer to the buffer to be reclaimed. +! +! Outputs: +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! M. Scot Breitenfeld +! January 11, 2011 +! +! Fortran2003 Interface: + SUBROUTINE h5dvlen_reclaim_f(type_id, space_id, plist_id, buf, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER(HID_T), INTENT(IN) :: plist_id + TYPE(C_PTR) , INTENT(INOUT) :: buf + INTEGER , INTENT(OUT) :: hdferr +!***** + + INTERFACE + INTEGER FUNCTION h5dvlen_reclaim_c(type_id, space_id, plist_id, buf) + USE H5GLOBAL + USE, INTRINSIC :: ISO_C_BINDING + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DVLEN_RECLAIM_C'::h5dvlen_reclaim_c + !DEC$ENDIF + INTEGER(HID_T) :: type_id + INTEGER(HID_T) :: space_id + INTEGER(HID_T) :: plist_id + TYPE(C_PTR), VALUE :: buf + END FUNCTION h5dvlen_reclaim_c + END INTERFACE + + hdferr = H5Dvlen_reclaim_c(type_id, space_id, plist_id, buf) + + END SUBROUTINE H5Dvlen_reclaim_f + +END MODULE H5D_PROVISIONAL + + diff --git a/fortran/src/H5Dff_F90.f90 b/fortran/src/H5Dff_F90.f90 new file mode 100644 index 0000000..3bb0fc0 --- /dev/null +++ b/fortran/src/H5Dff_F90.f90 @@ -0,0 +1,3002 @@ +!****h* ROBODoc/H5D (F90) +! +! NAME +! +! H5D_PROVISIONAL +! +! PURPOSE +! +! This file contains Fortran 90 interfaces for H5D functions. It contains +! the same functions as H5Dff_F03.f90 but excludes the Fortran 2003 functions +! and the interface listings. This file will be compiled instead of H5Dff_F03.f90 +! if Fortran 2003 functions are not enabled. +! +! COPYRIGHT +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +! NOTES +! (1) The maximum rank of an array allowed in Fortran is 7, therefore +! we only provide an interface for arrays up to and including rank 7. +! +! (2) Unfortunately we are using a generic interface and one of the factors +! used in determining the proper routine to select is that of the array +! rank being passed, therefore we can not create just one subroutine for +! each array type (integer, real, etc...) of various ranks and then use a +! rank 1 array of assumed size in the just one subroutine, +! (i.e. integer, dimension(*) :: ... ) +! (i.e. real , dimension(*) :: ... ) etc... +! +! (3) +! *** IMPORTANT *** +! If you add a new H5D function you must add the function name to the +! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! This is needed for Windows based operating systems. +!***** + +MODULE H5D_PROVISIONAL + USE H5GLOBAL + + INTERFACE h5dwrite_f + + MODULE PROCEDURE h5dwrite_reference_obj + MODULE PROCEDURE h5dwrite_reference_dsetreg + MODULE PROCEDURE h5dwrite_integer_scalar + MODULE PROCEDURE h5dwrite_integer_1 + MODULE PROCEDURE h5dwrite_integer_2 + MODULE PROCEDURE h5dwrite_integer_3 + MODULE PROCEDURE h5dwrite_integer_4 + MODULE PROCEDURE h5dwrite_integer_5 + MODULE PROCEDURE h5dwrite_integer_6 + MODULE PROCEDURE h5dwrite_integer_7 + MODULE PROCEDURE h5dwrite_char_scalar + MODULE PROCEDURE h5dwrite_char_1 + MODULE PROCEDURE h5dwrite_char_2 + MODULE PROCEDURE h5dwrite_char_3 + MODULE PROCEDURE h5dwrite_char_4 + MODULE PROCEDURE h5dwrite_char_5 + MODULE PROCEDURE h5dwrite_char_6 + MODULE PROCEDURE h5dwrite_char_7 + MODULE PROCEDURE h5dwrite_real_scalar + MODULE PROCEDURE h5dwrite_real_1 + MODULE PROCEDURE h5dwrite_real_2 + MODULE PROCEDURE h5dwrite_real_3 + MODULE PROCEDURE h5dwrite_real_4 + MODULE PROCEDURE h5dwrite_real_5 + MODULE PROCEDURE h5dwrite_real_6 + MODULE PROCEDURE h5dwrite_real_7 + + END INTERFACE + + INTERFACE h5dread_f + + MODULE PROCEDURE h5dread_reference_obj + MODULE PROCEDURE h5dread_reference_dsetreg + MODULE PROCEDURE h5dread_integer_scalar + MODULE PROCEDURE h5dread_integer_1 + MODULE PROCEDURE h5dread_integer_2 + MODULE PROCEDURE h5dread_integer_3 + MODULE PROCEDURE h5dread_integer_4 + MODULE PROCEDURE h5dread_integer_5 + MODULE PROCEDURE h5dread_integer_6 + MODULE PROCEDURE h5dread_integer_7 + MODULE PROCEDURE h5dread_char_scalar + MODULE PROCEDURE h5dread_char_1 + MODULE PROCEDURE h5dread_char_2 + MODULE PROCEDURE h5dread_char_3 + MODULE PROCEDURE h5dread_char_4 + MODULE PROCEDURE h5dread_char_5 + MODULE PROCEDURE h5dread_char_6 + MODULE PROCEDURE h5dread_char_7 + MODULE PROCEDURE h5dread_real_scalar + MODULE PROCEDURE h5dread_real_1 + MODULE PROCEDURE h5dread_real_2 + MODULE PROCEDURE h5dread_real_3 + MODULE PROCEDURE h5dread_real_4 + MODULE PROCEDURE h5dread_real_5 + MODULE PROCEDURE h5dread_real_6 + MODULE PROCEDURE h5dread_real_7 + END INTERFACE + + INTERFACE h5dfill_f + MODULE PROCEDURE h5dfill_integer + MODULE PROCEDURE h5dfill_real + MODULE PROCEDURE h5dfill_char + END INTERFACE + +CONTAINS + +!****s* H5D/h5dread_f +! +! NAME +! h5dread_f +! +! PURPOSE +! Reads raw data from the specified dataset into buf, +! converting from file datatype and dataspace to memory +! datatype and dataspace. +! +! INPUTS +! dset_id - dataset identifier +! mem_type_id - memory type identifier +! dims - 1-dim array of size 7; dims(k) has the size +! of k-th dimension of the buf array +! OUTPUTS +! buf - buffer to read data in +! hdferr: - error code +! Success: 0 +! Failure: -1 +! +! OPTIONAL PARAMETERS +! mem_space_id - memory dataspace identifier +! file_space_id - file dataspace identifier +! xfer_prp - trasfer property list identifier +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). February 28, 2001 +! +! dims parameter was added to make code portable; +! n parameter was replaced with dims parameter in +! the h5dwrite_reference_obj and h5dwrite_reference_dsetreg +! functions. April 2, 2001 +! +! NOTES +! This function is overloaded to read INTEGER, +! REAL, DOUBLE PRECISION and CHARACTER buffers +! up to 7 dimensions, and one dimensional buffers +! of the TYPE(hobj_ref_t_f) and TYPE(hdset_reg_ref_t_f) types. +!***** + SUBROUTINE h5dread_reference_obj(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + TYPE(hobj_ref_t_f), INTENT(INOUT) , & + DIMENSION(dims(1)) :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HADDR_T), ALLOCATABLE, DIMENSION(:) :: ref_buf + INTEGER :: j + + INTERFACE + INTEGER FUNCTION h5dread_ref_obj_c(dset_id, mem_type_id,& + 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 + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + INTEGER(HADDR_T), DIMENSION(*) :: ref_buf + END FUNCTION h5dread_ref_obj_c + END INTERFACE + + ALLOCATE(ref_buf(dims(1)), stat=hdferr) + IF (hdferr .NE. 0) THEN + hdferr = -1 + RETURN + ENDIF + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF (PRESENT(file_space_id)) file_space_id_default = file_space_id + + hdferr = h5dread_ref_obj_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, ref_buf, dims) + DO j = 1, dims(1) + buf(j)%ref = ref_buf(j) + ENDDO + DEALLOCATE(ref_buf) + END SUBROUTINE h5dread_reference_obj + + SUBROUTINE h5dread_reference_dsetreg(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + TYPE(hdset_reg_ref_t_f), INTENT(INOUT), & + DIMENSION(dims(1)) :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER, ALLOCATABLE, DIMENSION(:) :: ref_buf + INTEGER :: i,j + + INTERFACE + INTEGER FUNCTION h5dread_ref_reg_c(dset_id, mem_type_id,& + 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 + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + INTEGER, DIMENSION(*) :: ref_buf + END FUNCTION h5dread_ref_reg_c + END INTERFACE + + ALLOCATE(ref_buf(REF_REG_BUF_LEN*dims(1)), stat=hdferr) + IF (hdferr .NE. 0) THEN + hdferr = -1 + RETURN + ENDIF + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF (PRESENT(file_space_id)) file_space_id_default = file_space_id + + hdferr = h5dread_ref_reg_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, ref_buf, dims) + + DO j = 1, dims(1) + DO i = 1, REF_REG_BUF_LEN + buf(j)%ref(i) = ref_buf(REF_REG_BUF_LEN*(j-1) + i) + ENDDO + ENDDO + DEALLOCATE(ref_buf) + END SUBROUTINE h5dread_reference_dsetreg + + SUBROUTINE h5dread_integer_scalar(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + INTEGER, INTENT(INOUT) :: buf ! Data buffer + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + + INTERFACE + INTEGER FUNCTION h5dread_integer_s_c(dset_id, mem_type_id, & + mem_space_id_default, & + 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 + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + INTEGER, INTENT(OUT) :: buf + END FUNCTION h5dread_integer_s_c + END INTERFACE + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF (PRESENT(file_space_id)) file_space_id_default = file_space_id + + hdferr = h5dread_integer_s_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, buf, dims) + + END SUBROUTINE h5dread_integer_scalar + + SUBROUTINE h5dread_integer_1(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + INTEGER, INTENT(INOUT), DIMENSION(dims(1)) :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + + INTERFACE + INTEGER FUNCTION h5dread_integer_1_c(dset_id, mem_type_id, & + mem_space_id_default, & + 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 + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + INTEGER, INTENT(OUT), DIMENSION(dims(1)) :: buf + END FUNCTION h5dread_integer_1_c + END INTERFACE + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF (PRESENT(file_space_id)) file_space_id_default = file_space_id + + hdferr = h5dread_integer_1_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, buf, dims) + + END SUBROUTINE h5dread_integer_1 + + SUBROUTINE h5dread_integer_2(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + INTEGER, INTENT(INOUT), DIMENSION(dims(1),dims(2)) :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + + INTERFACE + INTEGER FUNCTION h5dread_integer_2_c(dset_id, mem_type_id, & + mem_space_id_default, & + 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 + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + INTEGER, INTENT(OUT), DIMENSION(dims(1),dims(2)) :: buf + END FUNCTION h5dread_integer_2_c + END INTERFACE + + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF (PRESENT(file_space_id)) file_space_id_default = file_space_id + + hdferr = h5dread_integer_2_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, & + buf, dims) + + END SUBROUTINE h5dread_integer_2 + + SUBROUTINE h5dread_integer_3(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + INTEGER, INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3)) :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + + ! + ! MS FORTRAN needs explicit interface for C functions called here. + ! + INTERFACE + INTEGER FUNCTION h5dread_integer_3_c(dset_id, mem_type_id, & + mem_space_id_default, & + 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 + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + INTEGER, INTENT(OUT), DIMENSION(dims(1),dims(2),dims(3)) :: buf + END FUNCTION h5dread_integer_3_c + END INTERFACE + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF (PRESENT(file_space_id)) file_space_id_default = file_space_id + + hdferr = h5dread_integer_3_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, & + buf, dims) + + END SUBROUTINE h5dread_integer_3 + + SUBROUTINE h5dread_integer_4(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + INTEGER, INTENT(INOUT), DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + + ! + ! MS FORTRAN needs explicit interface for C functions called here. + ! + INTERFACE + INTEGER FUNCTION h5dread_integer_4_c(dset_id, mem_type_id, & + mem_space_id_default, & + 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 + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + INTEGER, INTENT(OUT), DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf + END FUNCTION h5dread_integer_4_c + END INTERFACE + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF (PRESENT(file_space_id)) file_space_id_default = file_space_id + + hdferr = h5dread_integer_4_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, & + buf, dims) + + END SUBROUTINE h5dread_integer_4 + + SUBROUTINE h5dread_integer_5(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + INTEGER, INTENT(INOUT), DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + + ! + ! MS FORTRAN needs explicit interface for C functions called here. + ! + INTERFACE + INTEGER FUNCTION h5dread_integer_5_c(dset_id, mem_type_id, & + mem_space_id_default, & + 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 + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + INTEGER, INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf + END FUNCTION h5dread_integer_5_c + END INTERFACE + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF (PRESENT(file_space_id)) file_space_id_default = file_space_id + + hdferr = h5dread_integer_5_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, & + buf, dims) + + END SUBROUTINE h5dread_integer_5 + + SUBROUTINE h5dread_integer_6(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + INTEGER, INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + + + INTERFACE + INTEGER FUNCTION h5dread_integer_6_c(dset_id, mem_type_id, & + mem_space_id_default, & + 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 + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + INTEGER, INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf + END FUNCTION h5dread_integer_6_c + END INTERFACE + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF (PRESENT(file_space_id)) file_space_id_default = file_space_id + + hdferr = h5dread_integer_6_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, & + buf, dims) + + END SUBROUTINE h5dread_integer_6 + + SUBROUTINE h5dread_integer_7(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + INTEGER, INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + + INTERFACE + INTEGER FUNCTION h5dread_integer_7_c(dset_id, mem_type_id, & + mem_space_id_default, & + 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 + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + INTEGER, INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf + END FUNCTION h5dread_integer_7_c + END INTERFACE + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF (PRESENT(file_space_id)) file_space_id_default = file_space_id + + hdferr = h5dread_integer_7_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, & + buf, dims) + + END SUBROUTINE h5dread_integer_7 + + SUBROUTINE h5dread_char_scalar(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + CHARACTER(LEN=*), INTENT(INOUT) :: buf ! Data buffer + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + + INTERFACE + INTEGER FUNCTION h5dreadc_s_c(dset_id, mem_type_id, & + mem_space_id_default, & + 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$ATTRIBUTES reference :: buf + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + CHARACTER(LEN=*), INTENT(OUT) :: buf + END FUNCTION h5dreadc_s_c + END INTERFACE + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF (PRESENT(file_space_id)) file_space_id_default = file_space_id + + hdferr = h5dreadc_s_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, buf, dims) + + END SUBROUTINE h5dread_char_scalar + + SUBROUTINE h5dread_char_1(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + CHARACTER(LEN=*), INTENT(INOUT), & + DIMENSION(dims(1)) :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + + INTERFACE + INTEGER FUNCTION h5dreadc_1_c(dset_id, mem_type_id, & + mem_space_id_default, & + 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$ATTRIBUTES reference :: buf + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + CHARACTER(LEN=*), INTENT(INOUT), & + DIMENSION(dims(1)) :: buf + END FUNCTION h5dreadc_1_c + END INTERFACE + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF (PRESENT(file_space_id)) file_space_id_default = file_space_id + + hdferr = h5dreadc_1_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, buf, dims) + + END SUBROUTINE h5dread_char_1 + + SUBROUTINE h5dread_char_2(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + CHARACTER(LEN=*), INTENT(INOUT), & + DIMENSION(dims(1),dims(2)) :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + + + INTERFACE + INTEGER FUNCTION h5dreadc_2_c(dset_id, mem_type_id, & + mem_space_id_default, & + 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$ATTRIBUTES reference :: buf + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + CHARACTER(LEN=*), INTENT(INOUT), & + DIMENSION(dims(1),dims(2)) :: buf + END FUNCTION h5dreadc_2_c + END INTERFACE + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF (PRESENT(file_space_id)) file_space_id_default = file_space_id + + hdferr = h5dreadc_2_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, buf, dims) + + END SUBROUTINE h5dread_char_2 + + SUBROUTINE h5dread_char_3(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + CHARACTER(LEN=*), INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3)) :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + + INTERFACE + INTEGER FUNCTION h5dreadc_3_c(dset_id, mem_type_id, & + mem_space_id_default, & + 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$ATTRIBUTES reference :: buf + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + CHARACTER(LEN=*), INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3)) :: buf + END FUNCTION h5dreadc_3_c + END INTERFACE + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF (PRESENT(file_space_id)) file_space_id_default = file_space_id + + hdferr = h5dreadc_3_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, buf, dims) + + END SUBROUTINE h5dread_char_3 + + SUBROUTINE h5dread_char_4(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + CHARACTER(LEN=*), INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + + INTERFACE + INTEGER FUNCTION h5dreadc_4_c(dset_id, mem_type_id, & + mem_space_id_default, & + 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$ATTRIBUTES reference :: buf + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + CHARACTER(LEN=*), INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf + END FUNCTION h5dreadc_4_c + END INTERFACE + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF (PRESENT(file_space_id)) file_space_id_default = file_space_id + + hdferr = h5dreadc_4_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, buf, dims) + + END SUBROUTINE h5dread_char_4 + + SUBROUTINE h5dread_char_5(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + CHARACTER(LEN=*), INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + + INTERFACE + INTEGER FUNCTION h5dreadc_5_c(dset_id, mem_type_id, & + mem_space_id_default, & + 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$ATTRIBUTES reference :: buf + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + CHARACTER(LEN=*), INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf + END FUNCTION h5dreadc_5_c + END INTERFACE + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF (PRESENT(file_space_id)) file_space_id_default = file_space_id + + hdferr = h5dreadc_5_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, buf, dims) + + END SUBROUTINE h5dread_char_5 + + SUBROUTINE h5dread_char_6(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + CHARACTER(LEN=*), INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + + INTERFACE + INTEGER FUNCTION h5dreadc_6_c(dset_id, mem_type_id, & + mem_space_id_default, & + 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$ATTRIBUTES reference :: buf + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + CHARACTER(LEN=*), INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf + END FUNCTION h5dreadc_6_c + END INTERFACE + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF (PRESENT(file_space_id)) file_space_id_default = file_space_id + + hdferr = h5dreadc_6_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, buf, dims) + + END SUBROUTINE h5dread_char_6 + + SUBROUTINE h5dread_char_7(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + CHARACTER(LEN=*), INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + + INTERFACE + INTEGER FUNCTION h5dreadc_7_c(dset_id, mem_type_id, & + mem_space_id_default, & + 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$ATTRIBUTES reference :: buf + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + CHARACTER(LEN=*), INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf + END FUNCTION h5dreadc_7_c + END INTERFACE + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF (PRESENT(file_space_id)) file_space_id_default = file_space_id + + hdferr = h5dreadc_7_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, buf, dims) + + END SUBROUTINE h5dread_char_7 + + SUBROUTINE h5dread_real_scalar(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + REAL, INTENT(INOUT) :: buf ! Data buffer + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + + INTERFACE + INTEGER FUNCTION h5dread_real_s_c(dset_id, mem_type_id, & + mem_space_id_default, & + 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 + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + REAL, INTENT(OUT) :: buf + END FUNCTION h5dread_real_s_c + END INTERFACE + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF (PRESENT(file_space_id)) file_space_id_default = file_space_id + + hdferr = h5dread_real_s_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, buf, dims) + + END SUBROUTINE h5dread_real_scalar + + SUBROUTINE h5dread_real_1(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + REAL, INTENT(INOUT), & + DIMENSION(dims(1)) :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + + ! INTEGER, EXTERNAL :: h5dread_real_1_c + ! MS FORTRAN needs explicit interface for C functions called here. + ! + INTERFACE + INTEGER FUNCTION h5dread_real_1_c(dset_id, mem_type_id, & + mem_space_id_default, & + 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 + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + REAL, INTENT(INOUT), & + DIMENSION(dims(1)) :: buf + END FUNCTION h5dread_real_1_c + END INTERFACE + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF (PRESENT(file_space_id)) file_space_id_default = file_space_id + + hdferr = h5dread_real_1_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, buf, dims) + + END SUBROUTINE h5dread_real_1 + + SUBROUTINE h5dread_real_2(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + REAL, INTENT(INOUT), & + DIMENSION(dims(1),dims(2)) :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + + INTERFACE + INTEGER FUNCTION h5dread_real_2_c(dset_id, mem_type_id, & + mem_space_id_default, & + 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 + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + REAL, INTENT(INOUT), & + DIMENSION(dims(1),dims(2)) :: buf + END FUNCTION h5dread_real_2_c + END INTERFACE + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF (PRESENT(file_space_id)) file_space_id_default = file_space_id + + hdferr = h5dread_real_2_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, buf, dims) + + END SUBROUTINE h5dread_real_2 + + SUBROUTINE h5dread_real_3(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + REAL, INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3)) :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + + INTERFACE + INTEGER FUNCTION h5dread_real_3_c(dset_id, mem_type_id, & + mem_space_id_default, & + 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 + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + REAL, INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3)) :: buf + END FUNCTION h5dread_real_3_c + END INTERFACE + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF (PRESENT(file_space_id)) file_space_id_default = file_space_id + + hdferr = h5dread_real_3_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, buf, dims) + + END SUBROUTINE h5dread_real_3 + + SUBROUTINE h5dread_real_4(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + REAL, INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3), dims(4)) :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + + INTERFACE + INTEGER FUNCTION h5dread_real_4_c(dset_id, mem_type_id, & + mem_space_id_default, & + 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 + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + REAL, INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3), dims(4)) :: buf + END FUNCTION h5dread_real_4_c + END INTERFACE + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF (PRESENT(file_space_id)) file_space_id_default = file_space_id + + hdferr = h5dread_real_4_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, buf, dims) + + END SUBROUTINE h5dread_real_4 + + SUBROUTINE h5dread_real_5(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + REAL, INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + + INTERFACE + INTEGER FUNCTION h5dread_real_5_c(dset_id, mem_type_id, & + mem_space_id_default, & + 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 + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + REAL, INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf + END FUNCTION h5dread_real_5_c + END INTERFACE + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF (PRESENT(file_space_id)) file_space_id_default = file_space_id + + hdferr = h5dread_real_5_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, buf, dims) + + END SUBROUTINE h5dread_real_5 + + SUBROUTINE h5dread_real_6(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + REAL, INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + + INTERFACE + INTEGER FUNCTION h5dread_real_6_c(dset_id, mem_type_id, & + mem_space_id_default, & + 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 + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + REAL, INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf + END FUNCTION h5dread_real_6_c + END INTERFACE + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF (PRESENT(file_space_id)) file_space_id_default = file_space_id + + hdferr = h5dread_real_6_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, buf, dims) + + END SUBROUTINE h5dread_real_6 + + SUBROUTINE h5dread_real_7(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + REAL, INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + + INTERFACE + INTEGER FUNCTION h5dread_real_7_c(dset_id, mem_type_id, & + mem_space_id_default, & + 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 + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + REAL, INTENT(INOUT), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf + END FUNCTION h5dread_real_7_c + END INTERFACE + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF (PRESENT(file_space_id)) file_space_id_default = file_space_id + + hdferr = h5dread_real_7_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, buf, dims) + + END SUBROUTINE h5dread_real_7 + + SUBROUTINE h5dwrite_reference_obj(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: dims ! size of the bufffer buf + TYPE(hobj_ref_t_f), DIMENSION(dims(1)), INTENT(IN) :: buf ! Data buffer + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HADDR_T), ALLOCATABLE, DIMENSION(:) :: ref_buf + INTEGER :: j + + INTERFACE + INTEGER FUNCTION h5dwrite_ref_obj_c(dset_id, mem_type_id,& + 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 + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HADDR_T), DIMENSION(*) :: ref_buf + INTEGER(HSIZE_T), DIMENSION(*) :: dims + END FUNCTION h5dwrite_ref_obj_c + END INTERFACE + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF (PRESENT(file_space_id)) file_space_id_default = file_space_id + + ALLOCATE(ref_buf(dims(1)), stat=hdferr) + IF (hdferr .NE. 0 ) THEN + hdferr = -1 + RETURN + ELSE + DO j = 1, dims(1) + ref_buf(j) = buf(j)%ref + ENDDO + ENDIF + hdferr = h5dwrite_ref_obj_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, ref_buf, dims(1)) + DEALLOCATE(ref_buf) + + END SUBROUTINE h5dwrite_reference_obj + + SUBROUTINE h5dwrite_reference_dsetreg(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: dims ! size of the bufffer buf + TYPE(hdset_reg_ref_t_f), DIMENSION(dims(1)), INTENT(IN) :: buf ! Data buffer + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER, ALLOCATABLE, DIMENSION(:) :: ref_buf + INTEGER :: i,j + + INTERFACE + INTEGER FUNCTION h5dwrite_ref_reg_c(dset_id, mem_type_id,& + 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 + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER, DIMENSION(*) :: ref_buf + INTEGER(HSIZE_T), DIMENSION(*) :: dims + END FUNCTION h5dwrite_ref_reg_c + END INTERFACE + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF (PRESENT(file_space_id)) file_space_id_default = file_space_id + + ALLOCATE(ref_buf(REF_REG_BUF_LEN*dims(1)), stat=hdferr) + IF (hdferr .NE. 0 ) THEN + hdferr = -1 + RETURN + ELSE + DO j = 1, dims(1) + DO i = 1, REF_REG_BUF_LEN + ref_buf(REF_REG_BUF_LEN*(j-1) + i) = buf(j)%ref(i) + ENDDO + ENDDO + ENDIF + hdferr = h5dwrite_ref_reg_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, ref_buf, dims) + DEALLOCATE(ref_buf) + + END SUBROUTINE h5dwrite_reference_dsetreg + + SUBROUTINE h5dwrite_integer_scalar(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER, INTENT(IN) :: buf ! Data buffer + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + + INTERFACE + INTEGER FUNCTION h5dwrite_integer_s_c(dset_id, mem_type_id, & + mem_space_id_default, & + 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 + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + INTEGER, INTENT(IN) :: buf + END FUNCTION h5dwrite_integer_s_c + END INTERFACE + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF (PRESENT(file_space_id)) file_space_id_default = file_space_id + + hdferr = h5dwrite_integer_s_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, buf, dims) + + END SUBROUTINE h5dwrite_integer_scalar + + SUBROUTINE h5dwrite_integer_1(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + INTEGER, INTENT(IN), & + DIMENSION(dims(1)) :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + + INTERFACE + INTEGER FUNCTION h5dwrite_integer_1_c(dset_id, mem_type_id, & + mem_space_id_default, & + 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 + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + INTEGER, INTENT(IN), & + DIMENSION(dims(1)) :: buf + END FUNCTION h5dwrite_integer_1_c + END INTERFACE + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF (PRESENT(file_space_id)) file_space_id_default = file_space_id + + hdferr = h5dwrite_integer_1_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, buf, dims) + + END SUBROUTINE h5dwrite_integer_1 + + SUBROUTINE h5dwrite_integer_2(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + INTEGER, INTENT(IN), & + DIMENSION(dims(1),dims(2)) :: buf ! Data buffer + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + + INTERFACE + INTEGER FUNCTION h5dwrite_integer_2_c(dset_id, mem_type_id, & + mem_space_id_default, & + 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 + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + INTEGER, INTENT(IN), & + DIMENSION(dims(1),dims(2)) :: buf + END FUNCTION h5dwrite_integer_2_c + END INTERFACE + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF (PRESENT(file_space_id)) file_space_id_default = file_space_id + hdferr = h5dwrite_integer_2_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, & + buf, dims) + + END SUBROUTINE h5dwrite_integer_2 + + SUBROUTINE h5dwrite_integer_3(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + INTEGER, INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3)) :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + + INTERFACE + INTEGER FUNCTION h5dwrite_integer_3_c(dset_id, mem_type_id, & + mem_space_id_default, & + 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 + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + INTEGER, INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3)) :: buf + END FUNCTION h5dwrite_integer_3_c + END INTERFACE + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF (PRESENT(file_space_id)) file_space_id_default = file_space_id + + hdferr = h5dwrite_integer_3_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, & + buf, dims) + + END SUBROUTINE h5dwrite_integer_3 + + SUBROUTINE h5dwrite_integer_4(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + INTEGER, INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + + INTERFACE + INTEGER FUNCTION h5dwrite_integer_4_c(dset_id, mem_type_id, & + mem_space_id_default, & + 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 + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + INTEGER, INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf + END FUNCTION h5dwrite_integer_4_c + END INTERFACE + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF (PRESENT(file_space_id)) file_space_id_default = file_space_id + + hdferr = h5dwrite_integer_4_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, & + buf, dims) + + END SUBROUTINE h5dwrite_integer_4 + + SUBROUTINE h5dwrite_integer_5(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + INTEGER, INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + + INTERFACE + INTEGER FUNCTION h5dwrite_integer_5_c(dset_id, mem_type_id, & + mem_space_id_default, & + 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 + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + INTEGER, INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf + END FUNCTION h5dwrite_integer_5_c + END INTERFACE + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + + IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF (PRESENT(file_space_id)) file_space_id_default = file_space_id + + hdferr = h5dwrite_integer_5_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, & + buf, dims) + + END SUBROUTINE h5dwrite_integer_5 + + SUBROUTINE h5dwrite_integer_6(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + INTEGER, INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + + INTERFACE + INTEGER FUNCTION h5dwrite_integer_6_c(dset_id, mem_type_id, & + mem_space_id_default, & + 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 + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + INTEGER, INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf + END FUNCTION h5dwrite_integer_6_c + END INTERFACE + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF (PRESENT(file_space_id)) file_space_id_default = file_space_id + + hdferr = h5dwrite_integer_6_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, & + buf, dims) + + END SUBROUTINE h5dwrite_integer_6 + + SUBROUTINE h5dwrite_integer_7(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + INTEGER, INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + + INTERFACE + INTEGER FUNCTION h5dwrite_integer_7_c(dset_id, mem_type_id, & + mem_space_id_default, & + 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 + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + INTEGER, INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf + END FUNCTION h5dwrite_integer_7_c + END INTERFACE + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF (PRESENT(file_space_id)) file_space_id_default = file_space_id + + hdferr = h5dwrite_integer_7_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, & + buf, dims) + + END SUBROUTINE h5dwrite_integer_7 + + + SUBROUTINE h5dwrite_char_scalar(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + CHARACTER(LEN=*), INTENT(IN) :: buf ! Data buffer + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + + INTERFACE + INTEGER FUNCTION h5dwritec_s_c(dset_id, mem_type_id, & + mem_space_id_default, & + 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$ATTRIBUTES reference :: buf + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + CHARACTER(LEN=*), INTENT(IN) :: buf + END FUNCTION h5dwritec_s_c + END INTERFACE + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF (PRESENT(file_space_id)) file_space_id_default = file_space_id + + hdferr = h5dwritec_s_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, buf, dims) + + END SUBROUTINE h5dwrite_char_scalar + + SUBROUTINE h5dwrite_char_1(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + CHARACTER(LEN=*), INTENT(IN), & + DIMENSION(dims(1)) :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + + INTERFACE + INTEGER FUNCTION h5dwritec_1_c(dset_id, mem_type_id, & + mem_space_id_default, & + 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$ATTRIBUTES reference :: buf + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + CHARACTER(LEN=*), INTENT(IN), & + DIMENSION(dims(1)) :: buf + END FUNCTION h5dwritec_1_c + END INTERFACE + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF (PRESENT(file_space_id)) file_space_id_default = file_space_id + + hdferr = h5dwritec_1_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, buf, dims) + + END SUBROUTINE h5dwrite_char_1 + + SUBROUTINE h5dwrite_char_2(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + CHARACTER(LEN=*), INTENT(IN), & + DIMENSION(dims(1),dims(2)) :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + + INTERFACE + INTEGER FUNCTION h5dwritec_2_c(dset_id, mem_type_id, & + mem_space_id_default, & + 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$ATTRIBUTES reference :: buf + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + CHARACTER(LEN=*), INTENT(IN), & + DIMENSION(dims(1),dims(2)) :: buf + END FUNCTION h5dwritec_2_c + END INTERFACE + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF (PRESENT(file_space_id)) file_space_id_default = file_space_id + + hdferr = h5dwritec_2_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, buf, dims) + + END SUBROUTINE h5dwrite_char_2 + + SUBROUTINE h5dwrite_char_3(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + CHARACTER(LEN=*), INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3)) :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + + INTERFACE + INTEGER FUNCTION h5dwritec_3_c(dset_id, mem_type_id, & + mem_space_id_default, & + 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$ATTRIBUTES reference :: buf + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + CHARACTER(LEN=*), INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3)) :: buf + END FUNCTION h5dwritec_3_c + END INTERFACE + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF (PRESENT(file_space_id)) file_space_id_default = file_space_id + + hdferr = h5dwritec_3_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, buf, dims) + + END SUBROUTINE h5dwrite_char_3 + + SUBROUTINE h5dwrite_char_4(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + CHARACTER(LEN=*), INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + + INTERFACE + INTEGER FUNCTION h5dwritec_4_c(dset_id, mem_type_id, & + mem_space_id_default, & + 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$ATTRIBUTES reference :: buf + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + CHARACTER(LEN=*), INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf + END FUNCTION h5dwritec_4_c + END INTERFACE + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF (PRESENT(file_space_id)) file_space_id_default = file_space_id + + hdferr = h5dwritec_4_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, buf, dims) + + END SUBROUTINE h5dwrite_char_4 + + SUBROUTINE h5dwrite_char_5(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + CHARACTER(LEN=*), INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + + INTERFACE + INTEGER FUNCTION h5dwritec_5_c(dset_id, mem_type_id, & + mem_space_id_default, & + 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$ATTRIBUTES reference :: buf + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + CHARACTER(LEN=*), INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf + END FUNCTION h5dwritec_5_c + END INTERFACE + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF (PRESENT(file_space_id)) file_space_id_default = file_space_id + + hdferr = h5dwritec_5_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, buf, dims) + + END SUBROUTINE h5dwrite_char_5 + + SUBROUTINE h5dwrite_char_6(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + CHARACTER(LEN=*), INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + + INTERFACE + INTEGER FUNCTION h5dwritec_6_c(dset_id, mem_type_id, & + mem_space_id_default, & + 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$ATTRIBUTES reference :: buf + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + CHARACTER(LEN=*), INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf + END FUNCTION h5dwritec_6_c + END INTERFACE + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF (PRESENT(file_space_id)) file_space_id_default = file_space_id + + hdferr = h5dwritec_6_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, buf, dims) + + END SUBROUTINE h5dwrite_char_6 + + SUBROUTINE h5dwrite_char_7(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + CHARACTER(LEN=*), INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + + INTERFACE + INTEGER FUNCTION h5dwritec_7_c(dset_id, mem_type_id, & + mem_space_id_default, & + 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$ATTRIBUTES reference :: buf + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + CHARACTER(LEN=*), INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf + END FUNCTION h5dwritec_7_c + END INTERFACE + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF (PRESENT(file_space_id)) file_space_id_default = file_space_id + + hdferr = h5dwritec_7_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, buf, dims) + + END SUBROUTINE h5dwrite_char_7 + + SUBROUTINE h5dwrite_real_scalar(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + REAL, INTENT(IN) :: buf ! Data buffer + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + + INTERFACE + INTEGER FUNCTION h5dwrite_real_s_c(dset_id, mem_type_id, & + mem_space_id_default, & + 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 + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + REAL, INTENT(IN) :: buf + END FUNCTION h5dwrite_real_s_c + END INTERFACE + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF (PRESENT(file_space_id)) file_space_id_default = file_space_id + + hdferr = h5dwrite_real_s_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, buf, dims) + + END SUBROUTINE h5dwrite_real_scalar + + SUBROUTINE h5dwrite_real_1(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + REAL, INTENT(IN), & + DIMENSION(dims(1)) :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + + INTERFACE + INTEGER FUNCTION h5dwrite_real_1_c(dset_id, mem_type_id, & + mem_space_id_default, & + 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 + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + REAL, INTENT(IN), & + DIMENSION(dims(1)) :: buf + END FUNCTION h5dwrite_real_1_c + END INTERFACE + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF (PRESENT(file_space_id)) file_space_id_default = file_space_id + + hdferr = h5dwrite_real_1_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, buf, dims) + + END SUBROUTINE h5dwrite_real_1 + + SUBROUTINE h5dwrite_real_2(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + REAL, INTENT(IN), & + DIMENSION(dims(1),dims(2)) :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + + INTERFACE + INTEGER FUNCTION h5dwrite_real_2_c(dset_id, mem_type_id, & + mem_space_id_default, & + 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 + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + REAL, INTENT(IN), & + DIMENSION(dims(1),dims(2)) :: buf + END FUNCTION h5dwrite_real_2_c + END INTERFACE + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF (PRESENT(file_space_id)) file_space_id_default = file_space_id + + hdferr = h5dwrite_real_2_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, buf, dims) + + END SUBROUTINE h5dwrite_real_2 + + SUBROUTINE h5dwrite_real_3(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + REAL, INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3)) :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + + INTERFACE + INTEGER FUNCTION h5dwrite_real_3_c(dset_id, mem_type_id, & + mem_space_id_default, & + 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 + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + REAL, INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3)) :: buf + END FUNCTION h5dwrite_real_3_c + END INTERFACE + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF (PRESENT(file_space_id)) file_space_id_default = file_space_id + + hdferr = h5dwrite_real_3_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, buf, dims) + + END SUBROUTINE h5dwrite_real_3 + + SUBROUTINE h5dwrite_real_4(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + REAL, INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + + INTERFACE + INTEGER FUNCTION h5dwrite_real_4_c(dset_id, mem_type_id, & + mem_space_id_default, & + 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 + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + REAL, INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf + END FUNCTION h5dwrite_real_4_c + END INTERFACE + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF (PRESENT(file_space_id)) file_space_id_default = file_space_id + + hdferr = h5dwrite_real_4_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, buf, dims) + + END SUBROUTINE h5dwrite_real_4 + + SUBROUTINE h5dwrite_real_5(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + REAL, INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + + INTERFACE + INTEGER FUNCTION h5dwrite_real_5_c(dset_id, mem_type_id, & + mem_space_id_default, & + 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 + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + REAL, INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf + END FUNCTION h5dwrite_real_5_c + END INTERFACE + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF (PRESENT(file_space_id)) file_space_id_default = file_space_id + + hdferr = h5dwrite_real_5_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, buf, dims) + + END SUBROUTINE h5dwrite_real_5 + + SUBROUTINE h5dwrite_real_6(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + REAL, INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + + INTERFACE + INTEGER FUNCTION h5dwrite_real_6_c(dset_id, mem_type_id, & + mem_space_id_default, & + 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 + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + REAL, INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6)) :: buf + END FUNCTION h5dwrite_real_6_c + END INTERFACE + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF (PRESENT(file_space_id)) file_space_id_default = file_space_id + + hdferr = h5dwrite_real_6_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, buf, dims) + + END SUBROUTINE h5dwrite_real_6 + + SUBROUTINE h5dwrite_real_7(dset_id, mem_type_id, buf, dims, hdferr, & + mem_space_id, file_space_id, xfer_prp) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + REAL, INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id ! Memory dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + + INTERFACE + INTEGER FUNCTION h5dwrite_real_7_c(dset_id, mem_type_id, & + mem_space_id_default, & + 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 + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HID_T), INTENT(IN) :: mem_type_id + INTEGER(HID_T) :: mem_space_id_default + INTEGER(HID_T) :: file_space_id_default + INTEGER(HID_T) :: xfer_prp_default + INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims + REAL, INTENT(IN), & + DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5),dims(6),dims(7)) :: buf + END FUNCTION h5dwrite_real_7_c + END INTERFACE + + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF (PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF (PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF (PRESENT(file_space_id)) file_space_id_default = file_space_id + + hdferr = h5dwrite_real_7_c(dset_id, mem_type_id, mem_space_id_default, & + file_space_id_default, xfer_prp_default, buf, dims) + + END SUBROUTINE h5dwrite_real_7 + +! +! NAME +! h5dfill_integer +! +! PURPOSE +! Fills dataspace elements with a fill value in a memory buffer. +! Only INTEGER, CHARACTER, REAL and DOUBLE PRECISION datatypes +! of the fillvalues and buffers are supported. Buffer and fillvalue +! are assumed to have the same datatype. +! Only one-dimesional buffers are supported. +! +! INPUTS +! fill_value - fill value +! space_id - memory space selection identifier +! buf - data buffer iin memory ro apply selection to +! - of k-th dimension of the buf array +! OUTPUTS +! hdferr: - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! March 12, 2003 +! +! + + SUBROUTINE h5dfill_integer(fill_value, space_id, buf, hdferr) + IMPLICIT NONE + INTEGER, INTENT(IN) :: fill_value ! Fill value + INTEGER(HID_T), INTENT(IN) :: space_id ! Memory dataspace selection identifier + INTEGER, INTENT(IN), DIMENSION(*) :: buf ! Memory buffer to fill in + INTEGER, INTENT(OUT) :: hdferr ! Error code + + INTEGER(HID_T) :: fill_type_id ! Fill value datatype identifier + INTEGER(HID_T) :: mem_type_id ! Buffer dadtype identifier + + ! INTEGER, EXTERNAL :: h5dfill_integer_c + ! MS FORTRAN needs explicit interface for C functions called here. + ! + INTERFACE + 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 + 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 + INTEGER, INTENT(IN), DIMENSION(*) :: buf ! Memory buffer to fill in + INTEGER(HID_T) :: mem_type_id ! Buffer dadtype identifier + END FUNCTION h5dfill_integer_c + END INTERFACE + fill_type_id = H5T_NATIVE_INTEGER + mem_type_id = H5T_NATIVE_INTEGER + + hdferr = h5dfill_integer_c(fill_value, fill_type_id, space_id, & + buf, mem_type_id) + + END SUBROUTINE h5dfill_integer + +! +! NAME +! h5dfill_real +! +! PURPOSE +! Fills dataspace elements with a fill value in a memory buffer. +! Only INTEGER, CHARACTER, REAL and DOUBLE PRECISION datatypes +! of the fillvalues and buffers are supported. Buffer and fillvalue +! are assumed to have the same datatype. +! Only one-dimesional buffers are supported. +! +! INPUTS +! fill_value - fill value +! space_id - memory space selection identifier +! buf - data buffer iin memory ro apply selection to +! - of k-th dimension of the buf array +! OUTPUTS +! hdferr: - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! March 12, 2003 +! +! + + SUBROUTINE h5dfill_real(fill_valuer, space_id, buf, hdferr) + IMPLICIT NONE + REAL, INTENT(IN) :: fill_valuer ! Fill value + INTEGER(HID_T), INTENT(IN) :: space_id ! Memory dataspace selection identifier + REAL, INTENT(IN), DIMENSION(*) :: buf ! Memory buffer to fill in + INTEGER, INTENT(OUT) :: hdferr ! Error code + + INTEGER(HID_T) :: fill_type_id ! Fill value datatype identifier + INTEGER(HID_T) :: mem_type_id ! Buffer dadtype identifier + + ! INTEGER, EXTERNAL :: h5dfill_real_c + ! MS FORTRAN needs explicit interface for C functions called here. + ! + INTERFACE + 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 + 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 + REAL, INTENT(IN), DIMENSION(*) :: buf ! Memory buffer to fill in + INTEGER(HID_T) :: mem_type_id ! Buffer dadtype identifier + END FUNCTION h5dfill_real_c + END INTERFACE + fill_type_id = H5T_NATIVE_REAL + mem_type_id = H5T_NATIVE_REAL + + hdferr = h5dfill_real_c(fill_valuer, fill_type_id, space_id, & + buf, mem_type_id) + END SUBROUTINE h5dfill_real + +! +! NAME +! h5dfill_char +! +! PURPOSE +! Fills dataspace elements with a fill value in a memory buffer. +! Only INTEGER, CHARACTER, REAL and DOUBLE PRECISION datatypes +! of the fillvalues and buffers are supported. Buffer and fillvalue +! are assumed to have the same datatype. +! Only one-dimesional buffers are supported. +! +! INPUTS +! fill_value - fill value +! space_id - memory space selection identifier +! buf - data buffer iin memory ro apply selection to +! - of k-th dimension of the buf array +! OUTPUTS +! hdferr: - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! March 12, 2003 +! +! + + SUBROUTINE h5dfill_char(fill_value, space_id, buf, hdferr) + IMPLICIT NONE + CHARACTER, INTENT(IN) :: fill_value ! Fill value + INTEGER(HID_T), INTENT(IN) :: space_id ! Memory dataspace selection identifier + CHARACTER, INTENT(IN), DIMENSION(*) :: buf ! Memory buffer to fill in + INTEGER, INTENT(OUT) :: hdferr ! Error code + + INTEGER(HID_T) :: fill_type_id ! Fill value datatype identifier + INTEGER(HID_T) :: mem_type_id ! Buffer dadtype identifier + + ! INTEGER, EXTERNAL :: h5dfillc_c + ! MS FORTRAN needs explicit interface for C functions called here. + ! + INTERFACE + 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 + 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 + CHARACTER, INTENT(IN), DIMENSION(*) :: buf ! Memory buffer to fill in + INTEGER(HID_T) :: mem_type_id ! Buffer dadtype identifier + END FUNCTION h5dfillc_c + END INTERFACE + fill_type_id = H5T_NATIVE_CHARACTER + mem_type_id = H5T_NATIVE_CHARACTER + + hdferr = h5dfillc_c(fill_value, fill_type_id, space_id, & + buf, mem_type_id) + + END SUBROUTINE h5dfill_char + + +END MODULE H5D_PROVISIONAL diff --git a/fortran/src/H5Ef.c b/fortran/src/H5Ef.c index c6d860c..8671b18 100644 --- a/fortran/src/H5Ef.c +++ b/fortran/src/H5Ef.c @@ -1,4 +1,9 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +/****h* H5Ef/H5Ef + * PURPOSE + * This file contains C stubs for H5E Fortran APIs + * + * COPYRIGHT + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * @@ -11,53 +16,70 @@ * is linked from the top-level documents page. It can also be found at * * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * * access to either file, you may request a copy from help@hdfgroup.org. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -/* This files contains C stubs for H5E Fortran APIs */ - + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * + ****** +*/ #include "H5f90.h" #include "H5Eprivate.h" -/*---------------------------------------------------------------------------- - * Name: h5eclear_c - * Purpose: Call H5Eclear to clear the error stack for the current thread - * Inputs: - * Outputs: - * Returns: 0 on success, -1 on failure - * Programmer: Xiangyang Su - * Wednesday, March 29, 2000 - * Modifications: - *---------------------------------------------------------------------------*/ - +/****if* H5Ef/h5eclear_c + * NAME + * h5eclear_c + * PURPOSE + * Call H5Eclear to clear the error stack for the current thread + * INPUTS + * + * OUTPUTS + * + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Xiangyang Su + * Wednesday, March 29, 2000 + * HISTORY + * + * SOURCE +*/ int_f -nh5eclear_c(void) +nh5eclear_c(hid_t_f *estack_id ) +/******/ { - int_f ret_value = 0; + int_f ret_value = 0; - /* - * Call H5Eclear function. - */ - if(H5Eclear2(H5E_DEFAULT) < 0) - HGOTO_DONE(FAIL) + /* + * Call H5Eclear function. + */ + if(H5Eclear2((hid_t)*estack_id) < 0) + HGOTO_DONE(FAIL) done: return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5eprint_c1 - * Purpose: Call H5Eprint to print the error stack in a default manner. - * Inputs: name - file name - * namelen - length of name - * Outputs: - * Returns: 0 on success, -1 on failure - * Programmer: Xiangyang Su - * Wednesday, March 29, 2000 - * Modifications: Bug fix: Added call to close the file with the error messages - * EP 11/26/01 - *---------------------------------------------------------------------------*/ +/****if* H5Ef/h5eprint_c1 + * NAME + * h5eprint_c1 + * PURPOSE + * Call H5Eprint to print the error stack in a default manner. + * INPUTS + * name - file name + * namelen - length of name + * OUTPUTS + * + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Xiangyang Su + * Wednesday, March 29, 2000 + * HISTORY + * Bug fix: Added call to close the file with the error messages + * EP 11/26/01 + * SOURCE +*/ int_f nh5eprint_c1(_fcd name, int_f* namelen) +/******/ { FILE *file = NULL; char *c_name = NULL; @@ -83,20 +105,27 @@ done: return ret_value; } - -/*---------------------------------------------------------------------------- - * Name: h5eprint_c2 - * Purpose: Call H5Eprint to print the error stack to stderr - * in a default manner. - * Inputs: - * Outputs: - * Returns: 0 on success, -1 on failure - * Programmer: Xiangyang Su - * Wednesday, March 29, 2000 - * Modifications: - *---------------------------------------------------------------------------*/ +/****if* H5Ef/h5eprint_c2 + * NAME + * h5eprint_c2 + * PURPOSE + * Call H5Eprint to print the error stack to stderr + * in a default manner. + * INPUTS + * + * OUTPUTS + * + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Xiangyang Su + * Wednesday, March 29, 2000 + * + * SOURCE +*/ int_f nh5eprint_c2(void) +/******/ { int_f ret_value = 0; @@ -110,19 +139,28 @@ done: return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5eget_major_c - * Purpose: Call H5Eget_major to get a character string - * describing an error specified by a major error number. - * Inputs: error_no - Major error number - * Outputs: name - character string describing the error - * Returns: 0 on success, -1 on failure - * Programmer: Xiangyang Su - * Wednesday, March 29, 2000 - * Modifications: - *---------------------------------------------------------------------------*/ +/****if* H5Ef/h5eget_major_c + * NAME + * h5eget_major_c + * PURPOSE + * Call H5Eget_major to get a character string + * describing an error specified by a major error number. + * INPUTS + * error_no - Major error number + * OUTPUTS + * name - character string describing the error + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Xiangyang Su + * Wednesday, March 29, 2000 + * HISTORY + * + * SOURCE +*/ int_f nh5eget_major_c(int_f* error_no, _fcd name, size_t_f* namelen) +/******/ { char *c_name = NULL; size_t c_namelen = (size_t)*namelen; @@ -149,19 +187,28 @@ done: return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5eget_minor_c - * Purpose: Call H5Eget_minor to get a character string - * describing an error specified by a minor error number. - * Inputs: error_no - Major error number - * Outputs: name - character string describing the error - * Returns: 0 on success, -1 on failure - * Programmer: Xiangyang Su - * Wednesday, March 29, 2000 - * Modifications: - *---------------------------------------------------------------------------*/ +/****if* H5Ef/h5eget_minor_c + * NAME + * h5eget_minor_c + * PURPOSE + * Call H5Eget_minor to get a character string + * describing an error specified by a minor error number. + * INPUTS + * error_no - Major error number + * OUTPUTS + * name - character string describing the error + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Xiangyang Su + * Wednesday, March 29, 2000 + * HISTORY + * + * SOURCE +*/ int_f nh5eget_minor_c(int_f* error_no, _fcd name, size_t_f* namelen) +/******/ { char *c_name = NULL; size_t c_namelen = (size_t)*namelen; @@ -188,18 +235,27 @@ done: return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5eset_auto_c - * Purpose: Call H5Eset_auto to turn automatic error printing on or off. - * Inputs: printflag - flag to turn automatic error printing on or off. - * Outputs: - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal - * Friday, November 17, 2000 - * Modifications: major bug fix. Function never disabled printing. - *---------------------------------------------------------------------------*/ +/****if* H5Ef/h5eset_auto_c + * NAME + * h5eset_auto_c + * PURPOSE + * Call H5Eset_auto to turn automatic error printing on or off. + * INPUTS + * printflag - flag to turn automatic error printing on or off. + * OUTPUTS + * + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal + * Friday, November 17, 2000 + * HISTORY + * Major bug fix: Function never disabled printing. + * SOURCE +*/ int_f nh5eset_auto_c(int_f* printflag) +/******/ { herr_t status = -1; int_f ret_value = 0; @@ -215,3 +271,51 @@ done: return ret_value; } + +/****if* H5Ef/h5eset_auto2_c + * NAME + * h5eset_auto2_c + * PURPOSE + * Calls H5Eset_auto2 + * INPUTS + * estack_id - Error stack identifier. + * func - Function to be called upon an error condition. + * client_data - Data passed to the error function. + * + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld + * July 22, 2009 + * SOURCE +*/ +/* int_f */ +/* nh5eset_auto2_c(hid_t_f *estack_id, H5E_auto2_t *func, void *client_data) */ +/* /\******\/ */ +/* { */ +/* int ret_val = -1; */ +/* herr_t status = -1; */ + +/* status = H5Eset_auto2((hid_t)*estack_id, *func, client_data); */ +/* if (status >= 0) ret_val = 0; */ +/* return ret_val; */ +/* } */ + +int_f +nh5eset_auto2_c(int_f *printflag, hid_t_f *estack_id, H5E_auto2_t func, void *client_data) +/******/ +{ + int ret_val = -1; + herr_t status = -1; + + if (*printflag == 1 && *estack_id == -1) + status = H5Eset_auto2(H5E_DEFAULT, (H5E_auto2_t)H5Eprint2, stderr); + else if (*printflag == 1) + status = H5Eset_auto2((hid_t)*estack_id, func, client_data); + else if (*printflag == 0) + status = H5Eset_auto2(H5E_DEFAULT, NULL, NULL); + if (status >= 0) ret_val = 0; + + return ret_val; +} + diff --git a/fortran/src/H5Eff.f90 b/fortran/src/H5Eff.f90 index c33f9c1..2e137df 100644 --- a/fortran/src/H5Eff.f90 +++ b/fortran/src/H5Eff.f90 @@ -1,10 +1,13 @@ -!****h* fortran/src/H5Eff.f90 +!****h* ROBODoc/H5E ! ! NAME -! H5E +! MODULE H5E ! -! FUNCTION -! This file contains Fortran interfaces for H5E functions. +! FILE +! fortran/src/H5Eff.f90 +! +! PURPOSE +! This Module contains Fortran interfaces for H5E functions. ! ! COPYRIGHT ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * @@ -23,10 +26,10 @@ ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! NOTES -! *** IMPORTANT *** -! If you add a new H5E function you must add the function name to the -! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. -! This is needed for Windows based operating systems. +! *** IMPORTANT *** +! If you add a new H5E function to the module you must add the function name +! to the Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! This is needed for Windows based operating systems. ! !***** @@ -42,76 +45,82 @@ MODULE H5E CONTAINS -!---------------------------------------------------------------------- -! Name: h5eclear_f -! -! Purpose: Clears the error stack for the current thread. -! -! Inputs: -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! -! -! -! -! Programmer: Elena Pourmal -! August 12, 1999 +!****s* H5E/h5eclear_f ! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). April 6, 2001 -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5eclear_f(hdferr) +! NAME +! h5eclear_f +! +! PURPOSE +! Clears the error stack for the current thread. +! +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! OPTIONAL PARAMETERS +! estack_id - Error Stack id +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). April 6, 2001 +! +! Added optional error stack identifier in order to bring +! the function in line with the h5eclear2 routine. +! MSB, July 9, 2009 +! +! SOURCE + SUBROUTINE h5eclear_f(hdferr, estack_id) IMPLICIT NONE INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: estack_id +!***** + INTEGER(HID_T) :: estack_id_default -! INTEGER, EXTERNAL :: h5eclear_c -! MS FORTRAN needs explicit interface for C functions called here. -! INTERFACE - INTEGER FUNCTION h5eclear_c() + INTEGER FUNCTION h5eclear_c(estack_id_default) USE H5GLOBAL !DEC$IF DEFINED(HDF5F90_WINDOWS) !DEC$ATTRIBUTES C,reference,decorate,alias:'H5ECLEAR_C'::h5eclear_c !DEC$ENDIF + INTEGER(HID_T) :: estack_id_default END FUNCTION h5eclear_c END INTERFACE - hdferr = h5eclear_c() + + estack_id_default = H5E_DEFAULT_F + IF(PRESENT(estack_id)) estack_id_default = estack_id + + hdferr = h5eclear_c(estack_id_default) END SUBROUTINE h5eclear_f -!---------------------------------------------------------------------- -! Name: h5h5eprint_f +!****s* H5E/h5eprint_f ! -! Purpose: Prints the error stack in a default manner. +! NAME +! h5eprint_f ! -! Inputs: -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! name - name of the file that -! contains print output +! PURPOSE +! Prints the error stack in a default manner. ! -! Programmer: Elena Pourmal -! August 12, 1999 +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails ! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). April 6, 2001 +! OPTIONAL PARAMETERS +! name - name of the file that contains print output +! AUTHOR +! Elena Pourmal +! August 12, 1999 ! -! Comment: -!---------------------------------------------------------------------- - +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). April 6, 2001 +! +! SOURCE SUBROUTINE h5eprint_f(hdferr, name) CHARACTER(LEN=*), OPTIONAL, INTENT(IN) :: name ! File name INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** INTEGER :: namelen INTERFACE @@ -141,40 +150,41 @@ CONTAINS hdferr = h5eprint_c2() ENDIF END SUBROUTINE h5eprint_f - -!---------------------------------------------------------------------- -! Name: h5eget_major_f -! -! Purpose: Returns a character string describing an error specified -! by a major error number. -! -! Inputs: -! error_no - mojor error number -! Outputs: -! name - character string describing the error -! namelen - number of characters in the name buffer -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). April 6, 2001 -! -! Comment: -!---------------------------------------------------------------------- - +!****s* H5E/h5eget_major_f +! +! NAME +! h5eget_major_f +! +! PURPOSE +! Returns a character string describing an error specified +! by a major error number. +! +! INPUTS +! error_no - major error number +! +! OUTPUTS +! name - character string describing the error +! namelen - number of characters in the name buffer +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). April 6, 2001 +! +! SOURCE SUBROUTINE h5eget_major_f(error_no, name, namelen, hdferr) - INTEGER, INTENT(IN) :: error_no ! Major error number - CHARACTER(LEN=*), INTENT(OUT) :: name ! Character string describing - ! the error. - INTEGER(SIZE_T), INTENT(IN) :: namelen !Anticipated number of characters in name. - INTEGER, INTENT(OUT) :: hdferr ! Error code - + INTEGER, INTENT(IN) :: error_no ! Major error number + CHARACTER(LEN=*), INTENT(OUT) :: name ! Character string describing + ! the error. + INTEGER(SIZE_T), INTENT(IN) :: namelen ! Anticipated number of characters + ! in name. + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** INTERFACE INTEGER FUNCTION h5eget_major_c(error_no, name, namelen) USE H5GLOBAL @@ -190,41 +200,38 @@ CONTAINS hdferr = h5eget_major_c(error_no, name, namelen) END SUBROUTINE h5eget_major_f - -!---------------------------------------------------------------------- -! Name: h5eget_minor_f -! -! Purpose: Returns a character string describing an error specified -! by a minor error number. +!****s* H5E/h5eget_minor_f ! -! Inputs: -! error_no - minor error number -! Outputs: -! name - character string describing the error -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: +! NAME +! h5eget_minor_f ! +! PURPOSE +! Returns a character string describing an error specified +! by a minor error number. ! +! INPUTS +! error_no - minor error number ! +! OUTPUTS +! name - character string describing the error +! hdferr - Returns 0 if successful and -1 if fails ! -! Programmer: Elena Pourmal -! August 12, 1999 +! AUTHOR +! Elena Pourmal +! August 12, 1999 ! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). April 6, 2001 +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). April 6, 2001 ! -! Comment: -!---------------------------------------------------------------------- - +! SOURCE SUBROUTINE h5eget_minor_f(error_no, name, hdferr) - INTEGER, INTENT(IN) :: error_no !Major error number + INTEGER, INTENT(IN) :: error_no ! Major error number CHARACTER(LEN=*), INTENT(OUT) :: name ! Character string describing ! the error INTEGER, INTENT(OUT) :: hdferr ! Error code - +!***** INTERFACE INTEGER FUNCTION h5eget_minor_c(error_no, name) USE H5GLOBAL @@ -239,55 +246,6 @@ CONTAINS hdferr = h5eget_minor_c(error_no, name) END SUBROUTINE h5eget_minor_f -!---------------------------------------------------------------------- -! Name: h5eset_auto_f -! -! Purpose: Turns automatic error printing on or off -! -! Inputs: -! printflag - flag to turn automatic error -! - Possible values are: -! - 1 (on), 0 (off) -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! -! -! -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). April 6, 2001 -! -! Comment: -!---------------------------------------------------------------------- - - - SUBROUTINE h5eset_auto_f(printflag, hdferr) - INTEGER, INTENT(IN) :: printflag !flag to turn automatic error - !printing on or off - !possible values are: - !printon (1) - !printoff(0) - INTEGER, INTENT(OUT) :: hdferr ! Error code - - 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 - INTEGER :: printflag - END FUNCTION h5eset_auto_c - END INTERFACE - - hdferr = h5eset_auto_c(printflag) - END SUBROUTINE h5eset_auto_f END MODULE H5E diff --git a/fortran/src/H5Eff_F03.f90 b/fortran/src/H5Eff_F03.f90 new file mode 100644 index 0000000..164f203 --- /dev/null +++ b/fortran/src/H5Eff_F03.f90 @@ -0,0 +1,110 @@ +!****h* ROBODoc/H5E (F03) +! +! NAME +! H5E_PROVISIONAL +! +! FILE +! src/fortran/src/H5Eff_F03.f90 +! +! PURPOSE +! +! This file contains Fortran 90 and Fortran 2003 interfaces for H5E functions. +! It contains the same functions as H5Eff_F90.f90 but includes the +! Fortran 2003 functions and the interface listings. This file will be compiled +! instead of H5Eff_F90.f90 if Fortran 2003 functions are enabled. +! +! +! COPYRIGHT +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +! NOTES +! *** IMPORTANT *** +! If you add a new H5E function to the module you must add the function name +! to the Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! This is needed for Windows based operating systems. +! +!***** + +MODULE H5E_PROVISIONAL + + USE H5GLOBAL + +CONTAINS + +!****s* H5E/h5eset_auto_f +! +! NAME +! h5eset_auto_f +! +! PURPOSE +! Returns settings for automatic error stack traversal function and its data. +! +! Inputs: +! printflag - Flag to turn automatic error printing on or off; +! possible values are: +! printon (1) +! printoff(0) +! estack_id - Error stack identifier. +! func - Function to be called upon an error condition. +! client_data - Data passed to the error function +! +! Outputs: +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! M. Scot Breitenfeld +! July 10, 2009 +! +! Fortran2003 Interface: + SUBROUTINE h5eset_auto_f(printflag, hdferr, estack_id, func, client_data) + USE, INTRINSIC :: ISO_C_BINDING + INTEGER , INTENT(IN) :: printflag + INTEGER , INTENT(OUT) :: hdferr + INTEGER(HID_T), INTENT(IN) , OPTIONAL :: estack_id + TYPE(C_FUNPTR), INTENT(IN) , OPTIONAL :: func + TYPE(C_PTR) , INTENT(IN) , OPTIONAL :: client_data +!***** + INTEGER(HID_T) :: estack_id_default + TYPE(C_FUNPTR) :: func_default + TYPE(C_PTR) :: client_data_default + INTERFACE + INTEGER FUNCTION h5eset_auto2_c(printflag, estack_id, func, client_data) + USE, INTRINSIC :: ISO_C_BINDING + USE H5GLOBAL + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5ESET_AUTO2_C'::h5eset_auto2_c + !DEC$ENDIF + INTEGER :: printflag + INTEGER(HID_T) :: estack_id +!!$ TYPE(C_FUNPTR) :: func +!!$ TYPE(C_PTR), VALUE :: client_data + TYPE(C_FUNPTR), VALUE :: func + TYPE(C_PTR), VALUE :: client_data + END FUNCTION h5eset_auto2_c + END INTERFACE + + estack_id_default = -1 + func_default = C_NULL_FUNPTR + client_data_default = C_NULL_PTR + + IF(PRESENT(estack_id)) estack_id_default = estack_id + IF(PRESENT(func)) func_default = func + IF(PRESENT(client_data)) client_data_default = client_data + + hdferr = h5eset_auto2_c(printflag, estack_id_default, func_default, client_data_default) + END SUBROUTINE h5eset_auto_f + +END MODULE H5E_PROVISIONAL diff --git a/fortran/src/H5Eff_F90.f90 b/fortran/src/H5Eff_F90.f90 new file mode 100644 index 0000000..e698a84 --- /dev/null +++ b/fortran/src/H5Eff_F90.f90 @@ -0,0 +1,89 @@ +!****h* ROBODoc/H5E (F90) +! +! NAME +! MODULE H5E_PROVISIONAL +! +! PURPOSE +! This file contains Fortran 90 interfaces for H5E functions. It contains +! the same functions as H5Eff_F03.f90 but excludes the Fortran 2003 functions +! and the interface listings. This file will be compiled instead of H5Eff_F03.f90 +! if Fortran 2003 functions are not enabled. +! +! +! COPYRIGHT +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +! *** IMPORTANT *** +! If you add a new H5D function you must add the function name to the +! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! This is needed for Windows based operating systems. +!***** + +MODULE H5E_PROVISIONAL + + USE H5GLOBAL + +CONTAINS + +!****s* H5E/h5eset_auto_f +! +! NAME +! h5eset_auto_f +! +! PURPOSE +! Turns automatic error printing on or off. +! +! INPUTS +! printflag - Flag to turn automatic error printing on or off; +! possible values are: +! printon (1) +! printoff(0) +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). April 6, 2001 +! +! SOURCE + SUBROUTINE h5eset_auto_f(printflag, hdferr) + INTEGER, INTENT(IN) :: printflag ! flag to turn automatic error + ! printing on or off + ! possible values are: + ! printon (1) + ! printoff(0) + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + 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 + INTEGER :: printflag + END FUNCTION h5eset_auto_c + END INTERFACE + + hdferr = h5eset_auto_c(printflag) + END SUBROUTINE h5eset_auto_f + + +END MODULE H5E_PROVISIONAL diff --git a/fortran/src/H5FDmpiof.c b/fortran/src/H5FDmpiof.c index 2f22b55..89b4180 100644 --- a/fortran/src/H5FDmpiof.c +++ b/fortran/src/H5FDmpiof.c @@ -1,4 +1,10 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +/****h* H5FDmpiof/H5FDmpiof + * + * PURPOSE + * This file contains C stubs for Parallel Fortran APIs + * + * COPYRIGHT + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * @@ -11,9 +17,10 @@ * is linked from the top-level documents page. It can also be found at * * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * * access to either file, you may request a copy from help@hdfgroup.org. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -/* This files contains C stubs for Parallel Fortran APIs */ + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * + ****** +*/ #include "H5f90.h" #include @@ -30,20 +37,28 @@ #define MPI_Info_f2c(info) (MPI_Info)(info) #endif /*MPI Info*/ -/*---------------------------------------------------------------------------- - * Name: h5pset_fapl_mpio_c - * Purpose: Call H5Pset_fapl_mpio to set mode for parallel I/O and the user +/****if* H5FDmpiof/h5pset_fapl_mpio_c + * NAME + * h5pset_fapl_mpio_c + * PURPOSE + * Call H5Pset_fapl_mpio to set mode for parallel I/O and the user * supplied communicator and info object - * Inputs: prp_id - property list identifier + * INPUTS + * prp_id - property list identifier * comm - MPI communicator * info - MPI info object - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Thursday, October 26, 2000 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pset_fapl_mpio_c(hid_t_f *prp_id, int_f* comm, int_f* info) +/******/ { int ret_value = -1; hid_t c_prp_id; @@ -62,20 +77,27 @@ nh5pset_fapl_mpio_c(hid_t_f *prp_id, int_f* comm, int_f* info) ret_value = 0; return ret_value; } - -/*---------------------------------------------------------------------------- - * Name: h5pget_fapl_mpio_c - * Purpose: Call H5Pget_fapl_mpio to retrieve communicator and info object - * Inputs: prp_id - property list identifier +/****if* H5FDmpiof/h5pget_fapl_mpio_c + * NAME + * h5pget_fapl_mpio_c + * PURPOSE + * Call H5Pget_fapl_mpio to retrieve communicator and info object + * INPUTS + * prp_id - property list identifier * comm - buffer to return MPI communicator * info - buffer to return MPI info object - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Thursday, October 26, 2000 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pget_fapl_mpio_c(hid_t_f *prp_id, int_f* comm, int_f* info) +/******/ { int ret_value = -1; hid_t c_prp_id; @@ -94,19 +116,27 @@ nh5pget_fapl_mpio_c(hid_t_f *prp_id, int_f* comm, int_f* info) ret_value = 0; return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pset_dxpl_mpio_c - * Purpose: Call H5Pset_dxpl_mpio to set transfer mode of the dataset +/****if* H5FDmpiof/h5pset_dxpl_mpio_c + * NAME + * h5pset_dxpl_mpio_c + * PURPOSE + * Call H5Pset_dxpl_mpio to set transfer mode of the dataset * trasfer property list - * Inputs: prp_id - property list identifier + * INPUTS + * prp_id - property list identifier * data_xfer_mode - transfer mode - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Thursday, October 26, 2000 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pset_dxpl_mpio_c(hid_t_f *prp_id, int_f* data_xfer_mode) +/******/ { int ret_value = -1; hid_t c_prp_id; @@ -137,19 +167,27 @@ nh5pset_dxpl_mpio_c(hid_t_f *prp_id, int_f* data_xfer_mode) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pget_dxpl_mpio_c - * Purpose: Call H5Pget_dxpl_mpio to get transfer mode of the dataset +/****if* H5FDmpiof/h5pget_dxpl_mpio_c + * NAME + * h5pget_dxpl_mpio_c + * PURPOSE + * Call H5Pget_dxpl_mpio to get transfer mode of the dataset * trasfer property list - * Inputs: prp_id - property list identifier + * INPUTS + * prp_id - property list identifier * data_xfer_mode - buffer to retrieve transfer mode - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Thursday, June 15, 2000 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pget_dxpl_mpio_c(hid_t_f *prp_id, int_f* data_xfer_mode) +/******/ { int ret_value = -1; hid_t c_prp_id; @@ -182,20 +220,28 @@ nh5pget_dxpl_mpio_c(hid_t_f *prp_id, int_f* data_xfer_mode) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pset_fapl_mpiposix_c - * Purpose: Call H5Pset_fapl_mpiposix to set mode for parallel I/O and the user +/****if* H5FDmpiof/h5pset_fapl_mpiposix_c + * NAME + * h5pset_fapl_mpiposix_c + * PURPOSE + * Call H5Pset_fapl_mpiposix to set mode for parallel I/O and the user * supplied communicator - * Inputs: prp_id - property list identifier + * INPUTS + * prp_id - property list identifier * comm - MPI communicator * flag - flag to use GPFS hints - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Tuesday, May 6, 2003 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pset_fapl_mpiposix_c(hid_t_f *prp_id, int_f* comm, int_f* flag) +/******/ { int ret_value = -1; hid_t c_prp_id; @@ -214,19 +260,28 @@ nh5pset_fapl_mpiposix_c(hid_t_f *prp_id, int_f* comm, int_f* flag) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pget_fapl_mpiposix_c - * Purpose: Call H5Pget_fapl_mpiposix to retrieve communicator and info object - * Inputs: prp_id - property list identifier - * Outputs: comm - buffer to return MPI communicator +/****if* H5FDmpiof/h5pget_fapl_mpiposix_c + * NAME + * h5pget_fapl_mpiposix_c + * PURPOSE + * Call H5Pget_fapl_mpiposix to retrieve communicator and info object + * INPUTS + * prp_id - property list identifier + * OUTPUTS + * comm - buffer to return MPI communicator * flag - flag to use GPFS hints - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Tuesday, May 6, 2003 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pget_fapl_mpiposix_c(hid_t_f *prp_id, int_f* comm, int_f* flag) +/******/ { int ret_value = -1; hid_t c_prp_id; diff --git a/fortran/src/H5FDmpioff.f90 b/fortran/src/H5FDmpioff.f90 index 787f0d5..ea9283c 100644 --- a/fortran/src/H5FDmpioff.f90 +++ b/fortran/src/H5FDmpioff.f90 @@ -1,3 +1,13 @@ +!****h* ROBODoc/H5FDMPIO +! +! NAME +! MODULE H5FDMPIO +! +! PURPOSE +! This file contains Fortran interfaces for H5P functions needed by +! parallel MPI programs. +! +! COPYRIGHT ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! Copyright by The HDF Group. * ! Copyright by the Board of Trustees of the University of Illinois. * @@ -13,238 +23,215 @@ ! access to either file, you may request a copy from help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! -! -! This file contains Fortran90 interfaces for H5P functions needed by || MPI programs. -! - MODULE H5FDMPIO - USE H5GLOBAL - CONTAINS - -!---------------------------------------------------------------------- -! Name: h5pset_fapl_mpio_f -! -! Purpose: Stores MPI IO communicator information to the file -! access property list. -! -! Inputs: -! prp_id - file access property list identifier -! comm - MPI-2 communicator -! info - MPI-2 info object -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! November, 2000 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - SUBROUTINE h5pset_fapl_mpio_f(prp_id, comm, info, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER, INTENT(IN) :: comm ! MPI communicator to be used for file open - ! as defined in MPI_FILE_OPEN of MPI-2 - INTEGER, INTENT(IN) :: info ! MPI info object to be used for file open - ! as defined in MPI_FILE_OPEN of MPI-2 - INTEGER, INTENT(OUT) :: hdferr ! Error code - - INTEGER, EXTERNAL :: h5pset_fapl_mpio_c - hdferr = h5pset_fapl_mpio_c(prp_id, comm, info) - END SUBROUTINE h5pset_fapl_mpio_f - -!---------------------------------------------------------------------- -! Name: h5pget_fapl_mpio_f -! -! Purpose: Returns MPI communicator information. -! -! Inputs: -! prp_id - file access property list identifier -! Outputs: -! comm - MPI-2 communicator -! info - MPI-2 info object -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! November, 2000 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pget_fapl_mpio_f(prp_id, comm, info, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER, INTENT(OUT) :: comm ! buffer to return communicator - INTEGER, INTENT(OUT) :: info ! buffer to return info object - ! as defined in MPI_FILE_OPEN of MPI-2 - INTEGER, INTENT(OUT) :: hdferr ! Error code - - INTEGER, EXTERNAL :: h5pget_fapl_mpio_c - hdferr = h5pget_fapl_mpio_c(prp_id, comm, info) - END SUBROUTINE h5pget_fapl_mpio_f - -!---------------------------------------------------------------------- -! Name: h5pset_dxpl_mpio_f -! -! Purpose: Sets data transfer mode. -! -! Inputs: -! prp_id - data transfer property list identifier -! data_xfer_mode - transfer mode -! Possible values are: -! H5FD_MPIO_INDEPENDENT_F -! H5FD_MPIO_COLLECTIVE_F -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! November, 2000 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pset_dxpl_mpio_f(prp_id, data_xfer_mode, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER, INTENT(IN) :: data_xfer_mode ! Data transfer mode. Possible values are: - ! H5FD_MPIO_INDEPENDENT_F - ! H5FD_MPIO_COLLECTIVE_F - INTEGER, INTENT(OUT) :: hdferr ! Error code - - INTEGER, EXTERNAL :: h5pset_dxpl_mpio_c - hdferr = h5pset_dxpl_mpio_c(prp_id, data_xfer_mode) - END SUBROUTINE h5pset_dxpl_mpio_f - -!---------------------------------------------------------------------- -! Name: h5pget_dxpl_mpio_f -! -! Purpose: Returns the data transfer mode. -! -! Inputs: -! prp_id - data transfer property list identifier -! Outputs: -! data_xfer_mode - transfer mode -! Possible values are: -! H5FD_MPIO_INDEPENDENT_F -! H5FD_MPIO_COLLECTIVE_F -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! November, 2000 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pget_dxpl_mpio_f(prp_id, data_xfer_mode, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER, INTENT(OUT) :: data_xfer_mode ! Data transfer mode. Possible values are: - ! H5FD_MPIO_INDEPENDENT_F - ! H5FD_MPIO_COLLECTIVE_F - INTEGER, INTENT(OUT) :: hdferr ! Error code - - INTEGER, EXTERNAL :: h5pget_dxpl_mpio_c - hdferr = h5pget_dxpl_mpio_c(prp_id, data_xfer_mode) - END SUBROUTINE h5pget_dxpl_mpio_f - - -!---------------------------------------------------------------------- -! Name: h5pset_fapl_mpiposix_f -! -! Purpose: Stores MPI IO communicator information to the file -! access property list. -! -! Inputs: -! prp_id - file access property list identifier -! comm - MPI-2 communicator -! use_gpfs - logical flag to use the GPFS hints -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! May 6, 2003 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - SUBROUTINE h5pset_fapl_mpiposix_f(prp_id, comm, use_gpfs, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER, INTENT(IN) :: comm ! MPI communicator to be used for file open - ! as defined in MPI_FILE_OPEN of MPI-2 - LOGICAL, INTENT(IN) :: use_gpfs - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER :: flag - - INTEGER, EXTERNAL :: h5pset_fapl_mpiposix_c - flag = 0 - if(use_gpfs) flag = 1 - hdferr = h5pset_fapl_mpiposix_c(prp_id, comm, flag) - END SUBROUTINE h5pset_fapl_mpiposix_f - -!---------------------------------------------------------------------- -! Name: h5pget_fapl_mpiposix_f -! -! Purpose: Returns MPI communicator information. -! -! Inputs: -! prp_id - file access property list identifier -! Outputs: -! comm - MPI-2 communicator -! use_gpfs - flag to use GPFS hints -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! May 6, 2003 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pget_fapl_mpiposix_f(prp_id, comm, use_gpfs, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER, INTENT(OUT) :: comm ! buffer to return communicator - LOGICAL, INTENT(OUT) :: use_gpfs - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER :: flag - - INTEGER, EXTERNAL :: h5pget_fapl_mpiposix_c - hdferr = h5pget_fapl_mpiposix_c(prp_id, comm, flag) - use_gpfs = .FALSE. - if (flag .eq. 1) use_gpfs = .TRUE. - END SUBROUTINE h5pget_fapl_mpiposix_f - - END MODULE H5FDMPIO +! NOTES +! *** IMPORTANT *** +! If you add a new H5P function you must add the function name to the +! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! This is needed for Windows based operating systems. +! +!***** + +MODULE H5FDMPIO + USE H5GLOBAL +CONTAINS + +!****s* H5FDMPIO/h5pset_fapl_mpio_f +! +! NAME +! h5pset_fapl_mpio_f +! +! PURPOSE +! Stores MPI IO communicator information to the file +! access property list. +! +! INPUTS +! prp_id - file access property list identifier +! comm - MPI-2 communicator +! info - MPI-2 info object +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! Elena Pourmal +! November, 2000 +! +! SOURCE + SUBROUTINE h5pset_fapl_mpio_f(prp_id, comm, info, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER, INTENT(IN) :: comm ! MPI communicator to be used for file open + ! as defined in MPI_FILE_OPEN of MPI-2 + INTEGER, INTENT(IN) :: info ! MPI info object to be used for file open + ! as defined in MPI_FILE_OPEN of MPI-2 + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTEGER, EXTERNAL :: h5pset_fapl_mpio_c + hdferr = h5pset_fapl_mpio_c(prp_id, comm, info) + END SUBROUTINE h5pset_fapl_mpio_f + +!****s* H5FDMPIO/h5pget_fapl_mpio_f +! +! NAME +! h5pget_fapl_mpio_f +! +! PURPOSE +! Returns MPI communicator information. +! +! INPUTS +! prp_id - file access property list identifier +! OUTPUTS +! comm - MPI-2 communicator +! info - MPI-2 info object +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! November, 2000 +! +! SOURCE + SUBROUTINE h5pget_fapl_mpio_f(prp_id, comm, info, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER, INTENT(OUT) :: comm ! buffer to return communicator + INTEGER, INTENT(OUT) :: info ! buffer to return info object + ! as defined in MPI_FILE_OPEN of MPI-2 + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTEGER, EXTERNAL :: h5pget_fapl_mpio_c + hdferr = h5pget_fapl_mpio_c(prp_id, comm, info) + END SUBROUTINE h5pget_fapl_mpio_f + +!****s* H5FDMPIO/h5pset_dxpl_mpio_f +! +! NAME +! h5pset_dxpl_mpio_f +! +! PURPOSE +! Sets data transfer mode. +! +! INPUTS +! prp_id - data transfer property list identifier +! data_xfer_mode - transfer mode; possible values are: +! H5FD_MPIO_INDEPENDENT_F +! H5FD_MPIO_COLLECTIVE_F +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! Elena Pourmal +! November, 2000 +! +! SOURCE + SUBROUTINE h5pset_dxpl_mpio_f(prp_id, data_xfer_mode, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER, INTENT(IN) :: data_xfer_mode ! Data transfer mode. Possible values are: + ! H5FD_MPIO_INDEPENDENT_F + ! H5FD_MPIO_COLLECTIVE_F + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTEGER, EXTERNAL :: h5pset_dxpl_mpio_c + hdferr = h5pset_dxpl_mpio_c(prp_id, data_xfer_mode) + END SUBROUTINE h5pset_dxpl_mpio_f +!****s* H5FDMPIO/h5pget_dxpl_mpio_f +! +! NAME +! h5pget_dxpl_mpio_f +! +! PURPOSE +! Returns the data transfer mode. +! +! INPUTS +! prp_id - data transfer property list identifier +! OUTPUTS +! data_xfer_mode- transfer mode; possible values are: +! H5FD_MPIO_INDEPENDENT_F +! H5FD_MPIO_COLLECTIVE_F +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! November, 2000 +! +! SOURCE + SUBROUTINE h5pget_dxpl_mpio_f(prp_id, data_xfer_mode, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER, INTENT(OUT) :: data_xfer_mode ! Data transfer mode. Possible values are: + ! H5FD_MPIO_INDEPENDENT_F + ! H5FD_MPIO_COLLECTIVE_F + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTEGER, EXTERNAL :: h5pget_dxpl_mpio_c + hdferr = h5pget_dxpl_mpio_c(prp_id, data_xfer_mode) + END SUBROUTINE h5pget_dxpl_mpio_f + +!****s* H5FDMPIO/h5pset_fapl_mpiposix_f +! +! NAME +! h5pset_fapl_mpiposix_f +! +! PURPOSE +! Stores MPI IO communicator information to the file +! access property list. +! +! INPUTS +! prp_id - file access property list identifier +! comm - MPI-2 communicator +! use_gpfs - logical flag to use the GPFS hints +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! May 6, 2003 +! +! SOURCE + SUBROUTINE h5pset_fapl_mpiposix_f(prp_id, comm, use_gpfs, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER, INTENT(IN) :: comm ! MPI communicator to be used for file open + ! as defined in MPI_FILE_OPEN of MPI-2 + LOGICAL, INTENT(IN) :: use_gpfs + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTEGER :: flag + INTEGER, EXTERNAL :: h5pset_fapl_mpiposix_c + flag = 0 + IF(use_gpfs) flag = 1 + hdferr = h5pset_fapl_mpiposix_c(prp_id, comm, flag) + END SUBROUTINE h5pset_fapl_mpiposix_f + +!****s* H5FDMPIO/h5pget_fapl_mpiposix_f +! +! NAME +! h5pget_fapl_mpiposix_f +! +! PURPOSE +! Returns MPI communicator information. +! +! INPUTS +! prp_id - file access property list identifier +! OUTPUTS +! comm - MPI-2 communicator +! use_gpfs - flag to use GPFS hints +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! Elena Pourmal +! May 6, 2003 +! +! SOURCE + SUBROUTINE h5pget_fapl_mpiposix_f(prp_id, comm, use_gpfs, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER, INTENT(OUT) :: comm ! Buffer to return communicator + LOGICAL, INTENT(OUT) :: use_gpfs + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTEGER :: flag + + INTEGER, EXTERNAL :: h5pget_fapl_mpiposix_c + hdferr = h5pget_fapl_mpiposix_c(prp_id, comm, flag) + use_gpfs = .FALSE. + IF (flag .EQ. 1) use_gpfs = .TRUE. + END SUBROUTINE h5pget_fapl_mpiposix_f + +END MODULE H5FDMPIO diff --git a/fortran/src/H5Ff.c b/fortran/src/H5Ff.c index 3cfc9e3..1259d4d 100644 --- a/fortran/src/H5Ff.c +++ b/fortran/src/H5Ff.c @@ -1,4 +1,9 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +/****h* H5Ff/H5Ff + * PURPOSE + * This file contains C stubs for H5F Fortran APIs + * + * COPYRIGHT + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * @@ -11,29 +16,37 @@ * is linked from the top-level documents page. It can also be found at * * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * * access to either file, you may request a copy from help@hdfgroup.org. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -/* This files contains C stubs for H5F Fortran APIs */ + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * + ****** +*/ #include "H5f90.h" #include "H5Eprivate.h" -/*---------------------------------------------------------------------------- - * Name: h5fcreate_c - * Purpose: Call H5Fcreate to create the file - * Inputs: name - name of the file +/****if* H5Ff/h5fcreate_c + * NAME + * h5fcreate_c + * PURPOSE + * Call H5Fcreate to create the file + * INPUTS + * name - name of the file * namelen - name length * access_flags - file access flags * crt_pr - identifier of creation property list * acc_prp - identifier of access property list - * Outputs: file_id - file identifier - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * OUTPUTS + * file_id - file identifier + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Monday, July 26, 1999 - * Modifications: - *---------------------------------------------------------------------------*/ + * SOURCE +*/ int_f nh5fcreate_c(_fcd name, int_f *namelen, int_f *access_flags, hid_t_f* crt_prp, hid_t_f *acc_prp, hid_t_f *file_id) +/******/ { int ret_value = -1; char *c_name; @@ -80,20 +93,26 @@ nh5fcreate_c(_fcd name, int_f *namelen, int_f *access_flags, hid_t_f* crt_prp, h return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5fflush_c - * Purpose: Call H5Fflush to flush the object - * Inputs: object_id - identifier of either a file, a dataset, +/****if* H5Ff/h5fflush_c + * NAME + * h5fflush_c + * PURPOSE + * Call H5Fflush to flush the object + * INPUTS + * object_id - identifier of either a file, a dataset, * a group, an attribute or a named data type * scope - integer to specify the flushing action, either * H5F_SCOPE_GLOBAL or H5F_SCOPE_LOCAL - * Returns: 0 on success, -1 on failure - * Programmer: Xiangyang Su + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Xiangyang Su * Friday, November 5, 1999 - * Modifications: - *---------------------------------------------------------------------------*/ + * SOURCE +*/ int_f nh5fflush_c (hid_t_f *object_id, int_f *scope) +/******/ { int ret_value = -1; hid_t c_file_id; @@ -115,21 +134,27 @@ nh5fflush_c (hid_t_f *object_id, int_f *scope) } -/*---------------------------------------------------------------------------- - * Name: h5fmount_c - * Purpose: Call H5Fmount to mount the file - * Inputs: loc_id - Identifier for file or group +/****if* H5Ff/h5fmount_c + * NAME + * h5fmount_c + * PURPOSE + * Call H5Fmount to mount the file + * INPUTS + * loc_id - Identifier for file or group * dsetname - name of dataset * namelen - dsetname length * file_id - file identifier for the file to be mounted * acc_prp - identifier of access property list - * Returns: 0 on success, -1 on failure - * Programmer: Xiangyang Su + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Xiangyang Su * Monday, October 25, 1999 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY +*/ int_f nh5fmount_c (hid_t_f *loc_id, _fcd dsetname, int_f *namelen, hid_t_f *file_id, hid_t_f *acc_prp) +/******/ { int ret_value = -1; char *c_name; @@ -167,19 +192,25 @@ nh5fmount_c (hid_t_f *loc_id, _fcd dsetname, int_f *namelen, hid_t_f *file_id, h return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5funmount_c - * Purpose: Call H5Funmount to unmount the file - * Inputs: loc_id - Identifier for file or group +/****if* H5Ff/h5funmount_c + * NAME + * h5funmount_c + * PURPOSE + * Call H5Funmount to unmount the file + * INPUTS + * loc_id - Identifier for file or group * dsetname - name of dataset * namelen - dsetname length - * Returns: 0 on success, -1 on failure - * Programmer: Xiangyang Su + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Xiangyang Su * Monday, October 25, 1999 - * Modifications: - *---------------------------------------------------------------------------*/ + * SOURCE +*/ int_f nh5funmount_c (hid_t_f *loc_id, _fcd dsetname, int_f *namelen) +/******/ { int ret_value = -1; char *c_name; @@ -209,21 +240,28 @@ nh5funmount_c (hid_t_f *loc_id, _fcd dsetname, int_f *namelen) -/*---------------------------------------------------------------------------- - * Name: h5fopen_c - * Purpose: Call H5Fopen to open the file - * Inputs: name - name of the file +/****if* H5Ff/h5fopen_c + * NAME + * h5fopen_c + * PURPOSE + * Call H5Fopen to open the file + * INPUTS + * name - name of the file * namelen - name length * access_flags - file access flags * acc_prp - identifier of access property list - * Outputs: file_id - file identifier - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * OUTPUTS + * file_id - file identifier + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Tuesday, August 3, 1999 - * Modifications: - *---------------------------------------------------------------------------*/ + * SOURCE +*/ int_f nh5fopen_c (_fcd name, int_f *namelen, int_f *access_flags, hid_t_f *acc_prp, hid_t_f *file_id) +/******/ { int ret_value = -1; char *c_name; @@ -265,18 +303,25 @@ nh5fopen_c (_fcd name, int_f *namelen, int_f *access_flags, hid_t_f *acc_prp, hi return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5freopen_c - * Purpose: Call H5Freopen to open the file - * Inputs: file_id1 - file identifier - * Outputs: file_id2 - file identifier - * Returns: 0 on success, -1 on failure - * Programmer: Xiangyang Su +/****if* H5Ff/h5freopen_c + * NAME + * h5freopen_c + * PURPOSE + * Call H5Freopen to open the file + * INPUTS + * file_id1 - file identifier + * OUTPUTS + * file_id2 - file identifier + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Xiangyang Su * Wednesday, November 3, 1999 - * Modifications: - *---------------------------------------------------------------------------*/ + * SOURCE +*/ int_f nh5freopen_c (hid_t_f *file_id1, hid_t_f *file_id2) +/******/ { int ret_value = -1; hid_t c_file_id1, c_file_id2; @@ -291,18 +336,25 @@ nh5freopen_c (hid_t_f *file_id1, hid_t_f *file_id2) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5fget_create_plist_c - * Purpose: Call H5Fget_create_plist to get the file creation property list - * Inputs: file_id - file identifier - * Outputs: prop_id - creation property list identifier - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal, Xiangyang Su +/****if* H5Ff/h5fget_create_plist_c + * NAME + * h5fget_create_plist_c + * PURPOSE + * Call H5Fget_create_plist to get the file creation property list + * INPUTS + * file_id - file identifier + * OUTPUTS + * prop_id - creation property list identifier + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal, Xiangyang Su * Wednesday, November 3, 1999 - * Modifications: - *---------------------------------------------------------------------------*/ + * SOURCE +*/ int_f nh5fget_create_plist_c (hid_t_f *file_id, hid_t_f *prop_id) +/******/ { int ret_value = -1; hid_t c_file_id, c_prop_id; @@ -317,18 +369,27 @@ nh5fget_create_plist_c (hid_t_f *file_id, hid_t_f *prop_id) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5fget_access_plist_c - * Purpose: Call H5Fget_access_plist to get the file access property list - * Inputs: file_id - file identifier - * Outputs: access_id - access property list identifier - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal +/****if* H5Ff/h5fget_access_plist_c + * NAME + * h5fget_access_plist_c + * PURPOSE + * Call H5Fget_access_plist to get the file access property list + * INPUTS + * file_id - file identifier + * OUTPUTS + * access_id - access property list identifier + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Monday, September 30, 2002 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5fget_access_plist_c (hid_t_f *file_id, hid_t_f *access_id) +/******/ { int ret_value = -1; hid_t c_file_id, c_access_id; @@ -343,20 +404,29 @@ nh5fget_access_plist_c (hid_t_f *file_id, hid_t_f *access_id) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5fis_hdf5_c - * Purpose: Call H5Fis_hdf5 to determone if the file is an HDF5 file - * Inputs: name - name of the file +/****if* H5Ff/h5fis_hdf5_c + * NAME + * h5fis_hdf5_c + * PURPOSE + * Call H5Fis_hdf5 to determone if the file is an HDF5 file + * INPUTS + * name - name of the file * namelen - name length - * Outputs: flag - 0 if file is not HDF5 file , positive if a file + * OUTPUTS + * flag - 0 if file is not HDF5 file , positive if a file * is an HDF5 file, and negative on failure. - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Tuesday, August 3, 1999 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5fis_hdf5_c (_fcd name, int_f *namelen, int_f *flag) +/******/ { int ret_value = -1; char *c_name; @@ -380,18 +450,26 @@ nh5fis_hdf5_c (_fcd name, int_f *namelen, int_f *flag) HDfree(c_name); return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5fclose_c - * Purpose: Call H5Fclose to close the file - * Inputs: file_id - identifier of the file to be closed - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal +/****if* H5Ff/h5fclose_c + * NAME + * h5fclose_c + * PURPOSE + * Call H5Fclose to close the file + * INPUTS + * file_id - identifier of the file to be closed + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Monday, July 26, 1999 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5fclose_c ( hid_t_f *file_id ) +/******/ { int ret_value = 0; hid_t c_file_id; @@ -400,22 +478,30 @@ nh5fclose_c ( hid_t_f *file_id ) if ( H5Fclose(c_file_id) < 0 ) ret_value = -1; return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5fget_obj_count_c - * Purpose: Call H5Fget_obj_count to get number of open objects within a file - * Inputs: file_id - identifier of the file to be closed +/****if* H5Ff/h5fget_obj_count_c + * NAME + * h5fget_obj_count_c + * PURPOSE + * Call H5Fget_obj_count to get number of open objects within a file + * INPUTS + * file_id - identifier of the file to be closed * obj_type - type of the object - * Returns: obj_count - number of objects + * RETURNS + * obj_count - number of objects * 0 on success, -1 on failure - * Programmer: Elena Pourmal + * AUTHOR + * Elena Pourmal * Monday, September 30, 2002 - * Modifications: + * HISTORY + * * Changed type of obj_count to size_t_f * Thursday, September 25, 2008 - *---------------------------------------------------------------------------*/ + * SOURCE +*/ int_f nh5fget_obj_count_c ( hid_t_f *file_id , int_f *obj_type, size_t_f * obj_count) +/******/ { int ret_value = 0; hid_t c_file_id; @@ -429,23 +515,32 @@ nh5fget_obj_count_c ( hid_t_f *file_id , int_f *obj_type, size_t_f * obj_count) *obj_count = (size_t_f)c_obj_count; return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5fget_obj_ids_c - * Purpose: Call H5Fget_obj_count to get number of open objects within a file - * Inputs: file_id - identifier of the file to be closed - * obj_type - type of the object - * Returns: obj_ids - iarray of open objects identifiers +/****if* H5Ff/h5fget_obj_ids_c + * NAME + * h5fget_obj_ids_c + * PURPOSE + * Call H5Fget_obj_count to get number of open objects within a file + * INPUTS + * file_id - identifier of the file to be closed + * obj_type - type of the object + * RETURNS + * obj_ids - iarray of open objects identifiers * 0 on success, -1 on failure - * Programmer: Elena Pourmal - * Monday, September 30, 2002 - * Modifications: - * Changed type of max_obj to size_t_f; added parameter for the - * number of open objects - * Thursday, September 25, 2008 EIP - *---------------------------------------------------------------------------*/ + * AUTHOR + * Elena Pourmal + * Monday, September 30, 2002 + * HISTORY + * + * Changed type of max_obj to size_t_f; added parameter for the + * number of open objects + * Thursday, September 25, 2008 EIP + * + * SOURCE +*/ int_f -nh5fget_obj_ids_c(hid_t_f *file_id, int_f *obj_type, size_t_f *max_objs, +nh5fget_obj_ids_c ( hid_t_f *file_id , int_f *obj_type, size_t_f *max_objs, hid_t_f *obj_ids, size_t_f *num_objs) +/******/ { int ret_value = 0; hid_t c_file_id; @@ -472,20 +567,25 @@ nh5fget_obj_ids_c(hid_t_f *file_id, int_f *obj_type, size_t_f *max_objs, return ret_value; } - -/*---------------------------------------------------------------------------- - * Name: h5fget_freespace_c - * Purpose: Call H5Fget_freespace to get amount of free space within a file - * Inputs: file_id - identifier of the file to query - * Returns: free_space - amount of free space in file +/****if* H5Ff/h5fget_freespace_c + * NAME + * h5fget_freespace_c + * PURPOSE + * Call H5Fget_freespace to get amount of free space within a file + * INPUTS + * file_id - identifier of the file to query + * RETURNS + * free_space - amount of free space in file * 0 on success, -1 on failure - * Programmer: Quincey Koziol + * AUTHOR + * Quincey Koziol * Tuesday, October 7, 2003 - * Modifications: - *---------------------------------------------------------------------------*/ + * SOURCE +*/ int_f nh5fget_freespace_c ( hid_t_f *file_id , hssize_t_f *free_space) +/******/ { int ret_value = 0; hid_t c_file_id; @@ -497,20 +597,27 @@ nh5fget_freespace_c ( hid_t_f *file_id , hssize_t_f *free_space) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5fget_name_c - * Purpose: Call H5Fget_name to get file's name - * Inputs: obj_id - object identifier +/****if* H5Ff/h5fget_name_c + * NAME + * h5fget_name_c + * PURPOSE + * Call H5Fget_name to get file's name + * INPUTS + * obj_id - object identifier * buflen -size of the buffer - * Outputs: buf - buffer to hold the name + * OUTPUTS + * buf - buffer to hold the name * size - size of the file's name - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Tuesday, July 6, 2004 - * Modifications: - *---------------------------------------------------------------------------*/ + * SOURCE +*/ int_f nh5fget_name_c(hid_t_f *obj_id, size_t_f *size, _fcd buf, size_t_f *buflen) +/******/ { char *c_buf = NULL; /* Buffer to hold C string */ ssize_t size_c = -1; @@ -539,18 +646,25 @@ done: return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5fget_filesize_c - * Purpose: Call H5Fget_filesize to get file size - * Inputs: file_id - file identifier - * Outputs: size - size of the file - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal +/****if* H5Ff/h5fget_filesize_c + * NAME + * h5fget_filesize_c + * PURPOSE + * Call H5Fget_filesize to get file size + * INPUTS + * file_id - file identifier + * OUTPUTS + * size - size of the file + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Wednesday, July 7, 2004 - * Modifications: - *---------------------------------------------------------------------------*/ + * SOURCE +*/ int_f nh5fget_filesize_c(hid_t_f *file_id, hsize_t_f *size) +/******/ { hsize_t size_c; herr_t ret_value=0; /* Return value */ diff --git a/fortran/src/H5Fff.f90 b/fortran/src/H5Fff.f90 index dcd6ff6..0c70ad4 100644 --- a/fortran/src/H5Fff.f90 +++ b/fortran/src/H5Fff.f90 @@ -1,3 +1,15 @@ +!****h* ROBODoc/H5F +! +! NAME +! MODULE H5F +! +! FILE +! H5Fff.f90 +! +! PURPOSE +! This file contains Fortran interfaces for H5F functions. +! +! COPYRIGHT ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! Copyright by The HDF Group. * ! Copyright by the Board of Trustees of the University of Illinois. * @@ -13,863 +25,810 @@ ! access to either file, you may request a copy from help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! -! -! This file contains Fortran90 interfaces for H5F functions. -! - MODULE H5F - USE H5GLOBAL - - CONTAINS - -!---------------------------------------------------------------------- -! Name: h5fcreate_f -! -! Purpose: Creates HDF5 files. -! -! Inputs: -! name - name of the file to create -! access_flags - File access flags. Allowable values are: -! H5F_ACC_TRUNC_F -! H5F_ACC_EXCL_F -! Outputs: -! file_id - file identifier -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! creation_prp - file creation property list identifier -! access_prp - file access property list identifier -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). February 28, 2001 -! -! Comment: -!---------------------------------------------------------------------- - SUBROUTINE h5fcreate_f(name, access_flags, file_id, hdferr, & - creation_prp, access_prp) - IMPLICIT NONE - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the file - INTEGER, INTENT(IN) :: access_flags ! File access flags - INTEGER(HID_T), INTENT(OUT) :: file_id ! File identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: creation_prp - ! File creation propertly - ! list identifier - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: access_prp - ! File access property list - ! identifier - INTEGER(HID_T) :: creation_prp_default - INTEGER(HID_T) :: access_prp_default - INTEGER :: namelen ! Length of the name character string - -! INTEGER, EXTERNAL :: h5fcreate_c -! Interface is needed for MS FORTRAN -! - INTERFACE - 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$ATTRIBUTES reference :: name - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER, INTENT(IN) :: access_flags - INTEGER(HID_T), INTENT(OUT) :: file_id - INTEGER(HID_T), INTENT(IN) :: creation_prp_default - INTEGER(HID_T), INTENT(IN) :: access_prp_default - INTEGER :: namelen - END FUNCTION h5fcreate_c - END INTERFACE - - creation_prp_default = H5P_DEFAULT_F - access_prp_default = H5P_DEFAULT_F - - if (present(creation_prp)) creation_prp_default = creation_prp - if (present(access_prp)) access_prp_default = access_prp - namelen = LEN_TRIM(name) - - hdferr = h5fcreate_c(name, namelen, access_flags, & - creation_prp_default, access_prp_default, file_id) - - END SUBROUTINE h5fcreate_f - -!---------------------------------------------------------------------- -! Name: h5fflush_f -! -! Purpose: Flushes all buffers associated with a file to disk -! -! Inputs: -! object_id - identifier of object used to identify -! the file. -! scope - specifies the scope of the flushing action. -! Possible values are: -! H5F_SCOPE_GLOBAL_F -! H5F_SCOPE_LOCAL_F -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! creation_prp - file creation property list identifier -! access_prp - file access property list identifier -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). February 28, 2001 -! -! Comment: -!---------------------------------------------------------------------- - SUBROUTINE h5fflush_f(object_id, scope, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: object_id !identifier for any object - !associate with a file, - !including the file itself, - !a dataset, a group, an - !attribute, or a named - !data type - - INTEGER, INTENT(IN) :: scope !scope of the flushing - !action, possible values - !are: H5F_SCOPE_GLOBAL_F - ! which flushes the entire - !virtual file, - !and H5F_SCOPE_LOCAL_F - !which flushes only the - !specified file. - - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5fflush_c -! MS FORTRAN needs explicit interface for C functions called here. -! - 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 - INTEGER(HID_T), INTENT(IN) :: object_id - INTEGER, INTENT(IN) :: scope - END FUNCTION h5fflush_c - END INTERFACE - - hdferr = h5fflush_c(object_id, scope) - - END SUBROUTINE h5fflush_f - -!---------------------------------------------------------------------- -! Name: h5fmount_f -! -! Purpose: Mounts a file. -! -! Inputs: -! loc_id - the identifier for of file or group in -! which name is defined -! name - the name of the group onto which the file -! specified by child_id is to be mounted. -! child_id - the identifier of the file to be mounted. -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! access_prp - the identifier of the property list to be used -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). February 28, 2001 -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5fmount_f(loc_id, name, child_id, hdferr, access_prp) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! Identifier for file or group - ! in which dsetname is defined - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the group - INTEGER(HID_T), INTENT(IN) :: child_id ! File identifier for the - ! file to be mounted - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: access_prp - ! File access property list - ! identifier - INTEGER(HID_T) :: access_prp_default - INTEGER :: namelen ! Length of the name character string - -! INTEGER, EXTERNAL :: h5fmount_c -! Interface is needed for MS FORTRAN -! - INTERFACE - 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$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER(HID_T), INTENT(IN) :: child_id - INTEGER(HID_T), INTENT(IN) :: access_prp_default - INTEGER :: namelen - END FUNCTION h5fmount_c - END INTERFACE - - access_prp_default = H5P_DEFAULT_F - if (present(access_prp)) access_prp_default = access_prp - namelen = LEN(name) - hdferr = h5fmount_c(loc_id, name, namelen, child_id, access_prp_default) - - END SUBROUTINE h5fmount_f - - -!---------------------------------------------------------------------- -! Name: h5funmount_f -! -! Purpose: Unmounts a file. -! -! Inputs: -! loc_id - the identifier for of file or group in -! which name is defined -! name - the name of the mount point -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). February 28, 2001 -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5funmount_f(loc_id, name, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! Identifier for file or group - ! at which the specified file - ! is to be unmounted - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the mount point - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER :: namelen ! Length of the name character string - -! INTEGER, EXTERNAL :: h5fumount_c -! Interface is needed for MS FORTRAN -! - 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$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER :: namelen - END FUNCTION h5funmount_c - END INTERFACE - - namelen = LEN(name) - hdferr = h5funmount_c(loc_id, name, namelen) - - END SUBROUTINE h5funmount_f - -!---------------------------------------------------------------------- -! Name: h5fopen_f -! -! Purpose: Opens HDF5 file. -! -! Inputs: -! name - name of the file to acecss -! access_flags - File access flags. Allowable values are: -! H5F_ACC_RDWR_F -! H5F_ACC_RDONLY_F -! Outputs: -! file_id - file identifier -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! access_prp - file access property list identifier -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). February 28, 2001 -! -! Comment: -!---------------------------------------------------------------------- - SUBROUTINE h5fopen_f(name, access_flags, file_id, hdferr, & - access_prp) - IMPLICIT NONE - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the file - INTEGER, INTENT(IN) :: access_flags ! File access flags - INTEGER(HID_T), INTENT(OUT) :: file_id ! File identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: access_prp - ! File access property list - ! identifier - INTEGER(HID_T) :: access_prp_default - INTEGER :: namelen ! Length of the name character string - -! INTEGER, EXTERNAL :: h5fopen_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - 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$ATTRIBUTES reference :: name - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER :: namelen - INTEGER, INTENT(IN) :: access_flags - INTEGER(HID_T), INTENT(IN) :: access_prp_default - INTEGER(HID_T), INTENT(OUT) :: file_id - END FUNCTION h5fopen_c - END INTERFACE - - access_prp_default = H5P_DEFAULT_F - if (present(access_prp)) access_prp_default = access_prp - namelen = LEN(name) - hdferr = h5fopen_c(name, namelen, access_flags, & +! NOTES +! *** IMPORTANT *** +! If you add a new H5F function you must add the function name to the +! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! This is needed for Windows based operating systems. +! +!***** + +MODULE H5F + USE H5GLOBAL + +CONTAINS +!****s* H5F/h5fcreate_f +! +! NAME +! h5fcreate_f +! +! PURPOSE +! Creates HDF5 files. +! +! INPUTS +! name - name of the file to create +! access_flags - File access flags. Allowable values are: +! H5F_ACC_TRUNC_F +! H5F_ACC_EXCL_F +! OUTPUTS +! file_id - file identifier +! hdferr - Returns 0 if successful and -1 if fails +! +! OPTIONAL PARAMETERS +! creation_prp - file creation property list identifier +! access_prp - file access property list identifier +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). February 28, 2001 +! +! SOURCE + SUBROUTINE h5fcreate_f(name, access_flags, file_id, hdferr, & + creation_prp, access_prp) + IMPLICIT NONE + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the file + INTEGER, INTENT(IN) :: access_flags ! File access flags + INTEGER(HID_T), INTENT(OUT) :: file_id ! File identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: creation_prp + ! File creation propertly + ! list identifier + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: access_prp + ! File access property list + ! identifier +!***** + INTEGER(HID_T) :: creation_prp_default + INTEGER(HID_T) :: access_prp_default + INTEGER :: namelen ! Length of the name character string + + INTERFACE + 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$ATTRIBUTES reference :: name + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER, INTENT(IN) :: access_flags + INTEGER(HID_T), INTENT(OUT) :: file_id + INTEGER(HID_T), INTENT(IN) :: creation_prp_default + INTEGER(HID_T), INTENT(IN) :: access_prp_default + INTEGER :: namelen + END FUNCTION h5fcreate_c + END INTERFACE + + creation_prp_default = H5P_DEFAULT_F + access_prp_default = H5P_DEFAULT_F + + IF (PRESENT(creation_prp)) creation_prp_default = creation_prp + IF (PRESENT(access_prp)) access_prp_default = access_prp + namelen = LEN_TRIM(name) + hdferr = h5fcreate_c(name, namelen, access_flags, & + creation_prp_default, access_prp_default, file_id) + + END SUBROUTINE h5fcreate_f +!****s* H5F/h5fflush_f +! +! NAME +! h5fflush_f +! +! PURPOSE +! Flushes all buffers associated WITH a file to disk +! +! INPUTS +! object_id - identifier of object used to identify the file. +! scope - specifies the scope of the flushing action. +! Possible values are: +! H5F_SCOPE_GLOBAL_F +! H5F_SCOPE_LOCAL_F +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! +! OPTIONAL PARAMETERS +! creation_prp - file creation property list identifier +! access_prp - file access property list identifier +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). February 28, 2001 +! +! SOURCE + SUBROUTINE h5fflush_f(object_id, scope, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: object_id !identifier for any object + !associate with a file, + !including the file itself, + !a dataset, a group, an + !attribute, or a named + !data type + + INTEGER, INTENT(IN) :: scope !scope of the flushing + !action, possible values + !are: H5F_SCOPE_GLOBAL_F + ! which flushes the entire + !virtual file, + !and H5F_SCOPE_LOCAL_F + !which flushes only the + !specified file. + + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + 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 + INTEGER(HID_T), INTENT(IN) :: object_id + INTEGER, INTENT(IN) :: scope + END FUNCTION h5fflush_c + END INTERFACE + + hdferr = h5fflush_c(object_id, scope) + + END SUBROUTINE h5fflush_f +!****s* H5F/h5fmount_f +! +! NAME +! h5fmount_f +! +! PURPOSE +! Mounts a file. +! +! INPUTS +! loc_id - the identifier for of file or group in +! which name is defined +! name - the name of the group onto which the file +! specified by child_id is to be mounted. +! child_id - the identifier of the file to be mounted. +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! OPTIONAL PARAMETERS +! access_prp - the identifier of the property list to be used +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). February 28, 2001 +! +! SOURCE + SUBROUTINE h5fmount_f(loc_id, name, child_id, hdferr, access_prp) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id ! Identifier for file or group + ! in which dsetname is defined + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the group + INTEGER(HID_T), INTENT(IN) :: child_id ! File identifier for the + ! file to be mounted + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: access_prp + ! File access property list + ! identifier +!***** + INTEGER(HID_T) :: access_prp_default + INTEGER :: namelen ! Length of the name character string + + INTERFACE + 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$ATTRIBUTES reference :: name + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER(HID_T), INTENT(IN) :: child_id + INTEGER(HID_T), INTENT(IN) :: access_prp_default + INTEGER :: namelen + END FUNCTION h5fmount_c + END INTERFACE + + access_prp_default = H5P_DEFAULT_F + IF (PRESENT(access_prp)) access_prp_default = access_prp + namelen = LEN_TRIM(name) + hdferr = h5fmount_c(loc_id, name, namelen, child_id, access_prp_default) + + END SUBROUTINE h5fmount_f + +!****s* H5F/h5funmount_f +! +! NAME +! h5funmount_f +! +! PURPOSE +! Unmounts a file. +! +! INPUTS +! loc_id - the identifier for of file or group in +! which name is defined +! name - the name of the mount point +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). February 28, 2001 +! +! SOURCE + SUBROUTINE h5funmount_f(loc_id, name, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id ! Identifier for file or group + ! at which the specified file + ! is to be unmounted + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the mount point + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTEGER :: namelen ! Length of the name character string + + 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$ATTRIBUTES reference :: name + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER :: namelen + END FUNCTION h5funmount_c + END INTERFACE + + namelen = LEN_TRIM(name) + hdferr = h5funmount_c(loc_id, name, namelen) + + END SUBROUTINE h5funmount_f +!****s* H5F/h5fopen_f +! +! NAME +! h5fopen_f +! +! PURPOSE +! Opens HDF5 file. +! +! INPUTS +! name - name of the file to acecss +! access_flags - File access flags. Allowable values are: +! H5F_ACC_RDWR_F +! H5F_ACC_RDONLY_F +! OUTPUTS +! file_id - file identifier +! hdferr - Returns 0 if successful and -1 if fails +! OPTIONAL PARAMETERS +! access_prp - file access property list identifier +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). February 28, 2001 +! +! SOURCE + SUBROUTINE h5fopen_f(name, access_flags, file_id, hdferr, access_prp) + IMPLICIT NONE + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the file + INTEGER, INTENT(IN) :: access_flags ! File access flags + INTEGER(HID_T), INTENT(OUT) :: file_id ! File identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), OPTIONAL, INTENT(IN) :: access_prp + ! File access property list + ! identifier +!***** + INTEGER(HID_T) :: access_prp_default + INTEGER :: namelen ! Length of the name character string + + INTERFACE + 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$ATTRIBUTES reference :: name + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER :: namelen + INTEGER, INTENT(IN) :: access_flags + INTEGER(HID_T), INTENT(IN) :: access_prp_default + INTEGER(HID_T), INTENT(OUT) :: file_id + END FUNCTION h5fopen_c + END INTERFACE + + access_prp_default = H5P_DEFAULT_F + IF (PRESENT(access_prp)) access_prp_default = access_prp + namelen = LEN_TRIM(name) + hdferr = h5fopen_c(name, namelen, access_flags, & access_prp_default, file_id) - - END SUBROUTINE h5fopen_f - -!---------------------------------------------------------------------- -! Name: h5freopen_f -! -! Purpose: Reopens HDF5 file. -! -! Inputs: -! file_id - identifier of a file for which an -! additional identifier is required -! Outputs: -! ret_file_id - new file identifier -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). February 28, 2001 -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5freopen_f(file_id, ret_file_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: file_id ! File identifier - INTEGER(HID_T), INTENT(OUT) :: ret_file_id ! New File identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5freopen_c -! MS FORTRAN needs explicit interface for C functions called here. -! - 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 - INTEGER(HID_T), INTENT(IN) :: file_id - INTEGER(HID_T), INTENT(OUT) :: ret_file_id - END FUNCTION h5freopen_c - END INTERFACE - - hdferr = h5freopen_c(file_id, ret_file_id) - - END SUBROUTINE h5freopen_f - -!---------------------------------------------------------------------- -! Name: h5fget_create_plist_f -! -! Purpose: Returns a file creation property list identifier. -! -! Inputs: -! file_id - identifier of a file to get -! get creation property list of -! Outputs: -! prop_id - creation property list identifier -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). February 28, 2001 -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5fget_create_plist_f(file_id, prop_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: file_id ! File identifier - INTEGER(HID_T), INTENT(OUT) :: prop_id ! File creation property - ! list identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5fget_create_plist_c -! MS FORTRAN needs explicit interface for C functions called here. -! - 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 - INTEGER(HID_T), INTENT(IN) :: file_id - INTEGER(HID_T), INTENT(OUT) :: prop_id - END FUNCTION h5fget_create_plist_c - END INTERFACE - - hdferr = h5fget_create_plist_c(file_id, prop_id) - - END SUBROUTINE h5fget_create_plist_f - -!---------------------------------------------------------------------- -! Name: h5fget_access_plist_f -! -! Purpose: Returns a file access property list identifier. -! -! Inputs: -! file_id - identifier of a file to get -! get creation property list of -! Outputs: -! access_id - access property list identifier -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). February 28, 2001 -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5fget_access_plist_f(file_id, access_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: file_id ! File identifier - INTEGER(HID_T), INTENT(OUT) :: access_id ! File access property - ! list identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5fget_access_plist_c -! MS FORTRAN needs explicit interface for C functions called here. -! - 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 - INTEGER(HID_T), INTENT(IN) :: file_id - INTEGER(HID_T), INTENT(OUT) :: access_id - END FUNCTION h5fget_access_plist_c - END INTERFACE - - - hdferr = h5fget_access_plist_c(file_id, access_id) - - END SUBROUTINE h5fget_access_plist_f - -!---------------------------------------------------------------------- -! Name: h5fis_hdf5_f -! -! Purpose: Determines whether a file is in the HDF5 format. -! -! Inputs: -! name - name of the file to check -! Outputs: -! status - indicates if file is and HDF5 file -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). February 28, 2001 -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5fis_hdf5_f(name, status, hdferr) - IMPLICIT NONE - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the file - LOGICAL, INTENT(OUT) :: status ! Indicates if file - ! is an HDF5 file - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER :: namelen ! Length of the name character string - INTEGER :: flag ! "TRUE/FALSE" flag from C routine - ! to define status value. - -! INTEGER, EXTERNAL :: h5fis_hdf5_c -! MS FORTRAN needs explicit interface for C functions called here. -! - 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$ATTRIBUTES reference :: name - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER :: namelen - INTEGER :: flag - END FUNCTION h5fis_hdf5_c - END INTERFACE - - namelen = LEN(name) - hdferr = h5fis_hdf5_c(name, namelen, flag) - status = .TRUE. - if (flag .EQ. 0) status = .FALSE. - - END SUBROUTINE h5fis_hdf5_f - -!---------------------------------------------------------------------- -! Name: h5fclose_f -! -! Purpose: Closes HDF5 file. -! -! Inputs: -! file_id - file identifier -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). February 28, 2001 -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5fclose_f(file_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: file_id ! File identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5fclose_c -! MS FORTRAN needs explicit interface for C functions called here. -! - 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 - INTEGER(HID_T), INTENT(IN) :: file_id - END FUNCTION h5fclose_c - END INTERFACE - - hdferr = h5fclose_c(file_id) - - END SUBROUTINE h5fclose_f - -!---------------------------------------------------------------------- -! Name: h5fget_obj_count_f -! -! Purpose: Gets number of the objects open within a file -! -! Inputs: -! file_id - file identifier -! obj_type - type of the object; possible values are: -! H5F_OBJ_FILE_F -! H5F_OBJ_DATASET_F -! H5F_OBJ_GROUP_F -! H5F_OBJ_DATATYPE_F -! H5F_OBJ_ALL_F -! Outputs: -! obj_count - number of open objects -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! September 30, 2002 -! -! Modifications: -! Changed the type of obj_count to INTEGER(SIZE_T) -! September 25, 2008 EIP -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5fget_obj_count_f(file_id, obj_type, obj_count, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: file_id ! File identifier - INTEGER, INTENT(IN) :: obj_type ! Object type - INTEGER(SIZE_T), INTENT(OUT) :: obj_count - ! Number of open objects - INTEGER, INTENT(OUT) :: hdferr ! Error code - - 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 - INTEGER(HID_T), INTENT(IN) :: file_id - INTEGER, INTENT(IN) :: obj_type ! Object type - INTEGER(SIZE_T), INTENT(OUT) :: obj_count - ! Number of open objects - END FUNCTION h5fget_obj_count_c - END INTERFACE - - hdferr = h5fget_obj_count_c(file_id, obj_type, obj_count) - - END SUBROUTINE h5fget_obj_count_f - -!---------------------------------------------------------------------- -! Name: h5fget_obj_ids_f -! -! Purpose: Get list of open objects identifiers within a file -! -! Inputs: -! file_id - file identifier -! obj_type - type of the object; possible values are: -! H5F_OBJ_FILE_F -! H5F_OBJ_DATASET_F -! H5F_OBJ_GROUP_F -! H5F_OBJ_DATATYPE_F -! H5F_OBJ_ALL_F -! Outputs: -! obj_ids - array of open object identifiers -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! September 30, 2002 -! -! Modifications: -! Added optional parameter num_objs for number of open objects -! of the specified type and changed type of max_obj to -! INTEGER(SIZE_T) -! September 25, 2008 EIP -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5fget_obj_ids_f(file_id, obj_type, max_objs, obj_ids, hdferr, num_objs) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: file_id ! File identifier - INTEGER, INTENT(IN) :: obj_type ! Object type - INTEGER(SIZE_T), INTENT(IN) :: max_objs ! Maximum # of objects to retrieve - INTEGER(HID_T), DIMENSION(*), INTENT(INOUT) :: obj_ids + END SUBROUTINE h5fopen_f +!****s* H5F/h5freopen_f +! +! NAME +! h5freopen_f +! +! PURPOSE +! Reopens HDF5 file. +! +! INPUTS +! file_id - identifier of a file for which an +! additional identifier is required +! OUTPUTS +! ret_file_id - new file identifier +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). February 28, 2001 +! +! SOURCE + SUBROUTINE h5freopen_f(file_id, ret_file_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: file_id ! File identifier + INTEGER(HID_T), INTENT(OUT) :: ret_file_id ! New File identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + 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 + INTEGER(HID_T), INTENT(IN) :: file_id + INTEGER(HID_T), INTENT(OUT) :: ret_file_id + END FUNCTION h5freopen_c + END INTERFACE + + hdferr = h5freopen_c(file_id, ret_file_id) + + END SUBROUTINE h5freopen_f +!****s* H5F/h5fget_create_plist_f +! +! NAME +! h5fget_create_plist_f +! +! PURPOSE +! Returns a file creation property list identifier. +! +! INPUTS +! file_id - identifier of a file to creation property list of +! OUTPUTS +! prop_id - creation property list identifier +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). February 28, 2001 +! +! SOURCE + SUBROUTINE h5fget_create_plist_f(file_id, prop_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: file_id ! File identifier + INTEGER(HID_T), INTENT(OUT) :: prop_id ! File creation property + ! list identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + 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 + INTEGER(HID_T), INTENT(IN) :: file_id + INTEGER(HID_T), INTENT(OUT) :: prop_id + END FUNCTION h5fget_create_plist_c + END INTERFACE + + hdferr = h5fget_create_plist_c(file_id, prop_id) + + END SUBROUTINE h5fget_create_plist_f +!****s* H5F/h5fget_access_plist_f +! +! NAME +! h5fget_access_plist_f +! +! PURPOSE +! Returns a file access property list identifier. +! +! INPUTS +! file_id - identifier of a file to creation property list of +! OUTPUTS +! access_id - access property list identifier +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). February 28, 2001 +! +! SOURCE + SUBROUTINE h5fget_access_plist_f(file_id, access_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: file_id ! File identifier + INTEGER(HID_T), INTENT(OUT) :: access_id ! File access property + ! list identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + 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 + INTEGER(HID_T), INTENT(IN) :: file_id + INTEGER(HID_T), INTENT(OUT) :: access_id + END FUNCTION h5fget_access_plist_c + END INTERFACE + + hdferr = h5fget_access_plist_c(file_id, access_id) + + END SUBROUTINE h5fget_access_plist_f + +!****s* H5F/h5fis_hdf5_f +! +! NAME +! h5fis_hdf5_f +! +! PURPOSE +! Determines whether a file is in the HDF5 format. +! +! INPUTS +! name - name of the file to check +! OUTPUTS +! status - indicates if file is and HDF5 file +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). February 28, 2001 +! +! SOURCE + SUBROUTINE h5fis_hdf5_f(name, status, hdferr) + IMPLICIT NONE + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the file + LOGICAL, INTENT(OUT) :: status ! Indicates if file + ! is an HDF5 file + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTEGER :: namelen ! Length of the name character string + INTEGER :: flag ! "TRUE/FALSE" flag from C routine + ! to define status value. + + 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$ATTRIBUTES reference :: name + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER :: namelen + INTEGER :: flag + END FUNCTION h5fis_hdf5_c + END INTERFACE + + namelen = LEN_TRIM(name) + hdferr = h5fis_hdf5_c(name, namelen, flag) + status = .TRUE. + IF (flag .EQ. 0) status = .FALSE. + + END SUBROUTINE h5fis_hdf5_f +!****s* H5F/h5fclose_f +! +! NAME +! h5fclose_f +! +! PURPOSE +! Closes HDF5 file. +! +! INPUTS +! file_id - file identifier +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). February 28, 2001 +! +! SOURCE + SUBROUTINE h5fclose_f(file_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: file_id ! File identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + 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 + INTEGER(HID_T), INTENT(IN) :: file_id + END FUNCTION h5fclose_c + END INTERFACE + + hdferr = h5fclose_c(file_id) + + END SUBROUTINE h5fclose_f + +!****s* H5F/h5fget_obj_count_f +! +! NAME +! h5fget_obj_count_f +! +! PURPOSE +! Gets number of the objects open within a file +! +! INPUTS +! file_id - file identifier +! obj_type - type of the object; possible values are: +! H5F_OBJ_FILE_F +! H5F_OBJ_DATASET_F +! H5F_OBJ_GROUP_F +! H5F_OBJ_DATATYPE_F +! H5F_OBJ_ALL_F +! OUTPUTS +! obj_count - number of open objects +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! Elena Pourmal +! September 30, 2002 +! +! HISTORY +! Changed the type of obj_count to INTEGER(SIZE_T) +! September 25, 2008 EIP +! +! SOURCE + SUBROUTINE h5fget_obj_count_f(file_id, obj_type, obj_count, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: file_id ! File identifier + INTEGER, INTENT(IN) :: obj_type ! Object type + INTEGER(SIZE_T), INTENT(OUT) :: obj_count + ! Number of open objects + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + 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 + INTEGER(HID_T), INTENT(IN) :: file_id + INTEGER, INTENT(IN) :: obj_type ! Object type + INTEGER(SIZE_T), INTENT(OUT) :: obj_count + ! Number of open objects + END FUNCTION h5fget_obj_count_c + END INTERFACE + + hdferr = h5fget_obj_count_c(file_id, obj_type, obj_count) + + END SUBROUTINE h5fget_obj_count_f + +!****s* H5F/h5fget_obj_ids_f +! +! NAME +! h5fget_obj_ids_f +! +! PURPOSE +! Get list of open objects identifiers within a file +! +! INPUTS +! file_id - file identifier +! obj_type - type of the object; possible values are: +! H5F_OBJ_FILE_F +! H5F_OBJ_DATASET_F +! H5F_OBJ_GROUP_F +! H5F_OBJ_DATATYPE_F +! H5F_OBJ_ALL_F +! OUTPUTS +! obj_ids - array of open object identifiers +! hdferr - Returns 0 if successful and -1 if fails +! +! OPTIONAL PARAMETERS +! num_objs - number of open objects +! +! AUTHOR +! Elena Pourmal +! September 30, 2002 +! +! HISTORY +! Added optional parameter num_objs for number of open objects +! of the specified type and changed type of max_obj to +! INTEGER(SIZE_T) +! September 25, 2008 EIP +! +! SOURCE + SUBROUTINE h5fget_obj_ids_f(file_id, obj_type, max_objs, obj_ids, hdferr, num_objs) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: file_id ! File identifier + INTEGER, INTENT(IN) :: obj_type ! Object type + INTEGER(SIZE_T), INTENT(IN) :: max_objs ! Maximum # of objects to retrieve + INTEGER(HID_T), DIMENSION(*), INTENT(INOUT) :: obj_ids ! Array of open objects iidentifiers - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(SIZE_T), INTENT(OUT), OPTIONAL :: num_objs - INTEGER(SIZE_T) :: c_num_objs - ! Number of open objects of the specified type - - 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 - INTEGER(HID_T), INTENT(IN) :: file_id - INTEGER, INTENT(IN) :: obj_type - INTEGER(SIZE_T), INTENT(IN) :: max_objs - INTEGER(HID_T), DIMENSION(*), INTENT(INOUT) :: obj_ids - INTEGER(SIZE_T), INTENT(OUT) :: c_num_objs - END FUNCTION h5fget_obj_ids_c - END INTERFACE - - hdferr = h5fget_obj_ids_c(file_id, obj_type, max_objs, obj_ids, c_num_objs) - if (present(num_objs)) num_objs= c_num_objs - - END SUBROUTINE h5fget_obj_ids_f - -!---------------------------------------------------------------------- -! Name: h5fget_freespace_f -! -! Purpose: Get amount of free space within a file -! -! Inputs: -! file_id - file identifier -! Outputs: -! free_space - amount of free space in file -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Quincey Koziol -! October 7, 2003 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5fget_freespace_f(file_id, free_space, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: file_id ! File identifier - INTEGER(HSSIZE_T), INTENT(OUT) :: free_space - !amount of free space in file - INTEGER, INTENT(OUT) :: hdferr ! Error code - - 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 - INTEGER(HID_T), INTENT(IN) :: file_id - INTEGER(HSSIZE_T), INTENT(OUT) :: free_space - END FUNCTION h5fget_freespace_c - END INTERFACE - - hdferr = h5fget_freespace_c(file_id, free_space) - - END SUBROUTINE h5fget_freespace_f - -!---------------------------------------------------------------------- -! Name: h5fget_name_f -! -! Purpose: Gets the name of the file from the object identifier -! -! Inputs: -! obj_id - object identifier -! Inputs/Outputs: -! buf - buffer to read name in -! Outputs: -! size - actual size of the name -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! -! Programmer: Elena Pourmal -! July 6, 2004 -! -!---------------------------------------------------------------------- - - - SUBROUTINE h5fget_name_f(obj_id, buf, size, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: obj_id ! Object identifier - CHARACTER(LEN=*), INTENT(INOUT) :: buf - ! Buffer to hold file name - INTEGER(SIZE_T), INTENT(OUT) :: size ! Size of the file name - INTEGER, INTENT(OUT) :: hdferr ! Error code: 0 on success, - ! -1 if fail - INTEGER(SIZE_T) :: buflen -! INTEGER, EXTERNAL :: h5fget_name_c -! MS FORTRAN needs explicit interface for C functions called here. -! - 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$ATTRIBUTES reference :: buf - INTEGER(HID_T), INTENT(IN) :: obj_id - INTEGER(SIZE_T), INTENT(OUT) :: size - INTEGER(SIZE_T) :: buflen - CHARACTER(LEN=*), INTENT(OUT) :: buf - END FUNCTION h5fget_name_c - END INTERFACE - buflen = LEN(buf) - hdferr = h5fget_name_c(obj_id, size, buf, buflen) - END SUBROUTINE h5fget_name_f - -!---------------------------------------------------------------------- -! Name: h5fget_filesize_f -! -! Purpose: Retrieves the file size of the HDF5 file. -! -! Inputs: -! file_id - file identifier -! Outputs: -! size - file size -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! -! Programmer: Elena Pourmal -! July 7, 2004 -! -!---------------------------------------------------------------------- - - - SUBROUTINE h5fget_filesize_f(file_id, size, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: file_id ! file identifier - INTEGER(HSIZE_T), INTENT(OUT) :: size ! Size of the file - INTEGER, INTENT(OUT) :: hdferr ! Error code: 0 on success, - ! -1 if fail -! INTEGER, EXTERNAL :: h5fget_filesize_c -! MS FORTRAN needs explicit interface for C functions called here. -! - 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 - INTEGER(HID_T), INTENT(IN) :: file_id - INTEGER(HSIZE_T), INTENT(OUT) :: size - END FUNCTION h5fget_filesize_c - END INTERFACE - hdferr = h5fget_filesize_c(file_id, size) - END SUBROUTINE h5fget_filesize_f - - - END MODULE H5F + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(SIZE_T), INTENT(OUT), OPTIONAL :: num_objs ! number of open objects +!***** + INTEGER(SIZE_T) :: c_num_objs ! Number of open objects of the specified type + + 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 + INTEGER(HID_T), INTENT(IN) :: file_id + INTEGER, INTENT(IN) :: obj_type + INTEGER(SIZE_T), INTENT(IN) :: max_objs + INTEGER(HID_T), DIMENSION(*), INTENT(INOUT) :: obj_ids + INTEGER(SIZE_T), INTENT(OUT) :: c_num_objs + END FUNCTION h5fget_obj_ids_c + END INTERFACE + + hdferr = h5fget_obj_ids_c(file_id, obj_type, max_objs, obj_ids, c_num_objs) + IF (PRESENT(num_objs)) num_objs= c_num_objs + + END SUBROUTINE h5fget_obj_ids_f +!****s* H5F/h5fget_freespace_f +! +! NAME +! h5fget_freespace_f +! +! PURPOSE +! Get amount of free space within a file +! +! INPUTS +! file_id - file identifier +! OUTPUTS +! free_space - amount of free space in file +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Quincey Koziol +! October 7, 2003 +! +! SOURCE + SUBROUTINE h5fget_freespace_f(file_id, free_space, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: file_id ! File identifier + INTEGER(HSSIZE_T), INTENT(OUT) :: free_space + ! amount of free space in file + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + 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 + INTEGER(HID_T), INTENT(IN) :: file_id + INTEGER(HSSIZE_T), INTENT(OUT) :: free_space + END FUNCTION h5fget_freespace_c + END INTERFACE + + hdferr = h5fget_freespace_c(file_id, free_space) + + END SUBROUTINE h5fget_freespace_f +!****s* H5F/h5fget_name_f +! +! NAME +! h5fget_name_f +! +! PURPOSE +! Gets the name of the file from the object identifier +! +! INPUTS +! obj_id - object identifier +! OUTPUTS +! buf - buffer to store the read name +! size - actual size of the name +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! Elena Pourmal +! July 6, 2004 +! +! SOURCE + SUBROUTINE h5fget_name_f(obj_id, buf, size, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: obj_id ! Object identifier + CHARACTER(LEN=*), INTENT(INOUT) :: buf + ! Buffer to hold file name + INTEGER(SIZE_T), INTENT(OUT) :: size ! Size of the file name + INTEGER, INTENT(OUT) :: hdferr ! Error code: 0 on success, + ! -1 if fail +!***** + INTEGER(SIZE_T) :: buflen + + 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$ATTRIBUTES reference :: buf + INTEGER(HID_T), INTENT(IN) :: obj_id + INTEGER(SIZE_T), INTENT(OUT) :: size + INTEGER(SIZE_T) :: buflen + CHARACTER(LEN=*), INTENT(OUT) :: buf + END FUNCTION h5fget_name_c + END INTERFACE + buflen = LEN_TRIM(buf) + hdferr = h5fget_name_c(obj_id, size, buf, buflen) + END SUBROUTINE h5fget_name_f +!****s* H5F/h5fget_filesize_f +! +! NAME +! h5fget_filesize_f +! +! PURPOSE +! Retrieves the file size of the HDF5 file. +! +! INPUTS +! file_id - file identifier +! OUTPUTS +! size - file size +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! July 7, 2004 +! +! SOURCE + SUBROUTINE h5fget_filesize_f(file_id, size, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: file_id ! file identifier + INTEGER(HSIZE_T), INTENT(OUT) :: size ! Size of the file + INTEGER, INTENT(OUT) :: hdferr ! Error code: 0 on success, + ! -1 if fail +!***** + 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 + INTEGER(HID_T), INTENT(IN) :: file_id + INTEGER(HSIZE_T), INTENT(OUT) :: size + END FUNCTION h5fget_filesize_c + END INTERFACE + hdferr = h5fget_filesize_c(file_id, size) + END SUBROUTINE h5fget_filesize_f + + +END MODULE H5F diff --git a/fortran/src/H5Gf.c b/fortran/src/H5Gf.c index f40b595..5ebb3e7 100644 --- a/fortran/src/H5Gf.c +++ b/fortran/src/H5Gf.c @@ -1,4 +1,9 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +/****h* H5Gf/H5Gf + * PURPOSE + * This file contains C stubs for H5G Fortran APIs + * + * COPYRIGHT + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * @@ -11,32 +16,42 @@ * is linked from the top-level documents page. It can also be found at * * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * * access to either file, you may request a copy from help@hdfgroup.org. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -/* This files contains C stubs for H5G Fortran APIs */ + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * + ****** +*/ #include "H5f90.h" #include "H5Eprivate.h" -/*---------------------------------------------------------------------------- - * Name: h5gcreate_c - * Purpose: Call H5Gcreate to create a group - * Inputs: loc_id - file or group identifier +/****if* H5Gf/h5gcreate_c + * NAME + * h5gcreate_c + * PURPOSE + * Call H5Gcreate to create a group + * INPUTS + * loc_id - file or group identifier * name - name of the group * namelen - name length * size_hint - length of names in the group - * Outputs: grp_id - group identifier - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * OUTPUTS + * grp_id - group identifier + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Wednesday, August 5, 1999 - * Modifications: + * HISTORY + * * Changed to call H5Gcreate2 because H5Gcreate flip-flops and * H5Gcreate1 can be compiled out of the library * QAK - 2007/08/23 - *---------------------------------------------------------------------------*/ + * SOURCE +*/ int_f nh5gcreate_c(hid_t_f *loc_id, _fcd name, int_f *namelen, size_t_f *size_hint, hid_t_f *grp_id, hid_t_f *lcpl_id, hid_t_f *gcpl_id, hid_t_f *gapl_id ) +/******/ { hid_t c_gcpl_id = -1; /* Group creation property list */ char *c_name = NULL; @@ -81,21 +96,29 @@ DONE: return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5gopen_c - * Purpose: Call H5Gopen to open a dataset - * Inputs: loc_id - file or group identifier +/****if* H5Gf/h5gopen_c + * NAME + * h5gopen_c + * PURPOSE + * Call H5Gopen to open a dataset + * INPUTS + * loc_id - file or group identifier * name - name of the group * namelen - name length * gapl_id - Group access property list identifier - * Outputs: grp_id - group identifier - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * OUTPUTS + * grp_id - group identifier + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Wednesday, August 5, 1999 - * Modifications: - *---------------------------------------------------------------------------*/ + * + * SOURCE +*/ int_f nh5gopen_c(hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *gapl_id, hid_t_f *grp_id) +/******/ { char *c_name = NULL; hid_t c_grp_id; @@ -123,25 +146,32 @@ DONE: return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5gget_obj_info_idx_c - * Purpose: Call H5Gget_obj_info to return name and the type of group +/****if* H5Gf/h5gget_obj_info_idx_c + * NAME + * h5gget_obj_info_idx_c + * PURPOSE + * Call H5Gget_obj_info to return name and the type of group * member - * Inputs: loc_id - file or group identifier + * INPUTS + * loc_id - file or group identifier * name - name of the group * namelen - name length * idx - index of the group member - * Outputs: obj_name - buffer to store member's name + * OUTPUTS + * obj_name - buffer to store member's name * obj_namelen - length of the buffer * obj_type - type of the object - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Wednesday, August 5, 1999 - * Modifications: - *---------------------------------------------------------------------------*/ + * SOURCE +*/ int_f nh5gget_obj_info_idx_c(hid_t_f *loc_id, _fcd name, int_f *namelen, int_f *idx, _fcd obj_name, int_f *obj_namelen, int_f *obj_type) +/******/ { H5O_info_t oinfo; hid_t c_loc_id = (hid_t)*loc_id; @@ -199,20 +229,27 @@ DONE: return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5gn_members_c - * Purpose: Call H5Gget_info_by_name to find number of objects in the group - * Inputs: loc_id - file or group identifier +/****if* H5Gf/h5gn_members_c + * NAME + * h5gn_members_c + * PURPOSE + * Call H5Gget_info_by_name to find number of objects in the group + * INPUTS + * loc_id - file or group identifier * name - name of the group * namelen - name length - * Outputs: nmemebers - number of members - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * OUTPUTS + * nmemebers - number of members + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Wednesday, August 5, 1999 - * Modifications: - *---------------------------------------------------------------------------*/ + * SOURCE +*/ int_f nh5gn_members_c(hid_t_f *loc_id, _fcd name, int_f *namelen, int_f *nmembers) +/******/ { char *c_name = NULL; H5G_info_t ginfo; @@ -237,18 +274,24 @@ DONE: return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5gclose_c - * Purpose: Call H5Gclose to close the group - * Inputs: grp_id - identifier of the group to be closed - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal +/****if* H5Gf/h5gclose_c + * NAME + * h5gclose_c + * PURPOSE + * Call H5Gclose to close the group + * INPUTS + * grp_id - identifier of the group to be closed + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Wednesday, August 5, 1999 - * Modifications: - *---------------------------------------------------------------------------*/ + * SOURCE +*/ int_f nh5gclose_c(hid_t_f *grp_id) +/******/ { int ret_value = 0; @@ -258,25 +301,31 @@ nh5gclose_c(hid_t_f *grp_id) } -/*---------------------------------------------------------------------------- - * Name: h5glink_c - * Purpose: Call H5Glink to link the specified type - * Inputs: loc_id - identifier of file or group +/****if* H5Gf/h5glink_c + * NAME + * h5glink_c + * PURPOSE + * Call H5Glink to link the specified type + * INPUTS + * loc_id - identifier of file or group * link_type - link type * current_name - name of the existing object for hard link, * anything for the soft link * current_namelen - current name lenghth * new_name - new name for the object * new_namelen - new_name lenghth - * Returns: 0 on success, -1 on failure - * Programmer: Mingshi Chen - * Friday, August 6, 1999 - * Modifications: Elena Pourmal - *---------------------------------------------------------------------------*/ + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Mingshi Chen + * Friday, August 6, 1999 + * SOURCE +*/ int_f nh5glink_c(hid_t_f *loc_id, int_f *link_type, _fcd current_name, int_f *current_namelen, _fcd new_name, int_f *new_namelen) +/******/ { char *c_current_name = NULL, *c_new_name = NULL; int ret_value = -1; @@ -317,10 +366,13 @@ DONE: return ret_value ; } -/*---------------------------------------------------------------------------- - * Name: h5glink2_c - * Purpose: Call H5Glink2 to link the specified type - * Inputs: cur_loc_id - identifier of file or group +/****if* H5Gf/h5glink2_c + * NAME + * h5glink2_c + * PURPOSE + * Call H5Glink2 to link the specified type + * INPUTS + * cur_loc_id - identifier of file or group * cur_name - name of the existing object for hard link releative * to cur_loc_id location, * anything for the soft link @@ -330,15 +382,20 @@ DONE: * new_name - new name for the object releative to the new_loc_id * location * new_namelen - new_name lenghth - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Wednesday, September 25, 2002 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5glink2_c(hid_t_f *cur_loc_id, _fcd cur_name, int_f *cur_namelen, int_f *link_type, hid_t_f *new_loc_id, _fcd new_name, int_f *new_namelen) +/******/ { char *c_cur_name = NULL, *c_new_name = NULL; int ret_value = -1; @@ -378,19 +435,25 @@ DONE: return ret_value ; } -/*---------------------------------------------------------------------------- - * Name: h5gunlink_c - * Purpose: Call H5Gunlink to remove the specified name - * Inputs: loc_id - identifier of file or group +/****if* H5Gf/h5gunlink_c + * NAME + * h5gunlink_c + * PURPOSE + * Call H5Gunlink to remove the specified name + * INPUTS + * loc_id - identifier of file or group * name - name of the object to unlink - * Returns: 0 on success, -1 on failure - * Programmer: Mingshi Chen - * Friday, August 6, 1999 - * Modifications: Elena Pourmal - *---------------------------------------------------------------------------*/ + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Mingshi Chen + * Friday, August 6, 1999 + * SOURCE +*/ int_f nh5gunlink_c(hid_t_f *loc_id, _fcd name, int_f *namelen) +/******/ { char *c_name = NULL; int ret_value = -1; @@ -414,22 +477,28 @@ DONE: return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5gmove_c - * Purpose: Call H5Gmove to rename an object within an HDF5 file - * Inputs: loc_id - identifier of file or group +/****if* H5Gf/h5gmove_c + * NAME + * h5gmove_c + * PURPOSE + * Call H5Gmove to rename an object within an HDF5 file + * INPUTS + * loc_id - identifier of file or group * src_name - name of the original object * src_namelen - original name lenghth * dst_name - new name for the object * dst_namelen - new name lenghth - * Returns: 0 on success, -1 on failure - * Programmer: Mingshi Chen - * Friday, August 6, 1999 - * Modifications: Elena Pourmal - *---------------------------------------------------------------------------*/ + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Mingshi Chen + * Friday, August 6, 1999 + * SOURCE +*/ int_f nh5gmove_c(hid_t_f *loc_id, _fcd src_name, int_f *src_namelen, _fcd dst_name, int_f*dst_namelen) +/******/ { char *c_src_name = NULL, *c_dst_name = NULL; int ret_value = -1; @@ -458,23 +527,30 @@ DONE: return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5gmove2_c - * Purpose: Call H5Gmove2 to rename an object within an HDF5 file - * Inputs: src_loc_id - identifier of file or group +/****if* H5Gf/h5gmove2_c + * NAME + * h5gmove2_c + * PURPOSE + * Call H5Gmove2 to rename an object within an HDF5 file + * INPUTS + * src_loc_id - identifier of file or group * src_name - name of the original object relative to src_loc_id * src_namelen - original name lenghth * dst_loc_id - new location identifier * dst_name - new name for the object relative to dst_loc_id * dst_namelen - new name lenghth - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal - * Wednesday, September 25, 2002 - * Modifications: - *---------------------------------------------------------------------------*/ + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal + * Wednesday, September 25, 2002 + * + * SOURCE +*/ int_f nh5gmove2_c(hid_t_f *src_loc_id, _fcd src_name, int_f *src_namelen, hid_t_f *dst_loc_id, _fcd dst_name, int_f*dst_namelen) +/******/ { char *c_src_name = NULL, *c_dst_name = NULL; int ret_value = -1; @@ -503,23 +579,30 @@ DONE: return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5gget_linkval_c - * Purpose: Call H5Gget_linkval to return the name of object - * Inputs: loc_id - identifier of file or group +/****if* H5Gf/h5gget_linkval_c + * NAME + * h5gget_linkval_c + * PURPOSE + * Call H5Gget_linkval to return the name of object + * INPUTS + * loc_id - identifier of file or group * name - name of the object that symbolic link points to * namelen - the name lenghth * size - lenghth of retrurned value - * Outputs: value - name to be returned - * Returns: 0 on success, -1 on failure - * Programmer: Mingshi Chen - * Friday, August 6, 1999 - * Modifications: Elena Pourmal - *---------------------------------------------------------------------------*/ + * OUTPUTS + * value - name to be returned + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Mingshi Chen + * Friday, August 6, 1999 + * SOURCE +*/ int_f nh5gget_linkval_c(hid_t_f *loc_id, _fcd name, int_f *namelen, size_t_f *size, _fcd value) +/******/ { char *c_name = NULL; char *c_value = NULL; @@ -560,23 +643,30 @@ DONE: return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5gset_comment_c - * Purpose: Call H5Oset_comment_by_name to set comments for the specified object - * Inputs: loc_id - identifier of file or group +/****if* H5Gf/h5gset_comment_c + * NAME + * h5gset_comment_c + * PURPOSE + * Call H5Oset_comment_by_name to set comments for the specified object + * INPUTS + * loc_id - identifier of file or group * name - name of object whose comment is to be set or reset * namelen - the name lenghth * comment - the new comment * commentlen - new comment lenghth - * Returns: 0 on success, -1 on failure - * Programmer: Mingshi Chen + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Mingshi Chen * Friday, August 6, 1999 - * Modifications: Elena Pourmal - *---------------------------------------------------------------------------*/ - + * HISTORY + * Elena Pourmal + * SOURCE +*/ int_f nh5gset_comment_c(hid_t_f *loc_id, _fcd name, int_f *namelen, _fcd comment, int_f *commentlen) +/******/ { char *c_name = NULL, *c_comment = NULL; int ret_value = -1; @@ -604,23 +694,28 @@ DONE: return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5gget_comment_c - * Purpose: Call H5Oget_comment_by_name to retrieve comments for the specified object - * Inputs: loc_id - identifier of file or group +/****if* H5Gf/h5gget_comment_c + * NAME + * h5gget_comment_c + * PURPOSE + * Call H5Oget_comment_by_name to retrieve comments for the specified object + * INPUTS + * loc_id - identifier of file or group * name - name of object whose comment is to be set or reset * namelen - the name lenghth * bufsize - at most bufsize characters * comment - the new comment - * Returns: 0 on success, -1 on failure - * Programmer: Mingshi Chen + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Mingshi Chen * Friday, August 6, 1999 - * Modifications: Elena Pourmal - *---------------------------------------------------------------------------*/ - + * SOURCE +*/ int_f nh5gget_comment_c(hid_t_f *loc_id, _fcd name, int_f *namelen, size_t_f *bufsize, _fcd comment) +/******/ { char *c_name = NULL, *c_comment = NULL; size_t c_bufsize; @@ -661,22 +756,29 @@ DONE: return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5gcreate_anon_c - * Purpose: Call H5Gcreate_anon - * Inputs: +/****if* H5Gf/h5gcreate_anon_c + * NAME + * h5gcreate_anon_c + * PURPOSE + * Call H5Gcreate_anon + * INPUTS + * * loc_id - Location identifier * gcpl_id - Group creation property list identifier * gapl_id - Group access property list identifier * - * Outputs: grp_id - group identifier - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld - * February 15, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ + * OUTPUTS + * grp_id - group identifier + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld + * February 15, 2008 + * SOURCE +*/ int_f nh5gcreate_anon_c(hid_t_f *loc_id, hid_t_f *gcpl_id, hid_t_f *gapl_id, hid_t_f *grp_id) +/******/ { int_f ret_value=0; /* Return value */ @@ -688,20 +790,27 @@ done: return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5gget_create_plist_c - * Purpose: Call H5Gget_create_plist - * Inputs: +/****if* H5Gf/h5gget_create_plist_c + * NAME + * h5gget_create_plist_c + * PURPOSE + * Call H5Gget_create_plist + * INPUTS + * * grp_id - group identifier * - * Outputs: gcpl_id - Group creation property list identifier - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld - * February 15, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ + * OUTPUTS + * gcpl_id - Group creation property list identifier + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld + * February 15, 2008 + * SOURCE +*/ int_f nh5gget_create_plist_c(hid_t_f *grp_id, hid_t_f *gcpl_id ) +/******/ { int_f ret_value=0; /* Return value */ @@ -713,11 +822,15 @@ done: } -/*---------------------------------------------------------------------------- - * Name: h5gget_info_c - * Purpose: Call H5Gget_info - * Inputs: group_id - Group identifier - * Outputs: +/****if* H5Gf/h5gget_info_c + * NAME + * h5gget_info_c + * PURPOSE + * Call H5Gget_info + * INPUTS + * group_id - Group identifier + * OUTPUTS + * * storage_type - Type of storage for links in group: * H5G_STORAGE_TYPE_COMPACT: Compact storage * H5G_STORAGE_TYPE_DENSE: Indexed storage @@ -727,16 +840,21 @@ done: * max_corder - Current maximum creation order value for group * mounted - Whether group has a file mounted on it (0 = false, 1 = true) * - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld * February 15, 2008 - * Modifications: + * HISTORY + * * - Added 'mounted' paramater - * M.S. Breitenfeld + * M. Scot Breitenfeld * July 16, 2008 - *---------------------------------------------------------------------------*/ + * SOURCE +*/ int_f nh5gget_info_c (hid_t_f *group_id, int_f *storage_type, int_f *nlinks, int_f *max_corder, int_f *mounted ) +/******/ { int_f ret_value = 0; /* Return value */ @@ -761,10 +879,13 @@ done: } -/*---------------------------------------------------------------------------- - * Name: h5gget_info_by_idx_c - * Purpose: Call H5Gget_info_by_idx - * Inputs: +/****if* H5Gf/h5gget_info_by_idx_c + * NAME + * h5gget_info_by_idx_c + * PURPOSE + * Call H5Gget_info_by_idx + * INPUTS + * * loc_id - File or group identifier * group_name - Name of group containing group for which information is to be retrieved * group_namelen - name length @@ -772,7 +893,8 @@ done: * order - Order of the count in the index * n - Position in the index of the group for which information is retrieved * lapl_id - Link access property list - * Outputs: + * OUTPUTS + * * storage_type - Type of storage for links in group: * H5G_STORAGE_TYPE_COMPACT: Compact storage * H5G_STORAGE_TYPE_DENSE: Indexed storage @@ -782,19 +904,23 @@ done: * max_corder - Current maximum creation order value for group * mounted - Whether group has a file mounted on it (0 = false, 1 = true) * - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld * February 18, 2008 - * Modifications: + * HISTORY + * * - Added 'mounted' paramater - * M.S. Breitenfeld + * M. Scot Breitenfeld * July 16, 2008 - *---------------------------------------------------------------------------*/ + * SOURCE +*/ int_f nh5gget_info_by_idx_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, int_f *index_type, int_f *order, hsize_t_f *n, hid_t_f *lapl_id, int_f *storage_type, int_f *nlinks, int_f *max_corder, int_f *mounted ) - +/******/ { char *c_group_name = NULL; /* Buffer to hold group name C string */ int_f ret_value = 0; /* Return value */ @@ -826,15 +952,19 @@ nh5gget_info_by_idx_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5gget_info_by_name_c - * Purpose: Call H5Gget_info_by_name - * Inputs: +/****if* H5Gf/h5gget_info_by_name_c + * NAME + * h5gget_info_by_name_c + * PURPOSE + * Call H5Gget_info_by_name + * INPUTS + * * loc_id - File or group identifier * group_name - Name of group containing group for which information is to be retrieved * group_namelen - name length * lapl_id - Link access property list - * Outputs: + * OUTPUTS + * * storage_type - Type of storage for links in group: * H5G_STORAGE_TYPE_COMPACT: Compact storage * H5G_STORAGE_TYPE_DENSE: Indexed storage @@ -844,18 +974,22 @@ nh5gget_info_by_idx_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, * max_corder - Current maximum creation order value for group * mounted - Whether group has a file mounted on it (0 = false, 1 = true) * - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld * February 18, 2008 - * Modifications: + * HISTORY + * * - Added 'mounted' paramater - * M.S. Breitenfeld + * M. Scot Breitenfeld * July 16, 2008 - *---------------------------------------------------------------------------*/ + * SOURCE +*/ int_f nh5gget_info_by_name_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, hid_t_f *lapl_id, int_f *storage_type, int_f *nlinks, int_f *max_corder, int_f *mounted) - +/******/ { char *c_group_name = NULL; /* Buffer to hold group name C string */ int_f ret_value = 0; /* Return value */ @@ -885,4 +1019,3 @@ nh5gget_info_by_name_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen HDfree(c_group_name); return ret_value; } - diff --git a/fortran/src/H5Gff.f90 b/fortran/src/H5Gff.f90 index 2e769ad..6bcee7c 100644 --- a/fortran/src/H5Gff.f90 +++ b/fortran/src/H5Gff.f90 @@ -1,3 +1,15 @@ +!****h* ROBODoc/H5G +! +! NAME +! MODULE H5G +! +! FILE +! fortran/src/H5Gff.f90 +! +! PURPOSE +! This file contains Fortran interfaces for H5G functions. +! +! COPYRIGHT ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! Copyright by The HDF Group. * ! Copyright by the Board of Trustees of the University of Illinois. * @@ -13,55 +25,61 @@ ! access to either file, you may request a copy from help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! +! NOTES +! *** IMPORTANT *** +! If you add a new H5G function you must add the function name to the +! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! This is needed for Windows based operating systems. ! -! This file contains Fortran90 interfaces for H5F functions. -! +!***** + MODULE H5G USE H5GLOBAL -! PRIVATE :: h5gcreate1_f +! PRIVATE :: h5gcreate1_f ! PRIVATE :: h5gcreate2_f ! INTERFACE h5gcreate_f -! MODULE PROCEDURE h5gcreate1_f -! MODULE PROCEDURE h5gcreate2_f +! MODULE PROCEDURE h5gcreate1_f +! MODULE PROCEDURE h5gcreate2_f ! END INTERFACE CONTAINS -!---------------------------------------------------------------------- -! Name: h5gcreate_f -! -! Purpose: Creates a new group. -! -! Inputs: -! loc_id - location identifier -! name - group name at the specified location -! Outputs: -! grp_id - group identifier -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! size_hint - a parameter indicating the number of bytes -! to reserve for the names that will appear -! in the group -! lcpl_id - Property list for link creation -! gcpl_id - Property list for group creation -! gapl_id - Property list for group access -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 5, 2001 -! -! Added additional optional paramaters in 1.8 -! MSB - February 27, 2008 -! -! Comment: -!---------------------------------------------------------------------- +!****s* H5G/h5gcreate_f +! +! NAME +! h5gcreate_f +! +! PURPOSE +! Creates a new group. +! +! INPUTS +! loc_id - location identifier +! name - group name at the specified location +! OUTPUTS +! grp_id - group identifier +! hdferr - Returns 0 if successful and -1 if fails +! OPTIONAL PARAMETERS +! size_hint - a parameter indicating the number of bytes to +! reserve for the names that will appear in the group +! lcpl_id - Property list for link creation +! gcpl_id - Property list for group creation +! gapl_id - Property list for group access +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 5, 2001 +! +! Added additional optional paramaters in 1.8 +! MSB - February 27, 2008 +! +! SOURCE SUBROUTINE h5gcreate_f(loc_id, name, grp_id, hdferr, size_hint, lcpl_id, gcpl_id, gapl_id) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier @@ -80,7 +98,7 @@ CONTAINS INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lcpl_id ! Property list for link creation INTEGER(HID_T), OPTIONAL, INTENT(IN) :: gcpl_id ! Property list for group creation INTEGER(HID_T), OPTIONAL, INTENT(IN) :: gapl_id ! Property list for group access - +!***** INTEGER(HID_T) :: lcpl_id_default INTEGER(HID_T) :: gcpl_id_default INTEGER(HID_T) :: gapl_id_default @@ -88,8 +106,6 @@ CONTAINS INTEGER :: namelen ! Length of the name character string INTEGER(SIZE_T) :: size_hint_default -! MS FORTRAN needs explicit interface for C functions called here. -! INTERFACE INTEGER FUNCTION h5gcreate_c(loc_id, name, namelen, & size_hint_default, grp_id, lcpl_id_default, gcpl_id_default, gapl_id_default) @@ -125,33 +141,37 @@ CONTAINS END SUBROUTINE h5gcreate_f -!!$!---------------------------------------------------------------------- -!!$! Name: h5gcreate2_f !!$! -!!$! Purpose: Creates a new group. +!!$!****s* H5G/ !!$! -!!$! Inputs: +!!$! NAME +!!$! h5gcreate2_f +!!$! +!!$! PURPOSE +!!$! Creates a new group. +!!$! +!!$! INPUTS !!$! loc_id - location identifier !!$! name - group name at the specified location -!!$! Outputs: +!!$! OUTPUTS !!$! grp_id - group identifier !!$! hdferr: - error code !!$! Success: 0 !!$! Failure: -1 -!!$! Optional parameters: +!!$! OPTIONAL PARAMETERS !!$! !!$! lcpl_id - Property list for link creation !!$! gcpl_id - Property list for group creation !!$! gapl_id - Property list for group access !!$! -!!$! Programmer: M.S. BREITENFELD +!!$! AUTHOR M. Scot Breitenfeld !!$! February 27, 2008 !!$! -!!$! Modifications: +!!$! HISTORY !!$! -!!$! Comment: Needed to switch the first 2 arguments to avoid conflect +!!$! NOTES Needed to switch the first 2 arguments to avoid conflect !!$! with h5gcreate1_f -!!$!---------------------------------------------------------------------- +!!$! !!$ !!$ SUBROUTINE h5gcreate2_f(name, loc_id, grp_id, hdferr, & !!$ lcpl_id, gcpl_id, gapl_id) @@ -169,14 +189,16 @@ CONTAINS !!$ INTEGER(HID_T) :: gcpl_id_default !!$ INTEGER(HID_T) :: gapl_id_default !!$ -!!$ INTEGER(SIZE_T) :: OBJECT_NAMELEN_DEFAULT ! Dummy argument to pass to c call +!!$ INTEGER(SIZE_T) :: OBJECT_NAME +! LEN_DEFAULT ! Dummy argument to pass to c call !!$ INTEGER :: namelen ! Length of the name character string !!$ !!$! MS FORTRAN needs explicit interface for C functions called here. !!$! !!$ INTERFACE !!$ INTEGER FUNCTION h5gcreate_c(loc_id, name, namelen, & -!!$ OBJECT_NAMELEN_DEFAULT, grp_id, lcpl_id_default, gcpl_id_default, gapl_id_default) +!!$ OBJECT_NAME +! LEN_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 @@ -185,7 +207,8 @@ CONTAINS !!$ INTEGER(HID_T), INTENT(IN) :: loc_id !!$ CHARACTER(LEN=*), INTENT(IN) :: name !!$ INTEGER :: namelen -!!$ INTEGER(SIZE_T) :: OBJECT_NAMELEN_DEFAULT +!!$ INTEGER(SIZE_T) :: OBJECT_NAME +! LEN_DEFAULT !!$ INTEGER(HID_T) :: lcpl_id_default !!$ INTEGER(HID_T) :: gcpl_id_default !!$ INTEGER(HID_T) :: gapl_id_default @@ -194,7 +217,9 @@ CONTAINS !!$ END INTERFACE !!$ !!$ namelen = LEN(name) -!!$ OBJECT_NAMELEN_DEFAULT = OBJECT_NAMELEN_DEFAULT_F +!!$ OBJECT_NAME +! LEN_DEFAULT = OBJECT_NAME +! LEN_DEFAULT_F !!$ !!$ lcpl_id_default = H5P_DEFAULT_F !!$ IF(PRESENT(lcpl_id)) lcpl_id_default = lcpl_id @@ -204,40 +229,43 @@ CONTAINS !!$ IF(PRESENT(gapl_id)) gapl_id_default = gapl_id !!$ !!$ -!!$ hdferr = h5gcreate_c(loc_id, name, namelen, OBJECT_NAMELEN_DEFAULT, grp_id, & +!!$ hdferr = h5gcreate_c(loc_id, name, namelen, OBJECT_NAME +! LEN_DEFAULT, grp_id, & !!$ lcpl_id_default, gcpl_id_default, gapl_id_default) !!$ !!$ END SUBROUTINE h5gcreate2_f - -!---------------------------------------------------------------------- -! Name: h5gopen_f ! -! Purpose: Opens an existing group. +!****s* H5G/h5gopen_f +! +! NAME +! h5gopen_f ! -! Inputs: -! loc_id - location identifier -! name - name of the group to open -! Outputs: -! grp_id - group identifier -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! gapl_id - Group access property list identifier +! PURPOSE +! Opens an existing group. ! -! Programmer: Elena Pourmal -! August 12, 1999 +! INPUTS +! loc_id - location identifier +! name - name of the group to open +! OUTPUTS +! grp_id - group identifier +! hdferr - Returns 0 if successful and -1 if fails +! OPTIONAL PARAMETERS +! gapl_id - Group access property list identifier ! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 5, 2001 +! AUTHOR +! Elena Pourmal +! August 12, 1999 ! -! Added 1.8 (optional) parameter gapl_id -! February, 2008 M.S. Breitenfeld +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 5, 2001 ! -! Comment: -!---------------------------------------------------------------------- +! Added 1.8 (optional) parameter gapl_id +! February, 2008 M. Scot Breitenfeld +! +! SOURCE SUBROUTINE h5gopen_f(loc_id, name, grp_id, hdferr, gapl_id) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier @@ -245,13 +273,10 @@ CONTAINS INTEGER(HID_T), INTENT(OUT) :: grp_id ! File identifier INTEGER, INTENT(OUT) :: hdferr ! Error code INTEGER(HID_T), OPTIONAL, INTENT(IN) :: gapl_id ! Group access property list identifier - +!***** INTEGER(HID_T) :: gapl_id_default INTEGER :: namelen ! Length of the name character string -! INTEGER, EXTERNAL :: h5gopen_c -! MS FORTRAN needs explicit interface for C functions called here. -! INTERFACE INTEGER FUNCTION h5gopen_c(loc_id, name, namelen, gapl_id_default, grp_id) USE H5GLOBAL @@ -274,163 +299,150 @@ CONTAINS hdferr = h5gopen_c(loc_id, name, namelen, gapl_id_default, grp_id) END SUBROUTINE h5gopen_f - -!---------------------------------------------------------------------- -! Name: h5gclose_f ! -! Purpose: Closes the specified group. +!****s* H5G/h5gclose_f ! -! Inputs: -! grp_id - group identifier -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! NAME +! h5gclose_f ! -! Programmer: Elena Pourmal -! August 12, 1999 +! PURPOSE +! Closes the specified group. ! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 5, 2001 +! INPUTS +! grp_id - group identifier +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! Elena Pourmal +! August 12, 1999 ! -! Comment: -!---------------------------------------------------------------------- - SUBROUTINE h5gclose_f(grp_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: grp_id ! Group identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5gclose_c -! MS FORTRAN needs explicit interface for C functions called here. +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 5, 2001 ! - 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 - INTEGER(HID_T), INTENT(IN) :: grp_id - END FUNCTION h5gclose_c - END INTERFACE - - hdferr = h5gclose_c(grp_id) - - END SUBROUTINE h5gclose_f +! SOURCE + SUBROUTINE h5gclose_f(grp_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: grp_id ! Group identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + 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 + INTEGER(HID_T), INTENT(IN) :: grp_id + END FUNCTION h5gclose_c + END INTERFACE + hdferr = h5gclose_c(grp_id) -!---------------------------------------------------------------------- -! Name: h5gget_obj_info_idx_f + END SUBROUTINE h5gclose_f ! -! Purpose: Returns name and type of the group member identified by -! its index. +!****s* H5G/h5gget_obj_info_idx_f ! -! Inputs: -! loc_id - location identifier -! name - name of the group at the specified location -! idx - object index (zero-based) -! Outputs: -! obj_name - object name -! obj_type - object type -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! NAME +! h5gget_obj_info_idx_f ! -! Programmer: Elena Pourmal -! August 12, 1999 +! PURPOSE +! Returns name and type of the group member identified by +! its index. ! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 5, 2001 +! INPUTS +! loc_id - location identifier +! name - name of the group at the specified location +! idx - object index (zero-based) +! OUTPUTS +! obj_name - object name +! obj_type - object type +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! Elena Pourmal +! August 12, 1999 ! -! Comment: -!---------------------------------------------------------------------- - SUBROUTINE h5gget_obj_info_idx_f(loc_id, name, idx, & - obj_name, obj_type, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the group - INTEGER, INTENT(IN) :: idx ! Index of member object - CHARACTER(LEN=*), INTENT(OUT) :: obj_name ! Name of the object - INTEGER, INTENT(OUT) :: obj_type ! Object type - INTEGER, INTENT(OUT) :: hdferr ! Error code - - INTEGER :: namelen ! Length of the name character string - INTEGER :: obj_namelen ! Length of the obj_name character string - -! INTEGER, EXTERNAL :: h5gget_obj_info_idx_c -! MS FORTRAN needs explicit interface for C functions called here. +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 5, 2001 ! - INTERFACE - INTEGER FUNCTION h5gget_obj_info_idx_c(loc_id, name, & - 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$ATTRIBUTES reference :: name - !DEC$ATTRIBUTES reference :: obj_name - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER :: namelen - INTEGER, INTENT(IN) :: idx - CHARACTER(LEN=*), INTENT(OUT) :: obj_name - INTEGER :: obj_namelen - INTEGER, INTENT(OUT) :: obj_type - END FUNCTION h5gget_obj_info_idx_c - END INTERFACE +! SOURCE + SUBROUTINE h5gget_obj_info_idx_f(loc_id, name, idx, & + obj_name, obj_type, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the group + INTEGER, INTENT(IN) :: idx ! Index of member object + CHARACTER(LEN=*), INTENT(OUT) :: obj_name ! Name of the object + INTEGER, INTENT(OUT) :: obj_type ! Object type + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTEGER :: namelen ! Length of the name character string + INTEGER :: obj_namelen ! Length of the obj_name character string - namelen = LEN(name) - obj_namelen = LEN(obj_name) - hdferr = h5gget_obj_info_idx_c(loc_id, name, namelen, idx, & - obj_name, obj_namelen, obj_type) + INTERFACE + INTEGER FUNCTION h5gget_obj_info_idx_c(loc_id, name, & + 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$ATTRIBUTES reference :: name + !DEC$ATTRIBUTES reference :: obj_name + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER :: namelen + INTEGER, INTENT(IN) :: idx + CHARACTER(LEN=*), INTENT(OUT) :: obj_name + INTEGER :: obj_namelen + INTEGER, INTENT(OUT) :: obj_type + END FUNCTION h5gget_obj_info_idx_c + END INTERFACE - END SUBROUTINE h5gget_obj_info_idx_f + namelen = LEN(name) + obj_namelen = LEN(obj_name) + hdferr = h5gget_obj_info_idx_c(loc_id, name, namelen, idx, & + obj_name, obj_namelen, obj_type) + END SUBROUTINE h5gget_obj_info_idx_f -!---------------------------------------------------------------------- -! Name: h5gn_members_f ! -! Purpose: Returns the number of group members. +!****s* H5G/h5gn_members_f ! -! Inputs: -! loc_id - location identifier -! name - name of the group at the specified location -! Outputs: -! nmembers - number of group members -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! NAME +! h5gn_members_f ! -! Programmer: Elena Pourmal -! August 12, 1999 +! PURPOSE +! Returns the number of group members. ! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 5, 2001 +! INPUTS +! loc_id - location identifier +! name - name of the group at the specified location +! OUTPUTS +! nmembers - number of group members +! hdferr - Returns 0 if successful and -1 if fails ! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5gn_members_f(loc_id, name, nmembers, hdferr) +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 5, 2001 +! +! SOURCE + SUBROUTINE h5gn_members_f(loc_id, name, nmembers, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the group INTEGER, INTENT(OUT) :: nmembers ! Number of members in the ! group INTEGER, INTENT(OUT) :: hdferr ! Error code - +!***** INTEGER :: namelen ! Length of the name character string -! INTEGER, EXTERNAL :: h5gn_members_c -! MS FORTRAN needs explicit interface for C functions called here. -! INTERFACE INTEGER FUNCTION h5gn_members_c(loc_id, name, namelen, nmembers) USE H5GLOBAL @@ -449,548 +461,516 @@ CONTAINS hdferr = h5gn_members_c(loc_id, name, namelen, nmembers) END SUBROUTINE h5gn_members_f - -!---------------------------------------------------------------------- -! Name: h5glink_f -! -! Purpose: Creates a link of the specified type from new_name -! to current_name. -! -! Inputs: -! loc_id - location identifier -! link_type - link type -! Possible values are: -! H5G_LINK_HARD_F (0) or -! H5G_LINK_SOFT_F (1) -! current_name - name of the existing object if link is a -! hard link. Can be anything for the soft link. -! new_name - new name for the object -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 5, 2001 -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5glink_f(loc_id, link_type, current_name, & - new_name, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier - INTEGER, INTENT(IN) :: link_type ! link type +! +!****s* H5G/h5glink_f +! +! NAME +! h5glink_f +! +! PURPOSE +! Creates a link of the specified type from new_name +! to current_name. +! +! INPUTS +! loc_id - location identifier +! link_type - link type; possible values are: +! H5G_LINK_HARD_F (0) +! H5G_LINK_SOFT_F (1) +! current_name - name of the existing object if link is a +! hard link. Can be anything for the soft link +! new_name - new name for the object +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 5, 2001 +! +! SOURCE + SUBROUTINE h5glink_f(loc_id, link_type, current_name, & + new_name, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier + INTEGER, INTENT(IN) :: link_type ! link type ! Possible values are: ! H5G_LINK_HARD_F (0) or ! H5G_LINK_SOFT_F (1) - CHARACTER(LEN=*), INTENT(IN) :: current_name + CHARACTER(LEN=*), INTENT(IN) :: current_name ! Current name of an object - CHARACTER(LEN=*), INTENT(IN) :: new_name ! New name of an object - INTEGER, INTENT(OUT) :: hdferr ! Error code - - INTEGER :: current_namelen ! Lenghth of the current_name string - INTEGER :: new_namelen ! Lenghth of the new_name string - -! INTEGER, EXTERNAL :: h5glink_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5glink_c(loc_id, link_type, current_name, & - current_namelen, new_name, new_namelen) + CHARACTER(LEN=*), INTENT(IN) :: new_name ! New name of an object + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** - USE H5GLOBAL - !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 - INTEGER, INTENT(IN) :: link_type - CHARACTER(LEN=*), INTENT(IN) :: current_name - INTEGER :: current_namelen - CHARACTER(LEN=*), INTENT(IN) :: new_name - INTEGER :: new_namelen - END FUNCTION h5glink_c - END INTERFACE + INTEGER :: current_namelen ! Lenghth of the current_name string + INTEGER :: new_namelen ! Lenghth of the new_name string - current_namelen = LEN(current_name) - new_namelen = LEN(new_name) - hdferr = h5glink_c(loc_id, link_type, current_name, & - current_namelen, new_name, new_namelen) - END SUBROUTINE h5glink_f - -!---------------------------------------------------------------------- -! Name: h5glink2_f -! -! Purpose: Creates a link of the specified type from new_name -! to current_name. current_name and new_name are interpreted -! releative to current and new location identifiers. -! -! Inputs: -! cur_loc_id - location identifier -! cur_name - name of the existing object if link is a -! hard link. Can be anything for the soft link. -! link_type - link type -! Possible values are: -! H5G_LINK_HARD_F (0) or -! H5G_LINK_SOFT_F (1) -! new_loc_id - new location identifier -! new_name - new name for the object -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! September 25, 2002 -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5glink2_f(cur_loc_id, cur_name, link_type, new_loc_id, & - new_name, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: cur_loc_id ! File or group identifier - CHARACTER(LEN=*), INTENT(IN) :: cur_name - ! Current name of an object - INTEGER, INTENT(IN) :: link_type ! link type - ! Possible values are: - ! H5G_LINK_HARD_F (0) or - ! H5G_LINK_SOFT_F (1) + INTERFACE + INTEGER FUNCTION h5glink_c(loc_id, link_type, current_name, & + current_namelen, new_name, new_namelen) - INTEGER(HID_T), INTENT(IN) :: new_loc_id ! File or group identifier - CHARACTER(LEN=*), INTENT(IN) :: new_name ! New name of an object - INTEGER, INTENT(OUT) :: hdferr ! Error code + USE H5GLOBAL + !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 + INTEGER, INTENT(IN) :: link_type + CHARACTER(LEN=*), INTENT(IN) :: current_name + INTEGER :: current_namelen + CHARACTER(LEN=*), INTENT(IN) :: new_name + INTEGER :: new_namelen + END FUNCTION h5glink_c + END INTERFACE - INTEGER :: cur_namelen ! Lenghth of the current_name string - INTEGER :: new_namelen ! Lenghth of the new_name string + current_namelen = LEN(current_name) + new_namelen = LEN(new_name) + hdferr = h5glink_c(loc_id, link_type, current_name, & + current_namelen, new_name, new_namelen) + END SUBROUTINE h5glink_f + +! +!****s* H5G/h5glink2_f +! +! NAME +! h5glink2_f +! +! PURPOSE +! Creates a link of the specified type from new_name +! to current_name. current_name and new_name are interpreted +! releative to current and new location identifiers. +! +! INPUTS +! cur_loc_id - location identifier +! cur_name - name of the existing object if link is a +! hard link. Can be anything for the soft link. +! link_type - link type; possible values are: +! H5G_LINK_HARD_F (0) +! H5G_LINK_SOFT_F (1) +! new_loc_id - new location identifier +! new_name - new name for the object +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! September 25, 2002 +! +! SOURCE + SUBROUTINE h5glink2_f(cur_loc_id, cur_name, link_type, new_loc_id, & + new_name, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: cur_loc_id ! File or group identifier + CHARACTER(LEN=*), INTENT(IN) :: cur_name + ! Current name of an object + INTEGER, INTENT(IN) :: link_type ! link type + ! Possible values are: + ! H5G_LINK_HARD_F (0) or + ! H5G_LINK_SOFT_F (1) + + INTEGER(HID_T), INTENT(IN) :: new_loc_id ! File or group identifier + CHARACTER(LEN=*), INTENT(IN) :: new_name ! New name of an object + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + + INTEGER :: cur_namelen ! Lenghth of the current_name string + INTEGER :: new_namelen ! Lenghth of the new_name string - INTERFACE - INTEGER FUNCTION h5glink2_c(cur_loc_id, cur_name, cur_namelen, & - link_type, new_loc_id, & - new_name, new_namelen) + INTERFACE + INTEGER FUNCTION h5glink2_c(cur_loc_id, cur_name, cur_namelen, & + link_type, new_loc_id, & + new_name, new_namelen) - USE H5GLOBAL - !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 - INTEGER(HID_T), INTENT(IN) :: new_loc_id - INTEGER, INTENT(IN) :: link_type - CHARACTER(LEN=*), INTENT(IN) :: cur_name - CHARACTER(LEN=*), INTENT(IN) :: new_name - INTEGER :: cur_namelen - INTEGER :: new_namelen - END FUNCTION h5glink2_c - END INTERFACE + USE H5GLOBAL + !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 + INTEGER(HID_T), INTENT(IN) :: new_loc_id + INTEGER, INTENT(IN) :: link_type + CHARACTER(LEN=*), INTENT(IN) :: cur_name + CHARACTER(LEN=*), INTENT(IN) :: new_name + INTEGER :: cur_namelen + INTEGER :: new_namelen + END FUNCTION h5glink2_c + END INTERFACE - cur_namelen = LEN(cur_name) - new_namelen = LEN(new_name) - hdferr = h5glink2_c(cur_loc_id, cur_name, cur_namelen, link_type, & - new_loc_id, new_name, new_namelen) - END SUBROUTINE h5glink2_f + cur_namelen = LEN(cur_name) + new_namelen = LEN(new_name) + hdferr = h5glink2_c(cur_loc_id, cur_name, cur_namelen, link_type, & + new_loc_id, new_name, new_namelen) + END SUBROUTINE h5glink2_f -!---------------------------------------------------------------------- -! Name: h5gunlink_f ! -! Purpose: Removes the specified name from the group graph and -! decrements the link count for the object to which name -! points +!****s* H5G/h5gunlink_f +! +! NAME +! h5gunlink_f +! +! PURPOSE +! Removes the specified name from the group graph and +! decrements the link count for the object to which name +! points ! -! Inputs: -! loc_id - location identifier -! name - name of the object to unlink -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! INPUTS +! loc_id - location identifier +! name - name of the object to unlink +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails ! -! Programmer: Elena Pourmal -! August 12, 1999 +! AUTHOR +! Elena Pourmal +! August 12, 1999 ! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 5, 2001 +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 5, 2001 ! -! Comment: -!---------------------------------------------------------------------- +! SOURCE + SUBROUTINE h5gunlink_f(loc_id, name, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of an object + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTEGER :: namelen ! Lenghth of the name character string - SUBROUTINE h5gunlink_f(loc_id, name, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of an object - INTEGER, INTENT(OUT) :: hdferr ! Error code + 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$ATTRIBUTES reference :: name + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER :: namelen + END FUNCTION h5gunlink_c + END INTERFACE - INTEGER :: namelen ! Lenghth of the name character string + namelen = LEN(name) + hdferr = h5gunlink_c(loc_id, name, namelen) + END SUBROUTINE h5gunlink_f -! INTEGER, EXTERNAL :: h5gunlink_c -! MS FORTRAN needs explicit interface for C functions called here. ! - 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$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER :: namelen - END FUNCTION h5gunlink_c - END INTERFACE - - namelen = LEN(name) - hdferr = h5gunlink_c(loc_id, name, namelen) - END SUBROUTINE h5gunlink_f - -!---------------------------------------------------------------------- -! Name: h5gmove_f +!****s* H5G/h5gmove_f ! -! Purpose: Renames an object within an HDF5 file. +! NAME +! h5gmove_f ! -! Inputs: -! loc_id - location identifier -! name - object's name at specified location -! new_name - object's new name -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! PURPOSE +! Renames an object within an HDF5 file. ! -! Programmer: Elena Pourmal -! August 12, 1999 +! INPUTS +! loc_id - location identifier +! name - object's name at specified location +! new_name - object's new name +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails ! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 5, 2001 +! AUTHOR +! Elena Pourmal +! August 12, 1999 ! -! Comment: -!---------------------------------------------------------------------- - - - SUBROUTINE h5gmove_f(loc_id, name, new_name, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Current name of an object - CHARACTER(LEN=*), INTENT(IN) :: new_name ! New name of an object - INTEGER, INTENT(OUT) :: hdferr ! Error code - - INTEGER :: namelen ! Lenghth of the current_name string - INTEGER :: new_namelen ! Lenghth of the new_name string - -! INTEGER, EXTERNAL :: h5gmove_c -! MS FORTRAN needs explicit interface for C functions called here. +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 5, 2001 ! - 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$ATTRIBUTES reference :: name - !DEC$ATTRIBUTES reference :: new_name - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER :: namelen - CHARACTER(LEN=*), INTENT(IN) :: new_name - INTEGER :: new_namelen - END FUNCTION h5gmove_c - END INTERFACE - - namelen = LEN(name) - new_namelen = LEN(new_name) - hdferr = h5gmove_c(loc_id, name, namelen, new_name, new_namelen) - END SUBROUTINE h5gmove_f +! SOURCE + SUBROUTINE h5gmove_f(loc_id, name, new_name, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Current name of an object + CHARACTER(LEN=*), INTENT(IN) :: new_name ! New name of an object + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTEGER :: namelen ! Lenghth of the current_name string + INTEGER :: new_namelen ! Lenghth of the new_name string + + 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$ATTRIBUTES reference :: name + !DEC$ATTRIBUTES reference :: new_name + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER :: namelen + CHARACTER(LEN=*), INTENT(IN) :: new_name + INTEGER :: new_namelen + END FUNCTION h5gmove_c + END INTERFACE + + namelen = LEN(name) + new_namelen = LEN(new_name) + hdferr = h5gmove_c(loc_id, name, namelen, new_name, new_namelen) + END SUBROUTINE h5gmove_f +! +!****s* H5G/h5gmove2_f +! +! NAME +! h5gmove2_f +! +! PURPOSE +! Renames an object within an HDF5 file. +! +! INPUTS +! src_loc_id - original location identifier +! src_name - object's name at specified original location +! dst_loc_id - original location identifier +! dst_name - object's new name +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! Elena Pourmal +! September 25, 2002 +! +! SOURCE + SUBROUTINE h5gmove2_f(src_loc_id, src_name, dst_loc_id, dst_name, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: src_loc_id ! File or group identifier + CHARACTER(LEN=*), INTENT(IN) :: src_name ! Original name of an object + INTEGER(HID_T), INTENT(IN) :: dst_loc_id ! File or group identifier + CHARACTER(LEN=*), INTENT(IN) :: dst_name ! New name of an object + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTEGER :: src_namelen ! Length of the current_name string + INTEGER :: dst_namelen ! Lenghth of the new_name string + + INTERFACE + 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$ATTRIBUTES reference :: src_name + !DEC$ATTRIBUTES reference :: dst_name + INTEGER(HID_T), INTENT(IN) :: src_loc_id + INTEGER(HID_T), INTENT(IN) :: dst_loc_id + CHARACTER(LEN=*), INTENT(IN) :: src_name + CHARACTER(LEN=*), INTENT(IN) :: dst_name + INTEGER :: src_namelen + INTEGER :: dst_namelen + END FUNCTION h5gmove2_c + END INTERFACE + + src_namelen = LEN(src_name) + dst_namelen = LEN(dst_name) + hdferr = h5gmove2_c(src_loc_id, src_name, src_namelen, dst_loc_id, dst_name, dst_namelen) + END SUBROUTINE h5gmove2_f +! +!****s* H5G/h5gget_linkval_f +! +! NAME +! h5gget_linkval_f +! +! PURPOSE +! Returns the name of the object that the symbolic link +! points to. +! +! INPUTS +! loc_id - location identifier +! name - symbolic link to the object whose name +! is to be returned. +! size - maximum number of characters to be returned +! OUTPUTS +! buffer - a buffer to hold the name of the object +! being sought +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 5, 2001 +! +! SOURCE + SUBROUTINE h5gget_linkval_f(loc_id, name, size, buffer, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Current name of an object + INTEGER(SIZE_T), INTENT(IN) :: size ! Maximum number of buffer + CHARACTER(LEN=size), INTENT(OUT) :: buffer + ! Buffer to hold a name of + ! the object symbolic link + ! points to + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTEGER :: namelen ! Lenghth of the current_name string + + 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$ATTRIBUTES reference :: name + !DEC$ATTRIBUTES reference :: buffer + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER :: namelen + INTEGER(SIZE_T), INTENT(IN) :: size + CHARACTER(LEN=*), INTENT(OUT) :: buffer + END FUNCTION h5gget_linkval_c + END INTERFACE + + namelen = LEN(name) + hdferr = h5gget_linkval_c(loc_id, name, namelen, size, buffer) + END SUBROUTINE h5gget_linkval_f -!---------------------------------------------------------------------- -! Name: h5gmove2_f ! -! Purpose: Renames an object within an HDF5 file. +!****s* H5G/h5gset_comment_f ! -! Inputs: -! src_loc_id - original location identifier -! src_name - object's name at specified original location -! dst_loc_id - original location identifier -! dst_name - object's new name -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! NAME +! h5gset_comment_f ! -! Programmer: Elena Pourmal -! September 25, 2002 +! PURPOSE +! Sets comment for specified object. ! -! Comment: -!---------------------------------------------------------------------- - - - SUBROUTINE h5gmove2_f(src_loc_id, src_name, dst_loc_id, dst_name, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: src_loc_id ! File or group identifier - CHARACTER(LEN=*), INTENT(IN) :: src_name ! Original name of an object - INTEGER(HID_T), INTENT(IN) :: dst_loc_id ! File or group identifier - CHARACTER(LEN=*), INTENT(IN) :: dst_name ! New name of an object - INTEGER, INTENT(OUT) :: hdferr ! Error code - - INTEGER :: src_namelen ! Length of the current_name string - INTEGER :: dst_namelen ! Lenghth of the new_name string - -! INTEGER, EXTERNAL :: h5gmove2_c -! MS FORTRAN needs explicit interface for C functions called here. +! INPUTS +! loc_id - location identifier +! name - name of the object +! comment - comment to set for the object +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails ! - INTERFACE - 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$ATTRIBUTES reference :: src_name - !DEC$ATTRIBUTES reference :: dst_name - INTEGER(HID_T), INTENT(IN) :: src_loc_id - INTEGER(HID_T), INTENT(IN) :: dst_loc_id - CHARACTER(LEN=*), INTENT(IN) :: src_name - CHARACTER(LEN=*), INTENT(IN) :: dst_name - INTEGER :: src_namelen - INTEGER :: dst_namelen - END FUNCTION h5gmove2_c - END INTERFACE - - src_namelen = LEN(src_name) - dst_namelen = LEN(dst_name) - hdferr = h5gmove2_c(src_loc_id, src_name, src_namelen,& - dst_loc_id, dst_name, dst_namelen) - END SUBROUTINE h5gmove2_f - -!---------------------------------------------------------------------- -! Name: h5gget_linkval_f -! -! Purpose: Returns the name of the object that the symbolic link -! points to. -! -! Inputs: -! loc_id - location identifier -! name - symbolic link to the object whose name -! is to be returned. -! size - maximum number of characters to be returned -! Outputs: -! buffer - a buffer to hold the name of the object -! being sought -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 5, 2001 -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5gget_linkval_f(loc_id, name, size, buffer, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Current name of an object - INTEGER(SIZE_T), INTENT(IN) :: size ! Maximum number of buffer - CHARACTER(LEN=size), INTENT(OUT) :: buffer - ! Buffer to hold a name of - ! the object symbolic link - ! points to - INTEGER, INTENT(OUT) :: hdferr ! Error code - - INTEGER :: namelen ! Lenghth of the current_name string - -! INTEGER, EXTERNAL :: h5gget_linkval_c -! MS FORTRAN needs explicit interface for C functions called here. +! AUTHOR +! Elena Pourmal +! August 12, 1999 ! - 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$ATTRIBUTES reference :: name - !DEC$ATTRIBUTES reference :: buffer - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER :: namelen - INTEGER(SIZE_T), INTENT(IN) :: size - CHARACTER(LEN=*), INTENT(OUT) :: buffer - END FUNCTION h5gget_linkval_c - END INTERFACE - - namelen = LEN(name) - hdferr = h5gget_linkval_c(loc_id, name, namelen, size, buffer) - END SUBROUTINE h5gget_linkval_f - -!---------------------------------------------------------------------- -! Name: h5gset_comment_f +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 5, 2001 ! -! Purpose: Sets comment for specified object. +! SOURCE + SUBROUTINE h5gset_comment_f(loc_id, name, comment, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Current name of an object + CHARACTER(LEN=*), INTENT(IN) :: comment ! New name of an object + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTEGER :: namelen ! Lenghth of the current_name string + INTEGER :: commentlen ! Lenghth of the comment string + + INTERFACE + 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$ATTRIBUTES reference :: name + !DEC$ATTRIBUTES reference :: comment + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER :: namelen + CHARACTER(LEN=*), INTENT(IN) :: comment + INTEGER :: commentlen + END FUNCTION h5gset_comment_c + END INTERFACE + + namelen = LEN(name) + commentlen = LEN(comment) + hdferr = h5gset_comment_c(loc_id, name, namelen, comment, commentlen) + END SUBROUTINE h5gset_comment_f ! -! Inputs: -! loc_id - location identifier -! name - name of the object -! comment - comment to set for the object -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +!****s* H5G/h5gget_comment_f ! -! Programmer: Elena Pourmal -! August 12, 1999 +! NAME +! h5gget_comment_f ! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 5, 2001 +! PURPOSE +! Retrieves comment for specified object. ! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5gset_comment_f(loc_id, name, comment, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Current name of an object - CHARACTER(LEN=*), INTENT(IN) :: comment ! New name of an object - INTEGER, INTENT(OUT) :: hdferr ! Error code - - INTEGER :: namelen ! Lenghth of the current_name string - INTEGER :: commentlen ! Lenghth of the comment string - -! INTEGER, EXTERNAL :: h5gset_comment_c -! MS FORTRAN needs explicit interface for C functions called here. +! INPUTS +! loc_id - location identifier +! name - name of the object at specified location +! size - size of the buffer required to hold comment +! OUTPUTS +! buffer - buffer to hold object's comment +! hdferr - Returns 0 if successful and -1 if fails ! - INTERFACE - 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$ATTRIBUTES reference :: name - !DEC$ATTRIBUTES reference :: comment - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER :: namelen - CHARACTER(LEN=*), INTENT(IN) :: comment - INTEGER :: commentlen - END FUNCTION h5gset_comment_c - END INTERFACE - - namelen = LEN(name) - commentlen = LEN(comment) - hdferr = h5gset_comment_c(loc_id, name, namelen, comment, commentlen) - END SUBROUTINE h5gset_comment_f - -!---------------------------------------------------------------------- -! Name: h5gget_comment_f -! -! Purpose: Retrieves comment for specified object. -! -! Inputs: -! loc_id - location identifier -! name - name of the object at specified location -! size - size of the buffer required to hold comment -! Outputs: -! buffer - buffer to hold object's comment -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 5, 2001 -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5gget_comment_f(loc_id, name, size, buffer, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Current name of an object - INTEGER(SIZE_T), INTENT(IN) :: size ! Maximum number of buffer - CHARACTER(LEN=size), INTENT(OUT) :: buffer - ! Buffer to hold a comment - INTEGER, INTENT(OUT) :: hdferr ! Error code +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 5, 2001 +! +! SOURCE + SUBROUTINE h5gget_comment_f(loc_id, name, size, buffer, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Current name of an object + INTEGER(SIZE_T), INTENT(IN) :: size ! Maximum number of buffer + CHARACTER(LEN=size), INTENT(OUT) :: buffer + ! Buffer to hold a comment + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTEGER :: namelen ! Lenghth of the current_name string - INTEGER :: namelen ! Lenghth of the current_name string + INTERFACE + 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$ATTRIBUTES reference :: name, buffer + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER :: namelen + INTEGER(SIZE_T), INTENT(IN) :: size + CHARACTER(LEN=*), INTENT(OUT) :: buffer + END FUNCTION h5gget_comment_c + END INTERFACE -! INTEGER, EXTERNAL :: h5gget_comment_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - 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$ATTRIBUTES reference :: name, buffer - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER :: namelen - INTEGER(SIZE_T), INTENT(IN) :: size - CHARACTER(LEN=*), INTENT(OUT) :: buffer - END FUNCTION h5gget_comment_c - END INTERFACE + namelen = LEN(name) + hdferr = h5gget_comment_c(loc_id, name, namelen, size, buffer) - namelen = LEN(name) - hdferr = h5gget_comment_c(loc_id, name, namelen, size, buffer) END SUBROUTINE h5gget_comment_f - -!---------------------------------------------------------------------- -! Name: H5Gcreate_anon_f ! -! Purpose: Creates a new empty group without linking it into the file structure. +!****s* H5G/H5Gcreate_anon_f ! -! Inputs: -! loc_id - Location identifier -! Outputs: -! grp_id - group identifier -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! gcpl_id - Group creation property list identifier -! gapl_id - Group access property list identifier +! NAME +! H5Gcreate_anon_f ! -! Programmer: M.S. Breitenfeld -! February 15, 2008 +! PURPOSE +! Creates a new empty group without linking it into the file structure. ! -! Modifications: +! INPUTS +! loc_id - Location identifier +! OUTPUTS +! grp_id - group identifier +! hdferr - Returns 0 if successful and -1 if fails +! OPTIONAL PARAMETERS +! gcpl_id - Group creation property list identifier +! gapl_id - Group access property list identifier ! -! Comment: -!---------------------------------------------------------------------- +! AUTHOR +! M. Scot Breitenfeld +! February 15, 2008 +! +! SOURCE SUBROUTINE h5Gcreate_anon_f(loc_id, grp_id, hdferr, gcpl_id, gapl_id) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier @@ -998,7 +978,7 @@ CONTAINS INTEGER, INTENT(OUT) :: hdferr ! Error code INTEGER(HID_T), OPTIONAL, INTENT(IN) :: gcpl_id ! Property list for group creation INTEGER(HID_T), OPTIONAL, INTENT(IN) :: gapl_id ! Property list for group access - +!***** INTEGER(HID_T) :: gcpl_id_default INTEGER(HID_T) :: gapl_id_default @@ -1024,36 +1004,31 @@ CONTAINS hdferr = h5gcreate_anon_c(loc_id, gcpl_id_default, gapl_id_default, grp_id) END SUBROUTINE h5Gcreate_anon_f - -!---------------------------------------------------------------------- -! Name: H5Gget_create_plist_f ! -! Purpose: Gets a group creation property list identifier. +!****s* H5G/H5Gget_create_plist_f ! -! Inputs: -! grp_id - group identifier -! Outputs: -! gcpl_id - Group creation property list identifier -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: +! NAME +! H5Gget_create_plist_f ! -! Programmer: M.S. Breitenfeld -! February 15, 2008 +! PURPOSE +! Gets a group creation property list identifier. ! -! Modifications: +! INPUTS +! grp_id - group identifier +! OUTPUTS +! gcpl_id - Group creation property list identifier +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! M. Scot Breitenfeld +! February 15, 2008 ! -! Comment: -!---------------------------------------------------------------------- +! SOURCE SUBROUTINE h5gget_create_plist_f(grp_id, gcpl_id, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: grp_id ! Group identifier INTEGER(HID_T), INTENT(OUT) :: gcpl_id ! Property list for group creation INTEGER, INTENT(OUT) :: hdferr ! Error code - -! MS FORTRAN needs explicit interface for C functions called here. -! +!***** INTERFACE INTEGER FUNCTION h5gget_create_plist_c(grp_id, gcpl_id ) USE H5GLOBAL @@ -1069,56 +1044,59 @@ CONTAINS END SUBROUTINE h5gget_create_plist_f -!---------------------------------------------------------------------- -! Name: h5gget_info_f ! -! Purpose: Retrieves information about a group +!****s* H5G/h5gget_info_f ! -! Inputs: -! group_id - Group identifier +! NAME +! h5gget_info_f ! -! Outputs: NOTE: In C it is defined as a structure: H5G_info_t +! PURPOSE +! Retrieves information about a group ! -! storage_type - Type of storage for links in group -! H5G_STORAGE_TYPE_COMPACT: Compact storage -! H5G_STORAGE_TYPE_DENSE: Indexed storage -! H5G_STORAGE_TYPE_SYMBOL_TABLE: Symbol tables, the original HDF5 structure -! nlinks - Number of links in group -! max_corder - Current maximum creation order value for group -! hdferr - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! mounted - Whether group has a file mounted on it +! INPUTS +! group_id - Group identifier ! -! Programmer: M. S. Breitenfeld -! February 15, 2008 +! OUTPUTS +! storage_type - Type of storage for links in group +! H5G_STORAGE_TYPE_COMPACT: Compact storage +! H5G_STORAGE_TYPE_DENSE: Indexed storage +! H5G_STORAGE_TYPE_SYMBOL_TABLE: Symbol tables, the original HDF5 structure +! nlinks - Number of links in group +! max_corder - Current maximum creation order value for group +! hdferr - Returns 0 if successful and -1 if fails +! OPTIONAL PARAMETERS +! mounted - Whether group has a file mounted on it ! -! Modifications: -! - Added 'mounted' paramater -! M.S. Breitenfeld -! July 16, 2008 +! AUTHOR +! M. Scot Breitenfeld +! February 15, 2008 ! -!---------------------------------------------------------------------- - +! NOTES +! In C the output is defined as a structure: H5G_info_t +! +! HISTORY +! +! - Added 'mounted' paramater +! M. Scot Breitenfeld +! July 16, 2008 +! +! SOURCE SUBROUTINE h5gget_info_f(group_id, storage_type, nlinks, max_corder, hdferr, mounted) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: group_id ! Group identifier - INTEGER, INTENT(OUT) :: storage_type ! Type of storage for links in group: + INTEGER, INTENT(OUT) :: storage_type ! Type of storage for links in group: ! H5G_STORAGE_TYPE_COMPACT_F: Compact storage ! H5G_STORAGE_TYPE_DENSE_F: Indexed storage ! H5G_STORAGE_TYPE_SYMBOL_TABLE_F: Symbol tables, the original HDF5 structure - INTEGER, INTENT(OUT) :: nlinks ! Number of links in group - INTEGER, INTENT(OUT) :: max_corder ! Current maximum creation order value for group - INTEGER, INTENT(OUT) :: hdferr ! Error code: - ! 0 on success and -1 on failure - LOGICAL, INTENT(OUT), OPTIONAL :: mounted ! Whether group has a file mounted on it - + INTEGER, INTENT(OUT) :: nlinks ! Number of links in group + INTEGER, INTENT(OUT) :: max_corder ! Current maximum creation order value for group + INTEGER, INTENT(OUT) :: hdferr ! Error code: + ! 0 on success and -1 on failure + LOGICAL, INTENT(OUT), OPTIONAL :: mounted ! Whether group has a file mounted on it +!***** INTEGER :: mounted_c -! MS FORTRAN needs explicit interface for C functions called here. -! INTERFACE INTEGER FUNCTION h5gget_info_c(group_id, storage_type, nlinks, max_corder, mounted_c) USE H5GLOBAL @@ -1144,70 +1122,71 @@ CONTAINS ENDIF END SUBROUTINE h5gget_info_f - -!---------------------------------------------------------------------- -! Name: h5gget_info_by_idx_f -! -! Purpose: Retrieves information about a group, according to the group’s position within an index. -! -! Inputs: -! loc_id - File or group identifier -! group_name - Name of group containing group for which information is to be retrieved -! index_type - Index type -! order - Order of the count in the index -! n - Position in the index of the group for which information is retrieved -! -! Outputs: NOTE: In C the following are defined as a structure: H5G_info_t -! -! storage_type - Type of storage for links in group -! H5G_STORAGE_TYPE_COMPACT: Compact storage -! H5G_STORAGE_TYPE_DENSE: Indexed storage -! H5G_STORAGE_TYPE_SYMBOL_TABLE: Symbol tables, the original HDF5 structure -! nlinks - Number of links in group -! max_corder - Current maximum creation order value for group -! hdferr - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! lapl_id - Link access property list -! mounted - Whether group has a file mounted on it ! -! Programmer: M. S. Breitenfeld -! February 18, 2008 -! -! Modifications: -! - Added 'mounted' paramater -! M.S. Breitenfeld -! July 16, 2008 -! -!---------------------------------------------------------------------- - +!****s* H5G/h5gget_info_by_idx_f +! +! NAME +! h5gget_info_by_idx_f +! +! PURPOSE +! Retrieves information about a group, according to the group’s position within an index. +! +! INPUTS +! loc_id - File or group identifier +! group_name - Name of group containing group for which information is to be retrieved +! index_type - Index type +! order - Order of the count in the index +! n - Position in the index of the group for which information is retrieved +! +! OUTPUTS +! storage_type - Type of storage for links in group +! H5G_STORAGE_TYPE_COMPACT: Compact storage +! H5G_STORAGE_TYPE_DENSE: Indexed storage +! H5G_STORAGE_TYPE_SYMBOL_TABLE: Symbol tables, the original HDF5 structure +! nlinks - Number of links in group +! max_corder - Current maximum creation order value for group +! hdferr - Returns 0 if successful and -1 if fails +! OPTIONAL PARAMETERS +! lapl_id - Link access property list +! mounted - Whether group has a file mounted on it +! +! NOTES +! In C the output is defined as a structure: H5G_info_t +! +! AUTHOR +! M. Scot Breitenfeld +! February 18, 2008 +! +! HISTORY +! Added 'mounted' paramater +! M. Scot Breitenfeld +! July 16, 2008 +! +! SOURCE SUBROUTINE h5gget_info_by_idx_f(loc_id, group_name, index_type, order, n, & storage_type, nlinks, max_corder, hdferr, lapl_id, mounted) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier + INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier CHARACTER(LEN=*), INTENT(IN) :: group_name ! Name of group containing group for which information is to be retrieved INTEGER, INTENT(IN) :: index_type ! Index type INTEGER, INTENT(IN) :: order ! Order of the count in the index - INTEGER(HSIZE_T), INTENT(IN) :: n ! Position in the index of the group for which information is retrieved + INTEGER(HSIZE_T), INTENT(IN) :: n ! Position in the index of the group for which information is retrieved INTEGER, INTENT(OUT) :: storage_type ! Type of storage for links in group: - ! H5G_STORAGE_TYPE_COMPACT_F: Compact storage - ! H5G_STORAGE_TYPE_DENSE_F: Indexed storage - ! H5G_STORAGE_TYPE_SYMBOL_TABLE_F: Symbol tables, the original HDF5 structure - INTEGER, INTENT(OUT) :: nlinks ! Number of links in group - INTEGER, INTENT(OUT) :: max_corder ! Current maximum creation order value for group - INTEGER, INTENT(OUT) :: hdferr ! Error code: - ! 0 on success and -1 on failure + ! H5G_STORAGE_TYPE_COMPACT_F: Compact storage + ! H5G_STORAGE_TYPE_DENSE_F: Indexed storage + ! H5G_STORAGE_TYPE_SYMBOL_TABLE_F: Symbol tables, the original HDF5 structure + INTEGER, INTENT(OUT) :: nlinks ! Number of links in group + INTEGER, INTENT(OUT) :: max_corder ! Current maximum creation order value for group + INTEGER, INTENT(OUT) :: hdferr ! Error code: + ! 0 on success and -1 on failure INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list - LOGICAL, INTENT(OUT), OPTIONAL :: mounted ! Whether group has a file mounted on it - + LOGICAL, INTENT(OUT), OPTIONAL :: mounted ! Whether group has a file mounted on it +!***** INTEGER :: mounted_c INTEGER(HID_T) :: lapl_id_default INTEGER(SIZE_T) :: group_name_len ! length of group name -! MS FORTRAN needs explicit interface for C functions called here. -! INTERFACE 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) @@ -1215,7 +1194,7 @@ CONTAINS !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 CHARACTER(LEN=*), INTENT(IN) :: group_name @@ -1251,63 +1230,65 @@ CONTAINS ENDIF END SUBROUTINE h5gget_info_by_idx_f - -!---------------------------------------------------------------------- -! Name: h5gget_info_by_name_f ! -! Purpose: Retrieves information about a group. +!****s* H5G/h5gget_info_by_name_f ! -! Inputs: -! loc_id - File or group identifier -! group_name - Name of group containing group for which information is to be retrieved +! NAME +! h5gget_info_by_name_f ! -! Outputs: NOTE: In C the following are defined as a structure: H5G_info_t +! PURPOSE +! Retrieves information about a group. ! -! storage_type - Type of storage for links in group -! H5G_STORAGE_TYPE_COMPACT: Compact storage -! H5G_STORAGE_TYPE_DENSE: Indexed storage -! H5G_STORAGE_TYPE_SYMBOL_TABLE: Symbol tables, the original HDF5 structure -! nlinks - Number of links in group -! max_corder - Current maximum creation order value for group -! hdferr - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! lapl_id - Link access property list -! mounted - Whether group has a file mounted on it +! INPUTS +! loc_id - File or group identifier +! group_name - Name of group containing group for which information is to be retrieved ! -! Programmer: M. S. Breitenfeld -! February 18, 2008 +! OUTPUTS ! -! Modifications: -! - Added 'mounted' paramater -! M.S. Breitenfeld -! July 16, 2008 -!---------------------------------------------------------------------- - +! storage_type - Type of storage for links in group +! H5G_STORAGE_TYPE_COMPACT: Compact storage +! H5G_STORAGE_TYPE_DENSE: Indexed storage +! H5G_STORAGE_TYPE_SYMBOL_TABLE: Symbol tables, the original HDF5 structure +! nlinks - Number of links in group +! max_corder - Current maximum creation order value for group +! hdferr - Returns 0 if successful and -1 if fails +! OPTIONAL PARAMETERS +! lapl_id - Link access property list +! mounted - Whether group has a file mounted on it +! +! NOTES +! In C the output is defined as a structure: H5G_info_t +! +! AUTHOR +! M. Scot Breitenfeld +! February 18, 2008 +! +! HISTORY +! Added 'mounted' paramater +! M. Scot Breitenfeld +! July 16, 2008 +! SOURCE SUBROUTINE h5gget_info_by_name_f(loc_id, group_name, & storage_type, nlinks, max_corder, hdferr, lapl_id, mounted) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier + INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier CHARACTER(LEN=*), INTENT(IN) :: group_name ! Name of group containing group for which information is to be retrieved - INTEGER, INTENT(OUT) :: storage_type ! Type of storage for links in group: + INTEGER, INTENT(OUT) :: storage_type ! Type of storage for links in group: ! H5G_STORAGE_TYPE_COMPACT_F: Compact storage ! H5G_STORAGE_TYPE_DENSE_F: Indexed storage ! H5G_STORAGE_TYPE_SYMBOL_TABLE_F: Symbol tables, the original HDF5 structure - INTEGER, INTENT(OUT) :: nlinks ! Number of links in group - INTEGER, INTENT(OUT) :: max_corder ! Current maximum creation order value for group - INTEGER, INTENT(OUT) :: hdferr ! Error code: - ! 0 on success and -1 on failure + INTEGER, INTENT(OUT) :: nlinks ! Number of links in group + INTEGER, INTENT(OUT) :: max_corder ! Current maximum creation order value for group + INTEGER, INTENT(OUT) :: hdferr ! Error code: + ! 0 on success and -1 on failure INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list - LOGICAL, INTENT(OUT), OPTIONAL :: mounted ! Whether group has a file mounted on it - + LOGICAL, INTENT(OUT), OPTIONAL :: mounted ! Whether group has a file mounted on it +!***** INTEGER :: mounted_c INTEGER(HID_T) :: lapl_id_default INTEGER(SIZE_T) :: group_name_len ! length of group name -! MS FORTRAN needs explicit interface for C functions called here. -! INTERFACE INTEGER FUNCTION h5gget_info_by_name_c(loc_id, group_name, group_name_len, lapl_id_default, & storage_type, nlinks, max_corder, mounted_c) diff --git a/fortran/src/H5If.c b/fortran/src/H5If.c index 5f11fde..55868dd 100644 --- a/fortran/src/H5If.c +++ b/fortran/src/H5If.c @@ -1,4 +1,9 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +/****h* H5If/H5If + * PURPOSE + * This file contains C stubs for H5I Fortran APIs + * + * COPYRIGHT + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * @@ -11,25 +16,34 @@ * is linked from the top-level documents page. It can also be found at * * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * * access to either file, you may request a copy from help@hdfgroup.org. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -/* This files contains C stubs for H5I Fortran APIs */ - + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * + ****** +*/ #include "H5f90.h" #include "H5Eprivate.h" -/*---------------------------------------------------------------------------- - * Name: h5iget_type_c - * Purpose: Call H5Iget_type to get the type of an object - * Inputs: obj_id - object identifier - * Outputs: type - object type - * Returns: 0 on success, -1 on failure - * Programmer: Xiangyang Su - * Thursday, March 24, 2000 - * Modifications: - *---------------------------------------------------------------------------*/ +/****if* H5If/h5iget_type_c + * NAME + * h5iget_type_c + * PURPOSE + * Call H5Iget_type to get the type of an object + * INPUTS + * obj_id - object identifier + * OUTPUTS + * type - object type + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Xiangyang Su + * Thursday, March 24, 2000 + * HISTORY + * + * SOURCE +*/ int_f nh5iget_type_c (hid_t_f *obj_id, int_f *type) +/******/ { int ret_value = -1; hid_t c_obj_id; @@ -45,23 +59,32 @@ nh5iget_type_c (hid_t_f *obj_id, int_f *type) ret_value = 0; return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5iget_name_c - * Purpose: Call H5Iget_name to get object's name - * Inputs: obj_id - object identifier +/****if* H5If/h5iget_name_c + * NAME + * h5iget_name_c + * PURPOSE + * Call H5Iget_name to get object's name + * INPUTS + * obj_id - object identifier * buf_size - size of the buffer - * Outputs: buf - buffer to hold the name - * Returns: length of the name on success, -1 on failure - * Programmer: Elena Pourmal + * OUTPUTS + * buf - buffer to hold the name + * RETURNS + * length of the name on success, -1 on failure + * AUTHOR + * Elena Pourmal * Wednesday, March 12, 2003 - * Modifications: + * HISTORY + * * Changed the size of c_buf_size to c_buf_size + 1, which * fixes the problem of truncating the string by 1 if the * exact size of the string (buf_size) is passed in. - * M.S. Breitenfeld, April 21, 2008 - *---------------------------------------------------------------------------*/ + * M. Scot Breitenfeld, April 21, 2008 + * SOURCE +*/ int_f nh5iget_name_c(hid_t_f *obj_id, _fcd buf, size_t_f *buf_size, size_t_f *name_size) +/******/ { int ret_value = -1; hid_t c_obj_id; @@ -95,18 +118,25 @@ DONE: return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5iinc_ref_c - * Purpose: Call H5Iinc_ref to increment object's reference count - * Inputs: obj_id - object identifier - * Outputs: ref_count - Reference count of ID - * Returns: current reference count on success, -1 on failure - * Programmer: Quincey Koziol - * Tuesday, December 9, 2003 - * Modifications: - *---------------------------------------------------------------------------*/ +/****if* H5If/h5iinc_ref_c + * NAME + * h5iinc_ref_c + * PURPOSE + * Call H5Iinc_ref to increment object's reference count + * INPUTS + * obj_id - object identifier + * OUTPUTS + * ref_count - Reference count of ID + * RETURNS + * current reference count on success, -1 on failure + * AUTHOR + * Quincey Koziol + * Tuesday, December 9, 2003 + * SOURCE +*/ int_f nh5iinc_ref_c(hid_t_f *obj_id, int_f *ref_count) +/******/ { int ret_value; @@ -124,18 +154,25 @@ done: return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5idec_ref_c - * Purpose: Call H5Idec_ref to decrement object's reference count - * Inputs: obj_id - object identifier - * Outputs: ref_count - Reference count of ID - * Returns: current reference count on success, -1 on failure - * Programmer: Quincey Koziol +/****if* H5If/h5idec_ref_c + * NAME + * h5idec_ref_c + * PURPOSE + * Call H5Idec_ref to decrement object's reference count + * INPUTS + * obj_id - object identifier + * OUTPUTS + * ref_count - Reference count of ID + * RETURNS + * current reference count on success, -1 on failure + * AUTHOR + * Quincey Koziol * Tuesday, December 9, 2003 - * Modifications: - *---------------------------------------------------------------------------*/ + * SOURCE +*/ int_f nh5idec_ref_c(hid_t_f *obj_id, int_f *ref_count) +/******/ { int ret_value; @@ -153,18 +190,26 @@ done: return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5iget_ref_c - * Purpose: Call H5Iget_ref to retrieve object's reference count - * Inputs: obj_id - object identifier - * Outputs: ref_count - Reference count of ID - * Returns: current reference count on success, -1 on failure - * Programmer: Quincey Koziol - * Tuesday, December 9, 2003 - * Modifications: - *---------------------------------------------------------------------------*/ +/****if* H5If/h5iget_ref_c + * NAME + * h5iget_ref_c + * PURPOSE + * Call H5Iget_ref to retrieve object's reference count + * INPUTS + * obj_id - object identifier + * OUTPUTS + * ref_count - Reference count of ID + * RETURNS + * current reference count on success, -1 on failure + * AUTHOR + * Quincey Koziol + * Tuesday, December 9, 2003 + * + * SOURCE +*/ int_f nh5iget_ref_c(hid_t_f *obj_id, int_f *ref_count) +/******/ { int ret_value; @@ -182,18 +227,26 @@ done: return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5iget_file_id_c - * Purpose: Call H5Iget_file_id to obtain file identifier from object identifier - * Inputs: obj_id - object identifier - * Outputs: file_id - file identifier - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal - * Tuesday, August 24, 2004 - * Modifications: - *---------------------------------------------------------------------------*/ +/****if* H5If/h5iget_file_id_c + * NAME + * h5iget_file_id_c + * PURPOSE + * Call H5Iget_file_id to obtain file identifier from object identifier + * INPUTS + * obj_id - object identifier + * OUTPUTS + * file_id - file identifier + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal + * Tuesday, August 24, 2004 + * + * SOURCE +*/ int_f nh5iget_file_id_c(hid_t_f *obj_id, hid_t_f *file_id) +/******/ { int ret_value; hid_t c_file_id; diff --git a/fortran/src/H5Iff.f90 b/fortran/src/H5Iff.f90 index a082d5a..86e88b9 100644 --- a/fortran/src/H5Iff.f90 +++ b/fortran/src/H5Iff.f90 @@ -1,352 +1,352 @@ -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! Copyright by The HDF Group. * -! Copyright by the Board of Trustees of the University of Illinois. * -! All rights reserved. * -! * -! This file is part of HDF5. The full HDF5 copyright notice, including * -! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -! -! This file contains FORTRAN90 interfaces for H5I functions -! - MODULE H5I +!****h* ROBODoc/H5I +! +! NAME +! MODULE H5I +! +! FILE +! fortran/src/H5Iff.f90 +! +! PURPOSE +! This file contains Fortran interfaces for H5I functions. +! +! COPYRIGHT +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +! NOTES +! *** IMPORTANT *** +! If you add a new H5I function you must add the function name to the +! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! This is needed for Windows based operating systems. +! +!***** - USE H5GLOBAL +MODULE H5I - CONTAINS + USE H5GLOBAL -!---------------------------------------------------------------------- -! Name: h5iget_type_f -! -! Purpose: Retrieves the type of an object. -! -! Inputs: obj_id - object identifier -! Outputs: -! type - type of the object, possible values: -! H5I_FILE_F -! H5I_GROUP_F -! H5I_DATATYPE_F -! H5I_DATASPACE_F -! H5I_DATASET_F -! H5I_ATTR_F -! H5I_BADID_F -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 5, 2001 -! -! Comment: -!---------------------------------------------------------------------- - SUBROUTINE h5iget_type_f(obj_id, type, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: obj_id !Object identifier - INTEGER, INTENT(OUT) :: type !type of an object. - !possible values are: - !H5I_FILE_F - !H5I_GROUP_F - !H5I_DATATYPE_F - !H5I_DATASPACE_F - !H5I_DATASET_F - !H5I_ATTR_F - !H5I_BADID_F - INTEGER, INTENT(OUT) :: hdferr ! Error code +CONTAINS -! INTEGER, EXTERNAL :: h5iget_type_c -! Interface is needed for MS FORTRAN -! - 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 - INTEGER(HID_T), INTENT(IN) :: obj_id - INTEGER, INTENT(OUT) :: type - END FUNCTION h5iget_type_c - END INTERFACE - hdferr = h5iget_type_c(obj_id, type) - END SUBROUTINE h5iget_type_f +!****s* H5I/h5iget_type_f +! +! NAME +! h5iget_type_f +! +! PURPOSE +! Retrieves the type of an object. +! +! INPUTS +! obj_id - object identifier +! OUTPUTS +! type - type of the object, possible values: +! H5I_FILE_F +! H5I_GROUP_F +! H5I_DATATYPE_F +! H5I_DATASPACE_F +! H5I_DATASET_F +! H5I_ATTR_F +! H5I_BADID_F +! hdferr: - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 5, 2001 +! +! SOURCE + SUBROUTINE h5iget_type_f(obj_id, TYPE, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: obj_id ! Object identifier + INTEGER, INTENT(OUT) :: TYPE ! type of an object. + ! possible values are: + ! H5I_FILE_F + ! H5I_GROUP_F + ! H5I_DATATYPE_F + ! H5I_DATASPACE_F + ! H5I_DATASET_F + ! H5I_ATTR_F + ! H5I_BADID_F + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + 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 + INTEGER(HID_T), INTENT(IN) :: obj_id + INTEGER, INTENT(OUT) :: TYPE + END FUNCTION h5iget_type_c + END INTERFACE + hdferr = h5iget_type_c(obj_id, TYPE) + END SUBROUTINE h5iget_type_f -!---------------------------------------------------------------------- -! Name: h5iget_name_f -! -! Purpose: Gets a name of an object specified by its idetifier. -! -! Inputs: -! obj_id - attribute identifier -! buf_size - size of a buffer to read name in -! Outputs: -! buf - buffer to read name in, name will be truncated if -! buffer is not big enough -! name_size - name size -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! March 12, 2003 -! -! Modifications: -! -!---------------------------------------------------------------------- +!****s* H5I/h5iget_name_f +! +! NAME +! h5iget_name_f +! +! PURPOSE +! Gets a name of an object specified by its idetifier. +! +! INPUTS +! obj_id - attribute identifier +! buf_size - size of a buffer to read name in +! OUTPUTS +! buf - buffer to read name in, name will be truncated if +! buffer is not big enough +! name_size - name size +! hdferr: - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! March 12, 2003 +! SOURCE + SUBROUTINE h5iget_name_f(obj_id, buf, buf_size, name_size, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: obj_id ! Object identifier + INTEGER(SIZE_T), INTENT(IN) :: buf_size ! Buffer size + CHARACTER(LEN=*), INTENT(OUT) :: buf ! Buffer to hold object name + INTEGER(SIZE_T), INTENT(OUT) :: name_size ! Actual name size + INTEGER, INTENT(OUT) :: hdferr ! Error code: + ! 0 if successful, + ! -1 if fail +!***** + 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$ATTRIBUTES reference :: buf + INTEGER(HID_T), INTENT(IN) :: obj_id + CHARACTER(LEN=*), INTENT(OUT) :: buf + INTEGER(SIZE_T), INTENT(IN) :: buf_size + INTEGER(SIZE_T), INTENT(OUT) :: name_size + END FUNCTION h5iget_name_c + END INTERFACE + hdferr = h5iget_name_c(obj_id, buf, buf_size, name_size) + END SUBROUTINE h5iget_name_f - SUBROUTINE h5iget_name_f(obj_id, buf, buf_size, name_size, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: obj_id ! Object identifier - INTEGER(SIZE_T), INTENT(IN) :: buf_size ! Buffer size - CHARACTER(LEN=*), INTENT(OUT) :: buf ! Buffer to hold object name - INTEGER(SIZE_T), INTENT(OUT) :: name_size ! Actual name size - INTEGER, INTENT(OUT) :: hdferr ! Error code: - ! 0 if successful, - ! -1 if fail -! INTEGER, EXTERNAL :: h5iget_name_c -! MS FORTRAN needs explicit interface for C functions called here. -! - 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$ATTRIBUTES reference :: buf - INTEGER(HID_T), INTENT(IN) :: obj_id - CHARACTER(LEN=*), INTENT(OUT) :: buf - INTEGER(SIZE_T), INTENT(IN) :: buf_size - INTEGER(SIZE_T), INTENT(OUT) :: name_size - END FUNCTION h5iget_name_c - END INTERFACE +!****s* H5I/h5iinc_ref_f +! +! NAME +! h5iinc_ref_f +! +! PURPOSE +! Increments the reference count of an ID +! +! INPUTS +! obj_id - object identifier +! OUTPUTS +! ref_count - Current reference count of the ID +! hdferr: - error code +! Success: 0 +! Failure: -1 +! AUTHOR +! Quincey Koziol +! December 9, 2003 +! +! SOURCE + SUBROUTINE h5iinc_ref_f(obj_id, ref_count, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: obj_id ! Object identifier + INTEGER, INTENT(OUT) :: ref_count ! Current reference count of ID + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + 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 + INTEGER(HID_T), INTENT(IN) :: obj_id + INTEGER, INTENT(OUT) :: ref_count + END FUNCTION h5iinc_ref_c + END INTERFACE + hdferr = h5iinc_ref_c(obj_id, ref_count) + END SUBROUTINE h5iinc_ref_f - hdferr = h5iget_name_c(obj_id, buf, buf_size, name_size) - END SUBROUTINE h5iget_name_f +!****s* H5I/h5idec_ref_f +! +! NAME +! h5idec_ref_f +! +! PURPOSE +! Decrements the reference count of an ID +! +! INPUTS +! obj_id - Object identifier +! OUTPUTS +! ref_count - Current reference count of the ID +! hdferr: - Error code +! Success: 0 +! Failure: -1 +! AUTHOR +! Quincey Koziol +! December 9, 2003 +! +! SOURCE + SUBROUTINE h5idec_ref_f(obj_id, ref_count, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: obj_id ! Object identifier + INTEGER, INTENT(OUT) :: ref_count ! Current reference count of ID + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + 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 + INTEGER(HID_T), INTENT(IN) :: obj_id + INTEGER, INTENT(OUT) :: ref_count + END FUNCTION h5idec_ref_c + END INTERFACE + hdferr = h5idec_ref_c(obj_id, ref_count) + END SUBROUTINE h5idec_ref_f -!---------------------------------------------------------------------- -! Name: h5iinc_ref_f -! -! Purpose: Increments the reference count of an ID -! -! Inputs: obj_id - object identifier -! Outputs: -! ref_count - Current reference count of the ID -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Quincey Koziol -! December 9, 2003 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - SUBROUTINE h5iinc_ref_f(obj_id, ref_count, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: obj_id !Object identifier - INTEGER, INTENT(OUT) :: ref_count !Current reference count of ID - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5iinc_ref_c -! Interface is needed for MS FORTRAN -! - 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 - INTEGER(HID_T), INTENT(IN) :: obj_id - INTEGER, INTENT(OUT) :: ref_count - END FUNCTION h5iinc_ref_c - END INTERFACE - hdferr = h5iinc_ref_c(obj_id, ref_count) - END SUBROUTINE h5iinc_ref_f - -!---------------------------------------------------------------------- -! Name: h5idec_ref_f -! -! Purpose: Decrements the reference count of an ID -! -! Inputs: obj_id - object identifier -! Outputs: -! ref_count - Current reference count of the ID -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Quincey Koziol -! December 9, 2003 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - SUBROUTINE h5idec_ref_f(obj_id, ref_count, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: obj_id !Object identifier - INTEGER, INTENT(OUT) :: ref_count !Current reference count of ID - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5idec_ref_c -! Interface is needed for MS FORTRAN -! - 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 - INTEGER(HID_T), INTENT(IN) :: obj_id - INTEGER, INTENT(OUT) :: ref_count - END FUNCTION h5idec_ref_c - END INTERFACE - hdferr = h5idec_ref_c(obj_id, ref_count) - END SUBROUTINE h5idec_ref_f - -!---------------------------------------------------------------------- -! Name: h5iget_ref_f -! -! Purpose: Retrieves the reference count of an ID -! -! Inputs: obj_id - object identifier -! Outputs: -! ref_count - Current reference count of the ID -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Quincey Koziol -! December 9, 2003 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - SUBROUTINE h5iget_ref_f(obj_id, ref_count, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: obj_id !Object identifier - INTEGER, INTENT(OUT) :: ref_count !Current reference count of ID - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5iget_ref_c -! Interface is needed for MS FORTRAN -! - 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 - INTEGER(HID_T), INTENT(IN) :: obj_id - INTEGER, INTENT(OUT) :: ref_count - END FUNCTION h5iget_ref_c - END INTERFACE - hdferr = h5iget_ref_c(obj_id, ref_count) - END SUBROUTINE h5iget_ref_f - -!---------------------------------------------------------------------- -! Name: h5iget_file_id_f -! -! Purpose: Obtains file identifier from the object identifier -! -! Inputs: obj_id - object identifier -! Outputs: -! file_id - file identifier -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 23, 2004 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - SUBROUTINE h5iget_file_id_f(obj_id, file_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: obj_id ! Object identifier - INTEGER(HID_T), INTENT(OUT) :: file_id ! File identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code - - 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 - INTEGER(HID_T), INTENT(IN) :: obj_id - INTEGER(HID_T), INTENT(OUT) :: file_id - END FUNCTION h5iget_file_id_c - END INTERFACE - 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 +!****s* H5I/h5iget_ref_f +! NAME +! h5iget_ref_f +! +! PURPOSE +! Retrieves the reference count of an ID +! +! INPUTS +! obj_id - object identifier +! +! OUTPUTS +! ref_count - Current reference count of the ID +! hdferr: - error code +! Success: 0 +! Failure: -1 +! AUTHOR +! Quincey Koziol +! December 9, 2003 +! +! SOURCE + SUBROUTINE h5iget_ref_f(obj_id, ref_count, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: obj_id ! Object identifier + INTEGER, INTENT(OUT) :: ref_count ! Current reference count of ID + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + 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 + INTEGER(HID_T), INTENT(IN) :: obj_id + INTEGER, INTENT(OUT) :: ref_count + END FUNCTION h5iget_ref_c + END INTERFACE + hdferr = h5iget_ref_c(obj_id, ref_count) + END SUBROUTINE h5iget_ref_f +! +!****s* H5I/h5iget_file_id_f +! NAME +! h5iget_file_id_f +! +! PURPOSE +! Obtains file identifier from the object identifier +! +! INPUTS +! obj_id - object identifier +! OUTPUTS +! file_id - file identifier +! hdferr: - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 23, 2004 +! SOURCE + SUBROUTINE h5iget_file_id_f(obj_id, file_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: obj_id ! Object identifier + INTEGER(HID_T), INTENT(OUT) :: file_id ! File identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + 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 + INTEGER(HID_T), INTENT(IN) :: obj_id + INTEGER(HID_T), INTENT(OUT) :: file_id + END FUNCTION h5iget_file_id_c + END INTERFACE + hdferr = h5iget_file_id_c(obj_id, file_id) + END SUBROUTINE h5iget_file_id_f +! +!****s* H5I/h5iis_valid_f +! NAME +! h5iget_file_id_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 +! +! AUTHOR +! M. Scot Breitenfeld +! April 13, 2009 +! SOURCE + 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/H5Lf.c b/fortran/src/H5Lf.c index c971d5e..e5b01ed 100644 --- a/fortran/src/H5Lf.c +++ b/fortran/src/H5Lf.c @@ -1,4 +1,9 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +/****h* H5Lf/H5Lf + * PURPOSE + * This file contains C stubs for H5L Fortran APIs + * + * COPYRIGHT + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * @@ -11,17 +16,21 @@ * is linked from the top-level documents page. It can also be found at * * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * * access to either file, you may request a copy from help@hdfgroup.org. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -/* This files contains C stubs for H5L Fortran APIs */ + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * + ****** +*/ #include "H5f90.h" #include "H5Eprivate.h" -/*---------------------------------------------------------------------------- - * Name: h5lcopy_c - * Purpose: Call H5Lcopy - * Inputs: +/****if* H5Lf/h5lcopy_c + * NAME + * h5lcopy_c + * PURPOSE + * Call H5Lcopy + * INPUTS + * * src_loc_id - Location identifier of the source link * src_name - Name of the link to be copied * src_namelen - length of the name @@ -33,16 +42,21 @@ * lcpl_id - Link creation property list identifier * lapl_id - Link access property list identifier * - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld * January, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5lcopy_c(hid_t_f *src_loc_id, _fcd src_name, size_t_f *src_namelen, hid_t_f *dest_loc_id, _fcd dest_name, size_t_f *dest_namelen, hid_t_f *lcpl_id, hid_t_f *lapl_id) +/******/ { char *c_src_name = NULL; char *c_dest_name = NULL; @@ -72,10 +86,13 @@ done: return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5lcreate_external_c - * Purpose: Call H5Lcreate_external_c - * Inputs: +/****if* H5Lf/h5lcreate_external_c + * NAME + * h5lcreate_external_c + * PURPOSE + * Call H5Lcreate_external_c + * INPUTS + * * file_name - Name of the file containing the target object. Neither the file nor the target object is * required to exist. May be the file the link is being created in. * obj_name - Path within the target file to the target object. @@ -84,17 +101,19 @@ done: * lcpl_id - Link creation property list identifier. * lapl_id - Link access property list identifier. * - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld - * February 29, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld + * February 29, 2008 + * SOURCE +*/ int_f nh5lcreate_external_c(_fcd file_name, size_t_f *file_namelen, _fcd obj_name, size_t_f *obj_namelen, hid_t_f *link_loc_id, _fcd link_name, size_t_f *link_namelen, hid_t_f *lcpl_id, hid_t_f *lapl_id) - +/******/ { char *c_file_name = NULL; char *c_obj_name = NULL; @@ -129,24 +148,30 @@ done: return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5ldelete_c - * Purpose: Call H5Ldelete - * Inputs: +/****if* H5Lf/h5ldelete_c + * NAME + * h5ldelete_c + * PURPOSE + * Call H5Ldelete + * INPUTS + * * * loc_id - Identifier of the file or group containing the object * name - Name of the link to delete * lapl_id - Link access property list identifier * namelen - length of name * - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld * January, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ + * SOURCE +*/ int_f nh5ldelete_c ( hid_t_f *loc_id, _fcd name, size_t_f *namelen, hid_t_f *lapl_id ) +/******/ { char *c_name = NULL; int_f ret_value = 0; @@ -170,10 +195,13 @@ done: return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5lcreate_soft_c - * Purpose: Call H5Lcreate_soft - * Inputs: +/****if* H5Lf/h5lcreate_soft_c + * NAME + * h5lcreate_soft_c + * PURPOSE + * Call H5Lcreate_soft + * INPUTS + * * * target_path - Path to the target object, which is not required to exist. * link_loc_id - The file or group identifier for the new link. @@ -181,17 +209,20 @@ done: * lcpl_id - Link creation property list identifier. * lapl_id - Link access property list identifier. * - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld * February 20, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ + * SOURCE +*/ int_f nh5lcreate_soft_c(_fcd target_path, size_t_f *target_path_len, hid_t_f *link_loc_id, _fcd link_name, size_t_f *link_name_len, hid_t_f *lcpl_id, hid_t_f *lapl_id ) +/******/ { char *c_target_path = NULL; char *c_link_name = NULL; @@ -220,10 +251,13 @@ nh5lcreate_soft_c(_fcd target_path, size_t_f *target_path_len, return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5lcreate_hard_c - * Purpose: Call H5Lcreate_hard - * Inputs: +/****if* H5Lf/h5lcreate_hard_c + * NAME + * h5lcreate_hard_c + * PURPOSE + * Call H5Lcreate_hard + * INPUTS + * * obj_loc_id - The file or group identifier for the target object. * obj_name - Name of the target object, which must already exist. * obj_namelen - Name length @@ -233,17 +267,19 @@ nh5lcreate_soft_c(_fcd target_path, size_t_f *target_path_len, * lcpl_id - Link creation property list identifier. * lapl_id - Link access property list identifier. * - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld - * February 27, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ - + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld + * February 27, 2008 + * SOURCE +*/ int_f nh5lcreate_hard_c(hid_t_f *obj_loc_id, _fcd obj_name, size_t_f *obj_namelen, hid_t_f *link_loc_id, _fcd link_name, size_t_f *link_namelen, hid_t_f *lcpl_id, hid_t_f *lapl_id ) +/******/ { char *c_obj_name = NULL; char *c_link_name = NULL; @@ -272,10 +308,13 @@ nh5lcreate_hard_c(hid_t_f *obj_loc_id, _fcd obj_name, size_t_f *obj_namelen, return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5ldelete_by_idx_c - * Purpose: Calls h5ldelete_by_idx - * Inputs: +/****if* H5Lf/h5ldelete_by_idx_c + * NAME + * h5ldelete_by_idx_c + * PURPOSE + * Calls h5ldelete_by_idx + * INPUTS + * * loc_id - File or group identifier specifying location of subject group * group_name - Name of subject group * group_namelen - Name length @@ -293,15 +332,21 @@ nh5lcreate_hard_c(hid_t_f *obj_loc_id, _fcd obj_name, size_t_f *obj_namelen, * n - Link for which to retrieve information * lapl_id - Link access property list * - * Outputs: N/A - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld + * OUTPUTS + * N/A + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld * February 29, 2008 - * Modifications: N/A - *---------------------------------------------------------------------------*/ + * HISTORY + * N/A + * SOURCE +*/ int_f nh5ldelete_by_idx_c (hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, int_f *index_field, int_f *order, hsize_t_f *n, hid_t_f *lapl_id) +/******/ { char *c_group_name = NULL; /* Buffer to hold C string */ H5_index_t c_index_field; @@ -329,22 +374,31 @@ done: return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5lexists_c - * Purpose: Calls H5Lexists - * Inputs: +/****if* H5Lf/h5lexists_c + * NAME + * h5lexists_c + * PURPOSE + * Calls H5Lexists + * INPUTS + * * loc_id - Identifier of the file or group to query. * name - Link name to check * lapl_id - Link access property list identifier. - * Outputs: + * OUTPUTS + * * link_exists_c - returns a positive value, for TRUE, or 0 (zero), for FALSE. - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld * February 29, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5lexists_c (hid_t_f *loc_id, _fcd name, size_t_f *namelen, hid_t_f *lapl_id, int_f *link_exists) +/******/ { char *c_name = NULL; /* Buffer to hold C string */ int_f ret_value = 0; /* Return value */ @@ -367,15 +421,19 @@ done: return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5lget_info_c - * Purpose: Call H5Lget_info - * Inputs: +/****if* H5Lf/h5lget_info_c + * NAME + * h5lget_info_c + * PURPOSE + * Call H5Lget_info + * INPUTS + * * link_loc_id - File or group identifier. * link_name - Name of the link for which information is being sought * link_namelen - Name length * lapl_id - Link access property list - * Outputs: + * OUTPUTS + * * * cset - indicates the character set used for link’s name. * corder - specifies the link’s creation order position. @@ -388,20 +446,25 @@ done: * address - If the link is a hard link, address specifies the file address that the link points to * val_size - If the link is a symbolic link, val_size will be the length of the link value * - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld * January, 2008 - * Modifications: N/A - *---------------------------------------------------------------------------*/ + * HISTORY + * N/A + * SOURCE +*/ int_f nh5lget_info_c(hid_t_f *link_loc_id, _fcd link_name, size_t_f *link_namelen, int_f *cset, int_f *corder, int_f *corder_valid, int_f *link_type, haddr_t_f *address, size_t_f *val_size, hid_t_f *lapl_id) +/******/ { char *c_link_name = NULL; /* Buffer to hold C string */ - H5L_info_t link_buff; int_f ret_value = 0; /* Return value */ + H5L_info_t link_buff; /* * Convert FORTRAN name to C name @@ -431,10 +494,13 @@ done: return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5lget_info_by_idx_c - * Purpose: Call H5Lget_info_by_idx - * Inputs: +/****if* H5Lf/h5lget_info_by_idx_c + * NAME + * h5lget_info_by_idx_c + * PURPOSE + * Call H5Lget_info_by_idx + * INPUTS + * * loc_id - File or group identifier specifying location of subject group * group_name - Name of subject group *group_namelen - Name length @@ -442,43 +508,54 @@ done: * order - Order within field or index * n - Link for which to retrieve information * lapl_id - Link access property list - * Outputs: + * OUTPUTS + * * corder_valid - Indicates whether the the creation order data is valid for this attribute * corder - Is a positive integer containing the creation order of the attribute * cset - Indicates the character set used for the attribute’s name * data_size - indicates the size, in the number of characters, of the attribute * - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld * January, 2008 - * Modifications: N/A - *---------------------------------------------------------------------------*/ + * HISTORY + * N/A + * SOURCE +*/ int_f nh5lget_info_by_idx_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, int_f *index_field, int_f *order, hsize_t_f *n, int_f *link_type, int_f *corder_valid, int_f *corder, int_f *cset, haddr_t_f *address, size_t_f *val_size, hid_t_f *lapl_id) +/******/ { char *c_group_name = NULL; /* Buffer to hold C string */ - H5L_info_t link_buff; + H5_index_t c_index_field; + H5_iter_order_t c_order; int_f ret_value = 0; /* Return value */ + H5L_info_t link_buff; /* * Convert FORTRAN name to C name */ - if(NULL == (c_group_name = HD5f2cstring(group_name, (size_t)*group_namelen))) - HGOTO_DONE(FAIL) + if((c_group_name = HD5f2cstring(group_name, (size_t)*group_namelen)) == NULL) + HGOTO_DONE(FAIL); + c_index_field = (H5_index_t)*index_field; + c_order = (H5_iter_order_t)*order; /* * Call H5Linfo_by_idx function. */ - if(H5Lget_info_by_idx((hid_t)*loc_id, c_group_name, (H5_index_t)*index_field, (H5_iter_order_t)*order, (hsize_t)*n, + if(H5Lget_info_by_idx((hid_t)*loc_id, c_group_name, c_index_field, c_order, (hsize_t)*n, &link_buff, (hid_t)*lapl_id) < 0) - HGOTO_DONE(FAIL) + HGOTO_DONE(FAIL); /* Unpack the structure */ + *corder_valid = 0; - if(link_buff.corder_valid > 0) - *corder_valid = 1; + if(link_buff.corder_valid > 0) *corder_valid = 1; + *corder = (int_f)link_buff.corder; *cset = (int_f)link_buff.cset; *link_type = (int_f)link_buff.type; @@ -486,27 +563,33 @@ nh5lget_info_by_idx_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, *val_size = (size_t_f)link_buff.u.val_size; done: - if(c_group_name) - HDfree(c_group_name); - return ret_value; } -/*---------------------------------------------------------------------------- - * Name: H5Lis_registered_c - * Purpose: Call H5Lis_registered - * Inputs: +/****if* H5Lf/H5Lis_registered_c + * NAME + * H5Lis_registered_c + * PURPOSE + * Call H5Lis_registered + * INPUTS + * * link_cls_id - User-defined link class identifier - * Outputs: NONE + * OUTPUTS + * NONE * - * Returns: Returns a positive value if the link class has been registered + * RETURNS + * Returns a positive value if the link class has been registered * and zero if it is unregistered. Otherwise returns a negative value - * Programmer: M.S. Breitenfeld + * AUTHOR + * M. Scot Breitenfeld * March 3, 2008 - * Modifications: N/A - *---------------------------------------------------------------------------*/ + * HISTORY + * N/A + * SOURCE +*/ int_f nh5lis_registered_c(int_f *link_cls_id) +/******/ { int_f ret_value; /* Return value */ @@ -518,28 +601,51 @@ nh5lis_registered_c(int_f *link_cls_id) return ret_value; } +/* { not sure what this is fix -scot- */ +/* int_f ret_value = 0; /\* Return value *\/ */ +/* H5L_type_t c_link_cls_id; /\* User-defined link class identifier *\/ */ +/* htri_t registered; /\* registration status *\/ */ + -/*---------------------------------------------------------------------------- - * Name: h5lmove_c - * Purpose: Call H5Lmove - * Inputs: +/* c_link_cls_id = (H5L_type_t)*link_cls_id; */ +/* /\* */ +/* * Call H5Lis_registered */ +/* *\/ */ +/* registered = H5Lis_registered(c_link_cls_id); */ + +/* ret_value = (int_f)registered; */ + +/* return ret_value; */ +/* } */ + + +/****if* H5Lf/h5lmove_c + * NAME + * h5lmove_c + * PURPOSE + * Call H5Lmove + * INPUTS + * * src_loc_id - Original file or group identifier. * src_name - Original link name. * src_namelen - name length * dest_loc_id - Destination file or group identifier. * dest_name - NEW link name. * dest_namelen - name length - * Outputs: + * OUTPUTS + * * - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld * March 3, 2008 - * Modifications: N/A - *---------------------------------------------------------------------------*/ + * SOURCE +*/ int_f nh5lmove_c(hid_t_f *src_loc_id, _fcd src_name, size_t_f *src_namelen, hid_t_f *dest_loc_id, _fcd dest_name, size_t_f *dest_namelen, hid_t_f *lcpl_id, hid_t_f *lapl_id) - +/******/ { char *c_src_name = NULL; /* Buffer to hold C string */ char *c_dest_name = NULL; /* Buffer to hold C string */ @@ -569,10 +675,13 @@ done: return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5lget_name_by_idx_c - * Purpose: Call H5Lget_name_by_idx - * Inputs: +/****if* H5Lf/h5lget_name_by_idx_c + * NAME + * h5lget_name_by_idx_c + * PURPOSE + * Call H5Lget_name_by_idx + * INPUTS + * * loc_id - File or group identifier specifying location of subject group * group_name - Name of subject group * index_field - Index or field which determines the order @@ -580,18 +689,22 @@ done: * n - Link for which to retrieve information * size - Maximum number of characters of link value to be returned. * lapl_id - Link access property list - * Outputs: + * OUTPUTS + * * name - Buffer in which link value is returned * size - The size of the link name on success - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld * March 10, 2008 - * Modifications: N/A - *---------------------------------------------------------------------------*/ + * SOURCE +*/ int_f nh5lget_name_by_idx_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, int_f *index_field, int_f *order, hsize_t_f *n, size_t_f *size, _fcd name, hid_t_f *lapl_id) +/******/ { char *c_group_name = NULL; /* Buffer to hold C string */ char *c_name = NULL; /* Buffer to hold C string */ @@ -631,34 +744,98 @@ done: return ret_value; } -/*---------------------------------------------------------------------------- - * Name: H5Lregistered_c - * Purpose: Call H5Lregistered - * Inputs: - * - * Inputs: - * version - Version number of this struct - * class_id - Link class identifier - * comment - Comment for debugging - * comment_len - Comment for debugging - * create_func - Callback during link creation - * create_func_len - length - * move_func - Callback after moving link - * move_func_len - length - * copy_func - Callback after copying link - * copy_func_len - length - * trav_func - The main traversal function - * trav_func_len - length - * del_func - Callback for link deletion - * del_func_len - length - * query_func - Callback for queries - * query_func_len - length - * - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld - * February 3, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ + +/* /\****if* H5Lf/h5lget_val_c */ +/* * NAME */ +/* * h5lget_val_c */ +/* * PURPOSE */ +/* * Call H5Lget_val */ +/* * INPUTS */ +/* * */ +/* * link_loc_id - File or group identifier. */ +/* * link_name - Name of the link for which valrmation is being sought */ +/* * link_namelen - Name length */ +/* * size - Maximum number of characters of link value to be returned. */ +/* * lapl_id - Link access property list */ +/* * OUTPUTS */ +/* * */ +/* * linkval_buff - The buffer to hold the returned link value. */ +/* * */ +/* * RETURNS */ +/* * 0 on success, -1 on failure */ +/* * AUTHOR */ +/* * M. Scot Breitenfeld */ +/* * March 3, 2008 */ +/* * HISTORY */ +/* * N/A */ +/* * SOURCE */ +/* *\/ */ +/* int_f */ +/* nh5lget_val_c (hid_t_f *link_loc_id, _fcd link_name, size_t_f *link_namelen, */ +/* size_t_f *size, _fcd linkval_buff, */ +/* hid_t_f *lapl_id) */ +/* { */ +/* char *c_link_name = NULL; /\* Buffer to hold C string *\/ */ +/* int_f ret_value = 0; /\* Return value *\/ */ +/* void *c_linkval_buff = NULL; */ + +/* /\* */ +/* * Convert FORTRAN name to C name */ +/* *\/ */ +/* if((c_link_name = HD5f2cstring(link_name, (size_t)*link_namelen)) == NULL) */ +/* HGOTO_DONE(FAIL); */ +/* /\* */ +/* * Call H5Lval function. */ +/* *\/ */ +/* if(H5Lget_val((hid_t)*link_loc_id, c_link_name, &linkval_buff, (size_t)*size, (hid_t)*lapl_id) < 0) */ +/* HGOTO_DONE(FAIL); */ +/* /\* */ +/* * Convert C name to FORTRAN */ +/* *\/ */ +/* HD5packFstring(c_buf, _fcdtocp(buf), c_bufsize-1); */ + + +/* done: */ +/* return ret_value; */ +/* } */ + + +/* /\****if* H5Lf/ */ +/* * NAME */ +/* * H5Lregistered_c */ +/* * PURPOSE */ +/* * Call H5Lregistered */ +/* * INPUTS */ +/* * */ +/* * */ +/* * INPUTS */ +/* * */ +/* * version - Version number of this struct */ +/* * class_id - Link class identifier */ +/* * comment - Comment for debugging */ +/* * comment_len - Comment for debugging */ +/* * create_func - Callback during link creation */ +/* * create_func_len - length */ +/* * move_func - Callback after moving link */ +/* * move_func_len - length */ +/* * copy_func - Callback after copying link */ +/* * copy_func_len - length */ +/* * trav_func - The main traversal function */ +/* * trav_func_len - length */ +/* * del_func - Callback for link deletion */ +/* * del_func_len - length */ +/* * query_func - Callback for queries */ +/* * query_func_len - length */ +/* * */ +/* * RETURNS */ +/* * 0 on success, -1 on failure */ +/* * AUTHOR */ +/* * M. Scot Breitenfeld */ +/* * February 3, 2008 */ +/* * HISTORY */ +/* * */ +/* * SOURCE */ +/* *\/ */ /* int_f */ @@ -681,7 +858,7 @@ done: /* H5L_class_t class_t; */ -/* int ret_value = 0; */ +/* int_f ret_value = 0; */ /* /\* */ /* * Convert FORTRAN name to C name */ @@ -734,27 +911,34 @@ done: /* return ret_value; */ /* } */ -/*---------------------------------------------------------------------------- - * Name: h5lget_val_c - * Purpose: Call H5Lget_val_c - * Inputs: +/****if* H5Lf/h5lget_val_c + * NAME + * h5lget_val_c + * PURPOSE + * Call H5Lget_val + * INPUTS + * * link_loc_id - File or group identifier. * link_name - Link whose value is to be returned. * link_name_len - length of link_name * size - Maximum number of characters of link value to be returned. * lapl_id - List access property list identifier - * Outputs: + * OUTPUTS + * * linkval_buff - The buffer to hold the returned link value. * - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld * April 11, 2008 - * Modifications: N/A - *---------------------------------------------------------------------------*/ + * SOURCE +*/ int_f nh5lget_val_c(hid_t_f *link_loc_id, _fcd link_name, size_t_f *link_namelen, size_t_f *size, void *linkval_buff, hid_t_f *lapl_id) -{ +/******/ +{ char *c_link_name = NULL; /* Buffer to hold C string */ int_f ret_value = 0; /* Return value */ @@ -777,3 +961,112 @@ done: return ret_value; } +/****if* H5Lf/h5literate_c + * NAME + * h5literate_c + * PURPOSE + * Calls H5Literate + * INPUTS + * + * group_id - Identifier specifying subject group + * index_type - Type of index which determines the order + * order - Order within index + * idx - Iteration position at which to start + * op - Callback function passing data regarding the link to the calling application + * op_data - User-defined pointer to data required by the application for its processing of the link + * + * OUTPUTS + * + * idx - Position at which an interrupted iteration may be restarted + * + * RETURNS + * >0 on success, 0< on failure + * AUTHOR + * M. Scot Breitenfeld + * July 8, 2008 + * SOURCE +*/ +int_f +nh5literate_c(hid_t_f *group_id, int_f *index_type, int_f *order, hsize_t_f *idx, H5L_iterate_t op, void *op_data ) +/******/ +{ + int_f ret_value = -1; /* Return value */ + herr_t func_ret_value; /* H5Linterate return value */ + hsize_t idx_c = 0; + + idx_c = (hsize_t)*idx; + + /* + * Call H5Linterate + */ + + func_ret_value = H5Literate( (hid_t)*group_id, (H5_index_t)*index_type, (H5_iter_order_t)*order, &idx_c, op, op_data); + + ret_value = (int_f)func_ret_value; + *idx = (hsize_t_f)idx_c; + + return ret_value; +} + +/****if* H5Lf/h5literate_by_name_c + * NAME + * h5literate_by_name_c + * PURPOSE + * Call H5Literate_by_name + * INPUTS + * + * loc_id - Identifier specifying subject group + * name - Name of subject group + * namelen - Name length + * index_type - Type of index which determines the order + * order - Order within index + * idx - Iteration position at which to start + * op - Callback function passing data regarding the link to the calling application + * op_data - User-defined pointer to data required by the application for its processing of the link + * lapl_id - List access property list identifier + * + * OUTPUTS + * + * idx - Position at which an interrupted iteration may be restarted + * + * RETURNS + * >0 on success, 0< on failure + * AUTHOR + * M. Scot Breitenfeld + * Augest 18, 2008 + * SOURCE +*/ +int_f +nh5literate_by_name_c(hid_t_f *loc_id, _fcd name, size_t_f *namelen, int_f *index_type, int_f *order, hsize_t_f *idx, H5L_iterate_t op, void *op_data, hid_t_f *lapl_id) +/******/ +{ + int_f ret_value = -1; /* Return value */ + herr_t func_ret_value; /* H5Linterate return value */ + hsize_t idx_c = 0; + char *c_name = NULL; /* Buffer to hold C string */ + + /* + * Convert FORTRAN name to C name + */ + if((c_name = HD5f2cstring(name, (size_t)*namelen)) == NULL) + return ret_value=-1; + + idx_c = (hsize_t)*idx; + + /* + * Call H5Linterate + */ + + func_ret_value = H5Literate_by_name((hid_t)*loc_id, c_name,(H5_index_t)*index_type,(H5_iter_order_t)*order,&idx_c,op,op_data,(hid_t)*lapl_id); + + ret_value = (int_f)func_ret_value; + *idx = (hsize_t_f)idx_c; + + if(c_name) HDfree(c_name); + + return ret_value; +} + + + + diff --git a/fortran/src/H5Lff.f90 b/fortran/src/H5Lff.f90 index 8d30c20..8043d74 100644 --- a/fortran/src/H5Lff.f90 +++ b/fortran/src/H5Lff.f90 @@ -1,3 +1,14 @@ +!****h* ROBODoc/H5L +! +! NAME +! MODULE H5L +! +! PURPOSE +! This file contains Fortran interfaces for H5L functions. It includes +! all the functions that are independent on whether the Fortran 2003 functions +! are enabled or disabled. +! +! COPYRIGHT ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! Copyright by The HDF Group. * ! Copyright by the Board of Trustees of the University of Illinois. * @@ -13,43 +24,48 @@ ! access to either file, you may request a copy from help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! +! NOTES +! *** IMPORTANT *** +! If you add a new H5L function you must add the function name to the +! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! This is needed for Windows based operating systems. ! -! This file contains Fortran90 interfaces for H5L functions. -! +!***** + MODULE H5L USE H5GLOBAL CONTAINS -!---------------------------------------------------------------------- -! Name: h5lcopy_f ! -! Purpose: Copies a link from one location to another. +!****s* H5L/h5lcopy_f +! +! NAME +! h5lcopy_f ! -! Inputs: -! src_loc_id - Location identifier of the source link -! src_name - Name of the link to be copied -! dest_loc_id - Location identifier specifying the destination of the copy -! dest_name - Name to be assigned to the NEW copy -! loc_id - Identifier of the file or group containing the object -! name - Name of the link to delete +! PURPOSE +! Copies a link from one location to another. ! -! Outputs: -! hdferr - error code: -! Success: 0 -! Failure: -1 -! Optional parameters: -! lcpl_id - Link creation property list identifier -! lapl_id - Link access property list identifier +! INPUTS +! src_loc_id - Location identifier of the source link +! src_name - Name of the link to be copied +! dest_loc_id - Location identifier specifying the destination of the copy +! dest_name - Name to be assigned to the NEW copy +! loc_id - Identifier of the file or group containing the object +! name - Name of the link to delete ! -! Programmer: M.S. Breitenfeld -! February 27, 2008 +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! OPTIONAL PARAMETERS +! lcpl_id - Link creation property list identifier +! lapl_id - Link access property list identifier ! -! Modifications: +! AUTHOR +! M. Scot Breitenfeld +! February 27, 2008 ! -! Comment: -!---------------------------------------------------------------------- +! SOURCE SUBROUTINE h5lcopy_f(src_loc_id, src_name, dest_loc_id, dest_name, hdferr, & lcpl_id, lapl_id) IMPLICIT NONE @@ -62,16 +78,13 @@ CONTAINS ! 0 on success and -1 on failure INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lcpl_id ! Link creation property list identifier INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list identifier - +!***** INTEGER(HID_T) :: lcpl_id_default INTEGER(HID_T) :: lapl_id_default INTEGER(SIZE_T) :: src_namelen INTEGER(SIZE_T) :: dest_namelen - -! MS FORTRAN needs explicit interface for C functions called here. -! INTERFACE INTEGER FUNCTION h5lcopy_c(src_loc_id, src_name, src_namelen, dest_loc_id, dest_name, dest_namelen, & lcpl_id_default, lapl_id_default) @@ -106,29 +119,29 @@ CONTAINS END SUBROUTINE h5lcopy_f -!---------------------------------------------------------------------- -! Name: h5ldelete_f ! -! Purpose: Removes a link from a group. +!****s* H5L/h5ldelete_f ! -! Inputs: -! loc_id - Identifier of the file or group containing the object -! name - Name of the link to delete +! NAME +! h5ldelete_f ! -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! lapl_id - Link access property list identifier +! PURPOSE +! Removes a link from a group. ! -! Programmer: M.S. Breitenfeld -! January, 2008 +! INPUTS +! loc_id - Identifier of the file or group containing the object +! name - Name of the link to delete ! -! Modifications: +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! OPTIONAL PARAMETERS +! lapl_id - Link access property list identifier ! -! Comment: -!---------------------------------------------------------------------- +! AUTHOR +! M. Scot Breitenfeld +! January, 2008 +! +! SOURCE SUBROUTINE h5ldelete_f(loc_id, name, hdferr, lapl_id) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: loc_id ! Identifier of the file or group containing the object @@ -136,12 +149,10 @@ CONTAINS INTEGER, INTENT(OUT) :: hdferr ! Error code: ! 0 on success and -1 on failure INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list identifier +!***** INTEGER(HID_T) :: lapl_id_default INTEGER(SIZE_T) :: namelen - -! MS FORTRAN needs explicit interface for C functions called here. -! INTERFACE INTEGER FUNCTION h5ldelete_c(loc_id, name, namelen, lapl_id_default) USE H5GLOBAL @@ -165,48 +176,46 @@ CONTAINS END SUBROUTINE h5ldelete_f -!---------------------------------------------------------------------- -! Name: H5Lcreate_soft_f ! -! Purpose: Creates a soft link to an object. +!****s* H5L/H5Lcreate_soft_f ! -! Inputs: -! target_path - Path to the target object, which is not required to exist. -! link_loc_id - The file or group identifier for the new link. -! link_name - The name of the new link. +! NAME +! H5Lcreate_soft_f ! -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! lcpl_id - Link creation property list identifier. -! lapl_id - Link access property list identifier. +! PURPOSE +! Creates a soft link to an object. ! -! Programmer: M.S. Breitenfeld -! February 20, 2008 +! INPUTS +! target_path - Path to the target object, which is not required to exist. +! link_loc_id - The file or group identifier for the new link. +! link_name - The name of the new link. ! -! Modifications: +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! OPTIONAL PARAMETERS +! lcpl_id - Link creation property list identifier. +! lapl_id - Link access property list identifier. ! -! Comment: -!---------------------------------------------------------------------- +! AUTHOR +! M. Scot Breitenfeld +! February 20, 2008 +! +! SOURCE SUBROUTINE h5lcreate_soft_f(target_path, link_loc_id, link_name, hdferr, lcpl_id, lapl_id) IMPLICIT NONE - CHARACTER(LEN=*), INTENT(IN) :: target_path ! Path to the target object, which is not required to exist. + CHARACTER(LEN=*), INTENT(IN) :: target_path ! Path to the target object, which is not required to exist. INTEGER(HID_T), INTENT(IN) :: link_loc_id ! The file or group identifier for the new link. - CHARACTER(LEN=*), INTENT(IN) :: link_name ! The name of the new link. - INTEGER, INTENT(OUT) :: hdferr ! Error code: - ! 0 on success and -1 on failure + CHARACTER(LEN=*), INTENT(IN) :: link_name ! The name of the new link. + INTEGER, INTENT(OUT) :: hdferr ! Error code: + ! 0 on success and -1 on failure INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lcpl_id ! Link creation property list identifier. INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list identifier. - +!***** INTEGER(HID_T) :: lcpl_id_default INTEGER(HID_T) :: lapl_id_default INTEGER(SIZE_T) :: target_path_len INTEGER(SIZE_T) :: link_name_len -! MS FORTRAN needs explicit interface for C functions called here. -! INTERFACE INTEGER FUNCTION h5lcreate_soft_c(target_path, target_path_len, & link_loc_id, & @@ -242,33 +251,33 @@ CONTAINS END SUBROUTINE h5lcreate_soft_f -!---------------------------------------------------------------------- -! Name: H5Lcreate_hard_f ! -! Purpose: Creates a hard link to an object. +!****s* H5L/H5Lcreate_hard_f ! -! Inputs: +! NAME +! H5Lcreate_hard_f ! -! obj_loc_id - The file or group identifier for the target object. -! obj_name - Name of the target object, which must already exist. -! link_loc_id - The file or group identifier for the new link. -! link_name - The name of the new link. +! PURPOSE +! Creates a hard link to an object. ! -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! lcpl_id - Link creation property list identifier. -! lapl_id - Link access property list identifier. +! INPUTS ! -! Programmer: M.S. Breitenfeld -! February 27, 2008 +! obj_loc_id - The file or group identifier for the target object. +! obj_name - Name of the target object, which must already exist. +! link_loc_id - The file or group identifier for the new link. +! link_name - The name of the new link. ! -! Modifications: +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! OPTIONAL PARAMETERS +! lcpl_id - Link creation property list identifier. +! lapl_id - Link access property list identifier. ! -! Comment: -!---------------------------------------------------------------------- +! AUTHOR +! M. Scot Breitenfeld +! February 27, 2008 +! +! SOURCE SUBROUTINE h5lcreate_hard_f(obj_loc_id, obj_name, link_loc_id, link_name, hdferr, lcpl_id, lapl_id) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: obj_loc_id ! The file or group identifier for the target object. @@ -281,15 +290,13 @@ CONTAINS INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lcpl_id ! Link creation property list identifier. INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list identifier. - +!***** INTEGER(HID_T) :: lcpl_id_default INTEGER(HID_T) :: lapl_id_default INTEGER(SIZE_T) :: obj_namelen INTEGER(SIZE_T) :: link_namelen -! MS FORTRAN needs explicit interface for C functions called here. -! INTERFACE INTEGER FUNCTION h5lcreate_hard_c(obj_loc_id, obj_name, obj_namelen, & link_loc_id, link_name, link_namelen, lcpl_id_default, lapl_id_default) @@ -322,37 +329,36 @@ CONTAINS END SUBROUTINE h5lcreate_hard_f -!---------------------------------------------------------------------- -! Name: H5Lcreate_external_f ! -! Purpose: Creates a soft link to an object in a different file. +!****s* H5L/H5Lcreate_external_f ! -! Inputs: +! NAME +! H5Lcreate_external_f ! -! file_name - Name of the file containing the target object. Neither the file nor the target object is -! required to exist. May be the file the link is being created in. -! obj_name - Path within the target file to the target object. -! link_loc_id - The file or group identifier for the new link. -! link_name - The name of the new link. +! PURPOSE +! Creates a soft link to an object in a different file. ! -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! lcpl_id - Link creation property list identifier. -! lapl_id - Link access property list identifier. +! INPUTS ! -! Programmer: M.S. Breitenfeld -! February 27, 2008 +! file_name - Name of the file containing the target object. Neither the file nor the target object is +! required to exist. May be the file the link is being created in. +! obj_name - Path within the target file to the target object. +! link_loc_id - The file or group identifier for the new link. +! link_name - The name of the new link. ! -! Modifications: +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! OPTIONAL PARAMETERS +! lcpl_id - Link creation property list identifier. +! lapl_id - Link access property list identifier. ! -! Comment: -!---------------------------------------------------------------------- +! AUTHOR +! M. Scot Breitenfeld +! February 27, 2008 +! SOURCE SUBROUTINE h5lcreate_external_f(file_name, obj_name, link_loc_id, link_name, hdferr, lcpl_id, lapl_id) IMPLICIT NONE - CHARACTER(LEN=*), INTENT(IN) :: file_name ! Name of the file containing the target object. Neither + CHARACTER(LEN=*), INTENT(IN) :: file_name ! Name of the file containing the target object. Neither ! the file nor the target object is required to exist. ! May be the file the link is being created in. CHARACTER(LEN=*), INTENT(IN) :: obj_name ! Name of the target object, which must already exist. @@ -364,7 +370,7 @@ CONTAINS INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lcpl_id ! Link creation property list identifier. INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list identifier. - +!***** INTEGER(HID_T) :: lcpl_id_default INTEGER(HID_T) :: lapl_id_default @@ -372,8 +378,6 @@ CONTAINS INTEGER(SIZE_T) :: obj_namelen INTEGER(SIZE_T) :: link_namelen -! MS FORTRAN needs explicit interface for C functions called here. -! INTERFACE INTEGER FUNCTION h5lcreate_external_c(file_name, file_namelen, obj_name, obj_namelen, & link_loc_id, link_name, link_namelen, lcpl_id_default, lapl_id_default) @@ -408,42 +412,40 @@ CONTAINS END SUBROUTINE h5lcreate_external_f -!---------------------------------------------------------------------- -! Name: h5ldelete_by_idx_f -! -! Purpose: Removes the nth link in a group. -! Inputs: -! loc_id - File or group identifier specifying location of subject group -! group_name - Name of subject group -! index_field - Type of index; Possible values are: -! -! H5_INDEX_UNKNOWN_F = -1 - Unknown index type -! H5_INDEX_NAME_F - Index on names -! H5_INDEX_CRT_ORDER_F - Index on creation order -! H5_INDEX_N_F - Number of indices defined -! -! order - Order within field or index; Possible values are: -! -! H5_ITER_UNKNOWN_F - Unknown order -! H5_ITER_INC_F - Increasing order -! H5_ITER_DEC_F - Decreasing order -! H5_ITER_NATIVE_F - No particular order, whatever is fastest -! H5_ITER_N_F - Number of iteration orders -! -! n - Link for which to retrieve information -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! lapl_id - Link access property list ! -! Programmer: M.S. Breitenfeld -! February 29, 2008 -! -! Modifications: N/A -! -!---------------------------------------------------------------------- +!****s* H5L/h5ldelete_by_idx_f +! +! NAME +! h5ldelete_by_idx_f +! +! PURPOSE +! Removes the nth link in a group. +! INPUTS +! loc_id - File or group identifier specifying location of subject group +! group_name - Name of subject group +! index_field - Type of index; Possible values are: +! H5_INDEX_UNKNOWN_F = -1 - Unknown index type +! H5_INDEX_NAME_F - Index on names +! H5_INDEX_CRT_ORDER_F - Index on creation order +! H5_INDEX_N_F - Number of indices defined +! +! order - Order within field or index; Possible values are: +! H5_ITER_UNKNOWN_F - Unknown order +! H5_ITER_INC_F - Increasing order +! H5_ITER_DEC_F - Decreasing order +! H5_ITER_NATIVE_F - No particular order, whatever is fastest +! H5_ITER_N_F - Number of iteration orders +! +! n - Link for which to retrieve information +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! OPTIONAL PARAMETERS +! lapl_id - Link access property list +! +! AUTHOR +! M. Scot Breitenfeld +! February 29, 2008 +! SOURCE SUBROUTINE h5ldelete_by_idx_f(loc_id, group_name, index_field, order, n, hdferr, lapl_id) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: loc_id ! Identifer for object to which attribute is attached @@ -464,12 +466,10 @@ CONTAINS INTEGER, INTENT(OUT) :: hdferr ! Error code: ! 0 on success and -1 on failure INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list - +!***** INTEGER(HID_T) :: lapl_id_default INTEGER(SIZE_T) :: group_namelen -! MS FORTRAN needs explicit interface for C functions called here. -! INTERFACE INTEGER FUNCTION h5ldelete_by_idx_c(loc_id, group_name, group_namelen, index_field, order, n, lapl_id_default) USE H5GLOBAL @@ -495,29 +495,30 @@ CONTAINS END SUBROUTINE h5ldelete_by_idx_f -!---------------------------------------------------------------------- -! Name: H5Lexists_f ! -! Purpose: Check if a link with a particular name exists in a group. +!****s* H5L/H5Lexists_f +! +! NAME +! H5Lexists_f ! -! Inputs: -! loc_id - Identifier of the file or group to query. -! name - Link name to check +! PURPOSE +! Check if a link with a particular name exists in a group. ! -! Outputs: -! link_exists - link exists status (.TRUE.,.FALSE.) -! hdferr - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! lapl_id - Link access property list identifier. +! INPUTS +! loc_id - Identifier of the file or group to query. +! name - Link name to check ! -! Programmer: M. S. Breitenfeld -! February 29, 2008 +! OUTPUTS +! link_exists - link exists status (.TRUE.,.FALSE.) +! hdferr - Returns 0 if successful and -1 if fails +! OPTIONAL PARAMETERS +! lapl_id - Link access property list identifier. ! -! Modifications: N/A +! AUTHOR +! M. Scot Breitenfeld +! February 29, 2008 ! -!---------------------------------------------------------------------- +! SOURCE SUBROUTINE h5lexists_f(loc_id, name, link_exists, hdferr, lapl_id) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: loc_id ! Identifier of the file or group to query. @@ -527,12 +528,11 @@ CONTAINS ! 0 on success and -1 on failure INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list identifier. +!***** INTEGER :: link_exists_c INTEGER(HID_T) :: lapl_id_default INTEGER(SIZE_T) :: namelen -! -! MS FORTRAN needs explicit interface for C functions called here. -! + INTERFACE INTEGER FUNCTION h5lexists_c(loc_id, name, namelen, lapl_id_default, link_exists_c) USE H5GLOBAL @@ -561,46 +561,50 @@ CONTAINS END SUBROUTINE h5lexists_f -!---------------------------------------------------------------------- -! Name: h5lget_info_f -! -! Purpose: Returns information about a link. -! -! Inputs: -! link_loc_id - File or group identifier. -! link_name - Name of the link for which information is being sought -! -! Outputs: NOTE: In C these are contained in the structure H5L_info_t -! -! cset - indicates the character set used for link’s name. -! corder - specifies the link’s creation order position. -!f_corder_valid - indicates whether the value in corder is valid. -! link_type - specifies the link class: -! H5L_TYPE_HARD_F - Hard link -! H5L_TYPE_SOFT_F - Soft link -! H5L_TYPE_EXTERNAL_F - External link -! H5L_TYPE_ERROR_F - Error -! address - If the link is a hard link, address specifies the file address that the link points to -! val_size - If the link is a symbolic link, val_size will be the length of the link value, e.g., -! the length of the name of the pointed-to object with a null terminator. -! hdferr - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! lapl_id - Link access property list -! -! Programmer: M. S. Breitenfeld -! February 29, 2008 -! -! Modifications: +! +!****s* H5L/h5lget_info_f +! +! NAME +! h5lget_info_f +! +! PURPOSE +! Returns information about a link. +! +! INPUTS +! link_loc_id - File or group identifier. +! link_name - Name of the link for which information is being sought +! +! OUTPUTS +! NOTE: In C these are contained in the structure H5L_info_t +! +! cset - indicates the character set used for link’s name. +! corder - specifies the link’s creation order position. +! corder_valid - indicates whether the value in corder is valid. +! link_type - specifies the link class: +! H5L_TYPE_HARD_F - Hard link +! H5L_TYPE_SOFT_F - Soft link +! H5L_TYPE_EXTERNAL_F - External link +! H5L_TYPE_ERROR_ F - Error +! address - If the link is a hard link, address specifies the file address that the link points to +! val_size - If the link is a symbolic link, val_size will be the length of the link value, e.g., +! the length of the name of the pointed-to object with a null terminator. +! hdferr - Returns 0 if successful and -1 if fails +! +! OPTIONAL PARAMETERS +! lapl_id - Link access property list +! +! AUTHOR +! M. Scot Breitenfeld +! February 29, 2008 +! +! HISTORY ! Changed the link_type names to match those in C (bug 1720) from, ! H5L_LINK_HARD_F, H5L_LINK_SOFT_F,H5L_LINK_EXTERNAL_F,H5L_LINK_ERROR_F ! to ! H5L_TYPE_HARD_F, H5L_TYPE_SOFT_F,H5L_TYPE_EXTERNAL_F,H5L_TYPE_ERROR_F ! MSB January 8, 2010. ! -!---------------------------------------------------------------------- - +! SOURCE SUBROUTINE h5lget_info_f(link_loc_id, link_name, & cset, corder, f_corder_valid, link_type, address, val_size, & hdferr, lapl_id) @@ -609,7 +613,7 @@ CONTAINS INTEGER(HID_T), INTENT(IN) :: link_loc_id ! File or group identifier. CHARACTER(LEN=*), INTENT(IN) :: link_name ! Name of the link for which information is being sought -! Outputs: NOTE: In C these are contained in the structure H5L_info_t +! OUTPUTS NOTE: In C these are contained in the structure H5L_info_t INTEGER, INTENT(OUT) :: cset ! Indicates the character set used for the link’s name. INTEGER, INTENT(OUT) :: corder ! Specifies the link’s creation order position. LOGICAL, INTENT(OUT) :: f_corder_valid ! Indicates whether the value in corder is valid. @@ -618,19 +622,17 @@ CONTAINS ! H5L_TYPE_SOFT_F - Soft link ! H5L_TYPE_EXTERNAL_F - External link ! H5L_TYPE_ERROR _F - Error - INTEGER(HADDR_T), INTENT(OUT) :: address ! If the link is a hard link, address specifies the file address that the link points to - INTEGER(SIZE_T), INTENT(OUT) :: val_size ! If the link is a symbolic link, val_size will be the length of the link value, e.g., - ! the length of the name of the pointed-to object with a null terminator. + INTEGER(HADDR_T), INTENT(OUT) :: address ! If the link is a hard link, address specifies the file address that the link points to + INTEGER(SIZE_T), INTENT(OUT) :: val_size ! If the link is a symbolic link, val_size will be the length of the link value, e.g., + ! the length of the name of the pointed-to object with a null terminator. INTEGER, INTENT(OUT) :: hdferr ! Error code: ! 0 on success and -1 on failure INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list - +!***** INTEGER(SIZE_T) :: link_namelen INTEGER(HID_T) :: lapl_id_default INTEGER :: corder_valid -! MS FORTRAN needs explicit interface for C functions called here. -! INTERFACE INTEGER FUNCTION h5lget_info_c(link_loc_id, link_name, link_namelen, & cset, corder, corder_valid, link_type, address, val_size, & @@ -668,46 +670,51 @@ CONTAINS END SUBROUTINE h5lget_info_f -!---------------------------------------------------------------------- -! Name: h5lget_info_by_idx_f -! -! Purpose: Retrieves metadata for a link in a group, according to the order within a field or index. -! -! Inputs: -! loc_id - File or group identifier specifying location of subject group -! group_name - Name of subject group -! index_field - Index or field which determines the order -! order - Order within field or index -! n - Link for which to retrieve information -! -! Outputs: NOTE: In C these are defined as a structure: H5L_info_t -! corder_valid - indicates whether the creation order data is valid for this attribute -! corder - is a positive integer containing the creation order of the attribute -! cset - indicates the character set used for the attribute’s name -! address - If the link is a hard link, address specifies the file address that the link points to -! val_size - If the link is a symbolic link, val_size will be the length of the link value, e.g., -! the length of the name of the pointed-to object with a null terminator. -! hdferr - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! lapl_id - Link access property list -! -! Programmer: M.S. Breitenfeld -! February 29, 2008 -! -! Modifications: +! +!****s* H5L/h5lget_info_by_idx_f +! +! NAME +! h5lget_info_by_idx_f +! +! PURPOSE +! Retrieves metadata for a link in a group, according to the order within a field or index. +! +! INPUTS +! loc_id - File or group identifier specifying location of subject group +! group_name - Name of subject group +! index_field - Index or field which determines the order +! order - Order within field or index +! n - Link for which to retrieve information +! +! OUTPUTS +! NOTE: In C these are defined as a structure: H5L_info_t +! corder_valid - Indicates whether the creation order data is valid for this attribute +! corder - Is a positive integer containing the creation order of the attribute +! cset - Indicates the character set used for the attribute’s name +! address - If the link is a hard link, address specifies the file address that the link points to +! val_size - If the link is a symbolic link, val_size will be the length of the link value, e.g., +! the length of the name of the pointed-to object with a null terminator. +! hdferr - Returns 0 if successful and -1 if fails +! +! OPTIONAL PARAMETERS +! lapl_id - Link access property list +! +! AUTHOR +! M. Scot Breitenfeld +! February 29, 2008 +! +! HISTORY ! Changed the link_type names to match those in C (bug 1720) from, ! H5L_LINK_HARD_F, H5L_LINK_SOFT_F,H5L_LINK_EXTERNAL_F,H5L_LINK_ERROR_F ! to ! H5L_TYPE_HARD_F, H5L_TYPE_SOFT_F,H5L_TYPE_EXTERNAL_F,H5L_TYPE_ERROR_F -! MSB January 8, 2010. +! MSB January 8, 2010. ! -!---------------------------------------------------------------------- +! SOURCE SUBROUTINE h5lget_info_by_idx_f(loc_id, group_name, index_field, order, n, & link_type, f_corder_valid, corder, cset, address, val_size, hdferr, lapl_id) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier specifying location of subject group + INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier specifying location of subject group CHARACTER(LEN=*), INTENT(IN) :: group_name ! Name of subject group INTEGER, INTENT(IN) :: index_field ! Index or field which determines the order ! H5_INDEX_UNKNOWN_F - Unknown index type @@ -725,15 +732,16 @@ CONTAINS ! H5L_TYPE_SOFT_F - Soft link ! H5L_TYPE_EXTERNAL_F - External link ! H5L_TYPE_ERROR _F - Error - LOGICAL, INTENT(OUT) :: f_corder_valid ! Indicates whether the creation order data is valid for this attribute - INTEGER, INTENT(OUT) :: corder ! Is a positive integer containing the creation order of the attribute - INTEGER, INTENT(OUT) :: cset ! Indicates the character set used for the attribute’s name + LOGICAL, INTENT(OUT) :: f_corder_valid ! Indicates whether the creation order data is valid for this attribute + INTEGER, INTENT(OUT) :: corder ! Is a positive integer containing the creation order of the attribute + INTEGER, INTENT(OUT) :: cset ! Indicates the character set used for the attribute’s name INTEGER(HADDR_T), INTENT(OUT) :: address ! If the link is a hard link, address specifies the file address that the link points to - INTEGER(SIZE_T), INTENT(OUT) :: val_size ! If the link is a symbolic link, val_size will be the length of the link value, e.g., - ! the length of the name of the pointed-to object with a null terminator. + INTEGER(SIZE_T), INTENT(OUT) :: val_size ! If the link is a symbolic link, val_size will be the length of the link value, e.g., + ! the length of the name of the pointed-to object with a null terminator. INTEGER, INTENT(OUT) :: hdferr ! Error code: ! 0 on success and -1 on failure INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list +!***** INTEGER :: corder_valid INTEGER(SIZE_T) :: group_namelen INTEGER(HID_T) :: lapl_id_default @@ -755,7 +763,7 @@ CONTAINS INTEGER, INTENT(IN) :: order INTEGER(HSIZE_T), INTENT(IN) :: n INTEGER, INTENT(OUT) :: link_type - INTEGER :: corder_valid + INTEGER :: corder_valid INTEGER, INTENT(OUT) :: corder INTEGER, INTENT(OUT) :: cset INTEGER(HADDR_T), INTENT(OUT) :: address @@ -777,29 +785,30 @@ CONTAINS END SUBROUTINE h5lget_info_by_idx_f -!---------------------------------------------------------------------- -! Name: h5lis_registered_f ! -! Purpose: Determines whether a class of user-defined links is registered. +!****s* H5L/h5lis_registered_f ! -! Inputs: -! link_cls_id - User-defined link class identifier +! NAME +! h5lis_registered_f ! -! Outputs: -! registered - .TRUE. - if the link class has been registered -! .FALSE. - if it is unregistered -! hdferr - Error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! None +! PURPOSE +! Determines whether a class of user-defined links is registered. ! -! Programmer: M.S. Breitenfeld -! February 29, 2008 +! INPUTS +! link_cls_id - User-defined link class identifier ! -! Modifications: N/A +! OUTPUTS +! registered - .TRUE. - if the link class has been registered +! .FALSE. - if it is unregistered +! hdferr - Error code +! Success: 0 +! Failure: -1 ! -!---------------------------------------------------------------------- +! AUTHOR +! M. Scot Breitenfeld +! February 29, 2008 +! +! SOURCE SUBROUTINE h5lis_registered_f(link_cls_id, registered, hdferr) IMPLICIT NONE INTEGER, INTENT(IN) :: link_cls_id ! User-defined link class identifier @@ -807,9 +816,7 @@ CONTAINS ! .FALSE. - if it is unregistered INTEGER, INTENT(OUT) :: hdferr ! Error code: ! 0 on success and -1 on failure -! -! MS FORTRAN needs explicit interface for C functions called here. -! +!***** INTERFACE INTEGER FUNCTION h5lis_registered_c(link_cls_id) USE H5GLOBAL @@ -830,31 +837,34 @@ CONTAINS END SUBROUTINE h5lis_registered_f -!---------------------------------------------------------------------- -! Name: h5lmove_f ! -! Purpose: Renames a link within an HDF5 file. +!****s* H5L/h5lmove_f +! +! NAME +! h5lmove_f +! +! PURPOSE +! Renames a link within an HDF5 file. ! -! Inputs: -! src_loc_id - Original file or group identifier. -! src_name - Original link name. -! dest_loc_id - Destination file or group identifier. -! dest_name - NEW link name. +! INPUTS +! src_loc_id - Original file or group identifier. +! src_name - Original link name. +! dest_loc_id - Destination file or group identifier. +! dest_name - NEW link name. ! -! Outputs: -! hdferr - Error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! lcpl_id - Link creation property list identifier to be associated WITH the NEW link. -! lapl_id - Link access property list identifier to be associated WITH the NEW link. +! OUTPUTS +! hdferr - Error code: +! 0 on success and -1 on failure ! -! Programmer: M.S. Breitenfeld -! March 3, 2008 +! OPTIONAL PARAMETERS +! lcpl_id - Link creation property list identifier to be associated WITH the NEW link. +! lapl_id - Link access property list identifier to be associated WITH the NEW link. ! -! Modifications: N/A +! AUTHOR +! M. Scot Breitenfeld +! March 3, 2008 ! -!---------------------------------------------------------------------- +! SOURCE SUBROUTINE h5lmove_f(src_loc_id, src_name, dest_loc_id, dest_name, hdferr, lcpl_id, lapl_id) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: src_loc_id ! Original file or group identifier. @@ -867,16 +877,13 @@ CONTAINS ! to be associated WITH the NEW link. INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list identifier ! to be associated WITH the NEW link. - +!***** INTEGER(SIZE_T) :: src_namelen INTEGER(SIZE_T) :: dest_namelen INTEGER(HID_T) :: lcpl_id_default INTEGER(HID_T) :: lapl_id_default -! -! MS FORTRAN needs explicit interface for C functions called here. -! INTERFACE INTEGER FUNCTION h5lmove_c(src_loc_id, src_name, src_namelen, dest_loc_id, & dest_name, dest_namelen, lcpl_id_default, lapl_id_default) @@ -886,6 +893,7 @@ CONTAINS !DEC$ENDIF !DEC$ATTRIBUTES reference :: src_name, dest_name INTEGER(HID_T), INTENT(IN) :: src_loc_id + CHARACTER(LEN=*), INTENT(IN) :: src_name INTEGER(SIZE_T) :: src_namelen INTEGER(HID_T), INTENT(IN) :: dest_loc_id @@ -911,34 +919,35 @@ CONTAINS END SUBROUTINE h5lmove_f -!---------------------------------------------------------------------- -! Name: h5lget_name_by_idx_f ! -! Purpose: Retrieves name of the nth link in a group, according to the order within a specified field or index. +!****s* H5L/h5lget_name_by_idx_f +! +! NAME +! h5lget_name_by_idx_f ! -! Inputs: -! loc_id - File or group identifier specifying location of subject group -! group_name - Name of subject group -! index_field - Index or field which determines the order -! order - Order within field or index -! n - Link for which to retrieve information +! PURPOSE +! Retrieves name of the nth link in a group, according to the order within a specified field or index. ! -! Outputs: -! name - Buffer in which link value is returned -! hdferr - error code -! Success: 0 -! Failure: -1 +! INPUTS +! loc_id - File or group identifier specifying location of subject group +! group_name - Name of subject group +! index_field - Index or field which determines the order +! order - Order within field or index +! n - Link for which to retrieve information ! -! Optional parameters: -! lapl_id - List access property list identifier. -! size - Maximum number of characters of link value to be returned. +! OUTPUTS +! name - Buffer in which link value is returned +! hdferr - Returns 0 if successful and -1 if fails ! -! Programmer: M. S. Breitenfeld -! March 10, 2008 +! OPTIONAL PARAMETERS +! lapl_id - List access property list identifier. +! size - Maximum number of characters of link value to be returned. ! -! Modifications: N/A +! AUTHOR +! M. Scot Breitenfeld +! March 10, 2008 ! -!---------------------------------------------------------------------- +! SOURCE SUBROUTINE h5lget_name_by_idx_f(loc_id, group_name, index_field, order, n, & name, hdferr, size, lapl_id) IMPLICIT NONE @@ -958,16 +967,13 @@ CONTAINS CHARACTER(LEN=*), INTENT(OUT) :: name ! Buffer in which link value is returned INTEGER, INTENT(OUT) :: hdferr ! Error code: ! 0 on success and -1 on failure - +!***** INTEGER(SIZE_T) :: group_namelen INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list INTEGER(HID_T) :: lapl_id_default INTEGER(SIZE_T), OPTIONAL, INTENT(OUT) :: size ! Indicates the size, in the number of characters, of the link INTEGER(SIZE_T) :: size_default - -! MS FORTRAN needs explicit interface for C functions called here. -! INTERFACE INTEGER FUNCTION h5lget_name_by_idx_c(loc_id, group_name, group_namelen, index_field, order, n, & size_default, name, lapl_id_default) @@ -977,6 +983,7 @@ CONTAINS !DEC$ENDIF !DEC$ATTRIBUTES reference :: group_name, name INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(LEN=*), INTENT(IN) :: group_name INTEGER(SIZE_T) :: group_namelen INTEGER, INTENT(IN) :: index_field @@ -1004,24 +1011,27 @@ CONTAINS END SUBROUTINE h5lget_name_by_idx_f -! HAS PROBLEM WITH void pointer in C - -!!$!---------------------------------------------------------------------- -!!$! Name: h5lget_val_by_idx_f +! HAS PROBLEM WITH void pointer in C !!$! -!!$! Purpose: Returns the link value of a link, according to the order of +!!$!****s* H5L/ +!!$! +!!$! NAME +!!$! h5lget_val_by_idx_f +!!$! +!!$! PURPOSE +!!$! Returns the link value of a link, according to the order of !!$! an index. For symbolic links, this is the path to which the !!$! link points, including the null terminator. For user-defined !!$! links, it is the link buffer. -!!$! Inputs: +!!$! INPUTS !!$! loc_id - File or group identifier specifying location of subject group !!$! group_name - Name of subject group !!$! index_field - Index or field which determines the order !!$! order - Order within field or index !!$! n - Link for which to retrieve information -!!$! size - Maximum number of characters of link value to be returned. +!!$! size - Maximum number of characters of link value to be returned. !!$! -!!$! Outputs: NOTE: In C these are defined as a structure: H5L_info_t +!!$! OUTPUTS NOTE: In C these are defined as a structure: H5L_info_t !!$! corder_valid - indicates whether the creation order data is valid for this attribute !!$! corder - is a positive integer containing the creation order of the attribute !!$! cset - indicates the character set used for the attribute’s name @@ -1029,15 +1039,17 @@ CONTAINS !!$! hdferr - error code !!$! Success: 0 !!$! Failure: -1 -!!$! Optional parameters: +!!$! OPTIONAL PARAMETERS !!$! lapl_id - List access property list identifier. !!$! -!!$! Programmer: M. S. Breitenfeld +!!$! AUTHOR +!!$! M. Scot Breitenfeld !!$! March 3, 2008 !!$! -!!$! Modifications: N/A +!!$! HISTORY N/A !!$! -!!$!---------------------------------------------------------------------- +!!$! +!!$! SOURCE !!$ SUBROUTINE h5lget_val_by_idx_f(loc_id, group_name, index_field, order, n, & !!$ f_corder_valid, corder, cset, data_size, hdferr, lapl_id) !!$ IMPLICIT NONE @@ -1065,8 +1077,6 @@ CONTAINS !!$ INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link access property list !!$ INTEGER(HID_T) :: lapl_id_default !!$ -!!$! MS FORTRAN needs explicit interface for C functions called here. -!!$! !!$ INTERFACE !!$ 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) @@ -1101,33 +1111,32 @@ CONTAINS !!$ !!$ END SUBROUTINE h5lget_val_by_idx_f - - -!---------------------------------------------------------------------- -! Name: h5lget_val_f -! -! Purpose: Returns the value of a symbolic link. -! -! Inputs: -! link_loc_id - File or group identifier. -! link_name - Link whose value is to be returned. -! size - Maximum number of characters of link value to be returned. -! -! Outputs: -! linkval_buff - The buffer to hold the returned link value. -! hdferr - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! lapl_id - List access property list identifier. -! -! Programmer: M. S. Breitenfeld -! March 3, 2008 -! -! Modifications: N/A -! -!---------------------------------------------------------------------- - +!!$! +!!$!****s* H5L/h5lget_val_f +!!$! +!!$! NAME +!!$! h5lget_val_f +!!$! +!!$! PURPOSE +!!$! Returns the value of a symbolic link. +!!$! +!!$! INPUTS +!!$! link_loc_id - File or group identifier. +!!$! link_name - Link whose value is to be returned. +!!$! size - Maximum number of characters of link value to be returned. +!!$! +!!$! OUTPUTS +!!$! linkval_buff - The buffer to hold the returned link value. +!!$! hdferr - error code +!!$! Success: 0 +!!$! Failure: -1 +!!$! OPTIONAL PARAMETERS +!!$! lapl_id - List access property list identifier. +!!$! +!!$! AUTHOR +!!$! M. Scot Breitenfeld +!!$! March 3, 2008 +!!$! SOURCE !!$ SUBROUTINE h5lget_val_f(link_loc_id, link_name, size, linkval_buff, & !!$ hdferr, lapl_id) !!$ IMPLICIT NONE @@ -1179,37 +1188,41 @@ CONTAINS !!$ !!$ END SUBROUTINE h5lget_val_f - - -!---------------------------------------------------------------------- -! Name: H5Lregistered_f -! -! Purpose: Registers user-defined link class or changes behavior of existing class. -! -! Inputs: NOTE: In C the following represents struct H5L_class_t: -! version - Version number of this struct -! class_id - Link class identifier -! comment - Comment for debugging -! create_func - Callback during link creation -! move_func - Callback after moving link -! copy_func - Callback after copying link -! trav_func - The main traversal function -! del_func - Callback for link deletion -! query_func - Callback for queries -! -! Outputs: -! hdferr - Error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! None -! -! Programmer: M.S. Breitenfeld -! February 29, 2008 -! -! Modifications: N/A -! -!---------------------------------------------------------------------- +!!$! +!!$!****s* H5L/H5Lregistered_f +!!$! +!!$! NAME +!!$! H5Lregistered_f +!!$! +!!$! PURPOSE +!!$! Registers user-defined link class or changes behavior of existing class. +!!$! +!!$! INPUTS NOTE: In C the following represents struct H5L_class_t: +!!$! version - Version number of this struct +!!$! class_id - Link class identifier +!!$! comment - Comment for debugging +!!$! create_func - Callback during link creation +!!$! move_func - Callback after moving link +!!$! copy_func - Callback after copying link +!!$! trav_func - The main traversal function +!!$! del_func - Callback for link deletion +!!$! query_func - Callback for queries +!!$! +!!$! OUTPUTS +!!$! hdferr - Error code +!!$! Success: 0 +!!$! Failure: -1 +!!$! OPTIONAL PARAMETERS +!!$! None +!!$! +!!$! AUTHOR +!!$! M. Scot Breitenfeld +!!$! February 29, 2008 +!!$! +!!$! HISTORY N/A +!!$! +!!$! +!!$! SOURCE !!$ SUBROUTINE H5Lregistered_f(version, class_id, comment, create_func, & !!$ move_func, copy_func, trav_func, del_func, query_func, hdferr) !!$ IMPLICIT NONE @@ -1232,9 +1245,6 @@ CONTAINS !!$ INTEGER :: del_func_len !!$ INTEGER :: query_func_len !!$ -!!$! -!!$! MS FORTRAN needs explicit interface for C functions called here. -!!$! !!$ INTERFACE !!$ INTEGER FUNCTION H5Lregistered_c(version, class_id, comment, & !!$ create_func, create_func_len, & diff --git a/fortran/src/H5Lff_F03.f90 b/fortran/src/H5Lff_F03.f90 new file mode 100644 index 0000000..e2c54a7 --- /dev/null +++ b/fortran/src/H5Lff_F03.f90 @@ -0,0 +1,245 @@ +!****h* ROBODoc/H5L (F03) +! +! NAME +! H5L_PROVISIONAL +! +! FILE +! src/fortran/src/H5Lff_F03.f90 +! +! PURPOSE +! +! This file contains Fortran 90 and Fortran 2003 interfaces for H5L functions. +! It contains the same functions as H5Lff_F90.f90 but includes the +! Fortran 2003 functions and the interface listings. This file will be compiled +! instead of H5Lff_F90.f90 if Fortran 2003 functions are enabled. +! +! COPYRIGHT +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +! NOTES +! *** IMPORTANT *** +! If you add a new H5A function you must add the function name to the +! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! This is needed for Windows based operating systems. +! +!***** + +MODULE H5L_PROVISIONAL + + USE H5GLOBAL + USE ISO_C_BINDING + + IMPLICIT NONE + +!****t* H5L (F03)/h5l_info_t +! +! Fortran2003 Derived Type: +! + TYPE, bind(c) :: union_t + INTEGER(haddr_t) :: address + INTEGER(size_t) :: val_size + END TYPE union_t + + TYPE, bind(c) :: h5l_info_t + INTEGER(c_int) :: type ! H5L_type_t type +! LOGICAL(c_bool) :: corder_valid ! hbool_t corder_valid + INTEGER(c_int64_t) :: corder ! int64_t corder; + INTEGER(c_int) :: cset ! H5T_cset_t cset; + TYPE(union_t) :: u + END TYPE h5l_info_t + +!***** + +!type specifies the link class. Valid values include the following: +! H5L_TYPE_HARD Hard link +! H5L_TYPE_SOFT Soft link +! H5L_TYPE_EXTERNAL External link +! H5L_TYPE_ERROR Error +!cset specifies the character set in which the link name is encoded. Valid values include the following: +! H5T_CSET_ASCII US ASCII +! H5T_CSET_UTF8 UTF-8 Unicode encoding + +CONTAINS + +!****s* H5L (F03)/h5literate_f +! +! NAME +! h5literate_f +! +! PURPOSE +! Iterates through links in a group. +! +! Inputs: +! group_id - Identifier specifying subject group +! index_type - Type of index which determines the order: +! H5_INDEX_NAME_F - Alpha-numeric index on name +! H5_INDEX_CRT_ORDER_F - Index on creation order +! order - Order within index: +! H5_ITER_INC_F - Increasing order +! H5_ITER_DEC_F - Decreasing order +! H5_ITER_NATIVE_F - Fastest available order +! idx - IN: Iteration position at which to start +! op - Callback function passing data regarding the link to the calling application +! op_data - User-defined pointer to data required by the application for its processing of the link +! +! Outputs: +! idx - OUT: Position at which an interrupted iteration may be restarted +! return_value - 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. +! +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! M. Scot Breitenfeld +! July 8, 2008 +! +! Fortran2003 Interface: + SUBROUTINE h5literate_f(group_id, index_type, order, idx, op, op_data, return_value, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T) , INTENT(IN) :: group_id + INTEGER , INTENT(IN) :: index_type + INTEGER , INTENT(IN) :: order + INTEGER(HSIZE_T), INTENT(INOUT) :: idx + TYPE(C_FUNPTR) , INTENT(IN) :: op + TYPE(C_PTR) , INTENT(IN) :: op_data + INTEGER , INTENT(OUT) :: return_value + INTEGER , INTENT(OUT) :: hdferr +!***** + INTERFACE + INTEGER FUNCTION h5literate_c(group_id, index_type, order, idx, op, op_data) + USE, INTRINSIC :: ISO_C_BINDING + USE H5GLOBAL + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LITERATE_C'::h5literate_c + !DEC$ENDIF + INTEGER(HID_T), INTENT(IN) :: group_id + INTEGER, INTENT(IN) :: index_type + INTEGER, INTENT(IN) :: order + INTEGER(HSIZE_T), INTENT(INOUT) :: idx + TYPE(C_FUNPTR), VALUE :: op + TYPE(C_PTR), VALUE :: op_data + END FUNCTION h5literate_c + END INTERFACE + + return_value = h5literate_c(group_id, index_type, order, idx, op, op_data) + + IF(return_value.GE.0)THEN + hdferr = 0 + ELSE + hdferr = -1 + END IF + + END SUBROUTINE h5literate_f + +!****s* H5L (F03)/h5literate_by_name_f +! +! NAME +! h5literate_by_name_f +! +! PURPOSE +! Iterates through links in a group. +! +! Inputs: +! loc_id - File or group identifier specifying location of subject group +! group_name - Name of subject group +! index_type - Type of index which determines the order: +! H5_INDEX_NAME_F - Alpha-numeric index on name +! H5_INDEX_CRT_ORDER_F - Index on creation order +! order - Order within index: +! H5_ITER_INC_F - Increasing order +! H5_ITER_DEC_F - Decreasing order +! H5_ITER_NATIVE_F - Fastest available order +! idx - IN: Iteration position at which to start +! op - Callback function passing data regarding the link to the calling application +! op_data - User-defined pointer to data required by the application for its processing of the link +! +! Outputs: +! idx - OUT: Position at which an interrupted iteration may be restarted +! return_value - 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. +! +! hdferr - Returns 0 if successful and -1 if fails +! +! Optional parameters: +! lapl_id - Link access property list +! +! AUTHOR +! M. Scot Breitenfeld +! Augest 18, 2008 +! +! Fortran2003 Interface: + SUBROUTINE h5literate_by_name_f(loc_id, group_name, index_type, order, idx, op, op_data, return_value, hdferr, lapl_id) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T) , INTENT(IN) :: loc_id + CHARACTER(LEN=*), INTENT(IN) :: group_name + INTEGER , INTENT(IN) :: index_type + INTEGER , INTENT(IN) :: order + INTEGER(HSIZE_T), INTENT(INOUT) :: idx + TYPE(C_FUNPTR) , INTENT(IN) :: op + TYPE(C_PTR) , INTENT(IN) :: op_data + INTEGER , INTENT(OUT) :: return_value + INTEGER , INTENT(OUT) :: hdferr + INTEGER(HID_T) , INTENT(IN), OPTIONAL :: lapl_id +!***** + INTEGER(HID_T) :: lapl_id_default + INTEGER(SIZE_T) :: namelen + + INTERFACE + INTEGER FUNCTION h5literate_by_name_c(loc_id, name, namelen, index_type, order, idx, op, op_data, lapl_id_default) + USE, INTRINSIC :: ISO_C_BINDING + USE H5GLOBAL + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LITERATE_BY_NAME_C'::h5literate_by_name_c + !DEC$ENDIF + INTEGER(HID_T) , INTENT(IN) :: loc_id + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER(SIZE_T) , INTENT(IN) :: namelen + INTEGER , INTENT(IN) :: index_type + INTEGER , INTENT(IN) :: order + INTEGER(HSIZE_T), INTENT(INOUT) :: idx + TYPE(C_FUNPTR), VALUE :: op + TYPE(C_PTR), VALUE :: op_data + INTEGER(HID_T) , INTENT(IN) :: lapl_id_default + END FUNCTION + END INTERFACE + + namelen = LEN(group_name) + lapl_id_default = H5P_DEFAULT_F + IF(PRESENT(lapl_id)) lapl_id_default = lapl_id + + return_value = h5literate_by_name_c(loc_id, group_name, namelen, index_type, order, idx, op, op_data, lapl_id_default) + + IF(return_value.GE.0)THEN + hdferr = 0 + ELSE + hdferr = -1 + END IF + + END SUBROUTINE h5literate_by_name_f + +END MODULE H5L_PROVISIONAL diff --git a/fortran/src/H5Lff_F90.f90 b/fortran/src/H5Lff_F90.f90 new file mode 100644 index 0000000..c802af7 --- /dev/null +++ b/fortran/src/H5Lff_F90.f90 @@ -0,0 +1,39 @@ +!****h* ROBODoc/H5L (F90) +! +! NAME +! MODULE H5L_PROVISIONAL +! +! PURPOSE +! This file contains Fortran 90 interfaces for H5L functions. It contains +! the same functions as H5Lff_F03.f90 but excludes the Fortran 2003 functions +! and the interface listings. This file will be compiled instead of H5Lff_F03.f90 +! if Fortran 2003 functions are not enabled. +! +! NOTE +! Currently contains no functions. +! +! COPYRIGHT +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +! *** IMPORTANT *** +! If you add a new H5D function you must add the function name to the +! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! This is needed for Windows based operating systems. +!***** + +MODULE H5L_PROVISIONAL + +END MODULE H5L_PROVISIONAL diff --git a/fortran/src/H5Of.c b/fortran/src/H5Of.c index 56cbfeb..0df433a 100644 --- a/fortran/src/H5Of.c +++ b/fortran/src/H5Of.c @@ -1,4 +1,9 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +/****h* H5Of/H5Of + * PURPOSE + * This file contains C stubs for H5O Fortran APIs + * + * COPYRIGHT + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * @@ -11,32 +16,37 @@ * is linked from the top-level documents page. It can also be found at * * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * * access to either file, you may request a copy from help@hdfgroup.org. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -/* This files contains C stubs for H5O Fortran APIs */ + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * + ****** +*/ #include "H5f90.h" #include "H5Eprivate.h" -/*---------------------------------------------------------------------------- - * Name: h5olink_c - * Purpose: Calls H5Olink - * Inputs: +/****if* H5Of/h5olink_c + * NAME + * h5olink_c + * PURPOSE + * Calls H5Olink + * INPUTS * object_id - Object to be linked. * new_loc_id - File or group identifier specifying location at which object is to be linked. * name - Name of link to be created, relative to new_loc_id. * namelen - Length of buffer for link to be created. * lcpl_id - Link creation property list identifier. * lapl_id - Link access property list identifier. - * Outputs: - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld - * April 21, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld + * April 21, 2008 + * SOURCE +*/ int_f nh5olink_c (hid_t_f *object_id, hid_t_f *new_loc_id, _fcd name, size_t_f *namelen, hid_t_f *lcpl_id, hid_t_f *lapl_id) +/******/ { char *c_name = NULL; /* Buffer to hold C string */ int_f ret_value = 0; /* Return value */ @@ -60,21 +70,28 @@ nh5olink_c (hid_t_f *object_id, hid_t_f *new_loc_id, _fcd name, size_t_f *namele return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5oopen_c - * Purpose: Calls H5Oopen - * Inputs: loc_id - File or group identifier - * name - Attribute access property list - * namelen - Size of name - * lapl_id - Link access property list - * Outputs: obj_id - Dataset identifier - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld - * April 18, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ +/****if* H5Of/h5oopen_c + * NAME + * h5oopen_c + * PURPOSE + * Calls H5Oopen + * INPUTS + * loc_id - File or group identifier + * name - Attribute access property list + * namelen - Size of name + * lapl_id - Link access property list + * OUTPUTS + * obj_id - Dataset identifier + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld + * April 18, 2008 + * SOURCE +*/ int_f nh5oopen_c (hid_t_f *loc_id, _fcd name, size_t_f *namelen, hid_t_f *lapl_id, hid_t_f *obj_id) +/******/ { char *c_name = NULL; /* Buffer to hold C string */ int_f ret_value = 0; /* Return value */ @@ -96,20 +113,95 @@ nh5oopen_c (hid_t_f *loc_id, _fcd name, size_t_f *namelen, hid_t_f *lapl_id, hid HDfree(c_name); return ret_value; } +/****if* H5Of/h5oclose_c + * NAME + * h5oclose_c + * PURPOSE + * Call H5Oclose + * INPUTS + * object_id - Object identifier + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld + * December 17, 2008 + * SOURCE +*/ +int_f +nh5oclose_c ( hid_t_f *object_id ) +/******/ +{ + int_f ret_value=0; /* Return value */ + + if (H5Oclose((hid_t)*object_id) < 0) + HGOTO_DONE(FAIL); + + done: + return ret_value; +} + +/****if* H5Of/h5ovisit_c + * NAME + * h5ovisit_c + * PURPOSE + * Calls H5Ovisit + * INPUTS + * object_id - Identifier specifying subject group + * index_type - Type of index which determines the order + * order - Order within index + * idx - Iteration position at which to start + * op - Callback function passing data regarding the link to the calling application + * op_data - User-defined pointer to data required by the application for its processing of the link + * + * OUTPUTS + * idx - Position at which an interrupted iteration may be restarted + * + * RETURNS + * >0 on success, 0< on failure + * AUTHOR + * M. Scot Breitenfeld + * November 19, 2008 + * SOURCE +*/ +int_f +nh5ovisit_c(hid_t_f *group_id, int_f *index_type, int_f *order, H5O_iterate_t op, void *op_data ) +/******/ +{ + int_f ret_value = -1; /* Return value */ + herr_t func_ret_value; /* H5Linterate return value */ + + /* + * Call H5Ovisit + */ + func_ret_value = H5Ovisit( (hid_t)*group_id, (H5_index_t)*index_type, (H5_iter_order_t)*order, op, op_data); + + ret_value = (int_f)func_ret_value; + + return ret_value; +} -/*---------------------------------------------------------------------------- - * Name: h5oopen_by_addr_c - * Purpose: Calls H5open_by_addr - * Inputs: loc_id - File or group identifier - * addr - Object’s address in the file - * Outputs: obj_id - Dataset identifier - * Returns: 0 on success, -1 on failure - * Programmer: M. Scot Breitenfeld - * September 14, 2009 - * Modifications: - *---------------------------------------------------------------------------*/ +/****if* H5Of/h5oopen_by_addr_c + * NAME + * h5oopen_by_addr_c + * PURPOSE + * Calls H5open_by_addr + * INPUTS + * loc_id - File or group identifier + * addr - Object’s address in the file + * + * OUTPUTS + * obj_id - Dataset identifier + * + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld + * September 14, 2009 + * SOURCE +*/ int_f nh5oopen_by_addr_c (hid_t_f *loc_id, haddr_t_f *addr, hid_t_f *obj_id) +/******/ { int_f ret_value = 0; /* Return value */ @@ -122,3 +214,123 @@ nh5oopen_by_addr_c (hid_t_f *loc_id, haddr_t_f *addr, hid_t_f *obj_id) done: return ret_value; } + +/* ***if* H5Of/H5Oget_info_by_name_c + * NAME + * H5Oget_info_by_name_c + * PURPOSE + * Calls H5Oget_info_by_name + * INPUTS + * loc_id - File or group identifier specifying location of group in which object is located. + * name - Name of group, relative to loc_id. + * namelen - Name length. + * lapl_id - Link access property list. + * OUTPUTS + * corder_valid - Indicates whether the the creation order data is valid for this attribute. + * corder - Is a positive integer containing the creation order of the attribute. + * cset - Indicates the character set used for the attribute’s name. + * data_size - indicates the size, in the number of characters, of the attribute. + * + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld + * December 1, 2008 + * SOURCE +*/ +int_f +nh5oget_info_by_name_c (hid_t_f *loc_id, _fcd name, size_t_f *namelen, hid_t_f *lapl_id, + H5O_info_t_f *object_info) +/******/ +{ + char *c_name = NULL; /* Buffer to hold C string */ + int_f ret_value = 0; /* Return value */ + H5O_info_t Oinfo; + struct tm *ts; + + /* + * Convert FORTRAN name to C name + */ + if((c_name = HD5f2cstring(name, (size_t)*namelen)) == NULL) + HGOTO_DONE(FAIL); + + /* + * Call H5Oinfo_by_name function. + */ + if(H5Oget_info_by_name((hid_t)*loc_id, c_name, + &Oinfo, (hid_t)*lapl_id) < 0) + HGOTO_DONE(FAIL); + + object_info->fileno = Oinfo.fileno; + object_info->addr = (haddr_t_f)Oinfo.addr; + + + object_info->type = (int_f)Oinfo.type; + object_info->rc = (int_f)Oinfo.rc; + + ts = HDgmtime(&Oinfo.atime); + + object_info->atime[0] = (int_f)ts->tm_year+1900; /* year starts at 1900 */ + object_info->atime[1] = (int_f)ts->tm_mon+1; /* month starts at 0 in C */ + object_info->atime[2] = (int_f)ts->tm_mday; + object_info->atime[3] = 0; /* time is expressed as UTC (or GMT timezone) */ + object_info->atime[4] = (int_f)ts->tm_hour; + object_info->atime[5] = (int_f)ts->tm_min; + object_info->atime[6] = (int_f)ts->tm_sec; + object_info->atime[7] = -32767; /* millisecond is not available, assign it -HUGE(0) */ + + ts = HDgmtime(&Oinfo.btime); + + object_info->btime[0] = (int_f)ts->tm_year+1900; /* year starts at 1900 */ + object_info->btime[1] = (int_f)ts->tm_mon+1; /* month starts at 0 in C */ + object_info->btime[2] = (int_f)ts->tm_mday; + object_info->btime[3] = 0; /* time is expressed as UTC (or GMT timezone) */ + object_info->btime[4] = (int_f)ts->tm_hour; + object_info->btime[5] = (int_f)ts->tm_min; + object_info->btime[6] = (int_f)ts->tm_sec; + object_info->btime[7] = -32767; /* millisecond is not available, assign it -HUGE(0) */ + + ts = HDgmtime(&Oinfo.ctime); + + object_info->ctime[0] = (int_f)ts->tm_year+1900; /* year starts at 1900 */ + object_info->ctime[1] = (int_f)ts->tm_mon+1; /* month starts at 0 in C */ + object_info->ctime[2] = (int_f)ts->tm_mday; + object_info->ctime[3] = 0; /* time is expressed as UTC (or GMT timezone) */ + object_info->ctime[4] = (int_f)ts->tm_hour; + object_info->ctime[5] = (int_f)ts->tm_min; + object_info->ctime[6] = (int_f)ts->tm_sec; + object_info->ctime[7] = -32767; /* millisecond is not available, assign it -HUGE(0) */ + + ts = HDgmtime(&Oinfo.mtime); + + object_info->mtime[0] = (int_f)ts->tm_year+1900; /* year starts at 1900 */ + object_info->mtime[1] = (int_f)ts->tm_mon+1; /* month starts at 0 in C */ + object_info->mtime[2] = (int_f)ts->tm_mday; + object_info->mtime[3] = 0; /* time is expressed as UTC (or GMT timezone) */ + object_info->mtime[4] = (int_f)ts->tm_hour; + object_info->mtime[5] = (int_f)ts->tm_min; + object_info->mtime[6] = (int_f)ts->tm_sec; + object_info->mtime[7] = -32767; /* millisecond is not available, assign it -HUGE(0) */ + + object_info->num_attrs = (hsize_t_f)Oinfo.num_attrs; + + object_info->hdr.version = (int_f)Oinfo.hdr.version; + object_info->hdr.nmesgs = (int_f)Oinfo.hdr.nmesgs; + object_info->hdr.nchunks = (int_f)Oinfo.hdr.nchunks; + object_info->hdr.flags = (int_f)Oinfo.hdr.flags; + + object_info->hdr.space.total = (hsize_t_f)Oinfo.hdr.space.total; + object_info->hdr.space.meta = (hsize_t_f)Oinfo.hdr.space.meta; + object_info->hdr.space.mesg = (hsize_t_f)Oinfo.hdr.space.mesg; + object_info->hdr.space.free = (hsize_t_f)Oinfo.hdr.space.free; + + object_info->hdr.mesg.present = Oinfo.hdr.mesg.present; + object_info->hdr.mesg.shared = Oinfo.hdr.mesg.shared; + + object_info->meta_size.obj.index_size = (hsize_t_f)Oinfo.meta_size.obj.index_size; + object_info->meta_size.obj.heap_size = (hsize_t_f)Oinfo.meta_size.obj.heap_size; + + done: + return ret_value; +} + diff --git a/fortran/src/H5Off.f90 b/fortran/src/H5Off.f90 index af965e2..e69fdb5 100644 --- a/fortran/src/H5Off.f90 +++ b/fortran/src/H5Off.f90 @@ -1,3 +1,18 @@ +!****h* ROBODoc/H5O +! +! NAME +! MODULE H5O +! +! FILE +! fortran/src/H5Off.f90 +! +! PURPOSE +! This file contains Fortran interfaces for H5O functions. It includes +! all the functions that are independent on whether the Fortran 2003 functions +! are enabled or disabled. +! +! +! COPYRIGHT ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! Copyright by The HDF Group. * ! Copyright by the Board of Trustees of the University of Illinois. * @@ -13,39 +28,43 @@ ! access to either file, you may request a copy from help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! +! NOTES +! *** IMPORTANT *** +! If you add a new H5O function you must add the function name to the +! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! This is needed for Windows based operating systems. ! -! This file contains Fortran90 interfaces for H5O functions. -! +!***** + MODULE H5O USE H5GLOBAL CONTAINS -!---------------------------------------------------------------------- -! Name: h5olink_f -! -! Purpose: Creates a hard link to an object in an HDF5 file. -! -! Inputs: -! object_id - Object to be linked. -! new_loc_id - File or group identifier specifying location at which object is to be linked. -! new_link_name - Name of link to be created, relative to new_loc_id. -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! lcpl_id - Link creation property list identifier. -! lapl_id - Link access property list identifier. -! -! Programmer: M.S. Breitenfeld -! April 21, 2008 -! -! Modifications: N/A -! -!---------------------------------------------------------------------- - +!****s* H5O/h5olink_f +! +! NAME +! h5olink_f +! +! PURPOSE +! Creates a hard link to an object in an HDF5 file. +! INPUTS +! object_id - Object to be linked. +! new_loc_id - File or group identifier specifying location at which object is to be linked. +! new_link_name - Name of link to be created, relative to new_loc_id. +! OUTPUTS +! hdferr: - error code +! Success: 0 +! Failure: -1 +! OPTIONAL PARAMETERS +! lcpl_id - Link creation property list identifier. +! lapl_id - Link access property list identifier. +! AUTHOR +! M. Scot Breitenfeld +! April 21, 2008 +! +! SOURCE SUBROUTINE h5olink_f(object_id, new_loc_id, new_link_name, hdferr, lcpl_id, lapl_id) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: object_id ! Object to be linked @@ -57,6 +76,7 @@ CONTAINS ! Failure: -1 INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lcpl_id ! Link creation property list identifier. INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link creation property list identifier. +!***** INTEGER(HID_T) :: lapl_id_default INTEGER(HID_T) :: lcpl_id_default @@ -91,29 +111,28 @@ CONTAINS END SUBROUTINE h5olink_f -!---------------------------------------------------------------------- -! Name: h5oopen_f -! -! Purpose: Opens an object in an HDF5 file by location identifier and path name.O -! -! Inputs: -! loc_id - File or group identifier -! name - Path to the object, relative to loc_id. -! Outputs: -! obj_id - Object identifier for the opened object -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! lapl_id - Access property list identifier for the link pointing to the object -! -! Programmer: M.S. Breitenfeld -! April 18, 2008 -! -! Modifications: N/A -! -!---------------------------------------------------------------------- - +!****s* H5O/h5oopen_f +! +! NAME +! h5oopen_f +! PURPOSE +! Opens an object in an HDF5 file by location identifier and path name. +! +! INPUTS +! loc_id - File or group identifier +! name - Path to the object, relative to loc_id. +! OUTPUTS +! obj_id - Object identifier for the opened object +! hdferr: - error code +! Success: 0 +! Failure: -1 +! OPTIONAL PARAMETERS +! lapl_id - Access property list identifier for the link pointing to the object +! +! AUTHOR +! M. Scot Breitenfeld +! April 18, 2008 +! SOURCE SUBROUTINE h5oopen_f(loc_id, name, obj_id, hdferr, lapl_id) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier @@ -123,12 +142,10 @@ CONTAINS ! Success: 0 ! Failure: -1 INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Attribute access property list +!***** INTEGER(HID_T) :: lapl_id_default - INTEGER(SIZE_T) :: namelen -! MS FORTRAN needs explicit interface for C functions called here. -! INTERFACE INTEGER FUNCTION h5oopen_c(loc_id, name, namelen, lapl_id_default, obj_id) USE H5GLOBAL @@ -152,36 +169,71 @@ CONTAINS hdferr = h5oopen_c(loc_id, name, namelen, lapl_id_default, obj_id) END SUBROUTINE h5oopen_f - -!---------------------------------------------------------------------- -! Name: h5oopen_by_addr_f ! -! Purpose: Opens an object using its address within an HDF5 file. +!****s* H5O/h5oclose_f +! +! NAME +! h5oclose_f ! -! Inputs: -! loc_id - File or group identifier -! addr - Object’s address in the file -! Outputs: -! obj_id - Object identifier for the opened object -! hdferr: - error code -! Success: 0 -! Failure: -1 +! PURPOSE +! Closes an object in an HDF5 file. ! -! Programmer: M. Scot Breitenfeld -! September 14, 2009 +! INPUTS +! object_id - Object identifier +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails ! -! Modifications: N/A +! AUTHOR +! M. Scot Breitenfeld +! December 17, 2008 ! -!---------------------------------------------------------------------- +! SOURCE + SUBROUTINE h5oclose_f(object_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: object_id + INTEGER, INTENT(OUT) :: hdferr +!***** + INTERFACE + INTEGER FUNCTION h5oclose_c(object_id) + USE H5GLOBAL + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5OCLOSE_C'::h5oclose_c + !DEC$ENDIF + INTEGER(HID_T), INTENT(IN) :: object_id + END FUNCTION h5oclose_c + END INTERFACE + hdferr = h5oclose_c(object_id) + END SUBROUTINE h5oclose_f + +! +!****s* H5O/h5open_by_addr_f +! NAME +! h5oopen_by_addr_f +! +! PURPOSE +! Opens an object using its address within an HDF5 file. +! +! INPUTS +! loc_id - File or group identifier +! addr - Object’s address in the file +! OUTPUTS: +! obj_id - Object identifier for the opened object +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! M. Scot Breitenfeld +! September 14, 2009 +! +! SOURCE SUBROUTINE h5oopen_by_addr_f(loc_id, addr, obj_id, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier INTEGER(HADDR_T), INTENT(IN) :: addr ! Object’s address in the file INTEGER(HID_T), INTENT(OUT) :: obj_id ! Object identifier for the opened object - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! Success: 0 - ! Failure: -1 + INTEGER, INTENT(OUT) :: hdferr ! Error code: + ! 0 on success and -1 on failure +!***** INTERFACE INTEGER FUNCTION h5oopen_by_addr_c(loc_id, addr, obj_id) USE H5GLOBAL @@ -199,3 +251,4 @@ CONTAINS END SUBROUTINE h5oopen_by_addr_f END MODULE H5O + diff --git a/fortran/src/H5Off_F03.f90 b/fortran/src/H5Off_F03.f90 new file mode 100644 index 0000000..8eb7a4b --- /dev/null +++ b/fortran/src/H5Off_F03.f90 @@ -0,0 +1,242 @@ +!****h* ROBODoc/H5O (F03) +! +! NAME +! H5O_PROVISIONAL +! +! PURPOSE +! This file contains Fortran 90 and Fortran 2003 interfaces for H5O functions. +! It contains the same functions as H5Off_F90.f90 but includes the +! Fortran 2003 functions and the interface listings. This file will be compiled +! instead of H5Off_F90.f90 if Fortran 2003 functions are enabled. +! +! COPYRIGHT +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +! NOTES +! *** IMPORTANT *** +! If you add a new H5P function you must add the function name to the +! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! This is needed for Windows based operating systems. +! +!***** + +MODULE H5O_PROVISIONAL + + USE H5GLOBAL + USE, INTRINSIC :: ISO_C_BINDING + + IMPLICIT NONE + + enum, bind(c) + enumerator :: H5O_TYPE_UNKNOWN_F = -1 + enumerator :: H5O_TYPE_GROUP_F, H5O_TYPE_DATASET_F, H5O_TYPE_NAMED_DATATYPE_F, H5O_TYPE_NTYPES_F + end enum + +!****t* H5T (F03)/h5o_info_t +! +! Fortran2003 Derived Type: +! + TYPE, BIND(C) :: space_t + INTEGER(hsize_t) :: total ! Total space for storing object header in file + INTEGER(hsize_t) :: meta ! Space within header for object header metadata information + INTEGER(hsize_t) :: mesg ! Space within header for actual message information + INTEGER(hsize_t) :: free ! Free space within object header + END TYPE space_t + + TYPE, BIND(C) :: mesg_t + INTEGER(c_int64_t) :: present ! Flags to indicate presence of message type in header + INTEGER(c_int64_t) :: shared ! Flags to indicate message type is shared in header + END TYPE mesg_t + + TYPE, BIND(C) :: hdr_t + INTEGER :: version ! Version number of header format in file + INTEGER :: nmesgs ! Number of object header messages + INTEGER :: nchunks ! Number of object header chunks + INTEGER :: flags ! Object header status flags + TYPE(space_t) :: space + TYPE(mesg_t) :: mesg + END TYPE hdr_t + + ! Extra metadata storage for obj & attributes + TYPE, BIND(C) :: H5_ih_info_t + INTEGER(hsize_t) :: index_size ! btree and/or list + INTEGER(hsize_t) :: heap_size + END TYPE H5_ih_info_t + + TYPE, BIND(C) :: meta_size_t + TYPE(H5_ih_info_t) :: obj ! v1/v2 B-tree & local/fractal heap for groups, B-tree for chunked datasets + TYPE(H5_ih_info_t) :: attr ! v2 B-tree & heap for attributes + ENDTYPE meta_size_t + + TYPE, BIND(C) :: h5o_info_t + INTEGER(c_long) :: fileno ! File number that object is located in + INTEGER(haddr_t) :: addr ! Object address in file + INTEGER :: type ! Basic object type (group, dataset, etc.) + INTEGER :: rc ! Reference count of object + + INTEGER, DIMENSION(8) :: atime ! Access time ! -- NOTE -- + INTEGER, DIMENSION(8) :: mtime ! Modification time ! Returns an integer array + INTEGER, DIMENSION(8) :: ctime ! Change time ! as specified in the Fortran + INTEGER, DIMENSION(8) :: btime ! Birth time ! intrinsic DATE_AND_TIME(VALUES) + + INTEGER(hsize_t) :: num_attrs ! # of attributes attached to object + + TYPE(hdr_t) :: hdr + + TYPE(meta_size_t) :: meta_size + END TYPE h5o_info_t + +!***** + +CONTAINS + +!****s* H5O (F03)/h5ovisit_f_F03 +! +! NAME +! h5ovisit_f +! +! PURPOSE +! Recursively visits all objects starting from a specified object. +! +! Inputs: +! object_id - Identifier of the object at which the recursive iteration begins. +! index_type - Type of index; valid values include: +! H5_INDEX_NAME_F +! H5_INDEX_CRT_ORDER_F +! order - Order in which index is traversed; valid values include: +! H5_ITER_DEC_F +! H5_ITER_INC_F +! H5_ITER_NATIVE_F +! op - Callback function passing data regarding the group to the calling application +! op_data - User-defined pointer to data required by the application for its processing of the group +! +! Outputs: +! return_value - returns the return value of the first operator that returns a positive value, or +! zero if all members were processed with no operator returning non-zero. +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! M. Scot Breitenfeld +! November 19, 2008 +! +! Fortran2003 Interface: + SUBROUTINE h5ovisit_f(object_id, index_type, order, op, op_data, return_value, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: object_id + INTEGER, INTENT(IN) :: index_type + INTEGER, INTENT(IN) :: order + + TYPE(C_FUNPTR):: op + TYPE(C_PTR) :: op_data + INTEGER, INTENT(OUT) :: return_value + INTEGER, INTENT(OUT) :: hdferr +!***** + + INTERFACE + INTEGER FUNCTION h5ovisit_c(object_id, index_type, order, op, op_data) + USE, INTRINSIC :: ISO_C_BINDING + USE H5GLOBAL + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5OVISIT_C'::h5ovisit_c + !DEC$ENDIF + INTEGER(HID_T), INTENT(IN) :: object_id + INTEGER, INTENT(IN) :: index_type + INTEGER, INTENT(IN) :: order + TYPE(C_FUNPTR), VALUE :: op + TYPE(C_PTR), VALUE :: op_data + END FUNCTION h5ovisit_c + END INTERFACE + + return_value = h5ovisit_c(object_id, index_type, order, op, op_data) + + IF(return_value.GE.0)THEN + hdferr = 0 + ELSE + hdferr = -1 + END IF + + END SUBROUTINE h5ovisit_f + +!****s* H5O (F03)/h5oget_info_by_name_f_F03 +! +! NAME +! h5oget_info_by_name_f +! +! PURPOSE +! Retrieves the metadata for an object, identifying the object by location and relative name. +! +! Inputs: +! loc_id - File or group identifier specifying location of group +! in which object is located. +! name - Name of group, relative to loc_id +! +! Outputs: +! object_info - Buffer in which to return object information +! hdferr - Returns 0 if successful and -1 if fails +! +! Optional parameters: +! lapl_id - Link access property list +! +! AUTHOR +! M. Scot Breitenfeld +! December 1, 2008 +! +! Fortran2003 Interface: + SUBROUTINE h5oget_info_by_name_f(loc_id, name, object_info, hdferr, lapl_id) + + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T) , INTENT(IN) :: loc_id + CHARACTER(LEN=*), INTENT(IN) :: name + TYPE(h5o_info_t), INTENT(OUT), TARGET :: object_info + INTEGER , INTENT(OUT) :: hdferr + INTEGER(HID_T) , INTENT(IN) , OPTIONAL :: lapl_id +!***** + INTEGER :: corder_valid + INTEGER(SIZE_T) :: namelen + INTEGER(HID_T) :: lapl_id_default + TYPE(C_PTR) :: ptr + + INTERFACE + INTEGER FUNCTION h5oget_info_by_name_c(loc_id, name, namelen, lapl_id_default, & + object_info) + USE H5GLOBAL + USE, INTRINSIC :: ISO_C_BINDING + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5OGET_INFO_BY_NAME_C'::h5oget_info_by_name_c + !DEC$ENDIF + INTEGER(HID_T) , INTENT(IN) :: loc_id + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER(SIZE_T) , INTENT(IN) :: namelen + INTEGER(HID_T) , INTENT(IN) :: lapl_id_default + TYPE(C_PTR),value :: object_info + + END FUNCTION h5oget_info_by_name_c + END INTERFACE + + namelen = LEN(name) + + lapl_id_default = H5P_DEFAULT_F + IF(PRESENT(lapl_id)) lapl_id_default = lapl_id + + ptr = C_LOC(object_info) + + hdferr = H5Oget_info_by_name_c(loc_id, name, namelen, lapl_id_default, ptr) + + END SUBROUTINE H5Oget_info_by_name_f + +END MODULE H5O_PROVISIONAL + diff --git a/fortran/src/H5Off_F90.f90 b/fortran/src/H5Off_F90.f90 new file mode 100644 index 0000000..53553d6 --- /dev/null +++ b/fortran/src/H5Off_F90.f90 @@ -0,0 +1,39 @@ +!****h* ROBODoc/H5O (F90) +! +! NAME +! MODULE H5O_PROVISIONAL +! +! PURPOSE +! This file contains Fortran 90 interfaces for H5O functions. It contains +! the same functions as H5Off_F03.f90 but excludes the Fortran 2003 functions +! and the interface listings. This file will be compiled instead of H5Off_F03.f90 +! if Fortran 2003 functions are not enabled. +! +! NOTE +! Currently contains no functions. +! +! COPYRIGHT +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +! *** IMPORTANT *** +! If you add a new H5D function you must add the function name to the +! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! This is needed for Windows based operating systems. +!***** + +MODULE H5O_PROVISIONAL + +END MODULE H5O_PROVISIONAL diff --git a/fortran/src/H5Pf.c b/fortran/src/H5Pf.c index 29ba593..6fc8487 100644 --- a/fortran/src/H5Pf.c +++ b/fortran/src/H5Pf.c @@ -1,4 +1,9 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +/****h* H5Pf/H5Pf + * PURPOSE + * This file contains C stubs for H5P Fortran APIs + * + * COPYRIGHT + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * @@ -11,26 +16,35 @@ * is linked from the top-level documents page. It can also be found at * * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * * access to either file, you may request a copy from help@hdfgroup.org. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -/* This files contains C stubs for H5P Fortran APIs */ + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * + ****** +*/ #include "H5f90.h" #include "H5Eprivate.h" -/*---------------------------------------------------------------------------- - * Name: h5pcreate_c - * Purpose: Call H5Pcreate to create a property list - * Inputs: cls - property list class identifier - * Outputs: prp_id - identifier of the created property list - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal - * Wednesday, October 9, 2002 - * Modifications: - *---------------------------------------------------------------------------*/ +/****if* H5Pf/h5pcreate_c + * NAME + * h5pcreate_c + * PURPOSE + * Call H5Pcreate to create a property list + * INPUTS + * cls - property list class identifier + * OUTPUTS + * prp_id - identifier of the created property list + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal + * Wednesday, October 9, 2002 + * + * SOURCE +*/ int_f nh5pcreate_c ( hid_t_f *cls, hid_t_f *prp_id ) +/******/ { hid_t c_prp_id; int_f ret_value = 0; @@ -45,18 +59,25 @@ done: return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pclose_c - * Purpose: Call H5Pclose to close property lis - * Inputs: prp_id - identifier of the property list to be closed - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal +/****if* H5Pf/h5pclose_c + * NAME + * h5pclose_c + * PURPOSE + * Call H5Pclose to close property lis + * INPUTS + * prp_id - identifier of the property list to be closed + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Saturday, August 14, 1999 - * Modifications: - *---------------------------------------------------------------------------*/ + * + * SOURCE +*/ int_f nh5pclose_c ( hid_t_f *prp_id ) +/******/ { int_f ret_value = 0; @@ -67,19 +88,26 @@ nh5pclose_c ( hid_t_f *prp_id ) } -/*---------------------------------------------------------------------------- - * Name: h5pcopy_c - * Purpose: Call H5Pcopy to copy property list - * Inputs: prp_id - identifier of the property list to be copied - * Outputs: new_prp_id - identifier of the new property list - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal +/****if* H5Pf/h5pcopy_c + * NAME + * h5pcopy_c + * PURPOSE + * Call H5Pcopy to copy property list + * INPUTS + * prp_id - identifier of the property list to be copied + * OUTPUTS + * new_prp_id - identifier of the new property list + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Saturday, August 14, 1999 - * Modifications: - *---------------------------------------------------------------------------*/ - + * + * SOURCE +*/ int_f nh5pcopy_c ( hid_t_f *prp_id , hid_t_f *new_prp_id) +/******/ { hid_t c_new_prp_id; int_f ret_value = 0; @@ -94,20 +122,27 @@ done: return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pequal_c - * Purpose: Call H5Pequal to check if two property lists are equal - * Inputs: plist1_id - property list identifier +/****if* H5Pf/h5pequal_c + * NAME + * h5pequal_c + * PURPOSE + * Call H5Pequal to check if two property lists are equal + * INPUTS + * plist1_id - property list identifier * plist2_id - property list identifier - * Outputs: c_flag - flag to indicate that lists are eqaul - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * OUTPUTS + * c_flag - flag to indicate that lists are eqaul + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Monday, September 30, 2002 - * Modifications: - *---------------------------------------------------------------------------*/ - + * + * SOURCE +*/ int_f nh5pequal_c ( hid_t_f *plist1_id , hid_t_f *plist2_id, int_f * c_flag) +/******/ { htri_t c_c_flag; int_f ret_value = 0; @@ -123,25 +158,32 @@ done: } -/*---------------------------------------------------------------------------- - * Name: h5pget_class_c - * Purpose: Call H5Pget_class to determine property list class - * Inputs: prp_id - identifier of the dataspace - * Outputs: classtype - class type; possible values are: +/****if* H5Pf/h5pget_class_c + * NAME + * h5pget_class_c + * PURPOSE + * Call H5Pget_class to determine property list class + * INPUTS + * prp_id - identifier of the dataspace + * OUTPUTS + * classtype - class type; possible values are: * H5P_ROOT_F -1 * H5P_FILE_CREATE_F 0 * H5P_FILE_ACCESS_F 1 * H5P_DATASET_CREATE_F 2 * H5P_DATASET_XFER_F 3 * H5P_FILE_MOUNT_F 4 - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Saturday, August 14, 1999 - * Modifications: - *---------------------------------------------------------------------------*/ + * SOURCE +*/ int_f nh5pget_class_c ( hid_t_f *prp_id , int_f *classtype) +/******/ { hid_t c_classtype; int_f ret_value = 0; @@ -158,20 +200,26 @@ done: return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pset_preserve_c - * Purpose: Call H5Pset_preserve to set transfer property for compound +/****if* H5Pf/h5pset_preserve_c + * NAME + * h5pset_preserve_c + * PURPOSE + * Call H5Pset_preserve to set transfer property for compound * datatype - * Inputs: prp_id - property list identifier + * INPUTS + * prp_id - property list identifier * flag - TRUE/FALSE flag - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal - * Thursday, February 17, 2000 - * Modifications: - *---------------------------------------------------------------------------*/ + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal + * Thursday, February 17, 2000 + * SOURCE +*/ int_f nh5pset_preserve_c ( hid_t_f *prp_id , int_f *flag) +/******/ { int ret_value = 0; hid_t c_prp_id; @@ -186,20 +234,27 @@ nh5pset_preserve_c ( hid_t_f *prp_id , int_f *flag) } -/*---------------------------------------------------------------------------- - * Name: h5pget_preserve_c - * Purpose: Call H5Pget_preserve to set transfer property for compound +/****if* H5Pf/h5pget_preserve_c + * NAME + * h5pget_preserve_c + * PURPOSE + * Call H5Pget_preserve to set transfer property for compound * datatype - * Inputs: prp_id - property list identifier - * Outputs: flag - TRUE/FALSE flag - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal - * Thursday, February 17, 2000 - * Modifications: - *---------------------------------------------------------------------------*/ + * INPUTS + * prp_id - property list identifier + * OUTPUTS + * flag - TRUE/FALSE flag + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal + * Thursday, February 17, 2000 + * SOURCE +*/ int_f nh5pget_preserve_c ( hid_t_f *prp_id , int_f *flag) +/******/ { int ret_value = 0; hid_t c_prp_id; @@ -212,19 +267,25 @@ nh5pget_preserve_c ( hid_t_f *prp_id , int_f *flag) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pset_deflate_c - * Purpose: Call H5Pset_deflate to set deflate level - * Inputs: prp_id - property list identifier +/****if* H5Pf/h5pset_deflate_c + * NAME + * h5pset_deflate_c + * PURPOSE + * Call H5Pset_deflate to set deflate level + * INPUTS + * prp_id - property list identifier * level - level of deflation - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Saturday, August 14, 1999 - * Modifications: - *---------------------------------------------------------------------------*/ + * SOURCE +*/ int_f nh5pset_deflate_c ( hid_t_f *prp_id , int_f *level) +/******/ { int ret_value = 0; hid_t c_prp_id; @@ -240,21 +301,27 @@ nh5pset_deflate_c ( hid_t_f *prp_id , int_f *level) -/*---------------------------------------------------------------------------- - * Name: h5pset_chunk_c - * Purpose: Call H5Pset_chunk to set the sizes of chunks for a chunked +/****if* H5Pf/h5pset_chunk_c + * NAME + * h5pset_chunk_c + * PURPOSE + * Call H5Pset_chunk to set the sizes of chunks for a chunked * layout dataset - * Inputs: prp_id - property list identifier + * INPUTS + * prp_id - property list identifier * rank - number of dimensions of each chunk * dims - array of the size of each chunk - * Returns: 0 on success, -1 on failure + * RETURNS + * 0 on success, -1 on failure * Saturday, August 14, 1999 - * Programmer: Elena Pourmal - * Modifications: - *---------------------------------------------------------------------------*/ + * AUTHOR + * Elena Pourmal + * SOURCE +*/ int_f nh5pset_chunk_c ( hid_t_f *prp_id, int_f *rank, hsize_t_f *dims ) +/******/ { int ret_value = -1; hid_t c_prp_id; @@ -285,21 +352,27 @@ DONE: } -/*---------------------------------------------------------------------------- - * Name: h5pget_chunk_c - * Purpose: Call H5Pget_chunk to get the sizes of chunks for a chunked +/****if* H5Pf/h5pget_chunk_c + * NAME + * h5pget_chunk_c + * PURPOSE + * Call H5Pget_chunk to get the sizes of chunks for a chunked * layout dataset for at list max_rank number of dimensions - * Inputs: prp_id - property list identifier + * INPUTS + * prp_id - property list identifier * max rank - maximum number of dimensions to return * dims - array of the size of each chunk - * Returns: number of chunk's dimnesion on success, -1 on failure + * RETURNS + * number of chunk's dimnesion on success, -1 on failure * Saturday, August 14, 1999 - * Programmer: Elena Pourmal - * Modifications: - *---------------------------------------------------------------------------*/ + * AUTHOR + * Elena Pourmal + * SOURCE +*/ int_f nh5pget_chunk_c ( hid_t_f *prp_id, int_f *max_rank, hsize_t_f *dims ) +/******/ { int ret_value = -1; hid_t c_prp_id; @@ -327,21 +400,25 @@ nh5pget_chunk_c ( hid_t_f *prp_id, int_f *max_rank, hsize_t_f *dims ) return ret_value; } - - -/*---------------------------------------------------------------------------- - * Name: h5pset_fill_valuec_c - * Purpose: Call h5pset_fill_value_c to a character fill value - * Inputs: prp_id - property list identifier +/****if* H5Pf/h5pset_fill_valuec_c + * NAME + * h5pset_fill_valuec_c + * PURPOSE + * Call h5pset_fill_value_c to a character fill value + * INPUTS + * prp_id - property list identifier * type_id - datatype identifier (fill value is of type type_id) * fillvalue - character value - * Returns: 0 on success, -1 on failure + * RETURNS + * 0 on success, -1 on failure * Saturday, August 14, 1999 - * Programmer: Elena Pourmal - * Modifications: - *---------------------------------------------------------------------------*/ + * AUTHOR + * Elena Pourmal + * SOURCE +*/ int_f nh5pset_fill_valuec_c (hid_t_f *prp_id, hid_t_f *type_id, _fcd fillvalue) +/******/ { int ret_value = -1; @@ -353,19 +430,25 @@ nh5pset_fill_valuec_c (hid_t_f *prp_id, hid_t_f *type_id, _fcd fillvalue) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pset_fill_value_c - * Purpose: Call H5Pset_fill_value to set a fillvalue for a dataset - * Inputs: prp_id - property list identifier +/****if* H5Pf/h5pset_fill_value_c + * NAME + * h5pset_fill_value_c + * PURPOSE + * Call H5Pset_fill_value to set a fillvalue for a dataset + * INPUTS + * prp_id - property list identifier * type_id - datatype identifier (fill value is of type type_id) * fillvalue - fillvalue - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Saturday, August 14, 1999 - * Modifications: - *---------------------------------------------------------------------------*/ + * SOURCE +*/ int_f nh5pset_fill_value_c (hid_t_f *prp_id, hid_t_f *type_id, void *fillvalue) +/******/ { int ret_value = -1; hid_t c_prp_id; @@ -386,6 +469,7 @@ nh5pset_fill_value_c (hid_t_f *prp_id, hid_t_f *type_id, void *fillvalue) int_f nh5pset_fill_value_integer_c (hid_t_f *prp_id, hid_t_f *type_id, void *fillvalue) +/******/ { /* * Call h5pset_fill_value_c function. @@ -411,20 +495,27 @@ nh5pset_fill_value_double_c (hid_t_f *prp_id, hid_t_f *type_id, void *fillvalue) return nh5pset_fill_value_c(prp_id, type_id, fillvalue); } - -/*---------------------------------------------------------------------------- - * Name: h5pget_fill_valuec_c - * Purpose: Call h5pget_fill_value_c to a character fill value - * Inputs: prp_id - property list identifier +/****if* H5Pf/h5pget_fill_valuec_c + * NAME + * h5pget_fill_valuec_c + * PURPOSE + * Call h5pget_fill_value_c to a character fill value + * INPUTS + * prp_id - property list identifier * type_id - datatype identifier (fill value is of type type_id) * fillvalue - character value - * Returns: 0 on success, -1 on failure + * RETURNS + * 0 on success, -1 on failure * Saturday, August 14, 1999 - * Programmer: Elena Pourmal - * Modifications: - *---------------------------------------------------------------------------*/ + * AUTHOR + * Elena Pourmal + * HISTORY + * + * SOURCE +*/ int_f nh5pget_fill_valuec_c (hid_t_f *prp_id, hid_t_f *type_id, _fcd fillvalue) +/******/ { int ret_value = -1; @@ -436,19 +527,25 @@ nh5pget_fill_valuec_c (hid_t_f *prp_id, hid_t_f *type_id, _fcd fillvalue) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pget_fill_value_c - * Purpose: Call H5Pget_fill_value to set a fillvalue for a dataset - * Inputs: prp_id - property list identifier +/****if* H5Pf/h5pget_fill_value_c + * NAME + * h5pget_fill_value_c + * PURPOSE + * Call H5Pget_fill_value to set a fillvalue for a dataset + * INPUTS + * prp_id - property list identifier * type_id - datatype identifier (fill value is of type type_id) * fillvalue - fillvalue - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Saturday, August 14, 1999 - * Modifications: - *---------------------------------------------------------------------------*/ + * SOURCE +*/ int_f nh5pget_fill_value_c (hid_t_f *prp_id, hid_t_f *type_id, void *fillvalue) +/******/ { int ret_value = -1; hid_t c_prp_id; @@ -494,22 +591,31 @@ nh5pget_fill_value_double_c (hid_t_f *prp_id, hid_t_f *type_id, void *fillvalue) return nh5pset_fill_value_c(prp_id, type_id, fillvalue); } -/*---------------------------------------------------------------------------- - * Name: h5pget_version_c - * Purpose: Call H5Pget_version to get the version information +/****if* H5Pf/h5pget_version_c + * NAME + * h5pget_version_c + * PURPOSE + * Call H5Pget_version to get the version information * of various objects for a file creation property list - * Inputs: prp_id - property list identifier - * Outputs: boot - array to put boot block version number + * INPUTS + * prp_id - property list identifier + * OUTPUTS + * boot - array to put boot block version number * freelist - array to put global freelist version number * stab - array to put symbol table version number * shhdr - array to put shared object header version number - * Returns: 0 on success, -1 on failure - * Programmer: Xiangyang Su + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Xiangyang Su * Wednesday, February 23, 2000 - * Modifications: Removed extra length parameters EP 7/6/00 - *---------------------------------------------------------------------------*/ + * HISTORY + * Removed extra length parameters EP 7/6/00 + * SOURCE +*/ int_f nh5pget_version_c (hid_t_f *prp_id, int_f * boot,int_f * freelist, int_f * stab, int_f *shhdr) +/******/ { int ret_value = -1; #ifndef H5_NO_DEPRECATED_SYMBOLS @@ -543,19 +649,25 @@ nh5pget_version_c (hid_t_f *prp_id, int_f * boot,int_f * freelist, int_f * stab, return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pget_userblock_c - * Purpose: Call H5Pget_userblock to get the size of a user block in +/****if* H5Pf/h5pget_userblock_c + * NAME + * h5pget_userblock_c + * PURPOSE + * Call H5Pget_userblock to get the size of a user block in * a file creation property list - * Inputs: prp_id - property list identifier + * INPUTS + * prp_id - property list identifier * Outputs size - Size of the user-block in bytes - * Returns: 0 on success, -1 on failure - * Programmer: Xiangyang Su + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Xiangyang Su * Wednesday, February 23, 2000 - * Modifications: - *---------------------------------------------------------------------------*/ + * SOURCE +*/ int_f nh5pget_userblock_c (hid_t_f *prp_id, hsize_t_f * size) +/******/ { int ret_value = -1; hid_t c_prp_id; @@ -575,19 +687,25 @@ nh5pget_userblock_c (hid_t_f *prp_id, hsize_t_f * size) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pset_userblock_c - * Purpose: Call H5Pset_userblock to set the size of a user block in +/****if* H5Pf/h5pset_userblock_c + * NAME + * h5pset_userblock_c + * PURPOSE + * Call H5Pset_userblock to set the size of a user block in * a file creation property list - * Inputs: prp_id - property list identifier + * INPUTS + * prp_id - property list identifier * size - Size of the user-block in bytes - * Returns: 0 on success, -1 on failure - * Programmer: Xiangyang Su + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Xiangyang Su * Wednesday, February 23, 2000 - * Modifications: - *---------------------------------------------------------------------------*/ + * SOURCE +*/ int_f nh5pset_userblock_c (hid_t_f *prp_id, hsize_t_f * size) +/******/ { int ret_value = -1; hid_t c_prp_id; @@ -606,20 +724,28 @@ nh5pset_userblock_c (hid_t_f *prp_id, hsize_t_f * size) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pget_sizes_c - * Purpose: Call H5Pget_sizes to get the size of the offsets +/****if* H5Pf/h5pget_sizes_c + * NAME + * h5pget_sizes_c + * PURPOSE + * Call H5Pget_sizes to get the size of the offsets * and lengths used in an HDF5 file - * Inputs: prp_id - property list identifier + * INPUTS + * prp_id - property list identifier * Outputs sizeof_addr - Size of an object offset in bytes * sizeof_size - Size of an object length in bytes - * Returns: 0 on success, -1 on failure - * Programmer: Xiangyang Su + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Xiangyang Su * Wednesday, February 23, 2000 - * Modifications: Deleted extra length parameters. EP 6/7/00 - *---------------------------------------------------------------------------*/ + * HISTORY + * Deleted extra length parameters. EP 6/7/00 + * SOURCE +*/ int_f nh5pget_sizes_c (hid_t_f *prp_id, size_t_f * sizeof_addr, size_t_f * sizeof_size) +/******/ { int ret_value = -1; hid_t c_prp_id; @@ -641,19 +767,27 @@ nh5pget_sizes_c (hid_t_f *prp_id, size_t_f * sizeof_addr, size_t_f * sizeof_size return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pset_sizes_c - * Purpose: Call H5Pset_sizes to set the size of the offsets - * Inputs: prp_id - property list identifier +/****if* H5Pf/h5pset_sizes_c + * NAME + * h5pset_sizes_c + * PURPOSE + * Call H5Pset_sizes to set the size of the offsets + * INPUTS + * prp_id - property list identifier * sizeof_addr - Size of an object offset in bytes * sizeof_size - Size of an object length in bytes - * Returns: 0 on success, -1 on failure - * Programmer: Xiangyang Su + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Xiangyang Su * Wednesday, February 23, 2000 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pset_sizes_c (hid_t_f *prp_id, size_t_f * sizeof_addr, size_t_f * sizeof_size) +/******/ { int ret_value = -1; hid_t c_prp_id; @@ -673,20 +807,26 @@ nh5pset_sizes_c (hid_t_f *prp_id, size_t_f * sizeof_addr, size_t_f * sizeof_size return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pset_sym_k_c - * Purpose: Call H5Pset_sym_k to set the size of parameters used +/****if* H5Pf/h5pset_sym_k_c + * NAME + * h5pset_sym_k_c + * PURPOSE + * Call H5Pset_sym_k to set the size of parameters used * to control the symbol table node - * Inputs: prp_id - property list identifier + * INPUTS + * prp_id - property list identifier * ik - Symbol table tree rank * lk - Symbol table node size - * Returns: 0 on success, -1 on failure - * Programmer: Xiangyang Su + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Xiangyang Su * Friday, February 25, 2000 - * Modifications: - *---------------------------------------------------------------------------*/ + * SOURCE +*/ int_f nh5pset_sym_k_c (hid_t_f *prp_id, int_f* ik, int_f* lk) +/******/ { int ret_value = -1; hid_t c_prp_id; @@ -707,20 +847,29 @@ nh5pset_sym_k_c (hid_t_f *prp_id, int_f* ik, int_f* lk) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pget_sym_k_c - * Purpose: Call H5Pget_sym_k to get the size of parameters used +/****if* H5Pf/h5pget_sym_k_c + * NAME + * h5pget_sym_k_c + * PURPOSE + * Call H5Pget_sym_k to get the size of parameters used * to control the symbol table node - * Inputs: prp_id - property list identifier - * Outputs: ik - Symbol table tree rank + * INPUTS + * prp_id - property list identifier + * OUTPUTS + * ik - Symbol table tree rank * lk - Symbol table node size - * Returns: 0 on success, -1 on failure - * Programmer: Xiangyang Su + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Xiangyang Su * Friday, February 25, 2000 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pget_sym_k_c (hid_t_f *prp_id, int_f* ik, int_f* lk) +/******/ { int ret_value = -1; hid_t c_prp_id; @@ -740,19 +889,27 @@ nh5pget_sym_k_c (hid_t_f *prp_id, int_f* ik, int_f* lk) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pset_istore_k_c - * Purpose: Call H5Pset_istore_k to set the size of the parameter +/****if* H5Pf/h5pset_istore_k_c + * NAME + * h5pset_istore_k_c + * PURPOSE + * Call H5Pset_istore_k to set the size of the parameter * used to control the B-trees for indexing chunked datasets - * Inputs: prp_id - property list identifier + * INPUTS + * prp_id - property list identifier * ik - Symbol table tree rank - * Returns: 0 on success, -1 on failure - * Programmer: Xiangyang Su + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Xiangyang Su * Friday, February 25, 2000 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pset_istore_k_c (hid_t_f *prp_id, int_f* ik) +/******/ { int ret_value = -1; hid_t c_prp_id; @@ -771,19 +928,28 @@ nh5pset_istore_k_c (hid_t_f *prp_id, int_f* ik) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pget_istore_k_c - * Purpose: Call H5Pget_istore_k to get the size of parameters used +/****if* H5Pf/h5pget_istore_k_c + * NAME + * h5pget_istore_k_c + * PURPOSE + * Call H5Pget_istore_k to get the size of parameters used * to control the B-trees for indexing chunked datasets - * Inputs: prp_id - property list identifier - * Outputs: ik - Symbol table tree rank - * Returns: 0 on success, -1 on failure - * Programmer: Xiangyang Su + * INPUTS + * prp_id - property list identifier + * OUTPUTS + * ik - Symbol table tree rank + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Xiangyang Su * Friday, February 25, 2000 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pget_istore_k_c (hid_t_f *prp_id, int_f* ik) +/******/ { int ret_value = -1; hid_t c_prp_id; @@ -801,18 +967,27 @@ nh5pget_istore_k_c (hid_t_f *prp_id, int_f* ik) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pget_driver_c - * Purpose: Call H5Pget_driver to get low-level file driver identifier - * Inputs: prp_id - property list identifier - * Outputs: driver - low-level file driver identifier - * Returns: 0 on success, -1 on failure - * Programmer: Xiangyang Su +/****if* H5Pf/h5pget_driver_c + * NAME + * h5pget_driver_c + * PURPOSE + * Call H5Pget_driver to get low-level file driver identifier + * INPUTS + * prp_id - property list identifier + * OUTPUTS + * driver - low-level file driver identifier + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Xiangyang Su * Friday, February 25, 2000 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pget_driver_c (hid_t_f *prp_id, hid_t_f* driver) +/******/ { int ret_value = -1; hid_t c_driver; @@ -830,18 +1005,26 @@ DONE: return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pset_fapl_stdio_c - * Purpose: Call H5Pset_stdio to set the low level file driver to +/****if* H5Pf/h5pset_fapl_stdio_c + * NAME + * h5pset_fapl_stdio_c + * PURPOSE + * Call H5Pset_stdio to set the low level file driver to * use the functions declared in the stdio.h - * Inputs: prp_id - property list identifier - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * INPUTS + * prp_id - property list identifier + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * March 7, 2001 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pset_fapl_stdio_c (hid_t_f *prp_id) +/******/ { int ret_value = -1; hid_t c_prp_id; @@ -856,20 +1039,29 @@ nh5pset_fapl_stdio_c (hid_t_f *prp_id) return ret_value; } #ifdef NO_SUCH_F90_FUNCTION -/*---------------------------------------------------------------------------- - * Name: h5pget_fapl_stdio_c - * Purpose: Call H5Pget_fapl_stdio to determine whther the low level file driver +/****if* H5Pf/h5pget_fapl_stdio_c + * NAME + * h5pget_fapl_stdio_c + * PURPOSE + * Call H5Pget_fapl_stdio to determine whther the low level file driver * uses the functions declared in the stdio.h - * Inputs: prp_id - property list identifier - * Outputs: io - value indicates whether the file driver uses + * INPUTS + * prp_id - property list identifier + * OUTPUTS + * io - value indicates whether the file driver uses * the functions declared in the stdio.h - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * March 9, 2001 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pget_fapl_stdio_c (hid_t_f *prp_id, int_f* io) +/******/ { int ret_value = -1; hid_t c_prp_id; @@ -887,18 +1079,26 @@ nh5pget_fapl_stdio_c (hid_t_f *prp_id, int_f* io) #endif /*NO_SUCH_F90_FUNCTION*/ -/*---------------------------------------------------------------------------- - * Name: h5pset_fapl_sec2_c - * Purpose: Call H5Pset_fapl_sec2 to set the low level file driver to +/****if* H5Pf/h5pset_fapl_sec2_c + * NAME + * h5pset_fapl_sec2_c + * PURPOSE + * Call H5Pset_fapl_sec2 to set the low level file driver to * use the functions declared in the unistd.h - * Inputs: prp_id - property list identifier - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * INPUTS + * prp_id - property list identifier + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * March 9, 2001 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pset_fapl_sec2_c (hid_t_f *prp_id) +/******/ { int ret_value = -1; hid_t c_prp_id; @@ -914,20 +1114,29 @@ nh5pset_fapl_sec2_c (hid_t_f *prp_id) } #ifdef NO_SUCH_F90_FUNCTION -/*---------------------------------------------------------------------------- - * Name: h5pget_fapl_sec2_c - * Purpose: Call H5Pget_fapl_stdio to determine whther the low level file driver +/****if* H5Pf/h5pget_fapl_sec2_c + * NAME + * h5pget_fapl_sec2_c + * PURPOSE + * Call H5Pget_fapl_stdio to determine whther the low level file driver * uses the functions declared in the unistd.h - * Inputs: prp_id - property list identifier - * Outputs: sec2 - value indicates whether the file driver uses + * INPUTS + * prp_id - property list identifier + * OUTPUTS + * sec2 - value indicates whether the file driver uses * the functions declared in the unistd.h - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * March 9, 2001 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pget_fapl_sec2_c (hid_t_f *prp_id, int_f* sec2) +/******/ { int ret_value = -1; hid_t c_prp_id; @@ -944,20 +1153,28 @@ nh5pget_fapl_sec2_c (hid_t_f *prp_id, int_f* sec2) } #endif /*NO_SUCH_F90_FUNCTION*/ -/*---------------------------------------------------------------------------- - * Name: h5pset_alignment_c - * Purpose: Call H5Pset_alignment to set alignment properties of +/****if* H5Pf/h5pset_alignment_c + * NAME + * h5pset_alignment_c + * PURPOSE + * Call H5Pset_alignment to set alignment properties of * a file access property list - * Inputs: prp_id - property list identifier + * INPUTS + * prp_id - property list identifier * threshold - Threshold value * alignment - Alignment value - * Returns: 0 on success, -1 on failure - * Programmer: Xiangyang Su + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Xiangyang Su * Friday, February 25, 2000 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pset_alignment_c (hid_t_f *prp_id, hsize_t_f* threshold, hsize_t_f* alignment) +/******/ { int ret_value = -1; hid_t c_prp_id; @@ -975,20 +1192,28 @@ nh5pset_alignment_c (hid_t_f *prp_id, hsize_t_f* threshold, hsize_t_f* alignment return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pget_alignment_c - * Purpose: Call H5Pget_alignment to get alignment properties of +/****if* H5Pf/h5pget_alignment_c + * NAME + * h5pget_alignment_c + * PURPOSE + * Call H5Pget_alignment to get alignment properties of * a file access property list - * Inputs: prp_id - property list identifier + * INPUTS + * prp_id - property list identifier * threshold - Threshold value * alignment - Alignment value - * Returns: 0 on success, -1 on failure - * Programmer: Xiangyang Su + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Xiangyang Su * Friday, February 25, 2000 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pget_alignment_c (hid_t_f *prp_id, hsize_t_f* threshold, hsize_t_f* alignment) +/******/ { int ret_value = -1; hid_t c_prp_id; @@ -1007,21 +1232,29 @@ nh5pget_alignment_c (hid_t_f *prp_id, hsize_t_f* threshold, hsize_t_f* alignment return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pset_fapl_core_c - * Purpose: Call H5Pset_fapl_core to set the low-level file driver +/****if* H5Pf/h5pset_fapl_core_c + * NAME + * h5pset_fapl_core_c + * PURPOSE + * Call H5Pset_fapl_core to set the low-level file driver * to use malloc() and free() - * Inputs: prp_id - property list identifier + * INPUTS + * prp_id - property list identifier * increment - File block size in bytes * flag - Boolean flag indicating whether to write the * file contents to disk when the file is closed. - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * March 9, 2001 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pset_fapl_core_c (hid_t_f *prp_id, size_t_f* increment, int_f *flag) +/******/ { int ret_value = -1; hid_t c_prp_id; @@ -1041,19 +1274,27 @@ nh5pset_fapl_core_c (hid_t_f *prp_id, size_t_f* increment, int_f *flag) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pget_fapl_core_c - * Purpose: Call H5Pget_fapl_core to determine whether the file access +/****if* H5Pf/h5pget_fapl_core_c + * NAME + * h5pget_fapl_core_c + * PURPOSE + * Call H5Pget_fapl_core to determine whether the file access * property list is set to the core drive - * Inputs: prp_id - property list identifier + * INPUTS + * prp_id - property list identifier * Outputs increment - File block size in bytes - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * March 9, 2001 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pget_fapl_core_c (hid_t_f *prp_id, size_t_f* increment, int_f *flag) +/******/ { int ret_value = -1; hid_t c_prp_id; @@ -1073,21 +1314,29 @@ nh5pget_fapl_core_c (hid_t_f *prp_id, size_t_f* increment, int_f *flag) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pset_fapl_family_c - * Purpose: Call H5Pset_fapl_family to set the file access properties list +/****if* H5Pf/h5pset_fapl_family_c + * NAME + * h5pset_fapl_family_c + * PURPOSE + * Call H5Pset_fapl_family to set the file access properties list * to the family driver - * Inputs: prp_id - property list identifier + * INPUTS + * prp_id - property list identifier * memb_size - Logical size, in bytes, of each family member. * memb_plist - Identifier of the file access property list * for each member of the family - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * March 9, 2001 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pset_fapl_family_c(hid_t_f *prp_id, hsize_t_f* memb_size, hid_t_f* memb_plist ) +/******/ { int ret_value = -1; hid_t c_prp_id; @@ -1106,21 +1355,29 @@ nh5pset_fapl_family_c(hid_t_f *prp_id, hsize_t_f* memb_size, hid_t_f* memb_plist return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pget_fapl_family_c - * Purpose: Call H5Pget_fapl_family to determine whether the file access +/****if* H5Pf/h5pget_fapl_family_c + * NAME + * h5pget_fapl_family_c + * PURPOSE + * Call H5Pget_fapl_family to determine whether the file access * property list is set to the family driver - * Inputs: prp_id - property list identifier + * INPUTS + * prp_id - property list identifier * memb_size - Logical size, in bytes, of each family member. * memb_plist - Identifier of the file access property list * for each member of the family - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * March 9, 2001 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pget_fapl_family_c(hid_t_f *prp_id, hsize_t_f* memb_size, hid_t_f* memb_plist) +/******/ { int ret_value = -1; hid_t c_prp_id; @@ -1140,24 +1397,32 @@ nh5pget_fapl_family_c(hid_t_f *prp_id, hsize_t_f* memb_size, hid_t_f* memb_plist return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pset_cache_c - * Purpose: Call H5Pset_cache to set he number of elements in +/****if* H5Pf/h5pset_cache_c + * NAME + * h5pset_cache_c + * PURPOSE + * Call H5Pset_cache to set he number of elements in * the meta data cache and the total number of bytes in * the raw data chunk cache - * Inputs: prp_id - property list identifier + * INPUTS + * prp_id - property list identifier * mdc_nelmts - Number of elements (objects) in the * meta data cache * rdcc_nbytes - Total size of the raw data chunk cache, in bytes * rdcc_w0 - Preemption policy - * Returns: 0 on success, -1 on failure - * Programmer: Xiangyang Su + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Xiangyang Su * Friday, February 25, 2000 - * Modifications: Changed the type of the rdcc_w0 parameter to be real_f EP 7/7/00 + * HISTORY + * Changed the type of the rdcc_w0 parameter to be real_f EP 7/7/00 * instead of double - *---------------------------------------------------------------------------*/ + * SOURCE +*/ int_f nh5pset_cache_c(hid_t_f *prp_id, int_f* mdc_nelmts, size_t_f* rdcc_nelmts, size_t_f* rdcc_nbytes , real_f* rdcc_w0 ) +/******/ { int ret_value = -1; hid_t c_prp_id; @@ -1181,26 +1446,35 @@ nh5pset_cache_c(hid_t_f *prp_id, int_f* mdc_nelmts, size_t_f* rdcc_nelmts, size return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pget_cache_c - * Purpose: Call H5Pget_cache to get he number of elements in +/****if* H5Pf/h5pget_cache_c + * NAME + * h5pget_cache_c + * PURPOSE + * Call H5Pget_cache to get he number of elements in * the meta data cache and the total number of bytes in * the raw data chunk cache - * Inputs: prp_id - property list identifier - * Outputs: mdc_nelmts - Number of elements (objects) in the + * INPUTS + * prp_id - property list identifier + * OUTPUTS + * mdc_nelmts - Number of elements (objects) in the * meta data cache * rdcc_nelmts - Number of elements in the raw data chunk * rdcc_nbytes - Total size of the raw data chunk cache, in bytes * rdcc_w0 - Preemption policy - * Returns: 0 on success, -1 on failure - * Programmer: Xiangyang Su + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Xiangyang Su * Friday, February 25, 2000 - * Modifications: Changed type of the rdcc_w0 parameter to be real_f instead of double + * HISTORY + * Changed type of the rdcc_w0 parameter to be real_f instead of double * Changed type of the rdcc_nelmts parameter to be int_f. * EIP October 10, 2003 - *---------------------------------------------------------------------------*/ + * SOURCE +*/ int_f nh5pget_cache_c(hid_t_f *prp_id, int_f* mdc_nelmts, size_t_f* rdcc_nelmts, size_t_f* rdcc_nbytes , real_f* rdcc_w0) +/******/ { int ret_value = -1; hid_t c_prp_id; @@ -1224,24 +1498,32 @@ nh5pget_cache_c(hid_t_f *prp_id, int_f* mdc_nelmts, size_t_f* rdcc_nelmts, size_ return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pset_fapl_split_c - * Purpose: Call H5Pset_fapl_split to set he low-level driver to split meta data +/****if* H5Pf/h5pset_fapl_split_c + * NAME + * h5pset_fapl_split_c + * PURPOSE + * Call H5Pset_fapl_split to set he low-level driver to split meta data * from raw data - * Inputs: prp_id - property list identifier + * INPUTS + * prp_id - property list identifier * meta_len - Length of meta_ext * meta_ext - Name of the extension for the metafile filename. * meta_plist - Identifier of the meta file access property list * raw_len - Length of raw _ext * raw_ext - Name of the extension for the raw file filename. * raw_plist - Identifier of the raw file access property list - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * March 9, 2001 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pset_fapl_split_c(hid_t_f *prp_id, int_f* meta_len, _fcd meta_ext, hid_t_f* meta_plist, int_f* raw_len, _fcd raw_ext, hid_t_f * raw_plist) +/******/ { int ret_value = -1; hid_t c_prp_id; @@ -1277,26 +1559,35 @@ DONE: #ifdef NO_SUCH_F90_FUNCTION -/*---------------------------------------------------------------------------- - * Name: h5pget_fapl_split_c - * Purpose: Call H5Pget_fapl_split to determine whether the file access +/****if* H5Pf/h5pget_fapl_split_c + * NAME + * h5pget_fapl_split_c + * PURPOSE + * Call H5Pget_fapl_split to determine whether the file access * property list is set to the split driver - * Inputs: prp_id - property list identifier + * INPUTS + * prp_id - property list identifier * meta_ext_size - Number of characters of the meta file extension * to be copied to the meta_ext buffer * raw_ext_size - Number of characters of the raw file extension * to be copied to the raw_ext buffer - *Outputs: meta_ext - Name of the extension for the metafile filename. + *OUTPUT + * meta_ext - Name of the extension for the metafile filename. * meta_plist - Identifier of the meta file access property list * raw_ext - Name of the extension for the raw file filename. * raw_plist - Identifier of the raw file access property list - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * March 9 , 2001 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pget_fapl_split_c(hid_t_f *prp_id, size_t_f* meta_ext_size , _fcd meta_ext, hid_t_f* meta_plist, size_t_f* raw_ext_size, _fcd raw_ext, hid_t_f * raw_plist) +/******/ { int ret_value = -1; hid_t c_prp_id; @@ -1331,20 +1622,28 @@ nh5pget_fapl_split_c(hid_t_f *prp_id, size_t_f* meta_ext_size , _fcd meta_ext, h } #endif /*NO_SUCH_F90_FUNCTION*/ -/*---------------------------------------------------------------------------- - * Name: h5pset_gc_references_c - * Purpose: Call H5Pset_gc_references to set garbage +/****if* H5Pf/h5pset_gc_references_c + * NAME + * h5pset_gc_references_c + * PURPOSE + * Call H5Pset_gc_references to set garbage * collecting references flag - * Inputs: prp_id - property list identifier + * INPUTS + * prp_id - property list identifier * gc_reference - flag for garbage collecting references * for the file - * Returns: 0 on success, -1 on failure - * Programmer: Xiangyang Su + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Xiangyang Su * Friday, February 25, 2000 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pset_gc_references_c (hid_t_f *prp_id, int_f* gc_references) +/******/ { int ret_value = -1; hid_t c_prp_id; @@ -1363,20 +1662,28 @@ nh5pset_gc_references_c (hid_t_f *prp_id, int_f* gc_references) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pget_gc_references_c - * Purpose: Call H5Pget_gc_references to set garbage +/****if* H5Pf/h5pget_gc_references_c + * NAME + * h5pget_gc_references_c + * PURPOSE + * Call H5Pget_gc_references to set garbage * collecting references flag - * Inputs: prp_id - property list identifier + * INPUTS + * prp_id - property list identifier * Outputs gc_reference - flag for garbage collecting references * for the file - * Returns: 0 on success, -1 on failure - * Programmer: Xiangyang Su + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Xiangyang Su * Friday, February 25, 2000 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pget_gc_references_c (hid_t_f *prp_id, int_f* gc_references) +/******/ { int ret_value = -1; hid_t c_prp_id; @@ -1393,19 +1700,27 @@ nh5pget_gc_references_c (hid_t_f *prp_id, int_f* gc_references) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pset_layout_c - * Purpose: Call H5Pset_layout to the type of storage used +/****if* H5Pf/h5pset_layout_c + * NAME + * h5pset_layout_c + * PURPOSE + * Call H5Pset_layout to the type of storage used * store the raw data for a dataset - * Inputs: prp_id - property list identifier + * INPUTS + * prp_id - property list identifier * layout - Type of storage layout for raw data. - * Returns: 0 on success, -1 on failure - * Programmer: Xiangyang Su + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Xiangyang Su * Friday, February 25, 2000 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pset_layout_c (hid_t_f *prp_id, int_f* layout) +/******/ { int ret_value = -1; hid_t c_prp_id; @@ -1423,19 +1738,28 @@ nh5pset_layout_c (hid_t_f *prp_id, int_f* layout) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pget_layout_c - * Purpose: Call H5Pget_layout to the type of storage used +/****if* H5Pf/h5pget_layout_c + * NAME + * h5pget_layout_c + * PURPOSE + * Call H5Pget_layout to the type of storage used * store the raw data for a dataset - * Inputs: prp_id - property list identifier - * Outputs: layout - Type of storage layout for raw data. - * Returns: 0 on success, -1 on failure - * Programmer: Xiangyang Su + * INPUTS + * prp_id - property list identifier + * OUTPUTS + * layout - Type of storage layout for raw data. + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Xiangyang Su * Friday, February 25, 2000 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pget_layout_c (hid_t_f *prp_id, int_f* layout) +/******/ { int ret_value = -1; hid_t c_prp_id; @@ -1451,22 +1775,30 @@ nh5pget_layout_c (hid_t_f *prp_id, int_f* layout) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pset_filter_c - * Purpose: Call H5Pset_filter to add a filter to the filter pipeline. - * Inputs: prp_id - property list identifier +/****if* H5Pf/h5pset_filter_c + * NAME + * h5pset_filter_c + * PURPOSE + * Call H5Pset_filter to add a filter to the filter pipeline. + * INPUTS + * prp_id - property list identifier * filter - Filter to be added to the pipeline. * flags - Bit vector specifying certain general * properties of the filter. * cd_nelmts - Number of elements in cd_values. * cd_values - Auxiliary data for the filter. - * Returns: 0 on success, -1 on failure - * Programmer: Xiangyang Su + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Xiangyang Su * Wednesday, February 23, 2000 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pset_filter_c (hid_t_f *prp_id, int_f* filter, int_f* flags, size_t_f* cd_nelmts, int_f* cd_values ) +/******/ { int ret_value = -1; hid_t c_prp_id; @@ -1499,19 +1831,26 @@ DONE: return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pget_nfilters_c - * Purpose: Call H5Pget_nfilters to get the number of filters - * in the pipeline - * Inputs: prp_id - property list identifier - * Outputs: nfilters - number of filters defined in the filter pipline - * Returns: 0 on success, -1 on failure - * Programmer: Xiangyang Su - * Friday, February 25, 2000 - * Modifications: - *---------------------------------------------------------------------------*/ +/****if* H5Pf/h5pget_nfilters_c + * NAME + * h5pget_nfilters_c + * PURPOSE + * Call H5Pget_nfilters to get the number of filters + * in the pipeline + * INPUTS + * prp_id - property list identifier + * OUTPUTS + * nfilters - number of filters defined in the filter pipline + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Xiangyang Su + * Friday, February 25, 2000 + * SOURCE +*/ int_f nh5pget_nfilters_c (hid_t_f *prp_id, int_f* nfilters) +/******/ { int ret_value = -1; hid_t c_prp_id; @@ -1554,9 +1893,10 @@ nh5pget_nfilters_c (hid_t_f *prp_id, int_f* nfilters) *---------------------------------------------------------------------------*/ int_f nh5pget_filter_c(hid_t_f *prp_id, int_f* filter_number, int_f* flags, size_t_f* cd_nelmts, int_f* cd_values, size_t_f *namelen, _fcd name, int_f* filter_id) +/******/ { unsigned int c_flags; - size_t c_cd_nelmts; + size_t c_cd_nelmts = 0; H5Z_filter_t c_filter; unsigned int *c_cd_values = NULL; char *c_name = NULL; @@ -1595,23 +1935,31 @@ DONE: return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pset_external_c - * Purpose: Call H5Pset_external to add an external file to the +/****if* H5Pf/h5pset_external_c + * NAME + * h5pset_external_c + * PURPOSE + * Call H5Pset_external to add an external file to the * list of external files. - * Inputs: prp_id - property list identifier + * INPUTS + * prp_id - property list identifier * name - Name of an external file * namelen - length of name * offset - Offset, in bytes, from the beginning of the file * to the location in the file where the data starts. * bytes - Number of bytes reserved in the file for the data. - * Returns: 0 on success, -1 on failure - * Programmer: Xiangyang Su + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Xiangyang Su * Wednesday, February 23, 2000 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pset_external_c (hid_t_f *prp_id, _fcd name, int_f* namelen, int_f* offset, hsize_t_f*bytes) +/******/ { int ret_value = -1; hid_t c_prp_id; @@ -1642,19 +1990,28 @@ DONE: return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pget_external_count_c - * Purpose: Call H5Pget_external_count to get the number of external +/****if* H5Pf/h5pget_external_count_c + * NAME + * h5pget_external_count_c + * PURPOSE + * Call H5Pget_external_count to get the number of external * files for the specified dataset. - * Inputs: prp_id - property list identifier - * Outputs: count - number of external files - * Returns: 0 on success, -1 on failure - * Programmer: Xiangyang Su + * INPUTS + * prp_id - property list identifier + * OUTPUTS + * count - number of external files + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Xiangyang Su * Friday, February 25, 2000 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pget_external_count_c (hid_t_f *prp_id, int_f* count) +/******/ { int ret_value = -1; hid_t c_prp_id; @@ -1670,23 +2027,32 @@ nh5pget_external_count_c (hid_t_f *prp_id, int_f* count) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pget_external_c - * Purpose: Call H5Pget_external to get nformation about an external file. - * Inputs: prp_id - property list identifier - * name_size - length of name - * idx - External file index. - *Outputs: name - Name of an external file - * offset - Offset, in bytes, from the beginning of the file - * to the location in the file where the data starts. - * bytes - Number of bytes reserved in the file for the data. - * Returns: 0 on success, -1 on failure - * Programmer: Xiangyang Su - * Wednesday, February 23, 2000 - * Modifications: - *---------------------------------------------------------------------------*/ +/****if* H5Pf/h5pget_external_c + * NAME + * h5pget_external_c + * PURPOSE + * Call H5Pget_external to get nformation about an external file. + * INPUTS + * prp_id - property list identifier + * name_size - length of name + * idx - External file index. + *OUTPUT + * name - Name of an external file + * offset - Offset, in bytes, from the beginning of the file + * to the location in the file where the data starts. + * bytes - Number of bytes reserved in the file for the data. + * RETURNS + * on success, -1 on failure + * AUTHOR + * Xiangyang Su + * Wednesday, February 23, 2000 + * HISTORY + * + * SOURCE +*/ int_f nh5pget_external_c(hid_t_f *prp_id, int_f *idx, size_t_f* name_size, _fcd name, int_f* offset, hsize_t_f*bytes) +/******/ { int ret_value = -1; hid_t c_prp_id; @@ -1719,7 +2085,7 @@ nh5pget_external_c(hid_t_f *prp_id, int_f *idx, size_t_f* name_size, _fcd name, * from the function then we need to give HD5packFstring the fortran buffer size so * that it fills the remaining unused characters with blanks. MSB */ - HD5packFstring(c_name, _fcdtocp(name), c_namelen+1); + HD5packFstring(c_name, _fcdtocp(name), c_namelen); ret_value = 0; DONE: @@ -1727,22 +2093,30 @@ DONE: return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pset_btree_ratios_c - * Purpose: Call H5Pset_btree_ratios to set B-tree split ratios for B-tree split ratios for a dataset transfer property list. a +/****if* H5Pf/h5pset_btree_ratios_c + * NAME + * h5pset_btree_ratios_c + * PURPOSE + * Call H5Pset_btree_ratios to set B-tree split ratios for B-tree split ratios for a dataset transfer property list. a * dataset transfer property list. - * Inputs: prp_id - property list identifier + * INPUTS + * prp_id - property list identifier * left - The B-tree split ratio for left-most nodes. * middle - The B-tree split ratio for all other nodes * right - The B-tree split ratio for right-most nodes * and lone nodes. - * Returns: 0 on success, -1 on failure - * Programmer: Xiangyang Su + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Xiangyang Su * Friday, February 25, 2000 - * Modifications: Changed the type of the last three parameters from double to real_f - *---------------------------------------------------------------------------*/ + * HISTORY + * Changed the type of the last three parameters from double to real_f + * SOURCE +*/ int_f nh5pset_btree_ratios_c(hid_t_f *prp_id, real_f* left, real_f* middle, real_f* right) +/******/ { int ret_value = -1; hid_t c_prp_id; @@ -1764,22 +2138,30 @@ nh5pset_btree_ratios_c(hid_t_f *prp_id, real_f* left, real_f* middle, real_f* ri return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pget_btree_ratios_c - * Purpose: Call H5Pget_btree_ratios to Gets B-tree split ratios +/****if* H5Pf/h5pget_btree_ratios_c + * NAME + * h5pget_btree_ratios_c + * PURPOSE + * Call H5Pget_btree_ratios to Gets B-tree split ratios * for a dataset transfer property list. - * Inputs: prp_id - property list identifier + * INPUTS + * prp_id - property list identifier * left - The B-tree split ratio for left-most nodes. * middle - The B-tree split ratio for all other nodes * right - The B-tree split ratio for right-most nodes * and lone nodes. - * Returns: 0 on success, -1 on failure - * Programmer: Xiangyang Su + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Xiangyang Su * Friday, February 25, 2000 - * Modifications: Changed the type of the last three parameters from double to real_f - *---------------------------------------------------------------------------*/ + * HISTORY + * Changed the type of the last three parameters from double to real_f + * SOURCE +*/ int_f nh5pget_btree_ratios_c(hid_t_f *prp_id, real_f* left, real_f* middle, real_f* right) +/******/ { int ret_value = -1; hid_t c_prp_id; @@ -1798,24 +2180,33 @@ nh5pget_btree_ratios_c(hid_t_f *prp_id, real_f* left, real_f* middle, real_f* ri ret_value = 0; return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pget_fclose_degree_c - * Purpose: Call H5Pget_fclose_degree to determine file close behavior - * Inputs: fapl_id - file access identifier - * Outputs: +/****if* H5Pf/h5pget_fclose_degree_c + * NAME + * h5pget_fclose_degree_c + * PURPOSE + * Call H5Pget_fclose_degree to determine file close behavior + * INPUTS + * fapl_id - file access identifier + * OUTPUTS + * * degree - possible values are: * H5F_CLOSE_DEFAULT * H5F_CLOSE_WEAK * H5F_CLOSE_SEMI * H5F_CLOSE_STRONG - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Thursday, September 26, 2002 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pget_fclose_degree_c ( hid_t_f *fapl_id , int_f *degree) +/******/ { int ret_value = -1; hid_t c_fapl_id; @@ -1829,23 +2220,31 @@ nh5pget_fclose_degree_c ( hid_t_f *fapl_id , int_f *degree) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pset_fclose_degree_c - * Purpose: Call H5Pset_fclose_degree to set file close behavior - * Inputs: fapl_id - file access identifier +/****if* H5Pf/h5pset_fclose_degree_c + * NAME + * h5pset_fclose_degree_c + * PURPOSE + * Call H5Pset_fclose_degree to set file close behavior + * INPUTS + * fapl_id - file access identifier * degree - possible values are: * H5F_CLOSE_DEFAULT * H5F_CLOSE_WEAK * H5F_CLOSE_SEMI * H5F_CLOSE_STRONG - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Thursday, September 26, 2002 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pset_fclose_degree_c ( hid_t_f *fapl_id , int_f *degree) +/******/ { int ret_value = -1; hid_t c_fapl_id; @@ -1859,20 +2258,29 @@ nh5pset_fclose_degree_c ( hid_t_f *fapl_id , int_f *degree) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pset_buffer_c - * Purpose: Call H5Pset_buffer to set size of conversion buffer - * Inputs: prp_id - t`dataset trasfer property list identifier +/****if* H5Pf/h5pset_buffer_c + * NAME + * h5pset_buffer_c + * PURPOSE + * Call H5Pset_buffer to set size of conversion buffer + * INPUTS + * prp_id - t`dataset trasfer property list identifier * size - size of the buffer - * Outputs: NONE - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * OUTPUTS + * NONE + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Wednesday, October 2, 2002 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pset_buffer_c ( hid_t_f *prp_id , hsize_t_f *size) +/******/ { int ret_value = 0; hid_t c_prp_id; @@ -1884,19 +2292,28 @@ nh5pset_buffer_c ( hid_t_f *prp_id , hsize_t_f *size) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pget_buffer_c - * Purpose: Call H5Pget_buffer to get size of conversion buffer - * Inputs: prp_id - t`dataset trasfer property list identifier - * Outputs: size - size of conversion buffer - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal +/****if* H5Pf/h5pget_buffer_c + * NAME + * h5pget_buffer_c + * PURPOSE + * Call H5Pget_buffer to get size of conversion buffer + * INPUTS + * prp_id - t`dataset trasfer property list identifier + * OUTPUTS + * size - size of conversion buffer + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Wednesday, October 2, 2002 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pget_buffer_c ( hid_t_f *prp_id , hsize_t_f *size) +/******/ { int ret_value = -1; hid_t c_prp_id; @@ -1909,19 +2326,28 @@ nh5pget_buffer_c ( hid_t_f *prp_id , hsize_t_f *size) ret_value = 0; return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pfill_value_defined_c - * Purpose: Call H5Pfill_value_defined to check if fill value is defined - * Inputs: prp_id - dataset creation property list identifier - * Outputs: flag - fill value status flag - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal +/****if* H5Pf/h5pfill_value_defined_c + * NAME + * h5pfill_value_defined_c + * PURPOSE + * Call H5Pfill_value_defined to check if fill value is defined + * INPUTS + * prp_id - dataset creation property list identifier + * OUTPUTS + * flag - fill value status flag + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Friday, October 4, 2002 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pfill_value_defined_c ( hid_t_f *prp_id , int_f *flag) +/******/ { int ret_value = -1; hid_t c_prp_id; @@ -1933,20 +2359,29 @@ nh5pfill_value_defined_c ( hid_t_f *prp_id , int_f *flag) ret_value = 0; return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pget_alloc_time_c - * Purpose: Call H5Pget_alloc_time to get space allocation +/****if* H5Pf/h5pget_alloc_time_c + * NAME + * h5pget_alloc_time_c + * PURPOSE + * Call H5Pget_alloc_time to get space allocation * time for dataset during creation - * Inputs: prp_id - dataset creation property list identifier - * Outputs: flag - allocation time flag - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * INPUTS + * prp_id - dataset creation property list identifier + * OUTPUTS + * flag - allocation time flag + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Friday, October 4, 2002 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pget_alloc_time_c ( hid_t_f *prp_id , int_f *flag) +/******/ { int ret_value = -1; hid_t c_prp_id; @@ -1958,20 +2393,28 @@ nh5pget_alloc_time_c ( hid_t_f *prp_id , int_f *flag) ret_value = 0; return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pset_alloc_time_c - * Purpose: Call H5Pset_alloc_time to get space allocation +/****if* H5Pf/h5pset_alloc_time_c + * NAME + * h5pset_alloc_time_c + * PURPOSE + * Call H5Pset_alloc_time to get space allocation * time for dataset during creation - * Inputs: prp_id - dataset creation property list identifier + * INPUTS + * prp_id - dataset creation property list identifier * flag - allocation time flag - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Friday, October 4, 2002 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pset_alloc_time_c ( hid_t_f *prp_id , int_f *flag) +/******/ { int ret_value = -1; hid_t c_prp_id; @@ -1983,20 +2426,29 @@ nh5pset_alloc_time_c ( hid_t_f *prp_id , int_f *flag) ret_value = 0; return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pget_fill_time_c - * Purpose: Call H5Pget_fill_time to get fill value writing +/****if* H5Pf/h5pget_fill_time_c + * NAME + * h5pget_fill_time_c + * PURPOSE + * Call H5Pget_fill_time to get fill value writing * time for dataset during creation - * Inputs: prp_id - dataset creation property list identifier - * Outputs: flag - fill value writing time flag - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * INPUTS + * prp_id - dataset creation property list identifier + * OUTPUTS + * flag - fill value writing time flag + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Friday, October 4, 2002 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pget_fill_time_c ( hid_t_f *prp_id , int_f *flag) +/******/ { int ret_value = -1; hid_t c_prp_id; @@ -2008,20 +2460,28 @@ nh5pget_fill_time_c ( hid_t_f *prp_id , int_f *flag) ret_value = 0; return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pset_fill_time_c - * Purpose: Call H5Pset_fill_time to set fill value writing +/****if* H5Pf/h5pset_fill_time_c + * NAME + * h5pset_fill_time_c + * PURPOSE + * Call H5Pset_fill_time to set fill value writing * time for dataset during creation - * Inputs: prp_id - dataset creation property list identifier + * INPUTS + * prp_id - dataset creation property list identifier * flag - fill value writing time flag - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Friday, October 4, 2002 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pset_fill_time_c ( hid_t_f *prp_id , int_f *flag) +/******/ { int ret_value = -1; hid_t c_prp_id; @@ -2033,20 +2493,29 @@ nh5pset_fill_time_c ( hid_t_f *prp_id , int_f *flag) ret_value = 0; return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pset_meta_block_size_c - * Purpose: Call H5Pset_meta_block_size to set size of metadata block - * Inputs: prp_id - file access property list identifier +/****if* H5Pf/h5pset_meta_block_size_c + * NAME + * h5pset_meta_block_size_c + * PURPOSE + * Call H5Pset_meta_block_size to set size of metadata block + * INPUTS + * prp_id - file access property list identifier * size - size of the metadata block - * Outputs: NONE - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * OUTPUTS + * NONE + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Monday, October 7, 2002 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pset_meta_block_size_c ( hid_t_f *prp_id , hsize_t_f *size) +/******/ { int ret_value = 0; hid_t c_prp_id; @@ -2057,20 +2526,29 @@ nh5pset_meta_block_size_c ( hid_t_f *prp_id , hsize_t_f *size) if ( H5Pset_meta_block_size(c_prp_id, c_size) < 0 ) ret_value = -1; return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pget_meta_block_size_c - * Purpose: Call H5Pget_meta_block_size to get size of metadata block - * Inputs: prp_id - file access property list identifier - * Outputs: +/****if* H5Pf/h5pget_meta_block_size_c + * NAME + * h5pget_meta_block_size_c + * PURPOSE + * Call H5Pget_meta_block_size to get size of metadata block + * INPUTS + * prp_id - file access property list identifier + * OUTPUTS + * * size - size of the metadata block - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Monday, October 7, 2002 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pget_meta_block_size_c ( hid_t_f *prp_id , hsize_t_f *size) +/******/ { int ret_value = 0; hid_t c_prp_id; @@ -2081,20 +2559,29 @@ nh5pget_meta_block_size_c ( hid_t_f *prp_id , hsize_t_f *size) *size = (hsize_t_f)c_size; return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pset_sieve_buf_size_c - * Purpose: Call H5Pset_sieve_buf_size to set size of datasieve buffer - * Inputs: prp_id - file access property list identifier +/****if* H5Pf/h5pset_sieve_buf_size_c + * NAME + * h5pset_sieve_buf_size_c + * PURPOSE + * Call H5Pset_sieve_buf_size to set size of datasieve buffer + * INPUTS + * prp_id - file access property list identifier * size - size of the buffer - * Outputs: NONE - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * OUTPUTS + * NONE + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Monday, October 7, 2002 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pset_sieve_buf_size_c ( hid_t_f *prp_id , size_t_f *size) +/******/ { int ret_value = 0; hid_t c_prp_id; @@ -2105,20 +2592,29 @@ nh5pset_sieve_buf_size_c ( hid_t_f *prp_id , size_t_f *size) if ( H5Pset_sieve_buf_size(c_prp_id, c_size) < 0 ) ret_value = -1; return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pget_sieve_buf_size_c - * Purpose: Call H5Pget_sieve_buf_size to get size of datasieve buffer - * Inputs: prp_id - file access property list identifier - * Outputs: +/****if* H5Pf/h5pget_sieve_buf_size_c + * NAME + * h5pget_sieve_buf_size_c + * PURPOSE + * Call H5Pget_sieve_buf_size to get size of datasieve buffer + * INPUTS + * prp_id - file access property list identifier + * OUTPUTS + * * size - size of the buffer - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Monday, October 7, 2002 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pget_sieve_buf_size_c ( hid_t_f *prp_id , size_t_f *size) +/******/ { int ret_value = 0; hid_t c_prp_id; @@ -2129,20 +2625,29 @@ nh5pget_sieve_buf_size_c ( hid_t_f *prp_id , size_t_f *size) *size = (size_t_f)c_size; return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pset_small_data_block_size_c - * Purpose: Call H5Pset_small_data_block_size to set size of raw small data block - * Inputs: prp_id - file access property list identifier +/****if* H5Pf/h5pset_small_data_block_size_c + * NAME + * h5pset_small_data_block_size_c + * PURPOSE + * Call H5Pset_small_data_block_size to set size of raw small data block + * INPUTS + * prp_id - file access property list identifier * size - size of the block - * Outputs: NONE - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * OUTPUTS + * NONE + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Monday, October 7, 2002 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pset_small_data_block_size_c ( hid_t_f *prp_id , hsize_t_f *size) +/******/ { int ret_value = 0; hid_t c_prp_id; @@ -2153,20 +2658,29 @@ nh5pset_small_data_block_size_c ( hid_t_f *prp_id , hsize_t_f *size) if ( H5Pset_small_data_block_size(c_prp_id, c_size) < 0 ) ret_value = -1; return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pget_small_data_block_size_c - * Purpose: Call H5Pget_small_data_block_size to get size of raw small data block - * Inputs: prp_id - file access property list identifier - * Outputs: +/****if* H5Pf/h5pget_small_data_block_size_c + * NAME + * h5pget_small_data_block_size_c + * PURPOSE + * Call H5Pget_small_data_block_size to get size of raw small data block + * INPUTS + * prp_id - file access property list identifier + * OUTPUTS + * * size - size of the block - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Monday, October 7, 2002 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pget_small_data_block_size_c ( hid_t_f *prp_id , hsize_t_f *size) +/******/ { int ret_value = 0; hid_t c_prp_id; @@ -2177,20 +2691,29 @@ nh5pget_small_data_block_size_c ( hid_t_f *prp_id , hsize_t_f *size) *size = (hsize_t_f)c_size; return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pset_hyper_vector_size_c - * Purpose: Call H5Pset_hyper_vector_size to set size of the hyper vector - * Inputs: prp_id - dataset transfer property list identifier +/****if* H5Pf/h5pset_hyper_vector_size_c + * NAME + * h5pset_hyper_vector_size_c + * PURPOSE + * Call H5Pset_hyper_vector_size to set size of the hyper vector + * INPUTS + * prp_id - dataset transfer property list identifier * size - size of the vector - * Outputs: NONE - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * OUTPUTS + * NONE + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Monday, October 7, 2002 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pset_hyper_vector_size_c ( hid_t_f *prp_id , size_t_f *size) +/******/ { int ret_value = 0; hid_t c_prp_id; @@ -2201,20 +2724,29 @@ nh5pset_hyper_vector_size_c ( hid_t_f *prp_id , size_t_f *size) if ( H5Pset_hyper_vector_size(c_prp_id, c_size) < 0 ) ret_value = -1; return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pget_hyper_vector_size_c - * Purpose: Call H5Pget_hyper_vector_size to get size of the hyper vector - * Inputs: prp_id - dataset transfer property list identifier - * Outputs: +/****if* H5Pf/h5pget_hyper_vector_size_c + * NAME + * h5pget_hyper_vector_size_c + * PURPOSE + * Call H5Pget_hyper_vector_size to get size of the hyper vector + * INPUTS + * prp_id - dataset transfer property list identifier + * OUTPUTS + * * size - size of the vector - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Monday, October 7, 2002 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pget_hyper_vector_size_c ( hid_t_f *prp_id , size_t_f *size) +/******/ { int ret_value = 0; hid_t c_prp_id; @@ -2225,34 +2757,48 @@ nh5pget_hyper_vector_size_c ( hid_t_f *prp_id , size_t_f *size) *size = (size_t_f)c_size; return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pcreate_class_c - * Purpose: Call H5Pcreate_class ito create a new property class - * Inputs: parent - property list class identifier + +/****if* H5Pf/h5pcreate_class_c + * NAME + * h5pcreate_class_c + * PURPOSE + * Call H5Pcreate_class ito create a new property class + * INPUTS + * parent - property list class identifier * name - name of the new class * name_len - lenght of the "name" buffer - * Outputs: cls - new class identifier - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal - * October 11, 2002 - * Modifications: - *---------------------------------------------------------------------------*/ -int_f -nh5pcreate_class_c(hid_t_f *parent, _fcd name, int_f *name_len, hid_t_f *cls) + * OUTPUTS + * class - new class identifier + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal + * October 11, 2002 + * + * HISTORY + * Added the callback parameters (FORTRAN 2003 compilers only) + * M. Scot Breitenfeld, July 3, 2008 + * SOURCE +*/ +int_f +nh5pcreate_class_c(hid_t_f *parent, _fcd name, int_f *name_len, hid_t_f *cls, + H5P_cls_create_func_t create, void *create_data, + H5P_cls_copy_func_t copy, void *copy_data, + H5P_cls_close_func_t close, void *close_data) +/******/ { int ret_value = -1; - hid_t c_parent; hid_t c_class; char* c_name; c_name = (char *)HD5f2cstring(name, (size_t)*name_len); if (c_name == NULL) goto DONE; - c_parent = (hid_t)*parent; /* * Call H5Pcreate_class function. */ - c_class = H5Pcreate_class(c_parent, c_name, NULL, NULL,NULL,NULL,NULL,NULL); + c_class = H5Pcreate_class((hid_t)*parent, c_name, create, create_data, copy, copy_data, close, close_data); + if (c_class < 0) goto DONE; *cls = (hid_t_f)c_class; ret_value = 0; @@ -2262,21 +2808,30 @@ DONE: return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pregisterc_c - * Purpose: Call h5pregister_c to registers a permanent property - * Inputs: cls - property list class identifier + +/****if* H5Pf/h5pregisterc_c + * NAME + * h5pregisterc_c + * PURPOSE + * Call h5pregister_c to registers a permanent property + * INPUTS + * class - property list class identifier * name - name of the new property * name_len - length of the "name" buffer * size - property size * value - property value of character type - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal - * October 11, 2002 - * Modifications: - *---------------------------------------------------------------------------*/ + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal + * October 11, 2002 + * HISTORY + * + * SOURCE +*/ int_f nh5pregisterc_c(hid_t_f *cls, _fcd name, int_f *name_len, size_t_f *size, _fcd value, int_f UNUSED *value_len) +/******/ { int ret_value = -1; @@ -2287,21 +2842,29 @@ nh5pregisterc_c(hid_t_f *cls, _fcd name, int_f *name_len, size_t_f *size, _fcd v return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pregister_c - * Purpose: Call H5Pregister2 to registers a permanent property - * Inputs: cls - property list class identifier +/****if* H5Pf/h5pregister_c + * NAME + * h5pregister_c + * PURPOSE + * Call H5Pregister2 to registers a permanent property + * INPUTS + * class - property list class identifier * name - name of the new property * name_len - length of the "name" buffer * size - property size * value - property value - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * October 11, 2002 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pregister_c(hid_t_f *cls, _fcd name, int_f *name_len, size_t_f *size, void UNUSED *value) +/******/ { char* c_name = NULL; int_f ret_value = -1; @@ -2349,21 +2912,29 @@ nh5pregister_double_c(hid_t_f *cls, _fcd name, int_f *name_len, size_t_f *size, return nh5pregister_c(cls, name, name_len, size, value); } -/*---------------------------------------------------------------------------- - * Name: h5pinsertc_c - * Purpose: Call h5pinsert_c to register a temporary property - * Inputs: plist - property list identifier +/****if* H5Pf/h5pinsertc_c + * NAME + * h5pinsertc_c + * PURPOSE + * Call h5pinsert_c to register a temporary property + * INPUTS + * plist - property list identifier * name - name of the new property * name_len - length of the "name" buffer * size - property size * value - property value of character type - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * October 11, 2002 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pinsertc_c(hid_t_f *plist, _fcd name, int_f *name_len, size_t_f *size, _fcd value, int_f UNUSED *value_len) +/******/ { int_f ret_value = -1; @@ -2374,21 +2945,29 @@ nh5pinsertc_c(hid_t_f *plist, _fcd name, int_f *name_len, size_t_f *size, _fcd v return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pinsert_c - * Purpose: Call H5Pinsert2 to iinsert a temporary property - * Inputs: plist - property list class identifier +/****if* H5Pf/h5pinsert_c + * NAME + * h5pinsert_c + * PURPOSE + * Call H5Pinsert2 to iinsert a temporary property + * INPUTS + * plist - property list class identifier * name - name of the new property * name_len - length of the "name" buffer * size - property size * value - property value - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * October 11, 2002 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pinsert_c(hid_t_f *plist, _fcd name, int_f *name_len, size_t_f *size, void UNUSED *value) +/******/ { char* c_name = NULL; int_f ret_value = -1; @@ -2436,20 +3015,28 @@ nh5pinsert_double_c(hid_t_f *plist, _fcd name, int_f *name_len, size_t_f *size, return nh5pinsert_c(plist, name, name_len, size, value); } -/*---------------------------------------------------------------------------- - * Name: h5pexist_c - * Purpose: Call H5Pexist to querie whether a property name exists +/****if* H5Pf/h5pexist_c + * NAME + * h5pexist_c + * PURPOSE + * Call H5Pexist to querie whether a property name exists * in a property list or class - * Inputs: plist - property list or property class identifier + * INPUTS + * plist - property list or property class identifier * name - name of the new property * name_len - length of the "name" buffer - * Returns: nonnegative on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * nonnegative on success, -1 on failure + * AUTHOR + * Elena Pourmal * October 11, 2002 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pexist_c(hid_t_f *cls, _fcd name, int_f *name_len) +/******/ { int_f ret_value = -1; hid_t c_class; @@ -2470,19 +3057,27 @@ DONE: if(c_name != NULL) HDfree(c_name); return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pisa_class_c - * Purpose: Call H5Pisa_class to querie whether a property is a +/****if* H5Pf/h5pisa_class_c + * NAME + * h5pisa_class_c + * PURPOSE + * Call H5Pisa_class to querie whether a property is a * member of a class - * Inputs: plist - property list identifier + * INPUTS + * plist - property list identifier * cls - property class identifier - * Returns: nonnegative on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * nonnegative on success, -1 on failure + * AUTHOR + * Elena Pourmal * October 11, 2002 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pisa_class_c(hid_t_f *plist, hid_t_f *cls) +/******/ { int_f ret_value = -1; hid_t c_class; @@ -2499,20 +3094,29 @@ nh5pisa_class_c(hid_t_f *plist, hid_t_f *cls) ret_value = status; return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pget_size_c - * Purpose: Call H5Pget_size to querie the size of the property - * Inputs: plist - property list to query +/****if* H5Pf/h5pget_size_c + * NAME + * h5pget_size_c + * PURPOSE + * Call H5Pget_size to querie the size of the property + * INPUTS + * plist - property list to query * name - name of the property * name_len - length of the "name" buffer - * Outputs: size - size of the property in bytes - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * OUTPUTS + * size - size of the property in bytes + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * October 11, 2002 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pget_size_c(hid_t_f *plist, _fcd name, int_f *name_len, size_t_f *size) +/******/ { int_f ret_value = -1; hid_t c_plist; @@ -2534,18 +3138,27 @@ DONE: if(c_name != NULL) HDfree(c_name); return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pget_nprops_c - * Purpose: Call H5Pget_nporps to get number of the properties in the list - * Inputs: plist - property list to query - * Outputs: nprops - number of properties in the list - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal +/****if* H5Pf/h5pget_nprops_c + * NAME + * h5pget_nprops_c + * PURPOSE + * Call H5Pget_nporps to get number of the properties in the list + * INPUTS + * plist - property list to query + * OUTPUTS + * nprops - number of properties in the list + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * October 11, 2002 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pget_nprops_c(hid_t_f *plist, size_t_f *nprops) +/******/ { int_f ret_value = -1; hid_t c_plist; @@ -2562,19 +3175,28 @@ nh5pget_nprops_c(hid_t_f *plist, size_t_f *nprops) ret_value = 0; return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pget_class_parent_c - * Purpose: Call H5Pget_class_parent to get the parent class of +/****if* H5Pf/h5pget_class_parent_c + * NAME + * h5pget_class_parent_c + * PURPOSE + * Call H5Pget_class_parent to get the parent class of * a genereic property class - * Inputs: prp_id - property list to query - * Outputs: parent_id - parent classs identifier - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * INPUTS + * prp_id - property list to query + * OUTPUTS + * parent_id - parent classs identifier + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * October 11, 2002 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pget_class_parent_c(hid_t_f *prp_id, hid_t_f *parent_id) +/******/ { int_f ret_value = -1; hid_t c_prp_id; @@ -2592,21 +3214,29 @@ nh5pget_class_parent_c(hid_t_f *prp_id, hid_t_f *parent_id) ret_value = 0; return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pcopy_prop_c - * Purpose: Call H5Pcopy_prop to copy a property from one list or +/****if* H5Pf/h5pcopy_prop_c + * NAME + * h5pcopy_prop_c + * PURPOSE + * Call H5Pcopy_prop to copy a property from one list or * class to another - * Inputs: dst_id - identifier of destination property list + * INPUTS + * dst_id - identifier of destination property list * src_id - identifier of source property list * name - name of the property * name_len - length of the "name" buffer - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * October 11, 2002 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pcopy_prop_c(hid_t_f *dst_id, hid_t_f *src_id, _fcd name, int_f *name_len) +/******/ { int_f ret_value = -1; hid_t c_dst_id, c_src_id; @@ -2627,19 +3257,27 @@ DONE: if(c_name != NULL) HDfree(c_name); return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5premove_c - * Purpose: Call H5Premove to remove a property from a list - * Inputs: plid - identifier of property list +/****if* H5Pf/h5premove_c + * NAME + * h5premove_c + * PURPOSE + * Call H5Premove to remove a property from a list + * INPUTS + * plid - identifier of property list * name - name of the property to remove * name_len - length of the "name" buffer - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * October 11, 2002 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5premove_c(hid_t_f *plid, _fcd name, int_f *name_len) +/******/ { int_f ret_value = -1; hid_t c_plid; @@ -2659,19 +3297,27 @@ DONE: if(c_name != NULL) HDfree(c_name); return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5punregister_c - * Purpose: Call H5Punregister to remove a property from a property class - * Inputs: cls - identifier of property class +/****if* H5Pf/h5punregister_c + * NAME + * h5punregister_c + * PURPOSE + * Call H5Punregister to remove a property from a property class + * INPUTS + * cls - identifier of property class * name - name of the property to unregister * name_len - length of the "name" buffer - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal - * October 11, 2002 - * Modifications: - *---------------------------------------------------------------------------*/ + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal + * October 11, 2002 + * HISTORY + * + * SOURCE +*/ int_f nh5punregister_c(hid_t_f *cls, _fcd name, int_f *name_len) +/******/ { int_f ret_value = -1; hid_t c_class; @@ -2691,17 +3337,25 @@ DONE: if(c_name != NULL) HDfree(c_name); return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pclose_class_c - * Purpose: Call H5Pclose_class to close property class - * Inputs: cls - identifier of property class to close - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal - * October 11, 2002 - * Modifications: - *---------------------------------------------------------------------------*/ +/****if* H5Pf/h5pclose_class_c + * NAME + * h5pclose_class_c + * PURPOSE + * Call H5Pclose_class to close property class + * INPUTS + * class - identifier of property class to close + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal + * October 11, 2002 + * HISTORY + * + * SOURCE +*/ int_f nh5pclose_class_c(hid_t_f *cls) +/******/ { int_f ret_value = -1; hid_t c_class; @@ -2714,19 +3368,27 @@ nh5pclose_class_c(hid_t_f *cls) ret_value = 0; return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pget_class_name_c - * Purpose: Call H5Pget_class_name to get property class name - * Inputs: cls - identifier of property class +/****if* H5Pf/h5pget_class_name_c + * NAME + * h5pget_class_name_c + * PURPOSE + * Call H5Pget_class_name to get property class name + * INPUTS + * cls - identifier of property class * name - ibuffer to retrieve name in * name_len - length of the "name" buffer - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal - * October 11, 2002 - * Modifications: - *---------------------------------------------------------------------------*/ + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal + * October 11, 2002 + * HISTORY + * + * SOURCE +*/ int_f nh5pget_class_name_c(hid_t_f *cls, _fcd name, int_f *name_len) +/******/ { int_f ret_value = -1; char *c_name = NULL; /* Buffer to hold C string */ @@ -2753,21 +3415,28 @@ DONE: HDfree(c_name); return ret_value; } - -/*---------------------------------------------------------------------------- - * Name: h5pset_c - * Purpose: Call h5setc_c to set property with the character string value - * Inputs: plist - property list identifier +/****if* H5Pf/h5psetc_c + * NAME + * h5psetc_c + * PURPOSE + * Call h5setc_c to set property with the character string value + * INPUTS + * plist - property list identifier * name - name of property * name_len - length of the "name" buffer * value - property value of character type - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * October 11, 2002 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5psetc_c(hid_t_f *plist, _fcd name, int_f *name_len, _fcd value, int_f UNUSED *value_len) +/******/ { int_f ret_value = -1; @@ -2778,33 +3447,39 @@ nh5psetc_c(hid_t_f *plist, _fcd name, int_f *name_len, _fcd value, int_f UNUSED return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pset_c - * Purpose: Call H5Pset to set property value - * Inputs: plist - property list class identifier +/****if* H5Pf/h5pset_c + * NAME + * h5pset_c + * PURPOSE + * Call H5Pset to set property value + * INPUTS + * plist - property list class identifier * name - name of the new property * name_len - length of the "name" buffer * value - property value - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal - * October 11, 2002 - * Modifications: - *---------------------------------------------------------------------------*/ + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal + * October 11, 2002 + * HISTORY + * + * SOURCE +*/ int_f -nh5pset_c(hid_t_f *plist, _fcd name, int_f *name_len, void UNUSED *value) +nh5pset_c(hid_t_f *plist, _fcd name, int_f *name_len, void *value) +/******/ { int_f ret_value = -1; - hid_t c_plist; char* c_name; c_name = (char *)HD5f2cstring(name, (size_t)*name_len); if (c_name == NULL) goto DONE; - c_plist = (hid_t)*plist; /* * Call H5Pset function. */ - if( H5Pset(c_plist, c_name, value) <0) goto DONE; + if( H5Pset((hid_t)*plist, c_name, value) <0) goto DONE; ret_value = 0; DONE: @@ -2838,20 +3513,28 @@ nh5pset_double_c(hid_t_f *plist, _fcd name, int_f *name_len, void *value) */ return nh5pset_c(plist, name, name_len, value); } -/*---------------------------------------------------------------------------- - * Name: h5pgetc_c - * Purpose: Call h5set_c to set property with the character string value - * Inputs: plist - property list identifier +/****if* H5Pf/h5pgetc_c + * NAME + * h5pgetc_c + * PURPOSE + * Call h5set_c to set property with the character string value + * INPUTS + * plist - property list identifier * name - name of property * name_len - length of the "name" buffer * Output: value - property value of character type - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * October 11, 2002 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pgetc_c(hid_t_f *plist, _fcd name, int_f *name_len, _fcd value, int_f UNUSED *value_len) +/******/ { int_f ret_value = -1; @@ -2862,33 +3545,39 @@ nh5pgetc_c(hid_t_f *plist, _fcd name, int_f *name_len, _fcd value, int_f UNUSED return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pget_c - * Purpose: Call H5Pget to set property value - * Inputs: plist - property list class identifier +/****if* H5Pf/h5pget_c + * NAME + * h5pget_c + * PURPOSE + * Call H5Pget to set property value + * INPUTS + * plist - property list class identifier * name - name of the new property * name_len - length of the "name" buffer * Output: value - property value - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * October 11, 2002 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f -nh5pget_c(hid_t_f *plist, _fcd name, int_f *name_len, void UNUSED *value) +nh5pget_c(hid_t_f *plist, _fcd name, int_f *name_len, void *value) +/******/ { int_f ret_value = -1; - hid_t c_plist; char* c_name; c_name = (char *)HD5f2cstring(name, (size_t)*name_len); if (c_name == NULL) goto DONE; - c_plist = (hid_t)*plist; /* * Call H5Pset function. */ - if( H5Pget(c_plist, c_name, value) <0) goto DONE; + if( H5Pget((hid_t)*plist, c_name, value) <0) goto DONE; ret_value = 0; DONE: @@ -2924,19 +3613,27 @@ nh5pget_double_c(hid_t_f *plist, _fcd name, int_f *name_len, void *value) } -/*---------------------------------------------------------------------------- - * Name: h5pset_shuffle_c - * Purpose: Call H5Pset_shuffle - * Inputs: prp_id - property list identifier +/****if* H5Pf/h5pset_shuffle_c + * NAME + * h5pset_shuffle_c + * PURPOSE + * Call H5Pset_shuffle + * INPUTS + * prp_id - property list identifier * type_size - size of the datatype in bytes - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Wednesday, March 12, 2003 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pset_shuffle_c ( hid_t_f *prp_id ) +/******/ { int_f ret_value = 0; hid_t c_prp_id; @@ -2947,18 +3644,26 @@ nh5pset_shuffle_c ( hid_t_f *prp_id ) if ( status < 0 ) ret_value = -1; return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pset_fletcher32_c - * Purpose: Call H5Pset_fletcher32 to enable EDC - * Inputs: prp_id - dataset creation property list identifier - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal +/****if* H5Pf/h5pset_fletcher32_c + * NAME + * h5pset_fletcher32_c + * PURPOSE + * Call H5Pset_fletcher32 to enable EDC + * INPUTS + * prp_id - dataset creation property list identifier + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Thursday, March 13, 2003 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pset_fletcher32_c ( hid_t_f *prp_id ) +/******/ { int_f ret_value = 0; hid_t c_prp_id; @@ -2970,19 +3675,27 @@ nh5pset_fletcher32_c ( hid_t_f *prp_id ) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pset_edc_check_c - * Purpose: Call H5Pset_edc_check to enable EDC - * Inputs: prp_id - dataset transfer property list identifier +/****if* H5Pf/h5pset_edc_check_c + * NAME + * h5pset_edc_check_c + * PURPOSE + * Call H5Pset_edc_check to enable EDC + * INPUTS + * prp_id - dataset transfer property list identifier * flag - EDC flag - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Thursday, March 13, 2003 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pset_edc_check_c ( hid_t_f *prp_id, int_f *flag ) +/******/ { int_f ret_value = 0; hid_t c_prp_id; @@ -2996,19 +3709,27 @@ nh5pset_edc_check_c ( hid_t_f *prp_id, int_f *flag ) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pget_edc_check_c - * Purpose: Call H5Pget_edc_check to query EDC - * Inputs: prp_id - dataset transfer property list identifier +/****if* H5Pf/h5pget_edc_check_c + * NAME + * h5pget_edc_check_c + * PURPOSE + * Call H5Pget_edc_check to query EDC + * INPUTS + * prp_id - dataset transfer property list identifier * Outouts: flag - EDC flag - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Thursday, March 13, 2003 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pget_edc_check_c ( hid_t_f *prp_id, int_f *flag ) +/******/ { int_f ret_value = 0; hid_t c_prp_id; @@ -3020,19 +3741,27 @@ nh5pget_edc_check_c ( hid_t_f *prp_id, int_f *flag ) *flag = (int_f)c_flag; return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pset_family_offset_c - * Purpose: Call H5Pset_family_offset to set and offset for family driver - * Inputs: prp_id - property list identifier +/****if* H5Pf/h5pset_family_offset_c + * NAME + * h5pset_family_offset_c + * PURPOSE + * Call H5Pset_family_offset to set and offset for family driver + * INPUTS + * prp_id - property list identifier * offset - offset in bytes - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Wednesday, 19 March 2003 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pset_family_offset_c ( hid_t_f *prp_id , hsize_t_f *offset) +/******/ { int_f ret_value = 0; hid_t c_prp_id; @@ -3046,25 +3775,33 @@ nh5pset_family_offset_c ( hid_t_f *prp_id , hsize_t_f *offset) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pset_fapl_multi_c - * Purpose: Call H5Pset_fapl_multi to set multi file dirver - * Inputs: prp_id - file_creation property list identifier +/****if* H5Pf/h5pset_fapl_multi_c + * NAME + * h5pset_fapl_multi_c + * PURPOSE + * Call H5Pset_fapl_multi to set multi file dirver + * INPUTS + * prp_id - file_creation property list identifier * mem_map - memory mapping array * memb_fapl - property list for each memory usage type * memb_name - array with members names * len - array with the lenght of each name * lenmax - lenght of the name a sdeclared in Fortran * flag - flag allowing partila access when one of the files is missing - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Monday 24, March 2003 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f /*nh5pset_fapl_multi_c ( hid_t_f *prp_id , int_f *memb_map, hid_t_f *memb_fapl, _fcd memb_name, int_f *len, int_f *lenmax, haddr_t_f *memb_addr, int_f *flag) */ nh5pset_fapl_multi_c ( hid_t_f *prp_id , int_f *memb_map, hid_t_f *memb_fapl, _fcd memb_name, int_f *len, int_f *lenmax, real_f *memb_addr, int_f *flag) +/******/ { int_f ret_value = -1; hid_t c_prp_id; @@ -3126,18 +3863,26 @@ DONE: return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pset_fapl_multi_sc - * Purpose: Call H5Pset_fapl_multi to set multi file dirver - * Inputs: prp_id - file_creation property list identifier - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal +/****if* H5Pf/h5pset_fapl_multi_sc + * NAME + * h5pset_fapl_multi_sc + * PURPOSE + * Call H5Pset_fapl_multi to set multi file dirver + * INPUTS + * prp_id - file_creation property list identifier + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * March 31 2003 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pset_fapl_multi_sc ( hid_t_f *prp_id , int_f *flag) +/******/ { int_f ret_value = -1; hid_t c_prp_id; @@ -3155,24 +3900,33 @@ nh5pset_fapl_multi_sc ( hid_t_f *prp_id , int_f *flag) ret_value = 0; return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pget_fapl_multi_c - * Purpose: Call H5Pget_fapl_multi to set multi file dirver - * Inputs: prp_id - file_creation property list identifier +/****if* H5Pf/h5pget_fapl_multi_c + * NAME + * h5pget_fapl_multi_c + * PURPOSE + * Call H5Pget_fapl_multi to set multi file dirver + * INPUTS + * prp_id - file_creation property list identifier * lenmax - lenght of the name a sdeclared in Fortran - * Outputs: memb_map - memory mapping array + * OUTPUTS + * memb_map - memory mapping array * memb_fapl - property list for each memory usage type * memb_name - array with members names * len - array with the lenght of each name * flag - flag allowing partila access when one of the files is missing - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Monday 24, March 2003 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pget_fapl_multi_c ( hid_t_f *prp_id , int_f *memb_map, hid_t_f *memb_fapl, _fcd memb_name, int_f *len, int_f *lenmax, real_f *memb_addr, int_f *flag, int_f *maxlen_out) +/******/ { int_f ret_value = -1; hid_t c_prp_id; @@ -3230,20 +3984,28 @@ HD5packFstring(tmp, _fcdtocp(memb_name), (size_t)(c_lenmax*H5FD_MEM_NTYPES)); return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pset_szip_c - * Purpose: Call H5Pset_szip to set szip compression - * Inputs: prp_id - dataset creation property list identifier +/****if* H5Pf/h5pset_szip_c + * NAME + * h5pset_szip_c + * PURPOSE + * Call H5Pset_szip to set szip compression + * INPUTS + * prp_id - dataset creation property list identifier * options_mask * pixels_per_block -szip compression parameters - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * April 8 2003 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pset_szip_c ( hid_t_f *prp_id , int_f *options_mask, int_f *pixels_per_block) +/******/ { int_f ret_value = -1; hid_t c_prp_id; @@ -3263,19 +4025,28 @@ nh5pset_szip_c ( hid_t_f *prp_id , int_f *options_mask, int_f *pixels_per_block) ret_value = 0; return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pall_filters_avail_c - * Purpose: Call H5Pall_filters_avail - * Inputs: prp_id - dataset creation property list identifier - * Outputs: status - logical flag - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal +/****if* H5Pf/h5pall_filters_avail_c + * NAME + * h5pall_filters_avail_c + * PURPOSE + * Call H5Pall_filters_avail + * INPUTS + * prp_id - dataset creation property list identifier + * OUTPUTS + * status - logical flag + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * April 10 2003 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pall_filters_avail_c ( hid_t_f *prp_id , int_f *status) +/******/ { int_f ret_value = -1; hid_t c_prp_id; @@ -3295,25 +4066,34 @@ nh5pall_filters_avail_c ( hid_t_f *prp_id , int_f *status) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pget_filter_by_id_c - * Purpose: Call H5Pget_filter_by_id2 to get information about a filter +/****if* H5Pf/h5pget_filter_by_id_c + * NAME + * h5pget_filter_by_id_c + * PURPOSE + * Call H5Pget_filter_by_id2 to get information about a filter * in a pipeline - * Inputs: prp_id - property list identifier + * INPUTS + * prp_id - property list identifier * filter_id - filter id * namelen - Anticipated number of characters in name. - *Outputs: flags - Bit vector specifying certain general + *OUTPUT + * flags - Bit vector specifying certain general * properties of the filter. * cd_nelmts - Number of elements in cd_value * cd_values - Auxiliary data for the filter. * name - Name of the filter - * Returns: 0 on success, -1 on failure - * Programmer: Elena POurmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena POurmal * April 10, 2003 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pget_filter_by_id_c(hid_t_f *prp_id, int_f* filter_id, int_f* flags, size_t_f* cd_nelmts, int_f* cd_values, size_t_f *namelen, _fcd name) +/******/ { unsigned int c_flags; size_t c_cd_nelmts = (size_t)*cd_nelmts; @@ -3353,22 +4133,30 @@ DONE: return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pmodify_filter_c - * Purpose: Call H5Pmodify_filter to modify a filter - * Inputs: prp_id - property list identifier +/****if* H5Pf/h5pmodify_filter_c + * NAME + * h5pmodify_filter_c + * PURPOSE + * Call H5Pmodify_filter to modify a filter + * INPUTS + * prp_id - property list identifier * filter - Filter to be modified * flags - Bit vector specifying certain general * properties of the filter. * cd_nelmts - Number of elements in cd_values. * cd_values - Auxiliary data for the filter. - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * April 10 2003 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pmodify_filter_c (hid_t_f *prp_id, int_f* filter, int_f* flags, size_t_f* cd_nelmts, int_f* cd_values ) +/******/ { int_f ret_value = -1; hid_t c_prp_id; @@ -3401,18 +4189,26 @@ DONE: return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5premove_filter_c - * Purpose: Call H5Premove_filter to delete one or more filters - * Inputs: prp_id - property list identifier +/****if* H5Pf/h5premove_filter_c + * NAME + * h5premove_filter_c + * PURPOSE + * Call H5Premove_filter to delete one or more filters + * INPUTS + * prp_id - property list identifier * filter - Filter to be deleted - * Returns: 0 on success, -1 on failure - * Programmer: Quincey Koziol + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Quincey Koziol * January 27 2004 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5premove_filter_c (hid_t_f *prp_id, int_f* filter) +/******/ { int_f ret_value = -1; hid_t c_prp_id; @@ -3431,20 +4227,28 @@ DONE: return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pget_attr_phase_change_c - * Purpose: Calls H5Pget_attr_phase_change +/****if* H5Pf/h5pget_attr_phase_change_c + * NAME + * h5pget_attr_phase_change_c + * PURPOSE + * Calls H5Pget_attr_phase_change * - * Inputs: ocpl_id - Object (dataset or group) creation property list identifier + * INPUTS + * ocpl_id - Object (dataset or group) creation property list identifier * Outputs max_compact - Maximum number of attributes to be stored in compact storage * min_dense - Minimum number of attributes to be stored in dense storage - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld * January, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pget_attr_phase_change_c(hid_t_f *ocpl_id, int_f *max_compact, int_f *min_dense ) +/******/ { int ret_value = -1; hid_t c_ocpl_id; @@ -3464,19 +4268,27 @@ nh5pget_attr_phase_change_c(hid_t_f *ocpl_id, int_f *max_compact, int_f *min_den return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pset_attr_creation_order_c - * Purpose: Calls H5Ppset_attr_creation_order +/****if* H5Pf/h5pset_attr_creation_order_c + * NAME + * h5pset_attr_creation_order_c + * PURPOSE + * Calls H5Ppset_attr_creation_order * - * Inputs: ocpl_id - Object (dataset or group) creation property list identifier + * INPUTS + * ocpl_id - Object (dataset or group) creation property list identifier * Outputs crt_order_flags - Flags specifying whether to track and index attribute creation order - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld * January, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pset_attr_creation_order_c(hid_t_f *ocpl_id, int_f *crt_order_flags ) +/******/ { int ret_value = -1; unsigned c_crt_order_flags; @@ -3493,23 +4305,32 @@ nh5pset_attr_creation_order_c(hid_t_f *ocpl_id, int_f *crt_order_flags ) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pset_shared_mesg_nindexes_c - * Purpose: Calls h5pset_shared_mesg_nindexes +/****if* H5Pf/h5pset_shared_mesg_nindexes_c + * NAME + * h5pset_shared_mesg_nindexes_c + * PURPOSE + * Calls h5pset_shared_mesg_nindexes + * + * INPUTS * - * Inputs: * plist_id - file creation property list * nindexes - Number of shared object header message indexes * available in files created WITH this property list * - * Outputs: - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld + * OUTPUTS + * + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld * January, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pset_shared_mesg_nindexes_c(hid_t_f *plist_id, int_f *nindexes ) +/******/ { int ret_value = -1; hid_t c_plist_id; @@ -3527,24 +4348,33 @@ nh5pset_shared_mesg_nindexes_c(hid_t_f *plist_id, int_f *nindexes ) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pset_shared_mesg_index_c - * Purpose: Calls H5Pset_shared_mesg_index +/****if* H5Pf/h5pset_shared_mesg_index_c + * NAME + * h5pset_shared_mesg_index_c + * PURPOSE + * Calls H5Pset_shared_mesg_index + * + * INPUTS * - * Inputs: * fcpl_id - File creation property list identifier. * index_num - Index being configured. * mesg_type_flags - Types of messages that should be stored in this index. * min_mesg_size - Minimum message size. * - * Outputs: - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld + * OUTPUTS + * + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld * January, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pset_shared_mesg_index_c(hid_t_f *fcpl_id, int_f *index_num, int_f *mesg_type_flags, int_f *min_mesg_size) +/******/ { int ret_value = -1; herr_t ret; @@ -3558,22 +4388,31 @@ nh5pset_shared_mesg_index_c(hid_t_f *fcpl_id, int_f *index_num, int_f *mesg_type return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pget_attr_creation_order_c - * Purpose: Calls H5Pget_attr_creation_order +/****if* H5Pf/h5pget_attr_creation_order_c + * NAME + * h5pget_attr_creation_order_c + * PURPOSE + * Calls H5Pget_attr_creation_order + * + * INPUTS * - * Inputs: * ocpl_id - Object (group or dataset) creation property list identifier - * Outputs: + * OUTPUTS + * * crt_order_flags - Flags specifying whether to track and index attribute creation order * - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld * February, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pget_attr_creation_order_c(hid_t_f *ocpl_id, int_f *crt_order_flags) +/******/ { int ret_value = -1; herr_t ret; @@ -3591,23 +4430,32 @@ nh5pget_attr_creation_order_c(hid_t_f *ocpl_id, int_f *crt_order_flags) ret_value = 0; return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pset_libver_bounds_c - * Purpose: Calls H5Pset_libver_bounds +/****if* H5Pf/h5pset_libver_bounds_c + * NAME + * h5pset_libver_bounds_c + * PURPOSE + * Calls H5Pset_libver_bounds + * + * INPUTS * - * Inputs: * fapl_id - File access property list identifier * low - The earliest version of the library that will be used for writing objects. * high - The latest version of the library that will be used for writing objects. - * Outputs: + * OUTPUTS * - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld + * + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld * February 18, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pset_libver_bounds_c(hid_t_f *fapl_id, int_f *low, int_f *high ) +/******/ { int ret_value = -1; herr_t ret; @@ -3622,20 +4470,29 @@ nh5pset_libver_bounds_c(hid_t_f *fapl_id, int_f *low, int_f *high ) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pset_link_creation_order_c - * Purpose: Calls H5Pset_link_creation_order +/****if* H5Pf/h5pset_link_creation_order_c + * NAME + * h5pset_link_creation_order_c + * PURPOSE + * Calls H5Pset_link_creation_order * - * Inputs: gcpl_id - Group creation property list identifier + * INPUTS + * gcpl_id - Group creation property list identifier * crt_order_flags - Creation order flag(s) - * Outputs: - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld + * OUTPUTS + * + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld * February 18, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pset_link_creation_order_c(hid_t_f *gcpl_id, int_f *crt_order_flags ) +/******/ { int ret_value = -1; herr_t ret; @@ -3649,20 +4506,28 @@ nh5pset_link_creation_order_c(hid_t_f *gcpl_id, int_f *crt_order_flags ) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pget_link_phase_change_c - * Purpose: Calls H5Pget_link_phase_change +/****if* H5Pf/h5pget_link_phase_change_c + * NAME + * h5pget_link_phase_change_c + * PURPOSE + * Calls H5Pget_link_phase_change * - * Inputs: gcpl_id - Group creation property list identifier + * INPUTS + * gcpl_id - Group creation property list identifier * Outputs max_compact - Maximum number of attributes to be stored in compact storage * min_dense - Minimum number of attributes to be stored in dense storage - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld * February 20, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pget_link_phase_change_c(hid_t_f *gcpl_id, int_f *max_compact, int_f *min_dense ) +/******/ { int ret_value = -1; unsigned c_max_compact; @@ -3681,21 +4546,30 @@ nh5pget_link_phase_change_c(hid_t_f *gcpl_id, int_f *max_compact, int_f *min_den return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pget_obj_track_times_c - * Purpose: Call H5Pget_obj_track_times +/****if* H5Pf/h5pget_obj_track_times_c + * NAME + * h5pget_obj_track_times_c + * PURPOSE + * Call H5Pget_obj_track_times + * + * INPUTS + * plist_id - property list id + * OUTPUTS * - * Inputs: plist_id - property list id - * Outputs: * flag - TRUE/FALSE flag - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld * February 22, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pget_obj_track_times_c(hid_t_f *plist_id, int_f *flag) +/******/ { int ret_value = -1; hbool_t c_track_times=0; @@ -3714,20 +4588,28 @@ nh5pget_obj_track_times_c(hid_t_f *plist_id, int_f *flag) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pset_obj_track_times_c - * Purpose: Call H5Pset_obj_track_times +/****if* H5Pf/h5pset_obj_track_times_c + * NAME + * h5pset_obj_track_times_c + * PURPOSE + * Call H5Pset_obj_track_times * - * Inputs: plist_id - property list id + * INPUTS + * plist_id - property list id * flag - TRUE/FALSE flag - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld * February 22, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pset_obj_track_times_c(hid_t_f *plist_id, int_f *flag) +/******/ { int ret_value = -1; hbool_t c_track_times; @@ -3746,23 +4628,31 @@ nh5pset_obj_track_times_c(hid_t_f *plist_id, int_f *flag) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pset_create_inter_group_c - * Purpose: Calls H5Pset_create_intermediate_group +/****if* H5Pf/h5pset_create_inter_group_c + * NAME + * h5pset_create_inter_group_c + * PURPOSE + * Calls H5Pset_create_intermediate_group + * + * INPUTS * - * Inputs: * lcpl_id - Link creation property list identifier * crt_intermed_group - crt_intermed_group specifying whether * to create intermediate groups upon the * creation of an object - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld * February 22, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pset_create_inter_group_c(hid_t_f *lcpl_id, int_f *crt_intermed_group) +/******/ { int ret_value = -1; herr_t ret; @@ -3777,22 +4667,31 @@ nh5pset_create_inter_group_c(hid_t_f *lcpl_id, int_f *crt_intermed_group) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pget_link_creation_order_c - * Purpose: Calls H5Pget_link_creation_order +/****if* H5Pf/h5pget_link_creation_order_c + * NAME + * h5pget_link_creation_order_c + * PURPOSE + * Calls H5Pget_link_creation_order + * + * INPUTS * - * Inputs: * gcpl_id - Group creation property list identifier - * Outputs: + * OUTPUTS + * * crt_order_flags - Creation order flag(s) * - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld * March 3, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pget_link_creation_order_c(hid_t_f *gcpl_id, int_f *crt_order_flags) +/******/ { int ret_value = -1; herr_t ret; @@ -3811,24 +4710,33 @@ nh5pget_link_creation_order_c(hid_t_f *gcpl_id, int_f *crt_order_flags) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pset_char_encoding_c - * Purpose: Calls H5Pset_char_encoding +/****if* H5Pf/h5pset_char_encoding_c + * NAME + * h5pset_char_encoding_c + * PURPOSE + * Calls H5Pset_char_encoding + * + * INPUTS * - * Inputs: * plist_id - Property list identifier * encoding - String encoding character set: * H5T_CSET_ASCII_F -> US ASCII * H5T_CSET_UTF8_F -> UTF-8 Unicode encoding - * Outputs: NONE + * OUTPUTS + * NONE * - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld * March 3, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pset_char_encoding_c(hid_t_f *plist_id, int_f *encoding) +/******/ { int ret_value = -1; herr_t ret; @@ -3844,24 +4752,33 @@ nh5pset_char_encoding_c(hid_t_f *plist_id, int_f *encoding) } -/*---------------------------------------------------------------------------- - * Name: h5pget_char_encoding_c - * Purpose: Calls H5Pget_char_encoding +/****if* H5Pf/h5pget_char_encoding_c + * NAME + * h5pget_char_encoding_c + * PURPOSE + * Calls H5Pget_char_encoding + * + * INPUTS * - * Inputs: * plist_id - Property list identifier - * Outputs: + * OUTPUTS + * * encoding - Encoding character set: * H5T_CSET_ASCII_F -> US ASCII * H5T_CSET_UTF8_F -> UTF-8 Unicode encoding * - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld * March 3, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pget_char_encoding_c(hid_t_f *plist_id, int_f *encoding) +/******/ { int ret_value = -1; H5T_cset_t c_encoding; @@ -3878,24 +4795,33 @@ nh5pget_char_encoding_c(hid_t_f *plist_id, int_f *encoding) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pset_copy_object_c - * Purpose: Calls H5Pset_copy_object +/****if* H5Pf/h5pset_copy_object_c + * NAME + * h5pset_copy_object_c + * PURPOSE + * Calls H5Pset_copy_object + * + * INPUTS * - * Inputs: * ocp_plist_id - Object copy property list identifier * copy_options - Copy option(s) to be set * - * Outputs: + * OUTPUTS + * * NONE * - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld * March 3, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pset_copy_object_c(hid_t_f *ocp_plist_id, int_f *copy_options) +/******/ { int ret_value = -1; herr_t ret; @@ -3909,23 +4835,32 @@ nh5pset_copy_object_c(hid_t_f *ocp_plist_id, int_f *copy_options) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pget_copy_object_c - * Purpose: Calls H5Pget_copy_object +/****if* H5Pf/h5pget_copy_object_c + * NAME + * h5pget_copy_object_c + * PURPOSE + * Calls H5Pget_copy_object + * + * INPUTS * - * Inputs: * ocp_plist_id - Object copy property list identifier * - * Outputs: + * OUTPUTS + * * copy_options - Copy option(s) to be get * - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld * March 3, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pget_copy_object_c(hid_t_f *ocp_plist_id, int_f *copy_options) +/******/ { int ret_value = -1; unsigned c_copy_options; @@ -3942,26 +4877,34 @@ nh5pget_copy_object_c(hid_t_f *ocp_plist_id, int_f *copy_options) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pget_data_transform_c - * Purpose: Calls H5Pget_data_transform - * Inputs: +/****if* H5Pf/h5pget_data_transform_c + * NAME + * h5pget_data_transform_c + * PURPOSE + * Calls H5Pget_data_transform + * INPUTS + * * prp_id - property list identifier to query * expression_len - buffer size transorm expression * * Output: * expression - buffer to hold transform expression * - * Returns: + * RETURNS + * * Success: 0 * Failure: -1 * - * Programmer: M.S. Breitenfeld + * AUTHOR + * M. Scot Breitenfeld * March 19, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pget_data_transform_c(hid_t_f *plist_id, _fcd expression, int_f *expression_len, size_t_f *size) +/******/ { char *c_expression = NULL; /* Buffer to hold C string */ size_t c_expression_len; @@ -3998,26 +4941,34 @@ done: return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pset_data_transform_c - * Purpose: Calls H5Pset_data_transform - * Inputs: +/****if* H5Pf/h5pset_data_transform_c + * NAME + * h5pset_data_transform_c + * PURPOSE + * Calls H5Pset_data_transform + * INPUTS + * * prp_id - property list identifier to query * expression - buffer to hold transform expression * expression_len - buffer size transorm expression * * Output: * - * Returns: + * RETURNS + * * Success: 0 * Failure: -1 * - * Programmer: M.S. Breitenfeld + * AUTHOR + * M. Scot Breitenfeld * March 19, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pset_data_transform_c(hid_t_f *plist_id, _fcd expression, int_f *expression_len) +/******/ { char* c_expression = NULL; /* Buffer to hold C string */ int_f ret_value = 0; /* Return value */ @@ -4041,24 +4992,32 @@ done: return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pget_local_heap_size_hint_c - * Purpose: Calls H5Pget_local_heap_size_hint - * Inputs: +/****if* H5Pf/h5pget_local_heap_size_hint_c + * NAME + * h5pget_local_heap_size_hint_c + * PURPOSE + * Calls H5Pget_local_heap_size_hint + * INPUTS + * * gcpl_id - Group creation property list identifier * * Output: * size_hint - Hint for size of local heap - * Returns: + * RETURNS + * * Success: 0 * Failure: -1 * - * Programmer: M.S. Breitenfeld + * AUTHOR + * M. Scot Breitenfeld * March 21, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pget_local_heap_size_hint_c(hid_t_f *gcpl_id, size_t_f *size_hint) +/******/ { int_f ret_value = -1; /* Return value */ size_t c_size_hint; @@ -4074,25 +5033,33 @@ nh5pget_local_heap_size_hint_c(hid_t_f *gcpl_id, size_t_f *size_hint) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pget_est_link_info_c - * Purpose: Calls H5Pget_est_link_info - * Inputs: +/****if* H5Pf/h5pget_est_link_info_c + * NAME + * h5pget_est_link_info_c + * PURPOSE + * Calls H5Pget_est_link_info + * INPUTS + * * gcpl_id - Group creation property list identifier * * Output: * est_num_entries - Estimated number of links to be inserted into group * est_name_len - Estimated average length of link names - * Returns: + * RETURNS + * * Success: 0 * Failure: -1 * - * Programmer: M.S. Breitenfeld + * AUTHOR + * M. Scot Breitenfeld * March 21, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pget_est_link_info_c(hid_t_f *gcpl_id, int_f *est_num_entries, int_f *est_name_len) +/******/ { int_f ret_value = -1; /* Return value */ unsigned c_est_num_entries; @@ -4111,25 +5078,33 @@ nh5pget_est_link_info_c(hid_t_f *gcpl_id, int_f *est_num_entries, int_f *est_nam return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pset_local_heap_size_hint_c - * Purpose: Calls H5Pset_local_heap_size_hint - * Inputs: +/****if* H5Pf/h5pset_local_heap_size_hint_c + * NAME + * h5pset_local_heap_size_hint_c + * PURPOSE + * Calls H5Pset_local_heap_size_hint + * INPUTS + * * gcpl_id - Group creation property list identifier * size_hint - Hint for size of local heap * * Output: * - * Returns: + * RETURNS + * * Success: 0 * Failure: -1 * - * Programmer: M.S. Breitenfeld + * AUTHOR + * M. Scot Breitenfeld * March 21, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pset_local_heap_size_hint_c(hid_t_f *gcpl_id, size_t_f *size_hint) +/******/ { int_f ret_value = -1; /* Return value */ herr_t ret; @@ -4143,25 +5118,33 @@ nh5pset_local_heap_size_hint_c(hid_t_f *gcpl_id, size_t_f *size_hint) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pset_est_link_info_c - * Purpose: Calls H5Pset_est_link_info - * Inputs: +/****if* H5Pf/h5pset_est_link_info_c + * NAME + * h5pset_est_link_info_c + * PURPOSE + * Calls H5Pset_est_link_info + * INPUTS + * * gcpl_id - Group creation property list identifier * est_num_entries - Estimated number of links to be inserted into group * est_name_len - Estimated average length of link names * * Output: - * Returns: + * RETURNS + * * Success: 0 * Failure: -1 * - * Programmer: M.S. Breitenfeld + * AUTHOR + * M. Scot Breitenfeld * March 21, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pset_est_link_info_c(hid_t_f *gcpl_id, int_f *est_num_entries, int_f *est_name_len) +/******/ { int_f ret_value = -1; /* Return value */ herr_t ret; @@ -4175,21 +5158,29 @@ nh5pset_est_link_info_c(hid_t_f *gcpl_id, int_f *est_num_entries, int_f *est_nam return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pset_link_phase_change_c - * Purpose: Calls H5Pset_link_phase_change +/****if* H5Pf/h5pset_link_phase_change_c + * NAME + * h5pset_link_phase_change_c + * PURPOSE + * Calls H5Pset_link_phase_change * - * Inputs: gcpl_id - Group creation property list identifier + * INPUTS + * gcpl_id - Group creation property list identifier * max_compact - Maximum number of attributes to be stored in compact storage * min_dense - Minimum number of attributes to be stored in dense storage * Outputs - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld * March 21, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pset_link_phase_change_c(hid_t_f *gcpl_id, int_f *max_compact, int_f *min_dense ) +/******/ { int ret_value = -1; herr_t ret; @@ -4204,23 +5195,31 @@ nh5pset_link_phase_change_c(hid_t_f *gcpl_id, int_f *max_compact, int_f *min_den return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pset_fapl_direct_c - * Purpose: Calls H5Pset_fapl_direct +/****if* H5Pf/h5pset_fapl_direct_c + * NAME + * h5pset_fapl_direct_c + * PURPOSE + * Calls H5Pset_fapl_direct + * + * INPUTS * - * Inputs: * fapl_id - File access property list identifier * alignment - Required memory alignment boundary * block_size - File system block size * cbuf_size - Copy buffer size * Outputs - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld * March 21, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pset_fapl_direct_c(hid_t_f UNUSED *fapl_id, size_t_f UNUSED *alignment, size_t_f UNUSED *block_size, size_t_f UNUSED *cbuf_size) +/******/ { int ret_value = -1; #ifdef H5_HAVE_DIRECT @@ -4238,23 +5237,32 @@ nh5pset_fapl_direct_c(hid_t_f UNUSED *fapl_id, size_t_f UNUSED *alignment, size_ return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pget_fapl_direct_c - * Purpose: Calls H5Pget_fapl_direct +/****if* H5Pf/h5pget_fapl_direct_c + * NAME + * h5pget_fapl_direct_c + * PURPOSE + * Calls H5Pget_fapl_direct + * + * INPUTS * - * Inputs: * fapl_id - File access property list identifier - * Outputs: + * OUTPUTS + * * alignment - Required memory alignment boundary * block_size - File system block size * cbuf_size - Copy buffer size - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld * March 21, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pget_fapl_direct_c(hid_t_f UNUSED *fapl_id, size_t_f UNUSED *alignment, size_t_f UNUSED *block_size, size_t_f UNUSED *cbuf_size) +/******/ { int ret_value = -1; #ifdef H5_HAVE_DIRECT @@ -4278,21 +5286,30 @@ nh5pget_fapl_direct_c(hid_t_f UNUSED *fapl_id, size_t_f UNUSED *alignment, size_ return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pset_attr_phase_change_c - * Purpose: Calls H5Pset_attr_phase_change +/****if* H5Pf/h5pset_attr_phase_change_c + * NAME + * h5pset_attr_phase_change_c + * PURPOSE + * Calls H5Pset_attr_phase_change * - * Inputs: ocpl_id - Object (dataset or group) creation property list identifier + * INPUTS + * ocpl_id - Object (dataset or group) creation property list identifier * max_compact - Maximum number of attributes to be stored in compact storage * min_dense - Minimum number of attributes to be stored in dense storage - * Outputs: - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld + * OUTPUTS + * + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld * March 21, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pset_attr_phase_change_c(hid_t_f *ocpl_id, int_f *max_compact, int_f *min_dense ) +/******/ { int ret_value = -1; herr_t ret; @@ -4306,19 +5323,28 @@ nh5pset_attr_phase_change_c(hid_t_f *ocpl_id, int_f *max_compact, int_f *min_den return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pset_nbit_c - * Purpose: Calls H5Pset_nbit +/****if* H5Pf/h5pset_nbit_c + * NAME + * h5pset_nbit_c + * PURPOSE + * Calls H5Pset_nbit * - * Inputs: plist_id - Dataset creation property list identifier - * Outputs: - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld + * INPUTS + * plist_id - Dataset creation property list identifier + * OUTPUTS + * + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld * March 21, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pset_nbit_c(hid_t_f *plist_id ) +/******/ { int ret_value = -1; herr_t ret; @@ -4331,22 +5357,27 @@ nh5pset_nbit_c(hid_t_f *plist_id ) ret_value = 0; return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pset_scaleoffset_c - * Purpose: Calls H5Pset_scaleoffset +/****if* H5Pf/h5pset_scaleoffset_c + * NAME + * h5pset_scaleoffset_c + * PURPOSE + * Calls H5Pset_scaleoffset * - * Inputs: - * plist_id - Dataset creation property list identifier - * scale_type - Flag indicating compression method. + * INPUTS + * plist_id - Dataset creation property list identifier + * scale_type - Flag indicating compression method. * scale_factor - Parameter related to scale. - * Outputs: - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld - * March 21, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ + * + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld + * March 21, 2008 + * SOURCE +*/ int_f nh5pset_scaleoffset_c(hid_t_f *plist_id, int_f *scale_type, int_f *scale_factor ) +/******/ { int ret_value = -1; H5Z_SO_scale_type_t c_scale_type; @@ -4363,21 +5394,25 @@ nh5pset_scaleoffset_c(hid_t_f *plist_id, int_f *scale_type, int_f *scale_factor return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pset_nlinks - * Purpose: Calls H5Pset_nlinks +/****if* H5Pf/h5pset_nlinks + * NAME + * h5pset_nlinks + * PURPOSE + * Calls H5Pset_nlinks * - * Inputs: - * lapl_id - File access property list identifier - * nlinks - Maximum number of links to traverse - * Outputs: - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld - * March 24, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ + * INPUTS + * lapl_id - File access property list identifier + * nlinks - Maximum number of links to traverse + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld + * March 24, 2008 + * SOURCE +*/ int_f nh5pset_nlinks_c(hid_t_f *lapl_id, size_t_f *nlinks) +/******/ { int ret_value = -1; herr_t ret; @@ -4391,23 +5426,32 @@ nh5pset_nlinks_c(hid_t_f *lapl_id, size_t_f *nlinks) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pget_nlinks - * Purpose: Calls H5Pget_nlinks +/****if* H5Pf/h5pget_nlinks + * NAME + * h5pget_nlinks + * PURPOSE + * Calls H5Pget_nlinks + * + * INPUTS * - * Inputs: * lapl_id - File access property list identifier * - * Outputs: + * OUTPUTS + * * nlinks - Maximum number of links to traverse * - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld * March 24, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5pget_nlinks_c(hid_t_f *lapl_id, size_t_f *nlinks) +/******/ { int ret_value = -1; herr_t ret; @@ -4423,22 +5467,29 @@ nh5pget_nlinks_c(hid_t_f *lapl_id, size_t_f *nlinks) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5pget_create_inter_group_c - * Purpose: Calls H5Pget_create_intermediate_group +/****if* H5Pf/h5pget_create_inter_group_c + * NAME + * h5pget_create_inter_group_c + * PURPOSE + * Calls H5Pget_create_intermediate_group + * + * INPUTS * - * Inputs: * lcpl_id - Link creation property list identifier * crt_intermed_group - Specifying whether to create intermediate groups upon * the creation of an object - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld * April 4, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ - + * HISTORY + * + * SOURCE +*/ int_f nh5pget_create_inter_group_c(hid_t_f *lcpl_id, int_f *crt_intermed_group) +/******/ { int ret_value = -1; herr_t ret; @@ -4466,7 +5517,7 @@ nh5pget_create_inter_group_c(hid_t_f *lcpl_id, int_f *crt_intermed_group) * rdcc_w0 - * * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld + * Programmer: M. Scot Breitenfeld * April 13, 2009 * Modifications: *---------------------------------------------------------------------------*/ @@ -4497,7 +5548,7 @@ nh5pset_chunk_cache_c(hid_t_f *dapl_id, size_t_f *rdcc_nslots, size_t_f *rdcc_nb * rdcc_w0 - * * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld + * Programmer: M. Scot Breitenfeld * April 13, 2009 * Modifications: *---------------------------------------------------------------------------*/ diff --git a/fortran/src/H5Pff.f90 b/fortran/src/H5Pff.f90 index 50aad81..2d874d0 100644 --- a/fortran/src/H5Pff.f90 +++ b/fortran/src/H5Pff.f90 @@ -1,3 +1,14 @@ +!****h* ROBODoc/H5P (F90) +! +! NAME +! H5P_PROVISIONAL +! +! PURPOSE +! This file contains Fortran interfaces for H5P functions. It includes +! all the functions that are independent on whether the Fortran 2003 functions +! are enabled or disabled. +! +! COPYRIGHT ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! Copyright by The HDF Group. * ! Copyright by the Board of Trustees of the University of Illinois. * @@ -13,5486 +24,4691 @@ ! access to either file, you may request a copy from help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! -! -! This file contains Fortran90 interfaces for H5P functions. -! - MODULE H5P - - USE H5GLOBAL - - INTERFACE h5pset_fill_value_f - MODULE PROCEDURE h5pset_fill_value_integer - MODULE PROCEDURE h5pset_fill_value_real - MODULE PROCEDURE h5pset_fill_value_char - END INTERFACE - - INTERFACE h5pget_fill_value_f - MODULE PROCEDURE h5pget_fill_value_integer - MODULE PROCEDURE h5pget_fill_value_real - MODULE PROCEDURE h5pget_fill_value_char - END INTERFACE - - INTERFACE h5pset_f - MODULE PROCEDURE h5pset_integer - MODULE PROCEDURE h5pset_real - MODULE PROCEDURE h5pset_char - END INTERFACE - - INTERFACE h5pget_f - MODULE PROCEDURE h5pget_integer - MODULE PROCEDURE h5pget_real - MODULE PROCEDURE h5pget_char - END INTERFACE - - INTERFACE h5pregister_f - MODULE PROCEDURE h5pregister_integer - MODULE PROCEDURE h5pregister_real - MODULE PROCEDURE h5pregister_char - END INTERFACE - - INTERFACE h5pinsert_f - MODULE PROCEDURE h5pinsert_integer - MODULE PROCEDURE h5pinsert_real - MODULE PROCEDURE h5pinsert_char - END INTERFACE - - INTERFACE h5pset_fapl_multi_f - MODULE PROCEDURE h5pset_fapl_multi_l - MODULE PROCEDURE h5pset_fapl_multi_s - END INTERFACE - - - CONTAINS - -!---------------------------------------------------------------------- -! Name: h5pcreate_f -! -! Purpose: Creates a new property as an instance of a property -! list class. -! -! Inputs: -! class - type of the property class to be created. -! Possible values are: -! H5P_FILE_CREATE_F -! H5P_FILE_ACCESS_F -! H5P_DATASET_CREATE_F -! H5P_DATASET_XFER_F -! H5P_FILE_MOUNT_F -! Outputs: -! prp_id - property list identifier -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! Comment: -!---------------------------------------------------------------------- - SUBROUTINE h5pcreate_f(class, prp_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: class ! The type of the property list - ! to be created. Possible values - ! are: - ! H5P_FILE_CREATE_F - ! H5P_FILE_ACCESS_F - ! H5P_DATASET_CREATE_F - ! H5P_DATASET_XFER_F - ! H5P_FILE_MOUNT_F - INTEGER(HID_T), INTENT(OUT) :: prp_id ! Property list identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code - +! NOTES +! *** IMPORTANT *** +! If you add a new H5P function you must add the function name to the +! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! This is needed for Windows based operating systems. +!***** + +MODULE H5P + + USE H5GLOBAL + + INTERFACE h5pset_fapl_multi_f + MODULE PROCEDURE h5pset_fapl_multi_l + MODULE PROCEDURE h5pset_fapl_multi_s + END INTERFACE + +CONTAINS + +!****s* H5P/h5pcreate_f +! NAME +! h5pcreate_f +! +! PURPOSE +! Creates a new property as an instance of a property +! list class. +! +! INPUTS +! class - type of the property class to be created. +! Possible values are: +! H5P_FILE_CREATE_F +! H5P_FILE_ACCESS_F +! H5P_DATASET_CREATE_F +! H5P_DATASET_XFER_F +! H5P_FILE_MOUNT_F +! OUTPUTS +! prp_id - property list identifier +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Fortran90 Interface: + SUBROUTINE h5pcreate_f(class, prp_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: class ! The type of the property list + ! to be created. Possible values are: + ! H5P_FILE_CREATE_F + ! H5P_FILE_ACCESS_F + ! H5P_DATASET_CREATE_F + ! H5P_DATASET_XFER_F + ! H5P_FILE_MOUNT_F + INTEGER(HID_T), INTENT(OUT) :: prp_id ! Property list identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** ! INTEGER, EXTERNAL :: h5pcreate_c ! MS FORTRAN needs explicit interface for C functions called here. ! - 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 - INTEGER(HID_T), INTENT(IN) :: class - INTEGER(HID_T), INTENT(OUT) :: prp_id - END FUNCTION h5pcreate_c - END INTERFACE + 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 + INTEGER(HID_T), INTENT(IN) :: class + INTEGER(HID_T), INTENT(OUT) :: prp_id + END FUNCTION h5pcreate_c + END INTERFACE - hdferr = h5pcreate_c(class, prp_id) - END SUBROUTINE h5pcreate_f + hdferr = h5pcreate_c(class, prp_id) + END SUBROUTINE h5pcreate_f -!---------------------------------------------------------------------- -! Name: h5pset_preserve_f +!****s* H5P/h5pset_preserve_f +! NAME +! h5pset_preserve_f ! -! Purpose: Sets the dataset transfer property list status to -! TRUE or FALSE for initializing compound datatype -! members during write/read operations. +! PURPOSE +! Sets the dataset transfer property list status to +! TRUE or FALSE for initializing compound datatype +! members during write/read operations. ! -! Inputs: -! prp_id - property list identifier -! flag - status flag -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! INPUTS +! prp_id - property list identifier +! flag - status flag ! -! Programmer: Elena Pourmal -! August 12, 1999 +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails ! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! Datatype of the flag parameter is changed from -! INTEGER to LOGICAL -! June 4, 2003 +! OPTIONAL PARAMETERS +! NONE ! -! Comment: -!---------------------------------------------------------------------- - - - SUBROUTINE h5pset_preserve_f(prp_id, flag, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - LOGICAL, INTENT(IN) :: flag ! TRUE/FALSE flag to set the dataset +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Datatype of the flag parameter is changed from +! INTEGER to LOGICAL June 4, 2003 +! +! Fortran90 Interface: + SUBROUTINE h5pset_preserve_f(prp_id, flag, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + LOGICAL, INTENT(IN) :: flag ! TRUE/FALSE flag to set the dataset ! transfer property for partila writing/reading ! compound datatype - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER :: flag_c + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTEGER :: flag_c ! INTEGER, EXTERNAL :: h5pset_preserve_c ! MS FORTRAN needs explicit interface for C functions called here. ! - 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 - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER :: flag_c - END FUNCTION h5pset_preserve_c - END INTERFACE - flag_c = 0 - if(flag) flag_c = 1 - hdferr = h5pset_preserve_c(prp_id, flag_c) - END SUBROUTINE h5pset_preserve_f - -!---------------------------------------------------------------------- -! Name: h5pget_preserve_f -! -! Purpose: Checks status of the dataset transfer property list. -! -! Inputs: -! prp_id - property list identifier -! Outputs: -! flag - status flag -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! Datatype of the flag parameter is changed from -! INTEGER to LOGICAL -! June 4, 2003 -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pget_preserve_f(prp_id, flag, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - LOGICAL, INTENT(OUT) :: flag ! TRUE/FALSE flag. Shows status of the dataset's + 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 + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER :: flag_c + END FUNCTION h5pset_preserve_c + END INTERFACE + flag_c = 0 + IF(flag) flag_c = 1 + hdferr = h5pset_preserve_c(prp_id, flag_c) + END SUBROUTINE h5pset_preserve_f + +!****s* H5P/h5pget_preserve_f +! NAME +! h5pget_preserve_f +! +! PURPOSE +! Checks status of the dataset transfer property list. +! +! INPUTS +! prp_id - property list identifier +! +! OUTPUTS +! flag - status flag +! hdferr - error code +! Success: 0 +! Failure: -1 +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Datatype of the flag parameter is changed from +! INTEGER to LOGICAL +! June 4, 2003 +! +! Fortran90 Interface: + SUBROUTINE h5pget_preserve_f(prp_id, flag, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + LOGICAL, INTENT(OUT) :: flag ! TRUE/FALSE flag. Shows status of the dataset's ! transfer property for partial writing/reading ! compound datatype - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER :: flag_c + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTEGER :: flag_c ! INTEGER, EXTERNAL :: h5pget_preserve_c ! MS FORTRAN needs explicit interface for C functions called here. ! - 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 - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER :: flag_c - END FUNCTION h5pget_preserve_c - END INTERFACE - - hdferr = h5pget_preserve_c(prp_id, flag_c) - flag = .FALSE. - if(flag_c .eq. 1) flag = .TRUE. - END SUBROUTINE h5pget_preserve_f + 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 + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER :: flag_c + END FUNCTION h5pget_preserve_c + END INTERFACE + + hdferr = h5pget_preserve_c(prp_id, flag_c) + flag = .FALSE. + IF(flag_c .EQ. 1) flag = .TRUE. + END SUBROUTINE h5pget_preserve_f + +!****s* H5P/h5pget_class_f +! NAME +! h5pget_class_f +! +! PURPOSE +! Returns the property list class for a property list. +! +! INPUTS +! +! prp_id - property list identifier +! OUTPUTS +! +! classtype - property list class +! Possible values are: +! H5P_ROOT_F +! H5P_FILE_CREATE_F +! H5P_FILE_ACCESS_F +! H5PE_DATASET_CREATE_F +! H5P_DATASET_XFER_F +! H5P_FILE_MOUNT_F +! hdferr: - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Fortran90 Interface: + SUBROUTINE h5pget_class_f(prp_id, classtype, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER, INTENT(OUT) :: classtype ! The type of the property list + ! to be created. Possible values are: + ! H5P_ROOT_F + ! H5P_FILE_CREATE_F + ! H5P_FILE_ACCESS_F + ! H5PE_DATASET_CREATE_F + ! H5P_DATASET_XFER_F + ! H5P_FILE_MOUNT_F + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** -!---------------------------------------------------------------------- -! Name: h5pget_class_f -! -! Purpose: Returns the property list class for a property list. -! -! Inputs: -! prp_id - property list identifier -! Outputs: -! classtype - property list class -! Possible values are: -! H5P_ROOT_F -! H5P_FILE_CREATE_F -! H5P_FILE_ACCESS_F -! H5PE_DATASET_CREATE_F -! H5P_DATASET_XFER_F -! H5P_FILE_MOUNT_F -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pget_class_f(prp_id, classtype, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER, INTENT(OUT) :: classtype ! The type of the property list - ! to be created. Possible values - ! are: - ! H5P_ROOT_F - ! H5P_FILE_CREATE_F - ! H5P_FILE_ACCESS_F - ! H5PE_DATASET_CREATE_F - ! H5P_DATASET_XFER_F - ! H5P_FILE_MOUNT_F - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5pget_class_c +! INTEGER, EXTERNAL :: h5pget_class_c ! MS FORTRAN needs explicit interface for C functions called here. ! - 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 - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER, INTENT(OUT) :: classtype - END FUNCTION h5pget_class_c - END INTERFACE + 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 + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER, INTENT(OUT) :: classtype + END FUNCTION h5pget_class_c + END INTERFACE - hdferr = h5pget_class_c(prp_id, classtype) - END SUBROUTINE h5pget_class_f + hdferr = h5pget_class_c(prp_id, classtype) + END SUBROUTINE h5pget_class_f -!---------------------------------------------------------------------- -! Name: h5pcopy_f +!****s* H5P/h5pcopy_f +! NAME +! h5pcopy_f ! -! Purpose: Copies an existing property list to create a new -! property list +! PURPOSE +! Copies an existing property list to create a new +! property list ! -! Inputs: -! prp_id - property list identifier -! Outputs: -! new_prp_id - new property list identifier -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 +! INPUTS +! prp_id - property list identifier +! OUTPUTS +! new_prp_id - new property list identifier +! hdferr: - error code +! Success: 0 +! Failure: -1 ! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 +! AUTHOR +! Elena Pourmal +! August 12, 1999 ! -! Comment: -!---------------------------------------------------------------------- - - - SUBROUTINE h5pcopy_f(prp_id, new_prp_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER(HID_T), INTENT(OUT) :: new_prp_id - ! Identifier of property list - ! copy - INTEGER, INTENT(OUT) :: hdferr ! Error code +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Fortran90 Interface: + SUBROUTINE h5pcopy_f(prp_id, new_prp_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HID_T), INTENT(OUT) :: new_prp_id ! Identifier of property list + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** ! INTEGER, EXTERNAL :: h5pcopy_c ! MS FORTRAN needs explicit interface for C functions called here. ! - 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 - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER(HID_T), INTENT(OUT) :: new_prp_id - END FUNCTION h5pcopy_c - END INTERFACE - - hdferr = h5pcopy_c(prp_id, new_prp_id) - END SUBROUTINE h5pcopy_f - -!---------------------------------------------------------------------- -! Name: h5pclose_f -! -! Purpose: Terminates access to a property list. -! -! Inputs: -! prp_id - identifier of the property list to -! terminate access to. -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! Comment: -!---------------------------------------------------------------------- - - - SUBROUTINE h5pclose_f(prp_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code + 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 + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER(HID_T), INTENT(OUT) :: new_prp_id + END FUNCTION h5pcopy_c + END INTERFACE + + hdferr = h5pcopy_c(prp_id, new_prp_id) + END SUBROUTINE h5pcopy_f + +!****s* H5P/h5pclose_f +! NAME +! h5pclose_f +! +! PURPOSE +! Terminates access to a property list. +! +! INPUTS +! prp_id - identifier of the property list to +! terminate access to. +! OUTPUTS +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Fortran90 Interface: + SUBROUTINE h5pclose_f(prp_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** ! INTEGER, EXTERNAL :: h5pclose_c ! MS FORTRAN needs explicit interface for C functions called here. ! - 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 - INTEGER(HID_T), INTENT(IN) :: prp_id - END FUNCTION h5pclose_c - END INTERFACE - - hdferr = h5pclose_c(prp_id) - END SUBROUTINE h5pclose_f - -!---------------------------------------------------------------------- -! Name: h5pset_chunk_f -! -! Purpose: Sets the size of the chunks used to store -! a chunked layout dataset. -! -! Inputs: -! prp_id - datatset creation property list identifier -! ndims - number of dimensions for each chunk -! dims - array with dimension sizes for each chunk -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! Comment: -!---------------------------------------------------------------------- - - - SUBROUTINE h5pset_chunk_f(prp_id, ndims, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER, INTENT(IN) :: ndims ! Number of chunk dimensions - INTEGER(HSIZE_T), DIMENSION(ndims), INTENT(IN) :: dims - ! Array containing sizes of - ! chunk dimensions - INTEGER, INTENT(OUT) :: hdferr ! Error code + 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 + INTEGER(HID_T), INTENT(IN) :: prp_id + END FUNCTION h5pclose_c + END INTERFACE + + hdferr = h5pclose_c(prp_id) + END SUBROUTINE h5pclose_f + +!****s* H5P/h5pset_chunk_f +! NAME +! h5pset_chunk_f +! +! PURPOSE +! Sets the size of the chunks used to store +! a chunked layout dataset. +! +! INPUTS +! prp_id - datatset creation property list identifier +! ndims - number of dimensions for each chunk +! dims - array with dimension sizes for each chunk +! OUTPUTS +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Fortran90 Interface: + SUBROUTINE h5pset_chunk_f(prp_id, ndims, dims, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER, INTENT(IN) :: ndims ! Number of chunk dimensions + INTEGER(HSIZE_T), DIMENSION(ndims), INTENT(IN) :: dims + ! Array containing sizes of + ! chunk dimensions + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** ! INTEGER, EXTERNAL :: h5pset_chunk_c ! MS FORTRAN needs explicit interface for C functions called here. ! - 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 - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER, INTENT(IN) :: ndims - INTEGER(HSIZE_T), DIMENSION(ndims), INTENT(IN) :: dims - END FUNCTION h5pset_chunk_c - END INTERFACE - - hdferr = h5pset_chunk_c(prp_id, ndims, dims) - END SUBROUTINE h5pset_chunk_f - -!---------------------------------------------------------------------- -! Name: h5pget_chunk_f -! -! Purpose: Retrieves the size of chunks for the raw data of a -! chunked layout dataset -! -! Inputs: -! prp_id - property list identifier -! ndims - size of dims array -! Outputs: -! dims - array with dimension sizes for each chunk -! hdferr: - error code -! Success: number of chunk dimensions -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! Comment: -!---------------------------------------------------------------------- - - - SUBROUTINE h5pget_chunk_f(prp_id, ndims, dims, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER, INTENT(IN) :: ndims ! Number of chunk dimensions to - ! to return - INTEGER(HSIZE_T), DIMENSION(ndims), INTENT(OUT) :: dims - ! Array containing sizes of - ! chunk dimensions - INTEGER, INTENT(OUT) :: hdferr ! Error code; number of - ! chunk dimensions on success, - ! -1 on failure - + 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 + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER, INTENT(IN) :: ndims + INTEGER(HSIZE_T), DIMENSION(ndims), INTENT(IN) :: dims + END FUNCTION h5pset_chunk_c + END INTERFACE + + hdferr = h5pset_chunk_c(prp_id, ndims, dims) + END SUBROUTINE h5pset_chunk_f + +!****s* H5P/h5pget_chunk_f +! NAME +! h5pget_chunk_f +! +! PURPOSE +! Retrieves the size of chunks for the raw data of a +! chunked layout dataset +! +! INPUTS +! prp_id - property list identifier +! ndims - size of dims array +! OUTPUTS +! dims - array with dimension sizes for each chunk +! hdferr - error code +! Success: number of chunk dimensions +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Fortran90 Interface: + SUBROUTINE h5pget_chunk_f(prp_id, ndims, dims, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER, INTENT(IN) :: ndims ! Number of chunk dimensions to + ! to return + INTEGER(HSIZE_T), DIMENSION(ndims), INTENT(OUT) :: dims + ! Array containing sizes of + ! chunk dimensions + INTEGER, INTENT(OUT) :: hdferr ! Error code: + ! number of chunk dimensions on success, + ! -1 on failure +!***** ! INTEGER, EXTERNAL :: h5pget_chunk_c ! MS FORTRAN needs explicit interface for C functions called here. ! - 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 - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER :: ndims - INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: dims - END FUNCTION h5pget_chunk_c - END INTERFACE + 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 + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER :: ndims + INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: dims + END FUNCTION h5pget_chunk_c + END INTERFACE - hdferr = h5pget_chunk_c(prp_id, ndims, dims) - END SUBROUTINE h5pget_chunk_f + hdferr = h5pget_chunk_c(prp_id, ndims, dims) + END SUBROUTINE h5pget_chunk_f -!---------------------------------------------------------------------- -! Name: h5pset_deflate_f +!****s* H5P/h5pset_deflate_f +! NAME +! h5pset_deflate_f ! -! Purpose: Sets compression method and compression level. +! PURPOSE +! Sets compression method and compression level. ! -! Inputs: -! prp_id - property list identifier -! level - compression level -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! INPUTS +! prp_id - property list identifier +! level - compression level +! OUTPUTS +! +! hdferr - error code +! Success: 0 +! Failure: -1 ! -! Programmer: Elena Pourmal +! AUTHOR +! Elena Pourmal ! August 12, 1999 ! -! Modifications: Explicit Fortran interfaces were added for +! HISTORY +! Explicit Fortran interfaces were added for ! called C functions (it is needed for Windows ! port). March 14, 2001 -! -! Comment: -!---------------------------------------------------------------------- - - - SUBROUTINE h5pset_deflate_f(prp_id, level, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER, INTENT(IN) :: level ! Compression level - INTEGER, INTENT(OUT) :: hdferr ! Error code +! +! Fortran90 Interface: + SUBROUTINE h5pset_deflate_f(prp_id, level, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER, INTENT(IN) :: level ! Compression level + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** -! INTEGER, EXTERNAL :: h5pset_deflate_c +! INTEGER, EXTERNAL :: h5pset_deflate_c ! MS FORTRAN needs explicit interface for C functions called here. ! - 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 - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER, INTENT(IN) :: level - END FUNCTION h5pset_deflate_c - END INTERFACE - hdferr = h5pset_deflate_c(prp_id, level) + 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 + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER, INTENT(IN) :: level + END FUNCTION h5pset_deflate_c + END INTERFACE + hdferr = h5pset_deflate_c(prp_id, level) + + END SUBROUTINE h5pset_deflate_f + +!****s* H5P/h5pget_version_f +! NAME +! h5pget_version_f +! +! PURPOSE +! Retrieves the version information of various objects +! for a file creation property list +! +! INPUTS +! prp_id - file createion property list identifier +! OUTPUTS +! boot - super block version number +! freelist - global freelist version number +! stab - symbol table version number +! shhdr - shared object header version number +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Fortran90 Interface: + SUBROUTINE h5pget_version_f(prp_id, boot, freelist, & + stab, shhdr, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER, DIMENSION(:), INTENT(OUT) :: boot ! Array to put boot + ! block version number + INTEGER, DIMENSION(:), INTENT(OUT) :: freelist ! Array to put global + ! Freelist version number + + INTEGER, DIMENSION(:), INTENT(OUT) :: stab ! Array to put symbol + ! table version number + INTEGER, DIMENSION(:), INTENT(OUT) :: shhdr ! Array to put shared + ! object header version number + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** - END SUBROUTINE h5pset_deflate_f +! INTEGER, EXTERNAL :: h5pget_version_c +! MS FORTRAN needs explicit interface for C functions called here. +! + 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 + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER, DIMENSION(:), INTENT(OUT) :: boot + INTEGER, DIMENSION(:), INTENT(OUT) :: freelist + INTEGER, DIMENSION(:), INTENT(OUT) :: stab + INTEGER, DIMENSION(:), INTENT(OUT) :: shhdr + END FUNCTION h5pget_version_c + END INTERFACE + + hdferr = h5pget_version_c(prp_id, boot, freelist, stab, shhdr) + END SUBROUTINE h5pget_version_f -!---------------------------------------------------------------------- -! Name: h5pset(get)fill_value_f +!****s* H5P/h5pset_userblock_f +! NAME +! h5pset_userblock_f ! -! Purpose: Sets(gets) fill value for a dataset creation property list +! PURPOSE +! Sets user block size ! -! Inputs: -! prp_id - dataset creation property list identifier -! type_id - datatype identifier for fill value -! fillvalue - fill value -! Outputs: -! ( type_id - datatype identifier for fill value ) -! ( fillvalue - fill value ) -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 +! INPUTS +! prp_id - file creation property list to modify +! size - size of the user-block in bytes ! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 +! OUTPUTS +! hdferr - error code +! Success: 0 +! Failure: -1 ! -! Comment: h5pset(get)fill_value_f function is overloaded to support -! INTEGER, REAL, DOUBLE PRECISION and CHARACTER dtatypes. -!---------------------------------------------------------------------- - - - SUBROUTINE h5pset_fill_value_integer(prp_id, type_id, fillvalue, & - hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier of - ! of fillvalue datatype - ! (in memory) - INTEGER, INTENT(IN) :: fillvalue ! Fillvalue - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5pset_fill_value_integer_c -! MS FORTRAN needs explicit interface for C functions called here. +! AUTHOR +! Elena Pourmal +! August 12, 1999 ! - 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 - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER(HID_T), INTENT(IN) :: type_id - INTEGER, INTENT(IN) :: fillvalue - END FUNCTION h5pset_fill_value_integer_c - END INTERFACE - - hdferr = h5pset_fill_value_integer_c(prp_id, type_id, fillvalue) - END SUBROUTINE h5pset_fill_value_integer - - - SUBROUTINE h5pget_fill_value_integer(prp_id, type_id, fillvalue, & - hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier of - ! of fillvalue datatype - ! (in memory) - INTEGER, INTENT(IN) :: fillvalue ! Fillvalue - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5pget_fill_value_integer_c -! MS FORTRAN needs explicit interface for C functions called here. +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 ! - 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 - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER(HID_T), INTENT(IN) :: type_id - INTEGER :: fillvalue - END FUNCTION h5pget_fill_value_integer_c - END INTERFACE - - hdferr = h5pget_fill_value_integer_c(prp_id, type_id, fillvalue) - END SUBROUTINE h5pget_fill_value_integer - - - SUBROUTINE h5pset_fill_value_real(prp_id, type_id, fillvalue, & - hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier of - ! of fillvalue datatype - ! (in memory) - REAL, INTENT(IN) :: fillvalue ! Fillvalue - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5pset_fill_value_real_c +! Fortran90 Interface: + SUBROUTINE h5pset_userblock_f (prp_id, size, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HSIZE_T), INTENT(IN) :: size ! Size of the user-block in bytes + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + +! INTEGER, EXTERNAL :: h5pset_userblock_c ! MS FORTRAN needs explicit interface for C functions called here. ! - 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 - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER(HID_T), INTENT(IN) :: type_id - REAL, INTENT(IN) :: fillvalue - END FUNCTION h5pset_fill_value_real_c - END INTERFACE - - hdferr = h5pset_fill_value_real_c(prp_id, type_id, fillvalue) - END SUBROUTINE h5pset_fill_value_real - - - SUBROUTINE h5pget_fill_value_real(prp_id, type_id, fillvalue, & - hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier of - ! of fillvalue datatype - ! (in memory) - REAL, INTENT(IN) :: fillvalue ! Fillvalue - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5pget_fill_value_real_c + 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 + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER(HSIZE_T), INTENT(IN) :: size + END FUNCTION h5pset_userblock_c + END INTERFACE + + hdferr = h5pset_userblock_c(prp_id, size) + END SUBROUTINE h5pset_userblock_f + +!****s* H5P/h5pget_userblock_f +! NAME +! h5pget_userblock_f +! +! PURPOSE +! Gets user block size. +! +! INPUTS +! +! prp_id - file creation property list identifier +! OUTPUTS +! +! block_size - size of the user block in bytes +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Fortran90 Interface: + SUBROUTINE h5pget_userblock_f(prp_id, block_size, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HSIZE_T), INTENT(OUT) :: block_size ! Size of the + ! user-block in bytes + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** +! INTEGER, EXTERNAL :: h5pget_userblock_c ! MS FORTRAN needs explicit interface for C functions called here. ! - 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 - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER(HID_T), INTENT(IN) :: type_id - REAL :: fillvalue - END FUNCTION h5pget_fill_value_real_c - END INTERFACE - - hdferr = h5pget_fill_value_real_c(prp_id, type_id, fillvalue) - END SUBROUTINE h5pget_fill_value_real - - - - SUBROUTINE h5pset_fill_value_char(prp_id, type_id, fillvalue, & - hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier of - ! of fillvalue datatype - ! (in memory) - CHARACTER, INTENT(IN) :: fillvalue ! Fillvalue - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5pset_fill_valuec_c + 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 + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER(HSIZE_T), INTENT(OUT) :: block_size + END FUNCTION h5pget_userblock_c + END INTERFACE + hdferr = h5pget_userblock_c(prp_id, block_size) + END SUBROUTINE h5pget_userblock_f + +!****s* H5P/h5pset_sizes_f +! NAME +! h5pset_sizes_f +! +! PURPOSE +! Sets the byte size of the offsets and lengths used +! to address objects in an HDF5 file. +! +! INPUTS +! prp_id - file creation property list identifier +! sizeof_addr - size of an object offset in bytes +! sizeof_size - size of an object length in bytes +! OUTPUTS +! +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Fortran90 Interface: + SUBROUTINE h5pset_sizes_f (prp_id, sizeof_addr, sizeof_size, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(SIZE_T), INTENT(IN) :: sizeof_addr ! Size of an object + ! offset in bytes + INTEGER(SIZE_T), INTENT(IN) :: sizeof_size ! Size of an object + ! length in bytes + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** +! INTEGER, EXTERNAL :: h5pset_sizes_c ! MS FORTRAN needs explicit interface for C functions called here. ! - 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$ATTRIBUTES reference :: fillvalue - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER(HID_T), INTENT(IN) :: type_id - CHARACTER, INTENT(IN) :: fillvalue - END FUNCTION h5pset_fill_valuec_c - END INTERFACE - - hdferr = h5pset_fill_valuec_c(prp_id, type_id, fillvalue) - END SUBROUTINE h5pset_fill_value_char - - SUBROUTINE h5pget_fill_value_char(prp_id, type_id, fillvalue, & - hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier of - ! of fillvalue datatype - ! (in memory) - CHARACTER, INTENT(IN) :: fillvalue ! Fillvalue - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5pget_fill_valuec_c + 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 + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER(SIZE_T), INTENT(IN) :: sizeof_addr + INTEGER(SIZE_T), INTENT(IN) :: sizeof_size + END FUNCTION h5pset_sizes_c + END INTERFACE + + hdferr = h5pset_sizes_c(prp_id, sizeof_addr, sizeof_size) + END SUBROUTINE h5pset_sizes_f + +!****s* H5P/h5pget_sizes_f +! NAME +! h5pget_sizes_f +! +! PURPOSE +! Retrieves the size of the offsets and lengths used +! in an HDF5 file +! +! INPUTS +! prp_id - file creation property list identifier +! OUTPUTS +! +! sizeof_addr - size of an object offset in bytes +! sizeof_size - size of an object length in bytes +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Fortran90 Interface: + SUBROUTINE h5pget_sizes_f(prp_id, sizeof_addr, sizeof_size, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(SIZE_T), INTENT(OUT) :: sizeof_addr ! Size of an object + ! offset in bytes + INTEGER(SIZE_T), INTENT(OUT) :: sizeof_size ! Size of an object + ! length in bytes + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** +! INTEGER, EXTERNAL :: h5pget_sizes_c ! MS FORTRAN needs explicit interface for C functions called here. ! - 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$ATTRIBUTES reference :: fillvalue - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER(HID_T), INTENT(IN) :: type_id - CHARACTER :: fillvalue - END FUNCTION h5pget_fill_valuec_c - END INTERFACE - - hdferr = h5pget_fill_valuec_c(prp_id, type_id, fillvalue) - END SUBROUTINE h5pget_fill_value_char + 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 + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER(SIZE_T), INTENT(OUT) :: sizeof_addr + INTEGER(SIZE_T), INTENT(OUT) :: sizeof_size + END FUNCTION h5pget_sizes_c + END INTERFACE + + hdferr = h5pget_sizes_c(prp_id, sizeof_addr, sizeof_size) + END SUBROUTINE h5pget_sizes_f + +!****s* H5P/h5pset_sym_k_f +! NAME +! h5pset_sym_k_f +! +! PURPOSE +! Sets the size of parameters used to control the +!symbol table nodes +! +! INPUTS +! +! prp_id - file creation property list identifier +! ik - symbol table tree rank +! lk - symbol table node size +! OUTPUTS +! +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Fortran90 Interface: + SUBROUTINE h5pset_sym_k_f (prp_id, ik, lk, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER, INTENT(IN) :: ik ! Symbol table tree rank + INTEGER, INTENT(IN) :: lk ! Symbol table node size + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** -!---------------------------------------------------------------------- -! Name: h5pget_version_f -! -! Purpose: Retrieves the version information of various objects -! for a file creation property list -! -! Inputs: -! prp_id - file createion property list identifier -! Outputs: -! boot - super block version number -! freelist - global freelist version number -! stab - symbol table version number -! shhdr - shared object header version number -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 +! INTEGER, EXTERNAL :: h5pset_sym_k_c +! MS FORTRAN needs explicit interface for C functions called here. ! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pget_version_f(prp_id, boot, freelist, & - stab, shhdr, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER, DIMENSION(:), INTENT(OUT) :: boot !array to put boot - !block version number - INTEGER, DIMENSION(:), INTENT(OUT) :: freelist !array to put global - !freelist version number - - INTEGER, DIMENSION(:), INTENT(OUT) :: stab !array to put symbol - !table version number - INTEGER, DIMENSION(:), INTENT(OUT) :: shhdr !array to put shared - !object header version number - INTEGER, INTENT(OUT) :: hdferr ! Error code + 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 + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER, INTENT(IN) :: ik + INTEGER, INTENT(IN) :: lk + END FUNCTION h5pset_sym_k_c + END INTERFACE + + hdferr = h5pset_sym_k_c(prp_id, ik, lk) + END SUBROUTINE h5pset_sym_k_f +!****s* H5P/h5pget_sym_k_f +! NAME +! h5pget_sym_k_f +! +! PURPOSE +! Retrieves the size of the symbol table B-tree 1/2 rank +! and the symbol table leaf node 1/2 size. +! +! INPUTS +! +! prp_id - file creation property list identifier +! OUTPUTS +! +! ik - symbol table tree 1/2 rank +! lk - symbol table node 1/2 size +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Fortran90 Interface: + SUBROUTINE h5pget_sym_k_f(prp_id, ik, lk, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER, INTENT(OUT) :: ik ! Symbol table tree rank + INTEGER, INTENT(OUT) :: lk ! Symbol table node size + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** -! INTEGER, EXTERNAL :: h5pget_version_c +! INTEGER, EXTERNAL :: h5pget_sym_k_c ! MS FORTRAN needs explicit interface for C functions called here. ! - 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 - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER, DIMENSION(:), INTENT(OUT) :: boot - INTEGER, DIMENSION(:), INTENT(OUT) :: freelist - INTEGER, DIMENSION(:), INTENT(OUT) :: stab - INTEGER, DIMENSION(:), INTENT(OUT) :: shhdr - END FUNCTION h5pget_version_c - END INTERFACE - - hdferr = h5pget_version_c(prp_id, boot, freelist, stab, shhdr) - END SUBROUTINE h5pget_version_f + 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 + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER, INTENT(OUT) :: ik + INTEGER, INTENT(OUT) :: lk + END FUNCTION h5pget_sym_k_c + END INTERFACE + + hdferr = h5pget_sym_k_c(prp_id, ik, lk) + END SUBROUTINE h5pget_sym_k_f +!****s* H5P/h5pset_istore_k_f +! NAME +! h5pset_istore_k_f +! +! PURPOSE +! Sets the size of the parameter used to control the +! B-trees for indexing chunked datasets +! +! INPUTS +! +! prp_id - file creation property list identifier +! ik - 1/2 rank of chunked storage B-tree +! OUTPUTS +! +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Fortran90 Interface: + SUBROUTINE h5pset_istore_k_f (prp_id, ik, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER, INTENT(IN) :: ik ! 1/2 rank of chunked storage B-tree + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** -!---------------------------------------------------------------------- -! Name: h5pset_userblock_f +! INTEGER, EXTERNAL :: h5pset_istore_k_c +! MS FORTRAN needs explicit interface for C functions called here. ! -! Purpose: Sets user block size + 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 + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER, INTENT(IN) :: ik + END FUNCTION h5pset_istore_k_c + END INTERFACE + + hdferr = h5pset_istore_k_c(prp_id, ik) + END SUBROUTINE h5pset_istore_k_f + +!****s* H5P/h5pget_istore_k_f +! NAME +! h5pget_istore_k_f +! +! PURPOSE +! Queries the 1/2 rank of an indexed storage B-tree. +! +! INPUTS +! +! prp_id - file creation property list identifier +! OUTPUTS +! +! ik - 1/2 rank of chunked storage B-tree +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Fortran90 Interface: + SUBROUTINE h5pget_istore_k_f(prp_id, ik, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER, INTENT(OUT) :: ik ! 1/2 rank of chunked storage B-tree + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + +! INTEGER, EXTERNAL :: h5pget_istore_k_c +! MS FORTRAN needs explicit interface for C functions called here. ! -! Inputs: -! prp_id - file creation property list to modify -! size - size of the user-block in bytes -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE + 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 + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER, INTENT(OUT) :: ik + END FUNCTION h5pget_istore_k_c + END INTERFACE + + hdferr = h5pget_istore_k_c(prp_id, ik) + END SUBROUTINE h5pget_istore_k_f + +!****s* H5P/h5pget_driver_f +! NAME +! h5pget_driver_f +! +! PURPOSE +! Returns low-lever driver identifier. +! +! INPUTS +! +! prp_id - file access or data transfer property +! list identifier. +! OUTPUTS +! +! driver - low-level driver identifier +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Fortran90 Interface: + SUBROUTINE h5pget_driver_f(prp_id, driver, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HID_T), INTENT(OUT) :: driver ! Low-level file driver identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** +! INTEGER, EXTERNAL :: h5pget_driver_c +! MS FORTRAN needs explicit interface for C functions called here. ! -! Programmer: Elena Pourmal -! August 12, 1999 + 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 + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER(HID_T), INTENT(OUT) :: driver + END FUNCTION h5pget_driver_c + END INTERFACE + + hdferr = h5pget_driver_c(prp_id, driver) + END SUBROUTINE h5pget_driver_f + +!****s* H5P/h5pset_fapl_stdio_f +! NAME +! h5pset_fapl_stdio_f +! +! PURPOSE +! Sets the standard I/O driver. +! +! INPUTS +! +! prp_id - file access property list identifier +! OUTPUTS +! +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Fortran90 Interface: + SUBROUTINE h5pset_fapl_stdio_f (prp_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + +! INTEGER, EXTERNAL :: h5pset_fapl_stdio_c +! MS FORTRAN needs explicit interface for C functions called here. ! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 + 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 + INTEGER(HID_T), INTENT(IN) :: prp_id + END FUNCTION h5pset_fapl_stdio_c + END INTERFACE + + hdferr = h5pset_fapl_stdio_c(prp_id) + END SUBROUTINE h5pset_fapl_stdio_f + +!****s* H5P/h5pget_stdio_f +! NAME +! h5pget_stdio_f +! +! PURPOSE +! NOT AVAILABLE +! +! INPUTS +! +! OUTPUTS +! +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! SOURCE +! SUBROUTINE h5pget_stdio_f (prp_id, io, hdferr) ! -! Comment: -!---------------------------------------------------------------------- +! IMPLICIT NONE +! INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier +! INTEGER, INTENT(OUT) :: io ! value indicates that the file + !access property list is set to + !the stdio driver +! INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** +! INTEGER, EXTERNAL :: h5pget_stdio_c +! hdferr = h5pget_stdio_c(prp_id, io) +! END SUBROUTINE h5pget_stdio_f - SUBROUTINE h5pset_userblock_f (prp_id, size, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER(HSIZE_T), INTENT(IN) :: size !Size of the user-block in bytes - INTEGER, INTENT(OUT) :: hdferr ! Error code +!****s* H5P/h5pset_fapl_sec2_f +! NAME +! h5pset_fapl_sec2_f +! +! PURPOSE +! Sets the sec2 driver. +! +! INPUTS +! +! prp_id - file access property list identifier +! OUTPUTS +! +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Fortran90 Interface: + SUBROUTINE h5pset_fapl_sec2_f (prp_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** -! INTEGER, EXTERNAL :: h5pset_userblock_c +! INTEGER, EXTERNAL :: h5pset_fapl_sec2_c ! MS FORTRAN needs explicit interface for C functions called here. ! - 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 - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER(HSIZE_T), INTENT(IN) :: size - END FUNCTION h5pset_userblock_c - END INTERFACE + 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 + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + END FUNCTION h5pset_fapl_sec2_c + END INTERFACE + + hdferr = h5pset_fapl_sec2_c(prp_id) + END SUBROUTINE h5pset_fapl_sec2_f + +!****s* H5P/h5pget_sec2_f +! NAME +! h5pget_sec2_f +! +! PURPOSE +! NOT AVAILABLE +! +! INPUTS +! +! OUTPUTS +! +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! SOURCE! SUBROUTINE h5pget_sec2_f (prp_id, sec2, hdferr) +! IMPLICIT NONE +! INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier +! INTEGER, INTENT(OUT) :: sec2 ! value indicates whether the file + !driver uses the functions declared + !in the unistd.h file +! INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** +! INTEGER, EXTERNAL :: h5pget_sec2_c +! hdferr = h5pget_sec2_c(prp_id, sec2) +! END SUBROUTINE h5pget_sec2_f - hdferr = h5pset_userblock_c(prp_id, size) - END SUBROUTINE h5pset_userblock_f +!****s* H5P/h5pset_alignment_f +! NAME +! h5pset_alignment_f +! +! PURPOSE +! Sets alignment properties of a file access property list. +! +! INPUTS +! +! prp_id - file access property list identifier +! threshold - threshold value +! alignment - alignment value +! OUTPUTS +! +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Fortran90 Interface: + SUBROUTINE h5pset_alignment_f(prp_id, threshold, alignment, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HSIZE_T), INTENT(IN) :: threshold ! Threshold value + INTEGER(HSIZE_T), INTENT(IN) :: alignment ! alignment value + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** -!---------------------------------------------------------------------- -! Name: h5pget_userblock_f -! -! Purpose: Gets user block size. -! -! Inputs: -! prp_id - file creation property list identifier -! Outputs: -! block_size - size of the user block in bytes -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 +! INTEGER, EXTERNAL :: h5pset_alignment_c +! MS FORTRAN needs explicit interface for C functions called here. ! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 + 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 + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER(HSIZE_T), INTENT(IN) :: threshold + INTEGER(HSIZE_T), INTENT(IN) :: alignment + END FUNCTION h5pset_alignment_c + END INTERFACE + + hdferr = h5pset_alignment_c(prp_id, threshold, alignment) + END SUBROUTINE h5pset_alignment_f + +!****s* H5P/h5pget_alignment_f +! NAME +! h5pget_alignment_f +! +! PURPOSE +! Retrieves the current settings for alignment +! properties from a file access property list. +! +! INPUTS +! prp_id - file access property list identifier +! +! OUTPUTS +! threshold - threshold value +! alignment - alignment value +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Fortran90 Interface: + SUBROUTINE h5pget_alignment_f(prp_id, threshold, alignment, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HSIZE_T), INTENT(OUT) :: threshold ! Threshold value + INTEGER(HSIZE_T), INTENT(OUT) :: alignment ! alignment value + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** +! INTEGER, EXTERNAL :: h5pget_alignment_c +! MS FORTRAN needs explicit interface for C functions called here. ! -! Comment: -!---------------------------------------------------------------------- - - - SUBROUTINE h5pget_userblock_f(prp_id, block_size, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER(HSIZE_T), INTENT(OUT) :: block_size !Size of the - !user-block in bytes - INTEGER, INTENT(OUT) :: hdferr ! Error code + 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 + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER(HSIZE_T), INTENT(OUT) :: threshold + INTEGER(HSIZE_T), INTENT(OUT) :: alignment + END FUNCTION h5pget_alignment_c + END INTERFACE + + hdferr = h5pget_alignment_c(prp_id, threshold, alignment) + END SUBROUTINE h5pget_alignment_f + +!****s* H5P/h5pset_fapl_core_f +! NAME +! h5pset_fapl_core_f +! +! PURPOSE +! Modifies the file access property list to use the +! H5FD_CORE driver. +! +! INPUTS +! prp_id - file access property list identifier +! increment - size, in bytes, of memory increments +! backing_store - boolean flag indicating whether to write +! the file contents to disk when the file is closed. +! OUTPUTS +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Fortran90 Interface: + SUBROUTINE h5pset_fapl_core_f(prp_id, increment, backing_store, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(SIZE_T), INTENT(IN) :: increment ! File block size in bytes. + LOGICAL, INTENT(IN) :: backing_store ! Flag to indicate that + ! entire file contents are flushed to a file + ! with the same name as this core file. + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTEGER :: backing_store_flag -! INTEGER, EXTERNAL :: h5pget_userblock_c +! INTEGER, EXTERNAL :: h5pset_fapl_core_c ! MS FORTRAN needs explicit interface for C functions called here. ! - 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 - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER(HSIZE_T), INTENT(OUT) :: block_size - END FUNCTION h5pget_userblock_c - END INTERFACE - hdferr = h5pget_userblock_c(prp_id, block_size) - END SUBROUTINE h5pget_userblock_f - -!---------------------------------------------------------------------- -! Name: h5pset_sizes_f -! -! Purpose: Sets the byte size of the offsets and lengths used -! to address objects in an HDF5 file. -! -! Inputs: -! prp_id - file creation property list identifier -! sizeof_addr - size of an object offset in bytes -! sizeof_size - size of an object length in bytes -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pset_sizes_f (prp_id, sizeof_addr, sizeof_size, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER(SIZE_T), INTENT(IN) :: sizeof_addr !Size of an object - !offset in bytes - INTEGER(SIZE_T), INTENT(IN) :: sizeof_size !Size of an object - !length in bytes - INTEGER, INTENT(OUT) :: hdferr ! Error code + 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 + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER(SIZE_T), INTENT(IN) :: increment + INTEGER :: backing_store_flag + END FUNCTION h5pset_fapl_core_c + END INTERFACE + backing_store_flag = 0 + IF(backing_store) backing_store_flag = 1 + hdferr = h5pset_fapl_core_c(prp_id, increment, backing_store_flag) + END SUBROUTINE h5pset_fapl_core_f + +!****s* H5P/h5pget_fapl_core_f +! NAME +! h5pget_fapl_core_f +! +! PURPOSE +! Queries core file driver properties. +! +! INPUTS +! prp_id - file access property list identifier +! OUTPUTS +! +! increment - size, in bytes, of memory increments +! backing_store - boolean flag indicating whether to write +! the file contents to disk when the file is closed. +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Fortran90 Interface: + SUBROUTINE h5pget_fapl_core_f(prp_id, increment, backing_store, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(SIZE_T), INTENT(OUT) :: increment ! File block size in bytes. + LOGICAL, INTENT(OUT) :: backing_store ! Flag to indicate that + ! entire file contents are flushed to a file + ! with the same name as this core file. + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTEGER :: backing_store_flag -! INTEGER, EXTERNAL :: h5pset_sizes_c +! INTEGER, EXTERNAL :: h5pget_fapl_core_c ! MS FORTRAN needs explicit interface for C functions called here. ! - 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 - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER(SIZE_T), INTENT(IN) :: sizeof_addr - INTEGER(SIZE_T), INTENT(IN) :: sizeof_size - END FUNCTION h5pset_sizes_c - END INTERFACE - - hdferr = h5pset_sizes_c(prp_id, sizeof_addr, sizeof_size) - END SUBROUTINE h5pset_sizes_f + 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 + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER(SIZE_T), INTENT(OUT) :: increment + INTEGER :: backing_store_flag + END FUNCTION h5pget_fapl_core_c + END INTERFACE + + hdferr = h5pget_fapl_core_c(prp_id, increment, backing_store_flag) + backing_store =.FALSE. + IF (backing_store_flag .EQ. 1) backing_store =.TRUE. + END SUBROUTINE h5pget_fapl_core_f + +!****s* H5P/ h5pset_fapl_family_f +! NAME +! h5pset_fapl_family_f +! +! PURPOSE +! Sets the file access property list to use the family driver. +! +! INPUTS +! prp_id - file access property list identifier +! memb_size - size in bytes of each file member +! memb_plist - identifier of the file access property +! list to be used for each family member +! OUTPUTS +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Fortran90 Interface: + SUBROUTINE h5pset_fapl_family_f(prp_id, memb_size, memb_plist , hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HSIZE_T), INTENT(IN) :: memb_size ! Logical size, in bytes, + ! of each family member + INTEGER(HID_T), INTENT(IN) :: memb_plist ! Identifier of the file + ! access property list for + ! each member of the family + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** -!---------------------------------------------------------------------- -! Name: h5pget_sizes_f -! -! Purpose: Retrieves the size of the offsets and lengths used -! in an HDF5 file -! -! Inputs: -! prp_id - file creation property list identifier -! Outputs: -! sizeof_addr - size of an object offset in bytes -! sizeof_size - size of an object length in bytes -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 +! INTEGER, EXTERNAL :: h5pset_fapl_family_f +! MS FORTRAN needs explicit interface for C functions called here. ! -! Comment: -!---------------------------------------------------------------------- - - - SUBROUTINE h5pget_sizes_f(prp_id, sizeof_addr, sizeof_size, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER(SIZE_T), INTENT(OUT) :: sizeof_addr !Size of an object - !offset in bytes - INTEGER(SIZE_T), INTENT(OUT) :: sizeof_size !Size of an object - !length in bytes + 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 + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER(HSIZE_T), INTENT(IN) :: memb_size + INTEGER(HID_T), INTENT(IN) :: memb_plist + END FUNCTION h5pset_fapl_family_c + END INTERFACE - INTEGER, INTENT(OUT) :: hdferr ! Error code + hdferr = h5pset_fapl_family_c(prp_id, memb_size, memb_plist) + END SUBROUTINE h5pset_fapl_family_f + +!****s* H5P/h5pget_fapl_family_f +! NAME +! h5pget_fapl_family_f +! +! PURPOSE +! Returns file access property list information. +! +! INPUTS +! prp_id - file access property list identifier +! OUTPUTS +! memb_size - size in bytes of each file member +! memb_plist - identifier of the file access property +! list to be used for each family member +! hdferr - error code +! Success: 0 +! Failure: -1 +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Fortran90 Interface: + SUBROUTINE h5pget_fapl_family_f(prp_id, memb_size, memb_plist , hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HSIZE_T), INTENT(OUT) :: memb_size ! Logical size, in bytes, + ! of each family member + INTEGER(HID_T), INTENT(OUT) :: memb_plist ! Identifier of the file + ! access property list for + ! each member of the family + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** -! INTEGER, EXTERNAL :: h5pget_sizes_c +! INTEGER, EXTERNAL :: h5pget_fapl_family_f ! MS FORTRAN needs explicit interface for C functions called here. ! - 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 - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER(SIZE_T), INTENT(OUT) :: sizeof_addr - INTEGER(SIZE_T), INTENT(OUT) :: sizeof_size - END FUNCTION h5pget_sizes_c - END INTERFACE - - hdferr = h5pget_sizes_c(prp_id, sizeof_addr, sizeof_size) - END SUBROUTINE h5pget_sizes_f + 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 + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER(HSIZE_T), INTENT(OUT) :: memb_size + INTEGER(HID_T), INTENT(OUT) :: memb_plist + END FUNCTION h5pget_fapl_family_c + END INTERFACE + + hdferr = h5pget_fapl_family_c(prp_id, memb_size, memb_plist) + END SUBROUTINE h5pget_fapl_family_f + +!****s* H5P/h5pset_cache_f +! NAME +! h5pset_cache_f +! +! PURPOSE +! Sets the meta data cache and raw data chunk +! cache parameters +! +! INPUTS +! +! prp_id - file access property list identifier +! mdc_nelmts - number of elements (objects) in the meta +! data cache +! rdcc_nelmts - number of elements (objects) in the raw +! data chunk cache +! rdcc_nbytes - total size of the raw data chunk cache, in bytes +! rdcc_w0 - preemption policy (0 or 1) +! OUTPUTS +! +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Fortran90 Interface: + SUBROUTINE h5pset_cache_f(prp_id, mdc_nelmts,rdcc_nelmts, rdcc_nbytes, rdcc_w0, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER, INTENT(IN) :: mdc_nelmts ! Number of elements (objects) + ! in the meta data cache + INTEGER(SIZE_T), INTENT(IN) :: rdcc_nelmts ! Number of elements (objects) + ! in the meta data cache + INTEGER(SIZE_T), INTENT(IN) :: rdcc_nbytes ! Total size of the raw data + ! chunk cache, in bytes + REAL, INTENT(IN) :: rdcc_w0 ! Preemption policy + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** -!---------------------------------------------------------------------- -! Name: h5pset_sym_k_f -! -! Purpose: Sets the size of parameters used to control the -! symbol table nodes -! -! Inputs: -! prp_id - file creation property list identifier -! ik - symbol table tree rank -! lk - symbol table node size -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 +! INTEGER, EXTERNAL :: h5pset_cache_c +! MS FORTRAN needs explicit interface for C functions called here. ! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pset_sym_k_f (prp_id, ik, lk, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER, INTENT(IN) :: ik ! Symbol table tree rank - INTEGER, INTENT(IN) :: lk ! Symbol table node size + 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 + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER, INTENT(IN) :: mdc_nelmts + INTEGER(SIZE_T), INTENT(IN) :: rdcc_nelmts + INTEGER(SIZE_T), INTENT(IN) :: rdcc_nbytes + REAL, INTENT(IN) :: rdcc_w0 + END FUNCTION h5pset_cache_c + END INTERFACE - INTEGER, INTENT(OUT) :: hdferr ! Error code + hdferr = h5pset_cache_c(prp_id, mdc_nelmts, rdcc_nelmts, rdcc_nbytes, rdcc_w0 ) + END SUBROUTINE h5pset_cache_f + +!****s* H5P/h5pget_cache_f +! NAME +! h5pget_cache_f +! +! PURPOSE +! Queries the meta data cache and raw data chunk cache +! parameters. +! +! INPUTS +! prp_id - file access property list identifier +! +! OUTPUTS +! mdc_nelmts - number of elements (objects) in the meta +! data cache +! rdcc_nelmts - number of elements (objects) in the raw +! data chunk cache +! rdcc_nbytes - total size of the raw data chunk cache, in bytes +! rdcc_w0 - preemption policy (0 or 1) +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Bug fix: type of the rdcc_nelmts parameter should be INTEGER +! instead of INTEGER(SIZE_T) October 10, 2003 +! +! Fortran90 Interface: + SUBROUTINE h5pget_cache_f(prp_id, mdc_nelmts, rdcc_nelmts, rdcc_nbytes, rdcc_w0, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER, INTENT(OUT) :: mdc_nelmts ! Number of elements (objects) + ! in the meta data cache + INTEGER(SIZE_T), INTENT(OUT) :: rdcc_nelmts ! Number of elements (objects) + ! in the meta data cache + INTEGER(SIZE_T), INTENT(OUT) :: rdcc_nbytes ! Total size of the raw data + ! chunk cache, in bytes + REAL, INTENT(OUT) :: rdcc_w0 ! Preemption policy + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** +! INTEGER, EXTERNAL :: h5pget_cache_c +! MS FORTRAN needs explicit interface for C functions called here. +! + 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 + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER, INTENT(OUT) :: mdc_nelmts + INTEGER(SIZE_T), INTENT(OUT) :: rdcc_nelmts + INTEGER(SIZE_T), INTENT(OUT) :: rdcc_nbytes + REAL, INTENT(OUT) :: rdcc_w0 + END FUNCTION h5pget_cache_c + END INTERFACE + + hdferr = h5pget_cache_c(prp_id, mdc_nelmts,rdcc_nelmts, rdcc_nbytes, rdcc_w0 ) + END SUBROUTINE h5pget_cache_f + +!****s* H5P/h5pset_fapl_split_f +! NAME +! h5pset_fapl_split_f +! +! PURPOSE +! Emulates the old split file driver. +! +! INPUTS +! +! prp_id - file access property list identifier +! meta_ext - name of the extension for the metafile +! filename +! meta_plist - identifier of the meta file access property +! list +! raw_ext - name extension for the raw file filename +! raw_plist - identifier of the raw file access property list +! +! OUTPUTS +! +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Fortran90 Interface: + SUBROUTINE h5pset_fapl_split_f(prp_id, meta_ext, meta_plist, raw_ext, raw_plist, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + CHARACTER(LEN=*), INTENT(IN) :: meta_ext ! Name of the extension for + ! the metafile filename + INTEGER(HID_T), INTENT(IN) :: meta_plist ! Identifier of the meta file + ! access property list + CHARACTER(LEN=*), INTENT(IN) :: raw_ext ! Name extension for the raw file filename + INTEGER(HID_T), INTENT(IN) :: raw_plist ! Identifier of the raw file + ! access property list + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTEGER :: meta_len, raw_len -! INTEGER, EXTERNAL :: h5pset_sym_k_c +! INTEGER, EXTERNAL :: h5pset_fapl_split_c ! MS FORTRAN needs explicit interface for C functions called here. ! - 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 - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER, INTENT(IN) :: ik - INTEGER, INTENT(IN) :: lk - END FUNCTION h5pset_sym_k_c - END INTERFACE + 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$ATTRIBUTES reference :: meta_ext + !DEC$ATTRIBUTES reference :: raw_ext + INTEGER(HID_T), INTENT(IN) :: prp_id + CHARACTER(LEN=*), INTENT(IN) :: meta_ext + INTEGER(HID_T), INTENT(IN) :: meta_plist + CHARACTER(LEN=*), INTENT(IN) :: raw_ext + INTEGER(HID_T), INTENT(IN) :: raw_plist + INTEGER :: meta_len, raw_len + END FUNCTION h5pset_fapl_split_c + END INTERFACE - hdferr = h5pset_sym_k_c(prp_id, ik, lk) - END SUBROUTINE h5pset_sym_k_f + meta_len = LEN(meta_ext) + raw_len = LEN(raw_ext) + hdferr = h5pset_fapl_split_c(prp_id,meta_len,meta_ext,meta_plist,raw_len,raw_ext,raw_plist) + END SUBROUTINE h5pset_fapl_split_f + +!****s* H5P/h5pget_split_f +! NAME +! h5pget_split_f +! +! PURPOSE +! NOT AVAILABLE +! +! INPUTS +! +! OUTPUTS +! +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! SOURCE +! SUBROUTINE h5pget_split_f(prp_id, meta_ext_size, meta_ext, meta_plist,raw_ext_size,& +! raw_ext, raw_plist, hdferr) +! IMPLICIT NONE +! INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier +! INTEGER(SIZE_T), INTENT(IN) :: meta_ext_size ! Number of characters of the meta + ! file extension to be copied to the + ! meta_ext buffer -!---------------------------------------------------------------------- -! Name: h5pget_sym_k_f -! -! Purpose: Retrieves the size of the symbol table B-tree 1/2 rank -! and the symbol table leaf node 1/2 size. -! -! Inputs: -! prp_id - file creation property list identifier -! Outputs: -! ik - symbol table tree 1/2 rank -! lk - symbol table node 1/2 size -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! Comment: -!---------------------------------------------------------------------- +! CHARACTER(LEN=*), INTENT(OUT) :: meta_ext !Name of the extension for + !the metafile filename +! INTEGER(HID_T), INTENT(OUT) :: meta_plist ! Identifier of the meta file + ! access property list +! INTEGER(SIZE_T), INTENT(IN) :: raw_ext_size ! Number of characters of the raw + ! file extension to be copied to the + ! raw_ext buffer +! CHARACTER(LEN=*), INTENT(OUT) :: raw_ext !Name extension for the raw file filename +! INTEGER(HID_T), INTENT(OUT) :: raw_plist !Identifier of the raw file + !access property list +! INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** +! INTEGER, EXTERNAL :: h5pget_split_c +! hdferr = h5pget_split_c(prp_id, meta_ext_size, meta_ext, meta_plist, & +! raw_ext_size, raw_ext, raw_plist ) +! END SUBROUTINE h5pget_split_f - SUBROUTINE h5pget_sym_k_f(prp_id, ik, lk, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER, INTENT(OUT) :: ik !Symbol table tree rank - INTEGER, INTENT(OUT) :: lk !Symbol table node size - INTEGER, INTENT(OUT) :: hdferr ! Error code +!****s* H5P/h5pset_gc_references_f +! NAME +! h5pset_gc_references_f +! +! PURPOSE +! Sets garbage collecting references flag. +! +! INPUTS +! +! prp_id - file access property list identifier +! gc_reference - flag for stting garbage collection on +! and off (1 or 0) +! OUTPUTS +! +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Fortran90 Interface: + SUBROUTINE h5pset_gc_references_f (prp_id, gc_reference, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER, INTENT(IN) :: gc_reference ! The flag for garbage collecting + ! references for the file + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** -! INTEGER, EXTERNAL :: h5pget_sym_k_c +! INTEGER, EXTERNAL :: h5pset_gc_references_c ! MS FORTRAN needs explicit interface for C functions called here. ! - 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 - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER, INTENT(OUT) :: ik - INTEGER, INTENT(OUT) :: lk - END FUNCTION h5pget_sym_k_c - END INTERFACE + 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 + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER, INTENT(IN) :: gc_reference + END FUNCTION h5pset_gc_references_c + END INTERFACE - hdferr = h5pget_sym_k_c(prp_id, ik, lk) - END SUBROUTINE h5pget_sym_k_f + hdferr = h5pset_gc_references_c(prp_id, gc_reference) + END SUBROUTINE h5pset_gc_references_f + +!****s* H5P/h5pget_gc_references_f +! NAME +! h5pget_gc_references_f +! +! PURPOSE +! Returns garbage collecting references setting. +! +! INPUTS +! +! prp_id - file access property list identifier +! OUTPUTS +! +! gc_reference - flag for stting garbage collection on +! and off (1 or 0) +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Fortran90 Interface: + SUBROUTINE h5pget_gc_references_f(prp_id, gc_reference, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER, INTENT(OUT) :: gc_reference ! The flag for garbage collecting + ! references for the file + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** -!---------------------------------------------------------------------- -! Name: h5pset_istore_k_f -! -! Purpose: Sets the size of the parameter used to control the -! B-trees for indexing chunked datasets -! -! Inputs: -! prp_id - file creation property list identifier -! ik - 1/2 rank of chunked storage B-tree -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 +! INTEGER, EXTERNAL :: h5pget_gc_references_c +! MS FORTRAN needs explicit interface for C functions called here. ! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pset_istore_k_f (prp_id, ik, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER, INTENT(IN) :: ik ! 1/2 rank of chunked storage B-tree - - INTEGER, INTENT(OUT) :: hdferr ! Error code + 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 + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER, INTENT(OUT) :: gc_reference + END FUNCTION h5pget_gc_references_c + END INTERFACE + + hdferr = h5pget_gc_references_c(prp_id, gc_reference) + END SUBROUTINE h5pget_gc_references_f + +!****s* H5P/h5pset_layout_f +! NAME +! h5pset_layout_f +! +! PURPOSE +! Sets the type of storage used store the raw data +! for a dataset. +! +! INPUTS +! +! prp_id - data creation property list identifier +! layout - type of storage layout for raw data +! possible values are: +! H5D_COMPACT_F +! H5D_CONTIGUOUS_F +! H5D_CHUNKED_F +! OUTPUTS +! +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Fortran90 Interface: + SUBROUTINE h5pset_layout_f (prp_id, layout, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER, INTENT(IN) :: layout ! Type of storage layout for raw data + ! possible values are: + ! H5D_COMPACT_F + ! H5D_CONTIGUOUS_F + ! H5D_CHUNKED_F + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** -! INTEGER, EXTERNAL :: h5pset_istore_k_c +! INTEGER, EXTERNAL :: h5pset_layout_c ! MS FORTRAN needs explicit interface for C functions called here. ! - 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 - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER, INTENT(IN) :: ik - END FUNCTION h5pset_istore_k_c - END INTERFACE - - hdferr = h5pset_istore_k_c(prp_id, ik) - END SUBROUTINE h5pset_istore_k_f - -!---------------------------------------------------------------------- -! Name: h5pget_istore_k_f -! -! Purpose: Queries the 1/2 rank of an indexed storage B-tree. -! -! Inputs: -! prp_id - file creation property list identifier -! Outputs: -! ik - 1/2 rank of chunked storage B-tree -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! Comment: -!---------------------------------------------------------------------- - - - SUBROUTINE h5pget_istore_k_f(prp_id, ik, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER, INTENT(OUT) :: ik !1/2 rank of chunked storage B-tree - INTEGER, INTENT(OUT) :: hdferr ! Error code + 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 + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER, INTENT(IN) :: layout + END FUNCTION h5pset_layout_c + END INTERFACE + + hdferr = h5pset_layout_c(prp_id, layout) + END SUBROUTINE h5pset_layout_f + +!****s* H5P/h5pget_layout_f +! NAME +! h5pget_layout_f +! +! PURPOSE +! Returns the layout of the raw data for a dataset. +! +! INPUTS +! +! prp_id - data creation property list identifier +! OUTPUTS +! +! layout - type of storage layout for raw data +! possible values are: +! H5D_COMPACT_F +! H5D_CONTIGUOUS_F +! H5D_CHUNKED_F +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Fortran90 Interface: + SUBROUTINE h5pget_layout_f (prp_id, layout, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER, INTENT(OUT) :: layout ! Type of storage layout for raw data + ! possible values are: + ! H5D_COMPACT_F(0) + ! H5D_CONTIGUOUS_F(1) + ! H5D_CHUNKED_F(2) + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** -! INTEGER, EXTERNAL :: h5pget_istore_k_c +! INTEGER, EXTERNAL :: h5pget_layout_c ! MS FORTRAN needs explicit interface for C functions called here. ! - 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 - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER, INTENT(OUT) :: ik - END FUNCTION h5pget_istore_k_c - END INTERFACE - - hdferr = h5pget_istore_k_c(prp_id, ik) - END SUBROUTINE h5pget_istore_k_f - -!---------------------------------------------------------------------- -! Name: h5pget_driver_f -! -! Purpose: Returns low-lever driver identifier. -! -! Inputs: -! prp_id - file access or data transfer property -! list identifier. -! Outputs: -! driver - low-level driver identifier -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pget_driver_f(prp_id, driver, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER(HID_T), INTENT(OUT) :: driver !low-level file driver identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code + 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 + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER, INTENT(OUT) :: layout + END FUNCTION h5pget_layout_c + END INTERFACE + + hdferr = h5pget_layout_c(prp_id, layout) + END SUBROUTINE h5pget_layout_f + +!****s* H5P/h5pset_filter_f +! NAME +! h5pset_filter_f +! +! PURPOSE +! Adds a filter to the filter pipeline. +! +! INPUTS +! +! prp_id - data creation or transfer property list +! identifier +! filter - filter to be added to the pipeline +! flags - bit vector specifying certain general +! properties of the filter +! cd_nelmts - number of elements in cd_values +! cd_values - auxiliary data for the filter +! OUTPUTS +! +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! February, 2003 +! +! Fortran90 Interface: + SUBROUTINE h5pset_filter_f(prp_id, filter, flags, cd_nelmts, cd_values, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER, INTENT(IN) :: filter ! Filter to be added to the pipeline. + INTEGER, INTENT(IN) :: flags ! Bit vector specifying certain general + ! properties of the filter. + INTEGER(SIZE_T), INTENT(IN) :: cd_nelmts ! Number of elements in cd_values. + INTEGER, DIMENSION(*), INTENT(IN) :: cd_values ! Auxiliary data for the filter. + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** -! INTEGER, EXTERNAL :: h5pget_driver_c +! INTEGER, EXTERNAL :: h5pset_filter_c ! MS FORTRAN needs explicit interface for C functions called here. ! - 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 - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER(HID_T), INTENT(OUT) :: driver - END FUNCTION h5pget_driver_c - END INTERFACE - - hdferr = h5pget_driver_c(prp_id, driver) - END SUBROUTINE h5pget_driver_f - -!---------------------------------------------------------------------- -! Name: h5pset_fapl_stdio_f -! -! Purpose: Sets the standard I/O driver. -! -! Inputs: -! prp_id - file access property list identifier -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pset_fapl_stdio_f (prp_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code + 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 + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER, INTENT(IN) :: filter + INTEGER, INTENT(IN) :: flags + INTEGER(SIZE_T), INTENT(IN) :: cd_nelmts + INTEGER, DIMENSION(*), INTENT(IN) :: cd_values + END FUNCTION h5pset_filter_c + END INTERFACE + + hdferr = h5pset_filter_c(prp_id, filter, flags, cd_nelmts, cd_values ) + END SUBROUTINE h5pset_filter_f + +!****s* H5P/h5pget_nfilters_f +! NAME +! h5pget_nfilters_f +! +! PURPOSE +! Returns the number of filters in the pipeline. +! +! INPUTS +! +! prp_id - data creation or transfer property list +! identifier +! OUTPUTS +! +! nfilters - number of filters in the pipeline +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Fortran90 Interface: + SUBROUTINE h5pget_nfilters_f (prp_id, nfilters, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER, INTENT(OUT) :: nfilters ! The number of filters in the pipeline + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** -! INTEGER, EXTERNAL :: h5pset_fapl_stdio_c +! INTEGER, EXTERNAL :: h5pget_nfilters_c ! MS FORTRAN needs explicit interface for C functions called here. ! - 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 - INTEGER(HID_T), INTENT(IN) :: prp_id - END FUNCTION h5pset_fapl_stdio_c - END INTERFACE - - hdferr = h5pset_fapl_stdio_c(prp_id) - END SUBROUTINE h5pset_fapl_stdio_f - -!---------------------------------------------------------------------- -! Name: h5pget_stdio_f -! -! Purpose: NOT AVAILABLE -! -! Inputs: -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! Comment: -!---------------------------------------------------------------------- - -! SUBROUTINE h5pget_stdio_f (prp_id, io, hdferr) -! -! IMPLICIT NONE -! INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier -! INTEGER, INTENT(OUT) :: io ! value indicates that the file - !access property list is set to - !the stdio driver -! INTEGER, INTENT(OUT) :: hdferr ! Error code -! INTEGER, EXTERNAL :: h5pget_stdio_c -! hdferr = h5pget_stdio_c(prp_id, io) -! END SUBROUTINE h5pget_stdio_f - -!---------------------------------------------------------------------- -! Name: h5pset_fapl_sec2_f -! -! Purpose: Sets the sec2 driver. -! -! Inputs: -! prp_id - file access property list identifier -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! Comment: -!---------------------------------------------------------------------- + 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 + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER, INTENT(OUT) :: nfilters + END FUNCTION h5pget_nfilters_c + END INTERFACE + + hdferr = h5pget_nfilters_c(prp_id, nfilters) + END SUBROUTINE h5pget_nfilters_f + +!****s* H5P/h5pget_filter_f +! NAME +! h5pget_filter_f +! +! PURPOSE +! Returns information about a filter in a pipeline +! +! INPUTS +! +! prp_id - data creation or transfer property list +! identifier +! filter_number - sequence number within the filter +! pipeline of the filter for which +! information is sought +! OUTPUTS +! +! filter_id - filter identification number +! flags - bit vector specifying certain general +! properties of the filter +! cd_nelmts - number of elements in cd_values +! cd_values - auxiliary data for the filter +! namelen - number of characters in the name buffer +! name - buffer to retrieve filter name +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Fortran90 Interface: + SUBROUTINE h5pget_filter_f(prp_id, filter_number, flags, cd_nelmts, cd_values, namelen, name, filter_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER, INTENT(IN) :: filter_number ! Sequence number within the filter + ! pipeline of the filter for which + ! information is sought + INTEGER, DIMENSION(*), INTENT(OUT) :: cd_values ! Auxiliary data for the filter. + INTEGER, INTENT(OUT) :: flags ! Bit vector specifying certain general + ! properties of the filter. + INTEGER(SIZE_T), INTENT(INOUT) :: cd_nelmts ! Number of elements in cd_values. + INTEGER(SIZE_T), INTENT(IN) :: namelen ! Anticipated number of characters in name. + CHARACTER(LEN=*), INTENT(OUT) :: name ! Name of the filter + INTEGER, INTENT(OUT) :: filter_id ! Filter identification number + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** - SUBROUTINE h5pset_fapl_sec2_f (prp_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code -! INTEGER, EXTERNAL :: h5pset_fapl_sec2_c +! INTEGER, EXTERNAL :: h5pget_filter_c ! MS FORTRAN needs explicit interface for C functions called here. ! - 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 - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - END FUNCTION h5pset_fapl_sec2_c - END INTERFACE + INTERFACE + 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$ATTRIBUTES reference :: name + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER, INTENT(IN) :: filter_number + INTEGER, DIMENSION(*), INTENT(OUT) :: cd_values + INTEGER, INTENT(OUT) :: flags + INTEGER(SIZE_T), INTENT(INOUT) :: cd_nelmts + INTEGER(SIZE_T), INTENT(IN) :: namelen + CHARACTER(LEN=*), INTENT(OUT) :: name + INTEGER, INTENT(OUT) :: filter_id + END FUNCTION h5pget_filter_c + END INTERFACE + + hdferr = h5pget_filter_c(prp_id, filter_number, flags, cd_nelmts, & + cd_values, namelen, name, filter_id ) + END SUBROUTINE h5pget_filter_f + +!****s* H5P/h5pset_external_f +! NAME +! h5pset_external_f +! +! PURPOSE +! Adds an external file to the list of external files. +! +! INPUTS +! +! prp_id - dataset creation property list identifier +! name - name of external file +! offset - offset in bytes from the beginning of the +! file to the location in the file +! where the data starts +! bytes - size of the external file data. +! OUTPUTS +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Fortran90 Interface: + SUBROUTINE h5pset_external_f(prp_id, name, offset,bytes, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of an external file + INTEGER, INTENT(IN) :: offset ! Offset, in bytes, from the beginning + ! of the file to the location in the file + ! where the data starts. + INTEGER(HSIZE_T), INTENT(IN) :: bytes ! Number of bytes reserved in the + ! file for the data + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** - hdferr = h5pset_fapl_sec2_c(prp_id) - END SUBROUTINE h5pset_fapl_sec2_f + INTEGER :: namelen -!---------------------------------------------------------------------- -! Name: h5pget_sec2_f -! -! Purpose: NOT AVAILABLE -! -! Inputs: -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 +! INTEGER, EXTERNAL :: h5pset_external_c +! MS FORTRAN needs explicit interface for C functions called here. ! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 + 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$ATTRIBUTES reference :: name + INTEGER(HID_T), INTENT(IN) :: prp_id + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER :: namelen + INTEGER, INTENT(IN) :: offset + INTEGER(HSIZE_T), INTENT(IN) :: bytes + END FUNCTION h5pset_external_c + END INTERFACE + + namelen = LEN(name) + hdferr = h5pset_external_c(prp_id, name, namelen, offset, bytes) + END SUBROUTINE h5pset_external_f + +!****s* H5P/h5pget_external_count_f +! NAME +! h5pget_external_count_f +! +! PURPOSE +! Returns the number of external files for a dataset. +! +! INPUTS +! +! prp_id - dataset creation property list identifier +! OUTPUTS +! +! count - number of external files for the +! specified dataset +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Fortran90 Interface: + SUBROUTINE h5pget_external_count_f (prp_id, count, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER, INTENT(OUT) :: count ! Number of external files for the + ! Specified dataset + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** +! INTEGER, EXTERNAL :: h5pget_external_count_c +! MS FORTRAN needs explicit interface for C functions called here. ! -! Comment: -!---------------------------------------------------------------------- - -! SUBROUTINE h5pget_sec2_f (prp_id, sec2, hdferr) -! IMPLICIT NONE -! INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier -! INTEGER, INTENT(OUT) :: sec2 ! value indicates whether the file - !driver uses the functions declared - !in the unistd.h file -! INTEGER, INTENT(OUT) :: hdferr ! Error code -! INTEGER, EXTERNAL :: h5pget_sec2_c -! hdferr = h5pget_sec2_c(prp_id, sec2) -! END SUBROUTINE h5pget_sec2_f + 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 + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER, INTENT(OUT) :: count + END FUNCTION h5pget_external_count_c + END INTERFACE + + hdferr = h5pget_external_count_c(prp_id, count) + END SUBROUTINE h5pget_external_count_f + +!****s* H5P/h5pget_external_f +! NAME +! h5pget_external_f +! +! PURPOSE +! Returns information about an external file. +! +! INPUTS +! +! prp_id - dataset creation property list identifier +! OUTPUTS +! +! idx - external file index +! name_size - maximum size of name array +! name - name of the external file +! name - name of external file +! offset - offset in bytes from the beginning of the +! file to the location in the file +! where the data starts +! bytes - size of the external file data +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Fortran90 Interface: + SUBROUTINE h5pget_external_f(prp_id, idx, name_size, name, offset,bytes, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER, INTENT(IN) :: idx ! External file index. + INTEGER(SIZE_T), INTENT(IN) :: name_size ! Maximum length of name array + CHARACTER(LEN=*), INTENT(OUT) :: name ! Name of an external file + INTEGER, INTENT(OUT) :: offset ! Offset, in bytes, from the beginning + ! of the file to the location in the file + ! where the data starts. + INTEGER(HSIZE_T), INTENT(OUT) :: bytes ! Number of bytes reserved in the + ! file for the data + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** -!---------------------------------------------------------------------- -! Name: h5pset_alignment_f -! -! Purpose: Sets alignment properties of a file access property list. -! -! Inputs: -! prp_id - file access property list identifier -! threshold - threshold value -! alignment - alignment value -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 +! INTEGER, EXTERNAL :: h5pget_external_c +! MS FORTRAN needs explicit interface for C functions called here. ! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pset_alignment_f(prp_id, threshold, alignment, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER(HSIZE_T), INTENT(IN) :: threshold ! Threshold value - INTEGER(HSIZE_T), INTENT(IN) :: alignment ! alignment value - INTEGER, INTENT(OUT) :: hdferr ! Error code + 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$ATTRIBUTES reference :: name + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER, INTENT(IN) :: idx + INTEGER(SIZE_T), INTENT(IN) :: name_size + CHARACTER(LEN=*), INTENT(OUT) :: name + INTEGER, INTENT(OUT) :: offset + INTEGER(HSIZE_T), INTENT(OUT) :: bytes + END FUNCTION h5pget_external_c + END INTERFACE + + hdferr = h5pget_external_c(prp_id, idx, name_size, name, offset, bytes) + END SUBROUTINE h5pget_external_f + +!****s* H5P/h5pset_btree_ratios_f +! NAME +! h5pset_btree_ratios_f +! +! PURPOSE +! Sets B-tree split ratios for a dataset transfer +! property list. +! +! INPUTS +! +! prp_id - the dataset transfer property list +! identifier +! left - the B-tree split ratio for left-most nodes +! middle - the B-tree split ratio for all other nodes +! right - the B-tree split ratio for right-most nodes +! OUTPUTS +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Fortran90 Interface: + SUBROUTINE h5pset_btree_ratios_f(prp_id, left, middle, right, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + REAL, INTENT(IN) :: left ! The B-tree split ratio for left-most nodes. + REAL, INTENT(IN) :: middle ! The B-tree split ratio for all other nodes + REAL, INTENT(IN) :: right ! The B-tree split ratio for right-most + ! nodes and lone nodes. + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** -! INTEGER, EXTERNAL :: h5pset_alignment_c +! INTEGER, EXTERNAL :: h5pset_btree_ratios_c ! MS FORTRAN needs explicit interface for C functions called here. ! - 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 - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER(HSIZE_T), INTENT(IN) :: threshold - INTEGER(HSIZE_T), INTENT(IN) :: alignment - END FUNCTION h5pset_alignment_c - END INTERFACE + 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 + INTEGER(HID_T), INTENT(IN) :: prp_id + REAL, INTENT(IN) :: left + REAL, INTENT(IN) :: middle + REAL, INTENT(IN) :: right + END FUNCTION h5pset_btree_ratios_c + END INTERFACE + + hdferr = h5pset_btree_ratios_c(prp_id, left, middle, right) + END SUBROUTINE h5pset_btree_ratios_f + +!****s* H5P/h5pget_btree_ratios_f +! NAME +! h5pget_btree_ratios_f +! +! PURPOSE +! Gets B-tree split ratios for a dataset transfer property list +! +! INPUTS +! +! prp_id - the dataset transfer property list +! identifier +! OUTPUTS +! +! left - the B-tree split ratio for left-most nodes +! middle - the B-tree split ratio for all other nodes +! right - the B-tree split ratio for right-most nodes +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Fortran90 Interface: + SUBROUTINE h5pget_btree_ratios_f(prp_id, left, middle, right, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + REAL, INTENT(OUT) :: left ! The B-tree split ratio for left-most nodes. + REAL, INTENT(OUT) :: middle ! The B-tree split ratio for all other nodes + REAL, INTENT(OUT) :: right ! The B-tree split ratio for right-most + ! nodes and lone nodes. + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** - hdferr = h5pset_alignment_c(prp_id, threshold, alignment) - END SUBROUTINE h5pset_alignment_f -!---------------------------------------------------------------------- -! Name: h5pget_alignment_f -! -! Purpose: Retrieves the current settings for alignment -! properties from a file access property list. -! -! Inputs: -! prp_id - file access property list identifier -! Outputs: -! threshold - threshold value -! alignment - alignment value -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 +! INTEGER, EXTERNAL :: h5pget_btree_ratios_c +! MS FORTRAN needs explicit interface for C functions called here. ! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pget_alignment_f(prp_id, threshold, alignment, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER(HSIZE_T), INTENT(OUT) :: threshold ! Threshold value - INTEGER(HSIZE_T), INTENT(OUT) :: alignment ! alignment value - INTEGER, INTENT(OUT) :: hdferr ! Error code + 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 + INTEGER(HID_T), INTENT(IN) :: prp_id + REAL, INTENT(OUT) :: left + REAL, INTENT(OUT) :: middle + REAL, INTENT(OUT) :: right + END FUNCTION h5pget_btree_ratios_c + END INTERFACE + + hdferr = h5pget_btree_ratios_c(prp_id, left, middle, right) + END SUBROUTINE h5pget_btree_ratios_f + +!****s* H5P/h5pget_fclose_degree_f +! NAME +! h5pget_fclose_degree_f +! +! PURPOSE +! Returns the degree for the file close behavior. +! +! INPUTS +! +! fapl_id - File access property list identifier +! OUTPUTS +! +! degree - Possible values are: +! H5F_CLOSE_DEFAULT_F +! H5F_CLOSE_WEAK_F +! H5F_CLOSE_SEMI_F +! H5F_CLOSE_STRONG_F +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! September 26, 2002 +! +! HISTORY +! +! +! Fortran90 Interface: + SUBROUTINE h5pget_fclose_degree_f(fapl_id, degree, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: fapl_id ! File Access Property list identifier + INTEGER, INTENT(OUT) :: degree ! Possible values are: + ! H5F_CLOSE_DEFAULT_F + ! H5F_CLOSE_WEAK_F + ! H5F_CLOSE_SEMI_F + ! H5F_CLOSE_STRONG_F + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** -! INTEGER, EXTERNAL :: h5pget_alignment_c +! INTEGER, EXTERNAL :: h5pget_fclose_degree_c ! MS FORTRAN needs explicit interface for C functions called here. ! - 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 - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER(HSIZE_T), INTENT(OUT) :: threshold - INTEGER(HSIZE_T), INTENT(OUT) :: alignment - END FUNCTION h5pget_alignment_c - END INTERFACE - - hdferr = h5pget_alignment_c(prp_id, threshold, alignment) - END SUBROUTINE h5pget_alignment_f - -!---------------------------------------------------------------------- -! Name: h5pset_fapl_core_f -! -! Purpose: Modifies the file access property list to use the -! H5FD_CORE driver. -! -! Inputs: prp_id - file access property list identifier -! increment - size, in bytes, of memory increments -! backing_store - boolean flag indicating whether to write -! the file contents to disk when the file is closed. -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! Comment: -!---------------------------------------------------------------------- + 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 + INTEGER(HID_T), INTENT(IN) :: fapl_id + INTEGER, INTENT(OUT) :: degree + END FUNCTION h5pget_fclose_degree_c + END INTERFACE + + hdferr = h5pget_fclose_degree_c(fapl_id, degree) + END SUBROUTINE h5pget_fclose_degree_f + +!****s* H5P/h5pset_fclose_degree_f +! NAME +! h5pset_fclose_degree_f +! +! PURPOSE +! Sets the degree for the file close behavior. +! +! INPUTS +! +! fapl_id - file access property list identifier +! degree - Possible values are: +! H5F_CLOSE_DEFAULT_F +! H5F_CLOSE_WEAK_F +! H5F_CLOSE_SEMI_F +! H5F_CLOSE_STRONG_F +! OUTPUTS +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! September 26, 2002 +! +! Fortran90 Interface: + SUBROUTINE h5pset_fclose_degree_f(fapl_id, degree, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: fapl_id ! File Access Property list identifier + INTEGER, INTENT(IN) :: degree ! Possible values are: + ! H5F_CLOSE_DEFAULT_F + ! H5F_CLOSE_WEAK_F + ! H5F_CLOSE_SEMI_F + ! H5F_CLOSE_STRONG_F + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** - SUBROUTINE h5pset_fapl_core_f(prp_id, increment, backing_store, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER(SIZE_T), INTENT(IN) :: increment ! File block size in bytes. - LOGICAL, INTENT(IN) :: backing_store ! flag to indicate that - ! entire file contents are flushed to a file - ! with the same name as this core file. - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER :: backing_store_flag + 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 + INTEGER(HID_T), INTENT(IN) :: fapl_id + INTEGER, INTENT(IN) :: degree + END FUNCTION h5pset_fclose_degree_c + END INTERFACE -! INTEGER, EXTERNAL :: h5pset_fapl_core_c -! MS FORTRAN needs explicit interface for C functions called here. -! - 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 - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER(SIZE_T), INTENT(IN) :: increment - INTEGER :: backing_store_flag - END FUNCTION h5pset_fapl_core_c - END INTERFACE - backing_store_flag = 0 - if(backing_store) backing_store_flag = 1 - hdferr = h5pset_fapl_core_c(prp_id, increment, backing_store_flag) - END SUBROUTINE h5pset_fapl_core_f - -!---------------------------------------------------------------------- -! Name: h5pget_fapl_core_f -! -! Purpose: Queries core file driver properties. -! -! Inputs: -! prp_id - file access property list identifier -! Outputs: -! increment - size, in bytes, of memory increments -! backing_store - boolean flag indicating whether to write -! the file contents to disk when the file is closed. -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! Comment: -!---------------------------------------------------------------------- + hdferr = h5pset_fclose_degree_c(fapl_id, degree) + END SUBROUTINE h5pset_fclose_degree_f + +!****s* H5P/h5pequal_f +! NAME +! h5pequal_f +! +! PURPOSE +! Checks if two property lists are eqaul +! +! INPUTS +! +! plist1_id - property list identifier +! plist2_id - property list identifier +! OUTPUTS +! +! flag - flag, possible values +! .TRUE. or .FALSE. +! hdferr: - error code +! Success: 0 +! Failure: -1, flag is set to .FALSE. +! +! AUTHOR +! Elena Pourmal +! September 30, 2002 +! +! Fortran90 Interface: + SUBROUTINE h5pequal_f(plist1_id, plist2_id, flag, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist1_id ! Property list identifier + INTEGER(HID_T), INTENT(IN) :: plist2_id ! Property list identifier + LOGICAL, INTENT(OUT) :: flag ! Flag + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTEGER :: c_flag + + 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 + INTEGER(HID_T), INTENT(IN) :: plist1_id + INTEGER(HID_T), INTENT(IN) :: plist2_id + INTEGER, INTENT(OUT) :: c_flag + END FUNCTION h5pequal_c + END INTERFACE - SUBROUTINE h5pget_fapl_core_f(prp_id, increment, backing_store, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER(SIZE_T), INTENT(OUT) :: increment ! File block size in bytes. - LOGICAL, INTENT(OUT) :: backing_store ! flag to indicate that - ! entire file contents are flushed to a file - ! with the same name as this core file. - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER :: backing_store_flag + flag = .FALSE. + hdferr = h5pequal_c(plist1_id, plist2_id, c_flag) + IF (c_flag .GT. 0) flag = .TRUE. + END SUBROUTINE h5pequal_f + +!****s* H5P/h5pset_buffer_f +! NAME +! h5pset_buffer_f +! +! PURPOSE +! Sets sixe for conversion buffer +! +! INPUTS +! plist_id - data transfer property list identifier +! size - buffer size +! OUTPUTS +! +! hdferr: - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! October 2, 2002 +! +! Fortran90 Interface: + SUBROUTINE h5pset_buffer_f(plist_id, size, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist_id ! Data transfer property list identifier + INTEGER(HSIZE_T), INTENT(IN) :: size ! Buffer size in bytes; + ! buffer is allocated and freed by + ! the library. + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** -! INTEGER, EXTERNAL :: h5pget_fapl_core_c -! MS FORTRAN needs explicit interface for C functions called here. -! - 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 - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER(SIZE_T), INTENT(OUT) :: increment - INTEGER :: backing_store_flag - END FUNCTION h5pget_fapl_core_c - END INTERFACE + 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 + INTEGER(HID_T), INTENT(IN) :: plist_id + INTEGER(HSIZE_T), INTENT(IN) :: size + END FUNCTION h5pset_buffer_c + END INTERFACE - hdferr = h5pget_fapl_core_c(prp_id, increment, backing_store_flag) - backing_store =.FALSE. - IF (backing_store_flag .EQ. 1) backing_store =.TRUE. - END SUBROUTINE h5pget_fapl_core_f + hdferr = h5pset_buffer_c(plist_id, size) + END SUBROUTINE h5pset_buffer_f -!---------------------------------------------------------------------- -! Name: h5pset_fapl_family_f +!****s* H5P/h5pget_buffer_f +! NAME +! h5pget_buffer_f ! -! Purpose: Sets the file access property list to use the family driver. -! -! Inputs: -! prp_id - file access property list identifier -! memb_size - size in bytes of each file member -! memb_plist - identifier of the file access property -! list to be used for each family member -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! PURPOSE +! Gets size for conversion buffer ! -! Programmer: Elena Pourmal -! August 12, 1999 +! INPUTS +! +! plist_id - data transfer property list identifier +! OUTPUTS +! +! size - buffer size +! hdferr - error code +! Success: 0 +! Failure: -1 ! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 +! AUTHOR +! Elena Pourmal +! October 2, 2002 ! -! Comment: -!---------------------------------------------------------------------- +! Fortran90 Interface: + SUBROUTINE h5pget_buffer_f(plist_id, size, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist_id ! Data transfer property list identifier + INTEGER(HSIZE_T), INTENT(OUT) :: size ! Buffer size in bytes; + ! buffer is allocated and freed by + ! the library. + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** - SUBROUTINE h5pset_fapl_family_f(prp_id, memb_size, memb_plist , hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER(HSIZE_T), INTENT(IN) :: memb_size ! Logical size, in bytes, - !of each family member - INTEGER(HID_T), INTENT(IN) :: memb_plist !Identifier of the file - !access property list for - !each member of the family - INTEGER, INTENT(OUT) :: hdferr ! Error code + 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 + INTEGER(HID_T), INTENT(IN) :: plist_id + INTEGER(HSIZE_T), INTENT(OUT) :: size + END FUNCTION h5pget_buffer_c + END INTERFACE -! INTEGER, EXTERNAL :: h5pset_fapl_family_f -! MS FORTRAN needs explicit interface for C functions called here. -! - 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 - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER(HSIZE_T), INTENT(IN) :: memb_size - INTEGER(HID_T), INTENT(IN) :: memb_plist - END FUNCTION h5pset_fapl_family_c - END INTERFACE - - hdferr = h5pset_fapl_family_c(prp_id, memb_size, memb_plist) - END SUBROUTINE h5pset_fapl_family_f - -!---------------------------------------------------------------------- -! Name: h5pget_fapl_family_f -! -! Purpose: Returns file access property list information. -! -! Inputs: -! prp_id - file access property list identifier -! Outputs: -! memb_size - size in bytes of each file member -! memb_plist - identifier of the file access property -! list to be used for each family member -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! Comment: -!---------------------------------------------------------------------- - - - SUBROUTINE h5pget_fapl_family_f(prp_id, memb_size, memb_plist , hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER(HSIZE_T), INTENT(OUT) :: memb_size ! Logical size, in bytes, - !of each family member - INTEGER(HID_T), INTENT(OUT) :: memb_plist !Identifier of the file - !access property list for - !each member of the family - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5pget_fapl_family_f -! MS FORTRAN needs explicit interface for C functions called here. -! - 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 - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER(HSIZE_T), INTENT(OUT) :: memb_size - INTEGER(HID_T), INTENT(OUT) :: memb_plist - END FUNCTION h5pget_fapl_family_c - END INTERFACE - - hdferr = h5pget_fapl_family_c(prp_id, memb_size, memb_plist) - END SUBROUTINE h5pget_fapl_family_f - -!---------------------------------------------------------------------- -! Name: h5pset_cache_f -! -! Purpose: Sets the meta data cache and raw data chunk -! cache parameters -! -! Inputs: -! prp_id - file access property list identifier -! mdc_nelmts - number of elements (objects) in the meta -! data cache -! rdcc_nelmts - number of elements (objects) in the raw -! data chunk cache -! rdcc_nbytes - total size of the raw data chunk cache, in bytes -! rdcc_w0 - preemption policy (0 or 1) -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pset_cache_f(prp_id, mdc_nelmts,rdcc_nelmts, rdcc_nbytes, rdcc_w0, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER, INTENT(IN) :: mdc_nelmts !Number of elements (objects) - ! in the meta data cache - INTEGER(SIZE_T), INTENT(IN) :: rdcc_nelmts !Number of elements (objects) - ! in the meta data cache - INTEGER(SIZE_T), INTENT(IN) :: rdcc_nbytes !Total size of the raw data - !chunk cache, in bytes - REAL, INTENT(IN) :: rdcc_w0 !Preemption policy - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5pset_cache_c -! MS FORTRAN needs explicit interface for C functions called here. -! - 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 - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER, INTENT(IN) :: mdc_nelmts - INTEGER(SIZE_T), INTENT(IN) :: rdcc_nelmts - INTEGER(SIZE_T), INTENT(IN) :: rdcc_nbytes - REAL, INTENT(IN) :: rdcc_w0 - END FUNCTION h5pset_cache_c - END INTERFACE - - hdferr = h5pset_cache_c(prp_id, mdc_nelmts, rdcc_nelmts, rdcc_nbytes, rdcc_w0 ) - END SUBROUTINE h5pset_cache_f - -!---------------------------------------------------------------------- -! Name: h5pget_cache_f -! -! Purpose: Queries the meta data cache and raw data chunk cache -! parameters. -! -! Inputs: -! prp_id - file access property list identifier -! Outputs: -! mdc_nelmts - number of elements (objects) in the meta -! data cache -! rdcc_nelmts - number of elements (objects) in the raw -! data chunk cache -! rdcc_nbytes - total size of the raw data chunk cache, in bytes -! rdcc_w0 - preemption policy (0 or 1) -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! Bug fix: type of the rdcc_nelmts parameter should be INTEGER -! instead of INTEGER(SIZE_T) October 10, 2003 -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pget_cache_f(prp_id, mdc_nelmts, rdcc_nelmts, rdcc_nbytes, rdcc_w0, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER, INTENT(OUT) :: mdc_nelmts !Number of elements (objects) - ! in the meta data cache - INTEGER(SIZE_T), INTENT(OUT) :: rdcc_nelmts !Number of elements (objects) - ! in the meta data cache - INTEGER(SIZE_T), INTENT(OUT) :: rdcc_nbytes !Total size of the raw data - !chunk cache, in bytes - REAL, INTENT(OUT) :: rdcc_w0 !Preemption policy - INTEGER, INTENT(OUT) :: hdferr ! Error code - - -! INTEGER, EXTERNAL :: h5pget_cache_c -! MS FORTRAN needs explicit interface for C functions called here. -! - 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 - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER, INTENT(OUT) :: mdc_nelmts - INTEGER(SIZE_T), INTENT(OUT) :: rdcc_nelmts - INTEGER(SIZE_T), INTENT(OUT) :: rdcc_nbytes - REAL, INTENT(OUT) :: rdcc_w0 - END FUNCTION h5pget_cache_c - END INTERFACE - - hdferr = h5pget_cache_c(prp_id, mdc_nelmts,rdcc_nelmts, rdcc_nbytes, rdcc_w0 ) - END SUBROUTINE h5pget_cache_f - -!---------------------------------------------------------------------- -! Name: h5pset_fapl_split_f -! -! Purpose: Emulates the old split file driver. -! -! Inputs: -! prp_id - file access property list identifier -! meta_ext - name of the extension for the metafile -! filename -! meta_plist - identifier of the meta file access property -! list -! raw_ext - name extension for the raw file filename -! raw_plist - identifier of the raw file access property list -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pset_fapl_split_f(prp_id, meta_ext, meta_plist, raw_ext, raw_plist, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - CHARACTER(LEN=*), INTENT(IN) :: meta_ext !Name of the extension for - !the metafile filename - INTEGER(HID_T), INTENT(IN) :: meta_plist ! Identifier of the meta file - ! access property list - CHARACTER(LEN=*), INTENT(IN) :: raw_ext !Name extension for the raw file filename - INTEGER(HID_T), INTENT(IN) :: raw_plist !Identifier of the raw file - !access property list - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER :: meta_len, raw_len - -! INTEGER, EXTERNAL :: h5pset_fapl_split_c -! MS FORTRAN needs explicit interface for C functions called here. -! - 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$ATTRIBUTES reference :: meta_ext - !DEC$ATTRIBUTES reference :: raw_ext - INTEGER(HID_T), INTENT(IN) :: prp_id - CHARACTER(LEN=*), INTENT(IN) :: meta_ext - INTEGER(HID_T), INTENT(IN) :: meta_plist - CHARACTER(LEN=*), INTENT(IN) :: raw_ext - INTEGER(HID_T), INTENT(IN) :: raw_plist - INTEGER :: meta_len, raw_len - END FUNCTION h5pset_fapl_split_c - END INTERFACE - - meta_len = LEN(meta_ext) - raw_len = LEN(raw_ext) - hdferr = h5pset_fapl_split_c(prp_id,meta_len,meta_ext,meta_plist,raw_len,raw_ext,raw_plist) - END SUBROUTINE h5pset_fapl_split_f - -!---------------------------------------------------------------------- -! Name: h5pget_split_f -! -! Purpose: NOT AVAILABLE -! -! Inputs: -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! Comment: -!---------------------------------------------------------------------- - -! SUBROUTINE h5pget_split_f(prp_id, meta_ext_size, meta_ext, meta_plist,raw_ext_size,& -! raw_ext, raw_plist, hdferr) -! IMPLICIT NONE -! INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier -! INTEGER(SIZE_T), INTENT(IN) :: meta_ext_size ! Number of characters of the meta - ! file extension to be copied to the - ! meta_ext buffer - -! CHARACTER(LEN=*), INTENT(OUT) :: meta_ext !Name of the extension for - !the metafile filename -! INTEGER(HID_T), INTENT(OUT) :: meta_plist ! Identifier of the meta file - ! access property list -! INTEGER(SIZE_T), INTENT(IN) :: raw_ext_size ! Number of characters of the raw - ! file extension to be copied to the - ! raw_ext buffer -! CHARACTER(LEN=*), INTENT(OUT) :: raw_ext !Name extension for the raw file filename -! INTEGER(HID_T), INTENT(OUT) :: raw_plist !Identifier of the raw file - !access property list -! INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5pget_split_c -! hdferr = h5pget_split_c(prp_id, meta_ext_size, meta_ext, meta_plist, & -! raw_ext_size, raw_ext, raw_plist ) -! END SUBROUTINE h5pget_split_f - -!---------------------------------------------------------------------- -! Name: h5pset_gc_references_f -! -! Purpose: Sets garbage collecting references flag. -! -! Inputs: -! prp_id - file access property list identifier -! gc_reference - flag for stting garbage collection on -! and off (1 or 0) -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! Comment: -!---------------------------------------------------------------------- - - - SUBROUTINE h5pset_gc_references_f (prp_id, gc_reference, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER, INTENT(IN) :: gc_reference !the flag for garbage collecting - ! references for the file - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5pset_gc_references_c -! MS FORTRAN needs explicit interface for C functions called here. -! - 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 - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER, INTENT(IN) :: gc_reference - END FUNCTION h5pset_gc_references_c - END INTERFACE - - hdferr = h5pset_gc_references_c(prp_id, gc_reference) - END SUBROUTINE h5pset_gc_references_f - -!---------------------------------------------------------------------- -! Name: h5pget_gc_references_f -! -! Purpose: Returns garbage collecting references setting. -! -! Inputs: -! prp_id - file access property list identifier -! Outputs: -! gc_reference - flag for stting garbage collection on -! and off (1 or 0) -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pget_gc_references_f (prp_id, gc_reference, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER, INTENT(OUT) :: gc_reference !the flag for garbage collecting - ! references for the file - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5pget_gc_references_c -! MS FORTRAN needs explicit interface for C functions called here. -! - 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 - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER, INTENT(OUT) :: gc_reference - END FUNCTION h5pget_gc_references_c - END INTERFACE - - hdferr = h5pget_gc_references_c(prp_id, gc_reference) - END SUBROUTINE h5pget_gc_references_f - -!---------------------------------------------------------------------- -! Name: h5pset_layout_f -! -! Purpose: Sets the type of storage used store the raw data -! for a dataset. -! -! Inputs: -! prp_id - data creation property list identifier -! layout - type of storage layout for raw data -! possible values are: -! H5D_COMPACT_F -! H5D_CONTIGUOUS_F -! H5D_CHUNKED_F -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pset_layout_f (prp_id, layout, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER, INTENT(IN) :: layout !Type of storage layout for raw data - !possible values are: - !H5D_COMPACT_F - !H5D_CONTIGUOUS_F - !H5D_CHUNKED_F - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5pset_layout_c -! MS FORTRAN needs explicit interface for C functions called here. -! - 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 - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER, INTENT(IN) :: layout - END FUNCTION h5pset_layout_c - END INTERFACE - - hdferr = h5pset_layout_c(prp_id, layout) - END SUBROUTINE h5pset_layout_f - -!---------------------------------------------------------------------- -! Name: h5pget_layout_f -! -! Purpose: Returns the layout of the raw data for a dataset. -! -! Inputs: -! prp_id - data creation property list identifier -! Outputs: -! layout - type of storage layout for raw data -! possible values are: -! H5D_COMPACT_F -! H5D_CONTIGUOUS_F -! H5D_CHUNKED_F -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pget_layout_f (prp_id, layout, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER, INTENT(OUT) :: layout !Type of storage layout for raw data - !possible values are: - !H5D_COMPACT_F(0) - !H5D_CONTIGUOUS_F(1) - !H5D_CHUNKED_F(2) - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5pget_layout_c -! MS FORTRAN needs explicit interface for C functions called here. -! - 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 - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER, INTENT(OUT) :: layout - END FUNCTION h5pget_layout_c - END INTERFACE - - hdferr = h5pget_layout_c(prp_id, layout) - END SUBROUTINE h5pget_layout_f - -!---------------------------------------------------------------------- -! Name: h5pset_filter_f -! -! Purpose: Adds a filter to the filter pipeline. -! -! Inputs: -! prp_id - data creation or transfer property list -! identifier -! filter - filter to be added to the pipeline -! flags - bit vector specifying certain general -! properties of the filter -! cd_nelmts - number of elements in cd_values -! cd_values - auxiliary data for the filter -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! February, 2003 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pset_filter_f(prp_id, filter, flags, cd_nelmts, cd_values, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER, INTENT(IN) :: filter !Filter to be added to the pipeline. - INTEGER, INTENT(IN) :: flags !Bit vector specifying certain general - !properties of the filter. - INTEGER(SIZE_T), INTENT(IN) :: cd_nelmts !Number of elements in cd_values. - INTEGER, DIMENSION(*), INTENT(IN) :: cd_values !Auxiliary data for the filter. - - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5pset_filter_c -! MS FORTRAN needs explicit interface for C functions called here. -! - 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 - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER, INTENT(IN) :: filter - INTEGER, INTENT(IN) :: flags - INTEGER(SIZE_T), INTENT(IN) :: cd_nelmts - INTEGER, DIMENSION(*), INTENT(IN) :: cd_values - END FUNCTION h5pset_filter_c - END INTERFACE - - hdferr = h5pset_filter_c(prp_id, filter, flags, cd_nelmts, cd_values ) - END SUBROUTINE h5pset_filter_f - -!---------------------------------------------------------------------- -! Name: h5pget_nfilters_f -! -! Purpose: Returns the number of filters in the pipeline. -! -! Inputs: -! prp_id - data creation or transfer property list -! identifier -! Outputs: -! nfilters - number of filters in the pipeline -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pget_nfilters_f (prp_id, nfilters, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER, INTENT(OUT) :: nfilters !the number of filters in the pipeline - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5pget_nfilters_c -! MS FORTRAN needs explicit interface for C functions called here. -! - 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 - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER, INTENT(OUT) :: nfilters - END FUNCTION h5pget_nfilters_c - END INTERFACE - - hdferr = h5pget_nfilters_c(prp_id, nfilters) - END SUBROUTINE h5pget_nfilters_f - -!---------------------------------------------------------------------- -! Name: h5pget_filter_f -! -! Purpose: Returns information about a filter in a pipeline -! -! Inputs: -! prp_id - data creation or transfer property list -! identifier -! Outputs: -! identifier -! filter - filter to be added to the pipeline -! flags - bit vector specifying certain general -! properties of the filter -! cd_nelmts - number of elements in cd_values -! cd_values - auxiliary data for the filter -! namelen - number of characters in the name buffer -! name - buffer to retrieve filter name -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pget_filter_f(prp_id, filter_number, flags, cd_nelmts, cd_values, namelen, name, filter_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER, INTENT(IN) :: filter_number !Sequence number within the filter - !pipeline of the filter for which - !information is sought - INTEGER, DIMENSION(*), INTENT(OUT) :: cd_values !Auxiliary data for the filter. - INTEGER, INTENT(OUT) :: flags !Bit vector specifying certain general - !properties of the filter. - INTEGER(SIZE_T), INTENT(INOUT) :: cd_nelmts !Number of elements in cd_values. - INTEGER(SIZE_T), INTENT(IN) :: namelen !Anticipated number of characters in name. - CHARACTER(LEN=*), INTENT(OUT) :: name !Name of the filter - INTEGER, INTENT(OUT) :: filter_id ! filter identification number - - INTEGER, INTENT(OUT) :: hdferr ! Error code - - -! INTEGER, EXTERNAL :: h5pget_filter_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - 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$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER, INTENT(IN) :: filter_number - INTEGER, DIMENSION(*), INTENT(OUT) :: cd_values - INTEGER, INTENT(OUT) :: flags - INTEGER(SIZE_T), INTENT(INOUT) :: cd_nelmts - INTEGER(SIZE_T), INTENT(IN) :: namelen - CHARACTER(LEN=*), INTENT(OUT) :: name - INTEGER, INTENT(OUT) :: filter_id - END FUNCTION h5pget_filter_c - END INTERFACE - - hdferr = h5pget_filter_c(prp_id, filter_number, flags, cd_nelmts, & - cd_values, namelen, name, filter_id ) - END SUBROUTINE h5pget_filter_f - -!---------------------------------------------------------------------- -! Name: h5pset_external_f -! -! Purpose: Adds an external file to the list of external files. -! -! Inputs: -! prp_id - dataset creation property list identifier -! name - name of external file -! offset - offset in bytes from the beginning of the -! file to the location in the file -! where the data starts -! bytes - size of the external file data. -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pset_external_f(prp_id, name, offset,bytes, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - CHARACTER(LEN=*), INTENT(IN) :: name !Name of an external file - INTEGER, INTENT(IN) :: offset !Offset, in bytes, from the beginning - !of the file to the location in the file - !where the data starts. - INTEGER(HSIZE_T), INTENT(IN) :: bytes ! Number of bytes reserved in the - !file for the data - INTEGER, INTENT(OUT) :: hdferr ! Error code - - INTEGER :: namelen - -! INTEGER, EXTERNAL :: h5pset_external_c -! MS FORTRAN needs explicit interface for C functions called here. -! - 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$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: prp_id - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER :: namelen - INTEGER, INTENT(IN) :: offset - INTEGER(HSIZE_T), INTENT(IN) :: bytes - END FUNCTION h5pset_external_c - END INTERFACE - - namelen = LEN(name) - hdferr = h5pset_external_c(prp_id, name, namelen, offset, bytes) - END SUBROUTINE h5pset_external_f - -!---------------------------------------------------------------------- -! Name: h5pget_external_count_f -! -! Purpose: Returns the number of external files for a dataset. -! -! Inputs: -! prp_id - dataset creation property list identifier -! Outputs: -! count - number of external files for the -! specified dataset -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pget_external_count_f (prp_id, count, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER, INTENT(OUT) :: count !number of external files for the - !specified dataset - INTEGER, INTENT(OUT) :: hdferr ! Error code -! INTEGER, EXTERNAL :: h5pget_external_count_c -! MS FORTRAN needs explicit interface for C functions called here. -! - 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 - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER, INTENT(OUT) :: count - END FUNCTION h5pget_external_count_c - END INTERFACE - - hdferr = h5pget_external_count_c(prp_id, count) - END SUBROUTINE h5pget_external_count_f - -!---------------------------------------------------------------------- -! Name: h5pget_external_f -! -! Purpose: Returns information about an external file. -! -! Inputs: -! prp_id - dataset creation property list identifier -! Outputs: -! idx - external file index -! name_size - maximum size of name array -! name - name of the external file -! name - name of external file -! offset - offset in bytes from the beginning of the -! file to the location in the file -! where the data starts -! bytes - size of the external file data -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! Comment: -!---------------------------------------------------------------------- - - - SUBROUTINE h5pget_external_f(prp_id, idx, name_size, name, offset,bytes, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER, INTENT(IN) :: idx !External file index. - INTEGER(SIZE_T), INTENT(IN) :: name_size !Maximum length of name array - CHARACTER(LEN=*), INTENT(OUT) :: name !Name of an external file - INTEGER, INTENT(OUT) :: offset !Offset, in bytes, from the beginning - !of the file to the location in the file - !where the data starts. - INTEGER(HSIZE_T), INTENT(OUT) :: bytes ! Number of bytes reserved in the - !file for the data - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5pget_external_c -! MS FORTRAN needs explicit interface for C functions called here. -! - 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$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER, INTENT(IN) :: idx - INTEGER(SIZE_T), INTENT(IN) :: name_size - CHARACTER(LEN=*), INTENT(OUT) :: name - INTEGER, INTENT(OUT) :: offset - INTEGER(HSIZE_T), INTENT(OUT) :: bytes - END FUNCTION h5pget_external_c - END INTERFACE - - hdferr = h5pget_external_c(prp_id, idx, name_size, name, offset, bytes) - END SUBROUTINE h5pget_external_f - -!---------------------------------------------------------------------- -! Name: h5pset_btree_ratios_f -! -! Purpose: Sets B-tree split ratios for a dataset transfer -! property list. -! -! Inputs: -! prp_id - the dataset transfer property list -! identifier -! left - the B-tree split ratio for left-most nodes -! middle - the B-tree split ratio for all other nodes -! right - the B-tree split ratio for right-most nodes -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pset_btree_ratios_f(prp_id, left, middle, right, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - REAL, INTENT(IN) :: left !The B-tree split ratio for left-most nodes. - REAL, INTENT(IN) :: middle !The B-tree split ratio for all other nodes - REAL, INTENT(IN) :: right !The B-tree split ratio for right-most - !nodes and lone nodes. - - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5pset_btree_ratios_c -! MS FORTRAN needs explicit interface for C functions called here. -! - 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 - INTEGER(HID_T), INTENT(IN) :: prp_id - REAL, INTENT(IN) :: left - REAL, INTENT(IN) :: middle - REAL, INTENT(IN) :: right - END FUNCTION h5pset_btree_ratios_c - END INTERFACE - - hdferr = h5pset_btree_ratios_c(prp_id, left, middle, right) - END SUBROUTINE h5pset_btree_ratios_f - -!---------------------------------------------------------------------- -! Name: h5pget_btree_ratios_f -! -! Purpose: Gets B-tree split ratios for a dataset transfer property list -! -! Inputs: -! prp_id - the dataset transfer property list -! identifier -! Outputs: -! left - the B-tree split ratio for left-most nodes -! middle - the B-tree split ratio for all other nodes -! right - the B-tree split ratio for right-most nodes -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 14, 2001 -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pget_btree_ratios_f(prp_id, left, middle, right, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - REAL, INTENT(OUT) :: left !The B-tree split ratio for left-most nodes. - REAL, INTENT(OUT) :: middle !The B-tree split ratio for all other nodes - REAL, INTENT(OUT) :: right !The B-tree split ratio for right-most - !nodes and lone nodes. - - INTEGER, INTENT(OUT) :: hdferr ! Error code - - -! INTEGER, EXTERNAL :: h5pget_btree_ratios_c -! MS FORTRAN needs explicit interface for C functions called here. -! - 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 - INTEGER(HID_T), INTENT(IN) :: prp_id - REAL, INTENT(OUT) :: left - REAL, INTENT(OUT) :: middle - REAL, INTENT(OUT) :: right - END FUNCTION h5pget_btree_ratios_c - END INTERFACE - - hdferr = h5pget_btree_ratios_c(prp_id, left, middle, right) - END SUBROUTINE h5pget_btree_ratios_f - -!---------------------------------------------------------------------- -! Name: h5pget_fclose_degree_f -! -! Purpose: Returns the degree for the file close behavior. -! -! Inputs: -! fapl_id - file access property list identifier -! Outputs: -! degree - one of the following: -! Possible values are: -! H5F_CLOSE_DEFAULT_F -! H5F_CLOSE_WEAK_F -! H5F_CLOSE_SEMI_F -! H5F_CLOSE_STRONG_F -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! September 26, 2002 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pget_fclose_degree_f(fapl_id, degree, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: fapl_id ! File Access Property list identifier - INTEGER, INTENT(OUT) :: degree ! Possible values - ! are: - ! H5F_CLOSE_DEFAULT_F - ! H5F_CLOSE_WEAK_F - ! H5F_CLOSE_SEMI_F - ! H5F_CLOSE_STRONG_F - - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5pget_fclose_degree_c -! MS FORTRAN needs explicit interface for C functions called here. -! - 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 - INTEGER(HID_T), INTENT(IN) :: fapl_id - INTEGER, INTENT(OUT) :: degree - END FUNCTION h5pget_fclose_degree_c - END INTERFACE - - hdferr = h5pget_fclose_degree_c(fapl_id, degree) - END SUBROUTINE h5pget_fclose_degree_f - -!---------------------------------------------------------------------- -! Name: h5pset_fclose_degree_f -! -! Purpose: Sets the degree for the file close behavior. -! -! Inputs: -! fapl_id - file access property list identifier -! degree - one of the following: -! Possible values are: -! H5F_CLOSE_DEFAULT_F -! H5F_CLOSE_WEAK_F -! H5F_CLOSE_SEMI_F -! H5F_CLOSE_STRONG_F -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! September 26, 2002 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pset_fclose_degree_f(fapl_id, degree, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: fapl_id ! File Access Property list identifier - INTEGER, INTENT(IN) :: degree ! Possible values - ! are: - ! H5F_CLOSE_DEFAULT_F - ! H5F_CLOSE_WEAK_F - ! H5F_CLOSE_SEMI_F - ! H5F_CLOSE_STRONG_F - - INTEGER, INTENT(OUT) :: hdferr ! Error code - - 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 - INTEGER(HID_T), INTENT(IN) :: fapl_id - INTEGER, INTENT(IN) :: degree - END FUNCTION h5pset_fclose_degree_c - END INTERFACE - - hdferr = h5pset_fclose_degree_c(fapl_id, degree) - END SUBROUTINE h5pset_fclose_degree_f - -!---------------------------------------------------------------------- -! Name: h5pequal_f -! -! Purpose: Checks if two property lists are eqaul -! -! Inputs: -! plist1_id - property list identifier -! plist2_id - property list identifier -! Outputs: -! flag - flag, possible values -! .TRUE. or .FALSE. -! hdferr: - error code -! Success: 0 -! Failure: -1, flag is set to .FALSE. -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! September 30, 2002 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pequal_f(plist1_id, plist2_id, flag, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist1_id ! Property list identifier - INTEGER(HID_T), INTENT(IN) :: plist2_id ! Property list identifier - LOGICAL, INTENT(OUT) :: flag ! Flag - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER :: c_flag - - 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 - INTEGER(HID_T), INTENT(IN) :: plist1_id - INTEGER(HID_T), INTENT(IN) :: plist2_id - INTEGER, INTENT(OUT) :: c_flag - END FUNCTION h5pequal_c - END INTERFACE - - flag = .FALSE. - hdferr = h5pequal_c(plist1_id, plist2_id, c_flag) - if (c_flag .GT. 0) flag = .TRUE. - END SUBROUTINE h5pequal_f - -!---------------------------------------------------------------------- -! Name: h5pset_buffer_f -! -! Purpose: Sets sixe for conversion buffer -! -! Inputs: -! plist_id - data transfer property list identifier -! size - buffer size -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! October 2, 2002 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pset_buffer_f(plist_id, size, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist_id ! Data transfer property list identifier - INTEGER(HSIZE_T), INTENT(IN) :: size ! Buffer size in bytes; - ! buffer is allocated and freed by - ! the library. - INTEGER, INTENT(OUT) :: hdferr ! Error code - - 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 - INTEGER(HID_T), INTENT(IN) :: plist_id - INTEGER(HSIZE_T), INTENT(IN) :: size - END FUNCTION h5pset_buffer_c - END INTERFACE - - hdferr = h5pset_buffer_c(plist_id, size) - END SUBROUTINE h5pset_buffer_f - -!---------------------------------------------------------------------- -! Name: h5pget_buffer_f -! -! Purpose: Gets size for conversion buffer -! -! Inputs: -! plist_id - data transfer property list identifier -! Outputs: -! size - buffer size -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! October 2, 2002 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pget_buffer_f(plist_id, size, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist_id ! Data transfer property list identifier - INTEGER(HSIZE_T), INTENT(OUT) :: size ! Buffer size in bytes; - ! buffer is allocated and freed by - ! the library. - INTEGER, INTENT(OUT) :: hdferr ! Error code - - 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 - INTEGER(HID_T), INTENT(IN) :: plist_id - INTEGER(HSIZE_T), INTENT(OUT) :: size - END FUNCTION h5pget_buffer_c - END INTERFACE - - hdferr = h5pget_buffer_c(plist_id, size) - END SUBROUTINE h5pget_buffer_f - -!---------------------------------------------------------------------- -! Name: h5pfill_value_defined_f -! -! Purpose: Check if fill value is defined. -! -! Inputs: -! plist_id - dataset creation property list identifier -! Outputs: -! flag - fill value status flag -! Possible values are: -! H5D_FILL_VALUE_ERROR_F -! H5D_FILL_VALUE_UNDEFINED_F -! H5D_FILL_VALUE_DEFAULT_F -! H5D_FILL_VALUE_USER_DEFINED_F -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! October 4, 2002 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pfill_value_defined_f(plist_id, flag, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist_id - INTEGER, INTENT(OUT) :: flag - INTEGER, INTENT(OUT) :: hdferr - - 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 - INTEGER(HID_T), INTENT(IN) :: plist_id - INTEGER, INTENT(OUT) :: flag - END FUNCTION h5pfill_value_defined_c - END INTERFACE - - hdferr = h5pfill_value_defined_c(plist_id, flag) - END SUBROUTINE h5pfill_value_defined_f - -!---------------------------------------------------------------------- -! Name: h5pset_alloc_time_f -! -! Purpose: Set space allocation time for dataset during creation. -! -! Inputs: -! plist_id - dataset creation property list identifier -! flag - allocation time flag -! Possible values are: -! H5D_ALLOC_TIME_ERROR_F -! H5D_ALLOC_TIME_DEFAULT_F -! H5D_ALLOC_TIME_EARLY_F -! H5D_ALLOC_TIME_LATE_F -! H5D_ALLOC_TIME_INCR_F -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! October 4, 2002 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pset_alloc_time_f(plist_id, flag, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist_id - INTEGER, INTENT(IN) :: flag - INTEGER, INTENT(OUT) :: hdferr - - 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 - INTEGER(HID_T), INTENT(IN) :: plist_id - INTEGER, INTENT(IN) :: flag - END FUNCTION h5pset_alloc_time_c - END INTERFACE - - hdferr = h5pset_alloc_time_c(plist_id, flag) - END SUBROUTINE h5pset_alloc_time_f - -!---------------------------------------------------------------------- -! Name: h5pget_alloc_time_f -! -! Purpose: Get space allocation time for dataset during creation. -! -! Inputs: -! plist_id - dataset creation property list identifier -! Outputs: -! flag - allocation time flag -! Possible values are: -! H5D_ALLOC_TIME_ERROR_F -! H5D_ALLOC_TIME_DEFAULT_F -! H5D_ALLOC_TIME_EARLY_F -! H5D_ALLOC_TIME_LATE_F -! H5D_ALLOC_TIME_INCR_F -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! October 4, 2002 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pget_alloc_time_f(plist_id, flag, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist_id - INTEGER, INTENT(OUT) :: flag - INTEGER, INTENT(OUT) :: hdferr - - 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 - INTEGER(HID_T), INTENT(IN) :: plist_id - INTEGER, INTENT(OUT) :: flag - END FUNCTION h5pget_alloc_time_c - END INTERFACE - - hdferr = h5pget_alloc_time_c(plist_id, flag) - END SUBROUTINE h5pget_alloc_time_f - -!---------------------------------------------------------------------- -! Name: h5pset_fill_time_f -! -! Purpose: Set fill value writing time for dataset -! -! Inputs: -! plist_id - dataset creation property list identifier -! flag - fill time flag -! Possible values are: -! H5D_FILL_TIME_ERROR_F -! H5D_FILL_TIME_ALLOC_F -! H5D_FILL_TIME_NEVER_F -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! October 4, 2002 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pset_fill_time_f(plist_id, flag, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist_id - INTEGER, INTENT(IN) :: flag - INTEGER, INTENT(OUT) :: hdferr - - 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 - INTEGER(HID_T), INTENT(IN) :: plist_id - INTEGER, INTENT(IN) :: flag - END FUNCTION h5pset_fill_time_c - END INTERFACE - - hdferr = h5pset_fill_time_c(plist_id, flag) - END SUBROUTINE h5pset_fill_time_f - -!---------------------------------------------------------------------- -! Name: h5pget_fill_time_f -! -! Purpose: Get fill value writing time for dataset -! -! Inputs: -! plist_id - dataset creation property list identifier -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! flag - fill time flag -! Possible values are: -! H5D_FILL_TIME_ERROR_F -! H5D_FILL_TIME_ALLOC_F -! H5D_FILL_TIME_NEVER_F -! NONE -! -! Programmer: Elena Pourmal -! October 4, 2002 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pget_fill_time_f(plist_id, flag, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist_id - INTEGER, INTENT(OUT) :: flag - INTEGER, INTENT(OUT) :: hdferr - - 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 - INTEGER(HID_T), INTENT(IN) :: plist_id - INTEGER, INTENT(OUT) :: flag - END FUNCTION h5pget_fill_time_c - END INTERFACE - - hdferr = h5pget_fill_time_c(plist_id, flag) - END SUBROUTINE h5pget_fill_time_f - -!---------------------------------------------------------------------- -! Name: h5pset_meta_block_size_f -! -! Purpose: Sets the minimum size of metadata block allocations -! -! Inputs: -! plist_id - file access property list identifier -! size - metatdata block size -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! October 7, 2002 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pset_meta_block_size_f(plist_id, size, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist_id ! File access property list identifier - INTEGER(HSIZE_T), INTENT(IN) :: size ! Block size in bytes; - INTEGER, INTENT(OUT) :: hdferr ! Error code - - 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 - INTEGER(HID_T), INTENT(IN) :: plist_id - INTEGER(HSIZE_T), INTENT(IN) :: size - END FUNCTION h5pset_meta_block_size_c - END INTERFACE - - hdferr = h5pset_meta_block_size_c(plist_id, size) - END SUBROUTINE h5pset_meta_block_size_f - -!---------------------------------------------------------------------- -! Name: h5pget_meta_block_size_f -! -! Purpose: Gets the minimum size of metadata block allocations -! -! Inputs: -! plist_id - file access property list identifier -! Outputs: -! size - metatdata block size -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! October 7, 2002 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pget_meta_block_size_f(plist_id, size, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist_id ! File access property list identifier - INTEGER(HSIZE_T), INTENT(OUT) :: size ! Block size in bytes; - INTEGER, INTENT(OUT) :: hdferr ! Error code - - 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 - INTEGER(HID_T), INTENT(IN) :: plist_id - INTEGER(HSIZE_T), INTENT(OUT) :: size - END FUNCTION h5pget_meta_block_size_c - END INTERFACE - - hdferr = h5pget_meta_block_size_c(plist_id, size) - END SUBROUTINE h5pget_meta_block_size_f - -!---------------------------------------------------------------------- -! Name: h5pset_sieve_buf_size_f -! -! Purpose: Sets the maximum size of the data sieve buffer -! -! Inputs: -! plist_id - file access property list identifier -! size - sieve buffer size -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! October 7, 2002 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pset_sieve_buf_size_f(plist_id, size, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist_id ! File access property list identifier - INTEGER(SIZE_T), INTENT(IN) :: size ! Buffer size in bytes; - INTEGER, INTENT(OUT) :: hdferr ! Error code - - 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 - INTEGER(HID_T), INTENT(IN) :: plist_id - INTEGER(SIZE_T), INTENT(IN) :: size - END FUNCTION h5pset_sieve_buf_size_c - END INTERFACE - - hdferr = h5pset_sieve_buf_size_c(plist_id, size) - END SUBROUTINE h5pset_sieve_buf_size_f - -!---------------------------------------------------------------------- -! Name: h5pget_sieve_buf_size_f -! -! Purpose: Gets the maximum size of the data sieve buffer -! -! Inputs: -! plist_id - file access property list identifier -! Outputs: -! size - sieve buffer size -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! October 7, 2002 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pget_sieve_buf_size_f(plist_id, size, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist_id ! File access property list identifier - INTEGER(SIZE_T), INTENT(OUT) :: size ! Buffer size in bytes - INTEGER, INTENT(OUT) :: hdferr ! Error code - - 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 - INTEGER(HID_T), INTENT(IN) :: plist_id - INTEGER(SIZE_T), INTENT(OUT) :: size - END FUNCTION h5pget_sieve_buf_size_c - END INTERFACE - - hdferr = h5pget_sieve_buf_size_c(plist_id, size) - END SUBROUTINE h5pget_sieve_buf_size_f - -!---------------------------------------------------------------------- -! Name: h5pset_small_data_block_size_f -! -! Purpose: Sets the minimum size of "small" raw data block -! -! Inputs: -! plist_id - file access property list identifier -! size - small raw data block size -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! October 7, 2002 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pset_small_data_block_size_f(plist_id, size, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist_id ! File access property list identifier - INTEGER(HSIZE_T), INTENT(IN) :: size ! Small raw data block size - INTEGER, INTENT(OUT) :: hdferr ! Error code - - 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 - INTEGER(HID_T), INTENT(IN) :: plist_id - INTEGER(HSIZE_T), INTENT(IN) :: size - END FUNCTION h5pset_small_data_block_size_c - END INTERFACE - - hdferr = h5pset_small_data_block_size_c(plist_id, size) - END SUBROUTINE h5pset_small_data_block_size_f - -!---------------------------------------------------------------------- -! Name: h5pget_small_data_block_size_f -! -! Purpose: Gets the minimum size of "small" raw data block -! -! Inputs: -! plist_id - file access property list identifier -! Outputs: -! size - small raw data block size -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! October 7, 2002 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pget_small_data_block_size_f(plist_id, size, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist_id ! File access property list identifier - INTEGER(HSIZE_T), INTENT(OUT) :: size ! Small raw data block size - INTEGER, INTENT(OUT) :: hdferr ! Error code - - 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 - INTEGER(HID_T), INTENT(IN) :: plist_id - INTEGER(HSIZE_T), INTENT(OUT) :: size - END FUNCTION h5pget_small_data_block_size_c - END INTERFACE - - hdferr = h5pget_small_data_block_size_c(plist_id, size) - END SUBROUTINE h5pget_small_data_block_size_f - -!---------------------------------------------------------------------- -! Name: h5pset_hyper_vector_size_f -! -! Purpose: Set the number of "I/O" vectors (vector size) -! -! Inputs: -! plist_id - dataset transfer property list identifier -! size - vector size -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! October 7, 2002 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pset_hyper_vector_size_f(plist_id, size, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist_id ! Dataset transfer property list identifier - INTEGER(SIZE_T), INTENT(IN) :: size ! Vector size - INTEGER, INTENT(OUT) :: hdferr ! Error code - - 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 - INTEGER(HID_T), INTENT(IN) :: plist_id - INTEGER(SIZE_T), INTENT(IN) :: size - END FUNCTION h5pset_hyper_vector_size_c - END INTERFACE - - hdferr = h5pset_hyper_vector_size_c(plist_id, size) - END SUBROUTINE h5pset_hyper_vector_size_f - -!---------------------------------------------------------------------- -! Name: h5pget_hyper_vector_size_f -! -! Purpose: Get the number of "I/O" vectors (vector size) -! -! Inputs: -! plist_id - dataset transfer property list identifier -! Outputs: -! size - vector size -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! October 7, 2002 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pget_hyper_vector_size_f(plist_id, size, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist_id ! Dataset transfer property list identifier - INTEGER(SIZE_T), INTENT(OUT) :: size ! Vector size - INTEGER, INTENT(OUT) :: hdferr ! Error code - - 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 - INTEGER(HID_T), INTENT(IN) :: plist_id - INTEGER(SIZE_T), INTENT(OUT) :: size - END FUNCTION h5pget_hyper_vector_size_c - END INTERFACE - - hdferr = h5pget_hyper_vector_size_c(plist_id, size) - END SUBROUTINE h5pget_hyper_vector_size_f - -!---------------------------------------------------------------------- -! Name: h5pset_integer -! -! Purpose: Sets a property list value -! -! Inputs: -! prp_id - iproperty list identifier to modify -! name - name of property to modify -! value - value to set property to -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! October 9, 2002 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pset_integer(prp_id, name, value, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to modify - INTEGER, INTENT(IN) :: value ! Property value - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER :: name_len - - 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$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: prp_id - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER, INTENT(IN) :: name_len - INTEGER, INTENT(IN) :: value - END FUNCTION h5pset_integer_c - END INTERFACE - - name_len = LEN(name) - hdferr = h5pset_integer_c(prp_id, name , name_len, value) - END SUBROUTINE h5pset_integer - -!---------------------------------------------------------------------- -! Name: h5pset_real -! -! Purpose: Sets a property list value -! -! Inputs: -! prp_id - iproperty list identifier to modify -! name - name of property to modify -! value - value to set property to -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! October 9, 2002 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pset_real(prp_id, name, value, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to modify - REAL, INTENT(IN) :: value ! Property value - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER :: name_len - - 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$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: prp_id - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER, INTENT(IN) :: name_len - REAL, INTENT(IN) :: value - END FUNCTION h5pset_real_c - END INTERFACE - - name_len = LEN(name) - hdferr = h5pset_real_c(prp_id, name , name_len, value) - END SUBROUTINE h5pset_real - - -!---------------------------------------------------------------------- -! Name: h5pset_char -! -! Purpose: Sets a property list value -! -! Inputs: -! prp_id - iproperty list identifier to modify -! name - name of property to modify -! value - value to set property to -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! October 9, 2002 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pset_char(prp_id, name, value, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to modify - CHARACTER(LEN=*), INTENT(IN) :: value ! Property value - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER :: name_len - INTEGER :: value_len - - 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$ATTRIBUTES reference :: name - !DEC$ATTRIBUTES reference :: value - INTEGER(HID_T), INTENT(IN) :: prp_id - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER, INTENT(IN) :: name_len - CHARACTER(LEN=*), INTENT(IN) :: value - INTEGER, INTENT(IN) :: value_len - END FUNCTION h5psetc_c - END INTERFACE - - name_len = LEN(name) - value_len = LEN(value) - hdferr = h5psetc_c(prp_id, name , name_len, value, value_len) - END SUBROUTINE h5pset_char - -!---------------------------------------------------------------------- -! Name: h5pget_integer -! -! Purpose: Gets a property list value -! -! Inputs: -! prp_id - iproperty list identifier to modify -! name - name of property to modify -! Outputs: -! value - value of property -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! October 9, 2002 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pget_integer(prp_id, name, value, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to modify - INTEGER, INTENT(OUT) :: value ! Property value - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER :: name_len - - 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$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: prp_id - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER, INTENT(IN) :: name_len - INTEGER, INTENT(OUT) :: value - END FUNCTION h5pget_integer_c - END INTERFACE - - name_len = LEN(name) - hdferr = h5pget_integer_c(prp_id, name , name_len, value) - END SUBROUTINE h5pget_integer - -!---------------------------------------------------------------------- -! Name: h5pget_real -! -! Purpose: Gets a property list value -! -! Inputs: -! prp_id - iproperty list identifier to modify -! name - name of property to modify -! Outputs: -! value - value of property -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! October 9, 2002 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pget_real(prp_id, name, value, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to modify - REAL, INTENT(OUT) :: value ! Property value - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER :: name_len - - 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$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: prp_id - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER, INTENT(IN) :: name_len - REAL, INTENT(OUT) :: value - END FUNCTION h5pget_real_c - END INTERFACE - - name_len = LEN(name) - hdferr = h5pget_real_c(prp_id, name , name_len, value) - END SUBROUTINE h5pget_real - - -!---------------------------------------------------------------------- -! Name: h5pget_char -! -! Purpose: Gets a property list value -! -! Inputs: -! prp_id - iproperty list identifier to modify -! name - name of property to modify -! Outputs: -! value - value of property -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! October 9, 2002 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pget_char(prp_id, name, value, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to modify - CHARACTER(LEN=*), INTENT(OUT) :: value ! Property value - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER :: name_len - INTEGER :: value_len - - 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$ATTRIBUTES reference :: name - !DEC$ATTRIBUTES reference :: value - INTEGER(HID_T), INTENT(IN) :: prp_id - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER, INTENT(IN) :: name_len - CHARACTER(LEN=*), INTENT(OUT) :: value - INTEGER, INTENT(IN) :: value_len - END FUNCTION h5pgetc_c - END INTERFACE - - name_len = LEN(name) - value_len = LEN(value) - hdferr = h5pgetc_c(prp_id, name , name_len, value, value_len) - END SUBROUTINE h5pget_char - -!---------------------------------------------------------------------- -! Name: h5pexist_f -! -! Purpose: Queries whether a property name exists in a property list or class. -! -! Inputs: -! prp_id - iproperty list identifier to query -! name - name of property to check for -! Outputs: -! flag - logical flag -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! October 9, 2002 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pexist_f(prp_id, name, flag, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to modify - LOGICAL, INTENT(OUT) :: flag ! .TRUE. if exists, .FALSE. - ! otherwise - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER :: name_len - - 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$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: prp_id - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER, INTENT(IN) :: name_len - END FUNCTION h5pexist_c - END INTERFACE - flag = .FALSE. - name_len = LEN(name) - hdferr = h5pexist_c(prp_id, name , name_len) - if (hdferr > 0) then - flag = .TRUE. - hdferr = 0 - endif - END SUBROUTINE h5pexist_f - -!---------------------------------------------------------------------- -! Name: h5pget_size_f -! -! Purpose: Queries the size of a property value in bytes. -! -! Inputs: -! prp_id - property list identifier to query -! name - name of property to query -! Outputs: -! size - size of property in bytes -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! October 9, 2002 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pget_size_f(prp_id, name, size, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to query - INTEGER(SIZE_T), INTENT(OUT) :: size ! Size in bytes - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER :: name_len - - 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$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: prp_id - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER, INTENT(IN) :: name_len - INTEGER(SIZE_T), INTENT(OUT) :: size - END FUNCTION h5pget_size_c - END INTERFACE - name_len = LEN(name) - hdferr = h5pget_size_c(prp_id, name , name_len, size) - END SUBROUTINE h5pget_size_f - -!---------------------------------------------------------------------- -! Name: h5pget_npros_f -! -! Purpose: Queries number of properties in property list or class -! -! Inputs: -! prp_id - iproperty list identifier to query -! Outputs: -! nprops - number of properties in property object -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! October 9, 2002 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pget_nprops_f(prp_id, nprops, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER(SIZE_T), INTENT(OUT) :: nprops ! iNumber of properties - INTEGER, INTENT(OUT) :: hdferr ! Error code - - 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 - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER(SIZE_T), INTENT(OUT) :: nprops - END FUNCTION h5pget_nprops_c - END INTERFACE - hdferr = h5pget_nprops_c(prp_id, nprops) - END SUBROUTINE h5pget_nprops_f - -!---------------------------------------------------------------------- -! Name: h5pget_class_name_f -! -! Purpose: Queries the name of a class. -! -! Inputs: -! prp_id - property list identifier to query -! Outputs: -! name - name of a class -! size - Actual length of the class name -! If provided buffer "name" is smaller, -! than name will be truncated to fit into -! provided user buffer -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! October 9, 2002 -! -! Modifications: Returned the size of name as an argument -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pget_class_name_f(prp_id, name, size, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - CHARACTER(LEN=*), INTENT(OUT) :: name ! Buffer to retireve class name - - INTEGER, INTENT(OUT) :: size ! Actual length of the class name - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER :: name_len - - 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$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: prp_id - CHARACTER(LEN=*), INTENT(INOUT) :: name - INTEGER, INTENT(IN) :: name_len - END FUNCTION h5pget_class_name_c - END INTERFACE - - name_len = LEN(name) - size = h5pget_class_name_c(prp_id, name, name_len) - - hdferr = 0 - IF(size.LT.0) hdferr = -1 - - END SUBROUTINE h5pget_class_name_f - -!---------------------------------------------------------------------- -! Name: h5pget_class_parent_f -! -! Purpose: Retrieves the parent class of a genric property class. -! -! Inputs: -! prp_id - property list identifier to query -! Outputs: -! parent_id - identifier of the parent class -! hdferr: - error code -! -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! October 9, 2002 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pget_class_parent_f(prp_id, parent_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER(HID_T), INTENT(OUT) :: parent_id ! Parent class property list - ! identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code - - 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 - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER(HID_T), INTENT(OUT) :: parent_id - END FUNCTION h5pget_class_parent_c - END INTERFACE - hdferr = h5pget_class_parent_c(prp_id, parent_id) - END SUBROUTINE h5pget_class_parent_f - -!---------------------------------------------------------------------- -! Name: h5pisa_class_f -! -! Purpose: Determines whether a property list is a member of a class. -! -! Inputs: -! plist - property list identifier -! pclass - identifier of the property class -! Outputs: -! flag - .TRUE. if a member, .FALSE. otherwise -! hdferr: - error code -! -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! October 9, 2002 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pisa_class_f(plist, pclass, flag, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist ! Property list identifier - INTEGER(HID_T), INTENT(IN) :: pclass ! Class identifier - LOGICAL, INTENT(OUT) :: flag ! logical flag - INTEGER, INTENT(OUT) :: hdferr ! Error code - - 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 - INTEGER(HID_T), INTENT(IN) :: plist - INTEGER(HID_T), INTENT(IN) :: pclass - END FUNCTION h5pisa_class_c - END INTERFACE - flag = .FALSE. - hdferr = h5pisa_class_c(plist, pclass) - if (hdferr .gt. 0) then - flag = .TRUE. - hdferr = 0 - endif - END SUBROUTINE h5pisa_class_f - -!---------------------------------------------------------------------- -! Name: h5pcopy_prop_f -! -! Purpose: Copies a property from one list or class to another. -! -! Inputs: -! dst_id - Identifier of the destination property list -! src_id - Identifier of the source property list -! name - name of the property to copy -! Outputs: -! hdferr: - error code -! -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! October 9, 2002 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pcopy_prop_f(dst_id, src_id, name, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dst_id ! Destination property list - ! identifier - INTEGER(HID_T), INTENT(IN) :: src_id ! Source property list identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Property name - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER :: name_len - - 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$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: dst_id - INTEGER(HID_T), INTENT(IN) :: src_id - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER, INTENT(IN) :: name_len - END FUNCTION h5pcopy_prop_c - END INTERFACE - name_len = LEN(name) - hdferr = h5pcopy_prop_c(dst_id, src_id, name , name_len) - END SUBROUTINE h5pcopy_prop_f - -!---------------------------------------------------------------------- -! Name: h5premove_f -! -! Purpose: Removes a property from a property list. - -! -! Inputs: -! plid - Property list identofoer -! name - name of the property to remove -! Outputs: -! hdferr: - error code -! -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! October 9, 2002 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5premove_f(plid, name, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plid ! property list identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! name of property to remove - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER :: name_len - - 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$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: plid - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER, INTENT(IN) :: name_len - END FUNCTION h5premove_c - END INTERFACE - name_len = LEN(name) - hdferr = h5premove_c(plid, name , name_len) - END SUBROUTINE h5premove_f - -!---------------------------------------------------------------------- -! Name: h5punregister_f -! -! Purpose: Removes a property from a property list class. - -! -! Inputs: -! class - Property list class identifier -! name - name of the property to remove -! Outputs: -! hdferr: - error code -! -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! October 9, 2002 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5punregister_f(class, name, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: class ! property list class identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! name of property to remove - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER :: name_len - - 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$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: class - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER, INTENT(IN) :: name_len - END FUNCTION h5punregister_c - END INTERFACE - name_len = LEN(name) - hdferr = h5punregister_c(class, name , name_len) - END SUBROUTINE h5punregister_f - -!---------------------------------------------------------------------- -! Name: h5pclose_class_f -! -! Purpose: Closes an existing property list class. - -! -! Inputs: -! class - Property list class identifier -! Outputs: -! hdferr: - error code -! -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! October 9, 2002 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pclose_class_f(class, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: class ! property list class identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code - - 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 - INTEGER(HID_T), INTENT(IN) :: class - END FUNCTION h5pclose_class_c - END INTERFACE - hdferr = h5pclose_class_c(class) - END SUBROUTINE h5pclose_class_f + hdferr = h5pget_buffer_c(plist_id, size) + END SUBROUTINE h5pget_buffer_f + +!****s* H5P/h5pfill_value_defined_f +! NAME +! h5pfill_value_defined_f +! +! PURPOSE +! Check if fill value is defined. +! +! INPUTS +! +! plist_id - dataset creation property list identifier +! OUTPUTS +! +! flag - fill value status flag +! Possible values are: +! H5D_FILL_VALUE_ERROR_F +! H5D_FILL_VALUE_UNDEFINED_F +! H5D_FILL_VALUE_DEFAULT_F +! H5D_FILL_VALUE_USER_DEFINED_F +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! October 4, 2002 +! +! Fortran90 Interface: + SUBROUTINE h5pfill_value_defined_f(plist_id, flag, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist_id ! Dataset creation property list identifier + INTEGER, INTENT(OUT) :: flag ! Fill value status flag + ! H5D_FILL_VALUE_ERROR_F + ! H5D_FILL_VALUE_UNDEFINED_F + ! H5D_FILL_VALUE_DEFAULT_F + ! H5D_FILL_VALUE_USER_DEFINED_F + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + 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 + INTEGER(HID_T), INTENT(IN) :: plist_id + INTEGER, INTENT(OUT) :: flag + END FUNCTION h5pfill_value_defined_c + END INTERFACE -!---------------------------------------------------------------------- -! Name: h5pcreate_class_f -! -! Purpose: Create a new property list class + hdferr = h5pfill_value_defined_c(plist_id, flag) + END SUBROUTINE h5pfill_value_defined_f + +!****s* H5P/h5pset_alloc_time_f +! NAME +! h5pset_alloc_time_f +! +! PURPOSE +! Set space allocation time for dataset during creation. +! +! INPUTS +! +! plist_id - dataset creation property list identifier +! flag - allocation time flag: +! H5D_ALLOC_TIME_ERROR_F +! H5D_ALLOC_TIME_DEFAULT_F +! H5D_ALLOC_TIME_EARLY_F +! H5D_ALLOC_TIME_LATE_F +! H5D_ALLOC_TIME_INCR_F +! OUTPUTS +! +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! October 4, 2002 +! +! Fortran90 Interface: + SUBROUTINE h5pset_alloc_time_f(plist_id, flag, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist_id ! Dataset creation property list identifier + INTEGER, INTENT(IN) :: flag ! Allocation time flag: + ! H5D_ALLOC_TIME_ERROR_F + ! H5D_ALLOC_TIME_DEFAULT_F + ! H5D_ALLOC_TIME_EARLY_F + ! H5D_ALLOC_TIME_LATE_F + ! H5D_ALLOC_TIME_INCR_F + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + + 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 + INTEGER(HID_T), INTENT(IN) :: plist_id + INTEGER, INTENT(IN) :: flag + END FUNCTION h5pset_alloc_time_c + END INTERFACE + + hdferr = h5pset_alloc_time_c(plist_id, flag) + END SUBROUTINE h5pset_alloc_time_f + +!****s* H5P/h5pget_alloc_time_f +! NAME +! h5pget_alloc_time_f +! +! PURPOSE +! Get space allocation time for dataset during creation. +! +! INPUTS +! +! plist_id - dataset creation property list identifier +! OUTPUTS +! +! flag - allocation time flag: +! H5D_ALLOC_TIME_ERROR_F +! H5D_ALLOC_TIME_DEFAULT_F +! H5D_ALLOC_TIME_EARLY_F +! H5D_ALLOC_TIME_LATE_F +! H5D_ALLOC_TIME_INCR_F +! hdferr: - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! October 4, 2002 +! +! Fortran90 Interface: + SUBROUTINE h5pget_alloc_time_f(plist_id, flag, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist_id ! Dataset creation property list identifier + INTEGER, INTENT(OUT) :: flag ! Allocation time flag: + ! H5D_ALLOC_TIME_ERROR_F + ! H5D_ALLOC_TIME_DEFAULT_F + ! H5D_ALLOC_TIME_EARLY_F + ! H5D_ALLOC_TIME_LATE_F + ! H5D_ALLOC_TIME_INCR_F + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** -! -! Inputs: -! parent - Property list identifier of the parent class -! Possible values include: -! H5P_ROOT_F -! H5P_FILE_CREATE_F -! H5P_FILE_ACCESS_F -! H5P_DATASET_CREATE_F -! H5P_DATASET_XFER_F -! H5P_FILE_MOUNT_F -! name - name of the class we are creating -! Outputs: -! class - porperty list class identifier -! hdferr: - error code -! -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! October 9, 2002 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pcreate_class_f(parent, name, class, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: parent ! parent property list class - ! identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! name of property tocreate - INTEGER(HID_T), INTENT(OUT) :: class ! property list class identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER :: name_len - - INTERFACE - 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$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: parent - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER, INTENT(IN) :: name_len - INTEGER(HID_T), INTENT(OUT) :: class - END FUNCTION h5pcreate_class_c - END INTERFACE - name_len = LEN(name) - hdferr = h5pcreate_class_c(parent, name , name_len, & - class) - END SUBROUTINE h5pcreate_class_f - -!---------------------------------------------------------------------- -! Name: h5pregister_integer -! -! Purpose: Registers a permanent property with a property list class. -! -! Inputs: -! class - property list class to register -! permanent property within -! name - name of property to register -! size - size of property in bytes -! value - default value for property in newly -! created property lists -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! October 10, 2002 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pregister_integer(class, name, size, value, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: class ! Property list class identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to register - INTEGER(SIZE_T), INTENT(IN) :: size ! Size of the property value - INTEGER, INTENT(IN) :: value ! Property value - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER :: name_len - - 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$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: class - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER, INTENT(IN) :: name_len - INTEGER(SIZE_T), INTENT(IN) :: size - INTEGER, INTENT(IN) :: value - END FUNCTION h5pregister_integer_c - END INTERFACE - - name_len = LEN(name) - hdferr = h5pregister_integer_c(class, name , name_len, size, value) - END SUBROUTINE h5pregister_integer - -!---------------------------------------------------------------------- -! Name: h5pregister_real -! -! Purpose: Registers a permanent property with a property list class. -! -! Inputs: -! class - property list class to register -! permanent property within -! name - name of property to register -! size - size of property in bytes -! value - default value for property in newly -! created property lists -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! October 10, 2002 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pregister_real(class, name, size, value, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: class ! Property list class identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to register - INTEGER(SIZE_T), INTENT(IN) :: size ! size of the property value - REAL, INTENT(IN) :: value ! Property value - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER :: name_len - - 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$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: class - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER, INTENT(IN) :: name_len - INTEGER(SIZE_T), INTENT(IN) :: size - REAL, INTENT(IN) :: value - END FUNCTION h5pregister_real_c - END INTERFACE - - name_len = LEN(name) - hdferr = h5pregister_real_c(class, name , name_len, size, value) - END SUBROUTINE h5pregister_real - -!---------------------------------------------------------------------- -! Name: h5pregister_char -! -! Purpose: Registers a permanent property with a property list class. -! -! Inputs: -! class - property list class to register -! permanent property within -! name - name of property to register -! size - size of property in bytes -! value - default value for property in newly -! created property lists -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! October 10, 2002 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pregister_char(class, name, size, value, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: class ! Property list class identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to register - INTEGER(SIZE_T), INTENT(IN) :: size ! size of the property value - CHARACTER(LEN=*), INTENT(IN) :: value ! Property value - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER :: name_len - INTEGER :: value_len - - INTERFACE - 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$ATTRIBUTES reference :: name - !DEC$ATTRIBUTES reference :: value - INTEGER(HID_T), INTENT(IN) :: class - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER, INTENT(IN) :: name_len - INTEGER(SIZE_T), INTENT(IN) :: size - CHARACTER(LEN=*), INTENT(IN) :: value - INTEGER, INTENT(IN) :: value_len - END FUNCTION h5pregisterc_c - END INTERFACE - - name_len = LEN(name) - value_len = LEN(value) - hdferr = h5pregisterc_c(class, name , name_len, size, value, value_len) - END SUBROUTINE h5pregister_char - -!---------------------------------------------------------------------- -! Name: h5pinsert_integer -! -! Purpose: Registers a temporary property with a property list class. -! -! Inputs: -! plist - property list identifier -! name - name of property to insert -! size - size of property in bytes -! value - initial value for the property -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! October 10, 2002 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pinsert_integer(plist, name, size, value, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist ! Property list identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to insert - INTEGER(SIZE_T), INTENT(IN) :: size ! Size of the property value - INTEGER, INTENT(IN) :: value ! Property value - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER :: name_len - - 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$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: plist - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER, INTENT(IN) :: name_len - INTEGER(SIZE_T), INTENT(IN) :: size - INTEGER, INTENT(IN) :: value - END FUNCTION h5pinsert_integer_c - END INTERFACE - - name_len = LEN(name) - hdferr = h5pinsert_integer_c(plist, name , name_len, size, value) - END SUBROUTINE h5pinsert_integer - -!---------------------------------------------------------------------- -! Name: h5pinsert_real -! -! Purpose: Registers a temporary property with a property list class. -! -! Inputs: -! plist - property list identifier -! permanent property within -! name - name of property to insert -! size - size of property in bytes -! value - initial value for the property -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! October 10, 2002 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pinsert_real(plist, name, size, value, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist ! Property list identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to insert - INTEGER(SIZE_T), INTENT(IN) :: size ! Size of the property value - REAL, INTENT(IN) :: value ! Property value - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER :: name_len - - 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$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: plist - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER, INTENT(IN) :: name_len - INTEGER(SIZE_T), INTENT(IN) :: size - REAL, INTENT(IN) :: value - END FUNCTION h5pinsert_real_c - END INTERFACE - - name_len = LEN(name) - hdferr = h5pinsert_real_c(plist, name , name_len, size, value) - END SUBROUTINE h5pinsert_real - - -!---------------------------------------------------------------------- -! Name: h5pinsert_char -! -! Purpose: Registers a temporary property with a property list class. -! -! Inputs: -! plist - property list identifier -! permanent property within -! name - name of property to insert -! size - size of property in bytes -! value - initial value for the property -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! October 10, 2002 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pinsert_char(plist, name, size, value, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist ! Property list identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to insert - INTEGER(SIZE_T), INTENT(IN) :: size ! Size of property value - CHARACTER(LEN=*), INTENT(IN) :: value ! Property value - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER :: name_len - INTEGER :: value_len - - 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$ATTRIBUTES reference :: name - !DEC$ATTRIBUTES reference :: value - INTEGER(HID_T), INTENT(IN) :: plist - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER, INTENT(IN) :: name_len - INTEGER(SIZE_T), INTENT(IN) :: size - CHARACTER(LEN=*), INTENT(IN) :: value - INTEGER, INTENT(IN) :: value_len - END FUNCTION h5pinsertc_c - END INTERFACE - - name_len = LEN(name) - value_len = LEN(value) - hdferr = h5pinsertc_c(plist, name , name_len, size, value, value_len) - END SUBROUTINE h5pinsert_char - -!---------------------------------------------------------------------- -! Name: h5pset_shuffle_f -! -! Purpose: Sets shuffling filter -! -! Inputs: -! prp_id - dataset creation property list identifier -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! March 12, 2003 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- + 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 + INTEGER(HID_T), INTENT(IN) :: plist_id + INTEGER, INTENT(OUT) :: flag + END FUNCTION h5pget_alloc_time_c + END INTERFACE + + hdferr = h5pget_alloc_time_c(plist_id, flag) + END SUBROUTINE h5pget_alloc_time_f + +!****s* H5P/h5pset_fill_time_f +! NAME +! h5pset_fill_time_f +! +! PURPOSE +! Set fill value writing time for dataset +! +! INPUTS +! +! plist_id - dataset creation property list identifier +! flag - fill time flag: +! H5D_FILL_TIME_ERROR_F +! H5D_FILL_TIME_ALLOC_F +! H5D_FILL_TIME_NEVER_F +! OUTPUTS +! +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! October 4, 2002 +! +! Fortran90 Interface: + SUBROUTINE h5pset_fill_time_f(plist_id, flag, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist_id ! Dataset creation property list identifier + INTEGER, INTENT(IN) :: flag ! Fill time flag: + ! H5D_FILL_TIME_ERROR_F + ! H5D_FILL_TIME_ALLOC_F + ! H5D_FILL_TIME_NEVER_F + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + 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 + INTEGER(HID_T), INTENT(IN) :: plist_id + INTEGER, INTENT(IN) :: flag + END FUNCTION h5pset_fill_time_c + END INTERFACE + + hdferr = h5pset_fill_time_c(plist_id, flag) + END SUBROUTINE h5pset_fill_time_f + +!****s* H5P/h5pget_fill_time_f +! NAME +! h5pget_fill_time_f +! +! PURPOSE +! Get fill value writing time for dataset +! +! INPUTS +! +! plist_id - dataset creation property list identifier +! OUTPUTS +! +! hdferr: - error code +! Success: 0 +! Failure: -1 +! OPTIONAL PARAMETERS +! +! flag - fill time flag: +! H5D_FILL_TIME_ERROR_F +! H5D_FILL_TIME_ALLOC_F +! H5D_FILL_TIME_NEVER_F +! AUTHOR +! Elena Pourmal +! October 4, 2002 +! +! Fortran90 Interface: + SUBROUTINE h5pget_fill_time_f(plist_id, flag, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist_id ! Dataset creation property list identifier + INTEGER, INTENT(OUT) :: flag ! Fill time flag: + ! H5D_FILL_TIME_ERROR_F + ! H5D_FILL_TIME_ALLOC_F + ! H5D_FILL_TIME_NEVER_F + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + + 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 + INTEGER(HID_T), INTENT(IN) :: plist_id + INTEGER, INTENT(OUT) :: flag + END FUNCTION h5pget_fill_time_c + END INTERFACE + + hdferr = h5pget_fill_time_c(plist_id, flag) + END SUBROUTINE h5pget_fill_time_f + +!****s* H5P/ h5pset_meta_block_size_f +! NAME +! h5pset_meta_block_size_f +! +! PURPOSE +! Sets the minimum size of metadata block allocations +! +! INPUTS +! +! plist_id - file access property list identifier +! size - metatdata block size +! OUTPUTS +! +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! October 7, 2002 +! +! Fortran90 Interface: + SUBROUTINE h5pset_meta_block_size_f(plist_id, size, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist_id ! File access property list identifier + INTEGER(HSIZE_T), INTENT(IN) :: size ! Block size in bytes; + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + 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 + INTEGER(HID_T), INTENT(IN) :: plist_id + INTEGER(HSIZE_T), INTENT(IN) :: size + END FUNCTION h5pset_meta_block_size_c + END INTERFACE + + hdferr = h5pset_meta_block_size_c(plist_id, size) + END SUBROUTINE h5pset_meta_block_size_f + +!****s* H5P/h5pget_meta_block_size_f +! NAME +! h5pget_meta_block_size_f +! +! PURPOSE +! Gets the minimum size of metadata block allocations +! +! INPUTS +! +! plist_id - file access property list identifier +! OUTPUTS +! +! size - metatdata block size +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! October 7, 2002 +! +! Fortran90 Interface: + SUBROUTINE h5pget_meta_block_size_f(plist_id, size, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist_id ! File access property list identifier + INTEGER(HSIZE_T), INTENT(OUT) :: size ! Block size in bytes; + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + 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 + INTEGER(HID_T), INTENT(IN) :: plist_id + INTEGER(HSIZE_T), INTENT(OUT) :: size + END FUNCTION h5pget_meta_block_size_c + END INTERFACE + + hdferr = h5pget_meta_block_size_c(plist_id, size) + END SUBROUTINE h5pget_meta_block_size_f + +!****s* H5P/h5pset_sieve_buf_size_f +! NAME +! h5pset_sieve_buf_size_f +! +! PURPOSE +! Sets the maximum size of the data sieve buffer +! +! INPUTS +! +! plist_id - file access property list identifier +! size - sieve buffer size +! OUTPUTS +! +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! October 7, 2002 +! +! Fortran90 Interface: + SUBROUTINE h5pset_sieve_buf_size_f(plist_id, size, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist_id ! File access property list identifier + INTEGER(SIZE_T), INTENT(IN) :: size ! Buffer size in bytes; + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** - SUBROUTINE h5pset_shuffle_f(prp_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code + 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 + INTEGER(HID_T), INTENT(IN) :: plist_id + INTEGER(SIZE_T), INTENT(IN) :: size + END FUNCTION h5pset_sieve_buf_size_c + END INTERFACE + + hdferr = h5pset_sieve_buf_size_c(plist_id, size) + END SUBROUTINE h5pset_sieve_buf_size_f + +!****s* H5P/h5pget_sieve_buf_size_f +! NAME +! h5pget_sieve_buf_size_f +! +! PURPOSE +! Gets the maximum size of the data sieve buffer +! +! INPUTS +! +! plist_id - file access property list identifier +! OUTPUTS +! +! size - sieve buffer size +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! October 7, 2002 +! +! Fortran90 Interface: + SUBROUTINE h5pget_sieve_buf_size_f(plist_id, size, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist_id ! File access property list identifier + INTEGER(SIZE_T), INTENT(OUT) :: size ! Buffer size in bytes + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** -! INTEGER, EXTERNAL :: h5pset_shuffle_c -! MS FORTRAN needs explicit interface for C functions called here. -! - 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 - INTEGER(HID_T), INTENT(IN) :: prp_id - END FUNCTION h5pset_shuffle_c - END INTERFACE - hdferr = h5pset_shuffle_c(prp_id) + 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 + INTEGER(HID_T), INTENT(IN) :: plist_id + INTEGER(SIZE_T), INTENT(OUT) :: size + END FUNCTION h5pget_sieve_buf_size_c + END INTERFACE + + hdferr = h5pget_sieve_buf_size_c(plist_id, size) + END SUBROUTINE h5pget_sieve_buf_size_f + +!****s* H5P/h5pset_small_data_block_size_f +! NAME +! h5pset_small_data_block_size_f +! +! PURPOSE +! Sets the minimum size of "small" raw data block +! +! INPUTS +! +! plist_id - file access property list identifier +! size - small raw data block size +! OUTPUTS +! +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! October 7, 2002 +! +! Fortran90 Interface: + SUBROUTINE h5pset_small_data_block_size_f(plist_id, size, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist_id ! File access property list identifier + INTEGER(HSIZE_T), INTENT(IN) :: size ! Small raw data block size + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** - END SUBROUTINE h5pset_shuffle_f + 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 + INTEGER(HID_T), INTENT(IN) :: plist_id + INTEGER(HSIZE_T), INTENT(IN) :: size + END FUNCTION h5pset_small_data_block_size_c + END INTERFACE -!---------------------------------------------------------------------- -! Name: h5pset_edc_check_f -! -! Purpose: Enables/disables error detecting + hdferr = h5pset_small_data_block_size_c(plist_id, size) + END SUBROUTINE h5pset_small_data_block_size_f + +!****s* H5P/h5pget_small_data_block_size_f +! NAME +! h5pget_small_data_block_size_f ! -! Inputs: -! prp_id - dataset creation property list identifier -! flag - EDC flag; possible values: -! H5Z_DISABLE_EDC_F -! H5Z_ENABLE_EDC_F -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! PURPOSE +! Gets the minimum size of "small" raw data block ! -! Programmer: Elena Pourmal -! March 13, 2003 +! INPUTS +! +! plist_id - file access property list identifier +! OUTPUTS +! +! size - small raw data block size +! hdferr - error code +! Success: 0 +! Failure: -1 ! -! Modifications: +! AUTHOR +! Elena Pourmal +! October 7, 2002 ! -! Comment: -!---------------------------------------------------------------------- +! Fortran90 Interface: + SUBROUTINE h5pget_small_data_block_size_f(plist_id, size, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist_id ! File access property list identifier + INTEGER(HSIZE_T), INTENT(OUT) :: size ! Small raw data block size + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + 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 + INTEGER(HID_T), INTENT(IN) :: plist_id + INTEGER(HSIZE_T), INTENT(OUT) :: size + END FUNCTION h5pget_small_data_block_size_c + END INTERFACE + + hdferr = h5pget_small_data_block_size_c(plist_id, size) + END SUBROUTINE h5pget_small_data_block_size_f + +!****s* H5P/h5pset_hyper_vector_size_f +! NAME +! h5pset_hyper_vector_size_f +! +! PURPOSE +! Set the number of "I/O" vectors (vector size) +! +! INPUTS +! +! plist_id - dataset transfer property list identifier +! size - vector size +! OUTPUTS +! +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! October 7, 2002 +! +! Fortran90 Interface: + SUBROUTINE h5pset_hyper_vector_size_f(plist_id, size, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist_id ! Dataset transfer property list identifier + INTEGER(SIZE_T), INTENT(IN) :: size ! Vector size + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** - SUBROUTINE h5pset_edc_check_f(prp_id, flag, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER, INTENT(IN) :: flag ! Checksum filter flag - INTEGER, INTENT(OUT) :: hdferr ! Error code + 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 + INTEGER(HID_T), INTENT(IN) :: plist_id + INTEGER(SIZE_T), INTENT(IN) :: size + END FUNCTION h5pset_hyper_vector_size_c + END INTERFACE + + hdferr = h5pset_hyper_vector_size_c(plist_id, size) + END SUBROUTINE h5pset_hyper_vector_size_f + +!****s* H5P/ h5pget_hyper_vector_size_f +! NAME +! h5pget_hyper_vector_size_f +! +! PURPOSE +! Get the number of "I/O" vectors (vector size) +! +! INPUTS +! +! plist_id - dataset transfer property list identifier +! OUTPUTS +! +! size - vector size +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! October 7, 2002 +! +! Fortran90 Interface: + SUBROUTINE h5pget_hyper_vector_size_f(plist_id, size, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist_id ! Dataset transfer property list identifier + INTEGER(SIZE_T), INTENT(OUT) :: size ! Vector size + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** -! INTEGER, EXTERNAL :: h5pset_edc_check_c -! MS FORTRAN needs explicit interface for C functions called here. -! - 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 - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER, INTENT(IN) :: flag - END FUNCTION h5pset_edc_check_c - END INTERFACE - hdferr = h5pset_edc_check_c(prp_id, flag) + 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 + INTEGER(HID_T), INTENT(IN) :: plist_id + INTEGER(SIZE_T), INTENT(OUT) :: size + END FUNCTION h5pget_hyper_vector_size_c + END INTERFACE - END SUBROUTINE h5pset_edc_check_f + hdferr = h5pget_hyper_vector_size_c(plist_id, size) + END SUBROUTINE h5pget_hyper_vector_size_f + +!****s* H5P/h5pexist_f +! NAME +! h5pexist_f +! +! PURPOSE +! Queries whether a property name exists in a property list or class. +! +! INPUTS +! +! prp_id - property list identifier to query +! name - name of property to check for +! OUTPUTS +! +! flag - logical flag +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! October 9, 2002 +! +! Fortran90 Interface: + SUBROUTINE h5pexist_f(prp_id, name, flag, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to modify + LOGICAL, INTENT(OUT) :: flag ! .TRUE. if exists, .FALSE. otherwise + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTEGER :: name_len + + 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$ATTRIBUTES reference :: name + INTEGER(HID_T), INTENT(IN) :: prp_id + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER, INTENT(IN) :: name_len + END FUNCTION h5pexist_c + END INTERFACE + flag = .FALSE. + name_len = LEN(name) + hdferr = h5pexist_c(prp_id, name , name_len) + IF (hdferr > 0) THEN + flag = .TRUE. + hdferr = 0 + ENDIF + END SUBROUTINE h5pexist_f + +!****s* H5P/h5pget_size_f +! +! NAME +! h5pget_size_f +! +! PURPOSE +! Queries the size of a property value in bytes. +! +! INPUTS +! +! prp_id - property list identifier to query +! name - name of property to query +! OUTPUTS +! +! size - size of property in bytes +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! October 9, 2002 +! +! HISTORY +! +! +! Fortran90 Interface: + SUBROUTINE h5pget_size_f(prp_id, name, size, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to query + INTEGER(SIZE_T), INTENT(OUT) :: size ! Size in bytes + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTEGER :: name_len + + 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$ATTRIBUTES reference :: name + INTEGER(HID_T), INTENT(IN) :: prp_id + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER, INTENT(IN) :: name_len + INTEGER(SIZE_T), INTENT(OUT) :: size + END FUNCTION h5pget_size_c + END INTERFACE + name_len = LEN(name) + hdferr = h5pget_size_c(prp_id, name , name_len, size) + END SUBROUTINE h5pget_size_f + +!****s* H5P/h5pget_npros_f +! NAME +! h5pget_npros_f +! +! PURPOSE +! Queries number of properties in property list or class +! +! INPUTS +! +! prp_id - iproperty list identifier to query +! OUTPUTS +! +! nprops - number of properties in property object +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! October 9, 2002 +! +! Fortran90 Interface: + SUBROUTINE h5pget_nprops_f(prp_id, nprops, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(SIZE_T), INTENT(OUT) :: nprops ! Number of properties + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** -!---------------------------------------------------------------------- -! Name: h5pget_edc_check_f -! -! Purpose: Queries error detecting -! -! Inputs: -! prp_id - dataset creation property list identifier -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! March 13, 2003 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- + 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 + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER(SIZE_T), INTENT(OUT) :: nprops + END FUNCTION h5pget_nprops_c + END INTERFACE + hdferr = h5pget_nprops_c(prp_id, nprops) + END SUBROUTINE h5pget_nprops_f + +!****s* H5P/h5pget_class_name_f +! NAME +! h5pget_class_name_f +! +! PURPOSE +! Queries the name of a class. +! +! INPUTS +! +! prp_id - property list identifier to query +! OUTPUTS +! +! name - name of a class +! size - Actual length of the class name +! NOTE: If provided buffer "name" is smaller, +! than name will be truncated to fit into +! provided user buffer +! hdferr: - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! October 9, 2002 +! +! HISTORY +! Returned the size of name as an argument +! +! Fortran90 Interface: + SUBROUTINE h5pget_class_name_f(prp_id, name, size, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + CHARACTER(LEN=*), INTENT(OUT) :: name ! Buffer to retireve class name + INTEGER, INTENT(OUT) :: size ! Actual length of the class name + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTEGER :: name_len + + 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$ATTRIBUTES reference :: name + INTEGER(HID_T), INTENT(IN) :: prp_id + CHARACTER(LEN=*), INTENT(INOUT) :: name + INTEGER, INTENT(IN) :: name_len + END FUNCTION h5pget_class_name_c + END INTERFACE + + name_len = LEN(name) + size = h5pget_class_name_c(prp_id, name, name_len) + + hdferr = 0 + IF(size.LT.0) hdferr = -1 + + END SUBROUTINE h5pget_class_name_f + +!****s* H5P/h5pget_class_parent_f +! NAME +! h5pget_class_parent_f +! +! PURPOSE +! Retrieves the parent class of a genric property class. +! +! INPUTS +! +! prp_id - property list identifier to query +! OUTPUTS +! +! parent_id - identifier of the parent class +! hdferr: - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! October 9, 2002 +! +! Fortran90 Interface: + SUBROUTINE h5pget_class_parent_f(prp_id, parent_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HID_T), INTENT(OUT) :: parent_id ! Parent class property list + ! identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + 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 + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER(HID_T), INTENT(OUT) :: parent_id + END FUNCTION h5pget_class_parent_c + END INTERFACE + hdferr = h5pget_class_parent_c(prp_id, parent_id) + END SUBROUTINE h5pget_class_parent_f + +!****s* H5P/h5pisa_class_f +! NAME +! h5pisa_class_f +! +! PURPOSE +! Determines whether a property list is a member of a class. +! +! INPUTS +! +! plist - property list identifier +! pclass - identifier of the property class +! OUTPUTS +! +! flag - .TRUE. if a member, .FALSE. otherwise +! hdferr: - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! October 9, 2002 +! +! Fortran90 Interface: + SUBROUTINE h5pisa_class_f(plist, pclass, flag, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist ! Property list identifier + INTEGER(HID_T), INTENT(IN) :: pclass ! Class identifier + LOGICAL, INTENT(OUT) :: flag ! logical flag + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + 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 + INTEGER(HID_T), INTENT(IN) :: plist + INTEGER(HID_T), INTENT(IN) :: pclass + END FUNCTION h5pisa_class_c + END INTERFACE + flag = .FALSE. + hdferr = h5pisa_class_c(plist, pclass) + IF (hdferr .GT. 0) THEN + flag = .TRUE. + hdferr = 0 + ENDIF + END SUBROUTINE h5pisa_class_f + +!****s* H5P/h5pcopy_prop_f +! NAME +! h5pcopy_prop_f +! +! PURPOSE +! Copies a property from one list or class to another. +! +! INPUTS +! +! dst_id - Identifier of the destination property list +! src_id - Identifier of the source property list +! name - name of the property to copy +! OUTPUTS +! +! hdferr: - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! October 9, 2002 +! +! Fortran90 Interface: + SUBROUTINE h5pcopy_prop_f(dst_id, src_id, name, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dst_id ! Destination property list + ! identifier + INTEGER(HID_T), INTENT(IN) :: src_id ! Source property list identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Property name + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTEGER :: name_len + + 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$ATTRIBUTES reference :: name + INTEGER(HID_T), INTENT(IN) :: dst_id + INTEGER(HID_T), INTENT(IN) :: src_id + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER, INTENT(IN) :: name_len + END FUNCTION h5pcopy_prop_c + END INTERFACE + name_len = LEN(name) + hdferr = h5pcopy_prop_c(dst_id, src_id, name , name_len) + END SUBROUTINE h5pcopy_prop_f + +!****s* H5P/h5premove_f +! NAME +! h5premove_f +! +! PURPOSE +! Removes a property from a property list. + +! +! INPUTS +! +! plid - Property list identofoer +! name - name of the property to remove +! OUTPUTS +! +! hdferr: - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! October 9, 2002 +! +! Fortran90 Interface: + SUBROUTINE h5premove_f(plid, name, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plid ! Property list identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to remove + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTEGER :: name_len + + 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$ATTRIBUTES reference :: name + INTEGER(HID_T), INTENT(IN) :: plid + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER, INTENT(IN) :: name_len + END FUNCTION h5premove_c + END INTERFACE + name_len = LEN(name) + hdferr = h5premove_c(plid, name , name_len) + END SUBROUTINE h5premove_f + +!****s* H5P/h5punregister_f +! NAME +! h5punregister_f +! +! PURPOSE +! Removes a property from a property list class. +! +! INPUTS +! +! class - Property list class identifier +! name - name of the property to remove +! OUTPUTS +! +! hdferr: - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! October 9, 2002 +! +! Fortran90 Interface: + SUBROUTINE h5punregister_f(class, name, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: class ! property list class identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! name of property to remove + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTEGER :: name_len - SUBROUTINE h5pget_edc_check_f(prp_id, flag, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Dataset transfer property list identifier - INTEGER, INTENT(OUT) :: flag ! Checksum filter flag - ! May have one of the following values: - ! H5Z_ERROR_EDC_F - ! H5Z_DISABLE_EDC_F - ! H5Z_ENABLE_EDC_F - ! H5Z_NO_EDC_F - INTEGER, INTENT(OUT) :: hdferr ! Error code + 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$ATTRIBUTES reference :: name + INTEGER(HID_T), INTENT(IN) :: class + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER, INTENT(IN) :: name_len + END FUNCTION h5punregister_c + END INTERFACE + name_len = LEN(name) + hdferr = h5punregister_c(class, name , name_len) + END SUBROUTINE h5punregister_f + +!****s* H5P/h5pclose_class_f +! NAME +! h5pclose_class_f +! +! PURPOSE +! Closes an existing property list class. +! +! INPUTS +! +! class - Property list class identifier +! OUTPUTS +! +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! October 9, 2002 +! +! Fortran90 Interface: + SUBROUTINE h5pclose_class_f(class, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: class ! Property list class identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + 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 + INTEGER(HID_T), INTENT(IN) :: class + END FUNCTION h5pclose_class_c + END INTERFACE + hdferr = h5pclose_class_c(class) + END SUBROUTINE h5pclose_class_f -! INTEGER, EXTERNAL :: h5pget_edc_check_c -! MS FORTRAN needs explicit interface for C functions called here. +!****s* H5P/h5pset_shuffle_f +! NAME +! h5pset_shuffle_f ! - 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 - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER, INTENT(OUT) :: flag - END FUNCTION h5pget_edc_check_c - END INTERFACE - hdferr = h5pget_edc_check_c(prp_id, flag) - - END SUBROUTINE h5pget_edc_check_f -!---------------------------------------------------------------------- -! Name: h5pset_fletcher32_f -! -! Purpose: Sets Fletcher32 checksum of EDC for a dataset creation -! property list. +! PURPOSE +! Sets shuffling filter ! -! Inputs: -! prp_id - dataset creation property list identifier -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! INPUTS +! prp_id - dataset creation property list identifier +! OUTPUTS +! hdferr - error code +! Success: 0 +! Failure: -1 ! -! Programmer: Elena Pourmal -! March 13, 2003 +! AUTHOR +! Elena Pourmal +! March 12, 2003 ! -! Modifications: +! Fortran90 Interface: + SUBROUTINE h5pset_shuffle_f(prp_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + +! INTEGER, EXTERNAL :: h5pset_shuffle_c +! MS FORTRAN needs explicit interface for C functions called here. ! -! Comment: -!---------------------------------------------------------------------- + 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 + INTEGER(HID_T), INTENT(IN) :: prp_id + END FUNCTION h5pset_shuffle_c + END INTERFACE + hdferr = h5pset_shuffle_c(prp_id) + + END SUBROUTINE h5pset_shuffle_f + +!****s* H5P/h5pset_edc_check_f +! NAME +! h5pset_edc_check_f +! +! PURPOSE +! Enables/disables error detecting +! +! INPUTS +! +! prp_id - dataset creation property list identifier +! flag - EDC flag; possible values: +! H5Z_DISABLE_EDC_F +! H5Z_ENABLE_EDC_F +! OUTPUTS +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! March 13, 2003 +! +! Fortran90 Interface: + SUBROUTINE h5pset_edc_check_f(prp_id, flag, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER, INTENT(IN) :: flag ! Checksum filter flag + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** +! INTEGER, EXTERNAL :: h5pset_edc_check_c +! MS FORTRAN needs explicit interface for C functions called here. +! + 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 + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER, INTENT(IN) :: flag + END FUNCTION h5pset_edc_check_c + END INTERFACE + hdferr = h5pset_edc_check_c(prp_id, flag) + + END SUBROUTINE h5pset_edc_check_f + +!****s* H5P/h5pget_edc_check_f +! NAME +! h5pget_edc_check_f +! +! PURPOSE +! Queries error detecting +! +! INPUTS +! +! prp_id - dataset creation property list identifier +! OUTPUTS +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! March 13, 2003 +! +! Fortran90 Interface: + SUBROUTINE h5pget_edc_check_f(prp_id, flag, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Dataset transfer property list identifier + INTEGER, INTENT(OUT) :: flag ! Checksum filter flag + ! May have one of the following values: + ! H5Z_ERROR_EDC_F + ! H5Z_DISABLE_EDC_F + ! H5Z_ENABLE_EDC_F + ! H5Z_NO_EDC_F + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** - SUBROUTINE h5pset_fletcher32_f(prp_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code +! INTEGER, EXTERNAL :: h5pget_edc_check_c +! MS FORTRAN needs explicit interface for C functions called here. +! + 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 + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER, INTENT(OUT) :: flag + END FUNCTION h5pget_edc_check_c + END INTERFACE + hdferr = h5pget_edc_check_c(prp_id, flag) + + END SUBROUTINE h5pget_edc_check_f + +!****s* H5P/h5pset_fletcher32_f +! NAME +! h5pset_fletcher32_f +! +! PURPOSE +! Sets Fletcher32 checksum of EDC for a dataset creation +! property list. +! +! INPUTS +! +! prp_id - dataset creation property list identifier +! OUTPUTS +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! March 13, 2003 +! +! Fortran90 Interface: + SUBROUTINE h5pset_fletcher32_f(prp_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** ! INTEGER, EXTERNAL :: h5pset_fletcher32_c ! MS FORTRAN needs explicit interface for C functions called here. ! - 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 - INTEGER(HID_T), INTENT(IN) :: prp_id - END FUNCTION h5pset_fletcher32_c - END INTERFACE - hdferr = h5pset_fletcher32_c(prp_id) + 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 + INTEGER(HID_T), INTENT(IN) :: prp_id + END FUNCTION h5pset_fletcher32_c + END INTERFACE + hdferr = h5pset_fletcher32_c(prp_id) - END SUBROUTINE h5pset_fletcher32_f + END SUBROUTINE h5pset_fletcher32_f -!---------------------------------------------------------------------- -! Name: h5pset_family_offset_f -! -! Purpose: Sets offset for family file driver. +!****s* H5P/ h5pset_family_offset_f +! NAME +! h5pset_family_offset_f ! -! Inputs: -! prp_id - file creation property list identifier -! offset - file offset -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! PURPOSE +! Sets offset for family file driver. ! -! Programmer: Elena Pourmal -! 19 March 2003 +! INPUTS +! +! prp_id - file creation property list identifier +! offset - file offset +! OUTPUTS +! hdferr - error code +! Success: 0 +! Failure: -1 ! -! Modifications: +! AUTHOR +! Elena Pourmal +! 19 March 2003 ! -! Comment: -!---------------------------------------------------------------------- - - - SUBROUTINE h5pset_family_offset_f(prp_id, offset, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER(HSIZE_T), INTENT(IN) :: offset ! Offset in bytes - INTEGER, INTENT(OUT) :: hdferr ! Error code +! Fortran90 Interface: + SUBROUTINE h5pset_family_offset_f(prp_id, offset, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HSIZE_T), INTENT(IN) :: offset ! Offset in bytes + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** ! INTEGER, EXTERNAL :: h5pset_family_offset_c ! MS FORTRAN needs explicit interface for C functions called here. ! - 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 - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER(HSIZE_T), INTENT(IN) :: offset - END FUNCTION h5pset_family_offset_c - END INTERFACE - hdferr = h5pset_family_offset_c(prp_id, offset) - - END SUBROUTINE h5pset_family_offset_f - -!---------------------------------------------------------------------- -! Name: h5pset_fapl_multi_l -! -! Purpose: Sets up use of the multi-file driver. -! -! Inputs: -! prp_id - file creation property list identifier -! mem_map - mapping array -! memb_fapl - property list for each memory usage type -! memb_name - names of member file -! relax - flag -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! 20 March 2003 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - - SUBROUTINE h5pset_fapl_multi_l(prp_id, memb_map, memb_fapl, memb_name, memb_addr, relax, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! File creation property list identifier - INTEGER, DIMENSION(0:H5FD_MEM_NTYPES_F-1), INTENT(IN) :: memb_map - INTEGER(HID_T), DIMENSION(0:H5FD_MEM_NTYPES_F-1), INTENT(IN) :: memb_fapl - CHARACTER(LEN=*), DIMENSION(0:H5FD_MEM_NTYPES_F-1), INTENT(IN) :: memb_name - !INTEGER(HADDR_T), DIMENSION(0:H5FD_MEM_NTYPES_F-1), INTENT(IN) :: memb_addr - REAL, DIMENSION(0:H5FD_MEM_NTYPES_F-1), INTENT(IN) :: memb_addr - LOGICAL, INTENT(IN) :: relax - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER, DIMENSION(0:H5FD_MEM_NTYPES_F-1) :: lenm - INTEGER :: maxlen - INTEGER :: flag - INTEGER :: i + 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 + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER(HSIZE_T), INTENT(IN) :: offset + END FUNCTION h5pset_family_offset_c + END INTERFACE + hdferr = h5pset_family_offset_c(prp_id, offset) + + END SUBROUTINE h5pset_family_offset_f + +!****s* H5P/h5pset_fapl_multi_l +! NAME +! h5pset_fapl_multi_l +! +! PURPOSE +! Sets up use of the multi-file driver. +! +! INPUTS +! +! prp_id - file creation property list identifier +! mem_map - mapping array +! memb_fapl - property list for each memory usage type +! memb_name - names of member file +! relax - flag +! OUTPUTS +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! 20 March 2003 +! +! Fortran90 Interface: + SUBROUTINE h5pset_fapl_multi_l(prp_id, memb_map, memb_fapl, memb_name, memb_addr, relax, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! File creation property list identifier + INTEGER, DIMENSION(0:H5FD_MEM_NTYPES_F-1), INTENT(IN) :: memb_map ! Mapping array + INTEGER(HID_T), DIMENSION(0:H5FD_MEM_NTYPES_F-1), INTENT(IN) :: memb_fapl ! Property list for each memory usage type + CHARACTER(LEN=*), DIMENSION(0:H5FD_MEM_NTYPES_F-1), INTENT(IN) :: memb_name ! Names of member file + REAL, DIMENSION(0:H5FD_MEM_NTYPES_F-1), INTENT(IN) :: memb_addr + LOGICAL, INTENT(IN) :: relax ! Flag + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTEGER, DIMENSION(0:H5FD_MEM_NTYPES_F-1) :: lenm + INTEGER :: maxlen + INTEGER :: flag + INTEGER :: i ! INTEGER, EXTERNAL :: h5pset_fapl_multi_c ! MS FORTRAN needs explicit interface for C functions called here. ! - INTERFACE - 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$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 - INTEGER(HID_T), DIMENSION(0:H5FD_MEM_NTYPES_F-1), INTENT(IN) :: memb_fapl - CHARACTER(LEN=*), DIMENSION(0:H5FD_MEM_NTYPES_F-1), INTENT(IN) :: memb_name - REAL, DIMENSION(0:H5FD_MEM_NTYPES_F-1), INTENT(IN) :: memb_addr - !INTEGER(HADDR_T), DIMENSION(H5FD_MEM_NTYPES_F), INTENT(IN) :: memb_addr - INTEGER, DIMENSION(0:H5FD_MEM_NTYPES_F-1) :: lenm - INTEGER :: maxlen - INTEGER, INTENT(IN) :: flag - END FUNCTION h5pset_fapl_multi_c - END INTERFACE - maxlen = LEN(memb_name(1)) - do i=0, H5FD_MEM_NTYPES_F-1 - lenm(i) = LEN_TRIM(memb_name(i)) - enddo - flag = 0 - if (relax) flag = 1 - hdferr = h5pset_fapl_multi_c(prp_id, memb_map, memb_fapl, memb_name, lenm, maxlen, memb_addr, flag) - - END SUBROUTINE h5pset_fapl_multi_l -!---------------------------------------------------------------------- -! Name: h5pset_fapl_multi_s -! -! Purpose: Sets up use of the multi-file driver. -! -! Inputs: -! prp_id - file creation property list identifier -! relax - flag -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! 31 March 2003 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - - SUBROUTINE h5pset_fapl_multi_s(prp_id, relax, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! File creation property list identifier - LOGICAL, INTENT(IN) :: relax - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER :: flag + INTERFACE + 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$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 + INTEGER(HID_T), DIMENSION(0:H5FD_MEM_NTYPES_F-1), INTENT(IN) :: memb_fapl + CHARACTER(LEN=*), DIMENSION(0:H5FD_MEM_NTYPES_F-1), INTENT(IN) :: memb_name + REAL, DIMENSION(0:H5FD_MEM_NTYPES_F-1), INTENT(IN) :: memb_addr + !INTEGER(HADDR_T), DIMENSION(H5FD_MEM_NTYPES_F), INTENT(IN) :: memb_addr + INTEGER, DIMENSION(0:H5FD_MEM_NTYPES_F-1) :: lenm + INTEGER :: maxlen + INTEGER, INTENT(IN) :: flag + END FUNCTION h5pset_fapl_multi_c + END INTERFACE + maxlen = LEN(memb_name(1)) + DO i=0, H5FD_MEM_NTYPES_F-1 + lenm(i) = LEN_TRIM(memb_name(i)) + ENDDO + flag = 0 + IF (relax) flag = 1 + hdferr = h5pset_fapl_multi_c(prp_id, memb_map, memb_fapl, memb_name, lenm, maxlen, memb_addr, flag) + + END SUBROUTINE h5pset_fapl_multi_l +!****s* H5P/h5pset_fapl_multi_s +! NAME +! h5pset_fapl_multi_s +! +! PURPOSE +! Sets up use of the multi-file driver. +! +! INPUTS +! +! prp_id - file creation property list identifier +! relax - flag +! OUTPUTS +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! 31 March 2003 +! +! Fortran90 Interface: + SUBROUTINE h5pset_fapl_multi_s(prp_id, relax, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! File creation property list identifier + LOGICAL, INTENT(IN) :: relax + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTEGER :: flag ! INTEGER, EXTERNAL :: h5pset_fapl_multi_sc ! MS FORTRAN needs explicit interface for C functions called here. ! - 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 - INTEGER(HID_T), INTENT(IN) :: prp_id ! File creation property list identifier - INTEGER, INTENT(IN) :: flag - END FUNCTION h5pset_fapl_multi_sc - END INTERFACE - flag = 0 - if (relax) flag = 1 - hdferr = h5pset_fapl_multi_sc(prp_id, flag) - - END SUBROUTINE h5pset_fapl_multi_s -!---------------------------------------------------------------------- -! Name: h5pget_fapl_multi_f -! -! Purpose: Sets up use of the multi-file driver. -! -! Inputs: -! prp_id - file creation property list identifier -! Outputs: -! mem_map - mapping array -! memb_fapl - property list for each memory usage type -! memb_name - names of member file -! relax - flag -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! maxlen_out - maximum length for memb_name array element -! -! Programmer: Elena Pourmal -! 24 March 2003 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - - SUBROUTINE h5pget_fapl_multi_f(prp_id, memb_map, memb_fapl, memb_name, memb_addr, relax, hdferr, maxlen_out) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! File creation property list identifier - INTEGER, DIMENSION(0:H5FD_MEM_NTYPES_F-1), INTENT(OUT) :: memb_map - INTEGER(HID_T), DIMENSION(0:H5FD_MEM_NTYPES_F-1), INTENT(OUT) :: memb_fapl - CHARACTER(LEN=*), DIMENSION(0:H5FD_MEM_NTYPES_F-1), INTENT(OUT) :: memb_name - !INTEGER(HADDR_T), DIMENSION(0:H5FD_MEM_NTYPES_F-1), INTENT(OUT) :: memb_addr - REAL, DIMENSION(0:H5FD_MEM_NTYPES_F-1), INTENT(OUT) :: memb_addr - INTEGER, OPTIONAL, INTENT(OUT) :: maxlen_out - LOGICAL, INTENT(OUT) :: relax - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER, DIMENSION(0:H5FD_MEM_NTYPES_F-1) :: lenm - INTEGER :: maxlen - INTEGER :: c_maxlen_out - INTEGER :: flag - INTEGER :: i + 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 + INTEGER(HID_T), INTENT(IN) :: prp_id ! File creation property list identifier + INTEGER, INTENT(IN) :: flag + END FUNCTION h5pset_fapl_multi_sc + END INTERFACE + flag = 0 + IF (relax) flag = 1 + hdferr = h5pset_fapl_multi_sc(prp_id, flag) + + END SUBROUTINE h5pset_fapl_multi_s +!****s* H5P/h5pget_fapl_multi_f +! NAME +! h5pget_fapl_multi_f +! +! PURPOSE +! Sets up use of the multi-file driver. +! +! INPUTS +! +! prp_id - file creation property list identifier +! OUTPUTS +! +! mem_map - mapping array +! memb_fapl - property list for each memory usage type +! memb_name - names of member file +! relax - flag +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! OPTIONAL PARAMETERS +! maxlen_out - maximum length for memb_name array element +! +! AUTHOR +! Elena Pourmal +! 24 March 2003 +! +! Fortran90 Interface: + SUBROUTINE h5pget_fapl_multi_f(prp_id, memb_map, memb_fapl, memb_name, memb_addr, relax, hdferr, maxlen_out) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! File creation property list identifier + INTEGER, DIMENSION(0:H5FD_MEM_NTYPES_F-1), INTENT(OUT) :: memb_map + INTEGER(HID_T), DIMENSION(0:H5FD_MEM_NTYPES_F-1), INTENT(OUT) :: memb_fapl + CHARACTER(LEN=*), DIMENSION(0:H5FD_MEM_NTYPES_F-1), INTENT(OUT) :: memb_name + !INTEGER(HADDR_T), DIMENSION(0:H5FD_MEM_NTYPES_F-1), INTENT(OUT) :: memb_addr + REAL, DIMENSION(0:H5FD_MEM_NTYPES_F-1), INTENT(OUT) :: memb_addr + INTEGER, OPTIONAL, INTENT(OUT) :: maxlen_out + LOGICAL, INTENT(OUT) :: relax + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTEGER, DIMENSION(0:H5FD_MEM_NTYPES_F-1) :: lenm + INTEGER :: maxlen + INTEGER :: c_maxlen_out + INTEGER :: flag + INTEGER :: i ! INTEGER, EXTERNAL :: h5pget_fapl_multi_c ! MS FORTRAN needs explicit interface for C functions called here. ! - INTERFACE - 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$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 - INTEGER(HID_T), DIMENSION(H5FD_MEM_NTYPES_F), INTENT(OUT) :: memb_fapl - CHARACTER(LEN=*), DIMENSION(H5FD_MEM_NTYPES_F), INTENT(OUT) :: memb_name - REAL, DIMENSION(H5FD_MEM_NTYPES_F), INTENT(OUT) :: memb_addr - INTEGER, DIMENSION(0:H5FD_MEM_NTYPES_F-1) :: lenm - INTEGER :: maxlen - INTEGER :: c_maxlen_out - INTEGER, INTENT(OUT) :: flag - END FUNCTION h5pget_fapl_multi_c - END INTERFACE - maxlen = LEN(memb_name(0)) - do i=0, H5FD_MEM_NTYPES_F-1 - lenm(i) = LEN_TRIM(memb_name(i)) - enddo - hdferr = h5pget_fapl_multi_c(prp_id, memb_map, memb_fapl, memb_name, lenm, maxlen, memb_addr, flag, c_maxlen_out) - relax = .TRUE. - if(flag .eq. 0) relax = .FALSE. - if(present(maxlen_out)) maxlen_out = c_maxlen_out - END SUBROUTINE h5pget_fapl_multi_f -!---------------------------------------------------------------------- -! Name: h5pset_szip_f -! -! Purpose: Sets up use of szip compression -! -! Inputs: -! prp_id - dataset creation property list identifier -! options_mask -! pixels_per_block - szip parameters -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! April 10 2003 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - - SUBROUTINE h5pset_szip_f(prp_id, options_mask, pixels_per_block, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Dataset creation property - ! list identifier - INTEGER, INTENT(IN) :: options_mask - INTEGER, INTENT(IN) :: pixels_per_block - INTEGER, INTENT(OUT) :: hdferr ! Error code + INTERFACE + 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$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 + INTEGER(HID_T), DIMENSION(H5FD_MEM_NTYPES_F), INTENT(OUT) :: memb_fapl + CHARACTER(LEN=*), DIMENSION(H5FD_MEM_NTYPES_F), INTENT(OUT) :: memb_name + REAL, DIMENSION(H5FD_MEM_NTYPES_F), INTENT(OUT) :: memb_addr + INTEGER, DIMENSION(0:H5FD_MEM_NTYPES_F-1) :: lenm + INTEGER :: maxlen + INTEGER :: c_maxlen_out + INTEGER, INTENT(OUT) :: flag + END FUNCTION h5pget_fapl_multi_c + END INTERFACE + maxlen = LEN(memb_name(0)) + DO i=0, H5FD_MEM_NTYPES_F-1 + lenm(i) = LEN_TRIM(memb_name(i)) + ENDDO + hdferr = h5pget_fapl_multi_c(prp_id, memb_map, memb_fapl, memb_name, lenm, maxlen, memb_addr, flag, c_maxlen_out) + relax = .TRUE. + IF(flag .EQ. 0) relax = .FALSE. + IF(PRESENT(maxlen_out)) maxlen_out = c_maxlen_out + END SUBROUTINE h5pget_fapl_multi_f +!****s* H5P/h5pset_szip_f +! NAME +! h5pset_szip_f +! +! PURPOSE +! Sets up use of szip compression +! +! INPUTS +! +! prp_id - dataset creation property list identifier +! options_mask - A bit-mask conveying the desired SZIP options. +! Current valid values in Fortran are: +! H5_SZIP_EC_OM_F +! H5_SZIP_NN_OM_F +! pixels_per_block - szip parameters +! OUTPUTS +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! April 10 2003 +! +! Fortran90 Interface: + SUBROUTINE h5pset_szip_f(prp_id, options_mask, pixels_per_block, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Dataset creation property + ! list identifier + INTEGER, INTENT(IN) :: options_mask ! A bit-mask conveying the desired + ! SZIP options + ! Current valid values in Fortran are: + ! H5_SZIP_EC_OM_F + ! H5_SZIP_NN_OM_F + INTEGER, INTENT(IN) :: pixels_per_block ! The number of pixels or data elements + ! in each data block + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** -! INTEGER, EXTERNAL :: h5pset_szip_c +! INTEGER, EXTERNAL :: h5pset_szip_c ! MS FORTRAN needs explicit interface for C functions called here. ! - 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 - INTEGER(HID_T), INTENT(IN) :: prp_id ! File creation property list identifier - INTEGER, INTENT(IN) :: options_mask - INTEGER, INTENT(IN) :: pixels_per_block - END FUNCTION h5pset_szip_c - END INTERFACE - hdferr = h5pset_szip_c(prp_id, options_mask, pixels_per_block) - - END SUBROUTINE h5pset_szip_f - -!---------------------------------------------------------------------- -! Name: h5pall_filters_avail_f -! -! Purpose: Checks if all filters set in the dataset creation -! property list are available -! -! Inputs: -! prp_id - data creation property list identifier -! Outputs: -! flag - .TRUE. if all filters are available -! .FALSE. otherwise -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! April 10 2003 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - - SUBROUTINE h5pall_filters_avail_f(prp_id, flag, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Dataset creation property - ! list identifier - LOGICAL, INTENT(OUT) :: flag - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER :: status + 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 + INTEGER(HID_T), INTENT(IN) :: prp_id ! File creation property list identifier + INTEGER, INTENT(IN) :: options_mask + INTEGER, INTENT(IN) :: pixels_per_block + END FUNCTION h5pset_szip_c + END INTERFACE + hdferr = h5pset_szip_c(prp_id, options_mask, pixels_per_block) + + END SUBROUTINE h5pset_szip_f + +!****s* H5P/h5pall_filters_avail_f +! NAME +! h5pall_filters_avail_f +! +! PURPOSE +! Checks if all filters set in the dataset creation +! property list are available +! +! INPUTS +! +! prp_id - data creation property list identifier +! OUTPUTS +! +! flag - .TRUE. if all filters are available +! .FALSE. otherwise +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! April 10 2003 +! +! Fortran90 Interface: + SUBROUTINE h5pall_filters_avail_f(prp_id, flag, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Dataset creation property + ! list identifier + LOGICAL, INTENT(OUT) :: flag ! .TRUE. if all filters are available + ! .FALSE. otherwise + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** + INTEGER :: status ! INTEGER, EXTERNAL :: h5pall_filters_avail_c ! MS FORTRAN needs explicit interface for C functions called here. ! - 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 - INTEGER(HID_T), INTENT(IN) :: prp_id ! File creation property list identifier - INTEGER, INTENT(OUT) :: status - END FUNCTION h5pall_filters_avail_c - END INTERFACE - flag = .TRUE. - hdferr = h5pall_filters_avail_c(prp_id, status) - if (status .eq. 0 ) flag = .FALSE. - - END SUBROUTINE h5pall_filters_avail_f - -!---------------------------------------------------------------------- -! Name: h5pget_filter_by_id_f -! -! Purpose: Returns information about a filter in a pipeline -! -! Inputs: -! prp_id - data creation or transfer property list -! identifier -! Outputs: -! filter_id - filter identifier -! flags - bit vector specifying certain general -! properties of the filter -! cd_nelmts - number of elements in cd_values -! cd_values - auxiliary data for the filter -! namelen - number of characters in the name buffer -! name - buffer to retrieve filter name -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! April 10 2003 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pget_filter_by_id_f(prp_id, filter_id, flags, cd_nelmts, cd_values, namelen, name, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - - INTEGER, INTENT(IN) :: filter_id ! Filter identifier - INTEGER(SIZE_T), INTENT(INOUT) :: cd_nelmts !Number of elements in cd_values. - INTEGER, DIMENSION(*), INTENT(OUT) :: cd_values !Auxiliary data for the filter. - INTEGER, INTENT(OUT) :: flags !Bit vector specifying certain general - !properties of the filter. - INTEGER(SIZE_T), INTENT(IN) :: namelen !Anticipated number of characters in name. - CHARACTER(LEN=*), INTENT(OUT) :: name !Name of the filter - - INTEGER, INTENT(OUT) :: hdferr ! Error code - - -! INTEGER, EXTERNAL :: h5pget_filter_by_id_c -! MS FORTRAN needs explicit interface for C functions called here. -! - INTERFACE - 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$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER, INTENT(IN) :: filter_id - INTEGER, DIMENSION(*), INTENT(OUT) :: cd_values - INTEGER, INTENT(OUT) :: flags - INTEGER(SIZE_T), INTENT(INOUT) :: cd_nelmts - INTEGER(SIZE_T), INTENT(IN) :: namelen - CHARACTER(LEN=*), INTENT(OUT) :: name - END FUNCTION h5pget_filter_by_id_c - END INTERFACE - - hdferr = h5pget_filter_by_id_c(prp_id, filter_id, flags, cd_nelmts, & - cd_values, namelen, name) - END SUBROUTINE h5pget_filter_by_id_f - -!---------------------------------------------------------------------- -! Name: h5pmodify_filter_f -! -! Purpose: Adds a filter to the filter pipeline. -! -! Inputs: -! prp_id - data creation or transfer property list -! identifier -! filter - filter to be modified -! flags - bit vector specifying certain general -! properties of the filter -! cd_nelmts - number of elements in cd_values -! cd_values - auxiliary data for the filter -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! April 10 2003 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pmodify_filter_f(prp_id, filter, flags, cd_nelmts, cd_values, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - INTEGER, INTENT(IN) :: filter !Filter to be modified - INTEGER, INTENT(IN) :: flags !Bit vector specifying certain general - !properties of the filter. - INTEGER(SIZE_T), INTENT(IN) :: cd_nelmts !Number of elements in cd_values. - INTEGER, DIMENSION(*), INTENT(IN) :: cd_values !Auxiliary data for the filter. + 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 + INTEGER(HID_T), INTENT(IN) :: prp_id ! File creation property list identifier + INTEGER, INTENT(OUT) :: status + END FUNCTION h5pall_filters_avail_c + END INTERFACE + flag = .TRUE. + hdferr = h5pall_filters_avail_c(prp_id, status) + IF (status .EQ. 0 ) flag = .FALSE. + + END SUBROUTINE h5pall_filters_avail_f + +!****s* H5P/h5pget_filter_by_id_f +! NAME +! h5pget_filter_by_id_f +! +! PURPOSE +! Returns information about a filter in a pipeline +! +! INPUTS +! +! prp_id - data creation or transfer property list +! identifier +! OUTPUTS +! +! filter_id - filter identifier +! flags - bit vector specifying certain general +! properties of the filter +! cd_nelmts - number of elements in cd_values +! cd_values - auxiliary data for the filter +! namelen - number of characters in the name buffer +! name - buffer to retrieve filter name +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! April 10 2003 +! +! Fortran90 Interface: + SUBROUTINE h5pget_filter_by_id_f(prp_id, filter_id, flags, cd_nelmts, cd_values, namelen, name, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER, INTENT(IN) :: filter_id ! Filter identifier + INTEGER(SIZE_T), INTENT(INOUT) :: cd_nelmts ! Number of elements in cd_values. + INTEGER, DIMENSION(*), INTENT(OUT) :: cd_values ! Auxiliary data for the filter. + INTEGER, INTENT(OUT) :: flags ! Bit vector specifying certain general + ! properties of the filter. + INTEGER(SIZE_T), INTENT(IN) :: namelen ! Anticipated number of characters in name. + CHARACTER(LEN=*), INTENT(OUT) :: name ! Name of the filter + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** - INTEGER, INTENT(OUT) :: hdferr ! Error code -! INTEGER, EXTERNAL :: h5pmodify_filter_c +! INTEGER, EXTERNAL :: h5pget_filter_by_id_c ! MS FORTRAN needs explicit interface for C functions called here. ! - 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 - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER, INTENT(IN) :: filter - INTEGER, INTENT(IN) :: flags - INTEGER(SIZE_T), INTENT(IN) :: cd_nelmts - INTEGER, DIMENSION(*), INTENT(IN) :: cd_values - END FUNCTION h5pmodify_filter_c - END INTERFACE - - hdferr = h5pmodify_filter_c(prp_id, filter, flags, cd_nelmts, cd_values ) - END SUBROUTINE h5pmodify_filter_f + INTERFACE + 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$ATTRIBUTES reference :: name + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER, INTENT(IN) :: filter_id + INTEGER, DIMENSION(*), INTENT(OUT) :: cd_values + INTEGER, INTENT(OUT) :: flags + INTEGER(SIZE_T), INTENT(INOUT) :: cd_nelmts + INTEGER(SIZE_T), INTENT(IN) :: namelen + CHARACTER(LEN=*), INTENT(OUT) :: name + END FUNCTION h5pget_filter_by_id_c + END INTERFACE + + hdferr = h5pget_filter_by_id_c(prp_id, filter_id, flags, cd_nelmts, & + cd_values, namelen, name) + END SUBROUTINE h5pget_filter_by_id_f + +!****s* H5P/h5pmodify_filter_f +! NAME +! h5pmodify_filter_f +! +! PURPOSE +! Adds a filter to the filter pipeline. +! +! INPUTS +! +! prp_id - data creation or transfer property list +! identifier +! filter - filter to be modified +! flags - bit vector specifying certain general +! properties of the filter +! cd_nelmts - number of elements in cd_values +! cd_values - auxiliary data for the filter +! OUTPUTS +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! April 10 2003 +! +! Fortran90 Interface: + SUBROUTINE h5pmodify_filter_f(prp_id, filter, flags, cd_nelmts, cd_values, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER, INTENT(IN) :: filter ! Filter to be modified + INTEGER, INTENT(IN) :: flags ! Bit vector specifying certain general + ! properties of the filter + INTEGER(SIZE_T), INTENT(IN) :: cd_nelmts ! Number of elements in cd_values + INTEGER, DIMENSION(*), INTENT(IN) :: cd_values ! Auxiliary data for the filter + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** -!---------------------------------------------------------------------- -! Name: h5premove_filter_f -! -! Purpose: Delete one or more filters from the filter pipeline. -! -! Inputs: -! prp_id - data creation or transfer property list -! identifier -! filter - filter to be removed -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Quincey Koziol -! January 27 2004 -! -! Modifications: +! INTEGER, EXTERNAL :: h5pmodify_filter_c +! MS FORTRAN needs explicit interface for C functions called here. ! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5premove_filter_f(prp_id, filter, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Dataset creation property list - ! identifier - INTEGER, INTENT(IN) :: filter ! Filter to be removed - INTEGER, INTENT(OUT) :: hdferr ! Error code + 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 + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER, INTENT(IN) :: filter + INTEGER, INTENT(IN) :: flags + INTEGER(SIZE_T), INTENT(IN) :: cd_nelmts + INTEGER, DIMENSION(*), INTENT(IN) :: cd_values + END FUNCTION h5pmodify_filter_c + END INTERFACE + + hdferr = h5pmodify_filter_c(prp_id, filter, flags, cd_nelmts, cd_values ) + END SUBROUTINE h5pmodify_filter_f + +!****s* H5P/h5premove_filter_f +! NAME +! h5premove_filter_f +! +! PURPOSE +! Delete one or more filters from the filter pipeline. +! +! INPUTS +! +! prp_id - data creation or transfer property list +! identifier +! filter - filter to be removed +! OUTPUTS +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Quincey Koziol +! January 27 2004 +! +! Fortran90 Interface: + SUBROUTINE h5premove_filter_f(prp_id, filter, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Dataset creation property list + ! identifier + INTEGER, INTENT(IN) :: filter ! Filter to be removed + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** ! INTEGER, EXTERNAL :: h5premove_filter_c ! MS FORTRAN needs explicit interface for C functions called here. ! - 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 - INTEGER(HID_T), INTENT(IN) :: prp_id - INTEGER, INTENT(IN) :: filter - END FUNCTION h5premove_filter_c - END INTERFACE - - hdferr = h5premove_filter_c(prp_id, filter) - END SUBROUTINE h5premove_filter_f - -!---------------------------------------------------------------------- -! Name: H5Pget_attr_phase_change_f -! -! Purpose: Retrieves attribute storage phase change thresholds -! -! Inputs: -! ocpl_id - Object (dataset or group) creation property list identifier -! Outputs: -! max_compact - Maximum number of attributes to be stored in compact storage -! (Default: 8) -! min_dense - Minimum number of attributes to be stored in dense storage -! (Default: 6) -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: M.S. Breitenfeld -! January, 2008 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - + 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 + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER, INTENT(IN) :: filter + END FUNCTION h5premove_filter_c + END INTERFACE + + hdferr = h5premove_filter_c(prp_id, filter) + END SUBROUTINE h5premove_filter_f + +!****s* H5P/H5Pget_attr_phase_change_f +! NAME +! H5Pget_attr_phase_change_f +! +! PURPOSE +! Retrieves attribute storage phase change thresholds +! +! INPUTS +! +! ocpl_id - Object (dataset or group) creation property list identifier +! OUTPUTS +! +! max_compact - Maximum number of attributes to be stored in compact storage +! (Default: 8) +! min_dense - Minimum number of attributes to be stored in dense storage +! (Default: 6) +! hdferr - Error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! M. Scot Breitenfeld +! January, 2008 +! +! Fortran90 Interface: SUBROUTINE h5pget_attr_phase_change_f(ocpl_id, max_compact, min_dense, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: ocpl_id ! Object (dataset or group) creation property list identifier - INTEGER, INTENT(OUT) :: max_compact ! Maximum number of attributes to be stored in compact storage - !(Default: 8) - INTEGER, INTENT(OUT) :: min_dense ! Minimum number of attributes to be stored in dense storage - ! (Default: 6) - INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER, INTENT(OUT) :: max_compact ! Maximum number of attributes to be stored in compact storage + ! (Default: 8) + INTEGER, INTENT(OUT) :: min_dense ! Minimum number of attributes to be stored in dense storage + ! (Default: 6) + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** ! ! MS FORTRAN needs explicit interface for C functions called here. ! @@ -5512,35 +4728,35 @@ hdferr = h5pget_attr_phase_change_c(ocpl_id, max_compact, min_dense) END SUBROUTINE h5pget_attr_phase_change_f -!---------------------------------------------------------------------- -! Name: H5Pset_attr_creation_order_f +!****s* H5P/H5Pset_attr_creation_order_f +! NAME +! H5Pset_attr_creation_order_f ! -! Purpose: Sets tracking and indexing of attribute creation order +! PURPOSE +! Sets tracking and indexing of attribute creation order ! -! Inputs: -! ocpl_id - Object creation property list identifier -! crt_order_flags - Flags specifying whether to track and index attribute creation order -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! INPUTS +! +! ocpl_id - Object creation property list identifier +! crt_order_flags - Flags specifying whether to track and index attribute creation order +! OUTPUTS ! -! Programmer: M.S. Breitenfeld -! January, 2008 +! hdferr - Error code +! Success: 0 +! Failure: -1 ! -! Modifications: +! AUTHOR +! M. Scot Breitenfeld +! January, 2008 ! -! Comment: -!---------------------------------------------------------------------- - +! Fortran90 Interface: SUBROUTINE h5pset_attr_creation_order_f(ocpl_id, crt_order_flags , hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: ocpl_id ! Object (dataset or group) creation property list identifier + INTEGER(HID_T), INTENT(IN) :: ocpl_id ! Object (dataset or group) creation property list identifier INTEGER, INTENT(IN) :: crt_order_flags ! Flags specifying whether to track and index attribute creation order - - INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** ! ! MS FORTRAN needs explicit interface for C functions called here. ! @@ -5559,36 +4775,36 @@ hdferr = H5Pset_attr_creation_order_c(ocpl_id, crt_order_flags) END SUBROUTINE h5pset_attr_creation_order_f - -!---------------------------------------------------------------------- -! Name: H5Pset_shared_mesg_nindexes_f +!****s* H5P/H5Pset_shared_mesg_nindexes_f +! NAME +! H5Pset_shared_mesg_nindexes_f ! -! Purpose: Sets number of shared object header message indexes +! PURPOSE +! Sets number of shared object header message indexes ! -! Inputs: -! plist_id - file creation property list -! nindexes - Number of shared object header message indexes to be available in files created with this property list -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! INPUTS +! +! plist_id - file creation property list +! nindexes - Number of shared object header message indexes to be available in files created with this property list +! OUTPUTS ! -! Programmer: M.S. Breitenfeld -! January, 2008 +! hdferr - error code +! Success: 0 +! Failure: -1 ! -! Modifications: +! AUTHOR +! M. Scot Breitenfeld +! January, 2008 ! -! Comment: -!---------------------------------------------------------------------- - +! Fortran90 Interface: SUBROUTINE h5pset_shared_mesg_nindexes_f( plist_id, nindexes, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist_id ! file creation property list - INTEGER, INTENT(IN) :: nindexes ! Number of shared object header message indexes + INTEGER(HID_T), INTENT(IN) :: plist_id ! File creation property list + INTEGER, INTENT(IN) :: nindexes ! Number of shared object header message indexes ! available in files created WITH this property list INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** ! ! MS FORTRAN needs explicit interface for C functions called here. ! @@ -5598,7 +4814,7 @@ !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 @@ -5609,39 +4825,40 @@ END SUBROUTINE h5pset_shared_mesg_nindexes_f -!---------------------------------------------------------------------- -! Name: H5Pset_shared_mesg_index_f +!****s* H5P/H5Pset_shared_mesg_index_f +! NAME +! H5Pset_shared_mesg_index_f ! -! Purpose: Configures the specified shared object header message index +! PURPOSE +! Configures the specified shared object header message index ! -! Inputs: -! fcpl_id - File creation property list identifier. -! index_num - Index being configured. -! mesg_type_flags - Types of messages that should be stored in this index. -! min_mesg_size - Minimum message size. +! INPUTS +! +! fcpl_id - File creation property list identifier. +! index_num - Index being configured. +! mesg_type_flags - Types of messages that should be stored in this index. +! min_mesg_size - Minimum message size. ! -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! OUTPUTS ! -! Programmer: M.S. Breitenfeld -! January, 2008 +! hdferr - error code +! Success: 0 +! Failure: -1 ! -! Modifications: +! AUTHOR +! M. Scot Breitenfeld +! January, 2008 ! -! Comment: -!---------------------------------------------------------------------- - +! Fortran90 Interface: SUBROUTINE h5pset_shared_mesg_index_f(fcpl_id, index_num, mesg_type_flags, min_mesg_size, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: fcpl_id ! file creation property list - INTEGER, INTENT(IN) :: index_num ! Index being configured. + INTEGER(HID_T), INTENT(IN) :: fcpl_id ! file creation property list + INTEGER, INTENT(IN) :: index_num ! Index being configured. INTEGER, INTENT(IN) :: mesg_type_flags ! Types of messages that should be stored in this index. - INTEGER, INTENT(IN) :: min_mesg_size ! Minimum message size. - INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER, INTENT(IN) :: min_mesg_size ! Minimum message size. + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** ! ! MS FORTRAN needs explicit interface for C functions called here. ! @@ -5652,8 +4869,8 @@ !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(HID_T), INTENT(IN) :: fcpl_id INTEGER, INTENT(IN) :: index_num INTEGER, INTENT(IN) :: mesg_type_flags INTEGER, INTENT(IN) :: min_mesg_size @@ -5665,35 +4882,36 @@ END SUBROUTINE h5pset_shared_mesg_index_f -!---------------------------------------------------------------------- -! Name: H5Pget_attr_creation_order_f +!****s* H5P/H5Pget_attr_creation_order_f +! NAME +! H5Pget_attr_creation_order_f ! -! Purpose: Retrieves tracking and indexing settings for attribute creation order +! PURPOSE +! Retrieves tracking and indexing settings for attribute creation order ! -! Inputs: -! ocpl_id - Object (group or dataset) creation property list identifier +! INPUTS ! -! Outputs: -! crt_order_flags - Flags specifying whether to track and index attribute creation order -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! ocpl_id - Object (group or dataset) creation property list identifier ! -! Programmer: M.S. Breitenfeld -! February, 2008 +! OUTPUTS ! -! Modifications: +! crt_order_flags - Flags specifying whether to track and index attribute creation order +! hdferr - Error code +! Success: 0 +! Failure: -1 ! -! Comment: -!---------------------------------------------------------------------- - +! AUTHOR +! M. Scot Breitenfeld +! February, 2008 +! +! Fortran90 Interface: SUBROUTINE h5pget_attr_creation_order_f(ocpl_id, crt_order_flags, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: ocpl_id ! Object (group or dataset) creation property list identifier - INTEGER, INTENT(OUT) :: crt_order_flags ! Flags specifying whether to track and index attribute creation order + INTEGER(HID_T), INTENT(IN) :: ocpl_id ! Object (group or dataset) creation property list identifier + INTEGER, INTENT(OUT) :: crt_order_flags ! Flags specifying whether to track and index attribute creation order INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** ! ! MS FORTRAN needs explicit interface for C functions called here. ! @@ -5714,42 +4932,43 @@ END SUBROUTINE h5pget_attr_creation_order_f -!---------------------------------------------------------------------- -! Name: H5Pset_libver_bounds_f +!****s* H5P/H5Pset_libver_bounds_f +! NAME +! H5Pset_libver_bounds_f ! -! Purpose: Sets bounds on library versions, and indirectly format versions, to be used when creating objects. +! PURPOSE +! Sets bounds on library versions, and indirectly format versions, to be used when creating objects. ! -! Inputs: -! fapl_id - File access property list identifier -! low - The earliest version of the library that will be used for writing objects. -! high - The latest version of the library that will be used for writing objects. +! INPUTS ! -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! fapl_id - File access property list identifier +! low - The earliest version of the library that will be used for writing objects. +! high - The latest version of the library that will be used for writing objects. ! -! Programmer: M.S. Breitenfeld -! February 18, 2008 +! OUTPUTS ! -! Modifications: +! hdferr - error code +! Success: 0 +! Failure: -1 ! -! Comment: -!---------------------------------------------------------------------- - +! AUTHOR +! M. Scot Breitenfeld +! February 18, 2008 +! +! Fortran90 Interface: SUBROUTINE h5pset_libver_bounds_f(fapl_id, low, high, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: fapl_id ! File access property list identifier - INTEGER, INTENT(IN) :: low ! The earliest version of the library that will be used for writing objects. - ! Currently, low must be one of two pre-defined values: - ! HDF_LIBVER_EARLIEST_F - ! HDF_LIBVER_LATEST_F - INTEGER, INTENT(IN) :: high ! The latest version of the library that will be used for writing objects. - ! Currently, low must set to the pre-defined value: - ! HDF_LIBVER_LATEST_F - INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER, INTENT(IN) :: low ! The earliest version of the library that will be used for writing objects. + ! Currently, low must be one of two pre-defined values: + ! HDF_LIBVER_EARLIEST_F + ! HDF_LIBVER_LATEST_F + INTEGER, INTENT(IN) :: high ! The latest version of the library that will be used for writing objects. + ! Currently, low must set to the pre-defined value: + ! HDF_LIBVER_LATEST_F + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** ! ! MS FORTRAN needs explicit interface for C functions called here. ! @@ -5771,35 +4990,36 @@ END SUBROUTINE h5pset_libver_bounds_f -!---------------------------------------------------------------------- -! Name: H5Pset_link_creation_order_f +!****s* H5P/H5Pset_link_creation_order_f +! NAME +! H5Pset_link_creation_order_f ! -! Purpose: Sets creation order tracking and indexing for links in a group. +! PURPOSE +! Sets creation order tracking and indexing for links in a group. ! -! Inputs: -! gcpl_id - Group creation property list identifier -! crt_order_flags - Creation order flag(s) +! INPUTS ! -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! gcpl_id - Group creation property list identifier +! crt_order_flags - Creation order flag(s) ! -! Programmer: M.S. Breitenfeld -! February 18, 2008 +! OUTPUTS ! -! Modifications: +! hdferr - Error code +! Success: 0 +! Failure: -1 ! -! Comment: -!---------------------------------------------------------------------- - +! AUTHOR +! M. Scot Breitenfeld +! February 18, 2008 +! +! Fortran90 Interface: SUBROUTINE h5pset_link_creation_order_f(gcpl_id, crt_order_flags, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: gcpl_id ! File access property list identifier + INTEGER(HID_T), INTENT(IN) :: gcpl_id ! File access property list identifier INTEGER, INTENT(IN) :: crt_order_flags ! Creation order flag(s) INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** ! ! MS FORTRAN needs explicit interface for C functions called here. ! @@ -5820,36 +5040,37 @@ END SUBROUTINE h5pset_link_creation_order_f -!---------------------------------------------------------------------- -! Name: H5Pget_link_phase_change_f -! -! Purpose: Queries the settings for conversion between compact and dense groups. -! -! Inputs: -! gcpl_id - Group creation property list identifier -! Outputs: -! max_compact - Maximum number of attributes to be stored in compact storage -! min_dense - Minimum number of attributes to be stored in dense storage -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: M.S. Breitenfeld -! February 20, 2008 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - +!****s* H5P/H5Pget_link_phase_change_f +! NAME +! H5Pget_link_phase_change_f +! +! PURPOSE +! Queries the settings for conversion between compact and dense groups. +! +! INPUTS +! +! gcpl_id - Group creation property list identifier +! OUTPUTS +! +! max_compact - Maximum number of attributes to be stored in compact storage +! min_dense - Minimum number of attributes to be stored in dense storage +! hdferr - Error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! M. Scot Breitenfeld +! February 20, 2008 +! +! Fortran90 Interface: SUBROUTINE h5pget_link_phase_change_f(gcpl_id, max_compact, min_dense, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: gcpl_id ! Group creation property list identifier - INTEGER, INTENT(OUT) :: max_compact ! Maximum number of attributes to be stored in compact storage - INTEGER, INTENT(OUT) :: min_dense ! Minimum number of attributes to be stored in dense storage - INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER, INTENT(OUT) :: max_compact ! Maximum number of attributes to be stored in compact storage + INTEGER, INTENT(OUT) :: min_dense ! Minimum number of attributes to be stored in dense storage + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** ! ! MS FORTRAN needs explicit interface for C functions called here. ! @@ -5869,36 +5090,37 @@ hdferr = h5pget_link_phase_change_c(gcpl_id, max_compact, min_dense) END SUBROUTINE h5pget_link_phase_change_f -!---------------------------------------------------------------------- -! Name: H5Pget_obj_track_times_f +!****s* H5P/H5Pget_obj_track_times_f +! NAME +! H5Pget_obj_track_times_f ! -! Purpose: Returns whether times are tracked for an object. +! PURPOSE +! Returns whether times are tracked for an object. ! -! Inputs: -! plist_id - property list id -! flag - object timestamp setting -! .TRUE.,.FALSE. -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! INPUTS +! +! plist_id - property list id +! flag - object timestamp setting +! .TRUE.,.FALSE. +! OUTPUTS ! -! Programmer: M.S. Breitenfeld -! February 22, 2008 +! hdferr - error code +! Success: 0 +! Failure: -1 ! -! Modifications: +! AUTHOR +! M. Scot Breitenfeld +! February 22, 2008 ! -! Comment: -!---------------------------------------------------------------------- - +! Fortran90 Interface: SUBROUTINE h5pget_obj_track_times_f(plist_id, flag, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist_id ! Dataset creation property - ! list identifier + INTEGER(HID_T), INTENT(IN) :: plist_id ! Dataset creation property + ! list identifier LOGICAL, INTENT(OUT) :: flag ! Object timestamp setting INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** INTEGER :: status ! ! MS FORTRAN needs explicit interface for C functions called here. @@ -5909,7 +5131,7 @@ !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(HID_T), INTENT(IN) :: plist_id ! File creation property list identifier INTEGER, INTENT(OUT) :: status END FUNCTION h5pget_obj_track_times_c END INTERFACE @@ -5919,50 +5141,52 @@ END SUBROUTINE h5pget_obj_track_times_f -!---------------------------------------------------------------------- -! Name: H5Pset_obj_track_times_f -! -! Purpose: Set whether the birth, access, modification & change times for -! an object are stored. -! -! Birth time is the time the object was created. Access time is -! the last time that metadata or raw data was read from this -! object. Modification time is the last time the data for -! this object was changed (either writing raw data to a dataset -! or inserting/modifying/deleting a link in a group). Change -! time is the last time the metadata for this object was written -! (adding/modifying/deleting an attribute on an object, extending -! the size of a dataset, etc). -! -! If these times are not tracked, they will be reported as -! 12:00 AM UDT, Jan. 1, 1970 (i.e. 0 seconds past the UNIX -! epoch) when queried. -! -! Inputs: -! plist_id - property list id -! flag - object timestamp setting -! .TRUE.,.FALSE. -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: M.S. Breitenfeld -! February 22, 2008 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - +!****s* H5P/H5Pset_obj_track_times_f +! NAME +! H5Pset_obj_track_times_f +! +! PURPOSE +! Set whether the birth, access, modification & change times for +! an object are stored. +! +! Birth time is the time the object was created. Access time is +! the last time that metadata or raw data was read from this +! object. Modification time is the last time the data for +! this object was changed (either writing raw data to a dataset +! or inserting/modifying/deleting a link in a group). Change +! time is the last time the metadata for this object was written +! (adding/modifying/deleting an attribute on an object, extending +! the size of a dataset, etc). +! +! If these times are not tracked, they will be reported as +! 12:00 AM UDT, Jan. 1, 1970 (i.e. 0 seconds past the UNIX +! epoch) when queried. +! +! INPUTS +! +! plist_id - property list id +! flag - object timestamp setting +! .TRUE.,.FALSE. +! OUTPUTS +! +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! M. Scot Breitenfeld +! February 22, 2008 +! +! +! Fortran90 Interface: SUBROUTINE h5pset_obj_track_times_f(plist_id, flag, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: plist_id ! Dataset creation property ! list identifier LOGICAL, INTENT(IN) :: flag ! Object timestamp setting INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** INTEGER :: status ! ! MS FORTRAN needs explicit interface for C functions called here. @@ -5973,7 +5197,7 @@ !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(HID_T), INTENT(IN) :: plist_id ! File creation property list identifier INTEGER, INTENT(IN) :: status END FUNCTION h5pset_obj_track_times_c END INTERFACE @@ -5985,38 +5209,41 @@ END SUBROUTINE h5pset_obj_track_times_f -!---------------------------------------------------------------------- -! Name: H5Pset_create_inter_group_f +!****s* H5P/H5Pset_create_inter_group_f +! NAME +! H5Pset_create_inter_group_f ! -! Purpose: Specifies in property list whether to create missing intermediate groups. +! PURPOSE +! Specifies in property list whether to create missing intermediate groups. ! -! Inputs: -! lcpl_id - Link creation property list identifier -! crt_intermed_group - crt_intermed_group specifying whether -! to create intermediate groups upon the creation -! of an object -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! INPUTS +! +! lcpl_id - Link creation property list identifier +! crt_intermed_group - crt_intermed_group specifying whether +! to create intermediate groups upon the creation +! of an object +! OUTPUTS ! -! Programmer: M.S. Breitenfeld -! February 22, 2008 +! hdferr - Error code +! Success: 0 +! Failure: -1 ! -! Modifications: +! AUTHOR +! M. Scot Breitenfeld +! February 22, 2008 ! -! Comment: The long subroutine name (>31) on older f90 compilers causes problems +! HISTORY +! The long subroutine name (>31) on older f90 compilers causes problems ! so had to shorten the name -!-------------------------------------------------------------------------------------- - +! Fortran90 Interface: SUBROUTINE h5pset_create_inter_group_f(lcpl_id, crt_intermed_group, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: lcpl_id ! Link creation property list identifier + INTEGER(HID_T), INTENT(IN) :: lcpl_id ! Link creation property list identifier INTEGER, INTENT(IN) :: crt_intermed_group ! specifying whether to create intermediate groups ! upon the creation of an object INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** ! ! MS FORTRAN needs explicit interface for C functions called here. ! @@ -6035,35 +5262,36 @@ END SUBROUTINE h5pset_create_inter_group_f -!---------------------------------------------------------------------- -! Name: H5Pget_link_creation_order_f +!****s* H5P/H5Pget_link_creation_order_f +! NAME +! H5Pget_link_creation_order_f ! -! Purpose: Queries whether link creation order is tracked and/or indexed in a group. +! PURPOSE +! Queries whether link creation order is tracked and/or indexed in a group. ! -! Inputs: -! gcpl_id - Group creation property list identifier +! INPUTS ! -! Outputs: -! crt_order_flags - Creation order flag(s) -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! gcpl_id - Group creation property list identifier ! -! Programmer: M.S. Breitenfeld -! March 3, 2008 +! OUTPUTS ! -! Modifications: +! crt_order_flags - Creation order flag(s) +! hdferr - Error code +! Success: 0 +! Failure: -1 ! -! Comment: -!---------------------------------------------------------------------- - +! AUTHOR +! M. Scot Breitenfeld +! March 3, 2008 +! +! Fortran90 Interface: SUBROUTINE h5pget_link_creation_order_f(gcpl_id, crt_order_flags, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: gcpl_id ! Group creation property list identifier INTEGER, INTENT(OUT) :: crt_order_flags ! Creation order flag(s) INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** ! ! MS FORTRAN needs explicit interface for C functions called here. ! @@ -6084,40 +5312,39 @@ END SUBROUTINE h5pget_link_creation_order_f -!---------------------------------------------------------------------- -! Name: H5Pset_char_encoding +!****s* H5P/H5Pset_char_encoding_f +! NAME +! H5Pset_char_encoding_f ! -! Purpose: Sets the character encoding used to encode a string. +! PURPOSE +! Sets the character encoding used to encode a string. ! -! Inputs: -! plist_id - Property list identifier -! encoding - Valid values for encoding are: -! H5T_CSET_ASCII_F -> US ASCII -! H5T_CSET_UTF8_F -> UTF-8 Unicode encoding +! INPUTS ! -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! plist_id - Property list identifier +! encoding - Valid values for encoding are: +! H5T_CSET_ASCII_F -> US ASCII +! H5T_CSET_UTF8_F -> UTF-8 Unicode encoding ! -! Programmer: M.S. Breitenfeld -! March 3, 2008 +! OUTPUTS +! hdferr - Error code +! Success: 0 +! Failure: -1 ! -! Modifications: +! AUTHOR +! M. Scot Breitenfeld +! March 3, 2008 ! -! Comment: -!---------------------------------------------------------------------- - +! Fortran90 Interface: SUBROUTINE h5pset_char_encoding_f(plist_id, encoding, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: plist_id ! Property list identifier - - INTEGER, INTENT(IN) :: encoding ! String encoding character set: -! H5T_CSET_ASCII_F -> US ASCII -! H5T_CSET_UTF8_F -> UTF-8 Unicode encoding - INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER, INTENT(IN) :: encoding ! String encoding character set: + ! H5T_CSET_ASCII_F -> US ASCII + ! H5T_CSET_UTF8_F -> UTF-8 Unicode encoding + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** ! ! MS FORTRAN needs explicit interface for C functions called here. ! @@ -6138,40 +5365,41 @@ END SUBROUTINE h5pset_char_encoding_f -!---------------------------------------------------------------------- -! Name: H5Pget_char_encoding +!****s* H5P/H5Pget_char_encoding_f +! NAME +! H5Pget_char_encoding_f ! -! Purpose: Retrieves the character encoding used to create a string +! PURPOSE +! Retrieves the character encoding used to create a string ! -! Inputs: -! plist_id - Property list identifier +! INPUTS ! -! Outputs: -! encoding - Valid values for encoding are: -! H5T_CSET_ASCII_F -> US ASCII -! H5T_CSET_UTF8_F -> UTF-8 Unicode encoding -! hdferr - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! plist_id - Property list identifier ! -! Programmer: M.S. Breitenfeld -! March 3, 2008 +! OUTPUTS ! -! Modifications: +! encoding - Valid values for encoding are: +! H5T_CSET_ASCII_F -> US ASCII +! H5T_CSET_UTF8_F -> UTF-8 Unicode encoding +! hdferr - Error code +! Success: 0 +! Failure: -1 ! -! Comment: -!---------------------------------------------------------------------- - +! AUTHOR +! M. Scot Breitenfeld +! March 3, 2008 +! +! Fortran90 Interface: SUBROUTINE h5pget_char_encoding_f(plist_id, encoding, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: plist_id ! Property list identifier - INTEGER, INTENT(OUT) :: encoding ! Valid values for encoding are: -! H5T_CSET_ASCII_F -> US ASCII -! H5T_CSET_UTF8_F -> UTF-8 Unicode encoding + INTEGER, INTENT(OUT) :: encoding ! Valid values for encoding are: + ! H5T_CSET_ASCII_F -> US ASCII + ! H5T_CSET_UTF8_F -> UTF-8 Unicode encoding INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** ! ! MS FORTRAN needs explicit interface for C functions called here. ! @@ -6192,29 +5420,31 @@ END SUBROUTINE h5pget_char_encoding_f -!---------------------------------------------------------------------- -! Name: h5pset_copy_object_f +!****s* H5P/h5pset_copy_object_f +! NAME +! h5pset_copy_object_f ! -! Purpose: Sets properties to be used when an object is copied. +! PURPOSE +! Sets properties to be used when an object is copied. ! -! Inputs: -! ocp_plist_id - Object copy property list identifier -! copy_options - Copy option(s) to be set -! Outputs: -! hdferr - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! INPUTS +! +! ocp_plist_id - Object copy property list identifier +! copy_options - Copy option(s) to be set +! OUTPUTS +! +! hdferr - error code +! Success: 0 +! Failure: -1 ! -! Programmer: M.S. Breitenfeld -! March 3, 2008 +! AUTHOR +! M. Scot Breitenfeld +! March 3, 2008 ! -! Modifications: +! HISTORY ! -! Comment: -!---------------------------------------------------------------------- - +! +! Fortran90 Interface: SUBROUTINE h5pset_copy_object_f(ocp_plist_id, copy_options, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: ocp_plist_id ! Object copy property list identifier @@ -6226,6 +5456,7 @@ ! H5O_COPY_WITHOUT_ATTR_FLAG_F INTEGER, INTENT(OUT) :: hdferr ! Error code ! 0 on success and -1 on failure +!***** ! MS FORTRAN needs explicit interface for C functions called here. ! @@ -6242,39 +5473,43 @@ hdferr = h5pset_copy_object_c(ocp_plist_id, copy_options) END SUBROUTINE h5pset_copy_object_f -!---------------------------------------------------------------------- -! Name: h5pget_copy_object_f +!****s* H5P/h5pget_copy_object_f +! NAME +! h5pget_copy_object_f ! -! Purpose: Retrieves the properties to be used when an object is copied. +! PURPOSE +! Retrieves the properties to be used when an object is copied. ! -! Inputs: -! ocp_plist_id - Object copy property list identifier -! Outputs: -! copy_options - Copy option(s) to be get -! hdferr - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! INPUTS +! +! ocp_plist_id - Object copy property list identifier +! OUTPUTS +! +! copy_options - Copy option(s) to be get +! hdferr - Error code +! Success: 0 +! Failure: -1 ! -! Programmer: M.S. Breitenfeld -! March 3, 2008 +! AUTHOR +! M. Scot Breitenfeld +! March 3, 2008 ! -! Modifications: +! HISTORY ! -! Comment: -!---------------------------------------------------------------------- - +! +! Fortran90 Interface: SUBROUTINE h5pget_copy_object_f(ocp_plist_id, copy_options, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: ocp_plist_id ! Object copy property list identifier - INTEGER, INTENT(OUT) :: copy_options ! valid copy options returned are: - ! H5O_COPY_SHALLOW_HIERARCHY_F - ! H5O_COPY_EXPAND_SOFT_LINK_F - ! H5O_COPY_EXPAND_EXT_LINK_F - ! H5O_COPY_EXPAND_REFERENCE_F - ! H5O_COPY_WITHOUT_ATTR_FLAG_F - INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER, INTENT(OUT) :: copy_options ! Valid copy options returned are: + ! H5O_COPY_SHALLOW_HIERARCHY_F + ! H5O_COPY_EXPAND_SOFT_LINK_F + ! H5O_COPY_EXPAND_EXT_LINK_F + ! H5O_COPY_EXPAND_REFERENCE_F + ! H5O_COPY_WITHOUT_ATTR_FLAG_F + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** ! MS FORTRAN needs explicit interface for C functions called here. ! @@ -6291,41 +5526,43 @@ hdferr = h5pget_copy_object_c(ocp_plist_id, copy_options) END SUBROUTINE h5pget_copy_object_f -!---------------------------------------------------------------------- -! Name: h5pget_data_transform_f -! -! Purpose: Retrieves a data transform expression. -! -! Inputs: -! plist_id - Identifier of the property list or class -! Outputs: -! expression - buffer to hold transform expression -! hdferr - error code -! Success: Actual lenght of the expression -! If provided buffer "expression" is -! smaller, than expression will be -! truncated to fit into -! provided user buffer -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: M.S. Breitenfeld -! March 19, 2008 -! -! Modifications: -! -! Comment: Should hdferr return just 0 or 1 and add another arguement for the size? -!---------------------------------------------------------------------- - - SUBROUTINE h5pget_data_transform_f(plist_id, expression, hdferr, size) +!****s* H5P/h5pget_data_transform_f +! NAME +! h5pget_data_transform_f +! +! PURPOSE +! Retrieves a data transform expression. +! +! INPUTS +! +! plist_id - Identifier of the property list or class +! OUTPUTS +! +! expression - buffer to hold transform expression +! hdferr - Error code +! Success: Actual lenght of the expression +! If provided buffer "expression" is +! smaller, than expression will be +! truncated to fit into +! provided user buffer +! Failure: -1 +! +! AUTHOR +! M. Scot Breitenfeld +! March 19, 2008 +! +! HISTORY +! +! Should hdferr return just 0 or 1 and add another arguement for the size? +! Fortran90 Interface: +SUBROUTINE h5pget_data_transform_f(plist_id, expression, hdferr, size) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist_id ! Identifier of the property list or class - CHARACTER(LEN=*), INTENT(OUT) :: expression ! Buffer to hold transform expression - - INTEGER(SIZE_T), INTENT(OUT), OPTIONAL :: size ! registered size of the transform expression - - INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), INTENT(IN) :: plist_id ! Identifier of the property list or class + CHARACTER(LEN=*), INTENT(OUT) :: expression ! Buffer to hold transform expression + INTEGER(SIZE_T), INTENT(OUT), OPTIONAL :: size ! Registered size of the transform expression + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** INTEGER :: expression_len INTEGER(SIZE_T) :: size_default @@ -6339,8 +5576,8 @@ !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 + INTEGER(HID_T), INTENT(IN) :: plist_id + CHARACTER(LEN=*), INTENT(OUT) :: expression INTEGER(SIZE_T) :: size_default INTEGER :: expression_len END FUNCTION h5pget_data_transform_c @@ -6355,34 +5592,35 @@ END SUBROUTINE h5pget_data_transform_f -!---------------------------------------------------------------------- -! Name: h5pset_data_transform_f +!****s* H5P/h5pset_data_transform_f +! NAME +! h5pset_data_transform_f ! -! Purpose: Sets a data transform expression. +! PURPOSE +! Sets a data transform expression. ! -! Inputs: -! plist_id - Identifier of the property list or class -! expression - buffer to hold transform expression -! Outputs: -! hdferr - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! INPUTS +! +! plist_id - Identifier of the property list or class +! expression - Buffer to hold transform expression +! OUTPUTS +! +! hdferr - error code +! Success: 0 +! Failure: -1 ! -! Programmer: M.S. Breitenfeld -! March 19, 2008 +! AUTHOR +! M. Scot Breitenfeld +! March 19, 2008 ! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - +! Fortran90 Interface: SUBROUTINE h5pset_data_transform_f(plist_id, expression, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist_id ! Identifier of the property list or class - CHARACTER(LEN=*), INTENT(IN) :: expression ! Buffer to hold transform expression - INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), INTENT(IN) :: plist_id ! Identifier of the property list or class + CHARACTER(LEN=*), INTENT(IN) :: expression ! Buffer to hold transform expression + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** INTEGER :: expression_len ! MS FORTRAN needs explicit interface for C functions called here. @@ -6394,7 +5632,7 @@ !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 + INTEGER(HID_T), INTENT(IN) :: plist_id CHARACTER(LEN=*), INTENT(IN) :: expression INTEGER :: expression_len END FUNCTION h5pset_data_transform_c @@ -6405,34 +5643,35 @@ END SUBROUTINE h5pset_data_transform_f -!---------------------------------------------------------------------- -! Name: H5Pget_local_heap_size_hint_f +!****s* H5P/H5Pget_local_heap_size_hint_f +! NAME +! H5Pget_local_heap_size_hint_f ! -! Purpose: Queries the local heap size hint for original-style groups. +! PURPOSE +! Queries the local heap size hint for original-style groups. ! -! Inputs: -! gcpl_id - Group creation property list identifier -! Outputs: -! size_hint - Hint for size of local heap -! hdferr - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! INPUTS +! +! gcpl_id - Group creation property list identifier +! OUTPUTS ! -! Programmer: M.S. Breitenfeld -! March 21, 2008 +! size_hint - Hint for size of local heap +! hdferr - Error code +! Success: 0 +! Failure: -1 ! -! Modifications: +! AUTHOR +! M. Scot Breitenfeld +! March 21, 2008 ! -! Comment: -!---------------------------------------------------------------------- - +! Fortran90 Interface: SUBROUTINE h5pget_local_heap_size_hint_f(gcpl_id, size_hint, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: gcpl_id ! Group creation property list identifier + INTEGER(HID_T), INTENT(IN) :: gcpl_id ! Group creation property list identifier INTEGER(SIZE_T), INTENT(OUT) :: size_hint ! Hint for size of local heap - INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** ! MS FORTRAN needs explicit interface for C functions called here. ! @@ -6451,36 +5690,40 @@ END SUBROUTINE h5pget_local_heap_size_hint_f -!---------------------------------------------------------------------- -! Name: H5Pget_est_link_info_f +!****s* H5P/H5Pget_est_link_info_f +! NAME +! H5Pget_est_link_info_f ! -! Purpose: Queries data required to estimate required local heap or object header size. +! PURPOSE +! Queries data required to estimate required local heap or object header size. ! -! Inputs: -! gcpl_id - Group creation property list identifier -! Outputs: -! est_num_entries - Estimated number of links to be inserted into group -! est_name_len - Estimated average length of link names -! hdferr - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! INPUTS +! +! gcpl_id - Group creation property list identifier +! OUTPUTS +! +! est_num_entries - Estimated number of links to be inserted into group +! est_name_len - Estimated average length of link names +! hdferr - Error code +! Success: 0 +! Failure: -1 ! -! Programmer: M.S. Breitenfeld -! March 21, 2008 +! AUTHOR +! M. Scot Breitenfeld +! March 21, 2008 ! -! Modifications: +! HISTORY ! -! Comment: -!---------------------------------------------------------------------- - +! +! Fortran90 Interface: SUBROUTINE h5pget_est_link_info_f(gcpl_id, est_num_entries, est_name_len, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: gcpl_id ! Group creation property list identifier + INTEGER(HID_T), INTENT(IN) :: gcpl_id ! Group creation property list identifier INTEGER, INTENT(OUT) :: est_num_entries ! Estimated number of links to be inserted into group INTEGER, INTENT(OUT) :: est_name_len ! Estimated average length of link names - INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** ! MS FORTRAN needs explicit interface for C functions called here. ! @@ -6490,7 +5733,7 @@ !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(HID_T), INTENT(IN) :: gcpl_id INTEGER, INTENT(OUT) :: est_num_entries INTEGER, INTENT(OUT) :: est_name_len END FUNCTION h5pget_est_link_info_c @@ -6500,34 +5743,35 @@ END SUBROUTINE h5pget_est_link_info_f -!---------------------------------------------------------------------- -! Name: H5Pset_local_heap_size_hint_f +!****s* H5P/H5Pset_local_heap_size_hint_f +! NAME +! H5Pset_local_heap_size_hint_f ! -! Purpose: Sets the local heap size hint for original-style groups. +! PURPOSE +! Sets the local heap size hint for original-style groups. ! -! Inputs: -! gcpl_id - Group creation property list identifier -! size_hint - Hint for size of local heap -! Outputs: -! hdferr - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! INPUTS +! +! gcpl_id - Group creation property list identifier +! size_hint - Hint for size of local heap +! OUTPUTS ! -! Programmer: M.S. Breitenfeld -! March 21, 2008 +! hdferr - Error code +! Success: 0 +! Failure: -1 ! -! Modifications: +! AUTHOR +! M. Scot Breitenfeld +! March 21, 2008 ! -! Comment: -!---------------------------------------------------------------------- - +! Fortran90 Interface: SUBROUTINE h5pset_local_heap_size_hint_f(gcpl_id, size_hint, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: gcpl_id ! Group creation property list identifier + INTEGER(HID_T), INTENT(IN) :: gcpl_id ! Group creation property list identifier INTEGER(SIZE_T), INTENT(IN) :: size_hint ! Hint for size of local heap - INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** ! MS FORTRAN needs explicit interface for C functions called here. ! @@ -6546,36 +5790,37 @@ END SUBROUTINE h5pset_local_heap_size_hint_f -!---------------------------------------------------------------------- -! Name: h5pset_est_link_info_f +!****s* H5P/h5pset_est_link_info_f +! NAME +! h5pset_est_link_info_f ! -! Purpose: Sets estimated number of links and length of link names in a group. +! PURPOSE +! Sets estimated number of links and length of link names in a group. ! -! Inputs: -! gcpl_id - Group creation property list identifier -! est_num_entries - Estimated number of links to be inserted into group -! est_name_len - Estimated average length of link names -! Outputs: -! hdferr - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! INPUTS +! +! gcpl_id - Group creation property list identifier +! est_num_entries - Estimated number of links to be inserted into group +! est_name_len - Estimated average length of link names +! OUTPUTS ! -! Programmer: M.S. Breitenfeld -! March 21, 2008 +! hdferr - Error code +! Success: 0 +! Failure: -1 ! -! Modifications: +! AUTHOR +! M. Scot Breitenfeld +! March 21, 2008 ! -! Comment: -!---------------------------------------------------------------------- - +! Fortran90 Interface: SUBROUTINE h5pset_est_link_info_f(gcpl_id, est_num_entries, est_name_len, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: gcpl_id ! Group creation property list identifier + INTEGER(HID_T), INTENT(IN) :: gcpl_id ! Group creation property list identifier INTEGER, INTENT(IN) :: est_num_entries ! Estimated number of links to be inserted into group INTEGER, INTENT(IN) :: est_name_len ! Estimated average length of link names - INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** ! MS FORTRAN needs explicit interface for C functions called here. ! @@ -6585,7 +5830,7 @@ !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(HID_T), INTENT(IN) :: gcpl_id INTEGER, INTENT(IN) :: est_num_entries INTEGER, INTENT(IN) :: est_name_len END FUNCTION h5pset_est_link_info_c @@ -6595,36 +5840,37 @@ END SUBROUTINE h5pset_est_link_info_f -!---------------------------------------------------------------------- -! Name: h5pset_link_phase_change_f +!****s* H5P/h5pset_link_phase_change_f +! NAME +! h5pset_link_phase_change_f ! -! Purpose: Sets the parameters for conversion between compact and dense groups. +! PURPOSE +! Sets the parameters for conversion between compact and dense groups. ! -! Inputs: -! gcpl_id - Group creation property list identifier -! max_compact - Maximum number of attributes to be stored in compact storage -! min_dense - Minimum number of attributes to be stored in dense storage -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! INPUTS +! +! gcpl_id - Group creation property list identifier +! max_compact - Maximum number of attributes to be stored in compact storage +! min_dense - Minimum number of attributes to be stored in dense storage +! OUTPUTS ! -! Programmer: M.S. Breitenfeld -! March 21, 2008 +! hdferr - error code +! Success: 0 +! Failure: -1 ! -! Modifications: +! AUTHOR +! M. Scot Breitenfeld +! March 21, 2008 ! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pset_link_phase_change_f(gcpl_id, max_compact, min_dense, hdferr) +! Fortran90 Interface: +SUBROUTINE h5pset_link_phase_change_f(gcpl_id, max_compact, min_dense, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: gcpl_id ! Group creation property list identifier - INTEGER, INTENT(IN) :: max_compact ! Maximum number of attributes to be stored in compact storage - INTEGER, INTENT(IN) :: min_dense ! Minimum number of attributes to be stored in dense storage - INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER, INTENT(IN) :: max_compact ! Maximum number of attributes to be stored in compact storage + INTEGER, INTENT(IN) :: min_dense ! Minimum number of attributes to be stored in dense storage + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** ! ! MS FORTRAN needs explicit interface for C functions called here. ! @@ -6644,38 +5890,39 @@ hdferr = h5pset_link_phase_change_c(gcpl_id, max_compact, min_dense) END SUBROUTINE h5pset_link_phase_change_f -!---------------------------------------------------------------------- -! Name: h5pset_fapl_direct_f -! -! Purpose: Sets up use of the direct I/O driver. -! -! Inputs: -! fapl_id - File access property list identifier -! alignment - Required memory alignment boundary -! block_size - File system block size -! cbuf_size - Copy buffer size -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: M.S. Breitenfeld -! March 21, 2008 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pset_fapl_direct_f(fapl_id, alignment, block_size, cbuf_size, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: fapl_id ! File access property list identifier - INTEGER(SIZE_T), INTENT(IN) :: alignment ! Required memory alignment boundary! - INTEGER(SIZE_T), INTENT(IN) :: block_size ! File system block size - INTEGER(SIZE_T), INTENT(IN) :: cbuf_size ! Copy buffer size - INTEGER, INTENT(OUT) :: hdferr ! Error code +!****s* H5P/h5pset_fapl_direct_f +! NAME +! h5pset_fapl_direct_f +! +! PURPOSE +! Sets up use of the direct I/O driver. +! +! INPUTS +! +! fapl_id - File access property list identifier +! alignment - Required memory alignment boundary +! block_size - File system block size +! cbuf_size - Copy buffer size +! OUTPUTS +! +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! M. Scot Breitenfeld +! March 21, 2008 +! +! Fortran90 Interface: +SUBROUTINE h5pset_fapl_direct_f(fapl_id, alignment, block_size, cbuf_size, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: fapl_id ! File access property list identifier + INTEGER(SIZE_T), INTENT(IN) :: alignment ! Required memory alignment boundary! + INTEGER(SIZE_T), INTENT(IN) :: block_size ! File system block size + INTEGER(SIZE_T), INTENT(IN) :: cbuf_size ! Copy buffer size + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** ! ! MS FORTRAN needs explicit interface for C functions called here. ! @@ -6685,7 +5932,7 @@ !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(HID_T), INTENT(IN) :: fapl_id INTEGER(SIZE_T), INTENT(IN) :: alignment INTEGER(SIZE_T), INTENT(IN) :: block_size INTEGER(SIZE_T), INTENT(IN) :: cbuf_size @@ -6695,38 +5942,39 @@ hdferr = H5Pset_fapl_direct_c(fapl_id, alignment, block_size, cbuf_size) END SUBROUTINE h5pset_fapl_direct_f -!---------------------------------------------------------------------- -! Name: h5pget_fapl_direct_f +!****s* H5P/h5pget_fapl_direct_f +! NAME +! h5pget_fapl_direct_f ! -! Purpose: Gets up use of the direct I/O driver. +! PURPOSE +! Gets up use of the direct I/O driver. ! -! Inputs: -! fapl_id - File access property list identifier -! Outputs: -! alignment - Required memory alignment boundary -! block_size - File system block size -! cbuf_size - Copy buffer size -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! INPUTS +! +! fapl_id - File access property list identifier +! OUTPUTS ! -! Programmer: M.S. Breitenfeld -! March 21, 2008 +! alignment - Required memory alignment boundary +! block_size - File system block size +! cbuf_size - Copy buffer size +! hdferr - error code +! Success: 0 +! Failure: -1 ! -! Modifications: +! AUTHOR +! M. Scot Breitenfeld +! March 21, 2008 ! -! Comment: -!---------------------------------------------------------------------- - +! Fortran90 Interface: SUBROUTINE h5pget_fapl_direct_f(fapl_id, alignment, block_size, cbuf_size, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: fapl_id ! File access property list identifier - INTEGER(SIZE_T), INTENT(OUT) :: alignment ! Required memory alignment boundary! - INTEGER(SIZE_T), INTENT(OUT) :: block_size ! File system block size - INTEGER(SIZE_T), INTENT(OUT) :: cbuf_size ! Copy buffer size - INTEGER, INTENT(OUT) :: hdferr ! Error code + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: fapl_id ! File access property list identifier + INTEGER(SIZE_T), INTENT(OUT) :: alignment ! Required memory alignment boundary! + INTEGER(SIZE_T), INTENT(OUT) :: block_size ! File system block size + INTEGER(SIZE_T), INTENT(OUT) :: cbuf_size ! Copy buffer size + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** ! ! MS FORTRAN needs explicit interface for C functions called here. ! @@ -6736,7 +5984,7 @@ !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(HID_T), INTENT(IN) :: fapl_id INTEGER(SIZE_T), INTENT(OUT) :: alignment INTEGER(SIZE_T), INTENT(OUT) :: block_size INTEGER(SIZE_T), INTENT(OUT) :: cbuf_size @@ -6746,40 +5994,41 @@ hdferr = H5Pget_fapl_direct_c(fapl_id, alignment, block_size, cbuf_size) END SUBROUTINE h5pget_fapl_direct_f -!---------------------------------------------------------------------- -! Name: H5Pset_attr_phase_change_f -! -! Purpose: Sets attribute storage phase change thresholds. -! -! Inputs: -! ocpl_id - Object (dataset or group) creation property list identifier -! Outputs: -! max_compact - Maximum number of attributes to be stored in compact storage -! (Default: 8) -! min_dense - Minimum number of attributes to be stored in dense storage -! (Default: 6) -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: M.S. Breitenfeld -! January, 2008 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5pset_attr_phase_change_f(ocpl_id, max_compact, min_dense, hdferr) +!****s* H5P/H5Pset_attr_phase_change_f +! NAME +! H5Pset_attr_phase_change_f +! +! PURPOSE +! Sets attribute storage phase change thresholds. +! +! INPUTS +! +! ocpl_id - Object (dataset or group) creation property list identifier +! OUTPUTS +! +! max_compact - Maximum number of attributes to be stored in compact storage +! (Default: 8) +! min_dense - Minimum number of attributes to be stored in dense storage +! (Default: 6) +! hdferr - Error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! M. Scot Breitenfeld +! January, 2008 +! +! Fortran90 Interface: +SUBROUTINE h5pset_attr_phase_change_f(ocpl_id, max_compact, min_dense, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: ocpl_id ! Object (dataset or group) creation property list identifier - INTEGER, INTENT(IN) :: max_compact ! Maximum number of attributes to be stored in compact storage - !(Default: 8) - INTEGER, INTENT(IN) :: min_dense ! Minimum number of attributes to be stored in dense storage - ! (Default: 6) - INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER, INTENT(IN) :: max_compact ! Maximum number of attributes to be stored in compact storage + !(Default: 8) + INTEGER, INTENT(IN) :: min_dense ! Minimum number of attributes to be stored in dense storage + ! (Default: 6) + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** ! ! MS FORTRAN needs explicit interface for C functions called here. ! @@ -6801,35 +6050,29 @@ END SUBROUTINE h5pset_attr_phase_change_f -!---------------------------------------------------------------------- -! Name: H5Pset_nbit_f +!****s* H5P/H5Pset_nbit_f +! NAME +! H5Pset_nbit_f ! -! Purpose: Sets up the use of the N-Bit filter. +! PURPOSE +! Sets up the use of the N-Bit filter. ! ! Inputs: -! plist_id - Dataset creation property list identifier. -! Outputs: -! hdferr - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! plist_id - Dataset creation property list identifier. ! -! Programmer: M.S. Breitenfeld -! March 21, 2008 +! Outputs: +! hdferr - Returns 0 if successful and -1 if fails ! -! Modifications: +! AUTHOR +! M. Scot Breitenfeld +! March 21, 2008 ! -! Comment: -!---------------------------------------------------------------------- - +! Fortran90 Interface: SUBROUTINE h5pset_nbit_f(plist_id, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist_id ! Dataset creation property list identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! MS FORTRAN needs explicit interface for C functions called here. -! + INTEGER(HID_T), INTENT(IN) :: plist_id + INTEGER , INTENT(OUT) :: hdferr +!***** INTERFACE INTEGER FUNCTION H5Pset_nbit_c(plist_id) USE H5GLOBAL @@ -6844,39 +6087,38 @@ END SUBROUTINE h5pset_nbit_f -!---------------------------------------------------------------------- -! Name: h5pset_scaleoffset_f +!****s* H5P/h5pset_scaleoffset_f +! NAME +! h5pset_scaleoffset_f ! -! Purpose: Sets up the use of the Scale-Offset filter. +! PURPOSE +! Sets up the use of the scale-offset filter. ! ! Inputs: -! plist_id - Dataset creation property list identifier. -! scale_type - Flag indicating compression method. -! scale_factor - Parameter related to scale. -! Outputs: -! hdferr - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! plist_id - Dataset creation property list identifier. +! scale_type - Flag indicating compression method. Valid values: +! H5Z_SO_FLOAT_DSCALE_F +! H5Z_SO_FLOAT_ESCALE_F +! H5Z_SO_INT_F ! -! Programmer: M.S. Breitenfeld -! March 21, 2008 +! scale_factor - Parameter related to scale. ! -! Modifications: +! Outputs: +! hdferr - Returns 0 if successful and -1 if fails ! -! Comment: -!---------------------------------------------------------------------- - +! AUTHOR +! M. Scot Breitenfeld +! March 21, 2008 +! +! Fortran90 Interface: SUBROUTINE h5pset_scaleoffset_f(plist_id, scale_type, scale_factor, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: plist_id ! Dataset creation property list identifier - INTEGER, INTENT(IN) :: scale_type ! Flag indicating compression method. - INTEGER, INTENT(IN) :: scale_factor ! parameter related to scale. - INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), INTENT(IN) :: plist_id + INTEGER , INTENT(IN) :: scale_type + INTEGER , INTENT(IN) :: scale_factor + INTEGER , INTENT(OUT) :: hdferr +!***** -! MS FORTRAN needs explicit interface for C functions called here. -! INTERFACE INTEGER FUNCTION h5pset_scaleoffset_c(plist_id, scale_type, scale_factor) USE H5GLOBAL @@ -6893,35 +6135,39 @@ END SUBROUTINE h5pset_scaleoffset_f -!---------------------------------------------------------------------- -! Name: h5pset_nlinks_f +!****s* H5P/h5pset_nlinks_f +! NAME +! h5pset_nlinks_f ! -! Purpose: Sets maximum number of soft or user-defined link traversals. +! PURPOSE +! Sets maximum number of soft or user-defined link traversals. ! -! Inputs: -! lapl_id - File access property list identifier -! nlinks - Maximum number of links to traverse +! INPUTS +! +! lapl_id - File access property list identifier +! nlinks - Maximum number of links to traverse ! -! Outputs: -! hdferr - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! OUTPUTS ! -! Programmer: M.S. Breitenfeld -! March 24, 2008 +! hdferr - Error code +! Success: 0 +! Failure: -1 ! -! Modifications: +! AUTHOR +! M. Scot Breitenfeld +! March 24, 2008 ! -! Comment: -!---------------------------------------------------------------------- - +! HISTORY +! +! +! Fortran90 Interface: SUBROUTINE h5pset_nlinks_f(lapl_id, nlinks, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: lapl_id ! File access property list identifier INTEGER(SIZE_T), INTENT(IN) :: nlinks ! Maximum number of links to traverse - INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** ! MS FORTRAN needs explicit interface for C functions called here. ! @@ -6940,36 +6186,36 @@ END SUBROUTINE h5pset_nlinks_f -!---------------------------------------------------------------------- -! Name: h5pget_nlinks_f +!****s* H5P/h5pget_nlinks_f +! NAME +! h5pget_nlinks_f ! -! Purpose: Gets maximum number of soft or user-defined link traversals. +! PURPOSE +! Gets maximum number of soft or user-defined link traversals. ! -! Inputs: -! lapl_id - File access property list identifier -! nlinks - Maximum number of links to traverse +! INPUTS +! +! lapl_id - File access property list identifier +! nlinks - Maximum number of links to traverse ! -! Outputs: -! hdferr - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! OUTPUTS ! -! Programmer: M.S. Breitenfeld -! March 24, 2008 +! hdferr - error code +! Success: 0 +! Failure: -1 ! -! Modifications: +! AUTHOR +! M. Scot Breitenfeld +! March 24, 2008 ! -! Comment: -!---------------------------------------------------------------------- - +! Fortran90 Interface: SUBROUTINE h5pget_nlinks_f(lapl_id, nlinks, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: lapl_id ! File access property list identifier + INTEGER(HID_T), INTENT(IN) :: lapl_id ! File access property list identifier INTEGER(SIZE_T), INTENT(OUT) :: nlinks ! Maximum number of links to traverse - INTEGER, INTENT(OUT) :: hdferr ! Error code - + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** ! MS FORTRAN needs explicit interface for C functions called here. ! INTERFACE @@ -6987,38 +6233,41 @@ END SUBROUTINE h5pget_nlinks_f -!---------------------------------------------------------------------- -! Name: H5Pget_create_inter_group_f -! -! Purpose: Determines whether property is set to enable creating missing intermediate groups. -! -! Inputs: -! lcpl_id - Link creation property list identifier -! crt_intermed_group - Specifying whether to create intermediate groups upon -! the creation of an object -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: M.S. Breitenfeld -! April 4, 2008 -! -! Modifications: -! -! Comment: The long subroutine name (>31) on older f90 compilers causes problems -! so had to shorten the name -!-------------------------------------------------------------------------------------- - +!****s* H5P/H5Pget_create_inter_group_f +! NAME +! H5Pget_create_inter_group_f +! +! PURPOSE +! Determines whether property is set to enable creating missing intermediate groups. +! +! INPUTS +! +! lcpl_id - Link creation property list identifier +! crt_intermed_group - Specifying whether to create intermediate groups upon +! the creation of an object +! OUTPUTS +! +! hdferr - Error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! M. Scot Breitenfeld +! April 4, 2008 +! +! HISTORY +! +! The long subroutine name (>31) on older f90 compilers causes problems +! so the name was shortened +! Fortran90 Interface: SUBROUTINE h5pget_create_inter_group_f(lcpl_id, crt_intermed_group, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: lcpl_id ! Link creation property list identifier INTEGER, INTENT(IN) :: crt_intermed_group ! Flag specifying whether to create intermediate groups ! upon creation of an object - INTEGER, INTENT(OUT) :: hdferr ! Error code - + INTEGER, INTENT(OUT) :: hdferr ! Error code + ! 0 on success and -1 on failure +!***** INTERFACE INTEGER FUNCTION h5pget_create_inter_group_c(lcpl_id, crt_intermed_group) USE H5GLOBAL @@ -7034,56 +6283,59 @@ 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 - Dataset access property list identifier. -! rdcc_nslots - The number of chunk slots in the raw data chunk cache for this dataset. -! rdcc_nbytes - The total size of the raw data chunk cache for this dataset. -! rdcc_w0 - The chunk preemption policy for this dataset. -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: M.S. Breitenfeld -! April 13, 2009 -! -! Modifications: -!-------------------------------------------------------------------------------------- - +!****s* H5P/H5Pset_chunk_cache_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 - Dataset access property list identifier. +! rdcc_nslots - The number of chunk slots in the raw data chunk cache for this dataset. +! rdcc_nbytes - The total size of the raw data chunk cache for this dataset. +! rdcc_w0 - The chunk preemption policy for this dataset. +! OUTPUTS +! +! hdferr - Error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! M. Scot Breitenfeld +! April 13, 2009 +! +! HISTORY +! +! Fortran90 Interface: SUBROUTINE h5pset_chunk_cache_f(dapl_id, rdcc_nslots, rdcc_nbytes, rdcc_w0, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: dapl_id ! Dataset access property list identifier. - INTEGER(SIZE_T), INTENT(IN) :: rdcc_nslots ! The number of chunk slots in the raw data + INTEGER(SIZE_T), INTENT(IN) :: rdcc_nslots ! The number of chunk slots in the raw data ! chunk cache for this dataset. - INTEGER(SIZE_T), INTENT(IN) :: rdcc_nbytes ! The total size of the raw data chunk cache + INTEGER(SIZE_T), INTENT(IN) :: rdcc_nbytes ! The total size of the raw data chunk cache ! for this dataset. REAL, INTENT(IN) :: rdcc_w0 ! The chunk preemption policy for this dataset. INTEGER, INTENT(OUT) :: hdferr ! Error code ! 0 on success and -1 on failure - +!***** INTERFACE INTEGER FUNCTION h5pset_chunk_cache_c(dapl_id, rdcc_nslots, rdcc_nbytes, rdcc_w0) @@ -7102,43 +6354,47 @@ 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 - Dataset access property list identifier. -! Outputs: -! rdcc_nslots - Number of chunk slots in the raw data chunk cache hash table. -! rdcc_nbytes - Total size of the raw data chunk cache, in bytes. -! rdcc_w0 - Preemption policy. -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: M.S. Breitenfeld -! April 13, 2009 -! -! Modifications: -!-------------------------------------------------------------------------------------- - +!****s* H5P/H5Pget_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 - Dataset access property list identifier. +! OUTPUTS +! +! rdcc_nslots - Number of chunk slots in the raw data chunk cache hash table. +! rdcc_nbytes - Total size of the raw data chunk cache, in bytes. +! rdcc_w0 - Preemption policy. +! hdferr - Error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! M. Scot Breitenfeld +! April 13, 2009 +! +! HISTORY +! +! Fortran90 Interface: SUBROUTINE h5pget_chunk_cache_f(dapl_id, rdcc_nslots, rdcc_nbytes, rdcc_w0, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dapl_id ! Dataset access property list identifier. + INTEGER(HID_T), INTENT(IN) :: dapl_id ! Dataset access property list identifier. INTEGER(SIZE_T), INTENT(OUT) :: rdcc_nslots ! Number of chunk slots in the raw data chunk cache hash table. - INTEGER(SIZE_T), INTENT(OUT) :: rdcc_nbytes ! Total size of the raw data chunk cache, in bytes. - REAL, INTENT(OUT) :: rdcc_w0 ! Preemption policy. - INTEGER, INTENT(OUT) :: hdferr ! error code - + INTEGER(SIZE_T), INTENT(OUT) :: rdcc_nbytes ! Total size of the raw data chunk cache, in bytes. + REAL, INTENT(OUT) :: rdcc_w0 ! Preemption policy. + INTEGER, INTENT(OUT) :: hdferr ! Error code: + ! 0 on success and -1 on failure +!***** INTERFACE INTEGER FUNCTION h5pget_chunk_cache_c(dapl_id, rdcc_nslots, rdcc_nbytes, rdcc_w0) USE H5GLOBAL diff --git a/fortran/src/H5Pff_F03.f90 b/fortran/src/H5Pff_F03.f90 new file mode 100644 index 0000000..b601e69 --- /dev/null +++ b/fortran/src/H5Pff_F03.f90 @@ -0,0 +1,1185 @@ +!****h* ROBODoc/H5P (F03) +! +! NAME +! H5P_PROVISIONAL +! +! PURPOSE +! This file contains Fortran 90 and Fortran 2003 interfaces for H5P functions. +! It contains the same functions as H5Pff_F90.f90 but includes the +! Fortran 2003 functions and the interface listings. This file will be compiled +! instead of H5Pff_F90.f90 if Fortran 2003 functions are enabled. +! +! COPYRIGHT +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +! NOTES +! *** IMPORTANT *** +! If you add a new H5P function you must add the function name to the +! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! This is needed for Windows based operating systems. +! +!***** + +MODULE H5P_PROVISIONAL + + USE H5GLOBAL + + INTERFACE h5pset_fill_value_f + MODULE PROCEDURE h5pset_fill_value_integer + MODULE PROCEDURE h5pset_fill_value_real + MODULE PROCEDURE h5pset_fill_value_char + ! Recommended procedure: + MODULE PROCEDURE h5pset_fill_value_ptr + + END INTERFACE + + INTERFACE h5pget_fill_value_f + MODULE PROCEDURE h5pget_fill_value_integer + MODULE PROCEDURE h5pget_fill_value_real + MODULE PROCEDURE h5pget_fill_value_char + ! Recommended procedure: + MODULE PROCEDURE h5pget_fill_value_ptr + + END INTERFACE + + INTERFACE h5pset_f + MODULE PROCEDURE h5pset_integer + MODULE PROCEDURE h5pset_real + MODULE PROCEDURE h5pset_char + ! Recommended procedure: + MODULE PROCEDURE h5pset_ptr + + END INTERFACE + + INTERFACE h5pget_f + MODULE PROCEDURE h5pget_integer + MODULE PROCEDURE h5pget_real + MODULE PROCEDURE h5pget_char + ! Recommended procedure: + MODULE PROCEDURE h5pget_ptr + END INTERFACE + + INTERFACE h5pregister_f + MODULE PROCEDURE h5pregister_integer + MODULE PROCEDURE h5pregister_real + MODULE PROCEDURE h5pregister_char + ! Recommended procedure: + MODULE PROCEDURE h5pregister_ptr + END INTERFACE + + INTERFACE h5pinsert_f + MODULE PROCEDURE h5pinsert_integer + MODULE PROCEDURE h5pinsert_real + MODULE PROCEDURE h5pinsert_char + ! Recommended procedure: + MODULE PROCEDURE h5pinsert_ptr + END INTERFACE + + INTERFACE + INTEGER FUNCTION h5pget_fill_value_c(prp_id, type_id, fillvalue) + USE H5GLOBAL + USE, INTRINSIC :: ISO_C_BINDING + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_FILL_VALUE_C'::h5pget_fill_value_c + !DEC$ENDIF + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier of + ! of fillvalue datatype + ! (in memory) + TYPE(C_PTR), VALUE :: fillvalue ! Fillvalue + END FUNCTION h5pget_fill_value_c + END INTERFACE + + INTERFACE + INTEGER FUNCTION h5pset_fill_value_c(prp_id, type_id, fillvalue) + USE H5GLOBAL + USE, INTRINSIC :: ISO_C_BINDING + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_FILL_VALUE_C'::h5pset_fill_value_c + !DEC$ENDIF + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier of + ! of fillvalue datatype + ! (in memory) + TYPE(C_PTR), VALUE :: fillvalue ! Fillvalue + END FUNCTION h5pset_fill_value_c + END INTERFACE + + INTERFACE + INTEGER FUNCTION h5pset_c(prp_id, name, name_len, value) + USE H5GLOBAL + USE, INTRINSIC :: ISO_C_BINDING + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PSET_C'::h5pset_c + !DEC$ENDIF + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to modify + INTEGER :: name_len + TYPE(C_PTR), VALUE :: value ! Property value + END FUNCTION h5pset_c + END INTERFACE + + INTERFACE + INTEGER FUNCTION h5pget_c(prp_id, name, name_len, value) + USE, INTRINSIC :: ISO_C_BINDING + USE H5GLOBAL + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PGET_C'::h5pget_c + !DEC$ENDIF + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to modify + INTEGER :: name_len + TYPE(C_PTR), VALUE :: value ! Property value + END FUNCTION h5pget_c + END INTERFACE + + INTERFACE + INTEGER FUNCTION h5pregister_c(class, name, name_len, size, value) + USE iso_c_binding + USE H5GLOBAL + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PREGISTER_C'::h5pregister_c + !DEC$ENDIF + !DEC$ATTRIBUTES reference :: name + INTEGER(HID_T), INTENT(IN) :: class + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER, INTENT(IN) :: name_len + INTEGER(SIZE_T), INTENT(IN) :: size + TYPE(C_PTR), INTENT(IN), VALUE :: value + END FUNCTION h5pregister_c + END INTERFACE + + INTERFACE + INTEGER FUNCTION h5pinsert_c(plist, name, name_len, size, value) + USE iso_c_binding + USE H5GLOBAL + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5PINSERT_C'::h5pinsert_c + !DEC$ENDIF + !DEC$ATTRIBUTES reference :: name + INTEGER(HID_T), INTENT(IN) :: plist + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER, INTENT(IN) :: name_len + INTEGER(SIZE_T), INTENT(IN) :: size + TYPE(c_ptr), INTENT(IN), value :: value + END FUNCTION h5pinsert_c + END INTERFACE + +CONTAINS + +! +!****s* H5P (F03)/h5pset_fill_value_f_F90 +! +! NAME +! h5pset_fill_value_f +! +! PURPOSE +! Sets fill value for a dataset creation property list +! +! Inputs: +! prp_id - Property list identifier +! type_id - Datatype identifier of fill value datatype (in memory) +! fillvalue - Fillvalue +! +! Outputs: +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Added the recommended way of passing fillvalue +! and that is by passing the C address, all other +! ways are obsolete and should be avoided. June, 2008 MSB +! +! NOTES +! h5pset(get)fill_value_f function is overloaded to support +! INTEGER, REAL, DOUBLE PRECISION and CHARACTER dtatypes. +! +! Fortran90 Interface: +!! SUBROUTINE h5pset_fill_value_f(prp_id, type_id, fillvalue, hdferr) +!! IMPLICIT NONE +!! INTEGER(HID_T), INTENT(IN) :: prp_id +!! INTEGER(HID_T), INTENT(IN) :: type_id +!! TYPE(VOID) , INTENT(IN) :: fillvalue +!! INTEGER , INTENT(OUT) :: hdferr +!***** + + + SUBROUTINE h5pset_fill_value_integer(prp_id, type_id, fillvalue, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier of + ! of fillvalue datatype + ! (in memory) + INTEGER, INTENT(IN), TARGET :: fillvalue ! Fillvalue + INTEGER, INTENT(OUT) :: hdferr ! Error code + TYPE(C_PTR) :: f_ptr ! C address + + f_ptr = C_LOC(fillvalue) + + hdferr = h5pset_fill_value_c(prp_id, type_id, f_ptr) + + END SUBROUTINE h5pset_fill_value_integer +! +!****s* H5P (F03)/h5pget_fill_value_f_F90 +! +! NAME +! h5pget_fill_value_f +! +! PURPOSE +! Gets fill value for a dataset creation property list +! +! Inputs: +! prp_id - Property list identifier +! type_id - Datatype identifier of fill value datatype (in memory) +! +! Outputs: +! fillvalue - Fillvalue +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Added the recommended way of passing fillvalue +! and that is by passing the C address, all other +! ways are obsolete and should be avoided. June, 2008 MSB +! +! NOTES +! h5pget(get)fill_value_f function is overloaded to support +! INTEGER, REAL, DOUBLE PRECISION and CHARACTER dtatypes. +! +! Fortran90 Interface: +!! SUBROUTINE h5pget_fill_value_f(prp_id, type_id, fillvalue, hdferr) +!! INTEGER(HID_T), INTENT(IN) :: prp_id +!! INTEGER(HID_T), INTENT(IN) :: type_id +!! TYPE(VOID) , INTENT(OUT) :: fillvalue +!! INTEGER , INTENT(OUT) :: hdferr +!***** + + SUBROUTINE h5pget_fill_value_integer(prp_id, type_id, fillvalue, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier of + ! of fillvalue datatype + ! (in memory) + INTEGER, INTENT(OUT), TARGET :: fillvalue ! Fillvalue + INTEGER, INTENT(OUT) :: hdferr ! Error code + TYPE(C_PTR) :: f_ptr ! C address + + f_ptr = C_LOC(fillvalue) + + hdferr = h5pget_fill_value_c(prp_id, type_id, f_ptr) + + END SUBROUTINE h5pget_fill_value_integer + + + SUBROUTINE h5pset_fill_value_real(prp_id, type_id, fillvalue, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier of + ! of fillvalue datatype + ! (in memory) + REAL, INTENT(IN), TARGET :: fillvalue ! Fillvalue + INTEGER, INTENT(OUT) :: hdferr ! Error code + TYPE(C_PTR) :: f_ptr ! C address + + f_ptr = C_LOC(fillvalue) + + hdferr = h5pset_fill_value_c(prp_id, type_id, f_ptr) + + END SUBROUTINE h5pset_fill_value_real + + + SUBROUTINE h5pget_fill_value_real(prp_id, type_id, fillvalue, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier of + ! of fillvalue datatype + ! (in memory) + REAL, INTENT(OUT), TARGET :: fillvalue ! Fillvalue + INTEGER, INTENT(OUT) :: hdferr ! Error code + TYPE(C_PTR) :: f_ptr ! C address + + f_ptr = C_LOC(fillvalue) + + hdferr = h5pget_fill_value_c(prp_id, type_id, f_ptr) + + END SUBROUTINE h5pget_fill_value_real + + SUBROUTINE h5pset_fill_value_char(prp_id, type_id, fillvalue, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier of + ! of fillvalue datatype + ! (in memory) + CHARACTER, INTENT(IN), TARGET :: fillvalue ! Fillvalue + INTEGER, INTENT(OUT) :: hdferr ! Error code + TYPE(C_PTR) :: f_ptr ! C address + + f_ptr = C_LOC(fillvalue) + + hdferr = h5pset_fill_value_c(prp_id, type_id, f_ptr) + + END SUBROUTINE h5pset_fill_value_char + + SUBROUTINE h5pget_fill_value_char(prp_id, type_id, fillvalue, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier of + ! of fillvalue datatype + ! (in memory) + CHARACTER, INTENT(OUT) :: fillvalue ! Fillvalue + INTEGER, INTENT(OUT) :: hdferr ! Error code + + INTEGER :: i + CHARACTER(LEN=1), ALLOCATABLE, DIMENSION(:), TARGET :: chr + INTEGER :: chr_len + + TYPE(C_PTR) :: f_ptr ! C address + ! To resolve Issue #1 outlined in the preamble of this file we + ! need to pack the character string into an array. + + chr_len = LEN(fillvalue) + ALLOCATE(chr(1:chr_len), STAT=hdferr) + IF (hdferr .NE. 0) THEN + hdferr = -1 + RETURN + ENDIF + + f_ptr = C_LOC(chr(1)(1:1)) + + hdferr = h5pget_fill_value_c(prp_id, type_id, f_ptr) + + DO i = 1, chr_len + fillvalue(i:i) = chr(i) + ENDDO + DEALLOCATE(chr) + + END SUBROUTINE h5pget_fill_value_char +! +!****s* H5P (F03)/h5pset_fill_value_f_F03 +! +! NAME +! h5pset_fill_value_f +! +! PURPOSE +! Sets fill value for a dataset creation property list +! +! Inputs: +! prp_id - Property list identifier +! type_id - Datatype identifier of fill value datatype (in memory) +! fillvalue - Fillvalue +! +! Outputs: +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Added the recommended way of passing fillvalue +! and that is by passing the C address, all other +! ways are obsolete and should be avoided. June, 2008 MSB +! +! NOTES +! h5pset(get)fill_value_f function is overloaded to support +! INTEGER, REAL, DOUBLE PRECISION and CHARACTER dtatypes. +! +! Fortran2003 Interface: +!! SUBROUTINE h5pset_fill_value_f(prp_id, type_id, fillvalue, hdferr) +!! INTEGER(HID_T), INTENT(IN) :: prp_id +!! INTEGER(HID_T), INTENT(IN) :: type_id +!! TYPE(C_PTR) , INTENT(IN) :: fillvalue +!! INTEGER , INTENT(OUT) :: hdferr +!***** + + SUBROUTINE h5pset_fill_value_ptr(prp_id, type_id, fillvalue, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier of + ! of fillvalue datatype + ! (in memory) + TYPE(C_PTR), INTENT(IN) :: fillvalue ! Fillvalue + INTEGER, INTENT(OUT) :: hdferr ! Error code + + hdferr = h5pset_fill_value_c(prp_id, type_id, fillvalue) + + END SUBROUTINE h5pset_fill_value_ptr + +! +!****s* H5P (F03)/h5pget_fill_value_f_F03 +! +! NAME +! h5pget_fill_value_f +! +! PURPOSE +! Gets fill value for a dataset creation property list +! +! Inputs: +! prp_id - Property list identifier +! type_id - Datatype identifier of fill value datatype (in memory) +! +! Outputs: +! fillvalue - Fillvalue +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! Added the recommended way of passing fillvalue +! and that is by passing the C address, all other +! ways are obsolete and should be avoided. June, 2008 MSB +! +! NOTES +! h5pget(get)fill_value_f function is overloaded to support +! INTEGER, REAL, DOUBLE PRECISION and CHARACTER dtatypes. +! +! Fortran2003 Interface: +!! SUBROUTINE h5pget_fill_value_f(prp_id, type_id, fillvalue, hdferr) +!! INTEGER(HID_T), INTENT(IN) :: prp_id +!! INTEGER(HID_T), INTENT(IN) :: type_id +!! TYPE(C_PTR) , INTENT(OUT) :: fillvalue +!! INTEGER , INTENT(OUT) :: hdferr +!***** + + SUBROUTINE h5pget_fill_value_ptr(prp_id, type_id, fillvalue, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier of + ! of fillvalue datatype + ! (in memory) + TYPE(C_PTR), INTENT(OUT) :: fillvalue ! Fillvalue + INTEGER, INTENT(OUT) :: hdferr ! Error code + + hdferr = h5pget_fill_value_c(prp_id, type_id, fillvalue) + + END SUBROUTINE h5pget_fill_value_ptr + +! +!****s* H5P (F03)/h5pset_f_F90 +! +! NAME +! h5pset_f +! +! PURPOSE +! Sets a property list value +! +! Inputs: +! prp_id - Property list identifier to modify +! name - Name of property to modify +! value - Property value, supported types are: +! INTEGER +! REAL +! DOUBLE PRECISION +! CHARACTER(LEN=*) +! Outputs: +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! October 9, 2002 +! +! Fortran90 Interface: +!! SUBROUTINE h5pset_f(plid, name, value, hdferr) +!! INTEGER(HID_T) , INTENT(IN) :: plid +!! CHARACTER(LEN=*), INTENT(IN) :: name +!! TYPE , INTENT(IN) :: value +!! INTEGER , INTENT(OUT) :: hdferr +!***** + SUBROUTINE h5pset_integer(prp_id, name, value, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to modify + INTEGER, INTENT(IN), TARGET :: value ! Property value + INTEGER, INTENT(OUT) :: hdferr ! Error code + + INTEGER :: name_len + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(value) + + name_len = LEN(name) + hdferr = h5pget_c(prp_id, name, name_len, f_ptr) + + END SUBROUTINE h5pset_integer + + SUBROUTINE h5pset_real(prp_id, name, value, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to modify + REAL, INTENT(IN), TARGET :: value ! Property value + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER :: name_len + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(value) + + name_len = LEN(name) + hdferr = h5pget_c(prp_id, name, name_len, f_ptr) + + END SUBROUTINE h5pset_real + + SUBROUTINE h5pset_char(prp_id, name, value, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to modify + CHARACTER(LEN=*), INTENT(IN) :: value ! Property value + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER :: name_len + + INTEGER :: i + CHARACTER(LEN=1), ALLOCATABLE, DIMENSION(:), TARGET :: chr + INTEGER :: chr_len + + TYPE(C_PTR) :: f_ptr + ! To resolve Issue #1 outlined in the preamble of this file we + ! need to pack the character string into an array. + + chr_len = LEN(value) + ALLOCATE(chr(1:chr_len), STAT=hdferr) + IF (hdferr .NE. 0) THEN + hdferr = -1 + RETURN + ENDIF + + DO i = 1, chr_len + chr(i) = value(i:i) + ENDDO + + f_ptr = C_LOC(chr(1)(1:1)) + + name_len = LEN(name) + hdferr = h5pget_c(prp_id, name, name_len, f_ptr) + + DEALLOCATE(chr) + + END SUBROUTINE h5pset_char +! +!****s* H5P (F03)/h5pget_f_F90 +! +! NAME +! h5pget_f +! +! PURPOSE +! Queries the value of a property. +! +! Inputs: +! prp_id - Property list identifier to modify +! name - Name of property to get +! value - Property value, supported types are: +! INTEGER +! REAL +! DOUBLE PRECISION +! CHARACTER(LEN=*) +! Outputs: +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! October 9, 2002 +! +! Fortran90 Interface: +!! SUBROUTINE h5pget_f(plid, name, value, hdferr) +!! INTEGER(HID_T) , INTENT(IN) :: plid +!! CHARACTER(LEN=*), INTENT(IN) :: name +!! TYPE , INTENT(OUT) :: value +!! INTEGER , INTENT(OUT) :: hdferr +!***** + + SUBROUTINE h5pget_integer(prp_id, name, value, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to modify + INTEGER, INTENT(OUT), TARGET :: value ! Property value + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER :: name_len + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(value) + + name_len = LEN(name) + hdferr = h5pget_c(prp_id, name, name_len, f_ptr) + + END SUBROUTINE h5pget_integer + + SUBROUTINE h5pget_real(prp_id, name, value, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to modify + REAL, INTENT(OUT), TARGET :: value ! Property value + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER :: name_len + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(value) + + name_len = LEN(name) + hdferr = h5pget_c(prp_id, name, name_len, f_ptr) + END SUBROUTINE h5pget_real + + SUBROUTINE h5pget_char(prp_id, name, value, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to modify + CHARACTER(LEN=*), INTENT(OUT) :: value ! Property value + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER :: name_len + + INTEGER :: i + CHARACTER(LEN=1), ALLOCATABLE, DIMENSION(:), TARGET :: chr + INTEGER :: chr_len + TYPE(C_PTR) :: f_ptr + + chr_len = LEN(value) + ALLOCATE(chr(1:chr_len), STAT=hdferr) + IF (hdferr .NE. 0) THEN + hdferr = -1 + RETURN + ENDIF + f_ptr = C_LOC(chr(1)(1:1)) + + name_len = LEN(name) + hdferr = h5pget_c(prp_id, name, name_len, f_ptr) + + DO i = 1, chr_len + value(i:i) = chr(i) + ENDDO + + DEALLOCATE(chr) + + END SUBROUTINE h5pget_char + + +! +!****s* H5P (F03)/h5pset_f_F03 +! +! NAME +! h5pset_f +! +! PURPOSE +! Sets a property list value +! +! Inputs: +! prp_id - Property list identifier to modify +! name - Name of property to modify +! value - Pointer to value to set the property to +! Outputs: +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! October 9, 2002 +! +! Fortran2003 Interface: +!! SUBROUTINE h5pset_f(plid, name, value, hdferr) +!! INTEGER(HID_T) , INTENT(IN) :: plid +!! CHARACTER(LEN=*), INTENT(IN) :: name +!! TYPE(C_PTR) , INTENT(IN) :: value +!! INTEGER , INTENT(OUT) :: hdferr +!***** + SUBROUTINE h5pset_ptr(prp_id, name, value, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to modify + TYPE(C_PTR), INTENT(IN) :: value ! Property value + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER :: name_len + + name_len = LEN(name) + hdferr = h5pset_c(prp_id, name, name_len, value) + + END SUBROUTINE h5pset_ptr +! +!****s* H5P (F03)/h5pget_f_F03 +! +! NAME +! h5pget_f (F03) +! +! PURPOSE +! Queries the value of a property. +! +! Inputs: +! prp_id - Property list identifier to modify +! name - Name of property to get +! value - Pointer to a location to which to copy the value of of the property +! Outputs: +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! October 9, 2002 +! +! Fortran2003 Interface: +!! SUBROUTINE h5pget_f(plid, name, value, hdferr) +!! INTEGER(HID_T) , INTENT(IN) :: plid +!! CHARACTER(LEN=*), INTENT(IN) :: name +!! TYPE(C_PTR) , INTENT(OUT) :: value +!! INTEGER , INTENT(OUT) :: hdferr +!***** + SUBROUTINE h5pget_ptr(prp_id, name, value, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to modify + TYPE(C_PTR), INTENT(OUT) :: value ! Property value + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER :: name_len + + name_len = LEN(name) + hdferr = h5pget_c(prp_id, name, name_len, value) + + END SUBROUTINE h5pget_ptr + + +! +!****s* H5P (F03)/h5pregister_f_F90 +! +! NAME +! h5pregister +! +! PURPOSE +! Registers a permanent property with a property list class. +! +! Inputs: +! class - Property list class identifier +! name - Name of property to register +! size - Size of the property value +! value - Property value, supported types are: +! INTEGER +! REAL +! DOUBLE PRECISION +! CHARACTER(LEN=*) +! +! Outputs: +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! October 10, 2002 +! +! Fortran90 Interface: +!! SUBROUTINE h5pregister_f(class, name, size, value, hdferr) +!! INTEGER(HID_T) , INTENT(IN) :: class +!! CHARACTER(LEN=*), INTENT(IN) :: name +!! INTEGER(SIZE_T) , INTENT(IN) :: size +!! TYPE , INTENT(IN) :: value +!! INTEGER , INTENT(OUT) :: hdferr +!***** + SUBROUTINE h5pregister_integer(class, name, size, value, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: class ! Property list class identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to register + INTEGER(SIZE_T), INTENT(IN) :: size ! Size of the property value + INTEGER, INTENT(IN), TARGET :: value ! Property value + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER :: name_len + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(value) + + name_len = LEN(name) + hdferr = h5pregister_c(class, name, name_len, size, f_ptr) + + END SUBROUTINE h5pregister_integer + + SUBROUTINE h5pregister_real(class, name, size, value, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: class ! Property list class identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to register + INTEGER(SIZE_T), INTENT(IN) :: size ! size of the property value + REAL, INTENT(IN), TARGET :: value ! Property value + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER :: name_len + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(value) + + name_len = LEN(name) + hdferr = h5pregister_c(class, name, name_len, size, f_ptr) + + END SUBROUTINE h5pregister_real + + SUBROUTINE h5pregister_char(class, name, size, value, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: class ! Property list class identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to register + INTEGER(SIZE_T), INTENT(IN) :: size ! size of the property value + CHARACTER(LEN=*), INTENT(IN) :: value ! Property value + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER :: name_len + + INTEGER :: i + CHARACTER(LEN=1), ALLOCATABLE, DIMENSION(:), TARGET :: chr + INTEGER :: chr_len + + TYPE(C_PTR) :: f_ptr + ! To resolve Issue #1 outlined in the preamble of this file we + ! need to pack the character string into an array. + + chr_len = LEN(value) + ALLOCATE(chr(1:chr_len), STAT=hdferr) + IF (hdferr .NE. 0) THEN + hdferr = -1 + RETURN + ENDIF + + DO i = 1, chr_len + chr(i) = value(i:i) + ENDDO + + f_ptr = C_LOC(chr(1)(1:1)) + + name_len = LEN(name) + hdferr = h5pregister_c(class, name, name_len, size, f_ptr) + DEALLOCATE(chr) + END SUBROUTINE h5pregister_char +! +!****s* H5P (F03)/h5pregister_f_F03 +! +! NAME +! h5pregister (F03) +! +! PURPOSE +! Registers a permanent property with a property list class. +! +! Inputs: +! class - Property list class identifier +! name - Name of property to register +! size - Size of the property value +! value - Pointer to value to set the property to +! +! Outputs: +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! M. Scot Breitenfeld +! June 24, 2008 +! +! Fortran2003 Interface: +!! SUBROUTINE h5pregister_f(class, name, size, value, hdferr) +!! INTEGER(HID_T) , INTENT(IN) :: class +!! CHARACTER(LEN=*), INTENT(IN) :: name +!! INTEGER(SIZE_T) , INTENT(IN) :: size +!! TYPE(C_PTR) , INTENT(IN) :: value +!! INTEGER , INTENT(OUT) :: hdferr +!***** + + SUBROUTINE h5pregister_ptr(class, name, size, value, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: class ! Property list class identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to register + INTEGER(SIZE_T), INTENT(IN) :: size ! Size of the property value + TYPE(C_PTR), INTENT(IN) :: value ! Property value + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER :: name_len + + name_len = LEN(name) + hdferr = h5pregister_c(class, name, name_len, size, value) + END SUBROUTINE h5pregister_ptr + +! +!****s* H5P (F03)/h5pinsert_f_F90 +! +! NAME +! h5pinsert (f90) +! +! PURPOSE +! Registers a temporary property with a property list class. +! +! Inputs: +! plist - Property list class identifier +! name - Name of property to insert +! size - Size of the property value +! value - Property value, supported types are: +! INTEGER +! REAL +! DOUBLE PRECISION +! CHARACTER(LEN=*) +! Outputs: +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! Elena Pourmal +! October 10, 2002 +! +! Fortran90 Interface: +!! SUBROUTINE h5pinsert_f +!! INTEGER(HID_T) , INTENT(IN) :: plist +!! CHARACTER(LEN=*), INTENT(IN) :: name +!! INTEGER(SIZE_T) , INTENT(IN) :: size +!! TYPE , INTENT(IN) :: value +!! INTEGER , INTENT(OUT) :: hdferr +!***** + SUBROUTINE h5pinsert_integer(plist, name, size, value, hdferr) + USE iso_c_binding + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist ! Property list identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to insert + INTEGER(SIZE_T), INTENT(IN) :: size ! Size of the property value + INTEGER, INTENT(IN), TARGET :: value ! Property value + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER :: name_len + TYPE(c_ptr) :: f_ptr + + f_ptr = c_loc(value) + + name_len = LEN(name) + hdferr = h5pinsert_c(plist, name , name_len, size, f_ptr) + END SUBROUTINE h5pinsert_integer + + SUBROUTINE h5pinsert_real(plist, name, size, value, hdferr) + USE iso_c_binding + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist ! Property list identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to insert + INTEGER(SIZE_T), INTENT(IN) :: size ! Size of the property value + REAL, INTENT(IN), TARGET :: value ! Property value + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER :: name_len + TYPE(c_ptr) :: f_ptr + + f_ptr = c_loc(value) + + name_len = LEN(name) + hdferr = h5pinsert_c(plist, name , name_len, size, f_ptr) + + END SUBROUTINE h5pinsert_real + + SUBROUTINE h5pinsert_char(plist, name, size, value, hdferr) + USE iso_c_binding + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist ! Property list identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to insert + INTEGER(SIZE_T), INTENT(IN) :: size ! Size of property value + CHARACTER(LEN=*), INTENT(IN) :: value ! Property value + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER :: name_len + + INTEGER :: i + CHARACTER(LEN=1), ALLOCATABLE, DIMENSION(:), TARGET :: chr + INTEGER :: chr_len + + TYPE(c_ptr) :: f_ptr + ! To resolve Issue #1 outlined in the preamble of this file we + ! need to pack the character string into an array. + + chr_len = LEN(value) + ALLOCATE(chr(1:chr_len), STAT=hdferr) + IF (hdferr .NE. 0) THEN + hdferr = -1 + RETURN + ENDIF + + DO i = 1, chr_len + chr(i) = value(i:i) + ENDDO + + f_ptr = C_LOC(chr(1)(1:1)) + + name_len = LEN(name) + hdferr = h5pinsert_c(plist, name , name_len, size, f_ptr) + + DEALLOCATE(chr) + + END SUBROUTINE h5pinsert_char + +! +!****s* H5P (F03)/h5pinsert_f_F03 +! +! NAME +! h5pinsert (f03) +! +! PURPOSE +! Registers a temporary property with a property list class. +! +! Inputs: +! plist - Property list class identifier +! name - Name of property to insert +! size - Size of the property value +! value - Pointer to new value pointer for the property being modified +! +! Outputs: +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! M. Scot Breitenfeld +! June 24, 2008 +! +! Fortran90 Interface: +!! SUBROUTINE h5pinsert_f +!! INTEGER(HID_T) , INTENT(IN) :: plist +!! CHARACTER(LEN=*), INTENT(IN) :: name +!! INTEGER(SIZE_T) , INTENT(IN) :: size +!! TYPE(C_PTR) , INTENT(IN) :: value +!! INTEGER , INTENT(OUT) :: hdferr +!***** + SUBROUTINE h5pinsert_ptr(plist, name, size, value, hdferr) + USE iso_c_binding + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist ! Property list identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to insert + INTEGER(SIZE_T), INTENT(IN) :: size ! Size of property value + TYPE(c_ptr), INTENT(IN) :: value ! Property value + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER :: name_len + + name_len = LEN(name) + hdferr = h5pinsert_c(plist, name , name_len, size, value) + END SUBROUTINE h5pinsert_ptr +! +!****s* H5P (F03)/h5pcreate_class_f_F03 +! +! NAME +! h5pcreate_class_f +! +! PURPOSE +! Create a new property list class +! +! Inputs: +! parent - Parent property list class identifier +! Possible values include: +! H5P_ROOT_F +! H5P_FILE_CREATE_F +! H5P_FILE_ACCESS_F +! H5P_DATASET_CREATE_F +! H5P_DATASET_XFER_F +! H5P_FILE_MOUNT_F +! name - Name of property to create +! +! Outputs: +! class - Property list class identifier +! hdferr - Returns 0 if successful and -1 if fails +! +! Optional parameters: +! H5P_cls_create_func_t (create) - Callback routine called when a property list is created +! create_data - User pointer to any class creation information needed +! H5P_cls_copy_func_t (copy) - Callback routine called when a property list is copied +! copy_data - User pointer to any class copy information needed +! H5P_cls_close_func_t (close) - Callback routine called when a property list is being closed +! close_data - User pointer to any class close information needed +! +! AUTHOR +! Elena Pourmal +! October 9, 2002 +! +! HISTORY +! Added callback arguments +! M. Scot Breitenfeld, July 3, 2008 +! +! Fortran2003 Interface: + SUBROUTINE h5pcreate_class_f(parent, name, class, hdferr, create, create_data, copy, copy_data, close, close_data) + USE iso_c_binding + IMPLICIT NONE + INTEGER(HID_T) , INTENT(IN) :: parent + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER(HID_T) , INTENT(OUT) :: class + INTEGER , INTENT(OUT) :: hdferr + TYPE(C_PTR) , OPTIONAL :: create_data, copy_data, close_data + TYPE(C_FUNPTR) , OPTIONAL :: create, copy, close +!***** + INTEGER :: name_len + TYPE(C_PTR) :: create_data_default, copy_data_default, close_data_default + TYPE(C_FUNPTR) :: create_default, copy_default, close_default + INTERFACE + INTEGER FUNCTION h5pcreate_class_c(parent, name, name_len, class, & + create, create_data, & + copy, copy_data, & + close, close_data) + + USE iso_c_binding + USE H5GLOBAL + !DEC$IF DEFINED(HDCLOSEF90_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 + INTEGER, INTENT(IN) :: name_len + INTEGER(HID_T), INTENT(OUT) :: class + TYPE(C_PTR), VALUE :: create_data, copy_data, close_data + TYPE(C_FUNPTR), VALUE :: create, copy, close + END FUNCTION h5pcreate_class_c + END INTERFACE + name_len = LEN(name) + + create_default = c_null_funptr !fix:scot + create_data_default = c_null_ptr + copy_default = c_null_funptr !fix:scot + copy_data_default = c_null_ptr + close_default = c_null_funptr !fix:scot + close_data_default = c_null_ptr + + IF(PRESENT(create)) create_default = create + IF(PRESENT(create_data)) create_data_default = create_data + IF(PRESENT(copy)) copy_default = copy + IF(PRESENT(copy_data)) copy_data_default = copy_data + IF(PRESENT(close)) close_default = close + IF(PRESENT(close_data)) close_data_default = close_data + + hdferr = h5pcreate_class_c(parent, name , name_len, class, & + create_default, create_data_default, & + copy_default, copy_data_default, & + close_default, close_data_default) + + END SUBROUTINE h5pcreate_class_f + +END MODULE H5P_PROVISIONAL + diff --git a/fortran/src/H5Pff_F90.f90 b/fortran/src/H5Pff_F90.f90 new file mode 100644 index 0000000..ebdd185 --- /dev/null +++ b/fortran/src/H5Pff_F90.f90 @@ -0,0 +1,950 @@ +!****h* ROBODoc/H5P (_F90) +! +! NAME +! H5P_PROVISIONAL +! +! PURPOSE +! +! This file contains Fortran 90 interfaces for H5P functions. It contains +! the same functions as H5Pff_F03.f90 but excludes the Fortran 2003 functions +! and the interface listings. This file will be compiled instead of H5Pff_F03.f90 +! if Fortran 2003 functions are not enabled. +! +! COPYRIGHT +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +! NOTES +! *** IMPORTANT *** +! If you add a new H5P function you must add the function name to the +! Windows dll file '*hdf5_fortrandll.def' in the fortran/src directory. +! This is needed for Windows based operating systems. +!***** + +MODULE H5P_PROVISIONAL + + USE H5GLOBAL + + INTERFACE h5pset_fill_value_f + MODULE PROCEDURE h5pset_fill_value_integer + MODULE PROCEDURE h5pset_fill_value_real + MODULE PROCEDURE h5pset_fill_value_char + END INTERFACE + + INTERFACE h5pget_fill_value_f + MODULE PROCEDURE h5pget_fill_value_integer + MODULE PROCEDURE h5pget_fill_value_real + MODULE PROCEDURE h5pget_fill_value_char + END INTERFACE + + INTERFACE h5pset_f + MODULE PROCEDURE h5pset_integer + MODULE PROCEDURE h5pset_real + MODULE PROCEDURE h5pset_char + END INTERFACE + + INTERFACE h5pget_f + MODULE PROCEDURE h5pget_integer + MODULE PROCEDURE h5pget_real + MODULE PROCEDURE h5pget_char + END INTERFACE + + INTERFACE h5pregister_f + MODULE PROCEDURE h5pregister_integer + MODULE PROCEDURE h5pregister_real + MODULE PROCEDURE h5pregister_char + END INTERFACE + + INTERFACE h5pinsert_f + MODULE PROCEDURE h5pinsert_integer + MODULE PROCEDURE h5pinsert_real + MODULE PROCEDURE h5pinsert_char + END INTERFACE + +CONTAINS +! +!****s* H5P (F90)/h5pset(get)fill_value_f +! +! NAME +! h5pset(get)fill_value_f +! +! PURPOSE +! Sets(gets) fill value for a dataset creation property list +! +! INPUTS +! prp_id - dataset creation property list identifier +! type_id - datatype identifier for fill value +! fillvalue - fill value +! OUTPUTS +! type_id - datatype identifier for fill value +! fillvalue - fill value +! hdferr - error code +! Success: 0 +! Failure: -1 +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 14, 2001 +! +! NOTES +! h5pset(get)fill_value_f function is overloaded to support +! INTEGER, REAL, DOUBLE PRECISION and CHARACTER dtatypes. +! +! SOURCE + SUBROUTINE h5pset_fill_value_integer(prp_id, type_id, fillvalue, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier of + ! of fillvalue datatype + ! (in memory) + INTEGER, INTENT(IN) :: fillvalue ! Fillvalue + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + 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 + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER, INTENT(IN) :: fillvalue + END FUNCTION h5pset_fill_value_integer_c + END INTERFACE + + hdferr = h5pset_fill_value_integer_c(prp_id, type_id, fillvalue) + END SUBROUTINE h5pset_fill_value_integer + + + SUBROUTINE h5pget_fill_value_integer(prp_id, type_id, fillvalue, & + hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier of + ! of fillvalue datatype + ! (in memory) + INTEGER, INTENT(IN) :: fillvalue ! Fillvalue + INTEGER, INTENT(OUT) :: hdferr ! Error code + + 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 + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER :: fillvalue + END FUNCTION h5pget_fill_value_integer_c + END INTERFACE + + hdferr = h5pget_fill_value_integer_c(prp_id, type_id, fillvalue) + END SUBROUTINE h5pget_fill_value_integer + + + SUBROUTINE h5pset_fill_value_real(prp_id, type_id, fillvalue, & + hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier of + ! of fillvalue datatype + ! (in memory) + REAL, INTENT(IN) :: fillvalue ! Fillvalue + INTEGER, INTENT(OUT) :: hdferr ! Error code + + 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 + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER(HID_T), INTENT(IN) :: type_id + REAL, INTENT(IN) :: fillvalue + END FUNCTION h5pset_fill_value_real_c + END INTERFACE + + hdferr = h5pset_fill_value_real_c(prp_id, type_id, fillvalue) + END SUBROUTINE h5pset_fill_value_real + + + SUBROUTINE h5pget_fill_value_real(prp_id, type_id, fillvalue, & + hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier of + ! of fillvalue datatype + ! (in memory) + REAL, INTENT(IN) :: fillvalue ! Fillvalue + INTEGER, INTENT(OUT) :: hdferr ! Error code + + 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 + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER(HID_T), INTENT(IN) :: type_id + REAL :: fillvalue + END FUNCTION h5pget_fill_value_real_c + END INTERFACE + + hdferr = h5pget_fill_value_real_c(prp_id, type_id, fillvalue) + END SUBROUTINE h5pget_fill_value_real + + SUBROUTINE h5pset_fill_value_char(prp_id, type_id, fillvalue, & + hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier of + ! of fillvalue datatype + ! (in memory) + CHARACTER, INTENT(IN) :: fillvalue ! Fillvalue + INTEGER, INTENT(OUT) :: hdferr ! Error code + + 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$ATTRIBUTES reference :: fillvalue + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER(HID_T), INTENT(IN) :: type_id + CHARACTER, INTENT(IN) :: fillvalue + END FUNCTION h5pset_fill_valuec_c + END INTERFACE + + hdferr = h5pset_fill_valuec_c(prp_id, type_id, fillvalue) + END SUBROUTINE h5pset_fill_value_char + + SUBROUTINE h5pget_fill_value_char(prp_id, type_id, fillvalue, & + hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier of + ! of fillvalue datatype + ! (in memory) + CHARACTER, INTENT(IN) :: fillvalue ! Fillvalue + INTEGER, INTENT(OUT) :: hdferr ! Error code + + 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$ATTRIBUTES reference :: fillvalue + INTEGER(HID_T), INTENT(IN) :: prp_id + INTEGER(HID_T), INTENT(IN) :: type_id + CHARACTER :: fillvalue + END FUNCTION h5pget_fill_valuec_c + END INTERFACE + + hdferr = h5pget_fill_valuec_c(prp_id, type_id, fillvalue) + END SUBROUTINE h5pget_fill_value_char +! +!****s* H5P (F90)/h5pset_integer +! +! NAME +! h5pset_integer +! +! PURPOSE +! Sets a property list value +! +! INPUTS +! prp_id - iproperty list identifier to modify +! name - name of property to modify +! value - value to set property to +! OUTPUTS +! hdferr: - error code +! Success: 0 +! Failure: -1 +! AUTHOR +! Elena Pourmal +! October 9, 2002 +! +! SOURCE + SUBROUTINE h5pset_integer(prp_id, name, value, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to modify + INTEGER, INTENT(IN) :: value ! Property value + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTEGER :: name_len + + 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$ATTRIBUTES reference :: name + INTEGER(HID_T), INTENT(IN) :: prp_id + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER, INTENT(IN) :: name_len + INTEGER, INTENT(IN) :: value + END FUNCTION h5pset_integer_c + END INTERFACE + + name_len = LEN(name) + hdferr = h5pset_integer_c(prp_id, name , name_len, value) + END SUBROUTINE h5pset_integer + +! +!****s* H5P (F90)/h5pset_real +! +! NAME +! h5pset_real +! +! PURPOSE +! Sets a property list value +! +! INPUTS +! prp_id - iproperty list identifier to modify +! name - name of property to modify +! value - value to set property to +! OUTPUTS +! hdferr: - error code +! Success: 0 +! Failure: -1 +! AUTHOR +! Elena Pourmal +! October 9, 2002 +! +! SOURCE + SUBROUTINE h5pset_real(prp_id, name, value, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to modify + REAL, INTENT(IN) :: value ! Property value + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTEGER :: name_len + + 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$ATTRIBUTES reference :: name + INTEGER(HID_T), INTENT(IN) :: prp_id + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER, INTENT(IN) :: name_len + REAL, INTENT(IN) :: value + END FUNCTION h5pset_real_c + END INTERFACE + + name_len = LEN(name) + hdferr = h5pset_real_c(prp_id, name , name_len, value) + END SUBROUTINE h5pset_real + +!****s* H5P (F90)/h5pset_char +! +! NAME +! h5pset_char +! +! PURPOSE +! Sets a property list value +! +! INPUTS +! prp_id - iproperty list identifier to modify +! name - name of property to modify +! value - value to set property to +! OUTPUTS +! hdferr - error code +! Success: 0 +! Failure: -1 +! OPTIONAL PARAMETERS +! NONE +! +! AUTHOR +! Elena Pourmal +! October 9, 2002 +! SOURCE + SUBROUTINE h5pset_char(prp_id, name, value, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to modify + CHARACTER(LEN=*), INTENT(IN) :: value ! Property value + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTEGER :: name_len + INTEGER :: value_len + + 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$ATTRIBUTES reference :: name + !DEC$ATTRIBUTES reference :: value + INTEGER(HID_T), INTENT(IN) :: prp_id + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER, INTENT(IN) :: name_len + CHARACTER(LEN=*), INTENT(IN) :: value + INTEGER, INTENT(IN) :: value_len + END FUNCTION h5psetc_c + END INTERFACE + + name_len = LEN(name) + value_len = LEN(value) + hdferr = h5psetc_c(prp_id, name , name_len, value, value_len) + END SUBROUTINE h5pset_char + +!****s* H5P (F90)/h5pget_integer +! +! NAME +! h5pget_integer +! +! PURPOSE +! Gets a property list value +! +! INPUTS +! prp_id - iproperty list identifier to modify +! name - name of property to modify +! OUTPUTS +! value - value of property +! hdferr - error code +! Success: 0 +! Failure: -1 +! AUTHOR +! Elena Pourmal +! October 9, 2002 +! +! SOURCE + SUBROUTINE h5pget_integer(prp_id, name, value, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to modify + INTEGER, INTENT(OUT) :: value ! Property value + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTEGER :: name_len + + 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$ATTRIBUTES reference :: name + INTEGER(HID_T), INTENT(IN) :: prp_id + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER, INTENT(IN) :: name_len + INTEGER, INTENT(OUT) :: value + END FUNCTION h5pget_integer_c + END INTERFACE + + name_len = LEN(name) + hdferr = h5pget_integer_c(prp_id, name , name_len, value) + END SUBROUTINE h5pget_integer + +! +!****s* H5P (F90)/h5pget_real +! +! NAME +! h5pget_real +! +! PURPOSE +! Gets a property list value +! +! INPUTS +! prp_id - iproperty list identifier to modify +! name - name of property to modify +! OUTPUTS +! value - value of property +! hdferr - error code +! Success: 0 +! Failure: -1 +! AUTHOR +! Elena Pourmal +! October 9, 2002 +! SOURCE + SUBROUTINE h5pget_real(prp_id, name, value, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to modify + REAL, INTENT(OUT) :: value ! Property value + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTEGER :: name_len + + 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$ATTRIBUTES reference :: name + INTEGER(HID_T), INTENT(IN) :: prp_id + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER, INTENT(IN) :: name_len + REAL, INTENT(OUT) :: value + END FUNCTION h5pget_real_c + END INTERFACE + + name_len = LEN(name) + hdferr = h5pget_real_c(prp_id, name , name_len, value) + END SUBROUTINE h5pget_real + +! +!****s* H5P (F90)/h5pget_char +! +! NAME +! h5pget_char +! +! PURPOSE +! Gets a property list value +! +! INPUTS +! prp_id - iproperty list identifier to modify +! name - name of property to modify +! OUTPUTS +! value - value of property +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! October 9, 2002 +! +! SOURCE + SUBROUTINE h5pget_char(prp_id, name, value, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to modify + CHARACTER(LEN=*), INTENT(OUT) :: value ! Property value + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTEGER :: name_len + INTEGER :: value_len + + 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$ATTRIBUTES reference :: name + !DEC$ATTRIBUTES reference :: value + INTEGER(HID_T), INTENT(IN) :: prp_id + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER, INTENT(IN) :: name_len + CHARACTER(LEN=*), INTENT(OUT) :: value + INTEGER, INTENT(IN) :: value_len + END FUNCTION h5pgetc_c + END INTERFACE + + name_len = LEN(name) + value_len = LEN(value) + hdferr = h5pgetc_c(prp_id, name , name_len, value, value_len) + END SUBROUTINE h5pget_char + +! +!****s* H5P (F90)/h5pregister_integer +! +! NAME +! h5pregister_integer +! +! PURPOSE +! Registers a permanent property with a property list class. +! +! INPUTS +! class - property list class to register +! permanent property within +! name - name of property to register +! size - size of property in bytes +! value - default value for property in newly +! created property lists +! OUTPUTS +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! October 10, 2002 +! +! SOURCE + SUBROUTINE h5pregister_integer(class, name, size, value, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: class ! Property list class identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to register + INTEGER(SIZE_T), INTENT(IN) :: size ! Size of the property value + INTEGER, INTENT(IN) :: value ! Property value + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTEGER :: name_len + + 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$ATTRIBUTES reference :: name + INTEGER(HID_T), INTENT(IN) :: class + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER, INTENT(IN) :: name_len + INTEGER(SIZE_T), INTENT(IN) :: size + INTEGER, INTENT(IN) :: value + END FUNCTION h5pregister_integer_c + END INTERFACE + + name_len = LEN(name) + hdferr = h5pregister_integer_c(class, name , name_len, size, value) + END SUBROUTINE h5pregister_integer + +!****s* H5P (F90)/h5pregister_real +! +! NAME +! +! h5pregister_real +! +! PURPOSE Registers a permanent property with a property list class. +! +! INPUTS +! class - property list class to register +! permanent property within +! name - name of property to register +! size - size of property in bytes +! value - default value for property in newly +! created property lists +! OUTPUTS +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! October 10, 2002 +! SOURCE + SUBROUTINE h5pregister_real(class, name, size, value, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: class ! Property list class identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to register + INTEGER(SIZE_T), INTENT(IN) :: size ! size of the property value + REAL, INTENT(IN) :: value ! Property value + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTEGER :: name_len + + 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$ATTRIBUTES reference :: name + INTEGER(HID_T), INTENT(IN) :: class + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER, INTENT(IN) :: name_len + INTEGER(SIZE_T), INTENT(IN) :: size + REAL, INTENT(IN) :: value + END FUNCTION h5pregister_real_c + END INTERFACE + + name_len = LEN(name) + hdferr = h5pregister_real_c(class, name , name_len, size, value) + END SUBROUTINE h5pregister_real + +! +!****s* H5P (F90)/h5pregister_char +! +! NAME +! h5pregister_char +! +! PURPOSE +! Registers a permanent property with a property list class. +! +! INPUTS +! class - property list class to register +! permanent property within +! name - name of property to register +! size - size of property in bytes +! value - default value for property in newly +! created property lists +! OUTPUTS +! hdferr - error code +! Success: 0 +! Failure: -1 +! AUTHOR +! Elena Pourmal +! October 10, 2002 +! SOURCE + SUBROUTINE h5pregister_char(class, name, size, value, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: class ! Property list class identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to register + INTEGER(SIZE_T), INTENT(IN) :: size ! size of the property value + CHARACTER(LEN=*), INTENT(IN) :: value ! Property value + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTEGER :: name_len + INTEGER :: value_len + + INTERFACE + 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$ATTRIBUTES reference :: name + !DEC$ATTRIBUTES reference :: value + INTEGER(HID_T), INTENT(IN) :: class + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER, INTENT(IN) :: name_len + INTEGER(SIZE_T), INTENT(IN) :: size + CHARACTER(LEN=*), INTENT(IN) :: value + INTEGER, INTENT(IN) :: value_len + END FUNCTION h5pregisterc_c + END INTERFACE + + name_len = LEN(name) + value_len = LEN(value) + hdferr = h5pregisterc_c(class, name , name_len, size, value, value_len) + END SUBROUTINE h5pregister_char +! +!****s* H5P (F90)/h5pinsert_integer +! +! NAME +! h5pinsert_integer +! +! PURPOSE +! Registers a temporary property with a property list class. +! +! INPUTS +! plist - property list identifier +! name - name of property to insert +! size - size of property in bytes +! value - initial value for the property +! OUTPUTS +! hdferr - error code +! Success: 0 +! Failure: -1 +! AUTHOR +! Elena Pourmal +! October 10, 2002 +! SOURCE + SUBROUTINE h5pinsert_integer(plist, name, size, value, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist ! Property list identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to insert + INTEGER(SIZE_T), INTENT(IN) :: size ! Size of the property value + INTEGER, INTENT(IN) :: value ! Property value + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTEGER :: name_len + + 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$ATTRIBUTES reference :: name + INTEGER(HID_T), INTENT(IN) :: plist + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER, INTENT(IN) :: name_len + INTEGER(SIZE_T), INTENT(IN) :: size + INTEGER, INTENT(IN) :: value + END FUNCTION h5pinsert_integer_c + END INTERFACE + + name_len = LEN(name) + hdferr = h5pinsert_integer_c(plist, name , name_len, size, value) + END SUBROUTINE h5pinsert_integer + +! +!****s* H5P (F90)/h5pinsert_real +! +! NAME +! h5pinsert_real +! +! PURPOSE +! Registers a temporary property with a property list class. +! +! INPUTS +! plist - property list identifier +! permanent property within +! name - name of property to insert +! size - size of property in bytes +! value - initial value for the property +! OUTPUTS +! hdferr - error code +! Success: 0 +! Failure: -1 +! AUTHOR +! Elena Pourmal +! October 10, 2002 +! SOURCE + SUBROUTINE h5pinsert_real(plist, name, size, value, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist ! Property list identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to insert + INTEGER(SIZE_T), INTENT(IN) :: size ! Size of the property value + REAL, INTENT(IN) :: value ! Property value + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTEGER :: name_len + + 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$ATTRIBUTES reference :: name + INTEGER(HID_T), INTENT(IN) :: plist + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER, INTENT(IN) :: name_len + INTEGER(SIZE_T), INTENT(IN) :: size + REAL, INTENT(IN) :: value + END FUNCTION h5pinsert_real_c + END INTERFACE + + name_len = LEN(name) + hdferr = h5pinsert_real_c(plist, name , name_len, size, value) + END SUBROUTINE h5pinsert_real + + +! +!****s* H5P (F90)/h5pinsert_char +! +! NAME +! h5pinsert_char +! +! PURPOSE +! Registers a temporary property with a property list class. +! +! INPUTS +! plist - property list identifier +! permanent property within +! name - name of property to insert +! size - size of property in bytes +! value - initial value for the property +! OUTPUTS +! hdferr - error code +! Success: 0 +! Failure: -1 +! AUTHOR +! Elena Pourmal +! October 10, 2002 +! SOURCE +SUBROUTINE h5pinsert_char(plist, name, size, value, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: plist ! Property list identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to insert + INTEGER(SIZE_T), INTENT(IN) :: size ! Size of property value + CHARACTER(LEN=*), INTENT(IN) :: value ! Property value + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTEGER :: name_len + INTEGER :: value_len + + 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$ATTRIBUTES reference :: name + !DEC$ATTRIBUTES reference :: value + INTEGER(HID_T), INTENT(IN) :: plist + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER, INTENT(IN) :: name_len + INTEGER(SIZE_T), INTENT(IN) :: size + CHARACTER(LEN=*), INTENT(IN) :: value + INTEGER, INTENT(IN) :: value_len + END FUNCTION h5pinsertc_c + END INTERFACE + + name_len = LEN(name) + value_len = LEN(value) + hdferr = h5pinsertc_c(plist, name , name_len, size, value, value_len) + END SUBROUTINE h5pinsert_char + +! +!****s* H5P (F90)/h5pcreate_class_f +! +! NAME +! h5pcreate_class_f +! +! PURPOSE +! Create a new property list class +! +! INPUTS +! parent - Property list identifier of the parent class +! Possible values include: +! H5P_ROOT_F +! H5P_FILE_CREATE_F +! H5P_FILE_ACCESS_F +! H5P_DATASET_CREATE_F +! H5P_DATASET_XFER_F +! H5P_FILE_MOUNT_F +! name - name of the class we are creating +! OUTPUTS +! class - property list class identifier +! hdferr - error code +! Success: 0 +! Failure: -1 +! AUTHOR +! Elena Pourmal +! October 9, 2002 +! +! SOURCE + SUBROUTINE h5pcreate_class_f(parent, name, class, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: parent ! parent property list class + ! identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! name of property tocreate + INTEGER(HID_T), INTENT(OUT) :: class ! property list class identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTEGER :: name_len + + INTERFACE + 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$ATTRIBUTES reference :: name + INTEGER(HID_T), INTENT(IN) :: parent + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER, INTENT(IN) :: name_len + INTEGER(HID_T), INTENT(OUT) :: class + END FUNCTION h5pcreate_class_c + END INTERFACE + + name_len = LEN(name) + hdferr = h5pcreate_class_c(parent, name, name_len, class) + + END SUBROUTINE h5pcreate_class_f + +END MODULE H5P_PROVISIONAL + diff --git a/fortran/src/H5Rf.c b/fortran/src/H5Rf.c index 51a775f..86e0e61 100644 --- a/fortran/src/H5Rf.c +++ b/fortran/src/H5Rf.c @@ -1,4 +1,9 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +/****h* H5Rf/H5Rf + * PURPOSE + * This file contains C stubs for H5R Fortran APIs + * + * COPYRIGHT + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * @@ -11,26 +16,35 @@ * is linked from the top-level documents page. It can also be found at * * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * * access to either file, you may request a copy from help@hdfgroup.org. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -/* This files contains C stubs for H5R Fortran APIs */ + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * + ****** +*/ #include "H5f90.h" #include "H5Eprivate.h" -/*---------------------------------------------------------------------------- - * Name: h5rcreate_object_c - * Purpose: Call H5Rcreate to create a reference to an object - * Inputs: loc_id - file or group identifier - * name - name of the dataset - * namelen - name length - * Outputs: ref - reference to the object - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal - * Wednesday, December 1, 1999 - *---------------------------------------------------------------------------*/ +/****if* H5Rf/h5rcreate_object_c + * NAME + * h5rcreate_object_c + * PURPOSE + * Call H5Rcreate to create a reference to an object + * INPUTS + * loc_id - file or group identifier + * name - name of the dataset + * namelen - name length + * OUTPUTS + * ref - reference to the object + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal + * Wednesday, December 1, 1999 + * SOURCE +*/ int_f nh5rcreate_object_c(haddr_t_f *ref, hid_t_f *loc_id, _fcd name, int_f *namelen) +/******/ { char *c_name = NULL; hobj_ref_t ref_c; @@ -57,21 +71,31 @@ done: return ret_value; } /* nh5rcreate_object_c() */ -/*---------------------------------------------------------------------------- - * Name: h5rcreate_region_c - * Purpose: Call H5Rcreate to create a reference to dataset region +/****if* H5Rf/h5rcreate_region_c + * NAME + * h5rcreate_region_c + * PURPOSE + * Call H5Rcreate to create a reference to dataset region * region - * Inputs: loc_id - file or group identifier + * INPUTS + * loc_id - file or group identifier * name - name of the dataset * namelen - name length * space_id - dataset space identifier - * Outputs: ref - reference to the dataset region - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal - * Wednesday, December 1, 1999 - *---------------------------------------------------------------------------*/ + * OUTPUTS + * ref - reference to the dataset region + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal + * Wednesday, December 1, 1999 + * HISTORY + * + * SOURCE +*/ int_f nh5rcreate_region_c(int_f *ref, hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *space_id) +/******/ { char *c_name = NULL; hdset_reg_ref_t ref_c; @@ -98,18 +122,73 @@ done: return ret_value; } /* end nh5rcreate_region_c() */ -/*---------------------------------------------------------------------------- - * Name: h5rdereference_region_c - * Purpose: Call H5Rdereference to dereference to dataset region - * Inputs: dset_id - dataset identifier +/****if* H5Rf/h5rcreate_ptr_c + * NAME + * h5rcreate_ptr_c + * PURPOSE + * Call H5Rcreate to create a reference to dataset region + * INPUTS + * loc_id - file or group identifier + * name - name of the dataset + * namelen - name length + * space_id - dataset space identifier + * OUTPUTS + * ref - reference to the dataset region + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld + * June 20, 2008 + * + * SOURCE +*/ +int_f +nh5rcreate_ptr_c (void *ref, hid_t_f *loc_id, _fcd name, int_f *namelen, int_f *ref_type, hid_t_f *space_id) +/******/ +{ + int ret_value = -1; + char *c_name; + size_t c_namelen; + + /* + * Convert FORTRAN name to C name + */ + c_namelen = *namelen; + c_name = (char *)HD5f2cstring(name, c_namelen); + if (c_name == NULL) return ret_value; + + /* + * Call H5Rcreate function. + */ + if(H5Rcreate(ref, (hid_t)*loc_id, c_name, (H5R_type_t)*ref_type, (hid_t)*space_id) >= 0) + ret_value = 0; + + HDfree(c_name); + return ret_value; +} + +/****if* H5Rf/h5rdereference_region_c + * NAME + * h5rdereference_region_c + * PURPOSE + * Call H5Rdereference to dereference to dataset region + * INPUTS + * dset_id - dataset identifier * ref - reference to the dataset region - * Outputs: obj_id - dereferenced dataset identifier - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal - * Wednesday, December 1, 1999 - *---------------------------------------------------------------------------*/ + * OUTPUTS + * obj_id - dereferenced dataset identifier + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal + * Wednesday, December 1, 1999 + * HISTORY + * + * SOURCE +*/ int_f nh5rdereference_region_c(hid_t_f *dset_id, int_f *ref, hid_t_f *obj_id) +/******/ { hdset_reg_ref_t ref_c; hid_t c_obj_id; @@ -121,7 +200,7 @@ nh5rdereference_region_c(hid_t_f *dset_id, int_f *ref, hid_t_f *obj_id) /* * Call H5Rdereference function. */ - if((c_obj_id = H5Rdereference((hid_t)*dset_id, H5R_DATASET_REGION, &ref_c)) < 0) + if((c_obj_id = H5Rdereference2((hid_t)*dset_id, H5P_DEFAULT, H5R_DATASET_REGION, &ref_c)) < 0) HGOTO_DONE(FAIL) /* Copy the object's ID */ @@ -131,18 +210,28 @@ done: return ret_value; } /* end nh5rdereference_region_c() */ -/*---------------------------------------------------------------------------- - * Name: h5rdereference_object_c - * Purpose: Call H5Rdereference to dereference an object - * Inputs: dset_id - dataset identifier +/****if* H5Rf/h5rdereference_object_c + * NAME + * h5rdereference_object_c + * PURPOSE + * Call H5Rdereference to dereference an object + * INPUTS + * dset_id - dataset identifier * ref - reference to an object - * Outputs: obj_id - dereferenced object identifier - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal - * Wednesday, December 1, 1999 - *---------------------------------------------------------------------------*/ + * OUTPUTS + * obj_id - dereferenced object identifier + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal + * Wednesday, December 1, 1999 + * HISTORY + * + * SOURCE +*/ int_f nh5rdereference_object_c(hid_t_f *dset_id, haddr_t_f *ref, hid_t_f *obj_id) +/******/ { hid_t c_obj_id; hobj_ref_t ref_c = (hobj_ref_t)*ref; @@ -151,7 +240,7 @@ nh5rdereference_object_c(hid_t_f *dset_id, haddr_t_f *ref, hid_t_f *obj_id) /* * Call H5Rdereference function. */ - if((c_obj_id = H5Rdereference((hid_t)*dset_id, H5R_OBJECT, &ref_c)) < 0) + if((c_obj_id = H5Rdereference2((hid_t)*dset_id, H5P_DEFAULT, H5R_OBJECT, &ref_c)) < 0) HGOTO_DONE(FAIL) /* Copy the object's ID */ @@ -161,18 +250,66 @@ done: return ret_value; } /* end nh5rdereference_object_c() */ -/*---------------------------------------------------------------------------- - * Name: h5rget_region_region_object_c - * Purpose: Call H5Rget_region to dereference dataspace region - * Inputs: dset_id - dataset identifier - * ref - reference to the dataset region - * Outputs: space_id - dereferenced dataset dataspace identifier - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal - * Wednesday, December 1, 1999 - *---------------------------------------------------------------------------*/ +/****if* H5Rf/h5rdereference_ptr_c + * NAME + * h5rdereference_ptr_c + * PURPOSE + * Call H5Rdereference + * INPUTS + * obj_id - Valid identifier for the file containing the + * referenced object or any object in that file. + * ref_typ - The reference type of ref. + * ref - Object reference + * OUTPUTS + * ref_obj_id - Identifier of referenced object + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld + * June 20, 2008 + * HISTORY + * + * SOURCE +*/ +int_f +nh5rdereference_ptr_c (hid_t_f *obj_id, int_f *ref_type, void *ref, hid_t_f *ref_obj_id) +/******/ +{ + int ret_value = -1; + hid_t c_ref_obj_id; + + /* + * Call H5Rdereference function. + */ + c_ref_obj_id = H5Rdereference2((hid_t)*obj_id, H5P_DEFAULT, (H5R_type_t)*ref_type, ref); + if(c_ref_obj_id < 0) return ret_value; + *ref_obj_id = (hid_t_f)c_ref_obj_id; + ret_value = 0; + return ret_value; +} + +/****if* H5Rf/h5rget_region_region_object_c + * NAME + * h5rget_region_region_object_c + * PURPOSE + * Call H5Rget_region to dereference dataspace region + * INPUTS + * dset_id - dataset identifier + * ref - reference to the dataset region + * OUTPUTS + * space_id - dereferenced dataset dataspace identifier + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal + * Wednesday, December 1, 1999 + * HISTORY + * + * SOURCE +*/ int_f nh5rget_region_region_c(hid_t_f *dset_id, int_f *ref, hid_t_f *space_id) +/******/ { hid_t c_space_id; hdset_reg_ref_t ref_c; @@ -194,19 +331,29 @@ done: return ret_value; } /* end nh5rget_region_region_c() */ -/*---------------------------------------------------------------------------- - * Name: h5rget_object_type_obj_c - * Purpose: Call H5Rget_object_type to retrieve the type of the object reference points +/****if* H5Rf/h5rget_object_type_obj_c + * NAME + * h5rget_object_type_obj_c + * PURPOSE + * Call H5Rget_object_type to retrieve the type of the object reference points * to - * Inputs: dset_id - dataset identifier + * INPUTS + * dset_id - dataset identifier * ref - reference to the dataset region - * Outputs: obj_type - type of dereferenced object - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal - * Wednesday, December 1, 1999 - *---------------------------------------------------------------------------*/ + * OUTPUTS + * obj_type - type of dereferenced object + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal + * Wednesday, December 1, 1999 + * HISTORY + * + * SOURCE +*/ int_f nh5rget_object_type_obj_c(hid_t_f *dset_id, haddr_t_f *ref, int_f *obj_type) +/******/ { H5O_type_t c_obj_type; hobj_ref_t ref_c = (hobj_ref_t)*ref; @@ -225,22 +372,32 @@ done: return ret_value; } /* end nh5rget_object_type_obj_c() */ -/*---------------------------------------------------------------------------- - * Name: h5rget_name_object_c - * Purpose: Call H5Rget_name for an object - * Inputs: +/****if* H5Rf/h5rget_name_object_c + * NAME + * h5rget_name_object_c + * PURPOSE + * Call H5Rget_name for an object + * INPUTS + * * loc_id - Identifier for the dataset containing the reference or for the group that dataset is in. * ref - An object or dataset region reference. * - * Outputs: name - A name associated with the referenced object or dataset region. + * OUTPUTS + * name - A name associated with the referenced object or dataset region. * size - The size of the name buffer. * - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld - * March 31, 2008 - *---------------------------------------------------------------------------*/ + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld + * March 31, 2008 + * HISTORY + * + * SOURCE +*/ int_f nh5rget_name_object_c(hid_t_f *loc_id, haddr_t_f *ref, _fcd name, size_t_f *name_len, size_t_f *size_default) +/******/ { hobj_ref_t ref_c = (hobj_ref_t)*ref; ssize_t c_size; @@ -273,22 +430,32 @@ done: return ret_value; } /* end nh5rget_name_object_c() */ -/*---------------------------------------------------------------------------- - * Name: h5rget_name_region_c - * Purpose: Call H5Rget_name for a dataset region - * Inputs: +/****if* H5Rf/h5rget_name_region_c + * NAME + * h5rget_name_region_c + * PURPOSE + * Call H5Rget_name for a dataset region + * INPUTS + * * loc_id - Identifier for the dataset containing the reference or for the group that dataset is in. * ref - An object or dataset region reference. * - * Outputs: name - A name associated with the referenced object or dataset region. + * OUTPUTS + * name - A name associated with the referenced object or dataset region. * size - The size of the name buffer. * - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld - * March 31, 2008 - *---------------------------------------------------------------------------*/ + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld + * March 31, 2008 + * HISTORY + * + * SOURCE +*/ int_f nh5rget_name_region_c(hid_t_f *loc_id, int_f *ref, _fcd name, size_t_f *name_len, size_t_f *size_default) +/******/ { hdset_reg_ref_t ref_c; ssize_t c_size; @@ -321,5 +488,108 @@ done: if(c_buf) HDfree(c_buf); return ret_value; -} /* end nh5rget_name_region_c() */ +} + +/****if* H5Rf/h5rget_name_ptr_c + * NAME + * h5rget_name_ptr_c + * PURPOSE + * Call H5Rget_name + * INPUTS + * + * loc_id - Identifier for the dataset containing the reference or for the group that dataset is in. + * ref_type - Type of reference. + * ref - An object or dataset region reference. + * + * OUTPUTS + * name - A name associated with the referenced object or dataset region. + * size - The size of the name buffer. + * + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld + * June 20, 2008 + * HISTORY + * + * SOURCE +*/ +int_f +nh5rget_name_ptr_c (hid_t_f *loc_id, int_f *ref_type, void *ref, _fcd name, size_t_f *name_len, size_t_f *size_default) +/******/ +{ + int_f ret_value = -1; + ssize_t c_size; + size_t c_bufsize; + char *c_buf= NULL; /* Buffer to hold C string */ + + c_bufsize = (size_t)*name_len+1; + /* + * Allocate buffer to hold name of an attribute + */ + if ((c_buf = HDmalloc(c_bufsize)) == NULL) + return ret_value; + + /* + * Call H5Rget_name function. + */ + if((c_size=H5Rget_name((hid_t)*loc_id, (H5R_type_t)*ref_type, ref, c_buf, c_bufsize)) < 0){ + if(c_buf) HDfree(c_buf); + return ret_value; + } + /* + * Convert C name to FORTRAN and place it in the given buffer + */ + HD5packFstring(c_buf, _fcdtocp(name), c_bufsize-1); + + *size_default = (size_t_f)c_size; + ret_value = 0; + if(c_buf) HDfree(c_buf); + + return ret_value; +} + +/****if* H5Rf/h5rget_obj_type_c + * NAME + * h5rget_obj_type_c + * PURPOSE + * Call H5Rget_obj_type + * INPUTS + * loc_id - Identifier for the dataset containing the reference or + * for the group that dataset is in. + * ref_type - Type of reference to query. + * ref - Reference to query. + * + * OUTPUTS + * obj_type - Type of referenced object. + * H5G_UNKNOWN_F (-1) + * H5G_LINK_F 0 + * H5G_GROUP_F 1 + * H5G_DATASET_F 2 + * H5G_TYPE_F 3 + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld + * December 17, 2008 + * + * SOURCE +*/ +int_f +nh5rget_obj_type_c (hid_t_f *loc_id, int_f *ref_type, void *ref, int_f *obj_type) +/******/ +{ + int_f ret_value = -1; + H5O_type_t obj_type_c; + + /* + * Call H5Rget_obj_type function. + */ + if((H5Rget_obj_type2((hid_t)*loc_id, (H5R_type_t)*ref_type, ref, &obj_type_c)) < 0) + return ret_value; + + *obj_type = (int_f)obj_type_c; + ret_value = 0; + return ret_value; +} diff --git a/fortran/src/H5Rff.f90 b/fortran/src/H5Rff.f90 index 6c557e3..35a3ed6 100644 --- a/fortran/src/H5Rff.f90 +++ b/fortran/src/H5Rff.f90 @@ -1,3 +1,18 @@ +!****h* ROBODoc/H5R +! +! NAME +! MODULE H5R +! +! FILE +! fortran/src/H5Rff.f90 +! +! PURPOSE +! This file contains Fortran interfaces for H5R functions. It includes +! all the functions that are independent on whether the Fortran 2003 functions +! are enabled or disabled. +! +! +! COPYRIGHT ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! Copyright by The HDF Group. * ! Copyright by the Board of Trustees of the University of Illinois. * @@ -13,565 +28,164 @@ ! access to either file, you may request a copy from help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! +! NOTES +! *** IMPORTANT *** +! If you add a new H5R function you must add the function name to the +! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! This is needed for Windows based operating systems. ! -! This file contains Fortran90 interfaces for H5R functions. -! - MODULE H5R - USE H5GLOBAL - -! If you change the value of these parameters, do not forget to change corresponding -! values in the H5f90.h file. -! INTEGER, PARAMETER :: REF_OBJ_BUF_LEN = 2 -! INTEGER, PARAMETER :: REF_REG_BUF_LEN = 3 -! -! TYPE hobj_ref_t_f -! INTEGER ref(REF_OBJ_BUF_LEN) -! END TYPE -! -! TYPE hdset_reg_ref_t_f -! INTEGER ref(REF_REG_BUF_LEN) -! END TYPE -! - INTERFACE h5rcreate_f - - MODULE PROCEDURE h5rcreate_object_f - MODULE PROCEDURE h5rcreate_region_f - - END INTERFACE - - INTERFACE h5rdereference_f - - MODULE PROCEDURE h5rdereference_object_f - MODULE PROCEDURE h5rdereference_region_f - - END INTERFACE - - INTERFACE h5rget_region_f - - MODULE PROCEDURE h5rget_region_region_f - - END INTERFACE - - INTERFACE h5rget_object_type_f - - MODULE PROCEDURE h5rget_object_type_obj_f - - END INTERFACE - - INTERFACE h5rget_name_f - - MODULE PROCEDURE h5rget_name_object_f - MODULE PROCEDURE h5rget_name_region_f - - END INTERFACE - - CONTAINS - -!---------------------------------------------------------------------- -! Name: h5rcreate_object_f -! -! Purpose: Creates reference to the object -! -! Inputs: -! loc_id - location identifier -! name - name of the object at the specified location -! Outputs: -! ref - reference to the specified object -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). February 28, 2001 -! -! Comment: This is a module procedure for the h5rcreate_f -! subroutine. -!---------------------------------------------------------------------- - - SUBROUTINE h5rcreate_object_f(loc_id, name, ref, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! Location identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the object at location specified - ! by loc_id identifier - TYPE(hobj_ref_t_f), INTENT(OUT) :: ref ! Object reference - INTEGER, INTENT(OUT) :: hdferr ! Error code - - INTEGER :: namelen ! Name length - INTEGER(HADDR_T) :: ref_f ! Local buffer to pass reference - -! INTEGER, EXTERNAL :: h5fcreate_object_c -! Interface is needed for MS FORTRAN -! - 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$ATTRIBUTES reference :: name - INTEGER(HADDR_T) :: ref_f - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER :: namelen - END FUNCTION h5rcreate_object_c - END INTERFACE - - namelen = LEN(name) - ref_f = 0 - hdferr = h5rcreate_object_c(ref_f, loc_id, name, namelen ) - ref%ref = ref_f - - END SUBROUTINE h5rcreate_object_f - -!---------------------------------------------------------------------- -! Name: h5rcreate_region_f -! -! Purpose: Creates r eference to the dataset region -! -! Inputs: -! loc_id - location identifier -! name - name of the dataset at the specified location -! space_id - dataspace identifier that describes selected region -! Outputs: -! ref - reference to the dataset region -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). February 28, 2001 -! -! Comment: This is a module procedure for the h5rcreate_f -! subroutine. -!---------------------------------------------------------------------- - - SUBROUTINE h5rcreate_region_f(loc_id, name, space_id, ref, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! Location identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the dataset at location specified - ! by loc_id identifier - INTEGER(HID_T), INTENT(IN) :: space_id ! Dataset's dataspace identifier - TYPE(hdset_reg_ref_t_f), INTENT(OUT) :: ref ! Dataset region reference - INTEGER, INTENT(OUT) :: hdferr ! Error code - - INTEGER :: namelen ! Name length - INTEGER :: ref_f(REF_REG_BUF_LEN) ! Local buffer to pass reference +!***** -! INTEGER, EXTERNAL :: h5fcreate_region_c -! Interface is needed for MS FORTRAN -! - 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$ATTRIBUTES reference :: name -! INTEGER, PARAMETER :: REF_REG_BUF_LEN = 3 - INTEGER :: ref_f(REF_REG_BUF_LEN) - INTEGER(HID_T), INTENT(IN) :: loc_id - CHARACTER(LEN=*), INTENT(IN) :: name - INTEGER :: namelen - INTEGER(HID_T), INTENT(IN) :: space_id - END FUNCTION h5rcreate_region_c - END INTERFACE - - namelen = LEN(name) - ref_f = 0 - hdferr = h5rcreate_region_c(ref_f, loc_id, name, namelen, space_id ) - ref%ref = ref_f +MODULE H5R + USE H5GLOBAL - END SUBROUTINE h5rcreate_region_f + ! If you change the value of these parameters, do not forget to change corresponding + ! values in the H5f90.h file. + ! INTEGER, PARAMETER :: REF_OBJ_BUF_LEN = 2 + ! INTEGER, PARAMETER :: REF_REG_BUF_LEN = 3 + ! + ! TYPE hobj_ref_t_f + ! INTEGER ref(REF_OBJ_BUF_LEN) + ! END TYPE + ! + ! TYPE hdset_reg_ref_t_f + ! INTEGER ref(REF_REG_BUF_LEN) + ! END TYPE + ! -!---------------------------------------------------------------------- -! Name: h5rdereference_object_f -! -! Purpose: Opens the HDF5 object referenced -! -! Inputs: -! dset_id - identifier of the dataset containing -! reference -! ref - reference to open -! Outputs: -! obj_id - object_identifier -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). February 28, 2001 -! -! Comment: This is a module procedure for the h5rdereference_f -! subroutine. -!---------------------------------------------------------------------- + INTERFACE h5rget_region_f + MODULE PROCEDURE h5rget_region_region_f - SUBROUTINE h5rdereference_object_f(dset_id, ref, obj_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - TYPE(hobj_ref_t_f), INTENT(IN) :: ref ! Object reference - INTEGER(HID_T), INTENT(OUT) :: obj_id ! Object identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code + END INTERFACE - INTEGER(HADDR_T) :: ref_f ! Local buffer to pass reference + INTERFACE h5rget_object_type_f -! INTEGER, EXTERNAL :: h5h5rdereference_object_c -! Interface is needed for MS FORTRAN -! - 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 -! INTEGER, PARAMETER :: REF_OBJ_BUF_LEN = 2 - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HADDR_T) :: ref_f - INTEGER(HID_T), INTENT(OUT) :: obj_id - END FUNCTION h5rdereference_object_c - END INTERFACE + MODULE PROCEDURE h5rget_object_type_obj_f - ref_f = ref%ref - hdferr = h5rdereference_object_c(dset_id, ref_f, obj_id ) + END INTERFACE - END SUBROUTINE h5rdereference_object_f +CONTAINS -!---------------------------------------------------------------------- -! Name: h5rdereference_region_f +!****s* H5R/h5rget_region_region_f ! -! Purpose: Opens the dataset region +! NAME +! h5rget_region_region_f ! -! Inputs: -! dset_id - identifier of the dataset containing -! reference to teh regions -! ref - reference to open -! Outputs: -! obj_id - dataspace identifier -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! PURPOSE +! Retrieves a dataspace with the specified region selected ! -! Programmer: Elena Pourmal -! August 12, 1999 +! INPUTS +! dset_id - identifier of the dataset containing +! reference to the regions +! ref - reference to open +! OUTPUTS +! space_id - dataspace identifier +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! Elena Pourmal +! August 12, 1999 ! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). February 28, 2001 +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). February 28, 2001 ! -! Comment: This is a module procedure for the h5rdereference_f -! subroutine. -!---------------------------------------------------------------------- - - - SUBROUTINE h5rdereference_region_f(dset_id, ref, obj_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - TYPE(hdset_reg_ref_t_f), INTENT(IN) :: ref ! Object reference - INTEGER(HID_T), INTENT(OUT) :: obj_id ! Dataspace identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code - - INTEGER :: ref_f(REF_REG_BUF_LEN) ! Local buffer to pass reference - -! INTEGER, EXTERNAL :: h5rdereference_region_c -! Interface is needed for MS FORTRAN +! NOTES +! This is a module procedure for the h5rget_region_f subroutine. ! - 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 - INTEGER(HID_T), INTENT(IN) :: dset_id -! INTEGER, PARAMETER :: REF_REG_BUF_LEN = 3 - INTEGER :: ref_f(REF_REG_BUF_LEN) - INTEGER(HID_T), INTENT(OUT) :: obj_id - END FUNCTION h5rdereference_region_c - END INTERFACE - - ref_f = ref%ref - hdferr = h5rdereference_region_c(dset_id, ref_f, obj_id ) - - END SUBROUTINE h5rdereference_region_f - -!---------------------------------------------------------------------- -! Name: h5rget_region_region_f -! -! Purpose: Retrieves a dataspace with the specified region selected -! -! Inputs: -! dset_id - identifier of the dataset containing -! reference to the regions -! ref - reference to open -! Outputs: -! space_id - dataspace identifier -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). February 28, 2001 -! -! Comment: This is a module procedure for the h5rget_region_f -! subroutine. -!---------------------------------------------------------------------- - - - - SUBROUTINE h5rget_region_region_f(dset_id, ref, space_id, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - TYPE(hdset_reg_ref_t_f), INTENT(IN) :: ref ! Dataset region reference - INTEGER(HID_T), INTENT(OUT) :: space_id ! Space identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER :: ref_f(REF_REG_BUF_LEN) ! Local buffer to pass reference - -! INTEGER, EXTERNAL :: h5rget_region_region_c -! Interface is needed for MS FORTRAN -! - 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 - INTEGER(HID_T), INTENT(IN) :: dset_id -! INTEGER, PARAMETER :: REF_REG_BUF_LEN = 3 - INTEGER :: ref_f(REF_REG_BUF_LEN) - INTEGER(HID_T), INTENT(OUT) :: space_id - END FUNCTION h5rget_region_region_c - END INTERFACE - - ref_f = ref%ref - hdferr = h5rget_region_region_c(dset_id, ref_f, space_id ) - - END SUBROUTINE h5rget_region_region_f - -!---------------------------------------------------------------------- -! Name: h5rget_object_type_obj_f -! -! Purpose: Retrieves the type of object that an object reference points to. -! -! Inputs: -! dset_id - identifier of the dataset containing -! reference to the objects -! ref - reference to open -! Outputs: -! obj_type - object_type, possible values: -! H5G_UNKNOWN_F (-1) -! H5G_GROUP_F 0 -! H5G_DATASET_F 1 -! H5G_TYPE_F 2 -! H5G_LINK_F 3 -! -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). February 28, 2001 -! -! Comment: This is a module procedure for the h5rget_object_type_f -! subroutine. -!---------------------------------------------------------------------- - - - SUBROUTINE h5rget_object_type_obj_f(dset_id, ref, obj_type, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier - TYPE(hobj_ref_t_f), INTENT(IN) :: ref ! Object reference - INTEGER, INTENT(OUT) :: obj_type ! Object type - ! H5G_UNKNOWN_F (-1) - ! H5G_GROUP_F 0 - ! H5G_DATASET_F 1 - ! H5G_TYPE_F 2 - ! H5G_LINK_F 3 - - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HADDR_T) :: ref_f ! Local buffer to pass reference - -! INTEGER, EXTERNAL :: h5rget_object_type_obj_c -! Interface is needed for MS FORTRAN -! - 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 -! INTEGER, PARAMETER :: REF_OBJ_BUF_LEN = 2 - INTEGER(HID_T), INTENT(IN) :: dset_id - INTEGER(HADDR_T) :: ref_f - INTEGER, INTENT(OUT) :: obj_type - END FUNCTION h5rget_object_type_obj_c - END INTERFACE - - ref_f = ref%ref - hdferr = h5rget_object_type_obj_c(dset_id, ref_f, obj_type ) - - END SUBROUTINE h5rget_object_type_obj_f - -!---------------------------------------------------------------------- -! Name: h5rget_name_object_f -! -! Purpose: Retrieves a name of a referenced object. -! -! Inputs: -! loc_id - Identifier for the dataset containing the reference or for the group that dataset is in. -! ref - An object or dataset region reference. -! -! Outputs: -! name - A name associated with the referenced object or dataset region. -! -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! size - The size of the name buffer. -! -! Programmer: M.S. Breitenfeld -! March 28, 2008 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - - SUBROUTINE h5rget_name_object_f(loc_id, ref, name, hdferr, size) +! SOURCE + SUBROUTINE h5rget_region_region_f(dset_id, ref, space_id, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! Identifier for the dataset containing the reference - ! or for the group that dataset is in. - TYPE(hobj_ref_t_f), INTENT(IN) :: ref ! Object reference - INTEGER(SIZE_T), OPTIONAL, INTENT(OUT) :: size ! The size of the name buffer, - ! returning 0 (zero) if no name is associated with the identifier - CHARACTER(LEN=*), INTENT(OUT) :: name ! A name associated with the referenced object or dataset region. - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER(HADDR_T) :: ref_f ! Local buffer to pass reference - - INTEGER(SIZE_T) :: size_default - INTEGER(SIZE_T) :: name_len + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + TYPE(hdset_reg_ref_t_f), INTENT(IN) :: ref ! Dataset region reference + INTEGER(HID_T), INTENT(OUT) :: space_id ! Space identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTEGER :: ref_f(REF_REG_BUF_LEN) ! Local buffer to pass reference INTERFACE - INTEGER FUNCTION h5rget_name_object_c(loc_id, ref_f, name, name_len, size_default) + 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_NAME_OBJECT_C':: h5rget_name_object_c + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5RGET_REGION_REGION_C':: h5rget_region_region_c !DEC$ENDIF - !DEC$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: loc_id - INTEGER(SIZE_T) :: size_default - CHARACTER(LEN=*), INTENT(OUT) :: name - INTEGER(HADDR_T) :: ref_f - - INTEGER(SIZE_T) :: name_len - END FUNCTION h5rget_name_object_c + INTEGER(HID_T), INTENT(IN) :: dset_id + ! INTEGER, PARAMETER :: REF_REG_BUF_LEN = 3 + INTEGER :: ref_f(REF_REG_BUF_LEN) + INTEGER(HID_T), INTENT(OUT) :: space_id + END FUNCTION h5rget_region_region_c END INTERFACE - name_len=LEN(name) - ref_f = ref%ref - hdferr = h5rget_name_object_c(loc_id, ref_f, name, name_len, size_default) - - IF(PRESENT(size)) size = size_default - - END SUBROUTINE h5rget_name_object_f - -!---------------------------------------------------------------------- -! Name: h5rget_name_region_f -! -! Purpose: Retrieves a name of a dataset region. -! -! Inputs: -! loc_id - Identifier for the dataset containing the reference or for the group that dataset is in. -! ref - An object or dataset region reference. -! -! Outputs: -! name - A name associated with the referenced object or dataset region. -! -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! size - The size of the name buffer. -! -! Programmer: M.S. Breitenfeld -! March 28, 2008 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - - SUBROUTINE h5rget_name_region_f(loc_id, ref, name, hdferr, size) + hdferr = h5rget_region_region_c(dset_id, ref_f, space_id ) + + END SUBROUTINE h5rget_region_region_f + +!****s* H5R/h5rget_object_type_obj_f +! +! NAME +! h5rget_object_type_obj_f +! +! PURPOSE +! Retrieves the type of object that an object reference points to. +! +! INPUTS +! dset_id - identifier of the dataset containing +! reference to the objects +! ref - reference to open +! OUTPUTS +! obj_type - object_type, possible values: +! H5G_UNKNOWN_F (-1) +! H5G_GROUP_F 0 +! H5G_DATASET_F 1 +! H5G_TYPE_F 2 +! H5G_LINK_F 3 +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). February 28, 2001 +! +! NOTES +! This is a module procedure for the h5rget_object_type_f +! subroutine. +! SOURCE + SUBROUTINE h5rget_object_type_obj_f(dset_id, ref, obj_type, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! Identifier for the dataset containing the reference - ! or for the group that dataset is in. - TYPE(hdset_reg_ref_t_f), INTENT(IN) :: ref ! Object reference - INTEGER(SIZE_T), OPTIONAL, INTENT(OUT) :: size ! The size of the name buffer, - ! returning 0 (zero) if no name is associated with the identifier - CHARACTER(LEN=*), INTENT(OUT) :: name ! A name associated with the referenced object or dataset region. - INTEGER, INTENT(OUT) :: hdferr ! Error code - - INTEGER :: ref_f(REF_REG_BUF_LEN) ! Local buffer to pass reference - INTEGER(SIZE_T) :: size_default - INTEGER(SIZE_T) :: name_len + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + TYPE(hobj_ref_t_f), INTENT(IN) :: ref ! Object reference + INTEGER, INTENT(OUT) :: obj_type ! Object type + ! H5G_UNKNOWN_F (-1) + ! H5G_GROUP_F 0 + ! H5G_DATASET_F 1 + ! H5G_TYPE_F 2 + ! H5G_LINK_F 3 + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTEGER(HADDR_T) :: ref_f ! Local buffer to pass reference INTERFACE - INTEGER FUNCTION h5rget_name_region_c(loc_id, ref_f, name, name_len, size_default) + 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_NAME_REGION_C':: h5rget_name_region_c + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5RGET_OBJECT_TYPE_OBJ_C':: h5rget_object_type_obj_c !DEC$ENDIF - !DEC$ATTRIBUTES reference :: name - INTEGER(HID_T), INTENT(IN) :: loc_id - INTEGER(SIZE_T) :: size_default - CHARACTER(LEN=*), INTENT(OUT) :: name - INTEGER :: ref_f(REF_REG_BUF_LEN) - - INTEGER(SIZE_T) :: name_len - END FUNCTION h5rget_name_region_c + ! INTEGER, PARAMETER :: REF_OBJ_BUF_LEN = 2 + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HADDR_T) :: ref_f + INTEGER, INTENT(OUT) :: obj_type + END FUNCTION h5rget_object_type_obj_c END INTERFACE - name_len=LEN(name) - ref_f = ref%ref - hdferr = h5rget_name_region_c(loc_id, ref_f, name, name_len, size_default) - - IF(PRESENT(size)) size = size_default + hdferr = h5rget_object_type_obj_c(dset_id, ref_f, obj_type ) - END SUBROUTINE h5rget_name_region_f + END SUBROUTINE h5rget_object_type_obj_f END MODULE H5R diff --git a/fortran/src/H5Rff_F03.f90 b/fortran/src/H5Rff_F03.f90 new file mode 100644 index 0000000..7f66745 --- /dev/null +++ b/fortran/src/H5Rff_F03.f90 @@ -0,0 +1,655 @@ +!****h* ROBODoc/H5R (F03) +! +! NAME +! MODULE H5R_PROVISIONAL +! +! FILE +! fortran/src/H5Rff_F03.f90 +! +! PURPOSE +! This file contains Fortran 90 and Fortran 2003 interfaces for H5R functions. +! It contains the same functions as H5Rff_DEPRECIATE.f90 but includes the +! Fortran 2003 functions and the interface listings. This file will be compiled +! instead of H5Rff_DEPRECIATE.f90 if Fortran 2003 functions are enabled. +! +! COPYRIGHT +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +! NOTES +! *** IMPORTANT *** +! If you add a new H5R function you must add the function name to the +! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! This is needed for Windows based operating systems. +! +!***** +MODULE H5R_PROVISIONAL + USE H5GLOBAL + + ! If you change the value of these parameters, do not forget to change corresponding + ! values in the H5f90.h file. + ! INTEGER, PARAMETER :: REF_OBJ_BUF_LEN = 2 + ! INTEGER, PARAMETER :: REF_REG_BUF_LEN = 3 + ! + ! TYPE hobj_ref_t_f + ! INTEGER ref(REF_OBJ_BUF_LEN) + ! END TYPE + ! + ! TYPE hdset_reg_ref_t_f + ! INTEGER ref(REF_REG_BUF_LEN) + ! END TYPE + ! + INTERFACE h5rcreate_f + + MODULE PROCEDURE h5rcreate_object_f ! obsolete + MODULE PROCEDURE h5rcreate_region_f ! obsolete + MODULE PROCEDURE h5rcreate_ptr_f ! F2003 + + END INTERFACE + + INTERFACE h5rdereference_f + + MODULE PROCEDURE h5rdereference_object_f ! obsolete + MODULE PROCEDURE h5rdereference_region_f ! obsolete + MODULE PROCEDURE h5rdereference_ptr_f ! F2003 + + END INTERFACE + + INTERFACE h5rget_name_f + + MODULE PROCEDURE h5rget_name_object_f ! obsolete + MODULE PROCEDURE h5rget_name_region_f ! obsolete + MODULE PROCEDURE h5rget_name_ptr_f ! F2003 + + END INTERFACE + + INTERFACE + INTEGER FUNCTION h5rget_name_ptr_c(loc_id, ref_type, ref, name, name_len, size_default) + USE, INTRINSIC :: ISO_C_BINDING + USE H5GLOBAL + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5RGET_NAME_PTR_C':: h5rget_name_ptr_c + !DEC$ENDIF + !DEC$ATTRIBUTES reference :: name + INTEGER(HID_T), INTENT(IN) :: loc_id + INTEGER, INTENT(IN) :: ref_type + TYPE(C_PTR), INTENT(IN), VALUE :: ref + CHARACTER(LEN=*), INTENT(OUT) :: name + INTEGER(SIZE_T) :: name_len + INTEGER(SIZE_T) :: size_default + END FUNCTION h5rget_name_ptr_c + END INTERFACE + + INTERFACE + INTEGER FUNCTION h5rdereference_ptr_c(obj_id, ref_type, ref, ref_obj_id) + USE H5GLOBAL + USE, INTRINSIC :: ISO_C_BINDING + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5RDEREFERENCE_PTR_C':: h5rdereference_ptr_c + !DEC$ENDIF + INTEGER(HID_T), INTENT(IN) :: obj_id + INTEGER, INTENT(IN) :: ref_type + TYPE(C_PTR), INTENT(IN), VALUE :: ref + INTEGER(HID_T), INTENT(OUT) :: ref_obj_id + END FUNCTION h5rdereference_ptr_c + END INTERFACE + + INTERFACE + INTEGER FUNCTION h5rcreate_ptr_c(ref, loc_id, name, namelen, ref_type, space_id) + USE, INTRINSIC :: ISO_C_BINDING + USE H5GLOBAL + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5RCREATE_PTR_C':: h5rcreate_ptr_c + !DEC$ENDIF + !DEC$ATTRIBUTES reference :: name + TYPE(C_PTR), VALUE :: ref + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER :: namelen + INTEGER, INTENT(IN) :: ref_type + INTEGER(HID_T), INTENT(IN) :: space_id + END FUNCTION h5rcreate_ptr_c + END INTERFACE + +CONTAINS + +!****s* H5R (F03)/h5rcreate_object_f +! +! NAME +! h5rcreate_object_f +! +! PURPOSE +! Creates reference to the object +! +! Inputs: +! loc_id - location identifier +! name - name of the object at the specified location +! Outputs: +! ref - reference to the specified object +! hdferr: - error code +! Success: 0 +! Failure: -1 +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). February 28, 2001 +! +! NOTES +! This is a module procedure for the h5rcreate_f subroutine. +! +! Signature: + SUBROUTINE h5rcreate_object_f(loc_id, name, ref, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id ! Location identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the object at location specified + ! by loc_id identifier + TYPE(hobj_ref_t_f), INTENT(INOUT), TARGET :: ref ! Object reference + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTEGER :: namelen ! Name length + + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(ref) + + namelen = LEN(name) + + hdferr = h5rcreate_ptr_c(f_ptr, loc_id, name, namelen, INT(0), INT(-1,HID_T)) + + END SUBROUTINE h5rcreate_object_f + +!****s* H5R (F03)/h5rcreate_region_f +! +! NAME +! h5rcreate_region_f +! +! PURPOSE +! Creates reference to the dataset region +! +! Inputs: +! loc_id - location identifier +! name - name of the dataset at the specified location +! space_id - dataspace identifier that describes selected region +! Outputs: +! ref - reference to the dataset region +! hdferr: - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). February 28, 2001 +! +! NOTES +! This is a module procedure for the h5rcreate_f subroutine. +! +! Signature: + SUBROUTINE h5rcreate_region_f(loc_id, name, space_id, ref, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id ! Location identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the dataset at location specified + ! by loc_id identifier + INTEGER(HID_T), INTENT(IN) :: space_id ! Dataset's dataspace identifier + TYPE(hdset_reg_ref_t_f), INTENT(INOUT), TARGET :: ref ! Dataset region reference + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTEGER :: namelen ! Name length + INTEGER :: ref_f(REF_REG_BUF_LEN) ! Local buffer to pass reference + + TYPE(C_PTR) :: f_ptr + +! !$ 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$ATTRIBUTES reference :: name +! !$ ! INTEGER, PARAMETER :: REF_REG_BUF_LEN = 3 +! !$ INTEGER :: ref_f(REF_REG_BUF_LEN) +! !$ INTEGER(HID_T), INTENT(IN) :: loc_id +! !$ CHARACTER(LEN=*), INTENT(IN) :: name +! !$ INTEGER :: namelen +! !$ INTEGER(HID_T), INTENT(IN) :: space_id +! !$ END FUNCTION h5rcreate_region_c +! !$ END INTERFACE + + f_ptr = C_LOC(ref) + + namelen = LEN(name) + hdferr = h5rcreate_ptr_c(f_ptr, loc_id, name, namelen, 1, space_id) + +! !$ ref_f = 0 +! !$ hdferr = h5rcreate_region_c(ref_f, loc_id, name, namelen, space_id ) +! !$ ref%ref = ref_f + + END SUBROUTINE h5rcreate_region_f + +!****s* H5R (F03)/h5rcreate_ptr_f +! +! NAME +! h5rcreate_ptr_f +! +! PURPOSE +! Creates a reference. +! +! Inputs: +! loc_id - location identifier +! name - name of the dataset at the specified location +! ref_type - type of reference: +! H5R_OBJECT +! H5T_STD_REF_DSETREG +! Outputs: +! ref - reference created by the function call. +! hdferr - error code +! Success: 0 +! Failure: -1 +! OPTIONAL +! space_id - dataspace identifier that describes selected region +! +! AUTHOR +! M. Scot Breitenfeld +! June 20, 2008 +! +! NOTES +! This is a module procedure for the h5rcreate_f +! subroutine where the output is a pointer. +! +! Signature: + SUBROUTINE h5rcreate_ptr_f(loc_id, name, ref_type, ref, hdferr, space_id) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id ! Location identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the dataset at location specified + ! by loc_id identifier + INTEGER, INTENT(IN) :: ref_type ! type of reference + TYPE(C_PTR), INTENT(INOUT) :: ref ! Reference created by the function call + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), INTENT(IN), OPTIONAL :: space_id ! Dataset's dataspace identifier +!***** + INTEGER :: namelen ! Name length + INTEGER(HID_T) :: space_id_c + + namelen = LEN(name) + space_id_c = -1 + IF(PRESENT(space_id)) space_id_c = space_id + hdferr = h5rcreate_ptr_c(ref, loc_id, name, namelen, ref_type, space_id_c) + + END SUBROUTINE h5rcreate_ptr_f +!****s* H5R (F03)/h5rdereference_object_f +! +! NAME +! h5rdereference_object_f +! +! PURPOSE +! Opens the HDF5 object referenced +! +! Inputs: +! dset_id - identifier of the dataset containing +! reference +! ref - reference to open +! Outputs: +! obj_id - object_identifier +! hdferr: - error code +! Success: 0 +! Failure: -1 +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). February 28, 2001 +! +! NOTES +! This is a module procedure for the h5rdereference_f subroutine. +! +! Signature: + SUBROUTINE h5rdereference_object_f(obj_id, ref, ref_obj_id, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: obj_id ! Dataset identifier + TYPE(hobj_ref_t_f), INTENT(IN), TARGET :: ref ! Object reference + INTEGER(HID_T), INTENT(OUT) :: ref_obj_id ! Object identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTEGER(HADDR_T) :: ref_f ! Local buffer to pass reference + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(ref) + hdferr = h5rdereference_ptr_c(obj_id, 0, f_ptr, ref_obj_id) + + END SUBROUTINE h5rdereference_object_f +!****s* H5R (F03)/h5rdereference_region_f +! +! NAME +! h5rdereference_region_f +! +! PURPOSE +! Opens the dataset region +! +! Inputs: +! dset_id - identifier of the dataset containing +! reference to teh regions +! ref - reference to open +! Outputs: +! obj_id - dataspace identifier +! hdferr: - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). February 28, 2001 +! +! NOTES +! This is a module procedure for the h5rdereference_f subroutine. +! +! Signature: + SUBROUTINE h5rdereference_region_f(obj_id, ref, ref_obj_id, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: obj_id ! Dataset identifier + TYPE(hdset_reg_ref_t_f), INTENT(IN), TARGET :: ref ! Object reference + INTEGER(HID_T), INTENT(OUT) :: ref_obj_id ! Dataspace identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(ref) + hdferr = h5rdereference_ptr_c(obj_id, 1, f_ptr, ref_obj_id) + + END SUBROUTINE h5rdereference_region_f + +!****s* H5R (F03)/h5rdereference_ptr_f +! +! NAME +! h5rdereference_ptr_f +! +! PURPOSE +! Opens the HDF5 object referenced. +! +! Inputs: +! obj_id - valid identifier for the file containing the +! referenced object or any object in that file. +! ref_type - the reference type of ref. +! ref - Reference to open. +! Outputs: +! ref_obj_id - identifier of referenced object +! hdferr - error code +! Success: 0 +! Failure: -1 +! AUTHOR +! M. Scot Breitenfeld +! June 20, 2008 +! +! NOTES +! This is a module procedure for the h5rdereference_f +! subroutine using pointers. +! +! Signature: + SUBROUTINE h5rdereference_ptr_f(obj_id, ref_type, ref, ref_obj_id, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: obj_id ! Valid identifier for the file containing the + ! referenced object or any object in that file. + INTEGER, INTENT(IN) :: ref_type ! The reference type of ref. + TYPE(C_PTR), INTENT(IN) :: ref ! Object reference + INTEGER(HID_T), INTENT(OUT) :: ref_obj_id + ! Identifier of referenced object + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + hdferr = h5rdereference_ptr_c(obj_id, ref_type, ref, ref_obj_id) + + END SUBROUTINE h5rdereference_ptr_f +! +!****s* H5R (F03)/h5rget_name_object_f +! +! NAME +! h5rget_name_object_f +! +! PURPOSE +! Retrieves a name of a referenced object. +! +! Inputs: +! loc_id - Identifier for the dataset containing the reference or for the group that dataset is in. +! ref - An object or dataset region reference. +! +! Outputs: +! name - A name associated with the referenced object or dataset region. +! +! hdferr: - error code +! Success: 0 +! Failure: -1 +! +! Optional parameters: +! size - The size of the name buffer. +! +! AUTHOR +! M. Scot Breitenfeld +! March 28, 2008 +! +! Signature:S + SUBROUTINE h5rget_name_object_f(loc_id, ref, name, hdferr, size) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id ! Identifier for the dataset containing the reference + ! or for the group that dataset is in. + TYPE(hobj_ref_t_f), INTENT(IN), TARGET :: ref ! Object reference + INTEGER(SIZE_T), OPTIONAL, INTENT(OUT) :: size ! The size of the name buffer, + ! returning 0 (zero) if no name is associated + ! with the identifier + CHARACTER(LEN=*), INTENT(OUT) :: name ! A name associated with the referenced object or dataset region. + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTEGER(HADDR_T) :: ref_f ! Local buffer to pass reference + + INTEGER(SIZE_T) :: size_default + INTEGER(SIZE_T) :: name_len + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(ref) + + name_len=LEN(name) + + hdferr = h5rget_name_ptr_c(loc_id, 0, f_ptr, name, name_len, size_default) + + + IF(PRESENT(size)) size = size_default + + END SUBROUTINE h5rget_name_object_f +!****s* H5R (F03)/h5rget_name_region_f +! +! NAME +! h5rget_name_region_f +! +! PURPOSE +! Retrieves a name of a dataset region. +! +! Inputs: +! loc_id - Identifier for the dataset containing the reference or +! for the group that dataset is in. +! ref - An object or dataset region reference. +! +! Outputs: +! name - A name associated with the referenced object or dataset region. +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! Optional parameters: +! size - The size of the name buffer. +! +! AUTHOR +! M. Scot Breitenfeld +! March 28, 2008 +! +! Signature: + SUBROUTINE h5rget_name_region_f(loc_id, ref, name, hdferr, size) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id ! Identifier for the dataset containing the reference + ! or for the group that dataset is in. + TYPE(hdset_reg_ref_t_f), INTENT(IN), TARGET :: ref ! Object reference + INTEGER(SIZE_T), OPTIONAL, INTENT(OUT) :: size ! The size of the name buffer, + ! returning 0 (zero) if no name is associated with the identifier + CHARACTER(LEN=*), INTENT(OUT) :: name ! A name associated with the referenced object or dataset region. + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTEGER :: ref_f(REF_REG_BUF_LEN) ! Local buffer to pass reference + INTEGER(SIZE_T) :: size_default + INTEGER(SIZE_T) :: name_len + TYPE(C_PTR) :: f_ptr + + f_ptr = C_LOC(ref) + + name_len=LEN(name) + + hdferr = h5rget_name_ptr_c(loc_id, 1, f_ptr, name, name_len, size_default) + + IF(PRESENT(size)) size = size_default + + END SUBROUTINE h5rget_name_region_f + + !****s* H5R (F03)/h5rget_name_ptr_f + ! + ! NAME + ! h5rget_name_ptr_f + ! + ! PURPOSE + ! Retrieves a name of a referenced object. + ! + ! Inputs: + ! loc_id - Identifier for the dataset containing the reference or + ! for the group that dataset is in. + ! ref_type - Type of reference. + ! ref - An object or dataset region reference. + ! + ! Outputs: + ! name - A name associated with the referenced object or dataset ptr. + ! + ! hdferr - error code + ! Success: 0 + ! Failure: -1 + ! + ! Optional parameters: + ! size - The size of the name buffer. + ! + ! AUTHOR + ! M. Scot Breitenfeld + ! March 28, 2008 + ! + ! Signature: + SUBROUTINE h5rget_name_ptr_f(loc_id, ref_type, ref, name, hdferr, size) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id ! Identifier for the dataset containing the reference + ! or for the group that dataset is in. + INTEGER, INTENT(IN) :: ref_type ! Type of reference. + TYPE(C_PTR), INTENT(IN) :: ref ! An object or dataset region reference. + CHARACTER(LEN=*), INTENT(OUT) :: name ! A name associated with the referenced object or dataset ptr. + INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(SIZE_T), OPTIONAL, INTENT(OUT) :: size ! The size of the name buffer, + ! returning 0 (zero) if no name is associated + ! with the identifier +!***** + INTEGER(SIZE_T) :: size_default + INTEGER(SIZE_T) :: name_len + + name_len=LEN(name) + + hdferr = h5rget_name_ptr_c(loc_id, ref_type, ref, name, name_len, size_default) + + IF(PRESENT(size)) size = size_default + + END SUBROUTINE h5rget_name_ptr_f + + !****s* H5R (F03)/h5rget_obj_type_f + ! + ! NAME + ! h5rget_obj_type_f + ! + ! PURPOSE + ! Retrieves the type of object that an object reference points to. + ! + ! Inputs: + ! loc_id - Identifier for the dataset containing the reference or + ! for the group that dataset is in. + ! ref_type - Type of reference to query. + ! ref - Reference to query. + ! + ! Outputs: + ! obj_type - Type of referenced object. + ! H5G_UNKNOWN_F (-1) + ! H5G_LINK_F 0 + ! H5G_GROUP_F 1 + ! H5G_DATASET_F 2 + ! H5G_TYPE_F 3 + ! + ! hdferr - error code + ! Success: 0 + ! Failure: -1 + ! + ! AUTHOR + ! M. Scot Breitenfeld + ! Decemeber 17, 2008 + ! + ! Signature: + SUBROUTINE h5rget_obj_type_f(loc_id, ref_type, ref, obj_type, hdferr) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id + INTEGER, INTENT(IN) :: ref_type + TYPE(C_PTR), INTENT(IN) :: ref + INTEGER, INTENT(OUT) :: obj_type + INTEGER, INTENT(OUT) :: hdferr + !***** + + INTERFACE + INTEGER FUNCTION h5rget_obj_type_c(loc_id, ref_type, ref, obj_type) + USE, INTRINSIC :: ISO_C_BINDING + USE H5GLOBAL + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5RGET_OBJ_TYPE_C':: h5rget_obj_type_c + !DEC$ENDIF + INTEGER(HID_T), INTENT(IN) :: loc_id + INTEGER, INTENT(IN) :: ref_type + TYPE(C_PTR), VALUE :: ref + INTEGER :: obj_type + END FUNCTION h5rget_obj_type_c + END INTERFACE + + hdferr = h5rget_obj_type_c(loc_id, ref_type, ref, obj_type) + + END SUBROUTINE h5rget_obj_type_f + +END MODULE H5R_PROVISIONAL diff --git a/fortran/src/H5Rff_F90.f90 b/fortran/src/H5Rff_F90.f90 new file mode 100644 index 0000000..3f02825 --- /dev/null +++ b/fortran/src/H5Rff_F90.f90 @@ -0,0 +1,449 @@ +!****h* ROBODoc/H5R (F90) +! +! NAME +! MODULE H5R_PROVISIONAL +! +! FILE +! fortran/src/H5Rff_F90.f90 +! +! PURPOSE +! This file contains Fortran 90 interfaces for H5R functions. It contains +! the same functions as H5Rff_F03.f90 but excludes the Fortran 2003 functions +! and the interface listings. This file will be compiled instead of H5Rff_F03.f90 +! if Fortran 2003 functions are not enabled. +! +! COPYRIGHT +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +! NOTES +! *** IMPORTANT *** +! If you add a new H5R function you must add the function name to the +! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! This is needed for Windows based operating systems. +!***** + +MODULE H5R_PROVISIONAL + USE H5GLOBAL + +! If you change the value of these parameters, do not forget to change corresponding +! values in the H5f90.h file. +! INTEGER, PARAMETER :: REF_OBJ_BUF_LEN = 2 +! INTEGER, PARAMETER :: REF_REG_BUF_LEN = 3 +! +! TYPE hobj_ref_t_f +! INTEGER ref(REF_OBJ_BUF_LEN) +! END TYPE +! +! TYPE hdset_reg_ref_t_f +! INTEGER ref(REF_REG_BUF_LEN) +! END TYPE +! + INTERFACE h5rcreate_f + + MODULE PROCEDURE h5rcreate_object_f + MODULE PROCEDURE h5rcreate_region_f + + END INTERFACE + + INTERFACE h5rdereference_f + + MODULE PROCEDURE h5rdereference_object_f + MODULE PROCEDURE h5rdereference_region_f + + END INTERFACE + + INTERFACE h5rget_name_f + + MODULE PROCEDURE h5rget_name_object_f + MODULE PROCEDURE h5rget_name_region_f + + END INTERFACE + +CONTAINS + +!****s* H5R (F90)/h5rcreate_object_f +! +! NAME +! h5rcreate_object_f +! +! PURPOSE +! Creates reference to the object +! +! INPUTS +! loc_id - location identifier +! name - name of the object at the specified location +! OUTPUTS +! ref - reference to the specified object +! hdferr: - error code +! Success: 0 +! Failure: -1 +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). February 28, 2001 +! +! NOTES +! This is a module procedure for the h5rcreate_f subroutine. +! +! SOURCE + SUBROUTINE h5rcreate_object_f(loc_id, name, ref, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id ! Location identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the object at location specified + ! by loc_id identifier + TYPE(hobj_ref_t_f), INTENT(OUT) :: ref ! Object reference + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTEGER :: namelen ! Name length + INTEGER(HADDR_T) :: ref_f ! Local buffer to pass reference + + 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$ATTRIBUTES reference :: name + INTEGER(HADDR_T) :: ref_f + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER :: namelen + END FUNCTION h5rcreate_object_c + END INTERFACE + + namelen = LEN(name) + ref_f = 0 + hdferr = h5rcreate_object_c(ref_f, loc_id, name, namelen ) + ref%ref = ref_f + + END SUBROUTINE h5rcreate_object_f + +!****s* H5R (F90)/h5rcreate_region_f +! +! NAME +! h5rcreate_region_f +! +! PURPOSE +! Creates reference to the dataset region +! +! INPUTS +! loc_id - location identifier +! name - name of the dataset at the specified location +! space_id - dataspace identifier that describes selected region +! OUTPUTS +! ref - reference to the dataset region +! hdferr: - error code +! Success: 0 +! Failure: -1 +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). February 28, 2001 +! +! NOTES +! This is a module procedure for the h5rcreate_f subroutine. +! +! SOURCE + SUBROUTINE h5rcreate_region_f(loc_id, name, space_id, ref, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id ! Location identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the dataset at location specified + ! by loc_id identifier + INTEGER(HID_T), INTENT(IN) :: space_id ! Dataset's dataspace identifier + TYPE(hdset_reg_ref_t_f), INTENT(OUT) :: ref ! Dataset region reference + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTEGER :: namelen ! Name length + INTEGER :: ref_f(REF_REG_BUF_LEN) ! Local buffer to pass reference + + 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$ATTRIBUTES reference :: name + ! INTEGER, PARAMETER :: REF_REG_BUF_LEN = 3 + INTEGER :: ref_f(REF_REG_BUF_LEN) + INTEGER(HID_T), INTENT(IN) :: loc_id + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER :: namelen + INTEGER(HID_T), INTENT(IN) :: space_id + END FUNCTION h5rcreate_region_c + END INTERFACE + + namelen = LEN(name) + ref_f = 0 + hdferr = h5rcreate_region_c(ref_f, loc_id, name, namelen, space_id ) + ref%ref = ref_f + + END SUBROUTINE h5rcreate_region_f +!****s* H5R (F90)/h5rdereference_object_f +! +! NAME +! h5rdereference_object_f +! +! PURPOSE +! Opens the HDF5 object referenced +! +! INPUTS +! dset_id - identifier of the dataset containing reference +! ref - reference to open +! OUTPUTS +! obj_id - object_identifier +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). February 28, 2001 +! +! NOTES +! This is a module procedure for the h5rdereference_f subroutine. +! +! SOURCE + SUBROUTINE h5rdereference_object_f(dset_id, ref, obj_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + TYPE(hobj_ref_t_f), INTENT(IN) :: ref ! Object reference + INTEGER(HID_T), INTENT(OUT) :: obj_id ! Object identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTEGER(HADDR_T) :: ref_f ! Local buffer to pass reference + + 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 + ! INTEGER, PARAMETER :: REF_OBJ_BUF_LEN = 2 + INTEGER(HID_T), INTENT(IN) :: dset_id + INTEGER(HADDR_T) :: ref_f + INTEGER(HID_T), INTENT(OUT) :: obj_id + END FUNCTION h5rdereference_object_c + END INTERFACE + + ref_f = ref%ref + hdferr = h5rdereference_object_c(dset_id, ref_f, obj_id ) + + END SUBROUTINE h5rdereference_object_f +!****s* H5R (F90)/h5rdereference_region_f +! +! NAME +! h5rdereference_region_f +! +! PURPOSE +! Opens the dataset region +! +! INPUTS +! dset_id - identifier of the dataset containing +! reference to teh regions +! ref - reference to open +! OUTPUTS +! obj_id - dataspace identifier +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). February 28, 2001 +! +! NOTES +! This is a module procedure for the h5rdereference_f subroutine. +! +! SOURCE + SUBROUTINE h5rdereference_region_f(dset_id, ref, obj_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier + TYPE(hdset_reg_ref_t_f), INTENT(IN) :: ref ! Object reference + INTEGER(HID_T), INTENT(OUT) :: obj_id ! Dataspace identifier + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTEGER :: ref_f(REF_REG_BUF_LEN) ! Local buffer to pass reference + + 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 + INTEGER(HID_T), INTENT(IN) :: dset_id +! INTEGER, PARAMETER :: REF_REG_BUF_LEN = 3 + INTEGER :: ref_f(REF_REG_BUF_LEN) + INTEGER(HID_T), INTENT(OUT) :: obj_id + END FUNCTION h5rdereference_region_c + END INTERFACE + + ref_f = ref%ref + hdferr = h5rdereference_region_c(dset_id, ref_f, obj_id ) + + END SUBROUTINE h5rdereference_region_f +!****s* H5R (F90)/h5rget_name_object_f +! +! NAME +! h5rget_name_object_f +! +! PURPOSE +! Retrieves a name of a referenced object. +! +! INPUTS +! loc_id - Identifier for the dataset containing the reference or for the group that dataset is in. +! ref - An object or dataset region reference. +! +! OUTPUTS +! name - A name associated with the referenced object or dataset region. +! +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! OPTIONAL PARAMETERS +! size - The size of the name buffer. +! +! AUTHOR +! M. Scot Breitenfeld +! March 28, 2008 +! +! SOURCES + SUBROUTINE h5rget_name_object_f(loc_id, ref, name, hdferr, size) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id ! Identifier for the dataset containing the reference + ! or for the group that dataset is in. + TYPE(hobj_ref_t_f), INTENT(IN) :: ref ! Object reference + INTEGER(SIZE_T), OPTIONAL, INTENT(OUT) :: size ! The size of the name buffer, + ! returning 0 (zero) if no name is associated with the identifier + CHARACTER(LEN=*), INTENT(OUT) :: name ! A name associated with the referenced object or dataset region. + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTEGER(HADDR_T) :: ref_f ! Local buffer to pass reference + + INTEGER(SIZE_T) :: size_default + INTEGER(SIZE_T) :: name_len + + 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$ATTRIBUTES reference :: name + INTEGER(HID_T), INTENT(IN) :: loc_id + INTEGER(SIZE_T) :: size_default + CHARACTER(LEN=*), INTENT(OUT) :: name + INTEGER(HADDR_T) :: ref_f + + INTEGER(SIZE_T) :: name_len + END FUNCTION h5rget_name_object_c + END INTERFACE + + name_len=LEN(name) + + ref_f = ref%ref + hdferr = h5rget_name_object_c(loc_id, ref_f, name, name_len, size_default) + + IF(PRESENT(size)) size = size_default + + END SUBROUTINE h5rget_name_object_f + +!****s* H5R (F90)/h5rget_name_region_f +! +! NAME +! h5rget_name_region_f +! +! PURPOSE +! Retrieves a name of a dataset region. +! +! INPUTS +! loc_id - Identifier for the dataset containing the reference or +! for the group that dataset is in. +! ref - An object or dataset region reference. +! +! OUTPUTS +! name - A name associated with the referenced object or dataset region. +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! OPTIONAL PARAMETERS +! size - The size of the name buffer. +! +! AUTHOR +! M. Scot Breitenfeld +! March 28, 2008 +! +! SOURCE + SUBROUTINE h5rget_name_region_f(loc_id, ref, name, hdferr, size) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: loc_id ! Identifier for the dataset containing the reference + ! or for the group that dataset is in. + TYPE(hdset_reg_ref_t_f), INTENT(IN) :: ref ! Object reference + INTEGER(SIZE_T), OPTIONAL, INTENT(OUT) :: size ! The size of the name buffer, + ! returning 0 (zero) if no name is associated + ! with the identifier + CHARACTER(LEN=*), INTENT(OUT) :: name ! A name associated with the referenced object or dataset region. + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTEGER :: ref_f(REF_REG_BUF_LEN) ! Local buffer to pass reference + INTEGER(SIZE_T) :: size_default + INTEGER(SIZE_T) :: name_len + + 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$ATTRIBUTES reference :: name + INTEGER(HID_T), INTENT(IN) :: loc_id + INTEGER(SIZE_T) :: size_default + CHARACTER(LEN=*), INTENT(OUT) :: name + INTEGER :: ref_f(REF_REG_BUF_LEN) + + INTEGER(SIZE_T) :: name_len + END FUNCTION h5rget_name_region_c + END INTERFACE + + name_len=LEN(name) + + ref_f = ref%ref + hdferr = h5rget_name_region_c(loc_id, ref_f, name, name_len, size_default) + + IF(PRESENT(size)) size = size_default + + END SUBROUTINE h5rget_name_region_f + +END MODULE H5R_PROVISIONAL diff --git a/fortran/src/H5Sf.c b/fortran/src/H5Sf.c index e161618..2cfb1eb 100644 --- a/fortran/src/H5Sf.c +++ b/fortran/src/H5Sf.c @@ -1,4 +1,9 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +/****h* H5Sf/H5Sf + * PURPOSE + * This file contains C stubs for H5S Fortran APIs + * + * COPYRIGHT + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * @@ -11,26 +16,38 @@ * is linked from the top-level documents page. It can also be found at * * http://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 "H5f90.h" #include "H5Eprivate.h" -/*---------------------------------------------------------------------------- - * Name: h5screate_simple_c - * Purpose: Call H5Screate_simple to create a dataspace - * Inputs: rank - number of dimensions of dataspace +/****if* H5Sf/h5screate_simple_c + * NAME + * h5screate_simple_c + * PURPOSE + * Call H5Screate_simple to create a dataspace + * INPUTS + * rank - number of dimensions of dataspace * dims - array of the size of each dimension maxdims - an array of the maximum size of each dimension - * Outputs: space_id - identifier of the created dataspace - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * OUTPUTS + * space_id - identifier of the created dataspace + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Wednesday, August 4, 1999 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5screate_simple_c ( int_f *rank, hsize_t_f *dims, hsize_t_f *maxdims, hid_t_f *space_id ) +/******/ { hsize_t c_dims[H5S_MAX_RANK]; hsize_t c_maxdims[H5S_MAX_RANK]; @@ -56,18 +73,26 @@ done: return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5sclose_c - * Purpose: Call H5Sclose to close the dataspace - * Inputs: space_id - identifier of the dataspace to be closed - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal +/****if* H5Sf/h5sclose_c + * NAME + * h5sclose_c + * PURPOSE + * Call H5Sclose to close the dataspace + * INPUTS + * space_id - identifier of the dataspace to be closed + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Wednesday, August 4, 1999 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5sclose_c ( hid_t_f *space_id ) +/******/ { int ret_value = 0; hid_t c_space_id; @@ -77,20 +102,28 @@ nh5sclose_c ( hid_t_f *space_id ) return ret_value; } - -/*---------------------------------------------------------------------------- - * Name: h5screate_c - * Purpose: Call H5Screate to create a dataspace - * Inputs: classtype - type of the dataspace class - * Outputs: space_id - identifier of the created dataspace - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal +/****if* H5Sf/h5screate_c + * NAME + * h5screate_c + * PURPOSE + * Call H5Screate to create a dataspace + * INPUTS + * classtype - type of the dataspace class + * OUTPUTS + * space_id - identifier of the created dataspace + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Tuesday, August 10, 1999 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5screate_c ( int_f *classtype, hid_t_f *space_id ) +/******/ { H5S_class_t c_classtype; int ret_value = 0; @@ -103,19 +136,28 @@ nh5screate_c ( int_f *classtype, hid_t_f *space_id ) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5scopy_c - * Purpose: Call H5Scopy to copy dataspace - * Inputs: space_id - identifier of the dataspace to be copied - * Outputs: new_space_id - identifier of the new datspace - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal +/****if* H5Sf/h5scopy_c + * NAME + * h5scopy_c + * PURPOSE + * Call H5Scopy to copy dataspace + * INPUTS + * space_id - identifier of the dataspace to be copied + * OUTPUTS + * new_space_id - identifier of the new datspace + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Tuesday, August 10, 1999 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5scopy_c( hid_t_f *space_id , hid_t_f *new_space_id) +/******/ { int ret_value = 0; hid_t c_new_space_id; @@ -129,22 +171,31 @@ nh5scopy_c( hid_t_f *space_id , hid_t_f *new_space_id) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5sget_select_hyper_nblocks_c - * Purpose: Call H5SH5Sget_select_hyper_nblocks to +/****if* H5Sf/h5sget_select_hyper_nblocks_c + * NAME + * h5sget_select_hyper_nblocks_c + * PURPOSE + * Call H5SH5Sget_select_hyper_nblocks to * get the the number of hyperslab blocks in * the current dataspace selection if successful - * Inputs: space_id - identifier of the dataspace - * Outputs: num_blocks - number of hyperslab blocks in + * INPUTS + * space_id - identifier of the dataspace + * OUTPUTS + * num_blocks - number of hyperslab blocks in * the current dataspace selection - * Returns: 0 on success, -1 on failure - * Programmer: Xiangyang Su + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Xiangyang Su * Friday, November 12, 1999 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5sget_select_hyper_nblocks_c( hid_t_f *space_id , hssize_t_f * num_blocks) +/******/ { int ret_value = 0; hid_t c_space_id; @@ -158,22 +209,31 @@ nh5sget_select_hyper_nblocks_c( hid_t_f *space_id , hssize_t_f * num_blocks) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5sget_select_elem_npoints_c - * Purpose: Call H5Sget_select_elem_npoints to +/****if* H5Sf/h5sget_select_elem_npoints_c + * NAME + * h5sget_select_elem_npoints_c + * PURPOSE + * Call H5Sget_select_elem_npoints to * get the the number of element points in * the current dataspace selection if successful - * Inputs: space_id - identifier of the dataspace - * Outputs: num_points - number of element points in + * INPUTS + * space_id - identifier of the dataspace + * OUTPUTS + * num_points - number of element points in * the current dataspace selection - * Returns: 0 on success, -1 on failure - * Programmer: Xiangyang Su + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Xiangyang Su * Monday, November 15, 1999 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5sget_select_elem_npoints_c( hid_t_f *space_id , hssize_t_f * num_points) +/******/ { int ret_value = 0; hid_t c_space_id; @@ -187,31 +247,40 @@ nh5sget_select_elem_npoints_c( hid_t_f *space_id , hssize_t_f * num_points) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5sget_select_hyper_blocklist_c - * Purpose: Call H5Sget_select_hyper_blocklist to +/****if* H5Sf/h5sget_select_hyper_blocklist_c + * NAME + * h5sget_select_hyper_blocklist_c + * PURPOSE + * Call H5Sget_select_hyper_blocklist to * get a list of the hyperslab blocks currently selected * Starting with the startblock-th block in the * list of blocks, num_blocks blocks are put into the user's * buffer. If the user's buffer fills up before numblocks * blocks are inserted, the buffer * will contain only as many blocks as fit. - * Inputs: space_id - identifier of the dataspace + * INPUTS + * space_id - identifier of the dataspace * startblock - Hyperslab block to start with * num_blocks - number of hyperslab blocks in * the current dataspace selection - * Outputs: buf - List of hyperslab blocks selected - * Returns: 0 on success, -1 on failure - * Programmer: Xiangyang Su + * OUTPUTS + * buf - List of hyperslab blocks selected + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Xiangyang Su * Monday, November 15, 1999 - * Modifications: + * HISTORY + * * Transpose dimension arrays because of C-FORTRAN storage order - * M.S. Breitenfeld - *---------------------------------------------------------------------------*/ + * M. Scot Breitenfeld + * SOURCE +*/ int_f nh5sget_select_hyper_blocklist_c( hid_t_f *space_id ,hsize_t_f * startblock, hsize_t_f * num_blocks, hsize_t_f * buf) +/******/ { int ret_value = -1; hid_t c_space_id; @@ -256,25 +325,34 @@ nh5sget_select_hyper_blocklist_c( hid_t_f *space_id ,hsize_t_f * startblock, return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5sget_select_bounds_c - * Purpose: Call H5Sget_select_bounds to retrieve the coordinates +/****if* H5Sf/h5sget_select_bounds_c + * NAME + * h5sget_select_bounds_c + * PURPOSE + * Call H5Sget_select_bounds to retrieve the coordinates * of the bounding box containing the current selection * and places them into user-supplied buffers - * Inputs: space_id - identifier of the dataspace - * Outputs: start - Starting coordinates of the bounding box + * INPUTS + * space_id - identifier of the dataspace + * OUTPUTS + * start - Starting coordinates of the bounding box * end - Ending coordinates of the bounding box, * i.e., the coordinates of the diagonally opposite corne - * Returns: 0 on success, -1 on failure - * Programmer: Xiangyang Su + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Xiangyang Su * Wednesday, November 17, 1999 - * Modifications: swapped array bounds to account for C and Fortran reversed + * HISTORY + * swapped array bounds to account for C and Fortran reversed * matrix notation. - * M.S. Breitenfeld - *---------------------------------------------------------------------------*/ + * M. Scot Breitenfeld + * SOURCE +*/ int_f nh5sget_select_bounds_c( hid_t_f *space_id , hsize_t_f * start, hsize_t_f * end) +/******/ { hid_t c_space_id; hsize_t c_start[H5S_MAX_RANK]; @@ -299,9 +377,11 @@ done: return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5sget_select_elem_pointlist_c - * Purpose: Call H5Sget_select_elem_pointlist +/****if* H5Sf/h5sget_select_elem_pointlist_c + * NAME + * h5sget_select_elem_pointlist_c + * PURPOSE + * Call H5Sget_select_elem_pointlist * get a list of element points in the * current dataspace selectin. * Starting with the startpoint-th point in the @@ -309,19 +389,26 @@ done: * buffer. If the user's buffer fills up before numpoints * points are inserted, the buffer * will contain only as many points as fit. - * Inputs: space_id - identifier of the dataspace + * INPUTS + * space_id - identifier of the dataspace * startpoint - Element point to start with * numpoints - Number of element points to get - * Outputs: buf - List of element points selected - * Returns: 0 on success, -1 on failure - * Programmer: Xiangyang Su + * OUTPUTS + * buf - List of element points selected + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Xiangyang Su * Wednesday, November 17, 1999 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5sget_select_elem_pointlist_c( hid_t_f *space_id ,hsize_t_f * startpoint, hsize_t_f * numpoints, hsize_t_f * buf) +/******/ { int ret_value = -1; hid_t c_space_id; @@ -368,18 +455,26 @@ nh5sget_select_elem_pointlist_c( hid_t_f *space_id ,hsize_t_f * startpoint, -/*---------------------------------------------------------------------------- - * Name: h5sselect_all_c - * Purpose: Call H5Sselect_all to select entire dataspace - * Inputs: space_id - identifier of the dataspace - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal +/****if* H5Sf/h5sselect_all_c + * NAME + * h5sselect_all_c + * PURPOSE + * Call H5Sselect_all to select entire dataspace + * INPUTS + * space_id - identifier of the dataspace + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Tuesday, August 10, 1999 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5sselect_all_c ( hid_t_f *space_id ) +/******/ { int ret_value = 0; hid_t c_space_id; @@ -389,18 +484,26 @@ nh5sselect_all_c ( hid_t_f *space_id ) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5sselect_none_c - * Purpose: Call H5Sselect_none to reset the selection region - * Inputs: space_id - identifier of the dataspace - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal +/****if* H5Sf/h5sselect_none_c + * NAME + * h5sselect_none_c + * PURPOSE + * Call H5Sselect_none to reset the selection region + * INPUTS + * space_id - identifier of the dataspace + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Tuesday, August 10, 1999 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5sselect_none_c ( hid_t_f *space_id ) +/******/ { int ret_value = 0; hid_t c_space_id; @@ -410,21 +513,30 @@ nh5sselect_none_c ( hid_t_f *space_id ) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5sselect_valid_c - * Purpose: Call H5Sselect_valid to verify that selection +/****if* H5Sf/h5sselect_valid_c + * NAME + * h5sselect_valid_c + * PURPOSE + * Call H5Sselect_valid to verify that selection * is within dataspace extent. - * Inputs: space_id - identifier of the dataspace - * Outputs: flag - 0 if not valid selection, 1 if is valid selection, + * INPUTS + * space_id - identifier of the dataspace + * OUTPUTS + * flag - 0 if not valid selection, 1 if is valid selection, * and negative on failure. - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Tuesday, August 10, 1999 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5sselect_valid_c ( hid_t_f *space_id , int_f *flag ) +/******/ { int ret_value = 0; hid_t c_space_id; @@ -437,20 +549,29 @@ nh5sselect_valid_c ( hid_t_f *space_id , int_f *flag ) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5sget_simple_extent_npoints_c - * Purpose: Call H5Sget_simple_extent_npoints to determine the number +/****if* H5Sf/h5sget_simple_extent_npoints_c + * NAME + * h5sget_simple_extent_npoints_c + * PURPOSE + * Call H5Sget_simple_extent_npoints to determine the number * of elements in a dataspace - * Inputs: space_id - identifier of the dataspace - * Outputs: npoints - number of points in a dataspace - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * INPUTS + * space_id - identifier of the dataspace + * OUTPUTS + * npoints - number of points in a dataspace + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Wednesday, August 11, 1999 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5sget_simple_extent_npoints_c ( hid_t_f *space_id , hsize_t_f *npoints ) +/******/ { int ret_value = 0; hid_t c_space_id; @@ -463,20 +584,29 @@ nh5sget_simple_extent_npoints_c ( hid_t_f *space_id , hsize_t_f *npoints ) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5sget_select_npoints_c - * Purpose: Call H5Sget_select_npoints to determine the number +/****if* H5Sf/h5sget_select_npoints_c + * NAME + * h5sget_select_npoints_c + * PURPOSE + * Call H5Sget_select_npoints to determine the number * of elements in a dataspace selection - * Inputs: space_id - identifier of the dataspace - * Outputs: npoints - number of points in a dataspace selection - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * INPUTS + * space_id - identifier of the dataspace + * OUTPUTS + * npoints - number of points in a dataspace selection + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Wednesday, August 11, 1999 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5sget_select_npoints_c ( hid_t_f *space_id , hssize_t_f *npoints ) +/******/ { int ret_value = 0; hssize_t c_npoints; @@ -489,20 +619,29 @@ nh5sget_select_npoints_c ( hid_t_f *space_id , hssize_t_f *npoints ) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5sget_simple_extent_ndims_c - * Purpose: Call H5Sget_simple_extent_ndims to determine the number +/****if* H5Sf/h5sget_simple_extent_ndims_c + * NAME + * h5sget_simple_extent_ndims_c + * PURPOSE + * Call H5Sget_simple_extent_ndims to determine the number * dimensions - * Inputs: space_id - identifier of the dataspace - * Outputs: rank - number of dataspace dimensions - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * INPUTS + * space_id - identifier of the dataspace + * OUTPUTS + * rank - number of dataspace dimensions + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Wednesday, August 11, 1999 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5sget_simple_extent_ndims_c ( hid_t_f *space_id , int_f *ndims ) +/******/ { int ret_value = 0; hid_t c_space_id; @@ -515,21 +654,30 @@ nh5sget_simple_extent_ndims_c ( hid_t_f *space_id , int_f *ndims ) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5sget_simple_extent_type_c - * Purpose: Call H5Sget_simple_extent_type to determine the class type +/****if* H5Sf/h5sget_simple_extent_type_c + * NAME + * h5sget_simple_extent_type_c + * PURPOSE + * Call H5Sget_simple_extent_type to determine the class type * of a dataspace - * Inputs: space_id - identifier of the dataspace - * Outputs: classtype - class type; possible values are: + * INPUTS + * space_id - identifier of the dataspace + * OUTPUTS + * classtype - class type; possible values are: * H5S_SCALAR_F (0), H5S_SIMPLE_F (1), H5S_NULL_F (2) - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Wednesday, August 11, 1999 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5sget_simple_extent_type_c ( hid_t_f *space_id , int_f *classtype) +/******/ { int ret_value = 0; hid_t c_space_id; @@ -547,20 +695,28 @@ nh5sget_simple_extent_type_c ( hid_t_f *space_id , int_f *classtype) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5soffset_simple_c - * Purpose: Call H5Soffset_simple to set the offset of a simple +/****if* H5Sf/h5soffset_simple_c + * NAME + * h5soffset_simple_c + * PURPOSE + * Call H5Soffset_simple to set the offset of a simple * dataspace - * Inputs: space_id - identifier of the dataspace + * INPUTS + * space_id - identifier of the dataspace * offset - offset array - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Wednesday, August 11, 1999 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5soffset_simple_c ( hid_t_f *space_id , hssize_t_f *offset) +/******/ { hid_t c_space_id; int rank; @@ -586,22 +742,30 @@ done: return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5sset_extent_simple_c - * Purpose: Call H5Sset_extent_simple to set or reset size of +/****if* H5Sf/h5sset_extent_simple_c + * NAME + * h5sset_extent_simple_c + * PURPOSE + * Call H5Sset_extent_simple to set or reset size of * existing dataspace - * Inputs: space_id - identifier of the dataspace + * INPUTS + * space_id - identifier of the dataspace * rank - dataspace rank * current_size - array with the new dimension sizes * maximum_size - aray with maximum sizes of dimensions - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Wednesday, August 11, 1999 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5sset_extent_simple_c ( hid_t_f *space_id , int_f *rank, hsize_t_f *current_size, hsize_t_f *maximum_size) +/******/ { hsize_t c_current_size[H5S_MAX_RANK]; hsize_t c_maximum_size[H5S_MAX_RANK]; @@ -623,21 +787,31 @@ done: return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5sget_simple_extent_dims_c - * Purpose: Call H5Sget_simple_extent_dims to retrieve sizes of an + +/****if* H5Sf/h5sget_simple_extent_dims_c + * NAME + * h5sget_simple_extent_dims_c + * PURPOSE + * Call H5Sget_simple_extent_dims to retrieve sizes of an * existing dataspace - * Inputs: space_id - identifier of the dataspace - * Outputs: dims - array with the dimension sizes + * INPUTS + * space_id - identifier of the dataspace + * OUTPUTS + * dims - array with the dimension sizes * maxdims - aray with maximum sizes of dimensions - * Returns: number of dataspace dimensions (rank) on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * number of dataspace dimensions (rank) on success, -1 on failure + * AUTHOR + * Elena Pourmal * Wednesday, August 11, 1999 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5sget_simple_extent_dims_c ( hid_t_f *space_id , hsize_t_f *dims, hsize_t_f *maxdims) +/******/ { hid_t c_space_id; hsize_t c_dims[H5S_MAX_RANK]; @@ -668,21 +842,30 @@ done: return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5sis_simple_c - * Purpose: Call H5Sis_simple to detrmine if the dataspace +/****if* H5Sf/h5sis_simple_c + * NAME + * h5sis_simple_c + * PURPOSE + * Call H5Sis_simple to detrmine if the dataspace * is simple. - * Inputs: space_id - identifier of the dataspace - * Outputs: flag - 0 if not simple, 1 if is simple, + * INPUTS + * space_id - identifier of the dataspace + * OUTPUTS + * flag - 0 if not simple, 1 if is simple, * and negative on failure. - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Wednesday, August 11, 1999 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5sis_simple_c ( hid_t_f *space_id , int_f *flag ) +/******/ { int ret_value = 0; hid_t c_space_id; @@ -696,19 +879,27 @@ nh5sis_simple_c ( hid_t_f *space_id , int_f *flag ) } -/*---------------------------------------------------------------------------- - * Name: h5sextent_copy_c - * Purpose: Call H5Sextent_copy to copy an extent of dataspace - * Inputs: dest_space_id - identifier of the destination dataspace +/****if* H5Sf/h5sextent_copy_c + * NAME + * h5sextent_copy_c + * PURPOSE + * Call H5Sextent_copy to copy an extent of dataspace + * INPUTS + * dest_space_id - identifier of the destination dataspace * source_space_id - identifier of the source dataspace - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Wednesday, August 11, 1999 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5sextent_copy_c ( hid_t_f *dest_space_id , hid_t_f *source_space_id) +/******/ { int ret_value = 0; hid_t c_dest_space_id, c_source_space_id; @@ -721,18 +912,26 @@ nh5sextent_copy_c ( hid_t_f *dest_space_id , hid_t_f *source_space_id) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5sset_extent_none_c - * Purpose: Call H5Sset_extent_none to remove extent from a dataspace - * Inputs: space_id - dataspace identifier - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal +/****if* H5Sf/h5sset_extent_none_c + * NAME + * h5sset_extent_none_c + * PURPOSE + * Call H5Sset_extent_none to remove extent from a dataspace + * INPUTS + * space_id - dataspace identifier + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Wednesday, August 11, 1999 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5sset_extent_none_c ( hid_t_f *space_id ) +/******/ { int ret_value = 0; hid_t c_space_id; @@ -744,10 +943,13 @@ nh5sset_extent_none_c ( hid_t_f *space_id ) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5sselect_hyperslab_c - * Purpose: Call H5Sselect_hyperslab to select a hyperslab - * Inputs: space_id - identifier of the dataspace +/****if* H5Sf/h5sselect_hyperslab_c + * NAME + * h5sselect_hyperslab_c + * PURPOSE + * Call H5Sselect_hyperslab to select a hyperslab + * INPUTS + * space_id - identifier of the dataspace * operator - defines how the new selection is combined * with the previous one; current values are * H5S_SELECT_SET_F (0) and H5S_SELECT_OR_F (1) @@ -755,14 +957,19 @@ nh5sset_extent_none_c ( hid_t_f *space_id ) * count - number of blocks included in the hyperslab * stride - hyperslab stride (interval between blocks) * block - size of block in the hyperslab - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Wednesday, August 11, 1999 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5sselect_hyperslab_c ( hid_t_f *space_id , int_f *op, hsize_t_f *start, hsize_t_f *count, hsize_t_f *stride, hsize_t_f *block) +/******/ { hsize_t c_start[H5S_MAX_RANK]; hsize_t c_count[H5S_MAX_RANK]; @@ -795,25 +1002,35 @@ done: return ret_value; } + #ifdef NEW_HYPERSLAB_API -/*---------------------------------------------------------------------------- - * Name: h5scombine_hyperslab_c - * Purpose: Call H5Scombine_hyperslab - * Inputs: space_id - identifier of the dataspace +/****if* H5Sf/h5scombine_hyperslab_c + * NAME + * h5scombine_hyperslab_c + * PURPOSE + * Call H5Scombine_hyperslab + * INPUTS + * space_id - identifier of the dataspace * operator - defines how the new selection is combined * start - offset of start of hyperslab * count - number of blocks included in the hyperslab * stride - hyperslab stride (interval between blocks) * block - size of block in the hyperslab - * Outputs: hyper_id - identifier for the new dataspace - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * OUTPUTS + * hyper_id - identifier for the new dataspace + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Monday, October 7, 2002 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5scombine_hyperslab_c ( hid_t_f *space_id , int_f *op, hsize_t_f *start, hsize_t_f *count, hsize_t_f *stride, hsize_t_f *block, hid_t_f *hyper_id) +/******/ { int ret_value = -1; hid_t c_space_id; @@ -869,21 +1086,30 @@ DONE: if(c_block != NULL) HDfree(c_block); return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5scombine_select_c - * Purpose: Call H5Scombine_ select - * Inputs: space1_id - identifier of the first dataspace +/****if* H5Sf/h5scombine_select_c + * NAME + * h5scombine_select_c + * PURPOSE + * Call H5Scombine_ select + * INPUTS + * space1_id - identifier of the first dataspace * operator - defines how the new selection is combined * space2_id - identifier of the second dataspace - * Outputs: ds_id - identifier for the new dataspace - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * OUTPUTS + * ds_id - identifier for the new dataspace + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Monday, October 7, 2002 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5scombine_select_c ( hid_t_f *space1_id , int_f *op, hid_t_f *space2_id, hid_t_f *ds_id) +/******/ { int ret_value = -1; hid_t c_space1_id; @@ -901,20 +1127,28 @@ nh5scombine_select_c ( hid_t_f *space1_id , int_f *op, hid_t_f *space2_id, hid_t ret_value = 0; return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5sselect_select_c - * Purpose: Call H5Sselect_ select - * Inputs: space1_id - identifier of the first dataspace to modify +/****if* H5Sf/h5sselect_select_c + * NAME + * h5sselect_select_c + * PURPOSE + * Call H5Sselect_ select + * INPUTS + * space1_id - identifier of the first dataspace to modify * operator - defines how the new selection is combined * space2_id - identifier of the second dataspace - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Monday, October 7, 2002 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5sselect_select_c ( hid_t_f *space1_id , int_f *op, hid_t_f *space2_id) +/******/ { int ret_value = -1; hid_t c_space1_id; @@ -930,19 +1164,27 @@ nh5sselect_select_c ( hid_t_f *space1_id , int_f *op, hid_t_f *space2_id) return ret_value; } #endif /*NEW_HYPERSLAB_API*/ -/*---------------------------------------------------------------------------- - * Name: h5sget_select_type_c - * Purpose: Call H5Sget_select_type - * Inputs: space_id - identifier of the dataspace - * Outputs: type - type of selection - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal +/****if* H5Sf/h5sget_select_type_c + * NAME + * h5sget_select_type_c + * PURPOSE + * Call H5Sget_select_type + * INPUTS + * space_id - identifier of the dataspace + * OUTPUTS + * type - type of selection + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Monday, October 7, 2002 - * Modifications: - *---------------------------------------------------------------------------*/ - + * HISTORY + * + * SOURCE +*/ int_f nh5sget_select_type_c ( hid_t_f *space_id , int_f *type) +/******/ { int ret_value = -1; hid_t c_space_id; @@ -957,23 +1199,31 @@ nh5sget_select_type_c ( hid_t_f *space_id , int_f *type) } -/*---------------------------------------------------------------------------- - * Name: h5sselect_elements_c - * Purpose: Call H5Sselect_elements to select elements of a dataspace - * Inputs: space_id - identifier of the dataspace +/****if* H5Sf/h5sselect_elements_c + * NAME + * h5sselect_elements_c + * PURPOSE + * Call H5Sselect_elements to select elements of a dataspace + * INPUTS + * space_id - identifier of the dataspace * operator - defines how the new selection is combined * with the previous one; current values are * H5S_SELECT_SET_F (0) * nelements - number of elements in the selection * coord - arrays with the elements coordinates - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Wednesday, August 11, 1999 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5sselect_elements_c ( hid_t_f *space_id , int_f *op, size_t_f *nelements, hsize_t_f *coord) +/******/ { int ret_value = -1; hid_t c_space_id; @@ -1004,22 +1254,31 @@ nh5sselect_elements_c ( hid_t_f *space_id , int_f *op, size_t_f *nelements, hsi return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5sdecode_c - * Purpose: Call H5Sdecode - * Inputs: +/****if* H5Sf/h5sdecode_c + * NAME + * h5sdecode_c + * PURPOSE + * Call H5Sdecode + * INPUTS + * * buf - Buffer for the data space object to be decoded. - * Outputs: + * OUTPUTS + * * obj_id - Object_id (non-negative) * - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld * March 26, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5sdecode_c ( _fcd buf, hid_t_f *obj_id ) +/******/ { int ret_value = -1; unsigned char *c_buf = NULL; /* Buffer to hold C string */ @@ -1041,21 +1300,29 @@ nh5sdecode_c ( _fcd buf, hid_t_f *obj_id ) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5sencode_c - * Purpose: Call H5Sencode - * Inputs: +/****if* H5Sf/h5sencode_c + * NAME + * h5sencode_c + * PURPOSE + * Call H5Sencode + * INPUTS + * * obj_id - Identifier of the object to be encoded. * buf - Buffer for the object to be encoded into. * nalloc - The size of the allocated buffer. - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld * March 26, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5sencode_c (_fcd buf, hid_t_f *obj_id, size_t_f *nalloc ) +/******/ { int ret_value = -1; unsigned char *c_buf = NULL; /* Buffer to hold C string */ @@ -1102,22 +1369,31 @@ nh5sencode_c (_fcd buf, hid_t_f *obj_id, size_t_f *nalloc ) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5sextent_equal_c - * Purpose: Call H5Sextent_equal - * Inputs: +/****if* H5Sf/h5sextent_equal_c + * NAME + * h5sextent_equal_c + * PURPOSE + * Call H5Sextent_equal + * INPUTS + * * space1_id - First dataspace identifier. * space2_id - Second dataspace identifier. - * Outputs: + * OUTPUTS + * * equal - TRUE if equal, FALSE if unequal. - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld * April 4, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5sextent_equal_c ( hid_t_f * space1_id, hid_t_f *space2_id, hid_t_f *c_equal) +/******/ { int ret_value = -1; diff --git a/fortran/src/H5Sff.f90 b/fortran/src/H5Sff.f90 index 06bebef..9ef8ca8 100644 --- a/fortran/src/H5Sff.f90 +++ b/fortran/src/H5Sff.f90 @@ -1,3 +1,18 @@ +!****h* ROBODoc/H5S +! +! NAME +! MODULE H5S +! +! FILE +! fortran/src/H5Sff.f90 +! +! PURPOSE +! This file contains Fortran interfaces for H5S functions. It includes +! all the functions that are independent on whether the Fortran 2003 functions +! are enabled or disabled. +! +! +! COPYRIGHT ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! Copyright by The HDF Group. * ! Copyright by the Board of Trustees of the University of Illinois. * @@ -13,44 +28,50 @@ ! access to either file, you may request a copy from help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! +! NOTES +! *** IMPORTANT *** +! If you add a new H5S function you must add the function name to the +! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! This is needed for Windows based operating systems. ! -! This file contains Fortran90 interfaces for H5S functions. -! - MODULE H5S - USE H5GLOBAL +!***** - CONTAINS +MODULE H5S + USE H5GLOBAL -!---------------------------------------------------------------------- -! Name: h5screate_simple_f +CONTAINS + +! +!****s* H5S/h5screate_simple_f ! -! Purpose: Creates a new simple data space and opens it for access . +! NAME +! h5screate_simple_f ! -! Inputs: -! rank - number of dimensions -! dims - an array of the size of each dimension -! Outputs: -! space_id - dataspace identifier -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! maxdims - an array of the maximum size of each -! dimension +! PURPOSE +! Creates a new simple data space and opens it for access . ! -! Programmer: Elena Pourmal -! August 12, 1999 +! INPUTS +! rank - number of dimensions +! dims - an array of the size of each dimension +! OUTPUTS +! space_id - dataspace identifier +! hdferr - Returns 0 if successful and -1 if fails +! OPTIONAL PARAMETERS +! maxdims - an array of the maximum size of each dimension ! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 6, 2001 +! AUTHOR +! Elena Pourmal +! August 12, 1999 ! -! Comment: -!---------------------------------------------------------------------- +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 6, 2001 +! SOURCE SUBROUTINE h5screate_simple_f(rank, dims, space_id, hdferr, maxdims) IMPLICIT NONE - INTEGER, INTENT(IN) :: rank ! Number of dataspace dimensions + INTEGER, INTENT(IN) :: rank ! Number of dataspace dimensions INTEGER(HSIZE_T), INTENT(IN) :: dims(rank) ! Array with the dimension ! sizes @@ -59,11 +80,9 @@ INTEGER(HSIZE_T), OPTIONAL, INTENT(IN) :: maxdims(rank) ! Array with the maximum ! dimension sizes +!***** INTEGER(HSIZE_T), ALLOCATABLE, DIMENSION(:) :: f_maxdims -! INTEGER, EXTERNAL :: h5screate_simple_c -! MS FORTRAN needs explicit interface for C functions called here. -! INTERFACE INTEGER FUNCTION h5screate_simple_c(rank, dims, maxdims, space_id) USE H5GLOBAL @@ -92,38 +111,34 @@ END SUBROUTINE h5screate_simple_f -!---------------------------------------------------------------------- -! Name: h5sclose_f ! -! Purpose: Releases and terminates access to a dataspace. +!****s* H5S/h5sclose_f ! -! Inputs: -! space_id - identifier of dataspace to release -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! NAME +! h5sclose_f ! -! Programmer: Elena Pourmal -! August 12, 1999 +! PURPOSE +! Releases and terminates access to a dataspace. ! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 6, 2001 +! INPUTS +! space_id - identifier of dataspace to release +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! Elena Pourmal +! August 12, 1999 ! -! Comment: -!---------------------------------------------------------------------- - +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 6, 2001 +! +! SOURCE SUBROUTINE h5sclose_f(space_id, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5sclose_c -! MS FORTRAN needs explicit interface for C functions called here. -! +!***** INTERFACE INTEGER FUNCTION h5sclose_c(space_id) USE H5GLOBAL @@ -138,31 +153,34 @@ END SUBROUTINE h5sclose_f -!---------------------------------------------------------------------- -! Name: h5screate_f ! -! Purpose: Creates a new dataspace of a specified type. +!****s* H5S/h5screate_f +! +! NAME +! h5screate_f +! +! PURPOSE +! Creates a new dataspace of a specified type. ! -! Inputs: -! classtype - the type of the dataspace to be created -! Outputs: -! space_id - dataspace identifier -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! INPUTS +! classtype - the type of the dataspace to be created +! OUTPUTS +! space_id - dataspace identifier +! hdferr - Returns 0 if successful and -1 if fails ! -! Programmer: Elena Pourmal -! August 12, 1999 +! AUTHOR +! Elena Pourmal +! August 12, 1999 ! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 6, 2001 +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 6, 2001 +! +! NOTES ! -! Comment: -!---------------------------------------------------------------------- +! SOURCE SUBROUTINE h5screate_f(classtype, space_id, hdferr) IMPLICIT NONE INTEGER, INTENT(IN) :: classtype ! The type of the dataspace @@ -173,10 +191,7 @@ ! H5S_NULL_F(2) INTEGER(HID_T), INTENT(OUT) :: space_id ! Dataspace identifier INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5screate_c -! MS FORTRAN needs explicit interface for C functions called here. -! +!***** INTERFACE INTEGER FUNCTION h5screate_c(classtype, space_id) USE H5GLOBAL @@ -192,41 +207,41 @@ END SUBROUTINE h5screate_f -!---------------------------------------------------------------------- -! Name: h5scopy_f ! -! Purpose: Creates an exact copy of a dataspace. +!****s* H5S/h5scopy_f +! +! NAME +! h5scopy_f ! -! Inputs: -! space_id - dataspace identifier -! Outputs: -! new_space_id - identifier of dataspace's copy -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! PURPOSE +! Creates an exact copy of a dataspace. ! -! Programmer: Elena Pourmal -! August 12, 1999 +! INPUTS +! space_id - dataspace identifier +! OUTPUTS +! new_space_id - identifier of dataspace's copy +! hdferr - Returns 0 if successful and -1 if fails ! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 6, 2001 +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 6, 2001 +! +! NOTES ! -! Comment: -!---------------------------------------------------------------------- +! SOURCE SUBROUTINE h5scopy_f(space_id, new_space_id, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier INTEGER(HID_T), INTENT(OUT) :: new_space_id ! Identifier of dataspace's copy INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5scopy_c -! MS FORTRAN needs explicit interface for C functions called here. -! +!***** INTERFACE INTEGER FUNCTION h5scopy_c(space_id, new_space_id) USE H5GLOBAL @@ -242,31 +257,31 @@ END SUBROUTINE h5scopy_f -!---------------------------------------------------------------------- -! Name: h5sget_select_hyper_nblocks_f ! -! Purpose: Get number of hyperslab blocks. +!****s* H5S/h5sget_select_hyper_nblocks_f ! -! Inputs: -! space_id - dataspace identifier -! Outputs: -! num_blocks - number of hyperslab blocks in the current -! hyperslab selection -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! NAME +! h5sget_select_hyper_nblocks_f ! -! Programmer: Elena Pourmal -! August 12, 1999 +! PURPOSE +! Get number of hyperslab blocks. ! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 6, 2001 +! INPUTS +! space_id - dataspace identifier +! OUTPUTS +! num_blocks - number of hyperslab blocks in the current +! hyperslab selection +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! Elena Pourmal +! August 12, 1999 ! -! Comment: -!---------------------------------------------------------------------- +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 6, 2001 +! +! SOURCE SUBROUTINE h5sget_select_hyper_nblocks_f(space_id, num_blocks, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier @@ -275,15 +290,12 @@ !in the current dataspace !selection INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5sget_select_hyper_nblocks_c -! MS FORTRAN needs explicit interface for C functions called here. -! +!***** 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$ 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 @@ -294,33 +306,32 @@ END SUBROUTINE h5sget_select_hyper_nblocks_f -!---------------------------------------------------------------------- -! Name: h5sget_select_hyper_blocklist_f ! -! Purpose: Gets the list of hyperslab blocks currently selected. +!****s* H5S/h5sget_select_hyper_blocklist_f ! -! Inputs: -! space_id - dataspace identifier -! startblock - hyperslab block to start with -! num_blocks - number of blocks to get -! Outputs: -! buf - buffer to hold block list -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! NAME +! h5sget_select_hyper_blocklist_f ! -! Programmer: Elena Pourmal -! August 12, 1999 +! PURPOSE +! Gets the list of hyperslab blocks currently selected. ! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 6, 2001 +! INPUTS +! space_id - dataspace identifier +! startblock - hyperslab block to start with +! num_blocks - number of blocks to get +! OUTPUTS +! buf - buffer to hold block list +! hdferr - Returns 0 if successful and -1 if fails ! -! Comment: -!---------------------------------------------------------------------- - +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 6, 2001 +! SOURCE SUBROUTINE h5sget_select_hyper_blocklist_f(space_id, startblock, & num_blocks, buf, hdferr) IMPLICIT NONE @@ -334,11 +345,8 @@ INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: buf !List of hyperslab blocks selected INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** - -! INTEGER, EXTERNAL :: h5sget_select_hyper_blocklist_c -! MS FORTRAN needs explicit interface for C functions called here. -! INTERFACE INTEGER FUNCTION h5sget_select_hyper_blocklist_c(space_id, startblock, & num_blocks, buf ) @@ -359,33 +367,34 @@ END SUBROUTINE h5sget_select_hyper_blocklist_f -!---------------------------------------------------------------------- -! Name: h5sget_select_bounds_f ! -! Purpose: Gets the bounding box containing the current selection. +!****s* H5S/h5sget_select_bounds_f ! -! Inputs: -! space_id - dataspace identifier +! NAME +! h5sget_select_bounds_f ! -! Outputs: -! start - starting coordinates of bounding box -! end - ending coordinates of bounding box -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! PURPOSE +! Gets the bounding box containing the current selection. ! -! Programmer: Elena Pourmal -! August 12, 1999 +! INPUTS +! space_id - dataspace identifier ! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 6, 2001 +! OUTPUTS +! start - starting coordinates of bounding box +! end - ending coordinates of bounding box +! hdferr - Returns 0 if successful and -1 if fails +! OPTIONAL PARAMETERS +! NONE ! -! Comment: -!---------------------------------------------------------------------- - +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 6, 2001 +! SOURCE SUBROUTINE h5sget_select_bounds_f(space_id, start, END, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier @@ -396,7 +405,7 @@ !i.e., the coordinates of the diagonally !opposite corner INTEGER, INTENT(OUT) :: hdferr ! Error code - +!***** INTERFACE INTEGER FUNCTION h5sget_select_bounds_c(space_id, start, END) USE H5GLOBAL @@ -413,31 +422,31 @@ END SUBROUTINE h5sget_select_bounds_f -!---------------------------------------------------------------------- -! Name: h5sget_select_elem_npoints_f ! -! Purpose: Gets the number of element points in the current selection +!****s* H5S/h5sget_select_elem_npoints_f +! +! NAME +! h5sget_select_elem_npoints_f ! -! Inputs: -! space_id - dataspace identifier -! Outputs: -! num_points - number of element points in the current -! dataspace selection -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! PURPOSE +! Gets the number of element points in the current selection ! -! Programmer: Elena Pourmal -! August 12, 1999 +! INPUTS +! space_id - dataspace identifier +! OUTPUTS +! num_points - number of element points in the current +! dataspace selection +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! Elena Pourmal +! August 12, 1999 ! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 6, 2001 +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 6, 2001 ! -! Comment: -!---------------------------------------------------------------------- +! SOURCE SUBROUTINE h5sget_select_elem_npoints_f(space_id, num_points, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier @@ -446,15 +455,12 @@ !in the current dataspace !selection INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5sget_select_elem_npoints_c -! MS FORTRAN needs explicit interface for C functions called here. -! +!***** 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$ 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 @@ -465,33 +471,32 @@ END SUBROUTINE h5sget_select_elem_npoints_f -!---------------------------------------------------------------------- -! Name: h5sget_select_elem_pointlist_f ! -! Purpose: Gets the list of element points currently selected. +!****s* H5S/h5sget_select_elem_pointlist_f ! -! Inputs: -! space_id - dataspace identifier -! startpoint - element point to start with -! num_points - number of elemnt points to get -! Outputs: -! buf - buffer with element points selected -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! NAME +! h5sget_select_elem_pointlist_f ! -! Programmer: Elena Pourmal -! August 12, 1999 +! PURPOSE +! Gets the list of element points currently selected. ! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 6, 2001 +! INPUTS +! space_id - dataspace identifier +! startpoint - element point to start with +! num_points - number of elemnt points to get +! OUTPUTS +! buf - buffer with element points selected +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! Elena Pourmal +! August 12, 1999 ! -! Comment: -!---------------------------------------------------------------------- - +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 6, 2001 +! +! SOURCE SUBROUTINE h5sget_select_elem_pointlist_f(space_id, startpoint, & num_points, buf, hdferr) IMPLICIT NONE @@ -503,13 +508,13 @@ INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: buf !List of element points selected INTEGER, INTENT(OUT) :: hdferr ! Error code - +!***** INTERFACE 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$ 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 @@ -523,52 +528,48 @@ END SUBROUTINE h5sget_select_elem_pointlist_f -!---------------------------------------------------------------------- -! Name: h5sselect_elements_f -! -! Purpose: Selects elements to be included in the selection for -! a dataspace -! -! Inputs: -! space_id - dataspace identifier -! operator - flag, valid values are: -! H5S_SELECT_SET_F (0) -! H5S_SELECT_OR_F (1) -! rank - number of dataspace dimensions -! num_elements - number of elements to be selected -! coord - 2D (rank x num_elements) array with the -! elements coordinates -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 6, 2001 -! -! Comment: -!---------------------------------------------------------------------- +! +!****s* H5S/h5sselect_elements_f +! +! NAME +! h5sselect_elements_f +! +! PURPOSE +! Selects elements to be included in the selection for +! a dataspace +! +! INPUTS +! space_id - dataspace identifier +! operator - flag, valid values are: +! H5S_SELECT_SET_F +! H5S_SELECT_APPEND_F +! H5S_SELECT_PREPEND_F +! rank - number of dataspace dimensions +! num_elements - number of elements to be selected +! coord - 2D (rank x num_elements) array with the +! elements coordinates ( 1-based); in C the +! array is stored in 2D as (num_element x rank) +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 6, 2001 +! SOURCE SUBROUTINE h5sselect_elements_f(space_id, OPERATOR, rank, & num_elements, coord, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier - INTEGER, INTENT(IN) :: OPERATOR ! Flag, valid values are: - ! H5S_SELECT_SET_F (0) - ! H5S_SELECT_OR_F (1) - INTEGER, INTENT(IN) :: rank ! Number of dataspace dimensions - INTEGER(SIZE_T), INTENT(IN) :: num_elements ! Number of elements to be - ! selected - INTEGER(HSIZE_T), DIMENSION(rank,num_elements), INTENT(IN) :: coord - ! Array with the coordinates - ! of the selected elements - ! coord(rank, num_elements) - INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), INTENT(IN) :: space_id + INTEGER, INTENT(IN) :: OPERATOR + INTEGER, INTENT(IN) :: rank + INTEGER(SIZE_T), INTENT(IN) :: num_elements + INTEGER(HSIZE_T), INTENT(IN) , DIMENSION(rank,num_elements) :: coord + INTEGER, INTENT(OUT) :: hdferr +!***** INTEGER(HSIZE_T), ALLOCATABLE, DIMENSION(:,:) :: c_coord INTEGER :: error, i @@ -596,43 +597,49 @@ ENDDO hdferr = h5sselect_elements_c(space_id, OPERATOR, num_elements, c_coord) +! ALLOCATE(c_coord(num_elements,rank), stat = error) +! IF (error.NE. 0) THEN +! hdferr = -1 +! RETURN +! ENDIF +! +! c_coord = TRANSPOSE(coord) +! hdferr = h5sselect_elements_c(space_id, OPERATOR, INT(rank,size_t), c_coord) + + DEALLOCATE(c_coord) END SUBROUTINE h5sselect_elements_f -!---------------------------------------------------------------------- -! Name: h5sselect_all_f ! -! Purpose: Selects the entire dataspace. +!****s* H5S/h5sselect_all_f ! -! Inputs: -! space_id - identifier for the dataspace in which -! selection being made -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! NAME +! h5sselect_all_f ! -! Programmer: Elena Pourmal -! August 12, 1999 +! PURPOSE +! Selects the entire dataspace. ! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 6, 2001 +! INPUTS +! space_id - Identifier for the dataspace in which +! selection being made +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! Elena Pourmal +! August 12, 1999 ! -! Comment: -!---------------------------------------------------------------------- - +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 6, 2001 +! +! SOURCE SUBROUTINE h5sselect_all_f(space_id, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5sselect_all_c -! MS FORTRAN needs explicit interface for C functions called here. -! +!***** INTERFACE INTEGER FUNCTION h5sselect_all_c(space_id) USE H5GLOBAL @@ -647,39 +654,36 @@ END SUBROUTINE h5sselect_all_f -!---------------------------------------------------------------------- -! Name: h5sselect_none_f ! -! Purpose: Resets the selection region to include no elements. +!****s* H5S/h5sselect_none_f ! -! Inputs: -! space_id - the identifier for the dataspace in which -! the selection is being reset. -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! NAME +! h5sselect_none_f ! -! Programmer: Elena Pourmal -! August 12, 1999 +! PURPOSE +! Resets the selection region to include no elements. ! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 6, 2001 +! INPUTS +! space_id - the identifier for the dataspace in which +! the selection is being reset. +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails ! -! Comment: -!---------------------------------------------------------------------- - +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 6, 2001 +! +! SOURCE SUBROUTINE h5sselect_none_f(space_id, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5sselect_none_c -! MS FORTRAN needs explicit interface for C functions called here. -! +!***** INTERFACE INTEGER FUNCTION h5sselect_none_c(space_id) USE H5GLOBAL @@ -694,31 +698,32 @@ END SUBROUTINE h5sselect_none_f -!---------------------------------------------------------------------- -! Name: h5sselect_valid_f ! -! Purpose: Verifies that the selection is within the extent of -! the dataspace. +!****s* H5S/h5sselect_valid_f +! +! NAME +! h5sselect_valid_f ! -! Inputs: -! space_id - identifier for the dataspace for which -! selection is verified -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! PURPOSE +! Verifies that the selection is within the extent of +! the dataspace. ! -! Programmer: Elena Pourmal -! August 12, 1999 +! INPUTS +! space_id - identifier for the dataspace for which +! selection is verified +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails ! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 6, 2001 +! AUTHOR +! Elena Pourmal +! August 12, 1999 ! -! Comment: -!---------------------------------------------------------------------- +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 6, 2001 +! +! SOURCE SUBROUTINE h5sselect_valid_f(space_id, status, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier @@ -726,11 +731,9 @@ ! contained within the extent, ! FALSE otherwise. INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** INTEGER :: flag ! "TRUE/FALSE/ERROR" flag from C routine -! INTEGER, EXTERNAL :: h5sselect_valid_c -! MS FORTRAN needs explicit interface for C functions called here. -! INTERFACE INTEGER FUNCTION h5sselect_valid_c(space_id, flag) USE H5GLOBAL @@ -748,41 +751,38 @@ END SUBROUTINE h5sselect_valid_f -!---------------------------------------------------------------------- -! Name: h5sget_simple_extent_npoints_f ! -! Purpose: Determines the number of elements in a dataspace. +!****s* H5S/h5sget_simple_extent_npoints_f ! -! Inputs: -! space_id - dataspace identifier -! Outputs: -! npoints - number of elements in the dataspace -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! NAME +! h5sget_simple_extent_npoints_f ! -! Programmer: Elena Pourmal -! August 12, 1999 +! PURPOSE +! Determines the number of elements in a dataspace. ! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 6, 2001 +! INPUTS +! space_id - dataspace identifier +! OUTPUTS +! npoints - number of elements in the dataspace +! hdferr - Returns 0 if successful and -1 if fails ! -! Comment: -!---------------------------------------------------------------------- - +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 6, 2001 +! +! SOURCE SUBROUTINE h5sget_simple_extent_npoints_f(space_id, npoints, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier INTEGER(HSIZE_T), INTENT(OUT) :: npoints ! Number of elements in ! dataspace INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5sget_simple_extent_npoints_c -! MS FORTRAN needs explicit interface for C functions called here. -! +!***** INTERFACE INTEGER FUNCTION h5sget_simple_extent_npoints_c( space_id, npoints) USE H5GLOBAL @@ -798,41 +798,36 @@ END SUBROUTINE h5sget_simple_extent_npoints_f -!---------------------------------------------------------------------- -! Name: h5sget_select_npoints_f ! -! Purpose: Determines the number of elements in a dataspace selection. +!****s* H5S/h5sget_select_npoints_f ! -! Inputs: -! space_id - dataspace identifier -! Outputs: -! npoints - number of points in the dataspace selection -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! NAME +! h5sget_select_npoints_f ! -! Programmer: Elena Pourmal -! August 12, 1999 +! PURPOSE +! Determines the number of elements in a dataspace selection. ! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 6, 2001 +! INPUTS +! space_id - dataspace identifier +! OUTPUTS +! npoints - number of points in the dataspace selection +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! Elena Pourmal +! August 12, 1999 ! -! Comment: -!---------------------------------------------------------------------- - +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 6, 2001 +! SOURCE SUBROUTINE h5sget_select_npoints_f(space_id, npoints, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier INTEGER(HSSIZE_T), INTENT(OUT) :: npoints ! Number of elements in the ! selection INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5sget_select_npoints_c -! MS FORTRAN needs explicit interface for C functions called here. -! +!***** INTERFACE INTEGER FUNCTION h5sget_select_npoints_c(space_id, npoints) USE H5GLOBAL @@ -848,40 +843,36 @@ END SUBROUTINE h5sget_select_npoints_f -!---------------------------------------------------------------------- -! Name: h5sget_simple_extent_ndims_f ! -! Purpose: Determines the dimensionality of a dataspace +!****s* H5S/h5sget_simple_extent_ndims_f ! -! Inputs: -! space_id - dataspace identifier -! Outputs: -! rank - number of dataspace dimensions -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! NAME +! h5sget_simple_extent_ndims_f ! -! Programmer: Elena Pourmal -! August 12, 1999 +! PURPOSE +! Determines the dimensionality of a dataspace ! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 6, 2001 +! INPUTS +! space_id - dataspace identifier +! OUTPUTS +! rank - number of dataspace dimensions +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! Elena Pourmal +! August 12, 1999 ! -! Comment: -!---------------------------------------------------------------------- - +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 6, 2001 +! +! SOURCE SUBROUTINE h5sget_simple_extent_ndims_f(space_id, rank, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier INTEGER, INTENT(OUT) :: rank ! Number of dimensions INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5sget_simple_extent_ndims_c -! MS FORTRAN needs explicit interface for C functions called here. -! +!***** INTERFACE INTEGER FUNCTION h5sget_simple_extent_ndims_c(space_id, rank) USE H5GLOBAL @@ -896,34 +887,32 @@ hdferr = h5sget_simple_extent_ndims_c(space_id, rank) END SUBROUTINE h5sget_simple_extent_ndims_f - -!---------------------------------------------------------------------- -! Name: h5sget_simple_extent_dims_f ! -! Purpose: Retrieves dataspace dimension size and maximum size. +!****s* H5S/h5sget_simple_extent_dims_f ! -! Inputs: -! space_id - dataspace identifier -! Outputs: -! dims - array to store size of each dimension -! maxdims - array to store maximum size of each -! dimension -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! NAME +! h5sget_simple_extent_dims_f ! -! Programmer: Elena Pourmal -! August 12, 1999 +! PURPOSE +! Retrieves dataspace dimension size and maximum size. ! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 6, 2001 +! INPUTS +! space_id - dataspace identifier +! OUTPUTS +! dims - array to store size of each dimension +! maxdims - array to store maximum size of each +! dimension +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! Elena Pourmal +! August 12, 1999 ! -! Comment: -!---------------------------------------------------------------------- - +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 6, 2001 +! +! SOURCE SUBROUTINE h5sget_simple_extent_dims_f(space_id, dims, maxdims, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier @@ -935,10 +924,7 @@ INTEGER, INTENT(OUT) :: hdferr ! Error code: -1 on failure, ! number of dimensions on ! on success - -! INTEGER, EXTERNAL :: h5sget_simple_extent_dims_c -! MS FORTRAN needs explicit interface for C functions called here. -! +!***** INTERFACE INTEGER FUNCTION h5sget_simple_extent_dims_c(space_id, dims, maxdims) USE H5GLOBAL @@ -955,35 +941,34 @@ END SUBROUTINE h5sget_simple_extent_dims_f -!---------------------------------------------------------------------- -! Name: h5sget_simple_extent_type_f ! -! Purpose: Determine the current class of a dataspace +!****s* H5S/h5sget_simple_extent_type_f ! -! Inputs: -! space_id - dataspace identifier -! Outputs: -! classtype - class type, possible values are: -! H5S_NO_CLASS_F (-1) -! H5S_SCALAR_F (0) -! H5S_SIMPLE_F (1) -! H5S_NULL_F (2) -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! NAME +! h5sget_simple_extent_type_f ! -! Programmer: Elena Pourmal -! August 12, 1999 +! PURPOSE +! Determine the current class of a dataspace ! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 6, 2001 +! INPUTS +! space_id - dataspace identifier +! OUTPUTS +! classtype - class type, possible values are: +! H5S_NO_CLASS_F (-1) +! H5S_SCALAR_F (0) +! H5S_SIMPLE_F (1) +! H5S_NULL_F (2) +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! Elena Pourmal +! August 12, 1999 ! -! Comment: -!---------------------------------------------------------------------- - +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 6, 2001 +! +! SOURCE SUBROUTINE h5sget_simple_extent_type_f(space_id, classtype, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier @@ -994,10 +979,7 @@ ! H5S_SIMPLE_F (1) ! H5S_NULL_F (2) INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5sget_simple_extent_type_c -! MS FORTRAN needs explicit interface for C functions called here. -! +!***** INTERFACE INTEGER FUNCTION h5sget_simple_extent_type_c(space_id, classtype) USE H5GLOBAL @@ -1012,35 +994,33 @@ hdferr = h5sget_simple_extent_type_c(space_id, classtype) END SUBROUTINE h5sget_simple_extent_type_f - -!---------------------------------------------------------------------- -! Name: h5sset_extent_simple_f ! -! Purpose: Sets or resets the size of an existing dataspace. +!****s* H5S/h5sset_extent_simple_f ! -! Inputs: -! space_id - dataspace identifier -! rank - dataspace number of dimensions -! current_size - array with the new sizes of dimensions -! maximum_size - array with the new maximum sizes of -! dimensions -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! NAME +! h5sset_extent_simple_f ! -! Programmer: Elena Pourmal -! August 12, 1999 +! PURPOSE +! Sets or resets the size of an existing dataspace. ! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 6, 2001 +! INPUTS +! space_id - dataspace identifier +! rank - dataspace number of dimensions +! current_size - array with the new sizes of dimensions +! maximum_size - array with the new maximum sizes of +! dimensions +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! Elena Pourmal +! August 12, 1999 ! -! Comment: -!---------------------------------------------------------------------- - +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 6, 2001 +! +! SOURCE SUBROUTINE h5sset_extent_simple_f(space_id, rank, current_size, & maximum_size, hdferr) IMPLICIT NONE @@ -1054,10 +1034,7 @@ ! sizes of dimensions ! sizes INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5sset_extent_simple_c -! MS FORTRAN needs explicit interface for C functions called here. -! +!***** INTERFACE INTEGER FUNCTION h5sset_extent_simple_c(space_id, rank, & current_size, maximum_size) @@ -1076,33 +1053,31 @@ maximum_size) END SUBROUTINE h5sset_extent_simple_f - -!---------------------------------------------------------------------- -! Name: h5sis_simple_f ! -! Purpose: Determines whether a dataspace is a simple dataspace. +!****s* H5S/h5sis_simple_f ! -! Inputs: -! space_id - dataspace identifier -! Outputs: -! status - flag to indicate if dataspace -! is simple or not -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! NAME +! h5sis_simple_f ! -! Programmer: Elena Pourmal -! August 12, 1999 +! PURPOSE +! Determines whether a dataspace is a simple dataspace. ! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 6, 2001 +! INPUTS +! space_id - dataspace identifier +! OUTPUTS +! status - flag to indicate if dataspace +! is simple or not +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! Elena Pourmal +! August 12, 1999 ! -! Comment: -!---------------------------------------------------------------------- - +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 6, 2001 +! +! SOURCE SUBROUTINE h5sis_simple_f(space_id, status, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier @@ -1110,11 +1085,9 @@ ! is simple or not ( TRUE or ! FALSE) INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** INTEGER :: flag ! "TRUE/FALSE/ERROR from C" -! INTEGER, EXTERNAL :: h5sis_simple_c -! MS FORTRAN needs explicit interface for C functions called here. -! INTERFACE INTEGER FUNCTION h5sis_simple_c(space_id, flag) USE H5GLOBAL @@ -1132,31 +1105,34 @@ END SUBROUTINE h5sis_simple_f -!---------------------------------------------------------------------- -! Name: h5soffset_simple_f ! -! Purpose: Sets the offset of a simple dataspace. +!****s* H5S/h5soffset_simple_f ! -! Inputs: -! space_id - dataspace identifier -! offset - the offset at which to position the -! selection -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! NAME +! h5soffset_simple_f ! -! Programmer: Elena Pourmal -! August 12, 1999 +! PURPOSE +! Sets the offset of a simple dataspace. ! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 6, 2001 +! INPUTS +! space_id - dataspace identifier +! offset - the offset at which to position the +! selection +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! OPTIONAL PARAMETERS +! NONE ! -! Comment: -!---------------------------------------------------------------------- +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 6, 2001 +! +! SOURCE SUBROUTINE h5soffset_simple_f(space_id, offset, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier @@ -1164,10 +1140,7 @@ ! The offset at which to position ! the selection INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5soffset_simple_c -! MS FORTRAN needs explicit interface for C functions called here. -! +!***** INTERFACE INTEGER FUNCTION h5soffset_simple_c(space_id, offset) USE H5GLOBAL @@ -1183,33 +1156,38 @@ END SUBROUTINE h5soffset_simple_f -!---------------------------------------------------------------------- -! Name: h5sextent_copy_f ! -! Purpose: Copies the extent of a dataspace. +!****s* H5S/h5sextent_copy_f +! +! NAME +! h5sextent_copy_f +! +! PURPOSE +! Copies the extent of a dataspace. +! +! INPUTS +! dest_space_id - the identifier for the dataspace to which +! the extent is copied +! source_space_id - the identifier for the dataspace from +! which the extent is copied +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! OPTIONAL PARAMETERS +! NONE ! -! Inputs: -! dest_space_id - the identifier for the dataspace to which -! the extent is copied -! source_space_id - the identifier for the dataspace from -! which the extent is copied -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! AUTHOR +! Elena Pourmal +! August 12, 1999 ! -! Programmer: Elena Pourmal -! August 12, 1999 +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 6, 2001 ! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 6, 2001 +! NOTES ! -! Comment: -!---------------------------------------------------------------------- +! SOURCE SUBROUTINE h5sextent_copy_f(dest_space_id, source_space_id, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: dest_space_id ! Identifier of destination @@ -1217,10 +1195,7 @@ INTEGER(HID_T), INTENT(IN) :: source_space_id ! Identifier of source ! dataspace INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5sextent_copy_c -! MS FORTRAN needs explicit interface for C functions called here. -! +!***** INTERFACE INTEGER FUNCTION h5sextent_copy_c(dest_space_id, source_space_id) USE H5GLOBAL @@ -1236,37 +1211,34 @@ END SUBROUTINE h5sextent_copy_f -!---------------------------------------------------------------------- -! Name: h5sset_extent_none_f ! -! Purpose: Removes the extent from a dataspace. +!****s* H5S/h5sset_extent_none_f ! -! Inputs: -! space_id - dataspace identifier -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! NAME +! h5sset_extent_none_f ! -! Programmer: Elena Pourmal -! August 12, 1999 +! PURPOSE +! Removes the extent from a dataspace. ! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 6, 2001 +! INPUTS +! space_id - dataspace identifier +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! Elena Pourmal +! August 12, 1999 ! -! Comment: -!---------------------------------------------------------------------- +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 6, 2001 +! +! SOURCE SUBROUTINE h5sset_extent_none_f(space_id, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5sset_extent_none_c -! MS FORTRAN needs explicit interface for C functions called here. -! +!***** INTERFACE INTEGER FUNCTION h5sset_extent_none_c(space_id) USE H5GLOBAL @@ -1281,38 +1253,40 @@ END SUBROUTINE h5sset_extent_none_f -!---------------------------------------------------------------------- -! Name: h5sselect_hyperslab_f -! -! Purpose: Selects a hyperslab region to add to the current selected -! region -! -! Inputs: -! space_id - dataspace identifier -! operator - flag, valid values are: -! H5S_SELECT_SET_F (0) -! H5S_SELECT_OR_F (1) -! start - array with hyperslab offsets -! count - number of blocks included in the -! hyperslab -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! stride - array with hyperslab strides -! block - array with hyperslab block sizes -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 6, 2001 -! -! Comment: -!---------------------------------------------------------------------- - +! +!****s* H5S/h5sselect_hyperslab_f +! +! NAME +! h5sselect_hyperslab_f +! +! PURPOSE +! Selects a hyperslab region to add to the current selected +! region +! +! INPUTS +! space_id - dataspace identifier +! operator - flag, valid values are: +! H5S_SELECT_SET_F (0) +! H5S_SELECT_OR_F (1) +! start - array with hyperslab offsets +! count - number of blocks included in the +! hyperslab +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! OPTIONAL PARAMETERS +! stride - array with hyperslab strides +! block - array with hyperslab block sizes +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 6, 2001 +! +! SOURCE SUBROUTINE h5sselect_hyperslab_f(space_id, operator, start, count, & hdferr, stride, block) IMPLICIT NONE @@ -1332,14 +1306,12 @@ ! in each direction INTEGER(HSIZE_T), DIMENSION(:), OPTIONAL, INTENT(IN) :: block ! Sizes of element block +!***** INTEGER(HSIZE_T), DIMENSION(:), ALLOCATABLE :: def_block INTEGER(HSIZE_T), DIMENSION(:), ALLOCATABLE :: def_stride INTEGER :: rank INTEGER :: error1, error2 -! INTEGER, EXTERNAL :: h5sselect_hyperslab_c -! MS FORTRAN needs explicit interface for C functions called here. -! INTERFACE INTEGER FUNCTION h5sselect_hyperslab_c(space_id, operator, & start, count, stride, block) @@ -1408,49 +1380,56 @@ deallocate(def_stride) END SUBROUTINE h5sselect_hyperslab_f -!---------------------------------------------------------------------- -! Name: h5scombine_hyperslab_f -! -! Purpose: Combine a hyperslab selection with the current -! selection for a dataspace -! -! Inputs: -! space_id - dataspace of selection to use -! operator - flag, valid values are: -! H5S_SELECT_NOOP_F -! H5S_SELECT_SET_F -! H5S_SELECT_OR_F -! H5S_SELECT_AND_F -! H5S_SELECT_XOR_F -! H5S_SELECT_NOTB_F -! H5S_SELECT_NOTA_F -! H5S_SELECT_APPEND_F -! H5S_SELECT_PREPEND_F -! start - array with hyperslab offsets -! count - number of blocks included in the -! hyperslab -! Outputs: -! hyper_id - identifier for the new hyperslab -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! stride - array with hyperslab strides -! block - array with hyperslab block sizes -! -! Programmer: Elena Pourmal -! October 7, 2002 -! -! Modifications: -! -! Comment: Commented out until 1.6 ? 10/08/2002 -!---------------------------------------------------------------------- - -! SUBROUTINE h5scombine_hyperslab_f(space_id, operator, start, count, & -! hyper_id, hdferr, stride, block) -! IMPLICIT NONE -! INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier -! INTEGER, INTENT(IN) :: operator ! Flag, valid values are: +! !$! +! !$!****s* H5S/h5scombine_hyperslab_f +! !$! +! !$! NAME +! !$! h5scombine_hyperslab_f +! !$! +! !$! PURPOSE +! !$! Combine a hyperslab selection with the current +! !$! selection for a dataspace +! !$! +! !$! INPUTS +! !$! space_id - dataspace of selection to use +! !$! operator - flag, valid values are: +! !$! H5S_SELECT_NOOP_F +! !$! H5S_SELECT_SET_F +! !$! H5S_SELECT_OR_F +! !$! H5S_SELECT_AND_F +! !$! H5S_SELECT_XOR_F +! !$! H5S_SELECT_NOTB_F +! !$! H5S_SELECT_NOTA_F +! !$! H5S_SELECT_APPEND_F +! !$! H5S_SELECT_PREPEND_F +! !$! start - array with hyperslab offsets +! !$! count - number of blocks included in the +! !$! hyperslab +! !$! OUTPUTS +! !$! hyper_id - identifier for the new hyperslab +! !$! hdferr: - error code +! !$! Success: 0 +! !$! Failure: -1 +! !$! OPTIONAL PARAMETERS +! !$! stride - array with hyperslab strides +! !$! block - array with hyperslab block sizes +! !$! +! !$! AUTHOR +! !$! Elena Pourmal +! !$! October 7, 2002 +! !$! +! !$! HISTORY +! !$! +! !$! +! !$! NOTES +! !$! Commented out until 1.6 ? 10/08/2002 +! !$! +! !$! SOURCE +! SUBROUTINE h5scombine_hyperslab_f(space_id, operator, start, count, & +! hyper_id, hdferr, stride, block) +! IMPLICIT NONE +! INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier +! INTEGER, INTENT(IN) :: operator ! Flag, valid values are: ! H5S_SELECT_NOOP_F ! H5S_SELECT_SET_F ! H5S_SELECT_OR_F @@ -1461,133 +1440,140 @@ ! H5S_SELECT_APPEND_F ! H5S_SELECT_PREPEND_F ! -! INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: start +! INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: start ! Starting coordinates of the hyperslab -! INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: count +! INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: count ! Number of blocks to select ! from dataspace -! INTEGER(HID_T), INTENT(OUT) :: hyper_id ! New hyperslab identifier -! INTEGER, INTENT(OUT) :: hdferr ! Error code -! INTEGER(HSIZE_T), DIMENSION(:), OPTIONAL, INTENT(IN) :: stride +! INTEGER(HID_T), INTENT(OUT) :: hyper_id ! New hyperslab identifier +! INTEGER, INTENT(OUT) :: hdferr ! Error code +! INTEGER(HSIZE_T), DIMENSION(:), OPTIONAL, INTENT(IN) :: stride ! Array of how many elements to move ! in each direction -! INTEGER(HSIZE_T), DIMENSION(:), OPTIONAL, INTENT(IN) :: block +! INTEGER(HSIZE_T), DIMENSION(:), OPTIONAL, INTENT(IN) :: block ! Sizes of element block -! INTEGER(HSIZE_T), DIMENSION(:), ALLOCATABLE :: def_block -! INTEGER(HSIZE_T), DIMENSION(:), ALLOCATABLE :: def_stride -! INTEGER :: rank -! INTEGER :: error1, error2 - -! INTERFACE -! 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 -! INTEGER(HID_T), INTENT(IN) :: space_id -! INTEGER, INTENT(IN) :: operator -! INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: start -! INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: count -! INTEGER(HSIZE_T), DIMENSION(*), OPTIONAL, INTENT(IN) :: stride -! INTEGER(HSIZE_T), DIMENSION(*), OPTIONAL, INTENT(IN) :: block -! INTEGER(HID_T), INTENT(OUT) :: hyper_id -! END FUNCTION h5scombine_hyperslab_c -! END INTERFACE - -! if (present(stride).and. present(block)) then -! hdferr = h5scombine_hyperslab_c(space_id, operator, start, count, & -! stride, block, hyper_id) -! return -! endif +! INTEGER(HSIZE_T), DIMENSION(:), ALLOCATABLE :: def_block +! INTEGER(HSIZE_T), DIMENSION(:), ALLOCATABLE :: def_stride +! INTEGER :: rank +! INTEGER :: error1, error2 + +! INTERFACE +! 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 +! INTEGER(HID_T), INTENT(IN) :: space_id +! INTEGER, INTENT(IN) :: operator +! INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: start +! INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: count +! INTEGER(HSIZE_T), DIMENSION(*), OPTIONAL, INTENT(IN) :: stride +! INTEGER(HSIZE_T), DIMENSION(*), OPTIONAL, INTENT(IN) :: block +! INTEGER(HID_T), INTENT(OUT) :: hyper_id +! END FUNCTION h5scombine_hyperslab_c +! END INTERFACE + +! if (present(stride).and. present(block)) then +! hdferr = h5scombine_hyperslab_c(space_id, operator, start, count, & +! stride, block, hyper_id) +! return +! endif ! Case of optional parameters. ! ! Find the rank of the dataspace to allocate memery for ! default stride and block arrays. ! -! CALL h5sget_simple_extent_ndims_f(space_id, rank, hdferr) -! if( hdferr .EQ. -1) return +! CALL h5sget_simple_extent_ndims_f(space_id, rank, hdferr) +! if( hdferr .EQ. -1) return ! -! if (present(stride).and. .not.present(block)) then -! allocate(def_block(rank), stat=error1) -! if (error1.NE.0) then -! hdferr = -1 -! return -! endif -! def_block = 1 -! hdferr = h5scombine_hyperslab_c(space_id, operator, start, count, & -! stride, def_block, hyper_id) -! deallocate(def_block) -! return -! endif - -! if (.not.present(stride).and. present(block)) then -! allocate(def_stride(rank), stat=error2) -! if (error2.NE.0) then -! hdferr = -1 -! return -! endif -! def_stride = 1 -! hdferr = h5scombine_hyperslab_c(space_id, operator, start, count, & -! def_stride, block, hyper_id) -! deallocate(def_stride) -! return -! endif -! allocate(def_block(rank), stat=error1) -! allocate(def_stride(rank), stat=error2) -! if ((error1.NE.0) .OR. (error2.NE.0)) then -! hdferr = -1 -! return -! endif -! def_block = 1 -! def_stride = 1 -! hdferr = h5scombine_hyperslab_c(space_id, operator, start, count, & -! def_stride, def_block, hyper_id) -! deallocate(def_block) -! deallocate(def_stride) - -! END SUBROUTINE h5scombine_hyperslab_f - -!---------------------------------------------------------------------- -! Name: h5scombine_select_f -! -! Purpose: Combine two hyperslab selections with an operation -! and return a dataspace with resulting selection. -! -! Inputs: -! space1_id - dataspace of selection to use -! operator - flag, valid values are: -! H5S_SELECT_NOOP_F -! H5S_SELECT_SET_F -! H5S_SELECT_OR_F -! H5S_SELECT_AND_F -! H5S_SELECT_XOR_F -! H5S_SELECT_NOTB_F -! H5S_SELECT_NOTA_F -! H5S_SELECT_APPEND_F -! H5S_SELECT_PREPEND_F -! space2_id - dataspace of selection to use -! Outputs: -! ds_id - idataspace identifier with the new selection -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: - NONE -! -! Programmer: Elena Pourmal -! October 7, 2002 -! -! Modifications: -! -! Comment: commented out until 1.6 release(?) 10/08/2002 -!---------------------------------------------------------------------- - -! SUBROUTINE h5scombine_select_f(space1_id, operator, space2_id, & -! ds_id, hdferr) -! IMPLICIT NONE -! INTEGER(HID_T), INTENT(IN) :: space1_id ! First dataspace identifier -! INTEGER(HID_T), INTENT(IN) :: space2_id ! Second dataspace identifier -! INTEGER, INTENT(IN) :: operator ! Flag, valid values are: +! if (present(stride).and. .not.present(block)) then +! allocate(def_block(rank), stat=error1) +! if (error1.NE.0) then +! hdferr = -1 +! return +! endif +! def_block = 1 +! hdferr = h5scombine_hyperslab_c(space_id, operator, start, count, & +! stride, def_block, hyper_id) +! deallocate(def_block) +! return +! endif + +! if (.not.present(stride).and. present(block)) then +! allocate(def_stride(rank), stat=error2) +! if (error2.NE.0) then +! hdferr = -1 +! return +! endif +! def_stride = 1 +! hdferr = h5scombine_hyperslab_c(space_id, operator, start, count, & +! def_stride, block, hyper_id) +! deallocate(def_stride) +! return +! endif +! allocate(def_block(rank), stat=error1) +! allocate(def_stride(rank), stat=error2) +! if ((error1.NE.0) .OR. (error2.NE.0)) then +! hdferr = -1 +! return +! endif +! def_block = 1 +! def_stride = 1 +! hdferr = h5scombine_hyperslab_c(space_id, operator, start, count, & +! def_stride, def_block, hyper_id) +! deallocate(def_block) +! deallocate(def_stride) + +! END SUBROUTINE h5scombine_hyperslab_f + +! !$! +! !$!****s* H5S/ +! !$! +! !$! NAME +! !$! h5scombine_select_f +! !$! +! !$! PURPOSE +! !$! Combine two hyperslab selections with an operation +! !$! and return a dataspace with resulting selection. +! !$! +! !$! INPUTS +! !$! space1_id - dataspace of selection to use +! !$! operator - flag, valid values are: +! !$! H5S_SELECT_NOOP_F +! !$! H5S_SELECT_SET_F +! !$! H5S_SELECT_OR_F +! !$! H5S_SELECT_AND_F +! !$! H5S_SELECT_XOR_F +! !$! H5S_SELECT_NOTB_F +! !$! H5S_SELECT_NOTA_F +! !$! H5S_SELECT_APPEND_F +! !$! H5S_SELECT_PREPEND_F +! !$! space2_id - dataspace of selection to use +! !$! OUTPUTS +! !$! ds_id - idataspace identifier with the new selection +! !$! hdferr: - error code +! !$! Success: 0 +! !$! Failure: -1 +! !$! OPTIONAL PARAMETERS - NONE +! !$! +! !$! AUTHOR +! !$! Elena Pourmal +! !$! October 7, 2002 +! !$! +! !$! HISTORY +! !$! +! !$! +! !$! NOTES commented out until 1.6 release(?) 10/08/2002 +! !$! + +! ! SOURCE +! !$ SUBROUTINE h5scombine_select_f(space1_id, operator, space2_id, & +! ds_id, hdferr) +! IMPLICIT NONE +! INTEGER(HID_T), INTENT(IN) :: space1_id ! First dataspace identifier +! INTEGER(HID_T), INTENT(IN) :: space2_id ! Second dataspace identifier +! INTEGER, INTENT(IN) :: operator ! Flag, valid values are: ! H5S_SELECT_NOOP_F ! H5S_SELECT_SET_F ! H5S_SELECT_OR_F @@ -1598,70 +1584,77 @@ ! H5S_SELECT_APPEND_F ! H5S_SELECT_PREPEND_F ! -! INTEGER(HID_T), INTENT(OUT) :: ds_id ! New dataspace identifier -! INTEGER, INTENT(OUT) :: hdferr ! Error code -! -! INTERFACE -! 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 -! INTEGER(HID_T), INTENT(IN) :: space1_id -! INTEGER(HID_T), INTENT(IN) :: space2_id -! INTEGER, INTENT(IN) :: operator -! INTEGER(HID_T), INTENT(OUT) :: ds_id -! END FUNCTION h5scombine_select_c -! END INTERFACE - -! hdferr = h5scombine_select_c(space1_id, operator, space2_id, & -! ds_id) -! return - -! END SUBROUTINE h5scombine_select_f - -!---------------------------------------------------------------------- -! Name: h5sselect_select_f -! -! Purpose: Refine a hyperslab selection with an operation -! using second hyperslab -! -! Inputs: -! space1_id - dataspace of selection to modify -! operator - flag, valid values are: -! H5S_SELECT_NOOP_F -! H5S_SELECT_SET_F -! H5S_SELECT_OR_F -! H5S_SELECT_AND_F -! H5S_SELECT_XOR_F -! H5S_SELECT_NOTB_F -! H5S_SELECT_NOTA_F -! H5S_SELECT_APPEND_F -! H5S_SELECT_PREPEND_F -! space2_id - dataspace of selection to use -! -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: - NONE -! -! Programmer: Elena Pourmal -! October 7, 2002 -! -! Modifications: -! -! Comment:Commented out until 1.6 release(?) 10/08/2002 EIP -!---------------------------------------------------------------------- - -! SUBROUTINE h5sselect_select_f(space1_id, operator, space2_id, & -! hdferr) -! IMPLICIT NONE -! INTEGER(HID_T), INTENT(INOUT) :: space1_id ! Dataspace identifier to +! INTEGER(HID_T), INTENT(OUT) :: ds_id ! New dataspace identifier +! INTEGER, INTENT(OUT) :: hdferr ! Error code +! +! INTERFACE +! 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 +! INTEGER(HID_T), INTENT(IN) :: space1_id +! INTEGER(HID_T), INTENT(IN) :: space2_id +! INTEGER, INTENT(IN) :: operator +! INTEGER(HID_T), INTENT(OUT) :: ds_id +! END FUNCTION h5scombine_select_c +! END INTERFACE + +! hdferr = h5scombine_select_c(space1_id, operator, space2_id, & +! ds_id) +! return + +! END SUBROUTINE h5scombine_select_f + +! !$! +! !$!****s* H5S/ +! !$! +! !$! NAME +! !$! h5sselect_select_f +! !$! +! !$! PURPOSE +! !$! Refine a hyperslab selection with an operation +! !$! using second hyperslab +! !$! +! !$! INPUTS +! !$! space1_id - dataspace of selection to modify +! !$! operator - flag, valid values are: +! !$! H5S_SELECT_NOOP_F +! !$! H5S_SELECT_SET_F +! !$! H5S_SELECT_OR_F +! !$! H5S_SELECT_AND_F +! !$! H5S_SELECT_XOR_F +! !$! H5S_SELECT_NOTB_F +! !$! H5S_SELECT_NOTA_F +! !$! H5S_SELECT_APPEND_F +! !$! H5S_SELECT_PREPEND_F +! !$! space2_id - dataspace of selection to use +! !$! +! !$! OUTPUTS +! !$! hdferr: - error code +! !$! Success: 0 +! !$! Failure: -1 +! !$! OPTIONAL PARAMETERS - NONE +! !$! +! !$! AUTHOR +! !$! Elena Pourmal +! !$! October 7, 2002 +! !$! +! !$! HISTORY +! !$! +! !$! +! !$! NOTESCommented out until 1.6 release(?) 10/08/2002 EIP +! !$! + +! ! SOURCE +! SUBROUTINE h5sselect_select_f(space1_id, operator, space2_id, & +! hdferr) +! IMPLICIT NONE +! INTEGER(HID_T), INTENT(INOUT) :: space1_id ! Dataspace identifier to ! modify -! INTEGER(HID_T), INTENT(IN) :: space2_id ! Second dataspace identifier -! INTEGER, INTENT(IN) :: operator ! Flag, valid values are: +! INTEGER(HID_T), INTENT(IN) :: space2_id ! Second dataspace identifier +! INTEGER, INTENT(IN) :: operator ! Flag, valid values are: ! H5S_SELECT_NOOP_F ! H5S_SELECT_SET_F ! H5S_SELECT_OR_F @@ -1672,53 +1665,50 @@ ! H5S_SELECT_APPEND_F ! H5S_SELECT_PREPEND_F ! -! INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTERFACE -! 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 -! INTEGER(HID_T), INTENT(INOUT) :: space1_id -! INTEGER(HID_T), INTENT(IN) :: space2_id -! INTEGER, INTENT(IN) :: operator -! END FUNCTION h5sselect_select_c -! END INTERFACE - -! hdferr = h5sselect_select_c(space1_id, operator, space2_id) -! return - -! END SUBROUTINE h5sselect_select_f - -!---------------------------------------------------------------------- -! Name: h5sget_select_type_f -! -! Purpose: Retrieve the type of selection -! -! Inputs: -! space_id - dataspace iidentifier with selection -! Outputs: -! type - flag, valid values are: -! H5S_SEL_ERROR_F -! H5S_SEL_NONE_F -! H5S_SEL_POINTS_F -! H5S_SEL_HYPERSLABS_F -! H5S_SEL_ALL_F -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: - NONE -! -! Programmer: Elena Pourmal -! October 7, 2002 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - +! INTEGER, INTENT(OUT) :: hdferr ! Error code + +! INTERFACE +! 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 +! INTEGER(HID_T), INTENT(INOUT) :: space1_id +! INTEGER(HID_T), INTENT(IN) :: space2_id +! INTEGER, INTENT(IN) :: operator +! END FUNCTION h5sselect_select_c +! END INTERFACE + +! hdferr = h5sselect_select_c(space1_id, operator, space2_id) +! return + +! END SUBROUTINE h5sselect_select_f + +! +!****s* H5S/h5sget_select_type_f +! +! NAME +! h5sget_select_type_f +! +! PURPOSE +! Retrieve the type of selection +! +! INPUTS +! space_id - dataspace iidentifier with selection +! OUTPUTS +! type - flag, valid values are: +! H5S_SEL_ERROR_F +! H5S_SEL_NONE_F +! H5S_SEL_POINTS_F +! H5S_SEL_HYPERSLABS_F +! H5S_SEL_ALL_F +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! Elena Pourmal +! October 7, 2002 +! +! SOURCE SUBROUTINE h5sget_select_type_f(space_id, type, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(INOUT) :: space_id ! Dataspace identifier to @@ -1729,7 +1719,7 @@ ! H5S_SEL_HYPERSLABS_F ! H5S_SEL_ALL_F INTEGER, INTENT(OUT) :: hdferr ! Error code - +!***** INTERFACE INTEGER FUNCTION h5sget_select_type_c(space_id, type) USE H5GLOBAL @@ -1746,35 +1736,31 @@ END SUBROUTINE h5sget_select_type_f -!---------------------------------------------------------------------- -! Name: H5Sdecode_f -! -! Purpose: Decode a binary object description of data space and return a new object handle. ! -! Inputs: -! buf - Buffer for the data space object to be decoded. -! obj_id - Object ID -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 +!****s* H5S/H5Sdecode_f ! -! Optional parameters: - NONE +! NAME +! H5Sdecode_f ! -! Programmer: M.S. Breitenfeld -! March 26, 2008 +! PURPOSE +! Decode a binary object description of data space and return a new object handle. ! -! Modifications: +! INPUTS +! buf - Buffer for the data space object to be decoded. +! obj_id - Object ID +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails ! -! Comment: -!---------------------------------------------------------------------- - +! AUTHOR +! M. Scot Breitenfeld +! March 26, 2008 +! SOURCE SUBROUTINE h5sdecode_f(buf, obj_id, hdferr) IMPLICIT NONE CHARACTER(LEN=*), INTENT(IN) :: buf ! Buffer for the data space object to be decoded. INTEGER(HID_T), INTENT(OUT) :: obj_id ! Object ID INTEGER, INTENT(OUT) :: hdferr ! Error code - +!***** INTERFACE INTEGER FUNCTION h5sdecode_c(buf, obj_id) USE H5GLOBAL @@ -1791,38 +1777,34 @@ END SUBROUTINE h5sdecode_f -!---------------------------------------------------------------------- -! Name: H5Sencode_f ! -! Purpose: Encode a data space object description into a binary buffer. +!****s* H5S/H5Sencode_f ! -! Inputs: -! obj_id - Identifier of the object to be encoded. -! buf - Buffer for the object to be encoded into. -! nalloc - The size of the allocated buffer. -! Outputs: -! nalloc - The size of the buffer needed. -! hdferr: - error code -! Success: 0 -! Failure: -1 +! NAME +! H5Sencode_f ! -! Optional parameters: - NONE +! PURPOSE +! Encode a data space object description into a binary buffer. ! -! Programmer: M.S. Breitenfeld -! March 26, 2008 +! INPUTS +! obj_id - Identifier of the object to be encoded. +! buf - Buffer for the object to be encoded into. +! nalloc - The size of the allocated buffer. +! OUTPUTS +! nalloc - The size of the buffer needed. +! hdferr - Returns 0 if successful and -1 if fails. ! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - +! AUTHOR +! M. Scot Breitenfeld +! March 26, 2008 +! SOURCE SUBROUTINE h5sencode_f(obj_id, buf, nalloc, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: obj_id ! Identifier of the object to be encoded. CHARACTER(LEN=*), INTENT(OUT) :: buf ! Buffer for the object to be encoded into. INTEGER(SIZE_T), INTENT(INOUT) :: nalloc ! The size of the allocated buffer. INTEGER, INTENT(OUT) :: hdferr ! Error code - +!***** INTERFACE INTEGER FUNCTION h5sencode_c(buf, obj_id, nalloc) @@ -1841,38 +1823,32 @@ END SUBROUTINE h5sencode_f - -!---------------------------------------------------------------------- -! Name: h5sextent_equal_f +!****s* H5S/h5sextent_equal_f ! -! Purpose: Determines whether two dataspace extents are equal. +! NAME +! h5sextent_equal_f ! -! Inputs: -! space1_id - First dataspace identifier. -! space2_id - Second dataspace identifier. -! Outputs: -! Equal - .TRUE. if equal, .FALSE. if unequal. -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! PURPOSE +! Determines whether two dataspace extents are equal. ! -! Programmer: M.S. Breitenfeld -! April 2, 2008 +! INPUTS +! space1_id - First dataspace identifier. +! space2_id - Second dataspace identifier. +! OUTPUTS +! Equal - .TRUE. if equal, .FALSE. if unequal. +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! M. Scot Breitenfeld +! April 2, 2008 ! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - +! SOURCE SUBROUTINE h5sextent_equal_f(space1_id, space2_id, equal, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: space1_id ! First dataspace identifier. INTEGER(HID_T), INTENT(IN) :: space2_id ! Second dataspace identifier. LOGICAL, INTENT(OUT) :: Equal ! .TRUE. if equal, .FALSE. if unequal. INTEGER, INTENT(OUT) :: hdferr ! Error code - +!***** INTEGER(HID_T) :: c_equal INTERFACE diff --git a/fortran/src/H5Tf.c b/fortran/src/H5Tf.c index 37cfca0..c8ff6e0 100644 --- a/fortran/src/H5Tf.c +++ b/fortran/src/H5Tf.c @@ -1,4 +1,9 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +/****h* H5Tf/H5Tf + * PURPOSE + * This file contains C stubs for H5T Fortran APIs + * + * COPYRIGHT + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * @@ -11,28 +16,38 @@ * is linked from the top-level documents page. It can also be found at * * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * * access to either file, you may request a copy from help@hdfgroup.org. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -/* This files contains C stubs for H5T Fortran APIs */ + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * + ****** +*/ #include "H5f90.h" -/*---------------------------------------------------------------------------- - * Name: h5topen_c - * Purpose: Call H5Topen2 to open a datatype - * Inputs: loc_id - file or group identifier +/****if* H5Tf/h5topen_c + * NAME + * h5topen_c + * PURPOSE + * Call H5Topen2 to open a datatype + * INPUTS + * loc_id - file or group identifier * name - name of the datatype within file or group * namelen - name length * tapl_id - datatype access property list identifier - * Outputs: type_id - dataset identifier - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * OUTPUTS + * type_id - dataset identifier + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Saturday, August 14, 1999 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5topen_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id, hid_t_f *tapl_id) +/******/ { char *c_name = NULL; hid_t c_type_id; @@ -61,26 +76,34 @@ done: } -/*---------------------------------------------------------------------------- - * Name: h5tcommit_c - * Purpose: Call H5Tcommit2 to commit a datatype - * Inputs: loc_id - file or group identifier +/****if* H5Tf/h5tcommit_c + * NAME + * h5tcommit_c + * PURPOSE + * Call H5Tcommit2 to commit a datatype + * INPUTS + * loc_id - file or group identifier * name - name of the datatype within file or group * namelen - name length * type_id - dataset identifier * lcpl_id - Link creation property list * tcpl_id - Datatype creation property list * tapl_id - Datatype access property list - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Saturday, August 14, 1999 - * Modifications: + * HISTORY + * * - Added passing optional parameters for version 1.8 - * M.S. Breitenfeld - *---------------------------------------------------------------------------*/ + * M. Scot Breitenfeld + * SOURCE +*/ int_f nh5tcommit_c(hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id, hid_t_f *lcpl_id, hid_t_f *tcpl_id, hid_t_f *tapl_id) +/******/ { char *c_name = NULL; int ret_value = -1; @@ -101,18 +124,26 @@ done: return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5tclose_c - * Purpose: Call H5Tclose to close the datatype - * Inputs: type_id - identifier of the datatype to be closed - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal +/****if* H5Tf/h5tclose_c + * NAME + * h5tclose_c + * PURPOSE + * Call H5Tclose to close the datatype + * INPUTS + * type_id - identifier of the datatype to be closed + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Saturday, August 14, 1999 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5tclose_c ( hid_t_f *type_id ) +/******/ { int ret_value = 0; hid_t c_type_id; @@ -123,19 +154,28 @@ nh5tclose_c ( hid_t_f *type_id ) } -/*---------------------------------------------------------------------------- - * Name: h5tcopy_c - * Purpose: Call H5Tcopy to copy a datatype - * Inputs: type_id - identifier of the datatype to be copied - * Outputs: new_type_id - identifier of the new datatype - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal +/****if* H5Tf/h5tcopy_c + * NAME + * h5tcopy_c + * PURPOSE + * Call H5Tcopy to copy a datatype + * INPUTS + * type_id - identifier of the datatype to be copied + * OUTPUTS + * new_type_id - identifier of the new datatype + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Saturday, August 14, 1999 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5tcopy_c ( hid_t_f *type_id , hid_t_f *new_type_id) +/******/ { int ret_value = 0; hid_t c_type_id; @@ -148,20 +188,29 @@ nh5tcopy_c ( hid_t_f *type_id , hid_t_f *new_type_id) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5tequal_c - * Purpose: Call H5Tequal to copy a datatype - * Inputs: type1_id - datatype identifier +/****if* H5Tf/h5tequal_c + * NAME + * h5tequal_c + * PURPOSE + * Call H5Tequal to copy a datatype + * INPUTS + * type1_id - datatype identifier * type2_id - datatype identifier - * Outputs: c_flag - flag; indicates if two datatypes are equal or not. - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * OUTPUTS + * c_flag - flag; indicates if two datatypes are equal or not. + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Tuesday, February 22, 2000 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5tequal_c ( hid_t_f *type1_id , hid_t_f *type2_id, int_f *c_flag) +/******/ { int ret_value = -1; hid_t c_type1_id, c_type2_id; @@ -177,11 +226,15 @@ nh5tequal_c ( hid_t_f *type1_id , hid_t_f *type2_id, int_f *c_flag) } -/*---------------------------------------------------------------------------- - * Name: h5tget_class_c - * Purpose: Call H5Tget_class to determine the datatype class - * Inputs: type_id - identifier of the dataspace - * Outputs: classtype - class type; possible values are: +/****if* H5Tf/h5tget_class_c + * NAME + * h5tget_class_c + * PURPOSE + * Call H5Tget_class to determine the datatype class + * INPUTS + * type_id - identifier of the dataspace + * OUTPUTS + * classtype - class type; possible values are: * H5T_NO_CLASS_F (-1) * H5T_INTEGER_F (0) * H5T_FLOAT_F (1) @@ -192,14 +245,19 @@ nh5tequal_c ( hid_t_f *type1_id , hid_t_f *type2_id, int_f *c_flag) * H5T_COMPOUNDF (6) * H5T_REFERENCE_F (7) * H5T_ENUMF (8) - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Saturday, August 14, 1999 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5tget_class_c ( hid_t_f *type_id , int_f *classtype) +/******/ { int ret_value = 0; hid_t c_type_id; @@ -228,22 +286,31 @@ nh5tget_class_c ( hid_t_f *type_id , int_f *classtype) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5tget_order_c - * Purpose: Call H5Tget_order to determine byte order - * Inputs: type_id - identifier of the dataspace - * Outputs: order; possible values are: +/****if* H5Tf/h5tget_order_c + * NAME + * h5tget_order_c + * PURPOSE + * Call H5Tget_order to determine byte order + * INPUTS + * type_id - identifier of the dataspace + * OUTPUTS + * order; possible values are: * H5T_ORDER_LE_F (0) * H5T_ORDER_BE_F (1) * H5T_ORDER_VAX_F (2) - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Saturday, August 14, 1999 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5tget_order_c ( hid_t_f *type_id , int_f *order) +/******/ { int ret_value = -1; hid_t c_type_id; @@ -263,22 +330,30 @@ nh5tget_order_c ( hid_t_f *type_id , int_f *order) } -/*---------------------------------------------------------------------------- - * Name: h5tset_order_c - * Purpose: Call H5Tset_order to set byte order - * Inputs: type_id - identifier of the dataspace +/****if* H5Tf/h5tset_order_c + * NAME + * h5tset_order_c + * PURPOSE + * Call H5Tset_order to set byte order + * INPUTS + * type_id - identifier of the dataspace * order; possible values are: * H5T_ORDER_LE_F (0) * H5T_ORDER_BE_F (1) * H5T_ORDER_VAX_F (2) - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Saturday, August 14, 1999 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5tset_order_c ( hid_t_f *type_id , int_f *order) +/******/ { int ret_value = 0; hid_t c_type_id; @@ -296,19 +371,28 @@ nh5tset_order_c ( hid_t_f *type_id , int_f *order) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5tget_size_c - * Purpose: Call H5Tget_size to get size of the datatype - * Inputs: type_id - identifier of the dataspace - * Outputs: size (in bytes) - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal +/****if* H5Tf/h5tget_size_c + * NAME + * h5tget_size_c + * PURPOSE + * Call H5Tget_size to get size of the datatype + * INPUTS + * type_id - identifier of the dataspace + * OUTPUTS + * size (in bytes) + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Saturday, August 14, 1999 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5tget_size_c ( hid_t_f *type_id , size_t_f *size) +/******/ { int ret_value = -1; hid_t c_type_id; @@ -322,19 +406,28 @@ nh5tget_size_c ( hid_t_f *type_id , size_t_f *size) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5tset_size_c - * Purpose: Call H5Tget_size to get size of the datatype - * Inputs: type_id - identifier of the dataspace - * Outputs: size (in bytes) - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal +/****if* H5Tf/h5tset_size_c + * NAME + * h5tset_size_c + * PURPOSE + * Call H5Tget_size to get size of the datatype + * INPUTS + * type_id - identifier of the dataspace + * OUTPUTS + * size (in bytes) + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Saturday, August 14, 1999 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5tset_size_c ( hid_t_f *type_id , size_t_f *size) +/******/ { int ret_value = -1; hid_t c_type_id; @@ -349,19 +442,28 @@ nh5tset_size_c ( hid_t_f *type_id , size_t_f *size) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5tget_precision_c - * Purpose: Call H5Tget_precision to get precision of the datatype - * Inputs: type_id - identifier of the dataspace - * Outputs: precision - number of significant bits - * Returns: 0 on success, -1 on failure - * Programmer: XIANGYANG SU +/****if* H5Tf/h5tget_precision_c + * NAME + * h5tget_precision_c + * PURPOSE + * Call H5Tget_precision to get precision of the datatype + * INPUTS + * type_id - identifier of the dataspace + * OUTPUTS + * precision - number of significant bits + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * XIANGYANG SU * Tuesday, January 25, 2000 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5tget_precision_c ( hid_t_f *type_id , size_t_f *precision) +/******/ { int ret_value = -1; hid_t c_type_id; @@ -375,19 +477,27 @@ nh5tget_precision_c ( hid_t_f *type_id , size_t_f *precision) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5tset_precision_c - * Purpose: Call H5Tset_precision to set precision of the datatype - * Inputs: type_id - identifier of the dataspace +/****if* H5Tf/h5tset_precision_c + * NAME + * h5tset_precision_c + * PURPOSE + * Call H5Tset_precision to set precision of the datatype + * INPUTS + * type_id - identifier of the dataspace * precision - number of significant bits - * Returns: 0 on success, -1 on failure - * Programmer: XIANGYANG SU + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * XIANGYANG SU * Tuesday, January 25, 2000 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5tset_precision_c ( hid_t_f *type_id , size_t_f *precision) +/******/ { int ret_value = -1; hid_t c_type_id; @@ -402,20 +512,29 @@ nh5tset_precision_c ( hid_t_f *type_id , size_t_f *precision) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5tget_offset_c - * Purpose: Call H5Tget_offset to get bit offset of the first +/****if* H5Tf/h5tget_offset_c + * NAME + * h5tget_offset_c + * PURPOSE + * Call H5Tget_offset to get bit offset of the first * significant bit of the datatype - * Inputs: type_id - identifier of the dataspace - * Outputs: offset - bit offset of the first significant bit - * Returns: 0 on success, -1 on failure - * Programmer: XIANGYANG SU + * INPUTS + * type_id - identifier of the dataspace + * OUTPUTS + * offset - bit offset of the first significant bit + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * XIANGYANG SU * Tuesday, January 25, 2000 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5tget_offset_c ( hid_t_f *type_id , size_t_f *offset) +/******/ { int ret_value = -1; hid_t c_type_id; @@ -430,20 +549,28 @@ nh5tget_offset_c ( hid_t_f *type_id , size_t_f *offset) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5tset_offset_c - * Purpose: Call H5Tset_offset to set bit offset of the first +/****if* H5Tf/h5tset_offset_c + * NAME + * h5tset_offset_c + * PURPOSE + * Call H5Tset_offset to set bit offset of the first * significant bit of the datatype - * Inputs: type_id - identifier of the dataspace + * INPUTS + * type_id - identifier of the dataspace * offset - bit offset of the first significant bit - * Returns: 0 on success, -1 on failure - * Programmer: XIANGYANG SU + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * XIANGYANG SU * Tuesday, January 25, 2000 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5tset_offset_c ( hid_t_f *type_id , size_t_f *offset) +/******/ { int ret_value = -1; hid_t c_type_id; @@ -458,22 +585,31 @@ nh5tset_offset_c ( hid_t_f *type_id , size_t_f *offset) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5tget_pad_c - * Purpose: Call H5Tget_pad to get the padding type of the least and +/****if* H5Tf/h5tget_pad_c + * NAME + * h5tget_pad_c + * PURPOSE + * Call H5Tget_pad to get the padding type of the least and * most-significant bit padding * - * Inputs: type_id - identifier of the dataspace - * Outputs: lsbpad - padding type of the least significant bit + * INPUTS + * type_id - identifier of the dataspace + * OUTPUTS + * lsbpad - padding type of the least significant bit * msbpad - padding type of the least significant bit - * Returns: 0 on success, -1 on failure - * Programmer: XIANGYANG SU + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * XIANGYANG SU * Wednesday, January 26, 2000 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5tget_pad_c ( hid_t_f *type_id , int_f * lsbpad, int_f * msbpad) +/******/ { int ret_value = -1; hid_t c_type_id; @@ -490,23 +626,32 @@ nh5tget_pad_c ( hid_t_f *type_id , int_f * lsbpad, int_f * msbpad) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5tset_pad_c - * Inputs: type_id - identifier of the dataspace - * Purpose: Call H5Tset_pad to set the padding type of the least and +/****if* H5Tf/h5tset_pad_c + * NAME + * h5tset_pad_c + * INPUTS + * type_id - identifier of the dataspace + * PURPOSE + * Call H5Tset_pad to set the padding type of the least and * most-significant bit padding * - * Inputs: type_id - identifier of the dataspace + * INPUTS + * type_id - identifier of the dataspace * lsbpad - padding type of the least significant bit * msbpad - padding type of the least significant bit - * Returns: 0 on success, -1 on failure - * Programmer: XIANGYANG SU + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * XIANGYANG SU * Wednesday, January 26, 2000 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5tset_pad_c ( hid_t_f *type_id, int_f * lsbpad, int_f* msbpad ) +/******/ { int ret_value = -1; hid_t c_type_id; @@ -522,19 +667,28 @@ nh5tset_pad_c ( hid_t_f *type_id, int_f * lsbpad, int_f* msbpad ) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5tget_sign_c - * Purpose: Call H5Tget_sign to get sign type for an integer type - * Inputs: type_id - identifier of the dataspace - * Outputs: sign - sign type for an integer type - * Returns: 0 on success, -1 on failure - * Programmer: XIANGYANG SU +/****if* H5Tf/h5tget_sign_c + * NAME + * h5tget_sign_c + * PURPOSE + * Call H5Tget_sign to get sign type for an integer type + * INPUTS + * type_id - identifier of the dataspace + * OUTPUTS + * sign - sign type for an integer type + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * XIANGYANG SU * Wednesday, January 26, 2000 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5tget_sign_c ( hid_t_f *type_id , int_f *sign) +/******/ { int ret_value = -1; hid_t c_type_id; @@ -548,19 +702,27 @@ nh5tget_sign_c ( hid_t_f *type_id , int_f *sign) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5tset_sign_c - * Purpose: Call H5Tset_sign to set sign type for an integer type - * Inputs: type_id - identifier of the dataspace +/****if* H5Tf/h5tset_sign_c + * NAME + * h5tset_sign_c + * PURPOSE + * Call H5Tset_sign to set sign type for an integer type + * INPUTS + * type_id - identifier of the dataspace * sign - sign type for an integer typ - * Returns: 0 on success, -1 on failure - * Programmer: XIANGYANG SU + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * XIANGYANG SU * Wednesday, January 26, 2000 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5tset_sign_c ( hid_t_f *type_id , int_f* sign) +/******/ { int ret_value = -1; hid_t c_type_id; @@ -576,23 +738,32 @@ nh5tset_sign_c ( hid_t_f *type_id , int_f* sign) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5tget_fields_c - * Purpose: Call H5Tget_fields to get floating point datatype +/****if* H5Tf/h5tget_fields_c + * NAME + * h5tget_fields_c + * PURPOSE + * Call H5Tget_fields to get floating point datatype * bit field information - * Inputs: type_id - identifier of the dataspace - * Outputs: epos - exponent bit-position + * INPUTS + * type_id - identifier of the dataspace + * OUTPUTS + * epos - exponent bit-position * esize - size of exponent in bits * mpos - mantissa bit-position * msize - size of mantissa in bits - * Returns: 0 on success, -1 on failure - * Programmer: XIANGYANG SU + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * XIANGYANG SU * Thursday, January 27, 2000 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5tget_fields_c ( hid_t_f *type_id , size_t_f *spos, size_t_f *epos, size_t_f* esize, size_t_f* mpos, size_t_f* msize) +/******/ { int ret_value = -1; hid_t c_type_id; @@ -611,23 +782,31 @@ nh5tget_fields_c ( hid_t_f *type_id , size_t_f *spos, size_t_f *epos, size_t_f* return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5tset_fields_c - * Purpose: Call H5Tset_fields to set floating point datatype +/****if* H5Tf/h5tset_fields_c + * NAME + * h5tset_fields_c + * PURPOSE + * Call H5Tset_fields to set floating point datatype * bit field information - * Inputs: type_id - identifier of the dataspace + * INPUTS + * type_id - identifier of the dataspace * epos - exponent bit-position * esize - size of exponent in bits * mpos - mantissa bit-position * msize - size of mantissa in bits - * Returns: 0 on success, -1 on failure - * Programmer: XIANGYANG SU + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * XIANGYANG SU * Wednesday, January 26, 2000 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5tset_fields_c ( hid_t_f *type_id, size_t_f *spos, size_t_f *epos, size_t_f* esize, size_t_f* mpos, size_t_f* msize) +/******/ { int ret_value = -1; hid_t c_type_id; @@ -647,20 +826,29 @@ nh5tset_fields_c ( hid_t_f *type_id, size_t_f *spos, size_t_f *epos, size_t_f* e return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5tget_ebias_c - * Purpose: Call H5Tget_ebias to get exponent bias of a +/****if* H5Tf/h5tget_ebias_c + * NAME + * h5tget_ebias_c + * PURPOSE + * Call H5Tget_ebias to get exponent bias of a * floating-point type of the datatype - * Inputs: type_id - identifier of the dataspace - * Outputs: ebias - exponent bias of a floating-point type of the datatype - * Returns: 0 on success, -1 on failure - * Programmer: Xiangyang Su + * INPUTS + * type_id - identifier of the dataspace + * OUTPUTS + * ebias - exponent bias of a floating-point type of the datatype + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Xiangyang Su * Friday, January 27, 2000 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5tget_ebias_c ( hid_t_f *type_id , size_t_f *ebias) +/******/ { int ret_value = -1; hid_t c_type_id; @@ -675,20 +863,28 @@ nh5tget_ebias_c ( hid_t_f *type_id , size_t_f *ebias) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5tset_ebias_c - * Purpose: Call H5Tset_ebias to set exponent bias of a +/****if* H5Tf/h5tset_ebias_c + * NAME + * h5tset_ebias_c + * PURPOSE + * Call H5Tset_ebias to set exponent bias of a * floating-point type of the datatype - * Inputs: type_id - identifier of the dataspace + * INPUTS + * type_id - identifier of the dataspace * ebias - exponent bias of a floating-point type of the datatyp - * Returns: 0 on success, -1 on failure - * Programmer: Xiangyang Su + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Xiangyang Su * Friday, January 27, 2000 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5tset_ebias_c ( hid_t_f *type_id , size_t_f *ebias) +/******/ { int ret_value = -1; hid_t c_type_id; @@ -704,20 +900,29 @@ nh5tset_ebias_c ( hid_t_f *type_id , size_t_f *ebias) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5tget_norm_c - * Purpose: Call H5Tget_norm to get mantissa normalization +/****if* H5Tf/h5tget_norm_c + * NAME + * h5tget_norm_c + * PURPOSE + * Call H5Tget_norm to get mantissa normalization * of a floating-point datatype - * Inputs: type_id - identifier of the dataspace - * Outputs: norm - mantissa normalization of a floating-point type - * Returns: 0 on success, -1 on failure - * Programmer: Xiangyang Su + * INPUTS + * type_id - identifier of the dataspace + * OUTPUTS + * norm - mantissa normalization of a floating-point type + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Xiangyang Su * Friday, January 27, 2000 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5tget_norm_c ( hid_t_f *type_id , int_f *norm) +/******/ { int ret_value = -1; hid_t c_type_id; @@ -732,20 +937,28 @@ nh5tget_norm_c ( hid_t_f *type_id , int_f *norm) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5tset_norm_c - * Purpose: Call H5Tset_norm to set mantissa normalization of +/****if* H5Tf/h5tset_norm_c + * NAME + * h5tset_norm_c + * PURPOSE + * Call H5Tset_norm to set mantissa normalization of * floating-point type of the datatype - * Inputs: type_id - identifier of the dataspace + * INPUTS + * type_id - identifier of the dataspace * norm - mantissa normalization of a floating-point type - * Returns: 0 on success, -1 on failure - * Programmer: Xiangyang Su + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Xiangyang Su * Friday, January 27, 2000 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5tset_norm_c ( hid_t_f *type_id , int_f *norm) +/******/ { int ret_value = -1; hid_t c_type_id; @@ -761,22 +974,31 @@ nh5tset_norm_c ( hid_t_f *type_id , int_f *norm) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5tget_inpad_c - * Purpose: Call H5Tget_inpad to get the padding type for +/****if* H5Tf/h5tget_inpad_c + * NAME + * h5tget_inpad_c + * PURPOSE + * Call H5Tget_inpad to get the padding type for * unused bits in floating-point datatypes * - * Inputs: type_id - identifier of the dataspace - * Outputs: padtype - padding type for + * INPUTS + * type_id - identifier of the dataspace + * OUTPUTS + * padtype - padding type for * unused bits in floating-point datatype - * Returns: 0 on success, -1 on failure - * Programmer: XIANGYANG SU + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * XIANGYANG SU * Wednesday, January 26, 2000 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5tget_inpad_c ( hid_t_f *type_id , int_f * padtype) +/******/ { int ret_value = -1; hid_t c_type_id; @@ -791,23 +1013,32 @@ nh5tget_inpad_c ( hid_t_f *type_id , int_f * padtype) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5tset_inpad_c - * Inputs: type_id - identifier of the dataspace - * Purpose: Call H5Tset_inpad to set the padding type +/****if* H5Tf/h5tset_inpad_c + * NAME + * h5tset_inpad_c + * INPUTS + * type_id - identifier of the dataspace + * PURPOSE + * Call H5Tset_inpad to set the padding type * unused bits in floating-point datatype * - * Inputs: type_id - identifier of the dataspace + * INPUTS + * type_id - identifier of the dataspace * padtype - padding type for unused bits * in floating-point datatypes - * Returns: 0 on success, -1 on failure - * Programmer: XIANGYANG SU + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * XIANGYANG SU * Wednesday, January 26, 2000 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5tset_inpad_c ( hid_t_f *type_id, int_f * padtype) +/******/ { int ret_value = -1; hid_t c_type_id; @@ -823,21 +1054,30 @@ nh5tset_inpad_c ( hid_t_f *type_id, int_f * padtype) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5tget_cset_c - * Purpose: Call H5Tget_cset to get character set +/****if* H5Tf/h5tget_cset_c + * NAME + * h5tget_cset_c + * PURPOSE + * Call H5Tget_cset to get character set * type of a string datatype * - * Inputs: type_id - identifier of the dataspace - * Outputs: cset - character set type of a string datatype - * Returns: 0 on success, -1 on failure - * Programmer: XIANGYANG SU + * INPUTS + * type_id - identifier of the dataspace + * OUTPUTS + * cset - character set type of a string datatype + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * XIANGYANG SU * Wednesday, January 26, 2000 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5tget_cset_c ( hid_t_f *type_id , int_f * cset) +/******/ { int ret_value = -1; hid_t c_type_id; @@ -852,22 +1092,31 @@ nh5tget_cset_c ( hid_t_f *type_id , int_f * cset) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5tset_cset_c - * Inputs: type_id - identifier of the dataspace - * Purpose: Call H5Tset_cset to set character set +/****if* H5Tf/h5tset_cset_c + * NAME + * h5tset_cset_c + * INPUTS + * type_id - identifier of the dataspace + * PURPOSE + * Call H5Tset_cset to set character set * type of a string datatype * - * Inputs: type_id - identifier of the dataspace + * INPUTS + * type_id - identifier of the dataspace * cset - character set type of a string datatype - * Returns: 0 on success, -1 on failure - * Programmer: XIANGYANG SU + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * XIANGYANG SU * Wednesday, January 26, 2000 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5tset_cset_c ( hid_t_f *type_id, int_f * cset) +/******/ { int ret_value = -1; hid_t c_type_id; @@ -883,20 +1132,28 @@ nh5tset_cset_c ( hid_t_f *type_id, int_f * cset) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5tget_strpad_c - * Purpose: Call H5Tget_strpad to get string padding method +/****if* H5Tf/h5tget_strpad_c + * NAME + * h5tget_strpad_c + * PURPOSE + * Call H5Tget_strpad to get string padding method * for a string datatype - * Inputs: type_id - identifier of the dataspace - * Outputs: strpad - string padding method for a string datatype - * Returns: 0 on success, -1 on failure - * Programmer: XIANGYANG SU + * INPUTS + * type_id - identifier of the dataspace + * OUTPUTS + * strpad - string padding method for a string datatype + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * XIANGYANG SU * Wednesday, January 26, 2000 - * Modifications: - *---------------------------------------------------------------------------*/ - + * HISTORY + * + * SOURCE +*/ int_f nh5tget_strpad_c ( hid_t_f *type_id , int_f * strpad) +/******/ { int ret_value = -1; hid_t c_type_id; @@ -911,22 +1168,31 @@ nh5tget_strpad_c ( hid_t_f *type_id , int_f * strpad) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5tset_strpad_c - * Inputs: type_id - identifier of the dataspace - * Purpose: Call H5Tset_strpad to set string padding method +/****if* H5Tf/h5tset_strpad_c + * NAME + * h5tset_strpad_c + * INPUTS + * type_id - identifier of the dataspace + * PURPOSE + * Call H5Tset_strpad to set string padding method * for a string datatype * - * Inputs: type_id - identifier of the dataspace + * INPUTS + * type_id - identifier of the dataspace * strpad - string padding method for a string datatype - * Returns: 0 on success, -1 on failure - * Programmer: XIANGYANG SU + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * XIANGYANG SU * Wednesday, January 26, 2000 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5tset_strpad_c ( hid_t_f *type_id, int_f * strpad) +/******/ { int ret_value = -1; hid_t c_type_id; @@ -942,20 +1208,29 @@ nh5tset_strpad_c ( hid_t_f *type_id, int_f * strpad) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5tget_nmembers_c - * Purpose: Call H5Tget_nmembers to get number of fields +/****if* H5Tf/h5tget_nmembers_c + * NAME + * h5tget_nmembers_c + * PURPOSE + * Call H5Tget_nmembers to get number of fields * in a compound datatype - * Inputs: type_id - identifier of the dataspace - * Outputs: num_members - number of fields in a compound datatype - * Returns: 0 on success, -1 on failure - * Programmer: XIANGYANG SU + * INPUTS + * type_id - identifier of the dataspace + * OUTPUTS + * num_members - number of fields in a compound datatype + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * XIANGYANG SU * Thursday, February 3, 2000 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5tget_nmembers_c ( hid_t_f *type_id , int_f * num_members) +/******/ { int ret_value = -1; hid_t c_type_id; @@ -968,21 +1243,30 @@ nh5tget_nmembers_c ( hid_t_f *type_id , int_f * num_members) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5tget_member_name_c - * Purpose: Call H5Tget_member_name to get name +/****if* H5Tf/h5tget_member_name_c + * NAME + * h5tget_member_name_c + * PURPOSE + * Call H5Tget_member_name to get name * of a compound datatype - * Inputs: type_id - identifier of the dataspace - * Outputs: member_name - name of a field of a compound datatype - * Returns: 0 on success, -1 on failure - * Programmer: XIANGYANG SU + * INPUTS + * type_id - identifier of the dataspace + * OUTPUTS + * member_name - name of a field of a compound datatype + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * XIANGYANG SU * Thursday, February 3, 2000 - * Modifications: Elena Pourmal + * HISTORY + * Elena Pourmal * Added namelen parameter to return length of the name to Fortran user - *---------------------------------------------------------------------------*/ + * SOURCE +*/ int_f nh5tget_member_name_c ( hid_t_f *type_id ,int_f* idx, _fcd member_name, int_f *namelen) +/******/ { int ret_value = -1; hid_t c_type_id; @@ -1000,21 +1284,30 @@ nh5tget_member_name_c ( hid_t_f *type_id ,int_f* idx, _fcd member_name, int_f *n ret_value = 0; return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5tget_member_index_c - * Purpose: Call H5Tget_member_index to get an index of +/****if* H5Tf/h5tget_member_index_c + * NAME + * h5tget_member_index_c + * PURPOSE + * Call H5Tget_member_index to get an index of * the specified datatype filed or member. - * Inputs: type_id - datatype identifier + * INPUTS + * type_id - datatype identifier * name - name of the datatype within file or group * namelen - name length - * Outputs: index - 0-based index - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * OUTPUTS + * index - 0-based index + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Thursday, September 26, 2002 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5tget_member_index_c (hid_t_f *type_id, _fcd name, int_f *namelen, int_f *idx) +/******/ { int ret_value = -1; char *c_name; @@ -1044,23 +1337,32 @@ DONE: } -/*---------------------------------------------------------------------------- - * Name: h5tget_member_offset_c - * Purpose: Call H5Tget_member_offset to get byte offset of the +/****if* H5Tf/h5tget_member_offset_c + * NAME + * h5tget_member_offset_c + * PURPOSE + * Call H5Tget_member_offset to get byte offset of the * beginning of a field within a compound datatype with * respect to the beginning of the compound data type datum - * Inputs: type_id - identifier of the dataspace + * INPUTS + * type_id - identifier of the dataspace * member_no - Number of the field whose offset is requested - * Outputs: offset - byte offset of the the beginning of the field of + * OUTPUTS + * offset - byte offset of the the beginning of the field of * a compound datatype - * Returns: always 0 - * Programmer: XIANGYANG SU + * RETURNS + * always 0 + * AUTHOR + * XIANGYANG SU * Thursday, February 3, 2000 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5tget_member_offset_c ( hid_t_f *type_id ,int_f* member_no, size_t_f * offset) +/******/ { int ret_value = -1; size_t c_offset; @@ -1075,20 +1377,29 @@ nh5tget_member_offset_c ( hid_t_f *type_id ,int_f* member_no, size_t_f * offset) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5tget_array_dims_c - * Purpose: Call H5Tget_array_dims2 to get +/****if* H5Tf/h5tget_array_dims_c + * NAME + * h5tget_array_dims_c + * PURPOSE + * Call H5Tget_array_dims2 to get * dimensions of array datatype - * Inputs: type_id - identifier of the array datatype - * Outputs: dims - dimensions(sizes of dimensions) of the array - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * INPUTS + * type_id - identifier of the array datatype + * OUTPUTS + * dims - dimensions(sizes of dimensions) of the array + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Thursday, November 16, 2000 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5tget_array_dims_c ( hid_t_f *type_id , hsize_t_f * dims) +/******/ { hsize_t c_dims[H5S_MAX_RANK]; int rank, i; @@ -1109,20 +1420,29 @@ DONE: return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5tget_array_ndims_c - * Purpose: Call H5Tget_array_ndims to get number +/****if* H5Tf/h5tget_array_ndims_c + * NAME + * h5tget_array_ndims_c + * PURPOSE + * Call H5Tget_array_ndims to get number * of dimensions of array datatype - * Inputs: type_id - identifier of the array datatype - * Outputs: ndims - number of dimensions of the array - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * INPUTS + * type_id - identifier of the array datatype + * OUTPUTS + * ndims - number of dimensions of the array + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Thursday, November 16, 2000 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5tget_array_ndims_c ( hid_t_f *type_id , int_f * ndims) +/******/ { int ret_value = -1; hid_t c_type_id; @@ -1137,20 +1457,29 @@ nh5tget_array_ndims_c ( hid_t_f *type_id , int_f * ndims) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5tget_super_c - * Purpose: Call H5Tget_super to get base datatype from which +/****if* H5Tf/h5tget_super_c + * NAME + * h5tget_super_c + * PURPOSE + * Call H5Tget_super to get base datatype from which * datatype was derived - * Inputs: type_id - identifier of the array datatype - * Outputs: base_type_id - base datatype identifier - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * INPUTS + * type_id - identifier of the array datatype + * OUTPUTS + * base_type_id - base datatype identifier + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Thursday, November 16, 2000 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5tget_super_c ( hid_t_f *type_id , hid_t_f *base_type_id) +/******/ { int ret_value = -1; hid_t c_type_id; @@ -1166,21 +1495,30 @@ nh5tget_super_c ( hid_t_f *type_id , hid_t_f *base_type_id) } -/*---------------------------------------------------------------------------- - * Name: h5tget_member_type_c - * Purpose: Call H5Tget_member_type to get the identifier of a copy of +/****if* H5Tf/h5tget_member_type_c + * NAME + * h5tget_member_type_c + * PURPOSE + * Call H5Tget_member_type to get the identifier of a copy of * the datatype of the field - * Inputs: type_id - identifier of the datatype + * INPUTS + * type_id - identifier of the datatype * field_idx - Field index (0-based) of the field type to retrieve - * Outputs: datatype - identifier of a copy of the datatype of the field - * Returns: 0 on success, -1 on failure - * Programmer: XIANGYANG SU + * OUTPUTS + * datatype - identifier of a copy of the datatype of the field + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * XIANGYANG SU * Thursday, February 3, 2000 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5tget_member_type_c ( hid_t_f *type_id ,int_f* field_idx, hid_t_f * datatype) +/******/ { int ret_value = -1; hid_t c_type_id; @@ -1196,19 +1534,27 @@ nh5tget_member_type_c ( hid_t_f *type_id ,int_f* field_idx, hid_t_f * datatype) } -/*---------------------------------------------------------------------------- - * Name: h5tcreate_c - * Purpose: Call H5Tcreate to create a datatype - * Inputs: cls - class type - * size - size of the class memeber - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal - * Thursday, February 17, 2000 - * Modifications: - *---------------------------------------------------------------------------*/ +/****if* H5Tf/h5tcreate_c + * NAME + * h5tcreate_c + * PURPOSE + * Call H5Tcreate to create a datatype + * INPUTS + * cls - class type + * size - size of the class memeber + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal + * Thursday, February 17, 2000 + * HISTORY + * + * SOURCE +*/ int_f nh5tcreate_c(int_f *cls, size_t_f *size, hid_t_f *type_id) +/******/ { int ret_value = -1; H5T_class_t c_class; @@ -1224,22 +1570,30 @@ nh5tcreate_c(int_f *cls, size_t_f *size, hid_t_f *type_id) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5tinsert_c - * Purpose: Call H5Tinsert to adds another member to the compound datatype - * Inputs: type_id - identifier of the datatype +/****if* H5Tf/h5tinsert_c + * NAME + * h5tinsert_c + * PURPOSE + * Call H5Tinsert to adds another member to the compound datatype + * INPUTS + * type_id - identifier of the datatype * name - Name of the field to insert * namelen - length of the name * offset - Offset in memory structure of the field to insert * field_id - datatype identifier of the new member - * Returns: 0 on success, -1 on failure - * Programmer: XIANGYANG SU + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * XIANGYANG SU * Thursday, February 3, 2000 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5tinsert_c(hid_t_f *type_id, _fcd name, int_f* namelen, size_t_f *offset, hid_t_f * field_id) +/******/ { int ret_value = -1; hid_t c_type_id; @@ -1264,20 +1618,28 @@ nh5tinsert_c(hid_t_f *type_id, _fcd name, int_f* namelen, size_t_f *offset, hid_ } -/*---------------------------------------------------------------------------- - * Name: h5tpack_c - * Purpose: Call H5Tpack tor ecursively remove padding from +/****if* H5Tf/h5tpack_c + * NAME + * h5tpack_c + * PURPOSE + * Call H5Tpack tor ecursively remove padding from * within a compound datatype to make it more efficient * (space-wise) to store that data - * Inputs: type_id - identifier of the datatype - * Returns: 0 on success, -1 on failure - * Programmer: XIANGYANG SU + * INPUTS + * type_id - identifier of the datatype + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * XIANGYANG SU * Thursday, February 3, 2000 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5tpack_c(hid_t_f * type_id) +/******/ { int ret_value = -1; hid_t c_type_id; @@ -1291,20 +1653,28 @@ nh5tpack_c(hid_t_f * type_id) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5tarray_create_c - * Purpose: Call H5Tarray_create2 to create array datatype - * Inputs: base_id - identifier of array base datatype +/****if* H5Tf/h5tarray_create_c + * NAME + * h5tarray_create_c + * PURPOSE + * Call H5Tarray_create2 to create array datatype + * INPUTS + * base_id - identifier of array base datatype * rank - array's rank * dims - Size of new member array * type_id - identifier of the array datatype - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Thursday, November 16, 2000 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5tarray_create_c(hid_t_f * base_id, int_f *rank, hsize_t_f* dims, hid_t_f* type_id) +/******/ { hsize_t c_dims[H5S_MAX_RANK]; hid_t c_type_id; @@ -1329,20 +1699,29 @@ DONE: } -/*---------------------------------------------------------------------------- - * Name: h5tenum_create_c - * Purpose: Call H5Tenum_create to create a new enumeration datatype - * Inputs: parent_id - Datatype identifier for the base datatype - * Outputs: new_type_id - datatype identifier for the new +/****if* H5Tf/h5tenum_create_c + * NAME + * h5tenum_create_c + * PURPOSE + * Call H5Tenum_create to create a new enumeration datatype + * INPUTS + * parent_id - Datatype identifier for the base datatype + * OUTPUTS + * new_type_id - datatype identifier for the new * enumeration datatype - * Returns: 0 on success, -1 on failure - * Programmer: Xiangyang Su + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Xiangyang Su * Tuesday, February 15, 1999 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5tenum_create_c ( hid_t_f *parent_id , hid_t_f *new_type_id) +/******/ { int ret_value = 0; hid_t c_parent_id; @@ -1356,21 +1735,29 @@ nh5tenum_create_c ( hid_t_f *parent_id , hid_t_f *new_type_id) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5tenum_insert_c - * Purpose: Call H5Tenum_insert to insert a new enumeration datatype member. - * Inputs: type_id - identifier of the datatype +/****if* H5Tf/h5tenum_insert_c + * NAME + * h5tenum_insert_c + * PURPOSE + * Call H5Tenum_insert to insert a new enumeration datatype member. + * INPUTS + * type_id - identifier of the datatype * name - Name of the new member * namelen - length of the name * value - value of the new member - * Returns: 0 on success, -1 on failure - * Programmer: XIANGYANG SU + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * XIANGYANG SU * Thursday, February 3, 2000 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5tenum_insert_c(hid_t_f *type_id, _fcd name, int_f* namelen, int_f* value) +/******/ { int ret_value = -1; hid_t c_type_id; @@ -1394,22 +1781,30 @@ nh5tenum_insert_c(hid_t_f *type_id, _fcd name, int_f* namelen, int_f* value) } -/*---------------------------------------------------------------------------- - * Name: h5tenum_nameof_c - * Purpose: Call H5Tenum_nameof to find the symbol name that corresponds to +/****if* H5Tf/h5tenum_nameof_c + * NAME + * h5tenum_nameof_c + * PURPOSE + * Call H5Tenum_nameof to find the symbol name that corresponds to * the specified value of the enumeration datatype type - * Inputs: type_id - identifier of the datatype + * INPUTS + * type_id - identifier of the datatype * namelen - length of the name * value - value of the enumeration datatype * Output: name - Name of the enumeration datatype - * Returns: 0 on success, -1 on failure - * Programmer: XIANGYANG SU + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * XIANGYANG SU * Thursday, February 3, 2000 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5tenum_nameof_c(hid_t_f *type_id, int_f* value, _fcd name, size_t_f* namelen) +/******/ { int ret_value = -1; hid_t c_type_id; @@ -1430,22 +1825,30 @@ nh5tenum_nameof_c(hid_t_f *type_id, int_f* value, _fcd name, size_t_f* namelen) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5tenum_valueof_c - * Purpose: Call H5Tenum_valueof to find the value of that corresponds to +/****if* H5Tf/h5tenum_valueof_c + * NAME + * h5tenum_valueof_c + * PURPOSE + * Call H5Tenum_valueof to find the value of that corresponds to * the specified name of the enumeration datatype type - * Inputs: type_id - identifier of the datatype + * INPUTS + * type_id - identifier of the datatype * name - Name of the enumeration datatype * namelen - length of name * Output: value - value of the enumeration datatype - * Returns: 0 on success, -1 on failure - * Programmer: XIANGYANG SU + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * XIANGYANG SU * Thursday, February 3, 2000 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5tenum_valueof_c(hid_t_f *type_id, _fcd name, int_f* namelen, int_f* value) +/******/ { int ret_value = -1; hid_t c_type_id; @@ -1466,21 +1869,29 @@ nh5tenum_valueof_c(hid_t_f *type_id, _fcd name, int_f* namelen, int_f* value) } -/*---------------------------------------------------------------------------- - * Name: h5tget_member_value_c - * Purpose: Call H5Tget_member_value to get the value of an +/****if* H5Tf/h5tget_member_value_c + * NAME + * h5tget_member_value_c + * PURPOSE + * Call H5Tget_member_value to get the value of an * enumeration datatype member - * Inputs: type_id - identifier of the datatype + * INPUTS + * type_id - identifier of the datatype * member_no - Number of the enumeration datatype member. * Output: value - value of the enumeration datatype - * Returns: 0 on success, -1 on failure - * Programmer: XIANGYANG SU + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * XIANGYANG SU * Thursday, February 3, 2000 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5tget_member_value_c(hid_t_f *type_id, int_f* member_no, int_f* value) +/******/ { int ret_value = -1; hid_t c_type_id; @@ -1498,21 +1909,30 @@ nh5tget_member_value_c(hid_t_f *type_id, int_f* member_no, int_f* value) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5tset_tag_c - * Inputs: type_id - identifier of the dataspace - * Purpose: Call H5Tset_tag to set an opaque datatype tag - * Inputs: type_id - identifier of the dataspace +/****if* H5Tf/h5tset_tag_c + * NAME + * h5tset_tag_c + * INPUTS + * type_id - identifier of the dataspace + * PURPOSE + * Call H5Tset_tag to set an opaque datatype tag + * INPUTS + * type_id - identifier of the dataspace * tag - Unique ASCII string with which the opaque * datatype is to be tagged * namelen - length of tag - * Returns: 0 on success, -1 on failure - * Programmer: XIANGYANG SU + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * XIANGYANG SU * Wednesday, January 26, 2000 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5tset_tag_c(hid_t_f* type_id, _fcd tag, int_f* namelen) +/******/ { int ret_value = -1; hid_t c_type_id; @@ -1532,20 +1952,29 @@ nh5tset_tag_c(hid_t_f* type_id, _fcd tag, int_f* namelen) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5tget_tag_c - * Purpose: Call H5Tset_tag to set an opaque datatype tag - * Inputs: type_id - identifier of the datatype - * Outputs: tag - Unique ASCII string with which the opaque +/****if* H5Tf/h5tget_tag_c + * NAME + * h5tget_tag_c + * PURPOSE + * Call H5Tset_tag to set an opaque datatype tag + * INPUTS + * type_id - identifier of the datatype + * OUTPUTS + * tag - Unique ASCII string with which the opaque * datatype is to be tagged - * taglen - length of tag - * Returns: 0 on success, -1 on failure - * Programmer: XIANGYANG SU - * Wednesday, January 26, 2000 - * Modifications: - *---------------------------------------------------------------------------*/ + * taglen - length of tag + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * XIANGYANG SU + * Wednesday, January 26, 2000 + * HISTORY + * + * SOURCE +*/ int_f -nh5tget_tag_c(hid_t_f* type_id, _fcd tag, int_f* taglen) +nh5tget_tag_c(hid_t_f* type_id, _fcd tag, size_t_f* tag_size, int_f* taglen) +/******/ { int ret_value = -1; hid_t c_type_id; @@ -1555,24 +1984,33 @@ nh5tget_tag_c(hid_t_f* type_id, _fcd tag, int_f* taglen) c_tag = H5Tget_tag(c_type_id); if (c_tag == NULL ) return ret_value; - HD5packFstring(c_tag, _fcdtocp(tag), strlen(c_tag)); + HD5packFstring(c_tag, _fcdtocp(tag), (size_t)*tag_size); *taglen = (int_f)HDstrlen(c_tag); HDfree(c_tag); ret_value = 0; return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5tvlen_create_c - * Purpose: Call H5Tvlen_create to create VL dtatype - * Inputs: type_id - identifier of the base datatype - * Outputs: vltype_id - identifier of the VL datatype - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal +/****if* H5Tf/h5tvlen_create_c + * NAME + * h5tvlen_create_c + * PURPOSE + * Call H5Tvlen_create to create VL dtatype + * INPUTS + * type_id - identifier of the base datatype + * OUTPUTS + * vltype_id - identifier of the VL datatype + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Wednesday, October 23, 2002 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5tvlen_create_c(hid_t_f* type_id, hid_t_f *vltype_id) +/******/ { int ret_value = -1; hid_t c_type_id; @@ -1585,21 +2023,30 @@ nh5tvlen_create_c(hid_t_f* type_id, hid_t_f *vltype_id) ret_value = 0; return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5tis_variable_str_c - * Purpose: Call H5Tis_variable_str to detrmine if the datatype +/****if* H5Tf/h5tis_variable_str_c + * NAME + * h5tis_variable_str_c + * PURPOSE + * Call H5Tis_variable_str to detrmine if the datatype * is a variable string. - * Inputs: type_id - identifier of the dataspace - * Outputs: flag - 0 if not VL str, 1 if is not + * INPUTS + * type_id - identifier of the dataspace + * OUTPUTS + * flag - 0 if not VL str, 1 if is not * and negative on failure. - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Wednesday, March 12 , 2003 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5tis_variable_str_c ( hid_t_f *type_id , int_f *flag ) +/******/ { int ret_value = 0; hid_t c_type_id; @@ -1611,22 +2058,31 @@ nh5tis_variable_str_c ( hid_t_f *type_id , int_f *flag ) if ( status < 0 ) ret_value = -1; return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5tget_member_class_c - * Purpose: Call H5Tget_member_class to detrmine ithe class of the compound +/****if* H5Tf/h5tget_member_class_c + * NAME + * h5tget_member_class_c + * PURPOSE + * Call H5Tget_member_class to detrmine ithe class of the compound * datatype member - * Inputs: type_id - identifier of the dataspace + * INPUTS + * type_id - identifier of the dataspace * member_no - member's index - * Outputs: cls - member's class - * and negative on failure. - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal - * Wednesday, April 6, 2005 - * Modifications: - *---------------------------------------------------------------------------*/ + * OUTPUTS + * class - member's class + * and negative on failure. + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal + * Wednesday, April 6, 2005 + * HISTORY + * + * SOURCE +*/ int_f nh5tget_member_class_c ( hid_t_f *type_id , int_f *member_no, int_f *cls ) +/******/ { int ret_value = 0; hid_t c_type_id; @@ -1642,21 +2098,29 @@ nh5tget_member_class_c ( hid_t_f *type_id , int_f *member_no, int_f *cls ) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5tcommit_anon_c - * Purpose: Call H5Tcommit_anon - * Inputs: loc_id - file or group identifier +/****if* H5Tf/h5tcommit_anon_c + * NAME + * h5tcommit_anon_c + * PURPOSE + * Call H5Tcommit_anon + * INPUTS + * loc_id - file or group identifier * dtype_id - dataset identifier * tcpl_id - Datatype creation property list * tapl_id - Datatype access property list - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld - * February 25, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld + * February 25, 2008 + * HISTORY + * + * SOURCE +*/ int_f nh5tcommit_anon_c(hid_t_f *loc_id, hid_t_f *dtype_id, hid_t_f *tcpl_id, hid_t_f *tapl_id) +/******/ { int ret_value = -1; @@ -1670,19 +2134,26 @@ nh5tcommit_anon_c(hid_t_f *loc_id, hid_t_f *dtype_id, return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5tcommitted_c - * Purpose: Call H5Tcommitted +/****if* H5Tf/h5tcommitted_c + * NAME + * h5tcommitted_c + * PURPOSE + * Call H5Tcommitted * dtype_id - dataset identifier - * Returns: a positive value, for TRUE, if the datatype has been committed, + * RETURNS + * a positive value, for TRUE, if the datatype has been committed, * or 0 (zero), for FALSE, if the datatype has not been committed. * Otherwise returns a negative value. - * Programmer: M.S. Breitenfeld - * February 25, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ + * AUTHOR + * M. Scot Breitenfeld + * February 25, 2008 + * HISTORY + * + * SOURCE +*/ int_f nh5tcommitted_c(hid_t_f *dtype_id) +/******/ { int_f ret_value; @@ -1694,22 +2165,31 @@ nh5tcommitted_c(hid_t_f *dtype_id) } -/*---------------------------------------------------------------------------- - * Name: h5tdecode_c - * Purpose: Call H5Tdecode - * Inputs: +/****if* H5Tf/h5tdecode_c + * NAME + * h5tdecode_c + * PURPOSE + * Call H5Tdecode + * INPUTS + * * buf - Buffer for the data space object to be decoded. - * Outputs: + * OUTPUTS + * * obj_id - Object_id (non-negative) * - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld - * April 9, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld + * April 9, 2008 + * HISTORY + * + * SOURCE +*/ int_f nh5tdecode_c ( _fcd buf, hid_t_f *obj_id ) +/******/ { int ret_value = -1; unsigned char *c_buf = NULL; /* Buffer to hold C string */ @@ -1731,21 +2211,29 @@ nh5tdecode_c ( _fcd buf, hid_t_f *obj_id ) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5tencode_c - * Purpose: Call H5Tencode - * Inputs: +/****if* H5Tf/h5tencode_c + * NAME + * h5tencode_c + * PURPOSE + * Call H5Tencode + * INPUTS + * * obj_id - Identifier of the object to be encoded. * buf - Buffer for the object to be encoded into. * nalloc - The size of the allocated buffer. - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld - * April 9, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld + * April 9, 2008 + * HISTORY + * + * SOURCE +*/ int_f nh5tencode_c (_fcd buf, hid_t_f *obj_id, size_t_f *nalloc ) +/******/ { int ret_value = -1; unsigned char *c_buf = NULL; /* Buffer to hold C string */ @@ -1793,19 +2281,28 @@ nh5tencode_c (_fcd buf, hid_t_f *obj_id, size_t_f *nalloc ) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5tget_create_plist_c - * Purpose: Call H5Tget_create_plist - * Inputs: dtype_id - Datatype identifier - * Outputs: dtpl_id - Datatype property list identifier - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld - * April 9, 2008 - * Modifications: N/A - *---------------------------------------------------------------------------*/ +/****if* H5Tf/h5tget_create_plist_c + * NAME + * h5tget_create_plist_c + * PURPOSE + * Call H5Tget_create_plist + * INPUTS + * dtype_id - Datatype identifier + * OUTPUTS + * dtpl_id - Datatype property list identifier + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld + * April 9, 2008 + * HISTORY + * N/A + * SOURCE +*/ int_f nh5tget_create_plist_c ( hid_t_f *dtype_id, hid_t_f *dtpl_id) +/******/ { int_f ret_value=-1; /* Return value */ @@ -1816,21 +2313,30 @@ nh5tget_create_plist_c ( hid_t_f *dtype_id, hid_t_f *dtpl_id) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5tcompiler_conv_c - * Purpose: Call H5Tcompiler_conv - * Inputs: +/****if* H5Tf/h5tcompiler_conv_c + * NAME + * h5tcompiler_conv_c + * PURPOSE + * Call H5Tcompiler_conv + * INPUTS + * * src_id - Identifier for the source datatype. * dst_id - Identifier for the destination datatype. - * Outputs: c_flag - flag; TRUE for compiler conversion, FALSE for library conversion - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld - * April 9, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ + * OUTPUTS + * c_flag - flag; TRUE for compiler conversion, FALSE for library conversion + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M.Scot Breitenfeld + * April 9, 2008 + * HISTORY + * + * SOURCE +*/ int_f nh5tcompiler_conv_c ( hid_t_f *src_id, hid_t_f *dst_id, int_f *c_flag) +/******/ { int ret_value = -1; htri_t status; @@ -1841,21 +2347,30 @@ nh5tcompiler_conv_c ( hid_t_f *src_id, hid_t_f *dst_id, int_f *c_flag) ret_value = 0; return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5tget_native_type_c - * Purpose: Call H5Tget_native_type - * Inputs: +/****if* H5Tf/h5tget_native_type_c + * NAME + * h5tget_native_type_c + * PURPOSE + * Call H5Tget_native_type + * INPUTS + * * dtype_id - Datatype identifier for the dataset datatype. * direction - Direction of search. - * Outputs: native_dtype_id - The native datatype identifier for the specified dataset datatype - * Returns: 0 on success, -1 on failure - * Programmer: M.S. Breitenfeld - * June 18, 2008 - * Modifications: - *---------------------------------------------------------------------------*/ + * OUTPUTS + * native_dtype_id - The native datatype identifier for the specified dataset datatype + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld + * June 18, 2008 + * HISTORY + * + * SOURCE +*/ int_f nh5tget_native_type_c(hid_t_f *dtype_id, int_f *direction, hid_t_f *native_dtype_id) +/******/ { int ret_value = -1; hid_t status; @@ -1867,3 +2382,41 @@ nh5tget_native_type_c(hid_t_f *dtype_id, int_f *direction, hid_t_f *native_dtype return ret_value; } +/****if* H5Tf/h5tconvert_c + * NAME + * h5tconvert_c + * PURPOSE + * Call H5Tconvert + * INPUTS + * + * src_id - Identifier for the source datatype. + * dst_id - Identifier for the destination datatype. + * nelmts - Size of array buf. + * buf - Array containing pre-conversion values. + * background - Optional background buffer. + * plist_id - Dataset transfer property list identifier. + * + * OUTPUTS + * buf - Array containing post-conversion values. + * + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld + * December 8, 2008 + * + * SOURCE +*/ +int_f +nh5tconvert_c(hid_t_f *src_id, hid_t_f *dst_id, size_t_f *nelmts, void *buf, void *background, hid_t_f *plist_id) +/******/ +{ + int ret_value = -1; + hid_t status; + + status = H5Tconvert( (hid_t)*src_id, (hid_t)*dst_id, (size_t)*nelmts, buf, background, (hid_t)*plist_id ); + if ( status < 0 ) return ret_value; + ret_value = 0; + return ret_value; +} + diff --git a/fortran/src/H5Tff.f90 b/fortran/src/H5Tff.f90 index c6c96d0..f5369d0 100644 --- a/fortran/src/H5Tff.f90 +++ b/fortran/src/H5Tff.f90 @@ -1,3 +1,15 @@ +!****h* ROBODoc/H5T +! +! NAME +! MODULE H5T +! +! PURPOSE +! This file contains Fortran interfaces for H5T functions. It includes +! all the functions that are independent on whether the Fortran 2003 functions +! are enabled or disabled. +! +! +! COPYRIGHT ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! Copyright by The HDF Group. * ! Copyright by the Board of Trustees of the University of Illinois. * @@ -13,44 +25,51 @@ ! access to either file, you may request a copy from help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! +! NOTES +! *** IMPORTANT *** +! If you add a new H5T function you must add the function name to the +! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! This is needed for Windows based operating systems. ! -! This file contains FORTRAN90 interfaces for H5T functions -! +!***** + MODULE H5T USE H5GLOBAL CONTAINS -!---------------------------------------------------------------------- -! Name: h5topen_f ! -! Purpose: Opens named datatype. +!****s* H5T/h5topen_f ! -! Inputs: -! loc_id - location identifier -! name - a datatype name -! Outputs: -! type_id - datatype identifier -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! tapl_id - datatype access property list identifier. +! NAME +! h5topen_f ! -! Programmer: Elena Pourmal -! August 12, 1999 +! PURPOSE +! Opens named datatype. ! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 +! INPUTS +! loc_id - location identifier +! name - a datatype name +! OUTPUTS +! type_id - datatype identifier +! hdferr - Returns 0 if successful and -1 if fails +! OPTIONAL PARAMETERS +! tapl_id - datatype access property list identifier. ! -! Added optional parameter 'tapl_id' for compatability -! with H5Topen2. April 9, 2009. +! AUTHOR +! Elena Pourmal +! August 12, 1999 ! -! Comment: -!---------------------------------------------------------------------- - +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! +! Added optional parameter 'tapl_id' for compatability +! with H5Topen2. April 9, 2009. +! +! SOURCE SUBROUTINE h5topen_f(loc_id, name, type_id, hdferr, tapl_id) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier @@ -58,12 +77,10 @@ CONTAINS INTEGER(HID_T), INTENT(OUT) :: type_id ! Datatype identifier INTEGER, INTENT(OUT) :: hdferr ! Error code INTEGER(HID_T), OPTIONAL, INTENT(IN) :: tapl_id ! datatype access property list identifier - +!***** INTEGER :: namelen ! Name length INTEGER(HID_T) :: tapl_id_default -! -! MS FORTRAN needs explicit interface for C functions called here. -! + INTERFACE INTEGER FUNCTION h5topen_c(loc_id, name, namelen, type_id, tapl_id_default) USE H5GLOBAL @@ -86,42 +103,41 @@ CONTAINS hdferr = h5topen_c(loc_id, name, namelen, type_id, tapl_id_default) END SUBROUTINE h5topen_f - -!---------------------------------------------------------------------- -! Name: h5tcommit_f ! -! Purpose: Commits a transient datatype to a file, creating a -! new named datatype. +!****s* H5T/h5tcommit_f ! -! Inputs: -! loc_id - location identifier -! name - name of the datatype to be stored -! at the specified location -! type_id - identifier of a datatype to be stored -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! lcpl_id - Link creation property list -! tcpl_id - Datatype creation property list -! tapl_id - Datatype access property list +! NAME +! h5tcommit_f ! -! Programmer: Elena Pourmal -! August 12, 1999 +! PURPOSE +! Commits a transient datatype to a file, creating a +! new named datatype. ! -! Modifications: - Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 +! INPUTS +! loc_id - location identifier +! name - name of the datatype to be stored +! at the specified location +! type_id - identifier of a datatype to be stored +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! OPTIONAL PARAMETERS +! lcpl_id - Link creation property list +! tcpl_id - Datatype creation property list +! tapl_id - Datatype access property list ! -! - Added optional parameters introduced in version 1.8 -! M.S. Breitenfeld +! AUTHOR +! Elena Pourmal +! August 12, 1999 ! +! HISTORY +! - Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 ! +! - Added optional parameters introduced in version 1.8 +! M. Scot Breitenfeld ! -! Comment: -!---------------------------------------------------------------------- - +! SOURCE SUBROUTINE h5tcommit_f(loc_id, name, type_id, hdferr, & lcpl_id, tcpl_id, tapl_id ) IMPLICIT NONE @@ -133,7 +149,7 @@ CONTAINS INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lcpl_id ! Link creation property list INTEGER(HID_T), OPTIONAL, INTENT(IN) :: tcpl_id ! Datatype creation property list INTEGER(HID_T), OPTIONAL, INTENT(IN) :: tapl_id ! Datatype access property list - +!***** INTEGER :: namelen ! Name length @@ -141,8 +157,6 @@ CONTAINS INTEGER(HID_T) :: tcpl_id_default INTEGER(HID_T) :: tapl_id_default -! MS FORTRAN needs explicit interface for C functions called here. -! INTERFACE INTEGER FUNCTION h5tcommit_c(loc_id, name, namelen, type_id, & lcpl_id_default, tcpl_id_default, tapl_id_default ) @@ -175,43 +189,37 @@ CONTAINS lcpl_id_default, tcpl_id_default, tapl_id_default ) END SUBROUTINE h5tcommit_f - -!---------------------------------------------------------------------- -! Name: h5tcopy_f ! -! Purpose: iCreates a copy of exisiting datatype. +!****s* H5T/h5tcopy_f ! -! Inputs: -! type_id - datatype identifier -! Outputs: -! new_type_id - identifier of datatype's copy -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! NAME +! h5tcopy_f ! -! Programmer: Elena Pourmal -! August 12, 1999 +! PURPOSE +! Creates a copy of exisiting datatype. ! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 +! INPUTS +! type_id - datatype identifier +! OUTPUTS +! new_type_id - identifier of datatype's copy +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! Elena Pourmal +! August 12, 1999 ! -! Comment: -!---------------------------------------------------------------------- - - - SUBROUTINE h5tcopy_f(type_id, new_type_id, hdferr) +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! +! SOURCE + SUBROUTINE h5tcopy_f(type_id, new_type_id, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier INTEGER(HID_T), INTENT(OUT) :: new_type_id ! Identifier of datatype's copy INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5tcopy_c -! MS FORTRAN needs explicit interface for C functions called here. -! +!***** INTERFACE INTEGER FUNCTION h5tcopy_c(type_id, new_type_id) USE H5GLOBAL @@ -225,46 +233,41 @@ CONTAINS hdferr = h5tcopy_c(type_id, new_type_id) END SUBROUTINE h5tcopy_f - -!---------------------------------------------------------------------- -! Name: h5tequal_f -! -! Purpose: Determines whether two datatype identifiers refer -! to the same datatype. ! -! Inputs: -! type1_id - datatype identifier -! type2_id - datatype identifier -! Outputs: -! flag - TRUE/FALSE flag to indicate -! if two datatypes are equal -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5tequal_f(type1_id, type2_id, flag, hdferr) +!****s* H5T/h5tequal_f +! +! NAME +! h5tequal_f +! +! PURPOSE +! Determines whether two datatype identifiers refer +! to the same datatype. +! +! INPUTS +! type1_id - datatype identifier +! type2_id - datatype identifier +! OUTPUTS +! flag - TRUE/FALSE flag to indicate +! if two datatypes are equal +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! SOURCE + SUBROUTINE h5tequal_f(type1_id, type2_id, flag, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: type1_id ! Datatype identifier INTEGER(HID_T), INTENT(IN) :: type2_id ! Datatype identifier LOGICAL, INTENT(OUT) :: flag ! TRUE/FALSE flag to indicate if two ! datatypes are equal INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** INTEGER :: c_flag - -! INTEGER, EXTERNAL :: h5tequal_c -! MS FORTRAN needs explicit interface for C functions called here INTERFACE INTEGER FUNCTION h5tequal_c(type1_id, type2_id, c_flag) USE H5GLOBAL @@ -281,40 +284,35 @@ CONTAINS hdferr = h5tequal_c(type1_id, type2_id, c_flag) if(c_flag .gt. 0) flag = .TRUE. END SUBROUTINE h5tequal_f - -!---------------------------------------------------------------------- -! Name: h5tclose_f ! -! Purpose: Releases a datatype. +!****s* H5T/h5tclose_f ! -! Inputs: -! type_id - datatype identifier -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! NAME +! h5tclose_f ! -! Programmer: Elena Pourmal -! August 12, 1999 +! PURPOSE +! Releases a datatype. ! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 +! INPUTS +! type_id - datatype identifier +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails ! -! Comment: -!---------------------------------------------------------------------- - - - SUBROUTINE h5tclose_f(type_id, hdferr) +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! +! SOURCE + SUBROUTINE h5tclose_f(type_id, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5tclose_c -! MS FORTRAN needs explicit interface for C functions called here. -! +!***** INTERFACE INTEGER FUNCTION h5tclose_c(type_id) USE H5GLOBAL @@ -327,44 +325,42 @@ CONTAINS hdferr = h5tclose_c(type_id) END SUBROUTINE h5tclose_f - -!---------------------------------------------------------------------- -! Name: h5tget_class_f -! -! Purpose: Returns the datatype class identifier. -! -! Inputs: -! type_id - datatype identifier -! Outputs: -! class - class, possible values are: -! H5T_NO_CLASS_F (-1) -! H5T_INTEGER_F (0) -! H5T_FLOAT_F (1) -! H5T_TIME_F (2) -! H5T_STRING_F (3) -! H5T_BITFIELD_F (4) -! H5T_OPAQUE_F (5) -! H5T_COMPOUND_F (6) -! H5T_REFERENCE_F (7) -! H5T_ENUM_F (8) -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 -! -! Comment: -!---------------------------------------------------------------------- - - - SUBROUTINE h5tget_class_f(type_id, class, hdferr) +! +!****s* H5T/h5tget_class_f +! +! NAME +! h5tget_class_f +! +! PURPOSE +! Returns the datatype class identifier. +! +! INPUTS +! type_id - datatype identifier +! OUTPUTS +! class - class, possible values are: +! H5T_NO_CLASS_F (-1) +! H5T_INTEGER_F (0) +! H5T_FLOAT_F (1) +! H5T_TIME_F (2) +! H5T_STRING_F (3) +! H5T_BITFIELD_F (4) +! H5T_OPAQUE_F (5) +! H5T_COMPOUND_F (6) +! H5T_REFERENCE_F (7) +! H5T_ENUM_F (8) +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! +! SOURCE + SUBROUTINE h5tget_class_f(type_id, class, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier INTEGER, INTENT(OUT) :: class @@ -380,10 +376,7 @@ CONTAINS ! H5T_REFERENCE_F (7) ! H5T_ENUM_F (8) INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5tget_class_c -! MS FORTRAN needs explicit interface for C functions called here. -! +!***** INTERFACE INTEGER FUNCTION h5tget_class_c(type_id, class) USE H5GLOBAL @@ -397,42 +390,37 @@ CONTAINS hdferr = h5tget_class_c(type_id, class) END SUBROUTINE h5tget_class_f - -!---------------------------------------------------------------------- -! Name: h5tget_size_f ! -! Purpose: Returns the size of a datatype. +!****s* H5T/h5tget_size_f ! -! Inputs: -! type_id - datatype identifier -! Outputs: -! size - datatype size -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! NAME +! h5tget_size_f ! -! Programmer: Elena Pourmal -! August 12, 1999 +! PURPOSE +! Returns the size of a datatype. ! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 +! INPUTS +! type_id - datatype identifier +! OUTPUTS +! size - datatype size +! hdferr - Returns 0 if successful and -1 if fails ! -! Comment: -!---------------------------------------------------------------------- - - - SUBROUTINE h5tget_size_f(type_id, size, hdferr) +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! +! SOURCE + SUBROUTINE h5tget_size_f(type_id, size, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier INTEGER(SIZE_T), INTENT(OUT) :: size ! Datatype size INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5tget_size_c -! MS FORTRAN needs explicit interface for C functions called here. -! +!***** INTERFACE INTEGER FUNCTION h5tget_size_c(type_id, size) USE H5GLOBAL @@ -447,41 +435,38 @@ CONTAINS hdferr = h5tget_size_c(type_id, size) END SUBROUTINE h5tget_size_f -!---------------------------------------------------------------------- -! Name: h5tset_size_f ! -! Purpose: Sets the total size for an atomic datatype. +!****s* H5T/h5tset_size_f ! -! Inputs: -! type_id - datatype identifier -! size - size of the datatype -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! NAME +! h5tset_size_f ! -! Programmer: Elena Pourmal -! August 12, 1999 +! PURPOSE +! Sets the total size for an atomic datatype. ! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 +! INPUTS +! type_id - datatype identifier +! size - size of the datatype +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails ! -! Comment: -!---------------------------------------------------------------------- - - - SUBROUTINE h5tset_size_f(type_id, size, hdferr) +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! +! +! SOURCE + SUBROUTINE h5tset_size_f(type_id, size, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier INTEGER(SIZE_T), INTENT(IN) :: size ! Datatype size INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5tset_size_c -! MS FORTRAN needs explicit interface for C functions called here. -! +!***** INTERFACE INTEGER FUNCTION h5tset_size_c(type_id, size) USE H5GLOBAL @@ -496,155 +481,139 @@ CONTAINS hdferr = h5tset_size_c(type_id, size) END SUBROUTINE h5tset_size_f -!---------------------------------------------------------------------- -! Name: h5tget_order_f ! -! Purpose: Returns the byte order of an atomic datatype. +!****s* H5T/h5tget_order_f ! -! Inputs: -! type_id - datatype identifier -! Outputs: -! order - byte order for the datatype, possible -! values are: -! H5T_ORDER_LE_F -! H5T_ORDER_BE_F -! H5T_ORDER_VAX_F (not implemented yet) -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! NAME +! h5tget_order_f ! -! Programmer: Elena Pourmal -! August 12, 1999 +! PURPOSE +! Returns the byte order of an atomic datatype. ! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 +! INPUTS +! type_id - datatype identifier +! OUTPUTS +! order - byte order for the datatype, possible +! values are: +! H5T_ORDER_LE_F +! H5T_ORDER_BE_F +! H5T_ORDER_VAX_F (not implemented yet) +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! Elena Pourmal +! August 12, 1999 ! -! Comment: -!---------------------------------------------------------------------- - - - SUBROUTINE h5tget_order_f(type_id, order, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier - INTEGER, INTENT(OUT) :: order - ! Datatype byte order, bossible values are: - ! H5T_ORDER_LE_F - ! H5T_ORDER_BE_F - ! H5T_ORDER_VAX_F - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5tget_order_c -! MS FORTRAN needs explicit interface for C functions called here. +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 ! - 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 - INTEGER(HID_T), INTENT(IN) :: type_id - INTEGER, INTENT(OUT) :: order - END FUNCTION h5tget_order_c - END INTERFACE - - hdferr = h5tget_order_c(type_id, order) - END SUBROUTINE h5tget_order_f +! SOURCE + SUBROUTINE h5tget_order_f(type_id, order, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier + INTEGER, INTENT(OUT) :: order + ! Datatype byte order, possible values are: + ! H5T_ORDER_LE_F + ! H5T_ORDER_BE_F + ! H5T_ORDER_VAX_F + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + 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 + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER, INTENT(OUT) :: order + END FUNCTION h5tget_order_c + END INTERFACE + + hdferr = h5tget_order_c(type_id, order) + END SUBROUTINE h5tget_order_f +! +!****s* H5T/h5tset_order_f +! +! NAME +! h5tset_order_f +! +! PURPOSE +! Sets the byte ordering of an atomic datatype. +! +! INPUTS +! type_id - datatype identifier +! order - datatype byte order Possible values are: +! H5T_ORDER_LE_F +! H5T_ORDER_BE_F +! H5T_ORDER_VAX_F (not implemented yet) +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! +! SOURCE + SUBROUTINE h5tset_order_f(type_id, order, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier + INTEGER, INTENT(IN) :: order ! Datatype byte order, possible values + ! are: + ! H5T_ORDER_LE_F + ! H5T_ORDER_BE_F + ! H5T_ORDER_VAX_F + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + 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 + INTEGER(HID_T), INTENT(IN) :: type_id + INTEGER, INTENT(IN) :: order + END FUNCTION h5tset_order_c + END INTERFACE + + hdferr = h5tset_order_c(type_id, order) + END SUBROUTINE h5tset_order_f -!---------------------------------------------------------------------- -! Name: h5tset_order_f ! -! Purpose: Sets the byte ordering of an atomic datatype. +!****s* H5T/h5tget_precision_f ! -! Inputs: -! type_id - datatype identifier -! order - datatype byte order -! Possible values are: -! H5T_ORDER_LE_F -! H5T_ORDER_BE_F -! H5T_ORDER_VAX_F (not implemented yet) -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! NAME +! h5tget_precision_f ! -! Programmer: Elena Pourmal -! August 12, 1999 +! PURPOSE +! Returns the precision of an atomic datatype. ! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 -! -! Comment: -!---------------------------------------------------------------------- - - - SUBROUTINE h5tset_order_f(type_id, order, hdferr) - IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier - INTEGER, INTENT(IN) :: order ! Datatype byte order, bossible values - ! are: - ! H5T_ORDER_LE_F - ! H5T_ORDER_BE_F - ! H5T_ORDER_VAX_F - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5tset_order_c -! MS FORTRAN needs explicit interface for C functions called here. +! INPUTS +! type_id - datatype identifier +! OUTPUTS +! precision - precision of the datatype +! hdferr - Returns 0 if successful and -1 if fails ! - 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 - INTEGER(HID_T), INTENT(IN) :: type_id - INTEGER, INTENT(IN) :: order - END FUNCTION h5tset_order_c - END INTERFACE - - hdferr = h5tset_order_c(type_id, order) - END SUBROUTINE h5tset_order_f - -!---------------------------------------------------------------------- -! Name: h5tget_precision_f +! AUTHOR +! Elena Pourmal +! August 12, 1999 ! -! Purpose: Returns the precision of an atomic datatype. +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 ! -! Inputs: -! type_id - datatype identifier -! Outputs: -! precision - precision of the datatype -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 -! -! Comment: -!---------------------------------------------------------------------- - - - SUBROUTINE h5tget_precision_f(type_id, precision, hdferr) +! SOURCE + SUBROUTINE h5tget_precision_f(type_id, precision, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier INTEGER(SIZE_T), INTENT(OUT) :: precision ! Datatype precision INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5tget_precision_c -! MS FORTRAN needs explicit interface for C functions called here. -! +!***** INTERFACE INTEGER FUNCTION h5tget_precision_c (type_id, precision) USE H5GLOBAL @@ -659,40 +628,37 @@ CONTAINS hdferr = h5tget_precision_c(type_id, precision) END SUBROUTINE h5tget_precision_f -!---------------------------------------------------------------------- -! Name: h5tset_precision_f ! -! Purpose: Sets the precision of an atomic datatype. +!****s* H5T/h5tset_precision_f ! -! Inputs: -! type_id - datatype identifier -! precision - datatype precision -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! NAME +! h5tset_precision_f ! -! Programmer: Elena Pourmal -! August 12, 1999 +! PURPOSE +! Sets the precision of an atomic datatype. ! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 +! INPUTS +! type_id - datatype identifier +! precision - datatype precision +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails ! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5tset_precision_f(type_id, precision, hdferr) +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! +! SOURCE + SUBROUTINE h5tset_precision_f(type_id, precision, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier INTEGER(SIZE_T), INTENT(IN) :: precision ! Datatype precision INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5tset_precision_c -! MS FORTRAN needs explicit interface for C functions called here. -! +!***** INTERFACE INTEGER FUNCTION h5tset_precision_c (type_id, precision) USE H5GLOBAL @@ -707,41 +673,37 @@ CONTAINS hdferr = h5tset_precision_c(type_id, precision) END SUBROUTINE h5tset_precision_f -!---------------------------------------------------------------------- -! Name: h5tget_offset_f ! -! Purpose: Retrieves the bit offset of the first significant bit. +!****s* H5T/h5tget_offset_f ! -! Inputs: -! type_id - datatype identifier -! Outputs: -! offset - offset value -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! NAME +! h5tget_offset_f ! -! Programmer: Elena Pourmal -! August 12, 1999 +! PURPOSE +! Retrieves the bit offset of the first significant bit. ! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 +! INPUTS +! type_id - datatype identifier +! OUTPUTS +! offset - offset value +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! Elena Pourmal +! August 12, 1999 ! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5tget_offset_f(type_id, offset, hdferr) +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! +! SOURCE + SUBROUTINE h5tget_offset_f(type_id, offset, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier INTEGER(SIZE_T), INTENT(OUT) :: offset ! Datatype bit offset of the ! first significant bit INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5tget_offset_c -! MS FORTRAN needs explicit interface for C functions called here. -! +!***** INTERFACE INTEGER FUNCTION h5tget_offset_c(type_id, offset) USE H5GLOBAL @@ -756,41 +718,37 @@ CONTAINS hdferr = h5tget_offset_c(type_id, offset) END SUBROUTINE h5tget_offset_f -!---------------------------------------------------------------------- -! Name: h5tset_offset_f ! -! Purpose: Sets the bit offset of the first significant bit. +!****s* H5T/h5tset_offset_f ! -! Inputs: -! type_id - datatype identifier -! offset - offset value -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! NAME +! h5tset_offset_f ! -! Programmer: Elena Pourmal -! August 12, 1999 +! PURPOSE +! Sets the bit offset of the first significant bit. ! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 +! INPUTS +! type_id - datatype identifier +! offset - offset value +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! Elena Pourmal +! August 12, 1999 ! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5tset_offset_f(type_id, offset, hdferr) +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! +! SOURCE + SUBROUTINE h5tset_offset_f(type_id, offset, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier INTEGER(SIZE_T), INTENT(IN) :: offset ! Datatype bit offset of the ! first significant bit INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5tset_offset_c -! MS FORTRAN needs explicit interface for C functions called here. -! +!***** INTERFACE INTEGER FUNCTION h5tset_offset_c(type_id, offset) USE H5GLOBAL @@ -805,40 +763,40 @@ CONTAINS hdferr = h5tset_offset_c(type_id, offset) END SUBROUTINE h5tset_offset_f -!---------------------------------------------------------------------- -! Name: h5tget_pad_f -! -! Purpose: Retrieves the padding type of the least and -! most-significant bit padding. -! -! Inputs: -! type_id - datatype identifier -! Outputs: -! lsbpad - least-significant bit padding type -! msbpad - most-significant bit padding type -! Possible values of padding type are: -! H5T_PAD_ERROR_F = -1 -! H5T_PAD_ZERO_F = 0 -! H5T_PAD_ONE_F = 1 -! H5T_PAD_BACKGROUND_F = 2 -! H5T_PAD_NPAD_F = 3 -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5tget_pad_f(type_id, lsbpad, msbpad, hdferr) +! +!****s* H5T/h5tget_pad_f +! +! NAME +! h5tget_pad_f +! +! PURPOSE +! Retrieves the padding type of the least and +! most -significant bit padding. +! +! INPUTS +! type_id - datatype identifier +! OUTPUTS +! lsbpad - least-significant bit padding type +! msbpad - most-significant bit padding type +! Possible values of padding type are: +! H5T_PAD_ERROR_F = -1 +! H5T_PAD_ZERO_F = 0 +! H5T_PAD_ONE_F = 1 +! H5T_PAD_BACKGROUND_F = 2 +! H5T_PAD_NPAD_F = 3 +! hdferr - Returns 0 if successful and -1 if fails + +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! SOURCE + SUBROUTINE h5tget_pad_f(type_id, lsbpad, msbpad, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier INTEGER, INTENT(OUT) :: lsbpad ! padding type of the @@ -853,10 +811,7 @@ CONTAINS ! H5T_PAD_NPAD_F = 3 INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5tget_pad_c -! MS FORTRAN needs explicit interface for C functions called here. -! +!***** INTERFACE INTEGER FUNCTION h5tget_pad_c(type_id, lsbpad, msbpad) USE H5GLOBAL @@ -872,39 +827,38 @@ CONTAINS hdferr = h5tget_pad_c(type_id, lsbpad, msbpad) END SUBROUTINE h5tget_pad_f -!---------------------------------------------------------------------- -! Name: h5tset_pad_f -! -! Purpose: Sets the least and most-significant bits padding types. -! -! Inputs: -! type_id - datatype identifier -! lsbpad - least-significant bit padding type -! msbpad - most-significant bit padding type -! Possible values of padding type are: -! H5T_PAD_ERROR_F = -1 -! H5T_PAD_ZERO_F = 0 -! H5T_PAD_ONE_F = 1 -! H5T_PAD_BACKGROUND_F = 2 -! H5T_PAD_NPAD_F = 3 -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5tset_pad_f(type_id, lsbpad, msbpad, hdferr) +! +!****s* H5T/h5tset_pad_f +! +! NAME +! h5tset_pad_f +! +! PURPOSE +! Sets the least and most-significant bits padding types. +! +! INPUTS +! type_id - datatype identifier +! lsbpad - least-significant bit padding type +! msbpad - most-significant bit padding type +! Possible values of padding type are: +! H5T_PAD_ERROR_F = -1 +! H5T_PAD_ZERO_F = 0 +! H5T_PAD_ONE_F = 1 +! H5T_PAD_BACKGROUND_F = 2 +! H5T_PAD_NPAD_F = 3 +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! SOURCE + SUBROUTINE h5tset_pad_f(type_id, lsbpad, msbpad, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier INTEGER, INTENT(IN) :: lsbpad ! padding type of the @@ -918,10 +872,7 @@ CONTAINS ! H5T_PAD_ERROR_F = -1 ! H5T_PAD_NPAD_F = 3 INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5sget_pad_c -! MS FORTRAN needs explicit interface for C functions called here. -! +!***** INTERFACE INTEGER FUNCTION h5tset_pad_c(type_id, lsbpad, msbpad) USE H5GLOBAL @@ -937,37 +888,37 @@ CONTAINS hdferr = h5tset_pad_c(type_id, lsbpad, msbpad) END SUBROUTINE h5tset_pad_f -!---------------------------------------------------------------------- -! Name: h5tget_sign_f -! -! Purpose: Retrieves the sign type for an integer type. -! -! Inputs: -! type_id - datatype identifier -! Outputs: -! sign - sign type -! Possible values are: -! Unsigned integer type H5T_SGN_NONE_F = 0 -! Two's complement signed integer type -! H5T_SGN_2_F = 1 -! or error value: H5T_SGN_ERROR_F=-1 -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5tget_sign_f(type_id, sign, hdferr) +! +!****s* H5T/h5tget_sign_f +! +! NAME +! h5tget_sign_f +! +! PURPOSE +! Retrieves the sign type for an integer type. +! +! INPUTS +! type_id - datatype identifier +! OUTPUTS +! sign - sign type +! Possible values are: +! - Unsigned integer type +! H5T_SGN_NONE_F = 0 +! - Two's complement signed integer type +! H5T_SGN_2_F = 1 +! - error value: H5T_SGN_ERROR_F=-1 +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! SOURCE + SUBROUTINE h5tget_sign_f(type_id, sign, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier INTEGER, INTENT(OUT) :: sign ! sign type for an integer type @@ -977,10 +928,8 @@ CONTAINS !H5T_SGN_2_F = 1 !or error value: H5T_SGN_ERROR_F=-1 INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** -! INTEGER, EXTERNAL :: h5tget_sign_c -! MS FORTRAN needs explicit interface for C functions called here. -! INTERFACE INTEGER FUNCTION h5tget_sign_c(type_id, sign) USE H5GLOBAL @@ -995,37 +944,37 @@ CONTAINS hdferr = h5tget_sign_c(type_id, sign) END SUBROUTINE h5tget_sign_f -!---------------------------------------------------------------------- -! Name: h5tset_sign_f -! -! Purpose: Sets the sign proprety for an integer type. -! -! Inputs: -! type_id - datatype identifier -! sign - sign type -! Possible values are: -! Unsigned integer type H5T_SGN_NONE_F = 0 -! Two's complement signed integer type -! H5T_SGN_2_F = 1 -! or error value: H5T_SGN_ERROR_F=-1 -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5tset_sign_f(type_id, sign, hdferr) +! +!****s* H5T/h5tset_sign_f +! +! NAME +! h5tset_sign_f +! +! PURPOSE +! Sets the sign proprety for an integer type. +! +! INPUTS +! type_id - datatype identifier +! sign - sign type +! Possible values are: +! - Unsigned integer type +! H5T_SGN_NONE_F = 0 +! - Two's complement signed integer type +! H5T_SGN_2_F = 1 +! - error value: H5T_SGN_ERROR_F=-1 +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! SOURCE + SUBROUTINE h5tset_sign_f(type_id, sign, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier INTEGER, INTENT(IN) :: sign !sign type for an integer type @@ -1035,10 +984,8 @@ CONTAINS !H5T_SGN_2_F = 1 !or error value: H5T_SGN_ERROR_F=-1 INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** -! INTEGER, EXTERNAL :: h5tset_sign_c -! MS FORTRAN needs explicit interface for C functions called here. -! INTERFACE INTEGER FUNCTION h5tset_sign_c(type_id, sign) USE H5GLOBAL @@ -1053,36 +1000,35 @@ CONTAINS hdferr = h5tset_sign_c(type_id, sign) END SUBROUTINE h5tset_sign_f -!---------------------------------------------------------------------- -! Name: h5tget_fields_f ! -! Purpose: Retrieves floating point datatype bit field information. +!****s* H5T/h5tget_fields_f ! -! Inputs: -! type_id - datatype identifier -! Outputs: -! spos - sign bit-position -! epos - exponent bit-position -! esize - size of exponent in bits -! mpos - mantissa position -! msize - size of mantissa in bits -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! NAME +! h5tget_fields_f ! -! Programmer: Elena Pourmal -! August 12, 1999 +! PURPOSE +! Retrieves floating point datatype bit field information. ! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 +! INPUTS +! type_id - datatype identifier +! OUTPUTS +! spos - sign bit-position +! epos - exponent bit-position +! esize - size of exponent in bits +! mpos - mantissa position +! msize - size of mantissa in bits +! hdferr - Returns 0 if successful and -1 if fails ! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5tget_fields_f(type_id, spos, epos, esize, mpos, msize, hdferr) +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! SOURCE + SUBROUTINE h5tget_fields_f(type_id, spos, epos, esize, mpos, msize, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier INTEGER(SIZE_T), INTENT(OUT) :: spos ! sign bit-position @@ -1091,10 +1037,8 @@ CONTAINS INTEGER(SIZE_T), INTENT(OUT) :: mpos ! mantissa bit-position INTEGER(SIZE_T), INTENT(OUT) :: msize ! size of mantissa in bits INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** -! INTEGER, EXTERNAL :: h5tget_fields_c -! MS FORTRAN needs explicit interface for C functions called here. -! INTERFACE INTEGER FUNCTION h5tget_fields_c(type_id, spos, epos, esize, mpos, msize) USE H5GLOBAL @@ -1113,37 +1057,35 @@ CONTAINS hdferr = h5tget_fields_c(type_id, spos, epos, esize, mpos, msize) END SUBROUTINE h5tget_fields_f -!---------------------------------------------------------------------- -! Name: h5tset_fields_f -! -! Purpose: Sets locations and sizes of floating point bit fields. -! -! Inputs: -! type_id - datatype identifier -! spos - sign bit-position -! epos - exponent bit-position -! esize - size of exponent in bits -! mpos - mantissa position -! msize - size of mantissa in bits -! hdferr: - error code -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5tset_fields_f(type_id, spos, epos, esize, mpos, msize, hdferr) +! +!****s* H5T/h5tset_fields_f +! +! NAME +! h5tset_fields_f +! +! PURPOSE +! Sets locations and sizes of floating point bit fields. +! +! INPUTS +! type_id - datatype identifier +! spos - sign bit-position +! epos - exponent bit-position +! esize - size of exponent in bits +! mpos - mantissa position +! msize - size of mantissa in bits +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! SOURCE + SUBROUTINE h5tset_fields_f(type_id, spos, epos, esize, mpos, msize, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier INTEGER(SIZE_T), INTENT(IN) :: spos ! sign bit-position @@ -1152,10 +1094,8 @@ CONTAINS INTEGER(SIZE_T), INTENT(IN) :: mpos ! mantissa bit-position INTEGER(SIZE_T), INTENT(IN) :: msize ! size of mantissa in bits INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** -! INTEGER, EXTERNAL :: h5tset_fields_c -! MS FORTRAN needs explicit interface for C functions called here. -! INTERFACE INTEGER FUNCTION h5tset_fields_c(type_id, spos, epos, esize, mpos, msize) USE H5GLOBAL @@ -1174,40 +1114,37 @@ CONTAINS hdferr = h5tset_fields_c(type_id, spos, epos, esize, mpos, msize) END SUBROUTINE h5tset_fields_f -!---------------------------------------------------------------------- -! Name: h5tget_ebias_f ! -! Purpose: Retrieves the exponent bias of a floating-point type. +!****s* H5T/h5tget_ebias_f ! -! Inputs: -! type_id - datatype identifier -! Outputs: -! ebias - datatype exponent bias -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! NAME +! h5tget_ebias_f ! -! Programmer: Elena Pourmal -! August 12, 1999 +! PURPOSE +! Retrieves the exponent bias of a floating-point type. ! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 +! INPUTS +! type_id - datatype identifier +! OUTPUTS +! ebias - datatype exponent bias +! hdferr - Returns 0 if successful and -1 if fails ! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5tget_ebias_f(type_id, ebias, hdferr) +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! SOURCE + SUBROUTINE h5tget_ebias_f(type_id, ebias, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier INTEGER(SIZE_T), INTENT(OUT) :: ebias ! Datatype exponent bias of a floating-point type INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** -! INTEGER, EXTERNAL :: h5tget_ebias_c -! MS FORTRAN needs explicit interface for C functions called here. -! INTERFACE INTEGER FUNCTION h5tget_ebias_c(type_id, ebias) USE H5GLOBAL @@ -1222,41 +1159,37 @@ CONTAINS hdferr = h5tget_ebias_c(type_id, ebias) END SUBROUTINE h5tget_ebias_f -!---------------------------------------------------------------------- -! Name: h5tset_ebias_f ! -! Purpose: Sets the exponent bias of a floating-point type. +!****s* H5T/h5tset_ebias_f ! -! Inputs: -! type_id - datatype identifier -! ebias - datatype exponent bias -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! NAME +! h5tset_ebias_f ! -! Programmer: Elena Pourmal -! August 12, 1999 +! PURPOSE +! Sets the exponent bias of a floating-point type. ! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 +! INPUTS +! type_id - datatype identifier +! ebias - datatype exponent bias +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails ! -! Comment: -!---------------------------------------------------------------------- - - - SUBROUTINE h5tset_ebias_f(type_id, ebias, hdferr) +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! SOURCE + SUBROUTINE h5tset_ebias_f(type_id, ebias, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier INTEGER(SIZE_T), INTENT(IN) :: ebias !Datatype exponent bias of a floating-point type INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** -! INTEGER, EXTERNAL :: h5tset_ebias_c -! MS FORTRAN needs explicit interface for C functions called here. -! INTERFACE INTEGER FUNCTION h5tset_ebias_c(type_id, ebias) USE H5GLOBAL @@ -1271,36 +1204,35 @@ CONTAINS hdferr = h5tset_ebias_c(type_id, ebias) END SUBROUTINE h5tset_ebias_f -!---------------------------------------------------------------------- -! Name: h5tget_norm_f ! -! Purpose: Retrieves mantissa normalization of a floating-point -! datatype. +!****s* H5T/h5tget_norm_f ! -! Inputs: -! type_id - datatype identifier -! Outputs: -! norm - normalization types, valid values are: -! H5T_NORM_IMPLIED_F(0) -! H5T_NORM_MSBSET_F(1) -! H5T_NORM_NONE_F(2) -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! NAME +! h5tget_norm_f ! -! Programmer: Elena Pourmal -! August 12, 1999 +! PURPOSE +! Retrieves mantissa normalization of a floating-point +! datatype. ! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 +! INPUTS +! type_id - datatype identifier +! OUTPUTS +! norm - normalization types, valid values are: +! H5T_NORM_IMPLIED_F(0) +! H5T_NORM_MSBSET_F(1) +! H5T_NORM_NONE_F(2) +! hdferr - Returns 0 if successful and -1 if fails ! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5tget_norm_f(type_id, norm, hdferr) +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! SOURCE + SUBROUTINE h5tget_norm_f(type_id, norm, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier INTEGER, INTENT(OUT) :: norm !mantissa normalization of a floating-point datatype @@ -1310,10 +1242,8 @@ CONTAINS !mantissa is always 1, H5T_NORM_NONE_F(2) !Mantissa is not normalize INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** -! INTEGER, EXTERNAL :: h5tget_norm_c -! MS FORTRAN needs explicit interface for C functions called here. -! INTERFACE INTEGER FUNCTION h5tget_norm_c(type_id, norm) USE H5GLOBAL @@ -1328,36 +1258,35 @@ CONTAINS hdferr = h5tget_norm_c(type_id, norm) END SUBROUTINE h5tget_norm_f -!---------------------------------------------------------------------- -! Name: h5tset_norm_f ! -! Purpose: Sets the mantissa normalization of a floating-point datatype. +!****s* H5T/h5tset_norm_f ! -! Inputs: -! type_id - datatype identifier -! norm - normalization types, valid values are: -! H5T_NORM_IMPLIED_F(0) -! H5T_NORM_MSBSET_F(1) -! H5T_NORM_NONE_F(2) -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! NAME +! h5tset_norm_f ! -! Programmer: Elena Pourmal -! August 12, 1999 +! PURPOSE +! Sets the mantissa normalization of a floating-point datatype. ! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 +! INPUTS +! type_id - datatype identifier +! norm - normalization types, valid values are: +! H5T_NORM_IMPLIED_F(0) +! H5T_NORM_MSBSET_F(1) +! H5T_NORM_NONE_F(2) +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails ! -! Comment: -!---------------------------------------------------------------------- - - - SUBROUTINE h5tset_norm_f(type_id, norm, hdferr) +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! +! SOURCE + SUBROUTINE h5tset_norm_f(type_id, norm, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier INTEGER, INTENT(IN) :: norm !mantissa normalization of a floating-point datatype @@ -1367,10 +1296,7 @@ CONTAINS !mantissa is always 1, H5T_NORM_NONE_F(2) !Mantissa is not normalize INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5tset_norm_c -! MS FORTRAN needs explicit interface for C functions called here. -! +!***** INTERFACE INTEGER FUNCTION h5tset_norm_c(type_id, norm) USE H5GLOBAL @@ -1385,37 +1311,36 @@ CONTAINS hdferr = h5tset_norm_c(type_id, norm) END SUBROUTINE h5tset_norm_f -!---------------------------------------------------------------------- -! Name: h5tget_inpad_f -! -! Purpose: Retrieves the internal padding type for unused bits -! in floating-point datatypes. -! -! Inputs: -! type_id - datatype identifier -! Outputs: -! padtype - padding type for unused bits -! Possible values of padding type are: -! H5T_PAD_ZERO_F = 0 -! H5T_PAD_ONE_F = 1 -! H5T_PAD_BACKGROUND_F = 2 -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5tget_inpad_f(type_id, padtype, hdferr) +! +!****s* H5T/h5tget_inpad_f +! +! NAME +! h5tget_inpad_f +! +! PURPOSE +! Retrieves the internal padding type for unused bits +! in floating-point datatypes. +! +! INPUTS +! type_id - datatype identifier +! OUTPUTS +! padtype - padding type for unused bits +! Possible values of padding type are: +! H5T_PAD_ZERO_F = 0 +! H5T_PAD_ONE_F = 1 +! H5T_PAD_BACKGROUND_F = 2 +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! SOURCE + SUBROUTINE h5tget_inpad_f(type_id, padtype, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier INTEGER, INTENT(OUT) :: padtype ! padding type for unused bits @@ -1426,10 +1351,7 @@ CONTAINS ! H5T__PAD_BACKGROUND_F = 2 INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5tget_inpad_c -! MS FORTRAN needs explicit interface for C functions called here. -! +!***** INTERFACE INTEGER FUNCTION h5tget_inpad_c(type_id, padtype) USE H5GLOBAL @@ -1444,36 +1366,35 @@ CONTAINS hdferr = h5tget_inpad_c(type_id, padtype) END SUBROUTINE h5tget_inpad_f -!---------------------------------------------------------------------- -! Name: h5tset_inpad_f ! -! Purpose: Fills unused internal floating point bits. +!****s* H5T/h5tset_inpad_f ! -! Inputs: -! type_id - datatype identifier -! padtype - padding type for unused bits -! Possible values of padding type are: -! H5T_PAD_ZERO_F = 0 -! H5T_PAD_ONE_F = 1 -! H5T_PAD_BACKGROUND_F = 2 -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! NAME +! h5tset_inpad_f ! -! Programmer: Elena Pourmal -! August 12, 1999 +! PURPOSE +! Fills unused internal floating point bits. ! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 +! INPUTS +! type_id - datatype identifier +! padtype - padding type for unused bits +! Possible values of padding type are: +! H5T_PAD_ZERO_F = 0 +! H5T_PAD_ONE_F = 1 +! H5T_PAD_BACKGROUND_F = 2 +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails ! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5tset_inpad_f(type_id, padtype, hdferr) +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! SOURCE + SUBROUTINE h5tset_inpad_f(type_id, padtype, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier INTEGER, INTENT(IN) :: padtype ! padding type for unused bits @@ -1483,10 +1404,7 @@ CONTAINS ! H5T__PAD_ONE_F = 1 ! H5T__PAD_BACKGROUND_F = 2 INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5tset_inpad_c -! MS FORTRAN needs explicit interface for C functions called here. -! +!***** INTERFACE INTEGER FUNCTION h5tset_inpad_c(type_id, padtype) USE H5GLOBAL @@ -1501,46 +1419,42 @@ CONTAINS hdferr = h5tset_inpad_c(type_id, padtype) END SUBROUTINE h5tset_inpad_f -!---------------------------------------------------------------------- -! Name: h5tget_cset_f ! -! Purpose: Retrieves the character set type of a string datatype. +!****s* H5T/h5tget_cset_f ! -! Inputs: -! type_id - datatype identifier -! Outputs: -! cset - character set type of a string datatype -! Possible values are: -! H5T_CSET_ASCII_F = 0 -! H5T_CSET_UTF8_F -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! NAME +! h5tget_cset_f ! -! Programmer: Elena Pourmal -! August 12, 1999 +! PURPOSE +! Retrieves the character set type of a string datatype. ! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 +! INPUTS +! type_id - Datatype identifier +! OUTPUTS +! cset - Character set type of a string datatype +! Possible values are: +! H5T_CSET_ASCII_F = 0 +! H5T_CSET_UTF8_F +! hdferr - Returns 0 if successful and -1 if fails ! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5tget_cset_f(type_id, cset, hdferr) +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! SOURCE + SUBROUTINE h5tget_cset_f(type_id, cset, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier - INTEGER, INTENT(OUT) :: cset ! character set type of a string datatype - ! Possible values are: - ! H5T_CSET_ASCII_F = 0 - ! H5T_CSET_UTF8_F - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5tget_cset_c -! MS FORTRAN needs explicit interface for C functions called here. -! + INTEGER, INTENT(OUT) :: cset ! character set type of a string datatype + ! Possible values are: + ! H5T_CSET_ASCII_F = 0 + ! H5T_CSET_UTF8_F + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** INTERFACE INTEGER FUNCTION h5tget_cset_c(type_id, cset) USE H5GLOBAL @@ -1555,47 +1469,42 @@ CONTAINS hdferr = h5tget_cset_c(type_id, cset) END SUBROUTINE h5tget_cset_f -!---------------------------------------------------------------------- -! Name: h5tset_cset_f ! -! Purpose: Sets character set to be used. +!****s* H5T/h5tset_cset_f ! -! Inputs: -! type_id - datatype identifier -! cset - character set type of a string datatype -! Possible values are: -! H5T_CSET_ASCII_F = 0 -! H5T_CSET_UTF8_F -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! NAME +! h5tset_cset_f ! -! Programmer: Elena Pourmal -! August 12, 1999 +! PURPOSE +! Sets character set to be used. ! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 +! INPUTS +! type_id - datatype identifier +! cset - character set type of a string datatype +! Possible values are: +! H5T_CSET_ASCII_F = 0 +! H5T_CSET_UTF8_F +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails ! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5tset_cset_f(type_id, cset, hdferr) +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! SOURCE + SUBROUTINE h5tset_cset_f(type_id, cset, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier INTEGER, INTENT(IN) :: cset !character set type of a string datatype - !Possible values are: - ! H5T_CSET_ASCII_F = 0 - ! H5T_CSET_UTF8_F - + ! Possible values of padding type are: + ! H5T_CSET_ASCII_F = 0 + ! H5T_CSET_UTF8_F INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5tset_cset_c -! MS FORTRAN needs explicit interface for C functions called here. -! +!***** INTERFACE INTEGER FUNCTION h5tset_cset_c(type_id, cset) USE H5GLOBAL @@ -1610,45 +1519,41 @@ CONTAINS hdferr = h5tset_cset_c(type_id, cset) END SUBROUTINE h5tset_cset_f -!---------------------------------------------------------------------- -! Name: h5tget_strpad_f -! -! Purpose: Retrieves the storage mechanism for a string datatype. -! -! Inputs: -! type_id - datatype identifier -! Outputs: -! strpad - storage method for a string datatype -! Possible values are: -! H5T_STR_NULLTERM_F, -! H5T_STR_NULLPAD_F, -! H5T_STR_SPACEPAD_F -! H5T_STR_ERROR_F -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5tget_strpad_f(type_id, strpad, hdferr) +! +!****s* H5T/h5tget_strpad_f +! +! NAME +! h5tget_strpad_f +! +! PURPOSE +! Retrieves the storage mechanism for a string datatype. +! +! INPUTS +! type_id - datatype identifier +! OUTPUTS +! strpad - storage method for a string datatype +! Possible values are: +! H5T_STR_NULLTERM_F, +! H5T_STR_NULLPAD_F, +! H5T_STR_SPACEPAD_F +! H5T_STR_ERROR_F +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! SOURCE + SUBROUTINE h5tget_strpad_f(type_id, strpad, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier INTEGER, INTENT(OUT) :: strpad INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5tget_strpad_c -! MS FORTRAN needs explicit interface for C functions called here. -! +!***** INTERFACE INTEGER FUNCTION h5tget_strpad_c(type_id, strpad) USE H5GLOBAL @@ -1663,45 +1568,41 @@ CONTAINS hdferr = h5tget_strpad_c(type_id, strpad) END SUBROUTINE h5tget_strpad_f -!---------------------------------------------------------------------- -! Name: h5tset_strpad_f -! -! Purpose: Defines the storage mechanism for character strings. -! -! Inputs: -! type_id - datatype identifier -! strpad - storage method for a string datatype -! Possible values are: -! H5T_STR_NULLTERM_F, -! H5T_STR_NULLPAD_F, -! H5T_STR_SPACEPAD_F -! H5T_STR_ERROR_F -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5tset_strpad_f(type_id, strpad, hdferr) +! +!****s* H5T/h5tset_strpad_f +! +! NAME +! h5tset_strpad_f +! +! PURPOSE +! Defines the storage mechanism for character strings. +! +! INPUTS +! type_id - datatype identifier +! strpad - storage method for a string datatype +! Possible values are: +! H5T_STR_NULLTERM_F, +! H5T_STR_NULLPAD_F, +! H5T_STR_SPACEPAD_F +! H5T_STR_ERROR_F +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! SOURCE + SUBROUTINE h5tset_strpad_f(type_id, strpad, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier INTEGER, INTENT(IN) :: strpad ! string padding method for a string datatype INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5tset_strpad_c -! MS FORTRAN needs explicit interface for C functions called here. -! +!***** INTERFACE INTEGER FUNCTION h5tset_strpad_c(type_id, strpad) USE H5GLOBAL @@ -1716,41 +1617,38 @@ CONTAINS hdferr = h5tset_strpad_c(type_id, strpad) END SUBROUTINE h5tset_strpad_f -!---------------------------------------------------------------------- -! Name: h5tget_nmembers_f ! -! Purpose: Retrieves the number of fields in a compound datatype. +!****s* H5T/h5tget_nmembers_f ! -! Inputs: -! type_id - datatype identifier -! Outputs: -! num_members - number of members -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! NAME +! h5tget_nmembers_f ! -! Programmer: Elena Pourmal -! August 12, 1999 +! PURPOSE +! Retrieves the number of fields in a compound datatype. ! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 +! INPUTS +! type_id - datatype identifier +! OUTPUTS +! num_members - number of members +! hdferr - Returns 0 if successful and -1 if fails ! -! Comment: -!---------------------------------------------------------------------- - - - SUBROUTINE h5tget_nmembers_f(type_id, num_members, hdferr) +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! +! SOURCE + SUBROUTINE h5tget_nmembers_f(type_id, num_members, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier INTEGER, INTENT(OUT) :: num_members !number of fields in a compound datatype INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** -! INTEGER, EXTERNAL :: h5tget_nmembers_c -! MS FORTRAN needs explicit interface for C functions called here. -! INTERFACE INTEGER FUNCTION h5tget_nmembers_c(type_id, num_members) USE H5GLOBAL @@ -1765,34 +1663,33 @@ CONTAINS hdferr = h5tget_nmembers_c(type_id, num_members) END SUBROUTINE h5tget_nmembers_f -!---------------------------------------------------------------------- -! Name: h5tget_member_name_f ! -! Purpose: Retrieves the name of a field of a compound datatype. +!****s* H5T/h5tget_member_name_f ! -! Inputs: -! type_id - datatype identifier -! index - filed index (0-based) -! Outputs: -! member_name - buffer to hold member's name -! namelen - name length -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! NAME +! h5tget_member_name_f ! -! Programmer: Elena Pourmal -! August 12, 1999 +! PURPOSE +! Retrieves the name of a field of a compound datatype. ! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 +! INPUTS +! type_id - datatype identifier +! index - filed index (0-based) +! OUTPUTS +! member_name - buffer to hold member's name +! namelen - name length +! hdferr - Returns 0 if successful and -1 if fails ! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5tget_member_name_f(type_id, index, member_name, namelen, hdferr) +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! SOURCE + SUBROUTINE h5tget_member_name_f(type_id, index, member_name, namelen, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier INTEGER, INTENT(IN) :: index !Field index (0-based) of the field name to retrieve @@ -1800,10 +1697,7 @@ CONTAINS !a compound datatype INTEGER, INTENT(OUT) :: namelen ! Length of the name INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5tget_member_name_c -! MS FORTRAN needs explicit interface for C functions called here. -! +!***** INTERFACE INTEGER FUNCTION h5tget_member_name_c(type_id, index, member_name, namelen) USE H5GLOBAL @@ -1821,43 +1715,39 @@ CONTAINS hdferr = h5tget_member_name_c(type_id, index, member_name, namelen) END SUBROUTINE h5tget_member_name_f -!---------------------------------------------------------------------- -! Name: h5tget_member_offset_f ! -! Purpose: Retrieves the offset of a field of a compound datatype. +!****s* H5T/h5tget_member_offset_f ! -! Inputs: -! type_id - datatype identifier -! member_no - number of the field -! Outputs: -! offset - byte offset of the requested field -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! NAME +! h5tget_member_offset_f ! -! Programmer: Elena Pourmal -! August 12, 1999 +! PURPOSE +! Retrieves the offset of a field of a compound datatype. ! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 +! INPUTS +! type_id - datatype identifier +! member_no - number of the field +! OUTPUTS +! offset - byte offset of the requested field +! hdferr - Returns 0 if successful and -1 if fails ! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5tget_member_offset_f(type_id, member_no, offset, hdferr) +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! SOURCE + SUBROUTINE h5tget_member_offset_f(type_id, member_no, offset, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier INTEGER, INTENT(IN) :: member_no !Number of the field !whose offset is requested INTEGER(SIZE_T), INTENT(OUT) :: offset !byte offset of the beginning of the field INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5tget_member_offset_c -! MS FORTRAN needs explicit interface for C functions called here. -! +!***** INTERFACE INTEGER FUNCTION h5tget_member_offset_c(type_id, member_no, offset ) USE H5GLOBAL @@ -1872,37 +1762,35 @@ CONTAINS hdferr = h5tget_member_offset_c(type_id, member_no, offset ) END SUBROUTINE h5tget_member_offset_f -!---------------------------------------------------------------------- -! Name: h5tget_member_index_f ! -! Purpose: Retrieves the index of a compound or enumeration datatype member. +!****s* H5T/h5tget_member_index_f ! -! Inputs: -! type_id - datatype identifier -! name - name of the field or member whose index to -! to be retrieved from the datatype. -! Outputs: -! index - 0-based index of the filed or member (0 to N-1) -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! NAME +! h5tget_member_index_f ! -! Programmer: Elena Pourmal -! September 26, 2002 +! PURPOSE +! Retrieves the index of a compound or enumeration datatype member. ! -! Modifications: +! INPUTS +! type_id - datatype identifier +! name - name of the field or member whose index to +! to be retrieved from the datatype. +! OUTPUTS +! index - 0-based index of the filed or member (0 to N-1) +! hdferr - Returns 0 if successful and -1 if fails ! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5tget_member_index_f(type_id, name, index, hdferr) +! AUTHOR +! Elena Pourmal +! September 26, 2002 +! +! SOURCE + SUBROUTINE h5tget_member_index_f(type_id, name, index, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier CHARACTER(LEN=*), INTENT(IN) :: name ! Field or member name INTEGER, INTENT(OUT) :: index ! Field or member index INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** INTEGER :: namelen ! Name length INTERFACE @@ -1924,83 +1812,82 @@ CONTAINS END SUBROUTINE h5tget_member_index_f -!---------------------------------------------------------------------- -! Name: h5tget_member_dim_f -! -! Purpose: This function is not supported in hdf5-1.4.* -! -! Inputs: -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 -! -! Comment: -!---------------------------------------------------------------------- - -! SUBROUTINE h5tget_member_dims_f(type_id, field_idx,dims, field_dims, perm, hdferr) -! -! IMPLICIT NONE -! INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier -! INTEGER, INTENT(IN) :: field_idx !Field index (0-based) of -! !field_dims, perm) -! INTEGER, INTENT(OUT) :: dims !number of dimensions of the field -! -! INTEGER(SIZE_T),DIMENSION(*), INTENT(OUT) :: field_dims !buffer to store the -! !dimensions of the field -! INTEGER, DIMENSION(*), INTENT(OUT) :: perm !buffer to store the -! !permutation vector of the field -! INTEGER, INTENT(OUT) :: hdferr ! Error code -! INTEGER, EXTERNAL :: h5tget_member_dims_c -! hdferr = h5tget_member_dims_c(type_id, field_idx, dims, field_dims, perm) -! -! END SUBROUTINE h5tget_member_dims_f - -!---------------------------------------------------------------------- -! Name: h5tget_array_dims_f -! -! Purpose: Returns sizes of array dimensions. -! -! Inputs: -! type_id - array datatype identifier -! Outputs: -! dims - buffer to store array datatype -! dimensions -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5tget_array_dims_f(type_id, dims, hdferr) +! !$! +! !$!****s* H5T/h5tget_member_dim_f +! !$! +! !$! NAME +! !$! h5tget_member_dim_f +! !$! +! !$! PURPOSE +! !$! This function is not supported in hdf5-1.4.* +! !$! +! !$! INPUTS +! !$! OUTPUTS +! !$! hdferr: - error code +! !$! Success: 0 +! !$! Failure: -1 +! !$! +! !$! AUTHOR +! !$! Elena Pourmal +! !$! August 12, 1999 +! !$! +! !$! HISTORY +! !$! Explicit Fortran interfaces were added for +! !$! called C functions (it is needed for Windows +! !$! port). March 7, 2001 +! !$! +! !$! SOURCE +! !$! SUBROUTINE h5tget_member_dims_f(type_id, field_idx,dims, field_dims, perm, hdferr) +! !$! +! !$! IMPLICIT NONE +! !$! INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier +! !$! INTEGER, INTENT(IN) :: field_idx !Field index (0-based) of +! !$! !field_dims, perm) +! !$! INTEGER, INTENT(OUT) :: dims !number of dimensions of the field +! !$! +! !$! INTEGER(SIZE_T),DIMENSION(*), INTENT(OUT) :: field_dims !buffer to store the +! !$! !dimensions of the field +! !$! INTEGER, DIMENSION(*), INTENT(OUT) :: perm !buffer to store the +! !$! !permutation vector of the field +! !$! INTEGER, INTENT(OUT) :: hdferr ! Error code +! !$!*****! +! !$! INTEGER, EXTERNAL :: h5tget_member_dims_c +! !$! hdferr = h5tget_member_dims_c(type_id, field_idx, dims, field_dims, perm) +! !$! +! !$! END SUBROUTINE h5tget_member_dims_f + + +!****s* H5T/h5tget_array_dims_f +! +! NAME +! h5tget_array_dims_f +! +! PURPOSE +! Returns sizes of array dimensions. +! +! INPUTS +! type_id - array datatype identifier +! OUTPUTS +! dims - buffer to store array datatype dimensions +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! SOURCE + SUBROUTINE h5tget_array_dims_f(type_id, dims, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: type_id ! Array datatype identifier INTEGER(HSIZE_T),DIMENSION(*), INTENT(OUT) :: dims !buffer to store array datatype ! dimensions INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** -! INTEGER, EXTERNAL :: h5tget_array_dims_c -! MS FORTRAN needs explicit interface for C functions called here. -! INTERFACE INTEGER FUNCTION h5tget_array_dims_c(type_id, dims) USE H5GLOBAL @@ -2016,40 +1903,36 @@ CONTAINS END SUBROUTINE h5tget_array_dims_f -!---------------------------------------------------------------------- -! Name: h5tget_array_ndims_f ! -! Purpose: Returns the rank of an array datatype. +!****s* H5T/h5tget_array_ndims_f ! -! Inputs: -! type_id - array datatype identifier -! Outputs: -! ndims - number of array dimensions -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! NAME +! h5tget_array_ndims_f ! -! Programmer: Elena Pourmal -! August 12, 1999 +! PURPOSE +! Returns the rank of an array datatype. ! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 +! INPUTS +! type_id - array datatype identifier +! OUTPUTS +! ndims - number of array dimensions +! hdferr - Returns 0 if successful and -1 if fails ! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5tget_array_ndims_f(type_id, ndims, hdferr) +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! SOURCE + SUBROUTINE h5tget_array_ndims_f(type_id, ndims, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: type_id ! Array datatype identifier INTEGER, INTENT(OUT) :: ndims ! number of array dimensions INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5tget_array_ndims_c -! MS FORTRAN needs explicit interface for C functions called here. -! +!***** INTERFACE INTEGER FUNCTION h5tget_array_ndims_c(type_id, ndims) USE H5GLOBAL @@ -2065,41 +1948,37 @@ CONTAINS END SUBROUTINE h5tget_array_ndims_f -!---------------------------------------------------------------------- -! Name: h5tget_super_f ! -! Purpose: Returns the base datatype from which a datatype is derived. +!****s* H5T/h5tget_super_f ! -! Inputs: -! type_id - datatype identifier -! Outputs: -! base_type_id - identifier of the base type -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! NAME +! h5tget_super_f ! -! Programmer: Elena Pourmal -! August 12, 1999 +! PURPOSE +! Returns the base datatype from which a datatype is derived. ! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 +! INPUTS +! type_id - datatype identifier +! OUTPUTS +! base_type_id - identifier of the base type +! hdferr - Returns 0 if successful and -1 if fails ! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5tget_super_f(type_id, base_type_id, hdferr) +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! SOURCE + SUBROUTINE h5tget_super_f(type_id, base_type_id, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: type_id ! datatype identifier INTEGER(HID_T), INTENT(OUT) :: base_type_id ! identifier of the datatype ! from which datatype (type_id) was derived INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5tget_super_c -! MS FORTRAN needs explicit interface for C functions called here. -! +!***** INTERFACE INTEGER FUNCTION h5tget_super_c(type_id, base_type_id) USE H5GLOBAL @@ -2115,44 +1994,40 @@ CONTAINS END SUBROUTINE h5tget_super_f -!---------------------------------------------------------------------- -! Name: h5tget_member_type_f ! -! Purpose: Returns the datatype of the specified member. +!****s* H5T/h5tget_member_type_f ! -! Inputs: -! type_id - compound datatype identifier -! field_idx - field index (0-based) +! NAME +! h5tget_member_type_f ! -! Outputs: -! datatype - idnetifier of the member's datatype -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! PURPOSE +! Returns the datatype of the specified member. ! -! Programmer: Elena Pourmal -! August 12, 1999 +! INPUTS +! type_id - compound datatype identifier +! field_idx - field index (0-based) ! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 +! OUTPUTS +! datatype - idnetifier of the member's datatype +! hdferr - Returns 0 if successful and -1 if fails ! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5tget_member_type_f(type_id, field_idx, datatype, hdferr) +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! SOURCE + SUBROUTINE h5tget_member_type_f(type_id, field_idx, datatype, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier INTEGER, INTENT(IN) :: field_idx !Field index (0-based) of the field type to retrieve INTEGER(HID_T), INTENT(OUT) :: datatype !identifier of a copy of !the datatype of the field INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5tget_member_type_c -! MS FORTRAN needs explicit interface for C functions called here. -! +!***** INTERFACE INTEGER FUNCTION h5tget_member_type_c(type_id, field_idx , datatype) USE H5GLOBAL @@ -2168,37 +2043,35 @@ CONTAINS hdferr = h5tget_member_type_c(type_id, field_idx , datatype) END SUBROUTINE h5tget_member_type_f -!---------------------------------------------------------------------- -! Name: h5tcreate_f ! -! Purpose: Creates a new dataype +!****s* H5T/h5tcreate_f ! -! Inputs: -! class - datatype class, possible values are: -! H5T_COMPOUND_F -! H5T_ENUM_F -! H5T_OPAQUE_F -! size - datattype size -! Outputs: -! type_id - datatype identifier -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! NAME +! h5tcreate_f ! -! Programmer: Elena Pourmal -! August 12, 1999 +! PURPOSE +! Creates a new dataype ! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 +! INPUTS +! class - datatype class, possible values are: +! H5T_COMPOUND_F +! H5T_ENUM_F +! H5T_OPAQUE_F +! size - datattype size +! OUTPUTS +! type_id - datatype identifier +! hdferr - Returns 0 if successful and -1 if fails ! -! Comment: -!---------------------------------------------------------------------- - - - SUBROUTINE h5tcreate_f(class, size, type_id, hdferr) +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! SOURCE + SUBROUTINE h5tcreate_f(class, size, type_id, hdferr) IMPLICIT NONE INTEGER, INTENT(IN) :: class ! Datatype class can be one of ! H5T_COMPOUND_F @@ -2207,10 +2080,7 @@ CONTAINS INTEGER(SIZE_T), INTENT(IN) :: size ! Size of the datatype INTEGER(HID_T), INTENT(OUT) :: type_id ! Datatype identifier INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5tcreate_c -! MS FORTRAN needs explicit interface for C functions called here. -! +!***** INTERFACE INTEGER FUNCTION h5tcreate_c(class, size, type_id) USE H5GLOBAL @@ -2226,35 +2096,34 @@ CONTAINS hdferr = h5tcreate_c(class, size, type_id) END SUBROUTINE h5tcreate_f -!---------------------------------------------------------------------- -! Name: h5tinsert_f ! -! Purpose: Adds a new member to a compound datatype. +!****s* H5T/h5tinsert_f ! -! Inputs: -! type_id - compound dattype identifier -! name - name of the field to insert -! offset - start of the member in an instance of -! the compound datatype -! field_id - datatype identifier of the field to insert -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! NAME +! h5tinsert_f ! -! Programmer: Elena Pourmal -! August 12, 1999 +! PURPOSE +! Adds a new member to a compound datatype. ! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 +! INPUTS +! type_id - compound dattype identifier +! name - name of the field to insert +! offset - start of the member in an instance of +! the compound datatype +! field_id - datatype identifier of the field to insert +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails ! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5tinsert_f(type_id, name, offset, field_id, hdferr) +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! SOURCE + SUBROUTINE h5tinsert_f(type_id, name, offset, field_id, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier CHARACTER(LEN=*), INTENT(IN) :: name !Name of the field to insert @@ -2263,11 +2132,9 @@ CONTAINS INTEGER(HID_T), INTENT(IN) :: field_id !datatype identifier of the new member INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** INTEGER :: namelen -! INTEGER, EXTERNAL :: h5tinsert_c -! MS FORTRAN needs explicit interface for C functions called here. -! INTERFACE INTEGER FUNCTION h5tinsert_c(type_id, name, namelen, offset, field_id) USE H5GLOBAL @@ -2287,38 +2154,35 @@ CONTAINS hdferr = h5tinsert_c(type_id, name, namelen, offset, field_id ) END SUBROUTINE h5tinsert_f -!---------------------------------------------------------------------- -! Name: h5tpack_f ! -! Purpose: Recursively removes padding from within a compound datatype. +!****s* H5T/h5tpack_f ! -! Inputs: -! type_id - compound datatype identifier -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! NAME +! h5tpack_f ! -! Programmer: Elena Pourmal -! August 12, 1999 +! PURPOSE +! Recursively removes padding from within a compound datatype. ! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 +! INPUTS +! type_id - compound datatype identifier +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails ! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5tpack_f(type_id, hdferr) +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! SOURCE + SUBROUTINE h5tpack_f(type_id, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** -! INTEGER, EXTERNAL :: h5tpack_c -! MS FORTRAN needs explicit interface for C functions called here. -! INTERFACE INTEGER FUNCTION h5tpack_c(type_id) USE H5GLOBAL @@ -2332,95 +2196,91 @@ CONTAINS hdferr = h5tpack_c(type_id) END SUBROUTINE h5tpack_f -!---------------------------------------------------------------------- -! Name: h5tinsert_array_f -! -! Purpose: This function is not available on hdf5-1.4.* -! -! Inputs: -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 -! -! Comment: -!---------------------------------------------------------------------- - -! SUBROUTINE h5tinsert_array_f(parent_id,name,offset, ndims, dims, member_id, hdferr, perm) -! IMPLICIT NONE -! INTEGER(HID_T), INTENT(IN) :: parent_id ! identifier of the parent compound datatype -! CHARACTER(LEN=*), INTENT(IN) :: name !Name of the new member -! INTEGER(SIZE_T), INTENT(IN) :: offset !Offset to start of new member -! !within compound datatype -! INTEGER, INTENT(IN) :: ndims !Dimensionality of new member. -! !Valid values are 0 (zero) through 4 (four) -! INTEGER(SIZE_T), DIMENSION(*), INTENT(IN) :: dims !Size of new member array -! INTEGER(HID_T), INTENT(IN) :: member_id ! identifier of the datatype of the new member -! INTEGER, INTENT(OUT) :: hdferr ! Error code -! -! INTEGER, DIMENSION(*), OPTIONAL, INTENT(IN) :: perm -! !Pointer to buffer to store -! !the permutation vector of the field -! INTEGER :: namelen, sizeofperm -! INTEGER, EXTERNAL :: h5tinsert_array_c, h5tinsert_array_c2 -! namelen = LEN(name) -! if (present(perm)) then -! hdferr = h5tinsert_array_c(parent_id, name, namelen, offset, ndims,dims, member_id, perm) -! else -! hdferr = h5tinsert_array_c2(parent_id, name, namelen, offset, ndims,dims, member_id) -! end if -! -! END SUBROUTINE h5tinsert_array_f - -!---------------------------------------------------------------------- -! Name: h5tarray_create_f -! -! Purpose: Creates an array datatype object. -! -! Inputs: -! base_id - datatype identifier for the array -! base datatype -! rank - rank of the array -! dims - array dimension sizes -! Outputs: -! type_id - array datatype identifier -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! August 12, 1999 -! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5tarray_create_f(base_id, rank, dims, type_id, hdferr) +! !$! +! !$!****s* H5T/h5tinsert_array_f +! !$! +! !$! NAME +! !$! h5tinsert_array_f +! !$! +! !$! PURPOSE +! !$! This function is not available on hdf5-1.4.* +! !$! +! !$! INPUTS +! !$! OUTPUTS +! !$! hdferr: - error code +! !$! Success: 0 +! !$! Failure: -1 +! !$! +! !$! AUTHOR +! !$! Elena Pourmal +! !$! August 12, 1999 +! !$! +! !$! HISTORY +! !$! Explicit Fortran interfaces were added for +! !$! called C functions (it is needed for Windows +! !$! port). March 7, 2001 +! !$! SOURCE +! SUBROUTINE h5tinsert_array_f(parent_id,name,offset, ndims, dims, member_id, hdferr, perm) +! IMPLICIT NONE +! INTEGER(HID_T), INTENT(IN) :: parent_id ! identifier of the parent compound datatype +! CHARACTER(LEN=*), INTENT(IN) :: name !Name of the new member +! INTEGER(SIZE_T), INTENT(IN) :: offset !Offset to start of new member +! !within compound datatype +! INTEGER, INTENT(IN) :: ndims !Dimensionality of new member. +! !Valid values are 0 (zero) through 4 (four) +! INTEGER(SIZE_T), DIMENSION(*), INTENT(IN) :: dims !Size of new member array +! INTEGER(HID_T), INTENT(IN) :: member_id ! identifier of the datatype of the new member +! INTEGER, INTENT(OUT) :: hdferr ! Error code +! !*****! +! INTEGER, DIMENSION(*), OPTIONAL, INTENT(IN) :: perm +! !Pointer to buffer to store +! !the permutation vector of the field +! INTEGER :: namelen, sizeofperm +! INTEGER, EXTERNAL :: h5tinsert_array_c, h5tinsert_array_c2 +! namelen = LEN(name) +! if (present(perm)) then +! hdferr = h5tinsert_array_c(parent_id, name, namelen, offset, ndims,dims, member_id, perm) +! else +! hdferr = h5tinsert_array_c2(parent_id, name, namelen, offset, ndims,dims, member_id) +! end if +! +! END SUBROUTINE h5tinsert_array_f + +! +!****s* H5T/h5tarray_create_f +! +! NAME +! h5tarray_create_f +! +! PURPOSE +! Creates an array datatype object. +! +! INPUTS +! base_id - datatype identifier for the array +! base datatype +! rank - rank of the array +! dims - array dimension sizes +! OUTPUTS +! type_id - array datatype identifier +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! SOURCE + SUBROUTINE h5tarray_create_f(base_id, rank, dims, type_id, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: base_id ! identifier of array base datatype INTEGER, INTENT(IN) :: rank ! Rank of the array INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: dims !Sizes of each array dimension INTEGER(HID_T), INTENT(OUT) :: type_id ! identifier of the array datatype INTEGER, INTENT(OUT) :: hdferr ! Error code - - -! INTEGER, EXTERNAL :: h5tarray_create_c -! MS FORTRAN needs explicit interface for C functions called here. -! +!***** INTERFACE INTEGER FUNCTION h5tarray_create_c(base_id, rank, dims, type_id) USE H5GLOBAL @@ -2438,33 +2298,31 @@ CONTAINS END SUBROUTINE h5tarray_create_f -!---------------------------------------------------------------------- -! Name: h5tenum_create_f ! -! Purpose: Creates a new enumeration datatype. +!****s* H5T/h5tenum_create_f ! -! Inputs: -! parent_id - datatype identifier for base datatype -! Outputs: -! new_type_id - datatype identifier for the enumeration -! datatype -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! NAME +! h5tenum_create_f ! -! Programmer: Elena Pourmal -! August 12, 1999 +! PURPOSE +! Creates a new enumeration datatype. ! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 +! INPUTS +! parent_id - datatype identifier for base datatype +! OUTPUTS +! new_type_id - datatype identifier for the enumeration datatype +! hdferr - Returns 0 if successful and -1 if fails ! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5tenum_create_f(parent_id, new_type_id, hdferr) +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! SOURCE + SUBROUTINE h5tenum_create_f(parent_id, new_type_id, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: parent_id ! Datatype identifier for ! the base datatype @@ -2472,10 +2330,8 @@ CONTAINS !datatype identifier for the ! new enumeration datatype INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** -! INTEGER, EXTERNAL :: h5tenum_create_c -! MS FORTRAN needs explicit interface for C functions called here. -! INTERFACE INTEGER FUNCTION h5tenum_create_c(parent_id, new_type_id) USE H5GLOBAL @@ -2490,41 +2346,38 @@ CONTAINS hdferr = h5tenum_create_c(parent_id, new_type_id) END SUBROUTINE h5tenum_create_f -!---------------------------------------------------------------------- -! Name: h5tenaum_insert_f ! -! Purpose: Inserts a new enumeration datatype member. +!****s* H5T/h5tenaum_insert_f ! -! Inputs: -! type_id - datatype identifier -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! NAME +! h5tenaum_insert_f ! -! Programmer: Elena Pourmal -! August 12, 1999 +! PURPOSE +! Inserts a new enumeration datatype member. ! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 +! INPUTS +! type_id - datatype identifier +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails ! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5tenum_insert_f(type_id, name, value, hdferr) +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! SOURCE + SUBROUTINE h5tenum_insert_f(type_id, name, value, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier CHARACTER(LEN=*), INTENT(IN) :: name !Name of the new member INTEGER, INTENT(IN) :: value !value of the new member INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** INTEGER :: namelen -! INTEGER, EXTERNAL :: h5tenum_insert_c -! MS FORTRAN needs explicit interface for C functions called here. -! INTERFACE INTEGER FUNCTION h5tenum_insert_c(type_id, name, namelen, value) USE H5GLOBAL @@ -2543,45 +2396,48 @@ CONTAINS hdferr = h5tenum_insert_c(type_id, name, namelen, value) END SUBROUTINE h5tenum_insert_f -!---------------------------------------------------------------------- -! Name: h5tenum_nameof_f ! -! Purpose: Returns the symbol name corresponding to a specified -! member of an enumeration datatype. +!****s* H5T/h5tenum_nameof_f ! -! Inputs: -! type_id - datatype identifier -! value - value of the enumeration datatype -! namelen - name buffer size -! Outputs: -! name - buffer to hold symbol name -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! NAME +! h5tenum_nameof_f ! -! Programmer: Elena Pourmal -! August 12, 1999 +! PURPOSE +! Returns the symbol name corresponding to a specified +! member of an enumeration datatype. ! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 +! INPUTS +! type_id - datatype identifier +! value - value of the enumeration datatype +! namelen - name buffer size +! OUTPUTS +! name - buffer to hold symbol name +! hdferr - Returns 0 if successful and -1 if fails ! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5tenum_nameof_f(type_id, value, namelen, name, hdferr) +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! +! NOTE +! According to the standard: Because an INTENT(OUT) variable is considered undefined +! on entry to the procedure, any default initialization specified for its type will +! be applied. So we need to blank out the "name" to be portable and eliminate any +! characters the "name' may contain upon entry, depending on compiler implementation. +! SOURCE + SUBROUTINE h5tenum_nameof_f(type_id, value, namelen, name, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier CHARACTER(LEN=*), INTENT(OUT) :: name !Name of the enumeration datatype. INTEGER(SIZE_T), INTENT(IN) :: namelen !length of the name INTEGER, INTENT(IN) :: value !value of the enumeration datatype. INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** -! INTEGER, EXTERNAL :: h5tenum_nameof_c -! MS FORTRAN needs explicit interface for C functions called here. -! INTERFACE INTEGER FUNCTION h5tenum_nameof_c(type_id, value, name, namelen) USE H5GLOBAL @@ -2596,47 +2452,47 @@ CONTAINS END FUNCTION h5tenum_nameof_c END INTERFACE + name(1:LEN(name)) = ' ' + hdferr = h5tenum_nameof_c(type_id, value, name, namelen) END SUBROUTINE h5tenum_nameof_f -!---------------------------------------------------------------------- -! Name: h5tenum_valuof_f ! -! Purpose: Returns the value corresponding to a specified -! member of an enumeration datatype. +!****s* H5T/h5tenum_valuof_f ! -! Inputs: -! type_id - datatype identifier -! name - symbol name -! Outputs: -! value - value of the enumeration datatype -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! NAME +! h5tenum_valuof_f ! -! Programmer: Elena Pourmal -! August 12, 1999 +! PURPOSE +! Returns the value corresponding to a specified +! member of an enumeration datatype. ! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 +! INPUTS +! type_id - datatype identifier +! name - symbol name +! OUTPUTS +! value - value of the enumeration datatype +! hdferr - Returns 0 if successful and -1 if fails ! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5tenum_valueof_f(type_id, name, value, hdferr) +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! +! SOURCE + SUBROUTINE h5tenum_valueof_f(type_id, name, value, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier CHARACTER(LEN=*), INTENT(IN) :: name !Name of the enumeration datatype. INTEGER, INTENT(OUT) :: value !value of the enumeration datatype. INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** INTEGER :: namelen -! INTEGER, EXTERNAL :: h5tenum_valueof_c -! MS FORTRAN needs explicit interface for C functions called here. -! INTERFACE INTEGER FUNCTION h5tenum_valueof_c(type_id, name, namelen, value) USE H5GLOBAL @@ -2655,42 +2511,39 @@ CONTAINS hdferr = h5tenum_valueof_c(type_id, name, namelen, value) END SUBROUTINE h5tenum_valueof_f -!---------------------------------------------------------------------- -! Name: h5tget_member_value_f ! -! Purpose: Returns the value of an enumeration datatype member. +!****s* H5T/h5tget_member_value_f ! -! Inputs: -! type_id - datatype identifier -! member_no - number of the enumeration datatype member -! Outputs: -! value - value of the enumeration datatype -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! NAME +! h5tget_member_value_f ! -! Programmer: Elena Pourmal -! August 12, 1999 +! PURPOSE +! Returns the value of an enumeration datatype member. ! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 +! INPUTS +! type_id - datatype identifier +! member_no - number of the enumeration datatype member +! OUTPUTS +! value - value of the enumeration datatype +! hdferr - Returns 0 if successful and -1 if fails ! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5tget_member_value_f(type_id, member_no, value, hdferr) +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! SOURCE + SUBROUTINE h5tget_member_value_f(type_id, member_no, value, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier INTEGER, INTENT(IN) :: member_no !Number of the enumeration datatype member INTEGER, INTENT(OUT) :: value !value of the enumeration datatype. INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** -! INTEGER, EXTERNAL :: h5tget_member_value_c -! MS FORTRAN needs explicit interface for C functions called here. -! INTERFACE INTEGER FUNCTION h5tget_member_value_c(type_id, member_no, value) USE H5GLOBAL @@ -2706,43 +2559,40 @@ CONTAINS hdferr = h5tget_member_value_c(type_id, member_no, value) END SUBROUTINE h5tget_member_value_f -!---------------------------------------------------------------------- -! Name: h5tset_tag_f ! -! Purpose: Tags an opaque datatype. +!****s* H5T/h5tset_tag_f ! -! Inputs: -! type_id - identifier for opaque datatype -! tag - unique ASCII string with which the opaque -! datatype is to be tagged. -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! NAME +! h5tset_tag_f ! -! Programmer: Elena Pourmal -! August 12, 1999 +! PURPOSE +! Tags an opaque datatype. ! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 +! INPUTS +! type_id - identifier for opaque datatype +! tag - unique ASCII string with which the opaque +! datatype is to be tagged. +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails ! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5tset_tag_f(type_id, tag, hdferr) +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! SOURCE + SUBROUTINE h5tset_tag_f(type_id, tag, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier CHARACTER(LEN=*), INTENT(IN) :: tag !Unique ASCII string with which !the opaque datatype is to be tagged INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** INTEGER :: taglen -! INTEGER, EXTERNAL :: h5tset_tag_c -! MS FORTRAN needs explicit interface for C functions called here. -! INTERFACE INTEGER FUNCTION h5tset_tag_c(type_id, tag, taglen) USE H5GLOBAL @@ -2760,45 +2610,42 @@ CONTAINS hdferr = h5tset_tag_c(type_id, tag, taglen) END SUBROUTINE h5tset_tag_f -!---------------------------------------------------------------------- -! Name: h5tget_tag_f ! -! Purpose: Gets the tag associated with an opaque datatype. +!****s* H5T/h5tget_tag_f ! -! Inputs: -! type_id - identifier for opaque datatype -! Outputs: -! tag - unique ASCII string associated with opaque -! datatype -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! NAME +! h5tget_tag_f ! -! Programmer: Elena Pourmal -! August 12, 1999 +! PURPOSE +! Gets the tag associated with an opaque datatype. ! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). March 7, 2001 +! INPUTS +! type_id - identifier for opaque datatype +! OUTPUTS +! tag - unique ASCII string associated with opaque +! datatype +! hdferr - Returns 0 if successful and -1 if fails ! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5tget_tag_f(type_id, tag,taglen, hdferr) +! AUTHOR +! Elena Pourmal +! August 12, 1999 +! +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). March 7, 2001 +! SOURCE + SUBROUTINE h5tget_tag_f(type_id, tag,taglen, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier - CHARACTER(LEN=*), INTENT(OUT) :: tag !Unique ASCII string with which - !the opaque datatype is to be tagged - INTEGER, INTENT(OUT) :: taglen !length of tag + CHARACTER(LEN=*), INTENT(OUT) :: tag ! Unique ASCII string with which + ! the opaque datatype is to be tagged + INTEGER, INTENT(OUT) :: taglen ! Length of tag + INTEGER(SIZE_T) :: tag_size ! Declared character length of tab INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5tget_tag_c -! MS FORTRAN needs explicit interface for C functions called here. -! +!***** INTERFACE - INTEGER FUNCTION h5tget_tag_c(type_id, tag, taglen) + INTEGER FUNCTION h5tget_tag_c(type_id, tag, tag_size, taglen) USE H5GLOBAL !DEC$IF DEFINED(HDF5F90_WINDOWS) !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TGET_TAG_C'::h5tget_tag_c @@ -2806,42 +2653,45 @@ CONTAINS !DEC$ATTRIBUTES reference :: tag INTEGER(HID_T), INTENT(IN) :: type_id CHARACTER(LEN=*), INTENT(OUT) :: tag + INTEGER(SIZE_T), INTENT(IN) :: tag_size INTEGER, INTENT(OUT) :: taglen END FUNCTION h5tget_tag_c END INTERFACE - hdferr = h5tget_tag_c(type_id, tag, taglen) + tag_size = LEN(tag) + + hdferr = h5tget_tag_c(type_id, tag, tag_size, taglen ) END SUBROUTINE h5tget_tag_f -!---------------------------------------------------------------------- -! Name: h5tvlen_create_f ! -! Purpose: Creates a new variable-length datatype. +!****s* H5T/h5tvlen_create_f ! -! Inputs: -! type_id - identifier iof base datatype -! Outputs: -! vltype_id - identifier for VL datatype -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! NAME +! h5tvlen_create_f ! -! Programmer: Elena Pourmal -! Wednesday, October 23, 2002 +! PURPOSE +! Creates a new variable-length datatype. ! -! Modifications: +! INPUTS +! type_id - identifier iof base datatype +! OUTPUTS +! vltype_id - identifier for VL datatype +! hdferr - Returns 0 if successful and -1 if fails ! -! Comment: Only basic Fortran base datatypes are supported -!---------------------------------------------------------------------- - - SUBROUTINE h5tvlen_create_f(type_id, vltype_id, hdferr) +! AUTHOR +! Elena Pourmal +! Wednesday, October 23, 2002 +! +! NOTES +! Only basic Fortran base datatypes are supported +! +! SOURCE + SUBROUTINE h5tvlen_create_f(type_id, vltype_id, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier INTEGER(HID_T), INTENT(OUT) :: vltype_id ! VL datatype identifier INTEGER, INTENT(OUT) :: hdferr ! Error code - +!***** INTERFACE INTEGER FUNCTION h5tvlen_create_c(type_id, vltype_id) USE H5GLOBAL @@ -2856,42 +2706,37 @@ CONTAINS hdferr = h5tvlen_create_c(type_id, vltype_id) END SUBROUTINE h5tvlen_create_f -!---------------------------------------------------------------------- -! Name: h5tis_variable_str_f ! -! Purpose: Determines whether a dattype is a variable string. +!****s* H5T/h5tis_variable_str_f ! -! Inputs: -! type_id - - datartpe identifier -! Outputs: -! status - flag to indicate if datatype -! is a variable string -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! NAME +! h5tis_variable_str_f ! -! Programmer: Elena Pourmal -! March 12, 2003 +! PURPOSE +! Determines whether a dattype is a variable string. ! -! Modifications: +! INPUTS +! type_id - datartpe identifier +! OUTPUTS +! status - flag to indicate if datatype +! is a variable string +! hdferr - Returns 0 if successful and -1 if fails ! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5tis_variable_str_f(type_id, status, hdferr) +! AUTHOR +! Elena Pourmal +! March 12, 2003 +! +! SOURCE + SUBROUTINE h5tis_variable_str_f(type_id, status, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier LOGICAL, INTENT(OUT) :: status ! Flag, idicates if datatype ! is a variable string or not ( TRUE or ! FALSE) INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** INTEGER :: flag ! "TRUE/FALSE/ERROR from C" -! INTEGER, EXTERNAL :: h5tis_variable_str_c -! MS FORTRAN needs explicit interface for C functions called here. -! INTERFACE INTEGER FUNCTION h5tis_variable_str_c(type_id, flag) USE H5GLOBAL @@ -2909,52 +2754,47 @@ CONTAINS END SUBROUTINE h5tis_variable_str_f -!---------------------------------------------------------------------- -! Name: h5tget_member_class_f -! -! Purpose: Returns datatype class of compound datatype member. -! -! Inputs: -! type_id - - datartpe identifier -! member_no - index of compound datatype member -! Outputs: -! class - class type for compound dadtype member -! Can be one of the follwoing classes: -! H5T_NO_CLASS_F (error) -! H5T_INTEGER_F -! H5T_FLOAT_F -! H5T_TIME_F -! H5T_STRING_F -! H5T_BITFIELD_F -! H5T_OPAQUE_F -! H5T_COMPOUND_F -! H5T_REFERENCE_F -! H5T_ENUM_F -! H5T_VLEN_F -! H5T_ARRAY_F -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! April 6, 2005 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - - SUBROUTINE h5tget_member_class_f(type_id, member_no, class, hdferr) +! +!****s* H5T/h5tget_member_class_f +! +! NAME +! h5tget_member_class_f +! +! PURPOSE +! Returns datatype class of compound datatype member. +! +! INPUTS +! type_id - datartpe identifier +! member_no - index of compound datatype member +! OUTPUTS +! class - class type for compound dadtype member +! Valid classes: +! H5T_NO_CLASS_F (error) +! H5T_INTEGER_F +! H5T_FLOAT_F +! H5T_TIME_F +! H5T_STRING_F +! H5T_BITFIELD_F +! H5T_OPAQUE_F +! H5T_COMPOUND_F +! H5T_REFERENCE_F +! H5T_ENUM_F +! H5T_VLEN_F +! H5T_ARRAY_F +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! April 6, 2005 +! +! SOURCE + SUBROUTINE h5tget_member_class_f(type_id, member_no, class, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier INTEGER, INTENT(IN) :: member_no ! Member number INTEGER, INTENT(OUT) :: class ! Member class INTEGER, INTENT(OUT) :: hdferr ! Error code - -! MS FORTRAN needs explicit interface for C functions called here. -! +!***** INTERFACE INTEGER FUNCTION h5tget_member_class_c(type_id, member_no, class) USE H5GLOBAL @@ -2971,36 +2811,35 @@ CONTAINS END SUBROUTINE h5tget_member_class_f -!---------------------------------------------------------------------- -! Name: h5tcommit_anon_f ! -! Purpose: Commits a transient datatype to a file, -! creating a new named datatype, -! but does not link it into the file structure. +!****s* H5T/h5tcommit_anon_f ! -! Inputs: -! loc_id - A file or group identifier specifying the file -! in which the new named datatype is to be created. -! dtype_id - A datatype identifier. +! NAME +! h5tcommit_anon_f ! -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! tcpl_id - A datatype creation property list identifier. -! (H5P_DEFAULT_F for the default property list.) -! tapl_id - A datatype access property list identifier. -! should always be passed as the value H5P_DEFAULT_F. +! PURPOSE +! Commits a transient datatype to a file, +! creating a new named datatype, +! but does not link it into the file structure. ! -! Programmer: M.S. Breitenfeld -! February 25, 2008 +! INPUTS +! loc_id - A file or group identifier specifying the file +! in which the new named datatype is to be created. +! dtype_id - A datatype identifier. ! -! Modifications: +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails +! OPTIONAL PARAMETERS +! tcpl_id - A datatype creation property list identifier. +! (H5P_DEFAULT_F for the default property list.) +! tapl_id - A datatype access property list identifier. +! should always be passed as the value H5P_DEFAULT_F. ! -! Comment: -!---------------------------------------------------------------------- - +! AUTHOR +! M. Scot Breitenfeld +! February 25, 2008 +! +! SOURCE SUBROUTINE h5tcommit_anon_f(loc_id, dtype_id, hdferr, tcpl_id, tapl_id) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: loc_id ! A file or group identifier specifying @@ -3013,11 +2852,10 @@ CONTAINS ! (H5P_DEFAULT_F for the default property list.) INTEGER(HID_T), OPTIONAL, INTENT(IN) :: tapl_id ! A datatype access property list identifier. ! should always be passed as the value H5P_DEFAULT_F. +!***** INTEGER(HID_T) :: tcpl_id_default INTEGER(HID_T) :: tapl_id_default -! MS FORTRAN needs explicit interface for C functions called here. -! INTERFACE INTEGER FUNCTION h5tcommit_anon_c(loc_id, dtype_id, & tcpl_id_default, tapl_id_default) @@ -3043,41 +2881,36 @@ CONTAINS END SUBROUTINE h5tcommit_anon_f -!---------------------------------------------------------------------- -! Name: h5tcommitted_f ! -! Purpose: Determines whether a datatype is a named type or a transient type. +!****s* H5T/h5tcommitted_f ! -! Inputs: -! dtype_id - A datatype identifier. +! NAME +! h5tcommitted_f ! -! Outputs: -! committed - .TRUE., if the datatype has been committed -! .FALSE., if the datatype has not been committed. -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: None +! PURPOSE +! Determines whether a datatype is a named type or a transient type. ! -! Programmer: M.S. Breitenfeld -! February 25, 2008 +! INPUTS +! dtype_id - A datatype identifier. ! -! Modifications: +! OUTPUTS +! committed - .TRUE., if the datatype has been committed +! .FALSE., if the datatype has not been committed. +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! M. Scot Breitenfeld +! February 25, 2008 ! -! Comment: -!---------------------------------------------------------------------- - +! SOURCE SUBROUTINE h5tcommitted_f(dtype_id, committed, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: dtype_id ! A datatype identifier LOGICAL, INTENT(OUT) :: committed ! .TRUE., if the datatype has been committed !.FALSE., if the datatype has not been committed. INTEGER, INTENT(OUT) :: hdferr ! Error code: -! Success: 0 -! Failure: -1 - -! MS FORTRAN needs explicit interface for C functions called here. -! +! Success: 0 +! Failure: -1 +!***** INTERFACE INTEGER FUNCTION h5tcommitted_c(dtype_id) USE H5GLOBAL @@ -3103,34 +2936,31 @@ CONTAINS END SUBROUTINE h5tcommitted_f -!---------------------------------------------------------------------- -! Name: H5Tdecode_f ! -! Purpose: Decode a binary object description of data type and return a new object handle. -! Inputs: -! buf - Buffer for the data space object to be decoded. -! obj_id - Object ID -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 +!****s* H5T/H5Tdecode_f ! -! Optional parameters: - NONE +! NAME +! H5Tdecode_f ! -! Programmer: M.S. Breitenfeld -! April 9, 2008 +! PURPOSE +! Decode a binary object description of data type and return a new object handle. +! INPUTS +! buf - Buffer for the data space object to be decoded. +! obj_id - Object ID +! OUTPUTS +! hdferr - Returns 0 if successful and -1 if fails ! -! Modifications: +! AUTHOR +! M. Scot Breitenfeld +! April 9, 2008 ! -! Comment: -!---------------------------------------------------------------------- - +! SOURCE SUBROUTINE h5tdecode_f(buf, obj_id, hdferr) IMPLICIT NONE CHARACTER(LEN=*), INTENT(IN) :: buf ! Buffer for the data space object to be decoded. INTEGER(HID_T), INTENT(OUT) :: obj_id ! Object ID INTEGER, INTENT(OUT) :: hdferr ! Error code - +!***** INTERFACE INTEGER FUNCTION h5tdecode_c(buf, obj_id) USE H5GLOBAL @@ -3147,38 +2977,34 @@ CONTAINS END SUBROUTINE h5tdecode_f -!---------------------------------------------------------------------- -! Name: H5Tencode_f -! -! Purpose: Encode a data type object description into a binary buffer. ! -! Inputs: -! obj_id - Identifier of the object to be encoded. -! buf - Buffer for the object to be encoded into. -! nalloc - The size of the allocated buffer. -! Outputs: -! nalloc - The size of the buffer needed. -! hdferr: - error code -! Success: 0 -! Failure: -1 +!****s* H5T/H5Tencode_f ! -! Optional parameters: - NONE +! NAME +! H5Tencode_f ! -! Programmer: M.S. Breitenfeld -! April 9, 2008 +! PURPOSE +! Encode a data type object description into a binary buffer. ! -! Modifications: +! INPUTS +! obj_id - Identifier of the object to be encoded. +! buf - Buffer for the object to be encoded into. +! nalloc - The size of the allocated buffer. +! OUTPUTS +! nalloc - The size of the buffer needed. +! hdferr - Returns 0 if successful and -1 if fails. ! -! Comment: -!---------------------------------------------------------------------- - +! AUTHOR +! M. Scot Breitenfeld +! April 9, 2008 +! SOURCE SUBROUTINE h5tencode_f(obj_id, buf, nalloc, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: obj_id ! Identifier of the object to be encoded. CHARACTER(LEN=*), INTENT(OUT) :: buf ! Buffer for the object to be encoded into. INTEGER(SIZE_T), INTENT(INOUT) :: nalloc ! The size of the allocated buffer. INTEGER, INTENT(OUT) :: hdferr ! Error code - +!***** INTERFACE INTEGER FUNCTION h5tencode_c(buf, obj_id, nalloc) @@ -3197,37 +3023,33 @@ CONTAINS END SUBROUTINE h5tencode_f -!---------------------------------------------------------------------- -! Name: h5tget_create_plist_f ! -! Purpose: Returns a copy of a datatype creation property list. +!****s* H5T/h5tget_create_plist_f ! -! Inputs: -! dtype_id - Datatype identifier -! Outputs: -! dtpl_id - Datatype property list identifier -! hdferr: - Error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! NAME +! h5tget_create_plist_f ! -! Programmer: M.S. Breitenfeld -! April 9, 2008 +! PURPOSE +! Returns a copy of a datatype creation property list. ! -! Modifications: N/A +! INPUTS +! dtype_id - Datatype identifier +! OUTPUTS +! dtpl_id - Datatype property list identifier +! hdferr - Returns 0 if successful and -1 if fails ! -!---------------------------------------------------------------------- - +! AUTHOR +! M. Scot Breitenfeld +! April 9, 2008 +! +! SOURCE SUBROUTINE h5tget_create_plist_f(dtype_id, dtpl_id, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: dtype_id ! Datatype identifier INTEGER(HID_T), INTENT(OUT) :: dtpl_id ! Datatype property list identifier. INTEGER, INTENT(OUT) :: hdferr ! Error code: ! 0 on success and -1 on failure - -! MS FORTRAN needs explicit interface for C functions called here. -! +!***** INTERFACE INTEGER FUNCTION h5tget_create_plist_c(dtype_id, dtpl_id) USE H5GLOBAL @@ -3242,29 +3064,26 @@ CONTAINS hdferr = h5tget_create_plist_c(dtype_id, dtpl_id) END SUBROUTINE h5tget_create_plist_f -!---------------------------------------------------------------------- -! Name: h5tcompiler_conv_f ! -! Purpose: Check whether the library’s default conversion is hard conversion.R +!****s* H5T/h5tcompiler_conv_f ! -! Inputs: -! src_id - Identifier for the source datatype. -! dst_id - Identifier for the destination datatype. -! Outputs: -! flag - TRUE for compiler conversion, FALSE for library conversion -! hdferr: - Error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! NAME +! h5tcompiler_conv_f ! -! Programmer: M.S. Breitenfeld -! April 9, 2008 +! PURPOSE +! Check whether the library’s default conversion is hard conversion.R ! -! Modifications: N/A +! INPUTS +! src_id - Identifier for the source datatype. +! dst_id - Identifier for the destination datatype. +! OUTPUTS +! flag - TRUE for compiler conversion, FALSE for library conversion +! hdferr - Returns 0 if successful and -1 if fails ! -!---------------------------------------------------------------------- - +! AUTHOR +! M. Scot Breitenfeld +! April 9, 2008 +! SOURCE SUBROUTINE h5tcompiler_conv_f( src_id, dst_id, flag, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: src_id ! Identifier for the source datatype. @@ -3272,6 +3091,7 @@ CONTAINS LOGICAL, INTENT(OUT) :: flag ! .TRUE. for compiler conversion, .FALSE. for library conversion INTEGER, INTENT(OUT) :: hdferr ! Error code: ! 0 on success and -1 on failure +!***** INTEGER :: c_flag INTERFACE @@ -3293,35 +3113,31 @@ CONTAINS END SUBROUTINE h5tcompiler_conv_f -!---------------------------------------------------------------------- -! Name: h5tget_native_type_f ! -! Purpose: Returns the native datatype of a specified datatype. +!****s* H5T/h5tget_native_type_f ! -! Inputs: -! dtype_id - Datatype identifier for the dataset datatype. -! * -! direction - Direction of search: -! H5T_DIR_DEFAULT = 0, /*default direction is inscendent */ -! H5T_DIR_ASCEND = 1, /*in inscendent order */ -! H5T_DIR_DESCEND = 2 /*in descendent order */ -! * NOTE: In C it is defined as a structure: H5T_direction_t +! NAME +! h5tget_native_type_f ! -! Outputs: -! native_dtype_id - The native datatype identifier for the specified dataset datatype -! hdferr: - Error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! PURPOSE +! Returns the native datatype of a specified datatype. ! -! Programmer: M.S. Breitenfeld -! June 18, 2008 +! INPUTS +! dtype_id - Datatype identifier for the dataset datatype. +! +! direction - Direction of search: +! H5T_DIR_DEFAULT = 0, /*default direction is inscendent */ +! H5T_DIR_ASCEND = 1, /*in inscendent order */ +! H5T_DIR_DESCEND = 2 /*in descendent order */ +! * NOTE: In C it is defined as a structure: H5T_direction_t ! -! Modifications: N/A -! -!---------------------------------------------------------------------- - +! OUTPUTS +! native_dtype_id - The native datatype identifier for the specified dataset datatype +! hdferr - Returns 0 if successful and -1 if fails +! AUTHOR +! M. Scot Breitenfeld +! June 18, 2008 +! SOURCE SUBROUTINE h5tget_native_type_f(dtype_id, direction, native_dtype_id, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: dtype_id ! Datatype identifier @@ -3331,6 +3147,7 @@ CONTAINS INTEGER(HID_T), INTENT(OUT) :: native_dtype_id ! The native datatype identifier INTEGER, INTENT(OUT) :: hdferr ! Error code: ! 0 on success and -1 on failure +!***** INTERFACE INTEGER FUNCTION h5tget_native_type_c(dtype_id, direction, native_dtype_id) USE H5GLOBAL diff --git a/fortran/src/H5Tff_F03.f90 b/fortran/src/H5Tff_F03.f90 new file mode 100644 index 0000000..902e2ac --- /dev/null +++ b/fortran/src/H5Tff_F03.f90 @@ -0,0 +1,118 @@ +!****h* ROBODoc/H5T (F03) +! +! NAME +! H5T_PROVISIONAL +! +! PURPOSE +! This file contains Fortran 90 and Fortran 2003 interfaces for H5T functions. +! It contains the same functions as H5Tff_F90.f90 but includes the +! Fortran 2003 functions and the interface listings. This file will be compiled +! instead of H5Tff_F90.f90 if Fortran 2003 functions are enabled. +! +! COPYRIGHT +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +! NOTES +! *** IMPORTANT *** +! If you add a new H5T function you must add the function name to the +! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! This is needed for Windows based operating systems. +! +!***** + +MODULE H5T_PROVISIONAL + + USE H5GLOBAL + USE, INTRINSIC :: ISO_C_BINDING + +!****t* H5T (F03)/hvl_t +! Fortran2003 Derived Type: + TYPE hvl_t + INTEGER(size_t) :: len ! Length of VL data (in base type units) + TYPE(C_PTR) :: p ! Pointer to VL data + END TYPE hvl_t + +!***** + +CONTAINS + +!****s* H5T (F03)/H5Tconvert_f_F03 +! +! NAME +! H5Tconvert_f +! +! PURPOSE +! Converts data from between specified datatypes. +! +! Inputs: +! src_id - Identifier for the source datatype. +! dst_id - Identifier for the destination datatype. +! nelmts - Size of array buf. +! buf - Array containing pre-conversion values. +! background - Optional background buffer. +! plist_id - Dataset transfer property list identifier. +! +! Outputs: +! buf - Array containing post-conversion values. +! hdferr - error code: +! 0 on success and -1 on failure +! AUTHOR +! M. Scot Breitenfeld +! Decemember 8, 2008 +! +! Fortran2003 Interface: + SUBROUTINE h5tconvert_f(src_id, dst_id, nelmts, buf, hdferr, background, plist_id) + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + INTEGER(HID_T) , INTENT(IN) :: src_id + INTEGER(HID_T) , INTENT(IN) :: dst_id + INTEGER(SIZE_T), INTENT(IN) :: nelmts + TYPE(C_PTR) , INTENT(INOUT) :: buf + INTEGER , INTENT(OUT) :: hdferr + TYPE(C_PTR) , INTENT(INOUT), OPTIONAL :: background + INTEGER(HID_T) , INTENT(IN) , OPTIONAL :: plist_id +!***** + INTEGER(HID_T) :: plist_id_default + TYPE(C_PTR) :: background_default + + INTERFACE + INTEGER FUNCTION h5tconvert_c(src_id, dst_id, nelmts, buf, background, plist_id) + USE, INTRINSIC :: ISO_C_BINDING + USE H5GLOBAL + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TCONVERT_C'::H5Tconvert_c + !DEC$ENDIF + INTEGER(HID_T) , INTENT(IN) :: src_id + INTEGER(HID_T) , INTENT(IN) :: dst_id + INTEGER(SIZE_T), INTENT(IN) :: nelmts + TYPE(C_PTR) , VALUE :: buf + TYPE(C_PTR) , VALUE :: background + INTEGER(HID_T) , INTENT(IN) :: plist_id + END FUNCTION h5tconvert_c + END INTERFACE + + plist_id_default = H5P_DEFAULT_F + IF(PRESENT(plist_id)) plist_id_default = plist_id + + background_default = C_NULL_PTR + IF(PRESENT(background)) background_default = background + + hdferr = H5Tconvert_c(src_id, dst_id, nelmts, buf, background_default, plist_id_default) + + END SUBROUTINE h5tconvert_f + +END MODULE H5T_PROVISIONAL + diff --git a/fortran/src/H5Tff_F90.f90 b/fortran/src/H5Tff_F90.f90 new file mode 100644 index 0000000..021773d --- /dev/null +++ b/fortran/src/H5Tff_F90.f90 @@ -0,0 +1,39 @@ +!****h* ROBODoc/H5T (F90) +! +! NAME +! MODULE H5T_PROVISIONAL +! +! PURPOSE +! This file contains Fortran 90 interfaces for H5T functions. It contains +! the same functions as H5Tff_F03.f90 but excludes the Fortran 2003 functions +! and the interface listings. This file will be compiled instead of H5Tff_F03.f90 +! if Fortran 2003 functions are not enabled. +! +! NOTE +! Currently contains no functions. +! +! COPYRIGHT +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +! *** IMPORTANT *** +! If you add a new H5D function you must add the function name to the +! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! This is needed for Windows based operating systems. +!***** + +MODULE H5T_PROVISIONAL + +END MODULE H5T_PROVISIONAL diff --git a/fortran/src/H5Zf.c b/fortran/src/H5Zf.c index 8ad53c2..0427c23 100644 --- a/fortran/src/H5Zf.c +++ b/fortran/src/H5Zf.c @@ -1,4 +1,9 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +/****h* H5Zf/H5Zf + * PURPOSE + * This file contains C stubs for H5Z Fortran APIs + * + * COPYRIGHT + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * @@ -11,23 +16,32 @@ * is linked from the top-level documents page. It can also be found at * * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * * access to either file, you may request a copy from help@hdfgroup.org. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -/* This files contains C stubs for H5Z Fortran APIs */ + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * + ****** +*/ #include "H5f90.h" -/*---------------------------------------------------------------------------- - * Name: h5zunregister_c - * Purpose: Call H5Zunregister to unregister filter - * Inputs: filter identifier - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal +/****if* H5Zf/h5zunregister_c + * NAME + * h5zunregister_c + * PURPOSE + * Call H5Zunregister to unregister filter + * INPUTS + * filter identifier + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Wednesday, March 12, 2003 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5zunregister_c (int_f *filter) +/******/ { int ret_value = -1; herr_t status; @@ -44,19 +58,28 @@ nh5zunregister_c (int_f *filter) ret_value = 0; return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5zfiletr_avail_c - * Purpose: Call H5Zfilter_avail to find if filter is available - * Inputs: filter - filter identifier - * Outputs: flag - status flag - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal +/****if* H5Zf/h5zfiletr_avail_c + * NAME + * h5zfiletr_avail_c + * PURPOSE + * Call H5Zfilter_avail to find if filter is available + * INPUTS + * filter - filter identifier + * OUTPUTS + * flag - status flag + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Wednesday, March 12, 2003 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5zfilter_avail_c ( int_f *filter , int_f *flag ) +/******/ { int ret_value = 0; H5Z_filter_t c_filter; @@ -69,20 +92,29 @@ nh5zfilter_avail_c ( int_f *filter , int_f *flag ) return ret_value; } -/*---------------------------------------------------------------------------- - * Name: h5zget_filter_info_c - * Purpose: Call H5Zget_filter_info to find if filter has its encoder +/****if* H5Zf/h5zget_filter_info_c + * NAME + * h5zget_filter_info_c + * PURPOSE + * Call H5Zget_filter_info to find if filter has its encoder * and/or its decoder available - * Inputs: filter - filter identifier - * Outputs: flag - status flag - * Returns: 0 on success, -1 on failure - * Programmer: Nat Furrer and James Laird + * INPUTS + * filter - filter identifier + * OUTPUTS + * flag - status flag + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Nat Furrer and James Laird * Wednesday, June 16, 2004 - * Modifications: - *---------------------------------------------------------------------------*/ + * HISTORY + * + * SOURCE +*/ int_f nh5zget_filter_info_c ( int_f *filter , int_f *flag ) +/******/ { int ret_value = 0; H5Z_filter_t c_filter; diff --git a/fortran/src/H5Zff.f90 b/fortran/src/H5Zff.f90 index 750a7a5..ec68286 100644 --- a/fortran/src/H5Zff.f90 +++ b/fortran/src/H5Zff.f90 @@ -1,179 +1,196 @@ -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! Copyright by The HDF Group. * -! Copyright by the Board of Trustees of the University of Illinois. * -! All rights reserved. * -! * -! This file is part of HDF5. The full HDF5 copyright notice, including * -! terms governing use, modification, and redistribution, is contained in * -! the files COPYING and Copyright.html. COPYING can be found at the root * -! of the source code distribution tree; Copyright.html can be found at the * -! root level of an installed copy of the electronic HDF5 document set and * -! is linked from the top-level documents page. It can also be found at * -! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * -! access to either file, you may request a copy from help@hdfgroup.org. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! -! -! This file contains FORTRAN90 interfaces for H5I functions -! - MODULE H5Z - - USE H5GLOBAL - - CONTAINS - -!---------------------------------------------------------------------- -! Name: h5zunregister_f -! -! Purpose: Unregisters specified filetr -! -! Inputs: filter - filter; may have one of the following values: -! H5Z_FILTER_DEFLATE_F -! H5Z_FILTER_SHUFFLE_F -! H5Z_FILTER_FLETCHER32_F -! Outputs: -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! March 12, 2003 -! -! Modifications: -! -! Comment: -!---------------------------------------------------------------------- - SUBROUTINE h5zunregister_f(filter, hdferr) - IMPLICIT NONE - INTEGER, INTENT(IN) :: filter - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5zunregister_c -! Interface is needed for MS FORTRAN -! - 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 - INTEGER, INTENT(IN) :: filter - END FUNCTION h5zunregister_c - END INTERFACE - hdferr = h5zunregister_c (filter) - END SUBROUTINE h5zunregister_f -!---------------------------------------------------------------------- -! Name: h5zfilter_avail_f -! -! Purpose: Queries if filter is available -! -! Inputs: -! filter - filter -! Outputs: -! status - status; .TRUE. if filter is available, -! .FALSE. otherwise -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! March 12, 2003 -! -! Modifications: -! -!---------------------------------------------------------------------- - SUBROUTINE h5zfilter_avail_f(filter, status, hdferr) - IMPLICIT NONE - INTEGER, INTENT(IN) :: filter ! Filter; may be one of the following: - ! H5Z_FILTER_DEFLATE_F - ! H5Z_FILTER_SHUFFLE_F - ! H5Z_FILTER_FLETCHER32_F - LOGICAL, INTENT(OUT) :: status ! Flag, idicates if filter - ! is availble not ( TRUE or - ! FALSE) - INTEGER, INTENT(OUT) :: hdferr ! Error code - INTEGER :: flag ! "TRUE/FALSE/ERROR from C" - -! INTEGER, EXTERNAL :: h5zfilter_avail_c -! MS FORTRAN needs explicit interface for C functions called here. -! - 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 - INTEGER, INTENT(IN) :: filter - INTEGER :: flag - END FUNCTION h5zfilter_avail_c - END INTERFACE - - hdferr = h5zfilter_avail_c(filter, flag) - status = .TRUE. - if (flag .EQ. 0) status = .FALSE. - - END SUBROUTINE h5zfilter_avail_f - -!---------------------------------------------------------------------- -! Name: h5zget_filter_info_f -! -! Purpose: Queries if filter has its encoder and/or decoder -! available -! -! Inputs: -! filter - filter -! Outputs: -! config_flags - Bit vector possibly containing the -! following values: -! H5Z_FILTER_ENCODE_ENABLED_F -! H5Z_FILTER_DECODE_ENABLED_F -! hdferr: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Nat Furrer and James Laird -! June 16, 2004 -! -! Modifications: -! -!---------------------------------------------------------------------- - SUBROUTINE h5zget_filter_info_f(filter, config_flags, hdferr) - IMPLICIT NONE - INTEGER, INTENT(IN) :: filter ! Filter; may be one of the following: - ! H5Z_FILTER_DEFLATE_F - ! H5Z_FILTER_SHUFFLE_F - ! H5Z_FILTER_FLETCHER32_F - ! H5Z_FILTER_SZIP_F - INTEGER, INTENT(OUT) :: config_flags! Flag, indicates if filter - ! has its encoder and/or decoder - ! available - INTEGER, INTENT(OUT) :: hdferr ! Error code - -! INTEGER, EXTERNAL :: h5zget_filter_info_c -! MS FORTRAN needs explicit interface for C functions called here. -! - 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 - INTEGER, INTENT(IN) :: filter - INTEGER, INTENT(OUT) :: config_flags - END FUNCTION h5zget_filter_info_c - END INTERFACE - - hdferr = h5zget_filter_info_c(filter, config_flags) - - END SUBROUTINE h5zget_filter_info_f - - END MODULE H5Z +!****h* ROBODoc/H5Z +! +! NAME +! MODULE H5Z +! +! PURPOSE +! This file contains Fortran interfaces for H5Z functions. It includes +! all the functions that are independent on whether the Fortran 2003 functions +! are enabled or disabled. +! +! +! COPYRIGHT +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +! NOTES +! *** IMPORTANT *** +! If you add a new H5Z function you must add the function name to the +! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! This is needed for Windows based operating systems. +! +!***** + +MODULE H5Z + + USE H5GLOBAL + +CONTAINS + +!****s* H5Z/h5zunregister_f +! +! NAME +! h5zunregister_f +! +! PURPOSE +! Unregisters specified filetr +! +! INPUTS +! filter - filter; may have one of the following values: +! H5Z_FILTER_DEFLATE_F +! H5Z_FILTER_SZIP_F +! H5Z_FILTER_NBIT_F +! H5Z_FILTER_SCALEOFFSET_F +! H5Z_FILTER_SHUFFLE_F +! H5Z_FILTER_FLETCHER32_F +! +! OUTPUTS +! hdferr - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! March 12, 2003 +! +! SOURCE + SUBROUTINE h5zunregister_f(filter, hdferr) + IMPLICIT NONE + INTEGER, INTENT(IN) :: filter + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + 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 + INTEGER, INTENT(IN) :: filter + END FUNCTION h5zunregister_c + END INTERFACE + hdferr = h5zunregister_c (filter) + END SUBROUTINE h5zunregister_f + +!****s* H5Z/h5zfilter_avail_f +! NAME +! h5zfilter_avail_f +! +! PURPOSE +! Queries if filter is available +! +! INPUTS +! filter - filter +! OUTPUTS +! status - status; .TRUE. if filter is available, +! .FALSE. otherwise +! hdferr: - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Elena Pourmal +! March 12, 2003 +! +! SOURCE + SUBROUTINE h5zfilter_avail_f(filter, status, hdferr) + IMPLICIT NONE + INTEGER, INTENT(IN) :: filter ! Filter; may be one of the following: + ! H5Z_FILTER_DEFLATE_F + ! H5Z_FILTER_SZIP_F + ! H5Z_FILTER_NBIT_F + ! H5Z_FILTER_SCALEOFFSET_F + ! H5Z_FILTER_SHUFFLE_F + ! H5Z_FILTER_FLETCHER32_F + LOGICAL, INTENT(OUT) :: status ! Flag, idicates if filter + ! is availble not ( TRUE or + ! FALSE) + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + INTEGER :: flag ! "TRUE/FALSE/ERROR from C" + + 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 + INTEGER, INTENT(IN) :: filter + INTEGER :: flag + END FUNCTION h5zfilter_avail_c + END INTERFACE + + hdferr = h5zfilter_avail_c(filter, flag) + status = .TRUE. + IF (flag .EQ. 0) status = .FALSE. + + END SUBROUTINE h5zfilter_avail_f +!****s* H5Z/h5zget_filter_info_f +! +! NAME +! h5zget_filter_info_f +! +! PURPOSE +! Queries if filter has its encoder and/or decoder +! available +! +! INPUTS +! filter - filter +! OUTPUTS +! config_flags - Bit vector possibly containing the +! following values: +! H5Z_FILTER_ENCODE_ENABLED_F +! H5Z_FILTER_DECODE_ENABLED_F +! hdferr: - error code +! Success: 0 +! Failure: -1 +! +! AUTHOR +! Nat Furrer and James Laird +! June 16, 2004 +! SOURCE + SUBROUTINE h5zget_filter_info_f(filter, config_flags, hdferr) + IMPLICIT NONE + INTEGER, INTENT(IN) :: filter ! Filter; may be one of the following: + ! H5Z_FILTER_DEFLATE_F + ! H5Z_FILTER_SZIP_F + ! H5Z_FILTER_NBIT_F + ! H5Z_FILTER_SCALEOFFSET_F + ! H5Z_FILTER_SHUFFLE_F + ! H5Z_FILTER_FLETCHER32_F + INTEGER, INTENT(OUT) :: config_flags! Flag, indicates if filter + ! has its encoder and/or decoder + ! available + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** + + 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 + INTEGER, INTENT(IN) :: filter + INTEGER, INTENT(OUT) :: config_flags + END FUNCTION h5zget_filter_info_c + END INTERFACE + + hdferr = h5zget_filter_info_c(filter, config_flags) + + END SUBROUTINE h5zget_filter_info_f + +END MODULE H5Z diff --git a/fortran/src/H5_DBLE_InterfaceExclude.f90 b/fortran/src/H5_DBLE_InterfaceExclude.f90 index b3bafa1..2a3e26f 100644 --- a/fortran/src/H5_DBLE_InterfaceExclude.f90 +++ b/fortran/src/H5_DBLE_InterfaceExclude.f90 @@ -29,7 +29,7 @@ ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! AUTHOR -! M.S. Breitenfeld +! M. Scot Breitenfeld ! !***** diff --git a/fortran/src/H5_DBLE_InterfaceInclude.f90 b/fortran/src/H5_DBLE_InterfaceInclude.f90 index 4e7dbfb..11e0a85 100644 --- a/fortran/src/H5_DBLE_InterfaceInclude.f90 +++ b/fortran/src/H5_DBLE_InterfaceInclude.f90 @@ -30,7 +30,7 @@ ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! AUTHOR -! M.S. Breitenfeld +! M. Scot Breitenfeld ! !***** @@ -1609,14 +1609,11 @@ CONTAINS IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier of - ! of fillvalue datatype - ! (in memory) + ! of fillvalue datatype + ! (in memory) DOUBLE PRECISION, INTENT(IN) :: fillvalue ! Fillvalue INTEGER, INTENT(OUT) :: hdferr ! Error code - ! INTEGER, EXTERNAL :: h5pset_fill_value_double_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! INTERFACE INTEGER FUNCTION h5pset_fill_value_double_c(prp_id, type_id, fillvalue) USE H5GLOBAL @@ -1632,20 +1629,16 @@ CONTAINS hdferr = h5pset_fill_value_double_c(prp_id, type_id, fillvalue) END SUBROUTINE h5pset_fill_value_double - SUBROUTINE h5pget_fill_value_double(prp_id, type_id, fillvalue, & hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier INTEGER(HID_T), INTENT(IN) :: type_id ! Datatype identifier of - ! of fillvalue datatype - ! (in memory) + ! of fillvalue datatype + ! (in memory) DOUBLE PRECISION, INTENT(IN) :: fillvalue ! Fillvalue INTEGER, INTENT(OUT) :: hdferr ! Error code - ! INTEGER, EXTERNAL :: h5pget_fill_value_double_c - ! MS FORTRAN needs explicit interface for C functions called here. - ! INTERFACE INTEGER FUNCTION h5pget_fill_value_double_c(prp_id, type_id, fillvalue) USE H5GLOBAL @@ -1661,37 +1654,34 @@ CONTAINS hdferr = h5pget_fill_value_double_c(prp_id, type_id, fillvalue) END SUBROUTINE h5pget_fill_value_double - - !---------------------------------------------------------------------- - ! Name: h5pset_double - ! - ! Purpose: Sets a property list value - ! - ! Inputs: - ! prp_id - iproperty list identifier to modify - ! name - name of property to modify - ! value - value to set property to - ! Outputs: - ! hdferr: - error code - ! Success: 0 - ! Failure: -1 - ! Optional parameters: - ! NONE - ! - ! Programmer: Elena Pourmal - ! October 9, 2002 - ! - ! Modifications: - ! - ! Comment: - !---------------------------------------------------------------------- - +! +!****s* H5P (F90)/h5pset_double +! +! NAME +! h5pset_double +! +! PURPOSE +! Sets a property list value +! +! INPUTS +! prp_id - iproperty list identifier to modify +! name - name of property to modify +! value - value to set property to +! OUTPUTS +! hdferr: - error code +! Success: 0 +! Failure: -1 +! AUTHOR +! Elena Pourmal +! October 9, 2002 +! SOURCE SUBROUTINE h5pset_double(prp_id, name, value, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to modify + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to modify DOUBLE PRECISION, INTENT(IN) :: value ! Property value - INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** INTEGER :: name_len INTERFACE @@ -1712,37 +1702,34 @@ CONTAINS hdferr = h5pset_double_c(prp_id, name , name_len, value) END SUBROUTINE h5pset_double - - !---------------------------------------------------------------------- - ! Name: h5pget_double - ! - ! Purpose: Gets a property list value - ! - ! Inputs: - ! prp_id - iproperty list identifier to modify - ! name - name of property to modify - ! Outputs: - ! value - value of property - ! hdferr: - error code - ! Success: 0 - ! Failure: -1 - ! Optional parameters: - ! NONE - ! - ! Programmer: Elena Pourmal - ! October 9, 2002 - ! - ! Modifications: - ! - ! Comment: - !---------------------------------------------------------------------- - +!****s* H5P (F90)/h5pget_double +! +! NAME +! h5pget_double +! +! PURPOSE +! Gets a property list value +! +! INPUTS +! prp_id - iproperty list identifier to modify +! name - name of property to modify +! OUTPUTS +! value - value of property +! hdferr - error code +! Success: 0 +! Failure: -1 +! AUTHOR +! Elena Pourmal +! October 9, 2002 +! +! SOURCE SUBROUTINE h5pget_double(prp_id, name, value, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to modify + INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to modify DOUBLE PRECISION, INTENT(OUT) :: value ! Property value - INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** INTEGER :: name_len INTERFACE @@ -1763,41 +1750,39 @@ CONTAINS hdferr = h5pget_double_c(prp_id, name , name_len, value) END SUBROUTINE h5pget_double - - !---------------------------------------------------------------------- - ! Name: h5pregister_double - ! - ! Purpose: Registers a permanent property with a property list class. - ! - ! Inputs: - ! class - property list class to register - ! permanent property within - ! name - name of property to register - ! size - size of property in bytes - ! value - default value for property in newly - ! created property lists - ! Outputs: - ! hdferr: - error code - ! Success: 0 - ! Failure: -1 - ! Optional parameters: - ! NONE - ! - ! Programmer: Elena Pourmal - ! October 10, 2002 - ! - ! Modifications: - ! - ! Comment: - !---------------------------------------------------------------------- - +! +!****s* H5P (F90)/h5pregister_double +! +! NAME +! h5pregister_double +! +! PURPOSE +! Registers a permanent property with a property list class. +! +! INPUTS +! class - property list class to register +! permanent property within +! name - name of property to register +! size - size of property in bytes +! value - default value for property in newly +! created property lists +! OUTPUTS +! hdferr - error code +! Success: 0 +! Failure: -1 +! AUTHOR +! Elena Pourmal +! October 10, 2002 +! +! SOURCE SUBROUTINE h5pregister_double(class, name, size, value, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: class ! Property list class identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to register - INTEGER(SIZE_T), INTENT(IN) :: size ! size of the property value - DOUBLE PRECISION, INTENT(IN) :: value ! Property value - INTEGER, INTENT(OUT) :: hdferr ! Error code + INTEGER(HID_T), INTENT(IN) :: class ! Property list class identifier + CHARACTER(LEN=*), INTENT(IN) :: name ! Name of property to register + INTEGER(SIZE_T), INTENT(IN) :: size ! Size of the property value + DOUBLE PRECISION, INTENT(IN) :: value ! Property value + INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** INTEGER :: name_len INTERFACE @@ -1819,32 +1804,29 @@ CONTAINS hdferr = h5pregister_double_c(class, name , name_len, size, value) END SUBROUTINE h5pregister_double - !---------------------------------------------------------------------- - ! Name: h5pinsert_double - ! - ! Purpose: Registers a temporary property with a property list class. - ! - ! Inputs: - ! plist - property list identifier - ! permanent property within - ! name - name of property to insert - ! size - size of property in bytes - ! value - initial value for the property - ! Outputs: - ! hdferr: - error code - ! Success: 0 - ! Failure: -1 - ! Optional parameters: - ! NONE - ! - ! Programmer: Elena Pourmal - ! October 10, 2002 - ! - ! Modifications: - ! - ! Comment: - !---------------------------------------------------------------------- - +!****s* H5P (F90)/h5pinsert_double +! +! NAME +! +! h5pinsert_double +! +! PURPOSE +! Registers a temporary property with a property list class. +! +! INPUTS +! plist - property list identifier +! permanent property within +! name - name of property to insert +! size - size of property in bytes +! value - initial value for the property +! OUTPUTS +! hdferr - error code +! Success: 0 +! Failure: -1 +! AUTHOR +! Elena Pourmal +! October 10, 2002 +! SOURCE SUBROUTINE h5pinsert_double(plist, name, size, value, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: plist ! Property list identifier @@ -1852,6 +1834,7 @@ CONTAINS INTEGER(SIZE_T), INTENT(IN) :: size ! Size of the property value DOUBLE PRECISION, INTENT(IN) :: value ! Property value INTEGER, INTENT(OUT) :: hdferr ! Error code +!***** INTEGER :: name_len INTERFACE diff --git a/fortran/src/H5_f.c b/fortran/src/H5_f.c index 12c55af..05b7da0 100644 --- a/fortran/src/H5_f.c +++ b/fortran/src/H5_f.c @@ -1,4 +1,9 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +/****ih* H5_f/H5_f + * PURPOSE + * This file contains C stubs for H5 Fortran APIs + * + * COPYRIGHT + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * @@ -11,36 +16,42 @@ * is linked from the top-level documents page. It can also be found at * * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * * access to either file, you may request a copy from help@hdfgroup.org. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -/* This files contains C stubs for H5 Fortran APIs */ + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * + ****** +*/ #include "H5f90.h" -/*--------------------------------------------------------------------------- - * Name: h5init_types_c - * Purpose: Initialize predefined datatypes in Fortran - * Inputs: types - array with the predefined Native Fortran - * type, its element and length must be the - * same as the types array defined in the - * H5f90global.f90 - * floatingtypes - array with the predefined Floating Fortran - * type, its element and length must be the - * same as the floatingtypes array defined in the - * H5f90global.f90 - * integertypes - array with the predefined Integer Fortran - * type, its element and length must be the - * same as the integertypes array defined in the - * H5f90global.f90 - * Outputs: None - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal - * Tuesday, August 3, 1999 - *---------------------------------------------------------------------------*/ +/****if* H5_f/h5init_types_c + * NAME + * h5init_types_c + * PURPOSE + * Initialize predefined datatypes in Fortran + * INPUTS + * types - array with the predefined Native Fortran + * type, its element and length must be the + * same as the types array defined in the + * H5f90global.f90 + * floatingtypes - array with the predefined Floating Fortran + * type, its element and length must be the + * same as the floatingtypes array defined in the + * H5f90global.f90 + * integertypes - array with the predefined Integer Fortran + * type, its element and length must be the + * same as the integertypes array defined in the + * H5f90global.f90 + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal + * Tuesday, August 3, 1999 + * SOURCE +*/ int_f nh5init_types_c( hid_t_f * types, hid_t_f * floatingtypes, hid_t_f * integertypes ) +/******/ { - int ret_value = -1; hid_t c_type_id; size_t tmp_val; @@ -91,8 +102,6 @@ nh5init_types_c( hid_t_f * types, hid_t_f * floatingtypes, hid_t_f * integertype if(H5Tset_strpad(c_type_id, H5T_STR_SPACEPAD) < 0) return ret_value; types[3] = (hid_t_f)c_type_id; - - /* if ((types[3] = H5Tcopy(H5T_C_S1)) < 0) return ret_value; if(H5Tset_strpad(types[3],H5T_STR_NULLTERM) < 0) return ret_value; @@ -104,7 +113,9 @@ nh5init_types_c( hid_t_f * types, hid_t_f * floatingtypes, hid_t_f * integertype */ if ((types[4] = (hid_t_f)H5Tcopy(H5T_STD_REF_OBJ)) < 0) return ret_value; if ((types[5] = (hid_t_f)H5Tcopy(H5T_STD_REF_DSETREG)) < 0) return ret_value; - + /* + * FIND H5T_NATIVE_INTEGER_1 + */ if (sizeof(int_1_f) == sizeof(char)) { if ((types[6] = (hid_t_f)H5Tcopy(H5T_NATIVE_CHAR)) < 0) return ret_value; } /*end if */ @@ -117,7 +128,9 @@ nh5init_types_c( hid_t_f * types, hid_t_f * floatingtypes, hid_t_f * integertype else if (sizeof(int_1_f) == sizeof(long long)) { if ((types[6] = (hid_t_f)H5Tcopy(H5T_NATIVE_LLONG)) < 0) return ret_value; } /*end else */ - + /* + * FIND H5T_NATIVE_INTEGER_2 + */ if (sizeof(int_2_f) == sizeof(char)) { if ((types[7] = (hid_t_f)H5Tcopy(H5T_NATIVE_CHAR)) < 0) return ret_value; } /*end if */ @@ -130,7 +143,9 @@ nh5init_types_c( hid_t_f * types, hid_t_f * floatingtypes, hid_t_f * integertype else if (sizeof(int_2_f) == sizeof(long long)) { if ((types[7] = (hid_t_f)H5Tcopy(H5T_NATIVE_LLONG)) < 0) return ret_value; } /*end else */ - + /* + * FIND H5T_NATIVE_INTEGER_4 + */ if (sizeof(int_4_f) == sizeof(char)) { if ((types[8] = (hid_t_f)H5Tcopy(H5T_NATIVE_CHAR)) < 0) return ret_value; } /*end if */ @@ -143,7 +158,9 @@ nh5init_types_c( hid_t_f * types, hid_t_f * floatingtypes, hid_t_f * integertype else if (sizeof(int_4_f) == sizeof(long long)) { if ((types[8] = (hid_t_f)H5Tcopy(H5T_NATIVE_LLONG)) < 0) return ret_value; } /*end else */ - + /* + * FIND H5T_NATIVE_INTEGER_8 + */ if (sizeof(int_8_f) == sizeof(char)) { if ((types[9] = (hid_t_f)H5Tcopy(H5T_NATIVE_CHAR)) < 0) return ret_value; } /*end if */ @@ -156,7 +173,9 @@ nh5init_types_c( hid_t_f * types, hid_t_f * floatingtypes, hid_t_f * integertype else if (sizeof(int_8_f) == sizeof(long long)) { if ((types[9] = (hid_t_f)H5Tcopy(H5T_NATIVE_LLONG)) < 0) return ret_value; } /*end else */ - + /* + * FIND H5T_NATIVE_REAL_4 + */ if (sizeof(real_4_f) == sizeof(float)) { if ((types[10] = (hid_t_f)H5Tcopy(H5T_NATIVE_FLOAT)) < 0) return ret_value; } /*end if */ @@ -168,7 +187,9 @@ nh5init_types_c( hid_t_f * types, hid_t_f * floatingtypes, hid_t_f * integertype if ((types[10] = (hid_t_f)H5Tcopy(H5T_NATIVE_LDOUBLE)) < 0) return ret_value; } /*end else */ #endif - + /* + * FIND H5T_NATIVE_REAL_8 + */ if (sizeof(real_8_f) == sizeof(float)) { if ((types[11] = (hid_t_f)H5Tcopy(H5T_NATIVE_FLOAT)) < 0) return ret_value; } /*end if */ @@ -180,7 +201,9 @@ nh5init_types_c( hid_t_f * types, hid_t_f * floatingtypes, hid_t_f * integertype if ((types[11] = (hid_t_f)H5Tcopy(H5T_NATIVE_LDOUBLE)) < 0) return ret_value; } /*end else */ #endif - + /* + * FIND H5T_NATIVE_REAL_16 + */ if (sizeof(real_16_f) == sizeof(float)) { if ((types[12] = (hid_t_f)H5Tcopy(H5T_NATIVE_FLOAT)) < 0) return ret_value; } /*end if */ @@ -192,6 +215,13 @@ nh5init_types_c( hid_t_f * types, hid_t_f * floatingtypes, hid_t_f * integertype if ((types[12] = (hid_t_f)H5Tcopy(H5T_NATIVE_LDOUBLE)) < 0) return ret_value; } /*end else */ #endif + /* + * FIND H5T_NATIVE_B_8 + */ + if ((types[13] = (hid_t_f)H5Tcopy(H5T_NATIVE_B8)) < 0) return ret_value; + if ((types[14] = (hid_t_f)H5Tcopy(H5T_NATIVE_B16)) < 0) return ret_value; + if ((types[15] = (hid_t_f)H5Tcopy(H5T_NATIVE_B32)) < 0) return ret_value; + if ((types[16] = (hid_t_f)H5Tcopy(H5T_NATIVE_B64)) < 0) return ret_value; if ((floatingtypes[0] = (hid_t_f)H5Tcopy(H5T_IEEE_F32BE)) < 0) return ret_value; if ((floatingtypes[1] = (hid_t_f)H5Tcopy(H5T_IEEE_F32LE)) < 0) return ret_value; @@ -213,7 +243,18 @@ nh5init_types_c( hid_t_f * types, hid_t_f * floatingtypes, hid_t_f * integertype if ((integertypes[12] = (hid_t_f)H5Tcopy(H5T_STD_U32BE)) < 0) return ret_value; if ((integertypes[13] = (hid_t_f)H5Tcopy(H5T_STD_U32LE)) < 0) return ret_value; if ((integertypes[14] = (hid_t_f)H5Tcopy(H5T_STD_U64BE)) < 0) return ret_value; - if ((integertypes[15] = (hid_t_f)H5Tcopy(H5T_STD_U64LE)) < 0) return ret_value; + if ((integertypes[15] = (hid_t_f)H5Tcopy(H5T_STD_U64LE)) < 0) return ret_value; + if ((integertypes[17] = (hid_t_f)H5Tcopy(H5T_STD_B8BE)) < 0) return ret_value; + if ((integertypes[18] = (hid_t_f)H5Tcopy(H5T_STD_B8LE)) < 0) return ret_value; + if ((integertypes[19] = (hid_t_f)H5Tcopy(H5T_STD_B16BE)) < 0) return ret_value; + if ((integertypes[20] = (hid_t_f)H5Tcopy(H5T_STD_B16LE)) < 0) return ret_value; + if ((integertypes[21] = (hid_t_f)H5Tcopy(H5T_STD_B32BE)) < 0) return ret_value; + if ((integertypes[22] = (hid_t_f)H5Tcopy(H5T_STD_B32LE)) < 0) return ret_value; + if ((integertypes[23] = (hid_t_f)H5Tcopy(H5T_STD_B64BE)) < 0) return ret_value; + if ((integertypes[24] = (hid_t_f)H5Tcopy(H5T_STD_B64LE)) < 0) return ret_value; + if ((integertypes[25] = (hid_t_f)H5Tcopy(H5T_FORTRAN_S1)) < 0) return ret_value; + if ((integertypes[26] = (hid_t_f)H5Tcopy(H5T_C_S1)) < 0) return ret_value; + /* * Define Fortran H5T_STRING type to store non-fixed size strings */ @@ -224,42 +265,46 @@ nh5init_types_c( hid_t_f * types, hid_t_f * floatingtypes, hid_t_f * integertype ret_value = 0; return ret_value; } - -/*--------------------------------------------------------------------------- - * Name: h5close_types_c - * Purpose: Closes predefined datatype in Fortran - * Inputs: types - array with the predefined Native Fortran - * type, its element and length must be the - * same as the types array defined in the - * H5f90global.f90 - * lentypes - length of the types array, which must be the - * same as the length of types array defined - * in the H5f90global.f90 - * floatingtypes - array with the predefined Floating Fortran - * type, its element and length must be the - * same as the floatingtypes array defined in the - * H5f90global.f90 - * floatinglen - length of the floatingtypes array, which must be the - * same as the length of floatingtypes array defined - * in the H5f90global.f90 - * integertypes - array with the predefined Integer Fortran - * type, its element and length must be the - * same as the integertypes array defined in the - * H5f90global.f90 - * integerlen - length of the floatingtypes array, which must be the - * same as the length of floatingtypes array defined - * in the H5f90global.f90 - * Outputs: None - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal - * Tuesday, August 3, 1999 - *---------------------------------------------------------------------------*/ +/****if* H5_f/h5close_types_c + * NAME + * h5close_types_c + * PURPOSE + * Closes predefined datatype in Fortran + * INPUTS + * types - array with the predefined Native Fortran + * type, its element and length must be the + * same as the types array defined in the + * H5f90global.f90 + * lentypes - length of the types array, which must be the + * same as the length of types array defined + * in the H5f90global.f90 + * floatingtypes - array with the predefined Floating Fortran + * type, its element and length must be the + * same as the floatingtypes array defined in the + * H5f90global.f90 + * floatinglen - length of the floatingtypes array, which must be the + * same as the length of floatingtypes array defined + * in the H5f90global.f90 + * integertypes - array with the predefined Integer Fortran + * type, its element and length must be the + * same as the integertypes array defined in the + * H5f90global.f90 + * integerlen - length of the floatingtypes array, which must be the + * same as the length of floatingtypes array defined + * in the H5f90global.f90 + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal + * Tuesday, August 3, 1999 + * SOURCE + */ int_f nh5close_types_c( hid_t_f * types, int_f *lentypes, hid_t_f * floatingtypes, int_f* floatinglen, hid_t_f * integertypes, int_f * integerlen ) +/******/ { - int ret_value = -1; hid_t c_type_id; int i; @@ -279,32 +324,52 @@ nh5close_types_c( hid_t_f * types, int_f *lentypes, ret_value = 0; return ret_value; } -/*--------------------------------------------------------------------------- - * Name: h5init_flags_c - * Purpose: Initialize Fortran flags - * Inputs: h5d_flags - H5D inteface flags - * h5f_flags - H5F interface flags - * h5fd_flags - H5FD interface flags - * h5fd_hid_flags- H5FD interface flags of type hid_t - * h5g_flags - H5G interface flags - * h5i_flags - H5I interface flags - * h5p_flags - H5P interface flags - * h5p_flags_int - H5P intger interface flags - * h5r_flags - H5R interface flags - * h5s_flags - H5S interface flags - * h5t_flags - H5T interface flags - * h5z_flags - H5Z interface flags - * Outputs: None - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal - * Tuesday, August 3, 1999 - *---------------------------------------------------------------------------*/ +/****if* H5_f/h5init_flags_c + * NAME + * h5init_flags_c + * PURPOSE + * Initialize Fortran flags + * INPUTS + * h5d_flags - H5D inteface flags + * h5e_flags - H5E inteface flags + * h5e_hid_flags - H5E inteface flags of type hid_t + * h5f_flags - H5F interface flags + * h5fd_flags - H5FD interface flags + * h5fd_hid_flags - H5FD interface flags of type hid_t + * h5g_flags - H5G interface flags + * h5i_flags - H5I interface flags + * h5p_flags - H5P interface flags + * h5p_flags_int - H5P interface flags of type integer + * h5r_flags - H5R interface flags + * h5s_flags - H5S interface flags + * h5t_flags - H5T interface flags + * h5z_flags - H5Z interface flags + * OUTPUTS + * None + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal + * Tuesday, August 3, 1999 + * HISTORY + * Added Z flags. EIP, March 12, 2003 + * Added more FD flags and new H5LIB flags + * Added more FD flags for HDF5 file driver + * EIP, April 9, 2005 + * Added Generic flags introduced in version 1.8 + * MSB, January, 2008 + * Added types in lines h5*_flags = ( )variable to match input + * Added E flags. + * MSB, July 9, 2009 + * SOURCE + */ int_f -nh5init_flags_c( int_f *h5d_flags, int_f *h5f_flags, +nh5init_flags_c( int_f *h5d_flags, int_f *h5e_flags, hid_t_f *h5e_hid_flags, int_f *h5f_flags, int_f *h5fd_flags, hid_t_f *h5fd_hid_flags, int_f *h5g_flags, int_f *h5i_flags, int_f *h5l_flags, int_f *h5o_flags, hid_t_f *h5p_flags, int_f *h5p_flags_int, int_f *h5r_flags, int_f *h5s_flags, int_f *h5t_flags, int_f *h5z_flags, int_f *h5_generic_flags) +/******/ { int ret_value = -1; /* @@ -334,6 +399,15 @@ nh5init_flags_c( int_f *h5d_flags, int_f *h5f_flags, h5d_flags[21] = (int_f)H5D_CHUNK_CACHE_W0_DEFAULT; /* + * H5E flags + */ + h5e_hid_flags[0] = (hid_t_f)H5E_DEFAULT; + h5e_flags[0] = (int_f)H5E_MAJOR; + h5e_flags[1] = (int_f)H5E_MINOR; + h5e_flags[2] = (int_f)H5E_WALK_UPWARD; + h5e_flags[3] = (int_f)H5E_WALK_DOWNWARD; + +/* * H5F flags */ h5f_flags[0] = (int_f)H5F_ACC_RDWR; @@ -354,6 +428,7 @@ nh5init_flags_c( int_f *h5d_flags, int_f *h5f_flags, h5f_flags[15] = (int_f)H5F_OBJ_ALL; h5f_flags[16] = (int_f)H5F_LIBVER_EARLIEST; h5f_flags[17] = (int_f)H5F_LIBVER_LATEST; + h5f_flags[18] = (int_f)H5F_UNLIMITED; /* * H5FD flags @@ -533,8 +608,6 @@ nh5init_flags_c( int_f *h5d_flags, int_f *h5f_flags, /* * H5T flags */ - - h5t_flags[0] = (int_f)H5T_NO_CLASS; h5t_flags[1] = (int_f)H5T_INTEGER; h5t_flags[2] = (int_f)H5T_FLOAT; @@ -547,33 +620,33 @@ nh5init_flags_c( int_f *h5d_flags, int_f *h5f_flags, h5t_flags[9] = (int_f)H5T_ENUM; h5t_flags[10] = (int_f)H5T_ORDER_LE; h5t_flags[11] = (int_f)H5T_ORDER_BE; - h5t_flags[12] = (int_f)H5T_ORDER_VAX; - h5t_flags[13] = (int_f)H5T_ORDER_NONE; - h5t_flags[14] = (int_f)H5T_PAD_ZERO; - h5t_flags[15] = (int_f)H5T_PAD_ONE; - h5t_flags[16] = (int_f)H5T_PAD_BACKGROUND; - h5t_flags[17] = (int_f)H5T_PAD_ERROR; - h5t_flags[18] = (int_f)H5T_SGN_NONE; - h5t_flags[19] = (int_f)H5T_SGN_2; - h5t_flags[20] = (int_f)H5T_SGN_ERROR; - h5t_flags[21] = (int_f)H5T_NORM_IMPLIED; - h5t_flags[22] = (int_f)H5T_NORM_MSBSET; - h5t_flags[23] = (int_f)H5T_NORM_NONE; - h5t_flags[24] = (int_f)H5T_CSET_ASCII; - h5t_flags[25] = (int_f)H5T_CSET_UTF8; - h5t_flags[26] = (int_f)H5T_STR_NULLTERM; - h5t_flags[27] = (int_f)H5T_STR_NULLPAD; - h5t_flags[28] = (int_f)H5T_STR_SPACEPAD; - h5t_flags[29] = (int_f)H5T_STR_ERROR; - h5t_flags[30] = (int_f)H5T_VLEN; - h5t_flags[31] = (int_f)H5T_ARRAY; - h5t_flags[32] = (int_f)H5T_DIR_ASCEND; - h5t_flags[33] = (int_f)H5T_DIR_DESCEND; + h5t_flags[12] = (int_f)H5T_ORDER_MIXED; + h5t_flags[13] = (int_f)H5T_ORDER_VAX; + h5t_flags[14] = (int_f)H5T_ORDER_NONE; + h5t_flags[15] = (int_f)H5T_PAD_ZERO; + h5t_flags[16] = (int_f)H5T_PAD_ONE; + h5t_flags[17] = (int_f)H5T_PAD_BACKGROUND; + h5t_flags[18] = (int_f)H5T_PAD_ERROR; + h5t_flags[19] = (int_f)H5T_SGN_NONE; + h5t_flags[20] = (int_f)H5T_SGN_2; + h5t_flags[21] = (int_f)H5T_SGN_ERROR; + h5t_flags[22] = (int_f)H5T_NORM_IMPLIED; + h5t_flags[23] = (int_f)H5T_NORM_MSBSET; + h5t_flags[24] = (int_f)H5T_NORM_NONE; + h5t_flags[25] = (int_f)H5T_CSET_ASCII; + h5t_flags[26] = (int_f)H5T_CSET_UTF8; + h5t_flags[27] = (int_f)H5T_STR_NULLTERM; + h5t_flags[28] = (int_f)H5T_STR_NULLPAD; + h5t_flags[29] = (int_f)H5T_STR_SPACEPAD; + h5t_flags[30] = (int_f)H5T_STR_ERROR; + h5t_flags[31] = (int_f)H5T_VLEN; + h5t_flags[32] = (int_f)H5T_ARRAY; + h5t_flags[33] = (int_f)H5T_DIR_ASCEND; + h5t_flags[34] = (int_f)H5T_DIR_DESCEND; /* * H5Z flags */ - h5z_flags[0] = (int_f)H5Z_FILTER_ERROR; h5z_flags[1] = (int_f)H5Z_FILTER_NONE; h5z_flags[2] = (int_f)H5Z_FILTER_DEFLATE; @@ -588,6 +661,12 @@ nh5init_flags_c( int_f *h5d_flags, int_f *h5f_flags, h5z_flags[11] = (int_f)H5Z_FILTER_CONFIG_ENCODE_ENABLED; h5z_flags[12] = (int_f)H5Z_FILTER_CONFIG_DECODE_ENABLED; h5z_flags[13] = (int_f)H5Z_FILTER_ALL; + h5z_flags[14] = (int_f)H5Z_FILTER_NBIT; + h5z_flags[15] = (int_f)H5Z_FILTER_SCALEOFFSET; + h5z_flags[16] = (int_f)H5Z_SO_FLOAT_DSCALE; + h5z_flags[17] = (int_f)H5Z_SO_FLOAT_ESCALE; + h5z_flags[18] = (int_f)H5Z_SO_INT; + h5z_flags[19] = (int_f)H5Z_SO_INT_MINBITS_DEFAULT; /* * H5A flags */ @@ -619,6 +698,7 @@ nh5init_flags_c( int_f *h5d_flags, int_f *h5f_flags, int_f nh5init1_flags_c(int_f *h5lib_flags) +/******/ { int ret_value = -1; unsigned prm_1 = H5_SZIP_EC_OPTION_MASK; @@ -629,15 +709,22 @@ nh5init1_flags_c(int_f *h5lib_flags) return ret_value; } -/*--------------------------------------------------------------------------- - * Name: h5open_c - * Purpose: Calls H5open call to initialize C HDF5 library - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal - * Friday, November 17, 2000 - *---------------------------------------------------------------------------*/ +/****if* H5_f/h5open_c + * NAME + * h5open_c + * PURPOSE + * Calls H5open call to initialize C HDF5 library + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal + * Friday, November 17, 2000 + * + * SOURCE + */ int_f nh5open_c(void) +/******/ { int ret_value = -1; @@ -645,16 +732,20 @@ nh5open_c(void) ret_value = 0; return ret_value; } - -/*--------------------------------------------------------------------------- - * Name: h5close_c - * Purpose: Calls H5close call to close C HDF5 library - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal - * Friday, November 17, 2000 - *---------------------------------------------------------------------------*/ +/****if* H5_f/h5close_c + * NAME + * h5close_c + * PURPOSE + * Calls H5close call to close C HDF5 library + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal + * SOURCE + */ int_f nh5close_c(void) +/******/ { int ret_value = -1; @@ -663,22 +754,31 @@ nh5close_c(void) return ret_value; } -/*--------------------------------------------------------------------------- - * Name: h5get_libversion_c - * Purpose: Calls H5get_libversion function +/****if* H5_f/h5get_libversion_c + * NAME + * h5get_libversion_c + * PURPOSE + * Calls H5get_libversion function * to retrieve library version info. - * Inputs: + * INPUTS + * * None - * Outputs: + * OUTPUTS + * * majnum - the major version of the library * minnum - the minor version of the library * relnum - the release version of the library - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Tuesday, September 24, 2002 - *---------------------------------------------------------------------------*/ + * SOURCE + * + */ int_f nh5get_libversion_c(int_f *majnum, int_f *minnum, int_f *relnum) +/******/ { int ret_value = -1; @@ -693,22 +793,30 @@ nh5get_libversion_c(int_f *majnum, int_f *minnum, int_f *relnum) return ret_value; } -/*--------------------------------------------------------------------------- - * Name: h5check_version_c - * Purpose: Calls H5check_version function +/****if* H5_f/h5check_version_c + * NAME + * h5check_version_c + * PURPOSE + * Calls H5check_version function * to verify library version info. - * Inputs: + * INPUTS + * * majnum - the major version of the library * minnum - the minor version of the library * relnum - the release version of the library - * Outputs: + * OUTPUTS + * * None - * Returns: 0 on success, aborts on failure - * Programmer: Elena Pourmal + * RETURNS + * 0 on success, aborts on failure + * AUTHOR + * Elena Pourmal * Tuesday, September 24, 2002 - *---------------------------------------------------------------------------*/ + * SOURCE + */ int_f nh5check_version_c(int_f *majnum, int_f *minnum, int_f *relnum) +/******/ { int ret_value = -1; unsigned c_majnum, c_minnum, c_relnum; @@ -723,15 +831,21 @@ nh5check_version_c(int_f *majnum, int_f *minnum, int_f *relnum) return ret_value; } -/*--------------------------------------------------------------------------- - * Name: h5garbage_collect_c - * Purpose: Calls H5garbage_collect to collect on all free-lists of all types - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal +/****if* H5_f/h5garbage_collect_c + * NAME + * h5garbage_collect_c + * PURPOSE + * Calls H5garbage_collect to collect on all free-lists of all types + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Tuesday, September 24, 2002 - *---------------------------------------------------------------------------*/ + * SOURCE + */ int_f nh5garbage_collect_c(void) +/******/ { int ret_value = -1; @@ -740,15 +854,21 @@ nh5garbage_collect_c(void) return ret_value; } -/*--------------------------------------------------------------------------- - * Name: h5dont_atexit_c - * Purpose: Calls H5dont_atexit not to install atexit cleanup routine - * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal +/****if* H5_f/h5dont_atexit_c + * NAME + * h5dont_atexit_c + * PURPOSE + * Calls H5dont_atexit not to install atexit cleanup routine + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * Elena Pourmal * Tuesday, September 24, 2002 - *---------------------------------------------------------------------------*/ + * SOURCE + */ int_f nh5dont_atexit_c(void) +/******/ { int ret_value = -1; diff --git a/fortran/src/H5_ff.f90 b/fortran/src/H5_ff.f90 index 7dffd0a..dcd1917 100644 --- a/fortran/src/H5_ff.f90 +++ b/fortran/src/H5_ff.f90 @@ -1,3 +1,17 @@ +!****h* ROBODoc/H5LIB +! +! NAME +! MODULE H5LIB +! +! PURPOSE +! This module provides fortran specific helper functions for the HDF library +! +! USES +! H5LIB_PROVISIONAL - This module provides helper functions for Fortran 2003 +! only features. If Fortran 2003 functions are enabled then +! H5_ff_F03.f90 is compiled, else H5_ff_F90.f90, +! which is just a place holder blank module, is compiled. +! COPYRIGHT ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! Copyright by The HDF Group. * ! Copyright by the Board of Trustees of the University of Illinois. * @@ -13,52 +27,53 @@ ! access to either file, you may request a copy from help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! +! NOTES +! *** IMPORTANT *** +! If you add a new function you must add the function name to the +! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! This is needed for Windows based operating systems. +! +!***** + MODULE H5LIB + USE H5LIB_PROVISIONAL ! helper functions for Fortran 2003 features: + ! pre-Fortran 2003 - empty module + ! Forttran 2003 - contains functions + USE H5GLOBAL + CONTAINS -!---------------------------------------------------------------------- -! Name: h5open_f +!****s* H5LIB/h5open_f ! -! Purpose: Initializes the HDF5 library and Fortran90 interface. +! NAME +! h5open_f +! +! PURPOSE +! Initializes HDF5 Fortran interface. ! -! Inputs: ! Outputs: -! error: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! error - Returns 0 if successful and -1 if fails ! -! Programmer: Elena Pourmal -! August 12, 1999 +! AUTHOR +! Elena Pourmal +! August 12, 1999 ! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). February 28, 2001 +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). February 28, 2001 ! -! Comment: -!---------------------------------------------------------------------- +! Removed call to h5open_c since this may cause a problem for an +! application that uses HDF5 library outside HDF5 Fortran APIs. +! October 13, 2011 +! Fortran90 Interface: SUBROUTINE h5open_f(error) USE H5GLOBAL - IMPLICIT NONE INTEGER, INTENT(OUT) :: error - INTEGER :: error_0, error_1, error_2, error_3 -! INTEGER, EXTERNAL :: h5init_types_c -! INTEGER, EXTERNAL :: h5init_flags_c -! INTEGER, EXTERNAL :: h5init1_flags_c -! INTEGER, EXTERNAL :: h5open_c +!***** + INTEGER :: error_1, error_2, error_3 -! -! MS FORTRAN needs explicit interfaces for C functions called here. -! - INTERFACE - INTEGER FUNCTION h5open_c() - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5OPEN_C'::h5open_c - !DEC$ENDIF - END FUNCTION h5open_c - END INTERFACE INTERFACE INTEGER FUNCTION h5init_types_c(p_types, f_types, i_types) USE H5GLOBAL @@ -72,6 +87,8 @@ CONTAINS END INTERFACE INTERFACE INTEGER FUNCTION h5init_flags_c(i_H5D_flags, & + i_H5E_flags, & + i_H5E_hid_flags, & i_H5F_flags, & i_H5FD_flags, & i_H5FD_hid_flags, & @@ -87,9 +104,11 @@ CONTAINS i_H5Z_flags, & i_H5generic_flags) USE H5GLOBAL + INTEGER i_H5D_flags(H5D_FLAGS_LEN) + INTEGER i_H5E_flags(H5E_FLAGS_LEN) + INTEGER(HID_T) i_H5E_hid_flags(H5E_HID_FLAGS_LEN) INTEGER i_H5F_flags(H5F_FLAGS_LEN) INTEGER i_H5G_flags(H5G_FLAGS_LEN) - INTEGER i_H5D_flags(H5D_FLAGS_LEN) INTEGER i_H5FD_flags(H5FD_FLAGS_LEN) INTEGER(HID_T) i_H5FD_hid_flags(H5FD_HID_FLAGS_LEN) INTEGER i_H5I_flags(H5I_FLAGS_LEN) @@ -102,9 +121,9 @@ 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 @@ -116,9 +135,10 @@ CONTAINS !DEC$ENDIF END FUNCTION h5init1_flags_c END INTERFACE - error_0 = h5open_c() error_1 = h5init_types_c(predef_types, floating_types, integer_types) error_2 = h5init_flags_c(H5D_flags, & + H5E_flags, & + H5E_hid_flags, & H5F_flags, & H5FD_flags, & H5FD_hid_flags, & @@ -134,46 +154,39 @@ CONTAINS H5Z_flags, & H5generic_flags) error_3 = h5init1_flags_c(H5LIB_flags ) - error = error_0 + error_1 + error_2 + error_3 + error = error_1 + error_2 + error_3 END SUBROUTINE h5open_f -!---------------------------------------------------------------------- -! Name: h5close_f +!****s* H5LIB/h5close_f ! -! Purpose: Closes the HDF5 library and Fortran90 interface. +! NAME +! h5close_f +! +! PURPOSE +! Closes HDF5 Fortran interface. ! -! Inputs: ! Outputs: -! error: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! error - Returns 0 if successful and -1 if fails ! -! Programmer: Elena Pourmal -! August 12, 1999 +! AUTHOR +! Elena Pourmal +! August 12, 1999 ! -! Modifications: Explicit Fortran interfaces were added for -! called C functions (it is needed for Windows -! port). February 28, 2001 +! HISTORY +! Explicit Fortran interfaces were added for +! called C functions (it is needed for Windows +! port). February 28, 2001 ! -! Comment: -!---------------------------------------------------------------------- - +! Removed call to h5close_c since this may cause a problem for an +! application that uses HDF5 library outside HDF5 Fortran APIs. +! October 13, 2011 +! Fortran90 Interface: SUBROUTINE h5close_f(error) USE H5GLOBAL - IMPLICIT NONE - INTEGER :: error_1, error_2 INTEGER, INTENT(OUT) :: error - ! 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 - END FUNCTION h5close_c - END INTERFACE +!***** + INTEGER :: error_1 INTERFACE INTEGER FUNCTION h5close_types_c(p_types, P_TYPES_LEN, & f_types, F_TYPES_LEN, & @@ -193,38 +206,34 @@ CONTAINS error_1 = h5close_types_c(predef_types, PREDEF_TYPES_LEN, & floating_types, FLOATING_TYPES_LEN, & integer_types, INTEGER_TYPES_LEN ) - error_2 = h5close_c() - error = error_1 + error_2 + error = error_1 END SUBROUTINE h5close_f -!---------------------------------------------------------------------- -! Name: h5get_libversion_f +!****s* H5LIB/h5get_libversion_f ! -! Purpose: Returns the HDF5 LIbrary release number +! NAME +! h5get_libversion_f +! +! PURPOSE +! Returns the HDF5 LIbrary release number ! -! Inputs: ! Outputs: -! majnum: - major version of the library -! minum: - minor version of the library -! relnum: - release version of the library -! error: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE -! -! Programmer: Elena Pourmal -! September 24, 2002 -! -! Comment: -!---------------------------------------------------------------------- - +! majnum - major version of the library +! minum - minor version of the library +! relnum - release version of the library +! error - Returns 0 if successful and -1 if fails +! +! AUTHOR +! Elena Pourmal +! September 24, 2002 +! +! Fortran90 Interface: SUBROUTINE h5get_libversion_f(majnum, minnum, relnum, error) USE H5GLOBAL - IMPLICIT NONE INTEGER, INTENT(OUT) :: majnum, minnum, relnum, error +!***** INTERFACE INTEGER FUNCTION h5get_libversion_c(majnum, minnum, relnum) !DEC$IF DEFINED(HDF5F90_WINDOWS) @@ -238,34 +247,33 @@ CONTAINS END SUBROUTINE h5get_libversion_f -!---------------------------------------------------------------------- -! Name: h5check_version_f +!****s* H5LIB/h5check_version_f ! -! Purpose: Verifies that library versions are consistent. +! NAME +! h5check_version_f +! +! PURPOSE +! Verifies that library versions are consistent. ! ! Inputs: -! majnum: - major version of the library -! minum: - minor version of the library -! relnum: - release version of the library +! majnum - major version of the library +! minum - minor version of the library +! relnum - release version of the library +! ! Outputs: -! error: - error code -! Success: 0 -! Failure: application aborts -! Optional parameters: -! NONE +! error - Returns 0 if successful and -1 if fails ! -! Programmer: Elena Pourmal -! September 24, 2002 +! AUTHOR +! Elena Pourmal +! September 24, 2002 ! -! Comment: -!---------------------------------------------------------------------- - +! Fortran90 Interface: SUBROUTINE h5check_version_f(majnum, minnum, relnum, error) USE H5GLOBAL - IMPLICIT NONE - INTEGER, INTENT(IN) :: majnum, minnum, relnum + INTEGER, INTENT(IN) :: majnum, minnum, relnum INTEGER, INTENT(OUT) :: error +!***** INTERFACE INTEGER FUNCTION h5check_version_c(majnum, minnum, relnum) !DEC$IF DEFINED(HDF5F90_WINDOWS) @@ -278,32 +286,27 @@ CONTAINS error = h5check_version_c(majnum, minnum, relnum) END SUBROUTINE h5check_version_f - -!---------------------------------------------------------------------- -! Name: h5garbage_collect_f +!****s* H5LIB/h5garbage_collect_f ! -! Purpose: Garbage collects on all free-lists of all types. +! NAME +! h5garbage_collect_f ! -! Inputs: -! Outputs: -! error: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! PURPOSE +! Garbage collects on all free-lists of all types. ! -! Programmer: Elena Pourmal -! September 24, 2002 +! Outputs: +! error - Returns 0 if successful and -1 if fails ! +! AUTHOR +! Elena Pourmal +! September 24, 2002 ! -! Comment: -!---------------------------------------------------------------------- - +! Fortran90 Interface: SUBROUTINE h5garbage_collect_f(error) USE H5GLOBAL - IMPLICIT NONE INTEGER, INTENT(OUT) :: error +!***** INTERFACE INTEGER FUNCTION h5garbage_collect_c() !DEC$IF DEFINED(HDF5F90_WINDOWS) @@ -315,32 +318,27 @@ CONTAINS error = h5garbage_collect_c() END SUBROUTINE h5garbage_collect_f - -!---------------------------------------------------------------------- -! Name: h5dont_atexit_f +!****s* H5LIB/h5dont_atexit_f ! -! Purpose: Instructs library not to install atexit cleanup routine. +! NAME +! h5dont_atexit_f ! -! Inputs: -! Outputs: -! error: - error code -! Success: 0 -! Failure: -1 -! Optional parameters: -! NONE +! PURPOSE +! Instructs library not to install atexit cleanup routine. ! -! Programmer: Elena Pourmal -! September 24, 2002 +! Outputs: +! error - Returns 0 if successful and -1 if fails ! +! AUTHOR +! Elena Pourmal +! September 24, 2002 ! -! Comment: -!---------------------------------------------------------------------- - +! Fortran90 Interface: SUBROUTINE h5dont_atexit_f(error) USE H5GLOBAL - IMPLICIT NONE INTEGER, INTENT(OUT) :: error +!***** INTERFACE INTEGER FUNCTION h5dont_atexit_c() !DEC$IF DEFINED(HDF5F90_WINDOWS) @@ -352,4 +350,54 @@ CONTAINS error = h5dont_atexit_c() END SUBROUTINE h5dont_atexit_f + +!****f* H5LIB/h5kind_to_type +! +! NAME +! h5kind_to_type +! +! PURPOSE +! Converts the KIND to the correct HDF type +! +! Inputs: +! kind - Fortran KIND parameter +! flag - Whether KIND is of type INTEGER or REAL: +! H5_INTEGER_KIND - integer +! H5_REAL_KIND - real +! Outputs: +! h5_type - Returns the type +! +! AUTHOR +! M. Scot Breitenfeld +! August 25, 2008 +! +! Fortran90 Interface: + INTEGER(HID_T) FUNCTION h5kind_to_type(kind, flag) RESULT(h5_type) + USE H5GLOBAL + IMPLICIT NONE + INTEGER, INTENT(IN) :: kind + INTEGER, INTENT(IN) :: flag +!***** + IF(flag.EQ.H5_INTEGER_KIND)THEN + IF(kind.EQ.Fortran_INTEGER_1)THEN + h5_type = H5T_NATIVE_INTEGER_1 + ELSE IF(kind.EQ.Fortran_INTEGER_2)THEN + h5_type = H5T_NATIVE_INTEGER_2 + ELSE IF(kind.EQ.Fortran_INTEGER_4)THEN + h5_type = H5T_NATIVE_INTEGER_4 + ELSE IF(kind.EQ.Fortran_INTEGER_8)THEN + h5_type = H5T_NATIVE_INTEGER_8 + ENDIF + ELSE IF(flag.EQ.H5_REAL_KIND)THEN + IF(kind.EQ.Fortran_REAL_4)THEN + h5_type = H5T_NATIVE_REAL_4 + ELSE IF(kind.EQ.Fortran_REAL_8)THEN + h5_type = H5T_NATIVE_REAL_8 + ELSE IF(kind.EQ.Fortran_REAL_16)THEN + h5_type = H5T_NATIVE_REAL_16 + ENDIF + ENDIF + + END FUNCTION h5kind_to_type + END MODULE H5LIB diff --git a/fortran/src/H5_ff_F03.f90 b/fortran/src/H5_ff_F03.f90 new file mode 100644 index 0000000..f3e7098 --- /dev/null +++ b/fortran/src/H5_ff_F03.f90 @@ -0,0 +1,75 @@ +!****h* ROBODoc/H5LIB_PROVISIONAL +! +! NAME +! MODULE H5LIB_PROVISIONAL +! +! PURPOSE +! This file contains helper functions for Fortran 2003 features and is +! only compiled when Fortran 2003 features are enabled, otherwise +! the file H5_ff_F90.f90 is compiled. +! +! COPYRIGHT +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +! NOTES +! *** IMPORTANT *** +! If you add a new function you must add the function name to the +! Windows dll file 'hdf5_fortrandll.def' in the fortran/src directory. +! This is needed for Windows based operating systems. +!***** + +MODULE H5LIB_PROVISIONAL + +CONTAINS +!****f* H5LIB_PROVISIONAL/h5offsetof +! +! NAME +! h5offsetof +! +! PURPOSE +! Computes the offset in memory +! +! Inputs: +! start - starting pointer address +! end - ending pointer address +! +! Outputs: +! offset - offset of a member within the derived type +! +! AUTHOR +! M. Scot Breitenfeld +! Augest 25, 2008 +! +! ACKNOWLEDGEMENTS +! Joe Krahn +! +! Fortran2003 Interface: + FUNCTION h5offsetof(start,end) RESULT(offset) + USE, INTRINSIC :: ISO_C_BINDING + USE H5GLOBAL + IMPLICIT NONE + INTEGER(SIZE_T) :: offset + TYPE(C_PTR), VALUE, INTENT(IN) :: start, end +!***** + INTEGER(C_INTPTR_T) :: int_address_start, int_address_end + int_address_start = TRANSFER(start, int_address_start) + int_address_end = TRANSFER(end , int_address_end ) + + offset = int_address_end - int_address_start + + END FUNCTION h5offsetof + +END MODULE H5LIB_PROVISIONAL diff --git a/fortran/src/H5_ff_F90.f90 b/fortran/src/H5_ff_F90.f90 new file mode 100644 index 0000000..a5d303a --- /dev/null +++ b/fortran/src/H5_ff_F90.f90 @@ -0,0 +1,34 @@ +!****h* ROBODoc/H5LIB_PROVISIONAL (F90) +! +! NAME +! MODULE H5LIB_PROVISIONAL +! +! FILE +! fortran/src/H5_ff_F90.f90 +! +! PURPOSE +! This file is a dummy module for when Fortran 2003 features are not enabled. +! It is compiled in place of H5_ff_F03.f90 and is empty. +! +! COPYRIGHT +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +!***** + +MODULE H5LIB_PROVISIONAL + + +END MODULE H5LIB_PROVISIONAL diff --git a/fortran/src/H5f90global.f90 b/fortran/src/H5f90global.f90 index 05ec366..da7a736 100644 --- a/fortran/src/H5f90global.f90 +++ b/fortran/src/H5f90global.f90 @@ -1,22 +1,25 @@ -!****h* fortran/src/H5f90global.f90 +!****h* ROBODoc/H5GLOBAL ! ! NAME -! H5GLOBAL +! MODULE H5GLOBAL ! -! FUNCTION -! This module is used to pass C stubs for H5 Fortran APIs. The C stubs are -! packed into arrays in H5_f.c and these arrays are then passed to Fortran. -! This module then uses EQUIVALENCE to assign elements of the arrays to -! Fortran equivalent C stubs. +! FILE +! src/fortran/H5f90global.f90 +! +! PURPOSE +! This module is used to pass C stubs for H5 Fortran APIs. The C stubs are +! packed into arrays in H5_f.c and these arrays are then passed to Fortran. +! This module then uses EQUIVALENCE to assign elements of the arrays to +! Fortran equivalent C stubs. ! ! NOTES -! The size of the C arrays in H5_f.c have to match the values of the variables -! declared as PARAMETER, hence if the size of an array in H5_f.c is changed -! then the PARAMETER of that corresponding array in Fortran must also be changed. +! The size of the C arrays in H5_f.c has to match the values of the variables +! declared as PARAMETER, hence if the size of an array in H5_f.c is changed +! then the PARAMETER of that corresponding array in Fortran must also be changed. ! ! USES -! H5FORTRAN_TYPES - This module is generated at run time. See -! H5fortran_types.f90 for further informaton. +! H5FORTRAN_TYPES - This module is generated at run time. See +! ! COPYRIGHT ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! Copyright by The HDF Group. * @@ -61,7 +64,7 @@ MODULE H5GLOBAL INTEGER, DIMENSION(1:REF_REG_BUF_LEN) :: ref END TYPE hdset_reg_ref_t_f - INTEGER, PARAMETER :: PREDEF_TYPES_LEN = 13 ! Do not forget to change this + INTEGER, PARAMETER :: PREDEF_TYPES_LEN = 17 ! Do not forget to change this ! value when new predefined ! datatypes are added @@ -71,7 +74,7 @@ MODULE H5GLOBAL ! Do not forget to change the following line when new predefined ! integer data types are added - INTEGER, PARAMETER :: INTEGER_TYPES_LEN = 17 + INTEGER, PARAMETER :: INTEGER_TYPES_LEN = 27 INTEGER(HID_T) H5T_NATIVE_INTEGER_1, & H5T_NATIVE_INTEGER_2, & @@ -106,7 +109,21 @@ MODULE H5GLOBAL H5T_STD_U32LE, & H5T_STD_U64BE, & H5T_STD_U64LE, & - H5T_STRING + H5T_STRING, & + H5T_STD_B8BE, & + H5T_STD_B8LE, & + H5T_STD_B16BE, & + H5T_STD_B16LE, & + H5T_STD_B32BE, & + H5T_STD_B32LE, & + H5T_STD_B64BE, & + H5T_STD_B64LE, & + H5T_NATIVE_B8, & + H5T_NATIVE_B16, & + H5T_NATIVE_B32, & + H5T_NATIVE_B64, & + H5T_FORTRAN_S1, & + H5T_C_S1 INTEGER(HID_T), DIMENSION(PREDEF_TYPES_LEN) :: predef_types @@ -123,7 +140,10 @@ MODULE H5GLOBAL EQUIVALENCE (predef_types(11), H5T_NATIVE_REAL_4) EQUIVALENCE (predef_types(12), H5T_NATIVE_REAL_8) EQUIVALENCE (predef_types(13), H5T_NATIVE_REAL_16) - + EQUIVALENCE (predef_types(14), H5T_NATIVE_B8 ) + EQUIVALENCE (predef_types(15), H5T_NATIVE_B16) + EQUIVALENCE (predef_types(16), H5T_NATIVE_B32) + EQUIVALENCE (predef_types(17), H5T_NATIVE_B64) INTEGER(HID_T), DIMENSION(FLOATING_TYPES_LEN) :: floating_types EQUIVALENCE (floating_types(1), H5T_IEEE_F32BE ) @@ -149,6 +169,16 @@ MODULE H5GLOBAL EQUIVALENCE (integer_types(15), H5T_STD_U64BE) EQUIVALENCE (integer_types(16), H5T_STD_U64LE) EQUIVALENCE (integer_types(17), H5T_STRING) + EQUIVALENCE (integer_types(18), H5T_STD_B8BE) + EQUIVALENCE (integer_types(19), H5T_STD_B8LE) + EQUIVALENCE (integer_types(20), H5T_STD_B16BE) + EQUIVALENCE (integer_types(21), H5T_STD_B16LE) + EQUIVALENCE (integer_types(22), H5T_STD_B32BE) + EQUIVALENCE (integer_types(23), H5T_STD_B32LE) + EQUIVALENCE (integer_types(24), H5T_STD_B64BE) + EQUIVALENCE (integer_types(25), H5T_STD_B64LE) + EQUIVALENCE (integer_types(26), H5T_FORTRAN_S1) + EQUIVALENCE (integer_types(27), H5T_C_S1) ! COMMON /PREDEFINED_TYPES/ H5T_NATIVE_INTEGER, & @@ -195,7 +225,7 @@ MODULE H5GLOBAL ! Fortran flags ! ! - ! H5F flags (DO NOT FORGET TO UPDATE WHEN NEW FLAGS ARE ADDEDD !) + ! H5F flags (DO NOT FORGET TO UPDATE WHEN NEW FLAGS ARE ADDED !) ! ! H5F flags declaration ! @@ -224,6 +254,7 @@ MODULE H5GLOBAL INTEGER :: H5F_OBJ_ALL_F INTEGER :: H5F_LIBVER_EARLIEST_F INTEGER :: H5F_LIBVER_LATEST_F + INTEGER :: H5F_UNLIMITED_F EQUIVALENCE(H5F_flags(1), H5F_ACC_RDWR_F) EQUIVALENCE(H5F_flags(2), H5F_ACC_RDONLY_F) @@ -243,6 +274,7 @@ MODULE H5GLOBAL EQUIVALENCE(H5F_flags(16), H5F_OBJ_ALL_F) EQUIVALENCE(H5F_flags(17), H5F_LIBVER_EARLIEST_F) EQUIVALENCE(H5F_flags(18), H5F_LIBVER_LATEST_F) + EQUIVALENCE(H5F_flags(19), H5F_UNLIMITED_F) ! ! H5generic flags declaration ! @@ -384,6 +416,32 @@ MODULE H5GLOBAL EQUIVALENCE(H5D_flags(22), H5D_CHUNK_CACHE_W0_DFLT_F) ! + ! H5E flags declaration + ! + INTEGER, PARAMETER :: H5E_FLAGS_LEN = 4 + INTEGER H5E_flags(H5E_FLAGS_LEN) + INTEGER, PARAMETER :: H5E_HID_FLAGS_LEN = 1 + INTEGER(HID_T) H5E_hid_flags(H5E_HID_FLAGS_LEN) + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: /H5E_FLAGS/ + !DEC$ATTRIBUTES DLLEXPORT :: /H5E_HID_FLAGS/ + !DEC$endif + COMMON /H5E_FLAGS/ H5E_flags + COMMON /H5E_HID_FLAGS/ H5E_hid_flags + + INTEGER(HID_T) :: H5E_DEFAULT_F + INTEGER :: H5E_MAJOR_F + INTEGER :: H5E_MINOR_F + INTEGER :: H5E_WALK_UPWARD_F + INTEGER :: H5E_WALK_DOWNWARD_F + + EQUIVALENCE(H5E_hid_flags(1), H5E_DEFAULT_F) + EQUIVALENCE(H5E_flags(1) , H5E_MAJOR_F) + EQUIVALENCE(H5E_flags(2) , H5E_MINOR_F) + EQUIVALENCE(H5E_flags(3) , H5E_WALK_UPWARD_F) + EQUIVALENCE(H5E_flags(4) , H5E_WALK_DOWNWARD_F) + + ! ! H5FD flags declaration ! INTEGER, PARAMETER :: H5FD_FLAGS_LEN = 11 @@ -501,10 +559,10 @@ MODULE H5GLOBAL !DEC$endif COMMON /H5O_FLAGS/ H5O_flags - INTEGER :: H5O_COPY_SHALLOW_HIERARCHY_F ! * THESE VARIABLES DO - INTEGER :: H5O_COPY_EXPAND_SOFT_LINK_F ! NOT MATCH THE C VARIABLE - INTEGER :: H5O_COPY_EXPAND_EXT_LINK_F ! IN ORDER - INTEGER :: H5O_COPY_EXPAND_REFERENCE_F ! TO STAY UNDER THE + INTEGER :: H5O_COPY_SHALLOW_HIERARCHY_F ! *** THESE VARIABLES DO + INTEGER :: H5O_COPY_EXPAND_SOFT_LINK_F ! NOT MATCH THE C VARIABLE + INTEGER :: H5O_COPY_EXPAND_EXT_LINK_F ! IN ORDER + INTEGER :: H5O_COPY_EXPAND_REFERENCE_F ! TO STAY UNDER THE INTEGER :: H5O_COPY_WITHOUT_ATTR_FLAG_F INTEGER :: H5O_COPY_PRESERVE_NULL_FLAG_F INTEGER :: H5O_COPY_ALL_F @@ -518,7 +576,7 @@ MODULE H5GLOBAL INTEGER :: H5O_HDR_CHUNK0_SIZE_F INTEGER :: H5O_HDR_ATTR_CRT_ORDER_TRACK_F ! 32 CHARACTER INTEGER :: H5O_HDR_ATTR_CRT_ORDER_INDEX_F ! VARIABLE - INTEGER :: H5O_HDR_ATTR_STORE_PHASE_CHA_F ! LENGTH * + INTEGER :: H5O_HDR_ATTR_STORE_PHASE_CHA_F ! LENGTH *** INTEGER :: H5O_HDR_STORE_TIMES_F INTEGER :: H5O_HDR_ALL_FLAGS_F INTEGER :: H5O_SHMESG_MAX_NINDEXES_F @@ -682,52 +740,51 @@ MODULE H5GLOBAL EQUIVALENCE(H5S_flags(18), H5S_SEL_POINTS_F) EQUIVALENCE(H5S_flags(19), H5S_SEL_HYPERSLABS_F) EQUIVALENCE(H5S_flags(20), H5S_SEL_ALL_F) - - ! ! H5T flags declaration ! - INTEGER, PARAMETER :: H5T_FLAGS_LEN = 34 + INTEGER, PARAMETER :: H5T_FLAGS_LEN = 35 INTEGER H5T_flags(H5T_FLAGS_LEN) !DEC$if defined(BUILD_HDF5_DLL) !DEC$ATTRIBUTES DLLEXPORT :: /H5T_FLAGS/ !DEC$endif COMMON /H5T_FLAGS/ H5T_flags - INTEGER :: H5T_NO_CLASS_F - INTEGER :: H5T_INTEGER_F - INTEGER :: H5T_FLOAT_F - INTEGER :: H5T_TIME_F - INTEGER :: H5T_STRING_F - INTEGER :: H5T_BITFIELD_F - INTEGER :: H5T_OPAQUE_F - INTEGER :: H5T_COMPOUND_F - INTEGER :: H5T_REFERENCE_F - INTEGER :: H5T_ENUM_F - INTEGER :: H5T_VLEN_F - INTEGER :: H5T_ARRAY_F - INTEGER :: H5T_ORDER_LE_F - INTEGER :: H5T_ORDER_BE_F - INTEGER :: H5T_ORDER_VAX_F - INTEGER :: H5T_ORDER_NONE_F - INTEGER :: H5T_PAD_ZERO_F - INTEGER :: H5T_PAD_ONE_F - INTEGER :: H5T_PAD_BACKGROUND_F - INTEGER :: H5T_PAD_ERROR_F - INTEGER :: H5T_SGN_NONE_F - INTEGER :: H5T_SGN_2_F - INTEGER :: H5T_SGN_ERROR_F - INTEGER :: H5T_NORM_IMPLIED_F - INTEGER :: H5T_NORM_MSBSET_F - INTEGER :: H5T_NORM_NONE_F - INTEGER :: H5T_CSET_ASCII_F - INTEGER :: H5T_CSET_UTF8_F - INTEGER :: H5T_STR_NULLTERM_F - INTEGER :: H5T_STR_NULLPAD_F - INTEGER :: H5T_STR_SPACEPAD_F - INTEGER :: H5T_STR_ERROR_F - INTEGER :: H5T_DIR_ASCEND_F - INTEGER :: H5T_DIR_DESCEND_F + INTEGER :: H5T_NO_CLASS_F + INTEGER :: H5T_INTEGER_F + INTEGER :: H5T_FLOAT_F + INTEGER :: H5T_TIME_F + INTEGER :: H5T_STRING_F + INTEGER :: H5T_BITFIELD_F + INTEGER :: H5T_OPAQUE_F + INTEGER :: H5T_COMPOUND_F + INTEGER :: H5T_REFERENCE_F + INTEGER :: H5T_ENUM_F + INTEGER :: H5T_VLEN_F + INTEGER :: H5T_ARRAY_F + INTEGER :: H5T_ORDER_LE_F + INTEGER :: H5T_ORDER_BE_F + INTEGER :: H5T_ORDER_VAX_F + INTEGER :: H5T_ORDER_NONE_F + INTEGER :: H5T_ORDER_MIXED_F + INTEGER :: H5T_PAD_ZERO_F + INTEGER :: H5T_PAD_ONE_F + INTEGER :: H5T_PAD_BACKGROUND_F + INTEGER :: H5T_PAD_ERROR_F + INTEGER :: H5T_SGN_NONE_F + INTEGER :: H5T_SGN_2_F + INTEGER :: H5T_SGN_ERROR_F + INTEGER :: H5T_NORM_IMPLIED_F + INTEGER :: H5T_NORM_MSBSET_F + INTEGER :: H5T_NORM_NONE_F + INTEGER :: H5T_CSET_ASCII_F + INTEGER :: H5T_CSET_UTF8_F + INTEGER :: H5T_STR_NULLTERM_F + INTEGER :: H5T_STR_NULLPAD_F + INTEGER :: H5T_STR_SPACEPAD_F + INTEGER :: H5T_STR_ERROR_F + INTEGER :: H5T_DIR_ASCEND_F + INTEGER :: H5T_DIR_DESCEND_F EQUIVALENCE(H5T_flags(1), H5T_NO_CLASS_F) EQUIVALENCE(H5T_flags(2), H5T_INTEGER_F) @@ -741,33 +798,33 @@ MODULE H5GLOBAL EQUIVALENCE(H5T_flags(10), H5T_ENUM_F) EQUIVALENCE(H5T_flags(11), H5T_ORDER_LE_F) EQUIVALENCE(H5T_flags(12), H5T_ORDER_BE_F) - EQUIVALENCE(H5T_flags(13), H5T_ORDER_VAX_F) - EQUIVALENCE(H5T_flags(14), H5T_ORDER_NONE_F) - EQUIVALENCE(H5T_flags(15), H5T_PAD_ZERO_F) - EQUIVALENCE(H5T_flags(16), H5T_PAD_ONE_F) - EQUIVALENCE(H5T_flags(17), H5T_PAD_BACKGROUND_F) - EQUIVALENCE(H5T_flags(18), H5T_PAD_ERROR_F) - EQUIVALENCE(H5T_flags(19), H5T_SGN_NONE_F) - EQUIVALENCE(H5T_flags(20), H5T_SGN_2_F) - EQUIVALENCE(H5T_flags(21), H5T_SGN_ERROR_F) - EQUIVALENCE(H5T_flags(22), H5T_NORM_IMPLIED_F) - EQUIVALENCE(H5T_flags(23), H5T_NORM_MSBSET_F) - EQUIVALENCE(H5T_flags(24), H5T_NORM_NONE_F) - EQUIVALENCE(H5T_flags(25), H5T_CSET_ASCII_F) - EQUIVALENCE(H5T_flags(26), H5T_CSET_UTF8_F) - EQUIVALENCE(H5T_flags(27), H5T_STR_NULLTERM_F) - EQUIVALENCE(H5T_flags(28), H5T_STR_NULLPAD_F) - EQUIVALENCE(H5T_flags(29), H5T_STR_SPACEPAD_F) - EQUIVALENCE(H5T_flags(30), H5T_STR_ERROR_F) - EQUIVALENCE(H5T_flags(31), H5T_VLEN_F) - EQUIVALENCE(H5T_flags(32), H5T_ARRAY_F) - EQUIVALENCE(H5T_flags(33), H5T_DIR_ASCEND_F) - EQUIVALENCE(H5T_flags(34), H5T_DIR_DESCEND_F) - + EQUIVALENCE(H5T_flags(13), H5T_ORDER_MIXED_F) + EQUIVALENCE(H5T_flags(14), H5T_ORDER_VAX_F) + EQUIVALENCE(H5T_flags(15), H5T_ORDER_NONE_F) + EQUIVALENCE(H5T_flags(16), H5T_PAD_ZERO_F) + EQUIVALENCE(H5T_flags(17), H5T_PAD_ONE_F) + EQUIVALENCE(H5T_flags(18), H5T_PAD_BACKGROUND_F) + EQUIVALENCE(H5T_flags(19), H5T_PAD_ERROR_F) + EQUIVALENCE(H5T_flags(20), H5T_SGN_NONE_F) + EQUIVALENCE(H5T_flags(21), H5T_SGN_2_F) + EQUIVALENCE(H5T_flags(22), H5T_SGN_ERROR_F) + EQUIVALENCE(H5T_flags(23), H5T_NORM_IMPLIED_F) + EQUIVALENCE(H5T_flags(24), H5T_NORM_MSBSET_F) + EQUIVALENCE(H5T_flags(25), H5T_NORM_NONE_F) + EQUIVALENCE(H5T_flags(26), H5T_CSET_ASCII_F) + EQUIVALENCE(H5T_flags(27), H5T_CSET_UTF8_F) + EQUIVALENCE(H5T_flags(28), H5T_STR_NULLTERM_F) + EQUIVALENCE(H5T_flags(29), H5T_STR_NULLPAD_F) + EQUIVALENCE(H5T_flags(30), H5T_STR_SPACEPAD_F) + EQUIVALENCE(H5T_flags(31), H5T_STR_ERROR_F) + EQUIVALENCE(H5T_flags(32), H5T_VLEN_F) + EQUIVALENCE(H5T_flags(33), H5T_ARRAY_F) + EQUIVALENCE(H5T_flags(34), H5T_DIR_ASCEND_F) + EQUIVALENCE(H5T_flags(35), H5T_DIR_DESCEND_F) ! ! H5Z flags declaration ! - INTEGER, PARAMETER :: H5Z_FLAGS_LEN = 14 + INTEGER, PARAMETER :: H5Z_FLAGS_LEN = 20 INTEGER H5Z_flags(H5Z_FLAGS_LEN) !DEC$if defined(BUILD_HDF5_DLL) !DEC$ATTRIBUTES DLLEXPORT :: /H5Z_FLAGS/ @@ -788,6 +845,12 @@ MODULE H5GLOBAL INTEGER :: H5Z_FLAG_OPTIONAL_F INTEGER :: H5Z_FILTER_ENCODE_ENABLED_F INTEGER :: H5Z_FILTER_DECODE_ENABLED_F + INTEGER :: H5Z_FILTER_NBIT_F + INTEGER :: H5Z_FILTER_SCALEOFFSET_F + INTEGER :: H5Z_SO_FLOAT_DSCALE_F + INTEGER :: H5Z_SO_FLOAT_ESCALE_F + INTEGER :: H5Z_SO_INT_F + INTEGER :: H5Z_SO_INT_MINBITS_DEFAULT_F EQUIVALENCE(H5Z_flags(1), H5Z_FILTER_ERROR_F) EQUIVALENCE(H5Z_flags(2), H5Z_FILTER_NONE_F) @@ -803,7 +866,12 @@ MODULE H5GLOBAL EQUIVALENCE(H5Z_flags(12), H5Z_FILTER_ENCODE_ENABLED_F) EQUIVALENCE(H5Z_flags(13), H5Z_FILTER_DECODE_ENABLED_F) EQUIVALENCE(H5Z_flags(14), H5Z_FILTER_ALL_F) - + EQUIVALENCE(H5Z_flags(15), H5Z_FILTER_NBIT_F) + EQUIVALENCE(H5Z_flags(16), H5Z_FILTER_SCALEOFFSET_F) + EQUIVALENCE(H5Z_flags(17), H5Z_SO_FLOAT_DSCALE_F) + EQUIVALENCE(H5Z_flags(18), H5Z_SO_FLOAT_ESCALE_F) + EQUIVALENCE(H5Z_flags(19), H5Z_SO_INT_F) + EQUIVALENCE(H5Z_flags(20), H5Z_SO_INT_MINBITS_DEFAULT_F) ! ! H5 Library flags declaration diff --git a/fortran/src/H5f90kit.c b/fortran/src/H5f90kit.c index a809229..059685e 100644 --- a/fortran/src/H5f90kit.c +++ b/fortran/src/H5f90kit.c @@ -1,4 +1,12 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +/****h* H5f90kit/H5f90kit + * PURPOSE + * Routines from HDF4 to deal with C-FORTRAN issues: + * + * HD5f2cstring -- convert a Fortran string to a C string + * HD5packFstring -- convert a C string into a Fortran string + * + * COPYRIGHT + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * @@ -11,39 +19,33 @@ * is linked from the top-level documents page. It can also be found at * * http://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 #include "H5f90.h" - -/* - * Routines from HDF4 to deal with C-FORTRAN issues. - * - * HD5f2cstring -- convert a Fortran string to a C string - * HD5packFstring -- convert a C string into a Fortran string +/****if* H5f90kit/HDf2cstring + * NAME + * HD5f2cstring -- convert a Fortran string to a C string + * char * HDf2cstring(fdesc, len) + * INPUTS + * _fcd fdesc; IN: Fortran string descriptor + * int len; IN: length of Fortran string + * RETURNS + * Pointer to the C string if success, else NULL + * PURPOSE + * Chop off trailing blanks off of a Fortran string and + * move it into a newly allocated C string. It is up + * to the user to free this string. + * SOURCE */ - -/* ----------------------------- HDf2cstring ------------------------------ */ -/* -NAME - HD5f2cstring -- convert a Fortran string to a C string -USAGE - char * HDf2cstring(fdesc, len) - _fcd fdesc; IN: Fortran string descriptor - int len; IN: length of Fortran string -RETURNS - Pointer to the C string if success, else NULL -DESCRIPTION - Chop off trailing blanks off of a Fortran string and - move it into a newly allocated C string. It is up - to the user to free this string. - ----------------------------------------------------------------------------*/ char * HD5f2cstring(_fcd fdesc, size_t len) +/******/ { char *cstr; /* C string to return */ char *str; /* Pointer to FORTRAN string */ @@ -67,28 +69,29 @@ HD5f2cstring(_fcd fdesc, size_t len) return cstr; } /* HD5f2cstring */ -/* ---------------------------- HD5packFstring ----------------------------- */ -/* -NAME - HD5packFstring -- convert a C string into a Fortran string -USAGE - int HD5packFstring(src, dest, len) - char * src; IN: source string - char * dest; OUT: destination - int len; IN: length of string -RETURNS - SUCCEED / FAIL -DESCRIPTION - given a NULL terminated C string 'src' convert it to - a space padded Fortran string 'dest' of length 'len' - - This is very similar to HDc2fstr except that function does - it in place and this one copies. We should probably only - support one of these. - ----------------------------------------------------------------------------*/ +/****if* H5f90kit/HD5packFstring + * NAME + * HD5packFstring -- convert a C string into a Fortran string + * int HD5packFstring(src, dest, len) + * INPUTS + * char * src; IN: source string + * int len; IN: length of string + * OUTPUTS + * char * dest; OUT: destination + * RETURNS + * SUCCEED / FAIL + * PURPOSE + * given a NULL terminated C string 'src' convert it to + * a space padded Fortran string 'dest' of length 'len' + * + * This is very similar to HDc2fstr except that function does + * it in place and this one copies. We should probably only + * support one of these. + * SOURCE + */ void HD5packFstring(char *src, char *dest, size_t dst_len) +/******/ { size_t src_len=HDstrlen(src); @@ -99,5 +102,6 @@ HD5packFstring(char *src, char *dest, size_t dst_len) /* Pad out any remaining space in the FORTRAN string with ' 's */ if(src_len #include @@ -35,11 +47,19 @@ FILE * fort_header; #define CFILE "H5f90i_gen.h" #define FFILE "H5fortran_types.f90" +/* Prototypes for the write routines */ +void writeTypedef(const char* c_type, unsigned int size); +void writeFloatTypedef(const char* c_type, unsigned int size); +void writeTypedefDefault(unsigned int size); +void writeToFiles(const char* fortran_type, const char* c_type, unsigned int size, unsigned int kind); +void writeFloatToFiles(const char* fortran_type, const char* c_type, unsigned int size, unsigned int kind); + static void initCfile(void) { fprintf(c_header, - "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n\ + "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n\ + * Copyright by The HDF Group. *\n\ * Copyright by the Board of Trustees of the University of Illinois. *\n\ * All rights reserved. *\n\ * *\n\ @@ -49,8 +69,8 @@ initCfile(void) * of the source code distribution tree; Copyright.html can be found at the *\n\ * root level of an installed copy of the electronic HDF5 document set and *\n\ * is linked from the top-level documents page. It can also be found at *\n\ - * http://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have *\n\ - * access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. *\n\ + * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *\n\ + * access to either file, you may request a copy from help@hdfgroup.org. *\n\ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */\n\ \n\n\ #ifndef _H5f90i_gen_H\n\ @@ -66,6 +86,7 @@ initFfile(void) { fprintf(fort_header, "! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * \n\ +! Copyright by The HDF Group. *\n\ ! Copyright by the Board of Trustees of the University of Illinois. *\n\ ! All rights reserved. *\n\ ! *\n\ @@ -75,8 +96,8 @@ initFfile(void) ! of the source code distribution tree; Copyright.html can be found at the *\n\ ! root level of an installed copy of the electronic HDF5 document set and *\n\ ! is linked from the top-level documents page. It can also be found at *\n\ -! http://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have *\n\ -! access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. *\n\ +! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *\n\ +! access to either file, you may request a copy from help@hdfgroup.org. *\n\ ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n\ !\n!\n\ ! This file is automatically generated and contains HDF5 Fortran90 type definitions.\n!\n\ @@ -120,38 +141,36 @@ void writeTypedefDefault(unsigned int size) } /* Create matching Fortran and C types by writing to both files */ -void writeToFiles(const char* fortran_type, const char* c_type, unsigned int size) +void writeToFiles(const char* fortran_type, const char* c_type, unsigned int size, unsigned int kind) { - fprintf(fort_header, " INTEGER, PARAMETER :: %s = %u\n", fortran_type, size); + fprintf(fort_header, " INTEGER, PARAMETER :: %s = %u\n", fortran_type, kind); fprintf(c_header, "typedef c_int_%u %s;\n", size, c_type); } /* Create matching Fortran and C floating types by writing to both files */ -void writeFloatToFiles(const char* fortran_type, const char* c_type, unsigned int size) +void writeFloatToFiles(const char* fortran_type, const char* c_type, unsigned int size, unsigned int kind) { - fprintf(fort_header, " INTEGER, PARAMETER :: %s = %u\n", fortran_type, size); + fprintf(fort_header, " INTEGER, PARAMETER :: %s = %u\n", fortran_type, kind); fprintf(c_header, "typedef c_float_%u %s;\n", size, c_type); } -int main() +int main(void) { int FoundIntSize[4]; - int FoundRealSize[4]; + int FoundIntSizeKind[4]; + int FoundRealSize[3]; + int FoundRealSizeKind[3]; int i,j,flag; char chrA[20],chrB[20]; int H5_C_HAS_REAL_NATIVE_16; - int H5_C_HAS_REAL_NATIVE_12; /* Open target files */ c_header = fopen(CFILE, "w"); fort_header = fopen(FFILE, "w"); - -/* Default is C has 16 byte float */ + /* Default is C has 16 byte float */ H5_C_HAS_REAL_NATIVE_16 = 1; -/* Default is C has 12 byte float */ - H5_C_HAS_REAL_NATIVE_12 = 1; /* Write copyright, boilerplate to both files */ initCfile(); @@ -159,7 +178,7 @@ int main() /* First, define c_int_x */ -#if defined H5_FORTRAN_HAS_INTEGER_1 +#if defined H5_FORTRAN_HAS_INTEGER_1_KIND if(sizeof(long long) == 1) writeTypedef("long long", 1); else if(sizeof(long) == 1) @@ -173,9 +192,9 @@ int main() /* Actually, char is not necessarily one byte. * But if char isn't, then nothing is, so this * is as close as we can get. */ -#endif /*H5_FORTRAN_HAS_INTEGER_1 */ +#endif /*H5_FORTRAN_HAS_INTEGER_1_KIND*/ -#if defined H5_FORTRAN_HAS_INTEGER_2 +#if defined H5_FORTRAN_HAS_INTEGER_2_KIND if(sizeof(long long) == 2) writeTypedef("long long", 2); else if(sizeof(long) == 2) @@ -186,9 +205,9 @@ int main() writeTypedef("short", 2); else writeTypedefDefault(2); -#endif /*H5_FORTRAN_HAS_INTEGER_2 */ +#endif /*H5_FORTRAN_HAS_INTEGER_2_KIND*/ -#if defined H5_FORTRAN_HAS_INTEGER_4 +#if defined H5_FORTRAN_HAS_INTEGER_4_KIND if(sizeof(long long) == 4) writeTypedef("long long", 4); else if(sizeof(long) == 4) @@ -199,9 +218,9 @@ int main() writeTypedef("short", 4); else writeTypedefDefault(4); -#endif /*H5_FORTRAN_HAS_INTEGER_4 */ +#endif /*H5_FORTRAN_HAS_INTEGER_4_KIND*/ -#if defined H5_FORTRAN_HAS_INTEGER_8 +#if defined H5_FORTRAN_HAS_INTEGER_8_KIND if(sizeof(long long) == 8) writeTypedef("long long", 8); else if(sizeof(long) == 8) @@ -212,11 +231,11 @@ int main() writeTypedef("short", 8); else writeTypedefDefault(8); -#endif /*H5_FORTRAN_HAS_INTEGER_8 */ +#endif /*H5_FORTRAN_HAS_INTEGER_8_KIND*/ /* Define c_float_x */ -#if defined H5_FORTRAN_HAS_REAL_NATIVE_4 || defined H5_FORTRAN_HAS_REAL_4 +#if defined H5_FORTRAN_HAS_REAL_NATIVE_4_KIND || defined H5_FORTRAN_HAS_REAL_4_KIND if(sizeof(long double) == 4) writeFloatTypedef("long double", 4); else if(sizeof(double) == 4) @@ -228,9 +247,9 @@ int main() printf("Quitting....\n"); return -1; } -#endif /*H5_FORTRAN_HAS_REAL_NATIVE_4*/ +#endif /*H5_FORTRAN_HAS_REAL_NATIVE_4_KIND*/ -#if defined H5_FORTRAN_HAS_REAL_NATIVE_8 || defined H5_FORTRAN_HAS_REAL_8 +#if defined H5_FORTRAN_HAS_REAL_NATIVE_8_KIND || defined H5_FORTRAN_HAS_REAL_8_KIND if(sizeof(long double) == 8) writeFloatTypedef("long double", 8); else if(sizeof(double) == 8) @@ -242,23 +261,9 @@ int main() printf("Quitting....\n"); return -1; } -#endif /*H5_FORTRAN_HAS_REAL_NATIVE_8*/ - -#if defined H5_FORTRAN_HAS_REAL_NATIVE_12 || defined H5_FORTRAN_HAS_REAL_12 - if(sizeof(long double) == 12) - writeFloatTypedef("long double", 12); - else if(sizeof(double) == 12) - writeFloatTypedef("double", 12); - else if(sizeof(float) == 12) - writeFloatTypedef("float", 12); - else /*C has no 12 byte float so disable it in Fortran*/ - { printf("warning: Fortran REAL is 12 bytes, no corresponding C floating type\n"); - printf(" Disabling Fortran 12 byte REALs\n"); - H5_C_HAS_REAL_NATIVE_12 = 0; - } -#endif /*H5_FORTRAN_HAS_REAL_NATIVE_8*/ +#endif /*H5_FORTRAN_HAS_REAL_NATIVE_8_KIND*/ -#if defined H5_FORTRAN_HAS_REAL_NATIVE_16 || defined H5_FORTRAN_HAS_REAL_16 +#if defined H5_FORTRAN_HAS_REAL_NATIVE_16_KIND || defined H5_FORTRAN_HAS_REAL_16_KIND if(sizeof(long double) == 16) writeFloatTypedef("long double", 16); else if(sizeof(double) == 16) @@ -270,47 +275,47 @@ int main() printf(" Disabling Fortran 16 byte REALs\n"); H5_C_HAS_REAL_NATIVE_16 = 0; } -#endif /*H5_FORTRAN_HAS_REAL_NATIVE_16*/ +#endif /*H5_FORTRAN_HAS_REAL_NATIVE_16_KIND*/ /* Now begin defining fortran types. */ fprintf(c_header, "\n"); /* haddr_t */ -#if defined H5_FORTRAN_HAS_INTEGER_8 && H5_SIZEOF_HADDR_T >= 8 - writeToFiles("HADDR_T", "haddr_t_f", 8); -#elif defined H5_FORTRAN_HAS_INTEGER_4 && H5_SIZEOF_HADDR_T >= 4 - writeToFiles("HADDR_T", "haddr_t_f", 4); -#elif defined H5_FORTRAN_HAS_INTEGER_2 && H5_SIZEOF_HADDR_T >= 2 - writeToFiles("HADDR_T", "haddr_t_f", 2); -#elif defined H5_FORTRAN_HAS_INTEGER_1 && H5_SIZEOF_HADDR_T >= 1 - writeToFiles("HADDR_T", "haddr_t_f", 1); +#if defined H5_FORTRAN_HAS_INTEGER_8_KIND && H5_SIZEOF_HADDR_T >= 8 + writeToFiles("HADDR_T", "haddr_t_f", 8, H5_FORTRAN_HAS_INTEGER_8_KIND); +#elif defined H5_FORTRAN_HAS_INTEGER_4_KIND && H5_SIZEOF_HADDR_T >= 4 + writeToFiles("HADDR_T", "haddr_t_f", 4, H5_FORTRAN_HAS_INTEGER_4_KIND); +#elif defined H5_FORTRAN_HAS_INTEGER_2_KIND && H5_SIZEOF_HADDR_T >= 2 + writeToFiles("HADDR_T", "haddr_t_f", 2, H5_FORTRAN_HAS_INTEGER_2_KIND); +#elif defined H5_FORTRAN_HAS_INTEGER_1_KIND && H5_SIZEOF_HADDR_T >= 1 + writeToFiles("HADDR_T", "haddr_t_f", 1, H5_FORTRAN_HAS_INTEGER_1_KIND); #else /* Error: couldn't find a size for haddr_t */ return -1; #endif /* hsize_t */ -#if defined H5_FORTRAN_HAS_INTEGER_8 && H5_SIZEOF_HSIZE_T >= 8 - writeToFiles("HSIZE_T", "hsize_t_f", 8); -#elif defined H5_FORTRAN_HAS_INTEGER_4 && H5_SIZEOF_HSIZE_T >= 4 - writeToFiles("HSIZE_T", "hsize_t_f", 4); -#elif defined H5_FORTRAN_HAS_INTEGER_2 && H5_SIZEOF_HSIZE_T >= 2 - writeToFiles("HSIZE_T", "hsize_t_f", 2); -#elif defined H5_FORTRAN_HAS_INTEGER_1 && H5_SIZEOF_HSIZE_T >= 1 - writeToFiles("HSIZE_T", "hsize_t_f", 1); +#if defined H5_FORTRAN_HAS_INTEGER_8_KIND && H5_SIZEOF_HSIZE_T >= 8 + writeToFiles("HSIZE_T", "hsize_t_f", 8, H5_FORTRAN_HAS_INTEGER_8_KIND); +#elif defined H5_FORTRAN_HAS_INTEGER_4_KIND && H5_SIZEOF_HSIZE_T >= 4 + writeToFiles("HSIZE_T", "hsize_t_f", 4, H5_FORTRAN_HAS_INTEGER_4_KIND); +#elif defined H5_FORTRAN_HAS_INTEGER_2_KIND && H5_SIZEOF_HSIZE_T >= 2 + writeToFiles("HSIZE_T", "hsize_t_f", 2, H5_FORTRAN_HAS_INTEGER_2_KIND); +#elif defined H5_FORTRAN_HAS_INTEGER_1_KIND && H5_SIZEOF_HSIZE_T >= 1 + writeToFiles("HSIZE_T", "hsize_t_f", 1, H5_FORTRAN_HAS_INTEGER_1_KIND); #else /* Error: couldn't find a size for hsize_t */ return -1; #endif /* hssize_t */ -#if defined H5_FORTRAN_HAS_INTEGER_8 && H5_SIZEOF_HSSIZE_T >= 8 - writeToFiles("HSSIZE_T", "hssize_t_f", 8); -#elif defined H5_FORTRAN_HAS_INTEGER_4 && H5_SIZEOF_HSSIZE_T >= 4 - writeToFiles("HSSIZE_T", "hssize_t_f", 4); -#elif defined H5_FORTRAN_HAS_INTEGER_2 && H5_SIZEOF_HSSIZE_T >= 2 - writeToFiles("HSSIZE_T", "hssize_t_f", 2); -#elif defined H5_FORTRAN_HAS_INTEGER_1 && H5_SIZEOF_HSSIZE_T >= 1 - writeToFiles("HSSIZE_T", "hssize_t_f", 1); +#if defined H5_FORTRAN_HAS_INTEGER_8_KIND && H5_SIZEOF_HSSIZE_T >= 8 + writeToFiles("HSSIZE_T", "hssize_t_f", 8, H5_FORTRAN_HAS_INTEGER_8_KIND); +#elif defined H5_FORTRAN_HAS_INTEGER_4_KIND && H5_SIZEOF_HSSIZE_T >= 4 + writeToFiles("HSSIZE_T", "hssize_t_f", 4, H5_FORTRAN_HAS_INTEGER_4_KIND); +#elif defined H5_FORTRAN_HAS_INTEGER_2_KIND && H5_SIZEOF_HSSIZE_T >= 2 + writeToFiles("HSSIZE_T", "hssize_t_f", 2, H5_FORTRAN_HAS_INTEGER_2_KIND); +#elif defined H5_FORTRAN_HAS_INTEGER_1_KIND && H5_SIZEOF_HSSIZE_T >= 1 + writeToFiles("HSSIZE_T", "hssize_t_f", 1, H5_FORTRAN_HAS_INTEGER_1_KIND); #else /* Error: couldn't find a size for hssize_t */ return -1; @@ -318,34 +323,33 @@ int main() /* size_t */ -#if defined H5_FORTRAN_HAS_INTEGER_8 && H5_SIZEOF_SIZE_T >= 8 - writeToFiles("SIZE_T", "size_t_f", 8); -#elif defined H5_FORTRAN_HAS_INTEGER_4 && H5_SIZEOF_SIZE_T >= 4 - writeToFiles("SIZE_T", "size_t_f", 4); -#elif defined H5_FORTRAN_HAS_INTEGER_2 && H5_SIZEOF_SIZE_T >= 2 - writeToFiles("SIZE_T", "size_t_f", 2); -#elif defined H5_FORTRAN_HAS_INTEGER_1 && H5_SIZEOF_SIZE_T >= 1 - writeToFiles("SIZE_T", "size_t_f", 1); +#if defined H5_FORTRAN_HAS_INTEGER_8_KIND && H5_SIZEOF_SIZE_T >= 8 + writeToFiles("SIZE_T", "size_t_f", 8, H5_FORTRAN_HAS_INTEGER_8_KIND); +#elif defined H5_FORTRAN_HAS_INTEGER_4_KIND && H5_SIZEOF_SIZE_T >= 4 + writeToFiles("SIZE_T", "size_t_f", 4, H5_FORTRAN_HAS_INTEGER_4_KIND); +#elif defined H5_FORTRAN_HAS_INTEGER_2_KIND && H5_SIZEOF_SIZE_T >= 2 + writeToFiles("SIZE_T", "size_t_f", 2, H5_FORTRAN_HAS_INTEGER_2_KIND); +#elif defined H5_FORTRAN_HAS_INTEGER_1_KIND && H5_SIZEOF_SIZE_T >= 1 + writeToFiles("SIZE_T", "size_t_f", 1, H5_FORTRAN_HAS_INTEGER_1_KIND); #else /* Error: couldn't find a size for size_t */ return -1; #endif /* int */ -#if defined H5_FORTRAN_HAS_NATIVE_8 - writeToFiles("Fortran_INTEGER", "int_f", 8); -#elif defined H5_FORTRAN_HAS_NATIVE_4 - writeToFiles("Fortran_INTEGER", "int_f", 4); -#elif defined H5_FORTRAN_HAS_NATIVE_2 - writeToFiles("Fortran_INTEGER", "int_f", 2); -#elif defined H5_FORTRAN_HAS_NATIVE_1 - writeToFiles("Fortran_INTEGER", "int_f", 1); +#if defined H5_FORTRAN_HAS_NATIVE_8_KIND + writeToFiles("Fortran_INTEGER", "int_f", 8, H5_FORTRAN_HAS_NATIVE_8_KIND); +#elif defined H5_FORTRAN_HAS_NATIVE_4_KIND + writeToFiles("Fortran_INTEGER", "int_f", 4, H5_FORTRAN_HAS_NATIVE_4_KIND); +#elif defined H5_FORTRAN_HAS_NATIVE_2_KIND + writeToFiles("Fortran_INTEGER", "int_f", 2, H5_FORTRAN_HAS_NATIVE_2_KIND); +#elif defined H5_FORTRAN_HAS_NATIVE_1_KIND + writeToFiles("Fortran_INTEGER", "int_f", 1, H5_FORTRAN_HAS_NATIVE_1_KIND); #else /* Error: couldn't find a size for int */ return -1; #endif - /* int_1, int_2, int_4, int_8 */ /* Defined different KINDs of integers: */ @@ -358,17 +362,21 @@ int main() FoundIntSize[2] = -4; FoundIntSize[3] = -8; -#if defined H5_FORTRAN_HAS_INTEGER_1 +#if defined H5_FORTRAN_HAS_INTEGER_1_KIND FoundIntSize[0] = 1; + FoundIntSizeKind[0] = H5_FORTRAN_HAS_INTEGER_1_KIND; #endif -#if defined H5_FORTRAN_HAS_INTEGER_2 +#if defined H5_FORTRAN_HAS_INTEGER_2_KIND FoundIntSize[1] = 2; + FoundIntSizeKind[1] = H5_FORTRAN_HAS_INTEGER_2_KIND; #endif -#if defined H5_FORTRAN_HAS_INTEGER_4 +#if defined H5_FORTRAN_HAS_INTEGER_4_KIND FoundIntSize[2] = 4; + FoundIntSizeKind[2] = H5_FORTRAN_HAS_INTEGER_4_KIND; #endif -#if defined H5_FORTRAN_HAS_INTEGER_8 +#if defined H5_FORTRAN_HAS_INTEGER_8_KIND FoundIntSize[3] = 8; + FoundIntSizeKind[3] = H5_FORTRAN_HAS_INTEGER_8_KIND ; #endif for(i=0;i<4;i++) { @@ -376,7 +384,7 @@ int main() { sprintf(chrA, "Fortran_INTEGER_%d", FoundIntSize[i]); sprintf(chrB, "int_%d_f", FoundIntSize[i]); - writeToFiles(chrA, chrB, FoundIntSize[i]); + writeToFiles(chrA, chrB, FoundIntSize[i], FoundIntSizeKind[i]); } else /* Did not find the integer type */ { @@ -387,7 +395,7 @@ int main() { sprintf(chrA, "Fortran_INTEGER_%d", (-1)*FoundIntSize[i]); sprintf(chrB, "int_%d_f", (-1)*FoundIntSize[i]); - writeToFiles(chrA, chrB, FoundIntSize[j]); + writeToFiles(chrA, chrB, FoundIntSize[j], FoundIntSizeKind[j]); flag = 1; break; } @@ -400,7 +408,7 @@ int main() { sprintf(chrA, "Fortran_INTEGER_%d", (-1)*FoundIntSize[i]); sprintf(chrB, "int_%d_f", (-1)*FoundIntSize[i]); - writeToFiles(chrA, chrB, FoundIntSize[j]); + writeToFiles(chrA, chrB, FoundIntSize[j], FoundIntSizeKind[j]); flag = 1; break; } @@ -413,7 +421,7 @@ int main() } } - /* real_4, real_8, real_12, real_16 */ + /* real_4, real_8, real_16 */ /* Defined different KINDs of reals: */ /* if the REAL kind is not available then we assign */ @@ -422,44 +430,42 @@ int main() FoundRealSize[0] = -4; FoundRealSize[1] = -8; - FoundRealSize[2] = -12; - FoundRealSize[3] = -16; + FoundRealSize[2] = -16; -#if defined H5_FORTRAN_HAS_REAL_4 +#if defined H5_FORTRAN_HAS_REAL_4_KIND FoundRealSize[0] = 4; + FoundRealSizeKind[0] = H5_FORTRAN_HAS_REAL_4_KIND; #endif -#if defined H5_FORTRAN_HAS_REAL_8 +#if defined H5_FORTRAN_HAS_REAL_8_KIND FoundRealSize[1] = 8; + FoundRealSizeKind[1] = H5_FORTRAN_HAS_REAL_8_KIND; #endif -#if defined H5_FORTRAN_HAS_REAL_12 - if(H5_C_HAS_REAL_NATIVE_12 != 0) { - FoundRealSize[2] = 12; - } -#endif -#if defined H5_FORTRAN_HAS_REAL_16 + +#if defined H5_FORTRAN_HAS_REAL_16_KIND if(H5_C_HAS_REAL_NATIVE_16 != 0) { - FoundRealSize[3] = 16; + FoundRealSize[2] = 16; + FoundRealSizeKind[2] = H5_FORTRAN_HAS_REAL_16_KIND; } #endif - for(i=0;i<4;i++) { + for(i=0;i<3;i++) { if( FoundRealSize[i] > 0) /* Found the real type */ { sprintf(chrA, "Fortran_REAL_%d", FoundRealSize[i]); sprintf(chrB, "real_%d_f", FoundRealSize[i]); - writeFloatToFiles(chrA, chrB, FoundRealSize[i]); + writeFloatToFiles(chrA, chrB, FoundRealSize[i], FoundRealSizeKind[i]); } else /* Did not find the real type */ { flag = 0; /* flag indicating if found the next highest */ - for(j=i+1;j<4;j++) /* search for next highest */ + for(j=i+1;j<3;j++) /* search for next highest */ { if( FoundRealSize[j] > 0) /* Found the next highest */ { sprintf(chrA, "Fortran_REAL_%d", (-1)*FoundRealSize[i]); sprintf(chrB, "real_%d_f", (-1)*FoundRealSize[i]); if(FoundRealSize[j]>4) { - writeFloatToFiles(chrA, chrB, FoundRealSize[j]); + writeFloatToFiles(chrA, chrB, FoundRealSize[j], FoundRealSizeKind[j]); flag = 1; } /* else { */ @@ -471,14 +477,14 @@ int main() } if(flag == 0) /* No higher one found, so find next lowest */ { - for(j=2;j>-1;j--) /* Search for next lowest */ + for(j=1;j>-1;j--) /* Search for next lowest */ { if( FoundRealSize[j] > 0) /* Found the next lowest */ { sprintf(chrA, "Fortran_REAL_%d", (-1)*FoundRealSize[i]); sprintf(chrB, "real_%d_f", (-1)*FoundRealSize[i]); if(FoundRealSize[j]>4) { - writeFloatToFiles(chrA, chrB, FoundRealSize[j]); + writeFloatToFiles(chrA, chrB, FoundRealSize[j], FoundRealSizeKind[j]); } /* else { */ /* writeFloatToFiles(chrA, chrB, FoundRealSize[j]); */ @@ -496,44 +502,40 @@ int main() } /* hid_t */ -#if defined H5_FORTRAN_HAS_INTEGER_8 && H5_SIZEOF_HID_T >= 8 - writeToFiles("HID_T", "hid_t_f", 8); -#elif defined H5_FORTRAN_HAS_INTEGER_4 && H5_SIZEOF_HID_T >= 4 - writeToFiles("HID_T", "hid_t_f", 4); -#elif defined H5_FORTRAN_HAS_INTEGER_2 && H5_SIZEOF_HID_T >= 2 - writeToFiles("HID_T", "hid_t_f", 2); -#elif defined H5_FORTRAN_HAS_INTEGER_1 && H5_SIZEOF_HID_T >= 1 - writeToFiles("HID_T", "hid_t_f", 1); -#elif defined H5_FORTRAN_HAS_INTEGER_8 && H5_SIZEOF_HID_T >= 4 - writeToFiles("HID_T", "hid_t_f", 8); +#if defined H5_FORTRAN_HAS_INTEGER_8_KIND && H5_SIZEOF_HID_T >= 8 + writeToFiles("HID_T", "hid_t_f", 8, H5_FORTRAN_HAS_INTEGER_8_KIND); +#elif defined H5_FORTRAN_HAS_INTEGER_4_KIND && H5_SIZEOF_HID_T >= 4 + writeToFiles("HID_T", "hid_t_f", 4, H5_FORTRAN_HAS_INTEGER_4_KIND); +#elif defined H5_FORTRAN_HAS_INTEGER_2_KIND && H5_SIZEOF_HID_T >= 2 + writeToFiles("HID_T", "hid_t_f", 2, H5_FORTRAN_HAS_INTEGER_2_KIND); +#elif defined H5_FORTRAN_HAS_INTEGER_1_KIND && H5_SIZEOF_HID_T >= 1 + writeToFiles("HID_T", "hid_t_f", 1, H5_FORTRAN_HAS_INTEGER_1_KIND); +#elif defined H5_FORTRAN_HAS_INTEGER_8_KIND && H5_SIZEOF_HID_T >= 4 + writeToFiles("HID_T", "hid_t_f", 8, H5_FORTRAN_HAS_INTEGER_8_KIND); #else /* Error: couldn't find a size for hid_t */ return -1; #endif /* real_f */ -#if defined H5_FORTRAN_HAS_REAL_NATIVE_16 +#if defined H5_FORTRAN_HAS_REAL_NATIVE_16_KIND if(H5_C_HAS_REAL_NATIVE_16 != 0) { - writeFloatToFiles("Fortran_REAL", "real_f", 16); - } -#elif defined H5_FORTRAN_HAS_REAL_NATIVE_12 - if(H5_C_HAS_REAL_NATIVE_12 != 0) { - writeFloatToFiles("Fortran_REAL", "real_f", 12); + writeFloatToFiles("Fortran_REAL", "real_f", 16, H5_FORTRAN_HAS_REAL_NATIVE_16_KIND); } -#elif defined H5_FORTRAN_HAS_REAL_NATIVE_8 - writeFloatToFiles("Fortran_REAL", "real_f", 8); -#elif defined H5_FORTRAN_HAS_REAL_NATIVE_4 - writeFloatToFiles("Fortran_REAL", "real_f", 4); +#elif defined H5_FORTRAN_HAS_REAL_NATIVE_8_KIND + writeFloatToFiles("Fortran_REAL", "real_f", 8, H5_FORTRAN_HAS_REAL_NATIVE_8_KIND); +#elif defined H5_FORTRAN_HAS_REAL_NATIVE_4_KIND + writeFloatToFiles("Fortran_REAL", "real_f", 4, H5_FORTRAN_HAS_REAL_NATIVE_4_KIND); #else /* Error: couldn't find a size for real_f */ return -1; #endif /* double_f */ -#if defined H5_FORTRAN_HAS_DOUBLE_NATIVE_16 - writeFloatToFiles("Fortran_DOUBLE", "double_f", 16); -#elif defined H5_FORTRAN_HAS_DOUBLE_NATIVE_8 - writeFloatToFiles("Fortran_DOUBLE", "double_f", 8); +#if defined H5_FORTRAN_HAS_DOUBLE_NATIVE_16_KIND + writeFloatToFiles("Fortran_DOUBLE", "double_f", 16, H5_FORTRAN_HAS_DOUBLE_NATIVE_16_KIND); +#elif defined H5_FORTRAN_HAS_DOUBLE_NATIVE_8_KIND + writeFloatToFiles("Fortran_DOUBLE", "double_f", 8, H5_FORTRAN_HAS_DOUBLE_NATIVE_8_KIND); #else /* Error: couldn't find a size for real_f */ return -1; diff --git a/fortran/src/H5test_kind.f90 b/fortran/src/H5test_kind.f90 index bdf5f5b..3182853 100644 --- a/fortran/src/H5test_kind.f90 +++ b/fortran/src/H5test_kind.f90 @@ -1,9 +1,12 @@ -!****h* fortran/src/H5test_kind.f90 +!****p* Program/H5test_kind ! ! NAME -! H5test_kind +! Executable: H5test_kind ! -! FUNCTION +! FILE +! fortran/src/H5test_kind.f90 +! +! PURPOSE ! This stand alone program is used at build time to generate the program ! H5fortran_detect.f90. It cycles through all the available KIND parameters for ! integers and reals. The appropriate program and subroutines are then generated @@ -19,20 +22,20 @@ ! condition is set in the configure variable "FORTRAN_HAVE_SIZEOF". ! ! COPYRIGHT -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! AUTHOR ! Elena Pourma @@ -42,7 +45,7 @@ PROGRAM test_kind IMPLICIT NONE INTEGER :: i, j, ii, ir, last, ikind_numbers(10), rkind_numbers(10) - INTEGER :: jr, jd + INTEGER :: ji, jr, jd last = -1 ii = 0 j = SELECTED_INT_KIND(18) @@ -72,15 +75,15 @@ PROGRAM test_kind ENDIF ENDDO -! Generate program information: +! Generate program information: WRITE(*,'(40(A,/))') & -'!****h* fortran/src/H5fortran_detect.f90',& +'!****h* ROBODoc/H5fortran_detect.f90',& '!',& '! NAME',& '! H5fortran_detect',& '! ',& -'! FUNCTION',& +'! PURPOSE',& '! This stand alone program is used at build time to generate the header file',& '! H5fort_type_defines.h. The source code itself was automatically generated by',& '! the program H5test_kind.f90',& @@ -110,12 +113,12 @@ WRITE(*,'(40(A,/))') & '!',& '!*****' -! Generate a program +! Generate a program WRITE(*,*) "PROGRAM int_kind" WRITE(*,*) "WRITE(*,*) "" /*generating header file*/ """ - j = 0 - WRITE(*, "("" CALL i"", i2.2,""()"")") j + ji = 0 + WRITE(*, "("" CALL i"", i2.2,""()"")") ji jr = 0 WRITE(*, "("" CALL r"", i2.2,""()"")") jr jd = 0 @@ -130,62 +133,76 @@ WRITE(*,'(40(A,/))') & ENDDO WRITE(*,*) "END PROGRAM int_kind" j = 0 + ji = KIND(1) WRITE(*, "("" SUBROUTINE i"", i2.2,""()"")") j WRITE(*,*)" IMPLICIT NONE" WRITE(*,*)" INTEGER :: a = 0" WRITE(*,*)" INTEGER :: a_size" + WRITE(*,*)" CHARACTER(LEN=2) :: jchr2" WRITE(*,*)" a_size = BIT_SIZE(a)" WRITE(*,*)" IF (a_size .EQ. 8) THEN" - WRITE(*,*)" WRITE(*,*) ""#define H5_FORTRAN_HAS_NATIVE_1"" " + WRITE(*,*)" WRITE(jchr2,'(I2)')",ji + WRITE(*,'(A)')' WRITE(*,*) "#define H5_FORTRAN_HAS_NATIVE_1_KIND "'//"//ADJUSTL(jchr2)" WRITE(*,*)" endif" WRITE(*,*)" IF (a_size .EQ. 16) THEN" - WRITE(*,*)" WRITE(*,*) ""#define H5_FORTRAN_HAS_NATIVE_2"" " + WRITE(*,*)" WRITE(jchr2,'(I2)')",ji + WRITE(*,'(A)')' WRITE(*,*) "#define H5_FORTRAN_HAS_NATIVE_2_KIND "'//"//ADJUSTL(jchr2)" WRITE(*,*)" endif" WRITE(*,*)" IF (a_size .EQ. 32) THEN" - WRITE(*,*)" WRITE(*,*) ""#define H5_FORTRAN_HAS_NATIVE_4"" " + WRITE(*,*)" WRITE(jchr2,'(I2)')",ji + WRITE(*,'(A)')' WRITE(*,*) "#define H5_FORTRAN_HAS_NATIVE_4_KIND "'//"//ADJUSTL(jchr2)" WRITE(*,*)" ENDIF" WRITE(*,*)" IF (a_size .EQ. 64) THEN" - WRITE(*,*)" WRITE(*,*) ""#define H5_FORTRAN_HAS_NATIVE_8"" " + WRITE(*,*)" WRITE(jchr2,'(I2)')",ji + WRITE(*,'(A)')' WRITE(*,*) "#define H5_FORTRAN_HAS_NATIVE_8_KIND "'//"//ADJUSTL(jchr2)" WRITE(*,*)" ENDIF" WRITE(*,*)" IF (a_size .EQ. 128) THEN" - WRITE(*,*)" WRITE(*,*) ""#define H5_FORTRAN_HAS_NATIVE_16"" " + WRITE(*,*)" WRITE(jchr2,'(I2)')",ji + WRITE(*,'(A)')' WRITE(*,*) "#define H5_FORTRAN_HAS_NATIVE_16_KIND "'//"//ADJUSTL(jchr2)" WRITE(*,*)" ENDIF" WRITE(*,*)" RETURN" WRITE(*,*)"END SUBROUTINE" - jr = 0 + jr = KIND(1.0) WRITE(*, "("" SUBROUTINE r"", i2.2,""()"")") j WRITE(*,*)" IMPLICIT NONE" WRITE(*,*)" REAL :: b(32)" WRITE(*,*)" INTEGER :: a(1)" WRITE(*,*)" INTEGER :: a_size" WRITE(*,*)" INTEGER :: real_size" + WRITE(*,*)" CHARACTER(LEN=2) :: jchr2" WRITE(*,*)" a_size = BIT_SIZE(a(1)) ! Size in bits for integer" WRITE(*,*)" real_size = (SIZE(TRANSFER(b,a))*a_size)/SIZE(b)" WRITE(*,*)" IF (real_size .EQ. 32) THEN" - WRITE(*,*)" WRITE(*,*) ""#define H5_FORTRAN_HAS_REAL_NATIVE_4"" " + WRITE(*,*)" WRITE(jchr2,'(I2)')",jr + WRITE(*,'(A)')' WRITE(*,*) "#define H5_FORTRAN_HAS_REAL_NATIVE_4_KIND "'//"//ADJUSTL(jchr2)" WRITE(*,*)" ENDIF" WRITE(*,*)" IF (real_size .EQ. 64) THEN" - WRITE(*,*)" write(*,*) ""#define H5_FORTRAN_HAS_REAL_NATIVE_8"" " - WRITE(*,*)" endif" + WRITE(*,*)" WRITE(jchr2,'(I2)')",jr + WRITE(*,'(A)')' WRITE(*,*) "#define H5_FORTRAN_HAS_REAL_NATIVE_8_KIND "'//"//ADJUSTL(jchr2)" + WRITE(*,*)" ENDIF" WRITE(*,*)" IF (real_size .EQ. 128) THEN" - WRITE(*,*)" write(*,*) ""#define H5_FORTRAN_HAS_REAL_NATIVE_16"" " + WRITE(*,*)" WRITE(jchr2,'(I2)')",jr + WRITE(*,'(A)')' WRITE(*,*) "#define H5_FORTRAN_HAS_REAL_NATIVE_16_KIND "'//"//ADJUSTL(jchr2)" WRITE(*,*)" ENDIF" WRITE(*,*)" RETURN" WRITE(*,*)"END SUBROUTINE" - jd = 0 - WRITE(*, "("" SUBROUTINE d"", i2.2,""()"")") jd + jd = KIND(1.d0) + WRITE(*, "("" SUBROUTINE d"", i2.2,""()"")") j WRITE(*,*)" IMPLICIT NONE" WRITE(*,*)" DOUBLE PRECISION :: b=0" WRITE(*,*)" INTEGER :: a(8)=0" WRITE(*,*)" INTEGER :: a_size" WRITE(*,*)" INTEGER :: b_size" + WRITE(*,*)" CHARACTER(LEN=2) :: jchr2" WRITE(*,*)" a_size = BIT_SIZE(a(1))" WRITE(*,*)" b_size = SIZE(transfer(b,a))*a_size" WRITE(*,*)" IF (b_size .EQ. 64) THEN" - WRITE(*,*)" WRITE(*,*) ""#define H5_FORTRAN_HAS_DOUBLE_NATIVE_8"" " + WRITE(*,*)" WRITE(jchr2,'(I2)')",jd + WRITE(*,'(A)')' WRITE(*,*) "#define H5_FORTRAN_HAS_DOUBLE_NATIVE_8_KIND "'//"//ADJUSTL(jchr2)" WRITE(*,*)" ENDIF" WRITE(*,*)" IF (b_size .EQ. 128) THEN" - WRITE(*,*)" WRITE(*,*) ""#define H5_FORTRAN_HAS_DOUBLE_NATIVE_16"" " + WRITE(*,*)" WRITE(jchr2,'(I2)')",jd + WRITE(*,'(A)')' WRITE(*,*) "#define H5_FORTRAN_HAS_DOUBLE_NATIVE_16_KIND "'//"//ADJUSTL(jchr2)" WRITE(*,*)" ENDIF" WRITE(*,*)" RETURN" WRITE(*,*)"END SUBROUTINE" @@ -195,21 +212,27 @@ WRITE(*,'(40(A,/))') & WRITE(*,*)" IMPLICIT NONE" WRITE(*,*)" INTEGER(",j,") :: a = 0" WRITE(*,*)" INTEGER :: a_size" + WRITE(*,*)" CHARACTER(LEN=2) :: jchr2" WRITE(*,*)" a_size = BIT_SIZE(a)" WRITE(*,*)" IF (a_size .EQ. 8) THEN" - WRITE(*,*)" WRITE(*,*) ""#define H5_FORTRAN_HAS_INTEGER_1"" " + WRITE(*,*)" WRITE(jchr2,'(I2)')",j + WRITE(*,'(A)')' WRITE(*,*) "#define H5_FORTRAN_HAS_INTEGER_1_KIND "'//"//ADJUSTL(jchr2)" WRITE(*,*)" ENDIF" WRITE(*,*)" IF (a_size .EQ. 16) THEN" - WRITE(*,*)" WRITE(*,*) ""#define H5_FORTRAN_HAS_INTEGER_2"" " + WRITE(*,*)" WRITE(jchr2,'(I2)')",j + WRITE(*,'(A)')' WRITE(*,*) "#define H5_FORTRAN_HAS_INTEGER_2_KIND "'//"//ADJUSTL(jchr2)" WRITE(*,*)" ENDIF" WRITE(*,*)" IF (a_size .EQ. 32) THEN" - WRITE(*,*)" WRITE(*,*) ""#define H5_FORTRAN_HAS_INTEGER_4"" " + WRITE(*,*)" WRITE(jchr2,'(I2)')",j + WRITE(*,'(A)')' WRITE(*,*) "#define H5_FORTRAN_HAS_INTEGER_4_KIND "'//"//ADJUSTL(jchr2)" WRITE(*,*)" ENDIF" WRITE(*,*)" IF (a_size .EQ. 64) THEN" - WRITE(*,*)" WRITE(*,*) ""#define H5_FORTRAN_HAS_INTEGER_8"" " + WRITE(*,*)" WRITE(jchr2,'(I2)')",j + WRITE(*,'(A)')' WRITE(*,*) "#define H5_FORTRAN_HAS_INTEGER_8_KIND "'//"//ADJUSTL(jchr2)" WRITE(*,*)" ENDIF" WRITE(*,*)" IF (a_size .EQ. 128) THEN" - WRITE(*,*)" WRITE(*,*) ""#define H5_FORTRAN_HAS_INTEGER_16"" " + WRITE(*,*)" WRITE(jchr2,'(I2)')",j + WRITE(*,'(A)')' WRITE(*,*) "#define H5_FORTRAN_HAS_INTEGER_16_KIND "'//"//ADJUSTL(jchr2)" WRITE(*,*)" ENDIF" WRITE(*,*)" RETURN" WRITE(*,*)" END SUBROUTINE" @@ -222,16 +245,20 @@ WRITE(*,'(40(A,/))') & WRITE(*,*)" INTEGER :: a(1)" WRITE(*,*)" INTEGER :: a_size" WRITE(*,*)" INTEGER :: real_size" + WRITE(*,*)" CHARACTER(LEN=2) :: jchr2" WRITE(*,*)" a_size = BIT_SIZE(a(1)) ! Size in bits for integer" WRITE(*,*)" real_size = (SIZE(TRANSFER(b,a))*a_size)/SIZE(b)" WRITE(*,*)" IF (real_size .EQ. 32) THEN" - WRITE(*,*)" WRITE(*,*) ""#define H5_FORTRAN_HAS_REAL_4"" " + WRITE(*,*)" WRITE(jchr2,'(I2)')",j + WRITE(*,'(A)')' WRITE(*,*) "#define H5_FORTRAN_HAS_REAL_4_KIND "'//"//ADJUSTL(jchr2)" WRITE(*,*)" ENDIF" WRITE(*,*)" IF (real_size .EQ. 64) THEN" - WRITE(*,*)" write(*,*) ""#define H5_FORTRAN_HAS_REAL_8"" " + WRITE(*,*)" WRITE(jchr2,'(I2)')",j + WRITE(*,*)' WRITE(*,*) "#define H5_FORTRAN_HAS_REAL_8_KIND "'//"//ADJUSTL(jchr2)" WRITE(*,*)" endif" WRITE(*,*)" IF (real_size .EQ. 128) THEN" - WRITE(*,*)" write(*,*) ""#define H5_FORTRAN_HAS_REAL_16"" " + WRITE(*,*)" WRITE(jchr2,'(I2)')",j + WRITE(*,'(A)')' WRITE(*,*) "#define H5_FORTRAN_HAS_REAL_16_KIND "'//"//ADJUSTL(jchr2)" WRITE(*,*)" ENDIF" WRITE(*,*)" RETURN" WRITE(*,*)" END SUBROUTINE" diff --git a/fortran/src/H5test_kind_SIZEOF.f90 b/fortran/src/H5test_kind_SIZEOF.f90 index fbbe8e9..ba982ee 100644 --- a/fortran/src/H5test_kind_SIZEOF.f90 +++ b/fortran/src/H5test_kind_SIZEOF.f90 @@ -1,9 +1,12 @@ -!****h* fortran/src/H5test_kind_SIZEOF.f90 +!****p* Program/H5test_kind_SIZEOF ! ! NAME -! H5test_kind +! Executable: H5test_kind ! -! FUNCTION +! FILE +! fortran/src/H5test_kind_SIZEOF.f90 +! +! PURPOSE ! This stand alone program is used at build time to generate the program ! H5fortran_detect.f90. It cycles through all the available KIND parameters for ! integers and reals. The appropriate program and subroutines are then generated @@ -18,30 +21,30 @@ ! condition is set in the configure variable "FORTRAN_HAVE_SIZEOF". ! ! COPYRIGHT -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! ! AUTHOR -! M.S. Breitenfeld +! M. Scot Breitenfeld ! !***** PROGRAM test_kind IMPLICIT NONE - INTEGER :: i, j, ii, ir, last, ikind_numbers(10),rkind_numbers(10) - INTEGER :: jr, jd + INTEGER :: i, j, ii, ir, last, ikind_numbers(10), rkind_numbers(10) + INTEGER :: ji, jr, jd last = -1 ii = 0 DO i = 1,100 @@ -70,15 +73,15 @@ PROGRAM test_kind ENDIF ENDDO -! Generate program information: +! Generate program information: WRITE(*,'(40(A,/))') & -'!****h* fortran/src/H5fortran_detect.f90',& +'!****h* ROBODoc/H5fortran_detect.f90',& '!',& '! NAME',& '! H5fortran_detect',& '! ',& -'! FUNCTION',& +'! PURPOSE',& '! This stand alone program is used at build time to generate the header file',& '! H5fort_type_defines.h. The source code itself was automatically generated by',& '! the program H5test_kind_SIZEOF.f90',& @@ -109,11 +112,11 @@ WRITE(*,'(40(A,/))') & '!',& '!*****' -! Generate a program +! Generate a program WRITE(*,*) "PROGRAM int_kind" WRITE(*,*) "WRITE(*,*) "" /*generating header file*/ """ - j = 0 - WRITE(*, "("" CALL i"", i2.2,""()"")") j + ji = 0 + WRITE(*, "("" CALL i"", i2.2,""()"")") ji jr = 0 WRITE(*, "("" CALL r"", i2.2,""()"")") jr jd = 0 @@ -128,48 +131,59 @@ WRITE(*,'(40(A,/))') & ENDDO WRITE(*,*) "END PROGRAM int_kind" j = 0 + ji = KIND(1) WRITE(*, "("" SUBROUTINE i"", i2.2,""()"")") j WRITE(*,*)" IMPLICIT NONE" WRITE(*,*)" INTEGER :: a" WRITE(*,*)" INTEGER :: a_size" - WRITE(*,*)" CHARACTER(LEN=2) :: ichr2" + WRITE(*,*)" CHARACTER(LEN=2) :: ichr2, jchr2" WRITE(*,*)" a_size = SIZEOF(a)" WRITE(*,*)" WRITE(ichr2,'(I2)') a_size" - WRITE(*,*)' WRITE(*,*) "#define H5_FORTRAN_HAS_NATIVE_"'//"//ADJUSTL(ichr2)" + WRITE(*,'(A,I0)')" WRITE(jchr2,'(I2)') ",ji + WRITE(*,'(A)')' WRITE(*,*) "#define H5_FORTRAN_HAS_NATIVE_"'// & + "//TRIM(ADJUSTL(ichr2))//"//'"_KIND "'//"//ADJUSTL(jchr2)" WRITE(*,*)" RETURN" WRITE(*,*)"END SUBROUTINE" jr = 0 - WRITE(*, "("" SUBROUTINE r"", i2.2,""()"")") j + j = KIND(1.0) + WRITE(*, "("" SUBROUTINE r"", i2.2,""()"")") jr WRITE(*,*)" IMPLICIT NONE" WRITE(*,*)" REAL :: a" WRITE(*,*)" INTEGER :: a_size" - WRITE(*,*)" CHARACTER(LEN=2) :: ichr2" + WRITE(*,*)" CHARACTER(LEN=2) :: ichr2, jchr2" WRITE(*,*)" a_size = SIZEOF(a)" WRITE(*,*)" WRITE(ichr2,'(I2)') a_size" - WRITE(*,*)' WRITE(*,*) "#define H5_FORTRAN_HAS_REAL_NATIVE_"'//"//ADJUSTL(ichr2)" + WRITE(*,'(A,I0)')" WRITE(jchr2,'(I2)') ",j + WRITE(*,'(A)')' WRITE(*,*) "#define H5_FORTRAN_HAS_REAL_NATIVE_"'// & + "//TRIM(ADJUSTL(ichr2))//"//'"_KIND "'//"//ADJUSTL(jchr2)" WRITE(*,*)" RETURN" WRITE(*,*)"END SUBROUTINE" jd = 0 + j = KIND(1.d0) WRITE(*, "("" SUBROUTINE d"", i2.2,""()"")") jd WRITE(*,*)" IMPLICIT NONE" WRITE(*,*)" DOUBLE PRECISION :: a" WRITE(*,*)" INTEGER :: a_size" - WRITE(*,*)" CHARACTER(LEN=2) :: ichr2" + WRITE(*,*)" CHARACTER(LEN=2) :: ichr2, jchr2" WRITE(*,*)" a_size = SIZEOF(a)" WRITE(*,*)" WRITE(ichr2,'(I2)') a_size" - WRITE(*,*)' WRITE(*,*) "#define H5_FORTRAN_HAS_DOUBLE_NATIVE_"'//"//ADJUSTL(ichr2)" + WRITE(*,'(A,I0)')" WRITE(jchr2,'(I2)') ",j + WRITE(*,'(A)')' WRITE(*,*) "#define H5_FORTRAN_HAS_DOUBLE_NATIVE_"'// & + "//TRIM(ADJUSTL(ichr2))//"//'"_KIND "'//"//ADJUSTL(jchr2)" WRITE(*,*)" RETURN" WRITE(*,*)"END SUBROUTINE" DO i = 1, ii j = ikind_numbers(i) WRITE(*, "("" SUBROUTINE i"", i2.2,""()"")") j WRITE(*,*)" IMPLICIT NONE" - WRITE(*,*)" INTEGER(",j,") :: a" + WRITE(*,'(A,I0,A)')" INTEGER(KIND=",j,") :: a" WRITE(*,*)" INTEGER :: a_size" - WRITE(*,*)" CHARACTER(LEN=2) :: ichr2" + WRITE(*,*)" CHARACTER(LEN=2) :: ichr2, jchr2" WRITE(*,*)" a_size = SIZEOF(a)" WRITE(*,*)" WRITE(ichr2,'(I2)') a_size" - WRITE(*,*)' WRITE(*,*) "#define H5_FORTRAN_HAS_INTEGER_"'//"//ADJUSTL(ichr2)" + WRITE(*,'(A,I0)')" WRITE(jchr2,'(I2)') ",j + WRITE(*,'(A)')' WRITE(*,*) "#define H5_FORTRAN_HAS_INTEGER_"'// & + "//TRIM(ADJUSTL(ichr2))//"//'"_KIND "'//"//ADJUSTL(jchr2)" WRITE(*,*)" RETURN" WRITE(*,*)"END SUBROUTINE" ENDDO @@ -177,12 +191,14 @@ WRITE(*,'(40(A,/))') & j = rkind_numbers(i) WRITE(*, "("" SUBROUTINE r"", i2.2,""()"")") j WRITE(*,*)" IMPLICIT NONE" - WRITE(*,*)" REAL(KIND=",j,") :: a" + WRITE(*,'(A,I0,A)')" REAL(KIND= ",j,") :: a" WRITE(*,*)" INTEGER :: a_size" - WRITE(*,*)" CHARACTER(LEN=2) :: ichr2" + WRITE(*,*)" CHARACTER(LEN=2) :: ichr2, jchr2" WRITE(*,*)" a_size = SIZEOF(a)" WRITE(*,*)" WRITE(ichr2,'(I2)') a_size" - WRITE(*,*)' WRITE(*,*) "#define H5_FORTRAN_HAS_REAL_"'//"//ADJUSTL(ichr2)" + WRITE(*,'(A,I0)')" WRITE(jchr2,'(I2)') ", j + WRITE(*,'(A)')' WRITE(*,*) "#define H5_FORTRAN_HAS_REAL_"'// & + "//TRIM(ADJUSTL(ichr2))//"//'"_KIND "'//"//ADJUSTL(jchr2)" WRITE(*,*)" RETURN" WRITE(*,*)"END SUBROUTINE" ENDDO diff --git a/fortran/src/HDF5.f90 b/fortran/src/HDF5.f90 index b18591d..cb3d8bf 100644 --- a/fortran/src/HDF5.f90 +++ b/fortran/src/HDF5.f90 @@ -1,3 +1,15 @@ +!****h* ROBODoc/HDF5 +! +! NAME +! MODULE HDF5 +! +! FILE +! src/fortran/src/HDF5.f90 +! +! PURPOSE +! This is the main module used for linking to the Fortran HDF library. +! +! COPYRIGHT ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! Copyright by The HDF Group. * ! Copyright by the Board of Trustees of the University of Illinois. * @@ -13,22 +25,31 @@ ! access to either file, you may request a copy from help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! +!***** + MODULE HDF5 USE H5GLOBAL USE H5F USE H5G USE H5E + USE H5E_PROVISIONAL USE H5I USE H5L + USE H5L_PROVISIONAL USE H5S USE H5D + USE H5D_PROVISIONAL USE H5A + USE H5A_PROVISIONAL USE H5T + USE H5T_PROVISIONAL USE H5O + USE H5O_PROVISIONAL USE H5P + USE H5P_PROVISIONAL USE H5R + USE H5R_PROVISIONAL USE H5Z USE H5_DBLE_INTERFACE USE H5LIB - END MODULE HDF5 diff --git a/fortran/src/HDF5mpio.f90 b/fortran/src/HDF5mpio.f90 index 15d3a93..ac4d2b1 100644 --- a/fortran/src/HDF5mpio.f90 +++ b/fortran/src/HDF5mpio.f90 @@ -1,34 +1,54 @@ -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -! 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. * -! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +!****h* ROBODoc/HDF5 (mpio) ! - MODULE HDF5 - USE H5GLOBAL - USE H5F - USE H5E - USE H5G - USE H5I - USE H5L - USE H5S - USE H5D - USE H5A - USE H5T - USE H5O - USE H5P - USE H5FDMPIO - USE H5R - USE H5Z - USE H5_DBLE_INTERFACE - USE H5LIB - END MODULE HDF5 +! NAME +! HDF5 +! +! PURPOSE +! This is the main module used for linking to the Fortran parallel HDF library. +! This file replaces HDF5.f90 when compiling the parallel library. +! +! COPYRIGHT +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +!***** + +MODULE HDF5 + USE H5GLOBAL + USE H5F + USE H5G + USE H5E + USE H5E_PROVISIONAL + USE H5I + USE H5L + USE H5L_PROVISIONAL + USE H5S + USE H5D + USE H5D_PROVISIONAL + USE H5A + USE H5A_PROVISIONAL + USE H5T + USE H5T_PROVISIONAL + USE H5O + USE H5O_PROVISIONAL + USE H5P + USE H5P_PROVISIONAL + USE H5FDMPIO + USE H5R + USE H5R_PROVISIONAL + USE H5Z + USE H5_DBLE_INTERFACE + USE H5LIB +END MODULE HDF5 diff --git a/fortran/src/Makefile.am b/fortran/src/Makefile.am index c6a40e7..e6ef610 100644 --- a/fortran/src/Makefile.am +++ b/fortran/src/Makefile.am @@ -49,6 +49,14 @@ else PARALLEL_COND_SRC = HDF5.f90 endif +# Check if the compiler supports the Fortran 2003 standard +# which should include the intrinsic module iso_c_binding +if FORTRAN_2003_CONDITIONAL_F + F_STATUS = _F03 +else + F_STATUS = _F90 +endif + # Condition for including/excluding the DBLE interfaces for when the # default REAL is of type DOUBLE PRECISION. # We do not include the double precision interfaces if the defaut REAL is @@ -61,14 +69,15 @@ else endif # Source files for the library. -libhdf5_fortran_la_SOURCES= H5f90global.f90 \ - H5fortran_types.f90 H5_ff.f90 H5Aff.f90 H5Dff.f90 H5Eff.f90 \ - H5Fff.f90 H5Gff.f90 H5Iff.f90 H5Lff.f90 H5Off.f90 H5Pff.f90 H5Rff.f90 H5Sff.f90 \ - H5Tff.f90 H5Zff.f90 \ - H5_DBLE_Interface$(F_DBLE).f90 \ - H5f90kit.c H5_f.c H5Af.c H5Df.c H5Ef.c H5Ff.c H5Gf.c \ - H5If.c H5Lf.c H5Of.c H5Pf.c H5Rf.c H5Sf.c H5Tf.c H5Zf.c \ - $(PARALLEL_COND_SRC) +libhdf5_fortran_la_SOURCES=H5f90global.f90 \ + H5fortran_types.f90 H5_ff$(F_STATUS).f90 H5_ff.f90 H5Aff.f90 H5Dff.f90 H5Eff.f90 \ + H5Fff.f90 H5Gff.f90 H5Iff.f90 H5Lff.f90 H5Off.f90 H5Pff.f90 H5Rff.f90 H5Sff.f90 \ + H5Tff.f90 H5Zff.f90 \ + H5_DBLE_Interface$(F_DBLE).f90 \ + H5f90kit.c H5_f.c H5Af.c H5Df.c H5Ef.c H5Ff.c H5Gf.c \ + H5If.c H5Lf.c H5Of.c H5Pf.c H5Rf.c H5Sf.c H5Tf.c H5Zf.c \ + H5Aff$(F_STATUS).f90 H5Dff$(F_STATUS).f90 H5Eff$(F_STATUS).f90 H5Lff$(F_STATUS).f90 \ + H5Off$(F_STATUS).f90 H5Pff$(F_STATUS).f90 H5Rff$(F_STATUS).f90 H5Tff$(F_STATUS).f90 $(PARALLEL_COND_SRC) # HDF5 Fortran library depends on HDF5 Library. libhdf5_fortran_la_LIBADD=$(LIBHDF5) @@ -93,7 +102,6 @@ clean-local: @if test -n "$(F9XMODEXT)" && test "X$(F9XMODEXT)" != "Xo"; then \ $(RM) *.$(F9XMODEXT); \ fi - $(RM) $(DESTDIR)$(includedir)/H5f90i*.h install-data-local: @if test -n "$(F9XMODEXT)" && test "X$(F9XMODEXT)" != "Xo"; then \ @@ -185,10 +193,19 @@ H5f90global.lo: $(srcdir)/H5f90global.f90 H5fortran_types.lo H5fortran_types.lo: H5fortran_types.f90 H5fortran_detect.lo: H5fortran_detect.f90 H5test_kind.lo: $(srcdir)/H5test_kind.f90 -H5test_kind_SIZEOF.lo: $(srcdir)/H5test_kind_SIZEOF.f90 -H5_ff.lo: $(srcdir)/H5_ff.f90 H5f90global.lo +H5test_kind_SIZEOF.lo: $(srcdir)/H5test_kind_SIZEOF.f90 +H5_ff$(F_STATUS).lo: $(srcdir)/H5_ff$(F_STATUS).f90 H5f90global.lo +H5_ff.lo: $(srcdir)/H5_ff.f90 H5f90global.lo H5_ff$(F_STATUS).lo H5Aff.lo: $(srcdir)/H5Aff.f90 H5f90global.lo H5Dff.lo: $(srcdir)/H5Dff.f90 H5f90global.lo +H5Aff$(F_STATUS).lo: $(srcdir)/H5Aff$(F_STATUS).f90 H5f90global.lo +H5Dff$(F_STATUS).lo: $(srcdir)/H5Dff$(F_STATUS).f90 H5f90global.lo +H5Eff$(F_STATUS).lo: $(srcdir)/H5Eff$(F_STATUS).f90 H5f90global.lo +H5Lff$(F_STATUS).lo: $(srcdir)/H5Lff$(F_STATUS).f90 H5f90global.lo +H5Off$(F_STATUS).lo: $(srcdir)/H5Off$(F_STATUS).f90 H5f90global.lo +H5Pff$(F_STATUS).lo: $(srcdir)/H5Pff$(F_STATUS).f90 H5f90global.lo +H5Rff$(F_STATUS).lo: $(srcdir)/H5Rff$(F_STATUS).f90 H5f90global.lo +H5Tff$(F_STATUS).lo: $(srcdir)/H5Tff$(F_STATUS).f90 H5f90global.lo H5Eff.lo: $(srcdir)/H5Eff.f90 H5f90global.lo H5Fff.lo: $(srcdir)/H5Fff.f90 H5f90global.lo H5Gff.lo: $(srcdir)/H5Gff.f90 H5f90global.lo @@ -200,15 +217,22 @@ H5Rff.lo: $(srcdir)/H5Rff.f90 H5f90global.lo H5Sff.lo: $(srcdir)/H5Sff.f90 H5f90global.lo H5Tff.lo: $(srcdir)/H5Tff.f90 H5f90global.lo H5Zff.lo: $(srcdir)/H5Zff.f90 H5f90global.lo -H5_DBLE_Interface$(F_DBLE).lo: $(srcdir)/H5_DBLE_Interface$(F_DBLE).f90 H5Aff.lo H5Dff.lo H5Pff.lo - -HDF5.lo: $(srcdir)/HDF5.f90 H5f90global.lo H5Aff.lo \ - H5Dff.lo H5Eff.lo H5Fff.lo H5Gff.lo H5Iff.lo H5Lff.lo \ - H5Pff.lo H5Rff.lo H5Sff.lo H5Tff.lo H5Zff.lo \ - H5_DBLE_Interface$(F_DBLE).lo +H5_DBLE_Interface$(F_DBLE).lo: $(srcdir)/H5_DBLE_Interface$(F_DBLE).f90 H5Aff$(F_STATUS).lo H5Dff$(F_STATUS).lo H5Eff$(F_STATUS).lo H5Pff$(F_STATUS).lo +HDF5.lo: $(srcdir)/HDF5.f90 H5f90global.lo H5_ff$(F_STATUS).lo H5_ff.lo H5Aff.lo H5Aff$(F_STATUS).lo \ + H5Dff.lo H5Dff$(F_STATUS).lo \ + H5Eff.lo H5Eff$(F_STATUS).lo \ + H5Fff.lo H5Gff.lo H5Iff.lo H5Lff.lo H5Lff$(F_STATUS).lo \ + H5Off.lo H5Off$(F_STATUS).lo H5Pff.lo H5Pff$(F_STATUS).lo H5Rff$(F_STATUS).lo H5Rff.lo \ + H5Sff.lo H5Tff.lo H5Tff$(F_STATUS).lo H5Zff.lo \ + H5_DBLE_Interface$(F_DBLE).lo H5FDmpioff.lo: $(srcdir)/H5FDmpioff.f90 H5f90global.lo -HDF5mpio.lo: $(srcdir)/H5FDmpioff.f90 H5f90global.lo H5Aff.lo \ - H5Dff.lo H5Eff.lo H5Fff.lo H5Gff.lo H5Iff.lo H5Lff.lo \ - H5Pff.lo H5Rff.lo H5Sff.lo H5Tff.lo H5Zff.lo H5_DBLE_Interface$(F_DBLE).lo H5FDmpioff.lo +HDF5mpio.lo: $(srcdir)/H5FDmpioff.f90 H5f90global.lo H5_ff$(F_STATUS).lo H5_ff.lo \ + H5Aff.lo H5Aff$(F_STATUS).lo \ + H5Dff.lo H5Dff$(F_STATUS).lo \ + H5Eff.lo H5Eff$(F_STATUS).lo \ + H5Fff.lo H5Gff.lo H5Iff.lo H5Lff.lo H5Lff$(F_STATUS).lo \ + H5Off.lo H5Off$(F_STATUS).lo H5Pff.lo H5Pff$(F_STATUS).lo H5Rff$(F_STATUS).lo H5Rff.lo \ + H5Sff.lo H5Tff.lo H5Tff$(F_STATUS).lo H5Zff.lo \ + H5_DBLE_Interface$(F_DBLE).lo H5FDmpioff.lo include $(top_srcdir)/config/conclude.am diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in index 565137c..0ccaf33 100644 --- a/fortran/src/Makefile.in +++ b/fortran/src/Makefile.in @@ -98,21 +98,28 @@ am__installdirs = "$(DESTDIR)$(libdir)" LTLIBRARIES = $(lib_LTLIBRARIES) libhdf5_fortran_la_DEPENDENCIES = $(LIBHDF5) am__libhdf5_fortran_la_SOURCES_DIST = H5f90global.f90 \ - H5fortran_types.f90 H5_ff.f90 H5Aff.f90 H5Dff.f90 H5Eff.f90 \ - H5Fff.f90 H5Gff.f90 H5Iff.f90 H5Lff.f90 H5Off.f90 H5Pff.f90 \ - H5Rff.f90 H5Sff.f90 H5Tff.f90 H5Zff.f90 \ + H5fortran_types.f90 H5_ff$(F_STATUS).f90 H5_ff.f90 H5Aff.f90 \ + H5Dff.f90 H5Eff.f90 H5Fff.f90 H5Gff.f90 H5Iff.f90 H5Lff.f90 \ + H5Off.f90 H5Pff.f90 H5Rff.f90 H5Sff.f90 H5Tff.f90 H5Zff.f90 \ H5_DBLE_Interface$(F_DBLE).f90 H5f90kit.c H5_f.c H5Af.c H5Df.c \ H5Ef.c H5Ff.c H5Gf.c H5If.c H5Lf.c H5Of.c H5Pf.c H5Rf.c H5Sf.c \ - H5Tf.c H5Zf.c HDF5.f90 H5FDmpiof.c HDF5mpio.f90 H5FDmpioff.f90 + H5Tf.c H5Zf.c H5Aff$(F_STATUS).f90 H5Dff$(F_STATUS).f90 \ + H5Eff$(F_STATUS).f90 H5Lff$(F_STATUS).f90 H5Off$(F_STATUS).f90 \ + H5Pff$(F_STATUS).f90 H5Rff$(F_STATUS).f90 H5Tff$(F_STATUS).f90 \ + HDF5.f90 H5FDmpiof.c HDF5mpio.f90 H5FDmpioff.f90 @BUILD_PARALLEL_CONDITIONAL_FALSE@am__objects_1 = HDF5.lo @BUILD_PARALLEL_CONDITIONAL_TRUE@am__objects_1 = H5FDmpiof.lo \ @BUILD_PARALLEL_CONDITIONAL_TRUE@ HDF5mpio.lo H5FDmpioff.lo am_libhdf5_fortran_la_OBJECTS = H5f90global.lo H5fortran_types.lo \ - H5_ff.lo H5Aff.lo H5Dff.lo H5Eff.lo H5Fff.lo H5Gff.lo H5Iff.lo \ - H5Lff.lo H5Off.lo H5Pff.lo H5Rff.lo H5Sff.lo H5Tff.lo H5Zff.lo \ - H5_DBLE_Interface$(F_DBLE).lo H5f90kit.lo H5_f.lo H5Af.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) + H5_ff$(F_STATUS).lo H5_ff.lo H5Aff.lo H5Dff.lo H5Eff.lo \ + H5Fff.lo H5Gff.lo H5Iff.lo H5Lff.lo H5Off.lo H5Pff.lo H5Rff.lo \ + H5Sff.lo H5Tff.lo H5Zff.lo H5_DBLE_Interface$(F_DBLE).lo \ + H5f90kit.lo H5_f.lo H5Af.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 H5Aff$(F_STATUS).lo H5Dff$(F_STATUS).lo \ + H5Eff$(F_STATUS).lo H5Lff$(F_STATUS).lo H5Off$(F_STATUS).lo \ + H5Pff$(F_STATUS).lo H5Rff$(F_STATUS).lo H5Tff$(F_STATUS).lo \ + $(am__objects_1) libhdf5_fortran_la_OBJECTS = $(am_libhdf5_fortran_la_OBJECTS) AM_V_lt = $(am__v_lt_$(V)) am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) @@ -251,6 +258,7 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ +FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ @@ -271,10 +279,12 @@ H5_LONE_COLON = @H5_LONE_COLON@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ +HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ +HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ @@ -468,7 +478,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 = 71 +LT_VERS_REVISION = 101 LT_VERS_AGE = 0 # Include src directory in both Fortran and C flags (C compiler is used @@ -485,6 +495,11 @@ libhdf5_fortran_la_LDFLAGS = -version-info $(LT_VERS_INTERFACE):$(LT_VERS_REVISI # Include HDF5.f90 if parallel is disabled, HDF5mpiof* if parallel is enabled @BUILD_PARALLEL_CONDITIONAL_TRUE@PARALLEL_COND_SRC = H5FDmpiof.c HDF5mpio.f90 H5FDmpioff.f90 +@FORTRAN_2003_CONDITIONAL_F_FALSE@F_STATUS = _F90 + +# Check if the compiler supports the Fortran 2003 standard +# which should include the intrinsic module iso_c_binding +@FORTRAN_2003_CONDITIONAL_F_TRUE@F_STATUS = _F03 @FORTRAN_DEFAULT_REALisDBLE_F_FALSE@F_DBLE = Include # Condition for including/excluding the DBLE interfaces for when the @@ -495,14 +510,15 @@ libhdf5_fortran_la_LDFLAGS = -version-info $(LT_VERS_INTERFACE):$(LT_VERS_REVISI @FORTRAN_DEFAULT_REALisDBLE_F_TRUE@F_DBLE = Exclude # Source files for the library. -libhdf5_fortran_la_SOURCES = H5f90global.f90 \ - H5fortran_types.f90 H5_ff.f90 H5Aff.f90 H5Dff.f90 H5Eff.f90 \ - H5Fff.f90 H5Gff.f90 H5Iff.f90 H5Lff.f90 H5Off.f90 H5Pff.f90 H5Rff.f90 H5Sff.f90 \ - H5Tff.f90 H5Zff.f90 \ - H5_DBLE_Interface$(F_DBLE).f90 \ - H5f90kit.c H5_f.c H5Af.c H5Df.c H5Ef.c H5Ff.c H5Gf.c \ - H5If.c H5Lf.c H5Of.c H5Pf.c H5Rf.c H5Sf.c H5Tf.c H5Zf.c \ - $(PARALLEL_COND_SRC) +libhdf5_fortran_la_SOURCES = H5f90global.f90 \ + H5fortran_types.f90 H5_ff$(F_STATUS).f90 H5_ff.f90 H5Aff.f90 H5Dff.f90 H5Eff.f90 \ + H5Fff.f90 H5Gff.f90 H5Iff.f90 H5Lff.f90 H5Off.f90 H5Pff.f90 H5Rff.f90 H5Sff.f90 \ + H5Tff.f90 H5Zff.f90 \ + H5_DBLE_Interface$(F_DBLE).f90 \ + H5f90kit.c H5_f.c H5Af.c H5Df.c H5Ef.c H5Ff.c H5Gf.c \ + H5If.c H5Lf.c H5Of.c H5Pf.c H5Rf.c H5Sf.c H5Tf.c H5Zf.c \ + H5Aff$(F_STATUS).f90 H5Dff$(F_STATUS).f90 H5Eff$(F_STATUS).f90 H5Lff$(F_STATUS).f90 \ + H5Off$(F_STATUS).f90 H5Pff$(F_STATUS).f90 H5Rff$(F_STATUS).f90 H5Tff$(F_STATUS).f90 $(PARALLEL_COND_SRC) # HDF5 Fortran library depends on HDF5 Library. @@ -973,7 +989,6 @@ clean-local: @if test -n "$(F9XMODEXT)" && test "X$(F9XMODEXT)" != "Xo"; then \ $(RM) *.$(F9XMODEXT); \ fi - $(RM) $(DESTDIR)$(includedir)/H5f90i*.h install-data-local: @if test -n "$(F9XMODEXT)" && test "X$(F9XMODEXT)" != "Xo"; then \ @@ -1022,10 +1037,19 @@ H5f90global.lo: $(srcdir)/H5f90global.f90 H5fortran_types.lo H5fortran_types.lo: H5fortran_types.f90 H5fortran_detect.lo: H5fortran_detect.f90 H5test_kind.lo: $(srcdir)/H5test_kind.f90 -H5test_kind_SIZEOF.lo: $(srcdir)/H5test_kind_SIZEOF.f90 -H5_ff.lo: $(srcdir)/H5_ff.f90 H5f90global.lo +H5test_kind_SIZEOF.lo: $(srcdir)/H5test_kind_SIZEOF.f90 +H5_ff$(F_STATUS).lo: $(srcdir)/H5_ff$(F_STATUS).f90 H5f90global.lo +H5_ff.lo: $(srcdir)/H5_ff.f90 H5f90global.lo H5_ff$(F_STATUS).lo H5Aff.lo: $(srcdir)/H5Aff.f90 H5f90global.lo H5Dff.lo: $(srcdir)/H5Dff.f90 H5f90global.lo +H5Aff$(F_STATUS).lo: $(srcdir)/H5Aff$(F_STATUS).f90 H5f90global.lo +H5Dff$(F_STATUS).lo: $(srcdir)/H5Dff$(F_STATUS).f90 H5f90global.lo +H5Eff$(F_STATUS).lo: $(srcdir)/H5Eff$(F_STATUS).f90 H5f90global.lo +H5Lff$(F_STATUS).lo: $(srcdir)/H5Lff$(F_STATUS).f90 H5f90global.lo +H5Off$(F_STATUS).lo: $(srcdir)/H5Off$(F_STATUS).f90 H5f90global.lo +H5Pff$(F_STATUS).lo: $(srcdir)/H5Pff$(F_STATUS).f90 H5f90global.lo +H5Rff$(F_STATUS).lo: $(srcdir)/H5Rff$(F_STATUS).f90 H5f90global.lo +H5Tff$(F_STATUS).lo: $(srcdir)/H5Tff$(F_STATUS).f90 H5f90global.lo H5Eff.lo: $(srcdir)/H5Eff.f90 H5f90global.lo H5Fff.lo: $(srcdir)/H5Fff.f90 H5f90global.lo H5Gff.lo: $(srcdir)/H5Gff.f90 H5f90global.lo @@ -1037,16 +1061,23 @@ H5Rff.lo: $(srcdir)/H5Rff.f90 H5f90global.lo H5Sff.lo: $(srcdir)/H5Sff.f90 H5f90global.lo H5Tff.lo: $(srcdir)/H5Tff.f90 H5f90global.lo H5Zff.lo: $(srcdir)/H5Zff.f90 H5f90global.lo -H5_DBLE_Interface$(F_DBLE).lo: $(srcdir)/H5_DBLE_Interface$(F_DBLE).f90 H5Aff.lo H5Dff.lo H5Pff.lo - -HDF5.lo: $(srcdir)/HDF5.f90 H5f90global.lo H5Aff.lo \ - H5Dff.lo H5Eff.lo H5Fff.lo H5Gff.lo H5Iff.lo H5Lff.lo \ - H5Pff.lo H5Rff.lo H5Sff.lo H5Tff.lo H5Zff.lo \ - H5_DBLE_Interface$(F_DBLE).lo +H5_DBLE_Interface$(F_DBLE).lo: $(srcdir)/H5_DBLE_Interface$(F_DBLE).f90 H5Aff$(F_STATUS).lo H5Dff$(F_STATUS).lo H5Eff$(F_STATUS).lo H5Pff$(F_STATUS).lo +HDF5.lo: $(srcdir)/HDF5.f90 H5f90global.lo H5_ff$(F_STATUS).lo H5_ff.lo H5Aff.lo H5Aff$(F_STATUS).lo \ + H5Dff.lo H5Dff$(F_STATUS).lo \ + H5Eff.lo H5Eff$(F_STATUS).lo \ + H5Fff.lo H5Gff.lo H5Iff.lo H5Lff.lo H5Lff$(F_STATUS).lo \ + H5Off.lo H5Off$(F_STATUS).lo H5Pff.lo H5Pff$(F_STATUS).lo H5Rff$(F_STATUS).lo H5Rff.lo \ + H5Sff.lo H5Tff.lo H5Tff$(F_STATUS).lo H5Zff.lo \ + H5_DBLE_Interface$(F_DBLE).lo H5FDmpioff.lo: $(srcdir)/H5FDmpioff.f90 H5f90global.lo -HDF5mpio.lo: $(srcdir)/H5FDmpioff.f90 H5f90global.lo H5Aff.lo \ - H5Dff.lo H5Eff.lo H5Fff.lo H5Gff.lo H5Iff.lo H5Lff.lo \ - H5Pff.lo H5Rff.lo H5Sff.lo H5Tff.lo H5Zff.lo H5_DBLE_Interface$(F_DBLE).lo H5FDmpioff.lo +HDF5mpio.lo: $(srcdir)/H5FDmpioff.f90 H5f90global.lo H5_ff$(F_STATUS).lo H5_ff.lo \ + H5Aff.lo H5Aff$(F_STATUS).lo \ + H5Dff.lo H5Dff$(F_STATUS).lo \ + H5Eff.lo H5Eff$(F_STATUS).lo \ + H5Fff.lo H5Gff.lo H5Iff.lo H5Lff.lo H5Lff$(F_STATUS).lo \ + H5Off.lo H5Off$(F_STATUS).lo H5Pff.lo H5Pff$(F_STATUS).lo H5Rff$(F_STATUS).lo H5Rff.lo \ + H5Sff.lo H5Tff.lo H5Tff$(F_STATUS).lo H5Zff.lo \ + H5_DBLE_Interface$(F_DBLE).lo H5FDmpioff.lo # lib/progs/tests targets recurse into subdirectories. build-* targets # build files in this directory. diff --git a/fortran/src/hdf5_fortrandll.def b/fortran/src/hdf5_fortrandll.def index 5f45350..6b3aad8 100644 --- a/fortran/src/hdf5_fortrandll.def +++ b/fortran/src/hdf5_fortrandll.def @@ -50,54 +50,54 @@ H5_DBLE_INTERFACE_mp_H5PREGISTER_DOUBLE H5A_mp_H5ACREATE_F H5A_mp_H5AOPEN_NAME_F H5A_mp_H5AOPEN_IDX_F -H5A_mp_H5AWRITE_INTEGER_SCALAR -H5A_mp_H5AWRITE_INTEGER_1 -H5A_mp_H5AWRITE_INTEGER_2 -H5A_mp_H5AWRITE_INTEGER_3 -H5A_mp_H5AWRITE_INTEGER_4 -H5A_mp_H5AWRITE_INTEGER_5 -H5A_mp_H5AWRITE_INTEGER_6 -H5A_mp_H5AWRITE_INTEGER_7 -H5A_mp_H5AWRITE_REAL_SCALAR -H5A_mp_H5AWRITE_REAL_1 -H5A_mp_H5AWRITE_REAL_2 -H5A_mp_H5AWRITE_REAL_3 -H5A_mp_H5AWRITE_REAL_4 -H5A_mp_H5AWRITE_REAL_5 -H5A_mp_H5AWRITE_REAL_6 -H5A_mp_H5AWRITE_REAL_7 -H5A_mp_H5AWRITE_CHAR_SCALAR -H5A_mp_H5AWRITE_CHAR_1 -H5A_mp_H5AWRITE_CHAR_2 -H5A_mp_H5AWRITE_CHAR_3 -H5A_mp_H5AWRITE_CHAR_4 -H5A_mp_H5AWRITE_CHAR_5 -H5A_mp_H5AWRITE_CHAR_6 -H5A_mp_H5AWRITE_CHAR_7 -H5A_mp_H5AREAD_INTEGER_SCALAR -H5A_mp_H5AREAD_INTEGER_1 -H5A_mp_H5AREAD_INTEGER_2 -H5A_mp_H5AREAD_INTEGER_3 -H5A_mp_H5AREAD_INTEGER_4 -H5A_mp_H5AREAD_INTEGER_5 -H5A_mp_H5AREAD_INTEGER_6 -H5A_mp_H5AREAD_INTEGER_7 -H5A_mp_H5AREAD_REAL_SCALAR -H5A_mp_H5AREAD_REAL_1 -H5A_mp_H5AREAD_REAL_2 -H5A_mp_H5AREAD_REAL_3 -H5A_mp_H5AREAD_REAL_4 -H5A_mp_H5AREAD_REAL_5 -H5A_mp_H5AREAD_REAL_6 -H5A_mp_H5AREAD_REAL_7 -H5A_mp_H5AREAD_CHAR_SCALAR -H5A_mp_H5AREAD_CHAR_1 -H5A_mp_H5AREAD_CHAR_2 -H5A_mp_H5AREAD_CHAR_3 -H5A_mp_H5AREAD_CHAR_4 -H5A_mp_H5AREAD_CHAR_5 -H5A_mp_H5AREAD_CHAR_6 -H5A_mp_H5AREAD_CHAR_7 +H5A_PROVISIONAL_mp_H5AWRITE_INTEGER_SCALAR +H5A_PROVISIONAL_mp_H5AWRITE_INTEGER_1 +H5A_PROVISIONAL_mp_H5AWRITE_INTEGER_2 +H5A_PROVISIONAL_mp_H5AWRITE_INTEGER_3 +H5A_PROVISIONAL_mp_H5AWRITE_INTEGER_4 +H5A_PROVISIONAL_mp_H5AWRITE_INTEGER_5 +H5A_PROVISIONAL_mp_H5AWRITE_INTEGER_6 +H5A_PROVISIONAL_mp_H5AWRITE_INTEGER_7 +H5A_PROVISIONAL_mp_H5AWRITE_REAL_SCALAR +H5A_PROVISIONAL_mp_H5AWRITE_REAL_1 +H5A_PROVISIONAL_mp_H5AWRITE_REAL_2 +H5A_PROVISIONAL_mp_H5AWRITE_REAL_3 +H5A_PROVISIONAL_mp_H5AWRITE_REAL_4 +H5A_PROVISIONAL_mp_H5AWRITE_REAL_5 +H5A_PROVISIONAL_mp_H5AWRITE_REAL_6 +H5A_PROVISIONAL_mp_H5AWRITE_REAL_7 +H5A_PROVISIONAL_mp_H5AWRITE_CHAR_SCALAR +H5A_PROVISIONAL_mp_H5AWRITE_CHAR_1 +H5A_PROVISIONAL_mp_H5AWRITE_CHAR_2 +H5A_PROVISIONAL_mp_H5AWRITE_CHAR_3 +H5A_PROVISIONAL_mp_H5AWRITE_CHAR_4 +H5A_PROVISIONAL_mp_H5AWRITE_CHAR_5 +H5A_PROVISIONAL_mp_H5AWRITE_CHAR_6 +H5A_PROVISIONAL_mp_H5AWRITE_CHAR_7 +H5A_PROVISIONAL_mp_H5AREAD_INTEGER_SCALAR +H5A_PROVISIONAL_mp_H5AREAD_INTEGER_1 +H5A_PROVISIONAL_mp_H5AREAD_INTEGER_2 +H5A_PROVISIONAL_mp_H5AREAD_INTEGER_3 +H5A_PROVISIONAL_mp_H5AREAD_INTEGER_4 +H5A_PROVISIONAL_mp_H5AREAD_INTEGER_5 +H5A_PROVISIONAL_mp_H5AREAD_INTEGER_6 +H5A_PROVISIONAL_mp_H5AREAD_INTEGER_7 +H5A_PROVISIONAL_mp_H5AREAD_REAL_SCALAR +H5A_PROVISIONAL_mp_H5AREAD_REAL_1 +H5A_PROVISIONAL_mp_H5AREAD_REAL_2 +H5A_PROVISIONAL_mp_H5AREAD_REAL_3 +H5A_PROVISIONAL_mp_H5AREAD_REAL_4 +H5A_PROVISIONAL_mp_H5AREAD_REAL_5 +H5A_PROVISIONAL_mp_H5AREAD_REAL_6 +H5A_PROVISIONAL_mp_H5AREAD_REAL_7 +H5A_PROVISIONAL_mp_H5AREAD_CHAR_SCALAR +H5A_PROVISIONAL_mp_H5AREAD_CHAR_1 +H5A_PROVISIONAL_mp_H5AREAD_CHAR_2 +H5A_PROVISIONAL_mp_H5AREAD_CHAR_3 +H5A_PROVISIONAL_mp_H5AREAD_CHAR_4 +H5A_PROVISIONAL_mp_H5AREAD_CHAR_5 +H5A_PROVISIONAL_mp_H5AREAD_CHAR_6 +H5A_PROVISIONAL_mp_H5AREAD_CHAR_7 H5A_mp_H5AGET_SPACE_F H5A_mp_H5AGET_TYPE_F H5A_mp_H5AGET_NAME_F @@ -124,58 +124,58 @@ H5A_mp_H5ARENAME_F H5D_mp_H5DCREATE_F H5D_mp_H5DOPEN_F H5D_mp_H5DCLOSE_F -H5D_mp_H5DWRITE_REFERENCE_OBJ -H5D_mp_H5DWRITE_REFERENCE_DSETREG -H5D_mp_H5DWRITE_INTEGER_SCALAR -H5D_mp_H5DWRITE_INTEGER_1 -H5D_mp_H5DWRITE_INTEGER_2 -H5D_mp_H5DWRITE_INTEGER_3 -H5D_mp_H5DWRITE_INTEGER_4 -H5D_mp_H5DWRITE_INTEGER_5 -H5D_mp_H5DWRITE_INTEGER_6 -H5D_mp_H5DWRITE_INTEGER_7 -H5D_mp_H5DWRITE_CHAR_SCALAR -H5D_mp_H5DWRITE_CHAR_1 -H5D_mp_H5DWRITE_CHAR_2 -H5D_mp_H5DWRITE_CHAR_3 -H5D_mp_H5DWRITE_CHAR_4 -H5D_mp_H5DWRITE_CHAR_5 -H5D_mp_H5DWRITE_CHAR_6 -H5D_mp_H5DWRITE_CHAR_7 -H5D_mp_H5DWRITE_REAL_SCALAR -H5D_mp_H5DWRITE_REAL_1 -H5D_mp_H5DWRITE_REAL_2 -H5D_mp_H5DWRITE_REAL_3 -H5D_mp_H5DWRITE_REAL_4 -H5D_mp_H5DWRITE_REAL_5 -H5D_mp_H5DWRITE_REAL_6 -H5D_mp_H5DWRITE_REAL_7 -H5D_mp_H5DREAD_REFERENCE_OBJ -H5D_mp_H5DREAD_REFERENCE_DSETREG -H5D_mp_H5DREAD_INTEGER_SCALAR -H5D_mp_H5DREAD_INTEGER_1 -H5D_mp_H5DREAD_INTEGER_2 -H5D_mp_H5DREAD_INTEGER_3 -H5D_mp_H5DREAD_INTEGER_4 -H5D_mp_H5DREAD_INTEGER_5 -H5D_mp_H5DREAD_INTEGER_6 -H5D_mp_H5DREAD_INTEGER_7 -H5D_mp_H5DREAD_CHAR_SCALAR -H5D_mp_H5DREAD_CHAR_1 -H5D_mp_H5DREAD_CHAR_2 -H5D_mp_H5DREAD_CHAR_3 -H5D_mp_H5DREAD_CHAR_4 -H5D_mp_H5DREAD_CHAR_5 -H5D_mp_H5DREAD_CHAR_6 -H5D_mp_H5DREAD_CHAR_7 -H5D_mp_H5DREAD_REAL_SCALAR -H5D_mp_H5DREAD_REAL_1 -H5D_mp_H5DREAD_REAL_2 -H5D_mp_H5DREAD_REAL_3 -H5D_mp_H5DREAD_REAL_4 -H5D_mp_H5DREAD_REAL_5 -H5D_mp_H5DREAD_REAL_6 -H5D_mp_H5DREAD_REAL_7 +H5D_PROVISIONAL_mp_H5DWRITE_REFERENCE_OBJ +H5D_PROVISIONAL_mp_H5DWRITE_REFERENCE_DSETREG +H5D_PROVISIONAL_mp_H5DWRITE_INTEGER_SCALAR +H5D_PROVISIONAL_mp_H5DWRITE_INTEGER_1 +H5D_PROVISIONAL_mp_H5DWRITE_INTEGER_2 +H5D_PROVISIONAL_mp_H5DWRITE_INTEGER_3 +H5D_PROVISIONAL_mp_H5DWRITE_INTEGER_4 +H5D_PROVISIONAL_mp_H5DWRITE_INTEGER_5 +H5D_PROVISIONAL_mp_H5DWRITE_INTEGER_6 +H5D_PROVISIONAL_mp_H5DWRITE_INTEGER_7 +H5D_PROVISIONAL_mp_H5DWRITE_CHAR_SCALAR +H5D_PROVISIONAL_mp_H5DWRITE_CHAR_1 +H5D_PROVISIONAL_mp_H5DWRITE_CHAR_2 +H5D_PROVISIONAL_mp_H5DWRITE_CHAR_3 +H5D_PROVISIONAL_mp_H5DWRITE_CHAR_4 +H5D_PROVISIONAL_mp_H5DWRITE_CHAR_5 +H5D_PROVISIONAL_mp_H5DWRITE_CHAR_6 +H5D_PROVISIONAL_mp_H5DWRITE_CHAR_7 +H5D_PROVISIONAL_mp_H5DWRITE_REAL_SCALAR +H5D_PROVISIONAL_mp_H5DWRITE_REAL_1 +H5D_PROVISIONAL_mp_H5DWRITE_REAL_2 +H5D_PROVISIONAL_mp_H5DWRITE_REAL_3 +H5D_PROVISIONAL_mp_H5DWRITE_REAL_4 +H5D_PROVISIONAL_mp_H5DWRITE_REAL_5 +H5D_PROVISIONAL_mp_H5DWRITE_REAL_6 +H5D_PROVISIONAL_mp_H5DWRITE_REAL_7 +H5D_PROVISIONAL_mp_H5DREAD_REFERENCE_OBJ +H5D_PROVISIONAL_mp_H5DREAD_REFERENCE_DSETREG +H5D_PROVISIONAL_mp_H5DREAD_INTEGER_SCALAR +H5D_PROVISIONAL_mp_H5DREAD_INTEGER_1 +H5D_PROVISIONAL_mp_H5DREAD_INTEGER_2 +H5D_PROVISIONAL_mp_H5DREAD_INTEGER_3 +H5D_PROVISIONAL_mp_H5DREAD_INTEGER_4 +H5D_PROVISIONAL_mp_H5DREAD_INTEGER_5 +H5D_PROVISIONAL_mp_H5DREAD_INTEGER_6 +H5D_PROVISIONAL_mp_H5DREAD_INTEGER_7 +H5D_PROVISIONAL_mp_H5DREAD_CHAR_SCALAR +H5D_PROVISIONAL_mp_H5DREAD_CHAR_1 +H5D_PROVISIONAL_mp_H5DREAD_CHAR_2 +H5D_PROVISIONAL_mp_H5DREAD_CHAR_3 +H5D_PROVISIONAL_mp_H5DREAD_CHAR_4 +H5D_PROVISIONAL_mp_H5DREAD_CHAR_5 +H5D_PROVISIONAL_mp_H5DREAD_CHAR_6 +H5D_PROVISIONAL_mp_H5DREAD_CHAR_7 +H5D_PROVISIONAL_mp_H5DREAD_REAL_SCALAR +H5D_PROVISIONAL_mp_H5DREAD_REAL_1 +H5D_PROVISIONAL_mp_H5DREAD_REAL_2 +H5D_PROVISIONAL_mp_H5DREAD_REAL_3 +H5D_PROVISIONAL_mp_H5DREAD_REAL_4 +H5D_PROVISIONAL_mp_H5DREAD_REAL_5 +H5D_PROVISIONAL_mp_H5DREAD_REAL_6 +H5D_PROVISIONAL_mp_H5DREAD_REAL_7 H5D_mp_H5DGET_SPACE_F H5D_mp_H5DGET_TYPE_F H5D_mp_H5DSET_EXTENT_F @@ -188,9 +188,9 @@ H5D_mp_H5DWRITE_VL_REAL H5D_mp_H5DREAD_VL_REAL H5D_mp_H5DWRITE_VL_STRING H5D_mp_H5DREAD_VL_STRING -H5D_mp_H5DFILL_INTEGER -H5D_mp_H5DFILL_REAL -H5D_mp_H5DFILL_CHAR +H5D_PROVISIONAL_mp_H5DFILL_INTEGER +H5D_PROVISIONAL_mp_H5DFILL_REAL +H5D_PROVISIONAL_mp_H5DFILL_CHAR H5D_mp_H5DGET_SPACE_STATUS_F H5D_mp_H5DCREATE_ANON_F H5D_mp_H5DGET_SPACE_F @@ -205,7 +205,7 @@ H5E_mp_H5ECLEAR_F H5E_mp_H5EPRINT_F H5E_mp_H5EGET_MAJOR_F H5E_mp_H5EGET_MINOR_F -H5E_mp_H5ESET_AUTO_F +H5E_PROVISIONAL_mp_H5ESET_AUTO_F ; H5F H5F_mp_H5FCREATE_F H5F_mp_H5FFLUSH_F @@ -297,12 +297,12 @@ H5P_mp_H5PCLOSE_F H5P_mp_H5PSET_CHUNK_F H5P_mp_H5PGET_CHUNK_F H5P_mp_H5PSET_DEFLATE_F -H5P_mp_H5PSET_FILL_VALUE_INTEGER -H5P_mp_H5PGET_FILL_VALUE_INTEGER -H5P_mp_H5PSET_FILL_VALUE_REAL -H5P_mp_H5PGET_FILL_VALUE_REAL -H5P_mp_H5PSET_FILL_VALUE_CHAR -H5P_mp_H5PGET_FILL_VALUE_CHAR +H5P_PROVISIONAL_mp_H5PSET_FILL_VALUE_INTEGER +H5P_PROVISIONAL_mp_H5PGET_FILL_VALUE_INTEGER +H5P_PROVISIONAL_mp_H5PSET_FILL_VALUE_REAL +H5P_PROVISIONAL_mp_H5PGET_FILL_VALUE_REAL +H5P_PROVISIONAL_mp_H5PSET_FILL_VALUE_CHAR +H5P_PROVISIONAL_mp_H5PGET_FILL_VALUE_CHAR H5P_mp_H5PGET_VERSION_F H5P_mp_H5PSET_USERBLOCK_F H5P_mp_H5PGET_USERBLOCK_F @@ -354,12 +354,12 @@ H5P_mp_H5PSET_SMALL_DATA_BLOCK_SIZE_F H5P_mp_H5PGET_SMALL_DATA_BLOCK_SIZE_F H5P_mp_H5PSET_HYPER_VECTOR_SIZE_F H5P_mp_H5PGET_HYPER_VECTOR_SIZE_F -H5P_mp_H5PSET_INTEGER -H5P_mp_H5PSET_REAL -H5P_mp_H5PSET_CHAR -H5P_mp_H5PGET_INTEGER -H5P_mp_H5PGET_REAL -H5P_mp_H5PGET_CHAR +H5P_PROVISIONAL_mp_H5PSET_INTEGER +H5P_PROVISIONAL_mp_H5PSET_REAL +H5P_PROVISIONAL_mp_H5PSET_CHAR +H5P_PROVISIONAL_mp_H5PGET_INTEGER +H5P_PROVISIONAL_mp_H5PGET_REAL +H5P_PROVISIONAL_mp_H5PGET_CHAR H5P_mp_H5PEXIST_F H5P_mp_H5PGET_SIZE_F H5P_mp_H5PGET_NPROPS_F @@ -370,13 +370,13 @@ H5P_mp_H5PCOPY_PROP_F H5P_mp_H5PREMOVE_F H5P_mp_H5PUNREGISTER_F H5P_mp_H5PCLOSE_CLASS_F -H5P_mp_H5PCREATE_CLASS_F -H5P_mp_H5PREGISTER_INTEGER -H5P_mp_H5PREGISTER_REAL -H5P_mp_H5PREGISTER_CHAR -H5P_mp_H5PINSERT_INTEGER -H5P_mp_H5PINSERT_REAL -H5P_mp_H5PINSERT_CHAR +H5P_PROVISIONAL_mp_H5PCREATE_CLASS_F +H5P_PROVISIONAL_mp_H5PREGISTER_INTEGER +H5P_PROVISIONAL_mp_H5PREGISTER_REAL +H5P_PROVISIONAL_mp_H5PREGISTER_CHAR +H5P_PROVISIONAL_mp_H5PINSERT_INTEGER +H5P_PROVISIONAL_mp_H5PINSERT_REAL +H5P_PROVISIONAL_mp_H5PINSERT_CHAR H5P_mp_H5PSET_SHUFFLE_F H5P_mp_H5PSET_EDC_CHECK_F H5P_mp_H5PGET_EDC_CHECK_F @@ -424,14 +424,14 @@ 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 -H5R_mp_H5RDEREFERENCE_OBJECT_F -H5R_mp_H5RDEREFERENCE_REGION_F +H5R_PROVISIONAL_mp_H5RCREATE_OBJECT_F +H5R_PROVISIONAL_mp_H5RCREATE_REGION_F +H5R_PROVISIONAL_mp_H5RDEREFERENCE_OBJECT_F +H5R_PROVISIONAL_mp_H5RDEREFERENCE_REGION_F H5R_mp_H5RGET_REGION_REGION_F H5R_mp_H5RGET_OBJECT_TYPE_OBJ_F -H5R_mp_H5RGET_NAME_OBJECT_F -H5R_mp_H5RGET_NAME_REGION_F +H5R_PROVISIONAL_mp_H5RGET_NAME_OBJECT_F +H5R_PROVISIONAL_mp_H5RGET_NAME_REGION_F ; H5S H5S_mp_H5SCREATE_SIMPLE_F H5S_mp_H5SCLOSE_F diff --git a/fortran/src/phdf5_fortrandll.def b/fortran/src/phdf5_fortrandll.def new file mode 100644 index 0000000..a4bc9eb --- /dev/null +++ b/fortran/src/phdf5_fortrandll.def @@ -0,0 +1,530 @@ +EXPORTS +; H5LIB +H5LIB_mp_H5OPEN_F +H5LIB_mp_H5CLOSE_F +H5LIB_mp_H5GET_LIBVERSION_F +H5LIB_mp_H5CHECK_VERSION_F +H5LIB_mp_H5GARBAGE_COLLECT_F +H5LIB_mp_H5DONT_ATEXIT_F +; H5_DBLE_INTERFACE +H5_DBLE_INTERFACE_mp_H5AREAD_DOUBLE_SCALAR +H5_DBLE_INTERFACE_mp_H5AREAD_DOUBLE_1 +H5_DBLE_INTERFACE_mp_H5AREAD_DOUBLE_2 +H5_DBLE_INTERFACE_mp_H5AREAD_DOUBLE_3 +H5_DBLE_INTERFACE_mp_H5AREAD_DOUBLE_4 +H5_DBLE_INTERFACE_mp_H5AREAD_DOUBLE_5 +H5_DBLE_INTERFACE_mp_H5AREAD_DOUBLE_6 +H5_DBLE_INTERFACE_mp_H5AREAD_DOUBLE_7 +H5_DBLE_INTERFACE_mp_H5AWRITE_DOUBLE_SCALAR +H5_DBLE_INTERFACE_mp_H5AWRITE_DOUBLE_1 +H5_DBLE_INTERFACE_mp_H5AWRITE_DOUBLE_2 +H5_DBLE_INTERFACE_mp_H5AWRITE_DOUBLE_3 +H5_DBLE_INTERFACE_mp_H5AWRITE_DOUBLE_4 +H5_DBLE_INTERFACE_mp_H5AWRITE_DOUBLE_5 +H5_DBLE_INTERFACE_mp_H5AWRITE_DOUBLE_6 +H5_DBLE_INTERFACE_mp_H5AWRITE_DOUBLE_7 +H5_DBLE_INTERFACE_mp_H5DFILL_DOUBLE +H5_DBLE_INTERFACE_mp_H5DREAD_DOUBLE_SCALAR +H5_DBLE_INTERFACE_mp_H5DREAD_DOUBLE_1 +H5_DBLE_INTERFACE_mp_H5DREAD_DOUBLE_2 +H5_DBLE_INTERFACE_mp_H5DREAD_DOUBLE_3 +H5_DBLE_INTERFACE_mp_H5DREAD_DOUBLE_4 +H5_DBLE_INTERFACE_mp_H5DREAD_DOUBLE_5 +H5_DBLE_INTERFACE_mp_H5DREAD_DOUBLE_6 +H5_DBLE_INTERFACE_mp_H5DREAD_DOUBLE_7 +H5_DBLE_INTERFACE_mp_H5DWRITE_DOUBLE_SCALAR +H5_DBLE_INTERFACE_mp_H5DWRITE_DOUBLE_1 +H5_DBLE_INTERFACE_mp_H5DWRITE_DOUBLE_2 +H5_DBLE_INTERFACE_mp_H5DWRITE_DOUBLE_3 +H5_DBLE_INTERFACE_mp_H5DWRITE_DOUBLE_4 +H5_DBLE_INTERFACE_mp_H5DWRITE_DOUBLE_5 +H5_DBLE_INTERFACE_mp_H5DWRITE_DOUBLE_6 +H5_DBLE_INTERFACE_mp_H5DWRITE_DOUBLE_7 +H5_DBLE_INTERFACE_mp_H5PGET_DOUBLE +H5_DBLE_INTERFACE_mp_H5PSET_DOUBLE +H5_DBLE_INTERFACE_mp_H5PSET_FILL_VALUE_DOUBLE +H5_DBLE_INTERFACE_mp_H5PGET_FILL_VALUE_DOUBLE +H5_DBLE_INTERFACE_mp_H5PINSERT_DOUBLE +H5_DBLE_INTERFACE_mp_H5PREGISTER_DOUBLE +; H5A +H5A_mp_H5ACREATE_F +H5A_mp_H5AOPEN_NAME_F +H5A_mp_H5AOPEN_IDX_F +H5A_PROVISIONAL_mp_H5AWRITE_INTEGER_SCALAR +H5A_PROVISIONAL_mp_H5AWRITE_INTEGER_1 +H5A_PROVISIONAL_mp_H5AWRITE_INTEGER_2 +H5A_PROVISIONAL_mp_H5AWRITE_INTEGER_3 +H5A_PROVISIONAL_mp_H5AWRITE_INTEGER_4 +H5A_PROVISIONAL_mp_H5AWRITE_INTEGER_5 +H5A_PROVISIONAL_mp_H5AWRITE_INTEGER_6 +H5A_PROVISIONAL_mp_H5AWRITE_INTEGER_7 +H5A_PROVISIONAL_mp_H5AWRITE_REAL_SCALAR +H5A_PROVISIONAL_mp_H5AWRITE_REAL_1 +H5A_PROVISIONAL_mp_H5AWRITE_REAL_2 +H5A_PROVISIONAL_mp_H5AWRITE_REAL_3 +H5A_PROVISIONAL_mp_H5AWRITE_REAL_4 +H5A_PROVISIONAL_mp_H5AWRITE_REAL_5 +H5A_PROVISIONAL_mp_H5AWRITE_REAL_6 +H5A_PROVISIONAL_mp_H5AWRITE_REAL_7 +H5A_PROVISIONAL_mp_H5AWRITE_CHAR_SCALAR +H5A_PROVISIONAL_mp_H5AWRITE_CHAR_1 +H5A_PROVISIONAL_mp_H5AWRITE_CHAR_2 +H5A_PROVISIONAL_mp_H5AWRITE_CHAR_3 +H5A_PROVISIONAL_mp_H5AWRITE_CHAR_4 +H5A_PROVISIONAL_mp_H5AWRITE_CHAR_5 +H5A_PROVISIONAL_mp_H5AWRITE_CHAR_6 +H5A_PROVISIONAL_mp_H5AWRITE_CHAR_7 +H5A_PROVISIONAL_mp_H5AREAD_INTEGER_SCALAR +H5A_PROVISIONAL_mp_H5AREAD_INTEGER_1 +H5A_PROVISIONAL_mp_H5AREAD_INTEGER_2 +H5A_PROVISIONAL_mp_H5AREAD_INTEGER_3 +H5A_PROVISIONAL_mp_H5AREAD_INTEGER_4 +H5A_PROVISIONAL_mp_H5AREAD_INTEGER_5 +H5A_PROVISIONAL_mp_H5AREAD_INTEGER_6 +H5A_PROVISIONAL_mp_H5AREAD_INTEGER_7 +H5A_PROVISIONAL_mp_H5AREAD_REAL_SCALAR +H5A_PROVISIONAL_mp_H5AREAD_REAL_1 +H5A_PROVISIONAL_mp_H5AREAD_REAL_2 +H5A_PROVISIONAL_mp_H5AREAD_REAL_3 +H5A_PROVISIONAL_mp_H5AREAD_REAL_4 +H5A_PROVISIONAL_mp_H5AREAD_REAL_5 +H5A_PROVISIONAL_mp_H5AREAD_REAL_6 +H5A_PROVISIONAL_mp_H5AREAD_REAL_7 +H5A_PROVISIONAL_mp_H5AREAD_CHAR_SCALAR +H5A_PROVISIONAL_mp_H5AREAD_CHAR_1 +H5A_PROVISIONAL_mp_H5AREAD_CHAR_2 +H5A_PROVISIONAL_mp_H5AREAD_CHAR_3 +H5A_PROVISIONAL_mp_H5AREAD_CHAR_4 +H5A_PROVISIONAL_mp_H5AREAD_CHAR_5 +H5A_PROVISIONAL_mp_H5AREAD_CHAR_6 +H5A_PROVISIONAL_mp_H5AREAD_CHAR_7 +H5A_mp_H5AGET_SPACE_F +H5A_mp_H5AGET_TYPE_F +H5A_mp_H5AGET_NAME_F +H5A_mp_H5AGET_NAME_BY_IDX_F +H5A_mp_H5AGET_NUM_ATTRS_F +H5A_mp_H5ADELETE_F +H5A_mp_H5ACLOSE_F +H5A_mp_H5AGET_STORAGE_SIZE_F +H5A_mp_H5AGET_CREATE_PLIST_F +H5A_mp_H5ARENAME_BY_NAME_F +H5A_mp_H5AOPEN_F +H5A_mp_H5ADELETE_BY_IDX_F +H5A_mp_H5ADELETE_BY_NAME_F +H5A_mp_H5AOPEN_BY_IDX_F +H5A_mp_H5AGET_INFO_F +H5A_mp_H5AGET_INFO_BY_IDX_F +H5A_mp_H5AGET_INFO_BY_NAME_F +H5A_mp_H5ACREATE_BY_NAME_F +H5A_mp_H5AEXISTS_F +H5A_mp_H5AEXISTS_BY_NAME_F +H5A_mp_H5AOPEN_BY_NAME_F +H5A_mp_H5ARENAME_F +; H5D +H5D_mp_H5DCREATE_F +H5D_mp_H5DOPEN_F +H5D_mp_H5DCLOSE_F +H5D_PROVISIONAL_mp_H5DWRITE_REFERENCE_OBJ +H5D_PROVISIONAL_mp_H5DWRITE_REFERENCE_DSETREG +H5D_PROVISIONAL_mp_H5DWRITE_INTEGER_SCALAR +H5D_PROVISIONAL_mp_H5DWRITE_INTEGER_1 +H5D_PROVISIONAL_mp_H5DWRITE_INTEGER_2 +H5D_PROVISIONAL_mp_H5DWRITE_INTEGER_3 +H5D_PROVISIONAL_mp_H5DWRITE_INTEGER_4 +H5D_PROVISIONAL_mp_H5DWRITE_INTEGER_5 +H5D_PROVISIONAL_mp_H5DWRITE_INTEGER_6 +H5D_PROVISIONAL_mp_H5DWRITE_INTEGER_7 +H5D_PROVISIONAL_mp_H5DWRITE_CHAR_SCALAR +H5D_PROVISIONAL_mp_H5DWRITE_CHAR_1 +H5D_PROVISIONAL_mp_H5DWRITE_CHAR_2 +H5D_PROVISIONAL_mp_H5DWRITE_CHAR_3 +H5D_PROVISIONAL_mp_H5DWRITE_CHAR_4 +H5D_PROVISIONAL_mp_H5DWRITE_CHAR_5 +H5D_PROVISIONAL_mp_H5DWRITE_CHAR_6 +H5D_PROVISIONAL_mp_H5DWRITE_CHAR_7 +H5D_PROVISIONAL_mp_H5DWRITE_REAL_SCALAR +H5D_PROVISIONAL_mp_H5DWRITE_REAL_1 +H5D_PROVISIONAL_mp_H5DWRITE_REAL_2 +H5D_PROVISIONAL_mp_H5DWRITE_REAL_3 +H5D_PROVISIONAL_mp_H5DWRITE_REAL_4 +H5D_PROVISIONAL_mp_H5DWRITE_REAL_5 +H5D_PROVISIONAL_mp_H5DWRITE_REAL_6 +H5D_PROVISIONAL_mp_H5DWRITE_REAL_7 +H5D_PROVISIONAL_mp_H5DREAD_REFERENCE_OBJ +H5D_PROVISIONAL_mp_H5DREAD_REFERENCE_DSETREG +H5D_PROVISIONAL_mp_H5DREAD_INTEGER_SCALAR +H5D_PROVISIONAL_mp_H5DREAD_INTEGER_1 +H5D_PROVISIONAL_mp_H5DREAD_INTEGER_2 +H5D_PROVISIONAL_mp_H5DREAD_INTEGER_3 +H5D_PROVISIONAL_mp_H5DREAD_INTEGER_4 +H5D_PROVISIONAL_mp_H5DREAD_INTEGER_5 +H5D_PROVISIONAL_mp_H5DREAD_INTEGER_6 +H5D_PROVISIONAL_mp_H5DREAD_INTEGER_7 +H5D_PROVISIONAL_mp_H5DREAD_CHAR_SCALAR +H5D_PROVISIONAL_mp_H5DREAD_CHAR_1 +H5D_PROVISIONAL_mp_H5DREAD_CHAR_2 +H5D_PROVISIONAL_mp_H5DREAD_CHAR_3 +H5D_PROVISIONAL_mp_H5DREAD_CHAR_4 +H5D_PROVISIONAL_mp_H5DREAD_CHAR_5 +H5D_PROVISIONAL_mp_H5DREAD_CHAR_6 +H5D_PROVISIONAL_mp_H5DREAD_CHAR_7 +H5D_PROVISIONAL_mp_H5DREAD_REAL_SCALAR +H5D_PROVISIONAL_mp_H5DREAD_REAL_1 +H5D_PROVISIONAL_mp_H5DREAD_REAL_2 +H5D_PROVISIONAL_mp_H5DREAD_REAL_3 +H5D_PROVISIONAL_mp_H5DREAD_REAL_4 +H5D_PROVISIONAL_mp_H5DREAD_REAL_5 +H5D_PROVISIONAL_mp_H5DREAD_REAL_6 +H5D_PROVISIONAL_mp_H5DREAD_REAL_7 +H5D_mp_H5DGET_SPACE_F +H5D_mp_H5DGET_TYPE_F +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_H5DWRITE_VL_INTEGER +H5D_mp_H5DREAD_VL_INTEGER +H5D_mp_H5DWRITE_VL_REAL +H5D_mp_H5DREAD_VL_REAL +H5D_mp_H5DWRITE_VL_STRING +H5D_mp_H5DREAD_VL_STRING +H5D_PROVISIONAL_mp_H5DFILL_INTEGER +H5D_PROVISIONAL_mp_H5DFILL_REAL +H5D_PROVISIONAL_mp_H5DFILL_CHAR +H5D_mp_H5DGET_SPACE_STATUS_F +H5D_mp_H5DCREATE_ANON_F +H5D_mp_H5DGET_SPACE_F +H5D_mp_H5DGET_TYPE_F +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 +H5E_mp_H5EGET_MAJOR_F +H5E_mp_H5EGET_MINOR_F +H5E_PROVISIONAL_mp_H5ESET_AUTO_F +; H5F +H5F_mp_H5FCREATE_F +H5F_mp_H5FFLUSH_F +H5F_mp_H5FCLOSE_F +H5F_mp_H5FGET_OBJ_COUNT_F +H5F_mp_H5FGET_OBJ_IDS_F +H5F_mp_H5FGET_FREESPACE_F +H5F_mp_H5FMOUNT_F +H5F_mp_H5FUNMOUNT_F +H5F_mp_H5FOPEN_F +H5F_mp_H5FREOPEN_F +H5F_mp_H5FGET_CREATE_PLIST_F +H5F_mp_H5FGET_ACCESS_PLIST_F +H5F_mp_H5FIS_HDF5_F +H5F_mp_H5FGET_NAME_F +H5F_mp_H5FGET_FILESIZE_F +; H5G +H5G_mp_H5GOPEN_F +H5G_mp_H5GCREATE_F +H5G_mp_H5GCLOSE_F +H5G_mp_H5GGET_OBJ_INFO_IDX_F +H5G_mp_H5GN_MEMBERS_F +H5G_mp_H5GLINK_F +H5G_mp_H5GLINK2_F +H5G_mp_H5GUNLINK_F +H5G_mp_H5GMOVE_F +H5G_mp_H5GMOVE2_F +H5G_mp_H5GGET_LINKVAL_F +H5G_mp_H5GSET_COMMENT_F +H5G_mp_H5GGET_COMMENT_F +H5G_mp_H5GCREATE_ANON_F +H5G_mp_H5GGET_CREATE_PLIST_F +H5G_mp_H5GGET_INFO_F +H5G_mp_H5GGET_INFO_BY_IDX_F +H5G_mp_H5GGET_INFO_BY_NAME_F +H5G_mp_H5GGET_OBJ_INFO_IDX_F +; H5GLOBAL +; PREDEFINED_TYPES DATA +; FLOATING_TYPES DATA +; INTEGER_TYPES DATA +; H5F_FLAGS DATA +; H5GENERIC_FLAGS DATA +; H5G_FLAGS DATA +; H5D_FLAGS DATA +; H5FD_FLAGS DATA +; H5FD_HID_FLAGS DATA +; H5I_FLAGS DATA +; H5L_FLAGS DATA +; H5O_FLAGS DATA +; H5P_FLAGS DATA +; H5P_FLAGS_INT DATA +; H5R_FLAGS DATA +; H5S_FLAGS DATA +; H5T_FLAGS DATA +; H5Z_FLAGS DATA +; H5LIB_FLAGS DATA +; H5I +H5I_mp_H5IGET_TYPE_F +H5I_mp_H5IGET_NAME_F +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 +H5L_mp_H5LCREATE_SOFT_F +H5L_mp_H5LCREATE_HARD_F +H5L_mp_H5LCREATE_EXTERNAL_F +H5L_mp_H5LDELETE_BY_IDX_F +H5L_mp_H5LEXISTS_F +H5L_mp_H5LGET_INFO_F +H5L_mp_H5LGET_INFO_BY_IDX_F +H5L_mp_H5LIS_REGISTERED_F +H5L_mp_H5LMOVE_F +H5L_mp_H5LGET_NAME_BY_IDX_F +; H5O +H5O_mp_H5OLINK_F +H5O_mp_H5OOPEN_F +H5O_mp_H5OOPEN_BY_ADDR_F +; H5P +H5P_mp_H5PCREATE_F +H5P_mp_H5PSET_PRESERVE_F +H5P_mp_H5PGET_PRESERVE_F +H5P_mp_H5PGET_CLASS_F +H5P_mp_H5PCOPY_F +H5P_mp_H5PCLOSE_F +H5P_mp_H5PSET_CHUNK_F +H5P_mp_H5PGET_CHUNK_F +H5P_mp_H5PSET_DEFLATE_F +H5P_PROVISIONAL_mp_H5PSET_FILL_VALUE_INTEGER +H5P_PROVISIONAL_mp_H5PGET_FILL_VALUE_INTEGER +H5P_PROVISIONAL_mp_H5PSET_FILL_VALUE_REAL +H5P_PROVISIONAL_mp_H5PGET_FILL_VALUE_REAL +H5P_PROVISIONAL_mp_H5PSET_FILL_VALUE_CHAR +H5P_PROVISIONAL_mp_H5PGET_FILL_VALUE_CHAR +H5P_mp_H5PGET_VERSION_F +H5P_mp_H5PSET_USERBLOCK_F +H5P_mp_H5PGET_USERBLOCK_F +H5P_mp_H5PSET_SIZES_F +H5P_mp_H5PGET_SIZES_F +H5P_mp_H5PSET_SYM_K_F +H5P_mp_H5PGET_SYM_K_F +H5P_mp_H5PSET_ISTORE_K_F +H5P_mp_H5PGET_ISTORE_K_F +H5P_mp_H5PGET_DRIVER_F +H5P_mp_H5PSET_FAPL_STDIO_F +H5P_mp_H5PSET_FAPL_SEC2_F +H5P_mp_H5PSET_ALIGNMENT_F +H5P_mp_H5PGET_ALIGNMENT_F +H5P_mp_H5PSET_FAPL_CORE_F +H5P_mp_H5PGET_FAPL_CORE_F +H5P_mp_H5PSET_FAPL_FAMILY_F +H5P_mp_H5PGET_FAPL_FAMILY_F +H5P_mp_H5PSET_CACHE_F +H5P_mp_H5PGET_CACHE_F +H5P_mp_H5PSET_FAPL_SPLIT_F +H5P_mp_H5PSET_GC_REFERENCES_F +H5P_mp_H5PGET_GC_REFERENCES_F +H5P_mp_H5PSET_LAYOUT_F +H5P_mp_H5PGET_LAYOUT_F +H5P_mp_H5PSET_FILTER_F +H5P_mp_H5PGET_NFILTERS_F +H5P_mp_H5PGET_FILTER_F +H5P_mp_H5PSET_EXTERNAL_F +H5P_mp_H5PGET_EXTERNAL_COUNT_F +H5P_mp_H5PGET_EXTERNAL_F +H5P_mp_H5PSET_BTREE_RATIOS_F +H5P_mp_H5PGET_BTREE_RATIOS_F +H5P_mp_H5PGET_FCLOSE_DEGREE_F +H5P_mp_H5PSET_FCLOSE_DEGREE_F +H5P_mp_H5PEQUAL_F +H5P_mp_H5PSET_BUFFER_F +H5P_mp_H5PGET_BUFFER_F +H5P_mp_H5PFILL_VALUE_DEFINED_F +H5P_mp_H5PSET_ALLOC_TIME_F +H5P_mp_H5PGET_ALLOC_TIME_F +H5P_mp_H5PSET_FILL_TIME_F +H5P_mp_H5PGET_FILL_TIME_F +H5P_mp_H5PSET_META_BLOCK_SIZE_F +H5P_mp_H5PGET_META_BLOCK_SIZE_F +H5P_mp_H5PSET_SIEVE_BUF_SIZE_F +H5P_mp_H5PGET_SIEVE_BUF_SIZE_F +H5P_mp_H5PSET_SMALL_DATA_BLOCK_SIZE_F +H5P_mp_H5PGET_SMALL_DATA_BLOCK_SIZE_F +H5P_mp_H5PSET_HYPER_VECTOR_SIZE_F +H5P_mp_H5PGET_HYPER_VECTOR_SIZE_F +H5P_PROVISIONAL_mp_H5PSET_INTEGER +H5P_PROVISIONAL_mp_H5PSET_REAL +H5P_PROVISIONAL_mp_H5PSET_CHAR +H5P_PROVISIONAL_mp_H5PGET_INTEGER +H5P_PROVISIONAL_mp_H5PGET_REAL +H5P_PROVISIONAL_mp_H5PGET_CHAR +H5P_mp_H5PEXIST_F +H5P_mp_H5PGET_SIZE_F +H5P_mp_H5PGET_NPROPS_F +H5P_mp_H5PGET_CLASS_NAME_F +H5P_mp_H5PGET_CLASS_PARENT_F +H5P_mp_H5PISA_CLASS_F +H5P_mp_H5PCOPY_PROP_F +H5P_mp_H5PREMOVE_F +H5P_mp_H5PUNREGISTER_F +H5P_mp_H5PCLOSE_CLASS_F +H5P_PROVISIONAL_mp_H5PCREATE_CLASS_F +H5P_PROVISIONAL_mp_H5PREGISTER_INTEGER +H5P_PROVISIONAL_mp_H5PREGISTER_REAL +H5P_PROVISIONAL_mp_H5PREGISTER_CHAR +H5P_PROVISIONAL_mp_H5PINSERT_INTEGER +H5P_PROVISIONAL_mp_H5PINSERT_REAL +H5P_PROVISIONAL_mp_H5PINSERT_CHAR +H5P_mp_H5PSET_SHUFFLE_F +H5P_mp_H5PSET_EDC_CHECK_F +H5P_mp_H5PGET_EDC_CHECK_F +H5P_mp_H5PSET_FLETCHER32_F +H5P_mp_H5PSET_FAMILY_OFFSET_F +H5P_mp_H5PSET_FAPL_MULTI_L +H5P_mp_H5PSET_FAPL_MULTI_S +H5P_mp_H5PGET_FAPL_MULTI_F +H5P_mp_H5PSET_SZIP_F +H5P_mp_H5PALL_FILTERS_AVAIL_F +H5P_mp_H5PGET_FILTER_BY_ID_F +H5P_mp_H5PMODIFY_FILTER_F +H5P_mp_H5PREMOVE_FILTER_F +H5P_mp_H5PGET_ATTR_PHASE_CHANGE_F +H5P_mp_H5PSET_ATTR_CREATION_ORDER_F +H5P_mp_H5PSET_SHARED_MESG_NINDEXES_F +H5P_mp_H5PSET_SHARED_MESG_INDEX_F +H5P_mp_H5PGET_ATTR_CREATION_ORDER_F +H5P_mp_H5PSET_LIBVER_BOUNDS_F +H5P_mp_H5PSET_LINK_CREATION_ORDER_F +H5P_mp_H5PGET_LINK_PHASE_CHANGE_F +H5P_mp_H5PGET_OBJ_TRACK_TIMES_F +H5P_mp_H5PSET_OBJ_TRACK_TIMES_F +H5P_mp_H5PSET_CREATE_INTER_GROUP_F +H5P_mp_H5PGET_LINK_CREATION_ORDER_F +H5P_mp_H5PSET_CHAR_ENCODING_F +H5P_mp_H5PGET_CHAR_ENCODING_F +H5P_mp_H5PSET_COPY_OBJECT_F +H5P_mp_H5PGET_COPY_OBJECT_F +H5P_mp_H5PGET_DATA_TRANSFORM_F +H5P_mp_H5PSET_DATA_TRANSFORM_F +H5P_mp_H5PGET_LOCAL_HEAP_SIZE_HINT_F +H5P_mp_H5PGET_EST_LINK_INFO_F +H5P_mp_H5PSET_LOCAL_HEAP_SIZE_HINT_F +H5P_mp_H5PSET_EST_LINK_INFO_F +H5P_mp_H5PSET_LINK_PHASE_CHANGE_F +H5P_mp_H5PSET_FAPL_DIRECT_F +H5P_mp_H5PGET_FAPL_DIRECT_F +H5P_mp_H5PSET_ATTR_PHASE_CHANGE_F +H5P_mp_H5PSET_NBIT_F +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_PROVISIONAL_mp_H5RCREATE_OBJECT_F +H5R_PROVISIONAL_mp_H5RCREATE_REGION_F +H5R_PROVISIONAL_mp_H5RDEREFERENCE_OBJECT_F +H5R_PROVISIONAL_mp_H5RDEREFERENCE_REGION_F +H5R_mp_H5RGET_REGION_REGION_F +H5R_mp_H5RGET_OBJECT_TYPE_OBJ_F +H5R_PROVISIONAL_mp_H5RGET_NAME_OBJECT_F +H5R_PROVISIONAL_mp_H5RGET_NAME_REGION_F +; H5S +H5S_mp_H5SCREATE_SIMPLE_F +H5S_mp_H5SCLOSE_F +H5S_mp_H5SCREATE_F +H5S_mp_H5SCOPY_F +H5S_mp_H5SGET_SELECT_HYPER_NBLOCKS_F +H5S_mp_H5SGET_SELECT_HYPER_BLOCKLIST_F +H5S_mp_H5SGET_SELECT_BOUNDS_F +H5S_mp_H5SGET_SELECT_ELEM_NPOINTS_F +H5S_mp_H5SGET_SELECT_ELEM_POINTLIST_F +H5S_mp_H5SSELECT_ELEMENTS_F +H5S_mp_H5SSELECT_ALL_F +H5S_mp_H5SSELECT_NONE_F +H5S_mp_H5SSELECT_VALID_F +H5S_mp_H5SGET_SIMPLE_EXTENT_NPOINTS_F +H5S_mp_H5SGET_SELECT_NPOINTS_F +H5S_mp_H5SGET_SIMPLE_EXTENT_NDIMS_F +H5S_mp_H5SGET_SIMPLE_EXTENT_DIMS_F +H5S_mp_H5SGET_SIMPLE_EXTENT_TYPE_F +H5S_mp_H5SSET_EXTENT_SIMPLE_F +H5S_mp_H5SIS_SIMPLE_F +H5S_mp_H5SOFFSET_SIMPLE_F +H5S_mp_H5SEXTENT_COPY_F +H5S_mp_H5SSET_EXTENT_NONE_F +H5S_mp_H5SSELECT_HYPERSLAB_F +H5S_mp_H5SGET_SELECT_TYPE_F +H5S_mp_H5SDECODE_F +H5S_mp_H5SENCODE_F +H5S_mp_H5SEXTENT_EQUAL_F +; H5T +H5T_mp_H5TOPEN_F +H5T_mp_H5TCOMMIT_F +H5T_mp_H5TCOPY_F +H5T_mp_H5TEQUAL_F +H5T_mp_H5TCLOSE_F +H5T_mp_H5TGET_CLASS_F +H5T_mp_H5TGET_SIZE_F +H5T_mp_H5TSET_SIZE_F +H5T_mp_H5TGET_ORDER_F +H5T_mp_H5TSET_ORDER_F +H5T_mp_H5TGET_PRECISION_F +H5T_mp_H5TSET_PRECISION_F +H5T_mp_H5TGET_OFFSET_F +H5T_mp_H5TSET_OFFSET_F +H5T_mp_H5TGET_PAD_F +H5T_mp_H5TSET_PAD_F +H5T_mp_H5TGET_SIGN_F +H5T_mp_H5TSET_SIGN_F +H5T_mp_H5TGET_FIELDS_F +H5T_mp_H5TSET_FIELDS_F +H5T_mp_H5TGET_EBIAS_F +H5T_mp_H5TSET_EBIAS_F +H5T_mp_H5TGET_NORM_F +H5T_mp_H5TSET_NORM_F +H5T_mp_H5TGET_INPAD_F +H5T_mp_H5TSET_INPAD_F +H5T_mp_H5TGET_CSET_F +H5T_mp_H5TSET_CSET_F +H5T_mp_H5TGET_STRPAD_F +H5T_mp_H5TSET_STRPAD_F +H5T_mp_H5TGET_NMEMBERS_F +H5T_mp_H5TGET_MEMBER_NAME_F +H5T_mp_H5TGET_MEMBER_OFFSET_F +H5T_mp_H5TGET_MEMBER_INDEX_F +H5T_mp_H5TGET_ARRAY_DIMS_F +H5T_mp_H5TGET_ARRAY_NDIMS_F +H5T_mp_H5TGET_SUPER_F +H5T_mp_H5TGET_MEMBER_TYPE_F +H5T_mp_H5TCREATE_F +H5T_mp_H5TINSERT_F +H5T_mp_H5TPACK_F +H5T_mp_H5TARRAY_CREATE_F +H5T_mp_H5TENUM_CREATE_F +H5T_mp_H5TENUM_INSERT_F +H5T_mp_H5TENUM_NAMEOF_F +H5T_mp_H5TENUM_VALUEOF_F +H5T_mp_H5TGET_MEMBER_VALUE_F +H5T_mp_H5TSET_TAG_F +H5T_mp_H5TGET_TAG_F +H5T_mp_H5TVLEN_CREATE_F +H5T_mp_H5TIS_VARIABLE_STR_F +H5T_mp_H5TGET_MEMBER_CLASS_F +H5T_mp_H5TCOMMIT_ANON_F +H5T_mp_H5TCOMMITTED_F +H5T_mp_H5TDECODE_F +H5T_mp_H5TENCODE_F +H5T_mp_H5TGET_CREATE_PLIST_F +H5T_mp_H5TCOMPILER_CONV_F +H5T_mp_H5TGET_NATIVE_TYPE_F +; H5Z +H5Z_mp_H5ZUNREGISTER_F +H5Z_mp_H5ZFILTER_AVAIL_F +H5Z_mp_H5ZGET_FILTER_INFO_F +; Parallel +H5FDMPIO_mp_H5PSET_FAPL_MPIO_F +H5FDMPIO_mp_H5PSET_DXPL_MPIO_F diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt index eab7180..e6ddbaf 100644 --- a/fortran/test/CMakeLists.txt +++ b/fortran/test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8) +cmake_minimum_required (VERSION 2.8.6) PROJECT (HDF5_FORTRAN_TESTS C CXX Fortran) #----------------------------------------------------------------------------- @@ -15,28 +15,28 @@ TARGET_LINK_LIBRARIES (${HDF5_F90_C_TEST_LIB_TARGET} ${HDF5_TEST_LIB_TARGET} ) H5_SET_LIB_OPTIONS (${HDF5_F90_C_TEST_LIB_TARGET} ${HDF5_F90_C_TEST_LIB_NAME} ${LIB_TYPE}) +SET_TARGET_PROPERTIES (${HDF5_F90_C_TEST_LIB_TARGET} PROPERTIES FOLDER libraries/test/fortran) ADD_LIBRARY (${HDF5_F90_TEST_LIB_TARGET} ${LIB_TYPE} tf.f90) SET (SHARED_LINK_FLAGS " ") IF (WIN32 AND NOT CYGWIN) IF (BUILD_SHARED_LIBS) - SET_PROPERTY (TARGET ${HDF5_F90_TEST_LIB_TARGET} - APPEND PROPERTY COMPILE_DEFINITIONS - BUILD_HDF5_DLL - ) + SET_PROPERTY (TARGET ${HDF5_F90_TEST_LIB_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS BUILD_HDF5_DLL) IF (MSVC) SET (SHARED_LINK_FLAGS "/DLL") ENDIF (MSVC) ENDIF (BUILD_SHARED_LIBS) - SET_PROPERTY (TARGET ${HDF5_F90_TEST_LIB_TARGET} - APPEND PROPERTY COMPILE_DEFINITIONS - HDF5F90_WINDOWS - ) + SET_PROPERTY (TARGET ${HDF5_F90_TEST_LIB_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS HDF5F90_WINDOWS) ENDIF (WIN32 AND NOT CYGWIN) TARGET_FORTRAN_WIN_PROPERTIES (${HDF5_F90_TEST_LIB_TARGET} ${SHARED_LINK_FLAGS}) SET_TARGET_PROPERTIES (${HDF5_F90_TEST_LIB_TARGET} PROPERTIES LINKER_LANGUAGE Fortran) -TARGET_LINK_LIBRARIES (${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_C_TEST_LIB_TARGET}) +TARGET_LINK_LIBRARIES (${HDF5_F90_TEST_LIB_TARGET} + ${HDF5_F90_C_TEST_LIB_TARGET} + ${HDF5_F90_LIB_TARGET} + ${HDF5_LIB_TARGET} +) H5_SET_LIB_OPTIONS (${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_TEST_LIB_NAME} ${LIB_TYPE}) +SET_TARGET_PROPERTIES (${HDF5_F90_TEST_LIB_TARGET} PROPERTIES FOLDER libraries/test/fortran) #----------------------------------------------------------------------------- # Add Tests @@ -70,6 +70,7 @@ IF (WIN32 AND MSVC) TARGET_LINK_LIBRARIES (testhdf5_fortran "ws2_32.lib") ENDIF (WIN32 AND MSVC) SET_TARGET_PROPERTIES (testhdf5_fortran PROPERTIES LINKER_LANGUAGE Fortran) +SET_TARGET_PROPERTIES (testhdf5_fortran PROPERTIES FOLDER test/fortran) ADD_TEST (NAME testhdf5_fortran COMMAND $) @@ -92,9 +93,36 @@ IF (WIN32 AND MSVC) TARGET_LINK_LIBRARIES (testhdf5_fortran_1_8 "ws2_32.lib") ENDIF (WIN32 AND MSVC) SET_TARGET_PROPERTIES (testhdf5_fortran_1_8 PROPERTIES LINKER_LANGUAGE Fortran) +SET_TARGET_PROPERTIES (testhdf5_fortran_1_8 PROPERTIES FOLDER test/fortran) ADD_TEST (NAME testhdf5_fortran_1_8 COMMAND $) +#-- Adding test for fortranlib_test_F03 +IF (FORTRAN_HAVE_ISO_C_BINDING AND HDF5_ENABLE_F2003) + ADD_EXECUTABLE (fortranlib_test_F03 + fortranlib_test_F03.f90 + tH5F.f90 + tH5E_F03.f90 + tH5L_F03.f90 + tH5P_F03.f90 + tH5T_F03.f90 + ) + TARGET_NAMING (fortranlib_test_F03 ${LIB_TYPE}) + TARGET_FORTRAN_WIN_PROPERTIES (fortranlib_test_F03 "") + TARGET_LINK_LIBRARIES (fortranlib_test_F03 + ${HDF5_F90_TEST_LIB_TARGET} + ${HDF5_F90_LIB_TARGET} + ${HDF5_LIB_TARGET} + ) + IF (WIN32 AND MSVC) + TARGET_LINK_LIBRARIES (fortranlib_test_F03 "ws2_32.lib") + ENDIF (WIN32 AND MSVC) + SET_TARGET_PROPERTIES (fortranlib_test_F03 PROPERTIES LINKER_LANGUAGE Fortran) + SET_TARGET_PROPERTIES (fortranlib_test_F03 PROPERTIES FOLDER test/fortran) + + ADD_TEST (NAME fortranlib_test_F03 COMMAND $) +ENDIF (FORTRAN_HAVE_ISO_C_BINDING AND HDF5_ENABLE_F2003) + #-- Adding test for fflush1 ADD_EXECUTABLE (fflush1 fflush1.f90) TARGET_NAMING (fflush1 ${LIB_TYPE}) @@ -108,6 +136,7 @@ IF (WIN32 AND MSVC) TARGET_LINK_LIBRARIES (fflush1 "ws2_32.lib") ENDIF (WIN32 AND MSVC) SET_TARGET_PROPERTIES (fflush1 PROPERTIES LINKER_LANGUAGE Fortran) +SET_TARGET_PROPERTIES (fflush1 PROPERTIES FOLDER test/fortran) ADD_TEST (NAME fflush1 COMMAND $) @@ -124,6 +153,7 @@ IF (WIN32 AND MSVC) TARGET_LINK_LIBRARIES (fflush2 "ws2_32.lib") ENDIF (WIN32 AND MSVC) SET_TARGET_PROPERTIES (fflush2 PROPERTIES LINKER_LANGUAGE Fortran) +SET_TARGET_PROPERTIES (fflush2 PROPERTIES FOLDER test/fortran) ADD_TEST (NAME fflush2 COMMAND $) SET_TESTS_PROPERTIES(fflush2 PROPERTIES DEPENDS fflush1) diff --git a/fortran/test/Makefile.am b/fortran/test/Makefile.am index fb4d6ca..b261785 100644 --- a/fortran/test/Makefile.am +++ b/fortran/test/Makefile.am @@ -35,8 +35,21 @@ else AM_LDFLAGS+=-static endif +# Check if the compiler supports the Fortran 2003 standard +# which should include the intrinsic module iso_c_binding +if FORTRAN_2003_CONDITIONAL_F + ff_PREFIX = F03 +else + ff_PREFIX = F90 +endif + # Our main targets, the tests themselves TEST_PROG=fortranlib_test fflush1 fflush2 fortranlib_test_1_8 + +if FORTRAN_2003_CONDITIONAL_F + TEST_PROG += fortranlib_test_F03 +endif + check_PROGRAMS=$(TEST_PROG) libh5test_fortran_la_SOURCES= tf.f90 t.c @@ -51,8 +64,14 @@ fortranlib_test_SOURCES = fortranlib_test.f90 \ tH5Sselect.f90 tH5P.f90 tH5A.f90 tH5I.f90 tH5G.f90 tH5E.f90 fortranlib_test_1_8_SOURCES = fortranlib_test_1_8.f90 \ - tH5F.f90 tH5O.f90 tH5A_1_8.f90 tH5G_1_8.f90 - + tH5F.f90 tH5O.f90 tH5A_1_8.f90 tH5G_1_8.f90 + +if FORTRAN_2003_CONDITIONAL_F + fortranlib_test_F03_SOURCES = fortranlib_test_F03.f90 \ + tH5F.f90 tH5E_F03.f90 tH5L_F03.f90 tH5P_F03.f90 tH5T_F03.f90 +endif + + fflush1_SOURCES=fflush1.f90 fflush2_SOURCES=fflush2.f90 diff --git a/fortran/test/Makefile.in b/fortran/test/Makefile.in index 080544c..27198a8 100644 --- a/fortran/test/Makefile.in +++ b/fortran/test/Makefile.in @@ -59,7 +59,8 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ # want to build a shared C library and a static Fortran library. If so, # pass the -static flag to the library linker. @FORTRAN_SHARED_CONDITIONAL_FALSE@am__append_1 = -static -check_PROGRAMS = $(am__EXEEXT_1) +@FORTRAN_2003_CONDITIONAL_F_TRUE@am__append_2 = fortranlib_test_F03 +check_PROGRAMS = $(am__EXEEXT_2) TESTS = $(check_PROGRAMS) subdir = fortran/test ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -77,8 +78,10 @@ libh5test_fortran_la_OBJECTS = $(am_libh5test_fortran_la_OBJECTS) AM_V_lt = $(am__v_lt_$(V)) am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) am__v_lt_0 = --silent -am__EXEEXT_1 = fortranlib_test$(EXEEXT) fflush1$(EXEEXT) \ - fflush2$(EXEEXT) fortranlib_test_1_8$(EXEEXT) +@FORTRAN_2003_CONDITIONAL_F_TRUE@am__EXEEXT_1 = \ +@FORTRAN_2003_CONDITIONAL_F_TRUE@ fortranlib_test_F03$(EXEEXT) +am__EXEEXT_2 = fortranlib_test$(EXEEXT) fflush1$(EXEEXT) \ + fflush2$(EXEEXT) fortranlib_test_1_8$(EXEEXT) $(am__EXEEXT_1) am_fflush1_OBJECTS = fflush1.$(OBJEXT) fflush1_OBJECTS = $(am_fflush1_OBJECTS) fflush1_LDADD = $(LDADD) @@ -114,6 +117,18 @@ fortranlib_test_1_8_OBJECTS = $(am_fortranlib_test_1_8_OBJECTS) fortranlib_test_1_8_LDADD = $(LDADD) fortranlib_test_1_8_DEPENDENCIES = libh5test_fortran.la $(LIBH5TEST) \ $(LIBH5F) $(LIBHDF5) +am__fortranlib_test_F03_SOURCES_DIST = fortranlib_test_F03.f90 \ + tH5F.f90 tH5E_F03.f90 tH5L_F03.f90 tH5P_F03.f90 tH5T_F03.f90 +@FORTRAN_2003_CONDITIONAL_F_TRUE@am_fortranlib_test_F03_OBJECTS = fortranlib_test_F03.$(OBJEXT) \ +@FORTRAN_2003_CONDITIONAL_F_TRUE@ tH5F.$(OBJEXT) \ +@FORTRAN_2003_CONDITIONAL_F_TRUE@ tH5E_F03.$(OBJEXT) \ +@FORTRAN_2003_CONDITIONAL_F_TRUE@ tH5L_F03.$(OBJEXT) \ +@FORTRAN_2003_CONDITIONAL_F_TRUE@ tH5P_F03.$(OBJEXT) \ +@FORTRAN_2003_CONDITIONAL_F_TRUE@ tH5T_F03.$(OBJEXT) +fortranlib_test_F03_OBJECTS = $(am_fortranlib_test_F03_OBJECTS) +fortranlib_test_F03_LDADD = $(LDADD) +fortranlib_test_F03_DEPENDENCIES = libh5test_fortran.la $(LIBH5TEST) \ + $(LIBH5F) $(LIBHDF5) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src depcomp = $(SHELL) $(top_srcdir)/bin/depcomp am__depfiles_maybe = depfiles @@ -155,10 +170,11 @@ am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(libh5test_fortran_la_SOURCES) $(fflush1_SOURCES) \ $(fflush2_SOURCES) $(fortranlib_test_SOURCES) \ - $(fortranlib_test_1_8_SOURCES) + $(fortranlib_test_1_8_SOURCES) $(fortranlib_test_F03_SOURCES) DIST_SOURCES = $(libh5test_fortran_la_SOURCES) $(fflush1_SOURCES) \ $(fflush2_SOURCES) $(fortranlib_test_SOURCES) \ - $(fortranlib_test_1_8_SOURCES) + $(fortranlib_test_1_8_SOURCES) \ + $(am__fortranlib_test_F03_SOURCES_DIST) ETAGS = etags CTAGS = ctags am__tty_colors = \ @@ -232,6 +248,7 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ +FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ @@ -252,10 +269,12 @@ H5_LONE_COLON = @H5_LONE_COLON@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ +HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ +HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ @@ -451,9 +470,15 @@ INCLUDES = -I$(top_srcdir)/src -I$(top_builddir)/fortran/src # The Fortran test library noinst_LTLIBRARIES = libh5test_fortran.la +@FORTRAN_2003_CONDITIONAL_F_FALSE@ff_PREFIX = F90 + +# Check if the compiler supports the Fortran 2003 standard +# which should include the intrinsic module iso_c_binding +@FORTRAN_2003_CONDITIONAL_F_TRUE@ff_PREFIX = F03 # Our main targets, the tests themselves -TEST_PROG = fortranlib_test fflush1 fflush2 fortranlib_test_1_8 +TEST_PROG = fortranlib_test fflush1 fflush2 fortranlib_test_1_8 \ + $(am__append_2) libh5test_fortran_la_SOURCES = tf.f90 t.c # Source files are used for both the library and fortranlib_test. @@ -465,7 +490,10 @@ fortranlib_test_SOURCES = fortranlib_test.f90 \ tH5Sselect.f90 tH5P.f90 tH5A.f90 tH5I.f90 tH5G.f90 tH5E.f90 fortranlib_test_1_8_SOURCES = fortranlib_test_1_8.f90 \ - tH5F.f90 tH5O.f90 tH5A_1_8.f90 tH5G_1_8.f90 + tH5F.f90 tH5O.f90 tH5A_1_8.f90 tH5G_1_8.f90 + +@FORTRAN_2003_CONDITIONAL_F_TRUE@fortranlib_test_F03_SOURCES = fortranlib_test_F03.f90 \ +@FORTRAN_2003_CONDITIONAL_F_TRUE@ tH5F.f90 tH5E_F03.f90 tH5L_F03.f90 tH5P_F03.f90 tH5T_F03.f90 fflush1_SOURCES = fflush1.f90 fflush2_SOURCES = fflush2.f90 @@ -559,6 +587,9 @@ fortranlib_test$(EXEEXT): $(fortranlib_test_OBJECTS) $(fortranlib_test_DEPENDENC fortranlib_test_1_8$(EXEEXT): $(fortranlib_test_1_8_OBJECTS) $(fortranlib_test_1_8_DEPENDENCIES) @rm -f fortranlib_test_1_8$(EXEEXT) $(AM_V_FCLD)$(FCLINK) $(fortranlib_test_1_8_OBJECTS) $(fortranlib_test_1_8_LDADD) $(LIBS) +fortranlib_test_F03$(EXEEXT): $(fortranlib_test_F03_OBJECTS) $(fortranlib_test_F03_DEPENDENCIES) + @rm -f fortranlib_test_F03$(EXEEXT) + $(AM_V_FCLD)$(FCLINK) $(fortranlib_test_F03_OBJECTS) $(fortranlib_test_F03_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) diff --git a/fortran/test/fflush1.f90 b/fortran/test/fflush1.f90 index 8767e55..d35bfff 100644 --- a/fortran/test/fflush1.f90 +++ b/fortran/test/fflush1.f90 @@ -1,3 +1,15 @@ +!****h* root/fortran/test/fflush1.f90 +! +! NAME +! FFLUSH1EXAMPLE +! +! FUNCTION +! This is the first half of a two-part test that makes sure +! that a file can be read after an application crashes as long +! as the file was flushed first. We simulate by exit the +! the program using stop statement +! +! COPYRIGHT ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! Copyright by The HDF Group. * ! Copyright by the Board of Trustees of the University of Illinois. * @@ -13,12 +25,7 @@ ! access to either file, you may request a copy from help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! -! -! Purpose: This is the first half of a two-part test that makes sure -! that a file can be read after an application crashes as long -! as the file was flushed first. We simulate by exit the -! the program using stop statement -! +!***** PROGRAM FFLUSH1EXAMPLE diff --git a/fortran/test/fflush2.f90 b/fortran/test/fflush2.f90 index a4710e2..d699150 100644 --- a/fortran/test/fflush2.f90 +++ b/fortran/test/fflush2.f90 @@ -1,3 +1,15 @@ +!****h* root/fortran/test/fflush2.f90 +! +! NAME +! fflush2.f90 +! +! FUNCTION +! This is the second half of a two-part test that makes sure +! that a file can be read after an application crashes as long +! as the file was flushed first. This half tries to read the +! file created by the first half. +! +! COPYRIGHT ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! Copyright by The HDF Group. * ! Copyright by the Board of Trustees of the University of Illinois. * @@ -13,12 +25,7 @@ ! access to either file, you may request a copy from help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! -! -! Purpose: This is the second half of a two-part test that makes sure -! that a file can be read after an application crashes as long -! as the file was flushed first. This half tries to read the -! file created by the first half. -! +!***** PROGRAM FFLUSH2EXAMPLE @@ -89,7 +96,6 @@ write(*,*) "Cannot modify filename" CALL h5_exit_f (1) endif - print *, "filename=", filename, "fix_filename=", fix_filename CALL h5fopen_f(fix_filename, H5F_ACC_RDONLY_F, file_id, error) CALL check("h5fopen_f",error,total_error) @@ -135,7 +141,6 @@ !In case error happens, exit. ! IF (error == -1) CALL h5_exit_f (1) - ! !Close the datatype ! diff --git a/fortran/test/fortranlib_test.f90 b/fortran/test/fortranlib_test.f90 index 08580c8..6268d15 100644 --- a/fortran/test/fortranlib_test.f90 +++ b/fortran/test/fortranlib_test.f90 @@ -1,3 +1,12 @@ +!****h* root/fortran/test/fortranlib_test.f90 +! +! NAME +! fortranlib_test.f90 +! +! FUNCTION +! Basic testing of Fortran API's functionality. +! +! COPYRIGHT ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! Copyright by The HDF Group. * ! Copyright by the Board of Trustees of the University of Illinois. * @@ -13,10 +22,8 @@ ! access to either file, you may request a copy from help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! -! -! -! Testing Fortran functionality. -! +!***** + PROGRAM fortranlibtest USE HDF5 @@ -142,7 +149,7 @@ PROGRAM fortranlibtest ret_total_error = 0 CALL test_select_bounds(cleanup, ret_total_error) CALL write_test_status(ret_total_error, ' Selection bounds test ', total_error) - + ! write(*,*) ! write(*,*) '=========================================' ! write(*,*) 'Testing DATATYPE interface ' diff --git a/fortran/test/fortranlib_test_1_8.f90 b/fortran/test/fortranlib_test_1_8.f90 index fac83eb..321cb99 100644 --- a/fortran/test/fortranlib_test_1_8.f90 +++ b/fortran/test/fortranlib_test_1_8.f90 @@ -1,3 +1,12 @@ +!****h* root/fortran/test/fortranlib_test_1_8.f90 +! +! NAME +! fortranlib_test_1_8.f90 +! +! FUNCTION +! Basic testing of Fortran API's introduced in 1.8 release. +! +! COPYRIGHT ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! Copyright by The HDF Group. * ! Copyright by the Board of Trustees of the University of Illinois. * @@ -13,10 +22,8 @@ ! access to either file, you may request a copy from help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! -! -! -! Testing Fortran wrappers introduced in 1.8 release. -! +!***** + PROGRAM fortranlibtest USE HDF5 @@ -81,20 +88,22 @@ PROGRAM fortranlibtest total_error) ret_total_error = 0 - CALL test_genprop_basic_class(cleanup, ret_total_error) + CALL test_h5s_encode(cleanup, ret_total_error) CALL write_test_status(ret_total_error, & - ' Testing basic generic properties', & + ' Testing dataspace encoding and decoding', & total_error) ret_total_error = 0 - CALL test_h5s_encode(cleanup, ret_total_error) + CALL test_nbit(cleanup, ret_total_error ) CALL write_test_status(ret_total_error, & - ' Testing dataspace encoding and decoding', & + ' Testing nbit filter', & total_error) - - -! CALL test_hard_query(group_total_error) + ret_total_error = 0 + CALL test_scaleoffset(cleanup, ret_total_error ) + CALL write_test_status(ret_total_error, & + ' Testing scaleoffset filter', & + total_error) WRITE(*,*) @@ -129,7 +138,6 @@ SUBROUTINE dtransform(cleanup, total_error) INTEGER(SIZE_T) :: size - CALL H5Fcreate_f("dtransform.h5", H5F_ACC_TRUNC_F, file_id, error) CALL check("dtransform.H5Fcreate_f", error, total_error) @@ -194,10 +202,6 @@ SUBROUTINE test_genprop_basic_class(cleanup, total_error) INTEGER :: size LOGICAL :: flag - !/* Output message about test being performed */ - - !WRITE(*,*) "Testing Basic Generic Property List Class Creation Functionality" - ! /* Create a new generic class, derived from the root of the class hierarchy */ CALL H5Pcreate_class_f(H5P_ROOT_F, CLASS1_NAME, cid1, error) CALL check("H5Pcreate_class", error, total_error) @@ -277,13 +281,10 @@ SUBROUTINE test_h5s_encode(cleanup, total_error) INTEGER :: rank !/* LOGICAL rank of dataspace */ INTEGER(size_t) :: sbuf_size=0, scalar_size=0 -! Make sure the size is large, need variable length in fortran 2003 +! Make sure the size is large CHARACTER(LEN=288) :: sbuf CHARACTER(LEN=288) :: scalar_buf -! F2003 CHARACTER(LEN=:), ALLOCATABLE :: sbuf -! unsigned char *sbuf=NULL, *null_sbuf=NULL, *scalar_buf=NULL; -! hsize_t tdims[4]; /* Dimension array to test with */ INTEGER(hsize_t) :: n ! /* Number of dataspace elements */ INTEGER(hsize_t), DIMENSION(1:3) :: start = (/0, 0, 0/) @@ -292,11 +293,8 @@ SUBROUTINE test_h5s_encode(cleanup, total_error) INTEGER(hsize_t), DIMENSION(1:3) :: BLOCK = (/1, 3, 1/) INTEGER :: space_type - -! H5S_sel_type sel_type; -! hssize_t nblocks; ! - !Dataset dimensions + ! Dataset dimensions ! INTEGER, PARAMETER :: SPACE1_DIM1= 3, SPACE1_DIM2=15, SPACE1_DIM3=13 @@ -304,9 +302,6 @@ SUBROUTINE test_h5s_encode(cleanup, total_error) INTEGER :: SPACE1_RANK = 3 INTEGER :: error - !/* Output message about test being performed */ - !WRITE(*,*) "Testing Dataspace Encoding and Decoding" - !/*------------------------------------------------------------------------- ! * Test encoding and decoding of simple dataspace and hyperslab selection. ! *------------------------------------------------------------------------- @@ -326,7 +321,6 @@ SUBROUTINE test_h5s_encode(cleanup, total_error) CALL H5Sencode_f(sid1, sbuf, sbuf_size, error) CALL check("H5Sencode", error, total_error) - ! In fortran 2003 we can allocate the needed character size here ! /* Try decoding bogus buffer */ @@ -347,23 +341,6 @@ SUBROUTINE test_h5s_encode(cleanup, total_error) CALL VERIFY("h5sget_simple_extent_npoints_f", INT(n), SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3, & total_error) -!!$ -!!$ rank = H5Sget_simple_extent_ndims(decoded_sid1); -!!$ CHECK(rank, FAIL, "H5Sget_simple_extent_ndims"); -!!$ VERIFY(rank, SPACE1_RANK, "H5Sget_simple_extent_ndims"); -!!$ -!!$ rank = H5Sget_simple_extent_dims(decoded_sid1, tdims, NULL); -!!$ CHECK(rank, FAIL, "H5Sget_simple_extent_dims"); -!!$ VERIFY(HDmemcmp(tdims, dims1, SPACE1_RANK * sizeof(hsize_t)), 0, -!!$ "H5Sget_simple_extent_dims"); -!!$ -!!$ /* Verify hyperslabe selection */ -!!$ sel_type = H5Sget_select_type(decoded_sid1); -!!$ VERIFY(sel_type, H5S_SEL_HYPERSLABS, "H5Sget_select_type"); -!!$ -!!$ nblocks = H5Sget_select_hyper_nblocks(decoded_sid1); -!!$ VERIFY(nblocks, 2*2*2, "H5Sget_select_hyper_nblocks"); -!!$ ! !Close the dataspace for the dataset. ! @@ -423,3 +400,289 @@ SUBROUTINE test_h5s_encode(cleanup, total_error) END SUBROUTINE test_h5s_encode +!------------------------------------------------------------------------- +! Function: test_nbit +! +! Purpose: Tests (real) datatype for nbit filter +! +! Return: Success: 0 +! Failure: >0 +! +! Programmer: M. Scot Breitenfeld +! Decemeber 7, 2010 +! +! Modifications: +! +!------------------------------------------------------------------------- +! + +SUBROUTINE test_nbit(cleanup, total_error ) + + USE HDF5 + + IMPLICIT NONE + INTEGER, PARAMETER :: wp = KIND(1.0) + LOGICAL, INTENT(IN) :: cleanup + INTEGER, INTENT(INOUT) :: total_error + INTEGER(hid_t) :: file + + INTEGER(hid_t) :: dataset, datatype, space, dc + INTEGER(hsize_t), DIMENSION(1:2) :: dims = (/2,5/) + INTEGER(hsize_t), DIMENSION(1:2) :: chunk_dim = (/2,5/) + ! orig_data[] are initialized to be within the range that can be represented by + ! dataset datatype (no precision loss during datatype conversion) + ! + REAL(kind=wp), DIMENSION(1:2,1:5) :: orig_data = RESHAPE( (/188384.00, 19.103516, -1.0831790e9, -84.242188, & + 5.2045898, -49140.000, 2350.2500, -3.2110596e-1, 6.4998865e-5, -0.0000000/) , (/2,5/) ) + REAL(kind=wp), DIMENSION(1:2,1:5) :: new_data + INTEGER(size_t) :: PRECISION, offset + INTEGER :: error + LOGICAL :: status + INTEGER*8 :: ii + INTEGER(size_t) :: i, j + + + ! check to see if filter is available + CALL H5Zfilter_avail_f(H5Z_FILTER_NBIT_F, status, error) + IF(.NOT.status)THEN ! We don't have H5Z_FILTER_NBIT_F filter + total_error = -1 ! so return + RETURN + ENDIF + + CALL H5Fcreate_f("nbit.h5", H5F_ACC_TRUNC_F, file, error) + CALL check("H5Fcreate_f", error, total_error) + + ! Define dataset datatype (integer), and set precision, offset + CALL H5Tcopy_f(H5T_IEEE_F32BE, datatype, error) + CALL CHECK(" H5Tcopy_f", error, total_error) + CALL H5Tset_fields_f(datatype, 26_size_t, 20_size_t, 6_size_t, 7_size_t, 13_size_t, error) + CALL CHECK(" H5Tset_fields_f", error, total_error) + offset = 7 + CALL H5Tset_offset_f(datatype, offset, error) + CALL CHECK(" H5Tset_offset_f", error, total_error) + PRECISION = 20 + CALL H5Tset_precision_f(datatype,PRECISION, error) + CALL CHECK(" H5Tset_precision_f", error, total_error) + + CALL H5Tset_size_f(datatype, 4_size_t, error) + CALL CHECK(" H5Tset_size_f", error, total_error) + + CALL H5Tset_ebias_f(datatype, 31_size_t, error) + CALL CHECK(" H5Tset_ebias_f", error, total_error) + + ! Create the data space + CALL H5Screate_simple_f(2, dims, space, error) + CALL CHECK(" H5Screate_simple_f", error, total_error) + + ! USE nbit filter + CALL H5Pcreate_f(H5P_DATASET_CREATE_F, dc, error) + CALL CHECK(" H5Pcreate_f", error, total_error) + + CALL H5Pset_chunk_f(dc, 2, chunk_dim, error) + CALL CHECK(" H5Pset_chunk_f", error, total_error) + CALL H5Pset_nbit_f(dc, error) + CALL CHECK(" H5Pset_nbit_f", error, total_error) + + ! Create the dataset + CALL H5Dcreate_f(file, "nbit_real", datatype, & + space, dataset, error, dc) + CALL CHECK(" H5Dcreate_f", error, total_error) + + !---------------------------------------------------------------------- + ! STEP 1: Test nbit by setting up a chunked dataset and writing + ! to it. + !---------------------------------------------------------------------- + ! + CALL H5Dwrite_f(dataset, H5T_NATIVE_REAL, orig_data, dims, error) + CALL CHECK(" H5Dwrite_f", error, total_error) + + !---------------------------------------------------------------------- + ! STEP 2: Try to read the data we just wrote. + !---------------------------------------------------------------------- + ! + CALL H5Dread_f(dataset, H5T_NATIVE_REAL, new_data, dims, error) + CALL CHECK(" H5Dread_f", error, total_error) + + ! Check that the values read are the same as the values written + ! Assume size of long long = size of double + ! + i_loop: DO i = 1, dims(1) + j_loop: DO j = 1, dims(2) + IF(.NOT.(orig_data(i,j).EQ.orig_data(i,j))) CYCLE ! skip IF value is NaN + IF(new_data(i,j) .NE. orig_data(i,j))THEN + total_error = total_error + 1 + WRITE(*,'(" Read different values than written.")') + WRITE(*,'(" At index ", 2(1X,I0))') i, j + EXIT i_loop + END IF + ENDDO j_loop + ENDDO i_loop + + !---------------------------------------------------------------------- + ! Cleanup + !---------------------------------------------------------------------- + ! + CALL H5Tclose_f(datatype, error) + CALL CHECK(" H5Tclose_f", error, total_error) + CALL H5Pclose_f(dc, error) + CALL CHECK(" H5Pclose_f", error, total_error) + CALL H5Sclose_f(space, error) + CALL CHECK(" H5Sclose_f", error, total_error) + CALL H5Dclose_f(dataset, error) + CALL CHECK(" H5Dclose_f", error, total_error) + CALL H5Fclose_f(file, error) + CALL CHECK(" H5Fclose_f", error, total_error) + +END SUBROUTINE test_nbit + +!------------------------------------------------------------------------- +! Function: test_scaleoffset +! +! Purpose: Tests the integer datatype for scaleoffset filter +! with fill value set +! +! Return: Success: 0 +! Failure: >0 +! +! Programmer: M. Scot Breitenfeld +! Decemeber 11, 2010 +! +! Modifications: +! +!------------------------------------------------------------------------- +! + +SUBROUTINE test_scaleoffset(cleanup, total_error ) + + USE HDF5 + + IMPLICIT NONE + LOGICAL, INTENT(IN) :: cleanup + INTEGER, INTENT(INOUT) :: total_error + INTEGER(hid_t) :: file + + INTEGER(hid_t) :: dataset, datatype, space, mspace, dc + INTEGER(hsize_t), DIMENSION(1:2) :: dims = (/2, 5/) + INTEGER(hsize_t), DIMENSION(1:2) :: chunk_dim = (/2, 5/) + INTEGER, DIMENSION(1:2,1:5) :: orig_data + INTEGER, DIMENSION(1:2,1:5) :: new_data + INTEGER(hsize_t), DIMENSION(1:2) :: start ! Start of hyperslab + INTEGER(hsize_t), DIMENSION(1:2) :: stride ! Stride of hyperslab + INTEGER(hsize_t), DIMENSION(1:2) :: count ! BLOCK count + INTEGER(hsize_t), DIMENSION(1:2) :: BLOCK ! BLOCK sizes + INTEGER :: fillval + INTEGER(size_t) :: j + REAL :: x + INTEGER :: error + LOGICAL :: status + + ! check to see if filter is available + CALL H5Zfilter_avail_f(H5Z_FILTER_SCALEOFFSET_F, status, error) + IF(.NOT.status)THEN ! We don't have H5Z_FILTER_SCALEOFFSET_F filter + total_error = -1 ! so return + RETURN + ENDIF + + CALL H5Fcreate_f("h5scaleoffset.h5", H5F_ACC_TRUNC_F, file, error) + CALL check("H5Fcreate_f", error, total_error) + + CALL H5Tcopy_f(H5T_NATIVE_INTEGER, datatype, error) + CALL CHECK(" H5Tcopy_f", error, total_error) + + ! Set order of dataset datatype + CALL H5Tset_order_f(datatype, H5T_ORDER_BE_F, error) + CALL CHECK(" H5Tset_order_f", error, total_error) + + ! Create the data space for the dataset + CALL H5Screate_simple_f(2, dims, space, error) + CALL CHECK(" H5Screate_simple_f", error, total_error) + + ! Create the dataset property list + CALL H5Pcreate_f(H5P_DATASET_CREATE_F, dc, error) + CALL CHECK(" H5Pcreate_f", error, total_error) + + ! Set fill value + fillval = 10000 + CALL H5Pset_fill_value_f(dc, H5T_NATIVE_INTEGER, fillval, error) + CALL CHECK(" H5Pset_fill_value_f", error, total_error) + + ! Set up to use scaleoffset filter, let library calculate minbits + CALL H5Pset_chunk_f(dc, 2, chunk_dim, error) + CALL CHECK(" H5Pset_chunk_f", error, total_error) + + CALL H5Pset_scaleoffset_f(dc, H5Z_SO_INT_F, H5Z_SO_INT_MINBITS_DEFAULT_F, error) + CALL CHECK(" H5Pset_scaleoffset_f", error, total_error) + + ! Create the dataset + CALL H5Dcreate_f(file, "scaleoffset_int", datatype, & + space, dataset, error, dc) + CALL CHECK(" H5Dcreate_f", error, total_error) + + ! Create the memory data space + CALL H5Screate_simple_f(2, dims, mspace, error) + CALL CHECK(" H5Screate_simple_f", error, total_error) + + ! Select hyperslab for data to write, using 1x5 blocks, + ! (1,1) stride and (1,1) count starting at the position (0,0) + + start(1:2) = (/0,0/) + stride(1:2) = (/1,1/) + COUNT(1:2) = (/1,1/) + BLOCK(1:2) = (/1,5/) + + CALL H5Sselect_hyperslab_f(mspace, H5S_SELECT_SET_F, start, & + count, error, stride, BLOCK) + CALL CHECK(" H5Sselect_hyperslab_f", error, total_error) + + CALL RANDOM_SEED() + ! Initialize data of hyperslab + DO j = 1, dims(2) + CALL RANDOM_NUMBER(x) + orig_data(1,j) = INT(x*10000.) + IF(MOD(j,2_size_t).EQ.0)THEN + orig_data(1,j) = - orig_data(1,j) + ENDIF + ENDDO + + !---------------------------------------------------------------------- + ! STEP 1: Test scaleoffset by setting up a chunked dataset and writing + ! to it. + !---------------------------------------------------------------------- + + ! Only data in the hyperslab will be written, other value should be fill value + CALL H5Dwrite_f(dataset, H5T_NATIVE_INTEGER, orig_data, dims, error, mspace, mspace, H5P_DEFAULT_F) + CALL CHECK(" H5Dwrite_f", error, total_error) + + !---------------------------------------------------------------------- + ! STEP 2: Try to read the data we just wrote. + !---------------------------------------------------------------------- + + ! Read the dataset back + + CALL H5Dread_f(dataset, H5T_NATIVE_INTEGER, new_data, dims, error, mspace, mspace, H5P_DEFAULT_F) + CALL CHECK(" H5Dread_f", error, total_error) + + ! Check that the values read are the same as the values written + DO j = 1, dims(2) + IF(new_data(1,j) .NE. orig_data(1,j))THEN + total_error = total_error + 1 + WRITE(*,'(" Read different values than written.")') + WRITE(*,'(" At index ", 2(1X,I0))') 1, j + EXIT + ENDIF + ENDDO + !---------------------------------------------------------------------- + ! Cleanup + !---------------------------------------------------------------------- + CALL H5Tclose_f(datatype, error) + CALL CHECK(" H5Tclose_f", error, total_error) + CALL H5Pclose_f(dc, error) + CALL CHECK(" H5Pclose_f", error, total_error) + CALL H5Sclose_f(space, error) + CALL CHECK(" H5Sclose_f", error, total_error) + CALL H5Dclose_f(dataset, error) + CALL CHECK(" H5Dclose_f", error, total_error) + CALL H5Fclose_f(file, error) + CALL CHECK(" H5Fclose_f", error, total_error) + +END SUBROUTINE test_scaleoffset diff --git a/fortran/test/fortranlib_test_F03.f90 b/fortran/test/fortranlib_test_F03.f90 new file mode 100644 index 0000000..1b69f7f --- /dev/null +++ b/fortran/test/fortranlib_test_F03.f90 @@ -0,0 +1,164 @@ +!****h* root/fortran/test/fortranlib_test_F03.f90 +! +! NAME +! fortranlib_test_F03.f90 +! +! FUNCTION +! Basic testing of Fortran API's requiring Fortran 2003 +! compliance. +! +! COPYRIGHT +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +!***** + +PROGRAM fortranlibtest_F03 + + USE HDF5 + + IMPLICIT NONE + INTEGER :: total_error = 0 + INTEGER :: error + INTEGER :: majnum, minnum, relnum + LOGICAL :: szip_flag + INTEGER :: ret_total_error + LOGICAL :: cleanup, status + + CALL h5open_f(error) + + cleanup = .TRUE. + CALL h5_env_nocleanup_f(status) + IF(status) cleanup=.FALSE. + + WRITE(*,'(24X,A)') '==============================' + WRITE(*,'(24X,A)') ' FORTRAN 2003 tests ' + WRITE(*,'(24X,A)') '==============================' + CALL h5get_libversion_f(majnum, minnum, relnum, total_error) + IF(total_error .EQ. 0) THEN + WRITE(*, '(" FORTRANLIB_TEST is linked with HDF5 Library version ")', advance="NO") + WRITE(*, '(I1)', advance="NO") majnum + WRITE(*, '(".")', advance="NO") + WRITE(*, '(I1)', advance="NO") minnum + WRITE(*, '(" release ")', advance="NO") + WRITE(*, '(I3)') relnum + ELSE + total_error = total_error + 1 + ENDIF + + ret_total_error = 0 +! PROBLEMS with C +! CALL test_error(ret_total_error) +! CALL write_test_status(ret_total_error, ' Test error API based on data I/O', total_error) + + WRITE(*,*) +! write(*,*) +! write(*,*) '=========================================' +! write(*,*) 'Testing DATATYPE interface ' +! write(*,*) '=========================================' + ret_total_error = 0 + CALL test_array_compound_atomic(ret_total_error) + CALL write_test_status(ret_total_error, ' Testing 1-D Array of Compound Datatypes Functionality', total_error) + + ret_total_error = 0 + CALL test_array_compound_array(ret_total_error) + CALL write_test_status(ret_total_error, ' Testing 1-D Array of Compound Array Datatypes Functionality', total_error) + + ret_total_error = 0 + CALL t_array(ret_total_error) + CALL write_test_status(ret_total_error, ' Testing 3-D array by dataset, using C_LOC', total_error) + + ret_total_error = 0 + CALL t_enum(ret_total_error) + CALL write_test_status(ret_total_error, ' Testing writing/reading enum dataset, using C_LOC', total_error) + + ret_total_error = 0 + CALL t_bit(ret_total_error) + CALL write_test_status(ret_total_error, ' Testing writing/reading bitfield dataset, using C_LOC', total_error) + + ret_total_error = 0 + CALL t_opaque(ret_total_error) + CALL write_test_status(ret_total_error, ' Testing writing/reading opaque datatypes, using C_LOC', total_error) + + ret_total_error = 0 + CALL t_objref(ret_total_error) + CALL write_test_status(ret_total_error, ' Testing writing/reading object references, using C_LOC', total_error) + + ret_total_error = 0 + CALL t_regref(ret_total_error) + CALL write_test_status(ret_total_error, ' Testing writing/reading region references, using C_LOC', total_error) + + ret_total_error = 0 + CALL t_vlen(ret_total_error) + CALL write_test_status(ret_total_error, ' Testing writing/reading variable-length datatypes, using C_LOC', total_error) + + ret_total_error = 0 + CALL t_vlstring(ret_total_error) + CALL write_test_status(ret_total_error, ' Testing writing/reading variable-string datatypes, using C_LOC', total_error) + + ret_total_error = 0 + CALL t_vlstring_readwrite(ret_total_error) + CALL write_test_status(ret_total_error, ' Testing variable-string write/read, using h5dwrite_f/h5dread_f', total_error) + + ret_total_error = 0 + CALL t_string(ret_total_error) + CALL write_test_status(ret_total_error, ' Testing writing/reading string datatypes, using C_LOC', total_error) + + ret_total_error = 0 + CALL test_create(ret_total_error) + CALL write_test_status(ret_total_error, & + ' Testing filling functions', & + total_error) + + ret_total_error = 0 + CALL test_h5kind_to_type(total_error) + CALL write_test_status(ret_total_error, & + ' Test function h5kind_to_type', & + total_error) + + ret_total_error = 0 + CALL test_array_bkg(ret_total_error) + CALL write_test_status(ret_total_error, ' Testing Partial I/O of Array Fields in Compound Datatype FunctionalityT', total_error) + + ret_total_error = 0 + CALL test_genprop_class_callback(ret_total_error) + CALL write_test_status(ret_total_error, ' Test basic generic property list callback functionality', total_error) + + ret_total_error = 0 + CALL test_iter_group(ret_total_error) + CALL write_test_status(ret_total_error, ' Testing Group Iteration Functionality', total_error) + +! write(*,*) +! write(*,*) '=========================================' +! write(*,*) 'Testing GROUP interface ' +! write(*,*) '=========================================' + + + WRITE(*,*) + + WRITE(*,*) ' ============================================ ' + WRITE(*, fmt = '(19x, 27a)', advance='NO') ' FORTRAN tests completed with ' + WRITE(*, fmt = '(i4)', advance='NO') total_error + WRITE(*, fmt = '(12a)' ) ' error(s) ! ' + WRITE(*,*) ' ============================================ ' + + CALL h5close_f(error) + + ! if errors detected, exit with non-zero code. + IF (total_error .NE. 0) CALL h5_exit_f(1) + +END PROGRAM fortranlibtest_F03 + + diff --git a/fortran/test/t.c b/fortran/test/t.c index bf30331..01d4cdd 100644 --- a/fortran/test/t.c +++ b/fortran/test/t.c @@ -1,4 +1,13 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +/****h* root/fortran/test/tc.c + * + * NAME + * tc.c + * + * FUNCTION + * This file contains C routines needed for the test programs. + * + * COPYRIGHT + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * @@ -11,7 +20,10 @@ * is linked from the top-level documents page. It can also be found at * * http://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 "t.h" #include "H5Eprivate.h" diff --git a/fortran/test/tH5A.f90 b/fortran/test/tH5A.f90 index dd6cbb1..03522f7 100644 --- a/fortran/test/tH5A.f90 +++ b/fortran/test/tH5A.f90 @@ -1,3 +1,12 @@ +!****h* root/fortran/test/tH5A.f90 +! +! NAME +! tH5A.f90 +! +! FUNCTION +! Basic testing of Fortran H5A APIs. +! +! COPYRIGHT ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! Copyright by The HDF Group. * ! Copyright by the Board of Trustees of the University of Illinois. * @@ -13,6 +22,12 @@ ! access to either file, you may request a copy from help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! +! CONTAINS SUBROUTINES +! attribute_test +! +! +!***** + SUBROUTINE attribute_test(cleanup, total_error) ! This subroutine tests following functionalities: diff --git a/fortran/test/tH5A_1_8.f90 b/fortran/test/tH5A_1_8.f90 index c48420e..32cb228 100644 --- a/fortran/test/tH5A_1_8.f90 +++ b/fortran/test/tH5A_1_8.f90 @@ -1,3 +1,12 @@ +!****h* root/fortran/test/tH5A_1_8.f90 +! +! NAME +! tH5A_1_8.f90 +! +! FUNCTION +! Basic testing of Fortran H5A APIs introduced in 1.8. +! +! COPYRIGHT ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! Copyright by The HDF Group. * ! Copyright by the Board of Trustees of the University of Illinois. * @@ -13,6 +22,15 @@ ! access to either file, you may request a copy from help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! +! CONTAINS SUBROUTINES +! attribute_test_1_8, test_attr_corder_create_compact, test_attr_null_space, +! test_attr_create_by_name, test_attr_info_by_idx, attr_info_by_idx_check, +! test_attr_shared_rename, test_attr_delete_by_idx, test_attr_shared_delete, +! test_attr_dense_open, test_attr_dense_verify, test_attr_corder_create_basic, +! test_attr_basic_write, test_attr_many, attr_open_check, +! +!***** + SUBROUTINE attribute_test_1_8(cleanup, total_error) ! This subroutine tests following 1.8 functionalities: @@ -96,18 +114,6 @@ SUBROUTINE attribute_test_1_8(cleanup, total_error) ' - Tests INT attributes on both datasets and groups', & total_error) -!!$ CALL test_attr_basic_read(my_fapl) -!!$ CALL test_attr_flush(my_fapl) -!!$ CALL test_attr_plist(my_fapl) ! this is next -!!$ CALL test_attr_compound_write(my_fapl) -!!$ CALL test_attr_compound_read(my_fapl) -!!$ CALL test_attr_scalar_write(my_fapl) -!!$ CALL test_attr_scalar_read(my_fapl) -!!$ CALL test_attr_mult_write(my_fapl) -!!$ CALL test_attr_mult_read(my_fapl) -!!$ CALL test_attr_iterate(my_fapl) -!!$ CALL test_attr_delete(my_fapl) -!!$ CALL test_attr_dtype_shared(my_fapl) IF(new_format(i)) THEN DO j = 1, 2 IF (use_shared(j)) THEN @@ -117,7 +123,6 @@ SUBROUTINE attribute_test_1_8(cleanup, total_error) WRITE(*,*) " - Testing without shared attributes:" my_fcpl = fcpl END IF -!!$ CALL test_attr_dense_create(my_fcpl, my_fapl) ret_total_error = 0 CALL test_attr_dense_open(my_fcpl, my_fapl, ret_total_error) @@ -125,17 +130,11 @@ SUBROUTINE attribute_test_1_8(cleanup, total_error) ' - Testing INT attributes on both datasets and groups', & total_error) -!!$ CALL test_attr_dense_delete(my_fcpl, my_fapl) -!!$ CALL test_attr_dense_rename(my_fcpl, my_fapl) -!!$ CALL test_attr_dense_unlink(my_fcpl, my_fapl) -!!$ CALL test_attr_dense_limits(my_fcpl, my_fapl) -!!$ CALL test_attr_big(my_fcpl, my_fapl) ret_total_error = 0 CALL test_attr_null_space(my_fcpl, my_fapl, ret_total_error) CALL write_test_status(ret_total_error, & ' - Testing storing attribute with "null" dataspace', & total_error) -!!$ CALL test_attr_deprec(fcpl, my_fapl) ret_total_error = 0 CALL test_attr_many(new_format(i), my_fcpl, my_fapl, ret_total_error) CALL write_test_status(ret_total_error, & @@ -153,10 +152,6 @@ SUBROUTINE attribute_test_1_8(cleanup, total_error) CALL write_test_status(ret_total_error, & ' - Testing compact storage on objects with attribute creation order', & total_error) -!!$ CALL test_attr_corder_create_dense(my_fcpl, my_fapl) -!!$ CALL test_attr_corder_create_reopen(my_fcpl, my_fapl) -!!$ CALL test_attr_corder_transition(my_fcpl, my_fapl) -!!$ CALL test_attr_corder_delete(my_fcpl, my_fapl) ret_total_error = 0 CALL test_attr_info_by_idx(new_format(i), my_fcpl, my_fapl, ret_total_error) CALL write_test_status(ret_total_error, & @@ -169,9 +164,6 @@ SUBROUTINE attribute_test_1_8(cleanup, total_error) ' - Testing deleting attribute by index', & total_error) -!!$ CALL test_attr_iterate2(new_format, my_fcpl, my_fapl) -!!$ CALL test_attr_open_by_idx(new_format, my_fcpl, my_fapl) -!!$ CALL test_attr_open_by_name(new_format, my_fcpl, my_fapl) ret_total_error = 0 CALL test_attr_create_by_name(new_format(i), my_fcpl, my_fapl, ret_total_error) CALL write_test_status(ret_total_error, & @@ -180,7 +172,6 @@ SUBROUTINE attribute_test_1_8(cleanup, total_error) ! /* More complex tests with both "new format" and "shared" attributes */ IF( use_shared(j) ) THEN -!!$ CALL test_attr_shared_write(my_fcpl, my_fapl) ret_total_error = 0 CALL test_attr_shared_rename(my_fcpl, my_fapl, ret_total_error) CALL write_test_status(ret_total_error,& @@ -193,24 +184,8 @@ SUBROUTINE attribute_test_1_8(cleanup, total_error) ' - Testing deleting shared attributes in "compact" & "dense" storage', & total_error) - -!!$ CALL test_attr_shared_unlink(my_fcpl, my_fapl) END IF -!!$ CALL test_attr_bug1(my_fcpl, my_fapl) END DO -!!$ ELSE -!!$ CALL test_attr_big(fcpl, my_fapl) -!!$ CALL test_attr_null_space(fcpl, my_fapl) -!!$ CALL test_attr_deprec(fcpl, my_fapl) -!!$ CALL test_attr_many(new_format, fcpl, my_fapl) -!!$ CALL test_attr_info_by_idx(new_format, fcpl, my_fapl) -!!$ CALL test_attr_delete_by_idx(new_format, fcpl, my_fapl) -!!$ CALL test_attr_iterate2(new_format, fcpl, my_fapl) -!!$ CALL test_attr_open_by_idx(new_format, fcpl, my_fapl) -!!$ CALL test_attr_open_by_name(new_format, fcpl, my_fapl) -!!$ CALL test_attr_create_by_name(new_format, fcpl, my_fapl) -!!$ CALL test_attr_bug1(fcpl, my_fapl) - END IF ENDDO @@ -315,13 +290,7 @@ SUBROUTINE test_attr_corder_create_compact(fcpl,fapl, total_error) my_dataset = dset2 CASE (2) my_dataset = dset3 -! CASE DEFAULT -! CALL HDassert(0.AND."Toomanydatasets!") END SELECT -!!$ is_empty = H5O_is_attr_empty_test(my_dataset) -!!$ CALL VERIFY(is_empty, TRUE, "H5O_is_attr_empty_test") -!!$ is_dense = H5O_is_attr_dense_test(my_dataset) -!!$ CALL VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test") DO u = 0, max_compact - 1 ! /* Create attribute */ WRITE(chr2,'(I2.2)') u @@ -337,13 +306,6 @@ SUBROUTINE test_attr_corder_create_compact(fcpl,fapl, total_error) CALL h5aclose_f(attr, error) CALL check("h5aclose_f",error,total_error) -!!$ ret = H5O_num_attrs_test(my_dataset, nattrs) -!!$ CALL CHECK(ret, FAIL, "H5O_num_attrs_test") -!!$ CALL VERIFY(nattrs, (u + 1)) -!!$ is_empty = H5O_is_attr_empty_test(my_dataset) -!!$ CALL VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test") -!!$ is_dense = H5O_is_attr_dense_test(my_dataset) -!!$ CALL VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test") END DO END DO @@ -387,14 +349,6 @@ SUBROUTINE test_attr_corder_create_compact(fcpl,fapl, total_error) CASE DEFAULT WRITE(*,*) " WARNING: To many data sets! " END SELECT -!!$ ret = H5O_num_attrs_test(my_dataset, nattrs) -!!$ CALL CHECK(ret, FAIL, "H5O_num_attrs_test") -!!$ CALL VERIFY(nattrs, max_compact, "H5O_num_attrs_test") -!!$ is_empty = H5O_is_attr_empty_test(my_dataset) -!!$ CALL VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test") -!!$ is_dense = H5O_is_attr_dense_test(my_dataset) -!!$ CALL VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test") - DO u = 0,max_compact-1 WRITE(chr2,'(I2.2)') u attrname = 'attr '//chr2 @@ -483,8 +437,6 @@ SUBROUTINE test_attr_null_space(fcpl, fapl, total_error) data_dims = 0 - ! /* Output message about test being performed */ -! WRITE(*,*) " - Testing Storing Attributes with 'null' dataspace" ! /* Create file */ CALL h5fcreate_f(FileName, H5F_ACC_TRUNC_F, fid, error, fcpl, fapl) CALL check("h5fcreate_f",error,total_error) @@ -513,6 +465,7 @@ SUBROUTINE test_attr_null_space(fcpl, fapl, total_error) ! /* Try to read data from the attribute */ ! /* (shouldn't fail, but should leave buffer alone) */ value(1) = 103 + data_dims(1) = 1 CALL h5aread_f(attr, H5T_NATIVE_INTEGER, value, data_dims, error) CALL check("h5aread_f",error,total_error) CALL verify("h5aread_f",value(1),103,total_error) @@ -533,9 +486,6 @@ SUBROUTINE test_attr_null_space(fcpl, fapl, total_error) CALL check("H5Sextent_equal_f",error,total_error) CALL Verifylogical("H5Sextent_equal_f",equal,.TRUE.,total_error) -!!$ ret = H5Sclose(attr_sid) -!!$ CALL CHECK(ret, FAIL, "H5Sclose") - CALL h5aget_storage_size_f(attr, storage_size, error) CALL check("h5aget_storage_size_f",error,total_error) CALL VERIFY("h5aget_storage_size_f",INT(storage_size),0,total_error) @@ -639,11 +589,11 @@ SUBROUTINE test_attr_create_by_name(new_format,fcpl,fapl, total_error) ! /* Loop over using index for creation order value */ DO i = 1, 2 ! /* Print appropriate test message */ -!!$ IF(use_index(i))THEN -!!$ WRITE(*,*) " - Testing Creating Attributes By Name w/Creation Order Index" -!!$ ELSE -!!$ WRITE(*,*) " - Testing Creating Attributes By Name w/o Creation Order Index" -!!$ ENDIF + IF(use_index(i))THEN + WRITE(*,*) " - Testing Creating Attributes By Name w/Creation Order Index" + ELSE + WRITE(*,*) " - Testing Creating Attributes By Name w/o Creation Order Index" + ENDIF ! /* Create file */ CALL h5fcreate_f(FileName, H5F_ACC_TRUNC_F, fid, error, fcpl, fapl) CALL check("h5fcreate_f",error,total_error) @@ -691,11 +641,6 @@ SUBROUTINE test_attr_create_by_name(new_format,fcpl,fapl, total_error) ! CALL HDassert(0.AND."Toomanydatasets!") END SELECT - ! /* Check on dataset's attribute storage status */ -!!$ is_empty = H5O_is_attr_empty_test(my_dataset); -!!$ VERIFY(is_empty, TRUE, "H5O_is_attr_empty_test"); -!!$ is_dense = H5O_is_attr_dense_test(my_dataset); -!!$ VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test"); !/* Create attributes, up to limit of compact form */ @@ -722,15 +667,6 @@ SUBROUTINE test_attr_create_by_name(new_format,fcpl,fapl, total_error) ! CALL check("FAILED IN attr_info_by_idx_check",total_error) ENDDO - ! /* Verify state of object */ -!!$ ret = H5O_num_attrs_test(my_dataset, &nattrs); -!!$ CHECK(ret, FAIL, "H5O_num_attrs_test"); -!!$ VERIFY(nattrs, max_compact, "H5O_num_attrs_test"); -!!$ is_empty = H5O_is_attr_empty_test(my_dataset); -!!$ VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test"); -!!$ is_dense = H5O_is_attr_dense_test(my_dataset); -!!$ VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test"); - ! /* Test opening attributes stored compactly */ CALL attr_open_check(fid, dsetname, my_dataset, u, total_error) @@ -771,39 +707,8 @@ SUBROUTINE test_attr_create_by_name(new_format,fcpl,fapl, total_error) CALL h5aclose_f(attr, error) CALL check("h5aclose_f",error,total_error) - ! /* Verify state of object */ -!!$ if(u >= max_compact) { -!!$ is_dense = H5O_is_attr_dense_test(my_dataset); -!!$ VERIFY(is_dense, (new_format ? TRUE : FALSE), "H5O_is_attr_dense_test"); -!!$ } /* end if */ -!!$ -!!$ /* Verify information for new attribute */ -!!$ ret = attr_info_by_idx_check(my_dataset, attrname, (hsize_t)u, use_index); -!!$ CHECK(ret, FAIL, "attr_info_by_idx_check"); ENDDO - ! /* Verify state of object */ -!!$ ret = H5O_num_attrs_test(my_dataset, &nattrs); -!!$ CHECK(ret, FAIL, "H5O_num_attrs_test"); -!!$ VERIFY(nattrs, (max_compact * 2), "H5O_num_attrs_test"); -!!$ is_empty = H5O_is_attr_empty_test(my_dataset); -!!$ VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test"); -!!$ is_dense = H5O_is_attr_dense_test(my_dataset); -!!$ VERIFY(is_dense, (new_format ? TRUE : FALSE), "H5O_is_attr_dense_test"); - -!!$ if(new_format) { -!!$ /* Retrieve & verify # of records in the name & creation order indices */ -!!$ ret = H5O_attr_dense_info_test(my_dataset, &name_count, &corder_count); -!!$ CHECK(ret, FAIL, "H5O_attr_dense_info_test"); -!!$ if(use_index) -!!$ VERIFY(name_count, corder_count, "H5O_attr_dense_info_test"); -!!$ VERIFY(name_count, (max_compact * 2), "H5O_attr_dense_info_test"); -!!$ } /* end if */ - -!!$ /* Test opening attributes stored compactly */ -!!$ ret = attr_open_check(fid, dsetname, my_dataset, u); -!!$ CHECK(ret, FAIL, "attr_open_check"); - ENDDO ! /* Close Datasets */ @@ -914,13 +819,6 @@ SUBROUTINE test_attr_info_by_idx(new_format, fcpl, fapl, total_error) DO i = 1, 2 - ! /* Output message about test being performed */ -!!$ IF(use_index(i))THEN -!!$ WRITE(*,'(A72)') " - Testing Querying Attribute Info By Index w/Creation Order Index" -!!$ ELSE -!!$ WRITE(*,'(A74)') " - Testing Querying Attribute Info By Index w/o Creation Order Index" -!!$ ENDIF - ! /* Create file */ CALL h5fcreate_f(FileName, H5F_ACC_TRUNC_F, fid, error, fcpl, fapl) CALL check("h5fcreate_f",error,total_error) @@ -958,16 +856,8 @@ SUBROUTINE test_attr_info_by_idx(new_format, fcpl, fapl, total_error) my_dataset = dset2 CASE (2) my_dataset = dset3 - ! CASE DEFAULT - ! CALL HDassert(0.AND."Toomanydatasets!") END SELECT - !/* Check on dataset's attribute storage status */ -!!$ is_empty = H5O_is_attr_empty_test(my_dataset); -!!$ VERIFY(is_empty, TRUE, "H5O_is_attr_empty_test"); -!!$ is_dense = H5O_is_attr_dense_test(my_dataset); -!!$ VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test"); - ! /* Check for query on non-existant attribute */ n = 0 @@ -1005,7 +895,6 @@ SUBROUTINE test_attr_info_by_idx(new_format, fcpl, fapl, total_error) WRITE(chr2,'(I2.2)') j attrname = 'attr '//chr2 - ! attr = H5Acreate2(my_dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); ! check with the optional information create2 specs. CALL h5acreate_f(my_dataset, attrname, H5T_NATIVE_INTEGER, sid, attr, error, H5P_DEFAULT_F, H5P_DEFAULT_F) CALL check("h5acreate_f",error,total_error) @@ -1138,7 +1027,6 @@ SUBROUTINE attr_info_by_idx_check(obj_id, attrname, n, use_index, total_error ) END IF - ! CALL HDmemset(ainfo, 0, SIZEOF(ainfo) CALL h5aget_info_by_idx_f(obj_id, ".", H5_INDEX_CRT_ORDER_F, H5_ITER_DEC_F, n, & f_corder_valid, corder, cset, data_size, error) CALL check("h5aget_info_by_idx_f",error,total_error) @@ -1178,9 +1066,7 @@ SUBROUTINE attr_info_by_idx_check(obj_id, attrname, n, use_index, total_error ) f_corder_valid, corder, cset, data_size, error) CALL check("h5aget_info_by_idx_f",error,total_error) CALL VERIFY("h5aget_info_by_idx_f",corder,INT(n),total_error) -!!$ ret = H5Aget_name_by_idx(obj_id, ".", H5_INDEX_NAME, H5_ITER_INC, n, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) -!!$ CALL CHECK(ret, FAIL, "H5Aget_name_by_idx") -!!$ IF (HDstrcmp(attrname, tmpname)) CALL TestErrPrintf("Line %d: attribute name size wrong!\n"C, __LINE__) + CALL h5aget_info_by_idx_f(obj_id, ".", H5_INDEX_NAME_F, H5_ITER_DEC_F, n, & f_corder_valid, corder, cset, data_size, error) CALL check("h5aget_info_by_idx_f",error,total_error) @@ -1190,9 +1076,7 @@ SUBROUTINE attr_info_by_idx_check(obj_id, attrname, n, use_index, total_error ) f_corder_valid, corder, cset, data_size, error) CALL check("h5aget_info_by_idx_f",error,total_error) CALL VERIFY("h5aget_info_by_idx_f",corder,INT(n),total_error) -!!$ ret = H5Aget_name_by_idx(obj_id, ".", H5_INDEX_NAME, H5_ITER_DEC, (hsize_t)0, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) -!!$ CALL CHECK(ret, FAIL, "H5Aget_name_by_idx") -!!$ IF (HDstrcmp(attrname, tmpname)) CALL TestErrPrintf("Line %d: attribute name size wrong!\n"C, __LINE__) + END SUBROUTINE attr_info_by_idx_check @@ -1263,9 +1147,7 @@ SUBROUTINE test_attr_shared_rename( fcpl, fapl, total_error) INTEGER(HSIZE_T), DIMENSION(1) :: adims2 = (/1/) ! Attribute dimension INTEGER :: arank = 1 ! Attribure rank - ! /* Output message about test being performed */ -! WRITE(*,*) " - Testing Renaming Shared & Unshared Attributes in Compact & Dense Storage" -!!$ /* Initialize "big" attribute data */ + ! /* Initialize "big" attribute data */ ! /* Create dataspace for dataset */ CALL h5screate_f(H5S_SCALAR_F, sid, error) @@ -1338,19 +1220,6 @@ SUBROUTINE test_attr_shared_rename( fcpl, fapl, total_error) CALL h5dcreate_f(fid, DSET2_NAME, H5T_NATIVE_CHARACTER, sid, dataset2, error, dcpl_id=dcpl ) CALL check("h5dcreate_f",error,total_error) - ! /* Check on dataset's message storage status */ -!!$ if(test_shared != 0) { -!!$ /* Datasets' datatypes can be shared */ -!!$ ret = H5F_get_sohm_mesg_count_test(fid, H5O_DTYPE_ID, &mesg_count); -!!$ CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test"); -!!$ VERIFY(mesg_count, 1, "H5F_get_sohm_mesg_count_test"); -!!$ -!!$ /* Datasets' dataspace can be shared */ -!!$ ret = H5F_get_sohm_mesg_count_test(fid, H5O_SDSPACE_ID, &mesg_count); -!!$ CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test"); -!!$ VERIFY(mesg_count, 1, "H5F_get_sohm_mesg_count_test"); -!!$ } /* end if */ - ! /* Retrieve limits for compact/dense attribute storage */ CALL H5Pget_attr_phase_change_f(dcpl, max_compact, min_dense, error) CALL check("H5Pget_attr_phase_change_f",error,total_error) @@ -1358,16 +1227,8 @@ SUBROUTINE test_attr_shared_rename( fcpl, fapl, total_error) ! /* Close property list */ CALL h5pclose_f(dcpl,error) CALL check("h5pclose_f", error, total_error) -!!$ -!!$ -!!$ /* Check on datasets' attribute storage status */ -!!$ is_dense = H5O_is_attr_dense_test(dataset); -!!$ VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test"); -!!$ is_dense = H5O_is_attr_dense_test(dataset2); -!!$ VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test"); - ! /* Add attributes to each dataset, until after converting to dense storage */ - + ! /* Add attributes to each dataset, until after converting to dense storage */ DO u = 0, (max_compact * 2) - 1 ! /* Create attribute name */ @@ -1382,10 +1243,6 @@ SUBROUTINE test_attr_shared_rename( fcpl, fapl, total_error) CALL h5acreate_f(dataset, attrname, attr_tid, sid, attr, error, H5P_DEFAULT_F, H5P_DEFAULT_F) CALL check("h5acreate_f",error,total_error) -!!$ /* Check that attribute is not shared */ -!!$ is_shared = H5A_is_shared_test(attr); -!!$ VERIFY(is_shared, FALSE, "H5A_is_shared_test"); - ! /* Write data into the attribute */ attr_integer_data(1) = u + 1 data_dims(1) = 1 @@ -1397,15 +1254,6 @@ SUBROUTINE test_attr_shared_rename( fcpl, fapl, total_error) CALL h5acreate_f(dataset, attrname, attr_tid, big_sid, attr, error, H5P_DEFAULT_F, H5P_DEFAULT_F) CALL check("h5acreate_f",error,total_error) - ! Check that attribute is shared */ -!!$ is_shared = H5A_is_shared_test(attr); -!!$ VERIFY(is_shared, TRUE, "H5A_is_shared_test"); - - ! Check refcount for attribute */ -!!$ ret = H5A_get_shared_rc_test(attr, &shared_refcount); -!!$ CHECK(ret, FAIL, "H5A_get_shared_rc_test"); -!!$ VERIFY(shared_refcount, 1, "H5A_get_shared_rc_test"); -!!$ ! Write data into the attribute */ data_dims(1) = 1 @@ -1413,24 +1261,12 @@ SUBROUTINE test_attr_shared_rename( fcpl, fapl, total_error) CALL h5awrite_f(attr, attr_tid, attr_integer_data, data_dims, error) CALL check("h5awrite_f",error,total_error) - ! Check refcount for attribute */ -!!$ ret = H5A_get_shared_rc_test(attr, &shared_refcount); -!!$ CHECK(ret, FAIL, "H5A_get_shared_rc_test"); -!!$ VERIFY(shared_refcount, 1, "H5A_get_shared_rc_test"); ENDIF ! /* Close attribute */ CALL h5aclose_f(attr, error) CALL check("h5aclose_f",error,total_error) - ! /* Check on dataset's attribute storage status */ -!!$ is_dense = H5O_is_attr_dense_test(dataset); -!!$ if(u < max_compact) -!!$ VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test"); -!!$ else -!!$ VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test"); -!!$ -!!$ ! /* Alternate between creating "small" & "big" attributes */ IF(MOD(u+1,2).EQ.0)THEN @@ -1439,10 +1275,6 @@ SUBROUTINE test_attr_shared_rename( fcpl, fapl, total_error) CALL h5acreate_f(dataset2, attrname, attr_tid, sid, attr, error, H5P_DEFAULT_F, H5P_DEFAULT_F) CALL check("h5acreate_f",error,total_error) - ! /* Check that attribute is not shared */ -!!$ is_shared = H5A_is_shared_test(attr); -!!$ VERIFY(is_shared, FALSE, "H5A_is_shared_test"); -!!$ ! /* Write data into the attribute */ attr_integer_data(1) = u + 1 @@ -1456,15 +1288,6 @@ SUBROUTINE test_attr_shared_rename( fcpl, fapl, total_error) CALL h5acreate_f(dataset2, attrname, attr_tid, big_sid, attr, error, H5P_DEFAULT_F, H5P_DEFAULT_F) CALL check("h5acreate_f",error,total_error) -! /* Check that attribute is shared */ -!!$ is_shared = H5A_is_shared_test(attr); -!!$ VERIFY(is_shared, TRUE, "H5A_is_shared_test"); -!!$ -! /* Check refcount for attribute */ -!!$ ret = H5A_get_shared_rc_test(attr, &shared_refcount); -!!$ CHECK(ret, FAIL, "H5A_get_shared_rc_test"); -!!$ VERIFY(shared_refcount, 1, "H5A_get_shared_rc_test"); -!!$ ! /* Write data into the attribute */ @@ -1475,23 +1298,11 @@ SUBROUTINE test_attr_shared_rename( fcpl, fapl, total_error) ! /* Check refcount for attribute */ -!!$ ret = H5A_get_shared_rc_test(attr, &shared_refcount); -!!$ CHECK(ret, FAIL, "H5A_get_shared_rc_test"); -!!$ VERIFY(shared_refcount, 2, "H5A_get_shared_rc_test"); - ENDIF ! /* Close attribute */ CALL h5aclose_f(attr, error) CALL check("h5aclose_f",error,total_error) - ! /* Check on dataset's attribute storage status */ -!!$ is_dense = H5O_is_attr_dense_test(dataset2); -!!$ if(u < max_compact) -!!$ VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test"); -!!$ else -!!$ VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test"); - - ! /* Create new attribute name */ WRITE(chr2,'(I2.2)') u @@ -1510,22 +1321,6 @@ SUBROUTINE test_attr_shared_rename( fcpl, fapl, total_error) CALL H5Aopen_f(dataset2, attrname2, attr, error, aapl_id=H5P_DEFAULT_F) CALL check("H5Aopen_f",error,total_error) -!!$ -!!$ IF(MOD(u+1,2).EQ.0)THEN -!!$ ! /* Check that attribute is not shared */ -!!$ is_shared = H5A_is_shared_test(attr); -!!$ CALL VERIFY("H5A_is_shared_test", error, minusone) -!!$ ELSE -!!$ ! /* Check that attribute is shared */ -!!$ is_shared = H5A_is_shared_test(attr); -!!$ VERIFY(is_shared, TRUE, "H5A_is_shared_test"); -!!$ -!!$ /* Check refcount for attribute */ -!!$ ret = H5A_get_shared_rc_test(attr, &shared_refcount); -!!$ CHECK(ret, FAIL, "H5A_get_shared_rc_test"); -!!$ VERIFY(shared_refcount, 1, "H5A_get_shared_rc_test") -!!$ ENDIF - ! /* Close attribute */ CALL h5aclose_f(attr, error) CALL check("h5aclose_f",error,total_error) @@ -1534,22 +1329,6 @@ SUBROUTINE test_attr_shared_rename( fcpl, fapl, total_error) CALL H5Aopen_f(dataset, attrname, attr, error) CALL check("H5Aopen",error,total_error) -!!$ if(u % 2) { -!!$ /* Check that attribute is not shared */ -!!$ is_shared = H5A_is_shared_test(attr); -!!$ VERIFY(is_shared, FALSE, "H5A_is_shared_test"); -!!$ } /* end if */ -!!$ else { -!!$ /* Check that attribute is shared */ -!!$ is_shared = H5A_is_shared_test(attr); -!!$ VERIFY(is_shared, TRUE, "H5A_is_shared_test"); -!!$ -!!$ /* Check refcount for attribute */ -!!$ ret = H5A_get_shared_rc_test(attr, &shared_refcount); -!!$ CHECK(ret, FAIL, "H5A_get_shared_rc_test"); -!!$ VERIFY(shared_refcount, 1, "H5A_get_shared_rc_test"); -!!$ } /* end else */ - ! /* Close attribute */ CALL h5aclose_f(attr, error) CALL check("h5aclose_f",error,total_error) @@ -1565,22 +1344,6 @@ SUBROUTINE test_attr_shared_rename( fcpl, fapl, total_error) ! /* Check refcount on renamed attribute */ CALL H5Aopen_f(dataset2, attrname, attr, error) CALL check("H5Aopen",error,total_error) -!!$ -!!$ if(u % 2) { -!!$ /* Check that attribute is not shared */ -!!$ is_shared = H5A_is_shared_test(attr); -!!$ VERIFY(is_shared, FALSE, "H5A_is_shared_test"); -!!$ } /* end if */ -!!$ else { -!!$ /* Check that attribute is shared */ -!!$ is_shared = H5A_is_shared_test(attr); -!!$ VERIFY(is_shared, TRUE, "H5A_is_shared_test"); -!!$ -!!$ /* Check refcount for attribute */ -!!$ ret = H5A_get_shared_rc_test(attr, &shared_refcount); -!!$ CHECK(ret, FAIL, "H5A_get_shared_rc_test"); -!!$ VERIFY(shared_refcount, 2, "H5A_get_shared_rc_test"); -!!$ } /* end else */ ! /* Close attribute */ CALL h5aclose_f(attr, error) @@ -1592,22 +1355,6 @@ SUBROUTINE test_attr_shared_rename( fcpl, fapl, total_error) CALL H5Aopen_f(dataset, attrname, attr, error) CALL check("H5Aopen",error,total_error) -!!$ if(u % 2) { -!!$ /* Check that attribute is not shared */ -!!$ is_shared = H5A_is_shared_test(attr); -!!$ VERIFY(is_shared, FALSE, "H5A_is_shared_test"); -!!$ } /* end if */ -!!$ else { -!!$ /* Check that attribute is shared */ -!!$ is_shared = H5A_is_shared_test(attr); -!!$ VERIFY(is_shared, TRUE, "H5A_is_shared_test"); -!!$ -!!$ /* Check refcount for attribute */ -!!$ ret = H5A_get_shared_rc_test(attr, &shared_refcount); -!!$ CHECK(ret, FAIL, "H5A_get_shared_rc_test"); -!!$ VERIFY(shared_refcount, 2, "H5A_get_shared_rc_test"); -!!$ } /* end else */ - ! /* Close attribute */ CALL h5aclose_f(attr, error) CALL check("h5aclose_f",error,total_error) @@ -1624,20 +1371,6 @@ SUBROUTINE test_attr_shared_rename( fcpl, fapl, total_error) CALL h5dclose_f(dataset2, error) CALL check("h5dclose_f",error,total_error) -!!$ /* Check on shared message status now */ -!!$ if(test_shared != 0) { -!!$ if(test_shared == 1) { -!!$ /* Check on datatype storage status */ -!!$ ret = H5F_get_sohm_mesg_count_test(fid, H5O_DTYPE_ID, &mesg_count); -!!$ CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test"); -!!$ VERIFY(mesg_count, 2, "H5F_get_sohm_mesg_count_test"); -!!$ } /* end if */ -!!$ -!!$ /* Check on dataspace storage status */ -!!$ ret = H5F_get_sohm_mesg_count_test(fid, H5O_SDSPACE_ID, &mesg_count); -!!$ CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test"); -!!$ VERIFY(mesg_count, 2, "H5F_get_sohm_mesg_count_test"); -!!$ } /* end if */ ! /* Unlink datasets with attributes */ CALL H5Ldelete_f(fid, DSET1_NAME, error, H5P_DEFAULT_F) @@ -1651,23 +1384,6 @@ SUBROUTINE test_attr_shared_rename( fcpl, fapl, total_error) CALL check("HLdelete_f",error,total_error) ENDIF - ! /* Check on attribute storage status */ -!!$ ret = H5F_get_sohm_mesg_count_test(fid, H5O_ATTR_ID, &mesg_count); -!!$ CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test"); -!!$ VERIFY(mesg_count, 0, "H5F_get_sohm_mesg_count_test"); -!!$ -!!$ if(test_shared != 0) { -!!$ /* Check on datatype storage status */ -!!$ ret = H5F_get_sohm_mesg_count_test(fid, H5O_DTYPE_ID, &mesg_count); -!!$ CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test"); -!!$ VERIFY(mesg_count, 0, "H5F_get_sohm_mesg_count_test"); -!!$ -!!$ /* Check on dataspace storage status */ -!!$ ret = H5F_get_sohm_mesg_count_test(fid, H5O_SDSPACE_ID, &mesg_count); -!!$ CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test"); -!!$ VERIFY(mesg_count, 0, "H5F_get_sohm_mesg_count_test"); -!!$ } /* end if */ - ! /* Close file */ CALL h5fclose_f(fid, error) CALL check("h5fclose_f",error,total_error) @@ -1774,41 +1490,6 @@ SUBROUTINE test_attr_delete_by_idx(new_format, fcpl, fapl, total_error) ! /* Loop over using index for creation order value */ DO i = 1, 2 - ! /* Print appropriate test message */ -!!$ IF(idx_type .EQ. H5_INDEX_CRT_ORDER_F)THEN -!!$ IF(order .EQ. H5_ITER_INC_F) THEN -!!$ IF(use_index(i))THEN -!!$ WRITE(*,'(A102)') & -!!$ " - Testing Deleting Attribute By Creation Order Index in Increasing Order w/Creation Order Index" -!!$ ELSE -!!$ WRITE(*,'(A104)') & -!!$ " - Testing Deleting Attribute By Creation Order Index in Increasing Order w/o Creation Order Index" -!!$ ENDIF -!!$ ELSE -!!$ IF(use_index(i))THEN -!!$ WRITE(*,'(A102)') & -!!$ " - Testing Deleting Attribute By Creation Order Index in Decreasing Order w/Creation Order Index" -!!$ ELSE -!!$ WRITE(*,'(A104)') & -!!$ " - Testing Deleting Attribute By Creation Order Index in Decreasing Order w/o Creation Order Index" -!!$ ENDIF -!!$ ENDIF -!!$ ELSE -!!$ IF(order .EQ. H5_ITER_INC_F)THEN -!!$ IF(use_index(i))THEN -!!$ WRITE(*,'(7X,A86)')"- Testing Deleting Attribute By Name Index in Increasing Order w/Creation Order Index" -!!$ ELSE -!!$ WRITE(*,'(7X,A88)')"- Testing Deleting Attribute By Name Index in Increasing Order w/o Creation Order Index" -!!$ ENDIF -!!$ ELSE -!!$ IF(use_index(i))THEN -!!$ WRITE(*,'(7X,A86)') "- Testing Deleting Attribute By Name Index in Decreasing Order w/Creation Order Index" -!!$ ELSE -!!$ WRITE(*,'(7X,A88)') "- Testing Deleting Attribute By Name Index in Decreasing Order w/o Creation Order Index" -!!$ ENDIF -!!$ ENDIF -!!$ ENDIF - ! /* Create file */ CALL h5fcreate_f(FileName, H5F_ACC_TRUNC_F, fid, error, fcpl, fapl) CALL check("h5fcreate_f",error,total_error) @@ -1852,11 +1533,6 @@ SUBROUTINE test_attr_delete_by_idx(new_format, fcpl, fapl, total_error) ! CALL HDassert(0.AND."Toomanydatasets!") END SELECT - ! /* Check on dataset's attribute storage status */ -!!$ is_empty = H5O_is_attr_empty_test(my_dataset); -!!$ VERIFY(is_empty, TRUE, "H5O_is_attr_empty_test"); -!!$ is_dense = H5O_is_attr_dense_test(my_dataset); -!!$ VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test"); ! /* Check for deleting non-existant attribute */ !EP CALL H5Adelete_by_idx_f(my_dataset, '.', idx_type, order, 0_HSIZE_T,error, lapl_id=H5P_DEFAULT_F) @@ -1887,18 +1563,6 @@ SUBROUTINE test_attr_delete_by_idx(new_format, fcpl, fapl, total_error) ENDDO - - - ! /* Verify state of object */ - -!!$ ret = H5O_num_attrs_test(my_dataset, &nattrs); -!!$ CHECK(ret, FAIL, "H5O_num_attrs_test"); -!!$ VERIFY(nattrs, max_compact, "H5O_num_attrs_test"); -!!$ is_empty = H5O_is_attr_empty_test(my_dataset); -!!$ VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test"); -!!$ is_dense = H5O_is_attr_dense_test(my_dataset); -!!$ VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test"); - !/* Check for out of bound deletions */ CALL H5Adelete_by_idx_f(my_dataset, ".", idx_type, order, INT(u,HSIZE_T), error, lapl_id=H5P_DEFAULT_F) CALL VERIFY("H5Adelete_by_idx_f",error,minusone,total_error) @@ -1946,7 +1610,6 @@ SUBROUTINE test_attr_delete_by_idx(new_format, fcpl, fapl, total_error) ENDIF ! /* Verify the name for first attribute in appropriate order */ - ! HDmemset(tmpname, 0, (size_t)NAME_BUF_SIZE); size = 7 ! *CHECK* IF NOT THE SAME SIZE CALL h5aget_name_by_idx_f(my_dataset, ".", idx_type, order,INT(0,hsize_t), & @@ -1969,10 +1632,6 @@ SUBROUTINE test_attr_delete_by_idx(new_format, fcpl, fapl, total_error) CALL H5Adelete_by_idx_f(my_dataset, ".", idx_type, order, hzero, error) CALL check("H5Adelete_by_idx_f",error,total_error) - - ! /* Verify state of attribute storage (empty) */ -!!$ is_empty = H5O_is_attr_empty_test(my_dataset); -!!$ VERIFY(is_empty, TRUE, "H5O_is_attr_empty_test"); ENDDO ! /* Work on all the datasets */ @@ -2011,34 +1670,8 @@ SUBROUTINE test_attr_delete_by_idx(new_format, fcpl, fapl, total_error) CALL h5aclose_f(attr, error) CALL check("h5aclose_f",error,total_error) - ! /* Verify state of object */ - IF(u .GE. max_compact)THEN -!!$ is_dense = H5O_is_attr_dense_test(my_dataset); -!!$ VERIFY(is_dense, (new_format ? TRUE : FALSE), "H5O_is_attr_dense_test"); - ENDIF - ! /* Verify information for new attribute */ -!!$ CALL check("attr_info_by_idx_check",error,total_error) ENDDO - - ! /* Verify state of object */ -!!$ ret = H5O_num_attrs_test(my_dataset, &nattrs); -!!$ CHECK(ret, FAIL, "H5O_num_attrs_test"); -!!$ VERIFY(nattrs, (max_compact * 2), "H5O_num_attrs_test"); -!!$ is_empty = H5O_is_attr_empty_test(my_dataset); -!!$ VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test"); -!!$ is_dense = H5O_is_attr_dense_test(my_dataset); -!!$ VERIFY(is_dense, (new_format ? TRUE : FALSE), "H5O_is_attr_dense_test"); -!!$ - IF(new_format)THEN -!!$ ! /* Retrieve & verify # of records in the name & creation order indices */ -!!$ ret = H5O_attr_dense_info_test(my_dataset, &name_count, &corder_count); -!!$ CHECK(ret, FAIL, "H5O_attr_dense_info_test"); -!!$ IF(use_index) -!!$ VERIFY(name_count, corder_count, "H5O_attr_dense_info_test"); -!!$ VERIFY(name_count, (max_compact * 2), "H5O_attr_dense_info_test"); - ENDIF - ! /* Check for out of bound deletion */ CALL H5Adelete_by_idx_f(my_dataset, ".", idx_type, order, INT(u,HSIZE_T), error) CALL VERIFY("H5Adelete_by_idx_f",error,minusone,total_error) @@ -2054,8 +1687,6 @@ SUBROUTINE test_attr_delete_by_idx(new_format, fcpl, fapl, total_error) my_dataset = dset2 CASE (2) my_dataset = dset3 - ! CASE DEFAULT - ! CALL HDassert(0.AND."Toomanydatasets!") END SELECT ! /* Delete attributes from dense storage */ @@ -2101,9 +1732,6 @@ SUBROUTINE test_attr_delete_by_idx(new_format, fcpl, fapl, total_error) CALL H5Adelete_by_idx_f(my_dataset, ".", idx_type, order, INT(0,HSIZE_T), error, lapl_id=H5P_DEFAULT_F) CALL check("H5Adelete_by_idx_f",error,total_error) - ! /* Verify state of attribute storage (empty) */ -!!$ is_empty = H5O_is_attr_empty_test(my_dataset); -!!$ VERIFY(is_empty, TRUE, "H5O_is_attr_empty_test"); !/* Check for deletion on empty attribute storage again */ CALL H5Adelete_by_idx_f(my_dataset, ".", idx_type, order, INT(0,HSIZE_T), error) @@ -2194,7 +1822,6 @@ SUBROUTINE test_attr_shared_delete(fcpl, fapl, total_error) INTEGER :: arank = 1 ! Attribure rank ! /* Output message about test being performed */ -! WRITE(*,*) " - Testing Deleting Shared & Unshared Attributes in Compact & Dense Storage" ! /* Initialize "big" attribute DATA */ ! /* Create dataspace for dataset */ @@ -2225,11 +1852,9 @@ SUBROUTINE test_attr_shared_delete(fcpl, fapl, total_error) ! /* Make attributes > 500 bytes shared */ CALL H5Pset_shared_mesg_nindexes_f(my_fcpl,1,error) CALL check("H5Pset_shared_mesg_nindexes_f",error, total_error) -!!$ CHECK_I(ret, "H5Pset_shared_mesg_nindexes"); CALL H5Pset_shared_mesg_index_f(my_fcpl, 0, H5O_SHMESG_ATTR_FLAG_F, 500,error) CALL check(" H5Pset_shared_mesg_index_f",error, total_error) -!!$ CHECK_I(ret, "H5Pset_shared_mesg_index"); ELSE ! /* Set up copy of file creation property list */ CALL H5Pset_shared_mesg_nindexes_f(my_fcpl,3,error) @@ -2238,7 +1863,6 @@ SUBROUTINE test_attr_shared_delete(fcpl, fapl, total_error) ! /* Make datatypes & dataspaces > 1 byte shared (i.e. all of them :-) */ CALL H5Pset_shared_mesg_index_f(my_fcpl, 1, H5O_SHMESG_DTYPE_FLAG_F, 1,error) CALL H5Pset_shared_mesg_index_f(my_fcpl, 2, H5O_SHMESG_SDSPACE_FLAG_F, 1,error) -!!$ CHECK_I(ret, "H5Pset_shared_mesg_index"); ENDIF ! /* Create file */ @@ -2275,19 +1899,6 @@ SUBROUTINE test_attr_shared_delete(fcpl, fapl, total_error) CALL h5dcreate_f(fid, DSET2_NAME, H5T_NATIVE_CHARACTER, sid, dataset2, error, dcpl_id=dcpl ) CALL check("h5dcreate_f",error,total_error) - ! /* Check on dataset's message storage status */ -!!$ if(test_shared != 0) { -!!$ /* Datasets' datatypes can be shared */ -!!$ ret = H5F_get_sohm_mesg_count_test(fid, H5O_DTYPE_ID, &mesg_count); -!!$ CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test"); -!!$ VERIFY(mesg_count, 1, "H5F_get_sohm_mesg_count_test"); -!!$ -!!$ /* Datasets' dataspace can be shared */ -!!$ ret = H5F_get_sohm_mesg_count_test(fid, H5O_SDSPACE_ID, &mesg_count); -!!$ CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test"); -!!$ VERIFY(mesg_count, 1, "H5F_get_sohm_mesg_count_test"); -!!$ } /* end if */ -!!$ ! /* Retrieve limits for compact/dense attribute storage */ CALL H5Pget_attr_phase_change_f(dcpl, max_compact, min_dense, error) CALL check("H5Pget_attr_phase_change_f",error,total_error) @@ -2295,13 +1906,7 @@ SUBROUTINE test_attr_shared_delete(fcpl, fapl, total_error) ! /* Close property list */ CALL h5pclose_f(dcpl,error) CALL check("h5pclose_f", error, total_error) -!!$ -!!$ /* Check on datasets' attribute storage status */ -!!$ is_dense = H5O_is_attr_dense_test(dataset); -!!$ VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test"); -!!$ is_dense = H5O_is_attr_dense_test(dataset2); -!!$ VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test"); -!!$ + ! /* Add attributes to each dataset, until after converting to dense storage */ DO u = 0, (max_compact * 2) - 1 @@ -2318,10 +1923,6 @@ SUBROUTINE test_attr_shared_delete(fcpl, fapl, total_error) CALL h5acreate_f(dataset, attrname, attr_tid, sid, attr, error, H5P_DEFAULT_F, H5P_DEFAULT_F) CALL check("h5acreate_f",error,total_error) -!!$ /* Check that attribute is not shared */ -!!$ is_shared = H5A_is_shared_test(attr); -!!$ VERIFY(is_shared, FALSE, "H5A_is_shared_test"); - ! /* Write data into the attribute */ attr_integer_data(1) = u + 1 data_dims(1) = 1 @@ -2332,16 +1933,7 @@ SUBROUTINE test_attr_shared_delete(fcpl, fapl, total_error) CALL h5acreate_f(dataset, attrname, attr_tid, big_sid, attr, error) CALL check("h5acreate_f",error,total_error) -!!$ - ! Check that attribute is shared */ -!!$ is_shared = H5A_is_shared_test(attr); -!!$ VERIFY(is_shared, TRUE, "H5A_is_shared_test"); - - ! Check refcount for attribute */ -!!$ ret = H5A_get_shared_rc_test(attr, &shared_refcount); -!!$ CHECK(ret, FAIL, "H5A_get_shared_rc_test"); -!!$ VERIFY(shared_refcount, 1, "H5A_get_shared_rc_test"); -!!$ + ! Write data into the attribute */ attr_integer_data(1) = u + 1 @@ -2349,24 +1941,12 @@ SUBROUTINE test_attr_shared_delete(fcpl, fapl, total_error) CALL h5awrite_f(attr, attr_tid, attr_integer_data, data_dims, error) CALL check("h5awrite_f",error,total_error) - ! Check refcount for attribute */ -!!$ ret = H5A_get_shared_rc_test(attr, &shared_refcount); -!!$ CHECK(ret, FAIL, "H5A_get_shared_rc_test"); -!!$ VERIFY(shared_refcount, 1, "H5A_get_shared_rc_test"); ENDIF ! /* Close attribute */ CALL h5aclose_f(attr, error) CALL check("h5aclose_f",error,total_error) - ! /* Check on dataset's attribute storage status */ -!!$ is_dense = H5O_is_attr_dense_test(dataset); -!!$ if(u < max_compact) -!!$ VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test"); -!!$ else -!!$ VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test"); -!!$ -!!$ ! /* Alternate between creating "small" & "big" attributes */ IF(MOD(u+1,2).EQ.0)THEN @@ -2375,10 +1955,6 @@ SUBROUTINE test_attr_shared_delete(fcpl, fapl, total_error) CALL h5acreate_f(dataset2, attrname, attr_tid, sid, attr, error) CALL check("h5acreate_f",error,total_error) - ! /* Check that attribute is not shared */ -!!$ is_shared = H5A_is_shared_test(attr); -!!$ VERIFY(is_shared, FALSE, "H5A_is_shared_test"); -!!$ ! /* Write data into the attribute */ attr_integer_data(1) = u + 1 data_dims(1) = 1 @@ -2391,15 +1967,6 @@ SUBROUTINE test_attr_shared_delete(fcpl, fapl, total_error) CALL h5acreate_f(dataset2, attrname, attr_tid, big_sid, attr, error, acpl_id=H5P_DEFAULT_F, aapl_id=H5P_DEFAULT_F) CALL check("h5acreate_f",error,total_error) -! /* Check that attribute is shared */ -!!$ is_shared = H5A_is_shared_test(attr); -!!$ VERIFY(is_shared, TRUE, "H5A_is_shared_test"); -!!$ -! /* Check refcount for attribute */ -!!$ ret = H5A_get_shared_rc_test(attr, &shared_refcount); -!!$ CHECK(ret, FAIL, "H5A_get_shared_rc_test"); -!!$ VERIFY(shared_refcount, 1, "H5A_get_shared_rc_test"); -!!$ ! /* Write data into the attribute */ @@ -2408,23 +1975,11 @@ SUBROUTINE test_attr_shared_delete(fcpl, fapl, total_error) CALL h5awrite_f(attr, attr_tid, attr_integer_data, data_dims, error) CALL check("h5awrite_f",error,total_error) - -! /* Check refcount for attribute */ -!!$ ret = H5A_get_shared_rc_test(attr, &shared_refcount); -!!$ CHECK(ret, FAIL, "H5A_get_shared_rc_test"); -!!$ VERIFY(shared_refcount, 2, "H5A_get_shared_rc_test"); - ENDIF ! /* Close attribute */ CALL h5aclose_f(attr, error) CALL check("h5aclose_f",error,total_error) - ! /* Check on dataset's attribute storage status */ -!!$ is_dense = H5O_is_attr_dense_test(dataset2); -!!$ if(u < max_compact) -!!$ VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test"); -!!$ else -!!$ VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test"); ENDDO ! /* Delete attributes from second dataset */ @@ -2439,29 +1994,9 @@ SUBROUTINE test_attr_shared_delete(fcpl, fapl, total_error) CALL H5Adelete_by_name_f(fid, DSET2_NAME, attrname,error,lapl_id=H5P_DEFAULT_F) CALL check("H5Adelete_by_name", error, total_error) -!!$ /* Check refcount on attributes now */ -!!$ -!!$ /* Check refcount on first dataset's attribute */ - CALL h5aopen_f(dataset, attrname, attr, error, aapl_id=H5P_DEFAULT_F) CALL check("h5aopen_f",error,total_error) -!!$ -!!$ if(u % 2) { -! /* Check that attribute is not shared */ -!!$ is_shared = H5A_is_shared_test(attr); -!!$ VERIFY(is_shared, FALSE, "H5A_is_shared_test"); -!!$ } /* end if */ -!!$ else { -!/* Check that attribute is shared */ -!!$ is_shared = H5A_is_shared_test(attr); -!!$ VERIFY(is_shared, TRUE, "H5A_is_shared_test"); -!!$ -!/* Check refcount for attribute */ -!!$ ret = H5A_get_shared_rc_test(attr, &shared_refcount); -!!$ CHECK(ret, FAIL, "H5A_get_shared_rc_test"); -!!$ VERIFY(shared_refcount, 1, "H5A_get_shared_rc_test"); -!!$ } /* end else */ ! /* Close attribute */ CALL h5aclose_f(attr, error) @@ -2480,21 +2015,6 @@ SUBROUTINE test_attr_shared_delete(fcpl, fapl, total_error) CALL h5dclose_f(dataset2, error) CALL check("h5dclose_f",error,total_error) - ! /* Check on shared message status now */ -!!$ if(test_shared != 0) { -!!$ if(test_shared == 1) { - ! /* Check on datatype storage status */ -!!$ ret = H5F_get_sohm_mesg_count_test(fid, H5O_DTYPE_ID, &mesg_count); -!!$ CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test"); -!!$ VERIFY(mesg_count, 2, "H5F_get_sohm_mesg_count_test"); -!!$ } /* end if */ -!!$ -!!$ /* Check on dataspace storage status */ -!!$ ret = H5F_get_sohm_mesg_count_test(fid, H5O_SDSPACE_ID, &mesg_count); -!!$ CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test"); -!!$ VERIFY(mesg_count, 2, "H5F_get_sohm_mesg_count_test"); -!!$ } /* end if */ -!!$ ! /* Unlink datasets WITH attributes */ CALL h5ldelete_f(fid, DSET1_NAME, error, H5P_DEFAULT_F) @@ -2509,31 +2029,11 @@ SUBROUTINE test_attr_shared_delete(fcpl, fapl, total_error) CALL check("H5Ldelete_f", error, total_error) ENDIF - ! /* Check on attribute storage status */ -!!$ ret = H5F_get_sohm_mesg_count_test(fid, H5O_ATTR_ID, &mesg_count); -!!$ CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test"); -!!$ VERIFY(mesg_count, 0, "H5F_get_sohm_mesg_count_test"); -!!$ -!!$ if(test_shared != 0) { -!!$ /* Check on datatype storage status */ -!!$ ret = H5F_get_sohm_mesg_count_test(fid, H5O_DTYPE_ID, &mesg_count); -!!$ CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test"); -!!$ VERIFY(mesg_count, 0, "H5F_get_sohm_mesg_count_test"); -!!$ -!!$ /* Check on dataspace storage status */ -!!$ ret = H5F_get_sohm_mesg_count_test(fid, H5O_SDSPACE_ID, &mesg_count); -!!$ CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test"); -!!$ VERIFY(mesg_count, 0, "H5F_get_sohm_mesg_count_test"); -!!$ } /* end if */ -!!$ ! /* Close file */ CALL h5fclose_f(fid, error) CALL check("h5fclose_f",error,total_error) -!!$ -!!$ /* Check size of file */ -!!$ filesize = h5_get_file_size(FILENAME); -!!$ VERIFY(filesize, empty_filesize, "h5_get_file_size"); + ENDDO ! /* Close dataspaces */ @@ -2587,8 +2087,6 @@ SUBROUTINE test_attr_dense_open( fcpl, fapl, total_error) data_dims = 0 - ! /* Output message about test being performed */ -! WRITE(*,*) " - Testing Opening Attributes in Dense Storage" ! /* Create file */ @@ -2631,10 +2129,6 @@ SUBROUTINE test_attr_dense_open( fcpl, fapl, total_error) CALL h5pclose_f(dcpl, error) CALL check("h5pclose_f",error,total_error) - ! /* Check on dataset's attribute storage status */ - ! is_dense = H5O_is_attr_dense_test(dataset); - ! VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test"); - ! /* Add attributes, until just before converting to dense storage */ DO u = 0, max_compact - 1 @@ -2657,13 +2151,8 @@ SUBROUTINE test_attr_dense_open( fcpl, fapl, total_error) ! /* Verify attributes written so far */ CALL test_attr_dense_verify(dataset, u, total_error) - ! CHECK(ret, FAIL, "test_attr_dense_verify"); ENDDO - - ! /* Check on dataset's attribute storage status */ -!!$ is_dense = H5O_is_attr_dense_test(dataset); -!!$ VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test"); - +! ! /* Add one more attribute, to push into "dense" storage */ ! /* Create attribute */ @@ -2673,11 +2162,6 @@ SUBROUTINE test_attr_dense_open( fcpl, fapl, total_error) CALL h5acreate_f(dataset, attrname, H5T_NATIVE_INTEGER, sid, attr, error, aapl_id=H5P_DEFAULT_F) CALL check("h5acreate_f",error,total_error) - ! /* Check on dataset's attribute storage status */ -!!$ is_dense = H5O_is_attr_dense_test(dataset); -!!$ VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test"); - - ! /* Write data into the attribute */ data_dims(1) = 1 CALL h5awrite_f(attr, H5T_NATIVE_INTEGER, u, data_dims, error) @@ -2687,7 +2171,6 @@ SUBROUTINE test_attr_dense_open( fcpl, fapl, total_error) CALL h5aclose_f(attr, error) CALL check("h5aclose_f",error,total_error) - ! /* Close dataspace */ CALL h5sclose_f(sid, error) CALL check("h5sclose_f",error,total_error) @@ -2990,8 +2473,6 @@ SUBROUTINE test_attr_basic_write(fapl, total_error) attr_data1a(2) = 1087 attr_data1a(3) = -99890 - ! /* Output message about test being performed */ -! WRITE(*,*) " - Testing Basic Scalar Attribute Writing Functions" ! /* Create file */ CALL h5fcreate_f(FileName, H5F_ACC_TRUNC_F, fid1, error, H5P_DEFAULT_F, fapl) @@ -3056,8 +2537,6 @@ SUBROUTINE test_attr_basic_write(fapl, total_error) CALL check("h5aget_storage_size_f",error,total_error) !EP CALL VERIFY("h5aget_storage_size_f", INT(attr_size), 2*HSIZE_T, total_error) -! attr_size = H5Aget_storage_size(attr); -! VERIFY(attr_size, (ATTR1_DIM1 * sizeof(int)), "H5A_get_storage_size"); ! /* Read attribute information immediately, without closing attribute */ CALL h5aread_f(attr, H5T_NATIVE_INTEGER, read_data1, dimsa, error) @@ -3156,9 +2635,6 @@ SUBROUTINE test_attr_many(new_format, fcpl, fapl, total_error) INTEGER(HID_T) :: sid INTEGER(HID_T) :: gid INTEGER(HID_T) :: aid - - - INTEGER :: error INTEGER(HSIZE_T), DIMENSION(7) :: data_dims @@ -3175,8 +2651,6 @@ SUBROUTINE test_attr_many(new_format, fcpl, fapl, total_error) data_dims = 0 - ! /* Output message about test being performed */ -! WRITE(*,*) " - Testing Storing Many Attributes" !/* Create file */ CALL h5fcreate_f(FileName, H5F_ACC_TRUNC_F, fid, error, fcpl, fapl) diff --git a/fortran/test/tH5D.f90 b/fortran/test/tH5D.f90 index 56e82f4..9f7b50c 100644 --- a/fortran/test/tH5D.f90 +++ b/fortran/test/tH5D.f90 @@ -1,3 +1,12 @@ +!****h* root/fortran/test/tH5D.f90 +! +! NAME +! tH5D.f90 +! +! FUNCTION +! Basic testing of Fortran H5D APIs. +! +! COPYRIGHT ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! Copyright by The HDF Group. * ! Copyright by the Board of Trustees of the University of Illinois. * @@ -13,14 +22,17 @@ ! access to either file, you may request a copy from help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! +! NOTES +! Tests the H5D APIs functionalities of: +! h5dcreate_f, h5dopen_f, h5dclose_f, h5dget_space_f, h5dget_type_f, +! h5dread_f, and h5dwrite_f, h5dget_space_status_f ! ! -! Testing Dataset Interface functionality. -! +! CONTAINS SUBROUTINES +! datasettest, extenddsettest ! -! The following subroutine tests the following functionalities: -! h5dcreate_f, h5dopen_f, h5dclose_f, h5dget_space_f, h5dget_type_f, -! h5dread_f, and h5dwrite_f +!***** + ! SUBROUTINE datasettest(cleanup, total_error) USE HDF5 ! This module contains all necessary modules @@ -52,6 +64,7 @@ INTEGER(HSIZE_T), DIMENSION(2) :: data_dims INTEGER(HSIZE_T), DIMENSION(1) :: null_data_dim INTEGER :: null_dset_data = 1 ! null data + INTEGER :: flag ! Space allocation status ! ! Initialize the dset_data array. @@ -151,6 +164,16 @@ CALL h5dopen_f(file_id, null_dsetname, null_dset, error) CALL check("h5dopen_f", error, total_error) + ! Test whether space has been allocated for a dataset + CALL h5dget_space_status_f(dset_id, flag, error) + CALL check("h5dget_space_status_f",error, total_error) + CALL verify("h5dget_space_status_f", flag, H5D_SPACE_STS_ALLOCATED_F, total_error) + + CALL h5dget_space_status_f(null_dset, flag, error) + CALL check("h5dget_space_status_f",error, total_error) + CALL verify("h5dget_space_status_f", flag, H5D_SPACE_STS_NOT_ALLOCATED_F, total_error) + + ! ! Get the dataset type. ! diff --git a/fortran/test/tH5E.f90 b/fortran/test/tH5E.f90 index a4912bd..4d431a1 100644 --- a/fortran/test/tH5E.f90 +++ b/fortran/test/tH5E.f90 @@ -1,3 +1,12 @@ +!****h* root/fortran/test/tH5E.f90 +! +! NAME +! tH5E.f90 +! +! FUNCTION +! Basic testing of Fortran H5E APIs. +! +! COPYRIGHT ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! Copyright by The HDF Group. * ! Copyright by the Board of Trustees of the University of Illinois. * @@ -13,6 +22,15 @@ ! access to either file, you may request a copy from help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! +! NOTES +! Tests the H5D APIs functionalities of: +! h5eprint_f +! +! CONTAINS SUBROUTINES +! error_report_test +! +!***** +! SUBROUTINE error_report_test(cleanup, total_error) ! This subroutine tests following functionalities: h5eprint_f diff --git a/fortran/test/tH5E_F03.f90 b/fortran/test/tH5E_F03.f90 new file mode 100644 index 0000000..04e3190 --- /dev/null +++ b/fortran/test/tH5E_F03.f90 @@ -0,0 +1,210 @@ +!****h* root/fortran/test/tH5E_F03.f90 +! +! NAME +! tH5E_F03.f90 +! +! FUNCTION +! Test FORTRAN HDF5 H5E APIs which are dependent on FORTRAN 2003 +! features. +! +! COPYRIGHT +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +! USES +! liter_cb_mod +! +! CONTAINS SUBROUTINES +! test_error +! +!***** + +! ***************************************** +! *** H 5 E T E S T S +! ***************************************** + +MODULE test_my_hdf5_error_handler + + IMPLICIT NONE + +CONTAINS + +!/**************************************************************** +!** +!** my_hdf5_error_handler: Custom error callback routine. +!** +!****************************************************************/ + + INTEGER FUNCTION my_hdf5_error_handler(estack_id, data_inout) bind(C) + + ! This error function handle works with only version 2 error stack + + USE HDF5 + USE ISO_C_BINDING + IMPLICIT NONE + + ! estack_id is always passed from C as: H5E_DEFAULT + INTEGER(HID_T) :: estack_id + ! data that was registered with H5Eset_auto_f +! INTEGER, DIMENSION(1:2) :: data_inout + INTEGER :: data_inout + + PRINT*, " " + PRINT*, " Subtest: H5Eset_auto_f custom error message with callback, WITH DATA" + PRINT*, " -This message should be written to standard out- " + PRINT*, " Data Values Passed In =", data_inout + PRINT*, " " + + data_inout = 10*data_inout + + my_hdf5_error_handler = 1 ! this is not used by the C routine + + END FUNCTION my_hdf5_error_handler + + INTEGER FUNCTION my_hdf5_error_handler_nodata(estack_id, data_inout) bind(C) + + ! This error function handle works with only version 2 error stack + + USE HDF5 + USE ISO_C_BINDING + IMPLICIT NONE + + ! estack_id is always passed from C as: H5E_DEFAULT + INTEGER(HID_T) :: estack_id + ! data that was registered with H5Eset_auto_f + TYPE(C_PTR) :: data_inout + + PRINT*, " " + PRINT*, " Subtest: H5Eset_auto_f custom error message with callback, NO DATA" + PRINT*, " -This message should be written to standard out- " + PRINT*, " " + + my_hdf5_error_handler_nodata = 1 ! this is not used by the C routine + + END FUNCTION my_hdf5_error_handler_nodata + +END MODULE test_my_hdf5_error_handler + +SUBROUTINE test_error(total_error) + + USE HDF5 + USE ISO_C_BINDING + USE test_my_hdf5_error_handler + + IMPLICIT NONE + + INTEGER(hid_t), PARAMETER :: FAKE_ID = -1 + INTEGER :: total_error + INTEGER(hid_t) :: file + INTEGER(hid_t) :: dataset, space + INTEGER(hid_t) :: estack_id + INTEGER(hsize_t), DIMENSION(1:2) :: dims + CHARACTER(LEN=10) :: FUNC_test_error = "test_error" + TYPE(C_FUNPTR) :: old_func + TYPE(C_PTR) :: old_data, null_data + INTEGER :: error + TYPE(C_FUNPTR) :: op + INTEGER, DIMENSION(1:100,1:200), TARGET :: ipoints2 + !! INTEGER, DIMENSION(1:2), TARGET :: my_hdf5_error_handler_data + INTEGER, DIMENSION(:), POINTER :: ptr_data + INTEGER, TARGET :: my_hdf5_error_handler_data + TYPE(C_PTR) :: f_ptr + TYPE(C_FUNPTR) :: func + + TYPE(C_PTR), TARGET :: f_ptr1 + TYPE(C_FUNPTR), TARGET :: func1 + + INTEGER, DIMENSION(1:1) :: array_shape + LOGICAL :: is_associated + + ! my_hdf5_error_handler_data(1:2) =(/1,2/) + my_hdf5_error_handler_data = 99 + CALL h5fcreate_f("terror.h5", H5F_ACC_TRUNC_F, file, error) + CALL check("h5fcreate_f", error, total_error) + + ! Create the data space + dims(1) = 10 + dims(2) = 20 + CALL H5Screate_simple_f(2, dims, space, error) + CALL check("h5screate_simple_f", error, total_error) + + ! ** SET THE CUSTOMIZED PRINTING OF ERROR STACK ** + + ! set the customized error handling routine + func = c_funloc(my_hdf5_error_handler) + + ! set the data sent to the customized routine + f_ptr = c_loc(my_hdf5_error_handler_data) + + ! turn on automatic printing, and use a custom error routine with input data + CALL H5Eset_auto_f(1, error, H5E_DEFAULT_F, func, f_ptr) + + ! Create the erring dataset + CALL h5dcreate_f(FAKE_ID,"a_dataset",H5T_NATIVE_INTEGER, space, dataset, error) + CALL VERIFY("h5dcreate_f", error, -1, total_error) + +!!$ CALL VERIFY("H5Eset_auto_f",my_hdf5_error_handler_data(1),10, total_error) +!!$ CALL VERIFY("H5Eset_auto_f",my_hdf5_error_handler_data(2),20, total_error) + +!!$ ! Test enabling and disabling default printing +!!$ +!!$ CALL H5Eget_auto_f(H5E_DEFAULT_F, func1, f_ptr1, error) +!!$ CALL VERIFY("H5Eget_auto_f", error, 0, total_error) + + ! PRINT*,c_associated(f_ptr1) + + ALLOCATE(ptr_data(1:2)) + ptr_data = 0 + array_shape(1) = 2 + CALL C_F_POINTER(f_ptr1, ptr_data, array_shape) + + ! ptr_data => f_ptr1(1) + + ! PRINT*,ptr_data(1) + +!!$ if(old_data != NULL) +!!$ TEST_ERROR; +!!$#ifdef H5_USE_16_API +!!$ if (old_func != (H5E_auto_t)H5Eprint) +!!$ TEST_ERROR; +!!$#else /* H5_USE_16_API */ +!!$ if (old_func != (H5E_auto2_t)H5Eprint2) +!!$ TEST_ERROR; +!!$#endif /* H5_USE_16_API */ + + + ! set the customized error handling routine + func = c_funloc(my_hdf5_error_handler_nodata) + ! set the data sent to the customized routine as null + f_ptr = C_NULL_PTR + ! turn on automatic printing, and use a custom error routine with no input data + CALL H5Eset_auto_f(1, error, H5E_DEFAULT_F, func, f_ptr) + + CALL h5dcreate_f(FAKE_ID,"a_dataset",H5T_NATIVE_INTEGER, space, dataset, error) + CALL VERIFY("h5dcreate_f", error, -1, total_error) + + + ! turn on automatic printing with h5eprint_f which prints an error stack in the default manner. + + ! func = c_funloc(h5eprint_f) + ! CALL H5Eset_auto_f(0, error, H5E_DEFAULT_F, func, C_NULL_PTR) + + CALL H5Eset_auto_f(0, error) + CALL h5dcreate_f(FAKE_ID,"a_dataset",H5T_NATIVE_INTEGER, space, dataset, error) + + CALL H5Eset_auto_f(1, error) + CALL h5dcreate_f(FAKE_ID,"a_dataset",H5T_NATIVE_INTEGER, space, dataset, error) + +END SUBROUTINE test_error diff --git a/fortran/test/tH5F.f90 b/fortran/test/tH5F.f90 index 4b88cb3..d8f683c 100644 --- a/fortran/test/tH5F.f90 +++ b/fortran/test/tH5F.f90 @@ -1,3 +1,12 @@ +!****h* root/fortran/test/tH5F.f90 +! +! NAME +! tH5F.f90 +! +! FUNCTION +! Basic testing of Fortran H5F APIs. +! +! COPYRIGHT ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! Copyright by The HDF Group. * ! Copyright by the Board of Trustees of the University of Illinois. * @@ -13,15 +22,15 @@ ! access to either file, you may request a copy from help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! +! CONTAINS SUBROUTINES +! mountingtest, reopentest, plisttest, file_close, file_space ! +!***** ! -! Testing File Interface functionality. -! -! In the mountingtest subroutine we create one file with a group in it, -! and another file with a dataset. Mounting is used to -! access the dataset from the second file as a member of a group -! in the first file. -! +! In the mountingtest subroutine we create one file with a group in it, +! and another file with a dataset. Mounting is used to +! access the dataset from the second file as a member of a group +! in the first file. SUBROUTINE mountingtest(cleanup, total_error) USE HDF5 ! This module contains all necessary modules IMPLICIT NONE diff --git a/fortran/test/tH5G.f90 b/fortran/test/tH5G.f90 index 300e538..6befa94 100644 --- a/fortran/test/tH5G.f90 +++ b/fortran/test/tH5G.f90 @@ -1,3 +1,12 @@ +!****h* root/fortran/test/tH5G.f90 +! +! NAME +! tH5G.f90 +! +! FUNCTION +! Basic testing of Fortran H5G APIs. +! +! COPYRIGHT ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! Copyright by The HDF Group. * ! Copyright by the Board of Trustees of the University of Illinois. * @@ -13,6 +22,11 @@ ! access to either file, you may request a copy from help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! +! CONTAINS SUBROUTINES +! group_test +! +!***** + SUBROUTINE group_test(cleanup, total_error) ! This subroutine tests following functionalities: @@ -236,6 +250,7 @@ CALL h5sclose_f(dspace_id, error) CALL check("h5sclose_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 group_test diff --git a/fortran/test/tH5G_1_8.f90 b/fortran/test/tH5G_1_8.f90 index 6a2c623..fd55ba9 100644 --- a/fortran/test/tH5G_1_8.f90 +++ b/fortran/test/tH5G_1_8.f90 @@ -1,3 +1,12 @@ +!****h* root/fortran/test/tH5G_1_8.f90 +! +! NAME +! tH5G_1_8.f90 +! +! FUNCTION +! Basic testing of Fortran H5G APIs introduced in 1.8. +! +! COPYRIGHT ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! Copyright by The HDF Group. * ! Copyright by the Board of Trustees of the University of Illinois. * @@ -13,6 +22,12 @@ ! access to either file, you may request a copy from help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! +! CONTAINS SUBROUTINES +! group_test, group_info, timestamps, mklinks, test_move_preserves, lifecycle +! cklinks, delete_by_idx, link_info_by_idx_check, test_lcpl, objcopy, +! lapl_nlinks +! +!***** SUBROUTINE group_test(cleanup, total_error) USE HDF5 ! This module contains all necessary modules @@ -1057,6 +1072,7 @@ SUBROUTINE lifecycle(cleanup, fapl2, total_error) CALL check("h5_cleanup_f", error, total_error) END SUBROUTINE lifecycle + !/*------------------------------------------------------------------------- ! * Function: cklinks ! * @@ -1070,7 +1086,7 @@ SUBROUTINE lifecycle(cleanup, fapl2, total_error) ! * Programmer: M.S. Breitenfeld ! * April 14, 2008 ! * -! * Modifications: Modified Original C code +! * Modifications: Modified original C code ! * ! *------------------------------------------------------------------------- ! */ @@ -1118,10 +1134,10 @@ SUBROUTINE lifecycle(cleanup, fapl2, total_error) CALL H5Lexists_f(file,"d1",Lexists, error) - CALL verifylogical("test_lcpl.H5Lexists", Lexists,.TRUE.,total_error) + CALL verifylogical("H5Lexists", Lexists,.TRUE.,total_error) CALL H5Lexists_f(file,"grp1/hard",Lexists, error) - CALL verifylogical("test_lcpl.H5Lexists", Lexists,.TRUE.,total_error) + CALL verifylogical("H5Lexists", Lexists,.TRUE.,total_error) ! /* Cleanup */ CALL H5Fclose_f(file,error) @@ -1490,7 +1506,6 @@ SUBROUTINE link_info_by_idx_check(group_id, linkname, n, & ! *------------------------------------------------------------------------- ! */ - SUBROUTINE test_lcpl(cleanup, fapl, total_error) USE HDF5 ! This module contains all necessary modules @@ -1542,13 +1557,13 @@ SUBROUTINE link_info_by_idx_check(group_id, linkname, n, & ! h5_fixname(FILENAME[0], fapl, filename, sizeof filename); CALL H5Fcreate_f(filename, H5F_ACC_TRUNC_F, file_id, error, H5P_DEFAULT_F, fapl) - CALL check("test_lcpl.H5Fcreate_f", error, total_error) + CALL check("H5Fcreate_f", error, total_error) ! /* Create and link a group with the default LCPL */ CALL H5Gcreate_f(file_id, "/group", group_id, error) - CALL check("test_lcpl.H5Gcreate_f", error, total_error) + CALL check("H5Gcreate_f", error, total_error) ! /* Check that its character encoding is the default */ @@ -1561,49 +1576,54 @@ SUBROUTINE link_info_by_idx_check(group_id, linkname, n, & ! * creation property list and is always ASCII. */ !#define H5F_DEFAULT_CSET H5T_CSET_ASCII -- FROM H5Fprivate.h -- - CALL VERIFY("test_lcpl.H5Lget_info_f",cset, H5T_CSET_ASCII_F,total_error) + CALL VERIFY("H5Lget_info_f",cset, H5T_CSET_ASCII_F,total_error) ! /* Create and commit a datatype with the default LCPL */ CALL h5tcopy_f(H5T_NATIVE_INTEGER, type_id, error) - CALL check("test_lcpl.h5tcopy_f",error,total_error) + CALL check("h5tcopy_f",error,total_error) CALL h5tcommit_f(file_id, "/type", type_id, error) - CALL check("test_lcpl.h5tcommit_f", error, total_error) + CALL check("h5tcommit_f", error, total_error) CALL h5tclose_f(type_id, error) - CALL check("test_lcpl.h5tclose_f", error, total_error) + CALL check("h5tclose_f", error, total_error) ! /* Check that its character encoding is the default */ CALL H5Lget_info_f(file_id, "type", & cset, corder, f_corder_valid, link_type, address, val_size, & error) - CALL check("test_lcpl.h5tclose_f", error, total_error) + CALL check("h5tclose_f", error, total_error) !/* File-wide default character encoding can not yet be set via the file ! * creation property list and is always ASCII. */ !#define H5F_DEFAULT_CSET H5T_CSET_ASCII -- FROM H5Fprivate.h -- - CALL verify("test_lcpl.H5Lget_info_f",cset, H5T_CSET_ASCII_F,total_error) + CALL verify("H5Lget_info_f",cset, H5T_CSET_ASCII_F,total_error) !/* Create a dataspace */ CALL h5screate_simple_f(2, dims, space_id, error) - CALL check("test_lcpl.h5screate_simple_f",error,total_error) + CALL check("h5screate_simple_f",error,total_error) + CALL h5pcreate_f(H5P_DATASET_CREATE_F, crp_list, error) + CALL h5pset_chunk_f(crp_list, 2, dims, error) + CALL h5pcreate_f(H5P_DATASET_CREATE_F, crp_list, error) + CALL h5pset_chunk_f(crp_list, 2, dims, error) CALL h5pcreate_f(H5P_DATASET_CREATE_F, crp_list, error) CALL h5pset_chunk_f(crp_list, 2, dims, error) ! /* Create a dataset using the default LCPL */ CALL h5dcreate_f(file_id, "/dataset", H5T_NATIVE_INTEGER, space_id, dset_id, error, crp_list) - CALL check("test_lcpl.h5dcreate_f", error, total_error) + CALL check("h5dcreate_f", error, total_error) + CALL h5dclose_f(dset_id, error) - CALL check("test_lcpl.h5dclose_f", error, total_error) + CALL check("h5dclose_f", error, total_error) ! Reopen CALL H5Dopen_f(file_id, "/dataset", dset_id, error) - CALL check("test_lcpl.h5dopen_f", error, total_error) + CALL check("h5dopen_f", error, total_error) ! /* Extend the dataset */ CALL H5Dset_extent_f(dset_id, extend_dim, error) - CALL check("test_lcpl.H5Dset_extent_f", error, total_error) + CALL check("H5Dset_extent_f", error, total_error) ! /* Verify the dataspaces */ ! !Get dataset's dataspace handle. @@ -1612,7 +1632,7 @@ SUBROUTINE link_info_by_idx_check(group_id, linkname, n, & CALL check("h5dget_space_f",error,total_error) CALL h5sget_simple_extent_dims_f(data_space, dimsout, maxdimsout, error) - CALL check("test_lcpl.h5sget_simple_extent_dims_f",error, total_error) + CALL check("h5sget_simple_extent_dims_f",error, total_error) DO i = 1, 2 tmp1 = dimsout(i) @@ -1628,170 +1648,170 @@ SUBROUTINE link_info_by_idx_check(group_id, linkname, n, & ! /* close data set */ CALL h5dclose_f(dset_id, error) - CALL check("test_lcpl.h5dclose_f", error, total_error) + CALL check("h5dclose_f", error, total_error) ! /* Check that its character encoding is the default */ CALL H5Lget_info_f(file_id, "dataset", & cset, corder, f_corder_valid, link_type, address, val_size, & error) - CALL check("test_lcpl.H5Lget_info_f", error, total_error) + CALL check("H5Lget_info_f", error, total_error) !/* File-wide default character encoding can not yet be set via the file ! * creation property list and is always ASCII. */ !#define H5F_DEFAULT_CSET H5T_CSET_ASCII -- FROM H5Fprivate.h -- - CALL verify("test_lcpl.h5tclose_f",cset, H5T_CSET_ASCII_F,total_error) + CALL verify("h5tclose_f",cset, H5T_CSET_ASCII_F,total_error) !/* Create a link creation property list with the UTF-8 character encoding */ CALL H5Pcreate_f(H5P_LINK_CREATE_F,lcpl_id,error) - CALL check("test_lcpl.h5Pcreate_f",error,total_error) + CALL check("h5Pcreate_f",error,total_error) CALL H5Pset_char_encoding_f(lcpl_id, H5T_CSET_UTF8_F, error) - CALL check("test_lcpl.H5Pset_char_encoding_f",error, total_error) + CALL check("H5Pset_char_encoding_f",error, total_error) ! /* Create and link a group with the new LCPL */ CALL H5Gcreate_f(file_id, "/group2", group_id, error,lcpl_id=lcpl_id) - CALL check("test_lcpl.test_lcpl.H5Gcreate_f", error, total_error) + CALL check("H5Gcreate_f", error, total_error) CALL H5Gclose_f(group_id, error) - CALL check("test_lcpl.test_lcpl.H5Gclose_f", error, total_error) + CALL check("H5Gclose_f", error, total_error) !/* Check that its character encoding is UTF-8 */ CALL H5Lget_info_f(file_id, "group2", & cset, corder, f_corder_valid, link_type, address, val_size, & error) - CALL check("test_lcpl.H5Lget_info_f", error, total_error) - CALL verify("test_lcpl.H5Lget_info_f",cset, H5T_CSET_UTF8_F,total_error) + CALL check("H5Lget_info_f", error, total_error) + CALL verify("H5Lget_info_f",cset, H5T_CSET_UTF8_F,total_error) ! /* Create and commit a datatype with the new LCPL */ CALL h5tcopy_f(H5T_NATIVE_INTEGER, type_id, error) - CALL check("test_lcpl.h5tcopy_f",error,total_error) + CALL check("h5tcopy_f",error,total_error) CALL h5tcommit_f(file_id, "/type2", type_id, error, lcpl_id=lcpl_id) - CALL check("test_lcpl.h5tcommit_f", error, total_error) + CALL check("h5tcommit_f", error, total_error) CALL h5tclose_f(type_id, error) - CALL check("test_lcpl.h5tclose_f", error, total_error) + CALL check("h5tclose_f", error, total_error) !/* Check that its character encoding is UTF-8 */ CALL H5Lget_info_f(file_id, "type2", & cset, corder, f_corder_valid, link_type, address, val_size, & error) - CALL check("test_lcpl.H5Lget_info_f", error, total_error) - CALL verify("test_lcpl.H5Lget_info_f",cset, H5T_CSET_UTF8_F,total_error) + CALL check("H5Lget_info_f", error, total_error) + CALL verify("H5Lget_info_f",cset, H5T_CSET_UTF8_F,total_error) ! /* Create a dataset using the new LCPL */ CALL h5dcreate_f(file_id, "/dataset2", H5T_NATIVE_INTEGER, space_id, dset_id, error,lcpl_id=lcpl_id) - CALL check("test_lcpl.h5dcreate_f", error, total_error) + CALL check("h5dcreate_f", error, total_error) CALL h5dclose_f(dset_id, error) - CALL check("test_lcpl.h5dclose_f", error, total_error) + CALL check("h5dclose_f", error, total_error) CALL H5Pget_char_encoding_f(lcpl_id, encoding, error) - CALL check("test_lcpl.H5Pget_char_encoding_f", error, total_error) - CALL VERIFY("test_lcpl.H5Pget_char_encoding_f", encoding, H5T_CSET_UTF8_F, total_error) + CALL check("H5Pget_char_encoding_f", error, total_error) + CALL VERIFY("H5Pget_char_encoding_f", encoding, H5T_CSET_UTF8_F, total_error) ! /* Check that its character encoding is UTF-8 */ CALL H5Lget_info_f(file_id, "dataset2", & cset, corder, f_corder_valid, link_type, address, val_size, & error) - CALL check("test_lcpl.H5Lget_info_f", error, total_error) - CALL verify("test_lcpl.H5Lget_info_f2",cset, H5T_CSET_UTF8_F,total_error) + CALL check("H5Lget_info_f", error, total_error) + CALL verify("H5Lget_info_f2",cset, H5T_CSET_UTF8_F,total_error) ! /* Create a new link to the dataset with a different character encoding. */ CALL H5Pclose_f(lcpl_id, error) - CALL check("test_lcpl.H5Pclose_f", error, total_error) + CALL check("H5Pclose_f", error, total_error) CALL H5Pcreate_f(H5P_LINK_CREATE_F,lcpl_id,error) - CALL check("test_lcpl.h5Pcreate_f",error,total_error) + CALL check("h5Pcreate_f",error,total_error) CALL H5Pset_char_encoding_f(lcpl_id, H5T_CSET_ASCII_F, error) - CALL check("test_lcpl.H5Pset_char_encoding_f",error, total_error) + CALL check("H5Pset_char_encoding_f",error, total_error) CALL H5Lcreate_hard_f(file_id, "/dataset2", file_id, "/dataset2_link", error, lcpl_id) - CALL check("test_lcpl.H5Lcreate_hard_f",error, total_error) + CALL check("H5Lcreate_hard_f",error, total_error) CALL H5Lexists_f(file_id,"/dataset2_link",Lexists, error) - CALL check("test_lcpl.H5Lexists",error, total_error) - CALL verifylogical("test_lcpl.H5Lexists", Lexists,.TRUE.,total_error) + CALL check("H5Lexists",error, total_error) + CALL verifylogical("H5Lexists", Lexists,.TRUE.,total_error) ! /* Check that its character encoding is ASCII */ CALL H5Lget_info_f(file_id, "/dataset2_link", & cset, corder, f_corder_valid, link_type, address, val_size, & error) - CALL check("test_lcpl.H5Lget_info_f", error, total_error) - CALL verify("test_lcpl.H5Lget_info_f",cset, H5T_CSET_ASCII_F,total_error) + CALL check("H5Lget_info_f", error, total_error) + CALL verify("H5Lget_info_f",cset, H5T_CSET_ASCII_F,total_error) ! /* Check that the first link's encoding hasn't changed */ CALL H5Lget_info_f(file_id, "/dataset2", & cset, corder, f_corder_valid, link_type, address, val_size, & error) - CALL check("test_lcpl.H5Lget_info_f", error, total_error) - CALL verify("test_lcpl.H5Lget_info_f3",cset, H5T_CSET_UTF8_F,total_error) + CALL check("H5Lget_info_f", error, total_error) + CALL verify("H5Lget_info_f3",cset, H5T_CSET_UTF8_F,total_error) !/* Make sure that LCPLs work properly for other API calls: */ !/* H5Lcreate_soft */ CALL H5Pset_char_encoding_f(lcpl_id, H5T_CSET_UTF8_F, error) - CALL check("test_lcpl.H5Pset_char_encoding_f",error, total_error) + CALL check("H5Pset_char_encoding_f",error, total_error) CALL H5Lcreate_soft_f("dataset2", file_id, "slink_to_dset2",error,lcpl_id) CALL check("H5Lcreate_soft_f", error, total_error) CALL H5Lget_info_f(file_id, "slink_to_dset2", & cset, corder, f_corder_valid, link_type, address, val_size, & error) - CALL check("test_lcpl.H5Lget_info_f", error, total_error) - CALL verify("test_lcpl.H5Lget_info_f",cset, H5T_CSET_UTF8_F,total_error) + CALL check("H5Lget_info_f", error, total_error) + CALL verify("H5Lget_info_f",cset, H5T_CSET_UTF8_F,total_error) ! /* H5Lmove */ CALL H5Pset_char_encoding_f(lcpl_id, H5T_CSET_ASCII_F, error) - CALL check("test_lcpl.H5Pset_char_encoding_f",error, total_error) + CALL check("H5Pset_char_encoding_f",error, total_error) CALL H5Lmove_f(file_id, "slink_to_dset2", file_id, "moved_slink", error, lcpl_id, H5P_DEFAULT_F) - CALL check("test_lcpl.H5Lmove_f",error, total_error) + CALL check("H5Lmove_f",error, total_error) CALL H5Lget_info_f(file_id, "moved_slink", & cset, corder, f_corder_valid, link_type, address, val_size, & error) - CALL check("test_lcpl.H5Lget_info_f", error, total_error) - CALL verify("test_lcpl.H5Lget_info_f",cset, H5T_CSET_ASCII_F,total_error) + CALL check("H5Lget_info_f", error, total_error) + CALL verify("H5Lget_info_f",cset, H5T_CSET_ASCII_F,total_error) ! /* H5Lcopy */ CALL H5Pset_char_encoding_f(lcpl_id, H5T_CSET_UTF8_F, error) - CALL check("test_lcpl.H5Pset_char_encoding_f",error, total_error) + CALL check("H5Pset_char_encoding_f",error, total_error) CALL H5Lcopy_f(file_id, "moved_slink", file_id, "copied_slink", error, lcpl_id) CALL H5Lget_info_f(file_id, "copied_slink", & cset, corder, f_corder_valid, link_type, address, val_size, & error) - CALL check("test_lcpl.H5Lget_info_f", error, total_error) - CALL verify("test_lcpl.H5Lget_info_f",cset, H5T_CSET_UTF8_F,total_error) + CALL check("H5Lget_info_f", error, total_error) + CALL verify("H5Lget_info_f",cset, H5T_CSET_UTF8_F,total_error) ! /* H5Lcreate_external */ - CALL H5Lcreate_external_f("test_lcpl.filename", "path", file_id, "extlink", error, lcpl_id) - CALL check("test_lcpl.H5Lcreate_external_f", error, total_error) + CALL H5Lcreate_external_f("filename", "path", file_id, "extlink", error, lcpl_id) + CALL check("H5Lcreate_external_f", error, total_error) CALL H5Lget_info_f(file_id, "extlink", & cset, corder, f_corder_valid, link_type, address, val_size, & error) - CALL check("test_lcpl.H5Lget_info_f", error, total_error) - CALL verify("test_lcpl.H5Lget_info_f",cset, H5T_CSET_UTF8_F,total_error) + CALL check("H5Lget_info_f", error, total_error) + CALL verify("H5Lget_info_f",cset, H5T_CSET_UTF8_F,total_error) ! /* Close open IDs */ CALL H5Pclose_f(lcpl_id, error) - CALL check("test_lcpl.H5Pclose_f", error, total_error) + CALL check("H5Pclose_f", error, total_error) CALL H5Sclose_f(space_id, error) - CALL check("test_lcpl.h5Sclose_f",error,total_error) + CALL check("h5Sclose_f",error,total_error) CALL H5Fclose_f(file_id, error) - CALL check("test_lcpl.H5Fclose_f", error, total_error) + CALL check("H5Fclose_f", error, total_error) IF(cleanup) CALL h5_cleanup_f("tempfile", H5P_DEFAULT_F, error) CALL check("h5_cleanup_f", error, total_error) diff --git a/fortran/test/tH5I.f90 b/fortran/test/tH5I.f90 index 0d1a8c5..184edaf 100644 --- a/fortran/test/tH5I.f90 +++ b/fortran/test/tH5I.f90 @@ -1,3 +1,12 @@ +!****h* root/fortran/test/tH5I.f90 +! +! NAME +! tH5I.f90 +! +! FUNCTION +! Basic testing of Fortran H5I APIs. +! +! COPYRIGHT ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! Copyright by The HDF Group. * ! Copyright by the Board of Trustees of the University of Illinois. * @@ -13,6 +22,11 @@ ! access to either file, you may request a copy from help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! +! CONTAINS SUBROUTINES +! identifier_test +! +!***** + SUBROUTINE identifier_test(cleanup, total_error) ! This subroutine tests following functionalities: h5iget_type_f @@ -69,21 +83,21 @@ ! 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 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) - + 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 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) - + CALL check("H5Tclose_f", error, total_error) + ! ! Create a new file using default properties. ! diff --git a/fortran/test/tH5L_F03.f90 b/fortran/test/tH5L_F03.f90 new file mode 100644 index 0000000..f71f450 --- /dev/null +++ b/fortran/test/tH5L_F03.f90 @@ -0,0 +1,321 @@ +!****h* root/fortran/test/tH5L_F03.f90 +! +! NAME +! tH5L_F03.f90 +! +! FUNCTION +! Test FORTRAN HDF5 H5L APIs which are dependent on FORTRAN 2003 +! features. +! +! COPYRIGHT +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +! USES +! liter_cb_mod +! +! CONTAINS SUBROUTINES +! test_iter_group +! +!***** + +MODULE liter_cb_mod + + USE HDF5 + USE ISO_C_BINDING + IMPLICIT NONE + + TYPE iter_enum + INTEGER RET_ZERO + INTEGER RET_TWO + INTEGER RET_CHANGE + INTEGER RET_CHANGE2 + END TYPE iter_enum + + ! Custom group iteration callback data + TYPE, bind(c) :: iter_info + CHARACTER(LEN=1), DIMENSION(1:10) :: name ! The name of the object + INTEGER(c_int) :: TYPE ! The TYPE of the object + INTEGER(c_int) :: command ! The TYPE of RETURN value + END TYPE iter_info + +CONTAINS + +!*************************************************************** +!** +!** liter_cb(): Custom link iteration callback routine. +!** +!*************************************************************** + + INTEGER FUNCTION liter_cb(group, name, link_info, op_data) bind(C) + + USE HDF5 + USE ISO_C_BINDING + IMPLICIT NONE + + INTEGER(HID_T), VALUE :: group + CHARACTER(LEN=1), DIMENSION(1:10) :: name + + + TYPE (H5L_info_t) :: link_info + + TYPE(iter_info) :: op_data + + INTEGER, SAVE :: count + INTEGER, SAVE :: count2 + +!!$ +!!$ iter_info *info = (iter_info *)op_data; +!!$ static int count = 0; +!!$ static int count2 = 0; + + op_data%name(1:10) = name(1:10) + + SELECT CASE (op_data%command) + + CASE(0) + liter_cb = 0 + CASE(2) + liter_cb = 2 + CASE(3) + count = count + 1 + IF(count.GT.10) THEN + liter_cb = 1 + ELSE + liter_cb = 0 + ENDIF + CASE(4) + count2 = count2 + 1 + IF(count2.GT.10) THEN + liter_cb = 1 + ELSE + liter_cb = 0 + ENDIF + END SELECT + + END FUNCTION liter_cb +END MODULE liter_cb_mod + +! ***************************************** +! *** H 5 L T E S T S +! ***************************************** + + +!*************************************************************** +!** +!** test_iter_group(): Test group iteration functionality +!** +!*************************************************************** +SUBROUTINE test_iter_group(total_error) + + USE HDF5 + USE ISO_C_BINDING + USE liter_cb_mod + IMPLICIT NONE + + INTEGER, INTENT(INOUT) :: total_error + INTEGER(HID_T) :: fapl + INTEGER(HID_T) :: file ! File ID + INTEGER(hid_t) :: dataset ! Dataset ID + INTEGER(hid_t) :: datatype ! Common datatype ID + INTEGER(hid_t) :: filespace ! Common dataspace ID + INTEGER(hid_t) :: root_group,grp ! Root group ID + INTEGER i,j ! counting variable + INTEGER(hsize_t) idx ! Index in the group + CHARACTER(LEN=11) :: DATAFILE = "titerate.h5" + INTEGER, PARAMETER :: ndatasets = 50 + CHARACTER(LEN=10) :: name ! temporary name buffer + CHARACTER(LEN=10), DIMENSION(1:ndatasets+2) :: lnames ! Names of the links created +!!$ char dataset_name[NAMELEN]; dataset name + + TYPE(iter_info), TARGET :: info + +!!$ iter_info info; Custom iteration information +!!$ H5G_info_t ginfo; Buffer for querying object's info +!!$ herr_t ret; Generic return value + + INTEGER :: error + INTEGER :: ret_value + TYPE(C_PTR) :: f_ptr + TYPE(C_FUNPTR) :: f1 + TYPE(C_PTR) :: f2 + CHARACTER(LEN=2) :: ichr2 + CHARACTER(LEN=10) :: ichr10 + + ! Get the default FAPL + CALL H5Pcreate_f(H5P_FILE_ACCESS_F, fapl, error) + CALL check("h5pcreate_f", error, total_error) + + ! Set the "use the latest version of the format" bounds for creating objects in the file + CALL H5Pset_libver_bounds_f(fapl, H5F_LIBVER_LATEST_F, H5F_LIBVER_LATEST_F, error) + CALL check("H5Pset_libver_bounds_f",error, total_error) + + ! Create the test file with the datasets + CALL h5fcreate_f(DATAFILE, H5F_ACC_TRUNC_F, file, error, H5P_DEFAULT_F, fapl) + CALL check("h5fcreate_f", error, total_error) + + ! Test iterating over empty group + idx = 0 + info%command = 0 + f1 = C_FUNLOC(liter_cb) + f2 = C_LOC(info) + + + CALL H5Literate_f(file, H5_INDEX_NAME_F, H5_ITER_INC_F, idx, f1, f2, ret_value, error) + CALL check("H5Literate_f", error, total_error) + + CALL H5Tcopy_f(H5T_NATIVE_INTEGER, datatype, error) + CALL check("H5Tcopy_f", error, total_error) + + CALL H5Screate_f(H5S_SCALAR_F, filespace, error) + CALL check("H5Screate_f", error, total_error) + + DO i = 1, ndatasets + WRITE(ichr2, '(I2.2)') i + + name = 'Dataset '//ichr2 + + CALL h5dcreate_f(file, name, datatype, filespace, dataset, error) + CALL check("H5dcreate_f", error, total_error) + + lnames(i) = name + + CALL h5dclose_f(dataset,error) + CALL check("H5dclose_f", error, total_error) + + ENDDO + + ! Create a group and named datatype under root group for testing + + CALL H5Gcreate_f(file, "grp0000000", grp, error) + CALL check("H5Gcreate_f", error, total_error) + + lnames(ndatasets+2) = "grp0000000" + +!!$ +!!$ lnames[NDATASETS] = HDstrdup("grp"); +!!$ CHECK(lnames[NDATASETS], NULL, "strdup"); +!!$ + + CALL H5Tcommit_f(file, "dtype00000", datatype, error) + CALL check("H5Tcommit_f", error, total_error) + + lnames(ndatasets+1) = "dtype00000" + + ! Close everything up + + CALL H5Tclose_f(datatype, error) + CALL check("H5Tclose_f", error, total_error) + + CALL H5Gclose_f(grp, error) + CALL check("H5Gclose_f", error, total_error) + + CALL H5Sclose_f(filespace, error) + CALL check("H5Sclose_f", error, total_error) + + CALL H5Fclose_f(file, error) + CALL check("H5Fclose_f", error, total_error) + + ! Iterate through the datasets in the root group in various ways + CALL H5Fopen_f(DATAFILE, H5F_ACC_RDONLY_F, file, error, access_prp=fapl) + CALL check("h5fopen_f", error, total_error) + + ! Test all objects in group, when callback always returns 0 + info%command = 0 + idx = 0 + CALL H5Literate_f(file, H5_INDEX_NAME_F, H5_ITER_INC_F, idx, f1, f2, ret_value, error) + IF(ret_value.GT.0)THEN + PRINT*,"ERROR: Group iteration function didn't return zero correctly!" + CALL verify("H5Literate_f", error, -1, total_error) + ENDIF + + ! Test all objects in group, when callback always returns 1 + ! This also tests the "restarting" ability, because the index changes + + info%command = 2 + idx = 0 + i = 0 + f1 = C_FUNLOC(liter_cb) + f2 = C_LOC(info) + DO + CALL H5Literate_f(file, H5_INDEX_NAME_F, H5_ITER_INC_F, idx, f1, f2, ret_value, error) + IF(error.LT.0) EXIT + ! Verify return value from iterator gets propagated correctly + CALL VERIFY("H5Literate", ret_value, 2, total_error) + ! Increment the number of times "2" is returned + i = i + 1 + ! Verify that the index is the correct value + CALL VERIFY("H5Literate", INT(idx), INT(i), total_error) + IF(idx .GT.ndatasets+2)THEN + PRINT*,"ERROR: Group iteration function walked too far!" + ENDIF + + ! Verify the correct name is retrieved + DO j = 1, 10 + ichr10(j:j) = info%name(j)(1:1) + ENDDO + CALL verifystring("H5Literate_f", ichr10, lnames(INT(idx)), total_error) + IF(i.EQ.52)EXIT ! prints out error message otherwise (for gcc/gfortran/g95) not intel (why) -FIXME- scot + END DO + + ! put check if did not walk far enough -scot FIXME + + IF(i .NE. (NDATASETS + 2)) THEN + CALL VERIFY("H5Literate_f", i, INT(NDATASETS + 2), total_error) + PRINT*,"ERROR: Group iteration function didn't perform multiple iterations correctly" + ENDIF + + ! Test all objects in group, when callback changes return value + ! This also tests the "restarting" ability, because the index changes + + info%command = 3 + idx = 0 + i = 0 + + f1 = C_FUNLOC(liter_cb) + f2 = C_LOC(info) + DO + + CALL H5Literate_f(file, H5_INDEX_NAME_F, H5_ITER_INC_F, idx, f1, f2, ret_value, error) + IF(error.LT.0) EXIT + CALL VERIFY("H5Literate_f", ret_value, 1, total_error) + + ! Increment the number of times "1" is returned + i = i + 1 + + ! Verify that the index is the correct value + CALL VERIFY("H5Literate_f", INT(idx), INT(i+10), total_error) + + IF(idx .GT.ndatasets+2)THEN + PRINT*,"Group iteration function walked too far!" + ENDIF + + DO j = 1, 10 + ichr10(j:j) = info%name(j)(1:1) + ENDDO + ! Verify that the correct name is retrieved + CALL verifystring("H5Literate_f", ichr10, lnames(INT(idx)), total_error) + IF(i.EQ.42)EXIT ! prints out error message otherwise (for gcc/gfortran/g95) not intel (why) -FIX- scot + ENDDO + + IF(i .NE. 42 .OR. idx .NE. 52)THEN + PRINT*,"ERROR: Group iteration function didn't perform multiple iterations correctly!" + CALL check("H5Literate_f",-1,total_error) + ENDIF + + CALL H5Fclose_f(file, error) + CALL check("H5Fclose_f", error, total_error) + +END SUBROUTINE test_iter_group diff --git a/fortran/test/tH5O.f90 b/fortran/test/tH5O.f90 index 253a42a..d871e59 100644 --- a/fortran/test/tH5O.f90 +++ b/fortran/test/tH5O.f90 @@ -1,3 +1,12 @@ +!****h* root/fortran/test/tH5O.f90 +! +! NAME +! tH5O.f90 +! +! FUNCTION +! Basic testing of Fortran H5O APIs. +! +! COPYRIGHT ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! Copyright by The HDF Group. * ! Copyright by the Board of Trustees of the University of Illinois. * @@ -13,6 +22,11 @@ ! access to either file, you may request a copy from help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! +! CONTAINS SUBROUTINES +! test_h5o, test_h5o_link, test_h5o_plist +! +!***** + SUBROUTINE test_h5o(cleanup, total_error) USE HDF5 ! This module contains all necessary modules diff --git a/fortran/test/tH5P.f90 b/fortran/test/tH5P.f90 index 6a49f72..3faaac2 100644 --- a/fortran/test/tH5P.f90 +++ b/fortran/test/tH5P.f90 @@ -1,3 +1,12 @@ +!****h* root/fortran/test/tH5P.f90 +! +! NAME +! tH5P.f90 +! +! FUNCTION +! Basic testing of Fortran H5P APIs. +! +! COPYRIGHT ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! Copyright by The HDF Group. * ! Copyright by the Board of Trustees of the University of Illinois. * @@ -13,6 +22,11 @@ ! access to either file, you may request a copy from help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! +! CONTAINS SUBROUTINES +! external_test, multi_file_test +! +!***** + SUBROUTINE external_test(cleanup, total_error) ! This subroutine tests following functionalities: @@ -231,7 +245,8 @@ ! CALL h5pget_cache_f(fapl, mdc_nelmts, rdcc_nelmts, rdcc_nbytes, & rdcc_w0, error) - CALL check("h5pget_cache_f", error, total_error) + CALL check("h5pget_cache_f", error, total_error) + ! Set cache to some number ! @@ -239,7 +254,6 @@ CALL h5pset_cache_f(fapl, mdc_nelmts, rdcc_nelmts, rdcc_nbytes, & rdcc_w0, error) CALL check("h5pset_cache_f", error, total_error) - CALL h5fcreate_f(fix_filename, H5F_ACC_TRUNC_F, file_id, error, access_prp = fapl) CALL check("h5fcreate_f", error, total_error) if(error .ne. 0) then @@ -249,7 +263,6 @@ return endif - ! ! Create the dataspace. ! @@ -377,7 +390,7 @@ CALL check("h5pclose_f", error, total_error) IF(cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) CALL check("h5_cleanup_f", error, total_error) - + IF(cleanup) CALL h5_cleanup_f(filename//'.h5-b', H5P_DEFAULT_F, error) CALL check("h5_cleanup_f", error, total_error) IF(cleanup) CALL h5_cleanup_f(filename//'.h5-g', H5P_DEFAULT_F, error) @@ -390,7 +403,7 @@ CALL check("h5_cleanup_f", error, total_error) IF(cleanup) CALL h5_cleanup_f(filename//'.h5-s', H5P_DEFAULT_F, error) CALL check("h5_cleanup_f", error, total_error) - + RETURN END SUBROUTINE multi_file_test @@ -412,14 +425,14 @@ ! April 16, 2009 !------------------------------------------------------------------------- ! -SUBROUTINE test_chunk_cache(cleanup, total_error) - - USE HDF5 ! This module contains all necessary modules +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 */ @@ -457,7 +470,7 @@ SUBROUTINE test_chunk_cache(cleanup, 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) @@ -514,7 +527,7 @@ SUBROUTINE test_chunk_cache(cleanup, 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) @@ -526,7 +539,7 @@ SUBROUTINE test_chunk_cache(cleanup, total_error) 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 @@ -601,7 +614,7 @@ SUBROUTINE test_chunk_cache(cleanup, total_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) @@ -611,12 +624,12 @@ SUBROUTINE test_chunk_cache(cleanup, 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) @@ -654,11 +667,11 @@ SUBROUTINE test_chunk_cache(cleanup, total_error) 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 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) diff --git a/fortran/test/tH5P_F03.f90 b/fortran/test/tH5P_F03.f90 new file mode 100644 index 0000000..aec8a26 --- /dev/null +++ b/fortran/test/tH5P_F03.f90 @@ -0,0 +1,364 @@ +!****h* root/fortran/test/tH5P_F03.f90 +! +! NAME +! tH5P_F03.f90 +! +! FUNCTION +! Test FORTRAN HDF5 H5P APIs which are dependent on FORTRAN 2003 +! features. +! +! COPYRIGHT +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +! USES +! test_genprop_cls_cb1_mod +! +! CONTAINS SUBROUTINES +! test_create, test_genprop_class_callback +! +!***** + +! ***************************************** +! *** H 5 P T E S T S +! ***************************************** + +MODULE test_genprop_cls_cb1_mod + + ! Callback subroutine for test_genprop_class_callback + ! and the function H5Pcreate_class_f. + + USE HDF5 + USE ISO_C_BINDING + IMPLICIT NONE + + TYPE, bind(C) :: cop_cb_struct_ ! /* Struct for iterations */ + INTEGER :: count + INTEGER(HID_T) :: id + END TYPE cop_cb_struct_ + +CONTAINS + + INTEGER FUNCTION test_genprop_cls_cb1_f(list_id, create_data ) bind(C) + + USE HDF5 + USE ISO_C_BINDING + IMPLICIT NONE + + INTEGER(HID_T), INTENT(IN), VALUE :: list_id + + TYPE(cop_cb_struct_) :: create_data + + create_data%count = create_data%count + 1 + create_data%id = list_id + + test_genprop_cls_cb1_f = 0 + + END FUNCTION test_genprop_cls_cb1_f + +END MODULE test_genprop_cls_cb1_mod + +!/*------------------------------------------------------------------------- +! * Function: test_create +! * +! * Purpose: Tests H5Pset_fill_value_f and H5Pget_fill_value_f +! * +! * Return: Success: 0 +! * +! * Failure: number of errors +! * +! * Programmer: M. Scot Breitenfeld +! * June 24, 2008 +! * +! * Modifications: +! * +! *------------------------------------------------------------------------- +! */ + +SUBROUTINE test_create(total_error) + + USE HDF5 + USE ISO_C_BINDING + IMPLICIT NONE + + INTEGER, INTENT(INOUT) :: total_error + INTEGER(HID_T) :: fapl + + INTEGER(hid_t) :: file=-1, space=-1, dcpl=-1, comp_type_id=-1 + INTEGER(hid_t) :: dset1=-1, dset2=-1, dset3=-1, dset4=-1, dset5=-1, & + dset6=-1, dset7=-1, dset8=-1, dset9=-1 + INTEGER(hsize_t), DIMENSION(1:5), PARAMETER :: cur_size = (/2, 8, 8, 4, 2/) + INTEGER(hsize_t), DIMENSION(1:5), PARAMETER :: ch_size= (/1, 1, 1, 4, 1/) + CHARACTER(LEN=14) :: filename ='test_create.h5' + + ! /* compound datatype operations */ + TYPE, BIND(C) :: comp_datatype + REAL :: a + INTEGER :: x + DOUBLE PRECISION :: y + CHARACTER(LEN=1) :: z + END TYPE comp_datatype + + TYPE(comp_datatype), TARGET :: rd_c, fill_ctype + + INTEGER(SIZE_T) :: type_sizei ! Size of the integer datatype + INTEGER(SIZE_T) :: type_sizer ! Size of the real datatype + INTEGER(SIZE_T) :: type_sized ! Size of the double datatype + INTEGER(SIZE_T) :: type_sizec ! Size of the double datatype + INTEGER(SIZE_T) :: sizeof_compound ! total size of compound + INTEGER :: error + INTEGER(SIZE_T) :: h5off + TYPE(C_PTR) :: f_ptr + + !/* + ! * Create a file. + ! */ + CALL h5fcreate_f(filename,H5F_ACC_TRUNC_F,file,error) + CALL check("h5fcreate_f", error, total_error) + + CALL h5screate_simple_f(5, cur_size, space, error, cur_size) + CALL check("h5screate_simple_f", error, total_error) + + CALL H5Pcreate_f(H5P_DATASET_CREATE_F, dcpl, error) + CALL check("H5Pcreate_f", error, total_error) + + CALL h5pset_chunk_f(dcpl, 5, ch_size, error) + CALL check("h5pset_chunk_f",error, total_error) + + ! /* Create a compound datatype */ + + CALL h5tcreate_f(H5T_COMPOUND_F, INT(SIZEOF(fill_ctype),size_t), comp_type_id, error) + CALL check("h5tcreate_f", error, total_error) + h5off = H5OFFSETOF(C_LOC(fill_ctype), C_LOC(fill_ctype%a)) + CALL h5tinsert_f(comp_type_id, "a", h5off , H5T_NATIVE_REAL, error) + CALL check("h5tinsert_f", error, total_error) + CALL h5tinsert_f(comp_type_id, "x", H5OFFSETOF(C_LOC(fill_ctype), C_LOC(fill_ctype%x)), H5T_NATIVE_INTEGER, error) + CALL check("h5tinsert_f", error, total_error) + CALL h5tinsert_f(comp_type_id, "y", H5OFFSETOF(C_LOC(fill_ctype), C_LOC(fill_ctype%y)), H5T_NATIVE_DOUBLE, error) + CALL check("h5tinsert_f", error, total_error) + CALL h5tinsert_f(comp_type_id, "z", & + H5OFFSETOF(C_LOC(fill_ctype), C_LOC(fill_ctype%z)), H5T_NATIVE_CHARACTER, error) + CALL check("h5tinsert_f", error, total_error) + + + CALL H5Pset_alloc_time_f(dcpl, H5D_ALLOC_TIME_LATE_F,error) + CALL check("H5Pset_alloc_time_f",error, total_error) + + CALL H5Pset_fill_time_f(dcpl, H5D_FILL_TIME_ALLOC_F, error) + CALL check("H5Pset_fill_time_f",error, total_error) + + ! /* Compound datatype test */ + + f_ptr = C_LOC(fill_ctype) + + CALL H5Pget_fill_value_f(dcpl, comp_type_id, f_ptr, error) + CALL check("H5Pget_fill_value_f",error, total_error) + + fill_ctype%y = 4444. + fill_ctype%z = 'S' + fill_ctype%a = 5555. + fill_ctype%x = 55 + + f_ptr = C_LOC(fill_ctype) + + CALL H5Pset_fill_value_f(dcpl, comp_type_id, f_ptr, error) + CALL check("H5Pget_fill_value_f",error, total_error) + + CALL h5dcreate_f(file,"dset9", comp_type_id, space, dset9, error, dcpl_id=dcpl) + CALL check("h5dcreate_f", error, total_error) + + CALL h5dclose_f(dset9, error) + CALL check("h5dclose_f", error, total_error) + + CALL h5fclose_f(file,error) + CALL check("h5fclose_f", error, total_error) + + ! /* Open the file and get the dataset fill value from each dataset */ + CALL H5Pcreate_f(H5P_FILE_ACCESS_F, fapl, error) + CALL check("H5Pcreate_f",error, total_error) + + CALL H5Pset_libver_bounds_f(fapl, H5F_LIBVER_LATEST_F, H5F_LIBVER_LATEST_F, error) + CALL check("H5Pset_libver_bounds_f",error, total_error) + + CALL h5fopen_f (FILENAME, H5F_ACC_RDONLY_F, file, error, fapl) + CALL check("h5fopen_f", error, total_error) + + !/* Compound datatype test */ + CALL h5dopen_f(file, "dset9", dset9, error) + CALL check("h5dopen_f", error, total_error) + + CALL H5Dget_create_plist_f(dset9, dcpl, error) + CALL check("H5Dget_create_plist_f", error, total_error) + + f_ptr = C_LOC(rd_c) + + CALL H5Pget_fill_value_f(dcpl, comp_type_id, f_ptr, error) + CALL check("H5Pget_fill_value_f", error, total_error) + + IF( rd_c%a .NE. fill_ctype%a .OR. & + rd_c%y .NE. fill_ctype%y .OR. & + rd_c%x .NE. fill_ctype%x .OR. & + rd_c%z .NE. fill_ctype%z )THEN + + PRINT*,"***ERROR: Returned wrong fill value" + total_error = total_error + 1 + + ENDIF + + CALL h5dclose_f(dset9, error) + CALL check("h5dclose_f", error, total_error) + + CALL H5Pclose_f(dcpl, error) + CALL check("H5Pclose_f", error, total_error) + + CALL h5fclose_f(file,error) + CALL check("h5fclose_f", error, total_error) + +END SUBROUTINE test_create + + +SUBROUTINE test_genprop_class_callback(total_error) + + !/**************************************************************** + !** + !** test_genprop_class_callback(): Test basic generic property list code. + !** Tests callbacks for property lists in a generic class. + !** + !** FORTRAN TESTS: + !** Tests function H5Pcreate_class_f with callback. + !** + !****************************************************************/ + + USE HDF5 + USE ISO_C_BINDING + USE test_genprop_cls_cb1_mod + IMPLICIT NONE + + INTEGER, INTENT(INOUT) :: total_error + + INTEGER(hid_t) :: cid1 !/* Generic Property class ID */ + INTEGER(hid_t) :: lid1 !/* Generic Property list ID */ + INTEGER(hid_t) :: lid2 !/* 2nd Generic Property list ID */ + INTEGER(size_t) :: nprops !/* Number of properties in class */ + + TYPE cb_struct + INTEGER :: count + INTEGER(hid_t) :: id + END TYPE cb_struct + + TYPE(cb_struct), TARGET :: crt_cb_struct, cls_cb_struct + + CHARACTER(LEN=7) :: CLASS1_NAME = "Class 1" + TYPE(C_FUNPTR) :: f1, f3, f5 + TYPE(C_PTR) :: f2, f4, f6 + + CHARACTER(LEN=10) :: PROP1_NAME = "Property 1" + INTEGER(SIZE_T) :: PROP1_SIZE = 10 + CHARACTER(LEN=10) :: PROP2_NAME = "Property 2" + INTEGER(SIZE_T) :: PROP2_SIZE = 10 + CHARACTER(LEN=10) :: PROP3_NAME = "Property 3" + INTEGER(SIZE_T) :: PROP3_SIZE = 10 + CHARACTER(LEN=10) :: PROP4_NAME = "Property 4" + INTEGER(SIZE_T) :: PROP4_SIZE = 10 + INTEGER :: PROP1_DEF_VALUE = 10 + INTEGER :: PROP2_DEF_VALUE = 10 + INTEGER :: PROP3_DEF_VALUE = 10 + INTEGER :: PROP4_DEF_VALUE = 10 + + INTEGER :: error ! /* Generic RETURN value */ + + f1 = C_FUNLOC(test_genprop_cls_cb1_f) + f5 = C_FUNLOC(test_genprop_cls_cb1_f) + + f2 = C_LOC(crt_cb_struct) + f6 = C_LOC(cls_cb_struct) + + !/* Create a new generic class, derived from the root of the class hierarchy */ + CALL h5pcreate_class_f(h5p_ROOT_F,CLASS1_NAME, cid1, error, f1, f2, c_null_funptr, c_null_ptr, f5, f6) + CALL check("h5pcreate_class_f", error, total_error) + + !/* Insert first property into class (with no callbacks) */ + CALL h5pregister_f(cid1, PROP1_NAME, PROP1_SIZE, PROP1_DEF_VALUE, error) + CALL check("h5pregister_f", error, total_error) + !/* Insert second property into class (with no callbacks) */ + CALL h5pregister_f(cid1, PROP2_NAME, PROP2_SIZE, PROP2_DEF_VALUE, error) + CALL check("h5pregister_f", error, total_error) + !/* Insert third property into class (with no callbacks) */ + CALL h5pregister_f(cid1, PROP3_NAME, PROP3_SIZE, PROP3_DEF_VALUE, error) + CALL check("h5pregister_f", error, total_error) + + !/* Insert fourth property into class (with no callbacks) */ + CALL h5pregister_f(cid1, PROP4_NAME, PROP4_SIZE, PROP4_DEF_VALUE, error) + CALL check("h5pregister_f", error, total_error) + + ! /* Check the number of properties in class */ + CALL h5pget_nprops_f(cid1, nprops, error) + CALL check("h5pget_nprops_f", error, total_error) + CALL VERIFY("h5pget_nprops_f", INT(nprops), 4, total_error) + + ! /* Initialize class callback structs */ + + crt_cb_struct%count = 0 + crt_cb_struct%id = -1 + cls_cb_struct%count = 0 + cls_cb_struct%id = -1 + + !/* Create a property list from the class */ + CALL h5pcreate_f(cid1, lid1, error) + CALL check("h5pcreate_f", error, total_error) + + !/* Verify that the creation callback occurred */ + CALL VERIFY("h5pcreate_f", crt_cb_struct%count, 1, total_error) + CALL VERIFY("h5pcreate_f", INT(crt_cb_struct%id), INT(lid1), total_error) + + ! /* Check the number of properties in list */ + CALL h5pget_nprops_f(lid1,nprops, error) + CALL check("h5pget_nprops_f", error, total_error) + CALL VERIFY("h5pget_nprops_f", INT(nprops), 4, total_error) + + ! /* Create another property list from the class */ + CALL h5pcreate_f(cid1, lid2, error) + CALL check("h5pcreate_f", error, total_error) + + ! /* Verify that the creation callback occurred */ + CALL VERIFY("h5pcreate_f", crt_cb_struct%count, 2, total_error) + CALL VERIFY("h5pcreate_f", INT(crt_cb_struct%id), INT(lid2), total_error) + + ! /* Check the number of properties in list */ + CALL h5pget_nprops_f(lid2,nprops, error) + CALL check("h5pget_nprops_f", error, total_error) + CALL VERIFY("h5pget_nprops_f", INT(nprops), 4, total_error) + + ! /* Close first list */ + CALL h5pclose_f(lid1, error); + CALL check("h5pclose_f", error, total_error) + + !/* Verify that the close callback occurred */ + CALL VERIFY("h5pcreate_f", cls_cb_struct%count, 1, total_error) + CALL VERIFY("h5pcreate_f", INT(cls_cb_struct%id), INT(lid1), total_error) + + !/* Close second list */ + CALL h5pclose_f(lid2, error); + CALL check("h5pclose_f", error, total_error) + + !/* Verify that the close callback occurred */ + CALL VERIFY("h5pcreate_f", cls_cb_struct%count, 2, total_error) + CALL VERIFY("h5pcreate_f", INT(cls_cb_struct%id), INT(lid2), total_error) + + !/* Close class */ + CALL h5pclose_class_f(cid1, error) + CALL check("h5pclose_class_f", error, total_error) + +END SUBROUTINE test_genprop_class_callback diff --git a/fortran/test/tH5R.f90 b/fortran/test/tH5R.f90 index 0289465..ac105fc 100644 --- a/fortran/test/tH5R.f90 +++ b/fortran/test/tH5R.f90 @@ -1,3 +1,12 @@ +!****h* root/fortran/test/tH5R.f90 +! +! NAME +! tH5R.f90 +! +! FUNCTION +! Basic testing of Fortran H5R, Reference Interface, APIs. +! +! COPYRIGHT ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! Copyright by The HDF Group. * ! Copyright by the Board of Trustees of the University of Illinois. * @@ -13,12 +22,14 @@ ! access to either file, you may request a copy from help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! +! NOTES +! Tests h5rcreate_f, h5rdereference_f, h5rget_name_f +! and H5Rget_object_type functions ! +! CONTAINS SUBROUTINES +! refobjtest, refregtest ! -! Testing Reference Interface functionality. -! -! The following subroutine tests h5rcreate_f, h5rdereference_f, h5rget_name_f -! and H5Rget_object_type functions +!***** ! SUBROUTINE refobjtest(cleanup, total_error) USE HDF5 ! This module contains all necessary modules @@ -230,6 +241,8 @@ END SUBROUTINE refobjtest ! SUBROUTINE refregtest(cleanup, total_error) USE HDF5 ! This module contains all necessary modules +! use iso_c_binding ! NOTE: if this is uncommented, then need to move subroutine into another file. + IMPLICIT NONE LOGICAL, INTENT(IN) :: cleanup INTEGER, INTENT(OUT) :: total_error @@ -249,23 +262,30 @@ SUBROUTINE refregtest(cleanup, total_error) INTEGER(HID_T) :: dsetv_id ! Dataset identifier INTEGER(HID_T) :: dsetr_id ! Dataset identifier INTEGER :: error - TYPE(hdset_reg_ref_t_f) , DIMENSION(2) :: ref ! Buffers to store references - TYPE(hdset_reg_ref_t_f) , DIMENSION(2) :: ref_out ! - INTEGER(HSIZE_T), DIMENSION(2) :: ref_dim - INTEGER(HSIZE_T), DIMENSION(2) :: data_dims - INTEGER(HSIZE_T), DIMENSION(2) :: dims = (/2,9/) ! Datasets dimensions - INTEGER(HSIZE_T), DIMENSION(1) :: dimsr = (/2/) ! - INTEGER(HSIZE_T), DIMENSION(2) :: start - INTEGER(HSIZE_T), DIMENSION(2) :: count +! TYPE(hdset_reg_ref_t_f) , DIMENSION(1:2), TARGET :: ref + TYPE(hdset_reg_ref_t_f) , DIMENSION(1:2) :: ref + TYPE(hdset_reg_ref_t_f) , DIMENSION(1:2) :: ref_out + INTEGER(HSIZE_T), DIMENSION(2) :: ref_dim = (/0,0/) + INTEGER(HSIZE_T), DIMENSION(2) :: data_dims ! = (/0,0/) + INTEGER(HSIZE_T), DIMENSION(2) :: dims = (/2,9/) ! Datasets dimensions + INTEGER(HSIZE_T), DIMENSION(1) :: dimsr = (/2/) ! + INTEGER(HSIZE_T), DIMENSION(2) :: start ! = (/0,0/) + INTEGER(HSIZE_T), DIMENSION(2) :: count ! = (/0,0/) + INTEGER :: rankr = 1 INTEGER :: rank = 2 - INTEGER , DIMENSION(2,9) :: DATA +! INTEGER , DIMENSION(2,9), TARGET :: DATA + INTEGER , DIMENSION(2,9) :: DATA INTEGER , DIMENSION(2,9) :: data_out = 0 INTEGER(HSIZE_T) , DIMENSION(2,3) :: coord INTEGER(SIZE_T) ::num_points = 3 ! Number of selected points +! type(c_ptr) :: f_ptr coord = RESHAPE((/1,1,2,7,1,9/), (/2,3/)) ! Coordinates of selected points DATA = RESHAPE ((/1,1,1,2,2,2,3,3,3,4,4,4,5,5,5,6,6,6/), (/2,9/)) + ref_out(1)%ref = 0 + ref_out(2)%ref = 0 + ! ! Initialize FORTRAN predefined datatypes. ! @@ -305,11 +325,16 @@ SUBROUTINE refregtest(cleanup, total_error) CALL check("h5dcreate_f", error, total_error) data_dims(1) = 2 data_dims(2) = 9 + +! f_ptr = c_loc(data) +! CALL h5dwrite_f(dsetv_id, H5T_NATIVE_INTEGER, f_ptr, error) + CALL h5dwrite_f(dsetv_id, H5T_NATIVE_INTEGER, DATA, data_dims, error) CALL check("h5dwrite_f", error, total_error) CALL h5dclose_f(dsetv_id, error) CALL check("h5dclose_f", error, total_error) + ! ! Dataset with references ! @@ -326,8 +351,12 @@ SUBROUTINE refregtest(cleanup, total_error) CALL h5sselect_hyperslab_f(space_id, H5S_SELECT_SET_F, & start, count, error) CALL check("h5sselect_hyperslab_f", error, total_error) + ref(1)%ref(:) = 0 +! f_ptr = C_LOC(ref(1)) +! CALL h5rcreate_f(file_id, dsetnamev, 1, space_id, f_ptr, error) CALL h5rcreate_f(file_id, dsetnamev, space_id, ref(1), error) CALL check("h5rcreate_f", error, total_error) + ! ! Create a reference to elements selection. ! @@ -336,6 +365,7 @@ SUBROUTINE refregtest(cleanup, total_error) CALL h5sselect_elements_f(space_id, H5S_SELECT_SET_F, rank, num_points,& coord, error) CALL check("h5sselect_elements_f", error, total_error) + ref(2)%ref(:) = 0 CALL h5rcreate_f(file_id, dsetnamev, space_id, ref(2), error) CALL check("h5rcreate_f", error, total_error) ! @@ -355,6 +385,7 @@ SUBROUTINE refregtest(cleanup, total_error) CALL check("h5dclose_f", error, total_error) CALL h5fclose_f(file_id, error) CALL check("h5fclose_f", error, total_error) + ! ! Reopen the file to test selections. ! @@ -369,7 +400,6 @@ SUBROUTINE refregtest(cleanup, total_error) CALL h5dread_f(dsetr_id, H5T_STD_REF_DSETREG, ref_out, ref_dim, error) CALL check("h5dread_f", error, total_error) - ! Get name of the dataset the first region reference points to using H5Rget_name_f CALL H5Rget_name_f(dsetr_id, ref_out(1), buf, error, buf_size ) CALL check("H5Rget_name_f", error, total_error) @@ -390,7 +420,6 @@ SUBROUTINE refregtest(cleanup, total_error) CALL check("H5Rget_name_f", error, total_error) CALL VERIFY("H5Rget_name_f", INT(buf_size),7,total_error) CALL VerifyString("H5Rget_name_f", TRIM(buf_small), "/MAT", total_error) - ! ! Dereference the first reference. ! @@ -402,9 +431,7 @@ SUBROUTINE refregtest(cleanup, total_error) ! Get name of the dataset the second region reference points to using H5Rget_name_f CALL H5Rget_name_f(dsetr_id, ref_out(2), buf, error) ! no optional size CALL check("H5Rget_name_f", error, total_error) - CALL VerifyString("H5Rget_name_f", buf, "/MATRIX", total_error) - - + CALL VerifyString("H5Rget_name_f", TRIM(buf), "/MATRIX", total_error) ! ! Read selected data from the dataset. ! diff --git a/fortran/test/tH5S.f90 b/fortran/test/tH5S.f90 index b56d3a7..e3a44ad 100644 --- a/fortran/test/tH5S.f90 +++ b/fortran/test/tH5S.f90 @@ -1,3 +1,12 @@ +!****h* root/fortran/test/tH5S.f90 +! +! NAME +! tH5S.f90 +! +! FUNCTION +! Basic testing of Fortran H5S, Dataspace Interface, APIs. +! +! COPYRIGHT ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! Copyright by The HDF Group. * ! Copyright by the Board of Trustees of the University of Illinois. * @@ -13,17 +22,18 @@ ! access to either file, you may request a copy from help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! -! -! -! Testing Dataspace Interface functionality. -! -! -! The following subroutine tests the following functionalities: +! NOTES +! Tests the following functionalities: ! h5screate_f, h5scopy_f, h5screate_simple_f, h5sis_simple_f, ! h5sget_simple_extent_dims_f,h5sget_simple_extent_ndims_f ! h5sget_simple_extent_npoints_f, h5sget_simple_extent_type_f, ! h5sextent_copy_f, h5sset_extent_simple_f, h5sset_extent_none_f ! +! CONTAINS SUBROUTINES +! dataspace_basic_test +! +!***** + SUBROUTINE dataspace_basic_test(cleanup, total_error) USE HDF5 ! This module contains all necessary modules @@ -162,7 +172,7 @@ CALL check("h5sget_simple_extent_type_f", error, total_error) IF (classtype .NE. 1) write(*,*)"class type not H5S_SIMPLE_f" - ! + ! !set the copied space to none before extend the dimensions. ! CALL h5sset_extent_none_f(space2_id, error) diff --git a/fortran/test/tH5Sselect.f90 b/fortran/test/tH5Sselect.f90 index f7fd8af..1cbabe8 100644 --- a/fortran/test/tH5Sselect.f90 +++ b/fortran/test/tH5Sselect.f90 @@ -1,3 +1,12 @@ +!****h* root/fortran/test/tH5Sselect.f90 +! +! NAME +! tH5Sselect.f90 +! +! FUNCTION +! Basic testing of Fortran H5S, Selection-related Dataspace Interface, APIs. +! +! COPYRIGHT ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! Copyright by The HDF Group. * ! Copyright by the Board of Trustees of the University of Illinois. * @@ -13,18 +22,20 @@ ! access to either file, you may request a copy from help@hdfgroup.org. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! -! -! Testing Selection-related Dataspace Interface functionality. -! - -! -! The following subroutines tests the following functionalities: +! NOTES +! Tests the following functionalities: ! h5sget_select_npoints_f, h5sselect_elements_f, h5sselect_all_f, ! h5sselect_none_f, h5sselect_valid_f, h5sselect_hyperslab_f, ! h5sget_select_bounds_f, h5sget_select_elem_pointlist_f, ! h5sget_select_elem_npoints_f, h5sget_select_hyper_blocklist_f, -! h5sget_select_hyper_nblocks_f, h5sget_select_npoints_f +! h5sget_select_hyper_nblocks_f, h5sget_select_npoints_f +! +! CONTAINS SUBROUTINES +! test_select_hyperslab, test_select_element, test_basic_select, +! test_select_point, test_select_combine, test_select_bounds +! ! +!***** SUBROUTINE test_select_hyperslab(cleanup, total_error) @@ -1021,13 +1032,13 @@ !****************************************************************/ SUBROUTINE test_select_point(cleanup, total_error) - USE HDF5 ! This module contains all necessary modules - + USE HDF5 ! This module contains all necessary modules + IMPLICIT NONE LOGICAL, INTENT(IN) :: cleanup INTEGER, INTENT(OUT) :: total_error INTEGER(HID_T) :: xfer_plist - + INTEGER, PARAMETER :: SPACE1_DIM1=3 INTEGER, PARAMETER :: SPACE1_DIM2=15 INTEGER, PARAMETER :: SPACE1_DIM3=13 @@ -1035,11 +1046,11 @@ SUBROUTINE test_select_point(cleanup, total_error) INTEGER, PARAMETER :: SPACE2_DIM2=26 INTEGER, PARAMETER :: SPACE3_DIM1=15 INTEGER, PARAMETER :: SPACE3_DIM2=26 - + INTEGER, PARAMETER :: SPACE1_RANK=3 INTEGER, PARAMETER :: SPACE2_RANK=2 INTEGER, PARAMETER :: SPACE3_RANK=2 - + ! /* Element selection information */ INTEGER, PARAMETER :: POINT1_NPOINTS=10 INTEGER(hid_t) ::fid1 ! /* HDF5 File IDs */ @@ -1048,7 +1059,7 @@ SUBROUTINE test_select_point(cleanup, total_error) INTEGER(hsize_t), DIMENSION(1:3) :: dims1 = (/SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3/) INTEGER(hsize_t), DIMENSION(1:2) :: dims2 = (/SPACE2_DIM1, SPACE2_DIM2/) INTEGER(hsize_t), DIMENSION(1:2) :: dims3 = (/SPACE3_DIM1, SPACE3_DIM2/) - + INTEGER(hsize_t), DIMENSION(1:SPACE1_RANK,1:POINT1_NPOINTS) :: coord1 !/* Coordinates for point selection */ INTEGER(hsize_t), DIMENSION(1:SPACE1_RANK,1:POINT1_NPOINTS) :: temp_coord1 !/* Coordinates for point selection */ INTEGER(hsize_t), DIMENSION(1:SPACE2_RANK,1:POINT1_NPOINTS) :: coord2 !/* Coordinates for point selection */ @@ -1064,7 +1075,7 @@ SUBROUTINE test_select_point(cleanup, total_error) ! struct pnt_iter pi; /* Custom Pointer iterator struct */ INTEGER :: error !/* Generic return value */ CHARACTER(LEN=9) :: filename = 'h5s_hyper' - CHARACTER(LEN=80) :: fix_filename + CHARACTER(LEN=80) :: fix_filename CHARACTER(LEN=1), DIMENSION(1:SPACE2_DIM1,1:SPACE2_DIM2) :: wbuf, rbuf CALL h5_fixname_f(filename, fix_filename, H5P_DEFAULT_F, error) @@ -1090,11 +1101,11 @@ SUBROUTINE test_select_point(cleanup, total_error) !!$ for(i=0, tbuf=wbuf; i) diff --git a/fortran/testpar/Makefile.in b/fortran/testpar/Makefile.in index 5cd9d05..272fc45 100644 --- a/fortran/testpar/Makefile.in +++ b/fortran/testpar/Makefile.in @@ -177,6 +177,7 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ +FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ @@ -197,10 +198,12 @@ H5_LONE_COLON = @H5_LONE_COLON@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ +HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ +HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ diff --git a/hl/CMakeLists.txt b/hl/CMakeLists.txt index 0c0ad91..d1db6ca 100644 --- a/hl/CMakeLists.txt +++ b/hl/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8) +cmake_minimum_required (VERSION 2.8.6) PROJECT (HDF5_HL C CXX) #----------------------------------------------------------------------------- diff --git a/hl/Makefile.in b/hl/Makefile.in index 9c3005c..6f7b51c 100755 --- a/hl/Makefile.in +++ b/hl/Makefile.in @@ -182,6 +182,7 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ +FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ @@ -202,10 +203,12 @@ H5_LONE_COLON = @H5_LONE_COLON@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ +HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ +HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ diff --git a/hl/c++/CMakeLists.txt b/hl/c++/CMakeLists.txt index 15ae809..3601a91 100644 --- a/hl/c++/CMakeLists.txt +++ b/hl/c++/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8) +cmake_minimum_required (VERSION 2.8.6) PROJECT (HDF5_HL_CPP) #----------------------------------------------------------------------------- diff --git a/hl/c++/Makefile.in b/hl/c++/Makefile.in index 8631a43..a629463 100644 --- a/hl/c++/Makefile.in +++ b/hl/c++/Makefile.in @@ -178,6 +178,7 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ +FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ @@ -198,10 +199,12 @@ H5_LONE_COLON = @H5_LONE_COLON@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ +HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ +HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ diff --git a/hl/c++/examples/CMakeLists.txt b/hl/c++/examples/CMakeLists.txt index f396523..3034a78 100644 --- a/hl/c++/examples/CMakeLists.txt +++ b/hl/c++/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8) +cmake_minimum_required (VERSION 2.8.6) PROJECT (HDF5_HL_CPP_EXAMPLES) #----------------------------------------------------------------------------- @@ -18,6 +18,7 @@ TARGET_LINK_LIBRARIES ( ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ) +SET_TARGET_PROPERTIES (ptExampleFL PROPERTIES FOLDER examples/hl/cpp) ADD_EXECUTABLE (ptExampleVL ${HDF5_HL_CPP_EXAMPLES_SOURCE_DIR}/ptExampleVL.cpp) TARGET_NAMING (ptExampleVL ${LIB_TYPE}) @@ -27,6 +28,7 @@ TARGET_LINK_LIBRARIES ( ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ) +SET_TARGET_PROPERTIES (ptExampleVL PROPERTIES FOLDER examples/hl/cpp) IF (BUILD_TESTING) ADD_TEST (NAME cpp_hl_ex_ptExampleFL COMMAND $) diff --git a/hl/c++/examples/Makefile.in b/hl/c++/examples/Makefile.in index 49c6707..acb7c11 100644 --- a/hl/c++/examples/Makefile.in +++ b/hl/c++/examples/Makefile.in @@ -144,6 +144,7 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ +FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ @@ -164,10 +165,12 @@ H5_LONE_COLON = @H5_LONE_COLON@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ +HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ +HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ diff --git a/hl/c++/examples/run-hlc++-ex.sh.in b/hl/c++/examples/run-hlc++-ex.sh.in index b800981..7742f99 100755 --- a/hl/c++/examples/run-hlc++-ex.sh.in +++ b/hl/c++/examples/run-hlc++-ex.sh.in @@ -32,8 +32,8 @@ EXIT_SUCCESS=0 EXIT_FAILURE=1 # Where the tool is installed. -# Note: no '/' after DESTDIR. Explanation in commence.am -prefix="${prefix:-${DESTDIR}@prefix@}" +# default is relative path to installed location of the tools +prefix="${prefix:-../../../../}" AR="@AR@" RANLIB="@RANLIB@" H5TOOL="h5c++" # The tool name diff --git a/hl/c++/src/CMakeLists.txt b/hl/c++/src/CMakeLists.txt index 1e765e9..ad5454d 100644 --- a/hl/c++/src/CMakeLists.txt +++ b/hl/c++/src/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8) +cmake_minimum_required (VERSION 2.8.6) PROJECT (HDF5_HL_CPP_SRC) #----------------------------------------------------------------------------- @@ -18,6 +18,7 @@ TARGET_LINK_LIBRARIES ( ) SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_CPP_LIB_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_HL_CPP_LIB_TARGET} ${HDF5_HL_CPP_LIB_NAME} ${LIB_TYPE}) +SET_TARGET_PROPERTIES (${HDF5_HL_CPP_LIB_TARGET} PROPERTIES FOLDER libraries/hl) #----------------------------------------------------------------------------- # Add file(s) to CMake Install diff --git a/hl/c++/src/Makefile.in b/hl/c++/src/Makefile.in index aa15700..d9db5de 100644 --- a/hl/c++/src/Makefile.in +++ b/hl/c++/src/Makefile.in @@ -201,6 +201,7 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ +FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ @@ -221,10 +222,12 @@ H5_LONE_COLON = @H5_LONE_COLON@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ +HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ +HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ @@ -418,7 +421,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 = 71 +LT_VERS_REVISION = 101 LT_VERS_AGE = 0 # Include src directory diff --git a/hl/c++/test/CMakeLists.txt b/hl/c++/test/CMakeLists.txt index 7fc3418..7d29035 100644 --- a/hl/c++/test/CMakeLists.txt +++ b/hl/c++/test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8) +cmake_minimum_required (VERSION 2.8.6) PROJECT (HDF5_HL_CPP_TEST) #----------------------------------------------------------------------------- @@ -26,6 +26,7 @@ IF (BUILD_TESTING) ${HDF5_HL_LIB_TARGET} ${HDF5_HL_CPP_LIB_TARGET} ) + SET_TARGET_PROPERTIES (hl_ptableTest PROPERTIES FOLDER test/hl/cpp) ADD_TEST (NAME hl_ptableTest COMMAND $) ENDIF (BUILD_TESTING) diff --git a/hl/c++/test/Makefile.in b/hl/c++/test/Makefile.in index b542f85..4c84e4c 100644 --- a/hl/c++/test/Makefile.in +++ b/hl/c++/test/Makefile.in @@ -174,6 +174,7 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ +FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ @@ -194,10 +195,12 @@ H5_LONE_COLON = @H5_LONE_COLON@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ +HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ +HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ diff --git a/hl/c++/test/ptableTest.cpp b/hl/c++/test/ptableTest.cpp index 9c48f77..929058d 100644 --- a/hl/c++/test/ptableTest.cpp +++ b/hl/c++/test/ptableTest.cpp @@ -74,6 +74,7 @@ int main(void) return -1; } + int BasicTest() { herr_t err; @@ -182,9 +183,17 @@ int TestCompoundDatatype() goto out; PASSED(); + + H5Tclose(dtypeID); return 0; out: + + H5E_BEGIN_TRY { + H5Tclose(dtypeID); + } H5E_END_TRY; + + H5_FAILED(); return 1; } @@ -514,10 +523,19 @@ int SystemTest() if(ct1[1].b != ct2[2].g.b) goto out; + H5Tclose(dtypeID1); + H5Tclose(dtypeID2); + PASSED(); return 0; out: + + H5E_BEGIN_TRY { + H5Tclose(dtypeID1); + H5Tclose(dtypeID2); + } H5E_END_TRY; + H5_FAILED(); return 1; } diff --git a/hl/examples/CMakeLists.txt b/hl/examples/CMakeLists.txt index 28672b6..c95322c 100644 --- a/hl/examples/CMakeLists.txt +++ b/hl/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8) +cmake_minimum_required (VERSION 2.8.6) PROJECT (HDF5_HL_EXAMPLES ) SET (HDF5_TEST_FILES @@ -45,6 +45,7 @@ FOREACH (example ${examples}) ADD_EXECUTABLE (hl_ex_${example} ${HDF5_HL_EXAMPLES_SOURCE_DIR}/${example}.c) TARGET_NAMING (hl_ex_${example} ${LIB_TYPE}) TARGET_LINK_LIBRARIES (hl_ex_${example} ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET}) + SET_TARGET_PROPERTIES (hl_ex_${example} PROPERTIES FOLDER examples/hl) IF (BUILD_TESTING) ADD_TEST (NAME hl_ex_${example} COMMAND $) @@ -52,6 +53,10 @@ FOREACH (example ${examples}) ENDFOREACH (example ${examples}) IF (BUILD_TESTING) + SET_TESTS_PROPERTIES (hl_ex_ex_lite2 PROPERTIES DEPENDS hl_ex_ex_lite1) +ENDIF (BUILD_TESTING) + +IF (BUILD_TESTING) SET (HDF5_TEST_FILES image24pixel.txt image8.txt diff --git a/hl/examples/Makefile.am b/hl/examples/Makefile.am index d1f67bc..ae65a3b 100644 --- a/hl/examples/Makefile.am +++ b/hl/examples/Makefile.am @@ -91,8 +91,8 @@ ex_table10: $(srcdir)/ex_table10.c ex_table11: $(srcdir)/ex_table11.c ex_table12: $(srcdir)/ex_table12.c -if BUILD_SZIP_CONDITIONAL -export LD_LIBRARY_PATH=$(LL_PATH) +if BUILD_SHARED_SZIP_CONDITIONAL +LD_LIBRARY_PATH=$(LL_PATH) endif include $(top_srcdir)/config/examples.am diff --git a/hl/examples/Makefile.in b/hl/examples/Makefile.in index 7a3819a..e79583d 100644 --- a/hl/examples/Makefile.in +++ b/hl/examples/Makefile.in @@ -144,6 +144,7 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ +FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ @@ -164,10 +165,12 @@ H5_LONE_COLON = @H5_LONE_COLON@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ +HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ +HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ @@ -387,6 +390,7 @@ INSTALL_FILES = ex_lite1.c ex_lite2.c ex_lite3.c ptExampleFL.c ptExampleVL.c \ INSTALL_SCRIPT_FILES = run-hlc-ex.sh INSTALL_TOP_SCRIPT_FILES = run-hl-ex.sh +@BUILD_SHARED_SZIP_CONDITIONAL_TRUE@LD_LIBRARY_PATH = $(LL_PATH) # Assume that all tests in this directory are examples, and tell # conclude.am when to build them. @@ -651,8 +655,6 @@ ex_table10: $(srcdir)/ex_table10.c ex_table11: $(srcdir)/ex_table11.c ex_table12: $(srcdir)/ex_table12.c -@BUILD_SZIP_CONDITIONAL_TRUE@export LD_LIBRARY_PATH=$(LL_PATH) - # How to create EXAMPLEDIR if it doesn't already exist $(EXAMPLEDIR): -$(top_srcdir)/bin/mkdirs $@ diff --git a/hl/examples/run-hlc-ex.sh.in b/hl/examples/run-hlc-ex.sh.in index ae3fcdb..a82e591 100755 --- a/hl/examples/run-hlc-ex.sh.in +++ b/hl/examples/run-hlc-ex.sh.in @@ -32,8 +32,8 @@ EXIT_SUCCESS=0 EXIT_FAILURE=1 # Where the tool is installed. -# Note: no '/' after DESTDIR. Explanation in commence.am -prefix="${prefix:-${DESTDIR}@prefix@}" +# default is relative path to installed location of the tools +prefix="${prefix:-../../../../}" PARALLEL=@PARALLEL@ # Am I in parallel mode? AR="@AR@" RANLIB="@RANLIB@" diff --git a/hl/fortran/CMakeLists.txt b/hl/fortran/CMakeLists.txt index 1fd6de0..ae38588 100644 --- a/hl/fortran/CMakeLists.txt +++ b/hl/fortran/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8) +cmake_minimum_required (VERSION 2.8.6) PROJECT (HDF5_HL_F90 C CXX Fortran) #----------------------------------------------------------------------------- diff --git a/hl/fortran/Makefile.in b/hl/fortran/Makefile.in index 7068a20..19d6b62 100644 --- a/hl/fortran/Makefile.in +++ b/hl/fortran/Makefile.in @@ -182,6 +182,7 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ +FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ @@ -202,10 +203,12 @@ H5_LONE_COLON = @H5_LONE_COLON@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ +HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ +HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ diff --git a/hl/fortran/examples/CMakeLists.txt b/hl/fortran/examples/CMakeLists.txt index 50fa1ea..7098119 100644 --- a/hl/fortran/examples/CMakeLists.txt +++ b/hl/fortran/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8) +cmake_minimum_required (VERSION 2.8.6) PROJECT (HDF5_HL_F90_EXAMPLES C CXX Fortran) #----------------------------------------------------------------------------- @@ -12,6 +12,7 @@ INCLUDE_DIRECTORIES ( SET (examples exlite + ex_ds1 ) FOREACH (example ${examples}) @@ -24,6 +25,7 @@ FOREACH (example ${examples}) ${HDF5_LIB_TARGET} ) SET_TARGET_PROPERTIES (hl_f90_ex_${example} PROPERTIES LINKER_LANGUAGE Fortran) + SET_TARGET_PROPERTIES (hl_f90_ex_${example} PROPERTIES FOLDER examples/hl/fortran) IF (BUILD_TESTING) ADD_TEST (NAME hl_f90_ex_${example} COMMAND $) diff --git a/hl/fortran/examples/Makefile.am b/hl/fortran/examples/Makefile.am index 7c31fa7..4286fe3 100644 --- a/hl/fortran/examples/Makefile.am +++ b/hl/fortran/examples/Makefile.am @@ -31,10 +31,10 @@ endif # be run. # We don't tell automake about these programs so that it doesn't try to # compile them with the regular fortran compiler. -TEST_PROG=exlite +TEST_PROG=exlite ex_ds1 # List files to be installed here -INSTALL_FILES= exlite.f90 +INSTALL_FILES= exlite.f90 ex_ds1.f90 INSTALL_SCRIPT_FILES = run-hlfortran-ex.sh # Mark this directory as part of the Fortran API (this affects output diff --git a/hl/fortran/examples/Makefile.in b/hl/fortran/examples/Makefile.in index 64706bd..22744ae 100644 --- a/hl/fortran/examples/Makefile.in +++ b/hl/fortran/examples/Makefile.in @@ -145,6 +145,7 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ +FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ @@ -165,10 +166,12 @@ H5_LONE_COLON = @H5_LONE_COLON@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ +HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ +HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ @@ -367,10 +370,10 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.h5 # be run. # We don't tell automake about these programs so that it doesn't try to # compile them with the regular fortran compiler. -TEST_PROG = exlite +TEST_PROG = exlite ex_ds1 # List files to be installed here -INSTALL_FILES = exlite.f90 +INSTALL_FILES = exlite.f90 ex_ds1.f90 INSTALL_SCRIPT_FILES = run-hlfortran-ex.sh # Mark this directory as part of the Fortran API (this affects output diff --git a/hl/fortran/examples/ex_ds1.f90 b/hl/fortran/examples/ex_ds1.f90 new file mode 100644 index 0000000..377a641 --- /dev/null +++ b/hl/fortran/examples/ex_ds1.f90 @@ -0,0 +1,192 @@ +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! * 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +PROGRAM example_ds + + USE HDF5 + USE H5LT + USE H5DS + + IMPLICIT NONE + + INTEGER, PARAMETER :: RANK = 2 ! rank of DATA dataset + INTEGER, PARAMETER :: DIM_DATA = 12 + INTEGER, PARAMETER :: DIM1_SIZE = 3 + INTEGER, PARAMETER :: DIM2_SIZE = 4 + INTEGER, PARAMETER :: DIM1 = 1 + INTEGER, PARAMETER :: DIM2 = 2 + + CHARACTER(LEN=6), PARAMETER :: DSET_NAME = "MYDATA" + CHARACTER(LEN=5), PARAMETER :: DS_1_NAME = "Xaxis" + CHARACTER(LEN=5), PARAMETER :: DS_2_NAME = "Yaxis" + + + INTEGER(hid_t) :: fid ! file ID + INTEGER(hid_t) :: did ! dataset ID + INTEGER(hid_t) :: dsid ! DS dataset ID + INTEGER :: rankds = 1 ! rank of DS dataset + INTEGER(hsize_t), DIMENSION(1:rank) :: dims = (/DIM2_SIZE,DIM1_SIZE/) ! size of data dataset + INTEGER, DIMENSION(1:DIM_DATA) :: buf = (/1,2,3,4,5,6,7,8,9,10,11,12/) ! data of data dataset + INTEGER(hsize_t), DIMENSION(1:1) :: s1_dim = (/DIM1_SIZE/) ! size of DS 1 dataset + INTEGER(hsize_t), DIMENSION(1:1) :: s2_dim = (/DIM2_SIZE/) ! size of DS 2 dataset + REAL, DIMENSION(1:DIM1_SIZE) :: s1_wbuf = (/10,20,30/) ! data of DS 1 dataset + REAL, DIMENSION(1:DIM2_SIZE) :: s2_wbuf = (/10,20,50,100/) ! data of DS 2 dataset + INTEGER :: err + INTEGER :: num_scales + INTEGER(size_t) :: name_len + CHARACTER(LEN=80) :: name + INTEGER(size_t) :: label_len + CHARACTER(LEN=80) :: label + LOGICAL :: is_attached, is_scale + + ! + ! Initialize FORTRAN predefined datatypes. + ! + CALL h5open_f(err) + + ! create a file using default properties + CALL H5Fcreate_f("ex_ds1.h5",H5F_ACC_TRUNC_F, fid, err) + + ! make a dataset + CALL H5LTmake_dataset_int_f(fid, DSET_NAME, rank,dims,buf, err) + + ! make a DS dataset for the first dimension + CALL H5LTmake_dataset_float_f(fid,DS_1_NAME,rankds,s1_dim,s1_wbuf,err) + + ! make a DS dataset for the second dimension + CALL H5LTmake_dataset_float_f(fid,DS_2_NAME,rankds,s2_dim,s2_wbuf,err) + + !------------------------------------------------------------------------- + ! attach the DS_1_NAME dimension scale to DSET_NAME at dimension 1 + ! and then detach it. + !------------------------------------------------------------------------- + + ! get the dataset id for DSET_NAME + CALL H5Dopen_f(fid, DSET_NAME, did, err) + + ! get the DS dataset id + CALL H5Dopen_f(fid, DS_1_NAME, dsid, err) + + WRITE(*,'(/,5A,I0)') & + "Attach Dimension Scale """,TRIM(DS_1_NAME),'" to "', TRIM(DSET_NAME), '" at dimension ', DIM1 + + ! attach the DS_1_NAME dimension scale to DSET_NAME at dimension index 1 + CALL H5DSattach_scale_f(did, dsid, DIM1, err) + + ! Test if dimension Scale Attached + CALL H5DSis_attached_f(did, dsid, DIM1, is_attached, err) + WRITE(*,'(/,5X 3(A,1X),I0,A,L1)') 'Is',TRIM(DS_1_NAME),& + 'attached to dimension',DIM1,' ... ',is_attached + + + ! Check to see how many Dimension Scales are attached + + CALL H5DSget_num_scales_f(did, DIM1, num_scales, err) + + WRITE(*,'(5X,A,I0)') 'Total number of Dimension Scales Attached ... ', num_scales + + ! Detach scale + CALL H5DSdetach_scale_f(did, dsid, DIM1, err) + WRITE(*,'(/,5A,I0)') & + "Detach Dimension Scale """,TRIM(DS_1_NAME),'" from "', TRIM(DSET_NAME), '" at dimension ', DIM1 + + ! Check to see if a dimension scale is attached, should be .false. + CALL H5DSis_attached_f(did, dsid, DIM1, is_attached, err) + WRITE(*,'(/,5X,3(A,1X),I0,A,L1)') 'Is',TRIM(DS_1_NAME),& + 'attached to dimension',DIM1,' ... ',is_attached + + !------------------------------------------------------------------------- + ! set the DS_1_NAME dimension scale to DSET_NAME at dimension 1 + !------------------------------------------------------------------------- + + WRITE(*,'(/,5A,I0)') & + 'Set Dimension Scale "', TRIM(DS_1_NAME), '" to "', TRIM(DSET_NAME), '" at dimension ', DIM1 + + CALL H5DSset_scale_f(dsid, err, "Set X") + + ! Test if Dimension Scale + + CALL H5DSis_scale_f(dsid, is_scale, err) + + ! Get scale name + + name_len = 25 + name = '' + CALL H5DSget_scale_name_f(dsid, name, name_len, err) + + WRITE(*,'(/,5X,A,A)') 'The Dimension Scale name is ... ', name(1:name_len) + + ! Setting Dimension Scale Label + + WRITE(*,'(/,A,I0)') "Setting Dimension Scale label ""X"" for dimension ", DIM1 + + CALL H5DSset_label_f(did, DIM1, "X", err) + + label_len = 25 + label = '' + CALL H5DSget_label_f(did, DIM1, label, label_len, err) + + WRITE(*,'(/,5X,A,I0,2A)') 'Dimension Scale Label for dimension ', DIM1, ' is ... ', label(1:label_len) + + ! close DS id + CALL H5Dclose_f(dsid, err) + + !------------------------------------------------------------------------- + ! attach the DS_2_NAME dimension scale to DSET_NAME + !------------------------------------------------------------------------- + + ! get the DS dataset id + CALL H5Dopen_f(fid, DS_2_NAME, dsid, err) + + ! attach the DS_2_NAME dimension scale to DSET_NAME as the 2nd dimension (index 2) + + WRITE(*,'(/,5A,I0)') & + 'Set Dimension Scale "', TRIM(DS_2_NAME), '" to "', TRIM(DSET_NAME), '" at dimension ', DIM2 + + CALL H5DSattach_scale_f(did, dsid, DIM2, err) + + CALL H5DSis_attached_f(did, dsid, DIM2, is_attached, err) + + CALL H5DSset_scale_f(dsid, err, "Set Y") + + ! Get scale name + name_len = 25 + name = '' + CALL H5DSget_scale_name_f(dsid, name(1:name_len), name_len, err) + + WRITE(*,'(/,5X,A,A)') 'The Dimension Scale name is ... ', name(1:name_len) + + + ! Setting Dimension Scale Label + + WRITE(*,'(/,A,I0)') "Setting Dimension Scale label ""Y"" for dimension ", DIM2 + + CALL H5DSset_label_f(did, DIM2, "Y", err) + + ! Get Label + + label_len = 25 + label = '' + CALL H5DSget_label_f(did, DIM2, label, label_len, err) + + WRITE(*,'(/,5X,A,I0,2A,/)') 'Dimension Scale Label for dimension ', DIM2, ' is ... ', label(1:label_len) + + ! close DS id + CALL H5Dclose_f(dsid, err) + + ! close file + CALL H5Fclose_f(fid, err) + +END PROGRAM example_ds + diff --git a/hl/fortran/examples/run-hlfortran-ex.sh.in b/hl/fortran/examples/run-hlfortran-ex.sh.in index 919771d..2780bff 100755 --- a/hl/fortran/examples/run-hlfortran-ex.sh.in +++ b/hl/fortran/examples/run-hlfortran-ex.sh.in @@ -33,8 +33,8 @@ EXIT_SUCCESS=0 EXIT_FAILURE=1 # Where the tool is installed. -# Note: no '/' after DESTDIR. Explanation in commence.am -prefix="${prefix:-${DESTDIR}@prefix@}" +# default is relative path to installed location of the tools +prefix="${prefix:-../../../../}" PARALLEL=@PARALLEL@ # Am I in parallel mode? AR="@AR@" RANLIB="@RANLIB@" diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt index e55fcd4..916e9e1 100644 --- a/hl/fortran/src/CMakeLists.txt +++ b/hl/fortran/src/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8) +cmake_minimum_required (VERSION 2.8.6) PROJECT(HDF5_HL_F90_SRC C CXX Fortran) #----------------------------------------------------------------------------- @@ -15,6 +15,7 @@ INCLUDE_DIRECTORIES ( # hl_f90CStub lib #----------------------------------------------------------------------------- SET (HDF5_HL_F90_C_SRCS + ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5DSfc.c ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5LTfc.c ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5IMfc.c ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5IMcc.c @@ -29,11 +30,13 @@ ADD_LIBRARY (${HDF5_HL_F90_C_LIB_TARGET} ${LIB_TYPE} ${HDF5_HL_F90_C_SRCS} ${HDF TARGET_LINK_LIBRARIES (${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_F90_C_LIB_TARGET} ${HDF5_HL_LIB_TARGET}) SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_F90_C_LIB_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_HL_F90_C_LIB_NAME} ${LIB_TYPE}) +SET_TARGET_PROPERTIES (${HDF5_HL_F90_C_LIB_TARGET} PROPERTIES FOLDER libraries/hl/fortran) #----------------------------------------------------------------------------- # Fortran Modules #----------------------------------------------------------------------------- SET (HDF5_HL_F90_F_SRCS + ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5DSff.f90 ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5TBff.f90 ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5LTff.f90 ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5IMff.f90 @@ -44,9 +47,9 @@ SET (SHARED_LINK_FLAGS " ") IF (BUILD_SHARED_LIBS) IF (WIN32 AND NOT CYGWIN) SET_PROPERTY (TARGET ${HDF5_HL_F90_LIB_TARGET} - APPEND PROPERTY COMPILE_DEFINITIONS - BUILD_HDF5_DLL - ) + APPEND PROPERTY COMPILE_DEFINITIONS + BUILD_HDF5_DLL + ) IF (MSVC) SET (SHARED_LINK_FLAGS "/DLL") ENDIF (MSVC) @@ -55,7 +58,7 @@ ENDIF (BUILD_SHARED_LIBS) IF (WIN32 AND NOT CYGWIN) SET_PROPERTY (TARGET ${HDF5_HL_F90_LIB_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS - HDF5F90_WINDOWS + HDF5F90_WINDOWS ) ENDIF (WIN32 AND NOT CYGWIN) TARGET_FORTRAN_WIN_PROPERTIES (${HDF5_HL_F90_LIB_TARGET} ${SHARED_LINK_FLAGS}) @@ -63,18 +66,30 @@ SET_TARGET_PROPERTIES (${HDF5_HL_F90_LIB_TARGET} PROPERTIES LINKER_LANGUAGE Fort TARGET_LINK_LIBRARIES (${HDF5_HL_F90_LIB_TARGET} ${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_F90_LIB_TARGET}) SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_F90_LIB_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_HL_F90_LIB_TARGET} ${HDF5_HL_F90_LIB_NAME} ${LIB_TYPE}) +SET_TARGET_PROPERTIES (${HDF5_HL_F90_LIB_TARGET} PROPERTIES FOLDER libraries/hl/fortran) #----------------------------------------------------------------------------- # Add file(s) to CMake Install #----------------------------------------------------------------------------- -INSTALL ( - DIRECTORY - ${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/ - DESTINATION - ${HDF5_INSTALL_INCLUDE_DIR}/fortran - COMPONENT - fortheaders -) +IF (WIN32 AND NOT CYGWIN) + INSTALL ( + DIRECTORY + ${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/ + DESTINATION + ${HDF5_INSTALL_INCLUDE_DIR}/fortran + COMPONENT + fortheaders + ) +ELSE (WIN32 AND NOT CYGWIN) + INSTALL ( + DIRECTORY + ${CMAKE_Fortran_MODULE_DIRECTORY}/ + DESTINATION + ${HDF5_INSTALL_INCLUDE_DIR}/fortran + COMPONENT + fortheaders + ) +ENDIF (WIN32 AND NOT CYGWIN) #----------------------------------------------------------------------------- # Add Target(s) to CMake Install for import into other projects diff --git a/hl/fortran/src/H5DSfc.c b/hl/fortran/src/H5DSfc.c new file mode 100755 index 0000000..6816347 --- /dev/null +++ b/hl/fortran/src/H5DSfc.c @@ -0,0 +1,377 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +* Copyright by The HDF Group. * +* Copyright by the Board of Trustees of the University of Illinois. * +* All rights reserved. * +* * +* This file is part of HDF5. The full HDF5 copyright notice, including * +* terms governing use, modification, and redistribution, is contained in * +* the files COPYING and Copyright.html. COPYING can be found at the root * +* of the source code distribution tree; Copyright.html can be found at the * +* root level of an installed copy of the electronic HDF5 document set and * +* is linked from the top-level documents page. It can also be found at * +* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * +* access to either file, you may request a copy from help@hdfgroup.org. * +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* This files contains C stubs for H5D Fortran APIs */ + +#include "H5DSprivate.h" +#include "H5LTf90proto.h" +#include "H5Eprivate.h" + +/*------------------------------------------------------------------------- +* Function: h5dsset_scale_c +* +* Purpose: Calls H5DSset_scale +* +* Return: Success: 0, Failure: -1 +* +* Programmer: M. Scot Breitenfeld +* +* Date: April 17, 2011 +* +* Comments: +* +*------------------------------------------------------------------------- +*/ +int_f +nh5dsset_scale_c(hid_t_f *dsid, _fcd dimname, int_f *dimnamelen) +{ + char *c_dimname = NULL; + int_f ret_value = 0; + + /* + * convert FORTRAN name to C name + */ + + if(*dimnamelen != 0) + if(NULL == (c_dimname = (char *)HD5f2cstring(dimname, (size_t)*dimnamelen))) + HGOTO_DONE(FAIL) + + /* + * call H5DSset_scale function. + */ + + if(H5DSset_scale( (hid_t)*dsid, c_dimname) < 0) + HGOTO_DONE(FAIL) + + done: + if(c_dimname) + HDfree(c_dimname); + + return ret_value; + +} /* end nh5dsset_scale_c() */ + + +/*------------------------------------------------------------------------- +* Function: H5DSattach_scale_c +* +* Purpose: Calls H5DSattach_scale +* +* Return: Success: 0, Failure: -1 +* +* Programmer: M. Scot Breitenfeld +* +* Date: April 17, 2011 +* +* Comments: +* +*------------------------------------------------------------------------- +*/ +int_f +nh5dsattach_scale_c( hid_t_f *did, hid_t_f *dsid, int_f *idx) +{ + int_f ret_value = 0; + + /* + * call H5DSset_scale function. + */ + + if(H5DSattach_scale( (hid_t)*did, (hid_t)*dsid, (unsigned)*idx ) < 0) + HGOTO_DONE(FAIL) + + done: + return ret_value; + +} /* end nh5dsattach_scale_c() */ + + +/*------------------------------------------------------------------------- +* Function: H5DSdetach_scale_c +* +* Purpose: Calls H5DSdetach_scale +* +* Return: Success: 0, Failure: -1 +* +* Programmer: M. Scot Breitenfeld +* +* Date: April 17, 2011 +* +* Comments: +* +*------------------------------------------------------------------------- +*/ +int_f +nh5dsdetach_scale_c( hid_t_f *did, hid_t_f *dsid, int_f *idx) +{ + int_f ret_value = 0; + + /* + * call H5DSset_scale function. + */ + + if(H5DSdetach_scale( (hid_t)*did, (hid_t)*dsid, (unsigned)*idx ) < 0) + HGOTO_DONE(FAIL) + + done: + return ret_value; + +} /* end nh5dsdetach_scale_c() */ + + +/*------------------------------------------------------------------------- +* Function: H5DSis_attached_c +* +* Purpose: Calls H5DSis_attached +* +* Return: Success: 0, Failure: -1 +* +* Programmer: M. Scot Breitenfeld +* +* Date: April 17, 2011 +* +* Comments: +* +*------------------------------------------------------------------------- +*/ +int_f +nh5dsis_attached_c( hid_t_f *did, hid_t_f *dsid, int_f *idx, int_f *is_attached) +{ + int_f ret_value = 0; + htri_t c_is_attached; + + /* + * call H5DSis_attached function. + */ + + if((c_is_attached = H5DSis_attached( (hid_t)*did, (hid_t)*dsid, (unsigned)*idx )) < 0) + HGOTO_DONE(FAIL) + + *is_attached = (int_f)c_is_attached; + + done: + return ret_value; + +} /* end nh5dsis_attached_c() */ + +/*------------------------------------------------------------------------- +* Function: H5DSis_scale_c +* +* Purpose: Calls H5DSis_scale +* +* Return: Success: 0, Failure: -1 +* +* Programmer: M. Scot Breitenfeld +* +* Date: April 18, 2011 +* +* Comments: +* +*------------------------------------------------------------------------- +*/ +int_f +nh5dsis_scale_c( hid_t_f *did, int_f *is_scale) +{ + int_f ret_value = 0; + htri_t c_is_scale; + + /* + * call H5DSis_scale function. + */ + + if((c_is_scale=H5DSis_scale( (hid_t)*did )) < 0) + HGOTO_DONE(FAIL) + + *is_scale = (int_f)c_is_scale; + + done: + return ret_value; + +} /* end nh5dsis_scale_c() */ + + +/*------------------------------------------------------------------------- +* Function: h5dsset_label_c +* +* Purpose: Calls H5DSset_label +* +* Return: Success: 0, Failure: -1 +* +* Programmer: M. Scot Breitenfeld +* +* Date: April 18, 2011 +* +* Comments: +* +*------------------------------------------------------------------------- +*/ +int_f +nh5dsset_label_c(hid_t_f *did, int_f *idx, _fcd label, int_f *labellen) +{ + char *c_label = NULL; + int_f ret_value = 0; + + /* + * convert FORTRAN name to C name + */ + + if(NULL == (c_label = (char *)HD5f2cstring(label, (size_t)*labellen))) + HGOTO_DONE(FAIL) + + /* + * call H5DSset_label function. + */ + + if(H5DSset_label( (hid_t)*did, (unsigned)*idx, c_label) < 0) + HGOTO_DONE(FAIL) + + done: + if(c_label) + HDfree(c_label); + + return ret_value; + +} /* end nh5dsset_label_c() */ + +/*------------------------------------------------------------------------- +* Function: h5dsget_label_c +* +* Purpose: Calls H5DSget_label +* +* Return: Success: 0, Failure: -1 +* +* Programmer: M. Scot Breitenfeld +* +* Date: April 18, 2011 +* +* Comments: +* +*------------------------------------------------------------------------- +*/ +int_f +nh5dsget_label_c(hid_t_f *did, int_f *idx, _fcd label, size_t_f *size) +{ + char *c_label = NULL; + ssize_t size_c = -1; + int_f ret_value = 0; + + /* + * Allocate buffer to hold label + */ + if ((c_label = HDmalloc((size_t)*size + 1)) == NULL) + HGOTO_DONE(FAIL); + + /* + * call H5DSget_label function. + */ + + if( (size_c = (size_t_f)H5DSget_label( (hid_t)*did, (unsigned)*idx, c_label, (size_t)*size+1)) < 0) + HGOTO_DONE(FAIL) + + /* + * Convert C name to FORTRAN and place it in the given buffer + */ + + HD5packFstring(c_label, _fcdtocp(label), (size_t)*size+1); + +done: + *size = (size_t_f)size_c; /* Don't subtract '1' because H5DSget_label doesn't include the + * trailing NULL in the length calculation, Ref. HDFFV-7596 */ + if(c_label) HDfree(c_label); + return ret_value; + +} /* end nh5dsget_label_c() */ + +/*------------------------------------------------------------------------- +* Function: h5dsget_scale_name_c +* +* Purpose: Calls H5DSget_scale_name +* +* Return: Success: 0, Failure: -1 +* +* Programmer: M. Scot Breitenfeld +* +* Date: April 18, 2011 +* +* Comments: +* +*------------------------------------------------------------------------- +*/ +int_f +nh5dsget_scale_name_c(hid_t_f *did, _fcd name, size_t_f *size) +{ + char *c_scale_name = NULL; + ssize_t size_c = -1; + int_f ret_value = 0; + + /* + * Allocate buffer to hold name + */ + if ((c_scale_name = HDmalloc((size_t)*size + 1)) == NULL) + HGOTO_DONE(FAIL); + + /* + * call H5DSget_scale_name function. + */ + + if( (size_c = (size_t_f)H5DSget_scale_name( (hid_t)*did, c_scale_name, (size_t)*size+1)) < 0) + HGOTO_DONE(FAIL) + + /* + * Convert C name to FORTRAN and place it in the given buffer + */ + if(size_c != 0) { + HD5packFstring(c_scale_name, _fcdtocp(name), (size_t)*size+1); + *size = (size_t_f)size_c-1; /* (-1) because we don't include the NULL ending in the length*/ + } else { + *size = (size_t_f)size_c; /* if NULL then no name was found */ + } + +done: + if(c_scale_name) HDfree(c_scale_name); + return ret_value; + +} /* end nh5dsget_scale_name_c() */ + +/*------------------------------------------------------------------------- +* Function: H5DSget_num_scales_c +* +* Purpose: Calls H5DSget_num_scales +* +* Return: Success: 0, Failure: -1 +* +* Programmer: M. Scot Breitenfeld +* +* Date: April 18, 2011 +* +* Comments: +* +*------------------------------------------------------------------------- +*/ +int_f +nh5dsget_num_scales_c( hid_t_f *did, int_f *idx, int_f *num_scales) +{ + int_f ret_value = 0; + + /* + * call H5DSset_scale function. + */ + + if( (*num_scales = (int_f)H5DSget_num_scales( (hid_t)*did, (unsigned)*idx)) < 0) + HGOTO_DONE(FAIL) + + done: + return ret_value; + +} /* end nh5dsget_num_scales_c() */ diff --git a/hl/fortran/src/H5DSff.f90 b/hl/fortran/src/H5DSff.f90 new file mode 100755 index 0000000..c3ec587 --- /dev/null +++ b/hl/fortran/src/H5DSff.f90 @@ -0,0 +1,536 @@ +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! Copyright by The HDF Group. * +! Copyright by the Board of Trustees of the University of Illinois. * +! All rights reserved. * +! * +! This file is part of HDF5. The full HDF5 copyright notice, including * +! terms governing use, modification, and redistribution, is contained in * +! the files COPYING and Copyright.html. COPYING can be found at the root * +! of the source code distribution tree; Copyright.html can be found at the * +! root level of an installed copy of the electronic HDF5 document set and * +! is linked from the top-level documents page. It can also be found at * +! http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * +! access to either file, you may request a copy from help@hdfgroup.org. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! +! +! This file contains FORTRAN90 interfaces for H5DS functions +! + +MODULE h5ds + + USE h5fortran_types + USE hdf5 + +CONTAINS + + +!------------------------------------------------------------------------- +! Function: H5DSset_scale_f +! +! Purpose: Convert dataset dsid to a dimension scale, with optional name, dimname. +! +! Return: Success: 0, Failure: -1 +! +! Programmer: M. Scot Breitenfeld +! +! Date: April 17, 2011 +! +! Comments: +! +! Modifications: +! +!------------------------------------------------------------------------- + + SUBROUTINE H5DSset_scale_f( dsid, errcode, dimname) + + IMPLICIT NONE + +! +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_DLL) +!DEC$attributes dllexport :: h5dsset_scale_f +!DEC$endif +! + + INTEGER(hid_t), INTENT(in) :: dsid ! The dataset to be made a Dimension Scale + CHARACTER(LEN=*), INTENT(in), OPTIONAL :: dimname ! The dimension name + INTEGER :: errcode ! Error code + + INTEGER:: dimname_len ! length of dimname (if present) + + INTERFACE + INTEGER FUNCTION H5DSset_scale_c(dsid, dimname, dimname_len ) + + USE h5global + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DSSET_SCALE_C'::h5dsset_scale_c + !DEC$ENDIF + !DEC$ATTRIBUTES reference :: dimname + INTEGER(hid_t), INTENT(in) :: dsid ! The dataset to be made a Dimension Scale + CHARACTER(LEN=*), INTENT(in) :: dimname ! The dimension name + INTEGER, INTENT(in) :: dimname_len + END FUNCTION H5DSset_scale_c + END INTERFACE + + IF(PRESENT(dimname))THEN + dimname_len = LEN(dimname) + errcode = H5DSset_scale_c(dsid, dimname, dimname_len ) + ELSE + errcode = H5DSset_scale_c(dsid, " ", 0 ) + ENDIF + + END SUBROUTINE H5DSset_scale_f + +!------------------------------------------------------------------------- +! Function: H5DSattach_scale_f +! +! Purpose: Attach dimension scale dsid to dimension idx of dataset did. +! +! Return: Success: 0, Failure: -1 +! +! Programmer: M. Scot Breitenfeld +! +! Date: April 17, 2011 +! +! Comments: +! +! Modifications: +! +!------------------------------------------------------------------------- + + SUBROUTINE H5DSattach_scale_f( did, dsid, idx, errcode) + + IMPLICIT NONE + +! +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_DLL) +!DEC$attributes dllexport :: h5dsattach_scale_f +!DEC$endif +! + INTEGER(hid_t), INTENT(in) :: did ! the dataset + INTEGER(hid_t), INTENT(in) :: dsid ! the scale to be attached + INTEGER , INTENT(in) :: idx ! the dimension of did that dsid is associated with. + INTEGER :: errcode ! error code + INTEGER :: c_idx + + INTERFACE + INTEGER FUNCTION H5DSattach_scale_c(did, dsid, idx ) + + USE h5global + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DSATTACH_SCALE_C':: h5dsattach_scale_c + !DEC$ENDIF + INTEGER(hid_t), INTENT(in) :: did ! the dataset + INTEGER(hid_t), INTENT(in) :: dsid ! the scale to be attached + INTEGER , INTENT(in) :: idx ! the dimension of did that dsid is associated with. + END FUNCTION H5DSattach_scale_c + END INTERFACE + + c_idx = idx -1 ! account for C-dimensions starting at 0 + + errcode = H5DSattach_scale_c( did, dsid, c_idx) + + END SUBROUTINE H5DSattach_scale_f + +!------------------------------------------------------------------------- +! Function: H5DSdetach_scale_f +! +! Purpose: Detach dimension scale dsid from the dimension idx of Dataset did. +! +! Return: Success: 0, Failure: -1 +! +! Programmer: M. Scot Breitenfeld +! +! Date: April 17, 2011 +! +! Comments: +! +! Modifications: +! +!------------------------------------------------------------------------- + + SUBROUTINE H5DSdetach_scale_f( did, dsid, idx, errcode) + + IMPLICIT NONE + +! +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_DLL) +!DEC$attributes dllexport :: h5dsdetach_scale_f +!DEC$endif +! + INTEGER(hid_t), INTENT(in) :: did ! the dataset + INTEGER(hid_t), INTENT(in) :: dsid ! the scale to be detached + INTEGER , INTENT(in) :: idx ! the dimension of did to detach + INTEGER :: errcode ! error code + INTEGER :: c_idx + + INTERFACE + INTEGER FUNCTION H5DSdetach_scale_c(did, dsid, idx ) + + USE h5global + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DSDETACH_SCALE_C':: h5dsdetach_scale_c + !DEC$ENDIF + INTEGER(hid_t), INTENT(in) :: did ! the dataset + INTEGER(hid_t), INTENT(in) :: dsid ! the scale to be detached + INTEGER , INTENT(in) :: idx ! the dimension of did to detach + END FUNCTION H5DSdetach_scale_c + END INTERFACE + + c_idx = idx - 1 ! account for C-dimensions starting at 0 + + errcode = H5DSdetach_scale_c( did, dsid, c_idx) + + END SUBROUTINE H5DSdetach_scale_f + + +!------------------------------------------------------------------------- +! Function: H5DSis_attached_f +! +! Purpose: Report if dimension scale dsid is currently attached to dimension idx of dataset did. +! +! Return: Success: 0, Failure: -1 +! +! Programmer: M. Scot Breitenfeld +! +! Date: April 17, 2011 +! +! Comments: +! +! Modifications: +! +!------------------------------------------------------------------------- + + SUBROUTINE H5DSis_attached_f( did, dsid, idx, is_attached, errcode) + + IMPLICIT NONE + +! +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_DLL) +!DEC$attributes dllexport :: h5dsis_attached_f +!DEC$endif +! + INTEGER(hid_t), INTENT(in) :: did ! the dataset + INTEGER(hid_t), INTENT(in) :: dsid ! the scale to be attached + INTEGER , INTENT(in) :: idx ! the dimension of did that dsid is associated with + LOGICAL , INTENT(out) :: is_attached ! logical: dimension scale dsid is currently attached to + ! dimension idx of dataset did + INTEGER :: errcode ! error code + INTEGER :: c_is_attached + INTEGER :: c_idx + + INTERFACE + INTEGER FUNCTION H5DSis_attached_c(did, dsid, idx, c_is_attached ) + + USE h5global + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DSIS_ATTACHED_C':: h5dsis_attached_c + !DEC$ENDIF + INTEGER(hid_t), INTENT(in) :: did ! the dataset + INTEGER(hid_t), INTENT(in) :: dsid ! the scale to be detached + INTEGER , INTENT(in) :: idx ! the dimension of did to detach + INTEGER , INTENT(out) :: c_is_attached ! dimension scale dsid is currently attached to + END FUNCTION H5DSis_attached_c + END INTERFACE + + c_idx = idx - 1 ! account for C-dimensions starting at 0 + + errcode = H5DSis_attached_c(did, dsid, c_idx, c_is_attached) + + is_attached = .FALSE. ! default + IF(c_is_attached.GT.0)THEN + is_attached = .TRUE. + ELSE IF(errcode.LT.0)THEN + errcode = -1 + ENDIF + + END SUBROUTINE H5DSis_attached_f + +! +! H5DSiterate_scales: Impliment in F2003 +! + +!------------------------------------------------------------------------- +! Function: H5DSis_scale_f +! +! Purpose: Determines whether dset is a Dimension Scale. +! +! Return: Success: 0, Failure: -1 +! +! Programmer: M. Scot Breitenfeld +! +! Date: April 18, 2011 +! +! Comments: +! +! Modifications: +! +!------------------------------------------------------------------------- + + SUBROUTINE H5DSis_scale_f( did, is_scale, errcode) + + IMPLICIT NONE + +! +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_DLL) +!DEC$attributes dllexport :: h5dsis_scale_f +!DEC$endif +! + INTEGER(hid_t), INTENT(in) :: did ! the data set to query + LOGICAL , INTENT(out) :: is_scale ! logical: + ! .TRUE. if did is a Dimension Scale + INTEGER :: errcode ! error code + INTEGER :: c_is_scale + + INTERFACE + INTEGER FUNCTION H5DSis_scale_c(did,c_is_scale) + + USE h5global + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DSIS_SCALE_C':: h5dsis_scale_c + !DEC$ENDIF + INTEGER(hid_t), INTENT(in) :: did ! the data set to query + INTEGER, INTENT(out) :: c_is_scale + END FUNCTION H5DSis_scale_c + END INTERFACE + + errcode = H5DSis_scale_c(did, c_is_scale) + + is_scale = .FALSE. ! default + IF(c_is_scale.GT.0)THEN + is_scale = .TRUE. + ELSE IF(errcode.LT.0)THEN + errcode = -1 + ENDIF + + END SUBROUTINE H5DSis_scale_f + +!------------------------------------------------------------------------- +! Function: H5DSset_label_f +! +! Purpose: Set label for the dimension idx of did to the value label +! +! Return: Success: 0, Failure: -1 +! +! Programmer: M. Scot Breitenfeld +! +! Date: April 18, 2011 +! +! Comments: +! +! Modifications: +! +!------------------------------------------------------------------------- + + SUBROUTINE H5DSset_label_f( did, idx, label, errcode) + + IMPLICIT NONE + +! +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_DLL) +!DEC$attributes dllexport :: h5dsset_label_f +!DEC$endif +! + + INTEGER(hid_t), INTENT(in) :: did ! The dataset + INTEGER , INTENT(in) :: idx ! The dimension + CHARACTER(LEN=*), INTENT(in) :: label ! The label + INTEGER :: errcode ! Error code + + INTEGER :: label_len ! Length of label + INTEGER :: c_idx + + INTERFACE + INTEGER FUNCTION H5DSset_label_c(did, idx, label, label_len) + + USE h5global + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DSSET_LABEL_C'::h5dsset_label_c + !DEC$ENDIF + !DEC$ATTRIBUTES reference :: label + INTEGER(hid_t), INTENT(in) :: did ! The dataset + INTEGER , INTENT(in) :: idx ! The dimension + CHARACTER(LEN=*), INTENT(in) :: label ! The label + INTEGER, INTENT(in) :: label_len ! Length of label + END FUNCTION H5DSset_label_c + END INTERFACE + + c_idx = idx - 1 + + label_len = LEN(label) + errcode = H5DSset_label_c(did, c_idx, label, label_len) + + END SUBROUTINE H5DSset_label_f + +!------------------------------------------------------------------------- +! Function: H5DSget_label_f +! +! Purpose: Read the label for dimension idx of did into buffer label. +! +! Return: Success: 0, Failure: -1 +! +! Programmer: M. Scot Breitenfeld +! +! Date: April 18, 2011 +! +! Comments: +! +! Modifications: +! +!------------------------------------------------------------------------- + + SUBROUTINE H5DSget_label_f( did, idx, label, size, errcode) + + IMPLICIT NONE + +! +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_DLL) +!DEC$attributes dllexport :: h5dsget_label_f +!DEC$endif +! + + INTEGER(hid_t), INTENT(in) :: did ! The dataget + INTEGER , INTENT(in) :: idx ! The dimension + CHARACTER(LEN=*), INTENT(in) :: label ! The label + INTEGER(size_t) , INTENT(inout) :: size ! The length of the label buffer + INTEGER :: errcode ! Error code + INTEGER :: c_idx + + INTERFACE + INTEGER FUNCTION H5DSget_label_c(did, idx, label, size) + + USE h5global + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DSGET_LABEL_C'::h5dsget_label_c + !DEC$ENDIF + !DEC$ATTRIBUTES reference :: label + INTEGER(hid_t), INTENT(in) :: did ! The dataget + INTEGER , INTENT(in) :: idx ! The dimension + CHARACTER(LEN=*), INTENT(in) :: label ! The label + INTEGER(SIZE_T), INTENT(inout) :: size ! Length of label + END FUNCTION H5DSget_label_c + END INTERFACE + + c_idx = idx - 1 + + errcode = H5DSget_label_c(did, c_idx, label, size) + + END SUBROUTINE H5DSget_label_f + + +!------------------------------------------------------------------------- +! Function: H5DSget_scale_name_f +! +! Purpose: Read the name of scale did into buffer name. +! +! Return: Success: 0, Failure: -1 +! +! Programmer: M. Scot Breitenfeld +! +! Date: April 18, 2011 +! +! Comments: +! +! Modifications: +! +!------------------------------------------------------------------------- + + SUBROUTINE H5DSget_scale_name_f(did, name, size, errcode) + + IMPLICIT NONE + +! +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_DLL) +!DEC$attributes dllexport :: h5dsget_scale_name_f +!DEC$endif +! + + INTEGER(hid_t), INTENT(in) :: did ! The dataget + CHARACTER(LEN=*), INTENT(out) :: name ! The name + INTEGER(size_t) , INTENT(inout) :: size ! The length of the name buffer + INTEGER :: errcode ! Error code + + INTERFACE + INTEGER FUNCTION H5DSget_scale_name_c(did, name, size) + + USE h5global + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DSGET_SCALE_NAME_C'::h5dsget_scale_name_c + !DEC$ENDIF + !DEC$ATTRIBUTES reference :: name + INTEGER(hid_t), INTENT(in) :: did ! The dataget + CHARACTER(LEN=*), INTENT(out) :: name ! The name + INTEGER(SIZE_T), INTENT(inout) :: size ! Length of name + END FUNCTION H5DSget_scale_name_c + END INTERFACE + + errcode = H5DSget_scale_name_c(did, name, size) + + END SUBROUTINE H5DSget_scale_name_f + +!------------------------------------------------------------------------- +! Function: H5DSget_num_scales_f +! +! Purpose: Determines how many Dimension Scales are attached to dimension idx of did +! +! Return: Success: 0, Failure: -1 +! +! Programmer: M. Scot Breitenfeld +! +! Date: April 18, 2011 +! +! Comments: +! +! Modifications: +! +!------------------------------------------------------------------------- + + SUBROUTINE H5DSget_num_scales_f( did, idx, num_scales, errcode) + + IMPLICIT NONE + +! +!This definition is needed for Windows DLLs +!DEC$if defined(BUILD_HDF5_DLL) +!DEC$attributes dllexport :: h5dsget_num_scales_f +!DEC$endif +! + INTEGER(hid_t), INTENT(in) :: did ! the dataset + INTEGER , INTENT(in) :: idx ! the dimension of did to query + INTEGER , INTENT(out) :: num_scales ! the number of Dimension Scales associated with did + INTEGER :: errcode ! error code + INTEGER :: c_idx + + INTERFACE + INTEGER FUNCTION H5DSget_num_scales_c(did, idx, num_scales) + + USE h5global + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5DSGET_NUM_SCALES_C':: h5dsget_num_scales_c + !DEC$ENDIF + INTEGER(hid_t), INTENT(in) :: did ! the dataset + INTEGER , INTENT(in) :: idx ! the dimension of did to query + INTEGER , INTENT(out) :: num_scales ! the number of Dimension Scales associated with did + END FUNCTION H5DSget_num_scales_c + END INTERFACE + + c_idx = idx - 1 + errcode = H5DSget_num_scales_c(did, c_idx, num_scales) + + END SUBROUTINE H5DSget_num_scales_f + +END MODULE h5ds + + + + + + diff --git a/hl/fortran/src/H5IMcc.c b/hl/fortran/src/H5IMcc.c index 8f0e29e..22a7a3e 100644 --- a/hl/fortran/src/H5IMcc.c +++ b/hl/fortran/src/H5IMcc.c @@ -511,7 +511,7 @@ herr_t H5IM_get_palette(hid_t loc_id, goto out; /* Get the palette id */ - if((pal_id = H5Rdereference(image_id, H5R_OBJECT, &refbuf[pal_number])) < 0) + if((pal_id = H5Rdereference2(image_id, H5P_DEFAULT, H5R_OBJECT, &refbuf[pal_number])) < 0) goto out; /* Read the palette dataset using the memory type TID */ diff --git a/hl/fortran/src/H5LTf90proto.h b/hl/fortran/src/H5LTf90proto.h index 470f174..205871c 100755 --- a/hl/fortran/src/H5LTf90proto.h +++ b/hl/fortran/src/H5LTf90proto.h @@ -26,166 +26,223 @@ H5_FCDLL char* HD5f2cstring (_fcd fdesc, int len); H5_FCDLL void HD5packFstring (char *src, char *dest, size_t len); +/* + * Functions from H5DSfc.c + */ + +#define nh5dsset_scale_c H5_FC_FUNC_(h5dsset_scale_c, H5DSSET_SCALE_C) +#define nh5dsattach_scale_c H5_FC_FUNC_(h5dsattach_scale_c, H5DSATTACH_SCALE_C) +#define nh5dsdetach_scale_c H5_FC_FUNC_(h5dsdetach_scale_c, H5DSDETACH_SCALE_C) +#define nh5dsis_attached_c H5_FC_FUNC_(h5dsis_attached_c, H5DSIS_ATTACHED_C) +#define nh5dsis_scale_c H5_FC_FUNC_(h5dsis_scale_c, H5DSIS_SCALE_C) +#define nh5dsset_label_c H5_FC_FUNC_(h5dsset_label_c, H5DSSET_LABEL_C) +#define nh5dsget_label_c H5_FC_FUNC_(h5dsget_label_c, H5DSGET_LABEL_C) +#define nh5dsget_scale_name_c H5_FC_FUNC_(h5dsget_scale_name_c,H5DSGET_SCALE_NAME_C) +#define nh5dsget_num_scales_c H5_FC_FUNC_(h5dsget_num_scales_c,H5DSGET_NUM_SCALES_C) + /* -* Functions from H5LTfc.c -*/ -# define nh5ltmake_dataset_c H5_FC_FUNC_(h5ltmake_dataset_c, H5LTMAKE_DATASET_C) -# define nh5ltmake_dataset_int1_c H5_FC_FUNC_(h5ltmake_dataset_int1_c, H5LTMAKE_DATASET_INT1_C) -# define nh5ltmake_dataset_int2_c H5_FC_FUNC_(h5ltmake_dataset_int2_c, H5LTMAKE_DATASET_INT2_C) -# define nh5ltmake_dataset_int3_c H5_FC_FUNC_(h5ltmake_dataset_int3_c, H5LTMAKE_DATASET_INT3_C) -# define nh5ltmake_dataset_int4_c H5_FC_FUNC_(h5ltmake_dataset_int4_c, H5LTMAKE_DATASET_INT4_C) -# define nh5ltmake_dataset_int5_c H5_FC_FUNC_(h5ltmake_dataset_int5_c, H5LTMAKE_DATASET_INT5_C) -# define nh5ltmake_dataset_int6_c H5_FC_FUNC_(h5ltmake_dataset_int6_c, H5LTMAKE_DATASET_INT6_C) -# define nh5ltmake_dataset_int7_c H5_FC_FUNC_(h5ltmake_dataset_int7_c, H5LTMAKE_DATASET_INT7_C) -# define nh5ltmake_dataset_fl1_c H5_FC_FUNC_(h5ltmake_dataset_fl1_c, H5LTMAKE_DATASET_FL1_C) -# define nh5ltmake_dataset_fl2_c H5_FC_FUNC_(h5ltmake_dataset_fl2_c, H5LTMAKE_DATASET_FL2_C) -# define nh5ltmake_dataset_fl3_c H5_FC_FUNC_(h5ltmake_dataset_fl3_c, H5LTMAKE_DATASET_FL3_C) -# define nh5ltmake_dataset_fl4_c H5_FC_FUNC_(h5ltmake_dataset_fl4_c, H5LTMAKE_DATASET_FL4_C) -# define nh5ltmake_dataset_fl5_c H5_FC_FUNC_(h5ltmake_dataset_fl5_c, H5LTMAKE_DATASET_FL5_C) -# define nh5ltmake_dataset_fl6_c H5_FC_FUNC_(h5ltmake_dataset_fl6_c, H5LTMAKE_DATASET_FL6_C) -# define nh5ltmake_dataset_fl7_c H5_FC_FUNC_(h5ltmake_dataset_fl7_c, H5LTMAKE_DATASET_FL7_C) -# define nh5ltmake_dataset_dl1_c H5_FC_FUNC_(h5ltmake_dataset_dl1_c, H5LTMAKE_DATASET_DL1_C) -# define nh5ltmake_dataset_dl2_c H5_FC_FUNC_(h5ltmake_dataset_dl2_c, H5LTMAKE_DATASET_DL2_C) -# define nh5ltmake_dataset_dl3_c H5_FC_FUNC_(h5ltmake_dataset_dl3_c, H5LTMAKE_DATASET_DL3_C) -# define nh5ltmake_dataset_dl4_c H5_FC_FUNC_(h5ltmake_dataset_dl4_c, H5LTMAKE_DATASET_DL4_C) -# define nh5ltmake_dataset_dl5_c H5_FC_FUNC_(h5ltmake_dataset_dl5_c, H5LTMAKE_DATASET_DL5_C) -# define nh5ltmake_dataset_dl6_c H5_FC_FUNC_(h5ltmake_dataset_dl6_c, H5LTMAKE_DATASET_DL6_C) -# define nh5ltmake_dataset_dl7_c H5_FC_FUNC_(h5ltmake_dataset_dl7_c, H5LTMAKE_DATASET_DL7_C) -# define nh5ltmake_dataset_nint1_c H5_FC_FUNC_(h5ltmake_dataset_nint1_c, H5LTMAKE_DATASET_NINT1_C) -# define nh5ltmake_dataset_nint2_c H5_FC_FUNC_(h5ltmake_dataset_nint2_c, H5LTMAKE_DATASET_NINT2_C) -# define nh5ltmake_dataset_nint3_c H5_FC_FUNC_(h5ltmake_dataset_nint3_c, H5LTMAKE_DATASET_NINT3_C) -# define nh5ltmake_dataset_nint4_c H5_FC_FUNC_(h5ltmake_dataset_nint4_c, H5LTMAKE_DATASET_NINT4_C) -# define nh5ltmake_dataset_nint5_c H5_FC_FUNC_(h5ltmake_dataset_nint5_c, H5LTMAKE_DATASET_NINT5_C) -# define nh5ltmake_dataset_nint6_c H5_FC_FUNC_(h5ltmake_dataset_nint6_c, H5LTMAKE_DATASET_NINT6_C) -# define nh5ltmake_dataset_nint7_c H5_FC_FUNC_(h5ltmake_dataset_nint7_c, H5LTMAKE_DATASET_NINT7_C) -# define nh5ltmake_dataset_nfl1_c H5_FC_FUNC_(h5ltmake_dataset_nfl1_c, H5LTMAKE_DATASET_NFL1_C) -# define nh5ltmake_dataset_nfl2_c H5_FC_FUNC_(h5ltmake_dataset_nfl2_c, H5LTMAKE_DATASET_NFL2_C) -# define nh5ltmake_dataset_nfl3_c H5_FC_FUNC_(h5ltmake_dataset_nfl3_c, H5LTMAKE_DATASET_NFL3_C) -# define nh5ltmake_dataset_nfl4_c H5_FC_FUNC_(h5ltmake_dataset_nfl4_c, H5LTMAKE_DATASET_NFL4_C) -# define nh5ltmake_dataset_nfl5_c H5_FC_FUNC_(h5ltmake_dataset_nfl5_c, H5LTMAKE_DATASET_NFL5_C) -# define nh5ltmake_dataset_nfl6_c H5_FC_FUNC_(h5ltmake_dataset_nfl6_c, H5LTMAKE_DATASET_NFL6_C) -# define nh5ltmake_dataset_nfl7_c H5_FC_FUNC_(h5ltmake_dataset_nfl7_c, H5LTMAKE_DATASET_NFL7_C) -# define nh5ltmake_dataset_ndl1_c H5_FC_FUNC_(h5ltmake_dataset_ndl1_c, H5LTMAKE_DATASET_NDL1_C) -# define nh5ltmake_dataset_ndl2_c H5_FC_FUNC_(h5ltmake_dataset_ndl2_c, H5LTMAKE_DATASET_NDL2_C) -# define nh5ltmake_dataset_ndl3_c H5_FC_FUNC_(h5ltmake_dataset_ndl3_c, H5LTMAKE_DATASET_NDL3_C) -# define nh5ltmake_dataset_ndl4_c H5_FC_FUNC_(h5ltmake_dataset_ndl4_c, H5LTMAKE_DATASET_NDL4_C) -# define nh5ltmake_dataset_ndl5_c H5_FC_FUNC_(h5ltmake_dataset_ndl5_c, H5LTMAKE_DATASET_NDL5_C) -# define nh5ltmake_dataset_ndl6_c H5_FC_FUNC_(h5ltmake_dataset_ndl6_c, H5LTMAKE_DATASET_NDL6_C) -# define nh5ltmake_dataset_ndl7_c H5_FC_FUNC_(h5ltmake_dataset_ndl7_c, H5LTMAKE_DATASET_NDL7_C) -# define nh5ltread_dataset_c H5_FC_FUNC_(h5ltread_dataset_c, H5LTREAD_DATASET_C) -# define nh5ltread_dataset_int1_c H5_FC_FUNC_(h5ltread_dataset_int1_c, H5LTREAD_DATASET_INT1_C) -# define nh5ltread_dataset_int2_c H5_FC_FUNC_(h5ltread_dataset_int2_c, H5LTREAD_DATASET_INT2_C) -# define nh5ltread_dataset_int3_c H5_FC_FUNC_(h5ltread_dataset_int3_c, H5LTREAD_DATASET_INT3_C) -# define nh5ltread_dataset_int4_c H5_FC_FUNC_(h5ltread_dataset_int4_c, H5LTREAD_DATASET_INT4_C) -# define nh5ltread_dataset_int5_c H5_FC_FUNC_(h5ltread_dataset_int5_c, H5LTREAD_DATASET_INT5_C) -# define nh5ltread_dataset_int6_c H5_FC_FUNC_(h5ltread_dataset_int6_c, H5LTREAD_DATASET_INT6_C) -# define nh5ltread_dataset_int7_c H5_FC_FUNC_(h5ltread_dataset_int7_c, H5LTREAD_DATASET_INT7_C) -# define nh5ltread_dataset_fl1_c H5_FC_FUNC_(h5ltread_dataset_fl1_c, H5LTREAD_DATASET_FL1_C) -# define nh5ltread_dataset_fl2_c H5_FC_FUNC_(h5ltread_dataset_fl2_c, H5LTREAD_DATASET_FL2_C) -# define nh5ltread_dataset_fl3_c H5_FC_FUNC_(h5ltread_dataset_fl3_c, H5LTREAD_DATASET_FL3_C) -# define nh5ltread_dataset_fl4_c H5_FC_FUNC_(h5ltread_dataset_fl4_c, H5LTREAD_DATASET_FL4_C) -# define nh5ltread_dataset_fl5_c H5_FC_FUNC_(h5ltread_dataset_fl5_c, H5LTREAD_DATASET_FL5_C) -# define nh5ltread_dataset_fl6_c H5_FC_FUNC_(h5ltread_dataset_fl6_c, H5LTREAD_DATASET_FL6_C) -# define nh5ltread_dataset_fl7_c H5_FC_FUNC_(h5ltread_dataset_fl7_c, H5LTREAD_DATASET_FL7_C) -# define nh5ltread_dataset_dl1_c H5_FC_FUNC_(h5ltread_dataset_dl1_c, H5LTREAD_DATASET_DL1_C) -# define nh5ltread_dataset_dl2_c H5_FC_FUNC_(h5ltread_dataset_dl2_c, H5LTREAD_DATASET_DL2_C) -# define nh5ltread_dataset_dl3_c H5_FC_FUNC_(h5ltread_dataset_dl3_c, H5LTREAD_DATASET_DL3_C) -# define nh5ltread_dataset_dl4_c H5_FC_FUNC_(h5ltread_dataset_dl4_c, H5LTREAD_DATASET_DL4_C) -# define nh5ltread_dataset_dl5_c H5_FC_FUNC_(h5ltread_dataset_dl5_c, H5LTREAD_DATASET_DL5_C) -# define nh5ltread_dataset_dl6_c H5_FC_FUNC_(h5ltread_dataset_dl6_c, H5LTREAD_DATASET_DL6_C) -# define nh5ltread_dataset_dl7_c H5_FC_FUNC_(h5ltread_dataset_dl7_c, H5LTREAD_DATASET_DL7_C) -# define nh5ltread_dataset_nint1_c H5_FC_FUNC_(h5ltread_dataset_nint1_c, H5LTREAD_DATASET_NINT1_C) -# define nh5ltread_dataset_nint2_c H5_FC_FUNC_(h5ltread_dataset_nint2_c, H5LTREAD_DATASET_NINT2_C) -# define nh5ltread_dataset_nint3_c H5_FC_FUNC_(h5ltread_dataset_nint3_c, H5LTREAD_DATASET_NINT3_C) -# define nh5ltread_dataset_nint4_c H5_FC_FUNC_(h5ltread_dataset_nint4_c, H5LTREAD_DATASET_NINT4_C) -# define nh5ltread_dataset_nint5_c H5_FC_FUNC_(h5ltread_dataset_nint5_c, H5LTREAD_DATASET_NINT5_C) -# define nh5ltread_dataset_nint6_c H5_FC_FUNC_(h5ltread_dataset_nint6_c, H5LTREAD_DATASET_NINT6_C) -# define nh5ltread_dataset_nint7_c H5_FC_FUNC_(h5ltread_dataset_nint7_c, H5LTREAD_DATASET_NINT7_C) -# define nh5ltread_dataset_nfl1_c H5_FC_FUNC_(h5ltread_dataset_nfl1_c, H5LTREAD_DATASET_NFL1_C) -# define nh5ltread_dataset_nfl2_c H5_FC_FUNC_(h5ltread_dataset_nfl2_c, H5LTREAD_DATASET_NFL2_C) -# define nh5ltread_dataset_nfl3_c H5_FC_FUNC_(h5ltread_dataset_nfl3_c, H5LTREAD_DATASET_NFL3_C) -# define nh5ltread_dataset_nfl4_c H5_FC_FUNC_(h5ltread_dataset_nfl4_c, H5LTREAD_DATASET_NFL4_C) -# define nh5ltread_dataset_nfl5_c H5_FC_FUNC_(h5ltread_dataset_nfl5_c, H5LTREAD_DATASET_NFL5_C) -# define nh5ltread_dataset_nfl6_c H5_FC_FUNC_(h5ltread_dataset_nfl6_c, H5LTREAD_DATASET_NFL6_C) -# define nh5ltread_dataset_nfl7_c H5_FC_FUNC_(h5ltread_dataset_nfl7_c, H5LTREAD_DATASET_NFL7_C) -# define nh5ltread_dataset_ndl1_c H5_FC_FUNC_(h5ltread_dataset_ndl1_c, H5LTREAD_DATASET_NDL1_C) -# define nh5ltread_dataset_ndl2_c H5_FC_FUNC_(h5ltread_dataset_ndl2_c, H5LTREAD_DATASET_NDL2_C) -# define nh5ltread_dataset_ndl3_c H5_FC_FUNC_(h5ltread_dataset_ndl3_c, H5LTREAD_DATASET_NDL3_C) -# define nh5ltread_dataset_ndl4_c H5_FC_FUNC_(h5ltread_dataset_ndl4_c, H5LTREAD_DATASET_NDL4_C) -# define nh5ltread_dataset_ndl5_c H5_FC_FUNC_(h5ltread_dataset_ndl5_c, H5LTREAD_DATASET_NDL5_C) -# define nh5ltread_dataset_ndl6_c H5_FC_FUNC_(h5ltread_dataset_ndl6_c, H5LTREAD_DATASET_NDL6_C) -# define nh5ltread_dataset_ndl7_c H5_FC_FUNC_(h5ltread_dataset_ndl7_c, H5LTREAD_DATASET_NDL7_C) -# define nh5ltmake_dataset_string_c H5_FC_FUNC_(h5ltmake_dataset_string_c, H5LTMAKE_DATASET_STRING_C) -# define nh5ltread_dataset_string_c H5_FC_FUNC_(h5ltread_dataset_string_c, H5LTREAD_DATASET_STRING_C) - -# define nh5ltset_attribute_int_c H5_FC_FUNC_(h5ltset_attribute_int_c, H5LTSET_ATTRIBUTE_INT_C) -# define nh5ltset_attribute_float_c H5_FC_FUNC_(h5ltset_attribute_float_c, H5LTSET_ATTRIBUTE_FLOAT_C) -# define nh5ltset_attribute_double_c H5_FC_FUNC_(h5ltset_attribute_double_c, H5LTSET_ATTRIBUTE_DOUBLE_C) -# define nh5ltset_attribute_string_c H5_FC_FUNC_(h5ltset_attribute_string_c, H5LTSET_ATTRIBUTE_STRING_C) - -# define nh5ltget_attribute_int_c H5_FC_FUNC_(h5ltget_attribute_int_c, H5LTGET_ATTRIBUTE_INT_C) -# define nh5ltget_attribute_float_c H5_FC_FUNC_(h5ltget_attribute_float_c, H5LTGET_ATTRIBUTE_FLOAT_C) -# define nh5ltget_attribute_double_c H5_FC_FUNC_(h5ltget_attribute_double_c, H5LTGET_ATTRIBUTE_DOUBLE_C) -# define nh5ltget_attribute_string_c H5_FC_FUNC_(h5ltget_attribute_string_c, H5LTGET_ATTRIBUTE_STRING_C) - -# define nh5ltget_dataset_ndims_c H5_FC_FUNC_(h5ltget_dataset_ndims_c, H5LTGET_DATASET_NDIMS_C) -# define nh5ltfind_dataset_c H5_FC_FUNC_(h5ltfind_dataset_c, H5LTFIND_DATASET_C) -# define nh5ltget_dataset_info_c H5_FC_FUNC_(h5ltget_dataset_info_c, H5LTGET_DATASET_INFO_C) - -# define nh5ltget_attribute_ndims_c H5_FC_FUNC_(h5ltget_attribute_ndims_c, H5LTGET_ATTRIBUTE_NDIMS_C) -# define nh5ltget_attribute_info_c H5_FC_FUNC_(h5ltget_attribute_info_c, H5LTGET_ATTRIBUTE_INFO_C) + * Functions from H5LTfc.c + */ +#define nh5ltmake_dataset_c H5_FC_FUNC_(h5ltmake_dataset_c, H5LTMAKE_DATASET_C) +#define nh5ltmake_dataset_int1_c H5_FC_FUNC_(h5ltmake_dataset_int1_c, H5LTMAKE_DATASET_INT1_C) +#define nh5ltmake_dataset_int2_c H5_FC_FUNC_(h5ltmake_dataset_int2_c, H5LTMAKE_DATASET_INT2_C) +#define nh5ltmake_dataset_int3_c H5_FC_FUNC_(h5ltmake_dataset_int3_c, H5LTMAKE_DATASET_INT3_C) +#define nh5ltmake_dataset_int4_c H5_FC_FUNC_(h5ltmake_dataset_int4_c, H5LTMAKE_DATASET_INT4_C) +#define nh5ltmake_dataset_int5_c H5_FC_FUNC_(h5ltmake_dataset_int5_c, H5LTMAKE_DATASET_INT5_C) +#define nh5ltmake_dataset_int6_c H5_FC_FUNC_(h5ltmake_dataset_int6_c, H5LTMAKE_DATASET_INT6_C) +#define nh5ltmake_dataset_int7_c H5_FC_FUNC_(h5ltmake_dataset_int7_c, H5LTMAKE_DATASET_INT7_C) +#define nh5ltmake_dataset_fl1_c H5_FC_FUNC_(h5ltmake_dataset_fl1_c, H5LTMAKE_DATASET_FL1_C) +#define nh5ltmake_dataset_fl2_c H5_FC_FUNC_(h5ltmake_dataset_fl2_c, H5LTMAKE_DATASET_FL2_C) +#define nh5ltmake_dataset_fl3_c H5_FC_FUNC_(h5ltmake_dataset_fl3_c, H5LTMAKE_DATASET_FL3_C) +#define nh5ltmake_dataset_fl4_c H5_FC_FUNC_(h5ltmake_dataset_fl4_c, H5LTMAKE_DATASET_FL4_C) +#define nh5ltmake_dataset_fl5_c H5_FC_FUNC_(h5ltmake_dataset_fl5_c, H5LTMAKE_DATASET_FL5_C) +#define nh5ltmake_dataset_fl6_c H5_FC_FUNC_(h5ltmake_dataset_fl6_c, H5LTMAKE_DATASET_FL6_C) +#define nh5ltmake_dataset_fl7_c H5_FC_FUNC_(h5ltmake_dataset_fl7_c, H5LTMAKE_DATASET_FL7_C) +#define nh5ltmake_dataset_dl1_c H5_FC_FUNC_(h5ltmake_dataset_dl1_c, H5LTMAKE_DATASET_DL1_C) +#define nh5ltmake_dataset_dl2_c H5_FC_FUNC_(h5ltmake_dataset_dl2_c, H5LTMAKE_DATASET_DL2_C) +#define nh5ltmake_dataset_dl3_c H5_FC_FUNC_(h5ltmake_dataset_dl3_c, H5LTMAKE_DATASET_DL3_C) +#define nh5ltmake_dataset_dl4_c H5_FC_FUNC_(h5ltmake_dataset_dl4_c, H5LTMAKE_DATASET_DL4_C) +#define nh5ltmake_dataset_dl5_c H5_FC_FUNC_(h5ltmake_dataset_dl5_c, H5LTMAKE_DATASET_DL5_C) +#define nh5ltmake_dataset_dl6_c H5_FC_FUNC_(h5ltmake_dataset_dl6_c, H5LTMAKE_DATASET_DL6_C) +#define nh5ltmake_dataset_dl7_c H5_FC_FUNC_(h5ltmake_dataset_dl7_c, H5LTMAKE_DATASET_DL7_C) +#define nh5ltmake_dataset_nint1_c H5_FC_FUNC_(h5ltmake_dataset_nint1_c, H5LTMAKE_DATASET_NINT1_C) +#define nh5ltmake_dataset_nint2_c H5_FC_FUNC_(h5ltmake_dataset_nint2_c, H5LTMAKE_DATASET_NINT2_C) +#define nh5ltmake_dataset_nint3_c H5_FC_FUNC_(h5ltmake_dataset_nint3_c, H5LTMAKE_DATASET_NINT3_C) +#define nh5ltmake_dataset_nint4_c H5_FC_FUNC_(h5ltmake_dataset_nint4_c, H5LTMAKE_DATASET_NINT4_C) +#define nh5ltmake_dataset_nint5_c H5_FC_FUNC_(h5ltmake_dataset_nint5_c, H5LTMAKE_DATASET_NINT5_C) +#define nh5ltmake_dataset_nint6_c H5_FC_FUNC_(h5ltmake_dataset_nint6_c, H5LTMAKE_DATASET_NINT6_C) +#define nh5ltmake_dataset_nint7_c H5_FC_FUNC_(h5ltmake_dataset_nint7_c, H5LTMAKE_DATASET_NINT7_C) +#define nh5ltmake_dataset_nfl1_c H5_FC_FUNC_(h5ltmake_dataset_nfl1_c, H5LTMAKE_DATASET_NFL1_C) +#define nh5ltmake_dataset_nfl2_c H5_FC_FUNC_(h5ltmake_dataset_nfl2_c, H5LTMAKE_DATASET_NFL2_C) +#define nh5ltmake_dataset_nfl3_c H5_FC_FUNC_(h5ltmake_dataset_nfl3_c, H5LTMAKE_DATASET_NFL3_C) +#define nh5ltmake_dataset_nfl4_c H5_FC_FUNC_(h5ltmake_dataset_nfl4_c, H5LTMAKE_DATASET_NFL4_C) +#define nh5ltmake_dataset_nfl5_c H5_FC_FUNC_(h5ltmake_dataset_nfl5_c, H5LTMAKE_DATASET_NFL5_C) +#define nh5ltmake_dataset_nfl6_c H5_FC_FUNC_(h5ltmake_dataset_nfl6_c, H5LTMAKE_DATASET_NFL6_C) +#define nh5ltmake_dataset_nfl7_c H5_FC_FUNC_(h5ltmake_dataset_nfl7_c, H5LTMAKE_DATASET_NFL7_C) +#define nh5ltmake_dataset_ndl1_c H5_FC_FUNC_(h5ltmake_dataset_ndl1_c, H5LTMAKE_DATASET_NDL1_C) +#define nh5ltmake_dataset_ndl2_c H5_FC_FUNC_(h5ltmake_dataset_ndl2_c, H5LTMAKE_DATASET_NDL2_C) +#define nh5ltmake_dataset_ndl3_c H5_FC_FUNC_(h5ltmake_dataset_ndl3_c, H5LTMAKE_DATASET_NDL3_C) +#define nh5ltmake_dataset_ndl4_c H5_FC_FUNC_(h5ltmake_dataset_ndl4_c, H5LTMAKE_DATASET_NDL4_C) +#define nh5ltmake_dataset_ndl5_c H5_FC_FUNC_(h5ltmake_dataset_ndl5_c, H5LTMAKE_DATASET_NDL5_C) +#define nh5ltmake_dataset_ndl6_c H5_FC_FUNC_(h5ltmake_dataset_ndl6_c, H5LTMAKE_DATASET_NDL6_C) +#define nh5ltmake_dataset_ndl7_c H5_FC_FUNC_(h5ltmake_dataset_ndl7_c, H5LTMAKE_DATASET_NDL7_C) +#define nh5ltread_dataset_c H5_FC_FUNC_(h5ltread_dataset_c, H5LTREAD_DATASET_C) +#define nh5ltread_dataset_int1_c H5_FC_FUNC_(h5ltread_dataset_int1_c, H5LTREAD_DATASET_INT1_C) +#define nh5ltread_dataset_int2_c H5_FC_FUNC_(h5ltread_dataset_int2_c, H5LTREAD_DATASET_INT2_C) +#define nh5ltread_dataset_int3_c H5_FC_FUNC_(h5ltread_dataset_int3_c, H5LTREAD_DATASET_INT3_C) +#define nh5ltread_dataset_int4_c H5_FC_FUNC_(h5ltread_dataset_int4_c, H5LTREAD_DATASET_INT4_C) +#define nh5ltread_dataset_int5_c H5_FC_FUNC_(h5ltread_dataset_int5_c, H5LTREAD_DATASET_INT5_C) +#define nh5ltread_dataset_int6_c H5_FC_FUNC_(h5ltread_dataset_int6_c, H5LTREAD_DATASET_INT6_C) +#define nh5ltread_dataset_int7_c H5_FC_FUNC_(h5ltread_dataset_int7_c, H5LTREAD_DATASET_INT7_C) +#define nh5ltread_dataset_fl1_c H5_FC_FUNC_(h5ltread_dataset_fl1_c, H5LTREAD_DATASET_FL1_C) +#define nh5ltread_dataset_fl2_c H5_FC_FUNC_(h5ltread_dataset_fl2_c, H5LTREAD_DATASET_FL2_C) +#define nh5ltread_dataset_fl3_c H5_FC_FUNC_(h5ltread_dataset_fl3_c, H5LTREAD_DATASET_FL3_C) +#define nh5ltread_dataset_fl4_c H5_FC_FUNC_(h5ltread_dataset_fl4_c, H5LTREAD_DATASET_FL4_C) +#define nh5ltread_dataset_fl5_c H5_FC_FUNC_(h5ltread_dataset_fl5_c, H5LTREAD_DATASET_FL5_C) +#define nh5ltread_dataset_fl6_c H5_FC_FUNC_(h5ltread_dataset_fl6_c, H5LTREAD_DATASET_FL6_C) +#define nh5ltread_dataset_fl7_c H5_FC_FUNC_(h5ltread_dataset_fl7_c, H5LTREAD_DATASET_FL7_C) +#define nh5ltread_dataset_dl1_c H5_FC_FUNC_(h5ltread_dataset_dl1_c, H5LTREAD_DATASET_DL1_C) +#define nh5ltread_dataset_dl2_c H5_FC_FUNC_(h5ltread_dataset_dl2_c, H5LTREAD_DATASET_DL2_C) +#define nh5ltread_dataset_dl3_c H5_FC_FUNC_(h5ltread_dataset_dl3_c, H5LTREAD_DATASET_DL3_C) +#define nh5ltread_dataset_dl4_c H5_FC_FUNC_(h5ltread_dataset_dl4_c, H5LTREAD_DATASET_DL4_C) +#define nh5ltread_dataset_dl5_c H5_FC_FUNC_(h5ltread_dataset_dl5_c, H5LTREAD_DATASET_DL5_C) +#define nh5ltread_dataset_dl6_c H5_FC_FUNC_(h5ltread_dataset_dl6_c, H5LTREAD_DATASET_DL6_C) +#define nh5ltread_dataset_dl7_c H5_FC_FUNC_(h5ltread_dataset_dl7_c, H5LTREAD_DATASET_DL7_C) +#define nh5ltread_dataset_nint1_c H5_FC_FUNC_(h5ltread_dataset_nint1_c, H5LTREAD_DATASET_NINT1_C) +#define nh5ltread_dataset_nint2_c H5_FC_FUNC_(h5ltread_dataset_nint2_c, H5LTREAD_DATASET_NINT2_C) +#define nh5ltread_dataset_nint3_c H5_FC_FUNC_(h5ltread_dataset_nint3_c, H5LTREAD_DATASET_NINT3_C) +#define nh5ltread_dataset_nint4_c H5_FC_FUNC_(h5ltread_dataset_nint4_c, H5LTREAD_DATASET_NINT4_C) +#define nh5ltread_dataset_nint5_c H5_FC_FUNC_(h5ltread_dataset_nint5_c, H5LTREAD_DATASET_NINT5_C) +#define nh5ltread_dataset_nint6_c H5_FC_FUNC_(h5ltread_dataset_nint6_c, H5LTREAD_DATASET_NINT6_C) +#define nh5ltread_dataset_nint7_c H5_FC_FUNC_(h5ltread_dataset_nint7_c, H5LTREAD_DATASET_NINT7_C) +#define nh5ltread_dataset_nfl1_c H5_FC_FUNC_(h5ltread_dataset_nfl1_c, H5LTREAD_DATASET_NFL1_C) +#define nh5ltread_dataset_nfl2_c H5_FC_FUNC_(h5ltread_dataset_nfl2_c, H5LTREAD_DATASET_NFL2_C) +#define nh5ltread_dataset_nfl3_c H5_FC_FUNC_(h5ltread_dataset_nfl3_c, H5LTREAD_DATASET_NFL3_C) +#define nh5ltread_dataset_nfl4_c H5_FC_FUNC_(h5ltread_dataset_nfl4_c, H5LTREAD_DATASET_NFL4_C) +#define nh5ltread_dataset_nfl5_c H5_FC_FUNC_(h5ltread_dataset_nfl5_c, H5LTREAD_DATASET_NFL5_C) +#define nh5ltread_dataset_nfl6_c H5_FC_FUNC_(h5ltread_dataset_nfl6_c, H5LTREAD_DATASET_NFL6_C) +#define nh5ltread_dataset_nfl7_c H5_FC_FUNC_(h5ltread_dataset_nfl7_c, H5LTREAD_DATASET_NFL7_C) +#define nh5ltread_dataset_ndl1_c H5_FC_FUNC_(h5ltread_dataset_ndl1_c, H5LTREAD_DATASET_NDL1_C) +#define nh5ltread_dataset_ndl2_c H5_FC_FUNC_(h5ltread_dataset_ndl2_c, H5LTREAD_DATASET_NDL2_C) +#define nh5ltread_dataset_ndl3_c H5_FC_FUNC_(h5ltread_dataset_ndl3_c, H5LTREAD_DATASET_NDL3_C) +#define nh5ltread_dataset_ndl4_c H5_FC_FUNC_(h5ltread_dataset_ndl4_c, H5LTREAD_DATASET_NDL4_C) +#define nh5ltread_dataset_ndl5_c H5_FC_FUNC_(h5ltread_dataset_ndl5_c, H5LTREAD_DATASET_NDL5_C) +#define nh5ltread_dataset_ndl6_c H5_FC_FUNC_(h5ltread_dataset_ndl6_c, H5LTREAD_DATASET_NDL6_C) +#define nh5ltread_dataset_ndl7_c H5_FC_FUNC_(h5ltread_dataset_ndl7_c, H5LTREAD_DATASET_NDL7_C) +#define nh5ltmake_dataset_string_c H5_FC_FUNC_(h5ltmake_dataset_string_c, H5LTMAKE_DATASET_STRING_C) +#define nh5ltread_dataset_string_c H5_FC_FUNC_(h5ltread_dataset_string_c, H5LTREAD_DATASET_STRING_C) + +#define nh5ltset_attribute_int_c H5_FC_FUNC_(h5ltset_attribute_int_c, H5LTSET_ATTRIBUTE_INT_C) +#define nh5ltset_attribute_float_c H5_FC_FUNC_(h5ltset_attribute_float_c, H5LTSET_ATTRIBUTE_FLOAT_C) +#define nh5ltset_attribute_double_c H5_FC_FUNC_(h5ltset_attribute_double_c, H5LTSET_ATTRIBUTE_DOUBLE_C) +#define nh5ltset_attribute_string_c H5_FC_FUNC_(h5ltset_attribute_string_c, H5LTSET_ATTRIBUTE_STRING_C) + +#define nh5ltget_attribute_int_c H5_FC_FUNC_(h5ltget_attribute_int_c, H5LTGET_ATTRIBUTE_INT_C) +#define nh5ltget_attribute_float_c H5_FC_FUNC_(h5ltget_attribute_float_c, H5LTGET_ATTRIBUTE_FLOAT_C) +#define nh5ltget_attribute_double_c H5_FC_FUNC_(h5ltget_attribute_double_c, H5LTGET_ATTRIBUTE_DOUBLE_C) +#define nh5ltget_attribute_string_c H5_FC_FUNC_(h5ltget_attribute_string_c, H5LTGET_ATTRIBUTE_STRING_C) + +#define nh5ltget_dataset_ndims_c H5_FC_FUNC_(h5ltget_dataset_ndims_c, H5LTGET_DATASET_NDIMS_C) +#define nh5ltfind_dataset_c H5_FC_FUNC_(h5ltfind_dataset_c, H5LTFIND_DATASET_C) +#define nh5ltget_dataset_info_c H5_FC_FUNC_(h5ltget_dataset_info_c, H5LTGET_DATASET_INFO_C) + +#define nh5ltget_attribute_ndims_c H5_FC_FUNC_(h5ltget_attribute_ndims_c, H5LTGET_ATTRIBUTE_NDIMS_C) +#define nh5ltget_attribute_info_c H5_FC_FUNC_(h5ltget_attribute_info_c, H5LTGET_ATTRIBUTE_INFO_C) +#define nh5ltpath_valid_c H5_FC_FUNC_(h5ltpath_valid_c, H5LTPATH_VALID_C) /*------------------------------------------------------------------------- * Image *------------------------------------------------------------------------- */ -# define nh5immake_image_8bit_c H5_FC_FUNC_(h5immake_image_8bit_c, H5IMMAKE_IMAGE_8BIT_C) -# define nh5immake_image_24bit_c H5_FC_FUNC_(h5immake_image_24bit_c, H5IMMAKE_IMAGE_24BIT_C) -# define nh5imread_image_c H5_FC_FUNC_(h5imread_image_c, H5IMREAD_IMAGE_C) -# define nh5imget_image_info_c H5_FC_FUNC_(h5imget_image_info_c, H5IMGET_IMAGE_INFO_C) -# define nh5imis_image_c H5_FC_FUNC_(h5imis_image_c, H5IMIS_IMAGE_C) -# define nh5immake_palette_c H5_FC_FUNC_(h5immake_palette_c, H5IMMAKE_PALETTE_C) -# define nh5imlink_palette_c H5_FC_FUNC_(h5imlink_palette_c, H5IMLINK_PALETTE_C) -# define nh5imunlink_palette_c H5_FC_FUNC_(h5imunlink_palette_c, H5IMUNLINK_PALETTE_C) -# define nh5imget_npalettes_c H5_FC_FUNC_(h5imget_npalettes_c, H5IMGET_NPALETTES_C) -# define nh5imget_palette_info_c H5_FC_FUNC_(h5imget_palette_info_c, H5IMGET_PALETTE_INFO_C) -# define nh5imget_palette_c H5_FC_FUNC_(h5imget_palette_c, H5IMGET_PALETTE_C) -# define nh5imis_palette_c H5_FC_FUNC_(h5imis_palette_c, H5IMIS_PALETTE_C) +#define nh5immake_image_8bit_c H5_FC_FUNC_(h5immake_image_8bit_c, H5IMMAKE_IMAGE_8BIT_C) +#define nh5immake_image_24bit_c H5_FC_FUNC_(h5immake_image_24bit_c, H5IMMAKE_IMAGE_24BIT_C) +#define nh5imread_image_c H5_FC_FUNC_(h5imread_image_c, H5IMREAD_IMAGE_C) +#define nh5imget_image_info_c H5_FC_FUNC_(h5imget_image_info_c, H5IMGET_IMAGE_INFO_C) +#define nh5imis_image_c H5_FC_FUNC_(h5imis_image_c, H5IMIS_IMAGE_C) +#define nh5immake_palette_c H5_FC_FUNC_(h5immake_palette_c, H5IMMAKE_PALETTE_C) +#define nh5imlink_palette_c H5_FC_FUNC_(h5imlink_palette_c, H5IMLINK_PALETTE_C) +#define nh5imunlink_palette_c H5_FC_FUNC_(h5imunlink_palette_c, H5IMUNLINK_PALETTE_C) +#define nh5imget_npalettes_c H5_FC_FUNC_(h5imget_npalettes_c, H5IMGET_NPALETTES_C) +#define nh5imget_palette_info_c H5_FC_FUNC_(h5imget_palette_info_c, H5IMGET_PALETTE_INFO_C) +#define nh5imget_palette_c H5_FC_FUNC_(h5imget_palette_c, H5IMGET_PALETTE_C) +#define nh5imis_palette_c H5_FC_FUNC_(h5imis_palette_c, H5IMIS_PALETTE_C) /*------------------------------------------------------------------------- * Table *------------------------------------------------------------------------- */ -# define nh5tbmake_table_c H5_FC_FUNC_(h5tbmake_table_c, H5TBMAKE_TABLE_C) -# define nh5tbwrite_field_name_c H5_FC_FUNC_(h5tbwrite_field_name_c, H5TBWRITE_FIELD_NAME_C) -# define nh5tbwrite_field_name_int_c H5_FC_FUNC_(h5tbwrite_field_name_int_c, H5TBWRITE_FIELD_NAME_INT_C) -# define nh5tbwrite_field_name_fl_c H5_FC_FUNC_(h5tbwrite_field_name_fl_c, H5TBWRITE_FIELD_NAME_FL_C) -# define nh5tbwrite_field_name_dl_c H5_FC_FUNC_(h5tbwrite_field_name_dl_c, H5TBWRITE_FIELD_NAME_DL_C) -# define nh5tbwrite_field_name_st_c H5_FC_FUNC_(h5tbwrite_field_name_st_c, H5TBWRITE_FIELD_NAME_ST_C) -# define nh5tbread_field_name_c H5_FC_FUNC_(h5tbread_field_name_c, H5TBREAD_FIELD_NAME_C) -# define nh5tbread_field_name_int_c H5_FC_FUNC_(h5tbread_field_name_int_c, H5TBREAD_FIELD_NAME_INT_C) -# define nh5tbread_field_name_fl_c H5_FC_FUNC_(h5tbread_field_name_fl_c, H5TBREAD_FIELD_NAME_FL_C) -# define nh5tbread_field_name_dl_c H5_FC_FUNC_(h5tbread_field_name_dl_c, H5TBREAD_FIELD_NAME_DL_C) -# define nh5tbread_field_name_st_c H5_FC_FUNC_(h5tbread_field_name_st_c, H5TBREAD_FIELD_NAME_ST_C) -# define nh5tbwrite_field_index_c H5_FC_FUNC_(h5tbwrite_field_index_c, H5TBWRITE_FIELD_INDEX_C) -# define nh5tbwrite_field_index_int_c H5_FC_FUNC_(h5tbwrite_field_index_int_c, H5TBWRITE_FIELD_INDEX_INT_C) -# define nh5tbwrite_field_index_fl_c H5_FC_FUNC_(h5tbwrite_field_index_fl_c, H5TBWRITE_FIELD_INDEX_FL_C) -# define nh5tbwrite_field_index_dl_c H5_FC_FUNC_(h5tbwrite_field_index_dl_c, H5TBWRITE_FIELD_INDEX_DL_C) -# define nh5tbwrite_field_index_st_c H5_FC_FUNC_(h5tbwrite_field_index_st_c, H5TBWRITE_FIELD_INDEX_ST_C) -# define nh5tbread_field_index_c H5_FC_FUNC_(h5tbread_field_index_c, H5TBREAD_FIELD_INDEX_C) -# define nh5tbread_field_index_int_c H5_FC_FUNC_(h5tbread_field_index_int_c, H5TBREAD_FIELD_INDEX_INT_C) -# define nh5tbread_field_index_fl_c H5_FC_FUNC_(h5tbread_field_index_fl_c, H5TBREAD_FIELD_INDEX_FL_C) -# define nh5tbread_field_index_dl_c H5_FC_FUNC_(h5tbread_field_index_dl_c, H5TBREAD_FIELD_INDEX_DL_C) -# define nh5tbread_field_index_st_c H5_FC_FUNC_(h5tbread_field_index_st_c, H5TBREAD_FIELD_INDEX_ST_C) -# define nh5tbinsert_field_c H5_FC_FUNC_(h5tbinsert_field_c, H5TBINSERT_FIELD_C) -# define nh5tbinsert_field_int_c H5_FC_FUNC_(h5tbinsert_field_int_c, H5TBINSERT_FIELD_INT_C) -# define nh5tbinsert_field_fl_c H5_FC_FUNC_(h5tbinsert_field_fl_c, H5TBINSERT_FIELD_FL_C) -# define nh5tbinsert_field_dl_c H5_FC_FUNC_(h5tbinsert_field_dl_c, H5TBINSERT_FIELD_DL_C) -# define nh5tbinsert_field_st_c H5_FC_FUNC_(h5tbinsert_field_st_c, H5TBINSERT_FIELD_ST_C) -# define nh5tbdelete_field_c H5_FC_FUNC_(h5tbdelete_field_c, H5TBDELETE_FIELD_C) -# define nh5tbget_table_info_c H5_FC_FUNC_(h5tbget_table_info_c, H5TBGET_TABLE_INFO_C) -# define nh5tbget_field_info_c H5_FC_FUNC_(h5tbget_field_info_c, H5TBGET_FIELD_INFO_C) +#define nh5tbmake_table_c H5_FC_FUNC_(h5tbmake_table_c, H5TBMAKE_TABLE_C) +#define nh5tbwrite_field_name_c H5_FC_FUNC_(h5tbwrite_field_name_c, H5TBWRITE_FIELD_NAME_C) +#define nh5tbwrite_field_name_int_c H5_FC_FUNC_(h5tbwrite_field_name_int_c, H5TBWRITE_FIELD_NAME_INT_C) +#define nh5tbwrite_field_name_fl_c H5_FC_FUNC_(h5tbwrite_field_name_fl_c, H5TBWRITE_FIELD_NAME_FL_C) +#define nh5tbwrite_field_name_dl_c H5_FC_FUNC_(h5tbwrite_field_name_dl_c, H5TBWRITE_FIELD_NAME_DL_C) +#define nh5tbwrite_field_name_st_c H5_FC_FUNC_(h5tbwrite_field_name_st_c, H5TBWRITE_FIELD_NAME_ST_C) +#define nh5tbread_field_name_c H5_FC_FUNC_(h5tbread_field_name_c, H5TBREAD_FIELD_NAME_C) +#define nh5tbread_field_name_int_c H5_FC_FUNC_(h5tbread_field_name_int_c, H5TBREAD_FIELD_NAME_INT_C) +#define nh5tbread_field_name_fl_c H5_FC_FUNC_(h5tbread_field_name_fl_c, H5TBREAD_FIELD_NAME_FL_C) +#define nh5tbread_field_name_dl_c H5_FC_FUNC_(h5tbread_field_name_dl_c, H5TBREAD_FIELD_NAME_DL_C) +#define nh5tbread_field_name_st_c H5_FC_FUNC_(h5tbread_field_name_st_c, H5TBREAD_FIELD_NAME_ST_C) +#define nh5tbwrite_field_index_c H5_FC_FUNC_(h5tbwrite_field_index_c, H5TBWRITE_FIELD_INDEX_C) +#define nh5tbwrite_field_index_int_c H5_FC_FUNC_(h5tbwrite_field_index_int_c, H5TBWRITE_FIELD_INDEX_INT_C) +#define nh5tbwrite_field_index_fl_c H5_FC_FUNC_(h5tbwrite_field_index_fl_c, H5TBWRITE_FIELD_INDEX_FL_C) +#define nh5tbwrite_field_index_dl_c H5_FC_FUNC_(h5tbwrite_field_index_dl_c, H5TBWRITE_FIELD_INDEX_DL_C) +#define nh5tbwrite_field_index_st_c H5_FC_FUNC_(h5tbwrite_field_index_st_c, H5TBWRITE_FIELD_INDEX_ST_C) +#define nh5tbread_field_index_c H5_FC_FUNC_(h5tbread_field_index_c, H5TBREAD_FIELD_INDEX_C) +#define nh5tbread_field_index_int_c H5_FC_FUNC_(h5tbread_field_index_int_c, H5TBREAD_FIELD_INDEX_INT_C) +#define nh5tbread_field_index_fl_c H5_FC_FUNC_(h5tbread_field_index_fl_c, H5TBREAD_FIELD_INDEX_FL_C) +#define nh5tbread_field_index_dl_c H5_FC_FUNC_(h5tbread_field_index_dl_c, H5TBREAD_FIELD_INDEX_DL_C) +#define nh5tbread_field_index_st_c H5_FC_FUNC_(h5tbread_field_index_st_c, H5TBREAD_FIELD_INDEX_ST_C) +#define nh5tbinsert_field_c H5_FC_FUNC_(h5tbinsert_field_c, H5TBINSERT_FIELD_C) +#define nh5tbinsert_field_int_c H5_FC_FUNC_(h5tbinsert_field_int_c, H5TBINSERT_FIELD_INT_C) +#define nh5tbinsert_field_fl_c H5_FC_FUNC_(h5tbinsert_field_fl_c, H5TBINSERT_FIELD_FL_C) +#define nh5tbinsert_field_dl_c H5_FC_FUNC_(h5tbinsert_field_dl_c, H5TBINSERT_FIELD_DL_C) +#define nh5tbinsert_field_st_c H5_FC_FUNC_(h5tbinsert_field_st_c, H5TBINSERT_FIELD_ST_C) +#define nh5tbdelete_field_c H5_FC_FUNC_(h5tbdelete_field_c, H5TBDELETE_FIELD_C) +#define nh5tbget_table_info_c H5_FC_FUNC_(h5tbget_table_info_c, H5TBGET_TABLE_INFO_C) +#define nh5tbget_field_info_c H5_FC_FUNC_(h5tbget_field_info_c, H5TBGET_FIELD_INFO_C) + +HDF5_HL_F90CSTUBDLL +int_f +nh5dsset_scale_c(hid_t_f *dsid, _fcd dimname, int_f *dimnamelen); + +HDF5_HL_F90CSTUBDLL +int_f +nh5dsattach_scale_c( hid_t_f *did, hid_t_f *dsid, int_f *idx); + +HDF5_HL_F90CSTUBDLL +int_f +nh5dsattach_scale_c( hid_t_f *did, hid_t_f *dsid, int_f *idx); + +HDF5_HL_F90CSTUBDLL +int_f +nh5dsdetach_scale_c( hid_t_f *did, hid_t_f *dsid, int_f *idx); + +HDF5_HL_F90CSTUBDLL +int_f +nh5dsis_attached_c( hid_t_f *did, hid_t_f *dsid, int_f *idx, int_f *c_is_attached); + +HDF5_HL_F90CSTUBDLL +int_f +nh5dsget_label_c(hid_t_f *did, int_f *idx, _fcd label, size_t_f *size); + +HDF5_HL_F90CSTUBDLL +int_f +nh5dsis_scale_c(hid_t_f *did, int_f *is_scale); + + +HDF5_HL_F90CSTUBDLL +int_f +nh5dsset_label_c(hid_t_f *did, int_f *idx, _fcd label, int_f *labellen); + +HDF5_HL_F90CSTUBDLL +int_f +nh5dsget_scale_name_c(hid_t_f *did, _fcd label, size_t_f *size); + +HDF5_HL_F90CSTUBDLL +int_f +nh5dsget_num_scales_c( hid_t_f *did, int_f *idx, int_f *num_scales); + HDF5_HL_F90CSTUBDLL int_f @@ -441,36 +498,6 @@ nh5ltmake_dataset_nint3_c (hid_t_f *loc_id, HDF5_HL_F90CSTUBDLL int_f -nh5ltmake_dataset_nint1_c (hid_t_f *loc_id, - int_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf); - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltmake_dataset_nint2_c (hid_t_f *loc_id, - int_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf); - -HDF5_HL_F90CSTUBDLL -int_f -nh5ltmake_dataset_nint3_c (hid_t_f *loc_id, - int_f *namelen, - _fcd name, - int_f *rank, - hsize_t_f *dims, - hid_t_f *type_id, - void *buf); - -HDF5_HL_F90CSTUBDLL -int_f nh5ltmake_dataset_nint4_c (hid_t_f *loc_id, int_f *namelen, _fcd name, @@ -1171,6 +1198,13 @@ nh5ltread_dataset_string_c (hid_t_f *loc_id, _fcd name, char *buf); +HDF5_HL_F90CSTUBDLL +int_f +nh5ltpath_valid_c(hid_t_f *loc_id, + _fcd path, + int_f *pathlen, + int_f *check_object_valid_c); + /*------------------------------------------------------------------------- * Image *------------------------------------------------------------------------- diff --git a/hl/fortran/src/H5LTfc.c b/hl/fortran/src/H5LTfc.c index 484acf1..c0b7695 100755 --- a/hl/fortran/src/H5LTfc.c +++ b/hl/fortran/src/H5LTfc.c @@ -2124,3 +2124,54 @@ done: return ret_value; } + +/*------------------------------------------------------------------------- +* Function: h5ltpath_valid_c +* +* Purpose: Calls h5ltpath_valid +* +* Return: Success: 0, Failure: -1 +* +* Programmer: M. Scot Breitenfeld +* +* Date: February 18, 2012 +* +* Comments: +* +* Modifications: +* +* +*------------------------------------------------------------------------- +*/ + +int_f +nh5ltpath_valid_c(hid_t_f *loc_id, + _fcd path, + int_f *pathlen, + int_f *check_object_valid_c) +{ + htri_t ret = -1; + char *c_path = NULL; + hbool_t check_object_valid; + + /* + * convert FORTRAN name to C name + */ + if( NULL == (c_path = (char *)HD5f2cstring(path, (int)*pathlen))) + goto done; + + check_object_valid = FALSE; + if(*check_object_valid_c == 1) + check_object_valid = TRUE; + + /* + * call H5LTpath_valid function. + */ + ret = H5LTpath_valid( (hid_t)*loc_id, c_path, check_object_valid ); + +done: + if(c_path != NULL) + free(c_path); + + return (int_f)ret; +} diff --git a/hl/fortran/src/H5LTff.f90 b/hl/fortran/src/H5LTff.f90 index cbc9b96..7d53ab7 100755 --- a/hl/fortran/src/H5LTff.f90 +++ b/hl/fortran/src/H5LTff.f90 @@ -6308,6 +6308,73 @@ CONTAINS errcode = h5ltget_attribute_info_c(loc_id,namelen,dset_name,attrlen,attr_name,dims,type_class,type_size) END SUBROUTINE h5ltget_attribute_info_f + + !------------------------------------------------------------------------- + ! Function: h5ltpath_valid_f + ! + ! Purpose: Validates a path + ! + ! Return: Success: 0, Failure: -1 + ! + ! Programmer: M. Scot Breitenfeld + ! + ! Date: February 18, 2012 + ! + ! Comments: + ! + ! Modifications: + ! + !------------------------------------------------------------------------- + + SUBROUTINE h5ltpath_valid_f(loc_id, path, check_object_valid, path_valid, errcode) + + IMPLICIT NONE + ! + !This definition is needed for Windows DLLs + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$attributes dllexport :: h5ltpath_valid_f + !DEC$endif + ! + INTEGER(hid_t) , INTENT(IN) :: loc_id ! File or group identifier. + CHARACTER(LEN=*), INTENT(IN) :: path ! Path to the object to check, relative to loc_id. + LOGICAL , INTENT(IN) :: check_object_valid ! Indicates whether to check if the final component + ! of the path resolves to a valid object + LOGICAL , INTENT(OUT) :: path_valid ! Object status + INTEGER , INTENT(OUT) :: errcode ! Error code: 0 on success and -1 on failure + + INTEGER :: pathlen + INTEGER :: check_object_valid_c + INTEGER :: status + + INTERFACE + INTEGER FUNCTION h5ltpath_valid_c(loc_id, path, pathlen, check_object_valid_c) + USE h5global + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTPATH_VALID_C'::h5ltpath_valid_c + !DEC$ENDIF + !DEC$ATTRIBUTES reference :: path + INTEGER(hid_t), INTENT(in) :: loc_id + CHARACTER(len=*), INTENT(in) :: path + INTEGER :: pathlen + INTEGER :: check_object_valid_c + END FUNCTION h5ltpath_valid_c + END INTERFACE + + check_object_valid_c = 0 + IF(check_object_valid) check_object_valid_c = 1 + + pathlen = LEN(path) + status = h5ltpath_valid_c(loc_id, path, pathlen, check_object_valid_c) + + path_valid = .FALSE. + errcode = 0 + IF(status.EQ.1)THEN + path_valid = .TRUE. + ELSE IF(status.LT.0)THEN + errcode = -1 + ENDIF + + END SUBROUTINE h5ltpath_valid_f ! end ! END MODULE H5LT diff --git a/hl/fortran/src/Makefile.am b/hl/fortran/src/Makefile.am index f872a63..9835196 100644 --- a/hl/fortran/src/Makefile.am +++ b/hl/fortran/src/Makefile.am @@ -46,8 +46,8 @@ endif #endif # List sources to include in the HDF5 HL Fortran library. -libhdf5hl_fortran_la_SOURCES=H5LTfc.c H5IMfc.c H5IMcc.c H5TBfc.c H5LTff.f90 \ - H5IMff.f90 H5TBff.f90 +libhdf5hl_fortran_la_SOURCES=H5DSfc.c H5LTfc.c H5IMfc.c H5IMcc.c H5TBfc.c \ + H5DSff.f90 H5LTff.f90 H5IMff.f90 H5TBff.f90 # HDF5 HL Fortran library depends on HDF5 HL Library and HDF5 Fortran Library. libhdf5hl_fortran_la_LIBADD=$(LIBH5_HL) $(LIBH5F) @@ -79,6 +79,7 @@ uninstall-local: # determining this automagically (like we do with the C files). So, when # doing a parallel make, some modules could be made way before the # modules they depend upon are actually made. *sigh* +H5DSff.lo: $(srcdir)/H5DSff.f90 H5LTff.lo: $(srcdir)/H5LTff.f90 H5IMff.lo: $(srcdir)/H5IMff.f90 H5TBff.lo: $(srcdir)/H5TBff.f90 diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in index 0c86820..4056a1b 100644 --- a/hl/fortran/src/Makefile.in +++ b/hl/fortran/src/Makefile.in @@ -94,8 +94,8 @@ am__base_list = \ am__installdirs = "$(DESTDIR)$(libdir)" LTLIBRARIES = $(lib_LTLIBRARIES) libhdf5hl_fortran_la_DEPENDENCIES = $(LIBH5_HL) $(LIBH5F) -am_libhdf5hl_fortran_la_OBJECTS = H5LTfc.lo H5IMfc.lo H5IMcc.lo \ - H5TBfc.lo H5LTff.lo H5IMff.lo H5TBff.lo +am_libhdf5hl_fortran_la_OBJECTS = H5DSfc.lo H5LTfc.lo H5IMfc.lo \ + H5IMcc.lo H5TBfc.lo H5DSff.lo H5LTff.lo H5IMff.lo H5TBff.lo libhdf5hl_fortran_la_OBJECTS = $(am_libhdf5hl_fortran_la_OBJECTS) AM_V_lt = $(am__v_lt_$(V)) am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) @@ -216,6 +216,7 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ +FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ @@ -236,10 +237,12 @@ H5_LONE_COLON = @H5_LONE_COLON@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ +HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ +HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ @@ -433,7 +436,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 = 71 +LT_VERS_REVISION = 101 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 @@ -451,8 +454,8 @@ libhdf5hl_fortran_la_LDFLAGS = -version-info $(LT_VERS_INTERFACE):$(LT_VERS_REVI #endif # List sources to include in the HDF5 HL Fortran library. -libhdf5hl_fortran_la_SOURCES = H5LTfc.c H5IMfc.c H5IMcc.c H5TBfc.c H5LTff.f90 \ - H5IMff.f90 H5TBff.f90 +libhdf5hl_fortran_la_SOURCES = H5DSfc.c H5LTfc.c H5IMfc.c H5IMcc.c H5TBfc.c \ + H5DSff.f90 H5LTff.f90 H5IMff.f90 H5TBff.f90 # HDF5 HL Fortran library depends on HDF5 HL Library and HDF5 Fortran Library. @@ -547,6 +550,7 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5DSfc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5IMcc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5IMfc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5LTfc.Plo@am__quote@ @@ -851,6 +855,7 @@ uninstall-local: # determining this automagically (like we do with the C files). So, when # doing a parallel make, some modules could be made way before the # modules they depend upon are actually made. *sigh* +H5DSff.lo: $(srcdir)/H5DSff.f90 H5LTff.lo: $(srcdir)/H5LTff.f90 H5IMff.lo: $(srcdir)/H5IMff.f90 H5TBff.lo: $(srcdir)/H5TBff.f90 diff --git a/hl/fortran/test/CMakeLists.txt b/hl/fortran/test/CMakeLists.txt index 0a91b85..c9b0533 100644 --- a/hl/fortran/test/CMakeLists.txt +++ b/hl/fortran/test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8) +cmake_minimum_required (VERSION 2.8.6) PROJECT (HDF5_HL_FORTRAN_TESTS C CXX Fortran) #----------------------------------------------------------------------------- @@ -20,12 +20,23 @@ ADD_TEST ( f1tab.h5 ) +#-- Adding test for hl_f90_tstds +ADD_EXECUTABLE (hl_f90_tstds tstds.f90) +TARGET_NAMING (hl_f90_tstds ${LIB_TYPE}) +TARGET_FORTRAN_WIN_PROPERTIES (hl_f90_tstds "") +TARGET_LINK_LIBRARIES (hl_f90_tstds ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET}) +SET_TARGET_PROPERTIES (hl_f90_tstds PROPERTIES LINKER_LANGUAGE Fortran) +SET_TARGET_PROPERTIES (hl_f90_tstds PROPERTIES FOLDER test/hl/fortran) + +ADD_TEST (NAME hl_f90_tstds COMMAND $) + #-- Adding test for hl_f90_tstlite ADD_EXECUTABLE (hl_f90_tstlite tstlite.f90) TARGET_NAMING (hl_f90_tstlite ${LIB_TYPE}) TARGET_FORTRAN_WIN_PROPERTIES (hl_f90_tstlite "") TARGET_LINK_LIBRARIES (hl_f90_tstlite ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET}) SET_TARGET_PROPERTIES (hl_f90_tstlite PROPERTIES LINKER_LANGUAGE Fortran) +SET_TARGET_PROPERTIES (hl_f90_tstlite PROPERTIES FOLDER test/hl/fortran) ADD_TEST (NAME hl_f90_tstlite COMMAND $) @@ -35,6 +46,7 @@ TARGET_NAMING (hl_f90_tstimage ${LIB_TYPE}) TARGET_FORTRAN_WIN_PROPERTIES (hl_f90_tstimage "") TARGET_LINK_LIBRARIES (hl_f90_tstimage ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET}) SET_TARGET_PROPERTIES (hl_f90_tstimage PROPERTIES LINKER_LANGUAGE Fortran) +SET_TARGET_PROPERTIES (hl_f90_tstimage PROPERTIES FOLDER test/hl/fortran) ADD_TEST (NAME hl_f90_tstimage COMMAND $) @@ -44,5 +56,6 @@ TARGET_NAMING (hl_f90_tsttable ${LIB_TYPE}) TARGET_FORTRAN_WIN_PROPERTIES (hl_f90_tsttable "") TARGET_LINK_LIBRARIES (hl_f90_tsttable ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET}) SET_TARGET_PROPERTIES (hl_f90_tsttable PROPERTIES LINKER_LANGUAGE Fortran) +SET_TARGET_PROPERTIES (hl_f90_tsttable PROPERTIES FOLDER test/hl/fortran) ADD_TEST (NAME hl_f90_tsttable COMMAND $) diff --git a/hl/fortran/test/Makefile.am b/hl/fortran/test/Makefile.am index 7f149c8..cd281b7 100644 --- a/hl/fortran/test/Makefile.am +++ b/hl/fortran/test/Makefile.am @@ -33,18 +33,19 @@ else endif # Our main target, the test programs -TEST_PROG=tstlite tstimage tsttable +TEST_PROG=tstds tstlite tstimage tsttable check_PROGRAMS=$(TEST_PROG) LDADD= $(LIBH5F_HL) $(LIBH5F) $(LIBH5_HL) $(LIBHDF5) # Source files for the programs +tstds_SOURCES=tstds.f90 tstlite_SOURCES=tstlite.f90 tstimage_SOURCES=tstimage.f90 tsttable_SOURCES=tsttable.f90 # Temporary files. -CHECK_CLEANFILES+=dsetf[1-4].h5 f1img.h5 f1tab.h5 +CHECK_CLEANFILES+=dsetf[1-4].h5 f1img.h5 f1tab.h5 tstds.h5 # Mark this directory as part of the Fortran API (this affects output # from tests in conclude.am) diff --git a/hl/fortran/test/Makefile.in b/hl/fortran/test/Makefile.in index 16e8b14..707a32d 100644 --- a/hl/fortran/test/Makefile.in +++ b/hl/fortran/test/Makefile.in @@ -69,14 +69,19 @@ mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/H5config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = -am__EXEEXT_1 = tstlite$(EXEEXT) tstimage$(EXEEXT) tsttable$(EXEEXT) +am__EXEEXT_1 = tstds$(EXEEXT) tstlite$(EXEEXT) tstimage$(EXEEXT) \ + tsttable$(EXEEXT) +am_tstds_OBJECTS = tstds.$(OBJEXT) +tstds_OBJECTS = $(am_tstds_OBJECTS) +tstds_LDADD = $(LDADD) +tstds_DEPENDENCIES = $(LIBH5F_HL) $(LIBH5F) $(LIBH5_HL) $(LIBHDF5) +AM_V_lt = $(am__v_lt_$(V)) +am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) +am__v_lt_0 = --silent am_tstimage_OBJECTS = tstimage.$(OBJEXT) tstimage_OBJECTS = $(am_tstimage_OBJECTS) tstimage_LDADD = $(LDADD) tstimage_DEPENDENCIES = $(LIBH5F_HL) $(LIBH5F) $(LIBH5_HL) $(LIBHDF5) -AM_V_lt = $(am__v_lt_$(V)) -am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) -am__v_lt_0 = --silent am_tstlite_OBJECTS = tstlite.$(OBJEXT) tstlite_OBJECTS = $(am_tstlite_OBJECTS) tstlite_LDADD = $(LDADD) @@ -105,8 +110,9 @@ am__v_FCLD_0 = @echo " FCLD " $@; AM_V_GEN = $(am__v_GEN_$(V)) am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) am__v_GEN_0 = @echo " GEN " $@; -SOURCES = $(tstimage_SOURCES) $(tstlite_SOURCES) $(tsttable_SOURCES) -DIST_SOURCES = $(tstimage_SOURCES) $(tstlite_SOURCES) \ +SOURCES = $(tstds_SOURCES) $(tstimage_SOURCES) $(tstlite_SOURCES) \ + $(tsttable_SOURCES) +DIST_SOURCES = $(tstds_SOURCES) $(tstimage_SOURCES) $(tstlite_SOURCES) \ $(tsttable_SOURCES) ETAGS = etags CTAGS = ctags @@ -182,6 +188,7 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ +FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ @@ -202,10 +209,12 @@ H5_LONE_COLON = @H5_LONE_COLON@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ +HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ +HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ @@ -397,13 +406,14 @@ TRACE = perl $(top_srcdir)/bin/trace # Temporary files. CHECK_CLEANFILES = *.chkexe *.chklog *.clog dsetf[1-4].h5 f1img.h5 \ - f1tab.h5 + f1tab.h5 tstds.h5 # Our main target, the test programs -TEST_PROG = tstlite tstimage tsttable +TEST_PROG = tstds tstlite tstimage tsttable LDADD = $(LIBH5F_HL) $(LIBH5F) $(LIBH5_HL) $(LIBHDF5) # Source files for the programs +tstds_SOURCES = tstds.f90 tstlite_SOURCES = tstlite.f90 tstimage_SOURCES = tstimage.f90 tsttable_SOURCES = tsttable.f90 @@ -470,6 +480,9 @@ clean-checkPROGRAMS: list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list +tstds$(EXEEXT): $(tstds_OBJECTS) $(tstds_DEPENDENCIES) + @rm -f tstds$(EXEEXT) + $(AM_V_FCLD)$(FCLINK) $(tstds_OBJECTS) $(tstds_LDADD) $(LIBS) tstimage$(EXEEXT): $(tstimage_OBJECTS) $(tstimage_DEPENDENCIES) @rm -f tstimage$(EXEEXT) $(AM_V_FCLD)$(FCLINK) $(tstimage_OBJECTS) $(tstimage_LDADD) $(LIBS) diff --git a/hl/fortran/test/tstds.f90 b/hl/fortran/test/tstds.f90 new file mode 100644 index 0000000..8817989 --- /dev/null +++ b/hl/fortran/test/tstds.f90 @@ -0,0 +1,347 @@ +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +! * 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. * +! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +PROGRAM test_ds + + IMPLICIT NONE + + INTEGER :: err + + CALL test_testds(err) + + IF(err.LT.0)THEN + WRITE(*,'(5X,A)') "DIMENSION SCALES TEST *FAILED*" + ENDIF + +END PROGRAM test_ds + +SUBROUTINE test_testds(err) + + USE HDF5 + USE H5LT + USE H5DS + + IMPLICIT NONE + + INTEGER, PARAMETER :: RANK = 2 ! rank of DATA dataset + INTEGER, PARAMETER :: DIM_DATA = 12 + INTEGER, PARAMETER :: DIM1_SIZE = 3 + INTEGER, PARAMETER :: DIM2_SIZE = 4 + INTEGER, PARAMETER :: DIM1 = 1 + INTEGER, PARAMETER :: DIM2 = 2 + INTEGER, PARAMETER :: FAILED = -1 + + CHARACTER(LEN=6), PARAMETER :: DSET_NAME = "Mydata" + CHARACTER(LEN=5), PARAMETER :: DS_1_NAME = "Yaxis" + CHARACTER(LEN=5), PARAMETER :: DS_1_NAME_A = "Yaxiz" + CHARACTER(LEN=5), PARAMETER :: DS_2_NAME = "Xaxis" + + + INTEGER(hid_t) :: fid ! file ID + INTEGER(hid_t) :: did ! dataset ID + INTEGER(hid_t) :: dsid ! DS dataset ID + INTEGER :: rankds = 1 ! rank of DS dataset + INTEGER(hsize_t), DIMENSION(1:rank) :: dims = (/DIM2_SIZE,DIM1_SIZE/) ! size of DATA dataset + INTEGER, DIMENSION(1:DIM_DATA) :: buf = (/1,2,3,4,5,6,7,8,9,10,11,12/) ! DATA of DATA dataset + INTEGER(hsize_t), DIMENSION(1:1) :: s1_dim = (/DIM1_SIZE/) ! size of DS 1 dataset + INTEGER(hsize_t), DIMENSION(1:1) :: s2_dim = (/DIM2_SIZE/) ! size of DS 2 dataset + REAL, DIMENSION(1:DIM1_SIZE) :: s1_wbuf = (/10,20,30/) ! DATA of DS 1 dataset + INTEGER, DIMENSION(1:DIM2_SIZE) :: s2_wbuf = (/10,20,50,100/) ! DATA of DS 2 dataset + INTEGER :: err + INTEGER :: num_scales + INTEGER(size_t) :: name_len + CHARACTER(LEN=80) :: name + INTEGER(size_t) :: label_len + CHARACTER(LEN=80) :: label + LOGICAL :: is_attached, is_scale + + ! + ! Initialize FORTRAN predefined datatypes. + ! + CALL h5open_f(err) + IF(err.LT.0) RETURN + + ! create a file using default properties + CALL H5Fcreate_f("tstds.h5",H5F_ACC_TRUNC_F, fid, err) + IF(err.LT.0) RETURN + + ! make a dataset + CALL H5LTmake_dataset_int_f(fid,DSET_NAME,rank,dims,buf, err) + IF(err.LT.0) RETURN + + ! make a DS dataset for the first dimension + CALL H5LTmake_dataset_float_f(fid,DS_1_NAME,rankds,s1_dim,s1_wbuf,err) + IF(err.LT.0) RETURN + + ! make a DS dataset for the second dimension + CALL H5LTmake_dataset_int_f(fid,DS_2_NAME,rankds,s2_dim,s2_wbuf,err) + IF(err.LT.0) RETURN + + !------------------------------------------------------------------------- + ! attach the DS_1_NAME dimension scale to DSET_NAME at dimension 1 + !------------------------------------------------------------------------- + + CALL test_begin(' Test Attaching Dimension Scale ') + + ! get the dataset id for DSET_NAME + CALL H5Dopen_f(fid, DSET_NAME, did, err) + IF(err.LT.0) RETURN + + ! get the DS dataset id + CALL H5Dopen_f(fid, DS_1_NAME, dsid, err) + IF(err.LT.0) RETURN + + ! check attaching to a non-existent dimension; should fail + CALL H5DSattach_scale_f(did, dsid, 20, err) + IF(err.NE.-1) THEN + err = FAILED ! should fail, mark as an error + CALL write_test_status(err) + RETURN + ENDIF + + ! attach the DS_1_NAME dimension scale to DSET_NAME at dimension index 1 + CALL H5DSattach_scale_f(did, dsid, DIM1, err) + IF(err.EQ.-1) THEN + CALL write_test_status(err) + RETURN + ENDIF + CALL write_test_status(err) + + CALL test_begin(' Test If Dimension Scale Attached ') + + CALL H5DSis_attached_f(did, dsid, DIM1, is_attached, err) + IF(err.EQ.-1.OR..NOT.is_attached) THEN + err = FAILED + CALL write_test_status(err) + RETURN + ENDIF + CALL write_test_status(err) + + ! Check to see how many Dimension Scales are attached + + CALL test_begin(' Test Getting Number Dimension Scales ') + + CALL H5DSget_num_scales_f(did, DIM1, num_scales, err) + IF(err.LT.0.OR.num_scales.NE.1)THEN + err = FAILED + CALL write_test_status(err) + RETURN + ENDIF + CALL write_test_status(err) + + CALL test_begin(' Test Detaching Dimension Scale ') + + ! Detach scale + CALL H5DSdetach_scale_f(did, dsid, DIM1, err) + IF(err.LT.0) RETURN + + ! Check to see if a dimension scale is attached, should be .false. + CALL H5DSis_attached_f(did, dsid, DIM1, is_attached, err) + IF(err.LT.0.OR.is_attached)THEN + err = FAILED + CALL write_test_status(err) + RETURN + ENDIF + CALL write_test_status(err) + + !------------------------------------------------------------------------- + ! set the DS_1_NAME dimension scale to DSET_NAME at dimension 0 + !------------------------------------------------------------------------- + + CALL test_begin(' Test Setting Dimension Scale ') + + CALL H5DSset_scale_f(dsid, err, "Dimension Scale Set 1") + IF(err.LT.0.OR.is_attached)THEN + err = FAILED + CALL write_test_status(err) + RETURN + ENDIF + CALL write_test_status(err) + + CALL test_begin(' Test If Dimension Scale ') + + CALL H5DSis_scale_f(dsid, is_scale, err) + IF(err.LT.0.OR..NOT.is_scale)THEN + err = FAILED + CALL write_test_status(err) + RETURN + ENDIF + CALL write_test_status(err) + + ! Get scale name; test to large character buffer + + CALL test_begin(' Test Getting Dimension Scale By Name ') + + name_len = 25 + name = '' + CALL H5DSget_scale_name_f(dsid, name, name_len, err) + IF(err.LT.0.OR.name_len.NE.21.OR.TRIM(name).NE."Dimension Scale Set 1")THEN + err = FAILED + CALL write_test_status(err) + RETURN + ENDIF + + ! Get scale name; test exact size character buffer + name_len = 21 + name = '' + CALL H5DSget_scale_name_f(dsid, name(1:name_len), name_len, err) + IF(err.LT.0.OR.name_len.NE.21.OR.TRIM(name).NE."Dimension Scale Set 1")THEN + err = FAILED + CALL write_test_status(err) + RETURN + ENDIF + + ! Get scale name; test to small character buffer + name_len = 5 + name = '' + CALL H5DSget_scale_name_f(dsid, name(1:name_len), name_len, err) + IF(err.LT.0.OR.name_len.NE.21.OR.TRIM(name).NE."Dimen")THEN + err = FAILED + CALL write_test_status(err) + RETURN + ENDIF + + ! close DS id + CALL H5Dclose_f(dsid, err) + IF(err.LT.0) RETURN + + !------------------------------------------------------------------------- + ! attach the DS_2_NAME dimension scale to DSET_NAME + !------------------------------------------------------------------------- + + ! get the DS dataset id + CALL H5Dopen_f(fid, DS_2_NAME, dsid, err) + IF(err.LT.0) RETURN + + ! attach the DS_2_NAME dimension scale to DSET_NAME as the 2nd dimension (index 2) + CALL H5DSattach_scale_f(did, dsid, DIM2, err) + IF(err.LT.0) RETURN + + CALL H5DSis_attached_f(did, dsid, DIM2, is_attached, err) + IF(err.LT.0) RETURN + + ! test sending no Dimension Scale name + + CALL H5DSset_scale_f(dsid, err) + IF(err.LT.0)THEN + CALL write_test_status(err) + RETURN + ENDIF + + CALL H5DSis_scale_f(dsid, is_scale, err) + IF(err.LT.0.OR..NOT.is_scale)THEN + err = FAILED + CALL write_test_status(err) + RETURN + ENDIF + + ! Get scale name when there is no scale name + name_len = 5 + name = '' + CALL H5DSget_scale_name_f(dsid, name(1:name_len), name_len, err) + IF(err.LT.0.OR.name_len.NE.0)THEN ! name_len is 0 if no name is found + err = FAILED + CALL write_test_status(err) + RETURN + ENDIF + + CALL write_test_status(err) + + CALL test_begin(' Test Setting Dimension Scale Label ') + + CALL H5DSset_label_f(did, DIM2, "Label12", err) + IF(err.LT.0)THEN + CALL write_test_status(err) + RETURN + ENDIF + + ! Test label where character length is to small + + label_len = 5 + label = '' + CALL H5DSget_label_f(did, DIM2, label(1:label_len), label_len, err) + IF(err.LT.0.OR.label(1:5).NE."Label".OR.label_len.NE.7)THEN + err = FAILED + CALL write_test_status(err) + RETURN + ENDIF + + ! Test label where character length is exact + + label_len = 7 + label = '' + CALL H5DSget_label_f(did, DIM2, label(1:label_len), label_len, err) + IF(err.LT.0.OR.label(1:label_len).NE."Label12".OR.label_len.NE.7)THEN + err = FAILED + CALL write_test_status(err) + RETURN + ENDIF + + ! Test label where character length is to big + + label_len = 25 + label = '' + CALL H5DSget_label_f(did, DIM2, label, label_len, err) + IF(err.LT.0.OR.label(1:label_len).NE."Label12".OR.label_len.NE.7)THEN + err = FAILED + CALL write_test_status(err) + RETURN + ENDIF + CALL write_test_status(err) + + ! close DS id + CALL H5Dclose_f(dsid, err) + IF(err.LT.0) RETURN + + ! close file + CALL H5Fclose_f(fid, err) + IF(err.LT.0) RETURN + +END SUBROUTINE test_testds + +!------------------------------------------------------------------------- +! test_begin +!------------------------------------------------------------------------- + +SUBROUTINE test_begin(string) + CHARACTER(LEN=*), INTENT(IN) :: string + WRITE(*, fmt = '(A)', advance = 'no') ADJUSTL(string) +END SUBROUTINE test_begin + +!------------------------------------------------------------------------- +! passed/failed +!------------------------------------------------------------------------- +SUBROUTINE write_test_status( test_result) + +! Writes the results of the tests + + IMPLICIT NONE + + INTEGER, INTENT(IN) :: test_result ! negative, failed + ! 0 , passed + +! Controls the output style for reporting test results + + CHARACTER(LEN=8) :: error_string + CHARACTER(LEN=8), PARAMETER :: success = ' PASSED ' + CHARACTER(LEN=8), PARAMETER :: failure = '*FAILED*' + + error_string = failure + IF (test_result .EQ. 0) THEN + error_string = success + ENDIF + + WRITE(*, fmt = '(T34, A)') error_string + +END SUBROUTINE write_test_status diff --git a/hl/fortran/test/tstlite.f90 b/hl/fortran/test/tstlite.f90 index b0e28f9..9329dba 100644 --- a/hl/fortran/test/tstlite.f90 +++ b/hl/fortran/test/tstlite.f90 @@ -1067,6 +1067,9 @@ SUBROUTINE test_datasets() INTEGER :: has ! general purpose integer INTEGER :: type_class INTEGER(SIZE_T) :: type_size + LOGICAL :: path_valid ! status of the path + CHARACTER(LEN=6) :: chr_exact + CHARACTER(LEN=8) :: chr_lg ! ! Initialize FORTRAN predefined datatypes. @@ -1118,6 +1121,7 @@ SUBROUTINE test_datasets() CALL passed() + !------------------------------------------------------------------------- ! real !------------------------------------------------------------------------- @@ -1207,9 +1211,60 @@ SUBROUTINE test_datasets() CALL passed() + CALL test_begin(' Test h5ltpath_valid_f ') + ! + ! test function h5ltpath_valid_f + ! + chr_exact = "/"//dsetname2 ! test character buffer the exact size needed + CALL h5ltpath_valid_f(file_id, chr_exact, .TRUE., path_valid, errcode) + IF(errcode.LT.0.OR..NOT.path_valid)THEN + PRINT *, 'error in h5ltpath_valid_f' + STOP + ENDIF + chr_lg = "/"//dsetname2 ! test character buffer larger then needed + CALL h5ltpath_valid_f(file_id, chr_lg, .TRUE., path_valid, errcode) + IF(errcode.LT.0.OR..NOT.path_valid)THEN + PRINT *, 'error in h5ltpath_valid_f' + STOP + ENDIF + CALL h5ltpath_valid_f(file_id, chr_lg, .FALSE., path_valid, errcode) + IF(errcode.LT.0.OR..NOT.path_valid)THEN + PRINT *, 'error in h5ltpath_valid_f' + STOP + ENDIF + ! Should fail, dataset does not exist + CALL h5ltpath_valid_f(file_id, "/"//dsetname2//"junk", .TRUE., path_valid, errcode) + IF(errcode.LT.0.OR.path_valid)THEN + PRINT *, 'error in h5ltpath_valid_f' + STOP + ENDIF + + CALL h5ltpath_valid_f(file_id, "/"//dsetname2//"junk", .FALSE., path_valid, errcode) + IF(errcode.LT.0.OR.path_valid)THEN + PRINT *, 'error in h5ltpath_valid_f' + STOP + ENDIF + + ! Create a dangling soft link + CALL h5lcreate_soft_f("/G2", file_id, "/G3", errcode) + + ! Should pass, does not check for dangled link + CALL h5ltpath_valid_f(file_id, "/G3", .FALSE., path_valid, errcode) + IF(.NOT.path_valid)THEN + PRINT *, 'error in h5ltpath_valid_f' + STOP + ENDIF + + ! Should fail, dangled link + CALL h5ltpath_valid_f(file_id, "/G2", .TRUE., path_valid, errcode) + IF(path_valid)THEN + PRINT *, 'error in h5ltpath_valid_f' + STOP + ENDIF + CALL passed() CALL test_begin(' Get dataset dimensions/info ') @@ -1296,6 +1351,8 @@ SUBROUTINE test_attributes() CHARACTER(LEN=5), PARAMETER :: attrname5 = "attr5" ! Attribute name CHARACTER(LEN=8), PARAMETER :: buf1 = "mystring" ! Data buffer CHARACTER(LEN=8) :: bufr1 ! Data buffer + CHARACTER(LEN=10) :: bufr1_lg ! Data buffer + CHARACTER(LEN=6) :: bufr1_sm ! Data buffer INTEGER, DIMENSION(DIM1) :: buf2 ! Data buffer INTEGER, DIMENSION(DIM1) :: bufr2 ! Data buffer REAL, DIMENSION(DIM1) :: buf3 ! Data buffer @@ -1446,20 +1503,46 @@ SUBROUTINE test_attributes() CALL h5ltset_attribute_string_f(file_id,dsetname1,attrname5,buf1,errcode) ! - ! read attribute. + ! read attribute into a fortran character buf that is the same size as buf1. ! CALL h5ltget_attribute_string_f(file_id,dsetname1,attrname5,bufr1,errcode) ! ! compare read and write buffers. ! - IF ( buf1 .NE. bufr1 ) THEN PRINT *, 'read buffer differs from write buffer' PRINT *, buf1, ' and ', bufr1 STOP ENDIF + ! + ! read attribute into a fortran character buf that is larger then buf1. + ! + CALL h5ltget_attribute_string_f(file_id,dsetname1,attrname5,bufr1_lg,errcode) + + ! + ! compare read and write buffers, make sure C NULL character was removed. + ! + IF ( buf1(1:8) .NE. bufr1_lg(1:8) .AND. bufr1_lg(9:10) .NE. ' ' ) THEN + PRINT *, 'larger read buffer differs from write buffer' + PRINT *, buf1, ' and ', bufr1_lg + STOP + ENDIF + + ! + ! read attribute into a fortran character buf that is smaller then buf1. + ! + CALL h5ltget_attribute_string_f(file_id,dsetname1,attrname5,bufr1_sm,errcode) + + ! + ! compare read and write buffers. + ! + IF ( buf1(1:6) .NE. bufr1_sm(1:6) ) THEN + PRINT *, 'smaller read buffer differs from write buffer' + PRINT *, buf1, ' and ', bufr1_sm + STOP + ENDIF CALL passed() diff --git a/hl/src/CMakeLists.txt b/hl/src/CMakeLists.txt index 11f6273..f144b94 100644 --- a/hl/src/CMakeLists.txt +++ b/hl/src/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8) +cmake_minimum_required (VERSION 2.8.6) PROJECT (HDF5_HL_SRC) #----------------------------------------------------------------------------- @@ -34,10 +34,10 @@ SET (HL_HEADERS ) ADD_LIBRARY (${HDF5_HL_LIB_TARGET} ${LIB_TYPE} ${HL_SRCS} ${HL_HEADERS}) -SET_TARGET_PROPERTIES(${HDF5_HL_LIB_TARGET} PROPERTIES DEFINE_SYMBOL ${HDF5_HL_LIB_CORENAME}_EXPORTS) TARGET_LINK_LIBRARIES (${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET}) SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_LIB_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_HL_LIB_TARGET} ${HDF5_HL_LIB_NAME} ${LIB_TYPE}) +SET_TARGET_PROPERTIES (${HDF5_HL_LIB_TARGET} PROPERTIES FOLDER libraries/hl) #----------------------------------------------------------------------------- # Add file(s) to CMake Install diff --git a/hl/src/H5DS.c b/hl/src/H5DS.c index 432a725..e9ea9cf 100644 --- a/hl/src/H5DS.c +++ b/hl/src/H5DS.c @@ -318,7 +318,7 @@ herr_t H5DSattach_scale(hid_t did, ref_j = ((hobj_ref_t *)buf[idx].p)[i]; /* get the scale id for this REF */ - if((dsid_j = H5Rdereference(did,H5R_OBJECT,&ref_j)) < 0) + if((dsid_j = H5Rdereference2(did, H5P_DEFAULT, H5R_OBJECT, &ref_j)) < 0) goto out; /* get info for DS in the parameter list */ @@ -690,7 +690,7 @@ herr_t H5DSdetach_scale(hid_t did, ref = ((hobj_ref_t *)buf[idx].p)[j]; /* get the DS id */ - if ((dsid_j = H5Rdereference(did,H5R_OBJECT,&ref)) < 0) + if ((dsid_j = H5Rdereference2(did,H5P_DEFAULT,H5R_OBJECT,&ref)) < 0) goto out; /* get info for this DS */ @@ -800,7 +800,7 @@ herr_t H5DSdetach_scale(hid_t did, ref = dsbuf[ii].ref; /* get the dataset id */ - if ((did_i = H5Rdereference(did,H5R_OBJECT,&ref)) < 0) + if ((did_i = H5Rdereference2(did,H5P_DEFAULT,H5R_OBJECT,&ref)) < 0) goto out; /* get info for this dataset */ @@ -813,10 +813,8 @@ herr_t H5DSdetach_scale(hid_t did, /* same object, reset. we want to detach only for this DIM */ if(did_oi.fileno == tmp_oi.fileno && did_oi.addr == tmp_oi.addr) { - /* if we found not the last one, copy the last one to replace - the one which is found */ - if(i < nelmts-1) - dsbuf[ii] = dsbuf[nelmts-1]; + /* copy the last one to replace the one which is found */ + dsbuf[ii] = dsbuf[nelmts-1]; nelmts--; found_dset=1; break; @@ -1050,7 +1048,7 @@ htri_t H5DSis_attached(hid_t did, ref = ((hobj_ref_t *)buf[idx].p)[i]; /* get the scale id for this REF */ - if ((dsid_j = H5Rdereference(did,H5R_OBJECT,&ref)) < 0) + if ((dsid_j = H5Rdereference2(did,H5P_DEFAULT,H5R_OBJECT,&ref)) < 0) goto out; /* get info for DS in the parameter list */ @@ -1140,7 +1138,7 @@ htri_t H5DSis_attached(hid_t did, if (ref) { /* get the dataset id */ - if ((did_i = H5Rdereference(did,H5R_OBJECT,&ref)) < 0) + if ((did_i = H5Rdereference2(did,H5P_DEFAULT,H5R_OBJECT,&ref)) < 0) goto out; /* get info for dataset in the parameter list */ @@ -1344,7 +1342,7 @@ herr_t H5DSiterate_scales(hid_t did, /* disable error reporting, the ID might refer to a deleted dataset */ H5E_BEGIN_TRY { /* get the DS id */ - if ((scale_id = H5Rdereference(did,H5R_OBJECT,&ref)) < 0) + if ((scale_id = H5Rdereference2(did,H5P_DEFAULT,H5R_OBJECT,&ref)) < 0) goto out; } H5E_END_TRY; @@ -1619,6 +1617,8 @@ out: * Comments: * * Modifications: +* JIRA HDFFV-7673: Added a check to see if the label name exists, +* if not then returns zero. July 30, 2011. MSB * *------------------------------------------------------------------------- */ @@ -1631,7 +1631,7 @@ ssize_t H5DSget_label(hid_t did, unsigned int idx, char *label, size_t size) 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 nbytes = 0; size_t copy_len; int i; @@ -1687,6 +1687,7 @@ ssize_t H5DSget_label(hid_t did, unsigned int idx, char *label, size_t size) if ((aid = H5Aopen(did, DIMENSION_LABELS, H5P_DEFAULT)) < 0) goto out; + if ((tid = H5Aget_type(aid)) < 0) goto out; @@ -1700,26 +1701,30 @@ ssize_t H5DSget_label(hid_t did, unsigned int idx, char *label, size_t size) if (H5Aread(aid, tid, buf) < 0) goto out; - /* get the real string length */ - nbytes = strlen(buf[idx]); + /* do only if the label name exists for the dimension */ + if (buf[idx] != NULL) + { + /* get the real string length */ + nbytes = strlen(buf[idx]); - /* compute the string length which will fit into the user's buffer */ - copy_len = MIN(size-1, nbytes); + /* compute the string length which will fit into the user's buffer */ + copy_len = MIN(size-1, nbytes); - /* copy all/some of the name */ - if (label) - { - memcpy(label, buf[idx], copy_len); + /* copy all/some of the name */ + if (label) + { + memcpy(label, buf[idx], copy_len); + + /* terminate the string */ + label[copy_len] = '\0'; + } - /* terminate the string */ - label[copy_len] = '\0'; } - /* free all the ptr's from the H5Aread() */ for (i = 0; i < rank; i++) { if (buf[i]) - free(buf[i]); + free(buf[i]); } /* close */ diff --git a/hl/src/H5IM.c b/hl/src/H5IM.c index 11f4014..93d2b3f 100644 --- a/hl/src/H5IM.c +++ b/hl/src/H5IM.c @@ -905,7 +905,7 @@ herr_t H5IMget_palette_info( hid_t loc_id, goto out; /* Get the actual palette */ - if ( (pal_id = H5Rdereference( did, H5R_OBJECT, &refbuf[pal_number] )) < 0) + if ( (pal_id = H5Rdereference2(did, H5P_DEFAULT, H5R_OBJECT, &refbuf[pal_number])) < 0) goto out; if ( (pal_space_id = H5Dget_space( pal_id )) < 0) @@ -1016,7 +1016,7 @@ herr_t H5IMget_palette( hid_t loc_id, goto out; /* Get the palette id */ - if ( (pal_id = H5Rdereference( did, H5R_OBJECT, &refbuf[pal_number] )) < 0) + if ( (pal_id = H5Rdereference2(did, H5P_DEFAULT, H5R_OBJECT, &refbuf[pal_number])) < 0) goto out; /* Read the palette dataset */ diff --git a/hl/src/H5LT.c b/hl/src/H5LT.c index 22bb97f..eeaceeb 100644 --- a/hl/src/H5LT.c +++ b/hl/src/H5LT.c @@ -18,16 +18,17 @@ #include #include #include "H5LTprivate.h" - +#include "H5private.h" /* For Lex and Yacc */ #define COL 3 #define LIMIT 512 #define INCREMENT 1024 +#define TMP_LEN 256 #define MAX(a,b) (((a)>(b)) ? (a) : (b)) int input_len; char *myinput; -int indent = 0; +size_t indent = 0; @@ -1572,9 +1573,6 @@ out: } - - - /*------------------------------------------------------------------------- * Function: H5LTtext_to_dtype * @@ -1621,6 +1619,47 @@ out: } /*------------------------------------------------------------------------- +* Function: realloc_and_append +* +* Purpose: Expand the buffer and append a string to it. +* +* Return: void +* +* Programmer: Raymond Lu, songyulu@hdfgroup.org +* +* Date: 29 September 2011 +* +* Modifications: +* +*------------------------------------------------------------------------- +*/ +static char* +realloc_and_append(hbool_t _no_user_buf, size_t *len, char *buf, char *str_to_add) +{ + if(_no_user_buf) { + /* If the buffer isn't big enough, reallocate it. Otherwise, go to do strcat. */ + if(str_to_add && ((ssize_t)(*len - (strlen(buf) + strlen(str_to_add) + 1)) < LIMIT)) { + *len += ((strlen(buf) + strlen(str_to_add) + 1) / INCREMENT + 1) * INCREMENT; + buf = (char*)realloc(buf, *len); + } else if(!str_to_add && ((ssize_t)(*len - strlen(buf) - 1) < LIMIT)) { + *len += INCREMENT; + buf = (char*)realloc(buf, *len); + } + } + + if(!buf) + goto out; + + if(str_to_add) + strcat(buf, str_to_add); + + return buf; + +out: + return NULL; +} + +/*------------------------------------------------------------------------- * Function: indentation * * Purpose: Print spaces for indentation @@ -1635,16 +1674,24 @@ out: * *------------------------------------------------------------------------- */ -static void -indentation(int x, char* str) +static char* +indentation(size_t x, char* str, hbool_t no_u_buf, size_t *s_len) { + char tmp_str[TMP_LEN]; + if (x < 80) { - while (x-- > 0) - strcat(str, " "); - } else { - strcat(str, "error: the indentation exceeds the number of cols."); - exit(1); - } + memset(tmp_str, ' ', x); + tmp_str[x]='\0'; + } else + HDsnprintf(tmp_str, TMP_LEN, "error: the indentation exceeds the number of cols."); + + if(!(str = realloc_and_append(no_u_buf, s_len, str, tmp_str))) + goto out; + + return str; + +out: + return NULL; } /*------------------------------------------------------------------------- @@ -1659,21 +1706,20 @@ indentation(int x, char* str) * Modifications: * *-----------------------------------------------------------------------*/ -static herr_t -print_enum(hid_t type, char* str, int indt) +static char* +print_enum(hid_t type, char* str, size_t *str_len, hbool_t no_ubuf, size_t indt) { char **name = NULL; /*member names */ unsigned char *value = NULL; /*value array */ unsigned char *copy = NULL; /*a pointer to value array */ int nmembs; /*number of members */ - char tmp_str[256]; + char tmp_str[TMP_LEN]; int nchars; /*number of output characters */ hid_t super = -1; /*enum base integer type */ hid_t native = -1; /*native integer data type */ size_t super_size; /*enum base type size */ size_t dst_size; /*destination value type size */ int i; - herr_t ret = SUCCEED; if((nmembs = H5Tget_nmembers(type))==0) goto out; @@ -1718,27 +1764,28 @@ print_enum(hid_t type, char* str, int indt) /* Print members */ for (i = 0; i < nmembs; i++) { - indentation(indt + COL, str); - nchars = sprintf(tmp_str, "\"%s\"", name[i]); - strcat(str, tmp_str); - 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))); - 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))); - strcat(str, tmp_str); - } + if(!(str = indentation(indt + COL, str, no_ubuf, str_len))) + goto out; + nchars = HDsnprintf(tmp_str, TMP_LEN, "\"%s\"", name[i]); + if(!(str = realloc_and_append(no_ubuf, str_len, str, tmp_str))) + goto out; + HDsnprintf(tmp_str, TMP_LEN, "%*s ", MAX(0, 16 - nchars), ""); + if(!(str = realloc_and_append(no_ubuf, str_len, str, tmp_str))) + goto out; + + /*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; + if (H5T_SGN_NONE == H5Tget_sign(native)) + HDsnprintf(tmp_str, TMP_LEN, "%u", *((unsigned int*)((void *)copy))); + else + HDsnprintf(tmp_str, TMP_LEN, "%d", *((int*)((void *)copy))); + if(!(str = realloc_and_append(no_ubuf, str_len, str, tmp_str))) + goto out; - strcat(str, ";\n"); + HDsnprintf(tmp_str, TMP_LEN, ";\n"); + if(!(str = realloc_and_append(no_ubuf, str_len, str, tmp_str))) + goto out; } /* Release resources */ @@ -1749,13 +1796,13 @@ print_enum(hid_t type, char* str, int indt) free(value); H5Tclose(super); - return ret; + return str; out: if(0 == nmembs) { - sprintf(tmp_str, "\n%*s ", indt + 4, ""); - strcat(str, tmp_str); + HDsnprintf(tmp_str, TMP_LEN, "\n%*s ", indt + 4, ""); + str = realloc_and_append(no_ubuf, str_len, str, tmp_str); } /* end if */ /* Release resources */ @@ -1772,7 +1819,7 @@ out: if(super >= 0) H5Tclose(super); - return FAIL; + return NULL; } /*------------------------------------------------------------------------- @@ -1796,7 +1843,7 @@ herr_t H5LTdtype_to_text(hid_t dtype, char *str, H5LT_lang_t lang_type, size_t * { size_t str_len = INCREMENT; char *text_str; - herr_t ret = -1; + herr_t ret = SUCCEED; if(lang_type <= H5LT_LANG_ERR || lang_type >= H5LT_NO_LANG) goto out; @@ -1804,12 +1851,14 @@ herr_t H5LTdtype_to_text(hid_t dtype, char *str, H5LT_lang_t lang_type, size_t * if(len && !str) { text_str = (char*)calloc(str_len, sizeof(char)); text_str[0]='\0'; - if((ret = H5LT_dtype_to_text(dtype, &text_str, lang_type, &str_len, 1)) < 0) + if(!(text_str = H5LT_dtype_to_text(dtype, text_str, lang_type, &str_len, 1))) goto out; *len = strlen(text_str) + 1; - free(text_str); + if(text_str) + free(text_str); + text_str = NULL; } else if(len && str) { - if((ret = H5LT_dtype_to_text(dtype, &str, lang_type, len, 0)) < 0) + if(!(H5LT_dtype_to_text(dtype, str, lang_type, len, 0))) goto out; str[*len-1] = '\0'; } @@ -1837,26 +1886,18 @@ out: * *------------------------------------------------------------------------- */ -herr_t H5LT_dtype_to_text(hid_t dtype, char **dt_str, H5LT_lang_t lang, size_t *slen, +char* H5LT_dtype_to_text(hid_t dtype, char *dt_str, H5LT_lang_t lang, size_t *slen, hbool_t no_user_buf) { H5T_class_t tcls; - char tmp_str[256]; - char *tmp; + char tmp_str[TMP_LEN]; int i; - herr_t ret = SUCCEED; - - if(no_user_buf && ((*slen - strlen(*dt_str)) < LIMIT)) { - *slen += INCREMENT; - tmp = (char*)realloc(*dt_str, *slen); - if(tmp != *dt_str) { - free(*dt_str); - *dt_str = tmp; - } - } + if(!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, NULL))) + goto out; + if(lang != H5LT_DDL) { - sprintf(*dt_str, "only DDL is supported for now"); + HDsnprintf(dt_str, *slen, "only DDL is supported for now"); goto out; } @@ -1866,81 +1907,81 @@ herr_t H5LT_dtype_to_text(hid_t dtype, char **dt_str, H5LT_lang_t lang, size_t * switch (tcls) { case H5T_INTEGER: if (H5Tequal(dtype, H5T_STD_I8BE)) { - sprintf(*dt_str, "H5T_STD_I8BE"); + HDsnprintf(dt_str, *slen, "H5T_STD_I8BE"); } else if (H5Tequal(dtype, H5T_STD_I8LE)) { - sprintf(*dt_str, "H5T_STD_I8LE"); + HDsnprintf(dt_str, *slen, "H5T_STD_I8LE"); } else if (H5Tequal(dtype, H5T_STD_I16BE)) { - sprintf(*dt_str, "H5T_STD_I16BE"); + HDsnprintf(dt_str, *slen, "H5T_STD_I16BE"); } else if (H5Tequal(dtype, H5T_STD_I16LE)) { - sprintf(*dt_str, "H5T_STD_I16LE"); + HDsnprintf(dt_str, *slen, "H5T_STD_I16LE"); } else if (H5Tequal(dtype, H5T_STD_I32BE)) { - sprintf(*dt_str, "H5T_STD_I32BE"); + HDsnprintf(dt_str, *slen, "H5T_STD_I32BE"); } else if (H5Tequal(dtype, H5T_STD_I32LE)) { - sprintf(*dt_str, "H5T_STD_I32LE"); + HDsnprintf(dt_str, *slen, "H5T_STD_I32LE"); } else if (H5Tequal(dtype, H5T_STD_I64BE)) { - sprintf(*dt_str, "H5T_STD_I64BE"); + HDsnprintf(dt_str, *slen, "H5T_STD_I64BE"); } else if (H5Tequal(dtype, H5T_STD_I64LE)) { - sprintf(*dt_str, "H5T_STD_I64LE"); + HDsnprintf(dt_str, *slen, "H5T_STD_I64LE"); } else if (H5Tequal(dtype, H5T_STD_U8BE)) { - sprintf(*dt_str, "H5T_STD_U8BE"); + HDsnprintf(dt_str, *slen, "H5T_STD_U8BE"); } else if (H5Tequal(dtype, H5T_STD_U8LE)) { - sprintf(*dt_str, "H5T_STD_U8LE"); + HDsnprintf(dt_str, *slen, "H5T_STD_U8LE"); } else if (H5Tequal(dtype, H5T_STD_U16BE)) { - sprintf(*dt_str, "H5T_STD_U16BE"); + HDsnprintf(dt_str, *slen, "H5T_STD_U16BE"); } else if (H5Tequal(dtype, H5T_STD_U16LE)) { - sprintf(*dt_str, "H5T_STD_U16LE"); + HDsnprintf(dt_str, *slen, "H5T_STD_U16LE"); } else if (H5Tequal(dtype, H5T_STD_U32BE)) { - sprintf(*dt_str, "H5T_STD_U32BE"); + HDsnprintf(dt_str, *slen, "H5T_STD_U32BE"); } else if (H5Tequal(dtype, H5T_STD_U32LE)) { - sprintf(*dt_str, "H5T_STD_U32LE"); + HDsnprintf(dt_str, *slen, "H5T_STD_U32LE"); } else if (H5Tequal(dtype, H5T_STD_U64BE)) { - sprintf(*dt_str, "H5T_STD_U64BE"); + HDsnprintf(dt_str, *slen, "H5T_STD_U64BE"); } else if (H5Tequal(dtype, H5T_STD_U64LE)) { - sprintf(*dt_str, "H5T_STD_U64LE"); + HDsnprintf(dt_str, *slen, "H5T_STD_U64LE"); } else if (H5Tequal(dtype, H5T_NATIVE_SCHAR)) { - sprintf(*dt_str, "H5T_NATIVE_SCHAR"); + HDsnprintf(dt_str, *slen, "H5T_NATIVE_SCHAR"); } else if (H5Tequal(dtype, H5T_NATIVE_UCHAR)) { - sprintf(*dt_str, "H5T_NATIVE_UCHAR"); + HDsnprintf(dt_str, *slen, "H5T_NATIVE_UCHAR"); } else if (H5Tequal(dtype, H5T_NATIVE_SHORT)) { - sprintf(*dt_str, "H5T_NATIVE_SHORT"); + HDsnprintf(dt_str, *slen, "H5T_NATIVE_SHORT"); } else if (H5Tequal(dtype, H5T_NATIVE_USHORT)) { - sprintf(*dt_str, "H5T_NATIVE_USHORT"); + HDsnprintf(dt_str, *slen, "H5T_NATIVE_USHORT"); } else if (H5Tequal(dtype, H5T_NATIVE_INT)) { - sprintf(*dt_str, "H5T_NATIVE_INT"); + HDsnprintf(dt_str, *slen, "H5T_NATIVE_INT"); } else if (H5Tequal(dtype, H5T_NATIVE_UINT)) { - sprintf(*dt_str, "H5T_NATIVE_UINT"); + HDsnprintf(dt_str, *slen, "H5T_NATIVE_UINT"); } else if (H5Tequal(dtype, H5T_NATIVE_LONG)) { - sprintf(*dt_str, "H5T_NATIVE_LONG"); + HDsnprintf(dt_str, *slen, "H5T_NATIVE_LONG"); } else if (H5Tequal(dtype, H5T_NATIVE_ULONG)) { - sprintf(*dt_str, "H5T_NATIVE_ULONG"); + HDsnprintf(dt_str, *slen, "H5T_NATIVE_ULONG"); } else if (H5Tequal(dtype, H5T_NATIVE_LLONG)) { - sprintf(*dt_str, "H5T_NATIVE_LLONG"); + HDsnprintf(dt_str, *slen, "H5T_NATIVE_LLONG"); } else if (H5Tequal(dtype, H5T_NATIVE_ULLONG)) { - sprintf(*dt_str, "H5T_NATIVE_ULLONG"); + HDsnprintf(dt_str, *slen, "H5T_NATIVE_ULLONG"); } else { - sprintf(*dt_str, "undefined integer"); + HDsnprintf(dt_str, *slen, "undefined integer"); } break; case H5T_FLOAT: if (H5Tequal(dtype, H5T_IEEE_F32BE)) { - sprintf(*dt_str, "H5T_IEEE_F32BE"); + HDsnprintf(dt_str, *slen, "H5T_IEEE_F32BE"); } else if (H5Tequal(dtype, H5T_IEEE_F32LE)) { - sprintf(*dt_str, "H5T_IEEE_F32LE"); + HDsnprintf(dt_str, *slen, "H5T_IEEE_F32LE"); } else if (H5Tequal(dtype, H5T_IEEE_F64BE)) { - sprintf(*dt_str, "H5T_IEEE_F64BE"); + HDsnprintf(dt_str, *slen, "H5T_IEEE_F64BE"); } else if (H5Tequal(dtype, H5T_IEEE_F64LE)) { - sprintf(*dt_str, "H5T_IEEE_F64LE"); + HDsnprintf(dt_str, *slen, "H5T_IEEE_F64LE"); } else if (H5Tequal(dtype, H5T_NATIVE_FLOAT)) { - sprintf(*dt_str, "H5T_NATIVE_FLOAT"); + HDsnprintf(dt_str, *slen, "H5T_NATIVE_FLOAT"); } else if (H5Tequal(dtype, H5T_NATIVE_DOUBLE)) { - sprintf(*dt_str, "H5T_NATIVE_DOUBLE"); + HDsnprintf(dt_str, *slen, "H5T_NATIVE_DOUBLE"); #if H5_SIZEOF_LONG_DOUBLE !=0 } else if (H5Tequal(dtype, H5T_NATIVE_LDOUBLE)) { - sprintf(*dt_str, "H5T_NATIVE_LDOUBLE"); + HDsnprintf(dt_str, *slen, "H5T_NATIVE_LDOUBLE"); #endif } else { - sprintf(*dt_str, "undefined float"); + HDsnprintf(dt_str, *slen, "undefined float"); } break; @@ -1969,38 +2010,47 @@ herr_t H5LT_dtype_to_text(hid_t dtype, char **dt_str, H5LT_lang_t lang, size_t * goto out; /* Print lead-in */ - sprintf(*dt_str, "H5T_STRING {\n"); + HDsnprintf(dt_str, *slen, "H5T_STRING {\n"); indent += COL; - indentation(indent + COL, *dt_str); + if(!(dt_str = indentation(indent + COL, dt_str, no_user_buf, slen))) + goto out; if(is_vlstr) - strcat(*dt_str, "STRSIZE H5T_VARIABLE;\n"); - else { - sprintf(tmp_str, "STRSIZE %d;\n", (int)size); - strcat(*dt_str, tmp_str); - } + HDsnprintf(tmp_str, TMP_LEN, "STRSIZE H5T_VARIABLE;\n"); + else + HDsnprintf(tmp_str, TMP_LEN, "STRSIZE %d;\n", (int)size); - indentation(indent + COL, *dt_str); + if(!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str))) + goto out; + + if(!(dt_str = indentation(indent + COL, dt_str, no_user_buf, slen))) + goto out; if (str_pad == H5T_STR_NULLTERM) - strcat(*dt_str, "STRPAD H5T_STR_NULLTERM;\n"); + HDsnprintf(tmp_str, TMP_LEN, "STRPAD H5T_STR_NULLTERM;\n"); else if (str_pad == H5T_STR_NULLPAD) - strcat(*dt_str, "STRPAD H5T_STR_NULLPAD;\n"); + HDsnprintf(tmp_str, TMP_LEN, "STRPAD H5T_STR_NULLPAD;\n"); else if (str_pad == H5T_STR_SPACEPAD) - strcat(*dt_str, "STRPAD H5T_STR_SPACEPAD;\n"); + HDsnprintf(tmp_str, TMP_LEN, "STRPAD H5T_STR_SPACEPAD;\n"); else - strcat(*dt_str, "STRPAD H5T_STR_ERROR;\n"); + HDsnprintf(tmp_str, TMP_LEN, "STRPAD H5T_STR_ERROR;\n"); - indentation(indent + COL, *dt_str); + if(!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str))) + goto out; + + if(!(dt_str = indentation(indent + COL, dt_str, no_user_buf, slen))) + goto out; if (cset == H5T_CSET_ASCII) - strcat(*dt_str, "CSET H5T_CSET_ASCII;\n"); + HDsnprintf(tmp_str, TMP_LEN, "CSET H5T_CSET_ASCII;\n"); else if (cset == H5T_CSET_UTF8) - strcat(*dt_str, "CSET H5T_CSET_UTF8;\n"); + HDsnprintf(tmp_str, TMP_LEN, "CSET H5T_CSET_UTF8;\n"); else - strcat(*dt_str, "CSET unknown;\n"); + HDsnprintf(tmp_str, TMP_LEN, "CSET unknown;\n"); + if(!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str))) + goto out; /* Reproduce a C type string */ if((str_type = H5Tcopy(H5T_C_S1)) < 0) @@ -2017,11 +2067,14 @@ herr_t H5LT_dtype_to_text(hid_t dtype, char **dt_str, H5LT_lang_t lang, size_t * if(H5Tset_strpad(str_type, str_pad) < 0) goto out; - indentation(indent + COL, *dt_str); + if(!(dt_str = indentation(indent + COL, dt_str, no_user_buf, slen))) + goto out; /* 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"); + HDsnprintf(tmp_str, TMP_LEN, "CTYPE H5T_C_S1;\n"); + if(!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str))) + goto out; goto next; } @@ -2037,7 +2090,9 @@ herr_t H5LT_dtype_to_text(hid_t dtype, char **dt_str, H5LT_lang_t lang, size_t * } if (H5Tequal(tmp_type, str_type)) { - strcat(*dt_str, "H5T_C_S1;\n"); + HDsnprintf(tmp_str, TMP_LEN, "CTYPE H5T_C_S1;\n"); + if(!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str))) + goto out; goto next; } @@ -2056,7 +2111,9 @@ herr_t H5LT_dtype_to_text(hid_t dtype, char **dt_str, H5LT_lang_t lang, size_t * /* Are the two types equal? */ if (H5Tequal(tmp_type, str_type)) { - strcat(*dt_str, "CTYPE H5T_FORTRAN_S1;\n"); + HDsnprintf(tmp_str, TMP_LEN, "CTYPE H5T_FORTRAN_S1;\n"); + if(!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str))) + goto out; goto next; } @@ -2073,12 +2130,16 @@ herr_t H5LT_dtype_to_text(hid_t dtype, char **dt_str, H5LT_lang_t lang, size_t * /* Are the two types equal? */ if (H5Tequal(tmp_type, str_type)) { - strcat(*dt_str, "CTYPE H5T_FORTRAN_S1;\n"); + HDsnprintf(tmp_str, TMP_LEN, "CTYPE H5T_FORTRAN_S1;\n"); + if(!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str))) + goto out; goto next; } /* Type doesn't match any of above. */ - strcat(*dt_str, "CTYPE unknown_one_character_type;\n "); + HDsnprintf(tmp_str, TMP_LEN, "CTYPE unknown_one_character_type;\n"); + if(!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str))) + goto out; next: H5Tclose(str_type); @@ -2086,36 +2147,48 @@ next: /* Print closing */ indent -= COL; - indentation(indent + COL, *dt_str); - strcat(*dt_str, "}"); + if(!(dt_str = indentation(indent + COL, dt_str, no_user_buf, slen))) + goto out; + HDsnprintf(tmp_str, TMP_LEN, "}"); + if(!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str))) + goto out; break; } case H5T_OPAQUE: { - char *tag; + char *tag = NULL; /* Print lead-in */ - sprintf(*dt_str, "H5T_OPAQUE {\n"); + HDsnprintf(dt_str, *slen, "H5T_OPAQUE {\n"); indent += COL; - indentation(indent + COL, *dt_str); - sprintf(tmp_str, "OPQ_SIZE %lu;\n", (unsigned long)H5Tget_size(dtype)); - strcat(*dt_str, tmp_str); + if(!(dt_str = indentation(indent + COL, dt_str, no_user_buf, slen))) + goto out; + HDsnprintf(tmp_str, TMP_LEN, "OPQ_SIZE %lu;\n", (unsigned long)H5Tget_size(dtype)); + if(!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str))) + goto out; - indentation(indent + COL, *dt_str); + if(!(dt_str = indentation(indent + COL, dt_str, no_user_buf, slen))) + goto out; tag = H5Tget_tag(dtype); if(tag) { - sprintf(tmp_str, "OPQ_TAG \"%s\";\n", tag); - free(tag); + HDsnprintf(tmp_str, TMP_LEN, "OPQ_TAG \"%s\";\n", tag); + if(tag) + free(tag); + tag = NULL; } else - sprintf(tmp_str, "OPQ_TAG \"\";\n"); - strcat(*dt_str, tmp_str); + HDsnprintf(tmp_str, TMP_LEN, "OPQ_TAG \"\";\n"); + if(!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str))) + goto out; /* Print closing */ indent -= COL; - indentation(indent + COL, *dt_str); - strcat(*dt_str, "}"); + if(!(dt_str = indentation(indent + COL, dt_str, no_user_buf, slen))) + goto out; + HDsnprintf(tmp_str, TMP_LEN, "}"); + if(!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str))) + goto out; break; } @@ -2123,12 +2196,13 @@ next: { hid_t super; size_t super_len; - char* stmp; + char* stmp = NULL; /* Print lead-in */ - sprintf(*dt_str, "H5T_ENUM {\n"); + HDsnprintf(dt_str, *slen, "H5T_ENUM {\n"); indent += COL; - indentation(indent + COL, *dt_str); + if(!(dt_str = indentation(indent + COL, dt_str, no_user_buf, slen))) + goto out; if((super = H5Tget_super(dtype)) < 0) goto out; @@ -2136,19 +2210,29 @@ next: goto out; stmp = (char*)calloc(super_len, sizeof(char)); if(H5LTdtype_to_text(super, stmp, lang, &super_len) < 0) + goto out; + if(!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, stmp))) + goto out; + + if(stmp) + free(stmp); + stmp = NULL; + + HDsnprintf(tmp_str, TMP_LEN, ";\n"); + if(!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str))) goto out; - strcat(*dt_str, stmp); - free(stmp); - strcat(*dt_str, ";\n"); H5Tclose(super); - if(print_enum(dtype, *dt_str, indent) < 0) + if(!(dt_str = print_enum(dtype, dt_str, slen, no_user_buf, indent))) goto out; /* Print closing */ indent -= COL; - indentation(indent + COL, *dt_str); - strcat(*dt_str, "}"); + if(!(dt_str = indentation(indent + COL, dt_str, no_user_buf, slen))) + goto out; + HDsnprintf(tmp_str, TMP_LEN, "}"); + if(!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str))) + goto out; break; } @@ -2156,12 +2240,13 @@ next: { hid_t super; size_t super_len; - char* stmp; + char* stmp = NULL; /* Print lead-in */ - sprintf(*dt_str, "H5T_VLEN {\n"); + HDsnprintf(dt_str, *slen, "H5T_VLEN {\n"); indent += COL; - indentation(indent + COL, *dt_str); + if(!(dt_str = indentation(indent + COL, dt_str, no_user_buf, slen))) + goto out; if((super = H5Tget_super(dtype)) < 0) goto out; @@ -2170,15 +2255,24 @@ next: 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"); + if(!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, stmp))) + goto out; + + if(stmp) + free(stmp); + stmp = NULL; + HDsnprintf(tmp_str, TMP_LEN, "\n"); + if(!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str))) + goto out; H5Tclose(super); /* Print closing */ indent -= COL; - indentation(indent + COL, *dt_str); - strcat(*dt_str, "}"); + if(!(dt_str = indentation(indent + COL, dt_str, no_user_buf, slen))) + goto out; + HDsnprintf(tmp_str, TMP_LEN, "}"); + if(!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str))) + goto out; break; } @@ -2186,14 +2280,15 @@ next: { hid_t super; size_t super_len; - char* stmp; + char* stmp = NULL; hsize_t dims[H5S_MAX_RANK]; int ndims; /* Print lead-in */ - sprintf(*dt_str, "H5T_ARRAY {\n"); + HDsnprintf(dt_str, *slen, "H5T_ARRAY {\n"); indent += COL; - indentation(indent + COL, *dt_str); + if(!(dt_str = indentation(indent + COL, dt_str, no_user_buf, slen))) + goto out; /* Get array information */ if((ndims = H5Tget_array_ndims(dtype)) < 0) @@ -2203,10 +2298,13 @@ next: /* Print array dimensions */ for (i = 0; i < ndims; i++) { - sprintf(tmp_str, "[%d]", (int) dims[i]); - strcat(*dt_str, tmp_str); + HDsnprintf(tmp_str, TMP_LEN, "[%d]", (int) dims[i]); + if(!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str))) + goto out; } - strcat(*dt_str, " "); + HDsnprintf(tmp_str, TMP_LEN, " "); + if(!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str))) + goto out; if((super = H5Tget_super(dtype)) < 0) goto out; @@ -2215,32 +2313,40 @@ next: 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"); + if(!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, stmp))) + goto out; + if(stmp) + free(stmp); + stmp = NULL; + HDsnprintf(tmp_str, TMP_LEN, "\n"); + if(!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str))) + goto out; H5Tclose(super); /* Print closing */ indent -= COL; - indentation(indent + COL, *dt_str); - strcat(*dt_str, "}"); + if(!(dt_str = indentation(indent + COL, dt_str, no_user_buf, slen))) + goto out; + HDsnprintf(tmp_str, TMP_LEN, "}"); + if(!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str))) + goto out; break; } case H5T_COMPOUND: { - char *mname; + char *mname = NULL; hid_t mtype; size_t moffset; H5T_class_t mclass; size_t mlen; - char* mtmp; + char* mtmp = NULL; int nmembs; if((nmembs = H5Tget_nmembers(dtype)) < 0) goto out; - sprintf(*dt_str, "H5T_COMPOUND {\n"); + HDsnprintf(dt_str, *slen, "H5T_COMPOUND {\n"); indent += COL; for (i = 0; i < nmembs; i++) { @@ -2249,7 +2355,8 @@ next: if((mtype = H5Tget_member_type(dtype, (unsigned)i)) < 0) goto out; moffset = H5Tget_member_offset(dtype, (unsigned)i); - indentation(indent + COL, *dt_str); + if(!(dt_str = indentation(indent + COL, dt_str, no_user_buf, slen))) + goto out; if((mclass = H5Tget_class(mtype)) < 0) goto out; @@ -2261,47 +2368,53 @@ next: mtmp = (char*)calloc(mlen, sizeof(char)); if(H5LTdtype_to_text(mtype, mtmp, lang, &mlen) < 0) goto out; - strcat(*dt_str, mtmp); - free(mtmp); + if(!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, mtmp))) + goto out; + if(mtmp) + free(mtmp); + mtmp = NULL; if (H5T_COMPOUND == mclass) indent -= COL; - sprintf(tmp_str, " \"%s\"", mname); - strcat(*dt_str, tmp_str); - free(mname); + HDsnprintf(tmp_str, TMP_LEN, " \"%s\"", mname); + if(!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str))) + goto out; + if(mname) + free(mname); + mname = NULL; - sprintf(tmp_str, " : %lu;\n", (unsigned long)moffset); - strcat(*dt_str, tmp_str); + HDsnprintf(tmp_str, TMP_LEN, " : %lu;\n", (unsigned long)moffset); + if(!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str))) + goto out; } /* Print closing */ indent -= COL; - indentation(indent + COL, *dt_str); - strcat(*dt_str, "}"); + if(!(dt_str = indentation(indent + COL, dt_str, no_user_buf, slen))) + goto out; + HDsnprintf(tmp_str, TMP_LEN, "}"); + if(!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str))) + goto out; break; } case H5T_TIME: - sprintf(*dt_str, "H5T_TIME: not yet implemented"); + HDsnprintf(dt_str, *slen, "H5T_TIME: not yet implemented"); break; case H5T_BITFIELD: - sprintf(*dt_str, "H5T_BITFIELD: not yet implemented"); + HDsnprintf(dt_str, *slen, "H5T_BITFIELD: not yet implemented"); break; default: - sprintf(*dt_str, "unknown data type"); + HDsnprintf(dt_str, *slen, "unknown data type"); } - return ret; + return dt_str; out: - return FAIL; + return NULL; } - - - - /*------------------------------------------------------------------------- * * Get attribute functions @@ -2917,4 +3030,110 @@ out: } - +htri_t +H5LTpath_valid(hid_t loc_id, const char *path, hbool_t check_object_valid) + { + char *tmp_path = NULL; /* Temporary copy of the path */ + char *curr_name; /* Pointer to current component of path name */ + char *delimit; /* Pointer to path delimiter during traversal */ + H5I_type_t obj_type; + htri_t link_exists, obj_exists; + size_t path_length; + htri_t ret_value; + + /* Initialize */ + ret_value = FALSE; + + /* Find the type of loc_id */ + if((obj_type = H5Iget_type(loc_id)) == H5I_BADID) { + ret_value = FAIL; + goto done; + } + + /* Find the length of the path */ + path_length = HDstrlen(path); + + /* Check if the identifier is the object itself, i.e. path is '.' */ + if(HDstrncmp(path, ".", path_length) == 0) { + if(check_object_valid) { + obj_exists = H5Oexists_by_name(loc_id, path, H5P_DEFAULT); + ret_value = obj_exists; + goto done; + } else { + ret_value = TRUE; /* Since the object is the identifier itself, + * we can only check if loc_id is a valid type */ + goto done; + } + } + + /* Duplicate the path to use */ + if(NULL == (tmp_path = HDstrdup(path))) { + ret_value = FAIL; + goto done; + } + + curr_name = tmp_path; + + /* check if absolute pathname */ + if(HDstrncmp(path, "/", 1) == 0) curr_name++; + + /* check if relative path name starts with "./" */ + if(HDstrncmp(path, "./", 2) == 0) curr_name += 2; + + while((delimit=HDstrchr(curr_name,'/'))!=NULL) { + /* Change the delimiter to terminate the string */ + *delimit='\0'; + + obj_exists = FALSE; + if((link_exists = H5Lexists(loc_id, tmp_path, H5P_DEFAULT)) < 0) { + ret_value = FAIL; + goto done; + } + + /* If target link does not exist then no reason to + * continue checking the path */ + if(link_exists != TRUE) { + ret_value = FALSE; + goto done; + } + + /* Determine if link resolves to an actual object */ + if((obj_exists = H5Oexists_by_name(loc_id, tmp_path, H5P_DEFAULT)) < 0) { + ret_value = FAIL; + goto done; + } + + if(obj_exists != TRUE) + break; + + /* Change the delimiter back to '/' */ + *delimit='/'; + + /* Advance the pointer in the path to the start of the next component */ + curr_name = delimit + 1; + + } /* end while */ + + /* Should be pointing to the last component in the path name now... */ + + /* Check if link does not exist */ + if((link_exists = H5Lexists(loc_id, tmp_path, H5P_DEFAULT)) < 0) { + ret_value = FAIL; + } else { + ret_value = link_exists; + /* Determine if link resolves to an actual object for check_object_valid TRUE */ + if(check_object_valid == TRUE && link_exists == TRUE) { + if((obj_exists = H5Oexists_by_name(loc_id, tmp_path, H5P_DEFAULT)) < 0) { + ret_value = FAIL; + } else { + ret_value = obj_exists; + } + } + } + +done: + if(tmp_path != NULL) + HDfree(tmp_path); + + return ret_value; + } diff --git a/hl/src/H5LTprivate.h b/hl/src/H5LTprivate.h index c51ee7c..69616b1 100644 --- a/hl/src/H5LTprivate.h +++ b/hl/src/H5LTprivate.h @@ -45,7 +45,7 @@ H5_HLDLL herr_t H5LT_set_attribute_string( hid_t dset_id, H5_HLDLL herr_t H5LT_find_attribute( hid_t loc_id, const char *name ); -H5_HLDLL herr_t H5LT_dtype_to_text(hid_t dtype, char **dt_str, H5LT_lang_t lang, +H5_HLDLL char* H5LT_dtype_to_text(hid_t dtype, char *dt_str, H5LT_lang_t lang, size_t *slen, hbool_t no_user_buf); diff --git a/hl/src/H5LTpublic.h b/hl/src/H5LTpublic.h index 7fb873a..6efae68 100644 --- a/hl/src/H5LTpublic.h +++ b/hl/src/H5LTpublic.h @@ -340,8 +340,9 @@ H5_HLDLL herr_t H5LTdtype_to_text(hid_t dtype, char *str, H5LT_lang_t lang_type, *------------------------------------------------------------------------- */ -H5_HLDLL herr_t H5LTfind_attribute( hid_t loc_id, const char *name ); +H5_HLDLL herr_t H5LTfind_attribute( hid_t loc_id, const char *name ); +H5_HLDLL htri_t H5LTpath_valid(hid_t loc_id, const char *path, hbool_t check_object_valid); #ifdef __cplusplus } diff --git a/hl/src/Makefile.in b/hl/src/Makefile.in index ff55204..cb89235 100644 --- a/hl/src/Makefile.in +++ b/hl/src/Makefile.in @@ -200,6 +200,7 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ +FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ @@ -220,10 +221,12 @@ H5_LONE_COLON = @H5_LONE_COLON@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ +HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ +HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ @@ -417,7 +420,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 = 71 +LT_VERS_REVISION = 101 LT_VERS_AGE = 0 # This library is our main target. diff --git a/hl/test/CMakeLists.txt b/hl/test/CMakeLists.txt index 3104008..89baac4 100644 --- a/hl/test/CMakeLists.txt +++ b/hl/test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8) +cmake_minimum_required (VERSION 2.8.6) PROJECT (HDF5_HL_TEST) # -------------------------------------------------------------------- # Notes: When creating unit test executables they should be prefixed @@ -28,6 +28,7 @@ MACRO (HL_ADD_TEST hl_name files) ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET} ) + SET_TARGET_PROPERTIES (hl_${hl_name} PROPERTIES FOLDER test/hl) ADD_TEST (NAME hl_${hl_name} COMMAND $) @@ -92,4 +93,5 @@ IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET} ) + SET_TARGET_PROPERTIES (hl_gen_test_ds PROPERTIES FOLDER test/hl/gen) ENDIF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) diff --git a/hl/test/Makefile.in b/hl/test/Makefile.in index 54e4b12..9a95e16 100644 --- a/hl/test/Makefile.in +++ b/hl/test/Makefile.in @@ -224,6 +224,7 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ +FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ @@ -244,10 +245,12 @@ H5_LONE_COLON = @H5_LONE_COLON@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ +HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ +HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ diff --git a/hl/test/test_ds.c b/hl/test/test_ds.c index 53870f5..e290bbb 100644 --- a/hl/test/test_ds.c +++ b/hl/test/test_ds.c @@ -81,8 +81,9 @@ static int test_types(void); static int test_iterators(void); static int test_data(void); static int read_data( const char* fname, int ndims, hsize_t *dims, float **buf ); +static int test_attach_detach(void); - +#define RANK1 1 #define RANK 2 #define DIM_DATA 12 #define DIM1_SIZE 3 @@ -136,6 +137,7 @@ static int read_data( const char* fname, int ndims, hsize_t *dims, float **buf ) #define FILE5 "test_ds7.h5" #define FILE6 "test_ds8.h5" #define FILE7 "test_ds9.h5" +#define FILE8 "test_ds10.h5" #define DIMENSION_LIST "DIMENSION_LIST" #define REFERENCE_LIST "REFERENCE_LIST" @@ -174,7 +176,7 @@ int main(void) nerrors += test_foreign_scaleattached(FOREIGN_FILE1) < 0 ? 1 : 0; nerrors += test_foreign_scaleattached(FOREIGN_FILE2) < 0 ? 1 : 0; nerrors += test_detachscales() < 0 ? 1 : 0; - + nerrors += test_attach_detach() < 0 ? 1 : 0; /* the following tests have not been rewritten to match those above */ nerrors += test_simple() < 0 ?1:0; nerrors += test_errors() < 0 ?1:0; @@ -217,9 +219,9 @@ static hid_t create_test_file(const char *fileext) { char filename[65]; - strcpy(filename, FILENAME); - strcat(filename, fileext); - strcat(filename, FILEEXT); + HDstrcpy(filename, FILENAME); + HDstrcat(filename, fileext); + HDstrcat(filename, FILEEXT); return H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); } @@ -227,9 +229,9 @@ static hid_t open_test_file(const char *fileext) { char filename[65]; - strcpy(filename, FILENAME); - strcat(filename, fileext); - strcat(filename, FILEEXT); + HDstrcpy(filename, FILENAME); + HDstrcat(filename, fileext); + HDstrcat(filename, FILEEXT); return H5Fopen(filename, H5F_ACC_RDWR, H5P_DEFAULT); } @@ -258,8 +260,8 @@ herr_t create_char_dataset(hid_t fid, const char *dsidx, int fulldims) char s33_wbuf[DIM3_SIZE] = {6,6,6,12,12,12,53,53,53,120,120,120}; char name[32]; - strcpy(name, DATASET_NAME); - strcat(name, dsidx); + HDstrcpy(name, DATASET_NAME); + HDstrcat(name, dsidx); /* make a dataset */ if(H5LTmake_dataset_char(fid, name, rank, dims, buf) >= 0) { if(fulldims==0) { @@ -311,8 +313,8 @@ herr_t create_short_dataset(hid_t fid, const char *dsidx, int fulldims) short s33_wbuf[DIM3_SIZE] = {6,6,6,12,12,12,53,53,53,140,140,140}; char name[32]; - strcpy(name, DATASET_NAME); - strcat(name, dsidx); + HDstrcpy(name, DATASET_NAME); + HDstrcat(name, dsidx); /* make a dataset */ if(H5LTmake_dataset_short(fid, name, rank, dims, buf) >= 0) { @@ -360,8 +362,8 @@ herr_t create_int_dataset(hid_t fid, const char *dsidx, int fulldims) int s22_wbuf[DIM2_SIZE] = {5,10,50,300}; char name[32]; - strcpy(name, DATASET_NAME); - strcat(name, dsidx); + HDstrcpy(name, DATASET_NAME); + HDstrcat(name, dsidx); /* make a dataset */ if(H5LTmake_dataset_int(fid, name, rank, dims, buf) >= 0) { @@ -413,7 +415,7 @@ herr_t create_long_dataset(hid_t fid, const char *dsname, const char *dsidx, int long s44_wbuf[DIM4_SIZE] = {280,280}; char name[32]; - strcpy(name, dsname); + HDstrcpy(name, dsname); /* make a dataset */ if(H5LTmake_dataset_long(fid, name, rank, dims, buf) >= 0) { @@ -468,8 +470,8 @@ herr_t create_float_dataset(hid_t fid, const char *dsidx, int fulldims) float s22_wbuf[DIM2_SIZE] = {5,10,50,300}; char name[32]; - strcpy(name, DATASET_NAME); - strcat(name, dsidx); + HDstrcpy(name, DATASET_NAME); + HDstrcat(name, dsidx); /* make a dataset */ if(H5LTmake_dataset_float(fid, name, rank, dims, buf) >= 0) { @@ -503,15 +505,15 @@ herr_t create_DS1_char_datasets(hid_t fid, const char *dsidx, int rankds, hsize_ { char name[32]; - strcpy(name, DS_1_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_1_NAME); + HDstrcat(name, dsidx); /* make a DS dataset for the first dimension */ if(H5LTmake_dataset_char(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; if(s1_wbuf!=NULL) { - strcpy(name, DS_11_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_11_NAME); + HDstrcat(name, dsidx); /* make a DS dataset with an alternate scale for the first dimension */ if(H5LTmake_dataset_char(fid, name, rankds, s_dim, s1_wbuf) < 0) return FAIL; @@ -528,23 +530,23 @@ herr_t create_DS2_char_datasets(hid_t fid, const char *dsidx, int rankds, hsize_ { char name[32]; - strcpy(name, DS_2_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_2_NAME); + HDstrcat(name, dsidx); /* make a DS dataset for the second dimension */ if(H5LTmake_dataset_char(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; if(s1_wbuf!=NULL) { - strcpy(name, DS_21_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_21_NAME); + HDstrcat(name, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_char(fid, name, rankds, s_dim, s1_wbuf) < 0) return FAIL; } if(s2_wbuf!=NULL) { - strcpy(name, DS_22_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_22_NAME); + HDstrcat(name, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_char(fid, name, rankds, s_dim, s2_wbuf) < 0) return FAIL; @@ -561,31 +563,31 @@ herr_t create_DS3_char_datasets(hid_t fid, const char *dsidx, int rankds, hsize_ { char name[32]; - strcpy(name, DS_3_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_3_NAME); + HDstrcat(name, dsidx); /* make a DS dataset for the first dimension */ if(H5LTmake_dataset_char(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; if(s1_wbuf!=NULL) { - strcpy(name, DS_31_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_31_NAME); + HDstrcat(name, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_char(fid, name, rankds, s_dim, s1_wbuf) < 0) return FAIL; } if(s2_wbuf!=NULL) { - strcpy(name, DS_32_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_32_NAME); + HDstrcat(name, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_char(fid, name, rankds, s_dim, s2_wbuf) < 0) return FAIL; } if(s3_wbuf!=NULL) { - strcpy(name, DS_33_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_33_NAME); + HDstrcat(name, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_char(fid, name, rankds, s_dim, s3_wbuf) < 0) return FAIL; @@ -602,15 +604,15 @@ herr_t create_DS1_short_datasets(hid_t fid, const char *dsidx, int rankds, hsize { char name[32]; - strcpy(name, DS_1_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_1_NAME); + HDstrcat(name, dsidx); /* make a DS dataset for the first dimension */ if(H5LTmake_dataset_short(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; if(s1_wbuf!=NULL) { - strcpy(name, DS_11_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_11_NAME); + HDstrcat(name, dsidx); /* make a DS dataset with an alternate scale for the first dimension */ if(H5LTmake_dataset_short(fid, name, rankds, s_dim, s1_wbuf) < 0) return FAIL; @@ -627,24 +629,24 @@ herr_t create_DS2_short_datasets(hid_t fid, const char *dsidx, int rankds, hsize { char name[32]; - strcpy(name, DS_2_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_2_NAME); + HDstrcat(name, dsidx); /* make a DS dataset for the second dimension */ if(H5LTmake_dataset_short(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; if(s1_wbuf!=NULL) { - strcpy(name, DS_21_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_21_NAME); + HDstrcat(name, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_short(fid, name, rankds, s_dim, s1_wbuf) < 0) return FAIL; } if(s2_wbuf!=NULL) { - strcpy(name, DS_22_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_22_NAME); + HDstrcat(name, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_short(fid, name, rankds, s_dim, s2_wbuf) < 0) return FAIL; @@ -661,32 +663,32 @@ herr_t create_DS3_short_datasets(hid_t fid, const char *dsidx, int rankds, hsize { char name[32]; - strcpy(name, DS_3_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_3_NAME); + HDstrcat(name, dsidx); /* make a DS dataset for the first dimension */ if(H5LTmake_dataset_short(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; if(s1_wbuf!=NULL) { - strcpy(name, DS_31_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_31_NAME); + HDstrcat(name, dsidx); /* make a DS dataset for the first dimension */ if(H5LTmake_dataset_short(fid, name, rankds, s_dim, s1_wbuf) < 0) return FAIL; } if(s2_wbuf!=NULL) { - strcpy(name, DS_32_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_32_NAME); + HDstrcat(name, dsidx); /* make a DS dataset for the first dimension */ if(H5LTmake_dataset_short(fid, name, rankds, s_dim, s2_wbuf) < 0) return FAIL; } if(s3_wbuf!=NULL) { - strcpy(name, DS_33_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_33_NAME); + HDstrcat(name, dsidx); /* make a DS dataset for the first dimension */ if(H5LTmake_dataset_short(fid, name, rankds, s_dim, s3_wbuf) < 0) return FAIL; @@ -703,16 +705,16 @@ herr_t create_DS1_int_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t { char name[32]; - strcpy(name, DS_1_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_1_NAME); + HDstrcat(name, dsidx); /* make a DS dataset for the first dimension */ if(H5LTmake_dataset_int(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; if(s1_wbuf!=NULL) { - strcpy(name, DS_11_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_11_NAME); + HDstrcat(name, dsidx); /* make a DS dataset with an alternate scale for the first dimension */ if(H5LTmake_dataset_int(fid, name, rankds, s_dim, s1_wbuf) < 0) return FAIL; @@ -729,24 +731,24 @@ herr_t create_DS2_int_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t { char name[32]; - strcpy(name, DS_2_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_2_NAME); + HDstrcat(name, dsidx); /* make a DS dataset for the second dimension */ if(H5LTmake_dataset_int(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; if(s1_wbuf!=NULL) { - strcpy(name, DS_21_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_21_NAME); + HDstrcat(name, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_int(fid, name, rankds, s_dim, s1_wbuf) < 0) return FAIL; } if(s2_wbuf!=NULL) { - strcpy(name, DS_22_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_22_NAME); + HDstrcat(name, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_int(fid, name, rankds, s_dim, s2_wbuf) < 0) return FAIL; @@ -763,32 +765,32 @@ herr_t create_DS3_int_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t { char name[32]; - strcpy(name, DS_3_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_3_NAME); + HDstrcat(name, dsidx); /* make a DS dataset for the first dimension */ if(H5LTmake_dataset_int(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; if(s1_wbuf!=NULL) { - strcpy(name, DS_31_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_31_NAME); + HDstrcat(name, dsidx); /* make a DS dataset with an alternate scale for the first dimension */ if(H5LTmake_dataset_int(fid, name, rankds, s_dim, s1_wbuf) < 0) return FAIL; } if(s2_wbuf!=NULL) { - strcpy(name, DS_32_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_32_NAME); + HDstrcat(name, dsidx); /* make a DS dataset with an alternate scale for the first dimension */ if(H5LTmake_dataset_int(fid, name, rankds, s_dim, s2_wbuf) < 0) return FAIL; } if(s3_wbuf!=NULL) { - strcpy(name, DS_33_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_33_NAME); + HDstrcat(name, dsidx); /* make a DS dataset with an alternate scale for the first dimension */ if(H5LTmake_dataset_int(fid, name, rankds, s_dim, s3_wbuf) < 0) return FAIL; @@ -805,16 +807,16 @@ herr_t create_DS1_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_ { char name[32]; - strcpy(name, DS_1_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_1_NAME); + HDstrcat(name, dsidx); /* make a DS dataset for the first dimension */ if(H5LTmake_dataset_long(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; if(s1_wbuf!=NULL) { - strcpy(name, DS_11_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_11_NAME); + HDstrcat(name, dsidx); /* make a DS dataset with an alternate scale for the first dimension */ if(H5LTmake_dataset_long(fid, name, rankds, s_dim, s1_wbuf) < 0) return FAIL; @@ -831,24 +833,24 @@ herr_t create_DS2_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_ { char name[32]; - strcpy(name, DS_2_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_2_NAME); + HDstrcat(name, dsidx); /* make a DS dataset for the second dimension */ if(H5LTmake_dataset_long(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; if(s1_wbuf!=NULL) { - strcpy(name, DS_21_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_21_NAME); + HDstrcat(name, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_long(fid, name, rankds, s_dim, s1_wbuf) < 0) return FAIL; } if(s2_wbuf!=NULL) { - strcpy(name, DS_22_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_22_NAME); + HDstrcat(name, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_long(fid, name, rankds, s_dim, s2_wbuf) < 0) return FAIL; @@ -865,32 +867,32 @@ herr_t create_DS3_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_ { char name[32]; - strcpy(name, DS_3_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_3_NAME); + HDstrcat(name, dsidx); /* make a DS dataset for the first dimension */ if(H5LTmake_dataset_long(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; if(s1_wbuf!=NULL) { - strcpy(name, DS_31_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_31_NAME); + HDstrcat(name, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_long(fid, name, rankds, s_dim, s1_wbuf) < 0) return FAIL; } if(s2_wbuf!=NULL) { - strcpy(name, DS_32_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_32_NAME); + HDstrcat(name, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_long(fid, name, rankds, s_dim, s2_wbuf) < 0) return FAIL; } if(s3_wbuf!=NULL) { - strcpy(name, DS_33_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_33_NAME); + HDstrcat(name, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_long(fid, name, rankds, s_dim, s3_wbuf) < 0) return FAIL; @@ -907,40 +909,40 @@ herr_t create_DS4_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_ { char name[32]; - strcpy(name, DS_4_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_4_NAME); + HDstrcat(name, dsidx); /* make a DS dataset for the first dimension */ if(H5LTmake_dataset_long(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; if(s1_wbuf!=NULL) { - strcpy(name, DS_41_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_41_NAME); + HDstrcat(name, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_long(fid, name, rankds, s_dim, s1_wbuf) < 0) return FAIL; } if(s2_wbuf!=NULL) { - strcpy(name, DS_42_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_42_NAME); + HDstrcat(name, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_long(fid, name, rankds, s_dim, s2_wbuf) < 0) return FAIL; } if(s3_wbuf!=NULL) { - strcpy(name, DS_43_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_43_NAME); + HDstrcat(name, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_long(fid, name, rankds, s_dim, s3_wbuf) < 0) return FAIL; } if(s4_wbuf!=NULL) { - strcpy(name, DS_44_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_44_NAME); + HDstrcat(name, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_long(fid, name, rankds, s_dim, s4_wbuf) < 0) return FAIL; @@ -957,16 +959,16 @@ herr_t create_DS1_float_datasets(hid_t fid, const char *dsidx, int rankds, hsize { char name[32]; - strcpy(name, DS_1_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_1_NAME); + HDstrcat(name, dsidx); /* make a DS dataset for the first dimension */ if(H5LTmake_dataset_float(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; if(s1_wbuf!=NULL) { - strcpy(name, DS_11_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_11_NAME); + HDstrcat(name, dsidx); /* make a DS dataset with an alternate scale for the first dimension */ if(H5LTmake_dataset_float(fid, name, rankds, s_dim, s1_wbuf) < 0) return FAIL; @@ -983,24 +985,24 @@ herr_t create_DS2_float_datasets(hid_t fid, const char *dsidx, int rankds, hsize { char name[32]; - strcpy(name, DS_2_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_2_NAME); + HDstrcat(name, dsidx); /* make a DS dataset for the second dimension */ if(H5LTmake_dataset_float(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; if(s1_wbuf!=NULL) { - strcpy(name, DS_21_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_21_NAME); + HDstrcat(name, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_float(fid, name, rankds, s_dim, s1_wbuf) < 0) return FAIL; } if(s2_wbuf!=NULL) { - strcpy(name, DS_22_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_22_NAME); + HDstrcat(name, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_float(fid, name, rankds, s_dim, s2_wbuf) < 0) return FAIL; @@ -1017,32 +1019,32 @@ herr_t create_DS3_float_datasets(hid_t fid, const char *dsidx, int rankds, hsize { char name[32]; - strcpy(name, DS_3_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_3_NAME); + HDstrcat(name, dsidx); /* make a DS dataset for the first dimension */ if(H5LTmake_dataset_float(fid, name, rankds, s_dim, s_wbuf) < 0) return FAIL; if(s1_wbuf!=NULL) { - strcpy(name, DS_31_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_31_NAME); + HDstrcat(name, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_float(fid, name, rankds, s_dim, s1_wbuf) < 0) return FAIL; } if(s2_wbuf!=NULL) { - strcpy(name, DS_32_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_32_NAME); + HDstrcat(name, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_float(fid, name, rankds, s_dim, s2_wbuf) < 0) return FAIL; } if(s3_wbuf!=NULL) { - strcpy(name, DS_33_NAME); - strcat(name, dsidx); + HDstrcpy(name, DS_33_NAME); + HDstrcat(name, dsidx); /* make a DS dataset with an alternate scale for the second dimension */ if(H5LTmake_dataset_float(fid, name, rankds, s_dim, s3_wbuf) < 0) return FAIL; @@ -1125,13 +1127,13 @@ herr_t test_cmp_scalename(hid_t fid, hid_t did, const char *name, const char *sc if((dsid = H5Dopen2(fid, name, H5P_DEFAULT)) >= 0) { if(H5DSis_attached(did, dsid, idx) == 1) { if((name_len=H5DSget_scale_name(dsid,NULL,(size_t)0)) > 0) { - name_out = (char*)malloc(name_len * sizeof (char)); + name_out = (char*)HDmalloc(name_len * sizeof (char)); if(name_out != NULL) { if(H5DSget_scale_name(dsid, name_out, (size_t)name_len) >= 0) { - if(strcmp(scalename,name_out)==0) { + if(HDstrcmp(scalename,name_out)==0) { ret_value = SUCCEED; } - free(name_out); + HDfree(name_out); name_out=NULL; } } @@ -1292,8 +1294,8 @@ static int test_char_attachscales(const char *fileext) hid_t did = -1; char dsname[32]; char scalename[32]; - strcpy(dsname, DATASET_NAME); - strcat(dsname, "ac"); + HDstrcpy(dsname, DATASET_NAME); + HDstrcat(dsname, "ac"); TESTING2("test_char_attachscales"); @@ -1305,18 +1307,18 @@ static int test_char_attachscales(const char *fileext) goto out; if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { - strcpy(scalename, DS_1_NAME); - strcat(scalename, "ac"); + HDstrcpy(scalename, DS_1_NAME); + HDstrcat(scalename, "ac"); if(test_attach_scale(fid, did, scalename, DIM0) < 0) goto out; - strcpy(scalename, DS_2_NAME); - strcat(scalename, "ac"); + HDstrcpy(scalename, DS_2_NAME); + HDstrcat(scalename, "ac"); if(test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; - strcpy(scalename, DS_3_NAME); - strcat(scalename, "ac"); + HDstrcpy(scalename, DS_3_NAME); + HDstrcat(scalename, "ac"); if(test_attach_scale(fid, did, scalename, DIM2) < 0) goto out; @@ -1348,8 +1350,8 @@ static int test_short_attachscales(const char *fileext) hid_t did = -1; char dsname[32]; char scalename[32]; - strcpy(dsname, DATASET_NAME); - strcat(dsname, "as"); + HDstrcpy(dsname, DATASET_NAME); + HDstrcat(dsname, "as"); TESTING2("test_short_attachscales"); @@ -1361,48 +1363,48 @@ static int test_short_attachscales(const char *fileext) goto out; if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { - strcpy(scalename, DS_1_NAME); - strcat(scalename, "as"); + HDstrcpy(scalename, DS_1_NAME); + HDstrcat(scalename, "as"); if(test_attach_scale(fid, did, scalename, DIM0) < 0) goto out; - strcpy(scalename, DS_11_NAME); - strcat(scalename, "as"); + HDstrcpy(scalename, DS_11_NAME); + HDstrcat(scalename, "as"); if(test_attach_scale(fid, did, scalename, DIM0) < 0) goto out; - strcpy(scalename, DS_2_NAME); - strcat(scalename, "as"); + HDstrcpy(scalename, DS_2_NAME); + HDstrcat(scalename, "as"); if(test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; - strcpy(scalename, DS_21_NAME); - strcat(scalename, "as"); + HDstrcpy(scalename, DS_21_NAME); + HDstrcat(scalename, "as"); if(test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; - strcpy(scalename, DS_22_NAME); - strcat(scalename, "as"); + HDstrcpy(scalename, DS_22_NAME); + HDstrcat(scalename, "as"); if(test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; - strcpy(scalename, DS_3_NAME); - strcat(scalename, "as"); + HDstrcpy(scalename, DS_3_NAME); + HDstrcat(scalename, "as"); if(test_attach_scale(fid, did, scalename, DIM2) < 0) goto out; - strcpy(scalename, DS_31_NAME); - strcat(scalename, "as"); + HDstrcpy(scalename, DS_31_NAME); + HDstrcat(scalename, "as"); if(test_attach_scale(fid, did, scalename, DIM2) < 0) goto out; - strcpy(scalename, DS_32_NAME); - strcat(scalename, "as"); + HDstrcpy(scalename, DS_32_NAME); + HDstrcat(scalename, "as"); if(test_attach_scale(fid, did, scalename, DIM2) < 0) goto out; - strcpy(scalename, DS_33_NAME); - strcat(scalename, "as"); + HDstrcpy(scalename, DS_33_NAME); + HDstrcat(scalename, "as"); if(test_attach_scale(fid, did, scalename, DIM2) < 0) goto out; @@ -1434,8 +1436,8 @@ static int test_int_attachscales(const char *fileext) hid_t did = -1; char dsname[32]; char scalename[32]; - strcpy(dsname, DATASET_NAME); - strcat(dsname, "a"); + HDstrcpy(dsname, DATASET_NAME); + HDstrcat(dsname, "a"); TESTING2("test_int_attachscales"); @@ -1447,28 +1449,28 @@ static int test_int_attachscales(const char *fileext) goto out; if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { - strcpy(scalename, DS_1_NAME); - strcat(scalename, "a"); + HDstrcpy(scalename, DS_1_NAME); + HDstrcat(scalename, "a"); if(test_attach_scale(fid, did, scalename, DIM0) < 0) goto out; - strcpy(scalename, DS_11_NAME); - strcat(scalename, "a"); + HDstrcpy(scalename, DS_11_NAME); + HDstrcat(scalename, "a"); if(test_attach_scale(fid, did, scalename, DIM0) < 0) goto out; - strcpy(scalename, DS_2_NAME); - strcat(scalename, "a"); + HDstrcpy(scalename, DS_2_NAME); + HDstrcat(scalename, "a"); if(test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; - strcpy(scalename, DS_21_NAME); - strcat(scalename, "a"); + HDstrcpy(scalename, DS_21_NAME); + HDstrcat(scalename, "a"); if(test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; - strcpy(scalename, DS_22_NAME); - strcat(scalename, "a"); + HDstrcpy(scalename, DS_22_NAME); + HDstrcat(scalename, "a"); if(test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; @@ -1500,8 +1502,8 @@ static int test_long_attachscales(const char *fileext) hid_t did = -1; char dsname[32]; char scalename[32]; - strcpy(dsname, DATASET_NAME); - strcat(dsname, "al"); + HDstrcpy(dsname, DATASET_NAME); + HDstrcat(dsname, "al"); TESTING2("test_long_attachscales"); @@ -1513,23 +1515,23 @@ static int test_long_attachscales(const char *fileext) goto out; if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { - strcpy(scalename, DS_1_NAME); - strcat(scalename, "al"); + HDstrcpy(scalename, DS_1_NAME); + HDstrcat(scalename, "al"); if(test_attach_scale(fid, did, scalename, DIM0) < 0) goto out; - strcpy(scalename, DS_2_NAME); - strcat(scalename, "al"); + HDstrcpy(scalename, DS_2_NAME); + HDstrcat(scalename, "al"); if(test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; - strcpy(scalename, DS_3_NAME); - strcat(scalename, "al"); + HDstrcpy(scalename, DS_3_NAME); + HDstrcat(scalename, "al"); if(test_attach_scale(fid, did, scalename, DIM2) < 0) goto out; - strcpy(scalename, DS_4_NAME); - strcat(scalename, "al"); + HDstrcpy(scalename, DS_4_NAME); + HDstrcat(scalename, "al"); if(test_attach_scale(fid, did, scalename, DIM3) < 0) goto out; @@ -1561,8 +1563,8 @@ static int test_duplicatelong_attachscales(const char *fileext) hid_t did = -1; char dsname[32]; char scalename[32]; - strcpy(dsname, DATASET_NAME); - strcat(dsname, "al2"); + HDstrcpy(dsname, DATASET_NAME); + HDstrcat(dsname, "al2"); TESTING2("test_duplicatelong_attachscales"); @@ -1574,23 +1576,23 @@ static int test_duplicatelong_attachscales(const char *fileext) goto out; if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { - strcpy(scalename, DS_1_NAME); - strcat(scalename, "al"); + HDstrcpy(scalename, DS_1_NAME); + HDstrcat(scalename, "al"); if(test_attach_scale(fid, did, scalename, DIM0) < 0) goto out; - strcpy(scalename, DS_2_NAME); - strcat(scalename, "al"); + HDstrcpy(scalename, DS_2_NAME); + HDstrcat(scalename, "al"); if(test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; - strcpy(scalename, DS_3_NAME); - strcat(scalename, "al"); + HDstrcpy(scalename, DS_3_NAME); + HDstrcat(scalename, "al"); if(test_attach_scale(fid, did, scalename, DIM2) < 0) goto out; - strcpy(scalename, DS_4_NAME); - strcat(scalename, "al"); + HDstrcpy(scalename, DS_4_NAME); + HDstrcat(scalename, "al"); if(test_attach_scale(fid, did, scalename, DIM3) < 0) goto out; @@ -1622,8 +1624,8 @@ static int test_float_attachscales(const char *fileext) hid_t did = -1; char dsname[32]; char scalename[32]; - strcpy(dsname, DATASET_NAME); - strcat(dsname, "af"); + HDstrcpy(dsname, DATASET_NAME); + HDstrcat(dsname, "af"); TESTING2("test_float_attachscales"); @@ -1635,28 +1637,28 @@ static int test_float_attachscales(const char *fileext) goto out; if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { - strcpy(scalename, DS_1_NAME); - strcat(scalename, "af"); + HDstrcpy(scalename, DS_1_NAME); + HDstrcat(scalename, "af"); if(test_attach_scale(fid, did, scalename, DIM0) < 0) goto out; - strcpy(scalename, DS_11_NAME); - strcat(scalename, "af"); + HDstrcpy(scalename, DS_11_NAME); + HDstrcat(scalename, "af"); if(test_attach_scale(fid, did, scalename, DIM0) < 0) goto out; - strcpy(scalename, DS_2_NAME); - strcat(scalename, "af"); + HDstrcpy(scalename, DS_2_NAME); + HDstrcat(scalename, "af"); if(test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; - strcpy(scalename, DS_21_NAME); - strcat(scalename, "af"); + HDstrcpy(scalename, DS_21_NAME); + HDstrcat(scalename, "af"); if(test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; - strcpy(scalename, DS_22_NAME); - strcat(scalename, "af"); + HDstrcpy(scalename, DS_22_NAME); + HDstrcat(scalename, "af"); if(test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; @@ -1689,8 +1691,8 @@ static int test_numberofscales(const char *fileext) int nscales; /* number of scales in DIM */ char dsname[32]; char scalename[32]; - strcpy(dsname, DATASET_NAME); - strcat(dsname, "a"); + HDstrcpy(dsname, DATASET_NAME); + HDstrcat(dsname, "a"); TESTING2("test_numberofscales"); @@ -1716,8 +1718,8 @@ static int test_numberofscales(const char *fileext) else goto out; - strcpy(dsname, DATASET_NAME); - strcat(dsname, "b"); + HDstrcpy(dsname, DATASET_NAME); + HDstrcat(dsname, "b"); /* make a dataset */ if(create_int_dataset(fid, "b", 1) < 0) @@ -1725,8 +1727,8 @@ static int test_numberofscales(const char *fileext) /* make a DS dataset for the first dimension */ if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { - strcpy(scalename, DS_1_NAME); - strcat(scalename, "b"); + HDstrcpy(scalename, DS_1_NAME); + HDstrcat(scalename, "b"); if(test_attach_scale(fid, did, scalename, DIM0) < 0) goto out; @@ -1770,38 +1772,38 @@ static int test_char_scalenames(const char *fileext) { char dsname[32]; char scalename[32]; char name[32]; - strcpy(dsname, DATASET_NAME); - strcat(dsname, "ac"); + HDstrcpy(dsname, DATASET_NAME); + HDstrcat(dsname, "ac"); if((fid = open_test_file(fileext)) < 0) goto out; TESTING2("set char scale/cmp scale name"); if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { - strcpy(scalename, DS_1_NAME); - strcat(scalename, "ac"); - strcpy(name, SCALE_1_NAME); - strcat(name, "ac"); + HDstrcpy(scalename, DS_1_NAME); + HDstrcat(scalename, "ac"); + HDstrcpy(name, SCALE_1_NAME); + HDstrcat(name, "ac"); if(test_set_scalename(fid, did, scalename, name, DIM0) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM0) < 0) goto out; - strcpy(scalename, DS_2_NAME); - strcat(scalename, "ac"); - strcpy(name, SCALE_2_NAME); - strcat(name, "ac"); + HDstrcpy(scalename, DS_2_NAME); + HDstrcat(scalename, "ac"); + HDstrcpy(name, SCALE_2_NAME); + HDstrcat(name, "ac"); if(test_set_scalename(fid, did, scalename, name, DIM1) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM1) < 0) goto out; - strcpy(scalename, DS_3_NAME); - strcat(scalename, "ac"); - strcpy(name, SCALE_3_NAME); - strcat(name, "ac"); + HDstrcpy(scalename, DS_3_NAME); + HDstrcat(scalename, "ac"); + HDstrcpy(name, SCALE_3_NAME); + HDstrcat(name, "ac"); if(test_set_scalename(fid, did, scalename, name, DIM2) < 0) goto out; @@ -1836,98 +1838,98 @@ static int test_short_scalenames(const char *fileext) { char dsname[32]; char scalename[32]; char name[32]; - strcpy(dsname, DATASET_NAME); - strcat(dsname, "as"); + HDstrcpy(dsname, DATASET_NAME); + HDstrcat(dsname, "as"); if((fid = open_test_file(fileext)) < 0) goto out; TESTING2("set short scale/cmp scale name"); if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { - strcpy(scalename, DS_1_NAME); - strcat(scalename, "as"); - strcpy(name, SCALE_1_NAME); - strcat(name, "as"); + HDstrcpy(scalename, DS_1_NAME); + HDstrcat(scalename, "as"); + HDstrcpy(name, SCALE_1_NAME); + HDstrcat(name, "as"); if(test_set_scalename(fid, did, scalename, name, DIM0) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM0) < 0) goto out; - strcpy(scalename, DS_11_NAME); - strcat(scalename, "as"); - strcpy(name, SCALE_11_NAME); - strcat(name, "as"); + HDstrcpy(scalename, DS_11_NAME); + HDstrcat(scalename, "as"); + HDstrcpy(name, SCALE_11_NAME); + HDstrcat(name, "as"); if(test_set_scalename(fid, did, scalename, name, DIM0) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM0) < 0) goto out; - strcpy(scalename, DS_2_NAME); - strcat(scalename, "as"); - strcpy(name, SCALE_2_NAME); - strcat(name, "as"); + HDstrcpy(scalename, DS_2_NAME); + HDstrcat(scalename, "as"); + HDstrcpy(name, SCALE_2_NAME); + HDstrcat(name, "as"); if(test_set_scalename(fid, did, scalename, name, DIM1) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM1) < 0) goto out; - strcpy(scalename, DS_21_NAME); - strcat(scalename, "as"); - strcpy(name, SCALE_21_NAME); - strcat(name, "as"); + HDstrcpy(scalename, DS_21_NAME); + HDstrcat(scalename, "as"); + HDstrcpy(name, SCALE_21_NAME); + HDstrcat(name, "as"); if(test_set_scalename(fid, did, scalename, name, DIM1) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM1) < 0) goto out; - strcpy(scalename, DS_22_NAME); - strcat(scalename, "as"); - strcpy(name, SCALE_22_NAME); - strcat(name, "as"); + HDstrcpy(scalename, DS_22_NAME); + HDstrcat(scalename, "as"); + HDstrcpy(name, SCALE_22_NAME); + HDstrcat(name, "as"); if(test_set_scalename(fid, did, scalename, name, DIM1) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM1) < 0) goto out; - strcpy(scalename, DS_3_NAME); - strcat(scalename, "as"); - strcpy(name, SCALE_3_NAME); - strcat(name, "as"); + HDstrcpy(scalename, DS_3_NAME); + HDstrcat(scalename, "as"); + HDstrcpy(name, SCALE_3_NAME); + HDstrcat(name, "as"); if(test_set_scalename(fid, did, scalename, name, DIM2) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM2) < 0) goto out; - strcpy(scalename, DS_31_NAME); - strcat(scalename, "as"); - strcpy(name, SCALE_31_NAME); - strcat(name, "as"); + HDstrcpy(scalename, DS_31_NAME); + HDstrcat(scalename, "as"); + HDstrcpy(name, SCALE_31_NAME); + HDstrcat(name, "as"); if(test_set_scalename(fid, did, scalename, name, DIM2) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM2) < 0) goto out; - strcpy(scalename, DS_32_NAME); - strcat(scalename, "as"); - strcpy(name, SCALE_32_NAME); - strcat(name, "as"); + HDstrcpy(scalename, DS_32_NAME); + HDstrcat(scalename, "as"); + HDstrcpy(name, SCALE_32_NAME); + HDstrcat(name, "as"); if(test_set_scalename(fid, did, scalename, name, DIM2) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM2) < 0) goto out; - strcpy(scalename, DS_33_NAME); - strcat(scalename, "as"); - strcpy(name, SCALE_33_NAME); - strcat(name, "as"); + HDstrcpy(scalename, DS_33_NAME); + HDstrcat(scalename, "as"); + HDstrcpy(name, SCALE_33_NAME); + HDstrcat(name, "as"); if(test_set_scalename(fid, did, scalename, name, DIM2) < 0) goto out; @@ -1962,58 +1964,58 @@ static int test_int_scalenames(const char *fileext) { char dsname[32]; char scalename[32]; char name[32]; - strcpy(dsname, DATASET_NAME); - strcat(dsname, "a"); + HDstrcpy(dsname, DATASET_NAME); + HDstrcat(dsname, "a"); if((fid = open_test_file(fileext)) < 0) goto out; TESTING2("set int scale/cmp scale name"); if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { - strcpy(scalename, DS_1_NAME); - strcat(scalename, "a"); - strcpy(name, SCALE_1_NAME); - strcat(name, "a"); + HDstrcpy(scalename, DS_1_NAME); + HDstrcat(scalename, "a"); + HDstrcpy(name, SCALE_1_NAME); + HDstrcat(name, "a"); if(test_set_scalename(fid, did, scalename, name, DIM0) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM0) < 0) goto out; - strcpy(scalename, DS_11_NAME); - strcat(scalename, "a"); - strcpy(name, SCALE_11_NAME); - strcat(name, "a"); + HDstrcpy(scalename, DS_11_NAME); + HDstrcat(scalename, "a"); + HDstrcpy(name, SCALE_11_NAME); + HDstrcat(name, "a"); if(test_set_scalename(fid, did, scalename, name, DIM0) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM0) < 0) goto out; - strcpy(scalename, DS_2_NAME); - strcat(scalename, "a"); - strcpy(name, SCALE_2_NAME); - strcat(name, "a"); + HDstrcpy(scalename, DS_2_NAME); + HDstrcat(scalename, "a"); + HDstrcpy(name, SCALE_2_NAME); + HDstrcat(name, "a"); if(test_set_scalename(fid, did, scalename, name, DIM1) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM1) < 0) goto out; - strcpy(scalename, DS_21_NAME); - strcat(scalename, "a"); - strcpy(name, SCALE_21_NAME); - strcat(name, "a"); + HDstrcpy(scalename, DS_21_NAME); + HDstrcat(scalename, "a"); + HDstrcpy(name, SCALE_21_NAME); + HDstrcat(name, "a"); if(test_set_scalename(fid, did, scalename, name, DIM1) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM1) < 0) goto out; - strcpy(scalename, DS_22_NAME); - strcat(scalename, "a"); - strcpy(name, SCALE_22_NAME); - strcat(name, "a"); + HDstrcpy(scalename, DS_22_NAME); + HDstrcat(scalename, "a"); + HDstrcpy(name, SCALE_22_NAME); + HDstrcat(name, "a"); if(test_set_scalename(fid, did, scalename, name, DIM1) < 0) goto out; @@ -2048,48 +2050,48 @@ static int test_long_scalenames(const char *fileext) { char dsname[32]; char scalename[32]; char name[32]; - strcpy(dsname, DATASET_NAME); - strcat(dsname, "al"); + HDstrcpy(dsname, DATASET_NAME); + HDstrcat(dsname, "al"); if((fid = open_test_file(fileext)) < 0) goto out; TESTING2("set long scale/cmp scale name"); if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { - strcpy(scalename, DS_1_NAME); - strcat(scalename, "al"); - strcpy(name, SCALE_1_NAME); - strcat(name, "al"); + HDstrcpy(scalename, DS_1_NAME); + HDstrcat(scalename, "al"); + HDstrcpy(name, SCALE_1_NAME); + HDstrcat(name, "al"); if(test_set_scalename(fid, did, scalename, name, DIM0) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM0) < 0) goto out; - strcpy(scalename, DS_2_NAME); - strcat(scalename, "al"); - strcpy(name, SCALE_2_NAME); - strcat(name, "al"); + HDstrcpy(scalename, DS_2_NAME); + HDstrcat(scalename, "al"); + HDstrcpy(name, SCALE_2_NAME); + HDstrcat(name, "al"); if(test_set_scalename(fid, did, scalename, name, DIM1) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM1) < 0) goto out; - strcpy(scalename, DS_3_NAME); - strcat(scalename, "al"); - strcpy(name, SCALE_3_NAME); - strcat(name, "al"); + HDstrcpy(scalename, DS_3_NAME); + HDstrcat(scalename, "al"); + HDstrcpy(name, SCALE_3_NAME); + HDstrcat(name, "al"); if(test_set_scalename(fid, did, scalename, name, DIM2) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM2) < 0) goto out; - strcpy(scalename, DS_4_NAME); - strcat(scalename, "al"); - strcpy(name, SCALE_4_NAME); - strcat(name, "al"); + HDstrcpy(scalename, DS_4_NAME); + HDstrcat(scalename, "al"); + HDstrcpy(name, SCALE_4_NAME); + HDstrcat(name, "al"); if(test_set_scalename(fid, did, scalename, name, DIM3) < 0) goto out; @@ -2124,48 +2126,48 @@ static int test_samelong_scalenames(const char *fileext) { char dsname[32]; char scalename[32]; char name[32]; - strcpy(dsname, DATASET_NAME); - strcat(dsname, "al2"); + HDstrcpy(dsname, DATASET_NAME); + HDstrcat(dsname, "al2"); if((fid = open_test_file(fileext)) < 0) goto out; TESTING2("set same long scale/cmp scale name"); if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { - strcpy(scalename, DS_1_NAME); - strcat(scalename, "al"); - strcpy(name, DS_1_NAME); - strcat(name, "al"); + HDstrcpy(scalename, DS_1_NAME); + HDstrcat(scalename, "al"); + HDstrcpy(name, DS_1_NAME); + HDstrcat(name, "al"); if(test_set_scalename(fid, did, scalename, name, DIM0) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM0) < 0) goto out; - strcpy(scalename, DS_2_NAME); - strcat(scalename, "al"); - strcpy(name, DS_2_NAME); - strcat(name, "al"); + HDstrcpy(scalename, DS_2_NAME); + HDstrcat(scalename, "al"); + HDstrcpy(name, DS_2_NAME); + HDstrcat(name, "al"); if(test_set_scalename(fid, did, scalename, name, DIM1) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM1) < 0) goto out; - strcpy(scalename, DS_3_NAME); - strcat(scalename, "al"); - strcpy(name, DS_3_NAME); - strcat(name, "al"); + HDstrcpy(scalename, DS_3_NAME); + HDstrcat(scalename, "al"); + HDstrcpy(name, DS_3_NAME); + HDstrcat(name, "al"); if(test_set_scalename(fid, did, scalename, name, DIM2) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM2) < 0) goto out; - strcpy(scalename, DS_4_NAME); - strcat(scalename, "al"); - strcpy(name, DS_4_NAME); - strcat(name, "al"); + HDstrcpy(scalename, DS_4_NAME); + HDstrcat(scalename, "al"); + HDstrcpy(name, DS_4_NAME); + HDstrcat(name, "al"); if(test_set_scalename(fid, did, scalename, name, DIM3) < 0) goto out; @@ -2200,58 +2202,58 @@ static int test_float_scalenames(const char *fileext) { char dsname[32]; char scalename[32]; char name[32]; - strcpy(dsname, DATASET_NAME); - strcat(dsname, "af"); + HDstrcpy(dsname, DATASET_NAME); + HDstrcat(dsname, "af"); if((fid = open_test_file(fileext)) < 0) goto out; TESTING2("set float scale/cmp scale name"); if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { - strcpy(scalename, DS_1_NAME); - strcat(scalename, "af"); - strcpy(name, SCALE_1_NAME); - strcat(name, "af"); + HDstrcpy(scalename, DS_1_NAME); + HDstrcat(scalename, "af"); + HDstrcpy(name, SCALE_1_NAME); + HDstrcat(name, "af"); if(test_set_scalename(fid, did, scalename, name, DIM0) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM0) < 0) goto out; - strcpy(scalename, DS_11_NAME); - strcat(scalename, "af"); - strcpy(name, SCALE_11_NAME); - strcat(name, "af"); + HDstrcpy(scalename, DS_11_NAME); + HDstrcat(scalename, "af"); + HDstrcpy(name, SCALE_11_NAME); + HDstrcat(name, "af"); if(test_set_scalename(fid, did, scalename, name, DIM0) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM0) < 0) goto out; - strcpy(scalename, DS_2_NAME); - strcat(scalename, "af"); - strcpy(name, SCALE_2_NAME); - strcat(name, "af"); + HDstrcpy(scalename, DS_2_NAME); + HDstrcat(scalename, "af"); + HDstrcpy(name, SCALE_2_NAME); + HDstrcat(name, "af"); if(test_set_scalename(fid, did, scalename, name, DIM1) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM1) < 0) goto out; - strcpy(scalename, DS_21_NAME); - strcat(scalename, "af"); - strcpy(name, SCALE_21_NAME); - strcat(name, "af"); + HDstrcpy(scalename, DS_21_NAME); + HDstrcat(scalename, "af"); + HDstrcpy(name, SCALE_21_NAME); + HDstrcat(name, "af"); if(test_set_scalename(fid, did, scalename, name, DIM1) < 0) goto out; if(test_cmp_scalename(fid, did, scalename, name, DIM1) < 0) goto out; - strcpy(scalename, DS_22_NAME); - strcat(scalename, "af"); - strcpy(name, SCALE_22_NAME); - strcat(name, "af"); + HDstrcpy(scalename, DS_22_NAME); + HDstrcat(scalename, "af"); + HDstrcpy(name, SCALE_22_NAME); + HDstrcat(name, "af"); if(test_set_scalename(fid, did, scalename, name, DIM1) < 0) goto out; @@ -3044,13 +3046,11 @@ static int test_simple(void) *------------------------------------------------------------------------- */ - for(i=0; i<5; i++) - { + for(i=0; i<5; i++) { sprintf(dname,"dset_%d",i); if((did = H5Dopen2(gid,dname, H5P_DEFAULT)) < 0) goto out; - for(j=0; j<5; j++) - { + for(j=0; j<5; j++) { sprintf(sname,"ds_%d",j); if((dsid = H5Dopen2(gid,sname, H5P_DEFAULT)) < 0) goto out; @@ -3097,15 +3097,12 @@ static int test_simple(void) /* try to detach all dimensions. for dimensions 0 and 2, it is an error */ - for(i=0; i 4 ) + if ( HDstrlen( buffer ) > 4 ) { - fclose(file); + HDfclose(file); return -1; } if (sscanf(buffer, "%u", &nentries) != 1) { - fclose(file); + HDfclose(file); return -1; } /* ensure there are a sensible number of colors in the palette */ if ((nentries > 256) || (nentries > palette_size)) { - fclose(file); + HDfclose(file); return(-1); } @@ -867,7 +867,7 @@ static int read_palette(const char* fname, /* extract the red, green and blue color components. */ if (fscanf(file, "%u %u %u", &red, &green, &blue) != 3) { - fclose(file); + HDfclose(file); return -1; } /* store this palette entry */ @@ -877,7 +877,7 @@ static int read_palette(const char* fname, } /* close file */ - fclose(file); + HDfclose(file); return nentries; } diff --git a/hl/test/test_lite.c b/hl/test/test_lite.c index 2b36eb6..59da1f1 100644 --- a/hl/test/test_lite.c +++ b/hl/test/test_lite.c @@ -21,6 +21,8 @@ #define FILE_NAME "test_lite1.h5" #define FILE_NAME2 "test_lite2.h5" +#define FILE_NAME3 "test_lite3.h5" +#define FILE_NAME4 "test_lite4.h5" #define INPUT_FILE "dtype_file.txt" #define DSET0_NAME "2D int array" @@ -367,7 +369,7 @@ static int test_dsets( void ) if ( H5LTread_dataset_string(file_id,DSET7_NAME,data_string_out) < 0 ) goto out; - if ( strcmp(data_string_in,data_string_out) != 0 ) + if ( HDstrcmp(data_string_in,data_string_out) != 0 ) goto out; @@ -536,7 +538,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name ) 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 ) + if ( HDstrcmp( attr_str_in, attr_str_out ) != 0 ) { return -1; } @@ -1015,25 +1017,25 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name ) TESTING("H5LTget_attribute_info"); - dims_out = (hsize_t*) malloc( sizeof(hsize_t) * rank_out ); + if(NULL==(dims_out = (hsize_t*) HDmalloc( sizeof(hsize_t) * rank_out ))) return -1; - if ( H5LTget_attribute_info( loc_id, obj_name, ATTR2_NAME, dims_out, &type_class, - &type_size) < 0 ) + if ( H5LTget_attribute_info( loc_id, obj_name, ATTR2_NAME, dims_out, &type_class, &type_size) < 0 ) { + HDfree( dims_out ); return -1; - - for (i = 0; i < rank_out; i++) - { + } + + for (i = 0; i < rank_out; i++) { if ( dims_out[i] != 5 ) { + HDfree( dims_out ); return -1; } } if ( type_class != H5T_INTEGER ) { + HDfree( dims_out ); return -1; } - - if ( dims_out ) - free( dims_out ); + HDfree( dims_out ); PASSED(); @@ -1066,12 +1068,18 @@ static int test_integers(void) if(H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len)<0) goto out; - dt_str = (char*)calloc(str_len, sizeof(char)); - if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0) + + if(NULL==(dt_str = (char*)HDcalloc(str_len, sizeof(char)))) + goto out; + if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0) { + HDfree(dt_str); goto out; - if(strcmp(dt_str, "H5T_STD_I8BE")) + } + if(HDstrcmp(dt_str, "H5T_STD_I8BE")) { + HDfree(dt_str); goto out; - free(dt_str); + } + HDfree(dt_str); if(H5Tclose(dtype)<0) goto out; @@ -1117,12 +1125,18 @@ static int test_fps(void) if(H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len)<0) goto out; - dt_str = (char*)calloc(str_len, sizeof(char)); - if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0) + + if(NULL==(dt_str = (char*)HDcalloc(str_len, sizeof(char)))) goto out; - if(strcmp(dt_str, "H5T_IEEE_F32BE")) + if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0) { + HDfree(dt_str); goto out; - free(dt_str); + } + if(HDstrcmp(dt_str, "H5T_IEEE_F32BE")) { + HDfree(dt_str); + goto out; + } + HDfree(dt_str); if(H5Tclose(dtype)<0) goto out; @@ -1180,14 +1194,18 @@ static int test_strings(void) if(H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len)<0) goto out; - dt_str = (char*)calloc(str_len, sizeof(char)); - if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0) + if(NULL==(dt_str = (char*)HDcalloc(str_len, sizeof(char)))) + goto out; + if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0) { + HDfree(dt_str); goto out; - if(strcmp(dt_str, "H5T_STRING {\n STRSIZE 13;\n STRPAD H5T_STR_NULLTERM;\n CSET H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }")) { + } + if(HDstrcmp(dt_str, "H5T_STRING {\n STRSIZE 13;\n STRPAD H5T_STR_NULLTERM;\n CSET H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }")) { printf("dt=\n%s\n", dt_str); + HDfree(dt_str); goto out; } - free(dt_str); + HDfree(dt_str); if(H5Tclose(dtype)<0) goto out; @@ -1208,14 +1226,18 @@ static int test_strings(void) if(H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len)<0) goto out; - dt_str = (char*)calloc(str_len, sizeof(char)); - if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0) + if(NULL==(dt_str = (char*)HDcalloc(str_len, sizeof(char)))) + goto out; + if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0) { + HDfree(dt_str); goto out; - if(strcmp(dt_str, "H5T_STRING {\n STRSIZE H5T_VARIABLE;\n STRPAD H5T_STR_NULLPAD;\n CSET H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }")) { + } + if(HDstrcmp(dt_str, "H5T_STRING {\n STRSIZE H5T_VARIABLE;\n STRPAD H5T_STR_NULLPAD;\n CSET H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }")) { printf("dt=\n%s\n", dt_str); + HDfree(dt_str); goto out; } - free(dt_str); + HDfree(dt_str); if(H5Tclose(dtype)<0) goto out; @@ -1257,14 +1279,18 @@ static int test_opaques(void) if(H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len)<0) goto out; - dt_str = (char*)calloc(str_len, sizeof(char)); - if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0) + if(NULL==(dt_str = (char*)HDcalloc(str_len, sizeof(char)))) goto out; - if(strcmp(dt_str, "H5T_OPAQUE {\n OPQ_SIZE 19;\n OPQ_TAG \"This is a tag for opaque type\";\n }")) { + if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0) { + HDfree(dt_str); + goto out; + } + if(HDstrcmp(dt_str, "H5T_OPAQUE {\n OPQ_SIZE 19;\n OPQ_TAG \"This is a tag for opaque type\";\n }")) { printf("dt=\n%s\n", dt_str); + HDfree(dt_str); goto out; } - free(dt_str); + HDfree(dt_str); if(H5Tclose(dtype)<0) goto out; @@ -1311,7 +1337,7 @@ static int test_enums(void) if(H5Tenum_nameof(dtype, &value1, name1, size)<0) goto out; - if(strcmp(name1, "BLUE")) + if(HDstrcmp(name1, "BLUE")) goto out; if(H5Tenum_valueof(dtype, name2, &value2)<0) @@ -1328,16 +1354,20 @@ static int test_enums(void) if(H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len)<0) goto out; - dt_str = (char*)calloc(str_len, sizeof(char)); - if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0) + if(NULL==(dt_str = (char*)HDcalloc(str_len, sizeof(char)))) 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 }")) { + if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0) { + HDfree(dt_str); + goto out; + } + if(HDstrcmp(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); + HDfree(dt_str); goto out; } - free(dt_str); + HDfree(dt_str); if(H5Tclose(dtype)<0) goto out; @@ -1373,30 +1403,34 @@ static int test_variables(void) if(H5Tis_variable_str(dtype)) goto out; - + if(H5Tclose(dtype)<0) goto out; - + if((dtype = H5LTtext_to_dtype("H5T_VLEN { H5T_VLEN { H5T_STD_I32BE } }", H5LT_DDL))<0) goto out; - + if(H5Tis_variable_str(dtype)) goto out; - + if(H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len)<0) goto out; - dt_str = (char*)calloc(str_len, sizeof(char)); - if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0) + if(NULL==(dt_str = (char*)HDcalloc(str_len, sizeof(char)))) goto out; - if(strcmp(dt_str, "H5T_VLEN {\n H5T_VLEN {\n H5T_STD_I32BE\n }\n }")) { + if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0) { + HDfree(dt_str); + goto out; + } + if(HDstrcmp(dt_str, "H5T_VLEN {\n H5T_VLEN {\n H5T_STD_I32BE\n }\n }")) { printf("dt=\n%s\n", dt_str); + HDfree(dt_str); goto out; } - free(dt_str); - + HDfree(dt_str); + if(H5Tclose(dtype)<0) goto out; - + PASSED(); return 0; @@ -1440,15 +1474,19 @@ static int test_arrays(void) if(H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len)<0) goto out; - dt_str = (char*)calloc(str_len, sizeof(char)); - if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0) + if(NULL==(dt_str = (char*)HDcalloc(str_len, sizeof(char)))) goto out; - if(strcmp(dt_str, "H5T_ARRAY {\n [5][7][13] H5T_ARRAY {\n [17][19] H5T_COMPOUND {\n H5T_STD_I8BE \"arr_compound_1\" : 0;\n H5T_STD_I32BE \"arr_compound_2\" : 1;\n }\n }\n }")) { + if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0) { + HDfree(dt_str); + goto out; + } + if(HDstrcmp(dt_str, "H5T_ARRAY {\n [5][7][13] H5T_ARRAY {\n [17][19] H5T_COMPOUND {\n H5T_STD_I8BE \"arr_compound_1\" : 0;\n H5T_STD_I32BE \"arr_compound_2\" : 1;\n }\n }\n }")) { printf("dt=\n%s\n", dt_str); + HDfree(dt_str); goto out; } - free(dt_str); + HDfree(dt_str); if(H5Tclose(dtype)<0) goto out; @@ -1492,14 +1530,18 @@ static int test_compounds(void) if(H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len)<0) goto out; - dt_str = (char*)calloc(str_len, sizeof(char)); - if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0) + if(NULL==(dt_str = (char*)HDcalloc(str_len, sizeof(char)))) + goto out; + if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0) { + HDfree(dt_str); goto out; - if(strcmp(dt_str, "H5T_COMPOUND {\n H5T_STD_I16BE \"one_field\" : 2;\n H5T_STD_U8LE \"two_field\" : 6;\n }")) { + } + if(HDstrcmp(dt_str, "H5T_COMPOUND {\n H5T_STD_I16BE \"one_field\" : 2;\n H5T_STD_U8LE \"two_field\" : 6;\n }")) { printf("dt=\n%s\n", dt_str); + HDfree(dt_str); goto out; } - free(dt_str); + HDfree(dt_str); if(H5Tclose(dtype)<0) goto out; @@ -1509,9 +1551,11 @@ static int test_compounds(void) if((memb_name = H5Tget_member_name(dtype, 1)) == NULL) goto out; - if(strcmp(memb_name, "i16_field")) + if(HDstrcmp(memb_name, "i16_field")) { + HDfree(memb_name); goto out; - free(memb_name); + } + HDfree(memb_name); if((memb_class = H5Tget_member_class(dtype, 2))<0) goto out; @@ -1527,6 +1571,121 @@ out: } /*------------------------------------------------------------------------- +* subroutine for test_text_dtype(): test_compound_bug(). Test case for +* issue 7701. +*------------------------------------------------------------------------- +*/ +static int test_compound_bug(void) +{ + hid_t dtype; + H5T_class_t type_class; + int nmembs; + char* memb_name = NULL; + char* dt_str; + size_t str_len; + char text[] = "H5T_COMPOUND { H5T_STD_I32LE \"state_________________________________________________________________________________\"; H5T_STD_I32LE \"desc_________________________________________________________________________________________\"; H5T_VLEN { H5T_COMPOUND { H5T_ENUM { H5T_STD_I16LE; \"ZERO\" 0; \"ONE\" 1; \"TWO\" 2; \"THREE\" 3; } \"type____\"; H5T_STD_I32LE \"sub_______________________________________________________________________________________________________________\"; H5T_STRING { STRSIZE H5T_VARIABLE; STRPAD H5T_STR_SPACEPAD; CSET H5T_CSET_ASCII; CTYPE H5T_C_S1; } \"sub_desc\"; H5T_STD_I32LE \"final___________________________________________________________________________________________________\"; } } \"sub\"; }"; + char text2[] = + "H5T_COMPOUND {\n" + " H5T_STD_I16LE \"state___________________________" + "__________________________________________________" + "____\" : 0;\n" + " H5T_STD_I16LE \"desc____________________________" + "__________________________________________________" + "___________\" : 2;\n" + " H5T_VLEN { H5T_COMPOUND {\n" + " H5T_ENUM { H5T_STD_I16LE; \"ZERO\" 0; \"ONE\" " + "1; \"TWO\" 2; \"THREE\" 3; } \"type____\" : 0;\n" + " H5T_STD_I32LE \"sub___________________________" + "__________________________________________________" + "__________________________________1\" : 4;\n" + " H5T_STRING { STRSIZE H5T_VARIABLE; STRPAD H5T_" + "STR_SPACEPAD; CSET H5T_CSET_ASCII; CTYPE H5T_C_S1;" + " } \"sub_desc\" : 8;\n" + " H5T_STD_I32LE \"final_________________________" + "__________________________________________________" + "________________________\" : 16;\n" + " } } \"sub\" : 8;\n" + "}\n"; + + TESTING3(" text for compound type of bug fix"); + + if((dtype = H5LTtext_to_dtype(text, H5LT_DDL))<0) + goto out; + + if((type_class = H5Tget_class(dtype))<0) + goto out; + if(type_class != H5T_COMPOUND) + goto out; + + if((memb_name = H5Tget_member_name(dtype, 2)) == NULL) + goto out; + if(HDstrcmp(memb_name, "sub")) { + HDfree(memb_name); + goto out; + } + HDfree(memb_name); + + if(H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len)<0) + goto out; + + if(NULL==(dt_str = (char*)HDcalloc(str_len, sizeof(char)))) + goto out; + if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0) { + HDfree(dt_str); + goto out; + } + HDfree(dt_str); + + if(H5Tclose(dtype)<0) + goto out; + + + /* Test similar datatype in another format */ + if((dtype = H5LTtext_to_dtype(text2, H5LT_DDL))<0) + goto out; + + if((type_class = H5Tget_class(dtype))<0) + goto out; + if(type_class != H5T_COMPOUND) + goto out; + + if((nmembs = H5Tget_nmembers(dtype))<0) + goto out; + if(nmembs != 3) + goto out; + + if((memb_name = H5Tget_member_name(dtype, 1)) == NULL) + goto out; + if(HDstrcmp(memb_name, "desc_________________________________________________________________________________________")) { + HDfree(memb_name); + goto out; + } + HDfree(memb_name); + + if(H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len)<0) + goto out; + + if(NULL==(dt_str = (char*)HDcalloc(str_len, sizeof(char)))) + goto out; + if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0) { + HDfree(dt_str); + goto out; + } + + HDfree(dt_str); + + if(H5Tclose(dtype)<0) + goto out; + + PASSED(); + return 0; + +out: + H5_FAILED(); + return -1; +} + +/*------------------------------------------------------------------------- * subroutine for test_text_dtype(): test_complicated_compound(). *------------------------------------------------------------------------- */ @@ -1543,7 +1702,7 @@ static int test_complicated_compound(void) TESTING3(" text for complicated compound types"); /* Open input file */ - fp = fopen(filename, "r"); + fp = HDfopen(filename, "r"); if(fp == NULL) { printf( "Could not find file %s. Try set $srcdir \n", filename); goto out; @@ -1553,23 +1712,23 @@ static int test_complicated_compound(void) * Library has convenient function getline() but isn't available on * all machines. */ - if((line = (char*)calloc(size, sizeof(char)))==NULL) + if((line = (char*)HDcalloc(size, sizeof(char)))==NULL) goto out; - if(fgets(line, (int)size, fp)==NULL) + if(HDfgets(line, (int)size, fp)==NULL) goto out; - while(strlen(line)==size-1) { + while(HDstrlen(line)==size-1) { size *= 2; if(line) - free(line); - if((line = (char*)calloc(size, sizeof(char)))==NULL) + HDfree(line); + if((line = (char*)HDcalloc(size, sizeof(char)))==NULL) goto out; - if(fseek(fp, 0L, SEEK_SET)!=0) + if(HDfseek(fp, 0L, SEEK_SET)!=0) goto out; - if(fgets(line, (int)size, fp)==NULL) + if(HDfgets(line, (int)size, fp)==NULL) goto out; } - fclose(fp); + HDfclose(fp); fp = NULL; if((dtype = H5LTtext_to_dtype(line, H5LT_DDL))<0) @@ -1587,7 +1746,7 @@ static int test_complicated_compound(void) goto out; if(line) - free(line); + HDfree(line); PASSED(); return 0; @@ -1595,9 +1754,9 @@ static int test_complicated_compound(void) out: if(line) - free(line); + HDfree(line); if(fp) - fclose(fp); + HDfclose(fp); H5_FAILED(); return -1; @@ -1635,6 +1794,9 @@ static int test_text_dtype(void) if(test_compounds()<0) goto out; + if(test_compound_bug()<0) + goto out; + if(test_complicated_compound()<0) goto out; @@ -1645,6 +1807,314 @@ out: } /*------------------------------------------------------------------------- + * test H5LTpath_valid function + *------------------------------------------------------------------------- + */ +static int test_valid_path(void) +{ + hid_t file_id, group; + herr_t status; + FILE *fp = NULL; + htri_t path_valid; + char path[10]; + const char *data_string_in = "test"; + + TESTING("H5LTpath_valid"); + + /* Create a new file using default properties. */ + + /************************************************************** + * The file structure should look like this: + * + * +----------------------------------+ + * | / | + * +----------------------------------+ + * / | \ \ + * / | \ \ + * / | \ \ + * / | \ G8 (dangled external link) + * / DS \ + * / \ + * G1 G2 + * | --> DS1 | + * / \--> DS3 / \ + * / / \ + * G2 DS4 G7 + * | (hard link (dangled soft link + * | to /G1/DS3) to /G1/G20 ) + * / \ + * / \ + * G5 \ + * (soft link G6 (external link /G1 in FILENAME4) + * to /G2) + * + ****************************************************************/ + + file_id = H5Fcreate(FILE_NAME3, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + + /* + * Create dataset "/DS" + */ + if(H5LTmake_dataset_string(file_id, "DS", data_string_in)<0) + goto out; + + /* + * Create an external dangled link + */ + if(H5Lcreate_external("NonExistant_File.h5", "G8", file_id, "DangledExternalLink", H5P_DEFAULT, H5P_DEFAULT)<0) + goto out; + + /* + * Create a group named "G2" in the file. + */ + if((group = H5Gcreate2(file_id, "G2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT))<0) + goto out; + + /* + * Create a dataset named "G2/DS4" in the file. + */ + if(H5LTmake_dataset_string(group, "/G2/DS4", data_string_in)<0) + goto out; + + /* + * Create a soft link + */ + if(H5Lcreate_soft("/G1/G20", file_id, "/G2/G7", H5P_DEFAULT, H5P_DEFAULT) <0) + goto out; + + if(H5Gclose(group)<0) + goto out; + + /* + * Create a group named "G1" in the file. + */ + if((group = H5Gcreate2(file_id, "G1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT))<0) + goto out; + + /* + * Create a group named "G1/DS1" in the file. + */ + if(H5LTmake_dataset_string(group, "/G1/DS1", data_string_in)<0) + goto out; + + if(H5Gclose(group)<0) + goto out; + + /* + * Create a group named "/G3/G5" in the file. + */ + if(H5Lcreate_hard(file_id, "/G2/DS4", file_id, "/G1/DS3",H5P_DEFAULT, H5P_DEFAULT)<0) + goto out; + /* + * Create a group named "/G1/G2" in the file. + */ + if((group = H5Gcreate2(file_id, "/G1/G2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT))<0) + goto out; + + /* + * Create a soft link + */ + if(H5Lcreate_soft("/G2", file_id, "/G1/G2/G5", H5P_DEFAULT, H5P_DEFAULT)<0) + goto out; + + if(H5Gclose(group)<0) + goto out; + + /* + * Create a group named "/G1/G2/G6" in the file. + */ + if((group = H5Gcreate2(file_id, "/G1/G2/G6", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT))<0) + goto out; + + /* + * Create an external link + */ + if(H5Lcreate_external( FILE_NAME4, "G1", group, "ExternalLink", H5P_DEFAULT, H5P_DEFAULT)<0) + goto out; + + if(H5Gclose(group)<0) + goto out; + /* + * Close the file. + */ + status = H5Fclose (file_id); + + /* Create another file for checking external links */ + + /************************************************************** + * The file structure should look like this: + * + * +----+ + * | / | + * +----+ + * | + * | + * | + * G1 + * / \ + * / \ + * DS1 G2 + * (dangled soft link to /G1/G20) + * + ****************************************************************/ + + /* Make external link file */ + file_id = H5Fcreate(FILE_NAME4, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + + /* + * Create a group named "G1" in the file. + */ + if((group = H5Gcreate2(file_id, "G1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT))<0) + goto out; + /* + * Create a dataset named "G1/DS1" in the file. + */ + if(H5LTmake_dataset_string(group, "/G1/DS1", data_string_in)<0) + goto out; + + /* + * Create a dangling soft link + */ + + if(H5Lcreate_soft("/G1/G2", file_id, "/G1/G20", H5P_DEFAULT, H5P_DEFAULT)<0) + goto out; + + if(H5Gclose(group)<0) + goto out; + + H5Fclose(file_id); + + /* Open input file */ + if((file_id = H5Fopen(FILE_NAME3,H5F_ACC_RDONLY, H5P_DEFAULT))<0) + goto out; + + /************************************** + * CHECK ABSOLUTE PATHS + **************************************/ + if( (path_valid = H5LTpath_valid(file_id, "/G1", TRUE)) != TRUE) { + goto out; + } + + if((path_valid = H5LTpath_valid(file_id, "/G1/DS1", TRUE)) != TRUE) + goto out; + + if( (path_valid = H5LTpath_valid(file_id, "/G1/DS3", TRUE)) != TRUE) + goto out; + + if( (path_valid = H5LTpath_valid(file_id, "/G1/G2", TRUE)) != TRUE) + goto out; + + if( (path_valid = H5LTpath_valid(file_id, "/G1/G2/G5", TRUE)) != TRUE) + goto out; + + if( (path_valid = H5LTpath_valid(file_id, "/G2", TRUE)) != TRUE) + goto out; + + /* check soft link points to a valid object*/ + if( (path_valid = H5LTpath_valid(file_id, "/G2/DS4", TRUE)) != TRUE) + goto out; + + /* check if path exist, but not the object */ + if( (path_valid = H5LTpath_valid(file_id, "/G2/G7", FALSE)) != TRUE ) + goto out; + /* check if path exist and if the object exists. It should fail + * since it is a dangling soft link + */ + if( (path_valid = H5LTpath_valid(file_id, "/G2/G7", TRUE)) == TRUE) + goto out; + + /* check soft links */ + if( (path_valid = H5LTpath_valid(file_id, "/G1/G2/G5/DS4", TRUE)) != TRUE) + goto out; + + /************************************** + * CHECK RELATIVE PATHS + ***************************************/ + + if( (group = H5Gopen2(file_id, "/G1", H5P_DEFAULT)) < 0) + goto out; + + /* The identifier (file id) is the object itself, i.e. "." */ + + if((path_valid = H5LTpath_valid(file_id, ".", FALSE)) != TRUE) + goto out; + + if( (path_valid = H5LTpath_valid(file_id, ".", TRUE)) != TRUE) + goto out; + + /* The identifier (group id) is the object itself, i.e. "." */ + + if( (path_valid = H5LTpath_valid(group, ".", TRUE)) != TRUE) + goto out; + + if( (path_valid = H5LTpath_valid(group, "DS3", FALSE)) != TRUE) + goto out; + + if( (path_valid = H5LTpath_valid(group, "DS3", TRUE)) != TRUE) + goto out; + + if( (path_valid = H5LTpath_valid(group, "G2/G5", TRUE)) != TRUE) + goto out; + + /* Check the "./" case */ + if( (path_valid = H5LTpath_valid(group, "./DS3", TRUE)) != TRUE) + goto out; + + if( (path_valid = H5LTpath_valid(group, "./G2/G5", TRUE)) != TRUE) + goto out; + + /* Should fail, does not exist */ + if( (path_valid = H5LTpath_valid(group, "./G2/G20", FALSE)) == TRUE) + goto out; + + /* Should fail, does not exist */ + if( (path_valid = H5LTpath_valid(group, "./G2/G20", TRUE)) == TRUE) + goto out; + + if(H5Gclose(group)<0) + goto out; + + /***************************** + * Check external links + *****************************/ + + /* The dangled external link path is valid */ + if( (path_valid = H5LTpath_valid(file_id, "/DangledExternalLink", FALSE)) != TRUE) + goto out; + + /* The file however does not exists, so the link dangles -> should return false */ + if( (path_valid = H5LTpath_valid(file_id, "/DangledExternalLink", TRUE)) == TRUE) + goto out; + + if( (path_valid = H5LTpath_valid(file_id, "/G1/G2/G6/ExternalLink", FALSE)) != TRUE) + goto out; + + if( (path_valid = H5LTpath_valid(file_id, "/G1/G2/G6/ExternalLink", TRUE)) != TRUE) + goto out; + + if( (path_valid = H5LTpath_valid(file_id, "/G1/G2/G6/ExternalLink/DS1", TRUE)) != TRUE) + goto out; + + if( (path_valid = H5LTpath_valid(file_id, "/G1/G2/G6/ExternalLink/G20", FALSE)) != TRUE) + goto out; + + /* Should fail, does not exist */ + if( (path_valid = H5LTpath_valid(file_id, "/G1/G2/G6/ExternalLink/G20", TRUE)) == TRUE) + goto out; + + if(H5Fclose(file_id)<0) + goto out; + + PASSED(); + return 0; + + out: + H5_FAILED(); + return -1; +} + + +/*------------------------------------------------------------------------- * the main program *------------------------------------------------------------------------- */ @@ -1659,7 +2129,7 @@ int main( void ) nerrors += test_attr(); /* test text-dtype functions */ - nerrors += test_text_dtype(); + nerrors += test_valid_path(); /* check for errors */ if (nerrors) @@ -1672,4 +2142,3 @@ error: } - diff --git a/hl/test/test_packet.c b/hl/test/test_packet.c index 3c258c1..9d3074d 100644 --- a/hl/test/test_packet.c +++ b/hl/test/test_packet.c @@ -72,7 +72,7 @@ static particle_t testPart[NRECORDS] = { */ static int cmp_par(size_t i, size_t j, particle_t *rbuf, particle_t *wbuf ) { - if ( ( strcmp( rbuf[i].name, wbuf[j].name ) != 0 ) || + if ( ( HDstrcmp( rbuf[i].name, wbuf[j].name ) != 0 ) || rbuf[i].lati != wbuf[j].lati || rbuf[i].longi != wbuf[j].longi || rbuf[i].pressure != wbuf[j].pressure || @@ -127,7 +127,7 @@ static int create_hl_table(hid_t fid) /* Define field information */ const char *field_names[NFIELDS] = - { "Name","Latitude", "Longitude", "Pressure", "Temperature" }; + { "Name","Latitude", "Longitude", "Pressure", "Temperature" }; hid_t field_type[NFIELDS]; hid_t string_type; hsize_t chunk_size = 10; @@ -182,7 +182,7 @@ static int test_create_close(hid_t fid) /* Create a datatype for the particle struct */ part_t = make_particle_type(); - assert(part_t != -1); + HDassert(part_t != -1); /* Create the table */ table = H5PTcreate_fl(fid, PT_NAME, part_t, (hsize_t)100, -1); @@ -460,7 +460,7 @@ static int test_big_table(hid_t fid) /* Create a datatype for the particle struct */ part_t = make_particle_type(); - assert(part_t != -1); + HDassert(part_t != -1); /* Create a new table */ table = H5PTcreate_fl(fid, "Packet Test Dataset2", part_t, (hsize_t)33, -1); @@ -712,7 +712,7 @@ static int test_opaque(hid_t fid) if ((part_t = H5Tcreate (H5T_OPAQUE, sizeof(particle_t) )) < 0 ) return -1; - assert(part_t != -1); + HDassert(part_t != -1); /* Tag the opaque datatype */ if ( H5Tset_tag(part_t, "Opaque Particle" ) < 0) @@ -787,7 +787,7 @@ test_compress(void) /* Create a datatype for the particle struct */ part_t = make_particle_type(); - assert(part_t != -1); + HDassert(part_t != -1); /* Create a new table with compression level 8 */ table = H5PTcreate_fl(fid1, "Compressed Test Dataset", part_t, (hsize_t)80, 8); @@ -1059,7 +1059,7 @@ int main(void) /* create a file using default properties */ fid=H5Fcreate(TEST_FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - puts("Testing packet table"); + HDputs("Testing packet table"); /* run tests */ if ( test_packet_table(fid) < 0) diff --git a/hl/test/test_table.c b/hl/test/test_table.c index 0fc4c84..e3e040e 100644 --- a/hl/test/test_table.c +++ b/hl/test/test_table.c @@ -129,8 +129,8 @@ static hid_t h5file_open(const char *fname, unsigned flags) /* open */ if ((fid = H5Fopen(data_file,flags,H5P_DEFAULT))<0) { - fprintf(stderr,"Error: Cannot open file <%s>\n",data_file ); - exit(1); + HDfprintf(stderr,"Error: Cannot open file <%s>\n",data_file ); + HDexit(1); } return fid; @@ -142,16 +142,16 @@ 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 ) { - if ( ( strcmp( rbuf[i].name, wbuf[j].name ) != 0 ) || + if ( ( HDstrcmp( rbuf[i].name, wbuf[j].name ) != 0 ) || rbuf[i].lati != wbuf[j].lati || rbuf[i].longi != wbuf[j].longi || rbuf[i].pressure != wbuf[j].pressure || rbuf[i].temperature != wbuf[j].temperature ) { - fprintf(stderr,"read and write buffers have differences\n"); - fprintf(stderr,"%s %ld %f %f %d\n", + HDfprintf(stderr,"read and write buffers have differences\n"); + HDfprintf(stderr,"%s %ld %f %f %d\n", rbuf[i].name,rbuf[i].longi,rbuf[i].pressure,rbuf[i].temperature,rbuf[i].lati); - fprintf(stderr,"%s %ld %f %f %d\n", + HDfprintf(stderr,"%s %ld %f %f %d\n", wbuf[j].name,wbuf[j].longi,wbuf[j].pressure,wbuf[j].temperature,wbuf[j].lati); return -1; } @@ -495,9 +495,9 @@ static int test_table(hid_t fid, int do_write) *------------------------------------------------------------------------- */ if(do_write) - strcpy(tname,"table2"); + HDstrcpy(tname,"table2"); else - strcpy(tname,"table1"); + HDstrcpy(tname,"table1"); rstart=0; rrecords=8; @@ -645,7 +645,7 @@ static int test_table(hid_t fid, int do_write) wbufd[i].longi = wbuf[i].longi; wbufd[i].pressure = wbuf[i].pressure; wbufd[i].temperature = wbuf[i].temperature; - strcpy(wbufd[i].name, wbuf[i].name ); + HDstrcpy(wbufd[i].name, wbuf[i].name ); } @@ -1027,9 +1027,9 @@ static int test_table(hid_t fid, int do_write) rbuf[i].longi != position_in[i-NRECORDS_ADD+1].longi || rbuf[i].pressure != pressure_in[i-NRECORDS_ADD+1] ) { - fprintf(stderr,"%ld %f %d\n", + HDfprintf(stderr,"%ld %f %d\n", rbuf[i].longi,rbuf[i].pressure,rbuf[i].lati); - fprintf(stderr,"%ld %f %d\n", + HDfprintf(stderr,"%ld %f %d\n", position_in[i].longi,pressure_in[i],position_in[i].lati); goto out; } @@ -1144,7 +1144,7 @@ static int test_table(hid_t fid, int do_write) /* Compare the extracted table with the initial values */ for( i = 0; i < NRECORDS; i++ ) { - if ( ( strcmp( namepre_out[i].name, namepre_in[i].name ) != 0 ) || + if ( ( HDstrcmp( namepre_out[i].name, namepre_in[i].name ) != 0 ) || namepre_out[i].pressure != namepre_in[i].pressure ) { goto out; } @@ -1153,7 +1153,7 @@ static int test_table(hid_t fid, int do_write) /* reset buffer */ for( i = 0; i < NRECORDS; i++ ) { - strcpy( namepre_out[i].name, "\0" ); + HDstrcpy( namepre_out[i].name, "\0" ); namepre_out[i].pressure = -1; } @@ -1173,7 +1173,7 @@ static int test_table(hid_t fid, int do_write) for( i = 0; i < 3; i++ ) { hsize_t iistart = start; - if ( ( strcmp( namepre_out[i].name, namepre_in[iistart+i].name ) != 0 ) || + if ( ( HDstrcmp( namepre_out[i].name, namepre_in[iistart+i].name ) != 0 ) || namepre_out[i].pressure != namepre_in[iistart+i].pressure ) { goto out; } @@ -1351,7 +1351,7 @@ static int test_table(hid_t fid, int do_write) /* compare the extracted table with the initial values */ for( i = 0; i < NRECORDS; i++ ) { - if ( ( strcmp( namepre_out[i].name, namepre_in[i].name ) != 0 ) || + if ( ( HDstrcmp( namepre_out[i].name, namepre_in[i].name ) != 0 ) || namepre_out[i].pressure != namepre_in[i].pressure ) { goto out; } @@ -1360,7 +1360,7 @@ static int test_table(hid_t fid, int do_write) /* reset buffer */ for( i = 0; i < NRECORDS; i++ ) { - strcpy( namepre_out[i].name, "\0" ); + HDstrcpy( namepre_out[i].name, "\0" ); namepre_out[i].pressure = -1; } @@ -1382,7 +1382,7 @@ static int test_table(hid_t fid, int do_write) for( i = 0; i < 3; i++ ) { int iistart = (int) start; - if ( ( strcmp( namepre_out[i].name, wbuf[iistart+i].name ) != 0 ) || + if ( ( HDstrcmp( namepre_out[i].name, wbuf[iistart+i].name ) != 0 ) || namepre_out[i].pressure != wbuf[iistart+i].pressure ) { goto out; } @@ -1423,7 +1423,7 @@ static int test_table(hid_t fid, int do_write) /* compare the extracted table with the original array */ for( i = 0; i < NRECORDS; i++ ) { - if ( ( strcmp( rbuf2[i].name, wbuf[i].name ) != 0 ) || + if ( ( HDstrcmp( rbuf2[i].name, wbuf[i].name ) != 0 ) || rbuf2[i].lati != wbuf[i].lati || rbuf2[i].longi != wbuf[i].longi || rbuf2[i].pressure != wbuf[i].pressure || @@ -1464,7 +1464,7 @@ static int test_table(hid_t fid, int do_write) /* compare the extracted table with the original array */ for( i = 0; i < NRECORDS; i++ ) { - if ( ( strcmp( rbuf3[i].name, wbuf[i].name ) != 0 ) || + if ( ( HDstrcmp( rbuf3[i].name, wbuf[i].name ) != 0 ) || rbuf3[i].lati != wbuf[i].lati || rbuf3[i].longi != wbuf[i].longi || rbuf3[i].temperature != wbuf[i].temperature ) { @@ -1509,10 +1509,10 @@ static int test_table(hid_t fid, int do_write) TESTING2("getting field info"); /* alocate */ - names_out = (char**) malloc( sizeof(char*) * (size_t)NFIELDS ); + names_out = (char**) HDmalloc( sizeof(char*) * (size_t)NFIELDS ); for ( i = 0; i < NFIELDS; i++) { - names_out[i] = (char*) malloc( sizeof(char) * 255 ); + names_out[i] = (char*) HDmalloc( sizeof(char) * 255 ); } /* Get field info */ @@ -1521,7 +1521,7 @@ static int test_table(hid_t fid, int do_write) for ( i = 0; i < NFIELDS; i++) { - if ( (strcmp( field_names[i], names_out[i] ) != 0)) { + if ( (HDstrcmp( field_names[i], names_out[i] ) != 0)) { goto out; } } @@ -1529,9 +1529,9 @@ static int test_table(hid_t fid, int do_write) /* release */ for ( i = 0; i < NFIELDS; i++) { - free ( names_out[i] ); + HDfree ( names_out[i] ); } - free ( names_out ); + HDfree ( names_out ); PASSED(); @@ -1564,7 +1564,7 @@ int main(void) /* create a file using default properties */ fid=H5Fcreate("test_table.h5",H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT); - puts("Testing table with file creation mode (read/write in native architecture):"); + HDputs("Testing table with file creation mode (read/write in native architecture):"); /* test, do write */ if (test_table(fid,1)<0) @@ -1577,7 +1577,7 @@ int main(void) * test2: open a file written in test1 on a big-endian machine *------------------------------------------------------------------------- */ - puts("Testing table with file open mode (read big-endian data):"); + HDputs("Testing table with file open mode (read big-endian data):"); fid=h5file_open(TEST_FILE_BE,flags); @@ -1592,7 +1592,7 @@ int main(void) * test3: open a file written in test1 on a little-endian machine *------------------------------------------------------------------------- */ - puts("Testing table with file open mode (read little-endian data):"); + HDputs("Testing table with file open mode (read little-endian data):"); fid=h5file_open(TEST_FILE_LE,flags); @@ -1607,7 +1607,7 @@ int main(void) * test4: open a file written in test1 on the Cray T3 machine *------------------------------------------------------------------------- */ - puts("Testing table with file open mode (read Cray data):"); + HDputs("Testing table with file open mode (read Cray data):"); fid=h5file_open(TEST_FILE_CRAY,flags); diff --git a/hl/tools/CMakeLists.txt b/hl/tools/CMakeLists.txt index e2b605d..4fc83b7 100644 --- a/hl/tools/CMakeLists.txt +++ b/hl/tools/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8) +cmake_minimum_required (VERSION 2.8.6) PROJECT (HDF5_HL_TOOLS) #----------------------------------------------------------------------------- @@ -20,6 +20,7 @@ INCLUDE_DIRECTORIES (${HDF5_HL_TOOLS_SOURCE_DIR}/gif2h5) ADD_EXECUTABLE (gif2h5 ${GIF2H5_SRCS}) TARGET_NAMING (gif2h5 ${LIB_TYPE}) TARGET_LINK_LIBRARIES (gif2h5 ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) +SET_TARGET_PROPERTIES (gif2h5 PROPERTIES FOLDER tools/hl) #-- Add h52gif program SET (hdf2gif_SRCS @@ -29,6 +30,7 @@ SET (hdf2gif_SRCS ADD_EXECUTABLE (h52gif ${hdf2gif_SRCS}) TARGET_NAMING (h52gif ${LIB_TYPE}) TARGET_LINK_LIBRARIES (h52gif ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) +SET_TARGET_PROPERTIES (h52gif PROPERTIES FOLDER tools/hl) # -------------------------------------------------------------------- # This executable can generate the actual test files - Currently not @@ -39,6 +41,7 @@ IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) ADD_EXECUTABLE (hl_h52gifgentest ${HDF5_HL_TOOLS_SOURCE_DIR}/gif2h5/h52gifgentst.c) TARGET_NAMING (hl_h52gifgentest ${LIB_TYPE}) TARGET_LINK_LIBRARIES (hl_h52gifgentest ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET}) + SET_TARGET_PROPERTIES (hl_h52gifgentest PROPERTIES FOLDER generator/tools/hl) # ADD_TEST (NAME hl_h52gifgentest COMMAND $) ENDIF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) diff --git a/hl/tools/Makefile.in b/hl/tools/Makefile.in index db4388b..2cfefcc 100644 --- a/hl/tools/Makefile.in +++ b/hl/tools/Makefile.in @@ -179,6 +179,7 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ +FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ @@ -199,10 +200,12 @@ H5_LONE_COLON = @H5_LONE_COLON@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ +HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ +HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ diff --git a/hl/tools/gif2h5/Makefile.in b/hl/tools/gif2h5/Makefile.in index ae888c6..c857fed 100644 --- a/hl/tools/gif2h5/Makefile.in +++ b/hl/tools/gif2h5/Makefile.in @@ -189,6 +189,7 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ +FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ @@ -209,10 +210,12 @@ H5_LONE_COLON = @H5_LONE_COLON@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ +HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ +HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ diff --git a/hl/tools/gif2h5/gif2hdf.c b/hl/tools/gif2h5/gif2hdf.c index 1225613..810be78 100644 --- a/hl/tools/gif2h5/gif2hdf.c +++ b/hl/tools/gif2h5/gif2hdf.c @@ -17,6 +17,7 @@ #include #include "gif.h" +#include "h5tools.h" #include "h5tools_utils.h" @@ -49,6 +50,9 @@ main(int argv , char *argc[]) GifMemoryStruct.GifApplicationExtension = NULL; GifMemoryStruct.GifCommentExtension = NULL; + /* Initialize h5tools lib */ + h5tools_init(); + if ( argc[1] && (strcmp("-V",argc[1])==0) ) { print_version("gif2h5"); diff --git a/hl/tools/gif2h5/gif2mem.c b/hl/tools/gif2h5/gif2mem.c index 907fb80..7995bb4 100644 --- a/hl/tools/gif2h5/gif2mem.c +++ b/hl/tools/gif2h5/gif2mem.c @@ -37,7 +37,7 @@ #include "gif.h" -#define VERSION "1.00" +#define GIF2VERSION "1.00" GIFTOMEM Gif2Mem(BYTE *MemGif) diff --git a/hl/tools/gif2h5/hdf2gif.c b/hl/tools/gif2h5/hdf2gif.c index cc8e864..090d657 100644 --- a/hl/tools/gif2h5/hdf2gif.c +++ b/hl/tools/gif2h5/hdf2gif.c @@ -17,6 +17,7 @@ #include #include "gif.h" #include "H5IMpublic.h" +#include "h5tools.h" #include "h5tools_utils.h" @@ -70,6 +71,9 @@ int main(int argc , char **argv) char *image_name = NULL; int idx; + /* Initialize h5tools lib */ + h5tools_init(); + if ( argv[1] && (strcmp("-V",argv[1])==0) ) { print_version("gif2h5"); diff --git a/hl/tools/h5watch/Makefile.in b/hl/tools/h5watch/Makefile.in index 3c67028..745b6a4 100644 --- a/hl/tools/h5watch/Makefile.in +++ b/hl/tools/h5watch/Makefile.in @@ -186,6 +186,7 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ +FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ @@ -206,10 +207,12 @@ H5_LONE_COLON = @H5_LONE_COLON@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ +HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ +HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ diff --git a/perform/CMakeLists.txt b/perform/CMakeLists.txt index 15db402..1bcf628 100644 --- a/perform/CMakeLists.txt +++ b/perform/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8) +cmake_minimum_required (VERSION 2.8.6) PROJECT (HDF5_PERFORM ) #----------------------------------------------------------------------------- @@ -19,6 +19,7 @@ SET (h5perf_serial_SRCS ADD_EXECUTABLE (h5perf_serial ${h5perf_serial_SRCS}) TARGET_NAMING (h5perf_serial ${LIB_TYPE}) TARGET_LINK_LIBRARIES (h5perf_serial ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) +SET_TARGET_PROPERTIES (h5perf_serial PROPERTIES FOLDER perform) IF (HDF5_BUILD_PERFORM_STANDALONE) #-- Adding test for h5perf_serial_alone @@ -33,6 +34,7 @@ IF (HDF5_BUILD_PERFORM_STANDALONE) ) TARGET_NAMING (h5perf_serial_alone ${LIB_TYPE}) TARGET_LINK_LIBRARIES (h5perf_serial_alone ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + SET_TARGET_PROPERTIES (h5perf_serial_alone PROPERTIES FOLDER perform) ENDIF (HDF5_BUILD_PERFORM_STANDALONE) #-- Adding test for chunk @@ -42,6 +44,7 @@ SET (chunk_SRCS ADD_EXECUTABLE(chunk ${chunk_SRCS}) TARGET_NAMING (chunk ${LIB_TYPE}) TARGET_LINK_LIBRARIES(chunk ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) +SET_TARGET_PROPERTIES (chunk PROPERTIES FOLDER perform) #-- Adding test for iopipe SET (iopipe_SRCS @@ -50,6 +53,7 @@ SET (iopipe_SRCS ADD_EXECUTABLE (iopipe ${iopipe_SRCS}) TARGET_NAMING (iopipe ${LIB_TYPE}) TARGET_LINK_LIBRARIES (iopipe ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) +SET_TARGET_PROPERTIES (iopipe PROPERTIES FOLDER perform) #-- Adding test for overhead SET (overhead_SRCS @@ -58,6 +62,7 @@ SET (overhead_SRCS ADD_EXECUTABLE (overhead ${overhead_SRCS}) TARGET_NAMING (overhead ${LIB_TYPE}) TARGET_LINK_LIBRARIES (overhead ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) +SET_TARGET_PROPERTIES (overhead PROPERTIES FOLDER perform) #-- Adding test for perf_meta SET (perf_meta_SRCS @@ -66,6 +71,7 @@ SET (perf_meta_SRCS ADD_EXECUTABLE (perf_meta ${perf_meta_SRCS}) TARGET_NAMING (perf_meta ${LIB_TYPE}) TARGET_LINK_LIBRARIES (perf_meta ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) +SET_TARGET_PROPERTIES (perf_meta PROPERTIES FOLDER perform) #-- Adding test for zip_perf SET (zip_perf_SRCS @@ -74,6 +80,7 @@ SET (zip_perf_SRCS ADD_EXECUTABLE (zip_perf ${zip_perf_SRCS}) TARGET_NAMING (zip_perf ${LIB_TYPE}) TARGET_LINK_LIBRARIES (zip_perf ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) +SET_TARGET_PROPERTIES (zip_perf PROPERTIES FOLDER perform) IF (H5_HAVE_PARALLEL) #-- Adding test for h5perf @@ -85,6 +92,7 @@ IF (H5_HAVE_PARALLEL) ADD_EXECUTABLE (h5perf ${h5perf_SRCS}) TARGET_NAMING (h5perf ${LIB_TYPE}) TARGET_LINK_LIBRARIES (h5perf ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) + SET_TARGET_PROPERTIES (h5perf PROPERTIES FOLDER perform) IF (HDF5_BUILD_PERFORM_STANDALONE) #-- Adding test for h5perf @@ -99,6 +107,7 @@ IF (H5_HAVE_PARALLEL) ) TARGET_NAMING (h5perf_alone ${LIB_TYPE}) TARGET_LINK_LIBRARIES (h5perf_alone ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) + SET_TARGET_PROPERTIES (h5perf_alone PROPERTIES FOLDER perform) ENDIF (HDF5_BUILD_PERFORM_STANDALONE) #-- Adding test for benchpar @@ -108,14 +117,18 @@ IF (H5_HAVE_PARALLEL) ADD_EXECUTABLE (benchpar ${benchpar_SRCS}) TARGET_NAMING (benchpar ${LIB_TYPE}) TARGET_LINK_LIBRARIES (benchpar ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) + SET_TARGET_PROPERTIES (benchpar PROPERTIES FOLDER perform) #-- Adding test for mpi-perf - SET (mpi-perf_SRCS - ${HDF5_PERFORM_SOURCE_DIR}/mpi-perf.c - ) - ADD_EXECUTABLE (mpi-perf ${mpi-perf_SRCS}) - TARGET_NAMING (mpi-perf ${LIB_TYPE}) - TARGET_LINK_LIBRARIES (mpi-perf ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) + IF (NOT WIN32) + SET (mpi-perf_SRCS + ${HDF5_PERFORM_SOURCE_DIR}/mpi-perf.c + ) + ADD_EXECUTABLE (mpi-perf ${mpi-perf_SRCS}) + TARGET_NAMING (mpi-perf ${LIB_TYPE}) + TARGET_LINK_LIBRARIES (mpi-perf ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) + SET_TARGET_PROPERTIES (mpi-perf PROPERTIES FOLDER perform) + ENDIF (NOT WIN32) ENDIF (H5_HAVE_PARALLEL) @@ -138,7 +151,7 @@ ADD_CUSTOM_COMMAND ( # Remove any output file left over from previous test run ADD_TEST ( - NAME h5perform-clear-objects + NAME PERFORM_h5perform-clear-objects COMMAND ${CMAKE_COMMAND} -E remove chunk.h5 @@ -151,31 +164,33 @@ ADD_TEST ( x-gnuplot ) -ADD_TEST (NAME h5perf_serial COMMAND $) +ADD_TEST (NAME PERFORM_h5perf_serial COMMAND $) IF (HDF5_BUILD_PERFORM_STANDALONE) - ADD_TEST (NAME h5perf_serial_alone COMMAND $) + ADD_TEST (NAME PERFORM_h5perf_serial_alone COMMAND $) ENDIF (HDF5_BUILD_PERFORM_STANDALONE) -ADD_TEST (NAME chunk COMMAND $) +ADD_TEST (NAME PERFORM_chunk COMMAND $) -ADD_TEST (NAME iopipe COMMAND $) +ADD_TEST (NAME PERFORM_iopipe COMMAND $) -ADD_TEST (NAME overhead COMMAND $) +ADD_TEST (NAME PERFORM_overhead COMMAND $) -ADD_TEST (NAME perf_meta COMMAND $) +ADD_TEST (NAME PERFORM_perf_meta COMMAND $) -ADD_TEST (NAME zip_perf_help COMMAND $ "-h") -ADD_TEST (NAME zip_perf COMMAND $ tfilters.h5) +ADD_TEST (NAME PERFORM_zip_perf_help COMMAND $ "-h") +ADD_TEST (NAME PERFORM_zip_perf COMMAND $ tfilters.h5) IF (H5_HAVE_PARALLEL) - ADD_TEST (NAME h5perf COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) + ADD_TEST (NAME PERFORM_h5perf COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) IF (HDF5_BUILD_PERFORM_STANDALONE) - ADD_TEST (NAME h5perf_alone COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) + ADD_TEST (NAME PERFORM_h5perf_alone COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) ENDIF (HDF5_BUILD_PERFORM_STANDALONE) - ADD_TEST (NAME benchpar COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) +# ADD_TEST (NAME PERFORM_benchpar COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) - ADD_TEST (NAME mpi-perf COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) + IF (NOT WIN32) + ADD_TEST (NAME PERFORM_mpi-perf COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) + ENDIF (NOT WIN32) ENDIF (H5_HAVE_PARALLEL) diff --git a/perform/Makefile.in b/perform/Makefile.in index d0264e7..39739a4 100644 --- a/perform/Makefile.in +++ b/perform/Makefile.in @@ -224,6 +224,7 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ +FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ @@ -244,10 +245,12 @@ H5_LONE_COLON = @H5_LONE_COLON@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ +HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ +HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ diff --git a/perform/benchpar.c b/perform/benchpar.c index 035e9d6..24146e4 100644 --- a/perform/benchpar.c +++ b/perform/benchpar.c @@ -13,7 +13,9 @@ * access to either file, you may request a copy from help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +#ifdef H5_HAVE_UNISTD_H #include +#endif #include #include #include @@ -23,6 +25,11 @@ #include "hdf5.h" /* Local macros */ +#ifdef H5_HAVE_VISUAL_STUDIO +#define HDgetlogin() Wgetlogin() +#else /* H5_HAVE_VISUAL_STUDIO */ +#define HDgetlogin() getlogin() +#endif /* H5_HAVE_VISUAL_STUDIO */ /* * HDF Boolean type. @@ -115,13 +122,13 @@ static hid_t create_fapl(MPI_Comm comm, MPI_Info info, int acc_type ) /* set parallel access with communicator, using MPI-I/O driver */ if (acc_type == FACC_MPIO) { - ret = H5Pset_fapl_mpio(fapl, comm, info); + ret = H5Pset_fapl_mpio(fapl, comm, info); assert(ret>=0); } /* end if */ /* set parallel access with communicator, using MPI-posix driver */ if (acc_type == FACC_MPIPOSIX) { - ret = H5Pset_fapl_mpiposix(fapl, comm, use_gpfs); + ret = H5Pset_fapl_mpiposix(fapl, comm, use_gpfs); assert(ret>=0); } /* end if */ @@ -312,7 +319,7 @@ int main(int argc, char *argv[]) char *login; /* Pointer to login name */ /* Get the login name for this user */ - login=getlogin(); + login=HDgetlogin(); if(login==NULL) login=DEFAULT_USERNAME; diff --git a/perform/iopipe.c b/perform/iopipe.c index c72e3aa..85063fa 100644 --- a/perform/iopipe.c +++ b/perform/iopipe.c @@ -28,34 +28,34 @@ #endif -#define RAW_FILE_NAME "iopipe.raw" -#define HDF5_FILE_NAME "iopipe.h5" -#define HEADING "%-16s" -#define PROGRESS '=' +#define RAW_FILE_NAME "iopipe.raw" +#define HDF5_FILE_NAME "iopipe.h5" +#define HEADING "%-16s" +#define PROGRESS '=' #if 0 /* Normal testing */ -#define REQUEST_SIZE_X 4579 -#define REQUEST_SIZE_Y 4579 -#define NREAD_REQUESTS 45 -#define NWRITE_REQUESTS 45 +#define REQUEST_SIZE_X 4579 +#define REQUEST_SIZE_Y 4579 +#define NREAD_REQUESTS 45 +#define NWRITE_REQUESTS 45 #else /* Speedy testing */ -#define REQUEST_SIZE_X 1000 -#define REQUEST_SIZE_Y 1000 -#define NREAD_REQUESTS 45 -#define NWRITE_REQUESTS 45 +#define REQUEST_SIZE_X 1000 +#define REQUEST_SIZE_Y 1000 +#define NREAD_REQUESTS 45 +#define NWRITE_REQUESTS 45 #endif /*------------------------------------------------------------------------- - * Function: print_stats + * Function: print_stats * - * Purpose: Prints statistics + * Purpose: Prints statistics * - * Return: void + * Return: void * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, March 12, 1998 * * Modifications: @@ -65,63 +65,63 @@ #ifdef H5_HAVE_GETRUSAGE static void print_stats (const char *prefix, - struct rusage *r_start, struct rusage *r_stop, - struct timeval *t_start, struct timeval *t_stop, - size_t nbytes) + struct rusage *r_start, struct rusage *r_stop, + struct timeval *t_start, struct timeval *t_stop, + size_t nbytes) #else /* H5_HAVE_GETRUSAGE */ static void print_stats (const char *prefix, - struct timeval *r_start, struct timeval *r_stop, - struct timeval *t_start, struct timeval *t_stop, - size_t nbytes) + struct timeval *r_start, struct timeval *r_stop, + struct timeval *t_start, struct timeval *t_stop, + size_t nbytes) #endif /* H5_HAVE_GETRUSAGE */ { - double e_time, bw; + double e_time, bw; #ifdef H5_HAVE_GETRUSAGE - double u_time, s_time; + double u_time, s_time; u_time = ((double)(r_stop->ru_utime.tv_sec)+ - (double)(r_stop->ru_utime.tv_usec)/1000000.0) - - ((double)(r_start->ru_utime.tv_sec)+ - (double)(r_start->ru_utime.tv_usec)/1000000.0); + (double)(r_stop->ru_utime.tv_usec)/1000000.0) - + ((double)(r_start->ru_utime.tv_sec)+ + (double)(r_start->ru_utime.tv_usec)/1000000.0); s_time = ((double)(r_stop->ru_stime.tv_sec)+ - (double)(r_stop->ru_stime.tv_usec)/1000000.0) - - ((double)(r_start->ru_stime.tv_sec)+ - (double)(r_start->ru_stime.tv_usec)/1000000.0); + (double)(r_stop->ru_stime.tv_usec)/1000000.0) - + ((double)(r_start->ru_stime.tv_sec)+ + (double)(r_start->ru_stime.tv_usec)/1000000.0); #endif #ifndef H5_HAVE_SYS_TIMEB e_time = ((double)(t_stop->tv_sec)+ - (double)(t_stop->tv_usec)/1000000.0) - - ((double)(t_start->tv_sec)+ - (double)(t_start->tv_usec)/1000000.0); + (double)(t_stop->tv_usec)/1000000.0) - + ((double)(t_start->tv_sec)+ + (double)(t_start->tv_usec)/1000000.0); #else e_time = ((double)(t_stop->tv_sec)+ - (double)(t_stop->tv_usec)/1000.0) - - ((double)(t_start->tv_sec)+ - (double)(t_start->tv_usec)/1000.0); + (double)(t_stop->tv_usec)/1000.0) - + ((double)(t_start->tv_sec)+ + (double)(t_start->tv_usec)/1000.0); #endif bw = (double)nbytes / e_time; #ifdef H5_HAVE_GETRUSAGE printf (HEADING "%1.2fuser %1.2fsystem %1.2felapsed %1.2fMB/s\n", - prefix, u_time, s_time, e_time, bw/(1024*1024)); + prefix, u_time, s_time, e_time, bw/(1024*1024)); #else printf (HEADING "%1.2felapsed %1.2fMB/s\n", - prefix, e_time, bw/(1024*1024)); + prefix, e_time, bw/(1024*1024)); #endif } /*------------------------------------------------------------------------- - * Function: synchronize + * Function: synchronize * * Purpose: * - * Return: void + * Return: void * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, March 12, 1998 * * Modifications: @@ -132,7 +132,7 @@ static void synchronize (void) { #ifdef H5_HAVE_SYSTEM -#if defined(_WIN32) && ! defined(__CYGWIN__) +#if defined(H5_HAVE_WIN32_API) && ! defined(__CYGWIN__) _flushall(); #else HDsystem("sync"); @@ -143,15 +143,15 @@ synchronize (void) /*------------------------------------------------------------------------- - * Function: main + * Function: main * * Purpose: * - * Return: Success: + * Return: Success: * - * Failure: + * Failure: * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, March 12, 1998 * * Modifications: @@ -161,29 +161,29 @@ synchronize (void) int main (void) { - static hsize_t size[2] = {REQUEST_SIZE_X, REQUEST_SIZE_Y}; - static unsigned nread = NREAD_REQUESTS, nwrite = NWRITE_REQUESTS; + static hsize_t size[2] = {REQUEST_SIZE_X, REQUEST_SIZE_Y}; + static unsigned nread = NREAD_REQUESTS, nwrite = NWRITE_REQUESTS; - unsigned char *the_data = NULL; - hid_t file, dset, file_space = -1; - herr_t status; + unsigned char *the_data = NULL; + hid_t file, dset, file_space = -1; + herr_t status; #ifdef H5_HAVE_GETRUSAGE - struct rusage r_start, r_stop; + struct rusage r_start, r_stop; #else struct timeval r_start, r_stop; #endif - struct timeval t_start, t_stop; - int fd; - unsigned u; - hssize_t n; - off_t offset; - hsize_t start[2]; - hsize_t count[2]; + struct timeval t_start, t_stop; + int fd; + unsigned u; + hssize_t n; + off_t offset; + hsize_t start[2]; + hsize_t count[2]; #ifdef H5_HAVE_SYS_TIMEB - struct _timeb *tbstart = malloc(sizeof(struct _timeb)); - struct _timeb *tbstop = malloc(sizeof(struct _timeb)); + struct _timeb *tbstart = malloc(sizeof(struct _timeb)); + struct _timeb *tbstop = malloc(sizeof(struct _timeb)); #endif /* * The extra cast in the following statement is a bug workaround for the @@ -191,7 +191,7 @@ main (void) * 1998-11-06 ptl */ printf ("I/O request size is %1.1fMB\n", - (double)(hssize_t)(size[0]*size[1])/1024.0*1024); + (double)(hssize_t)(size[0]*size[1])/1024.0*1024); /* Open the files */ file = H5Fcreate (HDF5_FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -218,14 +218,14 @@ main (void) HDgettimeofday(&t_start, NULL); #else #ifdef H5_HAVE_SYS_TIMEB - _ftime(tbstart); + _ftime(tbstart); #endif #endif fprintf (stderr, HEADING, "fill raw"); for(u = 0; u < nwrite; u++) { - putc (PROGRESS, stderr); - HDfflush(stderr); - HDmemset(the_data, 0xAA, (size_t)(size[0]*size[1])); + putc (PROGRESS, stderr); + HDfflush(stderr); + HDmemset(the_data, 0xAA, (size_t)(size[0]*size[1])); } #ifdef H5_HAVE_GETRUSAGE HDgetrusage(RUSAGE_SELF, &r_stop); @@ -234,17 +234,17 @@ main (void) HDgettimeofday(&t_stop, NULL); #else #ifdef H5_HAVE_SYS_TIMEB - _ftime(tbstop); - t_start.tv_sec = tbstart->time; - t_start.tv_usec = tbstart->millitm; - t_stop.tv_sec = tbstop->time; - t_stop.tv_usec = tbstop->millitm; + _ftime(tbstop); + t_start.tv_sec = tbstart->time; + t_start.tv_usec = tbstart->millitm; + t_stop.tv_sec = tbstop->time; + t_stop.tv_usec = tbstop->millitm; #endif #endif putc ('\n', stderr); print_stats ("fill raw", - &r_start, &r_stop, &t_start, &t_stop, - (size_t)(nread*size[0]*size[1])); + &r_start, &r_stop, &t_start, &t_stop, + (size_t)(nread*size[0]*size[1])); /* Fill hdf5 */ @@ -256,16 +256,16 @@ main (void) HDgettimeofday(&t_start, NULL); #else #ifdef H5_HAVE_SYS_TIMEB - _ftime(tbstart); + _ftime(tbstart); #endif #endif fprintf (stderr, HEADING, "fill hdf5"); for(u = 0; u < nread; u++) { - putc (PROGRESS, stderr); - HDfflush(stderr); - status = H5Dread (dset, H5T_NATIVE_UCHAR, file_space, file_space, - H5P_DEFAULT, the_data); - assert (status>=0); + putc (PROGRESS, stderr); + HDfflush(stderr); + status = H5Dread (dset, H5T_NATIVE_UCHAR, file_space, file_space, + H5P_DEFAULT, the_data); + assert (status>=0); } #ifdef H5_HAVE_GETRUSAGE HDgetrusage(RUSAGE_SELF, &r_stop); @@ -274,17 +274,17 @@ main (void) HDgettimeofday(&t_stop, NULL); #else #ifdef H5_HAVE_SYS_TIMEB - _ftime(tbstop); - t_start.tv_sec = tbstart->time; - t_start.tv_usec = tbstart->millitm; - t_stop.tv_sec = tbstop->time; - t_stop.tv_usec = tbstop->millitm; + _ftime(tbstop); + t_start.tv_sec = tbstart->time; + t_start.tv_usec = tbstart->millitm; + t_stop.tv_sec = tbstop->time; + t_stop.tv_usec = tbstop->millitm; #endif #endif putc ('\n', stderr); print_stats ("fill hdf5", - &r_start, &r_stop, &t_start, &t_stop, - (size_t)(nread*size[0]*size[1])); + &r_start, &r_stop, &t_start, &t_stop, + (size_t)(nread*size[0]*size[1])); /* Write the raw dataset */ synchronize (); @@ -295,17 +295,17 @@ main (void) HDgettimeofday(&t_start, NULL); #else #ifdef H5_HAVE_SYS_TIMEB - _ftime(tbstart); + _ftime(tbstart); #endif #endif fprintf (stderr, HEADING, "out raw"); for(u = 0; u < nwrite; u++) { - putc (PROGRESS, stderr); - HDfflush(stderr); - offset = HDlseek (fd, (off_t)0, SEEK_SET); - assert (0==offset); - n = HDwrite (fd, the_data, (size_t)(size[0]*size[1])); - assert (n>=0 && (size_t)n==size[0]*size[1]); + putc (PROGRESS, stderr); + HDfflush(stderr); + offset = HDlseek (fd, (off_t)0, SEEK_SET); + assert (0==offset); + n = HDwrite (fd, the_data, (size_t)(size[0]*size[1])); + assert (n>=0 && (size_t)n==size[0]*size[1]); } #ifdef H5_HAVE_GETRUSAGE HDgetrusage(RUSAGE_SELF, &r_stop); @@ -314,17 +314,17 @@ main (void) HDgettimeofday(&t_stop, NULL); #else #ifdef H5_HAVE_SYS_TIMEB - _ftime(tbstop); - t_start.tv_sec = tbstart->time; - t_start.tv_usec = tbstart->millitm; - t_stop.tv_sec = tbstop->time; - t_stop.tv_usec = tbstop->millitm; + _ftime(tbstop); + t_start.tv_sec = tbstart->time; + t_start.tv_usec = tbstart->millitm; + t_stop.tv_sec = tbstop->time; + t_stop.tv_usec = tbstop->millitm; #endif #endif putc ('\n', stderr); print_stats ("out raw", - &r_start, &r_stop, &t_start, &t_stop, - (size_t)(nread*size[0]*size[1])); + &r_start, &r_stop, &t_start, &t_stop, + (size_t)(nread*size[0]*size[1])); /* Write the hdf5 dataset */ synchronize (); @@ -335,16 +335,16 @@ main (void) HDgettimeofday(&t_start, NULL); #else #ifdef H5_HAVE_SYS_TIMEB - _ftime(tbstart); + _ftime(tbstart); #endif #endif fprintf (stderr, HEADING, "out hdf5"); for(u = 0; u < nwrite; u++) { - putc (PROGRESS, stderr); - HDfflush(stderr); - status = H5Dwrite (dset, H5T_NATIVE_UCHAR, H5S_ALL, H5S_ALL, - H5P_DEFAULT, the_data); - assert (status>=0); + putc (PROGRESS, stderr); + HDfflush(stderr); + status = H5Dwrite (dset, H5T_NATIVE_UCHAR, H5S_ALL, H5S_ALL, + H5P_DEFAULT, the_data); + assert (status>=0); } #ifdef H5_HAVE_GETRUSAGE HDgetrusage(RUSAGE_SELF, &r_stop); @@ -353,17 +353,17 @@ main (void) HDgettimeofday(&t_stop, NULL); #else #ifdef H5_HAVE_SYS_TIMEB - _ftime(tbstop); - t_start.tv_sec = tbstart->time; - t_start.tv_usec = tbstart->millitm; - t_stop.tv_sec = tbstop->time; - t_stop.tv_usec = tbstop->millitm; + _ftime(tbstop); + t_start.tv_sec = tbstart->time; + t_start.tv_usec = tbstart->millitm; + t_stop.tv_sec = tbstop->time; + t_stop.tv_usec = tbstop->millitm; #endif #endif putc ('\n', stderr); print_stats ("out hdf5", - &r_start, &r_stop, &t_start, &t_stop, - (size_t)(nread*size[0]*size[1])); + &r_start, &r_stop, &t_start, &t_stop, + (size_t)(nread*size[0]*size[1])); /* Read the raw dataset */ synchronize (); @@ -374,17 +374,17 @@ main (void) HDgettimeofday(&t_start, NULL); #else #ifdef H5_HAVE_SYS_TIMEB - _ftime(tbstart); + _ftime(tbstart); #endif #endif fprintf (stderr, HEADING, "in raw"); for(u = 0; u < nread; u++) { - putc (PROGRESS, stderr); - HDfflush(stderr); - offset = HDlseek (fd, (off_t)0, SEEK_SET); - assert (0==offset); - n = HDread (fd, the_data, (size_t)(size[0]*size[1])); - assert (n>=0 && (size_t)n==size[0]*size[1]); + putc (PROGRESS, stderr); + HDfflush(stderr); + offset = HDlseek (fd, (off_t)0, SEEK_SET); + assert (0==offset); + n = HDread (fd, the_data, (size_t)(size[0]*size[1])); + assert (n>=0 && (size_t)n==size[0]*size[1]); } #ifdef H5_HAVE_GETRUSAGE HDgetrusage(RUSAGE_SELF, &r_stop); @@ -393,17 +393,17 @@ main (void) HDgettimeofday(&t_stop, NULL); #else #ifdef H5_HAVE_SYS_TIMEB - _ftime(tbstop); - t_start.tv_sec = tbstart->time; - t_start.tv_usec = tbstart->millitm; - t_stop.tv_sec = tbstop->time; - t_stop.tv_usec = tbstop->millitm; + _ftime(tbstop); + t_start.tv_sec = tbstart->time; + t_start.tv_usec = tbstart->millitm; + t_stop.tv_sec = tbstop->time; + t_stop.tv_usec = tbstop->millitm; #endif #endif putc ('\n', stderr); print_stats ("in raw", - &r_start, &r_stop, &t_start, &t_stop, - (size_t)(nread*size[0]*size[1])); + &r_start, &r_stop, &t_start, &t_stop, + (size_t)(nread*size[0]*size[1])); /* Read the hdf5 dataset */ @@ -415,16 +415,16 @@ main (void) HDgettimeofday(&t_start, NULL); #else #ifdef H5_HAVE_SYS_TIMEB - _ftime(tbstart); + _ftime(tbstart); #endif #endif fprintf (stderr, HEADING, "in hdf5"); for(u = 0; u < nread; u++) { - putc (PROGRESS, stderr); - HDfflush(stderr); - status = H5Dread (dset, H5T_NATIVE_UCHAR, file_space, file_space, - H5P_DEFAULT, the_data); - assert (status>=0); + putc (PROGRESS, stderr); + HDfflush(stderr); + status = H5Dread (dset, H5T_NATIVE_UCHAR, file_space, file_space, + H5P_DEFAULT, the_data); + assert (status>=0); } #ifdef H5_HAVE_GETRUSAGE HDgetrusage(RUSAGE_SELF, &r_stop); @@ -433,17 +433,17 @@ main (void) HDgettimeofday(&t_stop, NULL); #else #ifdef H5_HAVE_SYS_TIMEB - _ftime(tbstop); - t_start.tv_sec = tbstart->time; - t_start.tv_usec = tbstart->millitm; - t_stop.tv_sec = tbstop->time; - t_stop.tv_usec = tbstop->millitm; + _ftime(tbstop); + t_start.tv_sec = tbstart->time; + t_start.tv_usec = tbstart->millitm; + t_stop.tv_sec = tbstop->time; + t_stop.tv_usec = tbstop->millitm; #endif #endif putc ('\n', stderr); print_stats ("in hdf5", - &r_start, &r_stop, &t_start, &t_stop, - (size_t)(nread*size[0]*size[1])); + &r_start, &r_stop, &t_start, &t_stop, + (size_t)(nread*size[0]*size[1])); /* Read hyperslab */ assert (size[0]>20 && size[1]>20); @@ -459,16 +459,16 @@ main (void) HDgettimeofday(&t_start, NULL); #else #ifdef H5_HAVE_SYS_TIMEB - _ftime(tbstart); + _ftime(tbstart); #endif #endif fprintf (stderr, HEADING, "in hdf5 partial"); for(u = 0; u < nread; u++) { - putc (PROGRESS, stderr); - HDfflush(stderr); - status = H5Dread (dset, H5T_NATIVE_UCHAR, file_space, file_space, - H5P_DEFAULT, the_data); - assert (status>=0); + putc (PROGRESS, stderr); + HDfflush(stderr); + status = H5Dread (dset, H5T_NATIVE_UCHAR, file_space, file_space, + H5P_DEFAULT, the_data); + assert (status>=0); } #ifdef H5_HAVE_GETRUSAGE HDgetrusage(RUSAGE_SELF, &r_stop); @@ -477,17 +477,17 @@ main (void) HDgettimeofday(&t_stop, NULL); #else #ifdef H5_HAVE_SYS_TIMEB - _ftime(tbstop); - t_start.tv_sec = tbstart->time; - t_start.tv_usec = tbstart->millitm; - t_stop.tv_sec = tbstop->time; - t_stop.tv_usec = tbstop->millitm; + _ftime(tbstop); + t_start.tv_sec = tbstart->time; + t_start.tv_usec = tbstart->millitm; + t_stop.tv_sec = tbstop->time; + t_stop.tv_usec = tbstop->millitm; #endif #endif putc('\n', stderr); print_stats("in hdf5 partial", - &r_start, &r_stop, &t_start, &t_stop, - (size_t)(nread*count[0]*count[1])); + &r_start, &r_stop, &t_start, &t_stop, + (size_t)(nread*count[0]*count[1])); diff --git a/perform/mpi-perf.c b/perform/mpi-perf.c index c0fe794..a09d672 100644 --- a/perform/mpi-perf.c +++ b/perform/mpi-perf.c @@ -55,10 +55,19 @@ #include #include #include +#ifdef H5_HAVE_UNISTD_H #include +#endif #include #include -#include +#if defined(H5_TIME_WITH_SYS_TIME) +# include +# include +#elif defined(H5_HAVE_SYS_TIME_H) +# include +#else +# include +#endif #include #ifndef MPI_FILE_NULL /*MPIO may be defined in mpi.h already */ # include @@ -299,7 +308,7 @@ die_jar_jar_die: #if H5_HAVE_SETENV /* no setenv or unsetenv */ /* clear the environment variable if it was set earlier */ - if (opt_pvfstab_set){ + if (opt_pvfstab_set){ unsetenv("PVFSTAB_FILE"); } #endif diff --git a/perform/overhead.c b/perform/overhead.c index cfd96b8..0b40721 100644 --- a/perform/overhead.c +++ b/perform/overhead.c @@ -17,7 +17,7 @@ * Programmer: Robb Matzke * Monday, September 28, 1998 * - * Purpose: Creates a chunked dataset and measures the storage overhead. + * Purpose: Creates a chunked dataset and measures the storage overhead. */ /* See H5private.h for how to include headers */ @@ -54,12 +54,12 @@ # define UNUSED __attribute__((unused)) #endif -#define FILE_NAME_1 "overhead.h5" +#define FILE_NAME_1 "overhead.h5" #ifndef FALSE -#define FALSE 0 +#define FALSE 0 #endif /* FALSE */ #ifndef TRUE -#define TRUE 1 +#define TRUE 1 #endif /* TRUE */ typedef enum fill_t { @@ -73,13 +73,13 @@ typedef enum fill_t { /*------------------------------------------------------------------------- - * Function: usage + * Function: usage * - * Purpose: Prints a usage message and exits. + * Purpose: Prints a usage message and exits. * - * Return: never returns + * Return: never returns * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, September 30, 1998 * * Modifications: @@ -90,7 +90,7 @@ static void usage(const char *prog) { fprintf(stderr, "usage: %s [STYLE|cache] [LEFT [MIDDLE [RIGHT]]]\n", - prog); + prog); fprintf(stderr, "\ STYLE is the order that the dataset is filled and should be one of:\n\ forward -- Fill the dataset from lowest address to highest\n\ @@ -124,13 +124,13 @@ usage(const char *prog) /*------------------------------------------------------------------------- - * Function: cleanup + * Function: cleanup * - * Purpose: Removes test files + * Purpose: Removes test files * - * Return: void + * Return: void * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, June 4, 1998 * * Modifications: @@ -141,22 +141,22 @@ static void cleanup (void) { if (!getenv ("HDF5_NOCLEANUP")) { - remove (FILE_NAME_1); + remove (FILE_NAME_1); } } /*------------------------------------------------------------------------- - * Function: display_error_cb + * Function: display_error_cb * - * Purpose: Displays the error stack after printing "*FAILED*". + * Purpose: Displays the error stack after printing "*FAILED*". * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Robb Matzke - * Wednesday, March 4, 1998 + * Programmer: Robb Matzke + * Wednesday, March 4, 1998 * * Modifications: * @@ -173,15 +173,15 @@ display_error_cb (hid_t estack, void UNUSED *client_data) /*------------------------------------------------------------------------- - * Function: test + * Function: test * - * Purpose: The guts of the test + * Purpose: The guts of the test * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: number of errors + * Failure: number of errors * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, September 30, 1998 * * Modifications: @@ -192,25 +192,24 @@ static int test(fill_t fill_style, const double splits[], hbool_t verbose, hbool_t use_rdcc) { - hid_t file = (-1), fapl = (-1), dcpl = (-1), xfer = (-1), mspace = (-1), fspace = (-1), dset = (-1); - hsize_t ch_size[1] = {1}; /*chunk size */ - hsize_t cur_size[1] = {1000}; /*current dataset size */ - hsize_t max_size[1] = {H5S_UNLIMITED}; /*maximum dataset size */ - hsize_t hs_start[1]; /*hyperslab start offset*/ - hsize_t hs_count[1] = {1}; /*hyperslab nelmts */ - int fd = (-1); /*h5 file direct */ - static int *had = NULL; /*for random filling */ - const char *sname=NULL; /*fill style nam */ - int mdc_nelmts; /*num meta objs to cache*/ - hsize_t i; - int j; - h5_stat_t sb; + hid_t file = (-1), fapl = (-1), dcpl = (-1), xfer = (-1), mspace = (-1), fspace = (-1), dset = (-1); + hsize_t ch_size[1] = {1}; /*chunk size */ + hsize_t cur_size[1] = {1000}; /*current dataset size */ + hsize_t max_size[1] = {H5S_UNLIMITED}; /*maximum dataset size */ + hsize_t hs_start[1]; /*hyperslab start offset*/ + hsize_t hs_count[1] = {1}; /*hyperslab nelmts */ + int fd = (-1); /*h5 file direct */ + int *had = NULL; /*for random filling */ + const char *sname=NULL; /*fill style nam */ + int mdc_nelmts; /*num meta objs to cache*/ + hsize_t i; + int j; + h5_stat_t sb; - if(!had) had = calloc((size_t)cur_size[0], sizeof(int)); if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) goto error; if(!use_rdcc) { - if(H5Pget_cache(fapl, &mdc_nelmts, NULL, NULL, NULL) < 0) goto error; - if(H5Pset_cache(fapl, mdc_nelmts, 0, 0, 0.0) < 0) goto error; + if(H5Pget_cache(fapl, &mdc_nelmts, NULL, NULL, NULL) < 0) goto error; + if(H5Pset_cache(fapl, mdc_nelmts, 0, 0, 0.0) < 0) goto error; } if((file = H5Fcreate(FILE_NAME_1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) goto error; if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; @@ -220,60 +219,66 @@ test(fill_t fill_style, const double splits[], if((fspace = H5Screate_simple(1, cur_size, max_size)) < 0) goto error; if((mspace = H5Screate_simple(1, ch_size, ch_size)) < 0) goto error; if((dset = H5Dcreate2(file, "chunked", H5T_NATIVE_INT, - fspace, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error; + fspace, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error; if ((fd=HDopen(FILE_NAME_1, O_RDONLY, 0666)) < 0) goto error; + if(FILL_RANDOM==fill_style) + had = calloc((size_t)cur_size[0], sizeof(int)); + for (i=1; i<=cur_size[0]; i++) { - /* Decide which chunk to write to */ - switch (fill_style) { - case FILL_FORWARD: - hs_start[0] = i-1; - break; - case FILL_REVERSE: - hs_start[0] = cur_size[0]-i; - break; - case FILL_INWARD: - hs_start[0] = i%2 ? i/2 : cur_size[0]-i/2; - break; - case FILL_OUTWARD: - j = (int)(cur_size[0]-i)+1; - hs_start[0] = j%2 ? j/2 : (hssize_t)cur_size[0]-j/2; - break; - case FILL_RANDOM: - for (j=HDrand()%(int)cur_size[0]; had[j]; j=(j+1)%(int)cur_size[0]) /*void*/; - hs_start[0] = j; - had[j] = 1; - break; - case FILL_ALL: - abort(); - } - - /* Write the chunk */ - if (H5Sselect_hyperslab(fspace, H5S_SELECT_SET, hs_start, NULL, - hs_count, NULL) < 0) goto error; - if (H5Dwrite(dset, H5T_NATIVE_INT, mspace, fspace, xfer, &i) < 0) { - goto error; - } - - - /* Determine overhead */ - if (verbose) { - if (H5Fflush(file, H5F_SCOPE_LOCAL) < 0) goto error; - if (HDfstat(fd, &sb) < 0) goto error; - /* - * The extra cast in the following statement is a bug workaround - * for the Win32 version 5.0 compiler. - * 1998-11-06 ptl - */ - printf("%4lu %8.3f ***\n", - (unsigned long)i, - (double)(hssize_t)(sb.st_size-i*sizeof(int))/(hssize_t)i); - } - - + /* Decide which chunk to write to */ + switch (fill_style) { + case FILL_FORWARD: + hs_start[0] = i-1; + break; + case FILL_REVERSE: + hs_start[0] = cur_size[0]-i; + break; + case FILL_INWARD: + hs_start[0] = i%2 ? i/2 : cur_size[0]-i/2; + break; + case FILL_OUTWARD: + j = (int)(cur_size[0]-i)+1; + hs_start[0] = j%2 ? j/2 : (hssize_t)cur_size[0]-j/2; + break; + case FILL_RANDOM: + for (j=HDrand()%(int)cur_size[0]; had[j]; j=(j+1)%(int)cur_size[0]) + /*void*/; + hs_start[0] = j; + had[j] = 1; + break; + case FILL_ALL: + abort(); + } + + /* Write the chunk */ + if (H5Sselect_hyperslab(fspace, H5S_SELECT_SET, hs_start, NULL, + hs_count, NULL) < 0) goto error; + if (H5Dwrite(dset, H5T_NATIVE_INT, mspace, fspace, xfer, &i) < 0) { + goto error; + } + + /* Determine overhead */ + if (verbose) { + if (H5Fflush(file, H5F_SCOPE_LOCAL) < 0) goto error; + if (HDfstat(fd, &sb) < 0) goto error; + /* + * The extra cast in the following statement is a bug workaround + * for the Win32 version 5.0 compiler. + * 1998-11-06 ptl + */ + printf("%4lu %8.3f ***\n", + (unsigned long)i, + (double)(hssize_t)(sb.st_size-i*sizeof(int))/(hssize_t)i); + } } + if(had) { + free(had); + had = NULL; + } /* end if */ + H5Dclose(dset); H5Sclose(mspace); H5Sclose(fspace); @@ -282,33 +287,31 @@ test(fill_t fill_style, const double splits[], H5Fclose(file); if (!verbose) { - switch (fill_style) { - case FILL_FORWARD: - sname = "forward"; - break; - case FILL_REVERSE: - sname = "reverse"; - break; - case FILL_INWARD: - sname = "inward"; - break; - case FILL_OUTWARD: - sname = "outward"; - break; - case FILL_RANDOM: - sname = "random"; - break; - case FILL_ALL: - abort(); - } - - if (HDfstat(fd, &sb) < 0) goto error; - printf("%-7s %8.3f\n", sname, - (double)(hssize_t)(sb.st_size-cur_size[0]*sizeof(int))/ - (hssize_t)cur_size[0]); + switch (fill_style) { + case FILL_FORWARD: + sname = "forward"; + break; + case FILL_REVERSE: + sname = "reverse"; + break; + case FILL_INWARD: + sname = "inward"; + break; + case FILL_OUTWARD: + sname = "outward"; + break; + case FILL_RANDOM: + sname = "random"; + break; + case FILL_ALL: + abort(); + } + + if (HDfstat(fd, &sb) < 0) goto error; + printf("%-7s %8.3f\n", sname, + (double)(hssize_t)(sb.st_size-cur_size[0]*sizeof(int))/ + (hssize_t)cur_size[0]); } - - HDclose(fd); return 0; @@ -320,22 +323,23 @@ test(fill_t fill_style, const double splits[], H5Pclose(dcpl); H5Pclose(xfer); H5Fclose(file); - free(had); + if(had) + free(had); HDclose(fd); return 1; } /*------------------------------------------------------------------------- - * Function: main + * Function: main * * Purpose: * - * Return: Success: zero + * Return: Success: zero * - * Failure: non-zero + * Failure: non-zero * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Monday, September 28, 1998 * * Modifications: @@ -345,11 +349,11 @@ test(fill_t fill_style, const double splits[], int main(int argc, char *argv[]) { - hid_t xfer; - fill_t fill_style = FILL_ALL; - hbool_t use_cache = FALSE; - double splits[3]; - int i, j, nerrors=0; + hid_t xfer; + fill_t fill_style = FILL_ALL; + hbool_t use_cache = FALSE; + double splits[3]; + int i, j, nerrors=0; /* Default split ratios */ H5Eset_auto2(H5E_DEFAULT, display_error_cb, NULL); @@ -360,36 +364,37 @@ main(int argc, char *argv[]) /* Parse command-line options */ for(i = 1, j = 0; i < argc; i++) { - if (!strcmp(argv[i], "forward")) { - fill_style = FILL_FORWARD; - } else if (!strcmp(argv[i], "reverse")) { - fill_style = FILL_REVERSE; - } else if (!strcmp(argv[i], "inward")) { - fill_style = FILL_INWARD; - } else if (!strcmp(argv[i], "outward")) { - fill_style = FILL_OUTWARD; - } else if (!strcmp(argv[i], "random")) { - fill_style = FILL_RANDOM; - } else if (!strcmp(argv[i], "cache")) { - use_cache = TRUE; - } else if (j<3 && (isdigit(argv[i][0]) || '.'==argv[i][0])) { - splits[j++] = strtod(argv[i], NULL); - } else { - usage(argv[0]); - } + if (!strcmp(argv[i], "forward")) { + fill_style = FILL_FORWARD; + } else if (!strcmp(argv[i], "reverse")) { + fill_style = FILL_REVERSE; + } else if (!strcmp(argv[i], "inward")) { + fill_style = FILL_INWARD; + } else if (!strcmp(argv[i], "outward")) { + fill_style = FILL_OUTWARD; + } else if (!strcmp(argv[i], "random")) { + fill_style = FILL_RANDOM; + } else if (!strcmp(argv[i], "cache")) { + use_cache = TRUE; + } else if (j<3 && (isdigit(argv[i][0]) || '.'==argv[i][0])) { + splits[j++] = strtod(argv[i], NULL); + } else { + usage(argv[0]); + } } if (FILL_ALL==fill_style) { - printf("%-7s %8s\n", "Style", "Bytes/Chunk"); - printf("%-7s %8s\n", "-----", "-----------"); - nerrors += test(FILL_FORWARD, splits, FALSE, use_cache); - nerrors += test(FILL_REVERSE, splits, FALSE, use_cache); - nerrors += test(FILL_INWARD, splits, FALSE, use_cache); - nerrors += test(FILL_OUTWARD, splits, FALSE, use_cache); - nerrors += test(FILL_RANDOM, splits, FALSE, use_cache); - } else { - if (use_cache) usage(argv[0]); - nerrors += test(fill_style, splits, TRUE, FALSE); + printf("%-7s %8s\n", "Style", "Bytes/Chunk"); + printf("%-7s %8s\n", "-----", "-----------"); + nerrors += test(FILL_FORWARD, splits, FALSE, use_cache); + nerrors += test(FILL_REVERSE, splits, FALSE, use_cache); + nerrors += test(FILL_INWARD, splits, FALSE, use_cache); + nerrors += test(FILL_OUTWARD, splits, FALSE, use_cache); + nerrors += test(FILL_RANDOM, splits, FALSE, use_cache); + } + else { + if (use_cache) usage(argv[0]); + nerrors += test(fill_style, splits, TRUE, FALSE); } if (nerrors>0) goto error; cleanup(); diff --git a/perform/perf.c b/perform/perf.c index 92b85bc..f006afb 100644 --- a/perform/perf.c +++ b/perform/perf.c @@ -28,10 +28,19 @@ #include #include #include +#ifdef H5_HAVE_UNISTD_H #include +#endif #include #include -#include +#if defined(H5_TIME_WITH_SYS_TIME) +# include +# include +#elif defined(H5_HAVE_SYS_TIME_H) +# include +#else +# include +#endif #include #ifndef MPI_FILE_NULL /*MPIO may be defined in mpi.h already */ # include @@ -45,30 +54,30 @@ #define H5FATAL 1 #define VRFY(val, mesg, fatal) do { \ if (!val) { \ - printf("Proc %d: ", mynod); \ + printf("Proc %d: ", mynod); \ printf("*** Assertion failed (%s) at line %4d in %s\n", \ - mesg, (int)__LINE__, __FILE__); \ - if (fatal){ \ - fflush(stdout); \ - goto die_jar_jar_die; \ - } \ + mesg, (int)__LINE__, __FILE__); \ + if (fatal){ \ + fflush(stdout); \ + goto die_jar_jar_die; \ + } \ } \ } while(0) #define RANK 1 -hsize_t dims[RANK]; /* dataset dim sizes */ +hsize_t dims[RANK]; /* dataset dim sizes */ hsize_t block[RANK], stride[RANK], count[RANK]; hssize_t start[RANK]; hid_t fid; /* HDF5 file ID */ -hid_t acc_tpl; /* File access templates */ -hid_t sid; /* Dataspace ID */ -hid_t file_dataspace; /* File dataspace ID */ -hid_t mem_dataspace; /* memory dataspace ID */ -hid_t dataset; /* Dataset ID */ -hsize_t opt_alignment = 1; -hsize_t opt_threshold = 1; -int opt_split_vfd = 0; -char *meta_ext, *raw_ext; /* holds the meta and raw file extension if */ - /* opt_split_vfd is set */ +hid_t acc_tpl; /* File access templates */ +hid_t sid; /* Dataspace ID */ +hid_t file_dataspace; /* File dataspace ID */ +hid_t mem_dataspace; /* memory dataspace ID */ +hid_t dataset; /* Dataset ID */ +hsize_t opt_alignment = 1; +hsize_t opt_threshold = 1; +int opt_split_vfd = 0; +char *meta_ext, *raw_ext; /* holds the meta and raw file extension if */ + /* opt_split_vfd is set */ /* DEFAULT VALUES FOR OPTIONS */ @@ -105,7 +114,7 @@ int main(int argc, char **argv) MPI_File fh; MPI_Status status; int nchars; - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* startup MPI and determine the rank of this process */ MPI_Init(&argc,&argv); @@ -155,38 +164,38 @@ int main(int argc, char **argv) /* setup file access template with parallel IO access. */ if (opt_split_vfd){ - hid_t mpio_pl; - - mpio_pl = H5Pcreate (H5P_FILE_ACCESS); - VRFY((acc_tpl >= 0), "", H5FATAL); - ret = H5Pset_fapl_mpio(mpio_pl, MPI_COMM_WORLD, MPI_INFO_NULL); - VRFY((ret >= 0), "", H5FATAL); - - /* set optional allocation alignment */ - if (opt_alignment*opt_threshold != 1){ - ret = H5Pset_alignment(acc_tpl, opt_threshold, opt_alignment ); - VRFY((ret >= 0), "H5Pset_alignment succeeded", !H5FATAL); - } - - /* setup file access template */ - acc_tpl = H5Pcreate (H5P_FILE_ACCESS); - VRFY((acc_tpl >= 0), "", H5FATAL); - ret = H5Pset_fapl_split(acc_tpl, meta_ext, mpio_pl, raw_ext, mpio_pl); - VRFY((ret >= 0), "H5Pset_fapl_split succeeded", H5FATAL); - ret = H5Pclose(mpio_pl); - VRFY((ret >= 0), "H5Pclose mpio_pl succeeded", H5FATAL); + hid_t mpio_pl; + + mpio_pl = H5Pcreate (H5P_FILE_ACCESS); + VRFY((acc_tpl >= 0), "", H5FATAL); + ret = H5Pset_fapl_mpio(mpio_pl, MPI_COMM_WORLD, MPI_INFO_NULL); + VRFY((ret >= 0), "", H5FATAL); + + /* set optional allocation alignment */ + if (opt_alignment*opt_threshold != 1){ + ret = H5Pset_alignment(acc_tpl, opt_threshold, opt_alignment ); + VRFY((ret >= 0), "H5Pset_alignment succeeded", !H5FATAL); + } + + /* setup file access template */ + acc_tpl = H5Pcreate (H5P_FILE_ACCESS); + VRFY((acc_tpl >= 0), "", H5FATAL); + ret = H5Pset_fapl_split(acc_tpl, meta_ext, mpio_pl, raw_ext, mpio_pl); + VRFY((ret >= 0), "H5Pset_fapl_split succeeded", H5FATAL); + ret = H5Pclose(mpio_pl); + VRFY((ret >= 0), "H5Pclose mpio_pl succeeded", H5FATAL); }else{ - /* setup file access template */ - acc_tpl = H5Pcreate (H5P_FILE_ACCESS); - VRFY((acc_tpl >= 0), "", H5FATAL); - ret = H5Pset_fapl_mpio(acc_tpl, MPI_COMM_WORLD, MPI_INFO_NULL); - VRFY((ret >= 0), "", H5FATAL); - - /* set optional allocation alignment */ - if (opt_alignment*opt_threshold != 1){ - ret = H5Pset_alignment(acc_tpl, opt_threshold, opt_alignment ); - VRFY((ret >= 0), "H5Pset_alignment succeeded", !H5FATAL); - } + /* setup file access template */ + acc_tpl = H5Pcreate (H5P_FILE_ACCESS); + VRFY((acc_tpl >= 0), "", H5FATAL); + ret = H5Pset_fapl_mpio(acc_tpl, MPI_COMM_WORLD, MPI_INFO_NULL); + VRFY((ret >= 0), "", H5FATAL); + + /* set optional allocation alignment */ + if (opt_alignment*opt_threshold != 1){ + ret = H5Pset_alignment(acc_tpl, opt_threshold, opt_alignment ); + VRFY((ret >= 0), "H5Pset_alignment succeeded", !H5FATAL); + } } /* create the parallel file */ @@ -198,7 +207,7 @@ int main(int argc, char **argv) sid = H5Screate_simple(RANK, dims, NULL); VRFY((sid >= 0), "H5Screate_simple succeeded", H5FATAL); dataset = H5Dcreate2(fid, "Dataset1", H5T_NATIVE_CHAR, sid, - H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); VRFY((dataset >= 0), "H5Dcreate2 succeeded", H5FATAL); /* create the memory dataspace and the file dataspace */ @@ -366,7 +375,7 @@ die_jar_jar_die: #if H5_HAVE_SETENV /* no setenv or unsetenv */ /* clear the environment variable if it was set earlier */ - if (opt_pvfstab_set){ + if (opt_pvfstab_set){ unsetenv("PVFSTAB_FILE"); } #endif diff --git a/perform/pio_engine.c b/perform/pio_engine.c index 27606d0..0e3190c 100644 --- a/perform/pio_engine.c +++ b/perform/pio_engine.c @@ -22,7 +22,9 @@ #include #include #include +#ifdef H5_HAVE_UNISTD_H #include +#endif #include #include "hdf5.h" @@ -318,22 +320,22 @@ do_pio(parameters param) /* Need barrier to make sure everyone starts at the same time */ MPI_Barrier(pio_comm_g); - set_time(res.timers, HDF5_GROSS_WRITE_FIXED_DIMS, START); + set_time(res.timers, HDF5_GROSS_WRITE_FIXED_DIMS, TSTART); hrc = do_fopen(¶m, fname, &fd, PIO_CREATE | PIO_WRITE); VRFY((hrc == SUCCESS), "do_fopen failed"); - set_time(res.timers, HDF5_FINE_WRITE_FIXED_DIMS, START); + set_time(res.timers, HDF5_FINE_WRITE_FIXED_DIMS, TSTART); hrc = do_write(&res, &fd, ¶m, ndsets, nbytes, buf_size, buffer); hrc == SUCCESS; - set_time(res.timers, HDF5_FINE_WRITE_FIXED_DIMS, STOP); + set_time(res.timers, HDF5_FINE_WRITE_FIXED_DIMS, TSTOP); VRFY((hrc == SUCCESS), "do_write failed"); /* Close file for write */ hrc = do_fclose(iot, &fd); - set_time(res.timers, HDF5_GROSS_WRITE_FIXED_DIMS, STOP); + set_time(res.timers, HDF5_GROSS_WRITE_FIXED_DIMS, TSTOP); VRFY((hrc == SUCCESS), "do_fclose failed"); if (!param.h5_write_only) { @@ -347,20 +349,20 @@ do_pio(parameters param) MPI_Barrier(pio_comm_g); /* Open file for read */ - set_time(res.timers, HDF5_GROSS_READ_FIXED_DIMS, START); + set_time(res.timers, HDF5_GROSS_READ_FIXED_DIMS, TSTART); hrc = do_fopen(¶m, fname, &fd, PIO_READ); VRFY((hrc == SUCCESS), "do_fopen failed"); - set_time(res.timers, HDF5_FINE_READ_FIXED_DIMS, START); + set_time(res.timers, HDF5_FINE_READ_FIXED_DIMS, TSTART); hrc = do_read(&res, &fd, ¶m, ndsets, nbytes, buf_size, buffer); - set_time(res.timers, HDF5_FINE_READ_FIXED_DIMS, STOP); + set_time(res.timers, HDF5_FINE_READ_FIXED_DIMS, TSTOP); VRFY((hrc == SUCCESS), "do_read failed"); /* Close file for read */ hrc = do_fclose(iot, &fd); - set_time(res.timers, HDF5_GROSS_READ_FIXED_DIMS, STOP); + set_time(res.timers, HDF5_GROSS_READ_FIXED_DIMS, TSTOP); VRFY((hrc == SUCCESS), "do_fclose failed"); } @@ -411,14 +413,14 @@ done: static char * pio_create_filename(iotype iot, const char *base_name, char *fullname, size_t size) { - const char *prefix, *suffix=""; + const char *prefix, *suffix = ""; char *ptr, last = '\0'; size_t i, j; if (!base_name || !fullname || size < 1) - return NULL; + return NULL; - memset(fullname, 0, size); + HDmemset(fullname, 0, size); switch (iot) { case POSIXIO: @@ -433,77 +435,81 @@ pio_create_filename(iotype iot, const char *base_name, char *fullname, size_t si } /* First use the environment variable and then try the constant */ - prefix = getenv("HDF5_PARAPREFIX"); + prefix = HDgetenv("HDF5_PARAPREFIX"); #ifdef HDF5_PARAPREFIX if (!prefix) - prefix = HDF5_PARAPREFIX; + prefix = HDF5_PARAPREFIX; #endif /* HDF5_PARAPREFIX */ /* Prepend the prefix value to the base name */ if (prefix && *prefix) { - /* If the prefix specifies the HDF5_PARAPREFIX directory, then - * default to using the "/tmp/$USER" or "/tmp/$LOGIN" - * directory instead. */ - register char *user, *login, *subdir; - - user = getenv("USER"); - login = getenv("LOGIN"); - subdir = (user ? user : login); + /* If the prefix specifies the HDF5_PARAPREFIX directory, then + * default to using the "/tmp/$USER" or "/tmp/$LOGIN" + * directory instead. */ + register char *user, *login, *subdir; - if (subdir) { - for (i = 0; i < size && prefix[i]; i++) - fullname[i] = prefix[i]; + user = HDgetenv("USER"); + login = HDgetenv("LOGIN"); + subdir = (user ? user : login); - fullname[i++] = '/'; + if (subdir) { + for (i = 0; i < size && prefix[i]; i++) + fullname[i] = prefix[i]; - for (j = 0; i < size && subdir[j]; i++, j++) - fullname[i] = subdir[j]; - } else { - /* We didn't append the prefix yet */ - strncpy(fullname, prefix, MIN(strlen(prefix), size)); - } + fullname[i++] = '/'; - if ((strlen(fullname) + strlen(base_name) + 1) < size) { - /* Append the base_name with a slash first. Multiple slashes are - * handled below. */ - h5_stat_t buf; - - if (HDstat(fullname, &buf) < 0) - /* The directory doesn't exist just yet */ - if (mkdir(fullname, (mode_t)0755) < 0 && errno != EEXIST) { - /* We couldn't make the "/tmp/${USER,LOGIN}" subdirectory. - * Default to PREFIX's original prefix value. */ - strcpy(fullname, prefix); + for (j = 0; i < size && subdir[j]; i++, j++) + fullname[i] = subdir[j]; + } + else { + /* We didn't append the prefix yet */ + HDstrncpy(fullname, prefix, MIN(HDstrlen(prefix), size)); } - strcat(fullname, "/"); - strcat(fullname, base_name); - } else { + if ((HDstrlen(fullname) + HDstrlen(base_name) + 1) < size) { + /* Append the base_name with a slash first. Multiple slashes are + * handled below. */ + h5_stat_t buf; + + if (HDstat(fullname, &buf) < 0) + /* The directory doesn't exist just yet */ + if (HDmkdir(fullname, (mode_t) 0755) < 0 && errno != EEXIST) { + /* We couldn't make the "/tmp/${USER,LOGIN}" subdirectory. + * Default to PREFIX's original prefix value. */ + HDstrcpy(fullname, prefix); + } + + HDstrcat(fullname, "/"); + HDstrcat(fullname, base_name); + } + else { + /* Buffer is too small */ + return NULL; + } + } + else if (HDstrlen(base_name) >= size) { /* Buffer is too small */ return NULL; } - } else if (strlen(base_name) >= size) { - /* Buffer is too small */ - return NULL; - } else { - strcpy(fullname, base_name); + else { + HDstrcpy(fullname, base_name); } /* Append a suffix */ if (suffix) { - if (strlen(fullname) + strlen(suffix) >= size) - return NULL; + if (HDstrlen(fullname) + HDstrlen(suffix) >= size) + return NULL; - strcat(fullname, suffix); + HDstrcat(fullname, suffix); } /* Remove any double slashes in the filename */ for (ptr = fullname, i = j = 0; ptr && i < size; i++, ptr++) { - if (*ptr != '/' || last != '/') - fullname[j++] = *ptr; + if (*ptr != '/' || last != '/') + fullname[j++] = *ptr; - last = *ptr; + last = *ptr; } return fullname; @@ -962,7 +968,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets, } /* end else */ /* Start "raw data" write timer */ - set_time(res->timers, HDF5_RAW_WRITE_FIXED_DIMS, START); + set_time(res->timers, HDF5_RAW_WRITE_FIXED_DIMS, TSTART); while (nbytes_xfer < bytes_count){ /* Write */ @@ -1393,7 +1399,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets, } /* end while */ /* Stop "raw data" write timer */ - set_time(res->timers, HDF5_RAW_WRITE_FIXED_DIMS, STOP); + set_time(res->timers, HDF5_RAW_WRITE_FIXED_DIMS, TSTOP); /* Calculate write time */ @@ -1893,7 +1899,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets, } /* end else */ /* Start "raw data" read timer */ - set_time(res->timers, HDF5_RAW_READ_FIXED_DIMS, START); + set_time(res->timers, HDF5_RAW_READ_FIXED_DIMS, TSTART); while (nbytes_xfer < bytes_count){ /* Read */ @@ -2348,7 +2354,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets, } /* end while */ /* Stop "raw data" read timer */ - set_time(res->timers, HDF5_RAW_READ_FIXED_DIMS, STOP); + set_time(res->timers, HDF5_RAW_READ_FIXED_DIMS, TSTOP); /* Calculate read time */ @@ -3109,9 +3115,9 @@ int MPI_File_read_at(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, MPI_Status *status) { int err; - set_time(timer_g, HDF5_MPI_READ, START); + set_time(timer_g, HDF5_MPI_READ, TSTART); err=PMPI_File_read_at(fh, offset, buf, count, datatype, status); - set_time(timer_g, HDF5_MPI_READ, STOP); + set_time(timer_g, HDF5_MPI_READ, TSTOP); return err; } @@ -3120,9 +3126,9 @@ int MPI_File_read_at_all(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, MPI_Status *status) { int err; - set_time(timer_g, HDF5_MPI_READ, START); + set_time(timer_g, HDF5_MPI_READ, TSTART); err=PMPI_File_read_at_all(fh, offset, buf, count, datatype, status); - set_time(timer_g, HDF5_MPI_READ, STOP); + set_time(timer_g, HDF5_MPI_READ, TSTOP); return err; } @@ -3130,9 +3136,9 @@ int MPI_File_write_at(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, MPI_Status *status) { int err; - set_time(timer_g, HDF5_MPI_WRITE, START); + set_time(timer_g, HDF5_MPI_WRITE, TSTART); err=PMPI_File_write_at(fh, offset, buf, count, datatype, status); - set_time(timer_g, HDF5_MPI_WRITE, STOP); + set_time(timer_g, HDF5_MPI_WRITE, TSTOP); return err; } @@ -3140,9 +3146,9 @@ int MPI_File_write_at_all(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, MPI_Status *status) { int err; - set_time(timer_g, HDF5_MPI_WRITE, START); + set_time(timer_g, HDF5_MPI_WRITE, TSTART); err=PMPI_File_write_at_all(fh, offset, buf, count, datatype, status); - set_time(timer_g, HDF5_MPI_WRITE, STOP); + set_time(timer_g, HDF5_MPI_WRITE, TSTOP); return err; } diff --git a/perform/pio_perf.c b/perform/pio_perf.c index d3e2531..337e982 100644 --- a/perform/pio_perf.c +++ b/perform/pio_perf.c @@ -339,6 +339,11 @@ main(int argc, char **argv) int exit_value = EXIT_SUCCESS; struct options *opts = NULL; +#ifndef STANDALONE + /* Initialize h5tools lib */ + h5tools_init(); +#endif + output = stdout; /* initialize MPI and get the maximum num of processors we started with */ @@ -1312,11 +1317,11 @@ parse_command_line(int argc, char *argv[]) if (isalnum(*end) && i < 10) buf[i++] = *end; - if (!strcasecmp(buf, "phdf5")) { + if (!HDstrcasecmp(buf, "phdf5")) { cl_opts->io_types |= PIO_HDF5; - } else if (!strcasecmp(buf, "mpiio")) { + } else if (!HDstrcasecmp(buf, "mpiio")) { cl_opts->io_types |= PIO_MPI; - } else if (!strcasecmp(buf, "posix")) { + } else if (!HDstrcasecmp(buf, "posix")) { cl_opts->io_types |= PIO_POSIX; } else { fprintf(stderr, "pio_perf: invalid --api option %s\n", diff --git a/perform/pio_perf.h b/perform/pio_perf.h index f9a8e03..094b31d 100644 --- a/perform/pio_perf.h +++ b/perform/pio_perf.h @@ -16,14 +16,15 @@ #ifndef PIO_PERF_H__ #define PIO_PERF_H__ -#include "pio_timer.h" #ifndef STANDALONE #include "H5private.h" #include "h5test.h" +#include "h5tools.h" #include "h5tools_utils.h" #else #include "pio_standalone.h" #endif +#include "pio_timer.h" /* setup the dataset no fill option if this is v1.5 or more */ #if H5_VERS_MAJOR > 1 || H5_VERS_MINOR > 4 diff --git a/perform/pio_standalone.h b/perform/pio_standalone.h index a4bc8b5..584a057 100644 --- a/perform/pio_standalone.h +++ b/perform/pio_standalone.h @@ -22,7 +22,7 @@ /** From H5private.h **/ -#include "H5public.h" /* Include Public Definitions */ +#include "H5public.h" /* Include Public Definitions */ /* @@ -47,57 +47,57 @@ * And now for a couple non-Posix functions... Watch out for systems that * define these in terms of macros. */ -#ifdef _WIN32 -#define HDstrdup(S) _strdup(S) -#else /* _WIN32 */ +#ifdef H5_HAVE_WIN32_API +#define HDstrdup(S) _strdup(S) +#else /* H5_HAVE_WIN32_API */ #if !defined strdup && !defined H5_HAVE_STRDUP extern char *strdup(const char *s); #endif -#define HDstrdup(S) strdup(S) +#define HDstrdup(S) strdup(S) -#endif /* _WIN32 */ +#endif /* H5_HAVE_WIN32_API */ H5_DLL int HDfprintf (FILE *stream, const char *fmt, ...); -#define HDstrcmp(S,T) strcmp(S,T) -#define HDstrlen(S) strlen(S) -#define HDstrncmp(S,T,L) strncmp(S,T,L) -#define HDstrncpy(X,Y,Z) strncpy(X,Y,Z) -#define HDstrchr(S,C) strchr(S,C) -#define HDfree(M) free(M) +#define HDstrcmp(S,T) strcmp(S,T) +#define HDstrlen(S) strlen(S) +#define HDstrncmp(S,T,L) strncmp(S,T,L) +#define HDstrncpy(X,Y,Z) strncpy(X,Y,Z) +#define HDstrchr(S,C) strchr(S,C) +#define HDfree(M) free(M) #ifdef _O_BINARY -#define HDopen(S,F,M) open(S,F|_O_BINARY,M) +#define HDopen(S,F,M) open(S,F|_O_BINARY,M) #else -#define HDopen(S,F,M) open(S,F,M) +#define HDopen(S,F,M) open(S,F,M) #endif -#define HDclose(F) close(F) +#define HDclose(F) close(F) -#ifdef _WIN32 -#define HDlseek(F,O,W) _lseeki64(F,O,W) +#ifdef H5_HAVE_WIN32_API +#define HDlseek(F,O,W) _lseeki64(F,O,W) #else -#define HDlseek(F,O,W) lseek(F,O,W) +#define HDlseek(F,O,W) lseek(F,O,W) #endif -#define HDwrite(F,M,Z) write(F,M,Z) +#define HDwrite(F,M,Z) write(F,M,Z) -#define HDread(F,M,Z) read(F,M,Z) +#define HDread(F,M,Z) read(F,M,Z) -#ifdef _WIN32 - #define HDstat(S,B) _stati64(S,B) +#ifdef H5_HAVE_WIN32_API + #define HDstat(S,B) _stati64(S,B) #else #define HDstat(S,B) stat(S,B) #endif -#ifdef _WIN32 -#define HDfstat(F,B) _fstati64(F,B) -typedef struct _stati64 h5_stat_t; -typedef __int64 h5_stat_size_t; +#ifdef H5_HAVE_WIN32_API +#define HDfstat(F,B) _fstati64(F,B) +typedef struct _stati64 h5_stat_t; +typedef __int64 h5_stat_size_t; #else #define HDfstat(F,B) fstat(F,B) -typedef struct stat h5_stat_t; +typedef struct stat h5_stat_t; typedef off_t h5_stat_size_t; #endif @@ -134,7 +134,7 @@ extern const char *opt_arg; /* flag argument (or value) */ enum { no_arg = 0, /* doesn't take an argument */ - require_arg, /* requires an argument */ + require_arg, /* requires an argument */ optional_arg /* argument is optional */ }; diff --git a/perform/pio_timer.c b/perform/pio_timer.c index 66f9eb0..aba219e 100644 --- a/perform/pio_timer.c +++ b/perform/pio_timer.c @@ -22,7 +22,7 @@ #include #include -#include "pio_timer.h" +#include "hdf5.h" #ifdef H5_HAVE_PARALLEL @@ -43,15 +43,15 @@ pio_time *timer_g; /* timer: global for stub functions */ * Function: sub_time * Purpose: Struct two time values, and return the difference, in microseconds * - * Note that the function assumes that a > b + * Note that the function assumes that a > b * Programmer: Leon Arber, 1/27/06 */ static double sub_time(struct timeval* a, struct timeval* b) { return (((double)a->tv_sec + ((double)a->tv_usec) / MICROSECOND) - - ((double)b->tv_sec + - ((double)b->tv_usec) / MICROSECOND)); + ((double)b->tv_sec + + ((double)b->tv_usec) / MICROSECOND)); } @@ -89,7 +89,7 @@ pio_time_new(clock_type type) void pio_time_destroy(pio_time *pt) { - free(pt); + HDfree(pt); /* reset the global timer pointer too. */ timer_g = NULL; } @@ -134,43 +134,43 @@ set_time(pio_time *pt, timer_type t, int start_stop) { if (pt) { if (pt->type == MPI_TIMER) { - if (start_stop == START) { + if (start_stop == TSTART) { pt->mpi_timer[t] = MPI_Wtime(); - /* When we start the timer for HDF5_FINE_WRITE_FIXED_DIMS or HDF5_FINE_READ_FIXED_DIMS - * we compute the time it took to only open the file */ - if(t == HDF5_FINE_WRITE_FIXED_DIMS) - pt->total_time[HDF5_FILE_WRITE_OPEN] += pt->mpi_timer[t] - pt->mpi_timer[HDF5_GROSS_WRITE_FIXED_DIMS]; - else if(t == HDF5_FINE_READ_FIXED_DIMS) - pt->total_time[HDF5_FILE_READ_OPEN] += pt->mpi_timer[t] - pt->mpi_timer[HDF5_GROSS_READ_FIXED_DIMS]; + /* When we start the timer for HDF5_FINE_WRITE_FIXED_DIMS or HDF5_FINE_READ_FIXED_DIMS + * we compute the time it took to only open the file */ + if(t == HDF5_FINE_WRITE_FIXED_DIMS) + pt->total_time[HDF5_FILE_WRITE_OPEN] += pt->mpi_timer[t] - pt->mpi_timer[HDF5_GROSS_WRITE_FIXED_DIMS]; + else if(t == HDF5_FINE_READ_FIXED_DIMS) + pt->total_time[HDF5_FILE_READ_OPEN] += pt->mpi_timer[t] - pt->mpi_timer[HDF5_GROSS_READ_FIXED_DIMS]; } else { pt->total_time[t] += MPI_Wtime() - pt->mpi_timer[t]; - pt->mpi_timer[t] = MPI_Wtime(); - - /* When we stop the timer for HDF5_GROSS_WRITE_FIXED_DIMS or HDF5_GROSS_READ_FIXED_DIMS - * we compute the time it took to close the file after the last read/write finished */ - if(t == HDF5_GROSS_WRITE_FIXED_DIMS) - pt->total_time[HDF5_FILE_WRITE_CLOSE] += pt->mpi_timer[t] - pt->mpi_timer[HDF5_FINE_WRITE_FIXED_DIMS]; - else if(t == HDF5_GROSS_READ_FIXED_DIMS) - pt->total_time[HDF5_FILE_READ_CLOSE] += pt->mpi_timer[t] - pt->mpi_timer[HDF5_FINE_READ_FIXED_DIMS]; + pt->mpi_timer[t] = MPI_Wtime(); + + /* When we stop the timer for HDF5_GROSS_WRITE_FIXED_DIMS or HDF5_GROSS_READ_FIXED_DIMS + * we compute the time it took to close the file after the last read/write finished */ + if(t == HDF5_GROSS_WRITE_FIXED_DIMS) + pt->total_time[HDF5_FILE_WRITE_CLOSE] += pt->mpi_timer[t] - pt->mpi_timer[HDF5_FINE_WRITE_FIXED_DIMS]; + else if(t == HDF5_GROSS_READ_FIXED_DIMS) + pt->total_time[HDF5_FILE_READ_CLOSE] += pt->mpi_timer[t] - pt->mpi_timer[HDF5_FINE_READ_FIXED_DIMS]; } } else { - if (start_stop == START) { - gettimeofday(&pt->sys_timer[t], NULL); + if (start_stop == TSTART) { + HDgettimeofday(&pt->sys_timer[t], NULL); - /* When we start the timer for HDF5_FINE_WRITE_FIXED_DIMS or HDF5_FINE_READ_FIXED_DIMS - * we compute the time it took to only open the file */ - if(t == HDF5_FINE_WRITE_FIXED_DIMS) - pt->total_time[HDF5_FILE_WRITE_OPEN] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_GROSS_WRITE_FIXED_DIMS])); - else if(t == HDF5_FINE_READ_FIXED_DIMS) - pt->total_time[HDF5_FILE_READ_OPEN] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_GROSS_READ_FIXED_DIMS])); + /* When we start the timer for HDF5_FINE_WRITE_FIXED_DIMS or HDF5_FINE_READ_FIXED_DIMS + * we compute the time it took to only open the file */ + if(t == HDF5_FINE_WRITE_FIXED_DIMS) + pt->total_time[HDF5_FILE_WRITE_OPEN] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_GROSS_WRITE_FIXED_DIMS])); + else if(t == HDF5_FINE_READ_FIXED_DIMS) + pt->total_time[HDF5_FILE_READ_OPEN] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_GROSS_READ_FIXED_DIMS])); } else { struct timeval sys_t; - gettimeofday(&sys_t, NULL); + HDgettimeofday(&sys_t, NULL); pt->total_time[t] += sub_time(&sys_t, &(pt->sys_timer[t])); /* ((double)sys_t.tv_sec + @@ -178,12 +178,12 @@ set_time(pio_time *pt, timer_type t, int start_stop) ((double)pt->sys_timer[t].tv_sec + ((double)pt->sys_timer[t].tv_usec) / MICROSECOND);*/ - /* When we stop the timer for HDF5_GROSS_WRITE_FIXED_DIMS or HDF5_GROSS_READ_FIXED_DIMS - * we compute the time it took to close the file after the last read/write finished */ - if(t == HDF5_GROSS_WRITE_FIXED_DIMS) - pt->total_time[HDF5_FILE_WRITE_CLOSE] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_FINE_WRITE_FIXED_DIMS])); - else if(t == HDF5_GROSS_READ_FIXED_DIMS) - pt->total_time[HDF5_FILE_READ_CLOSE] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_FINE_READ_FIXED_DIMS])); + /* When we stop the timer for HDF5_GROSS_WRITE_FIXED_DIMS or HDF5_GROSS_READ_FIXED_DIMS + * we compute the time it took to close the file after the last read/write finished */ + if(t == HDF5_GROSS_WRITE_FIXED_DIMS) + pt->total_time[HDF5_FILE_WRITE_CLOSE] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_FINE_WRITE_FIXED_DIMS])); + else if(t == HDF5_GROSS_READ_FIXED_DIMS) + pt->total_time[HDF5_FILE_READ_CLOSE] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_FINE_READ_FIXED_DIMS])); } } @@ -231,7 +231,7 @@ set_time(pio_time *pt, timer_type t, int start_stop) } fprintf(output, " Proc %d: %s %s: %.2f\n", myrank, msg, - (start_stop == START ? "Start" : "Stop"), + (start_stop == TSTART ? "Start" : "Stop"), pt->total_time[t]); } } diff --git a/perform/pio_timer.h b/perform/pio_timer.h index 943521a..a5ee6d7 100644 --- a/perform/pio_timer.h +++ b/perform/pio_timer.h @@ -53,8 +53,8 @@ typedef enum clock_type_ { /* Miscellaneous identifiers */ enum { - START, /* Start a specified timer */ - STOP /* Stop a specified timer */ + TSTART, /* Start a specified timer */ + TSTOP /* Stop a specified timer */ }; /* The performance time structure */ diff --git a/perform/sio_engine.c b/perform/sio_engine.c index e892bcc..df2e21e 100644 --- a/perform/sio_engine.c +++ b/perform/sio_engine.c @@ -22,7 +22,7 @@ #include #include #ifdef H5_HAVE_UNISTD_H -# include +# include #endif #include @@ -233,18 +233,18 @@ do_sio(parameters param) HDfprintf(output, "data filename=%s\n", fname); - set_time(res.timers, HDF5_GROSS_WRITE_FIXED_DIMS, START); + set_time(res.timers, HDF5_GROSS_WRITE_FIXED_DIMS, TSTART); hrc = do_fopen(¶m, fname, &fd, SIO_CREATE | SIO_WRITE); VRFY((hrc == SUCCESS), "do_fopen failed"); - set_time(res.timers, HDF5_FINE_WRITE_FIXED_DIMS, START); + set_time(res.timers, HDF5_FINE_WRITE_FIXED_DIMS, TSTART); hrc = do_write(&res, &fd, ¶m, buffer); - set_time(res.timers, HDF5_FINE_WRITE_FIXED_DIMS, STOP); + set_time(res.timers, HDF5_FINE_WRITE_FIXED_DIMS, TSTOP); VRFY((hrc == SUCCESS), "do_write failed"); /* Close file for write */ hrc = do_fclose(iot, &fd); - set_time(res.timers, HDF5_GROSS_WRITE_FIXED_DIMS, STOP); + set_time(res.timers, HDF5_GROSS_WRITE_FIXED_DIMS, TSTOP); VRFY((hrc == SUCCESS), "do_fclose failed"); if (!param.h5_write_only) { @@ -253,19 +253,19 @@ do_sio(parameters param) */ /* Open file for read */ - set_time(res.timers, HDF5_GROSS_READ_FIXED_DIMS, START); + set_time(res.timers, HDF5_GROSS_READ_FIXED_DIMS, TSTART); hrc = do_fopen(¶m, fname, &fd, SIO_READ); VRFY((hrc == SUCCESS), "do_fopen failed"); - set_time(res.timers, HDF5_FINE_READ_FIXED_DIMS, START); + set_time(res.timers, HDF5_FINE_READ_FIXED_DIMS, TSTART); hrc = do_read(&res, &fd, ¶m, buffer); - set_time(res.timers, HDF5_FINE_READ_FIXED_DIMS, STOP); + set_time(res.timers, HDF5_FINE_READ_FIXED_DIMS, TSTOP); VRFY((hrc == SUCCESS), "do_read failed"); /* Close file for read */ hrc = do_fclose(iot, &fd); - set_time(res.timers, HDF5_GROSS_READ_FIXED_DIMS, STOP); + set_time(res.timers, HDF5_GROSS_READ_FIXED_DIMS, TSTOP); VRFY((hrc == SUCCESS), "do_fclose failed"); } @@ -551,7 +551,7 @@ do_write(results *res, file_descr *fd, parameters *parms, void *buffer) } /* Start "raw data" write timer */ - set_time(res->timers, HDF5_RAW_WRITE_FIXED_DIMS, START); + set_time(res->timers, HDF5_RAW_WRITE_FIXED_DIMS, TSTART); /* Perform write */ hrc = dset_write(rank-1, fd, parms, buffer); @@ -563,7 +563,7 @@ do_write(results *res, file_descr *fd, parameters *parms, void *buffer) /* Stop "raw data" write timer */ - set_time(res->timers, HDF5_RAW_WRITE_FIXED_DIMS, STOP); + set_time(res->timers, HDF5_RAW_WRITE_FIXED_DIMS, TSTOP); /* Calculate write time */ @@ -628,7 +628,7 @@ static herr_t dset_write(int local_dim, file_descr *fd, parameters *parms, void int cur_dim = order[local_dim]-1; int ret_code = SUCCESS; int k; - hsize_t dims[MAX_DIMS], maxdims[MAX_DIMS]; + hsize_t dims[MAX_DIMS], maxdims[MAX_DIMS]; long i,j; herr_t hrc; @@ -855,7 +855,7 @@ do_read(results *res, file_descr *fd, parameters *parms, void *buffer) } /* end switch */ /* Start "raw data" read timer */ - set_time(res->timers, HDF5_RAW_READ_FIXED_DIMS, START); + set_time(res->timers, HDF5_RAW_READ_FIXED_DIMS, TSTART); hrc = dset_read(rank-1, fd, parms, buffer, buffer2); if (hrc < 0) { @@ -864,7 +864,7 @@ do_read(results *res, file_descr *fd, parameters *parms, void *buffer) } /* Stop "raw data" read timer */ - set_time(res->timers, HDF5_RAW_READ_FIXED_DIMS, STOP); + set_time(res->timers, HDF5_RAW_READ_FIXED_DIMS, TSTOP); /* Calculate read time */ diff --git a/perform/sio_perf.c b/perform/sio_perf.c index d852a45..16e1750 100644 --- a/perform/sio_perf.c +++ b/perform/sio_perf.c @@ -343,6 +343,11 @@ main(int argc, char **argv) int exit_value = EXIT_SUCCESS; struct options *opts = NULL; +#ifndef STANDALONE + /* Initialize h5tools lib */ + h5tools_init(); +#endif + output = stdout; opts = parse_command_line(argc, argv); diff --git a/perform/sio_perf.h b/perform/sio_perf.h index 2417b6f..3e4456a 100644 --- a/perform/sio_perf.h +++ b/perform/sio_perf.h @@ -19,6 +19,7 @@ #ifndef STANDALONE #include "H5private.h" #include "h5test.h" +#include "h5tools.h" #include "h5tools_utils.h" #else #include "sio_standalone.h" @@ -49,24 +50,24 @@ typedef enum vfdtype_ { } vfdtype; typedef struct parameters_ { - iotype io_type; /* The type of IO test to perform */ + iotype io_type; /* The type of IO test to perform */ vfdtype vfd; - long num_files; /* Number of files to create */ - long num_dsets; /* Number of datasets to create */ - off_t num_bytes; /* Number of bytes in each dset */ + long num_files; /* Number of files to create */ + long num_dsets; /* Number of datasets to create */ + off_t num_bytes; /* Number of bytes in each dset */ int num_iters; /* Number of times to loop doing the IO */ int rank; /* Rank of dataset */ - off_t dset_size[MAX_DIMS]; /* Dataset size */ - size_t buf_size[MAX_DIMS]; /* Buffer size */ - size_t chk_size[MAX_DIMS]; /* Chunk size */ - int order[MAX_DIMS]; /* Buffer size */ - hsize_t h5_align; /* HDF5 object alignment */ - hsize_t h5_thresh; /* HDF5 object alignment threshold */ - int h5_use_chunks; /* Make HDF5 dataset chunked */ - int h5_extendable; /* Make HDF5 dataset chunked */ - int h5_write_only; /* Perform the write tests only */ + off_t dset_size[MAX_DIMS]; /* Dataset size */ + size_t buf_size[MAX_DIMS]; /* Buffer size */ + size_t chk_size[MAX_DIMS]; /* Chunk size */ + int order[MAX_DIMS]; /* Buffer size */ + hsize_t h5_align; /* HDF5 object alignment */ + hsize_t h5_thresh; /* HDF5 object alignment threshold */ + int h5_use_chunks; /* Make HDF5 dataset chunked */ + int h5_extendable; /* Make HDF5 dataset chunked */ + int h5_write_only; /* Perform the write tests only */ unsigned h5_use_mpi_posix; /* VFD for HDF5 I/O */ - int verify; /* Verify data correctness */ + int verify; /* Verify data correctness */ } parameters; typedef struct results_ { diff --git a/perform/sio_standalone.h b/perform/sio_standalone.h index 77bb7f8..677a8ae 100644 --- a/perform/sio_standalone.h +++ b/perform/sio_standalone.h @@ -21,7 +21,7 @@ /** From H5private.h **/ -#include "H5public.h" /* Include Public Definitions */ +#include "H5public.h" /* Include Public Definitions */ /* @@ -129,11 +129,11 @@ #define HDfgetc(F) fgetc(F) #define HDfgetpos(F,P) fgetpos(F,P) #define HDfgets(S,N,F) fgets(S,N,F) -#ifdef _WIN32 +#ifdef H5_HAVE_WIN32_API #define HDfileno(F) _fileno(F) -#else /* _WIN32 */ +#else /* H5_HAVE_WIN32_API */ #define HDfileno(F) fileno(F) -#endif /* _WIN32 */ +#endif /* H5_HAVE_WIN32_API */ #define HDfloor(X) floor(X) #define HDfmod(X,Y) fmod(X,Y) #define HDfopen(S,M) fopen(S,M) @@ -169,7 +169,7 @@ H5_DLL int HDfprintf (FILE *stream, const char *fmt, ...); * For Unix, if off_t is not 64bit big, try use the pseudo-standard * xxx64 versions if available. */ -#ifdef _WIN32 +#ifdef H5_HAVE_WIN32_API #define HDfstat(F,B) _fstati64(F,B) #define HDlstat(S,B) _lstati64(S,B) #define HDstat(S,B) _stati64(S,B) @@ -202,7 +202,11 @@ H5_DLL int HDfprintf (FILE *stream, const char *fmt, ...); #define HDgetgrgid(G) getgrgid(G) #define HDgetgrnam(S) getgrnam(S) #define HDgetgroups(Z,G) getgroups(Z,G) +#ifdef H5_HAVE_VISUAL_STUDIO +#define HDgetlogin() Wgetlogin() +#else /* H5_HAVE_VISUAL_STUDIO */ #define HDgetlogin() getlogin() +#endif /* H5_HAVE_VISUAL_STUDIO */ #define HDgetpgrp() getpgrp() #define HDgetpid() getpid() #define HDgetppid() getppid() @@ -235,7 +239,7 @@ H5_DLL int HDfprintf (FILE *stream, const char *fmt, ...); #define HDlog(X) log(X) #define HDlog10(X) log10(X) #define HDlongjmp(J,N) longjmp(J,N) -#ifdef _WIN32 +#ifdef H5_HAVE_WIN32_API #define HDlseek(F,O,W) _lseeki64(F,O,W) #else #ifdef H5_HAVE_LSEEK64 @@ -258,18 +262,18 @@ H5_DLL int HDfprintf (FILE *stream, const char *fmt, ...); #define HDmemcpy(X,Y,Z) memcpy((char*)(X),(const char*)(Y),Z) #define HDmemmove(X,Y,Z) memmove((char*)(X),(const char*)(Y),Z) /* - * The (void*) cast just avoids a compiler warning in _WIN32 + * The (void*) cast just avoids a compiler warning in H5_HAVE_VISUAL_STUDIO */ -#ifdef _WIN32 +#ifdef H5_HAVE_VISUAL_STUDIO #define HDmemset(X,C,Z) memset((void*)(X),C,Z) -#else /* _WIN32 */ +#else /* H5_HAVE_VISUAL_STUDIO */ #define HDmemset(X,C,Z) memset(X,C,Z) -#endif /* _WIN32 */ -#ifdef _WIN32 +#endif /* H5_HAVE_VISUAL_STUDIO */ +#ifdef H5_HAVE_WIN32_API #define HDmkdir(S,M) _mkdir(S) -#else /* _WIN32 */ +#else /* H5_HAVE_WIN32_API */ #define HDmkdir(S,M) mkdir(S,M) -#endif /* _WIN32 */ +#endif /* H5_HAVE_WIN32_API */ #define HDmkfifo(S,M) mkfifo(S,M) #define HDmktime(T) mktime(T) #define HDmodf(X,Y) modf(X,Y) @@ -331,7 +335,7 @@ int HDremove_all(const char * fname); #define HDsetuid(U) setuid(U) /* Windows does not permit setting the buffer size to values less than 2. */ -#ifndef _WIN32 +#ifndef H5_HAVE_WIN32_API #define HDsetvbuf(F,S,M,Z) setvbuf(F,S,M,Z) #else #define HDsetvbuf(F,S,M,Z) setvbuf(F,S,M,(Z>1?Z:2)) @@ -350,7 +354,7 @@ int HDremove_all(const char * fname); #define HDsin(X) sin(X) #define HDsinh(X) sinh(X) #define HDsleep(N) sleep(N) -#ifdef _WIN32 +#ifdef H5_HAVE_WIN32_API #define HDsnprintf _snprintf /*varargs*/ #else #define HDsnprintf snprintf /*varargs*/ @@ -369,7 +373,7 @@ H5_DLL void HDsrand(unsigned int seed); #endif /* sscanf() variable arguments */ -#define HDstrcasecmp(X,Y) strcasecmp(X,Y) +#define HDstrcasecmp(X,Y) strcasecmp(X,Y) #define HDstrcat(X,Y) strcat(X,Y) #define HDstrchr(S,C) strchr(S,C) #define HDstrcmp(X,Y) strcmp(X,Y) @@ -415,7 +419,7 @@ H5_DLL int64_t HDstrtoll (const char *s, const char **rest, int base); #define HDumask(N) umask(N) #define HDuname(S) uname(S) #define HDungetc(C,F) ungetc(C,F) -#ifdef _WIN32 +#ifdef H5_HAVE_WIN32_API #define HDunlink(S) _unlink(S) #else #define HDunlink(S) unlink(S) @@ -428,7 +432,7 @@ H5_DLL int64_t HDstrtoll (const char *s, const char **rest, int base); #define HDvfprintf(F,FMT,A) vfprintf(F,FMT,A) #define HDvprintf(FMT,A) vprintf(FMT,A) #define HDvsprintf(S,FMT,A) vsprintf(S,FMT,A) -#ifdef _WIN32 +#ifdef H5_HAVE_WIN32_API # define HDvsnprintf(S,N,FMT,A) _vsnprintf(S,N,FMT,A) #else # define HDvsnprintf(S,N,FMT,A) vsnprintf(S,N,FMT,A) @@ -443,9 +447,9 @@ H5_DLL int64_t HDstrtoll (const char *s, const char **rest, int base); * And now for a couple non-Posix functions... Watch out for systems that * define these in terms of macros. */ -#ifdef _WIN32 +#ifdef H5_HAVE_WIN32_API #define HDstrdup(S) _strdup(S) -#else /* _WIN32 */ +#else /* H5_HAVE_WIN32_API */ #if !defined strdup && !defined H5_HAVE_STRDUP extern char *strdup(const char *s); @@ -453,7 +457,7 @@ extern char *strdup(const char *s); #define HDstrdup(S) strdup(S) -#endif /* _WIN32 */ +#endif /* H5_HAVE_WIN32_API */ /* * HDF Boolean type. @@ -487,7 +491,7 @@ extern const char *opt_arg; /* flag argument (or value) */ enum { no_arg = 0, /* doesn't take an argument */ - require_arg, /* requires an argument */ + require_arg, /* requires an argument */ optional_arg /* argument is optional */ }; diff --git a/perform/sio_timer.c b/perform/sio_timer.c index f188a10..f233de3 100644 --- a/perform/sio_timer.c +++ b/perform/sio_timer.c @@ -39,15 +39,15 @@ sio_time *timer_g; /* timer: global for stub functions */ * Function: sub_time * Purpose: Struct two time values, and return the difference, in microseconds * - * Note that the function assumes that a > b + * Note that the function assumes that a > b * Programmer: Leon Arber, 1/27/06 */ static double sub_time(struct timeval* a, struct timeval* b) { return (((double)a->tv_sec + ((double)a->tv_usec) / MICROSECOND) - - ((double)b->tv_sec + - ((double)b->tv_usec) / MICROSECOND)); + ((double)b->tv_sec + + ((double)b->tv_usec) / MICROSECOND)); } @@ -82,7 +82,7 @@ sio_time_new(void) void sio_time_destroy(sio_time *pt) { - free(pt); + HDfree(pt); /* reset the global timer pointer too. */ timer_g = NULL; } @@ -100,15 +100,15 @@ sio_time * set_time(sio_time *pt, timer_type t, int start_stop) { if (pt) { - if (start_stop == START) { + if (start_stop == TSTART) { HDgettimeofday(&pt->sys_timer[t], NULL); - /* When we start the timer for HDF5_FINE_WRITE_FIXED_DIMS or HDF5_FINE_READ_FIXED_DIMS - * we compute the time it took to only open the file */ - if(t == HDF5_FINE_WRITE_FIXED_DIMS) - pt->total_time[HDF5_FILE_WRITE_OPEN] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_GROSS_WRITE_FIXED_DIMS])); - else if(t == HDF5_FINE_READ_FIXED_DIMS) - pt->total_time[HDF5_FILE_READ_OPEN] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_GROSS_READ_FIXED_DIMS])); + /* When we start the timer for HDF5_FINE_WRITE_FIXED_DIMS or HDF5_FINE_READ_FIXED_DIMS + * we compute the time it took to only open the file */ + if(t == HDF5_FINE_WRITE_FIXED_DIMS) + pt->total_time[HDF5_FILE_WRITE_OPEN] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_GROSS_WRITE_FIXED_DIMS])); + else if(t == HDF5_FINE_READ_FIXED_DIMS) + pt->total_time[HDF5_FILE_READ_OPEN] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_GROSS_READ_FIXED_DIMS])); } else { @@ -122,12 +122,12 @@ set_time(sio_time *pt, timer_type t, int start_stop) ((double)pt->sys_timer[t].tv_sec + ((double)pt->sys_timer[t].tv_usec) / MICROSECOND);*/ - /* When we stop the timer for HDF5_GROSS_WRITE_FIXED_DIMS or HDF5_GROSS_READ_FIXED_DIMS - * we compute the time it took to close the file after the last read/write finished */ - if(t == HDF5_GROSS_WRITE_FIXED_DIMS) - pt->total_time[HDF5_FILE_WRITE_CLOSE] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_FINE_WRITE_FIXED_DIMS])); - else if(t == HDF5_GROSS_READ_FIXED_DIMS) - pt->total_time[HDF5_FILE_READ_CLOSE] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_FINE_READ_FIXED_DIMS])); + /* When we stop the timer for HDF5_GROSS_WRITE_FIXED_DIMS or HDF5_GROSS_READ_FIXED_DIMS + * we compute the time it took to close the file after the last read/write finished */ + if(t == HDF5_GROSS_WRITE_FIXED_DIMS) + pt->total_time[HDF5_FILE_WRITE_CLOSE] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_FINE_WRITE_FIXED_DIMS])); + else if(t == HDF5_GROSS_READ_FIXED_DIMS) + pt->total_time[HDF5_FILE_READ_CLOSE] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_FINE_READ_FIXED_DIMS])); } @@ -171,7 +171,7 @@ set_time(sio_time *pt, timer_type t, int start_stop) } fprintf(output, " %s %s: %.2f\n", msg, - (start_stop == START ? "Start" : "Stop"), + (start_stop == TSTART ? "Start" : "Stop"), pt->total_time[t]); } } diff --git a/perform/sio_timer.h b/perform/sio_timer.h index 1fa880d..04432af 100644 --- a/perform/sio_timer.h +++ b/perform/sio_timer.h @@ -27,7 +27,7 @@ #endif #ifdef H5_HAVE_WINSOCK_H -# include +# include #endif /* H5_HAVE_WINSOCK_H */ /* The different types of timers we can have */ @@ -52,8 +52,8 @@ typedef enum timer_type_ { /* Miscellaneous identifiers */ enum { - START, /* Start a specified timer */ - STOP /* Stop a specified timer */ + TSTART, /* Start a specified timer */ + TSTOP /* Stop a specified timer */ }; /* The performance time structure */ diff --git a/perform/zip_perf.c b/perform/zip_perf.c index 5729baf..585dc13 100644 --- a/perform/zip_perf.c +++ b/perform/zip_perf.c @@ -23,6 +23,7 @@ /* our header files */ #include "h5test.h" +#include "h5tools.h" #include "h5tools_utils.h" #ifdef H5_HAVE_FILTER_DEFLATE @@ -66,9 +67,9 @@ #endif /* internal variables */ -static const char *prog; -static const char *option_prefix; -static char *filename; +static const char *prog=NULL; +static const char *option_prefix=NULL; +static char *filename=NULL; static int compress_percent = 0; static int compress_level = Z_DEFAULT_COMPRESSION; static int output, random_test = FALSE; @@ -175,6 +176,7 @@ cleanup(void) { if (!getenv("HDF5_NOCLEANUP")) unlink(filename); + free(filename); } static void @@ -292,10 +294,11 @@ uncompress_buffer(Bytef *dest, uLongf *destLen, const Bytef *source, * Programmer: Bill Wendling, 06. June 2002 * Modifications: */ +#define ZIP_PERF_FILE "zip_perf.data" static void get_unique_name(void) { - const char *prefix = NULL, *tmpl = "zip_perf.data"; + const char *prefix = NULL; const char *env = getenv("HDF5_PREFIX"); if (env) @@ -305,19 +308,20 @@ get_unique_name(void) prefix = option_prefix; if (prefix) - /* 2 = 1 for '/' + 1 for null terminator */ - filename = (char *) HDmalloc(strlen(prefix) + strlen(tmpl) + 2); + /* 2 = 1 for '/' + 1 for null terminator */ + filename = (char *) HDmalloc(strlen(prefix) + strlen(ZIP_PERF_FILE) + 2); else - filename = (char *) HDmalloc(strlen(tmpl) + 1); + filename = (char *) HDmalloc(strlen(ZIP_PERF_FILE) + 1); if (!filename) error("out of memory"); + filename[0] = 0; if (prefix){ - strcpy(filename, prefix); - strcat(filename, "/"); + strcpy(filename, prefix); + strcat(filename, "/"); } - strcat(filename, tmpl); + strcat(filename, ZIP_PERF_FILE); } /* @@ -410,7 +414,7 @@ fill_with_random_data(Bytef *src, uLongf src_len) register unsigned u; h5_stat_t stat_buf; - if (stat("/dev/urandom", &stat_buf) == 0) { + if (HDstat("/dev/urandom", &stat_buf) == 0) { uLongf len = src_len; Bytef *buf = src; int fd = HDopen("/dev/urandom", O_RDONLY, 0); @@ -570,6 +574,9 @@ main(int argc, char **argv) int opt; prog = argv[0]; + + /* Initialize h5tools lib */ + h5tools_init(); while ((opt = get_option(argc, (const char **)argv, s_opts, l_opts)) > 0) { switch ((char)opt) { diff --git a/release_docs/CMake.txt b/release_docs/CMake.txt old mode 100755 new mode 100644 index e916df9..2d15741 --- a/release_docs/CMake.txt +++ b/release_docs/CMake.txt @@ -25,8 +25,11 @@ Notes: This short instruction is written for users who want to quickly build Please send us any comments on how CMake support can be improved on any system. Visit the KitWare site for more information about CMake. - 3. Build and test results can be submitted to our CDash server at: - www.cdash.hdfgroup.org. + 3. If you are building HDF5 on Windows, do NOT use or execute any + files from the windows folder. + + 4. Build and test results can be submitted to our CDash server at: + cdash.hdfgroup.uiuc.edu. Please read the HDF and CDash document at: www.hdfgroup.org/CDash/HowToSubmit. @@ -36,7 +39,7 @@ Notes: This short instruction is written for users who want to quickly build ======================================================================== 1. We suggest you obtain the latest CMake for windows from the Kitware - web site. The HDF5 1.8.x product requires CMake version 2.8.4. + web site. The HDF5 1.8.x product requires CMake version 2.8.6. 2. If you plan to use Zlib or Szip; A. Download the packages and install them @@ -102,8 +105,8 @@ Notes: This short instruction is written for users who want to quickly build is: * SZIP_INCLUDE_DIR:PATH= * SZIP_LIBRARY:FILEPATH= - * ZLIB_INCLUDE_DIR:PATH= - * ZLIB_LIBRARY:FILEPATH= + * ZLIB_INCLUDE_DIR:PATH= + * ZLIB_LIBRARY:FILEPATH= * :BOOL=[ON | OFF] is: @@ -124,7 +127,6 @@ Notes: This short instruction is written for users who want to quickly build SET (HDF5_ENABLE_SZIP_ENCODING ON CACHE BOOL "Use SZip Encoding" FORCE) SET (HDF5_ENABLE_SZIP_SUPPORT ON CACHE BOOL "Use SZip Filter" FORCE) SET (HDF5_ENABLE_Z_LIB_SUPPORT ON CACHE BOOL "Enable Zlib Filters" FORCE) - SET (HDF5_USE_H5DUMP_PACKED_BITS ON CACHE BOOL "Use the PACKED BITS feature in h5dump" FORCE) SET (HDF5_ENABLE_COVERAGE OFF CACHE BOOL "Enable code coverage for Libraries and Programs" FORCE) 2. Configure the cache settings @@ -152,6 +154,12 @@ Notes: This short instruction is written for users who want to quickly build cmake -C ../config/cmake/cacheinit.cmake -G "Visual Studio 9 2008" \ -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=OFF -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=OFF .. + 2.3 On Windows, if you are using a VS Express version you must be sure that the + following two options are correctly set/unset: + + HDF5_NO_PACKAGES:BOOL=ON + HDF5_USE_FOLDERS:BOOL=OFF + 3. Build HDF5 On Windows, you can build HDF5 using either the Visual Studio Environment @@ -215,6 +223,10 @@ Notes: This short instruction is written for users who want to quickly build NOTE: We have just introduced the packaging capability and it has not been extensively tested. Please send us comments on how it can be improved. + See NSIS note 8 of this document. + Also, if you are using a VS Express version or do not want to enable + the packaging components, set HDF5_NO_PACKAGES to ON (on the command + line add -DHDF5_NO_PACKAGES:BOOL=ON) 6. The files that support building HDF5 with CMake are all the files in the config/cmake folder, the CMakeLists.txt files in each source folder, and @@ -224,6 +236,63 @@ Notes: This short instruction is written for users who want to quickly build 7. More information about using CMake can be found at the KitWare site, www.cmake.org. + + 8. Nullsoft Scriptable Install System + The Nullsoft Scriptable Install System (NSIS) is an open source installation + system. It was created by the WinAmp authors to distribute that application, + but it is now a general-purpose system which anyone might use. NSIS installers + recognize /S for silent installation and /D=dir to specify the + "output directory", which is where the program will be installed. These + options are case-sensitive, so be sure to type them in upper case. + + +======================================================================== + All options for HDF5 C/C++ Libraries with CMake +======================================================================== +OPTION (HDF5_Enable_Clear_File_Buffers "Securely clear file buffers before writing to file" ON) +OPTION (HDF5_Enable_Instrument "Instrument The library" HDF5_Enable_Instrument) +OPTION (HDF5_STRICT_FORMAT_CHECKS "Whether to perform strict file format checks" OFF) +OPTION (HDF5_METADATA_TRACE_FILE "Enable metadata trace file collection" OFF) +OPTION (HDF5_WANT_DATA_ACCURACY "IF data accuracy is guaranteed during data conversions" ON) +OPTION (HDF5_WANT_DCONV_EXCEPTION "exception handling functions is checked during data conversions" ON) +OPTION (HDF5_ENABLE_CODESTACK "Enable the function stack tracing (for developer debugging)." OFF) +OPTION (HDF5_ENABLE_HSIZET "Enable datasets larger than memory" ON) +OPTION (HDF5_ENABLE_LARGE_FILE "Enable support for large (64-bit) files on Linux." ON) +OPTION (HDF5_ENABLE_GPFS "Enable GPFS hints for the MPI/POSIX file driver" OFF) +IF (APPLE) OPTION (HDF5_BUILD_WITH_INSTALL_NAME "Build with library install_name set to the installation path" OFF) +OPTION (BUILD_SHARED_LIBS "Build Shared Libraries" OFF) +OPTION (BUILD_STATIC_EXECS "Build Static Executabless" OFF) +OPTION (BUILD_STATIC_PIC "Build Static PIC" OFF) +OPTION (HDF5_ENABLE_COVERAGE "Enable code coverage for Libraries and Programs" OFF) +OPTION (HDF5_ENABLE_USING_MEMCHECKER "Indicate that a memory checker is used" OFF) +OPTION (HDF5_ENABLE_DEPRECATED_SYMBOLS "Enable deprecated public API symbols" ON) +OPTION (HDF5_ENABLE_TRACE "Enable API tracing capability" ON) +OPTION (HDF5_ENABLE_TRACE "Enable API tracing capability" OFF) +OPTION (HDF5_ENABLE_EMBEDDED_LIBINFO "embed library info into executables" ON) +OPTION (HDF5_DISABLE_COMPILER_WARNINGS "Disable compiler warnings" OFF) +OPTION (HDF5_ENABLE_PARALLEL "Enable parallel build (requires MPI)" OFF) +OPTION (HDF5_USE_16_API_DEFAULT "Use the HDF5 1.6.x API by default" OFF) +OPTION (HDF5_USE_18_API_DEFAULT "Use the HDF5 1.8.x API by default" OFF) +OPTION (HDF5_USE_FILTER_${FILTER} "Use the ${FILTER} Filter" ON) +OPTION (HDF5_ALLOW_EXTERNAL_SUPPORT "Allow External Library Building" "NO") +OPTION (ZLIB_USE_EXTERNAL "Use External Library Building for ZLIB" 0) +OPTION (SZIP_USE_EXTERNAL "Use External Library Building for SZIP" 0) +OPTION (HDF5_ENABLE_Z_LIB_SUPPORT "Enable Zlib Filters" OFF) +OPTION (HDF5_ENABLE_SZIP_SUPPORT "Use SZip Filter" OFF) +IF (HDF5_ENABLE_SZIP_SUPPORT) OPTION (HDF5_ENABLE_SZIP_ENCODING "Use SZip Encoding" OFF) +OPTION (HDF5_PACKAGE_EXTLIBS "CPACK - include external libraries" OFF) +IF (WIN32 AND NOT CYGWIN) OPTION (HDF5_ENABLE_THREADSAFE "Enable Threadsafety" OFF) +OPTION (BUILD_TESTING "Build HDF5 Unit Testing" OFF) +OPTION (HDF5_TEST_VFD "Execute tests with different VFDs" OFF) +IF (HDF5_TEST_VFD) OPTION (HDF5_TEST_FHEAP_VFD "Execute tests with different VFDs" ON) +OPTION (HDF5_BUILD_FORTRAN "Build FORTRAN support" OFF) +IF (HDF5_BUILD_FORTRAN) OPTION (HDF5_ENABLE_F2003 "Enable FORTRAN 2003 Standard" OFF) +OPTION (HDF5_BUILD_EXAMPLES "Build HDF5 Library Examples" OFF) +OPTION (HDF5_BUILD_CPP_LIB "Build HDF5 C++ Library" OFF) +OPTION (HDF5_BUILD_TOOLS "Build HDF5 Tools" OFF) +OPTION (HDF5_BUILD_HL_LIB "Build HIGH Level HDF5 Library" OFF) +OPTION (HDF5_NO_PACKAGES "Do not include CPack Packaging" OFF) +OPTION (HDF5_USE_FOLDERS "Do not include CPack Packaging" OFF) ************************************************************************ diff --git a/release_docs/COPYING b/release_docs/COPYING old mode 100755 new mode 100644 diff --git a/release_docs/INSTALL_Cygwin.txt b/release_docs/INSTALL_Cygwin.txt index 8416dfc..5406820 100644 --- a/release_docs/INSTALL_Cygwin.txt +++ b/release_docs/INSTALL_Cygwin.txt @@ -181,7 +181,7 @@ Install HDF5 on Cygwin example, if users want to configure HDF5 C/C++/Fortran library with szip library enabled, with zlib library at /cygdrive/c/usr/, and install HDF5 into directory - /cygdrive/c/hdf5 using gcc/g++ as C/C++ compiler and g95 + /cygdrive/c/hdf5 using gcc/g++ as C/C++ compiler and gfortran as fortran compiler $ ./configure diff --git a/release_docs/INSTALL_Windows.txt b/release_docs/INSTALL_Windows.txt index 243ccba..e7184d4 100644 --- a/release_docs/INSTALL_Windows.txt +++ b/release_docs/INSTALL_Windows.txt @@ -68,6 +68,9 @@ Preconditions: Note: We have attempted to mirror our Autoconf configuration files for maintainence reasons. We are still working to synchronize the configuration files. + Also, if you are using a VS Express version or do not want to enable + the packaging components, set HDF5_NO_PACKAGES to ON (on the command + line add -DHDF5_NO_PACKAGES:BOOL=ON) 5. Set up a directory structure to unpack the library. For example: diff --git a/release_docs/INSTALL_Windows_From_Command_Line.txt b/release_docs/INSTALL_Windows_From_Command_Line.txt old mode 100755 new mode 100644 diff --git a/release_docs/INSTALL_Windows_Short_NET.TXT b/release_docs/INSTALL_Windows_Short_NET.TXT old mode 100755 new mode 100644 diff --git a/release_docs/INSTALL_Windows_Short_VS2005.TXT b/release_docs/INSTALL_Windows_Short_VS2005.TXT old mode 100755 new mode 100644 diff --git a/release_docs/INSTALL_Windows_Short_VS2008.TXT b/release_docs/INSTALL_Windows_Short_VS2008.TXT old mode 100755 new mode 100644 diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 646b33e..00df5c6 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.81-FA_a5 currently under development +HDF5 version 1.9.111-FA_a5 currently under development ================================================================================ @@ -39,6 +39,8 @@ New Features Configuration: ------------- + - Added code to display the version information of XL fortran and C++ + in the summary of configure. (AKC - 2012/02/28 - HDFFV-7793) - Configure now generates Makefiles that build in "silent make mode" by default in which compile and link lines are significantly simplified for clarity. To override this and view actual compile and @@ -91,6 +93,12 @@ New Features Library: -------- + - I added a new parameter of object access property list to the function + H5Rdereference (Issue 2763). It's called H5Rdereference2 now. The former + H5Rdereference function has been deprecated to H5Rdereference1. (SLU - + 2011/7/18) + - H5Tcreate now supports string type (fixed-length and variable-length). + (SLU - 2011/05/20) - Added ability to cache files opened through external links. Added new public functions H5Pset_elink_file_cache_size(), H5Pget_elink_file_cache_size(), and H5Fclear_elink_file_cache(). @@ -150,6 +158,12 @@ New Features Parallel Library: ----------------- + - Special Collective IO (IO when some processes do not contribute to the + IO) and Complex Derived Datatype MPI functionalities are no longer + conditionally enabled in the library by configure. They are always + enabled in order to take advantage of performance boosts from these + behaviors. Older MPI implementations that do not allow for these + functionalities can no longer by used by HDF5. (MAM - 2011/07/08). - Modified parallel tests to run with arbitrary number of processes. The modified tests are testphdf5 (parallel dataset access), t_chunk_alloc (chunk allocation), and t_posix_compliant (posix compliance). The rest of @@ -158,6 +172,38 @@ New Features Fortran Library: ---------------- + HDF5 Fortran library was enhanced to support Fortran 2003 standard. + The following features are available when the HDF5 library is configured + using --enable-fortran --enable-fortran2003 configure flags AND + if fortran compiler is Fortran2003 compliant: + + - Subroutines overloaded with the C_PTR derived type: + h5pget_f + h5pget_fill_value_f + h5pinsert_f + h5pregister_f + h5pset_f + h5pset_fill_value_f + h5rcreate_f + h5rderefrence_f + h5rget_name_f + h5rget_obj_type_f + - Subroutines overloaded with the C_PTR derived type + and simplified signatures: + h5aread_f + h5awrite_f + h5dread_f + h5dwrite_f + - New subroutines + h5dvlen_reclaim_f + h5literate_by_name_f + h5literate_f + h5ovisit_f + h5tconvert_f + + - Subroutines with additional optional parameters: + h5pcreate_class_f + (EIP - 2011/10/14) - Added for the C APIs the Fortran wrappers: h5dget_access_plist_f @@ -169,11 +215,11 @@ New Features C++ Library: ------------ - - New member functions - + Overloaded CommonFG::getObjnameByIdx to take char* for name - + Overloaded CommonFG::getObjTypeByIdx to return type name as a char*. + - New member functions + + Overloaded CommonFG::getObjnameByIdx to take char* for name + + Overloaded CommonFG::getObjTypeByIdx to return type name as a char*. (BMR - 2010/05/02) - + DataSet::getInMemDataSize() to simplify getting the dataset's + + DataSet::getInMemDataSize() to simplify getting the dataset's data size in memory. (BMR - 2009/07/26) - These member functions were added as wrapper for H5Rdereference to replace the incorrect IdComponent::dereference(). @@ -195,6 +241,33 @@ New Features Tools: ------ + - h5dump: Added capability for "-a" option to show attributes containing "/" + by using an escape character. For example, for a dataset "/dset" + containing attribute "speed(m/h)", use "h5dump -a "/dset/speed(\/h)" + to show the content of the attribute. See details at HDFFV-7523 + (PC -- 2012/03/12) + - h5dump: Added ability to apply command options across multiple files using a + wildcard in the filename. Example; "h5dump -H -d Dataset1 tarr*.h5". + HDFFV-7876 (ADB - 2012/03/12). + - h5repack: Improved performance for big chunked datasets (size > 128MB) + when used with layout (-l) or compression (-f) option. + It would perform much better prior to the improvement, + especially for cases that chunk dimentions looks like + "1024x5x1" (compare to "1x5x1024"). When bigger numbers + are toward front and smaller number is toward back in chunk + dimentions. HDFFV-7862 (JKM - 2012/03/01) + - h5dump: Added new option --no-compact-subset. This option will not + interpret the '[' character as starting the compact form of + subsetting. This is useful when the "h5dump error: unable to + open dataset "datset_name"" message is output because a dataset + name contains a '[' character. HDFFV-7689 (ADB - 2012/01/31) + - h5dump: Corrected schema location: + + (ADB - 2011/08/10) - h5diff: Added new level for -v (verbose) option. The new levels are 1 and 2. So -v1 and -v2 can be specified to view more information about attributes differences. @@ -216,7 +289,7 @@ New Features - h5diff: Add new flag --follow-symlinks. (refer to --help for details) (JKM - 2010/01/25) - h5diff: fix for displaying garbage value on LE machine for BE data. - (JKM - 2009/11/20) + (JKM - 2009/11/20) - h5dump: subsetting now allows default for count. Also trailing ; in short form can be omitted after last specified value. (ADB - 2009/09/04) @@ -265,6 +338,21 @@ New Features - Table: In version 3.0 of Table, "NROWS" (used to store number of records) was deprecated (PVN - 2008/11/24) + - Added Fortran wrappers for Dimension Scale APIs. HDFFV-3797 + h5dsset_scale_f + h5dsattach_scale_f + h5dsdetach_scale_f + h5dsis_attached_f + h5dsis_scale_f + h5dsset_label_f + h5dsget_label_f + h5dsget_scale_name_f + h5dsget_num_scales_f + (EIP for SB - 2011/10/13) + + - New API: h5ltpath_valid (Fortran: h5ltpath_valid_f) which checks + if a path is correct and determines if a link resolves to a valid + object and does not dangle. (MSB- 2012/3/15) Documentation ------------- @@ -280,6 +368,48 @@ Bug Fixes since HDF5-1.8.0 release Library ------- + - H5Pset_data_transform had seg fault in some cases like x*-100. It + works correctly now and handles other cases like 100-x or 2/x. + (SLU - 2012/3/15. Issue 7922) + - Fixed rare corruption bugs that could occur when using the new object + header format. (NAF - 2012/3/15 - HDFFV-7879) + - Creating a dataset in a read-only file caused seg fault when the file + is closed. It's fixed. The attemp to create a dataset will fail + with the error stack indicating the file is read-only. (SLU - + 2012/1/25. Issue 7756) + - Fixed a seg fault that could occur when shrinking a dataset with chunks + larger than 1 MB. (NAF - 2011/11/30 - HDFFV-7833) + - The library allowed the conversion of strings between ASCII and UTF8 + (Issue 7582). We have corrected it to report an error under this + situation. (SLU - 2011/11/8) + - The library had seg fault when it tried to shrink the size of compound type + through H5Tset_size immediately after the type was created (Issue + 7618). It's fixed now. (SLU - 2011/10/26) + - Fixed a bug that occurred when using H5Ocopy on a committed datatype + containing an attribute using that committed datatype. + (NAF - 2011/10/13 - Issue 5854) + - #ifdef _WIN32 instances changed to #ifdef H5_HAVE_WIN32_API and added + H5_HAVE_VISUAL_STUDIO checks where necessary. CMake only as configure + never set _WIN32. + - CLANG compiler with the options -fcatch-undefined-behavior and -ftrapv + discovered 3 problems in tests and tools' library (Issue 7674): + 1. In dsets.c, left shifting an unsigned int for 32 bits or more + caused undefined behavior. + 2. In dt_arith.c, the INIT_INTEGER macro definition has an overflow + when the value is negative minimal and is being subtracted one. + 3. In tools/lib/h5tools_str.c, right shifting an int value for 32 bits + or more caused undefined behavior. + All the problems have been corrected. (SLU - 2011/9/2) + - In v1.6 library, there was EOA for the whole MULTI file saved in the + super block. We took it out in v1.8 library because it's meaningless + for the MULTI file. v1.8 library saves the EOA for the metadata file, + instead. But this caused some backward compatibility problem. + v1.8 library couldn't open the file created with v1.6 library. We + fixed the problem by checking the EOA value to detect the file + created with v1.6 library. (SLU - 2011/6/22) + - When a dataset had filters and reading data failed, the error message + didn't say which filter isn't registered. It's fixed now. + (SLU - 2011/6/3) - The datatype handler created with H5Tencode/decode used to have the reference count 0 (zero). I have fixed it. It is 1 (one) now. (SLU - 2011/2/18) @@ -444,9 +574,9 @@ Bug Fixes since HDF5-1.8.0 release in some timezones to get false errors. This a deficiency in the Windows mktime() function, and has been handled properly. SJW - 2008/06/19 - Fixed the problem with the searching of target file for H5Lcreate_external(). - The searching pattern will depend on whether the target file's - pathname is an absolute or a relative path. Please see the description - in the RM for H5Lcreate_external(). (VC - 2008/04/08) + The searching pattern will depend on whether the target file's + pathname is an absolute or a relative path. Please see the description + in the RM for H5Lcreate_external(). (VC - 2008/04/08) - Fixed possible file corruption bug when encoding datatype descriptions for compound datatypes whose size was between 256 & 511 bytes and the file was opened with the "use the @@ -463,6 +593,14 @@ Bug Fixes since HDF5-1.8.0 release Configuration ------------- + - Added --enable-fortran2003 flag to enable Fortran2003 support + in the HDF5 Fortran library. The flag should be used along with the + --enable-fortran flag and takes affect only when Fortran compiler + is Fortran2003 compliant. (EIP - 2011/11/14) + + - In Windows platform, the default VFD, was Windows VFD, is restored back + to the SEC2, aka POSIX, VFD. The Windows VFD is deprecated. HDFFV-7740 + (AKC 2011/09/26) - Removed config/ibm-aix6.x. All IBM-AIX settings are in one file, ibm-aix. (AKC - 2011/4/14) - Shared C libraries are no longer disabled on Mac when Fortran @@ -510,7 +648,7 @@ Bug Fixes since HDF5-1.8.0 release prior to configuration. MAM - 2009/03/09 - BZ #1401. - Fixed error with 'make check install' failing due to h5dump needing other tools built first. MAM - 2008/10/24. - - When using shared szip, it is no longer necessary to specify + - Wpen using shared szip, it is no longer necessary to specify the path to the shared szip libraries in LD_LIBRARY_PATH. MAM - 2008/10/24. - The file libhdf5_fortran.settings is not installed since its content @@ -520,13 +658,88 @@ Bug Fixes since HDF5-1.8.0 release Performance ------------- + - ifdefs added to tests around include unistd.h and function to simulate + getlogin() on Windows. + (ADB - 2011/08/15) - perf_serial test added to Windows projects and check batch file. (ADB - 2009/06/11) Tools ----- + - h5dump: Added tools library error stack to properly catch error + information generated within the library. + HDFFV-7958 (ADB 2012/03/12) + - h5dump: Dangling links no longer throw error message, change process + when open link fails. + HDFFV-7839 (ADB 2012/03/12) + - h5diff: When two symbolic dangling links are compared with + --follow-symlinks option, the result should be same. It worked for + comparing two files, but didn't work for comparing two objects. + HDFFV-7835 (JKM 2012/03/09) + - h5dump: Refactored code to remove duplicated functions. Split XML + functions from DDL functions. Corrected indentation and formatting + errors. Also fixed subsetting counting overflow (HDFFV-5874). Verified + all tools call tools_init() in main. + HDFFV-7560 (ADB 2012/02/17) + - h5diff: fixed to prevent from displaying error stack message when + comparing the two dangling symlinks with follow-symlinks option. + HDFFV-7836 (JKM 2012/01/13) + - h5repack: fixed memory leak for handling variable length string in + attribute. HDFFV-7840 (JKM 2012/01/06) + - h5ls: fixed segfault when access region reference data in an + attribute. HDFFV-7838 (JKM 2011/12/29) + - h5diff: fixed segfault over non-comparable attribute with different + dimention or rank, along with '-c' option to display details. + HDFFV-7770 (JKM 2011/10/24) + - Fixed h5diff to display all the comparable object and attribute + regardless of non-comparables. HDFFV-7693 (JKM 2011/09/16) + - Fixed h5repack to update values of references(object and region) of + attributes in h5repack for 1) references, 2) ARRAY of references, + 3) VLEN of references, and 4) COMPOUND of references. + (JIRA HDF5 5932) PC -2011/09/14 + - h5diff: fixed segfault over dataset with container types + (array,lven) with multiple nested compound types. + (ex: compound->array->compound, compound->vlen->compound) + HDFFV-7712 JKM (2011/09/01) + - h5repack: added macro to handle failure in H5Dread/write when memory + allocation failed inside the library. (PC -- 2011/08/19) + - Fixed h5jam not to allow specifying an HDF5 formatted file as input + file for -u (user block file) option, because the original HDF5 file + will not be accessible if allows. HDFFV-5941 (JKM 2011/08/15) + - Revised command help pages of h5jam and h5unjam. The descriptions + were not up to date and some were missing. + HDFFV-7515 (JKM 2011/08/15) + - h5repack: h5repack failed to copy dataset if the layout is changed + from chunked with unlimited dims to contiguous. HDFFV-7649 + (PC -- 2011/07/15) + - h5diff: "--delta" option considers two NaN of the same type are + different, which is wrong based on h5diff description in Reference + Manual. HDFFV-7656 (PC -- 2011/07/15) + - Fixed h5diff to display instructive error message and exit with 1 + when mutually exclusive options (-d, -p and --use-system-epsilon) + are used together. HDFFV-7600 (JKM 2011/07/07) + - Fixed h5dump to display the first line of each element into correct + position for multiple dimention array type. + Before this fix, the first line of each element in array were + displayed after the last line of previous element without + moving to the next line (+indentation). + Bug #HDFFV-5878 (JKM 2011/06/15) + - Fixed h5dump to display correct value for H5T_STD_I8LE dataset + on a system (ppc64, linux, Big-Endian, clustering). + Bug #HDFFV-7594 (ABERT & JKM 2011/05/12) + - Fixed h5diff to compare file itself correctly. Previously h5diff + reported either different or not compatible in certain cases even + comparing file itself. This fix also improve performance when + comparing same target objects through verifying the obj&file + addresses before comparing the details in the objects (ex: datasets + or attributes) Bug #HDFFV-5928 (XCAO & JKM 2011/05/06) - Updated h5dump test case script to prevent entire test failure upon source directory is read-only. Bug# HDFFV-4342 (JKM 2011/4/12) + - Fixed h5dump displaying incorrect values for H5T_STD_I8BE type data in + attribute on Big-Endian machine. H5T_STD_I8BE is unsigned 8bit type, + so h5dump is supposed to display -2 instead of 254. It worked + correctly on Little-Endian system , but not on Big-Endian system. + Bug #HDFFV-4358 (JKM 2011/04/08) - Updated to unify option name to '--enable-error-stack' for printing HDF5 error stack messages for HDF5 tools. h5ls and h5dump for now. For h5ls, this replaces "-e/--errors" option, which is deprecated. @@ -613,7 +826,7 @@ Bug Fixes since HDF5-1.8.0 release (NAF - 2008/10/15) - Fixed unnecessary indentation of committed datatypes in h5dump. (NAF - 2008/10/15) - - Fixed bugs in h5stat:segmemtation fault when printing groups and + - Fixed bugs in h5stat:segmemtation fault when printing groups and print warning message when traversal of objects is unsuccessful. (see bug #1253) (VC- 2008/10/13) - Fixed bug in h5ls that prevented relative group listings (like @@ -633,8 +846,12 @@ Bug Fixes since HDF5-1.8.0 release was done incorrectly. Removed printing of attributes when doing binary output. PVN - 2008/06/05 + High-Level APIs: ------ + - Fixed the H5LTdtype_to_text function. It had some memory problems when + dealing with some complicated data types. HDFFVI-7701 (SLU - 2011/10/19) + - Fixed a bug in H5DSattach_scale, H5DSis_attached and H5DSdetach_scale caused by using H5Tget_native_type function to determine the native type for reading REFERENCE_LIST attribute. The bug was exposed @@ -665,27 +882,31 @@ Bug Fixes since HDF5-1.8.0 release - Documentation ------------- F90 APIs -------- - + - Modified the h5open_f and h5close_f subroutines to not to call H5open + and H5close correspodningly. While the H5open call just adds overhead, + the H5close call called by an Fortran application shuts down the HDF5 + library making it unaccessible to the application. + HDFFV-915 (EIP & SB - 2011/10/13) + C++ APIs -------- - - The constructor PropList::PropList(id) was fixed to act properly - according to the nature of 'id'. When 'id' is a property class id, - a new property list will be created. When 'id' id a property list id, - a copy of the property list will be made. (BMR - 2010/5/9) - - The parameters 'size' and 'bufsize' in CommonFG::getLinkval and - CommonFG::getComment, respectively, now have default values for - user's convenience. (BMR - 2009/10/23) - - NULL pointer accessing was fixed, bugzilla 1061. (BMR - 2009/10/05) - - read/write methods of DataSet and Attribute classes were fixed - to handle string correctly. (BMR - 2009/07/26) + - The constructor PropList::PropList(id) was fixed to act properly + according to the nature of 'id'. When 'id' is a property class id, + a new property list will be created. When 'id' id a property list id, + a copy of the property list will be made. (BMR - 2010/5/9) + - The parameters 'size' and 'bufsize' in CommonFG::getLinkval and + CommonFG::getComment, respectively, now have default values for + user's convenience. (BMR - 2009/10/23) + - NULL pointer accessing was fixed, bugzilla 1061. (BMR - 2009/10/05) + - read/write methods of DataSet and Attribute classes were fixed + to handle string correctly. (BMR - 2009/07/26) - Fixed bug that caused segfaults in Attribute::read. (BMR - 2008/04/20) - Fixed bug in PropList::getClassName to use portable HDfree instead of free. (BMR - 2008/04/20) @@ -706,53 +927,67 @@ Bug Fixes since HDF5-1.8.0 release Platforms Tested ================ - AIX 6.1 xlc 11.1.0.3 - (NCSA BP) xlC 11.1.0.3 - xlf 13.1.0.3 - mpcc_r 11.1.0.3 - mpxlf_r 13.1.0.3 - - FreeBSD 6.2-STABLE i386 gcc 3.4.6 [FreeBSD] 20060305 - (duty) g++ 3.4.6 [FreeBSD] 20060305 - gcc 4.2.1 20080123 - g++ 4.2.1 20080123 - gfortran 4.2.1 20070620 - FreeBSD 6.2-STABLE amd64 gcc 3.4.6 [FreeBSD] 20060305 - (liberty) g++ 3.4.6 [FreeBSD] 20060305 - gcc 4.2.1 20080123 - g++ 4.2.1 20080123 - gfortran 4.2.1 20080123 - - Linux 2.6.9 (RHEL4) Intel 10.0 compilers - (abe.ncsa.uiuc.edu) - Linux 2.4.21-47 gcc 3.2.3 20030502 - (osage) - Linux 2.6.9-42.0.10 gcc 3.4.6 20060404 - (kagiso) PGI 7.0-7 (pgcc, pgf90, pgCC) - Intel 9.1 (icc, ifort, icpc) - Linux 2.6.16.27 x86_64 AMD gcc 4.1.0 (SuSE Linux), g++ 4.1.0, g95 (GCC 4.0.3) - (smirom) PGI 6.2-5 (pgcc, pgf90, pgCC) - Intel 9.1 (icc, iort, icpc) - Linux 2.6.5-7.252.1-rtgfx #1 - SMP ia64 Intel(R) C++ Version 9.0 - (cobalt) Intel(R) Fortran Itanium(R) Version 9.0 - SGI MPI - SunOS 5.10 Sun C 5.9 SunOS_sparc - Patch 124867-11 2009/04/30 - (linew) Sun Fortran 95 8.3 SunOS_sparc - Patch 127000-11 2009/10/06 - Sun C++ 5.9 SunOS_sparc - Patch 124863-16 2009/09/15 - IA-64 Linux 2.4.21.SuSE_292.til1 ia64 - (NCSA tg-login) gcc 3.2.2 - Intel(R) C++ Version 8.1 - Intel(R) Fortran Compiler Version 8.1 - mpich-gm-1.2.5..10-intel-r2 - + AIX 5.3 xlc 10.1.0.5 + (NASA G-ADA) xlC 10.1.0.5 + xlf90 12.1.0.6 + + FreeBSD 8.2-STABLE i386 gcc 4.2.1 [FreeBSD] 20070719 + (loyalty) g++ 4.2.1 [FreeBSD] 20070719 + gcc 4.6.1 20110422 + g++ 4.6.1 20110422 + gfortran 4.6.1 20110422 + + FreeBSD 8.2-STABLE amd64 gcc 4.2.1 [FreeBSD] 20070719 + (freedom) g++ 4.2.1 [FreeBSD] 20070719 + gcc 4.6.1 20110422 + g++ 4.6.1 20110422 + gfortran 4.6.1 20110422 + + Linux 2.6.18-194.3.1.el5PAE gcc (GCC) 4.1.2 and 4.4.2 + #1 SMP i686 i686 i386 GNU Fortran (GCC) 4.1.2 20080704 + (jam) (Red Hat 4.1.2-48) and 4.4.2 + PGI C, Fortran, C++ 10.4-0 32-bit + PGI C, Fortran, C++ 10.6-0 32-bit + Intel(R) C Compiler for 32-bit + applications, Version 11.1 + Intel(R) C++ Compiler for 32-bit + applications, Version 11.1 + Intel(R) Fortran Compiler for 32-bit + applications, Version 11.1 + MPICH mpich2-1.3.1 compiled with + gcc 4.1.2 and gfortran 4.1.2 + + Linux 2.6.18-238.12.1.el5 gcc 4.1.2 and 4.4.2 + #1 SMP x86_64 GNU/Linux GNU Fortran (GCC) 4.1.2 20080704 + (koala) (Red Hat 4.1.2-46) and 4.4.2 + tested for both 32- and 64-bit binaries + Intel(R) C, C++, Fortran Compilers for + applications running on Intel(R) 64, + Version 11.1. + PGI C, Fortran, C++ Version 9.0-4 + for 64-bit target on x86-64 + MPICH mpich2-1.3.1 compiled with + gcc 4.1.2 and gfortran 4.1.2 + + SGI ProPack 7 Linux Intel(R) C++ Version 11.1 20100806 + 2.6.32.19-0.3.1.1982.0.PTF- Intel(R) Fortran Version 11.1 20100806 + default #1 SMP SGI MPT 2.01 + SGI Altix UV + (NCSA ember) + + SunOS 5.10 32- and 64-bit Sun C 5.9 Sun OS_sparc Patch 124867-16 + (linew) Sun Fortran 95 8.3 Sun OS_sparc Patch +127000-13 + Sun C++ 5.9 Sun OS_sparc Patch 124863-62 + Sun C 5.10 SunOS_sparc Patch 141861-07 + Sun Fortran 95 8.4 SunOS_sparc Patch +128231-06 + Sun C++ 5.10 SunOS_sparc 128228-11 + Windows XP Visual Studio 2008 w/ Intel Fortran 11.1 Visual Studio 2010 Cygwin(1.7.7 native gcc(4.3.4) compiler and gfortran) - + Windows XP x64 Visual Studio 2008 w/ Intel Fortran 11.1 Visual Studio 2010 Cygwin(1.7.7 native gcc(4.3.4) compiler and gfortran) @@ -786,14 +1021,12 @@ Platform C F90 F90 C++ zlib SZIP parallel parallel SunOS5.10 64-bit n y n y y y SunOS5.10 32-bit n y n y y y -AIX 6.1 32- and 64-bit n y n y y y Windows XP n y(3) n(3) y y y Windows XP x64 n y(3) n(3) y y y Windows Vista n y(3) n(3) y y y Windows Vista x64 n y(3) n(3) y y y Mac OS X 10.5 Intel n y n y y y -FreeBSD 6.2 32-bit n n n y y y -FreeBSD 6.2 64-bit +FreeBSD 8.2 32- and 64-bit n x n x y y RedHat EL4 2.6.9 i686 GNU W y(2) y(4) y(2) y y y RedHat EL4 2.6.9 i686 Intel W n y n y y n RedHat EL4 2.6.9 i686 PGI W n y n y y n @@ -814,14 +1047,12 @@ Platform Shared Shared Shared static- Thread- C libs F90 libs C++ libs exec safe SunOS 5.10 32-bit y y y x y SunOS 5.10 64-bit y y y x y -AIX 6.1 32- and 64-bit n n n x y Windows XP y y(3) y y n Windows XP x64 y y(3) y y n Windows Vista y y(3) y y y Windows Vista x64 y y(3) y y y Mac OS X 10.5 Intel y y y x n -FreeBSD 6.2 32-bit y y y x n -FreeBSD 6.2 64-bit y y y x n +FreeBSD 8.2 32- and 64-bit y x x y y RHEL4 2.6.9 i686 GNU W y y(4) y x y RHEL4 2.6.9 i686 Intel W y y y x n RHEL4 2.6.9 i686 PGI W y y y x n @@ -847,6 +1078,18 @@ SuSe Linux 2.6.5 Known Problems ============== +* The data conversion test dt_arith.c fails in "long double" to integer + conversion on Ubuntu 11.10 (3.0.0.13 kernal) with GCC 4.6.1 if the library + is built with optimization -O3 or -O2. The older GCC (4.5) or newer kernal + (3.2.2 on Fedora) doesn't have the problem. Users should lower down the + optimization level (-O1 or -O0) by defining CFLAGS in the command line of + "configure" like: + + CFLAGS=-O1 ./configure + + It will overwrite the library's default optimization level. (Issue 7829. + SLU - 2012/2/7) + * --with-mpe configure option does not work with Mpich2. AKC - 2011/03/10) * While working on the 1.8.6 release of HDF5, a bug was discovered that can @@ -865,13 +1108,6 @@ Known Problems it treats "exit(134) the same as if process 0 had received an abort signal. This is fixed and will be available in the next release. AKC - 2009/11/3 -* Some tests in tools/h5repack may fail in AIX systems when -q32 mode is used. - The error is due to insufficient memory requested. Request a large amount - of runtime memory by setting the following environment variable for more - memory. - LDR_CNTRL=MAXDATA=0x20000000@DSA - AKC - 2009/10/31 - * The PathScale MPI implementation, accessing a Panasas file system, would cause H5Fcreate() with H5F_ACC_EXCL to fail even when the file is not existing. This is due to the MPI_File_open() call failing if the amode has @@ -1019,13 +1255,13 @@ Known Problems ($* > $STDOUT_FILE) >& $STDERR_FILE - set RETURN_VALUE=$status + set RETURN_VALUE=$status cat $STDOUT_FILE tail +3 $STDERR_FILE - exit $RETURN_VALUE + exit $RETURN_VALUE You get the HDF make files and test scipts to execute your filter script by setting the environment variable "RUNSERIAL" to the full path of the diff --git a/release_docs/USING_Windows.txt b/release_docs/USING_Windows.txt index 4e78c68..410a759 100644 --- a/release_docs/USING_Windows.txt +++ b/release_docs/USING_Windows.txt @@ -87,7 +87,7 @@ Preconditions: Variables" box. In the New Variable window, set "Variable name" as HDF5_EXT_ZLIB and - "Variable value" as zlib1.lib, then click OK. + "Variable value" as zlib.lib, then click OK. Similarly, you can set: @@ -98,7 +98,7 @@ Preconditions: a. You will have to close and reopen running programs for the new environment variable settings to take effect. - b. c:\zlib\zlib1.dll and c:\szip\dll\szip.dll should be copied + b. c:\zlib\zlib.dll and c:\szip\dll\szip.dll should be copied into a location that the application can find. 9. Set up path for libraries and headers @@ -123,6 +123,16 @@ Preconditions: 9.4 If building Fortran applications, you will also need to setup the path for the Intel Fortran compiler. Please see Section VI. + + NOTE: + If you are using VS2010, the path settings will need to be in project + property sheets per project. Go to "Project" and select "Properties", find + "Configuration Properties", and then "VC++ Directories". + + 9.1 If you are building on 64-bit Windows, find the "Platform" dropdown + and select "x64". + 9.2 Add the header path to the "Include Directories" setting. + 9.3 Add the library path to the "Library Directories" setting. Notes: @@ -595,7 +605,7 @@ Building with Visual Studio 2010 is very similar to building with Visual Studio with the following considerations: 1. Visual Studio 2010 uses a new format for project files, but Visual Studio - 2008 project files can be easily converted. The HDF5 project files + 2008 project files can be converted. The HDF5 project files will need to be converted on first use. To do so: 1.1. Open the HDF5 Visual Studio 2008 solution file as in Section II @@ -610,7 +620,8 @@ with the following considerations: 1.3. When it is finished, it should state that all projects were converted successfully with no errors. Warnings can be ignored. - 2. Once the project files have been converted, build and test normally. + 2. Once the project files have been converted you will need to create project + property sheets for the library and include paths. Then build and test normally. Note that the converted project files aren't backwards compatible with previous versions of Visual Studio. diff --git a/release_docs/Using_CMake.txt b/release_docs/Using_CMake.txt new file mode 100644 index 0000000..4819815 --- /dev/null +++ b/release_docs/Using_CMake.txt @@ -0,0 +1,181 @@ +************************************************************************ +* Build and Install HDF5 Examples with CMake * +************************************************************************ + +Notes: This short instruction is written for users who want to quickly build + HDF5 Examples from the HDF5 source code package using the CMake tools. + + More information about using CMake can be found at the KitWare site, + www.cmake.org. + + CMake uses the command line, however the visual CMake tool is + recommended for the configuration step. The steps are similiar for + all the operating systems supported by CMake. + + NOTES: + 1. Using CMake for building and using HDF5 is under active development. + While we have attempted to provide error-free files, please + understand that development with CMake has not been extensively + tested outside of HDF. The CMake specific files may change + before the next release. + + 2. CMake was originally introduced to support development on Windows, + however it should be usable on any system where CMake is supported. + Please send us any comments on how CMake support can be improved on + any system. Visit the KitWare site for more information about CMake. + + 3. Build and test results can be submitted to our CDash server at: + cdash.hdfgroup.uiuc.edu. + Please read the HDF and CDash document at: + www.hdfgroup.org/CDash/HowToSubmit. + + +======================================================================== + Preconditions +======================================================================== + + 1. We suggest you obtain the latest CMake for windows from the Kitware + web site. The HDF5 1.8.x product requires CMake version 2.8.6. + + 2. You have installed the HDF5 library built with CMake. If you are + using a Windows platform, you can obtain a pre-built Windows binary + from The HDF Group's website at www.hdfgroup.org. + + 3. On Windows with Visual Studio, if you have installed the static HDF5 + library, you will need to add the HDF5\lib folder to the library + search list. See the "Using Static Libraries with Visual Studio" section. + + 4. Set the environment variable HDF5_ROOT to the installed location of HDF5. + On Windows HDF5_ROOT=C:\Program Files\HDF Group\HDF5\hdf5-1.8.7 + +======================================================================== + Building HDF5 Examples with CMake +======================================================================== + + 1. Run CMake + + The CMake executable is named "cmake-gui.exe" on Windows and should be + available in your Start menu. For Linux, UNIX, and Mac users the + executable is named "cmake-gui" and can be found where CMake was + installed. + Specify the source and build directories. It is recommemded that you + choose a build directory different then the source directory + (for example on Windows, if the source is at c:\MyHDFstuff\hdf5, then + use c:\MyHDFstuff\hdf5\build or c:\MyHDFstuff\build\hdf5). + + OPTIONAL: + Users can perform the configuration step without using the visual cmake-gui + program. Example configuration step executed within the build directory: + + cmake -G "" [-D] + + Where is + * Borland Makefiles + * MSYS Makefiles + * MinGW Makefiles + * NMake Makefiles + * Unix Makefiles + * Visual Studio 10 + * Visual Studio 10 Win64 + * Visual Studio 6 + * Visual Studio 7 + * Visual Studio 7 .NET 2003 + * Visual Studio 8 2005 + * Visual Studio 8 2005 Win64 + * Visual Studio 9 2008 + * Visual Studio 9 2008 Win64 + + is: + * BUILD_TESTING:BOOL=ON + * USE_SHARED_LIBS:BOOL=[ON | OFF] + + 2. Configure the cache settings + + 2.1 Click the Configure button. If this is the first time you are + running cmake-gui in this directory, you will be prompted for the + generator you wish to use (for example on Windows, Visual Studio 9 2008). + CMake will read in the CMakeLists.txt files from the source directory and + display options for the HDF5 project. After the first configure you + can adjust the cache settings and/or specify locations of other programs. + + Any conflicts or new values will be highlighted by the configure + process in red. Once you are happy with all the settings and there are no + more values in red, click the Generate button to produce the appropriate + build files. + + On Windows, if you are using a Visual Studio generator, the solution and + project files will be created in the build folder. + + On linux, if you are using the Unix Makefiles generator, the Makefiles will + be created in the build folder. + + 2.2 Alternative command line example on Windows in c:\MyHDFstuff\hdf5\build directory: + + cmake -G "Visual Studio 9 2008" -DBUILD_TESTING:BOOL=ON -DUSE_SHARED_LIBS:BOOL=ON .. + + 3. Build HDF5 examples + + On Windows, you can build HDF5 using either the Visual Studio Environment + or the command line. The command line is used on linux, Unix, and Mac. + + To build from the command line, navigate to your build directory and + execute the following; + + cmake --build . --config {Debug | Release} + + NOTE: "--config {Debug | Release}" may be optional on your platform. We + recommend choosing either Debug or Release on Windows. If you are + using the pre-built binaries from HDF, use Release. + + 3.1 If you wish to use the Visual Studio environment, open the solution + file in your build directory. Be sure to select either Debug or + Release and build the solution. + + 4. Test HDF5 Examples. + + To test the build, navigate to your build directory and execute; + + ctest . -C {Debug | Release} + + NOTE: "-C {Debug | Release}" may be optional on your platform. We + recommend choosing either Debug or Release to match the build + step on Windows. + + 6. The files that support building with CMake are all the files in the + config/cmake folder, the CMakeLists.txt files in each source folder, and + CTestConfig.cmake. CTestConfig.cmake is specific to the internal testing + performed by The HDF Group. It should be altered for the users + installation and needs. + + 7. More information about using CMake can be found at the KitWare site, + www.cmake.org. + + +======================================================================== + Using HDF5 Libraries with Visual Studio 2008 +======================================================================== + + 8. Set up path for external libraries and headers + + Invoke Microsoft Visual Studio and go to "Tools" and select "Options", + find "Projects", and then "VC++ Directories". + + 8.1 If you are building on 64-bit Windows, find the "Platform" dropdown + and select "x64". + + 8.2 Find the box "Show directories for", choose "Include files", add the + header path (i.e. c:\Program Files\HDF Group\HDF5\hdf5-1.8.7\include) + to the included directories. + + 8.3 Find the box "Show directories for", choose "Library files", add the + library path (i.e. c:\Program Files\HDF Group\HDF5\hdf5-1.8.7\lib) + to the library directories. + + 8.4 If using Fortran libraries, you will also need to setup the path + for the Intel Fortran compiler. + + +************************************************************************ + +Need further assistance, send email to help@hdfgroup.org + diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9279481..ab07ff4 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8) +cmake_minimum_required (VERSION 2.8.6) PROJECT (HDF5_SRC C CXX) #----------------------------------------------------------------------------- @@ -12,7 +12,6 @@ SET (H5_SRCS ${HDF5_SRC_DIR}/H5timer.c ${HDF5_SRC_DIR}/H5trace.c ) - SET (H5_HDRS ${HDF5_SRC_DIR}/hdf5.h ${HDF5_SRC_DIR}/H5api_adpt.h @@ -22,6 +21,7 @@ SET (H5_HDRS ) IDE_GENERATED_PROPERTIES ("H5" "${H5_HDRS}" "${H5_SRCS}" ) + SET (H5A_SRCS ${HDF5_SRC_DIR}/H5A.c ${HDF5_SRC_DIR}/H5Abtree2.c @@ -30,25 +30,36 @@ SET (H5A_SRCS ${HDF5_SRC_DIR}/H5Aint.c ${HDF5_SRC_DIR}/H5Atest.c ) - SET (H5A_HDRS ${HDF5_SRC_DIR}/H5Apkg.h ${HDF5_SRC_DIR}/H5Apublic.h ) IDE_GENERATED_PROPERTIES ("H5A" "${H5A_HDRS}" "${H5A_SRCS}" ) + SET (H5AC_SRCS ${HDF5_SRC_DIR}/H5AC.c ) - SET (H5AC_HDRS ${HDF5_SRC_DIR}/H5ACpkg.h ${HDF5_SRC_DIR}/H5ACpublic.h ) IDE_GENERATED_PROPERTIES ("H5AC" "${H5AC_HDRS}" "${H5AC_SRCS}" ) + SET (H5B_SRCS ${HDF5_SRC_DIR}/H5B.c + ${HDF5_SRC_DIR}/H5Bcache.c + ${HDF5_SRC_DIR}/H5Bdbg.c +) +SET (H5B_HDRS + ${HDF5_SRC_DIR}/H5Bpkg.h + ${HDF5_SRC_DIR}/H5Bpublic.h +) +IDE_GENERATED_PROPERTIES ("H5B" "${H5B_HDRS}" "${H5B_SRCS}" ) + + +SET (H5B2_SRCS ${HDF5_SRC_DIR}/H5B2.c ${HDF5_SRC_DIR}/H5B2cache.c ${HDF5_SRC_DIR}/H5B2dbg.c @@ -56,29 +67,32 @@ SET (H5B_SRCS ${HDF5_SRC_DIR}/H5B2int.c ${HDF5_SRC_DIR}/H5B2stat.c ${HDF5_SRC_DIR}/H5B2test.c - ${HDF5_SRC_DIR}/H5Bcache.c - ${HDF5_SRC_DIR}/H5Bdbg.c ) - -SET (H5B_HDRS +SET (H5B2_HDRS ${HDF5_SRC_DIR}/H5B2pkg.h ${HDF5_SRC_DIR}/H5B2public.h - ${HDF5_SRC_DIR}/H5Bpkg.h - ${HDF5_SRC_DIR}/H5Bpublic.h ) -IDE_GENERATED_PROPERTIES ("H5B" "${H5B_HDRS}" "${H5B_SRCS}" ) +IDE_GENERATED_PROPERTIES ("H5B2" "${H5B2_HDRS}" "${H5B2_SRCS}" ) + SET (H5C_SRCS ${HDF5_SRC_DIR}/H5C.c - ${HDF5_SRC_DIR}/H5CS.c ) - SET (H5C_HDRS ${HDF5_SRC_DIR}/H5Cpkg.h ${HDF5_SRC_DIR}/H5Cpublic.h ) IDE_GENERATED_PROPERTIES ("H5C" "${H5C_HDRS}" "${H5C_SRCS}" ) + +SET (H5CS_SRCS + ${HDF5_SRC_DIR}/H5CS.c +) +SET (H5CS_HDRS +) +IDE_GENERATED_PROPERTIES ("H5CS" "${H5CS_HDRS}" "${H5CS_SRCS}" ) + + SET (H5D_SRCS ${HDF5_SRC_DIR}/H5D.c ${HDF5_SRC_DIR}/H5Dbtree2.c @@ -102,19 +116,18 @@ SET (H5D_SRCS ${HDF5_SRC_DIR}/H5Dselect.c ${HDF5_SRC_DIR}/H5Dtest.c ) - SET (H5D_HDRS ${HDF5_SRC_DIR}/H5Dpkg.h ${HDF5_SRC_DIR}/H5Dpublic.h ) IDE_GENERATED_PROPERTIES ("H5D" "${H5D_HDRS}" "${H5D_SRCS}" ) + SET (H5E_SRCS ${HDF5_SRC_DIR}/H5E.c ${HDF5_SRC_DIR}/H5Edeprec.c ${HDF5_SRC_DIR}/H5Eint.c ) - SET (H5E_HDRS ${HDF5_SRC_DIR}/H5Edefin.h ${HDF5_SRC_DIR}/H5Einit.h @@ -125,6 +138,7 @@ SET (H5E_HDRS ) IDE_GENERATED_PROPERTIES ("H5E" "${H5E_HDRS}" "${H5E_SRCS}" ) + SET (H5EA_SRCS ${HDF5_SRC_DIR}/H5EA.c ${HDF5_SRC_DIR}/H5EAcache.c @@ -138,15 +152,16 @@ SET (H5EA_SRCS ${HDF5_SRC_DIR}/H5EAstat.c ${HDF5_SRC_DIR}/H5EAtest.c ) - SET (H5EA_HDRS ${HDF5_SRC_DIR}/H5EApkg.h ) IDE_GENERATED_PROPERTIES ("H5EA" "${H5EA_HDRS}" "${H5EA_SRCS}" ) + SET (H5F_SRCS ${HDF5_SRC_DIR}/H5F.c ${HDF5_SRC_DIR}/H5Faccum.c + ${HDF5_SRC_DIR}/H5Fcwfs.c ${HDF5_SRC_DIR}/H5Fdbg.c ${HDF5_SRC_DIR}/H5Fdeprec.c ${HDF5_SRC_DIR}/H5Fefc.c @@ -160,13 +175,13 @@ SET (H5F_SRCS ${HDF5_SRC_DIR}/H5Fsuper_cache.c ${HDF5_SRC_DIR}/H5Ftest.c ) - SET (H5F_HDRS ${HDF5_SRC_DIR}/H5Fpkg.h ${HDF5_SRC_DIR}/H5Fpublic.h ) IDE_GENERATED_PROPERTIES ("H5F" "${H5F_HDRS}" "${H5F_SRCS}" ) + SET (H5FA_SRCS ${HDF5_SRC_DIR}/H5FA.c ${HDF5_SRC_DIR}/H5FAcache.c @@ -177,12 +192,12 @@ SET (H5FA_SRCS ${HDF5_SRC_DIR}/H5FAstat.c ${HDF5_SRC_DIR}/H5FAtest.c ) - SET (H5FA_HDRS ${HDF5_SRC_DIR}/H5FApkg.h ) IDE_GENERATED_PROPERTIES ("H5FA" "${H5FA_HDRS}" "${H5FA_SRCS}" ) + SET (H5FD_SRCS ${HDF5_SRC_DIR}/H5FD.c ${HDF5_SRC_DIR}/H5FDcore.c @@ -197,8 +212,8 @@ SET (H5FD_SRCS ${HDF5_SRC_DIR}/H5FDsec2.c ${HDF5_SRC_DIR}/H5FDspace.c ${HDF5_SRC_DIR}/H5FDstdio.c + ${HDF5_SRC_DIR}/H5FDwindows.c ) - SET (H5FD_HDRS ${HDF5_SRC_DIR}/H5FDcore.h ${HDF5_SRC_DIR}/H5FDdirect.h @@ -212,9 +227,27 @@ SET (H5FD_HDRS ${HDF5_SRC_DIR}/H5FDpublic.h ${HDF5_SRC_DIR}/H5FDsec2.h ${HDF5_SRC_DIR}/H5FDstdio.h + ${HDF5_SRC_DIR}/H5FDwindows.h ) IDE_GENERATED_PROPERTIES ("H5FD" "${H5FD_HDRS}" "${H5FD_SRCS}" ) + +SET (H5FL_SRCS + ${HDF5_SRC_DIR}/H5FL.c +) +SET (H5FL_HDRS +) +IDE_GENERATED_PROPERTIES ("H5FL" "${H5FL_HDRS}" "${H5FL_SRCS}" ) + + +SET (H5FO_SRCS + ${HDF5_SRC_DIR}/H5FO.c +) +SET (H5FO_HDRS +) +IDE_GENERATED_PROPERTIES ("H5FO" "${H5FO_HDRS}" "${H5FO_SRCS}" ) + + SET (H5FS_SRCS ${HDF5_SRC_DIR}/H5FS.c ${HDF5_SRC_DIR}/H5FScache.c @@ -223,13 +256,13 @@ SET (H5FS_SRCS ${HDF5_SRC_DIR}/H5FSstat.c ${HDF5_SRC_DIR}/H5FStest.c ) - SET (H5FS_HDRS ${HDF5_SRC_DIR}/H5FSpkg.h ${HDF5_SRC_DIR}/H5FSpublic.h ) IDE_GENERATED_PROPERTIES ("H5FS" "${H5FS_HDRS}" "${H5FS_SRCS}" ) + SET (H5G_SRCS ${HDF5_SRC_DIR}/H5G.c ${HDF5_SRC_DIR}/H5Gbtree2.c @@ -250,13 +283,13 @@ SET (H5G_SRCS ${HDF5_SRC_DIR}/H5Gtest.c ${HDF5_SRC_DIR}/H5Gtraverse.c ) - SET (H5G_HDRS ${HDF5_SRC_DIR}/H5Gpkg.h ${HDF5_SRC_DIR}/H5Gpublic.h ) IDE_GENERATED_PROPERTIES ("H5G" "${H5G_HDRS}" "${H5G_SRCS}" ) + SET (H5HF_SRCS ${HDF5_SRC_DIR}/H5HF.c ${HDF5_SRC_DIR}/H5HFbtree2.c @@ -275,59 +308,99 @@ SET (H5HF_SRCS ${HDF5_SRC_DIR}/H5HFtest.c ${HDF5_SRC_DIR}/H5HFtiny.c ) - SET (H5HF_HDRS ${HDF5_SRC_DIR}/H5HFpkg.h ${HDF5_SRC_DIR}/H5HFpublic.h ) IDE_GENERATED_PROPERTIES ("H5HF" "${H5HF_HDRS}" "${H5HF_SRCS}" ) + SET (H5HG_SRCS ${HDF5_SRC_DIR}/H5HG.c ${HDF5_SRC_DIR}/H5HGcache.c ${HDF5_SRC_DIR}/H5HGdbg.c + ${HDF5_SRC_DIR}/H5HGquery.c ) - SET (H5HG_HDRS ${HDF5_SRC_DIR}/H5HGpkg.h ${HDF5_SRC_DIR}/H5HGpublic.h ) IDE_GENERATED_PROPERTIES ("H5HG" "${H5HG_HDRS}" "${H5HG_SRCS}" ) + SET (H5HL_SRCS ${HDF5_SRC_DIR}/H5HL.c ${HDF5_SRC_DIR}/H5HLcache.c ${HDF5_SRC_DIR}/H5HLdbg.c ${HDF5_SRC_DIR}/H5HLint.c ) - SET (H5HL_HDRS ${HDF5_SRC_DIR}/H5HLpkg.h ${HDF5_SRC_DIR}/H5HLpublic.h ) IDE_GENERATED_PROPERTIES ("H5HL" "${H5HL_HDRS}" "${H5HL_SRCS}" ) + +SET (H5HP_SRCS + ${HDF5_SRC_DIR}/H5HP.c +) +SET (H5HP_HDRS +) +IDE_GENERATED_PROPERTIES ("H5HP" "${H5HP_HDRS}" "${H5HP_SRCS}" ) + + +SET (H5I_SRCS + ${HDF5_SRC_DIR}/H5I.c + ${HDF5_SRC_DIR}/H5Itest.c +) +SET (H5I_HDRS + ${HDF5_SRC_DIR}/H5Ipkg.h + ${HDF5_SRC_DIR}/H5Ipublic.h +) +IDE_GENERATED_PROPERTIES ("H5I" "${H5I_HDRS}" "${H5I_SRCS}" ) + + +SET (H5L_SRCS + ${HDF5_SRC_DIR}/H5L.c + ${HDF5_SRC_DIR}/H5Lexternal.c +) +SET (H5L_HDRS + ${HDF5_SRC_DIR}/H5Lpkg.h + ${HDF5_SRC_DIR}/H5Lpublic.h +) +IDE_GENERATED_PROPERTIES ("H5L" "${H5L_HDRS}" "${H5L_SRCS}" ) + + SET (H5MF_SRCS ${HDF5_SRC_DIR}/H5MF.c ${HDF5_SRC_DIR}/H5MFaggr.c ${HDF5_SRC_DIR}/H5MFdbg.c ${HDF5_SRC_DIR}/H5MFsection.c ) - SET (H5MF_HDRS ) IDE_GENERATED_PROPERTIES ("H5MF" "${H5MF_HDRS}" "${H5MF_SRCS}" ) + +SET (H5MM_SRCS + ${HDF5_SRC_DIR}/H5MM.c +) +SET (H5MM_HDRS + ${HDF5_SRC_DIR}/H5MMpublic.h +) +IDE_GENERATED_PROPERTIES ("H5MM" "${H5MM_HDRS}" "${H5MM_SRCS}" ) + + SET (H5MP_SRCS ${HDF5_SRC_DIR}/H5MP.c ${HDF5_SRC_DIR}/H5MPtest.c ) - SET (H5MP_HDRS ${HDF5_SRC_DIR}/H5MPpkg.h ) IDE_GENERATED_PROPERTIES ("H5MP" "${H5MP_HDRS}" "${H5MP_SRCS}" ) + SET (H5O_SRCS ${HDF5_SRC_DIR}/H5O.c ${HDF5_SRC_DIR}/H5Oainfo.c @@ -364,7 +437,6 @@ SET (H5O_SRCS ${HDF5_SRC_DIR}/H5Otest.c ${HDF5_SRC_DIR}/H5Ounknown.c ) - SET (H5O_HDRS ${HDF5_SRC_DIR}/H5Opkg.h ${HDF5_SRC_DIR}/H5Opublic.h @@ -372,6 +444,7 @@ SET (H5O_HDRS ) IDE_GENERATED_PROPERTIES ("H5O" "${H5O_HDRS}" "${H5O_SRCS}" ) + SET (H5P_SRCS ${HDF5_SRC_DIR}/H5P.c ${HDF5_SRC_DIR}/H5Pacpl.c @@ -391,13 +464,40 @@ SET (H5P_SRCS ${HDF5_SRC_DIR}/H5Pstrcpl.c ${HDF5_SRC_DIR}/H5Ptest.c ) - SET (H5P_HDRS ${HDF5_SRC_DIR}/H5Ppkg.h ${HDF5_SRC_DIR}/H5Ppublic.h ) IDE_GENERATED_PROPERTIES ("H5P" "${H5P_HDRS}" "${H5P_SRCS}" ) + +SET (H5R_SRCS + ${HDF5_SRC_DIR}/H5R.c + ${HDF5_SRC_DIR}/H5Rdeprec.c +) +SET (H5R_HDRS + ${HDF5_SRC_DIR}/H5Rpkg.h + ${HDF5_SRC_DIR}/H5Rpublic.h +) +IDE_GENERATED_PROPERTIES ("H5R" "${H5R_HDRS}" "${H5R_SRCS}" ) + + +SET (H5RC_SRCS + ${HDF5_SRC_DIR}/H5RC.c +) +SET (H5RC_HDRS +) +IDE_GENERATED_PROPERTIES ("H5RC" "${H5RC_HDRS}" "${H5RC_SRCS}" ) + + +SET (H5RS_SRCS + ${HDF5_SRC_DIR}/H5RS.c +) +SET (H5RS_HDRS +) +IDE_GENERATED_PROPERTIES ("H5RS" "${H5RS_HDRS}" "${H5RS_SRCS}" ) + + SET (H5S_SRCS ${HDF5_SRC_DIR}/H5S.c ${HDF5_SRC_DIR}/H5Sall.c @@ -409,13 +509,21 @@ SET (H5S_SRCS ${HDF5_SRC_DIR}/H5Sselect.c ${HDF5_SRC_DIR}/H5Stest.c ) - SET (H5S_HDRS ${HDF5_SRC_DIR}/H5Spkg.h ${HDF5_SRC_DIR}/H5Spublic.h ) IDE_GENERATED_PROPERTIES ("H5S" "${H5S_HDRS}" "${H5S_SRCS}" ) + +SET (H5SL_SRCS + ${HDF5_SRC_DIR}/H5SL.c +) +SET (H5SL_HDRS +) +IDE_GENERATED_PROPERTIES ("H5SL" "${H5SL_HDRS}" "${H5SL_SRCS}" ) + + SET (H5SM_SRCS ${HDF5_SRC_DIR}/H5SM.c ${HDF5_SRC_DIR}/H5SMbtree2.c @@ -423,12 +531,20 @@ SET (H5SM_SRCS ${HDF5_SRC_DIR}/H5SMmessage.c ${HDF5_SRC_DIR}/H5SMtest.c ) - SET (H5SM_HDRS ${HDF5_SRC_DIR}/H5SMpkg.h ) IDE_GENERATED_PROPERTIES ("H5SM" "${H5SM_HDRS}" "${H5SM_SRCS}" ) + +SET (H5ST_SRCS + ${HDF5_SRC_DIR}/H5ST.c +) +SET (H5ST_HDRS +) +IDE_GENERATED_PROPERTIES ("H5ST" "${H5ST_HDRS}" "${H5ST_SRCS}" ) + + SET (H5T_SRCS ${HDF5_SRC_DIR}/H5T.c ${HDF5_SRC_DIR}/H5Tarray.c @@ -454,13 +570,37 @@ SET (H5T_SRCS ${HDF5_SRC_DIR}/H5Tvisit.c ${HDF5_SRC_DIR}/H5Tvlen.c ) - SET (H5T_HDRS ${HDF5_SRC_DIR}/H5Tpkg.h ${HDF5_SRC_DIR}/H5Tpublic.h ) IDE_GENERATED_PROPERTIES ("H5T" "${H5T_HDRS}" "${H5T_SRCS}" ) + +SET (H5TS_SRCS + ${HDF5_SRC_DIR}/H5TS.c +) +SET (H5TS_HDRS +) +IDE_GENERATED_PROPERTIES ("H5TS" "${H5TS_HDRS}" "${H5TS_SRCS}" ) + + +SET (H5V_SRCS + ${HDF5_SRC_DIR}/H5V.c +) +SET (H5V_HDRS +) +IDE_GENERATED_PROPERTIES ("H5V" "${H5V_HDRS}" "${H5V_SRCS}" ) + + +SET (H5WB_SRCS + ${HDF5_SRC_DIR}/H5WB.c +) +SET (H5WB_HDRS +) +IDE_GENERATED_PROPERTIES ("H5WB" "${H5WB_HDRS}" "${H5WB_SRCS}" ) + + SET (H5Z_SRCS ${HDF5_SRC_DIR}/H5Z.c ${HDF5_SRC_DIR}/H5Zdeflate.c @@ -475,55 +615,54 @@ IF (H5_ZLIB_HEADER) SET_PROPERTY(SOURCE ${HDF5_SRC_DIR}/H5Zdeflate.c PROPERTY COMPILE_DEFINITIONS H5_ZLIB_HEADER="${H5_ZLIB_HEADER}") ENDIF (H5_ZLIB_HEADER) - SET (H5Z_HDRS ${HDF5_SRC_DIR}/H5Zpkg.h ${HDF5_SRC_DIR}/H5Zpublic.h ) IDE_GENERATED_PROPERTIES ("H5Z" "${H5Z_HDRS}" "${H5Z_SRCS}" ) + SET (common_SRCS ${H5_SRCS} ${H5A_SRCS} ${H5AC_SRCS} ${H5B_SRCS} + ${H5B2_SRCS} ${H5C_SRCS} + ${H5CS_SRCS} ${H5D_SRCS} ${H5E_SRCS} ${H5EA_SRCS} ${H5F_SRCS} ${H5FA_SRCS} ${H5FD_SRCS} + ${H5FL_SRCS} + ${H5FO_SRCS} ${H5FS_SRCS} ${H5G_SRCS} ${H5HF_SRCS} ${H5HG_SRCS} ${H5HL_SRCS} + ${H5HP_SRCS} + ${H5I_SRCS} + ${H5L_SRCS} ${H5MF_SRCS} + ${H5MM_SRCS} ${H5MP_SRCS} ${H5O_SRCS} ${H5P_SRCS} + ${H5R_SRCS} + ${H5RC_SRCS} + ${H5RS_SRCS} ${H5S_SRCS} + ${H5SL_SRCS} ${H5SM_SRCS} + ${H5ST_SRCS} ${H5T_SRCS} + ${H5TS_SRCS} + ${H5V_SRCS} + ${H5WB_SRCS} ${H5Z_SRCS} - ${HDF5_SRC_DIR}/H5FL.c - ${HDF5_SRC_DIR}/H5FO.c - ${HDF5_SRC_DIR}/H5HP.c - ${HDF5_SRC_DIR}/H5I.c - ${HDF5_SRC_DIR}/H5Itest.c - ${HDF5_SRC_DIR}/H5L.c - ${HDF5_SRC_DIR}/H5Lexternal.c - ${HDF5_SRC_DIR}/H5MM.c - ${HDF5_SRC_DIR}/H5R.c - ${HDF5_SRC_DIR}/H5RC.c - ${HDF5_SRC_DIR}/H5Rdeprec.c - ${HDF5_SRC_DIR}/H5RS.c - ${HDF5_SRC_DIR}/H5SL.c - ${HDF5_SRC_DIR}/H5ST.c - ${HDF5_SRC_DIR}/H5TS.c - ${HDF5_SRC_DIR}/H5V.c - ${HDF5_SRC_DIR}/H5WB.c ) SET (H5_PUBLIC_HEADERS @@ -531,6 +670,7 @@ SET (H5_PUBLIC_HEADERS ${H5A_HDRS} ${H5AC_HDRS} ${H5B_HDRS} + ${H5B2_HDRS} ${H5C_HDRS} ${H5D_HDRS} ${H5E_HDRS} @@ -543,30 +683,20 @@ SET (H5_PUBLIC_HEADERS ${H5HF_HDRS} ${H5HG_HDRS} ${H5HL_HDRS} + ${H5I_HDRS} + ${H5L_HDRS} ${H5MF_HDRS} + ${H5MM_HDRS} ${H5MP_HDRS} ${H5O_HDRS} ${H5P_HDRS} + ${H5R_HDRS} ${H5S_HDRS} ${H5SM_HDRS} ${H5T_HDRS} ${H5Z_HDRS} - ${HDF5_SRC_DIR}/H5Ipkg.h - ${HDF5_SRC_DIR}/H5Ipublic.h - ${HDF5_SRC_DIR}/H5Lpkg.h - ${HDF5_SRC_DIR}/H5Lpublic.h - ${HDF5_SRC_DIR}/H5MMpublic.h - ${HDF5_SRC_DIR}/H5Rpkg.h - ${HDF5_SRC_DIR}/H5Rpublic.h ) -# -------------------------------------------------------------------- -# If we are compiling on Windows then add the windows specific files -# -------------------------------------------------------------------- -IF (WIN32 AND NOT CYGWIN) - SET (common_SRCS ${common_SRCS} ${HDF5_SRC_DIR}/H5FDwindows.c) - SET (H5_PUBLIC_HEADERS ${H5_PUBLIC_HEADERS} ${HDF5_SRC_DIR}/H5FDwindows.h) -ENDIF (WIN32 AND NOT CYGWIN) SET (H5_PRIVATE_HEADERS ${HDF5_SRC_DIR}/H5private.h @@ -617,27 +747,15 @@ INCLUDE_DIRECTORIES (${HDF5_SOURCE_DIR}) INCLUDE_DIRECTORIES (${CMAKE_BINARY_DIR}) #----------------------------------------------------------------------------- -# When building utility executables that generate other (source) files : -# we make use of the following variables defined in the root CMakeLists. -# Certain systems may add /Debug or /Release to output paths -# and we need to call the executable from inside the CMake configuration -#----------------------------------------------------------------------------- -#inherit EXE_EXT from parent HDF5 cmake project -#inherit CFG_INIT from parent HDF5 cmake project - -#----------------------------------------------------------------------------- # Setup the H5Detect utility which generates H5Tinit with platform # specific type checks inside #----------------------------------------------------------------------------- -SET (CMD ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}${CFG_INIT}/H5detect${EXE_EXT}) -IF (XCODE) - SET (CMD "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/\${CONFIGURATION}/H5detect") -ENDIF (XCODE) ADD_EXECUTABLE (H5detect ${HDF5_SRC_DIR}/H5detect.c) IF (MSVC) TARGET_LINK_LIBRARIES (H5detect "ws2_32.lib") ENDIF (MSVC) +SET (CMD $) ADD_CUSTOM_COMMAND ( OUTPUT ${HDF5_BINARY_DIR}/H5Tinit.c COMMAND ${CMD} @@ -645,20 +763,18 @@ ADD_CUSTOM_COMMAND ( DEPENDS H5detect ) -SET (CMDL ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}${CFG_INIT}/H5make_libsettings${EXE_EXT}) -IF (XCODE) - SET (CMDL "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/\${CONFIGURATION}/H5make_libsettings") -ENDIF (XCODE) ADD_EXECUTABLE (H5make_libsettings ${HDF5_SRC_DIR}/H5make_libsettings.c) IF (MSVC) TARGET_LINK_LIBRARIES (H5make_libsettings "ws2_32.lib") ENDIF (MSVC) +SET (CMD $) ADD_CUSTOM_COMMAND ( OUTPUT ${HDF5_BINARY_DIR}/H5lib_settings.c - COMMAND ${CMDL} + COMMAND ${CMD} ARGS > ${HDF5_BINARY_DIR}/H5lib_settings.c DEPENDS H5make_libsettings + WORKING_DIRECTORY ${HDF5_BINARY_DIR} ) ADD_CUSTOM_COMMAND ( @@ -697,10 +813,10 @@ SET (common_SRCS ${common_SRCS} ${HDF5_BINARY_DIR}/H5overflow.h) SET_SOURCE_FILES_PROPERTIES (${HDF5_BINARY_DIR}/H5overflow.h GENERATED) ADD_LIBRARY (${HDF5_LIB_TARGET} ${LIB_TYPE} ${common_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS}) -SET_TARGET_PROPERTIES(${HDF5_LIB_TARGET} PROPERTIES DEFINE_SYMBOL ${HDF5_LIB_CORENAME}_EXPORTS) TARGET_LINK_LIBRARIES (${HDF5_LIB_TARGET} ${LINK_LIBS}) SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT ${HDF5_LIB_TARGET}) H5_SET_LIB_OPTIONS (${HDF5_LIB_TARGET} ${HDF5_LIB_NAME} ${LIB_TYPE}) +SET_TARGET_PROPERTIES (${HDF5_LIB_TARGET} PROPERTIES FOLDER libraries) #----------------------------------------------------------------------------- # Add file(s) to CMake Install diff --git a/src/COPYING b/src/COPYING old mode 100755 new mode 100644 diff --git a/src/H5.c b/src/H5.c index 72e0a1b..654c730 100644 --- a/src/H5.c +++ b/src/H5.c @@ -108,7 +108,7 @@ H5_init_library(void) { herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI(H5_init_library, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* * Make sure the package information is updated. */ @@ -364,7 +364,7 @@ H5dont_atexit(void) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API_NOINIT_NOERR_NOFS(H5dont_atexit) + FUNC_ENTER_API_NOINIT_NOERR_NOFS H5TRACE0("e",""); if(H5_dont_atexit_g) @@ -403,7 +403,7 @@ H5garbage_collect(void) { herr_t ret_value = SUCCEED; - FUNC_ENTER_API(H5garbage_collect, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE0("e",""); /* Call the garbage collection routines in the library */ @@ -455,7 +455,7 @@ H5set_free_list_limits(int reg_global_lim, int reg_list_lim, int arr_global_lim, { herr_t ret_value = SUCCEED; - FUNC_ENTER_API(H5set_free_list_limits, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE6("e", "IsIsIsIsIsIs", reg_global_lim, reg_list_lim, arr_global_lim, arr_list_lim, blk_global_lim, blk_list_lim); @@ -598,7 +598,7 @@ H5get_libversion(unsigned *majnum, unsigned *minnum, unsigned *relnum) { herr_t ret_value = SUCCEED; - FUNC_ENTER_API(H5get_libversion, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("e", "*Iu*Iu*Iu", majnum, minnum, relnum); /* Set the version information */ @@ -653,7 +653,7 @@ H5check_version(unsigned majnum, unsigned minnum, unsigned relnum) static const char *version_mismatch_warning = VERSION_MISMATCH_WARNING; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API_NOINIT_NOERR_NOFS(H5check_version) + FUNC_ENTER_API_NOINIT_NOERR_NOFS H5TRACE3("e", "IuIuIu", majnum, minnum, relnum); /* Don't check again, if we already have */ @@ -767,7 +767,7 @@ H5open(void) { herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_API_NOCLEAR(H5open, FAIL) + FUNC_ENTER_API_NOCLEAR(FAIL) H5TRACE0("e",""); /* all work is done by FUNC_ENTER() */ done: @@ -797,7 +797,7 @@ H5close(void) * whole library just to release it all right away. It is safe to call * this function for an uninitialized library. */ - FUNC_ENTER_API_NOINIT_NOERR_NOFS(H5close) + FUNC_ENTER_API_NOINIT_NOERR_NOFS H5TRACE0("e",""); H5_term_library(); diff --git a/src/H5A.c b/src/H5A.c index 892e3bd..cc6a7a5 100644 --- a/src/H5A.c +++ b/src/H5A.c @@ -113,7 +113,7 @@ H5A_init(void) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5A_init, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* FUNC_ENTER() does all the work */ done: @@ -138,7 +138,7 @@ H5A_init_interface(void) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5A_init_interface) + FUNC_ENTER_NOAPI_NOINIT /* * Create attribute ID type. @@ -172,7 +172,7 @@ H5A_term_interface(void) { int n = 0; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5A_term_interface) + FUNC_ENTER_NOAPI_NOINIT if(H5_interface_initialize_g) { if((n = H5I_nmembers(H5I_ATTR))>0) { @@ -225,7 +225,7 @@ H5Acreate2(hid_t loc_id, const char *attr_name, hid_t type_id, hid_t space_id, H5S_t *space; /* Dataspace to use for attribute */ hid_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Acreate2, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE6("i", "i*siiii", loc_id, attr_name, type_id, space_id, acpl_id, aapl_id); /* check arguments */ @@ -296,7 +296,7 @@ H5Acreate_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, H5S_t *space; /* Dataspace to use for attribute */ hid_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Acreate_by_name, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE8("i", "i*s*siiiii", loc_id, obj_name, attr_name, type_id, space_id, acpl_id, aapl_id, lapl_id); @@ -369,7 +369,7 @@ H5A_create(const H5G_loc_t *loc, const char *name, const H5T_t *type, htri_t tri_ret; /* htri_t return value */ hid_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(H5A_create, dxpl_id, loc->oloc->addr, FAIL) + FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, loc->oloc->addr, FAIL) /* check args */ HDassert(loc); @@ -451,9 +451,9 @@ H5A_create(const H5G_loc_t *loc, const char *name, const H5T_t *type, /* Check if any of the pieces should be (or are already) shared in the * SOHM table */ - if(H5SM_try_share(attr->oloc.file, dxpl_id, NULL, H5O_DTYPE_ID, attr->shared->dt, NULL) < 0) + if(H5SM_try_share(attr->oloc.file, dxpl_id, NULL, 0, H5O_DTYPE_ID, attr->shared->dt, NULL) < 0) HGOTO_ERROR(H5E_OHDR, H5E_BADMESG, FAIL, "trying to share datatype failed") - if(H5SM_try_share(attr->oloc.file, dxpl_id, NULL, H5O_SDSPACE_ID, attr->shared->ds, NULL) < 0) + if(H5SM_try_share(attr->oloc.file, dxpl_id, NULL, 0, H5O_SDSPACE_ID, attr->shared->ds, NULL) < 0) HGOTO_ERROR(H5E_OHDR, H5E_BADMESG, FAIL, "trying to share dataspace failed") /* Check whether datatype is committed & increment ref count @@ -534,7 +534,7 @@ H5Aopen(hid_t loc_id, const char *attr_name, hid_t UNUSED aapl_id) H5A_t *attr = NULL; /* Attribute opened */ hid_t ret_value; - FUNC_ENTER_API(H5Aopen, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("i", "i*si", loc_id, attr_name, aapl_id); /* check arguments */ @@ -547,7 +547,7 @@ H5Aopen(hid_t loc_id, const char *attr_name, hid_t UNUSED aapl_id) /* Read in attribute from object header */ if(NULL == (attr = H5O_attr_open_by_name(loc.oloc, attr_name, H5AC_ind_dxpl_id))) - HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "unable to load attribute info from object header") + HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "unable to load attribute info from object header for attribute: '%s'", attr_name) /* Finish initializing attribute */ if(H5A_open_common(&loc, attr) < 0) @@ -596,7 +596,7 @@ H5Aopen_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, H5A_t *attr = NULL; /* Attribute opened */ hid_t ret_value; - FUNC_ENTER_API(H5Aopen_by_name, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE5("i", "i*s*sii", loc_id, obj_name, attr_name, aapl_id, lapl_id); /* check arguments */ @@ -664,7 +664,7 @@ H5Aopen_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5G_loc_t loc; /* Object location */ hid_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Aopen_by_idx, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE7("i", "i*sIiIohii", loc_id, obj_name, idx_type, order, n, aapl_id, lapl_id); @@ -726,7 +726,7 @@ H5A_open_common(const H5G_loc_t *loc, H5A_t *attr) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5A_open_common) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(loc); @@ -783,7 +783,7 @@ H5A_open_by_idx(const H5G_loc_t *loc, const char *obj_name, H5_index_t idx_type, H5A_t *attr = NULL; /* Attribute from object header */ H5A_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5A_open_by_idx) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(loc); @@ -847,7 +847,7 @@ H5A_open_by_name(const H5G_loc_t *loc, const char *obj_name, const char *attr_na H5A_t *attr = NULL; /* Attribute from object header */ H5A_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5A_open_by_name, NULL) + FUNC_ENTER_NOAPI(NULL) /* check args */ HDassert(loc); @@ -912,7 +912,7 @@ H5Awrite(hid_t attr_id, hid_t dtype_id, const void *buf) H5T_t *mem_type; /* Memory datatype */ herr_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Awrite, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("e", "ii*x", attr_id, dtype_id, buf); /* check arguments */ @@ -963,7 +963,7 @@ H5A_write(H5A_t *attr, const H5T_t *mem_type, const void *buf, hid_t dxpl_id) size_t buf_size; /* desired buffer size */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT_TAG(H5A_write, dxpl_id, attr->oloc.addr, FAIL) + FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, attr->oloc.addr, FAIL) HDassert(attr); HDassert(mem_type); @@ -1069,7 +1069,7 @@ H5Aread(hid_t attr_id, hid_t dtype_id, void *buf) H5T_t *mem_type; /* Memory datatype */ herr_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Aread, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("e", "ii*x", attr_id, dtype_id, buf); /* check arguments */ @@ -1119,7 +1119,7 @@ H5A_read(const H5A_t *attr, const H5T_t *mem_type, void *buf, hid_t dxpl_id) size_t buf_size; /* desired buffer size */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT(H5A_read) + FUNC_ENTER_NOAPI_NOINIT HDassert(attr); HDassert(mem_type); @@ -1215,7 +1215,7 @@ H5Aget_space(hid_t attr_id) H5S_t *ds = NULL; /* Copy of dataspace for attribute */ hid_t ret_value; - FUNC_ENTER_API(H5Aget_space, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("i", "i", attr_id); /* check arguments */ @@ -1261,13 +1261,17 @@ H5Aget_type(hid_t attr_id) H5T_t *dt = NULL; /* Copy of attribute's datatype */ hid_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Aget_type, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("i", "i", attr_id); /* check arguments */ if(NULL == (attr = (H5A_t *)H5I_object_verify(attr_id, H5I_ATTR))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an attribute") + /* Patch the datatype's "top level" file pointer */ + if(H5T_patch_file(attr->shared->dt, attr->oloc.file) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "unable to patch datatype's file pointer") + /* * Copy the attribute's datatype. If the type is a named type then * reopen the type before returning it to the user. Make the type @@ -1326,7 +1330,7 @@ H5Aget_create_plist(hid_t attr_id) H5P_genplist_t *new_plist; /* ACPL to return */ hid_t ret_value; - FUNC_ENTER_API(H5Aget_create_plist, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("i", "i", attr_id); HDassert(H5P_LST_ATTRIBUTE_CREATE_g != -1); @@ -1381,7 +1385,7 @@ H5Aget_name(hid_t attr_id, size_t buf_size, char *buf) H5A_t *my_attr; /* Attribute object for ID */ ssize_t ret_value; - FUNC_ENTER_API(H5Aget_name, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("Zs", "iz*s", attr_id, buf_size, buf); /* check arguments */ @@ -1421,7 +1425,7 @@ H5A_get_name(H5A_t *attr, size_t buf_size, char *buf) size_t copy_len, nbytes; ssize_t ret_value; - FUNC_ENTER_NOAPI(H5A_get_name, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* get the real attribute length */ nbytes = HDstrlen(attr->shared->name); @@ -1472,7 +1476,7 @@ H5Aget_name_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5A_t *attr = NULL; /* Attribute object for name */ ssize_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Aget_name_by_idx, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE8("Zs", "i*sIiIohxzi", loc_id, obj_name, idx_type, order, n, name, size, lapl_id); @@ -1539,7 +1543,7 @@ H5Aget_storage_size(hid_t attr_id) H5A_t *attr; /* Attribute object for ID */ hsize_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Aget_storage_size, 0) + FUNC_ENTER_API(0) H5TRACE1("h", "i", attr_id); /* Check args */ @@ -1573,7 +1577,7 @@ H5Aget_info(hid_t attr_id, H5A_info_t *ainfo) H5A_t *attr; /* Attribute object for name */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Aget_info, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*x", attr_id, ainfo); /* Check args */ @@ -1610,7 +1614,7 @@ H5Aget_info_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, H5A_t *attr = NULL; /* Attribute object for name */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Aget_info_by_name, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE5("e", "i*s*s*xi", loc_id, obj_name, attr_name, ainfo, lapl_id); /* Check args */ @@ -1669,7 +1673,7 @@ H5Aget_info_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5A_t *attr = NULL; /* Attribute object for name */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Aget_info_by_idx, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE7("e", "i*sIiIoh*xi", loc_id, obj_name, idx_type, order, n, ainfo, lapl_id); @@ -1727,7 +1731,7 @@ H5A_get_info(const H5A_t *attr, H5A_info_t *ainfo) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5A_get_info, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args */ HDassert(attr); @@ -1769,7 +1773,7 @@ H5Arename(hid_t loc_id, const char *old_name, const char *new_name) H5G_loc_t loc; /* Object location */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Arename, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("e", "i*s*s", loc_id, old_name, new_name); /* check arguments */ @@ -1815,7 +1819,7 @@ H5Arename_by_name(hid_t loc_id, const char *obj_name, const char *old_attr_name, hbool_t loc_found = FALSE; /* Entry at 'obj_name' found */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Arename_by_name, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE5("e", "i*s*s*si", loc_id, obj_name, old_attr_name, new_attr_name, lapl_id); @@ -1912,7 +1916,7 @@ H5Aiterate2(hid_t loc_id, H5_index_t idx_type, H5_iter_order_t order, hsize_t last_attr; /* Index of last attribute examined */ herr_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Aiterate2, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE6("e", "iIiIo*hx*x", loc_id, idx_type, order, idx, op, op_data); /* check arguments */ @@ -2000,7 +2004,7 @@ H5Aiterate_by_name(hid_t loc_id, const char *obj_name, H5_index_t idx_type, hsize_t last_attr; /* Index of last attribute examined */ herr_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Aiterate_by_name, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE8("e", "i*sIiIo*hx*xi", loc_id, obj_name, idx_type, order, idx, op, op_data, lapl_id); @@ -2081,7 +2085,7 @@ H5Adelete(hid_t loc_id, const char *name) H5G_loc_t loc; /* Object location */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Adelete, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*s", loc_id, name); /* check arguments */ @@ -2128,7 +2132,7 @@ H5Adelete_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, hbool_t loc_found = FALSE; /* Entry at 'obj_name' found */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Adelete_by_name, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE4("e", "i*s*si", loc_id, obj_name, attr_name, lapl_id); /* check arguments */ @@ -2204,7 +2208,7 @@ H5Adelete_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, hbool_t loc_found = FALSE; /* Entry at 'obj_name' found */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Adelete_by_idx, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE6("e", "i*sIiIohi", loc_id, obj_name, idx_type, order, n, lapl_id); /* check arguments */ @@ -2267,7 +2271,7 @@ H5Aclose(hid_t attr_id) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Aclose, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", attr_id); /* check arguments */ @@ -2308,7 +2312,7 @@ H5A_copy(H5A_t *_new_attr, const H5A_t *old_attr) hbool_t allocated_attr = FALSE; /* Whether the attribute was allocated */ H5A_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI(H5A_copy, NULL) + FUNC_ENTER_NOAPI(NULL) /* check args */ HDassert(old_attr); @@ -2370,7 +2374,7 @@ H5A_free(H5A_t *attr) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5A_free, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert(attr); @@ -2418,7 +2422,7 @@ H5A_close(H5A_t *attr) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5A_close, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert(attr); HDassert(attr->shared); @@ -2474,7 +2478,7 @@ H5A_oloc(H5A_t *attr) { H5O_loc_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5A_oloc, NULL) + FUNC_ENTER_NOAPI(NULL) HDassert(attr); @@ -2506,7 +2510,7 @@ H5A_nameof(H5A_t *attr) { H5G_name_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5A_nameof, NULL) + FUNC_ENTER_NOAPI(NULL) HDassert(attr); @@ -2538,7 +2542,7 @@ H5Aexists(hid_t obj_id, const char *attr_name) H5G_loc_t loc; /* Object location */ htri_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Aexists, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("t", "i*s", obj_id, attr_name); /* check arguments */ @@ -2582,7 +2586,7 @@ H5Aexists_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, hbool_t loc_found = FALSE; /* Entry at 'obj_name' found */ htri_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Aexists_by_name, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE4("t", "i*s*si", loc_id, obj_name, attr_name, lapl_id); /* check arguments */ diff --git a/src/H5AC.c b/src/H5AC.c index 6d865e4..3f824a2 100644 --- a/src/H5AC.c +++ b/src/H5AC.c @@ -236,7 +236,7 @@ H5AC_init(void) { herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5AC_init, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* FUNC_ENTER() does all the work */ done: @@ -267,7 +267,7 @@ H5AC_init_interface(void) H5FD_mpio_xfer_t xfer_mode; /* I/O transfer mode property value */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5AC_init_interface) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(H5P_CLS_DATASET_XFER_g!=(-1)); @@ -346,7 +346,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) #else /* H5_HAVE_PARALLEL */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5AC_init_interface) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ assert(H5P_LST_DATASET_XFER_g!=(-1)); @@ -380,7 +380,7 @@ H5AC_term_interface(void) { int n = 0; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5AC_term_interface) + FUNC_ENTER_NOAPI_NOINIT if (H5_interface_initialize_g) { #ifdef H5_HAVE_PARALLEL @@ -478,7 +478,7 @@ H5AC_create(const H5F_t *f, #endif /* H5_HAVE_PARALLEL */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5AC_create, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert(f); HDassert(NULL == f->shared->cache); @@ -490,7 +490,7 @@ H5AC_create(const H5F_t *f, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Bad cache configuration") #ifdef H5_HAVE_PARALLEL - if(IS_H5FD_MPI(f)) { + if(H5F_HAS_FEATURE(f, H5FD_FEAT_HAS_MPI)) { MPI_Comm mpi_comm; int mpi_rank; int mpi_size; @@ -541,10 +541,10 @@ H5AC_create(const H5F_t *f, sprintf(prefix, "%d:", mpi_rank); if(mpi_rank == 0) { - if(NULL == (aux_ptr->d_slist_ptr = H5SL_create(H5SL_TYPE_HADDR))) + if(NULL == (aux_ptr->d_slist_ptr = H5SL_create(H5SL_TYPE_HADDR, NULL))) HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, FAIL, "can't create dirtied entry list.") - if(NULL == (aux_ptr->c_slist_ptr = H5SL_create(H5SL_TYPE_HADDR))) + if(NULL == (aux_ptr->c_slist_ptr = H5SL_create(H5SL_TYPE_HADDR, NULL))) HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, FAIL, "can't create cleaned entry list.") } /* end if */ @@ -552,7 +552,7 @@ H5AC_create(const H5F_t *f, * when the distributed strategy is selected as all processes * will use it in the case of a flush. */ - if(NULL == (aux_ptr->candidate_slist_ptr = H5SL_create(H5SL_TYPE_HADDR))) + if(NULL == (aux_ptr->candidate_slist_ptr = H5SL_create(H5SL_TYPE_HADDR, NULL))) HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, FAIL, "can't create candidate entry list.") } /* end if */ @@ -664,7 +664,7 @@ H5AC_dest(H5F_t *f, hid_t dxpl_id) #endif /* H5_HAVE_PARALLEL */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5AC_dest, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ HDassert(f); @@ -743,7 +743,7 @@ H5AC_expunge_entry(H5F_t *f, #endif /* H5AC__TRACE_FILE_ENABLED */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5AC_expunge_entry, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert(f); HDassert(f->shared); @@ -828,7 +828,7 @@ H5AC_flush(H5F_t *f, hid_t dxpl_id) #endif /* H5AC__TRACE_FILE_ENABLED */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5AC_flush, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert(f); HDassert(f->shared); @@ -902,7 +902,7 @@ H5AC_get_entry_status(const H5F_t *f, unsigned status = 0; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5AC_get_entry_status, FAIL) + FUNC_ENTER_NOAPI(FAIL) if((f == NULL) || (!H5F_addr_defined(addr)) || (status_ptr == NULL)) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Bad param(s) on entry.") @@ -958,7 +958,7 @@ H5AC_insert_entry(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t add #endif /* H5AC__TRACE_FILE_ENABLED */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5AC_insert_entry, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert(f); HDassert(f->shared); @@ -970,7 +970,7 @@ H5AC_insert_entry(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t add HDassert(thing); /* Check for invalid access request */ - if(0 == (f->intent & H5F_ACC_RDWR)) + if(0 == (H5F_INTENT(f) & H5F_ACC_RDWR)) HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "no write intent on file") #if H5AC__TRACE_FILE_ENABLED @@ -1062,7 +1062,7 @@ H5AC_mark_entry_dirty(void *thing) #endif /* H5AC__TRACE_FILE_ENABLED */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5AC_mark_entry_dirty, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ HDassert(thing); @@ -1133,7 +1133,7 @@ H5AC_move_entry(H5F_t *f, const H5AC_class_t *type, haddr_t old_addr, haddr_t ne #endif /* H5_HAVE_PARALLEL */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5AC_move_entry, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert(f); HDassert(f->shared->cache); @@ -1211,7 +1211,7 @@ H5AC_pin_protected_entry(void *thing) #endif /* H5AC__TRACE_FILE_ENABLED */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5AC_pin_protected_entry, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ HDassert(thing); @@ -1261,7 +1261,7 @@ H5AC_create_flush_dependency(void * parent_thing, void * child_thing) #endif /* H5AC__TRACE_FILE_ENABLED */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5AC_create_flush_dependency, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ HDassert(parent_thing); @@ -1330,7 +1330,7 @@ H5AC_protect(H5F_t *f, #endif /* H5AC__TRACE_FILE_ENABLED */ void * ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5AC_protect, NULL) + FUNC_ENTER_NOAPI(NULL) /* check args */ HDassert(f); @@ -1342,7 +1342,7 @@ H5AC_protect(H5F_t *f, HDassert(H5F_addr_defined(addr)); /* Check for invalid access request */ - if(0 == (f->intent & H5F_ACC_RDWR) && rw == H5AC_WRITE) + if(0 == (H5F_INTENT(f) & H5F_ACC_RDWR) && rw == H5AC_WRITE) HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, NULL, "no write intent on file") #if H5AC__TRACE_FILE_ENABLED @@ -1450,7 +1450,7 @@ H5AC_resize_entry(void *thing, size_t new_size) #endif /* H5AC__TRACE_FILE_ENABLED */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5AC_resize_entry, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ HDassert(thing); @@ -1517,7 +1517,7 @@ H5AC_unpin_entry(void *thing) #endif /* H5AC__TRACE_FILE_ENABLED */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5AC_unpin_entry, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ HDassert(thing); @@ -1566,7 +1566,7 @@ H5AC_destroy_flush_dependency(void * parent_thing, void * child_thing) #endif /* H5AC__TRACE_FILE_ENABLED */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5AC_destroy_flush_dependency, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ HDassert(parent_thing); @@ -1648,7 +1648,7 @@ H5AC_unprotect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, #endif /* H5AC__TRACE_FILE_ENABLED */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5AC_unprotect, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert(f); HDassert(f->shared); @@ -1754,7 +1754,7 @@ H5AC_set_sync_point_done_callback(H5C_t * cache_ptr, { H5AC_aux_t * aux_ptr; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5AC_set_sync_point_done_callback) + FUNC_ENTER_NOAPI_NOINIT HDassert(cache_ptr && (cache_ptr->magic == H5C__H5C_T_MAGIC)); @@ -1791,7 +1791,7 @@ H5AC_set_write_done_callback(H5C_t * cache_ptr, { H5AC_aux_t * aux_ptr; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5AC_set_write_done_callback) + FUNC_ENTER_NOAPI_NOINIT HDassert(cache_ptr && (cache_ptr->magic == H5C__H5C_T_MAGIC)); @@ -1824,7 +1824,7 @@ H5AC_stats(const H5F_t *f) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5AC_stats, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert(f); HDassert(f->shared); @@ -1856,7 +1856,7 @@ H5AC_dump_cache(const H5F_t *f) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5AC_dump_cache, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert(f); HDassert(f->shared); @@ -1893,7 +1893,7 @@ H5AC_get_cache_auto_resize_config(const H5AC_t * cache_ptr, hbool_t evictions_enabled; H5C_auto_size_ctl_t internal_config; - FUNC_ENTER_NOAPI(H5AC_get_cache_auto_resize_config, FAIL) + FUNC_ENTER_NOAPI(FAIL) if ( ( cache_ptr == NULL ) || @@ -2015,7 +2015,7 @@ H5AC_get_cache_size(H5AC_t * cache_ptr, herr_t result; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5AC_get_cache_size, FAIL) + FUNC_ENTER_NOAPI(FAIL) result = H5C_get_cache_size((H5C_t *)cache_ptr, max_size_ptr, @@ -2053,7 +2053,7 @@ H5AC_get_cache_hit_rate(H5AC_t * cache_ptr, double * hit_rate_ptr) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5AC_get_cache_hit_rate, FAIL) + FUNC_ENTER_NOAPI(FAIL) if(H5C_get_cache_hit_rate((H5C_t *)cache_ptr, hit_rate_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_get_cache_hit_rate() failed.") @@ -2081,7 +2081,7 @@ H5AC_reset_cache_hit_rate_stats(H5AC_t * cache_ptr) herr_t result; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5AC_reset_cache_hit_rate_stats, FAIL) + FUNC_ENTER_NOAPI(FAIL) result = H5C_reset_cache_hit_rate_stats((H5C_t *)cache_ptr); @@ -2122,7 +2122,7 @@ H5AC_set_cache_auto_resize_config(H5AC_t *cache_ptr, FILE * trace_file_ptr = NULL; #endif /* H5AC__TRACE_FILE_ENABLED */ - FUNC_ENTER_NOAPI(H5AC_set_cache_auto_resize_config, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert( cache_ptr ); @@ -2299,7 +2299,7 @@ H5AC_validate_config(H5AC_cache_config_t * config_ptr) H5C_auto_size_ctl_t internal_config; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5AC_validate_config, FAIL) + FUNC_ENTER_NOAPI(FAIL) if(config_ptr == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL config_ptr on entry.") @@ -2393,7 +2393,7 @@ H5AC_close_trace_file(H5AC_t * cache_ptr) herr_t ret_value = SUCCEED; /* Return value */ FILE * trace_file_ptr = NULL; - FUNC_ENTER_NOAPI(H5AC_close_trace_file, FAIL) + FUNC_ENTER_NOAPI(FAIL) if ( cache_ptr == NULL ) { @@ -2455,7 +2455,7 @@ H5AC_open_trace_file(H5AC_t * cache_ptr, H5AC_aux_t * aux_ptr = NULL; #endif /* H5_HAVE_PARALLEL */ - FUNC_ENTER_NOAPI(H5AC_open_trace_file, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert(cache_ptr); @@ -2568,7 +2568,7 @@ H5AC_add_candidate(H5AC_t * cache_ptr, H5AC_slist_entry_t * slist_entry_ptr = NULL; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5AC_add_candidate, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert( cache_ptr != NULL ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); @@ -2650,7 +2650,7 @@ H5AC_broadcast_candidate_list(H5AC_t * cache_ptr, int num_entries = 0; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5AC_broadcast_candidate_list, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert( cache_ptr != NULL ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); @@ -2761,7 +2761,7 @@ H5AC_broadcast_clean_list(H5AC_t * cache_ptr) int mpi_result; int num_entries = 0; - FUNC_ENTER_NOAPI(H5AC_broadcast_clean_list, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert( cache_ptr != NULL ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); @@ -2952,7 +2952,7 @@ H5AC_check_if_write_permitted(const H5F_t UNUSED * f, #endif /* H5_HAVE_PARALLEL */ - FUNC_ENTER_NOAPI(H5AC_check_if_write_permitted, FAIL) + FUNC_ENTER_NOAPI(FAIL) #ifdef H5_HAVE_PARALLEL HDassert( f != NULL ); @@ -3014,7 +3014,7 @@ H5AC_construct_candidate_list(H5AC_t * cache_ptr, { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5AC_construct_candidate_list, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert( cache_ptr != NULL ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); @@ -3105,7 +3105,7 @@ H5AC_copy_candidate_list_to_buffer(H5AC_t * cache_ptr, int i = 0; int num_entries = 0; - FUNC_ENTER_NOAPI(H5AC_copy_candidate_list_to_buffer, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert( cache_ptr != NULL ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); @@ -3227,7 +3227,7 @@ H5AC_ext_config_2_int_config(H5AC_cache_config_t * ext_conf_ptr, { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5AC_ext_config_2_int_config, FAIL) + FUNC_ENTER_NOAPI(FAIL) if ( ( ext_conf_ptr == NULL ) || ( ext_conf_ptr->version != H5AC__CURR_CACHE_CONFIG_VERSION ) || @@ -3306,7 +3306,7 @@ H5AC_log_deleted_entry(H5AC_t * cache_ptr, H5AC_slist_entry_t * slist_entry_ptr = NULL; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5AC_log_deleted_entry, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert( cache_ptr != NULL ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); @@ -3398,7 +3398,7 @@ H5AC_log_dirtied_entry(const H5AC_info_t * entry_ptr, H5AC_aux_t * aux_ptr; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5AC_log_dirtied_entry, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert( entry_ptr ); HDassert( entry_ptr->addr == addr ); @@ -3521,7 +3521,7 @@ H5AC_log_flushed_entry(H5C_t * cache_ptr, H5AC_slist_entry_t * slist_entry_ptr = NULL; - FUNC_ENTER_NOAPI(H5AC_log_flushed_entry, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert( cache_ptr != NULL ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); @@ -3648,7 +3648,7 @@ H5AC_log_inserted_entry(H5F_t * f, H5AC_aux_t * aux_ptr; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5AC_log_inserted_entry, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert(cache_ptr != NULL); HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); @@ -3760,7 +3760,7 @@ H5AC_log_moved_entry(const H5F_t *f, H5AC_slist_entry_t * slist_entry_ptr = NULL; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5AC_log_moved_entry, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert( f ); HDassert( f->shared ); @@ -4010,7 +4010,7 @@ H5AC_propagate_and_apply_candidate_list(H5F_t * f, H5AC_aux_t * aux_ptr; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5AC_propagate_and_apply_candidate_list, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert( cache_ptr != NULL ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); @@ -4174,7 +4174,7 @@ H5AC_propagate_flushed_and_still_clean_entries_list(H5F_t * f, H5AC_aux_t * aux_ptr; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5AC_propagate_flushed_and_still_clean_entries_list, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert(cache_ptr != NULL); HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); @@ -4234,7 +4234,7 @@ H5AC_receive_and_apply_clean_list(H5F_t * f, int num_entries = 0; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5AC_receive_and_apply_clean_list, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert( f != NULL ); HDassert( f->shared->cache == cache_ptr ); @@ -4345,7 +4345,7 @@ H5AC_receive_candidate_list(H5AC_t * cache_ptr, int num_entries; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5AC_receive_candidate_list, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert( cache_ptr != NULL ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); @@ -4491,7 +4491,7 @@ H5AC_rsp__dist_md_write__flush(H5F_t *f, H5AC_aux_t * aux_ptr; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5AC_rsp__dist_md_write__flush, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert( f != NULL ); HDassert( f->shared->cache == cache_ptr ); @@ -4642,7 +4642,7 @@ H5AC_rsp__dist_md_write__flush_to_min_clean(H5F_t *f, H5AC_aux_t * aux_ptr; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5AC_rsp__dist_md_write__flush_to_min_clean, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert( f != NULL ); HDassert( f->shared->cache == cache_ptr ); @@ -4725,7 +4725,7 @@ H5AC_rsp__p0_only__flush(H5F_t *f, H5AC_aux_t * aux_ptr; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5AC_rsp__p0_only__flush, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert( f != NULL ); HDassert( f->shared->cache == cache_ptr ); @@ -4827,7 +4827,7 @@ H5AC_rsp__p0_only__flush_to_min_clean(H5F_t *f, H5AC_aux_t * aux_ptr; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5AC_rsp__p0_only__flush_to_min_clean, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert( f != NULL ); HDassert( f->shared->cache == cache_ptr ); @@ -4939,7 +4939,7 @@ H5AC_run_sync_point(H5F_t *f, H5AC_aux_t * aux_ptr; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5AC_run_sync_point, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert( f != NULL ); @@ -5076,7 +5076,7 @@ H5AC_tidy_cache_0_lists(H5AC_t * cache_ptr, H5AC_aux_t * aux_ptr; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5AC_tidy_cache_0_lists, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert( cache_ptr != NULL ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); @@ -5169,7 +5169,7 @@ H5AC_flush_entries(H5F_t *f) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5AC_flush_entries) + FUNC_ENTER_NOAPI_NOINIT HDassert(f); HDassert(f->shared->cache); @@ -5208,7 +5208,7 @@ H5AC_ignore_tags(H5F_t * f) herr_t ret_value = SUCCEED; /* Function Enter Macro */ - FUNC_ENTER_NOAPI(H5AC_ignore_tags, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Assertions */ HDassert(f); @@ -5245,7 +5245,7 @@ H5AC_tag(hid_t dxpl_id, haddr_t metadata_tag, haddr_t * prev_tag) herr_t ret_value = SUCCEED; /* return value */ /* Function Enter Macro */ - FUNC_ENTER_NOAPI(H5AC_tag, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check Arguments */ if(NULL == (dxpl = (H5P_genplist_t *)H5I_object_verify(dxpl_id, H5I_GENPROP_LST))) @@ -5305,7 +5305,7 @@ H5AC_retag_copied_metadata(H5F_t * f, haddr_t metadata_tag) herr_t ret_value = SUCCEED; /* Function Enter Macro */ - FUNC_ENTER_NOAPI(H5AC_retag_copied_metadata, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Assertions */ HDassert(f); @@ -5339,7 +5339,7 @@ H5AC_flush_tagged_metadata(H5F_t * f, haddr_t metadata_tag, hid_t dxpl_id) herr_t ret_value = SUCCEED; /* Function Enter Macro */ - FUNC_ENTER_NOAPI(H5AC_flush_tagged_metadata, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Assertions */ HDassert(f); @@ -5375,7 +5375,7 @@ H5AC_evict_tagged_metadata(H5F_t * f, haddr_t metadata_tag, hid_t dxpl_id) herr_t ret_value = SUCCEED; /* Function Enter Macro */ - FUNC_ENTER_NOAPI(H5AC_evict_tagged_metadata, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Assertions */ HDassert(f); @@ -5413,7 +5413,7 @@ H5AC_verify_tag(hid_t dxpl_id, H5AC_class_t * type) H5P_genplist_t * dxpl; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI(H5AC_verify_tag, FAIL) + FUNC_ENTER_NOAPI_NOINIT /* Get the dataset transfer property list */ if(NULL == (dxpl = (H5P_genplist_t *)H5I_object_verify(dxpl_id, H5I_GENPROP_LST))) diff --git a/src/H5Abtree2.c b/src/H5Abtree2.c index 31dcb66..5a15c20 100644 --- a/src/H5Abtree2.c +++ b/src/H5Abtree2.c @@ -171,7 +171,7 @@ H5A_dense_fh_name_cmp(const void *obj, size_t UNUSED obj_len, void *_udata) hbool_t took_ownership = FALSE; /* Whether the "found" operator took ownership of the attribute */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5A_dense_fh_name_cmp) + FUNC_ENTER_NOAPI_NOINIT /* Decode attribute information */ if(NULL == (attr = (H5A_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_ATTR_ID, (const unsigned char *)obj))) @@ -222,7 +222,7 @@ H5A_dense_btree2_name_store(void *_nrecord, const void *_udata) const H5A_bt2_ud_ins_t *udata = (const H5A_bt2_ud_ins_t *)_udata; H5A_dense_bt2_name_rec_t *nrecord = (H5A_dense_bt2_name_rec_t *)_nrecord; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5A_dense_btree2_name_store) + FUNC_ENTER_NOAPI_NOINIT /* Copy user information info native record */ nrecord->id = udata->id; @@ -255,7 +255,7 @@ H5A_dense_btree2_name_compare(const void *_bt2_udata, const void *_bt2_rec) const H5A_dense_bt2_name_rec_t *bt2_rec = (const H5A_dense_bt2_name_rec_t *)_bt2_rec; herr_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5A_dense_btree2_name_compare) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(bt2_udata); @@ -323,7 +323,7 @@ H5A_dense_btree2_name_encode(uint8_t *raw, const void *_nrecord, void UNUSED *ct { const H5A_dense_bt2_name_rec_t *nrecord = (const H5A_dense_bt2_name_rec_t *)_nrecord; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5A_dense_btree2_name_encode) + FUNC_ENTER_NOAPI_NOINIT /* Encode the record's fields */ HDmemcpy(raw, nrecord->id.id, (size_t)H5O_FHEAP_ID_LEN); @@ -354,7 +354,7 @@ H5A_dense_btree2_name_decode(const uint8_t *raw, void *_nrecord, void UNUSED *ct { H5A_dense_bt2_name_rec_t *nrecord = (H5A_dense_bt2_name_rec_t *)_nrecord; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5A_dense_btree2_name_decode) + FUNC_ENTER_NOAPI_NOINIT /* Decode the record's fields */ HDmemcpy(nrecord->id.id, raw, (size_t)H5O_FHEAP_ID_LEN); @@ -386,7 +386,7 @@ H5A_dense_btree2_name_debug(FILE *stream, const H5F_t UNUSED *f, hid_t UNUSED dx { const H5A_dense_bt2_name_rec_t *nrecord = (const H5A_dense_bt2_name_rec_t *)_nrecord; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5A_dense_btree2_name_debug) + FUNC_ENTER_NOAPI_NOINIT HDfprintf(stream, "%*s%-*s {%016Hx, %02x, %u, %08lx}\n", indent, "", fwidth, "Record:", @@ -415,7 +415,7 @@ H5A_dense_btree2_corder_store(void *_nrecord, const void *_udata) const H5A_bt2_ud_ins_t *udata = (const H5A_bt2_ud_ins_t *)_udata; H5A_dense_bt2_corder_rec_t *nrecord = (H5A_dense_bt2_corder_rec_t *)_nrecord; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5A_dense_btree2_corder_store) + FUNC_ENTER_NOAPI_NOINIT /* Copy user information info native record */ nrecord->id = udata->id; @@ -447,7 +447,7 @@ H5A_dense_btree2_corder_compare(const void *_bt2_udata, const void *_bt2_rec) const H5A_dense_bt2_corder_rec_t *bt2_rec = (const H5A_dense_bt2_corder_rec_t *)_bt2_rec; herr_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5A_dense_btree2_corder_compare) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(bt2_udata); @@ -483,7 +483,7 @@ H5A_dense_btree2_corder_encode(uint8_t *raw, const void *_nrecord, void UNUSED * { const H5A_dense_bt2_corder_rec_t *nrecord = (const H5A_dense_bt2_corder_rec_t *)_nrecord; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5A_dense_btree2_corder_encode) + FUNC_ENTER_NOAPI_NOINIT /* Encode the record's fields */ HDmemcpy(raw, nrecord->id.id, (size_t)H5O_FHEAP_ID_LEN); @@ -513,7 +513,7 @@ H5A_dense_btree2_corder_decode(const uint8_t *raw, void *_nrecord, void UNUSED * { H5A_dense_bt2_corder_rec_t *nrecord = (H5A_dense_bt2_corder_rec_t *)_nrecord; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5A_dense_btree2_corder_decode) + FUNC_ENTER_NOAPI_NOINIT /* Decode the record's fields */ HDmemcpy(nrecord->id.id, raw, (size_t)H5O_FHEAP_ID_LEN); @@ -544,7 +544,7 @@ H5A_dense_btree2_corder_debug(FILE *stream, const H5F_t UNUSED *f, hid_t UNUSED { const H5A_dense_bt2_corder_rec_t *nrecord = (const H5A_dense_bt2_corder_rec_t *)_nrecord; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5A_dense_btree2_corder_debug) + FUNC_ENTER_NOAPI_NOINIT HDfprintf(stream, "%*s%-*s {%016Hx, %02x, %u}\n", indent, "", fwidth, "Record:", diff --git a/src/H5Adense.c b/src/H5Adense.c index 889889e..4c10255 100644 --- a/src/H5Adense.c +++ b/src/H5Adense.c @@ -192,7 +192,7 @@ H5A_dense_create(H5F_t *f, hid_t dxpl_id, H5O_ainfo_t *ainfo) H5B2_t *bt2_corder = NULL; /* v2 B-tree handle for creation order */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5A_dense_create, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* * Check arguments. @@ -309,7 +309,7 @@ H5A_dense_fnd_cb(const H5A_t *attr, hbool_t *took_ownership, void *_user_attr) { H5A_t const **user_attr = (H5A_t const **)_user_attr; /* User data from v2 B-tree attribute lookup */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5A_dense_fnd_cb) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -349,7 +349,7 @@ H5A_dense_open(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, const char *na htri_t attr_exists; /* Attribute exists in v2 B-tree */ H5A_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI(H5A_dense_open, NULL) + FUNC_ENTER_NOAPI(NULL) /* * Check arguments. @@ -444,7 +444,7 @@ H5A_dense_insert(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, H5A_t *attr) htri_t attr_sharable; /* Flag indicating attributes are sharable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5A_dense_insert, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* * Check arguments. @@ -470,7 +470,7 @@ H5A_dense_insert(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, H5A_t *attr) mesg_flags |= H5O_MSG_FLAG_SHARED; else { /* Should this attribute be written as a SOHM? */ - if(H5SM_try_share(f, dxpl_id, NULL, H5O_ATTR_ID, attr, &mesg_flags) < 0) + if(H5SM_try_share(f, dxpl_id, NULL, 0, H5O_ATTR_ID, attr, &mesg_flags) < 0) HGOTO_ERROR(H5E_ATTR, H5E_WRITEERROR, FAIL, "error determining if message should be shared") /* Attributes can't be "unique be shareable" yet */ @@ -597,7 +597,7 @@ H5A_dense_write_bt2_cb2(void *_record, void *_op_data, hbool_t *changed) H5A_dense_bt2_corder_rec_t *record = (H5A_dense_bt2_corder_rec_t *)_record; /* Record from B-tree */ H5O_fheap_id_t *new_heap_id = (H5O_fheap_id_t *)_op_data; /* "op data" from v2 B-tree modify */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5A_dense_write_bt2_cb2) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -638,7 +638,7 @@ H5A_dense_write_bt2_cb(void *_record, void *_op_data, hbool_t *changed) uint8_t attr_buf[H5A_ATTR_BUF_SIZE]; /* Buffer for serializing attribute */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5A_dense_write_bt2_cb) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -754,7 +754,7 @@ H5A_dense_write(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, H5A_t *attr) htri_t attr_sharable; /* Flag indicating attributes are sharable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5A_dense_write, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* * Check arguments. @@ -850,7 +850,7 @@ H5A_dense_copy_fh_cb(const void *obj, size_t UNUSED obj_len, void *_udata) H5A_fh_ud_cp_t *udata = (H5A_fh_ud_cp_t *)_udata; /* User data for fractal heap 'op' callback */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5A_dense_copy_fh_cb) + FUNC_ENTER_NOAPI_NOINIT /* Decode attribute information & keep a copy */ /* (we make a copy instead of calling the user/library callback directly in @@ -901,7 +901,7 @@ H5A_dense_rename(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, const char * htri_t attr_exists; /* Attribute exists in v2 B-tree */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5A_dense_rename, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* * Check arguments. @@ -1049,7 +1049,7 @@ H5A_dense_iterate_bt2_cb(const void *_record, void *_bt2_udata) H5A_bt2_ud_it_t *bt2_udata = (H5A_bt2_ud_it_t *)_bt2_udata; /* User data for callback */ herr_t ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5A_dense_iterate_bt2_cb) + FUNC_ENTER_NOAPI_NOINIT /* Check for skipping attributes */ if(bt2_udata->skip > 0) @@ -1151,7 +1151,7 @@ H5A_dense_iterate(H5F_t *f, hid_t dxpl_id, hid_t loc_id, const H5O_ainfo_t *ainf haddr_t bt2_addr; /* Address of v2 B-tree to use for lookup */ herr_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5A_dense_iterate, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* * Check arguments. @@ -1286,7 +1286,7 @@ H5A_dense_remove_bt2_cb(const void *_record, void *_udata) H5B2_t *bt2_corder = NULL; /* v2 B-tree handle for creation order index */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5A_dense_remove_bt2_cb) + FUNC_ENTER_NOAPI_NOINIT /* Check for removing the link from the creation order index */ if(H5F_addr_defined(udata->corder_bt2_addr)) { @@ -1352,7 +1352,7 @@ H5A_dense_remove(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, const char * htri_t attr_sharable; /* Flag indicating attributes are sharable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5A_dense_remove, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* * Check arguments. @@ -1444,7 +1444,7 @@ H5A_dense_remove_by_idx_bt2_cb(const void *_record, void *_bt2_udata) hbool_t use_sh_loc; /* Whether to use the attribute's shared location or the separate one */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5A_dense_remove_by_idx_bt2_cb) + FUNC_ENTER_NOAPI_NOINIT /* Set up the user data for fractal heap 'op' callback */ fh_udata.f = bt2_udata->f; @@ -1571,7 +1571,7 @@ H5A_dense_remove_by_idx(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, haddr_t bt2_addr; /* Address of v2 B-tree to use for operation */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5A_dense_remove_by_idx, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* * Check arguments. @@ -1701,7 +1701,7 @@ H5A_dense_exists(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, const char * htri_t attr_sharable; /* Flag indicating attributes are sharable */ htri_t ret_value = TRUE; /* Return value */ - FUNC_ENTER_NOAPI(H5A_dense_exists, NULL) + FUNC_ENTER_NOAPI(NULL) /* * Check arguments. @@ -1788,7 +1788,7 @@ H5A_dense_delete_bt2_cb(const void *_record, void *_bt2_udata) H5A_t *attr = NULL; /* Attribute being removed */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5A_dense_delete_bt2_cb) + FUNC_ENTER_NOAPI_NOINIT /* Check for shared attribute */ if(record->flags & H5O_MSG_FLAG_SHARED) { @@ -1852,7 +1852,7 @@ H5A_dense_delete(H5F_t *f, hid_t dxpl_id, H5O_ainfo_t *ainfo) H5HF_t *fheap = NULL; /* Fractal heap handle */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5A_dense_delete, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* * Check arguments. diff --git a/src/H5Adeprec.c b/src/H5Adeprec.c index 2b244fd..22faaa2 100644 --- a/src/H5Adeprec.c +++ b/src/H5Adeprec.c @@ -100,7 +100,7 @@ DESCRIPTION static herr_t H5A_init_deprec_interface(void) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5A_init_deprec_interface) + FUNC_ENTER_NOAPI_NOINIT FUNC_LEAVE_NOAPI(H5A_init()) } /* H5A_init_deprec_interface() */ @@ -143,7 +143,7 @@ H5Acreate1(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, H5S_t *space; /* Dataspace to use for attribute */ hid_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Acreate1, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE5("i", "i*siii", loc_id, name, type_id, space_id, plist_id); /* check arguments */ @@ -198,7 +198,7 @@ H5Aopen_name(hid_t loc_id, const char *name) H5A_t *attr = NULL; /* Attribute opened */ hid_t ret_value; - FUNC_ENTER_API(H5Aopen_name, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("i", "i*s", loc_id, name); /* check arguments */ @@ -211,7 +211,7 @@ H5Aopen_name(hid_t loc_id, const char *name) /* Open the attribute on the object header */ if(NULL == (attr = H5A_open_by_name(&loc, ".", name, H5P_LINK_ACCESS_DEFAULT, H5AC_ind_dxpl_id))) - HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "can't open attribute") + HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "can't open attribute: '%s'", name) /* Register the attribute and get an ID for it */ if((ret_value = H5I_register(H5I_ATTR, attr, TRUE)) < 0) @@ -256,7 +256,7 @@ H5Aopen_idx(hid_t loc_id, unsigned idx) H5A_t *attr = NULL; /* Attribute opened */ hid_t ret_value; - FUNC_ENTER_API(H5Aopen_idx, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("i", "iIu", loc_id, idx); /* check arguments */ @@ -308,7 +308,7 @@ H5Aget_num_attrs(hid_t loc_id) void *obj; int ret_value; - FUNC_ENTER_API(H5Aget_num_attrs, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("Is", "i", loc_id); /* check arguments */ @@ -405,7 +405,7 @@ H5Aiterate1(hid_t loc_id, unsigned *attr_num, H5A_operator1_t op, void *op_data) hsize_t last_attr; /* Index of last attribute examined */ herr_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Aiterate1, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE4("e", "i*Iux*x", loc_id, attr_num, op, op_data); /* check arguments */ diff --git a/src/H5Aint.c b/src/H5Aint.c index 4e610e4..8475330 100644 --- a/src/H5Aint.c +++ b/src/H5Aint.c @@ -138,12 +138,12 @@ H5FL_SEQ_DEFINE(H5A_t_ptr); */ static herr_t H5A_compact_build_table_cb(H5O_t UNUSED *oh, H5O_mesg_t *mesg/*in,out*/, - unsigned sequence, hbool_t UNUSED *oh_modified, void *_udata/*in,out*/) + unsigned sequence, unsigned UNUSED *oh_modified, void *_udata/*in,out*/) { H5A_compact_bt_ud_t *udata = (H5A_compact_bt_ud_t *)_udata; /* Operator user data */ herr_t ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5A_compact_build_table_cb) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(mesg); @@ -204,7 +204,7 @@ H5A_compact_build_table(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5_index_t idx_type, H5O_mesg_operator_t op; /* Wrapper for operator */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5A_compact_build_table) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(f); @@ -265,7 +265,7 @@ H5A_dense_build_table_cb(const H5A_t *attr, void *_udata) H5A_dense_bt_ud_t *udata = (H5A_dense_bt_ud_t *)_udata; /* 'User data' passed in */ herr_t ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5A_dense_build_table_cb) + FUNC_ENTER_NOAPI_NOINIT /* check arguments */ HDassert(attr); @@ -314,7 +314,7 @@ H5A_dense_build_table(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, hsize_t nrec; /* # of records in v2 B-tree */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5A_dense_build_table) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(f); @@ -395,7 +395,7 @@ done: static int H5A_attr_cmp_name_inc(const void *attr1, const void *attr2) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5A_attr_cmp_name_inc) + FUNC_ENTER_NOAPI_NOINIT FUNC_LEAVE_NOAPI(HDstrcmp((*(const H5A_t * const *)attr1)->shared->name, (*(const H5A_t * const *)attr2)->shared->name)) @@ -423,7 +423,7 @@ H5A_attr_cmp_name_inc(const void *attr1, const void *attr2) static int H5A_attr_cmp_name_dec(const void *attr1, const void *attr2) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5A_attr_cmp_name_dec) + FUNC_ENTER_NOAPI_NOINIT FUNC_LEAVE_NOAPI(HDstrcmp((*(const H5A_t * const *)attr2)->shared->name, (*(const H5A_t * const *)attr1)->shared->name)) @@ -452,7 +452,7 @@ H5A_attr_cmp_corder_inc(const void *attr1, const void *attr2) { int ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5A_attr_cmp_corder_inc) + FUNC_ENTER_NOAPI_NOINIT if((*(const H5A_t * const *)attr1)->shared->crt_idx < (*(const H5A_t * const *)attr2)->shared->crt_idx) ret_value = -1; @@ -487,7 +487,7 @@ H5A_attr_cmp_corder_dec(const void *attr1, const void *attr2) { int ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5A_attr_cmp_corder_dec) + FUNC_ENTER_NOAPI_NOINIT if((*(const H5A_t * const *)attr1)->shared->crt_idx < (*(const H5A_t * const *)attr2)->shared->crt_idx) ret_value = 1; @@ -517,7 +517,7 @@ static herr_t H5A_attr_sort_table(H5A_attr_table_t *atable, H5_index_t idx_type, H5_iter_order_t order) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5A_attr_sort_table) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(atable); @@ -567,7 +567,7 @@ H5A_attr_iterate_table(const H5A_attr_table_t *atable, hsize_t skip, size_t u; /* Local index variable */ herr_t ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI(H5A_attr_iterate_table, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ HDassert(atable); @@ -646,7 +646,7 @@ H5A_attr_release_table(H5A_attr_table_t *atable) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5A_attr_release_table) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(atable); @@ -691,7 +691,7 @@ H5A_get_ainfo(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_ainfo_t *ainfo) H5B2_t *bt2_name = NULL; /* v2 B-tree handle for name index */ htri_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_TAG(H5A_get_ainfo, dxpl_id, oh->cache_info.addr, FAIL) + FUNC_ENTER_NOAPI_TAG(dxpl_id, oh->cache_info.addr, FAIL) /* check arguments */ HDassert(f); @@ -756,7 +756,7 @@ H5A_set_version(const H5F_t *f, H5A_t *attr) hbool_t type_shared, space_shared; /* Flags to indicate that shared messages are used for this attribute */ hbool_t use_latest_format; /* Flag indicating the newest file format should be used */ - FUNC_ENTER_NOAPI_NOFUNC(H5A_set_version) + FUNC_ENTER_NOAPI(FAIL) /* check arguments */ HDassert(f); @@ -820,7 +820,7 @@ H5A_attr_copy_file(const H5A_t *attr_src, H5F_t *file_dst, hbool_t *recompute_si H5A_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5A_attr_copy_file) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(attr_src); @@ -851,7 +851,8 @@ H5A_attr_copy_file(const H5A_t *attr_src, H5F_t *file_dst, hbool_t *recompute_si HDassert(attr_dst->shared->name); /* Copy attribute's datatype */ - /* (Start destination datatype as transient, even if source is named) */ + /* If source is named, we will keep dst as named, but we will not actually + * copy the target and update the message until post copy */ if(NULL == (attr_dst->shared->dt = H5T_copy(attr_src->shared->dt, H5T_COPY_ALL))) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, NULL, "cannot copy datatype") @@ -859,37 +860,14 @@ H5A_attr_copy_file(const H5A_t *attr_src, H5F_t *file_dst, hbool_t *recompute_si if(H5T_set_loc(attr_dst->shared->dt, file_dst, H5T_LOC_DISK) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "cannot mark datatype on disk") - /* Check for named datatype being copied */ - if(H5T_committed(attr_src->shared->dt)) { - H5O_loc_t *src_oloc; /* Pointer to source datatype's object location */ - H5O_loc_t *dst_oloc; /* Pointer to dest. datatype's object location */ - - /* Get group entries for source & destination */ - src_oloc = H5T_oloc(attr_src->shared->dt); - HDassert(src_oloc); - dst_oloc = H5T_oloc(attr_dst->shared->dt); - HDassert(dst_oloc); - - /* Reset object location for new object */ - H5O_loc_reset(dst_oloc); - dst_oloc->file = file_dst; - - /* Copy the shared object from source to destination */ - if(H5O_copy_header_map(src_oloc, dst_oloc, dxpl_id, cpy_info, FALSE, - NULL, NULL) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, NULL, "unable to copy object") - - /* Update shared message info from named datatype info */ - H5T_update_shared(attr_dst->shared->dt); - } /* end if */ - else { + if(!H5T_committed(attr_src->shared->dt)) { /* If the datatype is not named, it may have been shared in the * source file's heap. Un-share it for now. We'll try to shared * it in the destination file below. */ if(H5O_msg_reset_share(H5O_DTYPE_ID, attr_dst->shared->dt) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "unable to reset datatype sharing") - } /* end else */ + } /* end if */ /* Copy the dataspace for the attribute. Make sure the maximal dimension is also copied. * Otherwise the comparison in the test may complain about it. SLU 2011/4/12 */ @@ -902,13 +880,13 @@ H5A_attr_copy_file(const H5A_t *attr_src, H5F_t *file_dst, hbool_t *recompute_si if(H5O_msg_reset_share(H5O_SDSPACE_ID, attr_dst->shared->ds) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "unable to reset dataspace sharing") - - /* Try to share both the datatype and dataset. This does nothing if the - * datatype is committed or sharing is disabled. + /* Simulate trying to share both the datatype and dataset, to determine the + * final size of the messages. This does nothing if the datatype is + * committed or sharing is disabled. */ - if(H5SM_try_share(file_dst, dxpl_id, NULL, H5O_DTYPE_ID, attr_dst->shared->dt, NULL) < 0) + if(H5SM_try_share(file_dst, dxpl_id, NULL, H5SM_DEFER, H5O_DTYPE_ID, attr_dst->shared->dt, NULL) < 0) HGOTO_ERROR(H5E_OHDR, H5E_WRITEERROR, NULL, "can't share attribute datatype") - if(H5SM_try_share(file_dst, dxpl_id, NULL, H5O_SDSPACE_ID, attr_dst->shared->ds, NULL) < 0) + if(H5SM_try_share(file_dst, dxpl_id, NULL, H5SM_DEFER, H5O_SDSPACE_ID, attr_dst->shared->ds, NULL) < 0) HGOTO_ERROR(H5E_OHDR, H5E_WRITEERROR, NULL, "can't share attribute dataspace") /* Compute the sizes of the datatype and dataspace. This is their raw @@ -1029,6 +1007,10 @@ H5A_attr_copy_file(const H5A_t *attr_src, H5F_t *file_dst, hbool_t *recompute_si if(H5A_set_version(file_dst, attr_dst) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, NULL, "unable to update attribute version") + /* Recompute the destination attribute's size, if it's a different version */ + if(attr_src->shared->version != attr_dst->shared->version) + *recompute_size = TRUE; + /* Set return value */ ret_value = attr_dst; @@ -1077,20 +1059,55 @@ done: *------------------------------------------------------------------------- */ herr_t -H5A_attr_post_copy_file(const H5O_loc_t *src_oloc, const H5A_t UNUSED *attr_src, +H5A_attr_post_copy_file(const H5O_loc_t *src_oloc, const H5A_t *attr_src, H5O_loc_t *dst_oloc, const H5A_t *attr_dst, hid_t dxpl_id, H5O_copy_t *cpy_info) { - H5F_t *file_src = src_oloc->file; - H5F_t *file_dst = dst_oloc->file; + H5F_t *file_src, *file_dst; herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI_NOINIT(H5A_attr_post_copy_file) + FUNC_ENTER_NOAPI_NOINIT /* check args */ + HDassert(src_oloc); + HDassert(dst_oloc); HDassert(attr_dst); + HDassert(attr_src); + + file_src = src_oloc->file; + file_dst = dst_oloc->file; + + HDassert(file_src); HDassert(file_dst); + if(H5T_committed(attr_src->shared->dt)) { + H5O_loc_t *src_oloc_dt; /* Pointer to source datatype's object location */ + H5O_loc_t *dst_oloc_dt; /* Pointer to dest. datatype's object location */ + + /* Get group entries for source & destination */ + src_oloc_dt = H5T_oloc(attr_src->shared->dt); + HDassert(src_oloc_dt); + dst_oloc_dt = H5T_oloc(attr_dst->shared->dt); + HDassert(dst_oloc_dt); + + /* Reset object location for new object */ + H5O_loc_reset(dst_oloc_dt); + dst_oloc_dt->file = file_dst; + + /* Copy the shared object from source to destination */ + if(H5O_copy_header_map(src_oloc_dt, dst_oloc_dt, dxpl_id, cpy_info, FALSE, NULL, NULL) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy object") + + /* Update shared message info from named datatype info */ + H5T_update_shared(attr_dst->shared->dt); + } /* end if */ + + /* Try to share both the datatype and dataset. This does nothing if the + * datatype is committed or sharing is disabled. + */ + if(H5SM_try_share(file_dst, dxpl_id, NULL, H5SM_WAS_DEFERRED, H5O_DTYPE_ID, attr_dst->shared->dt, NULL) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_WRITEERROR, FAIL, "can't share attribute datatype") + if(H5SM_try_share(file_dst, dxpl_id, NULL, H5SM_WAS_DEFERRED, H5O_SDSPACE_ID, attr_dst->shared->ds, NULL) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_WRITEERROR, FAIL, "can't share attribute dataspace") /* Only need to fix reference attribute with real data being copied to * another file. @@ -1124,7 +1141,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5A_dense_copy_file_cb + * Function: H5A_dense_post_copy_file_cb * * Purpose: Callback routine for copying a dense attribute from SRC to DST. * @@ -1138,13 +1155,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5A_dense_copy_file_cb(const H5A_t *attr_src, void *_udata) +H5A_dense_post_copy_file_cb(const H5A_t *attr_src, void *_udata) { H5A_dense_file_cp_ud_t *udata = (H5A_dense_file_cp_ud_t *)_udata; H5A_t *attr_dst = NULL; herr_t ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5A_dense_copy_file_cb) + FUNC_ENTER_NOAPI_NOINIT /* check arguments */ HDassert(attr_src); @@ -1157,6 +1174,10 @@ H5A_dense_copy_file_cb(const H5A_t *attr_src, void *_udata) udata->recompute_size, udata->cpy_info, udata->dxpl_id))) HGOTO_ERROR(H5E_ATTR, H5E_CANTCOPY, H5_ITER_ERROR, "can't copy attribute") + if(H5A_attr_post_copy_file(udata->oloc_src, attr_src, udata->oloc_dst, attr_dst, + udata->dxpl_id, udata->cpy_info) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTCOPY, H5_ITER_ERROR, "can't copy attribute") + /* Reset shared location information */ if(H5O_msg_reset_share(H5O_ATTR_ID, attr_dst) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to reset attribute sharing") @@ -1176,105 +1197,20 @@ done: HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, FAIL, "can't close destination attribute") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5A_dense_copy_file_cb() */ - - -/*------------------------------------------------------------------------- - * Function: H5A_dense_copy_file_all - * - * Purpose: Copy all dense attributes from SRC to DST. - * - * Return: Success: Non-negative - * Failure: Negative - * - * Programmer: Peter Cao - * xcao@hdfgroup.org - * July 20, 2007 - * - *------------------------------------------------------------------------- - */ -herr_t -H5A_dense_copy_file_all(H5F_t *file_src, H5O_ainfo_t *ainfo_src, H5F_t *file_dst, - const H5O_ainfo_t *ainfo_dst, hbool_t *recompute_size, H5O_copy_t *cpy_info, hid_t dxpl_id) -{ - H5A_dense_file_cp_ud_t udata; /* User data for iteration callback */ - H5A_attr_iter_op_t attr_op; /* Attribute operator */ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI_NOINIT(H5A_dense_copy_file_all) - - /* check arguments */ - HDassert(ainfo_src); - HDassert(ainfo_dst); - - udata.ainfo = ainfo_dst; /* Destination dense information */ - udata.file = file_dst; /* Destination file */ - udata.recompute_size = recompute_size; /* Flag to indicate if size changed */ - udata.cpy_info = cpy_info; /* Information on copying options */ - udata.dxpl_id = dxpl_id; /* DXPL for operation */ - - attr_op.op_type = H5A_ATTR_OP_LIB; - attr_op.u.lib_op = H5A_dense_copy_file_cb; - - if(H5A_dense_iterate(file_src, dxpl_id, (hid_t)0, ainfo_src, H5_INDEX_NAME, - H5_ITER_NATIVE, (hsize_t)0, NULL, &attr_op, &udata) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "error building attribute table") - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5A_dense_copy_file_all */ - - -/*------------------------------------------------------------------------- - * Function: H5A_dense_post_copy_file_cb - * - * Purpose: Callback routine to perfom post copy for a dense attribute. - * - * Return: Success: Non-negative - * Failure: Negative - * - * Programmer: Peter Cao - * xcao@hdfgroup.org - * July 25, 2007 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5A_dense_post_copy_file_cb(const H5A_t *attr_dst, void *_udata) -{ - H5A_dense_file_cp_ud_t *udata = (H5A_dense_file_cp_ud_t *)_udata; - herr_t ret_value = H5_ITER_CONT; /* Return value */ - - FUNC_ENTER_NOAPI_NOINIT(H5A_dense_post_copy_file_cb) - - /* check arguments */ - HDassert(attr_dst); - HDassert(udata); - HDassert(udata->ainfo); - HDassert(udata->file); - HDassert(udata->cpy_info); - - if ( H5A_attr_post_copy_file(udata->oloc_src, NULL, - udata->oloc_dst, attr_dst, udata->dxpl_id, udata->cpy_info) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTCOPY, H5_ITER_ERROR, "can't copy attribute") - -done: - - FUNC_LEAVE_NOAPI(ret_value) } /* end H5A_dense_post_copy_file_cb() */ /*------------------------------------------------------------------------- * Function: H5A_dense_post_copy_file_all * - * Purpose: Do post copy for all dense attributes. + * Purpose: Copy all dense attributes from SRC to DST. * * Return: Success: Non-negative * Failure: Negative * * Programmer: Peter Cao * xcao@hdfgroup.org - * July 25, 2007 + * July 20, 2007 * *------------------------------------------------------------------------- */ @@ -1283,21 +1219,19 @@ H5A_dense_post_copy_file_all(const H5O_loc_t *src_oloc, const H5O_ainfo_t *ainfo H5O_loc_t *dst_oloc, H5O_ainfo_t *ainfo_dst, hid_t dxpl_id, H5O_copy_t *cpy_info) { H5A_dense_file_cp_ud_t udata; /* User data for iteration callback */ - H5A_attr_iter_op_t attr_op; /* Attribute operator */ - herr_t ret_value = SUCCEED; /* Return value */ + H5A_attr_iter_op_t attr_op; /* Attribute operator */ + hbool_t recompute_size = FALSE; /* recompute the size */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5A_dense_post_copy_file_all) + FUNC_ENTER_NOAPI_NOINIT /* check arguments */ HDassert(ainfo_src); HDassert(ainfo_dst); - HDassert(src_oloc); - HDassert(dst_oloc); - HDassert(src_oloc->file); - HDassert(dst_oloc->file); - udata.ainfo = ainfo_src; - udata.file = src_oloc->file; + udata.ainfo = ainfo_dst; /* Destination dense information */ + udata.file = dst_oloc->file; /* Destination file */ + udata.recompute_size = &recompute_size; /* Flag to indicate if size changed */ udata.cpy_info = cpy_info; /* Information on copying options */ udata.dxpl_id = dxpl_id; /* DXPL for operation */ udata.oloc_src = src_oloc; @@ -1306,11 +1240,12 @@ H5A_dense_post_copy_file_all(const H5O_loc_t *src_oloc, const H5O_ainfo_t *ainfo attr_op.op_type = H5A_ATTR_OP_LIB; attr_op.u.lib_op = H5A_dense_post_copy_file_cb; - if(H5A_dense_iterate(dst_oloc->file, dxpl_id, (hid_t)0, ainfo_dst, H5_INDEX_NAME, + + if(H5A_dense_iterate(src_oloc->file, dxpl_id, (hid_t)0, ainfo_src, H5_INDEX_NAME, H5_ITER_NATIVE, (hsize_t)0, NULL, &attr_op, &udata) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "error building attribute table") done: FUNC_LEAVE_NOAPI(ret_value) -} +} /* end H5A_dense_post_copy_file_all */ diff --git a/src/H5Apkg.h b/src/H5Apkg.h index 27f500e..20aa5b9 100644 --- a/src/H5Apkg.h +++ b/src/H5Apkg.h @@ -283,8 +283,6 @@ H5_DLL H5A_t *H5A_attr_copy_file(const H5A_t *attr_src, H5F_t *file_dst, hbool_t H5O_copy_t *cpy_info, hid_t dxpl_id); H5_DLL herr_t H5A_attr_post_copy_file(const H5O_loc_t *src_oloc, const H5A_t *mesg_src, H5O_loc_t *dst_oloc, const H5A_t *mesg_dst, hid_t dxpl_id, H5O_copy_t *cpy_info); -H5_DLL herr_t H5A_dense_copy_file_all(H5F_t *file_src, H5O_ainfo_t *ainfo_src, H5F_t *file_dst, - const H5O_ainfo_t *ainfo_dst, hbool_t *recompute_size, H5O_copy_t *cpy_info, hid_t dxpl_id); H5_DLL herr_t H5A_dense_post_copy_file_all(const H5O_loc_t *src_oloc, const H5O_ainfo_t * ainfo_src, H5O_loc_t *dst_oloc, H5O_ainfo_t *ainfo_dst, hid_t dxpl_id, H5O_copy_t *cpy_info); diff --git a/src/H5Atest.c b/src/H5Atest.c index 845c6c8..19b5547 100644 --- a/src/H5Atest.c +++ b/src/H5Atest.c @@ -97,7 +97,7 @@ H5A_is_shared_test(hid_t attr_id) H5A_t *attr; /* Attribute object for ID */ htri_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5A_is_shared_test) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments */ if(NULL == (attr = (H5A_t *)H5I_object_verify(attr_id, H5I_ATTR))) @@ -130,7 +130,7 @@ H5A_get_shared_rc_test(hid_t attr_id, hsize_t *ref_count) H5A_t *attr; /* Attribute object for ID */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5A_get_shared_rc_test) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments */ if(NULL == (attr = (H5A_t *)H5I_object_verify(attr_id, H5I_ATTR))) diff --git a/src/H5B.c b/src/H5B.c index 61c5856..cd50b36 100644 --- a/src/H5B.c +++ b/src/H5B.c @@ -224,7 +224,7 @@ H5B_create(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, void *udata, H5B_shared_t *shared=NULL; /* Pointer to shared B-tree info */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI(H5B_create, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* * Check arguments. @@ -315,7 +315,7 @@ H5B_find(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, int cmp = 1; /* Key comparison value */ htri_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5B_find, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* * Check arguments. @@ -407,7 +407,7 @@ H5B_find_node(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, htri_t found; /* Whether the correct node has been found */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5B_find_node, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* * Check arguments. @@ -516,7 +516,7 @@ H5B_split(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, unsigned idx, hbool_t bt_pinned = FALSE; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5B_split) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -789,7 +789,7 @@ H5B_insert(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, hbool_t nrbt_pinned = FALSE; /* TRUE if new_root_bt is pinned */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI(H5B_insert, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check arguments. */ HDassert(f); @@ -973,7 +973,7 @@ H5B_insert_child(H5B_t *bt, unsigned *bt_flags, unsigned *idx, H5B_shared_t *shared; /* Pointer to shared B-tree info */ uint8_t *base; /* Base offset for move */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5B_insert_child) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(bt); HDassert(bt_flags); @@ -1074,7 +1074,7 @@ H5B_insert_helper(H5F_t *f, hid_t dxpl_id, H5B_ins_ud_t *bt_ud, H5B_ins_t my_ins = H5B_INS_ERROR; H5B_ins_t ret_value = H5B_INS_ERROR; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5B_insert_helper) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments @@ -1438,7 +1438,7 @@ H5B_iterate_helper(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t add unsigned i; /* Index */ herr_t ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5B_iterate_helper) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -1503,7 +1503,7 @@ H5B_iterate(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, { herr_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOERR(H5B_iterate, -) + FUNC_ENTER_NOAPI_NOERR /* * Check arguments. @@ -1562,7 +1562,7 @@ H5B_remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type int cmp = 1; /* Key comparison value */ H5B_ins_t ret_value = H5B_INS_ERROR; - FUNC_ENTER_NOAPI(H5B_remove_helper, H5B_INS_ERROR) + FUNC_ENTER_NOAPI(H5B_INS_ERROR) HDassert(f); HDassert(type); @@ -1886,7 +1886,7 @@ H5B_remove(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, hbool_t rt_key_changed = FALSE; /*right key changed?*/ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5B_remove, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args */ HDassert(f); @@ -1932,7 +1932,7 @@ H5B_delete(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5B_delete, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args */ HDassert(f); @@ -2006,7 +2006,7 @@ H5B_shared_new(const H5F_t *f, const H5B_class_t *type, size_t sizeof_rkey) size_t u; /* Local index variable */ H5B_shared_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5B_shared_new, NULL) + FUNC_ENTER_NOAPI(NULL) /* * Check arguments. @@ -2082,7 +2082,7 @@ H5B_shared_free(void *_shared) { H5B_shared_t *shared = (H5B_shared_t *)_shared; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5B_shared_free) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Free the raw B-tree node buffer */ shared->page = H5FL_BLK_FREE(page, shared->page); @@ -2119,7 +2119,7 @@ H5B_copy(const H5B_t *old_bt) H5B_shared_t *shared; /* Pointer to shared B-tree info */ H5B_t *ret_value; - FUNC_ENTER_NOAPI(H5B_copy, NULL) + FUNC_ENTER_NOAPI(NULL) /* * Check arguments. @@ -2192,7 +2192,7 @@ H5B_get_info_helper(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t ad haddr_t left_child; /* Address of left-most child in node */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5B_get_info_helper) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -2292,7 +2292,7 @@ H5B_get_info(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, H5B_info_ud_t info_udata; /* User-data for B-tree size iteration */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5B_get_info, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* * Check arguments. @@ -2347,7 +2347,7 @@ H5B_valid(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, H5B_cache_ud_t cache_udata; /* User-data for metadata cache callback */ htri_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5B_valid, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* * Check arguments. @@ -2400,7 +2400,7 @@ done: herr_t H5B_node_dest(H5B_t *bt) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5B_node_dest) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check arguments */ HDassert(bt); @@ -2439,7 +2439,7 @@ H5B_support(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, H5B_t *node = NULL; /* Node containing direct link to child */ herr_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5B_support, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* * Check arguments. @@ -2498,7 +2498,7 @@ H5B_unsupport(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, H5B_t *node = NULL; /* Node containing direct link to child */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5B_unsupport, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* * Check arguments. diff --git a/src/H5B2.c b/src/H5B2.c index 9c3fd7b..003f83e 100644 --- a/src/H5B2.c +++ b/src/H5B2.c @@ -138,7 +138,7 @@ H5B2_create(H5F_t *f, hid_t dxpl_id, const H5B2_create_t *cparam, void *ctx_udat haddr_t hdr_addr; /* B-tree header address */ H5B2_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5B2_create, NULL) + FUNC_ENTER_NOAPI(NULL) /* * Check arguments. @@ -211,7 +211,7 @@ H5B2_open(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *ctx_udata) H5B2_hdr_cache_ud_t cache_udata; /* User-data for callback */ H5B2_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5B2_open) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments. */ HDassert(f); @@ -276,7 +276,7 @@ H5B2_insert(H5B2_t *bt2, hid_t dxpl_id, void *udata) H5B2_hdr_t *hdr; /* Pointer to the B-tree header */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5B2_insert, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check arguments. */ HDassert(bt2); @@ -336,7 +336,7 @@ done: herr_t H5B2_get_addr(const H5B2_t *bt2, haddr_t *addr_p) { - FUNC_ENTER_NOAPI_NOFUNC(H5B2_get_addr) + FUNC_ENTER_NOAPI_NOERR /* * Check arguments. @@ -374,7 +374,7 @@ H5B2_iterate(H5B2_t *bt2, hid_t dxpl_id, H5B2_operator_t op, void *op_data) H5B2_hdr_t *hdr; /* Pointer to the B-tree header */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOERR(H5B2_iterate, -) + FUNC_ENTER_NOAPI_NOERR /* Check arguments. */ HDassert(bt2); @@ -431,7 +431,7 @@ H5B2_find(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_found_t op, unsigned idx; /* Location of record which matches key */ htri_t ret_value = TRUE; /* Return value */ - FUNC_ENTER_NOAPI(H5B2_find, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check arguments. */ HDassert(bt2); @@ -566,7 +566,7 @@ H5B2_index(H5B2_t *bt2, hid_t dxpl_id, H5_iter_order_t order, hsize_t idx, unsigned depth; /* Current depth of the tree */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5B2_index, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check arguments. */ HDassert(bt2); @@ -720,7 +720,7 @@ H5B2_remove(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_remove_t op, H5B2_hdr_t *hdr; /* Pointer to the B-tree header */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5B2_remove, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check arguments. */ HDassert(bt2); @@ -794,7 +794,7 @@ H5B2_remove_by_idx(H5B2_t *bt2, hid_t dxpl_id, H5_iter_order_t order, H5B2_hdr_t *hdr; /* Pointer to the B-tree header */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5B2_remove_by_idx, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check arguments. */ HDassert(bt2); @@ -872,7 +872,7 @@ done: herr_t H5B2_get_nrec(const H5B2_t *bt2, hsize_t *nrec) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5B2_get_nrec) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments. */ HDassert(bt2); @@ -917,7 +917,7 @@ H5B2_neighbor(H5B2_t *bt2, hid_t dxpl_id, H5B2_compare_t range, void *udata, H5B2_hdr_t *hdr; /* Pointer to the B-tree header */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5B2_neighbor, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check arguments. */ HDassert(bt2); @@ -979,7 +979,7 @@ H5B2_modify(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_modify_t op, unsigned idx; /* Location of record which matches key */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5B2_modify, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check arguments. */ HDassert(bt2); @@ -1131,7 +1131,7 @@ H5B2_close(H5B2_t *bt2, hid_t dxpl_id) hbool_t pending_delete = FALSE; /* Whether the v2 B-tree is pending deletion */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5B2_close) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments. */ HDassert(bt2); @@ -1241,7 +1241,7 @@ H5B2_delete(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *ctx_udata, H5B2_hdr_cache_ud_t cache_udata; /* User-data for callback */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5B2_delete, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check arguments. */ HDassert(f); diff --git a/src/H5B2cache.c b/src/H5B2cache.c index f47bb9f..2ee4ef7 100644 --- a/src/H5B2cache.c +++ b/src/H5B2cache.c @@ -165,7 +165,7 @@ H5B2_cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) const uint8_t *p; /* Pointer into raw data buffer */ H5B2_hdr_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5B2_cache_hdr_load) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments */ HDassert(f); @@ -280,7 +280,7 @@ H5B2_cache_hdr_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, uint8_t hdr_buf[H5B2_HDR_BUF_SIZE]; /* Buffer for header */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5B2_cache_hdr_flush) + FUNC_ENTER_NOAPI_NOINIT /* check arguments */ HDassert(f); @@ -381,7 +381,7 @@ H5B2_cache_hdr_dest(H5F_t *f, H5B2_hdr_t *hdr) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5B2_cache_hdr_dest) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments */ HDassert(hdr); @@ -425,7 +425,7 @@ H5B2_cache_hdr_clear(H5F_t *f, H5B2_hdr_t *hdr, hbool_t destroy) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5B2_cache_hdr_clear) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -462,7 +462,7 @@ done: static herr_t H5B2_cache_hdr_size(const H5F_t UNUSED *f, const H5B2_hdr_t *hdr, size_t *size_ptr) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5B2_cache_hdr_size) + FUNC_ENTER_NOAPI_NOINIT /* check arguments */ HDassert(f); @@ -502,7 +502,7 @@ H5B2_cache_internal_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) unsigned u; /* Local index variable */ H5B2_internal_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5B2_cache_internal_load) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments */ HDassert(f); @@ -625,7 +625,7 @@ H5B2_cache_internal_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5B2_cache_internal_flush) + FUNC_ENTER_NOAPI_NOINIT /* check arguments */ HDassert(f); @@ -722,7 +722,7 @@ H5B2_cache_internal_dest(H5F_t *f, H5B2_internal_t *internal) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5B2_cache_internal_dest) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments */ HDassert(f); @@ -767,7 +767,7 @@ H5B2_cache_internal_clear(H5F_t *f, H5B2_internal_t *internal, hbool_t destroy) { herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT(H5B2_cache_internal_clear) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -804,7 +804,7 @@ done: static herr_t H5B2_cache_internal_size(const H5F_t UNUSED *f, const H5B2_internal_t *internal, size_t *size_ptr) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5B2_cache_internal_size) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check arguments */ HDassert(internal); @@ -844,7 +844,7 @@ H5B2_cache_leaf_load(H5F_t UNUSED *f, hid_t dxpl_id, haddr_t addr, void *_udata) unsigned u; /* Local index variable */ H5B2_leaf_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5B2_cache_leaf_load) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments */ HDassert(f); @@ -947,7 +947,7 @@ H5B2_cache_leaf_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5 { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5B2_cache_leaf_flush) + FUNC_ENTER_NOAPI_NOINIT /* check arguments */ HDassert(f); @@ -1030,7 +1030,7 @@ H5B2_cache_leaf_dest(H5F_t *f, H5B2_leaf_t *leaf) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5B2_cache_leaf_dest) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments */ HDassert(f); @@ -1075,7 +1075,7 @@ H5B2_cache_leaf_clear(H5F_t *f, H5B2_leaf_t *leaf, hbool_t destroy) { herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT(H5B2_cache_leaf_clear) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -1112,7 +1112,7 @@ done: static herr_t H5B2_cache_leaf_size(const H5F_t UNUSED *f, const H5B2_leaf_t *leaf, size_t *size_ptr) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5B2_cache_leaf_size) + FUNC_ENTER_NOAPI_NOERR /* check arguments */ HDassert(leaf); diff --git a/src/H5B2dbg.c b/src/H5B2dbg.c index 5a0b341..3e5d55a 100644 --- a/src/H5B2dbg.c +++ b/src/H5B2dbg.c @@ -97,7 +97,7 @@ H5B2_hdr_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, H5B2_hdr_cache_ud_t cache_udata; /* User-data for callback */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5B2_hdr_debug, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* * Check arguments. @@ -213,7 +213,7 @@ H5B2_int_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, H5B2_hdr_cache_ud_t cache_udata; /* User-data for callback */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5B2_int_debug, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* * Check arguments. @@ -345,7 +345,7 @@ H5B2_leaf_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, char temp_str[128]; /* Temporary string, for formatting */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5B2_leaf_debug, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* * Check arguments. diff --git a/src/H5B2hdr.c b/src/H5B2hdr.c index e8d8b96..c90b296 100644 --- a/src/H5B2hdr.c +++ b/src/H5B2hdr.c @@ -115,7 +115,7 @@ H5B2_hdr_init(H5B2_hdr_t *hdr, const H5B2_create_t *cparam, void *ctx_udata, unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5B2_hdr_init) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -241,7 +241,7 @@ H5B2_hdr_alloc(H5F_t *f) H5B2_hdr_t *hdr = NULL; /* v2 B-tree header */ H5B2_hdr_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5B2_hdr_alloc) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -288,7 +288,7 @@ H5B2_hdr_create(H5F_t *f, hid_t dxpl_id, const H5B2_create_t *cparam, H5B2_hdr_t *hdr = NULL; /* The new v2 B-tree header information */ haddr_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5B2_hdr_create) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -342,7 +342,7 @@ H5B2_hdr_incr(H5B2_hdr_t *hdr) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5B2_hdr_incr) + FUNC_ENTER_NOAPI_NOINIT /* Sanity checks */ HDassert(hdr); @@ -378,7 +378,7 @@ H5B2_hdr_decr(H5B2_hdr_t *hdr) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5B2_hdr_decr) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(hdr); @@ -413,7 +413,7 @@ done: herr_t H5B2_hdr_fuse_incr(H5B2_hdr_t *hdr) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5B2_hdr_fuse_incr) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(hdr); @@ -441,7 +441,7 @@ H5B2_hdr_fuse_incr(H5B2_hdr_t *hdr) size_t H5B2_hdr_fuse_decr(H5B2_hdr_t *hdr) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5B2_hdr_fuse_decr) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(hdr); @@ -472,7 +472,7 @@ H5B2_hdr_dirty(H5B2_hdr_t *hdr) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5B2_hdr_dirty) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(hdr); @@ -504,7 +504,7 @@ H5B2_hdr_free(H5B2_hdr_t *hdr) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5B2_hdr_free) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(hdr); @@ -569,7 +569,7 @@ H5B2_hdr_delete(H5B2_hdr_t *hdr, hid_t dxpl_id) unsigned cache_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting v2 B-tree header */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5B2_hdr_delete, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ HDassert(hdr); diff --git a/src/H5B2int.c b/src/H5B2int.c index f6602737f..4355174 100644 --- a/src/H5B2int.c +++ b/src/H5B2int.c @@ -140,7 +140,7 @@ H5B2_locate_record(const H5B2_class_t *type, unsigned nrec, size_t *rec_off, unsigned my_idx = 0; /* Final index value */ int cmp = -1; /* Key comparison value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5B2_locate_record) + FUNC_ENTER_NOAPI_NOINIT hi = nrec; while(lo < hi && cmp) { @@ -187,7 +187,7 @@ H5B2_split1(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, H5B2_node_ptr_t *cur unsigned left_child_flags = H5AC__NO_FLAGS_SET, right_child_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting child nodes */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5B2_split1) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments. */ HDassert(hdr); @@ -368,7 +368,7 @@ H5B2_split_root(H5B2_hdr_t *hdr, hid_t dxpl_id) unsigned u_max_nrec_size; /* Temporary variable for range checking */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5B2_split_root) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments. */ HDassert(hdr); @@ -450,7 +450,7 @@ H5B2_redistribute2(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, unsigned left_child_flags = H5AC__NO_FLAGS_SET, right_child_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting child nodes */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5B2_redistribute2) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments. */ HDassert(hdr); @@ -684,7 +684,7 @@ H5B2_redistribute3(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, unsigned middle_child_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting child nodes */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5B2_redistribute3) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments. */ HDassert(hdr); @@ -1065,7 +1065,7 @@ H5B2_merge2(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, unsigned left_child_flags = H5AC__NO_FLAGS_SET, right_child_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting child nodes */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5B2_merge2) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments. */ HDassert(hdr); @@ -1225,7 +1225,7 @@ H5B2_merge3(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, unsigned middle_child_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting child nodes */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5B2_merge3) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments. */ HDassert(hdr); @@ -1443,7 +1443,7 @@ H5B2_swap_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, uint8_t *child_native; /* Pointer to child's native records */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5B2_swap_leaf) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments. */ HDassert(hdr); @@ -1530,7 +1530,7 @@ H5B2_insert_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, H5B2_node_ptr_t *curr_node_ptr, unsigned idx; /* Location of record which matches key */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5B2_insert_leaf) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments. */ HDassert(hdr); @@ -1606,7 +1606,7 @@ H5B2_insert_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, unsigned idx; /* Location of record which matches key */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5B2_insert_internal) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments. */ HDassert(hdr); @@ -1736,7 +1736,7 @@ H5B2_create_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, H5B2_node_ptr_t *node_ptr) H5B2_leaf_t *leaf = NULL; /* Pointer to new leaf node created */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5B2_create_leaf) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments. */ HDassert(hdr); @@ -1805,7 +1805,7 @@ H5B2_protect_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, haddr_t addr, unsigned nrec, H5B2_leaf_cache_ud_t udata; /* User-data for callback */ H5B2_leaf_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5B2_protect_leaf) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments. */ HDassert(hdr); @@ -1846,7 +1846,7 @@ H5B2_create_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, H5B2_node_ptr_t *node_ptr, H5B2_internal_t *internal = NULL; /* Pointer to new internal node created */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5B2_create_internal) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments. */ HDassert(hdr); @@ -1924,7 +1924,7 @@ H5B2_protect_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, haddr_t addr, H5B2_internal_cache_ud_t udata; /* User data to pass through to cache 'deserialize' callback */ H5B2_internal_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5B2_protect_internal) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments. */ HDassert(hdr); @@ -1975,7 +1975,7 @@ H5B2_iterate_node(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, unsigned u; /* Local index */ herr_t ret_value = H5_ITER_CONT; /* Iterator return value */ - FUNC_ENTER_NOAPI_NOINIT(H5B2_iterate_node) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments. */ HDassert(hdr); @@ -2082,7 +2082,7 @@ H5B2_remove_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, H5B2_node_ptr_t *curr_node_ptr, unsigned idx; /* Location of record which matches key */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5B2_remove_leaf) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments. */ HDassert(hdr); @@ -2167,7 +2167,7 @@ H5B2_remove_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, hbool_t *depth_decreased, hbool_t collapsed_root = FALSE; /* Whether the root was collapsed */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5B2_remove_internal) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments. */ HDassert(hdr); @@ -2363,7 +2363,7 @@ H5B2_remove_leaf_by_idx(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned leaf_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting leaf node */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5B2_remove_leaf_by_idx) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments. */ HDassert(hdr); @@ -2447,7 +2447,7 @@ H5B2_remove_internal_by_idx(H5B2_hdr_t *hdr, hid_t dxpl_id, hbool_t collapsed_root = FALSE; /* Whether the root was collapsed */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5B2_remove_internal_by_idx) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments. */ HDassert(hdr); @@ -2710,7 +2710,7 @@ H5B2_neighbor_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, H5B2_node_ptr_t *curr_node_pt int cmp = 0; /* Comparison value of records */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5B2_neighbor_leaf) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments. */ HDassert(hdr); @@ -2796,7 +2796,7 @@ H5B2_neighbor_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, int cmp = 0; /* Comparison value of records */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5B2_neighbor_internal) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments. */ HDassert(hdr); @@ -2868,7 +2868,7 @@ H5B2_delete_node(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, uint8_t *native; /* Pointers to node's native records */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5B2_delete_node) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments. */ HDassert(hdr); @@ -2946,7 +2946,7 @@ H5B2_node_size(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth, H5B2_internal_t *internal = NULL; /* Pointer to internal node */ herr_t ret_value = SUCCEED; /* Iterator return value */ - FUNC_ENTER_NOAPI(H5B2_node_size, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check arguments. */ HDassert(hdr); @@ -2999,7 +2999,7 @@ H5B2_internal_free(H5B2_internal_t *internal) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5B2_internal_free) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -3044,7 +3044,7 @@ H5B2_leaf_free(H5B2_leaf_t *leaf) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5B2_leaf_free) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. diff --git a/src/H5B2stat.c b/src/H5B2stat.c index afd1e33..a8f1fbd 100644 --- a/src/H5B2stat.c +++ b/src/H5B2stat.c @@ -86,7 +86,7 @@ herr_t H5B2_stat_info(H5B2_t *bt2, H5B2_stat_t *info) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5B2_stat_info) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments. */ HDassert(info); @@ -118,7 +118,7 @@ H5B2_size(H5B2_t *bt2, hid_t dxpl_id, hsize_t *btree_size) H5B2_hdr_t *hdr; /* Pointer to the B-tree header */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5B2_size, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check arguments. */ HDassert(bt2); diff --git a/src/H5B2test.c b/src/H5B2test.c index 8076343..8507d6e 100644 --- a/src/H5B2test.c +++ b/src/H5B2test.c @@ -126,7 +126,7 @@ H5B2_test_crt_context(void *_f) H5B2_test_ctx_t *ctx; /* Callback context structure */ void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5B2_test_crt_context) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(f); @@ -164,7 +164,7 @@ H5B2_test_dst_context(void *_ctx) { H5B2_test_ctx_t *ctx = (H5B2_test_ctx_t *)_ctx; /* Callback context structure */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5B2_test_dst_context) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ HDassert(ctx); @@ -192,7 +192,7 @@ H5B2_test_dst_context(void *_ctx) static herr_t H5B2_test_store(void *nrecord, const void *udata) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5B2_test_store) + FUNC_ENTER_NOAPI_NOINIT_NOERR *(hsize_t *)nrecord = *(const hsize_t *)udata; @@ -217,7 +217,7 @@ H5B2_test_store(void *nrecord, const void *udata) static herr_t H5B2_test_compare(const void *rec1, const void *rec2) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5B2_test_compare) + FUNC_ENTER_NOAPI_NOINIT_NOERR FUNC_LEAVE_NOAPI((herr_t)(*(const hssize_t *)rec1 - *(const hssize_t *)rec2)) } /* H5B2_test_compare() */ @@ -241,7 +241,7 @@ H5B2_test_encode(uint8_t *raw, const void *nrecord, void *_ctx) { H5B2_test_ctx_t *ctx = (H5B2_test_ctx_t *)_ctx; /* Callback context structure */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5B2_test_encode) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ HDassert(ctx); @@ -270,7 +270,7 @@ H5B2_test_decode(const uint8_t *raw, void *nrecord, void *_ctx) { H5B2_test_ctx_t *ctx = (H5B2_test_ctx_t *)_ctx; /* Callback context structure */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5B2_test_decode) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ HDassert(ctx); @@ -299,7 +299,7 @@ H5B2_test_debug(FILE *stream, const H5F_t UNUSED *f, hid_t UNUSED dxpl_id, int indent, int fwidth, const void *record, const void UNUSED *_udata) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5B2_test_debug) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert (record); @@ -329,7 +329,7 @@ H5B2_test_crt_dbg_context(H5F_t *f, hid_t UNUSED dxpl_id, haddr_t UNUSED addr) H5B2_test_ctx_t *ctx; /* Callback context structure */ void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5B2_test_crt_dbg_context) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(f); @@ -365,7 +365,7 @@ done: herr_t H5B2_get_root_addr_test(H5B2_t *bt2, haddr_t *root_addr) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5B2_get_root_addr_test) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments. */ HDassert(bt2); @@ -402,7 +402,7 @@ H5B2_get_node_info_test(H5B2_t *bt2, hid_t dxpl_id, void *udata, unsigned idx; /* Location of record which matches key */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5B2_get_node_info_test, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check arguments. */ HDassert(bt2); @@ -516,7 +516,7 @@ H5B2_get_node_depth_test(H5B2_t *bt2, hid_t dxpl_id, void *udata) H5B2_node_info_test_t ninfo; /* Node information */ int ret_value; /* Return information */ - FUNC_ENTER_NOAPI(H5B2_get_node_depth_test, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check arguments. */ HDassert(bt2); diff --git a/src/H5Bcache.c b/src/H5Bcache.c index 64c8b56..191766c 100644 --- a/src/H5Bcache.c +++ b/src/H5Bcache.c @@ -109,7 +109,7 @@ H5B_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) unsigned u; /* Local index variable */ H5B_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5B_load) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments */ HDassert(f); @@ -215,7 +215,7 @@ H5B_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5B_t *bt, uns H5B_shared_t *shared; /* Pointer to shared B-tree info */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5B_flush) + FUNC_ENTER_NOAPI_NOINIT /* check arguments */ HDassert(f); @@ -305,7 +305,7 @@ H5B_dest(H5F_t *f, H5B_t *bt) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5B_dest) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -358,7 +358,7 @@ H5B_clear(H5F_t *f, H5B_t *bt, hbool_t destroy) { herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT(H5B_clear) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -396,7 +396,7 @@ H5B_notify(H5AC_notify_action_t action, H5B_t *bt) H5B_shared_t *shared; /* Pointer to shared B-tree info */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT(H5B_notify) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -454,7 +454,7 @@ H5B_compute_size(const H5F_t UNUSED *f, const H5B_t *bt, size_t *size_ptr) { H5B_shared_t *shared; /* Pointer to shared B-tree info */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5B_compute_size) + FUNC_ENTER_NOAPI_NOINIT /* check arguments */ HDassert(f); diff --git a/src/H5Bdbg.c b/src/H5Bdbg.c index 23ea9c8..3fb7dd8 100644 --- a/src/H5Bdbg.c +++ b/src/H5Bdbg.c @@ -65,7 +65,7 @@ H5B_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int f unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5B_debug, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* * Check arguments. @@ -189,7 +189,7 @@ H5B_assert(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type, void struct child_t *next; } *head = NULL, *tail = NULL, *prev = NULL, *cur = NULL, *tmp = NULL; - FUNC_ENTER_NOAPI_NOINIT(H5B_assert) + FUNC_ENTER_NOAPI_NOINIT if(0 == ncalls++) { if(H5DEBUG(B)) diff --git a/src/H5C.c b/src/H5C.c index ebc3272..3c792ba 100644 --- a/src/H5C.c +++ b/src/H5C.c @@ -239,7 +239,7 @@ H5C_epoch_marker_load(H5F_t UNUSED * f, { void * ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI(H5C_epoch_marker_load, NULL) + FUNC_ENTER_NOAPI_NOINIT HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, NULL, "called unreachable fcn.") @@ -258,7 +258,7 @@ H5C_epoch_marker_flush(H5F_t UNUSED *f, { herr_t ret_value = FAIL; /* Return value */ - FUNC_ENTER_NOAPI(H5C_epoch_marker_flush, FAIL) + FUNC_ENTER_NOAPI_NOINIT HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "called unreachable fcn.") @@ -273,7 +273,7 @@ H5C_epoch_marker_dest(H5F_t UNUSED * f, { herr_t ret_value = FAIL; /* Return value */ - FUNC_ENTER_NOAPI(H5C_epoch_marker_dest, FAIL) + FUNC_ENTER_NOAPI_NOINIT HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "called unreachable fcn.") @@ -289,7 +289,7 @@ H5C_epoch_marker_clear(H5F_t UNUSED * f, { herr_t ret_value = FAIL; /* Return value */ - FUNC_ENTER_NOAPI(H5C_epoch_marker_clear, FAIL) + FUNC_ENTER_NOAPI_NOINIT HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "called unreachable fcn.") @@ -304,7 +304,7 @@ H5C_epoch_marker_notify(H5C_notify_action_t UNUSED action, { herr_t ret_value = FAIL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5C_epoch_marker_notify) + FUNC_ENTER_NOAPI_NOINIT HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "called unreachable fcn.") @@ -319,7 +319,7 @@ H5C_epoch_marker_size(const H5F_t UNUSED * f, { herr_t ret_value = FAIL; /* Return value */ - FUNC_ENTER_NOAPI(H5C_epoch_marker_size, FAIL) + FUNC_ENTER_NOAPI_NOINIT HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "called unreachable fcn.") @@ -455,7 +455,7 @@ H5C_apply_candidate_list(H5F_t * f, #endif /* H5C_APPLY_CANDIDATE_LIST__DEBUG */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5C_apply_candidate_list, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert( cache_ptr != NULL ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); @@ -771,7 +771,7 @@ H5C_construct_candidate_list__clean_cache(H5C_t * cache_ptr) size_t space_needed; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5C_construct_candidate_list__clean_cache, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert( cache_ptr != NULL ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); @@ -882,7 +882,7 @@ H5C_construct_candidate_list__min_clean(H5C_t * cache_ptr) size_t space_needed = 0; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5C_construct_candidate_list__min_clean, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert( cache_ptr != NULL ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); @@ -985,7 +985,7 @@ H5C_create(size_t max_cache_size, H5C_t * cache_ptr = NULL; H5C_t * ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI(H5C_create, NULL) + FUNC_ENTER_NOAPI(NULL) HDassert( max_cache_size >= H5C__MIN_MAX_CACHE_SIZE ); HDassert( max_cache_size <= H5C__MAX_MAX_CACHE_SIZE ); @@ -1009,7 +1009,7 @@ H5C_create(size_t max_cache_size, "memory allocation failed") } - if ( (cache_ptr->slist_ptr = H5SL_create(H5SL_TYPE_HADDR)) == NULL ) { + if ( (cache_ptr->slist_ptr = H5SL_create(H5SL_TYPE_HADDR, NULL)) == NULL ) { HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, NULL, "can't create skip list.") } @@ -1397,7 +1397,7 @@ H5C_dest(H5F_t * f, H5C_t * cache_ptr = f->shared->cache; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5C_dest, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ HDassert(cache_ptr); @@ -1451,7 +1451,7 @@ H5C_expunge_entry(H5F_t * f, H5C_cache_entry_t * entry_ptr = NULL; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5C_expunge_entry, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert( f ); HDassert( f->shared ); @@ -1583,7 +1583,7 @@ H5C_flush_cache(H5F_t *f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id, unsign size_t initial_slist_size; #endif /* H5C_DO_SANITY_CHECKS */ - FUNC_ENTER_NOAPI(H5C_flush_cache, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); @@ -1959,7 +1959,7 @@ H5C_flush_to_min_clean(H5F_t * f, #endif /* JRM */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI(H5C_flush_to_min_clean, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert( f ); HDassert( f->shared ); @@ -2130,7 +2130,7 @@ H5C_get_cache_auto_resize_config(const H5C_t * cache_ptr, { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5C_get_cache_auto_resize_config, FAIL) + FUNC_ENTER_NOAPI(FAIL) if ( ( cache_ptr == NULL ) || ( cache_ptr->magic != H5C__H5C_T_MAGIC ) ) { @@ -2179,7 +2179,7 @@ H5C_get_cache_size(H5C_t * cache_ptr, { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5C_get_cache_size, FAIL) + FUNC_ENTER_NOAPI(FAIL) if ( ( cache_ptr == NULL ) || ( cache_ptr->magic != H5C__H5C_T_MAGIC ) ) { @@ -2236,7 +2236,7 @@ H5C_get_cache_hit_rate(H5C_t * cache_ptr, { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5C_get_cache_hit_rate, FAIL) + FUNC_ENTER_NOAPI(FAIL) if ( ( cache_ptr == NULL ) || ( cache_ptr->magic != H5C__H5C_T_MAGIC ) ) { @@ -2305,7 +2305,7 @@ H5C_get_entry_status(const H5F_t *f, H5C_cache_entry_t * entry_ptr = NULL; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5C_get_entry_status, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert( f ); HDassert( f->shared ); @@ -2395,7 +2395,7 @@ H5C_get_evictions_enabled(const H5C_t *cache_ptr, { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5C_get_evictions_enabled, FAIL) + FUNC_ENTER_NOAPI(FAIL) if ( ( cache_ptr == NULL ) || ( cache_ptr->magic != H5C__H5C_T_MAGIC ) ) { @@ -2436,7 +2436,7 @@ done: herr_t H5C_get_trace_file_ptr(const H5C_t *cache_ptr, FILE **trace_file_ptr_ptr) { - FUNC_ENTER_NOAPI_NOFUNC(H5C_get_trace_file_ptr) + FUNC_ENTER_NOAPI_NOERR HDassert(cache_ptr); HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); @@ -2468,7 +2468,7 @@ herr_t H5C_get_trace_file_ptr_from_entry(const H5C_cache_entry_t *entry_ptr, FILE **trace_file_ptr_ptr) { - FUNC_ENTER_NOAPI_NOFUNC(H5C_get_trace_file_ptr_from_entry) + FUNC_ENTER_NOAPI_NOERR /* Sanity checks */ HDassert(entry_ptr); @@ -2528,7 +2528,7 @@ H5C_insert_entry(H5F_t * f, unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5C_insert_entry, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert( f ); HDassert( f->shared ); @@ -2852,7 +2852,7 @@ H5C_mark_entries_as_clean(H5F_t * f, H5C_cache_entry_t * entry_ptr = NULL; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5C_mark_entries_as_clean, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert( f ); HDassert( f->shared ); @@ -3122,7 +3122,7 @@ H5C_mark_entry_dirty(void *thing) H5C_cache_entry_t * entry_ptr = (H5C_cache_entry_t *)thing; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5C_mark_entry_dirty, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ HDassert(entry_ptr); @@ -3201,7 +3201,7 @@ H5C_move_entry(H5C_t * cache_ptr, #endif /* H5C_DO_SANITY_CHECKS */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5C_move_entry, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); @@ -3365,7 +3365,7 @@ H5C_resize_entry(void *thing, size_t new_size) H5C_cache_entry_t * entry_ptr = (H5C_cache_entry_t *)thing; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5C_resize_entry, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ HDassert(entry_ptr); @@ -3472,7 +3472,7 @@ H5C_pin_entry_from_client(H5C_t UNUSED * cache_ptr, { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5C_pin_entry_from_client) + FUNC_ENTER_NOAPI_NOINIT /* Sanity checks */ HDassert( cache_ptr ); @@ -3518,7 +3518,7 @@ H5C_pin_protected_entry(void *thing) H5C_cache_entry_t * entry_ptr = (H5C_cache_entry_t *)thing; /* Pointer to entry to pin */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5C_pin_protected_entry, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ HDassert(entry_ptr); @@ -3611,7 +3611,7 @@ H5C_protect(H5F_t * f, H5C_cache_entry_t * entry_ptr; void * ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5C_protect, NULL) + FUNC_ENTER_NOAPI(NULL) /* check args */ HDassert( f ); @@ -3990,7 +3990,7 @@ H5C_reset_cache_hit_rate_stats(H5C_t * cache_ptr) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5C_reset_cache_hit_rate_stats, FAIL) + FUNC_ENTER_NOAPI(FAIL) if ( ( cache_ptr == NULL ) || ( cache_ptr->magic != H5C__H5C_T_MAGIC ) ) { @@ -4035,7 +4035,7 @@ H5C_set_cache_auto_resize_config(H5C_t *cache_ptr, size_t new_min_clean_size; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5C_set_cache_auto_resize_config, FAIL) + FUNC_ENTER_NOAPI(FAIL) if ( ( cache_ptr == NULL ) || ( cache_ptr->magic != H5C__H5C_T_MAGIC ) ) { @@ -4309,7 +4309,7 @@ H5C_set_evictions_enabled(H5C_t *cache_ptr, { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5C_set_evictions_enabled, FAIL) + FUNC_ENTER_NOAPI(FAIL) if ( ( cache_ptr == NULL ) || ( cache_ptr->magic != H5C__H5C_T_MAGIC ) ) { @@ -4363,7 +4363,7 @@ H5C_set_prefix(H5C_t * cache_ptr, char * prefix) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5C_set_prefix, FAIL) + FUNC_ENTER_NOAPI(FAIL) if ( ( cache_ptr == NULL ) || ( cache_ptr->magic != H5C__H5C_T_MAGIC ) || @@ -4406,7 +4406,7 @@ H5C_set_trace_file_ptr(H5C_t * cache_ptr, { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5C_set_trace_file_ptr, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* This would normally be an assert, but we need to use an HGOTO_ERROR * call to shut up the compiler. @@ -4493,7 +4493,7 @@ H5C_stats(H5C_t * cache_ptr, double average_entries_scanned_per_calls_to_msic = 0.0; #endif /* H5C_COLLECT_CACHE_STATS */ - FUNC_ENTER_NOAPI(H5C_stats, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* This would normally be an assert, but we need to use an HGOTO_ERROR * call to shut up the compiler. @@ -5020,14 +5020,14 @@ H5C_dump_cache(H5C_t * cache_ptr, H5SL_t * slist_ptr = NULL; H5SL_node_t * node_ptr = NULL; - FUNC_ENTER_NOAPI(H5C_dump_cache, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert(cache_ptr != NULL); HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); HDassert(cache_name != NULL ); /* First, create a skip list */ - slist_ptr = H5SL_create(H5SL_TYPE_HADDR); + slist_ptr = H5SL_create(H5SL_TYPE_HADDR, NULL); if ( slist_ptr == NULL ) { @@ -5147,7 +5147,7 @@ H5C_unpin_entry_from_client(H5C_t * cache_ptr, { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5C_unpin_entry_from_client) + FUNC_ENTER_NOAPI_NOINIT /* Sanity checking */ HDassert( cache_ptr ); @@ -5200,7 +5200,7 @@ H5C_unpin_entry(void *_entry_ptr) H5C_cache_entry_t * entry_ptr = (H5C_cache_entry_t *)_entry_ptr; /* Pointer to entry to unpin */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5C_unpin_entry, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ HDassert(entry_ptr); @@ -5279,7 +5279,7 @@ H5C_unprotect(H5F_t * f, H5C_cache_entry_t * test_entry_ptr; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5C_unprotect, FAIL) + FUNC_ENTER_NOAPI(FAIL) deleted = ( (flags & H5C__DELETED_FLAG) != 0 ); dirtied = ( (flags & H5C__DIRTIED_FLAG) != 0 ); @@ -5592,7 +5592,7 @@ H5C_validate_resize_config(H5C_auto_size_ctl_t * config_ptr, { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5C_validate_resize_config, FAIL) + FUNC_ENTER_NOAPI(FAIL) if ( config_ptr == NULL ) { @@ -5850,7 +5850,7 @@ static void H5C_adjust_flush_dependency_rc(H5C_cache_entry_t * cache_entry, unsigned old_child_height, unsigned new_child_height) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5C_adjust_flush_dependency_rc) + FUNC_ENTER_NOAPI_NOINIT /* Sanity checks */ HDassert(cache_entry); @@ -5963,7 +5963,7 @@ H5C_create_flush_dependency(void * parent_thing, void * child_thing) #endif /* NDEBUG */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5C_create_flush_dependency, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ HDassert(parent_entry); @@ -6076,7 +6076,7 @@ H5C_destroy_flush_dependency(void *parent_thing, void * child_thing) #endif /* NDEBUG */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5C_destroy_flush_dependency, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ HDassert(parent_entry); @@ -6215,7 +6215,7 @@ H5C__auto_adjust_cache_size(H5F_t * f, enum H5C_resize_status status = in_spec; /* will change if needed */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5C__auto_adjust_cache_size) + FUNC_ENTER_NOAPI_NOINIT HDassert( f ); HDassert( cache_ptr ); @@ -6565,7 +6565,7 @@ H5C__autoadjust__ageout(H5F_t * f, size_t test_size; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5C__autoadjust__ageout) + FUNC_ENTER_NOAPI_NOINIT HDassert( f ); HDassert( cache_ptr ); @@ -6678,7 +6678,7 @@ H5C__autoadjust__ageout__cycle_epoch_marker(H5C_t * cache_ptr) herr_t ret_value = SUCCEED; /* Return value */ int i; - FUNC_ENTER_NOAPI_NOINIT(H5C__autoadjust__ageout__cycle_epoch_marker) + FUNC_ENTER_NOAPI_NOINIT HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); @@ -6816,7 +6816,7 @@ H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * f, H5C_cache_entry_t * prev_ptr; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5C__autoadjust__ageout__evict_aged_out_entries) + FUNC_ENTER_NOAPI_NOINIT HDassert( f ); HDassert( cache_ptr ); @@ -7023,7 +7023,7 @@ H5C__autoadjust__ageout__insert_new_marker(H5C_t * cache_ptr) herr_t ret_value = SUCCEED; /* Return value */ int i; - FUNC_ENTER_NOAPI_NOINIT(H5C__autoadjust__ageout__insert_new_marker) + FUNC_ENTER_NOAPI_NOINIT HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); @@ -7101,7 +7101,7 @@ H5C__autoadjust__ageout__remove_all_markers(H5C_t * cache_ptr) int i; int ring_buf_index; - FUNC_ENTER_NOAPI_NOINIT(H5C__autoadjust__ageout__remove_all_markers) + FUNC_ENTER_NOAPI_NOINIT HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); @@ -7182,7 +7182,7 @@ H5C__autoadjust__ageout__remove_excess_markers(H5C_t * cache_ptr) int i; int ring_buf_index; - FUNC_ENTER_NOAPI_NOINIT(H5C__autoadjust__ageout__remove_excess_markers) + FUNC_ENTER_NOAPI_NOINIT HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); @@ -7278,7 +7278,7 @@ H5C__flash_increase_cache_size(H5C_t * cache_ptr, double hit_rate; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5C__flash_increase_cache_size) + FUNC_ENTER_NOAPI_NOINIT HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); @@ -7475,7 +7475,7 @@ H5C_flush_invalidate_cache(H5F_t * f, #endif /* H5C_DO_SANITY_CHECKS */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI(H5C_flush_invalidate_cache, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert( f ); HDassert( cache_ptr ); @@ -8025,7 +8025,7 @@ H5C_flush_single_entry(H5F_t * f, H5C_cache_entry_t * entry_ptr = NULL; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5C_flush_single_entry) + FUNC_ENTER_NOAPI_NOINIT HDassert( f ); HDassert( cache_ptr ); @@ -8102,7 +8102,7 @@ H5C_flush_single_entry(H5F_t * f, */ if ( ( ! clear_only ) && ( entry_ptr->is_dirty ) && - ( IS_H5FD_MPI(f) ) ) { + (H5F_HAS_FEATURE(f, H5FD_FEAT_HAS_MPI) ) ) { H5P_genplist_t *dxpl; /* Dataset transfer property list */ H5FD_mpio_xfer_t xfer_mode; /* I/O xfer mode property value */ @@ -8448,7 +8448,7 @@ H5C_load_entry(H5F_t * f, unsigned u; /* Local index variable */ void * ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5C_load_entry) + FUNC_ENTER_NOAPI_NOINIT HDassert(f); HDassert(f->shared); @@ -8618,7 +8618,7 @@ H5C_make_space_in_cache(H5F_t * f, H5C_cache_entry_t * next_ptr; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5C_make_space_in_cache) + FUNC_ENTER_NOAPI_NOINIT HDassert( f ); HDassert( cache_ptr ); @@ -8915,7 +8915,7 @@ H5C_validate_lru_list(H5C_t * cache_ptr) size_t size = 0; H5C_cache_entry_t * entry_ptr = NULL; - FUNC_ENTER_NOAPI_NOINIT(H5C_validate_lru_list) + FUNC_ENTER_NOAPI_NOINIT HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); @@ -9036,7 +9036,7 @@ H5C_verify_not_in_index(H5C_t * cache_ptr, int32_t depth; H5C_cache_entry_t * scan_ptr = NULL; - FUNC_ENTER_NOAPI_NOINIT(H5C_verify_not_in_index) + FUNC_ENTER_NOAPI_NOINIT HDassert( cache_ptr != NULL ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); @@ -9098,7 +9098,7 @@ done: herr_t H5C_ignore_tags(H5C_t * cache_ptr) { - FUNC_ENTER_NOAPI_NOFUNC(H5C_ignore_tags) + FUNC_ENTER_NOAPI_NOERR /* Assertions */ HDassert(cache_ptr != NULL); @@ -9136,7 +9136,7 @@ H5C_tag_entry(H5C_t * cache_ptr, H5C_cache_entry_t * entry_ptr, hid_t dxpl_id) H5C_tag_t tag; /* Tag structure */ hid_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5C_tag_entry, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Assertions */ HDassert(cache_ptr != NULL); @@ -9183,7 +9183,7 @@ H5C_flush_tagged_entries(H5F_t * f, hid_t primary_dxpl_id, hid_t secondary_dxpl_ herr_t result; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI(H5C_flush_tagged_entries, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Assertions */ HDassert(f); @@ -9227,7 +9227,7 @@ H5C_evict_tagged_entries(H5F_t * f, hid_t primary_dxpl_id, hid_t secondary_dxpl_ herr_t ret_value = SUCCEED; /* Function Enter Macro */ - FUNC_ENTER_NOAPI(H5C_evict_tagged_entries, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Assertions */ HDassert(f); @@ -9278,7 +9278,7 @@ H5C_mark_tagged_entries(H5C_t * cache_ptr, haddr_t tag, hbool_t mark_clean) int u; /* Iterator */ H5C_cache_entry_t *entry_ptr = NULL; /* entry pointer */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5C_mark_tagged_entries) + FUNC_ENTER_NOAPI_NOINIT /* Assertions */ HDassert(cache_ptr != NULL); @@ -9333,7 +9333,7 @@ H5C_flush_marked_entries(H5F_t * f, hid_t primary_dxpl_id, hid_t secondary_dxpl_ { herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI(H5C_flush_marked_entries, FAIL) + FUNC_ENTER_NOAPI_NOINIT /* Assertions */ HDassert(cache_ptr != NULL); @@ -9376,7 +9376,7 @@ H5C_evict_marked_entries(H5F_t * f, hid_t primary_dxpl_id, hid_t secondary_dxpl_ hbool_t first_flush = TRUE; /* Function Enter Macro */ - FUNC_ENTER_NOAPI(H5C_evict_marked_entries, FAIL) + FUNC_ENTER_NOAPI_NOINIT /* Assertions */ HDassert( cache_ptr != NULL ); @@ -9481,7 +9481,7 @@ H5C_retag_entries(H5C_t * cache_ptr, haddr_t src_tag, haddr_t dest_tag) unsigned u; /* Local index variable */ H5C_cache_entry_t *entry_ptr = NULL; /* entry pointer */ - FUNC_ENTER_NOAPI_NOFUNC(H5C_retag_entries) + FUNC_ENTER_NOAPI_NOINIT /* Iterate through entries, retagging those with the src_tag tag */ for(u = 0; u < H5C__HASH_TABLE_LEN; u++) { diff --git a/src/H5CS.c b/src/H5CS.c index c033e7e..c2ca49b 100644 --- a/src/H5CS.c +++ b/src/H5CS.c @@ -79,7 +79,7 @@ H5CS_get_stack(void) { H5CS_t *fstack; - FUNC_ENTER_NOAPI_NOFUNC_NOFS(H5CS_get_stack); + FUNC_ENTER_NOAPI_NOERR_NOFS fstack = H5TS_get_thread_local_value(H5TS_funcstk_key_g); if (!fstack) { @@ -123,7 +123,7 @@ H5CS_print_stack(const H5CS_t *fstack, FILE *stream) int i; /* Local index ariable */ /* Don't push this function on the function stack... :-) */ - FUNC_ENTER_NOAPI_NOFUNC_NOFS(H5CS_print_stack); + FUNC_ENTER_NOAPI_NOERR_NOFS /* Sanity check */ HDassert(fstack); @@ -170,7 +170,7 @@ H5CS_print(FILE *stream) H5CS_t *fstack = H5CS_get_my_stack (); /* Get the correct function stack */ /* Don't push this function on the function stack... :-) */ - FUNC_ENTER_NOAPI_NOFUNC_NOFS(H5CS_print); + FUNC_ENTER_NOAPI_NOERR_NOFS /* Sanity check */ assert(fstack); @@ -202,7 +202,7 @@ H5CS_push(const char *func_name) H5CS_t *fstack = H5CS_get_my_stack (); /* Don't push this function on the function stack... :-) */ - FUNC_ENTER_NOAPI_NOFUNC_NOFS(H5CS_push); + FUNC_ENTER_NOAPI_NOERR_NOFS /* Sanity check */ assert (fstack); @@ -239,7 +239,7 @@ H5CS_pop(void) H5CS_t *fstack = H5CS_get_my_stack (); /* Don't push this function on the function stack... :-) */ - FUNC_ENTER_NOAPI_NOFUNC_NOFS(H5CS_pop); + FUNC_ENTER_NOAPI_NOERR_NOFS /* Sanity check */ assert (fstack); @@ -273,7 +273,7 @@ H5CS_copy_stack(H5CS_t *new_stack) unsigned u; /* Local index variable */ /* Don't push this function on the function stack... :-) */ - FUNC_ENTER_NOAPI_NOFUNC_NOFS(H5CS_copy_stack); + FUNC_ENTER_NOAPI_NOERR_NOFS /* Sanity check */ HDassert (old_stack); @@ -307,7 +307,7 @@ H5CS_close_stack(H5CS_t *stack) unsigned u; /* Local index variable */ /* Don't push this function on the function stack... :-) */ - FUNC_ENTER_NOAPI_NOFUNC_NOFS(H5CS_close_stack); + FUNC_ENTER_NOAPI_NOERR_NOFS /* Sanity check */ HDassert (stack); diff --git a/src/H5D.c b/src/H5D.c index 6e86e32..d0b0be3 100644 --- a/src/H5D.c +++ b/src/H5D.c @@ -88,7 +88,7 @@ DESCRIPTION static herr_t H5D_init_pub_interface(void) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_init_pub_interface) + FUNC_ENTER_NOAPI_NOINIT FUNC_LEAVE_NOAPI(H5D_init()) } /* H5D_init_pub_interface() */ @@ -132,7 +132,7 @@ H5Dcreate2(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, const H5S_t *space; /* Dataspace for dataset */ hid_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Dcreate2, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE7("i", "i*siiiii", loc_id, name, type_id, space_id, lcpl_id, dcpl_id, dapl_id); @@ -166,7 +166,7 @@ H5Dcreate2(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not dataset access property list") /* Create the new dataset & get its ID */ - if(NULL == (dset = H5D_create_named(&loc, name, type_id, space, lcpl_id, dcpl_id, dapl_id, H5AC_dxpl_id))) + if(NULL == (dset = H5D__create_named(&loc, name, type_id, space, lcpl_id, dcpl_id, dapl_id, H5AC_dxpl_id))) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to create dataset") if((ret_value = H5I_register(H5I_DATASET, dset, TRUE)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "unable to register dataset") @@ -224,7 +224,7 @@ H5Dcreate_anon(hid_t loc_id, hid_t type_id, hid_t space_id, hid_t dcpl_id, const H5S_t *space; /* Dataspace for dataset */ hid_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Dcreate_anon, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE5("i", "iiiii", loc_id, type_id, space_id, dcpl_id, dapl_id); /* Check arguments */ @@ -308,7 +308,7 @@ H5Dopen2(hid_t loc_id, const char *name, hid_t dapl_id) hid_t dxpl_id = H5AC_dxpl_id; /* dxpl to use to open datset */ hid_t ret_value; - FUNC_ENTER_API(H5Dopen2, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("i", "i*si", loc_id, name, dapl_id); /* Check args */ @@ -383,7 +383,7 @@ H5Dclose(hid_t dset_id) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Dclose, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", dset_id); /* Check args */ @@ -429,7 +429,7 @@ H5Dget_space(hid_t dset_id) H5S_t *space = NULL; hid_t ret_value; - FUNC_ENTER_API(H5Dget_space, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("i", "i", dset_id); /* Check args */ @@ -476,7 +476,7 @@ H5Dget_space_status(hid_t dset_id, H5D_space_status_t *allocation) H5D_t *dset = NULL; herr_t ret_value = SUCCEED; - FUNC_ENTER_API(H5Dget_space_status, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*Ds", dset_id, allocation); /* Check arguments */ @@ -516,13 +516,17 @@ H5Dget_type(hid_t dset_id) H5T_t *dt = NULL; /* Datatype to return */ hid_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Dget_type, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("i", "i", dset_id); /* Check args */ if(NULL == (dset = (H5D_t *)H5I_object_verify(dset_id, H5I_DATASET))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset") + /* Patch the datatype's "top level" file pointer */ + if(H5T_patch_file(dset->shared->type, dset->oloc.file) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to patch datatype's file pointer") + /* Copy the dataset's datatype */ if(NULL == (dt = H5T_copy(dset->shared->type, H5T_COPY_REOPEN))) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to copy datatype") @@ -575,7 +579,7 @@ H5Dget_create_plist(hid_t dset_id) hid_t new_dcpl_id = FAIL; hid_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Dget_create_plist, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("i", "i", dset_id); /* Check args */ @@ -712,7 +716,7 @@ H5Dget_access_plist(hid_t dset_id) hid_t new_dapl_id = FAIL; hid_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Dget_access_plist, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("i", "i", dset_id); /* Check args */ @@ -774,7 +778,7 @@ H5Dget_storage_size(hid_t dset_id) H5D_t *dset; /* Dataset to query */ hsize_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Dget_storage_size, 0) + FUNC_ENTER_API(0) H5TRACE1("h", "i", dset_id); /* Check args */ @@ -809,7 +813,7 @@ H5Dget_offset(hid_t dset_id) H5D_t *dset; /* Dataset to query */ haddr_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Dget_offset, HADDR_UNDEF) + FUNC_ENTER_API(HADDR_UNDEF) H5TRACE1("a", "i", dset_id); /* Check args */ @@ -890,7 +894,7 @@ H5Diterate(void *buf, hid_t type_id, hid_t space_id, H5D_operator_t op, H5S_t *space; /* Dataspace for iteration */ herr_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Diterate, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE5("e", "*xiix*x", buf, type_id, space_id, op, operator_data); /* Check args */ @@ -933,7 +937,7 @@ H5Dvlen_reclaim(hid_t type_id, hid_t space_id, hid_t plist_id, void *buf) H5S_t *space; /* Dataspace for iteration */ herr_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Dvlen_reclaim, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE4("e", "iii*x", type_id, space_id, plist_id, buf); /* Check args */ @@ -994,7 +998,7 @@ H5Dvlen_get_buf_size(hid_t dataset_id, hid_t type_id, hid_t space_id, H5P_genplist_t *plist; /* Property list */ herr_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Dvlen_get_buf_size, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE4("e", "iii*h", dataset_id, type_id, space_id, size); /* Check args */ @@ -1084,7 +1088,7 @@ H5Dset_extent(hid_t dset_id, const hsize_t size[]) H5D_t *dset; /* Dataset for this operation */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Dset_extent, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*h", dset_id, size); /* Check args */ @@ -1120,7 +1124,7 @@ H5Dflush(hid_t dset_id) H5D_t *dset; /* Dataset for this operation */ herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_API(H5Dflush, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", dset_id); /* Check args */ @@ -1158,7 +1162,7 @@ H5Drefresh(hid_t dset_id) H5D_t * dset = NULL; hid_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_API(H5Drefresh, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", dset_id); /* Check args */ diff --git a/src/H5Dbtree.c b/src/H5Dbtree.c index 88fe4a5..af48329 100644 --- a/src/H5Dbtree.c +++ b/src/H5Dbtree.c @@ -237,7 +237,7 @@ H5D_btree_get_shared(const H5F_t UNUSED *f, const void *_udata) { const H5D_chunk_common_ud_t *udata = (const H5D_chunk_common_ud_t *) _udata; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_btree_get_shared) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(udata); HDassert(udata->storage); @@ -278,7 +278,7 @@ H5D_btree_new_node(H5F_t *f, hid_t dxpl_id, H5B_ins_t op, unsigned u; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_btree_new_node) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(f); @@ -350,7 +350,7 @@ H5D_btree_cmp2(void *_lt_key, void *_udata, void *_rt_key) H5D_chunk_common_ud_t *udata = (H5D_chunk_common_ud_t *) _udata; int ret_value; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_btree_cmp2) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(lt_key); HDassert(rt_key); @@ -399,7 +399,7 @@ H5D_btree_cmp3(void *_lt_key, void *_udata, void *_rt_key) H5D_chunk_common_ud_t *udata = (H5D_chunk_common_ud_t *) _udata; int ret_value = 0; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_btree_cmp3) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(lt_key); HDassert(rt_key); @@ -466,7 +466,7 @@ H5D_btree_found(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, haddr_t addr, const void unsigned u; htri_t ret_value = TRUE; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_btree_found) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments */ HDassert(f); @@ -534,7 +534,7 @@ H5D_btree_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key, unsigned u; H5B_ins_t ret_value; - FUNC_ENTER_NOAPI_NOINIT(H5D_btree_insert) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(f); @@ -658,7 +658,7 @@ H5D_btree_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key /*in,out * H5D_btree_key_t *lt_key = (H5D_btree_key_t *)_lt_key; H5B_ins_t ret_value=H5B_INS_REMOVE; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_btree_remove) + FUNC_ENTER_NOAPI_NOINIT /* Remove raw data chunk from file */ if(!(H5F_INTENT(f) & H5F_ACC_SWMR_WRITE)) { @@ -695,7 +695,7 @@ H5D_btree_decode_key(const H5B_shared_t *shared, const uint8_t *raw, void *_key) size_t ndims; unsigned u; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_btree_decode_key) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ HDassert(shared); @@ -733,7 +733,7 @@ H5D_btree_encode_key(const H5B_shared_t *shared, uint8_t *raw, const void *_key) size_t ndims; unsigned u; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_btree_encode_key) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ HDassert(shared); @@ -773,7 +773,7 @@ H5D_btree_debug_key(FILE *stream, int indent, int fwidth, const void *_key, const H5D_btree_dbg_t *udata = (const H5D_btree_dbg_t *)_udata; unsigned u; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_btree_debug_key) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(key); @@ -807,7 +807,7 @@ H5D_btree_shared_create(const H5F_t *f, H5O_storage_chunk_t *store, unsigned ndi size_t sizeof_rkey; /* Size of raw (disk) key */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_btree_shared_create) + FUNC_ENTER_NOAPI_NOINIT /* Set the raw key size */ sizeof_rkey = 4 + /*storage size */ @@ -851,7 +851,7 @@ H5D_btree_create_flush_dep(void *_key, void *_udata, void *parent) H5D_chunk_common_ud_t *udata = (H5D_chunk_common_ud_t *) _udata; int ret_value; - FUNC_ENTER_NOAPI_NOINIT(H5D_btree_create_flush_dep) + FUNC_ENTER_NOAPI_NOINIT HDassert(key); HDassert(udata); @@ -894,7 +894,7 @@ H5D_btree_update_flush_dep(void *_key, void *_udata, void *old_parent, H5D_chunk_common_ud_t *udata = (H5D_chunk_common_ud_t *) _udata; int ret_value; - FUNC_ENTER_NOAPI_NOINIT(H5D_btree_update_flush_dep) + FUNC_ENTER_NOAPI_NOINIT HDassert(key); HDassert(udata); @@ -933,7 +933,7 @@ H5D_btree_idx_init(const H5D_chk_idx_info_t *idx_info, const H5S_t UNUSED *space { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_btree_idx_init) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(idx_info); @@ -980,7 +980,7 @@ H5D_btree_idx_create(const H5D_chk_idx_info_t *idx_info) H5O_t *oh = NULL; /* Dataset's object header */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_btree_idx_create) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(idx_info); @@ -1036,7 +1036,7 @@ H5D_btree_idx_is_space_alloc(const H5O_storage_chunk_t *storage) { hbool_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_btree_idx_is_space_alloc) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(storage); @@ -1068,7 +1068,7 @@ H5D_btree_idx_insert(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata) H5O_t *oh = NULL; /* Dataset's object header */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_btree_idx_insert) + FUNC_ENTER_NOAPI_NOINIT HDassert(idx_info); HDassert(idx_info->f); @@ -1127,7 +1127,7 @@ H5D_btree_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata H5O_t *oh = NULL; /* Dataset's object header */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_btree_idx_get_addr) + FUNC_ENTER_NOAPI_NOINIT HDassert(idx_info); HDassert(idx_info->f); @@ -1189,7 +1189,7 @@ H5D_btree_idx_iterate_cb(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, H5D_chunk_rec_t chunk_rec; /* Generic chunk record for callback */ int ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR(H5D_btree_idx_iterate_cb) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check for memcpy() */ HDcompile_assert(offsetof(H5D_chunk_rec_t, nbytes) == offsetof(H5D_btree_key_t, nbytes)); @@ -1233,7 +1233,7 @@ H5D_btree_idx_iterate(const H5D_chk_idx_info_t *idx_info, H5O_t *oh = NULL; /* Dataset's object header */ int ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_btree_idx_iterate) + FUNC_ENTER_NOAPI_NOINIT HDassert(idx_info); HDassert(idx_info->f); @@ -1295,7 +1295,7 @@ H5D_btree_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t * H5O_t *oh = NULL; /* Dataset's object header */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_btree_idx_remove) + FUNC_ENTER_NOAPI_NOINIT HDassert(idx_info); HDassert(idx_info->f); @@ -1353,7 +1353,7 @@ H5D_btree_idx_delete(const H5D_chk_idx_info_t *idx_info) H5O_t *oh = NULL; /* Dataset's object header */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_btree_idx_delete) + FUNC_ENTER_NOAPI_NOINIT /* Sanity checks */ HDassert(idx_info); @@ -1429,7 +1429,7 @@ H5D_btree_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src, { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(H5D_btree_idx_copy_setup, idx_info_dst->dxpl_id, H5AC__COPIED_TAG, FAIL) + FUNC_ENTER_NOAPI_NOINIT_TAG(idx_info_dst->dxpl_id, H5AC__COPIED_TAG, FAIL) HDassert(idx_info_src); HDassert(idx_info_src->f); @@ -1478,7 +1478,7 @@ H5D_btree_idx_copy_shutdown(H5O_storage_chunk_t *storage_src, { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_btree_idx_copy_shutdown) + FUNC_ENTER_NOAPI_NOINIT HDassert(storage_src); HDassert(storage_dst); @@ -1517,7 +1517,7 @@ H5D_btree_idx_size(const H5D_chk_idx_info_t *idx_info, hsize_t *index_size) H5O_t *oh = NULL; /* Dataset's object header */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5D_btree_idx_size, FAIL) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(idx_info); @@ -1587,7 +1587,7 @@ done: static herr_t H5D_btree_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_addr) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_btree_idx_reset) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(storage); @@ -1621,7 +1621,7 @@ H5D_btree_idx_support(const H5D_chk_idx_info_t *idx_info, H5O_t *oh = NULL; /* Dataset's object header */ herr_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_btree_idx_support) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(idx_info); @@ -1677,7 +1677,7 @@ H5D_btree_idx_unsupport(const H5D_chk_idx_info_t *idx_info, H5O_t *oh = NULL; /* Dataset's object header */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_btree_idx_unsupport) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(idx_info); @@ -1727,7 +1727,7 @@ done: static herr_t H5D_btree_idx_dump(const H5O_storage_chunk_t *storage, FILE *stream) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_btree_idx_dump) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(storage); HDassert(stream); @@ -1755,7 +1755,7 @@ H5D_btree_idx_dest(const H5D_chk_idx_info_t *idx_info) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_btree_idx_dest) + FUNC_ENTER_NOAPI_NOINIT HDassert(idx_info); HDassert(idx_info->f); @@ -1795,7 +1795,7 @@ H5D_btree_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, int indent hbool_t shared_init = FALSE; /* Whether B-tree shared info is initialized */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5D_btree_debug, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Reset "fake" storage info */ HDmemset(&storage, 0, sizeof(storage)); diff --git a/src/H5Dbtree2.c b/src/H5Dbtree2.c index 4aec4be..e2a5ca1 100644 --- a/src/H5Dbtree2.c +++ b/src/H5Dbtree2.c @@ -260,7 +260,7 @@ H5D_bt2_crt_context(void *_udata) H5D_bt2_ctx_t *ctx; /* Callback context structure */ void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_bt2_crt_context) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(udata); @@ -308,7 +308,7 @@ H5D_bt2_dst_context(void *_ctx) { H5D_bt2_ctx_t *ctx = (H5D_bt2_ctx_t *)_ctx; /* Callback context structure */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_bt2_dst_context) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ HDassert(ctx); @@ -336,7 +336,7 @@ H5D_bt2_dst_context(void *_ctx) static herr_t H5D_bt2_store(void *record, const void *_udata) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_bt2_store) + FUNC_ENTER_NOAPI_NOINIT_NOERR const H5D_bt2_find_ud_t *udata = (const H5D_bt2_find_ud_t *)_udata; /* User data */ @@ -369,7 +369,7 @@ H5D_bt2_compare(const void *_udata, const void *_rec2) const H5D_bt2_rec_t *rec2 = (const H5D_bt2_rec_t *)_rec2; /* The native record */ herr_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_bt2_compare) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(rec1); HDassert(rec2); @@ -401,7 +401,7 @@ H5D_bt2_encode(uint8_t *raw, const void *_record, void *_ctx) const H5D_bt2_rec_t *record = (const H5D_bt2_rec_t *)_record; /* The native record */ unsigned i; /* Local index varible */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_bt2_encode) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ HDassert(ctx); @@ -435,7 +435,7 @@ H5D_bt2_decode(const uint8_t *raw, void *_record, void *_ctx) H5D_bt2_rec_t *record = (H5D_bt2_rec_t *)_record; /* The native record */ unsigned i; /* Local index variable */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_bt2_decode) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ HDassert(ctx); @@ -469,7 +469,7 @@ H5D_bt2_debug(FILE *stream, const H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const H5D_bt2_ctx_ud_t *u_ctx = (const H5D_bt2_ctx_ud_t *)_u_ctx; /* User data for creating callback context */ unsigned u; /* Local index variable */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_bt2_debug) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(record); @@ -499,7 +499,7 @@ H5D_bt2_debug(FILE *stream, const H5F_t UNUSED *f, hid_t UNUSED dxpl_id, static herr_t H5D_bt2_filt_store(void *record, const void *_udata) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_bt2_filt_store) + FUNC_ENTER_NOAPI_NOINIT_NOERR const H5D_bt2_find_ud_t *udata = (const H5D_bt2_find_ud_t *)_udata; /* User data */ @@ -532,7 +532,7 @@ H5D_bt2_filt_compare(const void *_udata, const void *_rec2) const H5D_bt2_filt_rec_t *rec2 = (const H5D_bt2_filt_rec_t *)_rec2; /* The native record */ herr_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_bt2_filt_compare) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(rec1); HDassert(rec2); @@ -564,7 +564,7 @@ H5D_bt2_filt_encode(uint8_t *raw, const void *_record, void *_ctx) const H5D_bt2_filt_rec_t *record = (const H5D_bt2_filt_rec_t *)_record; /* The native record */ unsigned i; /* Local index variable */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_bt2_filt_encode) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ HDassert(ctx); @@ -600,7 +600,7 @@ H5D_bt2_filt_decode(const uint8_t *raw, void *_record, void *_ctx) H5D_bt2_filt_rec_t *record = (H5D_bt2_filt_rec_t *)_record; /* The native record */ unsigned i; /* Local index variable */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_bt2_filt_decode) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ HDassert(ctx); @@ -636,7 +636,7 @@ H5D_bt2_filt_debug(FILE *stream, const H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const H5D_bt2_ctx_ud_t *u_ctx = (const H5D_bt2_ctx_ud_t *)_u_ctx; /* User data for creating callback context */ unsigned u; /* Local index variable */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_bt2_filt_debug) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(record); @@ -674,7 +674,7 @@ H5D_bt2_crt_dbg_context(H5F_t *f, hid_t UNUSED dxpl_id, haddr_t obj_addr) H5O_layout_t layout; /* Layout message */ void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_bt2_crt_dbg_context) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(f); @@ -745,7 +745,7 @@ H5D_bt2_dst_dbg_context(void *_u_ctx) { H5D_bt2_ctx_ud_t *u_ctx = (H5D_bt2_ctx_ud_t *)_u_ctx; /* User data for creating callback context */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_bt2_dst_dbg_context) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ HDassert(u_ctx); @@ -780,7 +780,7 @@ H5D_bt2_idx_open(const H5D_chk_idx_info_t *idx_info) H5D_bt2_ctx_ud_t u_ctx; /* user data for creating context */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_bt2_idx_open) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(idx_info); @@ -824,7 +824,7 @@ H5D_bt2_idx_create(const H5D_chk_idx_info_t *idx_info) H5D_bt2_ctx_ud_t u_ctx; /* data for context call */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_bt2_idx_create) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(idx_info); @@ -892,7 +892,7 @@ H5D_bt2_idx_is_space_alloc(const H5O_storage_chunk_t *storage) { hbool_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_bt2_idx_is_space_alloc) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(storage); @@ -922,7 +922,7 @@ H5D_bt2_idx_is_space_alloc(const H5O_storage_chunk_t *storage) static herr_t H5D_bt2_mod_filt_cb(void *_record, void *_op_data, hbool_t *changed) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_bt2_mod_filt_cb) + FUNC_ENTER_NOAPI_NOINIT_NOERR *(H5D_bt2_filt_rec_t *)_record = *(H5D_bt2_filt_rec_t *)_op_data; @@ -958,7 +958,7 @@ H5D_bt2_idx_insert(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata) unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_bt2_idx_insert) + FUNC_ENTER_NOAPI_NOINIT HDassert(idx_info); HDassert(idx_info->f); @@ -1111,7 +1111,7 @@ done: static herr_t H5D_bt2_found_cb(const void *nrecord, void *op_data) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_bt2_found_cb) + FUNC_ENTER_NOAPI_NOINIT_NOERR *(H5D_bt2_rec_t *)op_data = *(const H5D_bt2_rec_t *)nrecord; @@ -1137,7 +1137,7 @@ H5D_bt2_found_cb(const void *nrecord, void *op_data) static herr_t H5D_bt2_filt_found_cb(const void *nrecord, void *op_data) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_bt2_filt_found_cb) + FUNC_ENTER_NOAPI_NOINIT_NOERR *(H5D_bt2_filt_rec_t *)op_data = *(const H5D_bt2_filt_rec_t *)nrecord; @@ -1166,7 +1166,7 @@ H5D_bt2_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata) unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_bt2_idx_get_addr) + FUNC_ENTER_NOAPI_NOINIT HDassert(idx_info); HDassert(idx_info->f); @@ -1267,7 +1267,7 @@ H5D_bt2_idx_iterate_cb(const void *_record, void *_udata) unsigned u; /* Local index variable */ int ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOERR(H5D_bt2_idx_iterate_cb, -) + FUNC_ENTER_NOAPI_NOERR /* Compose generic chunk record for callback */ if(udata->filtered) { /* filtered record */ @@ -1317,7 +1317,7 @@ H5D_bt2_idx_iterate(const H5D_chk_idx_info_t *idx_info, H5D_bt2_it_ud_t udata; /* User data for B-tree iterator callback */ int ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_bt2_idx_iterate) + FUNC_ENTER_NOAPI_NOINIT HDassert(idx_info); HDassert(idx_info->f); @@ -1380,7 +1380,7 @@ H5D_bt2_remove_cb(const void *record, void *_udata) H5D_bt2_remove_ud_t *udata = (H5D_bt2_remove_ud_t *)_udata; /* User data for removal callback */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_bt2_remove_cb) + FUNC_ENTER_NOAPI_NOINIT /* Free the space in the file for the object being removed */ H5_CHECK_OVERFLOW(udata->unfilt_size, uint32_t, hsize_t); @@ -1414,7 +1414,7 @@ H5D_bt2_filt_remove_cb(const void *_record, void *_udata) const H5D_bt2_filt_rec_t *record = (const H5D_bt2_filt_rec_t *)_record; /* The native record */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_bt2_filt_remove_cb) + FUNC_ENTER_NOAPI_NOINIT /* Free the space in the file for the object being removed */ H5_CHECK_OVERFLOW(record->nbytes, uint32_t, hsize_t); @@ -1446,7 +1446,7 @@ H5D_bt2_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t *ud unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_bt2_idx_remove) + FUNC_ENTER_NOAPI_NOINIT HDassert(idx_info); HDassert(idx_info->f); @@ -1534,7 +1534,7 @@ H5D_bt2_idx_delete(const H5D_chk_idx_info_t *idx_info) H5D_bt2_ctx_ud_t u_ctx; /* data for context call */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_bt2_idx_delete) + FUNC_ENTER_NOAPI_NOINIT /* Sanity checks */ HDassert(idx_info); @@ -1591,7 +1591,7 @@ H5D_bt2_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src, { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_bt2_idx_copy_setup) + FUNC_ENTER_NOAPI_NOINIT /* Source file */ HDassert(idx_info_src); @@ -1647,7 +1647,7 @@ H5D_bt2_idx_copy_shutdown(H5O_storage_chunk_t *storage_src, { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_bt2_idx_copy_shutdown) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(storage_src); @@ -1688,7 +1688,7 @@ H5D_bt2_idx_size(const H5D_chk_idx_info_t *idx_info, hsize_t *index_size) H5B2_t *bt2_cdset = NULL; /* Pointer to v2 B-tree structure */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5D_bt2_idx_size, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args */ HDassert(idx_info); @@ -1733,7 +1733,7 @@ done: static herr_t H5D_bt2_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_addr) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_bt2_idx_reset) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(storage); @@ -1760,7 +1760,7 @@ H5D_bt2_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_addr) static herr_t H5D_bt2_idx_dump(const H5O_storage_chunk_t *storage, FILE *stream) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_bt2_idx_dump) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(storage); HDassert(stream); @@ -1787,7 +1787,7 @@ H5D_bt2_idx_dest(const H5D_chk_idx_info_t *idx_info) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_bt2_idx_dest) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(idx_info); diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index 304e235..b3b6ab5 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -301,7 +301,7 @@ H5D_chunk_set_info_real(H5O_layout_chunk_t *layout, unsigned ndims, const hsize_ unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5D_chunk_set_info_real, FAIL) + FUNC_ENTER_NOAPI_NOINIT /* Sanity checks */ HDassert(layout); @@ -351,7 +351,7 @@ H5D_chunk_set_info(const H5D_t *dset) unsigned ndims; /* Rank of dataspace */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5D_chunk_set_info, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ HDassert(dset); @@ -397,7 +397,7 @@ H5D_chunk_construct(H5F_t UNUSED *f, H5D_t *dset) unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_chunk_construct) + FUNC_ENTER_NOAPI_NOINIT /* Sanity checks */ HDassert(f); @@ -486,7 +486,7 @@ H5D_chunk_init(H5F_t *f, hid_t dxpl_id, const H5D_t *dset, hid_t dapl_id) H5P_genplist_t *dapl; /* Data access property list object pointer */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5D_chunk_init, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ HDassert(f); @@ -570,7 +570,7 @@ H5D_chunk_is_space_alloc(const H5O_storage_t *storage) { hbool_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOFUNC(H5D_chunk_is_space_alloc) + FUNC_ENTER_NOAPI_NOERR /* Sanity checks */ HDassert(storage); @@ -625,7 +625,7 @@ H5D_chunk_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info hbool_t sel_hyper_flag; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_chunk_io_init) + FUNC_ENTER_NOAPI_NOINIT /* Get layout for dataset */ fm->layout = &(dataset->shared->layout); @@ -722,7 +722,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))) + if(NULL == (dataset->shared->cache.chunk.sel_chunks = H5SL_create(H5SL_TYPE_HSIZE, NULL))) 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; @@ -893,7 +893,7 @@ H5D_chunk_alloc(size_t size, const H5O_pline_t *pline) { void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_chunk_alloc) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(size); @@ -923,7 +923,7 @@ H5D_chunk_alloc(size_t size, const H5O_pline_t *pline) static void * H5D_chunk_xfree(void *chk, const H5O_pline_t *pline) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_chunk_xfree) + FUNC_ENTER_NOAPI_NOINIT_NOERR if(chk) { if(pline && pline->nused) @@ -955,7 +955,7 @@ H5D_chunk_realloc(void *chk, size_t size, const H5O_pline_t *pline) { void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_chunk_realloc) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(size); HDassert(pline); @@ -991,7 +991,7 @@ H5D_free_chunk_info(void *item, void UNUSED *key, void UNUSED *opdata) { H5D_chunk_info_t *chunk_info = (H5D_chunk_info_t *)item; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_free_chunk_info) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(chunk_info); @@ -1037,7 +1037,7 @@ H5D_create_chunk_map_single(H5D_chunk_map_t *fm, const H5D_io_info_t unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_create_chunk_map_single) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(fm->f_ndims > 0); @@ -1123,7 +1123,7 @@ H5D_create_chunk_file_map_hyper(H5D_chunk_map_t *fm, const H5D_io_info_t unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_create_chunk_file_map_hyper) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ assert(fm->f_ndims>0); @@ -1300,7 +1300,7 @@ H5D_create_chunk_mem_map_hyper(const H5D_chunk_map_t *fm) unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_create_chunk_mem_map_hyper) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ assert(fm->f_ndims>0); @@ -1406,7 +1406,7 @@ H5D_chunk_file_cb(void UNUSED *elem, hid_t UNUSED type_id, unsigned ndims, const unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_chunk_file_cb) + FUNC_ENTER_NOAPI_NOINIT /* Calculate the index of this chunk */ if(H5V_chunk_index(ndims, coords, fm->layout->u.chunk.dim, fm->layout->u.chunk.down_chunks, &chunk_index) < 0) @@ -1518,7 +1518,7 @@ H5D_chunk_mem_cb(void UNUSED *elem, hid_t UNUSED type_id, unsigned ndims, const hsize_t chunk_index; /* Chunk index */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_chunk_mem_cb) + FUNC_ENTER_NOAPI_NOINIT /* Calculate the index of this chunk */ if(H5V_chunk_index(ndims, coords, fm->layout->u.chunk.dim, fm->layout->u.chunk.down_chunks, &chunk_index) < 0) @@ -1594,7 +1594,7 @@ H5D_chunk_cacheable(const H5D_io_info_t *io_info, haddr_t caddr, hbool_t write_o htri_t no_filters = TRUE; htri_t ret_value = FAIL; - FUNC_ENTER_NOAPI_NOINIT(H5D_chunk_cacheable) + FUNC_ENTER_NOAPI(FAIL) HDassert(io_info); HDassert(dataset); @@ -1691,7 +1691,7 @@ H5D_chunk_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hbool_t skip_missing_chunks = FALSE; /* Whether to skip missing chunks */ herr_t ret_value = SUCCEED; /*return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_chunk_read) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(io_info); @@ -1844,7 +1844,7 @@ H5D_chunk_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, uint32_t dst_accessed_bytes = 0; /* Total accessed size in a chunk */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_chunk_write) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(io_info); @@ -1997,7 +1997,7 @@ H5D_chunk_flush(H5D_t *dset, hid_t dxpl_id) unsigned nerrors = 0; /* Count of any errors encountered when flushing chunks */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_chunk_flush) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(dset); @@ -2041,7 +2041,7 @@ H5D_chunk_io_term(const H5D_chunk_map_t *fm) { herr_t ret_value = SUCCEED; /*return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_chunk_io_term) + FUNC_ENTER_NOAPI_NOINIT /* Single element I/O vs. multiple element I/O cleanup */ if(fm->use_single) { @@ -2092,7 +2092,7 @@ H5D_chunk_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_addr) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5D_chunk_idx_reset, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ HDassert(storage); @@ -2132,7 +2132,7 @@ done: herr_t H5D_chunk_cinfo_cache_reset(H5D_chunk_cached_t *last) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_chunk_cinfo_cache_reset) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ HDassert(last); @@ -2161,7 +2161,7 @@ H5D_chunk_cinfo_cache_update(H5D_chunk_cached_t *last, const H5D_chunk_ud_t *uda { unsigned u; /* Local index variable */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_chunk_cinfo_cache_update) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ HDassert(last); @@ -2201,7 +2201,7 @@ H5D_chunk_cinfo_cache_found(const H5D_chunk_cached_t *last, H5D_chunk_ud_t *udat { hbool_t ret_value = FALSE; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_chunk_cinfo_cache_found) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ HDassert(last); @@ -2254,7 +2254,7 @@ H5D_chunk_create(H5D_t *dset /*in,out*/, hid_t dxpl_id) H5D_chk_idx_info_t idx_info; /* Chunked index info */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5D_chunk_create, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args */ HDassert(dset); @@ -2317,7 +2317,7 @@ H5D_chunk_lookup(const H5D_t *dset, hid_t dxpl_id, const hsize_t *chunk_offset, unsigned u; /* Counter */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_chunk_lookup) + FUNC_ENTER_NOAPI_NOINIT HDassert(dset); HDassert(dset->shared->layout.u.chunk.ndims > 0); @@ -2415,7 +2415,7 @@ H5D_chunk_flush_entry(const H5D_t *dset, hid_t dxpl_id, const H5D_dxpl_cache_t * hbool_t point_of_no_return = FALSE; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(H5D_chunk_flush_entry, dxpl_id, dset->oloc.addr, FAIL) + FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, dset->oloc.addr, FAIL) HDassert(dset); HDassert(dset->shared); @@ -2608,7 +2608,7 @@ H5D_chunk_cache_evict(const H5D_t *dset, hid_t dxpl_id, const H5D_dxpl_cache_t * H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_chunk_cache_evict) + FUNC_ENTER_NOAPI_NOINIT HDassert(dset); HDassert(dxpl_cache); @@ -2702,7 +2702,7 @@ H5D_chunk_cache_prune(const H5D_t *dset, hid_t dxpl_id, int nerrors = 0; /* Accumulated error count during preemptions */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_chunk_cache_prune) + FUNC_ENTER_NOAPI_NOINIT /* * Preemption is accomplished by having multiple pointers (currently two) @@ -2831,7 +2831,7 @@ H5D_chunk_lock(const H5D_io_info_t *io_info, H5D_chunk_ud_t *udata, unsigned u; /*counters */ void *ret_value; /*return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_chunk_lock) + FUNC_ENTER_NOAPI(NULL) HDassert(io_info); HDassert(io_info->dxpl_cache); @@ -3229,7 +3229,7 @@ H5D_chunk_unlock(const H5D_io_info_t *io_info, const H5D_chunk_ud_t *udata, const H5D_rdcc_t *rdcc = &(io_info->dset->shared->cache.chunk); herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_chunk_unlock) + FUNC_ENTER_NOAPI(FAIL) HDassert(io_info); HDassert(udata); @@ -3336,7 +3336,7 @@ H5D_chunk_allocated_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) { hsize_t *nbytes = (hsize_t *)_udata; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_chunk_allocated_cb) + FUNC_ENTER_NOAPI_NOINIT_NOERR *(hsize_t *)nbytes += chunk_rec->nbytes; @@ -3369,7 +3369,7 @@ H5D_chunk_allocated(H5D_t *dset, hid_t dxpl_id, hsize_t *nbytes) hsize_t chunk_bytes = 0; /* Number of bytes allocated for chunks */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5D_chunk_allocated, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert(dset); HDassert(dset->shared); @@ -3471,7 +3471,7 @@ H5D_chunk_allocate(H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite, hid_t data_dxpl_id; /* DXPL ID to use for raw data I/O operations */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(H5D_chunk_allocate, dxpl_id, dset->oloc.addr, FAIL) + FUNC_ENTER_NOAPI_TAG(dxpl_id, dset->oloc.addr, FAIL) /* Check args */ HDassert(dset && H5D_CHUNKED == layout->type); @@ -3507,7 +3507,7 @@ H5D_chunk_allocate(H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite, #ifdef H5_HAVE_PARALLEL /* Retrieve MPI parameters */ - if(IS_H5FD_MPI(dset->oloc.file)) { + if(H5F_HAS_FEATURE(dset->oloc.file, H5FD_FEAT_HAS_MPI)) { /* Get the MPI communicator */ if(MPI_COMM_NULL == (mpi_comm = H5F_mpi_get_comm(dset->oloc.file))) HGOTO_ERROR(H5E_INTERNAL, H5E_MPI, FAIL, "Can't retrieve MPI communicator") @@ -3924,7 +3924,7 @@ H5D_chunk_update_old_edge_chunks(H5D_t *dset, hid_t dxpl_id, hsize_t old_dim[]) hbool_t carry; /* Flag to indicate that chunk increment carrys to higher dimension (sorta) */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5D_chunk_update_old_edge_chunks, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args */ HDassert(dset && H5D_CHUNKED == layout->type); @@ -4113,13 +4113,19 @@ H5D_chunk_prune_fill(H5D_chunk_it_ud1_t *udata, hbool_t new_unfilt_chunk) H5S_sel_iter_t chunk_iter; /* Memory selection iteration info */ hssize_t sel_nelmts; /* Number of elements in selection */ hsize_t count[H5O_LAYOUT_NDIMS]; /* Element count of hyperslab */ + size_t chunk_size; /*size of a chunk */ void *chunk; /* The file chunk */ H5D_chunk_ud_t chk_udata; /* User data for locking chunk */ uint32_t bytes_accessed; /* Bytes accessed in chunk */ + hbool_t chunk_iter_init = FALSE; /* Whether the chunk iterator has been initialized */ unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_chunk_prune_fill) + FUNC_ENTER_NOAPI_NOINIT + + /* Get the chunk's size */ + HDassert(layout->u.chunk.size > 0); + H5_ASSIGN_OVERFLOW(chunk_size, layout->u.chunk.size, uint32_t, size_t); /* Get the info for the chunk in the file */ if(H5D_chunk_lookup(dset, io_info->dxpl_id, chunk_offset, @@ -4138,7 +4144,7 @@ H5D_chunk_prune_fill(H5D_chunk_it_ud1_t *udata, hbool_t new_unfilt_chunk) if(H5D_fill_init(&udata->fb_info, NULL, NULL, NULL, NULL, NULL, &dset->shared->dcpl_cache.fill, dset->shared->type, dset->shared->type_id, (size_t)udata->elmts_per_chunk, - io_info->dxpl_cache->max_temp_buf, io_info->dxpl_id) < 0) + chunk_size, io_info->dxpl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't initialize fill buffer info") udata->fb_info_init = TRUE; } /* end if */ @@ -4182,16 +4188,11 @@ H5D_chunk_prune_fill(H5D_chunk_it_ud1_t *udata, hbool_t new_unfilt_chunk) /* Create a selection iterator for scattering the elements to memory buffer */ if(H5S_select_iter_init(&chunk_iter, udata->chunk_space, layout->u.chunk.dim[rank]) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize chunk selection information") + chunk_iter_init = TRUE; /* Scatter the data into memory */ - if(H5D_scatter_mem(udata->fb_info.fill_buf, udata->chunk_space, &chunk_iter, (size_t)sel_nelmts, io_info->dxpl_cache, chunk/*out*/) < 0) { - H5S_SELECT_ITER_RELEASE(&chunk_iter); + if(H5D_scatter_mem(udata->fb_info.fill_buf, udata->chunk_space, &chunk_iter, (size_t)sel_nelmts, io_info->dxpl_cache, chunk/*out*/) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "scatter failed") - } /* end if */ - - /* Release the selection iterator */ - if(H5S_SELECT_ITER_RELEASE(&chunk_iter) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't release selection iterator") /* The number of bytes accessed in the chunk */ @@ -4204,6 +4205,10 @@ H5D_chunk_prune_fill(H5D_chunk_it_ud1_t *udata, hbool_t new_unfilt_chunk) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "unable to unlock raw data chunk") done: + /* Release the selection iterator */ + if(chunk_iter_init && H5S_SELECT_ITER_RELEASE(&chunk_iter) < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't release selection iterator") + FUNC_LEAVE_NOAPI(ret_value) } /* H5D_chunk_prune_fill */ @@ -4346,7 +4351,7 @@ H5D_chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dim) int i; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5D_chunk_prune_by_extent, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args */ HDassert(dset && H5D_CHUNKED == layout->type); @@ -4701,7 +4706,7 @@ H5D_chunk_addrmap_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) hsize_t chunk_index; int ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_chunk_addrmap_cb) + FUNC_ENTER_NOAPI_NOINIT /* Compute the index for this chunk */ if(H5V_chunk_index(rank, chunk_rec->offset, udata->common.layout->dim, udata->common.layout->down_chunks, &chunk_index) < 0) @@ -4736,7 +4741,7 @@ H5D_chunk_addrmap(const H5D_io_info_t *io_info, haddr_t chunk_addr[]) H5D_chunk_it_ud2_t udata; /* User data for iteration callback */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5D_chunk_addrmap, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert(dset); HDassert(dset->shared); @@ -4800,7 +4805,7 @@ H5D_chunk_delete(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_storage_t *storage) htri_t exists; /* Flag if header message of interest exists */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5D_chunk_delete, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ HDassert(f); @@ -4890,7 +4895,7 @@ H5D_chunk_update_cache(H5D_t *dset, hid_t dxpl_id) unsigned rank; /*current # of dimensions */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5D_chunk_update_cache, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args */ HDassert(dset && H5D_CHUNKED == dset->shared->layout.type); @@ -5025,7 +5030,7 @@ H5D_chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) int ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_chunk_copy_cb) + FUNC_ENTER_NOAPI_NOINIT /* Get 'size_t' local value for number of bytes in chunk */ H5_ASSIGN_OVERFLOW(nbytes, chunk_rec->nbytes, uint32_t, size_t); @@ -5232,7 +5237,7 @@ H5D_chunk_copy(H5F_t *f_src, H5O_storage_chunk_t *storage_src, hbool_t copy_setup_done = FALSE; /* Indicate that 'copy setup' is done */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5D_chunk_copy, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args */ HDassert(f_src); @@ -5490,7 +5495,7 @@ H5D_chunk_bh_info(H5F_t *f, hid_t dxpl_id, H5O_layout_t *layout, H5D_chk_idx_info_t idx_info; /* Chunked index info */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5D_chunk_bh_info, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args */ HDassert(f); @@ -5545,7 +5550,7 @@ H5D_chunk_dump_index_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) { H5D_chunk_it_ud4_t *udata = (H5D_chunk_it_ud4_t *)_udata; /* User data from caller */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_chunk_dump_index_cb) + FUNC_ENTER_NOAPI_NOINIT_NOERR if(udata->stream) { unsigned u; /* Local index variable */ @@ -5589,7 +5594,7 @@ H5D_chunk_dump_index(H5D_t *dset, hid_t dxpl_id, FILE *stream) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5D_chunk_dump_index, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ HDassert(dset); @@ -5659,7 +5664,7 @@ H5D_chunk_dest(H5F_t *f, hid_t dxpl_id, H5D_t *dset) int nerrors = 0; /* Accumulated count of errors */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(H5D_chunk_dest, dxpl_id, dset->oloc.addr, FAIL) + FUNC_ENTER_NOAPI_TAG(dxpl_id, dset->oloc.addr, FAIL) HDassert(f); HDassert(dset); @@ -5734,7 +5739,7 @@ H5D_chunk_stats(const H5D_t *dset, hbool_t headers) char ascii[32]; herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5D_chunk_stats, FAIL) + FUNC_ENTER_NOAPI_NOERR(FAIL) if (!H5DEBUG(AC)) HGOTO_DONE(SUCCEED) @@ -5802,7 +5807,7 @@ H5D_nonexistent_readvv_cb(hsize_t UNUSED dst_off, hsize_t src_off, size_t len, hbool_t fb_info_init = FALSE; /* Whether the fill value buffer has been initialized */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_nonexistent_readvv_cb) + FUNC_ENTER_NOAPI_NOINIT /* Initialize the fill value buffer */ if(H5D_fill_init(&fb_info, (udata->rbuf + src_off), NULL, NULL, NULL, NULL, @@ -5852,7 +5857,7 @@ H5D_nonexistent_readvv(const H5D_io_info_t *io_info, H5D_chunk_readvv_ud_t udata; /* User data for H5V_opvv() operator */ ssize_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_nonexistent_readvv) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(io_info); @@ -5901,7 +5906,7 @@ H5D_chunk_is_partial_edge_chunk(const hsize_t offset[], const H5D_t *dset, unsigned i; /* Local index variables */ htri_t ret_value = FALSE; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_chunk_is_partial_edge_chunk) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(offset); @@ -5958,7 +5963,7 @@ H5D_chunk_find_flush_dep(const H5D_rdcc_t *rdcc, unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_chunk_find_flush_dep) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(rdcc); @@ -6027,7 +6032,7 @@ H5D_chunk_create_flush_dep(const H5D_rdcc_t *rdcc, H5D_rdcc_ent_t *ent = NULL; /* Cache entry */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_chunk_create_flush_dep) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(rdcc); @@ -6071,7 +6076,7 @@ H5D_chunk_update_flush_dep(const H5D_rdcc_t *rdcc, H5D_rdcc_ent_t *ent = NULL; /* Cache entry */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_chunk_update_flush_dep) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(rdcc); diff --git a/src/H5Dcompact.c b/src/H5Dcompact.c index 1e9c7ea..a2682d8 100644 --- a/src/H5Dcompact.c +++ b/src/H5Dcompact.c @@ -123,7 +123,7 @@ H5D_compact_fill(H5D_t *dset, hid_t dxpl_id) hbool_t fb_info_init = FALSE; /* Whether the fill value buffer has been initialized */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5D_compact_fill, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args */ HDassert(TRUE == H5P_isa_class(dxpl_id, H5P_DATASET_XFER)); @@ -180,7 +180,7 @@ H5D_compact_construct(H5F_t *f, H5D_t *dset) int i; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_compact_construct) + FUNC_ENTER_NOAPI_NOINIT /* Sanity checks */ HDassert(f); @@ -234,7 +234,7 @@ done: static hbool_t H5D_compact_is_space_alloc(const H5O_storage_t UNUSED *storage) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_compact_is_space_alloc) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity checks */ HDassert(storage); @@ -261,7 +261,7 @@ H5D_compact_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t UNUSED * hsize_t UNUSED nelmts, const H5S_t UNUSED *file_space, const H5S_t UNUSED *mem_space, H5D_chunk_map_t UNUSED *cm) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_compact_io_init) + FUNC_ENTER_NOAPI_NOINIT_NOERR io_info->store->compact.buf = io_info->dset->shared->layout.storage.u.compact.buf; io_info->store->compact.dirty = &io_info->dset->shared->layout.storage.u.compact.dirty; @@ -295,7 +295,7 @@ H5D_compact_readvv(const H5D_io_info_t *io_info, { ssize_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_compact_readvv) + FUNC_ENTER_NOAPI_NOINIT HDassert(io_info); @@ -336,7 +336,7 @@ H5D_compact_writevv(const H5D_io_info_t *io_info, { ssize_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_compact_writevv) + FUNC_ENTER_NOAPI_NOINIT HDassert(io_info); @@ -369,7 +369,7 @@ H5D_compact_flush(H5D_t *dset, hid_t dxpl_id) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_compact_flush) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(dset); @@ -419,7 +419,7 @@ H5D_compact_copy(H5F_t *f_src, H5O_storage_compact_t *storage_src, H5F_t *f_dst, hid_t buf_sid = -1; /* ID for buffer dataspace */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5D_compact_copy, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args */ HDassert(f_src); diff --git a/src/H5Dcontig.c b/src/H5Dcontig.c index 9a6e08f..674582d 100644 --- a/src/H5Dcontig.c +++ b/src/H5Dcontig.c @@ -164,7 +164,7 @@ H5D_contig_alloc(H5F_t *f, hid_t dxpl_id, H5O_storage_contig_t *storage /*out */ { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5D_contig_alloc, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* check args */ HDassert(f); @@ -213,7 +213,7 @@ H5D_contig_fill(H5D_t *dset, hid_t dxpl_id) hid_t my_dxpl_id; /* DXPL ID to use for this operation */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5D_contig_fill, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args */ HDassert(TRUE == H5P_isa_class(dxpl_id, H5P_DATASET_XFER)); @@ -225,7 +225,7 @@ H5D_contig_fill(H5D_t *dset, hid_t dxpl_id) #ifdef H5_HAVE_PARALLEL /* Retrieve MPI parameters */ - if(IS_H5FD_MPI(dset->oloc.file)) { + if(H5F_HAS_FEATURE(dset->oloc.file, H5FD_FEAT_HAS_MPI)) { /* Get the MPI communicator */ if(MPI_COMM_NULL == (mpi_comm = H5F_mpi_get_comm(dset->oloc.file))) HGOTO_ERROR(H5E_INTERNAL, H5E_MPI, FAIL, "Can't retrieve MPI communicator") @@ -360,7 +360,7 @@ H5D_contig_delete(H5F_t *f, hid_t dxpl_id, const H5O_storage_t *storage) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5D_contig_delete, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* check args */ HDassert(f); @@ -390,7 +390,7 @@ done: haddr_t H5D_contig_get_addr(const H5D_t *dset) { - FUNC_ENTER_NOAPI_NOFUNC(H5D_contig_get_addr) + FUNC_ENTER_NOAPI_NOERR /* check args */ HDassert(dset); @@ -426,7 +426,7 @@ H5D_contig_construct(H5F_t *f, H5D_t *dset) int i; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_contig_construct) + FUNC_ENTER_NOAPI_NOINIT /* Sanity checks */ HDassert(f); @@ -489,7 +489,7 @@ H5D_contig_is_space_alloc(const H5O_storage_t *storage) { hbool_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_contig_is_space_alloc) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity checks */ HDassert(storage); @@ -518,7 +518,7 @@ H5D_contig_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t UNUSED *t hsize_t UNUSED nelmts, const H5S_t UNUSED *file_space, const H5S_t UNUSED *mem_space, H5D_chunk_map_t UNUSED *cm) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_contig_io_init) + FUNC_ENTER_NOAPI_NOINIT_NOERR io_info->store->contig.dset_addr = io_info->dset->shared->layout.storage.u.contig.addr; io_info->store->contig.dset_size = io_info->dset->shared->layout.storage.u.contig.size; @@ -546,7 +546,7 @@ H5D_contig_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, { herr_t ret_value = SUCCEED; /*return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_contig_read) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(io_info); @@ -583,7 +583,7 @@ H5D_contig_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, { herr_t ret_value = SUCCEED; /*return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_contig_write) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(io_info); @@ -626,7 +626,7 @@ H5D_contig_write_one(H5D_io_info_t *io_info, hsize_t offset, size_t size) size_t mem_curr_seq = 0; /* "Current sequence" in memory */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_contig_write_one) + FUNC_ENTER_NOAPI_NOINIT HDassert(io_info); @@ -668,7 +668,7 @@ H5D_contig_readvv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len, hsize_t max_data; /* Actual maximum size of data to cache */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_contig_readvv_sieve_cb) + FUNC_ENTER_NOAPI_NOINIT /* Stash local copies of these value */ if(dset_contig->sieve_buf != NULL) { @@ -824,7 +824,7 @@ H5D_contig_readvv_cb(hsize_t dst_off, hsize_t src_off, size_t len, void *_udata) H5D_contig_readvv_ud_t *udata = (H5D_contig_readvv_ud_t *)_udata; /* User data for H5V_opvv() operator */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_contig_readvv_cb) + FUNC_ENTER_NOAPI_NOINIT /* Write data */ if(H5F_block_read(udata->file, H5FD_MEM_DRAW, (udata->dset_addr + dst_off), @@ -861,7 +861,7 @@ H5D_contig_readvv(const H5D_io_info_t *io_info, { ssize_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_contig_readvv) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(io_info); @@ -939,7 +939,7 @@ H5D_contig_writevv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len, hsize_t max_data; /* Actual maximum size of data to cache */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_contig_writevv_sieve_cb) + FUNC_ENTER_NOAPI_NOINIT /* Stash local copies of these values */ if(dset_contig->sieve_buf != NULL) { @@ -1145,7 +1145,7 @@ H5D_contig_writevv_cb(hsize_t dst_off, hsize_t src_off, size_t len, void *_udata H5D_contig_writevv_ud_t *udata = (H5D_contig_writevv_ud_t *)_udata; /* User data for H5V_opvv() operator */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_contig_writevv_cb) + FUNC_ENTER_NOAPI_NOINIT /* Write data */ if(H5F_block_write(udata->file, H5FD_MEM_DRAW, (udata->dset_addr + dst_off), len, udata->dxpl_id, (udata->wbuf + src_off)) < 0) @@ -1181,7 +1181,7 @@ H5D_contig_writevv(const H5D_io_info_t *io_info, { ssize_t ret_value; /* Return value (Size of sequence in bytes) */ - FUNC_ENTER_NOAPI_NOINIT(H5D_contig_writevv) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(io_info); @@ -1247,7 +1247,7 @@ H5D_contig_flush(H5D_t *dset, hid_t dxpl_id) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_contig_flush) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(dset); @@ -1306,7 +1306,7 @@ H5D_contig_copy(H5F_t *f_src, const H5O_storage_contig_t *storage_src, hbool_t fix_ref = FALSE; /* Flag to indicate that ref values should be fixed */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5D_contig_copy, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args */ HDassert(f_src); diff --git a/src/H5Ddbg.c b/src/H5Ddbg.c index fa4c54c..9b27c9c 100644 --- a/src/H5Ddbg.c +++ b/src/H5Ddbg.c @@ -77,7 +77,7 @@ DESCRIPTION static herr_t H5D_init_dbg_interface(void) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_init_dbg_interface) + FUNC_ENTER_NOAPI_NOINIT_NOERR FUNC_LEAVE_NOAPI(H5D_init()) } /* H5D_init_dbg_interface() */ @@ -104,7 +104,7 @@ H5Ddebug(hid_t dset_id) H5D_t *dset; /* Dataset to debug */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Ddebug, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", dset_id); /* Check args */ diff --git a/src/H5Ddeprec.c b/src/H5Ddeprec.c index b31f23b..7e65149 100644 --- a/src/H5Ddeprec.c +++ b/src/H5Ddeprec.c @@ -101,7 +101,7 @@ DESCRIPTION static herr_t H5D_init_deprec_interface(void) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_init_deprec_interface) + FUNC_ENTER_NOAPI_NOINIT_NOERR FUNC_LEAVE_NOAPI(H5D_init()) } /* H5D_init_deprec_interface() */ @@ -146,7 +146,7 @@ H5Dcreate1(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, const H5S_t *space; /* Dataspace for dataset */ hid_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Dcreate1, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE5("i", "i*siii", loc_id, name, type_id, space_id, dcpl_id); /* Check arguments */ @@ -165,7 +165,7 @@ H5Dcreate1(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not dataset create property list ID") /* Build and open the new dataset */ - if(NULL == (dset = H5D_create_named(&loc, name, type_id, space, H5P_LINK_CREATE_DEFAULT, dcpl_id, H5P_DATASET_ACCESS_DEFAULT, H5AC_dxpl_id))) + if(NULL == (dset = H5D__create_named(&loc, name, type_id, space, H5P_LINK_CREATE_DEFAULT, dcpl_id, H5P_DATASET_ACCESS_DEFAULT, H5AC_dxpl_id))) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to create dataset") /* Register the new dataset to get an ID for it */ @@ -212,7 +212,7 @@ H5Dopen1(hid_t loc_id, const char *name) hid_t dxpl_id = H5AC_dxpl_id; /* dxpl to use to open datset */ hid_t ret_value; - FUNC_ENTER_API(H5Dopen1, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("i", "i*s", loc_id, name); /* Check args */ @@ -283,7 +283,7 @@ H5Dextend(hid_t dset_id, const hsize_t size[]) H5D_t *dset; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Dextend, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*h", dset_id, size); /* Check args */ @@ -323,7 +323,7 @@ H5D_extend(H5D_t *dataset, const hsize_t *size, hid_t dxpl_id) H5O_fill_t *fill; /* Dataset's fill value */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_extend) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(dataset); diff --git a/src/H5Dearray.c b/src/H5Dearray.c index ba965a0..72e07e0 100644 --- a/src/H5Dearray.c +++ b/src/H5Dearray.c @@ -229,7 +229,7 @@ H5D_earray_crt_context(void *_udata) H5D_earray_ctx_ud_t *udata = (H5D_earray_ctx_ud_t *)_udata; /* User data for extensible array context */ void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_earray_crt_context) + FUNC_ENTER_NOAPI_NOINIT /* Sanity checks */ HDassert(udata); @@ -276,7 +276,7 @@ H5D_earray_dst_context(void *_ctx) { H5D_earray_ctx_t *ctx = (H5D_earray_ctx_t *)_ctx; /* Extensible array callback context */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_earray_dst_context) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity checks */ HDassert(ctx); @@ -306,7 +306,7 @@ H5D_earray_fill(void *nat_blk, size_t nelmts) { haddr_t fill_val = H5D_EARRAY_FILL; /* Value to fill elements with */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_earray_fill) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity checks */ HDassert(nat_blk); @@ -337,7 +337,7 @@ H5D_earray_encode(void *raw, const void *_elmt, size_t nelmts, void *_ctx) H5D_earray_ctx_t *ctx = (H5D_earray_ctx_t *)_ctx; /* Extensible array callback context */ const haddr_t *elmt = (const haddr_t *)_elmt; /* Convenience pointer to native elements */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_earray_encode) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity checks */ HDassert(raw); @@ -382,7 +382,7 @@ H5D_earray_decode(const void *_raw, void *_elmt, size_t nelmts, void *_ctx) haddr_t *elmt = (haddr_t *)_elmt; /* Convenience pointer to native elements */ const uint8_t *raw = (const uint8_t *)_raw; /* Convenience pointer to raw elements */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_earray_decode) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity checks */ HDassert(raw); @@ -425,7 +425,7 @@ H5D_earray_debug(FILE *stream, int indent, int fwidth, hsize_t idx, { char temp_str[128]; /* Temporary string, for formatting */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_earray_debug) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity checks */ HDassert(stream); @@ -458,7 +458,7 @@ H5D_earray_filt_fill(void *nat_blk, size_t nelmts) { H5D_earray_filt_elmt_t fill_val = H5D_EARRAY_FILT_FILL; /* Value to fill elements with */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_earray_filt_fill) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity checks */ HDassert(nat_blk); @@ -491,7 +491,7 @@ H5D_earray_filt_encode(void *_raw, const void *_elmt, size_t nelmts, void *_ctx) uint8_t *raw = (uint8_t *)_raw; /* Convenience pointer to raw elements */ const H5D_earray_filt_elmt_t *elmt = (const H5D_earray_filt_elmt_t *)_elmt; /* Convenience pointer to native elements */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_earray_filt_encode) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity checks */ HDassert(raw); @@ -538,7 +538,7 @@ H5D_earray_filt_decode(const void *_raw, void *_elmt, size_t nelmts, void *_ctx) H5D_earray_filt_elmt_t *elmt = (H5D_earray_filt_elmt_t *)_elmt; /* Convenience pointer to native elements */ const uint8_t *raw = (const uint8_t *)_raw; /* Convenience pointer to raw elements */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_earray_filt_decode) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity checks */ HDassert(raw); @@ -584,7 +584,7 @@ H5D_earray_filt_debug(FILE *stream, int indent, int fwidth, hsize_t idx, const H5D_earray_filt_elmt_t *elmt = (const H5D_earray_filt_elmt_t *)_elmt; /* Convenience pointer to native elements */ char temp_str[128]; /* Temporary string, for formatting */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_earray_filt_debug) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity checks */ HDassert(stream); @@ -621,7 +621,7 @@ H5D_earray_crt_dbg_context(H5F_t *f, hid_t dxpl_id, haddr_t obj_addr) H5O_layout_t layout; /* Layout message */ void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_earray_crt_dbg_context) + FUNC_ENTER_NOAPI_NOINIT HDassert(f); HDassert(H5F_addr_defined(obj_addr)); @@ -691,7 +691,7 @@ H5D_earray_dst_dbg_context(void *_dbg_ctx) { H5D_earray_ctx_ud_t *dbg_ctx = (H5D_earray_ctx_ud_t *)_dbg_ctx; /* Context for extensible array callback */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_earray_dst_dbg_context) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(dbg_ctx); @@ -723,7 +723,7 @@ H5D_earray_idx_depend(const H5D_chk_idx_info_t *idx_info) H5O_t *oh = NULL; /* Dataset's object header */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_earray_idx_depend) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(idx_info); @@ -780,7 +780,7 @@ H5D_earray_idx_undepend(const H5D_chk_idx_info_t *idx_info) H5O_t *oh = NULL; /* Dataset's object header */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_earray_idx_undepend) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(idx_info); @@ -840,7 +840,7 @@ H5D_earray_idx_open(const H5D_chk_idx_info_t *idx_info) H5D_earray_ctx_ud_t udata; /* User data for extensible array open call */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_earray_idx_open) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(idx_info); @@ -895,7 +895,7 @@ H5D_earray_idx_init(const H5D_chk_idx_info_t *idx_info, const H5S_t *space, unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_earray_idx_init) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(idx_info); @@ -965,7 +965,7 @@ H5D_earray_idx_create(const H5D_chk_idx_info_t *idx_info) H5D_earray_ctx_ud_t udata; /* User data for extensible array create call */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_earray_idx_create) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(idx_info); @@ -1045,7 +1045,7 @@ H5D_earray_idx_is_space_alloc(const H5O_storage_chunk_t *storage) { hbool_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_earray_idx_is_space_alloc) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(storage); @@ -1077,7 +1077,7 @@ H5D_earray_idx_insert(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata) hsize_t idx; /* Array index of chunk */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_earray_idx_insert) + FUNC_ENTER_NOAPI_NOINIT HDassert(idx_info); HDassert(idx_info->f); @@ -1243,7 +1243,7 @@ H5D_earray_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udat hsize_t idx; /* Array index of chunk */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_earray_idx_get_addr) + FUNC_ENTER_NOAPI_NOINIT HDassert(idx_info); HDassert(idx_info->f); @@ -1328,7 +1328,7 @@ H5D_earray_idx_resize(H5O_layout_chunk_t *layout) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_earray_idx_resize) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(layout); @@ -1375,7 +1375,7 @@ H5D_earray_idx_iterate(const H5D_chk_idx_info_t *idx_info, H5EA_stat_t ea_stat; /* Extensible array statistics */ int ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_earray_idx_iterate) + FUNC_ENTER_NOAPI_NOINIT HDassert(idx_info); HDassert(idx_info->f); @@ -1484,7 +1484,7 @@ H5D_earray_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t hsize_t idx; /* Array index of chunk */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_earray_idx_remove) + FUNC_ENTER_NOAPI_NOINIT HDassert(idx_info); HDassert(idx_info->f); @@ -1591,7 +1591,7 @@ H5D_earray_idx_delete_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) H5D_earray_ud_t *udata = (H5D_earray_ud_t *)_udata; /* User data for callback */ int ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_earray_idx_delete_cb) + FUNC_ENTER_NOAPI_NOINIT /* Sanity checks */ HDassert(chunk_rec); @@ -1633,7 +1633,7 @@ H5D_earray_idx_delete(const H5D_chk_idx_info_t *idx_info) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_earray_idx_delete) + FUNC_ENTER_NOAPI_NOINIT /* Sanity checks */ HDassert(idx_info); @@ -1695,7 +1695,7 @@ H5D_earray_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src, { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_earray_idx_copy_setup) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(idx_info_src); @@ -1751,7 +1751,7 @@ H5D_earray_idx_copy_shutdown(H5O_storage_chunk_t *storage_src, { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_earray_idx_copy_shutdown) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(storage_src); @@ -1792,7 +1792,7 @@ H5D_earray_idx_size(const H5D_chk_idx_info_t *idx_info, hsize_t *index_size) H5EA_stat_t ea_stat; /* Extensible array statistics */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5D_earray_idx_size, FAIL) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(idx_info); @@ -1848,7 +1848,7 @@ done: static herr_t H5D_earray_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_addr) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_earray_idx_reset) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(storage); @@ -1885,7 +1885,7 @@ H5D_earray_idx_support(const H5D_chk_idx_info_t *idx_info, hsize_t idx; /* Array index of chunk */ herr_t ret_value = TRUE; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_earray_idx_support) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(idx_info); @@ -1955,7 +1955,7 @@ H5D_earray_idx_unsupport(const H5D_chk_idx_info_t *idx_info, hsize_t idx; /* Array index of chunk */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_earray_idx_unsupport) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(idx_info); @@ -2019,7 +2019,7 @@ done: static herr_t H5D_earray_idx_dump(const H5O_storage_chunk_t *storage, FILE *stream) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_earray_idx_dump) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(storage); @@ -2048,7 +2048,7 @@ H5D_earray_idx_dest(const H5D_chk_idx_info_t *idx_info) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_earray_idx_dest) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(idx_info); diff --git a/src/H5Defl.c b/src/H5Defl.c index bcb47a2..51e8813 100644 --- a/src/H5Defl.c +++ b/src/H5Defl.c @@ -136,7 +136,7 @@ H5D_efl_construct(H5F_t *f, H5D_t *dset) int i; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_efl_construct) + FUNC_ENTER_NOAPI_NOINIT /* Sanity checks */ HDassert(f); @@ -200,7 +200,7 @@ done: hbool_t H5D_efl_is_space_alloc(const H5O_storage_t UNUSED *storage) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_efl_is_space_alloc) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity checks */ HDassert(storage); @@ -227,7 +227,7 @@ H5D_efl_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t UNUSED *type hsize_t UNUSED nelmts, const H5S_t UNUSED *file_space, const H5S_t UNUSED *mem_space, H5D_chunk_map_t UNUSED *cm) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_efl_io_init) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDmemcpy(&io_info->store->efl, &(io_info->dset->shared->dcpl_cache.efl), sizeof(H5O_efl_t)); @@ -267,7 +267,7 @@ H5D_efl_read(const H5O_efl_t *efl, haddr_t addr, size_t size, uint8_t *buf) size_t u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_efl_read) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(efl && efl->nused>0); @@ -353,7 +353,7 @@ H5D_efl_write(const H5O_efl_t *efl, haddr_t addr, size_t size, const uint8_t *bu size_t u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_efl_write) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(efl && efl->nused > 0); @@ -428,7 +428,7 @@ H5D_efl_readvv_cb(hsize_t dst_off, hsize_t src_off, size_t len, void *_udata) H5D_efl_readvv_ud_t *udata = (H5D_efl_readvv_ud_t *)_udata; /* User data for H5V_opvv() operator */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_efl_readvv_cb) + FUNC_ENTER_NOAPI_NOINIT /* Read data */ if(H5D_efl_read(udata->efl, dst_off, len, (udata->rbuf + src_off)) < 0) @@ -462,7 +462,7 @@ H5D_efl_readvv(const H5D_io_info_t *io_info, H5D_efl_readvv_ud_t udata; /* User data for H5V_opvv() operator */ ssize_t ret_value; /* Return value (Total size of sequence in bytes) */ - FUNC_ENTER_NOAPI_NOINIT(H5D_efl_readvv) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(io_info); @@ -508,7 +508,7 @@ H5D_efl_writevv_cb(hsize_t dst_off, hsize_t src_off, size_t len, void *_udata) H5D_efl_writevv_ud_t *udata = (H5D_efl_writevv_ud_t *)_udata; /* User data for H5V_opvv() operator */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_efl_writevv_cb) + FUNC_ENTER_NOAPI_NOINIT /* Write data */ if(H5D_efl_write(udata->efl, dst_off, len, (udata->wbuf + src_off)) < 0) @@ -542,7 +542,7 @@ H5D_efl_writevv(const H5D_io_info_t *io_info, H5D_efl_writevv_ud_t udata; /* User data for H5V_opvv() operator */ ssize_t ret_value; /* Return value (Total size of sequence in bytes) */ - FUNC_ENTER_NOAPI_NOINIT(H5D_efl_writevv) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(io_info); @@ -587,7 +587,7 @@ H5D_efl_bh_info(H5F_t *f, hid_t dxpl_id, H5O_efl_t *efl, hsize_t *heap_size) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5D_efl_bh_info, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args */ HDassert(f); diff --git a/src/H5Dfarray.c b/src/H5Dfarray.c index 196fc43..7786a76 100644 --- a/src/H5Dfarray.c +++ b/src/H5Dfarray.c @@ -239,7 +239,7 @@ H5D_farray_crt_context(void *_udata) H5D_farray_ctx_ud_t *udata = (H5D_farray_ctx_ud_t *)_udata; /* User data for fixed array context */ void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_farray_crt_context) + FUNC_ENTER_NOAPI_NOINIT /* Sanity checks */ HDassert(udata); @@ -286,7 +286,7 @@ H5D_farray_dst_context(void *_ctx) { H5D_farray_ctx_t *ctx = (H5D_farray_ctx_t *)_ctx; /* Fixed array callback context */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_farray_dst_context) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity checks */ HDassert(ctx); @@ -316,7 +316,7 @@ H5D_farray_fill(void *nat_blk, size_t nelmts) { haddr_t fill_val = H5D_FARRAY_FILL; /* Value to fill elements with */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_farray_fill) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity checks */ HDassert(nat_blk); @@ -347,7 +347,7 @@ H5D_farray_encode(void *raw, const void *_elmt, size_t nelmts, void *_ctx) H5D_farray_ctx_t *ctx = (H5D_farray_ctx_t *)_ctx; /* Fixed array callback context */ const haddr_t *elmt = (const haddr_t *)_elmt; /* Convenience pointer to native elements */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_farray_encode) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity checks */ HDassert(raw); @@ -392,7 +392,7 @@ H5D_farray_decode(const void *_raw, void *_elmt, size_t nelmts, void *_ctx) haddr_t *elmt = (haddr_t *)_elmt; /* Convenience pointer to native elements */ const uint8_t *raw = (const uint8_t *)_raw; /* Convenience pointer to raw elements */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_farray_decode) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity checks */ HDassert(raw); @@ -435,7 +435,7 @@ H5D_farray_debug(FILE *stream, int indent, int fwidth, hsize_t idx, { char temp_str[128]; /* Temporary string, for formatting */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_farray_debug) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity checks */ HDassert(stream); @@ -473,7 +473,7 @@ H5D_farray_crt_dbg_context(H5F_t *f, hid_t dxpl_id, haddr_t obj_addr) H5O_layout_t layout; /* Layout message */ void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_farray_crt_dbg_context) + FUNC_ENTER_NOAPI_NOINIT HDassert(f); HDassert(H5F_addr_defined(obj_addr)); @@ -544,7 +544,7 @@ H5D_farray_dst_dbg_context(void *_dbg_ctx) { H5D_farray_ctx_ud_t *dbg_ctx = (H5D_farray_ctx_ud_t *)_dbg_ctx; /* Context for fixed array callback */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_farray_dst_dbg_context) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(dbg_ctx); @@ -573,7 +573,7 @@ H5D_farray_filt_fill(void *nat_blk, size_t nelmts) { H5D_farray_filt_elmt_t fill_val = H5D_FARRAY_FILT_FILL; /* Value to fill elements with */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_farray_filt_fill) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity checks */ HDassert(nat_blk); @@ -606,7 +606,7 @@ H5D_farray_filt_encode(void *_raw, const void *_elmt, size_t nelmts, void *_ctx) uint8_t *raw = (uint8_t *)_raw; /* Convenience pointer to raw elements */ const H5D_farray_filt_elmt_t *elmt = (const H5D_farray_filt_elmt_t *)_elmt; /* Convenience pointer to native elements */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_farray_filt_encode) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity checks */ HDassert(raw); @@ -653,7 +653,7 @@ H5D_farray_filt_decode(const void *_raw, void *_elmt, size_t nelmts, void *_ctx) H5D_farray_filt_elmt_t *elmt = (H5D_farray_filt_elmt_t *)_elmt; /* Convenience pointer to native elements */ const uint8_t *raw = (const uint8_t *)_raw; /* Convenience pointer to raw elements */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_farray_filt_decode) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity checks */ HDassert(raw); @@ -699,7 +699,7 @@ H5D_farray_filt_debug(FILE *stream, int indent, int fwidth, hsize_t idx, const H5D_farray_filt_elmt_t *elmt = (const H5D_farray_filt_elmt_t *)_elmt; /* Convenience pointer to native elements */ char temp_str[128]; /* Temporary string, for formatting */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_farray_filt_debug) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity checks */ HDassert(stream); @@ -734,7 +734,7 @@ H5D_farray_idx_open(const H5D_chk_idx_info_t *idx_info) H5D_farray_ctx_ud_t udata; /* User data for fixed array open call */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_farray_idx_open) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(idx_info); @@ -790,7 +790,7 @@ H5D_farray_idx_create(const H5D_chk_idx_info_t *idx_info) H5D_farray_ctx_ud_t udata; /* User data for fixed array create call */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_farray_idx_create) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(idx_info); @@ -858,7 +858,7 @@ H5D_farray_idx_is_space_alloc(const H5O_storage_chunk_t *storage) { hbool_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_farray_idx_is_space_alloc) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(storage); @@ -895,7 +895,7 @@ H5D_farray_idx_insert(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata) hsize_t idx; /* Array index of chunk */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_farray_idx_insert) + FUNC_ENTER_NOAPI_NOINIT HDassert(idx_info); HDassert(idx_info->f); @@ -1046,7 +1046,7 @@ H5D_farray_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udat hsize_t idx; /* Array index of chunk */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_farray_idx_get_addr) + FUNC_ENTER_NOAPI_NOINIT HDassert(idx_info); HDassert(idx_info->f); @@ -1123,7 +1123,7 @@ H5D_farray_idx_iterate_cb(hsize_t UNUSED idx, const void *_elmt, void *_udata) int curr_dim; /* Current dimension */ int ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_farray_idx_iterate_cb) + FUNC_ENTER_NOAPI_NOINIT /* Compose generic chunk record for callback */ if(udata->filtered) { @@ -1187,7 +1187,7 @@ H5D_farray_idx_iterate(const H5D_chk_idx_info_t *idx_info, H5FA_stat_t fa_stat; /* Fixed array statistics */ int ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_farray_idx_iterate) + FUNC_ENTER_NOAPI_NOINIT HDassert(idx_info); HDassert(idx_info->f); @@ -1265,7 +1265,7 @@ H5D_farray_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t hsize_t idx; /* Array index of chunk */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_farray_idx_remove) + FUNC_ENTER_NOAPI_NOINIT HDassert(idx_info); HDassert(idx_info->f); @@ -1355,7 +1355,7 @@ H5D_farray_idx_delete_cb(hsize_t UNUSED idx, const void *_elmt, void *_udata) uint32_t nbytes; /* Size of chunk */ int ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_farray_idx_delete_cb) + FUNC_ENTER_NOAPI_NOINIT /* Sanity checks */ HDassert(_elmt); @@ -1403,7 +1403,7 @@ H5D_farray_idx_delete(const H5D_chk_idx_info_t *idx_info) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_farray_idx_delete) + FUNC_ENTER_NOAPI_NOINIT /* Sanity checks */ HDassert(idx_info); @@ -1487,7 +1487,7 @@ H5D_farray_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src, { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_farray_idx_copy_setup) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(idx_info_src); @@ -1543,7 +1543,7 @@ H5D_farray_idx_copy_shutdown(H5O_storage_chunk_t *storage_src, { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_farray_idx_copy_shutdown) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(storage_src); @@ -1584,7 +1584,7 @@ H5D_farray_idx_size(const H5D_chk_idx_info_t *idx_info, hsize_t *index_size) H5FA_stat_t fa_stat; /* Fixed array statistics */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5D_farray_idx_size, FAIL) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(idx_info); @@ -1635,7 +1635,7 @@ done: static herr_t H5D_farray_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_addr) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_farray_idx_reset) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(storage); @@ -1664,7 +1664,7 @@ H5D_farray_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_addr) static herr_t H5D_farray_idx_dump(const H5O_storage_chunk_t *storage, FILE *stream) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_farray_idx_dump) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(storage); @@ -1693,7 +1693,7 @@ H5D_farray_idx_dest(const H5D_chk_idx_info_t *idx_info) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_farray_idx_dest) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(idx_info); diff --git a/src/H5Dfill.c b/src/H5Dfill.c index a80dd83..c0a9766 100644 --- a/src/H5Dfill.c +++ b/src/H5Dfill.c @@ -117,7 +117,7 @@ H5Dfill(const void *fill, hid_t fill_type_id, void *buf, hid_t buf_type_id, hid_ H5T_t *buf_type; /* Buffer datatype */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Dfill, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE5("e", "*xi*xii", fill, fill_type_id, buf, buf_type_id, space_id); /* Check args */ @@ -181,7 +181,7 @@ H5D_fill(const void *fill, const H5T_t *fill_type, void *buf, size_t dst_type_size; /* Size of destination type*/ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_fill) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(fill_type); @@ -370,7 +370,7 @@ H5D_fill_init(H5D_fill_buf_info_t *fb_info, void *caller_fill_buf, { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5D_fill_init, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args */ HDassert(fb_info); @@ -566,7 +566,7 @@ H5D_fill_refill_vl(H5D_fill_buf_info_t *fb_info, size_t nelmts, hid_t dxpl_id) herr_t ret_value = SUCCEED; /* Return value */ void * buf = NULL; /* Temporary fill buffer */ - FUNC_ENTER_NOAPI(H5D_fill_refill_vl, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args */ HDassert(fb_info); @@ -644,7 +644,7 @@ done: herr_t H5D_fill_release(H5D_fill_buf_info_t *fb_info) { - FUNC_ENTER_NOAPI_NOFUNC(H5D_fill_release) + FUNC_ENTER_NOAPI_NOERR /* Check args */ HDassert(fb_info); @@ -682,7 +682,7 @@ H5D_fill_release(H5D_fill_buf_info_t *fb_info) herr_t H5D_fill_term(H5D_fill_buf_info_t *fb_info) { - FUNC_ENTER_NOAPI_NOFUNC(H5D_fill_term) + FUNC_ENTER_NOAPI_NOERR /* Check args */ HDassert(fb_info); diff --git a/src/H5Dint.c b/src/H5Dint.c index a4f5c8d..584626c 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -129,7 +129,7 @@ H5D_init(void) { herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5D_init, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* FUNC_ENTER() does all the work */ done: @@ -158,7 +158,7 @@ H5D_init_interface(void) H5P_genplist_t *def_dcpl; /* Default Dataset Creation Property list */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_init_interface) + FUNC_ENTER_NOAPI_NOINIT /* Initialize the atom group for the dataset IDs */ if(H5I_register_type(H5I_DATASET, (size_t)H5I_DATASETID_HASHSIZE, H5D_RESERVED_ATOMS, (H5I_free_t)H5D_close)0) { @@ -279,7 +279,7 @@ H5D_get_dxpl_cache_real(hid_t dxpl_id, H5D_dxpl_cache_t *cache) H5P_genplist_t *dx_plist; /* Data transfer property list */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_get_dxpl_cache_real) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(cache); @@ -364,7 +364,7 @@ H5D_get_dxpl_cache(hid_t dxpl_id, H5D_dxpl_cache_t **cache) { herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5D_get_dxpl_cache,FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args */ assert(cache); @@ -382,7 +382,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5D_create_named + * Function: H5D__create_named * * Purpose: Internal routine to create a new dataset. * @@ -396,7 +396,7 @@ done: *------------------------------------------------------------------------- */ H5D_t * -H5D_create_named(const H5G_loc_t *loc, const char *name, hid_t type_id, +H5D__create_named(const H5G_loc_t *loc, const char *name, hid_t type_id, const H5S_t *space, hid_t lcpl_id, hid_t dcpl_id, hid_t dapl_id, hid_t dxpl_id) { @@ -404,7 +404,7 @@ H5D_create_named(const H5G_loc_t *loc, const char *name, hid_t type_id, H5D_obj_create_t dcrt_info; /* Information for dataset creation */ H5D_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5D_create_named, NULL) + FUNC_ENTER_PACKAGE /* Check arguments */ HDassert(loc); @@ -437,7 +437,7 @@ H5D_create_named(const H5G_loc_t *loc, const char *name, hid_t type_id, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_create_named() */ +} /* end H5D__create_named() */ /*------------------------------------------------------------------------- @@ -465,7 +465,7 @@ H5D_get_space_status(H5D_t *dset, H5D_space_status_t *allocation, hid_t dxpl_id) hsize_t full_size; /* The number of bytes in the dataset when fully populated */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT(H5D_get_space_status) + FUNC_ENTER_NOAPI_NOINIT HDassert(dset); @@ -530,7 +530,7 @@ H5D_new(hid_t dcpl_id, hbool_t creating, hbool_t vl_type) H5P_genplist_t *plist; /* Property list created */ H5D_shared_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_new) + FUNC_ENTER_NOAPI_NOINIT /* Allocate new shared dataset structure */ if(NULL == (new_dset = H5FL_MALLOC(H5D_shared_t))) @@ -592,7 +592,7 @@ H5D_init_type(H5F_t *file, const H5D_t *dset, hid_t type_id, const H5T_t *type) hbool_t use_latest_format; /* Flag indicating the newest file format should be used */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_init_type) + FUNC_ENTER_NOAPI_NOINIT /* Sanity checking */ HDassert(file); @@ -664,7 +664,7 @@ H5D_init_space(H5F_t *file, const H5D_t *dset, const H5S_t *space) hbool_t use_latest_format; /* Flag indicating the newest file format should be used */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_init_space) + FUNC_ENTER_NOAPI_NOINIT /* Sanity checking */ HDassert(file); @@ -710,7 +710,7 @@ H5D_swmr_setup(const H5D_t *dataset, hid_t dxpl_id) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_swmr_setup) + FUNC_ENTER_NOAPI_NOINIT /* Sanity checking */ HDassert(dataset); @@ -768,7 +768,7 @@ H5D_swmr_teardown(const H5D_t *dataset, hid_t dxpl_id) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_swmr_teardown) + FUNC_ENTER_NOAPI_NOINIT /* Sanity checking */ HDassert(dataset); @@ -819,7 +819,7 @@ H5D_update_oh_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset, hid_t dapl_id) hbool_t layout_init = FALSE; /* Flag to indicate that chunk information was initialized */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_update_oh_info) + FUNC_ENTER_NOAPI_NOINIT /* Sanity checking */ HDassert(file); @@ -1018,7 +1018,7 @@ H5D_create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id, H5G_loc_t dset_loc; /* Dataset location */ H5D_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5D_create, NULL) + FUNC_ENTER_NOAPI(NULL) /* check args */ HDassert(file); @@ -1107,7 +1107,7 @@ H5D_create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id, HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, NULL, "compact dataset must have early space allocation") /* If MPI VFD is used, no filter support yet. */ - if(IS_H5FD_MPI(file) && pline->nused > 0) + if(H5F_HAS_FEATURE(file, H5FD_FEAT_HAS_MPI) && pline->nused > 0) HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, NULL, "Parallel I/O does not support filters yet") /* Get the dataset's external file list information */ @@ -1136,7 +1136,7 @@ H5D_create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id, } /* end if */ /* Check if this dataset is going into a parallel file and set space allocation time */ - if(IS_H5FD_MPI(file)) + if(H5F_HAS_FEATURE(file, H5FD_FEAT_ALLOCATE_EARLY)) new_dset->shared->dcpl_cache.fill.alloc_time = H5D_ALLOC_TIME_EARLY; /* Set the dataset's I/O operations */ @@ -1219,7 +1219,7 @@ H5D_open(const H5G_loc_t *loc, hid_t dapl_id, hid_t dxpl_id) H5D_t *dataset = NULL; H5D_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5D_open, NULL) + FUNC_ENTER_NOAPI(NULL) /* check args */ HDassert(loc); @@ -1318,7 +1318,7 @@ H5D_open_oid(H5D_t *dataset, hid_t dapl_id, hid_t dxpl_id) htri_t msg_exists; /* Whether a particular type of message exists */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(H5D_open_oid, dxpl_id, dataset->oloc.addr, FAIL) + FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, dataset->oloc.addr, FAIL) /* check args */ HDassert(dataset); @@ -1418,7 +1418,7 @@ H5D_open_oid(H5D_t *dataset, hid_t dapl_id, hid_t dxpl_id) */ if((H5F_INTENT(dataset->oloc.file) & H5F_ACC_RDWR) && !(*dataset->shared->layout.ops->is_space_alloc)(&dataset->shared->layout.storage) - && IS_H5FD_MPI(dataset->oloc.file)) { + && H5F_HAS_FEATURE(dataset->oloc.file, H5FD_FEAT_ALLOCATE_EARLY)) { if(H5D_alloc_storage(dataset, dxpl_id, H5D_ALLOC_OPEN, FALSE, NULL) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize file storage") } /* end if */ @@ -1471,7 +1471,7 @@ H5D_close(H5D_t *dataset) unsigned free_failed = FALSE; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5D_close, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* check args */ HDassert(dataset && dataset->oloc.file && dataset->shared); @@ -1579,9 +1579,14 @@ H5D_close(H5D_t *dataset) HGOTO_ERROR(H5E_DATASET, H5E_CANTRELEASE, FAIL, "can't decrement count for object") /* Check reference count for this object in the top file */ - if(H5FO_top_count(dataset->oloc.file, dataset->oloc.addr) == 0) + if(H5FO_top_count(dataset->oloc.file, dataset->oloc.addr) == 0) { if(H5O_close(&(dataset->oloc)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to close") + } /* end if */ + else + /* Free object location (i.e. "unhold" the file if appropriate) */ + if(H5O_loc_free(&(dataset->oloc)) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTRELEASE, FAIL, "problem attempting to free location") } /* end else */ /* Release the dataset's path info */ @@ -1616,8 +1621,8 @@ done: H5O_loc_t * H5D_oloc(H5D_t *dataset) { - /* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_oloc) + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR FUNC_LEAVE_NOAPI(dataset ? &(dataset->oloc) : (H5O_loc_t *)NULL) } /* end H5D_oloc() */ @@ -1639,8 +1644,8 @@ H5D_oloc(H5D_t *dataset) H5G_name_t * H5D_nameof(H5D_t *dataset) { - /* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_nameof) + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR FUNC_LEAVE_NOAPI(dataset ? &(dataset->path) : (H5G_name_t *)NULL) } /* end H5D_nameof() */ @@ -1663,8 +1668,8 @@ H5D_nameof(H5D_t *dataset) H5T_t * H5D_typeof(const H5D_t *dset) { - /* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_typeof) + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(dset); HDassert(dset->shared); @@ -1696,7 +1701,7 @@ H5D_alloc_storage(H5D_t *dset/*in,out*/, hid_t dxpl_id, H5D_time_alloc_t time_al hbool_t addr_set = FALSE; /* Flag to indicate that the dataset's storage address was set */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_alloc_storage) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(dset); @@ -1713,15 +1718,20 @@ H5D_alloc_storage(H5D_t *dset/*in,out*/, hid_t dxpl_id, H5D_time_alloc_t time_al switch(layout->type) { case H5D_CONTIGUOUS: if(!(*dset->shared->layout.ops->is_space_alloc)(&dset->shared->layout.storage)) { - /* Reserve space in the file for the entire array */ - if(H5D_contig_alloc(f, dxpl_id, &layout->storage.u.contig/*out*/) < 0) - HGOTO_ERROR(H5E_IO, H5E_CANTINIT, FAIL, "unable to initialize contiguous storage") + /* Check if we have a zero-sized dataset */ + if(layout->storage.u.contig.size > 0) { + /* Reserve space in the file for the entire array */ + if(H5D_contig_alloc(f, dxpl_id, &layout->storage.u.contig/*out*/) < 0) + HGOTO_ERROR(H5E_IO, H5E_CANTINIT, FAIL, "unable to initialize contiguous storage") + + /* Indicate that we should initialize storage space */ + must_init_space = TRUE; + } /* end if */ + else + layout->storage.u.contig.addr = HADDR_UNDEF; /* Indicate that we set the storage addr */ addr_set = TRUE; - - /* Indicate that we should initialize storage space */ - must_init_space = TRUE; } /* end if */ break; @@ -1850,7 +1860,7 @@ H5D_init_storage(H5D_t *dset, hbool_t full_overwrite, hsize_t old_dim[], { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_init_storage) + FUNC_ENTER_NOAPI_NOINIT HDassert(dset); @@ -1923,7 +1933,7 @@ H5D_get_storage_size(H5D_t *dset, hid_t dxpl_id) { hsize_t ret_value; - FUNC_ENTER_NOAPI_NOINIT_TAG(H5D_get_storage_size, dxpl_id, dset->oloc.addr, 0) + FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, dset->oloc.addr, 0) switch(dset->shared->layout.type) { case H5D_CHUNKED: @@ -1978,7 +1988,7 @@ H5D_get_offset(const H5D_t *dset) { haddr_t ret_value = HADDR_UNDEF; - FUNC_ENTER_NOAPI_NOINIT(H5D_get_offset) + FUNC_ENTER_NOAPI_NOINIT HDassert(dset); @@ -2026,7 +2036,7 @@ H5D_iterate(void *buf, hid_t type_id, const H5S_t *space, H5D_operator_t op, { herr_t ret_value; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_iterate) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(buf); @@ -2063,7 +2073,7 @@ H5D_vlen_reclaim(hid_t type_id, H5S_t *space, hid_t plist_id, void *buf) H5T_vlen_alloc_info_t *vl_alloc_info = &_vl_alloc_info; /* VL allocation info */ herr_t ret_value; - FUNC_ENTER_NOAPI(H5D_vlen_reclaim, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args */ HDassert(H5I_DATATYPE == H5I_get_type(type_id)); @@ -2104,7 +2114,7 @@ H5D_vlen_get_buf_size_alloc(size_t size, void *info) H5D_vlen_bufsize_t *vlen_bufsize = (H5D_vlen_bufsize_t *)info; void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_vlen_get_buf_size_alloc) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Get a temporary pointer to space for the VL data */ if((vlen_bufsize->vl_tbuf = H5FL_BLK_REALLOC(vlen_vl_buf, vlen_bufsize->vl_tbuf, size)) != NULL) @@ -2150,7 +2160,7 @@ H5D_vlen_get_buf_size(void UNUSED *elem, hid_t type_id, unsigned UNUSED ndim, co H5T_t *dt; /* Datatype for operation */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_vlen_get_buf_size) + FUNC_ENTER_NOAPI_NOINIT HDassert(op_data); HDassert(H5I_DATATYPE == H5I_get_type(type_id)); @@ -2194,7 +2204,7 @@ H5D_check_filters(H5D_t *dataset) H5O_fill_t *fill; /* Dataset's fill value */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_check_filters) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(dataset); @@ -2252,7 +2262,7 @@ H5D_set_extent(H5D_t *dset, const hsize_t *size, hid_t dxpl_id) htri_t changed; /* Whether the dataspace changed size */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(H5D_set_extent, dxpl_id, dset->oloc.addr, FAIL) + FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, dset->oloc.addr, FAIL) /* Check args */ HDassert(dset); @@ -2365,7 +2375,7 @@ H5D_flush_sieve_buf(H5D_t *dataset, hid_t dxpl_id) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_flush_sieve_buf) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(dataset); @@ -2407,7 +2417,7 @@ H5D_flush_real(H5D_t *dataset, hid_t dxpl_id) H5O_t *oh = NULL; /* Pointer to dataset's object header */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(H5D_flush_real, dxpl_id, dataset->oloc.addr, FAIL) + FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, dataset->oloc.addr, FAIL) /* Check args */ HDassert(dataset); @@ -2477,7 +2487,7 @@ H5D_mark(H5D_t *dataset, hid_t dxpl_id, unsigned flags) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_mark) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(dataset); @@ -2489,7 +2499,6 @@ H5D_mark(H5D_t *dataset, hid_t dxpl_id, unsigned flags) if(flags & H5D_MARK_LAYOUT) dataset->shared->layout_dirty = TRUE; -done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_mark() */ @@ -2514,7 +2523,7 @@ H5D_flush_cb(void *_dataset, hid_t UNUSED id, void *_udata) H5D_flush_ud_t *udata = (H5D_flush_ud_t *)_udata; /* User data for callback */ int ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_flush_cb) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(dataset); @@ -2550,7 +2559,7 @@ H5D_flush(const H5F_t *f, hid_t dxpl_id) H5D_flush_ud_t udata; /* User data for callback */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5D_flush, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args */ HDassert(f); diff --git a/src/H5Dio.c b/src/H5Dio.c index b7c2ecb..248ea9e 100644 --- a/src/H5Dio.c +++ b/src/H5Dio.c @@ -127,7 +127,7 @@ H5Dread(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, char fake_char; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Dread, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE6("e", "iiiiix", dset_id, mem_type_id, mem_space_id, file_space_id, plist_id, buf); @@ -219,7 +219,7 @@ H5Dwrite(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, char fake_char; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Dwrite, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE6("e", "iiiii*x", dset_id, mem_type_id, mem_space_id, file_space_id, dxpl_id, buf); @@ -315,7 +315,7 @@ H5D_read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, H5D_dxpl_cache_t *dxpl_cache = &_dxpl_cache; /* Data transfer property cache */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(H5D_read, dxpl_id, dataset->oloc.addr, FAIL) + FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, dataset->oloc.addr, FAIL) /* check args */ HDassert(dataset && dataset->oloc.file); @@ -339,7 +339,8 @@ H5D_read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, #ifdef H5_HAVE_PARALLEL /* Collective access is not permissible without a MPI based VFD */ - if(dxpl_cache->xfer_mode == H5FD_MPIO_COLLECTIVE && !IS_H5FD_MPI(dataset->oloc.file)) + if(dxpl_cache->xfer_mode == H5FD_MPIO_COLLECTIVE && + !(H5F_HAS_FEATURE(dataset->oloc.file, H5FD_FEAT_HAS_MPI))) HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, FAIL, "collective access for MPI-based drivers only") #endif /*H5_HAVE_PARALLEL*/ @@ -515,7 +516,7 @@ H5D_write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, H5D_dxpl_cache_t *dxpl_cache = &_dxpl_cache; /* Data transfer property cache */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(H5D_write, dxpl_id, dataset->oloc.addr, FAIL) + FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, dataset->oloc.addr, FAIL) /* check args */ HDassert(dataset && dataset->oloc.file); @@ -543,7 +544,7 @@ H5D_write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, /* Various MPI based checks */ #ifdef H5_HAVE_PARALLEL - if(IS_H5FD_MPI(dataset->oloc.file)) { + if H5F_HAS_FEATURE(dataset->oloc.file, H5FD_FEAT_HAS_MPI) { /* If MPI based VFD is used, no VL datatype support yet. */ /* This is because they use the global heap in the file and we don't */ /* support parallel access of that yet */ @@ -602,7 +603,7 @@ H5D_write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to construct projected memory dataspace") HDassert(projected_mem_space); HDassert(adj_buf); - + /* Switch to using projected memory dataspace & adjusted buffer */ mem_space = projected_mem_space; buf = adj_buf; @@ -727,7 +728,7 @@ static herr_t H5D_ioinfo_init(H5D_t *dset, const H5D_dxpl_cache_t *dxpl_cache, hid_t dxpl_id, const H5D_type_info_t *type_info, H5D_storage_t *store, H5D_io_info_t *io_info) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_ioinfo_init) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ HDassert(dset); @@ -768,7 +769,7 @@ H5D_ioinfo_init(H5D_t *dset, const H5D_dxpl_cache_t *dxpl_cache, hid_t dxpl_id, #ifdef H5_HAVE_PARALLEL /* Determine if the file was opened with an MPI VFD */ - io_info->using_mpi_vfd = IS_H5FD_MPI(dset->oloc.file); + io_info->using_mpi_vfd = H5F_HAS_FEATURE(dset->oloc.file, H5FD_FEAT_HAS_MPI); #endif /* H5_HAVE_PARALLEL */ FUNC_LEAVE_NOAPI(SUCCEED) @@ -797,7 +798,7 @@ H5D_typeinfo_init(const H5D_t *dset, const H5D_dxpl_cache_t *dxpl_cache, const H5T_t *dst_type; /* Destination datatype */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_typeinfo_init) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(type_info); @@ -949,9 +950,12 @@ H5D_ioinfo_adjust(H5D_io_info_t *io_info, const H5D_t *dset, hid_t dxpl_id, const H5S_t *file_space, const H5S_t *mem_space, const H5D_type_info_t *type_info, const H5D_chunk_map_t *fm) { + H5P_genplist_t *dx_plist; /* Data transer property list */ + H5D_mpio_actual_chunk_opt_mode_t actual_chunk_opt_mode; /* performed chunk optimization */ + H5D_mpio_actual_io_mode_t actual_io_mode; /* performed io mode */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_ioinfo_adjust) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(dset); @@ -962,6 +966,20 @@ H5D_ioinfo_adjust(H5D_io_info_t *io_info, const H5D_t *dset, hid_t dxpl_id, HDassert(type_info->tpath); HDassert(io_info); + /* Get the dataset transfer property list */ + if(NULL == (dx_plist = (H5P_genplist_t *)H5I_object(dxpl_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer property list") + + /* Reset the actual io mode properties to the default values in case + * the dxpl was previously used in a collective I/O operation. + */ + actual_chunk_opt_mode = H5D_MPIO_NO_CHUNK_OPTIMIZATION; + actual_io_mode = H5D_MPIO_NO_COLLECTIVE; + if(H5P_set(dx_plist, H5D_MPIO_ACTUAL_CHUNK_OPT_MODE_NAME, &actual_chunk_opt_mode) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "couldn't set actual chunk opt mode property") + if(H5P_set(dx_plist, H5D_MPIO_ACTUAL_IO_MODE_NAME, &actual_io_mode) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "couldn't set actual io mode property") + /* Make any parallel I/O adjustments */ if(io_info->using_mpi_vfd) { htri_t opt; /* Flag whether a selection is optimizable */ @@ -994,12 +1012,6 @@ H5D_ioinfo_adjust(H5D_io_info_t *io_info, const H5D_t *dset, hid_t dxpl_id, * mark it so that we remember to revert the change. */ if(io_info->dxpl_cache->xfer_mode == H5FD_MPIO_COLLECTIVE) { - H5P_genplist_t *dx_plist; /* Data transer property list */ - - /* Get the dataset transfer property list */ - if(NULL == (dx_plist = (H5P_genplist_t *)H5I_object(dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset creation property list") - /* Change the xfer_mode to independent for handling the I/O */ io_info->dxpl_cache->xfer_mode = H5FD_MPIO_INDEPENDENT; if(H5P_set(dx_plist, H5D_XFER_IO_XFER_MODE_NAME, &io_info->dxpl_cache->xfer_mode) < 0) @@ -1031,7 +1043,7 @@ H5D_ioinfo_term(H5D_io_info_t *io_info) { herr_t ret_value = SUCCEED; /*return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_ioinfo_term) + FUNC_ENTER_NOAPI_NOINIT /* Check if we used the MPI VFD for the I/O */ if(io_info->using_mpi_vfd) { @@ -1084,7 +1096,7 @@ done: static herr_t H5D_typeinfo_term(const H5D_type_info_t *type_info) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_typeinfo_term) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check for releasing datatype conversion & background buffers */ if(type_info->tconv_buf_allocated) { diff --git a/src/H5Dlayout.c b/src/H5Dlayout.c index 10fc9c9..c217283 100644 --- a/src/H5Dlayout.c +++ b/src/H5Dlayout.c @@ -78,7 +78,7 @@ H5D_layout_set_io_ops(const H5D_t *dataset) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5D_layout_set_io_ops, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* check args */ HDassert(dataset); @@ -158,7 +158,7 @@ H5D_layout_meta_size(const H5F_t *f, const H5O_layout_t *layout, hbool_t include { size_t ret_value; - FUNC_ENTER_NOAPI_NOINIT(H5D_layout_meta_size) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(f); @@ -273,7 +273,7 @@ H5D_layout_set_latest_version(H5O_layout_t *layout, const H5S_t *space, { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5D_layout_set_latest_version, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ HDassert(layout); @@ -313,7 +313,7 @@ H5D_layout_set_latest_indexing(H5O_layout_t *layout, const H5S_t *space, unsigned ndims; /* Rank of dataspace */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5D_layout_set_latest_indexing, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ HDassert(layout); @@ -428,7 +428,7 @@ H5D_layout_oh_create(H5F_t *file, hid_t dxpl_id, H5O_t *oh, H5D_t *dset, hbool_t layout_init = FALSE; /* Flag to indicate that chunk information was initialized */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(H5D_layout_oh_create, dxpl_id, dset->oloc.addr, FAIL) + FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, dset->oloc.addr, FAIL) /* Sanity checking */ HDassert(file); @@ -564,7 +564,7 @@ H5D_layout_oh_read(H5D_t *dataset, hid_t dxpl_id, hid_t dapl_id, H5P_genplist_t htri_t msg_exists; /* Whether a particular type of message exists */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_layout_oh_read) + FUNC_ENTER_NOAPI_NOINIT /* Sanity checking */ HDassert(dataset); @@ -704,7 +704,7 @@ H5D_layout_oh_write(H5D_t *dataset, hid_t dxpl_id, H5O_t *oh, unsigned update_fl { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_layout_oh_write) + FUNC_ENTER_NOAPI_NOINIT /* Sanity checking */ HDassert(dataset); diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index c32536f..03a9a76 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -17,33 +17,33 @@ * Programmer: rky 980813 * KY 2005 revised the code and made the change to support and optimize * collective IO support. - * Purpose: Functions to read/write directly between app buffer and file. + * Purpose: Functions to read/write directly between app buffer and file. * - * Beware of the ifdef'ed print statements. - * I didn't make them portable. + * Beware of the ifdef'ed print statements. + * I didn't make them portable. */ /****************/ /* Module Setup */ /****************/ -#define H5D_PACKAGE /*suppress error about including H5Dpkg */ +#define H5D_PACKAGE /* suppress error about including H5Dpkg */ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ -#include "H5Dpkg.h" /* Datasets */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5Fprivate.h" /* File access */ -#include "H5FDprivate.h" /* File drivers */ -#include "H5Iprivate.h" /* IDs */ -#include "H5MMprivate.h" /* Memory management */ -#include "H5Oprivate.h" /* Object headers */ -#include "H5Pprivate.h" /* Property lists */ -#include "H5Sprivate.h" /* Dataspaces */ -#include "H5Vprivate.h" /* Vector */ +#include "H5private.h" /* Generic Functions */ +#include "H5Dpkg.h" /* Datasets */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5Fprivate.h" /* File access */ +#include "H5FDprivate.h" /* File drivers */ +#include "H5Iprivate.h" /* IDs */ +#include "H5MMprivate.h" /* Memory management */ +#include "H5Oprivate.h" /* Object headers */ +#include "H5Pprivate.h" /* Property lists */ +#include "H5Sprivate.h" /* Dataspaces */ +#include "H5Vprivate.h" /* Vector */ #ifdef H5_HAVE_PARALLEL @@ -107,20 +107,16 @@ static herr_t H5D_multi_chunk_collective_io(H5D_io_info_t *io_info, H5P_genplist_t *dx_plist); static herr_t H5D_multi_chunk_collective_io_no_opt(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, H5D_chunk_map_t *fm, H5P_genplist_t *dx_plist); -#ifdef H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS static herr_t H5D_link_chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, H5D_chunk_map_t *fm, int sum_chunk); -#endif /* H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS */ static herr_t H5D_inter_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, const H5S_t *file_space, const H5S_t *mem_space); static herr_t H5D_final_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hsize_t nelmts, MPI_Datatype *mpi_file_type, MPI_Datatype *mpi_buf_type); -#ifdef H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS static herr_t H5D_sort_chunk(H5D_io_info_t *io_info, const H5D_chunk_map_t *fm, H5D_chunk_addr_info_t chunk_addr_info_array[], int many_chunk_opt); -#endif /* H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS */ static herr_t H5D_obtain_mpio_mode(H5D_io_info_t *io_info, H5D_chunk_map_t *fm, H5P_genplist_t *dx_plist, uint8_t assign_io_mode[], haddr_t chunk_addr[]); static herr_t H5D_ioinfo_xfer_mode(H5D_io_info_t *io_info, H5P_genplist_t *dx_plist, @@ -145,15 +141,15 @@ static herr_t H5D_mpio_get_sum_chunk(const H5D_io_info_t *io_info, /*------------------------------------------------------------------------- - * Function: H5D_mpio_opt_possible + * Function: H5D_mpio_opt_possible * - * Purpose: Checks if an direct I/O transfer is possible between memory and + * Purpose: Checks if an direct I/O transfer is possible between memory and * the file. * - * Return: Success: Non-negative: TRUE or FALSE - * Failure: Negative + * Return: Sauccess: Non-negative: TRUE or FALSE + * Failure: Negative * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Wednesday, April 3, 2002 * *------------------------------------------------------------------------- @@ -168,7 +164,7 @@ H5D_mpio_opt_possible(const H5D_io_info_t *io_info, const H5S_t *file_space, int mpi_code; /* MPI error code */ htri_t ret_value = TRUE; - FUNC_ENTER_NOAPI(H5D_mpio_opt_possible, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args */ HDassert(io_info); @@ -225,19 +221,8 @@ H5D_mpio_opt_possible(const H5D_io_info_t *io_info, const H5S_t *file_space, * storage. For contiguous storage, mem_space and file_space won't change * when it it is doing disk IO. For chunking storage, mem_space will * change for different chunks. So for chunking storage, whether we can - * use collective IO will defer until each chunk IO is reached. For - * contiguous storage, if we find MPI-IO cannot support complicated MPI - * derived data type and the shape of data space is not regular, we will - * set use_par_opt_io = FALSE. + * use collective IO will defer until each chunk IO is reached. */ -#ifndef H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS - if(io_info->dset->shared->layout.type == H5D_CONTIGUOUS) - if((H5S_SELECT_IS_REGULAR(file_space) != TRUE) || - (H5S_SELECT_IS_REGULAR(mem_space) != TRUE)) { - local_opinion = FALSE; - goto broadcast; - } /* end if */ -#endif /* Don't allow collective operations if filters need to be applied */ if(io_info->dset->shared->layout.type == H5D_CHUNKED) { @@ -245,24 +230,6 @@ H5D_mpio_opt_possible(const H5D_io_info_t *io_info, const H5S_t *file_space, local_opinion = FALSE; goto broadcast; } /* end if */ - -/* If H5_MPI_SPECIAL_COLLECTIVE_IO_WORKS and H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS - * are defined, the HDF5 library will do collective IO if the application - * asks for it. - * - * If H5_MPI_SPECIAL_COLLECTIVE_IO_WORKS is not defined and one or more - * processes are not participating in the IO, then collective IO is not - * assured. The library will check each process for the number of chunks - * it involves. If any process involves zero chunks, the library will use - * independent IO mode instead. - */ -#ifndef H5_MPI_SPECIAL_COLLECTIVE_IO_WORKS - /* Check the number of chunks to perform I/O on */ - if(0 == H5SL_count(fm->sel_chunks)) { - local_opinion = FALSE; - goto broadcast; - } /* end if */ -#endif /* H5_MPI_SPECIAL_COLLECTIVE_IO_WORKS */ } /* end if */ broadcast: @@ -280,11 +247,11 @@ done: /*------------------------------------------------------------------------- - * Function: H5D_mpio_select_read + * Function: H5D_mpio_select_read * - * Purpose: MPI-IO function to read directly from app buffer to file. + * Purpose: MPI-IO function to read directly from app buffer to file. * - * Return: non-negative on success, negative on failure. + * Return: non-negative on success, negative on failure. * * Programmer: * @@ -297,11 +264,11 @@ H5D_mpio_select_read(const H5D_io_info_t *io_info, const H5D_type_info_t UNUSED const H5D_contig_storage_t *store_contig = &(io_info->store->contig); /* Contiguous storage info for this I/O operation */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI(H5D_mpio_select_read, FAIL) + FUNC_ENTER_NOAPI(FAIL) H5_CHECK_OVERFLOW(mpi_buf_count, hsize_t, size_t); if(H5F_block_read(io_info->dset->oloc.file, H5FD_MEM_DRAW, store_contig->dset_addr, (size_t)mpi_buf_count, io_info->dxpl_id, io_info->u.rbuf) < 0) - HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "can't finish collective parallel read") + HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "can't finish collective parallel read") done: FUNC_LEAVE_NOAPI(ret_value) @@ -309,11 +276,11 @@ done: /*------------------------------------------------------------------------- - * Function: H5D_mpio_select_write + * Function: H5D_mpio_select_write * - * Purpose: MPI-IO function to write directly from app buffer to file. + * Purpose: MPI-IO function to write directly from app buffer to file. * - * Return: non-negative on success, negative on failure. + * Return: non-negative on success, negative on failure. * * Programmer: * @@ -326,7 +293,7 @@ H5D_mpio_select_write(const H5D_io_info_t *io_info, const H5D_type_info_t UNUSED const H5D_contig_storage_t *store_contig = &(io_info->store->contig); /* Contiguous storage info for this I/O operation */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI(H5D_mpio_select_write, FAIL) + FUNC_ENTER_NOAPI(FAIL) /*OKAY: CAST DISCARDS CONST QUALIFIER*/ H5_CHECK_OVERFLOW(mpi_buf_count, hsize_t, size_t); @@ -339,14 +306,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5D_ioinfo_xfer_mode + * Function: H5D_ioinfo_xfer_mode * - * Purpose: Switch to between collective & independent MPI I/O + * Purpose: Switch to between collective & independent MPI I/O * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * Friday, August 12, 2005 + * Programmer: Quincey Koziol + * Friday, August 12, 2005 * *------------------------------------------------------------------------- */ @@ -354,9 +321,9 @@ static herr_t H5D_ioinfo_xfer_mode(H5D_io_info_t *io_info, H5P_genplist_t *dx_plist, H5FD_mpio_xfer_t xfer_mode) { - herr_t ret_value = SUCCEED; /*return value */ + herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_ioinfo_xfer_mode) + FUNC_ENTER_NOAPI_NOINIT /* Change the xfer_mode */ io_info->dxpl_cache->xfer_mode = xfer_mode; @@ -383,15 +350,15 @@ done: /*------------------------------------------------------------------------- - * Function: H5D_ioinfo_coll_opt_mode + * Function: H5D_ioinfo_coll_opt_mode * - * Purpose: Switch between using collective & independent MPI I/O w/file + * Purpose: Switch between using collective & independent MPI I/O w/file * set view * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: MuQun Yang - * Oct. 5th, 2006 + * Programmer: MuQun Yang + * Oct. 5th, 2006 * *------------------------------------------------------------------------- */ @@ -399,9 +366,9 @@ static herr_t H5D_ioinfo_coll_opt_mode(H5D_io_info_t *io_info, H5P_genplist_t *dx_plist, H5FD_mpio_collective_opt_t coll_opt_mode) { - herr_t ret_value = SUCCEED; /*return value */ + herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_ioinfo_coll_opt_mode) + FUNC_ENTER_NOAPI_NOINIT /* Change the optimal xfer_mode */ io_info->dxpl_cache->coll_opt_mode = coll_opt_mode; @@ -414,14 +381,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5D_mpio_get_min_chunk + * Function: H5D_mpio_get_min_chunk * - * Purpose: Routine for obtaining minimum number of chunks to cover + * Purpose: Routine for obtaining minimum number of chunks to cover * hyperslab selection selected by all processors. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Muqun Yang + * Programmer: Muqun Yang * Monday, Feb. 13th, 2006 * *------------------------------------------------------------------------- @@ -434,7 +401,7 @@ H5D_mpio_get_min_chunk(const H5D_io_info_t *io_info, const H5D_chunk_map_t *fm, int mpi_code; /* MPI return code */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT(H5D_mpio_get_min_chunk) + FUNC_ENTER_NOAPI_NOINIT /* Get the number of chunks to perform I/O on */ num_chunkf = H5SL_count(fm->sel_chunks); @@ -449,14 +416,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5D_mpio_get_sum_chunk + * Function: H5D_mpio_get_sum_chunk * - * Purpose: Routine for obtaining total number of chunks to cover + * Purpose: Routine for obtaining total number of chunks to cover * hyperslab selection selected by all processors. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Muqun Yang + * Programmer: Muqun Yang * Monday, Feb. 13th, 2006 * *------------------------------------------------------------------------- @@ -470,7 +437,7 @@ H5D_mpio_get_sum_chunk(const H5D_io_info_t *io_info, const H5D_chunk_map_t *fm, int mpi_code; /* MPI return code */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT(H5D_mpio_get_sum_chunk) + FUNC_ENTER_NOAPI_NOINIT /* Get the number of chunks to perform I/O on */ num_chunkf = 0; @@ -487,14 +454,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5D_contig_collective_read + * Function: H5D_contig_collective_read * - * Purpose: Reads directly from contiguous data in file into application + * Purpose: Reads directly from contiguous data in file into application * memory using collective I/O. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, March 4, 2008 * *------------------------------------------------------------------------- @@ -504,9 +471,11 @@ H5D_contig_collective_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_i hsize_t UNUSED nelmts, const H5S_t *file_space, const H5S_t *mem_space, H5D_chunk_map_t UNUSED *fm) { + H5D_mpio_actual_io_mode_t actual_io_mode = H5D_MPIO_CONTIGUOUS_COLLECTIVE; + H5P_genplist_t *dx_plist; /* Pointer to DXPL */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5D_contig_collective_read, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ HDassert(IS_H5FD_MPIO(io_info->dset->oloc.file)); @@ -514,7 +483,17 @@ H5D_contig_collective_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_i /* Call generic internal collective I/O routine */ if(H5D_inter_collective_io(io_info, type_info, file_space, mem_space) < 0) - HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "couldn't finish shared collective MPI-IO") + HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "couldn't finish shared collective MPI-IO") + + /* Obtain the data transfer properties */ + if(NULL == (dx_plist = H5I_object(io_info->dxpl_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data transfer property list") + + /* Set the actual I/O mode property. internal_collective_io will not break to + * independent I/O, so we set it here. + */ + if(H5P_set(dx_plist, H5D_MPIO_ACTUAL_IO_MODE_NAME, &actual_io_mode) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "couldn't set actual io mode property") done: FUNC_LEAVE_NOAPI(ret_value) @@ -522,14 +501,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5D_contig_collective_write + * Function: H5D_contig_collective_write * - * Purpose: Write directly to contiguous data in file from application + * Purpose: Write directly to contiguous data in file from application * memory using collective I/O. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, March 4, 2008 * *------------------------------------------------------------------------- @@ -539,9 +518,11 @@ H5D_contig_collective_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_ hsize_t UNUSED nelmts, const H5S_t *file_space, const H5S_t *mem_space, H5D_chunk_map_t UNUSED *fm) { + H5D_mpio_actual_io_mode_t actual_io_mode = H5D_MPIO_CONTIGUOUS_COLLECTIVE; + H5P_genplist_t *dx_plist; /* Pointer to DXPL */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5D_contig_collective_write, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ HDassert(IS_H5FD_MPIO(io_info->dset->oloc.file)); @@ -549,7 +530,17 @@ H5D_contig_collective_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_ /* Call generic internal collective I/O routine */ if(H5D_inter_collective_io(io_info, type_info, file_space, mem_space) < 0) - HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "couldn't finish shared collective MPI-IO") + HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "couldn't finish shared collective MPI-IO") + + /* Obtain the data transfer properties */ + if(NULL == (dx_plist = H5I_object(io_info->dxpl_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data transfer property list") + + /* Set the actual I/O mode property. internal_collective_io will not break to + * independent I/O, so we set it here. + */ + if(H5P_set(dx_plist, H5D_MPIO_ACTUAL_IO_MODE_NAME, &actual_io_mode) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "couldn't set actual io mode property") done: FUNC_LEAVE_NOAPI(ret_value) @@ -557,9 +548,9 @@ done: /*------------------------------------------------------------------------- - * Function: H5D_chunk_collective_io + * Function: H5D_chunk_collective_io * - * Purpose: Routine for + * Purpose: Routine for * 1) choose an IO option: * a) One collective IO defined by one MPI derived datatype to link through all chunks * or b) multiple chunk IOs,to do MPI-IO for each chunk, the IO mode may be adjusted @@ -570,7 +561,7 @@ done: * 3. Build up the final MPI derived datatype * 4. Set up collective IO property list * 5. Do IO - * For option b) + * For option b) * 1. Use MPI_gather and MPI_Bcast to obtain information of *collective/independent/none* * IO mode for each chunk of the selection * 2. Depending on whether the IO mode is collective or independent or none, @@ -579,9 +570,9 @@ done: * 3. Set up collective IO property list for collective mode * 4. DO IO * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Muqun Yang + * Programmer: Muqun Yang * Monday, Feb. 13th, 2006 * *------------------------------------------------------------------------- @@ -592,6 +583,8 @@ H5D_chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_info { H5P_genplist_t *dx_plist; /* Pointer to DXPL */ H5FD_mpio_chunk_opt_t chunk_opt_mode; + H5D_mpio_actual_chunk_opt_mode_t actual_chunk_opt_mode; + H5D_mpio_actual_io_mode_t actual_io_mode; int io_option = H5D_MULTI_CHUNK_IO_MORE_OPT; int sum_chunk = -1; #ifdef H5_HAVE_INSTRUMENTED_LIBRARY @@ -599,7 +592,7 @@ H5D_chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_info #endif herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT(H5D_chunk_collective_io) + FUNC_ENTER_NOAPI_NOINIT /* Sanity checks */ HDassert(io_info); @@ -636,43 +629,9 @@ H5D_chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_info else temp_not_link_io = TRUE; #endif - } /* end else */ - -#ifndef H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS - if(io_option == H5D_ONE_LINK_CHUNK_IO) { - io_option = H5D_MULTI_CHUNK_IO; /* We can not do this with one chunk IO. */ -#ifdef H5_HAVE_INSTRUMENTED_LIBRARY - { int new_value; - htri_t check_prop; - check_prop = H5Pexist(io_info->dxpl_id, H5D_XFER_COLL_CHUNK_LINK_TO_MULTI); - if(check_prop > 0) { - new_value = 1; - if(H5Pset(io_info->dxpl_id, H5D_XFER_COLL_CHUNK_LINK_TO_MULTI, &new_value) < 0) - HGOTO_ERROR(H5E_IO, H5E_CANTSET, FAIL, "unable to set property value") - - } - }/* add this property because the library changes the option from one link to multiple chunks.*/ -#endif - } - if(io_option == H5D_ONE_LINK_CHUNK_IO_MORE_OPT){ - io_option = H5D_MULTI_CHUNK_IO_MORE_OPT; -#ifdef H5_HAVE_INSTRUMENTED_LIBRARY - { int new_value; - htri_t check_prop; - check_prop = H5Pexist(io_info->dxpl_id, H5D_XFER_COLL_CHUNK_LINK_TO_MULTI_OPT); - if(check_prop > 0) { - new_value = 1; - if(H5Pset(io_info->dxpl_id, H5D_XFER_COLL_CHUNK_LINK_TO_MULTI_OPT, &new_value) < 0) - HGOTO_ERROR(H5E_IO, H5E_CANTSET, FAIL, "unable to set property value") - - } - }/* add this property because the library changes the option from one link to multiple chunks.*/ -#endif - } -#endif + } /* end else */ #ifdef H5_HAVE_INSTRUMENTED_LIBRARY -{ htri_t check_prop; int new_value; @@ -709,22 +668,42 @@ H5D_chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_info HGOTO_ERROR(H5E_IO, H5E_CANTSET, FAIL, "unable to set property value") } /* end if */ } /* end if */ -} #endif /* step 2: Go ahead to do IO.*/ -#ifdef H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS if(io_option == H5D_ONE_LINK_CHUNK_IO || io_option == H5D_ONE_LINK_CHUNK_IO_MORE_OPT) { + /* set the actual io mode properties to the correct values for link chunk io. + * Link chunk I/O does not break to independent, so we can set the actual_io mode + * as well as the optimisation mode. */ + actual_chunk_opt_mode = H5D_MPIO_LINK_CHUNK; + actual_io_mode = H5D_MPIO_CHUNK_COLLECTIVE; + + /* Set the actual chunk opt mode property. */ + if(H5P_set(dx_plist, H5D_MPIO_ACTUAL_CHUNK_OPT_MODE_NAME, &actual_chunk_opt_mode) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "couldn't set actual chunk opt mode property") + if(H5D_link_chunk_collective_io(io_info, type_info, fm, sum_chunk) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL, "couldn't finish linked chunk MPI-IO") + + /* Set the actual io mode property. */ + if(H5P_set(dx_plist, H5D_MPIO_ACTUAL_IO_MODE_NAME, &actual_io_mode) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "couldn't set actual io mode property") } /* end if */ else -#endif /* H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS */ if(io_option == H5D_MULTI_CHUNK_IO) { + /* Set the actual chunk opt mode property */ + actual_chunk_opt_mode = H5D_MPIO_MULTI_CHUNK_NO_OPT; + if(H5P_set(dx_plist, H5D_MPIO_ACTUAL_CHUNK_OPT_MODE_NAME, &actual_chunk_opt_mode) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "couldn't set actual chunk opt mode property") + if(H5D_multi_chunk_collective_io_no_opt(io_info, type_info, fm, dx_plist) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL, "couldn't finish multiple chunk MPI-IO") } /* end if */ else { /*multiple chunk IOs with opt */ + actual_chunk_opt_mode = H5D_MPIO_MULTI_CHUNK; + if(H5P_set(dx_plist, H5D_MPIO_ACTUAL_CHUNK_OPT_MODE_NAME, &actual_chunk_opt_mode) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "couldn't set actual chunk opt mode property") + if(H5D_multi_chunk_collective_io(io_info, type_info, fm, dx_plist) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL, "couldn't finish optimized multiple chunk MPI-IO") } /* end else */ @@ -735,14 +714,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5D_chunk_collective_read + * Function: H5D_chunk_collective_read * - * Purpose: Reads directly from chunks in file into application memory + * Purpose: Reads directly from chunks in file into application memory * using collective I/O. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, March 4, 2008 * *------------------------------------------------------------------------- @@ -754,7 +733,7 @@ H5D_chunk_collective_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_in { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5D_chunk_collective_read, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Call generic selection operation */ if(H5D_chunk_collective_io(io_info, type_info, fm) < 0) @@ -766,14 +745,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5D_chunk_collective_write + * Function: H5D_chunk_collective_write * - * Purpose: Write directly to chunks in file from application memory + * Purpose: Write directly to chunks in file from application memory * using collective I/O. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, March 4, 2008 * *------------------------------------------------------------------------- @@ -785,7 +764,7 @@ H5D_chunk_collective_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_i { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5D_chunk_collective_write, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Call generic selection operation */ if(H5D_chunk_collective_io(io_info, type_info, fm) < 0) @@ -795,21 +774,20 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_chunk_collective_write() */ -#ifdef H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS /*------------------------------------------------------------------------- - * Function: H5D_link_chunk_collective_io + * Function: H5D_link_chunk_collective_io * - * Purpose: Routine for one collective IO with one MPI derived datatype to link with all chunks + * Purpose: Routine for one collective IO with one MPI derived datatype to link with all chunks * * 1. Sort the chunk address and chunk info * 2. Build up MPI derived datatype for each chunk * 3. Build up the final MPI derived datatype * 4. Use common collective IO routine to do MPI-IO * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Muqun Yang + * Programmer: Muqun Yang * Monday, Feb. 13th, 2006 * *------------------------------------------------------------------------- @@ -833,11 +811,11 @@ H5D_link_chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type hbool_t *chunk_mft_is_derived_array = NULL; /* Flags to indicate each chunk's MPI file datatype is derived */ hbool_t *chunk_mbt_is_derived_array = NULL; /* Flags to indicate each chunk's MPI memory datatype is derived */ int *chunk_mpi_file_counts = NULL; /* Count of MPI file datatype for each chunk */ - int *chunk_mpi_mem_counts = NULL; /* Count of MPI memory datatype for each chunk */ + int *chunk_mpi_mem_counts = NULL; /* Count of MPI memory datatype for each chunk */ int mpi_code; /* MPI return code */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT(H5D_link_chunk_collective_io) + FUNC_ENTER_NOAPI_NOINIT /* Get the sum # of chunks, if not already available */ if(sum_chunk < 0) { @@ -871,21 +849,22 @@ H5D_link_chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type /* Check for this process having selection in this chunk */ chunk_node = H5SL_first(fm->sel_chunks); - if(chunk_node == NULL) { - /* Set the dataspace info for I/O to NULL, this process doesn't have any I/O to perform */ - fspace = mspace = NULL; - } /* end if */ - else { - H5D_chunk_info_t *chunk_info; - - /* Get the chunk info, for the selection in the chunk */ - if(NULL == (chunk_info = H5SL_item(chunk_node))) - HGOTO_ERROR(H5E_STORAGE, H5E_CANTGET, FAIL, "couldn't get chunk info from skipped list") - /* Set the dataspace info for I/O */ - fspace = chunk_info->fspace; - mspace = chunk_info->mspace; - } /* end else */ + if(chunk_node == NULL) { + /* Set the dataspace info for I/O to NULL, this process doesn't have any I/O to perform */ + fspace = mspace = NULL; + } /* end if */ + else { + H5D_chunk_info_t *chunk_info; + + /* Get the chunk info, for the selection in the chunk */ + if(NULL == (chunk_info = H5SL_item(chunk_node))) + HGOTO_ERROR(H5E_STORAGE, H5E_CANTGET, FAIL, "couldn't get chunk info from skipped list") + + /* Set the dataspace info for I/O */ + fspace = chunk_info->fspace; + mspace = chunk_info->mspace; + } /* end else */ /* Set up the base storage address for this chunk */ io_info->store = &ctg_store; @@ -943,6 +922,7 @@ if(H5DEBUG(D)) if(H5D_sort_chunk(io_info, fm, chunk_addr_info_array, sum_chunk) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSWAP, FAIL, "unable to sort chunk address") ctg_store.contig.dset_addr = chunk_addr_info_array[0].chunk_addr; + #ifdef H5D_DEBUG if(H5DEBUG(D)) HDfprintf(H5DEBUG(D),"after sorting the chunk address \n"); @@ -1055,7 +1035,7 @@ if(H5DEBUG(D)) if(chunk_mpi_file_counts) H5MM_xfree(chunk_mpi_file_counts); if(chunk_mbt_is_derived_array) - H5MM_xfree(chunk_mbt_is_derived_array); + H5MM_xfree(chunk_mbt_is_derived_array); if(chunk_mft_is_derived_array) H5MM_xfree(chunk_mft_is_derived_array); @@ -1067,22 +1047,21 @@ if(H5DEBUG(D)) FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_link_chunk_collective_io */ -#endif /* H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS */ /*------------------------------------------------------------------------- - * Function: H5D_multi_chunk_collective_io + * Function: H5D_multi_chunk_collective_io * - * Purpose: To do IO per chunk according to IO mode(collective/independent/none) + * Purpose: To do IO per chunk according to IO mode(collective/independent/none) * * 1. Use MPI_gather and MPI_Bcast to obtain IO mode in each chunk(collective/independent/none) * 2. Depending on whether the IO mode is collective or independent or none, * Create either MPI derived datatype for each chunk or just do independent IO * 3. Use common collective IO routine to do MPI-IO * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Muqun Yang + * Programmer: Muqun Yang * Monday, Feb. 13th, 2006 * *------------------------------------------------------------------------- @@ -1106,9 +1085,10 @@ H5D_multi_chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *typ int mpi_rank; #endif size_t u; /* Local index variable */ + H5D_mpio_actual_io_mode_t actual_io_mode = H5D_MPIO_NO_COLLECTIVE; /* Local variable for tracking the I/O mode used. */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT(H5D_multi_chunk_collective_io) + FUNC_ENTER_NOAPI_NOINIT #ifdef H5Dmpio_DEBUG mpi_rank = H5F_mpi_get_rank(io_info->dset->oloc.file); @@ -1169,7 +1149,7 @@ if(H5DEBUG(D)) /* Pass in chunk's coordinates in a union. */ store.chunk.offset = chunk_info->coords; store.chunk.index = chunk_info->index; - } /* end if */ + } /* end if */ /* Collective IO for this chunk, * Note: even there is no selection for this process, the process still @@ -1185,10 +1165,19 @@ if(H5DEBUG(D)) if(chunk_info) { fspace = chunk_info->fspace; mspace = chunk_info->mspace; - } /* end if */ - else { + + /* Update the local variable tracking the dxpl's actual io mode property. + * + * Note: H5D_MPIO_COLLECTIVE_MULTI | H5D_MPIO_INDEPENDENT = H5D_MPIO_MIXED + * to ease switching between to mixed I/O without checking the current + * value of the property. You can see the definition in H5Ppublic.h + */ + actual_io_mode = actual_io_mode | H5D_MPIO_CHUNK_COLLECTIVE; + + } /* end if */ + else { fspace = mspace = NULL; - } /* end else */ + } /* end else */ /* Switch back to collective I/O */ if(last_xfer_mode != H5FD_MPIO_COLLECTIVE) { @@ -1208,8 +1197,8 @@ if(H5DEBUG(D)) /* Perform the I/O */ if(H5D_inter_collective_io(&ctg_io_info, type_info, fspace, mspace) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL, "couldn't finish shared collective MPI-IO") - } /* end if */ - else { /* possible independent IO for this chunk */ + } /* end if */ + else { /* possible independent IO for this chunk */ #ifdef H5D_DEBUG if(H5DEBUG(D)) HDfprintf(H5DEBUG(D),"inside independent IO mpi_rank = %d, chunk index = %Zu\n", mpi_rank, u); @@ -1217,85 +1206,13 @@ if(H5DEBUG(D)) HDassert(chunk_io_option[u] == 0); -#if !defined(H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS) || !defined(H5_MPI_SPECIAL_COLLECTIVE_IO_WORKS) - /* Check if this process has something to do with this chunk */ - if(chunk_info) { - H5D_io_info_t *chk_io_info; /* Pointer to I/O info object for this chunk */ - H5D_chunk_ud_t udata; /* B-tree pass-through */ - void *chunk; /* Pointer to the data chunk in cache */ - uint32_t accessed_bytes; /* Total accessed size in a chunk */ - htri_t cacheable; /* Whether the chunk is cacheable */ - - /* Switch to independent I/O */ - if(last_xfer_mode != H5FD_MPIO_INDEPENDENT) { - if(H5D_ioinfo_xfer_mode(io_info, dx_plist, H5FD_MPIO_INDEPENDENT) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't switch to independent I/O") - last_xfer_mode = H5FD_MPIO_INDEPENDENT; - } /* end if */ - - /* Load the chunk into cache. But if the whole chunk is written, - * simply allocate space instead of load the chunk. - */ - if(H5D_chunk_lookup(io_info->dset, io_info->dxpl_id, - chunk_info->coords, chunk_info->index, &udata) < 0) - HGOTO_ERROR(H5E_STORAGE, H5E_CANTGET, FAIL, "couldn't get chunk info from skipped list") - - /* Load the chunk into cache and lock it. */ - if((cacheable = H5D_chunk_cacheable(io_info, udata.addr, - io_info->op_type == H5D_IO_OP_WRITE)) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't tell if chunk is cacheable") - if(cacheable) { - hbool_t entire_chunk = TRUE; /* Whether whole chunk is selected */ - - /* Compute # of bytes accessed in chunk */ - accessed_bytes = chunk_info->chunk_points * type_info->src_type_size; - - /* Determine if we will access all the data in the chunk */ - if(((io_info->op_type == H5D_IO_OP_WRITE) && (accessed_bytes != ctg_store.contig.dset_size)) - || (io_info->op_type != H5D_IO_OP_WRITE)) - entire_chunk = FALSE; - - /* Lock the chunk into the cache */ - if(NULL == (chunk = H5D_chunk_lock(io_info, &udata, entire_chunk, FALSE))) - HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to read raw data chunk") - - /* Set up the storage buffer information for this chunk */ - cpt_store.compact.buf = chunk; - - /* Point I/O info at contiguous I/O info for this chunk */ - chk_io_info = &cpt_io_info; - } /* end if */ - else { - /* Set up the storage address information for this chunk */ - ctg_store.contig.dset_addr = udata.addr; - - /* No chunk cached */ - chunk = NULL; - - /* Point I/O info at temporary I/O info for this chunk */ - chk_io_info = &ctg_io_info; - } /* end else */ - - if(io_info->op_type == H5D_IO_OP_WRITE) { - if((io_info->io_ops.single_write)(chk_io_info, type_info, - (hsize_t)chunk_info->chunk_points, chunk_info->fspace, chunk_info->mspace) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "optimized write failed") - } /* end if */ - else { - if((io_info->io_ops.single_read)(chk_io_info, type_info, - (hsize_t)chunk_info->chunk_points, chunk_info->fspace, chunk_info->mspace) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "optimized read failed") - } /* end else */ - - /* Release the cache lock on the chunk. */ - if(chunk && H5D_chunk_unlock(io_info, &udata, (io_info->op_type == H5D_IO_OP_WRITE), chunk, accessed_bytes) < 0) - HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to unlock raw data chunk") - } /* end if */ -#else /* !defined(H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS) || !defined(H5_MPI_SPECIAL_COLLECTIVE_IO_WORKS) */ /* Set the file & memory dataspaces */ if(chunk_info) { fspace = chunk_info->fspace; mspace = chunk_info->mspace; + + /* Update the local variable tracking the dxpl's actual io mode. */ + actual_io_mode = actual_io_mode | H5D_MPIO_CHUNK_INDEPENDENT; } /* end if */ else { fspace = mspace = NULL; @@ -1318,10 +1235,13 @@ if(H5DEBUG(D)) if(H5DEBUG(D)) HDfprintf(H5DEBUG(D),"after inter collective IO\n"); #endif -#endif /* !defined(H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS) || !defined(H5_MPI_SPECIAL_COLLECTIVE_IO_WORKS) */ } /* end else */ } /* end for */ + /* Write the local value of actual io mode to the DXPL. */ + if(H5P_set(dx_plist, H5D_MPIO_ACTUAL_IO_MODE_NAME, &actual_io_mode) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "couldn't set actual io mode property") + done: if(chunk_io_option) H5MM_xfree(chunk_io_option); @@ -1333,9 +1253,9 @@ done: /*------------------------------------------------------------------------- - * Function: H5D_multi_chunk_collective_io_no_opt + * Function: H5D_multi_chunk_collective_io_no_opt * - * Purpose: To do collective IO without any optimization per chunk base + * Purpose: To do collective IO without any optimization per chunk base * The internal independent IO inside HDF5 cannot handle * non-contiguous(or with holes) storage efficiently. * Under this case, the one independent IO call may consist of @@ -1352,9 +1272,9 @@ done: * The HDF5 library won't do any IO management but leave it to MPI-IO to figure * out. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Muqun Yang + * Programmer: Muqun Yang * Monday, Feb. 13th, 2006 * *------------------------------------------------------------------------- @@ -1372,9 +1292,10 @@ H5D_multi_chunk_collective_io_no_opt(H5D_io_info_t *io_info, int min_chunk = -1; /* Minimum # of chunks all processes will operate on */ int count_chunk; /* How many chunks have we operated on? */ H5D_storage_t store; /* union of EFL and chunk pointer in file space */ + H5D_mpio_actual_io_mode_t actual_io_mode = H5D_MPIO_NO_COLLECTIVE; /*Local variable for tracking the I/O modes used. */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT(H5D_multi_chunk_collective_io_no_opt) + FUNC_ENTER_NOAPI_NOINIT #ifdef H5D_DEBUG if(H5DEBUG(D)) { @@ -1416,7 +1337,7 @@ if(H5DEBUG(D)) { /* Iterate through chunks to be operated on */ while(chunk_node) { H5D_chunk_info_t *chunk_info; /* chunk information */ - H5D_chunk_ud_t udata; /* B-tree pass-through */ + H5D_chunk_ud_t udata; /* B-tree pass-through */ hbool_t make_ind, make_coll; /* Flags to indicate that the MPI mode should change */ /* Get the actual chunk information from the skip list node */ @@ -1437,20 +1358,6 @@ if(H5DEBUG(D)) { if(count_chunk > min_chunk) /* Switch to independent I/O (permanently) */ make_ind = TRUE; -#ifndef H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS -/* This case needs to be improved to check if the selected space - is regular. If all selections are regular, collective IO can still be done. - However, since we find an MPI-IO bug at a DOE machine(mcr) that cannot - handle collective I/O selection for this case correctly, - we turn off this optimization but leave the following code - for future optimization. Otherwise, the following else {} doesn't make sense. - KY 2006/8/4/ */ - else { - /* Switch to independent I/O (temporarily) */ - make_ind = TRUE; - make_coll = TRUE; - } /* end else */ -#endif /* H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS */ /* Retrieve the chunk's address */ if(H5D_chunk_lookup(io_info->dset, io_info->dxpl_id, chunk_info->coords, @@ -1468,6 +1375,9 @@ if(H5DEBUG(D)) { if(H5D_ioinfo_xfer_mode(io_info, dx_plist, H5FD_MPIO_INDEPENDENT) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't switch to independent I/O") + /* Update the local variable tracking the dxpl's actual io mode */ + actual_io_mode = actual_io_mode | H5D_MPIO_CHUNK_INDEPENDENT; + /* Load the chunk into cache and lock it. */ if((cacheable = H5D_chunk_cacheable(io_info, udata.addr, io_info->op_type == H5D_IO_OP_WRITE)) < 0) @@ -1524,6 +1434,9 @@ if(H5DEBUG(D)) { /* Set up the storage address information for this chunk */ ctg_store.contig.dset_addr = udata.addr; + /* Update the local variable tracking the dxpl's actual io Mode. */ + actual_io_mode = actual_io_mode | H5D_MPIO_CHUNK_COLLECTIVE; + if(H5D_inter_collective_io(&ctg_io_info, type_info, chunk_info->fspace, chunk_info->mspace) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL,"couldn't finish shared collective MPI-IO") } /* end else */ @@ -1536,20 +1449,24 @@ if(H5DEBUG(D)) { chunk_node = H5SL_next(chunk_node); } /* end while */ + /* Write the local value of actual io mode to the DXPL. */ + if(H5P_set(dx_plist, H5D_MPIO_ACTUAL_IO_MODE_NAME, &actual_io_mode) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "couldn't set actual io mode property") + done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_multi_chunk_collective_io_no_opt */ /*------------------------------------------------------------------------- - * Function: H5D_inter_collective_io + * Function: H5D_inter_collective_io * - * Purpose: Routine for the shared part of collective IO between multiple chunk + * Purpose: Routine for the shared part of collective IO between multiple chunk * collective IO and contiguous collective IO * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Muqun Yang + * Programmer: Muqun Yang * Monday, Feb. 13th, 2006 * *------------------------------------------------------------------------- @@ -1565,7 +1482,7 @@ H5D_inter_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_info int mpi_code; /* MPI return code */ herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_inter_collective_io) + FUNC_ENTER_NOAPI_NOINIT if((file_space != NULL) && (mem_space != NULL)) { int mpi_file_count; /* Number of file "objects" to transfer */ @@ -1611,13 +1528,13 @@ if(H5DEBUG(D)) /*------------------------------------------------------------------------- - * Function: H5D_final_collective_io + * Function: H5D_final_collective_io * - * Purpose: Routine for the common part of collective IO with different storages. + * Purpose: Routine for the common part of collective IO with different storages. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Muqun Yang + * Programmer: Muqun Yang * Monday, Feb. 13th, 2006 * *------------------------------------------------------------------------- @@ -1626,10 +1543,10 @@ static herr_t H5D_final_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hsize_t mpi_buf_count, MPI_Datatype *mpi_file_type, MPI_Datatype *mpi_buf_type) { - hbool_t plist_is_setup = FALSE; /* Whether the dxpl has been customized */ + hbool_t plist_is_setup = FALSE; /* Whether the dxpl has been customized */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT(H5D_final_collective_io) + FUNC_ENTER_NOAPI_NOINIT /* Pass buf type, file type to the file driver. */ if(H5FD_mpi_setup_collective(io_info->dxpl_id, *mpi_buf_type, *mpi_file_type) < 0) @@ -1638,7 +1555,7 @@ H5D_final_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_info if(io_info->op_type == H5D_IO_OP_WRITE) { if((io_info->io_ops.single_write)(io_info, type_info, mpi_buf_count, NULL, NULL) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "optimized write failed") + HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "optimized write failed") } /* end if */ else { if((io_info->io_ops.single_read)(io_info, type_info, mpi_buf_count, NULL, NULL) < 0) @@ -1658,12 +1575,11 @@ if(H5DEBUG(D)) FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_final_collective_io */ -#ifdef H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS /*------------------------------------------------------------------------- - * Function: H5D_sort_chunk + * Function: H5D_sort_chunk * - * Purpose: Routine to sort chunks in increasing order of chunk address + * Purpose: Routine to sort chunks in increasing order of chunk address * Each chunk address is also obtained. * * Description: @@ -1678,9 +1594,9 @@ if(H5DEBUG(D)) * many_chunk_opt : flag to optimize the way to obtain chunk addresses * for many chunks * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Muqun Yang + * Programmer: Muqun Yang * Monday, Feb. 13th, 2006 * *------------------------------------------------------------------------- @@ -1699,9 +1615,9 @@ H5D_sort_chunk(H5D_io_info_t *io_info, const H5D_chunk_map_t *fm, int mpi_size; /* Number of MPI processes */ int mpi_code; /* MPI return code */ int i; /* Local index variable */ - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_sort_chunk) + FUNC_ENTER_NOAPI_NOINIT /* Retrieve # of MPI processes */ if((mpi_size = H5F_mpi_get_size(io_info->dset->oloc.file)) < 0) @@ -1740,14 +1656,15 @@ if(H5DEBUG(D)) /* Retrieve all the chunk addresses with process 0 */ if((mpi_rank = H5F_mpi_get_rank(io_info->dset->oloc.file)) < 0) HGOTO_ERROR(H5E_IO, H5E_MPI, FAIL, "unable to obtain mpi rank") - if(mpi_rank == 0) { + + if(mpi_rank == 0) { if(H5D_chunk_addrmap(io_info, total_chunk_addr_array) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get chunk address") - } /* end if */ + } /* end if */ - /* Broadcasting the MPI_IO option info. and chunk address info. */ - if(MPI_SUCCESS != (mpi_code = MPI_Bcast(total_chunk_addr_array, (int)(sizeof(haddr_t) * fm->layout->u.chunk.nchunks), MPI_BYTE, (int)0, io_info->comm))) - HMPI_GOTO_ERROR(FAIL, "MPI_BCast failed", mpi_code) + /* Broadcasting the MPI_IO option info. and chunk address info. */ + if(MPI_SUCCESS != (mpi_code = MPI_Bcast(total_chunk_addr_array, (int)(sizeof(haddr_t) * fm->layout->u.chunk.nchunks), MPI_BYTE, (int)0, io_info->comm))) + HMPI_GOTO_ERROR(FAIL, "MPI_BCast failed", mpi_code) } /* end if */ /* Start at first node in chunk skip list */ @@ -1801,13 +1718,12 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_sort_chunk() */ -#endif /* H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS */ /*------------------------------------------------------------------------- - * Function: H5D_obtain_mpio_mode + * Function: H5D_obtain_mpio_mode * - * Purpose: Routine to obtain each io mode(collective,independent or none) for each chunk; + * Purpose: Routine to obtain each io mode(collective,independent or none) for each chunk; * Each chunk address is also obtained. * * Description: @@ -1833,9 +1749,9 @@ done: * Output: uint8_t assign_io_mode[], : IO mode, collective, independent or none * haddr_t chunk_addr[], : chunk address array for each chunk * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Muqun Yang + * Programmer: Muqun Yang * Monday, Feb. 13th, 2006 * *------------------------------------------------------------------------- @@ -1846,9 +1762,7 @@ H5D_obtain_mpio_mode(H5D_io_info_t* io_info, H5D_chunk_map_t *fm, { int total_chunks; unsigned percent_nproc_per_chunk, threshold_nproc_per_chunk; -#if defined(H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS) && defined(H5_MPI_SPECIAL_COLLECTIVE_IO_WORKS) H5FD_mpio_chunk_opt_t chunk_opt_mode; -#endif uint8_t* io_mode_info = NULL; uint8_t* recv_io_mode_info = NULL; uint8_t* mergebuf = NULL; @@ -1866,7 +1780,7 @@ H5D_obtain_mpio_mode(H5D_io_info_t* io_info, H5D_chunk_map_t *fm, #endif herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT(H5D_obtain_mpio_mode) + FUNC_ENTER_NOAPI_NOINIT /* Assign the rank 0 to the root */ root = 0; @@ -1881,7 +1795,6 @@ H5D_obtain_mpio_mode(H5D_io_info_t* io_info, H5D_chunk_map_t *fm, /* Setup parameters */ H5_ASSIGN_OVERFLOW(total_chunks, fm->layout->u.chunk.nchunks, hsize_t, int); percent_nproc_per_chunk = H5P_peek_unsigned(dx_plist, H5D_XFER_MPIO_CHUNK_OPT_RATIO_NAME); -#if defined(H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS) && defined(H5_MPI_SPECIAL_COLLECTIVE_IO_WORKS) chunk_opt_mode = (H5FD_mpio_chunk_opt_t)H5P_peek_unsigned(dx_plist, H5D_XFER_MPIO_CHUNK_OPT_HARD_NAME); if((chunk_opt_mode == H5FD_MPIO_CHUNK_MULTI_IO) || (percent_nproc_per_chunk == 0)) { if(H5D_chunk_addrmap(io_info, chunk_addr) < 0) @@ -1891,7 +1804,6 @@ H5D_obtain_mpio_mode(H5D_io_info_t* io_info, H5D_chunk_map_t *fm, HGOTO_DONE(SUCCEED) } /* end if */ -#endif threshold_nproc_per_chunk = mpi_size * percent_nproc_per_chunk/100; /* Allocate memory */ @@ -1907,16 +1819,7 @@ H5D_obtain_mpio_mode(H5D_io_info_t* io_info, H5D_chunk_map_t *fm, while(chunk_node) { chunk_info = H5SL_item(chunk_node); -#ifndef H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS - /* regularity information: 1, selection information: 2 */ - if(H5S_SELECT_IS_REGULAR(chunk_info->fspace) == TRUE && - H5S_SELECT_IS_REGULAR(chunk_info->mspace) == TRUE) -#endif - io_mode_info[chunk_info->index] = H5D_CHUNK_SELECT_REG; /* this chunk is selected and is "regular" without defining H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS. */ -#ifndef H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS - else - io_mode_info[chunk_info->index] = H5D_CHUNK_SELECT_IRREG; /* this chunk is selected and is irregular*/ -#endif + io_mode_info[chunk_info->index] = H5D_CHUNK_SELECT_REG; /* this chunk is selected and is "regular" */ chunk_node = H5SL_next(chunk_node); } /* end while */ @@ -1928,23 +1831,14 @@ H5D_obtain_mpio_mode(H5D_io_info_t* io_info, H5D_chunk_map_t *fm, if(mpi_rank == root) { int nproc; int* nproc_per_chunk; -#if !defined(H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS) || !defined(H5_MPI_SPECIAL_COLLECTIVE_IO_WORKS) - int* ind_this_chunk; -#endif /* pre-computing: calculate number of processes and regularity of the selection occupied in each chunk */ nproc_per_chunk = (int*)H5MM_calloc(total_chunks * sizeof(int)); -#if !defined(H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS) || !defined(H5_MPI_SPECIAL_COLLECTIVE_IO_WORKS) - ind_this_chunk = (int*)H5MM_calloc(total_chunks * sizeof(int)); -#endif /* calculating the chunk address */ if(H5D_chunk_addrmap(io_info, chunk_addr) < 0) { HDfree(nproc_per_chunk); -#if !defined(H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS) || !defined(H5_MPI_SPECIAL_COLLECTIVE_IO_WORKS) - HDfree(ind_this_chunk); -#endif HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get chunk address") } /* end if */ @@ -1956,29 +1850,14 @@ H5D_obtain_mpio_mode(H5D_io_info_t* io_info, H5D_chunk_map_t *fm, for(ic = 0; ic < total_chunks; ic++, tmp_recv_io_mode_info++) { if(*tmp_recv_io_mode_info != 0) { nproc_per_chunk[ic]++; -#ifndef H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS - if(*tmp_recv_io_mode_info == H5D_CHUNK_SELECT_IRREG) - ind_this_chunk[ic] = 1; -#endif } /* end if */ -#ifndef H5_MPI_SPECIAL_COLLECTIVE_IO_WORKS - else { - /*checking whether we have a selection in this chunk */ - ind_this_chunk[ic] = 1; - } /* end else */ -#endif } /* end for */ } /* end for */ /* Calculating MPIO mode for each chunk (collective, independent, none) */ for(ic = 0; ic < total_chunks; ic++) { if(nproc_per_chunk[ic] > MAX(1, threshold_nproc_per_chunk)) { -#if !defined(H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS) || !defined(H5_MPI_SPECIAL_COLLECTIVE_IO_WORKS) - if(!ind_this_chunk[ic]) - assign_io_mode[ic] = H5D_CHUNK_IO_MODE_COL; -#else assign_io_mode[ic] = H5D_CHUNK_IO_MODE_COL; -#endif } /* end if */ } /* end for */ @@ -1988,9 +1867,6 @@ H5D_obtain_mpio_mode(H5D_io_info_t* io_info, H5D_chunk_map_t *fm, HDmemcpy(tempbuf, chunk_addr, sizeof(haddr_t) * total_chunks); HDfree(nproc_per_chunk); -#if !defined(H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS) || !defined(H5_MPI_SPECIAL_COLLECTIVE_IO_WORKS) - HDfree(ind_this_chunk); -#endif } /* end if */ /* Broadcasting the MPI_IO option info. and chunk address info. */ @@ -2003,11 +1879,6 @@ H5D_obtain_mpio_mode(H5D_io_info_t* io_info, H5D_chunk_map_t *fm, #ifdef H5_HAVE_INSTRUMENTED_LIBRARY check_prop = H5Pexist(io_info->dxpl_id, H5D_XFER_COLL_CHUNK_MULTI_RATIO_COLL_NAME); if(check_prop > 0) { -#if !defined(H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS) || !defined(H5_MPI_SPECIAL_COLLECTIVE_IO_WORKS) - new_value = 0; - if(H5Pset(io_info->dxpl_id, H5D_XFER_COLL_CHUNK_MULTI_RATIO_COLL_NAME, &new_value) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_UNSUPPORTED, FAIL, "unable to set property value") -#else for(ic = 0; ic < total_chunks; ic++) { if(assign_io_mode[ic] == H5D_CHUNK_IO_MODE_COL) { new_value = 0; @@ -2016,7 +1887,6 @@ H5D_obtain_mpio_mode(H5D_io_info_t* io_info, H5D_chunk_map_t *fm, break; } /* end if */ } /* end for */ -#endif } /* end if */ check_prop = H5Pexist(io_info->dxpl_id, H5D_XFER_COLL_CHUNK_MULTI_RATIO_IND_NAME); @@ -2053,7 +1923,7 @@ H5D_cmp_chunk_addr(const void *chunk_addr_info1, const void *chunk_addr_info2) { haddr_t addr1, addr2; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_cmp_chunk_addr) + FUNC_ENTER_NOAPI_NOINIT_NOERR addr1 = ((const H5D_chunk_addr_info_t *)chunk_addr_info1)->chunk_addr; addr2 = ((const H5D_chunk_addr_info_t *)chunk_addr_info2)->chunk_addr; diff --git a/src/H5Dnone.c b/src/H5Dnone.c index 723ab45..3c4c761 100644 --- a/src/H5Dnone.c +++ b/src/H5Dnone.c @@ -130,7 +130,7 @@ H5D_none_create(const H5D_chk_idx_info_t *idx_info) haddr_t addr; /* The address of dataset chunks */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_none_create) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(idx_info); @@ -172,7 +172,7 @@ done: static hbool_t H5D_none_is_space_alloc(const H5O_storage_chunk_t *storage) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_none_is_space_alloc) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(storage); @@ -198,7 +198,7 @@ H5D_none_insert(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata) hsize_t idx; /* Array index of chunk */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_none_insert) + FUNC_ENTER_NOAPI_NOINIT HDassert(idx_info); HDassert(idx_info->f); @@ -245,7 +245,7 @@ H5D_none_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata) hsize_t idx; /* Array index of chunk */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_none_get_addr) + FUNC_ENTER_NOAPI_NOINIT HDassert(idx_info); HDassert(idx_info->f); @@ -296,7 +296,7 @@ H5D_none_iterate(const H5D_chk_idx_info_t *idx_info, hsize_t idx; /* Array index of chunk */ int ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_none_iterate) + FUNC_ENTER_NOAPI_NOINIT HDassert(idx_info); HDassert(idx_info->f); @@ -373,7 +373,7 @@ done: static herr_t H5D_none_remove(const H5D_chk_idx_info_t UNUSED *idx_info, H5D_chunk_common_ud_t UNUSED *udata) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_none_remove) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* NO OP */ @@ -399,7 +399,7 @@ H5D_none_delete(const H5D_chk_idx_info_t *idx_info) hsize_t nbytes; /* Size of all chunks */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_none_delete) + FUNC_ENTER_NOAPI_NOINIT HDassert(idx_info); HDassert(idx_info->f); @@ -438,7 +438,7 @@ H5D_none_copy_setup(const H5D_chk_idx_info_t *idx_info_src, { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_none_copy_setup) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(idx_info_src); @@ -486,7 +486,7 @@ done: static herr_t H5D_none_size(const H5D_chk_idx_info_t UNUSED *idx_info, hsize_t *index_size) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_none_size) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(index_size); @@ -511,7 +511,7 @@ H5D_none_size(const H5D_chk_idx_info_t UNUSED *idx_info, hsize_t *index_size) static herr_t H5D_none_reset(H5O_storage_chunk_t *storage, hbool_t reset_addr) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_none_reset) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(storage); @@ -538,7 +538,7 @@ H5D_none_reset(H5O_storage_chunk_t *storage, hbool_t reset_addr) static herr_t H5D_none_dump(const H5O_storage_chunk_t *storage, FILE *stream) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_none_dump) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(storage); diff --git a/src/H5Doh.c b/src/H5Doh.c index bbf2cb2..db7cae1 100644 --- a/src/H5Doh.c +++ b/src/H5Doh.c @@ -108,7 +108,7 @@ H5O_dset_get_copy_file_udata(void) { void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_dset_get_copy_file_udata) + FUNC_ENTER_NOAPI_NOINIT /* Allocate space for the 'copy file' user data for copying datasets */ if(NULL == (ret_value = H5FL_CALLOC(H5D_copy_file_ud_t))) @@ -141,7 +141,7 @@ H5O_dset_free_copy_file_udata(void *_udata) { H5D_copy_file_ud_t *udata = (H5D_copy_file_ud_t *)_udata; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_dset_free_copy_file_udata) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ HDassert(udata); @@ -186,13 +186,13 @@ H5O_dset_free_copy_file_udata(void *_udata) * *------------------------------------------------------------------------- */ -htri_t +static htri_t H5O_dset_isa(H5O_t *oh) { htri_t exists; /* Flag if header message of interest exists */ htri_t ret_value = TRUE; /* Return value */ - FUNC_ENTER_NOAPI(H5O_dset_isa, FAIL) + FUNC_ENTER_NOAPI_NOINIT HDassert(oh); @@ -234,7 +234,7 @@ H5O_dset_open(const H5G_loc_t *obj_loc, hid_t lapl_id, hid_t dxpl_id, hbool_t ap hid_t dapl_id; /* dapl to use to open this dataset */ hid_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_dset_open) + FUNC_ENTER_NOAPI_NOINIT HDassert(obj_loc); @@ -287,7 +287,7 @@ H5O_dset_create(H5F_t *f, void *_crt_info, H5G_loc_t *obj_loc, hid_t dxpl_id) H5D_t *dset = NULL; /* New dataset created */ void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_dset_create) + FUNC_ENTER_NOAPI_NOINIT /* Sanity checks */ HDassert(f); @@ -335,7 +335,7 @@ H5O_dset_get_oloc(hid_t obj_id) H5D_t *dset; /* Dataset opened */ H5O_loc_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_dset_get_oloc) + FUNC_ENTER_NOAPI_NOINIT /* Get the dataset */ if(NULL == (dset = (H5D_t *)H5I_object(obj_id))) @@ -376,7 +376,7 @@ H5O_dset_bh_info(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t *bh_info) htri_t exists; /* Flag if header message of interest exists */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_dset_bh_info) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(f); diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h index 7fe7e3e..faafd4d 100644 --- a/src/H5Dpkg.h +++ b/src/H5Dpkg.h @@ -590,7 +590,7 @@ H5_DLLVAR const H5B2_class_t H5D_BT2_FILT[1]; H5_DLL H5D_t *H5D_create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id, hid_t dapl_id, hid_t dxpl_id); -H5_DLL H5D_t *H5D_create_named(const H5G_loc_t *loc, const char *name, +H5_DLL H5D_t *H5D__create_named(const H5G_loc_t *loc, const char *name, hid_t type_id, const H5S_t *space, hid_t lcpl_id, hid_t dcpl_id, hid_t dapl_id, hid_t dxpl_id); H5_DLL herr_t H5D_get_space_status(H5D_t *dset, H5D_space_status_t *allocation, diff --git a/src/H5Dprivate.h b/src/H5Dprivate.h index 666f969..66b6e56 100644 --- a/src/H5Dprivate.h +++ b/src/H5Dprivate.h @@ -72,6 +72,8 @@ #define H5D_XFER_MPIO_CHUNK_OPT_HARD_NAME "mpio_chunk_opt_hard" #define H5D_XFER_MPIO_CHUNK_OPT_NUM_NAME "mpio_chunk_opt_num" #define H5D_XFER_MPIO_CHUNK_OPT_RATIO_NAME "mpio_chunk_opt_ratio" +#define H5D_MPIO_ACTUAL_CHUNK_OPT_MODE_NAME "actual_chunk_opt_mode" +#define H5D_MPIO_ACTUAL_IO_MODE_NAME "actual_io_mode" #endif /* H5_HAVE_PARALLEL */ #define H5D_XFER_EDC_NAME "err_detect" /* EDC */ #define H5D_XFER_FILTER_CB_NAME "filter_cb" /* Filter callback function */ diff --git a/src/H5Dproxy.c b/src/H5Dproxy.c index 9124dac..7f3a566 100644 --- a/src/H5Dproxy.c +++ b/src/H5Dproxy.c @@ -132,7 +132,7 @@ H5D_cache_proxy_load(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, haddr_t UNUSED addr, { H5D_chunk_proxy_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_cache_proxy_load) + FUNC_ENTER_NOAPI_NOINIT /* This routine should never be invoked! */ HDassert(0 && "H5D_cache_proxy_load called!?!"); @@ -163,7 +163,7 @@ H5D_cache_proxy_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_cache_proxy_flush) + FUNC_ENTER_NOAPI_NOINIT #ifdef QAK HDfprintf(stderr, "%s: Flushing chunk proxy, addr = %a, destroy = %u\n", FUNC, addr, (unsigned)destroy); #endif /* QAK */ @@ -219,7 +219,7 @@ H5D_cache_proxy_dest(H5F_t UNUSED *f, H5D_chunk_proxy_t *proxy) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_cache_proxy_dest) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -253,7 +253,7 @@ H5D_cache_proxy_clear(H5F_t *f, H5D_chunk_proxy_t *proxy, hbool_t destroy) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_cache_proxy_clear) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -291,7 +291,7 @@ static herr_t H5D_cache_proxy_size(const H5F_t UNUSED *f, const H5D_chunk_proxy_t UNUSED *proxy, size_t *size_ptr) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_cache_proxy_size) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check arguments */ HDassert(f); @@ -327,7 +327,7 @@ H5D_chunk_proxy_create(H5D_t *dset, hid_t dxpl_id, H5D_chunk_ud_t *udata, htri_t supported; /* Return value from "support" callback */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_chunk_proxy_create) + FUNC_ENTER_NOAPI_NOINIT HDassert(dset); HDassert(ent); @@ -401,7 +401,7 @@ H5D_chunk_proxy_remove(const H5D_t *dset, hid_t dxpl_id, H5D_rdcc_ent_t *ent) H5D_chunk_proxy_t *proxy = NULL; /* Chunk proxy */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_chunk_proxy_remove) + FUNC_ENTER_NOAPI_NOINIT HDassert(dset); HDassert(ent); @@ -485,7 +485,7 @@ H5D_chunk_proxy_mark(H5D_rdcc_ent_t *ent, hbool_t dirty) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_chunk_proxy_mark) + FUNC_ENTER_NOAPI_NOINIT HDassert(ent); #ifdef QAK @@ -518,7 +518,7 @@ done: static herr_t H5D_chunk_proxy_destroy(H5D_chunk_proxy_t *proxy) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_chunk_proxy_destroy) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(proxy); @@ -549,7 +549,7 @@ H5D_chunk_proxy_create_flush_dep(H5D_rdcc_ent_t *ent, void *parent) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_chunk_proxy_create_flush_dep) + FUNC_ENTER_NOAPI_NOINIT HDassert(ent); HDassert(parent); @@ -586,7 +586,7 @@ H5D_chunk_proxy_update_flush_dep(H5D_rdcc_ent_t *ent, void *old_parent, { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_chunk_proxy_update_flush_dep) + FUNC_ENTER_NOAPI_NOINIT HDassert(ent); HDassert(old_parent); diff --git a/src/H5Dscatgath.c b/src/H5Dscatgath.c index ed73f3c..7758619 100644 --- a/src/H5Dscatgath.c +++ b/src/H5Dscatgath.c @@ -108,7 +108,7 @@ H5D_scatter_file(const H5D_io_info_t *_io_info, size_t nelem; /* Number of elements used in sequences */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_scatter_file) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(_io_info); @@ -207,7 +207,7 @@ H5D_gather_file(const H5D_io_info_t *_io_info, size_t nelem; /* Number of elements used in sequences */ size_t ret_value = nelmts; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_gather_file) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(_io_info); @@ -301,7 +301,7 @@ H5D_scatter_mem (const void *_tscat_buf, const H5S_t *space, size_t nelem; /* Number of elements used in sequences */ herr_t ret_value = SUCCEED; /* Number of elements scattered */ - FUNC_ENTER_NOAPI(H5D_scatter_mem, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args */ HDassert(tscat_buf); @@ -388,7 +388,7 @@ H5D_gather_mem(const void *_buf, const H5S_t *space, size_t nelem; /* Number of elements used in sequences */ size_t ret_value = nelmts; /* Number of elements gathered */ - FUNC_ENTER_NOAPI_NOINIT(H5D_gather_mem) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(buf); @@ -469,7 +469,7 @@ H5D_scatgath_read(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info size_t smine_nelmts; /*elements per strip */ herr_t ret_value = SUCCEED; /*return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_scatgath_read) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(io_info); @@ -601,7 +601,7 @@ H5D_scatgath_write(const H5D_io_info_t *io_info, const H5D_type_info_t *type_inf size_t smine_nelmts; /*elements per strip */ herr_t ret_value = SUCCEED; /*return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_scatgath_write) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(io_info); @@ -750,7 +750,7 @@ H5D_compound_opt_read(size_t nelmts, const H5S_t *space, size_t src_stride, dst_stride, copy_size; herr_t ret_value = SUCCEED; /*return value */ - FUNC_ENTER_NOAPI_NOINIT(H5D_compound_opt_read) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(nelmts > 0); @@ -875,7 +875,7 @@ H5D_compound_opt_write(size_t nelmts, const H5D_type_info_t *type_info) size_t src_stride, dst_stride; /* Strides through source & destination datatypes */ size_t i; /* Local index variable */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_compound_opt_write) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(nelmts > 0); diff --git a/src/H5Dselect.c b/src/H5Dselect.c index 6dade5c..d75b7ed 100644 --- a/src/H5Dselect.c +++ b/src/H5Dselect.c @@ -102,7 +102,7 @@ H5D_select_io(const H5D_io_info_t *io_info, size_t elmt_size, ssize_t tmp_file_len; /* Temporary number of bytes in file sequence */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5D_select_io, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args */ HDassert(io_info); @@ -266,7 +266,7 @@ H5D_select_read(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info, { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5D_select_read, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Call generic selection operation */ H5_CHECK_OVERFLOW(nelmts, hsize_t, size_t); @@ -297,7 +297,7 @@ H5D_select_write(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info, { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5D_select_write, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Call generic selection operation */ H5_CHECK_OVERFLOW(nelmts, hsize_t, size_t); diff --git a/src/H5Dtest.c b/src/H5Dtest.c index 68208b3..8136dd7 100644 --- a/src/H5Dtest.c +++ b/src/H5Dtest.c @@ -87,7 +87,7 @@ H5D_layout_version_test(hid_t did, unsigned *version) H5D_t *dset; /* Pointer to dataset to query */ herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_NOAPI(H5D_layout_version_test, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args */ if(NULL == (dset = (H5D_t *)H5I_object_verify(did, H5I_DATASET))) @@ -126,7 +126,7 @@ H5D_layout_contig_size_test(hid_t did, hsize_t *size) H5D_t *dset; /* Pointer to dataset to query */ herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_NOAPI(H5D_layout_contig_size_test, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args */ if(NULL == (dset = (H5D_t *)H5I_object_verify(did, H5I_DATASET))) @@ -167,7 +167,7 @@ H5D_layout_idx_type_test(hid_t did, H5D_chunk_index_t *idx_type) H5D_t *dset; /* Pointer to dataset to query */ herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_NOAPI(H5D_layout_idx_type_test, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args */ if(NULL == (dset = (H5D_t *)H5I_object_verify(did, H5I_DATASET))) @@ -208,7 +208,7 @@ H5D_current_cache_size_test(hid_t did, size_t *nbytes_used, int *nused) H5D_t *dset; /* Pointer to dataset to query */ herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_NOAPI(H5D_current_cache_size_test, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args */ if(NULL == (dset = (H5D_t *)H5I_object_verify(did, H5I_DATASET))) diff --git a/src/H5E.c b/src/H5E.c index 7a81d32..4e14887 100644 --- a/src/H5E.c +++ b/src/H5E.c @@ -144,7 +144,7 @@ H5E_init(void) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5E_init, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* FUNC_ENTER() does all the work */ done: @@ -168,7 +168,7 @@ done: static herr_t H5E_set_default_auto(H5E_t *stk) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5E_set_default_auto) + FUNC_ENTER_NOAPI_NOINIT_NOERR #ifndef H5_NO_DEPRECATED_SYMBOLS #ifdef H5_USE_16_API_DEFAULT @@ -210,7 +210,7 @@ H5E_init_interface(void) char lib_vers[128]; /* Buffer to constructu library version within */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5E_init_interface) + FUNC_ENTER_NOAPI_NOINIT /* Initialize the atom group for the error class IDs */ if(H5I_register_type(H5I_ERROR_CLASS, (size_t)H5I_ERRCLS_HASHSIZE, H5E_RESERVED_ATOMS, @@ -268,7 +268,7 @@ H5E_term_interface(void) { int n = 0; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5E_term_interface) + FUNC_ENTER_NOAPI_NOINIT_NOERR if(H5_interface_initialize_g) { int ncls, nmsg, nstk; @@ -341,7 +341,7 @@ H5E_get_stack(void) { H5E_t *estack; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5E_get_stack) + FUNC_ENTER_NOAPI_NOINIT_NOERR estack = (H5E_t *)H5TS_get_thread_local_value(H5TS_errstk_key_g); @@ -382,7 +382,7 @@ H5E_get_stack(void) static herr_t H5E_free_class(H5E_cls_t *cls) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5E_free_class) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments */ HDassert(cls); @@ -415,7 +415,7 @@ H5Eregister_class(const char *cls_name, const char *lib_name, const char *versio H5E_cls_t *cls; /* Pointer to error class */ hid_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Eregister_class, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("i", "*s*s*s", cls_name, lib_name, version); /* Check arguments */ @@ -453,7 +453,7 @@ H5E_register_class(const char *cls_name, const char *lib_name, const char *versi H5E_cls_t *cls = NULL; /* Pointer to error class */ H5E_cls_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5E_register_class) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments */ HDassert(cls_name); @@ -501,7 +501,7 @@ H5Eunregister_class(hid_t class_id) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Eunregister_class, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", class_id); /* Check arguments */ @@ -537,7 +537,7 @@ H5E_unregister_class(H5E_cls_t *cls) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5E_unregister_class) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments */ HDassert(cls); @@ -574,7 +574,7 @@ H5Eget_class_name(hid_t class_id, char *name, size_t size) H5E_cls_t *cls; /* Pointer to error class */ ssize_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Eget_class_name, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("Zs", "i*sz", class_id, name, size); /* Get the error class */ @@ -608,7 +608,7 @@ H5E_get_class_name(const H5E_cls_t *cls, char *name, size_t size) { ssize_t len; /* Length of error class's name */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5E_get_class_name) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments */ HDassert(cls); @@ -648,7 +648,7 @@ H5E_close_msg_cb(void *obj_ptr, hid_t obj_id, void *key) H5E_cls_t *cls = (H5E_cls_t*)key; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5E_close_msg_cb) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments */ HDassert(err_msg); @@ -683,7 +683,7 @@ H5Eclose_msg(hid_t err_id) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Eclose_msg, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", err_id); /* Check arguments */ @@ -714,7 +714,7 @@ done: static herr_t H5E_close_msg(H5E_msg_t *err) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5E_close_msg) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments */ HDassert(err); @@ -747,7 +747,7 @@ H5Ecreate_msg(hid_t class_id, H5E_type_t msg_type, const char *msg_str) H5E_msg_t *msg; /* Pointer to new error message */ hid_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Ecreate_msg, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("i", "iEt*s", class_id, msg_type, msg_str); /* Check arguments */ @@ -790,7 +790,7 @@ H5E_create_msg(H5E_cls_t *cls, H5E_type_t msg_type, const char *msg_str) H5E_msg_t *msg = NULL; /* Pointer to new error message */ H5E_msg_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5E_create_msg) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments */ HDassert(cls); @@ -838,7 +838,7 @@ H5Eget_msg(hid_t msg_id, H5E_type_t *type, char *msg_str, size_t size) H5E_msg_t *msg; /* Pointer to error message */ ssize_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Eget_msg, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE4("Zs", "i*Et*sz", msg_id, type, msg_str, size); /* Get the message object */ @@ -872,7 +872,7 @@ H5Ecreate_stack(void) H5E_t *stk; /* Error stack */ hid_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Ecreate_stack, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE0("i",""); /* Allocate a new error stack */ @@ -911,7 +911,7 @@ H5Eget_current_stack(void) hid_t ret_value; /* Return value */ /* Don't clear the error stack! :-) */ - FUNC_ENTER_API_NOCLEAR(H5Eget_current_stack, FAIL) + FUNC_ENTER_API_NOCLEAR(FAIL) H5TRACE0("i",""); /* Get the current stack */ @@ -947,7 +947,7 @@ H5E_get_current_stack(void) unsigned u; /* Local index variable */ H5E_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5E_get_current_stack) + FUNC_ENTER_NOAPI_NOINIT /* Get a pointer to the current error stack */ if(NULL == (current_stack = H5E_get_my_stack())) /*lint !e506 !e774 Make lint 'constant value Boolean' in non-threaded case */ @@ -1028,7 +1028,7 @@ H5Eset_current_stack(hid_t err_stack) H5E_t *estack; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Eset_current_stack, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", err_stack); if(err_stack != H5E_DEFAULT) { @@ -1071,7 +1071,7 @@ H5E_set_current_stack(H5E_t *estack) unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5E_set_current_stack) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(estack); @@ -1133,7 +1133,7 @@ H5Eclose_stack(hid_t stack_id) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Eclose_stack, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", stack_id); if(H5E_DEFAULT != stack_id) { @@ -1169,7 +1169,7 @@ done: static herr_t H5E_close_stack(H5E_t *estack) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5E_close_stack) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ HDassert(estack); @@ -1203,7 +1203,7 @@ H5Eget_num(hid_t error_stack_id) ssize_t ret_value; /* Return value */ /* Don't clear the error stack! :-) */ - FUNC_ENTER_API_NOCLEAR(H5Eget_num, FAIL) + FUNC_ENTER_API_NOCLEAR(FAIL) H5TRACE1("Zs", "i", error_stack_id); /* Need to check for errors */ @@ -1244,7 +1244,7 @@ done: static ssize_t H5E_get_num(const H5E_t *estack) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5E_get_num) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(estack); @@ -1271,7 +1271,7 @@ H5Epop(hid_t err_stack, size_t count) herr_t ret_value = SUCCEED; /* Return value */ /* Don't clear the error stack! :-) */ - FUNC_ENTER_API_NOCLEAR(H5Epop, FAIL) + FUNC_ENTER_API_NOCLEAR(FAIL) H5TRACE2("e", "iz", err_stack, count); /* Need to check for errors */ @@ -1333,11 +1333,13 @@ H5Epush2(hid_t err_stack, const char *file, const char *func, unsigned line, int desc_len; /* Actual length of description when formatted */ #endif /* H5_HAVE_VASPRINTF */ char *tmp = NULL; /* Buffer to place formatted description in */ + hbool_t va_started = FALSE; /* Whether the variable argument list is open */ herr_t ret_value=SUCCEED; /* Return value */ /* Don't clear the error stack! :-) */ - FUNC_ENTER_API_NOCLEAR(H5Epush2, FAIL) - H5TRACE7("e","issIuiis",err_stack,file,func,line,maj_id,min_id,fmt); + FUNC_ENTER_API_NOCLEAR(FAIL) + H5TRACE8("e", "i*s*sIuiii*s", err_stack, file, func, line, cls_id, maj_id, + min_id, fmt); if(err_stack == H5E_DEFAULT) estack = NULL; @@ -1357,6 +1359,7 @@ H5Epush2(hid_t err_stack, const char *file, const char *func, unsigned line, /* Format the description */ va_start(ap, fmt); + va_started = TRUE; #ifdef H5_HAVE_VASPRINTF /* Use the vasprintf() routine, since it does what we're trying to do below */ @@ -1398,13 +1401,13 @@ H5Epush2(hid_t err_stack, const char *file, const char *func, unsigned line, } /* end while */ #endif /* H5_HAVE_VASPRINTF */ - va_end(ap); - /* Push the error on the stack */ if(H5E_push_stack(estack, file, func, line, cls_id, maj_id, min_id, tmp) < 0) HGOTO_ERROR(H5E_ERROR, H5E_CANTSET, FAIL, "can't push error on stack") done: + if(va_started) + va_end(ap); if(tmp) H5MM_xfree(tmp); @@ -1431,7 +1434,7 @@ H5Eclear2(hid_t err_stack) herr_t ret_value = SUCCEED; /* Return value */ /* Don't clear the error stack! :-) */ - FUNC_ENTER_API_NOCLEAR(H5Eclear2, FAIL) + FUNC_ENTER_API_NOCLEAR(FAIL) H5TRACE1("e", "i", err_stack); /* Need to check for errors */ @@ -1476,7 +1479,7 @@ H5Eprint2(hid_t err_stack, FILE *stream) herr_t ret_value = SUCCEED; /* Return value */ /* Don't clear the error stack! :-) */ - FUNC_ENTER_API_NOCLEAR(H5Eprint2, FAIL) + FUNC_ENTER_API_NOCLEAR(FAIL) /*NO TRACE*/ /* Need to check for errors */ @@ -1522,7 +1525,7 @@ H5Ewalk2(hid_t err_stack, H5E_direction_t direction, H5E_walk2_t stack_func, voi herr_t ret_value = SUCCEED; /* Return value */ /* Don't clear the error stack! :-) */ - FUNC_ENTER_API_NOCLEAR(H5Ewalk2, FAIL) + FUNC_ENTER_API_NOCLEAR(FAIL) /*NO TRACE*/ /* Need to check for errors */ @@ -1576,7 +1579,7 @@ H5Eget_auto2(hid_t estack_id, H5E_auto2_t *func, void **client_data) H5E_auto_op_t op; /* Error stack function */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Eget_auto2, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("e", "i*x**x", estack_id, func, client_data); if(estack_id == H5E_DEFAULT) { @@ -1638,7 +1641,7 @@ H5Eset_auto2(hid_t estack_id, H5E_auto2_t func, void *client_data) herr_t ret_value = SUCCEED; /* Return value */ /* Don't clear the error stack! :-) */ - FUNC_ENTER_API_NOCLEAR(H5Eset_auto2, FAIL) + FUNC_ENTER_API_NOCLEAR(FAIL) H5TRACE3("e", "ix*x", estack_id, func, client_data); if(estack_id == H5E_DEFAULT) { @@ -1695,7 +1698,7 @@ H5Eauto_is_v2(hid_t estack_id, unsigned *is_stack) H5E_t *estack; /* Error stack to operate on */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Eauto_is_v2, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*Iu", estack_id, is_stack); if(estack_id == H5E_DEFAULT) { diff --git a/src/H5Edeprec.c b/src/H5Edeprec.c index 0a028d9..0d3083b 100644 --- a/src/H5Edeprec.c +++ b/src/H5Edeprec.c @@ -99,7 +99,7 @@ DESCRIPTION static herr_t H5E_init_deprec_interface(void) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5E_init_deprec_interface) + FUNC_ENTER_NOAPI_NOINIT_NOERR FUNC_LEAVE_NOAPI(H5E_init()) } /* H5E_init_deprec_interface() */ @@ -127,7 +127,7 @@ H5Eget_major(H5E_major_t maj) char *msg_str = NULL; char *ret_value; /* Return value */ - FUNC_ENTER_API_NOCLEAR(H5Eget_major, NULL) + FUNC_ENTER_API_NOCLEAR(NULL) /* Get the message object */ if(NULL == (msg = (H5E_msg_t *)H5I_object_verify(maj, H5I_ERROR_MSG))) @@ -179,7 +179,7 @@ H5Eget_minor(H5E_minor_t min) char *msg_str = NULL; char *ret_value; /* Return value */ - FUNC_ENTER_API_NOCLEAR(H5Eget_minor, NULL) + FUNC_ENTER_API_NOCLEAR(NULL) /* Get the message object */ if(NULL == (msg = (H5E_msg_t *)H5I_object_verify(min, H5I_ERROR_MSG))) @@ -236,7 +236,7 @@ H5Epush1(const char *file, const char *func, unsigned line, herr_t ret_value = SUCCEED; /* Return value */ /* Don't clear the error stack! :-) */ - FUNC_ENTER_API_NOCLEAR(H5Epush1, FAIL) + FUNC_ENTER_API_NOCLEAR(FAIL) H5TRACE6("e", "*s*sIuii*s", file, func, line, maj, min, str); /* Push the error on the default error stack */ @@ -267,7 +267,7 @@ H5Eclear1(void) herr_t ret_value = SUCCEED; /* Return value */ /* Don't clear the error stack! :-) */ - FUNC_ENTER_API_NOCLEAR(H5Eclear1, FAIL) + FUNC_ENTER_API_NOCLEAR(FAIL) H5TRACE0("e",""); /* Clear the default error stack */ @@ -302,7 +302,7 @@ H5Eprint1(FILE *stream) herr_t ret_value = SUCCEED; /* Return value */ /* Don't clear the error stack! :-) */ - FUNC_ENTER_API_NOCLEAR(H5Eprint1, FAIL) + FUNC_ENTER_API_NOCLEAR(FAIL) /*NO TRACE*/ if(NULL == (estack = H5E_get_my_stack())) /*lint !e506 !e774 Make lint 'constant value Boolean' in non-threaded case */ @@ -339,7 +339,7 @@ H5Ewalk1(H5E_direction_t direction, H5E_walk1_t func, void *client_data) herr_t ret_value = SUCCEED; /* Return value */ /* Don't clear the error stack! :-) */ - FUNC_ENTER_API_NOCLEAR(H5Ewalk1, FAIL) + FUNC_ENTER_API_NOCLEAR(FAIL) /*NO TRACE*/ if(NULL == (estack = H5E_get_my_stack())) /*lint !e506 !e774 Make lint 'constant value Boolean' in non-threaded case */ @@ -384,7 +384,7 @@ H5Eget_auto1(H5E_auto1_t *func, void **client_data) H5E_auto_op_t auto_op; /* Error stack operator */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Eget_auto1, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "*x**x", func, client_data); /* Retrieve default error stack */ @@ -441,7 +441,7 @@ H5Eset_auto1(H5E_auto1_t func, void *client_data) herr_t ret_value = SUCCEED; /* Return value */ /* Don't clear the error stack! :-) */ - FUNC_ENTER_API_NOCLEAR(H5Eset_auto1, FAIL) + FUNC_ENTER_API_NOCLEAR(FAIL) H5TRACE2("e", "x*x", func, client_data); if(NULL == (estack = H5E_get_my_stack())) /*lint !e506 !e774 Make lint 'constant value Boolean' in non-threaded case */ diff --git a/src/H5Eint.c b/src/H5Eint.c index f650581..594a69a 100644 --- a/src/H5Eint.c +++ b/src/H5Eint.c @@ -132,7 +132,7 @@ DESCRIPTION static herr_t H5E_init_int_interface(void) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5E_init_int_interface) + FUNC_ENTER_NOAPI_NOINIT_NOERR FUNC_LEAVE_NOAPI(H5E_init()) } /* H5E_init_int_interface() */ @@ -156,7 +156,7 @@ H5E_get_msg(const H5E_msg_t *msg, H5E_type_t *type, char *msg_str, size_t size) { ssize_t len; /* Length of error message */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5E_get_msg) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments */ HDassert(msg); @@ -227,7 +227,7 @@ H5E_walk1_cb(int n, H5E_error1_t *err_desc, void *client_data) unsigned have_desc = 1; /* Flag to indicate whether the error has a "real" description */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5E_walk1_cb) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments */ HDassert(err_desc); @@ -349,7 +349,7 @@ H5E_walk2_cb(unsigned n, const H5E_error2_t *err_desc, void *client_data) unsigned have_desc = 1; /* Flag to indicate whether the error has a "real" description */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5E_walk2_cb) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments */ HDassert(err_desc); @@ -450,8 +450,7 @@ H5E_print(const H5E_t *estack, FILE *stream, hbool_t bk_compatible) H5E_walk_op_t walk_op; /* Error stack walking callback */ herr_t ret_value = SUCCEED; - /* Don't clear the error stack! :-) */ - FUNC_ENTER_NOAPI_NOINIT(H5E_print) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(estack); @@ -526,7 +525,7 @@ H5E_walk(const H5E_t *estack, H5E_direction_t direction, const H5E_walk_op_t *op herr_t status; /* Status from callback function */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5E_walk) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(estack); @@ -620,7 +619,7 @@ done: herr_t H5E_get_auto(const H5E_t *estack, H5E_auto_op_t *op, void **client_data) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5E_get_auto) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(estack); @@ -660,7 +659,7 @@ H5E_get_auto(const H5E_t *estack, H5E_auto_op_t *op, void **client_data) herr_t H5E_set_auto(H5E_t *estack, const H5E_auto_op_t *op, void *client_data) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5E_set_auto) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(estack); @@ -694,6 +693,7 @@ H5E_printf_stack(H5E_t *estack, const char *file, const char *func, unsigned lin int desc_len; /* Actual length of description when formatted */ #endif /* H5_HAVE_VASPRINTF */ char *tmp = NULL; /* Buffer to place formatted description in */ + hbool_t va_started = FALSE; /* Whether the variable argument list is open */ herr_t ret_value = SUCCEED; /* Return value */ /* @@ -703,7 +703,7 @@ H5E_printf_stack(H5E_t *estack, const char *file, const char *func, unsigned lin * HERROR(). HERROR() is called by HRETURN_ERROR() which could * be called by FUNC_ENTER(). */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5E_printf_stack) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ HDassert(cls_id > 0); @@ -718,6 +718,7 @@ H5E_printf_stack(H5E_t *estack, const char *file, const char *func, unsigned lin /* Start the variable-argument parsing */ va_start(ap, fmt); + va_started = TRUE; #ifdef H5_HAVE_VASPRINTF /* Use the vasprintf() routine, since it does what we're trying to do below */ @@ -759,13 +760,13 @@ H5E_printf_stack(H5E_t *estack, const char *file, const char *func, unsigned lin } /* end while */ #endif /* H5_HAVE_VASPRINTF */ - va_end(ap); - /* Push the error on the stack */ if(H5E_push_stack(estack, file, func, line, cls_id, maj_id, min_id, tmp) < 0) HGOTO_DONE(FAIL) done: + if(va_started) + va_end(ap); if(tmp) H5MM_xfree(tmp); @@ -806,7 +807,7 @@ H5E_push_stack(H5E_t *estack, const char *file, const char *func, unsigned line, * HERROR(). HERROR() is called by HRETURN_ERROR() which could * be called by FUNC_ENTER(). */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5E_push_stack) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ HDassert(cls_id > 0); @@ -880,7 +881,7 @@ H5E_clear_entries(H5E_t *estack, size_t nentries) unsigned u; /* Local index variable */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5E_clear_entries) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(estack); @@ -934,7 +935,7 @@ H5E_clear_stack(H5E_t *estack) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5E_clear_stack, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check for 'default' error stack */ if(estack == NULL) @@ -970,7 +971,7 @@ H5E_pop(H5E_t *estack, size_t count) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5E_pop) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(estack); @@ -1004,7 +1005,7 @@ H5E_dump_api_stack(hbool_t is_api) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5E_dump_api_stack, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Only dump the error stack during an API call */ if(is_api) { diff --git a/src/H5Eprivate.h b/src/H5Eprivate.h index 1e5ada1..2ca48d2 100644 --- a/src/H5Eprivate.h +++ b/src/H5Eprivate.h @@ -126,7 +126,7 @@ extern int H5E_mpi_error_str_len; * error number, a description of the error (as a printf-like format string), * and an optional set of arguments for the printf format arguments. */ -#define H5E_PRINTF(...) H5E_printf_stack(NULL, __FILE__, FUNCNAME, __LINE__, H5E_ERR_CLS_g, H5_MY_PKG_ERR, __VA_ARGS__) +#define H5E_PRINTF(...) H5E_printf_stack(NULL, __FILE__, FUNC, __LINE__, H5E_ERR_CLS_g, H5_MY_PKG_ERR, __VA_ARGS__) /* * H5_LEAVE macro, used to facilitate control flow between a diff --git a/src/H5F.c b/src/H5F.c index 8bc1b9d..d152448 100644 --- a/src/H5F.c +++ b/src/H5F.c @@ -35,19 +35,6 @@ #include "H5SMprivate.h" /* Shared Object Header Messages */ #include "H5Tprivate.h" /* Datatypes */ -/* Predefined file drivers */ -#include "H5FDcore.h" /*temporary in-memory files */ -#include "H5FDfamily.h" /*family of files */ -#include "H5FDlog.h" /* sec2 driver with logging, for debugging */ -#include "H5FDmpi.h" /* MPI-based file drivers */ -#include "H5FDmulti.h" /*multiple files partitioned by mem usage */ -#include "H5FDsec2.h" /*Posix unbuffered I/O */ -#include "H5FDstdio.h" /* Standard C buffered I/O */ -#ifdef H5_HAVE_WINDOWS -#include "H5FDwindows.h" /* Windows buffered I/O */ -#endif -#include "H5FDdirect.h" /*Linux direct I/O */ - /* Struct only used by functions H5F_get_objects and H5F_get_objects_cb */ typedef struct H5F_olist_t { H5I_type_t obj_type; /* Type of object to look for */ @@ -99,7 +86,7 @@ H5F_init(void) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5F_init, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* FUNC_ENTER() does all the work */ done: @@ -125,7 +112,7 @@ H5F_init_interface(void) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5F_init_interface) + FUNC_ENTER_NOAPI_NOINIT /* * Initialize the atom group for the file IDs. @@ -161,7 +148,7 @@ H5F_term_interface(void) { int n = 0; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5F_term_interface) + FUNC_ENTER_NOAPI_NOINIT_NOERR if(H5_interface_initialize_g) { if((n = H5I_nmembers(H5I_FILE)) != 0) { @@ -202,7 +189,7 @@ H5Fget_create_plist(hid_t file_id) H5P_genplist_t *plist; /* Property list */ hid_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Fget_create_plist, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("i", "i", file_id); /* check args */ @@ -247,7 +234,7 @@ H5Fget_access_plist(hid_t file_id) H5F_t *f; /* File info */ hid_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Fget_access_plist, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("i", "i", file_id); /* Check args */ @@ -295,7 +282,7 @@ H5F_get_access_plist(H5F_t *f, hbool_t app_ref) unsigned efc_size = 0; hid_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI(H5F_get_access_plist, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args */ HDassert(f); @@ -390,7 +377,7 @@ H5Fget_obj_count(hid_t file_id, unsigned types) H5F_t *f = NULL; /* File to query */ ssize_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Fget_obj_count, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("Zs", "iIu", file_id, types); if(file_id != (hid_t)H5F_OBJ_ALL && (NULL == (f = (H5F_t *)H5I_object_verify(file_id, H5I_FILE)))) @@ -430,7 +417,7 @@ H5F_get_obj_count(const H5F_t *f, unsigned types, hbool_t app_ref) { size_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5F_get_obj_count) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* H5F_get_objects doesn't fail */ ret_value = H5F_get_objects(f, types, 0, NULL, app_ref); @@ -463,7 +450,7 @@ H5Fget_obj_ids(hid_t file_id, unsigned types, size_t max_objs, hid_t *oid_list) H5F_t *f = NULL; /* File to query */ ssize_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Fget_obj_ids, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE4("Zs", "iIuz*i", file_id, types, max_objs, oid_list); if(file_id != (hid_t)H5F_OBJ_ALL && (NULL == (f = (H5F_t *)H5I_object_verify(file_id, H5I_FILE)))) @@ -503,7 +490,7 @@ H5F_get_obj_ids(const H5F_t *f, unsigned types, size_t max_objs, hid_t *oid_list { size_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5F_get_obj_ids) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* H5F_get_objects doesn't fail */ ret_value = H5F_get_objects(f, types, max_objs, oid_list, app_ref); @@ -532,7 +519,7 @@ H5F_get_objects(const H5F_t *f, unsigned types, size_t max_index, hid_t *obj_id_ H5F_olist_t olist; /* Structure to hold search results */ size_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5F_get_objects) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Set up search information */ olist.obj_id_list = (max_index==0 ? NULL : obj_id_list); @@ -616,7 +603,7 @@ H5F_get_objects_cb(void *obj_ptr, hid_t obj_id, void *key) H5F_olist_t *olist = (H5F_olist_t *)key; /* Alias for search info */ int ret_value = FALSE; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5F_get_objects_cb) + FUNC_ENTER_NOAPI_NOINIT HDassert(obj_ptr); HDassert(olist); @@ -736,7 +723,7 @@ H5Fget_vfd_handle(hid_t file_id, hid_t fapl, void **file_handle) H5F_t *file; /* File to query */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Fget_vfd_handle, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("e", "ii**x", file_id, fapl, file_handle); /* Check args */ @@ -782,7 +769,7 @@ H5Fis_hdf5(const char *name) H5FD_t *file = NULL; /* Low-level file struct */ htri_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Fis_hdf5, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("t", "*s", name); /* Check args and all the boring stuff. */ @@ -833,7 +820,7 @@ H5F_new(H5F_file_t *shared, hid_t fcpl_id, hid_t fapl_id, H5FD_t *lf) { H5F_t *f = NULL, *ret_value; - FUNC_ENTER_NOAPI_NOINIT(H5F_new) + FUNC_ENTER_NOAPI_NOINIT if(NULL == (f = H5FL_CALLOC(H5F_t))) HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, NULL, "can't allocate top file structure") @@ -934,7 +921,7 @@ H5F_new(H5F_file_t *shared, hid_t fcpl_id, hid_t fapl_id, H5FD_t *lf) * merged into the trunk and journaling is enabled, at least until * we make it work. - QAK) */ - f->shared->use_tmp_space = !(IS_H5FD_MPI(f)); + f->shared->use_tmp_space = !H5F_HAS_FEATURE(f, H5FD_FEAT_HAS_MPI); /* * Create a metadata cache with the specified number of elements. @@ -994,7 +981,7 @@ H5F_dest(H5F_t *f, hid_t dxpl_id, hbool_t flush) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5F_dest) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(f); @@ -1180,7 +1167,7 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, H5F_close_degree_t fc_degree; /*file close degree */ H5F_t *ret_value; /*actual return value */ - FUNC_ENTER_NOAPI(H5F_open, NULL) + FUNC_ENTER_NOAPI(NULL) /* * If the driver has a `cmp' method then the driver is capable of @@ -1408,7 +1395,7 @@ H5Fcreate(const char *filename, unsigned flags, hid_t fcpl_id, hid_t fapl_id) H5F_t *new_file = NULL; /*file struct for new file */ hid_t ret_value; /*return value */ - FUNC_ENTER_API(H5Fcreate, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE4("i", "*sIuii", filename, flags, fcpl_id, fapl_id); /* Check/fix arguments */ @@ -1514,7 +1501,7 @@ H5Fopen(const char *filename, unsigned flags, hid_t fapl_id) H5F_t *new_file = NULL; /*file struct for new file */ hid_t ret_value; /*return value */ - FUNC_ENTER_API(H5Fopen, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("i", "*sIui", filename, flags, fapl_id); /* Check/fix arguments. */ @@ -1576,7 +1563,7 @@ H5Fflush(hid_t object_id, H5F_scope_t scope) H5O_loc_t *oloc = NULL; /* Object location for ID */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Fflush, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "iFs", object_id, scope); switch(H5I_get_type(object_id)) { @@ -1693,7 +1680,7 @@ H5F_flush(H5F_t *f, hid_t dxpl_id, hbool_t closing) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5F_flush, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Sanity check arguments */ HDassert(f); @@ -1762,7 +1749,7 @@ H5F_close(H5F_t *f) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5F_close) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(f); @@ -1822,7 +1809,7 @@ H5F_try_close(H5F_t *f) unsigned nopen_objs = 0; /* Number of open objects in file/mount hierarchy */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5F_try_close) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(f); @@ -1981,7 +1968,7 @@ H5Fclose(hid_t file_id) int nref; herr_t ret_value = SUCCEED; - FUNC_ENTER_API(H5Fclose, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", file_id); /* Check/fix arguments. */ @@ -2043,7 +2030,7 @@ H5Freopen(hid_t file_id) H5F_t *new_file = NULL; hid_t ret_value; - FUNC_ENTER_API(H5Freopen, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("i", "i", file_id); /* Check arguments */ @@ -2094,7 +2081,7 @@ H5Fget_intent(hid_t file_id, unsigned *intent_flags) { herr_t ret_value = SUCCEED; - FUNC_ENTER_API(H5Fget_intent, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*Iu", file_id, intent_flags); /* If no intent flags were passed in, exit quietly */ @@ -2148,7 +2135,7 @@ H5F_get_id(H5F_t *file, hbool_t app_ref) { hid_t ret_value; - FUNC_ENTER_NOAPI_NOINIT(H5F_get_id) + FUNC_ENTER_NOAPI_NOINIT HDassert(file); @@ -2187,8 +2174,8 @@ done: unsigned H5F_incr_nopen_objs(H5F_t *f) { - /* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5F_incr_nopen_objs) + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(f); @@ -2214,8 +2201,8 @@ H5F_incr_nopen_objs(H5F_t *f) unsigned H5F_decr_nopen_objs(H5F_t *f) { - /* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5F_decr_nopen_objs) + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(f); @@ -2245,7 +2232,7 @@ H5F_build_actual_name(const H5F_t *f, const H5P_genplist_t *fapl, const char *na hid_t new_fapl_id = -1; /* ID for duplicated FAPL */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5F_build_actual_name) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(f); @@ -2355,8 +2342,8 @@ H5F_addr_encode_len(size_t addr_len, uint8_t **pp/*in,out*/, haddr_t addr) { unsigned u; /* Local index variable */ - /* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5F_addr_encode_len) + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(addr_len); HDassert(pp && *pp); @@ -2394,8 +2381,8 @@ H5F_addr_encode_len(size_t addr_len, uint8_t **pp/*in,out*/, haddr_t addr) void H5F_addr_encode(const H5F_t *f, uint8_t **pp/*in,out*/, haddr_t addr) { - /* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5F_addr_encode) + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(f); @@ -2428,8 +2415,8 @@ H5F_addr_decode_len(size_t addr_len, const uint8_t **pp/*in,out*/, haddr_t *addr hbool_t all_zero = TRUE; /* True if address was all zeroes */ unsigned u; /* Local index variable */ - /* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5F_addr_decode_len) + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(addr_len); HDassert(pp && *pp); @@ -2493,8 +2480,8 @@ H5F_addr_decode_len(size_t addr_len, const uint8_t **pp/*in,out*/, haddr_t *addr void H5F_addr_decode(const H5F_t *f, const uint8_t **pp/*in,out*/, haddr_t *addr_p/*out*/) { - /* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5F_addr_decode) + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(f); @@ -2525,7 +2512,7 @@ H5Fget_freespace(hid_t file_id) hsize_t tot_space; /* Amount of free space in the file */ hssize_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Fget_freespace, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("Hs", "i", file_id); /* Check args */ @@ -2568,7 +2555,7 @@ H5Fget_filesize(hid_t file_id, hsize_t *size) haddr_t eof; /* End of file address */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Fget_filesize, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*h", file_id, size); /* Check args */ @@ -2610,7 +2597,7 @@ H5Fget_mdc_config(hid_t file_id, H5AC_cache_config_t *config_ptr) H5F_t *file; /* File object for file ID */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Fget_mdc_config, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*x", file_id, config_ptr); /* Check args */ @@ -2649,7 +2636,7 @@ H5Fset_mdc_config(hid_t file_id, H5AC_cache_config_t *config_ptr) H5F_t *file; /* File object for file ID */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Fset_mdc_config, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*x", file_id, config_ptr); /* Check args */ @@ -2687,7 +2674,7 @@ H5Fget_mdc_hit_rate(hid_t file_id, double *hit_rate_ptr) H5F_t *file; /* File object for file ID */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Fget_mdc_hit_rate, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*d", file_id, hit_rate_ptr); /* Check args */ @@ -2731,7 +2718,7 @@ H5Fget_mdc_size(hid_t file_id, size_t *max_size_ptr, size_t *min_clean_size_ptr, int32_t cur_num_entries; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Fget_mdc_size, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE5("e", "i*z*z*z*Is", file_id, max_size_ptr, min_clean_size_ptr, cur_size_ptr, cur_num_entries_ptr); @@ -2778,7 +2765,7 @@ H5Freset_mdc_hit_rate_stats(hid_t file_id) H5F_t *file; /* File object for file ID */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Freset_mdc_hit_rate_stats, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", file_id); /* Check args */ @@ -2823,7 +2810,7 @@ H5Fget_name(hid_t obj_id, char *name/*out*/, size_t size) size_t len; ssize_t ret_value; - FUNC_ENTER_API (H5Fget_name, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("Zs", "ixz", obj_id, name, size); /* For file IDs, get the file object directly */ @@ -2882,7 +2869,7 @@ H5Fget_info2(hid_t obj_id, H5F_info2_t *finfo) H5F_t *f; /* Top file in mount hierarchy */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Fget_info2, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*x", obj_id, finfo); /* Check args */ @@ -2955,7 +2942,7 @@ H5Fget_free_sections(hid_t file_id, H5F_mem_t type, size_t nsects, H5F_t *file; /* Top file in mount hierarchy */ ssize_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Fget_free_sections, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE4("Zs", "iFmzx", file_id, type, nsects, sect_info); /* Check args */ @@ -2993,7 +2980,7 @@ H5Fclear_elink_file_cache(hid_t file_id) H5F_t *file; /* File */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Fclear_elink_file_cache, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", file_id); /* Check args */ @@ -3009,3 +2996,149 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Fclear_elink_file_cache() */ + +/*------------------------------------------------------------------------- + * Function: H5F_set_grp_btree_shared + * + * Purpose: Set the grp_btree_shared field with a valid ref-count pointer. + * + * Return: Success: SUCCEED + * Failure: FAIL + * + * Programmer: Quincey Koziol + * 7/19/11 + * + *------------------------------------------------------------------------- + */ +herr_t +H5F_set_grp_btree_shared(H5F_t *f, H5RC_t *rc) +{ + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR + + /* Sanity check */ + HDassert(f); + HDassert(f->shared); + HDassert(rc); + + f->shared->grp_btree_shared = rc; + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* H5F_set_grp_btree_shared() */ + + +/*------------------------------------------------------------------------- + * Function: H5F_set_sohm_addr + * + * Purpose: Set the sohm_addr field with a new value. + * + * Return: Success: SUCCEED + * Failure: FAIL + * + * Programmer: Quincey Koziol + * 7/20/11 + * + *------------------------------------------------------------------------- + */ +herr_t +H5F_set_sohm_addr(H5F_t *f, haddr_t addr) +{ + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR + + /* Sanity check */ + HDassert(f); + HDassert(f->shared); + + f->shared->sohm_addr = addr; + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* H5F_set_sohm_addr() */ + + +/*------------------------------------------------------------------------- + * Function: H5F_set_sohm_vers + * + * Purpose: Set the sohm_vers field with a new value. + * + * Return: Success: SUCCEED + * Failure: FAIL + * + * Programmer: Quincey Koziol + * 7/20/11 + * + *------------------------------------------------------------------------- + */ +herr_t +H5F_set_sohm_vers(H5F_t *f, unsigned vers) +{ + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR + + /* Sanity check */ + HDassert(f); + HDassert(f->shared); + + f->shared->sohm_vers = vers; + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* H5F_set_sohm_vers() */ + + +/*------------------------------------------------------------------------- + * Function: H5F_set_sohm_nindexes + * + * Purpose: Set the sohm_nindexes field with a new value. + * + * Return: Success: SUCCEED + * Failure: FAIL + * + * Programmer: Quincey Koziol + * 7/20/11 + * + *------------------------------------------------------------------------- + */ +herr_t +H5F_set_sohm_nindexes(H5F_t *f, unsigned nindexes) +{ + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR + + /* Sanity check */ + HDassert(f); + HDassert(f->shared); + + f->shared->sohm_nindexes = nindexes; + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* H5F_set_sohm_nindexes() */ + + +/*------------------------------------------------------------------------- + * Function: H5F_set_store_msg_crt_idx + * + * Purpose: Set the store_msg_crt_idx field with a new value. + * + * Return: Success: SUCCEED + * Failure: FAIL + * + * Programmer: Quincey Koziol + * 7/20/11 + * + *------------------------------------------------------------------------- + */ +herr_t +H5F_set_store_msg_crt_idx(H5F_t *f, hbool_t flag) +{ + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR + + /* Sanity check */ + HDassert(f); + HDassert(f->shared); + + f->shared->store_msg_crt_idx = flag; + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* H5F_set_store_msg_crt_idx() */ + diff --git a/src/H5FD.c b/src/H5FD.c index d0683e1..66fa3b9 100644 --- a/src/H5FD.c +++ b/src/H5FD.c @@ -43,17 +43,6 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5Fpkg.h" /* File access */ #include "H5FDpkg.h" /* File Drivers */ -#include "H5FDcore.h" /* Files stored entirely in memory */ -#include "H5FDfamily.h" /* File families */ -#include "H5FDlog.h" /* sec2 driver with I/O logging (for debugging) */ -#include "H5FDmpi.h" /* MPI-based file drivers */ -#include "H5FDmulti.h" /* Usage-partitioned file family */ -#include "H5FDsec2.h" /* POSIX unbuffered file I/O */ -#include "H5FDstdio.h" /* Standard C buffered I/O */ -#ifdef H5_HAVE_WINDOWS -#include "H5FDwindows.h" /* Windows buffered I/O */ -#endif -#include "H5FDdirect.h" /* Direct file I/O */ #include "H5Iprivate.h" /* IDs */ #include "H5MMprivate.h" /* Memory management */ #include "H5Pprivate.h" /* Property lists */ @@ -108,7 +97,7 @@ static herr_t H5FD_free_cls(H5FD_class_t *cls); * object and the file is closed and re-opened, the 'fileno' value will * be different. */ -static unsigned long file_serial_no; +static unsigned long H5FD_file_serial_no_g; /*------------------------------------------------------------------------- @@ -129,7 +118,7 @@ H5FD_init(void) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_init, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* FUNC_ENTER() does all the work */ done: @@ -158,13 +147,13 @@ H5FD_init_interface(void) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5FD_init_interface) + FUNC_ENTER_NOAPI_NOINIT if(H5I_register_type(H5I_VFL, (size_t)H5I_VFL_HASHSIZE, 0, (H5I_free_t)H5FD_free_cls)terminate && cls->terminate() < 0) + HGOTO_ERROR(H5E_VFL, H5E_CANTCLOSEOBJ, FAIL, "virtual file driver '%s' did not terminate cleanly", cls->name) H5MM_xfree(cls); - FUNC_LEAVE_NOAPI(SUCCEED) +done: + FUNC_LEAVE_NOAPI(ret_value) } /* end H5FD_free_cls() */ @@ -290,7 +272,7 @@ H5FDregister(const H5FD_class_t *cls) hid_t ret_value; H5FD_mem_t type; - FUNC_ENTER_API(H5FDregister, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("i", "*x", cls); /* Check arguments */ @@ -352,7 +334,7 @@ H5FD_register(const void *_cls, size_t size, hbool_t app_ref) H5FD_mem_t type; hid_t ret_value; - FUNC_ENTER_NOAPI(H5FD_register, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check arguments */ HDassert(cls); @@ -403,7 +385,7 @@ H5FDunregister(hid_t driver_id) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5FDunregister, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", driver_id); /* Check arguments */ @@ -444,7 +426,7 @@ H5FD_get_class(hid_t id) { H5FD_class_t *ret_value = NULL; - FUNC_ENTER_NOAPI(H5FD_get_class, NULL) + FUNC_ENTER_NOAPI(NULL) if(H5I_VFL == H5I_get_type(id)) ret_value = (H5FD_class_t *)H5I_object(id); @@ -497,7 +479,7 @@ H5FD_sb_size(H5FD_t *file) { hsize_t ret_value=0; - FUNC_ENTER_NOAPI(H5FD_sb_size, 0) + FUNC_ENTER_NOAPI(0) assert(file && file->cls); @@ -535,7 +517,7 @@ H5FD_sb_encode(H5FD_t *file, char *name/*out*/, uint8_t *buf) { herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_sb_encode, FAIL) + FUNC_ENTER_NOAPI(FAIL) assert(file && file->cls); if(file->cls->sb_encode && @@ -565,7 +547,7 @@ H5FD_sb_decode(H5FD_t *file, const char *name, const uint8_t *buf) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_sb_decode, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert(file && file->cls); if(file->cls->sb_decode && (file->cls->sb_decode)(file, name, buf) < 0) @@ -602,7 +584,7 @@ H5FD_pl_copy(void *(*copy_func)(const void *), size_t pl_size, const void *old_p void *new_pl = NULL; /* Copy of property list */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5FD_pl_copy) + FUNC_ENTER_NOAPI_NOINIT /* Copy old pl, if one exists */ if(old_pl) { @@ -647,7 +629,7 @@ H5FD_pl_close(hid_t driver_id, herr_t (*free_func)(void *), void *pl) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5FD_pl_close) + FUNC_ENTER_NOAPI_NOINIT /* Allow driver to free or do it ourselves */ if(pl && free_func) { @@ -697,7 +679,7 @@ H5FD_fapl_get(H5FD_t *file) { void *ret_value=NULL; - FUNC_ENTER_NOAPI(H5FD_fapl_get, NULL) + FUNC_ENTER_NOAPI(NULL) assert(file); @@ -731,7 +713,7 @@ H5FD_fapl_open(H5P_genplist_t *plist, hid_t driver_id, const void *driver_info) void *copied_driver_info = NULL; /* Temporary VFL driver info */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_fapl_open, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Increment the reference count on driver and copy driver info */ if(H5I_inc_ref(driver_id, FALSE) < 0) @@ -778,7 +760,7 @@ H5FD_fapl_copy(hid_t driver_id, const void *old_fapl, void **copied_fapl) H5FD_class_t *driver; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_fapl_copy, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args */ if(NULL == (driver = (H5FD_class_t *)H5I_object(driver_id))) @@ -814,7 +796,7 @@ H5FD_fapl_close(hid_t driver_id, void *fapl) H5FD_class_t *driver = NULL; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_fapl_close, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args */ if(driver_id > 0) { @@ -853,7 +835,7 @@ H5FD_dxpl_open(H5P_genplist_t *plist, hid_t driver_id, const void *driver_info) void *copied_driver_info = NULL; /* Temporary VFL driver info */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_dxpl_open, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Increment the reference count on the driver and copy the driver info */ if(H5I_inc_ref(driver_id, FALSE) < 0) @@ -899,7 +881,7 @@ H5FD_dxpl_copy(hid_t driver_id, const void *old_dxpl, void **copied_dxpl) H5FD_class_t *driver; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_dxpl_copy, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args */ if(NULL == (driver = (H5FD_class_t *)H5I_object(driver_id))) @@ -935,7 +917,7 @@ H5FD_dxpl_close(hid_t driver_id, void *dxpl) H5FD_class_t *driver; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_dxpl_close, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args */ if(driver_id > 0) { @@ -1012,7 +994,7 @@ H5FDopen(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) { H5FD_t *ret_value=NULL; - FUNC_ENTER_API(H5FDopen, NULL) + FUNC_ENTER_API(NULL) /* Check arguments */ if(H5P_DEFAULT == fapl_id) @@ -1059,7 +1041,7 @@ H5FD_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) H5P_genplist_t *plist; /* Property list pointer */ H5FD_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_open, NULL) + FUNC_ENTER_NOAPI(NULL) /* Sanity check */ if(0 == maxaddr) @@ -1104,11 +1086,11 @@ H5FD_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, NULL, "unable to query file driver") /* Increment the global serial number & assign it to this H5FD_t object */ - if(++file_serial_no == 0) { + if(++H5FD_file_serial_no_g == 0) { /* (Just error out if we wrap around for now...) */ HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, NULL, "unable to get file serial number") } /* end if */ - file->fileno = file_serial_no; + file->fileno = H5FD_file_serial_no_g; /* Start with base address set to 0 */ /* (This will be changed later, when the superblock is located) */ @@ -1145,7 +1127,7 @@ H5FDclose(H5FD_t *file) { herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_API(H5FDclose, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("e", "*x", file); if(!file || !file->cls) @@ -1178,7 +1160,7 @@ H5FD_close(H5FD_t *file) const H5FD_class_t *driver; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI(H5FD_close, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* check args */ HDassert(file && file->cls); @@ -1230,7 +1212,7 @@ H5FDcmp(const H5FD_t *f1, const H5FD_t *f2) { int ret_value; - FUNC_ENTER_API(H5FDcmp, -1) /*return value is arbitrary*/ + FUNC_ENTER_API(-1) /*return value is arbitrary*/ H5TRACE2("Is", "*x*x", f1, f2); ret_value = H5FD_cmp(f1, f2); @@ -1261,7 +1243,7 @@ H5FD_cmp(const H5FD_t *f1, const H5FD_t *f2) { int ret_value; - FUNC_ENTER_NOAPI(H5FD_cmp, -1) /*return value is arbitrary*/ + FUNC_ENTER_NOAPI(-1) /*return value is arbitrary*/ if((!f1 || !f1->cls) && (!f2 || !f2->cls)) HGOTO_DONE(0) @@ -1311,7 +1293,7 @@ H5FDquery(const H5FD_t *f, unsigned long *flags/*out*/) { int ret_value; - FUNC_ENTER_API(H5FDquery, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("Is", "*xx", f, flags); assert(f); @@ -1345,7 +1327,7 @@ H5FD_query(const H5FD_t *f, unsigned long *flags/*out*/) { int ret_value=0; - FUNC_ENTER_NOAPI(H5FD_query, FAIL) + FUNC_ENTER_NOAPI(FAIL) assert(f); assert(flags); @@ -1405,7 +1387,7 @@ H5FDalloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size) { haddr_t ret_value = HADDR_UNDEF; - FUNC_ENTER_API(H5FDalloc, HADDR_UNDEF) + FUNC_ENTER_API(HADDR_UNDEF) H5TRACE4("a", "*xMtih", file, type, dxpl_id, size); /* Check args */ @@ -1459,7 +1441,7 @@ H5FDfree(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t siz { herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_API(H5FDfree, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE5("e", "*xMtiah", file, type, dxpl_id, addr, size); /* Check args */ @@ -1502,7 +1484,7 @@ H5FDget_eoa(H5FD_t *file, H5FD_mem_t type) { haddr_t ret_value; - FUNC_ENTER_API(H5FDget_eoa, HADDR_UNDEF) + FUNC_ENTER_API(HADDR_UNDEF) H5TRACE2("a", "*xMt", file, type); /* Check args */ @@ -1552,7 +1534,7 @@ H5FDset_eoa(H5FD_t *file, H5FD_mem_t type, haddr_t addr) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5FDset_eoa, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("e", "*xMta", file, type, addr); /* Check args */ @@ -1604,7 +1586,7 @@ H5FDget_eof(H5FD_t *file) { haddr_t ret_value; - FUNC_ENTER_API(H5FDget_eof, HADDR_UNDEF) + FUNC_ENTER_API(HADDR_UNDEF) H5TRACE1("a", "*x", file); /* Check arguments */ @@ -1641,7 +1623,7 @@ H5FD_get_maxaddr(const H5FD_t *file) { haddr_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_get_maxaddr, HADDR_UNDEF) + FUNC_ENTER_NOAPI(HADDR_UNDEF) HDassert(file); @@ -1669,7 +1651,7 @@ done: herr_t H5FD_get_feature_flags(const H5FD_t *file, unsigned long *feature_flags) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FD_get_feature_flags) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(file); HDassert(feature_flags); @@ -1699,7 +1681,7 @@ H5FD_get_fs_type_map(const H5FD_t *file, H5FD_mem_t *type_map) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_get_fs_type_map, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ HDassert(file && file->cls); @@ -1747,7 +1729,7 @@ H5FDread(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5FDread, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE6("e", "*xMtiazx", file, type, dxpl_id, addr, size, buf); /* Check args */ @@ -1798,7 +1780,7 @@ H5FDwrite(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t siz { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5FDwrite, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE6("e", "*xMtiaz*x", file, type, dxpl_id, addr, size, buf); /* Check args */ @@ -1847,7 +1829,7 @@ H5FDflush(H5FD_t *file, hid_t dxpl_id, unsigned closing) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5FDflush, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("e", "*xiIu", file, dxpl_id, closing); /* Check args */ @@ -1886,7 +1868,7 @@ H5FD_flush(H5FD_t *file, hid_t dxpl_id, unsigned closing) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_flush, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert(file && file->cls); @@ -1916,7 +1898,7 @@ H5FDtruncate(H5FD_t *file, hid_t dxpl_id, unsigned closing) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5FDtruncate, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("e", "*xiIu", file, dxpl_id, closing); /* Check args */ @@ -1955,7 +1937,7 @@ H5FD_truncate(H5FD_t *file, hid_t dxpl_id, unsigned closing) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_truncate, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert(file && file->cls); @@ -1984,9 +1966,7 @@ done: herr_t H5FD_get_fileno(const H5FD_t *file, unsigned long *filenum) { - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5FD_get_fileno, FAIL) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(file); HDassert(filenum); @@ -1994,8 +1974,7 @@ H5FD_get_fileno(const H5FD_t *file, unsigned long *filenum) /* Retrieve the file's serial number */ *filenum = file->fileno; -done: - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5FD_get_fileno() */ @@ -2019,7 +1998,7 @@ H5FDget_vfd_handle(H5FD_t *file, hid_t fapl, void **file_handle) { herr_t ret_value; - FUNC_ENTER_API(H5FDget_vfd_handle, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("e", "*xi**x", file, fapl, file_handle); /* Check arguments */ @@ -2050,7 +2029,7 @@ H5FD_get_vfd_handle(H5FD_t *file, hid_t fapl, void **file_handle) { herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI(H5FD_get_vfd_handle, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ HDassert(file); @@ -2081,9 +2060,7 @@ done: herr_t H5FD_set_base_addr(H5FD_t *file, haddr_t base_addr) { - herr_t ret_value = SUCCEED; - - FUNC_ENTER_NOAPI(H5FD_set_base_addr, FAIL) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(file); HDassert(H5F_addr_defined(base_addr)); @@ -2091,8 +2068,7 @@ H5FD_set_base_addr(H5FD_t *file, haddr_t base_addr) /* Set the file's base address */ file->base_addr = base_addr; -done: - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5FD_set_base_addr() */ @@ -2112,16 +2088,11 @@ done: haddr_t H5FD_get_base_addr(const H5FD_t *file) { - haddr_t ret_value; /* Return value */ - - FUNC_ENTER_NOAPI(H5FD_get_base_addr, HADDR_UNDEF) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(file); /* Return the file's base address */ - ret_value = file->base_addr; - -done: - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI(file->base_addr) } /* end H5FD_get_base_addr() */ diff --git a/src/H5FDcore.c b/src/H5FDcore.c index a4ba64a..7fa0e7c 100644 --- a/src/H5FDcore.c +++ b/src/H5FDcore.c @@ -53,7 +53,7 @@ typedef struct H5FD_core_t { hbool_t backing_store; /*write to file name on flush */ int fd; /*backing store file descriptor */ /* Information for determining uniqueness of a file with a backing store */ -#ifndef _WIN32 +#ifndef H5_HAVE_WIN32_API /* * On most systems the combination of device and i-node number uniquely * identify a file. @@ -66,7 +66,7 @@ typedef struct H5FD_core_t { #endif /*H5_VMS*/ #else /* - * On _WIN32 the low-order word of a unique identifier associated with the + * On H5_HAVE_WIN32_API the low-order word of a unique identifier associated with the * file and the volume serial number uniquely identify a file. This number * (which, both? -rpm) may change when the system is restarted or when the * file is opened. After a process opens a file, the identifier is @@ -114,6 +114,7 @@ typedef struct H5FD_core_fapl_t { (size_t)((A)+(Z))<(size_t)(A)) /* Prototypes */ +static herr_t H5FD_core_term(void); static void *H5FD_core_fapl_get(H5FD_t *_file); static H5FD_t *H5FD_core_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr); @@ -135,6 +136,7 @@ static const H5FD_class_t H5FD_core_g = { "core", /*name */ MAXADDR, /*maxaddr */ H5F_CLOSE_WEAK, /*fc_degree */ + H5FD_core_term, /*terminate */ NULL, /*sb_size */ NULL, /*sb_encode */ NULL, /*sb_decode */ @@ -182,7 +184,7 @@ DESCRIPTION static herr_t H5FD_core_init_interface(void) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FD_core_init_interface) + FUNC_ENTER_NOAPI_NOINIT_NOERR FUNC_LEAVE_NOAPI(H5FD_core_init()) } /* H5FD_core_init_interface() */ @@ -210,7 +212,7 @@ H5FD_core_init(void) { hid_t ret_value=H5FD_CORE_g; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_core_init, FAIL) + FUNC_ENTER_NOAPI(FAIL) if (H5I_VFL!=H5Iget_type(H5FD_CORE_g)) H5FD_CORE_g = H5FD_register(&H5FD_core_g,sizeof(H5FD_class_t),FALSE); @@ -228,24 +230,22 @@ done: * * Purpose: Shut down the VFD * - * Return: + * Returns: Non-negative on success or negative on failure * * Programmer: Quincey Koziol * Friday, Jan 30, 2004 * - * Modification: - * *--------------------------------------------------------------------------- */ -void +static herr_t H5FD_core_term(void) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FD_core_term) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Reset VFL ID */ H5FD_CORE_g=0; - FUNC_LEAVE_NOAPI_VOID + FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5FD_core_term() */ @@ -279,7 +279,7 @@ H5Pset_fapl_core(hid_t fapl_id, size_t increment, hbool_t backing_store) H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value; - FUNC_ENTER_API(H5Pset_fapl_core, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("e", "izb", fapl_id, increment, backing_store); /* Check argument */ @@ -326,7 +326,7 @@ H5Pget_fapl_core(hid_t fapl_id, size_t *increment/*out*/, H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Pget_fapl_core, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("e", "ixx", fapl_id, increment, backing_store); if(NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) @@ -369,7 +369,7 @@ H5FD_core_fapl_get(H5FD_t *_file) H5FD_core_fapl_t *fa; void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_core_fapl_get, NULL) + FUNC_ENTER_NOAPI_NOINIT if(NULL == (fa = (H5FD_core_fapl_t *)H5MM_calloc(sizeof(H5FD_core_fapl_t)))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") @@ -419,7 +419,7 @@ H5FD_core_open(const char *name, unsigned flags, hid_t fapl_id, H5FD_core_t *file=NULL; H5FD_core_fapl_t *fa=NULL; H5P_genplist_t *plist; /* Property list pointer */ -#ifdef _WIN32 +#ifdef H5_HAVE_WIN32_API HFILE filehandle; struct _BY_HANDLE_FILE_INFORMATION fileinfo; #endif @@ -427,7 +427,7 @@ H5FD_core_open(const char *name, unsigned flags, hid_t fapl_id, int fd=-1; H5FD_t *ret_value; - FUNC_ENTER_NOAPI(H5FD_core_open, NULL) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments */ if(!name || !*name) @@ -476,12 +476,12 @@ H5FD_core_open(const char *name, unsigned flags, hid_t fapl_id, if(fd >= 0) { /* Retrieve information for determining uniqueness of file */ -#ifdef _WIN32 +#ifdef H5_HAVE_WIN32_API filehandle = _get_osfhandle(fd); (void)GetFileInformationByHandle((HANDLE)filehandle, &fileinfo); file->fileindexhi = fileinfo.nFileIndexHigh; file->fileindexlo = fileinfo.nFileIndexLow; -#else /* _WIN32 */ +#else /* H5_HAVE_WIN32_API */ file->device = sb.st_dev; #ifdef H5_VMS file->inode[0] = sb.st_ino[0]; @@ -491,7 +491,7 @@ H5FD_core_open(const char *name, unsigned flags, hid_t fapl_id, file->inode = sb.st_ino; #endif /* H5_VMS */ -#endif /* _WIN32 */ +#endif /* H5_HAVE_WIN32_API */ } /* end if */ /* If an existing file is opened, load the whole file into memory. */ @@ -548,7 +548,7 @@ H5FD_core_close(H5FD_t *_file) H5FD_core_t *file = (H5FD_core_t*)_file; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_core_close, FAIL) + FUNC_ENTER_NOAPI_NOINIT /* Flush any changed buffers */ if(H5FD_core_flush(_file, (hid_t)-1, TRUE) < 0) @@ -601,11 +601,11 @@ H5FD_core_cmp(const H5FD_t *_f1, const H5FD_t *_f2) const H5FD_core_t *f2 = (const H5FD_core_t*)_f2; int ret_value = 0; - FUNC_ENTER_NOAPI(H5FD_core_cmp, FAIL) + FUNC_ENTER_NOAPI_NOINIT_NOERR if(f1->fd >= 0 && f2->fd >= 0) { /* Compare low level file information for backing store */ -#ifdef _WIN32 +#ifdef H5_HAVE_WIN32_API if (f1->fileindexhi < f2->fileindexhi) HGOTO_DONE(-1) if (f1->fileindexhi > f2->fileindexhi) HGOTO_DONE(1) @@ -633,7 +633,7 @@ H5FD_core_cmp(const H5FD_t *_f1, const H5FD_t *_f2) if(HDmemcmp(&(f1->inode),&(f2->inode),3*sizeof(ino_t))>0) HGOTO_DONE(1) #endif /* H5_VMS */ -#endif /*_WIN32*/ +#endif /*H5_HAVE_WIN32_API*/ } /* end if */ else { if (NULL==f1->name && NULL==f2->name) { @@ -676,7 +676,7 @@ H5FD_core_query(const H5FD_t * _file, unsigned long *flags /* out */) { const H5FD_core_t *file = (const H5FD_core_t*)_file; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FD_core_query) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Set the VFL feature flags that this driver supports */ if(flags) { @@ -720,15 +720,10 @@ static haddr_t H5FD_core_get_eoa(const H5FD_t *_file, H5FD_mem_t UNUSED type) { const H5FD_core_t *file = (const H5FD_core_t*)_file; - haddr_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_core_get_eoa, HADDR_UNDEF) + FUNC_ENTER_NOAPI_NOINIT_NOERR - /* Set return value */ - ret_value=file->eoa; - -done: - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI(file->eoa) } @@ -759,7 +754,7 @@ H5FD_core_set_eoa(H5FD_t *_file, H5FD_mem_t UNUSED type, haddr_t addr) H5FD_core_t *file = (H5FD_core_t*)_file; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_core_set_eoa, FAIL) + FUNC_ENTER_NOAPI_NOINIT if(ADDR_OVERFLOW(addr)) HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "address overflow") @@ -794,17 +789,11 @@ done: static haddr_t H5FD_core_get_eof(const H5FD_t *_file) { - haddr_t ret_value; /* Return value */ - const H5FD_core_t *file = (const H5FD_core_t*)_file; - FUNC_ENTER_NOAPI(H5FD_core_get_eof, HADDR_UNDEF) - - /* Set return value */ - ret_value=MAX(file->eof, file->eoa); + FUNC_ENTER_NOAPI_NOINIT_NOERR -done: - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI(MAX(file->eof, file->eoa)) } @@ -828,7 +817,7 @@ H5FD_core_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle) H5FD_core_t *file = (H5FD_core_t *)_file; /* core VFD info */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_core_get_handle, FAIL) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ if(!file_handle) @@ -897,7 +886,7 @@ H5FD_core_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, hadd H5FD_core_t *file = (H5FD_core_t*)_file; herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_core_read, FAIL) + FUNC_ENTER_NOAPI_NOINIT assert(file && file->pub.cls); assert(buf); @@ -970,7 +959,7 @@ H5FD_core_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, had H5FD_core_t *file = (H5FD_core_t*)_file; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_core_write, FAIL) + FUNC_ENTER_NOAPI_NOINIT HDassert(file && file->pub.cls); HDassert(buf); @@ -998,7 +987,7 @@ H5FD_core_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, had /* (Re)allocate memory for the file buffer */ if(NULL == (x = (unsigned char *)H5MM_realloc(file->mem, new_eof))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate memory block") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate memory block of %llu bytes", (unsigned long long)new_eof) #ifdef H5_CLEAR_MEMORY HDmemset(x + file->eof, 0, (size_t)(new_eof - file->eof)); #endif /* H5_CLEAR_MEMORY */ @@ -1042,7 +1031,7 @@ H5FD_core_flush(H5FD_t *_file, hid_t UNUSED dxpl_id, unsigned UNUSED closing) H5FD_core_t *file = (H5FD_core_t*)_file; herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_core_flush, FAIL) + FUNC_ENTER_NOAPI_NOINIT /* Write to backing store */ if (file->dirty && file->fd>=0 && file->backing_store) { @@ -1094,7 +1083,7 @@ H5FD_core_truncate(H5FD_t *_file, hid_t UNUSED dxpl_id, hbool_t UNUSED closing) size_t new_eof; /* New size of memory buffer */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_core_truncate, FAIL) + FUNC_ENTER_NOAPI_NOINIT HDassert(file); diff --git a/src/H5FDcore.h b/src/H5FDcore.h index dca110e..16cce89 100644 --- a/src/H5FDcore.h +++ b/src/H5FDcore.h @@ -17,20 +17,17 @@ * Programmer: Robb Matzke * Monday, August 2, 1999 * - * Purpose: The public header file for the sec2 driver. + * Purpose: The public header file for the core driver. */ #ifndef H5FDcore_H #define H5FDcore_H -#include "H5Ipublic.h" - #define H5FD_CORE (H5FD_core_init()) #ifdef __cplusplus extern "C" { #endif H5_DLL hid_t H5FD_core_init(void); -H5_DLL void H5FD_core_term(void); H5_DLL herr_t H5Pset_fapl_core(hid_t fapl_id, size_t increment, hbool_t backing_store); H5_DLL herr_t H5Pget_fapl_core(hid_t fapl_id, size_t *increment/*out*/, @@ -40,3 +37,4 @@ H5_DLL herr_t H5Pget_fapl_core(hid_t fapl_id, size_t *increment/*out*/, #endif #endif + diff --git a/src/H5FDdirect.c b/src/H5FDdirect.c index 214dd8d..8bb613c 100644 --- a/src/H5FDdirect.c +++ b/src/H5FDdirect.c @@ -17,27 +17,27 @@ * Programmer: Raymond Lu * Wednesday, 20 September 2006 * - * Purpose: The Direct I/O file driver forces the data to be written to - * the file directly without being copied into system kernel - * buffer. The main system support this feature is Linux. + * Purpose: The Direct I/O file driver forces the data to be written to + * the file directly without being copied into system kernel + * buffer. The main system support this feature is Linux. */ /* Interface initialization */ -#define H5_INTERFACE_INIT_FUNC H5FD_direct_init_interface +#define H5_INTERFACE_INIT_FUNC H5FD_direct_init_interface /* For system function posix_memalign - Commented it out because copper isn't able to compile * this file. */ /* #define _XOPEN_SOURCE 600 */ -#include "H5private.h" /* Generic Functions */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5Fprivate.h" /* File access */ -#include "H5FDprivate.h" /* File drivers */ -#include "H5FDdirect.h" /* Direct file driver */ -#include "H5FLprivate.h" /* Free Lists */ -#include "H5Iprivate.h" /* IDs */ -#include "H5MMprivate.h" /* Memory management */ -#include "H5Pprivate.h" /* Property lists */ +#include "H5private.h" /* Generic Functions */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5Fprivate.h" /* File access */ +#include "H5FDprivate.h" /* File drivers */ +#include "H5FDdirect.h" /* Direct file driver */ +#include "H5FLprivate.h" /* Free Lists */ +#include "H5Iprivate.h" /* IDs */ +#include "H5MMprivate.h" /* Memory management */ +#include "H5Pprivate.h" /* Property lists */ #ifdef H5_HAVE_DIRECT @@ -45,15 +45,15 @@ static hid_t H5FD_DIRECT_g = 0; /* File operations */ -#define OP_UNKNOWN 0 -#define OP_READ 1 -#define OP_WRITE 2 +#define OP_UNKNOWN 0 +#define OP_READ 1 +#define OP_WRITE 2 /* Driver-specific file access properties */ typedef struct H5FD_direct_fapl_t { - size_t mboundary; /* Memory boundary for alignment */ - size_t fbsize; /* File system block size */ - size_t cbsize; /* Maximal buffer size for copying user data */ + size_t mboundary; /* Memory boundary for alignment */ + size_t fbsize; /* File system block size */ + size_t cbsize; /* Maximal buffer size for copying user data */ hbool_t must_align; /* Decides if data alignment is required */ } H5FD_direct_fapl_t; @@ -70,27 +70,27 @@ typedef struct H5FD_direct_fapl_t { * occurs), and `op' will be set to H5F_OP_UNKNOWN. */ typedef struct H5FD_direct_t { - H5FD_t pub; /*public stuff, must be first */ - int fd; /*the unix file */ - haddr_t eoa; /*end of allocated region */ - haddr_t eof; /*end of file; current file size*/ - haddr_t pos; /*current file I/O position */ - int op; /*last operation */ - H5FD_direct_fapl_t fa; /*file access properties */ -#ifndef _WIN32 + H5FD_t pub; /*public stuff, must be first */ + int fd; /*the unix file */ + haddr_t eoa; /*end of allocated region */ + haddr_t eof; /*end of file; current file size*/ + haddr_t pos; /*current file I/O position */ + int op; /*last operation */ + H5FD_direct_fapl_t fa; /*file access properties */ +#ifndef H5_HAVE_WIN32_API /* * On most systems the combination of device and i-node number uniquely * identify a file. */ - dev_t device; /*file device number */ + dev_t device; /*file device number */ #ifdef H5_VMS - ino_t inode[3]; /*file i-node number */ + ino_t inode[3]; /*file i-node number */ #else - ino_t inode; /*file i-node number */ + ino_t inode; /*file i-node number */ #endif /*H5_VMS*/ #else /* - * On _WIN32 the low-order word of a unique identifier associated with the + * On H5_HAVE_WIN32_API the low-order word of a unique identifier associated with the * file and the volume serial number uniquely identify a file. This number * (which, both? -rpm) may change when the system is restarted or when the * file is opened. After a process opens a file, the identifier is @@ -111,57 +111,58 @@ typedef struct H5FD_direct_t { * some macros here so we don't have to have conditional compilations later * throughout the code. * - * file_offset_t: The datatype for file offsets, the second argument of - * the lseek() or lseek64() call. + * file_offset_t: The datatype for file offsets, the second argument of + * the lseek() or lseek64() call. * - * file_seek: The function which adjusts the current file position, - * either lseek() or lseek64(). + * file_seek: The function which adjusts the current file position, + * either lseek() or lseek64(). */ /* adding for windows NT file system support. */ #ifdef H5_HAVE_LSEEK64 -# define file_offset_t off64_t -# define file_seek lseek64 -# define file_truncate ftruncate64 -#elif defined (_WIN32) +# define file_offset_t off64_t +# define file_seek lseek64 +# define file_truncate ftruncate64 +#elif defined (H5_HAVE_WIN32_API) # /*MSVC*/ # define file_offset_t __int64 # define file_seek _lseeki64 -# define file_truncate _chsize +# define file_truncate _chsize #else -# define file_offset_t off_t -# define file_seek lseek -# define file_truncate HDftruncate +# define file_offset_t off_t +# define file_seek lseek +# define file_truncate HDftruncate #endif /* * These macros check for overflow of various quantities. These macros * assume that file_offset_t is signed and haddr_t and size_t are unsigned. * - * ADDR_OVERFLOW: Checks whether a file address of type `haddr_t' - * is too large to be represented by the second argument - * of the file seek function. + * ADDR_OVERFLOW: Checks whether a file address of type `haddr_t' + * is too large to be represented by the second argument + * of the file seek function. * - * SIZE_OVERFLOW: Checks whether a buffer size of type `hsize_t' is too - * large to be represented by the `size_t' type. + * SIZE_OVERFLOW: Checks whether a buffer size of type `hsize_t' is too + * large to be represented by the `size_t' type. * - * REGION_OVERFLOW: Checks whether an address and size pair describe data - * which can be addressed entirely by the second - * argument of the file seek function. + * REGION_OVERFLOW: Checks whether an address and size pair describe data + * which can be addressed entirely by the second + * argument of the file seek function. */ #define MAXADDR (((haddr_t)1<<(8*sizeof(file_offset_t)-1))-1) -#define ADDR_OVERFLOW(A) (HADDR_UNDEF==(A) || \ - ((A) & ~(haddr_t)MAXADDR)) -#define SIZE_OVERFLOW(Z) ((Z) & ~(hsize_t)MAXADDR) -#define REGION_OVERFLOW(A,Z) (ADDR_OVERFLOW(A) || SIZE_OVERFLOW(Z) || \ - HADDR_UNDEF==(A)+(Z) || \ - (file_offset_t)((A)+(Z))<(file_offset_t)(A)) +#define ADDR_OVERFLOW(A) (HADDR_UNDEF==(A) || \ + ((A) & ~(haddr_t)MAXADDR)) +#define SIZE_OVERFLOW(Z) ((Z) & ~(hsize_t)MAXADDR) +#define REGION_OVERFLOW(A,Z) (ADDR_OVERFLOW(A) || SIZE_OVERFLOW(Z) || \ + HADDR_UNDEF==(A)+(Z) || \ + (file_offset_t)((A)+(Z))<(file_offset_t)(A)) /* Prototypes */ +static herr_t H5FD_direct_term(void); static void *H5FD_direct_fapl_get(H5FD_t *file); static void *H5FD_direct_fapl_copy(const void *_old_fa); static H5FD_t *H5FD_direct_open(const char *name, unsigned flags, hid_t fapl_id, - haddr_t maxaddr); + haddr_t maxaddr); static herr_t H5FD_direct_close(H5FD_t *_file); static int H5FD_direct_cmp(const H5FD_t *_f1, const H5FD_t *_f2); static herr_t H5FD_direct_query(const H5FD_t *_f1, unsigned long *flags); @@ -170,43 +171,44 @@ static herr_t H5FD_direct_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr); static haddr_t H5FD_direct_get_eof(const H5FD_t *_file); static herr_t H5FD_direct_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle); static herr_t H5FD_direct_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, - size_t size, void *buf); + size_t size, void *buf); static herr_t H5FD_direct_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, - size_t size, const void *buf); + size_t size, const void *buf); static herr_t H5FD_direct_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing); static const H5FD_class_t H5FD_direct_g = { - "direct", /*name */ - MAXADDR, /*maxaddr */ - H5F_CLOSE_WEAK, /* fc_degree */ - NULL, /*sb_size */ - NULL, /*sb_encode */ - NULL, /*sb_decode */ - sizeof(H5FD_direct_fapl_t), /*fapl_size */ - H5FD_direct_fapl_get, /*fapl_get */ - H5FD_direct_fapl_copy, /*fapl_copy */ - NULL, /*fapl_free */ - 0, /*dxpl_size */ - NULL, /*dxpl_copy */ - NULL, /*dxpl_free */ - H5FD_direct_open, /*open */ - H5FD_direct_close, /*close */ - H5FD_direct_cmp, /*cmp */ - H5FD_direct_query, /*query */ - NULL, /*get_type_map */ - NULL, /*alloc */ - NULL, /*free */ - H5FD_direct_get_eoa, /*get_eoa */ - H5FD_direct_set_eoa, /*set_eoa */ - H5FD_direct_get_eof, /*get_eof */ + "direct", /*name */ + MAXADDR, /*maxaddr */ + H5F_CLOSE_WEAK, /* fc_degree */ + H5FD_direct_term, /*terminate */ + NULL, /*sb_size */ + NULL, /*sb_encode */ + NULL, /*sb_decode */ + sizeof(H5FD_direct_fapl_t), /*fapl_size */ + H5FD_direct_fapl_get, /*fapl_get */ + H5FD_direct_fapl_copy, /*fapl_copy */ + NULL, /*fapl_free */ + 0, /*dxpl_size */ + NULL, /*dxpl_copy */ + NULL, /*dxpl_free */ + H5FD_direct_open, /*open */ + H5FD_direct_close, /*close */ + H5FD_direct_cmp, /*cmp */ + H5FD_direct_query, /*query */ + NULL, /*get_type_map */ + NULL, /*alloc */ + NULL, /*free */ + H5FD_direct_get_eoa, /*get_eoa */ + H5FD_direct_set_eoa, /*set_eoa */ + H5FD_direct_get_eof, /*get_eof */ H5FD_direct_get_handle, /*get_handle */ - H5FD_direct_read, /*read */ - H5FD_direct_write, /*write */ - NULL, /*flush */ - H5FD_direct_truncate, /*truncate */ + H5FD_direct_read, /*read */ + H5FD_direct_write, /*write */ + NULL, /*flush */ + H5FD_direct_truncate, /*truncate */ NULL, /*lock */ NULL, /*unlock */ - H5FD_FLMAP_SINGLE /*fl_map */ + H5FD_FLMAP_SINGLE /*fl_map */ }; /* Declare a free list to manage the H5FD_direct_t struct */ @@ -229,23 +231,23 @@ DESCRIPTION static herr_t H5FD_direct_init_interface(void) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FD_direct_init_interface) + FUNC_ENTER_NOAPI_NOINIT_NOERR FUNC_LEAVE_NOAPI(H5FD_direct_init()) } /* H5FD_direct_init_interface() */ /*------------------------------------------------------------------------- - * Function: H5FD_direct_init + * Function: H5FD_direct_init * - * Purpose: Initialize this driver by registering the driver with the - * library. + * Purpose: Initialize this driver by registering the driver with the + * library. * - * Return: Success: The driver ID for the direct driver. + * Return: Success: The driver ID for the direct driver. * - * Failure: Negative. + * Failure: Negative. * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * Wednesday, 20 September 2006 * * Modifications: @@ -257,7 +259,7 @@ H5FD_direct_init(void) { hid_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_direct_init, FAIL) + FUNC_ENTER_NOAPI(FAIL) if (H5I_VFL!=H5I_get_type(H5FD_DIRECT_g)) H5FD_DIRECT_g = H5FD_register(&H5FD_direct_g,sizeof(H5FD_class_t),FALSE); @@ -271,42 +273,40 @@ done: /*--------------------------------------------------------------------------- - * Function: H5FD_direct_term + * Function: H5FD_direct_term * - * Purpose: Shut down the VFD + * Purpose: Shut down the VFD * - * Return: + * Returns: Non-negative on success or negative on failure * * Programmer: Raymond Lu * Wednesday, 20 September 2006 * - * Modification: - * *--------------------------------------------------------------------------- */ -void +static herr_t H5FD_direct_term(void) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FD_direct_term) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Reset VFL ID */ H5FD_DIRECT_g=0; - FUNC_LEAVE_NOAPI_VOID + FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5FD_direct_term() */ /*------------------------------------------------------------------------- - * Function: H5Pset_fapl_direct + * Function: H5Pset_fapl_direct * - * Purpose: Modify the file access property list to use the H5FD_DIRECT - * driver defined in this source file. There are no driver - * specific properties. + * Purpose: Modify the file access property list to use the H5FD_DIRECT + * driver defined in this source file. There are no driver + * specific properties. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Raymond Lu - * Wednesday, 20 September 2006 + * Programmer: Raymond Lu + * Wednesday, 20 September 2006 * * Modifications: * @@ -315,28 +315,28 @@ H5FD_direct_term(void) herr_t H5Pset_fapl_direct(hid_t fapl_id, size_t boundary, size_t block_size, size_t cbuf_size) { - H5P_genplist_t *plist; /* Property list pointer */ - H5FD_direct_fapl_t fa; - herr_t ret_value; + H5P_genplist_t *plist; /* Property list pointer */ + H5FD_direct_fapl_t fa; + herr_t ret_value; - FUNC_ENTER_API(H5Pset_fapl_direct, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE4("e", "izzz", fapl_id, boundary, block_size, cbuf_size); if(NULL == (plist = H5P_object_verify(fapl_id,H5P_FILE_ACCESS))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list") if(boundary != 0) - fa.mboundary = boundary; + fa.mboundary = boundary; else - fa.mboundary = MBOUNDARY_DEF; + fa.mboundary = MBOUNDARY_DEF; if(block_size != 0) - fa.fbsize = block_size; + fa.fbsize = block_size; else - fa.fbsize = FBSIZE_DEF; + fa.fbsize = FBSIZE_DEF; if(cbuf_size != 0) - fa.cbsize = cbuf_size; + fa.cbsize = cbuf_size; else - fa.cbsize = CBSIZE_DEF; + fa.cbsize = CBSIZE_DEF; /* Set the default to be true for data alignment */ fa.must_align = TRUE; @@ -353,16 +353,16 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_fapl_direct + * Function: H5Pget_fapl_direct * - * Purpose: Returns information about the direct file access property - * list though the function arguments. + * Purpose: Returns information about the direct file access property + * list though the function arguments. * - * Return: Success: Non-negative + * Return: Success: Non-negative * - * Failure: Negative + * Failure: Negative * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * Wednesday, October 18, 2006 * * Modifications: @@ -371,13 +371,13 @@ done: */ herr_t H5Pget_fapl_direct(hid_t fapl_id, size_t *boundary/*out*/, size_t *block_size/*out*/, - size_t *cbuf_size/*out*/) + size_t *cbuf_size/*out*/) { - H5FD_direct_fapl_t *fa; + H5FD_direct_fapl_t *fa; H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Pget_fapl_direct, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE4("e", "ixxx", fapl_id, boundary, block_size, cbuf_size); if(NULL == (plist = H5P_object_verify(fapl_id,H5P_FILE_ACCESS))) @@ -389,9 +389,9 @@ H5Pget_fapl_direct(hid_t fapl_id, size_t *boundary/*out*/, size_t *block_size/*o if (boundary) *boundary = fa->mboundary; if (block_size) - *block_size = fa->fbsize; + *block_size = fa->fbsize; if (cbuf_size) - *cbuf_size = fa->cbsize; + *cbuf_size = fa->cbsize; done: FUNC_LEAVE_API(ret_value) @@ -399,18 +399,18 @@ done: /*------------------------------------------------------------------------- - * Function: H5FD_direct_fapl_get + * Function: H5FD_direct_fapl_get * - * Purpose: Returns a file access property list which indicates how the - * specified file is being accessed. The return list could be - * used to access another file the same way. + * Purpose: Returns a file access property list which indicates how the + * specified file is being accessed. The return list could be + * used to access another file the same way. * - * Return: Success: Ptr to new file access property list with all - * members copied from the file struct. + * Return: Success: Ptr to new file access property list with all + * members copied from the file struct. * - * Failure: NULL + * Failure: NULL * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * Wednesday, 18 October 2006 * * Modifications: @@ -420,10 +420,10 @@ done: static void * H5FD_direct_fapl_get(H5FD_t *_file) { - H5FD_direct_t *file = (H5FD_direct_t*)_file; + H5FD_direct_t *file = (H5FD_direct_t*)_file; void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_direct_fapl_get, NULL) + FUNC_ENTER_NOAPI_NOINIT /* Set return value */ ret_value= H5FD_direct_fapl_copy(&(file->fa)); @@ -434,15 +434,15 @@ done: /*------------------------------------------------------------------------- - * Function: H5FD_direct_fapl_copy + * Function: H5FD_direct_fapl_copy * - * Purpose: Copies the direct-specific file access properties. + * Purpose: Copies the direct-specific file access properties. * - * Return: Success: Ptr to a new property list + * Return: Success: Ptr to a new property list * - * Failure: NULL + * Failure: NULL * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * Wednesday, 18 October 2006 * * Modifications: @@ -454,35 +454,30 @@ H5FD_direct_fapl_copy(const void *_old_fa) { const H5FD_direct_fapl_t *old_fa = (const H5FD_direct_fapl_t*)_old_fa; H5FD_direct_fapl_t *new_fa = H5MM_malloc(sizeof(H5FD_direct_fapl_t)); - void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_direct_fapl_copy, NULL) + FUNC_ENTER_NOAPI_NOINIT_NOERR assert(new_fa); /* Copy the general information */ HDmemcpy(new_fa, old_fa, sizeof(H5FD_direct_fapl_t)); - /* Set return value */ - ret_value=new_fa; - -done: - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI(new_fa) } /* end H5FD_direct_fapl_copy() */ /*------------------------------------------------------------------------- - * Function: H5FD_direct_open + * Function: H5FD_direct_open * - * Purpose: Create and/or opens a Unix file for direct I/O as an HDF5 file. + * Purpose: Create and/or opens a Unix file for direct I/O as an HDF5 file. * - * Return: Success: A pointer to a new file data structure. The - * public fields will be initialized by the - * caller, which is always H5FD_open(). + * Return: Success: A pointer to a new file data structure. The + * public fields will be initialized by the + * caller, which is always H5FD_open(). * - * Failure: NULL + * Failure: NULL * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * Wednesday, 20 September 2006 * * Modifications: @@ -492,20 +487,20 @@ done: static H5FD_t * H5FD_direct_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) { - int o_flags; - int fd=(-1); - H5FD_direct_t *file=NULL; - H5FD_direct_fapl_t *fa; -#ifdef _WIN32 - HFILE filehandle; + int o_flags; + int fd=(-1); + H5FD_direct_t *file=NULL; + H5FD_direct_fapl_t *fa; +#ifdef H5_HAVE_WIN32_API + HFILE filehandle; struct _BY_HANDLE_FILE_INFORMATION fileinfo; #endif - h5_stat_t sb; - H5P_genplist_t *plist; /* Property list */ + h5_stat_t sb; + H5P_genplist_t *plist; /* Property list */ int *buf1, *buf2; - H5FD_t *ret_value; + H5FD_t *ret_value; - FUNC_ENTER_NOAPI(H5FD_direct_open, NULL) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check on file offsets */ assert(sizeof(file_offset_t)>=sizeof(size_t)); @@ -547,7 +542,7 @@ H5FD_direct_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxadd H5_ASSIGN_OVERFLOW(file->eof,sb.st_size,h5_stat_size_t,haddr_t); file->pos = HADDR_UNDEF; file->op = OP_UNKNOWN; -#ifdef _WIN32 +#ifdef H5_HAVE_WIN32_API filehandle = _get_osfhandle(fd); (void)GetFileInformationByHandle((HANDLE)filehandle, &fileinfo); file->fileindexhi = fileinfo.nFileIndexHigh; @@ -561,7 +556,7 @@ H5FD_direct_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxadd #else file->inode = sb.st_ino; #endif /*H5_VMS*/ -#endif /*_WIN32*/ +#endif /*H5_HAVE_WIN32_API*/ file->fa.mboundary = fa->mboundary; file->fa.fbsize = fa->fbsize; file->fa.cbsize = fa->cbsize; @@ -572,7 +567,7 @@ H5FD_direct_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxadd */ buf1 = (int*)HDmalloc(sizeof(int)); if (HDposix_memalign(&buf2, file->fa.mboundary, file->fa.fbsize) != 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, NULL, "HDposix_memalign failed") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, NULL, "HDposix_memalign failed") if(o_flags & O_CREAT) { if(write(file->fd, (void*)buf1, sizeof(int))<0) { @@ -626,15 +621,15 @@ done: /*------------------------------------------------------------------------- - * Function: H5FD_direct_close + * Function: H5FD_direct_close * - * Purpose: Closes the file. + * Purpose: Closes the file. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1, file not closed. + * Failure: -1, file not closed. * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * Wednesday, 20 September 2006 * * Modifications: @@ -644,10 +639,10 @@ done: static herr_t H5FD_direct_close(H5FD_t *_file) { - H5FD_direct_t *file = (H5FD_direct_t*)_file; - herr_t ret_value=SUCCEED; /* Return value */ + H5FD_direct_t *file = (H5FD_direct_t*)_file; + herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_direct_close, FAIL) + FUNC_ENTER_NOAPI_NOINIT if (HDclose(file->fd)<0) HSYS_GOTO_ERROR(H5E_IO, H5E_CANTCLOSEFILE, FAIL, "unable to close file") @@ -660,17 +655,17 @@ done: /*------------------------------------------------------------------------- - * Function: H5FD_direct_cmp + * Function: H5FD_direct_cmp * - * Purpose: Compares two files belonging to this driver using an - * arbitrary (but consistent) ordering. + * Purpose: Compares two files belonging to this driver using an + * arbitrary (but consistent) ordering. * - * Return: Success: A value like strcmp() + * Return: Success: A value like strcmp() * - * Failure: never fails (arguments were checked by the - * caller). + * Failure: never fails (arguments were checked by the + * caller). * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * Thursday, 21 September 2006 * * Modifications: @@ -680,13 +675,13 @@ done: static int H5FD_direct_cmp(const H5FD_t *_f1, const H5FD_t *_f2) { - const H5FD_direct_t *f1 = (const H5FD_direct_t*)_f1; - const H5FD_direct_t *f2 = (const H5FD_direct_t*)_f2; + const H5FD_direct_t *f1 = (const H5FD_direct_t*)_f1; + const H5FD_direct_t *f2 = (const H5FD_direct_t*)_f2; int ret_value=0; - FUNC_ENTER_NOAPI(H5FD_direct_cmp, H5FD_VFD_DEFAULT) + FUNC_ENTER_NOAPI_NOINIT_NOERR -#ifdef _WIN32 +#ifdef H5_HAVE_WIN32_API if (f1->fileindexhi < f2->fileindexhi) HGOTO_DONE(-1) if (f1->fileindexhi > f2->fileindexhi) HGOTO_DONE(1) @@ -722,16 +717,16 @@ done: /*------------------------------------------------------------------------- - * Function: H5FD_direct_query + * Function: H5FD_direct_query * - * Purpose: Set the flags that this VFL driver is capable of supporting. + * Purpose: Set the flags that this VFL driver is capable of supporting. * (listed in H5FDpublic.h) * - * Return: Success: non-negative + * Return: Success: non-negative * - * Failure: negative + * Failure: negative * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * Thursday, 21 September 2006 * * Modifications: @@ -741,9 +736,7 @@ done: static herr_t H5FD_direct_query(const H5FD_t UNUSED * _f, unsigned long *flags /* out */) { - herr_t ret_value=SUCCEED; - - FUNC_ENTER_NOAPI(H5FD_direct_query, FAIL) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Set the VFL feature flags that this driver supports */ if(flags) { @@ -754,23 +747,22 @@ H5FD_direct_query(const H5FD_t UNUSED * _f, unsigned long *flags /* out */) *flags|=H5FD_FEAT_AGGREGATE_SMALLDATA; /* OK to aggregate "small" raw data allocations */ } -done: - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI(SUCCEED) } /*------------------------------------------------------------------------- - * Function: H5FD_direct_get_eoa + * Function: H5FD_direct_get_eoa * - * Purpose: Gets the end-of-address marker for the file. The EOA marker - * is the first address past the last byte allocated in the - * format address space. + * Purpose: Gets the end-of-address marker for the file. The EOA marker + * is the first address past the last byte allocated in the + * format address space. * - * Return: Success: The end-of-address marker. + * Return: Success: The end-of-address marker. * - * Failure: HADDR_UNDEF + * Failure: HADDR_UNDEF * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * Wednesday, 20 September 2006 * * Modifications: @@ -783,31 +775,26 @@ done: static haddr_t H5FD_direct_get_eoa(const H5FD_t *_file, H5FD_mem_t UNUSED type) { - const H5FD_direct_t *file = (const H5FD_direct_t*)_file; - haddr_t ret_value; /* Return value */ + const H5FD_direct_t *file = (const H5FD_direct_t*)_file; - FUNC_ENTER_NOAPI(H5FD_direct_get_eoa, HADDR_UNDEF) + FUNC_ENTER_NOAPI_NOINIT_NOERR - /* Set return value */ - ret_value=file->eoa; - -done: - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI(file->eoa) } /*------------------------------------------------------------------------- - * Function: H5FD_direct_set_eoa + * Function: H5FD_direct_set_eoa * - * Purpose: Set the end-of-address marker for the file. This function is - * called shortly after an existing HDF5 file is opened in order - * to tell the driver where the end of the HDF5 data is located. + * Purpose: Set the end-of-address marker for the file. This function is + * called shortly after an existing HDF5 file is opened in order + * to tell the driver where the end of the HDF5 data is located. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * Wednesday, 20 September 2006 * * Modifications: @@ -820,32 +807,30 @@ done: static herr_t H5FD_direct_set_eoa(H5FD_t *_file, H5FD_mem_t UNUSED type, haddr_t addr) { - H5FD_direct_t *file = (H5FD_direct_t*)_file; - herr_t ret_value=SUCCEED; /* Return value */ + H5FD_direct_t *file = (H5FD_direct_t*)_file; - FUNC_ENTER_NOAPI(H5FD_direct_set_eoa, FAIL) + FUNC_ENTER_NOAPI_NOINIT_NOERR file->eoa = addr; -done: - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI(SUCCEED) } /*------------------------------------------------------------------------- - * Function: H5FD_direct_get_eof + * Function: H5FD_direct_get_eof * - * Purpose: Returns the end-of-file marker, which is the greater of - * either the Unix end-of-file or the HDF5 end-of-address - * markers. + * Purpose: Returns the end-of-file marker, which is the greater of + * either the Unix end-of-file or the HDF5 end-of-address + * markers. * - * Return: Success: End of file address, the first address past - * the end of the "file", either the Unix file - * or the HDF5 file. + * Return: Success: End of file address, the first address past + * the end of the "file", either the Unix file + * or the HDF5 file. * - * Failure: HADDR_UNDEF + * Failure: HADDR_UNDEF * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * Wednesday, 20 September 2006 * * Modifications: @@ -855,16 +840,11 @@ done: static haddr_t H5FD_direct_get_eof(const H5FD_t *_file) { - const H5FD_direct_t *file = (const H5FD_direct_t*)_file; - haddr_t ret_value; /* Return value */ - - FUNC_ENTER_NOAPI(H5FD_direct_get_eof, HADDR_UNDEF) + const H5FD_direct_t *file = (const H5FD_direct_t*)_file; - /* Set return value */ - ret_value=MAX(file->eof, file->eoa); + FUNC_ENTER_NOAPI_NOINIT -done: - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI(MAX(file->eof, file->eoa)) } @@ -888,7 +868,7 @@ H5FD_direct_get_handle(H5FD_t *_file, hid_t UNUSED fapl, void** file_handle) H5FD_direct_t *file = (H5FD_direct_t *)_file; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI(H5FD_direct_get_handle, FAIL) + FUNC_ENTER_NOAPI_NOINIT if(!file_handle) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file handle not valid") @@ -900,18 +880,18 @@ done: /*------------------------------------------------------------------------- - * Function: H5FD_direct_read + * Function: H5FD_direct_read * - * Purpose: Reads SIZE bytes of data from FILE beginning at address ADDR - * into buffer BUF according to data transfer properties in - * DXPL_ID. + * Purpose: Reads SIZE bytes of data from FILE beginning at address ADDR + * into buffer BUF according to data transfer properties in + * DXPL_ID. * - * Return: Success: Zero. Result is stored in caller-supplied - * buffer BUF. + * Return: Success: Zero. Result is stored in caller-supplied + * buffer BUF. * - * Failure: -1, Contents of buffer BUF are undefined. + * Failure: -1, Contents of buffer BUF are undefined. * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * Thursday, 21 September 2006 * * Modifications: @@ -920,22 +900,22 @@ done: */ static herr_t H5FD_direct_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, haddr_t addr, - size_t size, void *buf/*out*/) + size_t size, void *buf/*out*/) { - H5FD_direct_t *file = (H5FD_direct_t*)_file; - ssize_t nbytes; - hbool_t _must_align = TRUE; - herr_t ret_value=SUCCEED; /* Return value */ - size_t alloc_size; - void *copy_buf = NULL, *p2; - size_t _boundary; - size_t _fbsize; - size_t _cbsize; - haddr_t read_size; /* Size to read into copy buffer */ - size_t copy_size = size; /* Size remaining to read when using copy buffer */ + H5FD_direct_t *file = (H5FD_direct_t*)_file; + ssize_t nbytes; + hbool_t _must_align = TRUE; + herr_t ret_value=SUCCEED; /* Return value */ + size_t alloc_size; + void *copy_buf = NULL, *p2; + size_t _boundary; + size_t _fbsize; + size_t _cbsize; + haddr_t read_size; /* Size to read into copy buffer */ + size_t copy_size = size; /* Size remaining to read when using copy buffer */ size_t copy_offset; /* Offset into copy buffer of the requested data */ - FUNC_ENTER_NOAPI(H5FD_direct_read, FAIL) + FUNC_ENTER_NOAPI_NOINIT assert(file && file->pub.cls); assert(buf); @@ -971,44 +951,44 @@ H5FD_direct_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, ha * and aligned data first, then copy the data into memory buffer. */ if(!_must_align || ((addr%_fbsize==0) && (size%_fbsize==0) && ((size_t)buf%_boundary==0))) { - /* Seek to the correct location */ - if ((addr!=file->pos || OP_READ!=file->op) && - file_seek(file->fd, (file_offset_t)addr, SEEK_SET)<0) - HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position") - /* Read the aligned data in file first, being careful of interrupted - * system calls and partial results. */ - while (size>0) { - do { - nbytes = HDread(file->fd, buf, size); - } while (-1==nbytes && EINTR==errno); - if (-1==nbytes) /* error */ - HSYS_GOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "file read failed") - if (0==nbytes) { - /* end of file but not end of format address space */ - HDmemset(buf, 0, size); - break; - } - assert(nbytes>=0); - assert((size_t)nbytes<=size); - H5_CHECK_OVERFLOW(nbytes,ssize_t,size_t); - size -= (size_t)nbytes; - H5_CHECK_OVERFLOW(nbytes,ssize_t,haddr_t); - addr += (haddr_t)nbytes; - buf = (char*)buf + nbytes; - } + /* Seek to the correct location */ + if ((addr!=file->pos || OP_READ!=file->op) && + file_seek(file->fd, (file_offset_t)addr, SEEK_SET)<0) + HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position") + /* Read the aligned data in file first, being careful of interrupted + * system calls and partial results. */ + while (size>0) { + do { + nbytes = HDread(file->fd, buf, size); + } while (-1==nbytes && EINTR==errno); + if (-1==nbytes) /* error */ + HSYS_GOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "file read failed") + if (0==nbytes) { + /* end of file but not end of format address space */ + HDmemset(buf, 0, size); + break; + } + assert(nbytes>=0); + assert((size_t)nbytes<=size); + H5_CHECK_OVERFLOW(nbytes,ssize_t,size_t); + size -= (size_t)nbytes; + H5_CHECK_OVERFLOW(nbytes,ssize_t,haddr_t); + addr += (haddr_t)nbytes; + buf = (char*)buf + nbytes; + } } else { /* Calculate where we will begin copying from the copy buffer */ copy_offset = (size_t)(addr % _fbsize); - /* allocate memory needed for the Direct IO option up to the maximal - * copy buffer size. Make a bigger buffer for aligned I/O if size is - * smaller than maximal copy buffer. */ - alloc_size = ((copy_offset + size - 1) / _fbsize + 1) * _fbsize; - if(alloc_size > _cbsize) - alloc_size = _cbsize; - HDassert(!(alloc_size % _fbsize)); - if (HDposix_memalign(©_buf, _boundary, alloc_size) != 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "HDposix_memalign failed") + /* allocate memory needed for the Direct IO option up to the maximal + * copy buffer size. Make a bigger buffer for aligned I/O if size is + * smaller than maximal copy buffer. */ + alloc_size = ((copy_offset + size - 1) / _fbsize + 1) * _fbsize; + if(alloc_size > _cbsize) + alloc_size = _cbsize; + HDassert(!(alloc_size % _fbsize)); + if (HDposix_memalign(©_buf, _boundary, alloc_size) != 0) + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "HDposix_memalign failed") /* look for the aligned position for reading the data */ HDassert(!(((addr / _fbsize) * _fbsize) % _fbsize)); @@ -1016,18 +996,18 @@ H5FD_direct_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, ha SEEK_SET) < 0) HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position") - /* - * Read the aligned data in file into aligned buffer first, then copy the data - * into the final buffer. If the data size is bigger than maximal copy buffer - * size, do the reading by segment (the outer while loop). If not, do one step - * reading. - */ - do { - /* Read the aligned data in file first. Not able to handle interrupted - * system calls and partial results like sec2 driver does because the - * data may no longer be aligned. It's expecially true when the data in - * file is smaller than ALLOC_SIZE. */ - HDmemset(copy_buf, 0, alloc_size); + /* + * Read the aligned data in file into aligned buffer first, then copy the data + * into the final buffer. If the data size is bigger than maximal copy buffer + * size, do the reading by segment (the outer while loop). If not, do one step + * reading. + */ + do { + /* Read the aligned data in file first. Not able to handle interrupted + * system calls and partial results like sec2 driver does because the + * data may no longer be aligned. It's expecially true when the data in + * file is smaller than ALLOC_SIZE. */ + HDmemset(copy_buf, 0, alloc_size); /* Calculate how much data we have to read in this iteration * (including unused parts of blocks) */ @@ -1038,23 +1018,23 @@ H5FD_direct_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, ha read_size = alloc_size; HDassert(!(read_size % _fbsize)); - do { - nbytes = HDread(file->fd, copy_buf, read_size); - } while(-1==nbytes && EINTR==errno); + do { + nbytes = HDread(file->fd, copy_buf, read_size); + } while(-1==nbytes && EINTR==errno); - if (-1==nbytes) /* error */ - HSYS_GOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "file read failed") + if (-1==nbytes) /* error */ + HSYS_GOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "file read failed") - /* Copy the needed data from the copy buffer to the output - * buffer, and update copy_size. If the copy buffer does not + /* Copy the needed data from the copy buffer to the output + * buffer, and update copy_size. If the copy buffer does not * contain the rest of the data, just copy what's in the copy * buffer and also update read_addr and copy_offset to read the * next section of data. */ - p2 = (unsigned char*)copy_buf + copy_offset; - if((copy_size + copy_offset) <= alloc_size) { - HDmemcpy(buf, p2, copy_size); - buf = (unsigned char *)buf + copy_size; - copy_size = 0; + p2 = (unsigned char*)copy_buf + copy_offset; + if((copy_size + copy_offset) <= alloc_size) { + HDmemcpy(buf, p2, copy_size); + buf = (unsigned char *)buf + copy_size; + copy_size = 0; } /* end if */ else { HDmemcpy(buf, p2, alloc_size - copy_offset); @@ -1062,12 +1042,12 @@ H5FD_direct_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, ha copy_size -= alloc_size - copy_offset; copy_offset = 0; } /* end else */ - } while (copy_size > 0); + } while (copy_size > 0); - /*Final step: update address*/ - addr = (haddr_t)(((addr + size - 1) / _fbsize + 1) * _fbsize); + /*Final step: update address*/ + addr = (haddr_t)(((addr + size - 1) / _fbsize + 1) * _fbsize); - if(copy_buf) { + if(copy_buf) { HDfree(copy_buf); copy_buf = NULL; } /* end if */ @@ -1092,17 +1072,17 @@ done: /*------------------------------------------------------------------------- - * Function: H5FD_direct_write + * Function: H5FD_direct_write * - * Purpose: Writes SIZE bytes of data to FILE beginning at address ADDR - * from buffer BUF according to data transfer properties in - * DXPL_ID. + * Purpose: Writes SIZE bytes of data to FILE beginning at address ADDR + * from buffer BUF according to data transfer properties in + * DXPL_ID. * - * Return: Success: Zero + * Return: Success: Zero * - * Failure: -1 + * Failure: -1 * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * Thursday, 21 September 2006 * * Modifications: @@ -1111,25 +1091,25 @@ done: */ static herr_t H5FD_direct_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, haddr_t addr, - size_t size, const void *buf) + size_t size, const void *buf) { - H5FD_direct_t *file = (H5FD_direct_t*)_file; - ssize_t nbytes; - hbool_t _must_align = TRUE; - herr_t ret_value=SUCCEED; /* Return value */ - size_t alloc_size; - void *copy_buf = NULL, *p1; - const void *p3; - size_t _boundary; - size_t _fbsize; - size_t _cbsize; + H5FD_direct_t *file = (H5FD_direct_t*)_file; + ssize_t nbytes; + hbool_t _must_align = TRUE; + herr_t ret_value=SUCCEED; /* Return value */ + size_t alloc_size; + void *copy_buf = NULL, *p1; + const void *p3; + size_t _boundary; + size_t _fbsize; + size_t _cbsize; haddr_t write_addr; /* Address to write copy buffer */ haddr_t write_size; /* Size to write from copy buffer */ haddr_t read_size; /* Size to read into copy buffer */ size_t copy_size = size; /* Size remaining to write when using copy buffer */ size_t copy_offset; /* Offset into copy buffer of the data to write */ - FUNC_ENTER_NOAPI(H5FD_direct_write, FAIL) + FUNC_ENTER_NOAPI_NOINIT assert(file && file->pub.cls); assert(buf); @@ -1159,49 +1139,49 @@ H5FD_direct_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, h * first, update buffer with user data, then write the data out. */ if(!_must_align || ((addr%_fbsize==0) && (size%_fbsize==0) && ((size_t)buf%_boundary==0))) { - /* Seek to the correct location */ - if ((addr!=file->pos || OP_WRITE!=file->op) && - file_seek(file->fd, (file_offset_t)addr, SEEK_SET)<0) - HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position") - - while (size>0) { - do { - nbytes = HDwrite(file->fd, buf, size); - } while (-1==nbytes && EINTR==errno); - if (-1==nbytes) /* error */ - HSYS_GOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "file write failed") - assert(nbytes>0); - assert((size_t)nbytes<=size); - H5_CHECK_OVERFLOW(nbytes,ssize_t,size_t); - size -= (size_t)nbytes; - H5_CHECK_OVERFLOW(nbytes,ssize_t,haddr_t); - addr += (haddr_t)nbytes; - buf = (const char*)buf + nbytes; - } + /* Seek to the correct location */ + if ((addr!=file->pos || OP_WRITE!=file->op) && + file_seek(file->fd, (file_offset_t)addr, SEEK_SET)<0) + HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position") + + while (size>0) { + do { + nbytes = HDwrite(file->fd, buf, size); + } while (-1==nbytes && EINTR==errno); + if (-1==nbytes) /* error */ + HSYS_GOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "file write failed") + assert(nbytes>0); + assert((size_t)nbytes<=size); + H5_CHECK_OVERFLOW(nbytes,ssize_t,size_t); + size -= (size_t)nbytes; + H5_CHECK_OVERFLOW(nbytes,ssize_t,haddr_t); + addr += (haddr_t)nbytes; + buf = (const char*)buf + nbytes; + } } else { /* Calculate where we will begin reading from (on disk) and where we * will begin copying from the copy buffer */ write_addr = (addr / _fbsize) * _fbsize; copy_offset = (size_t)(addr % _fbsize); - /* allocate memory needed for the Direct IO option up to the maximal - * copy buffer size. Make a bigger buffer for aligned I/O if size is - * smaller than maximal copy buffer. - */ - alloc_size = ((copy_offset + size - 1) / _fbsize + 1) * _fbsize; + /* allocate memory needed for the Direct IO option up to the maximal + * copy buffer size. Make a bigger buffer for aligned I/O if size is + * smaller than maximal copy buffer. + */ + alloc_size = ((copy_offset + size - 1) / _fbsize + 1) * _fbsize; if(alloc_size > _cbsize) alloc_size = _cbsize; HDassert(!(alloc_size % _fbsize)); - if (HDposix_memalign(©_buf, _boundary, alloc_size) != 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "HDposix_memalign failed") + if (HDposix_memalign(©_buf, _boundary, alloc_size) != 0) + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "HDposix_memalign failed") /* look for the right position for reading or writing the data */ if(file_seek(file->fd, (file_offset_t)write_addr, SEEK_SET) < 0) HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position") - p3 = buf; - do { + p3 = buf; + do { /* Calculate how much data we have to write in this iteration * (including unused parts of blocks) */ if((copy_size + copy_offset) < alloc_size) @@ -1210,16 +1190,16 @@ H5FD_direct_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, h else write_size = alloc_size; - /* - * Read the aligned data first if the aligned region doesn't fall - * entirely in the range to be writen. Not able to handle interrupted - * system calls and partial results like sec2 driver does because the - * data may no longer be aligned. It's expecially true when the data in - * file is smaller than ALLOC_SIZE. Only read the entire section if + /* + * Read the aligned data first if the aligned region doesn't fall + * entirely in the range to be writen. Not able to handle interrupted + * system calls and partial results like sec2 driver does because the + * data may no longer be aligned. It's expecially true when the data in + * file is smaller than ALLOC_SIZE. Only read the entire section if * both ends are misaligned, otherwise only read the block on the * misaligned end. - */ - HDmemset(copy_buf, 0, _fbsize); + */ + HDmemset(copy_buf, 0, _fbsize); if(copy_offset > 0) { if((write_addr + write_size) > (addr + size)) { @@ -1257,14 +1237,14 @@ H5FD_direct_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, h HSYS_GOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "file read failed") } /* end if */ - /* look for the right position and append or copy the data to be written to - * the aligned buffer. - * Consider all possible situations here: file address is not aligned on - * file block size; the end of data address is not aligned; the end of data - * address is aligned; data size is smaller or bigger than maximal copy size. - */ - p1 = (unsigned char *)copy_buf + copy_offset; - if((copy_size + copy_offset) <= alloc_size) { + /* look for the right position and append or copy the data to be written to + * the aligned buffer. + * Consider all possible situations here: file address is not aligned on + * file block size; the end of data address is not aligned; the end of data + * address is aligned; data size is smaller or bigger than maximal copy size. + */ + p1 = (unsigned char *)copy_buf + copy_offset; + if((copy_size + copy_offset) <= alloc_size) { HDmemcpy(p1, p3, copy_size); copy_size = 0; } /* end if */ @@ -1275,34 +1255,34 @@ H5FD_direct_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, h copy_offset = 0; } /* end else */ - /*look for the aligned position for writing the data*/ - HDassert(!(write_addr % _fbsize)); - if(file_seek(file->fd, (file_offset_t)write_addr, SEEK_SET) < 0) - HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position") - - /* - * Write the data. It doesn't truncate the extra data introduced by - * alignment because that step is done in H5FD_direct_flush. - */ - HDassert(!(write_size % _fbsize)); - do { - nbytes = HDwrite(file->fd, copy_buf, write_size); - } while (-1==nbytes && EINTR==errno); - - if (-1==nbytes) /* error */ - HSYS_GOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "file write failed") - - /* update the write address */ - write_addr += write_size; - } while (copy_size > 0); - - /*Update the address and size*/ - addr = write_addr; - buf = (const char*)buf + size; - - if(copy_buf) { - HDfree(copy_buf); - copy_buf = NULL; + /*look for the aligned position for writing the data*/ + HDassert(!(write_addr % _fbsize)); + if(file_seek(file->fd, (file_offset_t)write_addr, SEEK_SET) < 0) + HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position") + + /* + * Write the data. It doesn't truncate the extra data introduced by + * alignment because that step is done in H5FD_direct_flush. + */ + HDassert(!(write_size % _fbsize)); + do { + nbytes = HDwrite(file->fd, copy_buf, write_size); + } while (-1==nbytes && EINTR==errno); + + if (-1==nbytes) /* error */ + HSYS_GOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "file write failed") + + /* update the write address */ + write_addr += write_size; + } while (copy_size > 0); + + /*Update the address and size*/ + addr = write_addr; + buf = (const char*)buf + size; + + if(copy_buf) { + HDfree(copy_buf); + copy_buf = NULL; } /* end if */ } @@ -1327,16 +1307,16 @@ done: /*------------------------------------------------------------------------- - * Function: H5FD_direct_truncate + * Function: H5FD_direct_truncate * - * Purpose: Makes sure that the true file size is the same (or larger) - * than the end-of-address. + * Purpose: Makes sure that the true file size is the same (or larger) + * than the end-of-address. * - * Return: Success: Non-negative + * Return: Success: Non-negative * - * Failure: Negative + * Failure: Negative * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * Thursday, 21 September 2006 * *------------------------------------------------------------------------- @@ -1344,16 +1324,16 @@ done: static herr_t H5FD_direct_truncate(H5FD_t *_file, hid_t UNUSED dxpl_id, hbool_t UNUSED closing) { - H5FD_direct_t *file = (H5FD_direct_t*)_file; - herr_t ret_value = SUCCEED; /* Return value */ + H5FD_direct_t *file = (H5FD_direct_t*)_file; + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_direct_truncate, FAIL) + FUNC_ENTER_NOAPI_NOINIT assert(file); /* Extend the file to make sure it's large enough */ if (file->eoa!=file->eof) { -#ifdef _WIN32 +#ifdef H5_HAVE_WIN32_API HFILE filehandle; /* Windows file handle */ LARGE_INTEGER li; /* 64-bit integer for SetFilePointer() call */ @@ -1366,10 +1346,10 @@ H5FD_direct_truncate(H5FD_t *_file, hid_t UNUSED dxpl_id, hbool_t UNUSED closing (void)SetFilePointer((HANDLE)filehandle,li.LowPart,&li.HighPart,FILE_BEGIN); if(SetEndOfFile((HANDLE)filehandle)==0) HGOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly") -#else /* _WIN32 */ +#else /* H5_HAVE_WIN32_API */ if (-1==file_truncate(file->fd, (file_offset_t)file->eoa)) HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly") -#endif /* _WIN32 */ +#endif /* H5_HAVE_WIN32_API */ /* Update the eof value */ file->eof = file->eoa; @@ -1379,9 +1359,9 @@ H5FD_direct_truncate(H5FD_t *_file, hid_t UNUSED dxpl_id, hbool_t UNUSED closing file->op = OP_UNKNOWN; } else if (file->fa.must_align){ - /*Even though eof is equal to eoa, file is still truncated because Direct I/O - *write introduces some extra data for alignment. - */ + /*Even though eof is equal to eoa, file is still truncated because Direct I/O + *write introduces some extra data for alignment. + */ if (-1==file_truncate(file->fd, (file_offset_t)file->eof)) HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly") } diff --git a/src/H5FDdirect.h b/src/H5FDdirect.h index 26c70f3..5ceb91f 100644 --- a/src/H5FDdirect.h +++ b/src/H5FDdirect.h @@ -22,8 +22,6 @@ #ifndef H5FDdirect_H #define H5FDdirect_H -#include "H5Ipublic.h" - #ifdef H5_HAVE_DIRECT # define H5FD_DIRECT (H5FD_direct_init()) #else @@ -42,7 +40,6 @@ extern "C" { #define CBSIZE_DEF 16*1024*1024 H5_DLL hid_t H5FD_direct_init(void); -H5_DLL void H5FD_direct_term(void); H5_DLL herr_t H5Pset_fapl_direct(hid_t fapl_id, size_t alignment, size_t block_size, size_t cbuf_size); H5_DLL herr_t H5Pget_fapl_direct(hid_t fapl_id, size_t *boundary/*out*/, @@ -55,3 +52,4 @@ H5_DLL herr_t H5Pget_fapl_direct(hid_t fapl_id, size_t *boundary/*out*/, #endif /* H5_HAVE_DIRECT */ #endif + diff --git a/src/H5FDfamily.c b/src/H5FDfamily.c index 5fd0294..17683ce 100644 --- a/src/H5FDfamily.c +++ b/src/H5FDfamily.c @@ -88,6 +88,7 @@ typedef struct H5FD_family_dxpl_t { } H5FD_family_dxpl_t; /* Callback prototypes */ +static herr_t H5FD_family_term(void); static void *H5FD_family_fapl_get(H5FD_t *_file); static void *H5FD_family_fapl_copy(const void *_old_fa); static herr_t H5FD_family_fapl_free(void *_fa); @@ -119,6 +120,7 @@ static const H5FD_class_t H5FD_family_g = { "family", /*name */ HADDR_MAX, /*maxaddr */ H5F_CLOSE_WEAK, /*fc_degree */ + H5FD_family_term, /*terminate */ H5FD_family_sb_size, /*sb_size */ H5FD_family_sb_encode, /*sb_encode */ H5FD_family_sb_decode, /*sb_decode */ @@ -166,7 +168,7 @@ DESCRIPTION static herr_t H5FD_family_init_interface(void) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FD_family_init_interface) + FUNC_ENTER_NOAPI_NOINIT_NOERR FUNC_LEAVE_NOAPI(H5FD_family_init()) } /* H5FD_family_init_interface() */ @@ -194,7 +196,7 @@ H5FD_family_init(void) { hid_t ret_value=H5FD_FAMILY_g; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_family_init, FAIL) + FUNC_ENTER_NOAPI(FAIL) if (H5I_VFL!=H5Iget_type(H5FD_FAMILY_g)) H5FD_FAMILY_g = H5FD_register(&H5FD_family_g,sizeof(H5FD_class_t),FALSE); @@ -212,24 +214,22 @@ done: * * Purpose: Shut down the VFD * - * Return: + * Returns: Non-negative on success or negative on failure * * Programmer: Quincey Koziol * Friday, Jan 30, 2004 * - * Modification: - * *--------------------------------------------------------------------------- */ -void +static herr_t H5FD_family_term(void) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FD_family_term) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Reset VFL ID */ H5FD_FAMILY_g=0; - FUNC_LEAVE_NOAPI_VOID + FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5FD_family_term() */ @@ -265,7 +265,7 @@ H5Pset_fapl_family(hid_t fapl_id, hsize_t msize, hid_t memb_fapl_id) H5FD_family_fapl_t fa={0, -1}; H5P_genplist_t *plist; /* Property list pointer */ - FUNC_ENTER_API(H5Pset_fapl_family, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("e", "ihi", fapl_id, msize, memb_fapl_id); @@ -324,7 +324,7 @@ H5Pget_fapl_family(hid_t fapl_id, hsize_t *msize/*out*/, H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Pget_fapl_family, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("e", "ixx", fapl_id, msize, memb_fapl_id); if(NULL == (plist = H5P_object_verify(fapl_id,H5P_FILE_ACCESS))) @@ -371,7 +371,7 @@ H5FD_family_fapl_get(H5FD_t *_file) H5P_genplist_t *plist; /* Property list pointer */ void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_family_fapl_get, NULL) + FUNC_ENTER_NOAPI_NOINIT if(NULL == (fa = (H5FD_family_fapl_t *)H5MM_calloc(sizeof(H5FD_family_fapl_t)))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") @@ -417,7 +417,7 @@ H5FD_family_fapl_copy(const void *_old_fa) H5P_genplist_t *plist; /* Property list pointer */ void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_family_fapl_copy, NULL) + FUNC_ENTER_NOAPI_NOINIT if(NULL == (new_fa = (H5FD_family_fapl_t *)H5MM_malloc(sizeof(H5FD_family_fapl_t)))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") @@ -470,7 +470,7 @@ H5FD_family_fapl_free(void *_fa) H5FD_family_fapl_t *fa = (H5FD_family_fapl_t*)_fa; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_family_fapl_free, FAIL) + FUNC_ENTER_NOAPI_NOINIT if(H5I_dec_ref(fa->memb_fapl_id) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTDEC, FAIL, "can't close driver ID") @@ -505,7 +505,7 @@ H5FD_family_dxpl_copy(const void *_old_dx) H5P_genplist_t *plist; /* Property list pointer */ void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_family_dxpl_copy, NULL) + FUNC_ENTER_NOAPI_NOINIT if(NULL == (new_dx = (H5FD_family_dxpl_t *)H5MM_malloc(sizeof(H5FD_family_dxpl_t)))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") @@ -556,7 +556,7 @@ H5FD_family_dxpl_free(void *_dx) H5FD_family_dxpl_t *dx = (H5FD_family_dxpl_t*)_dx; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_family_dxpl_free, FAIL) + FUNC_ENTER_NOAPI_NOINIT if(H5I_dec_ref(dx->memb_dxpl_id) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTDEC, FAIL, "can't close driver ID") @@ -587,16 +587,11 @@ done: static hsize_t H5FD_family_sb_size(H5FD_t UNUSED *_file) { - hsize_t ret_value = 0; /*size of header*/ - - FUNC_ENTER_NOAPI(H5FD_family_sb_size, UFAIL) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* 8 bytes field for the size of member file size field should be * enough for now. */ - ret_value += 8; - -done: - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI(8) } @@ -625,7 +620,7 @@ H5FD_family_sb_encode(H5FD_t *_file, char *name/*out*/, unsigned char *buf/*out* { H5FD_family_t *file = (H5FD_family_t*)_file; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FD_family_sb_encode) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Name and version number */ HDstrncpy(name, "NCSAfami", (size_t)9); @@ -670,7 +665,7 @@ H5FD_family_sb_decode(H5FD_t *_file, const char UNUSED *name, const unsigned cha uint64_t msize; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_family_sb_decode, FAIL) + FUNC_ENTER_NOAPI_NOINIT /* Read member file size. Skip name template for now although it's saved. */ UINT64DECODE(buf, msize); @@ -748,7 +743,7 @@ H5FD_family_open(const char *name, unsigned flags, hid_t fapl_id, hsize_t eof=HADDR_UNDEF; unsigned t_flags = flags & ~H5F_ACC_CREAT; - FUNC_ENTER_NOAPI(H5FD_family_open, NULL) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments */ if(!name || !*name) @@ -905,7 +900,7 @@ H5FD_family_close(H5FD_t *_file) unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_family_close, FAIL) + FUNC_ENTER_NOAPI_NOINIT /* Close as many members as possible. Use private function here to avoid clearing * the error stack. We need the error message to indicate wrong member file size. */ @@ -929,7 +924,6 @@ H5FD_family_close(H5FD_t *_file) H5MM_xfree(file->name); H5MM_xfree(file); -done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5FD_family_close() */ @@ -957,18 +951,17 @@ H5FD_family_cmp(const H5FD_t *_f1, const H5FD_t *_f2) { const H5FD_family_t *f1 = (const H5FD_family_t*)_f1; const H5FD_family_t *f2 = (const H5FD_family_t*)_f2; - int ret_value=(H5FD_VFD_DEFAULT); + int ret_value = 0; - FUNC_ENTER_NOAPI(H5FD_family_cmp, H5FD_VFD_DEFAULT) + FUNC_ENTER_NOAPI_NOINIT_NOERR - assert(f1->nmembs>=1 && f1->memb[0]); - assert(f2->nmembs>=1 && f2->memb[0]); + HDassert(f1->nmembs >= 1 && f1->memb[0]); + HDassert(f2->nmembs >= 1 && f2->memb[0]); - ret_value= H5FDcmp(f1->memb[0], f2->memb[0]); + ret_value = H5FDcmp(f1->memb[0], f2->memb[0]); -done: FUNC_LEAVE_NOAPI(ret_value) -} +} /* end H5FD_family_cmp() */ /*------------------------------------------------------------------------- @@ -991,7 +984,7 @@ H5FD_family_query(const H5FD_t * _file, unsigned long *flags /* out */) { const H5FD_family_t *file = (const H5FD_family_t*)_file; /* Family VFD info */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FD_family_query) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Set the VFL feature flags that this driver supports */ if(flags) { @@ -1035,15 +1028,10 @@ static haddr_t H5FD_family_get_eoa(const H5FD_t *_file, H5FD_mem_t UNUSED type) { const H5FD_family_t *file = (const H5FD_family_t*)_file; - haddr_t ret_value; /* Return value */ - - FUNC_ENTER_NOAPI(H5FD_family_get_eoa, HADDR_UNDEF) - /* Set return value */ - ret_value=file->eoa; + FUNC_ENTER_NOAPI_NOINIT_NOERR -done: - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI(file->eoa) } @@ -1075,7 +1063,7 @@ H5FD_family_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t abs_eoa) unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_family_set_eoa, FAIL) + FUNC_ENTER_NOAPI_NOINIT for(u = 0; addr || u < file->nmembs; u++) { @@ -1153,7 +1141,7 @@ H5FD_family_get_eof(const H5FD_t *_file) int i; /* Local index variable */ haddr_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_family_get_eof, HADDR_UNDEF) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* * Find the last member that has a non-zero EOF and break out of the loop @@ -1180,7 +1168,6 @@ H5FD_family_get_eof(const H5FD_t *_file) /* Set return value */ ret_value = MAX(eof, file->eoa); -done: FUNC_LEAVE_NOAPI(ret_value) } @@ -1208,7 +1195,7 @@ H5FD_family_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle) int memb; herr_t ret_value; - FUNC_ENTER_NOAPI(H5FD_family_get_handle, FAIL) + FUNC_ENTER_NOAPI_NOINIT /* Get the plist structure and family offset */ if(NULL == (plist = H5P_object_verify(fapl, H5P_FILE_ACCESS))) @@ -1260,7 +1247,7 @@ H5FD_family_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, si H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_family_read, FAIL) + FUNC_ENTER_NOAPI_NOINIT /* * Get the member data transfer property list. If the transfer property @@ -1337,7 +1324,7 @@ H5FD_family_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, s H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_family_write, FAIL) + FUNC_ENTER_NOAPI_NOINIT /* * Get the member data transfer property list. If the transfer property @@ -1402,7 +1389,7 @@ H5FD_family_flush(H5FD_t *_file, hid_t dxpl_id, unsigned closing) unsigned u, nerrors = 0; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_family_flush, FAIL) + FUNC_ENTER_NOAPI_NOINIT for(u = 0; u < file->nmembs; u++) if(file->memb[u] && H5FD_flush(file->memb[u], dxpl_id, closing) < 0) @@ -1437,7 +1424,7 @@ H5FD_family_truncate(H5FD_t *_file, hid_t dxpl_id, unsigned closing) unsigned u, nerrors = 0; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_family_truncate, FAIL) + FUNC_ENTER_NOAPI_NOINIT for(u = 0; u < file->nmembs; u++) if(file->memb[u] && H5FD_truncate(file->memb[u], dxpl_id, closing) < 0) diff --git a/src/H5FDfamily.h b/src/H5FDfamily.h index dcb63e6..80969c3 100644 --- a/src/H5FDfamily.h +++ b/src/H5FDfamily.h @@ -22,8 +22,6 @@ #ifndef H5FDfamily_H #define H5FDfamily_H -#include "H5Ipublic.h" - #define H5FD_FAMILY (H5FD_family_init()) #ifdef __cplusplus @@ -31,7 +29,6 @@ extern "C" { #endif H5_DLL hid_t H5FD_family_init(void); -H5_DLL void H5FD_family_term(void); H5_DLL herr_t H5Pset_fapl_family(hid_t fapl_id, hsize_t memb_size, hid_t memb_fapl_id); H5_DLL herr_t H5Pget_fapl_family(hid_t fapl_id, hsize_t *memb_size/*out*/, @@ -42,3 +39,4 @@ H5_DLL herr_t H5Pget_fapl_family(hid_t fapl_id, hsize_t *memb_size/*out*/, #endif #endif + diff --git a/src/H5FDint.c b/src/H5FDint.c index 74b3bf6..09af4ed 100644 --- a/src/H5FDint.c +++ b/src/H5FDint.c @@ -97,7 +97,7 @@ DESCRIPTION static herr_t H5FD_int_init_interface(void) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FD_int_init_interface) + FUNC_ENTER_NOAPI_NOINIT_NOERR FUNC_LEAVE_NOAPI(H5FD_init()) } /* H5FD_int_init_interface() */ @@ -122,7 +122,7 @@ H5FD_read(H5FD_t *file, hid_t dxpl_id, H5FD_mem_t type, haddr_t addr, { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_read, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert(file && file->cls); HDassert(H5I_GENPROP_LST == H5I_get_type(dxpl_id)); @@ -165,7 +165,7 @@ H5FD_write(H5FD_t *file, hid_t dxpl_id, H5FD_mem_t type, haddr_t addr, { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_write, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert(file && file->cls); HDassert(H5I_GENPROP_LST == H5I_get_type(dxpl_id)); @@ -212,7 +212,7 @@ H5FD_set_eoa(H5FD_t *file, H5FD_mem_t type, haddr_t addr) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_set_eoa, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert(file && file->cls); HDassert(H5F_addr_defined(addr) && addr <= file->maxaddr); @@ -249,7 +249,7 @@ H5FD_get_eoa(const H5FD_t *file, H5FD_mem_t type) { haddr_t ret_value; - FUNC_ENTER_NOAPI(H5FD_get_eoa, HADDR_UNDEF) + FUNC_ENTER_NOAPI(HADDR_UNDEF) HDassert(file && file->cls); @@ -291,7 +291,7 @@ H5FD_get_eof(const H5FD_t *file) { haddr_t ret_value; - FUNC_ENTER_NOAPI(H5FD_get_eof, HADDR_UNDEF) + FUNC_ENTER_NOAPI(HADDR_UNDEF) HDassert(file && file->cls); diff --git a/src/H5FDlog.c b/src/H5FDlog.c index 565e935..bfd0b07 100644 --- a/src/H5FDlog.c +++ b/src/H5FDlog.c @@ -30,28 +30,47 @@ #define H5_INTERFACE_INIT_FUNC H5FD_log_init_interface -#include "H5private.h" /* Generic Functions */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5Fprivate.h" /* File access */ -#include "H5FDprivate.h" /* File drivers */ -#include "H5FDlog.h" /* Logging file driver */ -#include "H5FLprivate.h" /* Free Lists */ -#include "H5Iprivate.h" /* IDs */ -#include "H5MMprivate.h" /* Memory management */ -#include "H5Pprivate.h" /* Property lists */ +#include "H5private.h" /* Generic Functions */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5Fprivate.h" /* File access */ +#include "H5FDprivate.h" /* File drivers */ +#include "H5FDlog.h" /* Logging file driver */ +#include "H5FLprivate.h" /* Free Lists */ +#include "H5Iprivate.h" /* IDs */ +#include "H5MMprivate.h" /* Memory management */ +#include "H5Pprivate.h" /* Property lists */ /* The driver identification number, initialized at runtime */ static hid_t H5FD_LOG_g = 0; +/* Since Windows doesn't follow the rest of the world when it comes + * to POSIX I/O types, some typedefs and constants are needed to avoid + * making the code messy with #ifdefs. + */ +#ifdef H5_HAVE_WIN32_API +typedef unsigned int h5_log_io_t; +typedef int h5_log_io_ret_t; +static int H5_LOG_MAX_IO_BYTES_g = INT_MAX; +#else +/* Unix, everyone else */ +typedef size_t h5_log_io_t; +typedef ssize_t h5_log_io_ret_t; +static size_t H5_LOG_MAX_IO_BYTES_g = SSIZET_MAX; +#endif /* H5_HAVE_WIN32_API */ + /* Driver-specific file access properties */ typedef struct H5FD_log_fapl_t { - char *logfile; /* Allocated log file name */ + char *logfile; /* Allocated log file name */ unsigned long long flags; /* Flags for logging behavior */ size_t buf_size; /* Size of buffers for track flavor and number of times each byte is accessed */ } H5FD_log_fapl_t; -/* Define strings for the different file memory types */ -static const char *flavors[]={ /* These are defined in H5FDpublic.h */ +/* Define strings for the different file memory types + * These are defined in the H5F_mem_t enum from H5Fpublic.h + * Note that H5FD_MEM_NOLIST is not listed here since it has + * a negative value. + */ +static const char *flavors[]={ "H5FD_MEM_DEFAULT", "H5FD_MEM_SUPER", "H5FD_MEM_BTREE", @@ -61,11 +80,10 @@ static const char *flavors[]={ /* These are defined in H5FDpublic.h */ "H5FD_MEM_OHDR", }; -/* - * The description of a file belonging to this driver. The `eoa' and `eof' +/* The description of a file belonging to this driver. The `eoa' and `eof' * determine the amount of hdf5 address space in use and the high-water mark - * of the file (the current size of the underlying Unix file). The `pos' - * value is used to eliminate file position updates when they would be a + * of the file (the current size of the underlying filesystem file). The + * `pos' value is used to eliminate file position updates when they would be a * no-op. Unfortunately we've found systems that use separate file position * indicators for reading and writing so the lseek can only be eliminated if * the current operation is the same as the previous operation. When opening @@ -74,72 +92,77 @@ static const char *flavors[]={ /* These are defined in H5FDpublic.h */ * occurs), and `op' will be set to H5F_OP_UNKNOWN. */ typedef struct H5FD_log_t { - H5FD_t pub; /*public stuff, must be first */ - int fd; /*the unix file */ - haddr_t eoa; /*end of allocated region */ - haddr_t eof; /*end of file; current file size*/ - haddr_t pos; /*current file I/O position */ - H5FD_file_op_t op; /*last operation */ - char filename[H5FD_MAX_FILENAME_LEN]; /* Copy of file name from open operation */ -#ifndef _WIN32 - /* - * On most systems the combination of device and i-node number uniquely - * identify a file. + H5FD_t pub; /* public stuff, must be first */ + int fd; /* the unix file */ + haddr_t eoa; /* end of allocated region */ + haddr_t eof; /* end of file; current file size */ + haddr_t pos; /* current file I/O position */ + H5FD_file_op_t op; /* last operation */ + char filename[H5FD_MAX_FILENAME_LEN]; /* Copy of file name from open operation */ +#ifndef H5_HAVE_WIN32_API + /* On most systems the combination of device and i-node number uniquely + * identify a file. Note that Cygwin, MinGW and other Windows POSIX + * environments have the stat function (which fakes inodes) + * and will use the 'device + inodes' scheme as opposed to the + * Windows code further below. */ - dev_t device; /*file device number */ + dev_t device; /* file device number */ #ifdef H5_VMS - ino_t inode[3]; /*file i-node number */ + ino_t inode[3]; /* file i-node number */ #else - ino_t inode; /*file i-node number */ + ino_t inode; /* file i-node number */ #endif /*H5_VMS*/ #else - /* - * On _WIN32 the low-order word of a unique identifier associated with the - * file and the volume serial number uniquely identify a file. This number - * (which, both? -rpm) may change when the system is restarted or when the - * file is opened. After a process opens a file, the identifier is - * constant until the file is closed. An application can use this - * identifier and the volume serial number to determine whether two - * handles refer to the same file. + /* Files in windows are uniquely identified by the volume serial + * number and the file index (both low and high parts). + * + * There are caveats where these numbers can change, especially + * on FAT file systems. On NTFS, however, a file should keep + * those numbers the same until renamed or deleted (though you + * can use ReplaceFile() on NTFS to keep the numbers the same + * while renaming). + * + * See the MSDN "BY_HANDLE_FILE_INFORMATION Structure" entry for + * more information. + * + * http://msdn.microsoft.com/en-us/library/aa363788(v=VS.85).aspx */ - DWORD fileindexlo; - DWORD fileindexhi; -#endif - - /* Information from file open flags, for SWMR access */ - hbool_t swmr_read; /* Whether the file is open for SWMR read access */ + DWORD nFileIndexLow; + DWORD nFileIndexHigh; + DWORD dwVolumeSerialNumber; + + HANDLE hFile; /* Native windows file handle */ +#endif /* H5_HAVE_WIN32_API */ + + /* Information from properties set by 'h5repart' tool + * + * Whether to eliminate the family driver info and convert this file to + * a single file + */ + hbool_t fam_to_sec2; - /* Information from properties set by 'h5repart' tool */ - hbool_t fam_to_sec2; /* Whether to eliminate the family driver info - * and convert this file to a single file */ + /* Information from file open flags, for SWMR access: + * + * Whether the file is open for SWMR read access. + */ + hbool_t swmr_read; /* Fields for tracking I/O operations */ - unsigned char *nread; /* Number of reads from a file location */ - unsigned char *nwrite; /* Number of write to a file location */ - unsigned char *flavor; /* Flavor of information written to file location */ - unsigned long long total_read_ops; /* Total number of read operations */ - unsigned long long total_write_ops; /* Total number of write operations */ - unsigned long long total_seek_ops; /* Total number of seek operations */ - unsigned long long total_truncate_ops; /* Total number of truncate operations */ - double total_read_time; /* Total time spent in read operations */ - double total_write_time; /* Total time spent in write operations */ - double total_seek_time; /* Total time spent in seek operations */ - size_t iosize; /* Size of I/O information buffers */ - FILE *logfp; /* Log file pointer */ - H5FD_log_fapl_t fa; /* Driver-specific file access properties*/ + unsigned char *nread; /* Number of reads from a file location */ + unsigned char *nwrite; /* Number of write to a file location */ + unsigned char *flavor; /* Flavor of information written to file location */ + unsigned long long total_read_ops; /* Total number of read operations */ + unsigned long long total_write_ops; /* Total number of write operations */ + unsigned long long total_seek_ops; /* Total number of seek operations */ + unsigned long long total_truncate_ops; /* Total number of truncate operations */ + double total_read_time; /* Total time spent in read operations */ + double total_write_time; /* Total time spent in write operations */ + double total_seek_time; /* Total time spent in seek operations */ + size_t iosize; /* Size of I/O information buffers */ + FILE *logfp; /* Log file pointer */ + H5FD_log_fapl_t fa; /* Driver-specific file access properties */ } H5FD_log_t; - -/* - * This driver supports systems that have the lseek64() function by defining - * some macros here so we don't have to have conditional compilations later - * throughout the code. - * - * HDoff_t: The datatype for file offsets, the second argument of - * the lseek() or lseek64() call. - * - */ - /* * These macros check for overflow of various quantities. These macros * assume that HDoff_t is signed and haddr_t and size_t are unsigned. @@ -164,6 +187,7 @@ typedef struct H5FD_log_t { (HDoff_t)((A)+(Z))<(HDoff_t)(A)) /* Prototypes */ +static herr_t H5FD_log_term(void); static void *H5FD_log_fapl_get(H5FD_t *file); static void *H5FD_log_fapl_copy(const void *_old_fa); static herr_t H5FD_log_fapl_free(void *_fa); @@ -187,6 +211,7 @@ static const H5FD_class_t H5FD_log_g = { "log", /*name */ MAXADDR, /*maxaddr */ H5F_CLOSE_WEAK, /* fc_degree */ + H5FD_log_term, /*terminate */ NULL, /*sb_size */ NULL, /*sb_encode */ NULL, /*sb_decode */ @@ -237,7 +262,7 @@ DESCRIPTION static herr_t H5FD_log_init_interface(void) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FD_log_init_interface) + FUNC_ENTER_NOAPI_NOINIT_NOERR FUNC_LEAVE_NOAPI(H5FD_log_init()) } /* H5FD_log_init_interface() */ @@ -262,7 +287,7 @@ H5FD_log_init(void) { hid_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_log_init, FAIL) + FUNC_ENTER_NOAPI(FAIL) if(H5I_VFL != H5I_get_type(H5FD_LOG_g)) H5FD_LOG_g = H5FD_register(&H5FD_log_g, sizeof(H5FD_class_t), FALSE); @@ -280,22 +305,22 @@ done: * * Purpose: Shut down the VFD * - * Return: + * Returns: Non-negative on success or negative on failure * * Programmer: Quincey Koziol * Friday, Jan 30, 2004 * *--------------------------------------------------------------------------- */ -void +static herr_t H5FD_log_term(void) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FD_log_term) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Reset VFL ID */ H5FD_LOG_g = 0; - FUNC_LEAVE_NOAPI_VOID + FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5FD_log_term() */ @@ -303,8 +328,7 @@ H5FD_log_term(void) * Function: H5Pset_fapl_log * * Purpose: Modify the file access property list to use the H5FD_LOG - * driver defined in this source file. There are no driver - * specific properties. + * driver defined in this source file. * * Return: Non-negative on success/Negative on failure * @@ -316,17 +340,22 @@ H5FD_log_term(void) herr_t H5Pset_fapl_log(hid_t fapl_id, const char *logfile, unsigned long long flags, size_t buf_size) { - H5FD_log_fapl_t fa; /* File access property list information */ - H5P_genplist_t *plist; /* Property list pointer */ - herr_t ret_value; + H5FD_log_fapl_t fa; /* File access property list information */ + H5P_genplist_t *plist; /* Property list pointer */ + herr_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Pset_fapl_log, FAIL) - H5TRACE4("e", "i*sIuz", fapl_id, logfile, flags, buf_size); + FUNC_ENTER_API(FAIL) + H5TRACE4("e", "i*sULz", fapl_id, logfile, flags, buf_size); + /* Check arguments */ if(NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list") + /* This shallow copy is correct! The string will be properly + * copied deep down in the H5P code. + */ fa.logfile = (char *)logfile; + fa.flags = flags; fa.buf_size = buf_size; ret_value = H5P_set_driver(plist, H5FD_LOG, &fa); @@ -358,7 +387,7 @@ H5FD_log_fapl_get(H5FD_t *_file) H5FD_log_t *file = (H5FD_log_t *)_file; void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FD_log_fapl_get) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Set return value */ ret_value = H5FD_log_fapl_copy(&(file->fa)); @@ -387,7 +416,7 @@ H5FD_log_fapl_copy(const void *_old_fa) H5FD_log_fapl_t *new_fa = NULL; /* New FAPL info */ void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5FD_log_fapl_copy) + FUNC_ENTER_NOAPI_NOINIT HDassert(old_fa); @@ -436,7 +465,7 @@ H5FD_log_fapl_free(void *_fa) { H5FD_log_fapl_t *fa = (H5FD_log_fapl_t*)_fa; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FD_log_fapl_free) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Free the fapl information */ if(fa->logfile) @@ -450,7 +479,7 @@ H5FD_log_fapl_free(void *_fa) /*------------------------------------------------------------------------- * Function: H5FD_log_open * - * Purpose: Create and/or opens a Unix file as an HDF5 file. + * Purpose: Create and/or opens a file as an HDF5 file. * * Return: Success: A pointer to a new file data structure. The * public fields will be initialized by the @@ -470,8 +499,7 @@ H5FD_log_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) H5FD_log_fapl_t *fa; /* File access property list information */ int fd = (-1); /* File descriptor */ int o_flags; /* Flags for open() call */ -#ifdef _WIN32 - HFILE filehandle; +#ifdef H5_HAVE_WIN32_API struct _BY_HANDLE_FILE_INFORMATION fileinfo; #endif #ifdef H5_HAVE_GETTIMEOFDAY @@ -482,7 +510,7 @@ H5FD_log_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) h5_stat_t sb; H5FD_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5FD_log_open) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check on file offsets */ HDcompile_assert(sizeof(HDoff_t) >= sizeof(size_t)); @@ -567,12 +595,18 @@ H5FD_log_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) H5_ASSIGN_OVERFLOW(file->eof, sb.st_size, h5_stat_size_t, haddr_t); file->pos = HADDR_UNDEF; file->op = OP_UNKNOWN; -#ifdef _WIN32 - filehandle = _get_osfhandle(fd); - (void)GetFileInformationByHandle((HANDLE)filehandle, &fileinfo); - file->fileindexhi = fileinfo.nFileIndexHigh; - file->fileindexlo = fileinfo.nFileIndexLow; -#else /* _WIN32 */ +#ifdef H5_HAVE_WIN32_API + file->hFile = (HANDLE)_get_osfhandle(fd); + if(INVALID_HANDLE_VALUE == file->hFile) + HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to get Windows file handle") + + if(!GetFileInformationByHandle((HANDLE)file->hFile, &fileinfo)) + HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to get Windows file information") + + file->nFileIndexHigh = fileinfo.nFileIndexHigh; + file->nFileIndexLow = fileinfo.nFileIndexLow; + file->dwVolumeSerialNumber = fileinfo.dwVolumeSerialNumber; +#else /* H5_HAVE_WIN32_API */ file->device = sb.st_dev; #ifdef H5_VMS file->inode[0] = sb.st_ino[0]; @@ -582,7 +616,7 @@ H5FD_log_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) file->inode = sb.st_ino; #endif /*H5_VMS*/ -#endif /* _WIN32 */ +#endif /* H5_HAVE_WIN32_API */ /* Retain a copy of the name used to open the file, for possible error reporting */ HDstrncpy(file->filename, name, sizeof(file->filename)); @@ -657,7 +691,7 @@ done: /*------------------------------------------------------------------------- * Function: H5FD_log_close * - * Purpose: Closes a Unix file. + * Purpose: Closes an HDF5 file. * * Return: Success: 0 * Failure: -1, file not closed. @@ -676,7 +710,7 @@ H5FD_log_close(H5FD_t *_file) #endif /* H5_HAVE_GETTIMEOFDAY */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5FD_log_close) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(file); @@ -824,15 +858,17 @@ H5FD_log_cmp(const H5FD_t *_f1, const H5FD_t *_f2) const H5FD_log_t *f2 = (const H5FD_log_t *)_f2; int ret_value = 0; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FD_log_cmp) + FUNC_ENTER_NOAPI_NOINIT_NOERR -#ifdef _WIN32 - if(f1->fileindexhi < f2->fileindexhi) HGOTO_DONE(-1) - if(f1->fileindexhi > f2->fileindexhi) HGOTO_DONE(1) +#ifdef H5_HAVE_WIN32_API + if(f1->dwVolumeSerialNumber < f2->dwVolumeSerialNumber) HGOTO_DONE(-1) + if(f1->dwVolumeSerialNumber > f2->dwVolumeSerialNumber) HGOTO_DONE(1) - if(f1->fileindexlo < f2->fileindexlo) HGOTO_DONE(-1) - if(f1->fileindexlo > f2->fileindexlo) HGOTO_DONE(1) + if(f1->nFileIndexHigh < f2->nFileIndexHigh) HGOTO_DONE(-1) + if(f1->nFileIndexHigh > f2->nFileIndexHigh) HGOTO_DONE(1) + if(f1->nFileIndexLow < f2->nFileIndexLow) HGOTO_DONE(-1) + if(f1->nFileIndexLow > f2->nFileIndexLow) HGOTO_DONE(1) #else #ifdef H5_DEV_T_IS_SCALAR if(f1->device < f2->device) HGOTO_DONE(-1) @@ -880,7 +916,7 @@ H5FD_log_query(const H5FD_t *_file, unsigned long *flags /* out */) { const H5FD_log_t *file = (const H5FD_log_t *)_file; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FD_log_query) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Set the VFL feature flags that this driver supports */ if(flags) { @@ -921,7 +957,7 @@ H5FD_log_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t UNUSED dxpl_id, hsize_t siz haddr_t addr; haddr_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FD_log_alloc) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Compute the address for the block to allocate */ addr = file->eoa; @@ -974,7 +1010,7 @@ H5FD_log_get_eoa(const H5FD_t *_file, H5FD_mem_t UNUSED type) { const H5FD_log_t *file = (const H5FD_log_t *)_file; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FD_log_get_eoa) + FUNC_ENTER_NOAPI_NOINIT_NOERR FUNC_LEAVE_NOAPI(file->eoa) } /* end H5FD_log_get_eoa() */ @@ -1000,7 +1036,7 @@ H5FD_log_set_eoa(H5FD_t *_file, H5FD_mem_t UNUSED type, haddr_t addr) { H5FD_log_t *file = (H5FD_log_t *)_file; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FD_log_set_eoa) + FUNC_ENTER_NOAPI_NOINIT_NOERR file->eoa = addr; @@ -1012,11 +1048,11 @@ H5FD_log_set_eoa(H5FD_t *_file, H5FD_mem_t UNUSED type, haddr_t addr) * Function: H5FD_log_get_eof * * Purpose: Returns the end-of-file marker, which is the greater of - * either the Unix end-of-file or the HDF5 end-of-address + * either the filesystem end-of-file or the HDF5 end-of-address * markers. * * Return: Success: End of file address, the first address past - * the end of the "file", either the Unix file + * the end of the "file", either the filesystem file * or the HDF5 file. * Failure: HADDR_UNDEF * @@ -1030,7 +1066,7 @@ H5FD_log_get_eof(const H5FD_t *_file) { const H5FD_log_t *file = (const H5FD_log_t *)_file; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FD_log_get_eof) + FUNC_ENTER_NOAPI_NOINIT_NOERR FUNC_LEAVE_NOAPI(MAX(file->eof, file->eoa)) } /* end H5FD_log_get_eof() */ @@ -1055,7 +1091,7 @@ H5FD_log_get_handle(H5FD_t *_file, hid_t UNUSED fapl, void **file_handle) H5FD_log_t *file = (H5FD_log_t *)_file; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT(H5FD_log_get_handle) + FUNC_ENTER_NOAPI_NOINIT if(!file_handle) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file handle not valid") @@ -1089,7 +1125,6 @@ H5FD_log_read(H5FD_t *_file, H5FD_mem_t type, hid_t UNUSED dxpl_id, haddr_t addr size_t size, void *buf/*out*/) { H5FD_log_t *file = (H5FD_log_t *)_file; - ssize_t nbytes; size_t orig_size = size; /* Save the original size for later */ haddr_t orig_addr = addr; #ifdef H5_HAVE_GETTIMEOFDAY @@ -1097,7 +1132,7 @@ H5FD_log_read(H5FD_t *_file, H5FD_mem_t type, hid_t UNUSED dxpl_id, haddr_t addr #endif /* H5_HAVE_GETTIMEOFDAY */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5FD_log_read) + FUNC_ENTER_NOAPI_NOINIT HDassert(file && file->pub.cls); HDassert(buf); @@ -1182,10 +1217,23 @@ H5FD_log_read(H5FD_t *_file, H5FD_mem_t type, hid_t UNUSED dxpl_id, haddr_t addr HDgettimeofday(&timeval_start, NULL); #endif /* H5_HAVE_GETTIMEOFDAY */ while(size > 0) { + + h5_log_io_t bytes_in = 0; /* # of bytes to read */ + h5_log_io_ret_t bytes_read = -1; /* # of bytes actually read */ + + /* Trying to read more bytes than the return type can handle is + * undefined behavior in POSIX. + */ + if(size > H5_LOG_MAX_IO_BYTES_g) + bytes_in = H5_LOG_MAX_IO_BYTES_g; + else + bytes_in = (h5_log_io_t)size; + do { - nbytes = HDread(file->fd, buf, size); - } while(-1 == nbytes && EINTR == errno); - if(-1 == nbytes) { /* error */ + bytes_read = HDread(file->fd, buf, bytes_in); + } while(-1 == bytes_read && EINTR == errno); + + if(-1 == bytes_read) { /* error */ int myerrno = errno; time_t mytime = HDtime(NULL); HDoff_t myoffset = HDlseek(file->fd, (HDoff_t)0, SEEK_CUR); @@ -1195,18 +1243,20 @@ H5FD_log_read(H5FD_t *_file, H5FD_mem_t type, hid_t UNUSED dxpl_id, haddr_t addr HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "file read failed: time = %s, filename = '%s', file descriptor = %d, errno = %d, error message = '%s', buf = %p, size = %lu, offset = %llu", HDctime(&mytime), file->filename, file->fd, myerrno, HDstrerror(myerrno), buf, (unsigned long)size, (unsigned long long)myoffset); } /* end if */ - if(0 == nbytes) { + + if(0 == bytes_read) { /* end of file but not end of format address space */ HDmemset(buf, 0, size); break; } /* end if */ - HDassert(nbytes >= 0); - HDassert((size_t)nbytes <= size); - H5_CHECK_OVERFLOW(nbytes, ssize_t, size_t); - size -= (size_t)nbytes; - H5_CHECK_OVERFLOW(nbytes, ssize_t, haddr_t); - addr += (haddr_t)nbytes; - buf = (char *)buf + nbytes; + + HDassert(bytes_read >= 0); + HDassert((size_t)bytes_read <= size); + + size -= (size_t)bytes_read; + addr += (haddr_t)bytes_read; + buf = (char *)buf + bytes_read; + } /* end while */ #ifdef H5_HAVE_GETTIMEOFDAY if(file->fa.flags & H5FD_LOG_TIME_READ) @@ -1282,7 +1332,6 @@ H5FD_log_write(H5FD_t *_file, H5FD_mem_t type, hid_t UNUSED dxpl_id, haddr_t add size_t size, const void *buf) { H5FD_log_t *file = (H5FD_log_t *)_file; - ssize_t nbytes; size_t orig_size = size; /* Save the original size for later */ haddr_t orig_addr = addr; #ifdef H5_HAVE_GETTIMEOFDAY @@ -1290,7 +1339,7 @@ H5FD_log_write(H5FD_t *_file, H5FD_mem_t type, hid_t UNUSED dxpl_id, haddr_t add #endif /* H5_HAVE_GETTIMEOFDAY */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5FD_log_write) + FUNC_ENTER_NOAPI_NOINIT HDassert(file && file->pub.cls); HDassert(size > 0); @@ -1374,10 +1423,23 @@ H5FD_log_write(H5FD_t *_file, H5FD_mem_t type, hid_t UNUSED dxpl_id, haddr_t add HDgettimeofday(&timeval_start, NULL); #endif /* H5_HAVE_GETTIMEOFDAY */ while(size > 0) { + + h5_log_io_t bytes_in = 0; /* # of bytes to write */ + h5_log_io_ret_t bytes_wrote = -1; /* # of bytes written */ + + /* Trying to write more bytes than the return type can handle is + * undefined behavior in POSIX. + */ + if(size > H5_LOG_MAX_IO_BYTES_g) + bytes_in = H5_LOG_MAX_IO_BYTES_g; + else + bytes_in = (h5_log_io_t)size; + do { - nbytes = HDwrite(file->fd, buf, size); - } while(-1 == nbytes && EINTR == errno); - if(-1 == nbytes) { /* error */ + bytes_wrote = HDwrite(file->fd, buf, bytes_in); + } while(-1 == bytes_wrote && EINTR == errno); + + if(-1 == bytes_wrote) { /* error */ int myerrno = errno; time_t mytime = HDtime(NULL); HDoff_t myoffset = HDlseek(file->fd, (HDoff_t)0, SEEK_CUR); @@ -1387,13 +1449,13 @@ H5FD_log_write(H5FD_t *_file, H5FD_mem_t type, hid_t UNUSED dxpl_id, haddr_t add HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "file write failed: time = %s, filename = '%s', file descriptor = %d, errno = %d, error message = '%s', buf = %p, size = %lu, offset = %llu", HDctime(&mytime), file->filename, file->fd, myerrno, HDstrerror(myerrno), buf, (unsigned long)size, (unsigned long long)myoffset); } /* end if */ - HDassert(nbytes > 0); - HDassert((size_t)nbytes <= size); - H5_CHECK_OVERFLOW(nbytes, ssize_t, size_t); - size -= (size_t)nbytes; - H5_CHECK_OVERFLOW(nbytes, ssize_t, haddr_t); - addr += (haddr_t)nbytes; - buf = (const char *)buf + nbytes; + + HDassert(bytes_wrote > 0); + HDassert((size_t)bytes_wrote <= size); + + size -= (size_t)bytes_wrote; + addr += (haddr_t)bytes_wrote; + buf = (const char *)buf + bytes_wrote; } /* end while */ #ifdef H5_HAVE_GETTIMEOFDAY if(file->fa.flags & H5FD_LOG_TIME_WRITE) @@ -1475,26 +1537,39 @@ H5FD_log_truncate(H5FD_t *_file, hid_t UNUSED dxpl_id, hbool_t UNUSED closing) H5FD_log_t *file = (H5FD_log_t *)_file; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5FD_log_truncate) + FUNC_ENTER_NOAPI_NOINIT HDassert(file); /* Extend the file to make sure it's large enough */ if(!H5F_addr_eq(file->eoa, file->eof)) { -#ifdef _WIN32 - HFILE filehandle; /* Windows file handle */ - LARGE_INTEGER li; /* 64-bit integer for SetFilePointer() call */ - - /* Map the posix file handle to a Windows file handle */ - filehandle = _get_osfhandle(file->fd); - - /* Translate 64-bit integers into form Windows wants */ - /* [This algorithm is from the Windows documentation for SetFilePointer()] */ - li.QuadPart = (LONGLONG)file->eoa; - (void)SetFilePointer((HANDLE)filehandle, li.LowPart, &li.HighPart, FILE_BEGIN); - if(SetEndOfFile((HANDLE)filehandle) == 0) +#ifdef H5_HAVE_WIN32_API + LARGE_INTEGER li; /* 64-bit (union) integer for SetFilePointer() call */ + DWORD dwPtrLow; /* Low-order pointer bits from SetFilePointer() + * Only used as an error code here. + */ + DWORD dwError; /* DWORD error code from GetLastError() */ + BOOL bError; /* Boolean error flag */ + + /* Windows uses this odd QuadPart union for 32/64-bit portability */ + li.QuadPart = (__int64)file->eoa; + + /* Extend the file to make sure it's large enough. + * + * Since INVALID_SET_FILE_POINTER can technically be a valid return value + * from SetFilePointer(), we also need to check GetLastError(). + */ + dwPtrLow = SetFilePointer(file->hFile, li.LowPart, &li.HighPart, FILE_BEGIN); + if(INVALID_SET_FILE_POINTER == dwPtrLow) { + dwError = GetLastError(); + if(dwError != NO_ERROR ) + HGOTO_ERROR(H5E_FILE, H5E_FILEOPEN, FAIL, "unable to set file pointer") + } + + bError = SetEndOfFile(file->hFile); + if(0 == bError) HGOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly") -#else /* _WIN32 */ +#else /* H5_HAVE_WIN32_API */ #ifdef H5_VMS /* Reset seek offset to the beginning of the file, so that the file isn't * re-extended later. This may happen on Open VMS. */ @@ -1504,7 +1579,7 @@ H5FD_log_truncate(H5FD_t *_file, hid_t UNUSED dxpl_id, hbool_t UNUSED closing) if(-1 == HDftruncate(file->fd, (HDoff_t)file->eoa)) HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly") -#endif /* _WIN32 */ +#endif /* H5_HAVE_WIN32_API */ /* Log information about the truncate */ if(file->fa.flags & H5FD_LOG_NUM_TRUNCATE) diff --git a/src/H5FDlog.h b/src/H5FDlog.h index ffc4df1..2f1544e 100644 --- a/src/H5FDlog.h +++ b/src/H5FDlog.h @@ -22,8 +22,6 @@ #ifndef H5FDlog_H #define H5FDlog_H -#include "H5Ipublic.h" - #define H5FD_LOG (H5FD_log_init()) /* Flags for H5Pset_fapl_log() */ @@ -61,7 +59,6 @@ extern "C" { #endif H5_DLL hid_t H5FD_log_init(void); -H5_DLL void H5FD_log_term(void); H5_DLL herr_t H5Pset_fapl_log(hid_t fapl_id, const char *logfile, unsigned long long flags, size_t buf_size); #ifdef __cplusplus diff --git a/src/H5FDmpi.c b/src/H5FDmpi.c index 21c761a..ff2c87d 100644 --- a/src/H5FDmpi.c +++ b/src/H5FDmpi.c @@ -59,7 +59,7 @@ H5FD_mpi_get_rank(const H5FD_t *file) const H5FD_class_mpi_t *cls=(const H5FD_class_mpi_t *)(file->cls); int ret_value; - FUNC_ENTER_NOAPI(H5FD_mpi_get_rank, FAIL) + FUNC_ENTER_NOAPI(FAIL) assert(file && cls); assert(cls->get_rank); /* All MPI drivers must implement this */ @@ -95,7 +95,7 @@ H5FD_mpi_get_size(const H5FD_t *file) const H5FD_class_mpi_t *cls=(const H5FD_class_mpi_t *)(file->cls); int ret_value; - FUNC_ENTER_NOAPI(H5FD_mpi_get_size, FAIL) + FUNC_ENTER_NOAPI(FAIL) assert(file && cls); assert(cls->get_size); /* All MPI drivers must implement this */ @@ -131,7 +131,7 @@ H5FD_mpi_get_comm(const H5FD_t *file) const H5FD_class_mpi_t *cls=(const H5FD_class_mpi_t *)(file->cls); MPI_Comm ret_value; - FUNC_ENTER_NOAPI(H5FD_mpi_get_comm, MPI_COMM_NULL) + FUNC_ENTER_NOAPI(MPI_COMM_NULL) assert(file && cls); assert(cls->get_comm); /* All MPI drivers must implement this */ @@ -172,7 +172,7 @@ H5FD_mpi_MPIOff_to_haddr(MPI_Offset mpi_off) { haddr_t ret_value=HADDR_UNDEF; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FD_mpi_MPIOff_to_haddr) + FUNC_ENTER_NOAPI_NOINIT_NOERR if (mpi_off != (MPI_Offset)(haddr_t)mpi_off) ret_value=HADDR_UNDEF; @@ -213,7 +213,7 @@ H5FD_mpi_haddr_to_MPIOff(haddr_t addr, MPI_Offset *mpi_off/*out*/) { herr_t ret_value=FAIL; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FD_mpi_haddr_to_MPIOff) + FUNC_ENTER_NOAPI_NOINIT_NOERR assert(mpi_off); @@ -257,7 +257,7 @@ H5FD_mpi_comm_info_dup(MPI_Comm comm, MPI_Info info, MPI_Comm *comm_new, MPI_Inf MPI_Info info_dup=MPI_INFO_NULL; int mpi_code; - FUNC_ENTER_NOAPI(H5FD_mpi_comm_info_dup, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check arguments */ if (MPI_COMM_NULL == comm) @@ -316,7 +316,8 @@ herr_t H5FD_mpi_comm_info_free(MPI_Comm *comm, MPI_Info *info) { herr_t ret_value=SUCCEED; - FUNC_ENTER_NOAPI(H5FD_mpi_comm_info_free, FAIL) + + FUNC_ENTER_NOAPI(FAIL) /* Check arguments */ if (!comm || !info) @@ -368,7 +369,7 @@ H5FD_mpio_wait_for_left_neighbor(H5FD_t *_file) int mpi_code; /* mpi return code */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_mpio_wait_for_left_neighbor, FAIL) + FUNC_ENTER_NOAPI(FAIL) assert(file); assert(H5FD_MPIO==file->pub.driver_id); @@ -422,7 +423,7 @@ H5FD_mpio_signal_right_neighbor(H5FD_t *_file) int mpi_code; /* mpi return code */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_mpio_signal_right_neighbor, FAIL) + FUNC_ENTER_NOAPI(FAIL) assert(file); assert(H5FD_MPIO==file->pub.driver_id); @@ -470,7 +471,7 @@ H5FD_mpi_setup_collective(hid_t dxpl_id, MPI_Datatype btype, MPI_Datatype ftype) H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_mpi_setup_collective, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check arguments */ if(NULL == (plist = H5P_object_verify(dxpl_id,H5P_DATASET_XFER))) @@ -510,7 +511,7 @@ H5FD_mpi_teardown_collective(hid_t dxpl_id) H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_mpi_teardown_collective, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check arguments */ if(NULL == (plist = H5P_object_verify(dxpl_id,H5P_DATASET_XFER))) diff --git a/src/H5FDmpi.h b/src/H5FDmpi.h index b9998dd..2b7ac98 100644 --- a/src/H5FDmpi.h +++ b/src/H5FDmpi.h @@ -73,10 +73,6 @@ typedef struct H5FD_class_mpi_t { /* Macros */ -/* Single macro to check for all file drivers that use MPI */ -#define IS_H5FD_MPI(file) \ - (IS_H5FD_MPIO(file) || IS_H5FD_MPIPOSIX(file)) - #ifdef H5_HAVE_PARALLEL /* ======== Temporary data transfer properties ======== */ /* Definitions for memory MPI type property */ diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c index b382fb4..d780ceb 100644 --- a/src/H5FDmpio.c +++ b/src/H5FDmpio.c @@ -65,6 +65,7 @@ typedef struct H5FD_mpio_t { /* Private Prototypes */ /* Callbacks */ +static herr_t H5FD_mpio_term(void); static void *H5FD_mpio_fapl_get(H5FD_t *_file); static void *H5FD_mpio_fapl_copy(const void *_old_fa); static herr_t H5FD_mpio_fapl_free(void *_fa); @@ -98,6 +99,7 @@ static const H5FD_class_mpi_t H5FD_mpio_g = { "mpio", /*name */ HADDR_MAX, /*maxaddr */ H5F_CLOSE_SEMI, /* fc_degree */ + H5FD_mpio_term, /*terminate */ NULL, /*sb_size */ NULL, /*sb_encode */ NULL, /*sb_decode */ @@ -169,7 +171,7 @@ DESCRIPTION static herr_t H5FD_mpio_init_interface(void) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FD_mpio_init_interface) + FUNC_ENTER_NOAPI_NOINIT_NOERR FUNC_LEAVE_NOAPI(H5FD_mpio_init()) } /* H5FD_mpio_init_interface() */ @@ -200,7 +202,7 @@ H5FD_mpio_init(void) #endif /* H5FDmpio_DEBUG */ hid_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_mpio_init, FAIL) + FUNC_ENTER_NOAPI(FAIL) if (H5I_VFL!=H5I_get_type(H5FD_MPIO_g)) H5FD_MPIO_g = H5FD_register((const H5FD_class_t *)&H5FD_mpio_g,sizeof(H5FD_class_mpi_t),FALSE); @@ -234,24 +236,22 @@ done: * * Purpose: Shut down the VFD * - * Return: + * Returns: Non-negative on success or negative on failure * * Programmer: Quincey Koziol * Friday, Jan 30, 2004 * - * Modification: - * *--------------------------------------------------------------------------- */ -void +static herr_t H5FD_mpio_term(void) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FD_mpio_term) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Reset VFL ID */ H5FD_MPIO_g=0; - FUNC_LEAVE_NOAPI_VOID + FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5FD_mpio_term() */ @@ -321,7 +321,7 @@ H5Pset_fapl_mpio(hid_t fapl_id, MPI_Comm comm, MPI_Info info) H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value; - FUNC_ENTER_API(H5Pset_fapl_mpio, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("e", "iMcMi", fapl_id, comm, info); if(fapl_id == H5P_DEFAULT) @@ -392,7 +392,7 @@ H5Pget_fapl_mpio(hid_t fapl_id, MPI_Comm *comm/*out*/, MPI_Info *info/*out*/) int mpi_code; /* mpi return code */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Pget_fapl_mpio, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("e", "ixx", fapl_id, comm, info); if(NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) @@ -466,7 +466,7 @@ H5Pset_dxpl_mpio(hid_t dxpl_id, H5FD_mpio_xfer_t xfer_mode) H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value; - FUNC_ENTER_API(H5Pset_dxpl_mpio, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "iDt", dxpl_id, xfer_mode); if(dxpl_id==H5P_DEFAULT) @@ -516,7 +516,7 @@ H5Pget_dxpl_mpio(hid_t dxpl_id, H5FD_mpio_xfer_t *xfer_mode/*out*/) H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Pget_dxpl_mpio, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "ix", dxpl_id, xfer_mode); if(NULL == (plist = H5P_object_verify(dxpl_id, H5P_DATASET_XFER))) @@ -563,7 +563,7 @@ H5Pset_dxpl_mpio_collective_opt(hid_t dxpl_id, H5FD_mpio_collective_opt_t opt_mo H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value; - FUNC_ENTER_API(H5Pset_dxpl_mpio_collective_opt, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "iDc", dxpl_id, opt_mode); if(dxpl_id == H5P_DEFAULT) @@ -615,7 +615,7 @@ H5Pset_dxpl_mpio_chunk_opt(hid_t dxpl_id, H5FD_mpio_chunk_opt_t opt_mode) H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value; - FUNC_ENTER_API(H5Pset_dxpl_mpio_chunk_opt, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "iDh", dxpl_id, opt_mode); if(dxpl_id == H5P_DEFAULT) @@ -662,7 +662,7 @@ H5Pset_dxpl_mpio_chunk_opt_num(hid_t dxpl_id, unsigned num_chunk_per_proc) H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value; - FUNC_ENTER_API(H5Pset_dxpl_mpio_chunk_opt_num, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "iIu", dxpl_id, num_chunk_per_proc); if(dxpl_id == H5P_DEFAULT) @@ -709,7 +709,7 @@ H5Pset_dxpl_mpio_chunk_opt_ratio(hid_t dxpl_id, unsigned percent_num_proc_per_ch H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value; - FUNC_ENTER_API(H5Pset_dxpl_mpio_chunk_opt_ratio, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "iIu", dxpl_id, percent_num_proc_per_chunk); if(dxpl_id == H5P_DEFAULT) @@ -758,7 +758,7 @@ H5FD_mpio_fapl_get(H5FD_t *_file) H5FD_mpio_fapl_t *fa = NULL; void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_mpio_fapl_get, NULL) + FUNC_ENTER_NOAPI_NOINIT HDassert(file); HDassert(H5FD_MPIO == file->pub.driver_id); @@ -801,7 +801,7 @@ H5FD_mpio_fapl_copy(const void *_old_fa) const H5FD_mpio_fapl_t *old_fa = (const H5FD_mpio_fapl_t*)_old_fa; H5FD_mpio_fapl_t *new_fa = NULL; - FUNC_ENTER_NOAPI(H5FD_mpio_fapl_copy, NULL) + FUNC_ENTER_NOAPI_NOINIT #ifdef H5FDmpio_DEBUG if (H5FD_mpio_Debug[(int)'t']) fprintf(stderr, "enter H5FD_mpio_fapl_copy\n"); @@ -855,7 +855,7 @@ H5FD_mpio_fapl_free(void *_fa) herr_t ret_value = SUCCEED; H5FD_mpio_fapl_t *fa = (H5FD_mpio_fapl_t*)_fa; - FUNC_ENTER_NOAPI(H5FD_mpio_fapl_free, FAIL) + FUNC_ENTER_NOAPI_NOINIT_NOERR #ifdef H5FDmpio_DEBUG if (H5FD_mpio_Debug[(int)'t']) fprintf(stderr, "in H5FD_mpio_fapl_free\n"); @@ -867,7 +867,6 @@ fprintf(stderr, "in H5FD_mpio_fapl_free\n"); H5FD_mpi_comm_info_free(&fa->comm, &fa->info); H5MM_xfree(fa); -done: #ifdef H5FDmpio_DEBUG if (H5FD_mpio_Debug[(int)'t']) fprintf(stderr, "leaving H5FD_mpio_fapl_free\n"); @@ -940,10 +939,10 @@ H5FD_mpio_open(const char *name, unsigned flags, hid_t fapl_id, MPI_Info info_dup=MPI_INFO_NULL; H5FD_t *ret_value; /* Return value */ #ifndef H5_HAVE_MPI_GET_SIZE - struct stat stat_buf; + h5_stat_t stat_buf; #endif - FUNC_ENTER_NOAPI(H5FD_mpio_open, NULL) + FUNC_ENTER_NOAPI_NOINIT #ifdef H5FDmpio_DEBUG if (H5FD_mpio_Debug[(int)'t']) { @@ -1103,7 +1102,7 @@ H5FD_mpio_close(H5FD_t *_file) int mpi_code; /* MPI return code */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_mpio_close, FAIL) + FUNC_ENTER_NOAPI_NOINIT #ifdef H5FDmpio_DEBUG if (H5FD_mpio_Debug[(int)'t']) @@ -1156,19 +1155,18 @@ done: static herr_t H5FD_mpio_query(const H5FD_t UNUSED *_file, unsigned long *flags /* out */) { - herr_t ret_value=SUCCEED; - - FUNC_ENTER_NOAPI(H5FD_mpio_query, FAIL) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Set the VFL feature flags that this driver supports */ if(flags) { *flags=0; - *flags|=H5FD_FEAT_AGGREGATE_METADATA; /* OK to aggregate metadata allocations */ + *flags|=H5FD_FEAT_AGGREGATE_METADATA; /* OK to aggregate metadata allocations */ *flags|=H5FD_FEAT_AGGREGATE_SMALLDATA; /* OK to aggregate "small" raw data allocations */ + *flags|=H5FD_FEAT_HAS_MPI; /* This driver uses MPI */ + *flags|=H5FD_FEAT_ALLOCATE_EARLY; /* Allocate space early instead of late */ } /* end if */ -done: - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI(SUCCEED) } @@ -1197,18 +1195,13 @@ static haddr_t H5FD_mpio_get_eoa(const H5FD_t *_file, H5FD_mem_t UNUSED type) { const H5FD_mpio_t *file = (const H5FD_mpio_t*)_file; - haddr_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_mpio_get_eoa, HADDR_UNDEF) + FUNC_ENTER_NOAPI_NOINIT_NOERR assert(file); assert(H5FD_MPIO==file->pub.driver_id); - /* Set return value */ - ret_value=file->eoa; - -done: - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI(file->eoa) } @@ -1237,17 +1230,15 @@ static herr_t H5FD_mpio_set_eoa(H5FD_t *_file, H5FD_mem_t UNUSED type, haddr_t addr) { H5FD_mpio_t *file = (H5FD_mpio_t*)_file; - herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_mpio_set_eoa, FAIL) + FUNC_ENTER_NOAPI_NOINIT_NOERR assert(file); assert(H5FD_MPIO==file->pub.driver_id); file->eoa = addr; -done: - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI(SUCCEED) } @@ -1284,18 +1275,13 @@ static haddr_t H5FD_mpio_get_eof(const H5FD_t *_file) { const H5FD_mpio_t *file = (const H5FD_mpio_t*)_file; - haddr_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_mpio_get_eof, HADDR_UNDEF) + FUNC_ENTER_NOAPI_NOINIT_NOERR assert(file); assert(H5FD_MPIO==file->pub.driver_id); - /* Set return value */ - ret_value=file->eof; - -done: - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI(file->eof) } @@ -1319,7 +1305,7 @@ H5FD_mpio_get_handle(H5FD_t *_file, hid_t UNUSED fapl, void** file_handle) H5FD_mpio_t *file = (H5FD_mpio_t *)_file; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI(H5FD_mpio_get_handle, FAIL) + FUNC_ENTER_NOAPI_NOINIT if(!file_handle) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file handle not valid") @@ -1417,7 +1403,7 @@ H5FD_mpio_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t dxpl_id, haddr_t add hbool_t use_view_this_time = FALSE; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI(H5FD_mpio_read, FAIL) + FUNC_ENTER_NOAPI_NOINIT #ifdef H5FDmpio_DEBUG if (H5FD_mpio_Debug[(int)'t']) @@ -1701,7 +1687,7 @@ H5FD_mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, H5P_genplist_t *plist = NULL; /* Property list pointer */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI(H5FD_mpio_write, FAIL) + FUNC_ENTER_NOAPI_NOINIT #ifdef H5FDmpio_DEBUG if (H5FD_mpio_Debug[(int)'t']) @@ -1876,7 +1862,7 @@ H5FD_mpio_flush(H5FD_t *_file, hid_t UNUSED dxpl_id, unsigned closing) int mpi_code; /* mpi return code */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI(H5FD_mpio_flush, FAIL) + FUNC_ENTER_NOAPI_NOINIT #ifdef H5FDmpio_DEBUG if(H5FD_mpio_Debug[(int)'t']) @@ -1920,7 +1906,7 @@ H5FD_mpio_truncate(H5FD_t *_file, hid_t UNUSED dxpl_id, hbool_t UNUSED closing) H5FD_mpio_t *file = (H5FD_mpio_t*)_file; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI(H5FD_mpio_truncate, FAIL) + FUNC_ENTER_NOAPI_NOINIT #ifdef H5FDmpio_DEBUG if(H5FD_mpio_Debug[(int)'t']) @@ -2010,18 +1996,13 @@ static int H5FD_mpio_mpi_rank(const H5FD_t *_file) { const H5FD_mpio_t *file = (const H5FD_mpio_t*)_file; - int ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_mpio_mpi_rank, FAIL) + FUNC_ENTER_NOAPI_NOINIT_NOERR assert(file); assert(H5FD_MPIO==file->pub.driver_id); - /* Set return value */ - ret_value=file->mpi_rank; - -done: - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI(file->mpi_rank) } /* end H5FD_mpio_mpi_rank() */ @@ -2044,18 +2025,13 @@ static int H5FD_mpio_mpi_size(const H5FD_t *_file) { const H5FD_mpio_t *file = (const H5FD_mpio_t*)_file; - int ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_mpio_mpi_size, FAIL) + FUNC_ENTER_NOAPI_NOINIT_NOERR assert(file); assert(H5FD_MPIO==file->pub.driver_id); - /* Set return value */ - ret_value=file->mpi_size; - -done: - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI(file->mpi_size) } /* end H5FD_mpio_mpi_size() */ @@ -2079,18 +2055,14 @@ static MPI_Comm H5FD_mpio_communicator(const H5FD_t *_file) { const H5FD_mpio_t *file = (const H5FD_mpio_t*)_file; - MPI_Comm ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_mpio_communicator, MPI_COMM_NULL) + FUNC_ENTER_NOAPI_NOINIT_NOERR assert(file); assert(H5FD_MPIO==file->pub.driver_id); - /* Set return value */ - ret_value=file->comm; - -done: - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI(file->comm) } #endif /* H5_HAVE_PARALLEL */ + diff --git a/src/H5FDmpio.h b/src/H5FDmpio.h index 41baf8d..fe2d11f 100644 --- a/src/H5FDmpio.h +++ b/src/H5FDmpio.h @@ -46,7 +46,6 @@ extern "C" { #endif H5_DLL hid_t H5FD_mpio_init(void); -H5_DLL void H5FD_mpio_term(void); H5_DLL herr_t H5Pset_fapl_mpio(hid_t fapl_id, MPI_Comm comm, MPI_Info info); H5_DLL herr_t H5Pget_fapl_mpio(hid_t fapl_id, MPI_Comm *comm/*out*/, MPI_Info *info/*out*/); @@ -63,3 +62,4 @@ H5_DLL herr_t H5Pset_dxpl_mpio_chunk_opt_ratio(hid_t dxpl_id, unsigned percent_n #endif /* H5_HAVE_PARALLEL */ #endif + diff --git a/src/H5FDmpiposix.c b/src/H5FDmpiposix.c index 2a61c89..c91f176 100644 --- a/src/H5FDmpiposix.c +++ b/src/H5FDmpiposix.c @@ -17,7 +17,7 @@ * Programmer: Quincey Koziol * Thursday, July 11, 2002 * - * Purpose: This is a "combination" MPI-2 and posix I/O driver. + * Purpose: This is a "combination" MPI-2 and posix I/O driver. * It uses MPI for coordinating the actions of several processes * and posix I/O calls to do the actual I/O to the disk. * @@ -34,17 +34,17 @@ */ /* Interface initialization */ -#define H5_INTERFACE_INIT_FUNC H5FD_mpiposix_init_interface +#define H5_INTERFACE_INIT_FUNC H5FD_mpiposix_init_interface -#include "H5private.h" /* Generic Functions */ -#include "H5ACprivate.h" /* Metadata cache */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5Fprivate.h" /* File access */ -#include "H5FDprivate.h" /* File drivers */ -#include "H5FDmpi.h" /* MPI-based file drivers */ -#include "H5Iprivate.h" /* IDs */ -#include "H5MMprivate.h" /* Memory management */ +#include "H5private.h" /* Generic Functions */ +#include "H5ACprivate.h" /* Metadata cache */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5Fprivate.h" /* File access */ +#include "H5FDprivate.h" /* File drivers */ +#include "H5FDmpi.h" /* MPI-based file drivers */ +#include "H5Iprivate.h" /* IDs */ +#include "H5MMprivate.h" /* Memory management */ #include "H5Pprivate.h" /* Property lists */ /* Features: @@ -72,9 +72,9 @@ static hid_t H5FD_MPIPOSIX_g = 0; /* File operations */ -#define OP_UNKNOWN 0 -#define OP_READ 1 -#define OP_WRITE 2 +#define OP_UNKNOWN 0 +#define OP_READ 1 +#define OP_WRITE 2 /* * The description of a file belonging to this driver. @@ -84,31 +84,31 @@ static hid_t H5FD_MPIPOSIX_g = 0; * doesn't bother to keep it updated since it's an expensive operation. */ typedef struct H5FD_mpiposix_t { - H5FD_t pub; /*public stuff, must be first */ - int fd; /*the unix file handle */ - MPI_Comm comm; /*communicator */ + H5FD_t pub; /*public stuff, must be first */ + int fd; /*the unix file handle */ + MPI_Comm comm; /*communicator */ int mpi_rank; /* This process's rank */ int mpi_size; /* Total number of processes */ - haddr_t eof; /*end-of-file marker */ - haddr_t eoa; /*end-of-address marker */ - haddr_t last_eoa; /* Last known end-of-address marker */ - haddr_t pos; /* Current file I/O position */ - int op; /* Last file I/O operation */ - hsize_t naccess; /* Number of (write) accesses to file */ + haddr_t eof; /*end-of-file marker */ + haddr_t eoa; /*end-of-address marker */ + haddr_t last_eoa; /* Last known end-of-address marker */ + haddr_t pos; /* Current file I/O position */ + int op; /* Last file I/O operation */ + hsize_t naccess; /* Number of (write) accesses to file */ #ifdef H5_HAVE_GPFS size_t blksize; /* Block size of file system */ #endif hbool_t use_gpfs; /* Use GPFS to write things */ -#ifndef _WIN32 +#ifndef H5_HAVE_WIN32_API /* * On most systems the combination of device and i-node number uniquely * identify a file. */ - dev_t device; /*file device number */ - ino_t inode; /*file i-node number */ + dev_t device; /*file device number */ + ino_t inode; /*file i-node number */ #else /* - * On _WIN32 the low-order word of a unique identifier associated with the + * On H5_HAVE_WIN32_API the low-order word of a unique identifier associated with the * file and the volume serial number uniquely identify a file. This number * (which, both? -rpm) may change when the system is restarted or when the * file is opened. After a process opens a file, the identifier is @@ -129,59 +129,60 @@ typedef struct H5FD_mpiposix_t { * some macros here so we don't have to have conditional compilations later * throughout the code. * - * file_offset_t: The datatype for file offsets, the second argument of - * the lseek() or lseek64() call. + * file_offset_t: The datatype for file offsets, the second argument of + * the lseek() or lseek64() call. * - * file_seek: The function which adjusts the current file position, - * either lseek() or lseek64(). + * file_seek: The function which adjusts the current file position, + * either lseek() or lseek64(). */ /* adding for windows NT file system support. */ #ifdef H5_HAVE_LSEEK64 -# define file_offset_t off64_t -# define file_seek lseek64 -# define file_truncate ftruncate64 -#elif defined (_WIN32) +# define file_offset_t off64_t +# define file_seek lseek64 +# define file_truncate ftruncate64 +#elif defined (H5_HAVE_WIN32_API) # /*MSVC*/ # define file_offset_t __int64 # define file_seek _lseeki64 -# define file_truncate _ftruncatei64 +# define file_truncate _ftruncatei64 #else -# define file_offset_t off_t -# define file_seek HDlseek -# define file_truncate HDftruncate +# define file_offset_t off_t +# define file_seek HDlseek +# define file_truncate HDftruncate #endif /* * These macros check for overflow of various quantities. These macros * assume that file_offset_t is signed and haddr_t and size_t are unsigned. * - * ADDR_OVERFLOW: Checks whether a file address of type `haddr_t' - * is too large to be represented by the second argument - * of the file seek function. + * ADDR_OVERFLOW: Checks whether a file address of type `haddr_t' + * is too large to be represented by the second argument + * of the file seek function. * - * SIZE_OVERFLOW: Checks whether a buffer size of type `hsize_t' is too - * large to be represented by the `size_t' type. + * SIZE_OVERFLOW: Checks whether a buffer size of type `hsize_t' is too + * large to be represented by the `size_t' type. * - * REGION_OVERFLOW: Checks whether an address and size pair describe data - * which can be addressed entirely by the second - * argument of the file seek function. + * REGION_OVERFLOW: Checks whether an address and size pair describe data + * which can be addressed entirely by the second + * argument of the file seek function. */ #define MAXADDR (((haddr_t)1<<(8*sizeof(file_offset_t)-1))-1) -#define ADDR_OVERFLOW(A) (HADDR_UNDEF==(A) || \ - ((A) & ~(haddr_t)MAXADDR)) -#define SIZE_OVERFLOW(Z) ((Z) & ~(hsize_t)MAXADDR) -#define REGION_OVERFLOW(A,Z) (ADDR_OVERFLOW(A) || SIZE_OVERFLOW(Z) || \ - sizeof(file_offset_t) + * Returns: Non-negative on success or negative on failure * * Programmer: Quincey Koziol * Friday, Jan 30, 2004 * - * Modification: - * *--------------------------------------------------------------------------- */ -void +static herr_t H5FD_mpiposix_term(void) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FD_mpiposix_term) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Reset VFL ID */ H5FD_MPIPOSIX_g=0; - FUNC_LEAVE_NOAPI_VOID + FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5FD_mpiposix_term() */ /*------------------------------------------------------------------------- - * Function: H5Pset_fapl_mpiposix + * Function: H5Pset_fapl_mpiposix * - * Purpose: Store the user supplied MPI communicator COMM in - * the file access property list FAPL_ID which can then be used - * to create and/or open the file. This function is available - * only in the parallel HDF5 library and is not collective. + * Purpose: Store the user supplied MPI communicator COMM in + * the file access property list FAPL_ID which can then be used + * to create and/or open the file. This function is available + * only in the parallel HDF5 library and is not collective. * - * comm is the MPI communicator to be used for file open as - * defined in MPI_FILE_OPEN of MPI-2. This function makes a - * duplicate of comm. Any modification to comm after this function - * call returns has no effect on the access property list. + * comm is the MPI communicator to be used for file open as + * defined in MPI_FILE_OPEN of MPI-2. This function makes a + * duplicate of comm. Any modification to comm after this function + * call returns has no effect on the access property list. * * If fapl_id has previously set comm value, it will be replaced * and the old communicator is freed. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * - * Programmer: Quincey Koziol - * Thursday, July 11, 2002 + * Programmer: Quincey Koziol + * Thursday, July 11, 2002 * * Modifications: - * Albert Cheng, 2003-04-24 - * Modified the description of the function that it now stores - * a duplicate of the communicator. Free the old duplicate if - * previously set. (Work is actually done by H5P_set_driver.) + * Albert Cheng, 2003-04-24 + * Modified the description of the function that it now stores + * a duplicate of the communicator. Free the old duplicate if + * previously set. (Work is actually done by H5P_set_driver.) * - * Bill Wendling, 2003-05-01 - * Modified to take an extra flag indicating that we should - * use the GPFS hints (if available) for this file. + * Bill Wendling, 2003-05-01 + * Modified to take an extra flag indicating that we should + * use the GPFS hints (if available) for this file. * *------------------------------------------------------------------------- */ herr_t H5Pset_fapl_mpiposix(hid_t fapl_id, MPI_Comm comm, hbool_t use_gpfs) { - H5FD_mpiposix_fapl_t fa; + H5FD_mpiposix_fapl_t fa; H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value; - FUNC_ENTER_API(H5Pset_fapl_mpiposix, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("e", "iMcb", fapl_id, comm, use_gpfs); /* Check arguments */ if(NULL == (plist = H5P_object_verify(fapl_id,H5P_FILE_ACCESS))) HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a file access list") if (MPI_COMM_NULL == comm) - HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a valid communicator") + HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a valid communicator") /* Initialize driver specific properties */ fa.comm = comm; @@ -391,29 +391,29 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_fapl_mpiposix + * Function: H5Pget_fapl_mpiposix * - * Purpose: If the file access property list is set to the H5FD_MPIPOSIX - * driver then this function returns a duplicate of the MPI - * communicator through the comm pointer. It is the responsibility - * of the application to free the returned communicator. + * Purpose: If the file access property list is set to the H5FD_MPIPOSIX + * driver then this function returns a duplicate of the MPI + * communicator through the comm pointer. It is the responsibility + * of the application to free the returned communicator. * - * Return: Success: Non-negative with the communicator and - * information returned through the COMM - * argument if non-null. Since it is a duplicate - * of the stored object, future modifications to - * the access property list do not affect it and - * it is the responsibility of the application to - * free it. + * Return: Success: Non-negative with the communicator and + * information returned through the COMM + * argument if non-null. Since it is a duplicate + * of the stored object, future modifications to + * the access property list do not affect it and + * it is the responsibility of the application to + * free it. * - * Failure: Negative + * Failure: Negative * - * Programmer: Quincey Koziol - * Thursday, July 11, 2002 + * Programmer: Quincey Koziol + * Thursday, July 11, 2002 * * Modifications: - * Albert Cheng, 2003-04-24 - * Return duplicate of the stored communicator. + * Albert Cheng, 2003-04-24 + * Return duplicate of the stored communicator. * * Bill Wendling, 2003-05-01 * Return the USE_GPFS flag. @@ -423,12 +423,12 @@ done: herr_t H5Pget_fapl_mpiposix(hid_t fapl_id, MPI_Comm *comm/*out*/, hbool_t *use_gpfs/*out*/) { - H5FD_mpiposix_fapl_t *fa; + H5FD_mpiposix_fapl_t *fa; H5P_genplist_t *plist; /* Property list pointer */ - int mpi_code; /* mpi return code */ + int mpi_code; /* mpi return code */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Pget_fapl_mpiposix, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("e", "ixx", fapl_id, comm, use_gpfs); if(NULL == (plist = H5P_object_verify(fapl_id,H5P_FILE_ACCESS))) @@ -440,8 +440,8 @@ H5Pget_fapl_mpiposix(hid_t fapl_id, MPI_Comm *comm/*out*/, hbool_t *use_gpfs/*ou /* Get MPI Communicator */ if (comm){ - if (MPI_SUCCESS != (mpi_code=MPI_Comm_dup(fa->comm, comm))) - HMPI_GOTO_ERROR(FAIL, "MPI_Comm_dup failed", mpi_code) + if (MPI_SUCCESS != (mpi_code=MPI_Comm_dup(fa->comm, comm))) + HMPI_GOTO_ERROR(FAIL, "MPI_Comm_dup failed", mpi_code) } if (use_gpfs) @@ -453,35 +453,35 @@ done: /*------------------------------------------------------------------------- - * Function: H5FD_mpiposix_fapl_get + * Function: H5FD_mpiposix_fapl_get * - * Purpose: Returns a file access property list which could be used to - * create another file the same as this one. + * Purpose: Returns a file access property list which could be used to + * create another file the same as this one. * - * Return: Success: Ptr to new file access property list with all - * fields copied from the file pointer. + * Return: Success: Ptr to new file access property list with all + * fields copied from the file pointer. * - * Failure: NULL + * Failure: NULL * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, July 11, 2002 * * Modifications: - * Albert Cheng, 2003-04-24 - * Duplicate the communicator object so that the new - * property list is insulated from the old one. + * Albert Cheng, 2003-04-24 + * Duplicate the communicator object so that the new + * property list is insulated from the old one. * *------------------------------------------------------------------------- */ static void * H5FD_mpiposix_fapl_get(H5FD_t *_file) { - H5FD_mpiposix_t *file = (H5FD_mpiposix_t*)_file; + H5FD_mpiposix_t *file = (H5FD_mpiposix_t*)_file; H5FD_mpiposix_fapl_t *fa = NULL; - int mpi_code; /* MPI return code */ + int mpi_code; /* MPI return code */ void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_mpiposix_fapl_get, NULL) + FUNC_ENTER_NOAPI_NOINIT assert(file); assert(H5FD_MPIPOSIX==file->pub.driver_id); @@ -491,7 +491,7 @@ H5FD_mpiposix_fapl_get(H5FD_t *_file) /* Duplicate the communicator. */ if (MPI_SUCCESS != (mpi_code=MPI_Comm_dup(file->comm, &fa->comm))) - HMPI_GOTO_ERROR(NULL, "MPI_Comm_dup failed", mpi_code) + HMPI_GOTO_ERROR(NULL, "MPI_Comm_dup failed", mpi_code) fa->use_gpfs = file->use_gpfs; @@ -504,15 +504,15 @@ done: /*------------------------------------------------------------------------- - * Function: H5FD_mpiposix_fapl_copy + * Function: H5FD_mpiposix_fapl_copy * - * Purpose: Copies the mpiposix-specific file access properties. + * Purpose: Copies the mpiposix-specific file access properties. * - * Return: Success: Ptr to a new property list + * Return: Success: Ptr to a new property list * - * Failure: NULL + * Failure: NULL * - * Programmer: Albert Cheng + * Programmer: Albert Cheng * Apr 24, 2003 * * Modifications: @@ -522,12 +522,12 @@ done: static void * H5FD_mpiposix_fapl_copy(const void *_old_fa) { - void *ret_value = NULL; + void *ret_value = NULL; const H5FD_mpiposix_fapl_t *old_fa = (const H5FD_mpiposix_fapl_t*)_old_fa; - H5FD_mpiposix_fapl_t *new_fa = NULL; - int mpi_code; /* MPI return code */ + H5FD_mpiposix_fapl_t *new_fa = NULL; + int mpi_code; /* MPI return code */ - FUNC_ENTER_NOAPI(H5FD_mpiposix_fapl_copy, NULL) + FUNC_ENTER_NOAPI_NOINIT if (NULL==(new_fa=H5MM_malloc(sizeof(H5FD_mpiposix_fapl_t)))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") @@ -537,16 +537,16 @@ H5FD_mpiposix_fapl_copy(const void *_old_fa) /* Duplicate communicator. */ if (MPI_SUCCESS != (mpi_code=MPI_Comm_dup(old_fa->comm, &new_fa->comm))) - HMPI_GOTO_ERROR(NULL, "MPI_Comm_dup failed", mpi_code) + HMPI_GOTO_ERROR(NULL, "MPI_Comm_dup failed", mpi_code) new_fa->use_gpfs = old_fa->use_gpfs; ret_value = new_fa; done: if (NULL == ret_value){ - /* cleanup */ - if (new_fa) - H5MM_xfree(new_fa); + /* cleanup */ + if (new_fa) + H5MM_xfree(new_fa); } FUNC_LEAVE_NOAPI(ret_value) @@ -554,15 +554,15 @@ done: /*------------------------------------------------------------------------- - * Function: H5FD_mpiposix_fapl_free + * Function: H5FD_mpiposix_fapl_free * - * Purpose: Frees the mpiposix-specific file access properties. + * Purpose: Frees the mpiposix-specific file access properties. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Albert Cheng + * Programmer: Albert Cheng * Apr 24, 2003 * * Modifications: @@ -572,10 +572,10 @@ done: static herr_t H5FD_mpiposix_fapl_free(void *_fa) { - herr_t ret_value = SUCCEED; - H5FD_mpiposix_fapl_t *fa = (H5FD_mpiposix_fapl_t*)_fa; + H5FD_mpiposix_fapl_t *fa = (H5FD_mpiposix_fapl_t*)_fa; + + FUNC_ENTER_NOAPI_NOINIT_NOERR - FUNC_ENTER_NOAPI(H5FD_mpiposix_fapl_free, FAIL) assert(fa); /* Free the internal communicator */ @@ -583,8 +583,7 @@ H5FD_mpiposix_fapl_free(void *_fa) MPI_Comm_free(&fa->comm); H5MM_xfree(fa); -done: - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5FD_mpiposix_fapl_free() */ @@ -592,11 +591,11 @@ done: * Function: H5FD_mpiposix_open * * Purpose: Opens a file with name NAME. The FLAGS are a bit field with - * purpose similar to the second argument of open(2) and which - * are defined in H5Fpublic.h. The file access property list - * FAPL_ID contains the properties driver properties and MAXADDR - * is the largest address which this file will be expected to - * access. This is collective. + * purpose similar to the second argument of open(2) and which + * are defined in H5Fpublic.h. The file access property list + * FAPL_ID contains the properties driver properties and MAXADDR + * is the largest address which this file will be expected to + * access. This is collective. * * Return: Success: A new file pointer. * Failure: NULL @@ -605,27 +604,27 @@ done: * Thursday, July 11, 2002 * * Modifications: - * Albert Cheng, 2003-04-24 - * Duplicate the communicator so that file is insulated from the - * old one. + * Albert Cheng, 2003-04-24 + * Duplicate the communicator so that file is insulated from the + * old one. * *------------------------------------------------------------------------- */ static H5FD_t * H5FD_mpiposix_open(const char *name, unsigned flags, hid_t fapl_id, - haddr_t maxaddr) + haddr_t maxaddr) { - H5FD_mpiposix_t *file=NULL; /* New MPIPOSIX file struct */ + H5FD_mpiposix_t *file=NULL; /* New MPIPOSIX file struct */ int o_flags; /* Flags for file open call */ - int fd=(-1); /* File handle for file opened */ - int mpi_rank; /* MPI rank of this process */ - int mpi_size; /* Total number of MPI processes */ - int mpi_code; /* mpi return code */ - const H5FD_mpiposix_fapl_t *fa=NULL; /* MPIPOSIX file access property list information */ - H5FD_mpiposix_fapl_t _fa; /* Private copy of default file access property list information */ + int fd=(-1); /* File handle for file opened */ + int mpi_rank; /* MPI rank of this process */ + int mpi_size; /* Total number of MPI processes */ + int mpi_code; /* mpi return code */ + const H5FD_mpiposix_fapl_t *fa=NULL; /* MPIPOSIX file access property list information */ + H5FD_mpiposix_fapl_t _fa; /* Private copy of default file access property list information */ H5P_genplist_t *plist; /* Property list pointer */ h5_stat_t sb; /* Portable 'stat' struct */ -#ifdef _WIN32 +#ifdef H5_HAVE_WIN32_API HFILE filehandle; struct _BY_HANDLE_FILE_INFORMATION fileinfo; int results; @@ -633,7 +632,7 @@ H5FD_mpiposix_open(const char *name, unsigned flags, hid_t fapl_id, H5FD_t *ret_value=NULL; /* Return value */ MPI_Comm comm_dup=MPI_COMM_NULL; - FUNC_ENTER_NOAPI(H5FD_mpiposix_open, NULL) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments */ if (!name || !*name) @@ -647,18 +646,18 @@ H5FD_mpiposix_open(const char *name, unsigned flags, hid_t fapl_id, if(NULL == (plist = H5P_object_verify(fapl_id,H5P_FILE_ACCESS))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file access property list") if (H5P_FILE_ACCESS_DEFAULT==fapl_id || H5FD_MPIPOSIX!=H5P_get_driver(plist)) { - _fa.comm = MPI_COMM_SELF; /*default*/ + _fa.comm = MPI_COMM_SELF; /*default*/ _fa.use_gpfs = FALSE; - fa = &_fa; + fa = &_fa; } /* end if */ else { - fa = H5P_get_driver_info(plist); - assert(fa); + fa = H5P_get_driver_info(plist); + assert(fa); } /* end else */ /* Duplicate the communicator for use by this file. */ if (MPI_SUCCESS != (mpi_code=MPI_Comm_dup(fa->comm, &comm_dup))) - HMPI_GOTO_ERROR(NULL, "MPI_Comm_dup failed", mpi_code) + HMPI_GOTO_ERROR(NULL, "MPI_Comm_dup failed", mpi_code) /* Get the MPI rank of this process and the total number of processes */ if (MPI_SUCCESS != (mpi_code=MPI_Comm_rank (comm_dup, &mpi_rank))) @@ -759,7 +758,7 @@ H5FD_mpiposix_open(const char *name, unsigned flags, hid_t fapl_id, file->fd = fd; file->eof = sb.st_size; - /* for _WIN32 support. _WIN32 'stat' does not have st_blksize and st_blksize + /* for H5_HAVE_WIN32_API support. H5_HAVE_WIN32_API 'stat' does not have st_blksize and st_blksize is only used for the H5_HAVE_GPFS case */ #ifdef H5_HAVE_GPFS file->blksize = sb.st_blksize; @@ -778,7 +777,7 @@ H5FD_mpiposix_open(const char *name, unsigned flags, hid_t fapl_id, file->op = OP_UNKNOWN; /* Set the information for the file's device and inode */ -#ifdef _WIN32 +#ifdef H5_HAVE_WIN32_API filehandle = _get_osfhandle(fd); results = GetFileInformationByHandle((HANDLE)filehandle, &fileinfo); file->fileindexhi = fileinfo.nFileIndexHigh; @@ -801,8 +800,8 @@ done: /* Close the file if it was left open */ if(fd!=(-1)) HDclose(fd); - if (MPI_COMM_NULL != comm_dup) - MPI_Comm_free(&comm_dup); + if (MPI_COMM_NULL != comm_dup) + MPI_Comm_free(&comm_dup); } /* end if */ FUNC_LEAVE_NOAPI(ret_value) @@ -814,24 +813,24 @@ done: * * Purpose: Closes a file. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * * Programmer: Quincey Koziol * Thursday, July 11, 2002 * * Modifications: - * Albert Cheng, 2003-04-24 - * Free the communicator stored. + * Albert Cheng, 2003-04-24 + * Free the communicator stored. *------------------------------------------------------------------------- */ static herr_t H5FD_mpiposix_close(H5FD_t *_file) { - H5FD_mpiposix_t *file = (H5FD_mpiposix_t*)_file; + H5FD_mpiposix_t *file = (H5FD_mpiposix_t*)_file; herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_mpiposix_close, FAIL) + FUNC_ENTER_NOAPI_NOINIT assert(file); assert(H5FD_MPIPOSIX==file->pub.driver_id); @@ -852,16 +851,16 @@ done: /*------------------------------------------------------------------------- - * Function: H5FD_mpiposix_cmp + * Function: H5FD_mpiposix_cmp * - * Purpose: Compares two files belonging to this driver using an - * arbitrary (but consistent) ordering. + * Purpose: Compares two files belonging to this driver using an + * arbitrary (but consistent) ordering. * - * Return: Success: A value like strcmp() - * Failure: never fails (arguments were checked by the - * caller). + * Return: Success: A value like strcmp() + * Failure: never fails (arguments were checked by the + * caller). * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, July 11, 2002 * * Modifications: @@ -871,13 +870,13 @@ done: static int H5FD_mpiposix_cmp(const H5FD_t *_f1, const H5FD_t *_f2) { - const H5FD_mpiposix_t *f1 = (const H5FD_mpiposix_t*)_f1; - const H5FD_mpiposix_t *f2 = (const H5FD_mpiposix_t*)_f2; + const H5FD_mpiposix_t *f1 = (const H5FD_mpiposix_t*)_f1; + const H5FD_mpiposix_t *f2 = (const H5FD_mpiposix_t*)_f2; int ret_value=0; - FUNC_ENTER_NOAPI(H5FD_mpiposix_cmp, H5FD_VFD_DEFAULT) + FUNC_ENTER_NOAPI_NOINIT_NOERR -#ifdef _WIN32 +#ifdef H5_HAVE_WIN32_API if (f1->fileindexhi < f2->fileindexhi) HGOTO_DONE(-1) if (f1->fileindexhi > f2->fileindexhi) HGOTO_DONE(1) @@ -907,15 +906,15 @@ done: /*------------------------------------------------------------------------- - * Function: H5FD_mpiposix_query + * Function: H5FD_mpiposix_query * - * Purpose: Set the flags that this VFL driver is capable of supporting. + * Purpose: Set the flags that this VFL driver is capable of supporting. * (listed in H5FDpublic.h) * - * Return: Success: non-negative - * Failure: negative + * Return: Success: non-negative + * Failure: negative * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, July 11, 2002 * * Modifications: @@ -923,41 +922,40 @@ done: * John Mainzer -- 9/21/05 * Modified code to turn off the * H5FD_FEAT_ACCUMULATE_METADATA_WRITE flag. - * With the movement of all cache writes to process 0, - * this flag has become problematic in PHDF5. + * With the movement of all cache writes to process 0, + * this flag has become problematic in PHDF5. * *------------------------------------------------------------------------- */ static herr_t H5FD_mpiposix_query(const H5FD_t UNUSED *_file, unsigned long *flags /* out */) { - herr_t ret_value=SUCCEED; - - FUNC_ENTER_NOAPI(H5FD_mpiposix_query, FAIL) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Set the VFL feature flags that this driver supports */ if(flags) { *flags=0; - *flags|=H5FD_FEAT_AGGREGATE_METADATA; /* OK to aggregate metadata allocations */ + *flags|=H5FD_FEAT_AGGREGATE_METADATA; /* OK to aggregate metadata allocations */ *flags|=H5FD_FEAT_AGGREGATE_SMALLDATA; /* OK to aggregate "small" raw data allocations */ + *flags|=H5FD_FEAT_HAS_MPI; /* This driver uses MPI */ + *flags|=H5FD_FEAT_ALLOCATE_EARLY; /* Allocate space early instead of late */ } /* end if */ -done: - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5FD_mpiposix_query() */ /*------------------------------------------------------------------------- - * Function: H5FD_mpiposix_get_eoa + * Function: H5FD_mpiposix_get_eoa * - * Purpose: Gets the end-of-address marker for the file. The EOA marker - * is the first address past the last byte allocated in the - * format address space. + * Purpose: Gets the end-of-address marker for the file. The EOA marker + * is the first address past the last byte allocated in the + * format address space. * - * Return: Success: The end-of-address marker. - * Failure: HADDR_UNDEF + * Return: Success: The end-of-address marker. + * Failure: HADDR_UNDEF * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, July 11, 2002 * * Modifications: @@ -971,32 +969,27 @@ static haddr_t H5FD_mpiposix_get_eoa(const H5FD_t *_file, H5FD_mem_t UNUSED type) { const H5FD_mpiposix_t *file = (const H5FD_mpiposix_t*)_file; - haddr_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_mpiposix_get_eoa, HADDR_UNDEF) + FUNC_ENTER_NOAPI_NOINIT_NOERR assert(file); assert(H5FD_MPIPOSIX==file->pub.driver_id); - /* Set return value */ - ret_value=file->eoa; - -done: - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI(file->eoa) } /* end H5FD_mpiposix_get_eoa() */ /*------------------------------------------------------------------------- - * Function: H5FD_mpiposix_set_eoa + * Function: H5FD_mpiposix_set_eoa * - * Purpose: Set the end-of-address marker for the file. This function is - * called shortly after an existing HDF5 file is opened in order - * to tell the driver where the end of the HDF5 data is located. + * Purpose: Set the end-of-address marker for the file. This function is + * called shortly after an existing HDF5 file is opened in order + * to tell the driver where the end of the HDF5 data is located. * - * Return: Success: non-negative - * Failure: negative + * Return: Success: non-negative + * Failure: negative * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, July 11, 2002 * * Modifications: @@ -1009,37 +1002,35 @@ done: static herr_t H5FD_mpiposix_set_eoa(H5FD_t *_file, H5FD_mem_t UNUSED type, haddr_t addr) { - H5FD_mpiposix_t *file = (H5FD_mpiposix_t*)_file; - herr_t ret_value=SUCCEED; /* Return value */ + H5FD_mpiposix_t *file = (H5FD_mpiposix_t*)_file; - FUNC_ENTER_NOAPI(H5FD_mpiposix_set_eoa, FAIL) + FUNC_ENTER_NOAPI_NOINIT_NOERR assert(file); assert(H5FD_MPIPOSIX==file->pub.driver_id); file->eoa = addr; -done: - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5FD_mpi_posix_set_eoa() */ /*------------------------------------------------------------------------- - * Function: H5FD_mpiposix_get_eof + * Function: H5FD_mpiposix_get_eof * - * Purpose: Gets the end-of-file marker for the file. The EOF marker - * is the real size of the file. + * Purpose: Gets the end-of-file marker for the file. The EOF marker + * is the real size of the file. * - * The MPIPOSIX driver doesn't bother keeping this field updated - * since that's a relatively expensive operation. Fortunately - * the library only needs the EOF just after the file is opened - * in order to determine whether the file is empty, truncated, - * or okay. + * The MPIPOSIX driver doesn't bother keeping this field updated + * since that's a relatively expensive operation. Fortunately + * the library only needs the EOF just after the file is opened + * in order to determine whether the file is empty, truncated, + * or okay. * - * Return: Success: The end-of-address marker. - * Failure: HADDR_UNDEF + * Return: Success: The end-of-address marker. + * Failure: HADDR_UNDEF * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, July 11, 2002 * * Modifications: @@ -1049,19 +1040,14 @@ done: static haddr_t H5FD_mpiposix_get_eof(const H5FD_t *_file) { - const H5FD_mpiposix_t *file = (const H5FD_mpiposix_t*)_file; - haddr_t ret_value; /* Return value */ + const H5FD_mpiposix_t *file = (const H5FD_mpiposix_t*)_file; - FUNC_ENTER_NOAPI(H5FD_mpiposix_get_eof, HADDR_UNDEF) + FUNC_ENTER_NOAPI_NOINIT_NOERR assert(file); assert(H5FD_MPIPOSIX==file->pub.driver_id); - /* Set return value */ - ret_value=MAX(file->eof,file->eoa); - -done: - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI(MAX(file->eof,file->eoa)) } /* end H5FD_mpiposix_get_eof() */ @@ -1085,7 +1071,7 @@ H5FD_mpiposix_get_handle(H5FD_t *_file, hid_t UNUSED fapl, void** file_handle) H5FD_mpiposix_t *file = (H5FD_mpiposix_t *)_file; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI(H5FD_mpiposix_get_handle, FAIL) + FUNC_ENTER_NOAPI_NOINIT if(!file_handle) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file handle not valid") @@ -1098,21 +1084,21 @@ done: /*------------------------------------------------------------------------- - * Function: H5FD_mpiposix_read + * Function: H5FD_mpiposix_read * - * Purpose: Reads SIZE bytes of data from FILE beginning at address ADDR - * into buffer BUF according to data transfer properties in - * DXPL_ID using potentially complex file and buffer types to - * effect the transfer. + * Purpose: Reads SIZE bytes of data from FILE beginning at address ADDR + * into buffer BUF according to data transfer properties in + * DXPL_ID using potentially complex file and buffer types to + * effect the transfer. * - * Reading past the end of the file returns zeros instead of - * failing. + * Reading past the end of the file returns zeros instead of + * failing. * - * Return: Success: Non-negative. Result is stored in caller-supplied - * buffer BUF. - * Failure: Negative, Contents of buffer BUF are undefined. + * Return: Success: Non-negative. Result is stored in caller-supplied + * buffer BUF. + * Failure: Negative, Contents of buffer BUF are undefined. * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, July 11, 2002 * * Modifications: @@ -1121,13 +1107,13 @@ done: */ static herr_t H5FD_mpiposix_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, haddr_t addr, size_t size, - void *buf/*out*/) + void *buf/*out*/) { - H5FD_mpiposix_t *file = (H5FD_mpiposix_t*)_file; - ssize_t nbytes; /* Number of bytes read each I/O call */ - herr_t ret_value=SUCCEED; + H5FD_mpiposix_t *file = (H5FD_mpiposix_t*)_file; + ssize_t nbytes; /* Number of bytes read each I/O call */ + herr_t ret_value=SUCCEED; - FUNC_ENTER_NOAPI(H5FD_mpiposix_read, FAIL) + FUNC_ENTER_NOAPI_NOINIT assert(file); assert(H5FD_MPIPOSIX==file->pub.driver_id); @@ -1200,17 +1186,17 @@ done: /*------------------------------------------------------------------------- - * Function: H5FD_mpiposix_write + * Function: H5FD_mpiposix_write * - * Purpose: Writes SIZE bytes of data to FILE beginning at address ADDR - * from buffer BUF according to data transfer properties in - * DXPL_ID using potentially complex file and buffer types to - * effect the transfer. + * Purpose: Writes SIZE bytes of data to FILE beginning at address ADDR + * from buffer BUF according to data transfer properties in + * DXPL_ID using potentially complex file and buffer types to + * effect the transfer. * - * Return: Success: non-negative - * Failure: negative + * Return: Success: non-negative + * Failure: negative * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, July 11, 2002 * * Modifications: @@ -1225,17 +1211,17 @@ done: */ static herr_t H5FD_mpiposix_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, - size_t size, const void *buf) + size_t size, const void *buf) { - H5FD_mpiposix_t *file = (H5FD_mpiposix_t*)_file; + H5FD_mpiposix_t *file = (H5FD_mpiposix_t*)_file; #if 0 /* JRM */ - int mpi_code; /* MPI return code */ + int mpi_code; /* MPI return code */ #endif /* JRM */ - ssize_t nbytes; /* Number of bytes written each I/O call */ + ssize_t nbytes; /* Number of bytes written each I/O call */ H5P_genplist_t *plist; /* Property list pointer */ - herr_t ret_value=SUCCEED; /* Return value */ + herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_mpiposix_write, FAIL) + FUNC_ENTER_NOAPI_NOINIT assert(file); assert(H5FD_MPIPOSIX==file->pub.driver_id); @@ -1262,10 +1248,10 @@ H5FD_mpiposix_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, * writes between processes, but we should really just flag an error * whenever any process other than process 0 attempts to write * metadata. - * -- JRM 9/1/05 + * -- JRM 9/1/05 */ if(type!=H5FD_MEM_DRAW) { - unsigned block_before_meta_write=0; /* Whether to block before a metadata write */ + unsigned block_before_meta_write=0; /* Whether to block before a metadata write */ /* Check if we need to syncronize all processes before attempting metadata write * (Prevents race condition where the process writing the metadata goes ahead @@ -1363,11 +1349,11 @@ done: } /* end if */ #if 0 /* JRM */ /* Since metadata writes are now done by process 0 only, this broadcast - * is no longer needed. I leave it in and commented out to remind us - * that we need to re-work this function to reflect this reallity. - * - * -- JRM 9/1/05 - */ + * is no longer needed. I leave it in and commented out to remind us + * that we need to re-work this function to reflect this reallity. + * + * -- JRM 9/1/05 + */ /* Guard against getting into metadata broadcast in failure cases */ else { @@ -1386,11 +1372,11 @@ done: /*------------------------------------------------------------------------- * Function: H5FD_mpiposix_truncate * - * Purpose: Makes sure that the true file size is the same (or larger) - * than the end-of-address. + * Purpose: Makes sure that the true file size is the same (or larger) + * than the end-of-address. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * * Programmer: Quincey Koziol * Thursday, July 11, 2002 @@ -1400,15 +1386,15 @@ done: static herr_t H5FD_mpiposix_truncate(H5FD_t *_file, hid_t UNUSED dxpl_id, hbool_t UNUSED closing) { - H5FD_mpiposix_t *file = (H5FD_mpiposix_t*)_file; -#ifdef _WIN32 + H5FD_mpiposix_t *file = (H5FD_mpiposix_t*)_file; +#ifdef H5_HAVE_WIN32_API HFILE filehandle; /* Windows file handle */ LARGE_INTEGER li; /* 64-bit integer for SetFilePointer() call */ -#endif /* _WIN32 */ - int mpi_code; /* MPI return code */ +#endif /* H5_HAVE_WIN32_API */ + int mpi_code; /* MPI return code */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI(H5FD_mpiposix_truncate, FAIL) + FUNC_ENTER_NOAPI_NOINIT HDassert(file); HDassert(H5FD_MPIPOSIX == file->pub.driver_id); @@ -1417,7 +1403,7 @@ H5FD_mpiposix_truncate(H5FD_t *_file, hid_t UNUSED dxpl_id, hbool_t UNUSED closi if(file->eoa > file->last_eoa) { /* Use the round-robin process to truncate (extend) the file */ if(file->mpi_rank == H5_PAR_META_WRITE) { -#ifdef _WIN32 +#ifdef H5_HAVE_WIN32_API /* Map the posix file handle to a Windows file handle */ filehandle = _get_osfhandle(file->fd); @@ -1427,10 +1413,10 @@ H5FD_mpiposix_truncate(H5FD_t *_file, hid_t UNUSED dxpl_id, hbool_t UNUSED closi SetFilePointer((HANDLE)filehandle, li.LowPart, &li.HighPart, FILE_BEGIN); if(SetEndOfFile((HANDLE)filehandle) == 0) HGOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly") -#else /* _WIN32 */ +#else /* H5_HAVE_WIN32_API */ if(-1==file_truncate(file->fd, (file_offset_t)file->eoa)) HGOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly") -#endif /* _WIN32 */ +#endif /* H5_HAVE_WIN32_API */ } /* end if */ /* Don't let any proc return until all have extended the file. @@ -1457,14 +1443,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5FD_mpiposix_mpi_rank + * Function: H5FD_mpiposix_mpi_rank * - * Purpose: Returns the MPI rank for a process + * Purpose: Returns the MPI rank for a process * - * Return: Success: non-negative - * Failure: negative + * Return: Success: non-negative + * Failure: negative * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, July 11, 2002 * * Modifications: @@ -1475,30 +1461,25 @@ static int H5FD_mpiposix_mpi_rank(const H5FD_t *_file) { const H5FD_mpiposix_t *file = (const H5FD_mpiposix_t*)_file; - int ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_mpiposix_mpi_rank, FAIL) + FUNC_ENTER_NOAPI_NOINIT_NOERR assert(file); assert(H5FD_MPIPOSIX==file->pub.driver_id); - /* Set return value */ - ret_value=file->mpi_rank; - -done: - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI(file->mpi_rank) } /* end H5FD_mpiposix_mpi_rank() */ /*------------------------------------------------------------------------- - * Function: H5FD_mpiposix_mpi_size + * Function: H5FD_mpiposix_mpi_size * - * Purpose: Returns the number of MPI processes + * Purpose: Returns the number of MPI processes * - * Return: Success: non-negative - * Failure: negative + * Return: Success: non-negative + * Failure: negative * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, July 11, 2002 * * Modifications: @@ -1509,31 +1490,26 @@ static int H5FD_mpiposix_mpi_size(const H5FD_t *_file) { const H5FD_mpiposix_t *file = (const H5FD_mpiposix_t*)_file; - int ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_mpiposix_mpi_size, FAIL) + FUNC_ENTER_NOAPI_NOINIT_NOERR assert(file); assert(H5FD_MPIPOSIX==file->pub.driver_id); - /* Set return value */ - ret_value=file->mpi_size; - -done: - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI(file->mpi_size) } /* end H5FD_mpiposix_mpi_size() */ /*------------------------------------------------------------------------- - * Function: H5FD_mpiposix_communicator + * Function: H5FD_mpiposix_communicator * - * Purpose: Returns the MPI communicator for the file. + * Purpose: Returns the MPI communicator for the file. * - * Return: Success: The communicator + * Return: Success: The communicator * - * Failure: NULL + * Failure: NULL * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, July 11, 2002 * * Modifications: @@ -1544,18 +1520,13 @@ static MPI_Comm H5FD_mpiposix_communicator(const H5FD_t *_file) { const H5FD_mpiposix_t *file = (const H5FD_mpiposix_t*)_file; - MPI_Comm ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_mpiposix_communicator, MPI_COMM_NULL) + FUNC_ENTER_NOAPI_NOINIT_NOERR assert(file); assert(H5FD_MPIPOSIX==file->pub.driver_id); - /* Set return value */ - ret_value=file->comm; - -done: - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI(file->comm) } /* end H5FD_mpi_posix_communicator() */ #endif /*H5_HAVE_PARALLEL*/ diff --git a/src/H5FDmpiposix.h b/src/H5FDmpiposix.h index 832839e..af13fad 100644 --- a/src/H5FDmpiposix.h +++ b/src/H5FDmpiposix.h @@ -42,7 +42,6 @@ extern "C" { #endif H5_DLL hid_t H5FD_mpiposix_init(void); -H5_DLL void H5FD_mpiposix_term(void); H5_DLL herr_t H5Pset_fapl_mpiposix(hid_t fapl_id, MPI_Comm comm, hbool_t use_gpfs); H5_DLL herr_t H5Pget_fapl_mpiposix(hid_t fapl_id, MPI_Comm *comm/*out*/, hbool_t *use_gpfs/*out*/); diff --git a/src/H5FDmulti.c b/src/H5FDmulti.c index 328b530..5751596 100644 --- a/src/H5FDmulti.c +++ b/src/H5FDmulti.c @@ -97,9 +97,11 @@ typedef struct H5FD_multi_t { H5FD_multi_fapl_t fa; /*driver-specific file access properties*/ haddr_t memb_next[H5FD_MEM_NTYPES];/*addr of next member */ H5FD_t *memb[H5FD_MEM_NTYPES]; /*member pointers */ - /*haddr_t eoa;*/ /*end of allocated addresses. Took it out - *because individual files have their own - *eoa. */ + haddr_t memb_eoa[H5FD_MEM_NTYPES]; /*EOA for individual files, + *end of allocated addresses. v1.6 library + *have the EOA for the entire file. But it's + *meaningless for MULTI file. We replaced it + *with the EOAs for individual files */ unsigned flags; /*file open flags saved for debugging */ char *name; /*name passed to H5Fopen or H5Fcreate */ } H5FD_multi_t; @@ -115,6 +117,7 @@ static int compute_next(H5FD_multi_t *file); static int open_members(H5FD_multi_t *file); /* Callback prototypes */ +static herr_t H5FD_multi_term(void); static hsize_t H5FD_multi_sb_size(H5FD_t *file); static herr_t H5FD_multi_sb_encode(H5FD_t *file, char *name/*out*/, unsigned char *buf/*out*/); @@ -150,6 +153,7 @@ static const H5FD_class_t H5FD_multi_g = { "multi", /*name */ HADDR_MAX, /*maxaddr */ H5F_CLOSE_WEAK, /* fc_degree */ + H5FD_multi_term, /*terminate */ H5FD_multi_sb_size, /*sb_size */ H5FD_multi_sb_encode, /*sb_encode */ H5FD_multi_sb_decode, /*sb_decode */ @@ -247,21 +251,20 @@ H5FD_multi_init(void) * * Purpose: Shut down the VFD * - * Return: + * Returns: Non-negative on success or negative on failure * * Programmer: Quincey Koziol * Friday, Jan 30, 2004 * - * Modification: - * *--------------------------------------------------------------------------- */ -void +static herr_t H5FD_multi_term(void) { /* Reset VFL ID */ H5FD_MULTI_g=0; + return 0; } /* end H5FD_multi_term() */ @@ -969,6 +972,9 @@ H5FD_multi_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf) if (file->memb[mt]) if(H5FDset_eoa(file->memb[mt], mt, memb_eoa[mt])<0) H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_CANTSET, "set_eoa() failed", -1) + + /* Save the individual EOAs in one place for later comparison (in H5FD_multi_set_eoa) */ + file->memb_eoa[mt] = memb_eoa[mt]; } END_MEMBERS; return 0; @@ -1221,7 +1227,9 @@ H5FD_multi_open(const char *name, unsigned flags, hid_t fapl_id, /* * Initialize the file from the file access properties, using default - * values if necessary. + * values if necessary. Make sure to use CALLOC here because the code + * in H5FD_multi_set_eoa depends on the proper initialization of memb_eoa + * in H5FD_multi_t. */ if(NULL == (file = (H5FD_multi_t *)calloc((size_t)1, sizeof(H5FD_multi_t)))) H5Epush_ret(func, H5E_ERR_CLS, H5E_RESOURCE, H5E_NOSPACE, "memory allocation failed", NULL) @@ -1563,6 +1571,10 @@ H5FD_multi_get_eoa(const H5FD_t *_file, H5FD_mem_t type) * for MULTI file. This function only sets eoa for individual * file. * + * Raymond Lu + * 21 June 2011 + * Backward compatibility of EOA. Please the comment in the + * code. *------------------------------------------------------------------------- */ static herr_t @@ -1580,6 +1592,17 @@ H5FD_multi_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t eoa) if(H5FD_MEM_DEFAULT == mmt) mmt = type; + /* Handle backward compatibility in a quick and simple way. v1.6 library had EOA for the entire virtual + * file. But it wasn't meaningful. So v1.8 library doesn't have it anymore. It saves the EOA for the + * metadata file, instead. Here we try to figure out whether the EOA is from a v1.6 file by comparing its + * value. If it is a big value, we assume it's from v1.6 and simply discard it. This is the normal case + * when the metadata file has the smallest starting address. If the metadata file has the biggest address, + * the EOAs of v1.6 and v1.8 files are the same. It won't cause any trouble. (Please see Issue 2598 + * in Jira) SLU - 2011/6/21 + */ + if(H5FD_MEM_SUPER == type && file->memb_eoa[H5FD_MEM_SUPER] > 0 && eoa > file->memb_eoa[H5FD_MEM_SUPER]) + return 0; + assert(eoa >= file->fa.memb_addr[mmt]); assert(eoa < file->memb_next[mmt]); diff --git a/src/H5FDmulti.h b/src/H5FDmulti.h index c7e54ce..da16b0c 100644 --- a/src/H5FDmulti.h +++ b/src/H5FDmulti.h @@ -22,17 +22,12 @@ #ifndef H5FDmulti_H #define H5FDmulti_H -#include "H5Ipublic.h" -#include "H5Ppublic.h" /* Property lists */ -#include "H5Fpublic.h" - #define H5FD_MULTI (H5FD_multi_init()) #ifdef __cplusplus extern "C" { #endif H5_DLL hid_t H5FD_multi_init(void); -H5_DLL void H5FD_multi_term(void); H5_DLL herr_t H5Pset_fapl_multi(hid_t fapl_id, const H5FD_mem_t *memb_map, const hid_t *memb_fapl, const char * const *memb_name, const haddr_t *memb_addr, hbool_t relax); @@ -50,3 +45,4 @@ H5_DLL herr_t H5Pset_fapl_split(hid_t fapl, const char *meta_ext, #endif #endif + diff --git a/src/H5FDpublic.h b/src/H5FDpublic.h index c8ec658..f495e2d 100644 --- a/src/H5FDpublic.h +++ b/src/H5FDpublic.h @@ -209,8 +209,19 @@ typedef enum H5F_mem_t H5FD_mem_t; * the handle for the VFD (returned with the 'get_handle' callback) is * of type 'int' and is compatible with POSIX I/O calls. */ -#define H5FD_FEAT_POSIX_COMPAT_HANDLE 0x00000080 - +#define H5FD_FEAT_POSIX_COMPAT_HANDLE 0x00000080 + /* + * Defining the H5FD_FEAT_HAS_MPI for a VFL driver means that + * the driver makes use of MPI communication and code may retrieve + * communicator/rank information from it + */ +#define H5FD_FEAT_HAS_MPI 0x00000100 + /* + * Defining the H5FD_FEAT_ALLOCATE_EARLY for a VFL driver means that + * the library will use the H5D_ALLOC_TIME_EARLY on dataset create + * instead of the default H5D_ALLOC_TIME_LATE + */ +#define H5FD_FEAT_ALLOCATE_EARLY 0x00000200 /* Forward declaration */ typedef struct H5FD_t H5FD_t; @@ -220,6 +231,7 @@ typedef struct H5FD_class_t { const char *name; haddr_t maxaddr; H5F_close_degree_t fc_degree; + herr_t (*terminate)(void); hsize_t (*sb_size)(H5FD_t *file); herr_t (*sb_encode)(H5FD_t *file, char *name/*out*/, unsigned char *p/*out*/); diff --git a/src/H5FDsec2.c b/src/H5FDsec2.c index 94f1fc3..d1e62f9 100644 --- a/src/H5FDsec2.c +++ b/src/H5FDsec2.c @@ -42,11 +42,25 @@ /* The driver identification number, initialized at runtime */ static hid_t H5FD_SEC2_g = 0; -/* - * The description of a file belonging to this driver. The `eoa' and `eof' +/* Since Windows doesn't follow the rest of the world when it comes + * to POSIX I/O types, some typedefs and constants are needed to avoid + * making the code messy with #ifdefs. + */ +#ifdef H5_HAVE_WIN32_API +typedef unsigned int h5_sec2_io_t; +typedef int h5_sec2_io_ret_t; +static int H5_SEC2_MAX_IO_BYTES_g = INT_MAX; +#else +/* Unix, everyone else */ +typedef size_t h5_sec2_io_t; +typedef ssize_t h5_sec2_io_ret_t; +static size_t H5_SEC2_MAX_IO_BYTES_g = SSIZET_MAX; +#endif /* H5_HAVE_WIN32_API */ + +/* The description of a file belonging to this driver. The `eoa' and `eof' * determine the amount of hdf5 address space in use and the high-water mark - * of the file (the current size of the underlying Unix file). The `pos' - * value is used to eliminate file position updates when they would be a + * of the file (the current size of the underlying filesystem file). The + * `pos' value is used to eliminate file position updates when they would be a * no-op. Unfortunately we've found systems that use separate file position * indicators for reading and writing so the lseek can only be eliminated if * the current operation is the same as the previous operation. When opening @@ -55,57 +69,62 @@ static hid_t H5FD_SEC2_g = 0; * occurs), and `op' will be set to H5F_OP_UNKNOWN. */ typedef struct H5FD_sec2_t { - H5FD_t pub; /*public stuff, must be first */ - int fd; /*the unix file */ - haddr_t eoa; /*end of allocated region */ - haddr_t eof; /*end of file; current file size*/ - haddr_t pos; /*current file I/O position */ - H5FD_file_op_t op; /*last operation */ - char filename[H5FD_MAX_FILENAME_LEN]; /* Copy of file name from open operation */ -#ifndef _WIN32 - /* - * On most systems the combination of device and i-node number uniquely - * identify a file. + H5FD_t pub; /* public stuff, must be first */ + int fd; /* the filesystem file descriptor */ + haddr_t eoa; /* end of allocated region */ + haddr_t eof; /* end of file; current file size */ + haddr_t pos; /* current file I/O position */ + H5FD_file_op_t op; /* last operation */ + char filename[H5FD_MAX_FILENAME_LEN]; /* Copy of file name from open operation */ +#ifndef H5_HAVE_WIN32_API + /* On most systems the combination of device and i-node number uniquely + * identify a file. Note that Cygwin, MinGW and other Windows POSIX + * environments have the stat function (which fakes inodes) + * and will use the 'device + inodes' scheme as opposed to the + * Windows code further below. */ - dev_t device; /*file device number */ + dev_t device; /* file device number */ #ifdef H5_VMS - ino_t inode[3]; /*file i-node number */ + ino_t inode[3]; /* file i-node number */ #else - ino_t inode; /*file i-node number */ -#endif /*H5_VMS*/ + ino_t inode; /* file i-node number */ +#endif /* H5_VMS */ #else - /* - * On _WIN32 the low-order word of a unique identifier associated with the - * file and the volume serial number uniquely identify a file. This number - * (which, both? -rpm) may change when the system is restarted or when the - * file is opened. After a process opens a file, the identifier is - * constant until the file is closed. An application can use this - * identifier and the volume serial number to determine whether two - * handles refer to the same file. + /* Files in windows are uniquely identified by the volume serial + * number and the file index (both low and high parts). + * + * There are caveats where these numbers can change, especially + * on FAT file systems. On NTFS, however, a file should keep + * those numbers the same until renamed or deleted (though you + * can use ReplaceFile() on NTFS to keep the numbers the same + * while renaming). + * + * See the MSDN "BY_HANDLE_FILE_INFORMATION Structure" entry for + * more information. + * + * http://msdn.microsoft.com/en-us/library/aa363788(v=VS.85).aspx */ - DWORD fileindexlo; - DWORD fileindexhi; -#endif - - /* Information from file open flags, for SWMR access */ - hbool_t swmr_read; /* Whether the file is open for SWMR read access */ + DWORD nFileIndexLow; + DWORD nFileIndexHigh; + DWORD dwVolumeSerialNumber; + + HANDLE hFile; /* Native windows file handle */ +#endif /* H5_HAVE_WIN32_API */ + + /* Information from properties set by 'h5repart' tool + * + * Whether to eliminate the family driver info and convert this file to + * a single file. + */ + hbool_t fam_to_sec2; - /* Information from properties set by 'h5repart' tool */ - hbool_t fam_to_sec2; /* Whether to eliminate the family driver info - * and convert this file to a single file */ + /* Information from file open flags, for SWMR access: + * + * Whether the file is open for SWMR read access. + */ + hbool_t swmr_read; } H5FD_sec2_t; - -/* - * This driver supports systems that have the lseek64() function by defining - * some macros here so we don't have to have conditional compilations later - * throughout the code. - * - * HDoff_t: The datatype for file offsets, the second argument of - * the lseek() or lseek64() call. - * - */ - /* * These macros check for overflow of various quantities. These macros * assume that HDoff_t is signed and haddr_t and size_t are unsigned. @@ -130,6 +149,7 @@ typedef struct H5FD_sec2_t { (HDoff_t)((A)+(Z))<(HDoff_t)(A)) /* Prototypes */ +static herr_t H5FD_sec2_term(void); static H5FD_t *H5FD_sec2_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr); static herr_t H5FD_sec2_close(H5FD_t *_file); @@ -149,6 +169,7 @@ static const H5FD_class_t H5FD_sec2_g = { "sec2", /*name */ MAXADDR, /*maxaddr */ H5F_CLOSE_WEAK, /* fc_degree */ + H5FD_sec2_term, /*terminate */ NULL, /*sb_size */ NULL, /*sb_encode */ NULL, /*sb_decode */ @@ -199,7 +220,7 @@ DESCRIPTION static herr_t H5FD_sec2_init_interface(void) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FD_sec2_init_interface) + FUNC_ENTER_NOAPI_NOINIT_NOERR FUNC_LEAVE_NOAPI(H5FD_sec2_init()) } /* H5FD_sec2_init_interface() */ @@ -224,7 +245,7 @@ H5FD_sec2_init(void) { hid_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_sec2_init, FAIL) + FUNC_ENTER_NOAPI(FAIL) if(H5I_VFL != H5I_get_type(H5FD_SEC2_g)) H5FD_SEC2_g = H5FD_register(&H5FD_sec2_g, sizeof(H5FD_class_t), FALSE); @@ -242,22 +263,22 @@ done: * * Purpose: Shut down the VFD * - * Return: + * Returns: Non-negative on success or negative on failure * * Programmer: Quincey Koziol * Friday, Jan 30, 2004 * *--------------------------------------------------------------------------- */ -void +static herr_t H5FD_sec2_term(void) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FD_sec2_term) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Reset VFL ID */ H5FD_SEC2_g = 0; - FUNC_LEAVE_NOAPI_VOID + FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5FD_sec2_term() */ @@ -281,7 +302,7 @@ H5Pset_fapl_sec2(hid_t fapl_id) H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value; - FUNC_ENTER_API(H5Pset_fapl_sec2, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", fapl_id); if(NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) @@ -297,7 +318,7 @@ done: /*------------------------------------------------------------------------- * Function: H5FD_sec2_open * - * Purpose: Create and/or opens a Unix file as an HDF5 file. + * Purpose: Create and/or opens a file as an HDF5 file. * * Return: Success: A pointer to a new file data structure. The * public fields will be initialized by the @@ -312,17 +333,16 @@ done: static H5FD_t * H5FD_sec2_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) { - H5FD_sec2_t *file = NULL; /* sec2 VFD info */ - int fd = (-1); /* File descriptor */ - int o_flags; /* Flags for open() call */ -#ifdef _WIN32 - HFILE filehandle; + H5FD_sec2_t *file = NULL; /* sec2 VFD info */ + int fd = -1; /* File descriptor */ + int o_flags; /* Flags for open() call */ +#ifdef H5_HAVE_WIN32_API struct _BY_HANDLE_FILE_INFORMATION fileinfo; #endif - h5_stat_t sb; - H5FD_t *ret_value; /* Return value */ + h5_stat_t sb; + H5FD_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5FD_sec2_open) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check on file offsets */ HDcompile_assert(sizeof(HDoff_t) >= sizeof(size_t)); @@ -347,9 +367,9 @@ H5FD_sec2_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) /* Open the file */ if((fd = HDopen(name, o_flags, 0666)) < 0) { int myerrno = errno; - HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to open file: name = '%s', errno = %d, error message = '%s', flags = %x, o_flags = %x", name, myerrno, HDstrerror(myerrno), flags, (unsigned)o_flags); } /* end if */ + if(HDfstat(fd, &sb) < 0) HSYS_GOTO_ERROR(H5E_FILE, H5E_BADFILE, NULL, "unable to fstat file") @@ -361,22 +381,27 @@ H5FD_sec2_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) H5_ASSIGN_OVERFLOW(file->eof, sb.st_size, h5_stat_size_t, haddr_t); file->pos = HADDR_UNDEF; file->op = OP_UNKNOWN; -#ifdef _WIN32 - filehandle = _get_osfhandle(fd); - (void)GetFileInformationByHandle((HANDLE)filehandle, &fileinfo); - file->fileindexhi = fileinfo.nFileIndexHigh; - file->fileindexlo = fileinfo.nFileIndexLow; -#else /* _WIN32 */ +#ifdef H5_HAVE_WIN32_API + file->hFile = (HANDLE)_get_osfhandle(fd); + if(INVALID_HANDLE_VALUE == file->hFile) + HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to get Windows file handle") + + if(!GetFileInformationByHandle((HANDLE)file->hFile, &fileinfo)) + HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to get Windows file information") + + file->nFileIndexHigh = fileinfo.nFileIndexHigh; + file->nFileIndexLow = fileinfo.nFileIndexLow; + file->dwVolumeSerialNumber = fileinfo.dwVolumeSerialNumber; +#else /* H5_HAVE_WIN32_API */ file->device = sb.st_dev; #ifdef H5_VMS file->inode[0] = sb.st_ino[0]; file->inode[1] = sb.st_ino[1]; file->inode[2] = sb.st_ino[2]; -#else +#else /* H5_VMS */ file->inode = sb.st_ino; -#endif /*H5_VMS*/ - -#endif /* _WIN32 */ +#endif /* H5_VMS */ +#endif /* H5_HAVE_WIN32_API */ /* Retain a copy of the name used to open the file, for possible error reporting */ HDstrncpy(file->filename, name, sizeof(file->filename)); @@ -422,7 +447,7 @@ done: /*------------------------------------------------------------------------- * Function: H5FD_sec2_close * - * Purpose: Closes a Unix file. + * Purpose: Closes an HDF5 file. * * Return: Success: 0 * Failure: -1, file not closed. @@ -438,7 +463,7 @@ H5FD_sec2_close(H5FD_t *_file) H5FD_sec2_t *file = (H5FD_sec2_t *)_file; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5FD_sec2_close) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(file); @@ -477,16 +502,18 @@ H5FD_sec2_cmp(const H5FD_t *_f1, const H5FD_t *_f2) const H5FD_sec2_t *f2 = (const H5FD_sec2_t *)_f2; int ret_value = 0; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FD_sec2_cmp) + FUNC_ENTER_NOAPI_NOINIT_NOERR -#ifdef _WIN32 - if(f1->fileindexhi < f2->fileindexhi) HGOTO_DONE(-1) - if(f1->fileindexhi > f2->fileindexhi) HGOTO_DONE(1) +#ifdef H5_HAVE_WIN32_API + if(f1->dwVolumeSerialNumber < f2->dwVolumeSerialNumber) HGOTO_DONE(-1) + if(f1->dwVolumeSerialNumber > f2->dwVolumeSerialNumber) HGOTO_DONE(1) - if(f1->fileindexlo < f2->fileindexlo) HGOTO_DONE(-1) - if(f1->fileindexlo > f2->fileindexlo) HGOTO_DONE(1) + if(f1->nFileIndexHigh < f2->nFileIndexHigh) HGOTO_DONE(-1) + if(f1->nFileIndexHigh > f2->nFileIndexHigh) HGOTO_DONE(1) -#else + if(f1->nFileIndexLow < f2->nFileIndexLow) HGOTO_DONE(-1) + if(f1->nFileIndexLow > f2->nFileIndexLow) HGOTO_DONE(1) +#else /* H5_HAVE_WIN32_API */ #ifdef H5_DEV_T_IS_SCALAR if(f1->device < f2->device) HGOTO_DONE(-1) if(f1->device > f2->device) HGOTO_DONE(1) @@ -498,16 +525,14 @@ H5FD_sec2_cmp(const H5FD_t *_f1, const H5FD_t *_f2) if(HDmemcmp(&(f1->device),&(f2->device),sizeof(dev_t)) < 0) HGOTO_DONE(-1) if(HDmemcmp(&(f1->device),&(f2->device),sizeof(dev_t)) > 0) HGOTO_DONE(1) #endif /* H5_DEV_T_IS_SCALAR */ - -#ifndef H5_VMS - if(f1->inode < f2->inode) HGOTO_DONE(-1) - if(f1->inode > f2->inode) HGOTO_DONE(1) -#else +#ifdef H5_VMS if(HDmemcmp(&(f1->inode), &(f2->inode), 3 * sizeof(ino_t)) < 0) HGOTO_DONE(-1) if(HDmemcmp(&(f1->inode), &(f2->inode), 3 * sizeof(ino_t)) > 0) HGOTO_DONE(1) -#endif /*H5_VMS*/ - -#endif +#else /* H5_VMS */ + if(f1->inode < f2->inode) HGOTO_DONE(-1) + if(f1->inode > f2->inode) HGOTO_DONE(1) +#endif /* H5_VMS */ +#endif /* H5_HAVE_WIN32_API */ done: FUNC_LEAVE_NOAPI(ret_value) @@ -533,16 +558,16 @@ H5FD_sec2_query(const H5FD_t *_file, unsigned long *flags /* out */) { const H5FD_sec2_t *file = (const H5FD_sec2_t *)_file; /* sec2 VFD info */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FD_sec2_query) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Set the VFL feature flags that this driver supports */ if(flags) { *flags = 0; - *flags |= H5FD_FEAT_AGGREGATE_METADATA; /* OK to aggregate metadata allocations */ - *flags |= H5FD_FEAT_ACCUMULATE_METADATA; /* OK to accumulate metadata for faster writes */ - *flags |= H5FD_FEAT_DATA_SIEVE; /* OK to perform data sieving for faster raw data reads & writes */ - *flags |= H5FD_FEAT_AGGREGATE_SMALLDATA; /* OK to aggregate "small" raw data allocations */ - *flags |= H5FD_FEAT_POSIX_COMPAT_HANDLE; /* VFD handle is POSIX I/O call compatible */ + *flags |= H5FD_FEAT_AGGREGATE_METADATA; /* OK to aggregate metadata allocations */ + *flags |= H5FD_FEAT_ACCUMULATE_METADATA; /* OK to accumulate metadata for faster writes */ + *flags |= H5FD_FEAT_DATA_SIEVE; /* OK to perform data sieving for faster raw data reads & writes */ + *flags |= H5FD_FEAT_AGGREGATE_SMALLDATA; /* OK to aggregate "small" raw data allocations */ + *flags |= H5FD_FEAT_POSIX_COMPAT_HANDLE; /* VFD handle is POSIX I/O call compatible */ /* Check for flags that are set by h5repart */ if(file->fam_to_sec2) @@ -568,12 +593,13 @@ H5FD_sec2_query(const H5FD_t *_file, unsigned long *flags /* out */) * *------------------------------------------------------------------------- */ +/* ARGSUSED */ static haddr_t H5FD_sec2_get_eoa(const H5FD_t *_file, H5FD_mem_t UNUSED type) { const H5FD_sec2_t *file = (const H5FD_sec2_t *)_file; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FD_sec2_get_eoa) + FUNC_ENTER_NOAPI_NOINIT_NOERR FUNC_LEAVE_NOAPI(file->eoa) } /* end H5FD_sec2_get_eoa() */ @@ -594,12 +620,13 @@ H5FD_sec2_get_eoa(const H5FD_t *_file, H5FD_mem_t UNUSED type) * *------------------------------------------------------------------------- */ +/* ARGSUSED */ static herr_t H5FD_sec2_set_eoa(H5FD_t *_file, H5FD_mem_t UNUSED type, haddr_t addr) { H5FD_sec2_t *file = (H5FD_sec2_t *)_file; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FD_sec2_set_eoa) + FUNC_ENTER_NOAPI_NOINIT_NOERR file->eoa = addr; @@ -611,11 +638,11 @@ H5FD_sec2_set_eoa(H5FD_t *_file, H5FD_mem_t UNUSED type, haddr_t addr) * Function: H5FD_sec2_get_eof * * Purpose: Returns the end-of-file marker, which is the greater of - * either the Unix end-of-file or the HDF5 end-of-address + * either the filesystem end-of-file or the HDF5 end-of-address * markers. * * Return: Success: End of file address, the first address past - * the end of the "file", either the Unix file + * the end of the "file", either the filesystem file * or the HDF5 file. * Failure: HADDR_UNDEF * @@ -629,7 +656,7 @@ H5FD_sec2_get_eof(const H5FD_t *_file) { const H5FD_sec2_t *file = (const H5FD_sec2_t *)_file; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FD_sec2_get_eof) + FUNC_ENTER_NOAPI_NOINIT_NOERR FUNC_LEAVE_NOAPI(MAX(file->eof, file->eoa)) } /* end H5FD_sec2_get_eof() */ @@ -654,7 +681,7 @@ H5FD_sec2_get_handle(H5FD_t *_file, hid_t UNUSED fapl, void **file_handle) H5FD_sec2_t *file = (H5FD_sec2_t *)_file; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT(H5FD_sec2_get_handle) + FUNC_ENTER_NOAPI_NOINIT if(!file_handle) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file handle not valid") @@ -685,13 +712,12 @@ done: /* ARGSUSED */ static herr_t H5FD_sec2_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, - haddr_t addr, size_t size, void *buf/*out*/) + haddr_t addr, size_t size, void *buf /*out*/) { - H5FD_sec2_t *file = (H5FD_sec2_t *)_file; - ssize_t nbytes; - herr_t ret_value = SUCCEED; /* Return value */ + H5FD_sec2_t *file = (H5FD_sec2_t *)_file; + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5FD_sec2_read) + FUNC_ENTER_NOAPI_NOINIT HDassert(file && file->pub.cls); HDassert(buf); @@ -708,7 +734,8 @@ H5FD_sec2_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, * SWMR write operations. */ if(!file->swmr_read && (addr + size) > file->eoa) - HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "addr overflow, addr = %llu", (unsigned long long)addr) + HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "addr overflow, addr = %llu, size=%lu, eoa=%llu", + (unsigned long long)addr, size, (unsigned long long)file->eoa) /* Seek to the correct location */ if(addr != file->pos || OP_READ != file->op) { @@ -716,33 +743,46 @@ H5FD_sec2_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position") } /* end if */ - /* - * Read data, being careful of interrupted system calls, partial results, + /* Read data, being careful of interrupted system calls, partial results, * and the end of the file. */ while(size > 0) { + + h5_sec2_io_t bytes_in = 0; /* # of bytes to read */ + h5_sec2_io_ret_t bytes_read = -1; /* # of bytes actually read */ + + /* Trying to read more bytes than the return type can handle is + * undefined behavior in POSIX. + */ + if(size > H5_SEC2_MAX_IO_BYTES_g) + bytes_in = H5_SEC2_MAX_IO_BYTES_g; + else + bytes_in = (h5_sec2_io_t)size; + do { - nbytes = HDread(file->fd, buf, size); - } while(-1 == nbytes && EINTR == errno); - if(-1 == nbytes) { /* error */ + bytes_read = HDread(file->fd, buf, bytes_in); + } while(-1 == bytes_read && EINTR == errno); + + if(-1 == bytes_read) { /* error */ int myerrno = errno; time_t mytime = HDtime(NULL); HDoff_t myoffset = HDlseek(file->fd, (HDoff_t)0, SEEK_CUR); HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "file read failed: time = %s, filename = '%s', file descriptor = %d, errno = %d, error message = '%s', buf = %p, size = %lu, offset = %llu", HDctime(&mytime), file->filename, file->fd, myerrno, HDstrerror(myerrno), buf, (unsigned long)size, (unsigned long long)myoffset); } /* end if */ - if(0 == nbytes) { + + if(0 == bytes_read) { /* end of file but not end of format address space */ HDmemset(buf, 0, size); break; } /* end if */ - HDassert(nbytes >= 0); - HDassert((size_t)nbytes <= size); - H5_CHECK_OVERFLOW(nbytes, ssize_t, size_t); - size -= (size_t)nbytes; - H5_CHECK_OVERFLOW(nbytes, ssize_t, haddr_t); - addr += (haddr_t)nbytes; - buf = (char *)buf + nbytes; + + HDassert(bytes_read >= 0); + HDassert((size_t)bytes_read <= size); + + size -= (size_t)bytes_read; + addr += (haddr_t)bytes_read; + buf = (char *)buf + bytes_read; } /* end while */ /* Update current position */ @@ -777,14 +817,13 @@ done: */ /* ARGSUSED */ static herr_t -H5FD_sec2_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, haddr_t addr, - size_t size, const void *buf) +H5FD_sec2_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, + haddr_t addr, size_t size, const void *buf) { - H5FD_sec2_t *file = (H5FD_sec2_t *)_file; - ssize_t nbytes; - herr_t ret_value = SUCCEED; /* Return value */ + H5FD_sec2_t *file = (H5FD_sec2_t *)_file; + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5FD_sec2_write) + FUNC_ENTER_NOAPI_NOINIT HDassert(file && file->pub.cls); HDassert(buf); @@ -803,28 +842,40 @@ H5FD_sec2_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, had HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position") } /* end if */ - /* - * Write the data, being careful of interrupted system calls and partial + /* Write the data, being careful of interrupted system calls and partial * results */ while(size > 0) { + + h5_sec2_io_t bytes_in = 0; /* # of bytes to write */ + h5_sec2_io_ret_t bytes_wrote = -1; /* # of bytes written */ + + /* Trying to write more bytes than the return type can handle is + * undefined behavior in POSIX. + */ + if(size > H5_SEC2_MAX_IO_BYTES_g) + bytes_in = H5_SEC2_MAX_IO_BYTES_g; + else + bytes_in = (h5_sec2_io_t)size; + do { - nbytes = HDwrite(file->fd, buf, size); - } while(-1 == nbytes && EINTR == errno); - if(-1 == nbytes) { /* error */ + bytes_wrote = HDwrite(file->fd, buf, bytes_in); + } while(-1 == bytes_wrote && EINTR == errno); + + if(-1 == bytes_wrote) { /* error */ int myerrno = errno; time_t mytime = HDtime(NULL); HDoff_t myoffset = HDlseek(file->fd, (HDoff_t)0, SEEK_CUR); HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "file write failed: time = %s, filename = '%s', file descriptor = %d, errno = %d, error message = '%s', buf = %p, size = %lu, offset = %llu", HDctime(&mytime), file->filename, file->fd, myerrno, HDstrerror(myerrno), buf, (unsigned long)size, (unsigned long long)myoffset); } /* end if */ - HDassert(nbytes > 0); - HDassert((size_t)nbytes <= size); - H5_CHECK_OVERFLOW(nbytes, ssize_t, size_t); - size -= (size_t)nbytes; - H5_CHECK_OVERFLOW(nbytes, ssize_t, haddr_t); - addr += (haddr_t)nbytes; - buf = (const char *)buf + nbytes; + + HDassert(bytes_wrote > 0); + HDassert((size_t)bytes_wrote <= size); + + size -= (size_t)bytes_wrote; + addr += (haddr_t)bytes_wrote; + buf = (const char *)buf + bytes_wrote; } /* end while */ /* Update current position and eof */ @@ -865,36 +916,48 @@ H5FD_sec2_truncate(H5FD_t *_file, hid_t UNUSED dxpl_id, hbool_t UNUSED closing) H5FD_sec2_t *file = (H5FD_sec2_t *)_file; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5FD_sec2_truncate) + FUNC_ENTER_NOAPI_NOINIT HDassert(file); /* Extend the file to make sure it's large enough */ if(!H5F_addr_eq(file->eoa, file->eof)) { -#ifdef _WIN32 - HFILE filehandle; /* Windows file handle */ - LARGE_INTEGER li; /* 64-bit integer for SetFilePointer() call */ - - /* Map the posix file handle to a Windows file handle */ - filehandle = _get_osfhandle(file->fd); - - /* Translate 64-bit integers into form Windows wants */ - /* [This algorithm is from the Windows documentation for SetFilePointer()] */ - li.QuadPart = (LONGLONG)file->eoa; - (void)SetFilePointer((HANDLE)filehandle, li.LowPart, &li.HighPart, FILE_BEGIN); - if(SetEndOfFile((HANDLE)filehandle) == 0) +#ifdef H5_HAVE_WIN32_API + LARGE_INTEGER li; /* 64-bit (union) integer for SetFilePointer() call */ + DWORD dwPtrLow; /* Low-order pointer bits from SetFilePointer() + * Only used as an error code here. + */ + DWORD dwError; /* DWORD error code from GetLastError() */ + BOOL bError; /* Boolean error flag */ + + /* Windows uses this odd QuadPart union for 32/64-bit portability */ + li.QuadPart = (__int64)file->eoa; + + /* Extend the file to make sure it's large enough. + * + * Since INVALID_SET_FILE_POINTER can technically be a valid return value + * from SetFilePointer(), we also need to check GetLastError(). + */ + dwPtrLow = SetFilePointer(file->hFile, li.LowPart, &li.HighPart, FILE_BEGIN); + if(INVALID_SET_FILE_POINTER == dwPtrLow) { + dwError = GetLastError(); + if(dwError != NO_ERROR ) + HGOTO_ERROR(H5E_FILE, H5E_FILEOPEN, FAIL, "unable to set file pointer") + } + + bError = SetEndOfFile(file->hFile); + if(0 == bError) HGOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly") -#else /* _WIN32 */ +#else /* H5_HAVE_WIN32_API */ #ifdef H5_VMS /* Reset seek offset to the beginning of the file, so that the file isn't * re-extended later. This may happen on Open VMS. */ if(-1 == HDlseek(file->fd, (HDoff_t)0, SEEK_SET)) HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position") #endif - if(-1 == HDftruncate(file->fd, (HDoff_t)file->eoa)) HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly") -#endif /* _WIN32 */ +#endif /* H5_HAVE_WIN32_API */ /* Update the eof value */ file->eof = file->eoa; diff --git a/src/H5FDsec2.h b/src/H5FDsec2.h index b7db0d5..0c62597 100644 --- a/src/H5FDsec2.h +++ b/src/H5FDsec2.h @@ -22,8 +22,6 @@ #ifndef H5FDsec2_H #define H5FDsec2_H -#include "H5Ipublic.h" - #define H5FD_SEC2 (H5FD_sec2_init()) #ifdef __cplusplus @@ -31,7 +29,6 @@ extern "C" { #endif H5_DLL hid_t H5FD_sec2_init(void); -H5_DLL void H5FD_sec2_term(void); H5_DLL herr_t H5Pset_fapl_sec2(hid_t fapl_id); #ifdef __cplusplus diff --git a/src/H5FDspace.c b/src/H5FDspace.c index 9895938..deb2153 100644 --- a/src/H5FDspace.c +++ b/src/H5FDspace.c @@ -102,7 +102,7 @@ DESCRIPTION static herr_t H5FD_space_init_interface(void) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FD_space_init_interface) + FUNC_ENTER_NOAPI_NOINIT_NOERR FUNC_LEAVE_NOAPI(H5FD_init()) } /* H5FD_space_init_interface() */ @@ -131,7 +131,7 @@ H5FD_extend(H5FD_t *file, H5FD_mem_t type, hbool_t new_block, hsize_t size, hadd hsize_t extra; /* Extra space to allocate, to align request */ haddr_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5FD_extend) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(file); @@ -199,7 +199,7 @@ H5FD_alloc_real(H5FD_t *file, hid_t dxpl_id, H5FD_mem_t type, hsize_t size, hadd { haddr_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_alloc_real, HADDR_UNDEF) + FUNC_ENTER_NOAPI(HADDR_UNDEF) #ifdef H5FD_ALLOC_DEBUG HDfprintf(stderr, "%s: type = %u, size = %Hu\n", FUNC, (unsigned)type, size); #endif /* H5FD_ALLOC_DEBUG */ @@ -255,7 +255,7 @@ H5FD_alloc(H5FD_t *file, hid_t dxpl_id, H5FD_mem_t type, H5F_t *f, hsize_t size, { haddr_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_alloc, HADDR_UNDEF) + FUNC_ENTER_NOAPI(HADDR_UNDEF) /* check args */ HDassert(file); @@ -295,7 +295,7 @@ H5FD_free_real(H5FD_t *file, hid_t dxpl_id, H5FD_mem_t type, haddr_t addr, hsize { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5FD_free_real) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(file); @@ -380,7 +380,7 @@ H5FD_free(H5FD_t *file, hid_t dxpl_id, H5FD_mem_t type, H5F_t *f, haddr_t addr, { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_free, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args */ HDassert(file); @@ -426,7 +426,7 @@ H5FD_try_extend(H5FD_t *file, H5FD_mem_t type, H5F_t *f, haddr_t blk_end, haddr_t eoa; /* End of allocated space in file */ htri_t ret_value = FALSE; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_try_extend, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* check args */ HDassert(file); diff --git a/src/H5FDstdio.c b/src/H5FDstdio.c index 4eab71f..5c40d15 100644 --- a/src/H5FDstdio.c +++ b/src/H5FDstdio.c @@ -14,12 +14,12 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke - * Wednesday, October 22, 1997 + * Programmer: Robb Matzke + * Wednesday, October 22, 1997 * - * Purpose: This is the Posix stdio.h I/O subclass of H5Flow. - * It also serves as an example of coding a simple file driver, - * therefore, it should not use any non-public definitions. + * Purpose: This is the Posix stdio.h I/O subclass of H5Flow. + * It also serves as an example of coding a simple file driver, + * therefore, it should not use any non-public definitions. * * Notes: Ported to the new H5FD architecture on 10/18/99 - QAK * @@ -43,7 +43,7 @@ #include #endif -#ifdef _WIN32 +#ifdef H5_HAVE_WIN32_API #include #include @@ -58,7 +58,7 @@ #ifdef MAX #undef MAX #endif /* MAX */ -#define MAX(X,Y) ((X)>(Y)?(X):(Y)) +#define MAX(X,Y) ((X)>(Y)?(X):(Y)) /* The driver identification number, initialized at runtime */ static hid_t H5FD_STDIO_g = 0; @@ -84,23 +84,23 @@ typedef enum { * occurs), and `op' will be set to H5F_OP_UNKNOWN. */ typedef struct H5FD_stdio_t { - H5FD_t pub; /*public stuff, must be first */ - FILE * fp; /*the file handle */ - haddr_t eoa; /*end of allocated region */ - haddr_t eof; /*end of file; current file size*/ - haddr_t pos; /*current file I/O position */ - H5FD_stdio_file_op op; /*last operation */ + H5FD_t pub; /*public stuff, must be first */ + FILE * fp; /*the file handle */ + haddr_t eoa; /*end of allocated region */ + haddr_t eof; /*end of file; current file size*/ + haddr_t pos; /*current file I/O position */ + H5FD_stdio_file_op op; /*last operation */ unsigned write_access; /* Flag to indicate the file was opened with write access */ -#ifndef _WIN32 +#ifndef H5_HAVE_WIN32_API /* * On most systems the combination of device and i-node number uniquely * identify a file. */ - dev_t device; /*file device number */ - ino_t inode; /*file i-node number */ + dev_t device; /*file device number */ + ino_t inode; /*file i-node number */ #else /* - * On _WIN32 the low-order word of a unique identifier associated with the + * On H5_HAVE_WIN32_API the low-order word of a unique identifier associated with the * file and the volume serial number uniquely identify a file. This number * (which, both? -rpm) may change when the system is restarted or when the * file is opened. After a process opens a file, the identifier is @@ -117,18 +117,11 @@ typedef struct H5FD_stdio_t { } H5FD_stdio_t; /* Use similar structure as in H5private.h by defining Windows stuff first. */ -#ifdef _WIN32 - #if _MSC_VER > 1310 /* Newer than VS.NET 2003 */ - # define file_fseek _fseeki64 - # define file_offset_t __int64 - # define file_ftruncate _chsize_s /* Supported in VS 2005 or newer */ - # define file_ftell _ftelli64 - #else - # define file_fseek fseek - # define file_offset_t long - # define file_ftruncate _chsize - # define file_ftell ftell - #endif +#ifdef H5_HAVE_WIN32_API + # define file_fseek _fseeki64 + # define file_offset_t __int64 + # define file_ftruncate _chsize_s /* Supported in VS 2005 or newer */ + # define file_ftell _ftelli64 #endif /* Use file_xxx to indicate these are local macros, avoiding confusing @@ -138,15 +131,15 @@ typedef struct H5FD_stdio_t { */ #ifndef file_fseek #ifdef H5_HAVE_FSEEKO64 - # define file_fseek fseeko64 - # define file_offset_t off64_t - # define file_ftruncate ftruncate64 - # define file_ftell ftello64 + # define file_fseek fseeko64 + # define file_offset_t off64_t + # define file_ftruncate ftruncate64 + # define file_ftell ftello64 #else - # define file_fseek fseeko - # define file_offset_t off_t - # define file_ftruncate ftruncate - # define file_ftell ftello + # define file_fseek fseeko + # define file_offset_t off_t + # define file_ftruncate ftruncate + # define file_ftell ftello #endif #endif @@ -154,25 +147,26 @@ typedef struct H5FD_stdio_t { * These macros check for overflow of various quantities. These macros * assume that file_offset_t is signed and haddr_t and size_t are unsigned. * - * ADDR_OVERFLOW: Checks whether a file address of type `haddr_t' - * is too large to be represented by the second argument - * of the file seek function. + * ADDR_OVERFLOW: Checks whether a file address of type `haddr_t' + * is too large to be represented by the second argument + * of the file seek function. * - * SIZE_OVERFLOW: Checks whether a buffer size of type `hsize_t' is too - * large to be represented by the `size_t' type. + * SIZE_OVERFLOW: Checks whether a buffer size of type `hsize_t' is too + * large to be represented by the `size_t' type. * - * REGION_OVERFLOW: Checks whether an address and size pair describe data - * which can be addressed entirely by the second - * argument of the file seek function. + * REGION_OVERFLOW: Checks whether an address and size pair describe data + * which can be addressed entirely by the second + * argument of the file seek function. */ /* adding for windows NT filesystem support. */ #define MAXADDR (((haddr_t)1<<(8*sizeof(file_offset_t)-1))-1) -#define ADDR_OVERFLOW(A) (HADDR_UNDEF==(A) || ((A) & ~(haddr_t)MAXADDR)) -#define SIZE_OVERFLOW(Z) ((Z) & ~(hsize_t)MAXADDR) -#define REGION_OVERFLOW(A,Z) (ADDR_OVERFLOW(A) || SIZE_OVERFLOW(Z) || \ +#define ADDR_OVERFLOW(A) (HADDR_UNDEF==(A) || ((A) & ~(haddr_t)MAXADDR)) +#define SIZE_OVERFLOW(Z) ((Z) & ~(hsize_t)MAXADDR) +#define REGION_OVERFLOW(A,Z) (ADDR_OVERFLOW(A) || SIZE_OVERFLOW(Z) || \ HADDR_UNDEF==(A)+(Z) || (file_offset_t)((A)+(Z))<(file_offset_t)(A)) /* Prototypes */ +static herr_t H5FD_stdio_term(void); static H5FD_t *H5FD_stdio_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr); static herr_t H5FD_stdio_close(H5FD_t *lf); @@ -191,51 +185,52 @@ static herr_t H5FD_stdio_flush(H5FD_t *_file, hid_t dxpl_id, unsigned closing); static herr_t H5FD_stdio_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing); static const H5FD_class_t H5FD_stdio_g = { - "stdio", /*name */ - MAXADDR, /*maxaddr */ - H5F_CLOSE_WEAK, /* fc_degree */ - NULL, /*sb_size */ - NULL, /*sb_encode */ - NULL, /*sb_decode */ - 0, /*fapl_size */ - NULL, /*fapl_get */ - NULL, /*fapl_copy */ - NULL, /*fapl_free */ - 0, /*dxpl_size */ - NULL, /*dxpl_copy */ - NULL, /*dxpl_free */ - H5FD_stdio_open, /*open */ - H5FD_stdio_close, /*close */ - H5FD_stdio_cmp, /*cmp */ - H5FD_stdio_query, /*query */ - NULL, /*get_type_map */ - H5FD_stdio_alloc, /*alloc */ - NULL, /*free */ - H5FD_stdio_get_eoa, /*get_eoa */ - H5FD_stdio_set_eoa, /*set_eoa */ - H5FD_stdio_get_eof, /*get_eof */ + "stdio", /*name */ + MAXADDR, /*maxaddr */ + H5F_CLOSE_WEAK, /* fc_degree */ + H5FD_stdio_term, /*terminate */ + NULL, /*sb_size */ + NULL, /*sb_encode */ + NULL, /*sb_decode */ + 0, /*fapl_size */ + NULL, /*fapl_get */ + NULL, /*fapl_copy */ + NULL, /*fapl_free */ + 0, /*dxpl_size */ + NULL, /*dxpl_copy */ + NULL, /*dxpl_free */ + H5FD_stdio_open, /*open */ + H5FD_stdio_close, /*close */ + H5FD_stdio_cmp, /*cmp */ + H5FD_stdio_query, /*query */ + NULL, /*get_type_map */ + H5FD_stdio_alloc, /*alloc */ + NULL, /*free */ + H5FD_stdio_get_eoa, /*get_eoa */ + H5FD_stdio_set_eoa, /*set_eoa */ + H5FD_stdio_get_eof, /*get_eof */ H5FD_stdio_get_handle, /*get_handle */ - H5FD_stdio_read, /*read */ - H5FD_stdio_write, /*write */ - H5FD_stdio_flush, /*flush */ - H5FD_stdio_truncate, /*truncate */ + H5FD_stdio_read, /*read */ + H5FD_stdio_write, /*write */ + H5FD_stdio_flush, /*flush */ + H5FD_stdio_truncate, /*truncate */ NULL, /*lock */ NULL, /*unlock */ - H5FD_FLMAP_SINGLE /*fl_map */ + H5FD_FLMAP_SINGLE /*fl_map */ }; /*------------------------------------------------------------------------- - * Function: H5FD_stdio_init + * Function: H5FD_stdio_init * - * Purpose: Initialize this driver by registering the driver with the - * library. + * Purpose: Initialize this driver by registering the driver with the + * library. * - * Return: Success: The driver ID for the stdio driver. + * Return: Success: The driver ID for the stdio driver. * - * Failure: Negative. + * Failure: Negative. * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, July 29, 1999 * * Modifications: @@ -256,39 +251,38 @@ H5FD_stdio_init(void) /*--------------------------------------------------------------------------- - * Function: H5FD_stdio_term + * Function: H5FD_stdio_term * - * Purpose: Shut down the VFD + * Purpose: Shut down the VFD * - * Return: + * Returns: Non-negative on success or negative on failure * * Programmer: Quincey Koziol * Friday, Jan 30, 2004 * - * Modification: - * *--------------------------------------------------------------------------- */ -void +static herr_t H5FD_stdio_term(void) { /* Reset VFL ID */ H5FD_STDIO_g=0; + return 0; } /* end H5FD_stdio_term() */ /*------------------------------------------------------------------------- - * Function: H5Pset_fapl_stdio + * Function: H5Pset_fapl_stdio * - * Purpose: Modify the file access property list to use the H5FD_STDIO - * driver defined in this source file. There are no driver - * specific properties. + * Purpose: Modify the file access property list to use the H5FD_STDIO + * driver defined in this source file. There are no driver + * specific properties. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke - * Thursday, February 19, 1998 + * Programmer: Robb Matzke + * Thursday, February 19, 1998 * * Modifications: * Stolen from the sec2 driver - QAK, 10/18/99 @@ -313,27 +307,27 @@ H5Pset_fapl_stdio(hid_t fapl_id) /*------------------------------------------------------------------------- - * Function: H5FD_stdio_open + * Function: H5FD_stdio_open * - * Purpose: Create and/or opens a Standard C file as an HDF5 file. + * Purpose: Create and/or opens a Standard C file as an HDF5 file. * - * Bugs: H5F_ACC_EXCL has a race condition. (? -QAK) + * Bugs: H5F_ACC_EXCL has a race condition. (? -QAK) * * Errors: - * IO CANTOPENFILE File doesn't exist and CREAT wasn't - * specified. - * IO CANTOPENFILE Fopen failed. - * IO FILEEXISTS File exists but CREAT and EXCL were - * specified. + * IO CANTOPENFILE File doesn't exist and CREAT wasn't + * specified. + * IO CANTOPENFILE Fopen failed. + * IO FILEEXISTS File exists but CREAT and EXCL were + * specified. * - * Return: Success: A pointer to a new file data structure. The - * public fields will be initialized by the - * caller, which is always H5FD_open(). + * Return: Success: A pointer to a new file data structure. The + * public fields will be initialized by the + * caller, which is always H5FD_open(). * - * Failure: NULL + * Failure: NULL * - * Programmer: Robb Matzke - * Wednesday, October 22, 1997 + * Programmer: Robb Matzke + * Wednesday, October 22, 1997 * * Modifications: * Ported to VFL/H5FD layer - QAK, 10/18/99 @@ -344,17 +338,17 @@ static H5FD_t * H5FD_stdio_open( const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) { - FILE *f = NULL; + FILE *f = NULL; unsigned write_access=0; /* File opened with write access? */ - H5FD_stdio_t *file=NULL; + H5FD_stdio_t *file=NULL; static const char *func="H5FD_stdio_open"; /* Function Name for error reporting */ -#ifdef _WIN32 - HFILE filehandle; - struct _BY_HANDLE_FILE_INFORMATION fileinfo; +#ifdef H5_HAVE_WIN32_API + HFILE filehandle; + struct _BY_HANDLE_FILE_INFORMATION fileinfo; int fd; -#else /* _WIN32 */ - struct stat sb; -#endif /* _WIN32 */ +#else /* H5_HAVE_WIN32_API */ + struct stat sb; +#endif /* H5_HAVE_WIN32_API */ /* Sanity check on file offsets */ assert(sizeof(file_offset_t)>=sizeof(size_t)); @@ -412,7 +406,7 @@ H5FD_stdio_open( const char *name, unsigned flags, hid_t fapl_id, } /* The unique key */ -#ifdef _WIN32 +#ifdef H5_HAVE_WIN32_API /*#error "Needs correct fileindexhi & fileindexlo, code below is from sec2 driver"*/ fd = _fileno(f); filehandle = _get_osfhandle(fd); @@ -434,17 +428,17 @@ H5FD_stdio_open( const char *name, unsigned flags, hid_t fapl_id, /*------------------------------------------------------------------------- - * Function: H5F_stdio_close + * Function: H5F_stdio_close * - * Purpose: Closes a file. + * Purpose: Closes a file. * * Errors: - * IO CLOSEERROR Fclose failed. + * IO CLOSEERROR Fclose failed. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke - * Wednesday, October 22, 1997 + * Programmer: Robb Matzke + * Wednesday, October 22, 1997 * * Modifications: * Ported to VFL/H5FD layer - QAK, 10/18/99 @@ -454,7 +448,7 @@ H5FD_stdio_open( const char *name, unsigned flags, hid_t fapl_id, static herr_t H5FD_stdio_close(H5FD_t *_file) { - H5FD_stdio_t *file = (H5FD_stdio_t*)_file; + H5FD_stdio_t *file = (H5FD_stdio_t*)_file; static const char *func="H5FD_stdio_close"; /* Function Name for error reporting */ /* Clear the error stack */ @@ -470,17 +464,17 @@ H5FD_stdio_close(H5FD_t *_file) /*------------------------------------------------------------------------- - * Function: H5FD_stdio_cmp + * Function: H5FD_stdio_cmp * - * Purpose: Compares two files belonging to this driver using an - * arbitrary (but consistent) ordering. + * Purpose: Compares two files belonging to this driver using an + * arbitrary (but consistent) ordering. * - * Return: Success: A value like strcmp() + * Return: Success: A value like strcmp() * - * Failure: never fails (arguments were checked by the - * caller). + * Failure: never fails (arguments were checked by the + * caller). * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, July 29, 1999 * * Modifications: @@ -491,13 +485,13 @@ H5FD_stdio_close(H5FD_t *_file) static int H5FD_stdio_cmp(const H5FD_t *_f1, const H5FD_t *_f2) { - const H5FD_stdio_t *f1 = (const H5FD_stdio_t*)_f1; - const H5FD_stdio_t *f2 = (const H5FD_stdio_t*)_f2; + const H5FD_stdio_t *f1 = (const H5FD_stdio_t*)_f1; + const H5FD_stdio_t *f2 = (const H5FD_stdio_t*)_f2; /* Clear the error stack */ H5Eclear2(H5E_DEFAULT); -#ifdef _WIN32 +#ifdef H5_HAVE_WIN32_API if (f1->fileindexhi < f2->fileindexhi) return -1; if (f1->fileindexhi > f2->fileindexhi) return 1; @@ -525,16 +519,16 @@ H5FD_stdio_cmp(const H5FD_t *_f1, const H5FD_t *_f2) /*------------------------------------------------------------------------- - * Function: H5FD_stdio_query + * Function: H5FD_stdio_query * - * Purpose: Set the flags that this VFL driver is capable of supporting. + * Purpose: Set the flags that this VFL driver is capable of supporting. * (listed in H5FDpublic.h) * - * Return: Success: non-negative + * Return: Success: non-negative * - * Failure: negative + * Failure: negative * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, August 25, 2000 * * Modifications: @@ -561,18 +555,18 @@ H5FD_stdio_query(const H5FD_t *_f, unsigned long *flags /* out */) /*------------------------------------------------------------------------- - * Function: H5FD_stdio_alloc + * Function: H5FD_stdio_alloc * - * Purpose: Allocates file memory. If fseeko isn't available, makes + * Purpose: Allocates file memory. If fseeko isn't available, makes * sure the file size isn't bigger than 2GB because the * parameter OFFSET of fseek is of the type LONG INT, limiting * the file size to 2GB. * - * Return: Success: Address of new memory + * Return: Success: Address of new memory * - * Failure: HADDR_UNDEF + * Failure: HADDR_UNDEF * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * 30 March 2007 * * Modifications: @@ -582,8 +576,8 @@ H5FD_stdio_query(const H5FD_t *_f, unsigned long *flags /* out */) static haddr_t H5FD_stdio_alloc(H5FD_t *_file, H5FD_mem_t /*UNUSED*/ type, hid_t /*UNUSED*/ dxpl_id, hsize_t size) { - H5FD_stdio_t *file = (H5FD_stdio_t*)_file; - haddr_t addr; + H5FD_stdio_t *file = (H5FD_stdio_t*)_file; + haddr_t addr; haddr_t ret_value; /* Return value */ /* Shut compiler up */ @@ -613,17 +607,17 @@ H5FD_stdio_alloc(H5FD_t *_file, H5FD_mem_t /*UNUSED*/ type, hid_t /*UNUSED*/ dxp /*------------------------------------------------------------------------- - * Function: H5FD_stdio_get_eoa + * Function: H5FD_stdio_get_eoa * - * Purpose: Gets the end-of-address marker for the file. The EOA marker - * is the first address past the last byte allocated in the - * format address space. + * Purpose: Gets the end-of-address marker for the file. The EOA marker + * is the first address past the last byte allocated in the + * format address space. * - * Return: Success: The end-of-address marker. + * Return: Success: The end-of-address marker. * - * Failure: HADDR_UNDEF + * Failure: HADDR_UNDEF * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Monday, August 2, 1999 * * Modifications: @@ -638,7 +632,7 @@ H5FD_stdio_alloc(H5FD_t *_file, H5FD_mem_t /*UNUSED*/ type, hid_t /*UNUSED*/ dxp static haddr_t H5FD_stdio_get_eoa(const H5FD_t *_file, H5FD_mem_t /*unused*/ type) { - const H5FD_stdio_t *file = (const H5FD_stdio_t *)_file; + const H5FD_stdio_t *file = (const H5FD_stdio_t *)_file; /* Clear the error stack */ H5Eclear2(H5E_DEFAULT); @@ -651,17 +645,17 @@ H5FD_stdio_get_eoa(const H5FD_t *_file, H5FD_mem_t /*unused*/ type) /*------------------------------------------------------------------------- - * Function: H5FD_stdio_set_eoa + * Function: H5FD_stdio_set_eoa * - * Purpose: Set the end-of-address marker for the file. This function is - * called shortly after an existing HDF5 file is opened in order - * to tell the driver where the end of the HDF5 data is located. + * Purpose: Set the end-of-address marker for the file. This function is + * called shortly after an existing HDF5 file is opened in order + * to tell the driver where the end of the HDF5 data is located. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, July 29, 1999 * * Modifications: @@ -675,7 +669,7 @@ H5FD_stdio_get_eoa(const H5FD_t *_file, H5FD_mem_t /*unused*/ type) static herr_t H5FD_stdio_set_eoa(H5FD_t *_file, H5FD_mem_t /*unused*/ type, haddr_t addr) { - H5FD_stdio_t *file = (H5FD_stdio_t*)_file; + H5FD_stdio_t *file = (H5FD_stdio_t*)_file; /* Clear the error stack */ H5Eclear2(H5E_DEFAULT); @@ -690,19 +684,19 @@ H5FD_stdio_set_eoa(H5FD_t *_file, H5FD_mem_t /*unused*/ type, haddr_t addr) /*------------------------------------------------------------------------- - * Function: H5FD_stdio_get_eof + * Function: H5FD_stdio_get_eof * - * Purpose: Returns the end-of-file marker, which is the greater of - * either the Unix end-of-file or the HDF5 end-of-address - * markers. + * Purpose: Returns the end-of-file marker, which is the greater of + * either the Unix end-of-file or the HDF5 end-of-address + * markers. * - * Return: Success: End of file address, the first address past - * the end of the "file", either the Unix file - * or the HDF5 file. + * Return: Success: End of file address, the first address past + * the end of the "file", either the Unix file + * or the HDF5 file. * - * Failure: HADDR_UNDEF + * Failure: HADDR_UNDEF * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, July 29, 1999 * * Modifications: @@ -713,7 +707,7 @@ H5FD_stdio_set_eoa(H5FD_t *_file, H5FD_mem_t /*unused*/ type, haddr_t addr) static haddr_t H5FD_stdio_get_eof(const H5FD_t *_file) { - const H5FD_stdio_t *file = (const H5FD_stdio_t *)_file; + const H5FD_stdio_t *file = (const H5FD_stdio_t *)_file; /* Clear the error stack */ H5Eclear2(H5E_DEFAULT); @@ -756,24 +750,24 @@ H5FD_stdio_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle) /*------------------------------------------------------------------------- - * Function: H5F_stdio_read + * Function: H5F_stdio_read * - * Purpose: Reads SIZE bytes beginning at address ADDR in file LF and - * places them in buffer BUF. Reading past the logical or - * physical end of file returns zeros instead of failing. + * Purpose: Reads SIZE bytes beginning at address ADDR in file LF and + * places them in buffer BUF. Reading past the logical or + * physical end of file returns zeros instead of failing. * * Errors: - * IO READERROR Fread failed. - * IO SEEKERROR Fseek failed. + * IO READERROR Fread failed. + * IO SEEKERROR Fseek failed. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke - * Wednesday, October 22, 1997 + * Programmer: Robb Matzke + * Wednesday, October 22, 1997 * * Modifications: - * June 2, 1998 Albert Cheng - * Added xfer_mode argument + * June 2, 1998 Albert Cheng + * Added xfer_mode argument * * Ported to VFL/H5FD layer - QAK, 10/18/99 * @@ -783,8 +777,8 @@ static herr_t H5FD_stdio_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size, void *buf/*out*/) { - size_t n; - H5FD_stdio_t *file = (H5FD_stdio_t*)_file; + size_t n; + H5FD_stdio_t *file = (H5FD_stdio_t*)_file; static const char *func="H5FD_stdio_read"; /* Function Name for error reporting */ /* Shut compiler up */ @@ -862,23 +856,23 @@ H5FD_stdio_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, siz /*------------------------------------------------------------------------- - * Function: H5F_stdio_write + * Function: H5F_stdio_write * - * Purpose: Writes SIZE bytes from the beginning of BUF into file LF at - * file address ADDR. + * Purpose: Writes SIZE bytes from the beginning of BUF into file LF at + * file address ADDR. * * Errors: - * IO SEEKERROR Fseek failed. - * IO WRITEERROR Fwrite failed. + * IO SEEKERROR Fseek failed. + * IO WRITEERROR Fwrite failed. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke - * Wednesday, October 22, 1997 + * Programmer: Robb Matzke + * Wednesday, October 22, 1997 * * Modifications: - * June 2, 1998 Albert Cheng - * Added xfer_mode argument + * June 2, 1998 Albert Cheng + * Added xfer_mode argument * * Ported to VFL/H5FD layer - QAK, 10/18/99 * @@ -886,9 +880,9 @@ H5FD_stdio_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, siz */ static herr_t H5FD_stdio_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, - size_t size, const void *buf) + size_t size, const void *buf) { - H5FD_stdio_t *file = (H5FD_stdio_t*)_file; + H5FD_stdio_t *file = (H5FD_stdio_t*)_file; static const char *func="H5FD_stdio_write"; /* Function Name for error reporting */ /* Shut compiler up */ @@ -945,25 +939,25 @@ H5FD_stdio_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, /*------------------------------------------------------------------------- - * Function: H5F_stdio_flush + * Function: H5F_stdio_flush * - * Purpose: Makes sure that all data is on disk. + * Purpose: Makes sure that all data is on disk. * * Errors: - * IO SEEKERROR fseek failed. - * IO WRITEERROR fflush or fwrite failed. + * IO SEEKERROR fseek failed. + * IO WRITEERROR fflush or fwrite failed. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke - * Wednesday, October 22, 1997 + * Programmer: Robb Matzke + * Wednesday, October 22, 1997 * *------------------------------------------------------------------------- */ static herr_t H5FD_stdio_flush(H5FD_t *_file, hid_t dxpl_id, unsigned closing) { - H5FD_stdio_t *file = (H5FD_stdio_t*)_file; + H5FD_stdio_t *file = (H5FD_stdio_t*)_file; static const char *func = "H5FD_stdio_flush"; /* Function Name for error reporting */ /* Shut compiler up */ @@ -990,29 +984,29 @@ H5FD_stdio_flush(H5FD_t *_file, hid_t dxpl_id, unsigned closing) /*------------------------------------------------------------------------- - * Function: H5F_stdio_truncate + * Function: H5F_stdio_truncate * - * Purpose: Makes sure that the true file size is the same (or larger) - * than the end-of-address. + * Purpose: Makes sure that the true file size is the same (or larger) + * than the end-of-address. * * Errors: - * IO SEEKERROR fseek failed. - * IO WRITEERROR fflush or fwrite failed. + * IO SEEKERROR fseek failed. + * IO WRITEERROR fflush or fwrite failed. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * Thursday, January 31, 2008 + * Programmer: Quincey Koziol + * Thursday, January 31, 2008 * * Modifications: - * Vailin Choi; June 2010 - * Fix for window failures manifested from tests in mf.c. + * Vailin Choi; June 2010 + * Fix for window failures manifested from tests in mf.c. *------------------------------------------------------------------------- */ static herr_t H5FD_stdio_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing) { - H5FD_stdio_t *file = (H5FD_stdio_t*)_file; + H5FD_stdio_t *file = (H5FD_stdio_t*)_file; static const char *func = "H5FD_stdio_truncate"; /* Function Name for error reporting */ /* Shut compiler up */ @@ -1028,11 +1022,11 @@ H5FD_stdio_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing) if(file->eoa != file->eof) { int fd = fileno(file->fp); /* File descriptor for HDF5 file */ -#ifdef _WIN32 +#ifdef H5_HAVE_WIN32_API HFILE filehandle; /* Windows file handle */ LARGE_INTEGER li; /* 64-bit integer for SetFilePointer() call */ - /* Reset seek offset to beginning of file, so that file isn't re-extended later */ + /* Reset seek offset to beginning of file, so that file isn't re-extended later */ rewind(file->fp); /* Map the posix file handle to a Windows file handle */ @@ -1044,14 +1038,14 @@ H5FD_stdio_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing) (void)SetFilePointer((HANDLE)filehandle, li.LowPart, &li.HighPart, FILE_BEGIN); if(SetEndOfFile((HANDLE)filehandle) == 0) H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_SEEKERROR, "unable to truncate/extend file properly", -1) -#else /* _WIN32 */ +#else /* H5_HAVE_WIN32_API */ /* Reset seek offset to beginning of file, so that file isn't re-extended later */ rewind(file->fp); /* Truncate file to proper length */ if(-1 == file_ftruncate(fd, (file_offset_t)file->eoa)) H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_SEEKERROR, "unable to truncate/extend file properly", -1) -#endif /* _WIN32 */ +#endif /* H5_HAVE_WIN32_API */ /* Update the eof value */ file->eof = file->eoa; diff --git a/src/H5FDstdio.h b/src/H5FDstdio.h index 80443d8..8281705 100644 --- a/src/H5FDstdio.h +++ b/src/H5FDstdio.h @@ -31,7 +31,6 @@ extern "C" { #endif H5_DLL hid_t H5FD_stdio_init(void); -H5_DLL void H5FD_stdio_term(void); H5_DLL herr_t H5Pset_fapl_stdio(hid_t fapl_id); #ifdef __cplusplus diff --git a/src/H5FDwindows.c b/src/H5FDwindows.c index efdd0ba..8dd7555 100644 --- a/src/H5FDwindows.c +++ b/src/H5FDwindows.c @@ -13,271 +13,37 @@ * access to either file, you may request a copy from help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* - * Programmer: Scott Wegner - * Based on code by Robb Matzke - * May 24, 2007 - * - * Purpose: We would like to create a driver specifically for Windows - * to utilize the Win32 API, and reduce the maintenence demands - * for the other file drivers. Our other motivation is that - * the Windows system calls of the existing sec2 driver differ - * from those on other platforms, and are not 64-bit compatible. - * From the start, this will have the structure very similar - * to our sec2 driver, but make system calls more similar to - * our stdio driver. - */ - -/* Interface initialization */ -#define H5_INTERFACE_INIT_FUNC H5FD_windows_init_interface - - -#include "H5private.h" /* Generic Functions */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5Fprivate.h" /* File access */ -#include "H5FDprivate.h" /* File drivers */ -#include "H5FDwindows.h" /* Windows file driver */ -#include "H5FLprivate.h" /* Free Lists */ -#include "H5Iprivate.h" /* IDs */ -#include "H5MMprivate.h" /* Memory management */ -#include "H5Pprivate.h" /* Property lists */ +#include "H5private.h" /* Generic Functions */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5Fprivate.h" /* File access */ +#include "H5FDprivate.h" /* File drivers */ +#include "H5FDwindows.h" /* Windows file driver */ +#include "H5FDsec2.h" /* Windows file driver */ +#include "H5FLprivate.h" /* Free Lists */ +#include "H5Iprivate.h" /* IDs */ +#include "H5MMprivate.h" /* Memory management */ +#include "H5Pprivate.h" /* Property lists */ #ifdef H5_HAVE_WINDOWS -/* The driver identification number, initialized at runtime */ -static hid_t H5FD_WINDOWS_g = 0; - -/* File operations */ -#define OP_UNKNOWN 0 -#define OP_READ 1 -#define OP_WRITE 2 - -/* - * The description of a file belonging to this driver. The `eoa' and `eof' - * determine the amount of hdf5 address space in use and the high-water mark - * of the file (the current size of the underlying file). The `pos' - * value is used to eliminate file position updates when they would be a - * no-op. Unfortunately we've found systems that use separate file position - * indicators for reading and writing so the lseek can only be eliminated if - * the current operation is the same as the previous operation. When opening - * a file the `eof' will be set to the current file size, `eoa' will be set - * to zero, `pos' will be set to H5F_ADDR_UNDEF (as it is when an error - * occurs), and `op' will be set to H5F_OP_UNKNOWN. - */ -typedef struct H5FD_windows_t { - H5FD_t pub; /*public stuff, must be first */ - /* - * .NET doesn't support our 64-bit safe stdio functions, - * so we will use io.h functions instead. - */ -#ifndef WINDOWS_USE_STDIO - int fd; /*the file descriptor */ -#else - FILE *fp; /*the file handle */ -#endif /*MSC_VER */ - haddr_t eoa; /*end of allocated region */ - haddr_t eof; /*end of file; current file size*/ - haddr_t pos; /*current file I/O position */ - int op; /*last operation */ - unsigned write_access; /*flag to indicate the file was opened with write access */ - /* - * On _WIN32 the low-order word of a unique identifier associated with the - * file and the volume serial number uniquely identify a file. This number - * may change when the system is restarted or when the - * file is opened. After a process opens a file, the identifier is - * constant until the file is closed. An application can use this - * identifier and the volume serial number to determine whether two - * handles refer to the same file. - */ - DWORD fileindexlo; - DWORD fileindexhi; - DWORD volumeserialnumber; - - /* Information from file open flags, for SWMR access */ - hbool_t swmr_read; /* Whether the file is open for SWMR read access */ - - /* Information from properties set by 'h5repart' tool */ - hbool_t fam_to_sec2; /* Whether to eliminate the family driver info - * and convert this file to a single file */ -} H5FD_windows_t; - - -/* These are used by the macros below */ -#define file_offset_t __int64 -#define fseek_offset_t __int64 - -/* - * These macros check for overflow of various quantities. These macros - * assume that fseek_offset_t is signed and haddr_t and size_t are unsigned. - * - * ADDR_OVERFLOW: Checks whether a file address of type `haddr_t' - * is too large to be represented by the second argument - * of the file seek function. - * - * SIZE_OVERFLOW: Checks whether a buffer size of type `hsize_t' is too - * large to be represented by the `size_t' type. - * - * REGION_OVERFLOW: Checks whether an address and size pair describe data - * which can be addressed entirely by the second - * argument of the file seek function. - */ -#define MAXADDR (((haddr_t)1<<(8*sizeof(file_offset_t)-1))-1) -#define ADDR_OVERFLOW(A) (HADDR_UNDEF==(A) || \ - ((A) & ~(haddr_t)MAXADDR)) -#define SIZE_OVERFLOW(Z) ((Z) & ~(hsize_t)MAXADDR) -#define REGION_OVERFLOW(A,Z) (ADDR_OVERFLOW(A) || SIZE_OVERFLOW(Z) || \ - HADDR_UNDEF==(A)+(Z) || \ - (fseek_offset_t)((A)+(Z))<(fseek_offset_t)(A)) - -/* Prototypes */ -static H5FD_t *H5FD_windows_open(const char *name, unsigned flags, hid_t fapl_id, - haddr_t maxaddr); -static herr_t H5FD_windows_close(H5FD_t *_file); -static int H5FD_windows_cmp(const H5FD_t *_f1, const H5FD_t *_f2); -static herr_t H5FD_windows_query(const H5FD_t *_f1, unsigned long *flags); -static haddr_t H5FD_windows_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, - hsize_t size); -static haddr_t H5FD_windows_get_eoa(const H5FD_t *_file, H5FD_mem_t type); -static herr_t H5FD_windows_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr); -static haddr_t H5FD_windows_get_eof(const H5FD_t *_file); -static herr_t H5FD_windows_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle); -static herr_t H5FD_windows_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, - size_t size, void *buf); -static herr_t H5FD_windows_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, - size_t size, const void *buf); -static herr_t H5FD_windows_flush(H5FD_t *_file, hid_t dxpl_id, unsigned closing); -static herr_t H5FD_windows_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing); - -static const H5FD_class_t H5FD_windows_g = { - "windows", /*name */ - MAXADDR, /*maxaddr */ - H5F_CLOSE_WEAK, /* fc_degree */ - NULL, /*sb_size */ - NULL, /*sb_encode */ - NULL, /*sb_decode */ - 0, /*fapl_size */ - NULL, /*fapl_get */ - NULL, /*fapl_copy */ - NULL, /*fapl_free */ - 0, /*dxpl_size */ - NULL, /*dxpl_copy */ - NULL, /*dxpl_free */ - H5FD_windows_open, /*open */ - H5FD_windows_close, /*close */ - H5FD_windows_cmp, /*cmp */ - H5FD_windows_query, /*query */ - NULL, /*get_type_map */ - NULL, /*alloc */ - NULL, /*free */ - H5FD_windows_get_eoa, /*get_eoa */ - H5FD_windows_set_eoa, /*set_eoa */ - H5FD_windows_get_eof, /*get_eof */ - H5FD_windows_get_handle, /*get_handle */ - H5FD_windows_read, /*read */ - H5FD_windows_write, /*write */ - H5FD_windows_flush, /*flush */ - H5FD_windows_truncate, /*truncate */ - NULL, /*lock */ - NULL, /*unlock */ - H5FD_FLMAP_SINGLE /*fl_map */ -}; - -/* Declare a free list to manage the H5FD_windows_t struct */ -H5FL_DEFINE_STATIC(H5FD_windows_t); - -/*-------------------------------------------------------------------------- -NAME - H5FD_windows_init_interface -- Initialize interface-specific information -USAGE - herr_t H5FD_windows_init_interface() - -RETURNS - Non-negative on success/Negative on failure -DESCRIPTION - Initializes any interface-specific data or routines. (Just calls - H5FD_windows_init currently). - ---------------------------------------------------------------------------*/ -static herr_t -H5FD_windows_init_interface(void) -{ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FD_windows_init_interface) - - FUNC_LEAVE_NOAPI(H5FD_windows_init()) -} /* H5FD_windows_init_interface() */ - + /*------------------------------------------------------------------------- - * Function: H5FD_windows_init - * - * Purpose: Initialize this driver by registering the driver with the - * library. + * Function: H5Pset_fapl_windows * - * Return: Success: The driver ID for the windows driver. - * Failure: Negative. + * Purpose: Modify the file access property list to use the H5FD_WINDOWS + * driver defined in this source file. There are no driver + * specific properties. * - * Programmer: Scott Wegner - * Based on code by Robb Matzke - * Thursday, May 24, 2007 + * NOTE: The Windows VFD was merely a merge of the SEC2 and STDIO drivers + * so it has been retired. Selecting the Windows VFD will actually + * set the SEC2 VFD (though for backwards compatibility, we'll keep + * the H5FD_WINDOWS symbol). * - *------------------------------------------------------------------------- - */ -hid_t -H5FD_windows_init(void) -{ - hid_t ret_value; /* Return value */ - - FUNC_ENTER_NOAPI(H5FD_windows_init, FAIL) - - if(H5I_VFL != H5I_get_type(H5FD_WINDOWS_g)) - H5FD_WINDOWS_g = H5FD_register(&H5FD_windows_g, sizeof(H5FD_class_t), FALSE); - - /* Set return value */ - ret_value = H5FD_WINDOWS_g; - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_windows_init() */ - -/*--------------------------------------------------------------------------- - * Function: H5FD_windows_term * - * Purpose: Shut down the VFD + * Return: Non-negative on success/Negative on failure * - * Return: - * - * Programmer: Scott Wegner - * Based on code by Quincey Koziol - * Thursday, May 24 2007 - * - * Modification: - * - *--------------------------------------------------------------------------- - */ -void -H5FD_windows_term(void) -{ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FD_windows_term) - - /* Reset VFL ID */ - H5FD_WINDOWS_g=0; - - FUNC_LEAVE_NOAPI_VOID -} /* end H5FD_windows_term() */ - -/*------------------------------------------------------------------------- - * Function: H5Pset_fapl_windows - * - * Purpose: Modify the file access property list to use the H5FD_WINDOWS - * driver defined in this source file. There are no driver - * specific properties. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Scott Wegner - * Based on code by Robb Matzke - * Thursday, May 24 2007 - * - * Modifications: + * Programmer: Dana Robinson + * October 10, 2011 * *------------------------------------------------------------------------- */ @@ -287,810 +53,17 @@ H5Pset_fapl_windows(hid_t fapl_id) H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value; - FUNC_ENTER_API(H5Pset_fapl_windows, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", fapl_id); - if(NULL == (plist = H5P_object_verify(fapl_id,H5P_FILE_ACCESS))) + if(NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list") - ret_value= H5P_set_driver(plist, H5FD_WINDOWS, NULL); + ret_value = H5P_set_driver(plist, H5FD_WINDOWS, NULL); done: FUNC_LEAVE_API(ret_value) -} - -/*------------------------------------------------------------------------- - * Function: H5FD_windows_open - * - * Purpose: Create and/or opens a Windows file as an HDF5 file. - * - * Return: Success: A pointer to a new file data structure. The - * public fields will be initialized by the - * caller, which is always H5FD_open(). - * - * Failure: NULL - * - * Programmer: Scott Wegner - * Based on code by Robb Matzke - * Thursday, May 24 2007 - * - * Modifications: - * - *------------------------------------------------------------------------- - */ -/* ARGSUSED */ -static H5FD_t * -H5FD_windows_open(const char *name, unsigned flags, hid_t UNUSED fapl_id, - haddr_t maxaddr) -{ - int fd = -1; - FILE *f = NULL; - H5FD_windows_t *file = NULL; - HANDLE filehandle; - struct _BY_HANDLE_FILE_INFORMATION fileinfo; - H5FD_t *ret_value; - struct _stati64 sb; -#ifndef WINDOWS_USE_STDIO - int o_flags; -#else - unsigned write_access = 0; -#endif /* WINDOWS_USE_STDIO */ - - FUNC_ENTER_NOAPI(H5FD_windows_open, NULL) - - /* Sanity check on file offsets */ - assert(sizeof(file_offset_t)>=sizeof(size_t)); - - /* Check arguments */ - if (!name || !*name) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "invalid file name") - if (0==maxaddr || HADDR_UNDEF==maxaddr) - HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, NULL, "bogus maxaddr") - if (ADDR_OVERFLOW(maxaddr)) - HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, NULL, "bogus maxaddr") - -#ifndef WINDOWS_USE_STDIO - /* Build the open flags */ - o_flags = (H5F_ACC_RDWR & flags) ? O_RDWR : O_RDONLY; - if (H5F_ACC_TRUNC & flags) o_flags |= O_TRUNC; - if (H5F_ACC_CREAT & flags) o_flags |= O_CREAT; - if (H5F_ACC_EXCL & flags) o_flags |= O_EXCL; - /* Windows needs O_BINARY to correctly handle eol characters */ - o_flags |= O_BINARY; - - /* Open the file */ - if ((fd=_open(name, o_flags, 0666))<0) - HSYS_GOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to open file") - if (_fstati64(fd, &sb) == -1) - HSYS_GOTO_ERROR(H5E_FILE, H5E_BADFILE, NULL, "unable to fstat file") - -#else /* WINDOWS_USE_STDIO */ - /* Translate our flags into a mode, and open the file */ - if (_access_s(name, F_OK)) { - if ((flags & H5F_ACC_CREAT) && (flags & H5F_ACC_RDWR)) { - f = fopen(name, "wb+"); - write_access=1; /* Note the write access */ - } - else - HSYS_GOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "file doesn't exist and CREAT wasn't specified") - } else if ((flags & H5F_ACC_CREAT) && (flags & H5F_ACC_EXCL)) { - HSYS_GOTO_ERROR(H5E_FILE, H5E_FILEEXISTS, NULL, "file exists but CREAT and EXCL were specified") - } else if (flags & H5F_ACC_RDWR) { - if (flags & H5F_ACC_TRUNC) - f = fopen(name, "wb+"); - else - f = fopen(name, "rb+"); - write_access=1; /* Note the write access */ - } else - f = fopen(name, "rb"); - - if (!f) - HSYS_GOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "fsopen failed") - - if (_stati64(name, &sb) == -1) - HSYS_GOTO_ERROR(H5E_FILE, H5E_BADFILE, NULL, "unable to stat file") -#endif /* WINDOWS_USE_STDIO */ - - /* Create the new file struct */ - if (NULL==(file=H5FL_CALLOC(H5FD_windows_t))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "unable to allocate file struct") - - H5_ASSIGN_OVERFLOW(file->eof,sb.st_size,h5_stat_size_t,haddr_t); - file->pos = HADDR_UNDEF; - file->op = OP_UNKNOWN; - -#ifndef WINDOWS_USE_STDIO - file->fd = fd; -#else - file->fp = f; - if((fd = _fileno(f)) == -1) - HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to get file descriptor for file") - file->write_access=write_access; /* Note the write_access for later */ -#endif /* WINDOWS_USE_STDIO */ - - if( (filehandle = (HANDLE)_get_osfhandle(fd)) == INVALID_HANDLE_VALUE) - HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to get file handle for file") - if(!GetFileInformationByHandle(filehandle, &fileinfo)) - HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to get file information") - file->fileindexhi = fileinfo.nFileIndexHigh; - file->fileindexlo = fileinfo.nFileIndexLow; - file->volumeserialnumber = fileinfo.dwVolumeSerialNumber; - - /* Check for SWMR reader access */ - if(flags & H5F_ACC_SWMR_READ) - file->swmr_read = TRUE; - - /* Check for non-default FAPL */ - if(H5P_FILE_ACCESS_DEFAULT != fapl_id) { - H5P_genplist_t *plist; /* Property list pointer */ - - /* Get the FAPL */ - if(NULL == (plist = (H5P_genplist_t *)H5I_object(fapl_id))) - HGOTO_ERROR(H5E_VFL, H5E_BADTYPE, NULL, "not a file access property list") - - /* This step is for h5repart tool only. If user wants to change file driver from - * family to sec2 while using h5repart, this private property should be set so that - * in the later step, the library can ignore the family driver information saved - * in the superblock. - */ - if(H5P_exist_plist(plist, H5F_ACS_FAMILY_TO_SEC2_NAME) > 0) - if(H5P_get(plist, H5F_ACS_FAMILY_TO_SEC2_NAME, &file->fam_to_sec2) < 0) - HGOTO_ERROR(H5E_VFL, H5E_CANTGET, NULL, "can't get property of changing family to sec2") - } /* end if */ - - /* Set return value */ - ret_value=(H5FD_t*)file; - -done: - if(ret_value==NULL) { -#ifndef WINDOWS_USE_STDIO - if(fd>=0) - _close(fd); -#else - if(f) - fclose(file->fp); -#endif /* WINDOWS_USE_STDIO */ - } /* end if */ - - FUNC_LEAVE_NOAPI(ret_value) -} - -/*------------------------------------------------------------------------- - * Function: H5FD_windows_close - * - * Purpose: Closes a Windows file. - * - * Return: Success: 0 - * - * Failure: -1, file not closed. - * - * Programmer: Scott Wegner - * Based on code by Robb Matzke - * Thursday, May 24 2007 - * - * Modifications: - * - *------------------------------------------------------------------------- - */ -static herr_t -H5FD_windows_close(H5FD_t *_file) -{ - H5FD_windows_t *file = (H5FD_windows_t*)_file; - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5FD_windows_close, FAIL) - -#ifndef WINDOWS_USE_STDIO - if (_close(file->fd)<0) -#else - if (fclose(file->fp)<0) -#endif /* WINDOWS_USE_STDIO */ - HSYS_GOTO_ERROR(H5E_IO, H5E_CANTCLOSEFILE, FAIL, "unable to close file") - - H5FL_FREE(H5FD_windows_t,file); - -done: - FUNC_LEAVE_NOAPI(ret_value) -} - -/*------------------------------------------------------------------------- - * Function: H5FD_windows_cmp - * - * Purpose: Compares two files belonging to this driver using an - * arbitrary (but consistent) ordering. - * - * Return: Success: A value like strcmp() - * - * Failure: never fails (arguments were checked by the - * caller). - * - * Programmer: Scott Wegner - * Based on code by Robb Matzke - * Thursday, May 24 2007 - * - * Modifications: - * - *------------------------------------------------------------------------- - */ -static int -H5FD_windows_cmp(const H5FD_t *_f1, const H5FD_t *_f2) -{ - const H5FD_windows_t *f1 = (const H5FD_windows_t*)_f1; - const H5FD_windows_t *f2 = (const H5FD_windows_t*)_f2; - int ret_value=0; - - FUNC_ENTER_NOAPI(H5FD_windows_cmp, H5FD_VFD_DEFAULT) - - if (f1->volumeserialnumber < f2->volumeserialnumber) HGOTO_DONE(-1) - if (f1->volumeserialnumber > f2->volumeserialnumber) HGOTO_DONE(1) - - if (f1->fileindexhi < f2->fileindexhi) HGOTO_DONE(-1) - if (f1->fileindexhi > f2->fileindexhi) HGOTO_DONE(1) - - if (f1->fileindexlo < f2->fileindexlo) HGOTO_DONE(-1) - if (f1->fileindexlo > f2->fileindexlo) HGOTO_DONE(1) - - -done: - FUNC_LEAVE_NOAPI(ret_value) -} - -/*------------------------------------------------------------------------- - * Function: H5FD_windows_query - * - * Purpose: Set the flags that this VFL driver is capable of supporting. - * (listed in H5FDpublic.h) - * - * Return: Success: non-negative - * - * Failure: negative - * - * Programmer: Scott Wegner - Based on code by Quincey Koziol - * Thursday, May 24 2007 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5FD_windows_query(const H5FD_t *_file, unsigned long *flags /* out */) -{ - const H5FD_windows_t *file = (const H5FD_windows_t*)_file; /* windows VFD info */ - - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FD_windows_query) - - /* Set the VFL feature flags that this driver supports */ - if(flags) { - *flags = 0; - *flags|=H5FD_FEAT_AGGREGATE_METADATA; /* OK to aggregate metadata allocations */ - *flags|=H5FD_FEAT_ACCUMULATE_METADATA; /* OK to accumulate metadata for faster writes */ - *flags|=H5FD_FEAT_DATA_SIEVE; /* OK to perform data sieving for faster raw data reads & writes */ - *flags|=H5FD_FEAT_AGGREGATE_SMALLDATA; /* OK to aggregate "small" raw data allocations */ - - /* Check for flags that are set by h5repart */ - if(file->fam_to_sec2) - *flags |= H5FD_FEAT_IGNORE_DRVRINFO; /* Ignore the driver info when file is opened (which eliminates it) */ - } /* end if */ - -done: - FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5FD_windows_query() */ - -/*------------------------------------------------------------------------- - * Function: H5FD_windows_get_eoa - * - * Purpose: Gets the end-of-address marker for the file. The EOA marker - * is the first address past the last byte allocated in the - * format address space. - * - * Return: Success: The end-of-address marker. - * - * Failure: HADDR_UNDEF - * - * Programmer: Scott Wegner - * Based on code by Robb Matzke - * Thursday, May 24 2007 - * - * Modifications: - * - *------------------------------------------------------------------------- - */ -static haddr_t -H5FD_windows_get_eoa(const H5FD_t *_file, H5FD_mem_t UNUSED type) -{ - const H5FD_windows_t *file = (const H5FD_windows_t*)_file; - haddr_t ret_value; /* Return value */ - - FUNC_ENTER_NOAPI(H5FD_windows_get_eoa, HADDR_UNDEF) - - /* Set return value */ - ret_value=file->eoa; - -done: - FUNC_LEAVE_NOAPI(ret_value) -} - - -/*------------------------------------------------------------------------- - * Function: H5FD_windows_set_eoa - * - * Purpose: Set the end-of-address marker for the file. This function is - * called shortly after an existing HDF5 file is opened in order - * to tell the driver where the end of the HDF5 data is located. - * - * Return: Success: 0 - * - * Failure: -1 - * - * Programmer: Scott Wegner - * Based on code by Robb Matzke - * Thursday, July 29, 1999 - * - * Modifications: - * - *------------------------------------------------------------------------- - */ -static herr_t -H5FD_windows_set_eoa(H5FD_t *_file, H5FD_mem_t UNUSED type, haddr_t addr) -{ - H5FD_windows_t *file = (H5FD_windows_t*)_file; - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5FD_windows_set_eoa, FAIL) - - file->eoa = addr; - -done: - FUNC_LEAVE_NOAPI(ret_value) -} - -/*------------------------------------------------------------------------- - * Function: H5FD_windows_get_eof - * - * Purpose: Returns the end-of-file marker, which is the greater of - * either the Windows end-of-file or the HDF5 end-of-address - * markers. - * - * Return: Success: End of file address, the first address past - * the end of the "file", either the Unix file - * or the HDF5 file. - * - * Failure: HADDR_UNDEF - * - * Programmer: Scott Wegner - * Based on code by Robb Matzke - * Thursday, May 24 2007 - * - * Modifications: - * - *------------------------------------------------------------------------- - */ -static haddr_t -H5FD_windows_get_eof(const H5FD_t *_file) -{ - const H5FD_windows_t *file = (const H5FD_windows_t*)_file; - haddr_t ret_value; /* Return value */ - - FUNC_ENTER_NOAPI(H5FD_windows_get_eof, HADDR_UNDEF) - - /* Set return value */ - ret_value=MAX(file->eof, file->eoa); - -done: - FUNC_LEAVE_NOAPI(ret_value) -} - - -/*------------------------------------------------------------------------- - * Function: H5FD_windows_get_handle - * - * Purpose: Returns the file handle of windows file driver. - * - * Returns: Non-negative if succeed or negative if fails. - * - * Programmer: Scott Wegner - Based on code by Raymond Lu - * Thursday, May 24 2007 - * - * Modifications: - * - *------------------------------------------------------------------------- - */ -/* ARGSUSED */ -static herr_t -H5FD_windows_get_handle(H5FD_t *_file, hid_t UNUSED fapl, void** file_handle) -{ - H5FD_windows_t *file = (H5FD_windows_t *)_file; - herr_t ret_value = SUCCEED; - - FUNC_ENTER_NOAPI(H5FD_windows_get_handle, FAIL) - - if(!file_handle) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file handle not valid") -#ifndef WINDOWS_USE_STDIO - *file_handle = &(file->fd); -#else - *file_handle = &(file->fp); -#endif /* WINDOWS_USE_STDIO */ - if(*file_handle==NULL) - HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "get handle failed") - - -done: - FUNC_LEAVE_NOAPI(ret_value) -} - -/*------------------------------------------------------------------------- - * Function: H5FD_windows_alloc - * - * Purpose: Allocates file memory. - * - * Return: Success: Address of new memory - * - * Failure: HADDR_UNDEF - * - * Programmer: Scott Wegner - Based on code by Raymond Lu - * Thursday, May 24 2007 - * - * Modifications: - * - *------------------------------------------------------------------------- - */ -static haddr_t -H5FD_windows_alloc(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, hsize_t size) -{ - H5FD_windows_t *file = (H5FD_windows_t*)_file; - haddr_t addr; - haddr_t ret_value; /* Return value */ - - FUNC_ENTER_NOAPI(H5FD_windows_alloc, HADDR_UNDEF) - - /* Compute the address for the block to allocate */ - addr = file->eoa; - - /* Check if we need to align this block */ - if(size >= file->pub.threshold) { - /* Check for an already aligned block */ - if((addr % file->pub.alignment) != 0) - addr = ((addr / file->pub.alignment) + 1) * file->pub.alignment; - } - - - file->eoa = addr + size; - - /* Set return value */ - ret_value = addr; - -done: - FUNC_LEAVE_NOAPI(ret_value) - -} - - -/*------------------------------------------------------------------------- - * Function: H5FD_windows_read - * - * Purpose: Reads SIZE bytes of data from FILE beginning at address ADDR - * into buffer BUF according to data transfer properties in - * DXPL_ID. - * - * Return: Success: Zero. Result is stored in caller-supplied - * buffer BUF. - * - * Failure: -1, Contents of buffer BUF are undefined. - * - * Programmer: Scott Wegner - Based on code by Robb Matzke - * Thursday, May 24 2007 - * - * Modifications: - * - *------------------------------------------------------------------------- - */ -/* ARGSUSED */ -static herr_t -H5FD_windows_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, haddr_t addr, - size_t size, void *buf/*out*/) -{ - H5FD_windows_t *file = (H5FD_windows_t*)_file; - int nbytes; - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5FD_windows_read, FAIL) - - assert(file && file->pub.cls); - assert(buf); - - /* Check for overflow conditions */ - if (HADDR_UNDEF==addr) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "addr undefined") - if (REGION_OVERFLOW(addr, size)) - HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "addr overflow") - /* If the file is open for SWMR read access, allow access to data past - * the end of the allocated space (the 'eoa'). This is done because the - * eoa stored in the file's superblock might be out of sync with the - * objects being written within the file by the application performing - * SWMR write operations. - */ - if(!file->swmr_read && (addr + size) > file->eoa) - HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "addr overflow") - - /* Seek to the correct location */ - if ((addr!=file->pos || OP_READ!=file->op)) -#ifndef WINDOWS_USE_STDIO - if (_lseeki64(file->fd, addr, SEEK_SET) == -1) { -#else - if (_fseeki64(file->fp, addr, SEEK_SET) == -1) { -#endif /* WINDOWS_USE_STDIO */ - file->op = OP_UNKNOWN; - file->pos = HADDR_UNDEF; - HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position") - } - - /* - * Read data, being careful of interrupted system calls, partial results, - * and the end of the file. - */ - while (size>0) { -#ifndef WINDOWS_USE_STDIO - do { - nbytes = _read(file->fd, buf, (unsigned)(size <= WINDOWS_MAX_BUF ? size: WINDOWS_MAX_BUF)); - } while (-1==nbytes && EINTR==errno); - if (-1==nbytes) /* error */ - HSYS_GOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "file read failed") - if (0==nbytes) { - /* end of file but not end of format address space */ - HDmemset(buf, 0, size); - break; - } -#else - do { - nbytes = fread(buf,(size_t)1,(size <= WINDOWS_MAX_BUF ? size: WINDOWS_MAX_BUF),file->fp); - } while (!nbytes && EINTR==errno); - if(!nbytes) { - if (ferror(file->fp)) /* error */ - HSYS_GOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "file read failed") - if (feof(file->fp)) { - /* end of file but not end of format address space */ - HDmemset(buf, 0, size); - break; - } - } -#endif /* WINDOWS_USE_STDIO */ - assert(nbytes>=0); - assert((size_t)nbytes<=size); - H5_CHECK_OVERFLOW(nbytes,ssize_t,size_t); - size -= (size_t)nbytes; - H5_CHECK_OVERFLOW(nbytes,ssize_t,haddr_t); - addr += (haddr_t)nbytes; - buf = (char*)buf + nbytes; - } - - /* Update current position */ - file->pos = addr; - file->op = OP_READ; - -done: - if(ret_value<0) { - /* Reset last file I/O information */ - file->pos = HADDR_UNDEF; - file->op = OP_UNKNOWN; - } /* end if */ - - FUNC_LEAVE_NOAPI(ret_value) -} - - -/*------------------------------------------------------------------------- - * Function: H5FD_windows_write - * - * Purpose: Writes SIZE bytes of data to FILE beginning at address ADDR - * from buffer BUF according to data transfer properties in - * DXPL_ID. - * - * Return: Success: Zero - * - * Failure: -1 - * - * Programmer: Scott Wegner - * Based on code by Robb Matzke - * Thursday, May 24 2007 - * - * Modifications: - * - *------------------------------------------------------------------------- - */ -/* ARGSUSED */ -static herr_t -H5FD_windows_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, haddr_t addr, - size_t size, const void *buf) -{ - H5FD_windows_t *file = (H5FD_windows_t*)_file; - ssize_t nbytes; - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5FD_windows_write, FAIL) - - assert(file && file->pub.cls); - assert(buf); - - /* Check for overflow conditions */ - if (HADDR_UNDEF==addr) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "addr undefined") - if (REGION_OVERFLOW(addr, size)) - HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "addr overflow") - if (addr+size>file->eoa) - HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "addr overflow") - - /* Seek to the correct location */ - if ((addr!=file->pos || OP_WRITE!=file->op)) - { -#ifndef WINDOWS_USE_STDIO - if (_lseeki64(file->fd, addr, SEEK_SET) == -1) { -#else - if (_fseeki64(file->fp, addr, SEEK_SET) == -1) { -#endif /* WINDOWS_USE_STDIO */ - file->op = OP_UNKNOWN; - file->pos = HADDR_UNDEF; - HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position") - } - } - - /* - * Write the data, being careful of interrupted system calls and partial - * results - */ - while (size>0) { - do { -#ifndef WINDOWS_USE_STDIO - nbytes = _write(file->fd, buf, (unsigned)(size <= WINDOWS_MAX_BUF ? size: WINDOWS_MAX_BUF)); - } while (-1==nbytes && EINTR==errno); - if (-1==nbytes) /* error */ -#else - - - /* Write 1GB or less at a time */ - nbytes = fwrite(buf, 1, (size <= WINDOWS_MAX_BUF ? size: WINDOWS_MAX_BUF),file->fp); - } while (!nbytes && EINTR==errno); - if (!nbytes) /* error */ -#endif /* WINDOWS_USE_STDIO */ - HSYS_GOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "file write failed") - assert(nbytes>0); - assert((size_t)nbytes<=size); - H5_CHECK_OVERFLOW(nbytes,ssize_t,size_t); - size -= (size_t)nbytes; - H5_CHECK_OVERFLOW(nbytes,ssize_t,haddr_t); - addr += (haddr_t)nbytes; - buf = (const char*)buf + nbytes; - } - - /* Update current position and eof */ - file->pos = addr; - file->op = OP_WRITE; - if (file->pos>file->eof) - file->eof = file->pos; - -done: - if(ret_value<0) { - /* Reset last file I/O information */ - file->pos = HADDR_UNDEF; - file->op = OP_UNKNOWN; - } /* end if */ - - FUNC_LEAVE_NOAPI(ret_value) -} - - -/*------------------------------------------------------------------------- - * Function: H5FD_windows_flush - * - * Purpose: Makes sure that the true file size is the same (or larger) - * than the end-of-address. - * - * Return: Success: Non-negative - * Failure: Negative - * - * Programmer: Scott Wegner - * Based on code by Robb Matzke - * Thursday, May 24 2007 - * - *------------------------------------------------------------------------- - */ -/* ARGSUSED */ -static herr_t -H5FD_windows_flush(H5FD_t *_file, hid_t UNUSED dxpl_id, unsigned closing) -{ - H5FD_windows_t *file = (H5FD_windows_t*)_file; - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5FD_windows_flush, FAIL) - - HDassert(file); - - /* Only try to flush if we have write access */ - if(file->write_access) { - /* Flush */ - if(!closing) { -#ifdef WINDOWS_USE_STDIO - if(fflush(file->fp) == EOF) - HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "fflush failed") -#endif /* WINDOWS_USE_STDIO */ - - /* Reset last file I/O information */ - file->pos = HADDR_UNDEF; - file->op = OP_UNKNOWN; - } /* end if */ - } /* end if */ - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_windows_flush() */ - - -/*------------------------------------------------------------------------- - * Function: H5FD_windows_truncate - * - * Purpose: Makes sure that the true file size is the same (or larger) - * than the end-of-address. - * - * Return: Success: Non-negative - * Failure: Negative - * - * Programmer: Scott Wegner - * Based on code by Robb Matzke - * Thursday, May 24 2007 - * - *------------------------------------------------------------------------- - */ -/* ARGSUSED */ -static herr_t -H5FD_windows_truncate(H5FD_t *_file, hid_t UNUSED dxpl_id, hbool_t UNUSED closing) -{ - H5FD_windows_t *file = (H5FD_windows_t*)_file; -#ifndef WINDOWS_USE_STDIO - LARGE_INTEGER li; - HANDLE filehandle; -#else - int fd; -#endif /* WINDOWS_USE_STDIO */ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5FD_windows_truncate, FAIL) - - HDassert(file); - - if(file->eoa != file->eof) { -#ifndef WINDOWS_USE_STDIO - /* Extend the file to make sure it's large enough */ - if((filehandle = (HANDLE)_get_osfhandle(file->fd)) == INVALID_HANDLE_VALUE) - HGOTO_ERROR(H5E_FILE, H5E_FILEOPEN, FAIL, "unable to get file handle for file") - - li.QuadPart = (__int64)file->eoa; - (void)SetFilePointer((HANDLE)filehandle, li.LowPart, &li.HighPart, FILE_BEGIN); - if(SetEndOfFile(filehandle) == 0) - HGOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly") -#else /* WINDOWS_USE_STDIO */ - /* Only try to flush if we have write access */ - if(!file->write_access) - HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "cannot flush without write access") - - if((fd = _fileno(file->fp)) == -1) - HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "unable to get file descriptor for file") - if(_chsize_s(fd, file->eoa)) - HGOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly") -#endif /* WINDOWS_USE_STDIO */ - - /* Update the eof value */ - file->eof = file->eoa; - - /* Reset last file I/O information */ - file->pos = HADDR_UNDEF; - file->op = OP_UNKNOWN; - } /* end if */ - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_windows_truncate() */ +} /* end H5Pset_fapl_windows() */ #endif /* H5_HAVE_WINDOWS */ diff --git a/src/H5FDwindows.h b/src/H5FDwindows.h index 8277f149..7a9d2cf 100644 --- a/src/H5FDwindows.h +++ b/src/H5FDwindows.h @@ -1,42 +1,39 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * 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. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -/* - * Programmer: Scott Wegner - * Based on code by Robb Matzke - * Thursday, May 24 2007 - * - * Purpose: The public header file for the windows driver. - */ -#ifndef H5FDwindows_H -#define H5FDwindows_H - -#include "H5Ipublic.h" - -#define H5FD_WINDOWS (H5FD_windows_init()) - -#ifdef __cplusplus -extern "C" { -#endif - -H5_DLL hid_t H5FD_windows_init(void); -H5_DLL void H5FD_windows_term(void); -H5_DLL herr_t H5Pset_fapl_windows(hid_t fapl_id); - -#ifdef __cplusplus -} -#endif - -#endif +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Programmer: Scott Wegner + * Based on code by Robb Matzke + * Thursday, May 24 2007 + * + * Purpose: The public header file for the windows driver. + */ +#ifndef H5FDwindows_H +#define H5FDwindows_H + +#define H5FD_WINDOWS (H5FD_sec2_init()) + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +H5_DLL herr_t H5Pset_fapl_windows(hid_t fapl_id); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* H5FDwindows_H */ + diff --git a/src/H5FL.c b/src/H5FL.c index a41da2a..aec92ff 100644 --- a/src/H5FL.c +++ b/src/H5FL.c @@ -164,13 +164,11 @@ DESCRIPTION static herr_t H5FL_init_interface(void) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FL_init_interface) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Nothing currently... */ - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI(SUCCEED) } /* H5FL_init_interface() */ @@ -195,7 +193,7 @@ H5FL_malloc(size_t mem_size) { void *ret_value; /* return value*/ - FUNC_ENTER_NOAPI(H5FL_malloc, NULL) + FUNC_ENTER_NOAPI_NOINIT /* Attempt to allocate the memory requested */ if(NULL==(ret_value=H5MM_malloc(mem_size))) { @@ -235,7 +233,7 @@ H5FL_reg_init(H5FL_reg_head_t *head) H5FL_reg_gc_node_t *new_node; /* Pointer to the node for the new list to garbage collect */ herr_t ret_value=SUCCEED; /* return value*/ - FUNC_ENTER_NOAPI_NOINIT(H5FL_reg_init) + FUNC_ENTER_NOAPI_NOINIT /* Allocate a new garbage collection node */ if(NULL == (new_node = (H5FL_reg_gc_node_t *)H5MM_malloc(sizeof(H5FL_reg_gc_node_t)))) @@ -287,7 +285,7 @@ H5FL_reg_free(H5FL_reg_head_t *head, void *obj) /* NOINIT OK here because this must be called after H5FL_reg_malloc/calloc * -NAF */ - FUNC_ENTER_NOAPI_NOINIT(H5FL_reg_free) + FUNC_ENTER_NOAPI_NOINIT /* Double check parameters */ HDassert(head); @@ -372,7 +370,7 @@ H5FL_reg_malloc(H5FL_reg_head_t *head H5FL_TRACK_PARAMS) { void *ret_value; /* Pointer to object to return */ - FUNC_ENTER_NOAPI(H5FL_reg_malloc, NULL) + FUNC_ENTER_NOAPI(NULL) /* Double check parameters */ HDassert(head); @@ -449,7 +447,7 @@ H5FL_reg_calloc(H5FL_reg_head_t *head H5FL_TRACK_PARAMS) { void *ret_value; /* Pointer to object to return */ - FUNC_ENTER_NOAPI(H5FL_reg_calloc, NULL) + FUNC_ENTER_NOAPI(NULL) /* Double check parameters */ HDassert(head); @@ -489,7 +487,7 @@ H5FL_reg_gc_list(H5FL_reg_head_t *head) void *tmp; /* Temporary node pointer */ size_t total_mem; /* Total memory used on list */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FL_reg_gc_list) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Calculate the total memory used on this list */ total_mem=head->onlist*head->size; @@ -541,7 +539,7 @@ H5FL_reg_gc(void) H5FL_reg_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_reg_gc) + FUNC_ENTER_NOAPI_NOINIT /* Walk through all the free lists, free()'ing the nodes */ gc_node=H5FL_reg_gc_head.first; @@ -593,7 +591,7 @@ H5FL_reg_term(void) H5FL_reg_gc_node_t *left; /* pointer to garbage collection lists with work left */ H5FL_reg_gc_node_t *tmp; /* Temporary pointer to a garbage collection node */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FL_reg_term) + FUNC_ENTER_NOAPI_NOINIT_NOERR if (H5_interface_initialize_g) { /* Free the nodes on the garbage collection list, keeping nodes with allocations outstanding */ @@ -658,7 +656,7 @@ H5FL_blk_find_list(H5FL_blk_node_t **head, size_t size) { H5FL_blk_node_t *temp; /* Temp. pointer to node in the native list */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FL_blk_find_list) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Find the correct free list */ temp=*head; @@ -720,7 +718,7 @@ H5FL_blk_create_list(H5FL_blk_node_t **head, size_t size) H5FL_blk_node_t *temp; /* Temp. pointer to node in the list */ H5FL_blk_node_t *ret_value; - FUNC_ENTER_NOAPI_NOINIT(H5FL_blk_create_list) + FUNC_ENTER_NOAPI_NOINIT /* Allocate room for the new free list node */ if(NULL==(temp=H5FL_MALLOC(H5FL_blk_node_t))) @@ -771,7 +769,7 @@ H5FL_blk_init(H5FL_blk_head_t *head) H5FL_blk_gc_node_t *new_node; /* Pointer to the node for the new list to garbage collect */ herr_t ret_value=SUCCEED; /* return value*/ - FUNC_ENTER_NOAPI_NOINIT(H5FL_blk_init) + FUNC_ENTER_NOAPI_NOINIT /* Allocate a new garbage collection node */ if(NULL == (new_node = (H5FL_blk_gc_node_t *)H5MM_malloc(sizeof(H5FL_blk_gc_node_t)))) @@ -814,7 +812,7 @@ H5FL_blk_free_block_avail(H5FL_blk_head_t *head, size_t size) H5FL_blk_node_t *free_list; /* The free list of nodes of correct size */ htri_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5FL_blk_free_block_avail, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Double check parameters */ HDassert(head); @@ -855,7 +853,7 @@ H5FL_blk_malloc(H5FL_blk_head_t *head, size_t size H5FL_TRACK_PARAMS) H5FL_blk_list_t *temp; /* Temp. ptr to the new native list allocated */ void *ret_value; /* Pointer to the block to return to the user */ - FUNC_ENTER_NOAPI(H5FL_blk_malloc, NULL) + FUNC_ENTER_NOAPI(NULL) /* Double check parameters */ HDassert(head); @@ -945,7 +943,7 @@ H5FL_blk_calloc(H5FL_blk_head_t *head, size_t size H5FL_TRACK_PARAMS) { void *ret_value; /* Pointer to the block to return to the user */ - FUNC_ENTER_NOAPI(H5FL_blk_calloc, NULL) + FUNC_ENTER_NOAPI(NULL) /* Double check parameters */ HDassert(head); @@ -991,7 +989,7 @@ H5FL_blk_free(H5FL_blk_head_t *head, void *block) /* NOINIT OK here because this must be called after H5FL_blk_malloc/calloc * -NAF */ - FUNC_ENTER_NOAPI_NOINIT(H5FL_blk_free) + FUNC_ENTER_NOAPI_NOINIT /* Double check parameters */ HDassert(head); @@ -1089,7 +1087,7 @@ H5FL_blk_realloc(H5FL_blk_head_t *head, void *block, size_t new_size H5FL_TRACK_ { void *ret_value=NULL; /* Return value */ - FUNC_ENTER_NOAPI(H5FL_blk_realloc, NULL) + FUNC_ENTER_NOAPI(NULL) /* Double check parameters */ HDassert(head); @@ -1163,7 +1161,7 @@ H5FL_blk_gc_list(H5FL_blk_head_t *head) void *next; /* Temp. ptr to the free list list node */ void *temp; /* Temp. ptr to the free list page node */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FL_blk_gc_list) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Loop through all the nodes in the block free list queue */ while(head->head!=NULL) { @@ -1226,7 +1224,7 @@ H5FL_blk_gc(void) H5FL_blk_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_blk_gc) + FUNC_ENTER_NOAPI_NOINIT /* Walk through all the free lists, free()'ing the nodes */ gc_node=H5FL_blk_gc_head.first; @@ -1272,7 +1270,7 @@ H5FL_blk_term(void) H5FL_blk_gc_node_t *left; /* pointer to garbage collection lists with work left */ H5FL_blk_gc_node_t *tmp; /* Temporary pointer to a garbage collection node */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FL_blk_term) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Free the nodes on the garbage collection list, keeping nodes with allocations outstanding */ left=NULL; @@ -1331,7 +1329,7 @@ H5FL_arr_init(H5FL_arr_head_t *head) size_t u; /* Local index variable */ herr_t ret_value=SUCCEED; /* return value*/ - FUNC_ENTER_NOAPI_NOINIT(H5FL_arr_init) + FUNC_ENTER_NOAPI_NOINIT /* Allocate a new garbage collection node */ if(NULL == (new_node = (H5FL_gc_arr_node_t *)H5MM_malloc(sizeof(H5FL_gc_arr_node_t)))) @@ -1385,7 +1383,7 @@ H5FL_arr_free(H5FL_arr_head_t *head, void *obj) /* NOINIT OK here because this must be called after H5FL_arr_malloc/calloc * -NAF */ - FUNC_ENTER_NOAPI_NOINIT(H5FL_arr_free) + FUNC_ENTER_NOAPI_NOINIT /* The H5MM_xfree code allows obj to null */ if (!obj) @@ -1460,7 +1458,7 @@ H5FL_arr_malloc(H5FL_arr_head_t *head, size_t elem) void *ret_value; /* Pointer to object to return */ size_t mem_size; /* Size of memory block being recycled */ - FUNC_ENTER_NOAPI(H5FL_arr_malloc, NULL) + FUNC_ENTER_NOAPI(NULL) /* Double check parameters */ HDassert(head); @@ -1533,7 +1531,7 @@ H5FL_arr_calloc(H5FL_arr_head_t *head, size_t elem) { void *ret_value; /* Pointer to object to return */ - FUNC_ENTER_NOAPI(H5FL_arr_calloc, NULL) + FUNC_ENTER_NOAPI(NULL) /* Double check parameters */ HDassert(head); @@ -1571,7 +1569,7 @@ H5FL_arr_realloc(H5FL_arr_head_t *head, void * obj, size_t new_elem) { void *ret_value; /* Pointer to object to return */ - FUNC_ENTER_NOAPI(H5FL_arr_realloc, NULL) + FUNC_ENTER_NOAPI(NULL) /* Double check parameters */ HDassert(head); @@ -1635,7 +1633,7 @@ H5FL_arr_gc_list(H5FL_arr_head_t *head) unsigned u; /* Counter for array of free lists */ size_t total_mem; /* Total memory used on list */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FL_arr_gc_list) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Walk through the array of free lists */ for(u=0; u<(unsigned)head->maxelem; u++) { @@ -1695,7 +1693,7 @@ H5FL_arr_gc(void) H5FL_gc_arr_node_t *gc_arr_node; /* Pointer into the list of things to garbage collect */ herr_t ret_value=SUCCEED; /* return value*/ - FUNC_ENTER_NOAPI_NOINIT(H5FL_arr_gc) + FUNC_ENTER_NOAPI_NOINIT /* Walk through all the free lists, free()'ing the nodes */ gc_arr_node=H5FL_arr_gc_head.first; @@ -1741,7 +1739,7 @@ H5FL_arr_term(void) H5FL_gc_arr_node_t *left; /* pointer to garbage collection lists with work left */ H5FL_gc_arr_node_t *tmp; /* Temporary pointer to a garbage collection node */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FL_arr_term) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Free the nodes on the garbage collection list, keeping nodes with allocations outstanding */ left=NULL; @@ -1799,7 +1797,7 @@ 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) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Double check parameters */ HDassert(head); @@ -1835,7 +1833,7 @@ H5FL_seq_malloc(H5FL_seq_head_t *head, size_t elem H5FL_TRACK_PARAMS) { void *ret_value; /* Pointer to object to return */ - FUNC_ENTER_NOAPI(H5FL_seq_malloc, NULL) + FUNC_ENTER_NOAPI(NULL) /* Double check parameters */ HDassert(head); @@ -1869,7 +1867,7 @@ H5FL_seq_calloc(H5FL_seq_head_t *head, size_t elem H5FL_TRACK_PARAMS) { void *ret_value; /* Pointer to object to return */ - FUNC_ENTER_NOAPI(H5FL_seq_calloc, NULL) + FUNC_ENTER_NOAPI(NULL) /* Double check parameters */ HDassert(head); @@ -1903,7 +1901,7 @@ H5FL_seq_realloc(H5FL_seq_head_t *head, void * obj, size_t new_elem H5FL_TRACK_P { void *ret_value; /* Pointer to object to return */ - FUNC_ENTER_NOAPI(H5FL_seq_realloc, NULL) + FUNC_ENTER_NOAPI(NULL) /* Double check parameters */ HDassert(head); @@ -1942,7 +1940,7 @@ H5FL_fac_init(size_t size) H5FL_fac_head_t *factory = NULL; /* Pointer to new block factory */ H5FL_fac_head_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5FL_fac_init, NULL) + FUNC_ENTER_NOAPI(NULL) /* Sanity check */ HDassert(size > 0); @@ -2018,7 +2016,7 @@ H5FL_fac_free(H5FL_fac_head_t *head, void *obj) 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) + FUNC_ENTER_NOAPI_NOINIT /* Double check parameters */ HDassert(head); @@ -2107,7 +2105,7 @@ H5FL_fac_malloc(H5FL_fac_head_t *head H5FL_TRACK_PARAMS) void *ret_value; /* Pointer to object to return */ /* NOINIT OK here because this must be called after H5FL_fac_init -NAF */ - FUNC_ENTER_NOAPI_NOINIT(H5FL_fac_malloc) + FUNC_ENTER_NOAPI_NOINIT /* Double check parameters */ HDassert(head); @@ -2184,7 +2182,7 @@ H5FL_fac_calloc(H5FL_fac_head_t *head H5FL_TRACK_PARAMS) void *ret_value; /* Pointer to object to return */ /* NOINIT OK here because this must be called after H5FL_fac_init -NAF */ - FUNC_ENTER_NOAPI_NOINIT(H5FL_fac_calloc) + FUNC_ENTER_NOAPI_NOINIT /* Double check parameters */ HDassert(head); @@ -2223,7 +2221,7 @@ H5FL_fac_gc_list(H5FL_fac_head_t *head) void *tmp; /* Temporary node pointer */ size_t total_mem; /* Total memory used on list */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FL_fac_gc_list) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Calculate the total memory used on this list */ total_mem=head->onlist*head->size; @@ -2273,7 +2271,7 @@ 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) + FUNC_ENTER_NOAPI_NOINIT /* Walk through all the free lists, free()'ing the nodes */ gc_node=H5FL_fac_gc_head.first; @@ -2319,7 +2317,7 @@ H5FL_fac_term(H5FL_fac_head_t *factory) 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) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(factory); @@ -2379,7 +2377,7 @@ 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) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Free the nodes on the garbage collection list */ while(H5FL_fac_gc_head.first != NULL) { @@ -2425,7 +2423,7 @@ H5FL_garbage_coll(void) { herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI(H5FL_garbage_coll, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Garbage collect the free lists for array objects */ if(H5FL_arr_gc()<0) @@ -2486,7 +2484,7 @@ H5FL_set_free_list_limits(int reg_global_lim, int reg_list_lim, int arr_global_l { herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI(H5FL_set_free_list_limits, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Set the limit variables */ /* limit on all regular free lists */ @@ -2535,7 +2533,7 @@ H5FL_term_interface(void) { int ret_value=0; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FL_term_interface) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Garbage collect any nodes on the free lists */ (void)H5FL_garbage_coll(); diff --git a/src/H5FO.c b/src/H5FO.c index 8e1b98c..ace66ec 100644 --- a/src/H5FO.c +++ b/src/H5FO.c @@ -75,14 +75,14 @@ H5FO_create(const H5F_t *f) { herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FO_create,FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ assert(f); assert(f->shared); /* Create container used to store open object info */ - if((f->shared->open_objs = H5SL_create(H5SL_TYPE_HADDR)) == NULL) + if((f->shared->open_objs = H5SL_create(H5SL_TYPE_HADDR, NULL)) == NULL) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to create open object container") done: @@ -116,7 +116,7 @@ H5FO_opened(const H5F_t *f, haddr_t addr) H5FO_open_obj_t *open_obj; /* Information about open object */ void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOFUNC(H5FO_opened) + FUNC_ENTER_NOAPI_NOERR /* Sanity check */ HDassert(f); @@ -163,7 +163,7 @@ H5FO_insert(const H5F_t *f, haddr_t addr, void *obj, hbool_t delete_flag) H5FO_open_obj_t *open_obj; /* Information about open object */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FO_insert,FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ assert(f); @@ -215,7 +215,7 @@ H5FO_delete(H5F_t *f, hid_t dxpl_id, haddr_t addr) H5FO_open_obj_t *open_obj; /* Information about open object */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FO_delete,FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ HDassert(f); @@ -266,7 +266,7 @@ H5FO_mark(const H5F_t *f, haddr_t addr, hbool_t deleted) H5FO_open_obj_t *open_obj; /* Information about open object */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOFUNC(H5FO_mark) + FUNC_ENTER_NOAPI_NOERR /* Sanity check */ assert(f); @@ -310,7 +310,7 @@ H5FO_marked(const H5F_t *f, haddr_t addr) H5FO_open_obj_t *open_obj; /* Information about open object */ hbool_t ret_value = FALSE; /* Return value */ - FUNC_ENTER_NOAPI_NOFUNC(H5FO_marked) + FUNC_ENTER_NOAPI_NOERR /* Sanity check */ HDassert(f); @@ -349,7 +349,7 @@ H5FO_dest(const H5F_t *f) { herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FO_dest,FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ assert(f); @@ -394,13 +394,13 @@ H5FO_top_create(H5F_t *f) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FO_top_create, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ HDassert(f); /* Create container used to store open object info */ - if((f->obj_count = H5SL_create(H5SL_TYPE_HADDR)) == NULL) + if((f->obj_count = H5SL_create(H5SL_TYPE_HADDR, NULL)) == NULL) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to create open object container") done: @@ -433,7 +433,7 @@ H5FO_top_incr(const H5F_t *f, haddr_t addr) H5FO_obj_count_t *obj_count; /* Ref. count for object */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FO_top_incr, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ HDassert(f); @@ -488,7 +488,7 @@ H5FO_top_decr(const H5F_t *f, haddr_t addr) H5FO_obj_count_t *obj_count; /* Ref. count for object */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FO_top_decr, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ HDassert(f); @@ -542,7 +542,7 @@ H5FO_top_count(const H5F_t *f, haddr_t addr) H5FO_obj_count_t *obj_count; /* Ref. count for object */ hsize_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FO_top_count) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ HDassert(f); @@ -582,7 +582,7 @@ H5FO_top_dest(H5F_t *f) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FO_top_dest, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ HDassert(f); diff --git a/src/H5FS.c b/src/H5FS.c index aa7da4d..fc1285f 100644 --- a/src/H5FS.c +++ b/src/H5FS.c @@ -109,7 +109,7 @@ H5FS_create(H5F_t *f, hid_t dxpl_id, haddr_t *fs_addr, const H5FS_create_t *fs_c H5FS_t *fspace = NULL; /* New free space structure */ H5FS_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_TAG(H5FS_create, dxpl_id, H5AC__FREESPACE_TAG, NULL) + FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__FREESPACE_TAG, NULL) #ifdef H5FS_DEBUG HDfprintf(stderr, "%s: Creating free space manager, nclasses = %Zu\n", FUNC, nclasses); #endif /* H5FS_DEBUG */ @@ -198,7 +198,7 @@ H5FS_open(H5F_t *f, hid_t dxpl_id, haddr_t fs_addr, size_t nclasses, H5FS_hdr_cache_ud_t cache_udata; /* User-data for metadata cache callback */ H5FS_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_TAG(H5FS_open, dxpl_id, H5AC__FREESPACE_TAG, NULL) + FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__FREESPACE_TAG, NULL) #ifdef H5FS_DEBUG HDfprintf(stderr, "%s: Opening free space manager, fs_addr = %a, nclasses = %Zu\n", FUNC, fs_addr, nclasses); #endif /* H5FS_DEBUG */ @@ -267,7 +267,7 @@ H5FS_delete(H5F_t *f, hid_t dxpl_id, haddr_t fs_addr) H5FS_hdr_cache_ud_t cache_udata; /* User-data for metadata cache callback */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(H5FS_delete, dxpl_id, H5AC__FREESPACE_TAG, FAIL) + FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__FREESPACE_TAG, FAIL) #ifdef H5FS_DEBUG HDfprintf(stderr, "%s: Deleting free space manager, fs_addr = %a\n", FUNC, fs_addr); #endif /* H5FS_DEBUG */ @@ -358,7 +358,7 @@ H5FS_close(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(H5FS_close, dxpl_id, H5AC__FREESPACE_TAG, FAIL) + FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__FREESPACE_TAG, FAIL) /* Check arguments. */ HDassert(f); @@ -522,7 +522,7 @@ H5FS_new(const H5F_t *f, size_t nclasses, const H5FS_section_class_t *classes[], size_t u; /* Local index variable */ H5FS_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5FS_new) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments. */ HDassert(nclasses == 0 || (nclasses > 0 && classes)); @@ -597,7 +597,7 @@ done: herr_t H5FS_size(const H5F_t *f, const H5FS_t *fspace, hsize_t *meta_size) { - FUNC_ENTER_NOAPI_NOFUNC(H5FS_size) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* * Check arguments. @@ -631,7 +631,7 @@ H5FS_incr(H5FS_t *fspace) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FS_incr, FAIL) + FUNC_ENTER_NOAPI(FAIL) #ifdef H5FS_DEBUG HDfprintf(stderr, "%s: Entering, fpace->addr = %a, fspace->rc = %u\n", FUNC, fspace->addr, fspace->rc); #endif /* H5FS_DEBUG */ @@ -672,7 +672,7 @@ H5FS_decr(H5FS_t *fspace) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FS_decr, FAIL) + FUNC_ENTER_NOAPI(FAIL) #ifdef H5FS_DEBUG HDfprintf(stderr, "%s: Entering, fpace->addr = %a, fspace->rc = %u\n", FUNC, fspace->addr, fspace->rc); #endif /* H5FS_DEBUG */ @@ -720,7 +720,7 @@ H5FS_dirty(H5FS_t *fspace) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5FS_dirty) + FUNC_ENTER_NOAPI_NOINIT #ifdef QAK HDfprintf(stderr, "%s: Marking free space header as dirty\n", FUNC); #endif /* QAK */ @@ -755,7 +755,7 @@ H5FS_alloc_hdr(H5F_t *f, H5FS_t *fspace, haddr_t *fs_addr, hid_t dxpl_id) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(H5FS_alloc_hdr, dxpl_id, H5AC__FREESPACE_TAG, FAIL) + FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__FREESPACE_TAG, FAIL) /* Check arguments. */ HDassert(f); @@ -795,7 +795,7 @@ H5FS_alloc_sect(H5F_t *f, H5FS_t *fspace, hid_t dxpl_id) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(H5FS_alloc_sect, dxpl_id, H5AC__FREESPACE_TAG, FAIL) + FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__FREESPACE_TAG, FAIL) /* Check arguments. */ HDassert(f); @@ -843,7 +843,7 @@ H5FS_free(H5F_t *f, H5FS_t *fspace, hid_t dxpl_id) unsigned cache_flags; /* Flags for unprotecting cache entries */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(H5FS_free, dxpl_id, H5AC__FREESPACE_TAG, FAIL) + FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__FREESPACE_TAG, FAIL) /* Check arguments. */ HDassert(f); @@ -950,7 +950,7 @@ H5FS_hdr_dest(H5FS_t *fspace) unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5FS_hdr_dest) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -996,7 +996,7 @@ H5FS_sinfo_free_sect_cb(void *_sect, void UNUSED *key, void *op_data) H5FS_section_info_t *sect = (H5FS_section_info_t *)_sect; /* Section to free */ const H5FS_sinfo_t *sinfo = (const H5FS_sinfo_t *)op_data; /* Free space manager for section */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FS_sinfo_free_sect_cb) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(sect); HDassert(sinfo); @@ -1027,7 +1027,7 @@ H5FS_sinfo_free_node_cb(void *item, void UNUSED *key, void *op_data) { H5FS_node_t *fspace_node = (H5FS_node_t *)item; /* Temporary pointer to free space list node */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FS_sinfo_free_node_cb) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(fspace_node); HDassert(op_data); @@ -1061,7 +1061,7 @@ H5FS_sinfo_dest(H5FS_sinfo_t *sinfo) unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5FS_sinfo_dest) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -1119,7 +1119,7 @@ done: herr_t H5FS_assert(const H5FS_t *fspace) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FS_assert) + FUNC_ENTER_NOAPI_NOINIT_NOERR #ifndef QAK HDfprintf(stderr, "%s: fspace->tot_sect_count = %Hu\n", "H5FS_assert", fspace->tot_sect_count); #endif /* QAK */ diff --git a/src/H5FScache.c b/src/H5FScache.c index d1c8a2a..d186404 100644 --- a/src/H5FScache.c +++ b/src/H5FScache.c @@ -160,7 +160,7 @@ H5FS_cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) unsigned nclasses; /* Number of section classes */ H5FS_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5FS_cache_hdr_load) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments */ HDassert(f); @@ -287,7 +287,7 @@ H5FS_cache_hdr_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5F uint8_t hdr_buf[H5FS_HDR_BUF_SIZE]; /* Buffer for header */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5FS_cache_hdr_flush) + FUNC_ENTER_NOAPI_NOINIT /* check arguments */ HDassert(f); @@ -440,7 +440,7 @@ H5FS_cache_hdr_dest(H5F_t *f, H5FS_t *fspace) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5FS_cache_hdr_dest) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments */ HDassert(fspace); @@ -489,7 +489,7 @@ H5FS_cache_hdr_clear(H5F_t *f, H5FS_t *fspace, hbool_t destroy) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5FS_cache_hdr_clear) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -526,7 +526,7 @@ done: static herr_t H5FS_cache_hdr_size(const H5F_t UNUSED *f, const H5FS_t *fspace, size_t *size_ptr) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FS_cache_hdr_size) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check arguments */ HDassert(f); @@ -567,7 +567,7 @@ H5FS_cache_sinfo_load(H5F_t *f, hid_t dxpl_id, haddr_t UNUSED addr, void *_udata uint32_t computed_chksum; /* Computed metadata checksum value */ H5FS_sinfo_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5FS_cache_sinfo_load) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments */ HDassert(f); @@ -724,7 +724,7 @@ H5FS_sinfo_serialize_sect_cb(void *_item, void UNUSED *key, void *_udata) H5FS_iter_ud_t *udata = (H5FS_iter_ud_t *)_udata; /* Callback info */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5FS_sinfo_serialize_sect_cb) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments. */ HDassert(sect); @@ -779,7 +779,7 @@ H5FS_sinfo_serialize_node_cb(void *_item, void UNUSED *key, void *_udata) H5FS_iter_ud_t *udata = (H5FS_iter_ud_t *)_udata; /* Callback info */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5FS_sinfo_serialize_node_cb) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments. */ HDassert(fspace_node); @@ -823,7 +823,7 @@ H5FS_cache_sinfo_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5FS_cache_sinfo_flush) + FUNC_ENTER_NOAPI_NOINIT /* check arguments */ HDassert(f); @@ -921,7 +921,7 @@ H5FS_cache_sinfo_dest(H5F_t *f, H5FS_sinfo_t *sinfo) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5FS_cache_sinfo_dest) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments */ HDassert(sinfo); @@ -967,7 +967,7 @@ H5FS_cache_sinfo_clear(H5F_t *f, H5FS_sinfo_t *sinfo, hbool_t destroy) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5FS_cache_sinfo_clear) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -1004,7 +1004,7 @@ done: static herr_t H5FS_cache_sinfo_size(const H5F_t UNUSED *f, const H5FS_sinfo_t *sinfo, size_t *size_ptr) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FS_cache_sinfo_size) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check arguments */ HDassert(sinfo); diff --git a/src/H5FSdbg.c b/src/H5FSdbg.c index 9be363e..fe3ca71 100644 --- a/src/H5FSdbg.c +++ b/src/H5FSdbg.c @@ -100,7 +100,7 @@ H5FS_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int H5FS_hdr_cache_ud_t cache_udata; /* User-data for cache callback */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FS_debug, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* * Check arguments. @@ -197,7 +197,7 @@ H5FS_sect_debug(const H5FS_t *fspace, const H5FS_section_info_t *sect, FILE *str { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FS_sect_debug, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* * Check arguments. @@ -240,7 +240,7 @@ H5FS_sects_debug(H5F_t *f, hid_t dxpl_id, haddr_t UNUSED addr, FILE *stream, int H5FS_hdr_cache_ud_t cache_udata; /* User-data for cache callback */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FS_sects_debug, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* * Check arguments. diff --git a/src/H5FSsection.c b/src/H5FSsection.c index 9fb34df..914fa58 100644 --- a/src/H5FSsection.c +++ b/src/H5FSsection.c @@ -129,7 +129,7 @@ H5FS_sinfo_new(H5F_t *f, H5FS_t *fspace) H5FS_sinfo_t *sinfo = NULL; /* Section information struct created */ H5FS_sinfo_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5FS_sinfo_new) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments. */ HDassert(f); @@ -209,7 +209,7 @@ H5FS_sinfo_lock(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, H5AC_protect_t accmode) H5FS_sinfo_cache_ud_t cache_udata; /* User-data for cache callback */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(H5FS_sinfo_lock, dxpl_id, H5AC__FREESPACE_TAG, FAIL) + FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, H5AC__FREESPACE_TAG, FAIL) #ifdef H5FS_SINFO_DEBUG HDfprintf(stderr, "%s: Called, fspace->addr = %a, fspace->sinfo = %p, fspace->sect_addr = %a\n", FUNC, fspace->addr, fspace->sinfo, fspace->sect_addr); @@ -315,7 +315,7 @@ H5FS_sinfo_unlock(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, hbool_t modified) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5FS_sinfo_unlock) + FUNC_ENTER_NOAPI_NOINIT #ifdef H5FS_SINFO_DEBUG HDfprintf(stderr, "%s: Called, modified = %t, fspace->addr = %a, fspace->sect_addr = %a\n", FUNC, modified, fspace->addr, fspace->sect_addr); HDfprintf(stderr, "%s: fspace->sinfo_lock_count = %u, fspace->sinfo_modified = %t, fspace->sinfo_protected = %t\n", FUNC, fspace->sinfo_lock_count, fspace->sinfo_modified, fspace->sinfo_protected); @@ -474,7 +474,7 @@ HDfprintf(stderr, "%s: Leaving, ret_value = %d\n", FUNC, ret_value); static herr_t H5FS_sect_serialize_size(H5FS_t *fspace) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FS_sect_serialize_size) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments. */ HDassert(fspace); @@ -542,7 +542,7 @@ H5FS_sect_increase(H5FS_t *fspace, const H5FS_section_class_t *cls, { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5FS_sect_increase) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments. */ HDassert(fspace); @@ -604,7 +604,7 @@ H5FS_sect_decrease(H5FS_t *fspace, const H5FS_section_class_t *cls) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5FS_sect_decrease) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments. */ HDassert(fspace); @@ -662,7 +662,7 @@ H5FS_size_node_decr(H5FS_sinfo_t *sinfo, unsigned bin, H5FS_node_t *fspace_node, { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5FS_size_node_decr) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments. */ HDassert(sinfo); @@ -754,7 +754,7 @@ H5FS_sect_unlink_size(H5FS_sinfo_t *sinfo, const H5FS_section_class_t *cls, unsigned bin; /* Bin to put the free space section in */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5FS_sect_unlink_size) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments. */ HDassert(sinfo); @@ -808,7 +808,7 @@ H5FS_sect_unlink_rest(H5FS_t *fspace, const H5FS_section_class_t *cls, { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5FS_sect_unlink_rest) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments. */ HDassert(fspace); @@ -862,7 +862,7 @@ H5FS_sect_remove_real(H5FS_t *fspace, H5FS_section_info_t *sect) const H5FS_section_class_t *cls; /* Class of section */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5FS_sect_remove_real) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments. */ HDassert(fspace); @@ -905,7 +905,7 @@ H5FS_sect_remove(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, hbool_t sinfo_valid = FALSE; /* Whether the section info is valid */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5FS_sect_remove) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments. */ HDassert(f); @@ -952,7 +952,7 @@ H5FS_sect_link_size(H5FS_sinfo_t *sinfo, const H5FS_section_class_t *cls, unsigned bin; /* Bin to put the free space section in */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5FS_sect_link_size) + FUNC_ENTER_NOAPI_NOINIT #ifdef QAK HDfprintf(stderr, "%s: sect->size = %Hu, sect->addr = %a\n", FUNC, sect->size, sect->addr); #endif /* QAK */ @@ -967,7 +967,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))) + if(NULL == (sinfo->bins[bin].bin_list = H5SL_create(H5SL_TYPE_HSIZE, NULL))) HGOTO_ERROR(H5E_FSPACE, H5E_CANTCREATE, FAIL, "can't create skip list for free space nodes") } /* end if */ else { @@ -985,7 +985,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))) + if(NULL == (fspace_node->sect_list = H5SL_create(H5SL_TYPE_HADDR, NULL))) 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 */ @@ -1059,7 +1059,7 @@ H5FS_sect_link_rest(H5FS_t *fspace, const H5FS_section_class_t *cls, { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5FS_sect_link_rest) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments. */ HDassert(fspace); @@ -1072,7 +1072,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))) + if(NULL == (fspace->sinfo->merge_list = H5SL_create(H5SL_TYPE_HADDR, NULL))) 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") @@ -1110,7 +1110,7 @@ H5FS_sect_link(H5FS_t *fspace, H5FS_section_info_t *sect, unsigned flags) const H5FS_section_class_t *cls; /* Class of section */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5FS_sect_link) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments. */ HDassert(fspace); @@ -1172,7 +1172,7 @@ H5FS_sect_merge(H5FS_t *fspace, H5FS_section_info_t **sect, void *op_data) htri_t status; /* Status value */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5FS_sect_merge) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments. */ HDassert(fspace); @@ -1381,7 +1381,7 @@ H5FS_sect_add(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, H5FS_section_info_t *sect hbool_t sinfo_modified = FALSE; /* Whether the section info was modified */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FS_sect_add, FAIL) + FUNC_ENTER_NOAPI(FAIL) #ifdef H5FS_SINFO_DEBUG HDfprintf(stderr, "%s: *sect = {%a, %Hu, %u, %s}\n", FUNC, sect->addr, sect->size, sect->type, (sect->state == H5FS_SECT_LIVE ? "H5FS_SECT_LIVE" : "H5FS_SECT_SERIALIZED")); @@ -1469,7 +1469,7 @@ H5FS_sect_try_extend(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, haddr_t addr, hbool_t sinfo_modified = FALSE; /* Whether the section info was modified */ htri_t ret_value = FALSE; /* Return value */ - FUNC_ENTER_NOAPI(H5FS_sect_try_extend, FAIL) + FUNC_ENTER_NOAPI(FAIL) #ifdef H5FS_SINFO_DEBUG HDfprintf(stderr, "%s: addr = %a, size = %Hu, extra_requested = %hu\n", FUNC, addr, size, extra_requested); @@ -1601,7 +1601,7 @@ H5FS_sect_try_merge(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, H5FS_section_info_t hsize_t saved_fs_size; /* copy the free-space section size */ htri_t ret_value = FALSE; /* Return value */ - FUNC_ENTER_NOAPI(H5FS_sect_try_merge, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check arguments. */ HDassert(f); @@ -1675,7 +1675,7 @@ H5FS_sect_find_node(H5FS_t *fspace, hsize_t request, H5FS_section_info_t **node) const H5FS_section_class_t *cls; /* Class of section */ hsize_t alignment; - FUNC_ENTER_NOAPI_NOINIT(H5FS_sect_find_node) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments. */ HDassert(fspace); @@ -1827,7 +1827,7 @@ H5FS_sect_find(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, hsize_t request, hbool_t sinfo_modified = FALSE; /* Whether the section info was modified */ htri_t ret_value = FALSE; /* Return value */ - FUNC_ENTER_NOAPI(H5FS_sect_find, FAIL) + FUNC_ENTER_NOAPI(FAIL) #ifdef QAK HDfprintf(stderr, "%s: request = %Hu\n", FUNC, request); @@ -1899,7 +1899,7 @@ H5FS_iterate_sect_cb(void *_item, void UNUSED *key, void *_udata) H5FS_iter_ud_t *udata = (H5FS_iter_ud_t *)_udata; /* Callback info */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5FS_iterate_sect_cb) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments. */ HDassert(sect_info); @@ -1937,7 +1937,7 @@ H5FS_iterate_node_cb(void *_item, void UNUSED *key, void *_udata) H5FS_iter_ud_t *udata = (H5FS_iter_ud_t *)_udata; /* Callback info */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5FS_iterate_node_cb) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments. */ HDassert(fspace_node); @@ -1975,7 +1975,7 @@ H5FS_sect_iterate(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, H5FS_operator_t op, v hbool_t sinfo_valid = FALSE; /* Whether the section info is valid */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5FS_sect_iterate) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments. */ HDassert(fspace); @@ -2038,7 +2038,7 @@ done: herr_t H5FS_sect_stats(const H5FS_t *fspace, hsize_t *tot_space, hsize_t *nsects) { - FUNC_ENTER_NOAPI_NOFUNC(H5FS_sect_stats) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments. */ HDassert(fspace); @@ -2078,7 +2078,7 @@ H5FS_sect_change_class(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, hbool_t sinfo_valid = FALSE; /* Whether the section info is valid */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5FS_sect_change_class) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments. */ HDassert(fspace); @@ -2187,7 +2187,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))) + if(NULL == (fspace->sinfo->merge_list = H5SL_create(H5SL_TYPE_HADDR, NULL))) 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") @@ -2243,7 +2243,7 @@ H5FS_sect_assert(const H5FS_t *fspace) { hsize_t separate_obj; /* The number of separate objects managed */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FS_sect_assert) + FUNC_ENTER_NOAPI_NOINIT_NOERR #ifndef QAK HDfprintf(stderr, "%s: fspace->tot_sect_count = %Hu\n", "H5FS_sect_assert", fspace->tot_sect_count); #endif /* QAK */ diff --git a/src/H5FSstat.c b/src/H5FSstat.c index cc4822a..66c5495 100644 --- a/src/H5FSstat.c +++ b/src/H5FSstat.c @@ -84,7 +84,7 @@ herr_t H5FS_stat_info(const H5F_t *f, const H5FS_t *frsp, H5FS_stat_t *stats) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FS_stat_info) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments. */ HDassert(frsp); @@ -103,3 +103,4 @@ H5FS_stat_info(const H5F_t *f, const H5FS_t *frsp, H5FS_stat_t *stats) FUNC_LEAVE_NOAPI(SUCCEED) } /* H5FS_stat_info() */ + diff --git a/src/H5FStest.c b/src/H5FStest.c index af9eaec..63ba94c 100644 --- a/src/H5FStest.c +++ b/src/H5FStest.c @@ -85,7 +85,7 @@ herr_t H5FS_get_cparam_test(const H5FS_t *frsp, H5FS_create_t *cparam) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FS_get_cparam_test) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments. */ HDassert(frsp); @@ -100,6 +100,7 @@ H5FS_get_cparam_test(const H5FS_t *frsp, H5FS_create_t *cparam) FUNC_LEAVE_NOAPI(SUCCEED) } /* H5FS_get_cparam_test() */ + /*------------------------------------------------------------------------- * Function: H5FS_cmp_cparam_test * @@ -118,7 +119,7 @@ H5FS_cmp_cparam_test(const H5FS_create_t *cparam1, const H5FS_create_t *cparam2) { int ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FS_cmp_cparam_test) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments. */ HDassert(cparam1); @@ -152,3 +153,4 @@ H5FS_cmp_cparam_test(const H5FS_create_t *cparam1, const H5FS_create_t *cparam2) done: FUNC_LEAVE_NOAPI(ret_value) } /* H5FS_cmp_cparam_test */ + diff --git a/src/H5Faccum.c b/src/H5Faccum.c index c89ff33..3c72c5d 100644 --- a/src/H5Faccum.c +++ b/src/H5Faccum.c @@ -117,7 +117,7 @@ H5F_accum_read(const H5F_t *f, hid_t dxpl_id, H5FD_mem_t type, haddr_t addr, { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5F_accum_read, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert(f); HDassert(f->shared); @@ -278,7 +278,7 @@ H5F_accum_adjust(H5F_meta_accum_t *accum, H5FD_t *lf, hid_t dxpl_id, { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5F_accum_adjust) + FUNC_ENTER_NOAPI_NOINIT HDassert(accum); HDassert(lf); @@ -417,7 +417,7 @@ H5F_accum_write(const H5F_t *f, hid_t dxpl_id, H5FD_mem_t type, haddr_t addr, { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5F_accum_write, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert(f); HDassert(f->shared); @@ -833,7 +833,7 @@ H5F_accum_free(H5F_t *f, hid_t dxpl_id, H5FD_mem_t UNUSED type, haddr_t addr, { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5F_accum_free, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* check arguments */ HDassert(f); @@ -989,7 +989,7 @@ H5F_accum_flush(const H5F_t *f, hid_t dxpl_id) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5F_accum_flush, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert(f); HDassert(f->shared); @@ -1027,7 +1027,7 @@ H5F_accum_reset(const H5F_t *f, hid_t dxpl_id, hbool_t flush) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5F_accum_reset, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert(f); HDassert(f->shared); diff --git a/src/H5Fcwfs.c b/src/H5Fcwfs.c new file mode 100644 index 0000000..d0688f7 --- /dev/null +++ b/src/H5Fcwfs.c @@ -0,0 +1,323 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Programmer: Quincey Koziol + * Tuesday, July 19, 2011 + * + * Purpose: Each file has a small cache of global heap collections called + * the CWFS list and recently accessed collections with free + * space appear on this list. As collections are accessed the + * collection is moved toward the front of the list. New + * collections are added to the front of the list while old + * collections are added to the end of the list. + * + * The collection model reduces the overhead which would be + * incurred if the global heap were a single object, and the + * CWFS list allows the library to cheaply choose a collection + * for a new object based on object size, amount of free space + * in the collection, and temporal locality. + */ + +/****************/ +/* Module Setup */ +/****************/ + +#define H5F_PACKAGE /*suppress error about including H5Fpkg */ + + +/***********/ +/* Headers */ +/***********/ +#include "H5private.h" /* Generic Functions */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5Fpkg.h" /* File access */ +#include "H5HGprivate.h" /* Global heaps */ +#include "H5MFprivate.h" /* File memory management */ +#include "H5MMprivate.h" /* Memory management */ + + +/****************/ +/* Local Macros */ +/****************/ + +/* + * Maximum length of the CWFS list, the list of remembered collections that + * have free space. + */ +#define H5F_NCWFS 16 + + +/******************/ +/* Local Typedefs */ +/******************/ + + +/********************/ +/* Package Typedefs */ +/********************/ + + +/********************/ +/* Local Prototypes */ +/********************/ + + +/*********************/ +/* Package Variables */ +/*********************/ + + +/*****************************/ +/* Library Private Variables */ +/*****************************/ + + +/*******************/ +/* Local Variables */ +/*******************/ + + + +/*------------------------------------------------------------------------- + * Function: H5F_cwfs_add + * + * Purpose: Add a global heap collection to the CWFS for a file. + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * Tuesday, July 19, 2011 + * + *------------------------------------------------------------------------- + */ +herr_t +H5F_cwfs_add(H5F_t *f, H5HG_heap_t *heap) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Check args */ + HDassert(f); + HDassert(f->shared); + HDassert(heap); + + /* + * Add the new heap to the CWFS list, removing some other entry if + * necessary to make room. We remove the right-most entry that has less + * free space than this heap. + */ + if(NULL == f->shared->cwfs) { + if(NULL == (f->shared->cwfs = (H5HG_heap_t **)H5MM_malloc(H5F_NCWFS * sizeof(H5HG_heap_t *)))) + HGOTO_ERROR(H5E_FILE, H5E_CANTALLOC, FAIL, "can't allocate CWFS for file") + f->shared->cwfs[0] = heap; + f->shared->ncwfs = 1; + } else if(H5F_NCWFS == f->shared->ncwfs) { + int i; /* Local index variable */ + + for(i = H5F_NCWFS - 1; i >= 0; --i) + if(H5HG_FREE_SIZE(f->shared->cwfs[i]) < H5HG_FREE_SIZE(heap)) { + HDmemmove(f->shared->cwfs + 1, f->shared->cwfs, (size_t)i * sizeof(H5HG_heap_t *)); + f->shared->cwfs[0] = heap; + break; + } /* end if */ + } else { + HDmemmove(f->shared->cwfs + 1, f->shared->cwfs, f->shared->ncwfs * sizeof(H5HG_heap_t *)); + f->shared->cwfs[0] = heap; + f->shared->ncwfs += 1; + } /* end else */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* H5F_cwfs_add() */ + + +/*------------------------------------------------------------------------- + * Function: H5F_cwfs_find_free_heap + * + * Purpose: Find a global heap collection with free space for storing + * a new object. + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * Wednesday, July 20, 2011 + * + *------------------------------------------------------------------------- + */ +herr_t +H5F_cwfs_find_free_heap(H5F_t *f, hid_t dxpl_id, size_t need, haddr_t *addr) +{ + unsigned cwfsno; /* Local index for iterating over collections */ + hbool_t found = FALSE; /* Flag to indicate a heap with enough space was found */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Check args */ + HDassert(f); + HDassert(f->shared); + HDassert(addr); + + /* Note that we don't have metadata cache locks on the entries in + * f->shared->cwfs. + * + * In the current situation, this doesn't matter, as we are single + * threaded, and as best I can tell, entries are added to and deleted + * from f->shared->cwfs as they are added to and deleted from the + * metadata cache. + * + * To be proper, we should either lock each entry in f->shared->cwfs + * as we examine it, or lock the whole array. However, at present + * I don't see the point as there will be significant overhead, + * and protecting and unprotecting all the collections in the global + * heap on a regular basis will skew the replacement policy. + * + * JRM - 5/24/04 + */ + for(cwfsno = 0; cwfsno < f->shared->ncwfs; cwfsno++) + if(H5HG_FREE_SIZE(f->shared->cwfs[cwfsno]) >= need) { + *addr = H5HG_ADDR(f->shared->cwfs[cwfsno]); + found = TRUE; + break; + } /* end if */ + + /* + * If we didn't find any collection with enough free space the check if + * we can extend any of the collections to make enough room. + */ + if(!found) { + size_t new_need; + + for(cwfsno = 0; cwfsno < f->shared->ncwfs; cwfsno++) { + new_need = need; + new_need -= H5HG_FREE_SIZE(f->shared->cwfs[cwfsno]); + new_need = MAX(H5HG_SIZE(f->shared->cwfs[cwfsno]), new_need); + + if((H5HG_SIZE(f->shared->cwfs[cwfsno]) + new_need) <= H5HG_MAXSIZE) { + htri_t extended; /* Whether the heap was extended */ + + extended = H5MF_try_extend(f, dxpl_id, H5FD_MEM_GHEAP, H5HG_ADDR(f->shared->cwfs[cwfsno]), (hsize_t)H5HG_SIZE(f->shared->cwfs[cwfsno]), (hsize_t)new_need); + if(extended < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTEXTEND, FAIL, "error trying to extend heap") + else if(extended == TRUE) { + if(H5HG_extend(f, dxpl_id, H5HG_ADDR(f->shared->cwfs[cwfsno]), new_need) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTRESIZE, FAIL, "unable to extend global heap collection") + *addr = H5HG_ADDR(f->shared->cwfs[cwfsno]); + found = TRUE; + break; + } /* end if */ + } /* end if */ + } /* end for */ + } /* end if */ + + if(found) { + /* Move the collection forward in the CWFS list, if it's not + * already at the front + */ + if(cwfsno > 0) { + H5HG_heap_t *tmp = f->shared->cwfs[cwfsno]; + + f->shared->cwfs[cwfsno] = f->shared->cwfs[cwfsno - 1]; + f->shared->cwfs[cwfsno - 1] = tmp; + } /* end if */ + } /* end if */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* H5F_cwfs_find_free_heap() */ + + +/*------------------------------------------------------------------------- + * Function: H5F_cwfs_advance_heap + * + * Purpose: Advance a heap in the CWFS + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * Wednesday, July 20, 2011 + * + *------------------------------------------------------------------------- + */ +herr_t +H5F_cwfs_advance_heap(H5F_t *f, H5HG_heap_t *heap, hbool_t add_heap) +{ + unsigned u; /* Local index variable */ + + FUNC_ENTER_NOAPI_NOERR + + /* Check args */ + HDassert(f); + HDassert(f->shared); + HDassert(heap); + + for(u = 0; u < f->shared->ncwfs; u++) + if(f->shared->cwfs[u] == heap) { + if(u) { + f->shared->cwfs[u] = f->shared->cwfs[u - 1]; + f->shared->cwfs[u - 1] = heap; + } /* end if */ + break; + } /* end if */ + if(add_heap && u >= f->shared->ncwfs) { + f->shared->ncwfs = MIN(f->shared->ncwfs + 1, H5F_NCWFS); + f->shared->cwfs[f->shared->ncwfs - 1] = heap; + } /* end if */ + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* H5F_cwfs_advance_heap() */ + + +/*------------------------------------------------------------------------- + * Function: H5F_cwfs_remove_heap + * + * Purpose: Remove a heap from the CWFS + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * Wednesday, July 20, 2011 + * + *------------------------------------------------------------------------- + */ +herr_t +H5F_cwfs_remove_heap(H5F_file_t *shared, H5HG_heap_t *heap) +{ + unsigned u; /* Local index variable */ + + FUNC_ENTER_NOAPI_NOERR + + /* Check args */ + HDassert(shared); + HDassert(heap); + + /* Remove the heap from the CWFS list */ + for(u = 0; u < shared->ncwfs; u++) { + if(shared->cwfs[u] == heap) { + shared->ncwfs -= 1; + HDmemmove(shared->cwfs + u, shared->cwfs + u + 1, (shared->ncwfs - u) * sizeof(H5HG_heap_t *)); + break; + } /* end if */ + } /* end for */ + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* H5F_cwfs_remove_heap() */ + diff --git a/src/H5Fdbg.c b/src/H5Fdbg.c index 0ae0eb1..40d24e5 100644 --- a/src/H5Fdbg.c +++ b/src/H5Fdbg.c @@ -53,7 +53,7 @@ H5F_debug(H5F_t *f, FILE *stream, int indent, int fwidth) hsize_t userblock_size; /* Userblock size */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5F_debug, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* check args */ HDassert(f); @@ -123,13 +123,13 @@ H5F_debug(H5F_t *f, FILE *stream, int indent, int fwidth) f->shared->root_grp ? "" : "(none)"); if(f->shared->root_grp) { if(f->shared->sblock->root_ent) /* Use real root group symbol table entry */ - H5G_ent_debug(f->shared->sblock->root_ent, stream, indent + 3, MAX(0, fwidth - 3), NULL); + H5G__ent_debug(f->shared->sblock->root_ent, stream, indent + 3, MAX(0, fwidth - 3), NULL); else { H5O_loc_t *root_oloc; /* Root object location */ H5G_entry_t root_ent; /* Constructed root symbol table entry */ /* Reset the root group entry */ - H5G_ent_reset(&root_ent); + H5G__ent_reset(&root_ent); /* Build up a simulated root group symbol table entry */ root_oloc = H5G_oloc(f->shared->root_grp); @@ -138,7 +138,7 @@ H5F_debug(H5F_t *f, FILE *stream, int indent, int fwidth) root_ent.header = root_oloc->addr; /* Display root group symbol table entry info */ - H5G_ent_debug(&root_ent, stream, indent + 3, MAX(0, fwidth - 3), NULL); + H5G__ent_debug(&root_ent, stream, indent + 3, MAX(0, fwidth - 3), NULL); } /* end else */ } /* end if */ diff --git a/src/H5Fdeprec.c b/src/H5Fdeprec.c index 7e1136c..e3945ff 100644 --- a/src/H5Fdeprec.c +++ b/src/H5Fdeprec.c @@ -98,7 +98,7 @@ DESCRIPTION static herr_t H5F_init_deprec_interface(void) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5F_init_deprec_interface) + FUNC_ENTER_NOAPI_NOINIT_NOERR FUNC_LEAVE_NOAPI(H5F_init()) } /* H5F_init_deprec_interface() */ @@ -128,7 +128,7 @@ H5Fget_info1(hid_t obj_id, H5F_info1_t *finfo) H5F_t *f; /* Top file in mount hierarchy */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Fget_info1, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*x", obj_id, finfo); /* Check args */ diff --git a/src/H5Fefc.c b/src/H5Fefc.c index eebf143..08d27a1 100644 --- a/src/H5Fefc.c +++ b/src/H5Fefc.c @@ -95,7 +95,7 @@ H5F_efc_create(unsigned max_nfiles) H5F_efc_t *efc = NULL; /* EFC object */ H5F_efc_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5F_efc_create, NULL) + FUNC_ENTER_NOAPI(NULL) /* Sanity checks */ HDassert(max_nfiles > 0); @@ -147,9 +147,9 @@ H5F_efc_open(H5F_t *parent, const char *name, unsigned flags, hid_t fcpl_id, H5F_efc_t *efc = NULL; /* External file cache for parent file */ H5F_efc_ent_t *ent = NULL; /* Entry for target file in efc */ hbool_t open_file = FALSE; /* Whether ent->file needs to be closed in case of error */ - H5F_t *ret_value; /* Return value */ + H5F_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5F_efc_open) + FUNC_ENTER_NOAPI_NOINIT /* Sanity checks */ HDassert(parent); @@ -184,7 +184,7 @@ H5F_efc_open(H5F_t *parent, const char *name, unsigned flags, hid_t fcpl_id, } /* end if */ else { HDassert(efc->nfiles == 0); - if(NULL == (efc->slist = H5SL_create(H5SL_TYPE_STR))) + if(NULL == (efc->slist = H5SL_create(H5SL_TYPE_STR, NULL))) HGOTO_ERROR(H5E_FILE, H5E_CANTCREATE, NULL, "can't create skip list") } /* end else */ @@ -338,7 +338,7 @@ H5F_efc_close(H5F_t *parent, H5F_t *file) H5F_efc_ent_t *ent = NULL; /* Entry for target file in efc */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5F_efc_close) + FUNC_ENTER_NOAPI_NOINIT /* Sanity checks */ HDassert(parent); @@ -396,7 +396,7 @@ done: unsigned H5F_efc_max_nfiles(H5F_efc_t *efc) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5F_efc_max_nfiles) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(efc); HDassert(efc->max_nfiles > 0); @@ -427,7 +427,7 @@ H5F_efc_release(H5F_efc_t *efc) H5F_efc_ent_t *prev_ent = NULL; /* Previous EFC entry */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5F_efc_release) + FUNC_ENTER_NOAPI_NOINIT /* Sanity checks */ HDassert(efc); @@ -487,7 +487,7 @@ H5F_efc_destroy(H5F_efc_t *efc) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5F_efc_destroy) + FUNC_ENTER_NOAPI_NOINIT /* Sanity checks */ HDassert(efc); @@ -538,7 +538,7 @@ H5F_efc_remove_ent(H5F_efc_t *efc, H5F_efc_ent_t *ent) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5F_efc_remove_ent) + FUNC_ENTER_NOAPI_NOINIT /* Sanity checks */ HDassert(efc); @@ -605,7 +605,7 @@ H5F_efc_try_close_tag1(H5F_file_t *sf, H5F_file_t **tail) H5F_efc_ent_t *ent = NULL; /* EFC entry */ H5F_file_t *esf; /* Convenience pointer to ent->file->shared */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5F_efc_try_close_tag1) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity checks */ HDassert(sf); @@ -679,7 +679,7 @@ H5F_efc_try_close_tag2(H5F_file_t *sf, H5F_file_t **tail) H5F_efc_ent_t *ent = NULL; /* EFC entry */ H5F_file_t *esf; /* Convenience pointer to ent->file->shared */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5F_efc_try_close_tag2) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity checks */ HDassert(sf); @@ -790,7 +790,7 @@ H5F_efc_try_close(H5F_t *f) H5F_file_t *next; /* Temporary file pointer */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5F_efc_try_close) + FUNC_ENTER_NOAPI_NOINIT /* Sanity checks */ HDassert(f); diff --git a/src/H5Ffake.c b/src/H5Ffake.c index f71d373..af048bc 100644 --- a/src/H5Ffake.c +++ b/src/H5Ffake.c @@ -43,7 +43,7 @@ DESCRIPTION static herr_t H5F_init_fake_interface(void) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5F_init_fake_interface) + FUNC_ENTER_NOAPI_NOINIT_NOERR FUNC_LEAVE_NOAPI(H5F_init()) } /* H5F_init_fake_interface() */ @@ -72,7 +72,7 @@ H5F_fake_alloc(uint8_t sizeof_size) H5F_t *f = NULL; /* Pointer to fake file struct */ H5F_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5F_fake_alloc, NULL) + FUNC_ENTER_NOAPI(NULL) /* Allocate faked file struct */ if(NULL == (f = H5FL_CALLOC(H5F_t))) @@ -114,7 +114,7 @@ done: herr_t H5F_fake_free(H5F_t *f) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5F_fake_free) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Free faked file struct */ if(f) { diff --git a/src/H5Fio.c b/src/H5Fio.c index a10fafc..4f15017 100644 --- a/src/H5Fio.c +++ b/src/H5Fio.c @@ -97,7 +97,7 @@ H5F_block_read(const H5F_t *f, H5FD_mem_t type, haddr_t addr, size_t size, { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5F_block_read, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert(f); HDassert(f->shared); @@ -138,7 +138,7 @@ H5F_block_write(const H5F_t *f, H5FD_mem_t type, haddr_t addr, size_t size, { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5F_block_write, FAIL) + FUNC_ENTER_NOAPI(FAIL) #ifdef QAK HDfprintf(stderr, "%s: write to addr = %a, size = %Zu\n", FUNC, addr, size); #endif /* QAK */ @@ -180,7 +180,7 @@ H5F_flush_tagged_metadata(H5F_t * f, haddr_t tag, hid_t dxpl_id) { herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI(H5F_flush_tagged_metadata, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Use tag to search for and flush associated metadata */ if(H5AC_flush_tagged_metadata(f, tag, dxpl_id)<0) @@ -216,7 +216,7 @@ H5F_evict_tagged_metadata(H5F_t * f, haddr_t tag, hid_t dxpl_id) { herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI(H5F_evict_tagged_metadata, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Unpin the superblock, as this will be marked for eviction and it can't be pinned. */ diff --git a/src/H5Fmount.c b/src/H5Fmount.c index d04e747..ee7af97 100644 --- a/src/H5Fmount.c +++ b/src/H5Fmount.c @@ -52,7 +52,7 @@ DESCRIPTION static herr_t H5F_init_mount_interface(void) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5F_init_mount_interface) + FUNC_ENTER_NOAPI_NOINIT_NOERR FUNC_LEAVE_NOAPI(H5F_init()) } /* H5F_init_mount_interface() */ @@ -76,7 +76,7 @@ H5F_close_mounts(H5F_t *f) unsigned u; /* Local index */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5F_close_mounts, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert(f); @@ -141,7 +141,7 @@ H5F_mount(H5G_loc_t *loc, const char *name, H5F_t *child, H5G_loc_t root_loc; /* Group location of root of file to mount */ herr_t ret_value = SUCCEED; /*return value */ - FUNC_ENTER_NOAPI_NOINIT(H5F_mount) + FUNC_ENTER_NOAPI_NOINIT HDassert(loc); HDassert(name && *name); @@ -307,7 +307,7 @@ H5F_unmount(H5G_loc_t *loc, const char *name, hid_t dxpl_id) int child_idx; /* Index of child in parent's mtab */ herr_t ret_value = SUCCEED; /*return value */ - FUNC_ENTER_NOAPI_NOINIT(H5F_unmount) + FUNC_ENTER_NOAPI_NOINIT HDassert(loc); HDassert(name && *name); @@ -441,7 +441,7 @@ H5F_is_mount(const H5F_t *file) { hbool_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5F_is_mount) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(file); @@ -474,7 +474,7 @@ H5Fmount(hid_t loc_id, const char *name, hid_t child_id, hid_t plist_id) H5F_t *child = NULL; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Fmount, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE4("e", "i*sii", loc_id, name, child_id, plist_id); /* Check arguments */ @@ -524,7 +524,7 @@ H5Funmount(hid_t loc_id, const char *name) H5G_loc_t loc; herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Funmount, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*s", loc_id, name); /* Check args */ @@ -560,7 +560,7 @@ H5F_mount_count_ids_recurse(H5F_t *f, unsigned *nopen_files, unsigned *nopen_obj { unsigned u; /* Local index value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5F_mount_count_ids_recurse) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ HDassert(f); @@ -608,9 +608,7 @@ H5F_mount_count_ids_recurse(H5F_t *f, unsigned *nopen_files, unsigned *nopen_obj herr_t H5F_mount_count_ids(H5F_t *f, unsigned *nopen_files, unsigned *nopen_objs) { - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5F_mount_count_ids, FAIL) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ HDassert(f); @@ -624,8 +622,7 @@ H5F_mount_count_ids(H5F_t *f, unsigned *nopen_files, unsigned *nopen_objs) /* Count open IDs in the hierarchy */ H5F_mount_count_ids_recurse(f, nopen_files, nopen_objs); -done: - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5F_mount_count_ids() */ @@ -648,7 +645,7 @@ H5F_flush_mounts_recurse(H5F_t *f, hid_t dxpl_id) unsigned u; /* Index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5F_flush_mounts_recurse) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(f); @@ -688,7 +685,7 @@ H5F_flush_mounts(H5F_t *f, hid_t dxpl_id) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5F_flush_mounts, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ HDassert(f); @@ -705,3 +702,83 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5F_flush_mounts() */ + +/*------------------------------------------------------------------------- + * Function: H5F_traverse_mount + * + * Purpose: If LNK is a mount point then copy the entry for the root + * group of the mounted file into LNK. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Robb Matzke + * Tuesday, October 6, 1998 + * + *------------------------------------------------------------------------- + */ +herr_t +H5F_traverse_mount(H5O_loc_t *oloc/*in,out*/) +{ + H5F_t *parent = oloc->file, /* File of object */ + *child = NULL; /* Child file */ + unsigned lt, rt, md = 0; /* Binary search indices */ + int cmp; + H5O_loc_t *mnt_oloc = NULL; /* Object location for mount points */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity check */ + HDassert(oloc); + + /* + * The loop is necessary because we might have file1 mounted at the root + * of file2, which is mounted somewhere in file3. + */ + do { + /* + * Use a binary search to find the potential mount point in the mount + * table for the parent + */ + lt = 0; + rt = parent->shared->mtab.nmounts; + cmp = -1; + while(lt < rt && cmp) { + md = (lt + rt) / 2; + mnt_oloc = H5G_oloc(parent->shared->mtab.child[md].group); + cmp = H5F_addr_cmp(oloc->addr, mnt_oloc->addr); + if(cmp < 0) + rt = md; + else + lt = md + 1; + } /* end while */ + + /* Copy root info over to ENT */ + if(0 == cmp) { + /* Get the child file */ + child = parent->shared->mtab.child[md].file; + + /* Get the location for the root group in the child's file */ + mnt_oloc = H5G_oloc(child->shared->root_grp); + + /* Release the mount point */ + if(H5O_loc_free(oloc) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTFREE, FAIL, "unable to free object location") + + /* Copy the entry for the root group */ + if(H5O_loc_copy(oloc, mnt_oloc, H5_COPY_DEEP) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTCOPY, FAIL, "unable to copy object location") + + /* In case the shared root group info points to a different file handle + * than the child, modify oloc */ + oloc->file = child; + + /* Switch to child's file */ + parent = child; + } /* end if */ + } while(!cmp); + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5F_traverse_mount() */ + diff --git a/src/H5Fmpi.c b/src/H5Fmpi.c index c90ad7c..4fd04f6 100644 --- a/src/H5Fmpi.c +++ b/src/H5Fmpi.c @@ -98,7 +98,7 @@ H5F_mpi_get_rank(const H5F_t *f) { int ret_value; - FUNC_ENTER_NOAPI(H5F_mpi_get_rank, FAIL) + FUNC_ENTER_NOAPI(FAIL) assert(f && f->shared); @@ -132,7 +132,7 @@ H5F_mpi_get_comm(const H5F_t *f) { MPI_Comm ret_value; - FUNC_ENTER_NOAPI(H5F_mpi_get_comm, MPI_COMM_NULL) + FUNC_ENTER_NOAPI(MPI_COMM_NULL) assert(f && f->shared); @@ -166,7 +166,7 @@ H5F_mpi_get_size(const H5F_t *f) { int ret_value; - FUNC_ENTER_NOAPI(H5F_mpi_get_size, FAIL) + FUNC_ENTER_NOAPI(FAIL) assert(f && f->shared); diff --git a/src/H5Fpkg.h b/src/H5Fpkg.h index 0768d08..e6553ff 100644 --- a/src/H5Fpkg.h +++ b/src/H5Fpkg.h @@ -198,7 +198,7 @@ typedef struct H5F_super_t { * count in this struct indicates the number of H5F_t structs which are * pointing to this struct. */ -typedef struct H5F_file_t { +struct H5F_file_t { H5FD_t *lf; /* Lower level file handle for I/O */ H5F_super_t *sblock; /* Pointer to (pinned) superblock for file */ unsigned nrefs; /* Ref count for times file is opened */ @@ -255,7 +255,7 @@ typedef struct H5F_file_t { /* Metadata accumulator information */ H5F_meta_accum_t accum; /* Metadata accumulator info */ -} H5F_file_t; +}; /* * This is the top-level file descriptor. One of these structures is diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index 8ce9833..7eb7753 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -35,6 +35,7 @@ /* Main file structure */ typedef struct H5F_t H5F_t; +typedef struct H5F_file_t H5F_file_t; /* Block aggregation structure */ typedef struct H5F_blk_aggr_t H5F_blk_aggr_t; @@ -236,52 +237,86 @@ typedef struct H5F_blk_aggr_t H5F_blk_aggr_t; /* If the module using this macro is allowed access to the private variables, access them directly */ #ifdef H5F_PACKAGE #define H5F_INTENT(F) ((F)->intent) -#define H5F_FCPL(F) ((F)->shared->fcpl_id) -#define H5F_SIZEOF_ADDR(F) ((F)->shared->sizeof_addr) -#define H5F_SIZEOF_SIZE(F) ((F)->shared->sizeof_size) +#define H5F_OPEN_NAME(F) ((F)->open_name) +#define H5F_ACTUAL_NAME(F) ((F)->actual_name) +#define H5F_EXTPATH(F) ((F)->extpath) +#define H5F_SHARED(F) ((F)->shared) +#define H5F_SAME_SHARED(F1, F2) ((F1)->shared == (F2)->shared)) +#define H5F_NOPEN_OBJS(F) ((F)->nopen_objs) +#define H5F_INCR_NOPEN_OBJS(F) ((F)->nopen_objs++) +#define H5F_DECR_NOPEN_OBJS(F) ((F)->nopen_objs--) +#define H5F_FILE_ID(F) ((F)->file_id) +#define H5F_PARENT(F) ((F)->parent) +#define H5F_NMOUNTS(F) ((F)->nmounts) +#define H5F_DRIVER_ID(F) ((F)->shared->lf->driver_id) +#define H5F_GET_FILENO(F,FILENUM) ((FILENUM) = (F)->shared->lf->fileno) +#define H5F_HAS_FEATURE(F,FL) ((F)->shared->lf->feature_flags & (FL)) +#define H5F_BASE_ADDR(F) ((F)->shared->sblock->base_addr) #define H5F_SYM_LEAF_K(F) ((F)->shared->sblock->sym_leaf_k) #define H5F_KVALUE(F,T) ((F)->shared->sblock->btree_k[(T)->id]) +#define H5F_NREFS(F) ((F)->shared->nrefs) +#define H5F_SIZEOF_ADDR(F) ((F)->shared->sizeof_addr) +#define H5F_SIZEOF_SIZE(F) ((F)->shared->sizeof_size) +#define H5F_SOHM_ADDR(F) ((F)->shared->sohm_addr) +#define H5F_SET_SOHM_ADDR(F, A) ((F)->shared->sohm_addr = (A)) +#define H5F_SOHM_VERS(F) ((F)->shared->sohm_vers) +#define H5F_SET_SOHM_VERS(F, V) ((F)->shared->sohm_vers = (V)) +#define H5F_SOHM_NINDEXES(F) ((F)->shared->sohm_nindexes) +#define H5F_SET_SOHM_NINDEXES(F, N) ((F)->shared->sohm_nindexes = (N)) +#define H5F_FCPL(F) ((F)->shared->fcpl_id) +#define H5F_GET_FC_DEGREE(F) ((F)->shared->fc_degree) #define H5F_RDCC_NSLOTS(F) ((F)->shared->rdcc_nslots) #define H5F_RDCC_NBYTES(F) ((F)->shared->rdcc_nbytes) #define H5F_RDCC_W0(F) ((F)->shared->rdcc_w0) -#define H5F_BASE_ADDR(F) ((F)->shared->sblock->base_addr) -#define H5F_GRP_BTREE_SHARED(F) ((F)->shared->grp_btree_shared) #define H5F_SIEVE_BUF_SIZE(F) ((F)->shared->sieve_buf_size) #define H5F_GC_REF(F) ((F)->shared->gc_ref) #define H5F_USE_LATEST_FORMAT(F) ((F)->shared->latest_format) -#define H5F_OPEN_NAME(F) ((F)->open_name) -#define H5F_ACTUAL_NAME(F) ((F)->actual_name) -#define H5F_EXTPATH(F) ((F)->extpath) -#define H5F_GET_FC_DEGREE(F) ((F)->shared->fc_degree) #define H5F_STORE_MSG_CRT_IDX(F) ((F)->shared->store_msg_crt_idx) -#define H5F_HAS_FEATURE(F,FL) ((F)->shared->lf->feature_flags & (FL)) -#define H5F_DRIVER_ID(F) ((F)->shared->lf->driver_id) -#define H5F_GET_FILENO(F,FILENUM) ((FILENUM) = (F)->shared->lf->fileno) +#define H5F_SET_STORE_MSG_CRT_IDX(F, FL) ((F)->shared->store_msg_crt_idx = (FL)) +#define H5F_GRP_BTREE_SHARED(F) ((F)->shared->grp_btree_shared) +#define H5F_SET_GRP_BTREE_SHARED(F, RC) (((F)->shared->grp_btree_shared = (RC)) ? SUCCEED : FAIL) #define H5F_USE_TMP_SPACE(F) ((F)->shared->use_tmp_space) #define H5F_IS_TMP_ADDR(F, ADDR) (H5F_addr_le((F)->shared->tmp_addr, (ADDR))) #else /* H5F_PACKAGE */ #define H5F_INTENT(F) (H5F_get_intent(F)) -#define H5F_FCPL(F) (H5F_get_fcpl(F)) -#define H5F_SIZEOF_ADDR(F) (H5F_sizeof_addr(F)) -#define H5F_SIZEOF_SIZE(F) (H5F_sizeof_size(F)) +#define H5F_OPEN_NAME(F) (H5F_get_open_name(F)) +#define H5F_ACTUAL_NAME(F) (H5F_get_actual_name(F)) +#define H5F_EXTPATH(F) (H5F_get_extpath(F)) +#define H5F_SHARED(F) (H5F_get_shared(F)) +#define H5F_SAME_SHARED(F1, F2) (H5F_same_shared((F1), (F2))) +#define H5F_NOPEN_OBJS(F) (H5F_get_nopen_objs(F)) +#define H5F_INCR_NOPEN_OBJS(F) (H5F_incr_nopen_objs(F)) +#define H5F_DECR_NOPEN_OBJS(F) (H5F_decr_nopen_objs(F)) +#define H5F_FILE_ID(F) (H5F_get_file_id(F)) +#define H5F_PARENT(F) (H5F_get_parent(F)) +#define H5F_NMOUNTS(F) (H5F_get_nmounts(F)) +#define H5F_DRIVER_ID(F) (H5F_get_driver_id(F)) +#define H5F_GET_FILENO(F,FILENUM) (H5F_get_fileno((F), &(FILENUM))) +#define H5F_HAS_FEATURE(F,FL) (H5F_has_feature(F,FL)) +#define H5F_BASE_ADDR(F) (H5F_get_base_addr(F)) #define H5F_SYM_LEAF_K(F) (H5F_sym_leaf_k(F)) #define H5F_KVALUE(F,T) (H5F_Kvalue(F,T)) +#define H5F_NREFS(F) (H5F_get_nrefs(F)) +#define H5F_SIZEOF_ADDR(F) (H5F_sizeof_addr(F)) +#define H5F_SIZEOF_SIZE(F) (H5F_sizeof_size(F)) +#define H5F_SOHM_ADDR(F) (H5F_get_sohm_addr(F)) +#define H5F_SET_SOHM_ADDR(F, A) (H5F_set_sohm_addr((F), (A))) +#define H5F_SOHM_VERS(F) (H5F_get_sohm_vers(F)) +#define H5F_SET_SOHM_VERS(F, V) (H5F_set_sohm_vers((F), (V))) +#define H5F_SOHM_NINDEXES(F) (H5F_get_sohm_nindexes(F)) +#define H5F_SET_SOHM_NINDEXES(F, N) (H5F_set_sohm_nindexes((F), (N))) +#define H5F_FCPL(F) (H5F_get_fcpl(F)) +#define H5F_GET_FC_DEGREE(F) (H5F_get_fc_degree(F)) #define H5F_RDCC_NSLOTS(F) (H5F_rdcc_nslots(F)) #define H5F_RDCC_NBYTES(F) (H5F_rdcc_nbytes(F)) #define H5F_RDCC_W0(F) (H5F_rdcc_w0(F)) -#define H5F_BASE_ADDR(F) (H5F_get_base_addr(F)) -#define H5F_GRP_BTREE_SHARED(F) (H5F_grp_btree_shared(F)) #define H5F_SIEVE_BUF_SIZE(F) (H5F_sieve_buf_size(F)) #define H5F_GC_REF(F) (H5F_gc_ref(F)) #define H5F_USE_LATEST_FORMAT(F) (H5F_use_latest_format(F)) -#define H5F_OPEN_NAME(F) (H5F_get_open_name(F)) -#define H5F_ACTUAL_NAME(F) (H5F_get_actual_name(F)) -#define H5F_EXTPATH(F) (H5F_get_extpath(F)) -#define H5F_GET_FC_DEGREE(F) (H5F_get_fc_degree(F)) #define H5F_STORE_MSG_CRT_IDX(F) (H5F_store_msg_crt_idx(F)) -#define H5F_HAS_FEATURE(F,FL) (H5F_has_feature(F,FL)) -#define H5F_DRIVER_ID(F) (H5F_get_driver_id(F)) -#define H5F_GET_FILENO(F,FILENUM) (H5F_get_fileno((F), &(FILENUM))) +#define H5F_SET_STORE_MSG_CRT_IDX(F, FL) (H5F_set_store_msg_crt_idx((F), (FL))) +#define H5F_GRP_BTREE_SHARED(F) (H5F_grp_btree_shared(F)) +#define H5F_SET_GRP_BTREE_SHARED(F, RC) (H5F_set_grp_btree_shared((F), (RC))) #define H5F_USE_TMP_SPACE(F) (H5F_use_tmp_space(F)) #define H5F_IS_TMP_ADDR(F, ADDR) (H5F_is_tmp_addr((F), (ADDR))) #endif /* H5F_PACKAGE */ @@ -470,55 +505,73 @@ typedef struct H5F_blk_aggr_t H5F_blk_aggr_t; /* Forward declarations for prototype arguments */ struct H5B_class_t; struct H5RC_t; +struct H5O_loc_t; +struct H5HG_heap_t; /* Private functions */ H5_DLL H5F_t *H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, hid_t dxpl_id); H5_DLL herr_t H5F_try_close(H5F_t *f); -H5_DLL unsigned H5F_incr_nopen_objs(H5F_t *f); -H5_DLL unsigned H5F_decr_nopen_objs(H5F_t *f); /* Functions than retrieve values from the file struct */ H5_DLL unsigned H5F_get_intent(const H5F_t *f); -H5_DLL hid_t H5F_get_access_plist(H5F_t *f, hbool_t app_ref); -H5_DLL char *H5F_get_extpath(const H5F_t *f); H5_DLL char *H5F_get_open_name(const H5F_t *f); H5_DLL char *H5F_get_actual_name(const H5F_t *f); +H5_DLL char *H5F_get_extpath(const H5F_t *f); +H5_DLL H5F_file_t *H5F_get_shared(const H5F_t *f); +H5_DLL hbool_t H5F_same_shared(const H5F_t *f1, const H5F_t *f2); +H5_DLL unsigned H5F_get_nopen_objs(const H5F_t *f); +H5_DLL unsigned H5F_incr_nopen_objs(H5F_t *f); +H5_DLL unsigned H5F_decr_nopen_objs(H5F_t *f); +H5_DLL hid_t H5F_get_file_id(const H5F_t *f); +H5_DLL H5F_t *H5F_get_parent(const H5F_t *f); +H5_DLL unsigned H5F_get_nmounts(const H5F_t *f); +H5_DLL hid_t H5F_get_access_plist(H5F_t *f, hbool_t app_ref); H5_DLL hid_t H5F_get_id(H5F_t *file, hbool_t app_ref); H5_DLL size_t H5F_get_obj_count(const H5F_t *f, unsigned types, hbool_t app_ref); H5_DLL size_t H5F_get_obj_ids(const H5F_t *f, unsigned types, size_t max_objs, hid_t *obj_id_list, hbool_t app_ref); H5_DLL haddr_t H5F_get_next_proxy_addr(const H5F_t *f); /* Functions than retrieve values set/cached from the superblock/FCPL */ -H5_DLL hid_t H5F_get_fcpl(const H5F_t *f); -H5_DLL uint8_t H5F_sizeof_addr(const H5F_t *f); -H5_DLL uint8_t H5F_sizeof_size(const H5F_t *f); +H5_DLL haddr_t H5F_get_base_addr(const H5F_t *f); H5_DLL unsigned H5F_sym_leaf_k(const H5F_t *f); H5_DLL unsigned H5F_Kvalue(const H5F_t *f, const struct H5B_class_t *type); +H5_DLL unsigned H5F_get_nrefs(const H5F_t *f); +H5_DLL uint8_t H5F_sizeof_addr(const H5F_t *f); +H5_DLL uint8_t H5F_sizeof_size(const H5F_t *f); +H5_DLL haddr_t H5F_get_sohm_addr(const H5F_t *f); +H5_DLL herr_t H5F_set_sohm_addr(H5F_t *f, haddr_t addr); +H5_DLL unsigned H5F_get_sohm_vers(const H5F_t *f); +H5_DLL herr_t H5F_set_sohm_vers(H5F_t *f, unsigned vers); +H5_DLL unsigned H5F_get_sohm_nindexes(const H5F_t *f); +H5_DLL herr_t H5F_set_sohm_nindexes(H5F_t *f, unsigned nindexes); +H5_DLL hid_t H5F_get_fcpl(const H5F_t *f); +H5_DLL H5F_close_degree_t H5F_get_fc_degree(const H5F_t *f); H5_DLL size_t H5F_rdcc_nbytes(const H5F_t *f); H5_DLL size_t H5F_rdcc_nslots(const H5F_t *f); H5_DLL double H5F_rdcc_w0(const H5F_t *f); -H5_DLL haddr_t H5F_get_base_addr(const H5F_t *f); -H5_DLL struct H5RC_t *H5F_grp_btree_shared(const H5F_t *f); H5_DLL size_t H5F_sieve_buf_size(const H5F_t *f); H5_DLL unsigned H5F_gc_ref(const H5F_t *f); H5_DLL hbool_t H5F_use_latest_format(const H5F_t *f); -H5_DLL H5F_close_degree_t H5F_get_fc_degree(const H5F_t *f); H5_DLL hbool_t H5F_store_msg_crt_idx(const H5F_t *f); -H5_DLL hbool_t H5F_is_tmp_addr(const H5F_t *f, haddr_t addr); +H5_DLL herr_t H5F_set_store_msg_crt_idx(H5F_t *f, hbool_t flag); +H5_DLL struct H5RC_t *H5F_grp_btree_shared(const H5F_t *f); +H5_DLL herr_t H5F_set_grp_btree_shared(H5F_t *f, struct H5RC_t *rc); H5_DLL hbool_t H5F_use_tmp_space(const H5F_t *f); +H5_DLL hbool_t H5F_is_tmp_addr(const H5F_t *f, haddr_t addr); /* Functions that retrieve values from VFD layer */ -H5_DLL hbool_t H5F_has_feature(const H5F_t *f, unsigned feature); H5_DLL hid_t H5F_get_driver_id(const H5F_t *f); H5_DLL herr_t H5F_get_fileno(const H5F_t *f, unsigned long *filenum); +H5_DLL hbool_t H5F_has_feature(const H5F_t *f, unsigned feature); H5_DLL haddr_t H5F_get_eoa(const H5F_t *f, H5FD_mem_t type); H5_DLL herr_t H5F_get_vfd_handle(const H5F_t *file, hid_t fapl, void **file_handle); -/* Functions than check file mounting information */ +/* Functions that check file mounting information */ H5_DLL hbool_t H5F_is_mount(const H5F_t *file); H5_DLL hbool_t H5F_has_mount(const H5F_t *file); +H5_DLL herr_t H5F_traverse_mount(struct H5O_loc_t *oloc/*in,out*/); /* Functions that operate on blocks of bytes wrt super block */ H5_DLL herr_t H5F_block_read(const H5F_t *f, H5FD_mem_t type, haddr_t addr, @@ -561,6 +614,13 @@ H5_DLL H5F_t *H5F_efc_open(H5F_t *parent, const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, hid_t dxpl_id); H5_DLL herr_t H5F_efc_close(H5F_t *parent, H5F_t *file); +/* Global heap CWFS routines */ +H5_DLL herr_t H5F_cwfs_add(H5F_t *f, struct H5HG_heap_t *heap); +H5_DLL herr_t H5F_cwfs_find_free_heap(H5F_t *f, hid_t dxpl_id, size_t need, haddr_t *addr); +H5_DLL herr_t H5F_cwfs_advance_heap(H5F_t *f, struct H5HG_heap_t *heap, + hbool_t add_heap); +H5_DLL herr_t H5F_cwfs_remove_heap(H5F_file_t *shared, struct H5HG_heap_t *heap); + /* Debugging functions */ H5_DLL herr_t H5F_debug(H5F_t *f, FILE * stream, int indent, int fwidth); diff --git a/src/H5Fpublic.h b/src/H5Fpublic.h index 540177b..1f0e6d6 100644 --- a/src/H5Fpublic.h +++ b/src/H5Fpublic.h @@ -139,18 +139,27 @@ typedef struct H5F_info2_t { * Types of allocation requests. The values larger than H5FD_MEM_DEFAULT * should not change other than adding new types to the end. These numbers * might appear in files. + * + * Note: please change the log VFD flavors array if you change this + * enumeration. */ typedef enum H5F_mem_t { - H5FD_MEM_NOLIST = -1, /*must be negative*/ - H5FD_MEM_DEFAULT = 0, /*must be zero*/ - H5FD_MEM_SUPER = 1, - H5FD_MEM_BTREE = 2, - H5FD_MEM_DRAW = 3, - H5FD_MEM_GHEAP = 4, - H5FD_MEM_LHEAP = 5, - H5FD_MEM_OHDR = 6, - - H5FD_MEM_NTYPES /*must be last*/ + H5FD_MEM_NOLIST = -1, /* Data should not appear in the free list. + * Must be negative. + */ + H5FD_MEM_DEFAULT = 0, /* Value not yet set. Can also be the + * datatype set in a larger allocation + * that will be suballocated by the library. + * Must be zero. + */ + H5FD_MEM_SUPER = 1, /* Superblock data */ + H5FD_MEM_BTREE = 2, /* B-tree data */ + H5FD_MEM_DRAW = 3, /* Raw data (content of datasets, etc.) */ + H5FD_MEM_GHEAP = 4, /* Global heap data */ + H5FD_MEM_LHEAP = 5, /* Local heap data */ + H5FD_MEM_OHDR = 6, /* Object header data */ + + H5FD_MEM_NTYPES /* Sentinel value - must be last */ } H5F_mem_t; /* Free space section information */ diff --git a/src/H5Fquery.c b/src/H5Fquery.c index c5ecf6b..c04ba24 100644 --- a/src/H5Fquery.c +++ b/src/H5Fquery.c @@ -93,8 +93,8 @@ unsigned H5F_get_intent(const H5F_t *f) { - /* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5F_get_intent) + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(f); @@ -118,8 +118,8 @@ H5F_get_intent(const H5F_t *f) char * H5F_get_open_name(const H5F_t *f) { - /* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5F_get_open_name) + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(f); HDassert(f->open_name); @@ -144,8 +144,8 @@ H5F_get_open_name(const H5F_t *f) char * H5F_get_actual_name(const H5F_t *f) { - /* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5F_get_actual_name) + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(f); HDassert(f->actual_name); @@ -170,8 +170,8 @@ H5F_get_actual_name(const H5F_t *f) char * H5F_get_extpath(const H5F_t *f) { - /* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5F_get_extpath) + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(f); HDassert(f->extpath); @@ -181,6 +181,147 @@ H5F_get_extpath(const H5F_t *f) /*------------------------------------------------------------------------- + * Function: H5F_get_shared + * + * Purpose: Retrieve the file's 'shared' pointer + * + * Return: 'shared' on success/abort on failure (shouldn't fail) + * + * Programmer: Quincey Koziol, July 20, 2011 + * + *------------------------------------------------------------------------- + */ +H5F_file_t * +H5F_get_shared(const H5F_t *f) +{ + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR + + HDassert(f); + + FUNC_LEAVE_NOAPI(f->shared) +} /* end H5F_get_shared() */ + + +/*------------------------------------------------------------------------- + * Function: H5F_same_shared + * + * Purpose: Determine if two files have the same shared file pointer + * + * Return: TRUE/FALSE on success/abort on failure (shouldn't fail) + * + * Programmer: Quincey Koziol, July 19, 2011 + * + *------------------------------------------------------------------------- + */ +hbool_t +H5F_same_shared(const H5F_t *f1, const H5F_t *f2) +{ + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR + + HDassert(f1); + HDassert(f1->shared); + HDassert(f2); + HDassert(f2->shared); + + FUNC_LEAVE_NOAPI(f1->shared == f2->shared) +} /* end H5F_same_shared() */ + + +/*------------------------------------------------------------------------- + * Function: H5F_get_nopen_objs + * + * Purpose: Retrieve the file's 'nopen_objs' value + * + * Return: 'nopen_objs' on success/abort on failure (shouldn't fail) + * + * Programmer: Quincey Koziol, July 20, 2011 + * + *------------------------------------------------------------------------- + */ +unsigned +H5F_get_nopen_objs(const H5F_t *f) +{ + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR + + HDassert(f); + + FUNC_LEAVE_NOAPI(f->nopen_objs) +} /* end H5F_get_nopen_objs() */ + + +/*------------------------------------------------------------------------- + * Function: H5F_get_file_id + * + * Purpose: Retrieve the file's 'file_id' value + * + * Return: 'file_id' on success/abort on failure (shouldn't fail) + * + * Programmer: Quincey Koziol, July 20, 2011 + * + *------------------------------------------------------------------------- + */ +hid_t +H5F_get_file_id(const H5F_t *f) +{ + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR + + HDassert(f); + + FUNC_LEAVE_NOAPI(f->file_id) +} /* end H5F_get_file_id() */ + + +/*------------------------------------------------------------------------- + * Function: H5F_get_parent + * + * Purpose: Retrieve the file's 'parent' pointer + * + * Return: 'parent' on success/abort on failure (shouldn't fail) + * + * Programmer: Quincey Koziol, July 19, 2011 + * + *------------------------------------------------------------------------- + */ +H5F_t * +H5F_get_parent(const H5F_t *f) +{ + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR + + HDassert(f); + + FUNC_LEAVE_NOAPI(f->parent) +} /* end H5F_get_parent() */ + + +/*------------------------------------------------------------------------- + * Function: H5F_get_nmounts + * + * Purpose: Retrieve the file's 'nmounts' value + * + * Return: 'nmounts' on success/abort on failure (shouldn't fail) + * + * Programmer: Quincey Koziol, July 20, 2011 + * + *------------------------------------------------------------------------- + */ +unsigned +H5F_get_nmounts(const H5F_t *f) +{ + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR + + HDassert(f); + + FUNC_LEAVE_NOAPI(f->nmounts) +} /* end H5F_get_nmounts() */ + + +/*------------------------------------------------------------------------- * Function: H5F_get_fcpl * * Purpose: Retrieve the value of a file's FCPL. @@ -198,8 +339,8 @@ H5F_get_extpath(const H5F_t *f) hid_t H5F_get_fcpl(const H5F_t *f) { - /* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5F_get_fcpl) + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(f); HDassert(f->shared); @@ -225,8 +366,8 @@ H5F_get_fcpl(const H5F_t *f) uint8_t H5F_sizeof_addr(const H5F_t *f) { - /* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5F_sizeof_addr) + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(f); HDassert(f->shared); @@ -252,8 +393,8 @@ H5F_sizeof_addr(const H5F_t *f) uint8_t H5F_sizeof_size(const H5F_t *f) { - /* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5F_sizeof_size) + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(f); HDassert(f->shared); @@ -263,6 +404,78 @@ H5F_sizeof_size(const H5F_t *f) /*------------------------------------------------------------------------- + * Function: H5F_get_sohm_addr + * + * Purpose: Retrieve the file's 'sohm_addr' value + * + * Return: 'sohm_addr' on success/abort on failure (shouldn't fail) + * + * Programmer: Quincey Koziol, July 20, 2011 + * + *------------------------------------------------------------------------- + */ +haddr_t +H5F_get_sohm_addr(const H5F_t *f) +{ + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR + + HDassert(f); + HDassert(f->shared); + + FUNC_LEAVE_NOAPI(f->shared->sohm_addr) +} /* end H5F_get_sohm_addr() */ + + +/*------------------------------------------------------------------------- + * Function: H5F_get_sohm_vers + * + * Purpose: Retrieve the file's 'sohm_vers' value + * + * Return: 'sohm_vers' on success/abort on failure (shouldn't fail) + * + * Programmer: Quincey Koziol, July 20, 2011 + * + *------------------------------------------------------------------------- + */ +unsigned +H5F_get_sohm_vers(const H5F_t *f) +{ + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR + + HDassert(f); + HDassert(f->shared); + + FUNC_LEAVE_NOAPI(f->shared->sohm_vers) +} /* end H5F_get_sohm_vers() */ + + +/*------------------------------------------------------------------------- + * Function: H5F_get_sohm_nindexes + * + * Purpose: Retrieve the file's 'sohm_nindexes' value + * + * Return: 'sohm_nindexes' on success/abort on failure (shouldn't fail) + * + * Programmer: Quincey Koziol, July 20, 2011 + * + *------------------------------------------------------------------------- + */ +unsigned +H5F_get_sohm_nindexes(const H5F_t *f) +{ + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR + + HDassert(f); + HDassert(f->shared); + + FUNC_LEAVE_NOAPI(f->shared->sohm_nindexes) +} /* end H5F_get_sohm_nindexes() */ + + +/*------------------------------------------------------------------------- * Function: H5F_sym_leaf_k * * Purpose: Replaced a macro to retrieve the symbol table leaf size, @@ -283,8 +496,8 @@ H5F_sizeof_size(const H5F_t *f) unsigned H5F_sym_leaf_k(const H5F_t *f) { - /* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5F_sym_leaf_k) + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(f); HDassert(f->shared); @@ -315,8 +528,8 @@ H5F_sym_leaf_k(const H5F_t *f) unsigned H5F_Kvalue(const H5F_t *f, const H5B_class_t *type) { - /* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5F_Kvalue) + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(f); HDassert(f->shared); @@ -328,6 +541,30 @@ H5F_Kvalue(const H5F_t *f, const H5B_class_t *type) /*------------------------------------------------------------------------- + * Function: H5F_get_nrefs + * + * Purpose: Retrieve the file's 'nrefs' value + * + * Return: 'nrefs' on success/abort on failure (shouldn't fail) + * + * Programmer: Quincey Koziol, July 20, 2011 + * + *------------------------------------------------------------------------- + */ +unsigned +H5F_get_nrefs(const H5F_t *f) +{ + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR + + HDassert(f); + HDassert(f->shared); + + FUNC_LEAVE_NOAPI(f->shared->nrefs) +} /* end H5F_get_nrefs() */ + + +/*------------------------------------------------------------------------- * Function: H5F_rdcc_nslots * * Purpose: Replaced a macro to retrieve the raw data cache number of slots, @@ -348,8 +585,8 @@ H5F_Kvalue(const H5F_t *f, const H5B_class_t *type) size_t H5F_rdcc_nslots(const H5F_t *f) { - /* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5F_rdcc_nslots) + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(f); HDassert(f->shared); @@ -379,8 +616,8 @@ H5F_rdcc_nslots(const H5F_t *f) size_t H5F_rdcc_nbytes(const H5F_t *f) { - /* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5F_rdcc_nbytes) + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(f); HDassert(f->shared); @@ -410,8 +647,8 @@ H5F_rdcc_nbytes(const H5F_t *f) double H5F_rdcc_w0(const H5F_t *f) { - /* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5F_rdcc_w0) + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(f); HDassert(f->shared); @@ -437,8 +674,8 @@ H5F_rdcc_w0(const H5F_t *f) haddr_t H5F_get_base_addr(const H5F_t *f) { - /* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5F_get_base_addr) + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(f); HDassert(f->shared); @@ -469,8 +706,8 @@ H5F_get_base_addr(const H5F_t *f) H5RC_t * H5F_grp_btree_shared(const H5F_t *f) { - /* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5F_grp_btree_shared) + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(f); HDassert(f->shared); @@ -500,8 +737,8 @@ H5F_grp_btree_shared(const H5F_t *f) size_t H5F_sieve_buf_size(const H5F_t *f) { - /* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5F_sieve_buf_size) + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(f); HDassert(f->shared); @@ -531,8 +768,8 @@ H5F_sieve_buf_size(const H5F_t *f) unsigned H5F_gc_ref(const H5F_t *f) { - /* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5F_gc_ref) + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(f); HDassert(f->shared); @@ -560,8 +797,8 @@ H5F_gc_ref(const H5F_t *f) hbool_t H5F_use_latest_format(const H5F_t *f) { - /* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5F_use_latest_format) + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(f); HDassert(f->shared); @@ -588,8 +825,8 @@ H5F_use_latest_format(const H5F_t *f) H5F_close_degree_t H5F_get_fc_degree(const H5F_t *f) { - /* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5F_get_fc_degree) + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(f); HDassert(f->shared); @@ -616,8 +853,8 @@ H5F_get_fc_degree(const H5F_t *f) hbool_t H5F_store_msg_crt_idx(const H5F_t *f) { - /* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5F_store_msg_crt_idx) + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(f); HDassert(f->shared); @@ -643,8 +880,8 @@ H5F_store_msg_crt_idx(const H5F_t *f) hbool_t H5F_has_feature(const H5F_t *f, unsigned feature) { - /* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5F_has_feature) + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(f); HDassert(f->shared); @@ -670,8 +907,8 @@ H5F_has_feature(const H5F_t *f, unsigned feature) hid_t H5F_get_driver_id(const H5F_t *f) { - /* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5F_get_driver_id) + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(f); HDassert(f->shared); @@ -700,7 +937,7 @@ H5F_get_fileno(const H5F_t *f, unsigned long *filenum) { herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI(H5F_get_fileno, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert(f); HDassert(f->shared); @@ -733,7 +970,7 @@ H5F_get_eoa(const H5F_t *f, H5FD_mem_t type) { haddr_t ret_value; - FUNC_ENTER_NOAPI(H5F_get_eoa, HADDR_UNDEF) + FUNC_ENTER_NOAPI(HADDR_UNDEF) HDassert(f); HDassert(f->shared); @@ -766,7 +1003,7 @@ H5F_get_vfd_handle(const H5F_t *file, hid_t fapl, void **file_handle) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5F_get_vfd_handle, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ HDassert(file); @@ -799,8 +1036,8 @@ done: hbool_t H5F_is_tmp_addr(const H5F_t *f, haddr_t addr) { - /* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5F_is_tmp_addr) + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(f); HDassert(f->shared); @@ -827,8 +1064,8 @@ H5F_is_tmp_addr(const H5F_t *f, haddr_t addr) hbool_t H5F_use_tmp_space(const H5F_t *f) { - /* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5F_use_tmp_space) + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(f); HDassert(f->shared); diff --git a/src/H5Fsfile.c b/src/H5Fsfile.c index 8144986..95e5ad2 100644 --- a/src/H5Fsfile.c +++ b/src/H5Fsfile.c @@ -58,7 +58,7 @@ H5F_sfile_node_t *H5F_sfile_head_g = NULL; herr_t H5F_sfile_assert_num(unsigned n) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5F_sfile_assert_num) + FUNC_ENTER_NOAPI_NOINIT_NOERR if(n == 0) { /* Sanity checking */ @@ -107,7 +107,7 @@ H5F_sfile_add(H5F_file_t *shared) H5F_sfile_node_t *new_shared; /* New shared file node */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5F_sfile_add) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(shared); @@ -149,7 +149,7 @@ H5F_sfile_search(H5FD_t *lf) H5F_sfile_node_t *curr; /* Current shared file node */ H5F_file_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5F_sfile_search) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ HDassert(lf); @@ -191,7 +191,7 @@ H5F_sfile_remove(H5F_file_t *shared) H5F_sfile_node_t *last; /* Last shared file node */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5F_sfile_remove) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(shared); diff --git a/src/H5Fsuper.c b/src/H5Fsuper.c index 2510487..8bf4405 100644 --- a/src/H5Fsuper.c +++ b/src/H5Fsuper.c @@ -93,7 +93,7 @@ DESCRIPTION static herr_t H5F_init_super_interface(void) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5F_init_super_interface) + FUNC_ENTER_NOAPI_NOINIT_NOERR FUNC_LEAVE_NOAPI(H5F_init()) } /* H5F_init_super_interface() */ @@ -123,7 +123,7 @@ H5F_locate_signature(H5FD_t *file, hid_t dxpl_id) unsigned n, maxpow; haddr_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5F_locate_signature) + FUNC_ENTER_NOAPI_NOINIT /* Find the least N such that 2^N is larger than the file size */ if(HADDR_UNDEF == (addr = H5FD_get_eof(file)) || HADDR_UNDEF == (eoa = H5FD_get_eoa(file, H5FD_MEM_SUPER))) @@ -180,7 +180,7 @@ H5F_super_ext_create(H5F_t *f, hid_t dxpl_id, H5O_loc_t *ext_ptr) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5F_super_ext_create) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(f); @@ -233,7 +233,7 @@ H5F_super_ext_open(H5F_t *f, haddr_t ext_addr, H5O_loc_t *ext_ptr) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5F_super_ext_open) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(f); @@ -272,7 +272,7 @@ H5F_super_ext_close(H5F_t *f, H5O_loc_t *ext_ptr, hid_t dxpl_id, { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5F_super_ext_close) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(f); @@ -327,7 +327,7 @@ H5F_super_read(H5F_t *f, hid_t dxpl_id) hbool_t dirtied = FALSE; /* Bool for sblock protect call */ herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_NOAPI_TAG(H5F_super_read, dxpl_id, H5AC__SUPERBLOCK_TAG, FAIL) + FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__SUPERBLOCK_TAG, FAIL) /* Find the superblock */ if(HADDR_UNDEF == (super_addr = H5F_locate_signature(f->shared->lf, dxpl_id))) @@ -401,7 +401,7 @@ H5F_super_init(H5F_t *f, hid_t dxpl_id) hbool_t ext_created = FALSE; /* Whether the extension has been created */ herr_t ret_value = SUCCEED; /* Return Value */ - FUNC_ENTER_NOAPI_TAG(H5F_super_init, dxpl_id, H5AC__SUPERBLOCK_TAG, FAIL) + FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__SUPERBLOCK_TAG, FAIL) /* Allocate space for the superblock */ if(NULL == (sblock = H5FL_CALLOC(H5F_super_t))) @@ -681,7 +681,7 @@ H5F_super_dirty(H5F_t *f) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5F_super_dirty, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ HDassert(f); @@ -713,7 +713,7 @@ done: herr_t H5F_super_free(H5F_super_t *sblock) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5F_super_free) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ HDassert(sblock); @@ -746,7 +746,7 @@ H5F_super_size(H5F_t *f, hid_t dxpl_id, hsize_t *super_size, hsize_t *super_ext_ { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5F_super_size, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ HDassert(f); @@ -805,7 +805,7 @@ H5F_super_ext_write_msg(H5F_t *f, hid_t dxpl_id, void *mesg, unsigned id, hbool_ htri_t status; /* Indicate whether the message exists or not */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5F_super_ext_write_msg, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ HDassert(f); @@ -881,7 +881,7 @@ H5F_super_ext_remove_msg(H5F_t *f, hid_t dxpl_id, unsigned id) htri_t status; /* Indicate whether the message exists or not */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5F_super_ext_remove_msg, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Make sure that the superblock extension object header exists */ HDassert(H5F_addr_defined(f->shared->sblock->ext_addr)); diff --git a/src/H5Fsuper_cache.c b/src/H5Fsuper_cache.c index 946fcad..29139d5 100644 --- a/src/H5Fsuper_cache.c +++ b/src/H5Fsuper_cache.c @@ -130,7 +130,7 @@ H5F_sblock_load(H5F_t *f, hid_t dxpl_id, haddr_t UNUSED addr, void *_udata) hbool_t *dirtied = (hbool_t *)_udata; /* Set up dirtied out value */ H5F_super_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5F_sblock_load) + FUNC_ENTER_NOAPI_NOINIT /* check arguments */ HDassert(f); @@ -474,7 +474,7 @@ H5F_sblock_load(H5F_t *f, hid_t dxpl_id, haddr_t UNUSED addr, void *_udata) /* (Account for the stored EOA being absolute offset -QAK) */ if((eof + sblock->base_addr) < stored_eoa) - HGOTO_ERROR(H5E_FILE, H5E_TRUNCATED, NULL, "truncated file") + HGOTO_ERROR(H5E_FILE, H5E_TRUNCATED, NULL, "truncated file: eof = %llu, sblock->base_addr = %llu, stored_eoa = %llu", (unsigned long long)eof, (unsigned long long)sblock->base_addr, (unsigned long long)stored_eoa) } /* end if */ /* @@ -638,7 +638,7 @@ H5F_sblock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t UNUSED addr, { herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT(H5F_sblock_flush) + FUNC_ENTER_NOAPI_NOINIT /* check arguments */ HDassert(f); @@ -836,7 +836,7 @@ H5F_sblock_dest(H5F_t UNUSED *f, H5F_super_t* sblock) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5F_sblock_dest) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(sblock); @@ -867,7 +867,7 @@ H5F_sblock_clear(H5F_t *f, H5F_super_t *sblock, hbool_t destroy) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5F_sblock_clear) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -901,7 +901,7 @@ done: static herr_t H5F_sblock_size(const H5F_t *f, const H5F_super_t *sblock, size_t *size_ptr) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5F_sblock_size) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check arguments */ HDassert(f); diff --git a/src/H5Ftest.c b/src/H5Ftest.c index e2ee606..73b00a6 100644 --- a/src/H5Ftest.c +++ b/src/H5Ftest.c @@ -102,7 +102,7 @@ H5F_get_sohm_mesg_count_test(hid_t file_id, unsigned type_id, H5F_t *file; /* File info */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5F_get_sohm_mesg_count_test) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments */ if(NULL == (file = (H5F_t *)H5I_object_verify(file_id, H5I_FILE))) @@ -139,14 +139,14 @@ 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) + FUNC_ENTER_NOAPI_NOINIT /* 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->sblock->root_ent) < 0) + if(H5G__verify_cached_stab_test(H5G_oloc(file->shared->root_grp), file->shared->sblock->root_ent) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to verify cached symbol table info") done: @@ -173,7 +173,7 @@ H5F_get_maxaddr_test(hid_t file_id, haddr_t *maxaddr) H5F_t *file; /* File info */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5F_get_maxaddr_test) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments */ if(NULL == (file = (H5F_t *)H5I_object_verify(file_id, H5I_FILE))) diff --git a/src/H5G.c b/src/H5G.c index 020c8fa..0d7d023 100644 --- a/src/H5G.c +++ b/src/H5G.c @@ -75,72 +75,163 @@ *------------------------------------------------------------------------- */ -#define H5F_PACKAGE /*suppress error about including H5Fpkg */ +/****************/ +/* Module Setup */ +/****************/ + #define H5G_PACKAGE /*suppress error about including H5Gpkg */ /* Interface initialization */ #define H5_INTERFACE_INIT_FUNC H5G_init_interface -/* Packages needed by this file... */ + +/***********/ +/* Headers */ +/***********/ #include "H5private.h" /* Generic Functions */ #include "H5ACprivate.h" /* Metadata cache */ #include "H5Eprivate.h" /* Error handling */ -#include "H5Fpkg.h" /* File access */ #include "H5Gpkg.h" /* Groups */ #include "H5Iprivate.h" /* IDs */ -#include "H5Lprivate.h" /* Links */ -#include "H5MMprivate.h" /* Memory management */ #include "H5Pprivate.h" /* Property lists */ -/* Local macros */ + +/****************/ +/* Local Macros */ +/****************/ + #define H5G_RESERVED_ATOMS 0 -/* Local typedefs */ -/* User data for path traversal routine for "insertion file" routine */ -typedef struct { - H5G_loc_t *loc; /* Pointer to the location for insertion */ -} H5G_trav_ins_t; +/******************/ +/* Local Typedefs */ +/******************/ + + +/********************/ +/* Package Typedefs */ +/********************/ + + +/********************/ +/* Local Prototypes */ +/********************/ + + +/*********************/ +/* Package Variables */ +/*********************/ + + +/*****************************/ +/* Library Private Variables */ +/*****************************/ + + +/*******************/ +/* Local Variables */ +/*******************/ + + + +/*------------------------------------------------------------------------- + * Function: H5G__init + * + * Purpose: Initialize the interface from some other package. + * + * Return: Success: non-negative + * Failure: negative + * + * Programmer: Quincey Koziol + * Saturday, November 11, 2006 + * + *------------------------------------------------------------------------- + */ +herr_t +H5G__init(void) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + /* FUNC_ENTER() does all the work */ -/* User data for application-style iteration over links in a group */ -typedef struct { - hid_t gid; /* The group ID for the application callback */ - H5G_link_iterate_t lnk_op; /* Application callback */ - void *op_data; /* Application's op data */ -} H5G_iter_appcall_ud_t; +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5G__init() */ -/* User data for recursive traversal over links from a group */ -typedef struct { - hid_t gid; /* The group ID for the starting group */ - H5G_loc_t *curr_loc; /* Location of starting group */ - hid_t lapl_id; /* LAPL for walking across links */ - hid_t dxpl_id; /* DXPL for operations */ - H5_index_t idx_type; /* Index to use */ - H5_iter_order_t order; /* Iteration order within index */ - H5SL_t *visited; /* Skip list for tracking visited nodes */ - char *path; /* Path name of the link */ - size_t curr_path_len; /* Current length of the path in the buffer */ - size_t path_buf_size; /* Size of path buffer */ - H5L_iterate_t op; /* Application callback */ - void *op_data; /* Application's op data */ -} H5G_iter_visit_ud_t; + +/*------------------------------------------------------------------------- + * Function: H5G_init_interface + * + * Purpose: Initializes the H5G interface. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Robb Matzke + * Monday, January 5, 1998 + * + * Notes: The group creation properties are registered in the property + * list interface initialization routine (H5P_init_interface) + * so that the file creation property class can inherit from it + * correctly. (Which allows the file creation property list to + * control the group creation properties of the root group of + * a file) QAK - 24/10/2005 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5G_init_interface(void) +{ + herr_t ret_value = SUCCEED; /* Return value */ + FUNC_ENTER_NOAPI_NOINIT -/* Package variables */ + /* Initialize the atom group for the group IDs */ + if(H5I_register_type(H5I_GROUP, (size_t)H5I_GROUPID_HASHSIZE, H5G_RESERVED_ATOMS, (H5I_free_t)H5G_close) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to initialize interface") +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5G_init_interface() */ -/* Local variables */ + +/*------------------------------------------------------------------------- + * Function: H5G_term_interface + * + * Purpose: Terminates the H5G interface + * + * Return: Success: Positive if anything is done that might + * affect other interfaces; zero otherwise. + * + * Failure: Negative. + * + * Programmer: Robb Matzke + * Monday, January 5, 1998 + * + *------------------------------------------------------------------------- + */ +int +H5G_term_interface(void) +{ + int n = 0; -/* Declare a free list to manage the H5G_t struct */ -H5FL_DEFINE(H5G_t); -H5FL_DEFINE(H5G_shared_t); + FUNC_ENTER_NOAPI_NOINIT_NOERR -/* Declare the free list to manage H5_obj_t's */ -H5FL_DEFINE(H5_obj_t); + if(H5_interface_initialize_g) { + if((n = H5I_nmembers(H5I_GROUP))) + H5I_clear_type(H5I_GROUP, FALSE, FALSE); + else { + /* Destroy the group object id group */ + H5I_dec_type_ref(H5I_GROUP); + /* Mark closed */ + H5_interface_initialize_g = 0; + n = 1; /*H5I*/ + } /* end else */ + } /* end if */ -/* Private prototypes */ -static herr_t H5G_open_oid(H5G_t *grp, hid_t dxpl_id); + FUNC_LEAVE_NOAPI(n) +} /* end H5G_term_interface() */ /*------------------------------------------------------------------------- @@ -177,7 +268,7 @@ H5Gcreate2(hid_t loc_id, const char *name, hid_t lcpl_id, hid_t gcpl_id, H5G_t *grp = NULL; /* New group created */ hid_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Gcreate2, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE5("i", "i*siii", loc_id, name, lcpl_id, gcpl_id, gapl_id); /* Check arguments */ @@ -208,7 +299,7 @@ H5Gcreate2(hid_t loc_id, const char *name, hid_t lcpl_id, hid_t gcpl_id, HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not group access property list") /* Create the new group & get its ID */ - if(NULL == (grp = H5G_create_named(&loc, name, lcpl_id, gcpl_id, gapl_id, H5AC_dxpl_id))) + if(NULL == (grp = H5G__create_named(&loc, name, lcpl_id, gcpl_id, gapl_id, H5AC_dxpl_id))) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create group") if((ret_value = H5I_register(H5I_GROUP, grp, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register group") @@ -223,61 +314,6 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_create_named - * - * Purpose: Internal routine to create a new "named" group. - * - * Return: Success: Non-NULL, pointer to new group object. - * - * Failure: NULL - * - * Programmer: Quincey Koziol - * April 5, 2007 - * - *------------------------------------------------------------------------- - */ -H5G_t * -H5G_create_named(const H5G_loc_t *loc, const char *name, hid_t lcpl_id, - hid_t gcpl_id, hid_t gapl_id, hid_t dxpl_id) -{ - H5O_obj_create_t ocrt_info; /* Information for object creation */ - H5G_obj_create_t gcrt_info; /* Information for group creation */ - H5G_t *ret_value; /* Return value */ - - FUNC_ENTER_NOAPI(H5G_create_named, NULL) - - /* Check arguments */ - HDassert(loc); - HDassert(name && *name); - HDassert(lcpl_id != H5P_DEFAULT); - HDassert(gcpl_id != H5P_DEFAULT); - HDassert(gapl_id != H5P_DEFAULT); - HDassert(dxpl_id != H5P_DEFAULT); - - /* Set up group creation info */ - gcrt_info.gcpl_id = gcpl_id; - gcrt_info.cache_type = H5G_NOTHING_CACHED; - HDmemset(&gcrt_info.cache, 0, sizeof(gcrt_info.cache)); - - /* Set up object creation information */ - ocrt_info.obj_type = H5O_TYPE_GROUP; - ocrt_info.crt_info = &gcrt_info; - ocrt_info.new_obj = NULL; - - /* Create the new group and link it to its parent group */ - if(H5L_link_object(loc, name, &ocrt_info, lcpl_id, gapl_id, dxpl_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, NULL, "unable to create and link to group") - HDassert(ocrt_info.new_obj); - - /* Set the return value */ - ret_value = (H5G_t *)ocrt_info.new_obj; - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_create_named() */ - - -/*------------------------------------------------------------------------- * Function: H5Gcreate_anon * * Purpose: Creates a new group relative to LOC_ID, giving it the @@ -320,7 +356,7 @@ H5Gcreate_anon(hid_t loc_id, hid_t gcpl_id, hid_t gapl_id) H5G_obj_create_t gcrt_info; /* Information for group creation */ hid_t ret_value; - FUNC_ENTER_API(H5Gcreate_anon, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("i", "iii", loc_id, gcpl_id, gapl_id); /* Check arguments */ @@ -347,7 +383,7 @@ H5Gcreate_anon(hid_t loc_id, hid_t gcpl_id, hid_t gapl_id) HDmemset(&gcrt_info.cache, 0, sizeof(gcrt_info.cache)); /* Create the new group & get its ID */ - if(NULL == (grp = H5G_create(loc.oloc->file, &gcrt_info, H5AC_dxpl_id))) + if(NULL == (grp = H5G__create(loc.oloc->file, &gcrt_info, H5AC_dxpl_id))) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create group") if((ret_value = H5I_register(H5I_GROUP, grp, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register group") @@ -399,7 +435,7 @@ H5Gopen2(hid_t loc_id, const char *name, hid_t gapl_id) H5G_loc_t loc; /* Location of parent for group */ hid_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Gopen2, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("i", "i*si", loc_id, name, gapl_id); /* Check args */ @@ -416,7 +452,7 @@ H5Gopen2(hid_t loc_id, const char *name, hid_t gapl_id) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not group access property list") /* Open the group */ - if((grp = H5G_open_name(&loc, name, gapl_id, H5AC_dxpl_id)) == NULL) + if((grp = H5G__open_name(&loc, name, gapl_id, H5AC_dxpl_id)) == NULL) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open group") /* Register an ID for the group */ @@ -462,7 +498,7 @@ H5Gget_create_plist(hid_t group_id) hid_t new_gcpl_id = FAIL; hid_t ret_value = FAIL; - FUNC_ENTER_API(H5Gget_create_plist, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("i", "i", group_id); /* Check args */ @@ -497,7 +533,7 @@ H5Gget_create_plist(hid_t group_id) } /* end if */ /* Check for the group having a link info message */ - if((linfo_exists = H5G_obj_get_linfo(&(grp->oloc), &linfo, H5AC_ind_dxpl_id)) < 0) + if((linfo_exists = H5G__obj_get_linfo(&(grp->oloc), &linfo, H5AC_ind_dxpl_id)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to read object header") if(linfo_exists) { /* Set the link info for the property list */ @@ -554,7 +590,7 @@ H5Gget_info(hid_t grp_id, H5G_info_t *grp_info) H5G_loc_t loc; /* Location of group */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Gget_info, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*x", grp_id, grp_info); /* Check args */ @@ -569,7 +605,7 @@ H5Gget_info(hid_t grp_id, H5G_info_t *grp_info) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") /* Retrieve the group's information */ - if(H5G_obj_info(loc.oloc, grp_info/*out*/, H5AC_ind_dxpl_id) < 0) + if(H5G__obj_info(loc.oloc, grp_info/*out*/, H5AC_ind_dxpl_id) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't retrieve group info") done: @@ -601,7 +637,7 @@ H5Gget_info_by_name(hid_t loc_id, const char *name, H5G_info_t *grp_info, hbool_t loc_found = FALSE; /* Location at 'name' found */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Gget_info_by_name, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE4("e", "i*s*xi", loc_id, name, grp_info, lapl_id); /* Check args */ @@ -628,7 +664,7 @@ H5Gget_info_by_name(hid_t loc_id, const char *name, H5G_info_t *grp_info, loc_found = TRUE; /* Retrieve the group's information */ - if(H5G_obj_info(grp_loc.oloc, grp_info/*out*/, H5AC_ind_dxpl_id) < 0) + if(H5G__obj_info(grp_loc.oloc, grp_info/*out*/, H5AC_ind_dxpl_id) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't retrieve group info") done: @@ -664,7 +700,7 @@ H5Gget_info_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, hbool_t loc_found = FALSE; /* Entry at 'name' found */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Gget_info_by_idx, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE7("e", "i*sIiIoh*xi", loc_id, group_name, idx_type, order, n, grp_info, lapl_id); @@ -696,7 +732,7 @@ H5Gget_info_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, loc_found = TRUE; /* Retrieve the group's information */ - if(H5G_obj_info(grp_loc.oloc, grp_info/*out*/, H5AC_ind_dxpl_id) < 0) + if(H5G__obj_info(grp_loc.oloc, grp_info/*out*/, H5AC_ind_dxpl_id) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't retrieve group info") done: @@ -726,7 +762,7 @@ H5Gclose(hid_t group_id) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Gclose, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", group_id); /* Check args */ @@ -744,1096 +780,6 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Gclose() */ -/* - *------------------------------------------------------------------------- - *------------------------------------------------------------------------- - * N O A P I F U N C T I O N S B E Y O N D T H I S P O I N T - *------------------------------------------------------------------------- - *------------------------------------------------------------------------- - */ - - -/*------------------------------------------------------------------------- - * Function: H5G_init - * - * Purpose: Initialize the interface from some other package. - * - * Return: Success: non-negative - * Failure: negative - * - * Programmer: Quincey Koziol - * Saturday, November 11, 2006 - * - *------------------------------------------------------------------------- - */ -herr_t -H5G_init(void) -{ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5G_init, FAIL) - /* FUNC_ENTER() does all the work */ - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_init() */ - - -/*------------------------------------------------------------------------- - * Function: H5G_init_interface - * - * Purpose: Initializes the H5G interface. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Robb Matzke - * Monday, January 5, 1998 - * - * Notes: The group creation properties are registered in the property - * list interface initialization routine (H5P_init_interface) - * so that the file creation property class can inherit from it - * correctly. (Which allows the file creation property list to - * control the group creation properties of the root group of - * a file) QAK - 24/10/2005 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5G_init_interface(void) -{ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI_NOINIT(H5G_init_interface) - - /* Initialize the atom group for the group IDs */ - if(H5I_register_type(H5I_GROUP, (size_t)H5I_GROUPID_HASHSIZE, H5G_RESERVED_ATOMS, (H5I_free_t)H5G_close) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to initialize interface") - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_init_interface() */ - - -/*------------------------------------------------------------------------- - * Function: H5G_term_interface - * - * Purpose: Terminates the H5G interface - * - * Return: Success: Positive if anything is done that might - * affect other interfaces; zero otherwise. - * - * Failure: Negative. - * - * Programmer: Robb Matzke - * Monday, January 5, 1998 - * - *------------------------------------------------------------------------- - */ -int -H5G_term_interface(void) -{ - int n = 0; - - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_term_interface) - - if(H5_interface_initialize_g) { - if((n = H5I_nmembers(H5I_GROUP))) - H5I_clear_type(H5I_GROUP, FALSE, FALSE); - else { - /* Destroy the group object id group */ - H5I_dec_type_ref(H5I_GROUP); - - /* Mark closed */ - H5_interface_initialize_g = 0; - n = 1; /*H5I*/ - } /* end else */ - } /* end if */ - - FUNC_LEAVE_NOAPI(n) -} /* end H5G_term_interface() */ - - -/*------------------------------------------------------------------------- - * Function: H5G_create - * - * Purpose: Creates a new empty group with the specified name. The name - * is either an absolute name or is relative to LOC. - * - * Return: Success: A handle for the group. The group is opened - * and should eventually be close by calling - * H5G_close(). - * - * Failure: NULL - * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Aug 11 1997 - * - *------------------------------------------------------------------------- - */ -H5G_t * -H5G_create(H5F_t *file, H5G_obj_create_t *gcrt_info, hid_t dxpl_id) -{ - H5G_t *grp = NULL; /*new group */ - unsigned oloc_init = 0; /* Flag to indicate that the group object location was created successfully */ - H5G_t *ret_value; /* Return value */ - - FUNC_ENTER_NOAPI_NOINIT(H5G_create) - - /* check args */ - HDassert(file); - HDassert(gcrt_info->gcpl_id != H5P_DEFAULT); - HDassert(dxpl_id != H5P_DEFAULT); - - /* create an open group */ - if(NULL == (grp = H5FL_CALLOC(H5G_t))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") - if(NULL == (grp->shared = H5FL_CALLOC(H5G_shared_t))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") - - /* Create the group object header */ - if(H5G_obj_create(file, dxpl_id, gcrt_info, &(grp->oloc)/*out*/) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, NULL, "unable to create group object header") - oloc_init = 1; /* Indicate that the object location information is valid */ - - /* Add group to list of open objects in file */ - if(H5FO_top_incr(grp->oloc.file, grp->oloc.addr) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINC, NULL, "can't incr object ref. count") - if(H5FO_insert(grp->oloc.file, grp->oloc.addr, grp->shared, TRUE) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, NULL, "can't insert group into list of open objects") - - /* Set the count of times the object is opened */ - grp->shared->fo_count = 1; - - /* Set return value */ - ret_value = grp; - -done: - if(ret_value == NULL) { - /* Check if we need to release the file-oriented symbol table info */ - if(oloc_init) { - if(H5O_dec_rc_by_loc(&(grp->oloc), dxpl_id) < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTDEC, NULL, "unable to decrement refcount on newly created object") - if(H5O_close(&(grp->oloc)) < 0) - HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, NULL, "unable to release object header") - if(H5O_delete(file, dxpl_id, grp->oloc.addr) < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTDELETE, NULL, "unable to delete object header") - } /* end if */ - if(grp != NULL) { - if(grp->shared != NULL) - grp->shared = H5FL_FREE(H5G_shared_t, grp->shared); - grp = H5FL_FREE(H5G_t, grp); - } /* end if */ - } /* end if */ - - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_create() */ - - -/*------------------------------------------------------------------------- - * Function: H5G_open_name - * - * Purpose: Opens an existing group by name. - * - * Return: Success: Ptr to a new group. - * Failure: NULL - * - * Programmer: Quincey Koziol - * Monday, August 27, 2007 - * - *------------------------------------------------------------------------- - */ -H5G_t * -H5G_open_name(const H5G_loc_t *loc, const char *name, hid_t gapl_id, - hid_t dxpl_id) -{ - H5G_t *grp = NULL; /* Group to open */ - H5G_loc_t grp_loc; /* Location used to open group */ - H5G_name_t grp_path; /* Opened object group hier. path */ - H5O_loc_t grp_oloc; /* Opened object object location */ - hbool_t loc_found = FALSE; /* Location at 'name' found */ - H5O_type_t obj_type; /* Type of object at location */ - H5G_t *ret_value; /* Return value */ - - FUNC_ENTER_NOAPI(H5G_open_name, NULL) - - /* Check args */ - HDassert(loc); - HDassert(name); - - /* Set up opened group location to fill in */ - grp_loc.oloc = &grp_oloc; - grp_loc.path = &grp_path; - H5G_loc_reset(&grp_loc); - - /* Find the group object using the gapl passed in */ - if(H5G_loc_find(loc, name, &grp_loc/*out*/, gapl_id, dxpl_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, NULL, "group not found") - loc_found = TRUE; - - /* Check that the object found is the correct type */ - if(H5O_obj_type(&grp_oloc, &obj_type, dxpl_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTGET, NULL, "can't get object type") - if(obj_type != H5O_TYPE_GROUP) - HGOTO_ERROR(H5E_SYM, H5E_BADTYPE, NULL, "not a group") - - /* Open the group */ - if((grp = H5G_open(&grp_loc, dxpl_id)) == NULL) - HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, NULL, "unable to open group") - - /* Set return value */ - ret_value = grp; - -done: - if(!ret_value) { - if(loc_found && H5G_loc_free(&grp_loc) < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRELEASE, NULL, "can't free location") - } /* end if */ - - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_open_name() */ - - -/*------------------------------------------------------------------------- - * Function: H5G_open - * - * Purpose: Opens an existing group. The group should eventually be - * closed by calling H5G_close(). - * - * Return: Success: Ptr to a new group. - * - * Failure: NULL - * - * Programmer: Robb Matzke - * Monday, January 5, 1998 - * - *------------------------------------------------------------------------- - */ -H5G_t * -H5G_open(const H5G_loc_t *loc, hid_t dxpl_id) -{ - H5G_t *grp = NULL; /* Group opened */ - H5G_shared_t *shared_fo; /* Shared group object */ - H5G_t *ret_value; /* Return value */ - - FUNC_ENTER_NOAPI(H5G_open, NULL) - - /* Check args */ - HDassert(loc); - - /* Allocate the group structure */ - if(NULL == (grp = H5FL_CALLOC(H5G_t))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate space for group") - - /* Shallow copy (take ownership) of the group location object */ - if(H5O_loc_copy(&(grp->oloc), loc->oloc, H5_COPY_SHALLOW) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTCOPY, NULL, "can't copy object location") - if(H5G_name_copy(&(grp->path), loc->path, H5_COPY_SHALLOW) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTCOPY, NULL, "can't copy path") - - /* Check if group was already open */ - if((shared_fo = (H5G_shared_t *)H5FO_opened(grp->oloc.file, grp->oloc.addr)) == NULL) { - - /* Clear any errors from H5FO_opened() */ - H5E_clear_stack(NULL); - - /* Open the group object */ - if(H5G_open_oid(grp, dxpl_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, NULL, "not found") - - /* Add group to list of open objects in file */ - if(H5FO_insert(grp->oloc.file, grp->oloc.addr, grp->shared, FALSE) < 0) { - grp->shared = H5FL_FREE(H5G_shared_t, grp->shared); - HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, NULL, "can't insert group into list of open objects") - } /* end if */ - - /* Increment object count for the object in the top file */ - if(H5FO_top_incr(grp->oloc.file, grp->oloc.addr) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINC, NULL, "can't increment object count") - - /* Set open object count */ - grp->shared->fo_count = 1; - } /* end if */ - else { - /* Point to shared group info */ - grp->shared = shared_fo; - - /* Increment shared reference count */ - shared_fo->fo_count++; - - /* Check if the object has been opened through the top file yet */ - if(H5FO_top_count(grp->oloc.file, grp->oloc.addr) == 0) { - /* Open the object through this top file */ - if(H5O_open(&(grp->oloc)) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, NULL, "unable to open object header") - } /* end if */ - - /* Increment object count for the object in the top file */ - if(H5FO_top_incr(grp->oloc.file, grp->oloc.addr) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINC, NULL, "can't increment object count") - } /* end else */ - - /* Set return value */ - ret_value = grp; - -done: - if(!ret_value && grp) { - H5O_loc_free(&(grp->oloc)); - H5G_name_free(&(grp->path)); - grp = H5FL_FREE(H5G_t, grp); - } /* end if */ - - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_open() */ - - -/*------------------------------------------------------------------------- - * Function: H5G_open_oid - * - * Purpose: Opens an existing group. The group should eventually be - * closed by calling H5G_close(). - * - * Return: Success: Ptr to a new group. - * - * Failure: NULL - * - * Programmer: Quincey Koziol - * Wednesday, March 17, 1999 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5G_open_oid(H5G_t *grp, hid_t dxpl_id) -{ - hbool_t obj_opened = FALSE; - herr_t ret_value = SUCCEED; - - FUNC_ENTER_NOAPI_NOINIT(H5G_open_oid) - - /* Check args */ - HDassert(grp); - - /* Allocate the shared information for the group */ - if(NULL == (grp->shared = H5FL_CALLOC(H5G_shared_t))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") - - /* Grab the object header */ - if(H5O_open(&(grp->oloc)) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open group") - obj_opened = TRUE; - - /* Check if this object has the right message(s) to be treated as a group */ - if((H5O_msg_exists(&(grp->oloc), H5O_STAB_ID, dxpl_id) <= 0) - && (H5O_msg_exists(&(grp->oloc), H5O_LINFO_ID, dxpl_id) <= 0)) - HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "not a group") - -done: - if(ret_value < 0) { - if(obj_opened) - H5O_close(&(grp->oloc)); - if(grp->shared) - grp->shared = H5FL_FREE(H5G_shared_t, grp->shared); - } /* end if */ - - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_open_oid() */ - - -/*------------------------------------------------------------------------- - * Function: H5G_close - * - * Purpose: Closes the specified group. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Robb Matzke - * Monday, January 5, 1998 - * - *------------------------------------------------------------------------- - */ -herr_t -H5G_close(H5G_t *grp) -{ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5G_close, FAIL) - - /* Check args */ - HDassert(grp && grp->shared); - HDassert(grp->shared->fo_count > 0); - - --grp->shared->fo_count; - - if(0 == grp->shared->fo_count) { - HDassert(grp != H5G_rootof(H5G_fileof(grp))); - - /* Remove the group from the list of opened objects in the file */ - if(H5FO_top_decr(grp->oloc.file, grp->oloc.addr) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "can't decrement count for object") - if(H5FO_delete(grp->oloc.file, H5AC_dxpl_id, grp->oloc.addr) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "can't remove group from list of open objects") - if(H5O_close(&(grp->oloc)) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to close") - grp->shared = H5FL_FREE(H5G_shared_t, grp->shared); - } else { - /* Decrement the ref. count for this object in the top file */ - if(H5FO_top_decr(grp->oloc.file, grp->oloc.addr) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "can't decrement count for object") - - /* Check reference count for this object in the top file */ - if(H5FO_top_count(grp->oloc.file, grp->oloc.addr) == 0) - if(H5O_close(&(grp->oloc)) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to close") - - /* If this group is a mount point and the mount point is the last open - * reference to the group, then attempt to close down the file hierarchy - */ - if(grp->shared->mounted && grp->shared->fo_count == 1) { - /* Attempt to close down the file hierarchy */ - if(H5F_try_close(grp->oloc.file) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "problem attempting file close") - } /* end if */ - } /* end else */ - - if(H5G_name_free(&(grp->path)) < 0) { - grp = H5FL_FREE(H5G_t, grp); - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't free group entry name") - } /* end if */ - - grp = H5FL_FREE(H5G_t, grp); - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_close() */ - - -/*------------------------------------------------------------------------- - * Function: H5G_oloc - * - * Purpose: Returns a pointer to the object location for a group. - * - * Return: Success: Ptr to group entry - * Failure: NULL - * - * Programmer: Robb Matzke - * Tuesday, March 24, 1998 - * - *------------------------------------------------------------------------- - */ -H5O_loc_t * -H5G_oloc(H5G_t *grp) -{ - /* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_oloc) - - FUNC_LEAVE_NOAPI(grp ? &(grp->oloc) : NULL) -} /* end H5G_oloc() */ - - -/*------------------------------------------------------------------------- - * Function: H5G_nameof - * - * Purpose: Returns a pointer to the hier. name for a group. - * - * Return: Success: Ptr to hier. name - * Failure: NULL - * - * Programmer: Quincey Koziol - * Monday, September 12, 2005 - * - *------------------------------------------------------------------------- - */ -H5G_name_t * -H5G_nameof(H5G_t *grp) -{ - /* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_nameof) - - FUNC_LEAVE_NOAPI(grp ? &(grp->path) : NULL) -} /* end H5G_nameof() */ - - -/*------------------------------------------------------------------------- - * Function: H5G_fileof - * - * Purpose: Returns the file to which the specified group belongs. - * - * Return: Success: File pointer. - * - * Failure: NULL - * - * Programmer: Robb Matzke - * Tuesday, March 24, 1998 - * - *------------------------------------------------------------------------- - */ -H5F_t * -H5G_fileof(H5G_t *grp) -{ - /* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_fileof) - - HDassert(grp); - - FUNC_LEAVE_NOAPI(grp->oloc.file) -} /* end H5G_fileof() */ - - -/*------------------------------------------------------------------------- - * Function: H5G_get_shared_count - * - * Purpose: Queries the group object's "shared count" - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * Tuesday, July 5, 2005 - * - *------------------------------------------------------------------------- - */ -herr_t -H5G_get_shared_count(H5G_t *grp) -{ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_get_shared_count) - - /* Check args */ - HDassert(grp && grp->shared); - - FUNC_LEAVE_NOAPI(grp->shared->fo_count) -} /* end H5G_get_shared_count() */ - - -/*------------------------------------------------------------------------- - * Function: H5G_mount - * - * Purpose: Sets the 'mounted' flag for a group - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * Tuesday, July 19, 2005 - * - *------------------------------------------------------------------------- - */ -herr_t -H5G_mount(H5G_t *grp) -{ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_mount) - - /* Check args */ - HDassert(grp && grp->shared); - HDassert(grp->shared->mounted == FALSE); - - /* Set the 'mounted' flag */ - grp->shared->mounted = TRUE; - - FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5G_mount() */ - - -/*------------------------------------------------------------------------- - * Function: H5G_mounted - * - * Purpose: Retrieves the 'mounted' flag for a group - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * Tuesday, July 15, 2008 - * - *------------------------------------------------------------------------- - */ -hbool_t -H5G_mounted(H5G_t *grp) -{ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_mounted) - - /* Check args */ - HDassert(grp && grp->shared); - - FUNC_LEAVE_NOAPI(grp->shared->mounted) -} /* end H5G_mounted() */ - - -/*------------------------------------------------------------------------- - * Function: H5G_unmount - * - * Purpose: Resets the 'mounted' flag for a group - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * Tuesday, July 19, 2005 - * - *------------------------------------------------------------------------- - */ -herr_t -H5G_unmount(H5G_t *grp) -{ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_unmount) - - /* Check args */ - HDassert(grp && grp->shared); - HDassert(grp->shared->mounted == TRUE); - - /* Reset the 'mounted' flag */ - grp->shared->mounted = FALSE; - - FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5G_unmount() */ - - -/*------------------------------------------------------------------------- - * Function: H5G_iterate_cb - * - * Purpose: Callback function for iterating over links in a group - * - * Return: Success: Non-negative - * Failure: Negative - * - * Programmer: Quincey Koziol - * Oct 3, 2005 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5G_iterate_cb(const H5O_link_t *lnk, void *_udata) -{ - H5G_iter_appcall_ud_t *udata = (H5G_iter_appcall_ud_t *)_udata; /* User data for callback */ - herr_t ret_value = H5_ITER_ERROR; /* Return value */ - - FUNC_ENTER_NOAPI_NOINIT(H5G_iterate_cb) - - /* Sanity check */ - HDassert(lnk); - HDassert(udata); - - switch(udata->lnk_op.op_type) { -#ifndef H5_NO_DEPRECATED_SYMBOLS - case H5G_LINK_OP_OLD: - /* Make the old-type application callback */ - ret_value = (udata->lnk_op.op_func.op_old)(udata->gid, lnk->name, udata->op_data); - break; -#endif /* H5_NO_DEPRECATED_SYMBOLS */ - - case H5G_LINK_OP_NEW: - { - H5L_info_t info; /* Link info */ - - /* Retrieve the info for the link */ - if(H5G_link_to_info(lnk, &info) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTGET, H5_ITER_ERROR, "unable to get info for link") - - /* Make the application callback */ - ret_value = (udata->lnk_op.op_func.op_new)(udata->gid, lnk->name, &info, udata->op_data); - } - break; - - default: - HDassert(0 && "Unknown link op type?!?"); - } /* end switch */ - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_iterate_cb() */ - - -/*------------------------------------------------------------------------- - * Function: H5G_iterate - * - * Purpose: Private function for iterating over links in a group - * - * Return: Success: Non-negative - * Failure: Negative - * - * Programmer: Quincey Koziol - * Oct 3, 2005 - * - *------------------------------------------------------------------------- - */ -herr_t -H5G_iterate(hid_t loc_id, const char *group_name, - H5_index_t idx_type, H5_iter_order_t order, hsize_t skip, hsize_t *last_lnk, - const H5G_link_iterate_t *lnk_op, void *op_data, hid_t lapl_id, hid_t dxpl_id) -{ - H5G_loc_t loc; /* Location of parent for group */ - hid_t gid = -1; /* ID of group to iterate over */ - H5G_t *grp = NULL; /* Pointer to group data structure to iterate over */ - H5G_iter_appcall_ud_t udata; /* User data for callback */ - herr_t ret_value; /* Return value */ - - FUNC_ENTER_NOAPI(H5G_iterate, FAIL) - - /* Sanity check */ - HDassert(group_name); - HDassert(last_lnk); - HDassert(lnk_op && lnk_op->op_func.op_new); - - /* - * Open the group on which to operate. We also create a group ID which - * we can pass to the application-defined operator. - */ - if(H5G_loc(loc_id, &loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") - if(NULL == (grp = H5G_open_name(&loc, group_name, lapl_id, dxpl_id))) - HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open group") - if((gid = H5I_register(H5I_GROUP, grp, TRUE)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register group") - - /* Set up user data for callback */ - udata.gid = gid; - udata.lnk_op = *lnk_op; - udata.op_data = op_data; - - /* Call the real group iteration routine */ - if((ret_value = H5G_obj_iterate(&(grp->oloc), idx_type, order, skip, last_lnk, H5G_iterate_cb, &udata, dxpl_id)) < 0) - HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "error iterating over links") - -done: - /* Release the group opened */ - if(gid > 0) { - if(H5I_dec_app_ref(gid) < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "unable to close group") - } /* end if */ - else if(grp && H5G_close(grp) < 0) - HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "unable to release group") - - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_iterate() */ - - -/*------------------------------------------------------------------------- - * Function: H5G_free_visit_visited - * - * Purpose: Free the key for an object visited during a group traversal - * - * Return: Non-negative on success, negative on failure - * - * Programmer: Quincey Koziol - * Nov 4, 2007 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5G_free_visit_visited(void *item, void UNUSED *key, void UNUSED *operator_data/*in,out*/) -{ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_free_visit_visited) - - item = H5FL_FREE(H5_obj_t, item); - - FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5G_free_visit_visited() */ - - -/*------------------------------------------------------------------------- - * Function: H5G_visit_cb - * - * Purpose: Callback function for recursively visiting links from a group - * - * Return: Success: Non-negative - * Failure: Negative - * - * Programmer: Quincey Koziol - * Nov 4, 2007 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5G_visit_cb(const H5O_link_t *lnk, void *_udata) -{ - H5G_iter_visit_ud_t *udata = (H5G_iter_visit_ud_t *)_udata; /* User data for callback */ - H5L_info_t info; /* Link info */ - H5G_loc_t obj_loc; /* Location of object */ - H5G_name_t obj_path; /* Object's group hier. path */ - H5O_loc_t obj_oloc; /* Object's object location */ - hbool_t obj_found = FALSE; /* Object at 'name' found */ - size_t old_path_len = udata->curr_path_len; /* Length of path before appending this link's name */ - size_t link_name_len; /* Length of link's name */ - size_t len_needed; /* Length of path string needed */ - herr_t ret_value = H5_ITER_CONT; /* Return value */ - - FUNC_ENTER_NOAPI_NOINIT(H5G_visit_cb) - - /* Sanity check */ - HDassert(lnk); - HDassert(udata); - - /* Check if we will need more space to store this link's relative path */ - /* ("+2" is for string terminator and possible '/' for group separator later) */ - link_name_len = HDstrlen(lnk->name); - len_needed = udata->curr_path_len + link_name_len + 2; - if(len_needed > udata->path_buf_size) { - void *new_path; /* Pointer to new path buffer */ - - /* Attempt to allocate larger buffer for path */ - if(NULL == (new_path = H5MM_realloc(udata->path, len_needed))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, H5_ITER_ERROR, "can't allocate path string") - udata->path = (char *)new_path; - udata->path_buf_size = len_needed; - } /* end if */ - - /* Build the link's relative path name */ - HDassert(udata->path[old_path_len] == '\0'); - HDstrcpy(&(udata->path[old_path_len]), lnk->name); - udata->curr_path_len += link_name_len; - - /* Construct the link info from the link message */ - if(H5G_link_to_info(lnk, &info) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTGET, H5_ITER_ERROR, "unable to get info for link") - - /* Make the application callback */ - ret_value = (udata->op)(udata->gid, udata->path, &info, udata->op_data); - - /* Check for doing more work */ - if(ret_value == H5_ITER_CONT && lnk->type == H5L_TYPE_HARD) { - H5_obj_t obj_pos; /* Object "position" for this object */ - - /* Set up opened group location to fill in */ - obj_loc.oloc = &obj_oloc; - obj_loc.path = &obj_path; - H5G_loc_reset(&obj_loc); - - /* Find the object using the LAPL passed in */ - /* (Correctly handles mounted files) */ - if(H5G_loc_find(udata->curr_loc, lnk->name, &obj_loc/*out*/, udata->lapl_id, udata->dxpl_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, H5_ITER_ERROR, "object not found") - obj_found = TRUE; - - /* Construct unique "position" for this object */ - H5F_GET_FILENO(obj_oloc.file, obj_pos.fileno); - obj_pos.addr = obj_oloc.addr; - - /* Check if we've seen the object the link references before */ - if(NULL == H5SL_search(udata->visited, &obj_pos)) { - H5O_type_t otype; /* Basic object type (group, dataset, etc.) */ - unsigned rc; /* Reference count of object */ - - /* Get the object's reference count and type */ - if(H5O_get_rc_and_type(&obj_oloc, udata->dxpl_id, &rc, &otype) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTGET, H5_ITER_ERROR, "unable to get object info") - - /* If its ref count is > 1, we add it to the list of visited objects */ - /* (because it could come up again during traversal) */ - if(rc > 1) { - H5_obj_t *new_node; /* New object node for visited list */ - - /* Allocate new object "position" node */ - if((new_node = H5FL_MALLOC(H5_obj_t)) == NULL) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, H5_ITER_ERROR, "can't allocate object node") - - /* Set node information */ - *new_node = obj_pos; - - /* Add to list of visited objects */ - if(H5SL_insert(udata->visited, new_node, new_node) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, H5_ITER_ERROR, "can't insert object node into visited list") - } /* end if */ - - /* If it's a group, we recurse into it */ - if(otype == H5O_TYPE_GROUP) { - H5G_loc_t *old_loc = udata->curr_loc; /* Pointer to previous group location info */ - H5_index_t idx_type = udata->idx_type; /* Type of index to use */ - H5O_linfo_t linfo; /* Link info message */ - htri_t linfo_exists; /* Whether the link info message exists */ - - /* Add the path separator to the current path */ - HDassert(udata->path[udata->curr_path_len] == '\0'); - HDstrcpy(&(udata->path[udata->curr_path_len]), "/"); - udata->curr_path_len++; - - /* Attempt to get the link info for this group */ - if((linfo_exists = H5G_obj_get_linfo(&obj_oloc, &linfo, udata->dxpl_id)) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTGET, H5_ITER_ERROR, "can't check for link info message") - if(linfo_exists) { - /* Check for creation order tracking, if creation order index lookup requested */ - if(idx_type == H5_INDEX_CRT_ORDER) { - /* Check if creation order is tracked */ - if(!linfo.track_corder) - /* Switch to name order for this group */ - idx_type = H5_INDEX_NAME; - } /* end if */ - else - HDassert(idx_type == H5_INDEX_NAME); - } /* end if */ - else { - /* Can only perform name lookups on groups with symbol tables */ - if(idx_type != H5_INDEX_NAME) - /* Switch to name order for this group */ - idx_type = H5_INDEX_NAME; - } /* end if */ - - /* Point to this group's location info */ - udata->curr_loc = &obj_loc; - - /* Iterate over links in group */ - ret_value = H5G_obj_iterate(&obj_oloc, idx_type, udata->order, (hsize_t)0, NULL, H5G_visit_cb, udata, udata->dxpl_id); - - /* Restore location */ - udata->curr_loc = old_loc; - } /* end if */ - } /* end if */ - } /* end if */ - -done: - /* Reset path back to incoming path */ - udata->path[old_path_len] = '\0'; - udata->curr_path_len = old_path_len; - - /* Release resources */ - if(obj_found && H5G_loc_free(&obj_loc) < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRELEASE, H5_ITER_ERROR, "can't free location") - - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_visit_cb() */ - - -/*------------------------------------------------------------------------- - * Function: H5G_visit - * - * Purpose: Recursively visit all the links in a group and all - * the groups that are linked to from that group. Links within - * each group are visited according to the order within the - * specified index (unless the specified index does not exist for - * a particular group, then the "name" index is used). - * - * NOTE: Each _link_ reachable from the initial group will only be - * visited once. However, because an object may be reached from - * more than one link, the visitation may call the application's - * callback with more than one link that points to a particular - * _object_. - * - * 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. - * - * - * - * Programmer: Quincey Koziol - * November 4 2007 - * - *------------------------------------------------------------------------- - */ -herr_t -H5G_visit(hid_t loc_id, const char *group_name, H5_index_t idx_type, - H5_iter_order_t order, H5L_iterate_t op, void *op_data, hid_t lapl_id, - hid_t dxpl_id) -{ - H5G_iter_visit_ud_t udata; /* User data for callback */ - H5O_linfo_t linfo; /* Link info message */ - htri_t linfo_exists; /* Whether the link info message exists */ - hid_t gid = (-1); /* Group ID */ - H5G_t *grp = NULL; /* Group opened */ - H5G_loc_t loc; /* Location of group passed in */ - H5G_loc_t start_loc; /* Location of starting group */ - unsigned rc; /* Reference count of object */ - herr_t ret_value; /* Return value */ - - FUNC_ENTER_NOAPI(H5G_visit, FAIL) - - /* Check args */ - if(H5G_loc(loc_id, &loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") - - /* Open the group to begin visiting within */ - if((grp = H5G_open_name(&loc, group_name, lapl_id, dxpl_id)) == NULL) - HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open group") - - /* Register an ID for the starting group */ - if((gid = H5I_register(H5I_GROUP, grp, TRUE)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register group") - - /* Get the location of the starting group */ - if(H5G_loc(gid, &start_loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") - - /* Set up user data */ - udata.gid = gid; - udata.curr_loc = &start_loc; - udata.lapl_id = lapl_id; - udata.dxpl_id = dxpl_id; - udata.idx_type = idx_type; - udata.order = order; - udata.op = op; - udata.op_data = op_data; - - /* Allocate space for the path name */ - if(NULL == (udata.path = H5MM_strdup(""))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate path name buffer") - udata.path_buf_size = 1; - udata.curr_path_len = 0; - - /* Create skip list to store visited object information */ - 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 */ - if(H5O_get_rc_and_type(&grp->oloc, dxpl_id, &rc, NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to get object info") - - /* If its ref count is > 1, we add it to the list of visited objects */ - /* (because it could come up again during traversal) */ - if(rc > 1) { - H5_obj_t *obj_pos; /* New object node for visited list */ - - /* Allocate new object "position" node */ - if((obj_pos = H5FL_MALLOC(H5_obj_t)) == NULL) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate object node") - - /* Construct unique "position" for this object */ - H5F_GET_FILENO(grp->oloc.file, obj_pos->fileno); - obj_pos->addr = grp->oloc.addr; - - /* Add to list of visited objects */ - if(H5SL_insert(udata.visited, obj_pos, obj_pos) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "can't insert object node into visited list") - } /* end if */ - - /* Attempt to get the link info for this group */ - if((linfo_exists = H5G_obj_get_linfo(&(grp->oloc), &linfo, dxpl_id)) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't check for link info message") - if(linfo_exists) { - /* Check for creation order tracking, if creation order index lookup requested */ - if(idx_type == H5_INDEX_CRT_ORDER) { - /* Check if creation order is tracked */ - if(!linfo.track_corder) - /* Switch to name order for this group */ - idx_type = H5_INDEX_NAME; - } /* end if */ - else - HDassert(idx_type == H5_INDEX_NAME); - } /* end if */ - else { - /* Can only perform name lookups on groups with symbol tables */ - if(idx_type != H5_INDEX_NAME) - /* Switch to name order for this group */ - idx_type = H5_INDEX_NAME; - } /* end if */ - - /* Call the link iteration routine */ - if((ret_value = H5G_obj_iterate(&(grp->oloc), idx_type, order, (hsize_t)0, NULL, H5G_visit_cb, &udata, dxpl_id)) < 0) - HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "can't visit links") - -done: - /* Release user data resources */ - H5MM_xfree(udata.path); - if(udata.visited) - H5SL_destroy(udata.visited, H5G_free_visit_visited, NULL); - - /* Release the group opened */ - if(gid > 0) { - if(H5I_dec_app_ref(gid) < 0) - HDONE_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "unable to close group") - } /* end if */ - else if(grp && H5G_close(grp) < 0) - HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "unable to release group") - - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_visit() */ - /*------------------------------------------------------------------------- * Function: H5Gflush @@ -1853,7 +799,7 @@ H5Gflush(hid_t group_id) H5G_t *grp; /* Dataset for this operation */ herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_API(H5Gflush, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", group_id); /* Check args */ @@ -1887,7 +833,7 @@ H5Grefresh(hid_t group_id) H5G_t * grp = NULL; hid_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_API(H5Grefresh, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", group_id); /* Check args */ diff --git a/src/H5Gbtree2.c b/src/H5Gbtree2.c index 5ae9db1..a917eb4 100644 --- a/src/H5Gbtree2.c +++ b/src/H5Gbtree2.c @@ -167,7 +167,7 @@ H5G_dense_fh_name_cmp(const void *obj, size_t UNUSED obj_len, void *_udata) H5O_link_t *lnk; /* Pointer to link created from heap object */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5G_dense_fh_name_cmp) + FUNC_ENTER_NOAPI_NOINIT /* Decode link information */ if(NULL == (lnk = (H5O_link_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_LINK_ID, (const unsigned char *)obj))) @@ -209,7 +209,7 @@ H5G_dense_btree2_name_store(void *_nrecord, const void *_udata) const H5G_bt2_ud_ins_t *udata = (const H5G_bt2_ud_ins_t *)_udata; H5G_dense_bt2_name_rec_t *nrecord = (H5G_dense_bt2_name_rec_t *)_nrecord; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_dense_btree2_name_store) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Copy user information info native record */ nrecord->hash = udata->common.name_hash; @@ -240,7 +240,7 @@ H5G_dense_btree2_name_compare(const void *_bt2_udata, const void *_bt2_rec) const H5G_dense_bt2_name_rec_t *bt2_rec = (const H5G_dense_bt2_name_rec_t *)_bt2_rec; herr_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_dense_btree2_name_compare) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ HDassert(bt2_udata); @@ -310,7 +310,7 @@ H5G_dense_btree2_name_encode(uint8_t *raw, const void *_nrecord, void UNUSED *ct { const H5G_dense_bt2_name_rec_t *nrecord = (const H5G_dense_bt2_name_rec_t *)_nrecord; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_dense_btree2_name_encode) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Encode the record's fields */ UINT32ENCODE(raw, nrecord->hash) @@ -338,7 +338,7 @@ H5G_dense_btree2_name_decode(const uint8_t *raw, void *_nrecord, void UNUSED *ct { H5G_dense_bt2_name_rec_t *nrecord = (H5G_dense_bt2_name_rec_t *)_nrecord; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_dense_btree2_name_decode) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Decode the record's fields */ UINT32DECODE(raw, nrecord->hash) @@ -369,7 +369,7 @@ H5G_dense_btree2_name_debug(FILE *stream, const H5F_t UNUSED *f, hid_t UNUSED dx const H5G_dense_bt2_name_rec_t *nrecord = (const H5G_dense_bt2_name_rec_t *)_nrecord; unsigned u; /* Local index variable */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_dense_btree2_name_debug) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDfprintf(stream, "%*s%-*s {%x, ", indent, "", fwidth, "Record:", (unsigned)nrecord->hash); @@ -399,7 +399,7 @@ H5G_dense_btree2_corder_store(void *_nrecord, const void *_udata) const H5G_bt2_ud_ins_t *udata = (const H5G_bt2_ud_ins_t *)_udata; H5G_dense_bt2_corder_rec_t *nrecord = (H5G_dense_bt2_corder_rec_t *)_nrecord; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_dense_btree2_corder_store) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Copy user information info native record */ nrecord->corder = udata->common.corder; @@ -430,7 +430,7 @@ H5G_dense_btree2_corder_compare(const void *_bt2_udata, const void *_bt2_rec) const H5G_dense_bt2_corder_rec_t *bt2_rec = (const H5G_dense_bt2_corder_rec_t *)_bt2_rec; herr_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_dense_btree2_corder_compare) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ HDassert(bt2_udata); @@ -476,7 +476,7 @@ H5G_dense_btree2_corder_encode(uint8_t *raw, const void *_nrecord, void UNUSED * { const H5G_dense_bt2_corder_rec_t *nrecord = (const H5G_dense_bt2_corder_rec_t *)_nrecord; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_dense_btree2_corder_encode) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Encode the record's fields */ INT64ENCODE(raw, nrecord->corder) @@ -504,7 +504,7 @@ H5G_dense_btree2_corder_decode(const uint8_t *raw, void *_nrecord, void UNUSED * { H5G_dense_bt2_corder_rec_t *nrecord = (H5G_dense_bt2_corder_rec_t *)_nrecord; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_dense_btree2_corder_decode) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Decode the record's fields */ INT64DECODE(raw, nrecord->corder) @@ -535,7 +535,7 @@ H5G_dense_btree2_corder_debug(FILE *stream, const H5F_t UNUSED *f, hid_t UNUSED const H5G_dense_bt2_corder_rec_t *nrecord = (const H5G_dense_bt2_corder_rec_t *)_nrecord; unsigned u; /* Local index variable */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_dense_btree2_corder_debug) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDfprintf(stream, "%*s%-*s {%llu, ", indent, "", fwidth, "Record:", (unsigned long long)nrecord->corder); diff --git a/src/H5Gcache.c b/src/H5Gcache.c index ff758c4..1d2ad8b 100644 --- a/src/H5Gcache.c +++ b/src/H5Gcache.c @@ -130,7 +130,7 @@ H5G_node_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata) const uint8_t *p; H5G_node_t *ret_value; /*for error handling */ - FUNC_ENTER_NOAPI_NOINIT(H5G_node_load) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -181,7 +181,7 @@ H5G_node_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata) UINT16DECODE(p, sym->nsyms); /* entries */ - if(H5G_ent_decode_vec(f, &p, sym->entry, sym->nsyms) < 0) + if(H5G__ent_decode_vec(f, &p, sym->entry, sym->nsyms) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, NULL, "unable to decode symbol table entries") /* Set return value */ @@ -192,7 +192,7 @@ done: if(wb && H5WB_unwrap(wb) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, NULL, "can't close wrapped buffer") if(!ret_value) - if(sym && H5G_node_free(sym) < 0) + if(sym && H5G__node_free(sym) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTFREE, NULL, "unable to destroy symbol table node") FUNC_LEAVE_NOAPI(ret_value) @@ -219,7 +219,7 @@ H5G_node_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5G_node_ uint8_t node_buf[H5G_NODE_BUF_SIZE]; /* Buffer for node */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5G_node_flush) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -260,7 +260,7 @@ H5G_node_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5G_node_ UINT16ENCODE(p, sym->nsyms); /* entries */ - if(H5G_ent_encode_vec(f, &p, sym->entry, sym->nsyms) < 0) + if(H5G__ent_encode_vec(f, &p, sym->entry, sym->nsyms) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTENCODE, FAIL, "can't serialize") HDmemset(p, 0, sym->node_size - (size_t)(p - node)); @@ -307,7 +307,7 @@ H5G_node_dest(H5F_t *f, H5G_node_t *sym) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5G_node_dest) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -330,7 +330,7 @@ H5G_node_dest(H5F_t *f, H5G_node_t *sym) } /* end if */ /* Destroy symbol table node */ - if(H5G_node_free(sym) < 0) + if(H5G__node_free(sym) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTFREE, FAIL, "unable to destroy symbol table node") done: @@ -356,7 +356,7 @@ H5G_node_clear(H5F_t *f, H5G_node_t *sym, hbool_t destroy) { herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT(H5G_node_clear) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -396,7 +396,7 @@ done: static herr_t H5G_node_size(const H5F_t UNUSED *f, const H5G_node_t *sym, size_t *size_ptr) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_node_size) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* * Check arguments. diff --git a/src/H5Gcompact.c b/src/H5Gcompact.c index 26773cb..e4de283 100644 --- a/src/H5Gcompact.c +++ b/src/H5Gcompact.c @@ -89,7 +89,7 @@ H5G_compact_build_table_cb(const void *_mesg, unsigned UNUSED idx, void *_udata) H5G_iter_bt_t *udata = (H5G_iter_bt_t *)_udata; /* 'User data' passed in */ herr_t ret_value=H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5G_compact_build_table_cb) + FUNC_ENTER_NOAPI_NOINIT /* check arguments */ HDassert(lnk); @@ -128,7 +128,7 @@ H5G_compact_build_table(const H5O_loc_t *oloc, hid_t dxpl_id, const H5O_linfo_t { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5G_compact_build_table) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(oloc); @@ -159,7 +159,7 @@ H5G_compact_build_table(const H5O_loc_t *oloc, hid_t dxpl_id, const H5O_linfo_t HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "error iterating over link messages") /* Sort link table in correct iteration order */ - if(H5G_link_sort_table(ltable, idx_type, order) < 0) + if(H5G__link_sort_table(ltable, idx_type, order) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTSORT, FAIL, "error sorting link messages") } /* end if */ else @@ -171,7 +171,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_compact_insert + * Function: H5G__compact_insert * * Purpose: Insert a new symbol into the table described by GRP_ENT in * file F. The name of the new symbol is NAME and its symbol @@ -186,12 +186,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G_compact_insert(const H5O_loc_t *grp_oloc, H5O_link_t *obj_lnk, +H5G__compact_insert(const H5O_loc_t *grp_oloc, H5O_link_t *obj_lnk, hid_t dxpl_id) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5G_compact_insert, FAIL) + FUNC_ENTER_PACKAGE /* check arguments */ HDassert(grp_oloc && grp_oloc->file); @@ -203,11 +203,11 @@ H5G_compact_insert(const H5O_loc_t *grp_oloc, H5O_link_t *obj_lnk, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_compact_insert() */ +} /* end H5G__compact_insert() */ /*------------------------------------------------------------------------- - * Function: H5G_compact_get_name_by_idx + * Function: H5G__compact_get_name_by_idx * * Purpose: Returns the name of objects in the group by giving index. * @@ -220,14 +220,14 @@ done: *------------------------------------------------------------------------- */ ssize_t -H5G_compact_get_name_by_idx(H5O_loc_t *oloc, hid_t dxpl_id, +H5G__compact_get_name_by_idx(const H5O_loc_t *oloc, hid_t dxpl_id, const H5O_linfo_t *linfo, H5_index_t idx_type, H5_iter_order_t order, hsize_t idx, char* name, size_t size) { H5G_link_table_t ltable = {0, NULL}; /* Link table */ ssize_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5G_compact_get_name_by_idx, FAIL) + FUNC_ENTER_PACKAGE /* Sanity check */ HDassert(oloc); @@ -252,11 +252,11 @@ H5G_compact_get_name_by_idx(H5O_loc_t *oloc, hid_t dxpl_id, done: /* Release link table */ - if(ltable.lnks && H5G_link_release_table(<able) < 0) + if(ltable.lnks && H5G__link_release_table(<able) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTFREE, FAIL, "unable to release link table") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_compact_get_name_by_idx() */ +} /* end H5G__compact_get_name_by_idx() */ /*------------------------------------------------------------------------- @@ -280,7 +280,7 @@ H5G_compact_remove_common_cb(const void *_mesg, unsigned UNUSED idx, void *_udat H5G_iter_rm_t *udata = (H5G_iter_rm_t *)_udata; /* 'User data' passed in */ herr_t ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5G_compact_remove_common_cb) + FUNC_ENTER_NOAPI_NOINIT /* check arguments */ HDassert(lnk); @@ -289,7 +289,7 @@ H5G_compact_remove_common_cb(const void *_mesg, unsigned UNUSED idx, void *_udat /* If we've found the right link, get the object type */ if(HDstrcmp(lnk->name, udata->name) == 0) { /* Replace path names for link being removed */ - if(H5G_link_name_replace(udata->file, udata->dxpl_id, udata->grp_full_path_r, lnk) < 0) + if(H5G__link_name_replace(udata->file, udata->dxpl_id, udata->grp_full_path_r, lnk) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, H5_ITER_ERROR, "unable to get object type") /* Stop the iteration, we found the correct link */ @@ -302,7 +302,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_compact_remove + * Function: H5G__compact_remove * * Purpose: Remove NAME from links. * @@ -314,13 +314,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G_compact_remove(const H5O_loc_t *oloc, hid_t dxpl_id, H5RS_str_t *grp_full_path_r, +H5G__compact_remove(const H5O_loc_t *oloc, hid_t dxpl_id, H5RS_str_t *grp_full_path_r, const char *name) { H5G_iter_rm_t udata; /* Data to pass through OH iteration */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5G_compact_remove, FAIL) + FUNC_ENTER_PACKAGE HDassert(oloc && oloc->file); HDassert(name && *name); @@ -337,11 +337,11 @@ H5G_compact_remove(const H5O_loc_t *oloc, hid_t dxpl_id, H5RS_str_t *grp_full_pa done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_compact_remove() */ +} /* end H5G__compact_remove() */ /*------------------------------------------------------------------------- - * Function: H5G_compact_remove_by_idx + * Function: H5G__compact_remove_by_idx * * Purpose: Remove link from group, according to an index order. * @@ -353,7 +353,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G_compact_remove_by_idx(const H5O_loc_t *oloc, hid_t dxpl_id, +H5G__compact_remove_by_idx(const H5O_loc_t *oloc, hid_t dxpl_id, const H5O_linfo_t *linfo, H5RS_str_t *grp_full_path_r, H5_index_t idx_type, H5_iter_order_t order, hsize_t n) { @@ -361,7 +361,7 @@ H5G_compact_remove_by_idx(const H5O_loc_t *oloc, hid_t dxpl_id, H5G_iter_rm_t udata; /* Data to pass through OH iteration */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5G_compact_remove_by_idx, FAIL) + FUNC_ENTER_PACKAGE HDassert(oloc && oloc->file); HDassert(linfo); @@ -386,15 +386,15 @@ H5G_compact_remove_by_idx(const H5O_loc_t *oloc, hid_t dxpl_id, done: /* Release link table */ - if(ltable.lnks && H5G_link_release_table(<able) < 0) + if(ltable.lnks && H5G__link_release_table(<able) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTFREE, FAIL, "unable to release link table") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_compact_remove_by_idx() */ +} /* end H5G__compact_remove_by_idx() */ /*------------------------------------------------------------------------- - * Function: H5G_compact_iterate + * Function: H5G__compact_iterate * * Purpose: Iterate over the links in a group * @@ -406,14 +406,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G_compact_iterate(const H5O_loc_t *oloc, hid_t dxpl_id, const H5O_linfo_t *linfo, +H5G__compact_iterate(const H5O_loc_t *oloc, hid_t dxpl_id, const H5O_linfo_t *linfo, H5_index_t idx_type, H5_iter_order_t order, hsize_t skip, hsize_t *last_lnk, H5G_lib_iterate_t op, void *op_data) { H5G_link_table_t ltable = {0, NULL}; /* Link table */ herr_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5G_compact_iterate, FAIL) + FUNC_ENTER_PACKAGE /* Sanity check */ HDassert(oloc); @@ -425,16 +425,16 @@ H5G_compact_iterate(const H5O_loc_t *oloc, hid_t dxpl_id, const H5O_linfo_t *lin HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create link message table") /* Iterate over links in table */ - if((ret_value = H5G_link_iterate_table(<able, skip, last_lnk, op, op_data)) < 0) + if((ret_value = H5G__link_iterate_table(<able, skip, last_lnk, op, op_data)) < 0) HERROR(H5E_SYM, H5E_CANTNEXT, "iteration operator failed"); done: /* Release link table */ - if(ltable.lnks && H5G_link_release_table(<able) < 0) + if(ltable.lnks && H5G__link_release_table(<able) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTFREE, FAIL, "unable to release link table") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_compact_iterate() */ +} /* end H5G__compact_iterate() */ /*------------------------------------------------------------------------- @@ -458,7 +458,7 @@ H5G_compact_lookup_cb(const void *_mesg, unsigned UNUSED idx, void *_udata) H5G_iter_lkp_t *udata = (H5G_iter_lkp_t *)_udata; /* 'User data' passed in */ herr_t ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5G_compact_lookup_cb) + FUNC_ENTER_NOAPI_NOINIT /* check arguments */ HDassert(lnk); @@ -485,7 +485,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_compact_lookup + * Function: H5G__compact_lookup * * Purpose: Look up an object relative to a group, using link messages. * @@ -498,14 +498,14 @@ done: *------------------------------------------------------------------------- */ htri_t -H5G_compact_lookup(H5O_loc_t *oloc, const char *name, H5O_link_t *lnk, +H5G__compact_lookup(const H5O_loc_t *oloc, const char *name, H5O_link_t *lnk, hid_t dxpl_id) { H5G_iter_lkp_t udata; /* User data for iteration callback */ H5O_mesg_operator_t op; /* Message operator */ htri_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5G_compact_lookup, FAIL) + FUNC_ENTER_PACKAGE /* check arguments */ HDassert(lnk && oloc->file); @@ -527,11 +527,11 @@ H5G_compact_lookup(H5O_loc_t *oloc, const char *name, H5O_link_t *lnk, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_compact_lookup() */ +} /* end H5G__compact_lookup() */ /*------------------------------------------------------------------------- - * Function: H5G_compact_lookup_by_idx + * Function: H5G__compact_lookup_by_idx * * Purpose: Look up an object in a group using link messages, * according to the order of an index @@ -545,13 +545,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G_compact_lookup_by_idx(H5O_loc_t *oloc, hid_t dxpl_id, const H5O_linfo_t *linfo, +H5G__compact_lookup_by_idx(const H5O_loc_t *oloc, hid_t dxpl_id, const H5O_linfo_t *linfo, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, H5O_link_t *lnk) { H5G_link_table_t ltable = {0, NULL};/* Link table */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5G_compact_lookup_by_idx, FAIL) + FUNC_ENTER_PACKAGE /* check arguments */ HDassert(oloc && oloc->file); @@ -572,16 +572,16 @@ H5G_compact_lookup_by_idx(H5O_loc_t *oloc, hid_t dxpl_id, const H5O_linfo_t *lin done: /* Release link table */ - if(ltable.lnks && H5G_link_release_table(<able) < 0) + if(ltable.lnks && H5G__link_release_table(<able) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTFREE, FAIL, "unable to release link table") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_compact_lookup_by_idx() */ +} /* end H5G__compact_lookup_by_idx() */ #ifndef H5_NO_DEPRECATED_SYMBOLS /*------------------------------------------------------------------------- - * Function: H5G_compact_get_type_by_idx + * Function: H5G__compact_get_type_by_idx * * Purpose: Returns the type of objects in the group by giving index. * @@ -594,13 +594,13 @@ done: *------------------------------------------------------------------------- */ H5G_obj_t -H5G_compact_get_type_by_idx(H5O_loc_t *oloc, hid_t dxpl_id, const H5O_linfo_t *linfo, +H5G__compact_get_type_by_idx(H5O_loc_t *oloc, hid_t dxpl_id, const H5O_linfo_t *linfo, hsize_t idx) { H5G_link_table_t ltable = {0, NULL}; /* Link table */ H5G_obj_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5G_compact_get_type_by_idx, H5G_UNKNOWN) + FUNC_ENTER_PACKAGE /* Sanity check */ HDassert(oloc); @@ -639,10 +639,10 @@ H5G_compact_get_type_by_idx(H5O_loc_t *oloc, hid_t dxpl_id, const H5O_linfo_t *l done: /* Release link table */ - if(ltable.lnks && H5G_link_release_table(<able) < 0) + if(ltable.lnks && H5G__link_release_table(<able) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTFREE, H5G_UNKNOWN, "unable to release link table") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_compact_get_type_by_idx() */ +} /* end H5G__compact_get_type_by_idx() */ #endif /* H5_NO_DEPRECATED_SYMBOLS */ diff --git a/src/H5Gdense.c b/src/H5Gdense.c index 0bb29d5..841b4d3 100644 --- a/src/H5Gdense.c +++ b/src/H5Gdense.c @@ -254,7 +254,7 @@ typedef struct { /*------------------------------------------------------------------------- - * Function: H5G_dense_create + * Function: H5G__dense_create * * Purpose: Creates dense link storage structures for a group * @@ -267,7 +267,7 @@ typedef struct { *------------------------------------------------------------------------- */ herr_t -H5G_dense_create(H5F_t *f, hid_t dxpl_id, H5O_linfo_t *linfo, +H5G__dense_create(H5F_t *f, hid_t dxpl_id, H5O_linfo_t *linfo, const H5O_pline_t *pline) { H5HF_create_t fheap_cparam; /* Fractal heap creation parameters */ @@ -278,7 +278,7 @@ H5G_dense_create(H5F_t *f, hid_t dxpl_id, H5O_linfo_t *linfo, size_t fheap_id_len; /* Fractal heap ID length */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5G_dense_create, FAIL) + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -367,11 +367,11 @@ done: HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for creation order index") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_dense_create() */ +} /* end H5G__dense_create() */ /*------------------------------------------------------------------------- - * Function: H5G_dense_insert + * Function: H5G__dense_insert * * Purpose: Insert a link into the dense link storage structures for a group * @@ -384,7 +384,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G_dense_insert(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, +H5G__dense_insert(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, const H5O_link_t *lnk) { H5G_bt2_ud_ins_t udata; /* User data for v2 B-tree insertion */ @@ -397,7 +397,7 @@ H5G_dense_insert(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, void *link_ptr = NULL; /* Pointer to serialized link */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5G_dense_insert, FAIL) + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -480,7 +480,7 @@ done: HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "can't close wrapped buffer") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_dense_insert() */ +} /* end H5G__dense_insert() */ /*------------------------------------------------------------------------- @@ -503,7 +503,7 @@ H5G_dense_lookup_cb(const void *_lnk, void *_user_lnk) H5O_link_t *user_lnk = (H5O_link_t *)_user_lnk; /* User data from v2 B-tree link lookup */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5G_dense_lookup_cb) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -521,7 +521,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_dense_lookup + * Function: H5G__dense_lookup * * Purpose: Look up a link within a group that uses dense link storage * @@ -534,7 +534,7 @@ done: *------------------------------------------------------------------------- */ htri_t -H5G_dense_lookup(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, +H5G__dense_lookup(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, const char *name, H5O_link_t *lnk) { H5G_bt2_ud_common_t udata; /* User data for v2 B-tree link lookup */ @@ -542,7 +542,7 @@ H5G_dense_lookup(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, H5B2_t *bt2_name = NULL; /* v2 B-tree handle for name index */ htri_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5G_dense_lookup, FAIL) + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -581,7 +581,7 @@ done: HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for name index") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_dense_lookup() */ +} /* end H5G__dense_lookup() */ /*------------------------------------------------------------------------- @@ -605,7 +605,7 @@ H5G_dense_lookup_by_idx_fh_cb(const void *obj, size_t UNUSED obj_len, void *_uda H5O_link_t *tmp_lnk = NULL; /* Temporary pointer to link */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5G_dense_lookup_by_idx_fh_cb) + FUNC_ENTER_NOAPI_NOINIT /* Decode link information & keep a copy */ if(NULL == (tmp_lnk = (H5O_link_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_LINK_ID, (const unsigned char *)obj))) @@ -645,7 +645,7 @@ H5G_dense_lookup_by_idx_bt2_cb(const void *_record, void *_bt2_udata) H5G_fh_ud_lbi_t fh_udata; /* User data for fractal heap 'op' callback */ int ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5G_dense_lookup_by_idx_bt2_cb) + FUNC_ENTER_NOAPI_NOINIT /* Prepare user data for callback */ /* down */ @@ -664,7 +664,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_dense_lookup_by_idx + * Function: H5G__dense_lookup_by_idx * * Purpose: Look up a link within a group that uses dense link storage, * according to the order of an index @@ -678,7 +678,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G_dense_lookup_by_idx(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, +H5G__dense_lookup_by_idx(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, H5O_link_t *lnk) { H5HF_t *fheap = NULL; /* Fractal heap handle */ @@ -687,7 +687,7 @@ H5G_dense_lookup_by_idx(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, haddr_t bt2_addr; /* Address of v2 B-tree to use for lookup */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5G_dense_lookup_by_idx, FAIL) + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -748,7 +748,7 @@ H5G_dense_lookup_by_idx(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, } /* end if */ else { /* Otherwise, we need to build a table of the links and sort it */ /* Build the table of links for this group */ - if(H5G_dense_build_table(f, dxpl_id, linfo, idx_type, order, <able) < 0) + if(H5G__dense_build_table(f, dxpl_id, linfo, idx_type, order, <able) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "error building table of links") /* Check for going out of bounds */ @@ -766,11 +766,11 @@ done: HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "can't close fractal heap") if(bt2 && H5B2_close(bt2, dxpl_id) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for index") - if(ltable.lnks && H5G_link_release_table(<able) < 0) + if(ltable.lnks && H5G__link_release_table(<able) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTFREE, FAIL, "unable to release link table") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_dense_lookup_by_idx() */ +} /* end H5G__dense_lookup_by_idx() */ /*------------------------------------------------------------------------- @@ -794,7 +794,7 @@ H5G_dense_build_table_cb(const H5O_link_t *lnk, void *_udata) H5G_dense_bt_ud_t *udata = (H5G_dense_bt_ud_t *)_udata; /* 'User data' passed in */ herr_t ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5G_dense_build_table_cb) + FUNC_ENTER_NOAPI_NOINIT /* check arguments */ HDassert(lnk); @@ -814,7 +814,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_dense_build_table + * Function: H5G__dense_build_table * * Purpose: Builds a table containing a sorted list of links for a group * @@ -830,12 +830,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G_dense_build_table(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, +H5G__dense_build_table(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, H5_index_t idx_type, H5_iter_order_t order, H5G_link_table_t *ltable) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5G_dense_build_table) + FUNC_ENTER_PACKAGE /* Sanity check */ HDassert(f); @@ -859,11 +859,11 @@ H5G_dense_build_table(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, udata.curr_lnk = 0; /* Iterate over the links in the group, building a table of the link messages */ - if(H5G_dense_iterate(f, dxpl_id, linfo, H5_INDEX_NAME, H5_ITER_NATIVE, (hsize_t)0, NULL, H5G_dense_build_table_cb, &udata) < 0) + if(H5G__dense_iterate(f, dxpl_id, linfo, H5_INDEX_NAME, H5_ITER_NATIVE, (hsize_t)0, NULL, H5G_dense_build_table_cb, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTNEXT, FAIL, "error iterating over links") /* Sort link table in correct iteration order */ - if(H5G_link_sort_table(ltable, idx_type, order) < 0) + if(H5G__link_sort_table(ltable, idx_type, order) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTSORT, FAIL, "error sorting link messages") } /* end if */ else @@ -871,7 +871,7 @@ H5G_dense_build_table(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_dense_build_table() */ +} /* end H5G__dense_build_table() */ /*------------------------------------------------------------------------- @@ -894,7 +894,7 @@ H5G_dense_iterate_fh_cb(const void *obj, size_t UNUSED obj_len, void *_udata) H5G_fh_ud_it_t *udata = (H5G_fh_ud_it_t *)_udata; /* User data for fractal heap 'op' callback */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5G_dense_iterate_fh_cb) + FUNC_ENTER_NOAPI_NOINIT /* Decode link information & keep a copy */ /* (we make a copy instead of calling the user/library callback directly in @@ -931,7 +931,7 @@ H5G_dense_iterate_bt2_cb(const void *_record, void *_bt2_udata) H5G_bt2_ud_it_t *bt2_udata = (H5G_bt2_ud_it_t *)_bt2_udata; /* User data for callback */ herr_t ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5G_dense_iterate_bt2_cb) + FUNC_ENTER_NOAPI_NOINIT /* Check for skipping links */ if(bt2_udata->skip > 0) @@ -970,7 +970,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_dense_iterate + * Function: H5G__dense_iterate * * Purpose: Iterate over the objects in a group using dense link storage * @@ -983,7 +983,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G_dense_iterate(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, +H5G__dense_iterate(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, H5_index_t idx_type, H5_iter_order_t order, hsize_t skip, hsize_t *last_lnk, H5G_lib_iterate_t op, void *op_data) { @@ -993,7 +993,7 @@ H5G_dense_iterate(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, haddr_t bt2_addr; /* Address of v2 B-tree to use for lookup */ herr_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5G_dense_iterate, FAIL) + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -1065,11 +1065,11 @@ H5G_dense_iterate(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, } /* end if */ else { /* Build the table of links for this group */ - if(H5G_dense_build_table(f, dxpl_id, linfo, idx_type, order, <able) < 0) + if(H5G__dense_build_table(f, dxpl_id, linfo, idx_type, order, <able) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "error building table of links") /* Iterate over links in table */ - if((ret_value = H5G_link_iterate_table(<able, skip, last_lnk, op, op_data)) < 0) + if((ret_value = H5G__link_iterate_table(<able, skip, last_lnk, op, op_data)) < 0) HERROR(H5E_SYM, H5E_CANTNEXT, "iteration operator failed"); } /* end else */ @@ -1079,11 +1079,11 @@ done: HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "can't close fractal heap") if(bt2 && H5B2_close(bt2, dxpl_id) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for index") - if(ltable.lnks && H5G_link_release_table(<able) < 0) + if(ltable.lnks && H5G__link_release_table(<able) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTFREE, FAIL, "unable to release link table") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_dense_iterate() */ +} /* end H5G__dense_iterate() */ /*------------------------------------------------------------------------- @@ -1107,7 +1107,7 @@ H5G_dense_get_name_by_idx_fh_cb(const void *obj, size_t UNUSED obj_len, void *_u H5O_link_t *lnk; /* Pointer to link created from heap object */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5G_dense_get_name_by_idx_fh_cb) + FUNC_ENTER_NOAPI_NOINIT /* Decode link information */ if(NULL == (lnk = (H5O_link_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_LINK_ID, (const unsigned char *)obj))) @@ -1152,7 +1152,7 @@ H5G_dense_get_name_by_idx_bt2_cb(const void *_record, void *_bt2_udata) H5G_fh_ud_gnbi_t fh_udata; /* User data for fractal heap 'op' callback */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5G_dense_get_name_by_idx_bt2_cb) + FUNC_ENTER_NOAPI_NOINIT /* Prepare user data for callback */ /* down */ @@ -1175,7 +1175,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_dense_get_name_by_idx + * Function: H5G__dense_get_name_by_idx * * Purpose: Returns the name of objects in the group by giving index. * @@ -1189,7 +1189,7 @@ done: *------------------------------------------------------------------------- */ ssize_t -H5G_dense_get_name_by_idx(H5F_t *f, hid_t dxpl_id, H5O_linfo_t *linfo, +H5G__dense_get_name_by_idx(H5F_t *f, hid_t dxpl_id, H5O_linfo_t *linfo, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, char *name, size_t size) { @@ -1199,7 +1199,7 @@ H5G_dense_get_name_by_idx(H5F_t *f, hid_t dxpl_id, H5O_linfo_t *linfo, haddr_t bt2_addr; /* Address of v2 B-tree to use for lookup */ ssize_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5G_dense_get_name_by_idx, FAIL) + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -1263,7 +1263,7 @@ H5G_dense_get_name_by_idx(H5F_t *f, hid_t dxpl_id, H5O_linfo_t *linfo, } /* end if */ else { /* Otherwise, we need to build a table of the links and sort it */ /* Build the table of links for this group */ - if(H5G_dense_build_table(f, dxpl_id, linfo, idx_type, order, <able) < 0) + if(H5G__dense_build_table(f, dxpl_id, linfo, idx_type, order, <able) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "error building table of links") /* Check for going out of bounds */ @@ -1287,11 +1287,11 @@ done: HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "can't close fractal heap") if(bt2 && H5B2_close(bt2, dxpl_id) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for index") - if(ltable.lnks && H5G_link_release_table(<able) < 0) + if(ltable.lnks && H5G__link_release_table(<able) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTFREE, FAIL, "unable to release link table") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_dense_get_name_by_idx() */ +} /* end H5G__dense_get_name_by_idx() */ /*------------------------------------------------------------------------- @@ -1315,7 +1315,7 @@ H5G_dense_remove_fh_cb(const void *obj, size_t UNUSED obj_len, void *_udata) H5B2_t *bt2 = NULL; /* v2 B-tree handle for index */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5G_dense_remove_fh_cb) + FUNC_ENTER_NOAPI_NOINIT /* Decode link information */ if(NULL == (lnk = (H5O_link_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_LINK_ID, (const unsigned char *)obj))) @@ -1340,7 +1340,7 @@ H5G_dense_remove_fh_cb(const void *obj, size_t UNUSED obj_len, void *_udata) /* Replace open objects' names, if requested */ if(udata->replace_names) - if(H5G_link_name_replace(udata->f, udata->dxpl_id, udata->grp_full_path_r, lnk) < 0) + if(H5G__link_name_replace(udata->f, udata->dxpl_id, udata->grp_full_path_r, lnk) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTRENAME, FAIL, "unable to rename open objects") /* Perform the deletion action on the link, if requested */ @@ -1380,7 +1380,7 @@ H5G_dense_remove_bt2_cb(const void *_record, void *_bt2_udata) H5G_fh_ud_rm_t fh_udata; /* User data for fractal heap 'op' callback */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5G_dense_remove_bt2_cb) + FUNC_ENTER_NOAPI_NOINIT /* Set up the user data for fractal heap 'op' callback */ fh_udata.f = bt2_udata->common.f; @@ -1405,7 +1405,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_dense_remove + * Function: H5G__dense_remove * * Purpose: Remove a link from the dense storage of a group * @@ -1418,7 +1418,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G_dense_remove(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, +H5G__dense_remove(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, H5RS_str_t *grp_full_path_r, const char *name) { H5HF_t *fheap = NULL; /* Fractal heap handle */ @@ -1426,7 +1426,7 @@ H5G_dense_remove(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, H5B2_t *bt2 = NULL; /* v2 B-tree handle for index */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5G_dense_remove, FAIL) + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -1468,7 +1468,7 @@ done: HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for name index") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_dense_remove() */ +} /* end H5G__dense_remove() */ /*------------------------------------------------------------------------- @@ -1490,7 +1490,7 @@ H5G_dense_remove_by_idx_fh_cb(const void *obj, size_t UNUSED obj_len, void *_uda H5G_fh_ud_rmbi_t *udata = (H5G_fh_ud_rmbi_t *)_udata; /* User data for fractal heap 'op' callback */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5G_dense_remove_by_idx_fh_cb) + FUNC_ENTER_NOAPI_NOINIT /* Decode link information */ if(NULL == (udata->lnk = (H5O_link_t *)H5O_msg_decode(udata->f, udata->dxpl_id, NULL, H5O_LINK_ID, (const unsigned char *)obj))) @@ -1525,7 +1525,7 @@ H5G_dense_remove_by_idx_bt2_cb(const void *_record, void *_bt2_udata) const uint8_t *heap_id; /* Heap ID for link */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5G_dense_remove_by_idx_bt2_cb) + FUNC_ENTER_NOAPI_NOINIT /* Determine the index being used */ if(bt2_udata->idx_type == H5_INDEX_NAME) { @@ -1588,7 +1588,7 @@ H5G_dense_remove_by_idx_bt2_cb(const void *_record, void *_bt2_udata) } /* end if */ /* Replace open objects' names */ - if(H5G_link_name_replace(bt2_udata->f, bt2_udata->dxpl_id, bt2_udata->grp_full_path_r, fh_udata.lnk) < 0) + if(H5G__link_name_replace(bt2_udata->f, bt2_udata->dxpl_id, bt2_udata->grp_full_path_r, fh_udata.lnk) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTRENAME, FAIL, "unable to rename open objects") /* Perform the deletion action on the link */ @@ -1613,7 +1613,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_dense_remove_by_idx + * Function: H5G__dense_remove_by_idx * * Purpose: Remove a link from the dense storage of a group, according to * to the offset in an indexed order @@ -1627,7 +1627,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G_dense_remove_by_idx(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, +H5G__dense_remove_by_idx(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, H5RS_str_t *grp_full_path_r, H5_index_t idx_type, H5_iter_order_t order, hsize_t n) { @@ -1637,7 +1637,7 @@ H5G_dense_remove_by_idx(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, haddr_t bt2_addr; /* Address of v2 B-tree to use for lookup */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5G_dense_remove_by_idx, FAIL) + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -1699,7 +1699,7 @@ H5G_dense_remove_by_idx(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, } /* end if */ else { /* Otherwise, we need to build a table of the links and sort it */ /* Build the table of links for this group */ - if(H5G_dense_build_table(f, dxpl_id, linfo, idx_type, order, <able) < 0) + if(H5G__dense_build_table(f, dxpl_id, linfo, idx_type, order, <able) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "error building table of links") /* Check for going out of bounds */ @@ -1707,7 +1707,7 @@ H5G_dense_remove_by_idx(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "index out of bound") /* Remove the appropriate link from the dense storage */ - if(H5G_dense_remove(f, dxpl_id, linfo, grp_full_path_r, ltable.lnks[n].name) < 0) + if(H5G__dense_remove(f, dxpl_id, linfo, grp_full_path_r, ltable.lnks[n].name) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTREMOVE, FAIL, "unable to remove link from dense storage") } /* end else */ @@ -1717,15 +1717,15 @@ done: HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "can't close fractal heap") if(bt2 && H5B2_close(bt2, dxpl_id) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for index") - if(ltable.lnks && H5G_link_release_table(<able) < 0) + if(ltable.lnks && H5G__link_release_table(<able) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTFREE, FAIL, "unable to release link table") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_dense_remove_by_idx() */ +} /* end H5G__dense_remove_by_idx() */ /*------------------------------------------------------------------------- - * Function: H5G_dense_delete + * Function: H5G__dense_delete * * Purpose: Delete the dense storage for a group * @@ -1738,11 +1738,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G_dense_delete(H5F_t *f, hid_t dxpl_id, H5O_linfo_t *linfo, hbool_t adj_link) +H5G__dense_delete(H5F_t *f, hid_t dxpl_id, H5O_linfo_t *linfo, hbool_t adj_link) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5G_dense_delete, FAIL) + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -1808,12 +1808,12 @@ H5G_dense_delete(H5F_t *f, hid_t dxpl_id, H5O_linfo_t *linfo, hbool_t adj_link) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_dense_delete() */ +} /* end H5G__dense_delete() */ #ifndef H5_NO_DEPRECATED_SYMBOLS /*------------------------------------------------------------------------- - * Function: H5G_dense_get_type_by_idx + * Function: H5G__dense_get_type_by_idx * * Purpose: Returns the type of objects in the group by giving index. * @@ -1833,13 +1833,13 @@ done: *------------------------------------------------------------------------- */ H5G_obj_t -H5G_dense_get_type_by_idx(H5F_t *f, hid_t dxpl_id, H5O_linfo_t *linfo, +H5G__dense_get_type_by_idx(H5F_t *f, hid_t dxpl_id, H5O_linfo_t *linfo, hsize_t idx) { H5G_link_table_t ltable = {0, NULL}; /* Table of links */ H5G_obj_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5G_dense_get_type_by_idx, H5G_UNKNOWN) + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -1848,7 +1848,7 @@ H5G_dense_get_type_by_idx(H5F_t *f, hid_t dxpl_id, H5O_linfo_t *linfo, HDassert(linfo); /* Build the table of links for this group */ - if(H5G_dense_build_table(f, dxpl_id, linfo, H5_INDEX_NAME, H5_ITER_INC, <able) < 0) + if(H5G__dense_build_table(f, dxpl_id, linfo, H5_INDEX_NAME, H5_ITER_INC, <able) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, H5G_UNKNOWN, "error building table of links") /* Check for going out of bounds */ @@ -1881,10 +1881,10 @@ H5G_dense_get_type_by_idx(H5F_t *f, hid_t dxpl_id, H5O_linfo_t *linfo, done: /* Release link table */ - if(ltable.lnks && H5G_link_release_table(<able) < 0) + if(ltable.lnks && H5G__link_release_table(<able) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTFREE, H5G_UNKNOWN, "unable to release link table") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_dense_get_type_by_idx() */ +} /* end H5G__dense_get_type_by_idx() */ #endif /* H5_NO_DEPRECATED_SYMBOLS */ diff --git a/src/H5Gdeprec.c b/src/H5Gdeprec.c index 1815691..9473011 100644 --- a/src/H5Gdeprec.c +++ b/src/H5Gdeprec.c @@ -116,15 +116,15 @@ RETURNS Non-negative on success/Negative on failure DESCRIPTION Initializes any interface-specific data or routines. (Just calls - H5G_init() currently). + H5G__init() currently). --------------------------------------------------------------------------*/ static herr_t H5G_init_deprec_interface(void) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_init_deprec_interface) + FUNC_ENTER_NOAPI_NOINIT_NOERR - FUNC_LEAVE_NOAPI(H5G_init()) + FUNC_LEAVE_NOAPI(H5G__init()) } /* H5G_init_deprec_interface() */ #ifndef H5_NO_DEPRECATED_SYMBOLS @@ -146,8 +146,8 @@ H5G_map_obj_type(H5O_type_t obj_type) { H5G_obj_t ret_value; /* Return value */ - /* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_map_obj_type) + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Map object type to older "group" object type */ switch(obj_type) { @@ -206,7 +206,7 @@ H5Gcreate1(hid_t loc_id, const char *name, size_t size_hint) hid_t tmp_gcpl = (-1); /* Temporary group creation property list */ hid_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Gcreate1, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("i", "i*sz", loc_id, name, size_hint); /* Check arguments */ @@ -245,7 +245,7 @@ H5Gcreate1(hid_t loc_id, const char *name, size_t size_hint) tmp_gcpl = H5P_GROUP_CREATE_DEFAULT; /* Create the new group & get its ID */ - if(NULL == (grp = H5G_create_named(&loc, name, H5P_LINK_CREATE_DEFAULT, + if(NULL == (grp = H5G__create_named(&loc, name, H5P_LINK_CREATE_DEFAULT, tmp_gcpl, H5P_GROUP_ACCESS_DEFAULT, H5AC_dxpl_id))) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create group") if((ret_value = H5I_register(H5I_GROUP, grp, TRUE)) < 0) @@ -288,7 +288,7 @@ H5Gopen1(hid_t loc_id, const char *name) H5G_loc_t loc; /* Location of parent for group */ hid_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Gopen1, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("i", "i*s", loc_id, name); /* Check args */ @@ -298,7 +298,7 @@ H5Gopen1(hid_t loc_id, const char *name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") /* Open the group */ - if((grp = H5G_open_name(&loc, name, H5P_DEFAULT, H5AC_dxpl_id)) == NULL) + if((grp = H5G__open_name(&loc, name, H5P_DEFAULT, H5AC_dxpl_id)) == NULL) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open group") /* Register an atom for the group */ @@ -328,7 +328,7 @@ H5Glink(hid_t cur_loc_id, H5G_link_t type, const char *cur_name, const char *new { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Glink, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE4("e", "iLl*s*s", cur_loc_id, type, cur_name, new_name); /* Check arguments */ @@ -374,7 +374,7 @@ H5Glink2(hid_t cur_loc_id, const char *cur_name, H5G_link_t type, { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Glink2, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE5("e", "i*sLli*s", cur_loc_id, cur_name, type, new_loc_id, new_name); /* Check arguments */ @@ -435,7 +435,7 @@ H5G_link_hard(hid_t cur_loc_id, const char *cur_name, hid_t new_loc_id, H5G_loc_t new_loc, *new_loc_p; /* Information about new link's group */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5G_link_hard) + FUNC_ENTER_NOAPI_NOINIT /* Finish checking arguments */ if(cur_loc_id == H5L_SAME_LOC && new_loc_id == H5L_SAME_LOC) @@ -477,7 +477,7 @@ H5Gmove(hid_t src_loc_id, const char *src_name, const char *dst_name) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Gmove, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("e", "i*s*s", src_loc_id, src_name, dst_name); /* Call common routine to move the link */ @@ -502,7 +502,7 @@ H5Gmove2(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Gmove2, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE4("e", "i*si*s", src_loc_id, src_name, dst_loc_id, dst_name); /* Call common routine to move the link */ @@ -539,7 +539,7 @@ H5G_move(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, H5G_loc_t dst_loc, *dst_loc_p; /* Group info for destination location */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5G_move) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments */ if(src_loc_id == H5L_SAME_LOC && dst_loc_id == H5L_SAME_LOC) @@ -584,7 +584,7 @@ H5Gunlink(hid_t loc_id, const char *name) H5G_loc_t loc; /* Group's location */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Gunlink, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*s", loc_id, name); /* Check arguments */ @@ -616,7 +616,7 @@ H5Gget_linkval(hid_t loc_id, const char *name, size_t size, char *buf/*out*/) H5G_loc_t loc; /* Group's location */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Gget_linkval, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE4("e", "i*szx", loc_id, name, size, buf); /* Check arguments */ @@ -657,7 +657,7 @@ H5Gset_comment(hid_t loc_id, const char *name, const char *comment) H5G_loc_t loc; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Gset_comment, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("e", "i*s*s", loc_id, name, comment); if(H5G_loc(loc_id, &loc) < 0) @@ -702,7 +702,7 @@ H5Gget_comment(hid_t loc_id, const char *name, size_t bufsize, char *buf) H5G_loc_t loc; int ret_value; - FUNC_ENTER_API(H5Gget_comment, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE4("Is", "i*sz*s", loc_id, name, bufsize, buf); if(H5G_loc(loc_id, &loc) < 0) @@ -756,7 +756,7 @@ H5Giterate(hid_t loc_id, const char *name, int *idx_p, H5G_iterate_t op, hsize_t idx; /* Internal location to hold index */ herr_t ret_value; - FUNC_ENTER_API(H5Giterate, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE5("e", "i*s*Isx*x", loc_id, name, idx_p, op, op_data); /* Check args */ @@ -812,7 +812,7 @@ H5Gget_num_objs(hid_t loc_id, hsize_t *num_objs) H5O_type_t obj_type; /* Type of object at location */ herr_t ret_value = SUCCEED; - FUNC_ENTER_API(H5Gget_num_objs, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*h", loc_id, num_objs); /* Check args */ @@ -826,7 +826,7 @@ H5Gget_num_objs(hid_t loc_id, hsize_t *num_objs) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "bad pointer to # of objects") /* Retrieve information about the group */ - if(H5G_obj_info(loc.oloc, &grp_info, H5AC_ind_dxpl_id) < 0) + if(H5G__obj_info(loc.oloc, &grp_info, H5AC_ind_dxpl_id) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTCOUNT, FAIL, "can't determine") /* Set the number of objects [sic: links] in the group */ @@ -861,7 +861,7 @@ H5Gget_objinfo(hid_t loc_id, const char *name, hbool_t follow_link, H5G_loc_t loc; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Gget_objinfo, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE4("e", "i*sbx", loc_id, name, follow_link, statbuf); /* Check arguments */ @@ -899,7 +899,7 @@ H5G_get_objinfo_cb(H5G_loc_t UNUSED *grp_loc/*in*/, const char *name, const H5O_ H5G_trav_goi_t *udata = (H5G_trav_goi_t *)_udata; /* User data passed in */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5G_get_objinfo_cb) + FUNC_ENTER_NOAPI_NOINIT /* Check if the name in this group resolved to a valid link */ if(lnk == NULL && obj_loc == NULL) @@ -981,7 +981,7 @@ H5G_get_objinfo(const H5G_loc_t *loc, const char *name, hbool_t follow_link, H5G_trav_goi_t udata; /* User data for callback */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5G_get_objinfo) + FUNC_ENTER_NOAPI_NOINIT HDassert(loc); HDassert(name && *name); @@ -1058,7 +1058,7 @@ H5Gget_objname_by_idx(hid_t loc_id, hsize_t idx, char *name, size_t size) H5O_type_t obj_type; /* Type of object at location */ ssize_t ret_value; - FUNC_ENTER_API(H5Gget_objname_by_idx, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE4("Zs", "ih*sz", loc_id, idx, name, size); /* Check args */ @@ -1100,7 +1100,7 @@ H5Gget_objtype_by_idx(hid_t loc_id, hsize_t idx) H5O_type_t obj_type; /* Type of object at location */ H5G_obj_t ret_value; - FUNC_ENTER_API(H5Gget_objtype_by_idx, H5G_UNKNOWN) + FUNC_ENTER_API(H5G_UNKNOWN) H5TRACE2("Go", "ih", loc_id, idx); /* Check args */ @@ -1142,29 +1142,29 @@ H5G_obj_get_type_by_idx(H5O_loc_t *oloc, hsize_t idx, hid_t dxpl_id) htri_t linfo_exists; /* Whether the link info message exists */ H5G_obj_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_TAG(H5G_obj_get_type_by_idx, dxpl_id, oloc->addr, H5G_UNKNOWN) + FUNC_ENTER_NOAPI_TAG(dxpl_id, oloc->addr, H5G_UNKNOWN) /* Sanity check */ HDassert(oloc); /* Attempt to get the link info for this group */ - if((linfo_exists = H5G_obj_get_linfo(oloc, &linfo, dxpl_id)) < 0) + if((linfo_exists = H5G__obj_get_linfo(oloc, &linfo, dxpl_id)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, H5G_UNKNOWN, "can't check for link info message") if(linfo_exists) { if(H5F_addr_defined(linfo.fheap_addr)) { /* Get the object's name from the dense link storage */ - if((ret_value = H5G_dense_get_type_by_idx(oloc->file, dxpl_id, &linfo, idx)) < 0) + if((ret_value = H5G__dense_get_type_by_idx(oloc->file, dxpl_id, &linfo, idx)) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, H5G_UNKNOWN, "can't locate type") } /* end if */ else { /* Get the object's type from the link messages */ - if((ret_value = H5G_compact_get_type_by_idx(oloc, dxpl_id, &linfo, idx)) < 0) + if((ret_value = H5G__compact_get_type_by_idx(oloc, dxpl_id, &linfo, idx)) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, H5G_UNKNOWN, "can't locate type") } /* end else */ } /* end if */ else { /* Get the object's type from the symbol table */ - if((ret_value = H5G_stab_get_type_by_idx(oloc, idx, dxpl_id)) < 0) + if((ret_value = H5G__stab_get_type_by_idx(oloc, idx, dxpl_id)) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, H5G_UNKNOWN, "can't locate type") } /* end else */ diff --git a/src/H5Gent.c b/src/H5Gent.c index cec788c..17893fa 100644 --- a/src/H5Gent.c +++ b/src/H5Gent.c @@ -17,28 +17,66 @@ * Programmer: Robb Matzke * Friday, September 19, 1997 */ + +/****************/ +/* Module Setup */ +/****************/ + #define H5G_PACKAGE /*suppress error about including H5Gpkg */ -#define H5F_PACKAGE /*suppress error about including H5Fpkg */ -/* Packages needed by this file... */ +/***********/ +/* Headers */ +/***********/ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ -#include "H5Fpkg.h" /* File access */ +#include "H5Fprivate.h" /* File access */ #include "H5FLprivate.h" /* Free Lists */ #include "H5Gpkg.h" /* Groups */ #include "H5HLprivate.h" /* Local Heaps */ -/* Private macros */ -/* Private prototypes */ +/****************/ +/* Local Macros */ +/****************/ + + +/******************/ +/* Local Typedefs */ +/******************/ + + +/********************/ +/* Package Typedefs */ +/********************/ + + +/********************/ +/* Local Prototypes */ +/********************/ + + +/*********************/ +/* Package Variables */ +/*********************/ /* Declare extern the PQ free list for the wrapped strings */ H5FL_BLK_EXTERN(str_buf); + +/*****************************/ +/* Library Private Variables */ +/*****************************/ + + +/*******************/ +/* Local Variables */ +/*******************/ + + /*------------------------------------------------------------------------- - * Function: H5G_ent_decode_vec + * Function: H5G__ent_decode_vec * * Purpose: Same as H5G_ent_decode() except it does it for an array of * symbol table entries. @@ -55,12 +93,12 @@ H5FL_BLK_EXTERN(str_buf); *------------------------------------------------------------------------- */ herr_t -H5G_ent_decode_vec(const H5F_t *f, const uint8_t **pp, H5G_entry_t *ent, unsigned n) +H5G__ent_decode_vec(const H5F_t *f, const uint8_t **pp, H5G_entry_t *ent, unsigned n) { unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5G_ent_decode_vec, FAIL) + FUNC_ENTER_PACKAGE /* check arguments */ HDassert(f); @@ -74,7 +112,7 @@ H5G_ent_decode_vec(const H5F_t *f, const uint8_t **pp, H5G_entry_t *ent, unsigne done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_ent_decode_vec() */ +} /* end H5G__ent_decode_vec() */ /*------------------------------------------------------------------------- @@ -100,7 +138,7 @@ H5G_ent_decode(const H5F_t *f, const uint8_t **pp, H5G_entry_t *ent) uint32_t tmp; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5G_ent_decode, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* check arguments */ HDassert(f); @@ -143,7 +181,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_ent_encode_vec + * Function: H5G__ent_encode_vec * * Purpose: Same as H5G_ent_encode() except it does it for an array of * symbol table entries. @@ -160,12 +198,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G_ent_encode_vec(const H5F_t *f, uint8_t **pp, const H5G_entry_t *ent, unsigned n) +H5G__ent_encode_vec(const H5F_t *f, uint8_t **pp, const H5G_entry_t *ent, unsigned n) { unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5G_ent_encode_vec, FAIL) + FUNC_ENTER_PACKAGE /* check arguments */ HDassert(f); @@ -179,7 +217,7 @@ H5G_ent_encode_vec(const H5F_t *f, uint8_t **pp, const H5G_entry_t *ent, unsigne done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5G_ent_encode_vec() */ +} /* H5G__ent_encode_vec() */ /*------------------------------------------------------------------------- @@ -205,7 +243,7 @@ H5G_ent_encode(const H5F_t *f, uint8_t **pp, const H5G_entry_t *ent) uint8_t *p_ret = *pp + H5G_SIZEOF_ENTRY(f); herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5G_ent_encode, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* check arguments */ HDassert(f); @@ -249,7 +287,7 @@ H5G_ent_encode(const H5F_t *f, uint8_t **pp, const H5G_entry_t *ent) /* fill with zero */ if(*pp < p_ret) - HDmemset(*pp, 0, (p_ret - *pp)); + HDmemset(*pp, 0, (size_t)(p_ret - *pp)); *pp = p_ret; done: @@ -258,7 +296,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_ent_copy + * Function: H5G__ent_copy * * Purpose: Do a deep copy of symbol table entries * @@ -281,10 +319,10 @@ done: * *------------------------------------------------------------------------- */ -herr_t -H5G_ent_copy(H5G_entry_t *dst, const H5G_entry_t *src, H5_copy_depth_t depth) +void +H5G__ent_copy(H5G_entry_t *dst, const H5G_entry_t *src, H5_copy_depth_t depth) { - FUNC_ENTER_NOAPI_NOFUNC(H5G_ent_copy) + FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ HDassert(src); @@ -300,15 +338,15 @@ H5G_ent_copy(H5G_entry_t *dst, const H5G_entry_t *src, H5_copy_depth_t depth) ; } else if(depth == H5_COPY_SHALLOW) { /* Discarding 'const' qualifier OK - QAK */ - H5G_ent_reset((H5G_entry_t *)src); + H5G__ent_reset((H5G_entry_t *)src); } /* end if */ - FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5G_ent_copy() */ + FUNC_LEAVE_NOAPI_VOID +} /* end H5G__ent_copy() */ /*------------------------------------------------------------------------- - * Function: H5G_ent_reset + * Function: H5G__ent_reset * * Purpose: Reset a symbol table entry to an empty state * @@ -320,10 +358,10 @@ H5G_ent_copy(H5G_entry_t *dst, const H5G_entry_t *src, H5_copy_depth_t depth) * *------------------------------------------------------------------------- */ -herr_t -H5G_ent_reset(H5G_entry_t *ent) +void +H5G__ent_reset(H5G_entry_t *ent) { - FUNC_ENTER_NOAPI_NOFUNC(H5G_ent_reset) + FUNC_ENTER_PACKAGE /* Check arguments */ HDassert(ent); @@ -332,12 +370,12 @@ H5G_ent_reset(H5G_entry_t *ent) HDmemset(ent, 0, sizeof(H5G_entry_t)); ent->header = HADDR_UNDEF; - FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5G_ent_reset() */ + FUNC_LEAVE_NOAPI_VOID +} /* end H5G__ent_reset() */ /*------------------------------------------------------------------------- - * Function: H5G_ent_convert + * Function: H5G__ent_convert * * Purpose: Convert a link to a symbol table entry * @@ -351,14 +389,14 @@ H5G_ent_reset(H5G_entry_t *ent) *------------------------------------------------------------------------- */ herr_t -H5G_ent_convert(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, const char *name, +H5G__ent_convert(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, const char *name, const H5O_link_t *lnk, H5O_type_t obj_type, const void *crt_info, H5G_entry_t *ent) { size_t name_offset; /* Offset of name in heap */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5G_ent_convert, FAIL) + FUNC_ENTER_PACKAGE /* check arguments */ HDassert(f); @@ -367,7 +405,7 @@ H5G_ent_convert(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, const char *name, HDassert(lnk); /* Reset the new entry */ - H5G_ent_reset(ent); + H5G__ent_reset(ent); /* * Add the new name to the heap. @@ -485,11 +523,11 @@ H5G_ent_convert(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, const char *name, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_ent_convert() */ +} /* end H5G__ent_convert() */ /*------------------------------------------------------------------------- - * Function: H5G_ent_debug + * Function: H5G__ent_debug * * Purpose: Prints debugging information about a symbol table entry. * @@ -502,13 +540,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G_ent_debug(const H5G_entry_t *ent, FILE *stream, int indent, int fwidth, +H5G__ent_debug(const H5G_entry_t *ent, FILE *stream, int indent, int fwidth, const H5HL_t *heap) { const char *lval = NULL; int nested_indent, nested_fwidth; - FUNC_ENTER_NOAPI_NOFUNC(H5G_ent_debug) + FUNC_ENTER_PACKAGE_NOERR /* Calculate the indent & field width values for nested information */ nested_indent = indent + 3; @@ -565,5 +603,5 @@ H5G_ent_debug(const H5G_entry_t *ent, FILE *stream, int indent, int fwidth, } /* end switch */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5G_ent_debug() */ +} /* end H5G__ent_debug() */ diff --git a/src/H5Gint.c b/src/H5Gint.c index 0dc9c03..ad2e57e 100644 --- a/src/H5Gint.c +++ b/src/H5Gint.c @@ -39,7 +39,10 @@ /***********/ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ +#include "H5FOprivate.h" /* File objects */ #include "H5Gpkg.h" /* Groups */ +#include "H5Iprivate.h" /* IDs */ +#include "H5Lprivate.h" /* Links */ #include "H5MMprivate.h" /* Memory management */ @@ -52,6 +55,34 @@ /* Local Typedefs */ /******************/ +/* User data for path traversal routine for "insertion file" routine */ +typedef struct { + H5G_loc_t *loc; /* Pointer to the location for insertion */ +} H5G_trav_ins_t; + +/* User data for application-style iteration over links in a group */ +typedef struct { + hid_t gid; /* The group ID for the application callback */ + H5G_link_iterate_t lnk_op; /* Application callback */ + void *op_data; /* Application's op data */ +} H5G_iter_appcall_ud_t; + +/* User data for recursive traversal over links from a group */ +typedef struct { + hid_t gid; /* The group ID for the starting group */ + H5G_loc_t *curr_loc; /* Location of starting group */ + hid_t lapl_id; /* LAPL for walking across links */ + hid_t dxpl_id; /* DXPL for operations */ + H5_index_t idx_type; /* Index to use */ + H5_iter_order_t order; /* Iteration order within index */ + H5SL_t *visited; /* Skip list for tracking visited nodes */ + char *path; /* Path name of the link */ + size_t curr_path_len; /* Current length of the path in the buffer */ + size_t path_buf_size; /* Size of path buffer */ + H5L_iterate_t op; /* Application callback */ + void *op_data; /* Application's op data */ +} H5G_iter_visit_ud_t; + /********************/ /* Package Typedefs */ @@ -62,11 +93,20 @@ /* Local Prototypes */ /********************/ +static herr_t H5G_open_oid(H5G_t *grp, hid_t dxpl_id); + /*********************/ /* Package Variables */ /*********************/ +/* Declare a free list to manage the H5G_t struct */ +H5FL_DEFINE(H5G_t); +H5FL_DEFINE(H5G_shared_t); + +/* Declare the free list to manage H5_obj_t's */ +H5FL_DEFINE(H5_obj_t); + /*****************************/ /* Library Private Variables */ @@ -88,7 +128,7 @@ RETURNS Non-negative on success/Negative on failure DESCRIPTION Initializes any interface-specific data or routines. (Just calls - H5G_init() currently). + H5G__init() currently). --------------------------------------------------------------------------*/ static herr_t @@ -96,10 +136,10 @@ H5G_init_int_interface(void) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5G_init_int_interface, FAIL) + FUNC_ENTER_NOAPI_NOINIT - /* Funnel all work to H5G_init() */ - if(H5G_init() < 0) + /* Funnel all work to H5G__init() */ + if(H5G__init() < 0) HGOTO_ERROR(H5E_FUNC, H5E_CANTINIT, FAIL, "interface initialization failed") done: @@ -108,16 +148,71 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_component + * Function: H5G__create_named + * + * Purpose: Internal routine to create a new "named" group. + * + * Return: Success: Non-NULL, pointer to new group object. + * + * Failure: NULL + * + * Programmer: Quincey Koziol + * April 5, 2007 + * + *------------------------------------------------------------------------- + */ +H5G_t * +H5G__create_named(const H5G_loc_t *loc, const char *name, hid_t lcpl_id, + hid_t gcpl_id, hid_t gapl_id, hid_t dxpl_id) +{ + H5O_obj_create_t ocrt_info; /* Information for object creation */ + H5G_obj_create_t gcrt_info; /* Information for group creation */ + H5G_t *ret_value; /* Return value */ + + FUNC_ENTER_PACKAGE + + /* Check arguments */ + HDassert(loc); + HDassert(name && *name); + HDassert(lcpl_id != H5P_DEFAULT); + HDassert(gcpl_id != H5P_DEFAULT); + HDassert(gapl_id != H5P_DEFAULT); + HDassert(dxpl_id != H5P_DEFAULT); + + /* Set up group creation info */ + gcrt_info.gcpl_id = gcpl_id; + gcrt_info.cache_type = H5G_NOTHING_CACHED; + HDmemset(&gcrt_info.cache, 0, sizeof(gcrt_info.cache)); + + /* Set up object creation information */ + ocrt_info.obj_type = H5O_TYPE_GROUP; + ocrt_info.crt_info = &gcrt_info; + ocrt_info.new_obj = NULL; + + /* Create the new group and link it to its parent group */ + if(H5L_link_object(loc, name, &ocrt_info, lcpl_id, gapl_id, dxpl_id) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, NULL, "unable to create and link to group") + HDassert(ocrt_info.new_obj); + + /* Set the return value */ + ret_value = (H5G_t *)ocrt_info.new_obj; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5G__create_named() */ + + +/*------------------------------------------------------------------------- + * Function: H5G__create * - * Purpose: Returns the pointer to the first component of the - * specified name by skipping leading slashes. Returns - * the size in characters of the component through SIZE_P not - * counting leading slashes or the null terminator. + * Purpose: Creates a new empty group with the specified name. The name + * is either an absolute name or is relative to LOC. * - * Return: Success: Ptr into NAME. + * Return: Success: A handle for the group. The group is opened + * and should eventually be close by calling + * H5G_close(). * - * Failure: Ptr to the null terminator of NAME. + * Failure: NULL * * Programmer: Robb Matzke * matzke@llnl.gov @@ -125,83 +220,974 @@ done: * *------------------------------------------------------------------------- */ -const char * -H5G_component(const char *name, size_t *size_p) +H5G_t * +H5G__create(H5F_t *file, H5G_obj_create_t *gcrt_info, hid_t dxpl_id) { - /* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_component) + H5G_t *grp = NULL; /*new group */ + unsigned oloc_init = 0; /* Flag to indicate that the group object location was created successfully */ + H5G_t *ret_value; /* Return value */ + + FUNC_ENTER_PACKAGE + + /* check args */ + HDassert(file); + HDassert(gcrt_info->gcpl_id != H5P_DEFAULT); + HDassert(dxpl_id != H5P_DEFAULT); + + /* create an open group */ + if(NULL == (grp = H5FL_CALLOC(H5G_t))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + if(NULL == (grp->shared = H5FL_CALLOC(H5G_shared_t))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + + /* Create the group object header */ + if(H5G__obj_create(file, dxpl_id, gcrt_info, &(grp->oloc)/*out*/) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, NULL, "unable to create group object header") + oloc_init = 1; /* Indicate that the object location information is valid */ + + /* Add group to list of open objects in file */ + if(H5FO_top_incr(grp->oloc.file, grp->oloc.addr) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINC, NULL, "can't incr object ref. count") + if(H5FO_insert(grp->oloc.file, grp->oloc.addr, grp->shared, TRUE) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, NULL, "can't insert group into list of open objects") - assert(name); + /* Set the count of times the object is opened */ + grp->shared->fo_count = 1; - while ('/' == *name) - name++; - if (size_p) - *size_p = HDstrcspn(name, "/"); + /* Set return value */ + ret_value = grp; + +done: + if(ret_value == NULL) { + /* Check if we need to release the file-oriented symbol table info */ + if(oloc_init) { + if(H5O_dec_rc_by_loc(&(grp->oloc), dxpl_id) < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTDEC, NULL, "unable to decrement refcount on newly created object") + if(H5O_close(&(grp->oloc)) < 0) + HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, NULL, "unable to release object header") + if(H5O_delete(file, dxpl_id, grp->oloc.addr) < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTDELETE, NULL, "unable to delete object header") + } /* end if */ + if(grp != NULL) { + if(grp->shared != NULL) + grp->shared = H5FL_FREE(H5G_shared_t, grp->shared); + grp = H5FL_FREE(H5G_t, grp); + } /* end if */ + } /* end if */ - FUNC_LEAVE_NOAPI(name) -} /* end H5G_component() */ + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5G__create() */ /*------------------------------------------------------------------------- - * Function: H5G_normalize + * Function: H5G__open_name * - * Purpose: Returns a pointer to a new string which has duplicate and - * trailing slashes removed from it. + * Purpose: Opens an existing group by name. * - * Return: Success: Ptr to normalized name. + * Return: Success: Ptr to a new group. * Failure: NULL * * Programmer: Quincey Koziol - * Saturday, August 16, 2003 + * Monday, August 27, 2007 * *------------------------------------------------------------------------- */ -char * -H5G_normalize(const char *name) +H5G_t * +H5G__open_name(const H5G_loc_t *loc, const char *name, hid_t gapl_id, + hid_t dxpl_id) { - char *norm; /* Pointer to the normalized string */ - size_t s,d; /* Positions within the strings */ - unsigned last_slash; /* Flag to indicate last character was a slash */ - char *ret_value; /* Return value */ + H5G_t *grp = NULL; /* Group to open */ + H5G_loc_t grp_loc; /* Location used to open group */ + H5G_name_t grp_path; /* Opened object group hier. path */ + H5O_loc_t grp_oloc; /* Opened object object location */ + hbool_t loc_found = FALSE; /* Location at 'name' found */ + H5O_type_t obj_type; /* Type of object at location */ + H5G_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5G_normalize) + FUNC_ENTER_PACKAGE - /* Sanity check */ + /* Check args */ + HDassert(loc); HDassert(name); - /* Duplicate the name, to return */ - if(NULL == (norm = H5MM_strdup(name))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for normalized string") - - /* Walk through the characters, omitting duplicated '/'s */ - s = d = 0; - last_slash = 0; - while(name[s] != '\0') { - if(name[s] == '/') - if(last_slash) - ; - else { - norm[d++] = name[s]; - last_slash = 1; - } /* end else */ - else { - norm[d++] = name[s]; - last_slash = 0; - } /* end else */ - s++; - } /* end while */ - - /* Terminate normalized string */ - norm[d] = '\0'; - - /* Check for final '/' on normalized name & eliminate it */ - if(d > 1 && last_slash) - norm[d - 1] = '\0'; + /* Set up opened group location to fill in */ + grp_loc.oloc = &grp_oloc; + grp_loc.path = &grp_path; + H5G_loc_reset(&grp_loc); + + /* Find the group object using the gapl passed in */ + if(H5G_loc_find(loc, name, &grp_loc/*out*/, gapl_id, dxpl_id) < 0) + HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, NULL, "group not found") + loc_found = TRUE; + + /* Check that the object found is the correct type */ + if(H5O_obj_type(&grp_oloc, &obj_type, dxpl_id) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, NULL, "can't get object type") + if(obj_type != H5O_TYPE_GROUP) + HGOTO_ERROR(H5E_SYM, H5E_BADTYPE, NULL, "not a group") + + /* Open the group */ + if((grp = H5G_open(&grp_loc, dxpl_id)) == NULL) + HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, NULL, "unable to open group") + + /* Set return value */ + ret_value = grp; + +done: + if(!ret_value) { + if(loc_found && H5G_loc_free(&grp_loc) < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRELEASE, NULL, "can't free location") + } /* end if */ + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5G__open_name() */ + + +/*------------------------------------------------------------------------- + * Function: H5G_open + * + * Purpose: Opens an existing group. The group should eventually be + * closed by calling H5G_close(). + * + * Return: Success: Ptr to a new group. + * + * Failure: NULL + * + * Programmer: Robb Matzke + * Monday, January 5, 1998 + * + *------------------------------------------------------------------------- + */ +H5G_t * +H5G_open(const H5G_loc_t *loc, hid_t dxpl_id) +{ + H5G_t *grp = NULL; /* Group opened */ + H5G_shared_t *shared_fo; /* Shared group object */ + H5G_t *ret_value; /* Return value */ + + FUNC_ENTER_NOAPI(NULL) + + /* Check args */ + HDassert(loc); + + /* Allocate the group structure */ + if(NULL == (grp = H5FL_CALLOC(H5G_t))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate space for group") + + /* Shallow copy (take ownership) of the group location object */ + if(H5O_loc_copy(&(grp->oloc), loc->oloc, H5_COPY_SHALLOW) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTCOPY, NULL, "can't copy object location") + if(H5G_name_copy(&(grp->path), loc->path, H5_COPY_SHALLOW) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTCOPY, NULL, "can't copy path") + + /* Check if group was already open */ + if((shared_fo = (H5G_shared_t *)H5FO_opened(grp->oloc.file, grp->oloc.addr)) == NULL) { + + /* Clear any errors from H5FO_opened() */ + H5E_clear_stack(NULL); + + /* Open the group object */ + if(H5G_open_oid(grp, dxpl_id) < 0) + HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, NULL, "not found") + + /* Add group to list of open objects in file */ + if(H5FO_insert(grp->oloc.file, grp->oloc.addr, grp->shared, FALSE) < 0) { + grp->shared = H5FL_FREE(H5G_shared_t, grp->shared); + HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, NULL, "can't insert group into list of open objects") + } /* end if */ + + /* Increment object count for the object in the top file */ + if(H5FO_top_incr(grp->oloc.file, grp->oloc.addr) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINC, NULL, "can't increment object count") + + /* Set open object count */ + grp->shared->fo_count = 1; + } /* end if */ + else { + /* Point to shared group info */ + grp->shared = shared_fo; + + /* Increment shared reference count */ + shared_fo->fo_count++; + + /* Check if the object has been opened through the top file yet */ + if(H5FO_top_count(grp->oloc.file, grp->oloc.addr) == 0) { + /* Open the object through this top file */ + if(H5O_open(&(grp->oloc)) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, NULL, "unable to open object header") + } /* end if */ + + /* Increment object count for the object in the top file */ + if(H5FO_top_incr(grp->oloc.file, grp->oloc.addr) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINC, NULL, "can't increment object count") + } /* end else */ /* Set return value */ - ret_value = norm; + ret_value = grp; done: + if(!ret_value && grp) { + H5O_loc_free(&(grp->oloc)); + H5G_name_free(&(grp->path)); + grp = H5FL_FREE(H5G_t, grp); + } /* end if */ + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5G_open() */ + + +/*------------------------------------------------------------------------- + * Function: H5G_open_oid + * + * Purpose: Opens an existing group. The group should eventually be + * closed by calling H5G_close(). + * + * Return: Success: Ptr to a new group. + * + * Failure: NULL + * + * Programmer: Quincey Koziol + * Wednesday, March 17, 1999 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5G_open_oid(H5G_t *grp, hid_t dxpl_id) +{ + hbool_t obj_opened = FALSE; + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NOINIT + + /* Check args */ + HDassert(grp); + + /* Allocate the shared information for the group */ + if(NULL == (grp->shared = H5FL_CALLOC(H5G_shared_t))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") + + /* Grab the object header */ + if(H5O_open(&(grp->oloc)) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open group") + obj_opened = TRUE; + + /* Check if this object has the right message(s) to be treated as a group */ + if((H5O_msg_exists(&(grp->oloc), H5O_STAB_ID, dxpl_id) <= 0) + && (H5O_msg_exists(&(grp->oloc), H5O_LINFO_ID, dxpl_id) <= 0)) + HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "not a group") + +done: + if(ret_value < 0) { + if(obj_opened) + H5O_close(&(grp->oloc)); + if(grp->shared) + grp->shared = H5FL_FREE(H5G_shared_t, grp->shared); + } /* end if */ + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5G_open_oid() */ + + +/*------------------------------------------------------------------------- + * Function: H5G_close + * + * Purpose: Closes the specified group. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Robb Matzke + * Monday, January 5, 1998 + * + *------------------------------------------------------------------------- + */ +herr_t +H5G_close(H5G_t *grp) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Check args */ + HDassert(grp && grp->shared); + HDassert(grp->shared->fo_count > 0); + + --grp->shared->fo_count; + + if(0 == grp->shared->fo_count) { + HDassert(grp != H5G_rootof(H5G_fileof(grp))); + + /* Remove the group from the list of opened objects in the file */ + if(H5FO_top_decr(grp->oloc.file, grp->oloc.addr) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "can't decrement count for object") + if(H5FO_delete(grp->oloc.file, H5AC_dxpl_id, grp->oloc.addr) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "can't remove group from list of open objects") + if(H5O_close(&(grp->oloc)) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to close") + grp->shared = H5FL_FREE(H5G_shared_t, grp->shared); + } else { + /* Decrement the ref. count for this object in the top file */ + if(H5FO_top_decr(grp->oloc.file, grp->oloc.addr) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "can't decrement count for object") + + /* Check reference count for this object in the top file */ + if(H5FO_top_count(grp->oloc.file, grp->oloc.addr) == 0) { + if(H5O_close(&(grp->oloc)) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to close") + } /* end if */ + else + /* Free object location (i.e. "unhold" the file if appropriate) */ + if(H5O_loc_free(&(grp->oloc)) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "problem attempting to free location") + + /* If this group is a mount point and the mount point is the last open + * reference to the group, then attempt to close down the file hierarchy + */ + if(grp->shared->mounted && grp->shared->fo_count == 1) { + /* Attempt to close down the file hierarchy */ + if(H5F_try_close(grp->oloc.file) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "problem attempting file close") + } /* end if */ + } /* end else */ + + if(H5G_name_free(&(grp->path)) < 0) { + grp = H5FL_FREE(H5G_t, grp); + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't free group entry name") + } /* end if */ + + grp = H5FL_FREE(H5G_t, grp); + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5G_close() */ + + +/*------------------------------------------------------------------------- + * Function: H5G_oloc + * + * Purpose: Returns a pointer to the object location for a group. + * + * Return: Success: Ptr to group entry + * Failure: NULL + * + * Programmer: Robb Matzke + * Tuesday, March 24, 1998 + * + *------------------------------------------------------------------------- + */ +H5O_loc_t * +H5G_oloc(H5G_t *grp) +{ + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR + + FUNC_LEAVE_NOAPI(grp ? &(grp->oloc) : NULL) +} /* end H5G_oloc() */ + + +/*------------------------------------------------------------------------- + * Function: H5G_nameof + * + * Purpose: Returns a pointer to the hier. name for a group. + * + * Return: Success: Ptr to hier. name + * Failure: NULL + * + * Programmer: Quincey Koziol + * Monday, September 12, 2005 + * + *------------------------------------------------------------------------- + */ +H5G_name_t * +H5G_nameof(H5G_t *grp) +{ + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR + + FUNC_LEAVE_NOAPI(grp ? &(grp->path) : NULL) +} /* end H5G_nameof() */ + + +/*------------------------------------------------------------------------- + * Function: H5G_fileof + * + * Purpose: Returns the file to which the specified group belongs. + * + * Return: Success: File pointer. + * + * Failure: NULL + * + * Programmer: Robb Matzke + * Tuesday, March 24, 1998 + * + *------------------------------------------------------------------------- + */ +H5F_t * +H5G_fileof(H5G_t *grp) +{ + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR + + HDassert(grp); + + FUNC_LEAVE_NOAPI(grp->oloc.file) +} /* end H5G_fileof() */ + + +/*------------------------------------------------------------------------- + * Function: H5G_get_shared_count + * + * Purpose: Queries the group object's "shared count" + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * Tuesday, July 5, 2005 + * + *------------------------------------------------------------------------- + */ +herr_t +H5G_get_shared_count(H5G_t *grp) +{ + FUNC_ENTER_NOAPI_NOINIT_NOERR + + /* Check args */ + HDassert(grp && grp->shared); + + FUNC_LEAVE_NOAPI(grp->shared->fo_count) +} /* end H5G_get_shared_count() */ + + +/*------------------------------------------------------------------------- + * Function: H5G_mount + * + * Purpose: Sets the 'mounted' flag for a group + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * Tuesday, July 19, 2005 + * + *------------------------------------------------------------------------- + */ +herr_t +H5G_mount(H5G_t *grp) +{ + FUNC_ENTER_NOAPI_NOINIT_NOERR + + /* Check args */ + HDassert(grp && grp->shared); + HDassert(grp->shared->mounted == FALSE); + + /* Set the 'mounted' flag */ + grp->shared->mounted = TRUE; + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5G_mount() */ + + +/*------------------------------------------------------------------------- + * Function: H5G_mounted + * + * Purpose: Retrieves the 'mounted' flag for a group + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * Tuesday, July 15, 2008 + * + *------------------------------------------------------------------------- + */ +hbool_t +H5G_mounted(H5G_t *grp) +{ + FUNC_ENTER_NOAPI_NOINIT_NOERR + + /* Check args */ + HDassert(grp && grp->shared); + + FUNC_LEAVE_NOAPI(grp->shared->mounted) +} /* end H5G_mounted() */ + + +/*------------------------------------------------------------------------- + * Function: H5G_unmount + * + * Purpose: Resets the 'mounted' flag for a group + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * Tuesday, July 19, 2005 + * + *------------------------------------------------------------------------- + */ +herr_t +H5G_unmount(H5G_t *grp) +{ + FUNC_ENTER_NOAPI_NOINIT_NOERR + + /* Check args */ + HDassert(grp && grp->shared); + HDassert(grp->shared->mounted == TRUE); + + /* Reset the 'mounted' flag */ + grp->shared->mounted = FALSE; + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5G_unmount() */ + + +/*------------------------------------------------------------------------- + * Function: H5G_iterate_cb + * + * Purpose: Callback function for iterating over links in a group + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * Oct 3, 2005 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5G_iterate_cb(const H5O_link_t *lnk, void *_udata) +{ + H5G_iter_appcall_ud_t *udata = (H5G_iter_appcall_ud_t *)_udata; /* User data for callback */ + herr_t ret_value = H5_ITER_ERROR; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT + + /* Sanity check */ + HDassert(lnk); + HDassert(udata); + + switch(udata->lnk_op.op_type) { +#ifndef H5_NO_DEPRECATED_SYMBOLS + case H5G_LINK_OP_OLD: + /* Make the old-type application callback */ + ret_value = (udata->lnk_op.op_func.op_old)(udata->gid, lnk->name, udata->op_data); + break; +#endif /* H5_NO_DEPRECATED_SYMBOLS */ + + case H5G_LINK_OP_NEW: + { + H5L_info_t info; /* Link info */ + + /* Retrieve the info for the link */ + if(H5G_link_to_info(lnk, &info) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, H5_ITER_ERROR, "unable to get info for link") + + /* Make the application callback */ + ret_value = (udata->lnk_op.op_func.op_new)(udata->gid, lnk->name, &info, udata->op_data); + } + break; + + default: + HDassert(0 && "Unknown link op type?!?"); + } /* end switch */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5G_iterate_cb() */ + + +/*------------------------------------------------------------------------- + * Function: H5G_iterate + * + * Purpose: Private function for iterating over links in a group + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * Oct 3, 2005 + * + *------------------------------------------------------------------------- + */ +herr_t +H5G_iterate(hid_t loc_id, const char *group_name, + H5_index_t idx_type, H5_iter_order_t order, hsize_t skip, hsize_t *last_lnk, + const H5G_link_iterate_t *lnk_op, void *op_data, hid_t lapl_id, hid_t dxpl_id) +{ + H5G_loc_t loc; /* Location of parent for group */ + hid_t gid = -1; /* ID of group to iterate over */ + H5G_t *grp = NULL; /* Pointer to group data structure to iterate over */ + H5G_iter_appcall_ud_t udata; /* User data for callback */ + herr_t ret_value; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity check */ + HDassert(group_name); + HDassert(last_lnk); + HDassert(lnk_op && lnk_op->op_func.op_new); + + /* + * Open the group on which to operate. We also create a group ID which + * we can pass to the application-defined operator. + */ + if(H5G_loc(loc_id, &loc) < 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") + if(NULL == (grp = H5G__open_name(&loc, group_name, lapl_id, dxpl_id))) + HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open group") + if((gid = H5I_register(H5I_GROUP, grp, TRUE)) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register group") + + /* Set up user data for callback */ + udata.gid = gid; + udata.lnk_op = *lnk_op; + udata.op_data = op_data; + + /* Call the real group iteration routine */ + if((ret_value = H5G__obj_iterate(&(grp->oloc), idx_type, order, skip, last_lnk, H5G_iterate_cb, &udata, dxpl_id)) < 0) + HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "error iterating over links") + +done: + /* Release the group opened */ + if(gid > 0) { + if(H5I_dec_app_ref(gid) < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "unable to close group") + } /* end if */ + else if(grp && H5G_close(grp) < 0) + HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "unable to release group") + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5G_iterate() */ + + +/*------------------------------------------------------------------------- + * Function: H5G_free_visit_visited + * + * Purpose: Free the key for an object visited during a group traversal + * + * Return: Non-negative on success, negative on failure + * + * Programmer: Quincey Koziol + * Nov 4, 2007 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5G_free_visit_visited(void *item, void UNUSED *key, void UNUSED *operator_data/*in,out*/) +{ + FUNC_ENTER_NOAPI_NOINIT_NOERR + + item = H5FL_FREE(H5_obj_t, item); + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5G_free_visit_visited() */ + + +/*------------------------------------------------------------------------- + * Function: H5G_visit_cb + * + * Purpose: Callback function for recursively visiting links from a group + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * Nov 4, 2007 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5G_visit_cb(const H5O_link_t *lnk, void *_udata) +{ + H5G_iter_visit_ud_t *udata = (H5G_iter_visit_ud_t *)_udata; /* User data for callback */ + H5L_info_t info; /* Link info */ + H5G_loc_t obj_loc; /* Location of object */ + H5G_name_t obj_path; /* Object's group hier. path */ + H5O_loc_t obj_oloc; /* Object's object location */ + hbool_t obj_found = FALSE; /* Object at 'name' found */ + size_t old_path_len = udata->curr_path_len; /* Length of path before appending this link's name */ + size_t link_name_len; /* Length of link's name */ + size_t len_needed; /* Length of path string needed */ + herr_t ret_value = H5_ITER_CONT; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT + + /* Sanity check */ + HDassert(lnk); + HDassert(udata); + + /* Check if we will need more space to store this link's relative path */ + /* ("+2" is for string terminator and possible '/' for group separator later) */ + link_name_len = HDstrlen(lnk->name); + len_needed = udata->curr_path_len + link_name_len + 2; + if(len_needed > udata->path_buf_size) { + void *new_path; /* Pointer to new path buffer */ + + /* Attempt to allocate larger buffer for path */ + if(NULL == (new_path = H5MM_realloc(udata->path, len_needed))) + HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, H5_ITER_ERROR, "can't allocate path string") + udata->path = (char *)new_path; + udata->path_buf_size = len_needed; + } /* end if */ + + /* Build the link's relative path name */ + HDassert(udata->path[old_path_len] == '\0'); + HDstrcpy(&(udata->path[old_path_len]), lnk->name); + udata->curr_path_len += link_name_len; + + /* Construct the link info from the link message */ + if(H5G_link_to_info(lnk, &info) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, H5_ITER_ERROR, "unable to get info for link") + + /* Make the application callback */ + ret_value = (udata->op)(udata->gid, udata->path, &info, udata->op_data); + + /* Check for doing more work */ + if(ret_value == H5_ITER_CONT && lnk->type == H5L_TYPE_HARD) { + H5_obj_t obj_pos; /* Object "position" for this object */ + + /* Set up opened group location to fill in */ + obj_loc.oloc = &obj_oloc; + obj_loc.path = &obj_path; + H5G_loc_reset(&obj_loc); + + /* Find the object using the LAPL passed in */ + /* (Correctly handles mounted files) */ + if(H5G_loc_find(udata->curr_loc, lnk->name, &obj_loc/*out*/, udata->lapl_id, udata->dxpl_id) < 0) + HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, H5_ITER_ERROR, "object not found") + obj_found = TRUE; + + /* Construct unique "position" for this object */ + H5F_GET_FILENO(obj_oloc.file, obj_pos.fileno); + obj_pos.addr = obj_oloc.addr; + + /* Check if we've seen the object the link references before */ + if(NULL == H5SL_search(udata->visited, &obj_pos)) { + H5O_type_t otype; /* Basic object type (group, dataset, etc.) */ + unsigned rc; /* Reference count of object */ + + /* Get the object's reference count and type */ + if(H5O_get_rc_and_type(&obj_oloc, udata->dxpl_id, &rc, &otype) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, H5_ITER_ERROR, "unable to get object info") + + /* If its ref count is > 1, we add it to the list of visited objects */ + /* (because it could come up again during traversal) */ + if(rc > 1) { + H5_obj_t *new_node; /* New object node for visited list */ + + /* Allocate new object "position" node */ + if((new_node = H5FL_MALLOC(H5_obj_t)) == NULL) + HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, H5_ITER_ERROR, "can't allocate object node") + + /* Set node information */ + *new_node = obj_pos; + + /* Add to list of visited objects */ + if(H5SL_insert(udata->visited, new_node, new_node) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, H5_ITER_ERROR, "can't insert object node into visited list") + } /* end if */ + + /* If it's a group, we recurse into it */ + if(otype == H5O_TYPE_GROUP) { + H5G_loc_t *old_loc = udata->curr_loc; /* Pointer to previous group location info */ + H5_index_t idx_type = udata->idx_type; /* Type of index to use */ + H5O_linfo_t linfo; /* Link info message */ + htri_t linfo_exists; /* Whether the link info message exists */ + + /* Add the path separator to the current path */ + HDassert(udata->path[udata->curr_path_len] == '\0'); + HDstrcpy(&(udata->path[udata->curr_path_len]), "/"); + udata->curr_path_len++; + + /* Attempt to get the link info for this group */ + if((linfo_exists = H5G__obj_get_linfo(&obj_oloc, &linfo, udata->dxpl_id)) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, H5_ITER_ERROR, "can't check for link info message") + if(linfo_exists) { + /* Check for creation order tracking, if creation order index lookup requested */ + if(idx_type == H5_INDEX_CRT_ORDER) { + /* Check if creation order is tracked */ + if(!linfo.track_corder) + /* Switch to name order for this group */ + idx_type = H5_INDEX_NAME; + } /* end if */ + else + HDassert(idx_type == H5_INDEX_NAME); + } /* end if */ + else { + /* Can only perform name lookups on groups with symbol tables */ + if(idx_type != H5_INDEX_NAME) + /* Switch to name order for this group */ + idx_type = H5_INDEX_NAME; + } /* end if */ + + /* Point to this group's location info */ + udata->curr_loc = &obj_loc; + + /* Iterate over links in group */ + ret_value = H5G__obj_iterate(&obj_oloc, idx_type, udata->order, (hsize_t)0, NULL, H5G_visit_cb, udata, udata->dxpl_id); + + /* Restore location */ + udata->curr_loc = old_loc; + } /* end if */ + } /* end if */ + } /* end if */ + +done: + /* Reset path back to incoming path */ + udata->path[old_path_len] = '\0'; + udata->curr_path_len = old_path_len; + + /* Release resources */ + if(obj_found && H5G_loc_free(&obj_loc) < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRELEASE, H5_ITER_ERROR, "can't free location") + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5G_visit_cb() */ + + +/*------------------------------------------------------------------------- + * Function: H5G_visit + * + * Purpose: Recursively visit all the links in a group and all + * the groups that are linked to from that group. Links within + * each group are visited according to the order within the + * specified index (unless the specified index does not exist for + * a particular group, then the "name" index is used). + * + * NOTE: Each _link_ reachable from the initial group will only be + * visited once. However, because an object may be reached from + * more than one link, the visitation may call the application's + * callback with more than one link that points to a particular + * _object_. + * + * 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. + * + * + * + * Programmer: Quincey Koziol + * November 4 2007 + * + *------------------------------------------------------------------------- + */ +herr_t +H5G_visit(hid_t loc_id, const char *group_name, H5_index_t idx_type, + H5_iter_order_t order, H5L_iterate_t op, void *op_data, hid_t lapl_id, + hid_t dxpl_id) +{ + H5G_iter_visit_ud_t udata; /* User data for callback */ + H5O_linfo_t linfo; /* Link info message */ + htri_t linfo_exists; /* Whether the link info message exists */ + hid_t gid = (-1); /* Group ID */ + H5G_t *grp = NULL; /* Group opened */ + H5G_loc_t loc; /* Location of group passed in */ + H5G_loc_t start_loc; /* Location of starting group */ + unsigned rc; /* Reference count of object */ + herr_t ret_value; /* Return value */ + + /* Portably clear udata struct (before FUNC_ENTER) */ + HDmemset(&udata, 0, sizeof(udata)); + + FUNC_ENTER_NOAPI(FAIL) + + /* Check args */ + if(H5G_loc(loc_id, &loc) < 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") + + /* Open the group to begin visiting within */ + if((grp = H5G__open_name(&loc, group_name, lapl_id, dxpl_id)) == NULL) + HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open group") + + /* Register an ID for the starting group */ + if((gid = H5I_register(H5I_GROUP, grp, TRUE)) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register group") + + /* Get the location of the starting group */ + if(H5G_loc(gid, &start_loc) < 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") + + /* Set up user data */ + udata.gid = gid; + udata.curr_loc = &start_loc; + udata.lapl_id = lapl_id; + udata.dxpl_id = dxpl_id; + udata.idx_type = idx_type; + udata.order = order; + udata.op = op; + udata.op_data = op_data; + + /* Allocate space for the path name */ + if(NULL == (udata.path = H5MM_strdup(""))) + HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate path name buffer") + udata.path_buf_size = 1; + udata.curr_path_len = 0; + + /* Create skip list to store visited object information */ + if((udata.visited = H5SL_create(H5SL_TYPE_OBJ, NULL)) == NULL) + HGOTO_ERROR(H5E_SYM, H5E_CANTCREATE, FAIL, "can't create skip list for visited objects") + + /* Get the group's reference count */ + if(H5O_get_rc_and_type(&grp->oloc, dxpl_id, &rc, NULL) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to get object info") + + /* If its ref count is > 1, we add it to the list of visited objects */ + /* (because it could come up again during traversal) */ + if(rc > 1) { + H5_obj_t *obj_pos; /* New object node for visited list */ + + /* Allocate new object "position" node */ + if((obj_pos = H5FL_MALLOC(H5_obj_t)) == NULL) + HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't allocate object node") + + /* Construct unique "position" for this object */ + H5F_GET_FILENO(grp->oloc.file, obj_pos->fileno); + obj_pos->addr = grp->oloc.addr; + + /* Add to list of visited objects */ + if(H5SL_insert(udata.visited, obj_pos, obj_pos) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "can't insert object node into visited list") + } /* end if */ + + /* Attempt to get the link info for this group */ + if((linfo_exists = H5G__obj_get_linfo(&(grp->oloc), &linfo, dxpl_id)) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't check for link info message") + if(linfo_exists) { + /* Check for creation order tracking, if creation order index lookup requested */ + if(idx_type == H5_INDEX_CRT_ORDER) { + /* Check if creation order is tracked */ + if(!linfo.track_corder) + /* Switch to name order for this group */ + idx_type = H5_INDEX_NAME; + } /* end if */ + else + HDassert(idx_type == H5_INDEX_NAME); + } /* end if */ + else { + /* Can only perform name lookups on groups with symbol tables */ + if(idx_type != H5_INDEX_NAME) + /* Switch to name order for this group */ + idx_type = H5_INDEX_NAME; + } /* end if */ + + /* Call the link iteration routine */ + if((ret_value = H5G__obj_iterate(&(grp->oloc), idx_type, order, (hsize_t)0, NULL, H5G_visit_cb, &udata, dxpl_id)) < 0) + HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "can't visit links") + +done: + /* Release user data resources */ + H5MM_xfree(udata.path); + if(udata.visited) + H5SL_destroy(udata.visited, H5G_free_visit_visited, NULL); + + /* Release the group opened */ + if(gid > 0) { + if(H5I_dec_app_ref(gid) < 0) + HDONE_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "unable to close group") + } /* end if */ + else if(grp && H5G_close(grp) < 0) + HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "unable to release group") + FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_normalize() */ +} /* end H5G_visit() */ diff --git a/src/H5Glink.c b/src/H5Glink.c index 0049bfd..f934052 100644 --- a/src/H5Glink.c +++ b/src/H5Glink.c @@ -63,6 +63,11 @@ /* Local Prototypes */ /********************/ +static int H5G_link_cmp_name_inc(const void *lnk1, const void *lnk2); +static int H5G_link_cmp_name_dec(const void *lnk1, const void *lnk2); +static int H5G_link_cmp_corder_inc(const void *lnk1, const void *lnk2); +static int H5G_link_cmp_corder_dec(const void *lnk1, const void *lnk2); + /*********************/ /* Package Variables */ @@ -98,10 +103,10 @@ * *------------------------------------------------------------------------- */ -int +static int H5G_link_cmp_name_inc(const void *lnk1, const void *lnk2) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_link_cmp_name_inc) + FUNC_ENTER_NOAPI_NOINIT_NOERR FUNC_LEAVE_NOAPI(HDstrcmp(((const H5O_link_t *)lnk1)->name, ((const H5O_link_t *)lnk2)->name)) } /* end H5G_link_cmp_name_inc() */ @@ -125,10 +130,10 @@ H5G_link_cmp_name_inc(const void *lnk1, const void *lnk2) * *------------------------------------------------------------------------- */ -int +static int H5G_link_cmp_name_dec(const void *lnk1, const void *lnk2) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_link_cmp_name_dec) + FUNC_ENTER_NOAPI_NOINIT_NOERR FUNC_LEAVE_NOAPI(HDstrcmp(((const H5O_link_t *)lnk2)->name, ((const H5O_link_t *)lnk1)->name)) } /* end H5G_link_cmp_name_dec() */ @@ -151,12 +156,12 @@ H5G_link_cmp_name_dec(const void *lnk1, const void *lnk2) * *------------------------------------------------------------------------- */ -int +static int H5G_link_cmp_corder_inc(const void *lnk1, const void *lnk2) { int ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_link_cmp_corder_inc) + FUNC_ENTER_NOAPI_NOINIT_NOERR if(((const H5O_link_t *)lnk1)->corder < ((const H5O_link_t *)lnk2)->corder) ret_value = -1; @@ -186,12 +191,12 @@ H5G_link_cmp_corder_inc(const void *lnk1, const void *lnk2) * *------------------------------------------------------------------------- */ -int +static int H5G_link_cmp_corder_dec(const void *lnk1, const void *lnk2) { int ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_link_cmp_corder_dec) + FUNC_ENTER_NOAPI_NOINIT_NOERR if(((const H5O_link_t *)lnk1)->corder < ((const H5O_link_t *)lnk2)->corder) ret_value = 1; @@ -205,7 +210,7 @@ H5G_link_cmp_corder_dec(const void *lnk1, const void *lnk2) /*------------------------------------------------------------------------- - * Function: H5G_ent_to_link + * Function: H5G__ent_to_link * * Purpose: Convert a symbol table entry to a link * @@ -218,10 +223,10 @@ H5G_link_cmp_corder_dec(const void *lnk1, const void *lnk2) *------------------------------------------------------------------------- */ herr_t -H5G_ent_to_link(H5O_link_t *lnk, const H5HL_t *heap, +H5G__ent_to_link(H5O_link_t *lnk, const H5HL_t *heap, const H5G_entry_t *ent, const char *name) { - FUNC_ENTER_NOAPI_NOFUNC(H5G_ent_to_link) + FUNC_ENTER_PACKAGE_NOERR /* check arguments */ HDassert(lnk); @@ -258,7 +263,7 @@ H5G_ent_to_link(H5O_link_t *lnk, const H5HL_t *heap, } /* end else */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5G_ent_to_link() */ +} /* end H5G__ent_to_link() */ /*------------------------------------------------------------------------- @@ -278,7 +283,7 @@ H5G_link_to_info(const H5O_link_t *lnk, H5L_info_t *info) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5G_link_to_info, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ HDassert(lnk); @@ -338,7 +343,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_link_to_loc + * Function: H5G__link_to_loc * * Purpose: Build group location from group and link object * @@ -350,12 +355,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G_link_to_loc(const H5G_loc_t *grp_loc, const H5O_link_t *lnk, +H5G__link_to_loc(const H5G_loc_t *grp_loc, const H5O_link_t *lnk, H5G_loc_t *obj_loc) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5G_link_to_loc, FAIL) + FUNC_ENTER_PACKAGE /* Sanity check */ HDassert(grp_loc); @@ -382,145 +387,11 @@ H5G_link_to_loc(const H5G_loc_t *grp_loc, const H5O_link_t *lnk, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_link_to_loc() */ - - -/*------------------------------------------------------------------------- - * Function: H5G_link_copy_file - * - * Purpose: Copy a link and the object it points to from one file to - * another. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Sep 29 2006 - * - *------------------------------------------------------------------------- - */ -herr_t -H5G_link_copy_file(H5F_t *dst_file, hid_t dxpl_id, const H5O_link_t *_src_lnk, - const H5O_loc_t *src_oloc, H5O_link_t *dst_lnk, H5O_copy_t *cpy_info) -{ - H5O_link_t tmp_src_lnk; /* Temporary copy of src link, when needed */ - const H5O_link_t *src_lnk = _src_lnk; /* Source link */ - hbool_t dst_lnk_init = FALSE; /* Whether the destination link is initialized */ - hbool_t expanded_link_open = FALSE; /* Whether the target location has been opened */ - H5G_loc_t tmp_src_loc; /* Group location holding target object */ - H5G_name_t tmp_src_path; /* Path for target object */ - H5O_loc_t tmp_src_oloc; /* Object location for target object */ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5G_link_copy_file, FAIL) - - /* check arguments */ - HDassert(dst_file); - HDassert(src_lnk); - HDassert(dst_lnk); - HDassert(cpy_info); - - /* Expand soft or external link, if requested */ - if((H5L_TYPE_SOFT == src_lnk->type && cpy_info->expand_soft_link) - || (H5L_TYPE_EXTERNAL == src_lnk->type - && cpy_info->expand_ext_link)) { - H5G_loc_t lnk_grp_loc; /* Group location holding link */ - H5G_name_t lnk_grp_path; /* Path for link */ - htri_t tar_exists; /* Whether the target object exists */ - - /* Set up group location for link */ - H5G_name_reset(&lnk_grp_path); - lnk_grp_loc.path = &lnk_grp_path; - lnk_grp_loc.oloc = (H5O_loc_t *)src_oloc; /* Casting away const OK -QAK */ - - /* Check if the target object exists */ - if((tar_exists = H5G_loc_exists(&lnk_grp_loc, src_lnk->name, H5P_DEFAULT, - dxpl_id)) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to check if target object exists") - - if(tar_exists) { - /* Make a temporary copy of the link, so that it will not change the - * info in the cache when we change it to a hard link */ - if(NULL == H5O_msg_copy(H5O_LINK_ID, src_lnk, &tmp_src_lnk)) - HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy message") - - /* Set up group location for target object. Let H5G_traverse expand - * the link. */ - tmp_src_loc.path = &tmp_src_path; - tmp_src_loc.oloc = &tmp_src_oloc; - if(H5G_loc_reset(&tmp_src_loc) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to reset location") - - /* Find the target object */ - if(H5G_loc_find(&lnk_grp_loc, src_lnk->name, &tmp_src_loc, - H5P_DEFAULT, dxpl_id) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to find target object") - expanded_link_open = TRUE; - - /* Convert symbolic link to hard link */ - if(tmp_src_lnk.type == H5L_TYPE_SOFT) - tmp_src_lnk.u.soft.name = - (char *)H5MM_xfree(tmp_src_lnk.u.soft.name); - else if(tmp_src_lnk.u.ud.size > 0) - tmp_src_lnk.u.ud.udata = H5MM_xfree(tmp_src_lnk.u.ud.udata); - tmp_src_lnk.type = H5L_TYPE_HARD; - tmp_src_lnk.u.hard.addr = tmp_src_oloc.addr; - src_lnk = &tmp_src_lnk; - } /* end if */ - } /* end if */ - - /* Copy src link information to dst link information */ - if(NULL == H5O_msg_copy(H5O_LINK_ID, src_lnk, dst_lnk)) - HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy message") - dst_lnk_init = TRUE; - - /* Check if object in source group is a hard link & copy it */ - if(H5L_TYPE_HARD == src_lnk->type) { - H5O_loc_t new_dst_oloc; /* Copied object location in destination */ - - /* Set up copied object location to fill in */ - H5O_loc_reset(&new_dst_oloc); - new_dst_oloc.file = dst_file; - - if(!expanded_link_open) { - /* Build temporary object location for source */ - H5O_loc_reset(&tmp_src_oloc); - tmp_src_oloc.file = src_oloc->file; - tmp_src_oloc.addr = src_lnk->u.hard.addr; - } /* end if */ - HDassert(H5F_addr_defined(tmp_src_oloc.addr)); - - /* Copy the shared object from source to destination */ - /* Don't care about obj_type or udata because those are only important - * for old style groups */ - if(H5O_copy_header_map(&tmp_src_oloc, &new_dst_oloc, dxpl_id, cpy_info, - TRUE, NULL, NULL) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy object") - - /* Copy new destination object's information for eventual insertion */ - dst_lnk->u.hard.addr = new_dst_oloc.addr; - } /* end if */ - -done: - /* Check if we used a temporary src link */ - if(src_lnk != _src_lnk) { - HDassert(src_lnk == &tmp_src_lnk); - H5O_msg_reset(H5O_LINK_ID, &tmp_src_lnk); - } /* end if */ - if(ret_value < 0) - if(dst_lnk_init) - H5O_msg_reset(H5O_LINK_ID, dst_lnk); - /* Check if we need to free the temp source oloc */ - if(expanded_link_open) - if(H5G_loc_free(&tmp_src_loc) < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to free object") - - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_link_copy_file() */ +} /* end H5G__link_to_loc() */ /*------------------------------------------------------------------------- - * Function: H5G_link_sort_table + * Function: H5G__link_sort_table * * Purpose: Sort table containing a list of links for a group * @@ -533,10 +404,10 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G_link_sort_table(H5G_link_table_t *ltable, H5_index_t idx_type, +H5G__link_sort_table(H5G_link_table_t *ltable, H5_index_t idx_type, H5_iter_order_t order) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_link_sort_table) + FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ HDassert(ltable); @@ -561,11 +432,11 @@ H5G_link_sort_table(H5G_link_table_t *ltable, H5_index_t idx_type, } /* end else */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5G_link_sort_table() */ +} /* end H5G__link_sort_table() */ /*------------------------------------------------------------------------- - * Function: H5G_link_iterate_table + * Function: H5G__link_iterate_table * * Purpose: Iterate over table containing a list of links for a group, * making appropriate callbacks @@ -579,13 +450,13 @@ H5G_link_sort_table(H5G_link_table_t *ltable, H5_index_t idx_type, *------------------------------------------------------------------------- */ herr_t -H5G_link_iterate_table(const H5G_link_table_t *ltable, hsize_t skip, +H5G__link_iterate_table(const H5G_link_table_t *ltable, hsize_t skip, hsize_t *last_lnk, const H5G_lib_iterate_t op, void *op_data) { size_t u; /* Local index variable */ herr_t ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOERR(H5G_link_iterate_table, -) + FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ HDassert(ltable); @@ -611,11 +482,11 @@ H5G_link_iterate_table(const H5G_link_table_t *ltable, hsize_t skip, HERROR(H5E_SYM, H5E_CANTNEXT, "iteration operator failed"); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_link_iterate_table() */ +} /* end H5G__link_iterate_table() */ /*------------------------------------------------------------------------- - * Function: H5G_link_release_table + * Function: H5G__link_release_table * * Purpose: Release table containing a list of links for a group * @@ -628,12 +499,12 @@ H5G_link_iterate_table(const H5G_link_table_t *ltable, hsize_t skip, *------------------------------------------------------------------------- */ herr_t -H5G_link_release_table(H5G_link_table_t *ltable) +H5G__link_release_table(H5G_link_table_t *ltable) { size_t u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5G_link_release_table) + FUNC_ENTER_PACKAGE /* Sanity check */ HDassert(ltable); @@ -653,11 +524,11 @@ H5G_link_release_table(H5G_link_table_t *ltable) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_link_release_table() */ +} /* end H5G__link_release_table() */ /*------------------------------------------------------------------------- - * Function: H5G_link_name_replace + * Function: H5G__link_name_replace * * Purpose: Determine the type of object referred to (for hard links) or * the link type (for soft links and user-defined links). @@ -671,13 +542,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G_link_name_replace(H5F_t *file, hid_t dxpl_id, H5RS_str_t *grp_full_path_r, +H5G__link_name_replace(H5F_t *file, hid_t dxpl_id, H5RS_str_t *grp_full_path_r, const H5O_link_t *lnk) { H5RS_str_t *obj_path_r = NULL; /* Full path for link being removed */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5G_link_name_replace, FAIL) + FUNC_ENTER_PACKAGE /* check arguments */ HDassert(file); @@ -694,5 +565,5 @@ done: H5RS_decr(obj_path_r); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_link_name_replace() */ +} /* end H5G__link_name_replace() */ diff --git a/src/H5Gloc.c b/src/H5Gloc.c index 23db587..0da71bc 100644 --- a/src/H5Gloc.c +++ b/src/H5Gloc.c @@ -161,7 +161,7 @@ H5G_loc(hid_t loc_id, H5G_loc_t *loc) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5G_loc, FAIL) + FUNC_ENTER_NOAPI(FAIL) switch(H5I_get_type(loc_id)) { case H5I_FILE: @@ -275,7 +275,7 @@ H5G_loc_copy(H5G_loc_t *dst, const H5G_loc_t *src, H5_copy_depth_t depth) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5G_loc_copy, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args. */ HDassert(dst); @@ -309,7 +309,7 @@ H5G_loc_reset(H5G_loc_t *loc) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5G_loc_reset, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args. */ HDassert(loc); @@ -342,7 +342,7 @@ H5G_loc_free(H5G_loc_t *loc) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5G_loc_free, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args. */ HDassert(loc); @@ -378,7 +378,7 @@ H5G_loc_find_cb(H5G_loc_t UNUSED *grp_loc/*in*/, const char *name, H5G_loc_fnd_t *udata = (H5G_loc_fnd_t *)_udata; /* User data passed in */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5G_loc_find_cb) + FUNC_ENTER_NOAPI_NOINIT /* Check if the name in this group resolved to a valid object */ if(obj_loc == NULL) @@ -415,7 +415,7 @@ H5G_loc_find(const H5G_loc_t *loc, const char *name, H5G_loc_t *obj_loc/*out*/, H5G_loc_fnd_t udata; /* User data for traversal callback */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5G_loc_find, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args. */ HDassert(loc); @@ -460,7 +460,7 @@ H5G_loc_find_by_idx_cb(H5G_loc_t UNUSED *grp_loc/*in*/, const char UNUSED *name, hbool_t obj_exists = FALSE; /* Whether the object exists (unused) */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5G_loc_find_by_idx_cb) + FUNC_ENTER_NOAPI_NOINIT /* Check if the name in this group resolved to a valid link */ if(obj_loc == NULL) @@ -473,14 +473,14 @@ H5G_loc_find_by_idx_cb(H5G_loc_t UNUSED *grp_loc/*in*/, const char UNUSED *name, lnk_copied = TRUE; /* Build the initial object location for the link */ - if(H5G_link_to_loc(obj_loc, &fnd_lnk, udata->loc) < 0) + if(H5G__link_to_loc(obj_loc, &fnd_lnk, udata->loc) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "cannot initialize object location") obj_loc_valid = TRUE; /* Perform any special traversals that the link needs */ /* (soft links, user-defined links, file mounting, etc.) */ /* (may modify the object location) */ - if(H5G_traverse_special(obj_loc, &fnd_lnk, H5G_TARGET_NORMAL, &links_left, TRUE, udata->loc, &obj_exists, udata->lapl_id, udata->dxpl_id) < 0) + if(H5G__traverse_special(obj_loc, &fnd_lnk, H5G_TARGET_NORMAL, &links_left, TRUE, udata->loc, &obj_exists, udata->lapl_id, udata->dxpl_id) < 0) HGOTO_ERROR(H5E_LINK, H5E_TRAVERSE, FAIL, "special link traversal failed") done: @@ -521,7 +521,7 @@ H5G_loc_find_by_idx(H5G_loc_t *loc, const char *group_name, H5_index_t idx_type, H5G_loc_fbi_t udata; /* User data for traversal callback */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5G_loc_find_by_idx, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args. */ HDassert(loc); @@ -546,7 +546,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_loc_insert + * Function: H5G__loc_insert * * Purpose: Insert an object at a location * @@ -558,13 +558,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G_loc_insert(H5G_loc_t *grp_loc, const char *name, H5G_loc_t *obj_loc, +H5G__loc_insert(H5G_loc_t *grp_loc, const char *name, H5G_loc_t *obj_loc, H5O_type_t obj_type, const void *crt_info, hid_t dxpl_id) { H5O_link_t lnk; /* Link for object to insert */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5G_loc_insert, FAIL) + FUNC_ENTER_PACKAGE /* Check args. */ HDassert(grp_loc); @@ -591,7 +591,7 @@ H5G_loc_insert(H5G_loc_t *grp_loc, const char *name, H5G_loc_t *obj_loc, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_loc_insert() */ +} /* end H5G__loc_insert() */ /*------------------------------------------------------------------------- @@ -613,7 +613,7 @@ H5G_loc_exists_cb(H5G_loc_t UNUSED *grp_loc/*in*/, const char UNUSED *name, { H5G_loc_exists_t *udata = (H5G_loc_exists_t *)_udata; /* User data passed in */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_loc_exists_cb) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check if the name in this group resolved to a valid object */ if(obj_loc == NULL) @@ -651,7 +651,7 @@ H5G_loc_exists(const H5G_loc_t *loc, const char *name, hid_t lapl_id, hid_t dxpl H5G_loc_exists_t udata; /* User data for traversal callback */ htri_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5G_loc_exists, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args. */ HDassert(loc); @@ -691,7 +691,7 @@ H5G_loc_info_cb(H5G_loc_t UNUSED *grp_loc/*in*/, const char UNUSED *name, const H5G_loc_info_t *udata = (H5G_loc_info_t *)_udata; /* User data passed in */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5G_loc_info_cb) + FUNC_ENTER_NOAPI_NOINIT /* Check if the name in this group resolved to a valid link */ if(obj_loc == NULL) @@ -730,7 +730,7 @@ H5G_loc_info(H5G_loc_t *loc, const char *name, hbool_t want_ih_info, H5O_info_t H5G_loc_info_t udata; /* User data for traversal callback */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5G_loc_info, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args. */ HDassert(loc); @@ -772,7 +772,7 @@ H5G_loc_set_comment_cb(H5G_loc_t UNUSED *grp_loc/*in*/, const char UNUSED *name, htri_t exists; /* Whether a "comment" message already exists */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5G_loc_set_comment_cb) + FUNC_ENTER_NOAPI_NOINIT /* Check if the name in this group resolved to a valid link */ if(obj_loc == NULL) @@ -824,7 +824,7 @@ H5G_loc_set_comment(H5G_loc_t *loc, const char *name, const char *comment, H5G_loc_sc_t udata; /* User data for traversal callback */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5G_loc_set_comment, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args. */ HDassert(loc); @@ -863,7 +863,7 @@ H5G_loc_get_comment_cb(H5G_loc_t UNUSED *grp_loc/*in*/, const char UNUSED *name, H5O_name_t comment; /* Object header "comment" message */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5G_loc_get_comment_cb) + FUNC_ENTER_NOAPI_NOINIT /* Check if the name in this group resolved to a valid link */ if(obj_loc == NULL) @@ -915,7 +915,7 @@ H5G_loc_get_comment(H5G_loc_t *loc, const char *name, char *comment/*out*/, H5G_loc_gc_t udata; /* User data for traversal callback */ ssize_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5G_loc_get_comment, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args. */ HDassert(loc); diff --git a/src/H5Gname.c b/src/H5Gname.c index c7feb62..62875dc 100644 --- a/src/H5Gname.c +++ b/src/H5Gname.c @@ -23,22 +23,36 @@ * *------------------------------------------------------------------------- */ -#define H5F_PACKAGE /*suppress error about including H5Fpkg */ + +/****************/ +/* Module Setup */ +/****************/ + #define H5G_PACKAGE /*suppress error about including H5Gpkg */ -/* Packages needed by this file... */ +/***********/ +/* Headers */ +/***********/ #include "H5private.h" /* Generic Functions */ #include "H5Dprivate.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ -#include "H5Fpkg.h" /* File access */ +#include "H5Fprivate.h" /* File access */ #include "H5FLprivate.h" /* Free Lists */ #include "H5Gpkg.h" /* Groups */ #include "H5Iprivate.h" /* IDs */ #include "H5Lprivate.h" /* Links */ #include "H5MMprivate.h" /* Memory wrappers */ -/* Private typedefs */ + +/****************/ +/* Local Macros */ +/****************/ + + +/******************/ +/* Local Typedefs */ +/******************/ /* Struct used by change name callback function */ typedef struct H5G_names_t { @@ -60,14 +74,15 @@ typedef struct H5G_gnba_iter_t { char *path; /* Name of the object */ } H5G_gnba_iter_t; -/* Private macros */ +/********************/ +/* Package Typedefs */ +/********************/ -/* Local variables */ -/* Declare extern the PQ free list for the wrapped strings */ -H5FL_BLK_EXTERN(str_buf); +/********************/ +/* Local Prototypes */ +/********************/ -/* PRIVATE PROTOTYPES */ static htri_t H5G_common_path(const H5RS_str_t *fullpath_r, const H5RS_str_t *prefix_r); static H5RS_str_t *H5G_build_fullpath(const char *prefix, const char *name); #ifdef NOT_YET @@ -77,6 +92,123 @@ static herr_t H5G_name_move_path(H5RS_str_t **path_r_ptr, const char *full_suffix, const char *src_path, const char *dst_path); static int H5G_name_replace_cb(void *obj_ptr, hid_t obj_id, void *key); + +/*********************/ +/* Package Variables */ +/*********************/ + +/* Declare extern the PQ free list for the wrapped strings */ +H5FL_BLK_EXTERN(str_buf); + + +/*****************************/ +/* Library Private Variables */ +/*****************************/ + + +/*******************/ +/* Local Variables */ +/*******************/ + + + +/*------------------------------------------------------------------------- + * Function: H5G__component + * + * Purpose: Returns the pointer to the first component of the + * specified name by skipping leading slashes. Returns + * the size in characters of the component through SIZE_P not + * counting leading slashes or the null terminator. + * + * Return: Success: Ptr into NAME. + * + * Failure: Ptr to the null terminator of NAME. + * + * Programmer: Robb Matzke + * matzke@llnl.gov + * Aug 11 1997 + * + *------------------------------------------------------------------------- + */ +const char * +H5G__component(const char *name, size_t *size_p) +{ + FUNC_ENTER_PACKAGE_NOERR + + assert(name); + + while ('/' == *name) + name++; + if (size_p) + *size_p = HDstrcspn(name, "/"); + + FUNC_LEAVE_NOAPI(name) +} /* end H5G__component() */ + + +/*------------------------------------------------------------------------- + * Function: H5G_normalize + * + * Purpose: Returns a pointer to a new string which has duplicate and + * trailing slashes removed from it. + * + * Return: Success: Ptr to normalized name. + * Failure: NULL + * + * Programmer: Quincey Koziol + * Saturday, August 16, 2003 + * + *------------------------------------------------------------------------- + */ +char * +H5G_normalize(const char *name) +{ + char *norm; /* Pointer to the normalized string */ + size_t s,d; /* Positions within the strings */ + unsigned last_slash; /* Flag to indicate last character was a slash */ + char *ret_value; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT + + /* Sanity check */ + HDassert(name); + + /* Duplicate the name, to return */ + if(NULL == (norm = H5MM_strdup(name))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for normalized string") + + /* Walk through the characters, omitting duplicated '/'s */ + s = d = 0; + last_slash = 0; + while(name[s] != '\0') { + if(name[s] == '/') + if(last_slash) + ; + else { + norm[d++] = name[s]; + last_slash = 1; + } /* end else */ + else { + norm[d++] = name[s]; + last_slash = 0; + } /* end else */ + s++; + } /* end while */ + + /* Terminate normalized string */ + norm[d] = '\0'; + + /* Check for final '/' on normalized name & eliminate it */ + if(d > 1 && last_slash) + norm[d - 1] = '\0'; + + /* Set return value */ + ret_value = norm; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5G_normalize() */ + /*------------------------------------------------------------------------- * Function: H5G_common_path @@ -100,16 +232,16 @@ H5G_common_path(const H5RS_str_t *fullpath_r, const H5RS_str_t *prefix_r) size_t nchars1,nchars2; /* Number of characters in components */ htri_t ret_value=FALSE; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_common_path) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Get component of each name */ fullpath=H5RS_get_str(fullpath_r); assert(fullpath); - fullpath=H5G_component(fullpath,&nchars1); + fullpath=H5G__component(fullpath,&nchars1); assert(fullpath); prefix=H5RS_get_str(prefix_r); assert(prefix); - prefix=H5G_component(prefix,&nchars2); + prefix=H5G__component(prefix,&nchars2); assert(prefix); /* Check if we have a real string for each component */ @@ -123,9 +255,9 @@ H5G_common_path(const H5RS_str_t *fullpath_r, const H5RS_str_t *prefix_r) prefix+=nchars2; /* Get next component of each name */ - fullpath=H5G_component(fullpath,&nchars1); + fullpath=H5G__component(fullpath,&nchars1); assert(fullpath); - prefix=H5G_component(prefix,&nchars2); + prefix=H5G__component(prefix,&nchars2); assert(prefix); } /* end if */ else @@ -165,7 +297,7 @@ H5G_build_fullpath(const char *prefix, const char *name) unsigned need_sep; /* Flag to indicate if separator is needed */ H5RS_str_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5G_build_fullpath) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(prefix); @@ -221,7 +353,7 @@ H5G_build_fullpath_refstr_str(H5RS_str_t *prefix_r, const char *name) const char *prefix; /* Pointer to raw string for path */ H5RS_str_t *ret_value; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_build_fullpath_refstr_str) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(prefix_r); HDassert(name); @@ -259,7 +391,7 @@ H5G_build_fullpath_refstr_refstr(const H5RS_str_t *prefix_r, const H5RS_str_t *n const char *name; /* Pointer to raw string of name */ H5RS_str_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_build_fullpath_refstr_refstr) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Get the pointer to the prefix */ prefix = H5RS_get_str(prefix_r); @@ -276,7 +408,7 @@ H5G_build_fullpath_refstr_refstr(const H5RS_str_t *prefix_r, const H5RS_str_t *n /*------------------------------------------------------------------------- - * Function: H5G_name_init + * Function: H5G__name_init * * Purpose: Set the initial path for a group hierarchy name * @@ -289,9 +421,9 @@ H5G_build_fullpath_refstr_refstr(const H5RS_str_t *prefix_r, const H5RS_str_t *n *------------------------------------------------------------------------- */ herr_t -H5G_name_init(H5G_name_t *name, const char *path) +H5G__name_init(H5G_name_t *name, const char *path) { - FUNC_ENTER_NOAPI_NOFUNC(H5G_name_init) + FUNC_ENTER_PACKAGE /* Check arguments */ HDassert(name); @@ -304,7 +436,7 @@ H5G_name_init(H5G_name_t *name, const char *path) name->obj_hidden = 0; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5G_name_init() */ +} /* end H5G__name_init() */ /*------------------------------------------------------------------------- @@ -321,11 +453,11 @@ H5G_name_init(H5G_name_t *name, const char *path) *------------------------------------------------------------------------- */ herr_t -H5G_name_set(H5G_name_t *loc, H5G_name_t *obj, const char *name) +H5G_name_set(const H5G_name_t *loc, H5G_name_t *obj, const char *name) { herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI(H5G_name_set, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert(loc); HDassert(obj); @@ -379,7 +511,7 @@ done: herr_t H5G_name_copy(H5G_name_t *dst, const H5G_name_t *src, H5_copy_depth_t depth) { - FUNC_ENTER_NOAPI_NOFUNC(H5G_name_copy) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments */ HDassert(src); @@ -432,7 +564,7 @@ H5G_get_name(const H5G_loc_t *loc, char *name/*out*/, size_t size, ssize_t len = 0; /* Length of object's name */ ssize_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5G_get_name, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ HDassert(loc); @@ -499,7 +631,7 @@ done: herr_t H5G_name_reset(H5G_name_t *name) { - FUNC_ENTER_NOAPI_NOFUNC(H5G_name_reset) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments */ HDassert(name); @@ -527,7 +659,7 @@ H5G_name_reset(H5G_name_t *name) herr_t H5G_name_free(H5G_name_t *name) { - FUNC_ENTER_NOAPI_NOFUNC(H5G_name_free) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(name); @@ -568,7 +700,7 @@ H5G_name_move_path(H5RS_str_t **path_r_ptr, const char *full_suffix, const char size_t full_suffix_len; /* Length of full suffix */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5G_name_move_path) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments */ HDassert(path_r_ptr && *path_r_ptr); @@ -670,7 +802,7 @@ H5G_name_replace_cb(void *obj_ptr, hid_t obj_id, void *key) hbool_t obj_in_child = FALSE; /* Flag to indicate that the object is in the child mount hier. */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5G_name_replace_cb) + FUNC_ENTER_NOAPI_NOINIT HDassert(obj_ptr); @@ -719,30 +851,30 @@ H5G_name_replace_cb(void *obj_ptr, hid_t obj_id, void *key) HGOTO_DONE(SUCCEED) /* No need to look at object, it's path is already invalid */ /* Find the top file in object's mount hier. */ - if(oloc->file->parent) { + if(H5F_PARENT(oloc->file)) { /* Check if object is in child file (for mount & unmount operations) */ - if(names->dst_file && oloc->file->shared == names->dst_file->shared) + if(names->dst_file && H5F_SAME_SHARED(oloc->file, names->dst_file)) obj_in_child = TRUE; /* Find the "top" file in the chain of mounted files */ - top_obj_file = oloc->file->parent; - while(top_obj_file->parent != NULL) { + top_obj_file = H5F_PARENT(oloc->file); + while(H5F_PARENT(top_obj_file) != NULL) { /* Check if object is in child mount hier. (for mount & unmount operations) */ - if(names->dst_file && top_obj_file->shared == names->dst_file->shared) + if(names->dst_file && H5F_SAME_SHARED(top_obj_file, names->dst_file)) obj_in_child = TRUE; - top_obj_file = top_obj_file->parent; + top_obj_file = H5F_PARENT(top_obj_file); } /* end while */ } /* end if */ else top_obj_file = oloc->file; /* Check if object is in top of child mount hier. (for mount & unmount operations) */ - if(names->dst_file && top_obj_file->shared == names->dst_file->shared) + if(names->dst_file && H5F_SAME_SHARED(top_obj_file, names->dst_file)) obj_in_child = TRUE; /* Check if the object is in same file mount hier. */ - if(top_obj_file->shared != names->src_file->shared) + if(!H5F_SAME_SHARED(top_obj_file, names->src_file)) HGOTO_DONE(SUCCEED) /* No need to look at object, it's path is already invalid */ switch(names->op) { @@ -938,7 +1070,7 @@ H5G_name_replace(const H5O_link_t *lnk, H5G_names_op_t op, H5F_t *src_file, { herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI(H5G_name_replace, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check arguments */ HDassert(src_file); @@ -1022,8 +1154,8 @@ H5G_name_replace(const H5O_link_t *lnk, H5G_names_op_t op, H5F_t *src_file, H5G_names_t names; /* Structure to hold operation information for callback */ /* Find top file in src location's mount hierarchy */ - while(src_file->parent) - src_file = src_file->parent; + while(H5F_PARENT(src_file)) + src_file = H5F_PARENT(src_file); /* Set up common information for callback */ names.src_file = src_file; @@ -1076,7 +1208,7 @@ H5G_get_name_by_addr_cb(hid_t gid, const char *path, const H5L_info_t *linfo, hbool_t obj_found = FALSE; /* Object at 'path' found */ herr_t ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5G_get_name_by_addr_cb) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(path); @@ -1105,7 +1237,8 @@ H5G_get_name_by_addr_cb(hid_t gid, const char *path, const H5L_info_t *linfo, /* Check for object in same file (handles mounted files) */ /* (re-verify address, in case we traversed a file mount) */ if(udata->loc->addr == obj_loc.oloc->addr && udata->loc->file == obj_loc.oloc->file) { - udata->path = H5MM_strdup(path); + if(NULL == (udata->path = H5MM_strdup(path))) + HGOTO_ERROR(H5E_SYM, H5E_CANTALLOC, H5_ITER_ERROR, "can't duplicate path string") /* We found a match so we return immediately */ HGOTO_DONE(H5_ITER_STOP) @@ -1145,7 +1278,10 @@ H5G_get_name_by_addr(hid_t file, hid_t lapl_id, hid_t dxpl_id, const H5O_loc_t * herr_t status; /* Status from iteration */ ssize_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5G_get_name_by_addr, FAIL) + /* Portably clear udata struct (before FUNC_ENTER) */ + HDmemset(&udata, 0, sizeof(udata)); + + FUNC_ENTER_NOAPI(FAIL) /* Construct the link info for the file's root group */ if(H5G_loc(file, &root_loc) < 0) @@ -1153,7 +1289,8 @@ H5G_get_name_by_addr(hid_t file, hid_t lapl_id, hid_t dxpl_id, const H5O_loc_t * /* Check for root group being the object looked for */ if(root_loc.oloc->addr == loc->addr && root_loc.oloc->file == loc->file) { - udata.path = H5MM_strdup(""); + if(NULL == (udata.path = H5MM_strdup(""))) + HGOTO_ERROR(H5E_SYM, H5E_CANTALLOC, FAIL, "can't duplicate path string") found_obj = TRUE; } /* end if */ else { diff --git a/src/H5Gnode.c b/src/H5Gnode.c index 9da5a6e..904def4 100644 --- a/src/H5Gnode.c +++ b/src/H5Gnode.c @@ -26,15 +26,21 @@ * *------------------------------------------------------------------------- */ + +/****************/ +/* Module Setup */ +/****************/ + #define H5G_PACKAGE /*suppress error about including H5Gpkg */ -#define H5F_PACKAGE /*suppress error about including H5Fpkg */ -/* Packages needed by this file... */ +/***********/ +/* Headers */ +/***********/ #include "H5private.h" /* Generic Functions */ #include "H5ACprivate.h" /* Metadata cache */ #include "H5Eprivate.h" /* Error handling */ -#include "H5Fpkg.h" /* File access */ +#include "H5Fprivate.h" /* File access */ #include "H5FLprivate.h" /* Free Lists */ #include "H5Gpkg.h" /* Groups */ #include "H5HLprivate.h" /* Local Heaps */ @@ -42,7 +48,15 @@ #include "H5MMprivate.h" /* Memory management */ #include "H5Ppublic.h" /* Property Lists */ -/* Private typedefs */ + +/****************/ +/* Local Macros */ +/****************/ + + +/******************/ +/* Local Typedefs */ +/******************/ /* * Each key field of the B-link tree that points to symbol table @@ -53,9 +67,14 @@ typedef struct H5G_node_key_t { } H5G_node_key_t; -/* Private macros */ +/********************/ +/* Package Typedefs */ +/********************/ + -/* PRIVATE PROTOTYPES */ +/********************/ +/* Local Prototypes */ +/********************/ /* B-tree callbacks */ static H5RC_t *H5G_node_get_shared(const H5F_t *f, const void *_udata); @@ -79,6 +98,11 @@ static herr_t H5G_node_encode_key(const H5B_shared_t *shared, uint8_t *raw, cons static herr_t H5G_node_debug_key(FILE *stream, int indent, int fwidth, const void *key, const void *udata); + +/*********************/ +/* Package Variables */ +/*********************/ + /* H5G inherits B-tree like properties from H5B */ H5B_class_t H5B_SNODE[1] = {{ H5B_SNODE_ID, /*id */ @@ -106,6 +130,16 @@ H5FL_DEFINE(H5G_node_t); /* Declare a free list to manage sequences of H5G_entry_t's */ H5FL_SEQ_DEFINE(H5G_entry_t); + +/*****************************/ +/* Library Private Variables */ +/*****************************/ + + +/*******************/ +/* Local Variables */ +/*******************/ + /*------------------------------------------------------------------------- * Function: H5G_node_get_shared @@ -127,7 +161,7 @@ H5FL_SEQ_DEFINE(H5G_entry_t); static H5RC_t * H5G_node_get_shared(const H5F_t *f, const void UNUSED *_udata) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_node_get_shared) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(f); @@ -154,7 +188,7 @@ H5G_node_decode_key(const H5B_shared_t *shared, const uint8_t *raw, void *_key) { H5G_node_key_t *key = (H5G_node_key_t *) _key; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_node_decode_key) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(shared); HDassert(raw); @@ -184,7 +218,7 @@ H5G_node_encode_key(const H5B_shared_t *shared, uint8_t *raw, const void *_key) { const H5G_node_key_t *key = (const H5G_node_key_t *) _key; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_node_encode_key) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(shared); HDassert(raw); @@ -215,7 +249,7 @@ H5G_node_debug_key(FILE *stream, int indent, int fwidth, const void *_key, const H5G_node_key_t *key = (const H5G_node_key_t *) _key; const H5G_bt_common_t *udata = (const H5G_bt_common_t *) _udata; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_node_debug_key) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(key); @@ -238,7 +272,7 @@ H5G_node_debug_key(FILE *stream, int indent, int fwidth, const void *_key, /*------------------------------------------------------------------------- - * Function: H5G_node_free + * Function: H5G__node_free * * Purpose: Destroy a symbol table node in memory. * @@ -251,9 +285,9 @@ H5G_node_debug_key(FILE *stream, int indent, int fwidth, const void *_key, *------------------------------------------------------------------------- */ herr_t -H5G_node_free(H5G_node_t *sym) +H5G__node_free(H5G_node_t *sym) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_node_free) + FUNC_ENTER_PACKAGE_NOERR /* * Check arguments. @@ -268,7 +302,7 @@ H5G_node_free(H5G_node_t *sym) sym = H5FL_FREE(H5G_node_t, sym); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5G_node_free() */ +} /* end H5G__node_free() */ /*------------------------------------------------------------------------- @@ -299,7 +333,7 @@ H5G_node_create(H5F_t *f, hid_t dxpl_id, H5B_ins_t UNUSED op, void *_lt_key, H5G_node_t *sym = NULL; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5G_node_create) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -374,7 +408,7 @@ H5G_node_cmp2(void *_lt_key, void *_udata, void *_rt_key) const char *base; /* Base of heap */ int ret_value; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_node_cmp2) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity checks */ HDassert(udata && udata->heap); @@ -433,7 +467,7 @@ H5G_node_cmp3(void *_lt_key, void *_udata, void *_rt_key) const char *base; /* Base of heap */ int ret_value = 0; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_node_cmp3) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity checks */ HDassert(udata && udata->heap); @@ -497,7 +531,7 @@ H5G_node_found(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void UNUSED *_lt_key const char *base; /* Base of heap */ htri_t ret_value = TRUE; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5G_node_found) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -600,7 +634,7 @@ H5G_node_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, H5G_entry_t ent; /* Entry to insert in node */ H5B_ins_t ret_value = H5B_INS_ERROR; - FUNC_ENTER_NOAPI_NOINIT(H5G_node_insert) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -642,7 +676,7 @@ H5G_node_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, idx += cmp > 0 ? 1 : 0; /* Convert link information & name to symbol table entry */ - if(H5G_ent_convert(f, dxpl_id, udata->common.heap, udata->common.name, + if(H5G__ent_convert(f, dxpl_id, udata->common.heap, udata->common.name, udata->lnk, udata->obj_type, udata->crt_info, &ent) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTCONVERT, H5B_INS_ERROR, "unable to convert link") @@ -703,11 +737,12 @@ H5G_node_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, } /* end else */ /* Move entries down to make room for new entry */ + HDassert(idx >= 0); HDmemmove(insert_into->entry + idx + 1, insert_into->entry + idx, - (insert_into->nsyms - idx) * sizeof(H5G_entry_t)); + (insert_into->nsyms - (unsigned)idx) * sizeof(H5G_entry_t)); /* Copy new entry into table */ - H5G_ent_copy(&(insert_into->entry[idx]), &ent, H5_COPY_SHALLOW); + H5G__ent_copy(&(insert_into->entry[idx]), &ent, H5_COPY_SHALLOW); /* Increment # of symbols in table */ insert_into->nsyms += 1; @@ -765,7 +800,7 @@ H5G_node_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key/*in,out*/, int cmp = 1; H5B_ins_t ret_value = H5B_INS_ERROR; - FUNC_ENTER_NOAPI_NOINIT(H5G_node_remove) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments */ HDassert(f); @@ -824,7 +859,7 @@ H5G_node_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key/*in,out*/, } /* end else */ /* Replace any object names */ - if(H5G_link_name_replace(f, dxpl_id, udata->grp_full_path_r, &lnk) < 0) + if(H5G__link_name_replace(f, dxpl_id, udata->grp_full_path_r, &lnk) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, H5B_INS_ERROR, "unable to get object type") /* Decrement the ref. count for hard links */ @@ -936,7 +971,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_node_iterate + * Function: H5G__node_iterate * * Purpose: This function gets called during a group iterate operation. * @@ -949,7 +984,7 @@ done: *------------------------------------------------------------------------- */ int -H5G_node_iterate(H5F_t *f, hid_t dxpl_id, const void UNUSED *_lt_key, haddr_t addr, +H5G__node_iterate(H5F_t *f, hid_t dxpl_id, const void UNUSED *_lt_key, haddr_t addr, const void UNUSED *_rt_key, void *_udata) { H5G_bt_it_it_t *udata = (H5G_bt_it_it_t *)_udata; @@ -958,7 +993,7 @@ H5G_node_iterate(H5F_t *f, hid_t dxpl_id, const void UNUSED *_lt_key, haddr_t ad unsigned u; /* Local index variable */ int ret_value = H5_ITER_CONT; - FUNC_ENTER_NOAPI(H5G_node_iterate, H5_ITER_ERROR) + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -986,7 +1021,7 @@ H5G_node_iterate(H5F_t *f, hid_t dxpl_id, const void UNUSED *_lt_key, haddr_t ad HDassert(name); /* Convert the entry to a link */ - if(H5G_ent_to_link(&lnk, udata->heap, &ents[u], name) < 0) + if(H5G__ent_to_link(&lnk, udata->heap, &ents[u], name) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTCONVERT, H5_ITER_ERROR, "unable to convert symbol table entry to link") /* Make the callback */ @@ -1011,11 +1046,11 @@ done: HDONE_ERROR(H5E_SYM, H5E_PROTECT, H5_ITER_ERROR, "unable to release object header") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_node_iterate() */ +} /* end H5G__node_iterate() */ /*------------------------------------------------------------------------- - * Function: H5G_node_sumup + * Function: H5G__node_sumup * * Purpose: This function gets called during a group iterate operation * to return total number of members in the group. @@ -1028,14 +1063,14 @@ done: *------------------------------------------------------------------------- */ int -H5G_node_sumup(H5F_t *f, hid_t dxpl_id, const void UNUSED *_lt_key, haddr_t addr, +H5G__node_sumup(H5F_t *f, hid_t dxpl_id, const void UNUSED *_lt_key, haddr_t addr, const void UNUSED *_rt_key, void *_udata) { hsize_t *num_objs = (hsize_t *)_udata; H5G_node_t *sn = NULL; int ret_value = H5_ITER_CONT; - FUNC_ENTER_NOAPI(H5G_node_sumup, H5_ITER_ERROR) + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -1055,11 +1090,11 @@ done: HDONE_ERROR(H5E_SYM, H5E_PROTECT, H5_ITER_ERROR, "unable to release object header") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_node_sumup() */ +} /* end H5G__node_sumup() */ /*------------------------------------------------------------------------- - * Function: H5G_node_name + * Function: H5G__node_by_idx * * Purpose: This function gets called during a group iterate operation * to return object name by giving idx. @@ -1073,14 +1108,14 @@ done: *------------------------------------------------------------------------- */ int -H5G_node_by_idx(H5F_t *f, hid_t dxpl_id, const void UNUSED *_lt_key, haddr_t addr, +H5G__node_by_idx(H5F_t *f, hid_t dxpl_id, const void UNUSED *_lt_key, haddr_t addr, const void UNUSED *_rt_key, void *_udata) { H5G_bt_it_idx_common_t *udata = (H5G_bt_it_idx_common_t *)_udata; H5G_node_t *sn = NULL; int ret_value = H5_ITER_CONT; - FUNC_ENTER_NOAPI(H5G_node_by_idx, H5_ITER_ERROR) + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -1116,11 +1151,11 @@ done: HDONE_ERROR(H5E_SYM, H5E_PROTECT, H5_ITER_ERROR, "unable to release object header") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_node_by_idx() */ +} /* end H5G__node_by_idx() */ /*------------------------------------------------------------------------- - * Function: H5G_node_init + * Function: H5G__node_init * * Purpose: This function gets called during a file opening to initialize * global information about group B-tree nodes for file. @@ -1134,13 +1169,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G_node_init(H5F_t *f) +H5G__node_init(H5F_t *f) { H5B_shared_t *shared; /* Shared B-tree node info */ size_t sizeof_rkey; /* Size of raw (disk) key */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5G_node_init, FAIL) + FUNC_ENTER_PACKAGE /* Check arguments. */ HDassert(f); @@ -1156,12 +1191,12 @@ H5G_node_init(H5F_t *f) /* */ /* Make shared B-tree info reference counted */ - if(NULL == (f->shared->grp_btree_shared = H5RC_create(shared, H5B_shared_free))) - HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't create ref-count wrapper for shared B-tree info") + if(H5F_SET_GRP_BTREE_SHARED(f, H5RC_create(shared, H5B_shared_free)) < 0) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't create ref-count wrapper for shared B-tree info") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_node_init() */ +} /* end H5G__node_init() */ /*------------------------------------------------------------------------- @@ -1182,7 +1217,7 @@ done: herr_t H5G_node_close(const H5F_t *f) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_node_close) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments. */ HDassert(f); @@ -1196,7 +1231,7 @@ H5G_node_close(const H5F_t *f) /*------------------------------------------------------------------------- - * Function: H5G_node_copy + * Function: H5G__node_copy * * Purpose: This function gets called during a group iterate operation * to copy objects of this node into a new location. @@ -1209,7 +1244,7 @@ H5G_node_close(const H5F_t *f) *------------------------------------------------------------------------- */ int -H5G_node_copy(H5F_t *f, hid_t dxpl_id, const void UNUSED *_lt_key, haddr_t addr, +H5G__node_copy(H5F_t *f, hid_t dxpl_id, const void UNUSED *_lt_key, haddr_t addr, const void UNUSED *_rt_key, void *_udata) { H5G_bt_it_cpy_t *udata = (H5G_bt_it_cpy_t *)_udata; @@ -1220,7 +1255,7 @@ H5G_node_copy(H5F_t *f, hid_t dxpl_id, const void UNUSED *_lt_key, haddr_t addr, unsigned int i; /* Local index variable */ int ret_value = H5_ITER_CONT; - FUNC_ENTER_NOAPI(H5G_node_copy, H5_ITER_ERROR) + FUNC_ENTER_PACKAGE /* Check arguments. */ HDassert(f); @@ -1331,7 +1366,7 @@ H5G_node_copy(H5F_t *f, hid_t dxpl_id, const void UNUSED *_lt_key, haddr_t addr, /* Insert the new object in the destination file's group */ /* (Don't increment the link count - that's already done above for hard links) */ - if(H5G_stab_insert_real(udata->dst_file, udata->dst_stab, name, &lnk, + if(H5G__stab_insert_real(udata->dst_file, udata->dst_stab, name, &lnk, obj_type, (obj_type == H5O_TYPE_GROUP ? &gcrt_info : NULL), dxpl_id) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, H5_ITER_ERROR, "unable to insert the name") @@ -1349,11 +1384,11 @@ done: HDONE_ERROR(H5E_SYM, H5E_PROTECT, H5_ITER_ERROR, "unable to release object header") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_node_copy() */ +} /* end H5G__node_copy() */ /*------------------------------------------------------------------------- - * Function: H5G_node_build_table + * Function: H5G__node_build_table * * Purpose: B-link tree callback for building table of links * @@ -1366,7 +1401,7 @@ done: *------------------------------------------------------------------------- */ int -H5G_node_build_table(H5F_t *f, hid_t dxpl_id, const void UNUSED *_lt_key, haddr_t addr, +H5G__node_build_table(H5F_t *f, hid_t dxpl_id, const void UNUSED *_lt_key, haddr_t addr, const void UNUSED *_rt_key, void *_udata) { H5G_bt_it_bt_t *udata = (H5G_bt_it_bt_t *)_udata; @@ -1374,7 +1409,7 @@ H5G_node_build_table(H5F_t *f, hid_t dxpl_id, const void UNUSED *_lt_key, haddr_ unsigned u; /* Local index variable */ int ret_value = H5_ITER_CONT; - FUNC_ENTER_NOAPI(H5G_node_build_table, H5_ITER_ERROR) + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -1414,7 +1449,7 @@ H5G_node_build_table(H5F_t *f, hid_t dxpl_id, const void UNUSED *_lt_key, haddr_ linkno = udata->ltable->nlinks++; /* Convert the entry to a link */ - if(H5G_ent_to_link(&udata->ltable->lnks[linkno], udata->heap, &sn->entry[u], name) < 0) + if(H5G__ent_to_link(&udata->ltable->lnks[linkno], udata->heap, &sn->entry[u], name) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTCONVERT, H5_ITER_ERROR, "unable to convert symbol table entry to link") } /* end for */ @@ -1424,11 +1459,11 @@ done: HDONE_ERROR(H5E_SYM, H5E_PROTECT, H5_ITER_ERROR, "unable to release object header") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_node_build_table() */ +} /* end H5G__node_build_table() */ /*------------------------------------------------------------------------- - * Function: H5G_node_iterate_size + * Function: H5G__node_iterate_size * * Purpose: This function gets called by H5B_iterate_helper() * to gather storage info for SNODs. @@ -1441,12 +1476,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G_node_iterate_size(H5F_t *f, hid_t UNUSED dxpl_id, const void UNUSED *_lt_key, haddr_t UNUSED addr, +H5G__node_iterate_size(H5F_t *f, hid_t UNUSED dxpl_id, const void UNUSED *_lt_key, haddr_t UNUSED addr, const void UNUSED *_rt_key, void *_udata) { hsize_t *stab_size = (hsize_t *)_udata; /* User data */ - FUNC_ENTER_NOAPI_NOFUNC(H5G_node_iterate_size) + FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ HDassert(f); @@ -1455,7 +1490,7 @@ H5G_node_iterate_size(H5F_t *f, hid_t UNUSED dxpl_id, const void UNUSED *_lt_key *stab_size += H5G_NODE_SIZE(f); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5G_node_iterate_size() */ +} /* end H5G__node_iterate_size() */ /*------------------------------------------------------------------------- @@ -1481,7 +1516,7 @@ H5G_node_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, int indent, unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5G_node_debug, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* * Check arguments. @@ -1534,7 +1569,7 @@ H5G_node_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, int indent, else fprintf(stream, "%*s%-*s\n", indent, "", fwidth, "Warning: Invalid heap address given, name not displayed!"); - H5G_ent_debug(sn->entry + u, stream, indent, fwidth, heap); + H5G__ent_debug(sn->entry + u, stream, indent, fwidth, heap); } /* end for */ } /* end if */ diff --git a/src/H5Gobj.c b/src/H5Gobj.c index b0add06..021f4e1 100644 --- a/src/H5Gobj.c +++ b/src/H5Gobj.c @@ -28,7 +28,6 @@ /* Module Setup */ /****************/ -#define H5F_PACKAGE /*suppress error about including H5Fpkg */ #define H5G_PACKAGE /*suppress error about including H5Gpkg */ @@ -37,7 +36,7 @@ /***********/ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ -#include "H5Fpkg.h" /* File access */ +#include "H5Fprivate.h" /* File access */ #include "H5Gpkg.h" /* Groups */ #include "H5HLprivate.h" /* Local Heaps */ #include "H5Iprivate.h" /* IDs */ @@ -82,6 +81,7 @@ typedef struct { hid_t dxpl_id; /* DXPL during insertion */ } H5G_obj_stab_it_ud1_t; + /********************/ /* Package Typedefs */ /********************/ @@ -92,7 +92,7 @@ typedef struct { /********************/ static herr_t H5G_obj_compact_to_dense_cb(const void *_mesg, unsigned idx, void *_udata); -static herr_t H5G_obj_remove_update_linfo(H5O_loc_t *oloc, H5O_linfo_t *linfo, +static herr_t H5G_obj_remove_update_linfo(const H5O_loc_t *oloc, H5O_linfo_t *linfo, hid_t dxpl_id); @@ -113,7 +113,7 @@ static herr_t H5G_obj_remove_update_linfo(H5O_loc_t *oloc, H5O_linfo_t *linfo, /*------------------------------------------------------------------------- - * Function: H5G_obj_create + * Function: H5G__obj_create * * Purpose: Create an object header for a group and update object location info * @@ -126,7 +126,7 @@ static herr_t H5G_obj_remove_update_linfo(H5O_loc_t *oloc, H5O_linfo_t *linfo, *------------------------------------------------------------------------- */ herr_t -H5G_obj_create(H5F_t *f, hid_t dxpl_id, H5G_obj_create_t *gcrt_info, +H5G__obj_create(H5F_t *f, hid_t dxpl_id, H5G_obj_create_t *gcrt_info, H5O_loc_t *oloc/*out*/) { H5P_genplist_t *gc_plist; /* Group creation property list */ @@ -135,7 +135,7 @@ H5G_obj_create(H5F_t *f, hid_t dxpl_id, H5G_obj_create_t *gcrt_info, H5O_pline_t pline; /* Pipeline */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5G_obj_create, FAIL) + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -160,16 +160,16 @@ H5G_obj_create(H5F_t *f, hid_t dxpl_id, H5G_obj_create_t *gcrt_info, HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't get group info") /* Call the "real" group creation routine now */ - if(H5G_obj_create_real(f, dxpl_id, &ginfo, &linfo, &pline, gcrt_info, oloc) < 0) + if(H5G__obj_create_real(f, dxpl_id, &ginfo, &linfo, &pline, gcrt_info, oloc) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTCREATE, FAIL, "unable to create group") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_obj_create() */ +} /* end H5G__obj_create() */ /*------------------------------------------------------------------------- - * Function: H5G_obj_create_real + * Function: H5G__obj_create_real * * Purpose: Create an object header for a group and update object location info * @@ -182,7 +182,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G_obj_create_real(H5F_t *f, hid_t dxpl_id, const H5O_ginfo_t *ginfo, +H5G__obj_create_real(H5F_t *f, hid_t dxpl_id, const H5O_ginfo_t *ginfo, const H5O_linfo_t *linfo, const H5O_pline_t *pline, H5G_obj_create_t *gcrt_info, H5O_loc_t *oloc/*out*/) { @@ -191,7 +191,7 @@ H5G_obj_create_real(H5F_t *f, hid_t dxpl_id, const H5O_ginfo_t *ginfo, hid_t gcpl_id = gcrt_info->gcpl_id; /* Group creation property list ID */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5G_obj_create_real, FAIL) + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -203,7 +203,7 @@ H5G_obj_create_real(H5F_t *f, hid_t dxpl_id, const H5O_ginfo_t *ginfo, HDassert(oloc); /* Check for invalid access request */ - if(0 == (f->intent & H5F_ACC_RDWR)) + if(0 == (H5F_INTENT(f) & H5F_ACC_RDWR)) HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "no write intent on file") /* Check for using the latest version of the group format */ @@ -269,23 +269,26 @@ H5G_obj_create_real(H5F_t *f, hid_t dxpl_id, const H5O_ginfo_t *ginfo, /* Check for format of group to create */ if(use_latest_format) { /* Insert link info message */ - if(H5O_msg_create(oloc, H5O_LINFO_ID, 0, H5O_UPDATE_TIME, linfo, dxpl_id) < 0) + /* (Casting away const OK - QAK) */ + if(H5O_msg_create(oloc, H5O_LINFO_ID, 0, H5O_UPDATE_TIME, (void *)linfo, dxpl_id) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create message") /* Insert group info message */ - if(H5O_msg_create(oloc, H5O_GINFO_ID, H5O_MSG_FLAG_CONSTANT, 0, ginfo, dxpl_id) < 0) + /* (Casting away const OK - QAK) */ + if(H5O_msg_create(oloc, H5O_GINFO_ID, H5O_MSG_FLAG_CONSTANT, 0, (void *)ginfo, dxpl_id) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create message") /* Insert pipeline message */ if(pline && pline->nused) - if(H5O_msg_create(oloc, H5O_PLINE_ID, H5O_MSG_FLAG_CONSTANT, 0, pline, dxpl_id) < 0) + /* (Casting away const OK - QAK) */ + if(H5O_msg_create(oloc, H5O_PLINE_ID, H5O_MSG_FLAG_CONSTANT, 0, (void *)pline, dxpl_id) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create message") } /* end if */ else { H5O_stab_t stab; /* Symbol table message */ /* The group doesn't currently have a 'stab' message, go create one */ - if(H5G_stab_create(oloc, dxpl_id, ginfo, &stab) < 0) + if(H5G__stab_create(oloc, dxpl_id, ginfo, &stab) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create symbol table") /* Cache the symbol table information */ @@ -296,11 +299,11 @@ H5G_obj_create_real(H5F_t *f, hid_t dxpl_id, const H5O_ginfo_t *ginfo, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_obj_create_real() */ +} /* end H5G__obj_create_real() */ /*------------------------------------------------------------------------- - * Function: H5G_obj_get_linfo + * Function: H5G__obj_get_linfo * * Purpose: Retrieves the "link info" message for an object. Also * sets the number of links correctly, if it isn't set up yet. @@ -315,12 +318,12 @@ done: *------------------------------------------------------------------------- */ htri_t -H5G_obj_get_linfo(const H5O_loc_t *grp_oloc, H5O_linfo_t *linfo, hid_t dxpl_id) +H5G__obj_get_linfo(const H5O_loc_t *grp_oloc, H5O_linfo_t *linfo, hid_t dxpl_id) { H5B2_t *bt2_name = NULL; /* v2 B-tree handle for name index */ htri_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_TAG(H5G_obj_get_linfo, dxpl_id, grp_oloc->addr, FAIL) + FUNC_ENTER_PACKAGE_TAG(dxpl_id, grp_oloc->addr, FAIL) /* check arguments */ HDassert(grp_oloc); @@ -361,7 +364,7 @@ done: HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "can't close v2 B-tree for name index") FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) -} /* end H5G_obj_get_linfo() */ +} /* end H5G__obj_get_linfo() */ /*------------------------------------------------------------------------- @@ -385,14 +388,14 @@ H5G_obj_compact_to_dense_cb(const void *_mesg, unsigned UNUSED idx, void *_udata H5G_obj_oh_it_ud1_t *udata = (H5G_obj_oh_it_ud1_t *)_udata; /* 'User data' passed in */ herr_t ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(H5G_obj_compact_to_dense_cb, udata->dxpl_id, udata->oh_addr, FAIL) + FUNC_ENTER_NOAPI_NOINIT_TAG(udata->dxpl_id, udata->oh_addr, FAIL) /* check arguments */ HDassert(lnk); HDassert(udata); /* Insert link into dense link storage */ - if(H5G_dense_insert(udata->f, udata->dxpl_id, udata->linfo, lnk) < 0) + if(H5G__dense_insert(udata->f, udata->dxpl_id, udata->linfo, lnk) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "unable to insert link into dense storage") done: @@ -420,7 +423,7 @@ H5G_obj_stab_to_new_cb(const H5O_link_t *lnk, void *_udata) H5G_obj_stab_it_ud1_t *udata = (H5G_obj_stab_it_ud1_t *)_udata; /* 'User data' passed in */ herr_t ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5G_obj_stab_to_new_cb) + FUNC_ENTER_NOAPI_NOINIT /* check arguments */ HDassert(lnk); @@ -466,7 +469,7 @@ H5G_obj_insert(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *obj_lnk, hbool_t use_new_dense = FALSE; /* Whether to use "dense" form of 'new format' group */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(H5G_obj_insert, dxpl_id, grp_oloc->addr, FAIL) + FUNC_ENTER_NOAPI_TAG(dxpl_id, grp_oloc->addr, FAIL) /* check arguments */ HDassert(grp_oloc && grp_oloc->file); @@ -475,7 +478,7 @@ H5G_obj_insert(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *obj_lnk, /* Check if we have information about the number of objects in this group */ /* (by attempting to get the link info message for this group) */ - if((linfo_exists = H5G_obj_get_linfo(grp_oloc, &linfo, dxpl_id)) < 0) + if((linfo_exists = H5G__obj_get_linfo(grp_oloc, &linfo, dxpl_id)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't check for link info message") if(linfo_exists) { H5O_ginfo_t ginfo; /* Group info message */ @@ -525,7 +528,7 @@ H5G_obj_insert(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *obj_lnk, } /* end if */ /* The group doesn't currently have "dense" storage for links */ - if(H5G_dense_create(grp_oloc->file, dxpl_id, &linfo, pline) < 0) + if(H5G__dense_create(grp_oloc->file, dxpl_id, &linfo, pline) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create 'dense' form of new format group") /* Set up user data for object header message iteration */ @@ -569,7 +572,7 @@ H5G_obj_insert(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *obj_lnk, udata.dxpl_id = dxpl_id; /* Iterate through all links in "old format" group and insert them into new format */ - if(H5G_stab_iterate(grp_oloc, dxpl_id, H5_ITER_NATIVE, (hsize_t)0, NULL, H5G_obj_stab_to_new_cb, &udata) < 0) + if(H5G__stab_iterate(grp_oloc, dxpl_id, H5_ITER_NATIVE, (hsize_t)0, NULL, H5G_obj_stab_to_new_cb, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTNEXT, FAIL, "error iterating over old format links") /* Remove the symbol table message from the group */ @@ -594,19 +597,19 @@ H5G_obj_insert(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *obj_lnk, /* Insert into symbol table or "dense" storage */ if(use_old_format) { /* Insert into symbol table */ - if(H5G_stab_insert(grp_oloc, name, obj_lnk, obj_type, crt_info, dxpl_id) + if(H5G__stab_insert(grp_oloc, name, obj_lnk, obj_type, crt_info, dxpl_id) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "unable to insert entry into symbol table") } /* end if */ else { if(use_new_dense) { /* Insert into dense link storage */ - if(H5G_dense_insert(grp_oloc->file, dxpl_id, &linfo, obj_lnk) < 0) + if(H5G__dense_insert(grp_oloc->file, dxpl_id, &linfo, obj_lnk) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "unable to insert link into dense storage") } /* end if */ else { /* Insert with link message */ - if(H5G_compact_insert(grp_oloc, obj_lnk, dxpl_id) < 0) + if(H5G__compact_insert(grp_oloc, obj_lnk, dxpl_id) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "unable to insert link as link message") } /* end else */ } /* end else */ @@ -642,7 +645,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_obj_iterate + * Function: H5G__obj_iterate * * Purpose: Private function for H5Giterate. * Iterates over objects in a group @@ -657,7 +660,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G_obj_iterate(const H5O_loc_t *grp_oloc, +H5G__obj_iterate(const H5O_loc_t *grp_oloc, H5_index_t idx_type, H5_iter_order_t order, hsize_t skip, hsize_t *last_lnk, H5G_lib_iterate_t op, void *op_data, hid_t dxpl_id) { @@ -665,14 +668,14 @@ H5G_obj_iterate(const H5O_loc_t *grp_oloc, htri_t linfo_exists; /* Whether the link info message exists */ herr_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_TAG(H5G_obj_iterate, dxpl_id, grp_oloc->addr, FAIL) + FUNC_ENTER_PACKAGE_TAG(dxpl_id, grp_oloc->addr, FAIL) /* Sanity check */ HDassert(grp_oloc); HDassert(op); /* Attempt to get the link info for this group */ - if((linfo_exists = H5G_obj_get_linfo(grp_oloc, &linfo, dxpl_id)) < 0) + if((linfo_exists = H5G__obj_get_linfo(grp_oloc, &linfo, dxpl_id)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't check for link info message") if(linfo_exists) { /* Check for going out of bounds */ @@ -688,12 +691,12 @@ H5G_obj_iterate(const H5O_loc_t *grp_oloc, if(H5F_addr_defined(linfo.fheap_addr)) { /* Iterate over the links in the group, building a table of the link messages */ - if((ret_value = H5G_dense_iterate(grp_oloc->file, dxpl_id, &linfo, idx_type, order, skip, last_lnk, op, op_data)) < 0) + if((ret_value = H5G__dense_iterate(grp_oloc->file, dxpl_id, &linfo, idx_type, order, skip, last_lnk, op, op_data)) < 0) HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "can't iterate over dense links") } /* end if */ else { /* Get the object's name from the link messages */ - if((ret_value = H5G_compact_iterate(grp_oloc, dxpl_id, &linfo, idx_type, order, skip, last_lnk, op, op_data)) < 0) + if((ret_value = H5G__compact_iterate(grp_oloc, dxpl_id, &linfo, idx_type, order, skip, last_lnk, op, op_data)) < 0) HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "can't iterate over compact links") } /* end else */ } /* end if */ @@ -703,17 +706,17 @@ H5G_obj_iterate(const H5O_loc_t *grp_oloc, HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "no creation order index to query") /* Iterate over symbol table */ - if((ret_value = H5G_stab_iterate(grp_oloc, dxpl_id, order, skip, last_lnk, op, op_data)) < 0) + if((ret_value = H5G__stab_iterate(grp_oloc, dxpl_id, order, skip, last_lnk, op, op_data)) < 0) HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "can't iterate over symbol table") } /* end else */ done: FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) -} /* end H5G_obj_iterate() */ +} /* end H5G__obj_iterate() */ /*------------------------------------------------------------------------- - * Function: H5G_obj_info + * Function: H5G__obj_info * * Purpose: Retrieve information about a group * @@ -726,7 +729,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G_obj_info(H5O_loc_t *oloc, H5G_info_t *grp_info, hid_t dxpl_id) +H5G__obj_info(H5O_loc_t *oloc, H5G_info_t *grp_info, hid_t dxpl_id) { H5G_t *grp = NULL; /* Group to query */ H5G_loc_t grp_loc; /* Entry of group to be queried */ @@ -736,7 +739,7 @@ H5G_obj_info(H5O_loc_t *oloc, H5G_info_t *grp_info, hid_t dxpl_id) htri_t linfo_exists; /* Whether the link info message exists */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5G_obj_info, FAIL) + FUNC_ENTER_PACKAGE /* Sanity check */ HDassert(oloc); @@ -759,7 +762,7 @@ H5G_obj_info(H5O_loc_t *oloc, H5G_info_t *grp_info, hid_t dxpl_id) grp_info->mounted = H5G_MOUNTED(grp); /* Attempt to get the link info for this group */ - if((linfo_exists = H5G_obj_get_linfo(oloc, &linfo, dxpl_id)) < 0) + if((linfo_exists = H5G__obj_get_linfo(oloc, &linfo, dxpl_id)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't check for link info message") if(linfo_exists) { /* Retrieve the information about the links */ @@ -774,7 +777,7 @@ H5G_obj_info(H5O_loc_t *oloc, H5G_info_t *grp_info, hid_t dxpl_id) } /* end if */ else { /* Get the number of objects in this group by iterating over symbol table */ - if(H5G_stab_count(oloc, &grp_info->nlinks, dxpl_id) < 0) + if(H5G__stab_count(oloc, &grp_info->nlinks, dxpl_id) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTCOUNT, FAIL, "can't count objects") /* Set the other information about the group */ @@ -788,7 +791,7 @@ done: HDONE_ERROR(H5E_SYM, H5E_CANTCLOSEOBJ, FAIL, "unable to close queried group") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_obj_info() */ +} /* end H5G__obj_info() */ /*------------------------------------------------------------------------- @@ -805,20 +808,20 @@ done: *------------------------------------------------------------------------- */ ssize_t -H5G_obj_get_name_by_idx(H5O_loc_t *oloc, H5_index_t idx_type, +H5G_obj_get_name_by_idx(const H5O_loc_t *oloc, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, char* name, size_t size, hid_t dxpl_id) { H5O_linfo_t linfo; /* Link info message */ htri_t linfo_exists; /* Whether the link info message exists */ ssize_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_TAG(H5G_obj_get_name_by_idx, dxpl_id, oloc->addr, FAIL) + FUNC_ENTER_NOAPI_TAG(dxpl_id, oloc->addr, FAIL) /* Sanity check */ HDassert(oloc && oloc->file); /* Attempt to get the link info for this group */ - if((linfo_exists = H5G_obj_get_linfo(oloc, &linfo, dxpl_id)) < 0) + if((linfo_exists = H5G__obj_get_linfo(oloc, &linfo, dxpl_id)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't check for link info message") if(linfo_exists) { /* Check for creation order tracking, if creation order index lookup requested */ @@ -831,12 +834,12 @@ H5G_obj_get_name_by_idx(H5O_loc_t *oloc, H5_index_t idx_type, /* Check for dense link storage */ if(H5F_addr_defined(linfo.fheap_addr)) { /* Get the object's name from the dense link storage */ - if((ret_value = H5G_dense_get_name_by_idx(oloc->file, dxpl_id, &linfo, idx_type, order, n, name, size)) < 0) + if((ret_value = H5G__dense_get_name_by_idx(oloc->file, dxpl_id, &linfo, idx_type, order, n, name, size)) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't locate name") } /* end if */ else { /* Get the object's name from the link messages */ - if((ret_value = H5G_compact_get_name_by_idx(oloc, dxpl_id, &linfo, idx_type, order, n, name, size)) < 0) + if((ret_value = H5G__compact_get_name_by_idx(oloc, dxpl_id, &linfo, idx_type, order, n, name, size)) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't locate name") } /* end else */ } /* end if */ @@ -846,7 +849,7 @@ H5G_obj_get_name_by_idx(H5O_loc_t *oloc, H5_index_t idx_type, HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "no creation order index to query") /* Get the object's name from the symbol table */ - if((ret_value = H5G_stab_get_name_by_idx(oloc, order, n, name, size, dxpl_id)) < 0) + if((ret_value = H5G__stab_get_name_by_idx(oloc, order, n, name, size, dxpl_id)) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't locate name") } /* end else */ @@ -869,11 +872,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_obj_remove_update_linfo(H5O_loc_t *oloc, H5O_linfo_t *linfo, hid_t dxpl_id) +H5G_obj_remove_update_linfo(const H5O_loc_t *oloc, H5O_linfo_t *linfo, hid_t dxpl_id) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5G_obj_remove_update_linfo) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(oloc); @@ -891,7 +894,7 @@ H5G_obj_remove_update_linfo(H5O_loc_t *oloc, H5O_linfo_t *linfo, hid_t dxpl_id) /* Check if there's no more links */ if(linfo->nlinks == 0) { /* Delete the dense storage */ - if(H5G_dense_delete(oloc->file, dxpl_id, linfo, FALSE) < 0) + if(H5G__dense_delete(oloc->file, dxpl_id, linfo, FALSE) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete dense link storage") } /* end if */ /* Check for switching back to compact storage */ @@ -910,7 +913,7 @@ H5G_obj_remove_update_linfo(H5O_loc_t *oloc, H5O_linfo_t *linfo, hid_t dxpl_id) size_t u; /* Local index */ /* Build the table of links for this group */ - if(H5G_dense_build_table(oloc->file, dxpl_id, linfo, H5_INDEX_NAME, H5_ITER_NATIVE, <able) < 0) + if(H5G__dense_build_table(oloc->file, dxpl_id, linfo, H5_INDEX_NAME, H5_ITER_NATIVE, <able) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTNEXT, FAIL, "error iterating over links") /* Pin the object header */ @@ -940,7 +943,7 @@ H5G_obj_remove_update_linfo(H5O_loc_t *oloc, H5O_linfo_t *linfo, hid_t dxpl_id) } /* end if */ /* Remove the dense storage */ - if(H5G_dense_delete(oloc->file, dxpl_id, linfo, FALSE) < 0) + if(H5G__dense_delete(oloc->file, dxpl_id, linfo, FALSE) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete dense link storage") } /* end if */ @@ -949,7 +952,7 @@ H5G_obj_remove_update_linfo(H5O_loc_t *oloc, H5O_linfo_t *linfo, hid_t dxpl_id) HGOTO_ERROR(H5E_SYM, H5E_CANTUNPIN, FAIL, "unable to unpin group object header") /* Free link table information */ - if(H5G_link_release_table(<able) < 0) + if(H5G__link_release_table(<able) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTFREE, FAIL, "unable to release link table") } /* end if */ } /* end else */ @@ -978,21 +981,21 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G_obj_remove(H5O_loc_t *oloc, H5RS_str_t *grp_full_path_r, const char *name, hid_t dxpl_id) +H5G_obj_remove(const H5O_loc_t *oloc, H5RS_str_t *grp_full_path_r, const char *name, hid_t dxpl_id) { H5O_linfo_t linfo; /* Link info message */ htri_t linfo_exists; /* Whether the link info message exists */ hbool_t use_old_format; /* Whether to use 'old format' (symbol table) for deletion or not */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(H5G_obj_remove, dxpl_id, oloc->addr, FAIL) + FUNC_ENTER_NOAPI_TAG(dxpl_id, oloc->addr, FAIL) /* Sanity check */ HDassert(oloc); HDassert(name && *name); /* Attempt to get the link info for this group */ - if((linfo_exists = H5G_obj_get_linfo(oloc, &linfo, dxpl_id)) < 0) + if((linfo_exists = H5G__obj_get_linfo(oloc, &linfo, dxpl_id)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't check for link info message") if(linfo_exists) { /* Using the new format for groups */ @@ -1001,12 +1004,12 @@ H5G_obj_remove(H5O_loc_t *oloc, H5RS_str_t *grp_full_path_r, const char *name, h /* Check for dense or compact storage */ if(H5F_addr_defined(linfo.fheap_addr)) { /* Remove object from the dense link storage */ - if(H5G_dense_remove(oloc->file, dxpl_id, &linfo, grp_full_path_r, name) < 0) + if(H5G__dense_remove(oloc->file, dxpl_id, &linfo, grp_full_path_r, name) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't remove object") } /* end if */ else { /* Remove object from the link messages */ - if(H5G_compact_remove(oloc, dxpl_id, grp_full_path_r, name) < 0) + if(H5G__compact_remove(oloc, dxpl_id, grp_full_path_r, name) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't remove object") } /* end else */ } /* end if */ @@ -1015,7 +1018,7 @@ H5G_obj_remove(H5O_loc_t *oloc, H5RS_str_t *grp_full_path_r, const char *name, h use_old_format = TRUE; /* Remove object from the symbol table */ - if(H5G_stab_remove(oloc, dxpl_id, grp_full_path_r, name) < 0) + if(H5G__stab_remove(oloc, dxpl_id, grp_full_path_r, name) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't remove object") } /* end else */ @@ -1043,7 +1046,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G_obj_remove_by_idx(H5O_loc_t *grp_oloc, H5RS_str_t *grp_full_path_r, +H5G_obj_remove_by_idx(const H5O_loc_t *grp_oloc, H5RS_str_t *grp_full_path_r, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, hid_t dxpl_id) { H5O_linfo_t linfo; /* Link info message */ @@ -1051,13 +1054,13 @@ H5G_obj_remove_by_idx(H5O_loc_t *grp_oloc, H5RS_str_t *grp_full_path_r, hbool_t use_old_format; /* Whether to use 'old format' (symbol table) for deletion or not */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(H5G_obj_remove_by_idx, dxpl_id, grp_oloc->addr, FAIL) + FUNC_ENTER_NOAPI_TAG(dxpl_id, grp_oloc->addr, FAIL) /* Sanity check */ HDassert(grp_oloc && grp_oloc->file); /* Attempt to get the link info for this group */ - if((linfo_exists = H5G_obj_get_linfo(grp_oloc, &linfo, dxpl_id)) < 0) + if((linfo_exists = H5G__obj_get_linfo(grp_oloc, &linfo, dxpl_id)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't check for link info message") if(linfo_exists) { /* Check for creation order tracking, if creation order index lookup requested */ @@ -1073,12 +1076,12 @@ H5G_obj_remove_by_idx(H5O_loc_t *grp_oloc, H5RS_str_t *grp_full_path_r, /* Check for dense or compact storage */ if(H5F_addr_defined(linfo.fheap_addr)) { /* Remove object from the dense link storage */ - if(H5G_dense_remove_by_idx(grp_oloc->file, dxpl_id, &linfo, grp_full_path_r, idx_type, order, n) < 0) + if(H5G__dense_remove_by_idx(grp_oloc->file, dxpl_id, &linfo, grp_full_path_r, idx_type, order, n) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't remove object") } /* end if */ else { /* Remove object from compact link storage */ - if(H5G_compact_remove_by_idx(grp_oloc, dxpl_id, &linfo, grp_full_path_r, idx_type, order, n) < 0) + if(H5G__compact_remove_by_idx(grp_oloc, dxpl_id, &linfo, grp_full_path_r, idx_type, order, n) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't remove object") } /* end else */ } /* end if */ @@ -1091,7 +1094,7 @@ H5G_obj_remove_by_idx(H5O_loc_t *grp_oloc, H5RS_str_t *grp_full_path_r, use_old_format = TRUE; /* Remove object from the symbol table */ - if(H5G_stab_remove_by_idx(grp_oloc, dxpl_id, grp_full_path_r, order, n) < 0) + if(H5G__stab_remove_by_idx(grp_oloc, dxpl_id, grp_full_path_r, order, n) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't remove object") } /* end else */ @@ -1107,7 +1110,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_obj_lookup + * Function: H5G__obj_lookup * * Purpose: Look up a link in a group, using the name as the key. * @@ -1120,44 +1123,44 @@ done: *------------------------------------------------------------------------- */ htri_t -H5G_obj_lookup(H5O_loc_t *grp_oloc, const char *name, H5O_link_t *lnk, +H5G__obj_lookup(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *lnk, hid_t dxpl_id) { H5O_linfo_t linfo; /* Link info message */ htri_t linfo_exists; /* Whether the link info message exists */ htri_t ret_value = FALSE; /* Return value */ - FUNC_ENTER_NOAPI_TAG(H5G_obj_lookup, dxpl_id, grp_oloc->addr, FAIL) + FUNC_ENTER_PACKAGE_TAG(dxpl_id, grp_oloc->addr, FAIL) /* check arguments */ HDassert(grp_oloc && grp_oloc->file); HDassert(name && *name); /* Attempt to get the link info message for this group */ - if((linfo_exists = H5G_obj_get_linfo(grp_oloc, &linfo, dxpl_id)) < 0) + if((linfo_exists = H5G__obj_get_linfo(grp_oloc, &linfo, dxpl_id)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't check for link info message") if(linfo_exists) { /* Check for dense link storage */ if(H5F_addr_defined(linfo.fheap_addr)) { /* Get the object's info from the dense link storage */ - if((ret_value = H5G_dense_lookup(grp_oloc->file, dxpl_id, &linfo, name, lnk)) < 0) + if((ret_value = H5G__dense_lookup(grp_oloc->file, dxpl_id, &linfo, name, lnk)) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't locate object") } /* end if */ else { /* Get the object's info from the link messages */ - if((ret_value = H5G_compact_lookup(grp_oloc, name, lnk, dxpl_id)) < 0) + if((ret_value = H5G__compact_lookup(grp_oloc, name, lnk, dxpl_id)) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't locate object") } /* end else */ } /* end if */ else { /* Get the object's info from the symbol table */ - if((ret_value = H5G_stab_lookup(grp_oloc, name, lnk, dxpl_id)) < 0) + if((ret_value = H5G__stab_lookup(grp_oloc, name, lnk, dxpl_id)) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't locate object") } /* end else */ done: FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) -} /* end H5G_obj_lookup() */ +} /* end H5G__obj_lookup() */ /*------------------------------------------------------------------------- @@ -1175,20 +1178,20 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G_obj_lookup_by_idx(H5O_loc_t *grp_oloc, H5_index_t idx_type, +H5G_obj_lookup_by_idx(const H5O_loc_t *grp_oloc, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, H5O_link_t *lnk, hid_t dxpl_id) { H5O_linfo_t linfo; /* Link info message */ htri_t linfo_exists; /* Whether the link info message exists */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(H5G_obj_lookup_by_idx, dxpl_id, grp_oloc->addr, FAIL) + FUNC_ENTER_NOAPI_TAG(dxpl_id, grp_oloc->addr, FAIL) /* check arguments */ HDassert(grp_oloc && grp_oloc->file); /* Attempt to get the link info message for this group */ - if((linfo_exists = H5G_obj_get_linfo(grp_oloc, &linfo, dxpl_id)) < 0) + if((linfo_exists = H5G__obj_get_linfo(grp_oloc, &linfo, dxpl_id)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't check for link info message") if(linfo_exists) { /* Check for creation order tracking, if creation order index lookup requested */ @@ -1201,12 +1204,12 @@ H5G_obj_lookup_by_idx(H5O_loc_t *grp_oloc, H5_index_t idx_type, /* Check for dense link storage */ if(H5F_addr_defined(linfo.fheap_addr)) { /* Get the link from the dense storage */ - if(H5G_dense_lookup_by_idx(grp_oloc->file, dxpl_id, &linfo, idx_type, order, n, lnk) < 0) + if(H5G__dense_lookup_by_idx(grp_oloc->file, dxpl_id, &linfo, idx_type, order, n, lnk) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't locate object") } /* end if */ else { /* Get the link from the link messages */ - if(H5G_compact_lookup_by_idx(grp_oloc, dxpl_id, &linfo, idx_type, order, n, lnk) < 0) + if(H5G__compact_lookup_by_idx(grp_oloc, dxpl_id, &linfo, idx_type, order, n, lnk) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't locate object") } /* end else */ } /* end if */ @@ -1216,7 +1219,7 @@ H5G_obj_lookup_by_idx(H5O_loc_t *grp_oloc, H5_index_t idx_type, HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "no creation order index to query") /* Get the object's info from the symbol table */ - if(H5G_stab_lookup_by_idx(grp_oloc, order, n, lnk, dxpl_id) < 0) + if(H5G__stab_lookup_by_idx(grp_oloc, order, n, lnk, dxpl_id) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't locate object") } /* end else */ diff --git a/src/H5Goh.c b/src/H5Goh.c index fc7a1df..194e3ec 100644 --- a/src/H5Goh.c +++ b/src/H5Goh.c @@ -108,7 +108,7 @@ H5O_group_get_copy_file_udata(void) { void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_group_get_copy_file_udata) + FUNC_ENTER_NOAPI_NOINIT /* Allocate space for the 'copy file' user data for copying groups. * Currently this is only a ginfo, so there is no specific struct type for @@ -139,7 +139,7 @@ H5O_group_free_copy_file_udata(void *_udata) { H5G_copy_file_ud_t *udata = (H5G_copy_file_ud_t *)_udata; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_group_free_copy_file_udata) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ HDassert(udata); @@ -178,7 +178,7 @@ H5O_group_isa(struct H5O_t *oh) htri_t linfo_exists; /* Whether the 'linfo' message is in the object header */ htri_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_group_isa) + FUNC_ENTER_NOAPI_NOINIT HDassert(oh); @@ -214,7 +214,7 @@ H5O_group_open(const H5G_loc_t *obj_loc, hid_t UNUSED lapl_id, hid_t dxpl_id, hb H5G_t *grp = NULL; /* Group opened */ hid_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_group_open) + FUNC_ENTER_NOAPI_NOINIT HDassert(obj_loc); @@ -255,7 +255,7 @@ H5O_group_create(H5F_t *f, void *_crt_info, H5G_loc_t *obj_loc, hid_t dxpl_id) H5G_t *grp = NULL; /* New group created */ void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_group_create) + FUNC_ENTER_NOAPI_NOINIT /* Sanity checks */ HDassert(f); @@ -263,7 +263,7 @@ H5O_group_create(H5F_t *f, void *_crt_info, H5G_loc_t *obj_loc, hid_t dxpl_id) HDassert(obj_loc); /* Create the the group */ - if(NULL == (grp = H5G_create(f, crt_info, dxpl_id))) + if(NULL == (grp = H5G__create(f, crt_info, dxpl_id))) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, NULL, "unable to create group") /* Set up the new group's location */ @@ -303,7 +303,7 @@ H5O_group_get_oloc(hid_t obj_id) H5G_t *grp; /* Group opened */ H5O_loc_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_group_get_oloc) + FUNC_ENTER_NOAPI_NOINIT /* Get the group */ if(NULL == (grp = (H5G_t *)H5I_object(obj_id))) @@ -340,7 +340,7 @@ H5O_group_bh_info(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t *bh_info) H5B2_t *bt2_corder = NULL; /* v2 B-tree handle for creation order index */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(H5O_group_bh_info, dxpl_id, oh->cache_info.addr, FAIL) + FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, oh->cache_info.addr, FAIL) /* Sanity check */ HDassert(f); @@ -398,7 +398,7 @@ H5O_group_bh_info(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t *bh_info) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't find LINFO nor STAB messages") /* Get symbol table size info */ - if(H5G_stab_bh_size(f, dxpl_id, &stab, bh_info) < 0) + if(H5G__stab_bh_size(f, dxpl_id, &stab, bh_info) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't retrieve symbol table size info") } /* end else */ diff --git a/src/H5Gpkg.h b/src/H5Gpkg.h index c966e16..9f41cb9 100644 --- a/src/H5Gpkg.h +++ b/src/H5Gpkg.h @@ -46,18 +46,6 @@ /* Standard length of fractal heap ID for link */ #define H5G_DENSE_FHEAP_ID_LEN 7 -/* - * During name lookups (see H5G_traverse()) we sometimes want information about - * a symbolic link or a mount point. The normal operation is to follow the - * symbolic link or mount point and return information about its target. - */ -#define H5G_TARGET_NORMAL 0x0000 -#define H5G_TARGET_SLINK 0x0001 -#define H5G_TARGET_MOUNT 0x0002 -#define H5G_TARGET_UDLINK 0x0004 -#define H5G_TARGET_EXISTS 0x0008 -#define H5G_CRT_INTMD_GROUP 0x0010 - /* Size of a symbol table node on disk */ #define H5G_NODE_SIZE(f) ( \ /* General metadata fields */ \ @@ -95,7 +83,7 @@ typedef enum H5G_cache_type_t { * messages... The values are entered into the symbol table when an object * header is created (by hand) and are extracted from the symbol table with a * callback function registered in H5O_init_interface(). Be sure to update - * H5G_ent_decode(), H5G_ent_encode(), and H5G_ent_debug() as well. + * H5G_ent_decode(), H5G_ent_encode(), and H5G__ent_debug() as well. */ typedef union H5G_cache_t { struct { @@ -156,24 +144,6 @@ struct H5G_t { /* Link iteration operator for internal library callbacks */ typedef herr_t (*H5G_lib_iterate_t)(const H5O_link_t *lnk, void *op_data); -/* Describe kind of callback to make for each link */ -typedef enum H5G_link_iterate_op_type_t { -#ifndef H5_NO_DEPRECATED_SYMBOLS - H5G_LINK_OP_OLD, /* "Old" application callback */ -#endif /* H5_NO_DEPRECATED_SYMBOLS */ - H5G_LINK_OP_NEW /* "New" application callback */ -} H5G_link_iterate_op_type_t; - -typedef struct { - H5G_link_iterate_op_type_t op_type; - union { -#ifndef H5_NO_DEPRECATED_SYMBOLS - H5G_iterate_t op_old; /* "Old" application callback for each link */ -#endif /* H5_NO_DEPRECATED_SYMBOLS */ - H5L_iterate_t op_new; /* "New" application callback for each link */ - } op_func; -} H5G_link_iterate_t; - /* Data structure to hold table of links for a group */ typedef struct { size_t nlinks; /* # of links in table */ @@ -252,7 +222,7 @@ typedef struct H5G_bt_it_cpy_t { const H5O_loc_t *src_oloc; /* Source object location */ haddr_t src_heap_addr; /* Heap address of the source symbol table */ H5F_t *dst_file; /* File of destination group */ - H5O_stab_t *dst_stab; /* Symbol table message for destination group */ + const H5O_stab_t *dst_stab; /* Symbol table message for destination group */ H5O_copy_t *cpy_info; /* Information for copy operation */ } H5G_bt_it_cpy_t; @@ -318,20 +288,6 @@ typedef struct H5G_bt2_ud_ins_t { uint8_t id[H5G_DENSE_FHEAP_ID_LEN]; /* Heap ID of link to insert */ } H5G_bt2_ud_ins_t; -/* Typedef for path traversal operations */ -/* grp_loc is the location of the group in which the targeted object is located. - * name is the last component of the object's name - * lnk is the link between the group and the object - * obj_loc is the target of the traversal (or NULL if the object doesn't exist) - * operator_data is whatever udata was supplied when H5G_traverse was called - * own_loc should be set to H5G_OWN_OBJ_LOC if this callback takes ownership of obj_loc, - * H5G_OWN_GRP_LOC if it takes ownership of grp_loc, and H5G_OWN_NONE if obj_loc and - * grp_loc need to be deleted. - */ -typedef herr_t (*H5G_traverse_t)(H5G_loc_t *grp_loc/*in*/, const char *name, - const H5O_link_t *lnk/*in*/, H5G_loc_t *obj_loc/*out*/, void *operator_data/*in,out*/, - H5G_own_loc_t *own_loc/*out*/); - /* Typedef for group creation operation */ typedef struct H5G_obj_create_t{ hid_t gcpl_id; /* Group creation property list */ @@ -378,69 +334,62 @@ H5FL_EXTERN(H5G_shared_t); /* * General group routines */ -H5_DLL H5G_t *H5G_create(H5F_t *file, H5G_obj_create_t *gcrt_info, +H5_DLL H5G_t *H5G__create(H5F_t *file, H5G_obj_create_t *gcrt_info, hid_t dxpl_id); -H5_DLL H5G_t *H5G_create_named(const H5G_loc_t *loc, const char *name, +H5_DLL H5G_t *H5G__create_named(const H5G_loc_t *loc, const char *name, hid_t lcpl_id, hid_t gcpl_id, hid_t gapl_id, hid_t dxpl_id); -H5_DLL H5G_t *H5G_open_name(const H5G_loc_t *loc, const char *name, +H5_DLL H5G_t *H5G__open_name(const H5G_loc_t *loc, const char *name, hid_t gapl_id, hid_t dxpl_id); -H5_DLL herr_t H5G_iterate(hid_t loc_id, const char *group_name, - H5_index_t idx_type, H5_iter_order_t order, hsize_t skip, hsize_t *last_lnk, - const H5G_link_iterate_t *lnk_op, void *op_data, hid_t lapl_id, hid_t dxpl_id); /* * Group hierarchy traversal routines */ -H5_DLL herr_t H5G_traverse_special(const H5G_loc_t *grp_loc, +H5_DLL herr_t H5G__traverse_special(const H5G_loc_t *grp_loc, const H5O_link_t *lnk, unsigned target, size_t *nlinks, hbool_t last_comp, H5G_loc_t *obj_loc, hbool_t *obj_exists, hid_t lapl_id, hid_t dxpl_id); -H5_DLL herr_t H5G_traverse(const H5G_loc_t *loc, const char *name, - unsigned target, H5G_traverse_t op, void *op_data, hid_t lapl_id, - hid_t dxpl_id); /* * Utility functions */ -H5_DLL herr_t H5G_init(void); -H5_DLL char *H5G_normalize(const char *name); -H5_DLL const char *H5G_component(const char *name, size_t *size_p); +H5_DLL herr_t H5G__init(void); +H5_DLL const char *H5G__component(const char *name, size_t *size_p); /* * Functions that understand symbol tables but not names. The * functions that understand names are exported to the rest of * the library and appear in H5Gprivate.h. */ -H5_DLL herr_t H5G_stab_create(H5O_loc_t *grp_oloc, hid_t dxpl_id, +H5_DLL herr_t H5G__stab_create(H5O_loc_t *grp_oloc, hid_t dxpl_id, const H5O_ginfo_t *ginfo, H5O_stab_t *stab); -H5_DLL herr_t H5G_stab_create_components(H5F_t *f, H5O_stab_t *stab, size_t size_hint, hid_t dxpl_id); -H5_DLL herr_t H5G_stab_insert(const H5O_loc_t *grp_oloc, const char *name, - H5O_link_t *obj_lnk, H5O_type_t obj_type, const void *crt_info, - hid_t dxpl_id); -H5_DLL herr_t H5G_stab_insert_real(H5F_t *f, H5O_stab_t *stab, const char *name, +H5_DLL herr_t H5G__stab_create_components(H5F_t *f, H5O_stab_t *stab, size_t size_hint, hid_t dxpl_id); +H5_DLL herr_t H5G__stab_insert(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *obj_lnk, H5O_type_t obj_type, const void *crt_info, hid_t dxpl_id); -H5_DLL herr_t H5G_stab_delete(H5F_t *f, hid_t dxpl_id, const H5O_stab_t *stab); -H5_DLL herr_t H5G_stab_iterate(const H5O_loc_t *oloc, hid_t dxpl_id, H5_iter_order_t order, +H5_DLL herr_t H5G__stab_insert_real(H5F_t *f, const H5O_stab_t *stab, + const char *name, H5O_link_t *obj_lnk, H5O_type_t obj_type, + const void *crt_info, hid_t dxpl_id); +H5_DLL herr_t H5G__stab_delete(H5F_t *f, hid_t dxpl_id, const H5O_stab_t *stab); +H5_DLL herr_t H5G__stab_iterate(const H5O_loc_t *oloc, hid_t dxpl_id, H5_iter_order_t order, hsize_t skip, hsize_t *last_lnk, H5G_lib_iterate_t op, void *op_data); -H5_DLL herr_t H5G_stab_count(struct H5O_loc_t *oloc, hsize_t *num_objs, hid_t dxpl_id); -H5_DLL herr_t H5G_stab_bh_size(H5F_t *f, hid_t dxpl_id, const H5O_stab_t *stab, +H5_DLL herr_t H5G__stab_count(struct H5O_loc_t *oloc, hsize_t *num_objs, hid_t dxpl_id); +H5_DLL herr_t H5G__stab_bh_size(H5F_t *f, hid_t dxpl_id, const H5O_stab_t *stab, H5_ih_info_t *bh_info); -H5_DLL ssize_t H5G_stab_get_name_by_idx(H5O_loc_t *oloc, H5_iter_order_t order, +H5_DLL ssize_t H5G__stab_get_name_by_idx(const H5O_loc_t *oloc, H5_iter_order_t order, hsize_t n, char* name, size_t size, hid_t dxpl_id); -H5_DLL herr_t H5G_stab_remove(H5O_loc_t *oloc, hid_t dxpl_id, +H5_DLL herr_t H5G__stab_remove(const H5O_loc_t *oloc, hid_t dxpl_id, H5RS_str_t *grp_full_path_r, const char *name); -H5_DLL herr_t H5G_stab_remove_by_idx(H5O_loc_t *oloc, hid_t dxpl_id, +H5_DLL herr_t H5G__stab_remove_by_idx(const H5O_loc_t *oloc, hid_t dxpl_id, H5RS_str_t *grp_full_path_r, H5_iter_order_t order, hsize_t n); -H5_DLL herr_t H5G_stab_lookup(H5O_loc_t *grp_oloc, const char *name, +H5_DLL herr_t H5G__stab_lookup(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *lnk, hid_t dxpl_id); -H5_DLL herr_t H5G_stab_lookup_by_idx(H5O_loc_t *grp_oloc, H5_iter_order_t order, +H5_DLL herr_t H5G__stab_lookup_by_idx(const H5O_loc_t *grp_oloc, H5_iter_order_t order, hsize_t n, H5O_link_t *lnk, hid_t dxpl_id); #ifndef H5_STRICT_FORMAT_CHECKS -H5_DLL herr_t H5G_stab_valid(H5O_loc_t *grp_oloc, hid_t dxpl_id, +H5_DLL herr_t H5G__stab_valid(H5O_loc_t *grp_oloc, hid_t dxpl_id, H5O_stab_t *alt_stab); #endif /* H5_STRICT_FORMAT_CHECKS */ #ifndef H5_NO_DEPRECATED_SYMBOLS -H5_DLL H5G_obj_t H5G_stab_get_type_by_idx(H5O_loc_t *oloc, hsize_t idx, +H5_DLL H5G_obj_t H5G__stab_get_type_by_idx(H5O_loc_t *oloc, hsize_t idx, hid_t dxpl_id); #endif /* H5_NO_DEPRECATED_SYMBOLS */ @@ -448,167 +397,140 @@ H5_DLL H5G_obj_t H5G_stab_get_type_by_idx(H5O_loc_t *oloc, hsize_t idx, /* * Functions that understand symbol table entries. */ -H5_DLL herr_t H5G_ent_copy(H5G_entry_t *dst, const H5G_entry_t *src, +H5_DLL void H5G__ent_copy(H5G_entry_t *dst, const H5G_entry_t *src, H5_copy_depth_t depth); -H5_DLL herr_t H5G_ent_reset(H5G_entry_t *ent); -H5_DLL herr_t H5G_ent_decode_vec(const H5F_t *f, const uint8_t **pp, +H5_DLL void H5G__ent_reset(H5G_entry_t *ent); +H5_DLL herr_t H5G__ent_decode_vec(const H5F_t *f, const uint8_t **pp, H5G_entry_t *ent, unsigned n); -H5_DLL herr_t H5G_ent_encode_vec(const H5F_t *f, uint8_t **pp, +H5_DLL herr_t H5G__ent_encode_vec(const H5F_t *f, uint8_t **pp, const H5G_entry_t *ent, unsigned n); -H5_DLL herr_t H5G_ent_convert(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, +H5_DLL herr_t H5G__ent_convert(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, const char *name, const H5O_link_t *lnk, H5O_type_t obj_type, const void *crt_info, H5G_entry_t *ent); -H5_DLL herr_t H5G_ent_debug(const H5G_entry_t *ent, FILE * stream, int indent, +H5_DLL herr_t H5G__ent_debug(const H5G_entry_t *ent, FILE * stream, int indent, int fwidth, const H5HL_t *heap); /* Functions that understand symbol table nodes */ -H5_DLL herr_t H5G_node_init(H5F_t *f); -H5_DLL int H5G_node_iterate(H5F_t *f, hid_t dxpl_id, const void *_lt_key, haddr_t addr, +H5_DLL herr_t H5G__node_init(H5F_t *f); +H5_DLL int H5G__node_iterate(H5F_t *f, hid_t dxpl_id, const void *_lt_key, haddr_t addr, const void *_rt_key, void *_udata); -H5_DLL int H5G_node_sumup(H5F_t *f, hid_t dxpl_id, const void *_lt_key, haddr_t addr, +H5_DLL int H5G__node_sumup(H5F_t *f, hid_t dxpl_id, const void *_lt_key, haddr_t addr, const void *_rt_key, void *_udata); -H5_DLL int H5G_node_by_idx(H5F_t *f, hid_t dxpl_id, const void *_lt_key, haddr_t addr, +H5_DLL int H5G__node_by_idx(H5F_t *f, hid_t dxpl_id, const void *_lt_key, haddr_t addr, const void *_rt_key, void *_udata); -H5_DLL int H5G_node_copy(H5F_t *f, hid_t dxpl_id, const void *_lt_key, haddr_t addr, +H5_DLL int H5G__node_copy(H5F_t *f, hid_t dxpl_id, const void *_lt_key, haddr_t addr, const void *_rt_key, void *_udata); -H5_DLL int H5G_node_build_table(H5F_t *f, hid_t dxpl_id, const void *_lt_key, haddr_t addr, +H5_DLL int H5G__node_build_table(H5F_t *f, hid_t dxpl_id, const void *_lt_key, haddr_t addr, const void *_rt_key, void *_udata); -H5_DLL herr_t H5G_node_iterate_size(H5F_t *f, hid_t dxpl_id, const void *_lt_key, haddr_t addr, +H5_DLL herr_t H5G__node_iterate_size(H5F_t *f, hid_t dxpl_id, const void *_lt_key, haddr_t addr, const void *_rt_key, void *_udata); -H5_DLL herr_t H5G_node_free(H5G_node_t *sym); +H5_DLL herr_t H5G__node_free(H5G_node_t *sym); /* Functions that understand links in groups */ -H5_DLL int H5G_link_cmp_name_inc(const void *lnk1, const void *lnk2); -H5_DLL int H5G_link_cmp_name_dec(const void *lnk1, const void *lnk2); -H5_DLL int H5G_link_cmp_corder_inc(const void *lnk1, const void *lnk2); -H5_DLL int H5G_link_cmp_corder_dec(const void *lnk1, const void *lnk2); -H5_DLL herr_t H5G_ent_to_link(H5O_link_t *lnk, const H5HL_t *heap, +H5_DLL herr_t H5G__ent_to_link(H5O_link_t *lnk, const H5HL_t *heap, const H5G_entry_t *ent, const char *name); -H5_DLL herr_t H5G_link_to_info(const H5O_link_t *lnk, H5L_info_t *linfo); -H5_DLL herr_t H5G_link_to_loc(const H5G_loc_t *grp_loc, const H5O_link_t *lnk, +H5_DLL herr_t H5G__link_to_loc(const H5G_loc_t *grp_loc, const H5O_link_t *lnk, H5G_loc_t *obj_loc); -H5_DLL herr_t H5G_link_copy_file(H5F_t *dst_file, hid_t dxpl_id, - const H5O_link_t *_src_lnk, const H5O_loc_t *src_oloc, H5O_link_t *dst_lnk, - H5O_copy_t *cpy_info); -H5_DLL herr_t H5G_link_sort_table(H5G_link_table_t *ltable, H5_index_t idx_type, +H5_DLL herr_t H5G__link_sort_table(H5G_link_table_t *ltable, H5_index_t idx_type, H5_iter_order_t order); -H5_DLL herr_t H5G_link_iterate_table(const H5G_link_table_t *ltable, +H5_DLL herr_t H5G__link_iterate_table(const H5G_link_table_t *ltable, hsize_t skip, hsize_t *last_lnk, const H5G_lib_iterate_t op, void *op_data); -H5_DLL herr_t H5G_link_release_table(H5G_link_table_t *ltable); -H5_DLL herr_t H5G_link_name_replace(H5F_t *file, hid_t dxpl_id, +H5_DLL herr_t H5G__link_release_table(H5G_link_table_t *ltable); +H5_DLL herr_t H5G__link_name_replace(H5F_t *file, hid_t dxpl_id, H5RS_str_t *grp_full_path_r, const H5O_link_t *lnk); /* Functions that understand "compact" link storage */ -H5_DLL herr_t H5G_compact_insert(const H5O_loc_t *grp_oloc, H5O_link_t *obj_lnk, +H5_DLL herr_t H5G__compact_insert(const H5O_loc_t *grp_oloc, H5O_link_t *obj_lnk, hid_t dxpl_id); -H5_DLL ssize_t H5G_compact_get_name_by_idx(H5O_loc_t *oloc, hid_t dxpl_id, +H5_DLL ssize_t H5G__compact_get_name_by_idx(const H5O_loc_t *oloc, hid_t dxpl_id, const H5O_linfo_t *linfo, H5_index_t idx_type, H5_iter_order_t order, hsize_t idx, char *name, size_t size); -H5_DLL herr_t H5G_compact_remove(const H5O_loc_t *oloc, hid_t dxpl_id, +H5_DLL herr_t H5G__compact_remove(const H5O_loc_t *oloc, hid_t dxpl_id, H5RS_str_t *grp_full_path_r, const char *name); -H5_DLL herr_t H5G_compact_remove_by_idx(const H5O_loc_t *oloc, hid_t dxpl_id, +H5_DLL herr_t H5G__compact_remove_by_idx(const H5O_loc_t *oloc, hid_t dxpl_id, const H5O_linfo_t *linfo, H5RS_str_t *grp_full_path_r, H5_index_t idx_type, H5_iter_order_t order, hsize_t n); -H5_DLL herr_t H5G_compact_iterate(const H5O_loc_t *oloc, hid_t dxpl_id, +H5_DLL herr_t H5G__compact_iterate(const H5O_loc_t *oloc, hid_t dxpl_id, const H5O_linfo_t *linfo, H5_index_t idx_type, H5_iter_order_t order, hsize_t skip, hsize_t *last_lnk, H5G_lib_iterate_t op, void *op_data); -H5_DLL htri_t H5G_compact_lookup(H5O_loc_t *grp_oloc, const char *name, +H5_DLL htri_t H5G__compact_lookup(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *lnk, hid_t dxpl_id); -H5_DLL herr_t H5G_compact_lookup_by_idx(H5O_loc_t *oloc, hid_t dxpl_id, +H5_DLL herr_t H5G__compact_lookup_by_idx(const H5O_loc_t *oloc, hid_t dxpl_id, const H5O_linfo_t *linfo, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, H5O_link_t *lnk); #ifndef H5_NO_DEPRECATED_SYMBOLS -H5_DLL H5G_obj_t H5G_compact_get_type_by_idx(H5O_loc_t *oloc, hid_t dxpl_id, +H5_DLL H5G_obj_t H5G__compact_get_type_by_idx(H5O_loc_t *oloc, hid_t dxpl_id, const H5O_linfo_t *linfo, hsize_t idx); #endif /* H5_NO_DEPRECATED_SYMBOLS */ /* Functions that understand "dense" link storage */ -H5_DLL herr_t H5G_dense_build_table(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, +H5_DLL herr_t H5G__dense_build_table(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, H5_index_t idx_type, H5_iter_order_t order, H5G_link_table_t *ltable); -H5_DLL herr_t H5G_dense_create(H5F_t *f, hid_t dxpl_id, H5O_linfo_t *linfo, +H5_DLL herr_t H5G__dense_create(H5F_t *f, hid_t dxpl_id, H5O_linfo_t *linfo, const H5O_pline_t *pline); -H5_DLL herr_t H5G_dense_insert(H5F_t *f, hid_t dxpl_id, +H5_DLL herr_t H5G__dense_insert(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, const H5O_link_t *lnk); -H5_DLL htri_t H5G_dense_lookup(H5F_t *f, hid_t dxpl_id, +H5_DLL htri_t H5G__dense_lookup(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, const char *name, H5O_link_t *lnk); -H5_DLL herr_t H5G_dense_lookup_by_idx(H5F_t *f, hid_t dxpl_id, +H5_DLL herr_t H5G__dense_lookup_by_idx(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, H5O_link_t *lnk); -H5_DLL herr_t H5G_dense_iterate(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, +H5_DLL herr_t H5G__dense_iterate(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, H5_index_t idx_type, H5_iter_order_t order, hsize_t skip, hsize_t *last_lnk, H5G_lib_iterate_t op, void *op_data); -H5_DLL ssize_t H5G_dense_get_name_by_idx(H5F_t *f, hid_t dxpl_id, +H5_DLL ssize_t H5G__dense_get_name_by_idx(H5F_t *f, hid_t dxpl_id, H5O_linfo_t *linfo, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, char *name, size_t size); -H5_DLL herr_t H5G_dense_remove(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, +H5_DLL herr_t H5G__dense_remove(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, H5RS_str_t *grp_full_path_r, const char *name); -H5_DLL herr_t H5G_dense_remove_by_idx(H5F_t *f, hid_t dxpl_id, +H5_DLL herr_t H5G__dense_remove_by_idx(H5F_t *f, hid_t dxpl_id, const H5O_linfo_t *linfo, H5RS_str_t *grp_full_path_r, H5_index_t idx_type, H5_iter_order_t order, hsize_t n); -H5_DLL herr_t H5G_dense_delete(H5F_t *f, hid_t dxpl_id, H5O_linfo_t *linfo, +H5_DLL herr_t H5G__dense_delete(H5F_t *f, hid_t dxpl_id, H5O_linfo_t *linfo, hbool_t adj_link); #ifndef H5_NO_DEPRECATED_SYMBOLS -H5_DLL H5G_obj_t H5G_dense_get_type_by_idx(H5F_t *f, hid_t dxpl_id, +H5_DLL H5G_obj_t H5G__dense_get_type_by_idx(H5F_t *f, hid_t dxpl_id, H5O_linfo_t *linfo, hsize_t idx); #endif /* H5_NO_DEPRECATED_SYMBOLS */ /* Functions that understand group objects */ -H5_DLL herr_t H5G_obj_create(H5F_t *f, hid_t dxpl_id, +H5_DLL herr_t H5G__obj_create(H5F_t *f, hid_t dxpl_id, H5G_obj_create_t *gcrt_info, H5O_loc_t *oloc/*out*/); -H5_DLL herr_t H5G_obj_create_real(H5F_t *f, hid_t dxpl_id, +H5_DLL herr_t H5G__obj_create_real(H5F_t *f, hid_t dxpl_id, const H5O_ginfo_t *ginfo, const H5O_linfo_t *linfo, const H5O_pline_t *pline, H5G_obj_create_t *gcrt_info, H5O_loc_t *oloc/*out*/); -H5_DLL htri_t H5G_obj_get_linfo(const H5O_loc_t *grp_oloc, H5O_linfo_t *linfo, +H5_DLL htri_t H5G__obj_get_linfo(const H5O_loc_t *grp_oloc, H5O_linfo_t *linfo, hid_t dxpl_id); -H5_DLL herr_t H5G_obj_insert(const H5O_loc_t *grp_oloc, const char *name, - H5O_link_t *obj_lnk, hbool_t adj_link, H5O_type_t obj_type, - const void *crt_info, hid_t dxpl_id); -H5_DLL herr_t H5G_obj_iterate(const H5O_loc_t *grp_oloc, +H5_DLL herr_t H5G__obj_iterate(const H5O_loc_t *grp_oloc, H5_index_t idx_type, H5_iter_order_t order, hsize_t skip, hsize_t *last_lnk, H5G_lib_iterate_t op, void *op_data, hid_t dxpl_id); -H5_DLL herr_t H5G_obj_info(H5O_loc_t *oloc, H5G_info_t *grp_info, hid_t dxpl_id); -H5_DLL ssize_t H5G_obj_get_name_by_idx(H5O_loc_t *oloc, H5_index_t idx_type, - H5_iter_order_t order, hsize_t n, char* name, size_t size, hid_t dxpl_id); -H5_DLL herr_t H5G_obj_remove(H5O_loc_t *oloc, H5RS_str_t *grp_full_path_r, - const char *name, hid_t dxpl_id); -H5_DLL herr_t H5G_obj_remove_by_idx(H5O_loc_t *grp_oloc, H5RS_str_t *grp_full_path_r, - H5_index_t idx_type, H5_iter_order_t order, hsize_t n, hid_t dxpl_id); -H5_DLL htri_t H5G_obj_lookup(H5O_loc_t *grp_oloc, const char *name, +H5_DLL herr_t H5G__obj_info(H5O_loc_t *oloc, H5G_info_t *grp_info, hid_t dxpl_id); +H5_DLL htri_t H5G__obj_lookup(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *lnk, hid_t dxpl_id); -H5_DLL herr_t H5G_obj_lookup_by_idx(H5O_loc_t *grp_oloc, H5_index_t idx_type, - H5_iter_order_t order, hsize_t n, H5O_link_t *lnk, hid_t dxpl_id); /* * These functions operate on group hierarchy names. */ -H5_DLL herr_t H5G_name_init(H5G_name_t *name, const char *path); -H5_DLL herr_t H5G_name_set(H5G_name_t *loc, H5G_name_t *obj, const char *name); -H5_DLL H5RS_str_t *H5G_build_fullpath_refstr_str(H5RS_str_t *path_r, const char *name); +H5_DLL herr_t H5G__name_init(H5G_name_t *name, const char *path); /* * These functions operate on group "locations" */ -H5_DLL herr_t H5G_loc_copy(H5G_loc_t *dst, const H5G_loc_t *src, H5_copy_depth_t depth); -H5_DLL herr_t H5G_loc_insert(H5G_loc_t *grp_loc, const char *name, +H5_DLL herr_t H5G__loc_insert(H5G_loc_t *grp_loc, const char *name, H5G_loc_t *obj_loc, H5O_type_t obj_type, const void *crt_info, hid_t dxpl_id); -/* - * These functions operate on the root group - */ -H5_DLL herr_t H5G_root_loc(H5F_t *f, H5G_loc_t *loc); - /* Testing functions */ #ifdef H5G_TESTING -H5_DLL htri_t H5G_is_empty_test(hid_t gid); -H5_DLL htri_t H5G_has_links_test(hid_t gid, unsigned *nmsgs); -H5_DLL htri_t H5G_has_stab_test(hid_t gid); -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); -H5_DLL herr_t H5G_verify_cached_stabs_test(hid_t gid); +H5_DLL htri_t H5G__is_empty_test(hid_t gid); +H5_DLL htri_t H5G__has_links_test(hid_t gid, unsigned *nmsgs); +H5_DLL htri_t H5G__has_stab_test(hid_t gid); +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); +H5_DLL herr_t H5G__verify_cached_stabs_test(hid_t gid); #endif /* H5G_TESTING */ #endif /* _H5Gpkg_H */ diff --git a/src/H5Gprivate.h b/src/H5Gprivate.h index 140e22f..0c01cd2 100644 --- a/src/H5Gprivate.h +++ b/src/H5Gprivate.h @@ -105,6 +105,18 @@ #define H5G_MOUNTED(G) (H5G_mounted(G)) #endif /* H5G_PACKAGE */ +/* + * During name lookups (see H5G_traverse()) we sometimes want information about + * a symbolic link or a mount point. The normal operation is to follow the + * symbolic link or mount point and return information about its target. + */ +#define H5G_TARGET_NORMAL 0x0000 +#define H5G_TARGET_SLINK 0x0001 +#define H5G_TARGET_MOUNT 0x0002 +#define H5G_TARGET_UDLINK 0x0004 +#define H5G_TARGET_EXISTS 0x0008 +#define H5G_CRT_INTMD_GROUP 0x0010 + /* Type of operation being performed for call to H5G_name_replace() */ typedef enum { H5G_NAME_MOVE = 0, /* H5*move call */ @@ -141,6 +153,38 @@ typedef struct { H5G_name_t *path; /* Group hierarchy path */ } H5G_loc_t; +/* Typedef for path traversal operations */ +/* grp_loc is the location of the group in which the targeted object is located. + * name is the last component of the object's name + * lnk is the link between the group and the object + * obj_loc is the target of the traversal (or NULL if the object doesn't exist) + * operator_data is whatever udata was supplied when H5G_traverse was called + * own_loc should be set to H5G_OWN_OBJ_LOC if this callback takes ownership of obj_loc, + * H5G_OWN_GRP_LOC if it takes ownership of grp_loc, and H5G_OWN_NONE if obj_loc and + * grp_loc need to be deleted. + */ +typedef herr_t (*H5G_traverse_t)(H5G_loc_t *grp_loc/*in*/, const char *name, + const struct H5O_link_t *lnk/*in*/, H5G_loc_t *obj_loc/*out*/, void *operator_data/*in,out*/, + H5G_own_loc_t *own_loc/*out*/); + +/* Describe kind of callback to make for each link */ +typedef enum H5G_link_iterate_op_type_t { +#ifndef H5_NO_DEPRECATED_SYMBOLS + H5G_LINK_OP_OLD, /* "Old" application callback */ +#endif /* H5_NO_DEPRECATED_SYMBOLS */ + H5G_LINK_OP_NEW /* "New" application callback */ +} H5G_link_iterate_op_type_t; + +typedef struct { + H5G_link_iterate_op_type_t op_type; + union { +#ifndef H5_NO_DEPRECATED_SYMBOLS + H5G_iterate_t op_old; /* "Old" application callback for each link */ +#endif /* H5_NO_DEPRECATED_SYMBOLS */ + H5L_iterate_t op_new; /* "New" application callback for each link */ + } op_func; +} H5G_link_iterate_t; + typedef struct H5G_t H5G_t; typedef struct H5G_shared_t H5G_shared_t; typedef struct H5G_entry_t H5G_entry_t; @@ -150,9 +194,6 @@ typedef struct H5G_entry_t H5G_entry_t; * call. */ H5_DLL struct H5O_loc_t *H5G_oloc(H5G_t *grp); -H5_DLL herr_t H5G_mkroot(H5F_t *f, hid_t dxpl_id, hbool_t create_root); -H5_DLL herr_t H5G_root_free(H5G_t *grp); -H5_DLL H5G_t *H5G_rootof(H5F_t *f); H5_DLL H5G_name_t * H5G_nameof(H5G_t *grp); H5_DLL H5F_t *H5G_fileof(H5G_t *grp); H5_DLL H5G_t *H5G_open(const H5G_loc_t *loc, hid_t dxpl_id); @@ -164,10 +205,45 @@ H5_DLL herr_t H5G_unmount(H5G_t *grp); #ifndef H5_NO_DEPRECATED_SYMBOLS H5_DLL H5G_obj_t H5G_map_obj_type(H5O_type_t obj_type); #endif /* H5_NO_DEPRECATED_SYMBOLS */ + +/* + * Utility functions + */ +H5_DLL char *H5G_normalize(const char *name); + +/* + * Group hierarchy traversal routines + */ +H5_DLL herr_t H5G_traverse(const H5G_loc_t *loc, const char *name, + unsigned target, H5G_traverse_t op, void *op_data, hid_t lapl_id, + hid_t dxpl_id); +H5_DLL herr_t H5G_iterate(hid_t loc_id, const char *group_name, + H5_index_t idx_type, H5_iter_order_t order, hsize_t skip, hsize_t *last_lnk, + const H5G_link_iterate_t *lnk_op, void *op_data, hid_t lapl_id, hid_t dxpl_id); H5_DLL herr_t H5G_visit(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order, H5L_iterate_t op, void *op_data, hid_t lapl_id, hid_t dxpl_id); +/* + * Functions that understand links in groups + */ +H5_DLL herr_t H5G_link_to_info(const struct H5O_link_t *lnk, H5L_info_t *linfo); + +/* + * Functions that understand group objects + */ +H5_DLL herr_t H5G_obj_insert(const struct H5O_loc_t *grp_oloc, const char *name, + struct H5O_link_t *obj_lnk, hbool_t adj_link, H5O_type_t obj_type, + const void *crt_info, hid_t dxpl_id); +H5_DLL ssize_t H5G_obj_get_name_by_idx(const struct H5O_loc_t *oloc, H5_index_t idx_type, + H5_iter_order_t order, hsize_t n, char* name, size_t size, hid_t dxpl_id); +H5_DLL herr_t H5G_obj_remove(const struct H5O_loc_t *oloc, H5RS_str_t *grp_full_path_r, + const char *name, hid_t dxpl_id); +H5_DLL herr_t H5G_obj_remove_by_idx(const struct H5O_loc_t *grp_oloc, H5RS_str_t *grp_full_path_r, + H5_index_t idx_type, H5_iter_order_t order, hsize_t n, hid_t dxpl_id); +H5_DLL herr_t H5G_obj_lookup_by_idx(const struct H5O_loc_t *grp_oloc, H5_index_t idx_type, + H5_iter_order_t order, hsize_t n, struct H5O_link_t *lnk, hid_t dxpl_id); + /* * These functions operate on symbol table nodes. */ @@ -184,6 +260,7 @@ H5_DLL herr_t H5G_ent_decode(const H5F_t *f, const uint8_t **pp, H5G_entry_t *en /* * These functions operate on group hierarchy names. */ +H5_DLL herr_t H5G_name_set(const H5G_name_t *loc, H5G_name_t *obj, const char *name); H5_DLL herr_t H5G_name_replace(const struct H5O_link_t *lnk, H5G_names_op_t op, H5F_t *src_file, H5RS_str_t *src_full_path_r, H5F_t *dst_file, H5RS_str_t *dst_full_path_r, hid_t dxpl_id); @@ -194,11 +271,13 @@ H5_DLL ssize_t H5G_get_name(const H5G_loc_t *loc, char *name/*out*/, size_t size hbool_t *cached, hid_t lapl_id, hid_t dxpl_id); H5_DLL ssize_t H5G_get_name_by_addr(hid_t fid, hid_t lapl_id, hid_t dxpl_id, const struct H5O_loc_t *loc, char* name, size_t size); +H5_DLL H5RS_str_t *H5G_build_fullpath_refstr_str(H5RS_str_t *path_r, const char *name); /* * These functions operate on group "locations" */ H5_DLL herr_t H5G_loc(hid_t loc_id, H5G_loc_t *loc); +H5_DLL herr_t H5G_loc_copy(H5G_loc_t *dst, const H5G_loc_t *src, H5_copy_depth_t depth); H5_DLL herr_t H5G_loc_find(const H5G_loc_t *loc, const char *name, H5G_loc_t *obj_loc/*out*/, hid_t lapl_id, hid_t dxpl_id); H5_DLL herr_t H5G_loc_find_by_idx(H5G_loc_t *loc, const char *group_name, @@ -216,5 +295,13 @@ H5_DLL ssize_t H5G_loc_get_comment(H5G_loc_t *loc, const char *name, H5_DLL herr_t H5G_loc_reset(H5G_loc_t *loc); H5_DLL herr_t H5G_loc_free(H5G_loc_t *loc); +/* + * These functions operate on the root group + */ +H5_DLL herr_t H5G_mkroot(H5F_t *f, hid_t dxpl_id, hbool_t create_root); +H5_DLL herr_t H5G_root_loc(H5F_t *f, H5G_loc_t *loc); +H5_DLL herr_t H5G_root_free(H5G_t *grp); +H5_DLL H5G_t *H5G_rootof(H5F_t *f); + #endif /* _H5Gprivate_H */ diff --git a/src/H5Groot.c b/src/H5Groot.c index a7d7e29..5ec9d3a 100644 --- a/src/H5Groot.c +++ b/src/H5Groot.c @@ -44,6 +44,41 @@ #include "H5Pprivate.h" /* Property Lists */ +/****************/ +/* Local Macros */ +/****************/ + + +/******************/ +/* Local Typedefs */ +/******************/ + + +/********************/ +/* Package Typedefs */ +/********************/ + + +/********************/ +/* Local Prototypes */ +/********************/ + + +/*********************/ +/* Package Variables */ +/*********************/ + + +/*****************************/ +/* Library Private Variables */ +/*****************************/ + + +/*******************/ +/* Local Variables */ +/*******************/ + + /*------------------------------------------------------------------------- * Function: H5G_rootof @@ -66,7 +101,7 @@ H5G_t * H5G_rootof(H5F_t *f) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_rootof) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ HDassert(f); @@ -119,7 +154,7 @@ H5G_mkroot(H5F_t *f, hid_t dxpl_id, hbool_t create_root) hbool_t path_init = FALSE; /* Whether path was initialized */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5G_mkroot, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* check args */ HDassert(f); @@ -131,7 +166,7 @@ H5G_mkroot(H5F_t *f, hid_t dxpl_id, hbool_t create_root) HGOTO_DONE(SUCCEED) /* Create information needed for group nodes */ - if(H5G_node_init(f) < 0) + if(H5G__node_init(f) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create group node info") /* @@ -159,7 +194,7 @@ H5G_mkroot(H5F_t *f, hid_t dxpl_id, hbool_t create_root) /* (Pass the FCPL which is a sub-class of the group creation property class) */ gcrt_info.gcpl_id = f->shared->fcpl_id; gcrt_info.cache_type = H5G_NOTHING_CACHED; - if(H5G_obj_create(f, dxpl_id, &gcrt_info, root_loc.oloc/*out*/) < 0) + if(H5G__obj_create(f, dxpl_id, &gcrt_info, 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)") @@ -220,7 +255,7 @@ H5G_mkroot(H5F_t *f, hid_t dxpl_id, hbool_t create_root) /* 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) + 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 */ @@ -258,7 +293,7 @@ H5G_mkroot(H5F_t *f, hid_t dxpl_id, hbool_t create_root) } /* end if */ /* Create the path names for the root group's entry */ - H5G_name_init(root_loc.path, "/"); + H5G__name_init(root_loc.path, "/"); path_init = TRUE; f->shared->root_grp->shared->fo_count = 1; @@ -312,7 +347,7 @@ done: herr_t H5G_root_free(H5G_t *grp) { - FUNC_ENTER_NOAPI_NOFUNC(H5G_root_free) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(grp && grp->shared); @@ -348,7 +383,7 @@ H5G_root_loc(H5F_t *f, H5G_loc_t *loc) H5G_t *root_grp; /* Pointer to root group's info */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5G_root_loc, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert(f); HDassert(loc); diff --git a/src/H5Gstab.c b/src/H5Gstab.c index 37c54e4..bbbbfcf 100644 --- a/src/H5Gstab.c +++ b/src/H5Gstab.c @@ -17,19 +17,34 @@ * Friday, September 19, 1997 * */ -#define H5F_PACKAGE /*suppress error about including H5Fpkg */ + +/****************/ +/* Module Setup */ +/****************/ + #define H5G_PACKAGE /*suppress error about including H5Gpkg */ -/* Packages needed by this file... */ +/***********/ +/* Headers */ +/***********/ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ -#include "H5Fpkg.h" /* File access */ +#include "H5Fprivate.h" /* File access */ #include "H5Gpkg.h" /* Groups */ #include "H5HLprivate.h" /* Local Heaps */ #include "H5MMprivate.h" /* Memory management */ -/* Private typedefs */ + +/****************/ +/* Local Macros */ +/****************/ + + +/******************/ +/* Local Typedefs */ +/******************/ + /* User data for finding link information from B-tree */ typedef struct { /* downward */ @@ -74,11 +89,35 @@ typedef struct H5G_bt_it_lbi_t { hbool_t found; /*whether we found the link */ } H5G_bt_it_lbi_t; -/* Private prototypes */ + +/********************/ +/* Package Typedefs */ +/********************/ + + +/********************/ +/* Local Prototypes */ +/********************/ + + +/*********************/ +/* Package Variables */ +/*********************/ + + +/*****************************/ +/* Library Private Variables */ +/*****************************/ + + +/*******************/ +/* Local Variables */ +/*******************/ + /*------------------------------------------------------------------------- - * Function: H5G_stab_create_components + * Function: H5G__stab_create_components * * Purpose: Creates the components for a new, empty, symbol table (name heap * and B-tree). The caller can specify an initial size for the @@ -97,13 +136,13 @@ typedef struct H5G_bt_it_lbi_t { *------------------------------------------------------------------------- */ herr_t -H5G_stab_create_components(H5F_t *f, H5O_stab_t *stab, size_t size_hint, hid_t dxpl_id) +H5G__stab_create_components(H5F_t *f, H5O_stab_t *stab, size_t size_hint, hid_t dxpl_id) { H5HL_t *heap = NULL; /* Pointer to local heap */ size_t name_offset; /* Offset of "" name */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5G_stab_create_components, FAIL) + FUNC_ENTER_PACKAGE /* * Check arguments. @@ -140,11 +179,11 @@ done: HDONE_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to unprotect symbol table heap") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_stab_create_components() */ +} /* end H5G__stab_create_components() */ /*------------------------------------------------------------------------- - * Function: H5G_stab_create + * Function: H5G__stab_create * * Purpose: Creates a new empty symbol table (object header, name heap, * and B-tree). The caller can specify an initial size for the @@ -164,14 +203,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G_stab_create(H5O_loc_t *grp_oloc, hid_t dxpl_id, const H5O_ginfo_t *ginfo, +H5G__stab_create(H5O_loc_t *grp_oloc, hid_t dxpl_id, const H5O_ginfo_t *ginfo, H5O_stab_t *stab) { size_t heap_hint; /* Local heap size hint */ size_t size_hint; /* Local heap size hint */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(H5G_stab_create, dxpl_id, grp_oloc->addr, FAIL) + FUNC_ENTER_PACKAGE_TAG(dxpl_id, grp_oloc->addr, FAIL) /* * Check arguments. @@ -189,7 +228,7 @@ H5G_stab_create(H5O_loc_t *grp_oloc, hid_t dxpl_id, const H5O_ginfo_t *ginfo, size_hint = MAX(heap_hint, H5HL_SIZEOF_FREE(grp_oloc->file) + 2); /* Go create the B-tree & local heap */ - if(H5G_stab_create_components(grp_oloc->file, stab, size_hint, dxpl_id) < 0) + if(H5G__stab_create_components(grp_oloc->file, stab, size_hint, dxpl_id) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create symbol table components") /* @@ -201,11 +240,11 @@ H5G_stab_create(H5O_loc_t *grp_oloc, hid_t dxpl_id, const H5O_ginfo_t *ginfo, done: FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) -} /* end H5G_stab_create() */ +} /* end H5G__stab_create() */ /*------------------------------------------------------------------------- - * Function: H5G_stab_insert_real + * Function: H5G__stab_insert_real * * Purpose: Insert a new symbol into a table. * The name of the new symbol is NAME and its symbol @@ -220,7 +259,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G_stab_insert_real(H5F_t *f, H5O_stab_t *stab, const char *name, +H5G__stab_insert_real(H5F_t *f, const H5O_stab_t *stab, const char *name, H5O_link_t *obj_lnk, H5O_type_t obj_type, const void *crt_info, hid_t dxpl_id) { @@ -228,7 +267,7 @@ H5G_stab_insert_real(H5F_t *f, H5O_stab_t *stab, const char *name, H5G_bt_ins_t udata; /* Data to pass through B-tree */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5G_stab_insert_real, FAIL) + FUNC_ENTER_PACKAGE /* check arguments */ HDassert(f); @@ -257,11 +296,11 @@ done: HDONE_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to unprotect symbol table heap") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_stab_insert_real() */ +} /* end H5G__stab_insert_real() */ /*------------------------------------------------------------------------- - * Function: H5G_stab_insert + * Function: H5G__stab_insert * * Purpose: Insert a new symbol into the table described by GRP_ENT in * file F. The name of the new symbol is NAME and its symbol @@ -276,14 +315,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G_stab_insert(const H5O_loc_t *grp_oloc, const char *name, +H5G__stab_insert(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *obj_lnk, H5O_type_t obj_type, const void *crt_info, hid_t dxpl_id) { H5O_stab_t stab; /* Symbol table message */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(H5G_stab_insert, dxpl_id, grp_oloc->addr, FAIL) + FUNC_ENTER_PACKAGE_TAG(dxpl_id, grp_oloc->addr, FAIL) /* check arguments */ HDassert(grp_oloc && grp_oloc->file); @@ -294,17 +333,17 @@ H5G_stab_insert(const H5O_loc_t *grp_oloc, const char *name, if(NULL == H5O_msg_read(grp_oloc, H5O_STAB_ID, &stab, dxpl_id)) HGOTO_ERROR(H5E_SYM, H5E_BADMESG, FAIL, "not a symbol table") - if(H5G_stab_insert_real(grp_oloc->file, &stab, name, obj_lnk, obj_type, + if(H5G__stab_insert_real(grp_oloc->file, &stab, name, obj_lnk, obj_type, crt_info, dxpl_id) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, H5_ITER_ERROR, "unable to insert the name") done: FUNC_LEAVE_NOAPI_TAG(ret_value, H5_ITER_ERROR) -} /* end H5G_stab_insert() */ +} /* end H5G__stab_insert() */ /*------------------------------------------------------------------------- - * Function: H5G_stab_remove + * Function: H5G__stab_remove * * Purpose: Remove NAME from a symbol table. * @@ -316,7 +355,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G_stab_remove(H5O_loc_t *loc, hid_t dxpl_id, H5RS_str_t *grp_full_path_r, +H5G__stab_remove(const H5O_loc_t *loc, hid_t dxpl_id, H5RS_str_t *grp_full_path_r, const char *name) { H5HL_t *heap = NULL; /* Pointer to local heap */ @@ -324,7 +363,7 @@ H5G_stab_remove(H5O_loc_t *loc, hid_t dxpl_id, H5RS_str_t *grp_full_path_r, H5G_bt_rm_t udata; /*data to pass through B-tree */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5G_stab_remove, FAIL) + FUNC_ENTER_PACKAGE HDassert(loc && loc->file); HDassert(name && *name); @@ -352,11 +391,11 @@ done: HDONE_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to unprotect symbol table heap") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_stab_remove() */ +} /* end H5G__stab_remove() */ /*------------------------------------------------------------------------- - * Function: H5G_stab_remove_by_idx + * Function: H5G__stab_remove_by_idx * * Purpose: Remove NAME from a symbol table, according to the name index. * @@ -368,7 +407,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G_stab_remove_by_idx(H5O_loc_t *grp_oloc, hid_t dxpl_id, H5RS_str_t *grp_full_path_r, +H5G__stab_remove_by_idx(const H5O_loc_t *grp_oloc, hid_t dxpl_id, H5RS_str_t *grp_full_path_r, H5_iter_order_t order, hsize_t n) { H5HL_t *heap = NULL; /* Pointer to local heap */ @@ -378,12 +417,12 @@ H5G_stab_remove_by_idx(H5O_loc_t *grp_oloc, hid_t dxpl_id, H5RS_str_t *grp_full_ hbool_t lnk_copied = FALSE; /* Whether the link was copied */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5G_stab_remove_by_idx, FAIL) + FUNC_ENTER_PACKAGE HDassert(grp_oloc && grp_oloc->file); /* Look up name of link to remove, by index */ - if(H5G_stab_lookup_by_idx(grp_oloc, order, n, &obj_lnk, dxpl_id) < 0) + if(H5G__stab_lookup_by_idx(grp_oloc, order, n, &obj_lnk, dxpl_id) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't get link information") lnk_copied = TRUE; @@ -414,11 +453,11 @@ done: H5O_msg_reset(H5O_LINK_ID, &obj_lnk); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_stab_remove_by_idx() */ +} /* end H5G__stab_remove_by_idx() */ /*------------------------------------------------------------------------- - * Function: H5G_stab_delete + * Function: H5G__stab_delete * * Purpose: Delete entire symbol table information from file * @@ -432,13 +471,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G_stab_delete(H5F_t *f, hid_t dxpl_id, const H5O_stab_t *stab) +H5G__stab_delete(H5F_t *f, hid_t dxpl_id, const H5O_stab_t *stab) { H5HL_t *heap = NULL; /* Pointer to local heap */ H5G_bt_rm_t udata; /*data to pass through B-tree */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5G_stab_delete, FAIL) + FUNC_ENTER_PACKAGE HDassert(f); HDassert(stab); @@ -472,11 +511,11 @@ done: HDONE_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to unprotect symbol table heap") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_stab_delete() */ +} /* end H5G__stab_delete() */ /*------------------------------------------------------------------------- - * Function: H5G_stab_iterate + * Function: H5G__stab_iterate * * Purpose: Iterate over the objects in a group * @@ -488,7 +527,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G_stab_iterate(const H5O_loc_t *oloc, hid_t dxpl_id, H5_iter_order_t order, +H5G__stab_iterate(const H5O_loc_t *oloc, hid_t dxpl_id, H5_iter_order_t order, hsize_t skip, hsize_t *last_lnk, H5G_lib_iterate_t op, void *op_data) { H5HL_t *heap = NULL; /* Local heap for group */ @@ -496,7 +535,7 @@ H5G_stab_iterate(const H5O_loc_t *oloc, hid_t dxpl_id, H5_iter_order_t order, H5G_link_table_t ltable = {0, NULL}; /* Link table */ herr_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_TAG(H5G_stab_iterate, dxpl_id, oloc->addr, FAIL) + FUNC_ENTER_PACKAGE_TAG(dxpl_id, oloc->addr, FAIL) /* Sanity check */ HDassert(oloc); @@ -515,7 +554,7 @@ H5G_stab_iterate(const H5O_loc_t *oloc, hid_t dxpl_id, H5_iter_order_t order, if(order != H5_ITER_DEC) { H5G_bt_it_it_t udata; /* User data to pass to B-tree callback */ - /* Build udata to pass through H5B_iterate() to H5G_node_iterate() */ + /* Build udata to pass through H5B_iterate() to H5G__node_iterate() */ udata.heap = heap; udata.skip = skip; udata.final_ent = last_lnk; @@ -523,7 +562,7 @@ H5G_stab_iterate(const H5O_loc_t *oloc, hid_t dxpl_id, H5_iter_order_t order, udata.op_data = op_data; /* Iterate over the group members */ - if((ret_value = H5B_iterate(oloc->file, dxpl_id, H5B_SNODE, stab.btree_addr, H5G_node_iterate, &udata, NULL)) < 0) + if((ret_value = H5B_iterate(oloc->file, dxpl_id, H5B_SNODE, stab.btree_addr, H5G__node_iterate, &udata, NULL)) < 0) HERROR(H5E_SYM, H5E_CANTNEXT, "iteration operator failed"); /* Check for too high of a starting index (ex post facto :-) */ @@ -534,13 +573,13 @@ H5G_stab_iterate(const H5O_loc_t *oloc, hid_t dxpl_id, H5_iter_order_t order, else { H5G_bt_it_bt_t udata; /* User data to pass to B-tree callback */ - /* Build udata to pass through H5B_iterate() to H5G_node_build_table() */ + /* Build udata to pass through H5B_iterate() to H5G__node_build_table() */ udata.alloc_nlinks = 0; udata.heap = heap; udata.ltable = <able; /* Iterate over the group members */ - if(H5B_iterate(oloc->file, dxpl_id, H5B_SNODE, stab.btree_addr, H5G_node_build_table, &udata, NULL) < 0) + if(H5B_iterate(oloc->file, dxpl_id, H5B_SNODE, stab.btree_addr, H5G__node_build_table, &udata, NULL) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to build link table") /* Check for skipping out of bounds */ @@ -548,11 +587,11 @@ H5G_stab_iterate(const H5O_loc_t *oloc, hid_t dxpl_id, H5_iter_order_t order, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "index out of bound") /* Sort link table in correct iteration order */ - if(H5G_link_sort_table(<able, H5_INDEX_NAME, order) < 0) + if(H5G__link_sort_table(<able, H5_INDEX_NAME, order) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTSORT, FAIL, "error sorting link messages") /* Iterate over links in table */ - if((ret_value = H5G_link_iterate_table(<able, skip, last_lnk, op, op_data)) < 0) + if((ret_value = H5G__link_iterate_table(<able, skip, last_lnk, op, op_data)) < 0) HERROR(H5E_SYM, H5E_CANTNEXT, "iteration operator failed"); } /* end else */ @@ -560,15 +599,15 @@ done: /* Release resources */ if(heap && H5HL_unprotect(heap) < 0) HDONE_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to unprotect symbol table heap") - if(ltable.lnks && H5G_link_release_table(<able) < 0) + if(ltable.lnks && H5G__link_release_table(<able) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTFREE, FAIL, "unable to release link table") FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) -} /* end H5G_stab_iterate() */ +} /* end H5G__stab_iterate() */ /*------------------------------------------------------------------------- - * Function: H5G_stab_count + * Function: H5G__stab_count * * Purpose: Count the # of links in a group * @@ -580,12 +619,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G_stab_count(H5O_loc_t *oloc, hsize_t *num_objs, hid_t dxpl_id) +H5G__stab_count(H5O_loc_t *oloc, hsize_t *num_objs, hid_t dxpl_id) { H5O_stab_t stab; /* Info about symbol table */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_TAG(H5G_stab_count, dxpl_id, oloc->addr, FAIL) + FUNC_ENTER_PACKAGE_TAG(dxpl_id, oloc->addr, FAIL) /* Sanity check */ HDassert(oloc); @@ -599,16 +638,16 @@ H5G_stab_count(H5O_loc_t *oloc, hsize_t *num_objs, hid_t dxpl_id) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to determine local heap address") /* Iterate over the group members */ - if(H5B_iterate(oloc->file, dxpl_id, H5B_SNODE, stab.btree_addr, H5G_node_sumup, num_objs, NULL) < 0) + if(H5B_iterate(oloc->file, dxpl_id, H5B_SNODE, stab.btree_addr, H5G__node_sumup, num_objs, NULL) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "iteration operator failed") done: FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) -} /* end H5G_stab_count() */ +} /* end H5G__stab_count() */ /*------------------------------------------------------------------------- - * Function: H5G_stab_bh_size + * Function: H5G__stab_bh_size * * Purpose: Retrieve storage for btree and heap (1.6) * @@ -620,14 +659,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G_stab_bh_size(H5F_t *f, hid_t dxpl_id, const H5O_stab_t *stab, +H5G__stab_bh_size(H5F_t *f, hid_t dxpl_id, const H5O_stab_t *stab, H5_ih_info_t *bh_info) { hsize_t snode_size; /* Symbol table node size */ H5B_info_t bt_info; /* B-tree node info */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI(H5G_stab_bh_size, FAIL) + FUNC_ENTER_PACKAGE /* Sanity check */ HDassert(f); @@ -638,7 +677,7 @@ H5G_stab_bh_size(H5F_t *f, hid_t dxpl_id, const H5O_stab_t *stab, snode_size = 0; /* Get the B-tree & symbol table node size info */ - if(H5B_get_info(f, dxpl_id, H5B_SNODE, stab->btree_addr, &bt_info, H5G_node_iterate_size, &snode_size, NULL) < 0) + if(H5B_get_info(f, dxpl_id, H5B_SNODE, stab->btree_addr, &bt_info, H5G__node_iterate_size, &snode_size, NULL) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "iteration operator failed") /* Add symbol table & B-tree node sizes to index info */ @@ -650,7 +689,7 @@ H5G_stab_bh_size(H5F_t *f, hid_t dxpl_id, const H5O_stab_t *stab, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_stab_bh_size() */ +} /* end H5G__stab_bh_size() */ /*------------------------------------------------------------------------- @@ -674,7 +713,7 @@ H5G_stab_get_name_by_idx_cb(const H5G_entry_t *ent, void *_udata) size_t name_off; /* Offset of name in heap */ const char *name; /* Pointer to name string in heap */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_stab_get_name_by_idx_cb) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ HDassert(ent); @@ -692,7 +731,7 @@ H5G_stab_get_name_by_idx_cb(const H5G_entry_t *ent, void *_udata) /*------------------------------------------------------------------------- - * Function: H5G_stab_get_name_by_idx + * Function: H5G__stab_get_name_by_idx * * Purpose: Returns the name of objects in the group by giving index. * @@ -705,7 +744,7 @@ H5G_stab_get_name_by_idx_cb(const H5G_entry_t *ent, void *_udata) *------------------------------------------------------------------------- */ ssize_t -H5G_stab_get_name_by_idx(H5O_loc_t *oloc, H5_iter_order_t order, hsize_t n, +H5G__stab_get_name_by_idx(const H5O_loc_t *oloc, H5_iter_order_t order, hsize_t n, char* name, size_t size, hid_t dxpl_id) { H5HL_t *heap = NULL; /* Pointer to local heap */ @@ -714,7 +753,10 @@ H5G_stab_get_name_by_idx(H5O_loc_t *oloc, H5_iter_order_t order, hsize_t n, hbool_t udata_valid = FALSE; /* Whether iteration information is valid */ ssize_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5G_stab_get_name_by_idx, FAIL) + /* Portably clear udata struct (before FUNC_ENTER) */ + HDmemset(&udata, 0, sizeof(udata)); + + FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ HDassert(oloc); @@ -732,7 +774,7 @@ H5G_stab_get_name_by_idx(H5O_loc_t *oloc, H5_iter_order_t order, hsize_t n, hsize_t nlinks = 0; /* Number of links in group */ /* Iterate over the symbol table nodes, to count the links */ - if(H5B_iterate(oloc->file, dxpl_id, H5B_SNODE, stab.btree_addr, H5G_node_sumup, &nlinks, NULL) < 0) + if(H5B_iterate(oloc->file, dxpl_id, H5B_SNODE, stab.btree_addr, H5G__node_sumup, &nlinks, NULL) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "iteration operator failed") /* Map decreasing iteration order index to increasing iteration order index */ @@ -748,7 +790,7 @@ H5G_stab_get_name_by_idx(H5O_loc_t *oloc, H5_iter_order_t order, hsize_t n, udata_valid = TRUE; /* Iterate over the group members */ - if(H5B_iterate(oloc->file, dxpl_id, H5B_SNODE, stab.btree_addr, H5G_node_by_idx, &udata, NULL) < 0) + if(H5B_iterate(oloc->file, dxpl_id, H5B_SNODE, stab.btree_addr, H5G__node_by_idx, &udata, NULL) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "iteration operator failed") /* If we don't know the name now, we almost certainly went out of bounds */ @@ -775,7 +817,7 @@ done: H5MM_xfree(udata.name); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_stab_get_name_by_idx() */ +} /* end H5G__stab_get_name_by_idx() */ /*------------------------------------------------------------------------- @@ -798,12 +840,12 @@ H5G_stab_lookup_cb(const H5G_entry_t *ent, void *_udata) H5G_stab_fnd_ud_t *udata = (H5G_stab_fnd_ud_t *)_udata; /* 'User data' passed in */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5G_stab_lookup_cb) + FUNC_ENTER_NOAPI_NOINIT /* Check for setting link info */ if(udata->lnk) /* Convert the entry to a link */ - if(H5G_ent_to_link(udata->lnk, udata->heap, ent, udata->name) < 0) + if(H5G__ent_to_link(udata->lnk, udata->heap, ent, udata->name) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTCONVERT, FAIL, "unable to convert symbol table entry to link") done: @@ -812,7 +854,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_stab_lookup + * Function: H5G__stab_lookup * * Purpose: Look up an object relative to a group, using symbol table * @@ -825,7 +867,7 @@ done: *------------------------------------------------------------------------- */ htri_t -H5G_stab_lookup(H5O_loc_t *grp_oloc, const char *name, H5O_link_t *lnk, +H5G__stab_lookup(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *lnk, hid_t dxpl_id) { H5HL_t *heap = NULL; /* Pointer to local heap */ @@ -834,7 +876,7 @@ H5G_stab_lookup(H5O_loc_t *grp_oloc, const char *name, H5O_link_t *lnk, H5O_stab_t stab; /* Symbol table message */ htri_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5G_stab_lookup, FAIL) + FUNC_ENTER_PACKAGE /* check arguments */ HDassert(grp_oloc && grp_oloc->file); @@ -870,7 +912,7 @@ done: HDONE_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to unprotect symbol table heap") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_stab_lookup() */ +} /* end H5G__stab_lookup() */ /*------------------------------------------------------------------------- @@ -894,7 +936,7 @@ H5G_stab_lookup_by_idx_cb(const H5G_entry_t *ent, void *_udata) const char *name; /* Pointer to name string in heap */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5G_stab_lookup_by_idx_cb) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(ent); @@ -905,7 +947,7 @@ H5G_stab_lookup_by_idx_cb(const H5G_entry_t *ent, void *_udata) HDassert(name); /* Convert the entry to a link */ - if(H5G_ent_to_link(udata->lnk, udata->heap, ent, name) < 0) + if(H5G__ent_to_link(udata->lnk, udata->heap, ent, name) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTCONVERT, FAIL, "unable to convert symbol table entry to link") udata->found = TRUE; @@ -915,7 +957,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_stab_lookup_by_idx + * Function: H5G__stab_lookup_by_idx * * Purpose: Look up an object in a group, according to the name index * @@ -928,7 +970,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G_stab_lookup_by_idx(H5O_loc_t *grp_oloc, H5_iter_order_t order, hsize_t n, +H5G__stab_lookup_by_idx(const H5O_loc_t *grp_oloc, H5_iter_order_t order, hsize_t n, H5O_link_t *lnk, hid_t dxpl_id) { H5HL_t *heap = NULL; /* Pointer to local heap */ @@ -936,7 +978,7 @@ H5G_stab_lookup_by_idx(H5O_loc_t *grp_oloc, H5_iter_order_t order, hsize_t n, H5O_stab_t stab; /* Symbol table message */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5G_stab_lookup_by_idx, FAIL) + FUNC_ENTER_PACKAGE /* check arguments */ HDassert(grp_oloc && grp_oloc->file); @@ -955,7 +997,7 @@ H5G_stab_lookup_by_idx(H5O_loc_t *grp_oloc, H5_iter_order_t order, hsize_t n, hsize_t nlinks = 0; /* Number of links in group */ /* Iterate over the symbol table nodes, to count the links */ - if(H5B_iterate(grp_oloc->file, dxpl_id, H5B_SNODE, stab.btree_addr, H5G_node_sumup, &nlinks, NULL) < 0) + if(H5B_iterate(grp_oloc->file, dxpl_id, H5B_SNODE, stab.btree_addr, H5G__node_sumup, &nlinks, NULL) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "iteration operator failed") /* Map decreasing iteration order index to increasing iteration order index */ @@ -971,7 +1013,7 @@ H5G_stab_lookup_by_idx(H5O_loc_t *grp_oloc, H5_iter_order_t order, hsize_t n, udata.found = FALSE; /* Iterate over the group members */ - if(H5B_iterate(grp_oloc->file, dxpl_id, H5B_SNODE, stab.btree_addr, H5G_node_by_idx, &udata, NULL) < 0) + if(H5B_iterate(grp_oloc->file, dxpl_id, H5B_SNODE, stab.btree_addr, H5G__node_by_idx, &udata, NULL) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "iteration operator failed") /* If we didn't find the link, we almost certainly went out of bounds */ @@ -984,18 +1026,24 @@ done: HDONE_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to unprotect symbol table heap") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_stab_lookup_by_idx() */ +} /* end H5G__stab_lookup_by_idx() */ #ifndef H5_STRICT_FORMAT_CHECKS /*------------------------------------------------------------------------- - * Function: H5G_stab_valid + * Function: H5G__stab_valid * * Purpose: Verify that a group's symbol table message is valid. If * provided, the addresses in alt_stab will be tried if the * addresses in the group's stab message are invalid, and * the stab message will be updated if necessary. * + * NOTE: This function is only called when strict format + * checks are disabled. This is so that, when strict + * format checks are enabled, errors in the symbol table + * messages are not fixed by this function and are instead + * reported by the library. + * * Return: Non-negative on success/Negative on failure * * Programmer: Neil Fortner @@ -1005,14 +1053,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G_stab_valid(H5O_loc_t *grp_oloc, hid_t dxpl_id, H5O_stab_t *alt_stab) +H5G__stab_valid(H5O_loc_t *grp_oloc, hid_t dxpl_id, H5O_stab_t *alt_stab) { H5O_stab_t stab; /* Current symbol table */ H5HL_t *heap = NULL; /* Pointer to local heap */ hbool_t changed = FALSE; /* Whether stab has been modified */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(H5G_stab_valid, dxpl_id, grp_oloc->addr, FAIL) + FUNC_ENTER_PACKAGE_TAG(dxpl_id, grp_oloc->addr, FAIL) /* Read the symbol table message */ if(NULL == H5O_msg_read(grp_oloc, H5O_STAB_ID, &stab, dxpl_id)) @@ -1059,7 +1107,7 @@ done: HDONE_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to unprotect symbol table heap") FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) -} /* end H5G_stab_valid */ +} /* end H5G__stab_valid */ #endif /* H5_STRICT_FORMAT_CHECKS */ #ifndef H5_NO_DEPRECATED_SYMBOLS @@ -1084,7 +1132,7 @@ H5G_stab_get_type_by_idx_cb(const H5G_entry_t *ent, void *_udata) H5G_bt_it_gtbi_t *udata = (H5G_bt_it_gtbi_t *)_udata; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5G_stab_get_type_by_idx_cb) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(ent); @@ -1124,7 +1172,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_get_objtype_by_idx + * Function: H5G__stab_get_type_by_idx * * Purpose: Private function for H5Gget_objtype_by_idx. * Returns the type of objects in the group by giving index. @@ -1139,13 +1187,13 @@ done: *------------------------------------------------------------------------- */ H5G_obj_t -H5G_stab_get_type_by_idx(H5O_loc_t *oloc, hsize_t idx, hid_t dxpl_id) +H5G__stab_get_type_by_idx(H5O_loc_t *oloc, hsize_t idx, hid_t dxpl_id) { H5O_stab_t stab; /* Info about local heap & B-tree */ H5G_bt_it_gtbi_t udata; /* User data for B-tree callback */ H5G_obj_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_TAG(H5G_stab_get_type_by_idx, dxpl_id, oloc->addr, H5G_UNKNOWN) + FUNC_ENTER_PACKAGE_TAG(dxpl_id, oloc->addr, H5G_UNKNOWN) /* Sanity check */ HDassert(oloc); @@ -1163,7 +1211,7 @@ H5G_stab_get_type_by_idx(H5O_loc_t *oloc, hsize_t idx, hid_t dxpl_id) udata.type = H5G_UNKNOWN; /* Iterate over the group members */ - if(H5B_iterate(oloc->file, dxpl_id, H5B_SNODE, stab.btree_addr, H5G_node_by_idx, &udata, NULL) < 0) + if(H5B_iterate(oloc->file, dxpl_id, H5B_SNODE, stab.btree_addr, H5G__node_by_idx, &udata, NULL) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5G_UNKNOWN, "iteration operator failed") /* If we don't know the type now, we almost certainly went out of bounds */ @@ -1175,6 +1223,6 @@ H5G_stab_get_type_by_idx(H5O_loc_t *oloc, hsize_t idx, hid_t dxpl_id) done: FUNC_LEAVE_NOAPI_TAG(ret_value, H5G_UNKNOWN) -} /* end H5G_stab_get_type_by_idx() */ +} /* end H5G__stab_get_type_by_idx() */ #endif /* H5_NO_DEPRECATED_SYMBOLS */ diff --git a/src/H5Gtest.c b/src/H5Gtest.c index b6e3e141..dfdefda 100644 --- a/src/H5Gtest.c +++ b/src/H5Gtest.c @@ -74,11 +74,11 @@ /*-------------------------------------------------------------------------- NAME - H5G_is_empty_test + H5G__is_empty_test PURPOSE Determine whether a group contains no objects USAGE - htri_t H5G_is_empty_test(gid) + htri_t H5G__is_empty_test(gid) hid_t gid; IN: group to check RETURNS Non-negative TRUE/FALSE on success, negative on failure @@ -92,14 +92,14 @@ REVISION LOG --------------------------------------------------------------------------*/ htri_t -H5G_is_empty_test(hid_t gid) +H5G__is_empty_test(hid_t gid) { H5G_t *grp = NULL; /* Pointer to group */ htri_t msg_exists = FALSE; /* Indicate that a header message is present */ htri_t linfo_exists = FALSE;/* Indicate that the 'link info' message is present */ htri_t ret_value = TRUE; /* Return value */ - FUNC_ENTER_NOAPI(H5G_is_empty_test, FAIL) + FUNC_ENTER_PACKAGE /* Get group structure */ if(NULL == (grp = (H5G_t *)H5I_object_verify(gid, H5I_GROUP))) @@ -133,7 +133,7 @@ H5G_is_empty_test(hid_t gid) HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "both symbol table and link info messages found") /* Get the link info */ - if(H5G_obj_get_linfo(&(grp->oloc), &linfo, H5AC_dxpl_id) < 0) + if(H5G__obj_get_linfo(&(grp->oloc), &linfo, H5AC_dxpl_id) < 0) HGOTO_ERROR(H5E_SYM, H5E_BADMESG, FAIL, "can't get link info") /* Check for 'dense' link storage file addresses being defined */ @@ -171,7 +171,7 @@ H5G_is_empty_test(hid_t gid) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to read symbol table message") /* Get the count of links in the group */ - if(H5G_stab_count(&(grp->oloc), &nlinks, H5AC_dxpl_id) < 0) + if(H5G__stab_count(&(grp->oloc), &nlinks, H5AC_dxpl_id) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to count links") /* Check for link count */ @@ -181,16 +181,16 @@ H5G_is_empty_test(hid_t gid) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5G_is_empty_test() */ +} /* H5G__is_empty_test() */ /*-------------------------------------------------------------------------- NAME - H5G_has_links_test + H5G__has_links_test PURPOSE Determine whether a group contains link messages USAGE - htri_t H5G_has_links_test(gid) + htri_t H5G__has_links_test(gid) hid_t gid; IN: group to check unsigned *nmsgs; OUT: # of link messages in header RETURNS @@ -204,13 +204,13 @@ done: REVISION LOG --------------------------------------------------------------------------*/ htri_t -H5G_has_links_test(hid_t gid, unsigned *nmsgs) +H5G__has_links_test(hid_t gid, unsigned *nmsgs) { H5G_t *grp = NULL; /* Pointer to group */ htri_t msg_exists = 0; /* Indicate that a header message is present */ htri_t ret_value = TRUE; /* Return value */ - FUNC_ENTER_NOAPI(H5G_has_links_test, FAIL) + FUNC_ENTER_PACKAGE /* Get group structure */ if(NULL == (grp = (H5G_t *)H5I_object_verify(gid, H5I_GROUP))) @@ -240,16 +240,16 @@ H5G_has_links_test(hid_t gid, unsigned *nmsgs) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5G_has_links_test() */ +} /* H5G__has_links_test() */ /*-------------------------------------------------------------------------- NAME - H5G_has_stab_test + H5G__has_stab_test PURPOSE Determine whether a group contains a symbol table message USAGE - htri_t H5G_has_stab_test(gid) + htri_t H5G__has_stab_test(gid) hid_t gid; IN: group to check RETURNS Non-negative TRUE/FALSE on success, negative on failure @@ -262,13 +262,13 @@ done: REVISION LOG --------------------------------------------------------------------------*/ htri_t -H5G_has_stab_test(hid_t gid) +H5G__has_stab_test(hid_t gid) { H5G_t *grp = NULL; /* Pointer to group */ htri_t msg_exists = 0; /* Indicate that a header message is present */ htri_t ret_value = TRUE; /* Return value */ - FUNC_ENTER_NOAPI(H5G_has_stab_test, FAIL) + FUNC_ENTER_PACKAGE /* Get group structure */ if(NULL == (grp = (H5G_t *)H5I_object_verify(gid, H5I_GROUP))) @@ -288,16 +288,16 @@ H5G_has_stab_test(hid_t gid) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5G_has_stab_test() */ +} /* H5G__has_stab_test() */ /*-------------------------------------------------------------------------- NAME - H5G_is_new_dense_test + H5G__is_new_dense_test PURPOSE Determine whether a group is in the "new" format and dense USAGE - htri_t H5G_is_new_dense_test(gid) + htri_t H5G__is_new_dense_test(gid) hid_t gid; IN: group to check RETURNS Non-negative TRUE/FALSE on success, negative on failure @@ -312,13 +312,13 @@ done: REVISION LOG --------------------------------------------------------------------------*/ htri_t -H5G_is_new_dense_test(hid_t gid) +H5G__is_new_dense_test(hid_t gid) { H5G_t *grp = NULL; /* Pointer to group */ htri_t msg_exists = 0; /* Indicate that a header message is present */ htri_t ret_value = TRUE; /* Return value */ - FUNC_ENTER_NOAPI(H5G_is_new_dense_test, FAIL) + FUNC_ENTER_PACKAGE /* Get group structure */ if(NULL == (grp = (H5G_t *)H5I_object_verify(gid, H5I_GROUP))) @@ -343,7 +343,7 @@ H5G_is_new_dense_test(hid_t gid) H5O_linfo_t linfo; /* Link info message */ /* Get the link info */ - if(H5G_obj_get_linfo(&(grp->oloc), &linfo, H5AC_dxpl_id) < 0) + if(H5G__obj_get_linfo(&(grp->oloc), &linfo, H5AC_dxpl_id) < 0) HGOTO_ERROR(H5E_SYM, H5E_BADMESG, FAIL, "can't get link info") /* Check for 'dense' link storage file addresses being defined */ @@ -355,16 +355,16 @@ H5G_is_new_dense_test(hid_t gid) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5G_is_new_dense_test() */ +} /* H5G__is_new_dense_test() */ /*-------------------------------------------------------------------------- NAME - H5G_new_dense_info_test + H5G__new_dense_info_test PURPOSE Retrieve information about the state of the new "dense" storage for groups USAGE - herr_t H5G_new_dense_info_test(gid, name_count, corder_count) + herr_t H5G__new_dense_info_test(gid, name_count, corder_count) hid_t gid; IN: group to check hsize_t *name_count; OUT: Number of links in name index hsize_t *corder_count; OUT: Number of links in creation order index @@ -380,7 +380,7 @@ done: REVISION LOG --------------------------------------------------------------------------*/ herr_t -H5G_new_dense_info_test(hid_t gid, hsize_t *name_count, hsize_t *corder_count) +H5G__new_dense_info_test(hid_t gid, hsize_t *name_count, hsize_t *corder_count) { H5B2_t *bt2_name = NULL; /* v2 B-tree handle for name index */ H5B2_t *bt2_corder = NULL; /* v2 B-tree handle for creation order index */ @@ -388,7 +388,7 @@ H5G_new_dense_info_test(hid_t gid, hsize_t *name_count, hsize_t *corder_count) H5G_t *grp = NULL; /* Pointer to group */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5G_new_dense_info_test, FAIL) + FUNC_ENTER_PACKAGE /* Get group structure */ if(NULL == (grp = (H5G_t *)H5I_object_verify(gid, H5I_GROUP))) @@ -398,7 +398,7 @@ H5G_new_dense_info_test(hid_t gid, hsize_t *name_count, hsize_t *corder_count) H5_BEGIN_TAG(H5AC_dxpl_id, grp->oloc.addr, FAIL); /* Get the link info */ - if(H5G_obj_get_linfo(&(grp->oloc), &linfo, H5AC_dxpl_id) < 0) + if(H5G__obj_get_linfo(&(grp->oloc), &linfo, H5AC_dxpl_id) < 0) HGOTO_ERROR(H5E_SYM, H5E_BADMESG, FAIL, "can't get link info") /* Check for 'dense' link storage file addresses being defined */ @@ -428,6 +428,9 @@ H5G_new_dense_info_test(hid_t gid, hsize_t *name_count, hsize_t *corder_count) else *corder_count = 0; + /* Reset metadata tag in dxpl_id */ + H5_END_TAG(FAIL); + done: /* Release resources */ if(bt2_name && H5B2_close(bt2_name, H5AC_dxpl_id) < 0) @@ -435,20 +438,17 @@ done: if(bt2_corder && H5B2_close(bt2_corder, H5AC_dxpl_id) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTCLOSEOBJ, FAIL, "can't close v2 B-tree for creation order index") - /* Reset metadata tag in dxpl_id */ - H5_END_TAG(FAIL); - FUNC_LEAVE_NOAPI(ret_value) -} /* H5G_new_dense_info_test() */ +} /* H5G__new_dense_info_test() */ /*-------------------------------------------------------------------------- NAME - H5G_lheap_size_test + H5G__lheap_size_test PURPOSE Determine the size of a local heap for a group USAGE - herr_t H5G_lheap_size_test(gid, lheap_size) + herr_t H5G__lheap_size_test(gid, lheap_size) hid_t gid; IN: group to check size_t *lheap_size; OUT: Size of local heap RETURNS @@ -462,13 +462,13 @@ done: REVISION LOG --------------------------------------------------------------------------*/ herr_t -H5G_lheap_size_test(hid_t gid, size_t *lheap_size) +H5G__lheap_size_test(hid_t gid, size_t *lheap_size) { H5G_t *grp = NULL; /* Pointer to group */ H5O_stab_t stab; /* Symbol table message */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5G_lheap_size_test, FAIL) + FUNC_ENTER_PACKAGE /* Get group structure */ if(NULL == (grp = (H5G_t *)H5I_object_verify(gid, H5I_GROUP))) @@ -484,16 +484,16 @@ H5G_lheap_size_test(hid_t gid, size_t *lheap_size) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5G_lheap_size_test() */ +} /* H5G__lheap_size_test() */ /*-------------------------------------------------------------------------- NAME - H5G_user_path_test + H5G__user_path_test PURPOSE Retrieve the user path for an ID USAGE - herr_t H5G_user_path_test(obj_id, user_path, user_path_len) + herr_t H5G__user_path_test(obj_id, user_path, user_path_len) hid_t obj_id; IN: ID to check char *user_path; OUT: Pointer to buffer for User path size_t *user_path_len; OUT: Size of user path @@ -510,13 +510,13 @@ done: REVISION LOG --------------------------------------------------------------------------*/ herr_t -H5G_user_path_test(hid_t obj_id, char *user_path, size_t *user_path_len, unsigned *obj_hidden) +H5G__user_path_test(hid_t obj_id, char *user_path, size_t *user_path_len, unsigned *obj_hidden) { void *obj_ptr; /* Pointer to object for ID */ H5G_name_t *obj_path; /* Pointer to group hier. path for obj */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5G_user_path_test, FAIL) + FUNC_ENTER_PACKAGE /* Sanity check */ HDassert(user_path_len); @@ -583,11 +583,11 @@ H5G_user_path_test(hid_t obj_id, char *user_path, size_t *user_path_len, unsigne done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5G_user_path_test() */ +} /* H5G__user_path_test() */ /*------------------------------------------------------------------------- - * Function: H5G_verify_cached_stab_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 @@ -603,13 +603,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G_verify_cached_stab_test(H5O_loc_t *grp_oloc, H5G_entry_t *ent) +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_TAG(H5G_verify_cached_stab_test, H5AC_ind_dxpl_id, grp_oloc->addr, FAIL) + FUNC_ENTER_PACKAGE_TAG(H5AC_ind_dxpl_id, grp_oloc->addr, FAIL) /* Verify that stab info is cached in ent */ if(ent->type != H5G_CACHED_STAB) @@ -639,7 +639,7 @@ done: HDONE_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to unprotect symbol table heap") FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) -} /* end H5G_verify_cached_stab_test() */ +} /* end H5G__verify_cached_stab_test() */ /*------------------------------------------------------------------------- @@ -670,7 +670,7 @@ H5G_verify_cached_stabs_test_cb(H5F_t *f, hid_t dxpl_id, unsigned i; int ret_value = H5_ITER_CONT; - FUNC_ENTER_NOAPI(H5G_verify_cached_stabs_test_cb, H5_ITER_ERROR) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -738,7 +738,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_verify_cached_stabs_test + * Function: H5G__verify_cached_stabs_test * * Purpose: If the provided group contains a symbol table, verifies * that all links in the group contain cached symbol table @@ -756,7 +756,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G_verify_cached_stabs_test(hid_t gid) +H5G__verify_cached_stabs_test(hid_t gid) { H5G_t *grp = NULL; /* Group */ htri_t stab_exists; @@ -765,7 +765,7 @@ H5G_verify_cached_stabs_test(hid_t gid) haddr_t prev_tag = HADDR_UNDEF; /* Previous metadata tag */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5G_verify_cached_stabs_test, FAIL) + FUNC_ENTER_PACKAGE /* check args */ HDassert(gid >= 0); @@ -804,5 +804,5 @@ H5G_verify_cached_stabs_test(hid_t gid) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_verify_cached_stabs_test() */ +} /* end H5G__verify_cached_stabs_test() */ diff --git a/src/H5Gtraverse.c b/src/H5Gtraverse.c index 4397d1c..291734e 100644 --- a/src/H5Gtraverse.c +++ b/src/H5Gtraverse.c @@ -23,15 +23,21 @@ * *------------------------------------------------------------------------- */ -#define H5F_PACKAGE /*suppress error about including H5Fpkg */ + +/****************/ +/* Module Setup */ +/****************/ + #define H5G_PACKAGE /*suppress error about including H5Gpkg */ -/* Packages needed by this file... */ +/***********/ +/* Headers */ +/***********/ #include "H5private.h" /* Generic Functions */ #include "H5Dprivate.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ -#include "H5Fpkg.h" /* File access */ +#include "H5Fprivate.h" /* File access */ #include "H5Gpkg.h" /* Groups */ #include "H5HLprivate.h" /* Local Heaps */ #include "H5Iprivate.h" /* IDs */ @@ -40,7 +46,15 @@ #include "H5Ppublic.h" /* Property Lists */ #include "H5WBprivate.h" /* Wrapped Buffers */ -/* Private typedefs */ + +/****************/ +/* Local Macros */ +/****************/ + + +/******************/ +/* Local Typedefs */ +/******************/ /* User data for path traversal routine */ typedef struct { @@ -52,11 +66,15 @@ typedef struct { hbool_t exists; /* Indicate if object exists */ } H5G_trav_slink_t; -/* Private macros */ -/* Local variables */ +/********************/ +/* Package Typedefs */ +/********************/ -/* PRIVATE PROTOTYPES */ + +/********************/ +/* Local Prototypes */ +/********************/ static herr_t H5G_traverse_slink_cb(H5G_loc_t *grp_loc, const char *name, const H5O_link_t *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/); @@ -66,11 +84,26 @@ static herr_t H5G_traverse_ud(const H5G_loc_t *grp_loc, const H5O_link_t *lnk, static herr_t H5G_traverse_slink(const H5G_loc_t *grp_loc, const H5O_link_t *lnk, H5G_loc_t *obj_loc/*in,out*/, unsigned target, size_t *nlinks/*in,out*/, hbool_t *obj_exists, hid_t lapl_id, hid_t dxpl_id); -static herr_t H5G_traverse_mount(H5G_loc_t *loc/*in,out*/); static herr_t H5G_traverse_real(const H5G_loc_t *loc, const char *name, unsigned target, size_t *nlinks, H5G_traverse_t op, void *op_data, hid_t lapl_id, hid_t dxpl_id); + +/*********************/ +/* Package Variables */ +/*********************/ + + +/*****************************/ +/* Library Private Variables */ +/*****************************/ + + +/*******************/ +/* Local Variables */ +/*******************/ + + /*------------------------------------------------------------------------- * Function: H5G_traverse_slink_cb @@ -93,7 +126,7 @@ H5G_traverse_slink_cb(H5G_loc_t UNUSED *grp_loc, const char UNUSED *name, H5G_trav_slink_t *udata = (H5G_trav_slink_t *)_udata; /* User data passed in */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5G_traverse_slink_cb) + FUNC_ENTER_NOAPI_NOINIT /* Check for dangling soft link */ if(obj_loc == NULL) { @@ -149,7 +182,7 @@ H5G_traverse_ud(const H5G_loc_t *grp_loc/*in,out*/, const H5O_link_t *lnk, hid_t cur_grp = (-1); herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5G_traverse_ud) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(grp_loc); @@ -291,7 +324,7 @@ H5G_traverse_slink(const H5G_loc_t *grp_loc, const H5O_link_t *lnk, hbool_t tmp_grp_loc_set = FALSE; /* Flag to indicate that tmp group location is initialized */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5G_traverse_slink) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(grp_loc); @@ -347,87 +380,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5G_traverse_mount - * - * Purpose: If LNK is a mount point then copy the entry for the root - * group of the mounted file into LNK. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Robb Matzke - * Tuesday, October 6, 1998 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5G_traverse_mount(H5G_loc_t *obj_loc/*in,out*/) -{ - H5F_t *parent = obj_loc->oloc->file, /* File of object */ - *child = NULL; /* Child file */ - unsigned lt, rt, md = 0; /* Binary search indices */ - int cmp; - H5O_loc_t *oloc = NULL; /* Object location for mount points */ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5G_traverse_mount, FAIL) - - /* Sanity check */ - HDassert(obj_loc); - - /* - * The loop is necessary because we might have file1 mounted at the root - * of file2, which is mounted somewhere in file3. - */ - do { - /* - * Use a binary search to find the potential mount point in the mount - * table for the parent - */ - lt = 0; - rt = parent->shared->mtab.nmounts; - cmp = -1; - while(lt < rt && cmp) { - md = (lt + rt) / 2; - oloc = H5G_oloc(parent->shared->mtab.child[md].group); - cmp = H5F_addr_cmp(obj_loc->oloc->addr, oloc->addr); - if(cmp < 0) - rt = md; - else - lt = md + 1; - } /* end while */ - - /* Copy root info over to ENT */ - if(0 == cmp) { - /* Get the child file */ - child = parent->shared->mtab.child[md].file; - - /* Get the location for the root group in the child's file */ - oloc = H5G_oloc(child->shared->root_grp); - - /* Release the mount point */ - if(H5O_loc_free(obj_loc->oloc) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTFREE, FAIL, "unable to free object location") - - /* Copy the entry for the root group */ - if(H5O_loc_copy(obj_loc->oloc, oloc, H5_COPY_DEEP) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTCOPY, FAIL, "unable to copy object location") - - /* In case the shared root group info points to a different file handle - * than the child, modify obj_loc */ - obj_loc->oloc->file = child; - - /* Switch to child's file */ - parent = child; - } /* end if */ - } while(!cmp); - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_traverse_mount() */ - - -/*------------------------------------------------------------------------- - * Function: H5G_traverse_special + * Function: H5G__traverse_special * * Purpose: Handle traversing special link situations * @@ -440,13 +393,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5G_traverse_special(const H5G_loc_t *grp_loc, const H5O_link_t *lnk, +H5G__traverse_special(const H5G_loc_t *grp_loc, const H5O_link_t *lnk, unsigned target, size_t *nlinks, hbool_t last_comp, H5G_loc_t *obj_loc, hbool_t *obj_exists, hid_t lapl_id, hid_t dxpl_id) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5G_traverse_special, FAIL) + FUNC_ENTER_PACKAGE /* Sanity check */ HDassert(grp_loc); @@ -493,7 +446,7 @@ H5G_traverse_special(const H5G_loc_t *grp_loc, const H5O_link_t *lnk, */ if(H5F_addr_defined(obj_loc->oloc->addr) && (0 == (target & H5G_TARGET_MOUNT) || !last_comp)) { - if(H5G_traverse_mount(obj_loc/*in,out*/) < 0) + if(H5F_traverse_mount(obj_loc->oloc/*in,out*/) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "mount point traversal failed") } /* end if */ @@ -507,7 +460,7 @@ H5G_traverse_special(const H5G_loc_t *grp_loc, const H5O_link_t *lnk, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_traverse_special() */ +} /* end H5G__traverse_special() */ /*------------------------------------------------------------------------- @@ -549,7 +502,7 @@ H5G_traverse_real(const H5G_loc_t *_loc, const char *name, unsigned target, hbool_t last_comp = FALSE; /* Flag to indicate that a component is the last component in the name */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5G_traverse_real) + FUNC_ENTER_NOAPI_NOINIT /* Check parameters */ HDassert(_loc); @@ -608,7 +561,7 @@ H5G_traverse_real(const H5G_loc_t *_loc, const char *name, unsigned target, HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't get actual buffer") /* Traverse the path */ - while((name = H5G_component(name, &nchars)) && *name) { + while((name = H5G__component(name, &nchars)) && *name) { const char *s; /* Temporary string pointer */ htri_t lookup_status; /* Status from object lookup */ hbool_t obj_exists; /* Whether the object exists */ @@ -629,7 +582,7 @@ H5G_traverse_real(const H5G_loc_t *_loc, const char *name, unsigned target, } /* end if */ /* Check if this is the last component of the name */ - if(!((s = H5G_component(name + nchars, NULL)) && *s)) + if(!((s = H5G__component(name + nchars, NULL)) && *s)) last_comp = TRUE; /* If there's valid information in the link, reset it */ @@ -639,7 +592,7 @@ H5G_traverse_real(const H5G_loc_t *_loc, const char *name, unsigned target, } /* end if */ /* Get information for object in current group */ - if((lookup_status = H5G_obj_lookup(grp_loc.oloc, comp, &lnk/*out*/, dxpl_id)) < 0) + if((lookup_status = H5G__obj_lookup(grp_loc.oloc, comp, &lnk/*out*/, dxpl_id)) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "can't look up component") obj_exists = FALSE; @@ -651,7 +604,7 @@ H5G_traverse_real(const H5G_loc_t *_loc, const char *name, unsigned target, link_valid = TRUE; /* Build object location from the link */ - if(H5G_link_to_loc(&grp_loc, &lnk, &obj_loc) < 0) + if(H5G__link_to_loc(&grp_loc, &lnk, &obj_loc) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "cannot initialize object location") obj_loc_valid = TRUE; @@ -660,7 +613,7 @@ H5G_traverse_real(const H5G_loc_t *_loc, const char *name, unsigned target, /* Perform any special traversals that the link needs */ /* (soft links, user-defined links, file mounting, etc.) */ - if(H5G_traverse_special(&grp_loc, &lnk, target, nlinks, last_comp, &obj_loc, &obj_exists, lapl_id, dxpl_id) < 0) + if(H5G__traverse_special(&grp_loc, &lnk, target, nlinks, last_comp, &obj_loc, &obj_exists, lapl_id, dxpl_id) < 0) HGOTO_ERROR(H5E_LINK, H5E_TRAVERSE, FAIL, "special link traversal failed") } /* end if */ @@ -726,7 +679,7 @@ H5G_traverse_real(const H5G_loc_t *_loc, const char *name, unsigned target, /* Check for the parent group having a link info message */ /* (OK if not found) */ /* Get the link info for parent group */ - if((exists = H5G_obj_get_linfo(grp_loc.oloc, &par_linfo, dxpl_id)) < 0) + if((exists = H5G__obj_get_linfo(grp_loc.oloc, &par_linfo, dxpl_id)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to read object header") if(exists) { /* Only keep the creation order information from the parent @@ -762,11 +715,11 @@ H5G_traverse_real(const H5G_loc_t *_loc, const char *name, unsigned target, gcrt_info.gcpl_id = H5P_GROUP_CREATE_DEFAULT; gcrt_info.cache_type = H5G_NOTHING_CACHED; HDmemset(&gcrt_info.cache, 0, sizeof(gcrt_info.cache)); - if(H5G_obj_create_real(grp_oloc.file, dxpl_id, ginfo, linfo, pline, &gcrt_info, obj_loc.oloc/*out*/) < 0) + if(H5G__obj_create_real(grp_oloc.file, dxpl_id, ginfo, linfo, pline, &gcrt_info, obj_loc.oloc/*out*/) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create group entry") /* Insert new group into current group's symbol table */ - if(H5G_loc_insert(&grp_loc, comp, &obj_loc, H5O_TYPE_GROUP, &gcrt_info, dxpl_id) < 0) + if(H5G__loc_insert(&grp_loc, comp, &obj_loc, H5O_TYPE_GROUP, &gcrt_info, dxpl_id) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "unable to insert intermediate group") /* Decrement refcount on intermediate group's object header in memory */ @@ -786,13 +739,16 @@ H5G_traverse_real(const H5G_loc_t *_loc, const char *name, unsigned target, /* Reset any non-default object header messages */ if(ginfo != &def_ginfo) - if(H5O_msg_reset(H5O_GINFO_ID, ginfo) < 0) + /* (Casting away const OK - QAK) */ + if(H5O_msg_reset(H5O_GINFO_ID, (void *)ginfo) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "unable to reset group info message") if(linfo != &def_linfo) - if(H5O_msg_reset(H5O_LINFO_ID, linfo) < 0) + /* (Casting away const OK - QAK) */ + if(H5O_msg_reset(H5O_LINFO_ID, (void *)linfo) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "unable to reset link info message") if(pline != &def_pline) - if(H5O_msg_reset(H5O_PLINE_ID, pline) < 0) + /* (Casting away const OK - QAK) */ + if(H5O_msg_reset(H5O_PLINE_ID, (void *)pline) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "unable to reset I/O pipeline message") } /* end if */ else @@ -879,7 +835,7 @@ H5G_traverse(const H5G_loc_t *loc, const char *name, unsigned target, H5G_traver H5P_genplist_t *lapl; /* Property list with value for nlinks */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5G_traverse, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args */ if(!name || !*name) diff --git a/src/H5HF.c b/src/H5HF.c index 23e15c2..801fa8c 100644 --- a/src/H5HF.c +++ b/src/H5HF.c @@ -99,7 +99,7 @@ H5FL_DEFINE_STATIC(H5HF_t); herr_t H5HF_op_read(const void *obj, size_t obj_len, void *op_data) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_op_read) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Perform "read", using memcpy() */ HDmemcpy(op_data, obj, obj_len); @@ -124,7 +124,7 @@ H5HF_op_read(const void *obj, size_t obj_len, void *op_data) herr_t H5HF_op_write(const void *obj, size_t obj_len, void *op_data) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_op_write) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Perform "write", using memcpy() */ HDmemcpy((void *)obj, op_data, obj_len); /* Casting away const OK -QAK */ @@ -155,7 +155,7 @@ H5HF_create(H5F_t *f, hid_t dxpl_id, const H5HF_create_t *cparam) haddr_t fh_addr; /* Heap header address */ H5HF_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5HF_create, NULL) + FUNC_ENTER_NOAPI(NULL) #ifdef QAK HDfprintf(stderr, "%s: Called\n", FUNC); #endif /* QAK */ @@ -225,7 +225,7 @@ H5HF_open(H5F_t *f, hid_t dxpl_id, haddr_t fh_addr) H5HF_hdr_t *hdr = NULL; /* The fractal heap header information */ H5HF_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5HF_open, NULL) + FUNC_ENTER_NOAPI(NULL) /* * Check arguments. @@ -293,7 +293,7 @@ done: herr_t H5HF_get_id_len(H5HF_t *fh, size_t *id_len_p) { - FUNC_ENTER_NOAPI_NOFUNC(H5HF_get_id_len) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* * Check arguments. @@ -324,7 +324,7 @@ H5HF_get_id_len(H5HF_t *fh, size_t *id_len_p) herr_t H5HF_get_heap_addr(const H5HF_t *fh, haddr_t *heap_addr_p) { - FUNC_ENTER_NOAPI_NOFUNC(H5HF_get_heap_addr) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* * Check arguments. @@ -360,7 +360,8 @@ H5HF_insert(H5HF_t *fh, hid_t dxpl_id, size_t size, const void *obj, H5HF_hdr_t *hdr = NULL; /* The fractal heap header information */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI(H5HF_insert, FAIL) + FUNC_ENTER_NOAPI(FAIL) + #ifdef QAK HDfprintf(stderr, "%s: size = %Zu\n", FUNC, size); #endif /* QAK */ @@ -433,7 +434,7 @@ H5HF_get_obj_len(H5HF_t *fh, hid_t dxpl_id, const void *_id, size_t *obj_len_p) uint8_t id_flags; /* Heap ID flag bits */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5HF_get_obj_len, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* * Check arguments. @@ -501,7 +502,7 @@ H5HF_read(H5HF_t *fh, hid_t dxpl_id, const void *_id, void *obj/*out*/) uint8_t id_flags; /* Heap ID flag bits */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5HF_read, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* * Check arguments. @@ -579,7 +580,7 @@ H5HF_write(H5HF_t *fh, hid_t dxpl_id, void *_id, hbool_t UNUSED *id_changed, uint8_t id_flags; /* Heap ID flag bits */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5HF_write, FAIL) + FUNC_ENTER_NOAPI(FAIL) #ifdef QAK HDfprintf(stderr, "%s: Called\n", FUNC); #endif /* QAK */ @@ -654,7 +655,7 @@ H5HF_op(H5HF_t *fh, hid_t dxpl_id, const void *_id, H5HF_operator_t op, uint8_t id_flags; /* Heap ID flag bits */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5HF_op, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* * Check arguments. @@ -719,7 +720,7 @@ H5HF_remove(H5HF_t *fh, hid_t dxpl_id, const void *_id) uint8_t id_flags; /* Heap ID flag bits */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5HF_remove, FAIL) + FUNC_ENTER_NOAPI(FAIL) #ifdef QAK HDfprintf(stderr, "%s: Called\n", FUNC); #endif /* QAK */ @@ -787,7 +788,7 @@ H5HF_close(H5HF_t *fh, hid_t dxpl_id) haddr_t heap_addr = HADDR_UNDEF; /* Address of heap (for deletion) */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5HF_close, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* * Check arguments. @@ -891,7 +892,7 @@ H5HF_delete(H5F_t *f, hid_t dxpl_id, haddr_t fh_addr) H5HF_hdr_t *hdr = NULL; /* The fractal heap header information */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5HF_delete, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* * Check arguments. diff --git a/src/H5HFbtree2.c b/src/H5HFbtree2.c index bce58b7..023344c 100644 --- a/src/H5HFbtree2.c +++ b/src/H5HFbtree2.c @@ -211,7 +211,7 @@ H5HF_huge_bt2_crt_context(void *_f) H5HF_huge_bt2_ctx_t *ctx; /* Callback context structure */ void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_huge_bt2_crt_context) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(f); @@ -252,7 +252,7 @@ H5HF_huge_bt2_dst_context(void *_ctx) { H5HF_huge_bt2_ctx_t *ctx = (H5HF_huge_bt2_ctx_t *)_ctx; /* Callback context structure */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_huge_bt2_dst_context) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ HDassert(ctx); @@ -283,7 +283,7 @@ H5HF_huge_bt2_crt_dbg_context(H5F_t *f, hid_t UNUSED dxpl_id, haddr_t UNUSED add H5HF_huge_bt2_ctx_t *ctx; /* Callback context structure */ void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_huge_bt2_crt_dbg_context) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(f); @@ -321,7 +321,7 @@ done: herr_t H5HF_huge_bt2_indir_found(const void *nrecord, void *op_data) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_huge_bt2_indir_found) + FUNC_ENTER_NOAPI_NOINIT_NOERR #ifdef QAK HDfprintf(stderr, "%s: nrecord = {%a, %Hu, %Hu}\n", "H5HF_huge_bt2_indir_found", @@ -355,7 +355,7 @@ H5HF_huge_bt2_indir_remove(const void *nrecord, void *_udata) H5HF_huge_remove_ud1_t *udata = (H5HF_huge_remove_ud1_t *)_udata; /* User callback data */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_huge_bt2_indir_remove) + FUNC_ENTER_NOAPI_NOINIT /* Free the space in the file for the object being removed */ if(H5MF_xfree(udata->hdr->f, H5FD_MEM_FHEAP_HUGE_OBJ, udata->dxpl_id, ((const H5HF_huge_bt2_indir_rec_t *)nrecord)->addr, ((const H5HF_huge_bt2_indir_rec_t *)nrecord)->len) < 0) @@ -385,7 +385,7 @@ done: static herr_t H5HF_huge_bt2_indir_store(void *nrecord, const void *udata) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_huge_bt2_indir_store) + FUNC_ENTER_NOAPI_NOINIT_NOERR *(H5HF_huge_bt2_indir_rec_t *)nrecord = *(const H5HF_huge_bt2_indir_rec_t *)udata; @@ -410,7 +410,7 @@ H5HF_huge_bt2_indir_store(void *nrecord, const void *udata) static herr_t H5HF_huge_bt2_indir_compare(const void *_rec1, const void *_rec2) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_huge_bt2_indir_compare) + FUNC_ENTER_NOAPI_NOINIT_NOERR #ifdef QAK { @@ -444,7 +444,7 @@ H5HF_huge_bt2_indir_encode(uint8_t *raw, const void *_nrecord, void *_ctx) H5HF_huge_bt2_ctx_t *ctx = (H5HF_huge_bt2_ctx_t *)_ctx; /* Callback context structure */ const H5HF_huge_bt2_indir_rec_t *nrecord = (const H5HF_huge_bt2_indir_rec_t *)_nrecord; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_huge_bt2_indir_encode) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ HDassert(ctx); @@ -477,7 +477,7 @@ H5HF_huge_bt2_indir_decode(const uint8_t *raw, void *_nrecord, void *_ctx) H5HF_huge_bt2_ctx_t *ctx = (H5HF_huge_bt2_ctx_t *)_ctx; /* Callback context structure */ H5HF_huge_bt2_indir_rec_t *nrecord = (H5HF_huge_bt2_indir_rec_t *)_nrecord; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_huge_bt2_indir_decode) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ HDassert(ctx); @@ -511,7 +511,7 @@ H5HF_huge_bt2_indir_debug(FILE *stream, const H5F_t UNUSED *f, hid_t UNUSED dxpl { const H5HF_huge_bt2_indir_rec_t *nrecord = (const H5HF_huge_bt2_indir_rec_t *)_nrecord; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_huge_bt2_indir_debug) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDfprintf(stream, "%*s%-*s {%a, %Hu, %Hu}\n", indent, "", fwidth, "Record:", nrecord->addr, nrecord->len, nrecord->id); @@ -537,7 +537,7 @@ H5HF_huge_bt2_indir_debug(FILE *stream, const H5F_t UNUSED *f, hid_t UNUSED dxpl herr_t H5HF_huge_bt2_filt_indir_found(const void *nrecord, void *op_data) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_huge_bt2_filt_indir_found) + FUNC_ENTER_NOAPI_NOINIT_NOERR #ifdef QAK HDfprintf(stderr, "%s: nrecord = {%a, %Hu, %x, %Hu, %Hu}\n", "H5HF_huge_bt2_filt_indir_found", @@ -573,7 +573,7 @@ H5HF_huge_bt2_filt_indir_remove(const void *nrecord, void *_udata) H5HF_huge_remove_ud1_t *udata = (H5HF_huge_remove_ud1_t *)_udata; /* User callback data */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_huge_bt2_filt_indir_remove) + FUNC_ENTER_NOAPI_NOINIT /* Free the space in the file for the object being removed */ if(H5MF_xfree(udata->hdr->f, H5FD_MEM_FHEAP_HUGE_OBJ, udata->dxpl_id, ((const H5HF_huge_bt2_filt_indir_rec_t *)nrecord)->addr, ((const H5HF_huge_bt2_filt_indir_rec_t *)nrecord)->len) < 0) @@ -603,7 +603,7 @@ done: static herr_t H5HF_huge_bt2_filt_indir_store(void *nrecord, const void *udata) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_huge_bt2_filt_indir_store) + FUNC_ENTER_NOAPI_NOINIT_NOERR *(H5HF_huge_bt2_filt_indir_rec_t *)nrecord = *(const H5HF_huge_bt2_filt_indir_rec_t *)udata; @@ -628,7 +628,7 @@ H5HF_huge_bt2_filt_indir_store(void *nrecord, const void *udata) static herr_t H5HF_huge_bt2_filt_indir_compare(const void *_rec1, const void *_rec2) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_huge_bt2_filt_indir_compare) + FUNC_ENTER_NOAPI_NOINIT_NOERR #ifdef QAK { @@ -662,7 +662,7 @@ H5HF_huge_bt2_filt_indir_encode(uint8_t *raw, const void *_nrecord, void *_ctx) H5HF_huge_bt2_ctx_t *ctx = (H5HF_huge_bt2_ctx_t *)_ctx; /* Callback context structure */ const H5HF_huge_bt2_filt_indir_rec_t *nrecord = (const H5HF_huge_bt2_filt_indir_rec_t *)_nrecord; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_huge_bt2_filt_indir_encode) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ HDassert(ctx); @@ -697,7 +697,7 @@ H5HF_huge_bt2_filt_indir_decode(const uint8_t *raw, void *_nrecord, void *_ctx) H5HF_huge_bt2_ctx_t *ctx = (H5HF_huge_bt2_ctx_t *)_ctx; /* Callback context structure */ H5HF_huge_bt2_filt_indir_rec_t *nrecord = (H5HF_huge_bt2_filt_indir_rec_t *)_nrecord; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_huge_bt2_filt_indir_decode) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ HDassert(ctx); @@ -733,7 +733,7 @@ H5HF_huge_bt2_filt_indir_debug(FILE *stream, const H5F_t UNUSED *f, hid_t UNUSED { const H5HF_huge_bt2_filt_indir_rec_t *nrecord = (const H5HF_huge_bt2_filt_indir_rec_t *)_nrecord; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_huge_bt2_filt_indir_debug) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDfprintf(stream, "%*s%-*s {%a, %Hu, %x, %Hu, %Hu}\n", indent, "", fwidth, "Record:", nrecord->addr, nrecord->len, nrecord->filter_mask, nrecord->obj_size, nrecord->id); @@ -762,7 +762,7 @@ H5HF_huge_bt2_dir_remove(const void *nrecord, void *_udata) H5HF_huge_remove_ud1_t *udata = (H5HF_huge_remove_ud1_t *)_udata; /* User callback data */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_huge_bt2_dir_remove) + FUNC_ENTER_NOAPI_NOINIT /* Free the space in the file for the object being removed */ if(H5MF_xfree(udata->hdr->f, H5FD_MEM_FHEAP_HUGE_OBJ, udata->dxpl_id, ((const H5HF_huge_bt2_indir_rec_t *)nrecord)->addr, ((const H5HF_huge_bt2_indir_rec_t *)nrecord)->len) < 0) @@ -792,7 +792,7 @@ done: static herr_t H5HF_huge_bt2_dir_store(void *nrecord, const void *udata) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_huge_bt2_dir_store) + FUNC_ENTER_NOAPI_NOINIT_NOERR *(H5HF_huge_bt2_dir_rec_t *)nrecord = *(const H5HF_huge_bt2_dir_rec_t *)udata; @@ -821,7 +821,7 @@ H5HF_huge_bt2_dir_compare(const void *_rec1, const void *_rec2) const H5HF_huge_bt2_dir_rec_t *rec2 = (const H5HF_huge_bt2_dir_rec_t *)_rec2; herr_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_huge_bt2_dir_compare) + FUNC_ENTER_NOAPI_NOINIT_NOERR #ifdef QAK HDfprintf(stderr, "%s: rec1 = {%a, %Hu}\n", "H5HF_huge_bt2_dir_compare", rec1->addr, rec1->len); @@ -861,7 +861,7 @@ H5HF_huge_bt2_dir_encode(uint8_t *raw, const void *_nrecord, void *_ctx) H5HF_huge_bt2_ctx_t *ctx = (H5HF_huge_bt2_ctx_t *)_ctx; /* Callback context structure */ const H5HF_huge_bt2_dir_rec_t *nrecord = (const H5HF_huge_bt2_dir_rec_t *)_nrecord; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_huge_bt2_dir_encode) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ HDassert(ctx); @@ -893,7 +893,7 @@ H5HF_huge_bt2_dir_decode(const uint8_t *raw, void *_nrecord, void *_ctx) H5HF_huge_bt2_ctx_t *ctx = (H5HF_huge_bt2_ctx_t *)_ctx; /* Callback context structure */ H5HF_huge_bt2_dir_rec_t *nrecord = (H5HF_huge_bt2_dir_rec_t *)_nrecord; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_huge_bt2_dir_decode) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ HDassert(ctx); @@ -926,7 +926,7 @@ H5HF_huge_bt2_dir_debug(FILE *stream, const H5F_t UNUSED *f, hid_t UNUSED dxpl_i { const H5HF_huge_bt2_dir_rec_t *nrecord = (const H5HF_huge_bt2_dir_rec_t *)_nrecord; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_huge_bt2_dir_debug) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDfprintf(stream, "%*s%-*s {%a, %Hu}\n", indent, "", fwidth, "Record:", nrecord->addr, nrecord->len); @@ -952,7 +952,7 @@ H5HF_huge_bt2_dir_debug(FILE *stream, const H5F_t UNUSED *f, hid_t UNUSED dxpl_i herr_t H5HF_huge_bt2_filt_dir_found(const void *nrecord, void *op_data) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_huge_bt2_filt_dir_found) + FUNC_ENTER_NOAPI_NOINIT_NOERR #ifdef QAK HDfprintf(stderr, "%s: nrecord = {%a, %Hu, %x, %Hu}\n", "H5HF_huge_bt2_filt_dir_found", @@ -987,7 +987,7 @@ H5HF_huge_bt2_filt_dir_remove(const void *nrecord, void *_udata) H5HF_huge_remove_ud1_t *udata = (H5HF_huge_remove_ud1_t *)_udata; /* User callback data */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_huge_bt2_filt_dir_remove) + FUNC_ENTER_NOAPI_NOINIT /* Free the space in the file for the object being removed */ if(H5MF_xfree(udata->hdr->f, H5FD_MEM_FHEAP_HUGE_OBJ, udata->dxpl_id, ((const H5HF_huge_bt2_filt_dir_rec_t *)nrecord)->addr, ((const H5HF_huge_bt2_filt_dir_rec_t *)nrecord)->len) < 0) @@ -1017,7 +1017,7 @@ done: static herr_t H5HF_huge_bt2_filt_dir_store(void *nrecord, const void *udata) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_huge_bt2_filt_dir_store) + FUNC_ENTER_NOAPI_NOINIT_NOERR *(H5HF_huge_bt2_filt_dir_rec_t *)nrecord = *(const H5HF_huge_bt2_filt_dir_rec_t *)udata; @@ -1046,7 +1046,7 @@ H5HF_huge_bt2_filt_dir_compare(const void *_rec1, const void *_rec2) const H5HF_huge_bt2_filt_dir_rec_t *rec2 = (const H5HF_huge_bt2_filt_dir_rec_t *)_rec2; herr_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_huge_bt2_filt_dir_compare) + FUNC_ENTER_NOAPI_NOINIT_NOERR #ifdef QAK HDfprintf(stderr, "%s: rec1 = {%a, %Hu, %x, %Hu}\n", "H5HF_huge_bt2_filt_dir_compare", rec1->addr, rec1->len, rec1->filter_mask, rec1->obj_size); @@ -1086,7 +1086,7 @@ H5HF_huge_bt2_filt_dir_encode(uint8_t *raw, const void *_nrecord, void *_ctx) H5HF_huge_bt2_ctx_t *ctx = (H5HF_huge_bt2_ctx_t *)_ctx; /* Callback context structure */ const H5HF_huge_bt2_filt_dir_rec_t *nrecord = (const H5HF_huge_bt2_filt_dir_rec_t *)_nrecord; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_huge_bt2_filt_dir_encode) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ HDassert(ctx); @@ -1120,7 +1120,7 @@ H5HF_huge_bt2_filt_dir_decode(const uint8_t *raw, void *_nrecord, void *_ctx) H5HF_huge_bt2_ctx_t *ctx = (H5HF_huge_bt2_ctx_t *)_ctx; /* Callback context structure */ H5HF_huge_bt2_filt_dir_rec_t *nrecord = (H5HF_huge_bt2_filt_dir_rec_t *)_nrecord; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_huge_bt2_filt_dir_decode) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ HDassert(ctx); @@ -1154,7 +1154,7 @@ H5HF_huge_bt2_filt_dir_debug(FILE *stream, const H5F_t UNUSED *f, hid_t UNUSED d { const H5HF_huge_bt2_filt_dir_rec_t *nrecord = (const H5HF_huge_bt2_filt_dir_rec_t *)_nrecord; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_huge_bt2_filt_dir_debug) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDfprintf(stream, "%*s%-*s {%a, %Hu, %x, %Hu}\n", indent, "", fwidth, "Record:", nrecord->addr, nrecord->len, nrecord->filter_mask, nrecord->obj_size); diff --git a/src/H5HFcache.c b/src/H5HFcache.c index f8829f2..ddff0e0 100644 --- a/src/H5HFcache.c +++ b/src/H5HFcache.c @@ -166,7 +166,7 @@ H5FL_BLK_DEFINE(direct_block); static herr_t H5HF_dtable_decode(H5F_t *f, const uint8_t **pp, H5HF_dtable_t *dtable) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_dtable_decode) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments */ HDassert(f); @@ -216,7 +216,7 @@ H5HF_dtable_decode(H5F_t *f, const uint8_t **pp, H5HF_dtable_t *dtable) static herr_t H5HF_dtable_encode(H5F_t *f, uint8_t **pp, const H5HF_dtable_t *dtable) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_dtable_encode) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments */ HDassert(f); @@ -277,7 +277,7 @@ H5HF_cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) uint8_t heap_flags; /* Status flags for heap */ H5HF_hdr_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_cache_hdr_load) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments */ HDassert(f); @@ -457,7 +457,7 @@ H5HF_cache_hdr_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5H uint8_t hdr_buf[H5HF_HDR_BUF_SIZE]; /* Buffer for header */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_cache_hdr_flush) + FUNC_ENTER_NOAPI_NOINIT /* check arguments */ HDassert(f); @@ -589,7 +589,7 @@ H5HF_cache_hdr_dest(H5F_t *f, H5HF_hdr_t *hdr) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_cache_hdr_dest) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -635,7 +635,7 @@ H5HF_cache_hdr_clear(H5F_t *f, H5HF_hdr_t *hdr, hbool_t destroy) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_cache_hdr_clear) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -672,7 +672,7 @@ done: static herr_t H5HF_cache_hdr_size(const H5F_t UNUSED *f, const H5HF_hdr_t *hdr, size_t *size_ptr) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_cache_hdr_size) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments */ HDassert(f); @@ -717,7 +717,7 @@ H5HF_cache_iblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) unsigned u; /* Local index variable */ H5HF_indirect_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_cache_iblock_load) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments */ HDassert(f); @@ -909,7 +909,7 @@ H5HF_cache_iblock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, uint8_t iblock_buf[H5HF_IBLOCK_BUF_SIZE]; /* Buffer for indirect block */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_cache_iblock_flush) + FUNC_ENTER_NOAPI_NOINIT /* check arguments */ HDassert(f); @@ -1094,7 +1094,7 @@ H5HF_cache_iblock_dest(H5F_t *f, H5HF_indirect_t *iblock) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_cache_iblock_dest) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -1145,7 +1145,7 @@ H5HF_cache_iblock_clear(H5F_t *f, H5HF_indirect_t *iblock, hbool_t destroy) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_cache_iblock_clear) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -1182,7 +1182,7 @@ done: static herr_t H5HF_cache_iblock_size(const H5F_t UNUSED *f, const H5HF_indirect_t *iblock, size_t *size_ptr) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_cache_iblock_size) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments */ HDassert(iblock); @@ -1221,7 +1221,7 @@ H5HF_cache_dblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) haddr_t heap_addr; /* Address of heap header in the file */ H5HF_direct_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_cache_dblock_load) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments */ HDassert(f); @@ -1391,7 +1391,7 @@ H5HF_cache_dblock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_cache_dblock_flush) + FUNC_ENTER_NOAPI_NOINIT /* check arguments */ HDassert(f); @@ -1664,7 +1664,7 @@ H5HF_cache_dblock_dest(H5F_t *f, H5HF_direct_t *dblock) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_cache_dblock_dest) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -1716,7 +1716,7 @@ H5HF_cache_dblock_clear(H5F_t *f, H5HF_direct_t *dblock, hbool_t destroy) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_cache_dblock_clear) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -1753,7 +1753,7 @@ done: static herr_t H5HF_cache_dblock_size(const H5F_t UNUSED *f, const H5HF_direct_t *dblock, size_t *size_ptr) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_cache_dblock_size) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check arguments */ HDassert(dblock); diff --git a/src/H5HFdbg.c b/src/H5HFdbg.c index 68b30d9..4289c02 100644 --- a/src/H5HFdbg.c +++ b/src/H5HFdbg.c @@ -115,7 +115,7 @@ static herr_t H5HF_dtable_debug(H5HF_dtable_t *dtable, FILE *stream, static herr_t H5HF_dtable_debug(H5HF_dtable_t *dtable, FILE *stream, int indent, int fwidth) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_dtable_debug) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* * Check arguments. @@ -190,7 +190,7 @@ H5HF_hdr_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, H5HF_hdr_t *hdr = NULL; /* Fractal heap header info */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5HF_hdr_debug, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* * Check arguments. @@ -310,7 +310,7 @@ H5HF_dblock_debug_cb(const H5FS_section_info_t *_sect, void *_udata) haddr_t sect_start, sect_end; /* Section's beginning and ending offsets */ haddr_t dblock_start, dblock_end; /* Direct block's beginning and ending offsets */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_dblock_debug_cb) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* * Check arguments. @@ -397,7 +397,7 @@ H5HF_dblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, uint8_t *marker = NULL; /* Track free space for block */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5HF_dblock_debug, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* * Check arguments. @@ -524,7 +524,7 @@ H5HF_iblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, size_t u, v; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5HF_iblock_debug, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* * Check arguments. @@ -653,7 +653,7 @@ H5HF_sects_debug_cb(const H5FS_section_info_t *_sect, void *_udata) H5HF_debug_iter_ud2_t *udata = (H5HF_debug_iter_ud2_t *)_udata; /* User data for callbacks */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_sects_debug_cb) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -708,7 +708,7 @@ H5HF_sects_debug(H5F_t *f, hid_t dxpl_id, haddr_t fh_addr, H5HF_hdr_t *hdr = NULL; /* Fractal heap header info */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5HF_sects_debug, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* * Check arguments. diff --git a/src/H5HFdblock.c b/src/H5HFdblock.c index 5cd035a..afc7f25 100644 --- a/src/H5HFdblock.c +++ b/src/H5HFdblock.c @@ -102,7 +102,7 @@ H5HF_man_dblock_create(hid_t dxpl_id, H5HF_hdr_t *hdr, H5HF_indirect_t *par_iblo size_t free_space; /* Free space in new block */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_man_dblock_create) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -228,7 +228,7 @@ H5HF_man_dblock_destroy(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_direct_t *dblock, unsigned cache_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting indirect block */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_man_dblock_destroy) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -342,7 +342,7 @@ H5HF_man_dblock_new(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t request, size_t min_dblock_size; /* Min. size of direct block to allocate */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_man_dblock_new) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -441,7 +441,7 @@ H5HF_man_dblock_protect(H5HF_hdr_t *hdr, hid_t dxpl_id, haddr_t dblock_addr, H5HF_dblock_cache_ud_t udata; /* parent and other infor for deserializing direct block */ H5HF_direct_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_man_dblock_protect) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -520,7 +520,7 @@ H5HF_man_dblock_locate(H5HF_hdr_t *hdr, hid_t dxpl_id, hsize_t obj_off, unsigned entry; /* Entry of block */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_man_dblock_locate) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -621,7 +621,7 @@ H5HF_man_dblock_delete(H5F_t *f, hid_t dxpl_id, haddr_t dblock_addr, unsigned dblock_status = 0; /* Direct block's status in the metadata cache */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_man_dblock_delete) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -688,7 +688,7 @@ H5HF_man_dblock_dest(H5HF_direct_t *dblock) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_man_dblock_dest) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. diff --git a/src/H5HFdtable.c b/src/H5HFdtable.c index 29af47f..a7d95bc 100644 --- a/src/H5HFdtable.c +++ b/src/H5HFdtable.c @@ -96,7 +96,7 @@ H5HF_dtable_init(H5HF_dtable_t *dtable) size_t u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_dtable_init) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -153,7 +153,7 @@ done: herr_t H5HF_dtable_lookup(const H5HF_dtable_t *dtable, hsize_t off, unsigned *row, unsigned *col) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_dtable_lookup) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* * Check arguments. @@ -201,7 +201,7 @@ HDfprintf(stderr, "%s: high_bit = %u, off_mask = %Hu\n", "H5HF_dtable_lookup", h herr_t H5HF_dtable_dest(H5HF_dtable_t *dtable) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_dtable_dest) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* * Check arguments. @@ -242,7 +242,7 @@ H5HF_dtable_size_to_row(const H5HF_dtable_t *dtable, size_t block_size) { unsigned row; /* Row where block will fit */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_dtable_size_to_row) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* * Check arguments. @@ -276,7 +276,7 @@ H5HF_dtable_size_to_rows(const H5HF_dtable_t *dtable, hsize_t size) { unsigned rows; /* # of rows required for indirect block */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_dtable_size_to_rows) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* * Check arguments. @@ -312,7 +312,7 @@ H5HF_dtable_span_size(const H5HF_dtable_t *dtable, unsigned start_row, unsigned end_entry; /* Entry for last block covered */ hsize_t acc_span_size; /* Accumulated span size */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_dtable_span_size) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* * Check arguments. diff --git a/src/H5HFhdr.c b/src/H5HFhdr.c index 684c171..e4b89ba 100644 --- a/src/H5HFhdr.c +++ b/src/H5HFhdr.c @@ -112,7 +112,7 @@ H5HF_hdr_alloc(H5F_t *f) H5HF_hdr_t *hdr = NULL; /* Shared fractal heap header */ H5HF_hdr_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_hdr_alloc) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -160,7 +160,7 @@ H5HF_hdr_compute_free_space(H5HF_hdr_t *hdr, unsigned iblock_row) unsigned curr_row; /* Current row in block */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_hdr_compute_free_space) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* * Check arguments. @@ -210,7 +210,7 @@ H5HF_hdr_finish_init_phase1(H5HF_hdr_t *hdr) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_hdr_finish_init_phase1) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -250,7 +250,7 @@ H5HF_hdr_finish_init_phase2(H5HF_hdr_t *hdr) unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_hdr_finish_init_phase2) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -304,7 +304,7 @@ H5HF_hdr_finish_init(H5HF_hdr_t *hdr) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_hdr_finish_init) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -344,7 +344,7 @@ H5HF_hdr_create(H5F_t *f, hid_t dxpl_id, const H5HF_create_t *cparam) size_t dblock_overhead; /* Direct block's overhead */ haddr_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_hdr_create) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -535,7 +535,7 @@ H5HF_hdr_protect(H5F_t *f, hid_t dxpl_id, haddr_t addr, H5AC_protect_t rw) H5HF_hdr_t *hdr; /* Fractal heap header */ H5HF_hdr_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_hdr_protect) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments */ HDassert(f); @@ -581,7 +581,7 @@ H5HF_hdr_incr(H5HF_hdr_t *hdr) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_hdr_incr) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(hdr); @@ -617,7 +617,7 @@ H5HF_hdr_decr(H5HF_hdr_t *hdr) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_hdr_decr) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(hdr); @@ -654,7 +654,7 @@ done: herr_t H5HF_hdr_fuse_incr(H5HF_hdr_t *hdr) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_hdr_fuse_incr) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ HDassert(hdr); @@ -682,7 +682,7 @@ H5HF_hdr_fuse_incr(H5HF_hdr_t *hdr) size_t H5HF_hdr_fuse_decr(H5HF_hdr_t *hdr) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_hdr_fuse_decr) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ HDassert(hdr); @@ -713,7 +713,7 @@ H5HF_hdr_dirty(H5HF_hdr_t *hdr) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_hdr_dirty) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(hdr); @@ -751,7 +751,7 @@ H5HF_hdr_adj_free(H5HF_hdr_t *hdr, ssize_t amt) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_hdr_adj_free) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -789,7 +789,7 @@ H5HF_hdr_adjust_heap(H5HF_hdr_t *hdr, hsize_t new_size, hssize_t extra_free) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_hdr_adjust_heap) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -827,7 +827,7 @@ done: herr_t H5HF_hdr_inc_alloc(H5HF_hdr_t *hdr, size_t alloc_size) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_hdr_inc_alloc) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* * Check arguments. @@ -860,7 +860,7 @@ H5HF_hdr_start_iter(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, hsize_t curr_off, { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_hdr_start_iter) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -898,7 +898,7 @@ H5HF_hdr_reset_iter(H5HF_hdr_t *hdr, hsize_t curr_off) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_hdr_reset_iter) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -938,7 +938,7 @@ H5HF_hdr_skip_blocks(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_indirect_t *iblock, hsize_t sect_size; /* Size of section in heap space */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_hdr_skip_blocks) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -987,7 +987,7 @@ H5HF_hdr_update_iter(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t min_dblock_size) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_hdr_update_iter) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -1166,7 +1166,7 @@ H5HF_hdr_inc_iter(H5HF_hdr_t *hdr, hsize_t adv_size, unsigned nentries) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_hdr_inc_iter) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -1210,7 +1210,7 @@ H5HF_hdr_reverse_iter(H5HF_hdr_t *hdr, hid_t dxpl_id, haddr_t dblock_addr) hbool_t walked_up; /* Loop flag */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_hdr_reverse_iter) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -1351,7 +1351,7 @@ H5HF_hdr_empty(H5HF_hdr_t *hdr) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_hdr_empty) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(hdr); @@ -1399,7 +1399,7 @@ H5HF_hdr_free(H5HF_hdr_t *hdr) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_hdr_free) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -1442,7 +1442,7 @@ H5HF_hdr_delete(H5HF_hdr_t *hdr, hid_t dxpl_id) unsigned cache_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting heap header */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5HF_hdr_delete, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* * Check arguments. diff --git a/src/H5HFhuge.c b/src/H5HFhuge.c index 7577583..3bbd137 100644 --- a/src/H5HFhuge.c +++ b/src/H5HFhuge.c @@ -108,7 +108,7 @@ H5HF_huge_bt2_create(H5HF_hdr_t *hdr, hid_t dxpl_id) H5B2_create_t bt2_cparam; /* v2 B-tree creation parameters */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_huge_bt2_create) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -185,7 +185,7 @@ done: herr_t H5HF_huge_init(H5HF_hdr_t *hdr) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_huge_init) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* * Check arguments. @@ -263,7 +263,7 @@ H5HF_huge_new_id(H5HF_hdr_t *hdr) hsize_t new_id; /* New object's ID */ hsize_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_huge_new_id) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -316,7 +316,7 @@ H5HF_huge_insert(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t obj_size, void *obj, unsigned filter_mask = 0; /* Filter mask for object (only used for filtered objects) */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_huge_insert) + FUNC_ENTER_NOAPI_NOINIT #ifdef QAK HDfprintf(stderr, "%s: obj_size = %Zu\n", FUNC, obj_size); #endif /* QAK */ @@ -511,7 +511,7 @@ H5HF_huge_get_obj_len(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_huge_get_obj_len) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -607,7 +607,7 @@ H5HF_huge_op_real(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, unsigned filter_mask = 0; /* Filter mask for object (only used for filtered objects) */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_huge_op_real) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -752,7 +752,7 @@ H5HF_huge_write(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, size_t obj_size; /* Object's size in the file */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_huge_write) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -828,7 +828,7 @@ H5HF_huge_read(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, void *obj) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_huge_read) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -865,7 +865,7 @@ H5HF_huge_op(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_huge_op) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -902,7 +902,7 @@ H5HF_huge_remove(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id) H5HF_huge_remove_ud1_t udata; /* User callback data for v2 B-tree remove call */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_huge_remove) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -1010,7 +1010,7 @@ H5HF_huge_term(H5HF_hdr_t *hdr, hid_t dxpl_id) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_huge_term) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -1076,7 +1076,7 @@ H5HF_huge_delete(H5HF_hdr_t *hdr, hid_t dxpl_id) H5B2_remove_t op; /* Callback for v2 B-tree removal */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_huge_delete) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. diff --git a/src/H5HFiblock.c b/src/H5HFiblock.c index 6fbb0c2..6c19b4f 100644 --- a/src/H5HFiblock.c +++ b/src/H5HFiblock.c @@ -110,7 +110,7 @@ H5HF_iblock_pin(H5HF_indirect_t *iblock) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_iblock_pin) + FUNC_ENTER_NOAPI_NOINIT /* Sanity checks */ HDassert(iblock); @@ -168,7 +168,7 @@ H5HF_iblock_unpin(H5HF_indirect_t *iblock) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_iblock_unpin) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(iblock); @@ -226,7 +226,7 @@ H5HF_iblock_incr(H5HF_indirect_t *iblock) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_iblock_incr) + FUNC_ENTER_NOAPI_NOINIT /* Sanity checks */ HDassert(iblock); @@ -263,7 +263,7 @@ H5HF_iblock_decr(H5HF_indirect_t *iblock) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_iblock_decr) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(iblock); @@ -326,7 +326,7 @@ H5HF_iblock_dirty(H5HF_indirect_t *iblock) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_iblock_dirty) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(iblock); @@ -365,7 +365,7 @@ H5HF_man_iblock_root_create(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t min_dblock_si unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_man_iblock_root_create) + FUNC_ENTER_NOAPI_NOINIT /* Check for allocating entire root indirect block initially */ if(hdr->man_dtable.cparam.start_root_rows == 0) @@ -500,7 +500,7 @@ H5HF_man_iblock_root_double(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t min_dblock_si size_t u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_man_iblock_root_double) + FUNC_ENTER_NOAPI_NOINIT /* Get "new block" iterator information */ if(H5HF_man_iter_curr(&hdr->next_block, &next_row, NULL, &next_entry, &iblock) < 0) @@ -682,7 +682,7 @@ H5HF_man_iblock_root_halve(H5HF_indirect_t *iblock, hid_t dxpl_id) unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_man_iblock_root_halve) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(iblock); @@ -816,7 +816,7 @@ H5HF_man_iblock_root_revert(H5HF_indirect_t *root_iblock, hid_t dxpl_id) size_t dblock_size; /* Direct block's size */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_man_iblock_root_revert) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -892,7 +892,7 @@ H5HF_man_iblock_alloc_row(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t ** hbool_t iblock_held = FALSE; /* Flag to indicate that indirect block is held */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_man_iblock_alloc_row) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -956,7 +956,7 @@ H5HF_man_iblock_create(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_indirect_t *par_iblo size_t u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_man_iblock_create) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -1092,7 +1092,7 @@ H5HF_man_iblock_protect(H5HF_hdr_t *hdr, hid_t dxpl_id, haddr_t iblock_addr, hbool_t should_protect = FALSE; /* Whether we should protect the indirect block or not */ H5HF_indirect_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_man_iblock_protect) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -1192,7 +1192,7 @@ H5HF_man_iblock_unprotect(H5HF_indirect_t *iblock, hid_t dxpl_id, { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_man_iblock_unprotect) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -1230,7 +1230,7 @@ H5HF_man_iblock_attach(H5HF_indirect_t *iblock, unsigned entry, haddr_t child_ad { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_man_iblock_attach) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -1295,7 +1295,7 @@ H5HF_man_iblock_detach(H5HF_indirect_t *iblock, hid_t dxpl_id, unsigned entry) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_man_iblock_detach) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -1396,7 +1396,7 @@ done: herr_t H5HF_man_iblock_entry_addr(H5HF_indirect_t *iblock, unsigned entry, haddr_t *child_addr) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_man_iblock_entry_addr) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* * Check arguments. @@ -1439,7 +1439,7 @@ H5HF_man_iblock_delete(H5HF_hdr_t *hdr, hid_t dxpl_id, haddr_t iblock_addr, hbool_t did_protect; /* Whether we protected the indirect block or not */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_man_iblock_delete) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -1539,7 +1539,7 @@ H5HF_man_iblock_size(H5F_t *f, hid_t dxpl_id, H5HF_hdr_t *hdr, haddr_t iblock_ad hbool_t did_protect; /* Whether we protected the indirect block or not */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5HF_man_iblock_size, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* * Check arguments. @@ -1606,7 +1606,7 @@ H5HF_man_iblock_dest(H5HF_indirect_t *iblock) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_man_iblock_dest) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. diff --git a/src/H5HFiter.c b/src/H5HFiter.c index f7178a1..0f2f7a4 100644 --- a/src/H5HFiter.c +++ b/src/H5HFiter.c @@ -95,7 +95,7 @@ H5FL_DEFINE(H5HF_block_loc_t); herr_t H5HF_man_iter_init(H5HF_block_iter_t *biter) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_man_iter_init) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* * Check arguments. @@ -138,7 +138,7 @@ H5HF_man_iter_start_offset(H5HF_hdr_t *hdr, hid_t dxpl_id, hbool_t root_block = TRUE; /* Flag to indicate the current block is the root indirect block */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_man_iter_start_offset) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -281,7 +281,7 @@ done: herr_t H5HF_man_iter_set_entry(const H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, unsigned entry) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_man_iter_set_entry) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* * Check arguments. @@ -318,7 +318,7 @@ H5HF_man_iter_start_entry(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, H5HF_block_loc_t *new_loc = NULL; /* Pointer to new block location */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_man_iter_start_entry) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -376,7 +376,7 @@ H5HF_man_iter_reset(H5HF_block_iter_t *biter) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_man_iter_reset) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -434,7 +434,7 @@ done: herr_t H5HF_man_iter_next(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, unsigned nentries) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_man_iter_next) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* * Check arguments. @@ -473,7 +473,7 @@ H5HF_man_iter_up(H5HF_block_iter_t *biter) H5HF_block_loc_t *up_loc; /* Pointer to 'up' block location */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_man_iter_up) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -521,7 +521,7 @@ H5HF_man_iter_down(H5HF_block_iter_t *biter, H5HF_indirect_t *iblock) H5HF_block_loc_t *down_loc = NULL; /* Pointer to new 'down' block location */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_man_iter_down) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -574,7 +574,7 @@ herr_t H5HF_man_iter_curr(H5HF_block_iter_t *biter, unsigned *row, unsigned *col, unsigned *entry, H5HF_indirect_t **block) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_man_iter_curr) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* * Check arguments. @@ -614,7 +614,7 @@ H5HF_man_iter_offset(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, hsize_t *offset) { hsize_t curr_offset; /* For computing offset in heap */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_man_iter_offset) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* * Check arguments. @@ -652,7 +652,7 @@ H5HF_man_iter_offset(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, hsize_t *offset) hbool_t H5HF_man_iter_ready(H5HF_block_iter_t *biter) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_man_iter_ready) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* * Check arguments. diff --git a/src/H5HFman.c b/src/H5HFman.c index b1fb322..62f5580 100644 --- a/src/H5HFman.c +++ b/src/H5HFman.c @@ -116,7 +116,7 @@ H5HF_man_insert(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t obj_size, const void *obj htri_t node_found; /* Whether an existing free list node was found */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_man_insert) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -246,7 +246,7 @@ H5HF_man_op_real(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, uint8_t *p; /* Temporary pointer to obj info in block */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_man_op_real) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -379,7 +379,7 @@ H5HF_man_read(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, void *obj) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_man_read) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -416,7 +416,7 @@ H5HF_man_write(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_man_write) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -454,7 +454,7 @@ H5HF_man_op(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_man_op) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -499,7 +499,7 @@ H5HF_man_remove(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id) size_t blk_off; /* Offset of object in block */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_man_remove) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. diff --git a/src/H5HFsection.c b/src/H5HFsection.c index e41f46d..38d9381 100644 --- a/src/H5HFsection.c +++ b/src/H5HFsection.c @@ -327,7 +327,7 @@ H5HF_sect_init_cls(H5FS_section_class_t *cls, H5HF_hdr_t *hdr) H5HF_sect_private_t *cls_prvt; /* Pointer to class private info */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_sect_init_cls) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments. */ HDassert(cls); @@ -369,7 +369,7 @@ H5HF_sect_term_cls(H5FS_section_class_t *cls) H5HF_sect_private_t *cls_prvt; /* Pointer to class private info */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_sect_term_cls) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments. */ HDassert(cls); @@ -410,7 +410,7 @@ H5HF_sect_node_new(unsigned sect_type, haddr_t sect_addr, hsize_t sect_size, H5HF_free_section_t *new_sect; /* New section */ H5HF_free_section_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_sect_node_new) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments. */ HDassert(H5F_addr_defined(sect_addr)); @@ -454,7 +454,7 @@ H5HF_sect_node_free(H5HF_free_section_t *sect, H5HF_indirect_t *iblock) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_sect_node_free) + FUNC_ENTER_NOAPI_NOINIT HDassert(sect); @@ -491,7 +491,7 @@ H5HF_sect_single_new(hsize_t sect_off, size_t sect_size, H5HF_free_section_t *sect = NULL; /* 'Single' free space section to add */ H5HF_free_section_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_sect_single_new) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -545,7 +545,7 @@ H5HF_sect_single_locate_parent(H5HF_hdr_t *hdr, hid_t dxpl_id, hbool_t refresh, hbool_t did_protect; /* Whether we protected the indirect block or not */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_sect_single_locate_parent) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -604,7 +604,7 @@ H5HF_sect_single_revive(H5HF_hdr_t *hdr, hid_t dxpl_id, { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_sect_single_revive) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -653,7 +653,7 @@ H5HF_sect_single_dblock_info(H5HF_hdr_t *hdr, hid_t dxpl_id, { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5HF_sect_single_dblock_info, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* * Check arguments. @@ -740,7 +740,7 @@ H5HF_sect_single_reduce(H5HF_hdr_t *hdr, hid_t dxpl_id, { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_sect_single_reduce) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -797,7 +797,7 @@ H5HF_sect_single_full_dblock(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t dblock_overhead; /* Direct block's overhead */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_sect_single_full_dblock) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments. */ HDassert(sect); @@ -853,7 +853,7 @@ H5HF_sect_single_add(H5FS_section_info_t *_sect, unsigned *flags, void *_udata) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_sect_single_add) + FUNC_ENTER_NOAPI_NOINIT /* Don't need to check section if we are deserializing, because it should * have already been checked when it was first added @@ -907,7 +907,7 @@ H5HF_sect_single_deserialize(const H5FS_section_class_t UNUSED *cls, H5HF_free_section_t *new_sect; /* New section */ H5FS_section_info_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_sect_single_deserialize) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments. */ HDassert(H5F_addr_defined(sect_addr)); @@ -949,7 +949,7 @@ H5HF_sect_single_can_merge(const H5FS_section_info_t *_sect1, const H5HF_free_section_t *sect2 = (const H5HF_free_section_t *)_sect2; /* Fractal heap free section */ htri_t ret_value = FALSE; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_sect_single_can_merge) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments. */ HDassert(sect1); @@ -997,7 +997,7 @@ H5HF_sect_single_merge(H5FS_section_info_t *_sect1, H5FS_section_info_t *_sect2, hid_t dxpl_id = udata->dxpl_id; /* DXPL ID for operation */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_sect_single_merge) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments. */ HDassert(sect1); @@ -1054,7 +1054,7 @@ H5HF_sect_single_can_shrink(const H5FS_section_info_t *_sect, void *_udata) H5HF_hdr_t *hdr = udata->hdr; /* Fractal heap header */ htri_t ret_value = FALSE; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_sect_single_can_shrink) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments. */ HDassert(sect); @@ -1113,7 +1113,7 @@ H5HF_sect_single_shrink(H5FS_section_info_t **_sect, void UNUSED *_udata) size_t dblock_size; /* Section's direct block's size */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_sect_single_shrink) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments. */ HDassert(sect); @@ -1175,7 +1175,7 @@ H5HF_sect_single_free(H5FS_section_info_t *_sect) H5HF_indirect_t *parent = NULL; /* Parent indirect block for section */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_sect_single_free) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments. */ HDassert(sect); @@ -1214,7 +1214,7 @@ H5HF_sect_single_valid(const H5FS_section_class_t UNUSED *cls, const H5FS_sectio { const H5HF_free_section_t *sect = (const H5HF_free_section_t *)_sect; /* Pointer to section to check */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_sect_single_valid) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments. */ HDassert(sect); @@ -1302,7 +1302,7 @@ H5HF_sect_row_create(haddr_t sect_off, hsize_t sect_size, hbool_t is_first, H5HF_free_section_t *sect = NULL; /* 'Row' section created */ H5HF_free_section_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_sect_row_create) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments. */ HDassert(sect_size); @@ -1348,7 +1348,7 @@ H5HF_sect_row_from_single(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_sect_row_from_single) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -1396,7 +1396,7 @@ H5HF_sect_row_revive(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t *sect) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_sect_row_revive) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -1438,7 +1438,7 @@ H5HF_sect_row_reduce(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t *sect, hbool_t alloc_from_start; /* Whether to allocate from the end of the row */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_sect_row_reduce) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -1512,7 +1512,7 @@ H5HF_sect_row_first(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t *sect) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_sect_row_first) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(hdr); @@ -1554,7 +1554,7 @@ H5HF_sect_row_get_iblock(H5HF_free_section_t *sect) { H5HF_indirect_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_sect_row_get_iblock) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* * Check arguments. @@ -1593,7 +1593,7 @@ H5HF_sect_row_init_cls(H5FS_section_class_t *cls, void *_udata) H5HF_hdr_t *hdr = (H5HF_hdr_t *)_udata; /* Fractal heap header */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_sect_row_init_cls) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments. */ HDassert(cls); @@ -1636,7 +1636,7 @@ H5HF_sect_row_term_cls(H5FS_section_class_t *cls) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_sect_row_term_cls) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments. */ HDassert(cls); @@ -1672,7 +1672,7 @@ H5HF_sect_row_serialize(const H5FS_section_class_t *cls, const H5HF_free_section_t *sect = (const H5HF_free_section_t *)_sect; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_sect_row_serialize) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments. */ HDassert(cls); @@ -1716,7 +1716,7 @@ H5HF_sect_row_deserialize(const H5FS_section_class_t *cls, hid_t dxpl_id, H5HF_hdr_t *hdr; /* Fractal heap header */ H5FS_section_info_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_sect_row_deserialize) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments. */ HDassert(cls); @@ -1760,7 +1760,7 @@ H5HF_sect_row_can_merge(const H5FS_section_info_t *_sect1, H5HF_free_section_t *top_indir_sect1, *top_indir_sect2; /* Top indirect section for each row */ htri_t ret_value = FALSE; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_sect_row_can_merge) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments. */ HDassert(sect1); @@ -1819,7 +1819,7 @@ H5HF_sect_row_merge(H5FS_section_info_t *_sect1, H5FS_section_info_t *_sect2, hid_t dxpl_id = udata->dxpl_id; /* DXPL ID for operation */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_sect_row_merge) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments. */ HDassert(sect1); @@ -1885,7 +1885,7 @@ H5HF_sect_row_can_shrink(const H5FS_section_info_t *_sect, void UNUSED *_udata) H5HF_hdr_t *hdr = udata->hdr; /* Fractal heap header */ htri_t ret_value = FALSE; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_sect_row_can_shrink) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments. */ HDassert(sect); @@ -1924,7 +1924,7 @@ H5HF_sect_row_shrink(H5FS_section_info_t **_sect, void *_udata) hid_t dxpl_id = udata->dxpl_id; /* DXPL ID for operation */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_sect_row_shrink) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments. */ HDassert(sect); @@ -1965,7 +1965,7 @@ H5HF_sect_row_free_real(H5HF_free_section_t *sect) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_sect_row_free_real) + FUNC_ENTER_NOAPI_NOINIT HDassert(sect); @@ -1998,7 +1998,7 @@ H5HF_sect_row_free(H5FS_section_info_t *_sect) H5HF_free_section_t *sect = (H5HF_free_section_t *)_sect; /* Pointer to section to free */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_sect_row_free) + FUNC_ENTER_NOAPI_NOINIT HDassert(sect); HDassert(sect->u.row.under); @@ -2038,7 +2038,7 @@ H5HF_sect_row_valid(const H5FS_section_class_t *cls, const H5FS_section_info_t * const H5HF_free_section_t *indir_sect; /* Pointer to underlying indirect section */ unsigned indir_idx; /* Index of row in underlying indirect section's row array */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_sect_row_valid) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Basic sanity check */ HDassert(cls); @@ -2096,7 +2096,7 @@ H5HF_sect_row_debug(const H5FS_section_info_t *_sect, { const H5HF_free_section_t *sect = (const H5HF_free_section_t *)_sect; /* Section to dump info */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_sect_row_debug) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments. */ HDassert(sect); @@ -2143,7 +2143,7 @@ H5HF_sect_indirect_iblock_off(const H5HF_free_section_t *sect) { hsize_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_sect_indirect_iblock_off) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* * Check arguments. @@ -2174,7 +2174,7 @@ H5HF_sect_indirect_top(H5HF_free_section_t *sect) { H5HF_free_section_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_sect_indirect_top) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* * Check arguments. @@ -2210,7 +2210,7 @@ H5HF_sect_indirect_init_cls(H5FS_section_class_t *cls, void *_udata) H5HF_hdr_t *hdr = (H5HF_hdr_t *)_udata; /* Fractal heap header */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_sect_indirect_init_cls) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments. */ HDassert(cls); @@ -2247,7 +2247,7 @@ H5HF_sect_indirect_term_cls(H5FS_section_class_t *cls) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_sect_indirect_term_cls) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments. */ HDassert(cls); @@ -2283,7 +2283,7 @@ H5HF_sect_indirect_new(H5HF_hdr_t *hdr, haddr_t sect_off, hsize_t sect_size, H5HF_free_section_t *sect = NULL; /* 'Indirect' free space section to add */ H5HF_free_section_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_sect_indirect_new) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -2354,7 +2354,7 @@ H5HF_sect_indirect_for_row(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, H5HF_free_section_t *sect = NULL; /* 'Indirect' free space section to add */ H5HF_free_section_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_sect_indirect_for_row) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -2428,7 +2428,7 @@ H5HF_sect_indirect_init_rows(H5HF_hdr_t *hdr, hid_t dxpl_id, unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_sect_indirect_init_rows) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -2670,7 +2670,7 @@ H5HF_sect_indirect_add(H5HF_hdr_t *hdr, hid_t dxpl_id, unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_sect_indirect_add) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -2738,7 +2738,7 @@ H5HF_sect_indirect_decr(H5HF_free_section_t *sect) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_sect_indirect_decr) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -2792,7 +2792,7 @@ H5HF_sect_indirect_revive_row(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_ unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_sect_indirect_revive_row) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -2858,7 +2858,7 @@ H5HF_sect_indirect_revive(H5HF_hdr_t *hdr, hid_t dxpl_id, unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_sect_indirect_revive) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -2927,7 +2927,7 @@ H5HF_sect_indirect_reduce_row(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_ H5HF_free_section_t *peer_sect = NULL; /* Peer indirect section */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_sect_indirect_reduce_row) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -3194,7 +3194,7 @@ H5HF_sect_indirect_reduce(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t *s H5HF_free_section_t *peer_sect = NULL; /* Peer indirect section */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_sect_indirect_reduce) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -3421,7 +3421,7 @@ H5HF_sect_indirect_is_first(H5HF_free_section_t *sect) { hbool_t ret_value = FALSE; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_sect_indirect_is_first) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ HDassert(sect); @@ -3456,7 +3456,7 @@ H5HF_sect_indirect_first(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t *se { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_sect_indirect_first) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(hdr); @@ -3506,7 +3506,7 @@ done: static H5HF_indirect_t * H5HF_sect_indirect_get_iblock(H5HF_free_section_t *sect) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_sect_indirect_get_iblock) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* * Check arguments. @@ -3549,7 +3549,7 @@ H5HF_sect_indirect_merge_row(H5HF_hdr_t *hdr, hid_t dxpl_id, unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_sect_indirect_merge_row) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check parameters */ HDassert(hdr); @@ -3786,7 +3786,7 @@ H5HF_sect_indirect_build_parent(H5HF_hdr_t *hdr, H5HF_free_section_t *sect) unsigned par_entry; /* Entry within parent indirect section */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_sect_indirect_build_parent) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check parameters */ HDassert(hdr); @@ -3854,7 +3854,7 @@ H5HF_sect_indirect_shrink(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t *s unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_sect_indirect_shrink) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check parameters */ HDassert(hdr); @@ -3911,7 +3911,7 @@ H5HF_sect_indirect_serialize(H5HF_hdr_t *hdr, const H5HF_free_section_t *sect, { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_sect_indirect_serialize) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments. */ HDassert(hdr); @@ -3978,7 +3978,7 @@ H5HF_sect_indirect_deserialize(H5HF_hdr_t *hdr, hid_t dxpl_id, unsigned end_col; /* End column in indirect block */ H5FS_section_info_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_sect_indirect_deserialize) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments. */ HDassert(hdr); @@ -4048,7 +4048,7 @@ H5HF_sect_indirect_free(H5HF_free_section_t *sect) H5HF_indirect_t *iblock = NULL; /* Indirect block for section */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_sect_indirect_free) + FUNC_ENTER_NOAPI_NOINIT HDassert(sect); @@ -4097,7 +4097,7 @@ H5HF_sect_indirect_valid(const H5HF_hdr_t *hdr, const H5HF_free_section_t *sect) unsigned end_entry; /* Entry for last block covered */ unsigned u; /* Local index variable */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_sect_indirect_valid) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check arguments */ HDassert(hdr); @@ -4195,7 +4195,7 @@ static herr_t H5HF_sect_indirect_debug(const H5HF_free_section_t *sect, FILE *stream, int indent, int fwidth) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_sect_indirect_debug) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments. */ HDassert(sect); diff --git a/src/H5HFspace.c b/src/H5HFspace.c index aa419de..cec9b3a 100644 --- a/src/H5HFspace.c +++ b/src/H5HFspace.c @@ -110,7 +110,7 @@ H5HF_space_start(H5HF_hdr_t *hdr, hid_t dxpl_id, hbool_t may_create) H5HF_FSPACE_SECT_CLS_INDIRECT}; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_space_start) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -171,7 +171,7 @@ H5HF_space_add(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t *node, H5HF_sect_add_ud1_t udata; /* User data for free space manager 'add' */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_space_add) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -218,7 +218,7 @@ H5HF_space_find(H5HF_hdr_t *hdr, hid_t dxpl_id, hsize_t request, H5HF_free_secti htri_t node_found = FALSE; /* Whether an existing free list node was found */ htri_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_space_find) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -264,7 +264,7 @@ H5HF_space_size(H5HF_hdr_t *hdr, hid_t dxpl_id, hsize_t *fs_size) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_space_size) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -309,7 +309,7 @@ H5HF_space_remove(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t *node) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_space_remove) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -347,7 +347,7 @@ H5HF_space_close(H5HF_hdr_t *hdr, hid_t dxpl_id) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_space_close) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -402,7 +402,7 @@ H5HF_space_delete(H5HF_hdr_t *hdr, hid_t dxpl_id) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_space_delete) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -438,7 +438,7 @@ H5HF_space_sect_change_class(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_space_sect_change_class) + FUNC_ENTER_NOAPI_NOINIT #ifdef QAK HDfprintf(stderr, "%s: Called\n", FUNC); #endif /* QAK */ diff --git a/src/H5HFstat.c b/src/H5HFstat.c index 2ab5240..b0e1987 100644 --- a/src/H5HFstat.c +++ b/src/H5HFstat.c @@ -86,7 +86,7 @@ herr_t H5HF_stat_info(const H5HF_t *fh, H5HF_stat_t *stats) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_stat_info) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments. */ HDassert(fh); @@ -131,7 +131,7 @@ H5HF_size(const H5HF_t *fh, hid_t dxpl_id, hsize_t *heap_size) hsize_t meta_size = 0; /* free space storage size */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5HF_size, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* * Check arguments. diff --git a/src/H5HFtest.c b/src/H5HFtest.c index 30adf96..c2e9cb0 100644 --- a/src/H5HFtest.c +++ b/src/H5HFtest.c @@ -87,7 +87,7 @@ herr_t H5HF_get_cparam_test(const H5HF_t *fh, H5HF_create_t *cparam) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_get_cparam_test) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments. */ HDassert(fh); @@ -126,7 +126,7 @@ H5HF_cmp_cparam_test(const H5HF_create_t *cparam1, const H5HF_create_t *cparam2) { int ret_value = 0; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_cmp_cparam_test) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments. */ HDassert(cparam1); @@ -246,7 +246,7 @@ H5HF_get_max_root_rows(const H5HF_t *fh) { unsigned ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_get_max_root_rows) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments. */ HDassert(fh); @@ -277,7 +277,7 @@ H5HF_get_dtable_width_test(const H5HF_t *fh) { unsigned ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_get_dtable_width_test) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments. */ HDassert(fh); @@ -308,7 +308,7 @@ H5HF_get_dtable_max_drows_test(const H5HF_t *fh) { unsigned ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_get_dtable_max_drows_test) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments. */ HDassert(fh); @@ -343,7 +343,7 @@ H5HF_get_iblock_max_drows_test(const H5HF_t *fh, unsigned pos) { unsigned ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_get_iblock_max_drows_test) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments. */ HDassert(fh); @@ -376,7 +376,7 @@ H5HF_get_dblock_size_test(const H5HF_t *fh, unsigned row) { hsize_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_get_dblock_size_test) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments. */ HDassert(fh); @@ -408,7 +408,7 @@ H5HF_get_dblock_free_test(const H5HF_t *fh, unsigned row) { hsize_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_get_dblock_free_test) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments. */ HDassert(fh); @@ -439,7 +439,7 @@ H5HF_get_id_off_test(const H5HF_t *fh, const void *_id, hsize_t *obj_off) { const uint8_t *id = (const uint8_t *)_id; /* Object ID */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_get_id_off_test) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments. */ HDassert(fh); @@ -473,7 +473,7 @@ H5HF_get_id_type_test(const void *_id, unsigned char *obj_type) { const uint8_t *id = (const uint8_t *)_id; /* Object ID */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_get_id_type_test) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments. */ HDassert(id); @@ -503,7 +503,7 @@ herr_t H5HF_get_tiny_info_test(const H5HF_t *fh, size_t *max_len, hbool_t *len_extended) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_get_tiny_info_test) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments. */ HDassert(fh); @@ -535,7 +535,7 @@ H5HF_get_tiny_info_test(const H5HF_t *fh, size_t *max_len, herr_t H5HF_get_huge_info_test(const H5HF_t *fh, hsize_t *next_id, hbool_t *ids_direct) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_get_huge_info_test) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments. */ HDassert(fh); diff --git a/src/H5HFtiny.c b/src/H5HFtiny.c index f11b6c0..a4cbdc1 100644 --- a/src/H5HFtiny.c +++ b/src/H5HFtiny.c @@ -99,7 +99,7 @@ static herr_t H5HF_tiny_op_real(H5HF_hdr_t *hdr, const uint8_t *id, herr_t H5HF_tiny_init(H5HF_hdr_t *hdr) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_tiny_init) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* * Check arguments. @@ -150,7 +150,7 @@ H5HF_tiny_insert(H5HF_hdr_t *hdr, size_t obj_size, const void *obj, void *_id) size_t enc_obj_size; /* Encoded object size */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_tiny_insert) + FUNC_ENTER_NOAPI_NOINIT #ifdef QAK HDfprintf(stderr, "%s: obj_size = %Zu\n", FUNC, obj_size); #endif /* QAK */ @@ -213,7 +213,7 @@ H5HF_tiny_get_obj_len(H5HF_hdr_t *hdr, const uint8_t *id, size_t *obj_len_p) { size_t enc_obj_size; /* Encoded object size */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_tiny_get_obj_len) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* * Check arguments. @@ -258,7 +258,7 @@ H5HF_tiny_op_real(H5HF_hdr_t *hdr, const uint8_t *id, H5HF_operator_t op, size_t enc_obj_size; /* Encoded object size */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_tiny_op_real) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -316,7 +316,7 @@ H5HF_tiny_read(H5HF_hdr_t *hdr, const uint8_t *id, void *obj) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_tiny_read) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -353,7 +353,7 @@ H5HF_tiny_op(H5HF_hdr_t *hdr, const uint8_t *id, H5HF_operator_t op, { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_tiny_op) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -390,7 +390,7 @@ H5HF_tiny_remove(H5HF_hdr_t *hdr, const uint8_t *id) size_t enc_obj_size; /* Encoded object size */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_tiny_remove) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. diff --git a/src/H5HG.c b/src/H5HG.c index 67dc58e..0a97e47 100644 --- a/src/H5HG.c +++ b/src/H5HG.c @@ -41,7 +41,6 @@ /* Module Setup */ /****************/ -#define H5F_PACKAGE /*suppress error about including H5Fpkg */ #define H5HG_PACKAGE /*suppress error about including H5HGpkg */ @@ -50,7 +49,7 @@ /***********/ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ -#include "H5Fpkg.h" /* File access */ +#include "H5Fprivate.h" /* File access */ #include "H5HGpkg.h" /* Global heaps */ #include "H5MFprivate.h" /* File memory management */ #include "H5MMprivate.h" /* Memory management */ @@ -61,13 +60,6 @@ /****************/ /* - * Limit global heap collections to the some reasonable size. This is - * fairly arbitrary, but needs to be small enough that no more than H5HG_MAXIDX - * objects will be allocated from a single heap. - */ -#define H5HG_MAXSIZE 65536 - -/* * The maximum number of links allowed to a global heap object. */ #define H5HG_MAXLINK 65535 @@ -148,7 +140,7 @@ H5HG_create(H5F_t *f, hid_t dxpl_id, size_t size) size_t n; haddr_t ret_value = HADDR_UNDEF; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(H5HG_create, dxpl_id, H5AC__GLOBALHEAP_TAG, HADDR_UNDEF) + FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, H5AC__GLOBALHEAP_TAG, HADDR_UNDEF) /* Check args */ HDassert(f); @@ -164,7 +156,7 @@ H5HG_create(H5F_t *f, hid_t dxpl_id, size_t size) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, HADDR_UNDEF, "memory allocation failed") heap->addr = addr; heap->size = size; - heap->shared = f->shared; + heap->shared = H5F_SHARED(f); if(NULL == (heap->chunk = H5FL_BLK_MALLOC(gheap_chunk, size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, HADDR_UNDEF, "memory allocation failed") @@ -212,19 +204,8 @@ HDmemset(heap->chunk, 0, size); #endif /* OLD_WAY */ /* Add this heap to the beginning of the CWFS list */ - if(NULL == f->shared->cwfs) { - f->shared->cwfs = (H5HG_heap_t **)H5MM_malloc(H5HG_NCWFS * sizeof(H5HG_heap_t *)); - if(NULL == (f->shared->cwfs)) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, HADDR_UNDEF, "memory allocation failed") - f->shared->cwfs[0] = heap; - f->shared->ncwfs = 1; - } /* end if */ - else { - HDmemmove(f->shared->cwfs + 1, f->shared->cwfs, - MIN(f->shared->ncwfs, H5HG_NCWFS - 1) * sizeof(H5HG_heap_t *)); - f->shared->cwfs[0] = heap; - f->shared->ncwfs = MIN(H5HG_NCWFS, f->shared->ncwfs + 1); - } /* end else */ + if(H5F_cwfs_add(f, heap) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, HADDR_UNDEF, "unable to add global heap collection to file's CWFS") /* Add the heap to the cache */ if(H5AC_insert_entry(f, dxpl_id, H5AC_GHEAP, addr, heap, H5AC__NO_FLAGS_SET) < 0) @@ -270,7 +251,7 @@ H5HG_protect(H5F_t *f, hid_t dxpl_id, haddr_t addr, H5AC_protect_t rw) H5HG_heap_t *heap; /* Global heap */ H5HG_heap_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HG_protect) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments */ HDassert(f); @@ -317,7 +298,7 @@ H5HG_alloc(H5F_t *f, H5HG_heap_t *heap, size_t size, unsigned *heap_flags_ptr) size_t need = H5HG_SIZEOF_OBJHDR(f) + H5HG_ALIGN(size); size_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HG_alloc); + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(heap); @@ -441,7 +422,7 @@ done: * *------------------------------------------------------------------------- */ -static herr_t +herr_t H5HG_extend(H5F_t *f, hid_t dxpl_id, haddr_t addr, size_t need) { H5HG_heap_t *heap = NULL; /* Pointer to heap to extend */ @@ -452,7 +433,7 @@ H5HG_extend(H5F_t *f, hid_t dxpl_id, haddr_t addr, size_t need) unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HG_extend) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(f); @@ -537,102 +518,42 @@ herr_t H5HG_insert(H5F_t *f, hid_t dxpl_id, size_t size, void *obj, H5HG_t *hobj/*out*/) { size_t need; /*total space needed for object */ - unsigned cwfsno; size_t idx; - haddr_t addr = HADDR_UNDEF; + haddr_t addr; /* Address of heap to add object within */ H5HG_heap_t *heap = NULL; unsigned heap_flags = H5AC__NO_FLAGS_SET; - hbool_t found = FALSE; /* Flag to indicate a heap with enough space was found */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(H5HG_insert, dxpl_id, H5AC__GLOBALHEAP_TAG, FAIL) + FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__GLOBALHEAP_TAG, FAIL) /* Check args */ HDassert(f); HDassert(0 == size || obj); HDassert(hobj); - if(0 == (f->intent & H5F_ACC_RDWR)) + if(0 == (H5F_INTENT(f) & H5F_ACC_RDWR)) HGOTO_ERROR(H5E_HEAP, H5E_WRITEERROR, FAIL, "no write intent on file") /* Find a large enough collection on the CWFS list */ need = H5HG_SIZEOF_OBJHDR(f) + H5HG_ALIGN(size); - /* Note that we don't have metadata cache locks on the entries in - * f->shared->cwfs. - * - * In the current situation, this doesn't matter, as we are single - * threaded, and as best I can tell, entries are added to and deleted - * from f->shared->cwfs as they are added to and deleted from the - * metadata cache. - * - * To be proper, we should either lock each entry in f->shared->cwfs - * as we examine it, or lock the whole array. However, at present - * I don't see the point as there will be significant overhead, - * and protecting and unprotecting all the collections in the global - * heap on a regular basis will skew the replacement policy. - * - * JRM - 5/24/04 - */ - for(cwfsno = 0; cwfsno < f->shared->ncwfs; cwfsno++) - if(f->shared->cwfs[cwfsno]->obj[0].size >= need) { - addr = f->shared->cwfs[cwfsno]->addr; - found = TRUE; - break; - } /* end if */ - - /* - * If we didn't find any collection with enough free space the check if - * we can extend any of the collections to make enough room. - */ - if(!found) { - size_t new_need; - - for(cwfsno = 0; cwfsno < f->shared->ncwfs; cwfsno++) { - new_need = need; - new_need -= f->shared->cwfs[cwfsno]->obj[0].size; - new_need = MAX(f->shared->cwfs[cwfsno]->size, new_need); - - if((f->shared->cwfs[cwfsno]->size + new_need) <= H5HG_MAXSIZE) { - htri_t extended; /* Whether the heap was extended */ - - extended = H5MF_try_extend(f, dxpl_id, H5FD_MEM_GHEAP, f->shared->cwfs[cwfsno]->addr, (hsize_t)f->shared->cwfs[cwfsno]->size, (hsize_t)new_need); - if(extended < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTEXTEND, FAIL, "error trying to extend heap") - else if(extended == TRUE) { - if(H5HG_extend(f, dxpl_id, f->shared->cwfs[cwfsno]->addr, new_need) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTRESIZE, FAIL, "unable to extend global heap collection") - addr = f->shared->cwfs[cwfsno]->addr; - found = TRUE; - break; - } /* end if */ - } /* end if */ - } /* end for */ - } /* end if */ + /* Look for a heap in the file's CWFS that has enough space for the object */ + addr = HADDR_UNDEF; + if(H5F_cwfs_find_free_heap(f, dxpl_id, need, &addr) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_NOTFOUND, FAIL, "error trying to locate heap") /* * If we didn't find any collection with enough free space then allocate a * new collection large enough for the message plus the collection header. */ - if(!found) { - addr = H5HG_create(f, dxpl_id, need+H5HG_SIZEOF_HDR (f)); + if(!H5F_addr_defined(addr)) { + addr = H5HG_create(f, dxpl_id, need + H5HG_SIZEOF_HDR(f)); if(!H5F_addr_defined(addr)) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "unable to allocate a global heap collection") } /* end if */ - else { - /* Move the collection forward in the CWFS list, if it's not - * already at the front - */ - if(cwfsno > 0) { - H5HG_heap_t *tmp = f->shared->cwfs[cwfsno]; - - f->shared->cwfs[cwfsno] = f->shared->cwfs[cwfsno - 1]; - f->shared->cwfs[cwfsno - 1] = tmp; - --cwfsno; - } /* end if */ - } /* end else */ HDassert(H5F_addr_defined(addr)); + if(NULL == (heap = H5HG_protect(f, dxpl_id, addr, H5AC_WRITE))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect global heap") @@ -690,7 +611,7 @@ H5HG_read(H5F_t *f, hid_t dxpl_id, H5HG_t *hobj, void *object/*out*/, void *orig_object = object; /* Keep a copy of the original object pointer */ void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_TAG(H5HG_read, dxpl_id, H5AC__GLOBALHEAP_TAG, NULL) + FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__GLOBALHEAP_TAG, NULL) /* Check args */ HDassert(f); @@ -715,16 +636,8 @@ H5HG_read(H5F_t *f, hid_t dxpl_id, H5HG_t *hobj, void *object/*out*/, * with the H5AC_protect(), but it won't hurt to do it twice. */ if(heap->obj[0].begin) { - unsigned u; /* Local index variable */ - - for(u = 0; u < f->shared->ncwfs; u++) - if(f->shared->cwfs[u] == heap) { - if(u) { - f->shared->cwfs[u] = f->shared->cwfs[u - 1]; - f->shared->cwfs[u - 1] = heap; - } /* end if */ - break; - } /* end if */ + if(H5F_cwfs_advance_heap(f, heap, FALSE) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTMODIFY, NULL, "can't adjust file's CWFS") } /* end if */ /* If the caller would like to know the heap object's size, set that */ @@ -770,12 +683,12 @@ H5HG_link(H5F_t *f, hid_t dxpl_id, const H5HG_t *hobj, int adjust) unsigned heap_flags = H5AC__NO_FLAGS_SET; int ret_value; /* Return value */ - FUNC_ENTER_NOAPI_TAG(H5HG_link, dxpl_id, H5AC__GLOBALHEAP_TAG, FAIL) + FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__GLOBALHEAP_TAG, FAIL) /* Check args */ HDassert(f); HDassert(hobj); - if(0 == (f->intent & H5F_ACC_RDWR)) + if(0 == (H5F_INTENT(f) & H5F_ACC_RDWR)) HGOTO_ERROR(H5E_HEAP, H5E_WRITEERROR, FAIL, "no write intent on file") /* Load the heap */ @@ -833,12 +746,12 @@ H5HG_remove (H5F_t *f, hid_t dxpl_id, H5HG_t *hobj) unsigned flags = H5AC__NO_FLAGS_SET;/* Whether the heap gets deleted */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(H5HG_remove, dxpl_id, H5AC__GLOBALHEAP_TAG, FAIL); + FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__GLOBALHEAP_TAG, FAIL); /* Check args */ HDassert(f); HDassert(hobj); - if(0 == (f->intent & H5F_ACC_RDWR)) + if(0 == (H5F_INTENT(f) & H5F_ACC_RDWR)) HGOTO_ERROR(H5E_HEAP, H5E_WRITEERROR, FAIL, "no write intent on file") /* Load the heap */ @@ -887,18 +800,8 @@ H5HG_remove (H5F_t *f, hid_t dxpl_id, H5HG_t *hobj) * H5AC_protect() might have done that too, but that's okay. If the * heap isn't on the CWFS list then add it to the end. */ - for(u = 0; u < f->shared->ncwfs; u++) - if(f->shared->cwfs[u] == heap) { - if(u) { - f->shared->cwfs[u] = f->shared->cwfs[u - 1]; - f->shared->cwfs[u - 1] = heap; - } /* end if */ - break; - } /* end if */ - if(u >= f->shared->ncwfs) { - f->shared->ncwfs = MIN(f->shared->ncwfs + 1, H5HG_NCWFS); - f->shared->cwfs[f->shared->ncwfs - 1] = heap; - } /* end if */ + if(H5F_cwfs_advance_heap(f, heap, TRUE) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTMODIFY, FAIL, "can't adjust file's CWFS") } /* end else */ done: @@ -924,21 +827,16 @@ done: herr_t H5HG_free(H5HG_heap_t *heap) { - unsigned u; /* Local index variable */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HG_free) + FUNC_ENTER_NOAPI(FAIL) /* Check arguments */ HDassert(heap); /* Remove the heap from the CWFS list */ - for(u = 0; u < heap->shared->ncwfs; u++) { - if(heap->shared->cwfs[u] == heap) { - heap->shared->ncwfs -= 1; - HDmemmove(heap->shared->cwfs + u, heap->shared->cwfs + u + 1, (heap->shared->ncwfs - u) * sizeof(H5HG_heap_t *)); - break; - } /* end if */ - } /* end for */ + if(H5F_cwfs_remove_heap(heap->shared, heap) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTREMOVE, FAIL, "can't remove heap from file's CWFS") if(heap->chunk) heap->chunk = H5FL_BLK_FREE(gheap_chunk, heap->chunk); @@ -946,6 +844,7 @@ H5HG_free(H5HG_heap_t *heap) heap->obj = H5FL_SEQ_FREE(H5HG_obj_t, heap->obj); heap = H5FL_FREE(H5HG_heap_t, heap); - FUNC_LEAVE_NOAPI(SUCCEED) +done: + FUNC_LEAVE_NOAPI(ret_value) } /* H5HG_free() */ diff --git a/src/H5HGcache.c b/src/H5HGcache.c index a3cf5b1..afb2a75 100644 --- a/src/H5HGcache.c +++ b/src/H5HGcache.c @@ -28,7 +28,6 @@ /* Module Setup */ /****************/ -#define H5F_PACKAGE /*suppress error about including H5Fpkg */ #define H5HG_PACKAGE /*suppress error about including H5HGpkg */ @@ -37,7 +36,7 @@ /***********/ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ -#include "H5Fpkg.h" /* File access */ +#include "H5Fprivate.h" /* File access */ #include "H5HGpkg.h" /* Global heaps */ #include "H5MFprivate.h" /* File memory management */ #include "H5MMprivate.h" /* Memory management */ @@ -121,7 +120,7 @@ H5HG_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata) size_t max_idx = 0; /* The maximum index seen */ H5HG_heap_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HG_load) + FUNC_ENTER_NOAPI_NOINIT /* check arguments */ HDassert(f); @@ -131,7 +130,7 @@ H5HG_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata) /* Read the initial 4k page */ if(NULL == (heap = H5FL_CALLOC(H5HG_heap_t))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") - heap->shared = f->shared; + heap->shared = H5F_SHARED(f); if(NULL == (heap->chunk = H5FL_BLK_MALLOC(gheap_chunk, (size_t)H5HG_MINSIZE))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") if(H5F_block_read(f, H5FD_MEM_GHEAP, addr, (size_t)H5HG_MINSIZE, dxpl_id, heap->chunk) < 0) @@ -252,30 +251,9 @@ H5HG_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata) HDassert(max_idx < heap->nused); - /* - * Add the new heap to the CWFS list, removing some other entry if - * necessary to make room. We remove the right-most entry that has less - * free space than this heap. - */ - if(!f->shared->cwfs) { - if(NULL == (f->shared->cwfs = (H5HG_heap_t **)H5MM_malloc(H5HG_NCWFS * sizeof(H5HG_heap_t *)))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") - f->shared->ncwfs = 1; - f->shared->cwfs[0] = heap; - } else if(H5HG_NCWFS == f->shared->ncwfs) { - int i; /* Local index variable */ - - for(i = H5HG_NCWFS - 1; i >= 0; --i) - if(f->shared->cwfs[i]->obj[0].size < heap->obj[0].size) { - HDmemmove(f->shared->cwfs + 1, f->shared->cwfs, i * sizeof(H5HG_heap_t *)); - f->shared->cwfs[0] = heap; - break; - } /* end if */ - } else { - HDmemmove(f->shared->cwfs + 1, f->shared->cwfs, f->shared->ncwfs * sizeof(H5HG_heap_t *)); - f->shared->ncwfs += 1; - f->shared->cwfs[0] = heap; - } /* end else */ + /* Add the new heap to the CWFS list for the file */ + if(H5F_cwfs_add(f, heap) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, NULL, "unable to add global heap collection to file's CWFS") ret_value = heap; @@ -306,7 +284,7 @@ H5HG_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5HG_heap_t * { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HG_flush) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments */ HDassert(f); @@ -346,7 +324,7 @@ H5HG_dest(H5F_t *f, H5HG_heap_t *heap) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HG_dest) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments */ HDassert(heap); @@ -391,7 +369,7 @@ H5HG_clear(H5F_t *f, H5HG_heap_t *heap, hbool_t destroy) { herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT(H5HG_clear) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments */ HDassert(heap); @@ -425,7 +403,7 @@ done: static herr_t H5HG_size(const H5F_t UNUSED *f, const H5HG_heap_t *heap, size_t *size_ptr) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HG_size) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments */ HDassert(heap); diff --git a/src/H5HGdbg.c b/src/H5HGdbg.c index f301701..74044cb 100644 --- a/src/H5HGdbg.c +++ b/src/H5HGdbg.c @@ -18,15 +18,58 @@ * * Purpose: Global Heap object debugging functions. */ + +/****************/ +/* Module Setup */ +/****************/ + #define H5HG_PACKAGE /*suppress error about including H5HGpkg */ +/***********/ +/* Headers */ +/***********/ #include "H5private.h" /* Generic Functions */ #include "H5ACprivate.h" /* Metadata cache */ #include "H5Eprivate.h" /* Error handling */ #include "H5HGpkg.h" /* Global heaps */ #include "H5Iprivate.h" /* ID Functions */ +/****************/ +/* Local Macros */ +/****************/ + + +/******************/ +/* Local Typedefs */ +/******************/ + + +/********************/ +/* Package Typedefs */ +/********************/ + + +/********************/ +/* Local Prototypes */ +/********************/ + + +/*********************/ +/* Package Variables */ +/*********************/ + + +/*****************************/ +/* Library Private Variables */ +/*****************************/ + + +/*******************/ +/* Local Variables */ +/*******************/ + + /*------------------------------------------------------------------------- * Function: H5HG_debug @@ -39,18 +82,6 @@ * matzke@llnl.gov * Mar 27, 1998 * - * Modifications: - * Robb Matzke, 1999-07-28 - * The ADDR argument is passed by value. - * - * Robb Matzke, LLNL, 2003-06-05 - * The size does not include the object header, just the data. - * - * John Mainzer, 6/17/05 - * Modified the function to use the new dirtied parameter of - * of H5AC_unprotect() instead of modifying the is_dirty - * field of the cache info. - * *------------------------------------------------------------------------- */ herr_t @@ -64,7 +95,7 @@ H5HG_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, uint8_t *p = NULL; herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5HG_debug, FAIL); + FUNC_ENTER_NOAPI(FAIL) /* check arguments */ HDassert(f); @@ -142,4 +173,5 @@ done: HDONE_ERROR(H5E_HEAP, H5E_PROTECT, FAIL, "unable to release object header"); FUNC_LEAVE_NOAPI(ret_value); -} +} /* end H5HG_debug() */ + diff --git a/src/H5HGpkg.h b/src/H5HGpkg.h index 6c60656..5d4234f 100644 --- a/src/H5HGpkg.h +++ b/src/H5HGpkg.h @@ -71,12 +71,6 @@ H5FL_BLK_EXTERN(gheap_chunk); #define H5HG_MINSIZE 4096 /* - * Maximum length of the CWFS list, the list of remembered collections that - * have free space. - */ -#define H5HG_NCWFS 16 - -/* * Pad all global heap messages to a multiple of eight bytes so we can load * the entire collection into memory and operate on it there. Eight should * be sufficient for machines that have alignment constraints because our diff --git a/src/H5HGprivate.h b/src/H5HGprivate.h index b6cdb4a..3765c47 100644 --- a/src/H5HGprivate.h +++ b/src/H5HGprivate.h @@ -35,14 +35,44 @@ typedef struct H5HG_t { /* Typedef for heap in memory (defined in H5HGpkg.h) */ typedef struct H5HG_heap_t H5HG_heap_t; + +/* + * Limit global heap collections to the some reasonable size. This is + * fairly arbitrary, but needs to be small enough that no more than H5HG_MAXIDX + * objects will be allocated from a single heap. + */ +#define H5HG_MAXSIZE 65536 + +/* If the module using this macro is allowed access to the private variables, access them directly */ +#ifdef H5HG_PACKAGE +#define H5HG_ADDR(H) ((H)->addr) +#define H5HG_SIZE(H) ((H)->size) +#define H5HG_FREE_SIZE(H) ((H)->obj[0].size) +#else /* H5HG_PACKAGE */ +#define H5HG_ADDR(H) (H5HG_get_addr(H)) +#define H5HG_SIZE(H) (H5HG_get_size(H)) +#define H5HG_FREE_SIZE(H) (H5HG_get_free_size(H)) +#endif /* H5HG_PACKAGE */ + + +/* Main global heap routines */ H5_DLL herr_t H5HG_insert(H5F_t *f, hid_t dxpl_id, size_t size, void *obj, H5HG_t *hobj/*out*/); H5_DLL void *H5HG_read(H5F_t *f, hid_t dxpl_id, H5HG_t *hobj, void *object, size_t *buf_size/*out*/); H5_DLL int H5HG_link(H5F_t *f, hid_t dxpl_id, const H5HG_t *hobj, int adjust); H5_DLL herr_t H5HG_remove(H5F_t *f, hid_t dxpl_id, H5HG_t *hobj); +/* Support routines */ +H5_DLL herr_t H5HG_extend(H5F_t *f, hid_t dxpl_id, haddr_t addr, size_t need); + +/* Query routines */ +H5_DLL haddr_t H5HG_get_addr(const H5HG_heap_t *h); +H5_DLL size_t H5HG_get_size(const H5HG_heap_t *h); +H5_DLL size_t H5HG_get_free_size(const H5HG_heap_t *h); + /* Debugging functions */ H5_DLL herr_t H5HG_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int fwidth); -#endif +#endif /* _H5HGprivate_H */ + diff --git a/src/H5HGquery.c b/src/H5HGquery.c new file mode 100644 index 0000000..a1b3777 --- /dev/null +++ b/src/H5HGquery.c @@ -0,0 +1,145 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Programmer: Quincey Koziol + * Wednesday, July 20, 2011 + * + * Purpose: Query routines for global heaps. + * + */ + +/****************/ +/* Module Setup */ +/****************/ + +#define H5HG_PACKAGE /*suppress error about including H5HGpkg */ + + +/***********/ +/* Headers */ +/***********/ +#include "H5private.h" /* Generic Functions */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5HGpkg.h" /* Global heaps */ + + +/****************/ +/* Local Macros */ +/****************/ + + +/******************/ +/* Local Typedefs */ +/******************/ + + +/********************/ +/* Package Typedefs */ +/********************/ + + +/********************/ +/* Local Prototypes */ +/********************/ + + +/*********************/ +/* Package Variables */ +/*********************/ + + +/*****************************/ +/* Library Private Variables */ +/*****************************/ + + +/*******************/ +/* Local Variables */ +/*******************/ + + + +/*------------------------------------------------------------------------- + * Function: H5HG_get_addr + * + * Purpose: Query the address of a global heap object. + * + * Return: Address of heap on success/abort on failure (shouldn't fail) + * + * Programmer: Quincey Koziol + * Wednesday, July 20, 2011 + * + *------------------------------------------------------------------------- + */ +haddr_t +H5HG_get_addr(const H5HG_heap_t *heap) +{ + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR + + HDassert(heap); + + FUNC_LEAVE_NOAPI(heap->addr) +} /* H5HG_get_addr() */ + + +/*------------------------------------------------------------------------- + * Function: H5HG_get_size + * + * Purpose: Query the size of a global heap object. + * + * Return: Size of heap on success/abort on failure (shouldn't fail) + * + * Programmer: Quincey Koziol + * Wednesday, July 20, 2011 + * + *------------------------------------------------------------------------- + */ +size_t +H5HG_get_size(const H5HG_heap_t *heap) +{ + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR + + HDassert(heap); + + FUNC_LEAVE_NOAPI(heap->size) +} /* H5HG_get_size() */ + + +/*------------------------------------------------------------------------- + * Function: H5HG_get_free_size + * + * Purpose: Query the free size of a global heap object. + * + * Return: Free size of heap on success/abort on failure (shouldn't fail) + * + * Programmer: Quincey Koziol + * Wednesday, July 20, 2011 + * + *------------------------------------------------------------------------- + */ +size_t +H5HG_get_free_size(const H5HG_heap_t *heap) +{ + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR + + HDassert(heap); + + FUNC_LEAVE_NOAPI(heap->obj[0].size) +} /* H5HG_get_free_size() */ + diff --git a/src/H5HL.c b/src/H5HL.c index 4665474..b1b5b24 100644 --- a/src/H5HL.c +++ b/src/H5HL.c @@ -29,7 +29,6 @@ /* Module Setup */ /****************/ -#define H5F_PACKAGE /* Suppress error about including H5Fpkg */ #define H5HL_PACKAGE /* Suppress error about including H5HLpkg */ @@ -38,7 +37,7 @@ /***********/ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ -#include "H5Fpkg.h" /* File access */ +#include "H5Fprivate.h" /* File access */ #include "H5HLpkg.h" /* Local Heaps */ #include "H5MFprivate.h" /* File memory management */ @@ -119,7 +118,7 @@ H5HL_create(H5F_t *f, hid_t dxpl_id, size_t size_hint, haddr_t *addr_p/*out*/) hsize_t total_size; /* Total heap size on disk */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5HL_create, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* check arguments */ HDassert(f); @@ -154,9 +153,12 @@ H5HL_create(H5F_t *f, hid_t dxpl_id, size_t size_hint, haddr_t *addr_p/*out*/) heap->freelist->offset = 0; heap->freelist->size = size_hint; heap->freelist->prev = heap->freelist->next = NULL; + heap->free_block = 0; } /* end if */ - else + else { heap->freelist = NULL; + heap->free_block = H5HL_FREE_NULL; + } /* end else */ /* Allocate the heap prefix */ if(NULL == (prfx = H5HL_prfx_new(heap))) @@ -213,7 +215,7 @@ H5HL_dblk_realloc(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, size_t new_heap_size) size_t old_heap_size; /* Old size of heap data block */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HL_dblk_realloc) + FUNC_ENTER_NOAPI_NOINIT /* check arguments */ HDassert(heap); @@ -323,7 +325,7 @@ H5HL_minimize_heap_space(H5F_t *f, hid_t dxpl_id, H5HL_t *heap) size_t new_heap_size = heap->dblk_size; /* New size of heap */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5HL_minimize_heap_space, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* check args */ HDassert(f); @@ -449,7 +451,7 @@ H5HL_protect(H5F_t *f, hid_t dxpl_id, haddr_t addr, H5AC_protect_t rw) unsigned dblk_cache_flags = H5AC__NO_FLAGS_SET; /* Cache flags for unprotecting data block entry */ H5HL_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5HL_protect, NULL) + FUNC_ENTER_NOAPI(NULL) /* check arguments */ HDassert(f); @@ -460,8 +462,6 @@ H5HL_protect(H5F_t *f, hid_t dxpl_id, haddr_t addr, H5AC_protect_t rw) prfx_udata.sizeof_addr = H5F_SIZEOF_ADDR(f); prfx_udata.prfx_addr = addr; prfx_udata.sizeof_prfx = H5HL_SIZEOF_HDR(f); - prfx_udata.loaded = FALSE; - prfx_udata.free_block = H5HL_FREE_NULL; /* Protect the local heap prefix */ if(NULL == (prfx = (H5HL_prfx_t *)H5AC_protect(f, dxpl_id, H5AC_LHEAP_PRFX, addr, &prfx_udata, rw))) @@ -483,8 +483,6 @@ H5HL_protect(H5F_t *f, hid_t dxpl_id, haddr_t addr, H5AC_protect_t rw) /* Construct the user data for protect callback */ dblk_udata.heap = heap; - dblk_udata.free_block = prfx_udata.loaded ? prfx_udata.free_block : - (heap->freelist ? heap->freelist->offset : H5HL_FREE_NULL); dblk_udata.loaded = FALSE; /* Protect the local heap data block */ @@ -541,7 +539,7 @@ H5HL_offset_into(const H5HL_t *heap, size_t offset) * We need to have called some other function before this to get a * valid heap pointer. So, this can remain "FUNC_ENTER_NOAPI_NOINIT" */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HL_offset_into) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ HDassert(heap); @@ -570,7 +568,7 @@ H5HL_unprotect(H5HL_t *heap) { herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI(H5HL_unprotect, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* check arguments */ HDassert(heap); @@ -619,7 +617,7 @@ done: static H5HL_free_t * H5HL_remove_free(H5HL_t *heap, H5HL_free_t *fl) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HL_remove_free) + FUNC_ENTER_NOAPI_NOINIT_NOERR if(fl->prev) fl->prev->next = fl->next; @@ -652,7 +650,7 @@ H5HL_dirty(H5HL_t *heap) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HL_dirty) + FUNC_ENTER_NOAPI_NOINIT /* check arguments */ HDassert(heap); @@ -699,7 +697,7 @@ H5HL_insert(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, size_t buf_size, const void * hbool_t found; size_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5HL_insert, UFAIL) + FUNC_ENTER_NOAPI(UFAIL) /* check arguments */ HDassert(f); @@ -915,7 +913,7 @@ H5HL_remove(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, size_t offset, size_t size) H5HL_free_t *fl = NULL; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5HL_remove, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* check arguments */ HDassert(f); @@ -1066,7 +1064,7 @@ H5HL_delete(H5F_t *f, hid_t dxpl_id, haddr_t addr) unsigned cache_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting heap */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5HL_delete, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* check arguments */ HDassert(f); @@ -1077,8 +1075,6 @@ H5HL_delete(H5F_t *f, hid_t dxpl_id, haddr_t addr) prfx_udata.sizeof_addr = H5F_SIZEOF_ADDR(f); prfx_udata.prfx_addr = addr; prfx_udata.sizeof_prfx = H5HL_SIZEOF_HDR(f); - prfx_udata.loaded = FALSE; - prfx_udata.free_block = H5HL_FREE_NULL; /* Protect the local heap prefix */ if(NULL == (prfx = (H5HL_prfx_t *)H5AC_protect(f, dxpl_id, H5AC_LHEAP_PRFX, addr, &prfx_udata, H5AC_WRITE))) @@ -1093,8 +1089,6 @@ H5HL_delete(H5F_t *f, hid_t dxpl_id, haddr_t addr) /* Construct the user data for protect callback */ dblk_udata.heap = heap; - dblk_udata.free_block = prfx_udata.loaded ? prfx_udata.free_block : - (heap->freelist ? heap->freelist->offset : H5HL_FREE_NULL); dblk_udata.loaded = FALSE; /* Protect the local heap data block */ @@ -1145,7 +1139,7 @@ H5HL_get_size(H5F_t *f, hid_t dxpl_id, haddr_t addr, size_t *size) H5HL_t *heap; /* Heap data structure */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5HL_get_size, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* check arguments */ HDassert(f); @@ -1157,8 +1151,6 @@ H5HL_get_size(H5F_t *f, hid_t dxpl_id, haddr_t addr, size_t *size) prfx_udata.sizeof_addr = H5F_SIZEOF_ADDR(f); prfx_udata.prfx_addr = addr; prfx_udata.sizeof_prfx = H5HL_SIZEOF_HDR(f); - prfx_udata.loaded = FALSE; - prfx_udata.free_block = H5HL_FREE_NULL; /* Protect the local heap prefix */ if(NULL == (prfx = (H5HL_prfx_t *)H5AC_protect(f, dxpl_id, H5AC_LHEAP_PRFX, addr, &prfx_udata, H5AC_READ))) @@ -1199,7 +1191,7 @@ H5HL_heapsize(H5F_t *f, hid_t dxpl_id, haddr_t addr, hsize_t *heap_size) H5HL_t *heap; /* Heap data structure */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5HL_heapsize, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* check arguments */ HDassert(f); @@ -1211,8 +1203,6 @@ H5HL_heapsize(H5F_t *f, hid_t dxpl_id, haddr_t addr, hsize_t *heap_size) prfx_udata.sizeof_addr = H5F_SIZEOF_ADDR(f); prfx_udata.prfx_addr = addr; prfx_udata.sizeof_prfx = H5HL_SIZEOF_HDR(f); - prfx_udata.loaded = FALSE; - prfx_udata.free_block = H5HL_FREE_NULL; /* Protect the local heap prefix */ if(NULL == (prfx = (H5HL_prfx_t *)H5AC_protect(f, dxpl_id, H5AC_LHEAP_PRFX, addr, &prfx_udata, H5AC_READ))) diff --git a/src/H5HLcache.c b/src/H5HLcache.c index 56d9919..a3c43ac 100644 --- a/src/H5HLcache.c +++ b/src/H5HLcache.c @@ -134,18 +134,20 @@ const H5AC_class_t H5AC_LHEAP_DBLK[1] = {{ *------------------------------------------------------------------------- */ static herr_t -H5HL_fl_deserialize(H5HL_t *heap, hsize_t free_block) +H5HL_fl_deserialize(H5HL_t *heap) { H5HL_free_t *fl = NULL, *tail = NULL; /* Heap free block nodes */ + hsize_t free_block; /* Offset of free block */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HL_fl_deserialize) + FUNC_ENTER_NOAPI_NOINIT /* check arguments */ HDassert(heap); HDassert(!heap->freelist); /* Build free list */ + free_block = heap->free_block; while(H5HL_FREE_NULL != free_block) { const uint8_t *p; /* Pointer into image buffer */ @@ -208,7 +210,7 @@ H5HL_fl_serialize(const H5HL_t *heap) { H5HL_free_t *fl; /* Pointer to heap free list node */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HL_fl_serialize) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check arguments */ HDassert(heap); @@ -258,7 +260,7 @@ H5HL_prefix_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) haddr_t eoa; /* Relative end of file address */ H5HL_prfx_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HL_prefix_load) + FUNC_ENTER_NOAPI_NOINIT /* check arguments */ HDassert(f); @@ -310,8 +312,8 @@ H5HL_prefix_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) H5F_DECODE_LENGTH_LEN(p, heap->dblk_size, udata->sizeof_size); /* Free list head */ - H5F_DECODE_LENGTH_LEN(p, udata->free_block, udata->sizeof_size); - if(udata->free_block != H5HL_FREE_NULL && udata->free_block >= heap->dblk_size) + H5F_DECODE_LENGTH_LEN(p, heap->free_block, udata->sizeof_size); + if(heap->free_block != H5HL_FREE_NULL && heap->free_block >= heap->dblk_size) HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, NULL, "bad heap free list") /* Heap data address */ @@ -345,7 +347,7 @@ H5HL_prefix_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) } /* end else */ /* Build free list */ - if(H5HL_fl_deserialize(heap, udata->free_block) < 0) + if(H5HL_fl_deserialize(heap) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, NULL, "can't initialize free list") } /* end if */ else @@ -353,9 +355,6 @@ H5HL_prefix_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) heap->single_cache_obj = FALSE; } /* end if */ - /* Set flag to indicate prefix from loaded from file */ - udata->loaded = TRUE; - /* Set return value */ ret_value = prfx; @@ -399,7 +398,7 @@ H5HL_prefix_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, uint8_t heap_buf[H5HL_SPEC_READ_SIZE]; /* Buffer for heap */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HL_prefix_flush) + FUNC_ENTER_NOAPI_NOINIT /* check arguments */ HDassert(f); @@ -408,7 +407,6 @@ H5HL_prefix_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, if(prfx->cache_info.is_dirty) { H5HL_t *heap = prfx->heap; /* Pointer to the local heap */ - H5HL_free_t *fl = heap->freelist; /* Pointer to heap's free list */ uint8_t *buf; /* Pointer to heap buffer */ size_t buf_size; /* Size of buffer for encoding & writing heap info */ uint8_t *p; /* Pointer into raw data buffer */ @@ -426,6 +424,9 @@ H5HL_prefix_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, if(NULL == (buf = (uint8_t *)H5WB_actual(wb, buf_size))) HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, FAIL, "can't get actual buffer") + /* Update the free block value from the free list */ + heap->free_block = heap->freelist ? heap->freelist->offset : H5HL_FREE_NULL; + /* Serialize the heap prefix */ p = buf; HDmemcpy(p, H5HL_MAGIC, (size_t)H5_SIZEOF_MAGIC); @@ -435,18 +436,18 @@ H5HL_prefix_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, *p++ = 0; /*reserved*/ *p++ = 0; /*reserved*/ H5F_ENCODE_LENGTH_LEN(p, heap->dblk_size, heap->sizeof_size); - H5F_ENCODE_LENGTH_LEN(p, fl ? fl->offset : H5HL_FREE_NULL, heap->sizeof_size); + H5F_ENCODE_LENGTH_LEN(p, heap->free_block, heap->sizeof_size); H5F_addr_encode_len(heap->sizeof_addr, &p, heap->dblk_addr); /* Check if the local heap is a single object in cache */ if(heap->single_cache_obj) { - if((p - buf) < heap->prfx_size) { + if((size_t)(p - buf) < heap->prfx_size) { size_t gap; /* Size of gap between prefix and data block */ /* Set p to the start of the data block. This is necessary because * there may be a gap between the used portion of the prefix and the * data block due to alignment constraints. */ - gap = heap->prfx_size - (p - buf); + gap = heap->prfx_size - (size_t)(p - buf); HDmemset(p, 0, gap); p += gap; } /* end if */ @@ -498,7 +499,7 @@ H5HL_prefix_dest(H5F_t *f, void *thing) H5HL_prfx_t *prfx = (H5HL_prfx_t *)thing; /* Local heap prefix to destroy */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HL_prefix_dest) + FUNC_ENTER_NOAPI_NOINIT /* check arguments */ HDassert(prfx); @@ -554,7 +555,7 @@ H5HL_prefix_clear(H5F_t UNUSED *f, void *thing, hbool_t destroy) H5HL_prfx_t *prfx = (H5HL_prfx_t *)thing; /* The local heap prefix to operate on */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HL_prefix_clear) + FUNC_ENTER_NOAPI_NOINIT /* check arguments */ HDassert(prfx); @@ -590,7 +591,7 @@ H5HL_prefix_size(const H5F_t UNUSED *f, const void *thing, size_t *size_ptr) { const H5HL_prfx_t *prfx = (const H5HL_prfx_t *)thing; /* Pointer to local heap prefix to query */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HL_prefix_size) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check arguments */ HDassert(prfx); @@ -629,7 +630,7 @@ H5HL_datablock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) H5HL_cache_dblk_ud_t *udata = (H5HL_cache_dblk_ud_t *)_udata; /* User data for callback */ H5HL_dblk_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HL_datablock_load) + FUNC_ENTER_NOAPI_NOINIT /* check arguments */ HDassert(f); @@ -654,7 +655,7 @@ H5HL_datablock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) HGOTO_ERROR(H5E_HEAP, H5E_READERROR, NULL, "unable to read local heap data block") /* Build free list */ - if(H5HL_fl_deserialize(udata->heap, udata->free_block) < 0) + if(H5HL_fl_deserialize(udata->heap) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, NULL, "can't initialize free list") } /* end if */ @@ -695,7 +696,7 @@ H5HL_datablock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5HL_dblk_t *dblk = (H5HL_dblk_t *)_thing; /* Pointer to the local heap data block */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HL_datablock_flush) + FUNC_ENTER_NOAPI_NOINIT /* check arguments */ HDassert(f); @@ -707,6 +708,9 @@ H5HL_datablock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, if(dblk->cache_info.is_dirty) { H5HL_t *heap = dblk->heap; /* Pointer to the local heap */ + /* Update the free block value from the free list */ + heap->free_block = heap->freelist ? heap->freelist->offset : H5HL_FREE_NULL; + /* Serialize the free list into the heap data's image */ H5HL_fl_serialize(heap); @@ -746,7 +750,7 @@ H5HL_datablock_dest(H5F_t *f, void *_thing) H5HL_dblk_t *dblk = (H5HL_dblk_t *)_thing; /* Pointer to the local heap data block */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HL_datablock_dest) + FUNC_ENTER_NOAPI_NOINIT /* check arguments */ HDassert(dblk); @@ -796,7 +800,7 @@ H5HL_datablock_clear(H5F_t *f, void *_thing, hbool_t destroy) H5HL_dblk_t *dblk = (H5HL_dblk_t *)_thing; /* Pointer to the local heap data block */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HL_datablock_clear) + FUNC_ENTER_NOAPI_NOINIT /* check arguments */ HDassert(dblk); @@ -832,7 +836,7 @@ H5HL_datablock_size(const H5F_t UNUSED *f, const void *_thing, size_t *size_ptr) { const H5HL_dblk_t *dblk = (const H5HL_dblk_t *)_thing; /* Pointer to the local heap data block */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HL_datablock_size) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check arguments */ HDassert(dblk); diff --git a/src/H5HLdbg.c b/src/H5HLdbg.c index b8a8d35..29d5c82 100644 --- a/src/H5HLdbg.c +++ b/src/H5HLdbg.c @@ -60,7 +60,7 @@ H5HL_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, int indent, int size_t amount_free = 0; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5HL_debug, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* check arguments */ HDassert(f); diff --git a/src/H5HLint.c b/src/H5HLint.c index c6d6839..d5238eb 100644 --- a/src/H5HLint.c +++ b/src/H5HLint.c @@ -104,7 +104,7 @@ H5HL_new(size_t sizeof_size, size_t sizeof_addr, size_t prfx_size) H5HL_t *heap = NULL; /* New local heap */ H5HL_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5HL_new, NULL) + FUNC_ENTER_NOAPI(NULL) /* check arguments */ HDassert(sizeof_size > 0); @@ -145,7 +145,7 @@ done: static herr_t H5HL_inc_rc(H5HL_t *heap) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HL_inc_rc) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check arguments */ HDassert(heap); @@ -174,7 +174,7 @@ H5HL_inc_rc(H5HL_t *heap) static herr_t H5HL_dec_rc(H5HL_t *heap) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HL_dec_rc) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check arguments */ HDassert(heap); @@ -206,7 +206,7 @@ H5HL_dec_rc(H5HL_t *heap) herr_t H5HL_dest(H5HL_t *heap) { - FUNC_ENTER_NOAPI_NOFUNC(H5HL_dest) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check arguments */ HDassert(heap); @@ -252,7 +252,7 @@ H5HL_prfx_new(H5HL_t *heap) H5HL_prfx_t *prfx = NULL; /* New local heap prefix */ H5HL_prfx_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5HL_prfx_new, NULL) + FUNC_ENTER_NOAPI(NULL) /* check arguments */ HDassert(heap); @@ -296,7 +296,7 @@ H5HL_prfx_dest(H5HL_prfx_t *prfx) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5HL_prfx_dest, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* check arguments */ HDassert(prfx); @@ -342,7 +342,7 @@ H5HL_dblk_new(H5HL_t *heap) H5HL_dblk_t *dblk = NULL; /* New local heap data block */ H5HL_dblk_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5HL_dblk_new, NULL) + FUNC_ENTER_NOAPI(NULL) /* check arguments */ HDassert(heap); @@ -386,7 +386,7 @@ H5HL_dblk_dest(H5HL_dblk_t *dblk) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5HL_dblk_dest, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* check arguments */ HDassert(dblk); diff --git a/src/H5HLpkg.h b/src/H5HLpkg.h index b7e0ece..bf9be2c 100644 --- a/src/H5HLpkg.h +++ b/src/H5HLpkg.h @@ -90,18 +90,19 @@ struct H5HL_t { size_t sizeof_size; /* Size of file sizes */ size_t sizeof_addr; /* Size of file addresses */ hbool_t single_cache_obj; /* Indicate if the heap is a single object in the cache */ + H5HL_free_t *freelist; /*the free list */ /* Prefix-specific fields */ H5HL_prfx_t *prfx; /* The prefix object for the heap */ haddr_t prfx_addr; /* address of heap prefix */ size_t prfx_size; /* size of heap prefix */ + hsize_t free_block; /* Address of first free block */ /* Data block-specific fields */ H5HL_dblk_t *dblk; /* The data block object for the heap */ haddr_t dblk_addr; /* address of data block */ size_t dblk_size; /* size of heap data block on disk and in mem */ uint8_t *dblk_image; /* The data block image */ - H5HL_free_t *freelist; /*the free list */ }; /* Struct for heap data block */ @@ -127,15 +128,12 @@ typedef struct H5HL_cache_prfx_ud_t { size_t sizeof_prfx; /* Size of heap prefix */ /* Upwards */ - hbool_t loaded; /* Whether prefix was loaded from file */ - hsize_t free_block; /* First free block in heap */ } H5HL_cache_prfx_ud_t; /* Callback information for loading local heap data block from disk */ typedef struct H5HL_cache_dblk_ud_t { /* Downwards */ H5HL_t *heap; /* Local heap */ - hsize_t free_block; /* First free block in heap */ /* Upwards */ hbool_t loaded; /* Whether data block was loaded from file */ diff --git a/src/H5HLprivate.h b/src/H5HLprivate.h index 8679bee..0b044b6 100644 --- a/src/H5HLprivate.h +++ b/src/H5HLprivate.h @@ -44,7 +44,7 @@ # undef H5HL_DEBUG #endif -#define H5HL_ALIGN(X) (((X)+7)&(unsigned)(~0x07)) /*align on 8-byte boundary */ +#define H5HL_ALIGN(X) ((((unsigned)X)+7)&(unsigned)(~0x07)) /*align on 8-byte boundary */ #define H5HL_SIZEOF_FREE(F) \ H5HL_ALIGN(H5F_SIZEOF_SIZE (F) + /*ptr to next free block */ \ diff --git a/src/H5HP.c b/src/H5HP.c index ad76817..335fde2 100644 --- a/src/H5HP.c +++ b/src/H5HP.c @@ -88,7 +88,7 @@ H5HP_swim_max(H5HP_t *heap, size_t loc) H5HP_info_t *obj; /* Temporary pointer to object to move in heap */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HP_swim_max); + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Get copies of the information about the object to move in the heap */ val=heap->heap[loc].val; @@ -146,7 +146,7 @@ H5HP_swim_min(H5HP_t *heap, size_t loc) H5HP_info_t *obj; /* Temporary pointer to object to move in heap */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HP_swim_min); + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Get copies of the information about the object to move in the heap */ val=heap->heap[loc].val; @@ -204,7 +204,7 @@ H5HP_sink_max(H5HP_t *heap, size_t loc) void *obj; /* Temporary pointer to object to move in heap */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HP_sink_max); + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Get copies of the information about the object to move in the heap */ val=heap->heap[loc].val; @@ -273,7 +273,7 @@ H5HP_sink_min(H5HP_t *heap, size_t loc) void *obj; /* Temporary pointer to object to move in heap */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HP_sink_min); + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Get copies of the information about the object to move in the heap */ val=heap->heap[loc].val; @@ -339,7 +339,7 @@ H5HP_create(H5HP_type_t heap_type) H5HP_t *new_heap=NULL; /* Pointer to new heap object created */ H5HP_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5HP_create,NULL); + FUNC_ENTER_NOAPI(NULL) /* Check args */ assert(heap_type==H5HP_MIN_HEAP || heap_type==H5HP_MAX_HEAP); @@ -413,7 +413,7 @@ H5HP_count(const H5HP_t *heap) { ssize_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOFUNC(H5HP_count); + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ assert(heap); @@ -460,7 +460,7 @@ H5HP_insert(H5HP_t *heap, int val, void *obj) { herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5HP_insert,FAIL); + FUNC_ENTER_NOAPI(FAIL) /* Check args */ assert(heap); @@ -539,7 +539,7 @@ done: herr_t H5HP_top(const H5HP_t *heap, int *val) { - FUNC_ENTER_NOAPI_NOFUNC(H5HP_top); + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ assert(heap); @@ -586,7 +586,7 @@ H5HP_remove(H5HP_t *heap, int *val, void **obj) { herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5HP_remove,FAIL); + FUNC_ENTER_NOAPI(FAIL) /* Check args */ assert(heap); @@ -672,7 +672,7 @@ H5HP_change(H5HP_t *heap, int val, void *_obj) int old_val; /* Object's old priority value */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5HP_change,FAIL); + FUNC_ENTER_NOAPI(FAIL) /* Check args */ assert(heap); @@ -757,7 +757,7 @@ H5HP_incr(H5HP_t *heap, unsigned amt, void *_obj) size_t obj_loc; /* Location of object in heap */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5HP_incr,FAIL); + FUNC_ENTER_NOAPI(FAIL) /* Check args */ assert(heap); @@ -829,7 +829,7 @@ H5HP_decr(H5HP_t *heap, unsigned amt, void *_obj) size_t obj_loc; /* Location of object in heap */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5HP_decr,FAIL); + FUNC_ENTER_NOAPI(FAIL) /* Check args */ assert(heap); @@ -896,7 +896,7 @@ done: herr_t H5HP_close(H5HP_t *heap) { - FUNC_ENTER_NOAPI_NOFUNC(H5HP_close) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(heap); diff --git a/src/H5I.c b/src/H5I.c index 31f0238..fb4ce5a 100644 --- a/src/H5I.c +++ b/src/H5I.c @@ -147,7 +147,7 @@ DESCRIPTION static herr_t H5I_init_interface(void) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5I_init_interface) + FUNC_ENTER_NOAPI_NOINIT_NOERR FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5I_init_interface() */ @@ -176,7 +176,7 @@ H5I_term_interface(void) H5I_type_t type; int n = 0; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5I_term_interface) + FUNC_ENTER_NOAPI_NOINIT_NOERR if(H5_interface_initialize_g) { /* How many types are still being used? */ @@ -228,7 +228,7 @@ H5Iregister_type(size_t hash_size, unsigned reserved, H5I_free_t free_func) { H5I_type_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Iregister_type, H5I_BADID) + FUNC_ENTER_API(H5I_BADID) H5TRACE3("It", "zIux", hash_size, reserved, free_func); /* Call H5I_register_type with a value of 0 to get a new type */ @@ -270,7 +270,7 @@ H5I_register_type(H5I_type_t type_id, size_t hash_size, unsigned reserved, H5I_id_type_t *type_ptr = NULL; /*ptr to the atomic type*/ H5I_type_t ret_value = H5I_BADID; /* type ID to return */ - FUNC_ENTER_NOAPI(H5I_register_type, H5I_BADID) + FUNC_ENTER_NOAPI(H5I_BADID) /* Check that type_id is either a library type or zero */ if(type_id < 0 || type_id >= H5I_NTYPES) @@ -371,7 +371,7 @@ H5Itype_exists(H5I_type_t type) { htri_t ret_value = TRUE; /* Return value */ - FUNC_ENTER_API(H5Itype_exists, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("t", "It", type); if(type <= H5I_BADID || type >= H5I_next_type) @@ -407,7 +407,7 @@ H5Inmembers(H5I_type_t type, hsize_t *num_members) { int ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Inmembers, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "It*h", type, num_members); if(H5I_IS_LIB_TYPE(type)) @@ -457,7 +457,7 @@ H5I_nmembers(H5I_type_t type) H5I_id_type_t *type_ptr = NULL; int ret_value; - FUNC_ENTER_NOAPI(H5I_nmembers, FAIL) + FUNC_ENTER_NOAPI(FAIL) if(type <= H5I_BADID || type >= H5I_next_type) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid type number") @@ -493,7 +493,7 @@ H5Iclear_type(H5I_type_t type, hbool_t force) { herr_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Iclear_type, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "Itb", type, force); if(H5I_IS_LIB_TYPE(type)) @@ -546,7 +546,7 @@ H5I_clear_type(H5I_type_t type, hbool_t force, hbool_t app_ref) unsigned i; /* Local index variable */ int ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5I_clear_type, FAIL) + FUNC_ENTER_NOAPI(FAIL) if(type <= H5I_BADID || type >= H5I_next_type) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid type number") @@ -673,7 +673,7 @@ H5Idestroy_type(H5I_type_t type) { herr_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Idestroy_type, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("e", "It", type); if(H5I_IS_LIB_TYPE(type)) @@ -707,7 +707,7 @@ H5I_destroy_type(H5I_type_t type) H5I_id_type_t *type_ptr; /* ptr to the atomic type */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5I_destroy_type, FAIL) + FUNC_ENTER_NOAPI(FAIL) if(type <= H5I_BADID || type >= H5I_next_type) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid type number") @@ -748,7 +748,7 @@ H5Iregister(H5I_type_t type, const void *object) { hid_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Iregister, H5I_INVALID_HID) + FUNC_ENTER_API(H5I_INVALID_HID) H5TRACE2("i", "It*x", type, object); if(H5I_IS_LIB_TYPE(type)) @@ -798,7 +798,7 @@ H5I_register(H5I_type_t type, const void *object, hbool_t app_ref) unsigned i; /*counter */ hid_t ret_value = SUCCEED; /*return value */ - FUNC_ENTER_NOAPI(H5I_register, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check arguments */ if(type <= H5I_BADID || type >= H5I_next_type) @@ -911,7 +911,7 @@ H5I_register_with_id(H5I_type_t type, const void *object, hbool_t app_ref, hid_t unsigned hash_loc; /*new item's hash table location*/ hid_t ret_value = SUCCEED; /*return value */ - FUNC_ENTER_NOAPI(H5I_register_with_id, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check arguments */ @@ -980,7 +980,7 @@ H5I_subst(hid_t id, const void *new_object) H5I_id_info_t *id_ptr; /* Ptr to the atom */ void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5I_subst, NULL) + FUNC_ENTER_NOAPI(NULL) /* General lookup of the ID */ if(NULL == (id_ptr = H5I_find_id(id))) @@ -1017,7 +1017,7 @@ H5I_object(hid_t id) H5I_id_info_t *id_ptr; /*ptr to the new atom */ void *ret_value = NULL; /*return value */ - FUNC_ENTER_NOAPI(H5I_object, NULL) + FUNC_ENTER_NOAPI(NULL) /* General lookup of the ID */ if(NULL != (id_ptr = H5I_find_id(id))) { @@ -1053,7 +1053,7 @@ H5Iobject_verify(hid_t id, H5I_type_t id_type) { void * ret_value; /* Return value */ - FUNC_ENTER_API(H5Iobject_verify, NULL) + FUNC_ENTER_API(NULL) if(H5I_IS_LIB_TYPE(id_type)) HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, NULL, "cannot call public function on library type") @@ -1089,7 +1089,7 @@ H5I_object_verify(hid_t id, H5I_type_t id_type) H5I_id_info_t *id_ptr = NULL; /*ptr to the new atom */ void *ret_value = NULL; /*return value */ - FUNC_ENTER_NOAPI(H5I_object_verify, NULL) + FUNC_ENTER_NOAPI(NULL) HDassert(id_type >= 1 && id_type < H5I_next_type); @@ -1126,7 +1126,7 @@ H5I_get_type(hid_t id) { H5I_type_t ret_value = H5I_BADID; - FUNC_ENTER_NOAPI(H5I_get_type, H5I_BADID) + FUNC_ENTER_NOAPI(H5I_BADID) if(id > 0) ret_value = H5I_TYPE(id); @@ -1158,7 +1158,7 @@ H5Iget_type(hid_t id) { H5I_type_t ret_value = H5I_BADID; /* Return value */ - FUNC_ENTER_API(H5Iget_type, H5I_BADID) + FUNC_ENTER_API(H5I_BADID) H5TRACE1("It", "i", id); ret_value = H5I_get_type(id); @@ -1193,7 +1193,7 @@ H5Iremove_verify(hid_t id, H5I_type_t id_type) { void * ret_value; /* Return value */ - FUNC_ENTER_API(H5Iremove_verify, NULL) + FUNC_ENTER_API(NULL) if(H5I_IS_LIB_TYPE(id_type)) HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, NULL, "cannot call public function on library type") @@ -1227,7 +1227,7 @@ H5I_remove_verify(hid_t id, H5I_type_t id_type) { void * ret_value = NULL; /*return value */ - FUNC_ENTER_NOAPI(H5I_remove_verify, NULL) + FUNC_ENTER_NOAPI(NULL) /* Argument checking will be performed by H5I_remove() */ @@ -1265,7 +1265,7 @@ H5I_remove(hid_t id) unsigned hash_loc; /*atom's hash table location */ void * ret_value = NULL; /*return value */ - FUNC_ENTER_NOAPI(H5I_remove, NULL) + FUNC_ENTER_NOAPI(NULL) /* Check arguments */ type = H5I_TYPE(id); @@ -1332,7 +1332,7 @@ H5Idec_ref(hid_t id) { int ret_value; /* Return value */ - FUNC_ENTER_API(H5Idec_ref, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("Is", "i", id); /* Check arguments */ @@ -1373,7 +1373,7 @@ H5I_dec_ref(hid_t id) H5I_id_info_t *id_ptr; /*ptr to the new ID */ int ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5I_dec_ref, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ HDassert(id >= 0); @@ -1444,7 +1444,7 @@ H5I_dec_app_ref(hid_t id) H5I_id_info_t *id_ptr; /*ptr to the new ID */ int ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5I_dec_app_ref, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ HDassert(id >= 0); @@ -1491,7 +1491,7 @@ H5I_dec_app_ref_always_close(hid_t id) { int ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5I_dec_app_ref_always_close, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ HDassert(id >= 0); @@ -1535,7 +1535,7 @@ H5Iinc_ref(hid_t id) { int ret_value; /* Return value */ - FUNC_ENTER_API(H5Iinc_ref, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("Is", "i", id); /* Check arguments */ @@ -1579,7 +1579,7 @@ H5I_inc_ref(hid_t id, hbool_t app_ref) H5I_id_info_t *id_ptr; /*ptr to the ID */ int ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5I_inc_ref, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ HDassert(id >= 0); @@ -1627,7 +1627,7 @@ H5Iget_ref(hid_t id) { int ret_value; /* Return value */ - FUNC_ENTER_API(H5Iget_ref, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("Is", "i", id); /* Check arguments */ @@ -1671,7 +1671,7 @@ H5I_get_ref(hid_t id, hbool_t app_ref) H5I_id_info_t *id_ptr; /*ptr to the ID */ int ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5I_get_ref, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ HDassert(id >= 0); @@ -1715,7 +1715,7 @@ H5Iinc_type_ref(H5I_type_t type) { int ret_value; /* Return value */ - FUNC_ENTER_API(H5Iinc_type_ref, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("Is", "It", type); /* Check arguments */ @@ -1754,7 +1754,7 @@ H5I_inc_type_ref(H5I_type_t type) H5I_id_type_t *type_ptr; /* ptr to the type */ int ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5I_inc_type_ref, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ HDassert(type > 0 && type < H5I_next_type); @@ -1799,7 +1799,7 @@ H5Idec_type_ref(H5I_type_t type) { herr_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Idec_type_ref, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("e", "It", type); if(H5I_IS_LIB_TYPE(type)) @@ -1838,7 +1838,7 @@ H5I_dec_type_ref(H5I_type_t type) H5I_id_type_t *type_ptr; /* Pointer to the ID type */ herr_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5I_dec_type_ref, FAIL) + FUNC_ENTER_NOAPI(FAIL) if(type <= H5I_BADID || type >= H5I_next_type) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid type number") @@ -1886,7 +1886,7 @@ H5Iget_type_ref(H5I_type_t type) { int ret_value; /* Return value */ - FUNC_ENTER_API(H5Iget_type_ref, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("Is", "It", type); /* Check arguments */ @@ -1926,7 +1926,7 @@ H5I_get_type_ref(H5I_type_t type) H5I_id_type_t *type_ptr; /*ptr to the type */ int ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5I_get_type_ref, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ HDassert(type >= 0); @@ -1965,7 +1965,7 @@ H5Iis_valid(hid_t id) H5I_id_info_t *id_ptr; /* ptr to the ID */ htri_t ret_value = TRUE; /* Return value */ - FUNC_ENTER_API(H5Iis_valid, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("t", "i", id); /* Find the ID */ @@ -2010,7 +2010,7 @@ H5Isearch(H5I_type_t type, H5I_search_func_t func, void *key) { void * ret_value; /* Return value */ - FUNC_ENTER_API(H5Isearch, NULL) + FUNC_ENTER_API(NULL) if(H5I_IS_LIB_TYPE(type)) HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, NULL, "cannot call public function on library type") @@ -2055,7 +2055,7 @@ H5I_search(H5I_type_t type, H5I_search_func_t func, void *key, hbool_t app_ref) H5I_id_type_t *type_ptr; /*ptr to the type */ void *ret_value = NULL; /*return value */ - FUNC_ENTER_NOAPI(H5I_search, NULL) + FUNC_ENTER_NOAPI(NULL) /* Check arguments */ if(type <= H5I_BADID || type >= H5I_next_type) @@ -2113,7 +2113,7 @@ H5I_find_id(hid_t id) unsigned hash_loc; /*bucket pointer */ H5I_id_info_t *ret_value; /*return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5I_find_id) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments */ type = H5I_TYPE(id); @@ -2183,7 +2183,7 @@ H5Iget_name(hid_t id, char *name/*out*/, size_t size) H5G_loc_t loc; /* Object location */ ssize_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Iget_name, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("Zs", "ixz", id, name, size); /* Get object location */ @@ -2219,7 +2219,7 @@ H5Iget_file_id(hid_t obj_id) { hid_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Iget_file_id, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("i", "i", obj_id); if((ret_value = H5I_get_file_id(obj_id, TRUE)) < 0) @@ -2250,7 +2250,7 @@ H5I_get_file_id(hid_t obj_id, hbool_t app_ref) H5I_type_t type; /* ID type */ hid_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5I_get_file_id) + FUNC_ENTER_NOAPI_NOINIT /* Get object type */ type = H5I_TYPE(obj_id); @@ -2305,7 +2305,7 @@ H5I_debug(H5I_type_t type) unsigned int iu; herr_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5I_debug, FAIL) + FUNC_ENTER_NOAPI(FAIL) fprintf(stderr, "Dumping ID type %d\n", (int)type); type_ptr = H5I_id_type_list_g[type]; diff --git a/src/H5Itest.c b/src/H5Itest.c index 1c6892d..5236e8d 100644 --- a/src/H5Itest.c +++ b/src/H5Itest.c @@ -82,7 +82,7 @@ H5I_get_name_test(hid_t id, char *name/*out*/, size_t size, hbool_t *cached) H5G_loc_t loc; /* Object location */ ssize_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5I_get_name_test, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Get object location */ if(H5G_loc(id, &loc) < 0) diff --git a/src/H5L.c b/src/H5L.c index 2a9d591..86a2e80 100644 --- a/src/H5L.c +++ b/src/H5L.c @@ -17,8 +17,6 @@ /* Module Setup */ /****************/ -#define H5F_PACKAGE /*suppress error about including H5Fpkg */ -#define H5G_PACKAGE /*suppress error about including H5Gpkg */ #define H5L_PACKAGE /*suppress error about including H5Lpkg */ /* Interface initialization */ @@ -31,8 +29,8 @@ #include "H5ACprivate.h" /* Metadata cache */ #include "H5Dprivate.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ -#include "H5Gpkg.h" /* Groups */ -#include "H5Fpkg.h" /* File access */ +#include "H5Fprivate.h" /* File access */ +#include "H5Gprivate.h" /* Groups */ #include "H5Iprivate.h" /* IDs */ #include "H5Lpkg.h" /* Links */ #include "H5MMprivate.h" /* Memory management */ @@ -228,7 +226,7 @@ H5L_init(void) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5L_init, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* FUNC_ENTER() does all the work */ done: @@ -253,7 +251,7 @@ H5L_init_interface(void) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5L_init_interface) + FUNC_ENTER_NOAPI_NOINIT /* Initialize user-defined link classes */ if(H5L_register_external() < 0) @@ -281,7 +279,7 @@ H5L_term_interface(void) { int n = 0; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5L_term_interface) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Free the table of link types */ H5L_table_g = (H5L_class_t *)H5MM_xfree(H5L_table_g); @@ -319,7 +317,7 @@ H5Lmove(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, H5G_loc_t dst_loc, *dst_loc_p; herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Lmove, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE6("e", "i*si*sii", src_loc_id, src_name, dst_loc_id, dst_name, lcpl_id, lapl_id); @@ -377,7 +375,7 @@ H5Lcopy(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, H5G_loc_t dst_loc, *dst_loc_p; herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Lcopy, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE6("e", "i*si*sii", src_loc_id, src_name, dst_loc_id, dst_name, lcpl_id, lapl_id); @@ -438,7 +436,7 @@ H5Lcreate_soft(const char *link_target, H5G_loc_t link_loc; /* Group location for new link */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Lcreate_soft, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE5("e", "*si*sii", link_target, link_loc_id, link_name, lcpl_id, lapl_id); /* Check arguments */ @@ -484,7 +482,7 @@ H5Lcreate_hard(hid_t cur_loc_id, const char *cur_name, H5G_loc_t new_loc, *new_loc_p; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Lcreate_hard, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE6("e", "i*si*sii", cur_loc_id, cur_name, new_loc_id, new_name, lcpl_id, lapl_id); @@ -553,7 +551,7 @@ H5Lcreate_ud(hid_t link_loc_id, const char *link_name, H5L_type_t link_type, H5G_loc_t link_loc; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Lcreate_ud, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE7("e", "i*sLl*xzii", link_loc_id, link_name, link_type, udata, udata_size, lcpl_id, lapl_id); @@ -597,7 +595,7 @@ H5Ldelete(hid_t loc_id, const char *name, hid_t lapl_id) H5G_loc_t loc; /* Group's location */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Ldelete, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("e", "i*si", loc_id, name, lapl_id); /* Check arguments */ @@ -642,7 +640,7 @@ H5Ldelete_by_idx(hid_t loc_id, const char *group_name, H5L_trav_rmbi_t udata; /* User data for callback */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Ldelete_by_idx, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE6("e", "i*sIiIohi", loc_id, group_name, idx_type, order, n, lapl_id); /* Check arguments */ @@ -701,7 +699,7 @@ H5Lget_val(hid_t loc_id, const char *name, void *buf/*out*/, size_t size, H5G_loc_t loc; /* Group location for location to query */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Lget_val, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE5("e", "i*sxzi", loc_id, name, buf, size, lapl_id); /* Check arguments */ @@ -751,7 +749,7 @@ H5Lget_val_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5L_trav_gvbi_t udata; /* User data for callback */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Lget_val_by_idx, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE8("e", "i*sIiIohxzi", loc_id, group_name, idx_type, order, n, buf, size, lapl_id); @@ -807,7 +805,7 @@ H5Lexists(hid_t loc_id, const char *name, hid_t lapl_id) H5G_loc_t loc; htri_t ret_value; - FUNC_ENTER_API(H5Lexists, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("t", "i*si", loc_id, name, lapl_id); /* Check arguments */ @@ -851,7 +849,7 @@ H5Lget_info(hid_t loc_id, const char *name, H5L_info_t *linfo /*out*/, H5G_loc_t loc; herr_t ret_value = SUCCEED; - FUNC_ENTER_API(H5Lget_info, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE4("e", "i*sxi", loc_id, name, linfo, lapl_id); /* Check arguments */ @@ -897,7 +895,7 @@ H5Lget_info_by_idx(hid_t loc_id, const char *group_name, H5L_trav_gibi_t udata; /* User data for callback */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Lget_info_by_idx, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE7("e", "i*sIiIohxi", loc_id, group_name, idx_type, order, n, linfo, lapl_id); @@ -957,7 +955,7 @@ H5Lregister(const H5L_class_t *cls) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Lregister, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("e", "*x", cls); /* Check args */ @@ -1004,7 +1002,7 @@ H5Lunregister(H5L_type_t id) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Lunregister, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("e", "Ll", id); /* Check args */ @@ -1041,7 +1039,7 @@ H5Lis_registered(H5L_type_t id) size_t i; /* Local index variable */ htri_t ret_value = FALSE; /* Return value */ - FUNC_ENTER_API(H5Lis_registered, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("t", "Ll", id); /* Check args */ @@ -1086,7 +1084,7 @@ H5Lget_name_by_idx(hid_t loc_id, const char *group_name, H5L_trav_gnbi_t udata; /* User data for callback */ ssize_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Lget_name_by_idx, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE8("Zs", "i*sIiIohxzi", loc_id, group_name, idx_type, order, n, name, size, lapl_id); @@ -1158,7 +1156,7 @@ H5Literate(hid_t grp_id, H5_index_t idx_type, H5_iter_order_t order, hsize_t idx; /* Internal location to hold index */ herr_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Literate, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE6("e", "iIiIo*hx*x", grp_id, idx_type, order, idx_p, op, op_data); /* Check arguments */ @@ -1225,7 +1223,7 @@ H5Literate_by_name(hid_t loc_id, const char *group_name, hsize_t idx; /* Internal location to hold index */ herr_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Literate_by_name, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE8("e", "i*sIiIo*hx*xi", loc_id, group_name, idx_type, order, idx_p, op, op_data, lapl_id); @@ -1300,7 +1298,7 @@ H5Lvisit(hid_t grp_id, H5_index_t idx_type, H5_iter_order_t order, H5I_type_t id_type; /* Type of ID */ herr_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Lvisit, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE5("e", "iIiIox*x", grp_id, idx_type, order, op, op_data); /* Check args */ @@ -1357,7 +1355,7 @@ H5Lvisit_by_name(hid_t loc_id, const char *group_name, H5_index_t idx_type, { herr_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Lvisit_by_name, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE7("e", "i*sIiIox*xi", loc_id, group_name, idx_type, order, op, op_data, lapl_id); @@ -1414,7 +1412,7 @@ H5L_find_class_idx(H5L_type_t id) size_t i; /* Local index variable */ int ret_value = FAIL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5L_find_class_idx) + FUNC_ENTER_NOAPI_NOINIT_NOERR for(i = 0; i < H5L_table_used_g; i++) if(H5L_table_g[i].id == id) @@ -1445,7 +1443,7 @@ H5L_find_class(H5L_type_t id) int idx; /* Filter index in global table */ H5L_class_t *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI(H5L_find_class, NULL) + FUNC_ENTER_NOAPI(NULL) /* Get the index in the global table */ if((idx = H5L_find_class_idx(id)) < 0) @@ -1480,7 +1478,7 @@ H5L_register(const H5L_class_t *cls) size_t i; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5L_register, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert(cls); HDassert(cls->id >= 0 && cls->id <= H5L_TYPE_MAX); @@ -1533,7 +1531,7 @@ H5L_unregister(H5L_type_t id) size_t i; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5L_unregister, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert(id >= 0 && id <= H5L_TYPE_MAX); @@ -1576,7 +1574,7 @@ H5L_link(const H5G_loc_t *new_loc, const char *new_name, H5G_loc_t *obj_loc, H5O_link_t lnk; /* Link to insert */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5L_link) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(new_loc); @@ -1620,7 +1618,7 @@ H5L_link_object(const H5G_loc_t *new_loc, const char *new_name, H5O_link_t lnk; /* Link to insert */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5L_link_object) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(new_loc); @@ -1668,7 +1666,7 @@ H5L_link_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t UNUSED hbool_t obj_created = FALSE; /* Whether an object was created (through a hard link) */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5L_link_cb) + FUNC_ENTER_NOAPI_NOINIT /* Check if the name in this group resolved to a valid location */ /* (which is not what we want) */ @@ -1697,7 +1695,7 @@ H5L_link_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t UNUSED } /* end if */ else { /* Check that both objects are in same file */ - if(grp_loc->oloc->file->shared != udata->file->shared) + if(!H5F_SAME_SHARED(grp_loc->oloc->file, udata->file)) HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "interfile hard links are not allowed") } /* end else */ } /* end if */ @@ -1776,7 +1774,7 @@ done: oloc.file = grp_loc->oloc->file; oloc.addr = udata->lnk->u.hard.addr; - /* Decrement refcount on superblock extension's object header in memory */ + /* Decrement refcount on new object's object header in memory */ if(H5O_dec_rc_by_loc(&oloc, udata->dxpl_id) < 0) HDONE_ERROR(H5E_LINK, H5E_CANTDEC, FAIL, "unable to decrement refcount on newly created object") } /* end if */ @@ -1831,7 +1829,7 @@ H5L_create_real(const H5G_loc_t *link_loc, const char *link_name, H5L_trav_cr_t udata; /* User data for callback */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5L_create_real) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(link_loc); @@ -1918,7 +1916,7 @@ H5L_create_hard(H5G_loc_t *cur_loc, const char *cur_name, hbool_t loc_valid = FALSE; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5L_create_hard, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args */ HDassert(cur_loc); @@ -1986,7 +1984,7 @@ H5L_create_soft(const char *target_path, const H5G_loc_t *link_loc, H5O_link_t lnk; /* Link to insert */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5L_create_soft, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args */ HDassert(link_loc); @@ -2035,7 +2033,7 @@ H5L_create_ud(const H5G_loc_t *link_loc, const char *link_name, H5O_link_t lnk; /* Link to insert */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5L_create_ud) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(type >= H5L_TYPE_UD_MIN && type <= H5L_TYPE_MAX); @@ -2090,7 +2088,7 @@ H5L_get_val_real(const H5O_link_t *lnk, void *buf, size_t size) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5L_get_val_real) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(lnk); @@ -2148,7 +2146,7 @@ H5L_get_val_cb(H5G_loc_t UNUSED *grp_loc/*in*/, const char *name, const H5O_link H5L_trav_gv_t *udata = (H5L_trav_gv_t *)_udata; /* User data passed in */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5L_get_val_cb) + FUNC_ENTER_NOAPI_NOINIT /* Check if the name in this group resolved to a valid link */ if(lnk == NULL) @@ -2193,7 +2191,7 @@ H5L_get_val(H5G_loc_t *loc, const char *name, void *buf/*out*/, size_t size, H5L_trav_gv_t udata; /* User data for callback */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5L_get_val, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ HDassert(loc); @@ -2235,7 +2233,7 @@ H5L_get_val_by_idx_cb(H5G_loc_t UNUSED *grp_loc/*in*/, const char UNUSED *name, hbool_t lnk_copied = FALSE; /* Whether the link was copied */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5L_get_val_by_idx_cb) + FUNC_ENTER_NOAPI_NOINIT /* Check if the name of the group resolved to a valid object */ if(obj_loc == NULL) @@ -2284,7 +2282,7 @@ H5L_delete_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t *lnk, H5L_trav_rm_t *udata = (H5L_trav_rm_t *)_udata; /* User data passed in */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT(H5L_delete_cb) + FUNC_ENTER_NOAPI_NOINIT /* Check if the group resolved to a valid link */ if(grp_loc == NULL) @@ -2330,7 +2328,7 @@ H5L_delete(H5G_loc_t *loc, const char *name, hid_t lapl_id, hid_t dxpl_id) char *norm_name = NULL; /* Pointer to normalized name */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5L_delete, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ HDassert(loc); @@ -2374,7 +2372,7 @@ H5L_delete_by_idx_cb(H5G_loc_t UNUSED *grp_loc/*in*/, const char UNUSED *name, H5L_trav_gvbi_t *udata = (H5L_trav_gvbi_t *)_udata; /* User data passed in */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(H5L_delete_by_idx_cb, udata->dxpl_id, obj_loc->oloc->addr, FAIL) + FUNC_ENTER_NOAPI_NOINIT_TAG(udata->dxpl_id, obj_loc->oloc->addr, FAIL) /* Check if the name of the group resolved to a valid object */ if(obj_loc == NULL) @@ -2420,7 +2418,7 @@ H5L_move_dest_cb(H5G_loc_t *grp_loc/*in*/, const char *name, hbool_t temp_loc_init = FALSE; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5L_move_dest_cb) + FUNC_ENTER_NOAPI_NOINIT /* Make sure an object with this name doesn't already exist */ if(obj_loc != NULL) @@ -2429,7 +2427,7 @@ H5L_move_dest_cb(H5G_loc_t *grp_loc/*in*/, const char *name, /* Check for crossing file boundaries with a new hard link */ if(udata->lnk->type == H5L_TYPE_HARD) { /* Check that both objects are in same file */ - if(grp_loc->oloc->file->shared != udata->file->shared) + if(!H5F_SAME_SHARED(grp_loc->oloc->file, udata->file)) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "moving a link across files is not allowed") } /* end if */ @@ -2532,7 +2530,7 @@ H5L_move_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t *lnk, hbool_t link_copied = FALSE; /* Has udata_out.lnk been allocated? */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5L_move_cb) + FUNC_ENTER_NOAPI_NOINIT /* Check if the name in this group resolved to a valid link */ if(obj_loc == NULL) @@ -2651,7 +2649,7 @@ H5L_move(H5G_loc_t *src_loc, const char *src_name, H5G_loc_t *dst_loc, hid_t lapl_copy; /* Copy of lapl for this function */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5L_move) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(src_loc); @@ -2729,7 +2727,7 @@ H5L_exists_cb(H5G_loc_t UNUSED *grp_loc/*in*/, const char UNUSED *name, { hbool_t *udata = (hbool_t *)_udata; /* User data passed in */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5L_exists_cb) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check if the name in this group resolved to a valid link */ *udata = (hbool_t)(lnk != NULL); @@ -2760,7 +2758,7 @@ H5L_exists(const H5G_loc_t *loc, const char *name, hid_t lapl_id, hid_t dxpl_id) hbool_t exists = FALSE; /* Whether the link exists in the group */ htri_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5L_exists) + FUNC_ENTER_NOAPI_NOINIT /* Traverse the group hierarchy to locate the object to get info about */ if(H5G_traverse(loc, name, H5G_TARGET_SLINK|H5G_TARGET_UDLINK, H5L_exists_cb, &exists, lapl_id, dxpl_id) < 0) @@ -2794,7 +2792,7 @@ H5L_get_info_cb(H5G_loc_t UNUSED *grp_loc/*in*/, const char UNUSED *name, H5L_trav_gi_t *udata = (H5L_trav_gi_t *)_udata; /* User data passed in */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5L_get_info_cb) + FUNC_ENTER_NOAPI_NOINIT /* Check if the name in this group resolved to a valid link */ if(lnk == NULL) @@ -2832,7 +2830,7 @@ H5L_get_info(const H5G_loc_t *loc, const char *name, H5L_trav_gi_t udata; /* User data for callback */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5L_get_info, FAIL) + FUNC_ENTER_NOAPI(FAIL) udata.linfo = linfo; udata.dxpl_id = dxpl_id; @@ -2869,7 +2867,7 @@ H5L_get_info_by_idx_cb(H5G_loc_t UNUSED *grp_loc/*in*/, const char UNUSED *name, hbool_t lnk_copied = FALSE; /* Whether the link was copied */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5L_get_info_by_idx_cb) + FUNC_ENTER_NOAPI_NOINIT /* Check if the name of the group resolved to a valid object */ if(obj_loc == NULL) @@ -2917,7 +2915,7 @@ H5L_get_default_lcpl(void) { hid_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5L_get_default_lcpl, FAIL) + FUNC_ENTER_NOAPI(FAIL) ret_value = H5P_LINK_CREATE_DEFAULT; @@ -2947,7 +2945,7 @@ H5L_get_name_by_idx_cb(H5G_loc_t UNUSED *grp_loc/*in*/, const char UNUSED *name, H5L_trav_gnbi_t *udata = (H5L_trav_gnbi_t *)_udata; /* User data passed in */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5L_get_name_by_idx_cb) + FUNC_ENTER_NOAPI_NOINIT /* Check if the name of the group resolved to a valid object */ if(obj_loc == NULL) @@ -2966,3 +2964,137 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5L_get_name_by_idx_cb() */ + +/*------------------------------------------------------------------------- + * Function: H5L_link_copy_file + * + * Purpose: Copy a link and the object it points to from one file to + * another. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * Sep 29 2006 + * + *------------------------------------------------------------------------- + */ +herr_t +H5L_link_copy_file(H5F_t *dst_file, hid_t dxpl_id, const H5O_link_t *_src_lnk, + const H5O_loc_t *src_oloc, H5O_link_t *dst_lnk, H5O_copy_t *cpy_info) +{ + H5O_link_t tmp_src_lnk; /* Temporary copy of src link, when needed */ + const H5O_link_t *src_lnk = _src_lnk; /* Source link */ + hbool_t dst_lnk_init = FALSE; /* Whether the destination link is initialized */ + hbool_t expanded_link_open = FALSE; /* Whether the target location has been opened */ + H5G_loc_t tmp_src_loc; /* Group location holding target object */ + H5G_name_t tmp_src_path; /* Path for target object */ + H5O_loc_t tmp_src_oloc; /* Object location for target object */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* check arguments */ + HDassert(dst_file); + HDassert(src_lnk); + HDassert(dst_lnk); + HDassert(cpy_info); + + /* Expand soft or external link, if requested */ + if((H5L_TYPE_SOFT == src_lnk->type && cpy_info->expand_soft_link) + || (H5L_TYPE_EXTERNAL == src_lnk->type + && cpy_info->expand_ext_link)) { + H5G_loc_t lnk_grp_loc; /* Group location holding link */ + H5G_name_t lnk_grp_path; /* Path for link */ + htri_t tar_exists; /* Whether the target object exists */ + + /* Set up group location for link */ + H5G_name_reset(&lnk_grp_path); + lnk_grp_loc.path = &lnk_grp_path; + lnk_grp_loc.oloc = (H5O_loc_t *)src_oloc; /* Casting away const OK -QAK */ + + /* Check if the target object exists */ + if((tar_exists = H5G_loc_exists(&lnk_grp_loc, src_lnk->name, H5P_DEFAULT, + dxpl_id)) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to check if target object exists") + + if(tar_exists) { + /* Make a temporary copy of the link, so that it will not change the + * info in the cache when we change it to a hard link */ + if(NULL == H5O_msg_copy(H5O_LINK_ID, src_lnk, &tmp_src_lnk)) + HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy message") + + /* Set up group location for target object. Let H5G_traverse expand + * the link. */ + tmp_src_loc.path = &tmp_src_path; + tmp_src_loc.oloc = &tmp_src_oloc; + if(H5G_loc_reset(&tmp_src_loc) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to reset location") + + /* Find the target object */ + if(H5G_loc_find(&lnk_grp_loc, src_lnk->name, &tmp_src_loc, + H5P_DEFAULT, dxpl_id) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to find target object") + expanded_link_open = TRUE; + + /* Convert symbolic link to hard link */ + if(tmp_src_lnk.type == H5L_TYPE_SOFT) + tmp_src_lnk.u.soft.name = + (char *)H5MM_xfree(tmp_src_lnk.u.soft.name); + else if(tmp_src_lnk.u.ud.size > 0) + tmp_src_lnk.u.ud.udata = H5MM_xfree(tmp_src_lnk.u.ud.udata); + tmp_src_lnk.type = H5L_TYPE_HARD; + tmp_src_lnk.u.hard.addr = tmp_src_oloc.addr; + src_lnk = &tmp_src_lnk; + } /* end if */ + } /* end if */ + + /* Copy src link information to dst link information */ + if(NULL == H5O_msg_copy(H5O_LINK_ID, src_lnk, dst_lnk)) + HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy message") + dst_lnk_init = TRUE; + + /* Check if object in source group is a hard link & copy it */ + if(H5L_TYPE_HARD == src_lnk->type) { + H5O_loc_t new_dst_oloc; /* Copied object location in destination */ + + /* Set up copied object location to fill in */ + H5O_loc_reset(&new_dst_oloc); + new_dst_oloc.file = dst_file; + + if(!expanded_link_open) { + /* Build temporary object location for source */ + H5O_loc_reset(&tmp_src_oloc); + tmp_src_oloc.file = src_oloc->file; + tmp_src_oloc.addr = src_lnk->u.hard.addr; + } /* end if */ + HDassert(H5F_addr_defined(tmp_src_oloc.addr)); + + /* Copy the shared object from source to destination */ + /* Don't care about obj_type or udata because those are only important + * for old style groups */ + if(H5O_copy_header_map(&tmp_src_oloc, &new_dst_oloc, dxpl_id, cpy_info, + TRUE, NULL, NULL) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy object") + + /* Copy new destination object's information for eventual insertion */ + dst_lnk->u.hard.addr = new_dst_oloc.addr; + } /* end if */ + +done: + /* Check if we used a temporary src link */ + if(src_lnk != _src_lnk) { + HDassert(src_lnk == &tmp_src_lnk); + H5O_msg_reset(H5O_LINK_ID, &tmp_src_lnk); + } /* end if */ + if(ret_value < 0) + if(dst_lnk_init) + H5O_msg_reset(H5O_LINK_ID, dst_lnk); + /* Check if we need to free the temp source oloc */ + if(expanded_link_open) + if(H5G_loc_free(&tmp_src_loc) < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to free object") + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5L_link_copy_file() */ + diff --git a/src/H5Lexternal.c b/src/H5Lexternal.c index 29ae754..365124d 100644 --- a/src/H5Lexternal.c +++ b/src/H5Lexternal.c @@ -74,7 +74,7 @@ DESCRIPTION static herr_t H5L_init_extern_interface(void) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5L_init_extern_interface) + FUNC_ENTER_NOAPI_NOINIT_NOERR FUNC_LEAVE_NOAPI(H5L_init()) } /* H5L_init_extern_interface() */ @@ -100,7 +100,7 @@ H5L_getenv_prefix_name(char **env_prefix/*in,out*/) char *retptr=NULL; char *strret=NULL; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5L_getenv_prefix_name) + FUNC_ENTER_NOAPI_NOINIT_NOERR strret = HDstrchr(*env_prefix, COLON_SEPC); if (strret == NULL) { @@ -135,7 +135,7 @@ H5L_build_name(char *prefix, char *file_name, char **full_name/*out*/) size_t fname_len; /* Length of external link file name */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5L_build_name) + FUNC_ENTER_NOAPI_NOINIT prefix_len = HDstrlen(prefix); fname_len = HDstrlen(file_name); @@ -146,10 +146,9 @@ H5L_build_name(char *prefix, char *file_name, char **full_name/*out*/) /* Copy the prefix into the buffer */ HDstrcpy(*full_name, prefix); -#ifndef H5_VMS + if (!CHECK_DELIMITER(prefix[prefix_len-1])) HDstrcat(*full_name, DIR_SEPS); -#endif /* Add the external link's filename to the prefix supplied */ HDstrcat(*full_name, file_name); @@ -219,7 +218,7 @@ H5L_extern_traverse(const char UNUSED *link_name, hid_t cur_group, H5F_close_degree_t fc_degree = H5F_CLOSE_WEAK; /* File close degree for target file */ hid_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5L_extern_traverse, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ HDassert(p); @@ -490,7 +489,7 @@ H5L_extern_query(const char UNUSED * link_name, const void *_udata, size_t udata const uint8_t *udata = (const uint8_t *)_udata; /* Pointer to external link buffer */ ssize_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5L_extern_query) + FUNC_ENTER_NOAPI_NOINIT /* Check external link version & flags */ if(((*udata >> 4) & 0x0F) != H5L_EXT_VERSION) @@ -547,7 +546,7 @@ H5Lcreate_external(const char *file_name, const char *obj_name, uint8_t *p; /* Pointer into external link buffer */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Lcreate_external, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE6("e", "*s*si*sii", file_name, obj_name, link_loc_id, link_name, lcpl_id, lapl_id); @@ -608,7 +607,7 @@ H5L_register_external(void) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5L_register_external, FAIL) + FUNC_ENTER_NOAPI(FAIL) if(H5L_register(H5L_EXTERN_LINK_CLASS) < 0) HGOTO_ERROR(H5E_LINK, H5E_NOTREGISTERED, FAIL, "unable to register external link class") @@ -651,7 +650,7 @@ H5Lunpack_elink_val(const void *_ext_linkval, size_t link_size, size_t len; /* Length of the filename in the linkval*/ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Lunpack_elink_val, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE5("e", "*xz*Iu**s**s", _ext_linkval, link_size, flags, filename, obj_path); diff --git a/src/H5Lpkg.h b/src/H5Lpkg.h index e02a871..2e931f5 100644 --- a/src/H5Lpkg.h +++ b/src/H5Lpkg.h @@ -56,6 +56,9 @@ H5_DLL herr_t H5L_create_ud(const H5G_loc_t *link_loc, const char *link_name, const void * ud_data, size_t ud_data_size, H5L_type_t type, hid_t lcpl_id, hid_t lapl_id, hid_t dxpl_id); +H5_DLL herr_t H5L_link_copy_file(H5F_t *dst_file, hid_t dxpl_id, + const H5O_link_t *_src_lnk, const H5O_loc_t *src_oloc, H5O_link_t *dst_lnk, + H5O_copy_t *cpy_info); #endif /* _H5Lpkg_H */ diff --git a/src/H5MF.c b/src/H5MF.c index a8f12bb..fce151e 100644 --- a/src/H5MF.c +++ b/src/H5MF.c @@ -123,7 +123,7 @@ H5MF_init_merge_flags(H5F_t *f) hbool_t all_same; /* Whether all the types map to the same value */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5MF_init_merge_flags, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* check args */ HDassert(f); @@ -232,7 +232,7 @@ H5MF_alloc_open(H5F_t *f, hid_t dxpl_id, H5FD_mem_t type) H5MF_FSPACE_SECT_CLS_SIMPLE}; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5MF_alloc_open) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -279,7 +279,7 @@ H5MF_alloc_create(H5F_t *f, hid_t dxpl_id, H5FD_mem_t type) herr_t ret_value = SUCCEED; /* Return value */ H5FS_create_t fs_create; /* Free space creation parameters */ - FUNC_ENTER_NOAPI_NOINIT(H5MF_alloc_create) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -329,7 +329,7 @@ H5MF_alloc_start(H5F_t *f, hid_t dxpl_id, H5FD_mem_t type) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5MF_alloc_start) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -371,7 +371,7 @@ H5MF_alloc_close(H5F_t *f, hid_t dxpl_id, H5FD_mem_t type) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5MF_alloc_close) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -415,7 +415,7 @@ H5MF_alloc(H5F_t *f, H5FD_mem_t alloc_type, hid_t dxpl_id, hsize_t size) H5FD_mem_t fs_type; /* Free space type (mapped from allocation type) */ haddr_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5MF_alloc, HADDR_UNDEF) + FUNC_ENTER_NOAPI(HADDR_UNDEF) #ifdef H5MF_ALLOC_DEBUG HDfprintf(stderr, "%s: alloc_type = %u, size = %Hu\n", FUNC, (unsigned)alloc_type, size); #endif /* H5MF_ALLOC_DEBUG */ @@ -541,7 +541,7 @@ H5MF_alloc_tmp(H5F_t *f, hsize_t size) haddr_t eoa; /* End of allocated space in the file */ haddr_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5MF_alloc_tmp, HADDR_UNDEF) + FUNC_ENTER_NOAPI(HADDR_UNDEF) #ifdef H5MF_ALLOC_DEBUG HDfprintf(stderr, "%s: size = %Hu\n", FUNC, size); #endif /* H5MF_ALLOC_DEBUG */ @@ -594,7 +594,7 @@ H5MF_xfree(H5F_t *f, H5FD_mem_t alloc_type, hid_t dxpl_id, haddr_t addr, H5FD_mem_t fs_type; /* Free space type (mapped from allocation type) */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5MF_xfree, FAIL) + FUNC_ENTER_NOAPI(FAIL) #ifdef H5MF_ALLOC_DEBUG HDfprintf(stderr, "%s: Entering - alloc_type = %u, addr = %a, size = %Hu\n", FUNC, (unsigned)alloc_type, addr, size); #endif /* H5MF_ALLOC_DEBUG */ @@ -746,7 +746,7 @@ H5MF_try_extend(H5F_t *f, hid_t dxpl_id, H5FD_mem_t alloc_type, haddr_t addr, haddr_t end; /* End of block to extend */ htri_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5MF_try_extend, FAIL) + FUNC_ENTER_NOAPI(FAIL) #ifdef H5MF_ALLOC_DEBUG HDfprintf(stderr, "%s: Entering: alloc_type = %u, addr = %a, size = %Hu, extra_requested = %Hu\n", FUNC, (unsigned)alloc_type, addr, size, extra_requested); #endif /* H5MF_ALLOC_DEBUG */ @@ -824,7 +824,7 @@ H5MF_get_freespace(H5F_t *f, hid_t dxpl_id, hsize_t *tot_space, hsize_t *meta_si H5FD_mem_t type; /* Memory type for iteration */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5MF_get_freespace, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* check args */ HDassert(f); @@ -926,7 +926,7 @@ H5MF_try_shrink(H5F_t *f, H5FD_mem_t alloc_type, hid_t dxpl_id, haddr_t addr, H5MF_sect_ud_t udata; /* User data for callback */ htri_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5MF_try_shrink, FAIL) + FUNC_ENTER_NOAPI(FAIL) #ifdef H5MF_ALLOC_DEBUG HDfprintf(stderr, "%s: Entering - alloc_type = %u, addr = %a, size = %Hu\n", FUNC, (unsigned)alloc_type, addr, size); #endif /* H5MF_ALLOC_DEBUG */ @@ -987,7 +987,7 @@ H5MF_close(H5F_t *f, hid_t dxpl_id) H5FD_mem_t type; /* Memory type for iteration */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5MF_close, FAIL) + FUNC_ENTER_NOAPI(FAIL) #ifdef H5MF_ALLOC_DEBUG HDfprintf(stderr, "%s: Entering\n", FUNC); #endif /* H5MF_ALLOC_DEBUG */ @@ -1177,7 +1177,7 @@ H5MF_sects_cb(const H5FS_section_info_t *_sect, void *_udata) const H5MF_free_section_t *sect = (const H5MF_free_section_t *)_sect; H5MF_sect_iter_ud_t *udata = (H5MF_sect_iter_ud_t *)_udata; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5MF_sects_cb) + FUNC_ENTER_NOAPI_NOINIT_NOERR if(udata->sect_idx < udata->sect_count) { udata->sects[udata->sect_idx].addr = sect->sect_info.addr; @@ -1212,7 +1212,7 @@ H5MF_get_free_sections(H5F_t *f, hid_t dxpl_id, H5FD_mem_t type, size_t nsects, H5FD_mem_t ty; /* Memory type for iteration */ ssize_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5MF_get_free_sections, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* check args */ HDassert(f); diff --git a/src/H5MFaggr.c b/src/H5MFaggr.c index 9936c3b..05a9241 100644 --- a/src/H5MFaggr.c +++ b/src/H5MFaggr.c @@ -34,7 +34,7 @@ /***********/ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ -#include "H5Fpkg.h" /* File access */ +#include "H5Fpkg.h" /* File access */ #include "H5MFpkg.h" /* File memory management */ @@ -96,7 +96,7 @@ H5MF_aggr_vfd_alloc(H5F_t *f, H5FD_mem_t alloc_type, hid_t dxpl_id, hsize_t size { haddr_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5MF_aggr_vfd_alloc, HADDR_UNDEF) + FUNC_ENTER_NOAPI(HADDR_UNDEF) #ifdef H5MF_ALLOC_DEBUG HDfprintf(stderr, "%s: alloc_type = %u, size = %Hu\n", FUNC, (unsigned)alloc_type, size); #endif /* H5MF_ALLOC_DEBUG */ @@ -157,7 +157,7 @@ H5MF_aggr_alloc(H5F_t *f, hid_t dxpl_id, H5F_blk_aggr_t *aggr, haddr_t eoa = HADDR_UNDEF; /* Initial EOA for the file */ haddr_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5MF_aggr_alloc, HADDR_UNDEF) + FUNC_ENTER_NOAPI(HADDR_UNDEF) #ifdef H5MF_AGGR_DEBUG HDfprintf(stderr, "%s: type = %u, size = %Hu\n", FUNC, (unsigned)type, size); #endif /* H5MF_AGGR_DEBUG */ @@ -379,7 +379,7 @@ H5MF_aggr_try_extend(H5F_t *f, H5F_blk_aggr_t *aggr, H5FD_mem_t type, { htri_t ret_value = FALSE; /* Return value */ - FUNC_ENTER_NOAPI(H5MF_aggr_try_extend, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args */ HDassert(f); @@ -446,7 +446,7 @@ H5MF_aggr_can_absorb(const H5F_t *f, const H5F_blk_aggr_t *aggr, { htri_t ret_value = FALSE; /* Return value */ - FUNC_ENTER_NOAPI_NOFUNC(H5MF_aggr_can_absorb) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(f); @@ -497,7 +497,7 @@ herr_t H5MF_aggr_absorb(const H5F_t UNUSED *f, H5F_blk_aggr_t *aggr, H5MF_free_section_t *sect, hbool_t allow_sect_absorb) { - FUNC_ENTER_NOAPI_NOFUNC(H5MF_aggr_absorb) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(f); @@ -583,7 +583,7 @@ herr_t H5MF_aggr_query(const H5F_t *f, const H5F_blk_aggr_t *aggr, haddr_t *addr, hsize_t *size) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5MF_aggr_query) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(f); @@ -619,7 +619,7 @@ H5MF_aggr_reset(H5F_t *f, hid_t dxpl_id, H5F_blk_aggr_t *aggr) H5FD_mem_t alloc_type; /* Type of file memory to work with */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5MF_aggr_reset) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(f); @@ -682,7 +682,7 @@ H5MF_free_aggrs(H5F_t *f, hid_t dxpl_id) hsize_t sda_size = 0; /* Size of "small data aggregator" */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5MF_free_aggrs, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args */ HDassert(f); diff --git a/src/H5MFdbg.c b/src/H5MFdbg.c index 31cff15..bdc811f 100644 --- a/src/H5MFdbg.c +++ b/src/H5MFdbg.c @@ -105,7 +105,7 @@ H5MF_sects_debug_cb(const H5FS_section_info_t *_sect, void *_udata) H5MF_debug_iter_ud_t *udata = (H5MF_debug_iter_ud_t *)_udata; /* User data for callbacks */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5MF_sects_debug_cb) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -158,7 +158,7 @@ H5MF_sects_debug(H5F_t *f, hid_t dxpl_id, haddr_t fs_addr, FILE *stream, int ind herr_t ret_value = SUCCEED; /* Return value */ H5FD_mem_t type; /* Memory type for iteration */ - FUNC_ENTER_NOAPI(H5MF_sects_debug, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* * Check arguments. @@ -226,7 +226,7 @@ H5MF_sects_dump(H5F_t *f, hid_t dxpl_id, FILE *stream) int fwidth = 50; /* Field width */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5MF_sects_dump, FAIL) + FUNC_ENTER_NOAPI(FAIL) #ifdef H5MF_ALLOC_DEBUG HDfprintf(stderr, "%s: Dumping file free space sections\n", FUNC); #endif /* H5MF_ALLOC_DEBUG */ diff --git a/src/H5MFsection.c b/src/H5MFsection.c index 3f011ec..89b2219 100644 --- a/src/H5MFsection.c +++ b/src/H5MFsection.c @@ -134,7 +134,7 @@ H5MF_sect_simple_new(haddr_t sect_off, hsize_t sect_size) H5MF_free_section_t *sect = NULL; /* 'Simple' free space section to add */ H5MF_free_section_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5MF_sect_simple_new) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments. */ HDassert(sect_size); @@ -180,7 +180,7 @@ H5MF_sect_simple_deserialize(const H5FS_section_class_t UNUSED *cls, H5MF_free_section_t *sect; /* New section */ H5FS_section_info_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5MF_sect_simple_deserialize) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments. */ HDassert(H5F_addr_defined(sect_addr)); @@ -221,7 +221,7 @@ H5MF_sect_simple_can_merge(const H5FS_section_info_t *_sect1, const H5MF_free_section_t *sect2 = (const H5MF_free_section_t *)_sect2; /* File free section */ htri_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5MF_sect_simple_can_merge) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments. */ HDassert(sect1); @@ -259,7 +259,7 @@ H5MF_sect_simple_merge(H5FS_section_info_t *_sect1, H5FS_section_info_t *_sect2, H5MF_free_section_t *sect2 = (H5MF_free_section_t *)_sect2; /* File free section */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5MF_sect_simple_merge) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments. */ HDassert(sect1); @@ -302,7 +302,7 @@ H5MF_sect_simple_can_shrink(const H5FS_section_info_t *_sect, void *_udata) haddr_t end; /* End of section to extend */ htri_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5MF_sect_simple_can_shrink) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments. */ HDassert(sect); @@ -395,7 +395,7 @@ H5MF_sect_simple_shrink(H5FS_section_info_t **_sect, void *_udata) H5MF_sect_ud_t *udata = (H5MF_sect_ud_t *)_udata; /* User data for callback */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5MF_sect_simple_shrink) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments. */ HDassert(sect); @@ -453,7 +453,7 @@ H5MF_sect_simple_free(H5FS_section_info_t *_sect) { H5MF_free_section_t *sect = (H5MF_free_section_t *)_sect; /* File free section */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5MF_sect_simple_free) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments. */ HDassert(sect); @@ -490,7 +490,7 @@ H5MF_sect_simple_valid(const H5FS_section_class_t UNUSED *cls, const H5MF_free_section_t *sect = (const H5MF_free_section_t *)_sect; /* File free section */ #endif /* NDEBUG */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5MF_sect_simple_valid) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments. */ HDassert(sect); @@ -517,7 +517,7 @@ H5MF_sect_simple_split(H5FS_section_info_t *sect, hsize_t frag_size) { H5MF_free_section_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5MF_sect_simple_split) + FUNC_ENTER_NOAPI_NOINIT /* Allocate space for new section */ if(NULL == (ret_value = H5MF_sect_simple_new(sect->addr, frag_size))) diff --git a/src/H5MM.c b/src/H5MM.c index 1de4880..23ef9f9 100644 --- a/src/H5MM.c +++ b/src/H5MM.c @@ -56,8 +56,8 @@ void * H5MM_malloc(size_t size) { - /* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5MM_malloc); + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR assert(size); @@ -89,8 +89,8 @@ H5MM_malloc(size_t size) void * H5MM_calloc(size_t size) { - /* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5MM_calloc); + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR assert(size); @@ -110,7 +110,8 @@ H5MM_calloc(size_t size) * H5MM_realloc (NULL, 0) <==> NULL * * Return: Success: Ptr to new memory or NULL if the memory - * was freed. + * was freed or HDrealloc couldn't allocate + * memory. * * Failure: NULL * @@ -125,42 +126,37 @@ H5MM_realloc(void *mem, size_t size) { void *ret_value; - /* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5MM_realloc) + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR if(NULL == mem) { if(0 == size) - mem = NULL; + ret_value = NULL; else - mem = H5MM_malloc(size); + ret_value = H5MM_malloc(size); } /* end if */ else if(0 == size) - mem = H5MM_xfree(mem); + ret_value = H5MM_xfree(mem); else - mem = HDrealloc(mem, size); - - /* Set return value */ - ret_value = mem; + ret_value = HDrealloc(mem, size); FUNC_LEAVE_NOAPI(ret_value) } /* end H5MM_realloc() */ /*------------------------------------------------------------------------- - * Function: H5MM_xstrdup - * - * Purpose: Duplicates a string. If the string to be duplicated is the - * null pointer, then return null. If the string to be duplicated - * is the empty string then return a new empty string. + * Function: H5MM_xstrdup * - * Return: Success: Ptr to a new string (or null if no string). + * Purpose: Duplicates a string, including memory allocation. + * NULL is an acceptable value for the input string. * - * Failure: abort() + * Return: Success: Pointer to a new string (NULL if s is NULL). * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Jul 10 1997 + * Failure: abort() * + * Programmer: Robb Matzke + * matzke@llnl.gov + * Jul 10 1997 *------------------------------------------------------------------------- */ char * @@ -168,49 +164,48 @@ H5MM_xstrdup(const char *s) { char *ret_value = NULL; - /* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5MM_xstrdup) + FUNC_ENTER_NOAPI(NULL) if(s) { - ret_value = (char *)H5MM_malloc(HDstrlen(s) + 1); - HDassert(ret_value); + if(NULL == (ret_value = (char *)H5MM_malloc(HDstrlen(s) + 1))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") HDstrcpy(ret_value, s); } /* end if */ +done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5MM_xstrdup() */ /*------------------------------------------------------------------------- - * Function: H5MM_strdup + * Function: H5MM_strdup * - * Purpose: Duplicates a string. If the string to be duplicated is the - * null pointer, then return null. If the string to be duplicated - * is the empty string then return a new empty string. + * Purpose: Duplicates a string, including memory allocation. + * NULL is NOT an acceptable value for the input string. * - * Return: Success: Ptr to a new string (or null if no string). + * If the string to be duplicated is the NULL pointer, then + * an error will be raised. * - * Failure: abort() + * Return: Success: Pointer to a new string * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Jul 10 1997 - * - * Modifications: + * Failure: abort() * + * Programmer: Robb Matzke + * matzke@llnl.gov + * Jul 10 1997 *------------------------------------------------------------------------- */ char * H5MM_strdup(const char *s) { - char *ret_value; + char *ret_value; - FUNC_ENTER_NOAPI(H5MM_strdup, NULL) + FUNC_ENTER_NOAPI(NULL) if(!s) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "null string") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "null string") if(NULL == (ret_value = (char *)H5MM_malloc(HDstrlen(s) + 1))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") HDstrcpy(ret_value, s); done: @@ -240,8 +235,8 @@ done: void * H5MM_xfree(void *mem) { - /* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5MM_xfree); + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR if(mem) HDfree(mem); diff --git a/src/H5MP.c b/src/H5MP.c index b668d0c..4820b76 100644 --- a/src/H5MP.c +++ b/src/H5MP.c @@ -92,7 +92,7 @@ H5MP_create(size_t page_size, unsigned flags) H5MP_pool_t *mp = NULL; /* New memory pool header */ H5MP_pool_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5MP_create, NULL) + FUNC_ENTER_NOAPI(NULL) /* Allocate space for the pool header */ if(NULL == (mp = H5FL_MALLOC(H5MP_pool_t))) @@ -143,7 +143,7 @@ H5MP_new_page(H5MP_pool_t *mp, size_t page_size) H5MP_page_blk_t *first_blk; /* Pointer to first block in page */ H5MP_page_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5MP_new_page) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(mp); @@ -214,7 +214,7 @@ H5MP_malloc (H5MP_pool_t *mp, size_t request) size_t needed; /* Size requested, plus block header and alignment */ void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5MP_malloc, NULL) + FUNC_ENTER_NOAPI(NULL) /* Sanity check */ HDassert(mp); @@ -353,7 +353,7 @@ H5MP_free(H5MP_pool_t *mp, void *spc) H5MP_page_t *spc_page; /* Page containing block to free */ void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOFUNC(H5MP_free) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ HDassert(mp); @@ -438,7 +438,7 @@ H5MP_close(H5MP_pool_t *mp) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5MP_close, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Release memory for pool pages */ if(mp->first != NULL) { diff --git a/src/H5MPtest.c b/src/H5MPtest.c index 2232b94..ccbd140 100644 --- a/src/H5MPtest.c +++ b/src/H5MPtest.c @@ -51,7 +51,7 @@ herr_t H5MP_get_pool_free_size(const H5MP_pool_t *mp, size_t *free_size) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5MP_get_pool_free_size) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments. */ HDassert(mp); @@ -83,7 +83,7 @@ H5MP_get_pool_free_size(const H5MP_pool_t *mp, size_t *free_size) herr_t H5MP_get_pool_first_page(const H5MP_pool_t *mp, H5MP_page_t **page) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5MP_get_pool_first_page) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments. */ HDassert(mp); @@ -122,7 +122,7 @@ H5MP_pool_is_free_size_correct(const H5MP_pool_t *mp) size_t pool_free; /* Size of pages' free space */ htri_t ret_value = TRUE; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5MP_pool_is_free_size_correct) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments. */ HDassert(mp); @@ -191,7 +191,7 @@ done: herr_t H5MP_get_page_free_size(const H5MP_page_t *page, size_t *free_size) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5MP_get_page_free_size) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments. */ HDassert(page); @@ -223,7 +223,7 @@ H5MP_get_page_free_size(const H5MP_page_t *page, size_t *free_size) herr_t H5MP_get_page_next_page(const H5MP_page_t *page, H5MP_page_t **next_page) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5MP_get_page_next_page) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments. */ HDassert(page); diff --git a/src/H5O.c b/src/H5O.c index 22fb2df..5cefabc 100644 --- a/src/H5O.c +++ b/src/H5O.c @@ -28,7 +28,6 @@ /* Module Setup */ /****************/ -#define H5F_PACKAGE /*suppress error about including H5Fpkg */ #define H5O_PACKAGE /*suppress error about including H5Opkg */ /* Interface initialization */ @@ -39,8 +38,9 @@ /***********/ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ -#include "H5Fpkg.h" /* File access */ +#include "H5Fprivate.h" /* File access */ #include "H5FLprivate.h" /* Free lists */ +#include "H5FOprivate.h" /* File objects */ #include "H5Iprivate.h" /* IDs */ #include "H5Lprivate.h" /* Links */ #include "H5MFprivate.h" /* File memory management */ @@ -194,7 +194,7 @@ static const H5O_obj_class_t *const H5O_obj_class_g[] = { static herr_t H5O_init_interface(void) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_init_interface) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* H5O interface sanity checks */ HDassert(H5O_MSG_TYPES == NELMTS(H5O_msg_class_g)); @@ -234,7 +234,7 @@ H5Oopen(hid_t loc_id, const char *name, hid_t lapl_id) H5G_loc_t loc; hid_t ret_value = FAIL; - FUNC_ENTER_API(H5Oopen, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("i", "i*si", loc_id, name, lapl_id); /* Check args */ @@ -286,7 +286,7 @@ H5Oopen_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, hbool_t loc_found = FALSE; /* Entry at 'name' found */ hid_t ret_value = FAIL; - FUNC_ENTER_API(H5Oopen_by_idx, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE6("i", "i*sIiIohi", loc_id, group_name, idx_type, order, n, lapl_id); /* Check args */ @@ -373,7 +373,7 @@ H5Oopen_by_addr(hid_t loc_id, haddr_t addr) hid_t lapl_id = H5P_LINK_ACCESS_DEFAULT; /* lapl to use to open this object */ hid_t ret_value = FAIL; - FUNC_ENTER_API(H5Oopen_by_addr, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("i", "ia", loc_id, addr); /* Check args */ @@ -429,7 +429,7 @@ H5Olink(hid_t obj_id, hid_t new_loc_id, const char *new_name, hid_t lcpl_id, H5G_loc_t obj_loc; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Olink, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE5("e", "ii*sii", obj_id, new_loc_id, new_name, lcpl_id, lapl_id); /* Check arguments */ @@ -484,7 +484,7 @@ H5Oincr_refcount(hid_t object_id) H5O_loc_t *oloc; herr_t ret_value = SUCCEED; - FUNC_ENTER_API(H5Oincr_refcount, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", object_id); /* Get the object's oloc so we can adjust its link count */ @@ -525,7 +525,7 @@ H5Odecr_refcount(hid_t object_id) H5O_loc_t *oloc; herr_t ret_value = SUCCEED; - FUNC_ENTER_API(H5Odecr_refcount, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", object_id); /* Get the object's oloc so we can adjust its link count */ @@ -559,7 +559,7 @@ H5Oexists_by_name(hid_t loc_id, const char *name, hid_t lapl_id) H5G_loc_t loc; /* Location info */ hid_t ret_value = FAIL; /* Return value */ - FUNC_ENTER_API(H5Oexists_by_name, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("t", "i*si", loc_id, name, lapl_id); /* Check args */ @@ -601,7 +601,7 @@ H5Oget_info(hid_t loc_id, H5O_info_t *oinfo) H5G_loc_t loc; /* Location of group */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Oget_info, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*x", loc_id, oinfo); /* Check args */ @@ -638,7 +638,7 @@ H5Oget_info_by_name(hid_t loc_id, const char *name, H5O_info_t *oinfo, hid_t lap H5G_loc_t loc; /* Location of group */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Oget_info_by_name, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE4("e", "i*s*xi", loc_id, name, oinfo, lapl_id); /* Check args */ @@ -688,7 +688,7 @@ H5Oget_info_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, hbool_t loc_found = FALSE; /* Entry at 'name' found */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Oget_info_by_idx, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE7("e", "i*sIiIoh*xi", loc_id, group_name, idx_type, order, n, oinfo, lapl_id); @@ -755,7 +755,7 @@ H5Oset_comment(hid_t obj_id, const char *comment) H5G_loc_t loc; /* Location of group */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Oset_comment, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*s", obj_id, comment); /* Check args */ @@ -795,7 +795,7 @@ H5Oset_comment_by_name(hid_t loc_id, const char *name, const char *comment, H5G_loc_t loc; /* Location of group */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Oset_comment_by_name, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE4("e", "i*s*si", loc_id, name, comment, lapl_id); /* Check args */ @@ -840,7 +840,7 @@ H5Oget_comment(hid_t obj_id, char *comment, size_t bufsize) H5G_loc_t loc; /* Location of group */ ssize_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Oget_comment, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("Zs", "i*sz", obj_id, comment, bufsize); /* Check args */ @@ -879,7 +879,7 @@ H5Oget_comment_by_name(hid_t loc_id, const char *name, char *comment, size_t buf H5G_loc_t loc; /* Location of group */ ssize_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Oget_comment_by_name, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE5("Zs", "i*s*szi", loc_id, name, comment, bufsize, lapl_id); /* Check args */ @@ -940,7 +940,7 @@ H5Ovisit(hid_t obj_id, H5_index_t idx_type, H5_iter_order_t order, { herr_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Ovisit, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE5("e", "iIiIox*x", obj_id, idx_type, order, op, op_data); /* Check args */ @@ -998,7 +998,7 @@ H5Ovisit_by_name(hid_t loc_id, const char *obj_name, H5_index_t idx_type, { herr_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Ovisit_by_name, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE7("e", "i*sIiIox*xi", loc_id, obj_name, idx_type, order, op, op_data, lapl_id); @@ -1049,7 +1049,7 @@ H5Oclose(hid_t object_id) { herr_t ret_value = SUCCEED; - FUNC_ENTER_API(H5Oclose, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", object_id); /* Get the type of the object and close it in the correct way */ @@ -1119,14 +1119,16 @@ H5O_create(H5F_t *f, hid_t dxpl_id, size_t size_hint, size_t initial_rc, hbool_t store_msg_crt_idx; /* Whether to always store message creation indices for this file */ herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_NOAPI(H5O_create, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* check args */ HDassert(f); - HDassert(f->intent & H5F_ACC_RDWR); HDassert(loc); HDassert(TRUE == H5P_isa_class(ocpl_id, H5P_OBJECT_CREATE)); + /* Check for invalid access request */ + if(0 == (H5F_INTENT(f) & H5F_ACC_RDWR)) + HGOTO_ERROR(H5E_OHDR, H5E_BADVALUE, FAIL, "no write intent on file") /* Make certain we allocate at least a reasonable size for the object header */ size_hint = H5O_ALIGN_F(f, MAX(H5O_MIN_SIZE, size_hint)); @@ -1303,7 +1305,7 @@ H5O_open(H5O_loc_t *loc) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5O_open, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args */ HDassert(loc); @@ -1318,7 +1320,7 @@ H5O_open(H5O_loc_t *loc) if(loc->holding_file) loc->holding_file = FALSE; else - loc->file->nopen_objs++; + H5F_INCR_NOPEN_OBJS(loc->file); done: FUNC_LEAVE_NOAPI(ret_value) @@ -1347,7 +1349,7 @@ H5O_open_name(H5G_loc_t *loc, const char *name, hid_t lapl_id, hbool_t app_ref) hbool_t loc_found = FALSE; /* Entry at 'name' found */ hid_t ret_value = FAIL; - FUNC_ENTER_NOAPI(H5O_open_name, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args */ HDassert(loc); @@ -1395,7 +1397,7 @@ H5O_open_by_loc(const H5G_loc_t *obj_loc, hid_t lapl_id, hid_t dxpl_id, hbool_t const H5O_obj_class_t *obj_class; /* Class of object for location */ hid_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5O_open_by_loc, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert(obj_loc); @@ -1430,22 +1432,22 @@ H5O_close(H5O_loc_t *loc) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5O_close, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args */ HDassert(loc); HDassert(loc->file); - HDassert(loc->file->nopen_objs > 0); + HDassert(H5F_NOPEN_OBJS(loc->file) > 0); /* Decrement open-lock counters */ - --loc->file->nopen_objs; + H5F_DECR_NOPEN_OBJS(loc->file); #ifdef H5O_DEBUG if(H5DEBUG(O)) { - if(loc->file->file_id < 0 && 1 == loc->file->shared->nrefs) + if(H5F_FILE_ID(loc->file)< 0 && 1 == H5F_NREFS(loc->file)) HDfprintf(H5DEBUG(O), "< %a auto %lu remaining\n", loc->addr, - (unsigned long)(loc->file->nopen_objs)); + (unsigned long)H5F_NOPEN_OBJS(loc->file)); else HDfprintf(H5DEBUG(O), "< %a\n", loc->addr); } /* end if */ @@ -1455,7 +1457,7 @@ H5O_close(H5O_loc_t *loc) * If the file open object count has reached the number of open mount points * (each of which has a group open in the file) attempt to close the file. */ - if(loc->file->nopen_objs == loc->file->nmounts) + if(H5F_NOPEN_OBJS(loc->file) == H5F_NMOUNTS(loc->file)) /* Attempt to close down the file hierarchy */ if(H5F_try_close(loc->file) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCLOSEFILE, FAIL, "problem attempting file close") @@ -1491,7 +1493,7 @@ H5O_link_oh(H5F_t *f, int adjust, hid_t dxpl_id, H5O_t *oh, hbool_t *deleted) haddr_t addr = H5O_OH_GET_ADDR(oh); /* Object header address */ int ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5O_link_oh, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* check args */ HDassert(f); @@ -1607,7 +1609,7 @@ H5O_link(const H5O_loc_t *loc, int adjust, hid_t dxpl_id) hbool_t deleted = FALSE; /* Whether the object was deleted */ int ret_value; /* Return value */ - FUNC_ENTER_NOAPI_TAG(H5O_link, dxpl_id, loc->addr, FAIL) + FUNC_ENTER_NOAPI_TAG(dxpl_id, loc->addr, FAIL) /* check args */ HDassert(loc); @@ -1658,7 +1660,7 @@ H5O_protect(const H5O_loc_t *loc, hid_t dxpl_id, H5AC_protect_t prot) unsigned file_intent; /* R/W intent on file */ H5O_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_TAG(H5O_protect, dxpl_id, loc->addr, NULL) + FUNC_ENTER_NOAPI_TAG(dxpl_id, loc->addr, NULL) /* check args */ HDassert(loc); @@ -1875,7 +1877,7 @@ H5O_pin(const H5O_loc_t *loc, hid_t dxpl_id) H5O_t *oh = NULL; /* Object header */ H5O_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5O_pin, NULL) + FUNC_ENTER_NOAPI(NULL) /* check args */ HDassert(loc); @@ -1921,7 +1923,7 @@ H5O_unpin(H5O_t *oh) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5O_unpin, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* check args */ HDassert(oh); @@ -1957,7 +1959,7 @@ H5O_unprotect(const H5O_loc_t *loc, hid_t dxpl_id, H5O_t *oh, unsigned oh_flags) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5O_unprotect, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* check args */ HDassert(loc); @@ -1994,7 +1996,7 @@ H5O_touch_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh, hbool_t force) time_t now; /* Current time */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_touch_oh) + FUNC_ENTER_NOAPI_NOINIT HDassert(f); HDassert(oh); @@ -2088,7 +2090,7 @@ H5O_touch(const H5O_loc_t *loc, hbool_t force, hid_t dxpl_id) unsigned oh_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting object header */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5O_touch, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* check args */ HDassert(loc); @@ -2132,7 +2134,7 @@ H5O_bogus_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned mesg_flags) int idx; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5O_bogus_oh, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert(f); HDassert(oh); @@ -2198,7 +2200,7 @@ H5O_delete(H5F_t *f, hid_t dxpl_id, haddr_t addr) unsigned oh_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting object header */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(H5O_delete, dxpl_id, addr, FAIL) + FUNC_ENTER_NOAPI_TAG(dxpl_id, addr, FAIL) /* Check args */ HDassert(f); @@ -2252,7 +2254,7 @@ H5O_delete_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh) unsigned u; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_delete_oh) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(f); @@ -2291,7 +2293,7 @@ H5O_obj_type(const H5O_loc_t *loc, H5O_type_t *obj_type, hid_t dxpl_id) H5O_t *oh = NULL; /* Object header for location */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(H5O_obj_type, dxpl_id, loc->addr, FAIL) + FUNC_ENTER_NOAPI_TAG(dxpl_id, loc->addr, FAIL) /* Load the object header */ if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC_READ))) @@ -2327,7 +2329,7 @@ H5O_obj_type_real(H5O_t *oh, H5O_type_t *obj_type) { const H5O_obj_class_t *obj_class; /* Class of object for header */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_obj_type_real) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ HDassert(oh); @@ -2369,7 +2371,7 @@ H5O_obj_class(const H5O_loc_t *loc, hid_t dxpl_id) H5O_t *oh = NULL; /* Object header for location */ const H5O_obj_class_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(H5O_obj_class, dxpl_id, loc->addr, NULL) + FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, loc->addr, NULL) /* Load the object header */ if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC_READ))) @@ -2406,7 +2408,7 @@ H5O_obj_class_real(H5O_t *oh) size_t i; /* Local index variable */ const H5O_obj_class_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5O_obj_class_real, NULL) + FUNC_ENTER_NOAPI(NULL) /* Sanity check */ HDassert(oh); @@ -2448,7 +2450,7 @@ H5O_get_loc(hid_t object_id) { H5O_loc_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_get_loc) + FUNC_ENTER_NOAPI_NOINIT switch(H5I_get_type(object_id)) { case H5I_GROUP: @@ -2504,7 +2506,7 @@ done: herr_t H5O_loc_reset(H5O_loc_t *loc) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_loc_reset) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments */ HDassert(loc); @@ -2542,7 +2544,7 @@ H5O_loc_reset(H5O_loc_t *loc) herr_t H5O_loc_copy(H5O_loc_t *dst, H5O_loc_t *src, H5_copy_depth_t depth) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_loc_copy) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments */ HDassert(src); @@ -2558,7 +2560,7 @@ H5O_loc_copy(H5O_loc_t *dst, H5O_loc_t *src, H5_copy_depth_t depth) * hold it open, too. */ if(src->holding_file) - dst->file->nopen_objs++; + H5F_INCR_NOPEN_OBJS(dst->file); } else if(depth == H5_COPY_SHALLOW) { H5O_loc_reset(src); } /* end if */ @@ -2584,7 +2586,7 @@ H5O_loc_copy(H5O_loc_t *dst, H5O_loc_t *src, H5_copy_depth_t depth) herr_t H5O_loc_hold_file(H5O_loc_t *loc) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_loc_hold_file) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments */ HDassert(loc); @@ -2592,7 +2594,7 @@ H5O_loc_hold_file(H5O_loc_t *loc) /* If this location is not already holding its file open, do so. */ if(!loc->holding_file) { - loc->file->nopen_objs++; + H5F_INCR_NOPEN_OBJS(loc->file); loc->holding_file = TRUE; } /* end if */ @@ -2620,16 +2622,16 @@ H5O_loc_free(H5O_loc_t *loc) { herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT(H5O_loc_free) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments */ HDassert(loc); /* If this location is holding its file open try to close the file. */ if(loc->holding_file) { - loc->file->nopen_objs--; + H5F_DECR_NOPEN_OBJS(loc->file); loc->holding_file = FALSE; - if(loc->file->nopen_objs <= 0) { + if(H5F_NOPEN_OBJS(loc->file) <= 0) { if(H5F_try_close(loc->file) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "can't close file") } /* end if */ @@ -2659,7 +2661,7 @@ H5O_get_hdr_info(const H5O_loc_t *loc, hid_t dxpl_id, H5O_hdr_info_t *hdr) H5O_t *oh = NULL; /* Object header */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5O_get_hdr_info, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args */ HDassert(loc); @@ -2704,7 +2706,7 @@ H5O_get_hdr_info_real(const H5O_t *oh, H5O_hdr_info_t *hdr) const H5O_chunk_t *curr_chunk; /* Pointer to current message being operated on */ unsigned u; /* Local index variable */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_get_hdr_info_real) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(oh); @@ -2786,7 +2788,7 @@ H5O_get_info(const H5O_loc_t *loc, hid_t dxpl_id, hbool_t want_ih_info, H5O_t *oh = NULL; /* Object header */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(H5O_get_info, dxpl_id, loc->addr, FAIL) + FUNC_ENTER_NOAPI_TAG(dxpl_id, loc->addr, FAIL) /* Check args */ HDassert(loc); @@ -2907,7 +2909,7 @@ H5O_get_create_plist(const H5O_loc_t *loc, hid_t dxpl_id, H5P_genplist_t *oc_pli H5O_t *oh = NULL; /* Object header */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5O_get_create_plist, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args */ HDassert(loc); @@ -2962,7 +2964,7 @@ H5O_get_nlinks(const H5O_loc_t *loc, hid_t dxpl_id, hsize_t *nlinks) H5O_t *oh = NULL; /* Object header */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5O_get_nlinks, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args */ HDassert(loc); @@ -3003,7 +3005,7 @@ H5O_obj_create(H5F_t *f, H5O_type_t obj_type, void *crt_info, H5G_loc_t *obj_loc size_t u; /* Local index variable */ void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI(H5O_obj_create, NULL) + FUNC_ENTER_NOAPI(NULL) /* Sanity checks */ HDassert(f); @@ -3051,8 +3053,8 @@ done: haddr_t H5O_get_oh_addr(const H5O_t *oh) { - /* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_get_oh_addr) + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(oh); HDassert(oh->chunk); @@ -3080,7 +3082,7 @@ H5O_get_rc_and_type(const H5O_loc_t *loc, hid_t dxpl_id, unsigned *rc, H5O_type_ H5O_t *oh = NULL; /* Object header */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5O_get_rc_and_type, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args */ HDassert(loc); @@ -3121,7 +3123,7 @@ done: static herr_t H5O_free_visit_visited(void *item, void UNUSED *key, void UNUSED *operator_data/*in,out*/) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_free_visit_visited) + FUNC_ENTER_NOAPI_NOINIT_NOERR item = H5FL_FREE(H5_obj_t, item); @@ -3153,7 +3155,7 @@ H5O_visit_cb(hid_t UNUSED group, const char *name, const H5L_info_t *linfo, hbool_t obj_found = FALSE; /* Object at 'name' found */ herr_t ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_visit_cb) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(name); @@ -3268,7 +3270,7 @@ H5O_visit(hid_t loc_id, const char *obj_name, H5_index_t idx_type, hid_t obj_id = (-1); /* ID of object */ herr_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5O_visit, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Portably initialize user data struct to zeros */ HDmemset(&udata, 0, sizeof(udata)); @@ -3321,7 +3323,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)) == NULL) + if((udata.visited = H5SL_create(H5SL_TYPE_OBJ, NULL)) == 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 */ @@ -3379,7 +3381,7 @@ H5O_inc_rc(H5O_t *oh) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5O_inc_rc, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* check args */ HDassert(oh); @@ -3415,7 +3417,7 @@ H5O_dec_rc(H5O_t *oh) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5O_dec_rc, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* check args */ HDassert(oh); @@ -3453,7 +3455,7 @@ H5O_dec_rc_by_loc(const H5O_loc_t *loc, hid_t dxpl_id) H5O_t *oh = NULL; /* Object header */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5O_dec_rc_by_loc, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* check args */ HDassert(loc); @@ -3494,7 +3496,7 @@ H5O_free(H5O_t *oh) { unsigned u; /* Local index variable */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_free) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ HDassert(oh); diff --git a/src/H5Oainfo.c b/src/H5Oainfo.c index 8ff9cf6..ff4cc5d 100644 --- a/src/H5Oainfo.c +++ b/src/H5Oainfo.c @@ -112,7 +112,7 @@ H5O_ainfo_decode(H5F_t *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, unsigned char flags; /* Flags for encoding attribute info */ void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_ainfo_decode) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(f); @@ -184,7 +184,7 @@ H5O_ainfo_encode(H5F_t *f, hbool_t UNUSED disable_shared, uint8_t *p, const void const H5O_ainfo_t *ainfo = (const H5O_ainfo_t *)_mesg; unsigned char flags; /* Flags for encoding attribute info */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_ainfo_encode) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ HDassert(f); @@ -241,7 +241,7 @@ H5O_ainfo_copy(const void *_mesg, void *_dest) H5O_ainfo_t *dest = (H5O_ainfo_t *) _dest; void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_ainfo_copy) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(ainfo); @@ -281,7 +281,7 @@ H5O_ainfo_size(const H5F_t *f, hbool_t UNUSED disable_shared, const void *_mesg) const H5O_ainfo_t *ainfo = (const H5O_ainfo_t *)_mesg; size_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_ainfo_size) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Set return value */ ret_value = 1 /* Version */ @@ -310,7 +310,7 @@ H5O_ainfo_size(const H5F_t *f, hbool_t UNUSED disable_shared, const void *_mesg) static herr_t H5O_ainfo_free(void *mesg) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_ainfo_free) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(mesg); @@ -338,7 +338,7 @@ H5O_ainfo_delete(H5F_t *f, hid_t dxpl_id, H5O_t UNUSED *open_oh, void *_mesg) H5O_ainfo_t *ainfo = (H5O_ainfo_t *)_mesg; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_ainfo_delete) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(f); @@ -372,7 +372,7 @@ static herr_t H5O_ainfo_pre_copy_file(H5F_t UNUSED *file_src, const void UNUSED *native_src, hbool_t *deleted, const H5O_copy_t *cpy_info, void UNUSED *udata) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_ainfo_pre_copy_file) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ HDassert(deleted); @@ -403,13 +403,13 @@ H5O_ainfo_pre_copy_file(H5F_t UNUSED *file_src, const void UNUSED *native_src, */ static void * H5O_ainfo_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst, - hbool_t *recompute_size, H5O_copy_t *cpy_info, void UNUSED *udata, hid_t dxpl_id) + hbool_t UNUSED *recompute_size, H5O_copy_t *cpy_info, void UNUSED *udata, hid_t dxpl_id) { H5O_ainfo_t *ainfo_src = (H5O_ainfo_t *)mesg_src; H5O_ainfo_t *ainfo_dst = NULL; void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_ainfo_copy_file) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(file_src); @@ -436,9 +436,6 @@ H5O_ainfo_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst, /* Reset metadata tag */ H5_END_TAG(NULL); - - if((H5A_dense_copy_file_all(file_src, ainfo_src, file_dst, ainfo_dst, recompute_size, cpy_info, dxpl_id)) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "unable to create dense storage for attributes") } /* end if */ /* Set return value */ @@ -458,7 +455,7 @@ done: * * Purpose: Finish copying a message from between files. * We have to copy the values of a reference attribute in the - * post copy because H5O_post_copy_file() fails at the case that + * post copy because H5O_post_copy_file() fails in the case that * an object may have a reference attribute that points to the * object itself. * @@ -476,15 +473,15 @@ H5O_ainfo_post_copy_file(const H5O_loc_t *src_oloc, const void *mesg_src, const H5O_ainfo_t *ainfo_src = (const H5O_ainfo_t *)mesg_src; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_ainfo_post_copy_file) + FUNC_ENTER_NOAPI_NOINIT HDassert(ainfo_src); if(H5F_addr_defined(ainfo_src->fheap_addr)) { - if ( H5A_dense_post_copy_file_all(src_oloc, ainfo_src, dst_oloc, - (H5O_ainfo_t *)mesg_dst, dxpl_id, cpy_info) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTCOPY, FAIL, "can't copy attribute") - } + if(H5A_dense_post_copy_file_all(src_oloc, ainfo_src, dst_oloc, + (H5O_ainfo_t *)mesg_dst, dxpl_id, cpy_info) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTCOPY, FAIL, "can't copy attribute") + } /* end if */ done: FUNC_LEAVE_NOAPI(ret_value) @@ -510,7 +507,7 @@ H5O_ainfo_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, FILE * { const H5O_ainfo_t *ainfo = (const H5O_ainfo_t *) _mesg; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_ainfo_debug) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ HDassert(f); diff --git a/src/H5Oalloc.c b/src/H5Oalloc.c index aba88b4..05322af 100644 --- a/src/H5Oalloc.c +++ b/src/H5Oalloc.c @@ -115,7 +115,7 @@ H5O_add_gap(H5F_t *f, H5O_t *oh, unsigned chunkno, hbool_t *chk_dirtied, unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_add_gap) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(oh); @@ -240,7 +240,7 @@ H5O_eliminate_gap(H5O_t *oh, hbool_t *chk_dirtied, H5O_mesg_t *mesg, uint8_t *move_start, *move_end; /* Pointers to area of messages to move */ hbool_t null_before_gap; /* Flag whether the null message is before the gap or not */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_eliminate_gap) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ HDassert(oh); @@ -343,7 +343,7 @@ H5O_alloc_null(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned null_idx, H5O_mesg_t *alloc_msg; /* Pointer to null message to allocate out of */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_alloc_null) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(oh); @@ -450,7 +450,7 @@ H5O_alloc_msgs(H5O_t *oh, size_t min_alloc) H5O_mesg_t *new_mesg; /* Pointer to new message array */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_alloc_msgs) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(oh); @@ -521,7 +521,7 @@ H5O_alloc_extend_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned chunkno, unsigned u; /* Local index variable */ htri_t ret_value = TRUE; /* return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_alloc_extend_chunk) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(f != NULL); @@ -559,26 +559,27 @@ H5O_alloc_extend_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned chunkno, /* Check for changing the chunk #0 data size enough to need adjusting the flags */ if(oh->version > H5O_VERSION_1 && chunkno == 0) { uint64_t chunk0_size; /* Size of chunk 0's data */ + size_t orig_prfx_size = (size_t)1 << (oh->flags & H5O_HDR_CHUNK0_SIZE); /* Original prefix size */ HDassert(oh->chunk[0].size >= (size_t)H5O_SIZEOF_HDR(oh)); chunk0_size = oh->chunk[0].size - (size_t)H5O_SIZEOF_HDR(oh); - /* Check for moving from a 1-byte to a 2-byte size encoding */ - if(chunk0_size <= 255 && (chunk0_size + delta) > 255) { - extra_prfx_size = 1; - new_size_flags = H5O_HDR_CHUNK0_2; + /* Check for moving to a 8-byte size encoding */ + if(orig_prfx_size < 8 && (chunk0_size + delta) > 4294967295) { + extra_prfx_size = 8 - orig_prfx_size; + new_size_flags = H5O_HDR_CHUNK0_8; adjust_size_flags = TRUE; } /* end if */ - /* Check for moving from a 2-byte to a 4-byte size encoding */ - else if(chunk0_size <= 65535 && (chunk0_size + delta) > 65535) { - extra_prfx_size = 2; + /* Check for moving to a 4-byte size encoding */ + else if(orig_prfx_size < 4 && (chunk0_size + delta) > 65535) { + extra_prfx_size = 4 - orig_prfx_size; new_size_flags = H5O_HDR_CHUNK0_4; adjust_size_flags = TRUE; } /* end if */ - /* Check for moving from a 4-byte to a 8-byte size encoding */ - else if(chunk0_size <= 4294967295 && (chunk0_size + delta) > 4294967295) { - extra_prfx_size = 4; - new_size_flags = H5O_HDR_CHUNK0_8; + /* Check for moving to a 2-byte size encoding */ + else if(orig_prfx_size < 2 && (chunk0_size + delta) > 255) { + extra_prfx_size = 2 - orig_prfx_size; + new_size_flags = H5O_HDR_CHUNK0_2; adjust_size_flags = TRUE; } /* end if */ } /* end if */ @@ -646,17 +647,18 @@ H5O_alloc_extend_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned chunkno, /* Wipe new space for chunk */ HDmemset(oh->chunk[chunkno].image + old_size, 0, oh->chunk[chunkno].size - old_size); + /* Move chunk 0 data up if the size flags changed */ + if(adjust_size_flags) + HDmemmove(oh->chunk[0].image + H5O_SIZEOF_HDR(oh) - H5O_SIZEOF_CHKSUM_OH(oh), + oh->chunk[0].image + H5O_SIZEOF_HDR(oh) - H5O_SIZEOF_CHKSUM_OH(oh) - extra_prfx_size, + old_size - (size_t)H5O_SIZEOF_HDR(oh) + extra_prfx_size); + /* Spin through existing messages, adjusting them */ for(u = 0; u < oh->nmesgs; u++) { /* Adjust raw addresses for messages in this chunk to reflect new 'image' address */ - if(oh->mesg[u].chunkno == chunkno) { + if(oh->mesg[u].chunkno == chunkno) oh->mesg[u].raw = oh->chunk[chunkno].image + extra_prfx_size + (oh->mesg[u].raw - old_image); - /* Flag message as dirty directly */ - /* (we mark the entire chunk dirty when we update its size) */ - oh->mesg[u].dirty = TRUE; - } /* endif */ - /* Find continuation message which points to this chunk and adjust chunk's size */ /* (Chunk 0 doesn't have a continuation message that points to it and * it's size is directly encoded in the object header) */ @@ -762,7 +764,7 @@ H5O_alloc_new_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, size_t size) unsigned u; /* Local index variable */ int ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_alloc_new_chunk) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(oh); @@ -1121,7 +1123,7 @@ H5O_alloc(H5F_t *f, hid_t dxpl_id, H5O_t *oh, const H5O_msg_class_t *type, int idx; /* Index of message which fits allocation */ int ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5O_alloc, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* check args */ HDassert(oh); @@ -1205,7 +1207,7 @@ H5O_release_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_mesg_t *mesg, hbool_t chk_dirtied = FALSE; /* Flag for unprotecting chunk */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5O_release_mesg, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* check args */ HDassert(f); @@ -1278,7 +1280,7 @@ H5O_move_cont(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned cont_u) hbool_t chk_dirtied = FALSE; /* Flags for unprotecting chunk */ htri_t ret_value = TRUE; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_move_cont) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments. */ HDassert(f); @@ -1330,8 +1332,9 @@ H5O_move_cont(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned cont_u) move_end = cont_msg->raw + cont_msg->raw_size; cont_chunkno = cont_msg->chunkno; - /* Convert continuation message into a null message */ - if(H5O_release_mesg(f, dxpl_id, oh, cont_msg, TRUE) < 0) + /* Convert continuation message into a null message. Do not delete + * the target chunk yet, so we can still copy messages from it. */ + if(H5O_release_mesg(f, dxpl_id, oh, cont_msg, FALSE) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "unable to convert into null message") /* Protect chunk */ @@ -1353,7 +1356,6 @@ H5O_move_cont(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned cont_u) HDmemcpy(move_start, curr_msg->raw - H5O_SIZEOF_MSGHDR_OH(oh), move_size); curr_msg->raw = move_start + H5O_SIZEOF_MSGHDR_OH(oh); curr_msg->chunkno = cont_chunkno; - curr_msg->dirty = TRUE; chk_dirtied = TRUE; /* Adjust location to move messages to */ @@ -1361,6 +1363,10 @@ H5O_move_cont(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned cont_u) } /* end else */ } /* end if */ + /* Delete the target chunk */ + if(H5O_chunk_delete(f, dxpl_id, oh, deleted_chunkno) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "unable to remove chunk from cache") + HDassert(move_start <= (move_end + gap_size)); /* Check if there is space remaining in the continuation message */ @@ -1450,7 +1456,7 @@ H5O_move_msgs_forward(H5F_t *f, hid_t dxpl_id, H5O_t *oh) hbool_t did_packing = FALSE; /* Whether any messages were packed */ htri_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_move_msgs_forward) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(oh); @@ -1734,7 +1740,7 @@ H5O_merge_null(H5F_t *f, hid_t dxpl_id, H5O_t *oh) hbool_t did_merging = FALSE; /* Whether any messages were merged */ htri_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_merge_null) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(oh != NULL); @@ -1869,7 +1875,7 @@ H5O_remove_empty_chunks(H5F_t *f, hid_t dxpl_id, H5O_t *oh) hbool_t did_deleting = FALSE; /* Whether any chunks were deleted */ htri_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_remove_empty_chunks) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(oh != NULL); @@ -2059,7 +2065,7 @@ H5O_condense_header(H5F_t *f, H5O_t *oh, hid_t dxpl_id) htri_t result; /* Result from packing/merging/etc */ herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_NOAPI(H5O_condense_header, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* check args */ HDassert(oh != NULL); @@ -2132,7 +2138,7 @@ H5O_alloc_shrink_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned chunkno) herr_t ret_value = SUCCEED; /* Return value */ unsigned u; /* Index */ - FUNC_ENTER_NOAPI_NOINIT(H5O_alloc_shrink_chunk) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(f); diff --git a/src/H5Oattr.c b/src/H5Oattr.c index ce8e4af..8cd243b 100644 --- a/src/H5Oattr.c +++ b/src/H5Oattr.c @@ -130,7 +130,7 @@ H5O_attr_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned UNUSED mesg_fl unsigned flags = 0; /* Attribute flags */ H5A_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_attr_decode) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(f); @@ -278,7 +278,7 @@ H5O_attr_encode(H5F_t *f, uint8_t *p, const void *mesg) unsigned flags = 0; /* Attribute flags */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_attr_encode) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(f); @@ -381,7 +381,7 @@ H5O_attr_copy(const void *_src, void *_dst) { void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_attr_copy) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(_src); @@ -418,7 +418,7 @@ H5O_attr_size(const H5F_t UNUSED *f, const void *_mesg) size_t name_len; size_t ret_value = 0; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_attr_size) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(attr); @@ -479,7 +479,7 @@ H5O_attr_size(const H5F_t UNUSED *f, const void *_mesg) herr_t H5O_attr_reset(void UNUSED *_mesg) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_attr_reset) + FUNC_ENTER_NOAPI_NOINIT_NOERR FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5O_attr_reset() */ @@ -507,7 +507,7 @@ H5O_attr_free(void *mesg) H5A_t *attr = (H5A_t *)mesg; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_attr_free) + FUNC_ENTER_NOAPI_NOINIT HDassert(mesg); @@ -537,7 +537,7 @@ H5O_attr_delete(H5F_t *f, hid_t dxpl_id, H5O_t *oh, void *_mesg) H5A_t *attr = (H5A_t *) _mesg; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_attr_delete) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(f); @@ -575,7 +575,7 @@ H5O_attr_link(H5F_t *f, hid_t dxpl_id, H5O_t *oh, void *_mesg) H5A_t *attr = (H5A_t *) _mesg; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_attr_link) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(f); @@ -616,7 +616,7 @@ static herr_t H5O_attr_pre_copy_file(H5F_t UNUSED *file_src, const void UNUSED *native_src, hbool_t *deleted, const H5O_copy_t *cpy_info, void UNUSED *udata) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_attr_pre_copy_file) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ HDassert(deleted); @@ -653,7 +653,7 @@ H5O_attr_copy_file(H5F_t *file_src, const H5O_msg_class_t UNUSED *mesg_type, { void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_attr_copy_file) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(native_src); @@ -698,7 +698,7 @@ H5O_attr_post_copy_file(const H5O_loc_t *src_oloc, const void *mesg_src, herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_attr_post_copy_file) + FUNC_ENTER_NOAPI_NOINIT if ( H5A_attr_post_copy_file(src_oloc, (const H5A_t *)mesg_src, dst_oloc, (H5A_t *)mesg_dst, dxpl_id, cpy_info) < 0) @@ -727,7 +727,7 @@ H5O_attr_get_crt_index(const void *_mesg, H5O_msg_crt_idx_t *crt_idx /*out*/) { const H5A_t *attr = (const H5A_t *)_mesg; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_attr_get_crt_index) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(attr); HDassert(crt_idx); @@ -757,7 +757,7 @@ H5O_attr_set_crt_index(void *_mesg, H5O_msg_crt_idx_t crt_idx) { H5A_t *attr = (H5A_t *)_mesg; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_attr_set_crt_index) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(attr); @@ -795,7 +795,7 @@ H5O_attr_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE * stream, int in char buf[256]; /* Temporary string buffer */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_attr_debug) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(f); diff --git a/src/H5Oattribute.c b/src/H5Oattribute.c index 4a19ed4..fbfc140 100644 --- a/src/H5Oattribute.c +++ b/src/H5Oattribute.c @@ -173,13 +173,13 @@ static htri_t H5O_attr_find_opened_attr(const H5O_loc_t *loc, H5A_t **attr, */ static herr_t H5O_attr_to_dense_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, - unsigned UNUSED sequence, hbool_t *oh_modified, void *_udata/*in,out*/) + unsigned UNUSED sequence, unsigned *oh_modified, void *_udata/*in,out*/) { H5O_iter_cvt_t *udata = (H5O_iter_cvt_t *)_udata; /* Operator user data */ H5A_t *attr = (H5A_t *)mesg->native; /* Pointer to attribute to insert */ herr_t ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_attr_to_dense_cb) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(oh); @@ -199,7 +199,7 @@ H5O_attr_to_dense_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, H5_ITER_ERROR, "unable to convert into null message") /* Indicate that the object header was modified */ - *oh_modified = TRUE; + *oh_modified = H5O_MODIFY_CONDENSE; done: FUNC_LEAVE_NOAPI(ret_value) @@ -226,7 +226,7 @@ H5O_attr_create(const H5O_loc_t *loc, hid_t dxpl_id, H5A_t *attr) htri_t shared_mesg; /* Should this message be stored in the Shared Message table? */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_attr_create) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments */ HDassert(loc); @@ -419,12 +419,12 @@ done: */ static herr_t H5O_attr_open_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, unsigned sequence, - hbool_t UNUSED *oh_modified, void *_udata/*in,out*/) + unsigned UNUSED *oh_modified, void *_udata/*in,out*/) { H5O_iter_opn_t *udata = (H5O_iter_opn_t *)_udata; /* Operator user data */ herr_t ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_attr_open_cb) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(oh); @@ -477,7 +477,7 @@ H5O_attr_open_by_name(const H5O_loc_t *loc, const char *name, hid_t dxpl_id) htri_t found_open_attr = FALSE; /* Whether opened object is found */ H5A_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(H5O_attr_open_by_name, dxpl_id, loc->addr, NULL) + FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, loc->addr, NULL) /* Check arguments */ HDassert(loc); @@ -527,7 +527,7 @@ H5O_attr_open_by_name(const H5O_loc_t *loc, const char *name, hid_t dxpl_id) /* Check that we found the attribute */ if(!udata.attr) - HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, NULL, "can't locate attribute") + HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, NULL, "can't locate attribute: '%s'", name) /* Get attribute opened from object header */ HDassert(udata.attr); @@ -575,7 +575,7 @@ H5O_attr_open_by_idx_cb(const H5A_t *attr, void *_ret_attr) H5A_t **ret_attr = (H5A_t **)_ret_attr; /* 'User data' passed in */ herr_t ret_value = H5_ITER_STOP; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_attr_open_by_idx_cb) + FUNC_ENTER_NOAPI_NOINIT /* check arguments */ HDassert(attr); @@ -619,7 +619,7 @@ H5O_attr_open_by_idx(const H5O_loc_t *loc, H5_index_t idx_type, htri_t found_open_attr = FALSE; /* Whether opened object is found */ H5A_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_attr_open_by_idx) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments */ HDassert(loc); @@ -697,7 +697,7 @@ H5O_attr_find_opened_attr(const H5O_loc_t *loc, H5A_t **attr, const char* name_t size_t num_open_attr; /* Number of opened attributes */ htri_t ret_value = FALSE; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_attr_find_opened_attr) + FUNC_ENTER_NOAPI_NOINIT /* Get file serial number for the location of attribute */ if(H5F_get_fileno(loc->file, &loc_fnum) < 0) @@ -772,7 +772,7 @@ H5O_attr_update_shared(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5A_t *attr, htri_t shared_mesg; /* Whether the message should be shared */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_attr_update_shared) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(f); @@ -788,7 +788,7 @@ H5O_attr_update_shared(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5A_t *attr, /* Store new version of message as a SOHM */ /* (should always work, since we're not changing the size of the attribute) */ - if((shared_mesg = H5SM_try_share(f, dxpl_id, oh, H5O_ATTR_ID, attr, NULL)) == 0) + if((shared_mesg = H5SM_try_share(f, dxpl_id, oh, 0, H5O_ATTR_ID, attr, NULL)) == 0) HGOTO_ERROR(H5E_ATTR, H5E_BADMESG, FAIL, "attribute changed sharing status") else if(shared_mesg < 0) HGOTO_ERROR(H5E_ATTR, H5E_BADMESG, FAIL, "can't share attribute") @@ -846,14 +846,14 @@ done: */ static herr_t H5O_attr_write_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, - unsigned UNUSED sequence, hbool_t *oh_modified, void *_udata/*in,out*/) + unsigned UNUSED sequence, unsigned *oh_modified, void *_udata/*in,out*/) { H5O_iter_wrt_t *udata = (H5O_iter_wrt_t *)_udata; /* Operator user data */ H5O_chunk_proxy_t *chk_proxy = NULL; /* Chunk that message is in */ hbool_t chk_dirtied = FALSE; /* Flag for unprotecting chunk */ herr_t ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_attr_write_cb) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(oh); @@ -895,7 +895,7 @@ H5O_attr_write_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, H5_ITER_ERROR, "unable to update attribute in shared storage") /* Indicate that the object header was modified */ - *oh_modified = TRUE; + *oh_modified = H5O_MODIFY; /* Indicate that the attribute was found */ udata->found = TRUE; @@ -932,7 +932,7 @@ H5O_attr_write(const H5O_loc_t *loc, hid_t dxpl_id, H5A_t *attr) H5O_ainfo_t ainfo; /* Attribute information for object */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_attr_write) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments */ HDassert(loc); @@ -1005,12 +1005,12 @@ done: */ static herr_t H5O_attr_rename_chk_cb(H5O_t UNUSED *oh, H5O_mesg_t *mesg/*in,out*/, - unsigned UNUSED sequence, hbool_t UNUSED *oh_modified, void *_udata/*in,out*/) + unsigned UNUSED sequence, unsigned UNUSED *oh_modified, void *_udata/*in,out*/) { H5O_iter_ren_t *udata = (H5O_iter_ren_t *)_udata; /* Operator user data */ herr_t ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_attr_rename_chk_cb) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ HDassert(oh); @@ -1051,14 +1051,14 @@ H5O_attr_rename_chk_cb(H5O_t UNUSED *oh, H5O_mesg_t *mesg/*in,out*/, */ static herr_t H5O_attr_rename_mod_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, - unsigned UNUSED sequence, hbool_t *oh_modified, void *_udata/*in,out*/) + unsigned UNUSED sequence, unsigned *oh_modified, void *_udata/*in,out*/) { H5O_iter_ren_t *udata = (H5O_iter_ren_t *)_udata; /* Operator user data */ H5O_chunk_proxy_t *chk_proxy = NULL; /* Chunk that message is in */ hbool_t chk_dirtied = FALSE; /* Flag for unprotecting chunk */ herr_t ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_attr_rename_mod_cb) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(oh); @@ -1125,6 +1125,8 @@ H5O_attr_rename_mod_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, if(H5O_release_mesg(udata->f, udata->dxpl_id, oh, mesg, FALSE) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, H5_ITER_ERROR, "unable to release previous attribute") + *oh_modified = H5O_MODIFY_CONDENSE; + /* Append renamed attribute to object header */ /* (Don't let it become shared) */ if(H5O_msg_append_real(udata->f, udata->dxpl_id, oh, H5O_MSG_ATTR, (mesg->flags | H5O_MSG_FLAG_DONTSHARE), 0, attr) < 0) @@ -1139,7 +1141,7 @@ H5O_attr_rename_mod_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, } /* end else */ /* Indicate that the object header was modified */ - *oh_modified = TRUE; + *oh_modified |= H5O_MODIFY; /* Indicate that we found an existing attribute with the old name */ udata->found = TRUE; @@ -1177,7 +1179,7 @@ H5O_attr_rename(const H5O_loc_t *loc, hid_t dxpl_id, const char *old_name, H5O_ainfo_t ainfo; /* Attribute information for object */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(H5O_attr_rename, dxpl_id, loc->addr, FAIL) + FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, loc->addr, FAIL) /* Check arguments */ HDassert(loc); @@ -1268,7 +1270,7 @@ H5O_attr_iterate_real(hid_t loc_id, const H5O_loc_t *loc, hid_t dxpl_id, H5A_attr_table_t atable = {0, NULL}; /* Table of attributes */ herr_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(H5O_attr_iterate_real, dxpl_id, loc->addr, FAIL) + FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, loc->addr, FAIL) /* Check arguments */ HDassert(loc); @@ -1353,7 +1355,7 @@ H5O_attr_iterate(hid_t loc_id, hid_t dxpl_id, H5G_loc_t loc; /* Object location */ herr_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_attr_iterate) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments */ HDassert(attr_op); @@ -1398,7 +1400,7 @@ H5O_attr_remove_update(const H5O_loc_t *loc, H5O_t *oh, H5O_ainfo_t *ainfo, H5A_attr_table_t atable = {0, NULL}; /* Table of attributes */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_attr_remove_update) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments */ HDassert(loc); @@ -1511,12 +1513,12 @@ done: */ static herr_t H5O_attr_remove_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, - unsigned UNUSED sequence, hbool_t *oh_modified, void *_udata/*in,out*/) + unsigned UNUSED sequence, unsigned *oh_modified, void *_udata/*in,out*/) { H5O_iter_rm_t *udata = (H5O_iter_rm_t *)_udata; /* Operator user data */ herr_t ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_attr_remove_cb) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(oh); @@ -1530,7 +1532,7 @@ H5O_attr_remove_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, H5_ITER_ERROR, "unable to convert into null message") /* Indicate that the object header was modified */ - *oh_modified = TRUE; + *oh_modified = H5O_MODIFY_CONDENSE; /* Indicate that this message is the attribute to be deleted */ udata->found = TRUE; @@ -1564,7 +1566,7 @@ H5O_attr_remove(const H5O_loc_t *loc, const char *name, hid_t dxpl_id) htri_t ainfo_exists = FALSE; /* Whether the attribute info exists in the file */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(H5O_attr_remove, dxpl_id, loc->addr, FAIL) + FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, loc->addr, FAIL) /* Check arguments */ HDassert(loc); @@ -1649,7 +1651,7 @@ H5O_attr_remove_by_idx(const H5O_loc_t *loc, H5_index_t idx_type, H5A_attr_table_t atable = {0, NULL}; /* Table of attributes */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(H5O_attr_remove_by_idx, dxpl_id, loc->addr, FAIL) + FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, loc->addr, FAIL) /* Check arguments */ HDassert(loc); @@ -1737,7 +1739,7 @@ H5O_attr_count_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh, hsize_t *nattrs) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(H5O_attr_count_real, dxpl_id, oh->cache_info.addr, FAIL) + FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, oh->cache_info.addr, FAIL) /* Check arguments */ HDassert(f); @@ -1790,12 +1792,12 @@ done: */ static herr_t H5O_attr_exists_cb(H5O_t UNUSED *oh, H5O_mesg_t *mesg/*in,out*/, - unsigned UNUSED sequence, hbool_t UNUSED *oh_modified, void *_udata/*in,out*/) + unsigned UNUSED sequence, unsigned UNUSED *oh_modified, void *_udata/*in,out*/) { H5O_iter_rm_t *udata = (H5O_iter_rm_t *)_udata; /* Operator user data */ herr_t ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_attr_exists_cb) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ HDassert(mesg); @@ -1833,7 +1835,7 @@ H5O_attr_exists(const H5O_loc_t *loc, const char *name, hid_t dxpl_id) H5O_ainfo_t ainfo; /* Attribute information for object */ htri_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(H5O_attr_exists, dxpl_id, loc->addr, FAIL) + FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, loc->addr, FAIL) /* Check arguments */ HDassert(loc); @@ -1905,7 +1907,7 @@ H5O_attr_bh_info(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t *bh_info) H5B2_t *bt2_corder = NULL; /* v2 B-tree handle for creation order index */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5O_attr_bh_info, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert(f); HDassert(oh); @@ -1988,7 +1990,7 @@ H5O_attr_count(const H5O_loc_t *loc, hid_t dxpl_id) hsize_t nattrs; /* Number of attributes */ int ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_attr_count) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments */ HDassert(loc); diff --git a/src/H5Obtreek.c b/src/H5Obtreek.c index 99e6bdd..d25a7a3 100644 --- a/src/H5Obtreek.c +++ b/src/H5Obtreek.c @@ -85,7 +85,7 @@ H5O_btreek_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, H5O_btreek_t *mesg; /* Native message */ void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_btreek_decode) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(f); @@ -129,7 +129,7 @@ H5O_btreek_encode(H5F_t UNUSED *f, hbool_t UNUSED disable_shared, uint8_t *p, co { const H5O_btreek_t *mesg = (const H5O_btreek_t *)_mesg; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_btreek_encode) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ HDassert(f); @@ -167,7 +167,7 @@ H5O_btreek_copy(const void *_mesg, void *_dest) H5O_btreek_t *dest = (H5O_btreek_t *)_dest; void *ret_value; - FUNC_ENTER_NOAPI_NOINIT(H5O_btreek_copy) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(mesg); @@ -205,7 +205,7 @@ H5O_btreek_size(const H5F_t UNUSED *f, hbool_t UNUSED disable_shared, const void { size_t ret_value; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_btreek_size) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ HDassert(f); @@ -237,7 +237,7 @@ H5O_btreek_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, FILE { const H5O_btreek_t *mesg = (const H5O_btreek_t *)_mesg; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_btreek_debug) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ HDassert(f); diff --git a/src/H5Ocache.c b/src/H5Ocache.c index e64262b..2c33ebe 100644 --- a/src/H5Ocache.c +++ b/src/H5Ocache.c @@ -170,7 +170,7 @@ H5O_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) haddr_t eoa; /* Relative end of file address */ H5O_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_load) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments */ HDassert(f); @@ -374,7 +374,7 @@ H5O_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t UNUSED addr, H5O_t * { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_flush) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments */ HDassert(f); @@ -520,7 +520,7 @@ H5O_dest(H5F_t *f, H5O_t *oh) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_dest) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(oh); @@ -583,7 +583,7 @@ H5O_clear(H5F_t *f, H5O_t *oh, hbool_t destroy) unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT(H5O_clear) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(oh); @@ -650,7 +650,7 @@ done: static herr_t H5O_size(const H5F_t UNUSED *f, const H5O_t *oh, size_t *size_ptr) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_size) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ HDassert(oh); @@ -690,7 +690,7 @@ H5O_cache_chk_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) uint8_t *buf; /* Buffer to decode */ H5O_chunk_proxy_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_cache_chk_load) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments */ HDassert(f); @@ -783,7 +783,7 @@ H5O_cache_chk_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_cache_chk_flush) + FUNC_ENTER_NOAPI_NOINIT /* flush */ if(chk_proxy->cache_info.is_dirty) { @@ -829,7 +829,7 @@ H5O_cache_chk_dest(H5F_t *f, H5O_chunk_proxy_t *chk_proxy) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_cache_chk_dest) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments */ HDassert(chk_proxy); @@ -901,7 +901,7 @@ H5O_cache_chk_clear(H5F_t *f, H5O_chunk_proxy_t *chk_proxy, hbool_t destroy) unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT(H5O_cache_chk_clear) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(chk_proxy); @@ -952,7 +952,7 @@ done: static herr_t H5O_cache_chk_size(const H5F_t UNUSED *f, const H5O_chunk_proxy_t *chk_proxy, size_t *size_ptr) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_cache_chk_size) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ HDassert(chk_proxy); @@ -986,7 +986,7 @@ H5O_add_cont_msg(H5O_cont_msgs_t *cont_msg_info, const H5O_cont_t *cont) unsigned contno; /* Continuation message index */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_add_cont_msg) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments */ HDassert(cont_msg_info); @@ -1042,7 +1042,7 @@ H5O_chunk_deserialize(H5O_t *oh, haddr_t addr, size_t len, const uint8_t *image, #endif /* NDEBUG */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_chunk_deserialize) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments */ HDassert(oh); @@ -1373,7 +1373,7 @@ H5O_chunk_serialize(const H5F_t *f, H5O_t *oh, unsigned chunkno) unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_chunk_serialize) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments */ HDassert(f); @@ -1436,7 +1436,7 @@ H5O_chunk_proxy_dest(H5O_chunk_proxy_t *chk_proxy) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_chunk_proxy_dest) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments */ HDassert(chk_proxy); diff --git a/src/H5Ochunk.c b/src/H5Ochunk.c index 42b391d..41d3f66 100644 --- a/src/H5Ochunk.c +++ b/src/H5Ochunk.c @@ -97,7 +97,7 @@ H5O_chunk_add(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx) H5O_chunk_proxy_t *chk_proxy = NULL; /* Proxy for chunk, to mark it dirty in the cache */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(H5O_chunk_add, dxpl_id, oh->cache_info.addr, FAIL) + FUNC_ENTER_NOAPI_TAG(dxpl_id, oh->cache_info.addr, FAIL) /* check args */ HDassert(f); @@ -151,7 +151,7 @@ H5O_chunk_protect(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx) H5O_chunk_proxy_t *chk_proxy = NULL; /* Proxy for protected chunk */ H5O_chunk_proxy_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_TAG(H5O_chunk_protect, dxpl_id, oh->cache_info.addr, NULL) + FUNC_ENTER_NOAPI_TAG(dxpl_id, oh->cache_info.addr, NULL) /* check args */ HDassert(f); @@ -225,7 +225,7 @@ H5O_chunk_unprotect(H5F_t *f, hid_t dxpl_id, H5O_chunk_proxy_t *chk_proxy, { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5O_chunk_unprotect, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* check args */ HDassert(f); @@ -277,7 +277,7 @@ H5O_chunk_resize(H5O_t *oh, H5O_chunk_proxy_t *chk_proxy) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5O_chunk_resize, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* check args */ HDassert(oh); @@ -321,7 +321,7 @@ H5O_chunk_update_idx(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx) H5O_chk_cache_ud_t chk_udata; /* User data for loading chunk */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5O_chunk_update_idx, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* check args */ HDassert(f); @@ -373,7 +373,7 @@ H5O_chunk_delete(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx) H5O_chk_cache_ud_t chk_udata; /* User data for loading chunk */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(H5O_chunk_delete, dxpl_id, oh->cache_info.addr, FAIL) + FUNC_ENTER_NOAPI_TAG(dxpl_id, oh->cache_info.addr, FAIL) /* check args */ HDassert(f); diff --git a/src/H5Ocont.c b/src/H5Ocont.c index 8ba22cc..b609bfd 100644 --- a/src/H5Ocont.c +++ b/src/H5Ocont.c @@ -96,7 +96,7 @@ H5O_cont_decode(H5F_t *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, H5O_cont_t *cont = NULL; void *ret_value; - FUNC_ENTER_NOAPI_NOINIT(H5O_cont_decode) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(f); @@ -137,7 +137,7 @@ H5O_cont_encode(H5F_t *f, hbool_t UNUSED disable_shared, uint8_t *p, const void { const H5O_cont_t *cont = (const H5O_cont_t *) _mesg; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_cont_encode) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ HDassert(f); @@ -176,7 +176,7 @@ H5O_cont_size(const H5F_t *f, hbool_t UNUSED disable_shared, const void UNUSED * { size_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_cont_size) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Set return value */ ret_value = H5F_SIZEOF_ADDR(f) + /* Continuation header address */ @@ -201,7 +201,7 @@ H5O_cont_size(const H5F_t *f, hbool_t UNUSED disable_shared, const void UNUSED * static herr_t H5O_cont_free(void *mesg) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_cont_free) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(mesg); @@ -229,7 +229,7 @@ H5O_cont_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, void *_mesg) H5O_cont_t *mesg = (H5O_cont_t *) _mesg; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_cont_delete) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(f); @@ -266,7 +266,7 @@ H5O_cont_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, FILE * { const H5O_cont_t *cont = (const H5O_cont_t *) _mesg; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_cont_debug) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ HDassert(f); diff --git a/src/H5Ocopy.c b/src/H5Ocopy.c index 1ecd16f..dd649ff 100644 --- a/src/H5Ocopy.c +++ b/src/H5Ocopy.c @@ -186,7 +186,7 @@ H5Ocopy(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Ocopy, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE6("e", "i*si*sii", src_loc_id, src_name, dst_loc_id, dst_name, ocpypl_id, lcpl_id); @@ -293,6 +293,7 @@ H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out */, unsigned mesgno = 0; haddr_t addr_new = HADDR_UNDEF; hbool_t *deleted = NULL; /* Array of flags indicating whether messages should be copied */ + hbool_t inserted = FALSE; /* Whether the destination object header has been inserted into the cache */ size_t null_msgs; /* Number of NULL messages found in each loop */ size_t orig_dst_msgs; /* Original # of messages in dest. object */ H5O_mesg_t *mesg_src; /* Message in source object header */ @@ -307,7 +308,7 @@ H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out */, size_t msghdr_size; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT_TAG(H5O_copy_header_real, dxpl_id, oloc_src->addr, FAIL) + FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, oloc_src->addr, FAIL) HDassert(oloc_src); HDassert(oloc_src->file); @@ -370,9 +371,9 @@ H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out */, /* Allocate memory for "deleted" array. This array marks the message in * the source that shouldn't be copied to the destination. */ - if(NULL == (deleted = (hbool_t *)HDmalloc(sizeof(hbool_t) * oh_src->nmesgs))) + if(NULL == (deleted = (hbool_t *)HDmalloc(sizeof(hbool_t) * oh_src->nmesgs))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") - HDmemset(deleted, FALSE, sizeof(hbool_t) * oh_src->nmesgs); + HDmemset(deleted, FALSE, sizeof(hbool_t) * oh_src->nmesgs); /* "pre copy" pass over messages, to gather information for actual message copy operation * (for messages which depend on information from other messages) @@ -745,6 +746,7 @@ H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out */, if(H5AC_insert_entry(oloc_dst->file, dxpl_id, H5AC_OHDR, oloc_dst->addr, oh_dst, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINSERT, FAIL, "unable to cache object header") oh_dst = NULL; + inserted = TRUE; /* Reset metadat tag */ H5_END_TAG(FAIL); @@ -769,9 +771,13 @@ done: if(oh_src && H5O_unprotect(oloc_src, dxpl_id, oh_src, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") - /* Release pointer to destination object header */ - if(ret_value < 0 && oh_dst && H5O_free(oh_dst) < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to destroy object header data") + /* Free destination object header on failure */ + if(ret_value < 0 && oh_dst && !inserted) { + if(H5O_free(oh_dst) < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to destroy object header data") + if(H5O_loc_reset(oloc_dst) < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to destroy object header data") + } /* end if */ FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) } /* end H5O_copy_header_real() */ @@ -800,7 +806,7 @@ H5O_copy_header_map(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out */, hbool_t inc_link; /* Whether to increment the link count for the object */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI(H5O_copy_header_map, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ HDassert(oloc_src); @@ -899,7 +905,7 @@ H5O_copy_free_addrmap_cb(void *_item, void UNUSED *key, void UNUSED *op_data) { H5O_addr_map_t *item = (H5O_addr_map_t *)_item; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_copy_free_addrmap_cb) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(item); @@ -936,7 +942,7 @@ H5O_copy_header(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out */, H5O_copy_t cpy_info; /* Information for copying object */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT(H5O_copy_header) + FUNC_ENTER_NOAPI_NOINIT HDassert(oloc_src); HDassert(oloc_src->file); @@ -964,12 +970,11 @@ 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_OBJ)) == NULL) + if((cpy_info.map_list = H5SL_create(H5SL_TYPE_OBJ, NULL)) == NULL) HGOTO_ERROR(H5E_SLIST, H5E_CANTCREATE, FAIL, "cannot make skip list") /* copy the object from the source file to the destination file */ - if(H5O_copy_header_real(oloc_src, oloc_dst, dxpl_id, &cpy_info, NULL, NULL) - < 0) + if(H5O_copy_header_real(oloc_src, oloc_dst, dxpl_id, &cpy_info, NULL, NULL) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy object") done: @@ -1006,7 +1011,7 @@ H5O_copy_obj(H5G_loc_t *src_loc, H5G_loc_t *dst_loc, const char *dst_name, unsigned cpy_option = 0; /* Copy options */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5O_copy_obj, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert(src_loc); HDassert(src_loc->oloc->file); @@ -1073,7 +1078,7 @@ H5O_copy_obj_by_ref(H5O_loc_t *src_oloc, hid_t dxpl_id, H5O_loc_t *dst_oloc, { herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI(H5O_copy_obj_by_ref, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert(src_oloc); HDassert(dst_oloc); @@ -1141,7 +1146,7 @@ H5O_copy_expand_ref(H5F_t *file_src, void *_src_ref, hid_t dxpl_id, size_t i; /* Local index variable */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI(H5O_copy_expand_ref, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ HDassert(file_src); diff --git a/src/H5Odbg.c b/src/H5Odbg.c index 81f1e70..5c07b64 100644 --- a/src/H5Odbg.c +++ b/src/H5Odbg.c @@ -102,11 +102,11 @@ H5O_assert(const H5O_t *oh) size_t hdr_size; /* Size of header's chunks */ unsigned u, v; /* Local index variables */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_assert) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Initialize the tracking variables */ hdr_size = 0; - meta_space = H5O_SIZEOF_HDR(oh) + (H5O_SIZEOF_CHKHDR_OH(oh) * (oh->nchunks - 1)); + meta_space = (size_t)H5O_SIZEOF_HDR(oh) + (size_t)(H5O_SIZEOF_CHKHDR_OH(oh) * (oh->nchunks - 1)); mesg_space = 0; free_space = 0; @@ -140,7 +140,7 @@ H5O_assert(const H5O_t *oh) /* Check for correct chunk #0 size flags */ if(oh->version > H5O_VERSION_1) { - uint64_t chunk0_size = oh->chunk[0].size - H5O_SIZEOF_HDR(oh); + uint64_t chunk0_size = oh->chunk[0].size - (size_t)H5O_SIZEOF_HDR(oh); if(chunk0_size <= 255) HDassert((oh->flags & H5O_HDR_CHUNK0_SIZE) == H5O_HDR_CHUNK0_1); @@ -154,13 +154,21 @@ H5O_assert(const H5O_t *oh) /* Loop over all messages in object header */ for(u = 0, curr_msg = &oh->mesg[0]; u < oh->nmesgs; u++, curr_msg++) { + uint8_t *curr_hdr; /* Start of current message header */ + size_t curr_tot_size; /* Total size of current message (including header) */ + + curr_hdr = curr_msg->raw - H5O_SIZEOF_MSGHDR_OH(oh); + curr_tot_size = curr_msg->raw_size + (size_t)H5O_SIZEOF_MSGHDR_OH(oh); + /* Accumulate information, based on the type of message */ if(H5O_NULL_ID == curr_msg->type->id) - free_space += H5O_SIZEOF_MSGHDR_OH(oh) + curr_msg->raw_size; + free_space += curr_tot_size; else if(H5O_CONT_ID == curr_msg->type->id) { H5O_cont_t *cont = (H5O_cont_t *)curr_msg->native; hbool_t found_chunk = FALSE; /* Found a chunk that matches */ + HDassert(cont); + /* Increment # of continuation messages found */ cont_msgs_found++; @@ -175,11 +183,14 @@ H5O_assert(const H5O_t *oh) } /* end for */ HDassert(found_chunk); - meta_space += H5O_SIZEOF_MSGHDR_OH(oh) + curr_msg->raw_size; + meta_space += curr_tot_size; } /* end if */ else { - meta_space += H5O_SIZEOF_MSGHDR_OH(oh); + meta_space += (size_t)H5O_SIZEOF_MSGHDR_OH(oh); mesg_space += curr_msg->raw_size; + + /* Make sure the message has a native form if it is marked dirty */ + HDassert(curr_msg->native || !curr_msg->dirty); } /* end else */ /* Make certain that the message is in a valid chunk */ @@ -190,17 +201,19 @@ H5O_assert(const H5O_t *oh) HDassert(oh->chunk[curr_msg->chunkno].gap == 0); /* Make certain that the message is completely in a chunk message area */ - HDassert(curr_msg->raw_size <= (oh->chunk[curr_msg->chunkno].size) - (H5O_SIZEOF_CHKSUM_OH(oh) + oh->chunk[curr_msg->chunkno].gap)); + HDassert(curr_tot_size <= (oh->chunk[curr_msg->chunkno].size) - (H5O_SIZEOF_CHKSUM_OH(oh) + oh->chunk[curr_msg->chunkno].gap)); if(curr_msg->chunkno == 0) - HDassert(curr_msg->raw >= oh->chunk[curr_msg->chunkno].image + (H5O_SIZEOF_HDR(oh) - H5O_SIZEOF_CHKSUM_OH(oh))); + HDassert(curr_hdr >= oh->chunk[curr_msg->chunkno].image + (H5O_SIZEOF_HDR(oh) - H5O_SIZEOF_CHKSUM_OH(oh))); else - HDassert(curr_msg->raw >= oh->chunk[curr_msg->chunkno].image + (H5O_SIZEOF_CHKHDR_OH(oh) - H5O_SIZEOF_CHKSUM_OH(oh))); + HDassert(curr_hdr >= oh->chunk[curr_msg->chunkno].image + (H5O_SIZEOF_CHKHDR_OH(oh) - H5O_SIZEOF_CHKSUM_OH(oh))); HDassert(curr_msg->raw + curr_msg->raw_size <= (oh->chunk[curr_msg->chunkno].image + oh->chunk[curr_msg->chunkno].size) - (H5O_SIZEOF_CHKSUM_OH(oh) + oh->chunk[curr_msg->chunkno].gap)); /* Make certain that no other messages overlap this message */ for(v = 0, tmp_msg = &oh->mesg[0]; v < oh->nmesgs; v++, tmp_msg++) { if(u != v) - HDassert(!(tmp_msg->raw >= curr_msg->raw && tmp_msg->raw < (curr_msg->raw + curr_msg->raw_size))); + HDassert(!((tmp_msg->raw - H5O_SIZEOF_MSGHDR_OH(oh)) >= curr_hdr + && (tmp_msg->raw - H5O_SIZEOF_MSGHDR_OH(oh)) + < (curr_hdr + curr_tot_size))); } /* end for */ } /* end for */ @@ -237,7 +250,7 @@ H5O_debug_id(unsigned type_id, H5F_t *f, hid_t dxpl_id, const void *mesg, FILE * const H5O_msg_class_t *type; /* Actual H5O class type for the ID */ herr_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5O_debug_id,FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args */ HDassert(type_id < NELMTS(H5O_msg_class_g)); @@ -284,7 +297,7 @@ H5O_debug_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh, haddr_t addr, FILE *stream, i unsigned i; /* Local index variable */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI(H5O_debug_real, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* check args */ HDassert(f); @@ -537,7 +550,7 @@ H5O_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int f H5O_loc_t loc; /* Object location for object to delete */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5O_debug, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* check args */ HDassert(f); diff --git a/src/H5Odrvinfo.c b/src/H5Odrvinfo.c index 864fe9e..005b74a 100644 --- a/src/H5Odrvinfo.c +++ b/src/H5Odrvinfo.c @@ -86,7 +86,7 @@ H5O_drvinfo_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, H5O_drvinfo_t *mesg; /* Native message */ void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_drvinfo_decode) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(f); @@ -143,7 +143,7 @@ H5O_drvinfo_encode(H5F_t UNUSED *f, hbool_t UNUSED disable_shared, uint8_t *p, c { const H5O_drvinfo_t *mesg = (const H5O_drvinfo_t *)_mesg; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_drvinfo_encode) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ HDassert(f); @@ -183,7 +183,7 @@ H5O_drvinfo_copy(const void *_mesg, void *_dest) H5O_drvinfo_t *dest = (H5O_drvinfo_t *)_dest; void *ret_value; - FUNC_ENTER_NOAPI_NOINIT(H5O_drvinfo_copy) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(mesg); @@ -230,7 +230,7 @@ H5O_drvinfo_size(const H5F_t UNUSED *f, hbool_t UNUSED disable_shared, const voi const H5O_drvinfo_t *mesg = (const H5O_drvinfo_t *)_mesg; size_t ret_value; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_drvinfo_size) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ HDassert(f); @@ -264,7 +264,7 @@ H5O_drvinfo_reset(void *_mesg) { H5O_drvinfo_t *mesg = (H5O_drvinfo_t *) _mesg; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_drvinfo_reset) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ HDassert(mesg); @@ -294,7 +294,7 @@ H5O_drvinfo_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, FILE { const H5O_drvinfo_t *mesg = (const H5O_drvinfo_t *)_mesg; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_drvinfo_debug) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ HDassert(f); diff --git a/src/H5Odtype.c b/src/H5Odtype.c index f419e44..9ccb51b 100644 --- a/src/H5Odtype.c +++ b/src/H5Odtype.c @@ -104,7 +104,7 @@ const H5O_msg_class_t H5O_MSG_DTYPE[1] = {{ H5O_dtype_can_share, /* can share method */ H5O_dtype_pre_copy_file, /* pre copy native value to file */ H5O_dtype_shared_copy_file, /* copy native value to file */ - NULL, /* post copy native value to file */ + H5O_dtype_shared_post_copy_file, /* post copy native value to file */ NULL, /* get creation index */ NULL, /* set creation index */ H5O_dtype_shared_debug /* debug the message */ @@ -134,7 +134,7 @@ H5O_dtype_decode_helper(H5F_t *f, unsigned *ioflags/*in,out*/, const uint8_t **p size_t z; htri_t ret_value = FALSE; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_dtype_decode_helper) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(pp && *pp); @@ -597,7 +597,7 @@ H5O_dtype_encode_helper(const H5F_t *f, uint8_t **pp, const H5T_t *dt) size_t n, z; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_dtype_encode_helper) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(pp && *pp); @@ -1087,7 +1087,7 @@ H5O_dtype_decode(H5F_t *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, unsigned H5T_t *dt = NULL; void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_dtype_decode) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(p); @@ -1131,7 +1131,7 @@ H5O_dtype_encode(H5F_t *f, uint8_t *p, const void *mesg) const H5T_t *dt = (const H5T_t *) mesg; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_dtype_encode) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(f); @@ -1171,7 +1171,7 @@ H5O_dtype_copy(const void *_src, void *_dst) H5T_t *dst; void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_dtype_copy) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(src); @@ -1218,7 +1218,7 @@ H5O_dtype_size(const H5F_t *f, const void *_mesg) unsigned u; /* Local index variable */ size_t ret_value; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_dtype_size) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(f); HDassert(dt); @@ -1351,7 +1351,7 @@ H5O_dtype_reset(void *_mesg) { H5T_t *dt = (H5T_t *) _mesg; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_dtype_reset) + FUNC_ENTER_NOAPI_NOINIT_NOERR if(dt) H5T_free(dt); @@ -1377,7 +1377,7 @@ H5O_dtype_reset(void *_mesg) static herr_t H5O_dtype_free(void *mesg) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_dtype_free) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(mesg); @@ -1406,7 +1406,7 @@ H5O_dtype_set_share(void *_mesg/*in,out*/, const H5O_shared_t *sh) H5T_t *dt = (H5T_t *)_mesg; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT(H5O_dtype_set_share) + FUNC_ENTER_NOAPI_NOINIT HDassert(dt); HDassert(sh); @@ -1462,7 +1462,7 @@ H5O_dtype_can_share(const void *_mesg) htri_t tri_ret; htri_t ret_value = TRUE; - FUNC_ENTER_NOAPI_NOINIT(H5O_dtype_can_share) + FUNC_ENTER_NOAPI_NOINIT HDassert(mesg); @@ -1507,7 +1507,7 @@ H5O_dtype_pre_copy_file(H5F_t *file_src, const void *mesg_src, H5D_copy_file_ud_t *udata = (H5D_copy_file_ud_t *)_udata; /* Dataset copying user data */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_dtype_pre_copy_file) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(file_src); @@ -1556,7 +1556,7 @@ H5O_dtype_copy_file(H5F_t UNUSED *file_src, const H5O_msg_class_t *mesg_type, H5T_t *dst_mesg; /* Destination datatype */ void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_dtype_copy_file) + FUNC_ENTER_NOAPI_NOINIT /* Perform a normal copy of the object header message */ if(NULL == (dst_mesg = (H5T_t *)H5O_dtype_copy(native_src, NULL))) @@ -1604,7 +1604,7 @@ H5O_dtype_debug(H5F_t *f, hid_t dxpl_id, const void *mesg, FILE *stream, unsigned i; size_t k; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_dtype_debug) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ HDassert(f); diff --git a/src/H5Oefl.c b/src/H5Oefl.c index b97138f..e4b21f0 100644 --- a/src/H5Oefl.c +++ b/src/H5Oefl.c @@ -99,7 +99,7 @@ H5O_efl_decode(H5F_t *f, hid_t dxpl_id, H5O_t UNUSED *open_oh, size_t u; /* Local index variable */ void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_efl_decode) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(f); @@ -197,7 +197,7 @@ H5O_efl_encode(H5F_t *f, hbool_t UNUSED disable_shared, uint8_t *p, const void * const H5O_efl_t *mesg = (const H5O_efl_t *)_mesg; size_t u; /* Local index variable */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_efl_encode) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ HDassert(f); @@ -261,7 +261,7 @@ H5O_efl_copy(const void *_mesg, void *_dest) size_t u; /* Local index variable */ void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_efl_copy) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(mesg); @@ -345,7 +345,7 @@ H5O_efl_size(const H5F_t *f, hbool_t UNUSED disable_shared, const void *_mesg) const H5O_efl_t *mesg = (const H5O_efl_t *) _mesg; size_t ret_value = 0; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_efl_size) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ HDassert(f); @@ -382,7 +382,7 @@ H5O_efl_reset(void *_mesg) H5O_efl_t *mesg = (H5O_efl_t *) _mesg; size_t u; /* Local index variable */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_efl_reset) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ HDassert(mesg); @@ -420,7 +420,7 @@ H5O_efl_total_size (H5O_efl_t *efl) { hsize_t ret_value = 0, tmp; - FUNC_ENTER_NOAPI_NOINIT(H5O_efl_total_size) + FUNC_ENTER_NOAPI_NOINIT if(efl->nused > 0 && H5O_EFL_UNLIMITED == efl->slot[efl->nused - 1].size) ret_value = H5O_EFL_UNLIMITED; @@ -464,7 +464,7 @@ H5O_efl_copy_file(H5F_t UNUSED *file_src, void *mesg_src, H5F_t *file_dst, size_t idx, size, name_offset, heap_size; void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(H5O_efl_copy_file, dxpl_id, H5AC__COPIED_TAG, NULL) + FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, H5AC__COPIED_TAG, NULL) /* check args */ HDassert(efl_src); @@ -548,7 +548,7 @@ H5O_efl_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, FILE * s char buf[64]; size_t u; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_efl_debug) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ HDassert(f); diff --git a/src/H5Ofill.c b/src/H5Ofill.c index c7c743a..9fa6108 100644 --- a/src/H5Ofill.c +++ b/src/H5Ofill.c @@ -120,7 +120,7 @@ const H5O_msg_class_t H5O_MSG_FILL[1] = {{ NULL, /*can share method */ NULL, /* pre copy native value to file */ H5O_fill_shared_copy_file, /* copy native value to file */ - NULL, /* post copy native value to file */ + H5O_fill_shared_post_copy_file, /* post copy native value to file */ NULL, /* get creation index */ NULL, /* set creation index */ H5O_fill_shared_debug /*debug the message */ @@ -144,7 +144,7 @@ const H5O_msg_class_t H5O_MSG_FILL_NEW[1] = {{ NULL, /*can share method */ NULL, /* pre copy native value to file */ H5O_fill_new_shared_copy_file, /* copy native value to file */ - NULL, /* post copy native value to file */ + H5O_fill_new_shared_post_copy_file, /* post copy native value to file */ NULL, /* get creation index */ NULL, /* set creation index */ H5O_fill_new_shared_debug /*debug the message */ @@ -188,7 +188,7 @@ H5O_fill_new_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh H5O_fill_t *fill = NULL; void *ret_value; - FUNC_ENTER_NOAPI_NOINIT(H5O_fill_new_decode) + FUNC_ENTER_NOAPI_NOINIT HDassert(f); HDassert(p); @@ -302,7 +302,7 @@ H5O_fill_old_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh H5O_fill_t *fill = NULL; /* Decoded fill value message */ void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_fill_old_decode) + FUNC_ENTER_NOAPI_NOINIT HDassert(f); HDassert(p); @@ -361,7 +361,7 @@ H5O_fill_new_encode(H5F_t UNUSED *f, uint8_t *p, const void *_fill) { const H5O_fill_t *fill = (const H5O_fill_t *)_fill; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_fill_new_encode) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(f); HDassert(p); @@ -457,7 +457,7 @@ H5O_fill_old_encode(H5F_t UNUSED *f, uint8_t *p, const void *_fill) { const H5O_fill_t *fill = (const H5O_fill_t *)_fill; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_fill_old_encode) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(f); HDassert(p); @@ -494,7 +494,7 @@ H5O_fill_copy(const void *_src, void *_dst) H5O_fill_t *dst = (H5O_fill_t *)_dst; void *ret_value; - FUNC_ENTER_NOAPI_NOINIT(H5O_fill_copy) + FUNC_ENTER_NOAPI_NOINIT HDassert(src); @@ -611,7 +611,7 @@ H5O_fill_new_size(const H5F_t UNUSED *f, const void *_fill) const H5O_fill_t *fill = (const H5O_fill_t *)_fill; size_t ret_value; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_fill_new_size) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(f); HDassert(fill); @@ -658,7 +658,7 @@ H5O_fill_old_size(const H5F_t UNUSED *f, const void *_fill) { const H5O_fill_t *fill = (const H5O_fill_t *)_fill; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_fill_old_size) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(fill); @@ -684,7 +684,7 @@ H5O_fill_reset_dyn(H5O_fill_t *fill) hid_t fill_type_id = -1; /* Datatype ID for fill value datatype when reclaiming VL fill values */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5O_fill_reset_dyn, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert(fill); @@ -749,7 +749,7 @@ H5O_fill_reset(void *_fill) { H5O_fill_t *fill = (H5O_fill_t *)_fill; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_fill_reset) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(fill); @@ -780,7 +780,7 @@ H5O_fill_reset(void *_fill) static herr_t H5O_fill_free(void *fill) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_fill_free) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(fill); @@ -809,7 +809,7 @@ H5O_fill_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_fill, FILE *s const H5O_fill_t *fill = (const H5O_fill_t *)_fill; H5D_fill_value_t fill_status; /* Whether the fill value is defined */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_fill_debug) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(f); HDassert(fill); @@ -912,7 +912,7 @@ H5O_fill_convert(H5O_fill_t *fill, H5T_t *dset_type, hbool_t *fill_changed, hid_ hid_t src_id = -1, dst_id = -1; /* Datatype identifiers */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_fill_convert) + FUNC_ENTER_NOAPI_NOINIT HDassert(fill); HDassert(dset_type); @@ -1007,7 +1007,7 @@ done: herr_t H5O_fill_set_latest_version(H5O_fill_t *fill) { - FUNC_ENTER_NOAPI_NOFUNC(H5O_fill_set_latest_version) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ HDassert(fill); diff --git a/src/H5Oflush.c b/src/H5Oflush.c index 2b9bd40..94c0154 100644 --- a/src/H5Oflush.c +++ b/src/H5Oflush.c @@ -28,7 +28,6 @@ /* Module Setup */ /****************/ -#define H5F_PACKAGE /* suppress error about including H5Fpkg */ #define H5O_PACKAGE /* suppress error about including H5Opkg */ /***********/ @@ -37,7 +36,9 @@ #include "H5Dprivate.h" /* Datasets */ #include "H5Eprivate.h" /* Errors */ -#include "H5Fpkg.h" /* Files */ +#include "H5Fprivate.h" /* Files */ +#include "H5Gprivate.h" /* Groups */ +#include "H5Iprivate.h" /* IDs */ #include "H5Opkg.h" /* Objects */ /*************/ @@ -63,7 +64,7 @@ H5Oflush(hid_t obj_id) H5O_loc_t *oloc; /* object location */ herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_API(H5Oflush, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", obj_id); /* Check args */ @@ -99,7 +100,7 @@ H5O_flush_metadata(const H5O_loc_t *oloc, hid_t dxpl_id) herr_t ret_value = SUCCEED; /* Return value */ haddr_t tag = 0; - FUNC_ENTER_NOAPI(H5O_flush_metadata, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args */ HDassert(oloc); @@ -150,7 +151,7 @@ H5Orefresh(hid_t oid) H5O_loc_t *oloc; /* object location */ hid_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_API(H5Orefresh, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", oid); /* Check args */ @@ -193,7 +194,7 @@ H5O_refresh_metadata(hid_t oid, H5O_loc_t oloc, hid_t dxpl_id) hid_t ret_value = SUCCEED; H5I_type_t type; - FUNC_ENTER_NOAPI(H5O_refresh_metadata, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Get the object's object header */ if(NULL == (oh = H5O_protect(&oloc, dxpl_id, H5AC_READ))) @@ -210,12 +211,9 @@ H5O_refresh_metadata(hid_t oid, H5O_loc_t oloc, hid_t dxpl_id) H5G_loc_copy(&obj_loc, &tmp_loc, H5_COPY_DEEP); /* Get object header's address (i.e. the tag value for this object) */ - if (HADDR_UNDEF == (tag = H5O_OH_GET_ADDR(oh))) + if(HADDR_UNDEF == (tag = H5O_OH_GET_ADDR(oh))) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to get address of object header") - /* Get object's type */ - type = H5I_get_type(oid); - /* Unprotect object header before attempting to flush it */ if(oh && H5O_unprotect(&oloc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") @@ -224,15 +222,15 @@ H5O_refresh_metadata(hid_t oid, H5O_loc_t oloc, hid_t dxpl_id) oh = NULL; /* Close the object */ - if(H5I_dec_ref(oid, TRUE) < 0) + if(H5I_dec_ref(oid) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to close object") /* Flush the object's metadata before evicting it */ - if (H5O_flush_metadata(&oloc, dxpl_id) < 0) + if(H5O_flush_metadata(&oloc, dxpl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTFLUSH, FAIL, "unable to flush object's metadata") /* Evict the object's tagged metadata */ - if (H5F_evict_tagged_metadata(oloc.file, tag, dxpl_id)<0) + if(H5F_evict_tagged_metadata(oloc.file, tag, dxpl_id)<0) HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "unable to evict metadata") switch (type) diff --git a/src/H5Ofsinfo.c b/src/H5Ofsinfo.c index 49a46fa..3f0b15d 100644 --- a/src/H5Ofsinfo.c +++ b/src/H5Ofsinfo.c @@ -91,7 +91,7 @@ H5O_fsinfo_decode(H5F_t *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, H5FD_mem_t type; /* Memory type for iteration */ void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_fsinfo_decode) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(f); @@ -146,7 +146,7 @@ H5O_fsinfo_encode(H5F_t *f, hbool_t UNUSED disable_shared, uint8_t *p, const voi const H5O_fsinfo_t *fsinfo = (const H5O_fsinfo_t *)_mesg; H5FD_mem_t type; /* Memory type for iteration */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_fsinfo_encode) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ HDassert(f); @@ -187,7 +187,7 @@ H5O_fsinfo_copy(const void *_mesg, void *_dest) H5O_fsinfo_t *dest = (H5O_fsinfo_t *) _dest; void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_fsinfo_copy) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(fsinfo); @@ -226,7 +226,7 @@ H5O_fsinfo_size(const H5F_t *f, hbool_t UNUSED disable_shared, const void *_mesg size_t fs_addr_size = 0; size_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_fsinfo_size) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Addresses of free-space managers exist only for H5F_FILE_SPACE_ALL_PERSIST type */ @@ -255,7 +255,7 @@ H5O_fsinfo_size(const H5F_t *f, hbool_t UNUSED disable_shared, const void *_mesg static herr_t H5O_fsinfo_free(void *mesg) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_fsinfo_free) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(mesg); @@ -283,7 +283,7 @@ H5O_fsinfo_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, FILE const H5O_fsinfo_t *fsinfo = (const H5O_fsinfo_t *) _mesg; H5FD_mem_t type; /* Memory type for iteration */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_fsinfo_debug) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ HDassert(f); diff --git a/src/H5Oginfo.c b/src/H5Oginfo.c index 622edb3..418b053 100644 --- a/src/H5Oginfo.c +++ b/src/H5Oginfo.c @@ -102,7 +102,7 @@ H5O_ginfo_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, unsigned char flags; /* Flags for encoding group info */ void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_ginfo_decode) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(p); @@ -173,7 +173,7 @@ H5O_ginfo_encode(H5F_t UNUSED *f, hbool_t UNUSED disable_shared, uint8_t *p, con const H5O_ginfo_t *ginfo = (const H5O_ginfo_t *) _mesg; unsigned char flags; /* Flags for encoding group info */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_ginfo_encode) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ HDassert(p); @@ -226,7 +226,7 @@ H5O_ginfo_copy(const void *_mesg, void *_dest) H5O_ginfo_t *dest = (H5O_ginfo_t *)_dest; void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_ginfo_copy) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(ginfo); @@ -267,7 +267,7 @@ H5O_ginfo_size(const H5F_t UNUSED *f, hbool_t UNUSED disable_shared, const void const H5O_ginfo_t *ginfo = (const H5O_ginfo_t *)_mesg; size_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_ginfo_size) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Set return value */ ret_value = 1 + /* Version */ @@ -300,7 +300,7 @@ H5O_ginfo_size(const H5F_t UNUSED *f, hbool_t UNUSED disable_shared, const void static herr_t H5O_ginfo_free(void *mesg) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_ginfo_free) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(mesg); @@ -329,7 +329,7 @@ H5O_ginfo_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, FILE * { const H5O_ginfo_t *ginfo = (const H5O_ginfo_t *) _mesg; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_ginfo_debug) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ HDassert(f); diff --git a/src/H5Olayout.c b/src/H5Olayout.c index aec3c0a..8946d9b 100644 --- a/src/H5Olayout.c +++ b/src/H5Olayout.c @@ -106,7 +106,7 @@ H5O_layout_decode(H5F_t *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, unsigned u; void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_layout_decode) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(f); @@ -350,6 +350,8 @@ H5O_layout_decode(H5F_t *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, mesg->ops = H5D_LOPS_CHUNK; break; + case H5D_LAYOUT_ERROR: + case H5D_NLAYOUTS: default: HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, NULL, "Invalid layout class") } /* end switch */ @@ -408,7 +410,7 @@ H5O_layout_encode(H5F_t *f, hbool_t UNUSED disable_shared, uint8_t *p, const voi unsigned u; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_layout_encode) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(f); @@ -514,6 +516,8 @@ H5O_layout_encode(H5F_t *f, hbool_t UNUSED disable_shared, uint8_t *p, const voi } /* end else */ break; + case H5D_LAYOUT_ERROR: + case H5D_NLAYOUTS: default: HGOTO_ERROR(H5E_OHDR, H5E_CANTENCODE, FAIL, "Invalid layout class") } /* end switch */ @@ -545,7 +549,7 @@ H5O_layout_copy(const void *_mesg, void *_dest) H5O_layout_t *dest = (H5O_layout_t *) _dest; void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_layout_copy) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(mesg); @@ -605,7 +609,7 @@ H5O_layout_size(const H5F_t *f, hbool_t UNUSED disable_shared, const void *_mesg const H5O_layout_t *mesg = (const H5O_layout_t *) _mesg; size_t ret_value; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_layout_size) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ HDassert(f); @@ -638,7 +642,7 @@ H5O_layout_reset(void *_mesg) H5O_layout_t *mesg = (H5O_layout_t *)_mesg; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT(H5O_layout_reset) + FUNC_ENTER_NOAPI_NOINIT if(mesg) { /* Reset associated storage information, if it's been initialized */ @@ -674,7 +678,7 @@ H5O_layout_free(void *_mesg) H5O_layout_t *mesg = (H5O_layout_t *) _mesg; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_layout_free) + FUNC_ENTER_NOAPI_NOINIT HDassert(mesg); @@ -707,7 +711,7 @@ H5O_layout_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, void *_mesg) H5O_layout_t *mesg = (H5O_layout_t *) _mesg; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_layout_delete) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(f); @@ -734,6 +738,8 @@ H5O_layout_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, void *_mesg) HGOTO_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to free raw data") break; + case H5D_LAYOUT_ERROR: + case H5D_NLAYOUTS: default: HGOTO_ERROR(H5E_OHDR, H5E_BADTYPE, FAIL, "not valid storage type") } /* end switch */ @@ -766,7 +772,7 @@ H5O_layout_pre_copy_file(H5F_t UNUSED *file_src, const void *mesg_src, H5D_copy_file_ud_t *udata = (H5D_copy_file_ud_t *)_udata; /* Dataset copying user data */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_layout_pre_copy_file) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(layout_src); @@ -810,7 +816,7 @@ H5O_layout_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst, hbool_t copied = FALSE; /* Whether the data was copied */ void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_layout_copy_file) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(file_src); @@ -860,6 +866,8 @@ H5O_layout_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst, } /* end if */ break; + case H5D_LAYOUT_ERROR: + case H5D_NLAYOUTS: default: HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, NULL, "Invalid layout class") } /* end switch */ @@ -905,7 +913,7 @@ H5O_layout_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, const H5O_layout_t *mesg = (const H5O_layout_t *) _mesg; unsigned u; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_layout_debug) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ HDassert(f); @@ -986,6 +994,8 @@ H5O_layout_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, "Data Size:", mesg->storage.u.compact.size); break; + case H5D_LAYOUT_ERROR: + case H5D_NLAYOUTS: default: HDfprintf(stream, "%*s%-*s %s (%u)\n", indent, "", fwidth, "Type:", "Unknown", (unsigned)mesg->type); diff --git a/src/H5Olinfo.c b/src/H5Olinfo.c index 7644131..acdd1e1 100644 --- a/src/H5Olinfo.c +++ b/src/H5Olinfo.c @@ -25,12 +25,14 @@ */ #define H5G_PACKAGE /*suppress error about including H5Gpkg */ +#define H5L_PACKAGE /*suppress error about including H5Lpkg */ #define H5O_PACKAGE /*suppress error about including H5Opkg */ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ #include "H5FLprivate.h" /* Free lists */ #include "H5Gpkg.h" /* Groups */ +#include "H5Lpkg.h" /* Links */ #include "H5Opkg.h" /* Object headers */ @@ -118,7 +120,7 @@ H5O_linfo_decode(H5F_t *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, unsigned char index_flags; /* Flags for encoding link index info */ void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_linfo_decode) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(f); @@ -191,7 +193,7 @@ H5O_linfo_encode(H5F_t *f, hbool_t UNUSED disable_shared, uint8_t *p, const void const H5O_linfo_t *linfo = (const H5O_linfo_t *)_mesg; unsigned char index_flags; /* Flags for encoding link index info */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_linfo_encode) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ HDassert(f); @@ -248,7 +250,7 @@ H5O_linfo_copy(const void *_mesg, void *_dest) H5O_linfo_t *dest = (H5O_linfo_t *) _dest; void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_linfo_copy) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(linfo); @@ -288,7 +290,7 @@ H5O_linfo_size(const H5F_t *f, hbool_t UNUSED disable_shared, const void *_mesg) const H5O_linfo_t *linfo = (const H5O_linfo_t *)_mesg; size_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_linfo_size) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Set return value */ ret_value = 1 /* Version */ @@ -317,7 +319,7 @@ H5O_linfo_size(const H5F_t *f, hbool_t UNUSED disable_shared, const void *_mesg) static herr_t H5O_linfo_free(void *mesg) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_linfo_free) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(mesg); @@ -345,7 +347,7 @@ H5O_linfo_delete(H5F_t *f, hid_t dxpl_id, H5O_t UNUSED *open_oh, void *_mesg) H5O_linfo_t *linfo = (H5O_linfo_t *)_mesg; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_linfo_delete) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(f); @@ -353,7 +355,7 @@ H5O_linfo_delete(H5F_t *f, hid_t dxpl_id, H5O_t UNUSED *open_oh, void *_mesg) /* If the group is using "dense" link storage, delete it */ if(H5F_addr_defined(linfo->fheap_addr)) - if(H5G_dense_delete(f, dxpl_id, linfo, TRUE) < 0) + if(H5G__dense_delete(f, dxpl_id, linfo, TRUE) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to free dense link storage") done: @@ -385,7 +387,7 @@ H5O_linfo_copy_file(H5F_t UNUSED *file_src, void *native_src, H5F_t *file_dst, H5G_copy_file_ud_t *udata = (H5G_copy_file_ud_t *) _udata; void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(H5O_linfo_copy_file, dxpl_id, H5AC__COPIED_TAG, NULL) + FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, H5AC__COPIED_TAG, NULL) /* check args */ HDassert(linfo_src); @@ -413,7 +415,7 @@ H5O_linfo_copy_file(H5F_t UNUSED *file_src, void *native_src, H5F_t *file_dst, */ if(H5F_addr_defined(linfo_src->fheap_addr)) { /* Create the dense link storage */ - if(H5G_dense_create(file_dst, dxpl_id, linfo_dst, udata->common.src_pline) < 0) + if(H5G__dense_create(file_dst, dxpl_id, linfo_dst, udata->common.src_pline) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, NULL, "unable to create 'dense' form of new format group") } /* end if */ } /* end else */ @@ -453,14 +455,14 @@ H5O_linfo_post_copy_file_cb(const H5O_link_t *src_lnk, void *_udata) hbool_t dst_lnk_init = FALSE; /* Whether the destination link is initialized */ herr_t ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_linfo_post_copy_file_cb) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments */ HDassert(src_lnk); HDassert(udata); /* Copy the link (and the object it points to) */ - if(H5G_link_copy_file(udata->dst_oloc->file, udata->dxpl_id, src_lnk, + if(H5L_link_copy_file(udata->dst_oloc->file, udata->dxpl_id, src_lnk, udata->src_oloc, &dst_lnk, udata->cpy_info) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, H5_ITER_ERROR, "unable to copy link") dst_lnk_init = TRUE; @@ -470,7 +472,7 @@ H5O_linfo_post_copy_file_cb(const H5O_link_t *src_lnk, void *_udata) /* Insert the new object in the destination file's group */ /* (Doesn't increment the link count - that's already been taken care of for hard links) */ - if(H5G_dense_insert(udata->dst_oloc->file, udata->dxpl_id, udata->dst_linfo, &dst_lnk) < 0) + if(H5G__dense_insert(udata->dst_oloc->file, udata->dxpl_id, udata->dst_linfo, &dst_lnk) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINSERT, H5_ITER_ERROR, "unable to insert destination link") /* Reset metadata tag in dxpl_id */ @@ -505,7 +507,7 @@ H5O_linfo_post_copy_file(const H5O_loc_t *src_oloc, const void *mesg_src, H5O_linfo_t *linfo_dst = (H5O_linfo_t *)mesg_dst; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_linfo_post_copy_file) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(src_oloc && src_oloc->file); @@ -531,7 +533,7 @@ H5O_linfo_post_copy_file(const H5O_loc_t *src_oloc, const void *mesg_src, udata.cpy_info = cpy_info; /* Iterate over the links in the group, building a table of the link messages */ - if(H5G_dense_iterate(src_oloc->file, dxpl_id, linfo_src, H5_INDEX_NAME, H5_ITER_NATIVE, (hsize_t)0, NULL, H5O_linfo_post_copy_file_cb, &udata) < 0) + if(H5G__dense_iterate(src_oloc->file, dxpl_id, linfo_src, H5_INDEX_NAME, H5_ITER_NATIVE, (hsize_t)0, NULL, H5O_linfo_post_copy_file_cb, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTNEXT, FAIL, "error iterating over links") } /* end if */ @@ -559,7 +561,7 @@ H5O_linfo_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, FILE * { const H5O_linfo_t *linfo = (const H5O_linfo_t *) _mesg; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_linfo_debug) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ HDassert(f); diff --git a/src/H5Olink.c b/src/H5Olink.c index 7e14558..ccc6d0e 100644 --- a/src/H5Olink.c +++ b/src/H5Olink.c @@ -25,6 +25,7 @@ */ #define H5G_PACKAGE /*suppress error about including H5Gpkg */ +#define H5L_PACKAGE /*suppress error about including H5Lpkg */ #define H5O_PACKAGE /*suppress error about including H5Opkg */ #include "H5private.h" /* Generic Functions */ @@ -32,7 +33,7 @@ #include "H5FLprivate.h" /* Free lists */ #include "H5Gpkg.h" /* Groups */ #include "H5Iprivate.h" /* IDs */ -#include "H5Lprivate.h" /* Links */ +#include "H5Lpkg.h" /* Links */ #include "H5MMprivate.h" /* Memory management */ #include "H5Opkg.h" /* Object headers */ @@ -124,7 +125,7 @@ H5O_link_decode(H5F_t *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, unsigned char link_flags; /* Flags for encoding link info */ void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_link_decode) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(f); @@ -281,7 +282,7 @@ H5O_link_encode(H5F_t *f, hbool_t UNUSED disable_shared, uint8_t *p, const void uint64_t len; /* Length of a string in the message */ unsigned char link_flags; /* Flags for encoding link info */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_link_encode) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ HDassert(f); @@ -405,7 +406,7 @@ H5O_link_copy(const void *_mesg, void *_dest) H5O_link_t *dest = (H5O_link_t *) _dest; void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_link_copy) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(lnk); @@ -474,7 +475,7 @@ H5O_link_size(const H5F_t *f, hbool_t UNUSED disable_shared, const void *_mesg) size_t name_size; /* Size of encoded name length */ size_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_link_size) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Get name's length */ name_len = (uint64_t)HDstrlen(lnk->name); @@ -538,7 +539,7 @@ H5O_link_reset(void *_mesg) { H5O_link_t *lnk = (H5O_link_t *)_mesg; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_link_reset) + FUNC_ENTER_NOAPI_NOINIT_NOERR if(lnk) { /* Free information for link (but don't free link pointer) */ @@ -572,7 +573,7 @@ H5O_link_free(void *_mesg) { H5O_link_t *lnk = (H5O_link_t *)_mesg; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_link_free) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(lnk); @@ -602,7 +603,7 @@ H5O_link_delete(H5F_t *f, hid_t dxpl_id, H5O_t UNUSED *open_oh, void *_mesg) H5O_link_t *lnk = (H5O_link_t *)_mesg; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5O_link_delete, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* check args */ HDassert(f); @@ -675,7 +676,7 @@ static herr_t H5O_link_pre_copy_file(H5F_t UNUSED *file_src, const void UNUSED *native_src, hbool_t *deleted, const H5O_copy_t *cpy_info, void UNUSED *udata) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_link_pre_copy_file) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ HDassert(deleted); @@ -715,7 +716,7 @@ H5O_link_copy_file(H5F_t UNUSED *file_src, void *native_src, H5F_t UNUSED *file_ H5O_link_t *link_src = (H5O_link_t *)native_src; void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_link_copy_file) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(link_src); @@ -756,7 +757,7 @@ H5O_link_post_copy_file(const H5O_loc_t *src_oloc, const void *mesg_src, H5O_link_t *link_dst = (H5O_link_t *)mesg_dst; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_link_post_copy_file) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(link_src); @@ -768,7 +769,7 @@ H5O_link_post_copy_file(const H5O_loc_t *src_oloc, const void *mesg_src, HDassert(cpy_info->max_depth < 0 || cpy_info->curr_depth < cpy_info->max_depth); /* Copy the link (and the object it points to) */ - if(H5G_link_copy_file(dst_oloc->file, dxpl_id, link_src, src_oloc, link_dst, + if(H5L_link_copy_file(dst_oloc->file, dxpl_id, link_src, src_oloc, link_dst, cpy_info) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy link") @@ -797,7 +798,7 @@ H5O_link_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, FILE * const H5O_link_t *lnk = (const H5O_link_t *) _mesg; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_link_debug) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(f); diff --git a/src/H5Omessage.c b/src/H5Omessage.c index 0dd4565..f12c835 100644 --- a/src/H5Omessage.c +++ b/src/H5Omessage.c @@ -75,7 +75,7 @@ typedef struct { static herr_t H5O_msg_reset_real(const H5O_msg_class_t *type, void *native); static herr_t H5O_msg_remove_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, - unsigned sequence, hbool_t *oh_modified, void *_udata/*in,out*/); + unsigned sequence, unsigned *oh_modified, void *_udata/*in,out*/); static herr_t H5O_copy_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx, const H5O_msg_class_t *type, const void *mesg, unsigned mesg_flags, unsigned update_flags); @@ -119,7 +119,7 @@ H5O_msg_create(const H5O_loc_t *loc, unsigned type_id, unsigned mesg_flags, H5O_t *oh = NULL; /* Object header */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5O_msg_create, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* check args */ HDassert(loc); @@ -167,7 +167,7 @@ H5O_msg_append_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned type_id, const H5O_msg_class_t *type; /* Original H5O class type for the ID */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5O_msg_append_oh, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* check args */ HDassert(f); @@ -210,7 +210,7 @@ H5O_msg_append_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh, const H5O_msg_class_t *t int idx; /* Index of message to modify */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5O_msg_append_real, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* check args */ HDassert(f); @@ -263,7 +263,7 @@ H5O_msg_write(const H5O_loc_t *loc, unsigned type_id, unsigned mesg_flags, const H5O_msg_class_t *type; /* Actual H5O class type for the ID */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5O_msg_write, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* check args */ HDassert(loc); @@ -318,7 +318,7 @@ H5O_msg_write_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned type_id, const H5O_msg_class_t *type; /* Actual H5O class type for the ID */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(H5O_msg_write_oh, dxpl_id, oh->cache_info.addr, FAIL) + FUNC_ENTER_NOAPI_TAG(dxpl_id, oh->cache_info.addr, FAIL) /* check args */ HDassert(f); @@ -367,7 +367,7 @@ H5O_msg_write_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh, const H5O_msg_class_t *ty unsigned idx; /* Index of message to modify */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_msg_write_real) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(f); @@ -419,7 +419,7 @@ H5O_msg_write_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh, const H5O_msg_class_t *ty * XXX: This doesn't handle freeing extra space in object header from * a message shrinking. */ - if((status = H5SM_try_share(f, dxpl_id, ((mesg_flags & H5O_MSG_FLAG_SHARED) ? NULL : oh), idx_msg->type->id, mesg, &mesg_flags)) < 0) + if((status = H5SM_try_share(f, dxpl_id, ((mesg_flags & H5O_MSG_FLAG_SHARED) ? NULL : oh), 0, idx_msg->type->id, mesg, &mesg_flags)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_BADMESG, FAIL, "error while trying to share message") if(status == FALSE && (mesg_flags & H5O_MSG_FLAG_SHARED)) HGOTO_ERROR(H5E_OHDR, H5E_BADMESG, FAIL, "message changed sharing status") @@ -467,7 +467,7 @@ H5O_msg_read(const H5O_loc_t *loc, unsigned type_id, void *mesg, H5O_t *oh = NULL; /* Object header to use */ void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_TAG(H5O_msg_read, dxpl_id, loc->addr, NULL) + FUNC_ENTER_NOAPI_TAG(dxpl_id, loc->addr, NULL) /* check args */ HDassert(loc); @@ -522,7 +522,7 @@ H5O_msg_read_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned type_id, unsigned idx; /* Message's index in object header */ void *ret_value = NULL; - FUNC_ENTER_NOAPI_NOINIT(H5O_msg_read_oh) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(f); @@ -578,7 +578,7 @@ H5O_msg_reset(unsigned type_id, void *native) const H5O_msg_class_t *type; /* Actual H5O class type for the ID */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5O_msg_reset, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* check args */ HDassert(type_id < NELMTS(H5O_msg_class_g)); @@ -614,7 +614,7 @@ H5O_msg_reset_real(const H5O_msg_class_t *type, void *native) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_msg_reset_real) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(type); @@ -654,7 +654,7 @@ H5O_msg_free(unsigned type_id, void *mesg) const H5O_msg_class_t *type; /* Actual H5O class type for the ID */ void * ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOFUNC(H5O_msg_free) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ HDassert(type_id < NELMTS(H5O_msg_class_g)); @@ -683,7 +683,7 @@ H5O_msg_free(unsigned type_id, void *mesg) herr_t H5O_msg_free_mesg(H5O_mesg_t *mesg) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_msg_free_mesg) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ HDassert(mesg); @@ -713,7 +713,7 @@ H5O_msg_free_mesg(H5O_mesg_t *mesg) void * H5O_msg_free_real(const H5O_msg_class_t *type, void *msg_native) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_msg_free_real) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ HDassert(type); @@ -751,7 +751,7 @@ H5O_msg_copy(unsigned type_id, const void *mesg, void *dst) const H5O_msg_class_t *type; /* Actual H5O class type for the ID */ void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5O_msg_copy, NULL) + FUNC_ENTER_NOAPI(NULL) /* check args */ HDassert(mesg); @@ -790,7 +790,7 @@ H5O_msg_count(const H5O_loc_t *loc, unsigned type_id, hid_t dxpl_id) const H5O_msg_class_t *type; /* Actual H5O class type for the ID */ int ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5O_msg_count, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args */ HDassert(loc); @@ -836,7 +836,7 @@ H5O_msg_count_real(const H5O_t *oh, const H5O_msg_class_t *type) unsigned u; /* Local index variable */ unsigned ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_msg_count_real) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(oh); @@ -875,7 +875,7 @@ H5O_msg_exists(const H5O_loc_t *loc, unsigned type_id, hid_t dxpl_id) H5O_t *oh = NULL; /* Object header for location */ htri_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_TAG(H5O_msg_exists, dxpl_id, loc->addr, FAIL) + FUNC_ENTER_NOAPI_TAG(dxpl_id, loc->addr, FAIL) HDassert(loc); HDassert(loc->file); @@ -922,7 +922,7 @@ H5O_msg_exists_oh(const H5O_t *oh, unsigned type_id) unsigned u; /* Local index variable */ htri_t ret_value = FALSE; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_msg_exists_oh) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(oh); HDassert(type_id < NELMTS(H5O_msg_class_g)); @@ -967,7 +967,7 @@ H5O_msg_remove(const H5O_loc_t *loc, unsigned type_id, int sequence, hbool_t adj const H5O_msg_class_t *type; /* Actual H5O class type for the ID */ herr_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5O_msg_remove, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* check args */ HDassert(loc); @@ -1019,7 +1019,7 @@ H5O_msg_remove_op(const H5O_loc_t *loc, unsigned type_id, int sequence, const H5O_msg_class_t *type; /* Actual H5O class type for the ID */ herr_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5O_msg_remove_op, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* check args */ HDassert(loc); @@ -1063,13 +1063,13 @@ done: */ static herr_t H5O_msg_remove_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, unsigned sequence, - hbool_t *oh_modified, void *_udata/*in,out*/) + unsigned *oh_modified, void *_udata/*in,out*/) { H5O_iter_rm_t *udata = (H5O_iter_rm_t *)_udata; /* Operator user data */ htri_t try_remove = FALSE; /* Whether to try removing a message */ herr_t ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_msg_remove_cb) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(mesg); @@ -1098,7 +1098,7 @@ H5O_msg_remove_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, unsigned sequence, HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, H5_ITER_ERROR, "unable to release message") /* Indicate that the object header was modified */ - *oh_modified = TRUE; + *oh_modified = H5O_MODIFY_CONDENSE; /* Break out now, if we've found the correct message */ if(udata->sequence == H5O_FIRST || udata->sequence != H5O_ALL) @@ -1136,7 +1136,7 @@ H5O_msg_remove_real(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type, H5O_mesg_operator_t op; /* Wrapper for operator */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5O_msg_remove_real, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* check args */ HDassert(f); @@ -1210,7 +1210,7 @@ H5O_msg_iterate(const H5O_loc_t *loc, unsigned type_id, const H5O_msg_class_t *type; /* Actual H5O class type for the ID */ herr_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5O_msg_iterate, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* check args */ HDassert(loc); @@ -1275,10 +1275,10 @@ H5O_msg_iterate_real(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type, H5O_mesg_t *idx_msg; /* Pointer to current message */ unsigned idx; /* Absolute index of current message in all messages */ unsigned sequence; /* Relative index of current message for messages of type */ - hbool_t oh_modified = FALSE; /* Whether the callback modified the object header */ + unsigned oh_modified = 0; /* Whether the callback modified the object header */ herr_t ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_msg_iterate_real) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(f); @@ -1320,8 +1320,10 @@ done: * object header, the header will be condensed after each * message removal) */ - if(H5O_condense_header(f, oh, dxpl_id) < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTPACK, FAIL, "can't pack object header") + if(oh_modified & H5O_MODIFY_CONDENSE) { + if(H5O_condense_header(f, oh, dxpl_id) < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTPACK, FAIL, "can't pack object header") + } /* Mark object header as changed */ if(H5O_touch_oh(f, dxpl_id, oh, FALSE) < 0) @@ -1357,7 +1359,7 @@ H5O_msg_raw_size(const H5F_t *f, unsigned type_id, hbool_t disable_shared, const H5O_msg_class_t *type; /* Actual H5O class type for the ID */ size_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5O_msg_raw_size, 0) + FUNC_ENTER_NOAPI(0) /* Check args */ HDassert(type_id < NELMTS(H5O_msg_class_g)); @@ -1402,7 +1404,7 @@ H5O_msg_size_f(const H5F_t *f, hid_t ocpl_id, unsigned type_id, uint8_t oh_flags; /* Object header status flags */ size_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5O_msg_size_f, 0) + FUNC_ENTER_NOAPI(0) /* Check args */ HDassert(type_id < NELMTS(H5O_msg_class_g)); @@ -1464,7 +1466,7 @@ H5O_msg_size_oh(const H5F_t *f, const H5O_t *oh, unsigned type_id, const H5O_msg_class_t *type; /* Actual H5O class type for the ID */ size_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5O_msg_size_oh, 0) + FUNC_ENTER_NOAPI(0) /* Check args */ HDassert(type_id < NELMTS(H5O_msg_class_g)); @@ -1515,7 +1517,7 @@ H5O_msg_can_share(unsigned type_id, const void *mesg) const H5O_msg_class_t *type; /* Actual H5O class type for the ID */ htri_t ret_value; - FUNC_ENTER_NOAPI_NOFUNC(H5O_msg_can_share) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(type_id < NELMTS(H5O_msg_class_g)); @@ -1534,6 +1536,10 @@ H5O_msg_can_share(unsigned type_id, const void *mesg) ret_value = (type->share_flags & H5O_SHARE_IS_SHARABLE) ? TRUE : FALSE; } /* end else */ + /* If the message is shareable, both copy_file and post_copy_file must be + * defined */ + HDassert((type->post_copy_file && type->copy_file) || ret_value == FALSE); + FUNC_LEAVE_NOAPI(ret_value) } /* end H5O_msg_can_share() */ @@ -1558,7 +1564,7 @@ H5O_msg_can_share_in_ohdr(unsigned type_id) const H5O_msg_class_t *type; /* Actual H5O class type for the ID */ htri_t ret_value; - FUNC_ENTER_NOAPI_NOFUNC(H5O_msg_can_share_in_ohdr) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(type_id < NELMTS(H5O_msg_class_g)); @@ -1596,7 +1602,7 @@ H5O_msg_is_shared(unsigned type_id, const void *mesg) const H5O_msg_class_t *type; /* Actual H5O class type for the ID */ htri_t ret_value; - FUNC_ENTER_NOAPI_NOFUNC(H5O_msg_is_shared) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(type_id < NELMTS(H5O_msg_class_g)); @@ -1634,7 +1640,7 @@ H5O_msg_set_share(unsigned type_id, const H5O_shared_t *share, void *mesg) const H5O_msg_class_t *type; /* Actual H5O class type for the ID */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5O_msg_set_share, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args */ HDassert(type_id < NELMTS(H5O_msg_class_g)); @@ -1684,7 +1690,7 @@ H5O_msg_reset_share(unsigned type_id, void *mesg) { const H5O_msg_class_t *type; /* Actual H5O class type for the ID */ - FUNC_ENTER_NOAPI_NOFUNC(H5O_msg_reset_share) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(type_id < NELMTS(H5O_msg_class_g)); @@ -1719,7 +1725,7 @@ H5O_msg_get_crt_index(unsigned type_id, const void *mesg, H5O_msg_crt_idx_t *crt const H5O_msg_class_t *type; /* Actual H5O class type for the ID */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI(H5O_msg_get_crt_index, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args */ HDassert(type_id < NELMTS(H5O_msg_class_g)); @@ -1765,7 +1771,7 @@ H5O_msg_encode(H5F_t *f, unsigned type_id, hbool_t disable_shared, const H5O_msg_class_t *type; /* Actual H5O class type for the ID */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5O_msg_encode,FAIL) + FUNC_ENTER_NOAPI(FAIL) /* check args */ HDassert(f); @@ -1811,7 +1817,7 @@ H5O_msg_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned type_id, void *ret_value; /* Return value */ unsigned ioflags = 0; /* Flags for decode routine */ - FUNC_ENTER_NOAPI(H5O_msg_decode, NULL) + FUNC_ENTER_NOAPI(NULL) /* check args */ HDassert(f); @@ -1853,7 +1859,7 @@ H5O_msg_copy_file(const H5O_msg_class_t *type, H5F_t *file_src, { void *ret_value; - FUNC_ENTER_NOAPI_NOINIT(H5O_msg_copy_file) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(type); @@ -1895,7 +1901,7 @@ H5O_msg_alloc(H5F_t *f, hid_t dxpl_id, H5O_t *oh, const H5O_msg_class_t *type, htri_t shared_mesg; /* Should this message be stored in the Shared Message table? */ int ret_value = FAIL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_msg_alloc) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(f); @@ -1916,7 +1922,7 @@ H5O_msg_alloc(H5F_t *f, hid_t dxpl_id, H5O_t *oh, const H5O_msg_class_t *type, } /* end if */ else { /* Attempt to share message */ - if(H5SM_try_share(f, dxpl_id, oh, type->id, native, mesg_flags) < 0) + if(H5SM_try_share(f, dxpl_id, oh, 0, type->id, native, mesg_flags) < 0) HGOTO_ERROR(H5E_OHDR, H5E_WRITEERROR, FAIL, "error determining if message should be shared") } /* end else */ @@ -1959,7 +1965,7 @@ H5O_copy_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx, hbool_t chk_dirtied = FALSE; /* Flag for unprotecting chunk */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_copy_mesg) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(f); @@ -2034,7 +2040,7 @@ H5O_msg_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned type_id, const H5O_msg_class_t *type; /* Actual H5O class type for the ID */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5O_msg_delete, NULL) + FUNC_ENTER_NOAPI(NULL) /* check args */ HDassert(f); @@ -2072,7 +2078,7 @@ H5O_delete_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_mesg_t *mesg) const H5O_msg_class_t *type = mesg->type; /* Type of object to free */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5O_delete_mesg, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args */ HDassert(f); @@ -2113,7 +2119,7 @@ H5O_msg_flush(H5F_t *f, H5O_t *oh, H5O_mesg_t *mesg) unsigned msg_id; /* ID for message */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5O_msg_flush, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* check args */ HDassert(f); @@ -2155,9 +2161,8 @@ H5O_msg_flush(H5F_t *f, H5O_t *oh, H5O_mesg_t *mesg) /* Make certain that null messages aren't in chunks w/gaps */ if(H5O_NULL_ID == msg_id) HDassert(oh->chunk[mesg->chunkno].gap == 0); - - /* Unknown messages should always have a native pointer */ - if(mesg->type == H5O_MSG_UNKNOWN) + else + /* Non-null messages should always have a native pointer */ HDassert(mesg->native); #endif /* NDEBUG */ @@ -2215,7 +2220,7 @@ H5O_flush_msgs(H5F_t *f, H5O_t *oh) unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5O_flush_msgs, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* check args */ HDassert(f); @@ -2266,7 +2271,7 @@ H5O_msg_get_chunkno(const H5O_loc_t *loc, unsigned type_id, hid_t dxpl_id) unsigned idx; /* Index of message to modify */ int ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5O_msg_get_chunkno, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* check args */ HDassert(loc); @@ -2321,7 +2326,7 @@ H5O_msg_lock(const H5O_loc_t *loc, unsigned type_id, hid_t dxpl_id) unsigned idx; /* Index of message to modify */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5O_msg_lock, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* check args */ HDassert(loc); @@ -2379,7 +2384,7 @@ H5O_msg_unlock(const H5O_loc_t *loc, unsigned type_id, hid_t dxpl_id) unsigned idx; /* Index of message to modify */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5O_msg_unlock, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* check args */ HDassert(loc); diff --git a/src/H5Omtime.c b/src/H5Omtime.c index 731d833..612d656 100644 --- a/src/H5Omtime.c +++ b/src/H5Omtime.c @@ -105,8 +105,11 @@ H5FL_DEFINE(time_t); /*------------------------------------------------------------------------- * Function: H5O_mtime_new_decode * - * Purpose: Decode a new modification time message and return a pointer to a - * new time_t value. + * Purpose: Decode a new modification time message and return a pointer to + * a new time_t value. + * + * The new modification time message format was added due to the + * performance overhead of the old format. * * Return: Success: Ptr to new message in native struct. * @@ -126,11 +129,11 @@ H5O_mtime_new_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_o uint32_t tmp_time; /* Temporary copy of the time */ void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_mtime_new_decode); + FUNC_ENTER_NOAPI_NOINIT /* check args */ - assert(f); - assert(p); + HDassert(f); + HDassert(p); /* decode */ if(*p++ != H5O_MTIME_VERSION) @@ -151,15 +154,18 @@ H5O_mtime_new_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_o ret_value=mesg; done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* end H5O_mtime_new_decode() */ /*------------------------------------------------------------------------- * Function: H5O_mtime_decode * - * Purpose: Decode a modification time message and return a pointer to a - * new time_t value. + * Purpose: Decode a modification time message and return a pointer to a + * new time_t value. + * + * The new modification time message format was added due to the + * performance overhead of the old format. * * Return: Success: Ptr to new message in native struct. * @@ -180,7 +186,7 @@ H5O_mtime_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, struct tm tm; void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_mtime_decode) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(f); @@ -287,12 +293,12 @@ H5O_mtime_new_encode(H5F_t UNUSED *f, hbool_t UNUSED disable_shared, uint8_t *p, { const time_t *mesg = (const time_t *) _mesg; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_mtime_new_encode); + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ - assert(f); - assert(p); - assert(mesg); + HDassert(f); + HDassert(p); + HDassert(mesg); /* Version */ *p++ = H5O_MTIME_VERSION; @@ -305,7 +311,7 @@ H5O_mtime_new_encode(H5F_t UNUSED *f, hbool_t UNUSED disable_shared, uint8_t *p, /* Encode time */ UINT32ENCODE(p, *mesg); - FUNC_LEAVE_NOAPI(SUCCEED); + FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5O_mtime_new_encode() */ @@ -330,12 +336,12 @@ H5O_mtime_encode(H5F_t UNUSED *f, hbool_t UNUSED disable_shared, uint8_t *p, con const time_t *mesg = (const time_t *) _mesg; struct tm *tm; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_mtime_encode); + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ - assert(f); - assert(p); - assert(mesg); + HDassert(f); + HDassert(p); + HDassert(mesg); /* encode */ tm = HDgmtime(mesg); @@ -343,7 +349,7 @@ H5O_mtime_encode(H5F_t UNUSED *f, hbool_t UNUSED disable_shared, uint8_t *p, con 1900+tm->tm_year, 1+tm->tm_mon, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec); - FUNC_LEAVE_NOAPI(SUCCEED); + FUNC_LEAVE_NOAPI(SUCCEED) } @@ -372,10 +378,10 @@ H5O_mtime_copy(const void *_mesg, void *_dest) time_t *dest = (time_t *) _dest; void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_mtime_copy); + FUNC_ENTER_NOAPI_NOINIT /* check args */ - assert(mesg); + HDassert(mesg); if (!dest && NULL==(dest = H5FL_MALLOC(time_t))) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); @@ -386,7 +392,7 @@ H5O_mtime_copy(const void *_mesg, void *_dest) ret_value=dest; done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } @@ -413,13 +419,13 @@ done: static size_t H5O_mtime_new_size(const H5F_t UNUSED * f, hbool_t UNUSED disable_shared, const void UNUSED * mesg) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_mtime_new_size); + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ - assert(f); - assert(mesg); + HDassert(f); + HDassert(mesg); - FUNC_LEAVE_NOAPI(8); + FUNC_LEAVE_NOAPI(8) } /* end H5O_mtime_new_size() */ @@ -446,13 +452,13 @@ H5O_mtime_new_size(const H5F_t UNUSED * f, hbool_t UNUSED disable_shared, const static size_t H5O_mtime_size(const H5F_t UNUSED * f, hbool_t UNUSED disable_shared, const void UNUSED * mesg) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_mtime_size); + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ - assert(f); - assert(mesg); + HDassert(f); + HDassert(mesg); - FUNC_LEAVE_NOAPI(16); + FUNC_LEAVE_NOAPI(16) } @@ -474,9 +480,9 @@ H5O_mtime_size(const H5F_t UNUSED * f, hbool_t UNUSED disable_shared, const void static herr_t H5O_mtime_reset(void UNUSED *_mesg) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_mtime_reset); + FUNC_ENTER_NOAPI_NOINIT_NOERR - FUNC_LEAVE_NOAPI(SUCCEED); + FUNC_LEAVE_NOAPI(SUCCEED) } @@ -497,7 +503,7 @@ H5O_mtime_reset(void UNUSED *_mesg) static herr_t H5O_mtime_free(void *mesg) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_mtime_free) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(mesg); @@ -530,22 +536,22 @@ H5O_mtime_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, FILE * struct tm *tm; char buf[128]; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_mtime_debug); + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ - assert(f); - assert(mesg); - assert(stream); - assert(indent >= 0); - assert(fwidth >= 0); + HDassert(f); + HDassert(mesg); + HDassert(stream); + HDassert(indent >= 0); + HDassert(fwidth >= 0); /* debug */ tm = HDlocaltime(mesg); HDstrftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S %Z", tm); - fprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Time:", buf); - FUNC_LEAVE_NOAPI(SUCCEED); + FUNC_LEAVE_NOAPI(SUCCEED) } diff --git a/src/H5Oname.c b/src/H5Oname.c index f8d3553..fb44000 100644 --- a/src/H5Oname.c +++ b/src/H5Oname.c @@ -90,7 +90,7 @@ H5O_name_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, H5O_name_t *mesg; void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_name_decode) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(f); @@ -135,7 +135,7 @@ H5O_name_encode(H5F_t UNUSED *f, hbool_t UNUSED disable_shared, uint8_t *p, cons { const H5O_name_t *mesg = (const H5O_name_t *) _mesg; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_name_encode); + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ assert(f); @@ -145,7 +145,7 @@ H5O_name_encode(H5F_t UNUSED *f, hbool_t UNUSED disable_shared, uint8_t *p, cons /* encode */ HDstrcpy((char*)p, mesg->s); - FUNC_LEAVE_NOAPI(SUCCEED); + FUNC_LEAVE_NOAPI(SUCCEED) } @@ -174,7 +174,7 @@ H5O_name_copy(const void *_mesg, void *_dest) H5O_name_t *dest = (H5O_name_t *) _dest; void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_name_copy) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(mesg); @@ -225,7 +225,7 @@ H5O_name_size(const H5F_t UNUSED *f, hbool_t UNUSED disable_shared, const void * const H5O_name_t *mesg = (const H5O_name_t *) _mesg; size_t ret_value; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_name_size); + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ assert(f); @@ -233,7 +233,7 @@ H5O_name_size(const H5F_t UNUSED *f, hbool_t UNUSED disable_shared, const void * ret_value = mesg->s ? HDstrlen(mesg->s) + 1 : 0; - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } @@ -258,7 +258,7 @@ H5O_name_reset(void *_mesg) { H5O_name_t *mesg = (H5O_name_t *) _mesg; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_name_reset) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ HDassert(mesg); @@ -291,7 +291,7 @@ H5O_name_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, FILE *s { const H5O_name_t *mesg = (const H5O_name_t *)_mesg; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_name_debug); + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ assert(f); @@ -304,5 +304,5 @@ H5O_name_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, FILE *s "Name:", mesg->s); - FUNC_LEAVE_NOAPI(SUCCEED); + FUNC_LEAVE_NOAPI(SUCCEED) } diff --git a/src/H5Opkg.h b/src/H5Opkg.h index 49cecfd..d7b8450 100644 --- a/src/H5Opkg.h +++ b/src/H5Opkg.h @@ -333,7 +333,7 @@ typedef struct H5O_addr_map_t { haddr_t dst_addr; /* Address of object in destination file */ hbool_t is_locked; /* Indicate that the destination object is locked currently */ hsize_t inc_ref_count; /* Number of deferred increments to reference count */ - H5O_obj_class_t *obj_class; /* Object class */ + const H5O_obj_class_t *obj_class; /* Object class */ void *udata; /* Object class copy file udata */ } H5O_addr_map_t; @@ -590,7 +590,9 @@ H5_DLL herr_t H5O_shared_link(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, H5_DLL herr_t H5O_shared_copy_file(H5F_t *file_src, H5F_t *file_dst, const H5O_msg_class_t *mesg_type, const void *_native_src, void *_native_dst, hbool_t *recompute_size, H5O_copy_t *cpy_info, void *udata, hid_t dxpl_id); -H5_DLL herr_t H5O_shared_post_copy_file (H5F_t *f, hid_t dxpl_id, H5O_t *oh, void *mesg); +H5_DLL herr_t H5O_shared_post_copy_file (H5F_t *f, + const H5O_msg_class_t *mesg_type, const H5O_shared_t *shared_src, + H5O_shared_t *shared_dst, hid_t dxpl_id, H5O_copy_t *cpy_info); H5_DLL herr_t H5O_shared_debug(const H5O_shared_t *mesg, FILE *stream, int indent, int fwidth); diff --git a/src/H5Opline.c b/src/H5Opline.c index 89bdd36..89ce865 100644 --- a/src/H5Opline.c +++ b/src/H5Opline.c @@ -83,7 +83,7 @@ const H5O_msg_class_t H5O_MSG_PLINE[1] = {{ NULL, /*can share method */ H5O_pline_pre_copy_file, /* pre copy native value to file */ H5O_pline_shared_copy_file, /* copy native value to file */ - NULL, /* post copy native value to file */ + H5O_pline_shared_post_copy_file, /* post copy native value to file */ NULL, /* get creation index */ NULL, /* set creation index */ H5O_pline_shared_debug /* debug the message */ @@ -117,7 +117,7 @@ H5O_pline_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, size_t i; /* Local index variable */ void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_pline_decode) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(p); @@ -242,7 +242,7 @@ H5O_pline_encode(H5F_t UNUSED *f, uint8_t *p/*out*/, const void *mesg) const H5Z_filter_info_t *filter; /* Filter to encode */ size_t i, j; /* Local index variables */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_pline_encode) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(p); @@ -345,7 +345,7 @@ H5O_pline_copy(const void *_src, void *_dst/*out*/) size_t i; /* Local index variable */ H5O_pline_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_pline_copy) + FUNC_ENTER_NOAPI_NOINIT /* Allocate pipeline message, if not provided */ if(!dst && NULL == (dst = H5FL_MALLOC(H5O_pline_t))) @@ -438,7 +438,7 @@ H5O_pline_size(const H5F_t UNUSED *f, const void *mesg) size_t i; /* Local index variable */ size_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_pline_size) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Message header */ ret_value = 1 + /*version */ @@ -497,7 +497,7 @@ H5O_pline_reset(void *mesg) H5O_pline_t *pline = (H5O_pline_t*)mesg; /* Pipeline message */ size_t i; /* Local index variable */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_pline_reset) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(pline); @@ -542,7 +542,7 @@ H5O_pline_reset(void *mesg) static herr_t H5O_pline_free(void *mesg) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_pline_free) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(mesg); @@ -575,7 +575,7 @@ H5O_pline_pre_copy_file(H5F_t UNUSED *file_src, const void *mesg_src, H5O_copy_file_ud_common_t *udata = (H5O_copy_file_ud_common_t *)_udata; /* Object copying user data */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_pline_pre_copy_file) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(pline_src); @@ -614,7 +614,7 @@ H5O_pline_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *mesg, FILE *s const H5O_pline_t *pline = (const H5O_pline_t *)mesg; size_t i, j; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_pline_debug) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ HDassert(f); @@ -681,7 +681,7 @@ H5O_pline_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *mesg, FILE *s herr_t H5O_pline_set_latest_version(H5O_pline_t *pline) { - FUNC_ENTER_NOAPI_NOFUNC(H5O_pline_set_latest_version) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ HDassert(pline); diff --git a/src/H5Oprivate.h b/src/H5Oprivate.h index 19d22a6..c05fcb4 100644 --- a/src/H5Oprivate.h +++ b/src/H5Oprivate.h @@ -110,11 +110,13 @@ typedef struct H5O_t H5O_t; /* Set the fields in a shared message structure */ #define H5O_UPDATE_SHARED(SH_MESG, SH_TYPE, F, MSG_TYPE, CRT_IDX, OH_ADDR) \ - (SH_MESG)->type = (SH_TYPE); \ - (SH_MESG)->file = (F); \ - (SH_MESG)->msg_type_id = (MSG_TYPE); \ - (SH_MESG)->u.loc.index = (CRT_IDX); \ - (SH_MESG)->u.loc.oh_addr = (OH_ADDR); + { \ + (SH_MESG)->type = (SH_TYPE); \ + (SH_MESG)->file = (F); \ + (SH_MESG)->msg_type_id = (MSG_TYPE); \ + (SH_MESG)->u.loc.index = (CRT_IDX); \ + (SH_MESG)->u.loc.oh_addr = (OH_ADDR); \ + } /* end block */ /* Fractal heap ID type for shared message & attribute heap IDs. */ @@ -683,9 +685,14 @@ typedef struct H5O_fsinfo_t { typedef herr_t (*H5O_operator_t)(const void *mesg/*in*/, unsigned idx, void *operator_data/*in,out*/); +#ifdef OUT /* Typedef for "internal library" iteration operations */ typedef herr_t (*H5O_lib_operator_t)(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, unsigned sequence, hbool_t *oh_modified/*out*/, void *operator_data/*in,out*/); +#endif +/* Typedef for "internal library" iteration operations */ +typedef herr_t (*H5O_lib_operator_t)(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, + unsigned sequence, unsigned *oh_modified/*out*/, void *operator_data/*in,out*/); /* Some syntactic sugar to make the compiler happy with two different kinds of iterator callbacks */ typedef enum H5O_mesg_operator_type_t { @@ -693,6 +700,9 @@ typedef enum H5O_mesg_operator_type_t { H5O_MESG_OP_LIB /* Library internal callback */ } H5O_mesg_operator_type_t; +#define H5O_MODIFY_CONDENSE 0x01 +#define H5O_MODIFY 0x02 + typedef struct { H5O_mesg_operator_type_t op_type; union { diff --git a/src/H5Opublic.h b/src/H5Opublic.h index d9e38fc..546508a 100644 --- a/src/H5Opublic.h +++ b/src/H5Opublic.h @@ -186,7 +186,7 @@ H5_DLL herr_t H5Orefresh(hid_t oid); /* Typedefs */ -/* A struct that's part of the H5G_stat_t routine (deprecated) */ +/* A struct that's part of the H5G_stat_t structure (deprecated) */ typedef struct H5O_stat_t { hsize_t size; /* Total size of object header in file */ hsize_t free; /* Free space within object header */ diff --git a/src/H5Orefcount.c b/src/H5Orefcount.c index e3c6981..399c8da 100644 --- a/src/H5Orefcount.c +++ b/src/H5Orefcount.c @@ -96,7 +96,7 @@ H5O_refcount_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh H5O_refcount_t *refcount = NULL; /* Reference count */ void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_refcount_decode) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(f); @@ -142,7 +142,7 @@ H5O_refcount_encode(H5F_t UNUSED *f, hbool_t UNUSED disable_shared, uint8_t *p, { const H5O_refcount_t *refcount = (const H5O_refcount_t *)_mesg; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_refcount_encode) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ HDassert(f); @@ -181,7 +181,7 @@ H5O_refcount_copy(const void *_mesg, void *_dest) H5O_refcount_t *dest = (H5O_refcount_t *) _dest; void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_refcount_copy) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(refcount); @@ -221,7 +221,7 @@ H5O_refcount_size(const H5F_t UNUSED *f, hbool_t UNUSED disable_shared, { size_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_refcount_size) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Set return value */ ret_value = 1 /* Version */ @@ -246,7 +246,7 @@ H5O_refcount_size(const H5F_t UNUSED *f, hbool_t UNUSED disable_shared, static herr_t H5O_refcount_free(void *mesg) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_refcount_free) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(mesg); @@ -274,7 +274,7 @@ static herr_t H5O_refcount_pre_copy_file(H5F_t UNUSED *file_src, const void UNUSED *native_src, hbool_t *deleted, const H5O_copy_t UNUSED *cpy_info, void UNUSED *udata) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_refcount_pre_copy_file) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ HDassert(deleted); @@ -308,7 +308,7 @@ H5O_refcount_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, FIL { const H5O_refcount_t *refcount = (const H5O_refcount_t *) _mesg; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_refcount_debug) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ HDassert(f); diff --git a/src/H5Osdspace.c b/src/H5Osdspace.c index 323bec9..8ae73f7 100644 --- a/src/H5Osdspace.c +++ b/src/H5Osdspace.c @@ -77,7 +77,7 @@ const H5O_msg_class_t H5O_MSG_SDSPACE[1] = {{ NULL, /*can share method */ H5O_sdspace_pre_copy_file, /* pre copy native value to file */ H5O_sdspace_shared_copy_file,/* copy native value to file */ - NULL, /* post copy native value to file */ + H5O_sdspace_shared_post_copy_file,/* post copy native value to file */ NULL, /* get creation index */ NULL, /* set creation index */ H5O_sdspace_shared_debug /* debug the message */ @@ -118,7 +118,7 @@ H5O_sdspace_decode(H5F_t *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, unsigned i; /* local counting variable */ unsigned flags, version; - FUNC_ENTER_NOAPI_NOINIT(H5O_sdspace_decode) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(f); @@ -236,7 +236,7 @@ H5O_sdspace_encode(H5F_t *f, uint8_t *p, const void *_mesg) unsigned flags = 0; unsigned u; /* Local counting variable */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_sdspace_encode) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ HDassert(f); @@ -303,7 +303,7 @@ H5O_sdspace_copy(const void *_mesg, void *_dest) H5S_extent_t *dest = (H5S_extent_t *)_dest; void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_sdspace_copy) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(mesg); @@ -353,7 +353,7 @@ H5O_sdspace_size(const H5F_t *f, const void *_mesg) const H5S_extent_t *space = (const H5S_extent_t *)_mesg; size_t ret_value; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_sdspace_size) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Basic information for all dataspace messages */ ret_value = 1 + /* Version */ @@ -392,7 +392,7 @@ H5O_sdspace_reset(void *_mesg) { H5S_extent_t *mesg = (H5S_extent_t*)_mesg; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_sdspace_reset) + FUNC_ENTER_NOAPI_NOINIT_NOERR H5S_extent_release(mesg); @@ -415,7 +415,7 @@ H5O_sdspace_reset(void *_mesg) static herr_t H5O_sdspace_free(void *mesg) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_sdspace_free) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(mesg); @@ -448,7 +448,7 @@ H5O_sdspace_pre_copy_file(H5F_t UNUSED *file_src, const void *mesg_src, H5D_copy_file_ud_t *udata = (H5D_copy_file_ud_t *)_udata; /* Dataset copying user data */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_sdspace_pre_copy_file) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(file_src); @@ -499,7 +499,7 @@ H5O_sdspace_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *mesg, { const H5S_extent_t *sdim = (const H5S_extent_t *)mesg; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_sdspace_debug) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ HDassert(f); diff --git a/src/H5Oshared.c b/src/H5Oshared.c index 68fc4ad..4cc30e8 100644 --- a/src/H5Oshared.c +++ b/src/H5Oshared.c @@ -30,7 +30,6 @@ /* Module Setup */ /****************/ -#define H5F_PACKAGE /*suppress error about including H5Fpkg */ #define H5O_PACKAGE /*suppress error about including H5Opkg */ @@ -39,7 +38,7 @@ /***********/ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ -#include "H5Fpkg.h" /* File access */ +#include "H5Fprivate.h" /* File access */ #include "H5Gprivate.h" /* Groups */ #include "H5HFprivate.h" /* Fractal heap */ #include "H5Opkg.h" /* Object headers */ @@ -115,7 +114,7 @@ H5O_shared_read(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned *ioflags, uint8_t mesg_buf[H5O_MESG_BUF_SIZE]; /* Buffer for deserializing messages */ void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_shared_read) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(f); @@ -227,7 +226,7 @@ H5O_shared_link_adj(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_shared_link_adj) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(f); @@ -243,8 +242,17 @@ H5O_shared_link_adj(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, * new object header. Adjust the reference count on that * object header. */ - if(shared->file->shared != f->shared) - HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "interfile hard links are not allowed") + /* Unfortunately, it is possible for the shared->file pointer to become + * invalid if the oh is kept in cache (which is contained in + * shared->file->shared while shared->file is closed. Just ignore + * shared->file until the "top-level" file pointer is removed at some + * point in the future. -NAF */ + /* This is related to Jira issue #7638 and should be uncommented after + * the library has been refactored to shift to using shared file + * pointers for file operations, instead of using top file pointers. + * -QAK */ + /*if(shared->file->shared != f->shared) + HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "interfile hard links are not allowed")*/ /* Build the object location for the shared message's object header */ oloc.file = f; @@ -277,7 +285,7 @@ H5O_shared_link_adj(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, } /* end if */ /* Check for incrementing reference count on message */ else if(adjust > 0) { - if(H5SM_try_share(f, dxpl_id, open_oh, type->id, shared, NULL) < 0) + if(H5SM_try_share(f, dxpl_id, open_oh, 0, type->id, shared, NULL) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINC, FAIL, "error trying to share message") } /* end if */ } /* end else */ @@ -307,7 +315,7 @@ H5O_shared_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned *ioflags, unsigned version; /* Shared message version */ void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_shared_decode) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(f); @@ -392,7 +400,7 @@ H5O_shared_encode(const H5F_t *f, uint8_t *buf/*out*/, const H5O_shared_t *sh_me { unsigned version; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_shared_encode) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(f); @@ -409,8 +417,8 @@ H5O_shared_encode(const H5F_t *f, uint8_t *buf/*out*/, const H5O_shared_t *sh_me version = H5O_SHARED_VERSION_2; /* version 1 is no longer used */ } /* end else */ - *buf++ = version; - *buf++ = (unsigned)sh_mesg->type; + *buf++ = (uint8_t)version; + *buf++ = (uint8_t)sh_mesg->type; /* Encode either the heap ID of the message or the address of the * object header that holds it. @@ -440,7 +448,7 @@ H5O_shared_encode(const H5F_t *f, uint8_t *buf/*out*/, const H5O_shared_t *sh_me herr_t H5O_set_shared(H5O_shared_t *dst, const H5O_shared_t *src) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_set_shared) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ HDassert(dst); @@ -471,12 +479,12 @@ H5O_shared_size(const H5F_t *f, const H5O_shared_t *sh_mesg) { size_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_shared_size) + FUNC_ENTER_NOAPI_NOINIT_NOERR if(sh_mesg->type == H5O_SHARE_TYPE_COMMITTED) { - ret_value = 1 + /*version */ - 1 + /*the type field */ - H5F_SIZEOF_ADDR(f); /*sharing by another obj hdr */ + ret_value = (size_t)1 + /*version */ + (size_t)1 + /*the type field */ + (size_t)H5F_SIZEOF_ADDR(f); /*sharing by another obj hdr */ } /* end if */ else { HDassert(sh_mesg->type == H5O_SHARE_TYPE_SOHM); @@ -507,7 +515,7 @@ H5O_shared_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_shared_delete) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(f); @@ -550,7 +558,7 @@ H5O_shared_link(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_shared_link) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(f); @@ -579,7 +587,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_shared_copy_file(H5F_t UNUSED *file_src, H5F_t *file_dst, +H5O_shared_copy_file(H5F_t *file_src, H5F_t *file_dst, const H5O_msg_class_t *mesg_type, const void *_native_src, void *_native_dst, hbool_t UNUSED *recompute_size, H5O_copy_t *cpy_info, void UNUSED *udata, hid_t dxpl_id) @@ -588,7 +596,7 @@ H5O_shared_copy_file(H5F_t UNUSED *file_src, H5F_t *file_dst, H5O_shared_t *shared_dst = (H5O_shared_t *)_native_dst; /* Alias to shared info in native destination message */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_shared_copy_file) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(file_src); @@ -602,39 +610,27 @@ H5O_shared_copy_file(H5F_t UNUSED *file_src, H5F_t *file_dst, /* Committed shared messages create a shared message at the destination * and also copy the committed object that they point to. * - * SOHMs try to share the destination message. + * Other messages simulate sharing the destination message to determine how + * it will eventually be shared (if at all), but do not actually share the + * message until "post copy". The "H5O_shared_t" part of the message will + * be updated (to allow calculation of the final size) but the message is + * not actually shared. */ - if(shared_src->type == H5O_SHARE_TYPE_COMMITTED) { - H5O_loc_t dst_oloc; - H5O_loc_t src_oloc; - - /* Copy the shared object from source to destination */ - dst_oloc.file = file_dst; - src_oloc.file = shared_src->file; - src_oloc.addr = shared_src->u.loc.oh_addr; - if(H5O_copy_header_map(&src_oloc, &dst_oloc, dxpl_id, cpy_info, FALSE, - NULL, NULL) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy object") - - /* Set up destination message's shared info */ - H5O_UPDATE_SHARED(shared_dst, H5O_SHARE_TYPE_COMMITTED, file_dst, mesg_type->id, 0, dst_oloc.addr) - } /* end if */ - else { - /* Try to share new message in the destination file. */ - /* Message is always shared in heap in dest. file because the dest. - * object header doesn't quite exist yet - JML - */ - + if(shared_src->type != H5O_SHARE_TYPE_COMMITTED) { + /* Simulate trying to share new message in the destination file. */ /* Set copied metadata tag */ H5_BEGIN_TAG(dxpl_id, H5AC__COPIED_TAG, FAIL); - if(H5SM_try_share(file_dst, dxpl_id, NULL, mesg_type->id, _native_dst, NULL) < 0) + if(H5SM_try_share(file_dst, dxpl_id, NULL, H5SM_DEFER, mesg_type->id, _native_dst, NULL) < 0) HGOTO_ERROR(H5E_OHDR, H5E_WRITEERROR, FAIL, "unable to determine if message should be shared") /* Reset metadata tag */ H5_END_TAG(FAIL); - - } /* end else */ + } /* end if */ + else + /* Mark the message as committed - as it will be committed in post copy + */ + H5O_UPDATE_SHARED(shared_dst, H5O_SHARE_TYPE_COMMITTED, file_dst, mesg_type->id, 0, HADDR_UNDEF) done: FUNC_LEAVE_NOAPI(ret_value) @@ -660,40 +656,45 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_shared_post_copy_file(H5F_t *f, hid_t dxpl_id, H5O_t *oh, void *mesg) +H5O_shared_post_copy_file(H5F_t *f, const H5O_msg_class_t *mesg_type, + const H5O_shared_t *shared_src, H5O_shared_t *shared_dst, hid_t dxpl_id, + H5O_copy_t *cpy_info) { - H5O_shared_t *old_sh_mesg; - htri_t shared_mesg; /* Whether the message should be shared */ - unsigned msg_type_id; /* Message's type ID */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_shared_post_copy_file) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(f); - HDassert(mesg); - - /* the old shared message */ - old_sh_mesg = (H5O_shared_t *) mesg; + HDassert(shared_src); + HDassert(shared_dst); - /* save the type id for later use */ - msg_type_id = old_sh_mesg->msg_type_id; + /* Copy the target of committed messages, try to share others */ + if(shared_src->type == H5O_SHARE_TYPE_COMMITTED) { + H5O_loc_t dst_oloc; + H5O_loc_t src_oloc; - /* Remove the old message from the SOHM storage */ - if(H5SM_delete(f, dxpl_id, oh, old_sh_mesg) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to find attribute information for object") + /* Copy the shared object from source to destination */ + dst_oloc.file = f; + src_oloc.file = shared_src->file; + src_oloc.addr = shared_src->u.loc.oh_addr; + if(H5O_copy_header_map(&src_oloc, &dst_oloc, dxpl_id, cpy_info, FALSE, + NULL, NULL) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy object") - /* Add the new message */ - if((shared_mesg = H5SM_try_share(f, dxpl_id, oh, msg_type_id, mesg, NULL)) == 0) - HGOTO_ERROR(H5E_OHDR, H5E_BADMESG, FAIL, "message changed sharing status") - else if(shared_mesg < 0) - HGOTO_ERROR(H5E_OHDR, H5E_BADMESG, FAIL, "can't share message") + /* Set up destination message's shared info */ + H5O_UPDATE_SHARED(shared_dst, H5O_SHARE_TYPE_COMMITTED, f, mesg_type->id, 0, dst_oloc.addr) + } /* end if */ + else + /* Share the message */ + if(H5SM_try_share(f, dxpl_id, NULL, H5SM_WAS_DEFERRED, mesg_type->id, + shared_dst, NULL) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_BADMESG, FAIL, "can't share message") done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5O_shared_post_copy_file() */ - /*------------------------------------------------------------------------- * Function: H5O_shared_debug @@ -710,7 +711,7 @@ done: herr_t H5O_shared_debug(const H5O_shared_t *mesg, FILE *stream, int indent, int fwidth) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_shared_debug) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(mesg); diff --git a/src/H5Oshared.h b/src/H5Oshared.h index c0f5cd6..ddacc25 100644 --- a/src/H5Oshared.h +++ b/src/H5Oshared.h @@ -53,7 +53,7 @@ H5O_SHARED_DECODE(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned mesg_flags, { void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_SHARED_DECODE) + FUNC_ENTER_NOAPI_NOINIT #ifndef H5O_SHARED_TYPE #error "Need to define H5O_SHARED_TYPE macro!" @@ -113,7 +113,7 @@ H5O_SHARED_ENCODE(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mes const H5O_shared_t *sh_mesg = (const H5O_shared_t *)_mesg; /* Pointer to shared message portion of actual message */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_SHARED_ENCODE) + FUNC_ENTER_NOAPI_NOINIT #ifndef H5O_SHARED_TYPE #error "Need to define H5O_SHARED_TYPE macro!" @@ -168,7 +168,7 @@ H5O_SHARED_SIZE(const H5F_t *f, hbool_t disable_shared, const void *_mesg) const H5O_shared_t *sh_mesg = (const H5O_shared_t *)_mesg; /* Pointer to shared message portion of actual message */ size_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_SHARED_SIZE) + FUNC_ENTER_NOAPI_NOINIT #ifndef H5O_SHARED_TYPE #error "Need to define H5O_SHARED_TYPE macro!" @@ -221,7 +221,7 @@ H5O_SHARED_DELETE(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, void *_mesg) H5O_shared_t *sh_mesg = (H5O_shared_t *)_mesg; /* Pointer to shared message portion of actual message */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_SHARED_DELETE) + FUNC_ENTER_NOAPI_NOINIT #ifndef H5O_SHARED_TYPE #error "Need to define H5O_SHARED_TYPE macro!" @@ -273,7 +273,7 @@ H5O_SHARED_LINK(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, void *_mesg) H5O_shared_t *sh_mesg = (H5O_shared_t *)_mesg; /* Pointer to shared message portion of actual message */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_SHARED_LINK) + FUNC_ENTER_NOAPI_NOINIT #ifndef H5O_SHARED_TYPE #error "Need to define H5O_SHARED_TYPE macro!" @@ -325,7 +325,7 @@ H5O_SHARED_COPY_FILE(H5F_t *file_src, void *_native_src, H5F_t *file_dst, void *dst_mesg = NULL; /* Destination message */ void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_SHARED_COPY_FILE) + FUNC_ENTER_NOAPI_NOINIT #ifndef H5O_SHARED_TYPE #error "Need to define H5O_SHARED_TYPE macro!" @@ -385,15 +385,17 @@ static H5_inline herr_t H5O_SHARED_POST_COPY_FILE(const H5O_loc_t *oloc_src, const void *mesg_src, H5O_loc_t *oloc_dst, void *mesg_dst, hid_t dxpl_id, H5O_copy_t *cpy_info) { - const H5O_shared_t *shared_dst = (const H5O_shared_t *)mesg_dst; /* Alias to shared info in native source */ - herr_t ret_value = SUCCEED; /* Return value */ + const H5O_shared_t *shared_src = (const H5O_shared_t *)mesg_src; /* Alias to shared info in native source */ + H5O_shared_t *shared_dst = (H5O_shared_t *)mesg_dst; /* Alias to shared info in native destination */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_SHARED_POST_COPY_FILE) + FUNC_ENTER_NOAPI_NOINIT HDassert(oloc_src->file); HDassert(oloc_dst->file); HDassert(mesg_src); HDassert(mesg_dst); + HDassert(cpy_info); #ifndef H5O_SHARED_TYPE #error "Need to define H5O_SHARED_TYPE macro!" @@ -408,11 +410,17 @@ H5O_SHARED_POST_COPY_FILE(const H5O_loc_t *oloc_src, const void *mesg_src, HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy native message to another file") #endif /* H5O_SHARED_POST_COPY_FILE_REAL */ - /* update only shared message after the post copy */ - if(H5O_msg_is_shared(shared_dst->msg_type_id, mesg_dst)) { - if(H5O_shared_post_copy_file(oloc_dst->file, dxpl_id, cpy_info->oh_dst, mesg_dst) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_WRITEERROR, FAIL, "unable to fix shared message in post copy") - } + /* Update shared message after the post copy - will short circuit in + * production if the DEFER pass determined it will not be shared; debug mode + * verifies that it is indeed the case */ + if(H5O_shared_post_copy_file(oloc_dst->file, H5O_SHARED_TYPE, + shared_src, shared_dst, dxpl_id, cpy_info) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_WRITEERROR, FAIL, "unable to fix shared message in post copy") + + /* Make sure that if the the source or destination is committed, both are + * committed */ + HDassert((shared_src->type == H5O_SHARE_TYPE_COMMITTED) + == (shared_dst->type == H5O_SHARE_TYPE_COMMITTED)); done: FUNC_LEAVE_NOAPI(ret_value) @@ -443,7 +451,7 @@ H5O_SHARED_DEBUG(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE *stream, const H5O_shared_t *sh_mesg = (const H5O_shared_t *)_mesg; /* Pointer to shared message portion of actual message */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_SHARED_DEBUG) + FUNC_ENTER_NOAPI_NOINIT #ifndef H5O_SHARED_TYPE #error "Need to define H5O_SHARED_TYPE macro!" diff --git a/src/H5Oshmesg.c b/src/H5Oshmesg.c index 51c1c55..69c7d49 100644 --- a/src/H5Oshmesg.c +++ b/src/H5Oshmesg.c @@ -82,7 +82,7 @@ H5O_shmesg_decode(H5F_t *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, H5O_shmesg_table_t *mesg; /* Native message */ void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_shmesg_decode) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(f); @@ -121,7 +121,7 @@ H5O_shmesg_encode(H5F_t *f, hbool_t UNUSED disable_shared, uint8_t *p, const voi { const H5O_shmesg_table_t *mesg = (const H5O_shmesg_table_t *)_mesg; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_shmesg_encode) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ HDassert(f); @@ -158,7 +158,7 @@ H5O_shmesg_copy(const void *_mesg, void *_dest) H5O_shmesg_table_t *dest = (H5O_shmesg_table_t *)_dest; void *ret_value; - FUNC_ENTER_NOAPI_NOINIT(H5O_shmesg_copy) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(mesg); @@ -196,7 +196,7 @@ H5O_shmesg_size(const H5F_t *f, hbool_t UNUSED disable_shared, const void UNUSED { size_t ret_value; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_shmesg_size) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ HDassert(f); @@ -227,7 +227,7 @@ H5O_shmesg_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, FILE { const H5O_shmesg_table_t *mesg = (const H5O_shmesg_table_t *)_mesg; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_shmesg_debug) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ HDassert(f); diff --git a/src/H5Ostab.c b/src/H5Ostab.c index 5d1909b..3e9a5b5 100644 --- a/src/H5Ostab.c +++ b/src/H5Ostab.c @@ -102,7 +102,7 @@ H5O_stab_decode(H5F_t *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, H5O_stab_t *stab = NULL; void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_stab_decode) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(f); @@ -145,7 +145,7 @@ H5O_stab_encode(H5F_t *f, hbool_t UNUSED disable_shared, uint8_t *p, const void { const H5O_stab_t *stab = (const H5O_stab_t *) _mesg; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_stab_encode); + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ assert(f); @@ -156,7 +156,7 @@ H5O_stab_encode(H5F_t *f, hbool_t UNUSED disable_shared, uint8_t *p, const void H5F_addr_encode(f, &p, stab->btree_addr); H5F_addr_encode(f, &p, stab->heap_addr); - FUNC_LEAVE_NOAPI(SUCCEED); + FUNC_LEAVE_NOAPI(SUCCEED) } @@ -183,7 +183,7 @@ H5O_stab_copy(const void *_mesg, void *_dest) H5O_stab_t *dest = (H5O_stab_t *) _dest; void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_stab_copy) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(stab); @@ -223,12 +223,12 @@ H5O_stab_size(const H5F_t *f, hbool_t UNUSED disable_shared, const void UNUSED * { size_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_stab_size); + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Set return value */ ret_value=2 * H5F_SIZEOF_ADDR(f); - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } @@ -249,7 +249,7 @@ H5O_stab_size(const H5F_t *f, hbool_t UNUSED disable_shared, const void UNUSED * static herr_t H5O_stab_free(void *mesg) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_stab_free) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(mesg); @@ -276,14 +276,14 @@ H5O_stab_delete(H5F_t *f, hid_t dxpl_id, H5O_t UNUSED *open_oh, void *mesg) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_stab_delete) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(f); HDassert(mesg); /* Free the file space for the symbol table */ - if(H5G_stab_delete(f, dxpl_id, (const H5O_stab_t *)mesg) < 0) + if(H5G__stab_delete(f, dxpl_id, (const H5O_stab_t *)mesg) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to free symbol table") done: @@ -316,7 +316,7 @@ H5O_stab_copy_file(H5F_t *file_src, void *native_src, H5F_t *file_dst, size_t size_hint; /* Local heap initial size */ void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_stab_copy_file) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(stab_src); @@ -334,7 +334,7 @@ H5O_stab_copy_file(H5F_t *file_src, void *native_src, H5F_t *file_dst, H5_BEGIN_TAG(dxpl_id, H5AC__COPIED_TAG, NULL); /* Create components of symbol table message */ - if(H5G_stab_create_components(file_dst, stab_dst, size_hint, dxpl_id) < 0) + if(H5G__stab_create_components(file_dst, stab_dst, size_hint, dxpl_id) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, NULL, "can't create symbol table components") /* Reset metadata tag */ @@ -378,7 +378,7 @@ H5O_stab_post_copy_file(const H5O_loc_t *src_oloc, const void *mesg_src, H5O_loc H5G_bt_it_cpy_t udata; /* B-tree user data */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_stab_post_copy_file) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(stab_src); @@ -399,7 +399,7 @@ H5O_stab_post_copy_file(const H5O_loc_t *src_oloc, const void *mesg_src, H5O_loc udata.cpy_info = cpy_info; /* Iterate over objects in group, copying them */ - if((H5B_iterate(src_oloc->file, dxpl_id, H5B_SNODE, stab_src->btree_addr, H5G_node_copy, &udata, NULL)) < 0) + if((H5B_iterate(src_oloc->file, dxpl_id, H5B_SNODE, stab_src->btree_addr, H5G__node_copy, &udata, NULL)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "iteration operator failed") done: @@ -428,7 +428,7 @@ H5O_stab_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, FILE * { const H5O_stab_t *stab = (const H5O_stab_t *) _mesg; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_stab_debug); + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ assert(f); @@ -443,5 +443,6 @@ H5O_stab_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, FILE * HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, "Name heap address:", stab->heap_addr); - FUNC_LEAVE_NOAPI(SUCCEED); + FUNC_LEAVE_NOAPI(SUCCEED) } + diff --git a/src/H5Ostorage.c b/src/H5Ostorage.c index 41b16bc..c23b54b 100644 --- a/src/H5Ostorage.c +++ b/src/H5Ostorage.c @@ -113,7 +113,7 @@ H5O_storage_decode(H5F_t *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, uint8_t version; /* Version of message decoded */ void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_storage_decode) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(f); @@ -238,7 +238,7 @@ H5O_storage_encode(H5F_t *f, hbool_t UNUSED disable_shared, uint8_t *p, const H5O_storage_t *mesg = (const H5O_storage_t *) _mesg; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_storage_encode) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(f); @@ -318,7 +318,7 @@ H5O_storage_copy(const void *_mesg, void *_dest) H5O_storage_t *dest = (H5O_storage_t *) _dest; void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_storage_copy) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(mesg); @@ -375,7 +375,7 @@ H5O_storage_size(const H5F_t *f, hbool_t UNUSED disable_shared, const void *_mes const H5O_storage_t *mesg = (const H5O_storage_t *) _mesg; size_t ret_value; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_storage_size) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ HDassert(f); @@ -407,7 +407,7 @@ H5O_storage_reset(void *_mesg) { H5O_storage_t *mesg = (H5O_storage_t *)_mesg; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_storage_reset) + FUNC_ENTER_NOAPI_NOINIT_NOERR if(mesg) { /* Free the compact storage buffer */ @@ -440,7 +440,7 @@ H5O_storage_free(void *_mesg) H5O_storage_t *mesg = (H5O_storage_t *) _mesg; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT(H5O_storage_free) + FUNC_ENTER_NOAPI_NOINIT HDassert(mesg); @@ -473,7 +473,7 @@ H5O_storage_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, void *_mesg) H5O_storage_t *mesg = (H5O_storage_t *) _mesg; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_storage_delete) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(f); @@ -530,7 +530,7 @@ H5O_storage_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst, H5O_storage_t *storage_dst = NULL; void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_storage_copy_file) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(file_src); @@ -616,7 +616,7 @@ H5O_storage_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, { const H5O_storage_t *mesg = (const H5O_storage_t *) _mesg; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_storage_debug) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ HDassert(f); @@ -715,7 +715,7 @@ H5O_storage_meta_size(const H5F_t *f, const H5O_storage_t *storage, { size_t ret_value; - FUNC_ENTER_NOAPI_NOINIT(H5O_storage_meta_size) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(f); diff --git a/src/H5Otest.c b/src/H5Otest.c index 883bfcd..ca1b426 100644 --- a/src/H5Otest.c +++ b/src/H5Otest.c @@ -101,7 +101,7 @@ H5O_is_attr_dense_test(hid_t oid) H5O_loc_t *loc; /* Pointer to object's location */ htri_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5O_is_attr_dense_test, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Get object location for object */ if(NULL == (loc = H5O_get_loc(oid))) @@ -166,7 +166,7 @@ H5O_is_attr_empty_test(hid_t oid) hsize_t nattrs; /* Number of attributes */ htri_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5O_is_attr_empty_test, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Get object location for object */ if(NULL == (loc = H5O_get_loc(oid))) @@ -259,7 +259,7 @@ H5O_num_attrs_test(hid_t oid, hsize_t *nattrs) hsize_t obj_nattrs; /* Number of attributes */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5O_num_attrs_test, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Get object location for object */ if(NULL == (loc = H5O_get_loc(oid))) @@ -351,7 +351,7 @@ H5O_attr_dense_info_test(hid_t oid, hsize_t *name_count, hsize_t *corder_count) H5O_loc_t *loc; /* Pointer to object's location */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5O_attr_dense_info_test, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Get object location for object */ if(NULL == (loc = H5O_get_loc(oid))) @@ -399,6 +399,9 @@ H5O_attr_dense_info_test(hid_t oid, hsize_t *name_count, hsize_t *corder_count) else *corder_count = 0; + /* Reset metadata tag in dxpl_id */ + H5_END_TAG(FAIL); + done: /* Release resources */ if(bt2_name && H5B2_close(bt2_name, H5AC_ind_dxpl_id) < 0) @@ -408,9 +411,6 @@ done: if(oh && H5O_unprotect(loc, H5AC_ind_dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header") - /* Reset metadata tag in dxpl_id */ - H5_END_TAG(FAIL); - FUNC_LEAVE_NOAPI(ret_value) } /* H5O_attr_dense_info_test() */ @@ -445,7 +445,7 @@ H5O_check_msg_marked_test(hid_t oid, hbool_t flag_val) unsigned idx; /* Index of message */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5O_check_msg_marked_test, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Get object location for object */ if(NULL == (loc = H5O_get_loc(oid))) @@ -508,7 +508,7 @@ H5O_expunge_chunks_test(const H5O_loc_t *loc, hid_t dxpl_id) unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5O_expunge_chunks_test, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Get the object header */ if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC_WRITE))) @@ -564,7 +564,7 @@ H5O_get_rc(const H5O_loc_t *loc, hid_t dxpl_id, unsigned *rc) H5O_t *oh = NULL; /* Object header */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5O_get_rc, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ HDassert(loc); diff --git a/src/H5Ounknown.c b/src/H5Ounknown.c index d4a3801..548f74d 100644 --- a/src/H5Ounknown.c +++ b/src/H5Ounknown.c @@ -40,7 +40,7 @@ const H5O_msg_class_t H5O_MSG_UNKNOWN[1] = {{ H5O_UNKNOWN_ID, /*message id number */ "unknown", /*message name for debugging */ 0, /*native message size */ - FALSE, /* messages are sharable? */ + 0, /* messages are sharable? */ NULL, /*decode message */ NULL, /*encode message */ NULL, /*copy the native value */ @@ -78,7 +78,7 @@ H5FL_DEFINE(H5O_unknown_t); static herr_t H5O_unknown_free(void *mesg) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_unknown_free) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(mesg); diff --git a/src/H5P.c b/src/H5P.c index afcb84e..92b3d18 100644 --- a/src/H5P.c +++ b/src/H5P.c @@ -81,7 +81,7 @@ DESCRIPTION static herr_t H5P_init_pub_interface(void) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5P_init_pub_interface) + FUNC_ENTER_NOAPI_NOINIT_NOERR FUNC_LEAVE_NOAPI(H5P_init()) } /* H5P_init_pub_interface() */ @@ -114,7 +114,7 @@ H5Pcopy(hid_t id) void *obj; /* Property object to copy */ hid_t ret_value=FALSE; /* return value */ - FUNC_ENTER_API(H5Pcopy, FAIL); + FUNC_ENTER_API(FAIL) H5TRACE1("i", "i", id); if(H5P_DEFAULT==id) @@ -147,7 +147,7 @@ H5Pcopy(hid_t id) } /* end else */ done: - FUNC_LEAVE_API(ret_value); + FUNC_LEAVE_API(ret_value) } /* H5Pcopy() */ @@ -196,7 +196,7 @@ H5Pcreate_class(hid_t parent, const char *name, H5P_genclass_t *pclass = NULL; /* Property list class created */ hid_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Pcreate_class, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE8("i", "i*sx*xx*xx*x", parent, name, cls_create, create_data, cls_copy, copy_data, cls_close, close_data); @@ -260,7 +260,7 @@ H5Pcreate(hid_t cls_id) H5P_genclass_t *pclass; /* Property list class to modify */ hid_t ret_value; /* return value */ - FUNC_ENTER_API(H5Pcreate, FAIL); + FUNC_ENTER_API(FAIL) H5TRACE1("i", "i", cls_id); /* Check arguments. */ @@ -272,7 +272,7 @@ H5Pcreate(hid_t cls_id) HGOTO_ERROR(H5E_PLIST, H5E_CANTCREATE, FAIL, "unable to create property list"); done: - FUNC_LEAVE_API(ret_value); + FUNC_LEAVE_API(ret_value) } /* H5Pcreate() */ @@ -441,7 +441,7 @@ H5Pregister2(hid_t cls_id, const char *name, size_t size, void *def_value, H5P_genclass_t *orig_pclass; /* Original property class */ herr_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Pregister2, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE11("e", "i*sz*xxxxxxxx", cls_id, name, size, def_value, prp_create, prp_set, prp_get, prp_delete, prp_copy, prp_cmp, prp_close); @@ -625,7 +625,7 @@ H5Pinsert2(hid_t plist_id, const char *name, size_t size, void *value, H5P_genplist_t *plist; /* Property list to modify */ herr_t ret_value; /* return value */ - FUNC_ENTER_API(H5Pinsert2, FAIL); + FUNC_ENTER_API(FAIL) H5TRACE10("e", "i*sz*xxxxxxx", plist_id, name, size, value, prp_set, prp_get, prp_delete, prp_copy, prp_cmp, prp_close); @@ -642,7 +642,7 @@ H5Pinsert2(hid_t plist_id, const char *name, size_t size, void *value, HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "unable to register property in plist") done: - FUNC_LEAVE_API(ret_value); + FUNC_LEAVE_API(ret_value) } /* H5Pinsert2() */ @@ -683,7 +683,7 @@ H5Pset(hid_t plist_id, const char *name, void *value) H5P_genplist_t *plist; /* Property list to modify */ herr_t ret_value=SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pset, FAIL); + FUNC_ENTER_API(FAIL) H5TRACE3("e", "i*s*x", plist_id, name, value); /* Check arguments. */ @@ -699,7 +699,7 @@ H5Pset(hid_t plist_id, const char *name, void *value) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "unable to set value in plist"); done: - FUNC_LEAVE_API(ret_value); + FUNC_LEAVE_API(ret_value) } /* H5Pset() */ @@ -732,7 +732,7 @@ H5Pexist(hid_t id, const char *name) H5P_genclass_t *pclass; /* Property class to query */ htri_t ret_value; /* return value */ - FUNC_ENTER_API(H5Pexist, FAIL); + FUNC_ENTER_API(FAIL) H5TRACE2("t", "i*s", id, name); /* Check arguments. */ @@ -759,7 +759,7 @@ H5Pexist(hid_t id, const char *name) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property object"); done: - FUNC_LEAVE_API(ret_value); + FUNC_LEAVE_API(ret_value) } /* H5Pexist() */ @@ -793,7 +793,7 @@ H5Pget_size(hid_t id, const char *name, size_t *size) H5P_genplist_t *plist; /* Property list to query */ herr_t ret_value; /* return value */ - FUNC_ENTER_API(H5Pget_size, FAIL); + FUNC_ENTER_API(FAIL) H5TRACE3("e", "i*s*z", id, name, size); /* Check arguments. */ @@ -825,7 +825,7 @@ H5Pget_size(hid_t id, const char *name, size_t *size) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property object"); done: - FUNC_LEAVE_API(ret_value); + FUNC_LEAVE_API(ret_value) } /* H5Pget_size() */ @@ -856,7 +856,7 @@ H5Pget_class(hid_t plist_id) H5P_genclass_t *pclass=NULL; /* Property list class */ hid_t ret_value=FAIL; /* return value */ - FUNC_ENTER_API(H5Pget_class, FAIL); + FUNC_ENTER_API(FAIL) H5TRACE1("i", "i", plist_id); /* Check arguments. */ @@ -879,7 +879,7 @@ done: if(ret_value<0 && pclass) H5P_close_class(pclass); - FUNC_LEAVE_API(ret_value); + FUNC_LEAVE_API(ret_value) } /* H5Pget_class() */ @@ -913,7 +913,7 @@ H5Pget_nprops(hid_t id, size_t *nprops) H5P_genclass_t *pclass; /* Property class to query */ herr_t ret_value=SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pget_nprops, FAIL); + FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*z", id, nprops); /* Check arguments. */ @@ -939,7 +939,7 @@ H5Pget_nprops(hid_t id, size_t *nprops) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property object"); done: - FUNC_LEAVE_API(ret_value); + FUNC_LEAVE_API(ret_value) } /* H5Pget_nprops() */ @@ -969,7 +969,7 @@ H5Pequal(hid_t id1, hid_t id2) void *obj1, *obj2; /* Property objects to compare */ htri_t ret_value = FALSE; /* return value */ - FUNC_ENTER_API(H5Pequal, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("t", "ii", id1, id2); /* Check arguments. */ @@ -1025,7 +1025,7 @@ H5Pisa_class(hid_t plist_id, hid_t pclass_id) { htri_t ret_value; /* return value */ - FUNC_ENTER_API(H5Pisa_class, FAIL); + FUNC_ENTER_API(FAIL) H5TRACE2("t", "ii", plist_id, pclass_id); /* Check arguments. */ @@ -1039,7 +1039,7 @@ H5Pisa_class(hid_t plist_id, hid_t pclass_id) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "unable to compare property list classes"); done: - FUNC_LEAVE_API(ret_value); + FUNC_LEAVE_API(ret_value) } /* H5Pisa_class() */ @@ -1102,7 +1102,7 @@ H5Piterate(hid_t id, int *idx, H5P_iterate_t iter_func, void *iter_data) int fake_idx = 0; /* Index when user doesn't provide one */ int ret_value; /* return value */ - FUNC_ENTER_API(H5Piterate, FAIL); + FUNC_ENTER_API(FAIL) H5TRACE4("Is", "i*Isx*x", id, idx, iter_func, iter_data); /* Check arguments. */ @@ -1126,7 +1126,7 @@ H5Piterate(hid_t id, int *idx, H5P_iterate_t iter_func, void *iter_data) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property object"); done: - FUNC_LEAVE_API(ret_value); + FUNC_LEAVE_API(ret_value) } /* H5Piterate() */ @@ -1164,7 +1164,7 @@ H5Pget(hid_t plist_id, const char *name, void *value) H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pget, FAIL); + FUNC_ENTER_API(FAIL) H5TRACE3("e", "i*s*x", plist_id, name, value); /* Check arguments. */ @@ -1180,7 +1180,7 @@ H5Pget(hid_t plist_id, const char *name, void *value) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to query property value"); done: - FUNC_LEAVE_API(ret_value); + FUNC_LEAVE_API(ret_value) } /* H5Pget() */ @@ -1216,7 +1216,7 @@ H5Premove(hid_t plist_id, const char *name) H5P_genplist_t *plist; /* Property list to modify */ herr_t ret_value; /* return value */ - FUNC_ENTER_API(H5Premove, FAIL); + FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*s", plist_id, name); /* Check arguments. */ @@ -1230,7 +1230,7 @@ H5Premove(hid_t plist_id, const char *name) HGOTO_ERROR(H5E_PLIST, H5E_CANTDELETE, FAIL, "unable to remove property"); done: - FUNC_LEAVE_API(ret_value); + FUNC_LEAVE_API(ret_value) } /* H5Premove() */ @@ -1278,7 +1278,7 @@ H5Pcopy_prop(hid_t dst_id, hid_t src_id, const char *name) H5I_type_t src_id_type, dst_id_type; /* ID types */ herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pcopy_prop, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("e", "ii*s", dst_id, src_id, name); /* Check arguments. */ @@ -1337,7 +1337,7 @@ H5Punregister(hid_t pclass_id, const char *name) H5P_genclass_t *pclass; /* Property list class to modify */ herr_t ret_value; /* return value */ - FUNC_ENTER_API(H5Punregister, FAIL); + FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*s", pclass_id, name); /* Check arguments. */ @@ -1351,7 +1351,7 @@ H5Punregister(hid_t pclass_id, const char *name) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "unable to remove property from class"); done: - FUNC_LEAVE_API(ret_value); + FUNC_LEAVE_API(ret_value) } /* H5Punregister() */ @@ -1381,7 +1381,7 @@ H5Pclose(hid_t plist_id) { herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pclose, FAIL); + FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", plist_id); /* Allow default property lists to pass through without throwing an error */ @@ -1396,7 +1396,7 @@ H5Pclose(hid_t plist_id) } /* end if */ done: - FUNC_LEAVE_API(ret_value); + FUNC_LEAVE_API(ret_value) } /* H5Pclose() */ @@ -1426,7 +1426,7 @@ H5Pget_class_name(hid_t pclass_id) H5P_genclass_t *pclass; /* Property class to query */ char *ret_value; /* return value */ - FUNC_ENTER_API(H5Pget_class_name, NULL); + FUNC_ENTER_API(NULL) /* Check arguments. */ if(NULL == (pclass = (H5P_genclass_t *)H5I_object_verify(pclass_id, H5I_GENPROP_CLS))) @@ -1437,7 +1437,7 @@ H5Pget_class_name(hid_t pclass_id) HGOTO_ERROR(H5E_PLIST, H5E_NOTFOUND, NULL, "unable to query name of class"); done: - FUNC_LEAVE_API(ret_value); + FUNC_LEAVE_API(ret_value) } /* H5Pget_class_name() */ @@ -1467,7 +1467,7 @@ H5Pget_class_parent(hid_t pclass_id) H5P_genclass_t *parent = NULL; /* Parent's property class */ hid_t ret_value; /* return value */ - FUNC_ENTER_API(H5Pget_class_parent, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("i", "i", pclass_id); /* Check arguments. */ @@ -1517,7 +1517,7 @@ H5Pclose_class(hid_t cls_id) { hid_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Pclose_class, FAIL); + FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", cls_id); /* Check arguments */ diff --git a/src/H5Pdapl.c b/src/H5Pdapl.c index 356c42d..51e62fe 100644 --- a/src/H5Pdapl.c +++ b/src/H5Pdapl.c @@ -126,7 +126,7 @@ H5P_dacc_reg_prop(H5P_genclass_t *pclass) double rdcc_w0 = H5D_ACS_PREEMPT_READ_CHUNKS_DEF; /* Default raw data chunk cache dirty ratio */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5P_dacc_reg_prop) + FUNC_ENTER_NOAPI_NOINIT /* Register the size of raw data chunk cache (elements) */ if(H5P_register_real(pclass, H5D_ACS_DATA_CACHE_NUM_SLOTS_NAME, H5D_ACS_DATA_CACHE_NUM_SLOTS_SIZE, &rdcc_nslots, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) @@ -181,7 +181,7 @@ H5Pset_chunk_cache(hid_t dapl_id, size_t rdcc_nslots, size_t rdcc_nbytes, double H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pset_chunk_cache, FAIL); + FUNC_ENTER_API(FAIL) H5TRACE4("e", "izzd", dapl_id, rdcc_nslots, rdcc_nbytes, rdcc_w0); /* Check arguments. Note that we allow negative values - they are @@ -202,7 +202,7 @@ H5Pset_chunk_cache(hid_t dapl_id, size_t rdcc_nslots, size_t rdcc_nbytes, double HGOTO_ERROR(H5E_PLIST, H5E_CANTSET,FAIL, "can't set preempt read chunks"); done: - FUNC_LEAVE_API(ret_value); + FUNC_LEAVE_API(ret_value) } @@ -233,7 +233,7 @@ H5Pget_chunk_cache(hid_t dapl_id, size_t *rdcc_nslots, size_t *rdcc_nbytes, doub H5P_genplist_t *def_plist; /* Default file access property list */ herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pget_chunk_cache, FAIL); + FUNC_ENTER_API(FAIL) H5TRACE4("e", "i*z*z*d", dapl_id, rdcc_nslots, rdcc_nbytes, rdcc_w0); /* Get the plist structure */ @@ -269,5 +269,5 @@ H5Pget_chunk_cache(hid_t dapl_id, size_t *rdcc_nslots, size_t *rdcc_nbytes, doub } /* end if */ done: - FUNC_LEAVE_API(ret_value); + FUNC_LEAVE_API(ret_value) } diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c index fc58a6d..9ea4f7f 100644 --- a/src/H5Pdcpl.c +++ b/src/H5Pdcpl.c @@ -183,7 +183,7 @@ H5P_dcrt_reg_prop(H5P_genclass_t *pclass) H5O_efl_t efl = H5D_CRT_EXT_FILE_LIST_DEF; /* Default external file list */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5P_dcrt_reg_prop) + FUNC_ENTER_NOAPI_NOINIT /* Register the storage layout property */ if(H5P_register_real(pclass, H5D_CRT_LAYOUT_NAME, H5D_CRT_LAYOUT_SIZE, &layout, NULL, NULL, NULL, NULL, NULL, H5D_CRT_LAYOUT_CMP, NULL) < 0) @@ -232,7 +232,7 @@ H5P_dcrt_copy(hid_t dst_plist_id, hid_t src_plist_id, void UNUSED *copy_data) H5P_genplist_t *dst_plist; /* Pointer to destination property list */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5P_dcrt_copy) + FUNC_ENTER_NOAPI_NOINIT /* Verify property list IDs */ if(NULL == (dst_plist = (H5P_genplist_t *)H5I_object(dst_plist_id))) @@ -342,7 +342,7 @@ H5P_dcrt_close(hid_t dcpl_id, void UNUSED *close_data) H5P_genplist_t *plist; /* Property list */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5P_dcrt_close) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments */ if(NULL == (plist = (H5P_genplist_t *)H5I_object(dcpl_id))) @@ -389,7 +389,7 @@ H5P_dcrt_layout_cmp(const void *_layout1, const void *_layout2, size_t UNUSED si *layout2 = (const H5O_layout_t *)_layout2; herr_t ret_value = 0; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5P_dcrt_layout_cmp) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ HDassert(layout1); @@ -458,7 +458,7 @@ H5P_fill_value_cmp(const void *_fill1, const void *_fill2, size_t UNUSED size) int cmp_value; /* Value from comparison */ herr_t ret_value = 0; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5P_fill_value_cmp) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ HDassert(fill1); @@ -520,7 +520,7 @@ H5P_dcrt_ext_file_list_cmp(const void *_efl1, const void *_efl2, size_t UNUSED s int cmp_value; /* Value from comparison */ herr_t ret_value = 0; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5P_dcrt_ext_file_list_cmp) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ HDassert(efl1); @@ -595,7 +595,7 @@ H5P_set_layout(H5P_genplist_t *plist, const H5O_layout_t *layout) unsigned alloc_time_state; /* State of allocation time property */ herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_NOAPI_NOINIT(H5P_set_layout) + FUNC_ENTER_NOAPI_NOINIT /* Get the allocation time state */ if(H5P_get(plist, H5D_CRT_ALLOC_TIME_STATE_NAME, &alloc_time_state) < 0) @@ -662,7 +662,7 @@ H5P_init_def_layout(void) const H5O_storage_compact_t def_store_compact = H5D_DEF_STORAGE_COMPACT_INIT; const H5O_storage_chunk_t def_store_chunk = H5D_DEF_STORAGE_CHUNK_INIT; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5P_init_def_layout) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Initialize the default layout info for non-contigous layouts */ H5D_def_layout_compact_g.storage.u.compact = def_store_compact; @@ -703,7 +703,7 @@ H5Pset_layout(hid_t plist_id, H5D_layout_t layout_type) const H5O_layout_t *layout; /* Pointer to default layout information for type specified */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Pset_layout, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "iDl", plist_id, layout_type); /* Check arguments */ @@ -778,7 +778,7 @@ H5Pget_layout(hid_t plist_id) H5O_layout_t layout; /* Layout property */ H5D_layout_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Pget_layout, H5D_LAYOUT_ERROR) + FUNC_ENTER_API(H5D_LAYOUT_ERROR) H5TRACE1("Dl", "i", plist_id); /* Get the plist structure */ @@ -831,7 +831,7 @@ H5Pset_chunk(hid_t plist_id, int ndims, const hsize_t dim[/*ndims*/]) unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Pset_chunk, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("e", "iIs*[a1]h", plist_id, ndims, dim); /* Check arguments */ @@ -923,7 +923,7 @@ H5Pget_chunk(hid_t plist_id, int max_ndims, hsize_t dim[]/*out*/) H5O_layout_t layout; /* Layout information */ int ret_value; /* Return value */ - FUNC_ENTER_API(H5Pget_chunk, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("Is", "iIsx", plist_id, max_ndims, dim); /* Get the plist structure */ @@ -975,7 +975,7 @@ H5Pset_chunk_opts(hid_t plist_id, unsigned options) uint8_t layout_flags = 0; /* "options" translated into layout message flags format */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Pset_chunk_opts, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "iIu", plist_id, options); /* Check arguments */ @@ -1042,7 +1042,7 @@ H5Pget_chunk_opts(hid_t plist_id, unsigned *options) H5O_layout_t layout; /* Layout information for setting chunk info */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Pget_chunk_opts, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*Iu", plist_id, options); #ifndef H5_HAVE_C99_DESIGNATED_INITIALIZER @@ -1121,7 +1121,7 @@ H5Pset_external(hid_t plist_id, const char *name, off_t offset, hsize_t size) H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Pset_external, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE4("e", "i*soh", plist_id, name, offset, size); /* Check arguments */ @@ -1201,7 +1201,7 @@ H5Pget_external_count(hid_t plist_id) H5P_genplist_t *plist; /* Property list pointer */ int ret_value; /* return value */ - FUNC_ENTER_API(H5Pget_external_count, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("Is", "i", plist_id); /* Get the plist structure */ @@ -1259,7 +1259,7 @@ H5Pget_external(hid_t plist_id, unsigned idx, size_t name_size, char *name/*out* H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pget_external, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE6("e", "iIuzxxx", plist_id, idx, name_size, name, offset, size); /* Get the plist structure */ @@ -1318,7 +1318,7 @@ H5Pset_szip(hid_t plist_id, unsigned options_mask, unsigned pixels_per_block) unsigned int config_flags; herr_t ret_value=SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pset_szip, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("e", "iIuIu", plist_id, options_mask, pixels_per_block); if(H5Zget_filter_info(H5Z_FILTER_SZIP, &config_flags) < 0) @@ -1388,7 +1388,7 @@ H5Pset_shuffle(hid_t plist_id) H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pset_shuffle, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", plist_id); /* Check arguments */ @@ -1434,7 +1434,7 @@ H5Pset_nbit(hid_t plist_id) H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pset_nbit, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", plist_id); /* Check arguments */ @@ -1497,7 +1497,7 @@ H5Pset_scaleoffset(hid_t plist_id, H5Z_SO_scale_type_t scale_type, int scale_fac unsigned cd_values[2]; /* Filter parameters */ herr_t ret_value=SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pset_scaleoffset, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("e", "iZaIs", plist_id, scale_type, scale_factor); /* Check arguments */ @@ -1568,7 +1568,7 @@ H5Pset_fill_value(hid_t plist_id, hid_t type_id, const void *value) H5O_fill_t fill; /* Fill value to modify */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Pset_fill_value, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("e", "ii*x", plist_id, type_id, value); /* Get the plist structure */ @@ -1662,7 +1662,7 @@ H5P_get_fill_value(H5P_genplist_t *plist, const H5T_t *type, void *value/*out*/, hid_t dst_id = -1; /*destination datatype id */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5P_get_fill_value, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* * If no fill value is defined then return an error. We can't even @@ -1752,7 +1752,7 @@ H5Pget_fill_value(hid_t plist_id, hid_t type_id, void *value/*out*/) H5T_t *type; /* Datatype */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Pget_fill_value, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("e", "iix", plist_id, type_id, value); /* Check arguments */ @@ -1791,7 +1791,7 @@ H5P_is_fill_value_defined(const H5O_fill_t *fill, H5D_fill_value_t *status) { herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI(H5P_is_fill_value_defined, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert(fill); HDassert(status); @@ -1833,7 +1833,7 @@ H5P_fill_value_defined(H5P_genplist_t *plist, H5D_fill_value_t *status) H5O_fill_t fill; /* Fill value to query */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI(H5P_fill_value_defined, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert(status); @@ -1868,7 +1868,7 @@ H5Pfill_value_defined(hid_t plist_id, H5D_fill_value_t *status) H5P_genplist_t *plist; /* Property list to query */ herr_t ret_value = SUCCEED; - FUNC_ENTER_API(H5Pfill_value_defined, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*DF", plist_id, status); HDassert(status); @@ -1911,7 +1911,7 @@ H5Pset_alloc_time(hid_t plist_id, H5D_alloc_time_t alloc_time) unsigned alloc_time_state; /* State of allocation time property */ herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pset_alloc_time, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "iDa", plist_id, alloc_time); /* Check arguments */ @@ -1992,7 +1992,7 @@ H5Pget_alloc_time(hid_t plist_id, H5D_alloc_time_t *alloc_time/*out*/) { herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pget_alloc_time, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "ix", plist_id, alloc_time); /* Get values */ @@ -2037,7 +2037,7 @@ H5Pset_fill_time(hid_t plist_id, H5D_fill_time_t fill_time) H5O_fill_t fill; /* Fill value property to modify */ herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pset_fill_time, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "iDf", plist_id, fill_time); /* Check arguments */ @@ -2085,7 +2085,7 @@ H5Pget_fill_time(hid_t plist_id, H5D_fill_time_t *fill_time/*out*/) { herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pget_fill_time, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "ix", plist_id, fill_time); /* Set values */ diff --git a/src/H5Pdeprec.c b/src/H5Pdeprec.c index 1528df5..8d1d75f 100644 --- a/src/H5Pdeprec.c +++ b/src/H5Pdeprec.c @@ -97,7 +97,7 @@ DESCRIPTION static herr_t H5P_init_deprec_interface(void) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5P_init_deprec_interface) + FUNC_ENTER_NOAPI_NOINIT_NOERR FUNC_LEAVE_NOAPI(H5P_init()) } /* H5P_init_deprec_interface() */ @@ -253,7 +253,7 @@ H5Pregister1(hid_t cls_id, const char *name, size_t size, void *def_value, H5P_genclass_t *orig_pclass; /* Original property class */ herr_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Pregister1, FAIL); + FUNC_ENTER_API(FAIL) H5TRACE10("e", "i*sz*xxxxxxx", cls_id, name, size, def_value, prp_create, prp_set, prp_get, prp_delete, prp_copy, prp_close); @@ -285,7 +285,7 @@ H5Pregister1(hid_t cls_id, const char *name, size_t size, void *def_value, } /* end if */ done: - FUNC_LEAVE_API(ret_value); + FUNC_LEAVE_API(ret_value) } /* H5Pregister1() */ @@ -437,7 +437,7 @@ H5Pinsert1(hid_t plist_id, const char *name, size_t size, void *value, H5P_genplist_t *plist; /* Property list to modify */ herr_t ret_value; /* return value */ - FUNC_ENTER_API(H5Pinsert1, FAIL); + FUNC_ENTER_API(FAIL) H5TRACE9("e", "i*sz*xxxxxx", plist_id, name, size, value, prp_set, prp_get, prp_delete, prp_copy, prp_close); @@ -454,7 +454,7 @@ H5Pinsert1(hid_t plist_id, const char *name, size_t size, void *value, HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "unable to register property in plist") done: - FUNC_LEAVE_API(ret_value); + FUNC_LEAVE_API(ret_value) } /* H5Pinsert1() */ @@ -488,7 +488,7 @@ H5Pget_version(hid_t plist_id, unsigned *super/*out*/, unsigned *freelist/*out*/ H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Pget_version, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE5("e", "ixxxx", plist_id, super, freelist, stab, shhdr); /* Get the plist structure */ diff --git a/src/H5Pdxpl.c b/src/H5Pdxpl.c index 0e81727..ea292e6 100644 --- a/src/H5Pdxpl.c +++ b/src/H5Pdxpl.c @@ -98,14 +98,20 @@ #define H5D_XFER_MPIO_CHUNK_OPT_HARD_DEF H5FD_MPIO_CHUNK_DEFAULT #define H5D_XFER_MPIO_CHUNK_OPT_NUM_SIZE sizeof(unsigned) #define H5D_XFER_MPIO_CHUNK_OPT_NUM_DEF H5D_ONE_LINK_CHUNK_IO_THRESHOLD -#define H5D_XFER_MPIO_CHUNK_OPT_RATIO_SIZE sizeof(unsigned) +#define H5D_XFER_MPIO_CHUNK_OPT_RATIO_SIZE sizeof(unsigned) #define H5D_XFER_MPIO_CHUNK_OPT_RATIO_DEF H5D_MULTI_CHUNK_IO_COL_THRESHOLD +/* Definitions for chunk opt mode property. */ +#define H5D_MPIO_ACTUAL_CHUNK_OPT_MODE_SIZE sizeof(H5D_mpio_actual_chunk_opt_mode_t) +#define H5D_MPIO_ACTUAL_CHUNK_OPT_MODE_DEF H5D_MPIO_NO_CHUNK_OPTIMIZATION +/* Definitions for chunk io mode property. */ +#define H5D_MPIO_ACTUAL_IO_MODE_SIZE sizeof(H5D_mpio_actual_io_mode_t) +#define H5D_MPIO_ACTUAL_IO_MODE_DEF H5D_MPIO_NO_COLLECTIVE /* Definitions for EDC property */ -#define H5D_XFER_EDC_SIZE sizeof(H5Z_EDC_t) -#define H5D_XFER_EDC_DEF H5Z_ENABLE_EDC +#define H5D_XFER_EDC_SIZE sizeof(H5Z_EDC_t) +#define H5D_XFER_EDC_DEF H5Z_ENABLE_EDC /* Definitions for filter callback function property */ -#define H5D_XFER_FILTER_CB_SIZE sizeof(H5Z_cb_t) -#define H5D_XFER_FILTER_CB_DEF {NULL,NULL} +#define H5D_XFER_FILTER_CB_SIZE sizeof(H5Z_cb_t) +#define H5D_XFER_FILTER_CB_DEF {NULL,NULL} /* Definitions for type conversion callback function property */ #define H5D_XFER_CONV_CB_SIZE sizeof(H5T_conv_cb_t) #define H5D_XFER_CONV_CB_DEF {NULL,NULL} @@ -202,6 +208,8 @@ H5P_dxfr_reg_prop(H5P_genclass_t *pclass) H5FD_mpio_collective_opt_t def_mpio_collective_opt_mode = H5D_XFER_MPIO_COLLECTIVE_OPT_DEF; unsigned def_mpio_chunk_opt_num = H5D_XFER_MPIO_CHUNK_OPT_NUM_DEF; unsigned def_mpio_chunk_opt_ratio = H5D_XFER_MPIO_CHUNK_OPT_RATIO_DEF; + H5D_mpio_actual_chunk_opt_mode_t def_mpio_actual_chunk_opt_mode = H5D_MPIO_ACTUAL_CHUNK_OPT_MODE_DEF; + H5D_mpio_actual_io_mode_t def_mpio_actual_io_mode = H5D_MPIO_ACTUAL_IO_MODE_DEF; #endif /* H5_HAVE_PARALLEL */ H5Z_EDC_t enable_edc = H5D_XFER_EDC_DEF; /* Default value for EDC property */ H5Z_cb_t filter_cb = H5D_XFER_FILTER_CB_DEF; /* Default value for filter callback */ @@ -209,7 +217,7 @@ H5P_dxfr_reg_prop(H5P_genclass_t *pclass) void *def_xfer_xform = H5D_XFER_XFORM_DEF; /* Default value for data transform */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5P_dxfr_reg_prop) + FUNC_ENTER_NOAPI_NOINIT /* Register the max. temp buffer size property */ if(H5P_register_real(pclass, H5D_XFER_MAX_TEMP_BUF_NAME, H5D_XFER_MAX_TEMP_BUF_SIZE, &def_max_temp_buf, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) @@ -264,7 +272,7 @@ H5P_dxfr_reg_prop(H5P_genclass_t *pclass) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") #ifdef H5_HAVE_PARALLEL - /* Register the I/O transfer mode property */ + /* Register the I/O transfer mode properties */ if(H5P_register_real(pclass, H5D_XFER_IO_XFER_MODE_NAME, H5D_XFER_IO_XFER_MODE_SIZE, &def_io_xfer_mode, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") if(H5P_register_real(pclass, H5D_XFER_MPIO_COLLECTIVE_OPT_NAME, H5D_XFER_MPIO_COLLECTIVE_OPT_SIZE, &def_mpio_collective_opt_mode, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) @@ -275,6 +283,14 @@ H5P_dxfr_reg_prop(H5P_genclass_t *pclass) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") if(H5P_register_real(pclass, H5D_XFER_MPIO_CHUNK_OPT_RATIO_NAME, H5D_XFER_MPIO_CHUNK_OPT_RATIO_SIZE, &def_mpio_chunk_opt_ratio, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") + + /* Register the chunk optimization mode property. */ + if(H5P_register_real(pclass, H5D_MPIO_ACTUAL_CHUNK_OPT_MODE_NAME, H5D_MPIO_ACTUAL_CHUNK_OPT_MODE_SIZE, &def_mpio_actual_chunk_opt_mode, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") + + /* Register the actual io mode property. */ + if(H5P_register_real(pclass, H5D_MPIO_ACTUAL_IO_MODE_NAME, H5D_MPIO_ACTUAL_IO_MODE_SIZE, &def_mpio_actual_io_mode, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") #endif /* H5_HAVE_PARALLEL */ /* Register the EDC property */ @@ -326,7 +342,7 @@ H5P_dxfr_create(hid_t dxpl_id, void UNUSED *create_data) H5P_genplist_t *plist; /* Property list */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5P_dxfr_create) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments */ if(NULL == (plist = (H5P_genplist_t *)H5I_object(dxpl_id))) @@ -376,7 +392,7 @@ H5P_dxfr_copy(hid_t dst_dxpl_id, hid_t src_dxpl_id, void UNUSED *copy_data) H5P_genplist_t *src_plist; /* Source property list */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5P_dxfr_copy) + FUNC_ENTER_NOAPI_NOINIT if(NULL == (dst_plist = (H5P_genplist_t *)H5I_object(dst_dxpl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list") @@ -427,7 +443,7 @@ H5P_dxfr_close(hid_t dxpl_id, void UNUSED *close_data) H5P_genplist_t *plist; /* Property list */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5P_dxfr_close) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments */ if(NULL == (plist = (H5P_genplist_t *)H5I_object(dxpl_id))) @@ -467,7 +483,7 @@ H5P_dxfr_xform_del(hid_t UNUSED prop_id, const char UNUSED *name, size_t UNUSED { herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT(H5P_dxfr_xform_del) + FUNC_ENTER_NOAPI_NOINIT HDassert(value); @@ -499,7 +515,7 @@ H5P_dxfr_xform_copy(const char UNUSED *name, size_t UNUSED size, void *value) { herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT(H5P_dxfr_xform_copy) + FUNC_ENTER_NOAPI_NOINIT HDassert(value); @@ -530,7 +546,7 @@ H5P_dxfr_xform_close(const char UNUSED *name, size_t UNUSED size, void *value) { herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT(H5P_dxfr_xform_close) + FUNC_ENTER_NOAPI_NOINIT HDassert(value); @@ -564,7 +580,7 @@ H5Pset_data_transform(hid_t plist_id, const char *expression) H5Z_data_xform_t *data_xform_prop = NULL; /* New data xform property */ herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pset_data_transform, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*s", plist_id, expression); /* Check arguments */ @@ -630,7 +646,7 @@ H5Pget_data_transform(hid_t plist_id, char *expression /*out*/, size_t size) char* pexp; ssize_t ret_value; /* return value */ - FUNC_ENTER_API(H5Pget_data_transform, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("Zs", "ixz", plist_id, expression, size); /* Get the plist structure */ @@ -698,7 +714,7 @@ H5Pset_buffer(hid_t plist_id, size_t size, void *tconv, void *bkg) H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pset_buffer, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE4("e", "iz*x*x", plist_id, size, tconv, bkg); /* Check arguments */ @@ -745,7 +761,7 @@ H5Pget_buffer(hid_t plist_id, void **tconv/*out*/, void **bkg/*out*/) size_t size; /* Type conversion buffer size */ size_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Pget_buffer, 0) + FUNC_ENTER_API(0) H5TRACE3("z", "ixx", plist_id, tconv, bkg); /* Get the plist structure */ @@ -797,7 +813,7 @@ H5Pset_preserve(hid_t plist_id, hbool_t status) H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pset_preserve, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "ib", plist_id, status); /* Get the plist structure */ @@ -837,7 +853,7 @@ H5Pget_preserve(hid_t plist_id) H5P_genplist_t *plist; /* Property list pointer */ int ret_value; /* return value */ - FUNC_ENTER_API(H5Pget_preserve, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("Is", "i", plist_id); /* Get the plist structure */ @@ -879,7 +895,7 @@ H5Pset_edc_check(hid_t plist_id, H5Z_EDC_t check) H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pset_edc_check, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "iZe", plist_id, check); /* Check argument */ @@ -922,7 +938,7 @@ H5Pget_edc_check(hid_t plist_id) H5P_genplist_t *plist; /* Property list pointer */ H5Z_EDC_t ret_value; /* return value */ - FUNC_ENTER_API(H5Pget_edc_check, H5Z_ERROR_EDC) + FUNC_ENTER_API(H5Z_ERROR_EDC) H5TRACE1("Ze", "i", plist_id); /* Get the plist structure */ @@ -965,7 +981,7 @@ H5Pset_filter_callback(hid_t plist_id, H5Z_filter_func_t func, void *op_data) herr_t ret_value=SUCCEED; /* return value */ H5Z_cb_t cb_struct; - FUNC_ENTER_API(H5Pset_filter_callback, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("e", "ix*x", plist_id, func, op_data); /* Get the plist structure */ @@ -1007,7 +1023,7 @@ H5Pset_type_conv_cb(hid_t plist_id, H5T_conv_except_func_t op, void *operate_dat herr_t ret_value=SUCCEED; /* return value */ H5T_conv_cb_t cb_struct; - FUNC_ENTER_API(H5Pset_type_conv_cb, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("e", "ix*x", plist_id, op, operate_data); /* Get the plist structure */ @@ -1049,7 +1065,7 @@ H5Pget_type_conv_cb(hid_t plist_id, H5T_conv_except_func_t *op, void **operate_d H5T_conv_cb_t cb_struct; herr_t ret_value=SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pget_type_conv_cb, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("e", "i*x**x", plist_id, op, operate_data); /* Get the plist structure */ @@ -1094,7 +1110,7 @@ H5Pget_btree_ratios(hid_t plist_id, double *left/*out*/, double *middle/*out*/, H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pget_btree_ratios, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE4("e", "ixxx", plist_id, left, middle, right); /* Get the plist structure */ @@ -1148,7 +1164,7 @@ H5Pset_btree_ratios(hid_t plist_id, double left, double middle, H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pset_btree_ratios, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE4("e", "iddd", plist_id, left, middle, right); /* Check arguments */ @@ -1201,7 +1217,7 @@ H5P_set_vlen_mem_manager(H5P_genplist_t *plist, H5MM_allocate_t alloc_func, { herr_t ret_value=SUCCEED; /* return value */ - FUNC_ENTER_NOAPI(H5P_set_vlen_mem_manager, FAIL) + FUNC_ENTER_NOAPI(FAIL) assert(plist); @@ -1248,7 +1264,7 @@ H5Pset_vlen_mem_manager(hid_t plist_id, H5MM_allocate_t alloc_func, H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pset_vlen_mem_manager, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE5("e", "ix*xx*x", plist_id, alloc_func, alloc_info, free_func, free_info); @@ -1288,7 +1304,7 @@ H5Pget_vlen_mem_manager(hid_t plist_id, H5MM_allocate_t *alloc_func/*out*/, H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pget_vlen_mem_manager, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE5("e", "ixxxx", plist_id, alloc_func, alloc_info, free_func, free_info); /* Get the plist structure */ @@ -1342,7 +1358,7 @@ H5Pset_hyper_vector_size(hid_t plist_id, size_t vector_size) H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pset_hyper_vector_size, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "iz", plist_id, vector_size); /* Check arguments */ @@ -1382,7 +1398,7 @@ H5Pget_hyper_vector_size(hid_t plist_id, size_t *vector_size/*out*/) H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pget_hyper_vector_size, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "ix", plist_id, vector_size); /* Get the plist structure */ @@ -1398,3 +1414,74 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_hyper_vector_size() */ + +#ifdef H5_HAVE_PARALLEL +/*------------------------------------------------------------------------- + * Function: H5Pget_mpio_actual_chunk_opt_mode + * + * Purpose: Retrieves the chunked io optimization scheme that library chose + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Jacob Gruber + * Wednesday, May 4, 2011 + *------------------------------------------------------------------------- + */ +herr_t +H5Pget_mpio_actual_chunk_opt_mode(hid_t plist_id, H5D_mpio_actual_chunk_opt_mode_t *actual_chunk_opt_mode) +{ + H5P_genplist_t *plist; + herr_t ret_value = SUCCEED; /* return value */ + + FUNC_ENTER_API(FAIL) + H5TRACE2("e", "i*Do", plist_id, actual_chunk_opt_mode); + + /* Get the plist structure */ + if(NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER))) + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") + + /* Return values */ + if(actual_chunk_opt_mode) + if(H5P_get(plist, H5D_MPIO_ACTUAL_CHUNK_OPT_MODE_NAME, actual_chunk_opt_mode) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get value") + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5Pget_mpio_actual_chunk_opt_mode() */ + + +/*------------------------------------------------------------------------- + * Function: H5Pget_mpio_actual_io_mode + * + * Purpose: Retrieves the type of I/O actually preformed when collective I/O + * is requested. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Jacob Gruber + * Wednesday, May 4, 2011 + *------------------------------------------------------------------------- + */ +herr_t +H5Pget_mpio_actual_io_mode(hid_t plist_id, H5D_mpio_actual_io_mode_t *actual_io_mode) +{ + H5P_genplist_t *plist; + herr_t ret_value = SUCCEED; /* return value */ + + FUNC_ENTER_API(FAIL) + H5TRACE2("e", "i*Di", plist_id, actual_io_mode); + + /* Get the plist structure */ + if(NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER))) + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") + + /* Return values */ + if(actual_io_mode) + if(H5P_get(plist, H5D_MPIO_ACTUAL_IO_MODE_NAME, actual_io_mode) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get value") + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5Pget_mpio_actual_io_mode() */ +#endif /* H5_HAVE_PARALLEL */ + diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index 7dea0b2..c3371c9 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -217,7 +217,7 @@ H5P_facc_reg_prop(H5P_genclass_t *pclass) unsigned efc_size = H5F_ACS_EFC_SIZE_DEF; /* Default external file cache size */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5P_facc_reg_prop) + FUNC_ENTER_NOAPI_NOINIT /* Register the initial metadata cache resize configuration */ if(H5P_register_real(pclass, H5F_ACS_META_CACHE_INIT_CONFIG_NAME, H5F_ACS_META_CACHE_INIT_CONFIG_SIZE, &mdc_initCacheCfg, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) @@ -329,7 +329,7 @@ H5P_facc_create(hid_t fapl_id, void UNUSED *copy_data) H5P_genplist_t *plist; /* Property list */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT(H5P_facc_create) + FUNC_ENTER_NOAPI_NOINIT /* Check argument */ if(NULL == (plist = (H5P_genplist_t *)H5I_object(fapl_id))) @@ -379,7 +379,7 @@ H5P_facc_copy(hid_t dst_fapl_id, hid_t src_fapl_id, void UNUSED *copy_data) H5P_genplist_t *src_plist; /* Source property list */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT(H5P_facc_copy) + FUNC_ENTER_NOAPI_NOINIT /* Get driver ID from source property list */ if(NULL == (src_plist = (H5P_genplist_t *)H5I_object(src_fapl_id))) @@ -430,7 +430,7 @@ H5P_facc_close(hid_t fapl_id, void UNUSED *close_data) H5P_genplist_t *plist; /* Property list */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI(H5P_facc_close, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check argument */ if(NULL == (plist = (H5P_genplist_t *)H5I_object(fapl_id))) @@ -491,9 +491,9 @@ herr_t H5Pset_alignment(hid_t fapl_id, hsize_t threshold, hsize_t alignment) { H5P_genplist_t *plist; /* Property list pointer */ - herr_t ret_value=SUCCEED; /* return value */ + herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pset_alignment, FAIL); + FUNC_ENTER_API(FAIL) H5TRACE3("e", "ihh", fapl_id, threshold, alignment); /* Check args */ @@ -511,7 +511,7 @@ H5Pset_alignment(hid_t fapl_id, hsize_t threshold, hsize_t alignment) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set alignment"); done: - FUNC_LEAVE_API(ret_value); + FUNC_LEAVE_API(ret_value) } @@ -541,9 +541,9 @@ H5Pget_alignment(hid_t fapl_id, hsize_t *threshold/*out*/, hsize_t *alignment/*out*/) { H5P_genplist_t *plist; /* Property list pointer */ - herr_t ret_value=SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Pget_alignment, FAIL); + FUNC_ENTER_API(FAIL) H5TRACE3("e", "ixx", fapl_id, threshold, alignment); /* Get the plist structure */ @@ -559,7 +559,7 @@ H5Pget_alignment(hid_t fapl_id, hsize_t *threshold/*out*/, HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get alignment"); done: - FUNC_LEAVE_API(ret_value); + FUNC_LEAVE_API(ret_value) } @@ -595,9 +595,9 @@ H5P_set_driver(H5P_genplist_t *plist, hid_t new_driver_id, const void *new_drive { hid_t driver_id; /* VFL driver ID */ void *driver_info; /* VFL driver info */ - herr_t ret_value=SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5P_set_driver, FAIL) + FUNC_ENTER_NOAPI(FAIL) if(NULL == H5I_object_verify(new_driver_id, H5I_VFL)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file driver ID") @@ -672,7 +672,7 @@ H5Pset_driver(hid_t plist_id, hid_t new_driver_id, const void *new_driver_info) H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Pset_driver, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("e", "ii*x", plist_id, new_driver_id, new_driver_info); /* Check arguments */ @@ -728,7 +728,7 @@ H5P_get_driver(H5P_genplist_t *plist) { hid_t ret_value=FAIL; /* Return value */ - FUNC_ENTER_NOAPI(H5P_get_driver, FAIL); + FUNC_ENTER_NOAPI(FAIL) /* Get the current driver ID */ if(TRUE == H5P_isa_class(plist->plist_id, H5P_FILE_ACCESS) ) { @@ -745,7 +745,7 @@ H5P_get_driver(H5P_genplist_t *plist) ret_value = H5_DEFAULT_VFD; done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } @@ -783,7 +783,7 @@ H5Pget_driver(hid_t plist_id) H5P_genplist_t *plist; /* Property list pointer */ hid_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Pget_driver, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("i", "i", plist_id); if(NULL == (plist = (H5P_genplist_t *)H5I_object_verify(plist_id, H5I_GENPROP_LST))) @@ -827,7 +827,7 @@ H5P_get_driver_info(H5P_genplist_t *plist) { void *ret_value=NULL; - FUNC_ENTER_NOAPI(H5P_get_driver_info, NULL); + FUNC_ENTER_NOAPI(NULL) /* Get the current driver info */ if( TRUE == H5P_isa_class(plist->plist_id, H5P_FILE_ACCESS) ) { @@ -841,7 +841,7 @@ H5P_get_driver_info(H5P_genplist_t *plist) } done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* end H5P_get_driver_info() */ @@ -877,7 +877,7 @@ H5Pget_driver_info(hid_t plist_id) H5P_genplist_t *plist; /* Property list pointer */ void *ret_value; /* Return value */ - FUNC_ENTER_API(H5Pget_driver_info, NULL); + FUNC_ENTER_API(NULL) if(NULL == (plist = (H5P_genplist_t *)H5I_object_verify(plist_id, H5I_GENPROP_LST))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a property list") @@ -912,9 +912,9 @@ herr_t H5Pset_family_offset(hid_t fapl_id, hsize_t offset) { H5P_genplist_t *plist; /* Property list pointer */ - herr_t ret_value=SUCCEED; /* return value */ + herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pset_family_offset, FAIL); + FUNC_ENTER_API(FAIL) H5TRACE2("e", "ih", fapl_id, offset); /* Get the plist structure */ @@ -927,7 +927,7 @@ H5Pset_family_offset(hid_t fapl_id, hsize_t offset) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set family offset"); done: - FUNC_LEAVE_API(ret_value); + FUNC_LEAVE_API(ret_value) } @@ -951,9 +951,9 @@ done: static herr_t H5P_set_family_offset(H5P_genplist_t *plist, hsize_t offset) { - herr_t ret_value=SUCCEED; + herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI(H5P_set_family_offset, FAIL); + FUNC_ENTER_NOAPI(FAIL) if( TRUE == H5P_isa_class(plist->plist_id, H5P_FILE_ACCESS) ) { if(H5P_set(plist, H5F_ACS_FAMILY_OFFSET_NAME, &offset) < 0) @@ -963,7 +963,7 @@ H5P_set_family_offset(H5P_genplist_t *plist, hsize_t offset) } done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } @@ -989,9 +989,9 @@ herr_t H5Pget_family_offset(hid_t fapl_id, hsize_t *offset) { H5P_genplist_t *plist; /* Property list pointer */ - herr_t ret_value=SUCCEED; /* return value */ + herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pget_family_offset, FAIL); + FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*h", fapl_id, offset); /* Get the plist structure */ @@ -1004,7 +1004,7 @@ H5Pget_family_offset(hid_t fapl_id, hsize_t *offset) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't get family offset"); done: - FUNC_LEAVE_API(ret_value); + FUNC_LEAVE_API(ret_value) } @@ -1028,9 +1028,9 @@ done: static herr_t H5P_get_family_offset(H5P_genplist_t *plist, hsize_t *offset) { - herr_t ret_value=SUCCEED; + herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI(H5P_get_family_offset, FAIL); + FUNC_ENTER_NOAPI(FAIL) if( TRUE == H5P_isa_class(plist->plist_id, H5P_FILE_ACCESS) ) { if(H5P_get(plist, H5F_ACS_FAMILY_OFFSET_NAME, offset) < 0) @@ -1040,7 +1040,7 @@ H5P_get_family_offset(H5P_genplist_t *plist, hsize_t *offset) } done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } @@ -1066,9 +1066,9 @@ herr_t H5Pset_multi_type(hid_t fapl_id, H5FD_mem_t type) { H5P_genplist_t *plist; /* Property list pointer */ - herr_t ret_value=SUCCEED; /* return value */ + herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pset_multi_type, FAIL); + FUNC_ENTER_API(FAIL) H5TRACE2("e", "iMt", fapl_id, type); /* Get the plist structure */ @@ -1081,7 +1081,7 @@ H5Pset_multi_type(hid_t fapl_id, H5FD_mem_t type) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set data type for multi driver"); done: - FUNC_LEAVE_API(ret_value); + FUNC_LEAVE_API(ret_value) } @@ -1105,9 +1105,9 @@ done: static herr_t H5P_set_multi_type(H5P_genplist_t *plist, H5FD_mem_t type) { - herr_t ret_value=SUCCEED; + herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI(H5P_set_multi_type, FAIL); + FUNC_ENTER_NOAPI(FAIL) if( TRUE == H5P_isa_class(plist->plist_id, H5P_FILE_ACCESS) ) { if(H5P_set(plist, H5F_ACS_MULTI_TYPE_NAME, &type) < 0) @@ -1117,7 +1117,7 @@ H5P_set_multi_type(H5P_genplist_t *plist, H5FD_mem_t type) } done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } @@ -1143,9 +1143,9 @@ herr_t H5Pget_multi_type(hid_t fapl_id, H5FD_mem_t *type) { H5P_genplist_t *plist; /* Property list pointer */ - herr_t ret_value=SUCCEED; /* return value */ + herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pget_multi_type, FAIL); + FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*Mt", fapl_id, type); /* Get the plist structure */ @@ -1158,7 +1158,7 @@ H5Pget_multi_type(hid_t fapl_id, H5FD_mem_t *type) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't get data type for multi driver"); done: - FUNC_LEAVE_API(ret_value); + FUNC_LEAVE_API(ret_value) } @@ -1182,9 +1182,9 @@ done: static herr_t H5P_get_multi_type(H5P_genplist_t *plist, H5FD_mem_t *type) { - herr_t ret_value=SUCCEED; + herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI(H5P_get_multi_type, FAIL); + FUNC_ENTER_NOAPI(FAIL) if( TRUE == H5P_isa_class(plist->plist_id, H5P_FILE_ACCESS) ) { if(H5P_get(plist, H5F_ACS_MULTI_TYPE_NAME, type) < 0) @@ -1194,7 +1194,7 @@ H5P_get_multi_type(H5P_genplist_t *plist, H5FD_mem_t *type) } done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } @@ -1236,9 +1236,9 @@ H5Pset_cache(hid_t plist_id, int UNUSED mdc_nelmts, size_t rdcc_nslots, size_t rdcc_nbytes, double rdcc_w0) { H5P_genplist_t *plist; /* Property list pointer */ - herr_t ret_value=SUCCEED; /* return value */ + herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pset_cache, FAIL); + FUNC_ENTER_API(FAIL) H5TRACE5("e", "iIszzd", plist_id, mdc_nelmts, rdcc_nslots, rdcc_nbytes, rdcc_w0); @@ -1259,7 +1259,7 @@ H5Pset_cache(hid_t plist_id, int UNUSED mdc_nelmts, HGOTO_ERROR(H5E_PLIST, H5E_CANTSET,FAIL, "can't set preempt read chunks"); done: - FUNC_LEAVE_API(ret_value); + FUNC_LEAVE_API(ret_value) } @@ -1296,9 +1296,9 @@ H5Pget_cache(hid_t plist_id, int *mdc_nelmts, size_t *rdcc_nslots, size_t *rdcc_nbytes, double *rdcc_w0) { H5P_genplist_t *plist; /* Property list pointer */ - herr_t ret_value=SUCCEED; /* return value */ + herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pget_cache, FAIL); + FUNC_ENTER_API(FAIL) H5TRACE5("e", "i*Is*z*z*d", plist_id, mdc_nelmts, rdcc_nslots, rdcc_nbytes, rdcc_w0); @@ -1323,7 +1323,7 @@ H5Pget_cache(hid_t plist_id, int *mdc_nelmts, HGOTO_ERROR(H5E_PLIST, H5E_CANTGET,FAIL, "can't get preempt read chunks"); done: - FUNC_LEAVE_API(ret_value); + FUNC_LEAVE_API(ret_value) } @@ -1346,7 +1346,7 @@ H5Pset_mdc_config(hid_t plist_id, H5AC_cache_config_t *config_ptr) H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pset_mdc_config, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*x", plist_id, config_ptr); /* Get the plist structure */ @@ -1367,7 +1367,7 @@ H5Pset_mdc_config(hid_t plist_id, H5AC_cache_config_t *config_ptr) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set metadata cache initial config") done: - FUNC_LEAVE_API(ret_value); + FUNC_LEAVE_API(ret_value) } /* H5Pset_mdc_config() */ @@ -1394,7 +1394,7 @@ H5Pget_mdc_config(hid_t plist_id, H5AC_cache_config_t *config_ptr) H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pget_mdc_config, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*x", plist_id, config_ptr); /* Get the plist structure */ @@ -1457,9 +1457,9 @@ herr_t H5Pset_gc_references(hid_t plist_id, unsigned gc_ref) { H5P_genplist_t *plist; /* Property list pointer */ - herr_t ret_value=SUCCEED; /* return value */ + herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pset_gc_references, FAIL); + FUNC_ENTER_API(FAIL) H5TRACE2("e", "iIu", plist_id, gc_ref); /* Get the plist structure */ @@ -1471,7 +1471,7 @@ H5Pset_gc_references(hid_t plist_id, unsigned gc_ref) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set garbage collect reference"); done: - FUNC_LEAVE_API(ret_value); + FUNC_LEAVE_API(ret_value) } @@ -1499,9 +1499,9 @@ herr_t H5Pget_gc_references(hid_t plist_id, unsigned *gc_ref/*out*/) { H5P_genplist_t *plist; /* Property list pointer */ - herr_t ret_value=SUCCEED; /* return value */ + herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pget_gc_references, FAIL); + FUNC_ENTER_API(FAIL) H5TRACE2("e", "ix", plist_id, gc_ref); /* Get the plist structure */ @@ -1514,7 +1514,7 @@ H5Pget_gc_references(hid_t plist_id, unsigned *gc_ref/*out*/) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get garbage collect reference"); done: - FUNC_LEAVE_API(ret_value); + FUNC_LEAVE_API(ret_value) } @@ -1538,7 +1538,7 @@ H5Pset_fclose_degree(hid_t plist_id, H5F_close_degree_t degree) H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pset_fclose_degree, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "iFd", plist_id, degree); /* Get the plist structure */ @@ -1574,7 +1574,7 @@ H5Pget_fclose_degree(hid_t plist_id, H5F_close_degree_t *degree) H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pget_fclose_degree, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*Fd", plist_id, degree); /* Get the plist structure */ @@ -1622,9 +1622,9 @@ herr_t H5Pset_meta_block_size(hid_t plist_id, hsize_t size) { H5P_genplist_t *plist; /* Property list pointer */ - herr_t ret_value=SUCCEED; /* return value */ + herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pset_meta_block_size, FAIL); + FUNC_ENTER_API(FAIL) H5TRACE2("e", "ih", plist_id, size); /* Get the plist structure */ @@ -1636,7 +1636,7 @@ H5Pset_meta_block_size(hid_t plist_id, hsize_t size) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set meta data block size"); done: - FUNC_LEAVE_API(ret_value); + FUNC_LEAVE_API(ret_value) } @@ -1664,9 +1664,9 @@ herr_t H5Pget_meta_block_size(hid_t plist_id, hsize_t *size/*out*/) { H5P_genplist_t *plist; /* Property list pointer */ - herr_t ret_value=SUCCEED; /* return value */ + herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pget_meta_block_size, FAIL); + FUNC_ENTER_API(FAIL) H5TRACE2("e", "ix", plist_id, size); /* Get the plist structure */ @@ -1680,7 +1680,7 @@ H5Pget_meta_block_size(hid_t plist_id, hsize_t *size/*out*/) } /* end if */ done: - FUNC_LEAVE_API(ret_value); + FUNC_LEAVE_API(ret_value) } @@ -1717,9 +1717,9 @@ herr_t H5Pset_sieve_buf_size(hid_t plist_id, size_t size) { H5P_genplist_t *plist; /* Property list pointer */ - herr_t ret_value=SUCCEED; /* return value */ + herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pset_sieve_buf_size, FAIL); + FUNC_ENTER_API(FAIL) H5TRACE2("e", "iz", plist_id, size); /* Get the plist structure */ @@ -1731,7 +1731,7 @@ H5Pset_sieve_buf_size(hid_t plist_id, size_t size) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set sieve buffer size"); done: - FUNC_LEAVE_API(ret_value); + FUNC_LEAVE_API(ret_value) } /* end H5Pset_sieve_buf_size() */ @@ -1759,9 +1759,9 @@ herr_t H5Pget_sieve_buf_size(hid_t plist_id, size_t *size/*out*/) { H5P_genplist_t *plist; /* Property list pointer */ - herr_t ret_value=SUCCEED; /* return value */ + herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pget_sieve_buf_size, FAIL); + FUNC_ENTER_API(FAIL) H5TRACE2("e", "ix", plist_id, size); /* Get the plist structure */ @@ -1774,7 +1774,7 @@ H5Pget_sieve_buf_size(hid_t plist_id, size_t *size/*out*/) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get sieve buffer size"); done: - FUNC_LEAVE_API(ret_value); + FUNC_LEAVE_API(ret_value) } /* end H5Pget_sieve_buf_size() */ @@ -1806,9 +1806,9 @@ herr_t H5Pset_small_data_block_size(hid_t plist_id, hsize_t size) { H5P_genplist_t *plist; /* Property list pointer */ - herr_t ret_value=SUCCEED; /* return value */ + herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pset_small_data_block_size, FAIL); + FUNC_ENTER_API(FAIL) H5TRACE2("e", "ih", plist_id, size); /* Get the plist structure */ @@ -1820,7 +1820,7 @@ H5Pset_small_data_block_size(hid_t plist_id, hsize_t size) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set 'small data' block size"); done: - FUNC_LEAVE_API(ret_value); + FUNC_LEAVE_API(ret_value) } /* end H5Pset_small_data_block_size() */ @@ -1843,9 +1843,9 @@ herr_t H5Pget_small_data_block_size(hid_t plist_id, hsize_t *size/*out*/) { H5P_genplist_t *plist; /* Property list pointer */ - herr_t ret_value=SUCCEED; /* return value */ + herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pget_small_data_block_size, FAIL); + FUNC_ENTER_API(FAIL) H5TRACE2("e", "ix", plist_id, size); /* Get the plist structure */ @@ -1859,7 +1859,7 @@ H5Pget_small_data_block_size(hid_t plist_id, hsize_t *size/*out*/) } /* end if */ done: - FUNC_LEAVE_API(ret_value); + FUNC_LEAVE_API(ret_value) } /* end H5Pget_small_data_block_size() */ @@ -1957,7 +1957,7 @@ H5Pset_libver_bounds(hid_t plist_id, H5F_libver_t low, hbool_t latest; /* Whether to use the latest version or not */ herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pset_libver_bounds, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("e", "iFvFv", plist_id, low, high); /* Check args */ @@ -2002,7 +2002,7 @@ H5Pget_libver_bounds(hid_t plist_id, H5F_libver_t *low/*out*/, hbool_t latest; /* Whether to use the latest version or not */ herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pget_libver_bounds, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("e", "ixx", plist_id, low, high); /* Get the plist structure */ @@ -2047,7 +2047,7 @@ H5Pset_elink_file_cache_size(hid_t plist_id, unsigned efc_size) H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pset_elink_file_cache_size, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "iIu", plist_id, efc_size); /* Get the plist structure */ @@ -2085,7 +2085,7 @@ H5Pget_elink_file_cache_size(hid_t plist_id, unsigned *efc_size) H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pget_elink_file_cache_size, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*Iu", plist_id, efc_size); /* Get the plist structure */ diff --git a/src/H5Pfcpl.c b/src/H5Pfcpl.c index a0f2f89..2e8cf1e 100644 --- a/src/H5Pfcpl.c +++ b/src/H5Pfcpl.c @@ -159,7 +159,7 @@ H5P_fcrt_reg_prop(H5P_genclass_t *pclass) hsize_t free_space_threshold = H5F_CRT_FREE_SPACE_THRESHOLD_DEF; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5P_fcrt_reg_prop) + FUNC_ENTER_NOAPI_NOINIT /* Register the user block size */ if(H5P_register_real(pclass, H5F_CRT_USER_BLOCK_NAME, H5F_CRT_USER_BLOCK_SIZE, &userblock_size, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) @@ -230,7 +230,7 @@ H5Pset_userblock(hid_t plist_id, hsize_t size) H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pset_userblock, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "ih", plist_id, size); /* Sanity check non-zero userblock sizes */ @@ -281,9 +281,9 @@ herr_t H5Pget_userblock(hid_t plist_id, hsize_t *size) { H5P_genplist_t *plist; /* Property list pointer */ - herr_t ret_value=SUCCEED; /* return value */ + herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pget_userblock, FAIL); + FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*h", plist_id, size); /* Get the plist structure */ @@ -296,7 +296,7 @@ H5Pget_userblock(hid_t plist_id, hsize_t *size) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL,"can't get user block"); done: - FUNC_LEAVE_API(ret_value); + FUNC_LEAVE_API(ret_value) } @@ -320,7 +320,7 @@ H5Pset_sizes(hid_t plist_id, size_t sizeof_addr, size_t sizeof_size) H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pset_sizes, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("e", "izz", plist_id, sizeof_addr, sizeof_size); /* Check arguments */ @@ -377,7 +377,7 @@ H5Pget_sizes(hid_t plist_id, size_t *sizeof_addr, size_t *sizeof_size) H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pget_sizes, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("e", "i*z*z", plist_id, sizeof_addr, sizeof_size); /* Get the plist structure */ @@ -440,9 +440,9 @@ H5Pset_sym_k(hid_t plist_id, unsigned ik, unsigned lk) { unsigned btree_k[H5B_NUM_BTREE_ID]; H5P_genplist_t *plist; /* Property list pointer */ - herr_t ret_value=SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Pset_sym_k, FAIL); + FUNC_ENTER_API(FAIL) H5TRACE3("e", "iIuIu", plist_id, ik, lk); /* Get the plist structure */ @@ -462,7 +462,7 @@ H5Pset_sym_k(hid_t plist_id, unsigned ik, unsigned lk) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set rank for symbol table leaf nodes"); done: - FUNC_LEAVE_API(ret_value); + FUNC_LEAVE_API(ret_value) } @@ -491,9 +491,9 @@ H5Pget_sym_k(hid_t plist_id, unsigned *ik /*out */ , unsigned *lk /*out */ ) { unsigned btree_k[H5B_NUM_BTREE_ID]; H5P_genplist_t *plist; /* Property list pointer */ - herr_t ret_value=SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Pget_sym_k, FAIL); + FUNC_ENTER_API(FAIL) H5TRACE3("e", "ixx", plist_id, ik, lk); /* Get the plist structure */ @@ -511,7 +511,7 @@ H5Pget_sym_k(hid_t plist_id, unsigned *ik /*out */ , unsigned *lk /*out */ ) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get rank for symbol table leaf nodes"); done: - FUNC_LEAVE_API(ret_value); + FUNC_LEAVE_API(ret_value) } @@ -539,9 +539,9 @@ H5Pset_istore_k(hid_t plist_id, unsigned ik) { unsigned btree_k[H5B_NUM_BTREE_ID]; H5P_genplist_t *plist; /* Property list pointer */ - herr_t ret_value=SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Pset_istore_k, FAIL); + FUNC_ENTER_API(FAIL) H5TRACE2("e", "iIu", plist_id, ik); /* Check arguments */ @@ -560,7 +560,7 @@ H5Pset_istore_k(hid_t plist_id, unsigned ik) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set rank for btree interanl nodes"); done: - FUNC_LEAVE_API(ret_value); + FUNC_LEAVE_API(ret_value) } @@ -592,7 +592,7 @@ H5Pget_istore_k(hid_t plist_id, unsigned *ik /*out */ ) H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Pget_istore_k, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "ix", plist_id, ik); /* Get the plist structure */ @@ -636,7 +636,7 @@ H5Pset_shared_mesg_nindexes(hid_t plist_id, unsigned nindexes) H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Pset_shared_mesg_nindexes, FAIL); + FUNC_ENTER_API(FAIL) H5TRACE2("e", "iIu", plist_id, nindexes); /* Check argument */ @@ -651,7 +651,7 @@ H5Pset_shared_mesg_nindexes(hid_t plist_id, unsigned nindexes) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't set number of indexes"); done: - FUNC_LEAVE_API(ret_value); + FUNC_LEAVE_API(ret_value) } /* end H5Pset_shared_mesg_nindexes() */ @@ -674,7 +674,7 @@ H5Pget_shared_mesg_nindexes(hid_t plist_id, unsigned *nindexes) H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Pget_shared_mesg_nindexes, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*Iu", plist_id, nindexes); /* Get the plist structure */ @@ -715,7 +715,7 @@ H5Pset_shared_mesg_index(hid_t plist_id, unsigned index_num, unsigned mesg_type_ unsigned minsizes[H5O_SHMESG_MAX_NINDEXES]; /* Array of min_mesg_sizes*/ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Pset_shared_mesg_index, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE4("e", "iIuIuIu", plist_id, index_num, mesg_type_flags, min_mesg_size); /* Check arguments */ @@ -776,9 +776,9 @@ H5Pget_shared_mesg_index(hid_t plist_id, unsigned index_num, unsigned *mesg_type unsigned nindexes; /* Number of SOHM indexes */ unsigned type_flags[H5O_SHMESG_MAX_NINDEXES]; /* Array of mesg_type_flags*/ unsigned minsizes[H5O_SHMESG_MAX_NINDEXES]; /* Array of min_mesg_sizes*/ - herr_t ret_value=SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Pget_shared_mesg_index, FAIL); + FUNC_ENTER_API(FAIL) H5TRACE4("e", "iIu*Iu*Iu", plist_id, index_num, mesg_type_flags, min_mesg_size); @@ -806,7 +806,7 @@ H5Pget_shared_mesg_index(hid_t plist_id, unsigned index_num, unsigned *mesg_type *min_mesg_size = minsizes[index_num]; done: - FUNC_LEAVE_API(ret_value); + FUNC_LEAVE_API(ret_value) } /* end H5Pset_shared_mesg_index() */ @@ -833,9 +833,9 @@ herr_t H5Pset_shared_mesg_phase_change(hid_t plist_id, unsigned max_list, unsigned min_btree) { H5P_genplist_t *plist; /* Property list pointer */ - herr_t ret_value=SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Pset_shared_mesg_phase_change, FAIL); + FUNC_ENTER_API(FAIL) H5TRACE3("e", "iIuIu", plist_id, max_list, min_btree); /* Check that values are sensible. The min_btree value must be no greater @@ -866,7 +866,7 @@ H5Pset_shared_mesg_phase_change(hid_t plist_id, unsigned max_list, unsigned min_ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't set B-tree minimum in property list"); done: - FUNC_LEAVE_API(ret_value); + FUNC_LEAVE_API(ret_value) } /* end H5Pset_shared_mesg_phase_change() */ @@ -887,9 +887,9 @@ herr_t H5Pget_shared_mesg_phase_change(hid_t plist_id, unsigned *max_list, unsigned *min_btree) { H5P_genplist_t *plist; /* Property list pointer */ - herr_t ret_value=SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Pget_shared_mesg_phase_change, FAIL); + FUNC_ENTER_API(FAIL) H5TRACE3("e", "i*Iu*Iu", plist_id, max_list, min_btree); /* Get the plist structure */ @@ -907,7 +907,7 @@ H5Pget_shared_mesg_phase_change(hid_t plist_id, unsigned *max_list, unsigned *mi } done: - FUNC_LEAVE_API(ret_value); + FUNC_LEAVE_API(ret_value) } /* end H5Pget_shared_mesg_phase_change() */ @@ -934,7 +934,7 @@ H5Pset_file_space(hid_t plist_id, H5F_file_space_type_t strategy, hsize_t thresh H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Pset_file_space, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("e", "iFfh", plist_id, strategy, threshold); if((unsigned)strategy >= H5F_FILE_SPACE_NTYPES) @@ -976,7 +976,7 @@ H5Pget_file_space(hid_t plist_id, H5F_file_space_type_t *strategy, hsize_t *thre H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Pget_file_space, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("e", "i*Ff*h", plist_id, strategy, threshold); /* Get the plist structure */ diff --git a/src/H5Pfmpl.c b/src/H5Pfmpl.c index 43c6055..7828fb2 100644 --- a/src/H5Pfmpl.c +++ b/src/H5Pfmpl.c @@ -110,7 +110,7 @@ H5P_fmnt_reg_prop(H5P_genclass_t *pclass) hbool_t local = H5F_MNT_SYM_LOCAL_DEF; /* Whether symlinks are local to file */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5P_fmnt_reg_prop) + FUNC_ENTER_NOAPI_NOINIT /* Register property of whether symlinks is local to file */ if(H5P_register_real(pclass, H5F_MNT_SYM_LOCAL_NAME, H5F_MNT_SYM_LOCAL_SIZE, &local, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) diff --git a/src/H5Pgcpl.c b/src/H5Pgcpl.c index 72784eb..983929d 100644 --- a/src/H5Pgcpl.c +++ b/src/H5Pgcpl.c @@ -110,7 +110,7 @@ H5P_gcrt_reg_prop(H5P_genclass_t *pclass) H5O_linfo_t linfo = H5G_CRT_LINK_INFO_DEF; /* Default link info settings */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5P_gcrt_reg_prop) + FUNC_ENTER_NOAPI_NOINIT /* Register group info property */ if(H5P_register_real(pclass, H5G_CRT_GROUP_INFO_NAME, H5G_CRT_GROUP_INFO_SIZE, &ginfo, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) @@ -143,7 +143,7 @@ H5Pset_local_heap_size_hint(hid_t plist_id, size_t size_hint) H5O_ginfo_t ginfo; /* Group information structure */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Pset_local_heap_size_hint, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "iz", plist_id, size_hint); /* Get the plist structure */ @@ -183,7 +183,7 @@ H5Pget_local_heap_size_hint(hid_t plist_id, size_t *size_hint /*out*/) { herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pget_local_heap_size_hint, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "ix", plist_id, size_hint); if(size_hint) { @@ -231,7 +231,7 @@ H5Pset_link_phase_change(hid_t plist_id, unsigned max_compact, unsigned min_dens H5O_ginfo_t ginfo; /* Group information structure */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Pset_link_phase_change, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("e", "iIuIu", plist_id, max_compact, min_dense); /* Range check values */ @@ -284,7 +284,7 @@ H5Pget_link_phase_change(hid_t plist_id, unsigned *max_compact /*out*/, unsigned { herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pget_link_phase_change, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("e", "ixx", plist_id, max_compact, min_dense); /* Get values */ @@ -337,7 +337,7 @@ H5Pset_est_link_info(hid_t plist_id, unsigned est_num_entries, unsigned est_name H5O_ginfo_t ginfo; /* Group information structure */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Pset_est_link_info, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("e", "iIuIu", plist_id, est_num_entries, est_name_len); /* Range check values */ @@ -388,7 +388,7 @@ H5Pget_est_link_info(hid_t plist_id, unsigned *est_num_entries /*out*/, unsigned { herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pget_est_link_info, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("e", "ixx", plist_id, est_num_entries, est_name_len); /* Get values */ @@ -433,7 +433,7 @@ H5Pset_link_creation_order(hid_t plist_id, unsigned crt_order_flags) H5O_linfo_t linfo; /* Link information structure */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Pset_link_creation_order, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "iIu", plist_id, crt_order_flags); /* Check for bad combination of flags */ @@ -478,7 +478,7 @@ H5Pget_link_creation_order(hid_t plist_id, unsigned *crt_order_flags /*out*/) { herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pget_link_creation_order, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "ix", plist_id, crt_order_flags); /* Get values */ diff --git a/src/H5Pint.c b/src/H5Pint.c index 4ae274e..08b8af6 100644 --- a/src/H5Pint.c +++ b/src/H5Pint.c @@ -265,7 +265,7 @@ H5P_do_prop_cb1(H5SL_t *slist, H5P_genprop_t *prop, H5P_prp_cb1_t cb) H5P_genprop_t *pcopy=NULL; /* Copy of property to insert into skip list */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5P_do_prop_cb1) + FUNC_ENTER_NOAPI_NOINIT /* Allocate space for a temporary copy of the property value */ if(NULL == (tmp_value = H5MM_malloc(prop->size))) @@ -326,7 +326,7 @@ H5P_init(void) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5P_init, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* FUNC_ENTER() does all the work */ done: @@ -351,7 +351,7 @@ H5P_init_interface(void) size_t pass_init; /* # of classes initialized in each pass */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5P_init_interface) + FUNC_ENTER_NOAPI_NOINIT /* * Initialize the Generic Property class & object groups. @@ -451,7 +451,7 @@ H5P_term_interface(void) int nclass=0; int n=0; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5P_term_interface) + FUNC_ENTER_NOAPI_NOINIT_NOERR if(H5_interface_initialize_g) { /* Destroy HDF5 library property classes & lists */ @@ -551,7 +551,7 @@ H5P_copy_pclass(H5P_genclass_t *pclass) H5P_genprop_t *pcopy; /* Copy of property to insert into class */ H5P_genclass_t *ret_value=NULL; /* return value */ - FUNC_ENTER_NOAPI_NOINIT(H5P_copy_pclass) + FUNC_ENTER_NOAPI_NOINIT HDassert(pclass); @@ -632,7 +632,7 @@ H5P_copy_plist(const H5P_genplist_t *old_plist, hbool_t app_ref) hbool_t has_parent_class; /* Flag to indicate that this property list's class has a parent */ hid_t ret_value=FAIL; /* return value */ - FUNC_ENTER_NOAPI(H5P_copy_plist, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert(old_plist); @@ -650,11 +650,11 @@ H5P_copy_plist(const H5P_genplist_t *old_plist, hbool_t app_ref) new_plist->class_init = FALSE; /* 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)) == NULL) + if((new_plist->props = H5SL_create(H5SL_TYPE_STR, NULL)) == 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)) == NULL) + if((new_plist->del = H5SL_create(H5SL_TYPE_STR, NULL)) == 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 @@ -662,7 +662,7 @@ H5P_copy_plist(const 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))== NULL) + if((seen = H5SL_create(H5SL_TYPE_STR, NULL))== NULL) HGOTO_ERROR(H5E_PLIST,H5E_CANTCREATE,FAIL,"can't create skip list for seen properties") nseen = 0; @@ -842,7 +842,7 @@ H5P_dup_prop(H5P_genprop_t *oprop, H5P_prop_within_t type) H5P_genprop_t *prop = NULL; /* Pointer to new property copied */ H5P_genprop_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5P_dup_prop) + FUNC_ENTER_NOAPI_NOINIT HDassert(oprop); HDassert(type != H5P_PROP_WITHIN_UNKNOWN); @@ -956,7 +956,7 @@ H5P_create_prop(const char *name, size_t size, H5P_prop_within_t type, H5P_genprop_t *prop=NULL; /* Pointer to new property copied */ H5P_genprop_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5P_create_prop) + FUNC_ENTER_NOAPI_NOINIT HDassert(name); HDassert((size>0 && value!=NULL) || (size==0)); @@ -1036,7 +1036,7 @@ H5P_add_prop(H5SL_t *slist, H5P_genprop_t *prop) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5P_add_prop, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert(slist); HDassert(prop); @@ -1074,7 +1074,7 @@ H5P_find_prop_plist(H5P_genplist_t *plist, const char *name) { H5P_genprop_t *ret_value; /* Property pointer return value */ - FUNC_ENTER_NOAPI_NOINIT(H5P_find_prop_plist) + FUNC_ENTER_NOAPI_NOINIT HDassert(plist); HDassert(name); @@ -1134,7 +1134,7 @@ H5P_find_prop_pclass(H5P_genclass_t *pclass, const char *name) { H5P_genprop_t *ret_value; /* Property pointer return value */ - FUNC_ENTER_NOAPI_NOINIT(H5P_find_prop_pclass) + FUNC_ENTER_NOAPI_NOINIT HDassert(pclass); HDassert(name); @@ -1169,7 +1169,7 @@ done: static herr_t H5P_free_prop(H5P_genprop_t *prop) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5P_free_prop) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(prop); @@ -1213,7 +1213,7 @@ H5P_free_prop_cb(void *item, void UNUSED *key, void *op_data) H5P_genprop_t *tprop=(H5P_genprop_t *)item; /* Temporary pointer to property */ hbool_t make_cb = *(hbool_t *)op_data; /* Whether to make property 'close' callback */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5P_free_prop_cb) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(tprop); @@ -1252,7 +1252,7 @@ H5P_free_del_name_cb(void *item, void UNUSED *key, void UNUSED *op_data) { char *del_name=(char *)item; /* Temporary pointer to deleted name */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5P_free_del_name_cb) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(del_name); @@ -1288,7 +1288,7 @@ H5P_free_del_name_cb(void *item, void UNUSED *key, void UNUSED *op_data) herr_t H5P_access_class(H5P_genclass_t *pclass, H5P_class_mod_t mod) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5P_access_class) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(pclass); HDassert(mod > H5P_MOD_ERR && mod < H5P_MOD_MAX); @@ -1384,7 +1384,7 @@ H5P_check_class(void *_obj, hid_t UNUSED id, void *_key) const H5P_check_class_t *key=(const H5P_check_class_t *)_key; /* Pointer to key information for comparison */ int ret_value=0; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5P_check_class) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(obj); HDassert(H5I_GENPROP_CLS==H5I_get_type(id)); @@ -1443,7 +1443,7 @@ H5P_create_class(H5P_genclass_t *par_class, const char *name, hbool_t internal, H5P_genclass_t *pclass=NULL; /* Property list class created */ H5P_genclass_t *ret_value; /* return value */ - FUNC_ENTER_NOAPI(H5P_create_class, NULL) + FUNC_ENTER_NOAPI(NULL) HDassert(name); /* Allow internal classes to break some rules */ @@ -1468,7 +1468,7 @@ H5P_create_class(H5P_genclass_t *par_class, const char *name, hbool_t internal, pclass->revision = H5P_GET_NEXT_REV; /* Get a revision number for the class */ /* Create the skip list for properties */ - if(NULL == (pclass->props = H5SL_create(H5SL_TYPE_STR))) + if(NULL == (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 */ @@ -1540,7 +1540,7 @@ H5P_create(H5P_genclass_t *pclass) H5SL_t *seen=NULL; /* Skip list to hold names of properties already seen */ H5P_genplist_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5P_create) + FUNC_ENTER_NOAPI_NOINIT HDassert(pclass); @@ -1558,11 +1558,11 @@ H5P_create(H5P_genclass_t *pclass) plist->class_init = FALSE; /* Initially, wait until the class callback finishes to set */ /* Create the skip list for changed properties */ - if((plist->props = H5SL_create(H5SL_TYPE_STR)) == NULL) + if((plist->props = H5SL_create(H5SL_TYPE_STR, NULL)) == 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)) == NULL) + if((plist->del = H5SL_create(H5SL_TYPE_STR, NULL)) == 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 @@ -1570,7 +1570,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)) == NULL) + if((seen = H5SL_create(H5SL_TYPE_STR, NULL)) == NULL) HGOTO_ERROR(H5E_PLIST,H5E_CANTCREATE,NULL,"can't create skip list for seen properties") /* @@ -1679,7 +1679,7 @@ H5P_create_id(H5P_genclass_t *pclass, hbool_t app_ref) hid_t plist_id = FAIL; /* Property list ID */ hid_t ret_value; /* return value */ - FUNC_ENTER_NOAPI(H5P_create_id, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert(pclass); @@ -1889,7 +1889,7 @@ H5P_register_real(H5P_genclass_t *pclass, const char *name, size_t size, H5P_genprop_t *new_prop = NULL; /* Temporary property pointer */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5P_register_real, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert(pclass); HDassert(0 == pclass->plists); @@ -2089,7 +2089,7 @@ H5P_register(H5P_genclass_t **ppclass, const char *name, size_t size, H5P_genclass_t *new_class = NULL; /* New class pointer */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5P_register, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ HDassert(ppclass); @@ -2299,7 +2299,7 @@ H5P_insert(H5P_genplist_t *plist, const char *name, size_t size, H5P_genprop_t *new_prop = NULL; /* Temporary property pointer */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5P_insert) + FUNC_ENTER_NOAPI_NOINIT HDassert(plist); HDassert(name); @@ -2392,7 +2392,7 @@ H5P_set(H5P_genplist_t *plist, const char *name, const void *value) H5P_genprop_t *prop; /* Temporary property pointer */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5P_set, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert(plist); HDassert(name); @@ -2541,7 +2541,7 @@ H5P_exist_plist(H5P_genplist_t *plist, const char *name) { htri_t ret_value = FAIL; /* return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5P_exist_plist) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(plist); HDassert(name); @@ -2601,7 +2601,7 @@ H5P_exist_pclass(H5P_genclass_t *pclass, const char *name) { htri_t ret_value = FAIL; /* return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5P_exist_pclass) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(pclass); HDassert(name); @@ -2658,7 +2658,7 @@ H5P_get_size_plist(H5P_genplist_t *plist, const char *name, size_t *size) H5P_genprop_t *prop; /* Temporary property pointer */ herr_t ret_value=SUCCEED; /* return value */ - FUNC_ENTER_NOAPI_NOINIT(H5P_get_size_plist) + FUNC_ENTER_NOAPI_NOINIT HDassert(plist); HDassert(name); @@ -2704,7 +2704,7 @@ H5P_get_size_pclass(H5P_genclass_t *pclass, const char *name, size_t *size) H5P_genprop_t *prop; /* Temporary property pointer */ herr_t ret_value=SUCCEED; /* return value */ - FUNC_ENTER_NOAPI_NOINIT(H5P_get_size_pclass) + FUNC_ENTER_NOAPI_NOINIT HDassert(pclass); HDassert(name); @@ -2746,7 +2746,7 @@ H5P_get_class(const H5P_genplist_t *plist) { H5P_genclass_t *ret_value; /* return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5P_get_class) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(plist); @@ -2780,7 +2780,7 @@ H5P_get_class(const H5P_genplist_t *plist) herr_t H5P_get_nprops_plist(const H5P_genplist_t *plist, size_t *nprops) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5P_get_nprops_plist) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(plist); HDassert(nprops); @@ -2818,7 +2818,7 @@ H5P_get_nprops_pclass(const H5P_genclass_t *pclass, size_t *nprops, hbool_t recu { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5P_get_nprops_pclass, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert(pclass); HDassert(nprops); @@ -2866,7 +2866,7 @@ H5P_cmp_prop(const H5P_genprop_t *prop1, const H5P_genprop_t *prop2) int cmp_value; /* Value from comparison */ int ret_value = 0; /* return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5P_cmp_prop) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(prop1); HDassert(prop2); @@ -2957,7 +2957,7 @@ H5P_cmp_class(const H5P_genclass_t *pclass1, const H5P_genclass_t *pclass2) int cmp_value; /* Value from comparison */ int ret_value = 0; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5P_cmp_class) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(pclass1); HDassert(pclass2); @@ -3063,7 +3063,7 @@ H5P_cmp_plist(const H5P_genplist_t *plist1, const H5P_genplist_t *plist2) int cmp_value; /* Value from comparison */ int ret_value = 0; /* return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5P_cmp_plist) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(plist1); HDassert(plist2); @@ -3169,7 +3169,7 @@ H5P_isa_class_real(H5P_genclass_t *pclass1, H5P_genclass_t *pclass2) { htri_t ret_value; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5P_isa_class_real) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(pclass1); HDassert(pclass2); @@ -3222,7 +3222,7 @@ H5P_isa_class(hid_t plist_id, hid_t pclass_id) H5P_genclass_t *pclass; /* Property list class */ htri_t ret_value; /* return value */ - FUNC_ENTER_NOAPI(H5P_isa_class, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check arguments. */ if(NULL == (plist = (H5P_genplist_t *)H5I_object_verify(plist_id, H5I_GENPROP_LST))) @@ -3272,7 +3272,7 @@ H5P_object_verify(hid_t plist_id, hid_t pclass_id) { H5P_genplist_t *ret_value; /* return value */ - FUNC_ENTER_NOAPI(H5P_object_verify, NULL) + FUNC_ENTER_NOAPI(NULL) /* Compare the property list's class against the other class */ if(H5P_isa_class(plist_id, pclass_id) != TRUE) @@ -3349,7 +3349,7 @@ H5P_iterate_plist(hid_t plist_id, int *idx, H5P_iterate_t iter_func, void *iter_ int curr_idx = 0; /* Current iteration index */ int ret_value = FAIL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5P_iterate_plist) + FUNC_ENTER_NOAPI_NOINIT HDassert(idx); HDassert(iter_func); @@ -3359,7 +3359,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)) == NULL) + if((seen = H5SL_create(H5SL_TYPE_STR, NULL)) == NULL) HGOTO_ERROR(H5E_PLIST,H5E_CANTCREATE,FAIL,"can't create skip list for seen properties") /* Walk through the changed properties in the list */ @@ -3505,7 +3505,7 @@ H5P_iterate_pclass(hid_t pclass_id, int *idx, H5P_iterate_t iter_func, void *ite int curr_idx=0; /* Current iteration index */ int ret_value=FAIL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5P_iterate_pclass) + FUNC_ENTER_NOAPI_NOINIT HDassert(idx); HDassert(iter_func); @@ -3577,7 +3577,7 @@ H5P_peek_unsigned(H5P_genplist_t *plist, const char *name) { unsigned ret_value; /* return value */ - FUNC_ENTER_NOAPI(H5P_peek_unsigned, UFAIL) + FUNC_ENTER_NOAPI(UFAIL) HDassert(plist); HDassert(name); @@ -3622,7 +3622,7 @@ H5P_peek_hid_t(H5P_genplist_t *plist, const char *name) { hid_t ret_value; /* return value */ - FUNC_ENTER_NOAPI(H5P_peek_hid_t, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert(plist); HDassert(name); @@ -3667,7 +3667,7 @@ H5P_peek_voidp(H5P_genplist_t *plist, const char *name) { void * ret_value; /* return value */ - FUNC_ENTER_NOAPI(H5P_peek_voidp, NULL) + FUNC_ENTER_NOAPI(NULL) HDassert(plist); HDassert(name); @@ -3712,7 +3712,7 @@ H5P_peek_size_t(H5P_genplist_t *plist, const char *name) { size_t ret_value; /* return value */ - FUNC_ENTER_NOAPI(H5P_peek_size_t, UFAIL) + FUNC_ENTER_NOAPI(UFAIL) HDassert(plist); HDassert(name); @@ -3760,7 +3760,7 @@ H5P_get(const H5P_genplist_t *plist, const char *name, void *value) H5P_genprop_t *prop; /* Temporary property pointer */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5P_get, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert(plist); HDassert(name); @@ -3907,7 +3907,7 @@ H5P_remove(hid_t plist_id, H5P_genplist_t *plist, const char *name) char *del_name; /* Pointer to deleted name */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5P_remove, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert(plist); HDassert(name); @@ -4044,7 +4044,7 @@ H5P_copy_prop_plist(hid_t dst_id, hid_t src_id, const char *name) H5P_genprop_t *new_prop=NULL; /* Pointer to new property */ herr_t ret_value=SUCCEED; /* return value */ - FUNC_ENTER_NOAPI_NOINIT(H5P_copy_prop_plist) + FUNC_ENTER_NOAPI_NOINIT HDassert(name); @@ -4151,7 +4151,7 @@ H5P_copy_prop_pclass(hid_t dst_id, hid_t src_id, const char *name) H5P_genprop_t *prop; /* Temporary property pointer */ herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_NOAPI_NOINIT(H5P_copy_prop_pclass) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(name); @@ -4226,7 +4226,7 @@ H5P_unregister(H5P_genclass_t *pclass, const char *name) H5P_genprop_t *prop; /* Temporary property pointer */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5P_unregister) + FUNC_ENTER_NOAPI_NOINIT HDassert(pclass); HDassert(name); @@ -4291,7 +4291,7 @@ H5P_close(void *_plist) unsigned make_cb=0; /* Operator data for property free callback */ herr_t ret_value=SUCCEED; /* return value */ - FUNC_ENTER_NOAPI_NOINIT(H5P_close) + FUNC_ENTER_NOAPI_NOINIT HDassert(plist); @@ -4316,7 +4316,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)) == NULL) + if((seen = H5SL_create(H5SL_TYPE_STR, NULL)) == NULL) HGOTO_ERROR(H5E_PLIST,H5E_CANTCREATE,FAIL,"can't create skip list for seen properties") nseen = 0; @@ -4450,7 +4450,7 @@ H5P_get_class_name(H5P_genclass_t *pclass) { char *ret_value; /* return value */ - FUNC_ENTER_NOAPI(H5P_get_class_name, NULL) + FUNC_ENTER_NOAPI(NULL) HDassert(pclass); @@ -4491,7 +4491,7 @@ H5P_get_class_path(H5P_genclass_t *pclass) size_t my_path_len; /* This class's name's length */ char *ret_value; /* return value */ - FUNC_ENTER_NOAPI_NOINIT(H5P_get_class_path) + FUNC_ENTER_NOAPI_NOINIT HDassert(pclass); @@ -4558,7 +4558,7 @@ H5P_open_class_path(const char *path) H5P_genclass_t *ret_value; /* Return value */ H5P_check_class_t check_info; /* Structure to hold the information for checking duplicate names */ - FUNC_ENTER_NOAPI_NOINIT(H5P_open_class_path) + FUNC_ENTER_NOAPI_NOINIT HDassert(path); @@ -4631,7 +4631,7 @@ H5P_get_class_parent(const H5P_genclass_t *pclass) { H5P_genclass_t *ret_value; /* return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5P_get_class_parent) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(pclass); @@ -4665,7 +4665,7 @@ H5P_close_class(void *_pclass) H5P_genclass_t *pclass = (H5P_genclass_t *)_pclass; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5P_close_class) + FUNC_ENTER_NOAPI_NOINIT HDassert(pclass); diff --git a/src/H5Plapl.c b/src/H5Plapl.c index 438a297..6c80493 100644 --- a/src/H5Plapl.c +++ b/src/H5Plapl.c @@ -155,7 +155,7 @@ H5P_lacc_reg_prop(H5P_genclass_t *pclass) herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5P_lacc_reg_prop) + FUNC_ENTER_NOAPI_NOINIT /* Register property for number of links traversed */ if(H5P_register_real(pclass, H5L_ACS_NLINKS_NAME, H5L_ACS_NLINKS_SIZE, &nlinks, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) @@ -202,7 +202,7 @@ H5P_lacc_elink_fapl_del(hid_t UNUSED prop_id, const char UNUSED *name, size_t UN hid_t l_fapl_id; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI(H5P_lacc_elink_fapl_del, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert(value); @@ -236,7 +236,7 @@ H5P_lacc_elink_fapl_copy(const char UNUSED *name, size_t UNUSED size, void *valu hid_t l_fapl_id; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI(H5P_lacc_elink_fapl_copy, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert(value); @@ -277,7 +277,7 @@ H5P_lacc_elink_fapl_close(const char UNUSED *name, size_t UNUSED size, void *val hid_t l_fapl_id; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT(H5P_lacc_elink_fapl_close) + FUNC_ENTER_NOAPI_NOINIT HDassert(value); @@ -306,7 +306,7 @@ done: static herr_t H5P_lacc_elink_pref_del(hid_t UNUSED prop_id, const char UNUSED *name, size_t UNUSED size, void *value) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5P_lacc_elink_pref_del) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(value); @@ -332,7 +332,7 @@ H5P_lacc_elink_pref_del(hid_t UNUSED prop_id, const char UNUSED *name, size_t UN static herr_t H5P_lacc_elink_pref_copy(const char UNUSED *name, size_t UNUSED size, void *value) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5P_lacc_elink_pref_copy) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(value); @@ -358,7 +358,7 @@ H5P_lacc_elink_pref_copy(const char UNUSED *name, size_t UNUSED size, void *valu static herr_t H5P_lacc_elink_pref_close(const char UNUSED *name, size_t UNUSED size, void *value) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5P_lacc_elink_pref_close) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(value); @@ -395,7 +395,7 @@ H5Pset_nlinks(hid_t plist_id, size_t nlinks) H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Pset_nlinks, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "iz", plist_id, nlinks); if(nlinks <= 0) @@ -436,7 +436,7 @@ H5Pget_nlinks(hid_t plist_id, size_t *nlinks) H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Pget_nlinks, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*z", plist_id, nlinks); if(!nlinks) @@ -476,7 +476,7 @@ H5Pset_elink_prefix(hid_t plist_id, const char *prefix) char *my_prefix; /* Copy of prefix string */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Pset_elink_prefix, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*s", plist_id, prefix); /* Get the plist structure */ @@ -527,7 +527,7 @@ H5Pget_elink_prefix(hid_t plist_id, char *prefix, size_t size) size_t len; /* Length of prefix string */ ssize_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Pget_elink_prefix, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("Zs", "i*sz", plist_id, prefix, size); /* Get the plist structure */ @@ -577,7 +577,7 @@ H5Pset_elink_fapl(hid_t lapl_id, hid_t fapl_id) hid_t l_fapl_id, new_fapl_id; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Pset_elink_fapl, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "ii", lapl_id, fapl_id); /* Check arguments */ @@ -628,7 +628,7 @@ H5Pget_elink_fapl(hid_t lapl_id) hid_t l_fapl_id; hid_t ret_value=FAIL; /* Return value */ - FUNC_ENTER_API(H5Pget_elink_fapl, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("i", "i", lapl_id); /* Get the plist structure */ @@ -672,7 +672,7 @@ H5Pset_elink_acc_flags(hid_t lapl_id, unsigned flags) H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Pset_elink_acc_flags, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "iIu", lapl_id, flags); /* Check that flags are valid */ @@ -711,7 +711,7 @@ H5Pget_elink_acc_flags(hid_t lapl_id, unsigned *flags) H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Pget_elink_acc_flags, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*Iu", lapl_id, flags); /* Get the plist structure */ @@ -749,7 +749,7 @@ H5Pset_elink_cb(hid_t lapl_id, H5L_elink_traverse_t func, void *op_data) H5L_elink_cb_t cb_info; /* Callback info struct */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Pset_elink_cb, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("e", "ix*x", lapl_id, func, op_data); /* Check if the callback function is NULL and the user data is non-NULL. @@ -794,7 +794,7 @@ H5Pget_elink_cb(hid_t lapl_id, H5L_elink_traverse_t *func, void **op_data) H5L_elink_cb_t cb_info; /* Callback info struct */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Pget_elink_cb, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("e", "i*x**x", lapl_id, func, op_data); /* Get the plist structure */ diff --git a/src/H5Plcpl.c b/src/H5Plcpl.c index ffc68fa..60b4e37 100644 --- a/src/H5Plcpl.c +++ b/src/H5Plcpl.c @@ -116,7 +116,7 @@ H5P_lcrt_reg_prop(H5P_genclass_t *pclass) unsigned intmd_group = H5L_CRT_INTERMEDIATE_GROUP_DEF; /* Default setting for creating intermediate groups */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5P_lcrt_reg_prop, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Register create intermediate groups property */ if(H5P_register_real(pclass, H5L_CRT_INTERMEDIATE_GROUP_NAME, H5L_CRT_INTERMEDIATE_GROUP_SIZE, &intmd_group, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) @@ -147,7 +147,7 @@ H5Pset_create_intermediate_group(hid_t plist_id, unsigned crt_intmd_group) H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Pset_create_intermediate_group, FAIL); + FUNC_ENTER_API(FAIL) H5TRACE2("e", "iIu", plist_id, crt_intmd_group); /* Get the plist structure */ @@ -182,7 +182,7 @@ H5Pget_create_intermediate_group(hid_t plist_id, unsigned *crt_intmd_group /*out H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pget_create_intermediate_group, FAIL); + FUNC_ENTER_API(FAIL) H5TRACE2("e", "ix", plist_id, crt_intmd_group); /* Get the plist structure */ diff --git a/src/H5Pocpl.c b/src/H5Pocpl.c index dec2cfe..217d0ba 100755 --- a/src/H5Pocpl.c +++ b/src/H5Pocpl.c @@ -133,7 +133,7 @@ H5P_ocrt_reg_prop(H5P_genclass_t *pclass) H5O_pline_t pline = H5O_CRT_PIPELINE_DEF; /* Default I/O pipeline setting */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5P_ocrt_reg_prop) + FUNC_ENTER_NOAPI_NOINIT /* Register max. compact attribute storage property */ if(H5P_register_real(pclass, H5O_CRT_ATTR_MAX_COMPACT_NAME, H5O_CRT_ATTR_MAX_COMPACT_SIZE, &attr_max_compact, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) @@ -180,7 +180,7 @@ H5P_ocrt_copy(hid_t dst_plist_id, hid_t src_plist_id, void UNUSED *copy_data) H5P_genplist_t *dst_plist; /* Pointer to destination property list */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5P_ocrt_copy) + FUNC_ENTER_NOAPI_NOINIT /* Verify property list IDs */ if(NULL == (dst_plist = (H5P_genplist_t *)H5I_object(dst_plist_id))) @@ -228,7 +228,7 @@ H5P_ocrt_close(hid_t dcpl_id, void UNUSED *close_data) H5P_genplist_t *plist; /* Property list */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5P_ocrt_close) + FUNC_ENTER_NOAPI_NOINIT /* Check arguments */ if(NULL == (plist = (H5P_genplist_t *)H5I_object(dcpl_id))) @@ -275,7 +275,7 @@ H5Pset_attr_phase_change(hid_t plist_id, unsigned max_compact, unsigned min_dens H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Pset_attr_phase_change, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("e", "iIuIu", plist_id, max_compact, min_dense); /* Range check values */ @@ -319,7 +319,7 @@ H5Pget_attr_phase_change(hid_t plist_id, unsigned *max_compact, unsigned *min_de H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Pget_attr_phase_change, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("e", "i*Iu*Iu", plist_id, max_compact, min_dense); /* Get the plist structure */ @@ -360,7 +360,7 @@ H5Pset_attr_creation_order(hid_t plist_id, unsigned crt_order_flags) uint8_t ohdr_flags; /* Object header flags */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Pset_attr_creation_order, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "iIu", plist_id, crt_order_flags); /* Check for bad combination of flags */ @@ -409,7 +409,7 @@ H5Pget_attr_creation_order(hid_t plist_id, unsigned *crt_order_flags) { herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pget_attr_creation_order, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*Iu", plist_id, crt_order_flags); /* Get values */ @@ -471,7 +471,7 @@ H5Pset_obj_track_times(hid_t plist_id, hbool_t track_times) uint8_t ohdr_flags; /* Object header flags */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Pset_obj_track_times, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "ib", plist_id, track_times); /* Get the plist structure */ @@ -514,7 +514,7 @@ H5Pget_obj_track_times(hid_t plist_id, hbool_t *track_times) { herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pget_obj_track_times, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*b", plist_id, track_times); /* Get values */ @@ -582,7 +582,7 @@ H5P_modify_filter(H5P_genplist_t *plist, H5Z_filter_t filter, unsigned flags, H5O_pline_t pline; herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_NOAPI(H5P_modify_filter, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Get the pipeline property to modify */ if(H5P_get(plist, H5O_CRT_PIPELINE_NAME, &pline) < 0) @@ -651,7 +651,7 @@ H5Pmodify_filter(hid_t plist_id, H5Z_filter_t filter, unsigned int flags, H5P_genplist_t *plist; /* Property list */ herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pmodify_filter, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE5("e", "iZfIuz*[a3]Iu", plist_id, filter, flags, cd_nelmts, cd_values); /* Check args */ @@ -728,7 +728,7 @@ H5Pset_filter(hid_t plist_id, H5Z_filter_t filter, unsigned int flags, H5O_pline_t pline; /* Filter pipeline */ herr_t ret_value=SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pset_filter, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE5("e", "iZfIuz*[a3]Iu", plist_id, filter, flags, cd_nelmts, cd_values); /* Check args */ @@ -794,7 +794,7 @@ H5Pget_nfilters(hid_t plist_id) H5O_pline_t pline; /* Filter pipeline */ int ret_value; /* return value */ - FUNC_ENTER_API(H5Pget_nfilters, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("Is", "i", plist_id); /* Get the plist structure */ @@ -855,7 +855,7 @@ H5Pget_filter2(hid_t plist_id, unsigned idx, unsigned int *flags/*out*/, const H5Z_filter_info_t *filter; /* Pointer to filter information */ H5Z_filter_t ret_value; /* return value */ - FUNC_ENTER_API(H5Pget_filter2, H5Z_FILTER_ERROR) + FUNC_ENTER_API(H5Z_FILTER_ERROR) H5TRACE8("Zf", "iIux*zxzxx", plist_id, idx, flags, cd_nelmts, cd_values, namelen, name, filter_config); @@ -938,7 +938,7 @@ H5P_get_filter_by_id(H5P_genplist_t *plist, H5Z_filter_t id, unsigned int *flags H5Z_filter_info_t *filter; /* Pointer to filter information */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5P_get_filter_by_id, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Get pipeline info */ if(H5P_get(plist, H5O_CRT_PIPELINE_NAME, &pline) < 0) @@ -992,11 +992,9 @@ H5Pget_filter_by_id2(hid_t plist_id, H5Z_filter_t id, unsigned int *flags/*out*/ size_t namelen, char name[]/*out*/, unsigned *filter_config) { H5P_genplist_t *plist; /* Property list */ - H5O_pline_t pline; /* Filter pipeline */ - const H5Z_filter_info_t *filter; /* Pointer to filter information */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Pget_filter_by_id2, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE8("e", "iZfx*zxzx*Iu", plist_id, id, flags, cd_nelmts, cd_values, namelen, name, filter_config); @@ -1064,7 +1062,7 @@ H5Pall_filters_avail(hid_t plist_id) H5O_pline_t pline; /* Filter pipeline */ htri_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Pall_filters_avail, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("t", "i", plist_id); /* Get the plist structure */ @@ -1111,7 +1109,7 @@ H5Premove_filter(hid_t plist_id, H5Z_filter_t filter) H5O_pline_t pline; /* Filter pipeline */ herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_API(H5Premove_filter, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "iZf", plist_id, filter); /* Get the plist structure */ @@ -1175,7 +1173,7 @@ H5Pset_deflate(hid_t plist_id, unsigned level) H5O_pline_t pline; /* Filter pipeline */ herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pset_deflate, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "iIu", plist_id, level); /* Check arguments */ @@ -1230,7 +1228,7 @@ H5Pset_fletcher32(hid_t plist_id) H5O_pline_t pline; /* Filter pipeline */ herr_t ret_value=SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pset_fletcher32, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", plist_id); /* Get the plist structure */ @@ -1272,7 +1270,7 @@ H5P_get_filter(const H5Z_filter_info_t *filter, unsigned int *flags/*out*/, size_t namelen, char name[]/*out*/, unsigned *filter_config /*out*/) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5P_get_filter) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments */ HDassert(filter); @@ -1353,7 +1351,7 @@ H5P_ocrt_pipeline_cmp(const void *_pline1, const void *_pline2, size_t UNUSED si int cmp_value; /* Value from comparison */ herr_t ret_value = 0; /* Return value */ - FUNC_ENTER_NOAPI_NOFUNC(H5P_ocrt_pipeline_cmp) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ HDassert(pline1); @@ -1450,7 +1448,7 @@ H5Pget_filter1(hid_t plist_id, unsigned idx, unsigned int *flags/*out*/, H5P_genplist_t *plist; /* Property list pointer */ H5Z_filter_t ret_value; /* return value */ - FUNC_ENTER_API(H5Pget_filter1, H5Z_FILTER_ERROR) + FUNC_ENTER_API(H5Z_FILTER_ERROR) H5TRACE7("Zf", "iIux*zxzx", plist_id, idx, flags, cd_nelmts, cd_values, namelen, name); @@ -1531,7 +1529,7 @@ H5Pget_filter_by_id1(hid_t plist_id, H5Z_filter_t id, unsigned int *flags/*out*/ H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Pget_filter_by_id1, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE7("e", "iZfx*zxzx", plist_id, id, flags, cd_nelmts, cd_values, namelen, name); diff --git a/src/H5Pocpypl.c b/src/H5Pocpypl.c index 963dddc..af50d80 100755 --- a/src/H5Pocpypl.c +++ b/src/H5Pocpypl.c @@ -115,7 +115,7 @@ H5P_ocpy_reg_prop(H5P_genclass_t *pclass) unsigned ocpy_option = H5O_CPY_OPTION_DEF; /* Default object copy flags */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5P_ocpy_reg_prop, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Register copy options property */ if(H5P_register_real(pclass, H5O_CPY_OPTION_NAME, H5O_CPY_OPTION_SIZE, &ocpy_option, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) @@ -153,7 +153,7 @@ H5Pset_copy_object(hid_t plist_id, unsigned cpy_option) H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Pset_copy_object, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "iIu", plist_id, cpy_option); /* Check parameters */ @@ -191,7 +191,7 @@ H5Pget_copy_object(hid_t plist_id, unsigned *cpy_option /*out*/) H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pget_copy_object, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "ix", plist_id, cpy_option); /* Get the plist structure */ diff --git a/src/H5Ppublic.h b/src/H5Ppublic.h index ba6106e..68627d4 100644 --- a/src/H5Ppublic.h +++ b/src/H5Ppublic.h @@ -120,6 +120,38 @@ typedef H5P_prp_cb1_t H5P_prp_close_func_t; /* Define property list iteration function type */ typedef herr_t (*H5P_iterate_t)(hid_t id, const char *name, void *iter_data); +/* Actual IO mode property */ +typedef enum H5D_mpio_actual_chunk_opt_mode_t { + /* The default value, H5D_MPIO_NO_CHUNK_OPTIMIZATION, is used for all I/O + * operations that do not use chunk optimizations, including non-collective + * I/O and contiguous collective I/O. + */ + H5D_MPIO_NO_CHUNK_OPTIMIZATION = 0, + H5D_MPIO_LINK_CHUNK, + H5D_MPIO_MULTI_CHUNK, + H5D_MPIO_MULTI_CHUNK_NO_OPT +} H5D_mpio_actual_chunk_opt_mode_t; + +typedef enum H5D_mpio_actual_io_mode_t { + /* The following four values are conveniently defined as a bit field so that + * we can switch from the default to indpendent or collective and then to + * mixed without having to check the original value. + * + * NO_COLLECTIVE means that either collective I/O wasn't requested or that + * no I/O took place. + * + * CHUNK_INDEPENDENT means that collective I/O was requested, but the + * chunk optimization scheme chose independent I/O for each chunk. + */ + H5D_MPIO_NO_COLLECTIVE = 0x0, + H5D_MPIO_CHUNK_INDEPENDENT = 0x1, + H5D_MPIO_CHUNK_COLLECTIVE = 0x2, + H5D_MPIO_CHUNK_MIXED = 0x1 | 0x2, + + /* The contiguous case is separate from the bit field. */ + H5D_MPIO_CONTIGUOUS_COLLECTIVE = 0x4 +} H5D_mpio_actual_io_mode_t; + /********************/ /* Public Variables */ /********************/ @@ -359,6 +391,10 @@ H5_DLL herr_t H5Pset_hyper_vector_size(hid_t fapl_id, size_t size); H5_DLL herr_t H5Pget_hyper_vector_size(hid_t fapl_id, size_t *size/*out*/); H5_DLL herr_t H5Pset_type_conv_cb(hid_t dxpl_id, H5T_conv_except_func_t op, void* operate_data); H5_DLL herr_t H5Pget_type_conv_cb(hid_t dxpl_id, H5T_conv_except_func_t *op, void** operate_data); +#ifdef H5_HAVE_PARALLEL +H5_DLL herr_t H5Pget_mpio_actual_chunk_opt_mode(hid_t plist_id, H5D_mpio_actual_chunk_opt_mode_t *actual_chunk_opt_mode); +H5_DLL herr_t H5Pget_mpio_actual_io_mode(hid_t plist_id, H5D_mpio_actual_io_mode_t *actual_io_mode); +#endif /* H5_HAVE_PARALLEL */ /* Link creation property list (LCPL) routines */ H5_DLL herr_t H5Pset_create_intermediate_group(hid_t plist_id, unsigned crt_intmd); diff --git a/src/H5Pstrcpl.c b/src/H5Pstrcpl.c index 5125511..91cf70b 100644 --- a/src/H5Pstrcpl.c +++ b/src/H5Pstrcpl.c @@ -114,7 +114,7 @@ H5P_strcrt_reg_prop(H5P_genclass_t *pclass) H5T_cset_t char_encoding = H5P_STRCRT_CHAR_ENCODING_DEF; /* Default character set encoding */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5P_strcrt_reg_prop, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Register character encoding */ if(H5P_register_real(pclass, H5P_STRCRT_CHAR_ENCODING_NAME, H5P_STRCRT_CHAR_ENCODING_SIZE, &char_encoding, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) @@ -145,7 +145,7 @@ H5Pset_char_encoding(hid_t plist_id, H5T_cset_t encoding) H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pset_char_encoding, FAIL); + FUNC_ENTER_API(FAIL) H5TRACE2("e", "iTc", plist_id, encoding); /* Check arguments */ @@ -161,7 +161,7 @@ H5Pset_char_encoding(hid_t plist_id, H5T_cset_t encoding) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set character encoding") done: - FUNC_LEAVE_API(ret_value); + FUNC_LEAVE_API(ret_value) } /* end H5P_set_char_encoding() */ @@ -182,7 +182,7 @@ H5Pget_char_encoding(hid_t plist_id, H5T_cset_t *encoding /*out*/) H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_API(H5Pget_char_encoding, FAIL); + FUNC_ENTER_API(FAIL) H5TRACE2("e", "ix", plist_id, encoding); /* Get the plist structure */ @@ -195,6 +195,6 @@ H5Pget_char_encoding(hid_t plist_id, H5T_cset_t *encoding /*out*/) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get character encoding flag") done: - FUNC_LEAVE_API(ret_value); + FUNC_LEAVE_API(ret_value) } /* end H5Pget_char_encoding() */ diff --git a/src/H5Ptest.c b/src/H5Ptest.c index 575d6d3..b36da6a 100644 --- a/src/H5Ptest.c +++ b/src/H5Ptest.c @@ -63,7 +63,7 @@ H5P_get_class_path_test(hid_t pclass_id) H5P_genclass_t *pclass; /* Property class to query */ char *ret_value; /* return value */ - FUNC_ENTER_NOAPI(H5P_get_class_path_test, NULL) + FUNC_ENTER_NOAPI(NULL) /* Check arguments. */ if(NULL == (pclass = (H5P_genclass_t *)H5I_object_verify(pclass_id, H5I_GENPROP_CLS))) @@ -104,7 +104,7 @@ H5P_open_class_path_test(const char *path) H5P_genclass_t *pclass=NULL;/* Property class to query */ hid_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5P_open_class_path_test, FAIL); + FUNC_ENTER_NOAPI(FAIL) /* Check arguments. */ if (NULL == path || *path=='\0') @@ -122,7 +122,7 @@ done: if(ret_value<0 && pclass) H5P_close_class(pclass); - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* H5P_open_class_path_test() */ @@ -149,7 +149,7 @@ H5P_reset_external_file_test(hid_t dcpl_id) H5P_genplist_t *plist; /* Property list */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5P_reset_external_file_test, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check arguments */ if(NULL == (plist = (H5P_genplist_t *)H5I_object(dcpl_id))) diff --git a/src/H5R.c b/src/H5R.c index 2d2766d..65ac7da 100644 --- a/src/H5R.c +++ b/src/H5R.c @@ -38,8 +38,6 @@ /* Static functions */ static herr_t H5R_create(void *ref, H5G_loc_t *loc, const char *name, H5R_type_t ref_type, H5S_t *space, hid_t dxpl_id); -static hid_t H5R_dereference(H5F_t *file, hid_t dxpl_id, H5R_type_t ref_type, - const void *_ref, hbool_t app_ref); static H5S_t * H5R_get_region(H5F_t *file, hid_t dxpl_id, const void *_ref); static ssize_t H5R_get_name(H5F_t *file, hid_t lapl_id, hid_t dxpl_id, hid_t id, H5R_type_t ref_type, const void *_ref, char *name, size_t size); @@ -63,7 +61,7 @@ H5R_init(void) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5R_init, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* FUNC_ENTER() does all the work */ done: @@ -88,14 +86,14 @@ H5R_init_interface(void) { herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5R_init_interface); + FUNC_ENTER_NOAPI_NOINIT /* Initialize the atom group for the file IDs */ if(H5I_register_type(H5I_REFERENCE, (size_t)H5I_REFID_HASHSIZE, H5R_RESERVED_ATOMS, (H5I_free_t)NULL) < 0) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTINIT, FAIL, "unable to initialize interface"); done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } @@ -121,7 +119,7 @@ H5R_term_interface(void) { int n=0; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5R_term_interface); + FUNC_ENTER_NOAPI_NOINIT_NOERR if (H5_interface_initialize_g) { if ((n=H5I_nmembers(H5I_REFERENCE))) { @@ -133,7 +131,7 @@ H5R_term_interface(void) } } - FUNC_LEAVE_NOAPI(n); + FUNC_LEAVE_NOAPI(n) } @@ -173,7 +171,7 @@ H5R_create(void *_ref, H5G_loc_t *loc, const char *name, H5R_type_t ref_type, H5 hbool_t obj_found = FALSE; /* Object location found */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5R_create) + FUNC_ENTER_NOAPI_NOINIT HDassert(_ref); HDassert(loc); @@ -312,7 +310,7 @@ H5Rcreate(void *ref, hid_t loc_id, const char *name, H5R_type_t ref_type, hid_t H5S_t *space = NULL; /* Pointer to dataspace containing region */ herr_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Rcreate, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE5("e", "*xi*sRti", ref, loc_id, name, ref_type, space_id); /* Check args */ @@ -361,9 +359,13 @@ done: Currently only set up to work with references to datasets EXAMPLES REVISION LOG + Raymond Lu + 13 July 2011 + I added the OAPL_ID parameter for the object being referenced. It only + supports dataset access property list currently. --------------------------------------------------------------------------*/ -static hid_t -H5R_dereference(H5F_t *file, hid_t dxpl_id, H5R_type_t ref_type, const void *_ref, hbool_t app_ref) +hid_t +H5R_dereference(H5F_t *file, hid_t oapl_id, hid_t dxpl_id, H5R_type_t ref_type, const void *_ref, hbool_t app_ref) { H5O_loc_t oloc; /* Object location */ H5G_name_t path; /* Path of object */ @@ -372,7 +374,7 @@ H5R_dereference(H5F_t *file, hid_t dxpl_id, H5R_type_t ref_type, const void *_re H5O_type_t obj_type; /* Type of object */ hid_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5R_dereference) + FUNC_ENTER_NOAPI_NOINIT HDassert(_ref); HDassert(ref_type > H5R_BADTYPE || ref_type < H5R_MAXTYPE); @@ -462,11 +464,16 @@ H5R_dereference(H5F_t *file, hid_t dxpl_id, H5R_type_t ref_type, const void *_re case H5O_TYPE_DATASET: { - hid_t dapl_id = H5P_DATASET_ACCESS_DEFAULT; /* dapl to use to open dataset */ H5D_t *dset; /* Pointer to dataset to open */ + /* Get correct property list */ + if(H5P_DEFAULT == oapl_id) + oapl_id = H5P_DATASET_ACCESS_DEFAULT; + else if(TRUE != H5P_isa_class(oapl_id, H5P_DATASET_ACCESS)) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not dataset access property list") + /* Open the dataset */ - if(NULL == (dset = H5D_open(&loc, dapl_id, dxpl_id))) + if(NULL == (dset = H5D_open(&loc, oapl_id, dxpl_id))) HGOTO_ERROR(H5E_DATASET, H5E_NOTFOUND, FAIL, "not found") /* Create an atom for the dataset */ @@ -488,13 +495,14 @@ done: /*-------------------------------------------------------------------------- NAME - H5Rdereference + H5Rdereference2 PURPOSE Opens the HDF5 object referenced. USAGE - hid_t H5Rdereference(ref) + hid_t H5Rdereference2(ref) hid_t id; IN: Dataset reference object is in or location ID of object that the dataset is located within. + hid_t oapl_id; IN: Property list of the object being referenced. H5R_type_t ref_type; IN: Type of reference to create void *ref; IN: Reference to open. @@ -507,20 +515,26 @@ done: COMMENTS, BUGS, ASSUMPTIONS EXAMPLES REVISION LOG + Raymond Lu + 13 July 2011 + I added the OAPL_ID parameter for the object being referenced. It only + supports dataset access property list currently. --------------------------------------------------------------------------*/ hid_t -H5Rdereference(hid_t id, H5R_type_t ref_type, const void *_ref) +H5Rdereference2(hid_t obj_id, hid_t oapl_id, H5R_type_t ref_type, const void *_ref) { H5G_loc_t loc; /* Group location */ H5F_t *file = NULL; /* File object */ hid_t ret_value; - FUNC_ENTER_API(H5Rdereference, FAIL) - H5TRACE3("i", "iRt*x", id, ref_type, _ref); + FUNC_ENTER_API(FAIL) + H5TRACE4("i", "iiRt*x", obj_id, oapl_id, ref_type, _ref); /* Check args */ - if(H5G_loc(id, &loc) < 0) + if(H5G_loc(obj_id, &loc) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") + if(oapl_id < 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list") if(ref_type <= H5R_BADTYPE || ref_type >= H5R_MAXTYPE) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid reference type") if(_ref == NULL) @@ -530,12 +544,12 @@ H5Rdereference(hid_t id, H5R_type_t ref_type, const void *_ref) file = loc.oloc->file; /* Create reference */ - if((ret_value = H5R_dereference(file, H5AC_dxpl_id, ref_type, _ref, TRUE)) < 0) + if((ret_value = H5R_dereference(file, oapl_id, H5AC_dxpl_id, ref_type, _ref, TRUE)) < 0) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTINIT, FAIL, "unable dereference object") done: FUNC_LEAVE_API(ret_value) -} /* end H5Rdereference() */ +} /* end H5Rdereference2() */ /*-------------------------------------------------------------------------- @@ -568,7 +582,7 @@ H5R_get_region(H5F_t *file, hid_t dxpl_id, const void *_ref) uint8_t *buf = NULL; /* Buffer to store serialized selection in */ H5S_t *ret_value; - FUNC_ENTER_NOAPI_NOINIT(H5R_get_region) + FUNC_ENTER_NOAPI_NOINIT HDassert(_ref); HDassert(file); @@ -637,7 +651,7 @@ H5Rget_region(hid_t id, H5R_type_t ref_type, const void *ref) H5S_t *space = NULL; /* Dataspace object */ hid_t ret_value; - FUNC_ENTER_API(H5Rget_region, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("i", "iRt*x", id, ref_type, ref); /* Check args */ @@ -691,7 +705,7 @@ H5R_get_obj_type(H5F_t *file, hid_t dxpl_id, H5R_type_t ref_type, unsigned rc; /* Reference count of object */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5R_get_obj_type) + FUNC_ENTER_NOAPI_NOINIT HDassert(file); HDassert(_ref); @@ -777,7 +791,7 @@ H5Rget_obj_type2(hid_t id, H5R_type_t ref_type, const void *ref, H5G_loc_t loc; /* Object location */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Rget_obj_type2, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE4("e", "iRt*x*Ot", id, ref_type, ref, obj_type); /* Check args */ @@ -833,7 +847,7 @@ H5R_get_name(H5F_t *f, hid_t lapl_id, hid_t dxpl_id, hid_t id, H5R_type_t ref_ty H5O_loc_t oloc; /* Object location describing object for reference */ ssize_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5R_get_name) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(f); @@ -931,7 +945,7 @@ H5Rget_name(hid_t id, H5R_type_t ref_type, const void *_ref, char *name, H5F_t *file; /* File object */ ssize_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Rget_name, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE5("Zs", "iRt*x*sz", id, ref_type, _ref, name, size); /* Check args */ diff --git a/src/H5RC.c b/src/H5RC.c index ecec03a..6abe837 100644 --- a/src/H5RC.c +++ b/src/H5RC.c @@ -57,7 +57,7 @@ H5RC_create(void *o, H5RC_free_func_t free_func) { H5RC_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5RC_create, NULL) + FUNC_ENTER_NOAPI(NULL) /* Sanity check */ HDassert(o); @@ -101,7 +101,7 @@ H5RC_decr(H5RC_t *rc) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5RC_decr, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ HDassert(rc); diff --git a/src/H5RS.c b/src/H5RS.c index 06fc81e..dc6795e 100644 --- a/src/H5RS.c +++ b/src/H5RS.c @@ -63,7 +63,7 @@ H5RS_xstrdup(const char *s) { char *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5RS_xstrdup) + FUNC_ENTER_NOAPI_NOINIT_NOERR if(s) { size_t len = HDstrlen(s) + 1; @@ -103,7 +103,7 @@ H5RS_create(const char *s) { H5RS_str_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5RS_create, NULL) + FUNC_ENTER_NOAPI(NULL) /* Allocate ref-counted string structure */ if(NULL == (ret_value = H5FL_MALLOC(H5RS_str_t))) @@ -143,7 +143,7 @@ H5RS_wrap(const char *s) { H5RS_str_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5RS_wrap, NULL) + FUNC_ENTER_NOAPI(NULL) /* Allocate ref-counted string structure */ if(NULL == (ret_value = H5FL_MALLOC(H5RS_str_t))) @@ -185,7 +185,7 @@ H5RS_own(char *s) { H5RS_str_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5RS_own, NULL) + FUNC_ENTER_NOAPI(NULL) /* Allocate ref-counted string structure */ if(NULL == (ret_value = H5FL_MALLOC(H5RS_str_t))) @@ -223,7 +223,7 @@ done: herr_t H5RS_decr(H5RS_str_t *rs) { - FUNC_ENTER_NOAPI_NOFUNC(H5RS_decr) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ HDassert(rs); @@ -261,7 +261,7 @@ H5RS_decr(H5RS_str_t *rs) herr_t H5RS_incr(H5RS_str_t *rs) { - FUNC_ENTER_NOAPI_NOFUNC(H5RS_incr) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ HDassert(rs); @@ -305,7 +305,7 @@ H5RS_incr(H5RS_str_t *rs) H5RS_str_t * H5RS_dup(H5RS_str_t *ret_value) { - FUNC_ENTER_NOAPI_NOFUNC(H5RS_dup) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check for valid reference counted string */ if(ret_value != NULL) @@ -341,7 +341,7 @@ H5RS_dup_str(const char *s) size_t path_len; /* Length of the path */ H5RS_str_t *ret_value; - FUNC_ENTER_NOAPI(H5RS_dup_str, NULL) + FUNC_ENTER_NOAPI(NULL) /* Sanity check */ HDassert(s); @@ -389,7 +389,7 @@ int H5RS_cmp(const H5RS_str_t *rs1, const H5RS_str_t *rs2) { /* Can't return invalid value from this function */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5RS_cmp) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ HDassert(rs1); @@ -422,7 +422,7 @@ H5RS_cmp(const H5RS_str_t *rs1, const H5RS_str_t *rs2) ssize_t H5RS_len(const H5RS_str_t *rs) { - FUNC_ENTER_NOAPI_NOFUNC(H5RS_len) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ HDassert(rs); @@ -456,7 +456,7 @@ H5RS_len(const H5RS_str_t *rs) char * H5RS_get_str(const H5RS_str_t *rs) { - FUNC_ENTER_NOAPI_NOFUNC(H5RS_get_str) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ HDassert(rs); @@ -488,7 +488,7 @@ H5RS_get_str(const H5RS_str_t *rs) unsigned H5RS_get_count(const H5RS_str_t *rs) { - FUNC_ENTER_NOAPI_NOFUNC(H5RS_get_count) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ HDassert(rs); diff --git a/src/H5Rdeprec.c b/src/H5Rdeprec.c index 0e2acc8..d0c79a8 100644 --- a/src/H5Rdeprec.c +++ b/src/H5Rdeprec.c @@ -46,7 +46,7 @@ #include "H5Gprivate.h" /* Groups */ #include "H5Oprivate.h" /* Object headers */ #include "H5Rpkg.h" /* References */ - +#include "H5Ppublic.h" /* for using H5P_DATASET_ACCESS_DEFAULT */ #ifndef H5_NO_DEPRECATED_SYMBOLS /****************/ @@ -100,7 +100,7 @@ DESCRIPTION static herr_t H5R_init_deprec_interface(void) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5R_init_deprec_interface) + FUNC_ENTER_NOAPI_NOINIT_NOERR FUNC_LEAVE_NOAPI(H5R_init()) } /* H5R_init_deprec_interface() */ @@ -136,7 +136,7 @@ H5Rget_obj_type1(hid_t id, H5R_type_t ref_type, const void *ref) H5O_type_t obj_type; /* Object type */ H5G_obj_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Rget_obj_type1, H5G_UNKNOWN) + FUNC_ENTER_API(H5G_UNKNOWN) H5TRACE3("Go", "iRt*x", id, ref_type, ref); /* Check args */ @@ -158,5 +158,57 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Rget_obj_type1() */ + +/*-------------------------------------------------------------------------- + NAME + H5Rdereference1 + PURPOSE + Opens the HDF5 object referenced. + USAGE + hid_t H5Rdereference1(ref) + hid_t id; IN: Dataset reference object is in or location ID of + object that the dataset is located within. + H5R_type_t ref_type; IN: Type of reference to create + void *ref; IN: Reference to open. + + RETURNS + Valid ID on success, Negative on failure + DESCRIPTION + Given a reference to some object, open that object and return an ID for + that object. + GLOBAL VARIABLES + COMMENTS, BUGS, ASSUMPTIONS + EXAMPLES + REVISION LOG +--------------------------------------------------------------------------*/ +hid_t +H5Rdereference1(hid_t obj_id, H5R_type_t ref_type, const void *_ref) +{ + H5G_loc_t loc; /* Group location */ + H5F_t *file = NULL; /* File object */ + hid_t ret_value; + + FUNC_ENTER_API(FAIL) + H5TRACE3("i", "iRt*x", obj_id, ref_type, _ref); + + /* Check args */ + if(H5G_loc(obj_id, &loc) < 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") + if(ref_type <= H5R_BADTYPE || ref_type >= H5R_MAXTYPE) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid reference type") + if(_ref == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid reference pointer") + + /* Get the file pointer from the entry */ + file = loc.oloc->file; + + /* Create reference */ + if((ret_value = H5R_dereference(file, H5P_DATASET_ACCESS_DEFAULT, H5AC_dxpl_id, ref_type, _ref, TRUE)) < 0) + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTINIT, FAIL, "unable dereference object") + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5Rdereference1() */ + #endif /* H5_NO_DEPRECATED_SYMBOLS */ diff --git a/src/H5Rpkg.h b/src/H5Rpkg.h index 82382fb..8c66a90 100644 --- a/src/H5Rpkg.h +++ b/src/H5Rpkg.h @@ -57,6 +57,8 @@ H5_DLL herr_t H5R_init(void); H5_DLL herr_t H5R_get_obj_type(H5F_t *file, hid_t dxpl_id, H5R_type_t ref_type, const void *_ref, H5O_type_t *obj_type); +H5_DLL hid_t H5R_dereference(H5F_t *file, hid_t dapl_id, hid_t dxpl_id, H5R_type_t ref_type, + const void *_ref, hbool_t app_ref); #endif /* _H5Rpkg_H */ diff --git a/src/H5Rpublic.h b/src/H5Rpublic.h index 04d319b..997309f 100644 --- a/src/H5Rpublic.h +++ b/src/H5Rpublic.h @@ -60,7 +60,7 @@ extern "C" { /* Functions in H5R.c */ H5_DLL herr_t H5Rcreate(void *ref, hid_t loc_id, const char *name, H5R_type_t ref_type, hid_t space_id); -H5_DLL hid_t H5Rdereference(hid_t dataset, H5R_type_t ref_type, const void *ref); +H5_DLL hid_t H5Rdereference2(hid_t obj_id, hid_t oapl_id, H5R_type_t ref_type, const void *ref); H5_DLL hid_t H5Rget_region(hid_t dataset, H5R_type_t ref_type, const void *ref); H5_DLL herr_t H5Rget_obj_type2(hid_t id, H5R_type_t ref_type, const void *_ref, H5O_type_t *obj_type); @@ -81,6 +81,7 @@ H5_DLL ssize_t H5Rget_name(hid_t loc_id, H5R_type_t ref_type, const void *ref, /* Function prototypes */ H5_DLL H5G_obj_t H5Rget_obj_type1(hid_t id, H5R_type_t ref_type, const void *_ref); +H5_DLL hid_t H5Rdereference1(hid_t obj_id, H5R_type_t ref_type, const void *ref); #endif /* H5_NO_DEPRECATED_SYMBOLS */ diff --git a/src/H5S.c b/src/H5S.c index 21029ef..5d99066 100644 --- a/src/H5S.c +++ b/src/H5S.c @@ -75,7 +75,7 @@ H5S_init_interface(void) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5S_init_interface) + FUNC_ENTER_NOAPI_NOINIT /* Initialize the atom group for the file IDs */ if(H5I_register_type(H5I_DATASPACE, (size_t)H5I_DATASPACEID_HASHSIZE, H5S_RESERVED_ATOMS, (H5I_free_t)H5S_close) < 0) @@ -86,7 +86,7 @@ H5S_init_interface(void) /* Allow MPI buf-and-file-type optimizations? */ const char *s = HDgetenv ("HDF5_MPI_OPT_TYPES"); if (s && HDisdigit(*s)) - H5S_mpi_opt_types_g = (int)HDstrtol (s, NULL, 0); + H5S_mpi_opt_types_g = (hbool_t)HDstrtol (s, NULL, 0); } #endif /* H5_HAVE_PARALLEL */ @@ -117,7 +117,7 @@ H5S_term_interface(void) { int n = 0; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_term_interface) + FUNC_ENTER_NOAPI_NOINIT_NOERR if(H5_interface_initialize_g) { if((n = H5I_nmembers(H5I_DATASPACE))) { @@ -161,7 +161,7 @@ H5S_create(H5S_class_t type) H5S_t *new_ds = NULL; /* New dataspace created */ H5S_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5S_create, NULL) + FUNC_ENTER_NOAPI(NULL) /* Create a new dataspace */ if(NULL == (new_ds = H5FL_MALLOC(H5S_t))) @@ -186,6 +186,7 @@ H5S_create(H5S_class_t type) new_ds->extent.nelem = 0; break; + case H5S_NO_CLASS: default: HDassert("unknown dataspace (extent) type" && 0); break; @@ -239,7 +240,7 @@ H5Screate(H5S_class_t type) H5S_t *new_ds=NULL; /* New dataspace structure */ hid_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Screate, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("i", "Sc", type); /* Check args */ @@ -282,7 +283,7 @@ H5S_extent_release(H5S_extent_t *extent) { herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5S_extent_release, FAIL) + FUNC_ENTER_NOAPI(FAIL) assert(extent); @@ -316,7 +317,7 @@ H5S_close(H5S_t *ds) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5S_close, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert(ds); @@ -357,7 +358,7 @@ H5Sclose(hid_t space_id) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Sclose, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", space_id); /* Check args */ @@ -396,7 +397,7 @@ H5Scopy(hid_t space_id) H5S_t *dst = NULL; hid_t ret_value; - FUNC_ENTER_API(H5Scopy, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("i", "i", space_id); /* Check args */ @@ -442,7 +443,7 @@ H5Sextent_copy(hid_t dst_id,hid_t src_id) H5S_t *dst; hid_t ret_value = SUCCEED; - FUNC_ENTER_API(H5Sextent_copy, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "ii", dst_id, src_id); /* Check args */ @@ -480,7 +481,7 @@ H5S_extent_copy(H5S_extent_t *dst, const H5S_extent_t *src, hbool_t copy_max) unsigned u; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5S_extent_copy, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Copy the regular fields */ dst->type = src->type; @@ -512,6 +513,7 @@ H5S_extent_copy(H5S_extent_t *dst, const H5S_extent_t *src, hbool_t copy_max) dst->max = NULL; break; + case H5S_NO_CLASS: default: HDassert("unknown dataspace type" && 0); break; @@ -553,7 +555,7 @@ H5S_copy(const H5S_t *src, hbool_t share_selection, hbool_t copy_max) H5S_t *dst = NULL; H5S_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5S_copy, NULL) + FUNC_ENTER_NOAPI(NULL) if(NULL == (dst = H5FL_MALLOC(H5S_t))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") @@ -604,7 +606,7 @@ H5S_get_simple_extent_npoints(const H5S_t *ds) { hssize_t ret_value; - FUNC_ENTER_NOAPI(H5S_get_simple_extent_npoints, -1) + FUNC_ENTER_NOAPI(-1) /* check args */ HDassert(ds); @@ -640,7 +642,7 @@ H5Sget_simple_extent_npoints(hid_t space_id) H5S_t *ds; hssize_t ret_value; - FUNC_ENTER_API(H5Sget_simple_extent_npoints, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("Hs", "i", space_id); /* Check args */ @@ -681,7 +683,7 @@ H5S_get_npoints_max(const H5S_t *ds) hsize_t ret_value; unsigned u; - FUNC_ENTER_NOAPI(H5S_get_npoints_max, 0) + FUNC_ENTER_NOAPI(0) /* check args */ assert(ds); @@ -712,6 +714,7 @@ H5S_get_npoints_max(const H5S_t *ds) } break; + case H5S_NO_CLASS: default: assert("unknown dataspace class" && 0); HGOTO_ERROR(H5E_DATASPACE, H5E_UNSUPPORTED, 0, "internal error (unknown dataspace class)") @@ -744,7 +747,7 @@ H5Sget_simple_extent_ndims(hid_t space_id) H5S_t *ds; int ret_value; - FUNC_ENTER_API(H5Sget_simple_extent_ndims, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("Is", "i", space_id); /* Check args */ @@ -784,7 +787,7 @@ H5S_get_simple_extent_ndims(const H5S_t *ds) { int ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5S_get_simple_extent_ndims, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* check args */ HDassert(ds); @@ -796,6 +799,7 @@ H5S_get_simple_extent_ndims(const H5S_t *ds) ret_value = (int)ds->extent.rank; break; + case H5S_NO_CLASS: default: HDassert("unknown dataspace class" && 0); HGOTO_ERROR(H5E_DATASPACE, H5E_UNSUPPORTED, FAIL, "internal error (unknown dataspace class)") @@ -835,7 +839,7 @@ H5Sget_simple_extent_dims(hid_t space_id, hsize_t dims[]/*out*/, H5S_t *ds; int ret_value; - FUNC_ENTER_API(H5Sget_simple_extent_dims, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("Is", "ixx", space_id, dims, maxdims); /* Check args */ @@ -869,7 +873,7 @@ H5S_extent_get_dims(const H5S_extent_t *ext, hsize_t dims[], hsize_t max_dims[]) int i; /* Local index variable */ int ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5S_extent_get_dims, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* check args */ HDassert(ext); @@ -894,6 +898,7 @@ H5S_extent_get_dims(const H5S_extent_t *ext, hsize_t dims[], hsize_t max_dims[]) } /* end for */ break; + case H5S_NO_CLASS: default: HDassert("unknown dataspace class" && 0); HGOTO_ERROR(H5E_DATASPACE, H5E_UNSUPPORTED, FAIL, "internal error (unknown dataspace class)") @@ -926,7 +931,7 @@ H5S_get_simple_extent_dims(const H5S_t *ds, hsize_t dims[], hsize_t max_dims[]) { int ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5S_get_simple_extent_dims, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* check args */ HDassert(ds); @@ -958,7 +963,7 @@ H5S_write(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned update_flags, H5S_t *ds) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5S_write, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert(f); HDassert(oh); @@ -999,7 +1004,7 @@ H5S_append(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5S_t *ds) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5S_append, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert(f); HDassert(oh); @@ -1035,7 +1040,7 @@ H5S_read(const H5O_loc_t *loc, hid_t dxpl_id) H5S_t *ds = NULL; /* Dataspace to return */ H5S_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5S_read, NULL) + FUNC_ENTER_NOAPI(NULL) /* check args */ HDassert(loc); @@ -1082,7 +1087,7 @@ H5S_is_simple(const H5S_t *sdim) { htri_t ret_value; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_is_simple) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args and all the boring stuff. */ HDassert(sdim); @@ -1115,7 +1120,7 @@ H5Sis_simple(hid_t space_id) H5S_t *space; /* dataspace to modify */ htri_t ret_value; - FUNC_ENTER_API(H5Sis_simple, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("t", "i", space_id); /* Check args and all the boring stuff. */ @@ -1172,7 +1177,7 @@ H5Sset_extent_simple(hid_t space_id, int rank, const hsize_t dims[/*rank*/], int u; /* local counting variable */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Sset_extent_simple, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE4("e", "iIs*[a1]h*[a1]h", space_id, rank, dims, max); /* Check args */ @@ -1228,7 +1233,7 @@ H5S_set_extent_simple(H5S_t *space, unsigned rank, const hsize_t *dims, unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5S_set_extent_simple) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(rank <= H5S_MAX_RANK); @@ -1321,7 +1326,7 @@ H5Screate_simple(int rank, const hsize_t dims[/*rank*/], int i; hid_t ret_value; - FUNC_ENTER_API(H5Screate_simple, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("i", "Is*[a0]h*[a0]h", rank, dims, maxdims); /* Check arguments */ @@ -1387,7 +1392,7 @@ H5S_create_simple(unsigned rank, const hsize_t dims[/*rank*/], { H5S_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5S_create_simple, NULL) + FUNC_ENTER_NOAPI(NULL) /* Check arguments */ assert(rank <=H5S_MAX_RANK); @@ -1427,7 +1432,7 @@ H5Sencode(hid_t obj_id, void *buf, size_t *nalloc) H5S_t *dspace; herr_t ret_value=SUCCEED; - FUNC_ENTER_API (H5Sencode, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("e", "i*x*z", obj_id, buf, nalloc); /* Check argument and retrieve object */ @@ -1467,7 +1472,7 @@ H5S_encode(H5S_t *obj, unsigned char *buf, size_t *nalloc) H5F_t *f = NULL; /* Fake file structure*/ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT(H5S_encode) + FUNC_ENTER_NOAPI_NOINIT /* Allocate "fake" file structure */ if(NULL == (f = H5F_fake_alloc((uint8_t)0))) @@ -1540,7 +1545,7 @@ H5Sdecode(const void *buf) H5S_t *ds; hid_t ret_value; - FUNC_ENTER_API (H5Sdecode, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("i", "*x", buf); if(buf == NULL) @@ -1584,7 +1589,7 @@ H5S_decode(const unsigned char *buf) uint8_t sizeof_size; /* 'Size of sizes' for file */ H5S_t *ret_value; - FUNC_ENTER_NOAPI_NOINIT(H5S_decode) + FUNC_ENTER_NOAPI_NOINIT /* Decode the type of the information */ if(*buf++ != H5O_SDSPACE_ID) @@ -1666,7 +1671,7 @@ H5S_get_simple_extent_type(const H5S_t *space) { H5S_class_t ret_value; - FUNC_ENTER_NOAPI(H5S_get_simple_extent_type, H5S_NO_CLASS) + FUNC_ENTER_NOAPI(H5S_NO_CLASS) assert(space); @@ -1701,7 +1706,7 @@ H5Sget_simple_extent_type(hid_t sid) H5S_t *space; H5S_class_t ret_value; - FUNC_ENTER_API(H5Sget_simple_extent_type, H5S_NO_CLASS) + FUNC_ENTER_API(H5S_NO_CLASS) H5TRACE1("Sc", "i", sid); /* Check arguments */ @@ -1735,7 +1740,7 @@ H5Sset_extent_none(hid_t space_id) H5S_t *space; /* dataspace to modify */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Sset_extent_none, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", space_id); /* Check args */ @@ -1775,7 +1780,7 @@ H5Soffset_simple(hid_t space_id, const hssize_t *offset) H5S_t *space; /* dataspace to modify */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Soffset_simple, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*Hs", space_id, offset); /* Check args */ @@ -1815,7 +1820,7 @@ H5S_set_extent(H5S_t *space, const hsize_t *size) unsigned u; /* Local index variable */ htri_t ret_value = FALSE; /* Return value */ - FUNC_ENTER_NOAPI(H5S_set_extent, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args */ HDassert(space && H5S_SIMPLE == H5S_GET_EXTENT_TYPE(space)); @@ -1827,7 +1832,7 @@ H5S_set_extent(H5S_t *space, const hsize_t *size) /* Check for invalid dimension size modification */ if(space->extent.max && H5S_UNLIMITED != space->extent.max[u] && space->extent.max[u] < size[u]) - HGOTO_ERROR(H5E_DATASPACE, H5E_BADVALUE, FAIL, "dimension cannot exceed the existing maximal size") + HGOTO_ERROR(H5E_DATASPACE, H5E_BADVALUE, FAIL, "dimension cannot exceed the existing maximal size (new: %llu max: %llu)", (unsigned long long)size[u], (unsigned long long)space->extent.max[u]) /* Indicate that dimension size can be modified */ ret_value = TRUE; @@ -1864,7 +1869,7 @@ H5S_has_extent(const H5S_t *ds) { hbool_t ret_value; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_has_extent) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(ds); @@ -1897,7 +1902,7 @@ H5S_set_extent_real(H5S_t *space, const hsize_t *size) unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5S_set_extent_real, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args */ HDassert(space && H5S_SIMPLE == H5S_GET_EXTENT_TYPE(space)); @@ -1944,7 +1949,7 @@ H5Sextent_equal(hid_t space1_id, hid_t space2_id) const H5S_t *ds1, *ds2; /* Dataspaces to compare */ htri_t ret_value; - FUNC_ENTER_API(H5Sextent_equal, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("t", "ii", space1_id, space2_id); /* check args */ @@ -1980,7 +1985,7 @@ H5S_extent_equal(const H5S_t *ds1, const H5S_t *ds2) unsigned u; /* Local index variable */ htri_t ret_value = TRUE; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_extent_equal) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(ds1); @@ -2038,7 +2043,7 @@ done: hsize_t H5S_extent_nelem(const H5S_extent_t *ext) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_extent_nelem) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ HDassert(ext); @@ -2063,9 +2068,7 @@ H5S_extent_nelem(const H5S_extent_t *ext) herr_t H5S_set_latest_version(H5S_t *ds) { - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5S_set_latest_version, FAIL) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ HDassert(ds); @@ -2073,8 +2076,7 @@ H5S_set_latest_version(H5S_t *ds) /* Set encoding of extent to latest version */ ds->extent.version = H5O_SDSPACE_VERSION_LATEST; -done: - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5S_set_latest_version() */ #ifndef H5_NO_DEPRECATED_SYMBOLS @@ -2099,7 +2101,7 @@ H5S_extend(H5S_t *space, const hsize_t *size) unsigned u; int ret_value = 0; - FUNC_ENTER_NOAPI(H5S_extend, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args */ HDassert(space && H5S_SIMPLE == H5S_GET_EXTENT_TYPE(space)); diff --git a/src/H5SL.c b/src/H5SL.c index c996392..b6c9f8e 100644 --- a/src/H5SL.c +++ b/src/H5SL.c @@ -82,32 +82,42 @@ /* 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) \ +#define H5SL_LOCATE_SCALAR_CMP(SLIST, 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) \ +#define H5SL_LOCATE_STRING_CMP(SLIST, TYPE, PNODE, PKEY, 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) \ - ((((TYPE *)((PNODE)->key))->fileno < ((TYPE *)PKEY)->fileno) ? TRUE : (((TYPE *)((PNODE)->key))->addr < ((TYPE *)PKEY)->addr)) +#define H5SL_LOCATE_OBJ_CMP(SLIST, TYPE, PNODE, PKEY, HASHVAL) \ + ((((TYPE *)((PNODE)->key))->fileno == ((TYPE *)PKEY)->fileno) \ + ? (((TYPE *)((PNODE)->key))->addr < ((TYPE *)PKEY)->addr) \ + : (((TYPE *)((PNODE)->key))->fileno < ((TYPE *)PKEY)->fileno)) + +/* Define a code template for comparing generic keys for the "CMP" in the H5SL_LOCATE macro */ +#define H5SL_LOCATE_GENERIC_CMP(SLIST, TYPE, PNODE, PKEY, HASHVAL) \ + ((SLIST)->cmp((TYPE *)((PNODE)->key), (TYPE *)PKEY) < 0) /* Define a code template for comparing scalar keys for the "EQ" in the H5SL_LOCATE macro */ -#define H5SL_LOCATE_SCALAR_EQ(TYPE, PNODE, PKEY, HASHVAL) \ +#define H5SL_LOCATE_SCALAR_EQ(SLIST, TYPE, PNODE, PKEY, HASHVAL) \ (*(TYPE *)((PNODE)->key) == *(TYPE *)PKEY) /* 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) \ +#define H5SL_LOCATE_STRING_EQ(SLIST, TYPE, PNODE, PKEY, HASHVAL) \ (((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) \ +#define H5SL_LOCATE_OBJ_EQ(SLIST, TYPE, PNODE, PKEY, HASHVAL) \ ((((TYPE *)((PNODE)->key))->fileno == ((TYPE *)PKEY)->fileno) && (((TYPE *)((PNODE)->key))->addr == ((TYPE *)PKEY)->addr)) +/* Define a code template for comparing generic keys for the "EQ" in the H5SL_LOCATE macro */ +#define H5SL_LOCATE_GENERIC_EQ(SLIST, TYPE, PNODE, PKEY, HASHVAL) \ + ((SLIST)->cmp((TYPE *)((PNODE)->key), (TYPE *)PKEY) == 0) + /* Define a code template for initializing the hash value for scalar keys for the "HASHINIT" in the H5SL_LOCATE macro */ #define H5SL_LOCATE_SCALAR_HASHINIT(KEY, HASHVAL) @@ -119,6 +129,9 @@ /* 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) +/* Define a code template for initializing the hash value for generic keys for the "HASHINIT" in the H5SL_LOCATE macro */ +#define H5SL_LOCATE_GENERIC_HASHINIT(KEY, HASHVAL) + /* Macro used to find node for operation */ #define H5SL_LOCATE(OP, CMP, SLIST, X, TYPE, KEY, HASHVAL) \ @@ -130,15 +143,15 @@ for(_i = (int)SLIST->curr_level; _i >= 0; _i--) { \ _count = 0; \ while(_count < 3 && X->forward[_i] && \ - H5_GLUE3(H5SL_LOCATE_,CMP,_CMP)(TYPE, X->forward[_i], KEY, HASHVAL) ) { \ + H5_GLUE3(H5SL_LOCATE_,CMP,_CMP)(SLIST, 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) ) { \ + if(X != NULL && H5_GLUE3(H5SL_LOCATE_,CMP,_EQ)(SLIST, TYPE, X, KEY, HASHVAL) ) { \ /* What to do when a node is found */ \ - H5_GLUE3(H5SL_LOCATE_,OP,_FOUND)(SLIST, X, _i) \ + H5_GLUE3(H5SL_LOCATE_,OP,_FOUND)(SLIST, X, _i) \ } /* end if */ \ } @@ -266,7 +279,7 @@ } /* 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)) \ + if(!_drop && !H5_GLUE3(H5SL_LOCATE_,CMP,_CMP)(SLIST, TYPE, X->forward[_i], KEY, HASHVAL)) \ _drop = X; \ \ /* No need to check the last node in the gap if there are 3, as */ \ @@ -280,7 +293,7 @@ X = X->forward[_i]; \ } /* end for */ \ HDassert(!_drop->forward[_i] || \ - !H5_GLUE3(H5SL_LOCATE_,CMP,_CMP)(TYPE, _drop->forward[_i], KEY, HASHVAL)); \ + !H5_GLUE3(H5SL_LOCATE_,CMP,_CMP)(SLIST, TYPE, _drop->forward[_i], KEY, HASHVAL)); \ \ /* Promote the middle node if necessary */ \ if(_count == 3) { \ @@ -293,7 +306,7 @@ _next = _drop->forward[_i]; \ } /* end for */ \ \ - if(_next && H5_GLUE3(H5SL_LOCATE_,CMP,_EQ)(TYPE, _next, KEY, HASHVAL)) \ + if(_next && H5_GLUE3(H5SL_LOCATE_,CMP,_EQ)(SLIST, TYPE, _next, KEY, HASHVAL)) \ HGOTO_ERROR(H5E_SLIST, H5E_CANTINSERT, NULL, "can't insert duplicate key") \ } @@ -316,7 +329,7 @@ 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))) { \ + while(X && (!X->key || H5_GLUE3(H5SL_LOCATE_,CMP,_CMP)(SLIST, TYPE, X, KEY, HASHVAL))) { \ _llast = _last; \ _last = X; \ X = X->forward[_i]; \ @@ -347,7 +360,7 @@ 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)) { \ + if (!H5_GLUE3(H5SL_LOCATE_,CMP,_CMP)(SLIST, TYPE, X->forward[_i], KEY, HASHVAL)) { \ _drop = X; \ /* Again check if we can stop searching */ \ if(_count) { \ @@ -370,7 +383,7 @@ } /* end for */ \ HDassert(_count >= 1 && _count <= 3); \ HDassert(!_drop->forward[_i] || \ - !H5_GLUE3(H5SL_LOCATE_,CMP,_CMP)(TYPE, _drop->forward[_i], KEY, HASHVAL)); \ + !H5_GLUE3(H5SL_LOCATE_,CMP,_CMP)(SLIST, TYPE, _drop->forward[_i], KEY, HASHVAL)); \ \ /* Check if we need to adjust node heights */ \ if(_count == 1) { \ @@ -431,7 +444,7 @@ } /* end for */ \ \ /* Check if we've found the node */ \ - if(_next && H5_GLUE3(H5SL_LOCATE_,CMP,_EQ)(TYPE, _next, KEY, HASHVAL)) { \ + if(_next && H5_GLUE3(H5SL_LOCATE_,CMP,_EQ)(SLIST, TYPE, _next, KEY, HASHVAL)) { \ void *tmp = _next->item; \ X = _next; \ \ @@ -485,6 +498,7 @@ struct H5SL_node_t { struct H5SL_t { /* Static values for each list */ H5SL_type_t type; /* Type of skip list */ + H5SL_cmp_t cmp; /* Comparison callback, if type is H5SL_TYPE_GENERIC */ /* Dynamic values for each list */ int curr_level; /* Current top level used in list */ @@ -531,7 +545,7 @@ static size_t H5SL_fac_nalloc_g; static herr_t H5SL_init_interface(void) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5SL_init_interface) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Allocate space for array of factories */ H5SL_fac_g = (H5FL_fac_head_t **)H5MM_malloc(sizeof(H5FL_fac_head_t *)); @@ -572,7 +586,7 @@ H5SL_new_node(void *item, const void *key, uint32_t hashval) { H5SL_node_t *ret_value; /* New skip list node */ - FUNC_ENTER_NOAPI_NOINIT(H5SL_new_node) + FUNC_ENTER_NOAPI_NOINIT /* Allocate the node */ if(NULL == (ret_value = (H5SL_node_t *)H5FL_MALLOC(H5SL_node_t))) @@ -623,7 +637,7 @@ H5SL_insert_common(H5SL_t *slist, void *item, const void *key) uint32_t hashval = 0; /* Hash value for key */ H5SL_node_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5SL_insert_common); + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(slist); @@ -667,6 +681,10 @@ H5SL_insert_common(H5SL_t *slist, void *item, const void *key) H5SL_INSERT(OBJ, slist, prev, const H5_obj_t, key, -) break; + case H5SL_TYPE_GENERIC: + H5SL_INSERT(GENERIC, slist, prev, const void, key, -) + break; + default: HDassert(0 && "Unknown skiplist type!"); } /* end switch */ @@ -699,7 +717,7 @@ H5SL_insert_common(H5SL_t *slist, void *item, const void *key) ret_value=x; done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* end H5SL_insert_common() */ @@ -733,7 +751,7 @@ H5SL_release_common(H5SL_t *slist, H5SL_operator_t op, void *op_data) H5SL_node_t *node, *next_node; /* Pointers to skip list nodes */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT(H5SL_release_common); + FUNC_ENTER_NOAPI_NOINIT /* Check args */ assert(slist); @@ -772,7 +790,7 @@ H5SL_release_common(H5SL_t *slist, H5SL_operator_t op, void *op_data) slist->nobjs=0; done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* end H5SL_release_common() */ @@ -804,7 +822,7 @@ H5SL_close_common(H5SL_t *slist, H5SL_operator_t op, void *op_data) { herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT(H5SL_close_common) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(slist); @@ -834,7 +852,7 @@ done: PURPOSE Create a skip list USAGE - H5SL_t *H5SL_create(H5SL_type_t type) + H5SL_t *H5SL_create(H5SL_type_t type, H5SL_cmp_t cmp) RETURNS Returns a pointer to a skip list on success, NULL on failure. @@ -846,16 +864,16 @@ done: REVISION LOG --------------------------------------------------------------------------*/ H5SL_t * -H5SL_create(H5SL_type_t type) +H5SL_create(H5SL_type_t type, H5SL_cmp_t cmp) { H5SL_t *new_slist = NULL; /* Pointer to new skip list object created */ H5SL_node_t *header; /* Pointer to skip list header node */ H5SL_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5SL_create,NULL); + FUNC_ENTER_NOAPI(NULL) /* Check args */ - HDassert(type>=H5SL_TYPE_INT && type<=H5SL_TYPE_OBJ); + HDassert(type>=H5SL_TYPE_INT && type<=H5SL_TYPE_GENERIC); /* Allocate skip list structure */ if(NULL == (new_slist = H5FL_MALLOC(H5SL_t))) @@ -863,6 +881,8 @@ H5SL_create(H5SL_type_t type) /* Set the static internal fields */ new_slist->type = type; + HDassert((type == H5SL_TYPE_GENERIC) == !!cmp); + new_slist->cmp = cmp; /* Set the dynamic internal fields */ new_slist->curr_level = -1; @@ -917,7 +937,7 @@ done: size_t H5SL_count(H5SL_t *slist) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5SL_count); + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ assert(slist); @@ -925,7 +945,7 @@ H5SL_count(H5SL_t *slist) /* Check internal consistency */ /* (Pre-condition) */ - FUNC_LEAVE_NOAPI(slist->nobjs); + FUNC_LEAVE_NOAPI(slist->nobjs) } /* end H5SL_count() */ @@ -955,7 +975,7 @@ H5SL_insert(H5SL_t *slist, void *item, const void *key) { herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5SL_insert); + FUNC_ENTER_NOAPI_NOINIT /* Check args */ assert(slist); @@ -969,7 +989,7 @@ H5SL_insert(H5SL_t *slist, void *item, const void *key) HGOTO_ERROR(H5E_SLIST,H5E_CANTINSERT,FAIL,"can't create new skip list node") done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* end H5SL_insert() */ @@ -1002,7 +1022,7 @@ H5SL_add(H5SL_t *slist, void *item, const void *key) { H5SL_node_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5SL_add); + FUNC_ENTER_NOAPI_NOINIT /* Check args */ assert(slist); @@ -1016,7 +1036,7 @@ H5SL_add(H5SL_t *slist, void *item, const void *key) HGOTO_ERROR(H5E_SLIST,H5E_CANTINSERT,NULL,"can't create new skip list node") done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* end H5SL_add() */ @@ -1046,7 +1066,7 @@ H5SL_remove(H5SL_t *slist, const void *key) uint32_t hashval = 0; /* Hash value for key */ void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5SL_remove) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(slist); @@ -1090,6 +1110,10 @@ H5SL_remove(H5SL_t *slist, const void *key) H5SL_REMOVE(OBJ, slist, x, const H5_obj_t, key, -) break; + case H5SL_TYPE_GENERIC: + H5SL_REMOVE(GENERIC, slist, x, const void, key, -) + break; + default: HDassert(0 && "Unknown skiplist type!"); } /* end switch */ @@ -1127,7 +1151,7 @@ H5SL_remove_first(H5SL_t *slist) size_t level = slist->curr_level; /* Skip list level */ size_t i; /* Index */ - FUNC_ENTER_NOAPI_NOINIT(H5SL_remove_first) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(slist); @@ -1225,7 +1249,7 @@ H5SL_search(H5SL_t *slist, const void *key) uint32_t hashval = 0; /* Hash value for key */ void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5SL_search); + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ assert(slist); @@ -1269,6 +1293,10 @@ H5SL_search(H5SL_t *slist, const void *key) H5SL_SEARCH(OBJ, slist, x, const H5_obj_t, key, -) break; + case H5SL_TYPE_GENERIC: + H5SL_SEARCH(GENERIC, slist, x, const void, key, -) + break; + default: HDassert(0 && "Unknown skiplist type!"); } /* end switch */ @@ -1277,7 +1305,7 @@ H5SL_search(H5SL_t *slist, const void *key) ret_value=NULL; done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* end H5SL_search() */ @@ -1310,7 +1338,7 @@ H5SL_less(H5SL_t *slist, const void *key) uint32_t hashval = 0; /* Hash value for key */ void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5SL_less); + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ assert(slist); @@ -1354,6 +1382,10 @@ H5SL_less(H5SL_t *slist, const void *key) H5SL_SEARCH(OBJ, slist, x, const H5_obj_t, key, -) break; + case H5SL_TYPE_GENERIC: + H5SL_SEARCH(GENERIC, slist, x, const void, key, -) + break; + default: HDassert(0 && "Unknown skiplist type!"); } /* end switch */ @@ -1375,7 +1407,7 @@ H5SL_less(H5SL_t *slist, const void *key) } /* end else */ done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* end H5SL_less() */ @@ -1408,7 +1440,7 @@ H5SL_greater(H5SL_t *slist, const void *key) uint32_t hashval = 0; /* Hash value for key */ void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5SL_greater); + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(slist); @@ -1452,6 +1484,10 @@ H5SL_greater(H5SL_t *slist, const void *key) H5SL_SEARCH(OBJ, slist, x, const H5_obj_t, key, -) break; + case H5SL_TYPE_GENERIC: + H5SL_SEARCH(GENERIC, slist, x, const void, key, -) + break; + default: HDassert(0 && "Unknown skiplist type!"); } /* end switch */ @@ -1464,7 +1500,7 @@ H5SL_greater(H5SL_t *slist, const void *key) ret_value = NULL; done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* end H5SL_greater() */ @@ -1496,7 +1532,7 @@ H5SL_find(H5SL_t *slist, const void *key) uint32_t hashval = 0; /* Hash value for key */ H5SL_node_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5SL_find); + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ assert(slist); @@ -1540,6 +1576,10 @@ H5SL_find(H5SL_t *slist, const void *key) H5SL_FIND(OBJ, slist, x, const H5_obj_t, key, -) break; + case H5SL_TYPE_GENERIC: + H5SL_FIND(GENERIC, slist, x, const void, key, -) + break; + default: HDassert(0 && "Unknown skiplist type!"); } /* end switch */ @@ -1548,7 +1588,7 @@ H5SL_find(H5SL_t *slist, const void *key) ret_value=NULL; done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* end H5SL_find() */ @@ -1581,7 +1621,7 @@ H5SL_below(H5SL_t *slist, const void *key) uint32_t hashval = 0; /* Hash value for key */ H5SL_node_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5SL_below) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(slist); @@ -1624,6 +1664,10 @@ H5SL_below(H5SL_t *slist, const void *key) case H5SL_TYPE_OBJ: H5SL_FIND(OBJ, slist, x, const H5_obj_t, key, -) break; + + case H5SL_TYPE_GENERIC: + H5SL_FIND(GENERIC, slist, x, const void, key, -) + break; } /* end switch */ /* An exact match for 'key' must not have been found in list, if we get here */ @@ -1676,7 +1720,7 @@ H5SL_above(H5SL_t *slist, const void *key) uint32_t hashval = 0; /* Hash value for key */ H5SL_node_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5SL_above) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(slist); @@ -1719,6 +1763,10 @@ H5SL_above(H5SL_t *slist, const void *key) case H5SL_TYPE_OBJ: H5SL_FIND(OBJ, slist, x, const H5_obj_t, key, -) break; + + case H5SL_TYPE_GENERIC: + H5SL_FIND(GENERIC, slist, x, const void, key, -) + break; } /* end switch */ /* An exact match for 'key' must not have been found in list, if we get here */ @@ -1755,7 +1803,7 @@ done: H5SL_node_t * H5SL_first(H5SL_t *slist) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5SL_first); + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ assert(slist); @@ -1763,7 +1811,7 @@ H5SL_first(H5SL_t *slist) /* Check internal consistency */ /* (Pre-condition) */ - FUNC_LEAVE_NOAPI(slist->header->forward[0]); + FUNC_LEAVE_NOAPI(slist->header->forward[0]) } /* end H5SL_first() */ @@ -1789,7 +1837,7 @@ H5SL_first(H5SL_t *slist) H5SL_node_t * H5SL_next(H5SL_node_t *slist_node) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5SL_next); + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ assert(slist_node); @@ -1797,7 +1845,7 @@ H5SL_next(H5SL_node_t *slist_node) /* Check internal consistency */ /* (Pre-condition) */ - FUNC_LEAVE_NOAPI(slist_node->forward[0]); + FUNC_LEAVE_NOAPI(slist_node->forward[0]) } /* end H5SL_next() */ @@ -1823,7 +1871,7 @@ H5SL_next(H5SL_node_t *slist_node) H5SL_node_t * H5SL_prev(H5SL_node_t *slist_node) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5SL_prev); + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ assert(slist_node); @@ -1832,7 +1880,7 @@ H5SL_prev(H5SL_node_t *slist_node) /* (Pre-condition) */ /* Walk backward, detecting the header node (which has it's key set to NULL) */ - FUNC_LEAVE_NOAPI(slist_node->backward->key==NULL ? NULL : slist_node->backward); + FUNC_LEAVE_NOAPI(slist_node->backward->key==NULL ? NULL : slist_node->backward) } /* end H5SL_prev() */ @@ -1858,7 +1906,7 @@ H5SL_prev(H5SL_node_t *slist_node) H5SL_node_t * H5SL_last(H5SL_t *slist) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5SL_last); + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ assert(slist); @@ -1867,7 +1915,7 @@ H5SL_last(H5SL_t *slist) /* (Pre-condition) */ /* Find last node, avoiding the header node */ - FUNC_LEAVE_NOAPI(slist->last==slist->header ? NULL : slist->last); + FUNC_LEAVE_NOAPI(slist->last==slist->header ? NULL : slist->last) } /* end H5SL_last() */ @@ -1892,7 +1940,7 @@ H5SL_last(H5SL_t *slist) void * H5SL_item(H5SL_node_t *slist_node) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5SL_item); + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ assert(slist_node); @@ -1900,7 +1948,7 @@ H5SL_item(H5SL_node_t *slist_node) /* Check internal consistency */ /* (Pre-condition) */ - FUNC_LEAVE_NOAPI(slist_node->item); + FUNC_LEAVE_NOAPI(slist_node->item) } /* end H5SL_item() */ @@ -1943,7 +1991,7 @@ H5SL_iterate(H5SL_t *slist, H5SL_operator_t op, void *op_data) H5SL_node_t *node; /* Pointers to skip list nodes */ herr_t ret_value = 0; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5SL_iterate) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(slist); @@ -1989,7 +2037,7 @@ H5SL_iterate(H5SL_t *slist, H5SL_operator_t op, void *op_data) herr_t H5SL_release(H5SL_t *slist) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5SL_release); + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ assert(slist); @@ -2000,7 +2048,7 @@ H5SL_release(H5SL_t *slist) /* Free skip list nodes */ H5SL_release_common(slist,NULL,NULL); /* always succeeds */ - FUNC_LEAVE_NOAPI(SUCCEED); + FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5SL_release() */ @@ -2035,7 +2083,7 @@ H5SL_release(H5SL_t *slist) herr_t H5SL_free(H5SL_t *slist, H5SL_operator_t op, void *op_data) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5SL_free); + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ assert(slist); @@ -2046,7 +2094,7 @@ H5SL_free(H5SL_t *slist, H5SL_operator_t op, void *op_data) /* Free skip list nodes */ H5SL_release_common(slist,op,op_data); /* always succeeds */ - FUNC_LEAVE_NOAPI(SUCCEED); + FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5SL_free() */ @@ -2081,7 +2129,7 @@ H5SL_destroy(H5SL_t *slist, H5SL_operator_t op, void *op_data) { herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5SL_destroy); + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ assert(slist); @@ -2092,7 +2140,7 @@ H5SL_destroy(H5SL_t *slist, H5SL_operator_t op, void *op_data) /* Close skip list */ (void)H5SL_close_common(slist,op,op_data); /* always succeeds */ - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* end H5SL_destroy() */ @@ -2118,7 +2166,7 @@ H5SL_destroy(H5SL_t *slist, H5SL_operator_t op, void *op_data) herr_t H5SL_close(H5SL_t *slist) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5SL_close); + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ assert(slist); @@ -2129,7 +2177,7 @@ H5SL_close(H5SL_t *slist) /* Close skip list */ (void)H5SL_close_common(slist,NULL,NULL); /* always succeeds */ - FUNC_LEAVE_NOAPI(SUCCEED); + FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5SL_close() */ @@ -2158,7 +2206,7 @@ int H5SL_term_interface(void) herr_t ret; int n = H5_interface_initialize_g ? 1 : 0; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5SL_term_interface) + FUNC_ENTER_NOAPI_NOINIT_NOERR if(n) { /* Terminate all the factories */ @@ -2176,6 +2224,6 @@ int H5SL_term_interface(void) H5_interface_initialize_g = 0; } /* end if */ - FUNC_LEAVE_NOAPI(n); + FUNC_LEAVE_NOAPI(n) } /* H5SL_term_interface() */ diff --git a/src/H5SLprivate.h b/src/H5SLprivate.h index 40fbfa9..07ee414 100644 --- a/src/H5SLprivate.h +++ b/src/H5SLprivate.h @@ -47,13 +47,17 @@ typedef enum { H5SL_TYPE_HSIZE, /* Skip list keys are 'hsize_t's */ H5SL_TYPE_UNSIGNED, /* Skip list keys are 'unsigned's */ H5SL_TYPE_SIZE, /* Skip list keys are 'size_t's */ - H5SL_TYPE_OBJ /* Skip list keys are 'H5_obj_t's */ + H5SL_TYPE_OBJ, /* Skip list keys are 'H5_obj_t's */ + H5SL_TYPE_GENERIC /* Skip list keys are unknown, comparison callback supplied */ } H5SL_type_t; /**********/ /* Macros */ /**********/ +/* Typedef for comparison operations */ +typedef int (*H5SL_cmp_t)(const void *key1, const void *key2); + /* Typedef for iteration operations */ typedef herr_t (*H5SL_operator_t)(void *item, void *key, void *operator_data/*in,out*/); @@ -61,7 +65,7 @@ typedef herr_t (*H5SL_operator_t)(void *item, void *key, /********************/ /* Private routines */ /********************/ -H5_DLL H5SL_t *H5SL_create(H5SL_type_t type); +H5_DLL H5SL_t *H5SL_create(H5SL_type_t type, H5SL_cmp_t cmp); 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); diff --git a/src/H5SM.c b/src/H5SM.c index a971fb0..8c00d34 100755 --- a/src/H5SM.c +++ b/src/H5SM.c @@ -17,7 +17,6 @@ /* Module Setup */ /****************/ -#define H5F_PACKAGE /*suppress error about including H5Fpkg */ #define H5O_PACKAGE /*suppress error about including H5Opkg */ #define H5SM_PACKAGE /*suppress error about including H5SMpkg */ @@ -26,7 +25,7 @@ /***********/ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ -#include "H5Fpkg.h" /* File access */ +#include "H5Fprivate.h" /* File access */ #include "H5FLprivate.h" /* Free Lists */ #include "H5MFprivate.h" /* File memory management */ #include "H5MMprivate.h" /* Memory management */ @@ -66,7 +65,7 @@ static herr_t H5SM_convert_list_to_btree(H5F_t * f, H5SM_index_header_t * header static herr_t H5SM_convert_btree_to_list(H5F_t * f, H5SM_index_header_t * header, hid_t dxpl_id); static herr_t H5SM_incr_ref(void *record, void *_op_data, hbool_t *changed); static herr_t H5SM_write_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - H5SM_index_header_t *header, unsigned type_id, void *mesg, + H5SM_index_header_t *header, hbool_t defer, unsigned type_id, void *mesg, unsigned *cache_flags_ptr); static herr_t H5SM_decr_ref(void *record, void *op_data, hbool_t *changed); static herr_t H5SM_delete_from_index(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, @@ -74,7 +73,7 @@ static herr_t H5SM_delete_from_index(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned *cache_flags, void ** /*out*/ encoded_mesg); static herr_t H5SM_type_to_flag(unsigned type_id, unsigned *type_flag); static herr_t H5SM_read_iter_op(H5O_t *oh, H5O_mesg_t *mesg, unsigned sequence, - hbool_t *oh_modified, void *_udata); + unsigned *oh_modified, void *_udata); static herr_t H5SM_read_mesg_fh_cb(const void *obj, size_t obj_len, void *_udata); static herr_t H5SM_read_mesg(H5F_t *f, const H5SM_sohm_t *mesg, H5HF_t *fheap, H5O_t * open_oh, hid_t dxpl_id, size_t *encoding_size /*out*/, @@ -131,16 +130,16 @@ H5SM_init(H5F_t *f, H5P_genplist_t * fc_plist, const H5O_loc_t *ext_loc, hid_t d unsigned x; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(H5SM_init, dxpl_id, H5AC__SOHM_TAG, FAIL) + FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__SOHM_TAG, FAIL) HDassert(f); /* File should not already have a SOHM table */ - HDassert(f->shared->sohm_addr == HADDR_UNDEF); + HDassert(!H5F_addr_defined(H5F_SOHM_ADDR(f))); /* Initialize master table */ if(NULL == (table = H5FL_MALLOC(H5SM_master_table_t))) HGOTO_ERROR(H5E_SOHM, H5E_CANTALLOC, FAIL, "memory allocation failed for SOHM table") - table->num_indexes = f->shared->sohm_nindexes; + table->num_indexes = H5F_SOHM_NINDEXES(f); table->table_size = H5SM_TABLE_SIZE(f); /* Get information from fcpl */ @@ -213,18 +212,18 @@ H5SM_init(H5F_t *f, H5P_genplist_t * fc_plist, const H5O_loc_t *ext_loc, hid_t d HGOTO_ERROR(H5E_SOHM, H5E_CANTINS, FAIL, "can't add SOHM table to cache") /* Record the address of the master table in the file */ - f->shared->sohm_addr = table_addr; + H5F_SET_SOHM_ADDR(f, table_addr); /* Check for sharing attributes in this file, which means that creation * indices must be tracked on object header message in the file. */ if(type_flags_used & H5O_SHMESG_ATTR_FLAG) - f->shared->store_msg_crt_idx = TRUE; + H5F_SET_STORE_MSG_CRT_IDX(f, TRUE); /* Write shared message information to the superblock extension */ - sohm_table.addr = f->shared->sohm_addr; - sohm_table.version = f->shared->sohm_vers; - sohm_table.nindexes = f->shared->sohm_nindexes; + sohm_table.addr = H5F_SOHM_ADDR(f); + sohm_table.version = H5F_SOHM_VERS(f); + sohm_table.nindexes = H5F_SOHM_NINDEXES(f); if(H5O_msg_create(ext_loc, H5O_SHMESG_ID, H5O_MSG_FLAG_CONSTANT | H5O_MSG_FLAG_DONTSHARE, H5O_UPDATE_TIME, &sohm_table, dxpl_id) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTINIT, FAIL, "unable to update SOHM header message") @@ -257,7 +256,7 @@ H5SM_type_to_flag(unsigned type_id, unsigned *type_flag) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5SM_type_to_flag) + FUNC_ENTER_NOAPI_NOINIT /* Translate the H5O type_id into an H5SM type flag */ switch(type_id) { @@ -305,7 +304,7 @@ H5SM_get_index(const H5SM_master_table_t *table, unsigned type_id) unsigned type_flag; ssize_t ret_value = FAIL; - FUNC_ENTER_NOAPI_NOINIT(H5SM_get_index) + FUNC_ENTER_NOAPI_NOINIT /* Translate the H5O type_id into an H5SM type flag */ if(H5SM_type_to_flag(type_id, &type_flag) < 0) @@ -346,20 +345,20 @@ H5SM_type_shared(H5F_t *f, unsigned type_id, hid_t dxpl_id) size_t u; /* Local index variable */ htri_t ret_value = FALSE; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(H5SM_type_shared, dxpl_id, H5AC__SOHM_TAG, FAIL) + FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, H5AC__SOHM_TAG, FAIL) /* Translate the H5O type_id into an H5SM type flag */ if(H5SM_type_to_flag(type_id, &type_flag) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTGET, FAIL, "can't map message type to flag") /* Look up the master SOHM table */ - if(H5F_addr_defined(f->shared->sohm_addr)) { + if(H5F_addr_defined(H5F_SOHM_ADDR(f))) { H5SM_table_cache_ud_t cache_udata; /* User-data for callback */ /* Set up user data for callback */ cache_udata.f = f; - if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, f->shared->sohm_addr, &cache_udata, H5AC_READ))) + if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), &cache_udata, H5AC_READ))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM master table") } /* end if */ else @@ -375,7 +374,7 @@ H5SM_type_shared(H5F_t *f, unsigned type_id, hid_t dxpl_id) done: /* Release the master SOHM table */ - if(table && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_TABLE, f->shared->sohm_addr, table, H5AC__NO_FLAGS_SET) < 0) + if(table && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), table, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTUNPROTECT, FAIL, "unable to close SOHM master table") FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) @@ -403,7 +402,7 @@ H5SM_get_fheap_addr(H5F_t *f, hid_t dxpl_id, unsigned type_id, haddr_t *fheap_ad ssize_t index_num; /* Which index */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(H5SM_get_fheap_addr, dxpl_id, H5AC__SOHM_TAG, FAIL) + FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__SOHM_TAG, FAIL) /* Sanity checks */ HDassert(f); @@ -413,7 +412,7 @@ H5SM_get_fheap_addr(H5F_t *f, hid_t dxpl_id, unsigned type_id, haddr_t *fheap_ad cache_udata.f = f; /* Look up the master SOHM table */ - if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, f->shared->sohm_addr, &cache_udata, H5AC_READ))) + if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), &cache_udata, H5AC_READ))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM master table") /* Look up index for message type */ @@ -425,7 +424,7 @@ H5SM_get_fheap_addr(H5F_t *f, hid_t dxpl_id, unsigned type_id, haddr_t *fheap_ad done: /* Release the master SOHM table */ - if(table && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_TABLE, f->shared->sohm_addr, table, H5AC__NO_FLAGS_SET) < 0) + if(table && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), table, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTUNPROTECT, FAIL, "unable to close SOHM master table") FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) @@ -452,7 +451,7 @@ H5SM_create_index(H5F_t *f, H5SM_index_header_t *header, hid_t dxpl_id) H5B2_t *bt2 = NULL; /* v2 B-tree handle for index */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT(H5SM_create_index) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(header); @@ -478,8 +477,8 @@ H5SM_create_index(H5F_t *f, H5SM_index_header_t *header, hid_t dxpl_id) /* Create the v2 B-tree index */ bt2_cparam.cls = H5SM_INDEX; - bt2_cparam.node_size = (size_t)H5SM_B2_NODE_SIZE; - bt2_cparam.rrec_size = (size_t)H5SM_SOHM_ENTRY_SIZE(f); + bt2_cparam.node_size = (uint32_t)H5SM_B2_NODE_SIZE; + bt2_cparam.rrec_size = (uint32_t)H5SM_SOHM_ENTRY_SIZE(f); bt2_cparam.split_percent = H5SM_B2_SPLIT_PERCENT; bt2_cparam.merge_percent = H5SM_B2_MERGE_PERCENT; if(NULL == (bt2 = H5B2_create(f, dxpl_id, &bt2_cparam, f))) @@ -557,7 +556,7 @@ H5SM_delete_index(H5F_t *f, H5SM_index_header_t *header, hid_t dxpl_id, { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5SM_delete_index) + FUNC_ENTER_NOAPI_NOINIT /* Determine whether index is a list or a B-tree. */ if(header->index_type == H5SM_LIST) { @@ -630,7 +629,7 @@ H5SM_create_list(H5F_t *f, H5SM_index_header_t *header, hid_t dxpl_id) haddr_t addr = HADDR_UNDEF; /* Address of the list on disk */ haddr_t ret_value; - FUNC_ENTER_NOAPI_NOINIT_TAG(H5SM_create_list, dxpl_id, H5AC__SOHM_TAG, HADDR_UNDEF) + FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, H5AC__SOHM_TAG, HADDR_UNDEF) HDassert(f); HDassert(header); @@ -711,7 +710,7 @@ H5SM_convert_list_to_btree(H5F_t *f, H5SM_index_header_t *header, void * encoding_buf = NULL; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5SM_convert_list_to_btree) + FUNC_ENTER_NOAPI_NOINIT HDassert(_list && *_list); HDassert(header); @@ -721,8 +720,8 @@ H5SM_convert_list_to_btree(H5F_t *f, H5SM_index_header_t *header, /* Create the new v2 B-tree for tracking the messages */ bt2_cparam.cls = H5SM_INDEX; - bt2_cparam.node_size = (size_t)H5SM_B2_NODE_SIZE; - bt2_cparam.rrec_size = (size_t)H5SM_SOHM_ENTRY_SIZE(f); + bt2_cparam.node_size = (uint32_t)H5SM_B2_NODE_SIZE; + bt2_cparam.rrec_size = (uint32_t)H5SM_SOHM_ENTRY_SIZE(f); bt2_cparam.split_percent = H5SM_B2_SPLIT_PERCENT; bt2_cparam.merge_percent = H5SM_B2_MERGE_PERCENT; if(NULL == (bt2 = H5B2_create(f, dxpl_id, &bt2_cparam, f))) @@ -813,7 +812,7 @@ H5SM_convert_btree_to_list(H5F_t * f, H5SM_index_header_t * header, hid_t dxpl_i haddr_t btree_addr; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT_TAG(H5SM_convert_btree_to_list, dxpl_id, H5AC__SOHM_TAG, FAIL) + FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, H5AC__SOHM_TAG, FAIL) /* Remember the address of the old B-tree, but change the header over to be * a list.. @@ -873,11 +872,11 @@ H5SM_can_share_common(const H5F_t *f, unsigned type_id, const void *mesg) { htri_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5SM_can_share_common) + FUNC_ENTER_NOAPI_NOINIT /* Check whether this message ought to be shared or not */ /* If sharing is disabled in this file, don't share the message */ - if(!H5F_addr_defined(f->shared->sohm_addr)) + if(!H5F_addr_defined(H5F_SOHM_ADDR(f))) HGOTO_DONE(FALSE) /* Type-specific check */ @@ -922,7 +921,7 @@ H5SM_can_share(H5F_t *f, hid_t dxpl_id, H5SM_master_table_t *table, htri_t tri_ret; htri_t ret_value = TRUE; - FUNC_ENTER_NOAPI_TAG(H5SM_can_share, dxpl_id, H5AC__SOHM_TAG, FAIL) + FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__SOHM_TAG, FAIL) /* "trivial" sharing checks */ if((tri_ret = H5SM_can_share_common(f, type_id, mesg)) < 0) @@ -940,7 +939,7 @@ H5SM_can_share(H5F_t *f, hid_t dxpl_id, H5SM_master_table_t *table, /* Set up user data for callback */ cache_udata.f = f; - if(NULL == (my_table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, f->shared->sohm_addr, &cache_udata, H5AC_READ))) + if(NULL == (my_table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), &cache_udata, H5AC_READ))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM master table") } /* end if */ @@ -964,7 +963,7 @@ H5SM_can_share(H5F_t *f, hid_t dxpl_id, H5SM_master_table_t *table, done: /* Release the master SOHM table, if we protected it */ - if(my_table && my_table != table && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_TABLE, f->shared->sohm_addr, my_table, H5AC__NO_FLAGS_SET) < 0) + if(my_table && my_table != table && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), my_table, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTUNPROTECT, FAIL, "unable to close SOHM master table") FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) @@ -989,6 +988,12 @@ done: * header it needs (which can cause an error if that OH is * already protected!). * + * DEFER_FLAGS indicates whether the sharing operation should + * actually occur, or whether this is just a set up call for a + * future sharing operation. In the latter case this argument + * should be H5SM_DEFER. If the message was previously deferred + * this argument should be H5SM_WAS_DEFERRED. + * * MESG_FLAGS will have the H5O_MSG_FLAG_SHAREABLE or * H5O_MSG_FLAG_SHARED flag set if one is appropriate. This is * the only way to tell the difference between a message that @@ -1026,17 +1031,33 @@ done: *------------------------------------------------------------------------- */ htri_t -H5SM_try_share(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned type_id, - void *mesg, unsigned *mesg_flags) +H5SM_try_share(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned defer_flags, + unsigned type_id, void *mesg, unsigned *mesg_flags) { H5SM_master_table_t *table = NULL; H5SM_table_cache_ud_t cache_udata; /* User-data for callback */ unsigned cache_flags = H5AC__NO_FLAGS_SET; ssize_t index_num; htri_t tri_ret; +#ifndef NDEBUG + unsigned deferred_type = -1u; +#endif htri_t ret_value = TRUE; - FUNC_ENTER_NOAPI_TAG(H5SM_try_share, dxpl_id, H5AC__SOHM_TAG, FAIL) + FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__SOHM_TAG, FAIL) + + /* If we previously deferred this operation, the saved message type should + * be the same as the one we get here. In debug mode, we make sure this + * holds true; otherwise we can leave now if it wasn't shared in the DEFER + * pass. */ + if(defer_flags & H5SM_WAS_DEFERRED) +#ifndef NDEBUG + deferred_type = ((H5O_shared_t *)mesg)->type; +#else /* NDEBUG */ + if((((H5O_shared_t *)mesg)->type != H5O_SHARE_TYPE_HERE) + && (((H5O_shared_t *)mesg)->type != H5O_SHARE_TYPE_SOHM)) + HGOTO_DONE(FALSE); +#endif /* NDEBUG */ /* "trivial" sharing checks */ if(mesg_flags && (*mesg_flags & H5O_MSG_FLAG_DONTSHARE)) @@ -1050,7 +1071,7 @@ H5SM_try_share(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned type_id, cache_udata.f = f; /* Look up the master SOHM table */ - if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, f->shared->sohm_addr, &cache_udata, H5AC_WRITE))) + if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), &cache_udata, H5AC_WRITE))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM master table") /* "complex" sharing checks */ @@ -1072,22 +1093,33 @@ H5SM_try_share(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned type_id, * message to become shared (if it is unique, it will not be shared). */ if(H5SM_write_mesg(f, dxpl_id, open_oh, &(table->indexes[index_num]), - type_id, mesg, &cache_flags) < 0) + (defer_flags & H5SM_DEFER) != 0, type_id, mesg, &cache_flags) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTINSERT, FAIL, "can't write shared message") - /* Set flags if this message was "written" without error; it is now - * either fully shared or "shareable". + /* Set flags if this message was "written" without error and wasn't a + * 'defer' attempt; it is now either fully shared or "shareable". */ - if(mesg_flags) { + if(mesg_flags && !(defer_flags & H5SM_DEFER)) { if(((H5O_shared_t *)mesg)->type == H5O_SHARE_TYPE_HERE) *mesg_flags |= H5O_MSG_FLAG_SHAREABLE; - else + else { + HDassert(((H5O_shared_t *)mesg)->type == H5O_SHARE_TYPE_SOHM); *mesg_flags |= H5O_MSG_FLAG_SHARED; + } /* end else */ } /* end if */ done: + HDassert(!ret_value || ((H5O_shared_t *)mesg)->type == H5O_SHARE_TYPE_HERE + || ((H5O_shared_t *)mesg)->type == H5O_SHARE_TYPE_SOHM); +#ifndef NDEBUG + /* If we previously deferred this operation, make sure the saved message + * type is the same as the one we get here. */ + if(defer_flags & H5SM_WAS_DEFERRED) + HDassert(deferred_type == ((H5O_shared_t *)mesg)->type); +#endif /* NDEBUG */ + /* Release the master SOHM table */ - if(table && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_TABLE, f->shared->sohm_addr, table, cache_flags) < 0) + if(table && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), table, cache_flags) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTUNPROTECT, FAIL, "unable to close SOHM master table") FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) @@ -1118,7 +1150,7 @@ H5SM_incr_ref(void *record, void *_op_data, hbool_t *changed) H5SM_incr_ref_opdata *op_data = (H5SM_incr_ref_opdata *) _op_data; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT(H5SM_incr_ref) + FUNC_ENTER_NOAPI_NOINIT HDassert(record); HDassert(op_data); @@ -1158,19 +1190,28 @@ done: /*------------------------------------------------------------------------- * Function: H5SM_write_mesg * - * Purpose: Adds a shareable message to an index. If this is the first - * such message and we have an object header location for this - * message, we record it in the index but don't modify the - * message passed in. - * - * If the message is already in the index or we don't have an - * object header location for it, it is shared in the heap - * and this function sets its sharing struct to reflect this. + * Purpose: This routine adds a shareable message to an index. + * The behavior is controlled by the DEFER parameter: + * + * If DEFER is TRUE, this routine Simulates adding a shareable + * message to an index. It determines what the outcome would + * be with DEFER set the FALSE and updates the shared message + * info, but does not actually add the message to a heap, list, + * or b-tree. Assumes that an open object header will be + * available when H5SM_write_mesg is called with DEFER set to + * FALSE. + * + * If DEFER is FALSE, this routine adds a shareable message to + * an index. If this is the first such message and we have an + * object header location for this message, we record it in the + * index but don't modify the message passed in. If the message + * is already in the index or we don't have an object header + * location for it, it is shared in the heap and this function + * sets its sharing struct to reflect this. * * The index could be a list or a B-tree. * - * Return: TRUE if message is now shared - * FALSE if message is in index but is not shared + * Return: Non-negative on success * Negative on failure * * Programmer: James Laird @@ -1180,7 +1221,7 @@ done: */ static herr_t H5SM_write_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - H5SM_index_header_t *header, unsigned type_id, void *mesg, + H5SM_index_header_t *header, hbool_t defer, unsigned type_id, void *mesg, unsigned *cache_flags_ptr) { H5SM_list_t *list = NULL; /* List index */ @@ -1195,7 +1236,7 @@ H5SM_write_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, size_t empty_pos = UFAIL; /* Empty entry in list */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT_TAG(H5SM_write_mesg, dxpl_id, H5AC__SOHM_TAG, FAIL) + FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, H5AC__SOHM_TAG, FAIL) /* Sanity check */ HDassert(header); @@ -1235,7 +1276,7 @@ H5SM_write_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, cache_udata.header = header; /* The index is a list; get it from the cache */ - if(NULL == (list = (H5SM_list_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_LIST, header->index_addr, &cache_udata, H5AC_WRITE))) + if(NULL == (list = (H5SM_list_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_LIST, header->index_addr, &cache_udata, defer ? H5AC_READ : H5AC_WRITE))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM index") /* See if the message is already in the index and get its location. @@ -1243,55 +1284,75 @@ H5SM_write_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, * later. */ list_pos = H5SM_find_in_list(list, &key, &empty_pos); - if(list_pos != UFAIL) { - /* If the message was previously shared in an object header, share - * it in the heap now. - */ - if(list->messages[list_pos].location == H5SM_IN_OH) { - /* Put the message in the heap and record its new heap ID */ - if(H5HF_insert(fheap, dxpl_id, key.encoding_size, key.encoding, &shared.u.heap_id) < 0) - HGOTO_ERROR(H5E_SOHM, H5E_CANTINSERT, FAIL, "unable to insert message into fractal heap") - - list->messages[list_pos].location = H5SM_IN_HEAP; - list->messages[list_pos].u.heap_loc.fheap_id = shared.u.heap_id; - list->messages[list_pos].u.heap_loc.ref_count = 2; - } /* end if */ - else { - /* If the message was already in the heap, increase its ref count */ - HDassert(list->messages[list_pos].location == H5SM_IN_HEAP); - ++(list->messages[list_pos].u.heap_loc.ref_count); - } /* end else */ - - /* Set up the shared location to point to the shared location */ - shared.u.heap_id = list->messages[list_pos].u.heap_loc.fheap_id; - found = TRUE; + if(defer) { + if(list_pos != UFAIL) + found = TRUE; } /* end if */ + else { + if(list_pos != UFAIL) { + /* If the message was previously shared in an object header, share + * it in the heap now. + */ + if(list->messages[list_pos].location == H5SM_IN_OH) { + /* Put the message in the heap and record its new heap ID */ + if(H5HF_insert(fheap, dxpl_id, key.encoding_size, key.encoding, &shared.u.heap_id) < 0) + HGOTO_ERROR(H5E_SOHM, H5E_CANTINSERT, FAIL, "unable to insert message into fractal heap") + + list->messages[list_pos].location = H5SM_IN_HEAP; + list->messages[list_pos].u.heap_loc.fheap_id = shared.u.heap_id; + list->messages[list_pos].u.heap_loc.ref_count = 2; + } /* end if */ + else { + /* If the message was already in the heap, increase its ref count */ + HDassert(list->messages[list_pos].location == H5SM_IN_HEAP); + ++(list->messages[list_pos].u.heap_loc.ref_count); + } /* end else */ + + /* Set up the shared location to point to the shared location */ + shared.u.heap_id = list->messages[list_pos].u.heap_loc.fheap_id; + found = TRUE; + } /* end if */ + } /* end else */ } /* end if */ /* Index is a B-tree */ else { - H5SM_incr_ref_opdata op_data; - HDassert(header->index_type == H5SM_BTREE); /* Open the index v2 B-tree */ if(NULL == (bt2 = H5B2_open(f, dxpl_id, header->index_addr, f))) HGOTO_ERROR(H5E_SOHM, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for SOHM index") - /* Set up callback info */ - op_data.key = &key; - op_data.dxpl_id = dxpl_id; + if(defer) { + htri_t bt2_find; /* Result from searching in the v2 B-tree */ - /* If this returns failure, it means that the message wasn't found. */ - /* If it succeeds, set the heap_id in the shared struct. It will - * return a heap ID, since a message with a reference count greater - * than 1 is always shared in the heap. - */ - if(H5B2_modify(bt2, dxpl_id, &key, H5SM_incr_ref, &op_data) >= 0) { - shared.u.heap_id = op_data.fheap_id; - found = TRUE; + /* If this returns 0, it means that the message wasn't found. */ + /* If it return 1, set the heap_id in the shared struct. It will + * return a heap ID, since a message with a reference count greater + * than 1 is always shared in the heap. + */ + if((bt2_find = H5B2_find(bt2, dxpl_id, &key, NULL, NULL)) < 0) + HGOTO_ERROR(H5E_SOHM, H5E_NOTFOUND, FAIL, "can't search for message in index") + found = (hbool_t)bt2_find; } /* end if */ - else - H5E_clear_stack(NULL); /*ignore error*/ + else { + H5SM_incr_ref_opdata op_data; + + /* Set up callback info */ + op_data.key = &key; + op_data.dxpl_id = dxpl_id; + + /* If this returns failure, it means that the message wasn't found. */ + /* If it succeeds, set the heap_id in the shared struct. It will + * return a heap ID, since a message with a reference count greater + * than 1 is always shared in the heap. + */ + if(H5B2_modify(bt2, dxpl_id, &key, H5SM_incr_ref, &op_data) >= 0) { + shared.u.heap_id = op_data.fheap_id; + found = TRUE; + } /* end if */ + else + H5E_clear_stack(NULL); /*ignore error*/ + } /* end else */ } /* end else */ if(found) @@ -1309,11 +1370,21 @@ H5SM_write_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, HGOTO_ERROR(H5E_SOHM, H5E_BADTYPE, FAIL, "'share in ohdr' check returned error") /* If this message can be shared in an object header location, it is - * "shareable" but not shared in the heap. Insert it in the index - * but don't modify the original message. + * "shareable" but not shared in the heap. + * + * If 'defer' flag is set: + * We will insert it in the index but not modify the original + * message. + * If it can't be shared in an object header location, we will + * insert it in the heap. Note that we will only share + * the message in the object header if there is an + * "open_oh" available. * - * If it can't be shared in an object header location or there's no - * object header location available, insert it in the heap. + * If 'defer' flag is not set: + * Insert it in the index but don't modify the original message. + * If it can't be shared in an object header location or there's + * no object header location available, insert it in the + * heap. */ if(share_in_ohdr && open_oh) { /* Set up shared component info */ @@ -1322,62 +1393,71 @@ H5SM_write_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, /* Retrieve any creation index from the native message */ if(H5O_msg_get_crt_index(type_id, mesg, &shared.u.loc.index) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTGET, FAIL, "unable to retrieve creation index") - shared.u.loc.oh_addr = H5O_OH_GET_ADDR(open_oh); - /* Copy shared component info into key for inserting into index */ - key.message.location = H5SM_IN_OH; - key.message.u.mesg_loc = shared.u.loc; + if(defer) + shared.u.loc.oh_addr = HADDR_UNDEF; + else { + shared.u.loc.oh_addr = H5O_OH_GET_ADDR(open_oh); + + /* Copy shared component info into key for inserting into index */ + key.message.location = H5SM_IN_OH; + key.message.u.mesg_loc = shared.u.loc; + } /* end else */ } /* end if */ else { - /* Put the message in the heap and record its new heap ID */ - if(H5HF_insert(fheap, dxpl_id, key.encoding_size, key.encoding, &shared.u.heap_id) < 0) - HGOTO_ERROR(H5E_SOHM, H5E_CANTINSERT, FAIL, "unable to insert message into fractal heap") - /* Set up shared component info */ - /* (heap ID set above) */ + /* (heap ID set below, if not deferred) */ shared.type = H5O_SHARE_TYPE_SOHM; - key.message.location = H5SM_IN_HEAP; - key.message.u.heap_loc.fheap_id = shared.u.heap_id; - key.message.u.heap_loc.ref_count = 1; - } /* end else */ - - /* Set common information */ - key.message.msg_type_id = type_id; + if(!defer) { + /* Put the message in the heap and record its new heap ID */ + if(H5HF_insert(fheap, dxpl_id, key.encoding_size, key.encoding, &shared.u.heap_id) < 0) + HGOTO_ERROR(H5E_SOHM, H5E_CANTINSERT, FAIL, "unable to insert message into fractal heap") - /* Check whether the list has grown enough that it needs to become a B-tree */ - if(header->index_type == H5SM_LIST && header->num_messages >= header->list_max) - if(H5SM_convert_list_to_btree(f, header, &list, fheap, open_oh, dxpl_id) < 0) - HGOTO_ERROR(H5E_SOHM, H5E_CANTDELETE, FAIL, "unable to convert list to B-tree") - - /* Insert the new message into the SOHM index */ - if(header->index_type == H5SM_LIST) { - /* Index is a list. Find an empty spot if we haven't already */ - if(empty_pos == UFAIL) - if((H5SM_find_in_list(list, NULL, &empty_pos) == UFAIL) || empty_pos == UFAIL) - HGOTO_ERROR(H5E_SOHM, H5E_CANTINSERT, FAIL, "unable to find empty entry in list") - - /* Insert message into list */ - HDassert(list->messages[empty_pos].location == H5SM_NO_LOC); - HDassert(key.message.location != H5SM_NO_LOC); - list->messages[empty_pos] = key.message; - } /* end if */ - /* Index is a B-tree */ - else { - HDassert(header->index_type == H5SM_BTREE); + key.message.location = H5SM_IN_HEAP; + key.message.u.heap_loc.fheap_id = shared.u.heap_id; + key.message.u.heap_loc.ref_count = 1; + } /* end if */ + } /* end else */ - /* Open the index v2 B-tree, if it isn't already */ - if(NULL == bt2) { - if(NULL == (bt2 = H5B2_open(f, dxpl_id, header->index_addr, f))) - HGOTO_ERROR(H5E_SOHM, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for SOHM index") + if(!defer) { + /* Set common information */ + key.message.msg_type_id = type_id; + + /* Check whether the list has grown enough that it needs to become a B-tree */ + if(header->index_type == H5SM_LIST && header->num_messages >= header->list_max) + if(H5SM_convert_list_to_btree(f, header, &list, fheap, open_oh, dxpl_id) < 0) + HGOTO_ERROR(H5E_SOHM, H5E_CANTDELETE, FAIL, "unable to convert list to B-tree") + + /* Insert the new message into the SOHM index */ + if(header->index_type == H5SM_LIST) { + /* Index is a list. Find an empty spot if we haven't already */ + if(empty_pos == UFAIL) + if((H5SM_find_in_list(list, NULL, &empty_pos) == UFAIL) || empty_pos == UFAIL) + HGOTO_ERROR(H5E_SOHM, H5E_CANTINSERT, FAIL, "unable to find empty entry in list") + + /* Insert message into list */ + HDassert(list->messages[empty_pos].location == H5SM_NO_LOC); + HDassert(key.message.location != H5SM_NO_LOC); + list->messages[empty_pos] = key.message; } /* end if */ + /* Index is a B-tree */ + else { + HDassert(header->index_type == H5SM_BTREE); - if(H5B2_insert(bt2, dxpl_id, &key) < 0) - HGOTO_ERROR(H5E_SOHM, H5E_CANTINSERT, FAIL, "couldn't add SOHM to B-tree") - } /* end else */ + /* Open the index v2 B-tree, if it isn't already */ + if(NULL == bt2) { + if(NULL == (bt2 = H5B2_open(f, dxpl_id, header->index_addr, f))) + HGOTO_ERROR(H5E_SOHM, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for SOHM index") + } /* end if */ + + if(H5B2_insert(bt2, dxpl_id, &key) < 0) + HGOTO_ERROR(H5E_SOHM, H5E_CANTINSERT, FAIL, "couldn't add SOHM to B-tree") + } /* end else */ - ++(header->num_messages); - (*cache_flags_ptr) |= H5AC__DIRTIED_FLAG; + ++(header->num_messages); + (*cache_flags_ptr) |= H5AC__DIRTIED_FLAG; + } /* end if */ } /* end else */ /* Set the file pointer & message type for the shared component */ @@ -1396,7 +1476,7 @@ done: HDONE_ERROR(H5E_SOHM, H5E_CANTCLOSEOBJ, FAIL, "can't close v2 B-tree for SOHM index") /* If we got a list out of the cache, release it (it is always dirty after writing a message) */ - if(list && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_LIST, header->index_addr, list, H5AC__DIRTIED_FLAG) < 0) + if(list && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_LIST, header->index_addr, list, defer ? H5AC__NO_FLAGS_SET : H5AC__DIRTIED_FLAG) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTUNPROTECT, FAIL, "unable to close SOHM index") if(encoding_buf) @@ -1436,10 +1516,10 @@ H5SM_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, H5O_shared_t *sh_mesg) unsigned type_id; /* Message type ID to operate on */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_TAG(H5SM_delete, dxpl_id, H5AC__SOHM_TAG, FAIL) + FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__SOHM_TAG, FAIL) HDassert(f); - HDassert(f->shared->sohm_addr != HADDR_UNDEF); + HDassert(H5F_addr_defined(H5F_SOHM_ADDR(f))); HDassert(sh_mesg); /* Get message type */ @@ -1449,7 +1529,7 @@ H5SM_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, H5O_shared_t *sh_mesg) cache_udata.f = f; /* Look up the master SOHM table */ - if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, f->shared->sohm_addr, &cache_udata, H5AC_WRITE))) + if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), &cache_udata, H5AC_WRITE))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM master table") /* Find the correct index and try to delete from it */ @@ -1464,7 +1544,7 @@ H5SM_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, H5O_shared_t *sh_mesg) HGOTO_ERROR(H5E_SOHM, H5E_CANTDELETE, FAIL, "unable to delete mesage from SOHM index") /* Release the master SOHM table */ - if(H5AC_unprotect(f, dxpl_id, H5AC_SOHM_TABLE, f->shared->sohm_addr, table, cache_flags) < 0) + if(H5AC_unprotect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), table, cache_flags) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTUNPROTECT, FAIL, "unable to close SOHM master table") table = NULL; @@ -1482,7 +1562,7 @@ H5SM_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, H5O_shared_t *sh_mesg) done: /* Release the master SOHM table (should only happen on error) */ - if(table && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_TABLE, f->shared->sohm_addr, table, cache_flags) < 0) + if(table && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), table, cache_flags) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTUNPROTECT, FAIL, "unable to close SOHM master table") /* Release any native message we decoded */ @@ -1524,7 +1604,7 @@ H5SM_find_in_list(const H5SM_list_t *list, const H5SM_mesg_key_t *key, size_t *e size_t x; size_t ret_value; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5SM_find_in_list) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(list); /* Both key and empty_pos can be NULL, but not both! */ @@ -1538,7 +1618,7 @@ H5SM_find_in_list(const H5SM_list_t *list, const H5SM_mesg_key_t *key, size_t *e * Also record the first empty position we find. */ for(x = 0; x < list->header->list_max; x++) { - if(key && (list->messages[x].location != H5SM_NO_LOC) && + if((list->messages[x].location != H5SM_NO_LOC) && (0 == H5SM_message_compare(key, &(list->messages[x])))) HGOTO_DONE(x) else if(empty_pos && list->messages[x].location == H5SM_NO_LOC) { @@ -1577,7 +1657,7 @@ H5SM_get_hash_fh_cb(const void *obj, size_t obj_len, void *_udata) { H5SM_fh_ud_gh_t *udata = (H5SM_fh_ud_gh_t *)_udata; /* User data for fractal heap 'op' callback */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5SM_get_hash_fh_cb) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Compute hash value on raw message */ udata->hash = H5_checksum_lookup3(obj, obj_len, udata->type_id); @@ -1610,7 +1690,7 @@ H5SM_decr_ref(void *record, void *op_data, hbool_t *changed) { H5SM_sohm_t *message = (H5SM_sohm_t *) record; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5SM_decr_ref) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(record); HDassert(op_data); @@ -1665,7 +1745,7 @@ H5SM_delete_from_index(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned type_id; /* Message type to operate on */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT_TAG(H5SM_delete_from_index, dxpl_id, H5AC__SOHM_TAG, FAIL) + FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, H5AC__SOHM_TAG, FAIL) /* Sanity check */ HDassert(f); @@ -1846,17 +1926,17 @@ herr_t H5SM_get_info(const H5O_loc_t *ext_loc, H5P_genplist_t *fc_plist, hid_t dxpl_id) { H5F_t *f = ext_loc->file; /* File pointer (convenience variable) */ - H5F_file_t *shared = f->shared; /* Shared file info (convenience variable) */ H5O_shmesg_table_t sohm_table; /* SOHM message from superblock extension */ H5SM_master_table_t *table = NULL; /* SOHM master table */ + unsigned tmp_sohm_nindexes; /* Number of shared messages indexes in the table */ htri_t status; /* Status for message existing */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(H5SM_get_info, dxpl_id, H5AC__SOHM_TAG, FAIL) + FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__SOHM_TAG, FAIL) /* Sanity check */ HDassert(ext_loc); - HDassert(f && shared); + HDassert(f); HDassert(fc_plist); /* Check for the extension having a 'shared message info' message */ @@ -1879,28 +1959,28 @@ H5SM_get_info(const H5O_loc_t *ext_loc, H5P_genplist_t *fc_plist, hid_t dxpl_id) HDmemset(minsizes, 0, sizeof(minsizes)); /* Set SOHM info from file */ - shared->sohm_addr = sohm_table.addr; - shared->sohm_vers = sohm_table.version; - shared->sohm_nindexes = sohm_table.nindexes; - HDassert(H5F_addr_defined(shared->sohm_addr)); - HDassert(shared->sohm_nindexes > 0 && shared->sohm_nindexes <= H5O_SHMESG_MAX_NINDEXES); + H5F_SET_SOHM_ADDR(f, sohm_table.addr); + H5F_SET_SOHM_VERS(f, sohm_table.version); + H5F_SET_SOHM_NINDEXES(f, sohm_table.nindexes); + HDassert(H5F_addr_defined(H5F_SOHM_ADDR(f))); + HDassert(H5F_SOHM_NINDEXES(f) > 0 && H5F_SOHM_NINDEXES(f) <= H5O_SHMESG_MAX_NINDEXES); /* Set up user data for callback */ cache_udata.f = f; /* Read the rest of the SOHM table information from the cache */ - if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, shared->sohm_addr, &cache_udata, H5AC_READ))) + if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), &cache_udata, H5AC_READ))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM master table") /* Get index conversion limits */ - sohm_l2b = table->indexes[0].list_max; - sohm_b2l = table->indexes[0].btree_min; + sohm_l2b = (unsigned)table->indexes[0].list_max; + sohm_b2l = (unsigned)table->indexes[0].btree_min; /* Iterate through all indices */ for(u = 0; u < table->num_indexes; ++u) { /* Pack information about the individual SOHM index */ index_flags[u] = table->indexes[u].mesg_types; - minsizes[u] = table->indexes[u].min_mesg_size; + minsizes[u] = (unsigned)table->indexes[u].min_mesg_size; /* Sanity check */ HDassert(sohm_l2b == table->indexes[u].list_max); @@ -1910,11 +1990,12 @@ H5SM_get_info(const H5O_loc_t *ext_loc, H5P_genplist_t *fc_plist, hid_t dxpl_id) * indices must be tracked on object header message in the file. */ if(index_flags[u] & H5O_SHMESG_ATTR_FLAG) - shared->store_msg_crt_idx = TRUE; + H5F_SET_STORE_MSG_CRT_IDX(f, TRUE); } /* end for */ /* Set values in the property list */ - if(H5P_set(fc_plist, H5F_CRT_SHMSG_NINDEXES_NAME, &shared->sohm_nindexes) < 0) + tmp_sohm_nindexes = H5F_SOHM_NINDEXES(f); + if(H5P_set(fc_plist, H5F_CRT_SHMSG_NINDEXES_NAME, &tmp_sohm_nindexes) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTSET, FAIL, "can't set number of SOHM indexes") if(H5P_set(fc_plist, H5F_CRT_SHMSG_INDEX_TYPES_NAME, index_flags) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTSET, FAIL, "can't set type flags for indexes") @@ -1927,18 +2008,19 @@ H5SM_get_info(const H5O_loc_t *ext_loc, H5P_genplist_t *fc_plist, hid_t dxpl_id) } /* end if */ else { /* No SOHM info in file */ - shared->sohm_addr = HADDR_UNDEF; - shared->sohm_nindexes = 0; - shared->sohm_vers = 0; + H5F_SET_SOHM_ADDR(f, HADDR_UNDEF); + H5F_SET_SOHM_VERS(f, 0); + H5F_SET_SOHM_NINDEXES(f, 0); /* Shared object header messages are disabled */ - if(H5P_set(fc_plist, H5F_CRT_SHMSG_NINDEXES_NAME, &shared->sohm_nindexes) < 0) + tmp_sohm_nindexes = H5F_SOHM_NINDEXES(f); + if(H5P_set(fc_plist, H5F_CRT_SHMSG_NINDEXES_NAME, &tmp_sohm_nindexes) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTSET, FAIL, "can't set number of SOHM indexes") } /* end else */ done: /* Release the master SOHM table if we took it out of the cache */ - if(table && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_TABLE, shared->sohm_addr, table, H5AC__NO_FLAGS_SET) < 0) + if(table && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), table, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTUNPROTECT, FAIL, "unable to close SOHM master table") FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) @@ -1962,7 +2044,7 @@ herr_t H5SM_reconstitute(H5O_shared_t *sh_mesg, H5F_t *f, unsigned msg_type_id, H5O_fheap_id_t heap_id) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5SM_reconstitute) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check args */ HDassert(sh_mesg); @@ -1995,7 +2077,7 @@ H5SM_get_refcount_bt2_cb(const void *_record, void *_op_data) const H5SM_sohm_t *record = (const H5SM_sohm_t *)_record; /* v2 B-tree record for message */ H5SM_sohm_t *op_data = (H5SM_sohm_t *)_op_data; /* "op data" from v2 B-tree find */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5SM_get_refcount_bt2_cb) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* * Check arguments. @@ -2039,7 +2121,7 @@ H5SM_get_refcount(H5F_t *f, hid_t dxpl_id, unsigned type_id, void * encoding_buf = NULL; /* Buffer for encoded message */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(H5SM_get_refcount, dxpl_id, H5AC__SOHM_TAG, FAIL) + FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, H5AC__SOHM_TAG, FAIL) /* Sanity check */ HDassert(f); @@ -2050,7 +2132,7 @@ H5SM_get_refcount(H5F_t *f, hid_t dxpl_id, unsigned type_id, tbl_cache_udata.f = f; /* Look up the master SOHM table */ - if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, f->shared->sohm_addr, &tbl_cache_udata, H5AC_READ))) + if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), &tbl_cache_udata, H5AC_READ))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM master table") /* Find the correct index and find the message in it */ @@ -2124,7 +2206,7 @@ done: /* Release resources */ if(list && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_LIST, header->index_addr, list, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTUNPROTECT, FAIL, "unable to close SOHM index") - if(table && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_TABLE, f->shared->sohm_addr, table, H5AC__NO_FLAGS_SET) < 0) + if(table && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), table, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTUNPROTECT, FAIL, "unable to close SOHM master table") if(fheap && H5HF_close(fheap, dxpl_id) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTCLOSEOBJ, FAIL, "can't close fractal heap") @@ -2157,12 +2239,12 @@ done: */ static herr_t H5SM_read_iter_op(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, unsigned sequence, - hbool_t UNUSED *oh_modified, void *_udata/*in,out*/) + unsigned UNUSED *oh_modified, void *_udata/*in,out*/) { H5SM_read_udata_t *udata = (H5SM_read_udata_t *) _udata; herr_t ret_value = H5_ITER_CONT; - FUNC_ENTER_NOAPI_NOINIT(H5SM_read_iter_op) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -2219,7 +2301,7 @@ H5SM_read_mesg_fh_cb(const void *obj, size_t obj_len, void *_udata) H5SM_read_udata_t *udata = (H5SM_read_udata_t *)_udata; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT(H5SM_read_mesg_fh_cb) + FUNC_ENTER_NOAPI_NOINIT /* Allocate a buffer to hold the message */ if(NULL == (udata->encoding_buf = H5MM_malloc(obj_len))) @@ -2257,7 +2339,7 @@ H5SM_read_mesg(H5F_t *f, const H5SM_sohm_t *mesg, H5HF_t *fheap, H5O_t *oh = NULL; /* Object header for message in object header */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT_TAG(H5SM_read_mesg, dxpl_id, H5AC__SOHM_TAG, FAIL) + FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, H5AC__SOHM_TAG, FAIL) HDassert(f); HDassert(mesg); @@ -2350,7 +2432,7 @@ done: herr_t H5SM_table_free(H5SM_master_table_t *table) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5SM_table_free) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ HDassert(table); @@ -2379,7 +2461,7 @@ H5SM_table_free(H5SM_master_table_t *table) herr_t H5SM_list_free(H5SM_list_t *list) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5SM_list_free) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(list); HDassert(list->messages); @@ -2417,7 +2499,7 @@ H5SM_table_debug(H5F_t *f, hid_t dxpl_id, haddr_t table_addr, unsigned x; /* Counter variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(H5SM_table_debug, dxpl_id, H5AC__SOHM_TAG, FAIL) + FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__SOHM_TAG, FAIL) HDassert(f); HDassert(table_addr != HADDR_UNDEF); @@ -2429,12 +2511,12 @@ H5SM_table_debug(H5F_t *f, hid_t dxpl_id, haddr_t table_addr, * userblock */ if(table_vers == UFAIL) - table_vers = f->shared->sohm_vers; - else if(table_vers != f->shared->sohm_vers) + table_vers = H5F_SOHM_VERS(f); + else if(table_vers != H5F_SOHM_VERS(f)) HDfprintf(stream, "*** SOHM TABLE VERSION DOESN'T MATCH VERSION IN SUPERBLOCK!\n"); if(num_indexes == UFAIL) - num_indexes = f->shared->sohm_nindexes; - else if(num_indexes != f->shared->sohm_nindexes) + num_indexes = H5F_SOHM_NINDEXES(f); + else if(num_indexes != H5F_SOHM_NINDEXES(f)) HDfprintf(stream, "*** NUMBER OF SOHM INDEXES DOESN'T MATCH VALUE IN SUPERBLOCK!\n"); /* Check arguments. Version must be 0, the only version implemented so far */ @@ -2508,7 +2590,7 @@ H5SM_list_debug(H5F_t *f, hid_t dxpl_id, haddr_t list_addr, unsigned x; /* Counter variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(H5SM_list_debug, dxpl_id, H5AC__SOHM_TAG, FAIL) + FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__SOHM_TAG, FAIL) HDassert(f); HDassert(list_addr != HADDR_UNDEF); @@ -2598,11 +2680,11 @@ H5SM_ih_size(H5F_t *f, hid_t dxpl_id, hsize_t *hdr_size, H5_ih_info_t *ih_info) unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(H5SM_ih_size, dxpl_id, H5AC__SOHM_TAG, FAIL) + FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__SOHM_TAG, FAIL) /* Sanity check */ HDassert(f); - HDassert(H5F_addr_defined(f->shared->sohm_addr)); + HDassert(H5F_addr_defined(H5F_SOHM_ADDR(f))); HDassert(hdr_size); HDassert(ih_info); @@ -2610,7 +2692,7 @@ H5SM_ih_size(H5F_t *f, hid_t dxpl_id, hsize_t *hdr_size, H5_ih_info_t *ih_info) cache_udata.f = f; /* Look up the master SOHM table */ - if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, f->shared->sohm_addr, &cache_udata, H5AC_READ))) + if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), &cache_udata, H5AC_READ))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM master table") /* Get SOHM header size */ @@ -2662,7 +2744,7 @@ done: HDONE_ERROR(H5E_SOHM, H5E_CANTCLOSEOBJ, FAIL, "can't close fractal heap") if(bt2 && H5B2_close(bt2, dxpl_id) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTCLOSEOBJ, FAIL, "can't close v2 B-tree for SOHM index") - if(table && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_TABLE, f->shared->sohm_addr, table, H5AC__NO_FLAGS_SET) < 0) + if(table && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), table, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTUNPROTECT, FAIL, "unable to close SOHM master table") FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) diff --git a/src/H5SMbtree2.c b/src/H5SMbtree2.c index 156a6c5..daa1e4f 100755 --- a/src/H5SMbtree2.c +++ b/src/H5SMbtree2.c @@ -102,7 +102,7 @@ H5SM_bt2_crt_context(void *_f) H5SM_bt2_ctx_t *ctx; /* Callback context structure */ void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5SM_bt2_crt_context) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(f); @@ -140,7 +140,7 @@ H5SM_bt2_dst_context(void *_ctx) { H5SM_bt2_ctx_t *ctx = (H5SM_bt2_ctx_t *)_ctx; /* Callback context structure */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5SM_bt2_dst_context) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ HDassert(ctx); @@ -172,7 +172,7 @@ H5SM_bt2_store(void *native, const void *udata) { const H5SM_mesg_key_t *key = (const H5SM_mesg_key_t *)udata; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5SM_bt2_store) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Copy the source message to the B-tree */ *(H5SM_sohm_t *)native = key->message; @@ -200,7 +200,7 @@ H5SM_bt2_debug(FILE *stream, const H5F_t UNUSED *f, hid_t UNUSED dxpl_id, { const H5SM_sohm_t *sohm = (const H5SM_sohm_t *)record; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5SM_bt2_debug) + FUNC_ENTER_NOAPI_NOINIT_NOERR if(sohm->location == H5SM_IN_HEAP) HDfprintf(stream, "%*s%-*s {%a, %lo, %Hx}\n", indent, "", fwidth, @@ -236,7 +236,7 @@ H5SM_bt2_crt_dbg_context(H5F_t *f, hid_t UNUSED dxpl_id, haddr_t UNUSED addr) H5SM_bt2_ctx_t *ctx; /* Callback context structure */ void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5SM_bt2_crt_dbg_context) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(f); @@ -279,7 +279,7 @@ H5SM_bt2_convert_to_list_op(const void * record, void *op_data) const H5SM_list_t *list = (const H5SM_list_t *)op_data; size_t mesg_idx; /* Index of message to modify */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5SM_bt2_convert_to_list_op) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity checks */ HDassert(record); diff --git a/src/H5SMcache.c b/src/H5SMcache.c index 1511fd0..9955f39 100644 --- a/src/H5SMcache.c +++ b/src/H5SMcache.c @@ -17,7 +17,6 @@ /* Module Setup */ /****************/ -#define H5F_PACKAGE /*suppress error about including H5Fpkg */ #define H5SM_PACKAGE /*suppress error about including H5SMpkg */ @@ -25,7 +24,7 @@ /* Headers */ /***********/ #include "H5Eprivate.h" /* Error handling */ -#include "H5Fpkg.h" /* File access */ +#include "H5Fprivate.h" /* File access */ #include "H5FLprivate.h" /* Free Lists */ #include "H5MFprivate.h" /* File memory management */ #include "H5MMprivate.h" /* Memory management */ @@ -128,21 +127,21 @@ H5SM_table_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void UNUSED *udata) size_t x; /* Counter variable for index headers */ H5SM_master_table_t *ret_value; - FUNC_ENTER_NOAPI_NOINIT(H5SM_table_load) + FUNC_ENTER_NOAPI_NOINIT /* Verify that we're reading version 0 of the table; this is the only * version defined so far. */ - HDassert(f->shared->sohm_vers == HDF5_SHAREDHEADER_VERSION); + HDassert(H5F_SOHM_VERS(f) == HDF5_SHAREDHEADER_VERSION); /* Allocate space for the master table in memory */ if(NULL == (table = H5FL_CALLOC(H5SM_master_table_t))) HGOTO_ERROR(H5E_SOHM, H5E_NOSPACE, NULL, "memory allocation failed") /* Read number of indexes and version from file superblock */ - table->num_indexes = f->shared->sohm_nindexes; + table->num_indexes = H5F_SOHM_NINDEXES(f); - HDassert(addr == f->shared->sohm_addr); + HDassert(addr == H5F_SOHM_ADDR(f)); HDassert(addr != HADDR_UNDEF); HDassert(table->num_indexes > 0); @@ -257,7 +256,7 @@ H5SM_table_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5SM_ma uint8_t tbl_buf[H5SM_TBL_BUF_SIZE]; /* Buffer for table */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5SM_table_flush) + FUNC_ENTER_NOAPI_NOINIT /* check arguments */ HDassert(f); @@ -273,7 +272,7 @@ H5SM_table_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5SM_ma /* Verify that we're writing version 0 of the table; this is the only * version defined so far. */ - HDassert(f->shared->sohm_vers == HDF5_SHAREDHEADER_VERSION); + HDassert(H5F_SOHM_VERS(f) == HDF5_SHAREDHEADER_VERSION); /* Wrap the local buffer for serialized header info */ if(NULL == (wb = H5WB_wrap(tbl_buf, sizeof(tbl_buf)))) @@ -362,7 +361,7 @@ H5SM_table_dest(H5F_t UNUSED *f, H5SM_master_table_t* table) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5SM_table_dest) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(table); @@ -394,7 +393,7 @@ H5SM_table_clear(H5F_t *f, H5SM_master_table_t *table, hbool_t destroy) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5SM_table_clear) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -428,7 +427,7 @@ done: static herr_t H5SM_table_size(const H5F_t UNUSED *f, const H5SM_master_table_t *table, size_t *size_ptr) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5SM_table_size) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check arguments */ HDassert(f); @@ -469,7 +468,7 @@ H5SM_list_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) size_t x; /* Counter variable for messages in list */ H5SM_list_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5SM_list_load) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(udata->header); @@ -566,7 +565,7 @@ H5SM_list_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5SM_lis uint8_t lst_buf[H5SM_LST_BUF_SIZE]; /* Buffer for list index */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5SM_list_flush) + FUNC_ENTER_NOAPI_NOINIT /* check arguments */ HDassert(f); @@ -615,7 +614,7 @@ H5SM_list_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5SM_lis computed_chksum = H5_checksum_metadata(buf, (size_t)(p - buf), 0); UINT32ENCODE(p, computed_chksum); #ifdef H5_CLEAR_MEMORY -HDmemset(p, 0, (list->header->list_size - (p - buf))); +HDmemset(p, 0, (list->header->list_size - (size_t)(p - buf))); #endif /* H5_CLEAR_MEMORY */ /* Write the list to disk */ @@ -656,7 +655,7 @@ H5SM_list_dest(H5F_t *f, H5SM_list_t* list) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5SM_list_dest) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(list); @@ -700,7 +699,7 @@ H5SM_list_clear(H5F_t *f, H5SM_list_t *list, hbool_t destroy) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5SM_list_clear) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -734,7 +733,7 @@ done: static herr_t H5SM_list_size(const H5F_t UNUSED *f, const H5SM_list_t *list, size_t *size_ptr) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5SM_list_size) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check arguments */ HDassert(f); diff --git a/src/H5SMmessage.c b/src/H5SMmessage.c index 0d41a09..a9a58a4 100644 --- a/src/H5SMmessage.c +++ b/src/H5SMmessage.c @@ -52,7 +52,7 @@ typedef struct H5SM_compare_udata_t { /********************/ static herr_t H5SM_compare_cb(const void *obj, size_t obj_len, void *udata); static herr_t H5SM_compare_iter_op(H5O_t *oh, H5O_mesg_t *mesg, unsigned sequence, - hbool_t *oh_modified, void *udata); + unsigned *oh_modified, void *udata); /*********************/ @@ -92,7 +92,7 @@ H5SM_compare_cb(const void *obj, size_t obj_len, void *_udata) { H5SM_compare_udata_t *udata = (H5SM_compare_udata_t *)_udata; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5SM_compare_cb) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* If the encoding sizes are different, it's not the same object */ if(udata->key->encoding_size > obj_len) @@ -125,12 +125,12 @@ H5SM_compare_cb(const void *obj, size_t obj_len, void *_udata) */ static herr_t H5SM_compare_iter_op(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, unsigned sequence, - hbool_t UNUSED *oh_modified, void *_udata/*in,out*/) + unsigned UNUSED *oh_modified, void *_udata/*in,out*/) { H5SM_compare_udata_t *udata = (H5SM_compare_udata_t *) _udata; herr_t ret_value = H5_ITER_CONT; - FUNC_ENTER_NOAPI_NOINIT(H5SM_compare_iter_op) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. @@ -192,7 +192,7 @@ H5SM_message_compare(const void *rec1, const void *rec2) const H5SM_sohm_t *mesg = (const H5SM_sohm_t *) rec2; herr_t ret_value = 0; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5SM_message_compare) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* If the key has an fheap ID, we're looking for a message that's * already in the index; if the fheap ID matches, we've found the message @@ -291,7 +291,7 @@ H5SM_message_encode(uint8_t *raw, const void *_nrecord, void *_ctx) H5SM_bt2_ctx_t *ctx = (H5SM_bt2_ctx_t *)_ctx; /* Callback context structure */ const H5SM_sohm_t *message = (const H5SM_sohm_t *)_nrecord; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5SM_message_encode) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ HDassert(ctx); @@ -335,7 +335,7 @@ H5SM_message_decode(const uint8_t *raw, void *_nrecord, void *_ctx) H5SM_bt2_ctx_t *ctx = (H5SM_bt2_ctx_t *)_ctx; /* Callback context structure */ H5SM_sohm_t *message = (H5SM_sohm_t *)_nrecord; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5SM_message_decode) + FUNC_ENTER_NOAPI_NOINIT_NOERR message->location = (H5SM_storage_loc_t)*raw++; UINT32DECODE(raw, message->hash); diff --git a/src/H5SMpkg.h b/src/H5SMpkg.h index 84c2bf4..68dc484 100755 --- a/src/H5SMpkg.h +++ b/src/H5SMpkg.h @@ -83,7 +83,7 @@ H5SM_METADATA_PREFIX_SIZE \ \ /* Indices */ \ - + ((f)->shared->sohm_nindexes * H5SM_INDEX_HEADER_SIZE(f)) \ + + (H5F_SOHM_NINDEXES(f) * H5SM_INDEX_HEADER_SIZE(f)) \ ) #define H5SM_LIST_SIZE(f, num_mesg) ( \ diff --git a/src/H5SMprivate.h b/src/H5SMprivate.h index 46a43ad..d072434 100755 --- a/src/H5SMprivate.h +++ b/src/H5SMprivate.h @@ -26,6 +26,16 @@ #include "H5Oprivate.h" /* Object headers */ #include "H5Pprivate.h" /* Property lists */ +/**************************/ +/* Library Private Macros */ +/**************************/ + +/* Flags for the "defer_flags" argument to H5SM_try_share + */ +#define H5SM_DEFER 0x01u /* Don't actually write shared message to index, heap; just update shared info */ +#define H5SM_WAS_DEFERRED 0x02u /* Message was previously updated by a call to H5SM_try_share with H5SM_DEFER */ + + /****************************/ /* Library Private Typedefs */ /****************************/ @@ -44,7 +54,7 @@ H5_DLL herr_t H5SM_init(H5F_t *f, H5P_genplist_t *fc_plist, H5_DLL htri_t H5SM_can_share(H5F_t *f, hid_t dxpl_id, H5SM_master_table_t *table, ssize_t *sohm_index_num, unsigned type_id, const void *mesg); H5_DLL htri_t H5SM_try_share(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, - unsigned type_id, void *mesg, unsigned *mesg_flags); + unsigned defer_flags, unsigned type_id, void *mesg, unsigned *mesg_flags); H5_DLL herr_t H5SM_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, H5O_shared_t *sh_mesg); H5_DLL herr_t H5SM_get_info(const H5O_loc_t *ext_loc, H5P_genplist_t *fc_plist, diff --git a/src/H5SMtest.c b/src/H5SMtest.c index 5f4a89b..12ed766 100644 --- a/src/H5SMtest.c +++ b/src/H5SMtest.c @@ -17,7 +17,6 @@ /* Module Setup */ /****************/ -#define H5F_PACKAGE /*suppress error about including H5Fpkg */ #define H5SM_PACKAGE /*suppress error about including H5SMpkg */ #define H5SM_TESTING /*suppress warning about H5SM testing funcs*/ @@ -28,7 +27,8 @@ #include "H5private.h" /* Generic Functions */ #include "H5ACprivate.h" /* Metadata cache */ #include "H5Eprivate.h" /* Error handling */ -#include "H5Fpkg.h" /* File access */ +#include "H5Fprivate.h" /* File access */ +#include "H5FLprivate.h" /* Free Lists */ #include "H5SMpkg.h" /* Shared object header messages */ @@ -82,14 +82,14 @@ H5SM_get_mesg_count_test(H5F_t *f, hid_t dxpl_id, unsigned type_id, H5SM_master_table_t *table = NULL; /* SOHM master table */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(H5SM_get_mesg_count_test, dxpl_id, H5AC__SOHM_TAG, FAIL) + FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, H5AC__SOHM_TAG, FAIL) /* Sanity check */ HDassert(f); HDassert(mesg_count); /* Check for shared messages being enabled */ - if(H5F_addr_defined(f->shared->sohm_addr)) { + if(H5F_addr_defined(H5F_SOHM_ADDR(f))) { H5SM_index_header_t *header; /* Index header for message type */ H5SM_table_cache_ud_t cache_udata; /* User-data for callback */ ssize_t index_num; /* Table index for message type */ @@ -98,7 +98,7 @@ H5SM_get_mesg_count_test(H5F_t *f, hid_t dxpl_id, unsigned type_id, cache_udata.f = f; /* Look up the master SOHM table */ - if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, f->shared->sohm_addr, &cache_udata, H5AC_READ))) + if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), &cache_udata, H5AC_READ))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM master table") /* Find the correct index for this message type */ @@ -115,7 +115,7 @@ H5SM_get_mesg_count_test(H5F_t *f, hid_t dxpl_id, unsigned type_id, done: /* Release resources */ - if(table && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_TABLE, f->shared->sohm_addr, table, H5AC__NO_FLAGS_SET) < 0) + if(table && H5AC_unprotect(f, dxpl_id, H5AC_SOHM_TABLE, H5F_SOHM_ADDR(f), table, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTUNPROTECT, FAIL, "unable to close SOHM master table") FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) diff --git a/src/H5ST.c b/src/H5ST.c index 77e4bb4..7b61aa1 100644 --- a/src/H5ST.c +++ b/src/H5ST.c @@ -52,7 +52,7 @@ H5ST_create(void) { H5ST_tree_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5ST_create, NULL) + FUNC_ENTER_NOAPI(NULL) /* Allocate wrapper for TST */ if(NULL == (ret_value = H5FL_MALLOC(H5ST_tree_t))) @@ -87,7 +87,7 @@ done: static herr_t H5ST_close_internal(H5ST_ptr_t p) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5ST_close_internal) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Recursively free TST */ if(p) { @@ -125,7 +125,7 @@ H5ST_close(H5ST_tree_t *tree) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5ST_close, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check arguments */ if(NULL == tree) @@ -172,7 +172,7 @@ H5ST_insert(H5ST_tree_t *tree, const char *s, void *obj) H5ST_ptr_t up=NULL; /* Pointer to up node */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5ST_insert,FAIL); + FUNC_ENTER_NOAPI(FAIL) /* Find the correct location to insert object */ p = &tree->root; @@ -247,7 +247,7 @@ H5ST_search(H5ST_tree_t *tree, const char *s) H5ST_ptr_t p; /* Temporary pointer to TST node */ htri_t ret_value=FALSE; /* Return value */ - FUNC_ENTER_NOAPI_NOFUNC(H5ST_search) + FUNC_ENTER_NOAPI_NOINIT_NOERR p = tree->root; while (p) { @@ -291,7 +291,7 @@ H5ST_find_internal(H5ST_ptr_t p, const char *s) { H5ST_ptr_t ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5ST_find_internal) + FUNC_ENTER_NOAPI_NOINIT_NOERR while (p) { if (*s < p->splitchar) @@ -334,7 +334,7 @@ H5ST_find(H5ST_tree_t *tree, const char *s) { H5ST_ptr_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5ST_find, NULL) + FUNC_ENTER_NOAPI(NULL) if(NULL == (ret_value = H5ST_find_internal(tree->root, s))) HGOTO_ERROR(H5E_TST, H5E_NOTFOUND, NULL, "key not found in TST") @@ -369,7 +369,7 @@ H5ST_locate(H5ST_tree_t *tree, const char *s) H5ST_ptr_t node; /* Pointer to node located */ void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5ST_locate, NULL) + FUNC_ENTER_NOAPI(NULL) /* Locate the node to remove */ if(NULL == (node = H5ST_find_internal(tree->root, s))) @@ -406,7 +406,7 @@ H5ST_findfirst_internal(H5ST_ptr_t p) { H5ST_ptr_t ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5ST_findfirst_internal) + FUNC_ENTER_NOAPI_NOINIT_NOERR while(p) { /* Find least node in current tree */ @@ -452,7 +452,7 @@ H5ST_findfirst(H5ST_tree_t *tree) { H5ST_ptr_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5ST_findfirst, NULL) + FUNC_ENTER_NOAPI(NULL) if(NULL == (ret_value = H5ST_findfirst_internal(tree->root))) HGOTO_ERROR(H5E_TST,H5E_NOTFOUND,NULL,"no nodes in TST"); @@ -485,7 +485,7 @@ H5ST_getnext(H5ST_ptr_t p) { H5ST_ptr_t ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5ST_getnext) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* If the node to continue from has higher-valued nodes attached */ if(p->hikid) { @@ -544,7 +544,7 @@ H5ST_findnext(H5ST_ptr_t p) H5ST_ptr_t q; /* Temporary pointer to TST node */ H5ST_ptr_t ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOFUNC(H5ST_findnext) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Find the next node at the current level, or go back up the tree */ do { @@ -587,7 +587,7 @@ H5ST_delete_internal(H5ST_ptr_t *root, H5ST_ptr_t p) H5ST_ptr_t q, /* Temporary pointer to TST node */ newp; /* Pointer to node which will replace deleted node in tree */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5ST_delete_internal) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Find node to replace one being deleted */ if(p->lokid) { @@ -663,7 +663,7 @@ H5ST_delete(H5ST_tree_t *tree, H5ST_ptr_t p) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5ST_delete, FAIL) + FUNC_ENTER_NOAPI(FAIL) if(H5ST_delete_internal(&tree->root, p) < 0) HGOTO_ERROR(H5E_TST, H5E_CANTDELETE, FAIL, "can't delete node from TST") @@ -698,7 +698,7 @@ H5ST_remove(H5ST_tree_t *tree, const char *s) H5ST_ptr_t node; /* Pointer to node to remove */ void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5ST_remove, NULL) + FUNC_ENTER_NOAPI(NULL) /* Locate the node to remove */ if(NULL == (node = H5ST_find_internal(tree->root, s))) @@ -738,7 +738,7 @@ done: herr_t H5ST_dump_internal(H5ST_ptr_t p) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5ST_dump_internal) + FUNC_ENTER_NOAPI_NOINIT_NOERR if(p) { printf("p=%p\n", p); @@ -782,7 +782,7 @@ H5ST_dump_internal(H5ST_ptr_t p) herr_t H5ST_dump(H5ST_tree_t *tree) { - FUNC_ENTER_NOAPI_NOFUNC(H5ST_dump, NULL) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Dump the tree */ H5ST_dump_internal(tree->root); diff --git a/src/H5Sall.c b/src/H5Sall.c index c98781a..c99d699 100644 --- a/src/H5Sall.c +++ b/src/H5Sall.c @@ -115,7 +115,7 @@ static const H5S_sel_iter_class_t H5S_sel_iter_all[1] = {{ herr_t H5S_all_iter_init (H5S_sel_iter_t *iter, const H5S_t *space) { - FUNC_ENTER_NOAPI_NOFUNC(H5S_all_iter_init); + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ assert (space && H5S_SEL_ALL==H5S_GET_SELECT_TYPE(space)); @@ -131,7 +131,7 @@ H5S_all_iter_init (H5S_sel_iter_t *iter, const H5S_t *space) /* Initialize type of selection iterator */ iter->type=H5S_sel_iter_all; - FUNC_LEAVE_NOAPI(SUCCEED); + FUNC_LEAVE_NOAPI(SUCCEED) } /* H5S_all_iter_init() */ @@ -155,7 +155,7 @@ H5S_all_iter_coords (const H5S_sel_iter_t *iter, hsize_t *coords) { herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5S_all_iter_coords); + FUNC_ENTER_NOAPI_NOINIT /* Check args */ assert (iter); @@ -166,7 +166,7 @@ H5S_all_iter_coords (const H5S_sel_iter_t *iter, hsize_t *coords) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't retrieve coordinates"); done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* H5S_all_iter_coords() */ @@ -190,7 +190,7 @@ H5S_all_iter_block (const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end) { unsigned u; /* Local index variable */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_all_iter_block); + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ assert (iter); @@ -207,7 +207,7 @@ H5S_all_iter_block (const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end) end[u]=iter->dims[u]-1; } /* end for */ - FUNC_LEAVE_NOAPI(SUCCEED); + FUNC_LEAVE_NOAPI(SUCCEED) } /* H5S_all_iter_coords() */ @@ -228,12 +228,12 @@ H5S_all_iter_block (const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end) static hsize_t H5S_all_iter_nelmts (const H5S_sel_iter_t *iter) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_all_iter_nelmts); + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ assert (iter); - FUNC_LEAVE_NOAPI(iter->elmt_left); + FUNC_LEAVE_NOAPI(iter->elmt_left) } /* H5S_all_iter_nelmts() */ @@ -257,12 +257,12 @@ H5S_all_iter_nelmts (const H5S_sel_iter_t *iter) static htri_t H5S_all_iter_has_next_block (const H5S_sel_iter_t UNUSED *iter) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_all_iter_has_next_block); + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ assert (iter); - FUNC_LEAVE_NOAPI(FALSE); + FUNC_LEAVE_NOAPI(FALSE) } /* H5S_all_iter_has_next_block() */ @@ -287,7 +287,7 @@ H5S_all_iter_has_next_block (const H5S_sel_iter_t UNUSED *iter) static herr_t H5S_all_iter_next(H5S_sel_iter_t *iter, size_t nelem) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_all_iter_next); + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ assert (iter); @@ -297,7 +297,7 @@ H5S_all_iter_next(H5S_sel_iter_t *iter, size_t nelem) iter->u.all.elmt_offset+=nelem; iter->u.all.byte_offset+=(nelem*iter->elmt_size); - FUNC_LEAVE_NOAPI(SUCCEED); + FUNC_LEAVE_NOAPI(SUCCEED) } /* H5S_all_iter_next() */ @@ -321,12 +321,12 @@ H5S_all_iter_next(H5S_sel_iter_t *iter, size_t nelem) static herr_t H5S_all_iter_next_block(H5S_sel_iter_t UNUSED *iter) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_all_iter_next_block); + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ assert (iter); - FUNC_LEAVE_NOAPI(FAIL); + FUNC_LEAVE_NOAPI(FAIL) } /* H5S_all_iter_next_block() */ @@ -350,12 +350,12 @@ H5S_all_iter_next_block(H5S_sel_iter_t UNUSED *iter) static herr_t H5S_all_iter_release (H5S_sel_iter_t UNUSED * iter) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_all_iter_release); + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ assert (iter); - FUNC_LEAVE_NOAPI(SUCCEED); + FUNC_LEAVE_NOAPI(SUCCEED) } /* H5S_all_iter_release() */ @@ -379,7 +379,7 @@ H5S_all_iter_release (H5S_sel_iter_t UNUSED * iter) static herr_t H5S_all_release(H5S_t *space) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_all_release) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(space); @@ -413,7 +413,7 @@ H5S_all_release(H5S_t *space) static herr_t H5S_all_copy(H5S_t *dst, const H5S_t UNUSED *src, hbool_t UNUSED share_selection) { - FUNC_ENTER_NOAPI_NOFUNC(H5S_all_copy) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(src); HDassert(dst); @@ -448,11 +448,11 @@ H5S_all_copy(H5S_t *dst, const H5S_t UNUSED *src, hbool_t UNUSED share_selection htri_t H5S_all_is_valid (const H5S_t UNUSED *space) { - FUNC_ENTER_NOAPI_NOFUNC(H5S_all_is_valid); + FUNC_ENTER_NOAPI_NOINIT_NOERR assert(space); - FUNC_LEAVE_NOAPI(TRUE); + FUNC_LEAVE_NOAPI(TRUE) } /* end H5S_all_is_valid() */ @@ -478,7 +478,7 @@ H5S_all_is_valid (const H5S_t UNUSED *space) hssize_t H5S_all_serial_size (const H5S_t UNUSED *space) { - FUNC_ENTER_NOAPI_NOFUNC(H5S_all_serial_size); + FUNC_ENTER_NOAPI_NOINIT_NOERR assert(space); @@ -486,7 +486,7 @@ H5S_all_serial_size (const H5S_t UNUSED *space) * + + + * = 16 bytes */ - FUNC_LEAVE_NOAPI(16); + FUNC_LEAVE_NOAPI(16) } /* end H5S_all_serial_size() */ @@ -512,7 +512,7 @@ H5S_all_serial_size (const H5S_t UNUSED *space) herr_t H5S_all_serialize (const H5S_t *space, uint8_t *buf) { - FUNC_ENTER_NOAPI_NOFUNC(H5S_all_serialize); + FUNC_ENTER_NOAPI_NOINIT_NOERR assert(space); @@ -522,7 +522,7 @@ H5S_all_serialize (const H5S_t *space, uint8_t *buf) UINT32ENCODE(buf, (uint32_t)0); /* Store the un-used padding */ UINT32ENCODE(buf, (uint32_t)0); /* Store the additional information length */ - FUNC_LEAVE_NOAPI(SUCCEED); + FUNC_LEAVE_NOAPI(SUCCEED) } /* H5S_all_serialize() */ @@ -550,7 +550,7 @@ H5S_all_deserialize(H5S_t *space, const uint8_t UNUSED *buf) { herr_t ret_value; /* return value */ - FUNC_ENTER_NOAPI(H5S_all_deserialize, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert(space); @@ -594,7 +594,7 @@ H5S_all_bounds(const H5S_t *space, hsize_t *start, hsize_t *end) unsigned rank; /* Dataspace rank */ unsigned i; /* index variable */ - FUNC_ENTER_NOAPI_NOFUNC(H5S_all_bounds) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(space); HDassert(start); @@ -636,7 +636,7 @@ H5S_all_bounds(const H5S_t *space, hsize_t *start, hsize_t *end) herr_t H5S_all_offset(const H5S_t UNUSED *space, hsize_t *offset) { - FUNC_ENTER_NOAPI_NOFUNC(H5S_all_offset) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(space); HDassert(offset); @@ -669,11 +669,11 @@ H5S_all_offset(const H5S_t UNUSED *space, hsize_t *offset) htri_t H5S_all_is_contiguous(const H5S_t UNUSED *space) { - FUNC_ENTER_NOAPI_NOFUNC(H5S_all_is_contiguous); + FUNC_ENTER_NOAPI_NOINIT_NOERR assert(space); - FUNC_LEAVE_NOAPI(TRUE); + FUNC_LEAVE_NOAPI(TRUE) } /* H5S_all_is_contiguous() */ @@ -698,11 +698,11 @@ H5S_all_is_contiguous(const H5S_t UNUSED *space) htri_t H5S_all_is_single(const H5S_t UNUSED *space) { - FUNC_ENTER_NOAPI_NOFUNC(H5S_all_is_single); + FUNC_ENTER_NOAPI_NOINIT_NOERR assert(space); - FUNC_LEAVE_NOAPI(TRUE); + FUNC_LEAVE_NOAPI(TRUE) } /* H5S_all_is_single() */ @@ -728,12 +728,12 @@ H5S_all_is_single(const H5S_t UNUSED *space) htri_t H5S_all_is_regular(const H5S_t UNUSED *space) { - FUNC_ENTER_NOAPI_NOFUNC(H5S_all_is_regular); + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ assert(space); - FUNC_LEAVE_NOAPI(TRUE); + FUNC_LEAVE_NOAPI(TRUE) } /* H5S_all_is_regular() */ @@ -758,7 +758,7 @@ H5S_all_is_regular(const H5S_t UNUSED *space) herr_t H5S_all_adjust_u(H5S_t UNUSED *space, const hsize_t UNUSED *offset) { - FUNC_ENTER_NOAPI_NOFUNC(H5S_all_adjust_u) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(space); @@ -784,7 +784,7 @@ H5S_all_adjust_u(H5S_t UNUSED *space, const hsize_t UNUSED *offset) static herr_t H5S_all_project_scalar(const H5S_t UNUSED *space, hsize_t *offset) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_all_project_scalar) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(space && H5S_SEL_ALL == H5S_GET_SELECT_TYPE(space)); @@ -815,7 +815,7 @@ H5S_all_project_simple(const H5S_t *base_space, H5S_t *new_space, hsize_t *offse { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5S_all_project_simple) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(base_space && H5S_SEL_ALL == H5S_GET_SELECT_TYPE(base_space)); @@ -854,7 +854,7 @@ H5S_select_all(H5S_t *space, hbool_t rel_prev) { herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_NOAPI(H5S_select_all, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args */ HDassert(space); @@ -898,7 +898,7 @@ H5Sselect_all(hid_t spaceid) H5S_t *space; /* Dataspace to modify selection of */ herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_API(H5Sselect_all, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", spaceid); /* Check args */ @@ -952,7 +952,7 @@ H5S_all_get_seq_list(const H5S_t UNUSED *space, unsigned UNUSED flags, H5S_sel_i { size_t elem_used; /* The number of elements used */ - FUNC_ENTER_NOAPI_NOFUNC(H5S_all_get_seq_list); + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ assert(space); @@ -983,6 +983,6 @@ H5S_all_get_seq_list(const H5S_t UNUSED *space, unsigned UNUSED flags, H5S_sel_i iter->u.all.elmt_offset+=elem_used; iter->u.all.byte_offset+=len[0]; - FUNC_LEAVE_NOAPI(SUCCEED); + FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5S_all_get_seq_list() */ diff --git a/src/H5Sdbg.c b/src/H5Sdbg.c index 352795e..df033da 100644 --- a/src/H5Sdbg.c +++ b/src/H5Sdbg.c @@ -93,7 +93,7 @@ H5S_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE *stream, int indent, { const H5S_t *mesg = (const H5S_t*)_mesg; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_debug) + FUNC_ENTER_NOAPI_NOINIT_NOERR switch(H5S_GET_EXTENT_TYPE(mesg)) { case H5S_NULL: diff --git a/src/H5Shyper.c b/src/H5Shyper.c index 2622101..1eeb098 100644 --- a/src/H5Shyper.c +++ b/src/H5Shyper.c @@ -140,7 +140,7 @@ H5FL_DEFINE_STATIC(H5S_hyper_span_info_t); static herr_t H5S_hyper_print_spans_helper(FILE *f, struct H5S_hyper_span_t *span,unsigned depth) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_print_spans_helper) + FUNC_ENTER_NOAPI_NOINIT_NOERR while(span) { HDfprintf(f,"%s: depth=%u, span=%p, (%d, %d), nelem=%u, pstride=%u\n",FUNC,depth,span,(int)span->low,(int)span->high,(unsigned)span->nelem,(unsigned)span->pstride); @@ -157,7 +157,7 @@ H5S_hyper_print_spans_helper(FILE *f, struct H5S_hyper_span_t *span,unsigned dep herr_t H5S_hyper_print_spans(FILE *f, const struct H5S_hyper_span_info_t *span_lst) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_print_spans) + FUNC_ENTER_NOAPI_NOINIT_NOERR if(span_lst!=NULL) { HDfprintf(f,"%s: spans=%p, count=%u, scratch=%p, head=%p\n",FUNC,span_lst,span_lst->count,span_lst->scratch,span_lst->head); @@ -170,7 +170,7 @@ H5S_hyper_print_spans(FILE *f, const struct H5S_hyper_span_info_t *span_lst) herr_t H5S_space_print_spans(FILE *f, const H5S_t *space) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_space_print_spans) + FUNC_ENTER_NOAPI_NOINIT_NOERR H5S_hyper_print_spans(f,space->select.sel_info.hslab->span_lst); @@ -182,7 +182,7 @@ H5S_hyper_print_diminfo_helper(FILE *f, const char *field, unsigned ndims, const { unsigned u; /* Local index variable */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_print_diminfo_helper) + FUNC_ENTER_NOAPI_NOINIT_NOERR if(dinfo!=NULL) { HDfprintf(f,"%s: %s: start=[",FUNC,field); @@ -207,7 +207,7 @@ H5S_hyper_print_diminfo_helper(FILE *f, const char *field, unsigned ndims, const herr_t H5S_hyper_print_diminfo(FILE *f, const H5S_t *space) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_print_diminfo) + FUNC_ENTER_NOAPI_NOINIT_NOERR H5S_hyper_print_diminfo_helper(f,"opt_diminfo",space->extent.rank,space->select.sel_info.hslab->opt_diminfo); H5S_hyper_print_diminfo_helper(f,"app_diminfo",space->extent.rank,space->select.sel_info.hslab->app_diminfo); @@ -243,7 +243,7 @@ H5S_hyper_iter_init(H5S_sel_iter_t *iter, const H5S_t *space) unsigned u; /* Index variable */ int i; /* Index variable */ - FUNC_ENTER_NOAPI_NOFUNC(H5S_hyper_iter_init) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(space && H5S_SEL_HYPERSLABS == H5S_GET_SELECT_TYPE(space)); @@ -428,7 +428,7 @@ H5S_hyper_iter_init(H5S_sel_iter_t *iter, const H5S_t *space) static herr_t H5S_hyper_iter_coords (const H5S_sel_iter_t *iter, hsize_t *coords) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_iter_coords) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(iter); @@ -520,7 +520,7 @@ H5S_hyper_iter_block (const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end) { unsigned u; /* Local index variable */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_iter_block) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(iter); @@ -568,7 +568,7 @@ H5S_hyper_iter_block (const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end) static hsize_t H5S_hyper_iter_nelmts (const H5S_sel_iter_t *iter) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_iter_nelmts) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(iter); @@ -600,7 +600,7 @@ H5S_hyper_iter_has_next_block(const H5S_sel_iter_t *iter) unsigned u; /* Local index variable */ htri_t ret_value = FALSE; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_iter_has_next_block) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(iter); @@ -658,7 +658,7 @@ H5S_hyper_iter_next(H5S_sel_iter_t *iter, size_t nelem) int fast_dim; /* Rank of the fastest changing dimension for the dataspace */ unsigned i; /* Counters */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_iter_next) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check for the special case of just one H5Sselect_hyperslab call made */ /* (i.e. a regular hyperslab selection */ @@ -873,7 +873,7 @@ H5S_hyper_iter_next_block(H5S_sel_iter_t *iter) int fast_dim; /* Rank of the fastest changing dimension for the dataspace */ unsigned u; /* Counters */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_iter_next_block) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check for the special case of just one H5Sselect_hyperslab call made */ /* (i.e. a regular hyperslab selection */ @@ -1055,7 +1055,7 @@ H5S_hyper_iter_next_block(H5S_sel_iter_t *iter) static herr_t H5S_hyper_iter_release (H5S_sel_iter_t *iter) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_iter_release) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(iter); @@ -1095,7 +1095,7 @@ H5S_hyper_new_span(hsize_t low, hsize_t high, H5S_hyper_span_info_t *down, H5S_h { H5S_hyper_span_t *ret_value; - FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_new_span) + FUNC_ENTER_NOAPI_NOINIT /* Allocate a new span node */ if(NULL == (ret_value = H5FL_MALLOC(H5S_hyper_span_t))) @@ -1143,7 +1143,7 @@ H5S_hyper_span_precompute_helper (H5S_hyper_span_info_t *spans, size_t elmt_size H5S_hyper_span_t *span; /* Hyperslab span */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_span_precompute_helper) + FUNC_ENTER_NOAPI_NOINIT HDassert(spans); @@ -1201,7 +1201,7 @@ H5S_hyper_span_precompute(H5S_hyper_span_info_t *spans, size_t elmt_size) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_span_precompute) + FUNC_ENTER_NOAPI_NOINIT HDassert(spans); @@ -1237,7 +1237,7 @@ done: static void H5S_hyper_span_scratch(H5S_hyper_span_info_t *spans, void *scr_value) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_span_scratch) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(spans); @@ -1290,7 +1290,7 @@ H5S_hyper_copy_span_helper (H5S_hyper_span_info_t *spans) H5S_hyper_span_info_t *new_down; /* New down span tree */ H5S_hyper_span_info_t *ret_value; - FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_copy_span_helper) + FUNC_ENTER_NOAPI_NOINIT HDassert(spans); @@ -1376,7 +1376,7 @@ H5S_hyper_copy_span(H5S_hyper_span_info_t *spans) { H5S_hyper_span_info_t *ret_value; - FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_copy_span) + FUNC_ENTER_NOAPI_NOINIT HDassert(spans); @@ -1419,7 +1419,7 @@ H5S_hyper_cmp_spans (H5S_hyper_span_info_t *span_info1, H5S_hyper_span_info_t *s htri_t nest=FAIL; htri_t ret_value=FAIL; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_cmp_spans) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check for redundant comparison */ if(span_info1==span_info2) @@ -1520,7 +1520,7 @@ H5S_hyper_free_span_info (H5S_hyper_span_info_t *span_info) H5S_hyper_span_t *span, *next_span; herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_free_span_info) + FUNC_ENTER_NOAPI_NOINIT HDassert(span_info); @@ -1572,7 +1572,7 @@ H5S_hyper_free_span (H5S_hyper_span_t *span) { herr_t ret_value=SUCCEED; - FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_free_span) + FUNC_ENTER_NOAPI_NOINIT HDassert(span); @@ -1621,7 +1621,7 @@ H5S_hyper_copy (H5S_t *dst, const H5S_t *src, hbool_t share_selection) const H5S_hyper_sel_t *src_hslab; /* Pointer to source hyperslab info */ herr_t ret_value=SUCCEED; /* return value */ - FUNC_ENTER_NOAPI(H5S_hyper_copy, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert(src); HDassert(dst); @@ -1693,7 +1693,7 @@ H5S_hyper_is_valid_helper (const H5S_hyper_span_info_t *spans, const hssize_t *o htri_t tmp; /* temporary return value */ htri_t ret_value=TRUE; /* return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_is_valid_helper) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(spans); HDassert(offset); @@ -1755,7 +1755,7 @@ H5S_hyper_is_valid (const H5S_t *space) unsigned u; /* Counter */ htri_t ret_value=TRUE; /* return value */ - FUNC_ENTER_NOAPI_NOFUNC(H5S_hyper_is_valid) + FUNC_ENTER_NOAPI_NOERR HDassert(space); @@ -1816,7 +1816,7 @@ H5S_hyper_span_nblocks(H5S_hyper_span_info_t *spans) H5S_hyper_span_t *span; /* Hyperslab span */ hsize_t ret_value = 0; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_span_nblocks) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Count the number of elements in the span tree */ if(spans != NULL) { @@ -1860,7 +1860,7 @@ H5S_get_select_hyper_nblocks(H5S_t *space) { hsize_t ret_value; /* return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_get_select_hyper_nblocks) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(space); @@ -1902,7 +1902,7 @@ H5Sget_select_hyper_nblocks(hid_t spaceid) H5S_t *space; /* Dataspace to modify selection of */ hssize_t ret_value; /* return value */ - FUNC_ENTER_API(H5Sget_select_hyper_nblocks, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("Hs", "i", spaceid); /* Check args */ @@ -1944,7 +1944,7 @@ H5S_hyper_serial_size(const H5S_t *space) hsize_t block_count; /* block counter for regular hyperslabs */ hssize_t ret_value; /* return value */ - FUNC_ENTER_NOAPI_NOFUNC(H5S_hyper_serial_size) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(space); @@ -2000,7 +2000,7 @@ H5S_hyper_serialize_helper (const H5S_hyper_span_info_t *spans, hsize_t *start, hsize_t u; /* Index variable */ herr_t ret_value=SUCCEED; /* return value */ - FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_serialize_helper) + FUNC_ENTER_NOAPI_NOINIT /* Sanity checks */ HDassert(spans); @@ -2084,7 +2084,7 @@ H5S_hyper_serialize (const H5S_t *space, uint8_t *buf) unsigned ndims; /* Rank of the dataspace */ int done; /* Whether we are done with the iteration */ - FUNC_ENTER_NOAPI_NOFUNC(H5S_hyper_serialize) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(space); @@ -2247,7 +2247,7 @@ H5S_hyper_deserialize (H5S_t *space, const uint8_t *buf) unsigned i,j; /* local counting variables */ herr_t ret_value=FAIL; /* return value */ - FUNC_ENTER_NOAPI(H5S_hyper_deserialize, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args */ HDassert(space); @@ -2330,7 +2330,7 @@ H5S_hyper_span_blocklist(H5S_hyper_span_info_t *spans, hsize_t start[], hsize_t hsize_t u; /* Index variable */ herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_span_blocklist) + FUNC_ENTER_NOAPI_NOINIT /* Sanity checks */ HDassert(spans); @@ -2429,7 +2429,7 @@ H5S_get_select_hyper_blocklist(H5S_t *space, hbool_t internal, hsize_t startbloc { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_get_select_hyper_blocklist) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(space); HDassert(buf); @@ -2587,7 +2587,7 @@ H5Sget_select_hyper_blocklist(hid_t spaceid, hsize_t startblock, H5S_t *space; /* Dataspace to modify selection of */ herr_t ret_value; /* return value */ - FUNC_ENTER_API(H5Sget_select_hyper_blocklist, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE4("e", "ihh*[a2]h", spaceid, startblock, numblocks, buf); /* Check args */ @@ -2643,7 +2643,7 @@ H5S_hyper_bounds_helper(const H5S_hyper_span_info_t *spans, const hssize_t *offs H5S_hyper_span_t *curr; /* Hyperslab information nodes */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_bounds_helper) + FUNC_ENTER_NOAPI_NOINIT HDassert(spans); HDassert(offset); @@ -2712,7 +2712,7 @@ H5S_hyper_bounds(const H5S_t *space, hsize_t *start, hsize_t *end) unsigned i; /* index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5S_hyper_bounds, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert(space); HDassert(start); @@ -2782,7 +2782,7 @@ H5S_hyper_offset(const H5S_t *space, hsize_t *offset) int i; /* index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5S_hyper_offset, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert(space); HDassert(offset); @@ -2886,7 +2886,7 @@ H5S_hyper_is_contiguous(const H5S_t *space) unsigned u; /* index variable */ htri_t ret_value = FALSE; /* Return value */ - FUNC_ENTER_NOAPI_NOFUNC(H5S_hyper_is_contiguous) + FUNC_ENTER_NOAPI_NOERR HDassert(space); @@ -3071,7 +3071,7 @@ H5S_hyper_is_single(const H5S_t *space) unsigned u; /* index variable */ htri_t ret_value=TRUE; /* return value */ - FUNC_ENTER_NOAPI_NOFUNC(H5S_hyper_is_single) + FUNC_ENTER_NOAPI_NOERR HDassert(space); @@ -3138,7 +3138,7 @@ H5S_hyper_is_regular(const H5S_t *space) { htri_t ret_value; /* return value */ - FUNC_ENTER_NOAPI_NOFUNC(H5S_hyper_is_regular) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(space); @@ -3180,7 +3180,7 @@ H5S_hyper_release(H5S_t *space) { herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI(H5S_hyper_release, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args */ HDassert(space && H5S_SEL_HYPERSLABS == H5S_GET_SELECT_TYPE(space)); @@ -3225,7 +3225,7 @@ done: static herr_t H5S_hyper_recover_span (unsigned *recover, H5S_hyper_span_t **curr_span, H5S_hyper_span_t *next_span) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_recover_span) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(recover); HDassert(curr_span); @@ -3268,7 +3268,7 @@ H5S_hyper_coord_to_span(unsigned rank, hsize_t *coords) H5S_hyper_span_info_t *down=NULL; /* Pointer to new span tree for next level down */ H5S_hyper_span_t *ret_value=NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_coord_to_span) + FUNC_ENTER_NOAPI_NOINIT HDassert(rank > 0); HDassert(coords); @@ -3337,7 +3337,7 @@ H5S_hyper_add_span_element_helper(H5S_hyper_span_info_t *span_tree, unsigned ran H5S_hyper_span_t *new_span; /* New span created for element */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_add_span_element_helper) + FUNC_ENTER_NOAPI_NOINIT HDassert(span_tree); HDassert(rank > 0); @@ -3535,7 +3535,7 @@ H5S_hyper_add_span_element(H5S_t *space, unsigned rank, hsize_t *coords) H5S_hyper_span_info_t *head = NULL; /* Pointer to new head of span tree */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_add_span_element) + FUNC_ENTER_NOAPI_NOINIT HDassert(space); HDassert(rank > 0); @@ -3611,7 +3611,7 @@ done: herr_t H5S_hyper_reset_scratch(H5S_t *space) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_reset_scratch) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(space); @@ -3649,7 +3649,7 @@ H5S_hyper_convert(H5S_t *space) { herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_convert) + FUNC_ENTER_NOAPI_NOINIT HDassert(space); @@ -3721,7 +3721,7 @@ H5S_hyper_intersect_helper (H5S_hyper_span_info_t *spans1, H5S_hyper_span_info_t htri_t status; /* Status from recursive call */ htri_t ret_value=FALSE; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_intersect_helper) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert((spans1 && spans2) || (spans1 == NULL && spans2 == NULL)); @@ -3788,7 +3788,7 @@ H5S_hyper_intersect (H5S_t *space1, H5S_t *space2) { htri_t ret_value=FAIL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_intersect) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(space1); @@ -3840,7 +3840,7 @@ H5S_hyper_intersect_block_helper (const H5S_hyper_span_info_t *spans, hsize_t *s htri_t status; /* Status from recursive call */ htri_t ret_value=FALSE; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_intersect_block_helper) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(spans); @@ -3907,7 +3907,7 @@ H5S_hyper_intersect_block (H5S_t *space, hsize_t *start, hsize_t *end) { htri_t ret_value=FAIL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_intersect_block) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(space); @@ -3956,7 +3956,7 @@ H5S_hyper_adjust_helper_u (H5S_hyper_span_info_t *spans, const hsize_t *offset) { H5S_hyper_span_t *span; /* Pointer to current span in span tree */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_adjust_helper_u) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ HDassert(spans); @@ -4014,7 +4014,7 @@ H5S_hyper_adjust_u(H5S_t *space, const hsize_t *offset) unsigned u; /* Local index variable */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_adjust_u) + FUNC_ENTER_NOAPI_NOINIT HDassert(space); HDassert(offset); @@ -4060,7 +4060,7 @@ H5S_hyper_project_scalar(const H5S_t *space, hsize_t *offset) hsize_t block[H5S_MAX_RANK]; /* Block selected in base dataspace */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_project_scalar) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(space && H5S_SEL_HYPERSLABS == H5S_GET_SELECT_TYPE(space)); @@ -4128,7 +4128,7 @@ H5S_hyper_project_simple_lower(const H5S_t *base_space, H5S_t *new_space) H5S_hyper_span_info_t *down; /* Pointer to list of spans */ unsigned curr_dim; /* Current dimension being operated on */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_project_simple_lower) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(base_space && H5S_SEL_HYPERSLABS == H5S_GET_SELECT_TYPE(base_space)); @@ -4176,7 +4176,7 @@ H5S_hyper_project_simple_higher(const H5S_t *base_space, H5S_t *new_space) unsigned curr_dim; /* Current dimension being operated on */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_project_simple_higher) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(base_space && H5S_SEL_HYPERSLABS == H5S_GET_SELECT_TYPE(base_space)); @@ -4264,7 +4264,7 @@ H5S_hyper_project_simple(const H5S_t *base_space, H5S_t *new_space, hsize_t *off { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_project_simple) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(base_space && H5S_SEL_HYPERSLABS == H5S_GET_SELECT_TYPE(base_space)); @@ -4432,7 +4432,7 @@ H5S_hyper_adjust_helper_s(H5S_hyper_span_info_t *spans, const hssize_t *offset) { H5S_hyper_span_t *span; /* Pointer to current span in span tree */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_adjust_helper_s) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ HDassert(spans); @@ -4490,7 +4490,7 @@ H5S_hyper_adjust_s(H5S_t *space, const hssize_t *offset) unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_adjust_s) + FUNC_ENTER_NOAPI_NOINIT HDassert(space); HDassert(offset); @@ -4544,7 +4544,7 @@ H5S_hyper_normalize_offset(H5S_t *space, hssize_t *old_offset) unsigned u; /* Local index variable */ herr_t ret_value = FALSE; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_normalize_offset) + FUNC_ENTER_NOAPI_NOINIT HDassert(space); @@ -4598,7 +4598,7 @@ H5S_hyper_denormalize_offset(H5S_t *space, const hssize_t *old_offset) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_denormalize_offset) + FUNC_ENTER_NOAPI_NOINIT HDassert(space); HDassert(H5S_GET_SELECT_TYPE(space) == H5S_SEL_HYPERSLABS); @@ -4643,7 +4643,7 @@ H5S_hyper_append_span (H5S_hyper_span_t **prev_span, H5S_hyper_span_info_t ** sp H5S_hyper_span_t *new_span = NULL; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_append_span) + FUNC_ENTER_NOAPI_NOINIT HDassert(prev_span); HDassert(span_tree); @@ -4767,7 +4767,7 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s unsigned recover_a, recover_b; /* Flags to indicate when to recover temporary spans */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_clip_spans) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(a_spans); @@ -5257,7 +5257,7 @@ H5S_hyper_merge_spans_helper (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_inf unsigned recover_a, recover_b; /* Flags to indicate when to recover temporary spans */ H5S_hyper_span_info_t *ret_value; - FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_merge_spans_helper) + FUNC_ENTER_NOAPI_NOINIT /* Make certain both 'a' & 'b' spans have down span trees or neither does */ HDassert((a_spans != NULL && b_spans != NULL) || (a_spans == NULL && b_spans == NULL)); @@ -5569,7 +5569,7 @@ done: static herr_t H5S_hyper_merge_spans (H5S_t *space, H5S_hyper_span_info_t *new_spans, hbool_t can_own) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_merge_spans) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(space); @@ -5625,7 +5625,7 @@ H5S_hyper_spans_nelem (H5S_hyper_span_info_t *spans) H5S_hyper_span_t *span; /* Hyperslab span */ hsize_t ret_value; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_spans_nelem) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Count the number of elements in the span tree */ if(spans==NULL) @@ -5687,7 +5687,7 @@ H5S_hyper_make_spans(unsigned rank, const hsize_t *start, const hsize_t *stride, unsigned u; /* Counters */ H5S_hyper_span_info_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_make_spans) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(rank > 0); @@ -5828,7 +5828,7 @@ H5S_hyper_rebuild_helper(const H5S_hyper_span_t *span, H5S_hyper_dim_t span_slab H5S_hyper_dim_t canon_down_span_slab_info[H5S_MAX_RANK]; hbool_t ret_value = TRUE; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_rebuild_helper) + FUNC_ENTER_NOAPI_NOINIT_NOERR if(span) { /* Initialization */ @@ -5956,7 +5956,7 @@ H5S_hyper_rebuild(H5S_t *space) unsigned rank, curr_dim; htri_t ret_value = TRUE; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_rebuild) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(space); @@ -6018,7 +6018,7 @@ H5S_hyper_generate_spans(H5S_t *space) unsigned u; /* Counter */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_generate_spans) + FUNC_ENTER_NOAPI_NOINIT HDassert(space); HDassert(H5S_GET_SELECT_TYPE(space) == H5S_SEL_HYPERSLABS); @@ -6068,7 +6068,7 @@ H5S_generate_hyperslab (H5S_t *space, H5S_seloper_t op, H5S_hyper_span_info_t *b_not_a=NULL; /* Span tree for hyperslab spans in new span tree and not in old span tree */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5S_generate_hyperslab) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(space); @@ -6314,7 +6314,7 @@ H5S_select_hyperslab (H5S_t *space, H5S_seloper_t op, unsigned u; /* Counters */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5S_select_hyperslab, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args */ HDassert(space); @@ -6585,7 +6585,7 @@ H5Sselect_hyperslab(hid_t space_id, H5S_seloper_t op, const hsize_t start[], unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Sselect_hyperslab, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE6("e", "iSs*h*h*h*h", space_id, op, start, stride, count, block); /* Check args */ @@ -6639,7 +6639,7 @@ H5S_operate_hyperslab (H5S_t *result, H5S_hyper_span_info_t *spans1, H5S_seloper H5S_hyper_span_info_t *b_not_a=NULL; /* Span tree for hyperslab spans in new span tree and not in old span tree */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5S_operate_hyperslab) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(result); @@ -6846,7 +6846,7 @@ H5S_generate_hyperslab (H5S_t *space, H5S_seloper_t op, hbool_t span2_owned=FALSE; /* Flag to indicate that span2 was used in H5S_operate_hyperslab() */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5S_generate_hyperslab) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(space); @@ -6923,7 +6923,7 @@ H5S_select_hyperslab (H5S_t *space, H5S_seloper_t op, unsigned u; /* Counters */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5S_select_hyperslab, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args */ HDassert(space); @@ -7180,7 +7180,7 @@ H5Sselect_hyperslab(hid_t space_id, H5S_seloper_t op, const hsize_t start[], H5S_t *space = NULL; /* Dataspace to modify selection of */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Sselect_hyperslab, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE6("e", "iSs*h*h*h*h", space_id, op, start, stride, count, block); /* Check args */ @@ -7249,7 +7249,7 @@ H5Scombine_hyperslab(hid_t space_id, H5S_seloper_t op, const hsize_t start[], H5S_t *new_space = NULL; /* New dataspace created */ hid_t ret_value; - FUNC_ENTER_API(H5Scombine_hyperslab, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE6("i", "iSs*h*h*h*h", space_id, op, start, stride, count, block); /* Check args */ @@ -7302,7 +7302,7 @@ H5S_combine_select (H5S_t *space1, H5S_seloper_t op, H5S_t *space2) hbool_t span2_owned=FALSE; /* Flag to indicate that span2 was used in H5S_operate_hyperslab() */ H5S_t *ret_value; /* return value */ - FUNC_ENTER_NOAPI_NOINIT(H5S_combine_select) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(space1); @@ -7374,7 +7374,7 @@ H5Scombine_select(hid_t space1_id, H5S_seloper_t op, hid_t space2_id) H5S_t *new_space = NULL; /* New Dataspace */ hid_t ret_value; - FUNC_ENTER_API(H5Scombine_select, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("i", "iSsi", space1_id, op, space2_id); /* Check args */ @@ -7430,7 +7430,7 @@ H5S_select_select (H5S_t *space1, H5S_seloper_t op, H5S_t *space2) hbool_t span2_owned=FALSE; /* Flag to indicate that span2 was used in H5S_operate_hyperslab() */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5S_select_select) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(space1); @@ -7499,7 +7499,7 @@ H5Sselect_select(hid_t space1_id, H5S_seloper_t op, hid_t space2_id) H5S_t *space2; /* Second Dataspace */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Sselect_select, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("e", "iSsi", space1_id, op, space2_id); /* Check args */ @@ -7583,7 +7583,7 @@ H5S_hyper_get_seq_list_gen(const H5S_t *space,H5S_sel_iter_t *iter, unsigned u; /* Index variable */ int i; /* Index variable */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_get_seq_list_gen) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(space); @@ -8017,7 +8017,7 @@ H5S_hyper_get_seq_list_opt(const H5S_t *space, H5S_sel_iter_t *iter, unsigned u; /* Local index variable */ int i; /* Local index variable */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_get_seq_list_opt) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(space); @@ -8447,7 +8447,7 @@ H5S_hyper_get_seq_list_single(const H5S_t *space, H5S_sel_iter_t *iter, unsigned u; /* Local index variable */ int i; /* Local index variable */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_get_seq_list_single) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(space); @@ -8715,7 +8715,7 @@ H5S_hyper_get_seq_list(const H5S_t *space, unsigned UNUSED flags, H5S_sel_iter_t { herr_t ret_value; /* return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_get_seq_list) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(space); diff --git a/src/H5Smpio.c b/src/H5Smpio.c index d6131b9..7cd4c31 100644 --- a/src/H5Smpio.c +++ b/src/H5Smpio.c @@ -78,7 +78,7 @@ H5S_mpio_all_type(const H5S_t *space, size_t elmt_size, hsize_t nelmts; /* Total number of elmts */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5S_mpio_all_type) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(space); @@ -119,7 +119,7 @@ done: static herr_t H5S_mpio_none_type(MPI_Datatype *new_type, int *count, hbool_t *is_derived_type) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_mpio_none_type) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* fill in the return values */ *new_type = MPI_BYTE; @@ -173,7 +173,7 @@ H5S_mpio_hyper_type(const H5S_t *space, size_t elmt_size, int mpi_code; /* MPI return code */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT(H5S_mpio_hyper_type) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(space); @@ -439,7 +439,7 @@ H5S_mpio_span_hyper_type(const H5S_t *space, size_t elmt_size, int mpi_code; /* MPI return code */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5S_mpio_span_hyper_type) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(space); @@ -506,7 +506,7 @@ H5S_obtain_datatype(const hsize_t *down, H5S_hyper_span_t *span, int mpi_code; /* MPI return status code */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5S_obtain_datatype) + FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ HDassert(span); @@ -677,7 +677,7 @@ H5S_mpio_space_type(const H5S_t *space, size_t elmt_size, { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5S_mpio_space_type) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(space); @@ -730,7 +730,7 @@ H5S_mpio_space_type(const H5S_t *space, size_t elmt_size, } /* end switch */ done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* end H5S_mpio_space_type() */ #endif /* H5_HAVE_PARALLEL */ diff --git a/src/H5Snone.c b/src/H5Snone.c index 1948f13..e9a3bf9 100644 --- a/src/H5Snone.c +++ b/src/H5Snone.c @@ -116,7 +116,7 @@ static const H5S_sel_iter_class_t H5S_sel_iter_none[1] = {{ herr_t H5S_none_iter_init(H5S_sel_iter_t *iter, const H5S_t UNUSED *space) { - FUNC_ENTER_NOAPI_NOFUNC(H5S_none_iter_init) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(space && H5S_SEL_NONE==H5S_GET_SELECT_TYPE(space)); @@ -147,7 +147,7 @@ H5S_none_iter_init(H5S_sel_iter_t *iter, const H5S_t UNUSED *space) static herr_t H5S_none_iter_coords(const H5S_sel_iter_t UNUSED *iter, hsize_t UNUSED *coords) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_none_iter_coords) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(iter); @@ -175,7 +175,7 @@ H5S_none_iter_coords(const H5S_sel_iter_t UNUSED *iter, hsize_t UNUSED *coords) static herr_t H5S_none_iter_block(const H5S_sel_iter_t UNUSED *iter, hsize_t UNUSED *start, hsize_t UNUSED *end) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_none_iter_block) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(iter); @@ -203,7 +203,7 @@ H5S_none_iter_block(const H5S_sel_iter_t UNUSED *iter, hsize_t UNUSED *start, hs static hsize_t H5S_none_iter_nelmts(const H5S_sel_iter_t UNUSED *iter) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_none_iter_nelmts) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(iter); @@ -232,7 +232,7 @@ H5S_none_iter_nelmts(const H5S_sel_iter_t UNUSED *iter) static htri_t H5S_none_iter_has_next_block(const H5S_sel_iter_t UNUSED *iter) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_none_iter_has_next_block) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(iter); @@ -262,7 +262,7 @@ H5S_none_iter_has_next_block(const H5S_sel_iter_t UNUSED *iter) static herr_t H5S_none_iter_next(H5S_sel_iter_t UNUSED *iter, size_t UNUSED nelem) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_none_iter_next) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(iter); @@ -292,7 +292,7 @@ H5S_none_iter_next(H5S_sel_iter_t UNUSED *iter, size_t UNUSED nelem) static herr_t H5S_none_iter_next_block(H5S_sel_iter_t UNUSED *iter) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_none_iter_next) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(iter); @@ -321,7 +321,7 @@ H5S_none_iter_next_block(H5S_sel_iter_t UNUSED *iter) static herr_t H5S_none_iter_release(H5S_sel_iter_t UNUSED * iter) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_none_iter_release) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(iter); @@ -350,7 +350,7 @@ H5S_none_iter_release(H5S_sel_iter_t UNUSED * iter) static herr_t H5S_none_release(H5S_t UNUSED * space) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_none_release) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(space); @@ -381,7 +381,7 @@ H5S_none_release(H5S_t UNUSED * space) static herr_t H5S_none_copy(H5S_t *dst, const H5S_t UNUSED *src, hbool_t UNUSED share_selection) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_none_copy) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(src); HDassert(dst); @@ -416,7 +416,7 @@ H5S_none_copy(H5S_t *dst, const H5S_t UNUSED *src, hbool_t UNUSED share_selectio static htri_t H5S_none_is_valid(const H5S_t UNUSED *space) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_none_is_valid) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(space); @@ -446,7 +446,7 @@ H5S_none_is_valid(const H5S_t UNUSED *space) static hssize_t H5S_none_serial_size(const H5S_t UNUSED *space) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_none_serial_size) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(space); @@ -480,7 +480,7 @@ H5S_none_serial_size(const H5S_t UNUSED *space) static herr_t H5S_none_serialize(const H5S_t *space, uint8_t *buf) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_none_serialize) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(space); @@ -518,7 +518,7 @@ H5S_none_deserialize(H5S_t *space, const uint8_t UNUSED *buf) { herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_NOAPI_NOINIT(H5S_none_deserialize) + FUNC_ENTER_NOAPI_NOINIT HDassert(space); @@ -559,7 +559,7 @@ done: static herr_t H5S_none_bounds(const H5S_t UNUSED *space, hsize_t UNUSED *start, hsize_t UNUSED *end) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_none_bounds) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(space); HDassert(start); @@ -592,7 +592,7 @@ H5S_none_bounds(const H5S_t UNUSED *space, hsize_t UNUSED *start, hsize_t UNUSED herr_t H5S_none_offset(const H5S_t UNUSED *space, hsize_t UNUSED *offset) { - FUNC_ENTER_NOAPI_NOFUNC(H5S_none_offset) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(space); HDassert(offset); @@ -622,7 +622,7 @@ H5S_none_offset(const H5S_t UNUSED *space, hsize_t UNUSED *offset) static htri_t H5S_none_is_contiguous(const H5S_t UNUSED *space) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_none_is_contiguous) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(space); @@ -651,7 +651,7 @@ H5S_none_is_contiguous(const H5S_t UNUSED *space) static htri_t H5S_none_is_single(const H5S_t UNUSED *space) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_none_is_single) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(space); @@ -681,7 +681,7 @@ H5S_none_is_single(const H5S_t UNUSED *space) static htri_t H5S_none_is_regular(const H5S_t UNUSED *space) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_none_is_regular) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(space); @@ -711,7 +711,7 @@ H5S_none_is_regular(const H5S_t UNUSED *space) herr_t H5S_none_adjust_u(H5S_t UNUSED *space, const hsize_t UNUSED *offset) { - FUNC_ENTER_NOAPI_NOFUNC(H5S_none_adjust_u) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(space); @@ -736,7 +736,7 @@ H5S_none_adjust_u(H5S_t UNUSED *space, const hsize_t UNUSED *offset) static herr_t H5S_none_project_scalar(const H5S_t UNUSED *space, hsize_t UNUSED *offset) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_none_project_scalar) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(space && H5S_SEL_NONE == H5S_GET_SELECT_TYPE(space)); @@ -764,7 +764,7 @@ H5S_none_project_simple(const H5S_t *base_space, H5S_t *new_space, hsize_t *offs { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5S_none_project_simple) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(base_space && H5S_SEL_NONE == H5S_GET_SELECT_TYPE(base_space)); @@ -802,7 +802,7 @@ H5S_select_none(H5S_t *space) { herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_NOAPI(H5S_select_none, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args */ HDassert(space); @@ -845,7 +845,7 @@ H5Sselect_none(hid_t spaceid) H5S_t *space; /* Dataspace to modify selection of */ herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_API(H5Sselect_none, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", spaceid); /* Check args */ @@ -897,7 +897,7 @@ H5S_none_get_seq_list(const H5S_t UNUSED *space, unsigned UNUSED flags, H5S_sel_ size_t UNUSED maxseq, size_t UNUSED maxelem, size_t *nseq, size_t *nelem, hsize_t UNUSED *off, size_t UNUSED *len) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_none_get_seq_list) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(space); diff --git a/src/H5Spoint.c b/src/H5Spoint.c index e544371..7e82295 100644 --- a/src/H5Spoint.c +++ b/src/H5Spoint.c @@ -123,7 +123,7 @@ H5FL_DEFINE_STATIC(H5S_pnt_list_t); herr_t H5S_point_iter_init(H5S_sel_iter_t *iter, const H5S_t *space) { - FUNC_ENTER_NOAPI_NOFUNC(H5S_point_iter_init) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(space && H5S_SEL_POINTS==H5S_GET_SELECT_TYPE(space)); @@ -160,7 +160,7 @@ H5S_point_iter_init(H5S_sel_iter_t *iter, const H5S_t *space) static herr_t H5S_point_iter_coords (const H5S_sel_iter_t *iter, hsize_t *coords) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_point_iter_coords) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(iter); @@ -191,7 +191,7 @@ H5S_point_iter_coords (const H5S_sel_iter_t *iter, hsize_t *coords) static herr_t H5S_point_iter_block (const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_point_iter_block) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(iter); @@ -223,7 +223,7 @@ H5S_point_iter_block (const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end) static hsize_t H5S_point_iter_nelmts (const H5S_sel_iter_t *iter) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_point_iter_nelmts) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(iter); @@ -254,7 +254,7 @@ H5S_point_iter_has_next_block(const H5S_sel_iter_t *iter) { htri_t ret_value=TRUE; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_point_iter_has_next_block) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(iter); @@ -289,7 +289,7 @@ done: static herr_t H5S_point_iter_next(H5S_sel_iter_t *iter, size_t nelem) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_point_iter_next) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(iter); @@ -325,7 +325,7 @@ H5S_point_iter_next(H5S_sel_iter_t *iter, size_t nelem) static herr_t H5S_point_iter_next_block(H5S_sel_iter_t *iter) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_point_iter_next_block) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(iter); @@ -357,7 +357,7 @@ H5S_point_iter_next_block(H5S_sel_iter_t *iter) static herr_t H5S_point_iter_release (H5S_sel_iter_t UNUSED * iter) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_point_iter_release) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(iter); @@ -392,7 +392,7 @@ H5S_point_add(H5S_t *space, H5S_seloper_t op, size_t num_elem, const hsize_t *co unsigned u; /* Counter */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5S_point_add) + FUNC_ENTER_NOAPI_NOINIT HDassert(space); HDassert(num_elem > 0); @@ -492,7 +492,7 @@ H5S_point_release (H5S_t *space) { H5S_pnt_node_t *curr, *next; /* Point selection nodes */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_point_release) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(space); @@ -552,7 +552,7 @@ H5S_select_elements(H5S_t *space, H5S_seloper_t op, size_t num_elem, { herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_NOAPI_NOINIT(H5S_select_elements) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(space); @@ -607,7 +607,7 @@ H5S_point_copy(H5S_t *dst, const H5S_t *src, hbool_t UNUSED share_selection) H5S_pnt_node_t *curr, *new_node, *new_tail; /* Point information nodes */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5S_point_copy) + FUNC_ENTER_NOAPI_NOINIT HDassert(src); HDassert(dst); @@ -688,7 +688,7 @@ H5S_point_is_valid (const H5S_t *space) unsigned u; /* Counter */ htri_t ret_value=TRUE; /* return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_point_is_valid) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(space); @@ -735,7 +735,7 @@ H5Sget_select_elem_npoints(hid_t spaceid) H5S_t *space; /* Dataspace to modify selection of */ hssize_t ret_value; /* return value */ - FUNC_ENTER_API(H5Sget_select_elem_npoints, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("Hs", "i", spaceid); /* Check args */ @@ -776,7 +776,7 @@ H5S_point_serial_size (const H5S_t *space) H5S_pnt_node_t *curr; /* Point information nodes */ hssize_t ret_value; /* return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_point_serial_size) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(space); @@ -825,7 +825,7 @@ H5S_point_serialize (const H5S_t *space, uint8_t *buf) uint32_t len=0; /* number of bytes used */ unsigned u; /* local counting variable */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_point_serialize) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(space); @@ -893,7 +893,7 @@ H5S_point_deserialize (H5S_t *space, const uint8_t *buf) unsigned i, j; /* local counting variables */ herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_NOAPI_NOINIT(H5S_point_deserialize) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(space); @@ -963,7 +963,7 @@ H5S_get_select_elem_pointlist(H5S_t *space, hsize_t startpoint, hsize_t numpoint H5S_pnt_node_t *node; /* Point node */ unsigned rank; /* Dataspace rank */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_get_select_elem_pointlist) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(space); HDassert(buf); @@ -1028,7 +1028,7 @@ H5Sget_select_elem_pointlist(hid_t spaceid, hsize_t startpoint, H5S_t *space; /* Dataspace to modify selection of */ herr_t ret_value; /* return value */ - FUNC_ENTER_API(H5Sget_select_elem_pointlist, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE4("e", "ihh*[a2]h", spaceid, startpoint, numpoints, buf); /* Check args */ @@ -1080,7 +1080,7 @@ H5S_point_bounds(const H5S_t *space, hsize_t *start, hsize_t *end) unsigned u; /* index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5S_point_bounds) + FUNC_ENTER_NOAPI_NOINIT HDassert(space); HDassert(start); @@ -1146,7 +1146,7 @@ H5S_point_offset(const H5S_t *space, hsize_t *offset) int i; /* index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5S_point_offset, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert(space); HDassert(offset); @@ -1206,7 +1206,7 @@ H5S_point_is_contiguous(const H5S_t *space) { htri_t ret_value; /* return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_point_is_contiguous) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(space); @@ -1243,7 +1243,7 @@ H5S_point_is_single(const H5S_t *space) { htri_t ret_value; /* return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_point_is_single) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(space); @@ -1283,7 +1283,7 @@ H5S_point_is_regular(const H5S_t *space) { htri_t ret_value; /* return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_point_is_regular) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(space); @@ -1322,7 +1322,7 @@ H5S_point_adjust_u(H5S_t *space, const hsize_t *offset) H5S_pnt_node_t *node; /* Point node */ unsigned rank; /* Dataspace rank */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_point_adjust_u) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(space); HDassert(offset); @@ -1369,7 +1369,7 @@ H5S_point_project_scalar(const H5S_t *space, hsize_t *offset) const H5S_pnt_node_t *node; /* Point node */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5S_point_project_scalar) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(space && H5S_SEL_POINTS == H5S_GET_SELECT_TYPE(space)); @@ -1412,7 +1412,7 @@ H5S_point_project_simple(const H5S_t *base_space, H5S_t *new_space, hsize_t *off unsigned rank_diff; /* Difference in ranks between spaces */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5S_point_project_simple) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(base_space && H5S_SEL_POINTS == H5S_GET_SELECT_TYPE(base_space)); @@ -1554,7 +1554,7 @@ H5Sselect_elements(hid_t spaceid, H5S_seloper_t op, size_t num_elem, H5S_t *space; /* Dataspace to modify selection of */ herr_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Sselect_elements, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE4("e", "iSsz*h", spaceid, op, num_elem, coord); /* Check args */ @@ -1625,7 +1625,7 @@ H5S_point_get_seq_list(const H5S_t *space, unsigned flags, H5S_sel_iter_t *iter, int i; /* Local index variable */ herr_t ret_value=SUCCEED; /* return value */ - FUNC_ENTER_NOAPI_NOINIT(H5S_point_get_seq_list) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(space); diff --git a/src/H5Sselect.c b/src/H5Sselect.c index db18780..91aed1e 100644 --- a/src/H5Sselect.c +++ b/src/H5Sselect.c @@ -63,7 +63,7 @@ static herr_t H5S_select_iter_next_block(H5S_sel_iter_t *iter); herr_t H5S_select_offset(H5S_t *space, const hssize_t *offset) { - FUNC_ENTER_NOAPI_NOFUNC(H5S_select_offset) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(space); @@ -109,7 +109,7 @@ H5S_select_copy (H5S_t *dst, const H5S_t *src, hbool_t share_selection) { herr_t ret_value; /* return value */ - FUNC_ENTER_NOAPI(H5S_select_copy, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args */ assert(dst); @@ -150,7 +150,7 @@ H5S_select_release(H5S_t *ds) { herr_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOFUNC(H5S_select_release) + FUNC_ENTER_NOAPI_NOINIT_NOERR assert(ds); @@ -187,7 +187,7 @@ H5S_select_get_seq_list(const H5S_t *space, unsigned flags, { herr_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOFUNC(H5S_select_get_seq_list) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(space); @@ -222,7 +222,7 @@ H5S_select_serial_size(const H5S_t *space) { hssize_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOFUNC(H5S_select_serial_size) + FUNC_ENTER_NOAPI_NOINIT_NOERR assert(space); @@ -260,7 +260,7 @@ H5S_select_serialize(const H5S_t *space, uint8_t *buf) { herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOFUNC(H5S_select_serialize) + FUNC_ENTER_NOAPI_NOINIT_NOERR assert(space); assert(buf); @@ -295,7 +295,7 @@ H5Sget_select_npoints(hid_t spaceid) H5S_t *space; /* Dataspace to modify selection of */ hssize_t ret_value; /* return value */ - FUNC_ENTER_API(H5Sget_select_npoints, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("Hs", "i", spaceid); /* Check args */ @@ -332,7 +332,7 @@ done: hssize_t H5S_get_select_npoints(const H5S_t *space) { - FUNC_ENTER_NOAPI_NOFUNC(H5S_get_select_npoints) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(space); @@ -369,7 +369,7 @@ H5Sselect_valid(hid_t spaceid) H5S_t *space; /* Dataspace to modify selection of */ htri_t ret_value; /* return value */ - FUNC_ENTER_API(H5Sselect_valid, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("t", "i", spaceid); /* Check args */ @@ -411,7 +411,7 @@ H5S_select_valid(const H5S_t *space) { htri_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOFUNC(H5S_select_valid) + FUNC_ENTER_NOAPI_NOINIT_NOERR assert(space); @@ -450,7 +450,7 @@ H5S_select_deserialize (H5S_t *space, const uint8_t *buf) uint32_t sel_type; /* Pointer to the selection type */ herr_t ret_value=FAIL; /* return value */ - FUNC_ENTER_NOAPI(H5S_select_deserialize, FAIL) + FUNC_ENTER_NOAPI(FAIL) assert(space); @@ -520,7 +520,7 @@ H5Sget_select_bounds(hid_t spaceid, hsize_t start[], hsize_t end[]) H5S_t *space; /* Dataspace to modify selection of */ herr_t ret_value; /* return value */ - FUNC_ENTER_API(H5Sget_select_bounds, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("e", "i*h*h", spaceid, start, end); /* Check args */ @@ -568,7 +568,7 @@ H5S_get_select_bounds(const H5S_t *space, hsize_t *start, hsize_t *end) { herr_t ret_value; /* return value */ - FUNC_ENTER_NOAPI_NOFUNC(H5S_get_select_bounds) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ assert(space); @@ -609,7 +609,7 @@ H5S_get_select_offset(const H5S_t *space, hsize_t *offset) { herr_t ret_value; /* return value */ - FUNC_ENTER_NOAPI_NOFUNC(H5S_get_select_offset) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(space); @@ -647,7 +647,7 @@ H5S_select_is_contiguous(const H5S_t *space) { herr_t ret_value; /* return value */ - FUNC_ENTER_NOAPI_NOFUNC(H5S_select_is_contiguous) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ assert(space); @@ -684,7 +684,7 @@ H5S_select_is_single(const H5S_t *space) { herr_t ret_value; /* return value */ - FUNC_ENTER_NOAPI_NOFUNC(H5S_select_is_single) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ assert(space); @@ -721,7 +721,7 @@ H5S_select_is_regular(const H5S_t *space) { herr_t ret_value; /* return value */ - FUNC_ENTER_NOAPI_NOFUNC(H5S_select_is_regular) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ assert(space); @@ -758,7 +758,7 @@ H5S_select_adjust_u(H5S_t *space, const hsize_t *offset) { herr_t ret_value; /* return value */ - FUNC_ENTER_NOAPI_NOFUNC(H5S_select_adjust_u) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(space); @@ -796,7 +796,7 @@ H5S_select_project_scalar(const H5S_t *space, hsize_t *offset) { herr_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOFUNC(H5S_select_project_scalar) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(space); @@ -836,7 +836,7 @@ H5S_select_project_simple(const H5S_t *space, H5S_t *new_space, hsize_t *offset) { herr_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOFUNC(H5S_select_project_simple) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(space); @@ -871,7 +871,7 @@ H5S_select_iter_init(H5S_sel_iter_t *sel_iter, const H5S_t *space, size_t elmt_s { herr_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOFUNC(H5S_select_iter_init) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(sel_iter); @@ -926,7 +926,7 @@ H5S_select_iter_coords (const H5S_sel_iter_t *sel_iter, hsize_t *coords) { herr_t ret_value; /* return value */ - FUNC_ENTER_NOAPI_NOFUNC(H5S_select_iter_coords) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ assert(sel_iter); @@ -968,7 +968,7 @@ H5S_select_iter_block (const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end) { herr_t ret_value; /* return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_select_iter_block) + FUNC_ENTER_NOAPI_NOINIT_NOINIT_NOERR /* Check args */ assert(iter); @@ -1008,7 +1008,7 @@ H5S_select_iter_nelmts (const H5S_sel_iter_t *sel_iter) { hsize_t ret_value; /* return value */ - FUNC_ENTER_NOAPI_NOFUNC(H5S_select_iter_nelmts) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ assert(sel_iter); @@ -1047,7 +1047,7 @@ H5S_select_iter_has_next_block (const H5S_sel_iter_t *iter) { herr_t ret_value; /* return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_select_iter_has_next_block) + FUNC_ENTER_NOAPI_NOINIT_NOINIT_NOERR /* Check args */ assert(iter); @@ -1087,7 +1087,7 @@ H5S_select_iter_next(H5S_sel_iter_t *iter, size_t nelem) { herr_t ret_value; /* return value */ - FUNC_ENTER_NOAPI_NOFUNC(H5S_select_iter_next) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ assert(iter); @@ -1132,7 +1132,7 @@ H5S_select_iter_next_block(H5S_sel_iter_t *iter) { herr_t ret_value; /* return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_select_iter_next_block) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ assert(iter); @@ -1170,7 +1170,7 @@ H5S_select_iter_release(H5S_sel_iter_t *sel_iter) { herr_t ret_value; /* return value */ - FUNC_ENTER_NOAPI_NOFUNC(H5S_select_iter_release) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ assert(sel_iter); @@ -1236,7 +1236,7 @@ H5S_select_iterate(void *buf, hid_t type_id, const H5S_t *space, H5D_operator_t herr_t user_ret=0; /* User's return value */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5S_select_iterate, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args */ HDassert(buf); @@ -1345,7 +1345,7 @@ H5Sget_select_type(hid_t space_id) H5S_t *space; /* dataspace to modify */ H5S_sel_type ret_value; /* Return value */ - FUNC_ENTER_API(H5Sget_select_type, H5S_SEL_ERROR) + FUNC_ENTER_API(H5S_SEL_ERROR) H5TRACE1("St", "i", space_id); /* Check args */ @@ -1384,7 +1384,7 @@ H5S_get_select_type(const H5S_t *space) { H5S_sel_type ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOFUNC(H5S_get_select_type) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ assert(space); @@ -1428,7 +1428,7 @@ H5S_select_shape_same(const H5S_t *space1, const H5S_t *space2) hbool_t iter_b_init = 0; /* Selection b iteration info has been initialized */ htri_t ret_value = TRUE; /* Return value */ - FUNC_ENTER_NOAPI(H5S_select_shape_same, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args */ HDassert(space1); @@ -1767,7 +1767,7 @@ H5S_select_construct_projection(const H5S_t *base_space, H5S_t **new_space_ptr, hsize_t projected_space_element_offset = 0; /* Offset of selected element in projected buffer */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5S_select_construct_projection, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ HDassert(base_space != NULL); @@ -1997,7 +1997,7 @@ H5S_select_fill(const void *fill, size_t fill_size, const H5S_t *space, void *_b size_t max_elem; /* Total number of elements in selection */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5S_select_fill, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args */ HDassert(fill); diff --git a/src/H5Stest.c b/src/H5Stest.c index 5758263..62a4179 100644 --- a/src/H5Stest.c +++ b/src/H5Stest.c @@ -56,7 +56,7 @@ H5S_select_shape_same_test(hid_t sid1, hid_t sid2) H5S_t *space2; /* Pointer to 2nd dataspace */ htri_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5S_select_shape_same_test, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Get dataspace structures */ if(NULL == (space1 = (H5S_t *)H5I_object_verify(sid1, H5I_DATASPACE))) @@ -97,7 +97,7 @@ H5S_get_rebuild_status_test(hid_t space_id) H5S_t *space; /* Pointer to 1st dataspace */ htri_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5S_get_rebuild_status_test, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Get dataspace structures */ if(NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE))) diff --git a/src/H5T.c b/src/H5T.c index 4b41ddb..01bd6c1 100644 --- a/src/H5T.c +++ b/src/H5T.c @@ -521,11 +521,11 @@ H5T_init(void) { herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5T_init, FAIL); + FUNC_ENTER_NOAPI(FAIL) /* FUNC_ENTER() does all the work */ done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } @@ -556,7 +556,7 @@ H5T_init_inf(void) size_t u; /* Local index value */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5T_init_inf) + FUNC_ENTER_NOAPI_NOINIT /* Get the float datatype */ if(NULL == (dst_p = (H5T_t *)H5I_object(H5T_NATIVE_FLOAT_g))) @@ -666,7 +666,7 @@ H5T_init_hw(void) #endif /* H5_HAVE_GET_FPC_CSR */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_init_hw) + FUNC_ENTER_NOAPI_NOINIT_NOERR #ifdef H5_HAVE_GET_FPC_CSR /* [This code is specific to SGI machines] */ @@ -739,7 +739,7 @@ H5T_init_interface(void) H5P_genclass_t *crt_pclass; /* Property list class for datatype creation properties */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5T_init_interface) + FUNC_ENTER_NOAPI_NOINIT /* Initialize the atom group for the file IDs */ if(H5I_register_type(H5I_DATATYPE, (size_t)H5I_DATATYPEID_HASHSIZE, H5T_RESERVED_ATOMS, (H5I_free_t)H5T_close)<0) @@ -1376,7 +1376,7 @@ H5T_unlock_cb(void *_dt, hid_t UNUSED id, void UNUSED *key) { H5T_t *dt = (H5T_t *)_dt; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_unlock_cb) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert (dt && dt->shared); if (H5T_STATE_IMMUTABLE==dt->shared->state) @@ -1408,7 +1408,7 @@ H5T_term_interface(void) int i, nprint=0, n=0; H5T_path_t *path = NULL; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_term_interface) + FUNC_ENTER_NOAPI_NOINIT_NOERR if(H5_interface_initialize_g) { /* Unregister all conversion functions */ @@ -1585,12 +1585,12 @@ H5Tcreate(H5T_class_t type, size_t size) H5T_t *dt = NULL; /* New datatype constructed */ hid_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Tcreate, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("i", "Ttz", type, size); - /* check args */ - if(size == 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid size") + /* check args. We support string (fixed-size or variable-length) now. */ + if(size <= 0 && size != H5T_VARIABLE) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "size must be positive") /* create the type */ if(NULL == (dt = H5T_create(type, size))) @@ -1636,7 +1636,7 @@ H5Tcopy(hid_t type_id) H5T_t *new_dt = NULL; hid_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Tcopy, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("i", "i", type_id); switch(H5I_get_type(type_id)) { @@ -1713,7 +1713,7 @@ H5Tclose(hid_t type_id) H5T_t *dt; /* Pointer to datatype to close */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Tclose, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", type_id); /* Check args */ @@ -1752,7 +1752,7 @@ H5Tequal(hid_t type1_id, hid_t type2_id) const H5T_t *dt2; /* Pointer to second datatype */ htri_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Tequal, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("t", "ii", type1_id, type2_id); /* check args */ @@ -1798,7 +1798,7 @@ H5Tlock(hid_t type_id) H5T_t *dt; /* Datatype to operate on */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Tlock, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", type_id); /* Check args */ @@ -1836,7 +1836,7 @@ H5Tget_class(hid_t type_id) H5T_t *dt; /* Pointer to datatype */ H5T_class_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Tget_class, H5T_NO_CLASS) + FUNC_ENTER_API(H5T_NO_CLASS) H5TRACE1("Tt", "i", type_id); /* Check args */ @@ -1874,7 +1874,7 @@ H5T_get_class(const H5T_t *dt, htri_t internal) { H5T_class_t ret_value; - FUNC_ENTER_NOAPI(H5T_get_class, H5T_NO_CLASS); + FUNC_ENTER_NOAPI(H5T_NO_CLASS) assert(dt); @@ -1889,7 +1889,7 @@ H5T_get_class(const H5T_t *dt, htri_t internal) } done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* end H5T_get_class() */ @@ -1914,7 +1914,7 @@ H5Tdetect_class(hid_t type, H5T_class_t cls) H5T_t *dt; /* Datatype to query */ htri_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Tdetect_class, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("t", "iTt", type, cls); /* Check args */ @@ -1960,7 +1960,7 @@ H5T_detect_class(const H5T_t *dt, H5T_class_t cls, hbool_t from_api) unsigned i; htri_t ret_value = FALSE; /* Return value */ - FUNC_ENTER_NOAPI(H5T_detect_class, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert(dt); HDassert(cls > H5T_NO_CLASS && cls < H5T_NCLASSES); @@ -2035,7 +2035,7 @@ H5Tis_variable_str(hid_t dtype_id) H5T_t *dt; /* Datatype to query */ htri_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Tis_variable_str, FAIL); + FUNC_ENTER_API(FAIL) H5TRACE1("t", "i", dtype_id); /* Check args */ @@ -2047,7 +2047,7 @@ H5Tis_variable_str(hid_t dtype_id) HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "can't determine if datatype is VL-string") done: - FUNC_LEAVE_API(ret_value); + FUNC_LEAVE_API(ret_value) } /* end H5Tis_variable_str() */ @@ -2066,9 +2066,9 @@ done: htri_t H5T_is_variable_str(const H5T_t *dt) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_is_variable_str) + FUNC_ENTER_NOAPI_NOINIT_NOERR - FUNC_LEAVE_NOAPI(H5T_IS_VL_STRING(dt->shared)); + FUNC_LEAVE_NOAPI(H5T_IS_VL_STRING(dt->shared)) } /* end H5T_is_variable_str() */ @@ -2094,7 +2094,7 @@ H5Tget_size(hid_t type_id) H5T_t *dt; /* Datatype to query */ size_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Tget_size, 0) + FUNC_ENTER_API(0) H5TRACE1("z", "i", type_id); /* Check args */ @@ -2139,7 +2139,7 @@ H5Tset_size(hid_t type_id, size_t size) H5T_t *dt; /* Datatype to modify */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Tset_size, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "iz", type_id, size); /* Check args */ @@ -2155,8 +2155,6 @@ H5Tset_size(hid_t type_id, size_t size) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "operation not allowed after members are defined") if(H5T_REFERENCE == dt->shared->type) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "operation not defined for this datatype") - if(size == 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "can't adjust size to 0") /* Modify the datatype */ if(H5T_set_size(dt, size) < 0) @@ -2191,7 +2189,7 @@ H5Tget_super(hid_t type) H5T_t *super = NULL; /* Supertype */ hid_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Tget_super, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("i", "i", type); if(NULL == (dt = (H5T_t *)H5I_object_verify(type,H5I_DATATYPE))) @@ -2233,7 +2231,7 @@ H5T_get_super(const H5T_t *dt) { H5T_t *ret_value=NULL; - FUNC_ENTER_NOAPI(H5T_get_super, NULL); + FUNC_ENTER_NOAPI(NULL) assert(dt); @@ -2243,7 +2241,7 @@ H5T_get_super(const H5T_t *dt) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to copy parent data type"); done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } @@ -2280,7 +2278,7 @@ H5T_register(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, int i; /*counter */ herr_t ret_value=SUCCEED; /*return value */ - FUNC_ENTER_NOAPI_NOINIT(H5T_register); + FUNC_ENTER_NOAPI_NOINIT /* Check args */ assert(src); @@ -2413,7 +2411,7 @@ done: H5I_dec_ref(tmp_did); } /* end if */ - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* end H5T_register() */ @@ -2444,7 +2442,7 @@ H5Tregister(H5T_pers_t pers, const char *name, hid_t src_id, hid_t dst_id, H5T_t *dst; /*destination data type desc */ herr_t ret_value = SUCCEED; /*return value */ - FUNC_ENTER_API(H5Tregister, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE5("e", "Te*siix", pers, name, src_id, dst_id, func); /* Check args */ @@ -2496,7 +2494,7 @@ H5T_unregister(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, int nprint = 0; /*number of paths shut down */ int i; /*counter */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_unregister) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Remove matching entries from the soft list */ if(H5T_PERS_DONTCARE == pers || H5T_PERS_SOFT == pers) { @@ -2590,7 +2588,7 @@ H5Tunregister(H5T_pers_t pers, const char *name, hid_t src_id, hid_t dst_id, H5T_t *src = NULL, *dst = NULL; /* Datatype descriptors */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Tunregister, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE5("e", "Te*siix", pers, name, src_id, dst_id, func); /* Check arguments */ @@ -2632,7 +2630,7 @@ H5Tfind(hid_t src_id, hid_t dst_id, H5T_cdata_t **pcdata) H5T_path_t *path; H5T_conv_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Tfind, NULL) + FUNC_ENTER_API(NULL) H5TRACE3("x", "ii**x", src_id, dst_id, pcdata); /* Check args */ @@ -2680,7 +2678,7 @@ H5Tcompiler_conv(hid_t src_id, hid_t dst_id) H5T_t *src, *dst; htri_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Tcompiler_conv, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("t", "ii", src_id, dst_id); /* Check args */ @@ -2728,7 +2726,7 @@ H5Tconvert(hid_t src_id, hid_t dst_id, size_t nelmts, void *buf, H5T_t *src, *dst; /*unatomized types */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Tconvert, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE6("e", "iiz*x*xi", src_id, dst_id, nelmts, buf, background, dxpl_id); /* Check args */ @@ -2775,7 +2773,7 @@ H5Tencode(hid_t obj_id, void *buf, size_t *nalloc) H5T_t *dtype; herr_t ret_value = SUCCEED; - FUNC_ENTER_API (H5Tencode, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("e", "i*x*z", obj_id, buf, nalloc); /* Check argument and retrieve object */ @@ -2820,7 +2818,7 @@ H5Tdecode(const void *buf) H5T_t *dt; hid_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Tdecode, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("i", "*x", buf); /* Check args */ @@ -2868,7 +2866,7 @@ H5T_encode(H5T_t *obj, unsigned char *buf, size_t *nalloc) H5F_t *f = NULL; /* Fake file structure*/ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT(H5T_encode) + FUNC_ENTER_NOAPI_NOINIT /* Allocate "fake" file structure */ if(NULL == (f = H5F_fake_alloc((uint8_t)0))) @@ -2924,7 +2922,7 @@ H5T_decode(const unsigned char *buf) H5F_t *f = NULL; /* Fake file structure*/ H5T_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5T_decode) + FUNC_ENTER_NOAPI_NOINIT /* Allocate "fake" file structure */ if(NULL == (f = H5F_fake_alloc((uint8_t)0))) @@ -2970,7 +2968,9 @@ done: * Friday, December 5, 1997 * * Modifications: - * + * Raymond Lu + * 19 May 2011 + * We support fixed size or variable-length string now. *------------------------------------------------------------------------- */ H5T_t * @@ -2979,13 +2979,29 @@ H5T_create(H5T_class_t type, size_t size) H5T_t *dt = NULL; H5T_t *ret_value = NULL; - FUNC_ENTER_NOAPI(H5T_create, NULL) + FUNC_ENTER_NOAPI(NULL) switch(type) { case H5T_INTEGER: case H5T_FLOAT: case H5T_TIME: case H5T_STRING: + { + H5T_t *origin_dt = NULL; + + if(NULL == (origin_dt = (H5T_t *)H5I_object(H5T_C_S1))) + HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, NULL, "can't get structure for string type") + + /* Copy the default string datatype */ + if(NULL == (dt = H5T_copy(origin_dt, H5T_COPY_TRANSIENT))) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to copy"); + + /* Modify the datatype */ + if(H5T_set_size(dt, size) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to set size for string type") + } + break; + case H5T_BITFIELD: HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, NULL, "type class is not appropriate - use H5Tcopy()") @@ -3045,7 +3061,9 @@ H5T_create(H5T_class_t type, size_t size) HGOTO_ERROR(H5E_INTERNAL, H5E_UNSUPPORTED, NULL, "unknown data type class") } /* end switch */ - dt->shared->size = size; + /* Set the size except VL string */ + if(H5T_STRING != type || H5T_VARIABLE != size) + dt->shared->size = size; /* Set return value */ ret_value = dt; @@ -3107,7 +3125,7 @@ H5T_copy(const H5T_t *old_dt, H5T_copy_t method) char *s; H5T_t *ret_value; - FUNC_ENTER_NOAPI(H5T_copy, NULL) + FUNC_ENTER_NOAPI(NULL) /* check args */ HDassert(old_dt); @@ -3377,7 +3395,8 @@ H5T_lock (H5T_t *dt, hbool_t immutable) { herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5T_lock, FAIL); + FUNC_ENTER_NOAPI(FAIL) + assert (dt); switch (dt->shared->state) { @@ -3395,7 +3414,7 @@ H5T_lock (H5T_t *dt, hbool_t immutable) } done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } @@ -3417,7 +3436,7 @@ H5T_alloc(void) H5T_t *dt = NULL; /* Pointer to datatype allocated */ H5T_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5T_alloc, NULL) + FUNC_ENTER_NOAPI(NULL) /* Allocate & initialize datatype wrapper info */ if(NULL == (dt = H5FL_CALLOC(H5T_t))) @@ -3466,7 +3485,7 @@ H5T_free(H5T_t *dt) unsigned i; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5T_free, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert(dt && dt->shared); @@ -3564,7 +3583,7 @@ H5T_close(H5T_t *dt) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5T_close, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert(dt && dt->shared); @@ -3594,6 +3613,11 @@ H5T_close(H5T_t *dt) if(H5O_close(&dt->oloc) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to close") } /* end if */ + else + /* Free object location (i.e. "unhold" the file if appropriate) + */ + if(H5O_loc_free(&(dt->oloc)) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTRELEASE, FAIL, "problem attempting to free location") } /* end if */ /* Free the group hier. path since we're not calling H5T_free*/ @@ -3644,7 +3668,7 @@ H5T_set_size(H5T_t *dt, size_t size) size_t prec, offset; herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5T_set_size, FAIL); + FUNC_ENTER_NOAPI(FAIL) /* Check args */ assert(dt); @@ -3689,7 +3713,7 @@ H5T_set_size(H5T_t *dt, size_t size) case H5T_COMPOUND: /* If decreasing size, check the last member isn't being cut. */ if(sizeshared->size) { - int num_membs; + int num_membs = 0; unsigned i, max_index=0; size_t memb_offset, max_offset=0; size_t max_size; @@ -3697,18 +3721,20 @@ H5T_set_size(H5T_t *dt, size_t size) if((num_membs = H5T_get_nmembers(dt))<0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to get number of members"); - for(i=0; i<(unsigned)num_membs; i++) { - memb_offset = H5T_get_member_offset(dt, i); - if(memb_offset > max_offset) { - max_offset = memb_offset; - max_index = i; - } - } + if(num_membs) { + for(i=0; i<(unsigned)num_membs; i++) { + memb_offset = H5T_get_member_offset(dt, i); + if(memb_offset > max_offset) { + max_offset = memb_offset; + max_index = i; + } + } - max_size = H5T_get_member_size(dt, max_index); + max_size = H5T_get_member_size(dt, max_index); - if(size<(max_offset+max_size)) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "size shrinking will cut off last member "); + if(size<(max_offset+max_size)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "size shrinking will cut off last member "); + } /* Compound must not have been packed previously */ /* We will check if resizing changed the packed state of @@ -3798,7 +3824,7 @@ H5T_set_size(H5T_t *dt, size_t size) } done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } @@ -3823,13 +3849,13 @@ done: size_t H5T_get_size(const H5T_t *dt) { - /* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_get_size); + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ assert(dt); - FUNC_LEAVE_NOAPI(dt->shared->size); + FUNC_LEAVE_NOAPI(dt->shared->size) } @@ -3860,7 +3886,7 @@ H5T_cmp(const H5T_t *dt1, const H5T_t *dt2, hbool_t superset) int tmp; int ret_value = 0; - FUNC_ENTER_NOAPI(H5T_cmp, 0) + FUNC_ENTER_NOAPI(0) /* Sanity check */ HDassert(dt1); @@ -4305,7 +4331,7 @@ H5T_path_find(const H5T_t *src, const H5T_t *dst, const char *name, int nprint = 0; /*lines of output printed */ H5T_path_t *ret_value; /*return value */ - FUNC_ENTER_NOAPI(H5T_path_find, NULL); + FUNC_ENTER_NOAPI(NULL) /* Sanity check */ HDassert(src); @@ -4439,7 +4465,7 @@ H5T_path_find(const H5T_t *src, const H5T_t *dst, const char *name, path->cdata.command = H5T_CONV_INIT; if((H5T_g.soft[i].func)(src_id, dst_id, &(path->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL, dxpl_id) < 0) { HDmemset(&(path->cdata), 0, sizeof(H5T_cdata_t)); - H5E_clear_stack(NULL); /*ignore the error*/ + H5E_clear_stack(H5E_DEFAULT); /*ignore the error*/ } /* end if */ else { HDstrcpy(path->name, H5T_g.soft[i].name); @@ -4538,7 +4564,7 @@ done: if(dst_id >= 0) H5I_dec_ref(dst_id); - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* end H5T_path_find() */ @@ -4562,11 +4588,11 @@ done: hbool_t H5T_path_noop(const H5T_path_t *p) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_path_noop); + FUNC_ENTER_NOAPI_NOINIT_NOERR assert(p); - FUNC_LEAVE_NOAPI(p->is_noop || (p->is_hard && 0==H5T_cmp(p->src, p->dst, FALSE))); + FUNC_LEAVE_NOAPI(p->is_noop || (p->is_hard && 0==H5T_cmp(p->src, p->dst, FALSE))) } /* end H5T_path_noop() */ @@ -4603,14 +4629,14 @@ H5T_path_compound_subset(const H5T_path_t *p) { H5T_subset_info_t *ret_value = NULL; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_path_compound_subset); + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(p); if(p->are_compounds) ret_value = H5T_conv_struct_subset(&(p->cdata)); - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* end H5T_path_compound_subset */ @@ -4631,11 +4657,11 @@ H5T_path_compound_subset(const H5T_path_t *p) H5T_bkg_t H5T_path_bkg(const H5T_path_t *p) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_path_bkg); + FUNC_ENTER_NOAPI_NOINIT_NOERR assert(p); - FUNC_LEAVE_NOAPI(p->cdata.need_bkg); + FUNC_LEAVE_NOAPI(p->cdata.need_bkg) } /* end H5T_path_bkg() */ @@ -4663,7 +4689,7 @@ H5T_compiler_conv(H5T_t *src, H5T_t *dst) H5T_path_t *path; htri_t ret_value; - FUNC_ENTER_NOAPI_NOINIT(H5T_compiler_conv) + FUNC_ENTER_NOAPI_NOINIT /* Find it */ if (NULL==(path=H5T_path_find(src, dst, NULL, NULL, H5AC_ind_dxpl_id, FALSE))) @@ -4727,7 +4753,7 @@ H5T_convert(H5T_path_t *tpath, hid_t src_id, hid_t dst_id, size_t nelmts, #endif herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5T_convert, FAIL); + FUNC_ENTER_NOAPI(FAIL) #ifdef H5T_DEBUG if (H5DEBUG(T)) H5_timer_begin(&timer); @@ -4745,7 +4771,7 @@ H5T_convert(H5T_path_t *tpath, hid_t src_id, hid_t dst_id, size_t nelmts, #endif done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } @@ -4767,7 +4793,7 @@ H5T_oloc(H5T_t *dt) { H5O_loc_t *ret_value = NULL; - FUNC_ENTER_NOAPI(H5T_oloc, NULL) + FUNC_ENTER_NOAPI(NULL) HDassert(dt); @@ -4806,7 +4832,7 @@ H5T_nameof(H5T_t *dt) { H5G_name_t *ret_value = NULL; - FUNC_ENTER_NOAPI(H5T_nameof, NULL) + FUNC_ENTER_NOAPI(NULL) HDassert(dt); @@ -4847,7 +4873,7 @@ H5T_is_immutable(const H5T_t *dt) { htri_t ret_value = FALSE; - FUNC_ENTER_NOAPI(H5T_is_immutable, FAIL); + FUNC_ENTER_NOAPI(FAIL) assert(dt); @@ -4855,7 +4881,7 @@ H5T_is_immutable(const H5T_t *dt) ret_value = TRUE; done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } @@ -4880,7 +4906,7 @@ H5T_is_named(const H5T_t *dt) { htri_t ret_value = FALSE; - FUNC_ENTER_NOAPI(H5T_is_named, FAIL); + FUNC_ENTER_NOAPI(FAIL) assert(dt); @@ -4888,7 +4914,7 @@ H5T_is_named(const H5T_t *dt) ret_value = TRUE; done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } @@ -4917,7 +4943,7 @@ H5T_get_ref_type(const H5T_t *dt) { H5R_type_t ret_value = H5R_BADTYPE; - FUNC_ENTER_NOAPI(H5T_get_ref_type, H5R_BADTYPE); + FUNC_ENTER_NOAPI(H5R_BADTYPE) assert(dt); @@ -4925,7 +4951,7 @@ H5T_get_ref_type(const H5T_t *dt) ret_value=dt->shared->u.atomic.u.r.rtype; done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* end H5T_get_ref_type() */ @@ -4951,7 +4977,7 @@ H5T_is_sensible(const H5T_t *dt) { htri_t ret_value; - FUNC_ENTER_NOAPI(H5T_is_sensible, FAIL); + FUNC_ENTER_NOAPI(FAIL) assert(dt); @@ -4979,7 +5005,7 @@ H5T_is_sensible(const H5T_t *dt) } /* end switch */ done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } @@ -5016,7 +5042,7 @@ H5T_set_loc(H5T_t *dt, H5F_t *f, H5T_loc_t loc) int accum_change; /* Amount of change in the offset of the fields */ size_t old_size; /* Previous size of a field */ - FUNC_ENTER_NOAPI(H5T_set_loc, FAIL); + FUNC_ENTER_NOAPI(FAIL) assert(dt); assert(loc>=H5T_LOC_BADLOC && locshared->state || H5T_STATE_NAMED == dt->shared->state) { + dt->oloc.file = f; + dt->sh_loc.file = f; + } /* end if */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5T_patch_file() */ + + +/*------------------------------------------------------------------------- * Function: H5Tflush * * Purpose: Flushes all buffers associated with a named datatype to disk. @@ -5297,7 +5359,7 @@ H5Tflush(hid_t type_id) H5T_t *dt; /* Datatype for this operation */ herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_API(H5Tflush, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", type_id); /* Check args */ @@ -5333,7 +5395,7 @@ H5Trefresh(hid_t type_id) H5T_t * dt = NULL; hid_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_API(H5Trefresh, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", type_id); /* Check args */ diff --git a/src/H5TS.c b/src/H5TS.c index 480bc2d..6f661ad 100644 --- a/src/H5TS.c +++ b/src/H5TS.c @@ -14,9 +14,9 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* private headers */ -#include "H5private.h" /*library */ -#include "H5Eprivate.h" /*error handling */ -#include "H5MMprivate.h" /*memory management functions */ +#include "H5private.h" /*library */ +#include "H5Eprivate.h" /*error handling */ +#include "H5MMprivate.h" /*memory management functions */ #ifdef H5_HAVE_THREADSAFE @@ -127,6 +127,12 @@ H5TS_pthread_first_thread_init(void) { H5_g.H5_libinit_g = FALSE; +#ifdef H5_HAVE_WIN32_API +# ifdef PTW32_STATIC_LIB + pthread_win32_process_attach_np(); +# endif +#endif + /* initialize global API mutex lock */ pthread_mutex_init(&H5_g.init_lock.atomic_lock, NULL); pthread_cond_init(&H5_g.init_lock.cond_var, NULL); @@ -171,7 +177,7 @@ H5TS_pthread_first_thread_init(void) herr_t H5TS_mutex_lock(H5TS_mutex_t *mutex) { -#ifdef H5_HAVE_WIN_THREADS +#ifdef H5_HAVE_WIN_THREADS EnterCriticalSection( &mutex->CriticalSection); return 0; #else /* H5_HAVE_WIN_THREADS */ @@ -226,7 +232,7 @@ H5TS_mutex_lock(H5TS_mutex_t *mutex) herr_t H5TS_mutex_unlock(H5TS_mutex_t *mutex) { -#ifdef H5_HAVE_WIN_THREADS +#ifdef H5_HAVE_WIN_THREADS /* Releases ownership of the specified critical section object. */ LeaveCriticalSection(&mutex->CriticalSection); return 0; @@ -285,7 +291,7 @@ H5TS_mutex_unlock(H5TS_mutex_t *mutex) herr_t H5TS_cancel_count_inc(void) { -#ifdef H5_HAVE_WIN_THREADS +#ifdef H5_HAVE_WIN_THREADS /* unsupported; just return 0 */ return SUCCEED; #else /* H5_HAVE_WIN_THREADS */ @@ -296,25 +302,25 @@ H5TS_cancel_count_inc(void) if (!cancel_counter) { /* - * First time thread calls library - create new counter and associate + * First time thread calls library - create new counter and associate * with key */ - cancel_counter = (H5TS_cancel_t *)H5MM_calloc(sizeof(H5TS_cancel_t)); + cancel_counter = (H5TS_cancel_t *)H5MM_calloc(sizeof(H5TS_cancel_t)); - if (!cancel_counter) { - H5E_push_stack(NULL, "H5TS_cancel_count_inc", - __FILE__, __LINE__, H5E_ERR_CLS_g, H5E_RESOURCE, H5E_NOSPACE, "memory allocation failed"); - return FAIL; - } + if (!cancel_counter) { + H5E_push_stack(NULL, "H5TS_cancel_count_inc", + __FILE__, __LINE__, H5E_ERR_CLS_g, H5E_RESOURCE, H5E_NOSPACE, "memory allocation failed"); + return FAIL; + } ret_value = pthread_setspecific(H5TS_cancel_key_g, - (void *)cancel_counter); + (void *)cancel_counter); } if (cancel_counter->cancel_count == 0) /* thread entering library */ ret_value = pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, - &cancel_counter->previous_state); + &cancel_counter->previous_state); ++cancel_counter->cancel_count; @@ -352,7 +358,7 @@ H5TS_cancel_count_inc(void) herr_t H5TS_cancel_count_dec(void) { -#ifdef H5_HAVE_WIN_THREADS +#ifdef H5_HAVE_WIN_THREADS /* unsupported; will just return 0 */ return SUCCEED; #else /* H5_HAVE_WIN_THREADS */ @@ -387,13 +393,22 @@ H5TS_cancel_count_dec(void) *-------------------------------------------------------------------------- */ H5TS_thread_t -H5TS_create_thread(void * func, H5TS_attr_t * attr, void*udata) +H5TS_create_thread(void *func, H5TS_attr_t *attr, void *udata) { H5TS_thread_t ret_value; -#ifdef H5_HAVE_WIN_THREADS +#ifdef H5_HAVE_WIN_THREADS - ret_value = CreateThread(NULL, 0, func, udata, 0, NULL); + /* When calling C runtime functions, you have to use _beginthread or + * _beginthreadex instead of CreateThread. Threads created with + * CreateThread risk being killed in low-memory situations. + * We use _beginthread instead of _begintheadex because the latter + * requires a stdcall function (and we don't need the more advanced + * features it exposes). + * + * NOTE: No error checks here! ret_value will be -1L on errors. + */ + ret_value = _beginthread(func, 0 /* stack size */, udata); #else /* H5_HAVE_WIN_THREADS */ @@ -405,4 +420,4 @@ H5TS_create_thread(void * func, H5TS_attr_t * attr, void*udata) } /* H5TS_create_thread */ -#endif /* H5_HAVE_THREADSAFE */ +#endif /* H5_HAVE_THREADSAFE */ diff --git a/src/H5Tarray.c b/src/H5Tarray.c index f7cddb9..714ecc9 100644 --- a/src/H5Tarray.c +++ b/src/H5Tarray.c @@ -94,7 +94,7 @@ DESCRIPTION static herr_t H5T_init_array_interface(void) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_init_array_interface) + FUNC_ENTER_NOAPI_NOINIT_NOERR FUNC_LEAVE_NOAPI(H5T_init()) } /* H5T_init_array_interface() */ @@ -127,7 +127,7 @@ H5Tarray_create2(hid_t base_id, unsigned ndims, const hsize_t dim[/* ndims */]) unsigned u; /* local index variable */ hid_t ret_value; /* return value */ - FUNC_ENTER_API(H5Tarray_create2, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("i", "iIu*h", base_id, ndims, dim); /* Check args */ @@ -182,7 +182,7 @@ H5T_array_create(H5T_t *base, unsigned ndims, const hsize_t dim[/* ndims */]) H5T_t *ret_value; /* new array data type */ unsigned u; /* local index variable */ - FUNC_ENTER_NOAPI(H5T_array_create, NULL) + FUNC_ENTER_NOAPI(NULL) HDassert(base); HDassert(ndims <= H5S_MAX_RANK); @@ -239,7 +239,7 @@ H5Tget_array_ndims(hid_t type_id) H5T_t *dt; /* pointer to array datatype */ int ret_value; /* return value */ - FUNC_ENTER_API(H5Tget_array_ndims, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("Is", "i", type_id); /* Check args */ @@ -273,7 +273,7 @@ done: int H5T_get_array_ndims(const H5T_t *dt) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_get_array_ndims) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(dt); HDassert(dt->shared->type == H5T_ARRAY); @@ -302,7 +302,7 @@ H5Tget_array_dims2(hid_t type_id, hsize_t dims[]) H5T_t *dt; /* pointer to array data type */ int ret_value; /* return value */ - FUNC_ENTER_API(H5Tget_array_dims2, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("Is", "i*h", type_id, dims); /* Check args */ @@ -339,7 +339,7 @@ H5T_get_array_dims(const H5T_t *dt, hsize_t dims[]) unsigned u; /* Local index variable */ int ret_value; /* return value */ - FUNC_ENTER_NOAPI(H5T_get_array_dims, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert(dt); HDassert(dt->shared->type == H5T_ARRAY); @@ -386,7 +386,7 @@ H5Tarray_create1(hid_t base_id, int ndims, const hsize_t dim[/* ndims */], unsigned u; /* local index variable */ hid_t ret_value; /* return value */ - FUNC_ENTER_API(H5Tarray_create1, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE4("i", "iIs*h*Is", base_id, ndims, dim, perm); /* Check args */ @@ -437,7 +437,7 @@ H5Tget_array_dims1(hid_t type_id, hsize_t dims[], int UNUSED perm[]) H5T_t *dt; /* Array datatype to query */ int ret_value; /* return value */ - FUNC_ENTER_API(H5Tget_array_dims1, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("Is", "i*h*Is", type_id, dims, perm); /* Check args */ diff --git a/src/H5Tbit.c b/src/H5Tbit.c index a52d538..f85ff14 100644 --- a/src/H5Tbit.c +++ b/src/H5Tbit.c @@ -46,9 +46,9 @@ void H5T_bit_copy(uint8_t *dst, size_t dst_offset, const uint8_t *src, size_t src_offset, size_t size) { - unsigned shift; - unsigned mask_lo, mask_hi; - unsigned s_idx, d_idx; + size_t shift; + size_t mask_lo, mask_hi; + size_t s_idx, d_idx; /* * Normalize the offset to be a byte number and a bit offset within that @@ -76,8 +76,8 @@ H5T_bit_copy(uint8_t *dst, size_t dst_offset, const uint8_t *src, * dst[d_idx+1] dst[d_idx] */ while(src_offset && size > 0) { - unsigned nbits = MIN3(size, 8 - dst_offset, 8 - src_offset); - unsigned mask = ((unsigned)1 << nbits) - 1; + size_t nbits = MIN3(size, 8 - dst_offset, 8 - src_offset); + size_t mask = ((size_t)1 << nbits) - 1; dst[d_idx] &= (uint8_t)~(mask << dst_offset); dst[d_idx] |= (uint8_t)(((src[s_idx] >> src_offset) & (uint8_t)mask) << dst_offset); @@ -119,7 +119,7 @@ H5T_bit_copy(uint8_t *dst, size_t dst_offset, const uint8_t *src, * to line up with the destination. */ shift = dst_offset; - mask_lo = ((unsigned)1 << (8 - shift)) - 1; + mask_lo = ((size_t)1 << (8 - shift)) - 1; mask_hi = (~mask_lo) & 0xff; for(/*void*/; size > 8; size -= 8, d_idx++, s_idx++) { @@ -135,8 +135,8 @@ H5T_bit_copy(uint8_t *dst, size_t dst_offset, const uint8_t *src, /* Finish up */ while(size > 0) { - unsigned nbits = (unsigned)MIN3 (size, 8 - dst_offset, 8 - src_offset); - unsigned mask = ((unsigned)1 << nbits) - 1; + size_t nbits = (size_t)MIN3 (size, 8 - dst_offset, 8 - src_offset); + size_t mask = ((size_t)1 << nbits) - 1; dst[d_idx] &= (uint8_t)(~(mask << dst_offset)); dst[d_idx] |= (uint8_t)(((src[s_idx] >> src_offset) & (uint8_t)mask) << dst_offset); @@ -185,7 +185,7 @@ H5T_bit_shift(uint8_t *buf, ssize_t shift_dist, size_t offset, size_t size) H5WB_t *wb = NULL; /* Wrapped buffer for temporary buffer */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5T_bit_shift, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ HDassert(buf); @@ -259,7 +259,7 @@ H5T_bit_get_d(uint8_t *buf, size_t offset, size_t size) size_t i, hs; uint64_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOFUNC(H5T_bit_get_d) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(8 * sizeof(val) >= size); @@ -417,8 +417,8 @@ H5T_bit_find(uint8_t *buf, size_t offset, size_t size, H5T_sdir_t direction, size_t iu; ssize_t ret_value = (-1); /* Return value */ - /* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_bit_find) + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Some functions call this with value=TRUE */ HDassert(TRUE == 1); @@ -522,8 +522,8 @@ H5T_bit_inc(uint8_t *buf, size_t start, size_t size) unsigned carry = 1; unsigned acc, mask; - /* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_bit_inc) + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(buf); @@ -593,8 +593,8 @@ H5T_bit_dec(uint8_t *buf, size_t start, size_t size) uint8_t tmp; unsigned borrow = 0; - /* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_bit_dec) + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(buf); HDassert(size); @@ -668,8 +668,8 @@ H5T_bit_neg(uint8_t *buf, size_t start, size_t size) size_t pos = start % 8; uint8_t tmp[1]; - /* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_bit_neg); + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(buf); HDassert(size); diff --git a/src/H5Tcommit.c b/src/H5Tcommit.c index d3779e5..a49d66e 100644 --- a/src/H5Tcommit.c +++ b/src/H5Tcommit.c @@ -99,7 +99,7 @@ DESCRIPTION static herr_t H5T_init_commit_interface(void) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_init_commit_interface) + FUNC_ENTER_NOAPI_NOINIT_NOERR FUNC_LEAVE_NOAPI(H5T_init()) } /* H5T_init_commit_interface() */ @@ -126,7 +126,7 @@ H5Tcommit2(hid_t loc_id, const char *name, hid_t type_id, hid_t lcpl_id, H5T_t *type; /* Datatype for ID */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Tcommit2, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE6("e", "i*siiii", loc_id, name, type_id, lcpl_id, tcpl_id, tapl_id); /* Check arguments */ @@ -159,7 +159,7 @@ H5Tcommit2(hid_t loc_id, const char *name, hid_t type_id, hid_t lcpl_id, HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not datatype access property list") /* Commit the type */ - if(H5T_commit_named(&loc, name, type, lcpl_id, tcpl_id, tapl_id, H5AC_dxpl_id) < 0) + if(H5T__commit_named(&loc, name, type, lcpl_id, tcpl_id, tapl_id, H5AC_dxpl_id) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to commit datatype") done: @@ -168,7 +168,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_commit_named + * Function: H5T__commit_named * * Purpose: Internal routine to save a transient datatype to a file and * turn the type ID into a "named", immutable type. @@ -181,7 +181,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5T_commit_named(const H5G_loc_t *loc, const char *name, H5T_t *dt, +H5T__commit_named(const H5G_loc_t *loc, const char *name, H5T_t *dt, hid_t lcpl_id, hid_t tcpl_id, hid_t tapl_id, hid_t dxpl_id) { H5O_obj_create_t ocrt_info; /* Information for object creation */ @@ -189,7 +189,7 @@ H5T_commit_named(const H5G_loc_t *loc, const char *name, H5T_t *dt, H5T_state_t old_state = H5T_STATE_TRANSIENT; /* The state of the datatype before H5T_commit. */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5T_commit_named, FAIL) + FUNC_ENTER_PACKAGE /* Sanity checks */ HDassert(loc); @@ -246,7 +246,7 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5T_commit_named() */ +} /* end H5T__commit_named() */ /*------------------------------------------------------------------------- @@ -275,7 +275,7 @@ H5Tcommit_anon(hid_t loc_id, hid_t type_id, hid_t tcpl_id, hid_t tapl_id) H5T_t *type = NULL; /* Datatype created */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Tcommit_anon, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE4("e", "iiii", loc_id, type_id, tcpl_id, tapl_id); /* Check arguments */ @@ -342,7 +342,7 @@ H5T_commit(H5F_t *file, H5T_t *type, hid_t tcpl_id, hid_t dxpl_id) size_t dtype_size; /* Size of the datatype message */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5T_commit) + FUNC_ENTER_NOAPI_NOINIT HDassert(file); HDassert(type); @@ -462,7 +462,7 @@ H5Tcommitted(hid_t type_id) H5T_t *type; /* Datatype to query */ htri_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Tcommitted, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("t", "i", type_id); /* Check arguments */ @@ -493,7 +493,7 @@ htri_t H5T_committed(const H5T_t *type) { /* Use no-init for efficiency */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_committed) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(type); @@ -520,7 +520,7 @@ H5T_link(const H5T_t *type, int adjust, hid_t dxpl_id) { int ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5T_link, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert(type); HDassert(type->sh_loc.type == H5O_SHARE_TYPE_COMMITTED); @@ -561,7 +561,7 @@ H5Topen2(hid_t loc_id, const char *name, hid_t tapl_id) hid_t dxpl_id = H5AC_dxpl_id; /* dxpl to use to open datatype */ hid_t ret_value = FAIL; /* Return value */ - FUNC_ENTER_API(H5Topen2, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("i", "i*si", loc_id, name, tapl_id); /* Check args */ @@ -643,7 +643,7 @@ H5Tget_create_plist(hid_t dtype_id) herr_t status; /* Generic status value */ hid_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Tget_create_plist, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("i", "i", dtype_id); /* Check arguments */ @@ -707,7 +707,7 @@ H5T_open(const H5G_loc_t *loc, hid_t dxpl_id) H5T_t *dt = NULL; H5T_t *ret_value; - FUNC_ENTER_NOAPI(H5T_open, NULL) + FUNC_ENTER_NOAPI(NULL) HDassert(loc); @@ -823,7 +823,7 @@ H5T_open_oid(const H5G_loc_t *loc, hid_t dxpl_id) H5T_t *dt = NULL; /* Datatype from the file */ H5T_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5T_open_oid) + FUNC_ENTER_NOAPI_NOINIT HDassert(loc); @@ -876,7 +876,7 @@ done: herr_t H5T_update_shared(H5T_t *dt) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_update_shared) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(dt); diff --git a/src/H5Tcompound.c b/src/H5Tcompound.c index 48192d2..e7142e5 100644 --- a/src/H5Tcompound.c +++ b/src/H5Tcompound.c @@ -93,7 +93,7 @@ DESCRIPTION static herr_t H5T_init_compound_interface(void) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_init_compound_interface) + FUNC_ENTER_NOAPI_NOINIT_NOERR FUNC_LEAVE_NOAPI(H5T_init()) } /* H5T_init_compound_interface() */ @@ -125,7 +125,7 @@ H5Tget_member_offset(hid_t type_id, unsigned membno) H5T_t *dt; /* Datatype to query */ size_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Tget_member_offset, 0) + FUNC_ENTER_API(0) H5TRACE2("z", "iIu", type_id, membno); /* Check args */ @@ -164,7 +164,7 @@ done: size_t H5T_get_member_offset(const H5T_t *dt, unsigned membno) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_get_member_offset) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(dt); HDassert(membno < dt->shared->u.compnd.nmembs); @@ -195,7 +195,7 @@ H5Tget_member_class(hid_t type_id, unsigned membno) H5T_t *dt; /* Datatype to query */ H5T_class_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Tget_member_class, H5T_NO_CLASS) + FUNC_ENTER_API(H5T_NO_CLASS) H5TRACE2("Tt", "iIu", type_id, membno); /* Check args */ @@ -239,7 +239,7 @@ H5Tget_member_type(hid_t type_id, unsigned membno) H5T_t *memb_dt = NULL; /* Member datatype */ hid_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Tget_member_type, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("i", "iIu", type_id, membno); /* Check args */ @@ -283,7 +283,7 @@ H5T_get_member_type(const H5T_t *dt, unsigned membno, H5T_copy_t method) { H5T_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5T_get_member_type, NULL) + FUNC_ENTER_NOAPI(NULL) HDassert(dt); HDassert(membno < dt->shared->u.compnd.nmembs); @@ -313,7 +313,7 @@ done: size_t H5T_get_member_size(const H5T_t *dt, unsigned membno) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_get_member_size) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(dt); HDassert(membno < dt->shared->u.compnd.nmembs); @@ -354,7 +354,7 @@ H5Tinsert(hid_t parent_id, const char *name, size_t offset, hid_t member_id) H5T_t *member; /* The member datatype */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Tinsert, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE4("e", "i*szi", parent_id, name, offset, member_id); /* Check args */ @@ -399,7 +399,7 @@ H5Tpack(hid_t type_id) H5T_t *dt; /* Datatype to modify */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Tpack, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("e", "i", type_id); /* Check args */ @@ -438,7 +438,7 @@ H5T_insert(H5T_t *parent, const char *name, size_t offset, const H5T_t *member) unsigned i; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5T_insert, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* check args */ HDassert(parent && H5T_COMPOUND == parent->shared->type); @@ -530,7 +530,7 @@ H5T_pack(const H5T_t *dt) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5T_pack) + FUNC_ENTER_NOAPI_NOINIT HDassert(dt); @@ -607,7 +607,7 @@ H5T_is_packed(const H5T_t *dt) { htri_t ret_value = TRUE; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_is_packed) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(dt); @@ -646,7 +646,7 @@ H5T_update_packed(const H5T_t *dt) { unsigned i; /* Index */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_update_packed) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(dt); HDassert(dt->shared->type == H5T_COMPOUND); diff --git a/src/H5Tconv.c b/src/H5Tconv.c index 927a9dc..6795ef1 100644 --- a/src/H5Tconv.c +++ b/src/H5Tconv.c @@ -601,7 +601,13 @@ } /* The main part of every integer hardware conversion macro */ -#define H5T_CONV(GUTS,STYPE,DTYPE,ST,DT,D_MIN,D_MAX) { \ +#define H5T_CONV(GUTS,STYPE,DTYPE,ST,DT,D_MIN,D_MAX) \ +{ \ + herr_t ret_value=SUCCEED; /* Return value */ \ + \ + FUNC_ENTER_NOAPI(FAIL) \ + \ +{ \ size_t elmtno; /*element number */ \ size_t sprec; /*source precision */ \ size_t dprec; /*destination precision */ \ @@ -745,6 +751,10 @@ HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, \ "unknown conversion command"); \ } \ +} \ + \ +done: \ + FUNC_LEAVE_NOAPI(ret_value) \ } /* Macro defining action on source data which needs to be aligned (before main action) */ @@ -955,7 +965,7 @@ DESCRIPTION static herr_t H5T_init_conv_interface(void) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_init_conv_interface) + FUNC_ENTER_NOAPI_NOINIT_NOERR FUNC_LEAVE_NOAPI(H5T_init()) } /* H5T_init_conv_interface() */ @@ -982,7 +992,7 @@ H5T_conv_noop(hid_t UNUSED src_id, hid_t UNUSED dst_id, H5T_cdata_t *cdata, { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5T_conv_noop, FAIL) + FUNC_ENTER_NOAPI(FAIL) switch(cdata->command) { case H5T_CONV_INIT: @@ -1035,7 +1045,7 @@ H5T_conv_order_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t i; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5T_conv_order_opt, FAIL) + FUNC_ENTER_NOAPI(FAIL) switch(cdata->command) { case H5T_CONV_INIT: @@ -1443,7 +1453,7 @@ H5T_conv_order(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t j, md; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5T_conv_order, FAIL) + FUNC_ENTER_NOAPI(FAIL) switch(cdata->command) { case H5T_CONV_INIT: @@ -1548,7 +1558,7 @@ H5T_conv_b_b(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, hbool_t reverse; /*if reverse the order of destination */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5T_conv_b_b, FAIL) + FUNC_ENTER_NOAPI(FAIL) switch(cdata->command) { case H5T_CONV_INIT: @@ -1774,7 +1784,7 @@ H5T_conv_struct_free(H5T_conv_struct_t *priv) *dst_memb_id = priv->dst_memb_id; unsigned i; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_conv_struct_free) + FUNC_ENTER_NOAPI_NOINIT_NOERR for(i = 0; i < priv->src_nmembs; i++) if(src2dst[i] >= 0) { @@ -1852,7 +1862,7 @@ H5T_conv_struct_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata, hid_t dxpl_id) unsigned i, j; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5T_conv_struct_init) + FUNC_ENTER_NOAPI_NOINIT src_nmembs = src->shared->u.compnd.nmembs; dst_nmembs = dst->shared->u.compnd.nmembs; @@ -2017,7 +2027,7 @@ H5T_conv_struct_subset(const H5T_cdata_t *cdata) { H5T_conv_struct_t *priv; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_conv_struct_subset) + FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(cdata); HDassert(cdata->priv); @@ -2088,7 +2098,7 @@ H5T_conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, H5T_conv_struct_t *priv = (H5T_conv_struct_t *)(cdata->priv); herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5T_conv_struct, FAIL) + FUNC_ENTER_NOAPI(FAIL) switch(cdata->command) { case H5T_CONV_INIT: @@ -2338,7 +2348,7 @@ H5T_conv_struct_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, int i; /*counters */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5T_conv_struct_opt, FAIL) + FUNC_ENTER_NOAPI(FAIL) switch(cdata->command) { case H5T_CONV_INIT: @@ -2570,7 +2580,7 @@ H5T_conv_enum_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata) unsigned i, j; /*counters */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5T_conv_enum_init) + FUNC_ENTER_NOAPI_NOINIT cdata->need_bkg = H5T_BKG_NO; if(NULL == (priv = (H5T_enum_struct_t *)(cdata->priv = H5MM_calloc(sizeof(*priv))))) @@ -2614,6 +2624,15 @@ H5T_conv_enum_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata) * a native integer type as an index into the `val2dst'. The values of * that array are the index numbers in the destination type or negative * if the entry is unused. + * + * (This optimized algorithm doesn't work when the byte orders are different. + * The code such as "n = *((int*)(src->shared->u.enumer.value+i*src->shared->size));" + * can change the value significantly. i.g. if the source value is big-endian 0x0000000f, + * executing the casting on little-endian machine will get a big number 0x0f000000. + * Then it can't meet the condition + * "if(src->shared->u.enumer.nmembs<2 || (double)length/src->shared->u.enumer.nmembs<1.2)" + * Because this is the optimized code, we won't fix it. It should still work in some + * situations. SLU - 2011/5/24) */ if (1==src->shared->size || sizeof(short)==src->shared->size || sizeof(int)==src->shared->size) { for (i=0; ishared->u.enumer.nmembs; i++) { @@ -2690,13 +2709,6 @@ done: * * Programmer: Robb Matzke * Monday, January 4, 1999 - * - * Modifications: - * Robb Matzke, 1999-06-16 - * Added support for non-zero strides. If BUF_STRIDE is non-zero - * then convert one value at each memory location advancing - * BUF_STRIDE bytes each time; otherwise assume both source and - * destination values are packed. *------------------------------------------------------------------------- */ herr_t @@ -2706,6 +2718,7 @@ H5T_conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, { uint8_t *buf = (uint8_t*)_buf; /*cast for pointer arithmetic */ H5T_t *src = NULL, *dst = NULL; /*src and dst datatypes */ + H5T_t *src_super = NULL, *dst_super = NULL; /*parent types for src and dst*/ uint8_t *s = NULL, *d = NULL; /*src and dst BUF pointers */ int src_delta, dst_delta; /*conversion strides */ int n; /*src value cast as native int */ @@ -2716,7 +2729,7 @@ H5T_conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t i; /*counters */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5T_conv_enum, FAIL) + FUNC_ENTER_NOAPI(FAIL) switch(cdata->command) { case H5T_CONV_INIT: @@ -2796,6 +2809,12 @@ H5T_conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, for(i = 0; i < nelmts; i++, s += src_delta, d += dst_delta) { if(priv->length) { /* Use O(1) lookup */ + /* (The casting won't work when the byte orders are different. i.g. if the source value + * is big-endian 0x0000000f, the direct casting "n = *((int*)s);" will make it a big + * number 0x0f000000 on little-endian machine. But we won't fix it because it's an + * optimization code. Please also see the comment in the H5T_conv_enum_init() function. + * SLU - 2011/5/24) + */ if(1 == src->shared->size) n = *((signed char*)s); else if(sizeof(short) == src->shared->size) @@ -2856,6 +2875,7 @@ H5T_conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } /* end else */ } } + break; default: @@ -2903,6 +2923,9 @@ done: * old data. At this moment, it only frees the first level of * VL datatype. It doesn't handle nested VL datatypes. * + * Raymond Lu, 8 November 2011 + * I put a condition check to prevent the conversion of VL strings + * between ASCII and UTF8. *------------------------------------------------------------------------- */ herr_t @@ -2936,7 +2959,7 @@ H5T_conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t elmtno; /*element number counter */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5T_conv_vlen, FAIL) + FUNC_ENTER_NOAPI(FAIL) switch(cdata->command) { case H5T_CONV_INIT: @@ -2953,6 +2976,11 @@ H5T_conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a H5T_VLEN datatype") if(H5T_VLEN != dst->shared->type) HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a H5T_VLEN datatype") + if(H5T_VLEN_STRING == src->shared->u.vlen.type && H5T_VLEN_STRING == dst->shared->u.vlen.type) { + if((H5T_CSET_ASCII == src->shared->u.vlen.cset && H5T_CSET_UTF8 == dst->shared->u.vlen.cset) + || (H5T_CSET_ASCII == dst->shared->u.vlen.cset && H5T_CSET_UTF8 == src->shared->u.vlen.cset)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "The library doesn't convert between strings of ASCII and UTF") + } /* Variable-length types don't need a background buffer */ cdata->need_bkg = H5T_BKG_NO; @@ -3239,7 +3267,7 @@ H5T_conv_array(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, void *bkg_buf = NULL; /*temporary background buffer */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5T_conv_array, FAIL) + FUNC_ENTER_NOAPI(FAIL) switch (cdata->command) { case H5T_CONV_INIT: @@ -3404,7 +3432,7 @@ H5T_conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, hbool_t reverse; /*if reverse the order of destination */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5T_conv_i_i, FAIL) + FUNC_ENTER_NOAPI(FAIL) switch(cdata->command) { case H5T_CONV_INIT: @@ -3826,7 +3854,7 @@ H5T_conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, hbool_t reverse; /*if reverse the order of destination */ herr_t ret_value = SUCCEED; /*return value */ - FUNC_ENTER_NOAPI(H5T_conv_f_f, FAIL) + FUNC_ENTER_NOAPI(FAIL) switch(cdata->command) { case H5T_CONV_INIT: @@ -4350,6 +4378,10 @@ done: * then convert one value at each memory location advancing * BUF_STRIDE bytes each time; otherwise assume both source and * destination values are packed. + * + * Raymond Lu, 8 November 2011 + * I put a condition check to prevent the conversion of strings + * between ASCII and UTF8. *------------------------------------------------------------------------- */ herr_t @@ -4367,7 +4399,7 @@ H5T_conv_s_s(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, uint8_t *dbuf=NULL; /*temp buf for overlap convers. */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5T_conv_s_s, FAIL) + FUNC_ENTER_NOAPI(FAIL) switch(cdata->command) { case H5T_CONV_INIT: @@ -4381,6 +4413,9 @@ H5T_conv_s_s(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "bad source character set") if(H5T_CSET_ASCII != dst->shared->u.atomic.u.s.cset && H5T_CSET_UTF8 != dst->shared->u.atomic.u.s.cset) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "bad destination character set") + if((H5T_CSET_ASCII == src->shared->u.atomic.u.s.cset && H5T_CSET_UTF8 == dst->shared->u.atomic.u.s.cset) + || (H5T_CSET_ASCII == dst->shared->u.atomic.u.s.cset && H5T_CSET_UTF8 == src->shared->u.atomic.u.s.cset)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "The library doesn't convert between strings of ASCII and UTF") if(src->shared->u.atomic.u.s.pad < 0 || src->shared->u.atomic.u.s.pad >= H5T_NPAD || dst->shared->u.atomic.u.s.pad < 0 || dst->shared->u.atomic.u.s.pad >= H5T_NPAD) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "bad character padding") @@ -4582,14 +4617,7 @@ H5T_conv_schar_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_schar_uchar, FAIL) - H5T_CONV_su(SCHAR, UCHAR, signed char, unsigned char, -, -); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -4615,14 +4643,7 @@ H5T_conv_uchar_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_uchar_schar, FAIL) - H5T_CONV_us(UCHAR, SCHAR, unsigned char, signed char, -, SCHAR_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -4648,14 +4669,7 @@ H5T_conv_schar_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_schar_short, FAIL) - H5T_CONV_sS(SCHAR, SHORT, signed char, short, -, -); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -4681,14 +4695,7 @@ H5T_conv_schar_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_schar_ushort, FAIL) - H5T_CONV_sU(SCHAR, USHORT, signed char, unsigned short, -, -); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -4714,14 +4721,7 @@ H5T_conv_uchar_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_uchar_short, FAIL) - H5T_CONV_uS(UCHAR, SHORT, unsigned char, short, -, SHRT_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -4747,14 +4747,7 @@ H5T_conv_uchar_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_uchar_ushort, FAIL) - H5T_CONV_uU(UCHAR, USHORT, unsigned char, unsigned short, -, -); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -4779,14 +4772,7 @@ H5T_conv_schar_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_schar_int, FAIL) - H5T_CONV_sS(SCHAR, INT, signed char, int, -, -); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -4811,14 +4797,7 @@ H5T_conv_schar_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_schar_uint, FAIL) - H5T_CONV_sU(SCHAR, UINT, signed char, unsigned, -, -); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -4843,14 +4822,7 @@ H5T_conv_uchar_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_uchar_int, FAIL) - H5T_CONV_uS(UCHAR, INT, unsigned char, int, -, INT_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -4875,14 +4847,7 @@ H5T_conv_uchar_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_uchar_uint, FAIL) - H5T_CONV_uU(UCHAR, UINT, unsigned char, unsigned, -, -); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -4907,14 +4872,7 @@ H5T_conv_schar_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_schar_long, FAIL) - H5T_CONV_sS(SCHAR, LONG, signed char, long, -, -); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -4940,14 +4898,7 @@ H5T_conv_schar_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_schar_ulong, FAIL) - H5T_CONV_sU(SCHAR, ULONG, signed char, unsigned long, -, -); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -4972,14 +4923,7 @@ H5T_conv_uchar_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_uchar_long, FAIL) - H5T_CONV_uS(UCHAR, LONG, unsigned char, long, -, LONG_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -5005,14 +4949,7 @@ H5T_conv_uchar_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_uchar_ulong, FAIL) - H5T_CONV_uU(UCHAR, ULONG, unsigned char, unsigned long, -, -); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -5038,14 +4975,7 @@ H5T_conv_schar_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_schar_llong, FAIL) - H5T_CONV_sS(SCHAR, LLONG, signed char, long long, -, -); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -5071,14 +5001,7 @@ H5T_conv_schar_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_schar_ullong, FAIL) - H5T_CONV_sU(SCHAR, ULLONG, signed char, unsigned long long, -, -); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -5104,14 +5027,7 @@ H5T_conv_uchar_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_uchar_llong, FAIL) - H5T_CONV_uS(UCHAR, LLONG, unsigned char, long long, -, LLONG_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -5137,14 +5053,7 @@ H5T_conv_uchar_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_uchar_ullong, FAIL) - H5T_CONV_uU(UCHAR, ULLONG, unsigned char, unsigned long long, -, -); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -5170,14 +5079,7 @@ H5T_conv_short_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_short_schar, FAIL) - H5T_CONV_Ss(SHORT, SCHAR, short, signed char, SCHAR_MIN, SCHAR_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -5203,14 +5105,7 @@ H5T_conv_short_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_short_uchar, FAIL) - H5T_CONV_Su(SHORT, UCHAR, short, unsigned char, -, UCHAR_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -5236,14 +5131,7 @@ H5T_conv_ushort_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_ushort_schar, FAIL) - H5T_CONV_Us(USHORT, SCHAR, unsigned short, signed char, -, SCHAR_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -5269,14 +5157,7 @@ H5T_conv_ushort_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_ushort_uchar, FAIL) - H5T_CONV_Uu(USHORT, UCHAR, unsigned short, unsigned char, -, UCHAR_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -5302,14 +5183,7 @@ H5T_conv_short_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_short_ushort, FAIL) - H5T_CONV_su(SHORT, USHORT, short, unsigned short, -, -); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -5335,14 +5209,7 @@ H5T_conv_ushort_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_ushort_short, FAIL) - H5T_CONV_us(USHORT, SHORT, unsigned short, short, -, SHRT_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -5368,14 +5235,7 @@ H5T_conv_short_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_short_int, FAIL) - H5T_CONV_sS(SHORT, INT, short, int, -, -); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -5401,14 +5261,7 @@ H5T_conv_short_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_short_uint, FAIL) - H5T_CONV_sU(SHORT, UINT, short, unsigned, -, -); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -5434,14 +5287,7 @@ H5T_conv_ushort_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_ushort_int, FAIL) - H5T_CONV_uS(USHORT, INT, unsigned short, int, -, INT_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -5467,14 +5313,7 @@ H5T_conv_ushort_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_ushort_uint, FAIL) - H5T_CONV_uU(USHORT, UINT, unsigned short, unsigned, -, -); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -5500,14 +5339,7 @@ H5T_conv_short_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_short_long, FAIL) - H5T_CONV_sS(SHORT, LONG, short, long, -, -); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -5533,14 +5365,7 @@ H5T_conv_short_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_short_ulong, FAIL) - H5T_CONV_sU(SHORT, ULONG, short, unsigned long, -, -); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -5566,14 +5391,7 @@ H5T_conv_ushort_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_ushort_long, FAIL) - H5T_CONV_uS(USHORT, LONG, unsigned short, long, -, LONG_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -5599,14 +5417,7 @@ H5T_conv_ushort_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_ushort_ulong, FAIL) - H5T_CONV_uU(USHORT, ULONG, unsigned short, unsigned long, -, -); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -5632,14 +5443,7 @@ H5T_conv_short_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_short_llong, FAIL) - H5T_CONV_sS(SHORT, LLONG, short, long long, -, -); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -5665,14 +5469,7 @@ H5T_conv_short_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_short_ullong, FAIL) - H5T_CONV_sU(SHORT, ULLONG, short, unsigned long long, -, -); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -5698,14 +5495,7 @@ H5T_conv_ushort_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_ushort_llong, FAIL) - H5T_CONV_uS(USHORT, LLONG, unsigned short, long long, -, LLONG_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -5731,14 +5521,7 @@ H5T_conv_ushort_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_ushort_ullong, FAIL) - H5T_CONV_uU(USHORT, ULLONG, unsigned short, unsigned long long, -, -); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -5764,14 +5547,7 @@ H5T_conv_int_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_int_schar, FAIL) - H5T_CONV_Ss(INT, SCHAR, int, signed char, SCHAR_MIN, SCHAR_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -5797,14 +5573,7 @@ H5T_conv_int_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_int_uchar, FAIL) - H5T_CONV_Su(INT, UCHAR, int, unsigned char, -, UCHAR_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -5830,14 +5599,7 @@ H5T_conv_uint_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_uint_schar, FAIL) - H5T_CONV_Us(UINT, SCHAR, unsigned, signed char, -, SCHAR_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -5863,14 +5625,7 @@ H5T_conv_uint_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_uint_uchar, FAIL) - H5T_CONV_Uu(UINT, UCHAR, unsigned, unsigned char, -, UCHAR_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -5896,14 +5651,7 @@ H5T_conv_int_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_int_short, FAIL) - H5T_CONV_Ss(INT, SHORT, int, short, SHRT_MIN, SHRT_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -5929,14 +5677,7 @@ H5T_conv_int_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_int_ushort, FAIL) - H5T_CONV_Su(INT, USHORT, int, unsigned short, -, USHRT_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -5962,14 +5703,7 @@ H5T_conv_uint_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_uint_short, FAIL) - H5T_CONV_Us(UINT, SHORT, unsigned, short, -, SHRT_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -5995,14 +5729,7 @@ H5T_conv_uint_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_uint_ushort, FAIL) - H5T_CONV_Uu(UINT, USHORT, unsigned, unsigned short, -, USHRT_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -6027,14 +5754,7 @@ H5T_conv_int_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_int_uint, FAIL) - H5T_CONV_su(INT, UINT, int, unsigned, -, -); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -6059,14 +5779,7 @@ H5T_conv_uint_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_uint_int, FAIL) - H5T_CONV_us(UINT, INT, unsigned, int, -, INT_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -6091,14 +5804,7 @@ H5T_conv_int_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_int_long, FAIL) - H5T_CONV_sS(INT, LONG, int, long, -, -); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -6123,14 +5829,7 @@ H5T_conv_int_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_int_ulong, FAIL) - H5T_CONV_sU(INT, LONG, int, unsigned long, -, -); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -6155,14 +5854,7 @@ H5T_conv_uint_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_uint_long, FAIL) - H5T_CONV_uS(UINT, LONG, unsigned, long, -, LONG_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -6187,14 +5879,7 @@ H5T_conv_uint_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_uint_ulong, FAIL) - H5T_CONV_uU(UINT, ULONG, unsigned, unsigned long, -, -); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -6219,14 +5904,7 @@ H5T_conv_int_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_int_llong, FAIL) - H5T_CONV_sS(INT, LLONG, int, long long, -, -); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -6251,14 +5929,7 @@ H5T_conv_int_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_int_ullong, FAIL) - H5T_CONV_sU(INT, ULLONG, int, unsigned long long, -, -); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -6283,14 +5954,7 @@ H5T_conv_uint_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_uint_llong, FAIL) - H5T_CONV_uS(UINT, LLONG, unsigned, long long, -, LLONG_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -6316,14 +5980,7 @@ H5T_conv_uint_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_uint_ullong, FAIL) - H5T_CONV_uU(UINT, ULLONG, unsigned, unsigned long long, -, -); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -6348,14 +6005,7 @@ H5T_conv_long_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_long_schar, FAIL) - H5T_CONV_Ss(LONG, SCHAR, long, signed char, SCHAR_MIN, SCHAR_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -6380,14 +6030,7 @@ H5T_conv_long_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_long_uchar, FAIL) - H5T_CONV_Su(LONG, UCHAR, long, unsigned char, -, UCHAR_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -6413,14 +6056,7 @@ H5T_conv_ulong_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_ulong_schar, FAIL) - H5T_CONV_Us(ULONG, SCHAR, unsigned long, signed char, -, SCHAR_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -6446,14 +6082,7 @@ H5T_conv_ulong_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_ulong_uchar, FAIL) - H5T_CONV_Uu(ULONG, UCHAR, unsigned long, unsigned char, -, UCHAR_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -6478,14 +6107,7 @@ H5T_conv_long_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_long_short, FAIL) - H5T_CONV_Ss(LONG, SHORT, long, short, SHRT_MIN, SHRT_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -6511,14 +6133,7 @@ H5T_conv_long_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_long_ushort, FAIL) - H5T_CONV_Su(LONG, USHORT, long, unsigned short, -, USHRT_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -6543,14 +6158,7 @@ H5T_conv_ulong_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_ulong_short, FAIL) - H5T_CONV_Us(ULONG, SHORT, unsigned long, short, -, SHRT_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -6576,14 +6184,7 @@ H5T_conv_ulong_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_ulong_ushort, FAIL) - H5T_CONV_Uu(ULONG, USHORT, unsigned long, unsigned short, -, USHRT_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -6608,14 +6209,7 @@ H5T_conv_long_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_long_int, FAIL) - H5T_CONV_Ss(LONG, INT, long, int, INT_MIN, INT_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -6640,14 +6234,7 @@ H5T_conv_long_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_long_uint, FAIL) - H5T_CONV_Su(LONG, UINT, long, unsigned, -, UINT_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -6672,14 +6259,7 @@ H5T_conv_ulong_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_ulong_int, FAIL) - H5T_CONV_Us(ULONG, INT, unsigned long, int, -, INT_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -6704,14 +6284,7 @@ H5T_conv_ulong_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_ulong_uint, FAIL) - H5T_CONV_Uu(ULONG, UINT, unsigned long, unsigned, -, UINT_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -6736,14 +6309,7 @@ H5T_conv_long_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_long_ulong, FAIL) - H5T_CONV_su(LONG, ULONG, long, unsigned long, -, -); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -6768,14 +6334,7 @@ H5T_conv_ulong_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_ulong_long, FAIL) - H5T_CONV_us(ULONG, LONG, unsigned long, long, -, LONG_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -6800,14 +6359,7 @@ H5T_conv_long_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_long_llong, FAIL) - H5T_CONV_sS(LONG, LLONG, long, long long, -, -); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -6833,14 +6385,7 @@ H5T_conv_long_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_long_ullong, FAIL) - H5T_CONV_sU(LONG, ULLONG, long, unsigned long long, -, -); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -6866,14 +6411,7 @@ H5T_conv_ulong_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_ulong_llong, FAIL) - H5T_CONV_uS(ULONG, LLONG, unsigned long, long long, -, LLONG_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -6899,14 +6437,7 @@ H5T_conv_ulong_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_ulong_ullong, FAIL) - H5T_CONV_uU(ULONG, ULLONG, unsigned long, unsigned long long, -, -); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -6932,14 +6463,7 @@ H5T_conv_llong_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_llong_schar, FAIL) - H5T_CONV_Ss(LLONG, SCHAR, long long, signed char, SCHAR_MIN, SCHAR_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -6965,14 +6489,7 @@ H5T_conv_llong_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_llong_uchar, FAIL) - H5T_CONV_Su(LLONG, UCHAR, long long, unsigned char, -, UCHAR_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -6998,14 +6515,7 @@ H5T_conv_ullong_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_ullong_schar, FAIL) - H5T_CONV_Us(ULLONG, SCHAR, unsigned long long, signed char, -, SCHAR_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -7031,14 +6541,7 @@ H5T_conv_ullong_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_ullong_uchar, FAIL) - H5T_CONV_Uu(ULLONG, UCHAR, unsigned long long, unsigned char, -, UCHAR_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -7064,14 +6567,7 @@ H5T_conv_llong_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_llong_short, FAIL) - H5T_CONV_Ss(LLONG, SHORT, long long, short, SHRT_MIN, SHRT_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -7097,14 +6593,7 @@ H5T_conv_llong_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_llong_ushort, FAIL) - H5T_CONV_Su(LLONG, USHORT, long long, unsigned short, -, USHRT_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -7130,14 +6619,7 @@ H5T_conv_ullong_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_ullong_short, FAIL) - H5T_CONV_Us(ULLONG, SHORT, unsigned long long, short, -, SHRT_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -7163,14 +6645,7 @@ H5T_conv_ullong_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_ullong_ushort, FAIL) - H5T_CONV_Uu(ULLONG, USHORT, unsigned long long, unsigned short, -, USHRT_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -7195,14 +6670,7 @@ H5T_conv_llong_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_llong_int, FAIL) - H5T_CONV_Ss(LLONG, INT, long long, int, INT_MIN, INT_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -7227,14 +6695,7 @@ H5T_conv_llong_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_llong_uint, FAIL) - H5T_CONV_Su(LLONG, UINT, long long, unsigned, -, UINT_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -7259,14 +6720,7 @@ H5T_conv_ullong_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_ullong_int, FAIL) - H5T_CONV_Us(ULLONG, INT, unsigned long long, int, -, INT_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -7292,14 +6746,7 @@ H5T_conv_ullong_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_ullong_uint, FAIL) - H5T_CONV_Uu(ULLONG, UINT, unsigned long long, unsigned, -, UINT_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -7324,14 +6771,7 @@ H5T_conv_llong_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_llong_long, FAIL) - H5T_CONV_Ss(LLONG, LONG, long long, long, LONG_MIN, LONG_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -7357,14 +6797,7 @@ H5T_conv_llong_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_llong_ulong, FAIL) - H5T_CONV_Su(LLONG, ULONG, long long, unsigned long, -, ULONG_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -7390,14 +6823,7 @@ H5T_conv_ullong_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_ullong_long, FAIL) - H5T_CONV_Us(ULLONG, LONG, unsigned long long, long, -, LONG_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -7423,14 +6849,7 @@ H5T_conv_ullong_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_ullong_ulong, FAIL) - H5T_CONV_Uu(ULLONG, ULONG, unsigned long long, unsigned long, -, ULONG_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -7456,14 +6875,7 @@ H5T_conv_llong_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_llong_ullong, FAIL) - H5T_CONV_su(LLONG, ULLONG, long long, unsigned long long, -, -); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -7489,14 +6901,7 @@ H5T_conv_ullong_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_ullong_llong, FAIL) - H5T_CONV_us(ULLONG, LLONG, unsigned long long, long long, -, LLONG_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -7526,14 +6931,7 @@ H5T_conv_float_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_float_double, FAIL) - H5T_CONV_fF(FLOAT, DOUBLE, float, double, -, -); - -done: - FUNC_LEAVE_NOAPI(ret_value) } #endif /* H5T_CONV_INTERNAL_FP_FP */ @@ -7560,14 +6958,7 @@ H5T_conv_float_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_float_ldouble, FAIL) - H5T_CONV_fF(FLOAT, LDOUBLE, float, long double, -, -); - -done: - FUNC_LEAVE_NOAPI(ret_value) } #endif /*H5T_CONV_INTERNAL_FP_LDOUBLE*/ @@ -7601,14 +6992,7 @@ H5T_conv_double_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_double_float, FAIL) - H5T_CONV_Ff(DOUBLE, FLOAT, double, float, -FLT_MAX, FLT_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } #endif /*H5T_CONV_INTERNAL_FP_FP*/ @@ -7635,15 +7019,7 @@ H5T_conv_double_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_double_ldouble, FAIL) - H5T_CONV_fF(DOUBLE, LDOUBLE, double, long double, -, -); - - -done: - FUNC_LEAVE_NOAPI(ret_value) } #endif /*H5T_CONV_INTERNAL_FP_LDOUBLE*/ @@ -7670,14 +7046,7 @@ H5T_conv_ldouble_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_ldouble_float, FAIL) - H5T_CONV_Ff(LDOUBLE, FLOAT, long double, float, -FLT_MAX, FLT_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } #endif /* H5T_CONV_INTERNAL_FP_LDOUBLE */ @@ -7704,14 +7073,7 @@ H5T_conv_ldouble_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_ldouble_double, FAIL) - H5T_CONV_Ff(LDOUBLE, DOUBLE, long double, double, -DBL_MAX, DBL_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } #endif /*H5T_CONV_INTERNAL_FP_LDOUBLE*/ @@ -7737,14 +7099,7 @@ H5T_conv_schar_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_schar_float, FAIL) - H5T_CONV_xF(SCHAR, FLOAT, signed char, float, -, -); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -7769,14 +7124,7 @@ H5T_conv_schar_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_schar_double, FAIL) - H5T_CONV_xF(SCHAR, DOUBLE, signed char, double, -, -); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -7802,14 +7150,7 @@ H5T_conv_schar_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_schar_ldouble, FAIL) - H5T_CONV_xF(SCHAR, LDOUBLE, signed char, long double, -, -); - -done: - FUNC_LEAVE_NOAPI(ret_value) } #endif /* H5T_CONV_INTERNAL_INTEGER_LDOUBLE */ @@ -7835,14 +7176,7 @@ H5T_conv_uchar_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_uchar_float, FAIL) - H5T_CONV_xF(UCHAR, FLOAT, unsigned char, float, -, -); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -7867,14 +7201,7 @@ H5T_conv_uchar_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_uchar_double, FAIL) - H5T_CONV_xF(UCHAR, DOUBLE, unsigned char, double, -, -); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -7900,14 +7227,7 @@ H5T_conv_uchar_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_uchar_ldouble, FAIL) - H5T_CONV_xF(UCHAR, LDOUBLE, unsigned char, long double, -, -); - -done: - FUNC_LEAVE_NOAPI(ret_value) } #endif /* H5T_CONV_INTERNAL_INTEGER_LDOUBLE */ @@ -7933,14 +7253,7 @@ H5T_conv_short_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_short_float, FAIL) - H5T_CONV_xF(SHORT, FLOAT, short, float, -, -); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -7965,14 +7278,7 @@ H5T_conv_short_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_short_double, FAIL) - H5T_CONV_xF(SHORT, DOUBLE, short, double, -, -); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -7998,14 +7304,7 @@ H5T_conv_short_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_short_ldouble, FAIL) - - H5T_CONV_xF(SHORT, LDOUBLE, short, long double, -, -); - -done: - FUNC_LEAVE_NOAPI(ret_value) + H5T_CONV_xF(SHORT, LDOUBLE, short, long double, -, -); } #endif /* H5T_CONV_INTERNAL_INTEGER_LDOUBLE */ @@ -8031,14 +7330,7 @@ H5T_conv_ushort_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_ushort_float, FAIL) - H5T_CONV_xF(USHORT, FLOAT, unsigned short, float, -, -); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -8063,14 +7355,7 @@ H5T_conv_ushort_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_ushort_double, FAIL) - H5T_CONV_xF(USHORT, DOUBLE, unsigned short, double, -, -); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -8096,14 +7381,7 @@ H5T_conv_ushort_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_ushort_ldouble, FAIL) - H5T_CONV_xF(USHORT, LDOUBLE, unsigned short, long double, -, -); - -done: - FUNC_LEAVE_NOAPI(ret_value) } #endif /* H5T_CONV_INTERNAL_INTEGER_LDOUBLE */ @@ -8129,14 +7407,7 @@ H5T_conv_int_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_int_float, FAIL) - H5T_CONV_xF(INT, FLOAT, int, float, -, -); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -8161,14 +7432,7 @@ H5T_conv_int_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_int_double, FAIL) - H5T_CONV_xF(INT, DOUBLE, int, double, -, -); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -8194,14 +7458,7 @@ H5T_conv_int_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_int_ldouble, FAIL) - H5T_CONV_xF(INT, LDOUBLE, int, long double, -, -); - -done: - FUNC_LEAVE_NOAPI(ret_value) } #endif /* H5T_CONV_INTERNAL_INTEGER_LDOUBLE */ @@ -8227,14 +7484,7 @@ H5T_conv_uint_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_uint_float, FAIL) - H5T_CONV_xF(UINT, FLOAT, unsigned int, float, -, -); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -8259,14 +7509,7 @@ H5T_conv_uint_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_uint_double, FAIL) - H5T_CONV_xF(UINT, DOUBLE, unsigned int, double, -, -); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -8292,14 +7535,7 @@ H5T_conv_uint_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_uint_ldouble, FAIL) - H5T_CONV_xF(UINT, LDOUBLE, unsigned int, long double, -, -); - -done: - FUNC_LEAVE_NOAPI(ret_value) } #endif /* H5T_CONV_INTERNAL_INTEGER_LDOUBLE */ @@ -8325,14 +7561,7 @@ H5T_conv_long_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_long_float, FAIL) - H5T_CONV_xF(LONG, FLOAT, long, float, -, -); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -8357,14 +7586,7 @@ H5T_conv_long_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_long_double, FAIL) - H5T_CONV_xF(LONG, DOUBLE, long, double, -, -); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -8390,14 +7612,7 @@ H5T_conv_long_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_long_ldouble, FAIL) - H5T_CONV_xF(LONG, LDOUBLE, long, long double, -, -); - -done: - FUNC_LEAVE_NOAPI(ret_value) } #endif /* H5T_CONV_INTERNAL_INTEGER_LDOUBLE */ @@ -8424,14 +7639,7 @@ H5T_conv_ulong_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_ulong_float, FAIL) - H5T_CONV_xF(ULONG, FLOAT, unsigned long, float, -, -); - -done: - FUNC_LEAVE_NOAPI(ret_value) } #endif /* H5T_CONV_INTERNAL_ULONG_FLT */ @@ -8458,14 +7666,7 @@ H5T_conv_ulong_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_ulong_double, FAIL) - H5T_CONV_xF(ULONG, DOUBLE, unsigned long, double, -, -); - -done: - FUNC_LEAVE_NOAPI(ret_value) } #endif /* H5T_CONV_INTERNAL_ULONG_DBL */ @@ -8492,14 +7693,7 @@ H5T_conv_ulong_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_ulong_ldouble, FAIL) - H5T_CONV_xF(ULONG, LDOUBLE, unsigned long, long double, -, -); - -done: - FUNC_LEAVE_NOAPI(ret_value) } #endif /* H5T_CONV_INTERNAL_ULONG_LDOUBLE */ @@ -8525,14 +7719,7 @@ H5T_conv_llong_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_llong_float, FAIL) - H5T_CONV_xF(LLONG, FLOAT, long long, float, -, -); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -8557,14 +7744,7 @@ H5T_conv_llong_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_llong_double, FAIL) - H5T_CONV_xF(LLONG, DOUBLE, long long, double, -, -); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -8590,14 +7770,7 @@ H5T_conv_llong_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_llong_ldouble, FAIL) - H5T_CONV_xF(LLONG, LDOUBLE, long long, long double, -, -); - -done: - FUNC_LEAVE_NOAPI(ret_value) } #endif /* H5T_CONV_INTERNAL_LLONG_LDOUBLE */ @@ -8624,14 +7797,7 @@ H5T_conv_ullong_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_ullong_float, FAIL) - H5T_CONV_xF(ULLONG, FLOAT, unsigned long long, float, -, -); - -done: - FUNC_LEAVE_NOAPI(ret_value) } #endif /*H5T_CONV_INTERNAL_ULLONG_FP*/ @@ -8658,14 +7824,7 @@ H5T_conv_ullong_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_ullong_double, FAIL) - H5T_CONV_xF(ULLONG, DOUBLE, unsigned long long, double, -, -); - -done: - FUNC_LEAVE_NOAPI(ret_value) } #endif /*H5T_CONV_INTERNAL_ULLONG_FP*/ @@ -8692,14 +7851,7 @@ H5T_conv_ullong_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_ullong_ldouble, FAIL) - H5T_CONV_xF(ULLONG, LDOUBLE, unsigned long long, long double, -, -); - -done: - FUNC_LEAVE_NOAPI(ret_value) } #endif /*H5T_CONV_INTERNAL_ULLONG_LDOUBLE*/ @@ -8725,14 +7877,7 @@ H5T_conv_float_schar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_float_schar, FAIL) - H5T_CONV_Fx(FLOAT, SCHAR, float, signed char, SCHAR_MIN, SCHAR_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -8757,14 +7902,7 @@ H5T_conv_float_uchar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_float_uchar, FAIL) - H5T_CONV_Fx(FLOAT, UCHAR, float, unsigned char, 0, UCHAR_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -8789,14 +7927,7 @@ H5T_conv_double_schar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_double_schar, FAIL) - H5T_CONV_Fx(DOUBLE, SCHAR, double, signed char, SCHAR_MIN, SCHAR_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -8821,14 +7952,7 @@ H5T_conv_double_uchar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_double_uchar, FAIL) - H5T_CONV_Fx(DOUBLE, UCHAR, double, unsigned char, 0, UCHAR_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -8854,14 +7978,7 @@ H5T_conv_ldouble_schar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_ldouble_schar, FAIL) - H5T_CONV_Fx(LDOUBLE, SCHAR, long double, signed char, SCHAR_MIN, SCHAR_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } #endif /* H5T_CONV_INTERNAL_LDOUBLE_INTEGER */ @@ -8888,14 +8005,7 @@ H5T_conv_ldouble_uchar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_ldouble_uchar, FAIL) - H5T_CONV_Fx(LDOUBLE, UCHAR, long double, unsigned char, 0, UCHAR_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } #endif /* H5T_CONV_INTERNAL_LDOUBLE_INTEGER */ @@ -8921,14 +8031,7 @@ H5T_conv_float_short (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_float_short, FAIL) - H5T_CONV_Fx(FLOAT, SHORT, float, short, SHRT_MIN, SHRT_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -8953,14 +8056,7 @@ H5T_conv_float_ushort (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_float_ushort, FAIL) - H5T_CONV_Fx(FLOAT, USHORT, float, unsigned short, 0, USHRT_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -8985,14 +8081,7 @@ H5T_conv_double_short (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_double_short, FAIL) - H5T_CONV_Fx(DOUBLE, SHORT, double, short, SHRT_MIN, SHRT_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -9017,14 +8106,7 @@ H5T_conv_double_ushort (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_double_ushort, FAIL) - H5T_CONV_Fx(DOUBLE, USHORT, double, unsigned short, 0, USHRT_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -9050,14 +8132,7 @@ H5T_conv_ldouble_short (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_ldouble_short, FAIL) - H5T_CONV_Fx(LDOUBLE, SHORT, long double, short, SHRT_MIN, SHRT_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } #endif /*H5T_CONV_INTERNAL_LDOUBLE_INTEGER*/ @@ -9084,14 +8159,7 @@ H5T_conv_ldouble_ushort (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_ldouble_ushort, FAIL) - H5T_CONV_Fx(LDOUBLE, USHORT, long double, unsigned short, 0, USHRT_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } #endif /* H5T_CONV_INTERNAL_LDOUBLE_INTEGER */ @@ -9117,14 +8185,7 @@ H5T_conv_float_int (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_float_int, FAIL) - H5T_CONV_Fx(FLOAT, INT, float, int, INT_MIN, INT_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -9149,14 +8210,7 @@ H5T_conv_float_uint (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_float_uint, FAIL) - H5T_CONV_Fx(FLOAT, UINT, float, unsigned int, 0, UINT_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -9181,14 +8235,7 @@ H5T_conv_double_int (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_double_int, FAIL) - H5T_CONV_Fx(DOUBLE, INT, double, int, INT_MIN, INT_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -9213,14 +8260,7 @@ H5T_conv_double_uint (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_double_uint, FAIL) - H5T_CONV_Fx(DOUBLE, UINT, double, unsigned int, 0, UINT_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -9246,14 +8286,7 @@ H5T_conv_ldouble_int (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_ldouble_int, FAIL) - H5T_CONV_Fx(LDOUBLE, INT, long double, int, INT_MIN, INT_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } #endif /* H5T_CONV_INTERNAL_LDOUBLE_INTEGER */ @@ -9280,14 +8313,7 @@ H5T_conv_ldouble_uint (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_ldouble_uint, FAIL) - H5T_CONV_Fx(LDOUBLE, UINT, long double, unsigned int, 0, UINT_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } #endif /* H5T_CONV_INTERNAL_LDOUBLE_UINT */ @@ -9313,14 +8339,7 @@ H5T_conv_float_long (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_float_long, FAIL) - H5T_CONV_Fx(FLOAT, LONG, float, long, LONG_MIN, LONG_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -9345,14 +8364,7 @@ H5T_conv_float_ulong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_float_ulong, FAIL) - H5T_CONV_Fx(FLOAT, ULONG, float, unsigned long, 0, ULONG_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -9377,14 +8389,7 @@ H5T_conv_double_long (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_double_long, FAIL) - H5T_CONV_Fx(DOUBLE, LONG, double, long, LONG_MIN, LONG_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -9409,14 +8414,7 @@ H5T_conv_double_ulong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_double_ulong, FAIL) - H5T_CONV_Fx(DOUBLE, ULONG, double, unsigned long, 0, ULONG_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } @@ -9442,14 +8440,7 @@ H5T_conv_ldouble_long (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_ldouble_long, FAIL) - H5T_CONV_Fx(LDOUBLE, LONG, long double, long, LONG_MIN, LONG_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } #endif /*H5T_CONV_INTERNAL_LDOUBLE_INTEGER*/ @@ -9476,14 +8467,7 @@ H5T_conv_ldouble_ulong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_ldouble_ulong, FAIL) - H5T_CONV_Fx(LDOUBLE, ULONG, long double, unsigned long, 0, ULONG_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } #endif /* H5T_CONV_INTERNAL_LDOUBLE_INTEGER */ @@ -9510,14 +8494,7 @@ H5T_conv_float_llong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_float_llong, FAIL) - H5T_CONV_Fx(FLOAT, LLONG, float, long long, LLONG_MIN, LLONG_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } #endif /* H5T_CONV_INTERNAL_FP_LLONG */ @@ -9544,14 +8521,7 @@ H5T_conv_float_ullong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_float_ullong, FAIL) - H5T_CONV_Fx(FLOAT, ULLONG, float, unsigned long long, 0, ULLONG_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } #endif /*H5T_CONV_INTERNAL_FP_ULLONG*/ @@ -9578,14 +8548,7 @@ H5T_conv_double_llong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_double_llong, FAIL) - H5T_CONV_Fx(DOUBLE, LLONG, double, long long, LLONG_MIN, LLONG_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } #endif /*H5T_CONV_INTERNAL_FP_LLONG*/ @@ -9612,14 +8575,7 @@ H5T_conv_double_ullong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_double_ullong, FAIL) - H5T_CONV_Fx(DOUBLE, ULLONG, double, unsigned long long, 0, ULLONG_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } #endif /*H5T_CONV_INTERNAL_FP_ULLONG*/ @@ -9646,14 +8602,7 @@ H5T_conv_ldouble_llong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_ldouble_llong, FAIL) - H5T_CONV_Fx(LDOUBLE, LLONG, long double, long long, LLONG_MIN, LLONG_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } #endif /*H5T_CONV_INTERNAL_LDOUBLE_LLONG*/ @@ -9680,14 +8629,7 @@ H5T_conv_ldouble_ullong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t dxpl_id) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5T_conv_ldouble_ullong, FAIL) - H5T_CONV_Fx(LDOUBLE, ULLONG, long double, unsigned long long, 0, ULLONG_MAX); - -done: - FUNC_LEAVE_NOAPI(ret_value) } #endif /*H5T_CONV_INTERNAL_LDOUBLE_ULLONG*/ @@ -9751,7 +8693,7 @@ H5T_conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, H5T_conv_ret_t except_ret; /*return of callback function */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5T_conv_f_i, FAIL) + FUNC_ENTER_NOAPI(FAIL) switch(cdata->command) { case H5T_CONV_INIT: @@ -10340,7 +9282,7 @@ H5T_conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, hbool_t reverse; /*if reverse the order of destination */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5T_conv_i_f, FAIL) + FUNC_ENTER_NOAPI(FAIL) switch(cdata->command) { case H5T_CONV_INIT: @@ -10735,7 +9677,7 @@ H5T_reverse_order(uint8_t *rev, uint8_t *s, size_t size, H5T_order_t order) { size_t i; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_reverse_order) + FUNC_ENTER_NOAPI_NOINIT_NOERR assert(s); assert(size); diff --git a/src/H5Tcset.c b/src/H5Tcset.c index 4ec58ab..33fb32a 100644 --- a/src/H5Tcset.c +++ b/src/H5Tcset.c @@ -46,7 +46,7 @@ DESCRIPTION static herr_t H5T_init_cset_interface(void) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_init_cset_interface) + FUNC_ENTER_NOAPI_NOINIT_NOERR FUNC_LEAVE_NOAPI(H5T_init()) } /* H5T_init_cset_interface() */ @@ -78,7 +78,7 @@ H5Tget_cset(hid_t type_id) H5T_t *dt; H5T_cset_t ret_value; - FUNC_ENTER_API(H5Tget_cset, H5T_CSET_ERROR) + FUNC_ENTER_API(H5T_CSET_ERROR) H5TRACE1("Tc", "i", type_id); /* Check args */ @@ -124,7 +124,7 @@ H5Tset_cset(hid_t type_id, H5T_cset_t cset) H5T_t *dt; herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Tset_cset, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "iTc", type_id, cset); /* Check args */ diff --git a/src/H5Tdbg.c b/src/H5Tdbg.c index 92ab674..c161f9f 100644 --- a/src/H5Tdbg.c +++ b/src/H5Tdbg.c @@ -109,7 +109,7 @@ H5T_print_stats(H5T_path_t UNUSED * path, int UNUSED * nprint/*in,out*/) char bandwidth[32]; #endif - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_print_stats) + FUNC_ENTER_NOAPI_NOINIT_NOERR #ifdef H5T_DEBUG if(H5DEBUG(T) && path->stats.ncalls > 0) { @@ -166,7 +166,7 @@ H5T_debug(const H5T_t *dt, FILE *stream) const char *s1 = "", *s2 = ""; unsigned i; - FUNC_ENTER_NOAPI_NOFUNC(H5T_debug) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(dt); diff --git a/src/H5Tdeprec.c b/src/H5Tdeprec.c index b3bd298..32080fe 100644 --- a/src/H5Tdeprec.c +++ b/src/H5Tdeprec.c @@ -101,7 +101,7 @@ DESCRIPTION static herr_t H5T_init_deprec_interface(void) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_init_deprec_interface) + FUNC_ENTER_NOAPI_NOINIT_NOERR FUNC_LEAVE_NOAPI(H5T_init()) } /* H5T_init_deprec_interface() */ @@ -129,7 +129,7 @@ H5Tcommit1(hid_t loc_id, const char *name, hid_t type_id) H5T_t *type; /* Datatype for ID */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Tcommit1, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("e", "i*si", loc_id, name, type_id); /* Check arguments */ @@ -141,7 +141,7 @@ H5Tcommit1(hid_t loc_id, const char *name, hid_t type_id) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") /* Commit the datatype to the file, using default property list values */ - if(H5T_commit_named(&loc, name, type, H5P_LINK_CREATE_DEFAULT, + if(H5T__commit_named(&loc, name, type, H5P_LINK_CREATE_DEFAULT, H5P_DATATYPE_CREATE_DEFAULT, H5P_DATATYPE_ACCESS_DEFAULT, H5AC_dxpl_id) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to commit datatype") @@ -179,7 +179,7 @@ H5Topen1(hid_t loc_id, const char *name) hid_t dxpl_id = H5AC_dxpl_id; /* dxpl to use to open datatype */ hid_t ret_value = FAIL; - FUNC_ENTER_API(H5Topen1, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("i", "i*s", loc_id, name); /* Check args */ diff --git a/src/H5Tenum.c b/src/H5Tenum.c index 8ef88f5..1e3d760 100644 --- a/src/H5Tenum.c +++ b/src/H5Tenum.c @@ -53,7 +53,7 @@ DESCRIPTION static herr_t H5T_init_enum_interface(void) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_init_enum_interface) + FUNC_ENTER_NOAPI_NOINIT_NOERR FUNC_LEAVE_NOAPI(H5T_init()) } /* H5T_init_enum_interface() */ @@ -83,7 +83,7 @@ H5Tenum_create(hid_t parent_id) H5T_t *dt = NULL; /*new enumeration data type */ hid_t ret_value; /*return value */ - FUNC_ENTER_API(H5Tenum_create, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("i", "i", parent_id); /* Check args */ @@ -125,7 +125,7 @@ H5T_enum_create(const H5T_t *parent) { H5T_t *ret_value; /*new enumeration data type */ - FUNC_ENTER_NOAPI(H5T_enum_create, NULL) + FUNC_ENTER_NOAPI(NULL) assert(parent); @@ -169,7 +169,7 @@ H5Tenum_insert(hid_t type, const char *name, const void *value) H5T_t *dt=NULL; herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Tenum_insert, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("e", "i*s*x", type, name, value); /* Check args */ @@ -218,7 +218,7 @@ H5T_enum_insert(const H5T_t *dt, const char *name, const void *value) uint8_t *values=NULL; herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5T_enum_insert, FAIL) + FUNC_ENTER_NOAPI(FAIL) assert(dt); assert(name && *name); @@ -280,7 +280,7 @@ H5Tget_member_value(hid_t type, unsigned membno, void *value/*out*/) H5T_t *dt=NULL; herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Tget_member_value, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("e", "iIux", type, membno, value); if(NULL == (dt = (H5T_t *)H5I_object_verify(type, H5I_DATATYPE))) @@ -322,7 +322,7 @@ H5T_get_member_value(const H5T_t *dt, unsigned membno, void *value/*out*/) { herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5T_get_member_value, FAIL) + FUNC_ENTER_NOAPI(FAIL) assert(dt); assert(value); @@ -363,7 +363,7 @@ H5Tenum_nameof(hid_t type, const void *value, char *name/*out*/, size_t size) H5T_t *dt = NULL; herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Tenum_nameof, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE4("e", "i*xxz", type, value, name, size); /* Check args */ @@ -421,7 +421,7 @@ H5T_enum_nameof(const H5T_t *dt, const void *value, char *name/*out*/, size_t si hbool_t alloc_name = FALSE; /* Whether name has been allocated */ char *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5T_enum_nameof) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(dt && H5T_ENUM == dt->shared->type); @@ -512,7 +512,7 @@ H5Tenum_valueof(hid_t type, const char *name, void *value/*out*/) H5T_t *dt; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Tenum_valueof, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("e", "i*sx", type, name, value); /* Check args */ @@ -563,7 +563,7 @@ H5T_enum_valueof(const H5T_t *dt, const char *name, void *value/*out*/) H5T_t *copied_dt = NULL; /*do sorting in copied datatype */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5T_enum_valueof) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ assert(dt && H5T_ENUM==dt->shared->type); diff --git a/src/H5Tfields.c b/src/H5Tfields.c index 43f1369..a208f75 100644 --- a/src/H5Tfields.c +++ b/src/H5Tfields.c @@ -47,7 +47,7 @@ DESCRIPTION static herr_t H5T_init_fields_interface(void) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_init_fields_interface) + FUNC_ENTER_NOAPI_NOINIT_NOERR FUNC_LEAVE_NOAPI(H5T_init()) } /* H5T_init_fields_interface() */ @@ -79,7 +79,7 @@ H5Tget_nmembers(hid_t type_id) H5T_t *dt; /* Datatype to query */ int ret_value; /* Return value */ - FUNC_ENTER_API(H5Tget_nmembers, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("Is", "i", type_id); /* Check args */ @@ -119,7 +119,7 @@ H5T_get_nmembers(const H5T_t *dt) { int ret_value; - FUNC_ENTER_NOAPI(H5T_get_nmembers, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert(dt); @@ -162,7 +162,7 @@ H5Tget_member_name(hid_t type_id, unsigned membno) H5T_t *dt = NULL; char *ret_value; - FUNC_ENTER_API(H5Tget_member_name, NULL) + FUNC_ENTER_API(NULL) /* Check args */ if (NULL == (dt = H5I_object_verify(type_id,H5I_DATATYPE))) @@ -200,7 +200,7 @@ H5T_get_member_name(H5T_t const *dt, unsigned membno) { char *ret_value; - FUNC_ENTER_NOAPI(H5T_get_member_name, NULL) + FUNC_ENTER_NOAPI(NULL) assert(dt); @@ -251,7 +251,7 @@ H5Tget_member_index(hid_t type_id, const char *name) int ret_value=FAIL; unsigned i; - FUNC_ENTER_API(H5Tget_member_index, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("Is", "i*s", type_id, name); /* Check arguments */ @@ -308,7 +308,7 @@ H5T_sort_value(const H5T_t *dt, int *map) unsigned i, j; /* Local index variables */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5T_sort_value, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args */ HDassert(dt); @@ -413,7 +413,7 @@ H5T_sort_name(const H5T_t *dt, int *map) uint8_t tbuf[32]; herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5T_sort_name, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args */ assert(dt); diff --git a/src/H5Tfixed.c b/src/H5Tfixed.c index 770293a..51737eb 100644 --- a/src/H5Tfixed.c +++ b/src/H5Tfixed.c @@ -46,7 +46,7 @@ DESCRIPTION static herr_t H5T_init_fixed_interface(void) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_init_fixed_interface) + FUNC_ENTER_NOAPI_NOINIT_NOERR FUNC_LEAVE_NOAPI(H5T_init()) } /* H5T_init_fixed_interface() */ @@ -75,7 +75,7 @@ H5Tget_sign(hid_t type_id) H5T_t *dt = NULL; H5T_sign_t ret_value; - FUNC_ENTER_API(H5Tget_sign, H5T_SGN_ERROR) + FUNC_ENTER_API(H5T_SGN_ERROR) H5TRACE1("Ts", "i", type_id); /* Check args */ @@ -111,7 +111,7 @@ H5T_get_sign(H5T_t const *dt) { H5T_sign_t ret_value; - FUNC_ENTER_NOAPI(H5T_get_sign, H5T_SGN_ERROR) + FUNC_ENTER_NOAPI(H5T_SGN_ERROR) assert(dt); @@ -154,7 +154,7 @@ H5Tset_sign(hid_t type_id, H5T_sign_t sign) H5T_t *dt = NULL; herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Tset_sign, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "iTs", type_id, sign); /* Check args */ diff --git a/src/H5Tfloat.c b/src/H5Tfloat.c index 88d13fd..7d08d62 100644 --- a/src/H5Tfloat.c +++ b/src/H5Tfloat.c @@ -46,7 +46,7 @@ DESCRIPTION static herr_t H5T_init_float_interface(void) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_init_float_interface) + FUNC_ENTER_NOAPI_NOINIT_NOERR FUNC_LEAVE_NOAPI(H5T_init()) } /* H5T_init_float_interface() */ @@ -79,7 +79,7 @@ size_t *esize/*out*/, size_t *mpos/*out*/, size_t *msize/*out*/) H5T_t *dt; /* Datatype */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Tget_fields, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE6("e", "ixxxxx", type_id, spos, epos, esize, mpos, msize); /* Check args */ @@ -132,7 +132,7 @@ H5Tset_fields(hid_t type_id, size_t spos, size_t epos, size_t esize, H5T_t *dt; /* Datatype */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Tset_fields, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE6("e", "izzzzz", type_id, spos, epos, esize, mpos, msize); /* Check args */ @@ -191,7 +191,7 @@ H5Tget_ebias(hid_t type_id) H5T_t *dt; /* Datatype */ size_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Tget_ebias, 0) + FUNC_ENTER_API(0) H5TRACE1("z", "i", type_id); /* Check args */ @@ -232,7 +232,7 @@ H5Tset_ebias(hid_t type_id, size_t ebias) H5T_t *dt; /* Datatype */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Tset_ebias, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "iz", type_id, ebias); /* Check args */ @@ -274,7 +274,7 @@ H5Tget_norm(hid_t type_id) H5T_t *dt; /* Datatype */ H5T_norm_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Tget_norm, H5T_NORM_ERROR) + FUNC_ENTER_API(H5T_NORM_ERROR) H5TRACE1("Tn", "i", type_id); /* Check args */ @@ -312,7 +312,7 @@ H5Tset_norm(hid_t type_id, H5T_norm_t norm) H5T_t *dt; /* Datatype */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Tset_norm, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "iTn", type_id, norm); /* Check args */ @@ -358,7 +358,7 @@ H5Tget_inpad(hid_t type_id) H5T_t *dt; /* Datatype */ H5T_pad_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Tget_inpad, H5T_PAD_ERROR) + FUNC_ENTER_API(H5T_PAD_ERROR) H5TRACE1("Tp", "i", type_id); /* Check args */ @@ -398,7 +398,7 @@ H5Tset_inpad(hid_t type_id, H5T_pad_t pad) H5T_t *dt; /* Datatype */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Tset_inpad, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "iTp", type_id, pad); /* Check args */ diff --git a/src/H5Tnative.c b/src/H5Tnative.c index 3699757..50bb96e 100644 --- a/src/H5Tnative.c +++ b/src/H5Tnative.c @@ -60,7 +60,7 @@ DESCRIPTION static herr_t H5T_init_native_interface(void) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_init_native_interface) + FUNC_ENTER_NOAPI_NOINIT_NOERR FUNC_LEAVE_NOAPI(H5T_init()) } /* H5T_init_native_interface() */ @@ -104,7 +104,7 @@ H5Tget_native_type(hid_t type_id, H5T_direction_t direction) size_t comp_size=0; /* Compound datatype's size */ hid_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Tget_native_type, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("i", "iTd", type_id, direction); /* check argument */ @@ -170,7 +170,7 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig unsigned u; /* Local index variable */ H5T_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5T_get_native_type, NULL) + FUNC_ENTER_NOAPI(NULL) assert(dtype); @@ -568,7 +568,7 @@ H5T_get_native_integer(size_t prec, H5T_sign_t sign, H5T_direction_t direction, } match = H5T_NATIVE_INT_MATCH_UNKNOWN; H5T_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5T_get_native_integer, NULL) + FUNC_ENTER_NOAPI(NULL) if(direction == H5T_DIR_DEFAULT || direction == H5T_DIR_ASCEND) { if(prec <= H5Tget_precision(H5T_NATIVE_SCHAR)) { @@ -708,7 +708,7 @@ H5T_get_native_float(size_t size, H5T_direction_t direction, size_t *struct_alig } match=H5T_NATIVE_FLOAT_MATCH_UNKNOWN; H5T_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5T_get_native_float, NULL) + FUNC_ENTER_NOAPI(NULL) assert(size>0); @@ -826,7 +826,7 @@ H5T_get_native_bitfield(size_t prec, H5T_direction_t direction, size_t *struct_a size_t native_size=0; /* Datatype size of the native type */ H5T_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5T_get_native_bitfield, NULL) + FUNC_ENTER_NOAPI(NULL) if(direction == H5T_DIR_DEFAULT || direction == H5T_DIR_ASCEND) { if(prec<=H5Tget_precision(H5T_NATIVE_B8)) { @@ -909,7 +909,7 @@ H5T_cmp_offset(size_t *comp_size, size_t *offset, size_t elem_size, { herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI(H5T_cmp_offset, FAIL) + FUNC_ENTER_NOAPI(FAIL) if(offset && comp_size) { if(align>1 && *comp_size%align) { diff --git a/src/H5Toffset.c b/src/H5Toffset.c index 17351f4..bea8d2b 100644 --- a/src/H5Toffset.c +++ b/src/H5Toffset.c @@ -49,7 +49,7 @@ DESCRIPTION static herr_t H5T_init_offset_interface(void) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_init_offset_interface) + FUNC_ENTER_NOAPI_NOINIT_NOERR FUNC_LEAVE_NOAPI(H5T_init()) } /* H5T_init_offset_interface() */ @@ -90,7 +90,7 @@ H5Tget_offset(hid_t type_id) H5T_t *dt; int ret_value; - FUNC_ENTER_API(H5Tget_offset, -1) + FUNC_ENTER_API(-1) H5TRACE1("Is", "i", type_id); /* Check args */ @@ -140,7 +140,7 @@ H5T_get_offset(const H5T_t *dt) { int ret_value; - FUNC_ENTER_NOAPI(H5T_get_offset, -1) + FUNC_ENTER_NOAPI(-1) /* Defer to parent*/ while(dt->shared->parent) @@ -201,7 +201,7 @@ H5Tset_offset(hid_t type_id, size_t offset) H5T_t *dt; herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Tset_offset, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "iz", type_id, offset); /* Check args */ @@ -269,7 +269,7 @@ H5T_set_offset(const H5T_t *dt, size_t offset) { herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5T_set_offset, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args */ assert(dt); diff --git a/src/H5Toh.c b/src/H5Toh.c index 886acc1..5878075 100644 --- a/src/H5Toh.c +++ b/src/H5Toh.c @@ -98,12 +98,12 @@ const H5O_obj_class_t H5O_OBJ_DATATYPE[1] = {{ * *------------------------------------------------------------------------- */ -htri_t +static htri_t H5O_dtype_isa(struct H5O_t *oh) { htri_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5O_dtype_isa, FAIL) + FUNC_ENTER_NOAPI_NOINIT HDassert(oh); @@ -134,7 +134,7 @@ H5O_dtype_open(const H5G_loc_t *obj_loc, hid_t UNUSED lapl_id, hid_t dxpl_id, hb H5T_t *type = NULL; /* Datatype opened */ hid_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_dtype_open) + FUNC_ENTER_NOAPI_NOINIT HDassert(obj_loc); @@ -174,7 +174,7 @@ H5O_dtype_create(H5F_t *f, void *_crt_info, H5G_loc_t *obj_loc, hid_t dxpl_id) H5T_obj_create_t *crt_info = (H5T_obj_create_t *)_crt_info; /* Named datatype creation parameters */ void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_dtype_create) + FUNC_ENTER_NOAPI_NOINIT /* Sanity checks */ HDassert(f); @@ -218,7 +218,7 @@ H5O_dtype_get_oloc(hid_t obj_id) H5T_t *type; /* Datatype opened */ H5O_loc_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_dtype_get_oloc) + FUNC_ENTER_NOAPI_NOINIT /* Get the datatype */ if(NULL == (type = (H5T_t *)H5I_object(obj_id))) diff --git a/src/H5Topaque.c b/src/H5Topaque.c index 0e137ac..d68e659 100644 --- a/src/H5Topaque.c +++ b/src/H5Topaque.c @@ -47,7 +47,7 @@ DESCRIPTION static herr_t H5T_init_opaque_interface(void) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_init_opaque_interface) + FUNC_ENTER_NOAPI_NOINIT_NOERR FUNC_LEAVE_NOAPI(H5T_init()) } /* H5T_init_opaque_interface() */ @@ -73,7 +73,7 @@ H5Tset_tag(hid_t type_id, const char *tag) H5T_t *dt=NULL; herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Tset_tag, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*s", type_id, tag); /* Check args */ @@ -120,7 +120,7 @@ H5Tget_tag(hid_t type_id) H5T_t *dt=NULL; char *ret_value; - FUNC_ENTER_API(H5Tget_tag, NULL) + FUNC_ENTER_API(NULL) /* Check args */ if (NULL == (dt = H5I_object_verify(type_id,H5I_DATATYPE))) diff --git a/src/H5Torder.c b/src/H5Torder.c index 590a6c7..35be454 100644 --- a/src/H5Torder.c +++ b/src/H5Torder.c @@ -94,7 +94,7 @@ DESCRIPTION static herr_t H5T_init_order_interface(void) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_init_order_interface) + FUNC_ENTER_NOAPI_NOINIT_NOERR FUNC_LEAVE_NOAPI(H5T_init()) } /* H5T_init_order_interface() */ @@ -121,7 +121,7 @@ H5Tget_order(hid_t type_id) H5T_t *dt; /* Datatype to query */ H5T_order_t ret_value; /* Return value */ - FUNC_ENTER_API(H5Tget_order, H5T_ORDER_ERROR) + FUNC_ENTER_API(H5T_ORDER_ERROR) H5TRACE1("To", "i", type_id); /* Check args */ @@ -155,7 +155,7 @@ H5T_get_order(const H5T_t *dtype) { H5T_order_t ret_value = H5T_ORDER_NONE; /* Return value */ - FUNC_ENTER_NOAPI(H5T_get_order, H5T_ORDER_ERROR) + FUNC_ENTER_NOAPI(H5T_ORDER_ERROR) /* Defer to parent */ while(dtype->shared->parent) @@ -228,7 +228,7 @@ H5Tset_order(hid_t type_id, H5T_order_t order) H5T_t *dt; /* Datatype to modify */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Tset_order, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "iTo", type_id, order); /* Check args */ @@ -265,7 +265,7 @@ H5T_set_order(H5T_t *dtype, H5T_order_t order) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5T_set_order, FAIL) + FUNC_ENTER_NOAPI(FAIL) if(H5T_ENUM == dtype->shared->type && dtype->shared->u.enumer.nmembs > 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "operation not allowed after enum members are defined") diff --git a/src/H5Tpad.c b/src/H5Tpad.c index eee2ab3..88a5e13 100644 --- a/src/H5Tpad.c +++ b/src/H5Tpad.c @@ -46,7 +46,7 @@ DESCRIPTION static herr_t H5T_init_pad_interface(void) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_init_pad_interface) + FUNC_ENTER_NOAPI_NOINIT_NOERR FUNC_LEAVE_NOAPI(H5T_init()) } /* H5T_init_pad_interface() */ @@ -76,7 +76,7 @@ H5Tget_pad(hid_t type_id, H5T_pad_t *lsb/*out*/, H5T_pad_t *msb/*out*/) H5T_t *dt = NULL; herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Tget_pad, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("e", "ixx", type_id, lsb, msb); /* Check args */ @@ -120,7 +120,7 @@ H5Tset_pad(hid_t type_id, H5T_pad_t lsb, H5T_pad_t msb) H5T_t *dt = NULL; herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Tset_pad, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE3("e", "iTpTp", type_id, lsb, msb); /* Check args */ diff --git a/src/H5Tpkg.h b/src/H5Tpkg.h index 0ec9632..f25fb1e 100644 --- a/src/H5Tpkg.h +++ b/src/H5Tpkg.h @@ -513,7 +513,7 @@ H5FL_EXTERN(H5T_shared_t); /* Common functions */ H5_DLL H5T_t *H5T_create(H5T_class_t type, size_t size); H5_DLL herr_t H5T_commit(H5F_t *file, H5T_t *type, hid_t tcpl_id, hid_t dxpl_id); -H5_DLL herr_t H5T_commit_named(const H5G_loc_t *loc, const char *name, +H5_DLL herr_t H5T__commit_named(const H5G_loc_t *loc, const char *name, H5T_t *dt, hid_t lcpl_id, hid_t tcpl_id, hid_t tapl_id, hid_t dxpl_id); H5_DLL H5T_t *H5T_alloc(void); H5_DLL herr_t H5T_free(H5T_t *dt); diff --git a/src/H5Tprecis.c b/src/H5Tprecis.c index 62493e9..c5ac186 100644 --- a/src/H5Tprecis.c +++ b/src/H5Tprecis.c @@ -49,7 +49,7 @@ DESCRIPTION static herr_t H5T_init_precis_interface(void) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_init_precis_interface) + FUNC_ENTER_NOAPI_NOINIT_NOERR FUNC_LEAVE_NOAPI(H5T_init()) } /* H5T_init_precis_interface() */ @@ -83,7 +83,7 @@ H5Tget_precision(hid_t type_id) H5T_t *dt; size_t ret_value; - FUNC_ENTER_API(H5Tget_precision, 0) + FUNC_ENTER_API(0) H5TRACE1("z", "i", type_id); /* Check args */ @@ -121,7 +121,7 @@ H5T_get_precision(const H5T_t *dt) { size_t ret_value; - FUNC_ENTER_NOAPI(H5T_get_precision, 0) + FUNC_ENTER_NOAPI(0) /* Defer to parent*/ while(dt->shared->parent) @@ -172,7 +172,7 @@ H5Tset_precision(hid_t type_id, size_t prec) H5T_t *dt = NULL; herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Tset_precision, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "iz", type_id, prec); /* Check args */ @@ -233,7 +233,7 @@ H5T_set_precision(const H5T_t *dt, size_t prec) size_t offset, size; herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5T_set_precision, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args */ assert(dt); diff --git a/src/H5Tprivate.h b/src/H5Tprivate.h index c70eea0..0c96896 100644 --- a/src/H5Tprivate.h +++ b/src/H5Tprivate.h @@ -135,6 +135,7 @@ H5_DLL htri_t H5T_set_loc(H5T_t *dt, H5F_t *f, H5T_loc_t loc); H5_DLL htri_t H5T_is_sensible(const H5T_t *dt); H5_DLL uint32_t H5T_hash(H5F_t * file, const H5T_t *dt); H5_DLL herr_t H5T_set_latest_version(H5T_t *dt); +H5_DLL herr_t H5T_patch_file(H5T_t *dt, H5F_t *f); H5_DLL htri_t H5T_is_variable_str(const H5T_t *dt); /* Reference specific functions */ diff --git a/src/H5Tstrpad.c b/src/H5Tstrpad.c index 6dc79a1..e8ac4f5 100644 --- a/src/H5Tstrpad.c +++ b/src/H5Tstrpad.c @@ -46,7 +46,7 @@ DESCRIPTION static herr_t H5T_init_strpad_interface(void) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_init_strpad_interface) + FUNC_ENTER_NOAPI_NOINIT_NOERR FUNC_LEAVE_NOAPI(H5T_init()) } /* H5T_init_strpad_interface() */ @@ -79,7 +79,7 @@ H5Tget_strpad(hid_t type_id) H5T_t *dt = NULL; H5T_str_t ret_value; - FUNC_ENTER_API(H5Tget_strpad, H5T_STR_ERROR) + FUNC_ENTER_API(H5T_STR_ERROR) H5TRACE1("Tz", "i", type_id); /* Check args */ @@ -136,7 +136,7 @@ H5Tset_strpad(hid_t type_id, H5T_str_t strpad) H5T_t *dt = NULL; herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Tset_strpad, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "iTz", type_id, strpad); /* Check args */ diff --git a/src/H5Tvisit.c b/src/H5Tvisit.c index 44e06fe..a1843ef 100644 --- a/src/H5Tvisit.c +++ b/src/H5Tvisit.c @@ -101,7 +101,7 @@ H5T_visit(H5T_t *dt, unsigned visit_flags, H5T_operator_t op, void *op_value) hbool_t is_complex; /* Flag indicating current datatype is "complex" */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5T_visit, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ HDassert(dt); diff --git a/src/H5Tvlen.c b/src/H5Tvlen.c index f1b1f00..267692c 100644 --- a/src/H5Tvlen.c +++ b/src/H5Tvlen.c @@ -81,7 +81,7 @@ DESCRIPTION static herr_t H5T_init_vlen_interface(void) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_init_vlen_interface) + FUNC_ENTER_NOAPI_NOINIT_NOERR FUNC_LEAVE_NOAPI(H5T_init()) } /* H5T_init_vlen_interface() */ @@ -109,7 +109,7 @@ H5Tvlen_create(hid_t base_id) H5T_t *dt = NULL; /*new datatype */ hid_t ret_value; /*return value */ - FUNC_ENTER_API(H5Tvlen_create, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("i", "i", base_id); /* Check args */ @@ -150,7 +150,7 @@ H5T_vlen_create(const H5T_t *base) H5T_t *dt = NULL; /*new VL datatype */ H5T_t *ret_value; /*return value */ - FUNC_ENTER_NOAPI_NOINIT(H5T_vlen_create) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ HDassert(base); @@ -211,7 +211,7 @@ H5T_vlen_set_loc(const H5T_t *dt, H5F_t *f, H5T_loc_t loc) { htri_t ret_value = FALSE; /* Indicate success, but no location change */ - FUNC_ENTER_NOAPI_NOINIT(H5T_vlen_set_loc) + FUNC_ENTER_NOAPI_NOINIT /* check parameters */ HDassert(dt); @@ -322,7 +322,7 @@ H5T_vlen_seq_mem_getlen(const void *_vl) hvl_t vl; /* User's hvl_t information */ #endif - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_vlen_seq_mem_getlen) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check parameters, return result */ #ifdef H5_NO_ALIGNMENT_RESTRICTIONS @@ -359,7 +359,7 @@ H5T_vlen_seq_mem_getptr(void *_vl) hvl_t vl; /* User's hvl_t information */ #endif - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_vlen_seq_mem_getptr) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check parameters, return result */ #ifdef H5_NO_ALIGNMENT_RESTRICTIONS @@ -397,7 +397,7 @@ H5T_vlen_seq_mem_isnull(const H5F_t UNUSED *f, void *_vl) hvl_t vl; /* User's hvl_t information */ #endif - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_vlen_seq_mem_isnull) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check parameters, return result */ #ifdef H5_NO_ALIGNMENT_RESTRICTIONS @@ -435,7 +435,7 @@ H5T_vlen_seq_mem_read(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, void *_vl, void *bu hvl_t vl; /* User's hvl_t information */ #endif - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_vlen_seq_mem_read) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check parameters, copy data */ HDassert(buf); @@ -475,7 +475,7 @@ H5T_vlen_seq_mem_write(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const H5T_vlen_all size_t len; herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5T_vlen_seq_mem_write) + FUNC_ENTER_NOAPI_NOINIT /* check parameters */ HDassert(_vl); @@ -530,7 +530,7 @@ H5T_vlen_seq_mem_setnull(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, void *_vl, void { hvl_t vl; /* Temporary hvl_t to use during operation */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_vlen_seq_mem_setnull) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check parameters */ HDassert(_vl); @@ -567,7 +567,7 @@ H5T_vlen_str_mem_getlen(const void *_vl) const char *s; /* Pointer to the user's string information */ #endif - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_vlen_str_mem_getlen) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check parameters */ #ifdef H5_NO_ALIGNMENT_RESTRICTIONS @@ -602,7 +602,7 @@ H5T_vlen_str_mem_getptr(void *_vl) char *s; /* Pointer to the user's string information */ #endif - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_vlen_str_mem_getptr) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check parameters */ #ifdef H5_NO_ALIGNMENT_RESTRICTIONS @@ -638,7 +638,7 @@ H5T_vlen_str_mem_isnull(const H5F_t UNUSED *f, void *_vl) char *s; /* Pointer to the user's string information */ #endif - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_vlen_str_mem_isnull) + FUNC_ENTER_NOAPI_NOINIT_NOERR #ifndef H5_NO_ALIGNMENT_RESTRICTIONS HDmemcpy(&s, _vl, sizeof(char *)); @@ -670,7 +670,7 @@ H5T_vlen_str_mem_read(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, void *_vl, void *bu char *s; /* Pointer to the user's string information */ #endif - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_vlen_str_mem_read) + FUNC_ENTER_NOAPI_NOINIT_NOERR if(len>0) { /* check parameters */ @@ -709,7 +709,7 @@ H5T_vlen_str_mem_write(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const H5T_vlen_all size_t len; /* Maximum length of the string to copy */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5T_vlen_str_mem_write) + FUNC_ENTER_NOAPI_NOINIT /* check parameters */ HDassert(buf); @@ -754,7 +754,7 @@ H5T_vlen_str_mem_setnull(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, void *_vl, void { char *t=NULL; /* Pointer to temporary buffer allocated */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_vlen_str_mem_setnull) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Set pointer in user's buffer with memcpy, to avoid alignment issues */ HDmemcpy(_vl,&t,sizeof(char *)); @@ -781,7 +781,7 @@ H5T_vlen_disk_getlen(const void *_vl) const uint8_t *vl=(const uint8_t *)_vl; /* Pointer to the disk VL information */ size_t seq_len; /* Sequence length */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_vlen_disk_getlen) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check parameters */ HDassert(vl); @@ -808,7 +808,7 @@ H5T_vlen_disk_getlen(const void *_vl) static void * H5T_vlen_disk_getptr(void UNUSED *vl) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_vlen_disk_getptr) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check parameters */ HDassert(vl); @@ -835,7 +835,7 @@ H5T_vlen_disk_isnull(const H5F_t *f, void *_vl) uint8_t *vl=(uint8_t *)_vl; /* Pointer to the disk VL information */ haddr_t addr; /* Sequence's heap address */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_vlen_disk_isnull) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check parameters */ HDassert(vl); @@ -870,7 +870,7 @@ H5T_vlen_disk_read(H5F_t *f, hid_t dxpl_id, void *_vl, void *buf, size_t UNUSED H5HG_t hobjid; herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5T_vlen_disk_read) + FUNC_ENTER_NOAPI_NOINIT /* check parameters */ HDassert(vl); @@ -919,7 +919,7 @@ H5T_vlen_disk_write(H5F_t *f, hid_t dxpl_id, const H5T_vlen_alloc_info_t UNUSED size_t len; /* Size of new sequence on disk (in bytes) */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5T_vlen_disk_write) + FUNC_ENTER_NOAPI_NOINIT /* check parameters */ HDassert(vl); @@ -982,7 +982,7 @@ H5T_vlen_disk_setnull(H5F_t *f, hid_t dxpl_id, void *_vl, void *_bg) uint32_t seq_len = 0; /* Sequence length */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5T_vlen_disk_setnull) + FUNC_ENTER_NOAPI_NOINIT /* check parameters */ HDassert(f); @@ -1046,7 +1046,7 @@ H5T_vlen_reclaim_recurse(void *elem, const H5T_t *dt, H5MM_free_t free_func, voi unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5T_vlen_reclaim_recurse) + FUNC_ENTER_NOAPI_NOINIT HDassert(elem); HDassert(dt); @@ -1160,7 +1160,7 @@ H5T_vlen_reclaim(void *elem, hid_t type_id, unsigned UNUSED ndim, const hsize_t H5T_t *dt; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5T_vlen_reclaim, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert(elem); HDassert(vl_alloc_info); @@ -1208,7 +1208,7 @@ H5T_vlen_get_alloc_info(hid_t dxpl_id, H5T_vlen_alloc_info_t **vl_alloc_info) H5P_genplist_t *plist; /* DX property list */ herr_t ret_value=SUCCEED; - FUNC_ENTER_NOAPI(H5T_vlen_get_alloc_info, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert(H5I_GENPROP_LST == H5I_get_type(dxpl_id)); HDassert(vl_alloc_info); @@ -1263,7 +1263,7 @@ H5T_vlen_reclaim_elmt(void *elem, H5T_t *dt, hid_t dxpl_id) HDassert(dt); HDassert(elem); - FUNC_ENTER_NOAPI(H5T_vlen_reclaim_elmt, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Get VL allocation info */ if(H5T_vlen_get_alloc_info(dxpl_id, &vl_alloc_info) < 0) diff --git a/src/H5V.c b/src/H5V.c index 515a2c5..fe38978 100644 --- a/src/H5V.c +++ b/src/H5V.c @@ -72,7 +72,7 @@ static void H5V_stride_optimize1(unsigned *np/*in,out*/, hsize_t *elmt_size/*in,out*/, const hsize_t *size, hsize_t *stride1) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5V_stride_optimize1); + FUNC_ENTER_NOAPI_NOINIT_NOERR /* * This has to be true because if we optimize the dimensionality down to @@ -121,7 +121,7 @@ static void H5V_stride_optimize2(unsigned *np/*in,out*/, hsize_t *elmt_size/*in,out*/, const hsize_t *size, hsize_t *stride1, hsize_t *stride2) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5V_stride_optimize2) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* * This has to be true because if we optimize the dimensionality down to @@ -265,7 +265,7 @@ H5V_hyper_stride(unsigned n, const hsize_t *size, int i; /*counter */ hsize_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOFUNC(H5V_hyper_stride) + FUNC_ENTER_NOAPI_NOINIT_NOERR assert(n <= H5V_HYPER_NDIMS); assert(size); @@ -364,8 +364,8 @@ H5V_hyper_eq(unsigned n, unsigned i; htri_t ret_value=TRUE; /* Return value */ - /* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5V_hyper_eq) + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR if (n == 0) HGOTO_DONE(TRUE) @@ -411,8 +411,8 @@ H5V_hyper_disjointp(unsigned n, unsigned u; htri_t ret_value = FALSE; /* Return value */ - /* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5V_hyper_disjointp) + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR if(!n || !size1 || !size2) HGOTO_DONE(TRUE) @@ -471,7 +471,7 @@ H5V_hyper_fill(unsigned n, const hsize_t *_size, unsigned u; #endif - FUNC_ENTER_NOAPI_NOFUNC(H5V_hyper_fill) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ assert(n > 0 && n <= H5V_HYPER_NDIMS); @@ -557,7 +557,7 @@ H5V_hyper_copy(unsigned n, const hsize_t *_size, unsigned u; #endif - FUNC_ENTER_NOAPI_NOFUNC(H5V_hyper_copy) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ assert(n > 0 && n <= H5V_HYPER_NDIMS); @@ -711,7 +711,8 @@ H5V_stride_fill(unsigned n, hsize_t elmt_size, const hsize_t *size, int j; /*counter */ hbool_t carry; /*subtraction carray value */ - FUNC_ENTER_NOAPI_NOFUNC(H5V_stride_fill) + FUNC_ENTER_NOAPI_NOINIT_NOERR + assert (elmt_size < SIZET_MAX); H5V_vector_cpy(n, idx, size); @@ -772,7 +773,8 @@ H5V_stride_copy(unsigned n, hsize_t elmt_size, const hsize_t *size, int j; /*counters */ hbool_t carry; /*carray for subtraction*/ - FUNC_ENTER_NOAPI_NOFUNC(H5V_stride_copy) + FUNC_ENTER_NOAPI_NOINIT_NOERR + assert (elmt_size0); @@ -978,7 +981,7 @@ H5V_array_fill(void *_dst, const void *src, size_t size, size_t count) size_t items_left; /* number of items left to copy */ uint8_t *dst=(uint8_t*)_dst;/* alias for pointer arithmetic */ - FUNC_ENTER_NOAPI_NOFUNC(H5V_array_fill) + FUNC_ENTER_NOAPI_NOINIT_NOERR assert (dst); assert (src); @@ -1033,7 +1036,7 @@ H5V_array_down(unsigned n, const hsize_t *total_size, hsize_t *down) hsize_t acc; /*accumulator */ int i; /*counter */ - FUNC_ENTER_NOAPI_NOFUNC(H5V_array_down) + FUNC_ENTER_NOAPI_NOINIT_NOERR assert(n <= H5V_HYPER_NDIMS); assert(total_size); @@ -1079,7 +1082,7 @@ H5V_array_offset_pre(unsigned n, const hsize_t *acc, const hsize_t *offset) int i; /*counter */ hsize_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOFUNC(H5V_array_offset_pre) + FUNC_ENTER_NOAPI_NOINIT_NOERR assert(n <= H5V_HYPER_NDIMS); assert(acc); @@ -1119,7 +1122,7 @@ H5V_array_offset(unsigned n, const hsize_t *total_size, const hsize_t *offset) hsize_t acc_arr[H5V_HYPER_NDIMS]; /* Accumulated size of down dimensions */ hsize_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5V_array_offset, (HDabort(), 0)) /*lint !e527 Don't worry about unreachable statement */ + FUNC_ENTER_NOAPI((HDabort(), 0)) /*lint !e527 Don't worry about unreachable statement */ assert(n <= H5V_HYPER_NDIMS); assert(total_size); @@ -1161,7 +1164,7 @@ H5V_array_calc_pre(hsize_t offset, unsigned n, const hsize_t *down, { unsigned u; /* Local index variable */ - FUNC_ENTER_NOAPI_NOFUNC(H5V_array_calc_pre) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ HDassert(n <= H5V_HYPER_NDIMS); @@ -1203,7 +1206,7 @@ H5V_array_calc(hsize_t offset, unsigned n, const hsize_t *total_size, hsize_t *c hsize_t idx[H5V_HYPER_NDIMS]; /* Size of each dimension in bytes */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5V_array_calc, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ HDassert(n <= H5V_HYPER_NDIMS); @@ -1272,7 +1275,7 @@ H5V_chunk_index(unsigned ndims, const hsize_t *coord, const uint32_t *chunk, hsize_t scaled_coord[H5V_HYPER_NDIMS]; /* Scaled, coordinates, in terms of chunks */ unsigned u; /* Local index variable */ - FUNC_ENTER_NOAPI_NOFUNC(H5V_chunk_index) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ assert(ndims <= H5V_HYPER_NDIMS); @@ -1308,7 +1311,7 @@ H5V_chunk_index(unsigned ndims, const hsize_t *coord, const uint32_t *chunk, void H5V_swizzle_coords(hsize_t *coords, unsigned unlim_dim) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5V_swizzle_coords) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ HDassert(coords); @@ -1343,7 +1346,7 @@ H5V_swizzle_coords(hsize_t *coords, unsigned unlim_dim) void H5V_unswizzle_coords(hsize_t *coords, unsigned unlim_dim) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5V_unswizzle_coords) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ HDassert(coords); @@ -1397,7 +1400,7 @@ H5V_opvv(size_t dst_max_nseq, size_t *dst_curr_seq, size_t dst_len_arr[], size_t acc_len; /* Accumulated length of sequences */ ssize_t ret_value = 0; /* Return value (Total size of sequence in bytes) */ - FUNC_ENTER_NOAPI(H5V_opvv, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ HDassert(dst_curr_seq); @@ -1605,7 +1608,7 @@ H5V_memcpyvv(void *_dst, size_t acc_len; /* Accumulated length of sequences */ ssize_t ret_value = 0; /* Return value (Total size of sequence in bytes) */ - FUNC_ENTER_NOAPI_NOFUNC(H5V_memcpyvv) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ HDassert(_dst); diff --git a/src/H5Vprivate.h b/src/H5Vprivate.h index 18630d6..89e1938 100644 --- a/src/H5Vprivate.h +++ b/src/H5Vprivate.h @@ -130,8 +130,8 @@ H5V_vector_reduce_product(unsigned n, const hsize_t *v) { hsize_t ret_value = 1; - /* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5V_vector_reduce_product) + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR if (n && !v) HGOTO_DONE(0) while (n--) ret_value *= *v++; @@ -162,8 +162,8 @@ H5V_vector_zerop_u(int n, const hsize_t *v) { htri_t ret_value=TRUE; /* Return value */ - /* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5V_vector_zerop_u) + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR if (!v) HGOTO_DONE(TRUE) @@ -197,8 +197,8 @@ H5V_vector_zerop_s(int n, const hssize_t *v) { htri_t ret_value=TRUE; /* Return value */ - /* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5V_vector_zerop_s) + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR if (!v) HGOTO_DONE(TRUE) @@ -234,8 +234,8 @@ H5V_vector_cmp_u (unsigned n, const hsize_t *v1, const hsize_t *v2) { int ret_value=0; /* Return value */ - /* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5V_vector_cmp_u) + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR if (v1 == v2) HGOTO_DONE(0) if (v1 == NULL) HGOTO_DONE(-1) @@ -276,8 +276,8 @@ H5V_vector_cmp_s (unsigned n, const hssize_t *v1, const hssize_t *v2) { int ret_value=0; /* Return value */ - /* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5V_vector_cmp_s) + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR if (v1 == v2) HGOTO_DONE(0) if (v1 == NULL) HGOTO_DONE(-1) diff --git a/src/H5WB.c b/src/H5WB.c index f624abc..978ded4 100644 --- a/src/H5WB.c +++ b/src/H5WB.c @@ -110,7 +110,7 @@ H5WB_wrap(void *buf, size_t buf_size) H5WB_t *wb = NULL; /* Wrapped buffer info */ H5WB_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5WB_wrap, NULL) + FUNC_ENTER_NOAPI(NULL) /* * Check arguments. @@ -163,7 +163,7 @@ H5WB_actual(H5WB_t *wb, size_t need) { void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5WB_actual, NULL) + FUNC_ENTER_NOAPI(NULL) /* * Check arguments. @@ -231,7 +231,7 @@ H5WB_actual_clear(H5WB_t *wb, size_t need) { void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5WB_actual_clear, NULL) + FUNC_ENTER_NOAPI(NULL) /* * Check arguments. @@ -267,7 +267,7 @@ done: herr_t H5WB_unwrap(H5WB_t *wb) { - FUNC_ENTER_NOAPI_NOFUNC(H5WB_unwrap) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* * Check arguments. diff --git a/src/H5Z.c b/src/H5Z.c index b22863e..3bb3a44 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -81,7 +81,7 @@ H5Z_init_interface (void) { herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5Z_init_interface) + FUNC_ENTER_NOAPI_NOINIT #ifdef H5_HAVE_FILTER_DEFLATE if (H5Z_register (H5Z_DEFLATE)<0) @@ -97,8 +97,6 @@ H5Z_init_interface (void) #endif /* H5_HAVE_FILTER_FLETCHER32 */ #ifdef H5_HAVE_FILTER_SZIP H5Z_SZIP->encoder_present = SZ_encoder_enabled(); - if (H5Z_SZIP->encoder_present < 0) - HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "szip filter reports bad status") if (H5Z_register (H5Z_SZIP)<0) HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register szip filter") #endif /* H5_HAVE_FILTER_SZIP */ @@ -226,7 +224,7 @@ H5Zregister(const void *cls) H5Z_class2_t cls_new; /* Translated class struct */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Zregister, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("e", "*x", cls); /* Check args */ @@ -304,7 +302,7 @@ H5Z_register (const H5Z_class2_t *cls) size_t i; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5Z_register, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert(cls); HDassert(cls->id >= 0 && cls->id <= H5Z_FILTER_MAX); @@ -370,7 +368,7 @@ H5Zunregister(H5Z_filter_t id) { herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Zunregister, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("e", "Zf", id); /* Check args */ @@ -409,7 +407,7 @@ H5Z_unregister (H5Z_filter_t id) size_t i; /* Local index variable */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5Z_unregister,FAIL) + FUNC_ENTER_NOAPI(FAIL) assert (id>=0 && id<=H5Z_FILTER_MAX); @@ -455,7 +453,7 @@ H5Zfilter_avail(H5Z_filter_t id) size_t i; /* Local index variable */ htri_t ret_value=FALSE; /* Return value */ - FUNC_ENTER_API(H5Zfilter_avail, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE1("t", "Zf", id); /* Check args */ @@ -500,7 +498,7 @@ H5Z_prelude_callback(const H5O_pline_t *pline, hid_t dcpl_id, hid_t type_id, size_t u; /* Local index variable */ htri_t ret_value = TRUE; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5Z_prelude_callback) + FUNC_ENTER_NOAPI_NOINIT HDassert(pline->nused > 0); @@ -585,7 +583,7 @@ H5Z_prepare_prelude_callback_dcpl(hid_t dcpl_id, hid_t type_id, H5Z_prelude_type hid_t space_id = -1; /* ID for dataspace describing chunk */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5Z_prepare_prelude_callback_dcpl) + FUNC_ENTER_NOAPI_NOINIT HDassert(H5I_GENPROP_LST == H5I_get_type(dcpl_id)); HDassert(H5I_DATATYPE == H5I_get_type(type_id)); @@ -668,7 +666,7 @@ H5Z_can_apply(hid_t dcpl_id, hid_t type_id) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5Z_can_apply, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Make "can apply" callbacks for filters in pipeline */ if(H5Z_prepare_prelude_callback_dcpl(dcpl_id, type_id, H5Z_PRELUDE_CAN_APPLY) < 0) @@ -703,7 +701,7 @@ H5Z_set_local(hid_t dcpl_id, hid_t type_id) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5Z_set_local, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Make "set local" callbacks for filters in pipeline */ if(H5Z_prepare_prelude_callback_dcpl(dcpl_id, type_id, H5Z_PRELUDE_SET_LOCAL) < 0) @@ -733,7 +731,7 @@ H5Z_can_apply_direct(const H5O_pline_t *pline) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5Z_can_apply_direct, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert(pline->nused > 0); @@ -770,7 +768,7 @@ H5Z_set_local_direct(const H5O_pline_t *pline) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5Z_set_local_direct, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert(pline->nused > 0); @@ -804,7 +802,7 @@ H5Z_modify(const H5O_pline_t *pline, H5Z_filter_t filter, unsigned flags, size_t idx; /* Index of filter in pipeline */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5Z_modify, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert(pline); HDassert(filter >= 0 && filter <= H5Z_FILTER_MAX); @@ -874,7 +872,7 @@ H5Z_append(H5O_pline_t *pline, H5Z_filter_t filter, unsigned flags, size_t idx; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5Z_append, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert(pline); HDassert(filter >= 0 && filter <= H5Z_FILTER_MAX); @@ -979,7 +977,7 @@ H5Z_find_idx(H5Z_filter_t id) size_t i; /* Local index variable */ int ret_value=FAIL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5Z_find_idx) + FUNC_ENTER_NOAPI_NOINIT_NOERR for (i=0; ifilter[idx].id))<0) { - HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "required filter is not registered") + /* Print out the filter name to give more info. But the name is optional for + * the filter */ + if(pline->filter[idx].name) + HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "required filter '%s' is not registered", + pline->filter[idx].name) + else + HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "required filter (name unavailable) is not registered") + } fclass=&H5Z_table_g[fclass_idx]; #ifdef H5Z_DEBUG @@ -1192,7 +1197,7 @@ H5Z_filter_info(const H5O_pline_t *pline, H5Z_filter_t filter) size_t idx; /* Index of filter in pipeline */ H5Z_filter_info_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5Z_filter_info, NULL) + FUNC_ENTER_NOAPI(NULL) assert(pline); assert(filter>=0 && filter<=H5Z_FILTER_MAX); @@ -1235,7 +1240,7 @@ H5Z_all_filters_avail(const H5O_pline_t *pline) size_t i,j; /* Local index variable */ htri_t ret_value=TRUE; /* Return value */ - FUNC_ENTER_NOAPI(H5Z_all_filters_avail, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args */ assert(pline); @@ -1279,7 +1284,7 @@ H5Z_delete(H5O_pline_t *pline, H5Z_filter_t filter) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5Z_delete, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Check args */ HDassert(pline); @@ -1363,7 +1368,7 @@ H5Zget_filter_info(H5Z_filter_t filter, unsigned int *filter_config_flags) H5Z_class2_t *fclass; herr_t ret_value = SUCCEED; - FUNC_ENTER_API(H5Zget_filter_info, FAIL) + FUNC_ENTER_API(FAIL) H5TRACE2("e", "Zf*Iu", filter, filter_config_flags); /* Look up the filter class info */ diff --git a/src/H5Zdeflate.c b/src/H5Zdeflate.c index 598aa97..f318c2f 100644 --- a/src/H5Zdeflate.c +++ b/src/H5Zdeflate.c @@ -79,7 +79,7 @@ H5Z_filter_deflate (unsigned flags, size_t cd_nelmts, int status; /* Status from zlib operation */ size_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5Z_filter_deflate, 0) + FUNC_ENTER_NOAPI(0) /* Sanity check */ HDassert(*buf_size > 0); diff --git a/src/H5Zfletcher32.c b/src/H5Zfletcher32.c index e3a77bd..d2ad965 100644 --- a/src/H5Zfletcher32.c +++ b/src/H5Zfletcher32.c @@ -85,7 +85,7 @@ H5Z_filter_fletcher32 (unsigned flags, size_t UNUSED cd_nelmts, const unsigned U uint8_t tmp; size_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5Z_filter_fletcher32, 0) + FUNC_ENTER_NOAPI(0) assert(sizeof(uint32_t)>=4); diff --git a/src/H5Znbit.c b/src/H5Znbit.c index 263b2cd..134ef3a 100644 --- a/src/H5Znbit.c +++ b/src/H5Znbit.c @@ -135,7 +135,7 @@ H5Z_can_apply_nbit(hid_t UNUSED dcpl_id, hid_t type_id, hid_t UNUSED space_id) const H5T_t *type; /* Datatype */ htri_t ret_value = TRUE; /* Return value */ - FUNC_ENTER_NOAPI(H5Z_can_apply_nbit, FAIL) + FUNC_ENTER_NOAPI_NOINIT /* Get datatype */ if(NULL == (type = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) @@ -235,7 +235,7 @@ H5Z_calc_parms_array(const H5T_t *type) H5T_class_t dtype_base_class; /* Array datatype's base datatype's class */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5Z_calc_parms_array, FAIL) + FUNC_ENTER_NOAPI_NOINIT /* Store datatype class code */ ++cd_values_actual_nparms; @@ -308,7 +308,7 @@ H5Z_calc_parms_compound(const H5T_t *type) unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5Z_calc_parms_compound, FAIL) + FUNC_ENTER_NOAPI_NOINIT /* Store compound datatype class code */ ++cd_values_actual_nparms; @@ -397,7 +397,7 @@ H5Z_set_parms_nooptype(const H5T_t *type, unsigned cd_values[]) size_t dtype_size; /* No-op datatype's size (in bytes) */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5Z_set_parms_nooptype, FAIL) + FUNC_ENTER_NOAPI_NOINIT /* Set datatype class code */ cd_values[cd_values_index++] = H5Z_NBIT_NOOPTYPE; @@ -439,7 +439,7 @@ H5Z_set_parms_atomic(const H5T_t *type, unsigned cd_values[]) int dtype_offset; /* Atomic datatype's offset (in bits) */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5Z_set_parms_atomic) + FUNC_ENTER_NOAPI_NOINIT /* Set datatype class code */ cd_values[cd_values_index++] = H5Z_NBIT_ATOMIC; @@ -525,7 +525,7 @@ H5Z_set_parms_array(const H5T_t *type, unsigned cd_values[]) htri_t is_vlstring; /* flag indicating if datatype is varible-length string */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5Z_set_parms_array, FAIL) + FUNC_ENTER_NOAPI_NOINIT /* Set datatype class code */ cd_values[cd_values_index++] = H5Z_NBIT_ARRAY; @@ -615,7 +615,7 @@ H5Z_set_parms_compound(const H5T_t *type, unsigned cd_values[]) unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5Z_set_parms_compound, FAIL) + FUNC_ENTER_NOAPI_NOINIT /* Set "local" parameter for compound datatype class code */ cd_values[cd_values_index++] = H5Z_NBIT_COMPOUND; @@ -739,7 +739,7 @@ H5Z_set_local_nbit(hid_t dcpl_id, hid_t type_id, hid_t space_id) H5T_class_t dtype_class; /* Datatype's class */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5Z_set_local_nbit, FAIL) + FUNC_ENTER_NOAPI_NOINIT /* Get datatype */ if(NULL == (type = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) @@ -873,7 +873,7 @@ H5Z_filter_nbit(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], unsigned d_nelmts = 0; /* number of elements in the chunk */ size_t ret_value = 0; /* return value */ - FUNC_ENTER_NOAPI(H5Z_filter_nbit, 0) + FUNC_ENTER_NOAPI_NOINIT /* check arguments * cd_values[0] stores actual number of parameters in cd_values[] diff --git a/src/H5Zpkg.h b/src/H5Zpkg.h index 959ec28..b0df856 100644 --- a/src/H5Zpkg.h +++ b/src/H5Zpkg.h @@ -66,8 +66,5 @@ H5_DLLVAR H5Z_class2_t H5Z_NBIT[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_class2_t * old_vers, H5Z_class2_t * curr_vers); - #endif /* _H5Zpkg_H */ diff --git a/src/H5Zscaleoffset.c b/src/H5Zscaleoffset.c index c524141..e6ae53e 100644 --- a/src/H5Zscaleoffset.c +++ b/src/H5Zscaleoffset.c @@ -698,7 +698,7 @@ H5Z_can_apply_scaleoffset(hid_t UNUSED dcpl_id, hid_t type_id, hid_t UNUSED spac H5T_order_t dtype_order; /* Datatype's endianness order */ htri_t ret_value = TRUE; /* Return value */ - FUNC_ENTER_NOAPI(H5Z_can_apply_scaleoffset, FAIL) + FUNC_ENTER_NOAPI_NOINIT /* Get datatype */ if(NULL == (type = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) @@ -750,7 +750,7 @@ H5Z_scaleoffset_get_type(unsigned dtype_class, unsigned dtype_size, unsigned dty enum H5Z_scaleoffset_t type = t_bad; /* integer type */ enum H5Z_scaleoffset_t ret_value; /* return value */ - FUNC_ENTER_NOAPI_NOINIT(H5Z_scaleoffset_get_type) + FUNC_ENTER_NOAPI_NOINIT if(dtype_class==H5Z_SCALEOFFSET_CLS_INTEGER) { if(dtype_sign==H5Z_SCALEOFFSET_SGN_NONE) { /* unsigned integer */ @@ -809,7 +809,7 @@ H5Z_scaleoffset_set_parms_fillval(H5P_genplist_t *dcpl_plist, { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5Z_scaleoffset_set_parms_fillval, FAIL) + FUNC_ENTER_NOAPI_NOINIT if(scale_type == t_uchar) H5Z_scaleoffset_set_filval_3(unsigned char, dcpl_plist, type, cd_values, need_convert, dxpl_id) @@ -875,7 +875,7 @@ H5Z_set_local_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id) H5D_fill_value_t status; /* Status of fill value in property list */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5Z_set_local_scaleoffset, FAIL) + FUNC_ENTER_NOAPI_NOINIT /* Get the plist structure */ if(NULL == (dcpl_plist = H5P_object_verify(dcpl_id, H5P_DATASET_CREATE))) @@ -1057,7 +1057,7 @@ H5Z_filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_value unsigned i; /* index */ parms_atomic p; /* paramters needed for compress/decompress functions */ - FUNC_ENTER_NOAPI(H5Z_filter_scaleoffset, 0) + FUNC_ENTER_NOAPI_NOINIT /* check arguments */ if(cd_nelmts != H5Z_SCALEOFFSET_TOTAL_NPARMS) @@ -1513,7 +1513,7 @@ H5Z_scaleoffset_precompress_fd(void *data, unsigned d_nelmts, enum H5Z_scaleoffs { herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5Z_scaleoffset_precompress_fd, FAIL) + FUNC_ENTER_NOAPI_NOINIT if(type == t_float) H5Z_scaleoffset_precompress_3(float, data, d_nelmts, @@ -1536,7 +1536,7 @@ H5Z_scaleoffset_postdecompress_fd(void *data, unsigned d_nelmts, enum H5Z_scaleo long long sminval = (long long)minval; /* for signed integer types */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5Z_scaleoffset_postdecompress_fd, FAIL) + FUNC_ENTER_NOAPI_NOINIT if(type == t_float) H5Z_scaleoffset_postdecompress_3(float, data, d_nelmts, filavail, diff --git a/src/H5Zshuffle.c b/src/H5Zshuffle.c index 2e4f1fa..7aa0202 100644 --- a/src/H5Zshuffle.c +++ b/src/H5Zshuffle.c @@ -74,7 +74,7 @@ H5Z_set_local_shuffle(hid_t dcpl_id, hid_t type_id, hid_t UNUSED space_id) unsigned cd_values[H5Z_SHUFFLE_TOTAL_NPARMS]; /* Filter parameters */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5Z_set_local_shuffle, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Get the plist structure */ if(NULL == (dcpl_plist = H5P_object_verify(dcpl_id, H5P_DATASET_CREATE))) @@ -139,7 +139,7 @@ H5Z_filter_shuffle(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t leftover; /* Extra bytes at end of buffer */ size_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5Z_filter_shuffle, 0) + FUNC_ENTER_NOAPI(0) /* Check arguments */ if (cd_nelmts!=H5Z_SHUFFLE_TOTAL_NPARMS || cd_values[H5Z_SHUFFLE_PARM_SIZE]==0) diff --git a/src/H5Zszip.c b/src/H5Zszip.c index 52f5e11..fd3d90c 100644 --- a/src/H5Zszip.c +++ b/src/H5Zszip.c @@ -84,7 +84,7 @@ H5Z_can_apply_szip(hid_t UNUSED dcpl_id, hid_t type_id, hid_t UNUSED space_id) H5T_order_t dtype_order; /* Datatype's endianness order */ htri_t ret_value = TRUE; /* Return value */ - FUNC_ENTER_NOAPI(H5Z_can_apply_szip, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Get datatype */ if(NULL == (type = H5I_object_verify(type_id, H5I_DATATYPE))) @@ -151,7 +151,7 @@ H5Z_set_local_szip(hid_t dcpl_id, hid_t type_id, hid_t space_id) hsize_t scanline; /* Size of dataspace's fastest changing dimension */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5Z_set_local_szip, FAIL) + FUNC_ENTER_NOAPI(FAIL) /* Get the plist structure */ if(NULL == (dcpl_plist = H5P_object_verify(dcpl_id, H5P_DATASET_CREATE))) @@ -284,7 +284,7 @@ H5Z_filter_szip (unsigned flags, size_t cd_nelmts, const unsigned cd_values[], unsigned char *newbuf = NULL; /* Pointer to input buffer */ SZ_com_t sz_param; /* szip parameter block */ - FUNC_ENTER_NOAPI(H5Z_filter_szip, 0) + FUNC_ENTER_NOAPI(0) /* Sanity check to make certain that we haven't drifted out of date with * the mask options from the szlib.h header */ diff --git a/src/H5Ztrans.c b/src/H5Ztrans.c index 8028123..2a2796d 100644 --- a/src/H5Ztrans.c +++ b/src/H5Ztrans.c @@ -94,6 +94,8 @@ static H5Z_node *H5Z_parse_term(H5Z_token *current, H5Z_datval_ptrs* dat_val_poi static H5Z_node *H5Z_parse_factor(H5Z_token *current, H5Z_datval_ptrs* dat_val_pointers); static H5Z_node *H5Z_new_node(H5Z_token_type type); static void H5Z_do_op(H5Z_node* tree); +static hbool_t H5Z_op_is_numbs(H5Z_node* _tree); +static hbool_t H5Z_op_is_numbs2(H5Z_node* _tree); static hid_t H5Z_xform_find_type(const H5T_t* type); static herr_t H5Z_xform_eval_full(H5Z_node *tree, const size_t array_size, const hid_t array_type, H5Z_result* res); static void H5Z_xform_destroy_parse_tree(H5Z_node *tree); @@ -105,41 +107,46 @@ static void H5Z_XFORM_DEBUG(H5Z_node *tree); static void H5Z_print(H5Z_node *tree, FILE *stream); #endif /* H5Z_XFORM_DEBUG */ - #define H5Z_XFORM_DO_OP1(RESL,RESR,TYPE,OP,SIZE) \ { \ - if( (((RESL).type == H5Z_XFORM_SYMBOL) && ((RESR).type != H5Z_XFORM_SYMBOL)) || (((RESR).type == H5Z_XFORM_SYMBOL) && ((RESL).type != H5Z_XFORM_SYMBOL))) \ + size_t u; \ + \ + if(((RESL).type == H5Z_XFORM_SYMBOL) && ((RESR).type != H5Z_XFORM_SYMBOL)) \ + { \ + TYPE* p; \ + double tree_val; \ + \ + tree_val = ((RESR).type==H5Z_XFORM_INTEGER ? (double)(RESR).value.int_val : (RESR).value.float_val); \ + p = (TYPE*)(RESL).value.dat_val; \ + \ + for(u=0; u<(SIZE); u++) \ + *p++ = *p OP tree_val; \ + } \ + else if(((RESR).type == H5Z_XFORM_SYMBOL) && ((RESL).type != H5Z_XFORM_SYMBOL)) \ { \ - size_t u; \ TYPE* p; \ double tree_val; \ \ - if((RESL).type == H5Z_XFORM_SYMBOL) \ - { \ - tree_val = ((RESR).type==H5Z_XFORM_INTEGER ? (double)(RESR).value.int_val : (RESR).value.float_val); \ - p = (TYPE*)(RESL).value.dat_val; \ - } \ + /* The case that the left operand is nothing, like -x or +x */ \ + if((RESL).type == H5Z_XFORM_ERROR) \ + tree_val = 0; \ else \ - { \ tree_val = ((RESL).type==H5Z_XFORM_INTEGER ? (double)(RESL).value.int_val : (RESL).value.float_val); \ - p = (TYPE*)(RESR).value.dat_val; \ - } \ - \ + \ + p = (TYPE*)(RESR).value.dat_val; \ for(u=0; u<(SIZE); u++) \ - *p++ OP tree_val; \ - } \ + *p++ = tree_val OP *p; \ + } \ else if( ((RESL).type == H5Z_XFORM_SYMBOL) && ((RESR).type==H5Z_XFORM_SYMBOL)) \ { \ - size_t u; \ TYPE* pl = (TYPE*)(RESL).value.dat_val; \ TYPE* pr = (TYPE*)(RESR).value.dat_val; \ \ for(u=0; u<(SIZE); u++) \ - *pl++ OP *pr++; \ + *pl++ = *pl OP *pr++; \ } \ else \ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Unexpected type conversion operation") \ - \ } /* Due to the undefined nature of embedding macros/conditionals within macros, we employ @@ -235,6 +242,7 @@ static void H5Z_print(H5Z_node *tree, FILE *stream); } #endif /*H5_SIZEOF_LONG_DOUBLE */ + #define H5Z_XFORM_DO_OP3(OP) \ { \ if((tree->lchild->type == H5Z_XFORM_INTEGER) && (tree->rchild->type==H5Z_XFORM_INTEGER)) \ @@ -259,6 +267,48 @@ static void H5Z_print(H5Z_node *tree, FILE *stream); } \ } +/* The difference of this macro from H5Z_XFORM_DO_OP3 is that it handles the operations when the left operand is empty, like -x or +x. + * The reason that it's seperated from H5Z_XFORM_DO_OP3 is because compilers don't accept operations like *x or /x. So in H5Z_do_op, + * these two macros are called in different ways. + */ +#define H5Z_XFORM_DO_OP6(OP) \ +{ \ + if(!tree->lchild && (tree->rchild->type==H5Z_XFORM_INTEGER)) \ + { \ + tree->type = H5Z_XFORM_INTEGER; \ + tree->value.int_val = OP tree->rchild->value.int_val; \ + H5MM_xfree(tree->rchild); \ + tree->rchild = NULL; \ + } \ + else if(!tree->lchild && (tree->rchild->type==H5Z_XFORM_FLOAT)) \ + { \ + tree->type = H5Z_XFORM_FLOAT; \ + tree->value.float_val = OP tree->rchild->value.float_val; \ + H5MM_xfree(tree->rchild); \ + tree->rchild = NULL; \ + } \ + else if((tree->lchild->type == H5Z_XFORM_INTEGER) && (tree->rchild->type==H5Z_XFORM_INTEGER)) \ + { \ + tree->type = H5Z_XFORM_INTEGER; \ + tree->value.int_val = tree->lchild->value.int_val OP tree->rchild->value.int_val; \ + H5MM_xfree(tree->lchild); \ + H5MM_xfree(tree->rchild); \ + tree->lchild = NULL; \ + tree->rchild = NULL; \ + } \ + else if( ( (tree->lchild->type == H5Z_XFORM_FLOAT) || (tree->lchild->type == H5Z_XFORM_INTEGER)) && \ + ( (tree->rchild->type == H5Z_XFORM_FLOAT) || (tree->rchild->type == H5Z_XFORM_INTEGER))) \ + { \ + tree->type = H5Z_XFORM_FLOAT; \ + tree->value.float_val = ((tree->lchild->type == H5Z_XFORM_FLOAT) ? tree->lchild->value.float_val : (double)tree->lchild->value.int_val) OP \ + ((tree->rchild->type == H5Z_XFORM_FLOAT) ? tree->rchild->value.float_val : (double)tree->rchild->value.int_val); \ + H5MM_xfree(tree->lchild); \ + H5MM_xfree(tree->rchild); \ + tree->lchild = NULL; \ + tree->rchild = NULL; \ + } \ +} + #define H5Z_XFORM_DO_OP4(TYPE) \ { \ if ((ret_value = (H5Z_node*) H5MM_malloc(sizeof(H5Z_node))) == NULL) \ @@ -317,19 +367,16 @@ static void H5Z_print(H5Z_node *tree, FILE *stream); static void H5Z_unget_token(H5Z_token *current) { + FUNC_ENTER_NOAPI_NOINIT_NOERR + /* check args */ assert(current); - - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5Z_unget_token) - current->tok_type = current->tok_last_type; current->tok_begin = current->tok_last_begin; current->tok_end = current->tok_last_end; FUNC_LEAVE_NOAPI_VOID - - } @@ -356,7 +403,7 @@ H5Z_get_token(H5Z_token *current) { H5Z_token *ret_value = current; - FUNC_ENTER_NOAPI(H5Z_get_token, NULL) + FUNC_ENTER_NOAPI_NOINIT /* check args */ assert(current); @@ -485,7 +532,7 @@ done: void H5Z_xform_destroy_parse_tree(H5Z_node *tree) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5Z_xform_destroy_parse_tree) + FUNC_ENTER_NOAPI_NOINIT_NOERR if (tree) { @@ -518,7 +565,7 @@ H5Z_xform_parse(const char *expression, H5Z_datval_ptrs* dat_val_pointers) H5Z_token tok; void* ret_value; - FUNC_ENTER_NOAPI(H5Z_xform_parse, NULL) + FUNC_ENTER_NOAPI(NULL) if(!expression) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "No expression provided?") @@ -557,7 +604,7 @@ H5Z_parse_expression(H5Z_token *current, H5Z_datval_ptrs* dat_val_pointers) H5Z_node *expr; H5Z_node *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5Z_parse_expression) + FUNC_ENTER_NOAPI_NOINIT expr = H5Z_parse_term(current, dat_val_pointers); @@ -651,7 +698,8 @@ H5Z_parse_term(H5Z_token *current, H5Z_datval_ptrs* dat_val_pointers) H5Z_node *term = NULL; H5Z_node *ret_value; - FUNC_ENTER_NOAPI(H5Z_parse_term, NULL); + FUNC_ENTER_NOAPI_NOINIT + term = H5Z_parse_factor(current, dat_val_pointers); for (;;) { @@ -741,7 +789,7 @@ H5Z_parse_factor(H5Z_token *current, H5Z_datval_ptrs* dat_val_pointers) H5Z_node *new_node; H5Z_node *ret_value; - FUNC_ENTER_NOAPI(H5Z_parse_factor, NULL); + FUNC_ENTER_NOAPI_NOINIT current = H5Z_get_token(current); @@ -880,7 +928,7 @@ H5Z_new_node(H5Z_token_type type) { H5Z_node *ret_value; - FUNC_ENTER_NOAPI(H5Z_new_node, NULL) + FUNC_ENTER_NOAPI_NOINIT if(NULL == (ret_value = (H5Z_node *)H5MM_calloc(sizeof(H5Z_node)))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "Ran out of memory trying to allocate space for nodes in the parse tree") @@ -913,7 +961,7 @@ H5Z_xform_eval(H5Z_data_xform_t *data_xform_prop, void* array, size_t array_size size_t i; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5Z_xform_eval, FAIL) + FUNC_ENTER_NOAPI(FAIL) HDassert(data_xform_prop); @@ -1024,11 +1072,14 @@ H5Z_xform_eval_full(H5Z_node *tree, const size_t array_size, const hid_t array_ H5Z_result resl, resr; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5Z_xform_eval_full, FAIL) + FUNC_ENTER_NOAPI_NOINIT /* check args */ HDassert(tree); + HDmemset(&resl, 0, sizeof(H5Z_result)); + HDmemset(&resr, 0, sizeof(H5Z_result)); + if (tree->type == H5Z_XFORM_INTEGER) { res->type = H5Z_XFORM_INTEGER; res->value.int_val = tree->value.int_val; @@ -1046,7 +1097,7 @@ H5Z_xform_eval_full(H5Z_node *tree, const size_t array_size, const hid_t array_ res->value.dat_val = *((void**)(tree->value.dat_val)); } /* end if */ else { - if(H5Z_xform_eval_full(tree->lchild, array_size, array_type, &resl) < 0) + if(tree->lchild && H5Z_xform_eval_full(tree->lchild, array_size, array_type, &resl) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "error while performing data transform") if(H5Z_xform_eval_full(tree->rchild, array_size, array_type, &resr) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "error while performing data transform") @@ -1061,19 +1112,19 @@ H5Z_xform_eval_full(H5Z_node *tree, const size_t array_size, const hid_t array_ switch (tree->type) { case H5Z_XFORM_PLUS: - H5Z_XFORM_TYPE_OP(resl, resr, array_type, +=, array_size) + H5Z_XFORM_TYPE_OP(resl, resr, array_type, +, array_size) break; case H5Z_XFORM_MINUS: - H5Z_XFORM_TYPE_OP(resl, resr, array_type, -=, array_size) + H5Z_XFORM_TYPE_OP(resl, resr, array_type, -, array_size) break; case H5Z_XFORM_MULT: - H5Z_XFORM_TYPE_OP(resl, resr, array_type, *=, array_size) + H5Z_XFORM_TYPE_OP(resl, resr, array_type, *, array_size) break; case H5Z_XFORM_DIVIDE: - H5Z_XFORM_TYPE_OP(resl, resr, array_type, /=, array_size) + H5Z_XFORM_TYPE_OP(resl, resr, array_type, /, array_size) break; default: @@ -1111,7 +1162,7 @@ H5Z_xform_find_type(const H5T_t* type) H5T_t *tmp; /* Temporary datatype */ hid_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5Z_xform_find_type) + FUNC_ENTER_NOAPI_NOINIT HDassert(type); @@ -1197,7 +1248,7 @@ H5Z_xform_copy_tree(H5Z_node* tree, H5Z_datval_ptrs* dat_val_pointers, H5Z_datva { H5Z_node* ret_value=NULL; - FUNC_ENTER_NOAPI(H5Z_xform_copy_tree, NULL) + FUNC_ENTER_NOAPI(NULL) assert(tree); @@ -1273,25 +1324,40 @@ H5Z_xform_copy_tree(H5Z_node* tree, H5Z_datval_ptrs* dat_val_pointers, H5Z_datva void H5Z_xform_reduce_tree(H5Z_node* tree) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5Z_xform_reduce_tree) + FUNC_ENTER_NOAPI_NOINIT_NOERR if(tree) { - if((tree->type == H5Z_XFORM_PLUS) || (tree->type == H5Z_XFORM_DIVIDE) ||(tree->type == H5Z_XFORM_MULT) ||(tree->type == H5Z_XFORM_MINUS)) + if((tree->type == H5Z_XFORM_DIVIDE) || (tree->type == H5Z_XFORM_MULT)) { - if(((tree->lchild->type == H5Z_XFORM_INTEGER) || (tree->lchild->type == H5Z_XFORM_FLOAT)) && ((tree->rchild->type == H5Z_XFORM_INTEGER) || (tree->rchild->type == H5Z_XFORM_FLOAT))) + if(H5Z_op_is_numbs(tree)) + H5Z_do_op(tree); + else + { + H5Z_xform_reduce_tree(tree->lchild); + if(H5Z_op_is_numbs(tree)) + H5Z_do_op(tree); + else { + H5Z_xform_reduce_tree(tree->rchild); + if(H5Z_op_is_numbs(tree)) + H5Z_do_op(tree); + } + } + } else if((tree->type == H5Z_XFORM_PLUS) || (tree->type == H5Z_XFORM_MINUS)) { + if(H5Z_op_is_numbs2(tree)) H5Z_do_op(tree); else { H5Z_xform_reduce_tree(tree->lchild); - if(((tree->lchild->type == H5Z_XFORM_INTEGER) || (tree->lchild->type == H5Z_XFORM_FLOAT)) && ((tree->rchild->type == H5Z_XFORM_INTEGER) || (tree->rchild->type == H5Z_XFORM_FLOAT))) + if(H5Z_op_is_numbs2(tree)) H5Z_do_op(tree); else { H5Z_xform_reduce_tree(tree->rchild); - if(((tree->lchild->type == H5Z_XFORM_INTEGER) || (tree->lchild->type == H5Z_XFORM_FLOAT)) && ((tree->rchild->type == H5Z_XFORM_INTEGER) || (tree->rchild->type == H5Z_XFORM_FLOAT))) + if(H5Z_op_is_numbs2(tree)) H5Z_do_op(tree); } } } + } FUNC_LEAVE_NOAPI_VOID; @@ -1299,6 +1365,63 @@ H5Z_xform_reduce_tree(H5Z_node* tree) /*------------------------------------------------------------------------- + * Function: H5Z_op_is_numbs + * Purpose: Internal function to facilitate the condition check in + * H5Z_xform_reduce_tree to reduce the bulkiness of the code. + * Return: TRUE or FALSE + * Programmer: Raymond Lu + * 15 March 2012 + * Modifications: + * + *------------------------------------------------------------------------- + */ +static hbool_t +H5Z_op_is_numbs(H5Z_node* _tree) +{ + hbool_t ret_value = FALSE; + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + assert(_tree); + + if(((_tree->lchild->type == H5Z_XFORM_INTEGER) || (_tree->lchild->type == H5Z_XFORM_FLOAT)) && ((_tree->rchild->type == H5Z_XFORM_INTEGER) || (_tree->rchild->type == H5Z_XFORM_FLOAT))) + ret_value = TRUE; + + FUNC_LEAVE_NOAPI(ret_value) +} + + +/*------------------------------------------------------------------------- + * Function: H5Z_op_is_numbs2 + * Purpose: Internal function to facilitate the condition check in + * H5Z_xform_reduce_tree to reduce the bulkiness of the code. + * The difference from H5Z_op_is_numbs is that the left child + * can be empty, like -x or +x. + * Return: TRUE or FALSE + * Programmer: Raymond Lu + * 15 March 2012 + * Modifications: + * + *------------------------------------------------------------------------- + */ +static hbool_t +H5Z_op_is_numbs2(H5Z_node* _tree) +{ + hbool_t ret_value = FALSE; + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + assert(_tree); + + if((!_tree->lchild && ((_tree->rchild->type == H5Z_XFORM_INTEGER) || (_tree->rchild->type == H5Z_XFORM_FLOAT))) || + ((_tree->lchild && ((_tree->lchild->type == H5Z_XFORM_INTEGER) || (_tree->lchild->type == H5Z_XFORM_FLOAT))) && (_tree->rchild && ((_tree->rchild->type == H5Z_XFORM_INTEGER) || (_tree->rchild->type == H5Z_XFORM_FLOAT))))) + ret_value = TRUE; + + FUNC_LEAVE_NOAPI(ret_value) +} + + +/*------------------------------------------------------------------------- * Function: H5Z_do_op * Purpose: If the root of the tree passed in points to a simple * arithmetic operation and the left and right subtrees are both @@ -1309,26 +1432,28 @@ H5Z_xform_reduce_tree(H5Z_node* tree) * Programmer: Leon Arber * April 1, 2004. * Modifications: -* + * Raymond Lu + * 15 March 2012 + * I added a new macro H5Z_XFORM_DO_OP6 to handle the special + * operations like -x or +x when the left operand is empty. + * *------------------------------------------------------------------------- */ static void H5Z_do_op(H5Z_node* tree) { - - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5Z_do_op) + FUNC_ENTER_NOAPI_NOINIT_NOERR if(tree->type == H5Z_XFORM_DIVIDE) H5Z_XFORM_DO_OP3(/) else if(tree->type == H5Z_XFORM_MULT) H5Z_XFORM_DO_OP3(*) else if(tree->type == H5Z_XFORM_PLUS) - H5Z_XFORM_DO_OP3(+) + H5Z_XFORM_DO_OP6(+) else if(tree->type == H5Z_XFORM_MINUS) - H5Z_XFORM_DO_OP3(-) + H5Z_XFORM_DO_OP6(-) FUNC_LEAVE_NOAPI_VOID; - } @@ -1359,7 +1484,7 @@ H5Z_xform_create(const char *expr) unsigned int i; unsigned int count = 0; - FUNC_ENTER_NOAPI(H5Z_xform_create, NULL) + FUNC_ENTER_NOAPI(NULL) assert(expr); @@ -1383,7 +1508,7 @@ H5Z_xform_create(const char *expr) * we don't need to allocate any space since no array will have to be * stored */ if(count > 0) - if((data_xform_prop->dat_val_pointers->ptr_dat_val = (void**) H5MM_calloc(count * sizeof(void**))) == NULL) + if(NULL == (data_xform_prop->dat_val_pointers->ptr_dat_val = (void *)H5MM_calloc(count * sizeof(void *)))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "unable to allocate memory for pointers in transform array") /* Initialize the num_ptrs field, which will be used to keep track of the number of copies @@ -1445,7 +1570,7 @@ done: herr_t H5Z_xform_destroy(H5Z_data_xform_t *data_xform_prop) { - FUNC_ENTER_NOAPI_NOFUNC(H5Z_xform_destroy) + FUNC_ENTER_NOAPI_NOINIT_NOERR if(data_xform_prop) { /* Destroy the parse tree */ @@ -1498,7 +1623,7 @@ H5Z_xform_copy(H5Z_data_xform_t **data_xform_prop) H5Z_data_xform_t *new_data_xform_prop=NULL; herr_t ret_value=SUCCEED; - FUNC_ENTER_NOAPI(H5Z_xform_copy, FAIL) + FUNC_ENTER_NOAPI(FAIL) if(*data_xform_prop) { /* Allocate new node */ @@ -1518,7 +1643,7 @@ H5Z_xform_copy(H5Z_data_xform_t **data_xform_prop) count++; if(count > 0) - if((new_data_xform_prop->dat_val_pointers->ptr_dat_val = (void**) H5MM_calloc(count * sizeof(void**))) == NULL) + if(NULL == (new_data_xform_prop->dat_val_pointers->ptr_dat_val = (void *)H5MM_calloc(count * sizeof(void *)))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate memory for pointers in transform array") /* Zero out num_pointers prior to H5Z_xform_cop_tree call; that call will increment it to the right amount */ @@ -1575,7 +1700,7 @@ H5Z_xform_noop(const H5Z_data_xform_t *data_xform_prop) { hbool_t ret_value; - FUNC_ENTER_NOAPI_NOFUNC(H5Z_xform_noop) + FUNC_ENTER_NOAPI_NOINIT_NOERR ret_value=(data_xform_prop ? FALSE : TRUE); @@ -1604,7 +1729,7 @@ H5Z_xform_extract_xform_str(const H5Z_data_xform_t *data_xform_prop) { char* ret_value; - FUNC_ENTER_NOAPI_NOFUNC(H5Z_xform_extract_xform_str) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* There should be no way that this can be NULL since the function * that calls this one checks to make sure it isn't before diff --git a/src/H5api_adpt.h b/src/H5api_adpt.h index fc0b467..845a9a0 100644 --- a/src/H5api_adpt.h +++ b/src/H5api_adpt.h @@ -303,10 +303,10 @@ * The Visual Studio project files will not be supported in the next major release of 1.10. */ -#if defined(_WIN32) +#if defined(H5_HAVE_WIN32_API) #if defined(_HDF5DLL_) -#pragma warning(disable: 4273) /* Disable the dll linkage warnings */ +#pragma warning(disable: 4273) /* Disable the dll linkage warnings */ #define H5_DLL __declspec(dllexport) #define H5_DLLVAR extern __declspec(dllexport) #elif defined(_HDF5USEDLL_) @@ -318,7 +318,7 @@ #endif /* _HDF5DLL_ */ #if defined(_HDF5TESTDLL_) -#pragma warning(disable: 4273) /* Disable the dll linkage warnings */ +#pragma warning(disable: 4273) /* Disable the dll linkage warnings */ #define H5TEST_DLL __declspec(dllexport) #define H5TEST_DLLVAR extern __declspec(dllexport) #elif defined(_HDF5TESTUSEDLL_) @@ -330,7 +330,7 @@ #endif /* _HDF5TESTDLL_ */ #if defined(_HDF5TOOLSDLL_) -#pragma warning(disable: 4273) /* Disable the dll linkage warnings */ +#pragma warning(disable: 4273) /* Disable the dll linkage warnings */ #define H5TOOLS_DLL __declspec(dllexport) #define H5TOOLS_DLLVAR extern __declspec(dllexport) #elif defined(_HDF5TOOLSUSEDLL_) @@ -342,7 +342,7 @@ #endif /* _HDF5TOOLSDLL_ */ #if defined(_HDF5_HLDLL_EXPORTS_) -#pragma warning(disable: 4273) /* Disable the dll linkage warnings */ +#pragma warning(disable: 4273) /* Disable the dll linkage warnings */ #define H5_HLDLL __declspec(dllexport) #elif defined(_HDF5USEHLDLL_) #define H5_HLDLL __declspec(dllimport) @@ -351,7 +351,7 @@ #endif /* _HDF5_HLDLL_EXPORTS */ #if defined(HDF5_HL_CPPDLL_EXPORTS) -#pragma warning(disable: 4273) /* Disable the dll linkage warnings */ +#pragma warning(disable: 4273) /* Disable the dll linkage warnings */ #define H5_HLCPPDLL __declspec(dllexport) #elif defined(HDF5USE_HLCPPDLL) #define H5_HLCPPDLL __declspec(dllimport) @@ -360,7 +360,7 @@ #endif /*HDF5_HL_CPPDLL_EXPORTS*/ #if defined(HDF5_HL_F90CSTUBDLL_EXPORTS) -#pragma warning(disable: 4273) /* Disable the dll linkage warnings */ +#pragma warning(disable: 4273) /* Disable the dll linkage warnings */ #define HDF5_HL_F90CSTUBDLL __declspec(dllexport) #elif defined(HDF5USE_HLF90CSTUBDLL) #define HDF5_HL_F90CSTUBDLL __declspec(dllimport) @@ -370,7 +370,7 @@ #if defined(HDF5FORT_CSTUB_DLL_EXPORTS) -#pragma warning(disable: 4273) /* Disable the dll linkage warnings */ +#pragma warning(disable: 4273) /* Disable the dll linkage warnings */ #define H5_FCDLL __declspec(dllexport) #define H5_FCDLLVAR extern __declspec(dllexport) #elif defined(HDF5FORT_CSTUB_USEDLL) @@ -382,7 +382,7 @@ #endif /* _HDF5_FORTRANDLL_EXPORTS_ */ #if defined(HDF5FORTTEST_CSTUB_DLL_EXPORTS) -#pragma warning(disable: 4273) /* Disable the dll linkage warnings */ +#pragma warning(disable: 4273) /* Disable the dll linkage warnings */ #define H5_FCTESTDLL __declspec(dllexport) #define H5_FCTESTDLLVAR extern __declspec(dllexport) #elif defined(HDF5FORTTEST_CSTUB_USEDLL) @@ -402,7 +402,7 @@ #define H5_DLLCPP #endif /* HDF5_CPPDLL_EXPORTS */ -#else /*_WIN32*/ +#else /*H5_HAVE_WIN32_API*/ #define H5_DLL #define H5_HLDLL #define H5_HLCPPDLL @@ -417,7 +417,7 @@ #define H5_FCDLLVAR extern #define H5_FCTESTDLL #define H5_FCTESTDLLVAR extern -#endif +#endif /*H5_HAVE_WIN32_API*/ #endif /* H5API_ADPT_H */ diff --git a/src/H5checksum.c b/src/H5checksum.c index 6c01508..ec8b2b0 100644 --- a/src/H5checksum.c +++ b/src/H5checksum.c @@ -115,7 +115,7 @@ H5_checksum_fletcher32(const void *_data, size_t _len) size_t len = _len / 2; /* Length in 16-bit words */ uint32_t sum1 = 0, sum2 = 0; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5_checksum_fletcher32) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ HDassert(_data); @@ -171,7 +171,7 @@ H5_checksum_crc_make_table(void) uint32_t c; /* Checksum for each byte value */ unsigned n, k; /* Local index variables */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5_checksum_crc_make_table) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Compute the checksum for each possible byte value */ for(n = 0; n < 256; n++) { @@ -209,7 +209,7 @@ H5_checksum_crc_update(uint32_t crc, const uint8_t *buf, size_t len) { size_t n; /* Local index variable */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5_checksum_crc_update) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Initialize the CRC table if necessary */ if(!H5_crc_table_computed) @@ -243,7 +243,7 @@ H5_checksum_crc_update(uint32_t crc, const uint8_t *buf, size_t len) uint32_t H5_checksum_crc(const void *_data, size_t len) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5_checksum_crc) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ HDassert(_data); @@ -376,7 +376,7 @@ H5_checksum_lookup3(const void *key, size_t length, uint32_t initval) const uint8_t *k = (const uint8_t *)key; uint32_t a, b, c; /* internal state */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5_checksum_lookup3) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ HDassert(key); @@ -448,7 +448,7 @@ done: uint32_t H5_checksum_metadata(const void *data, size_t len, uint32_t initval) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5_checksum_metadata) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ HDassert(data); @@ -481,7 +481,7 @@ H5_hash_string(const char *str) uint32_t hash = 5381; int c; - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5_hash_string) + FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ HDassert(str); diff --git a/src/H5config.h.in b/src/H5config.h.in index c53ccca..a2059f5 100644 --- a/src/H5config.h.in +++ b/src/H5config.h.in @@ -68,6 +68,9 @@ /* Define if the compiler understands the __func__ keyword */ #undef HAVE_C99_FUNC +/* Define to 1 if you have the `clock_gettime' function. */ +#undef HAVE_CLOCK_GETTIME + /* Define if the function stack tracing code is to be compiled in */ #undef HAVE_CODESTACK @@ -226,6 +229,9 @@ /* Define to 1 if you have the `lstat' function. */ #undef HAVE_LSTAT +/* Define to 1 if you have the header file. */ +#undef HAVE_MACH_MACH_TIME_H + /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H @@ -461,17 +467,10 @@ /* Define if the metadata trace file code is to be compiled in */ #undef METADATA_TRACE_FILE -/* Define if your system can handle complicated MPI derived datatype - correctly. */ -#undef MPI_COMPLEX_DERIVED_DATATYPE_WORKS - /* Define if your system's `MPI_File_set_size' function works for files over 2GB. */ #undef MPI_FILE_SET_SIZE_BIG -/* Define if your system can handle special collective IO properly. */ -#undef MPI_SPECIAL_COLLECTIVE_IO_WORKS - /* Define if we can violate pointer alignment restrictions */ #undef NO_ALIGNMENT_RESTRICTIONS diff --git a/src/H5dbg.c b/src/H5dbg.c index 632ac08..5441895 100644 --- a/src/H5dbg.c +++ b/src/H5dbg.c @@ -83,7 +83,7 @@ H5_buffer_dump(FILE *stream, int indent, const uint8_t *buf, { size_t u, v; /* Local index variable */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5_buffer_dump) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. diff --git a/src/H5detect.c b/src/H5detect.c index 0461cfd..98fd6ae 100644 --- a/src/H5detect.c +++ b/src/H5detect.c @@ -621,7 +621,7 @@ H5TN_init_interface(void)\n\ H5T_t *dt = NULL;\n\ herr_t ret_value = SUCCEED;\n\ \n\ - FUNC_ENTER_NOAPI(H5TN_init_interface, FAIL)\n"); + FUNC_ENTER_NOAPI(FAIL)\n"); for(i = 0; i < nd; i++) { /* The native endianess of this machine */ diff --git a/src/H5private.h b/src/H5private.h index 7950117..e01edd2 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -13,28 +13,34 @@ * access to either file, you may request a copy from help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Robb Matzke - * Friday, October 30, 1998 +/* Programmer: Robb Matzke + * Friday, October 30, 1998 * - * Purpose: This file is included by all HDF5 library source files to - * define common things which are not defined in the HDF5 API. - * The configuration constants like H5_HAVE_UNISTD_H etc. are - * defined in H5config.h which is included by H5public.h. + * Purpose: This file is included by all HDF5 library source files to + * define common things which are not defined in the HDF5 API. + * The configuration constants like H5_HAVE_UNISTD_H etc. are + * defined in H5config.h which is included by H5public.h. * */ #ifndef _H5private_H #define _H5private_H -#include "H5public.h" /* Include Public Definitions */ +#include "H5public.h" /* Include Public Definitions */ /* include the pthread header */ #ifdef H5_HAVE_THREADSAFE -#ifdef H5_HAVE_PTHREAD_H -#include -#else /* H5_HAVE_PTHREAD_H */ -#define H5_HAVE_WIN_THREADS -#endif /* H5_HAVE_PTHREAD_H */ + #ifdef H5_HAVE_WIN32_API + #ifndef H5_HAVE_WIN_THREADS + #ifdef H5_HAVE_PTHREAD_H + #include + #endif /* H5_HAVE_PTHREAD_H */ + #endif /* H5_HAVE_WIN_THREADS */ + #else /* H5_HAVE_WIN32_API */ + #ifdef H5_HAVE_PTHREAD_H + #include + #endif /* H5_HAVE_PTHREAD_H */ + #endif /* H5_HAVE_WIN32_API */ #endif /* H5_HAVE_THREADSAFE */ /* @@ -79,7 +85,7 @@ /* * The `struct stat' data type for stat() and fstat(). This is a Posix file - * but often apears on non-Posix systems also. The `struct stat' is required + * but often apears on non-Posix systems also. The `struct stat' is required * for hdf5 to compile, although only a few fields are actually used. */ #ifdef H5_HAVE_SYS_STAT_H @@ -121,7 +127,7 @@ #endif /* - * Unix ioctls. These are used by h5ls (and perhaps others) to determine a + * Unix ioctls. These are used by h5ls (and perhaps others) to determine a * resonable output width. */ #ifdef H5_HAVE_SYS_IOCTL_H @@ -144,17 +150,21 @@ #endif -#ifdef _WIN32 -#define WIN32_LEAN_AND_MEAN /*Exclude rarely-used stuff from Windows headers */ +#ifdef H5_HAVE_WIN32_API +#define WIN32_LEAN_AND_MEAN /* Exclude rarely-used stuff from Windows headers */ #ifdef H5_HAVE_WINSOCK_H #include #endif +#ifdef H5_HAVE_THREADSAFE +#include /* For _beginthread() */ +#endif + #include #include /* For _getcwd() */ -#endif /*_WIN32*/ +#endif /*H5_HAVE_WIN32_API*/ /* H5_inline */ #ifndef H5_inline @@ -163,7 +173,7 @@ #ifndef F_OK -# define F_OK 00 +# define F_OK 00 # define W_OK 02 # define R_OK 04 #endif @@ -187,11 +197,10 @@ */ #define eventa(func_name) h5_mpe_eventa #define eventb(func_name) h5_mpe_eventb -#define MPE_LOG_VARS(func_name) \ - static int eventa(func_name) = -1; \ - static int eventb(func_name) = -1; \ - const char* p_end_funcname = #func_name; \ - const char* p_event_start = "start" #func_name; +#define MPE_LOG_VARS \ + static int eventa(FUNC) = -1; \ + static int eventb(FUNC) = -1; \ + const char* p_event_start = "start" FUNC; /* Hardwire the color to "red", since that's what all the routines are using * now. In the future, if we want to change that color for a given routine, @@ -200,15 +209,15 @@ * color information down to the BEGIN_MPE_LOG macro (which should have a new * BEGIN_MPE_LOG_COLOR variant). -QAK */ -#define BEGIN_MPE_LOG(func_name) \ - if (H5_MPEinit_g){ \ - if (eventa(func_name) == -1 && eventb(func_name) == -1) { \ - const char* p_color = "red"; \ - eventa(func_name)=MPE_Log_get_event_number(); \ - eventb(func_name)=MPE_Log_get_event_number(); \ - MPE_Describe_state(eventa(func_name), eventb(func_name), (char *)p_end_funcname, (char *)p_color); \ +#define BEGIN_MPE_LOG \ + if (H5_MPEinit_g){ \ + if (eventa(FUNC) == -1 && eventb(FUNC) == -1) { \ + const char* p_color = "red"; \ + eventa(FUNC)=MPE_Log_get_event_number(); \ + eventb(FUNC)=MPE_Log_get_event_number(); \ + MPE_Describe_state(eventa(FUNC), eventb(FUNC), (char *)FUNC, (char *)p_color); \ } \ - MPE_Log_event(eventa(func_name), 0, (char *)p_event_start); \ + MPE_Log_event(eventa(FUNC), 0, (char *)p_event_start); \ } @@ -220,12 +229,12 @@ */ #define FINISH_MPE_LOG \ if (H5_MPEinit_g) { \ - MPE_Log_event(eventb(func_name), 0, (char *)p_end_funcname); \ + MPE_Log_event(eventb(FUNC), 0, (char *)FUNC); \ } #else /* H5_HAVE_MPE */ -#define MPE_LOG_VARS(func_name) /* void */ -#define BEGIN_MPE_LOG(func_name) /* void */ +#define MPE_LOG_VARS /* void */ +#define BEGIN_MPE_LOG /* void */ #define FINISH_MPE_LOG /* void */ #endif /* H5_HAVE_MPE */ @@ -244,36 +253,27 @@ * never be raised by the hdf5 library). */ #ifndef SIGBUS -# define SIGBUS SIGILL +# define SIGBUS SIGILL #endif /* * Does the compiler support the __attribute__(()) syntax? This is how gcc - * suppresses warnings about unused function arguments. It's no big deal if + * suppresses warnings about unused function arguments. It's no big deal if * we don't. */ #ifdef __cplusplus -# define __attribute__(X) /*void*/ -# define UNUSED /*void*/ +# define __attribute__(X) /*void*/ +# define UNUSED /*void*/ #else /* __cplusplus */ #ifdef H5_HAVE_ATTRIBUTE -# define UNUSED __attribute__((unused)) +# define UNUSED __attribute__((unused)) #else -# define __attribute__(X) /*void*/ -# define UNUSED /*void*/ +# define __attribute__(X) /*void*/ +# define UNUSED /*void*/ #endif #endif /* __cplusplus */ /* - * Does the compiler expand __FUNCTION__ to be the name of the function - * currently being defined? If not then define it to be some constant - * string. - */ -#ifndef H5_HAVE_FUNCTION -# define __FUNCTION__ "NoFunctionName" -#endif - -/* * Status return values for the `herr_t' type. * Since some unix/c routines use 0 and -1 (or more precisely, non-negative * vs. negative) as their return code, and some assumption had been made in @@ -282,48 +282,48 @@ * function, remember to compare against zero and not one of these two * values. */ -#define SUCCEED 0 -#define FAIL (-1) -#define UFAIL (unsigned)(-1) +#define SUCCEED 0 +#define FAIL (-1) +#define UFAIL (unsigned)(-1) /* number of members in an array */ #ifndef NELMTS -# define NELMTS(X) (sizeof(X)/sizeof(X[0])) +# define NELMTS(X) (sizeof(X)/sizeof(X[0])) #endif /* minimum of two, three, or four values */ #undef MIN -#define MIN(a,b) (((a)<(b)) ? (a) : (b)) -#define MIN2(a,b) MIN(a,b) -#define MIN3(a,b,c) MIN(a,MIN(b,c)) -#define MIN4(a,b,c,d) MIN(MIN(a,b),MIN(c,d)) +#define MIN(a,b) (((a)<(b)) ? (a) : (b)) +#define MIN2(a,b) MIN(a,b) +#define MIN3(a,b,c) MIN(a,MIN(b,c)) +#define MIN4(a,b,c,d) MIN(MIN(a,b),MIN(c,d)) /* maximum of two, three, or four values */ #undef MAX -#define MAX(a,b) (((a)>(b)) ? (a) : (b)) -#define MAX2(a,b) MAX(a,b) -#define MAX3(a,b,c) MAX(a,MAX(b,c)) -#define MAX4(a,b,c,d) MAX(MAX(a,b),MAX(c,d)) +#define MAX(a,b) (((a)>(b)) ? (a) : (b)) +#define MAX2(a,b) MAX(a,b) +#define MAX3(a,b,c) MAX(a,MAX(b,c)) +#define MAX4(a,b,c,d) MAX(MAX(a,b),MAX(c,d)) /* limit the middle value to be within a range (inclusive) */ -#define RANGE(LO,X,HI) MAX(LO,MIN(X,HI)) +#define RANGE(LO,X,HI) MAX(LO,MIN(X,HI)) /* absolute value */ #ifndef ABS -# define ABS(a) (((a)>=0) ? (a) : -(a)) +# define ABS(a) (((a)>=0) ? (a) : -(a)) #endif /* sign of argument */ #ifndef SIGN -# define SIGN(a) ((a)>0 ? 1 : (a)<0 ? -1 : 0) +# define SIGN(a) ((a)>0 ? 1 : (a)<0 ? -1 : 0) #endif /* test for number that is a power of 2 */ /* (from: http://graphics.stanford.edu/~seander/bithacks.html#DetermineIfPowerOf2) */ -# define POWER_OF_TWO(n) (!(n & (n - 1)) && n) +# define POWER_OF_TWO(n) (!(n & (n - 1)) && n) /* Raise an integer to a power of 2 */ -# define H5_EXP2(n) (1 << (n)) +# define H5_EXP2(n) (1 << (n)) /* * HDF Boolean type. @@ -336,7 +336,7 @@ #endif /* - * Numeric data types. Some of these might be defined in Posix.1g, otherwise + * Numeric data types. Some of these might be defined in Posix.1g, otherwise * we define them with the closest available type which is at least as large * as the number of bits indicated in the type name. The `int8' types *must* * be exactly one byte wide because we use it for pointer calculations to @@ -404,28 +404,28 @@ #endif /* - * Maximum and minimum values. These should be defined in for the + * Maximum and minimum values. These should be defined in for the * most part. */ #ifndef LLONG_MAX -# define LLONG_MAX ((long long)(((unsigned long long)1 \ - <<(8*sizeof(long long)-1))-1)) +# define LLONG_MAX ((long long)(((unsigned long long)1 \ + <<(8*sizeof(long long)-1))-1)) # define LLONG_MIN ((long long)(-LLONG_MAX)-1) #endif #ifndef ULLONG_MAX -# define ULLONG_MAX ((unsigned long long)((long long)(-1))) +# define ULLONG_MAX ((unsigned long long)((long long)(-1))) #endif #ifndef SIZET_MAX -# define SIZET_MAX ((size_t)(ssize_t)(-1)) -# define SSIZET_MAX ((ssize_t)(((size_t)1<<(8*sizeof(ssize_t)-1))-1)) +# define SIZET_MAX ((size_t)(ssize_t)(-1)) +# define SSIZET_MAX ((ssize_t)(((size_t)1<<(8*sizeof(ssize_t)-1))-1)) #endif /* * Maximum & minimum values for our typedefs. */ -#define HSIZET_MAX ((hsize_t)ULLONG_MAX) -#define HSSIZET_MAX ((hssize_t)LLONG_MAX) -#define HSSIZET_MIN (~(HSSIZET_MAX)) +#define HSIZET_MAX ((hsize_t)ULLONG_MAX) +#define HSSIZET_MAX ((hssize_t)LLONG_MAX) +#define HSSIZET_MIN (~(HSSIZET_MAX)) /* * A macro to portably increment enumerated types. @@ -445,15 +445,15 @@ * Data types and functions for timing certain parts of the library. */ typedef struct { - double utime; /*user time */ - double stime; /*system time */ - double etime; /*elapsed wall-clock time */ + double utime; /*user time */ + double stime; /*system time */ + double etime; /*elapsed wall-clock time */ } H5_timer_t; H5_DLL void H5_timer_reset (H5_timer_t *timer); H5_DLL void H5_timer_begin (H5_timer_t *timer); H5_DLL void H5_timer_end (H5_timer_t *sum/*in,out*/, - H5_timer_t *timer/*in,out*/); + H5_timer_t *timer/*in,out*/); H5_DLL void H5_bandwidth(char *buf/*out*/, double nbytes, double nseconds); H5_DLL time_t H5_now(void); @@ -481,19 +481,19 @@ typedef struct { /* Put all platform-specific definitions in the following file */ /* so that the following definitions are platform free. */ -#include "H5win32defs.h" /* For Windows-specific definitions */ +#include "H5win32defs.h" /* For Windows-specific definitions */ #ifndef HDabort - #define HDabort() abort() + #define HDabort() abort() #endif /* HDabort */ #ifndef HDabs - #define HDabs(X) abs(X) + #define HDabs(X) abs(X) #endif /* HDabs */ #ifndef HDaccess - #define HDaccess(F,M) access(F, M) + #define HDaccess(F,M) access(F, M) #endif /* HDaccess */ #ifndef HDacos - #define HDacos(X) acos(X) + #define HDacos(X) acos(X) #endif /* HDacos */ #ifndef HDalarm #ifdef H5_HAVE_ALARM @@ -503,232 +503,232 @@ typedef struct { #endif /* H5_HAVE_ALARM */ #endif /* HDalarm */ #ifndef HDasctime - #define HDasctime(T) asctime(T) + #define HDasctime(T) asctime(T) #endif /* HDasctime */ #ifndef HDasin - #define HDasin(X) asin(X) + #define HDasin(X) asin(X) #endif /* HDasin */ #ifndef HDassert - #define HDassert(X) assert(X) + #define HDassert(X) assert(X) #endif /* HDassert */ #ifndef HDatan - #define HDatan(X) atan(X) + #define HDatan(X) atan(X) #endif /* HDatan */ #ifndef HDatan2 - #define HDatan2(X,Y) atan2(X,Y) + #define HDatan2(X,Y) atan2(X,Y) #endif /* HDatan2 */ #ifndef HDatexit - #define HDatexit(F) atexit(F) + #define HDatexit(F) atexit(F) #endif /* HDatexit */ #ifndef HDatof - #define HDatof(S) atof(S) + #define HDatof(S) atof(S) #endif /* HDatof */ #ifndef HDatoi - #define HDatoi(S) atoi(S) + #define HDatoi(S) atoi(S) #endif /* HDatoi */ #ifndef HDatol - #define HDatol(S) atol(S) + #define HDatol(S) atol(S) #endif /* HDatol */ #ifndef HDBSDgettimeofday - #define HDBSDgettimeofday(S,P) BSDgettimeofday(S,P) + #define HDBSDgettimeofday(S,P) BSDgettimeofday(S,P) #endif /* HDBSDgettimeofday */ #ifndef HDbsearch - #define HDbsearch(K,B,N,Z,F) bsearch(K,B,N,Z,F) + #define HDbsearch(K,B,N,Z,F) bsearch(K,B,N,Z,F) #endif /* HDbsearch */ #ifndef HDcalloc - #define HDcalloc(N,Z) calloc(N,Z) + #define HDcalloc(N,Z) calloc(N,Z) #endif /* HDcalloc */ #ifndef HDceil - #define HDceil(X) ceil(X) + #define HDceil(X) ceil(X) #endif /* HDceil */ #ifndef HDcfgetispeed - #define HDcfgetispeed(T) cfgetispeed(T) + #define HDcfgetispeed(T) cfgetispeed(T) #endif /* HDcfgetispeed */ #ifndef HDcfgetospeed - #define HDcfgetospeed(T) cfgetospeed(T) + #define HDcfgetospeed(T) cfgetospeed(T) #endif /* HDcfgetospeed */ #ifndef HDcfsetispeed - #define HDcfsetispeed(T,S) cfsetispeed(T,S) + #define HDcfsetispeed(T,S) cfsetispeed(T,S) #endif /* HDcfsetispeed */ #ifndef HDcfsetospeed - #define HDcfsetospeed(T,S) cfsetospeed(T,S) + #define HDcfsetospeed(T,S) cfsetospeed(T,S) #endif /* HDcfsetospeed */ #ifndef HDchdir - #define HDchdir(S) chdir(S) + #define HDchdir(S) chdir(S) #endif /* HDchdir */ #ifndef HDchmod - #define HDchmod(S,M) chmod(S,M) + #define HDchmod(S,M) chmod(S,M) #endif /* HDchmod */ #ifndef HDchown - #define HDchown(S,O,G) chown(S,O,G) + #define HDchown(S,O,G) chown(S,O,G) #endif /* HDchown */ #ifndef HDclearerr - #define HDclearerr(F) clearerr(F) + #define HDclearerr(F) clearerr(F) #endif /* HDclearerr */ #ifndef HDclock - #define HDclock() clock() + #define HDclock() clock() #endif /* HDclock */ #ifndef HDclose - #define HDclose(F) close(F) + #define HDclose(F) close(F) #endif /* HDclose */ #ifndef HDclosedir - #define HDclosedir(D) closedir(D) + #define HDclosedir(D) closedir(D) #endif /* HDclosedir */ #ifndef HDcos - #define HDcos(X) cos(X) + #define HDcos(X) cos(X) #endif /* HDcos */ #ifndef HDcosh - #define HDcosh(X) cosh(X) + #define HDcosh(X) cosh(X) #endif /* HDcosh */ #ifndef HDcreat - #define HDcreat(S,M) creat(S,M) + #define HDcreat(S,M) creat(S,M) #endif /* HDcreat */ #ifndef HDctermid - #define HDctermid(S) ctermid(S) + #define HDctermid(S) ctermid(S) #endif /* HDctermid */ #ifndef HDctime - #define HDctime(T) ctime(T) + #define HDctime(T) ctime(T) #endif /* HDctime */ #ifndef HDcuserid - #define HDcuserid(S) cuserid(S) + #define HDcuserid(S) cuserid(S) #endif /* HDcuserid */ #ifndef HDdifftime #ifdef H5_HAVE_DIFFTIME - #define HDdifftime(X,Y) difftime(X,Y) + #define HDdifftime(X,Y) difftime(X,Y) #else /* H5_HAVE_DIFFTIME */ - #define HDdifftime(X,Y) ((double)(X)-(double)(Y)) + #define HDdifftime(X,Y) ((double)(X)-(double)(Y)) #endif /* H5_HAVE_DIFFTIME */ #endif /* HDdifftime */ #ifndef HDdiv - #define HDdiv(X,Y) div(X,Y) + #define HDdiv(X,Y) div(X,Y) #endif /* HDdiv */ #ifndef HDdup - #define HDdup(F) dup(F) + #define HDdup(F) dup(F) #endif /* HDdup */ #ifndef HDdup2 - #define HDdup2(F,I) dup2(F,I) + #define HDdup2(F,I) dup2(F,I) #endif /* HDdup2 */ /* execl() variable arguments */ /* execle() variable arguments */ /* execlp() variable arguments */ #ifndef HDexecv - #define HDexecv(S,AV) execv(S,AV) + #define HDexecv(S,AV) execv(S,AV) #endif /* HDexecv */ #ifndef HDexecve - #define HDexecve(S,AV,E) execve(S,AV,E) + #define HDexecve(S,AV,E) execve(S,AV,E) #endif /* HDexecve */ #ifndef HDexecvp - #define HDexecvp(S,AV) execvp(S,AV) + #define HDexecvp(S,AV) execvp(S,AV) #endif /* HDexecvp */ #ifndef HDexit - #define HDexit(N) exit(N) + #define HDexit(N) exit(N) #endif /* HDexit */ #ifndef HD_exit - #define HD_exit(N) _exit(N) + #define HD_exit(N) _exit(N) #endif /* HD_exit */ #ifndef HDexp - #define HDexp(X) exp(X) + #define HDexp(X) exp(X) #endif /* HDexp */ #ifndef HDexp2 - #define HDexp2(X) exp2(X) + #define HDexp2(X) exp2(X) #endif /* HDexp2 */ #ifndef HDfabs - #define HDfabs(X) fabs(X) + #define HDfabs(X) fabs(X) #endif /* HDfabs */ /* use ABS() because fabsf() fabsl() are not common yet. */ #ifndef HDfabsf - #define HDfabsf(X) ABS(X) + #define HDfabsf(X) ABS(X) #endif /* HDfabsf */ #ifndef HDfabsl - #define HDfabsl(X) ABS(X) + #define HDfabsl(X) ABS(X) #endif /* HDfabsl */ #ifndef HDfclose - #define HDfclose(F) fclose(F) + #define HDfclose(F) fclose(F) #endif /* HDfclose */ /* fcntl() variable arguments */ #ifndef HDfdopen - #define HDfdopen(N,S) fdopen(N,S) + #define HDfdopen(N,S) fdopen(N,S) #endif /* HDfdopen */ #ifndef HDfeof - #define HDfeof(F) feof(F) + #define HDfeof(F) feof(F) #endif /* HDfeof */ #ifndef HDferror - #define HDferror(F) ferror(F) + #define HDferror(F) ferror(F) #endif /* HDferror */ #ifndef HDfflush - #define HDfflush(F) fflush(F) + #define HDfflush(F) fflush(F) #endif /* HDfflush */ #ifndef HDfgetc - #define HDfgetc(F) fgetc(F) + #define HDfgetc(F) fgetc(F) #endif /* HDfgetc */ #ifndef HDfgetpos - #define HDfgetpos(F,P) fgetpos(F,P) + #define HDfgetpos(F,P) fgetpos(F,P) #endif /* HDfgetpos */ #ifndef HDfgets - #define HDfgets(S,N,F) fgets(S,N,F) + #define HDfgets(S,N,F) fgets(S,N,F) #endif /* HDfgets */ #ifndef HDfileno - #define HDfileno(F) fileno(F) + #define HDfileno(F) fileno(F) #endif /* HDfileno */ #ifndef HDfloor - #define HDfloor(X) floor(X) + #define HDfloor(X) floor(X) #endif /* HDfloor */ #ifndef HDfmod - #define HDfmod(X,Y) fmod(X,Y) + #define HDfmod(X,Y) fmod(X,Y) #endif /* HDfmod */ #ifndef HDfopen - #define HDfopen(S,M) fopen(S,M) + #define HDfopen(S,M) fopen(S,M) #endif /* HDfopen */ #ifndef HDfork - #define HDfork() fork() + #define HDfork() fork() #endif /* HDfork */ #ifndef HDfpathconf - #define HDfpathconf(F,N) fpathconf(F,N) + #define HDfpathconf(F,N) fpathconf(F,N) #endif /* HDfpathconf */ H5_DLL int HDfprintf (FILE *stream, const char *fmt, ...); #ifndef HDfputc - #define HDfputc(C,F) fputc(C,F) + #define HDfputc(C,F) fputc(C,F) #endif /* HDfputc */ #ifndef HDfputs - #define HDfputs(S,F) fputs(S,F) + #define HDfputs(S,F) fputs(S,F) #endif /* HDfputs */ #ifndef HDfread - #define HDfread(M,Z,N,F) fread(M,Z,N,F) + #define HDfread(M,Z,N,F) fread(M,Z,N,F) #endif /* HDfread */ #ifndef HDfree - #define HDfree(M) free(M) + #define HDfree(M) free(M) #endif /* HDfree */ #ifndef HDfreopen - #define HDfreopen(S,M,F) freopen(S,M,F) + #define HDfreopen(S,M,F) freopen(S,M,F) #endif /* HDfreopen */ #ifndef HDfrexp - #define HDfrexp(X,N) frexp(X,N) + #define HDfrexp(X,N) frexp(X,N) #endif /* HDfrexp */ /* Check for Cray-specific 'frexpf()' and 'frexpl()' routines */ #ifndef HDfrexpf #ifdef H5_HAVE_FREXPF - #define HDfrexpf(X,N) frexpf(X,N) + #define HDfrexpf(X,N) frexpf(X,N) #else /* H5_HAVE_FREXPF */ - #define HDfrexpf(X,N) frexp(X,N) + #define HDfrexpf(X,N) frexp(X,N) #endif /* H5_HAVE_FREXPF */ #endif /* HDfrexpf */ #ifndef HDfrexpl #ifdef H5_HAVE_FREXPL - #define HDfrexpl(X,N) frexpl(X,N) + #define HDfrexpl(X,N) frexpl(X,N) #else /* H5_HAVE_FREXPL */ - #define HDfrexpl(X,N) frexp(X,N) + #define HDfrexpl(X,N) frexp(X,N) #endif /* H5_HAVE_FREXPL */ #endif /* HDfrexpl */ /* fscanf() variable arguments */ #ifndef HDfseek #ifdef H5_HAVE_FSEEKO - #define HDfseek(F,O,W) fseeko(F,O,W) + #define HDfseek(F,O,W) fseeko(F,O,W) #else /* H5_HAVE_FSEEKO */ - #define HDfseek(F,O,W) fseek(F,O,W) + #define HDfseek(F,O,W) fseek(F,O,W) #endif /* H5_HAVE_FSEEKO */ #endif /* HDfseek */ #ifndef HDfsetpos - #define HDfsetpos(F,P) fsetpos(F,P) + #define HDfsetpos(F,P) fsetpos(F,P) #endif /* HDfsetpos */ /* definitions related to the file stat utilities. * For Unix, if off_t is not 64bit big, try use the pseudo-standard @@ -740,10 +740,10 @@ H5_DLL int HDfprintf (FILE *stream, const char *fmt, ...); #define HDfstat(F,B) fstat64(F,B) #endif /* HDfstat */ #ifndef HDlstat - #define HDlstat(S,B) lstat64(S,B) + #define HDlstat(S,B) lstat64(S,B) #endif /* HDlstat */ #ifndef HDstat - #define HDstat(S,B) stat64(S,B) + #define HDstat(S,B) stat64(S,B) #endif /* HDstat */ typedef struct stat64 h5_stat_t; typedef off64_t h5_stat_size_t; @@ -753,10 +753,10 @@ H5_DLL int HDfprintf (FILE *stream, const char *fmt, ...); #define HDfstat(F,B) fstat(F,B) #endif /* HDfstat */ #ifndef HDlstat - #define HDlstat(S,B) lstat(S,B) + #define HDlstat(S,B) lstat(S,B) #endif /* HDlstat */ #ifndef HDstat - #define HDstat(S,B) stat(S,B) + #define HDstat(S,B) stat(S,B) #endif /* HDstat */ typedef struct stat h5_stat_t; typedef off_t h5_stat_size_t; @@ -765,7 +765,7 @@ H5_DLL int HDfprintf (FILE *stream, const char *fmt, ...); #endif /* !defined(HDfstat) || !defined(HDstat) */ #ifndef HDftell - #define HDftell(F) ftell(F) + #define HDftell(F) ftell(F) #endif /* HDftell */ #ifndef HDftruncate #ifdef H5_HAVE_FTRUNCATE64 @@ -775,273 +775,273 @@ H5_DLL int HDfprintf (FILE *stream, const char *fmt, ...); #endif #endif /* HDftruncate */ #ifndef HDfwrite - #define HDfwrite(M,Z,N,F) fwrite(M,Z,N,F) + #define HDfwrite(M,Z,N,F) fwrite(M,Z,N,F) #endif /* HDfwrite */ #ifndef HDgetc - #define HDgetc(F) getc(F) + #define HDgetc(F) getc(F) #endif /* HDgetc */ #ifndef HDgetchar - #define HDgetchar() getchar() + #define HDgetchar() getchar() #endif /* HDgetchar */ #ifndef HDgetcwd - #define HDgetcwd(S,Z) getcwd(S,Z) + #define HDgetcwd(S,Z) getcwd(S,Z) #endif /* HDgetcwd */ #ifndef HDgetdcwd - #define HDgetdcwd(D,S,Z) getcwd(S,Z) + #define HDgetdcwd(D,S,Z) getcwd(S,Z) #endif /* HDgetdcwd */ #ifndef HDgetdrive - #define HDgetdrive() 0 + #define HDgetdrive() 0 #endif /* HDgetdrive */ #ifndef HDgetegid - #define HDgetegid() getegid() + #define HDgetegid() getegid() #endif /* HDgetegid() */ #ifndef HDgetenv - #define HDgetenv(S) getenv(S) + #define HDgetenv(S) getenv(S) #endif /* HDgetenv */ #ifndef HDgeteuid - #define HDgeteuid() geteuid() + #define HDgeteuid() geteuid() #endif /* HDgeteuid */ #ifndef HDgetgid - #define HDgetgid() getgid() + #define HDgetgid() getgid() #endif /* HDgetgid */ #ifndef HDgetgrgid - #define HDgetgrgid(G) getgrgid(G) + #define HDgetgrgid(G) getgrgid(G) #endif /* HDgetgrgid */ #ifndef HDgetgrnam - #define HDgetgrnam(S) getgrnam(S) + #define HDgetgrnam(S) getgrnam(S) #endif /* HDgetgrnam */ #ifndef HDgetgroups - #define HDgetgroups(Z,G) getgroups(Z,G) + #define HDgetgroups(Z,G) getgroups(Z,G) #endif /* HDgetgroups */ #ifndef HDgetlogin - #define HDgetlogin() getlogin() + #define HDgetlogin() getlogin() #endif /* HDgetlogin */ #ifndef HDgetpgrp - #define HDgetpgrp() getpgrp() + #define HDgetpgrp() getpgrp() #endif /* HDgetpgrp */ #ifndef HDgetpid - #define HDgetpid() getpid() + #define HDgetpid() getpid() #endif /* HDgetpid */ #ifndef HDgetppid - #define HDgetppid() getppid() + #define HDgetppid() getppid() #endif /* HDgetppid */ #ifndef HDgetpwnam - #define HDgetpwnam(S) getpwnam(S) + #define HDgetpwnam(S) getpwnam(S) #endif /* HDgetpwnam */ #ifndef HDgetpwuid - #define HDgetpwuid(U) getpwuid(U) + #define HDgetpwuid(U) getpwuid(U) #endif /* HDgetpwuid */ #ifndef HDgetrusage - #define HDgetrusage(X,S) getrusage(X,S) + #define HDgetrusage(X,S) getrusage(X,S) #endif /* HDgetrusage */ #ifndef HDgets - #define HDgets(S) gets(S) + #define HDgets(S) gets(S) #endif /* HDgets */ #ifndef HDgettimeofday - #define HDgettimeofday(S,P) gettimeofday(S,P) + #define HDgettimeofday(S,P) gettimeofday(S,P) #endif /* HDgettimeofday */ #ifndef HDgetuid - #define HDgetuid() getuid() + #define HDgetuid() getuid() #endif /* HDgetuid */ #ifndef HDgmtime - #define HDgmtime(T) gmtime(T) + #define HDgmtime(T) gmtime(T) #endif /* HDgmtime */ #ifndef HDisalnum - #define HDisalnum(C) isalnum((int)(C)) /*cast for solaris warning*/ + #define HDisalnum(C) isalnum((int)(C)) /*cast for solaris warning*/ #endif /* HDisalnum */ #ifndef HDisalpha - #define HDisalpha(C) isalpha((int)(C)) /*cast for solaris warning*/ + #define HDisalpha(C) isalpha((int)(C)) /*cast for solaris warning*/ #endif /* HDisalpha */ #ifndef HDisatty - #define HDisatty(F) isatty(F) + #define HDisatty(F) isatty(F) #endif /* HDisatty */ #ifndef HDiscntrl - #define HDiscntrl(C) iscntrl((int)(C)) /*cast for solaris warning*/ + #define HDiscntrl(C) iscntrl((int)(C)) /*cast for solaris warning*/ #endif /* HDiscntrl */ #ifndef HDisdigit - #define HDisdigit(C) isdigit((int)(C)) /*cast for solaris warning*/ + #define HDisdigit(C) isdigit((int)(C)) /*cast for solaris warning*/ #endif /* HDisdigit */ #ifndef HDisgraph - #define HDisgraph(C) isgraph((int)(C)) /*cast for solaris warning*/ + #define HDisgraph(C) isgraph((int)(C)) /*cast for solaris warning*/ #endif /* HDisgraph */ #ifndef HDislower - #define HDislower(C) islower((int)(C)) /*cast for solaris warning*/ + #define HDislower(C) islower((int)(C)) /*cast for solaris warning*/ #endif /* HDislower */ #ifndef HDisprint - #define HDisprint(C) isprint((int)(C)) /*cast for solaris warning*/ + #define HDisprint(C) isprint((int)(C)) /*cast for solaris warning*/ #endif /* HDisprint */ #ifndef HDispunct - #define HDispunct(C) ispunct((int)(C)) /*cast for solaris warning*/ + #define HDispunct(C) ispunct((int)(C)) /*cast for solaris warning*/ #endif /* HDispunct */ #ifndef HDisspace - #define HDisspace(C) isspace((int)(C)) /*cast for solaris warning*/ + #define HDisspace(C) isspace((int)(C)) /*cast for solaris warning*/ #endif /* HDisspace */ #ifndef HDisupper - #define HDisupper(C) isupper((int)(C)) /*cast for solaris warning*/ + #define HDisupper(C) isupper((int)(C)) /*cast for solaris warning*/ #endif /* HDisupper */ #ifndef HDisxdigit - #define HDisxdigit(C) isxdigit((int)(C)) /*cast for solaris warning*/ + #define HDisxdigit(C) isxdigit((int)(C)) /*cast for solaris warning*/ #endif /* HDisxdigit */ #ifndef HDkill - #define HDkill(P,S) kill(P,S) + #define HDkill(P,S) kill(P,S) #endif /* HDkill */ #ifndef HDlabs - #define HDlabs(X) labs(X) + #define HDlabs(X) labs(X) #endif /* HDlabs */ #ifndef HDldexp - #define HDldexp(X,N) ldexp(X,N) + #define HDldexp(X,N) ldexp(X,N) #endif /* HDldexp */ #ifndef HDldiv - #define HDldiv(X,Y) ldiv(X,Y) + #define HDldiv(X,Y) ldiv(X,Y) #endif /* HDldiv */ #ifndef HDlink - #define HDlink(OLD,NEW) link(OLD,NEW) + #define HDlink(OLD,NEW) link(OLD,NEW) #endif /* HDlink */ #ifndef HDlocaleconv - #define HDlocaleconv() localeconv() + #define HDlocaleconv() localeconv() #endif /* HDlocaleconv */ #ifndef HDlocaltime - #define HDlocaltime(T) localtime(T) + #define HDlocaltime(T) localtime(T) #endif /* HDlocaltime */ #ifndef HDlog - #define HDlog(X) log(X) + #define HDlog(X) log(X) #endif /* HDlog */ #ifndef HDlog10 - #define HDlog10(X) log10(X) + #define HDlog10(X) log10(X) #endif /* HDlog10 */ #ifndef HDlongjmp - #define HDlongjmp(J,N) longjmp(J,N) + #define HDlongjmp(J,N) longjmp(J,N) #endif /* HDlongjmp */ /* HDlseek and HDoff_t must be defined together for consistency. */ #ifndef HDlseek #ifdef H5_HAVE_LSEEK64 - #define HDlseek(F,O,W) lseek64(F,O,W) - #define HDoff_t off64_t + #define HDlseek(F,O,W) lseek64(F,O,W) + #define HDoff_t off64_t #else - #define HDlseek(F,O,W) lseek(F,O,W) - #define HDoff_t off_t + #define HDlseek(F,O,W) lseek(F,O,W) + #define HDoff_t off_t #endif #endif /* HDlseek */ #ifndef HDmalloc - #define HDmalloc(Z) malloc(Z) + #define HDmalloc(Z) malloc(Z) #endif /* HDmalloc */ #ifndef HDposix_memalign #define HDposix_memalign(P,A,Z) posix_memalign(P,A,Z) #endif /* HDposix_memalign */ #ifndef HDmblen - #define HDmblen(S,N) mblen(S,N) + #define HDmblen(S,N) mblen(S,N) #endif /* HDmblen */ #ifndef HDmbstowcs - #define HDmbstowcs(P,S,Z) mbstowcs(P,S,Z) + #define HDmbstowcs(P,S,Z) mbstowcs(P,S,Z) #endif /* HDmbstowcs */ #ifndef HDmbtowc - #define HDmbtowc(P,S,Z) mbtowc(P,S,Z) + #define HDmbtowc(P,S,Z) mbtowc(P,S,Z) #endif /* HDmbtowc */ #ifndef HDmemchr - #define HDmemchr(S,C,Z) memchr(S,C,Z) + #define HDmemchr(S,C,Z) memchr(S,C,Z) #endif /* HDmemchr */ #ifndef HDmemcmp - #define HDmemcmp(X,Y,Z) memcmp(X,Y,Z) + #define HDmemcmp(X,Y,Z) memcmp(X,Y,Z) #endif /* HDmemcmp */ /* * The (char*) casts are required for the DEC when optimizations are turned * on and the source and/or destination are not aligned. */ #ifndef HDmemcpy - #define HDmemcpy(X,Y,Z) memcpy((char*)(X),(const char*)(Y),Z) + #define HDmemcpy(X,Y,Z) memcpy((char*)(X),(const char*)(Y),Z) #endif /* HDmemcpy */ #ifndef HDmemmove - #define HDmemmove(X,Y,Z) memmove((char*)(X),(const char*)(Y),Z) + #define HDmemmove(X,Y,Z) memmove((char*)(X),(const char*)(Y),Z) #endif /* HDmemmove */ #ifndef HDmemset - #define HDmemset(X,C,Z) memset(X,C,Z) + #define HDmemset(X,C,Z) memset(X,C,Z) #endif /* HDmemset */ #ifndef HDmkdir - #define HDmkdir(S,M) mkdir(S,M) + #define HDmkdir(S,M) mkdir(S,M) #endif /* HDmkdir */ #ifndef HDmkfifo - #define HDmkfifo(S,M) mkfifo(S,M) + #define HDmkfifo(S,M) mkfifo(S,M) #endif /* HDmkfifo */ #ifndef HDmktime - #define HDmktime(T) mktime(T) + #define HDmktime(T) mktime(T) #endif /* HDmktime */ #ifndef HDmodf - #define HDmodf(X,Y) modf(X,Y) + #define HDmodf(X,Y) modf(X,Y) #endif /* HDmodf */ #ifndef HDopen #ifdef _O_BINARY - #define HDopen(S,F,M) open(S,F|_O_BINARY,M) + #define HDopen(S,F,M) open(S,F|_O_BINARY,M) #else - #define HDopen(S,F,M) open(S,F,M) + #define HDopen(S,F,M) open(S,F,M) #endif #endif /* HDopen */ #ifndef HDopendir - #define HDopendir(S) opendir(S) + #define HDopendir(S) opendir(S) #endif /* HDopendir */ #ifndef HDpathconf - #define HDpathconf(S,N) pathconf(S,N) + #define HDpathconf(S,N) pathconf(S,N) #endif /* HDpathconf */ #ifndef HDpause - #define HDpause() pause() + #define HDpause() pause() #endif /* HDpause */ #ifndef HDperror - #define HDperror(S) perror(S) + #define HDperror(S) perror(S) #endif /* HDperror */ #ifndef HDpipe - #define HDpipe(F) pipe(F) + #define HDpipe(F) pipe(F) #endif /* HDpipe */ #ifndef HDpow - #define HDpow(X,Y) pow(X,Y) + #define HDpow(X,Y) pow(X,Y) #endif /* HDpow */ /* printf() variable arguments */ #ifndef HDputc - #define HDputc(C,F) putc(C,F) + #define HDputc(C,F) putc(C,F) #endif /* HDputc*/ #ifndef HDputchar - #define HDputchar(C) putchar(C) + #define HDputchar(C) putchar(C) #endif /* HDputchar */ #ifndef HDputs - #define HDputs(S) puts(S) + #define HDputs(S) puts(S) #endif /* HDputs */ #ifndef HDqsort - #define HDqsort(M,N,Z,F) qsort(M,N,Z,F) + #define HDqsort(M,N,Z,F) qsort(M,N,Z,F) #endif /* HDqsort*/ #ifndef HDraise - #define HDraise(N) raise(N) + #define HDraise(N) raise(N) #endif /* HDraise */ #ifdef H5_HAVE_RAND_R #ifndef HDrandom - #define HDrandom() HDrand() + #define HDrandom() HDrand() #endif /* HDrandom */ H5_DLL int HDrand(void); #elif H5_HAVE_RANDOM #ifndef HDrand - #define HDrand() random() + #define HDrand() random() #endif /* HDrand */ #ifndef HDrandom - #define HDrandom() random() + #define HDrandom() random() #endif /* HDrandom */ #else /* H5_HAVE_RANDOM */ #ifndef HDrand - #define HDrand() rand() + #define HDrand() rand() #endif /* HDrand */ #ifndef HDrandom - #define HDrandom() rand() + #define HDrandom() rand() #endif /* HDrandom */ #endif /* H5_HAVE_RANDOM */ #ifndef HDread - #define HDread(F,M,Z) read(F,M,Z) + #define HDread(F,M,Z) read(F,M,Z) #endif /* HDread */ #ifndef HDreaddir - #define HDreaddir(D) readdir(D) + #define HDreaddir(D) readdir(D) #endif /* HDreaddir */ #ifndef HDrealloc - #define HDrealloc(M,Z) realloc(M,Z) + #define HDrealloc(M,Z) realloc(M,Z) #endif /* HDrealloc */ #ifndef HDrealpath - #define HDrealpath(F1,F2) realpath(F1,F2) + #define HDrealpath(F1,F2) realpath(F1,F2) #endif /* HDrealloc */ #ifdef H5_VMS #ifdef __cplusplus @@ -1052,126 +1052,126 @@ H5_DLL int HDfprintf (FILE *stream, const char *fmt, ...); } #endif /* __cplusplus */ #ifndef HDremove - #define HDremove(S) HDremove_all(S) + #define HDremove(S) HDremove_all(S) #endif /* HDremove */ #else /* H5_VMS */ #ifndef HDremove - #define HDremove(S) remove(S) + #define HDremove(S) remove(S) #endif /* HDremove */ #endif /*H5_VMS*/ #ifndef HDrename - #define HDrename(OLD,NEW) rename(OLD,NEW) + #define HDrename(OLD,NEW) rename(OLD,NEW) #endif /* HDrename */ #ifndef HDrewind - #define HDrewind(F) rewind(F) + #define HDrewind(F) rewind(F) #endif /* HDrewind */ #ifndef HDrewinddir - #define HDrewinddir(D) rewinddir(D) + #define HDrewinddir(D) rewinddir(D) #endif /* HDrewinddir */ #ifndef HDrmdir - #define HDrmdir(S) rmdir(S) + #define HDrmdir(S) rmdir(S) #endif /* HDrmdir */ /* scanf() variable arguments */ #ifndef HDsetbuf - #define HDsetbuf(F,S) setbuf(F,S) + #define HDsetbuf(F,S) setbuf(F,S) #endif /* HDsetbuf */ #ifndef HDsetgid - #define HDsetgid(G) setgid(G) + #define HDsetgid(G) setgid(G) #endif /* HDsetgid */ #ifndef HDsetjmp - #define HDsetjmp(J) setjmp(J) + #define HDsetjmp(J) setjmp(J) #endif /* HDsetjmp */ #ifndef HDsetlocale - #define HDsetlocale(N,S) setlocale(N,S) + #define HDsetlocale(N,S) setlocale(N,S) #endif /* HDsetlocale */ #ifndef HDsetpgid - #define HDsetpgid(P,PG) setpgid(P,PG) + #define HDsetpgid(P,PG) setpgid(P,PG) #endif /* HDsetpgid */ #ifndef HDsetsid - #define HDsetsid() setsid() + #define HDsetsid() setsid() #endif /* HDsetsid */ #ifndef HDsetuid - #define HDsetuid(U) setuid(U) + #define HDsetuid(U) setuid(U) #endif /* HDsetuid */ #ifndef HDsetvbuf - #define HDsetvbuf(F,S,M,Z) setvbuf(F,S,M,Z) + #define HDsetvbuf(F,S,M,Z) setvbuf(F,S,M,Z) #endif /* HDsetvbuf */ #ifndef HDsigaddset - #define HDsigaddset(S,N) sigaddset(S,N) + #define HDsigaddset(S,N) sigaddset(S,N) #endif /* HDsigaddset */ #ifndef HDsigdelset - #define HDsigdelset(S,N) sigdelset(S,N) + #define HDsigdelset(S,N) sigdelset(S,N) #endif /* HDsigdelset */ #ifndef HDsigemptyset - #define HDsigemptyset(S) sigemptyset(S) + #define HDsigemptyset(S) sigemptyset(S) #endif /* HDsigemptyset */ #ifndef HDsigfillset - #define HDsigfillset(S) sigfillset(S) + #define HDsigfillset(S) sigfillset(S) #endif /* HDsigfillset */ #ifndef HDsigismember - #define HDsigismember(S,N) sigismember(S,N) + #define HDsigismember(S,N) sigismember(S,N) #endif /* HDsigismember */ #ifndef HDsiglongjmp - #define HDsiglongjmp(J,N) siglongjmp(J,N) + #define HDsiglongjmp(J,N) siglongjmp(J,N) #endif /* HDsiglongjmp */ #ifndef HDsignal - #define HDsignal(N,F) signal(N,F) + #define HDsignal(N,F) signal(N,F) #endif /* HDsignal */ #ifndef HDsigpending - #define HDsigpending(S) sigpending(S) + #define HDsigpending(S) sigpending(S) #endif /* HDsigpending */ #ifndef HDsigprocmask - #define HDsigprocmask(H,S,O) sigprocmask(H,S,O) + #define HDsigprocmask(H,S,O) sigprocmask(H,S,O) #endif /* HDsigprocmask */ #ifndef HDsigsetjmp - #define HDsigsetjmp(J,N) sigsetjmp(J,N) + #define HDsigsetjmp(J,N) sigsetjmp(J,N) #endif /* HDsigsetjmp */ #ifndef HDsigsuspend - #define HDsigsuspend(S) sigsuspend(S) + #define HDsigsuspend(S) sigsuspend(S) #endif /* HDsigsuspend */ #ifndef HDsin - #define HDsin(X) sin(X) + #define HDsin(X) sin(X) #endif /* HDsin */ #ifndef HDsinh - #define HDsinh(X) sinh(X) + #define HDsinh(X) sinh(X) #endif /* HDsinh */ #ifndef HDsleep - #define HDsleep(N) sleep(N) + #define HDsleep(N) sleep(N) #endif /* HDsleep */ #ifndef HDsnprintf - #define HDsnprintf snprintf /*varargs*/ + #define HDsnprintf snprintf /*varargs*/ #endif /* HDsnprintf */ /* sprintf() variable arguments */ #ifndef HDsqrt - #define HDsqrt(X) sqrt(X) + #define HDsqrt(X) sqrt(X) #endif /* HDsqrt */ #ifdef H5_HAVE_RAND_R H5_DLL void HDsrand(unsigned int seed); #ifndef HDsrandom - #define HDsrandom(S) HDsrand(S) + #define HDsrandom(S) HDsrand(S) #endif /* HDsrandom */ #elif H5_HAVE_RANDOM #ifndef HDsrand - #define HDsrand(S) srandom(S) + #define HDsrand(S) srandom(S) #endif /* HDsrand */ #ifndef HDsrandom - #define HDsrandom(S) srandom(S) + #define HDsrandom(S) srandom(S) #endif /* HDsrandom */ #else /* H5_HAVE_RAND_R */ #ifndef HDsrand - #define HDsrand(S) srand(S) + #define HDsrand(S) srand(S) #endif /* HDsrand */ #ifndef HDsrandom - #define HDsrandom(S) srand(S) + #define HDsrandom(S) srand(S) #endif /* HDsrandom */ #endif /* H5_HAVE_RAND_R */ /* sscanf() variable arguments */ #ifndef HDstrcat - #define HDstrcat(X,Y) strcat(X,Y) + #define HDstrcat(X,Y) strcat(X,Y) #endif /* HDstrcat */ #ifndef HDstrchr - #define HDstrchr(S,C) strchr(S,C) + #define HDstrchr(S,C) strchr(S,C) #endif /* HDstrchr */ #ifndef HDstrcmp #define HDstrcmp(X,Y) strcmp(X,Y) @@ -1180,181 +1180,181 @@ H5_DLL int HDfprintf (FILE *stream, const char *fmt, ...); #define HDstrcasecmp(X,Y) strcasecmp(X,Y) #endif /* HDstrcasecmp */ #ifndef HDstrcoll - #define HDstrcoll(X,Y) strcoll(X,Y) + #define HDstrcoll(X,Y) strcoll(X,Y) #endif /* HDstrcoll */ #ifndef HDstrcpy - #define HDstrcpy(X,Y) strcpy(X,Y) + #define HDstrcpy(X,Y) strcpy(X,Y) #endif /* HDstrcpy */ #ifndef HDstrcspn - #define HDstrcspn(X,Y) strcspn(X,Y) + #define HDstrcspn(X,Y) strcspn(X,Y) #endif /* HDstrcspn */ #ifndef HDstrerror - #define HDstrerror(N) strerror(N) + #define HDstrerror(N) strerror(N) #endif /* HDstrerror */ #ifndef HDstrftime - #define HDstrftime(S,Z,F,T) strftime(S,Z,F,T) + #define HDstrftime(S,Z,F,T) strftime(S,Z,F,T) #endif /* HDstrftime */ #ifndef HDstrlen - #define HDstrlen(S) strlen(S) + #define HDstrlen(S) strlen(S) #endif /* HDstrlen */ #ifndef HDstrncat - #define HDstrncat(X,Y,Z) strncat(X,Y,Z) + #define HDstrncat(X,Y,Z) strncat(X,Y,Z) #endif /* HDstrncat */ #ifndef HDstrncmp - #define HDstrncmp(X,Y,Z) strncmp(X,Y,Z) + #define HDstrncmp(X,Y,Z) strncmp(X,Y,Z) #endif /* HDstrncmp */ #ifndef HDstrncpy - #define HDstrncpy(X,Y,Z) strncpy(X,Y,Z) + #define HDstrncpy(X,Y,Z) strncpy(X,Y,Z) #endif /* HDstrncpy */ #ifndef HDstrpbrk - #define HDstrpbrk(X,Y) strpbrk(X,Y) + #define HDstrpbrk(X,Y) strpbrk(X,Y) #endif /* HDstrpbrk */ #ifndef HDstrrchr - #define HDstrrchr(S,C) strrchr(S,C) + #define HDstrrchr(S,C) strrchr(S,C) #endif /* HDstrrchr */ #ifndef HDstrspn - #define HDstrspn(X,Y) strspn(X,Y) + #define HDstrspn(X,Y) strspn(X,Y) #endif /* HDstrspn */ #ifndef HDstrstr - #define HDstrstr(X,Y) strstr(X,Y) + #define HDstrstr(X,Y) strstr(X,Y) #endif /* HDstrstr */ #ifndef HDstrtod - #define HDstrtod(S,R) strtod(S,R) + #define HDstrtod(S,R) strtod(S,R) #endif /* HDstrtod */ #ifndef HDstrtok - #define HDstrtok(X,Y) strtok(X,Y) + #define HDstrtok(X,Y) strtok(X,Y) #endif /* HDstrtok */ #ifndef HDstrtol - #define HDstrtol(S,R,N) strtol(S,R,N) + #define HDstrtol(S,R,N) strtol(S,R,N) #endif /* HDstrtol */ H5_DLL int64_t HDstrtoll (const char *s, const char **rest, int base); #ifndef HDstrtoul - #define HDstrtoul(S,R,N) strtoul(S,R,N) + #define HDstrtoul(S,R,N) strtoul(S,R,N) #endif /* HDstrtoul */ #ifndef HDstrtoull - #define HDstrtoull(S,R,N) strtoull(S,R,N) + #define HDstrtoull(S,R,N) strtoull(S,R,N) #endif /* HDstrtoul */ #ifndef HDstrxfrm - #define HDstrxfrm(X,Y,Z) strxfrm(X,Y,Z) + #define HDstrxfrm(X,Y,Z) strxfrm(X,Y,Z) #endif /* HDstrxfrm */ #ifdef H5_HAVE_SYMLINK #ifndef HDsymlink - #define HDsymlink(F1,F2) symlink(F1,F2) + #define HDsymlink(F1,F2) symlink(F1,F2) #endif /* HDsymlink */ #endif /* H5_HAVE_SYMLINK */ #ifndef HDsysconf - #define HDsysconf(N) sysconf(N) + #define HDsysconf(N) sysconf(N) #endif /* HDsysconf */ #ifndef HDsystem - #define HDsystem(S) system(S) + #define HDsystem(S) system(S) #endif /* HDsystem */ #ifndef HDtan - #define HDtan(X) tan(X) + #define HDtan(X) tan(X) #endif /* HDtan */ #ifndef HDtanh - #define HDtanh(X) tanh(X) + #define HDtanh(X) tanh(X) #endif /* HDtanh */ #ifndef HDtcdrain - #define HDtcdrain(F) tcdrain(F) + #define HDtcdrain(F) tcdrain(F) #endif /* HDtcdrain */ #ifndef HDtcflow - #define HDtcflow(F,A) tcflow(F,A) + #define HDtcflow(F,A) tcflow(F,A) #endif /* HDtcflow */ #ifndef HDtcflush - #define HDtcflush(F,N) tcflush(F,N) + #define HDtcflush(F,N) tcflush(F,N) #endif /* HDtcflush */ #ifndef HDtcgetattr - #define HDtcgetattr(F,T) tcgetattr(F,T) + #define HDtcgetattr(F,T) tcgetattr(F,T) #endif /* HDtcgetattr */ #ifndef HDtcgetpgrp - #define HDtcgetpgrp(F) tcgetpgrp(F) + #define HDtcgetpgrp(F) tcgetpgrp(F) #endif /* HDtcgetpgrp */ #ifndef HDtcsendbreak - #define HDtcsendbreak(F,N) tcsendbreak(F,N) + #define HDtcsendbreak(F,N) tcsendbreak(F,N) #endif /* HDtcsendbreak */ #ifndef HDtcsetattr - #define HDtcsetattr(F,O,T) tcsetattr(F,O,T) + #define HDtcsetattr(F,O,T) tcsetattr(F,O,T) #endif /* HDtcsetattr */ #ifndef HDtcsetpgrp - #define HDtcsetpgrp(F,N) tcsetpgrp(F,N) + #define HDtcsetpgrp(F,N) tcsetpgrp(F,N) #endif /* HDtcsetpgrp */ #ifndef HDtime - #define HDtime(T) time(T) + #define HDtime(T) time(T) #endif /* HDtime */ #ifndef HDtimes - #define HDtimes(T) times(T) + #define HDtimes(T) times(T) #endif /* HDtimes*/ #ifndef HDtmpfile - #define HDtmpfile() tmpfile() + #define HDtmpfile() tmpfile() #endif /* HDtmpfile */ #ifndef HDtmpnam - #define HDtmpnam(S) tmpnam(S) + #define HDtmpnam(S) tmpnam(S) #endif /* HDtmpnam */ #ifndef HDtolower - #define HDtolower(C) tolower(C) + #define HDtolower(C) tolower(C) #endif /* HDtolower */ #ifndef HDtoupper - #define HDtoupper(C) toupper(C) + #define HDtoupper(C) toupper(C) #endif /* HDtoupper */ #ifndef HDttyname - #define HDttyname(F) ttyname(F) + #define HDttyname(F) ttyname(F) #endif /* HDttyname */ #ifndef HDtzset - #define HDtzset() tzset() + #define HDtzset() tzset() #endif /* HDtzset */ #ifndef HDumask - #define HDumask(N) umask(N) + #define HDumask(N) umask(N) #endif /* HDumask */ #ifndef HDuname - #define HDuname(S) uname(S) + #define HDuname(S) uname(S) #endif /* HDuname */ #ifndef HDungetc - #define HDungetc(C,F) ungetc(C,F) + #define HDungetc(C,F) ungetc(C,F) #endif /* HDungetc */ #ifndef HDunlink - #define HDunlink(S) unlink(S) + #define HDunlink(S) unlink(S) #endif /* HDunlink */ #ifndef HDutime - #define HDutime(S,T) utime(S,T) + #define HDutime(S,T) utime(S,T) #endif /* HDutime */ #ifndef HDva_arg - #define HDva_arg(A,T) va_arg(A,T) + #define HDva_arg(A,T) va_arg(A,T) #endif /* HDva_arg */ #ifndef HDva_end - #define HDva_end(A) va_end(A) + #define HDva_end(A) va_end(A) #endif /* HDva_end */ #ifndef HDva_start - #define HDva_start(A,P) va_start(A,P) + #define HDva_start(A,P) va_start(A,P) #endif /* HDva_start */ #ifndef HDvasprintf #define HDvasprintf(RET,FMT,A) vasprintf(RET,FMT,A) #endif /* HDvasprintf */ #ifndef HDvfprintf - #define HDvfprintf(F,FMT,A) vfprintf(F,FMT,A) + #define HDvfprintf(F,FMT,A) vfprintf(F,FMT,A) #endif /* HDvfprintf */ #ifndef HDvprintf - #define HDvprintf(FMT,A) vprintf(FMT,A) + #define HDvprintf(FMT,A) vprintf(FMT,A) #endif /* HDvprintf */ #ifndef HDvsprintf - #define HDvsprintf(S,FMT,A) vsprintf(S,FMT,A) + #define HDvsprintf(S,FMT,A) vsprintf(S,FMT,A) #endif /* HDvsprintf */ #ifndef HDvsnprintf #define HDvsnprintf(S,N,FMT,A) vsnprintf(S,N,FMT,A) #endif /* HDvsnprintf */ #ifndef HDwait - #define HDwait(W) wait(W) + #define HDwait(W) wait(W) #endif /* HDwait */ #ifndef HDwaitpid - #define HDwaitpid(P,W,O) waitpid(P,W,O) + #define HDwaitpid(P,W,O) waitpid(P,W,O) #endif /* HDwaitpid */ #ifndef HDwcstombs - #define HDwcstombs(S,P,Z) wcstombs(S,P,Z) + #define HDwcstombs(S,P,Z) wcstombs(S,P,Z) #endif /* HDwcstombs */ #ifndef HDwctomb - #define HDwctomb(S,C) wctomb(S,C) + #define HDwctomb(S,C) wctomb(S,C) #endif /* HDwctomb */ #ifndef HDwrite - #define HDwrite(F,M,Z) write(F,M,Z) + #define HDwrite(F,M,Z) write(F,M,Z) #endif /* HDwrite */ /* @@ -1453,9 +1453,9 @@ extern char *strdup(const char *s); #if defined(H5_HAVE_WINDOW_PATH) /* directory delimiter for Windows: slash and backslash are acceptable on Windows */ -#define DIR_SLASH_SEPC '/' -#define DIR_SEPC '\\' -#define DIR_SEPS "\\" +#define DIR_SLASH_SEPC '/' +#define DIR_SEPC '\\' +#define DIR_SEPS "\\" #define CHECK_DELIMITER(SS) ((SS == DIR_SEPC)||(SS == DIR_SLASH_SEPC)) #define CHECK_ABSOLUTE(NAME) ((isalpha(NAME[0])) && (NAME[1] == ':') && (CHECK_DELIMITER(NAME[2]))) #define CHECK_ABS_DRIVE(NAME) ((isalpha(NAME[0])) && (NAME[1] == ':')) @@ -1475,59 +1475,68 @@ extern char *strdup(const char *s); /* OpenVMS pathname: $:[path] * i.g. SYS$SYSUSERS:[LU.HDF5.SRC]H5system.c */ -#define DIR_SEPC '.' -#define DIR_SEPS "." +#define DIR_SEPC ']' +#define DIR_SEPS "]" #define CHECK_DELIMITER(SS) (SS == DIR_SEPC) #define CHECK_ABSOLUTE(NAME) (strrchr(NAME, ':') && strrchr(NAME, '[')) -#define CHECK_ABS_DRIVE(NAME) (0) -#define CHECK_ABS_PATH(NAME) (0) -#define GET_LAST_DELIMITER(NAME, ptr) ptr = strrchr(NAME, ']'); +#define CHECK_ABS_DRIVE(NAME) (0) +#define CHECK_ABS_PATH(NAME) (0) +#define GET_LAST_DELIMITER(NAME, ptr) ptr = strrchr(NAME, DIR_SEPC); #else -#define DIR_SEPC '/' -#define DIR_SEPS "/" +#define DIR_SEPC '/' +#define DIR_SEPS "/" #define CHECK_DELIMITER(SS) (SS == DIR_SEPC) #define CHECK_ABSOLUTE(NAME) (CHECK_DELIMITER(*NAME)) -#define CHECK_ABS_DRIVE(NAME) (0) -#define CHECK_ABS_PATH(NAME) (0) +#define CHECK_ABS_DRIVE(NAME) (0) +#define CHECK_ABS_PATH(NAME) (0) #define GET_LAST_DELIMITER(NAME, ptr) ptr = strrchr(NAME, DIR_SEPC); #endif -#define COLON_SEPC ':' +#define COLON_SEPC ':' +/* Use FUNC to safely handle variations of C99 __func__ keyword handling */ +#ifdef H5_HAVE_C99_FUNC +#define FUNC __func__ +#elif defined(H5_HAVE_FUNCTION) +#define FUNC __FUNCTION__ +#else +#error "We need __func__ or __FUNCTION__ to test function names!" +#endif + /* * These macros check whether debugging has been requested for a certain - * package at run-time. Code for debugging is conditionally compiled by - * defining constants like `H5X_DEBUG'. In order to see the output though + * package at run-time. Code for debugging is conditionally compiled by + * defining constants like `H5X_DEBUG'. In order to see the output though * the code must be enabled at run-time with an environment variable * HDF5_DEBUG which is a list of packages to debug. * * Note: If you add/remove items from this enum then be sure to update the - * information about the package in H5_init_library(). + * information about the package in H5_init_library(). */ typedef enum { - H5_PKG_A, /*Attributes */ - H5_PKG_AC, /*Meta data cache */ - H5_PKG_B, /*B-trees */ - H5_PKG_D, /*Datasets */ - H5_PKG_E, /*Error handling */ - H5_PKG_F, /*Files */ - H5_PKG_G, /*Groups */ - H5_PKG_HG, /*Global heap */ - H5_PKG_HL, /*Local heap */ - H5_PKG_I, /*Interface */ - H5_PKG_MF, /*File memory management */ - H5_PKG_MM, /*Core memory management */ - H5_PKG_O, /*Object headers */ - H5_PKG_P, /*Property lists */ - H5_PKG_S, /*Data spaces */ - H5_PKG_T, /*Data types */ - H5_PKG_V, /*Vector functions */ - H5_PKG_Z, /*Raw data filters */ - H5_NPKGS /*Must be last */ + H5_PKG_A, /*Attributes */ + H5_PKG_AC, /*Meta data cache */ + H5_PKG_B, /*B-trees */ + H5_PKG_D, /*Datasets */ + H5_PKG_E, /*Error handling */ + H5_PKG_F, /*Files */ + H5_PKG_G, /*Groups */ + H5_PKG_HG, /*Global heap */ + H5_PKG_HL, /*Local heap */ + H5_PKG_I, /*Interface */ + H5_PKG_MF, /*File memory management */ + H5_PKG_MM, /*Core memory management */ + H5_PKG_O, /*Object headers */ + H5_PKG_P, /*Property lists */ + H5_PKG_S, /*Data spaces */ + H5_PKG_T, /*Data types */ + H5_PKG_V, /*Vector functions */ + H5_PKG_Z, /*Raw data filters */ + H5_NPKGS /*Must be last */ } H5_pkg_t; typedef struct H5_debug_open_stream_t { @@ -1536,58 +1545,58 @@ typedef struct H5_debug_open_stream_t { } H5_debug_open_stream_t; typedef struct H5_debug_t { - FILE *trace; /*API trace output stream */ + FILE *trace; /*API trace output stream */ hbool_t ttop; /*Show only top-level calls? */ hbool_t ttimes; /*Show trace event times? */ struct { - const char *name; /*package name */ - FILE *stream; /*output stream or NULL */ + const char *name; /*package name */ + FILE *stream; /*output stream or NULL */ } pkg[H5_NPKGS]; H5_debug_open_stream_t *open_stream; /* Stack of open output streams */ } H5_debug_t; -extern H5_debug_t H5_debug_g; -#define H5DEBUG(X) (H5_debug_g.pkg[H5_PKG_##X].stream) +extern H5_debug_t H5_debug_g; +#define H5DEBUG(X) (H5_debug_g.pkg[H5_PKG_##X].stream) /* Do not use const else AIX strings does not show it. */ extern char H5libhdf5_settings[]; /* embedded library information */ /*------------------------------------------------------------------------- - * Purpose: These macros are inserted automatically just after the - * FUNC_ENTER() macro of API functions and are used to trace - * application program execution. Unless H5_DEBUG_API has been - * defined they are no-ops. + * Purpose: These macros are inserted automatically just after the + * FUNC_ENTER() macro of API functions and are used to trace + * application program execution. Unless H5_DEBUG_API has been + * defined they are no-ops. * - * Arguments: R - Return type encoded as a string - * T - Argument types encoded as a string - * A0-An - Arguments. The number at the end of the macro name - * indicates the number of arguments. + * Arguments: R - Return type encoded as a string + * T - Argument types encoded as a string + * A0-An - Arguments. The number at the end of the macro name + * indicates the number of arguments. * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * * Modifications: *------------------------------------------------------------------------- */ #ifdef H5_DEBUG_API -#define H5TRACE_DECL const char *RTYPE=NULL; \ +#define H5TRACE_DECL const char *RTYPE=NULL; \ double CALLTIME; -#define H5TRACE0(R,T) RTYPE=R; \ - CALLTIME=H5_trace(NULL,FUNC,T) -#define H5TRACE1(R,T,A0) RTYPE=R; \ - CALLTIME=H5_trace(NULL,FUNC,T,#A0,A0) -#define H5TRACE2(R,T,A0,A1) RTYPE=R; \ - CALLTIME=H5_trace(NULL,FUNC,T,#A0,A0,#A1,A1) -#define H5TRACE3(R,T,A0,A1,A2) RTYPE=R; \ - CALLTIME=H5_trace(NULL,FUNC,T,#A0,A0,#A1,A1,#A2,A2) -#define H5TRACE4(R,T,A0,A1,A2,A3) RTYPE=R; \ - CALLTIME=H5_trace(NULL,FUNC,T,#A0,A0,#A1,A1,#A2,A2,#A3,A3) -#define H5TRACE5(R,T,A0,A1,A2,A3,A4) RTYPE=R; \ - CALLTIME=H5_trace(NULL,FUNC,T,#A0,A0,#A1,A1,#A2,A2,#A3,A3, \ +#define H5TRACE0(R,T) RTYPE=R; \ + CALLTIME=H5_trace(NULL,FUNC,T) +#define H5TRACE1(R,T,A0) RTYPE=R; \ + CALLTIME=H5_trace(NULL,FUNC,T,#A0,A0) +#define H5TRACE2(R,T,A0,A1) RTYPE=R; \ + CALLTIME=H5_trace(NULL,FUNC,T,#A0,A0,#A1,A1) +#define H5TRACE3(R,T,A0,A1,A2) RTYPE=R; \ + CALLTIME=H5_trace(NULL,FUNC,T,#A0,A0,#A1,A1,#A2,A2) +#define H5TRACE4(R,T,A0,A1,A2,A3) RTYPE=R; \ + CALLTIME=H5_trace(NULL,FUNC,T,#A0,A0,#A1,A1,#A2,A2,#A3,A3) +#define H5TRACE5(R,T,A0,A1,A2,A3,A4) RTYPE=R; \ + CALLTIME=H5_trace(NULL,FUNC,T,#A0,A0,#A1,A1,#A2,A2,#A3,A3, \ #A4,A4) -#define H5TRACE6(R,T,A0,A1,A2,A3,A4,A5) RTYPE=R; \ - CALLTIME=H5_trace(NULL,FUNC,T,#A0,A0,#A1,A1,#A2,A2,#A3,A3, \ +#define H5TRACE6(R,T,A0,A1,A2,A3,A4,A5) RTYPE=R; \ + CALLTIME=H5_trace(NULL,FUNC,T,#A0,A0,#A1,A1,#A2,A2,#A3,A3, \ #A4,A4,#A5,A5) #define H5TRACE7(R,T,A0,A1,A2,A3,A4,A5,A6) RTYPE=R; \ - CALLTIME=H5_trace(NULL,FUNC,T,#A0,A0,#A1,A1,#A2,A2,#A3,A3, \ + CALLTIME=H5_trace(NULL,FUNC,T,#A0,A0,#A1,A1,#A2,A2,#A3,A3, \ #A4,A4,#A5,A5,#A6,A6) #define H5TRACE8(R,T,A0,A1,A2,A3,A4,A5,A6,A7) RTYPE=R; \ CALLTIME=H5_trace(NULL,FUNC,T,#A0,A0,#A1,A1,#A2,A2,#A3,A3, \ @@ -1602,48 +1611,46 @@ extern char H5libhdf5_settings[]; /* embedded library information */ CALLTIME=H5_trace(NULL,FUNC,T,#A0,A0,#A1,A1,#A2,A2,#A3,A3, \ #A4,A4,#A5,A5,#A6,A6,#A7,A7,#A8,A8,#A9,A9, \ #A10,A10) -#define H5TRACE_RETURN(V) if (RTYPE) { \ - H5_trace(&CALLTIME,FUNC,RTYPE,NULL,V); \ - RTYPE=NULL; \ - } +#define H5TRACE_RETURN(V) if (RTYPE) { \ + H5_trace(&CALLTIME,FUNC,RTYPE,NULL,V); \ + RTYPE=NULL; \ + } #else -#define H5TRACE_DECL /*void*/ -#define H5TRACE0(R,T) /*void*/ -#define H5TRACE1(R,T,A0) /*void*/ -#define H5TRACE2(R,T,A0,A1) /*void*/ -#define H5TRACE3(R,T,A0,A1,A2) /*void*/ -#define H5TRACE4(R,T,A0,A1,A2,A3) /*void*/ -#define H5TRACE5(R,T,A0,A1,A2,A3,A4) /*void*/ -#define H5TRACE6(R,T,A0,A1,A2,A3,A4,A5) /*void*/ +#define H5TRACE_DECL /*void*/ +#define H5TRACE0(R,T) /*void*/ +#define H5TRACE1(R,T,A0) /*void*/ +#define H5TRACE2(R,T,A0,A1) /*void*/ +#define H5TRACE3(R,T,A0,A1,A2) /*void*/ +#define H5TRACE4(R,T,A0,A1,A2,A3) /*void*/ +#define H5TRACE5(R,T,A0,A1,A2,A3,A4) /*void*/ +#define H5TRACE6(R,T,A0,A1,A2,A3,A4,A5) /*void*/ #define H5TRACE7(R,T,A0,A1,A2,A3,A4,A5,A6) /*void*/ #define H5TRACE8(R,T,A0,A1,A2,A3,A4,A5,A6,A7) /*void*/ #define H5TRACE9(R,T,A0,A1,A2,A3,A4,A5,A6,A7,A8) /*void*/ #define H5TRACE10(R,T,A0,A1,A2,A3,A4,A5,A6,A7,A8,A9) /*void*/ #define H5TRACE11(R,T,A0,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10) /*void*/ -#define H5TRACE_RETURN(V) /*void*/ +#define H5TRACE_RETURN(V) /*void*/ #endif H5_DLL double H5_trace(const double *calltime, const char *func, const char *type, ...); /*------------------------------------------------------------------------- - * Purpose: Register function entry for library initialization and code - * profiling. - * - * Notes: Every file must have a file-scope variable called - * `initialize_interface_g' of type hbool_t which is initialized - * to FALSE. + * Purpose: Register function entry for library initialization and code + * profiling. * - * Don't use local variable initializers which contain - * calls to other library functions since the initializer - * would happen before the FUNC_ENTER() gets called. Don't - * use initializers that require special cleanup code to - * execute if FUNC_ENTER() fails since a failing FUNC_ENTER() - * returns immediately without branching to the `done' label. + * Notes: Every file must have a file-scope variable called + * `initialize_interface_g' of type hbool_t which is initialized + * to FALSE. * - * Programmer: Quincey Koziol + * Don't use local variable initializers which contain + * calls to other library functions since the initializer + * would happen before the FUNC_ENTER() gets called. Don't + * use initializers that require special cleanup code to + * execute if FUNC_ENTER() fails since a failing FUNC_ENTER() + * returns immediately without branching to the `done' label. * - * Modifications: + * Programmer: Quincey Koziol * *------------------------------------------------------------------------- */ @@ -1652,8 +1659,26 @@ H5_DLL double H5_trace(const double *calltime, const char *func, const char *typ /* an API function */ #define H5_IS_API(S) ('_'!=((const char *)S)[2] && '_'!=((const char *)S)[3] && (!((const char *)S)[4] || '_'!=((const char *)S)[4])) +/* `S' is the name of a function which is being tested to check if it's */ +/* a public API function */ +#define H5_IS_PUB(S) (((HDisdigit(S[1]) || HDisupper(S[1])) && HDislower(S[2])) || \ + ((HDisdigit(S[2]) || HDisupper(S[2])) && HDislower(S[3])) || \ + (!S[4] || ((HDisdigit(S[3]) || HDisupper(S[3])) && HDislower(S[4])))) + +/* `S' is the name of a function which is being tested to check if it's */ +/* a private library function */ +#define H5_IS_PRIV(S) (((HDisdigit(S[1]) || HDisupper(S[1])) && '_' == S[2] && HDislower(S[3])) || \ + ((HDisdigit(S[2]) || HDisupper(S[2])) && '_' == S[3] && HDislower(S[4])) || \ + ((HDisdigit(S[3]) || HDisupper(S[3])) && '_' == S[4] && HDislower(S[5]))) + +/* `S' is the name of a function which is being tested to check if it's */ +/* a package private function */ +#define H5_IS_PKG(S) (((HDisdigit(S[1]) || HDisupper(S[1])) && '_' == S[2] && '_' == S[3] && HDislower(S[4])) || \ + ((HDisdigit(S[2]) || HDisupper(S[2])) && '_' == S[3] && '_' == S[4] && HDislower(S[5])) || \ + ((HDisdigit(S[3]) || HDisupper(S[3])) && '_' == S[4] && '_' == S[5] && HDislower(S[6]))) + /* global library version information string */ -extern char H5_lib_vers_info_g[]; +extern char H5_lib_vers_info_g[]; /* Lock headers */ #ifdef H5_HAVE_THREADSAFE @@ -1718,10 +1743,10 @@ extern hbool_t H5_libinit_g; /* Has the library been initialized? */ /* Include required function stack header */ #include "H5CSprivate.h" -#define H5_PUSH_FUNC(func_name) H5CS_push(func_name); +#define H5_PUSH_FUNC H5CS_push(FUNC); #define H5_POP_FUNC H5CS_pop(); #else /* H5_HAVE_CODESTACK */ -#define H5_PUSH_FUNC(func_name) /* void */ +#define H5_PUSH_FUNC /* void */ #define H5_POP_FUNC /* void */ #endif /* H5_HAVE_CODESTACK */ @@ -1729,28 +1754,19 @@ extern hbool_t H5_libinit_g; /* Has the library been initialized? */ extern hbool_t H5_MPEinit_g; /* Has the MPE Library been initialized? */ #endif -/* Check if the function name is correct (if the compiler supports __FUNCTION__) */ -#ifdef H5_HAVE_FUNCTION -#define H5_CHECK_FUNCNAME(func_name) \ - assert(!HDstrcmp(#func_name, __FUNCTION__)) -#else /* H5_HAVE_FUNCTION */ -#define H5_CHECK_FUNCNAME(func_name) \ - assert(func_name) -#endif /* H5_HAVE_FUNCTION */ - /* Macros for defining interface initialization routines */ #ifdef H5_INTERFACE_INIT_FUNC -static int H5_interface_initialize_g = 0; -static herr_t H5_INTERFACE_INIT_FUNC(void); -#define H5_INTERFACE_INIT(err) \ - /* Initialize this interface or bust */ \ - if (!H5_interface_initialize_g) { \ - H5_interface_initialize_g = 1; \ - if (H5_INTERFACE_INIT_FUNC()<0) { \ - H5_interface_initialize_g = 0; \ - HGOTO_ERROR (H5E_FUNC, H5E_CANTINIT, err, \ - "interface initialization failed") \ - } \ +static int H5_interface_initialize_g = 0; +static herr_t H5_INTERFACE_INIT_FUNC(void); +#define H5_INTERFACE_INIT(err) \ + /* Initialize this interface or bust */ \ + if (!H5_interface_initialize_g) { \ + H5_interface_initialize_g = 1; \ + if (H5_INTERFACE_INIT_FUNC()<0) { \ + H5_interface_initialize_g = 0; \ + HGOTO_ERROR (H5E_FUNC, H5E_CANTINIT, err, \ + "interface initialization failed") \ + } \ } #else /* H5_INTERFACE_INIT_FUNC */ #define H5_INTERFACE_INIT(err) @@ -1758,83 +1774,81 @@ static herr_t H5_INTERFACE_INIT_FUNC(void); #ifndef NDEBUG -#define FUNC_ENTER_COMMON_NOFUNC(func_name,asrt) \ - static hbool_t func_check = FALSE; \ - \ - if(!func_check) { \ - /* Check API status */ \ - HDassert(asrt); \ - \ - /* Check function name */ \ - H5_CHECK_FUNCNAME(func_name); \ - \ - /* Don't check again */ \ - func_check = TRUE; \ - } /* end if */ +#define FUNC_ENTER_CHECK_NAME(asrt) \ + { \ + static hbool_t func_check = FALSE; \ + \ + if(!func_check) { \ + /* Check function naming status */ \ + HDassert(asrt); \ + \ + /* Don't check again */ \ + func_check = TRUE; \ + } /* end if */ \ + } /* end scope */ #else /* NDEBUG */ -#define FUNC_ENTER_COMMON_NOFUNC(func_name,asrt) +#define FUNC_ENTER_CHECK_NAME(asrt) #endif /* NDEBUG */ -#define FUNC_ENTER_COMMON(func_name, asrt) \ - static const char FUNC[] = #func_name; \ - hbool_t err_occurred = FALSE; \ - FUNC_ENTER_COMMON_NOFUNC(func_name, asrt); -#define FUNC_ENTER_COMMON_NOERR(func_name, asrt) \ - static const char FUNC[] = #func_name; \ - FUNC_ENTER_COMMON_NOFUNC(func_name, asrt); +#define FUNC_ENTER_COMMON(asrt) \ + hbool_t err_occurred = FALSE; \ + FUNC_ENTER_CHECK_NAME(asrt); + +#define FUNC_ENTER_COMMON_NOERR(asrt) \ + FUNC_ENTER_CHECK_NAME(asrt); /* Threadsafety initialization code for API routines */ #define FUNC_ENTER_API_THREADSAFE \ - /* Initialize the thread-safe code */ \ + /* Initialize the thread-safe code */ \ H5_FIRST_THREAD_INIT \ - \ - /* Grab the mutex for the library */ \ + \ + /* Grab the mutex for the library */ \ H5_API_UNSET_CANCEL \ H5_API_LOCK /* Local variables for API routines */ -#define FUNC_ENTER_API_VARS(func_name) \ - MPE_LOG_VARS(func_name) \ +#define FUNC_ENTER_API_VARS \ + MPE_LOG_VARS \ H5TRACE_DECL -#define FUNC_ENTER_API_COMMON(func_name) \ - FUNC_ENTER_API_VARS(func_name) \ - FUNC_ENTER_COMMON(func_name, H5_IS_API(#func_name)); \ +#define FUNC_ENTER_API_COMMON \ + FUNC_ENTER_API_VARS \ + FUNC_ENTER_COMMON(H5_IS_API(FUNC)); \ FUNC_ENTER_API_THREADSAFE; -#define FUNC_ENTER_API_INIT(func_name,err) \ - /* Initialize the library */ \ +#define FUNC_ENTER_API_INIT(err) \ + /* Initialize the library */ \ if(!(H5_INIT_GLOBAL)) { \ H5_INIT_GLOBAL = TRUE; \ - if(H5_init_library() < 0) \ - HGOTO_ERROR(H5E_FUNC, H5E_CANTINIT, err, \ - "library initialization failed") \ - } \ + if(H5_init_library() < 0) \ + HGOTO_ERROR(H5E_FUNC, H5E_CANTINIT, err, \ + "library initialization failed") \ + } \ \ - /* Initialize the interface, if appropriate */ \ - H5_INTERFACE_INIT(err) \ + /* Initialize the interface, if appropriate */ \ + H5_INTERFACE_INIT(err) \ \ /* Push the name of this function on the function stack */ \ - H5_PUSH_FUNC(#func_name) \ + H5_PUSH_FUNC \ \ - BEGIN_MPE_LOG(func_name) + BEGIN_MPE_LOG /* Use this macro for all "normal" API functions */ -#define FUNC_ENTER_API(func_name,err) {{ \ - FUNC_ENTER_API_COMMON(func_name) \ - FUNC_ENTER_API_INIT(func_name,err); \ - /* Clear thread error stack entering public functions */ \ - H5E_clear_stack(NULL); \ +#define FUNC_ENTER_API(err) {{ \ + FUNC_ENTER_API_COMMON \ + FUNC_ENTER_API_INIT(err); \ + /* Clear thread error stack entering public functions */ \ + H5E_clear_stack(NULL); \ { /* * Use this macro for API functions that shouldn't clear the error stack * like H5Eprint and H5Ewalk. */ -#define FUNC_ENTER_API_NOCLEAR(func_name,err) {{ \ - FUNC_ENTER_API_COMMON(func_name) \ - FUNC_ENTER_API_INIT(func_name,err); \ +#define FUNC_ENTER_API_NOCLEAR(err) {{ \ + FUNC_ENTER_API_COMMON \ + FUNC_ENTER_API_INIT(err); \ { /* @@ -1843,10 +1857,10 @@ static herr_t H5_INTERFACE_INIT_FUNC(void); * are: H5check_version, etc. * */ -#define FUNC_ENTER_API_NOINIT(func_name) {{ \ - FUNC_ENTER_API_COMMON(func_name) \ - H5_PUSH_FUNC(#func_name) \ - BEGIN_MPE_LOG(func_name); \ +#define FUNC_ENTER_API_NOINIT {{ \ + FUNC_ENTER_API_COMMON \ + H5_PUSH_FUNC \ + BEGIN_MPE_LOG \ { /* @@ -1856,50 +1870,55 @@ static herr_t H5_INTERFACE_INIT_FUNC(void); * are: H5close, H5check_version, etc. * */ -#define FUNC_ENTER_API_NOINIT_NOERR_NOFS(func_name) {{ \ - FUNC_ENTER_API_VARS(func_name) \ - FUNC_ENTER_COMMON_NOERR(func_name, H5_IS_API(#func_name)); \ - FUNC_ENTER_API_THREADSAFE; \ - BEGIN_MPE_LOG(func_name); \ +#define FUNC_ENTER_API_NOINIT_NOERR_NOFS {{ \ + FUNC_ENTER_API_VARS \ + FUNC_ENTER_COMMON_NOERR(H5_IS_API(FUNC)); \ + FUNC_ENTER_API_THREADSAFE; \ + BEGIN_MPE_LOG \ { /* Note: this macro only works when there's _no_ interface initialization routine for the module */ -#define FUNC_ENTER_NOAPI_INIT(func_name,err) \ - /* Initialize the interface, if appropriate */ \ - H5_INTERFACE_INIT(err) \ +#define FUNC_ENTER_NOAPI_INIT(err) \ + /* Initialize the interface, if appropriate */ \ + H5_INTERFACE_INIT(err) \ \ /* Push the name of this function on the function stack */ \ - H5_PUSH_FUNC(#func_name) + H5_PUSH_FUNC /* Use this macro for all "normal" non-API functions */ -#define FUNC_ENTER_NOAPI(func_name,err) { \ - FUNC_ENTER_COMMON(func_name, !H5_IS_API(#func_name)); \ - FUNC_ENTER_NOAPI_INIT(func_name,err) \ +#define FUNC_ENTER_NOAPI(err) { \ + FUNC_ENTER_COMMON(!H5_IS_API(FUNC)); \ + FUNC_ENTER_NOAPI_INIT(err) \ { -/* Use this macro for all non-API functions, which propagate errors, but don't issue them */ -#define FUNC_ENTER_NOAPI_NOERR(func_name,err) { \ - FUNC_ENTER_COMMON_NOERR(func_name, !H5_IS_API(#func_name)); \ - FUNC_ENTER_NOAPI_INIT(func_name,err) \ +/* Use this macro for all "normal" package-level functions */ +#define FUNC_ENTER_PACKAGE { \ + FUNC_ENTER_COMMON(H5_IS_PKG(FUNC)); \ + H5_PUSH_FUNC \ { -/* Use this macro for all non-API functions which don't issue errors */ -#define FUNC_ENTER_NOAPI_NOFUNC(func_name) { \ - FUNC_ENTER_COMMON_NOFUNC(func_name,!H5_IS_API(#func_name)); \ - FUNC_ENTER_NOAPI_INIT(func_name,err) \ +/* Use this macro for package-level functions which propgate errors, but don't issue them */ +#define FUNC_ENTER_PACKAGE_NOERR { \ + FUNC_ENTER_COMMON_NOERR(H5_IS_PKG(FUNC)); \ + H5_PUSH_FUNC \ { -/* - * Use this macro for non-API functions which fall into these categories: - * - static functions, since they must be called from a function in the - * interface, the library and interface must already be - * initialized. - * - functions which are called during library shutdown, since we don't - * want to re-initialize the library. - */ -#define FUNC_ENTER_NOAPI_NOINIT(func_name) { \ - FUNC_ENTER_COMMON(func_name, !H5_IS_API(#func_name)); \ - H5_PUSH_FUNC(#func_name) \ +/* Use the following macro as replacement for the FUNC_ENTER_PACKAGE + * macro when the function needs to set up a metadata tag. */ +#define FUNC_ENTER_PACKAGE_TAG(dxpl_id, tag, err) { \ + haddr_t prev_tag = HADDR_UNDEF; \ + hid_t tag_dxpl_id = dxpl_id; \ + \ + FUNC_ENTER_COMMON(H5_IS_PKG(FUNC)); \ + if(H5AC_tag(tag_dxpl_id, tag, &prev_tag) < 0) \ + HGOTO_ERROR(H5E_CACHE, H5E_CANTTAG, err, "unable to apply metadata tag") \ + H5_PUSH_FUNC \ + { + +/* Use this macro for all non-API functions, which propagate errors, but don't issue them */ +#define FUNC_ENTER_NOAPI_NOERR { \ + FUNC_ENTER_COMMON_NOERR(!H5_IS_API(FUNC)); \ + FUNC_ENTER_NOAPI_INIT(-) \ { /* @@ -1909,11 +1928,10 @@ static herr_t H5_INTERFACE_INIT_FUNC(void); * initialized. * - functions which are called during library shutdown, since we don't * want to re-initialize the library. - * - functions that propagate, but don't issue errors */ -#define FUNC_ENTER_NOAPI_NOINIT_NOERR(func_name) { \ - FUNC_ENTER_COMMON_NOERR(func_name, !H5_IS_API(#func_name)); \ - H5_PUSH_FUNC(#func_name) \ +#define FUNC_ENTER_NOAPI_NOINIT { \ + FUNC_ENTER_COMMON(!H5_IS_API(FUNC)); \ + H5_PUSH_FUNC \ { /* @@ -1923,14 +1941,11 @@ static herr_t H5_INTERFACE_INIT_FUNC(void); * initialized. * - functions which are called during library shutdown, since we don't * want to re-initialize the library. - * - * This macro is used for functions which fit the above categories _and_ - * also don't use the 'FUNC' variable (i.e. don't push errors on the error stack) - * + * - functions that propagate, but don't issue errors */ -#define FUNC_ENTER_NOAPI_NOINIT_NOFUNC(func_name) { \ - FUNC_ENTER_COMMON_NOFUNC(func_name,!H5_IS_API(#func_name)); \ - H5_PUSH_FUNC(#func_name) \ +#define FUNC_ENTER_NOAPI_NOINIT_NOERR { \ + FUNC_ENTER_COMMON_NOERR(!H5_IS_API(FUNC)); \ + H5_PUSH_FUNC \ { /* @@ -1942,37 +1957,37 @@ static herr_t H5_INTERFACE_INIT_FUNC(void); * also don't use the 'FUNC' variable (i.e. don't push errors on the error stack) * */ -#define FUNC_ENTER_NOAPI_NOFUNC_NOFS(func_name) { \ - FUNC_ENTER_COMMON_NOFUNC(func_name,!H5_IS_API(#func_name)); \ +#define FUNC_ENTER_NOAPI_NOERR_NOFS { \ + FUNC_ENTER_COMMON_NOERR(!H5_IS_API(FUNC)); \ { /* Use the following two macros as replacements for the FUNC_ENTER_NOAPI * and FUNC_ENTER_NOAPI_NOINIT macros when the function needs to set * up a metadata tag. */ -#define FUNC_ENTER_NOAPI_TAG(func_name, dxpl_id, tag, err) { \ +#define FUNC_ENTER_NOAPI_TAG(dxpl_id, tag, err) { \ haddr_t prev_tag = HADDR_UNDEF; \ hid_t tag_dxpl_id = dxpl_id; \ - FUNC_ENTER_COMMON(func_name, !H5_IS_API(#func_name)); \ + FUNC_ENTER_COMMON(!H5_IS_API(FUNC)); \ if(H5AC_tag(tag_dxpl_id, tag, &prev_tag)<0) \ HGOTO_ERROR(H5E_CACHE, H5E_CANTTAG, err, "unable to apply metadata tag") \ - FUNC_ENTER_NOAPI_INIT(func_name,err) \ + FUNC_ENTER_NOAPI_INIT(err) \ { -#define FUNC_ENTER_NOAPI_NOINIT_TAG(func_name, dxpl_id, tag, err) { \ +#define FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, tag, err) { \ haddr_t prev_tag = HADDR_UNDEF; \ hid_t tag_dxpl_id = dxpl_id; \ - FUNC_ENTER_COMMON(func_name, !H5_IS_API(#func_name)); \ + FUNC_ENTER_COMMON(!H5_IS_API(FUNC)); \ if(H5AC_tag(tag_dxpl_id, tag, &prev_tag)<0) \ HGOTO_ERROR(H5E_CACHE, H5E_CANTTAG, err, "unable to apply metadata tag") \ - H5_PUSH_FUNC(#func_name) \ + H5_PUSH_FUNC \ { /*------------------------------------------------------------------------- - * Purpose: Register function exit for code profiling. This should be - * the last statement executed by a function. + * Purpose: Register function exit for code profiling. This should be + * the last statement executed by a function. * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * *------------------------------------------------------------------------- */ @@ -1982,34 +1997,34 @@ static herr_t H5_INTERFACE_INIT_FUNC(void); H5_API_SET_CANCEL #define FUNC_LEAVE_API(ret_value) \ - FINISH_MPE_LOG; \ - H5TRACE_RETURN(ret_value); \ + FINISH_MPE_LOG \ + H5TRACE_RETURN(ret_value); \ H5_POP_FUNC \ - if(err_occurred) \ - (void)H5E_dump_api_stack(TRUE); \ + if(err_occurred) \ + (void)H5E_dump_api_stack(TRUE); \ FUNC_LEAVE_API_THREADSAFE \ - return(ret_value); \ + return(ret_value); \ } /*end scope from end of FUNC_ENTER*/ \ }} /*end scope from beginning of FUNC_ENTER*/ /* Use this macro to match the FUNC_ENTER_API_NOFS macro */ #define FUNC_LEAVE_API_NOFS(ret_value) \ - FINISH_MPE_LOG; \ - H5TRACE_RETURN(ret_value); \ + FINISH_MPE_LOG \ + H5TRACE_RETURN(ret_value); \ FUNC_LEAVE_API_THREADSAFE \ - return(ret_value); \ + return(ret_value); \ } /*end scope from end of FUNC_ENTER*/ \ }} /*end scope from beginning of FUNC_ENTER*/ #define FUNC_LEAVE_NOAPI(ret_value) \ H5_POP_FUNC \ - return(ret_value); \ + return(ret_value); \ } /*end scope from end of FUNC_ENTER*/ \ } /*end scope from beginning of FUNC_ENTER*/ #define FUNC_LEAVE_NOAPI_VOID \ H5_POP_FUNC \ - return; \ + return; \ } /*end scope from end of FUNC_ENTER*/ \ } /*end scope from beginning of FUNC_ENTER*/ @@ -2019,7 +2034,7 @@ static herr_t H5_INTERFACE_INIT_FUNC(void); * (so far, just the H5CS routines themselves) */ #define FUNC_LEAVE_NOAPI_NOFS(ret_value) \ - return(ret_value); \ + return(ret_value); \ } /*end scope from end of FUNC_ENTER*/ \ } /*end scope from beginning of FUNC_ENTER*/ @@ -2028,7 +2043,7 @@ static herr_t H5_INTERFACE_INIT_FUNC(void); if(H5AC_tag(tag_dxpl_id, prev_tag, NULL)<0) \ HDONE_ERROR(H5E_CACHE, H5E_CANTTAG, err, "unable to apply metadata tag") \ H5_POP_FUNC \ - return(ret_value); \ + return(ret_value); \ } /*end scope from end of FUNC_ENTER*/ \ } /*end scope from beginning of FUNC_ENTER*/ @@ -2036,41 +2051,6 @@ static herr_t H5_INTERFACE_INIT_FUNC(void); /* Revisions to FUNC_ENTER/LEAVE Macros */ /****************************************/ -/* `S' is the name of a function which is being tested to check if it's */ -/* a public API function */ -#define H5_IS_PUB(S) (((HDisdigit(S[1]) || HDisupper(S[1])) && HDislower(S[2])) || \ - ((HDisdigit(S[2]) || HDisupper(S[2])) && HDislower(S[3])) || \ - (!S[4] || ((HDisdigit(S[3]) || HDisupper(S[3])) && HDislower(S[4])))) - -/* `S' is the name of a function which is being tested to check if it's */ -/* a private library function */ -#define H5_IS_PRIV(S) (((HDisdigit(S[1]) || HDisupper(S[1])) && '_' == S[2] && HDislower(S[3])) || \ - ((HDisdigit(S[2]) || HDisupper(S[2])) && '_' == S[3] && HDislower(S[4])) || \ - ((HDisdigit(S[3]) || HDisupper(S[3])) && '_' == S[4] && HDislower(S[5]))) - -/* `S' is the name of a function which is being tested to check if it's */ -/* a package private function */ -#define H5_IS_PKG(S) (((HDisdigit(S[1]) || HDisupper(S[1])) && '_' == S[2] && '_' == S[3] && HDislower(S[4])) || \ - ((HDisdigit(S[2]) || HDisupper(S[2])) && '_' == S[3] && '_' == S[4] && HDislower(S[5])) || \ - ((HDisdigit(S[3]) || HDisupper(S[3])) && '_' == S[4] && '_' == S[5] && HDislower(S[6]))) - -#ifndef NDEBUG -#define FUNC_ENTER_NAME_CHECK(asrt) \ - { \ - static hbool_t func_check = FALSE; \ - \ - if(!func_check) { \ - /* Check function naming status */ \ - HDassert(asrt); \ - \ - /* Don't check again */ \ - func_check = TRUE; \ - } /* end if */ \ - } /* end scope */ -#else /* NDEBUG */ -#define FUNC_ENTER_NAME_CHECK(asrt) -#endif /* NDEBUG */ - /* Macros for referencing package initialization symbols */ #define H5_PACKAGE_INIT_VAR(x) H5_GLUE3(H5_, x, _init_g) #define H5_PACKAGE_INIT_FUNC(x) H5_GLUE(x, __pkg_init) @@ -2082,14 +2062,14 @@ static herr_t H5_INTERFACE_INIT_FUNC(void); #define H5_CHECK_PACKAGE_INIT_INIT_NO(asrt) /* Macros to initialize package, if a package initialization routine is defined */ -#define H5_PKG_YES_INIT(pkg) \ - if(!H5_PACKAGE_INIT_VAR(pkg)) { \ - if(H5_GLUE(pkg, _pkg_init)() < 0) { \ - /* (Can't use H5E_THROW here) */ \ +#define H5_PKG_YES_INIT(pkg) \ + if(!H5_PACKAGE_INIT_VAR(pkg)) { \ + if(H5_GLUE(pkg, _pkg_init)() < 0) { \ + /* (Can't use H5E_THROW here) */ \ H5E_PRINTF(H5E_CANTINIT, "interface initialization failed"); \ - ret_value = fail_value; \ - goto func_init_failed; \ - } /* end if */ \ + ret_value = fail_value; \ + goto func_init_failed; \ + } /* end if */ \ } /* end if */ #define H5_PKG_NO_INIT(pkg) @@ -2110,113 +2090,104 @@ H5_DECLARE_PKG_FUNC(H5_MY_PKG_INIT, H5_MY_PKG) /* API re-entrance variable */ extern hbool_t H5_api_entered_g; /* Has library already been entered through API? */ -/* Use FUNCNAME to safely handle variations of C99 __func__ keyword handling */ -#ifdef H5_HAVE_C99_FUNC -#define FUNCNAME __func__ -#elif defined(H5_HAVE_FUNCTION) -#define FUNCNAME __FUNCTION__ -#else -#error "We need __func__ or __FUNCTION__ to test function names!" -#endif - /* Macros for entering different scopes of routines */ -#define H5_PACKAGE_ENTER(pkg, pkg_init, init) \ - FUNC_ENTER_NAME_CHECK(H5_IS_PKG(FUNCNAME)) \ +#define H5_PACKAGE_ENTER(pkg, pkg_init, init) \ + FUNC_ENTER_CHECK_NAME(H5_IS_PKG(FUNC)) \ \ - /* The library should be initialized already */ \ - HDassert(H5_INIT_GLOBAL); \ + /* The library should be initialized already */ \ + HDassert(H5_INIT_GLOBAL); \ \ - /* This interface should be initialized already */ \ - /* (except for package initialization routines :-) */ \ - H5_GLUE4(H5_CHECK_PACKAGE_INIT_, init, _, pkg_init)(pkg) \ + /* This interface should be initialized already */ \ + /* (except for package initialization routines :-) */ \ + H5_GLUE4(H5_CHECK_PACKAGE_INIT_, init, _, pkg_init)(pkg) \ \ - /* Push the name of this function on the function stack */ \ - H5_PUSH_FUNC(FUNCNAME) \ + /* Push the name of this function on the function stack */ \ + H5_PUSH_FUNC \ \ - /* Enter scope for this type of function */ \ + /* Enter scope for this type of function */ \ { -#define H5_PRIVATE_ENTER(pkg, pkg_init) \ - FUNC_ENTER_NAME_CHECK(H5_IS_PRIV(FUNCNAME)) \ +#define H5_PRIVATE_ENTER(pkg, pkg_init) \ + FUNC_ENTER_CHECK_NAME(H5_IS_PRIV(FUNC)) \ \ - /* The library should be initialized already */ \ - HDassert(H5_INIT_GLOBAL); \ + /* The library should be initialized already */ \ + HDassert(H5_INIT_GLOBAL); \ \ - /* Initialize this interface if desired */ \ - H5_GLUE3(H5_PKG_, pkg_init, _INIT)(pkg) \ + /* Initialize this interface if desired */ \ + H5_GLUE3(H5_PKG_, pkg_init, _INIT)(pkg) \ \ - /* Push the name of this function on the function stack */ \ - H5_PUSH_FUNC(FUNCNAME) \ + /* Push the name of this function on the function stack */ \ + H5_PUSH_FUNC \ \ - /* Enter scope for this type of function */ \ + /* Enter scope for this type of function */ \ {{ -#define H5_PUBLIC_ENTER(pkg, pkg_init) \ - FUNC_ENTER_API_VARS(FUNCNAME) \ +#define H5_PUBLIC_ENTER(pkg, pkg_init) \ + FUNC_ENTER_API_VARS \ FUNC_ENTER_API_THREADSAFE; \ - FUNC_ENTER_NAME_CHECK(H5_IS_PUB(FUNCNAME)) \ + FUNC_ENTER_CHECK_NAME(H5_IS_PUB(FUNC)) \ \ - /* Clear thread error stack when entering public functions */ \ - H5E_clear_stack(NULL); \ + /* Clear thread error stack when entering public functions */ \ + H5E_clear_stack(NULL); \ \ - /* Initialize the library or bust */ \ - if(!(H5_INIT_GLOBAL)) { \ + /* Initialize the library or bust */ \ + if(!(H5_INIT_GLOBAL)) { \ H5_INIT_GLOBAL = TRUE; \ - if(H5_init_library() < 0) { \ - /* (Can't use H5E_THROW here) */ \ + if(H5_init_library() < 0) { \ + /* (Can't use H5E_THROW here) */ \ H5E_PRINTF(H5E_CANTINIT, "interface initialization failed"); \ - ret_value = fail_value; \ - goto func_init_failed; \ - } /* end if */ \ - } /* end if */ \ + ret_value = fail_value; \ + goto func_init_failed; \ + } /* end if */ \ + } /* end if */ \ \ - /* Initialize this interface if desired */ \ - H5_GLUE3(H5_PKG_, pkg_init, _INIT)(pkg) \ + /* Initialize this interface if desired */ \ + H5_GLUE3(H5_PKG_, pkg_init, _INIT)(pkg) \ \ - /* Check for re-entering API routine */ \ - HDassert(!H5_api_entered_g); \ - H5_api_entered_g = TRUE; \ + /* Check for re-entering API routine */ \ + HDassert(!H5_api_entered_g); \ + H5_api_entered_g = TRUE; \ \ - /* Start logging MPI's MPE information */ \ - BEGIN_MPE_LOG(FUNCNAME) \ + /* Start logging MPI's MPE information */ \ + BEGIN_MPE_LOG \ \ - /* Push the name of this function on the function stack */ \ - H5_PUSH_FUNC(FUNCNAME) \ + /* Push the name of this function on the function stack */ \ + H5_PUSH_FUNC \ \ - /* Enter scope for this type of function */ \ + /* Enter scope for this type of function */ \ {{{ /* Macros for substituting the package name */ -#define FUNC_ENTER_STATIC H5_PACKAGE_ENTER(H5_MY_PKG, H5_MY_PKG_INIT, REG) -#define FUNC_ENTER_PKGINIT H5_PACKAGE_ENTER(H5_MY_PKG, H5_MY_PKG_INIT, INIT) -#define FUNC_ENTER_PKG H5_PACKAGE_ENTER(H5_MY_PKG, H5_MY_PKG_INIT, REG) -#define FUNC_ENTER_PRIV H5_PRIVATE_ENTER(H5_MY_PKG, H5_MY_PKG_INIT) -#define FUNC_ENTER_PUB H5_PUBLIC_ENTER(H5_MY_PKG, H5_MY_PKG_INIT) +#define FUNC_ENTER_STATIC H5_PACKAGE_ENTER(H5_MY_PKG, H5_MY_PKG_INIT, REG) +#define FUNC_ENTER_PKGINIT H5_PACKAGE_ENTER(H5_MY_PKG, H5_MY_PKG_INIT, INIT) +#define FUNC_ENTER_PKG H5_PACKAGE_ENTER(H5_MY_PKG, H5_MY_PKG_INIT, REG) +#define FUNC_ENTER_PRIV H5_PRIVATE_ENTER(H5_MY_PKG, H5_MY_PKG_INIT) +#define FUNC_ENTER_PUB H5_PUBLIC_ENTER(H5_MY_PKG, H5_MY_PKG_INIT) /* Macros for substituting a function prefix */ -#define FUNC_PREFIX_STATIC static +#define FUNC_PREFIX_STATIC static #define FUNC_PREFIX_PKGINIT #define FUNC_PREFIX_PKG #define FUNC_PREFIX_PRIV #define FUNC_PREFIX_PUB /* Macros for declaring error variables */ -#define FUNC_ERR_VAR_ERR(ret_typ, err) \ - hbool_t past_catch = FALSE; \ +#define FUNC_ERR_VAR_ERR(ret_typ, err) \ + hbool_t past_catch = FALSE; \ ret_typ fail_value = err; -#define FUNC_ERR_VAR_ERRCATCH(ret_typ, err) \ +#define FUNC_ERR_VAR_ERRCATCH(ret_typ, err) \ hbool_t past_catch = FALSE; #define FUNC_ERR_VAR_NOERR(ret_typ, err) /* Use this macro when entering all functions */ -#define BEGIN_FUNC(scope, use_err, ret_typ, ret_init, err, func) \ -H5_GLUE(FUNC_PREFIX_, scope) \ -ret_typ \ -func \ -/* Open function */ \ -{ \ - ret_typ ret_value = ret_init; \ - H5_GLUE(FUNC_ERR_VAR_, use_err)(ret_typ, err) \ +#define BEGIN_FUNC(scope, use_err, ret_typ, ret_init, err, func) \ +H5_GLUE(FUNC_PREFIX_, scope) \ +ret_typ \ +func \ +/* Open function */ \ +{ \ + ret_typ ret_value = ret_init; \ + H5_GLUE(FUNC_ERR_VAR_, use_err)(ret_typ, err) \ H5_GLUE(FUNC_ENTER_, scope) /* Macros for label when a function initialization can fail */ @@ -2225,73 +2196,73 @@ func \ #define H5_PRIV_FUNC_INIT_FAILED(pkg_init) H5_GLUE3(H5_PRIV_, pkg_init, _FUNC_INIT_FAILED) /* Macros for leaving different scopes of routines */ -#define FUNC_LEAVE_PKGINIT \ - /* Leave scope for this type of function */ \ - } \ +#define FUNC_LEAVE_PKGINIT \ + /* Leave scope for this type of function */ \ + } \ \ - /* Pop the name of this function off the function stack */ \ + /* Pop the name of this function off the function stack */ \ H5_POP_FUNC -#define FUNC_LEAVE_STATIC \ - /* Leave scope for this type of function */ \ - } \ +#define FUNC_LEAVE_STATIC \ + /* Leave scope for this type of function */ \ + } \ \ - /* Pop the name of this function off the function stack */ \ + /* Pop the name of this function off the function stack */ \ H5_POP_FUNC -#define FUNC_LEAVE_PKG \ - /* Leave scope for this type of function */ \ - } \ +#define FUNC_LEAVE_PKG \ + /* Leave scope for this type of function */ \ + } \ \ - /* Pop the name of this function off the function stack */ \ + /* Pop the name of this function off the function stack */ \ H5_POP_FUNC -#define FUNC_LEAVE_PRIV \ - /* Leave scope for this type of function */ \ - }} \ +#define FUNC_LEAVE_PRIV \ + /* Leave scope for this type of function */ \ + }} \ \ - /* Label for errors during FUNC_ENTER */ \ - H5_PRIV_FUNC_INIT_FAILED(H5_MY_PKG_INIT) \ + /* Label for errors during FUNC_ENTER */ \ + H5_PRIV_FUNC_INIT_FAILED(H5_MY_PKG_INIT) \ \ - /* Pop the name of this function off the function stack */ \ + /* Pop the name of this function off the function stack */ \ H5_POP_FUNC -#define FUNC_LEAVE_PUB \ - /* Leave scope for this type of function */ \ - }}} \ +#define FUNC_LEAVE_PUB \ + /* Leave scope for this type of function */ \ + }}} \ \ - /* Label for errors during FUNC_ENTER */ \ -func_init_failed: \ + /* Label for errors during FUNC_ENTER */ \ +func_init_failed: \ \ - /* Dump error stack if an error occurred during API routine */ \ - if(ret_value == fail_value) \ - (void)H5E_dump_api_stack(TRUE); \ + /* Dump error stack if an error occurred during API routine */ \ + if(ret_value == fail_value) \ + (void)H5E_dump_api_stack(TRUE); \ \ - /* Finish the API tracing info */ \ - H5TRACE_RETURN(ret_value); \ + /* Finish the API tracing info */ \ + H5TRACE_RETURN(ret_value); \ \ - /* Pop the name of this function off the function stack */ \ - H5_POP_FUNC \ + /* Pop the name of this function off the function stack */ \ + H5_POP_FUNC \ \ - /* Finish the MPE tracing info */ \ - FINISH_MPE_LOG; \ + /* Finish the MPE tracing info */ \ + FINISH_MPE_LOG \ \ - /* Check for leaving API routine */ \ - HDassert(H5_api_entered_g); \ - H5_api_entered_g = FALSE; \ + /* Check for leaving API routine */ \ + HDassert(H5_api_entered_g); \ + H5_api_entered_g = FALSE; \ \ - /* Release thread-safety semaphore */ \ + /* Release thread-safety semaphore */ \ FUNC_LEAVE_API_THREADSAFE /* Use this macro when leaving all functions */ -#define END_FUNC(scope) \ - /* Scope-specific function conclusion */ \ - H5_GLUE(FUNC_LEAVE_, scope) \ +#define END_FUNC(scope) \ + /* Scope-specific function conclusion */ \ + H5_GLUE(FUNC_LEAVE_, scope) \ \ - /* Leave routine */ \ - return(ret_value); \ + /* Leave routine */ \ + return(ret_value); \ \ - /* Close Function */ \ + /* Close Function */ \ } /* Macro to begin/end tagging (when FUNC_ENTER_*TAG macros are insufficient) */ diff --git a/src/H5public.h b/src/H5public.h index 29633d4..6253d63 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -75,10 +75,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 81 /* For tweaks, bug-fixes, or development */ +#define H5_VERS_RELEASE 111 /* For tweaks, bug-fixes, or development */ #define H5_VERS_SUBRELEASE "FA_a5" /* For pre-releases like snap0 */ /* Empty string for real releases. */ -#define H5_VERS_INFO "HDF5 library version: 1.9.81-FA_a5" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.9.111-FA_a5" /* Full version string */ #define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ H5_VERS_RELEASE) diff --git a/src/H5system.c b/src/H5system.c index afe07b0..bb1d2f1 100644 --- a/src/H5system.c +++ b/src/H5system.c @@ -15,11 +15,11 @@ /*------------------------------------------------------------------------- * - * Created: H5system.c - * Aug 21 2006 - * Quincey Koziol + * Created: H5system.c + * Aug 21 2006 + * Quincey Koziol * - * Purpose: System call wrapper implementations. + * Purpose: System call wrapper implementations. * *------------------------------------------------------------------------- */ @@ -32,9 +32,9 @@ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ -#include "H5Fprivate.h" /* File access */ -#include "H5MMprivate.h" /* Memory management */ +#include "H5private.h" /* Generic Functions */ +#include "H5Fprivate.h" /* File access */ +#include "H5MMprivate.h" /* Memory management */ #include "H5Eprivate.h" @@ -75,71 +75,71 @@ /*------------------------------------------------------------------------- - * Function: HDfprintf + * Function: HDfprintf * - * Purpose: Prints the optional arguments under the control of the format - * string FMT to the stream STREAM. This function takes the - * same format as fprintf(3c) with a few added features: + * Purpose: Prints the optional arguments under the control of the format + * string FMT to the stream STREAM. This function takes the + * same format as fprintf(3c) with a few added features: * - * The conversion modifier `H' refers to the size of an - * `hsize_t' or `hssize_t' type. For instance, "0x%018Hx" - * prints an `hsize_t' value as a hex number right justified and - * zero filled in an 18-character field. + * The conversion modifier `H' refers to the size of an + * `hsize_t' or `hssize_t' type. For instance, "0x%018Hx" + * prints an `hsize_t' value as a hex number right justified and + * zero filled in an 18-character field. * - * The conversion `a' refers to an `haddr_t' type. + * The conversion `a' refers to an `haddr_t' type. * - * Return: Success: Number of characters printed + * Return: Success: Number of characters printed * - * Failure: -1 + * Failure: -1 * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, April 9, 1998 * * Modifications: - * Robb Matzke, 1999-07-27 - * The `%a' format refers to an argument of `haddr_t' type - * instead of `haddr_t*' and the return value is correct. + * Robb Matzke, 1999-07-27 + * The `%a' format refers to an argument of `haddr_t' type + * instead of `haddr_t*' and the return value is correct. *------------------------------------------------------------------------- */ int HDfprintf(FILE *stream, const char *fmt, ...) { - int n=0, nout = 0; - int fwidth, prec; - int zerofill; - int leftjust; - int plussign; - int ldspace; - int prefix; - char modifier[8]; - int conv; - char *rest, format_templ[128]; - const char *s; - va_list ap; + int n=0, nout = 0; + int fwidth, prec; + int zerofill; + int leftjust; + int plussign; + int ldspace; + int prefix; + char modifier[8]; + int conv; + char *rest, format_templ[128]; + const char *s; + va_list ap; assert (stream); assert (fmt); va_start (ap, fmt); while (*fmt) { - fwidth = prec = 0; - zerofill = 0; - leftjust = 0; - plussign = 0; - prefix = 0; - ldspace = 0; - modifier[0] = '\0'; - - if ('%'==fmt[0] && '%'==fmt[1]) { - HDputc ('%', stream); - fmt += 2; - nout++; - } else if ('%'==fmt[0]) { - s = fmt + 1; - - /* Flags */ - while(HDstrchr ("-+ #", *s)) { - switch(*s) { + fwidth = prec = 0; + zerofill = 0; + leftjust = 0; + plussign = 0; + prefix = 0; + ldspace = 0; + modifier[0] = '\0'; + + if ('%'==fmt[0] && '%'==fmt[1]) { + HDputc ('%', stream); + fmt += 2; + nout++; + } else if ('%'==fmt[0]) { + s = fmt + 1; + + /* Flags */ + while(HDstrchr ("-+ #", *s)) { + switch(*s) { case '-': leftjust = 1; break; @@ -155,61 +155,61 @@ HDfprintf(FILE *stream, const char *fmt, ...) case '#': prefix = 1; break; - } /* end switch */ /*lint !e744 Switch statement doesn't _need_ default */ - s++; - } /* end while */ - - /* Field width */ - if (HDisdigit (*s)) { - zerofill = ('0'==*s); - fwidth = (int)HDstrtol (s, &rest, 10); - s = rest; - } else if ('*'==*s) { - fwidth = va_arg (ap, int); - if (fwidth<0) { - leftjust = 1; - fwidth = -fwidth; - } - s++; - } - - /* Precision */ - if ('.'==*s) { - s++; - if (HDisdigit (*s)) { - prec = (int)HDstrtol (s, &rest, 10); - s = rest; - } else if ('*'==*s) { - prec = va_arg (ap, int); - s++; - } - if (prec<1) prec = 1; - } - - /* Extra type modifiers */ - if (HDstrchr ("ZHhlqLI", *s)) { - switch (*s) { + } /* end switch */ /*lint !e744 Switch statement doesn't _need_ default */ + s++; + } /* end while */ + + /* Field width */ + if (HDisdigit (*s)) { + zerofill = ('0'==*s); + fwidth = (int)HDstrtol (s, &rest, 10); + s = rest; + } else if ('*'==*s) { + fwidth = va_arg (ap, int); + if (fwidth<0) { + leftjust = 1; + fwidth = -fwidth; + } + s++; + } + + /* Precision */ + if ('.'==*s) { + s++; + if (HDisdigit (*s)) { + prec = (int)HDstrtol (s, &rest, 10); + s = rest; + } else if ('*'==*s) { + prec = va_arg (ap, int); + s++; + } + if (prec<1) prec = 1; + } + + /* Extra type modifiers */ + if (HDstrchr ("ZHhlqLI", *s)) { + switch (*s) { /*lint --e{506} Don't issue warnings about constant value booleans */ /*lint --e{774} Don't issue warnings boolean within 'if' always evaluates false/true */ - case 'H': - if (sizeof(hsize_t)0) - sprintf (format_templ+HDstrlen(format_templ), "%d", fwidth); - if (prec>0) - sprintf (format_templ+HDstrlen(format_templ), ".%d", prec); - if (*modifier) - sprintf (format_templ+HDstrlen(format_templ), "%s", modifier); - sprintf (format_templ+HDstrlen(format_templ), "%c", conv); - - - /* Conversion */ - switch (conv) { - case 'd': - case 'i': - if (!HDstrcmp(modifier, "h")) { - short x = (short)va_arg (ap, int); - n = fprintf (stream, format_templ, x); - } else if (!*modifier) { - int x = va_arg (ap, int); - n = fprintf (stream, format_templ, x); - } else if (!HDstrcmp (modifier, "l")) { - long x = va_arg (ap, long); - n = fprintf (stream, format_templ, x); - } else { - int64_t x = va_arg(ap, int64_t); - n = fprintf (stream, format_templ, x); - } - break; - - case 'o': - case 'u': - case 'x': - case 'X': - if (!HDstrcmp (modifier, "h")) { - unsigned short x = (unsigned short)va_arg (ap, unsigned int); - n = fprintf (stream, format_templ, x); - } else if (!*modifier) { - unsigned int x = va_arg (ap, unsigned int); /*lint !e732 Loss of sign not really occuring */ - n = fprintf (stream, format_templ, x); - } else if (!HDstrcmp (modifier, "l")) { - unsigned long x = va_arg (ap, unsigned long); /*lint !e732 Loss of sign not really occuring */ - n = fprintf (stream, format_templ, x); - } else { - uint64_t x = va_arg(ap, uint64_t); /*lint !e732 Loss of sign not really occuring */ - n = fprintf (stream, format_templ, x); - } - break; - - case 'f': - case 'e': - case 'E': - case 'g': - case 'G': - if (!HDstrcmp (modifier, "h")) { - float x = (float) va_arg (ap, double); - n = fprintf (stream, format_templ, x); - } else if (!*modifier || !HDstrcmp (modifier, "l")) { - double x = va_arg (ap, double); - n = fprintf (stream, format_templ, x); - } else { - /* - * Some compilers complain when `long double' and - * `double' are the same thing. - */ + break; + } + s++; + } + + /* Conversion */ + conv = *s++; + + /* Create the format template */ + sprintf (format_templ, "%%%s%s%s%s%s", + leftjust?"-":"", plussign?"+":"", + ldspace?" ":"", prefix?"#":"", zerofill?"0":""); + if (fwidth>0) + sprintf (format_templ+HDstrlen(format_templ), "%d", fwidth); + if (prec>0) + sprintf (format_templ+HDstrlen(format_templ), ".%d", prec); + if (*modifier) + sprintf (format_templ+HDstrlen(format_templ), "%s", modifier); + sprintf (format_templ+HDstrlen(format_templ), "%c", conv); + + + /* Conversion */ + switch (conv) { + case 'd': + case 'i': + if (!HDstrcmp(modifier, "h")) { + short x = (short)va_arg (ap, int); + n = fprintf (stream, format_templ, x); + } else if (!*modifier) { + int x = va_arg (ap, int); + n = fprintf (stream, format_templ, x); + } else if (!HDstrcmp (modifier, "l")) { + long x = va_arg (ap, long); + n = fprintf (stream, format_templ, x); + } else { + int64_t x = va_arg(ap, int64_t); + n = fprintf (stream, format_templ, x); + } + break; + + case 'o': + case 'u': + case 'x': + case 'X': + if (!HDstrcmp (modifier, "h")) { + unsigned short x = (unsigned short)va_arg (ap, unsigned int); + n = fprintf (stream, format_templ, x); + } else if (!*modifier) { + unsigned int x = va_arg (ap, unsigned int); /*lint !e732 Loss of sign not really occuring */ + n = fprintf (stream, format_templ, x); + } else if (!HDstrcmp (modifier, "l")) { + unsigned long x = va_arg (ap, unsigned long); /*lint !e732 Loss of sign not really occuring */ + n = fprintf (stream, format_templ, x); + } else { + uint64_t x = va_arg(ap, uint64_t); /*lint !e732 Loss of sign not really occuring */ + n = fprintf (stream, format_templ, x); + } + break; + + case 'f': + case 'e': + case 'E': + case 'g': + case 'G': + if (!HDstrcmp (modifier, "h")) { + float x = (float) va_arg (ap, double); + n = fprintf (stream, format_templ, x); + } else if (!*modifier || !HDstrcmp (modifier, "l")) { + double x = va_arg (ap, double); + n = fprintf (stream, format_templ, x); + } else { + /* + * Some compilers complain when `long double' and + * `double' are the same thing. + */ #if H5_SIZEOF_LONG_DOUBLE != H5_SIZEOF_DOUBLE - long double x = va_arg (ap, long double); - n = fprintf (stream, format_templ, x); + long double x = va_arg (ap, long double); + n = fprintf (stream, format_templ, x); #else - double x = va_arg (ap, double); - n = fprintf (stream, format_templ, x); + double x = va_arg (ap, double); + n = fprintf (stream, format_templ, x); #endif - } - break; + } + break; - case 'a': + case 'a': { - haddr_t x = va_arg (ap, haddr_t); /*lint !e732 Loss of sign not really occuring */ - if (H5F_addr_defined(x)) { - sprintf(format_templ, "%%%s%s%s%s%s", - leftjust?"-":"", plussign?"+":"", - ldspace?" ":"", prefix?"#":"", - zerofill?"0":""); - if (fwidth>0) - sprintf(format_templ+HDstrlen(format_templ), "%d", fwidth); + haddr_t x = va_arg (ap, haddr_t); /*lint !e732 Loss of sign not really occuring */ + if (H5F_addr_defined(x)) { + sprintf(format_templ, "%%%s%s%s%s%s", + leftjust?"-":"", plussign?"+":"", + ldspace?" ":"", prefix?"#":"", + zerofill?"0":""); + if (fwidth>0) + sprintf(format_templ+HDstrlen(format_templ), "%d", fwidth); /*lint --e{506} Don't issue warnings about constant value booleans */ /*lint --e{774} Don't issue warnings boolean within 'if' always evaluates false/true */ - if (sizeof(x)==H5_SIZEOF_INT) { - HDstrcat(format_templ, "u"); - } else if (sizeof(x)==H5_SIZEOF_LONG) { - HDstrcat(format_templ, "lu"); - } else if (sizeof(x)==H5_SIZEOF_LONG_LONG) { - HDstrcat(format_templ, H5_PRINTF_LL_WIDTH); - HDstrcat(format_templ, "u"); - } - n = fprintf(stream, format_templ, x); - } else { - HDstrcpy(format_templ, "%"); - if (leftjust) + if (sizeof(x)==H5_SIZEOF_INT) { + HDstrcat(format_templ, "u"); + } else if (sizeof(x)==H5_SIZEOF_LONG) { + HDstrcat(format_templ, "lu"); + } else if (sizeof(x)==H5_SIZEOF_LONG_LONG) { + HDstrcat(format_templ, H5_PRINTF_LL_WIDTH); + HDstrcat(format_templ, "u"); + } + n = fprintf(stream, format_templ, x); + } else { + HDstrcpy(format_templ, "%"); + if (leftjust) HDstrcat(format_templ, "-"); - if (fwidth) - sprintf(format_templ+HDstrlen(format_templ), "%d", fwidth); - HDstrcat(format_templ, "s"); - fprintf(stream, format_templ, "UNDEF"); - } - } - break; - - case 'c': + if (fwidth) + sprintf(format_templ+HDstrlen(format_templ), "%d", fwidth); + HDstrcat(format_templ, "s"); + fprintf(stream, format_templ, "UNDEF"); + } + } + break; + + case 'c': { - char x = (char)va_arg (ap, int); - n = fprintf (stream, format_templ, x); - } - break; + char x = (char)va_arg (ap, int); + n = fprintf (stream, format_templ, x); + } + break; - case 's': - case 'p': + case 's': + case 'p': { - char *x = va_arg (ap, char*); /*lint !e64 Type mismatch not really occuring */ - n = fprintf (stream, format_templ, x); - } - break; + char *x = va_arg (ap, char*); /*lint !e64 Type mismatch not really occuring */ + n = fprintf (stream, format_templ, x); + } + break; - case 'n': + case 'n': format_templ[HDstrlen(format_templ)-1] = 'u'; n = fprintf (stream, format_templ, nout); - break; + break; case 't': { @@ -379,18 +379,18 @@ HDfprintf(FILE *stream, const char *fmt, ...) } break; - default: - HDfputs (format_templ, stream); - n = (int)HDstrlen (format_templ); - break; - } - nout += n; - fmt = s; - } else { - HDputc (*fmt, stream); - fmt++; - nout++; - } + default: + HDfputs (format_templ, stream); + n = (int)HDstrlen (format_templ); + break; + } + nout += n; + fmt = s; + } else { + HDputc (*fmt, stream); + fmt++; + nout++; + } } va_end (ap); return nout; @@ -398,43 +398,43 @@ HDfprintf(FILE *stream, const char *fmt, ...) /*------------------------------------------------------------------------- - * Function: HDstrtoll + * Function: HDstrtoll * - * Purpose: Converts the string S to an int64_t value according to the - * given BASE, which must be between 2 and 36 inclusive, or be - * the special value zero. + * Purpose: Converts the string S to an int64_t value according to the + * given BASE, which must be between 2 and 36 inclusive, or be + * the special value zero. * - * The string must begin with an arbitrary amount of white space - * (as determined by isspace(3c)) followed by a single optional + * The string must begin with an arbitrary amount of white space + * (as determined by isspace(3c)) followed by a single optional * `+' or `-' sign. If BASE is zero or 16 the string may then - * include a `0x' or `0X' prefix, and the number will be read in - * base 16; otherwise a zero BASE is taken as 10 (decimal) - * unless the next character is a `0', in which case it is taken - * as 8 (octal). - * - * The remainder of the string is converted to an int64_t in the - * obvious manner, stopping at the first character which is not - * a valid digit in the given base. (In bases above 10, the - * letter `A' in either upper or lower case represetns 10, `B' - * represents 11, and so forth, with `Z' representing 35.) - * - * If REST is not null, the address of the first invalid - * character in S is stored in *REST. If there were no digits - * at all, the original value of S is stored in *REST. Thus, if - * *S is not `\0' but **REST is `\0' on return the entire string - * was valid. - * - * Return: Success: The result. - * - * Failure: If the input string does not contain any - * digits then zero is returned and REST points - * to the original value of S. If an overflow - * or underflow occurs then the maximum or - * minimum possible value is returned and the - * global `errno' is set to ERANGE. If BASE is - * incorrect then zero is returned. - * - * Programmer: Robb Matzke + * include a `0x' or `0X' prefix, and the number will be read in + * base 16; otherwise a zero BASE is taken as 10 (decimal) + * unless the next character is a `0', in which case it is taken + * as 8 (octal). + * + * The remainder of the string is converted to an int64_t in the + * obvious manner, stopping at the first character which is not + * a valid digit in the given base. (In bases above 10, the + * letter `A' in either upper or lower case represetns 10, `B' + * represents 11, and so forth, with `Z' representing 35.) + * + * If REST is not null, the address of the first invalid + * character in S is stored in *REST. If there were no digits + * at all, the original value of S is stored in *REST. Thus, if + * *S is not `\0' but **REST is `\0' on return the entire string + * was valid. + * + * Return: Success: The result. + * + * Failure: If the input string does not contain any + * digits then zero is returned and REST points + * to the original value of S. If an overflow + * or underflow occurs then the maximum or + * minimum possible value is returned and the + * global `errno' is set to ERANGE. If BASE is + * incorrect then zero is returned. + * + * Programmer: Robb Matzke * Thursday, April 9, 1998 * * Modifications: @@ -444,13 +444,13 @@ HDfprintf(FILE *stream, const char *fmt, ...) int64_t HDstrtoll(const char *s, const char **rest, int base) { - int64_t sign=1, acc=0; - hbool_t overflow = FALSE; + int64_t sign=1, acc=0; + hbool_t overflow = FALSE; errno = 0; if (!s || (base && (base<2 || base>36))) { - if (rest) *rest = s; - return 0; + if (rest) *rest = s; + return 0; } /* Skip white space */ @@ -458,51 +458,51 @@ HDstrtoll(const char *s, const char **rest, int base) /* Optional minus or plus sign */ if ('+'==*s) { - s++; + s++; } else if ('-'==*s) { - sign = -1; - s++; + sign = -1; + s++; } /* Zero base prefix */ if (0==base && '0'==*s && ('x'==s[1] || 'X'==s[1])) { - base = 16; - s += 2; + base = 16; + s += 2; } else if (0==base && '0'==*s) { - base = 8; - s++; + base = 8; + s++; } else if (0==base) { - base = 10; + base = 10; } /* Digits */ while ((base<=10 && *s>='0' && *s<'0'+base) || - (base>10 && ((*s>='0' && *s<='9') || - (*s>='a' && *s<'a'+base-10) || - (*s>='A' && *s<'A'+base-10)))) { - if (!overflow) { - int64_t digit = 0; - if (*s>='0' && *s<='9') digit = *s - '0'; - else if (*s>='a' && *s<='z') digit = (*s-'a')+10; - else digit = (*s-'A')+10; - - if (acc*base+digit < acc) { - overflow = TRUE; - } else { - acc = acc*base + digit; - } - } - s++; + (base>10 && ((*s>='0' && *s<='9') || + (*s>='a' && *s<'a'+base-10) || + (*s>='A' && *s<'A'+base-10)))) { + if (!overflow) { + int64_t digit = 0; + if (*s>='0' && *s<='9') digit = *s - '0'; + else if (*s>='a' && *s<='z') digit = (*s-'a')+10; + else digit = (*s-'A')+10; + + if (acc*base+digit < acc) { + overflow = TRUE; + } else { + acc = acc*base + digit; + } + } + s++; } /* Overflow */ if (overflow) { - if (sign>0) { - acc = ((uint64_t)1<<(8*sizeof(int64_t)-1))-1; - } else { - acc = (int64_t)((uint64_t)1<<(8*sizeof(int64_t)-1)); - } - errno = ERANGE; + if (sign>0) { + acc = ((uint64_t)1<<(8*sizeof(int64_t)-1))-1; + } else { + acc = (int64_t)((uint64_t)1<<(8*sizeof(int64_t)-1)); + } + errno = ERANGE; } /* Return values */ @@ -513,20 +513,20 @@ HDstrtoll(const char *s, const char **rest, int base) /*------------------------------------------------------------------------- - * Function: HDrand/HDsrand + * Function: HDrand/HDsrand * - * Purpose: Wrapper function for rand. If rand_r exists on this system, - * use it. + * Purpose: Wrapper function for rand. If rand_r exists on this system, + * use it. * - * Wrapper function for srand. If rand_r is available, it will keep - * track of the seed locally instead of using srand() which modifies - * global state and can break other programs. + * Wrapper function for srand. If rand_r is available, it will keep + * track of the seed locally instead of using srand() which modifies + * global state and can break other programs. * - * Return: Success: Random number from 0 to RAND_MAX + * Return: Success: Random number from 0 to RAND_MAX * - * Failure: Cannot fail. + * Failure: Cannot fail. * - * Programmer: Leon Arber + * Programmer: Leon Arber * March 6, 2006. * *------------------------------------------------------------------------- @@ -548,17 +548,17 @@ void HDsrand(unsigned int seed) /*------------------------------------------------------------------------- - * Function: HDremove_all + * Function: HDremove_all * - * Purpose: Wrapper function for remove on VMS systems + * Purpose: Wrapper function for remove on VMS systems * - * This function deletes all versions of a file + * This function deletes all versions of a file * - * Return: Success: 0; + * Return: Success: 0; * - * Failure: -1 + * Failure: -1 * - * Programmer: Elena Pourmal + * Programmer: Elena Pourmal * March 22, 2006 * *------------------------------------------------------------------------- @@ -584,13 +584,13 @@ HDremove_all(const char *fname) #endif /*------------------------------------------------------------------------- - * Function: Wgettimeofday + * Function: Wgettimeofday * - * Purpose: Wrapper function for gettimeofday on Windows systems + * Purpose: Wrapper function for gettimeofday on Windows systems * - * This function can get the time as well as a timezone + * This function can get the time as well as a timezone * - * Return: 0 + * Return: 0 * * This implementation is taken from the Cygwin source distribution at * src/winsup/mingw/mingwex/gettimeofday.c @@ -599,12 +599,12 @@ HDremove_all(const char *fname) * Danny Smith * and released in the public domain. * - * Programmer: Scott Wegner + * Programmer: Scott Wegner * May 19, 2009 * *------------------------------------------------------------------------- */ -#ifdef _WIN32 +#ifdef H5_HAVE_VISUAL_STUDIO /* Offset between 1/1/1601 and 1/1/1970 in 100 nanosecond units */ #define _W32_FT_OFFSET (116444736000000000ULL) @@ -638,6 +638,27 @@ Wgettimeofday(struct timeval *tv, struct timezone *tz) Do not set errno on error. */ return 0; } + +#ifdef H5_HAVE_WINSOCK_H +#pragma comment(lib, "advapi32.lib") +#endif + +#define WloginBuffer_count 256 +static char Wlogin_buffer[WloginBuffer_count]; + +char* +Wgetlogin() +{ + +#ifdef H5_HAVE_WINSOCK_H + long bufferCount = WloginBuffer_count; + if (GetUserName(Wlogin_buffer, &bufferCount) == 0) + return (Wlogin_buffer); + else +#endif /* H5_HAVE_WINSOCK_H */ + return NULL; +} + #endif @@ -645,16 +666,16 @@ Wgettimeofday(struct timeval *tv, struct timezone *tz) * Function: H5_build_extpath * * Purpose: To build the path for later searching of target file for external - * link. This path can be either: + * link. This path can be either: * 1. The absolute path of NAME * or * 2. The current working directory + relative path of NAME * - * Return: Success: 0 - * Failure: -1 + * Return: Success: 0 + * Failure: -1 * - * Programmer: Vailin Choi - * April 2, 2008 + * Programmer: Vailin Choi + * April 2, 2008 * *------------------------------------------------------------------------- */ @@ -668,7 +689,7 @@ H5_build_extpath(const char *name, char **extpath/*out*/) char *new_name = NULL; /* Pointer to the name of the file */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5_build_extpath) + FUNC_ENTER_NOAPI_NOINIT /* Clear external path pointer to begin with */ *extpath = NULL; @@ -692,23 +713,23 @@ H5_build_extpath(const char *name, char **extpath/*out*/) if(NULL == (new_name = (char *)H5MM_strdup(name))) HGOTO_ERROR(H5E_INTERNAL, H5E_NOSPACE, FAIL, "memory allocation failed") - /* - * Windows: name[0-1] is ":" - * Get current working directory on the drive specified in NAME - * Unix: does not apply + /* + * Windows: name[0-1] is ":" + * Get current working directory on the drive specified in NAME + * Unix: does not apply * OpenVMS: does not apply - */ + */ if(CHECK_ABS_DRIVE(name)) { drive = name[0] - 'A' + 1; retcwd = HDgetdcwd(drive, cwdpath, MAX_PATH_LEN); HDstrcpy(new_name, &name[2]); } /* end if */ - /* - * Windows: name[0] is a '/' or '\' - * Get current drive - * Unix: does not apply + /* + * Windows: name[0] is a '/' or '\' + * Get current drive + * Unix: does not apply * OpenVMS: does not apply - */ + */ else if(CHECK_ABS_PATH(name) && (0 != (drive = HDgetdrive()))) { sprintf(cwdpath, "%c:%c", (drive+'A'-1), name[0]); retcwd = cwdpath; @@ -764,9 +785,9 @@ H5_build_extpath(const char *name, char **extpath/*out*/) done: /* Release resources */ if(cwdpath) - H5MM_xfree(cwdpath); + H5MM_xfree(cwdpath); if(new_name) - H5MM_xfree(new_name); + H5MM_xfree(new_name); FUNC_LEAVE_NOAPI(ret_value) } /* H5_build_extpath() */ diff --git a/src/H5trace.c b/src/H5trace.c index 67a85c5..b711f40 100644 --- a/src/H5trace.c +++ b/src/H5trace.c @@ -458,6 +458,44 @@ H5_trace(const double *returning, const char *func, const char *type, ...) } /* end else */ break; + case 'i': + if(ptr) { + if(vp) + fprintf(out, "0x%lx", (unsigned long)vp); + else + fprintf(out, "NULL"); + } /* end if */ + else { + H5D_mpio_actual_io_mode_t actual_io_mode = (H5D_mpio_actual_io_mode_t)va_arg(ap, int); + + switch(actual_io_mode) { + case H5D_MPIO_NO_COLLECTIVE: + fprintf(out, "H5D_MPIO_NO_COLLECTIVE"); + break; + + case H5D_MPIO_CHUNK_INDEPENDENT: + fprintf(out, "H5D_MPIO_CHUNK_INDEPENDENT"); + break; + + case H5D_MPIO_CHUNK_COLLECTIVE: + fprintf(out, "H5D_MPIO_CHUNK_COLLECTIVE"); + break; + + case H5D_MPIO_CHUNK_MIXED: + fprintf(out, "H5D_MPIO_CHUNK_MIXED"); + break; + + case H5D_MPIO_CONTIGUOUS_COLLECTIVE: + fprintf(out, "H5D_MPIO_CONTIGUOUS_COLLECTIVE"); + break; + + default: + fprintf(out, "%ld", (long)actual_io_mode); + break; + } /* end switch */ + } /* end else */ + break; + case 'l': if(ptr) { if(vp) @@ -496,6 +534,40 @@ H5_trace(const double *returning, const char *func, const char *type, ...) } /* end else */ break; + case 'o': + if(ptr) { + if(vp) + fprintf(out, "0x%lx", (unsigned long)vp); + else + fprintf(out, "NULL"); + } /* end if */ + else { + H5D_mpio_actual_chunk_opt_mode_t chunk_opt_mode = (H5D_mpio_actual_chunk_opt_mode_t)va_arg(ap, int); + + switch(chunk_opt_mode) { + case H5D_MPIO_NO_CHUNK_OPTIMIZATION: + fprintf(out, "H5D_MPIO_NO_CHUNK_OPTIMIZATION"); + break; + + case H5D_MPIO_LINK_CHUNK: + fprintf(out, "H5D_MPIO_LINK_CHUNK"); + break; + + case H5D_MPIO_MULTI_CHUNK: + fprintf(out, "H5D_MPIO_MULTI_CHUNK"); + break; + + case H5D_MPIO_MULTI_CHUNK_NO_OPT: + fprintf(out, "H5D_MPIO_MULTI_CHUNK_NO_OPT"); + break; + + default: + fprintf(out, "%ld", (long)chunk_opt_mode); + break; + } /* end switch */ + } /* end else */ + break; + case 's': if(ptr) { if(vp) @@ -2206,6 +2278,62 @@ H5_trace(const double *returning, const char *func, const char *type, ...) } /* end else */ break; + case 'U': + switch(type[1]) { + case 'l': + if(ptr) { + if(vp) { + fprintf(out, "0x%lx", (unsigned long)vp); + if(asize_idx >= 0 && asize[asize_idx] >= 0) { + unsigned long *p = (unsigned long *)vp; + + fprintf(out, " {"); + for(i = 0; i < asize[asize_idx]; i++) + HDfprintf(out, "%s%lu", i?", ":"", p[i]); + fprintf(out, "}"); + } /* end if */ + } /* end if */ + else + fprintf(out, "NULL"); + } /* end if */ + else { + unsigned long iul = va_arg(ap, unsigned long); /*lint !e732 Loss of sign not really occuring */ + + fprintf(out, "%lu", iul); + asize[argno] = iul; + } /* end else */ + break; + + case 'L': + if(ptr) { + if(vp) { + fprintf(out, "0x%lx", (unsigned long)vp); + if(asize_idx >= 0 && asize[asize_idx] >= 0) { + unsigned long long *p = (unsigned long long *)vp; + + fprintf(out, " {"); + for(i = 0; i < asize[asize_idx]; i++) + HDfprintf(out, "%s%llu", i?", ":"", p[i]); + fprintf(out, "}"); + } /* end if */ + } /* end if */ + else + fprintf(out, "NULL"); + } /* end if */ + else { + unsigned long long iull = va_arg(ap, unsigned long long); /*lint !e732 Loss of sign not really occuring */ + + fprintf(out, "%llu", iull); + asize[argno] = iull; + } /* end else */ + break; + + default: + fprintf (out, "BADTYPE(U%c)", type[1]); + goto error; + } /* end switch */ + break; + case 'x': if(ptr) { if(vp) { diff --git a/src/H5vers.txt b/src/H5vers.txt index 89f7bc6..07d2c4b 100644 --- a/src/H5vers.txt +++ b/src/H5vers.txt @@ -62,6 +62,7 @@ FUNCTION: H5Pget_filter; ; v10, v18 FUNCTION: H5Pget_filter_by_id; ; v16, v18 FUNCTION: H5Pinsert; ; v14, v18 FUNCTION: H5Pregister; ; v14, v18 +FUNCTION: H5Rdereference; ; v10, v110 FUNCTION: H5Rget_obj_type; ; v16, v18 FUNCTION: H5Tarray_create; ; v14, v18 FUNCTION: H5Tcommit; ; v10, v18 diff --git a/src/H5version.h b/src/H5version.h index 296768e..b955a8f 100644 --- a/src/H5version.h +++ b/src/H5version.h @@ -22,7 +22,7 @@ /* Issue error if contradicting macros have been defined. */ #if (defined(H5_USE_16_API) || defined(H5_USE_18_API)) && defined(H5_NO_DEPRECATED_SYMBOLS) -#error "Can't choose old API versions when deprecated APIs are disabled" + #error "Can't choose old API versions when deprecated APIs are disabled" #endif /* (defined(H5_USE_16_API) || defined(H5_USE_18_API)) && defined(H5_NO_DEPRECATED_SYMBOLS) */ @@ -33,11 +33,11 @@ * API symbol, the individual API version macro takes priority. */ #if defined(H5_USE_16_API_DEFAULT) && !defined(H5_USE_16_API) -#define H5_USE_16_API 1 + #define H5_USE_16_API 1 #endif /* H5_USE_16_API_DEFAULT && !H5_USE_16_API */ #if defined(H5_USE_18_API_DEFAULT) && !defined(H5_USE_18_API) -#define H5_USE_18_API 1 + #define H5_USE_18_API 1 #endif /* H5_USE_18_API_DEFAULT && !H5_USE_18_API */ @@ -48,87 +48,91 @@ /*************/ #if !defined(H5Acreate_vers) -#define H5Acreate_vers 1 + #define H5Acreate_vers 1 #endif /* !defined(H5Acreate_vers) */ #if !defined(H5Aiterate_vers) -#define H5Aiterate_vers 1 + #define H5Aiterate_vers 1 #endif /* !defined(H5Aiterate_vers) */ #if !defined(H5Dcreate_vers) -#define H5Dcreate_vers 1 + #define H5Dcreate_vers 1 #endif /* !defined(H5Dcreate_vers) */ #if !defined(H5Dopen_vers) -#define H5Dopen_vers 1 + #define H5Dopen_vers 1 #endif /* !defined(H5Dopen_vers) */ #if !defined(H5Eclear_vers) -#define H5Eclear_vers 1 + #define H5Eclear_vers 1 #endif /* !defined(H5Eclear_vers) */ #if !defined(H5Eget_auto_vers) -#define H5Eget_auto_vers 1 + #define H5Eget_auto_vers 1 #endif /* !defined(H5Eget_auto_vers) */ #if !defined(H5Eprint_vers) -#define H5Eprint_vers 1 + #define H5Eprint_vers 1 #endif /* !defined(H5Eprint_vers) */ #if !defined(H5Epush_vers) -#define H5Epush_vers 1 + #define H5Epush_vers 1 #endif /* !defined(H5Epush_vers) */ #if !defined(H5Eset_auto_vers) -#define H5Eset_auto_vers 1 + #define H5Eset_auto_vers 1 #endif /* !defined(H5Eset_auto_vers) */ #if !defined(H5Ewalk_vers) -#define H5Ewalk_vers 1 + #define H5Ewalk_vers 1 #endif /* !defined(H5Ewalk_vers) */ #if !defined(H5Gcreate_vers) -#define H5Gcreate_vers 1 + #define H5Gcreate_vers 1 #endif /* !defined(H5Gcreate_vers) */ #if !defined(H5Gopen_vers) -#define H5Gopen_vers 1 + #define H5Gopen_vers 1 #endif /* !defined(H5Gopen_vers) */ #if !defined(H5Pget_filter_vers) -#define H5Pget_filter_vers 1 + #define H5Pget_filter_vers 1 #endif /* !defined(H5Pget_filter_vers) */ #if !defined(H5Pget_filter_by_id_vers) -#define H5Pget_filter_by_id_vers 1 + #define H5Pget_filter_by_id_vers 1 #endif /* !defined(H5Pget_filter_by_id_vers) */ #if !defined(H5Pinsert_vers) -#define H5Pinsert_vers 1 + #define H5Pinsert_vers 1 #endif /* !defined(H5Pinsert_vers) */ #if !defined(H5Pregister_vers) -#define H5Pregister_vers 1 + #define H5Pregister_vers 1 #endif /* !defined(H5Pregister_vers) */ +#if !defined(H5Rdereference_vers) + #define H5Rdereference_vers 1 +#endif /* !defined(H5Rdereference_vers) */ + #if !defined(H5Rget_obj_type_vers) -#define H5Rget_obj_type_vers 1 + #define H5Rget_obj_type_vers 1 #endif /* !defined(H5Rget_obj_type_vers) */ #if !defined(H5Tarray_create_vers) -#define H5Tarray_create_vers 1 + #define H5Tarray_create_vers 1 #endif /* !defined(H5Tarray_create_vers) */ #if !defined(H5Tcommit_vers) -#define H5Tcommit_vers 1 + #define H5Tcommit_vers 1 #endif /* !defined(H5Tcommit_vers) */ #if !defined(H5Tget_array_dims_vers) -#define H5Tget_array_dims_vers 1 + #define H5Tget_array_dims_vers 1 #endif /* !defined(H5Tget_array_dims_vers) */ #if !defined(H5Topen_vers) -#define H5Topen_vers 1 + #define H5Topen_vers 1 #endif /* !defined(H5Topen_vers) */ /************/ @@ -136,11 +140,11 @@ /************/ #if !defined(H5E_auto_t_vers) -#define H5E_auto_t_vers 1 + #define H5E_auto_t_vers 1 #endif /* !defined(H5E_auto_t_vers) */ #if !defined(H5Z_class_t_vers) -#define H5Z_class_t_vers 1 + #define H5Z_class_t_vers 1 #endif /* !defined(H5Z_class_t_vers) */ #endif /* H5_USE_16_API */ @@ -152,91 +156,95 @@ /*************/ #if !defined(H5Acreate_vers) -#define H5Acreate_vers 2 + #define H5Acreate_vers 2 #endif /* !defined(H5Acreate_vers) */ #if !defined(H5Aiterate_vers) -#define H5Aiterate_vers 2 + #define H5Aiterate_vers 2 #endif /* !defined(H5Aiterate_vers) */ #if !defined(H5Dcreate_vers) -#define H5Dcreate_vers 2 + #define H5Dcreate_vers 2 #endif /* !defined(H5Dcreate_vers) */ #if !defined(H5Dopen_vers) -#define H5Dopen_vers 2 + #define H5Dopen_vers 2 #endif /* !defined(H5Dopen_vers) */ #if !defined(H5Eclear_vers) -#define H5Eclear_vers 2 + #define H5Eclear_vers 2 #endif /* !defined(H5Eclear_vers) */ #if !defined(H5Eget_auto_vers) -#define H5Eget_auto_vers 2 + #define H5Eget_auto_vers 2 #endif /* !defined(H5Eget_auto_vers) */ #if !defined(H5Eprint_vers) -#define H5Eprint_vers 2 + #define H5Eprint_vers 2 #endif /* !defined(H5Eprint_vers) */ #if !defined(H5Epush_vers) -#define H5Epush_vers 2 + #define H5Epush_vers 2 #endif /* !defined(H5Epush_vers) */ #if !defined(H5Eset_auto_vers) -#define H5Eset_auto_vers 2 + #define H5Eset_auto_vers 2 #endif /* !defined(H5Eset_auto_vers) */ #if !defined(H5Ewalk_vers) -#define H5Ewalk_vers 2 + #define H5Ewalk_vers 2 #endif /* !defined(H5Ewalk_vers) */ #if !defined(H5Fget_info_vers) -#define H5Fget_info_vers 1 + #define H5Fget_info_vers 1 #endif /* !defined(H5Fget_info_vers) */ #if !defined(H5Gcreate_vers) -#define H5Gcreate_vers 2 + #define H5Gcreate_vers 2 #endif /* !defined(H5Gcreate_vers) */ #if !defined(H5Gopen_vers) -#define H5Gopen_vers 2 + #define H5Gopen_vers 2 #endif /* !defined(H5Gopen_vers) */ #if !defined(H5Pget_filter_vers) -#define H5Pget_filter_vers 2 + #define H5Pget_filter_vers 2 #endif /* !defined(H5Pget_filter_vers) */ #if !defined(H5Pget_filter_by_id_vers) -#define H5Pget_filter_by_id_vers 2 + #define H5Pget_filter_by_id_vers 2 #endif /* !defined(H5Pget_filter_by_id_vers) */ #if !defined(H5Pinsert_vers) -#define H5Pinsert_vers 2 + #define H5Pinsert_vers 2 #endif /* !defined(H5Pinsert_vers) */ #if !defined(H5Pregister_vers) -#define H5Pregister_vers 2 + #define H5Pregister_vers 2 #endif /* !defined(H5Pregister_vers) */ +#if !defined(H5Rdereference_vers) + #define H5Rdereference_vers 1 +#endif /* !defined(H5Rdereference_vers) */ + #if !defined(H5Rget_obj_type_vers) -#define H5Rget_obj_type_vers 2 + #define H5Rget_obj_type_vers 2 #endif /* !defined(H5Rget_obj_type_vers) */ #if !defined(H5Tarray_create_vers) -#define H5Tarray_create_vers 2 + #define H5Tarray_create_vers 2 #endif /* !defined(H5Tarray_create_vers) */ #if !defined(H5Tcommit_vers) -#define H5Tcommit_vers 2 + #define H5Tcommit_vers 2 #endif /* !defined(H5Tcommit_vers) */ #if !defined(H5Tget_array_dims_vers) -#define H5Tget_array_dims_vers 2 + #define H5Tget_array_dims_vers 2 #endif /* !defined(H5Tget_array_dims_vers) */ #if !defined(H5Topen_vers) -#define H5Topen_vers 2 + #define H5Topen_vers 2 #endif /* !defined(H5Topen_vers) */ /************/ @@ -244,11 +252,11 @@ /************/ #if !defined(H5E_auto_t_vers) -#define H5E_auto_t_vers 2 + #define H5E_auto_t_vers 2 #endif /* !defined(H5E_auto_t_vers) */ #if !defined(H5Z_class_t_vers) -#define H5Z_class_t_vers 2 + #define H5Z_class_t_vers 2 #endif /* !defined(H5Z_class_t_vers) */ #endif /* H5_USE_18_API */ @@ -265,253 +273,264 @@ /*************/ #if !defined(H5Acreate_vers) || H5Acreate_vers == 2 -#ifndef H5Acreate_vers -#define H5Acreate_vers 2 -#endif /* H5Acreate_vers */ -#define H5Acreate H5Acreate2 + #ifndef H5Acreate_vers + #define H5Acreate_vers 2 + #endif /* H5Acreate_vers */ + #define H5Acreate H5Acreate2 #elif H5Acreate_vers == 1 -#define H5Acreate H5Acreate1 + #define H5Acreate H5Acreate1 #else /* H5Acreate_vers */ -#error "H5Acreate_vers set to invalid value" + #error "H5Acreate_vers set to invalid value" #endif /* H5Acreate_vers */ #if !defined(H5Aiterate_vers) || H5Aiterate_vers == 2 -#ifndef H5Aiterate_vers -#define H5Aiterate_vers 2 -#endif /* H5Aiterate_vers */ -#define H5Aiterate H5Aiterate2 -#define H5A_operator_t H5A_operator2_t + #ifndef H5Aiterate_vers + #define H5Aiterate_vers 2 + #endif /* H5Aiterate_vers */ + #define H5Aiterate H5Aiterate2 + #define H5A_operator_t H5A_operator2_t #elif H5Aiterate_vers == 1 -#define H5Aiterate H5Aiterate1 -#define H5A_operator_t H5A_operator1_t + #define H5Aiterate H5Aiterate1 + #define H5A_operator_t H5A_operator1_t #else /* H5Aiterate_vers */ -#error "H5Aiterate_vers set to invalid value" + #error "H5Aiterate_vers set to invalid value" #endif /* H5Aiterate_vers */ #if !defined(H5Dcreate_vers) || H5Dcreate_vers == 2 -#ifndef H5Dcreate_vers -#define H5Dcreate_vers 2 -#endif /* H5Dcreate_vers */ -#define H5Dcreate H5Dcreate2 + #ifndef H5Dcreate_vers + #define H5Dcreate_vers 2 + #endif /* H5Dcreate_vers */ + #define H5Dcreate H5Dcreate2 #elif H5Dcreate_vers == 1 -#define H5Dcreate H5Dcreate1 + #define H5Dcreate H5Dcreate1 #else /* H5Dcreate_vers */ -#error "H5Dcreate_vers set to invalid value" + #error "H5Dcreate_vers set to invalid value" #endif /* H5Dcreate_vers */ #if !defined(H5Dopen_vers) || H5Dopen_vers == 2 -#ifndef H5Dopen_vers -#define H5Dopen_vers 2 -#endif /* H5Dopen_vers */ -#define H5Dopen H5Dopen2 + #ifndef H5Dopen_vers + #define H5Dopen_vers 2 + #endif /* H5Dopen_vers */ + #define H5Dopen H5Dopen2 #elif H5Dopen_vers == 1 -#define H5Dopen H5Dopen1 + #define H5Dopen H5Dopen1 #else /* H5Dopen_vers */ -#error "H5Dopen_vers set to invalid value" + #error "H5Dopen_vers set to invalid value" #endif /* H5Dopen_vers */ #if !defined(H5Eclear_vers) || H5Eclear_vers == 2 -#ifndef H5Eclear_vers -#define H5Eclear_vers 2 -#endif /* H5Eclear_vers */ -#define H5Eclear H5Eclear2 + #ifndef H5Eclear_vers + #define H5Eclear_vers 2 + #endif /* H5Eclear_vers */ + #define H5Eclear H5Eclear2 #elif H5Eclear_vers == 1 -#define H5Eclear H5Eclear1 + #define H5Eclear H5Eclear1 #else /* H5Eclear_vers */ -#error "H5Eclear_vers set to invalid value" + #error "H5Eclear_vers set to invalid value" #endif /* H5Eclear_vers */ #if !defined(H5Eget_auto_vers) || H5Eget_auto_vers == 2 -#ifndef H5Eget_auto_vers -#define H5Eget_auto_vers 2 -#endif /* H5Eget_auto_vers */ -#define H5Eget_auto H5Eget_auto2 + #ifndef H5Eget_auto_vers + #define H5Eget_auto_vers 2 + #endif /* H5Eget_auto_vers */ + #define H5Eget_auto H5Eget_auto2 #elif H5Eget_auto_vers == 1 -#define H5Eget_auto H5Eget_auto1 + #define H5Eget_auto H5Eget_auto1 #else /* H5Eget_auto_vers */ -#error "H5Eget_auto_vers set to invalid value" + #error "H5Eget_auto_vers set to invalid value" #endif /* H5Eget_auto_vers */ #if !defined(H5Eprint_vers) || H5Eprint_vers == 2 -#ifndef H5Eprint_vers -#define H5Eprint_vers 2 -#endif /* H5Eprint_vers */ -#define H5Eprint H5Eprint2 + #ifndef H5Eprint_vers + #define H5Eprint_vers 2 + #endif /* H5Eprint_vers */ + #define H5Eprint H5Eprint2 #elif H5Eprint_vers == 1 -#define H5Eprint H5Eprint1 + #define H5Eprint H5Eprint1 #else /* H5Eprint_vers */ -#error "H5Eprint_vers set to invalid value" + #error "H5Eprint_vers set to invalid value" #endif /* H5Eprint_vers */ #if !defined(H5Epush_vers) || H5Epush_vers == 2 -#ifndef H5Epush_vers -#define H5Epush_vers 2 -#endif /* H5Epush_vers */ -#define H5Epush H5Epush2 + #ifndef H5Epush_vers + #define H5Epush_vers 2 + #endif /* H5Epush_vers */ + #define H5Epush H5Epush2 #elif H5Epush_vers == 1 -#define H5Epush H5Epush1 + #define H5Epush H5Epush1 #else /* H5Epush_vers */ -#error "H5Epush_vers set to invalid value" + #error "H5Epush_vers set to invalid value" #endif /* H5Epush_vers */ #if !defined(H5Eset_auto_vers) || H5Eset_auto_vers == 2 -#ifndef H5Eset_auto_vers -#define H5Eset_auto_vers 2 -#endif /* H5Eset_auto_vers */ -#define H5Eset_auto H5Eset_auto2 + #ifndef H5Eset_auto_vers + #define H5Eset_auto_vers 2 + #endif /* H5Eset_auto_vers */ + #define H5Eset_auto H5Eset_auto2 #elif H5Eset_auto_vers == 1 -#define H5Eset_auto H5Eset_auto1 + #define H5Eset_auto H5Eset_auto1 #else /* H5Eset_auto_vers */ -#error "H5Eset_auto_vers set to invalid value" + #error "H5Eset_auto_vers set to invalid value" #endif /* H5Eset_auto_vers */ #if !defined(H5Ewalk_vers) || H5Ewalk_vers == 2 -#ifndef H5Ewalk_vers -#define H5Ewalk_vers 2 -#endif /* H5Ewalk_vers */ -#define H5Ewalk H5Ewalk2 -#define H5E_error_t H5E_error2_t -#define H5E_walk_t H5E_walk2_t + #ifndef H5Ewalk_vers + #define H5Ewalk_vers 2 + #endif /* H5Ewalk_vers */ + #define H5Ewalk H5Ewalk2 + #define H5E_error_t H5E_error2_t + #define H5E_walk_t H5E_walk2_t #elif H5Ewalk_vers == 1 -#define H5Ewalk H5Ewalk1 -#define H5E_error_t H5E_error1_t -#define H5E_walk_t H5E_walk1_t + #define H5Ewalk H5Ewalk1 + #define H5E_error_t H5E_error1_t + #define H5E_walk_t H5E_walk1_t #else /* H5Ewalk_vers */ -#error "H5Ewalk_vers set to invalid value" + #error "H5Ewalk_vers set to invalid value" #endif /* H5Ewalk_vers */ #if !defined(H5Fget_info_vers) || H5Fget_info_vers == 2 -#ifndef H5Fget_info_vers -#define H5Fget_info_vers 2 -#endif /* H5Fget_info_vers */ -#define H5Fget_info H5Fget_info2 -#define H5F_info_t H5F_info2_t + #ifndef H5Fget_info_vers + #define H5Fget_info_vers 2 + #endif /* H5Fget_info_vers */ + #define H5Fget_info H5Fget_info2 + #define H5F_info_t H5F_info2_t #elif H5Fget_info_vers == 1 -#define H5Fget_info H5Fget_info1 -#define H5F_info_t H5F_info1_t + #define H5Fget_info H5Fget_info1 + #define H5F_info_t H5F_info1_t #else /* H5Fget_info_vers */ -#error "H5Fget_info_vers set to invalid value" + #error "H5Fget_info_vers set to invalid value" #endif /* H5Fget_info_vers */ #if !defined(H5Gcreate_vers) || H5Gcreate_vers == 2 -#ifndef H5Gcreate_vers -#define H5Gcreate_vers 2 -#endif /* H5Gcreate_vers */ -#define H5Gcreate H5Gcreate2 + #ifndef H5Gcreate_vers + #define H5Gcreate_vers 2 + #endif /* H5Gcreate_vers */ + #define H5Gcreate H5Gcreate2 #elif H5Gcreate_vers == 1 -#define H5Gcreate H5Gcreate1 + #define H5Gcreate H5Gcreate1 #else /* H5Gcreate_vers */ -#error "H5Gcreate_vers set to invalid value" + #error "H5Gcreate_vers set to invalid value" #endif /* H5Gcreate_vers */ #if !defined(H5Gopen_vers) || H5Gopen_vers == 2 -#ifndef H5Gopen_vers -#define H5Gopen_vers 2 -#endif /* H5Gopen_vers */ -#define H5Gopen H5Gopen2 + #ifndef H5Gopen_vers + #define H5Gopen_vers 2 + #endif /* H5Gopen_vers */ + #define H5Gopen H5Gopen2 #elif H5Gopen_vers == 1 -#define H5Gopen H5Gopen1 + #define H5Gopen H5Gopen1 #else /* H5Gopen_vers */ -#error "H5Gopen_vers set to invalid value" + #error "H5Gopen_vers set to invalid value" #endif /* H5Gopen_vers */ #if !defined(H5Pget_filter_vers) || H5Pget_filter_vers == 2 -#ifndef H5Pget_filter_vers -#define H5Pget_filter_vers 2 -#endif /* H5Pget_filter_vers */ -#define H5Pget_filter H5Pget_filter2 + #ifndef H5Pget_filter_vers + #define H5Pget_filter_vers 2 + #endif /* H5Pget_filter_vers */ + #define H5Pget_filter H5Pget_filter2 #elif H5Pget_filter_vers == 1 -#define H5Pget_filter H5Pget_filter1 + #define H5Pget_filter H5Pget_filter1 #else /* H5Pget_filter_vers */ -#error "H5Pget_filter_vers set to invalid value" + #error "H5Pget_filter_vers set to invalid value" #endif /* H5Pget_filter_vers */ #if !defined(H5Pget_filter_by_id_vers) || H5Pget_filter_by_id_vers == 2 -#ifndef H5Pget_filter_by_id_vers -#define H5Pget_filter_by_id_vers 2 -#endif /* H5Pget_filter_by_id_vers */ -#define H5Pget_filter_by_id H5Pget_filter_by_id2 + #ifndef H5Pget_filter_by_id_vers + #define H5Pget_filter_by_id_vers 2 + #endif /* H5Pget_filter_by_id_vers */ + #define H5Pget_filter_by_id H5Pget_filter_by_id2 #elif H5Pget_filter_by_id_vers == 1 -#define H5Pget_filter_by_id H5Pget_filter_by_id1 + #define H5Pget_filter_by_id H5Pget_filter_by_id1 #else /* H5Pget_filter_by_id_vers */ -#error "H5Pget_filter_by_id_vers set to invalid value" + #error "H5Pget_filter_by_id_vers set to invalid value" #endif /* H5Pget_filter_by_id_vers */ #if !defined(H5Pinsert_vers) || H5Pinsert_vers == 2 -#ifndef H5Pinsert_vers -#define H5Pinsert_vers 2 -#endif /* H5Pinsert_vers */ -#define H5Pinsert H5Pinsert2 + #ifndef H5Pinsert_vers + #define H5Pinsert_vers 2 + #endif /* H5Pinsert_vers */ + #define H5Pinsert H5Pinsert2 #elif H5Pinsert_vers == 1 -#define H5Pinsert H5Pinsert1 + #define H5Pinsert H5Pinsert1 #else /* H5Pinsert_vers */ -#error "H5Pinsert_vers set to invalid value" + #error "H5Pinsert_vers set to invalid value" #endif /* H5Pinsert_vers */ #if !defined(H5Pregister_vers) || H5Pregister_vers == 2 -#ifndef H5Pregister_vers -#define H5Pregister_vers 2 -#endif /* H5Pregister_vers */ -#define H5Pregister H5Pregister2 + #ifndef H5Pregister_vers + #define H5Pregister_vers 2 + #endif /* H5Pregister_vers */ + #define H5Pregister H5Pregister2 #elif H5Pregister_vers == 1 -#define H5Pregister H5Pregister1 + #define H5Pregister H5Pregister1 #else /* H5Pregister_vers */ -#error "H5Pregister_vers set to invalid value" + #error "H5Pregister_vers set to invalid value" #endif /* H5Pregister_vers */ +#if !defined(H5Rdereference_vers) || H5Rdereference_vers == 2 + #ifndef H5Rdereference_vers + #define H5Rdereference_vers 2 + #endif /* H5Rdereference_vers */ + #define H5Rdereference H5Rdereference2 +#elif H5Rdereference_vers == 1 + #define H5Rdereference H5Rdereference1 +#else /* H5Rdereference_vers */ + #error "H5Rdereference_vers set to invalid value" +#endif /* H5Rdereference_vers */ + #if !defined(H5Rget_obj_type_vers) || H5Rget_obj_type_vers == 2 -#ifndef H5Rget_obj_type_vers -#define H5Rget_obj_type_vers 2 -#endif /* H5Rget_obj_type_vers */ -#define H5Rget_obj_type H5Rget_obj_type2 + #ifndef H5Rget_obj_type_vers + #define H5Rget_obj_type_vers 2 + #endif /* H5Rget_obj_type_vers */ + #define H5Rget_obj_type H5Rget_obj_type2 #elif H5Rget_obj_type_vers == 1 -#define H5Rget_obj_type H5Rget_obj_type1 + #define H5Rget_obj_type H5Rget_obj_type1 #else /* H5Rget_obj_type_vers */ -#error "H5Rget_obj_type_vers set to invalid value" + #error "H5Rget_obj_type_vers set to invalid value" #endif /* H5Rget_obj_type_vers */ #if !defined(H5Tarray_create_vers) || H5Tarray_create_vers == 2 -#ifndef H5Tarray_create_vers -#define H5Tarray_create_vers 2 -#endif /* H5Tarray_create_vers */ -#define H5Tarray_create H5Tarray_create2 + #ifndef H5Tarray_create_vers + #define H5Tarray_create_vers 2 + #endif /* H5Tarray_create_vers */ + #define H5Tarray_create H5Tarray_create2 #elif H5Tarray_create_vers == 1 -#define H5Tarray_create H5Tarray_create1 + #define H5Tarray_create H5Tarray_create1 #else /* H5Tarray_create_vers */ -#error "H5Tarray_create_vers set to invalid value" + #error "H5Tarray_create_vers set to invalid value" #endif /* H5Tarray_create_vers */ #if !defined(H5Tcommit_vers) || H5Tcommit_vers == 2 -#ifndef H5Tcommit_vers -#define H5Tcommit_vers 2 -#endif /* H5Tcommit_vers */ -#define H5Tcommit H5Tcommit2 + #ifndef H5Tcommit_vers + #define H5Tcommit_vers 2 + #endif /* H5Tcommit_vers */ + #define H5Tcommit H5Tcommit2 #elif H5Tcommit_vers == 1 -#define H5Tcommit H5Tcommit1 + #define H5Tcommit H5Tcommit1 #else /* H5Tcommit_vers */ -#error "H5Tcommit_vers set to invalid value" + #error "H5Tcommit_vers set to invalid value" #endif /* H5Tcommit_vers */ #if !defined(H5Tget_array_dims_vers) || H5Tget_array_dims_vers == 2 -#ifndef H5Tget_array_dims_vers -#define H5Tget_array_dims_vers 2 -#endif /* H5Tget_array_dims_vers */ -#define H5Tget_array_dims H5Tget_array_dims2 + #ifndef H5Tget_array_dims_vers + #define H5Tget_array_dims_vers 2 + #endif /* H5Tget_array_dims_vers */ + #define H5Tget_array_dims H5Tget_array_dims2 #elif H5Tget_array_dims_vers == 1 -#define H5Tget_array_dims H5Tget_array_dims1 + #define H5Tget_array_dims H5Tget_array_dims1 #else /* H5Tget_array_dims_vers */ -#error "H5Tget_array_dims_vers set to invalid value" + #error "H5Tget_array_dims_vers set to invalid value" #endif /* H5Tget_array_dims_vers */ #if !defined(H5Topen_vers) || H5Topen_vers == 2 -#ifndef H5Topen_vers -#define H5Topen_vers 2 -#endif /* H5Topen_vers */ -#define H5Topen H5Topen2 + #ifndef H5Topen_vers + #define H5Topen_vers 2 + #endif /* H5Topen_vers */ + #define H5Topen H5Topen2 #elif H5Topen_vers == 1 -#define H5Topen H5Topen1 + #define H5Topen H5Topen1 #else /* H5Topen_vers */ -#error "H5Topen_vers set to invalid value" + #error "H5Topen_vers set to invalid value" #endif /* H5Topen_vers */ /************/ @@ -519,26 +538,26 @@ /************/ #if !defined(H5E_auto_t_vers) || H5E_auto_t_vers == 2 -#ifndef H5E_auto_t_vers -#define H5E_auto_t_vers 2 -#endif /* H5E_auto_t_vers */ -#define H5E_auto_t H5E_auto2_t + #ifndef H5E_auto_t_vers + #define H5E_auto_t_vers 2 + #endif /* H5E_auto_t_vers */ + #define H5E_auto_t H5E_auto2_t #elif H5E_auto_t_vers == 1 -#define H5E_auto_t H5E_auto1_t + #define H5E_auto_t H5E_auto1_t #else /* H5E_auto_t_vers */ -#error "H5E_auto_t_vers set to invalid value" + #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 + #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 + #define H5Z_class_t H5Z_class1_t #else /* H5Z_class_t_vers */ -#error "H5Z_class_t_vers set to invalid value" + #error "H5Z_class_t_vers set to invalid value" #endif /* H5Z_class_t_vers */ #endif /* H5version_H */ diff --git a/src/H5win32defs.h b/src/H5win32defs.h index a428899..5f886d1 100644 --- a/src/H5win32defs.h +++ b/src/H5win32defs.h @@ -23,7 +23,7 @@ * */ -#ifdef _WIN32 +#ifdef H5_HAVE_WIN32_API typedef struct _stati64 h5_stat_t; typedef __int64 h5_stat_size_t; @@ -33,41 +33,25 @@ typedef __int64 h5_stat_size_t; #define HDdup(F) _dup(F) #define HDfdopen(N,S) _fdopen(N,S) #define HDfileno(F) _fileno(F) -#if _MSC_VER > 1310 /* Newer than VS.NET 2003 */ -#define HDftruncate(F,L) _chsize_s(F,L) -#else -#define HDftruncate(F,L) chsize(F,L) -#endif +#define HDfseek(F,O,W) _fseeki64(F,O,W) #define HDfstat(F,B) _fstati64(F,B) +#define HDftruncate(F,L) _chsize_s(F,L) #define HDisatty(F) _isatty(F) -#define HDlstat(S,B) _lstati64(S,B) -#define HDstat(S,B) _stati64(S,B) #define HDgetcwd(S,Z) _getcwd(S,Z) #define HDgetdcwd(D,S,Z) _getdcwd(D,S,Z) - -struct timezone { - int tz_minuteswest; - int tz_dsttime; -}; - -#ifdef __cplusplus - extern "C" { -#endif /* __cplusplus */ -H5_DLL int Wgettimeofday(struct timeval *tv, struct timezone *tz); -#ifdef __cplusplus - } -#endif /* __cplusplus */ -#define HDgettimeofday(V,Z) Wgettimeofday(V,Z) - #define HDgetdrive() _getdrive() #define HDlseek(F,O,W) _lseeki64(F,O,W) -#define HDoff_t __int64 -#define HDmemset(X,C,Z) memset((void*)(X),C,Z) +#define HDlstat(S,B) _lstati64(S,B) #define HDmkdir(S,M) _mkdir(S) +#define HDoff_t __int64 +/* _O_BINARY must be set in Windows to avoid CR-LF <-> LF EOL + * transformations when performing I/O. + */ #define HDopen(S,F,M) _open(S,F|_O_BINARY,M) #define HDread(F,M,Z) _read(F,M,Z) #define HDsetvbuf(F,S,M,Z) setvbuf(F,S,M,(Z>1?Z:2)) #define HDsleep(S) Sleep(S*1000) +#define HDstat(S,B) _stati64(S,B) #define HDstrcasecmp(A,B) _stricmp(A,B) #define HDstrtoull(S,R,N) _strtoui64(S,R,N) #define HDstrdup(S) _strdup(S) @@ -77,11 +61,34 @@ H5_DLL int Wgettimeofday(struct timeval *tv, struct timezone *tz); #define HDvsnprintf(S,N,FMT,A) _vsnprintf(S,N,FMT,A) #define HDwrite(F,M,Z) _write(F,M,Z) +#ifdef H5_HAVE_VISUAL_STUDIO +/* + * The (void*) cast just avoids a compiler warning in H5_HAVE_VISUAL_STUDIO + */ +#define HDmemset(X,C,Z) memset((void*)(X),C,Z) + +struct timezone { + int tz_minuteswest; + int tz_dsttime; +}; + +#ifdef __cplusplus + extern "C" { +#endif /* __cplusplus */ + H5_DLL int Wgettimeofday(struct timeval *tv, struct timezone *tz); + H5_DLL char* Wgetlogin(); +#ifdef __cplusplus + } +#endif /* __cplusplus */ +#define HDgettimeofday(V,Z) Wgettimeofday(V,Z) +#define HDgetlogin() Wgetlogin() + +#endif /* H5_HAVE_VISUAL_STUDIO */ + /* Non-POSIX functions */ /* Don't use actual pthread_self on Windows because the return * type cannot be cast as a ulong like other systems. */ #define HDpthread_self_ulong() ((unsigned long)GetCurrentThreadId()) - -#endif /* _WIN32 */ +#endif /* H5_HAVE_WIN32_API */ diff --git a/src/Makefile.am b/src/Makefile.am index 9d27bbf..e03a626 100755 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -53,7 +53,8 @@ libhdf5_la_SOURCES= H5.c H5checksum.c H5dbg.c H5system.c H5timer.c H5trace.c \ H5E.c H5Edeprec.c H5Eint.c \ H5EA.c H5EAcache.c H5EAdbg.c H5EAdblkpage.c H5EAdblock.c H5EAhdr.c \ H5EAiblock.c H5EAint.c H5EAsblock.c H5EAstat.c H5EAtest.c \ - H5F.c H5Faccum.c H5Fdbg.c H5Fdeprec.c H5Fefc.c H5Ffake.c H5Fio.c \ + H5F.c H5Faccum.c H5Fcwfs.c \ + H5Fdbg.c H5Fdeprec.c H5Fefc.c H5Ffake.c H5Fio.c \ H5Fmount.c H5Fmpi.c H5Fquery.c \ H5Fsfile.c H5Fsuper.c H5Fsuper_cache.c H5Ftest.c \ H5FA.c H5FAcache.c H5FAdbg.c H5FAdblock.c H5FAdblkpage.c H5FAhdr.c \ @@ -70,7 +71,7 @@ libhdf5_la_SOURCES= H5.c H5checksum.c H5dbg.c H5system.c H5timer.c H5trace.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 \ H5HFspace.c H5HFstat.c H5HFtest.c H5HFtiny.c \ - H5HG.c H5HGcache.c H5HGdbg.c \ + H5HG.c H5HGcache.c H5HGdbg.c H5HGquery.c \ H5HL.c H5HLcache.c H5HLdbg.c H5HLint.c \ H5HP.c H5I.c H5Itest.c H5L.c H5Lexternal.c H5lib_settings.c \ H5MF.c H5MFaggr.c H5MFdbg.c H5MFsection.c \ diff --git a/src/Makefile.in b/src/Makefile.in index 6c95491..bf7f62d 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -107,48 +107,48 @@ am_libhdf5_la_OBJECTS = H5.lo H5checksum.lo H5dbg.lo H5system.lo \ H5Dselect.lo H5Dtest.lo H5E.lo H5Edeprec.lo H5Eint.lo H5EA.lo \ H5EAcache.lo H5EAdbg.lo H5EAdblkpage.lo H5EAdblock.lo \ H5EAhdr.lo H5EAiblock.lo H5EAint.lo H5EAsblock.lo H5EAstat.lo \ - H5EAtest.lo H5F.lo H5Faccum.lo H5Fdbg.lo H5Fdeprec.lo \ - H5Fefc.lo H5Ffake.lo H5Fio.lo H5Fmount.lo H5Fmpi.lo \ - H5Fquery.lo H5Fsfile.lo H5Fsuper.lo H5Fsuper_cache.lo \ - H5Ftest.lo H5FA.lo H5FAcache.lo H5FAdbg.lo H5FAdblock.lo \ - H5FAdblkpage.lo H5FAhdr.lo H5FAstat.lo H5FAtest.lo H5FD.lo \ - H5FDcore.lo H5FDdirect.lo H5FDfamily.lo H5FDint.lo H5FDlog.lo \ - H5FDmpi.lo H5FDmpio.lo H5FDmpiposix.lo H5FDmulti.lo \ - H5FDsec2.lo H5FDspace.lo H5FDstdio.lo H5FL.lo H5FO.lo H5FS.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 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 \ - H5HLint.lo H5HP.lo H5I.lo H5Itest.lo H5L.lo H5Lexternal.lo \ - H5lib_settings.lo H5MF.lo H5MFaggr.lo H5MFdbg.lo \ - H5MFsection.lo H5MM.lo H5MP.lo H5MPtest.lo H5O.lo H5Oainfo.lo \ - H5Oalloc.lo H5Oattr.lo H5Oattribute.lo H5Obogus.lo \ - H5Obtreek.lo H5Ocache.lo H5Ochunk.lo H5Ocont.lo H5Ocopy.lo \ - H5Odbg.lo H5Odrvinfo.lo H5Odtype.lo H5Oefl.lo H5Ofill.lo \ - H5Oflush.lo H5Ofsinfo.lo H5Oginfo.lo H5Olayout.lo H5Olinfo.lo \ - H5Olink.lo H5Omessage.lo H5Omtime.lo H5Oname.lo H5Onull.lo \ - H5Opline.lo H5Orefcount.lo H5Osdspace.lo H5Oshared.lo \ - H5Oshmesg.lo H5Ostab.lo H5Ostorage.lo H5Otest.lo H5Ounknown.lo \ - H5P.lo H5Pacpl.lo H5Pdapl.lo H5Pdcpl.lo H5Pdeprec.lo \ - H5Pdxpl.lo H5Pfapl.lo H5Pfcpl.lo H5Pfmpl.lo H5Pgcpl.lo \ - H5Pint.lo H5Plapl.lo H5Plcpl.lo H5Pocpl.lo H5Pocpypl.lo \ - H5Pstrcpl.lo H5Ptest.lo H5R.lo H5Rdeprec.lo H5RC.lo H5RS.lo \ - H5S.lo H5Sall.lo H5Sdbg.lo H5Shyper.lo H5Smpio.lo H5Snone.lo \ - H5Spoint.lo H5Sselect.lo H5Stest.lo H5SL.lo H5SM.lo \ - H5SMbtree2.lo H5SMcache.lo H5SMmessage.lo H5SMtest.lo H5ST.lo \ - H5T.lo H5Tarray.lo H5Tbit.lo H5Tcommit.lo H5Tcompound.lo \ - H5Tconv.lo H5Tcset.lo H5Tdbg.lo H5Tdeprec.lo H5Tenum.lo \ - H5Tfields.lo H5Tfixed.lo H5Tfloat.lo H5Tinit.lo H5Tnative.lo \ - H5Toffset.lo H5Toh.lo H5Topaque.lo H5Torder.lo H5Tpad.lo \ - H5Tprecis.lo H5Tstrpad.lo H5Tvisit.lo H5Tvlen.lo H5TS.lo \ - H5V.lo H5WB.lo H5Z.lo H5Zdeflate.lo H5Zfletcher32.lo \ - H5Znbit.lo H5Zshuffle.lo H5Zszip.lo H5Zscaleoffset.lo \ - H5Ztrans.lo + H5EAtest.lo H5F.lo H5Faccum.lo H5Fcwfs.lo H5Fdbg.lo \ + H5Fdeprec.lo H5Fefc.lo H5Ffake.lo H5Fio.lo H5Fmount.lo \ + H5Fmpi.lo H5Fquery.lo H5Fsfile.lo H5Fsuper.lo \ + H5Fsuper_cache.lo H5Ftest.lo H5FA.lo H5FAcache.lo H5FAdbg.lo \ + H5FAdblock.lo H5FAdblkpage.lo H5FAhdr.lo H5FAstat.lo \ + H5FAtest.lo H5FD.lo H5FDcore.lo H5FDdirect.lo H5FDfamily.lo \ + H5FDint.lo H5FDlog.lo H5FDmpi.lo H5FDmpio.lo H5FDmpiposix.lo \ + H5FDmulti.lo H5FDsec2.lo H5FDspace.lo H5FDstdio.lo H5FL.lo \ + H5FO.lo H5FS.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 \ + 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 H5HGquery.lo \ + H5HL.lo H5HLcache.lo H5HLdbg.lo H5HLint.lo H5HP.lo H5I.lo \ + H5Itest.lo H5L.lo H5Lexternal.lo H5lib_settings.lo H5MF.lo \ + H5MFaggr.lo H5MFdbg.lo H5MFsection.lo H5MM.lo H5MP.lo \ + H5MPtest.lo H5O.lo H5Oainfo.lo H5Oalloc.lo H5Oattr.lo \ + H5Oattribute.lo H5Obogus.lo H5Obtreek.lo H5Ocache.lo \ + H5Ochunk.lo H5Ocont.lo H5Ocopy.lo H5Odbg.lo H5Odrvinfo.lo \ + H5Odtype.lo H5Oefl.lo H5Ofill.lo H5Oflush.lo H5Ofsinfo.lo \ + H5Oginfo.lo H5Olayout.lo H5Olinfo.lo H5Olink.lo H5Omessage.lo \ + H5Omtime.lo H5Oname.lo H5Onull.lo H5Opline.lo H5Orefcount.lo \ + H5Osdspace.lo H5Oshared.lo H5Oshmesg.lo H5Ostab.lo \ + H5Ostorage.lo H5Otest.lo H5Ounknown.lo H5P.lo H5Pacpl.lo \ + H5Pdapl.lo H5Pdcpl.lo H5Pdeprec.lo H5Pdxpl.lo H5Pfapl.lo \ + H5Pfcpl.lo H5Pfmpl.lo H5Pgcpl.lo H5Pint.lo H5Plapl.lo \ + H5Plcpl.lo H5Pocpl.lo H5Pocpypl.lo H5Pstrcpl.lo H5Ptest.lo \ + H5R.lo H5Rdeprec.lo H5RC.lo H5RS.lo H5S.lo H5Sall.lo H5Sdbg.lo \ + H5Shyper.lo H5Smpio.lo H5Snone.lo H5Spoint.lo H5Sselect.lo \ + H5Stest.lo H5SL.lo H5SM.lo H5SMbtree2.lo H5SMcache.lo \ + H5SMmessage.lo H5SMtest.lo H5ST.lo H5T.lo H5Tarray.lo \ + H5Tbit.lo H5Tcommit.lo H5Tcompound.lo H5Tconv.lo H5Tcset.lo \ + H5Tdbg.lo H5Tdeprec.lo H5Tenum.lo H5Tfields.lo H5Tfixed.lo \ + H5Tfloat.lo H5Tinit.lo H5Tnative.lo H5Toffset.lo H5Toh.lo \ + H5Topaque.lo H5Torder.lo H5Tpad.lo H5Tprecis.lo H5Tstrpad.lo \ + H5Tvisit.lo H5Tvlen.lo H5TS.lo H5V.lo H5WB.lo H5Z.lo \ + H5Zdeflate.lo H5Zfletcher32.lo H5Znbit.lo H5Zshuffle.lo \ + H5Zszip.lo H5Zscaleoffset.lo H5Ztrans.lo libhdf5_la_OBJECTS = $(am_libhdf5_la_OBJECTS) AM_V_lt = $(am__v_lt_$(V)) am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) @@ -266,6 +266,7 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ +FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ @@ -286,10 +287,12 @@ H5_LONE_COLON = @H5_LONE_COLON@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ +HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ +HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ @@ -483,7 +486,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 = 71 +LT_VERS_REVISION = 101 LT_VERS_AGE = 0 H5detect_CFLAGS = -g $(AM_CFLAGS) @@ -511,7 +514,8 @@ libhdf5_la_SOURCES = H5.c H5checksum.c H5dbg.c H5system.c H5timer.c H5trace.c \ H5E.c H5Edeprec.c H5Eint.c \ H5EA.c H5EAcache.c H5EAdbg.c H5EAdblkpage.c H5EAdblock.c H5EAhdr.c \ H5EAiblock.c H5EAint.c H5EAsblock.c H5EAstat.c H5EAtest.c \ - H5F.c H5Faccum.c H5Fdbg.c H5Fdeprec.c H5Fefc.c H5Ffake.c H5Fio.c \ + H5F.c H5Faccum.c H5Fcwfs.c \ + H5Fdbg.c H5Fdeprec.c H5Fefc.c H5Ffake.c H5Fio.c \ H5Fmount.c H5Fmpi.c H5Fquery.c \ H5Fsfile.c H5Fsuper.c H5Fsuper_cache.c H5Ftest.c \ H5FA.c H5FAcache.c H5FAdbg.c H5FAdblock.c H5FAdblkpage.c H5FAhdr.c \ @@ -528,7 +532,7 @@ libhdf5_la_SOURCES = H5.c H5checksum.c H5dbg.c H5system.c H5timer.c H5trace.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 \ H5HFspace.c H5HFstat.c H5HFtest.c H5HFtiny.c \ - H5HG.c H5HGcache.c H5HGdbg.c \ + H5HG.c H5HGcache.c H5HGdbg.c H5HGquery.c \ H5HL.c H5HLcache.c H5HLdbg.c H5HLint.c \ H5HP.c H5I.c H5Itest.c H5L.c H5Lexternal.c H5lib_settings.c \ H5MF.c H5MFaggr.c H5MFdbg.c H5MFsection.c \ @@ -795,6 +799,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5FSstat.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5FStest.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Faccum.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Fcwfs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Fdbg.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Fdeprec.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Fefc.Plo@am__quote@ @@ -844,6 +849,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5HG.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5HGcache.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5HGdbg.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5HGquery.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5HL.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5HLcache.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5HLdbg.Plo@am__quote@ diff --git a/src/hdf5.h b/src/hdf5.h index ef15063..a37329d 100644 --- a/src/hdf5.h +++ b/src/hdf5.h @@ -41,6 +41,7 @@ /* Predefined file drivers */ #include "H5FDcore.h" /* Files stored entirely in memory */ +#include "H5FDdirect.h" /* Linux direct I/O */ #include "H5FDfamily.h" /* File families */ #include "H5FDlog.h" /* sec2 driver with I/O logging (for debugging) */ #include "H5FDmpi.h" /* MPI-based file drivers */ @@ -50,6 +51,5 @@ #ifdef H5_HAVE_WINDOWS #include "H5FDwindows.h" /* Windows buffered I/O */ #endif -#include "H5FDdirect.h" /* Linux direct I/O */ #endif diff --git a/src/libhdf5.settings.in b/src/libhdf5.settings.in index a873062..343fa34 100644 --- a/src/libhdf5.settings.in +++ b/src/libhdf5.settings.in @@ -39,6 +39,7 @@ Languages: ---------- Fortran: @HDF_FORTRAN@ @BUILD_FORTRAN_CONDITIONAL_TRUE@ Fortran Compiler: @FC_VERSION@ +@BUILD_FORTRAN_CONDITIONAL_TRUE@ Fortran 2003 Compiler: @HAVE_FORTRAN_2003@ @BUILD_FORTRAN_CONDITIONAL_TRUE@ Fortran Flags: @FCFLAGS@ @BUILD_FORTRAN_CONDITIONAL_TRUE@ H5 Fortran Flags: @H5_FCFLAGS@ @BUILD_FORTRAN_CONDITIONAL_TRUE@ AM Fortran Flags: @AM_FCFLAGS@ diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 9ff9614..a2577b9 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8) +cmake_minimum_required (VERSION 2.8.6) PROJECT (HDF5_TEST) #----------------------------------------------------------------------------- @@ -29,8 +29,8 @@ IF (MINGW) TARGET_LINK_LIBRARIES (${HDF5_TEST_LIB_TARGET} "wsock32.lib") ENDIF (MINGW) TARGET_LINK_LIBRARIES (${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) -SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_TEST_LIB_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_TEST_LIB_TARGET} ${HDF5_TEST_LIB_NAME} ${LIB_TYPE}) +SET_TARGET_PROPERTIES (${HDF5_TEST_LIB_TARGET} PROPERTIES FOLDER libraries/test) # -------------------------------------------------------------------- # Copy all the HDF5 files from the test directory into the source directory @@ -88,11 +88,14 @@ SET (HDF5_REFERENCE_TEST_FILES filespace_1_6.h5 filespace_1_8.h5 fill_old.h5 + filter_error.h5 group_old.h5 le_data.h5 le_extlink1.h5 le_extlink2.h5 mergemsg.h5 + multi_file_v16-r.h5 + multi_file_v16-s.h5 noencoder.h5 specmetaread.h5 tarrold.h5 @@ -105,7 +108,6 @@ SET (HDF5_REFERENCE_TEST_FILES tmtimen.h5 tmtimeo.h5 tsizeslheap.h5 - vms_data.h5 ) FOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) @@ -151,8 +153,31 @@ SET (testhdf5_SRCS ADD_EXECUTABLE (testhdf5 ${testhdf5_SRCS}) TARGET_NAMING (testhdf5 ${LIB_TYPE}) TARGET_LINK_LIBRARIES (testhdf5 ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) +SET_TARGET_PROPERTIES (testhdf5 PROPERTIES FOLDER test) +# Remove any output file left over from previous test run +ADD_TEST ( + NAME h5test-clear-testhdf5-objects + COMMAND ${CMAKE_COMMAND} + -E remove + coord.h5 + sys_file1 + tattr.h5 + tfile1.h5 + tfile2.h5 + tfile3.h5 + tfile4.h5 + tfile5.h5 + tfile6.h5 + th5o_file + th5s1.h5 + tselect.h5 + tsohm.h5 + tsohm_dst.h5 + tsohm_src.h5 +) ADD_TEST (NAME testhdf5 COMMAND $) +SET_TESTS_PROPERTIES(testhdf5 PROPERTIES DEPENDS h5test-clear-testhdf5-objects) ############################################################################## ############################################################################## @@ -164,6 +189,7 @@ MACRO (ADD_H5_TEST file) ADD_EXECUTABLE (${file} ${HDF5_TEST_SOURCE_DIR}/${file}.c) TARGET_NAMING (${file} ${LIB_TYPE}) TARGET_LINK_LIBRARIES (${file} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) + SET_TARGET_PROPERTIES (${file} PROPERTIES FOLDER test) ADD_TEST (NAME ${file} COMMAND $) ENDMACRO (ADD_H5_TEST file) @@ -173,8 +199,6 @@ ADD_TEST ( NAME h5test-clear-objects COMMAND ${CMAKE_COMMAND} -E remove - cache_test.h5 - coord.h5 dt_arith1.h5 dt_arith2.h5 dtransform.h5 @@ -224,24 +248,10 @@ ADD_TEST ( extlinks19B00027.h5 extlinks19B00028.h5 fheap.h5 - objcopy_ext.h5 - sys_file1 - tattr.h5 + new_multi_file_v16-r.h5 + new_multi_file_v16-s.h5 + objcopy_ext.dat testmeta.h5 - tfile1.h5 - tfile2.h5 - tfile3.h5 - tfile4.h5 - tfile5.h5 - th5o_file - th5s1.h5 - th5s2.h5 - th5s3.h5 - tnullspace.h5 - tselect.h5 - tsohm.h5 - tsohm_dst.h5 - tsohm_src.h5 tstint1.h5 tstint2.h5 ) @@ -316,23 +326,47 @@ SET_TESTS_PROPERTIES(flush2 PROPERTIES DEPENDS flush1) ADD_EXECUTABLE (cache ${HDF5_TEST_SOURCE_DIR}/cache.c ${HDF5_TEST_SOURCE_DIR}/cache_common.c) TARGET_NAMING (cache ${LIB_TYPE}) TARGET_LINK_LIBRARIES (cache ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) - +SET_TARGET_PROPERTIES (cache PROPERTIES FOLDER test) +ADD_TEST ( + NAME h5test-clear-cache-objects + COMMAND ${CMAKE_COMMAND} + -E remove + cache_test.h5 +) ADD_TEST (NAME cache COMMAND $) -SET_TESTS_PROPERTIES(cache PROPERTIES DEPENDS h5test-clear-objects) +SET_TESTS_PROPERTIES(cache PROPERTIES DEPENDS h5test-clear-cache-objects) #-- Adding test for cache_api ADD_EXECUTABLE (cache_api ${HDF5_TEST_SOURCE_DIR}/cache_api.c ${HDF5_TEST_SOURCE_DIR}/cache_common.c) TARGET_NAMING (cache_api ${LIB_TYPE}) TARGET_LINK_LIBRARIES (cache_api ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) +SET_TARGET_PROPERTIES (cache_api PROPERTIES FOLDER test) +ADD_TEST ( + NAME h5test-clear-cache_api-objects + COMMAND ${CMAKE_COMMAND} + -E remove + cache_api_test.h5 +) ADD_TEST (NAME cache_api COMMAND $) +SET_TESTS_PROPERTIES(cache_api PROPERTIES DEPENDS h5test-clear-cache_api-objects) #-- Adding test for cache_tagging ADD_EXECUTABLE (cache_tagging ${HDF5_TEST_SOURCE_DIR}/cache_tagging.c ${HDF5_TEST_SOURCE_DIR}/cache_common.c) TARGET_NAMING (cache_tagging ${LIB_TYPE}) TARGET_LINK_LIBRARIES (cache_tagging ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) +SET_TARGET_PROPERTIES (cache_tagging PROPERTIES FOLDER test) +ADD_TEST ( + NAME h5test-clear-cache_tagging-objects + COMMAND ${CMAKE_COMMAND} + -E remove + tagging_test.h5 + tagging_ext_test.h5 +) ADD_TEST (NAME cache_tagging COMMAND $) +SET_TESTS_PROPERTIES(cache_tagging PROPERTIES DEPENDS h5test-clear-cache_tagging-objects) + #-- Adding test for ttsafe ADD_EXECUTABLE (ttsafe ${HDF5_TEST_SOURCE_DIR}/ttsafe.c @@ -343,15 +377,34 @@ ADD_EXECUTABLE (ttsafe ) TARGET_NAMING (ttsafe ${LIB_TYPE}) TARGET_LINK_LIBRARIES (ttsafe ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) +SET_TARGET_PROPERTIES (ttsafe PROPERTIES FOLDER test) +ADD_TEST ( + NAME h5test-clear-ttsafe-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ttsafe_error.h5 + ttsafe_dcreate.h5 + ttsafe_cancel.h5 + ttsafe_acreate.h5 +) ADD_TEST (NAME ttsafe COMMAND $) +SET_TESTS_PROPERTIES(ttsafe PROPERTIES DEPENDS h5test-clear-ttsafe-objects) #-- Adding test for err_compat IF (HDF5_ENABLE_DEPRECATED_SYMBOLS) ADD_EXECUTABLE (err_compat ${HDF5_TEST_SOURCE_DIR}/err_compat.c) TARGET_NAMING (err_compat ${LIB_TYPE}) TARGET_LINK_LIBRARIES (err_compat ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) + SET_TARGET_PROPERTIES (err_compat PROPERTIES FOLDER test) + ADD_TEST ( + NAME h5test-clear-err_compat-objects + COMMAND ${CMAKE_COMMAND} + -E remove + err_compat.txt + err_compat.txt.err + ) ADD_TEST (NAME err_compat COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" -D "TEST_ARGS:STRING=" @@ -362,13 +415,22 @@ IF (HDF5_ENABLE_DEPRECATED_SYMBOLS) -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) + SET_TESTS_PROPERTIES(err_compat PROPERTIES DEPENDS h5test-clear-err_compat-objects) ENDIF (HDF5_ENABLE_DEPRECATED_SYMBOLS) #-- Adding test for error_test ADD_EXECUTABLE (error_test ${HDF5_TEST_SOURCE_DIR}/error_test.c) TARGET_NAMING (error_test ${LIB_TYPE}) TARGET_LINK_LIBRARIES (error_test ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) +SET_TARGET_PROPERTIES (error_test PROPERTIES FOLDER test) +ADD_TEST ( + NAME h5test-clear-error_test-objects + COMMAND ${CMAKE_COMMAND} + -E remove + error_test.txt + error_test.txt.err +) ADD_TEST (NAME error_test COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" -D "TEST_ARGS:STRING=" @@ -379,12 +441,24 @@ ADD_TEST (NAME error_test COMMAND "${CMAKE_COMMAND}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) +SET_TESTS_PROPERTIES(error_test PROPERTIES DEPENDS h5test-clear-error_test-objects) #-- Adding test for links_env ADD_EXECUTABLE (links_env ${HDF5_TEST_SOURCE_DIR}/links_env.c) TARGET_NAMING (links_env ${LIB_TYPE}) TARGET_LINK_LIBRARIES (links_env ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) +SET_TARGET_PROPERTIES (links_env PROPERTIES FOLDER test) +ADD_TEST ( + NAME h5test-clear-links_env-objects + COMMAND ${CMAKE_COMMAND} + -E remove + links_env.txt + links_env.txt.err + extlinks_env0.h5 + extlinks_env1.h5 + tmp/extlinks_env1.h5 +) ADD_TEST (NAME links_env COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" -D "TEST_ARGS:STRING=" @@ -396,6 +470,27 @@ ADD_TEST (NAME links_env COMMAND "${CMAKE_COMMAND}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) +SET_TESTS_PROPERTIES(links_env PROPERTIES DEPENDS h5test-clear-links_env-objects) + +#-- Adding test for libinfo +SET (GREP_RUNNER ${PROJECT_BINARY_DIR}/GrepRunner.cmake) +FILE (WRITE ${GREP_RUNNER} + "FILE (STRINGS \${TEST_PROGRAM} TEST_RESULT REGEX \"SUMMARY OF THE HDF5 CONFIGURATION\") +IF (\${TEST_RESULT} STREQUAL \"0\") + MESSAGE (FATAL_ERROR \"Failed: The output: \${TEST_RESULT} of \${TEST_PROGRAM} did not contain SUMMARY OF THE HDF5 CONFIGURATION\") +ELSE (\${TEST_RESULT} STREQUAL \"0\") + MESSAGE (STATUS \"COMMAND Result: \${TEST_RESULT}\") +ENDIF (\${TEST_RESULT} STREQUAL \"0\") +" +) + +ADD_TEST (NAME testlibinfo COMMAND ${CMAKE_COMMAND} -D "TEST_PROGRAM=$" -P "${GREP_RUNNER}") + +############################################################################## +############################################################################## +### V F D T E S T S ### +############################################################################## +############################################################################## IF (HDF5_TEST_VFD) @@ -513,6 +608,7 @@ IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) ADD_EXECUTABLE (${genfile} ${HDF5_TEST_SOURCE_DIR}/${genfile}.c) TARGET_NAMING (${genfile} ${LIB_TYPE}) TARGET_LINK_LIBRARIES (${genfile} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) + SET_TARGET_PROPERTIES (${genfile} PROPERTIES FOLDER generator/test) ENDMACRO (ADD_H5_GENERATOR genfile) # generator executables @@ -537,10 +633,7 @@ IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) ) FOREACH (gen ${H5_GENERATORS}) - ADD_EXECUTABLE (${gen} ${HDF5_TEST_SOURCE_DIR}/${gen}.c) - TARGET_NAMING (${gen} ${LIB_TYPE}) - TARGET_LINK_LIBRARIES (${gen} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) + ADD_H5_GENERATOR (${gen}) ENDFOREACH (gen ${H5_GENERATORS}) ENDIF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) - diff --git a/test/Makefile.am b/test/Makefile.am index 7c8eeed..df093b7 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -119,7 +119,7 @@ CHECK_CLEANFILES+=accum.h5 cmpd_dset.h5 compact_dataset.h5 dataset.h5 \ stab.h5 extern_[1-3].h5 extern_[1-4][ab].raw gheap[0-4].h5 \ dt_arith[1-2] links.h5 links[0-6]*.h5 extlinks[0-15].h5 tmp \ big.data big[0-9][0-9][0-9][0-9][0-9].h5 \ - stdio.h5 sec2.h5 dtypes[1-8].h5 dt_arith[1-2].h5 tattr.h5 \ + stdio.h5 sec2.h5 dtypes[0-9].h5 dt_arith[1-2].h5 tattr.h5 \ tselect.h5 mtime.h5 unlink.h5 unicode.h5 coord.h5 \ fillval_[0-9].h5 fillval.raw mount_[0-9].h5 testmeta.h5 ttime.h5 \ trefer[1-3].h5 tvltypes.h5 tvlstr.h5 tvlstr2.h5 flush.h5 \ @@ -132,7 +132,8 @@ CHECK_CLEANFILES+=accum.h5 cmpd_dset.h5 compact_dataset.h5 dataset.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 app_ref.h5 farray.h5 \ - earray.h5 efc[0-5].h5 log_vfd_out.log swmr_data.h5 \ + earray.h5 efc[0-5].h5 log_vfd_out.log new_multi_file_v16-r.h5 \ + new_multi_file_v16-s.h5 swmr_data.h5 \ flushrefresh.h5 flushrefresh_VERIFICATION_START \ flushrefresh_VERIFICATION_CHECKPOINT1 flushrefresh_VERIFICATION_CHECKPOINT2 \ flushrefresh_VERIFICATION_DONE diff --git a/test/Makefile.in b/test/Makefile.in index 23c6ca8..d462da7 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -59,7 +59,9 @@ DIST_COMMON = $(srcdir)/H5srcdir_str.h.in $(srcdir)/Makefile.am \ $(top_srcdir)/config/commence.am \ $(top_srcdir)/config/conclude.am COPYING bin_PROGRAMS = swmr_generator$(EXEEXT) swmr_reader$(EXEEXT) \ - swmr_writer$(EXEEXT) swmr_remove_reader$(EXEEXT) swmr_remove_writer$(EXEEXT) swmr_addrem_writer$(EXEEXT) swmr_sparse_reader$(EXEEXT) swmr_sparse_writer$(EXEEXT) + swmr_writer$(EXEEXT) swmr_remove_reader$(EXEEXT) \ + swmr_remove_writer$(EXEEXT) swmr_addrem_writer$(EXEEXT) \ + swmr_sparse_reader$(EXEEXT) swmr_sparse_writer$(EXEEXT) check_PROGRAMS = $(am__EXEEXT_1) error_test$(EXEEXT) \ err_compat$(EXEEXT) tcheck_version$(EXEEXT) testmeta$(EXEEXT) \ links_env$(EXEEXT) flushrefresh$(EXEEXT) @@ -368,6 +370,10 @@ stab_SOURCES = stab.c stab_OBJECTS = stab.$(OBJEXT) stab_LDADD = $(LDADD) stab_DEPENDENCIES = libh5test.la $(LIBHDF5) +swmr_addrem_writer_SOURCES = swmr_addrem_writer.c +swmr_addrem_writer_OBJECTS = swmr_addrem_writer.$(OBJEXT) +swmr_addrem_writer_LDADD = $(LDADD) +swmr_addrem_writer_DEPENDENCIES = libh5test.la $(LIBHDF5) swmr_generator_SOURCES = swmr_generator.c swmr_generator_OBJECTS = swmr_generator.$(OBJEXT) swmr_generator_LDADD = $(LDADD) @@ -376,10 +382,6 @@ swmr_reader_SOURCES = swmr_reader.c swmr_reader_OBJECTS = swmr_reader.$(OBJEXT) swmr_reader_LDADD = $(LDADD) swmr_reader_DEPENDENCIES = libh5test.la $(LIBHDF5) -swmr_writer_SOURCES = swmr_writer.c -swmr_writer_OBJECTS = swmr_writer.$(OBJEXT) -swmr_writer_LDADD = $(LDADD) -swmr_writer_DEPENDENCIES = libh5test.la $(LIBHDF5) swmr_remove_reader_SOURCES = swmr_remove_reader.c swmr_remove_reader_OBJECTS = swmr_remove_reader.$(OBJEXT) swmr_remove_reader_LDADD = $(LDADD) @@ -388,10 +390,6 @@ swmr_remove_writer_SOURCES = swmr_remove_writer.c swmr_remove_writer_OBJECTS = swmr_remove_writer.$(OBJEXT) swmr_remove_writer_LDADD = $(LDADD) swmr_remove_writer_DEPENDENCIES = libh5test.la $(LIBHDF5) -swmr_addrem_writer_SOURCES = swmr_addrem_writer.c -swmr_addrem_writer_OBJECTS = swmr_addrem_writer.$(OBJEXT) -swmr_addrem_writer_LDADD = $(LDADD) -swmr_addrem_writer_DEPENDENCIES = libh5test.la $(LIBHDF5) swmr_sparse_reader_SOURCES = swmr_sparse_reader.c swmr_sparse_reader_OBJECTS = swmr_sparse_reader.$(OBJEXT) swmr_sparse_reader_LDADD = $(LDADD) @@ -400,6 +398,10 @@ swmr_sparse_writer_SOURCES = swmr_sparse_writer.c swmr_sparse_writer_OBJECTS = swmr_sparse_writer.$(OBJEXT) swmr_sparse_writer_LDADD = $(LDADD) swmr_sparse_writer_DEPENDENCIES = libh5test.la $(LIBHDF5) +swmr_writer_SOURCES = swmr_writer.c +swmr_writer_OBJECTS = swmr_writer.$(OBJEXT) +swmr_writer_LDADD = $(LDADD) +swmr_writer_DEPENDENCIES = libh5test.la $(LIBHDF5) tcheck_version_SOURCES = tcheck_version.c tcheck_version_OBJECTS = tcheck_version.$(OBJEXT) tcheck_version_LDADD = $(LDADD) @@ -473,7 +475,9 @@ SOURCES = $(libh5test_la_SOURCES) accum.c app_ref.c big.c bittests.c \ gen_udlinks.c getname.c gheap.c hyperslab.c istore.c lheap.c \ links.c links_env.c mf.c mount.c mtime.c ntypes.c objcopy.c \ ohdr.c pool.c reserved.c set_extent.c space_overflow.c stab.c \ - swmr_generator.c swmr_reader.c swmr_writer.c swmr_remove_reader.c swmr_remove_writer.c swmr_addrem_writer.c swmr_sparse_reader.c swmr_sparse_writer.c tcheck_version.c \ + swmr_addrem_writer.c swmr_generator.c swmr_reader.c \ + swmr_remove_reader.c swmr_remove_writer.c swmr_sparse_reader.c \ + swmr_sparse_writer.c swmr_writer.c tcheck_version.c \ $(testhdf5_SOURCES) testmeta.c $(ttsafe_SOURCES) unlink.c \ vfd.c DIST_SOURCES = $(libh5test_la_SOURCES) accum.c app_ref.c big.c \ @@ -489,8 +493,10 @@ DIST_SOURCES = $(libh5test_la_SOURCES) accum.c app_ref.c big.c \ gen_specmetaread.c gen_udlinks.c getname.c gheap.c hyperslab.c \ istore.c lheap.c links.c links_env.c mf.c mount.c mtime.c \ ntypes.c objcopy.c ohdr.c pool.c reserved.c set_extent.c \ - space_overflow.c stab.c swmr_generator.c swmr_reader.c \ - swmr_writer.c swmr_remove_reader.c swmr_remove_writer.c swmr_addrem_writer.c swmr_sparse_reader.c swmr_sparse_writer.c tcheck_version.c $(testhdf5_SOURCES) testmeta.c \ + space_overflow.c stab.c swmr_addrem_writer.c swmr_generator.c \ + swmr_reader.c swmr_remove_reader.c swmr_remove_writer.c \ + swmr_sparse_reader.c swmr_sparse_writer.c swmr_writer.c \ + tcheck_version.c $(testhdf5_SOURCES) testmeta.c \ $(ttsafe_SOURCES) unlink.c vfd.c ETAGS = etags CTAGS = ctags @@ -562,6 +568,7 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ +FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ @@ -582,10 +589,12 @@ H5_LONE_COLON = @H5_LONE_COLON@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ +HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ +HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ @@ -790,7 +799,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog accum.h5 cmpd_dset.h5 \ extern_[1-4][ab].raw gheap[0-4].h5 dt_arith[1-2] links.h5 \ links[0-6]*.h5 extlinks[0-15].h5 tmp big.data \ big[0-9][0-9][0-9][0-9][0-9].h5 stdio.h5 sec2.h5 \ - dtypes[1-8].h5 dt_arith[1-2].h5 tattr.h5 tselect.h5 mtime.h5 \ + dtypes[0-9].h5 dt_arith[1-2].h5 tattr.h5 tselect.h5 mtime.h5 \ unlink.h5 unicode.h5 coord.h5 fillval_[0-9].h5 fillval.raw \ mount_[0-9].h5 testmeta.h5 ttime.h5 trefer[1-3].h5 tvltypes.h5 \ tvlstr.h5 tvlstr2.h5 flush.h5 enum1.h5 titerate.h5 ttsafe.h5 \ @@ -803,7 +812,8 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog accum.h5 cmpd_dset.h5 \ tstint[1-2].h5 unlink_chunked.h5 btree2.h5 objcopy_src.h5 \ objcopy_dst.h5 objcopy_ext.dat trefer1.h5 trefer2.h5 \ app_ref.h5 farray.h5 earray.h5 efc[0-5].h5 log_vfd_out.log \ - swmr_data.h5 flushrefresh.h5 flushrefresh_VERIFICATION_START \ + new_multi_file_v16-r.h5 new_multi_file_v16-s.h5 swmr_data.h5 \ + flushrefresh.h5 flushrefresh_VERIFICATION_START \ flushrefresh_VERIFICATION_CHECKPOINT1 \ flushrefresh_VERIFICATION_CHECKPOINT2 \ flushrefresh_VERIFICATION_DONE @@ -1199,30 +1209,30 @@ space_overflow$(EXEEXT): $(space_overflow_OBJECTS) $(space_overflow_DEPENDENCIES stab$(EXEEXT): $(stab_OBJECTS) $(stab_DEPENDENCIES) @rm -f stab$(EXEEXT) $(AM_V_CCLD)$(LINK) $(stab_OBJECTS) $(stab_LDADD) $(LIBS) +swmr_addrem_writer$(EXEEXT): $(swmr_addrem_writer_OBJECTS) $(swmr_addrem_writer_DEPENDENCIES) + @rm -f swmr_addrem_writer$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(swmr_addrem_writer_OBJECTS) $(swmr_addrem_writer_LDADD) $(LIBS) swmr_generator$(EXEEXT): $(swmr_generator_OBJECTS) $(swmr_generator_DEPENDENCIES) @rm -f swmr_generator$(EXEEXT) $(AM_V_CCLD)$(LINK) $(swmr_generator_OBJECTS) $(swmr_generator_LDADD) $(LIBS) swmr_reader$(EXEEXT): $(swmr_reader_OBJECTS) $(swmr_reader_DEPENDENCIES) @rm -f swmr_reader$(EXEEXT) $(AM_V_CCLD)$(LINK) $(swmr_reader_OBJECTS) $(swmr_reader_LDADD) $(LIBS) -swmr_writer$(EXEEXT): $(swmr_writer_OBJECTS) $(swmr_writer_DEPENDENCIES) - @rm -f swmr_writer$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(swmr_writer_OBJECTS) $(swmr_writer_LDADD) $(LIBS) -swmr_remove_reader$(EXEEXT): $(swmr_remove_reader_OBJECTS) $(swmr_remove_reader_DEPENDENCIES) +swmr_remove_reader$(EXEEXT): $(swmr_remove_reader_OBJECTS) $(swmr_remove_reader_DEPENDENCIES) @rm -f swmr_remove_reader$(EXEEXT) $(AM_V_CCLD)$(LINK) $(swmr_remove_reader_OBJECTS) $(swmr_remove_reader_LDADD) $(LIBS) -swmr_remove_writer$(EXEEXT): $(swmr_remove_writer_OBJECTS) $(swmr_remove_writer_DEPENDENCIES) +swmr_remove_writer$(EXEEXT): $(swmr_remove_writer_OBJECTS) $(swmr_remove_writer_DEPENDENCIES) @rm -f swmr_remove_writer$(EXEEXT) $(AM_V_CCLD)$(LINK) $(swmr_remove_writer_OBJECTS) $(swmr_remove_writer_LDADD) $(LIBS) -swmr_addrem_writer$(EXEEXT): $(swmr_addrem_writer_OBJECTS) $(swmr_addrem_writer_DEPENDENCIES) - @rm -f swmr_addrem_writer$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(swmr_addrem_writer_OBJECTS) $(swmr_addrem_writer_LDADD) $(LIBS) -swmr_sparse_reader$(EXEEXT): $(swmr_sparse_reader_OBJECTS) $(swmr_sparse_reader_DEPENDENCIES) +swmr_sparse_reader$(EXEEXT): $(swmr_sparse_reader_OBJECTS) $(swmr_sparse_reader_DEPENDENCIES) @rm -f swmr_sparse_reader$(EXEEXT) $(AM_V_CCLD)$(LINK) $(swmr_sparse_reader_OBJECTS) $(swmr_sparse_reader_LDADD) $(LIBS) -swmr_sparse_writer$(EXEEXT): $(swmr_sparse_writer_OBJECTS) $(swmr_sparse_writer_DEPENDENCIES) +swmr_sparse_writer$(EXEEXT): $(swmr_sparse_writer_OBJECTS) $(swmr_sparse_writer_DEPENDENCIES) @rm -f swmr_sparse_writer$(EXEEXT) $(AM_V_CCLD)$(LINK) $(swmr_sparse_writer_OBJECTS) $(swmr_sparse_writer_LDADD) $(LIBS) +swmr_writer$(EXEEXT): $(swmr_writer_OBJECTS) $(swmr_writer_DEPENDENCIES) + @rm -f swmr_writer$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(swmr_writer_OBJECTS) $(swmr_writer_LDADD) $(LIBS) tcheck_version$(EXEEXT): $(tcheck_version_OBJECTS) $(tcheck_version_DEPENDENCIES) @rm -f tcheck_version$(EXEEXT) $(AM_V_CCLD)$(LINK) $(tcheck_version_OBJECTS) $(tcheck_version_LDADD) $(LIBS) @@ -1315,15 +1325,15 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/set_extent.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/space_overflow.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stab.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/swmr_addrem_writer.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/swmr_common.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/swmr_generator.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/swmr_reader.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/swmr_writer.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/swmr_remove_reader.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/swmr_remove_writer.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/swmr_addrem_writer.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/swmr_sparse_reader.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/swmr_sparse_writer.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/swmr_writer.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tarray.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tattr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tcheck_version.Po@am__quote@ diff --git a/test/be_data.h5 b/test/be_data.h5 index 0feefa3..e6629d3 100644 Binary files a/test/be_data.h5 and b/test/be_data.h5 differ diff --git a/test/big.c b/test/big.c index 24b2d25..dffbbeb 100644 --- a/test/big.c +++ b/test/big.c @@ -22,14 +22,14 @@ /* * The purpose of this test is to verify if a virtual file driver can handle: * a. Large file (2GB) - * This should exceed 32bits I/O system since offset is a signed - * integral type (in order to support negative offset with respect to - * end of file). + * This should exceed 32bits I/O system since offset is a signed + * integral type (in order to support negative offset with respect to + * end of file). * b. Extra Large file (4GB) - * This definite exceeds 32bit I/O and file systems. + * This definite exceeds 32bit I/O and file systems. * c. Huge file (tens of GB) - * This verifies the HDF5 library handles big logical file size - * correctly. + * This verifies the HDF5 library handles big logical file size + * correctly. * In practice, if a VFD can handle a big file size, there is no need to * test the smaller file sizes. E.g., If it can handle the Huge file, * there is no need to test the Extra large or Large files. Therefore the @@ -81,15 +81,15 @@ typedef enum vfd_t { SEC2_VFD, STDIO_VFD, FAMILY_VFD } vfd_t; fsizes_t file_size= NOFILE; const char *FILENAME[] = { - "big", - "sec2", - "stdio", - NULL + "big", + "sec2", + "stdio", + NULL }; -int cflag=1; /* check file system before test */ -int sparse_support=0; /* sparse file supported, default false */ -int have_space=0; /* enough space for huge file test, default false */ -hsize_t family_size_def=FAMILY_SIZE; /* default family file size */ +int cflag=1; /* check file system before test */ +int sparse_support=0; /* sparse file supported, default false */ +int have_space=0; /* enough space for huge file test, default false */ +hsize_t family_size_def=FAMILY_SIZE; /* default family file size */ /* Protocols */ static void usage(void); @@ -216,55 +216,55 @@ supports_big(vfd_t vfd) case FAMILY_VFD: case SEC2_VFD: case STDIO_VFD: - if ((fd=HDopen("y.h5", O_RDWR|O_TRUNC|O_CREAT, 0666)) < 0) - goto error; - - /* Write a few byte at the beginning */ - if (5!=HDwrite(fd, "hello", (size_t)5)) - goto quit; - fsize = SFILE; - - /* Write a few bytes at 2GB */ - if (HDlseek(fd, 2*GB, SEEK_SET)!=2*GB) - goto quit; - if (5!=HDwrite(fd, "hello", (size_t)5)) - goto quit; - fsize = LFILE; - - /* Write a few bytes at 4GB */ - if (HDlseek(fd, 4*GB, SEEK_SET) != 4*GB) - goto quit; - if (5!=HDwrite(fd, "hello", (size_t)5)) - goto quit; - fsize = XLFILE; - - /* If this supports sparse_file, write a few bytes at 32GB */ - if (!sparse_support) - goto quit; - if (HDlseek(fd, 32*GB, SEEK_SET) != 32*GB) - goto quit; - if (5!=HDwrite(fd, "hello", (size_t)5)) - goto quit; - fsize = HUGEFILE; - - break; + if ((fd=HDopen("y.h5", O_RDWR|O_TRUNC|O_CREAT, 0666)) < 0) + goto error; + + /* Write a few byte at the beginning */ + if (5!=HDwrite(fd, "hello", (size_t)5)) + goto quit; + fsize = SFILE; + + /* Write a few bytes at 2GB */ + if (HDlseek(fd, 2*GB, SEEK_SET)!=2*GB) + goto quit; + if (5!=HDwrite(fd, "hello", (size_t)5)) + goto quit; + fsize = LFILE; + + /* Write a few bytes at 4GB */ + if (HDlseek(fd, 4*GB, SEEK_SET) != 4*GB) + goto quit; + if (5!=HDwrite(fd, "hello", (size_t)5)) + goto quit; + fsize = XLFILE; + + /* If this supports sparse_file, write a few bytes at 32GB */ + if (!sparse_support) + goto quit; + if (HDlseek(fd, 32*GB, SEEK_SET) != 32*GB) + goto quit; + if (5!=HDwrite(fd, "hello", (size_t)5)) + goto quit; + fsize = HUGEFILE; + + break; default: - /* unknown or unsupported VFD */ - goto error; - break; + /* unknown or unsupported VFD */ + goto error; + break; } - + quit: if (HDclose(fd) < 0) - goto error; + goto error; if (HDremove("y.h5") < 0) - goto error; + goto error; return(fsize); error: if (fd >= 0){ - HDclose(fd); - HDremove("y.h5"); + HDclose(fd); + HDremove("y.h5"); } return (fsize); } @@ -300,30 +300,30 @@ enough_room(hid_t fapl) for (i=0; i=0; i++) { - HDsnprintf(name, sizeof name, filename, i); - if(HDclose(fd[i]) < 0) + HDsnprintf(name, sizeof name, filename, i); + if(HDclose(fd[i]) < 0) ret_value=0; - HDremove(name); + HDremove(name); } return ret_value; @@ -356,43 +356,43 @@ writer (char* filename, hid_t fapl, fsizes_t testsize, int wrt_n) hsize_t hs_start[1]; hsize_t hs_size[1]; hid_t file=-1, space1=-1, space2=-1, mem_space=-1, d1=-1, d2=-1; - int *buf = (int*)malloc (sizeof(int) * WRT_SIZE); + int *buf = (int*)HDmalloc (sizeof(int) * WRT_SIZE); int i, j; - FILE *out = fopen(DNAME, "w"); + FILE *out = HDfopen(DNAME, "w"); hid_t dcpl; switch(testsize){ case LFILE: - TESTING("Large dataset write(2GB)"); - /* reduce size1 to produce a 2GB dataset */ - size1[1] = 1024/16; - size2[0] /= 16; - break; + TESTING("Large dataset write(2GB)"); + /* reduce size1 to produce a 2GB dataset */ + size1[1] = 1024/16; + size2[0] /= 16; + break; case XLFILE: - TESTING("Extra large dataset write(4GB)"); - /* reduce size1 to produce a 4GB dataset */ - size1[1] = 1024/8; - size2[0] /= 8; - break; + TESTING("Extra large dataset write(4GB)"); + /* reduce size1 to produce a 4GB dataset */ + size1[1] = 1024/8; + size2[0] /= 8; + break; case HUGEFILE: - TESTING("Huge dataset write"); - /* Leave size1 as 32GB */ - break; + TESTING("Huge dataset write"); + /* Leave size1 as 32GB */ + break; case SFILE: - TESTING("small dataset write(1GB)"); - /* reduce size1 to produce a 1GB dataset */ - size1[1] = 1024/32; - size2[0] /= 32; - break; + TESTING("small dataset write(1GB)"); + /* reduce size1 to produce a 1GB dataset */ + size1[1] = 1024/32; + size2[0] /= 32; + break; case NOFILE: - /* what to do?? */ - HDfprintf(stdout, "Unexpected file size of NOFILE\n"); - goto error; - break; + /* what to do?? */ + HDfprintf(stdout, "Unexpected file size of NOFILE\n"); + goto error; + break; } /* @@ -400,30 +400,30 @@ writer (char* filename, hid_t fapl, fsizes_t testsize, int wrt_n) * which is a family of files. Each member of the family will be 1GB */ if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) { - goto error; + goto error; } /* Create simple data spaces according to the size specified above. */ if ((space1 = H5Screate_simple (4, size1, size1)) < 0 || - (space2 = H5Screate_simple (1, size2, size2)) < 0) { - goto error; + (space2 = H5Screate_simple (1, size2, size2)) < 0) { + goto error; } /* Create the datasets */ -/* - * The fix below is provided for bug#921 - * H5Dcreate with H5P_DEFAULT creation properties - * will create a set of solid 1GB files; test will crash if quotas are enforced - * or it will take some time to write a file. - * We should create a dataset allocating space late and never writing fill values. - * EIP 4/8/03 -*/ + /* + * The fix below is provided for bug#921 + * H5Dcreate with H5P_DEFAULT creation properties + * will create a set of solid 1GB files; test will crash if quotas are enforced + * or it will take some time to write a file. + * We should create a dataset allocating space late and never writing fill values. + * EIP 4/8/03 + */ dcpl = H5Pcreate(H5P_DATASET_CREATE); H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_LATE); H5Pset_fill_time(dcpl, H5D_FILL_TIME_NEVER); if((d1 = H5Dcreate2(file, "d1", H5T_NATIVE_INT, space1, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0 || - (d2 = H5Dcreate2(file, "d2", H5T_NATIVE_INT, space2, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) { - goto error; + (d2 = H5Dcreate2(file, "d2", H5T_NATIVE_INT, space2, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) { + goto error; } @@ -431,15 +431,15 @@ writer (char* filename, hid_t fapl, fsizes_t testsize, int wrt_n) hs_size[0] = WRT_SIZE; if ((mem_space = H5Screate_simple (1, hs_size, hs_size)) < 0) goto error; for (i=0; i}\n" - "\t-h\tPrint the help page\n" - "\t-c\tFile system Checking skipped. Caution: this test generates\n" - "\t\tmany big files and may fill up the file system.\n" - "\t-fsize\tChange family size default to where is\n" - "\t\ta positive float point number. Default value is %Hu.\n" - "Examples:\n" - "\tbig -fsize 2.1e9 \t# test with file size just under 2GB\n" - "\tbig -fsize 2.2e9 \t# test with file size just above 2GB\n" - "\tBe sure the file system can support the file size requested\n" - , (hsize_t)FAMILY_SIZE); + "Usage: big [-h] [-c] [-fsize }\n" + "\t-h\tPrint the help page\n" + "\t-c\tFile system Checking skipped. Caution: this test generates\n" + "\t\tmany big files and may fill up the file system.\n" + "\t-fsize\tChange family size default to where is\n" + "\t\ta positive float point number. Default value is %Hu.\n" + "Examples:\n" + "\tbig -fsize 2.1e9 \t# test with file size just under 2GB\n" + "\tbig -fsize 2.2e9 \t# test with file size just above 2GB\n" + "\tBe sure the file system can support the file size requested\n" + , (hsize_t)FAMILY_SIZE); } - + /* Flush stdout at the end of this test routine to ensure later output to */ /* stderr will not come out before it.*/ int testvfd(vfd_t vfd) @@ -611,107 +611,107 @@ int testvfd(vfd_t vfd) switch(vfd){ case FAMILY_VFD: - /* Test huge file with the family driver */ - puts("Testing big file with the Family Driver "); - if ((fapl=H5Pcreate(H5P_FILE_ACCESS)) < 0) - goto error; - - if (H5Pset_fapl_family(fapl, family_size_def, H5P_DEFAULT) < 0) - goto error; - - if (cflag){ - /* - * We shouldn't run this test if the file system doesn't support holes - * because we would generate multi-gigabyte files. - */ - puts("Checking if file system is adequate for this test..."); - if (sizeof(long long)<8 || 0==GB8LL) { - puts("Test skipped because sizeof(long long) is too small. This"); - puts("hardware apparently doesn't support 64-bit integer types."); - usage(); - goto quit; - } - if (!sparse_support) { - puts("Test skipped because file system does not support holes."); - usage(); - goto quit; - } - if (!enough_room(fapl)) { - puts("Test skipped because of quota (file size or num open files)."); - usage(); - goto quit; - } - } - - /* Do the test with the Family Driver */ - h5_fixname(FILENAME[0], fapl, filename, sizeof filename); - - if (writer(filename, fapl, HUGEFILE, WRT_N)) goto error; - if (reader(filename, fapl)) goto error; - - puts("Test passed with the Family Driver."); - break; + /* Test huge file with the family driver */ + HDputs("Testing big file with the Family Driver "); + if ((fapl=H5Pcreate(H5P_FILE_ACCESS)) < 0) + goto error; + + if (H5Pset_fapl_family(fapl, family_size_def, H5P_DEFAULT) < 0) + goto error; + + if (cflag){ + /* + * We shouldn't run this test if the file system doesn't support holes + * because we would generate multi-gigabyte files. + */ + HDputs("Checking if file system is adequate for this test..."); + if (sizeof(long long)<8 || 0==GB8LL) { + HDputs("Test skipped because sizeof(long long) is too small. This"); + HDputs("hardware apparently doesn't support 64-bit integer types."); + usage(); + goto quit; + } + if (!sparse_support) { + HDputs("Test skipped because file system does not support holes."); + usage(); + goto quit; + } + if (!enough_room(fapl)) { + HDputs("Test skipped because of quota (file size or num open files)."); + usage(); + goto quit; + } + } + + /* Do the test with the Family Driver */ + h5_fixname(FILENAME[0], fapl, filename, sizeof filename); + + if (writer(filename, fapl, HUGEFILE, WRT_N)) goto error; + if (reader(filename, fapl)) goto error; + + HDputs("Test passed with the Family Driver."); + break; case SEC2_VFD: - testsize = supports_big(SEC2_VFD); - if (testsize == NOFILE) { - HDfprintf(stdout, "Test for sec2 is skipped because file system does not support big files.\n"); - goto quit; - } - /* Test big file with the SEC2 driver */ - puts("Testing big file with the SEC2 Driver "); + testsize = supports_big(SEC2_VFD); + if (testsize == NOFILE) { + HDfprintf(stdout, "Test for sec2 is skipped because file system does not support big files.\n"); + goto quit; + } + /* Test big file with the SEC2 driver */ + HDputs("Testing big file with the SEC2 Driver "); - if ((fapl=H5Pcreate(H5P_FILE_ACCESS)) < 0) - goto error; - if(H5Pset_fapl_sec2(fapl) < 0) - goto error; + if ((fapl=H5Pcreate(H5P_FILE_ACCESS)) < 0) + goto error; + if(H5Pset_fapl_sec2(fapl) < 0) + goto error; - h5_fixname(FILENAME[1], fapl, filename, sizeof filename); + h5_fixname(FILENAME[1], fapl, filename, sizeof filename); - if (writer(filename, fapl, testsize, WRT_N)) goto error; - if (reader(filename, fapl)) goto error; + if (writer(filename, fapl, testsize, WRT_N)) goto error; + if (reader(filename, fapl)) goto error; - puts("Test passed with the SEC2 Driver."); - break; + HDputs("Test passed with the SEC2 Driver."); + break; case STDIO_VFD: - testsize = supports_big(STDIO_VFD); - if (testsize == NOFILE) { - HDfprintf(stdout, "Test for stdio is skipped because file system does not support big files.\n"); - goto quit; - } - puts("\nTesting big file with the STDIO Driver "); + testsize = supports_big(STDIO_VFD); + if (testsize == NOFILE) { + HDfprintf(stdout, "Test for stdio is skipped because file system does not support big files.\n"); + goto quit; + } + HDputs("\nTesting big file with the STDIO Driver "); - if ((fapl=H5Pcreate(H5P_FILE_ACCESS)) < 0) - goto error; - if(H5Pset_fapl_stdio(fapl) < 0) - goto error; + if ((fapl=H5Pcreate(H5P_FILE_ACCESS)) < 0) + goto error; + if(H5Pset_fapl_stdio(fapl) < 0) + goto error; - h5_fixname(FILENAME[2], fapl, filename, sizeof filename); + h5_fixname(FILENAME[2], fapl, filename, sizeof filename); - if (writer(filename, fapl, testsize, WRT_N)) goto error; - if (reader(filename, fapl)) goto error; - puts("Test passed with the STDIO Driver."); - break; + if (writer(filename, fapl, testsize, WRT_N)) goto error; + if (reader(filename, fapl)) goto error; + HDputs("Test passed with the STDIO Driver."); + break; default: - puts("Unsupprted VFD"); - usage(); - goto error;; + HDputs("Unsupprted VFD"); + usage(); + goto error;; } /* end of switch (vfd) */ quit: /* End with normal return code */ /* Clean up the test file */ if (h5_cleanup(FILENAME, fapl)) HDremove(DNAME); - fflush(stdout); + HDfflush(stdout); return 0; error: if (fapl>=0) H5Pclose(fapl); - puts("*** TEST FAILED ***"); - fflush(stdout); + HDputs("*** TEST FAILED ***"); + HDfflush(stdout); return 1; } @@ -748,58 +748,58 @@ main (int ac, char **av) /* parameters setup */ while (--ac > 0){ - av++; - if (strcmp("-fsize", *av)==0){ - /* specify a different family file size */ - ac--; av++; - if (ac > 0) { - family_size_def = (hsize_t)HDstrtoull(*av, NULL, 0); - } - else{ - printf("***Missing fsize value***\n"); - usage(); - return 1; - } - } - else if (strcmp("-c", *av)==0){ - /* turn off file system check before test */ - cflag=0; - } - else if (strcmp("-h", *av)==0){ - usage(); - return 0; - }else{ - usage(); - return 1; - } + av++; + if (HDstrcmp("-fsize", *av)==0){ + /* specify a different family file size */ + ac--; av++; + if (ac > 0) { + family_size_def = (hsize_t)HDstrtoull(*av, NULL, 0); + } + else{ + printf("***Missing fsize value***\n"); + usage(); + return 1; + } + } + else if (HDstrcmp("-c", *av)==0){ + /* turn off file system check before test */ + cflag=0; + } + else if (HDstrcmp("-h", *av)==0){ + usage(); + return 0; + }else{ + usage(); + return 1; + } } /* check sparse file support unless cflag is not set. */ if (cflag) - sparse_support = is_sparse(); + sparse_support = is_sparse(); /* Choose random # seed */ seed = (unsigned long)HDtime(NULL); #ifdef QAK -/* seed = (unsigned long)1155438845; */ -HDfprintf(stderr, "Random # seed was: %lu\n", seed); + /* seed = (unsigned long)1155438845; */ + HDfprintf(stderr, "Random # seed was: %lu\n", seed); #endif /* QAK */ HDsrandom(seed); -/*=================================================*/ + /*=================================================*/ if (testvfd(FAMILY_VFD) != 0) - goto error; + goto error; if (testvfd(SEC2_VFD) != 0) - goto error; + goto error; if (testvfd(STDIO_VFD) != 0) - goto error; + goto error; /* End with normal exit code */ return 0; error: - puts("*** TEST FAILED ***"); + HDputs("*** TEST FAILED ***"); return 1; } diff --git a/test/cross_read.c b/test/cross_read.c index 6588031..308a0c1 100755 --- a/test/cross_read.c +++ b/test/cross_read.c @@ -17,7 +17,7 @@ * Programmer: Raymond Lu * Thursday, March 23, 2006 * - * Purpose: Check if floating-point data created on OpenVMS, big-endian, and + * Purpose: Check if floating-point data created on big-endian and * little-endian machines can be read on the machine running this test. */ @@ -31,7 +31,8 @@ const char *FILENAME[] = { NULL }; -#define DATASETNAME "Array" +#define DATASETNAME "Array_le" +#define DATASETNAME1 "Array_be" #define DATASETNAME2 "Scale_offset_float_data_le" #define DATASETNAME3 "Scale_offset_float_data_be" #define DATASETNAME4 "Scale_offset_double_data_le" @@ -44,94 +45,112 @@ const char *FILENAME[] = { #define DATASETNAME11 "Scale_offset_int_data_be" #define DATASETNAME12 "Scale_offset_long_long_data_le" #define DATASETNAME13 "Scale_offset_long_long_data_be" + +#define DATASETNAME14 "Fletcher_float_data_le" +#define DATASETNAME15 "Fletcher_float_data_be" +#define DATASETNAME16 "Deflate_float_data_le" +#define DATASETNAME17 "Deflate_float_data_be" +#define DATASETNAME18 "Szip_float_data_le" +#define DATASETNAME19 "Szip_float_data_be" +#define DATASETNAME20 "Shuffle_float_data_le" +#define DATASETNAME21 "Shuffle_float_data_be" +#define DATASETNAME22 "Nbit_float_data_le" +#define DATASETNAME23 "Nbit_float_data_be" + #define NX 6 #define NY 6 /*------------------------------------------------------------------------- - * Function: read_data + * Function: open_dataset * - * Purpose: Read data from a data file. + * Purpose: Read and compare the data from a dataset. * * Return: Success: 0 - * Failure: -1 + * Failure: 1 * * Programmer: Raymond Lu - * 21 January 2011 + * 17 May 2011 * * Modifications: * *------------------------------------------------------------------------- */ -static int read_data(char *fname) +static int check_data(const char *dsetname, hid_t fid, hbool_t floating_number) { - const char *pathname = H5_get_srcdir_filename(fname); /* Corrected test file name */ - hid_t file, dataset; /* handles */ + hid_t dataset; /* handles */ double data_in[NX+1][NY]; /* input buffer */ double data_out[NX+1][NY]; /* output buffer */ long long int_data_in[NX+1][NY]; /* input buffer */ long long int_data_out[NX+1][NY]; /* output buffer */ int i, j; unsigned nerrors = 0; - const char *not_supported= " Scaleoffset filter is not enabled."; - - /* - * Open the file. - */ - if((file = H5Fopen(pathname, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) - TEST_ERROR; - - TESTING("regular dataset"); /* * Open the regular dataset. */ - if((dataset = H5Dopen2(file, DATASETNAME, H5P_DEFAULT)) < 0) + if((dataset = H5Dopen2(fid, dsetname, H5P_DEFAULT)) < 0) TEST_ERROR; /* * Data and output buffer initialization. */ for (j = 0; j < NX; j++) { - for (i = 0; i < NY; i++) { - data_in[j][i] = i + j; - data_out[j][i] = 0; + for (i = 0; i < NY; i++) { + data_in[j][i] = ((double)(i + j + 1))/3; + data_out[j][i] = 0; + + int_data_in[j][i] = i + j; + int_data_out[j][i] = 0; } } for (i = 0; i < NY; i++) { data_in[NX][i] = -2.2; data_out[NX][i] = 0; + + int_data_in[NX][i] = -2; + int_data_out[NX][i] = 0; } - /* - * 0 1 2 3 4 5 - * 1 2 3 4 5 6 - * 2 3 4 5 6 7 - * 3 4 5 6 7 8 - * 4 5 6 7 8 9 - * 5 6 7 8 9 10 - * -2.2 -2.2 -2.2 -2.2 -2.2 -2.2 - */ /* * Read data from hyperslab in the file into the hyperslab in * memory and display. */ - if(H5Dread(dataset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, - data_out) < 0) - TEST_ERROR; - - /* Check results */ - for (j=0; j<(NX+1); j++) { - for (i=0; i 4) + i_mask = ~((unsigned)~0 << (precision[0] + offset[0])) & ((unsigned)~0 << offset[0]); + else { + i_mask = 0xffffffff; + i_mask = i_mask & ((unsigned)~0 << offset[0]); + } c_mask = ~((unsigned)~0 << (precision[1] + offset[1])) & ((unsigned)~0 << offset[1]); s_mask = ~((unsigned)~0 << (precision[2] + offset[2])) & ((unsigned)~0 << offset[2]); b_mask = ~((unsigned)~0 << (precision[4] + offset[4])) & ((unsigned)~0 << offset[4]); @@ -9770,6 +9781,121 @@ error: /*------------------------------------------------------------------------- + * Function: test_large_chunk_shrink + * + * Purpose: Tests support for shrinking a chunk larger than 1 MB by a + * size greater than 1 MB. + * + * Return: Success: 0 + * Failure: -1 + * + * Programmer: Neil Fortner + * Monday, November 31, 2011 + * + *------------------------------------------------------------------------- + */ +static herr_t +test_large_chunk_shrink(hid_t fapl) +{ + char filename[FILENAME_BUF_SIZE]; + hid_t fid = -1; /* File ID */ + hid_t dcpl = -1; /* Dataset creation property list ID */ + hid_t sid = -1; /* Dataspace ID */ + hid_t scalar_sid = -1;/* Scalar dataspace ID */ + hid_t dsid = -1; /* Dataset ID */ + hsize_t dim, max_dim, chunk_dim; /* Dataset and chunk dimensions */ + hsize_t hs_offset; /* Hyperslab offset */ + hsize_t hs_size; /* Hyperslab size */ + unsigned write_elem, read_elem; /* Element written/read */ + + TESTING("shrinking large chunk"); + + h5_fixname(FILENAME[10], fapl, filename, sizeof filename); + + /* Create file */ + if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR + + /* Create dataset creation property list */ + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) FAIL_STACK_ERROR + + /* Set 2 MB chunk size */ + chunk_dim = 2 * 1024 * 1024 / sizeof(unsigned); + if(H5Pset_chunk(dcpl, 1, &chunk_dim) < 0) FAIL_STACK_ERROR + + /* Create scalar dataspace */ + if((scalar_sid = H5Screate(H5S_SCALAR)) < 0) FAIL_STACK_ERROR + + /* Create 1-D dataspace */ + dim = 2 * 1024 * 1024 / sizeof(unsigned); + max_dim = H5S_UNLIMITED; + if((sid = H5Screate_simple(1, &dim, &max_dim)) < 0) FAIL_STACK_ERROR + + /* Create 2 MB chunked dataset */ + if((dsid = H5Dcreate2(fid, "dset", H5T_NATIVE_UINT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR + + /* Select last element in the dataset */ + hs_offset = dim - 1; + hs_size = 1; + if(H5Sselect_hyperslab(sid, H5S_SELECT_SET, &hs_offset, NULL, &hs_size, NULL) < 0) FAIL_STACK_ERROR + + /* Read (unwritten) element from dataset */ + read_elem = 1; + if(H5Dread(dsid, H5T_NATIVE_UINT, scalar_sid, sid, H5P_DEFAULT, &read_elem) < 0) FAIL_STACK_ERROR + + /* Verify unwritten element is fill value (0) */ + if(read_elem != 0) FAIL_PUTS_ERROR("invalid unwritten element read"); + + /* Write element to dataset */ + write_elem = 2; + if(H5Dwrite(dsid, H5T_NATIVE_UINT, scalar_sid, sid, H5P_DEFAULT, &write_elem) < 0) FAIL_STACK_ERROR + + /* Read element from dataset */ + read_elem = write_elem + 1; + if(H5Dread(dsid, H5T_NATIVE_UINT, scalar_sid, sid, H5P_DEFAULT, &read_elem) < 0) FAIL_STACK_ERROR + + /* Verify written element is read in */ + if(read_elem != write_elem) FAIL_PUTS_ERROR("invalid written element read"); + + /* Shrink dataset to 512 KB */ + dim = 512 * 1024 / sizeof(unsigned); + if(H5Dset_extent(dsid, &dim) < 0) FAIL_STACK_ERROR + + /* Expand dataset back to 2MB */ + dim = 2 * 1024 * 1024 / sizeof(unsigned); + if(H5Dset_extent(dsid, &dim) < 0) FAIL_STACK_ERROR + + /* Read element from dataset */ + read_elem = 1; + if(H5Dread(dsid, H5T_NATIVE_UINT, scalar_sid, sid, H5P_DEFAULT, &read_elem) < 0) FAIL_STACK_ERROR + + /* Verify element is now 0 */ + if(read_elem != 0) FAIL_PUTS_ERROR("invalid element read"); + + /* Close everything */ + if(H5Sclose(sid) < 0) FAIL_STACK_ERROR + if(H5Sclose(scalar_sid) < 0) FAIL_STACK_ERROR + if(H5Dclose(dsid) < 0) FAIL_STACK_ERROR + if(H5Pclose(dcpl) < 0) FAIL_STACK_ERROR + if(H5Fclose(fid) < 0) FAIL_STACK_ERROR + + PASSED(); + + return 0; + +error: + H5E_BEGIN_TRY { + H5Pclose(dcpl); + H5Dclose(dsid); + H5Sclose(sid); + H5Sclose(scalar_sid); + H5Fclose(fid); + } H5E_END_TRY; + return -1; +} /* end test_large_chunk_shrink() */ + + +/*------------------------------------------------------------------------- * Function: main * * Purpose: Tests the dataset interface (H5D) @@ -9900,6 +10026,7 @@ main(void) nerrors += (test_fixed_array(my_fapl) < 0 ? 1 : 0); nerrors += (test_idx_compatible() < 0 ? 1 : 0); nerrors += (test_unfiltered_edge_chunks(my_fapl) < 0 ? 1 : 0); + nerrors += (test_large_chunk_shrink(my_fapl) < 0 ? 1 : 0); if(H5Fclose(file) < 0) goto error; diff --git a/test/dt_arith.c b/test/dt_arith.c index 078242d..054f069 100644 --- a/test/dt_arith.c +++ b/test/dt_arith.c @@ -121,7 +121,7 @@ static int without_hardware_g = 0; TYPE value2 = 0; \ \ /* Allocate buffers */ \ - NELMTS=(SRC_PREC-1)*3+1; \ + NELMTS=SRC_PREC*3; \ BUF = (unsigned char*)aligned_malloc(NELMTS*MAX(SRC_SIZE, DST_SIZE)); \ SAVED = (unsigned char*)aligned_malloc(NELMTS*MAX(SRC_SIZE, DST_SIZE)); \ HDmemset(BUF, 0, NELMTS*MAX(SRC_SIZE, DST_SIZE)); \ @@ -132,7 +132,7 @@ static int without_hardware_g = 0; \ /*positive values, ascending order. VALUE1 starts from 00000001, to 00000010, until 10000000*/ \ /*VALUE2 ascends from 00000000, to 00000011, 00000111,..., until 11111111.*/ \ - for(n=0; n=SRC_MIN) { \ memcpy(buf_p, &value1, SRC_SIZE); \ memcpy(saved_p, &value1, SRC_SIZE); \ @@ -146,20 +146,26 @@ static int without_hardware_g = 0; saved_p += SRC_SIZE; \ } \ \ - value1 <<= 1; \ - value2 = (value1 - 1) | value1; \ + if(n=SRC_MIN) { \ memcpy(buf_p, &value2, SRC_SIZE); \ memcpy(saved_p, &value2, SRC_SIZE); \ buf_p += SRC_SIZE; \ saved_p += SRC_SIZE; \ } \ - value2 <<= 1; \ + if(n=0) { + FAIL_PUTS_ERROR("Operation not allowed for this type."); + } /* end if */ + H5E_BEGIN_TRY { size=H5Tget_precision(complex_id); } H5E_END_TRY; @@ -3210,7 +3238,11 @@ test_compound_18(void) /* Open Generated File */ /* (generated with gen_bad_compound.c) */ +#ifdef H5_VMS + if((file = H5Fopen(TESTFILE, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR +#else if((file = H5Fopen(testfile, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR +#endif /* Try to open the datatype */ H5E_BEGIN_TRY { @@ -3896,6 +3928,67 @@ mkstr(size_t len, H5T_str_t strpad) /*------------------------------------------------------------------------- + * Function: test_str_create + * + * Purpose: Test string type creation using H5Tcreate + * + * Return: Success: 0 + * Failure: number of errors + * + * Programmer: Raymond Lu + * 19 May 2011 + * + *------------------------------------------------------------------------- + */ +static int +test_str_create(void) +{ + hid_t fixed_str1, fixed_str2; + hid_t vlen_str1, vlen_str2; + htri_t is_vl_str = FALSE; + size_t query_size, str_size = 10; + + TESTING("string type creation using H5Tcreate"); + + /* Create fixed-length string in two ways and make sure they are the same */ + if((fixed_str1 = mkstr(str_size, H5T_STR_NULLTERM)) < 0) goto error; + + if((fixed_str2 = H5Tcreate(H5T_STRING, str_size)) < 0) goto error; + if(H5Tset_strpad(fixed_str2, H5T_STR_NULLTERM) < 0) goto error; + + if(!H5Tequal(fixed_str1, fixed_str2)) goto error; + + if((query_size = H5Tget_size(fixed_str1)) == 0) goto error; + if(query_size != str_size) goto error; + + if((query_size = H5Tget_size(fixed_str2)) == 0) goto error; + if(query_size != str_size) goto error; + + /* Create variable-length string in two ways and make sure they are the same */ + if((vlen_str1 = mkstr((size_t)H5T_VARIABLE, H5T_STR_NULLTERM)) < 0) goto error; + + if((vlen_str2 = H5Tcreate(H5T_STRING, (size_t)H5T_VARIABLE)) < 0) goto error; + if(H5Tset_strpad(vlen_str2, H5T_STR_NULLTERM) < 0) goto error; + + if(!H5Tequal(vlen_str1, vlen_str2)) goto error; + + if((is_vl_str = H5Tis_variable_str(vlen_str1)) < 0) goto error; + if(!is_vl_str) goto error; + + if((is_vl_str = H5Tis_variable_str(vlen_str2)) < 0) goto error; + if(!is_vl_str) goto error; + + + PASSED(); + return 0; + +error: + H5_FAILED(); + return 1; +} + + +/*------------------------------------------------------------------------- * Function: test_conv_str_1 * * Purpose: Test string conversions @@ -4415,8 +4508,6 @@ error: * Failure: number of errors * * Programmer: Robb Matzke, LLNL, 2003-06-09 - * - * Modifications: *------------------------------------------------------------------------- */ static int @@ -4432,7 +4523,7 @@ test_conv_enum_2(void) "PURPLE", "ORANGE", "WHITE" }; - + TESTING("non-native enumeration type conversion"); /* Source enum type */ @@ -6441,6 +6532,353 @@ error: return 1; } /* end test_named_indirect_reopen() */ +static void create_del_obj_named_test_file(const char *filename, hid_t fapl, + hbool_t new_format) +{ + hid_t file; /* File ID */ + hid_t type; /* Datatype ID */ + hid_t space; /* Dataspace ID */ + hid_t attr; /* Attribute ID */ + hid_t dset; /* Dataset ID */ + hid_t fcpl; /* File creation property list ID */ + hid_t my_fapl; /* Copy of file access property list ID */ + hid_t dcpl; /* Dataset creation property list ID */ + herr_t status; /* Generic return value */ + + /* Make copy of FAPL */ + my_fapl = H5Pcopy(fapl); + assert(my_fapl > 0); + + if(new_format) { + /* Use latest version of file format */ + status = H5Pset_libver_bounds(my_fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST); + assert(status >= 0); + } /* end if */ + + /* Create a file creation property list (used for the root group's creation property list) */ + fcpl = H5Pcreate(H5P_FILE_CREATE); + assert(fcpl > 0); + + if(new_format) { + /* Use dense link storage for all links in root group */ + status = H5Pset_link_phase_change(fcpl, 0, 0); + assert(status >= 0); + } /* end if */ + + /* Create file with attribute that uses committed datatype */ + file = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, my_fapl); + assert(file > 0); + + /* Close FCPL */ + status = H5Pclose(fcpl); + assert(status >= 0); + + /* Close FAPL */ + status = H5Pclose(my_fapl); + assert(status >= 0); + + /* Create datatype to commit */ + type = H5Tvlen_create(H5T_NATIVE_INT); + assert(type > 0); + + /* Commit datatype */ + status = H5Tcommit2(file, DEL_OBJ_NAMED_NAMED_DTYPE, type, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + assert(status >= 0); + + /* Create scalar dataspace */ + space = H5Screate(H5S_SCALAR); + assert(space > 0); + + /* Create a dataset creation property list */ + dcpl = H5Pcreate(H5P_DATASET_CREATE); + assert(dcpl > 0); + + if(new_format) { + /* Use dense attribute storage for all attributes on dataset */ + status = H5Pset_attr_phase_change(dcpl, 0, 0); + assert(status >= 0); + } /* end if */ + + /* Create dataset */ + dset = H5Dcreate2(file, DEL_OBJ_NAMED_DATASET, type, space, H5P_DEFAULT, dcpl, H5P_DEFAULT); + assert(dset > 0); + + /* Close DCPL */ + status = H5Pclose(dcpl); + assert(status >= 0); + + /* Close dataset */ + status = H5Dclose(dset); + assert(status >= 0); + + /* Create attribute */ + attr = H5Acreate_by_name(file, DEL_OBJ_NAMED_DATASET, DEL_OBJ_NAMED_ATTRIBUTE, type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + assert(attr > 0); + + /* Close dataspace */ + status = H5Sclose(space); + assert(status >= 0); + + /* Close datatype */ + status = H5Tclose(type); + assert(status >= 0); + + /* Close attribute */ + status = H5Aclose(attr); + assert(status >= 0); + + /* Close file */ + status = H5Fclose(file); + assert(status >= 0); +} /* end create_del_obj_named_test_file() */ + + +/*------------------------------------------------------------------------- + * Function: test_delete_obj_named + * + * Purpose: Tests that delete objects that use named datatypes through + * different file IDs + * + * Return: Success: 0 + * Failure: number of errors + * + * Programmer: Quincey Koziol + * Monday, July 18, 2011 + * + *------------------------------------------------------------------------- + */ +static int +test_delete_obj_named(hid_t fapl) +{ + hid_t filea1 = -1, filea2 = -1, fileb = -1; /* File IDs */ + hid_t attr = -1; /* Attribute ID */ + hid_t dset = -1; /* Dataset ID */ + hid_t fapl2 = -1; /* File access property list ID */ + hbool_t new_format; /* Whether to use old or new format */ + char filename[1024], filename2[1024]; + + TESTING("deleting objects that use named datatypes"); + + /* Set up filenames & FAPLs */ + if((fapl2 = H5Pcopy(fapl)) < 0) FAIL_STACK_ERROR + h5_fixname(FILENAME[8], fapl, filename, sizeof filename); + h5_fixname(FILENAME[9], fapl2, filename2, sizeof filename2); + + /* Loop over old & new format files */ + for(new_format = FALSE; new_format <= TRUE; new_format++) { + /* Create test file, with attribute that uses committed datatype */ + create_del_obj_named_test_file(filename, fapl, new_format); + +/* Test deleting dataset opened through different file ID */ + if((filea1 = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR + if((filea2 = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR + + if((dset = H5Dopen2(filea1, DEL_OBJ_NAMED_DATASET, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + if(H5Dclose(dset) < 0) FAIL_STACK_ERROR + + if(H5Fclose(filea1) < 0) FAIL_STACK_ERROR + + if((fileb = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl2)) < 0) FAIL_STACK_ERROR + + if(H5Ldelete(filea2, DEL_OBJ_NAMED_DATASET, H5P_DEFAULT) < 0) FAIL_STACK_ERROR + + if(H5Fclose(filea2) < 0) FAIL_STACK_ERROR + if(H5Fclose(fileb) < 0) FAIL_STACK_ERROR + + + /* Create test file, with attribute that uses committed datatype */ + create_del_obj_named_test_file(filename, fapl, new_format); + +/* Test deleting attribute opened through different file ID */ + if((filea1 = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR + if((filea2 = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR + + if((attr = H5Aopen_by_name(filea1, DEL_OBJ_NAMED_DATASET, DEL_OBJ_NAMED_ATTRIBUTE, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + if(H5Aclose(attr) < 0) FAIL_STACK_ERROR + + if(H5Fclose(filea1) < 0) FAIL_STACK_ERROR + + if((fileb = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl2)) < 0) FAIL_STACK_ERROR + + if(H5Adelete_by_name(filea2, DEL_OBJ_NAMED_DATASET, DEL_OBJ_NAMED_ATTRIBUTE, H5P_DEFAULT) < 0) FAIL_STACK_ERROR + + if(H5Fclose(filea2) < 0) FAIL_STACK_ERROR + if(H5Fclose(fileb) < 0) FAIL_STACK_ERROR + } /* end for */ + + if(H5Pclose(fapl2) < 0) FAIL_STACK_ERROR + + PASSED(); + return 0; + +error: + H5E_BEGIN_TRY { + H5Tclose(attr); + H5Dclose(dset); + H5Pclose(fapl2); + H5Fclose(filea1); + H5Fclose(filea2); + H5Fclose(fileb); + } H5E_END_TRY; + return 1; +} /* end test_delete_obj_named() */ + + +/*------------------------------------------------------------------------- + * Function: test_delete_obj_named_fileid + * + * Purpose: Tests that objects that use named datatypes through + * different file IDs get the correct file IDs + * + * Return: Success: 0 + * Failure: number of errors + * + * Programmer: Quincey Koziol + * Thursday, July 28, 2011 + * + *------------------------------------------------------------------------- + */ +static int +test_delete_obj_named_fileid(hid_t fapl) +{ + hid_t filea1 = -1, filea2 = -1, fileb = -1; /* File IDs */ + hid_t dset_fid = -1; /* File ID from dataset */ + hid_t type_fid = -1; /* File ID from datatype */ + hid_t attr_fid = -1; /* File ID from attribute */ + hid_t type = -1; /* Datatype ID */ + hid_t attr = -1; /* Attribute ID */ + hid_t dset = -1; /* Dataset ID */ + hid_t fapl2 = -1; /* File access property list ID */ + hbool_t new_format; /* Whether to use old or new format */ + char filename[1024], filename2[1024]; + + TESTING("deleting objects that use named datatypes"); + + /* Set up filenames & FAPLs */ + if((fapl2 = H5Pcopy(fapl)) < 0) FAIL_STACK_ERROR + h5_fixname(FILENAME[8], fapl, filename, sizeof filename); + h5_fixname(FILENAME[9], fapl2, filename2, sizeof filename2); + + /* Loop over old & new format files */ + for(new_format = FALSE; new_format <= TRUE; new_format++) { + /* Create test file, with attribute that uses committed datatype */ + create_del_obj_named_test_file(filename, fapl, new_format); + +/* Test getting file ID for dataset opened through different file ID */ + if((filea1 = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR + + if((filea2 = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR + + if((dset = H5Dopen2(filea1, DEL_OBJ_NAMED_DATASET, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + + /* Verify file ID from dataset matches correct file */ + dset_fid = H5Iget_file_id(dset); + if(dset_fid != filea1) TEST_ERROR + H5Fclose(dset_fid); + + /* Verify file ID from datatype (from dataset) matches correct file */ + type = H5Dget_type(dset); + type_fid = H5Iget_file_id(type); + if(type_fid != filea1) TEST_ERROR + H5Fclose(type_fid); + H5Tclose(type); + + if(H5Dclose(dset) < 0) FAIL_STACK_ERROR + + if(H5Fclose(filea1) < 0) FAIL_STACK_ERROR + + if((fileb = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl2)) < 0) FAIL_STACK_ERROR + + if((filea1 = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR + + if((dset = H5Dopen2(filea1, DEL_OBJ_NAMED_DATASET, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + + /* Verify file ID from dataset matches correct file */ + dset_fid = H5Iget_file_id(dset); + if(dset_fid != filea1) TEST_ERROR + H5Fclose(dset_fid); + + /* Verify file ID from datatype (from dataset) matches correct file */ + type = H5Dget_type(dset); + type_fid = H5Iget_file_id(type); + if(type_fid != filea1) TEST_ERROR + H5Fclose(type_fid); + H5Tclose(type); + + if(H5Dclose(dset) < 0) FAIL_STACK_ERROR + + if(H5Fclose(filea1) < 0) FAIL_STACK_ERROR + if(H5Fclose(filea2) < 0) FAIL_STACK_ERROR + if(H5Fclose(fileb) < 0) FAIL_STACK_ERROR + + + /* Create test file, with attribute that uses committed datatype */ + create_del_obj_named_test_file(filename, fapl, new_format); + +/* Test getting file ID for attribute opened through different file ID */ + if((filea1 = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR + if((filea2 = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR + + if((attr = H5Aopen_by_name(filea1, DEL_OBJ_NAMED_DATASET, DEL_OBJ_NAMED_ATTRIBUTE, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + + /* Verify file ID from dataset matches correct file */ + attr_fid = H5Iget_file_id(attr); + if(attr_fid != filea1) TEST_ERROR + H5Fclose(attr_fid); + + /* Verify file ID from datatype (from dataset) matches correct file */ + type = H5Aget_type(attr); + type_fid = H5Iget_file_id(type); + if(type_fid != filea1) TEST_ERROR + H5Fclose(type_fid); + H5Tclose(type); + + if(H5Aclose(attr) < 0) FAIL_STACK_ERROR + + if(H5Fclose(filea1) < 0) FAIL_STACK_ERROR + + if((fileb = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl2)) < 0) FAIL_STACK_ERROR + + if((filea1 = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR + + if((attr = H5Aopen_by_name(filea1, DEL_OBJ_NAMED_DATASET, DEL_OBJ_NAMED_ATTRIBUTE, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + + /* Verify file ID from dataset matches correct file */ + attr_fid = H5Iget_file_id(attr); + if(attr_fid != filea1) TEST_ERROR + H5Fclose(attr_fid); + + /* Verify file ID from datatype (from dataset) matches correct file */ + type = H5Aget_type(attr); + type_fid = H5Iget_file_id(type); + if(type_fid != filea1) TEST_ERROR + H5Fclose(type_fid); + H5Tclose(type); + + if(H5Aclose(attr) < 0) FAIL_STACK_ERROR + + if(H5Fclose(filea1) < 0) FAIL_STACK_ERROR + if(H5Fclose(filea2) < 0) FAIL_STACK_ERROR + if(H5Fclose(fileb) < 0) FAIL_STACK_ERROR + } /* end for */ + + if(H5Pclose(fapl2) < 0) FAIL_STACK_ERROR + + PASSED(); + return 0; + +error: + H5E_BEGIN_TRY { + H5Tclose(attr); + H5Dclose(dset); + H5Pclose(fapl2); + H5Fclose(filea1); + H5Fclose(filea2); + H5Fclose(fileb); + } H5E_END_TRY; + return 1; +} /* end test_delete_obj_named_fileid() */ + /*------------------------------------------------------------------------- * Function: test_deprec @@ -6592,6 +7030,215 @@ error: /*------------------------------------------------------------------------- + * Function: test_utf_ascii_conv + * + * Purpose: Make sure the library doesn't conversion strings between + * ASCII and UTF8. + * + * Return: Success: 0 + * Failure: number of errors + * + * Programmer: Raymond Lu + * 10 November 2011 + *------------------------------------------------------------------------- + */ +int test_utf_ascii_conv(void) +{ + hid_t fid; + hid_t did; + hid_t utf8_vtid, ascii_vtid; + hid_t utf8_tid, ascii_tid; + hid_t sid; + const char *utf8_w = "foo!"; + char *ascii_r = NULL; + const char *ascii_w = "bar!"; + char *utf8_r = NULL; + + char ascii2[4], utf8_2[4]; + herr_t status; + + TESTING("string conversion between ASCII and UTF"); + + /************************************************ + * Test VL string conversion from UTF8 to ASCII + ************************************************/ + /* Create a variable-length string */ + if((utf8_vtid = H5Tcopy(H5T_C_S1)) < 0) FAIL_STACK_ERROR + + if((status = H5Tset_size(utf8_vtid, H5T_VARIABLE)) < 0) FAIL_STACK_ERROR + + /* Set the character set for the string to UTF-8 */ + if((status = H5Tset_cset(utf8_vtid, H5T_CSET_UTF8)) < 0) FAIL_STACK_ERROR + + /* Create a variable-length string */ + if((ascii_vtid = H5Tcopy(H5T_C_S1)) < 0) FAIL_STACK_ERROR + + if((status = H5Tset_size(ascii_vtid, H5T_VARIABLE)) < 0) FAIL_STACK_ERROR + + /* Set the character set for the string to ASCII (should already be so) */ + if((status = H5Tset_cset(ascii_vtid, H5T_CSET_ASCII) < 0)) FAIL_STACK_ERROR + + /* Test conversion in memory */ + H5E_BEGIN_TRY { + status = H5Tconvert(utf8_vtid, ascii_vtid, 1, (void *)utf8_w, NULL, H5P_DEFAULT); + } H5E_END_TRY + if(status >= 0) + FAIL_STACK_ERROR + + /* Create a file */ + if((fid = H5Fcreate(FILENAME[10], H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + + /* Create a scalar dataspace for the dataset */ + if((sid = H5Screate(H5S_SCALAR)) < 0) FAIL_STACK_ERROR + + /* Create a dataset of UTF8 string type */ + if((did = H5Dcreate2(fid, UTF8_DATASET, utf8_vtid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + + /* Write the UTF8 string, as UTF8 */ + if((status = H5Dwrite(did, utf8_vtid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &utf8_w)) < 0) FAIL_STACK_ERROR + + /* Read the UTF8 string, as ASCII, supposed to fail */ + H5E_BEGIN_TRY { + status = H5Dread(did, ascii_vtid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &ascii_r); + } H5E_END_TRY + if(status >= 0) + FAIL_STACK_ERROR + + /* Close the dataset */ + if((status = H5Dclose(did)) < 0) FAIL_STACK_ERROR + + /************************************************ + * Test VL string conversion from ASCII to UTF8 + ************************************************/ + /* Test conversion in memory */ + H5E_BEGIN_TRY { + status = H5Tconvert(ascii_vtid, utf8_vtid, 1, (void *)ascii_w, NULL, H5P_DEFAULT); + } H5E_END_TRY + if(status >= 0) + FAIL_STACK_ERROR + + /* Create a dataset of ASCII string type */ + if((did = H5Dcreate2(fid, ASCII_DATASET, ascii_vtid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + + /* Write the ASCII string, as ASCII */ + if((status = H5Dwrite(did, ascii_vtid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &ascii_w)) < 0) FAIL_STACK_ERROR + + /* Read the ASCII string, as UTF8, supposed to fail */ + H5E_BEGIN_TRY { + status = H5Dread(did, utf8_vtid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &utf8_r); + } H5E_END_TRY + if(status >= 0) + FAIL_STACK_ERROR + + /* Close the dataset */ + if((status = H5Dclose(did)) < 0) FAIL_STACK_ERROR + + /* Close the UTF8 VL-string datatype */ + if((status = H5Tclose(utf8_vtid)) < 0) FAIL_STACK_ERROR + + /* Close the ASCII VL-string datatype */ + if((status = H5Tclose(ascii_vtid)) < 0) FAIL_STACK_ERROR + + /********************************************************** + * Test fixed-length string conversion from UTF8 to ASCII + **********************************************************/ + /* Create a fixed-length UTF8 string */ + if((utf8_tid = H5Tcopy(H5T_C_S1)) < 0) FAIL_STACK_ERROR + + if((status = H5Tset_size(utf8_tid, 4)) < 0) FAIL_STACK_ERROR + + /* Set the character set for the string to UTF-8 */ + if((status = H5Tset_cset(utf8_tid, H5T_CSET_UTF8)) < 0) FAIL_STACK_ERROR + + /* Create a fixed-length ASCII string */ + if((ascii_tid = H5Tcopy(H5T_C_S1)) < 0) FAIL_STACK_ERROR + + if((status = H5Tset_size(ascii_tid, 4)) < 0) FAIL_STACK_ERROR + + /* Set the character set for the string to ASCII (should already be so) */ + if((status = H5Tset_cset(ascii_tid, H5T_CSET_ASCII) < 0)) FAIL_STACK_ERROR + + /* Test conversion in memory */ + H5E_BEGIN_TRY { + status = H5Tconvert(utf8_tid, ascii_tid, 1, utf8_2, NULL, H5P_DEFAULT); + } H5E_END_TRY + if(status >= 0) + FAIL_STACK_ERROR + + /* Create a dataset */ + if((did = H5Dcreate2(fid, UTF8_DATASET2, utf8_tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + + /* Write the UTF8 string, as UTF8 */ + if((status = H5Dwrite(did, utf8_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &utf8_w)) < 0) FAIL_STACK_ERROR + + /* Read the UTF8 string as ASCII, supposed to fail */ + H5E_BEGIN_TRY { + status = H5Dread(did, ascii_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &ascii2); + } H5E_END_TRY + if(status >= 0) + FAIL_STACK_ERROR + + /* Close the dataset */ + if((status = H5Dclose(did)) < 0) FAIL_STACK_ERROR + + /********************************************************** + * Test fixed-length string conversion from ASCII to UTF8 + **********************************************************/ + /* Test conversion in memory */ + H5E_BEGIN_TRY { + status = H5Tconvert(ascii_tid, utf8_tid, 1, ascii2, NULL, H5P_DEFAULT); + } H5E_END_TRY + if(status >= 0) + FAIL_STACK_ERROR + + /* Create a dataset */ + if((did = H5Dcreate2(fid, ASCII_DATASET2, ascii_tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + + /* Write the ASCII string, as ASCII */ + if((status = H5Dwrite(did, ascii_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &ascii_w)) < 0) FAIL_STACK_ERROR + + /* Read the UTF8 string as ASCII, supposed to fail */ + H5E_BEGIN_TRY { + status = H5Dread(did, utf8_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &utf8_2); + } H5E_END_TRY + if(status >= 0) + FAIL_STACK_ERROR + + /* Close the dataset */ + if((status = H5Dclose(did)) < 0) FAIL_STACK_ERROR + + /* Close the UTF8 string datatype */ + if((status = H5Tclose(utf8_tid)) < 0) FAIL_STACK_ERROR + + /* Close the ASCII string datatype */ + if((status = H5Tclose(ascii_tid)) < 0) FAIL_STACK_ERROR + + /* Close the dataspace */ + if((status = H5Sclose(sid)) < 0) FAIL_STACK_ERROR + + /* Close the file */ + if((status = H5Fclose(fid)) < 0) FAIL_STACK_ERROR + + PASSED(); + return 0; + +error: + H5E_BEGIN_TRY { + H5Tclose(utf8_vtid); + H5Tclose(ascii_vtid); + H5Tclose(utf8_tid); + H5Tclose(ascii_tid); + H5Dclose(did); + H5Sclose(sid); + H5Fclose(fid); + } H5E_END_TRY; + return 1; +} + + + + +/*------------------------------------------------------------------------- * Function: main * * Purpose: Test the datatype interface. @@ -6635,7 +7282,10 @@ main(void) nerrors += test_latest(); nerrors += test_int_float_except(); nerrors += test_named_indirect_reopen(fapl); + nerrors += test_delete_obj_named(fapl); + nerrors += test_delete_obj_named_fileid(fapl); nerrors += test_set_order_compound(fapl); + nerrors += test_str_create(); #ifndef H5_NO_DEPRECATED_SYMBOLS nerrors += test_deprec(fapl); #endif /* H5_NO_DEPRECATED_SYMBOLS */ @@ -6668,6 +7318,7 @@ main(void) nerrors += test_bitfield_funcs(); nerrors += test_opaque(); nerrors += test_set_order(); + nerrors += test_utf_ascii_conv(); if(nerrors) { printf("***** %lu FAILURE%s! *****\n", @@ -6679,4 +7330,3 @@ main(void) return 0; } - diff --git a/test/enum.c b/test/enum.c index e9f607d..3684102 100644 --- a/test/enum.c +++ b/test/enum.c @@ -119,9 +119,6 @@ test_named(hid_t file) * * Programmer: Robb Matzke * Monday, January 4, 1999 - * - * Modifications: - * *------------------------------------------------------------------------- */ static int diff --git a/test/error_test.c b/test/error_test.c index 52dcc0c..1ca9686 100644 --- a/test/error_test.c +++ b/test/error_test.c @@ -20,11 +20,12 @@ * Purpose: Tests the error API routines. */ #include "h5test.h" +#include "H5srcdir.h" #ifdef H5_USE_16_API int main(void) { - printf("Test skipped because backward compatbility with v1.6 is configured in\n"); + HDfprintf(stderr, "Test skipped because backward compatbility with v1.6 is configured in\n"); return 0; } #else /* H5_USE_16_API */ @@ -34,6 +35,8 @@ const char *FILENAME[] = { NULL }; +#define DATAFILE "filter_error" + #define DIM0 100 #define DIM1 200 @@ -74,6 +77,8 @@ hid_t ERR_MIN_GETNUM; #define MSG_SIZE 64 #define LONG_DESC_SIZE 8192 +#define DSET_FILTER_NAME "dataset_with_filter" + static herr_t custom_print_cb(unsigned n, const H5E_error2_t *err_desc, void *client_data); @@ -102,8 +107,7 @@ test_error(hid_t file) H5E_auto2_t old_func; void *old_data; - TESTING("error API based on data I/O"); - printf("\n"); + HDfprintf(stderr, "\nTesting error API based on data I/O\n"); /* Create the data space */ dims[0] = DIM0; @@ -359,8 +363,9 @@ test_long_desc(void) /* Push an error with a long description */ if(H5Epush(H5E_DEFAULT, __FILE__, test_FUNC, __LINE__, ERR_CLS, ERR_MAJ_TEST, ERR_MIN_SUBROUTINE, format, long_desc) < 0) TEST_ERROR; - /* Create the string that should be in the description */ - HDsnprintf(full_desc, LONG_DESC_SIZE + 128, format, long_desc); + /* Create the string that should be in the description. Must use HDsnprintf here + * because snprintf is _snprintf on Windows */ + HDsnprintf(full_desc, (size_t)(LONG_DESC_SIZE + 128), format, long_desc); /* Make certain that the description is correct */ if(H5Ewalk2(H5E_DEFAULT, H5E_WALK_UPWARD, long_desc_cb, full_desc) < 0) TEST_ERROR; @@ -401,12 +406,12 @@ static herr_t dump_error(hid_t estack) { /* Print errors in library default way */ - fprintf(stderr, "********* Print error stack in HDF5 default way *********\n"); + HDfprintf(stderr, "********* Print error stack in HDF5 default way *********\n"); if(H5Eprint2(estack, stderr) < 0) TEST_ERROR; /* Customized way to print errors */ - fprintf(stderr, "\n********* Print error stack in customized way *********\n"); + HDfprintf(stderr, "\n********* Print error stack in customized way *********\n"); if(H5Ewalk2(estack, H5E_WALK_UPWARD, custom_print_cb, stderr) < 0) TEST_ERROR; @@ -450,12 +455,12 @@ custom_print_cb(unsigned n, const H5E_error2_t *err_desc, void* client_data) if(H5Eget_msg(err_desc->min_num, NULL, min, MSG_SIZE) < 0) TEST_ERROR; - fprintf(stream, "%*serror #%03d: %s in %s(): line %u\n", + HDfprintf(stream, "%*serror #%03d: %s in %s(): line %u\n", indent, "", n, err_desc->file_name, err_desc->func_name, err_desc->line); - fprintf(stream, "%*sclass: %s\n", indent * 2, "", cls); - fprintf(stream, "%*smajor: %s\n", indent * 2, "", maj); - fprintf(stream, "%*sminor: %s\n", indent * 2, "", min); + HDfprintf(stream, "%*sclass: %s\n", indent * 2, "", cls); + HDfprintf(stream, "%*smajor: %s\n", indent * 2, "", maj); + HDfprintf(stream, "%*sminor: %s\n", indent * 2, "", min); return 0; @@ -534,7 +539,6 @@ test_copy(void) const char *err_func = "test_copy"; /* Function name for pushing error */ const char *err_msg = "Error message"; /* Error message for pushing error */ int err_num; /* Number of errors on stack */ - int err_num_copy; /* Number of errors on stack copy */ hid_t estack_id; /* Error stack ID */ herr_t ret; /* Generic return value */ @@ -618,6 +622,57 @@ error: /*------------------------------------------------------------------------- + * Function: test_filter_error + * + * Purpose: Make sure the error message prints out the filter name + * when the existent file is opened but the filter isn't + * registered. The existent file was created with + * gen_filters.c. + * + * Return: Success: 0 + * + * Failure: -1 + * + * Programmer: Raymond Lu + * 2 June 2011 + * + *------------------------------------------------------------------------- + */ +static herr_t +test_filter_error(const char *fname) +{ + const char *pathname = H5_get_srcdir_filename(fname); /* Corrected test file name */ + hid_t file, dataset; /* handles */ + int buf[20]; + + HDfprintf(stderr, "\nTesting error message during data reading when filter isn't registered\n"); + + /* Open the file */ + if((file = H5Fopen(pathname, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) + TEST_ERROR; + + /* Open the regular dataset */ + if((dataset = H5Dopen2(file, DSET_FILTER_NAME, H5P_DEFAULT)) < 0) + TEST_ERROR; + + if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) >= 0) + TEST_ERROR; + + /* Close/release resources */ + if(H5Dclose(dataset) < 0) + TEST_ERROR + + if(H5Fclose(file) < 0) + TEST_ERROR + + return 0; + +error: + return -1; +} + + +/*------------------------------------------------------------------------- * Function: main * * Purpose: Test error API. @@ -635,7 +690,7 @@ main(void) char filename[1024]; const char *FUNC_main = "main"; - fprintf(stderr, " This program tests the Error API. There're supposed to be some error messages\n"); + HDfprintf(stderr, " This program tests the Error API. There're supposed to be some error messages\n"); /* Initialize errors */ if(init_error() < 0) @@ -689,17 +744,25 @@ main(void) if(test_copy() < 0) TEST_ERROR; if(H5Fclose(file) < 0) TEST_ERROR; - h5_cleanup(FILENAME, fapl); /* Close error information */ if(close_error() < 0) TEST_ERROR; - printf("All error API tests passed.\n"); + /* Test error message during data reading when filter isn't registered + * Use default FAPL to avoid some VFD drivers by the check-vfd test because + * the test file was pre-generated. */ + h5_fixname(DATAFILE, H5P_DEFAULT, filename, sizeof filename); + if(test_filter_error(filename) < 0) + TEST_ERROR; + + h5_cleanup(FILENAME, fapl); + + HDfprintf(stderr, "\nAll error API tests passed.\n"); return 0; error: - printf("***** ERROR TEST FAILED! *****\n"); + HDfprintf(stderr, "\n***** ERROR TEST FAILED (real problem)! *****\n"); return 1; } #endif /* H5_USE_16_API */ diff --git a/test/filter_error.h5 b/test/filter_error.h5 new file mode 100644 index 0000000..370cc1c Binary files /dev/null and b/test/filter_error.h5 differ diff --git a/test/flush2.c b/test/flush2.c index 5675856..06dd086 100644 --- a/test/flush2.c +++ b/test/flush2.c @@ -186,7 +186,7 @@ main(void) PASSED() else { -#if defined _WIN32 && defined _HDF5USEDLL_ +#if defined H5_HAVE_WIN32_API && defined _HDF5USEDLL_ SKIPPED(); puts(" DLL will flush the file even when calling _exit, skip this test temporarily"); #elif defined H5_VMS @@ -209,7 +209,7 @@ main(void) PASSED() else { -#if defined _WIN32 && defined _HDF5USEDLL_ +#if defined H5_HAVE_WIN32_API && defined _HDF5USEDLL_ SKIPPED(); puts(" DLL will flush the file even when calling _exit, skip this test temporarily"); #elif defined H5_VMS diff --git a/test/gen_cross.c b/test/gen_cross.c index 32be867..d960499 100755 --- a/test/gen_cross.c +++ b/test/gen_cross.c @@ -27,7 +27,8 @@ #include "h5test.h" #define H5FILE_NAME "data.h5" -#define DATASETNAME "Array" +#define DATASETNAME "Array_le" +#define DATASETNAME1 "Array_be" #define DATASETNAME2 "Scale_offset_float_data_le" #define DATASETNAME3 "Scale_offset_float_data_be" #define DATASETNAME4 "Scale_offset_double_data_le" @@ -40,6 +41,18 @@ #define DATASETNAME11 "Scale_offset_int_data_be" #define DATASETNAME12 "Scale_offset_long_long_data_le" #define DATASETNAME13 "Scale_offset_long_long_data_be" + +#define DATASETNAME14 "Fletcher_float_data_le" +#define DATASETNAME15 "Fletcher_float_data_be" +#define DATASETNAME16 "Deflate_float_data_le" +#define DATASETNAME17 "Deflate_float_data_be" +#define DATASETNAME18 "Szip_float_data_le" +#define DATASETNAME19 "Szip_float_data_be" +#define DATASETNAME20 "Shuffle_float_data_le" +#define DATASETNAME21 "Shuffle_float_data_be" +#define DATASETNAME22 "Nbit_float_data_le" +#define DATASETNAME23 "Nbit_float_data_be" + #define NX 6 #define NY 6 #define RANK 2 @@ -53,6 +66,11 @@ int create_scale_offset_dsets_char(hid_t fid, hid_t fsid, hid_t msid); int create_scale_offset_dsets_short(hid_t fid, hid_t fsid, hid_t msid); int create_scale_offset_dsets_int(hid_t fid, hid_t fsid, hid_t msid); int create_scale_offset_dsets_long_long(hid_t fid, hid_t fsid, hid_t msid); +int create_fletcher_dsets_float(hid_t fid, hid_t fsid, hid_t msid); +int create_deflate_dsets_float(hid_t fid, hid_t fsid, hid_t msid); +int create_szip_dsets_float(hid_t fid, hid_t fsid, hid_t msid); +int create_shuffle_dsets_float(hid_t fid, hid_t fsid, hid_t msid); +int create_nbit_dsets_float(hid_t fid, hid_t fsid, hid_t msid); /*------------------------------------------------------------------------- @@ -84,15 +102,15 @@ create_normal_dset(hid_t fid, hid_t fsid, hid_t msid) */ for (j = 0; j < NX; j++) { for (i = 0; i < NY; i++) - data[j][i] = i + j; + data[j][i] = ((float)(i + j + 1)) / 3; } /* - * 0 1 2 3 4 5 - * 1 2 3 4 5 6 - * 2 3 4 5 6 7 - * 3 4 5 6 7 8 - * 4 5 6 7 8 9 - * 5 6 7 8 9 10 + * 1/3 2/3 3/3 4/3 5/3 6/3 + * 2/3 3/3 4/3 5/3 6/3 7/3 + * 3/3 4/3 5/3 6/3 7/3 8/3 + * 4/3 5/3 6/3 7/3 8/3 9/3 + * 5/3 6/3 7/3 8/3 9/3 10/3 + * 6/3 7/3 8/3 9/3 10/3 11/3 * -2.2 -2.2 -2.2 -2.2 -2.2 -2.2 */ @@ -106,9 +124,9 @@ create_normal_dset(hid_t fid, hid_t fsid, hid_t msid) /* * Create a new dataset within the file using defined dataspace and - * datatype and default dataset creation properties. + * little-endian datatype and default dataset creation properties. */ - if((dataset = H5Dcreate2(fid, DATASETNAME, H5T_NATIVE_DOUBLE, fsid, + if((dataset = H5Dcreate2(fid, DATASETNAME, H5T_IEEE_F64LE, fsid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) TEST_ERROR @@ -118,14 +136,38 @@ create_normal_dset(hid_t fid, hid_t fsid, hid_t msid) if(H5Dwrite(dataset, H5T_NATIVE_FLOAT, msid, fsid, H5P_DEFAULT, data) < 0) TEST_ERROR + /* + * Close dataset + */ + if(H5Dclose(dataset) < 0) + TEST_ERROR + /* - * Close/release resources. + * Create a new dataset within the file using defined dataspace and + * big-endian datatype and default dataset creation properties. */ - if(H5Pclose(dcpl) < 0) + if((dataset = H5Dcreate2(fid, DATASETNAME1, H5T_IEEE_F64BE, fsid, + H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) + TEST_ERROR + + /* + * Write the data to the dataset using default transfer properties. + */ + if(H5Dwrite(dataset, H5T_NATIVE_FLOAT, msid, fsid, H5P_DEFAULT, data) < 0) TEST_ERROR + + /* + * Close dataset + */ if(H5Dclose(dataset) < 0) TEST_ERROR + /* + * Close/release resources. + */ + if(H5Pclose(dcpl) < 0) + TEST_ERROR + return 0; #ifdef H5_HAVE_FILTER_SCALEOFFSET @@ -774,6 +816,527 @@ error: /*------------------------------------------------------------------------- + * Function: create_fletcher_dsets_float + * + * Purpose: Create a dataset of FLOAT datatype with fletcher filter + * + * Return: Success: 0 + * Failure: -1 + * + * Programmer: Raymond Lu + * 29 March 2011 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +int +create_fletcher_dsets_float(hid_t fid, hid_t fsid, hid_t msid) +{ +#ifdef H5_HAVE_FILTER_FLETCHER32 + hid_t dataset; /* dataset handles */ + hid_t dcpl; + float data[NX][NY]; /* data to write */ + float fillvalue = -2.2; + hsize_t chunk[RANK] = {CHUNK0, CHUNK1}; + int i, j; + + /* + * Data and output buffer initialization. + */ + for (j = 0; j < NX; j++) { + for (i = 0; i < NY; i++) + data[j][i] = ((float)(i + j + 1))/3; + } + + /* + * Create the dataset creation property list, add the Scale-Offset + * filter, set the chunk size, and set the fill value. + */ + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) + TEST_ERROR + if(H5Pset_filter(dcpl, H5Z_FILTER_FLETCHER32, 0, (size_t)0, NULL) < 0) + TEST_ERROR + if(H5Pset_chunk(dcpl, RANK, chunk) < 0) + TEST_ERROR + if(H5Pset_fill_value(dcpl, H5T_NATIVE_FLOAT, &fillvalue) < 0) + TEST_ERROR + + /* + * Create a new dataset within the file using defined dataspace, little + * endian datatype and default dataset creation properties. + */ + if((dataset = H5Dcreate2(fid, DATASETNAME14, H5T_IEEE_F32LE, fsid, + H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) + TEST_ERROR + + /* + * Write the data to the dataset using default transfer properties. + */ + if(H5Dwrite(dataset, H5T_NATIVE_FLOAT, msid, fsid, H5P_DEFAULT, data) < 0) + TEST_ERROR + + /* Close dataset */ + if(H5Dclose(dataset) < 0) + TEST_ERROR + + /* Now create a dataset with a big-endian type */ + if((dataset = H5Dcreate2(fid, DATASETNAME15, H5T_IEEE_F32BE, fsid, + H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) + TEST_ERROR + if(H5Dwrite(dataset, H5T_NATIVE_FLOAT, msid, fsid, H5P_DEFAULT, data) < 0) + TEST_ERROR + if(H5Dclose(dataset) < 0) + TEST_ERROR + + /* + * Close/release resources. + */ + if(H5Pclose(dcpl) < 0) + TEST_ERROR + +#else /* H5_HAVE_FILTER_FLETCHER32 */ + const char *not_supported= "Fletcher filter is not enabled. Can't create the dataset."; + + puts(not_supported); +#endif /* H5_HAVE_FILTER_FLETCHER32 */ + + return 0; + +#ifdef H5_HAVE_FILTER_FLETCHER32 +error: + H5E_BEGIN_TRY { + H5Pclose(dcpl); + H5Dclose(dataset); + } H5E_END_TRY; + + return -1; +#endif /* H5_HAVE_FILTER_FLETCHER32 */ +} + + +/*------------------------------------------------------------------------- + * Function: create_deflate_dsets_float + * + * Purpose: Create a dataset of FLOAT datatype with deflate filter + * + * Return: Success: 0 + * Failure: -1 + * + * Programmer: Raymond Lu + * 29 March 2011 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +int +create_deflate_dsets_float(hid_t fid, hid_t fsid, hid_t msid) +{ +#ifdef H5_HAVE_FILTER_DEFLATE + hid_t dataset; /* dataset handles */ + hid_t dcpl; + float data[NX][NY]; /* data to write */ + float fillvalue = -2.2; + hsize_t chunk[RANK] = {CHUNK0, CHUNK1}; + int i, j; + + /* + * Data and output buffer initialization. + */ + for (j = 0; j < NX; j++) { + for (i = 0; i < NY; i++) + data[j][i] = ((float)(i + j + 1))/3; + } + + /* + * Create the dataset creation property list, add the Scale-Offset + * filter, set the chunk size, and set the fill value. + */ + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) + TEST_ERROR + if(H5Pset_deflate (dcpl, 6) < 0) + TEST_ERROR + if(H5Pset_chunk(dcpl, RANK, chunk) < 0) + TEST_ERROR + if(H5Pset_fill_value(dcpl, H5T_NATIVE_FLOAT, &fillvalue) < 0) + TEST_ERROR + + /* + * Create a new dataset within the file using defined dataspace, little + * endian datatype and default dataset creation properties. + */ + if((dataset = H5Dcreate2(fid, DATASETNAME16, H5T_IEEE_F32LE, fsid, + H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) + TEST_ERROR + + /* + * Write the data to the dataset using default transfer properties. + */ + if(H5Dwrite(dataset, H5T_NATIVE_FLOAT, msid, fsid, H5P_DEFAULT, data) < 0) + TEST_ERROR + + /* Close dataset */ + if(H5Dclose(dataset) < 0) + TEST_ERROR + + /* Now create a dataset with a big-endian type */ + if((dataset = H5Dcreate2(fid, DATASETNAME17, H5T_IEEE_F32BE, fsid, + H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) + TEST_ERROR + if(H5Dwrite(dataset, H5T_NATIVE_FLOAT, msid, fsid, H5P_DEFAULT, data) < 0) + TEST_ERROR + if(H5Dclose(dataset) < 0) + TEST_ERROR + + /* + * Close/release resources. + */ + if(H5Pclose(dcpl) < 0) + TEST_ERROR + +#else /* H5_HAVE_FILTER_DEFLATE */ + const char *not_supported= "Deflate filter is not enabled. Can't create the dataset."; + + puts(not_supported); +#endif /* H5_HAVE_FILTER_DEFLATE */ + + return 0; + +#ifdef H5_HAVE_FILTER_DEFLATE +error: + H5E_BEGIN_TRY { + H5Pclose(dcpl); + H5Dclose(dataset); + } H5E_END_TRY; + + return -1; +#endif /* H5_HAVE_FILTER_DEFLATE */ +} + + +/*------------------------------------------------------------------------- + * Function: create_szip_dsets_float + * + * Purpose: Create a dataset of FLOAT datatype with szip filter + * + * Return: Success: 0 + * Failure: -1 + * + * Programmer: Raymond Lu + * 29 March 2011 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +int +create_szip_dsets_float(hid_t fid, hid_t fsid, hid_t msid) +{ +#ifdef H5_HAVE_FILTER_SZIP + hid_t dataset; /* dataset handles */ + hid_t dcpl; + float data[NX][NY]; /* data to write */ + float fillvalue = -2.2; + hsize_t chunk[RANK] = {CHUNK0, CHUNK1}; + int i, j; + + /* + * Data and output buffer initialization. + */ + for (j = 0; j < NX; j++) { + for (i = 0; i < NY; i++) + data[j][i] = ((float)(i + j + 1))/3; + } + + /* + * Create the dataset creation property list, add the Scale-Offset + * filter, set the chunk size, and set the fill value. + */ + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) + TEST_ERROR + if(H5Pset_szip(dcpl, H5_SZIP_NN_OPTION_MASK, 4) < 0) + TEST_ERROR + if(H5Pset_chunk(dcpl, RANK, chunk) < 0) + TEST_ERROR + if(H5Pset_fill_value(dcpl, H5T_NATIVE_FLOAT, &fillvalue) < 0) + TEST_ERROR + + /* + * Create a new dataset within the file using defined dataspace, little + * endian datatype and default dataset creation properties. + */ + if((dataset = H5Dcreate2(fid, DATASETNAME18, H5T_IEEE_F32LE, fsid, + H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) + TEST_ERROR + + /* + * Write the data to the dataset using default transfer properties. + */ + if(H5Dwrite(dataset, H5T_NATIVE_FLOAT, msid, fsid, H5P_DEFAULT, data) < 0) + TEST_ERROR + + /* Close dataset */ + if(H5Dclose(dataset) < 0) + TEST_ERROR + + /* Now create a dataset with a big-endian type */ + if((dataset = H5Dcreate2(fid, DATASETNAME19, H5T_IEEE_F32BE, fsid, + H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) + TEST_ERROR + if(H5Dwrite(dataset, H5T_NATIVE_FLOAT, msid, fsid, H5P_DEFAULT, data) < 0) + TEST_ERROR + if(H5Dclose(dataset) < 0) + TEST_ERROR + + /* + * Close/release resources. + */ + if(H5Pclose(dcpl) < 0) + TEST_ERROR + +#else /* H5_HAVE_FILTER_SZIP */ + const char *not_supported= "Szip filter is not enabled. Can't create the dataset."; + + puts(not_supported); +#endif /* H5_HAVE_FILTER_SZIP */ + + return 0; + +#ifdef H5_HAVE_FILTER_SZIP +error: + H5E_BEGIN_TRY { + H5Pclose(dcpl); + H5Dclose(dataset); + } H5E_END_TRY; + + return -1; +#endif /* H5_HAVE_FILTER_SZIP */ +} + + +/*------------------------------------------------------------------------- + * Function: create_shuffle_dsets_float + * + * Purpose: Create a dataset of FLOAT datatype with shuffle filter + * + * Return: Success: 0 + * Failure: -1 + * + * Programmer: Raymond Lu + * 29 March 2011 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +int +create_shuffle_dsets_float(hid_t fid, hid_t fsid, hid_t msid) +{ +#ifdef H5_HAVE_FILTER_SHUFFLE + hid_t dataset; /* dataset handles */ + hid_t dcpl; + float data[NX][NY]; /* data to write */ + float fillvalue = -2.2; + hsize_t chunk[RANK] = {CHUNK0, CHUNK1}; + int i, j; + + /* + * Data and output buffer initialization. + */ + for (j = 0; j < NX; j++) { + for (i = 0; i < NY; i++) + data[j][i] = ((float)(i + j + 1))/3; + } + + /* + * Create the dataset creation property list, add the Scale-Offset + * filter, set the chunk size, and set the fill value. + */ + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) + TEST_ERROR + if(H5Pset_shuffle (dcpl) < 0) + TEST_ERROR + if(H5Pset_chunk(dcpl, RANK, chunk) < 0) + TEST_ERROR + if(H5Pset_fill_value(dcpl, H5T_NATIVE_FLOAT, &fillvalue) < 0) + TEST_ERROR + + /* + * Create a new dataset within the file using defined dataspace, little + * endian datatype and default dataset creation properties. + */ + if((dataset = H5Dcreate2(fid, DATASETNAME20, H5T_IEEE_F32LE, fsid, + H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) + TEST_ERROR + + /* + * Write the data to the dataset using default transfer properties. + */ + if(H5Dwrite(dataset, H5T_NATIVE_FLOAT, msid, fsid, H5P_DEFAULT, data) < 0) + TEST_ERROR + + /* Close dataset */ + if(H5Dclose(dataset) < 0) + TEST_ERROR + + /* Now create a dataset with a big-endian type */ + if((dataset = H5Dcreate2(fid, DATASETNAME21, H5T_IEEE_F32BE, fsid, + H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) + TEST_ERROR + if(H5Dwrite(dataset, H5T_NATIVE_FLOAT, msid, fsid, H5P_DEFAULT, data) < 0) + TEST_ERROR + if(H5Dclose(dataset) < 0) + TEST_ERROR + + /* + * Close/release resources. + */ + if(H5Pclose(dcpl) < 0) + TEST_ERROR + +#else /* H5_HAVE_FILTER_SHUFFLE */ + const char *not_supported= "Shuffle filter is not enabled. Can't create the dataset."; + + puts(not_supported); +#endif /* H5_HAVE_FILTER_SHUFFLE */ + + return 0; + +#ifdef H5_HAVE_FILTER_SHUFFLE +error: + H5E_BEGIN_TRY { + H5Pclose(dcpl); + H5Dclose(dataset); + } H5E_END_TRY; + + return -1; +#endif /* H5_HAVE_FILTER_SHUFFLE */ +} + + +/*------------------------------------------------------------------------- + * Function: create_nbit_dsets_float + * + * Purpose: Create a dataset of FLOAT datatype with nbit filter + * + * Return: Success: 0 + * Failure: -1 + * + * Programmer: Raymond Lu + * 29 March 2011 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +int +create_nbit_dsets_float(hid_t fid, hid_t fsid, hid_t msid) +{ +#ifdef H5_HAVE_FILTER_NBIT + hid_t dataset; /* dataset handles */ + hid_t datatype; + hid_t dcpl; + size_t precision, offset; + float data[NX][NY]; /* data to write */ + float fillvalue = -2.2; + hsize_t chunk[RANK] = {CHUNK0, CHUNK1}; + int i, j; + + /* + * Data and output buffer initialization. + */ + for (j = 0; j < NX; j++) { + for (i = 0; i < NY; i++) + data[j][i] = ((float)(i + j + 1))/3; + } + + /* + * Create the dataset creation property list, add the Scale-Offset + * filter, set the chunk size, and set the fill value. + */ + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) + TEST_ERROR + if(H5Pset_nbit(dcpl) < 0) + TEST_ERROR + if(H5Pset_chunk(dcpl, RANK, chunk) < 0) + TEST_ERROR + if(H5Pset_fill_value(dcpl, H5T_NATIVE_FLOAT, &fillvalue) < 0) + TEST_ERROR + + /* Define user-defined single-precision floating-point type for dataset. + * A 20-bit little-endian data type. */ + if((datatype = H5Tcopy(H5T_IEEE_F32LE)) < 0) + TEST_ERROR + if(H5Tset_fields(datatype, (size_t)26, (size_t)20, (size_t)6, (size_t)7, (size_t)13) < 0) + TEST_ERROR + offset = 7; + if(H5Tset_offset(datatype,offset) < 0) + TEST_ERROR + precision = 20; + if(H5Tset_precision(datatype,precision) < 0) + TEST_ERROR + if(H5Tset_size(datatype, (size_t)4) < 0) + TEST_ERROR + if(H5Tset_ebias(datatype, (size_t)31) < 0) + TEST_ERROR + + /* + * Create a new dataset within the file using defined dataspace, + * user-defined datatype, and default dataset creation properties. + */ + if((dataset = H5Dcreate2(fid, DATASETNAME22, datatype, fsid, + H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) + TEST_ERROR + + /* + * Write the data to the dataset using default transfer properties. + */ + if(H5Dwrite(dataset, H5T_NATIVE_FLOAT, msid, fsid, H5P_DEFAULT, data) < 0) + TEST_ERROR + + /* Close dataset */ + if(H5Dclose(dataset) < 0) + TEST_ERROR + + /* Now create a dataset with a big-endian type */ + if(H5Tset_order(datatype, H5T_ORDER_BE) < 0) + TEST_ERROR + if((dataset = H5Dcreate2(fid, DATASETNAME23, datatype, fsid, + H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) + TEST_ERROR + if(H5Dwrite(dataset, H5T_NATIVE_FLOAT, msid, fsid, H5P_DEFAULT, data) < 0) + TEST_ERROR + if(H5Dclose(dataset) < 0) + TEST_ERROR + + /* + * Close/release resources. + */ + if(H5Pclose(dcpl) < 0) + TEST_ERROR + +#else /* H5_HAVE_FILTER_NBIT */ + const char *not_supported= "Nbit filter is not enabled. Can't create the dataset."; + + puts(not_supported); +#endif /* H5_HAVE_FILTER_NBIT */ + + return 0; + +#ifdef H5_HAVE_FILTER_NBIT +error: + H5E_BEGIN_TRY { + H5Pclose(dcpl); + H5Dclose(dataset); + } H5E_END_TRY; + + return -1; +#endif /* H5_HAVE_FILTER_NBIT */ +} + + +/*------------------------------------------------------------------------- * Function: main * * Purpose: Create a file for cross_read.c test. @@ -853,6 +1416,27 @@ main (void) if(create_scale_offset_dsets_long_long(file, filespace, memspace) < 0) {H5_FAILED(); AT(); return 1;} + /* Create a dataset of FLOAT with fletcher filter */ + if(create_fletcher_dsets_float(file, filespace, memspace) < 0) + {H5_FAILED(); AT(); return 1;} + + /* Create a dataset of FLOAT with deflate filter */ + if(create_deflate_dsets_float(file, filespace, memspace) < 0) + {H5_FAILED(); AT(); return 1;} + + /* Create a dataset of FLOAT with szip filter */ + if(create_szip_dsets_float(file, filespace, memspace) < 0) + {H5_FAILED(); AT(); return 1;} + + /* Create a dataset of FLOAT with shuffle filter */ + if(create_shuffle_dsets_float(file, filespace, memspace) < 0) + {H5_FAILED(); AT(); return 1;} + + /* Create a dataset of FLOAT with nbit filter */ + if(create_nbit_dsets_float(file, filespace, memspace) < 0) + {H5_FAILED(); AT(); return 1;} + + /* * Close/release resources. */ diff --git a/test/gen_filters.c b/test/gen_filters.c index 6d24fb3..58400d5 100644 --- a/test/gen_filters.c +++ b/test/gen_filters.c @@ -13,20 +13,38 @@ * access to either file, you may request a copy from help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* +#include "h5test.h" + +#define TESTFILE1 "test_filters.h5" +#define TESTFILE2 "filter_error.h5" +#define DSETNAME "dataset_with_filter" + +/* Temporary filter IDs used for testing */ +#define H5Z_FILTER_BOGUS 305 + +/* Local prototypes for filter functions */ +static size_t filter_bogus(unsigned int flags, size_t cd_nelmts, + const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf); + + +/*------------------------------------------------------------------------- + * Function: create_file_with_bogus_filter + * + * Purpose: Create a dataset with the fletcher filter. + * This function is used to create the test file `test_filters.h5' + * which has a dataset with the "fletcher" I/O filter. This dataset + * will be used to verify the correct behavior of the library in + * the test "dsets" + * + * Return: Success: 0 + * + * Failure: -1 + * * Programmer: Pedro Vicente * Thursday, March 25, 2004 * - * Purpose: Create a dataset with the fletcher filter. - * This program is used to create the test file `test_filters.h5' which has - * a dataset with the "fletcher" I/O filter. This dataset will - * be used to verify the correct behavior of the library in the test "dsets" + *------------------------------------------------------------------------- */ -#include "hdf5.h" - -#define TESTFILE "test_filters.h5" - - static herr_t test_filters_endianess(void) { @@ -45,7 +63,7 @@ test_filters_endianess(void) buf[i] = 1; /* create a file using default properties */ - if((fid = H5Fcreate(TESTFILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; + if((fid = H5Fcreate(TESTFILE1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; /* create a data space */ if((sid = H5Screate_simple(rank, dims, NULL)) < 0) goto error; @@ -82,7 +100,109 @@ error: #endif /* H5_HAVE_FILTER_FLETCHER32 */ } /* end test_filters_endianess() */ +/* This message derives from H5Z */ +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 */ + "bogus", /* Filter name for debugging */ + NULL, /* The "can apply" callback */ + NULL, /* The "set local" callback */ + filter_bogus, /* The actual filter function */ +}}; + +/*------------------------------------------------------------------------- + * Function: filter_bogus + * + * Purpose: A bogus compression method that doesn't do anything. + * + * Return: Success: Data chunk size + * + * Failure: 0 + * + * Programmer: Raymond Lu + * 2 June 2011 + * + *------------------------------------------------------------------------- + */ +static size_t +filter_bogus(unsigned int UNUSED flags, size_t UNUSED cd_nelmts, + const unsigned int UNUSED *cd_values, size_t nbytes, + size_t UNUSED *buf_size, void UNUSED **buf) +{ + return nbytes; +} + + +/*------------------------------------------------------------------------- + * Function: create_file_with_bogus_filter + * + * Purpose: Create a file and a dataset with a bogus filter enabled + * + * Return: Success: 0 + * + * Failure: -1 + * + * Programmer: Raymond Lu + * 2 June 2011 + * + *------------------------------------------------------------------------- + */ +static herr_t +create_file_with_bogus_filter(void) +{ + hid_t fid = -1; /* file ID */ + hid_t dsid = -1; /* dataset ID */ + hid_t sid = -1; /* dataspace ID */ + hid_t dcpl = -1; /* dataset creation property list ID */ + hsize_t dims[1] = {20}; /* dataspace dimensions */ + hsize_t chunk_dims[1] = {10}; /* chunk dimensions */ + int buf[20]; + int rank = 1; + int i; + + for(i = 0; i < 20; i++) + buf[i] = 1; + + /* create a file using default properties */ + if((fid = H5Fcreate(TESTFILE2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; + + /* create a data space */ + if((sid = H5Screate_simple(rank, dims, NULL)) < 0) goto error; + + /* create dcpl */ + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; + + /* create chunking */ + if(H5Pset_chunk(dcpl, rank, chunk_dims) < 0) goto error; + + /* register bogus filter */ + if(H5Zregister (H5Z_BOGUS) < 0) goto error; + if(H5Pset_filter(dcpl, H5Z_FILTER_BOGUS, 0, (size_t)0, NULL) < 0) goto error; + + /* create a dataset */ + if((dsid = H5Dcreate2(fid, DSETNAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error; + + if(H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) goto error; + + /* close */ + if(H5Pclose(dcpl) < 0) goto error; + if(H5Dclose(dsid) < 0) goto error; + if(H5Sclose(sid) < 0) goto error; + if(H5Fclose(fid) < 0) goto error; + + return 0; + +error: + H5E_BEGIN_TRY { + H5Pclose(dcpl); + H5Dclose(dsid); + H5Sclose(sid); + H5Fclose(fid); + } H5E_END_TRY; + return -1; +} /*------------------------------------------------------------------------- @@ -99,7 +219,20 @@ error: int main(void) { - test_filters_endianess(); + int nerrors = 0; + + nerrors += test_filters_endianess() < 0 ? 1 : 0; + nerrors += create_file_with_bogus_filter() < 0 ? 1 : 0; + + if(nerrors) + goto error; + printf("All tests passed.\n"); + return 0; + +error: + nerrors = MAX(1, nerrors); + printf("***** %d GEN_FILTERS FAILURES *****\n", nerrors); + return 1; } diff --git a/test/getname.c b/test/getname.c index 1e50dcc..fbad220 100644 --- a/test/getname.c +++ b/test/getname.c @@ -72,7 +72,7 @@ check_name(hid_t id, const char *chk_name, const char *chk_user_path) /* Get user path */ *user_path = '\0'; - if(H5G_user_path_test(id, user_path, &user_path_len, &user_path_hidden) < 0) TEST_ERROR + if(H5G__user_path_test(id, user_path, &user_path_len, &user_path_hidden) < 0) TEST_ERROR /* Check on name from H5Iget_name() */ if(HDstrcmp(name, chk_name)) goto error; @@ -2518,7 +2518,7 @@ test_obj_ref(hid_t fapl) FAIL_STACK_ERROR TESTING("getting path to normal dataset in root group"); - if((dataset2 = H5Rdereference(dataset, H5R_OBJECT, &wbuf[0])) < 0) FAIL_STACK_ERROR + if((dataset2 = H5Rdereference2(dataset, H5P_DEFAULT, H5R_OBJECT, &wbuf[0])) < 0) FAIL_STACK_ERROR *buf = '\0'; i = H5Iget_name(dataset2, (char*)buf, sizeof(buf)); if(H5Dclose(dataset2) < 0) FAIL_STACK_ERROR @@ -2530,7 +2530,7 @@ test_obj_ref(hid_t fapl) HDmemset(buf, 0, sizeof(buf)); TESTING("getting path to dataset in /Group1"); - if((dataset2 = H5Rdereference(dataset, H5R_OBJECT, &wbuf[1])) < 0) FAIL_STACK_ERROR + if((dataset2 = H5Rdereference2(dataset, H5P_DEFAULT, H5R_OBJECT, &wbuf[1])) < 0) FAIL_STACK_ERROR *buf = '\0'; i = H5Iget_name(dataset2, (char*)buf, sizeof(buf)); if(H5Dclose(dataset2) < 0) FAIL_STACK_ERROR @@ -2542,7 +2542,7 @@ test_obj_ref(hid_t fapl) HDmemset(buf, 0, sizeof(buf)); TESTING("getting path to /Group1"); - if((group = H5Rdereference(dataset, H5R_OBJECT, &wbuf[2])) < 0) FAIL_STACK_ERROR + if((group = H5Rdereference2(dataset, H5P_DEFAULT, H5R_OBJECT, &wbuf[2])) < 0) FAIL_STACK_ERROR *buf = '\0'; i = H5Iget_name(group, (char*)buf, sizeof(buf)); if(H5Gclose(group) < 0) FAIL_STACK_ERROR @@ -2554,7 +2554,7 @@ test_obj_ref(hid_t fapl) HDmemset(buf, 0, sizeof(buf)); TESTING("getting path to datatype in /Group1"); - if((tid1 = H5Rdereference(dataset, H5R_OBJECT, &wbuf[3])) < 0) FAIL_STACK_ERROR + if((tid1 = H5Rdereference2(dataset, H5P_DEFAULT, H5R_OBJECT, &wbuf[3])) < 0) FAIL_STACK_ERROR *buf = '\0'; i = H5Iget_name(tid1, (char*)buf, sizeof(buf)); if(H5Tclose(tid1) < 0) FAIL_STACK_ERROR @@ -2566,7 +2566,7 @@ test_obj_ref(hid_t fapl) HDmemset(buf, 0, sizeof(buf)); TESTING("getting path to dataset in nested group"); - if((dataset2 = H5Rdereference(dataset, H5R_OBJECT, &wbuf[4])) < 0) FAIL_STACK_ERROR + if((dataset2 = H5Rdereference2(dataset, H5P_DEFAULT, H5R_OBJECT, &wbuf[4])) < 0) FAIL_STACK_ERROR *buf = '\0'; i = H5Iget_name(dataset2, (char*)buf, sizeof(buf)); if(H5Dclose(dataset2) < 0) FAIL_STACK_ERROR @@ -2578,7 +2578,7 @@ test_obj_ref(hid_t fapl) HDmemset(buf, 0, sizeof(buf)); TESTING("getting path to nested group"); - if((group = H5Rdereference(dataset, H5R_OBJECT, &wbuf[5])) < 0) FAIL_STACK_ERROR + if((group = H5Rdereference2(dataset, H5P_DEFAULT, H5R_OBJECT, &wbuf[5])) < 0) FAIL_STACK_ERROR *buf = '\0'; i = H5Iget_name(group, (char*)buf, sizeof(buf)); if(H5Gclose(group) < 0) FAIL_STACK_ERROR @@ -2590,7 +2590,7 @@ test_obj_ref(hid_t fapl) HDmemset(buf, 0, sizeof(buf)); TESTING("getting path to dataset created via hard link"); - if((dataset2 = H5Rdereference(dataset, H5R_OBJECT, &wbuf[6])) < 0) FAIL_STACK_ERROR + if((dataset2 = H5Rdereference2(dataset, H5P_DEFAULT, H5R_OBJECT, &wbuf[6])) < 0) FAIL_STACK_ERROR *buf = '\0'; i = H5Iget_name(dataset2, (char*)buf, sizeof(buf)); if(H5Dclose(dataset2) < 0) FAIL_STACK_ERROR @@ -2602,7 +2602,7 @@ test_obj_ref(hid_t fapl) HDmemset(buf, 0, sizeof(buf)); TESTING("getting path to root group"); - if((group = H5Rdereference(dataset, H5R_OBJECT, &wbuf[7])) < 0) FAIL_STACK_ERROR + if((group = H5Rdereference2(dataset, H5P_DEFAULT, H5R_OBJECT, &wbuf[7])) < 0) FAIL_STACK_ERROR *buf = '\0'; i = H5Iget_name(group, (char*)buf, sizeof(buf)); if(H5Gclose(group) < 0) FAIL_STACK_ERROR @@ -2617,7 +2617,7 @@ test_obj_ref(hid_t fapl) FAIL_STACK_ERROR TESTING("getting path to dataset hidden by a mounted file"); - if((dataset2 = H5Rdereference(dataset, H5R_OBJECT, &wbuf[4])) < 0) FAIL_STACK_ERROR + if((dataset2 = H5Rdereference2(dataset, H5P_DEFAULT, H5R_OBJECT, &wbuf[4])) < 0) FAIL_STACK_ERROR *buf = '\0'; i = H5Iget_name(dataset2, (char*)buf, sizeof(buf)); if(H5Dclose(dataset2) < 0) FAIL_STACK_ERROR @@ -2628,7 +2628,7 @@ test_obj_ref(hid_t fapl) PASSED() /* Now we try unlinking dataset2 from the file and searching for it. It shouldn't be found */ - if((dataset2 = H5Rdereference(dataset, H5R_OBJECT, &wbuf[1])) < 0) + if((dataset2 = H5Rdereference2(dataset, H5P_DEFAULT, H5R_OBJECT, &wbuf[1])) < 0) FAIL_STACK_ERROR if(H5Ldelete(fid1, "/Group1/Dataset2", H5P_DEFAULT) < 0) FAIL_STACK_ERROR @@ -2768,7 +2768,7 @@ test_reg_ref(hid_t fapl) TESTING("H5Iget_name to get name from region reference(hyperslab)"); /* Dereference the first reference */ - dsetv_id = H5Rdereference(dsetr_id, H5R_DATASET_REGION, &ref_out[0]); + dsetv_id = H5Rdereference2(dsetr_id, H5P_DEFAULT, H5R_DATASET_REGION, &ref_out[0]); /* Get name of the dataset the first region reference points using H5Iget_name */ *buf2 = '\0'; @@ -2789,7 +2789,7 @@ test_reg_ref(hid_t fapl) TESTING("H5Iget_name to get name from region reference(pnt selec)"); /* Dereference the second reference */ - if((dsetv_id = H5Rdereference(dsetr_id, H5R_DATASET_REGION, &ref_out[1])) < 0) TEST_ERROR + if((dsetv_id = H5Rdereference2(dsetr_id, H5P_DEFAULT, H5R_DATASET_REGION, &ref_out[1])) < 0) TEST_ERROR /* Get name of the dataset the first region reference points using H5Iget_name */ *buf2 = '\0'; diff --git a/test/h5test.c b/test/h5test.c index ae864f0..7faba81 100644 --- a/test/h5test.c +++ b/test/h5test.c @@ -17,11 +17,11 @@ * Programmer: Robb Matzke * Thursday, November 19, 1998 * - * Purpose: Provides support functions for most of the hdf5 tests cases. + * Purpose: Provides support functions for most of the hdf5 tests cases. * */ -#undef NDEBUG /*override -DNDEBUG */ +#undef NDEBUG /*override -DNDEBUG */ #include #include #include "h5test.h" @@ -32,35 +32,33 @@ #define H5G_TESTING #include "H5Gpkg.h" -#ifdef H5_HAVE_WINSOCK_H +#ifdef H5_HAVE_WIN32_API #include -#include -#include -#endif /* H5_HAVE_WINSOCK_H */ +#endif /* H5_HAVE_WIN32_API */ /* * Define these environment variables or constants to influence functions in * this test support library. The environment variable is used in preference * to the cpp constant. If neither is defined then use some default value. * - * HDF5_DRIVER: This string describes what low level file driver to - * use for HDF5 file access. The first word in the - * value is the name of the driver and subsequent data - * is interpreted according to the driver. See - * h5_fileaccess() for details. - * - * HDF5_PREFIX: A string to add to the beginning of all serial test - * file names. This can be used to run tests in a - * different file system (e.g., "/tmp" or "/tmp/myname"). - * The prefix will be separated from the base file name - * by a slash. See h5_fixname() for details. - * - * HDF5_PARAPREFIX: A string to add to the beginning of all parallel test - * file names. This can be used to tell MPIO what driver - * to use (e.g., "gfs:", "ufs:", or "nfs:") or to use a - * different file system (e.g., "/tmp" or "/tmp/myname"). - * The prefix will be separated from the base file name - * by a slash. See h5_fixname() for details. + * HDF5_DRIVER: This string describes what low level file driver to + * use for HDF5 file access. The first word in the + * value is the name of the driver and subsequent data + * is interpreted according to the driver. See + * h5_fileaccess() for details. + * + * HDF5_PREFIX: A string to add to the beginning of all serial test + * file names. This can be used to run tests in a + * different file system (e.g., "/tmp" or "/tmp/myname"). + * The prefix will be separated from the base file name + * by a slash. See h5_fixname() for details. + * + * HDF5_PARAPREFIX: A string to add to the beginning of all parallel test + * file names. This can be used to tell MPIO what driver + * to use (e.g., "gfs:", "ufs:", or "nfs:") or to use a + * different file system (e.g., "/tmp" or "/tmp/myname"). + * The prefix will be separated from the base file name + * by a slash. See h5_fixname() for details. * */ /* @@ -72,7 +70,7 @@ #ifndef HDF5_PARAPREFIX #define HDF5_PARAPREFIX "" #endif -char *paraprefix = NULL; /* for command line option para-prefix */ +char *paraprefix = NULL; /* for command line option para-prefix */ #ifdef H5_HAVE_PARALLEL MPI_Info h5_io_info_g=MPI_INFO_NULL;/* MPI INFO object for IO */ #endif @@ -84,13 +82,13 @@ MPI_Info h5_io_info_g=MPI_INFO_NULL;/* MPI INFO object for IO */ * These are the letters that are appended to the file name when generating * names for the split and multi drivers. They are: * - * m: All meta data when using the split driver. - * s: The userblock, superblock, and driver info block - * b: B-tree nodes - * r: Dataset raw data - * g: Global heap - * l: local heap (object names) - * o: object headers + * m: All meta data when using the split driver. + * s: The userblock, superblock, and driver info block + * b: B-tree nodes + * r: Dataset raw data + * g: Global heap + * l: local heap (object names) + * o: object headers */ static const char *multi_letters = "msbrglo"; @@ -98,16 +96,16 @@ static herr_t h5_errors(hid_t estack, void *client_data); /*------------------------------------------------------------------------- - * Function: h5_errors + * Function: h5_errors * - * Purpose: Displays the error stack after printing "*FAILED*". + * Purpose: Displays the error stack after printing "*FAILED*". * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Robb Matzke - * Wednesday, March 4, 1998 + * Programmer: Robb Matzke + * Wednesday, March 4, 1998 * * Modifications: * @@ -123,50 +121,50 @@ h5_errors(hid_t estack, void UNUSED *client_data) /*------------------------------------------------------------------------- - * Function: h5_cleanup + * Function: h5_cleanup * - * Purpose: Cleanup temporary test files. - * base_name contains the list of test file names. - * The file access property list is also closed. + * Purpose: Cleanup temporary test files. + * base_name contains the list of test file names. + * The file access property list is also closed. * - * Return: Non-zero if cleanup actions were performed; zero otherwise. + * Return: Non-zero if cleanup actions were performed; zero otherwise. * - * Programmer: Albert Cheng + * Programmer: Albert Cheng * May 28, 1998 * * Modifications: - * Albert Cheng, 2000-09-09 - * Added the explicite base_name argument to replace the - * global variable FILENAME. + * Albert Cheng, 2000-09-09 + * Added the explicite base_name argument to replace the + * global variable FILENAME. * *------------------------------------------------------------------------- */ int h5_cleanup(const char *base_name[], hid_t fapl) { - char filename[1024]; - char temp[2048]; - int i, j; - int retval=0; - hid_t driver; + char filename[1024]; + char temp[2048]; + int i, j; + int retval=0; + hid_t driver; if (GetTestCleanup()){ - for (i = 0; base_name[i]; i++) { - if (h5_fixname(base_name[i], fapl, filename, sizeof(filename)) == NULL) - continue; + for (i = 0; base_name[i]; i++) { + if (h5_fixname(base_name[i], fapl, filename, sizeof(filename)) == NULL) + continue; driver = H5Pget_driver(fapl); - if (driver == H5FD_FAMILY) { - for (j = 0; /*void*/; j++) { - HDsnprintf(temp, sizeof temp, filename, j); + if (driver == H5FD_FAMILY) { + for (j = 0; /*void*/; j++) { + HDsnprintf(temp, sizeof temp, filename, j); - if (HDaccess(temp, F_OK) < 0) + if (HDaccess(temp, F_OK) < 0) break; - HDremove(temp); - } - } else if (driver == H5FD_CORE) { + HDremove(temp); + } + } else if (driver == H5FD_CORE) { hbool_t backing; /* Whether the core file has backing store */ H5Pget_fapl_core(fapl,NULL,&backing); @@ -175,21 +173,21 @@ h5_cleanup(const char *base_name[], hid_t fapl) if(backing) HDremove(filename); - } else if (driver == H5FD_MULTI) { - H5FD_mem_t mt; - assert(HDstrlen(multi_letters)==H5FD_MEM_NTYPES); - - for (mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t,mt)) { - HDsnprintf(temp, sizeof temp, "%s-%c.h5", - filename, multi_letters[mt]); - HDremove(temp); /*don't care if it fails*/ - } - } else { - HDremove(filename); - } - } - - retval = 1; + } else if (driver == H5FD_MULTI) { + H5FD_mem_t mt; + assert(HDstrlen(multi_letters)==H5FD_MEM_NTYPES); + + for (mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t,mt)) { + HDsnprintf(temp, sizeof temp, "%s-%c.h5", + filename, multi_letters[mt]); + HDremove(temp); /*don't care if it fails*/ + } + } else { + HDremove(filename); + } + } + + retval = 1; } H5Pclose(fapl); @@ -198,13 +196,13 @@ h5_cleanup(const char *base_name[], hid_t fapl) /*------------------------------------------------------------------------- - * Function: h5_reset + * Function: h5_reset * - * Purpose: Reset the library by closing it. + * Purpose: Reset the library by closing it. * - * Return: void + * Return: void * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Friday, November 20, 1998 * * Modifications: @@ -230,7 +228,7 @@ h5_reset(void) */ #ifdef OLD_WAY { - char filename[1024]; + char filename[1024]; /* * Cause the library to emit some diagnostics early so they don't @@ -238,12 +236,12 @@ h5_reset(void) */ sprintf(filename, "/tmp/h5emit-%05d.h5", HDgetpid()); H5E_BEGIN_TRY { - hid_t file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, - H5P_DEFAULT); - hid_t grp = H5Gcreate2(file, "emit", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - H5Gclose(grp); - H5Fclose(file); - HDunlink(filename); + hid_t file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, + H5P_DEFAULT); + hid_t grp = H5Gcreate2(file, "emit", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5Gclose(grp); + H5Fclose(file); + HDunlink(filename); } H5E_END_TRY; } #endif /* OLD_WAY */ @@ -251,34 +249,34 @@ h5_reset(void) /*------------------------------------------------------------------------- - * Function: h5_fixname + * Function: h5_fixname * - * Purpose: Create a file name from a file base name like `test' and - * return it through the FULLNAME (at most SIZE characters - * counting the null terminator). The full name is created by - * prepending the contents of HDF5_PREFIX (separated from the - * base name by a slash) and appending a file extension based on - * the driver supplied, resulting in something like - * `ufs:/u/matzke/test.h5'. + * Purpose: Create a file name from a file base name like `test' and + * return it through the FULLNAME (at most SIZE characters + * counting the null terminator). The full name is created by + * prepending the contents of HDF5_PREFIX (separated from the + * base name by a slash) and appending a file extension based on + * the driver supplied, resulting in something like + * `ufs:/u/matzke/test.h5'. * - * Return: Success: The FULLNAME pointer. + * Return: Success: The FULLNAME pointer. * - * Failure: NULL if BASENAME or FULLNAME is the null - * pointer or if FULLNAME isn't large enough for - * the result. + * Failure: NULL if BASENAME or FULLNAME is the null + * pointer or if FULLNAME isn't large enough for + * the result. * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, November 19, 1998 * * Modifications: - * Robb Matzke, 1999-08-03 - * Modified to use the virtual file layer. + * Robb Matzke, 1999-08-03 + * Modified to use the virtual file layer. * - * Albert Cheng, 2000-01-25 - * Added prefix for parallel test files. + * Albert Cheng, 2000-01-25 + * Added prefix for parallel test files. * - * Albert Cheng, 2003-05-08 - * Changed the default parallel prefix back to NULL but added + * Albert Cheng, 2003-05-08 + * Changed the default parallel prefix back to NULL but added * an explanation remark of $HDF5_PARAPREFIX. *------------------------------------------------------------------------- */ @@ -290,7 +288,7 @@ h5_fixname(const char *base_name, hid_t fapl, char *fullname, size_t size) char *ptr, last = '\0'; size_t i, j; hid_t driver = -1; - int isppdriver = 0; /* if the driver is MPI parallel */ + int isppdriver = 0; /* if the driver is MPI parallel */ if (!base_name || !fullname || size < 1) return NULL; @@ -299,20 +297,20 @@ h5_fixname(const char *base_name, hid_t fapl, char *fullname, size_t size) /* figure out the suffix */ if (H5P_DEFAULT != fapl) { - if ((driver = H5Pget_driver(fapl)) < 0) + if ((driver = H5Pget_driver(fapl)) < 0) return NULL; - if (H5FD_FAMILY == driver) - suffix = "%05d.h5"; - else if (H5FD_MULTI == driver) - suffix = NULL; + if (H5FD_FAMILY == driver) + suffix = "%05d.h5"; + else if (H5FD_MULTI == driver) + suffix = NULL; } /* Must first check fapl is not H5P_DEFAULT (-1) because H5FD_XXX * could be of value -1 if it is not defined. */ isppdriver = H5P_DEFAULT != fapl && - (H5FD_MPIO==driver || H5FD_MPIPOSIX==driver); + (H5FD_MPIO==driver || H5FD_MPIPOSIX==driver); /* Check HDF5_NOCLEANUP environment setting. * (The #ifdef is needed to prevent compile failure in case MPI is not @@ -320,12 +318,12 @@ h5_fixname(const char *base_name, hid_t fapl, char *fullname, size_t size) */ if (isppdriver){ #ifdef H5_HAVE_PARALLEL - if (getenv_all(MPI_COMM_WORLD, 0, "HDF5_NOCLEANUP")) - SetTestNoCleanup(); + if (getenv_all(MPI_COMM_WORLD, 0, "HDF5_NOCLEANUP")) + SetTestNoCleanup(); #endif /* H5_HAVE_PARALLEL */ }else{ - if (HDgetenv("HDF5_NOCLEANUP")) - SetTestNoCleanup(); + if (HDgetenv("HDF5_NOCLEANUP")) + SetTestNoCleanup(); } /* Check what prefix to use for test files. Process HDF5_PARAPREFIX and @@ -336,52 +334,52 @@ h5_fixname(const char *base_name, hid_t fapl, char *fullname, size_t size) */ if (isppdriver){ #ifdef H5_HAVE_PARALLEL - /* + /* * For parallel: * First use command line option, then the environment * variable, then try the constant - */ + */ static int explained = 0; - prefix = (paraprefix ? paraprefix : getenv_all(MPI_COMM_WORLD, 0, "HDF5_PARAPREFIX")); + prefix = (paraprefix ? paraprefix : getenv_all(MPI_COMM_WORLD, 0, "HDF5_PARAPREFIX")); - if (!prefix && !explained) { - /* print hint by process 0 once. */ - int mpi_rank; + if (!prefix && !explained) { + /* print hint by process 0 once. */ + int mpi_rank; - MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); + MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); - if (mpi_rank == 0) - printf("*** Hint ***\n" - "You can use environment variable HDF5_PARAPREFIX to " - "run parallel test files in a\n" - "different directory or to add file type prefix. E.g.,\n" - " HDF5_PARAPREFIX=pfs:/PFS/user/me\n" - " export HDF5_PARAPREFIX\n" - "*** End of Hint ***\n"); + if (mpi_rank == 0) + printf("*** Hint ***\n" + "You can use environment variable HDF5_PARAPREFIX to " + "run parallel test files in a\n" + "different directory or to add file type prefix. E.g.,\n" + " HDF5_PARAPREFIX=pfs:/PFS/user/me\n" + " export HDF5_PARAPREFIX\n" + "*** End of Hint ***\n"); - explained = TRUE; + explained = TRUE; #ifdef HDF5_PARAPREFIX prefix = HDF5_PARAPREFIX; #endif /* HDF5_PARAPREFIX */ - } + } #endif /* H5_HAVE_PARALLEL */ } else { - /* + /* * For serial: * First use the environment variable, then try the constant - */ - prefix = HDgetenv("HDF5_PREFIX"); + */ + prefix = HDgetenv("HDF5_PREFIX"); #ifdef HDF5_PREFIX - if (!prefix) + if (!prefix) prefix = HDF5_PREFIX; #endif /* HDF5_PREFIX */ } /* Prepend the prefix value to the base name */ if (prefix && *prefix) { - if (isppdriver){ + if (isppdriver){ /* This is a parallel system */ char *subdir; @@ -441,18 +439,18 @@ h5_fixname(const char *base_name, hid_t fapl, char *fullname, size_t size) return NULL; } } else if (HDstrlen(base_name) >= size) { - /* Buffer is too small */ - return NULL; + /* Buffer is too small */ + return NULL; } else { - HDstrcpy(fullname, base_name); + HDstrcpy(fullname, base_name); } /* Append a suffix */ if (suffix) { - if (HDstrlen(fullname) + HDstrlen(suffix) >= size) + if (HDstrlen(fullname) + HDstrlen(suffix) >= size) return NULL; - HDstrcat(fullname, suffix); + HDstrcat(fullname, suffix); } /* Remove any double slashes in the filename */ @@ -468,19 +466,19 @@ h5_fixname(const char *base_name, hid_t fapl, char *fullname, size_t size) /*------------------------------------------------------------------------- - * Function: h5_rmprefix + * Function: h5_rmprefix * - * Purpose: This "removes" the MPIO driver prefix part of the file name - * by returning a pointer that points at the non-prefix component + * Purpose: This "removes" the MPIO driver prefix part of the file name + * by returning a pointer that points at the non-prefix component * part of the file name. E.g., - * Input Return - * pfs:/scratch1/dataX /scratch1/dataX - * /scratch2/dataY /scratch2/dataY - * Note that there is no change to the original file name. + * Input Return + * pfs:/scratch1/dataX /scratch1/dataX + * /scratch2/dataY /scratch2/dataY + * Note that there is no change to the original file name. * - * Return: Success: a pointer at the non-prefix part. + * Return: Success: a pointer at the non-prefix part. * - * Programmer: Albert Cheng; Jun 1, 2006 + * Programmer: Albert Cheng; Jun 1, 2006 * *------------------------------------------------------------------------- */ @@ -490,26 +488,26 @@ h5_rmprefix(const char *filename) const char *ret_ptr; if ((ret_ptr = HDstrstr(filename, ":")) == NULL) - ret_ptr = filename; + ret_ptr = filename; else - ret_ptr++; + ret_ptr++; return(ret_ptr); } /*------------------------------------------------------------------------- - * Function: h5_fileaccess + * Function: h5_fileaccess * - * Purpose: Returns a file access template which is the default template - * but with a file driver set according to the constant or - * environment variable HDF5_DRIVER + * Purpose: Returns a file access template which is the default template + * but with a file driver set according to the constant or + * environment variable HDF5_DRIVER * - * Return: Success: A file access property list + * Return: Success: A file access property list * - * Failure: -1 + * Failure: -1 * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, November 19, 1998 * * Modifications: @@ -519,8 +517,8 @@ h5_rmprefix(const char *filename) hid_t h5_fileaccess(void) { - const char *val = NULL; - const char *name; + const char *val = NULL; + const char *name; char s[1024]; hid_t fapl = -1; @@ -538,53 +536,53 @@ h5_fileaccess(void) if (NULL==(name=HDstrtok(s, " \t\n\r"))) return fapl; if (!HDstrcmp(name, "sec2")) { - /* Unix read() and write() system calls */ - if (H5Pset_fapl_sec2(fapl)<0) return -1; + /* Unix read() and write() system calls */ + if (H5Pset_fapl_sec2(fapl)<0) return -1; } else if (!HDstrcmp(name, "stdio")) { - /* Standard C fread() and fwrite() system calls */ - if (H5Pset_fapl_stdio(fapl)<0) return -1; + /* Standard C fread() and fwrite() system calls */ + if (H5Pset_fapl_stdio(fapl)<0) return -1; } else if (!HDstrcmp(name, "core")) { - /* In-core temporary file with 1MB increment */ - if (H5Pset_fapl_core(fapl, (size_t)1, TRUE)<0) return -1; + /* In-core temporary file with 1MB increment */ + if (H5Pset_fapl_core(fapl, (size_t)1, TRUE)<0) return -1; } else if (!HDstrcmp(name, "split")) { - /* Split meta data and raw data each using default driver */ - if (H5Pset_fapl_split(fapl, - "-m.h5", H5P_DEFAULT, - "-r.h5", H5P_DEFAULT)<0) - return -1; + /* Split meta data and raw data each using default driver */ + if (H5Pset_fapl_split(fapl, + "-m.h5", H5P_DEFAULT, + "-r.h5", H5P_DEFAULT)<0) + return -1; } else if (!HDstrcmp(name, "multi")) { - /* Multi-file driver, general case of the split driver */ - H5FD_mem_t memb_map[H5FD_MEM_NTYPES]; - hid_t memb_fapl[H5FD_MEM_NTYPES]; - const char *memb_name[H5FD_MEM_NTYPES]; - char sv[H5FD_MEM_NTYPES][1024]; - haddr_t memb_addr[H5FD_MEM_NTYPES]; - H5FD_mem_t mt; - - HDmemset(memb_map, 0, sizeof memb_map); - HDmemset(memb_fapl, 0, sizeof memb_fapl); - HDmemset(memb_name, 0, sizeof memb_name); - HDmemset(memb_addr, 0, sizeof memb_addr); - - HDassert(HDstrlen(multi_letters)==H5FD_MEM_NTYPES); - for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, mt)) { - memb_fapl[mt] = H5P_DEFAULT; - sprintf(sv[mt], "%%s-%c.h5", multi_letters[mt]); - memb_name[mt] = sv[mt]; - memb_addr[mt] = (haddr_t)MAX(mt - 1, 0) * (HADDR_MAX / 10); - } /* end for */ - - if (H5Pset_fapl_multi(fapl, memb_map, memb_fapl, memb_name, - memb_addr, FALSE)<0) { - return -1; - } + /* Multi-file driver, general case of the split driver */ + H5FD_mem_t memb_map[H5FD_MEM_NTYPES]; + hid_t memb_fapl[H5FD_MEM_NTYPES]; + const char *memb_name[H5FD_MEM_NTYPES]; + char sv[H5FD_MEM_NTYPES][1024]; + haddr_t memb_addr[H5FD_MEM_NTYPES]; + H5FD_mem_t mt; + + HDmemset(memb_map, 0, sizeof memb_map); + HDmemset(memb_fapl, 0, sizeof memb_fapl); + HDmemset(memb_name, 0, sizeof memb_name); + HDmemset(memb_addr, 0, sizeof memb_addr); + + HDassert(HDstrlen(multi_letters)==H5FD_MEM_NTYPES); + for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, mt)) { + memb_fapl[mt] = H5P_DEFAULT; + sprintf(sv[mt], "%%s-%c.h5", multi_letters[mt]); + memb_name[mt] = sv[mt]; + memb_addr[mt] = (haddr_t)MAX(mt - 1, 0) * (HADDR_MAX / 10); + } /* end for */ + + if (H5Pset_fapl_multi(fapl, memb_map, memb_fapl, memb_name, + memb_addr, FALSE)<0) { + return -1; + } } else if (!HDstrcmp(name, "family")) { hsize_t fam_size = 100*1024*1024; /*100 MB*/ - /* Family of files, each 1MB and using the default driver */ - if ((val=HDstrtok(NULL, " \t\n\r"))) - fam_size = (hsize_t)(HDstrtod(val, NULL) * 1024*1024); - if (H5Pset_fapl_family(fapl, fam_size, H5P_DEFAULT)<0) + /* Family of files, each 1MB and using the default driver */ + if ((val=HDstrtok(NULL, " \t\n\r"))) + fam_size = (hsize_t)(HDstrtod(val, NULL) * 1024*1024); + if (H5Pset_fapl_family(fapl, fam_size, H5P_DEFAULT)<0) return -1; } else if (!HDstrcmp(name, "log")) { unsigned log_flags = H5FD_LOG_LOC_IO | H5FD_LOG_ALLOC; @@ -594,20 +592,20 @@ h5_fileaccess(void) log_flags = (unsigned)HDstrtol(val, NULL, 0); if (H5Pset_fapl_log(fapl, NULL, log_flags, (size_t)0) < 0) - return -1; + return -1; } else if (!HDstrcmp(name, "direct")) { #ifdef H5_HAVE_DIRECT - /* Linux direct read() and write() system calls. Set memory boundary, file block size, - * and copy buffer size to the default values. */ - if (H5Pset_fapl_direct(fapl, 1024, 4096, 8*4096)<0) return -1; + /* Linux direct read() and write() system calls. Set memory boundary, file block size, + * and copy buffer size to the default values. */ + if (H5Pset_fapl_direct(fapl, 1024, 4096, 8*4096)<0) return -1; #endif } else if(!HDstrcmp(name, "latest")) { - /* use the latest format */ - if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) + /* use the latest format */ + if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) return -1; } else { - /* Unknown driver */ - return -1; + /* Unknown driver */ + return -1; } return fapl; @@ -615,13 +613,13 @@ h5_fileaccess(void) /*------------------------------------------------------------------------- - * Function: h5_no_hwconv + * Function: h5_no_hwconv * - * Purpose: Turn off hardware data type conversions. + * Purpose: Turn off hardware data type conversions. * - * Return: void + * Return: void * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Friday, November 20, 1998 * * Modifications: @@ -636,13 +634,13 @@ h5_no_hwconv(void) /*------------------------------------------------------------------------- - * Function: h5_show_hostname + * Function: h5_show_hostname * - * Purpose: Show hostname. Show process ID if in MPI environment. + * Purpose: Show hostname. Show process ID if in MPI environment. * - * Return: void + * Return: void * - * Programmer: Albert Cheng + * Programmer: Albert Cheng * 2002/04/22 * * Modifications: @@ -652,8 +650,8 @@ h5_no_hwconv(void) void h5_show_hostname(void) { - char hostname[80]; -#ifdef H5_HAVE_WINSOCK_H + char hostname[80]; +#ifdef H5_HAVE_WIN32_API WSADATA wsaData; int err; #endif @@ -661,21 +659,21 @@ h5_show_hostname(void) /* try show the process or thread id in multiple processes cases*/ #ifdef H5_HAVE_PARALLEL { - int mpi_rank, mpi_initialized; - - MPI_Initialized(&mpi_initialized); - if (mpi_initialized){ - MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank); - printf("MPI-process %d.", mpi_rank); - }else - printf("thread 0."); + int mpi_rank, mpi_initialized; + + MPI_Initialized(&mpi_initialized); + if (mpi_initialized){ + MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank); + printf("MPI-process %d.", mpi_rank); + }else + printf("thread 0."); } #elif defined(H5_HAVE_THREADSAFE) printf("thread %lu.", HDpthread_self_ulong()); #else printf("thread 0."); #endif -#ifdef H5_HAVE_WINSOCK_H +#ifdef H5_HAVE_WIN32_API err = WSAStartup( MAKEWORD(2,2), &wsaData ); if ( err != 0 ) { @@ -699,13 +697,13 @@ h5_show_hostname(void) #endif #ifdef H5_HAVE_GETHOSTNAME if (gethostname(hostname, (size_t)80) < 0) - printf(" gethostname failed\n"); + printf(" gethostname failed\n"); else - printf(" hostname=%s\n", hostname); + printf(" hostname=%s\n", hostname); #else printf(" gethostname not supported\n"); #endif -#ifdef H5_HAVE_WINSOCK_H +#ifdef H5_HAVE_WIN32_API WSACleanup(); #endif } @@ -728,8 +726,8 @@ h5_show_hostname(void) int h5_set_info_object(void) { - char *envp; /* environment pointer */ - int ret_value=0; + char *envp; /* environment pointer */ + int ret_value=0; /* handle any MPI INFO hints via $HDF5_MPI_INFO */ if ((envp = getenv("HDF5_MPI_INFO")) != NULL){ @@ -816,39 +814,39 @@ h5_set_info_object(void) void h5_dump_info_object(MPI_Info info) { - char key[MPI_MAX_INFO_KEY+1]; - char value[MPI_MAX_INFO_VAL+1]; - int flag; - int i, nkeys; + char key[MPI_MAX_INFO_KEY+1]; + char value[MPI_MAX_INFO_VAL+1]; + int flag; + int i, nkeys; printf("Dumping MPI Info Object(%d) (up to %d bytes per item):\n", (int)info, - MPI_MAX_INFO_VAL); + MPI_MAX_INFO_VAL); if (info==MPI_INFO_NULL){ - printf("object is MPI_INFO_NULL\n"); + printf("object is MPI_INFO_NULL\n"); } else { - MPI_Info_get_nkeys(info, &nkeys); - printf("object has %d items\n", nkeys); - for (i=0; i= 0) { - if(env == NULL) - env = (char*) HDmalloc(len+1); - else if(strlen(env) < len) - env = (char*) HDrealloc(env, len+1); - - MPI_Bcast(env, len, MPI_CHAR, root, comm); - env[len] = '\0'; - } - else { - if(env) - HDfree(env); - env = NULL; - } - } + MPI_Comm_rank(comm, &mpi_rank); + MPI_Comm_size(comm, &mpi_size); + assert(root < mpi_size); + + /* The root task does the getenv call + * and sends the result to the other tasks */ + if(mpi_rank == root) { + env = HDgetenv(name); + if(env) { + len = HDstrlen(env); + MPI_Bcast(&len, 1, MPI_INT, root, comm); + MPI_Bcast(env, len, MPI_CHAR, root, comm); + } + else { + /* len -1 indicates that the variable was not in the environment */ + len = -1; + MPI_Bcast(&len, 1, MPI_INT, root, comm); + } + } + else { + MPI_Bcast(&len, 1, MPI_INT, root, comm); + if(len >= 0) { + if(env == NULL) + env = (char*) HDmalloc(len+1); + else if(strlen(env) < len) + env = (char*) HDrealloc(env, len+1); + + MPI_Bcast(env, len, MPI_CHAR, root, comm); + env[len] = '\0'; + } + else { + if(env) + HDfree(env); + env = NULL; + } + } } #ifndef NDEBUG @@ -1118,7 +1116,7 @@ getenv_all(MPI_Comm comm, int root, const char* name) *------------------------------------------------------------------------- */ hid_t -h5_make_local_copy(char *origfilename, char *local_copy_name) +h5_make_local_copy(const char *origfilename, const char *local_copy_name) { int fd_old = (-1), fd_new = (-1); /* File descriptors for copying data */ ssize_t nread; /* Number of bytes read in */ @@ -1175,7 +1173,7 @@ h5_verify_cached_stabs_cb(hid_t oid, const char UNUSED *name, const H5O_info_t *oinfo, void UNUSED *udata) { if(oinfo->type == H5O_TYPE_GROUP) - return(H5G_verify_cached_stabs_test(oid)); + return(H5G__verify_cached_stabs_test(oid)); else return(0); } /* end h5_verify_cached_stabs_cb() */ diff --git a/test/h5test.h b/test/h5test.h index 5d3fb17..dd38546 100644 --- a/test/h5test.h +++ b/test/h5test.h @@ -61,18 +61,18 @@ /* Should be used internally by the libtest.a only. */ #define HDGetTestVerbosity() (TestVerbosity) -#define VERBOSE_NONE (HDGetTestVerbosity()==VERBO_NONE) -#define VERBOSE_DEF (HDGetTestVerbosity()>=VERBO_DEF) -#define VERBOSE_LO (HDGetTestVerbosity()>=VERBO_LO) -#define VERBOSE_MED (HDGetTestVerbosity()>=VERBO_MED) -#define VERBOSE_HI (HDGetTestVerbosity()>=VERBO_HI) +#define VERBOSE_NONE (HDGetTestVerbosity()==VERBO_NONE) +#define VERBOSE_DEF (HDGetTestVerbosity()>=VERBO_DEF) +#define VERBOSE_LO (HDGetTestVerbosity()>=VERBO_LO) +#define VERBOSE_MED (HDGetTestVerbosity()>=VERBO_MED) +#define VERBOSE_HI (HDGetTestVerbosity()>=VERBO_HI) /* * Test controls definitions. */ -#define SKIPTEST 1 /* Skip this test */ -#define ONLYTEST 2 /* Do only this test */ -#define BEGINTEST 3 /* Skip all tests before this test */ +#define SKIPTEST 1 /* Skip this test */ +#define ONLYTEST 2 /* Do only this test */ +#define BEGINTEST 3 /* Skip all tests before this test */ /* * This contains the filename prefix specificied as command line option for @@ -80,14 +80,14 @@ */ H5TEST_DLLVAR char *paraprefix; #ifdef H5_HAVE_PARALLEL -extern MPI_Info h5_io_info_g; /* MPI INFO object for IO */ +H5TEST_DLLVAR MPI_Info h5_io_info_g; /* MPI INFO object for IO */ #endif /* * Print the current location on the standard output stream. */ -#define AT() printf (" at %s:%d in %s()...\n", \ - __FILE__, __LINE__, __FUNCTION__); +#define AT() printf (" at %s:%d in %s()...\n", \ + __FILE__, __LINE__, FUNC); /* * The name of the test is printed by saying TESTING("something") which will @@ -98,12 +98,12 @@ extern MPI_Info h5_io_info_g; /* MPI INFO object for IO */ * spaces. If the h5_errors() is used for automatic error handling then * the H5_FAILED() macro is invoked automatically when an API function fails. */ -#define TESTING(WHAT) {printf("Testing %-62s",WHAT); fflush(stdout);} -#define TESTING_2(WHAT) {printf(" Testing %-62s",WHAT); fflush(stdout);} -#define PASSED() {puts(" PASSED");fflush(stdout);} -#define H5_FAILED() {puts("*FAILED*");fflush(stdout);} -#define H5_WARNING() {puts("*WARNING*");fflush(stdout);} -#define SKIPPED() {puts(" -SKIP-");fflush(stdout);} +#define TESTING(WHAT) {printf("Testing %-62s",WHAT); fflush(stdout);} +#define TESTING_2(WHAT) {printf(" Testing %-62s",WHAT); fflush(stdout);} +#define PASSED() {puts(" PASSED");fflush(stdout);} +#define H5_FAILED() {puts("*FAILED*");fflush(stdout);} +#define H5_WARNING() {puts("*WARNING*");fflush(stdout);} +#define SKIPPED() {puts(" -SKIP-");fflush(stdout);} #define TEST_ERROR {H5_FAILED(); AT(); goto error;} #define STACK_ERROR {H5Eprint2(H5E_DEFAULT, stdout); goto error;} #define FAIL_STACK_ERROR {H5_FAILED(); AT(); H5Eprint2(H5E_DEFAULT, stdout); \ @@ -113,9 +113,9 @@ extern MPI_Info h5_io_info_g; /* MPI INFO object for IO */ /* * Alarm definitions to wait up (terminate) a test that runs too long. */ -#define H5_ALARM_SEC 1200 /* default is 20 minutes */ -#define ALARM_ON TestAlarmOn() -#define ALARM_OFF HDalarm(0) +#define H5_ALARM_SEC 1200 /* default is 20 minutes */ +#define ALARM_ON TestAlarmOn() +#define ALARM_OFF HDalarm(0) /* * The methods to compare the equality of floating-point values: @@ -127,9 +127,9 @@ extern MPI_Info h5_io_info_g; /* MPI INFO object for IO */ * It's the test's responsibility not to pass in the value 0, which * may cause the equation to fail. */ -#define FLT_ABS_EQUAL(X,Y) ((float)fabs(X-Y)= 0) TEST_ERROR /* Verify state of group */ - if(H5G_has_stab_test(group_id) != TRUE) TEST_ERROR + if(H5G__has_stab_test(group_id) != TRUE) TEST_ERROR /* Close the group */ if(H5Gclose(group_id) < 0) TEST_ERROR @@ -11291,7 +11534,7 @@ delete_by_idx(hid_t fapl) } /* end for */ /* Verify state of group (compact) */ - if(H5G_has_links_test(group_id, NULL) != TRUE) TEST_ERROR + if(H5G__has_links_test(group_id, NULL) != TRUE) TEST_ERROR /* Check for out of bound deletion */ H5E_BEGIN_TRY { @@ -11328,7 +11571,7 @@ delete_by_idx(hid_t fapl) if(H5Ldelete_by_idx(group_id, ".", idx_type, order, (hsize_t)0, H5P_DEFAULT) < 0) TEST_ERROR /* Verify state of group (empty) */ - if(H5G_has_links_test(group_id, NULL) == TRUE) TEST_ERROR + if(H5G__has_links_test(group_id, NULL) == TRUE) TEST_ERROR /* Create more links, to push group into dense form */ for(u = 0; u < (max_compact * 2); u++) { @@ -11343,7 +11586,7 @@ delete_by_idx(hid_t fapl) /* Verify state of group (dense) */ if(u >= max_compact) - if(H5G_is_new_dense_test(group_id) != TRUE) TEST_ERROR + if(H5G__is_new_dense_test(group_id) != TRUE) TEST_ERROR /* Verify link information for new link */ if(link_info_by_idx_check(group_id, objname, (hsize_t)u, TRUE, use_index) < 0) TEST_ERROR @@ -11384,8 +11627,8 @@ delete_by_idx(hid_t fapl) if(H5Ldelete_by_idx(group_id, ".", idx_type, order, (hsize_t)0, H5P_DEFAULT) < 0) TEST_ERROR /* Verify state of group (empty) */ - if(H5G_has_links_test(group_id, NULL) == TRUE) TEST_ERROR - if(H5G_is_new_dense_test(group_id) == TRUE) TEST_ERROR + if(H5G__has_links_test(group_id, NULL) == TRUE) TEST_ERROR + if(H5G__is_new_dense_test(group_id) == TRUE) TEST_ERROR /* Check for deletion on empty group again */ H5E_BEGIN_TRY { @@ -11410,7 +11653,7 @@ delete_by_idx(hid_t fapl) /* Verify state of group (dense) */ if(u >= max_compact) - if(H5G_is_new_dense_test(group_id) != TRUE) TEST_ERROR + if(H5G__is_new_dense_test(group_id) != TRUE) TEST_ERROR /* Verify link information for new link */ if(link_info_by_idx_check(group_id, objname, (hsize_t)u, TRUE, use_index) < 0) TEST_ERROR @@ -11470,8 +11713,8 @@ delete_by_idx(hid_t fapl) if(H5Ldelete_by_idx(group_id, ".", idx_type, order, (hsize_t)0, H5P_DEFAULT) < 0) TEST_ERROR /* Verify state of group (empty) */ - if(H5G_has_links_test(group_id, NULL) == TRUE) TEST_ERROR - if(H5G_is_new_dense_test(group_id) == TRUE) TEST_ERROR + if(H5G__has_links_test(group_id, NULL) == TRUE) TEST_ERROR + if(H5G__is_new_dense_test(group_id) == TRUE) TEST_ERROR @@ -11621,7 +11864,7 @@ delete_by_idx_old(hid_t fapl) if(ret >= 0) TEST_ERROR /* Verify state of group */ - if(H5G_has_stab_test(group_id) != TRUE) TEST_ERROR + if(H5G__has_stab_test(group_id) != TRUE) TEST_ERROR /* Delete links in middle */ @@ -11703,7 +11946,7 @@ delete_by_idx_old(hid_t fapl) if(H5Ldelete_by_idx(group_id, ".", H5_INDEX_NAME, order, (hsize_t)0, H5P_DEFAULT) < 0) TEST_ERROR /* Verify state of group */ - if(H5G_has_stab_test(group_id) != TRUE) TEST_ERROR + if(H5G__has_stab_test(group_id) != TRUE) TEST_ERROR /* Close the group */ if(H5Gclose(group_id) < 0) TEST_ERROR @@ -12130,7 +12373,7 @@ link_iterate(hid_t fapl) } /* end for */ /* Verify state of group (compact) */ - if(H5G_has_links_test(group_id, NULL) != TRUE) TEST_ERROR + if(H5G__has_links_test(group_id, NULL) != TRUE) TEST_ERROR /* Check for out of bound iteration on compact group */ skip = (hsize_t)u; @@ -12156,7 +12399,7 @@ link_iterate(hid_t fapl) } /* end for */ /* Verify state of group (dense) */ - if(H5G_is_new_dense_test(group_id) != TRUE) TEST_ERROR + if(H5G__is_new_dense_test(group_id) != TRUE) TEST_ERROR /* Check for out of bound iteration on dense group */ skip = (hsize_t)u; @@ -12543,7 +12786,7 @@ link_iterate_old(hid_t fapl) } /* end for */ /* Verify state of group (symbol table) */ - if(H5G_has_stab_test(group_id) != TRUE) TEST_ERROR + if(H5G__has_stab_test(group_id) != TRUE) TEST_ERROR /* Check for out of bound iteration on old-style group */ skip = (hsize_t)u; @@ -12834,7 +13077,7 @@ open_by_idx(hid_t fapl) } /* end for */ /* Verify state of group (compact) */ - if(H5G_has_links_test(group_id, NULL) != TRUE) TEST_ERROR + if(H5G__has_links_test(group_id, NULL) != TRUE) TEST_ERROR /* Check for out of bound open by index on compact group */ H5E_BEGIN_TRY { @@ -12869,7 +13112,7 @@ open_by_idx(hid_t fapl) } /* end for */ /* Verify state of group (dense) */ - if(H5G_is_new_dense_test(group_id) != TRUE) TEST_ERROR + if(H5G__is_new_dense_test(group_id) != TRUE) TEST_ERROR /* Check for out of bound open by index on compact group */ H5E_BEGIN_TRY { @@ -13011,7 +13254,7 @@ open_by_idx_old(hid_t fapl) } /* end for */ /* Verify state of group (symbol table) */ - if(H5G_has_stab_test(group_id) != TRUE) TEST_ERROR + if(H5G__has_stab_test(group_id) != TRUE) TEST_ERROR /* Check for out of bound open by index */ H5E_BEGIN_TRY { @@ -13282,7 +13525,7 @@ object_info(hid_t fapl) } /* end for */ /* Verify state of group (compact) */ - if(H5G_has_links_test(group_id, NULL) != TRUE) TEST_ERROR + if(H5G__has_links_test(group_id, NULL) != TRUE) TEST_ERROR /* Check for out of bound query by index */ H5E_BEGIN_TRY { @@ -13330,7 +13573,7 @@ object_info(hid_t fapl) } /* end for */ /* Verify state of group (dense) */ - if(H5G_is_new_dense_test(group_id) != TRUE) TEST_ERROR + if(H5G__is_new_dense_test(group_id) != TRUE) TEST_ERROR /* Check for out of bound query by index */ H5E_BEGIN_TRY { @@ -13479,7 +13722,7 @@ object_info_old(hid_t fapl) } /* end for */ /* Verify state of group (symbol table) */ - if(H5G_has_stab_test(group_id) != TRUE) TEST_ERROR + if(H5G__has_stab_test(group_id) != TRUE) TEST_ERROR /* Check for out of bound query by index */ H5E_BEGIN_TRY { @@ -13767,7 +14010,7 @@ group_info(hid_t fapl) } /* end for */ /* Verify state of group (compact) */ - if(H5G_has_links_test(group_id, NULL) != TRUE) TEST_ERROR + if(H5G__has_links_test(group_id, NULL) != TRUE) TEST_ERROR /* Check for out of bound query by index */ H5E_BEGIN_TRY { @@ -13908,7 +14151,7 @@ group_info(hid_t fapl) } /* end for */ /* Verify state of group (dense) */ - if(H5G_is_new_dense_test(group_id) != TRUE) TEST_ERROR + if(H5G__is_new_dense_test(group_id) != TRUE) TEST_ERROR /* Check for out of bound query by index */ H5E_BEGIN_TRY { @@ -14138,7 +14381,7 @@ group_info_old(hid_t fapl) } /* end for */ /* Verify state of group (old-style) */ - if(H5G_has_stab_test(group_id) != TRUE) TEST_ERROR + if(H5G__has_stab_test(group_id) != TRUE) TEST_ERROR /* Check for out of bound query by index */ H5E_BEGIN_TRY { @@ -14478,6 +14721,9 @@ main(void) nerrors += external_symlink(env_h5_drvr, my_fapl, new_format) < 0 ? 1 : 0; nerrors += external_copy_invalid_object(my_fapl, new_format) < 0 ? 1 : 0; nerrors += external_dont_fail_to_source(my_fapl, new_format) < 0 ? 1 : 0; +#ifndef H5_CANNOT_OPEN_TWICE + nerrors += external_open_twice(my_fapl, new_format) < 0 ? 1 : 0; +#endif /* H5_CANNOT_OPEN_TWICE */ } /* end for */ /* These tests assume that external links are a form of UD links, diff --git a/test/mount.c b/test/mount.c index f63404d..b7180fa 100644 --- a/test/mount.c +++ b/test/mount.c @@ -983,10 +983,13 @@ error: static int test_interlink(hid_t fapl) { - hid_t file1 = -1, file2 = -1, type = -1, space = -1, dset = -1; + hid_t file1 = -1, file2 = -1; +#ifdef NOT_NOW + hid_t type = -1, space = -1, dset = -1; + hsize_t cur_dims[1] = {2}; +#endif /* NOT_NOW */ char filename1[1024], filename2[1024]; herr_t status; - hsize_t cur_dims[1] = {2}; TESTING("interfile hard links"); h5_fixname(FILENAME[0], fapl, filename1, sizeof filename1); @@ -1018,6 +1021,11 @@ test_interlink(hid_t fapl) TEST_ERROR } /* end if */ +/* Commented this code out until Jira issue #7638 is resolved. Once that + * issue is resolved (hopefully by refactored the file code to use shared + * file pointers for all operations), this should be uncommented. -QAK + */ +#ifdef NOT_NOW /* Try an interfile hard link by sharing a data type */ if((type = H5Tcopy(H5T_NATIVE_INT)) < 0) FAIL_STACK_ERROR if(H5Tcommit2(file1, "/type1", type, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR @@ -1031,9 +1039,15 @@ test_interlink(hid_t fapl) TEST_ERROR } /* end if */ - /* Shut down */ + /* Close IDs */ if(H5Sclose(space) < 0) FAIL_STACK_ERROR if(H5Tclose(type) < 0) FAIL_STACK_ERROR +#else /* NOT_NOW */ + SKIPPED(); + HDputs(" Test skipped due file pointer sharing issue (Jira 7638)."); +#endif /* NOT_NOW */ + + /* Shut down */ if(H5Funmount(file1, "/mnt1") < 0) FAIL_STACK_ERROR if(H5Fclose(file1) < 0) FAIL_STACK_ERROR if(H5Fclose(file2) < 0) FAIL_STACK_ERROR @@ -1043,9 +1057,11 @@ test_interlink(hid_t fapl) error: H5E_BEGIN_TRY { +#ifdef NOT_NOW H5Dclose(dset); H5Sclose(space); H5Tclose(type); +#endif /* NOT_NOW */ H5Fclose(file1); H5Fclose(file2); } H5E_END_TRY; diff --git a/test/multi_file_v16-r.h5 b/test/multi_file_v16-r.h5 new file mode 100644 index 0000000..36a4c88 Binary files /dev/null and b/test/multi_file_v16-r.h5 differ diff --git a/test/multi_file_v16-s.h5 b/test/multi_file_v16-s.h5 new file mode 100644 index 0000000..e990e95 Binary files /dev/null and b/test/multi_file_v16-s.h5 differ diff --git a/test/ntypes.c b/test/ntypes.c index 3310a82..165d21b 100644 --- a/test/ntypes.c +++ b/test/ntypes.c @@ -331,7 +331,7 @@ test_compound_dtype2(hid_t file) temp_point->st.c2 = (short)(i + j); temp_point->st.l2 = (i * 5 + j * 50) * n; temp_point->st.ll2 = (i * 10 + j * 100) * n; - temp_point->l = (unsigned long long)((i * 100 + j * 1000) * n); + temp_point->l = (unsigned long long)((i * 40 + j * 400) * n); } /* end for */ } /* end for */ @@ -2187,7 +2187,7 @@ test_refer_dtype(hid_t file) TEST_ERROR; /* Open datatype object */ - if((tid1 = H5Rdereference(dataset, H5R_OBJECT, rbuf)) < 0) + if((tid1 = H5Rdereference2(dataset, H5P_DEFAULT, H5R_OBJECT, rbuf)) < 0) TEST_ERROR; /* Verify correct datatype */ @@ -2372,7 +2372,7 @@ test_refer_dtype2(hid_t file) TEST_ERROR; /* Try to open objects */ - if((dset2 = H5Rdereference(dset1, H5R_DATASET_REGION, &rbuf)) < 0) + if((dset2 = H5Rdereference2(dset1, H5P_DEFAULT, H5R_DATASET_REGION, &rbuf)) < 0) TEST_ERROR; /* Check what H5Rget_obj_type2 function returns */ diff --git a/test/objcopy.c b/test/objcopy.c index 95b2db3..8fb8bbe 100755 --- a/test/objcopy.c +++ b/test/objcopy.c @@ -61,9 +61,10 @@ const char *FILENAME[] = { */ #define CONFIG_SHARE_SRC 1 #define CONFIG_SHARE_DST 2 -#define CONFIG_NEW_FORMAT 4 -#define CONFIG_DENSE 8 -#define MAX_CONFIGURATION 15 +#define CONFIG_SRC_NEW_FORMAT 4 +#define CONFIG_DST_NEW_FORMAT 8 +#define CONFIG_DENSE 16 +#define MAX_CONFIGURATION 31 #define FILE_EXT "objcopy_ext.dat" /* The fill_old.h5 is generated from gen_old_fill.c in HDF5 'test' directory @@ -985,8 +986,8 @@ compare_data(hid_t parent1, hid_t parent2, hid_t pid, hid_t tid, size_t nelmts, if(obj1_type != obj2_type) TEST_ERROR /* Open referenced objects */ - if((obj1_id = H5Rdereference(parent1, H5R_OBJECT, ref_buf1)) < 0) TEST_ERROR - if((obj2_id = H5Rdereference(parent2, H5R_OBJECT, ref_buf2)) < 0) TEST_ERROR + if((obj1_id = H5Rdereference2(parent1, H5P_DEFAULT, H5R_OBJECT, ref_buf1)) < 0) TEST_ERROR + if((obj2_id = H5Rdereference2(parent2, H5P_DEFAULT, H5R_OBJECT, ref_buf2)) < 0) TEST_ERROR /* break the infinite loop when the ref_object points to itself */ if(obj_owner > 0) { @@ -1043,8 +1044,8 @@ compare_data(hid_t parent1, hid_t parent2, hid_t pid, hid_t tid, size_t nelmts, if(obj1_type != obj2_type) TEST_ERROR /* Open referenced objects */ - if((obj1_id = H5Rdereference(parent1, H5R_DATASET_REGION, ref_buf1)) < 0) TEST_ERROR - if((obj2_id = H5Rdereference(parent2, H5R_DATASET_REGION, ref_buf2)) < 0) TEST_ERROR + if((obj1_id = H5Rdereference2(parent1, H5P_DEFAULT, H5R_DATASET_REGION, ref_buf1)) < 0) TEST_ERROR + if((obj2_id = H5Rdereference2(parent2, H5P_DEFAULT, H5R_DATASET_REGION, ref_buf2)) < 0) TEST_ERROR /* break the infinite loop when the ref_object points to itself */ if(obj_owner > 0) { @@ -1249,7 +1250,8 @@ compare_datasets(hid_t did, hid_t did2, hid_t pid, const void *wbuf) * data in each dataset will (probably) be different and the storage * size will thus vary) */ - if(!(nfilters > 0 && H5Tdetect_class(tid, H5T_VLEN))) { + if(!(nfilters > 0 && (H5Tdetect_class(tid, H5T_VLEN) || + (H5Tdetect_class(tid, H5T_REFERENCE) && H5Tequal(tid, H5T_STD_REF_DSETREG))))) { hsize_t storage_size = H5Dget_storage_size(did); /* Dataset's raw data storage size */ hsize_t storage_size2 = H5Dget_storage_size(did2); /* 2nd Dataset's raw data storage size */ @@ -1535,7 +1537,7 @@ error: *------------------------------------------------------------------------- */ static int -test_copy_named_datatype(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) +test_copy_named_datatype(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) { hid_t fid_src = -1, fid_dst = -1; /* File IDs */ hid_t tid = -1, tid2 = -1; /* Datatype IDs */ @@ -1545,14 +1547,14 @@ test_copy_named_datatype(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) TESTING("H5Ocopy(): named datatype"); /* Initialize the filenames */ - h5_fixname(FILENAME[0], fapl, src_filename, sizeof src_filename); - h5_fixname(FILENAME[1], fapl, dst_filename, sizeof dst_filename); + h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename); + h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename); /* Reset file address checking info */ addr_reset(); /* create source file */ - if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, fapl)) < 0) TEST_ERROR + if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR /* create datatype */ if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0) TEST_ERROR @@ -1568,10 +1570,10 @@ test_copy_named_datatype(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) /* open the source file with read-only */ - if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR + if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, src_fapl)) < 0) TEST_ERROR /* create destination file */ - if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, fapl)) < 0) TEST_ERROR + if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */ if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR @@ -1628,7 +1630,7 @@ error: *------------------------------------------------------------------------- */ static int -test_copy_named_datatype_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) +test_copy_named_datatype_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) { hid_t fid_src = -1, fid_dst = -1; /* File IDs */ hid_t tid = -1, tid2 = -1; /* Datatype IDs */ @@ -1638,14 +1640,14 @@ test_copy_named_datatype_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) TESTING("H5Ocopy(): named vlen datatype"); /* Initialize the filenames */ - h5_fixname(FILENAME[0], fapl, src_filename, sizeof src_filename); - h5_fixname(FILENAME[1], fapl, dst_filename, sizeof dst_filename); + h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename); + h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename); /* Reset file address checking info */ addr_reset(); /* create source file */ - if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, fapl)) < 0) TEST_ERROR + if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR /* create datatype */ if((tid = H5Tvlen_create(H5T_NATIVE_INT)) < 0) TEST_ERROR @@ -1661,10 +1663,10 @@ test_copy_named_datatype_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) /* open the source file with read-only */ - if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR + if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, src_fapl)) < 0) TEST_ERROR /* create destination file */ - if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, fapl)) < 0) TEST_ERROR + if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */ if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR @@ -1721,7 +1723,7 @@ error: *------------------------------------------------------------------------- */ static int -test_copy_named_datatype_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) +test_copy_named_datatype_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) { hid_t fid_src = -1, fid_dst = -1; /* File IDs */ hid_t tid = -1, tid2 = -1; /* Datatype IDs */ @@ -1731,14 +1733,14 @@ test_copy_named_datatype_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) TESTING("H5Ocopy(): named nested vlen datatype"); /* Initialize the filenames */ - h5_fixname(FILENAME[0], fapl, src_filename, sizeof src_filename); - h5_fixname(FILENAME[1], fapl, dst_filename, sizeof dst_filename); + h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename); + h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename); /* Reset file address checking info */ addr_reset(); /* create source file */ - if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, fapl)) < 0) TEST_ERROR + if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR /* create first vlen datatype */ if((tid = H5Tvlen_create(H5T_NATIVE_INT)) < 0) TEST_ERROR @@ -1760,10 +1762,10 @@ test_copy_named_datatype_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) /* open the source file with read-only */ - if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR + if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, src_fapl)) < 0) TEST_ERROR /* create destination file */ - if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, fapl)) < 0) TEST_ERROR + if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */ if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR @@ -1803,7 +1805,150 @@ error: H5Fclose(fid_src); } H5E_END_TRY; return 1; -} /* end test_copy_named_datatype_vl */ +} /* end test_copy_named_datatype_vl_vl */ + + +/*------------------------------------------------------------------------- + * Function: test_copy_named_datatype_attr_self + * + * Purpose: Create name datatype in SRC file, with an attribute that + * uses that named datatype as its datatype, and copy it to + * DST file + * + * Return: Success: 0 + * Failure: number of errors + * + * Programmer: Neil + * Friday, March 11, 2011 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +static int +test_copy_named_datatype_attr_self(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) +{ + hid_t fid_src = -1, fid_dst = -1; /* File IDs */ + hid_t tid = -1, tid2 = -1; /* Datatype IDs */ + hid_t aid = -1; /* Attribute ID */ + hid_t sid = -1; /* Dataspace ID */ + hsize_t dims[2] = {3, 4}; /* Dataspace dimensions */ + H5O_info_t oinfo, oinfo2; /* Object info */ + H5G_info_t ginfo; /* Group info */ + char src_filename[NAME_BUF_SIZE]; + char dst_filename[NAME_BUF_SIZE]; + + TESTING("H5Ocopy(): named datatype with self-referential attribute"); + + /* Initialize the filenames */ + h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename); + h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename); + + /* Reset file address checking info */ + addr_reset(); + + /* create source file */ + if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR + + /* create datatype */ + if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0) TEST_ERROR + + /* create named datatype */ + if((H5Tcommit2(fid_src, NAME_DATATYPE_SIMPLE, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR + + /* create dataspace */ + if((sid = H5Screate_simple(2, dims, NULL)) < 0) TEST_ERROR + + /* create attribute */ + if((aid = H5Acreate2(tid, "attr_self", tid, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR + + /* attach other attributes to the dataset */ + if(test_copy_attach_attributes(tid, tid) < 0) TEST_ERROR + + /* close the attribute */ + if(H5Aclose(aid) < 0) TEST_ERROR + + /* close the datatype */ + if(H5Tclose(tid) < 0) TEST_ERROR + + /* close the dataspace */ + if(H5Sclose(sid) < 0) TEST_ERROR + + /* close the SRC file */ + if(H5Fclose(fid_src) < 0) TEST_ERROR + + + /* open the source file with read-only */ + if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, src_fapl)) < 0) TEST_ERROR + + /* create destination file */ + if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR + + /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */ + if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR + + /* copy the datatype from SRC to DST */ + if(H5Ocopy(fid_src, NAME_DATATYPE_SIMPLE, fid_dst, NAME_DATATYPE_SIMPLE, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR + + /* open the source datatype */ + if((tid = H5Topen2(fid_src, NAME_DATATYPE_SIMPLE, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + + /* open the copied datatype */ + if((tid2 = H5Topen2(fid_dst, NAME_DATATYPE_SIMPLE, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + + /* Compare the datatypes */ + if(H5Tequal(tid, tid2) != TRUE) TEST_ERROR + + /* close the source datatype */ + if(H5Tclose(tid) < 0) TEST_ERROR + + /* open the destination attribute */ + if((aid = H5Aopen(tid2, "attr_self", H5P_DEFAULT)) < 0) TEST_ERROR + + /* open the destination attribute's datatype */ + if((tid = H5Aget_type(aid)) < 0) TEST_ERROR + + /* verify that the attribute's datatype is committed */ + if(H5Tcommitted(tid) != TRUE) TEST_ERROR + + /* verify that the addresses of the datatypes are the same */ + if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR + if(H5Oget_info(tid2, &oinfo2) < 0) TEST_ERROR + if(oinfo.fileno != oinfo2.fileno || oinfo.addr != oinfo2.addr) + FAIL_PUTS_ERROR("destination attribute does not use the same committed datatype") + + /* Verify that there are only 2 links int he destination root group */ + if(H5Gget_info(fid_dst, &ginfo) < 0) + if(ginfo.nlinks != 2) + FAIL_PUTS_ERROR("unexpected number of links in destination root group") + + /* close the attribute */ + if(H5Aclose(aid) < 0) TEST_ERROR + + /* close the datatypes */ + if(H5Tclose(tid2) < 0) TEST_ERROR + if(H5Tclose(tid) < 0) TEST_ERROR + + /* close the SRC file */ + if(H5Fclose(fid_src) < 0) TEST_ERROR + + /* close the DST file */ + if(H5Fclose(fid_dst) < 0) TEST_ERROR + + PASSED(); + return 0; + +error: + H5E_BEGIN_TRY { + H5Tclose(tid2); + H5Tclose(tid); + H5Sclose(sid); + H5Aclose(aid); + H5Fclose(fid_dst); + H5Fclose(fid_src); + } H5E_END_TRY; + return 1; +} /* end test_copy_named_datatype_attr_self */ /*------------------------------------------------------------------------- @@ -1822,7 +1967,7 @@ error: *------------------------------------------------------------------------- */ static int -test_copy_dataset_simple(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) +test_copy_dataset_simple(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) { hid_t fid_src = -1, fid_dst = -1; /* File IDs */ hid_t sid = -1; /* Dataspace ID */ @@ -1841,14 +1986,14 @@ test_copy_dataset_simple(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) buf[i][j] = 10000 + 100*i+j; /* Initialize the filenames */ - h5_fixname(FILENAME[0], fapl, src_filename, sizeof src_filename); - h5_fixname(FILENAME[1], fapl, dst_filename, sizeof dst_filename); + h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename); + h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename); /* Reset file address checking info */ addr_reset(); /* create source file */ - if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, fapl)) < 0) TEST_ERROR + if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR /* Set dataspace dimensions */ dim2d[0] = DIM_SIZE_1; @@ -1877,10 +2022,10 @@ test_copy_dataset_simple(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) /* open the source file with read-only */ - if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR + if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, src_fapl)) < 0) TEST_ERROR /* create destination file */ - if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, fapl)) < 0) TEST_ERROR + if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */ if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR @@ -2045,7 +2190,7 @@ error: *------------------------------------------------------------------------- */ static int -test_copy_dataset_simple_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) +test_copy_dataset_simple_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) { hid_t fid_src = -1, fid_dst = -1; /* File IDs */ hid_t sid = -1; /* Dataspace ID */ @@ -2057,14 +2202,14 @@ test_copy_dataset_simple_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) TESTING("H5Ocopy(): empty contiguous dataset"); /* Initialize the filenames */ - h5_fixname(FILENAME[0], fapl, src_filename, sizeof src_filename); - h5_fixname(FILENAME[1], fapl, dst_filename, sizeof dst_filename); + h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename); + h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename); /* Reset file address checking info */ addr_reset(); /* create source file */ - if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, fapl)) < 0) TEST_ERROR + if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR /* Set dataspace dimensions */ dim2d[0] = DIM_SIZE_1; @@ -2090,10 +2235,10 @@ test_copy_dataset_simple_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) /* open the source file with read-only */ - if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR + if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, src_fapl)) < 0) TEST_ERROR /* create destination file */ - if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, fapl)) < 0) TEST_ERROR + if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */ if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR @@ -2153,7 +2298,7 @@ error: *------------------------------------------------------------------------- */ static int -test_copy_dataset_compound(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) +test_copy_dataset_compound(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) { hid_t fid_src = -1, fid_dst = -1; /* File IDs */ hid_t sid = -1; /* Dataspace ID */ @@ -2180,14 +2325,14 @@ test_copy_dataset_compound(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) } /* end for */ /* Initialize the filenames */ - h5_fixname(FILENAME[0], fapl, src_filename, sizeof src_filename); - h5_fixname(FILENAME[1], fapl, dst_filename, sizeof dst_filename); + h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename); + h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename); /* Reset file address checking info */ addr_reset(); /* create source file */ - if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, fapl)) < 0) TEST_ERROR + if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR /* Set dataspace dimensions */ dim1d[0] = DIM_SIZE_1; @@ -2223,10 +2368,10 @@ test_copy_dataset_compound(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) /* open the source file with read-only */ - if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR + if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, src_fapl)) < 0) TEST_ERROR /* create destination file */ - if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, fapl)) < 0) TEST_ERROR + if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */ if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR @@ -2287,7 +2432,7 @@ error: *------------------------------------------------------------------------- */ static int -test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) +test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) { hid_t fid_src = -1, fid_dst = -1; /* File IDs */ hid_t sid = -1; /* Dataspace ID */ @@ -2314,14 +2459,14 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) } /* end for */ /* Initialize the filenames */ - h5_fixname(FILENAME[0], fapl, src_filename, sizeof src_filename); - h5_fixname(FILENAME[1], fapl, dst_filename, sizeof dst_filename); + h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename); + h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename); /* Reset file address checking info */ addr_reset(); /* create source file */ - if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, fapl)) < 0) TEST_ERROR + if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR /* Set 1-D dataspace dimensions */ dim1d[0] = DIM_SIZE_1; @@ -2404,10 +2549,10 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) /* open the source file with read-only */ - if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR + if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, src_fapl)) < 0) TEST_ERROR /* create destination file */ - if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, fapl)) < 0) TEST_ERROR + if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */ if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR @@ -2424,7 +2569,7 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) if((did2 = H5Dopen2(fid_dst, NAME_DATASET_CHUNKED, H5P_DEFAULT)) < 0) TEST_ERROR /* Check if the array index type is correct */ - if(compare_idx_type(fapl, did2, H5D_CHUNK_IDX_EARRAY, H5D_CHUNK_IDX_BTREE) != TRUE) + if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_EARRAY, H5D_CHUNK_IDX_BTREE) != TRUE) TEST_ERROR /* Check if the datasets are equal */ @@ -2444,7 +2589,7 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) if((did2 = H5Dopen2(fid_dst, NAME_DATASET_CHUNKED2, H5P_DEFAULT)) < 0) TEST_ERROR /* Check if the array index type is correct */ - if(compare_idx_type(fapl, did2, H5D_CHUNK_IDX_FARRAY, H5D_CHUNK_IDX_BTREE) != TRUE) + if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_FARRAY, H5D_CHUNK_IDX_BTREE) != TRUE) TEST_ERROR /* Check if the datasets are equal */ @@ -2464,7 +2609,7 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) if((did2 = H5Dopen2(fid_dst, NAME_DATASET_CHUNKED3, H5P_DEFAULT)) < 0) TEST_ERROR /* Check if the array index type is correct */ - if(compare_idx_type(fapl, did2, H5D_CHUNK_IDX_NONE, H5D_CHUNK_IDX_BTREE) != TRUE) + if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_NONE, H5D_CHUNK_IDX_BTREE) != TRUE) TEST_ERROR /* Check if the datasets are equal */ @@ -2514,7 +2659,7 @@ error: *------------------------------------------------------------------------- */ static int -test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) +test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) { hid_t fid_src = -1, fid_dst = -1; /* File IDs */ hid_t sid = -1; /* Dataspace ID */ @@ -2531,14 +2676,14 @@ test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) TESTING("H5Ocopy(): empty chunked dataset"); /* Initialize the filenames */ - h5_fixname(FILENAME[0], fapl, src_filename, sizeof src_filename); - h5_fixname(FILENAME[1], fapl, dst_filename, sizeof dst_filename); + h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename); + h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename); /* Reset file address checking info */ addr_reset(); /* create source file */ - if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, fapl)) < 0) TEST_ERROR + if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR /* Set 1-D dataspace dimensions */ dim1d[0] = DIM_SIZE_1; @@ -2611,10 +2756,10 @@ test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) /* open the source file with read-only */ - if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR + if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, src_fapl)) < 0) TEST_ERROR /* create destination file */ - if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, fapl)) < 0) TEST_ERROR + if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */ if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR @@ -2631,7 +2776,7 @@ test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) if((did2 = H5Dopen2(fid_dst, NAME_DATASET_CHUNKED, H5P_DEFAULT)) < 0) TEST_ERROR /* Check if the array index type is correct */ - if(compare_idx_type(fapl, did2, H5D_CHUNK_IDX_EARRAY, H5D_CHUNK_IDX_BTREE) != TRUE) + if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_EARRAY, H5D_CHUNK_IDX_BTREE) != TRUE) TEST_ERROR /* Check if the datasets are equal */ @@ -2651,7 +2796,7 @@ test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) if((did2 = H5Dopen2(fid_dst, NAME_DATASET_CHUNKED2, H5P_DEFAULT)) < 0) TEST_ERROR /* Check if the array index type is correct */ - if(compare_idx_type(fapl, did2, H5D_CHUNK_IDX_FARRAY, H5D_CHUNK_IDX_BTREE) != TRUE) + if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_FARRAY, H5D_CHUNK_IDX_BTREE) != TRUE) TEST_ERROR /* Check if the datasets are equal */ @@ -2671,7 +2816,7 @@ test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) if((did2 = H5Dopen2(fid_dst, NAME_DATASET_CHUNKED3, H5P_DEFAULT)) < 0) TEST_ERROR /* Check if the array index type is correct */ - if(compare_idx_type(fapl, did2, H5D_CHUNK_IDX_NONE, H5D_CHUNK_IDX_BTREE) != TRUE) + if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_NONE, H5D_CHUNK_IDX_BTREE) != TRUE) TEST_ERROR /* Check if the datasets are equal */ @@ -2721,7 +2866,7 @@ error: *------------------------------------------------------------------------- */ static int -test_copy_dataset_chunked_sparse(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) +test_copy_dataset_chunked_sparse(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) { hid_t fid_src = -1, fid_dst = -1; /* File IDs */ hid_t sid = -1; /* Dataspace ID */ @@ -2751,14 +2896,14 @@ test_copy_dataset_chunked_sparse(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) } /* end for */ /* Initialize the filenames */ - h5_fixname(FILENAME[0], fapl, src_filename, sizeof src_filename); - h5_fixname(FILENAME[1], fapl, dst_filename, sizeof dst_filename); + h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename); + h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename); /* Reset file address checking info */ addr_reset(); /* create source file */ - if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, fapl)) < 0) TEST_ERROR + if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR /* Set 1-D dataspace dimensions */ dim1d[0]=DIM_SIZE_1; @@ -2907,10 +3052,10 @@ test_copy_dataset_chunked_sparse(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) /* open the source file with read-only */ - if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR + if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, src_fapl)) < 0) TEST_ERROR /* create destination file */ - if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, fapl)) < 0) TEST_ERROR + if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */ if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR @@ -2928,7 +3073,7 @@ test_copy_dataset_chunked_sparse(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) if((did2 = H5Dopen2(fid_dst, NAME_DATASET_CHUNKED, H5P_DEFAULT)) < 0) TEST_ERROR /* Check if the array index type is correct */ - if(compare_idx_type(fapl, did2, H5D_CHUNK_IDX_EARRAY, H5D_CHUNK_IDX_BTREE) != TRUE) + if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_EARRAY, H5D_CHUNK_IDX_BTREE) != TRUE) TEST_ERROR /* Check if the datasets are equal */ @@ -2948,7 +3093,7 @@ test_copy_dataset_chunked_sparse(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) if((did2 = H5Dopen2(fid_dst, NAME_DATASET_CHUNKED2, H5P_DEFAULT)) < 0) TEST_ERROR /* Check if the array index type is correct */ - if(compare_idx_type(fapl, did2, H5D_CHUNK_IDX_BT2, H5D_CHUNK_IDX_BTREE) != TRUE) + if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_BT2, H5D_CHUNK_IDX_BTREE) != TRUE) TEST_ERROR /* Check if the datasets are equal */ @@ -2968,7 +3113,7 @@ test_copy_dataset_chunked_sparse(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) if((did2 = H5Dopen2(fid_dst, NAME_DATASET_CHUNKED3, H5P_DEFAULT)) < 0) TEST_ERROR /* Check if the array index type is correct */ - if(compare_idx_type(fapl, did2, H5D_CHUNK_IDX_NONE, H5D_CHUNK_IDX_BTREE) != TRUE) + if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_NONE, H5D_CHUNK_IDX_BTREE) != TRUE) TEST_ERROR /* Check if the datasets are equal */ @@ -2988,7 +3133,7 @@ test_copy_dataset_chunked_sparse(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) if((did2 = H5Dopen2(fid_dst, NAME_DATASET_CHUNKED4, H5P_DEFAULT)) < 0) TEST_ERROR /* Check if the array index type is correct */ - if(compare_idx_type(fapl, did2, H5D_CHUNK_IDX_NONE, H5D_CHUNK_IDX_BTREE) != TRUE) + if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_NONE, H5D_CHUNK_IDX_BTREE) != TRUE) TEST_ERROR /* Check if the datasets are equal */ @@ -3037,7 +3182,7 @@ error: *------------------------------------------------------------------------- */ static int -test_copy_dataset_compressed(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) +test_copy_dataset_compressed(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) { #ifdef H5_HAVE_FILTER_DEFLATE hid_t fid_src = -1, fid_dst = -1; /* File IDs */ @@ -3064,14 +3209,14 @@ test_copy_dataset_compressed(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) buf[i][j] = (float)(100.0); /* Something easy to compress */ /* Initialize the filenames */ - h5_fixname(FILENAME[0], fapl, src_filename, sizeof src_filename); - h5_fixname(FILENAME[1], fapl, dst_filename, sizeof dst_filename); + h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename); + h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename); /* Reset file address checking info */ addr_reset(); /* create source file */ - if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, fapl)) < 0) TEST_ERROR + if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR /* Set dataspace dimensions */ dim2d[0] = DIM_SIZE_1; @@ -3125,10 +3270,10 @@ test_copy_dataset_compressed(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) /* open the source file with read-only */ - if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR + if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, src_fapl)) < 0) TEST_ERROR /* create destination file */ - if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, fapl)) < 0) TEST_ERROR + if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */ if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR @@ -3143,7 +3288,7 @@ test_copy_dataset_compressed(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) /* open the destination dataset */ if((did2 = H5Dopen2(fid_dst, NAME_DATASET_CHUNKED, H5P_DEFAULT)) < 0) TEST_ERROR - if(compare_idx_type(fapl, did2, H5D_CHUNK_IDX_FARRAY, H5D_CHUNK_IDX_BTREE) != TRUE) + if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_FARRAY, H5D_CHUNK_IDX_BTREE) != TRUE) TEST_ERROR /* Check if the datasets are equal */ @@ -3162,7 +3307,7 @@ test_copy_dataset_compressed(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) /* open the destination dataset */ if((did2 = H5Dopen2(fid_dst, NAME_DATASET_CHUNKED2, H5P_DEFAULT)) < 0) TEST_ERROR - if(compare_idx_type(fapl, did2, H5D_CHUNK_IDX_FARRAY, H5D_CHUNK_IDX_BTREE) != TRUE) + if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_FARRAY, H5D_CHUNK_IDX_BTREE) != TRUE) TEST_ERROR /* Check if the datasets are equal */ @@ -3216,7 +3361,8 @@ error: *------------------------------------------------------------------------- */ static int -test_copy_dataset_no_edge_filt(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) +test_copy_dataset_no_edge_filt(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, + hid_t dst_fapl) { #ifdef H5_HAVE_FILTER_DEFLATE hid_t fid_src = -1, fid_dst = -1; /* File IDs */ @@ -3243,14 +3389,14 @@ test_copy_dataset_no_edge_filt(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) buf[i][j] = (float)(100.0); /* Something easy to compress */ /* Initialize the filenames */ - h5_fixname(FILENAME[0], fapl, src_filename, sizeof src_filename); - h5_fixname(FILENAME[1], fapl, dst_filename, sizeof dst_filename); + h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename); + h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename); /* Reset file address checking info */ addr_reset(); /* create source file */ - if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, fapl)) < 0) TEST_ERROR + if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR /* Set dataspace dimensions */ dim2d[0]=DIM_SIZE_1; @@ -3288,10 +3434,10 @@ test_copy_dataset_no_edge_filt(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) /* open the source file with read-only */ - if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR + if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, src_fapl)) < 0) TEST_ERROR /* create destination file */ - if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, fapl)) < 0) TEST_ERROR + if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */ if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR @@ -3306,7 +3452,7 @@ test_copy_dataset_no_edge_filt(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) if((did2 = H5Dopen2(fid_dst, NAME_DATASET_CHUNKED, H5P_DEFAULT)) < 0) TEST_ERROR /* H5Pset_chunk_opts() will set layout version to 4 which will use latest indexing available */ - if(compare_idx_type(fapl, did2, H5D_CHUNK_IDX_FARRAY, H5D_CHUNK_IDX_FARRAY) != TRUE) + if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_FARRAY, H5D_CHUNK_IDX_FARRAY) != TRUE) TEST_ERROR /* Check if the datasets are equal */ @@ -3357,7 +3503,7 @@ error: *------------------------------------------------------------------------- */ static int -test_copy_dataset_compact(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) +test_copy_dataset_compact(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) { hid_t fid_src = -1, fid_dst = -1; /* File IDs */ hid_t sid = -1; /* Dataspace ID */ @@ -3377,14 +3523,14 @@ test_copy_dataset_compact(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) buf[i][j] = (float)(i+j/100.0); /* Initialize the filenames */ - h5_fixname(FILENAME[0], fapl, src_filename, sizeof src_filename); - h5_fixname(FILENAME[1], fapl, dst_filename, sizeof dst_filename); + h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename); + h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename); /* Reset file address checking info */ addr_reset(); /* create source file */ - if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, fapl)) < 0) TEST_ERROR + if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR /* Set dataspace dimensions */ dim2d[0]=DIM_SIZE_1; @@ -3420,10 +3566,10 @@ test_copy_dataset_compact(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) /* open the source file with read-only */ - if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR + if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, src_fapl)) < 0) TEST_ERROR /* create destination file */ - if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, fapl)) < 0) TEST_ERROR + if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */ if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR @@ -3484,7 +3630,7 @@ error: *------------------------------------------------------------------------- */ static int -test_copy_dataset_external(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) +test_copy_dataset_external(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) { hid_t fid_src = -1, fid_dst = -1; /* File IDs */ hid_t sid = -1; /* Dataspace ID */ @@ -3507,14 +3653,14 @@ test_copy_dataset_external(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) HDfclose(HDfopen (FILE_EXT, "w")); /* Initialize the filenames */ - h5_fixname(FILENAME[0], fapl, src_filename, sizeof src_filename); - h5_fixname(FILENAME[1], fapl, dst_filename, sizeof dst_filename); + h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename); + h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename); /* Reset file address checking info */ addr_reset(); /* create source file */ - if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, fapl)) < 0) TEST_ERROR + if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR /* Set dataspace dimensions */ dim1d[0]=DIM_SIZE_1; @@ -3547,10 +3693,10 @@ test_copy_dataset_external(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) /* open the source file with read-only */ - if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR + if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, src_fapl)) < 0) TEST_ERROR /* create destination file */ - if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, fapl)) < 0) TEST_ERROR + if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */ if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR @@ -3610,7 +3756,7 @@ error: *------------------------------------------------------------------------- */ static int -test_copy_dataset_named_dtype(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) +test_copy_dataset_named_dtype(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) { hid_t fid_src = -1, fid_dst = -1; /* File IDs */ hid_t tid = -1; /* Datatype ID */ @@ -3629,14 +3775,14 @@ test_copy_dataset_named_dtype(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) buf[i] = i; /* Initialize the filenames */ - h5_fixname(FILENAME[0], fapl, src_filename, sizeof src_filename); - h5_fixname(FILENAME[1], fapl, dst_filename, sizeof dst_filename); + h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename); + h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename); /* Reset file address checking info */ addr_reset(); /* create source file */ - if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, fapl)) < 0) TEST_ERROR + if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR /* Set dataspace dimensions */ dim1d[0]=DIM_SIZE_1; @@ -3668,10 +3814,10 @@ test_copy_dataset_named_dtype(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) /* open the source file with read-only */ - if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR + if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, src_fapl)) < 0) TEST_ERROR /* create destination file */ - if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, fapl)) < 0) TEST_ERROR + if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */ if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR @@ -3731,7 +3877,7 @@ error: *------------------------------------------------------------------------- */ static int -test_copy_dataset_named_dtype_hier(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) +test_copy_dataset_named_dtype_hier(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) { hid_t fid_src = -1, fid_dst = -1; /* File IDs */ hid_t tid = -1; /* Datatype ID */ @@ -3751,14 +3897,14 @@ test_copy_dataset_named_dtype_hier(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) buf[i] = i; /* Initialize the filenames */ - h5_fixname(FILENAME[0], fapl, src_filename, sizeof src_filename); - h5_fixname(FILENAME[1], fapl, dst_filename, sizeof dst_filename); + h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename); + h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename); /* Reset file address checking info */ addr_reset(); /* create source file */ - if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, fapl)) < 0) TEST_ERROR + if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR /* Create group to place all objects in */ if((gid = H5Gcreate2(fid_src, NAME_GROUP_TOP, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR @@ -3805,10 +3951,10 @@ test_copy_dataset_named_dtype_hier(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) /* open the source file with read-only */ - if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR + if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, src_fapl)) < 0) TEST_ERROR /* create destination file */ - if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, fapl)) < 0) TEST_ERROR + if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */ if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR @@ -3870,7 +4016,7 @@ error: *------------------------------------------------------------------------- */ static int -test_copy_dataset_named_dtype_hier_outside(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) +test_copy_dataset_named_dtype_hier_outside(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) { hid_t fid_src = -1, fid_dst = -1; /* File IDs */ hid_t tid = -1; /* Datatype ID */ @@ -3890,14 +4036,14 @@ test_copy_dataset_named_dtype_hier_outside(hid_t fcpl_src, hid_t fcpl_dst, hid_t buf[i] = i; /* Initialize the filenames */ - h5_fixname(FILENAME[0], fapl, src_filename, sizeof src_filename); - h5_fixname(FILENAME[1], fapl, dst_filename, sizeof dst_filename); + h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename); + h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename); /* Reset file address checking info */ addr_reset(); /* create source file */ - if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, fapl)) < 0) TEST_ERROR + if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR /* Create group to place all objects in */ if((gid = H5Gcreate2(fid_src, NAME_GROUP_TOP, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR @@ -3944,10 +4090,10 @@ test_copy_dataset_named_dtype_hier_outside(hid_t fcpl_src, hid_t fcpl_dst, hid_t /* open the source file with read-only */ - if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR + if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, src_fapl)) < 0) TEST_ERROR /* create destination file */ - if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, fapl)) < 0) TEST_ERROR + if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */ if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR @@ -4009,7 +4155,7 @@ error: *------------------------------------------------------------------------- */ static int -test_copy_dataset_multi_ohdr_chunks(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) +test_copy_dataset_multi_ohdr_chunks(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) { hid_t fid_src = -1, fid_dst = -1; /* File IDs */ hid_t sid = -1; /* Dataspace ID */ @@ -4028,14 +4174,14 @@ test_copy_dataset_multi_ohdr_chunks(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) buf[i] = i; /* Initialize the filenames */ - h5_fixname(FILENAME[0], fapl, src_filename, sizeof src_filename); - h5_fixname(FILENAME[1], fapl, dst_filename, sizeof dst_filename); + h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename); + h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename); /* Reset file address checking info */ addr_reset(); /* create source file */ - if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, fapl)) < 0) TEST_ERROR + if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR /* Create group to place all objects in */ if((gid = H5Gcreate2(fid_src, NAME_GROUP_TOP, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR @@ -4078,10 +4224,10 @@ test_copy_dataset_multi_ohdr_chunks(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) /* open the source file with read-only */ - if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR + if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, src_fapl)) < 0) TEST_ERROR /* create destination file */ - if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, fapl)) < 0) TEST_ERROR + if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */ if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR @@ -4142,7 +4288,7 @@ error: *------------------------------------------------------------------------- */ static int -test_copy_dataset_attr_named_dtype(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) +test_copy_dataset_attr_named_dtype(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) { hid_t fid_src = -1, fid_dst = -1; /* File IDs */ hid_t tid = -1; /* Datatype ID */ @@ -4162,14 +4308,14 @@ test_copy_dataset_attr_named_dtype(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) buf[i] = i; /* Initialize the filenames */ - h5_fixname(FILENAME[0], fapl, src_filename, sizeof src_filename); - h5_fixname(FILENAME[1], fapl, dst_filename, sizeof dst_filename); + h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename); + h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename); /* Reset file address checking info */ addr_reset(); /* create source file */ - if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, fapl)) < 0) TEST_ERROR + if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR /* Create group to place all objects in */ if((gid = H5Gcreate2(fid_src, NAME_GROUP_TOP, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR @@ -4219,10 +4365,10 @@ test_copy_dataset_attr_named_dtype(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) /* open the source file with read-only */ - if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR + if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, src_fapl)) < 0) TEST_ERROR /* create destination file */ - if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, fapl)) < 0) TEST_ERROR + if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */ if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR @@ -4284,7 +4430,7 @@ error: *------------------------------------------------------------------------- */ static int -test_copy_dataset_contig_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) +test_copy_dataset_contig_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) { hid_t fid_src = -1, fid_dst = -1; /* File IDs */ hid_t tid = -1; /* Datatype ID */ @@ -4307,14 +4453,14 @@ test_copy_dataset_contig_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) } /* end for */ /* Initialize the filenames */ - h5_fixname(FILENAME[0], fapl, src_filename, sizeof src_filename); - h5_fixname(FILENAME[1], fapl, dst_filename, sizeof dst_filename); + h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename); + h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename); /* Reset file address checking info */ addr_reset(); /* create source file */ - if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, fapl)) < 0) TEST_ERROR + if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR /* Set dataspace dimensions */ dim1d[0]=DIM_SIZE_1; @@ -4339,10 +4485,10 @@ test_copy_dataset_contig_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) /* open the source file with read-only */ - if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR + if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, src_fapl)) < 0) TEST_ERROR /* create destination file */ - if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, fapl)) < 0) TEST_ERROR + if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */ if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR @@ -4413,7 +4559,7 @@ error: *------------------------------------------------------------------------- */ static int -test_copy_dataset_chunked_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) +test_copy_dataset_chunked_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) { hid_t fid_src = -1, fid_dst = -1; /* File IDs */ hid_t tid = -1; /* Datatype ID */ @@ -4438,14 +4584,14 @@ test_copy_dataset_chunked_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) } /* end for */ /* Initialize the filenames */ - h5_fixname(FILENAME[0], fapl, src_filename, sizeof src_filename); - h5_fixname(FILENAME[1], fapl, dst_filename, sizeof dst_filename); + h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename); + h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename); /* Reset file address checking info */ addr_reset(); /* create source file */ - if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, fapl)) < 0) TEST_ERROR + if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR /* Set dataspace dimensions */ dim1d[0]=DIM_SIZE_1; @@ -4491,10 +4637,10 @@ test_copy_dataset_chunked_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) /* open the source file with read-only */ - if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR + if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, src_fapl)) < 0) TEST_ERROR /* create destination file */ - if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, fapl)) < 0) TEST_ERROR + if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */ if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR @@ -4509,7 +4655,7 @@ test_copy_dataset_chunked_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) /* open the destination dataset */ if((did2 = H5Dopen2(fid_dst, NAME_DATASET_VL, H5P_DEFAULT)) < 0) TEST_ERROR - if(compare_idx_type(fapl, did2, H5D_CHUNK_IDX_FARRAY, H5D_CHUNK_IDX_BTREE) != TRUE) + if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_FARRAY, H5D_CHUNK_IDX_BTREE) != TRUE) TEST_ERROR /* Check if the datasets are equal */ @@ -4528,7 +4674,7 @@ test_copy_dataset_chunked_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) /* open the destination dataset */ if((did2 = H5Dopen2(fid_dst, NAME_DATASET_VL2, H5P_DEFAULT)) < 0) TEST_ERROR - if(compare_idx_type(fapl, did2, H5D_CHUNK_IDX_NONE, H5D_CHUNK_IDX_BTREE) != TRUE) + if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_NONE, H5D_CHUNK_IDX_BTREE) != TRUE) TEST_ERROR /* Check if the datasets are equal */ @@ -4589,7 +4735,7 @@ error: *------------------------------------------------------------------------- */ static int -test_copy_dataset_compact_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) +test_copy_dataset_compact_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) { hid_t fid_src = -1, fid_dst = -1; /* File IDs */ hid_t tid = -1; /* Datatype ID */ @@ -4613,14 +4759,14 @@ test_copy_dataset_compact_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) } /* end for */ /* Initialize the filenames */ - h5_fixname(FILENAME[0], fapl, src_filename, sizeof src_filename); - h5_fixname(FILENAME[1], fapl, dst_filename, sizeof dst_filename); + h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename); + h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename); /* Reset file address checking info */ addr_reset(); /* create source file */ - if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, fapl)) < 0) TEST_ERROR + if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR /* Set dataspace dimensions */ dim1d[0]=DIM_SIZE_1; @@ -4652,10 +4798,10 @@ test_copy_dataset_compact_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) /* open the source file with read-only */ - if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR + if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, src_fapl)) < 0) TEST_ERROR /* create destination file */ - if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, fapl)) < 0) TEST_ERROR + if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */ if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR @@ -4726,7 +4872,7 @@ error: *------------------------------------------------------------------------- */ static int -test_copy_attribute_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) +test_copy_attribute_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) { hid_t fid_src = -1, fid_dst = -1; /* File IDs */ hid_t sid = -1; /* Dataspace ID */ @@ -4739,14 +4885,14 @@ test_copy_attribute_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) TESTING("H5Ocopy(): variable length attribute"); /* Initialize the filenames */ - h5_fixname(FILENAME[0], fapl, src_filename, sizeof src_filename); - h5_fixname(FILENAME[1], fapl, dst_filename, sizeof dst_filename); + h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename); + h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename); /* Reset file address checking info */ addr_reset(); /* create source file */ - if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, fapl)) < 0) TEST_ERROR + if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR /* Set dataspace dimensions */ dim2d[0] = DIM_SIZE_1; @@ -4772,10 +4918,10 @@ test_copy_attribute_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) /* open the source file with read-only */ - if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR + if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, src_fapl)) < 0) TEST_ERROR /* create destination file */ - if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, fapl)) < 0) TEST_ERROR + if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */ if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR @@ -4841,7 +4987,7 @@ error: *------------------------------------------------------------------------- */ static int -test_copy_dataset_compressed_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) +test_copy_dataset_compressed_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) { #ifdef H5_HAVE_FILTER_DEFLATE hid_t fid_src = -1, fid_dst = -1; /* File IDs */ @@ -4874,14 +5020,14 @@ test_copy_dataset_compressed_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) } /* Initialize the filenames */ - h5_fixname(FILENAME[0], fapl, src_filename, sizeof src_filename); - h5_fixname(FILENAME[1], fapl, dst_filename, sizeof dst_filename); + h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename); + h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename); /* Reset file address checking info */ addr_reset(); /* create source file */ - if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, fapl)) < 0) TEST_ERROR + if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR /* Set dataspace dimensions */ dim2d[0]=DIM_SIZE_1; @@ -4915,10 +5061,10 @@ test_copy_dataset_compressed_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) /* open the source file with read-only */ - if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR + if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, src_fapl)) < 0) TEST_ERROR /* create destination file */ - if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, fapl)) < 0) TEST_ERROR + if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */ if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR @@ -4993,7 +5139,7 @@ error: *------------------------------------------------------------------------- */ static int -test_copy_group_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) +test_copy_group_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) { hid_t fid_src = -1, fid_dst = -1; /* File IDs */ hid_t gid = -1, gid2 = -1; /* Group IDs */ @@ -5003,14 +5149,14 @@ test_copy_group_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) TESTING("H5Ocopy(): empty group"); /* Initialize the filenames */ - h5_fixname(FILENAME[0], fapl, src_filename, sizeof src_filename); - h5_fixname(FILENAME[1], fapl, dst_filename, sizeof dst_filename); + h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename); + h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename); /* Reset file address checking info */ addr_reset(); /* create source file */ - if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, fapl)) < 0) TEST_ERROR + if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR /* create group at the SRC file */ if((gid = H5Gcreate2(fid_src, NAME_GROUP_EMPTY, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR @@ -5026,10 +5172,10 @@ test_copy_group_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) /* open the source file with read-only */ - if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR + if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, src_fapl)) < 0) TEST_ERROR /* create destination file */ - if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, fapl)) < 0) TEST_ERROR + if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */ if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR @@ -5073,22 +5219,22 @@ error: /*------------------------------------------------------------------------- - * Function: test_copy_group + * Function: test_copy_root_group * - * Purpose: Create a group in SRC file and copy it to DST file + * Purpose: Create a root group in SRC file and copy it to DST file * * Return: Success: 0 * Failure: number of errors * * Programmer: Peter Cao - * Friday, September 30, 2005 + * August 8, 2006 * * Modifications: * *------------------------------------------------------------------------- */ static int -test_copy_group(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) +test_copy_root_group(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) { hid_t fid_src = -1, fid_dst = -1; /* File IDs */ hid_t sid = -1; /* Dataspace ID */ @@ -5101,7 +5247,7 @@ test_copy_group(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) char src_filename[NAME_BUF_SIZE]; char dst_filename[NAME_BUF_SIZE]; - TESTING("H5Ocopy(): simple nested groups"); + TESTING("H5Ocopy(): root group"); /* set initial data values */ for (i=0; i 0) { char ext_filename[NAME_BUF_SIZE]; - h5_fixname(FILENAME[2], fapl, ext_filename, sizeof ext_filename); + h5_fixname(FILENAME[2], src_fapl, ext_filename, sizeof ext_filename); /* Create the external file and dataset */ - if((fid_ext = H5Fcreate(ext_filename, H5F_ACC_TRUNC, fcpl_src, fapl)) < 0) TEST_ERROR + if((fid_ext = H5Fcreate(ext_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR if((sid = H5Screate_simple(2, dim2d, NULL)) < 0) TEST_ERROR if((did = H5Dcreate2(fid_ext, NAME_DATASET_SIMPLE, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR @@ -8651,13 +8798,13 @@ test_copy_option(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl, unsigned flag, hboo /* open the source file with read-only */ /* (except when expanding soft links */ if((flag & H5O_COPY_EXPAND_SOFT_LINK_FLAG) > 0) { - if((fid_src = H5Fopen(src_filename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR + if((fid_src = H5Fopen(src_filename, H5F_ACC_RDWR, src_fapl)) < 0) TEST_ERROR } /* end if */ else - if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR + if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, src_fapl)) < 0) TEST_ERROR /* create destination file */ - if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, fapl)) < 0) TEST_ERROR + if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */ @@ -8825,12 +8972,13 @@ main(void) /* Test in all configurations */ for(configuration = 0; configuration <= MAX_CONFIGURATION; configuration++) { - hid_t my_fapl; + hid_t src_fapl; + hid_t dst_fapl; 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)) + if(!(configuration & CONFIG_SRC_NEW_FORMAT) && (configuration & CONFIG_DENSE)) continue; /* Test with and without shared messages */ @@ -8851,111 +8999,131 @@ main(void) fcpl_dst = H5P_DEFAULT; } - /* Set the FAPL for the type of format */ - if(configuration & CONFIG_NEW_FORMAT) { - puts("Testing with new group format:"); - my_fapl = fapl2; + /* Set the FAPL for the source file's type of format */ + if(configuration & CONFIG_SRC_NEW_FORMAT) { + puts("Testing with latest format for source file:"); + src_fapl = fapl2; - /* Test with and without dense attributes */ + /* 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; + num_attributes_g = MAX(min_dense, 2) - 2; } } /* end if */ else { - puts("Testing with old group format:"); - my_fapl = fapl; + puts("Testing with oldest file format for source file:"); + src_fapl = fapl; num_attributes_g = 4; } /* end else */ + /* Set the FAPL for the destination file's type of format */ + if(configuration & CONFIG_DST_NEW_FORMAT) { + puts("Testing with latest format for destination file:"); + dst_fapl = fapl2; + } /* end if */ + else { + puts("Testing with oldest file format for destination file:"); + dst_fapl = fapl; + } /* end else */ + /* The tests... */ - nerrors += test_copy_dataset_simple(fcpl_src, fcpl_dst, my_fapl); - nerrors += test_copy_dataset_simple_samefile(fcpl_src, my_fapl); - nerrors += test_copy_dataset_simple_empty(fcpl_src, fcpl_dst, my_fapl); - nerrors += test_copy_dataset_compound(fcpl_src, fcpl_dst, my_fapl); - nerrors += test_copy_dataset_chunked(fcpl_src, fcpl_dst, my_fapl); - nerrors += test_copy_dataset_chunked_empty(fcpl_src, fcpl_dst, my_fapl); - nerrors += test_copy_dataset_chunked_sparse(fcpl_src, fcpl_dst, my_fapl); - nerrors += test_copy_dataset_compressed(fcpl_src, fcpl_dst, my_fapl); - nerrors += test_copy_dataset_no_edge_filt(fcpl_src, fcpl_dst, my_fapl); - nerrors += test_copy_dataset_compact(fcpl_src, fcpl_dst, my_fapl); - nerrors += test_copy_dataset_multi_ohdr_chunks(fcpl_src, fcpl_dst, my_fapl); - nerrors += test_copy_dataset_attr_named_dtype(fcpl_src, fcpl_dst, my_fapl); - - nerrors += test_copy_group_empty(fcpl_src, fcpl_dst, my_fapl); - nerrors += test_copy_root_group(fcpl_src, fcpl_dst, my_fapl); - nerrors += test_copy_group(fcpl_src, fcpl_dst, my_fapl); - nerrors += test_copy_group_deep(fcpl_src, fcpl_dst, my_fapl); - nerrors += test_copy_group_loop(fcpl_src, fcpl_dst, my_fapl); - nerrors += test_copy_group_wide_loop(fcpl_src, fcpl_dst, my_fapl); - nerrors += test_copy_group_links(fcpl_src, fcpl_dst, my_fapl); - nerrors += test_copy_soft_link(fcpl_src, fcpl_dst, my_fapl); + nerrors += test_copy_dataset_simple(fcpl_src, fcpl_dst, src_fapl, dst_fapl); + nerrors += test_copy_dataset_simple_samefile(fcpl_src, src_fapl); + nerrors += test_copy_dataset_simple_empty(fcpl_src, fcpl_dst, src_fapl, dst_fapl); + nerrors += test_copy_dataset_compound(fcpl_src, fcpl_dst, src_fapl, dst_fapl); + nerrors += test_copy_dataset_chunked(fcpl_src, fcpl_dst, src_fapl, dst_fapl); + nerrors += test_copy_dataset_chunked_empty(fcpl_src, fcpl_dst, src_fapl, dst_fapl); + nerrors += test_copy_dataset_chunked_sparse(fcpl_src, fcpl_dst, src_fapl, dst_fapl); + nerrors += test_copy_dataset_compressed(fcpl_src, fcpl_dst, src_fapl, dst_fapl); + nerrors += test_copy_dataset_no_edge_filt(fcpl_src, fcpl_dst, src_fapl, dst_fapl); + nerrors += test_copy_dataset_compact(fcpl_src, fcpl_dst, src_fapl, dst_fapl); + nerrors += test_copy_dataset_multi_ohdr_chunks(fcpl_src, fcpl_dst, src_fapl, dst_fapl); + nerrors += test_copy_dataset_attr_named_dtype(fcpl_src, fcpl_dst, src_fapl, dst_fapl); + + nerrors += test_copy_group_empty(fcpl_src, fcpl_dst, src_fapl, dst_fapl); + nerrors += test_copy_root_group(fcpl_src, fcpl_dst, src_fapl, dst_fapl); + nerrors += test_copy_group(fcpl_src, fcpl_dst, src_fapl, dst_fapl); + nerrors += test_copy_group_deep(fcpl_src, fcpl_dst, src_fapl, dst_fapl); + nerrors += test_copy_group_loop(fcpl_src, fcpl_dst, src_fapl, dst_fapl); + nerrors += test_copy_group_wide_loop(fcpl_src, fcpl_dst, src_fapl, dst_fapl); + nerrors += test_copy_group_links(fcpl_src, fcpl_dst, src_fapl, dst_fapl); + nerrors += test_copy_soft_link(fcpl_src, fcpl_dst, src_fapl, dst_fapl); #ifndef H5_CANNOT_OPEN_TWICE - nerrors += test_copy_ext_link(fcpl_src, fcpl_dst, my_fapl); + nerrors += test_copy_ext_link(fcpl_src, fcpl_dst, src_fapl, dst_fapl); #endif /* H5_CANNOT_OPEN_TWICE */ - nerrors += test_copy_exist(fcpl_src, fcpl_dst, my_fapl); - nerrors += test_copy_path(fcpl_src, fcpl_dst, my_fapl); - - nerrors += test_copy_option(fcpl_src, fcpl_dst, my_fapl, H5O_COPY_WITHOUT_ATTR_FLAG, - FALSE, "H5Ocopy(): without attributes"); - nerrors += test_copy_option(fcpl_src, fcpl_dst, my_fapl, 0, TRUE, - "H5Ocopy(): with missing groups"); - nerrors += test_copy_option(fcpl_src, fcpl_dst, my_fapl, H5O_COPY_EXPAND_SOFT_LINK_FLAG, - FALSE, "H5Ocopy(): expand soft link"); - nerrors += test_copy_option(fcpl_src, fcpl_dst, my_fapl, H5O_COPY_EXPAND_EXT_LINK_FLAG, + nerrors += test_copy_exist(fcpl_src, fcpl_dst, src_fapl, dst_fapl); + nerrors += test_copy_path(fcpl_src, fcpl_dst, src_fapl, dst_fapl); + + nerrors += test_copy_named_datatype_attr_self(fcpl_src, fcpl_dst, src_fapl, dst_fapl); + + nerrors += test_copy_option(fcpl_src, fcpl_dst, src_fapl, dst_fapl, + H5O_COPY_WITHOUT_ATTR_FLAG, + FALSE, "H5Ocopy(): without attributes"); + nerrors += test_copy_option(fcpl_src, fcpl_dst, src_fapl, dst_fapl, + 0, + TRUE, "H5Ocopy(): with missing groups"); + nerrors += test_copy_option(fcpl_src, fcpl_dst, src_fapl, dst_fapl, + H5O_COPY_EXPAND_SOFT_LINK_FLAG, + FALSE, "H5Ocopy(): expand soft link"); + nerrors += test_copy_option(fcpl_src, fcpl_dst, src_fapl, dst_fapl, + H5O_COPY_EXPAND_EXT_LINK_FLAG, FALSE, "H5Ocopy: expand external link"); - nerrors += test_copy_option(fcpl_src, fcpl_dst, my_fapl, + nerrors += test_copy_option(fcpl_src, fcpl_dst, src_fapl, dst_fapl, H5O_COPY_EXPAND_SOFT_LINK_FLAG | H5O_COPY_EXPAND_EXT_LINK_FLAG, FALSE, "H5Ocopy: expand soft and external links"); - nerrors += test_copy_option(fcpl_src, fcpl_dst, my_fapl, H5O_COPY_SHALLOW_HIERARCHY_FLAG, - FALSE, "H5Ocopy(): shallow group copy"); - nerrors += test_copy_option(fcpl_src, fcpl_dst, my_fapl, H5O_COPY_EXPAND_REFERENCE_FLAG, - FALSE, "H5Ocopy(): expand object reference"); - nerrors += test_copy_option(fcpl_src, fcpl_dst, my_fapl, H5O_COPY_PRESERVE_NULL_FLAG, - FALSE, "H5Ocopy(): preserve NULL messages"); - nerrors += test_copy_option(fcpl_src, fcpl_dst, my_fapl, H5O_COPY_WITHOUT_ATTR_FLAG | - H5O_COPY_PRESERVE_NULL_FLAG, TRUE, "H5Ocopy(): preserve NULL messages"); + nerrors += test_copy_option(fcpl_src, fcpl_dst, src_fapl, dst_fapl, + H5O_COPY_SHALLOW_HIERARCHY_FLAG, + FALSE, "H5Ocopy(): shallow group copy"); + nerrors += test_copy_option(fcpl_src, fcpl_dst, src_fapl, dst_fapl, + H5O_COPY_EXPAND_REFERENCE_FLAG, + FALSE, "H5Ocopy(): expand object reference"); + nerrors += test_copy_option(fcpl_src, fcpl_dst, src_fapl, dst_fapl, + H5O_COPY_PRESERVE_NULL_FLAG, + FALSE, "H5Ocopy(): preserve NULL messages"); + nerrors += test_copy_option(fcpl_src, fcpl_dst, src_fapl, dst_fapl, + H5O_COPY_WITHOUT_ATTR_FLAG | H5O_COPY_PRESERVE_NULL_FLAG, + TRUE, "H5Ocopy(): preserve NULL messages"); /* Tests that do not use attributes and do not need to be tested * multiple times for different attribute configurations */ if(configuration < CONFIG_DENSE) { - nerrors += test_copy_named_datatype(fcpl_src, fcpl_dst, my_fapl); - nerrors += test_copy_named_datatype_vl(fcpl_src, fcpl_dst, my_fapl); - nerrors += test_copy_named_datatype_vl_vl(fcpl_src, fcpl_dst, my_fapl); - - nerrors += test_copy_dataset_external(fcpl_src, fcpl_dst, my_fapl); - nerrors += test_copy_dataset_named_dtype(fcpl_src, fcpl_dst, my_fapl); - nerrors += test_copy_dataset_named_dtype_hier(fcpl_src, fcpl_dst, my_fapl); - nerrors += test_copy_dataset_named_dtype_hier_outside(fcpl_src, fcpl_dst, my_fapl); - - nerrors += test_copy_dataset_contig_vl(fcpl_src, fcpl_dst, my_fapl); - nerrors += test_copy_dataset_chunked_vl(fcpl_src, fcpl_dst, my_fapl); - nerrors += test_copy_dataset_compact_vl(fcpl_src, fcpl_dst, my_fapl); - nerrors += test_copy_dataset_compressed_vl(fcpl_src, fcpl_dst, my_fapl); - nerrors += test_copy_attribute_vl(fcpl_src, fcpl_dst, my_fapl); - nerrors += test_copy_dataset_compact_named_vl(fcpl_src, fcpl_dst, my_fapl); - nerrors += test_copy_dataset_contig_named_vl(fcpl_src, fcpl_dst, my_fapl); - nerrors += test_copy_dataset_chunked_named_vl(fcpl_src, fcpl_dst, my_fapl); - nerrors += test_copy_dataset_compressed_named_vl(fcpl_src, fcpl_dst, my_fapl); - nerrors += test_copy_dataset_compact_vl_vl(fcpl_src, fcpl_dst, my_fapl); - nerrors += test_copy_dataset_contig_vl_vl(fcpl_src, fcpl_dst, my_fapl); - nerrors += test_copy_dataset_chunked_vl_vl(fcpl_src, fcpl_dst, my_fapl); - nerrors += test_copy_dataset_compressed_vl_vl(fcpl_src, fcpl_dst, my_fapl); - nerrors += test_copy_dataset_contig_cmpd_vl(fcpl_src, fcpl_dst, my_fapl); - nerrors += test_copy_dataset_chunked_cmpd_vl(fcpl_src, fcpl_dst, my_fapl); - nerrors += test_copy_dataset_compact_cmpd_vl(fcpl_src, fcpl_dst, my_fapl); - - nerrors += test_copy_same_file_named_datatype(fcpl_src, my_fapl); - nerrors += test_copy_old_layout(fcpl_dst, my_fapl); - nerrors += test_copy_null_ref(fcpl_src, fcpl_dst, my_fapl); + nerrors += test_copy_named_datatype(fcpl_src, fcpl_dst, src_fapl, dst_fapl); + nerrors += test_copy_named_datatype_vl(fcpl_src, fcpl_dst, src_fapl, dst_fapl); + nerrors += test_copy_named_datatype_vl_vl(fcpl_src, fcpl_dst, src_fapl, dst_fapl); + + nerrors += test_copy_dataset_external(fcpl_src, fcpl_dst, src_fapl, dst_fapl); + nerrors += test_copy_dataset_named_dtype(fcpl_src, fcpl_dst, src_fapl, dst_fapl); + nerrors += test_copy_dataset_named_dtype_hier(fcpl_src, fcpl_dst, src_fapl, dst_fapl); + nerrors += test_copy_dataset_named_dtype_hier_outside(fcpl_src, fcpl_dst, src_fapl, dst_fapl); + + nerrors += test_copy_dataset_contig_vl(fcpl_src, fcpl_dst, src_fapl, dst_fapl); + nerrors += test_copy_dataset_chunked_vl(fcpl_src, fcpl_dst, src_fapl, dst_fapl); + nerrors += test_copy_dataset_compact_vl(fcpl_src, fcpl_dst, src_fapl, dst_fapl); + nerrors += test_copy_dataset_compressed_vl(fcpl_src, fcpl_dst, src_fapl, dst_fapl); + nerrors += test_copy_attribute_vl(fcpl_src, fcpl_dst, src_fapl, dst_fapl); + nerrors += test_copy_dataset_compact_named_vl(fcpl_src, fcpl_dst, src_fapl, dst_fapl); + nerrors += test_copy_dataset_contig_named_vl(fcpl_src, fcpl_dst, src_fapl, dst_fapl); + nerrors += test_copy_dataset_chunked_named_vl(fcpl_src, fcpl_dst, src_fapl, dst_fapl); + nerrors += test_copy_dataset_compressed_named_vl(fcpl_src, fcpl_dst, src_fapl, dst_fapl); + nerrors += test_copy_dataset_compact_vl_vl(fcpl_src, fcpl_dst, src_fapl, dst_fapl); + nerrors += test_copy_dataset_contig_vl_vl(fcpl_src, fcpl_dst, src_fapl, dst_fapl); + nerrors += test_copy_dataset_chunked_vl_vl(fcpl_src, fcpl_dst, src_fapl, dst_fapl); + nerrors += test_copy_dataset_compressed_vl_vl(fcpl_src, fcpl_dst, src_fapl, dst_fapl); + nerrors += test_copy_dataset_contig_cmpd_vl(fcpl_src, fcpl_dst, src_fapl, dst_fapl); + nerrors += test_copy_dataset_chunked_cmpd_vl(fcpl_src, fcpl_dst, src_fapl, dst_fapl); + nerrors += test_copy_dataset_compact_cmpd_vl(fcpl_src, fcpl_dst, src_fapl, dst_fapl); + + nerrors += test_copy_same_file_named_datatype(fcpl_src, src_fapl); + nerrors += test_copy_old_layout(fcpl_dst, dst_fapl); + nerrors += test_copy_null_ref(fcpl_src, fcpl_dst, src_fapl, dst_fapl); } /* TODO: not implemented - nerrors += test_copy_mount(my_fapl); + nerrors += test_copy_mount(src_fapl); */ } /* end for */ diff --git a/test/stab.c b/test/stab.c index b460d90..a42ee5e 100644 --- a/test/stab.c +++ b/test/stab.c @@ -277,14 +277,14 @@ test_large(hid_t fapl, hbool_t new_format) */ if((cwg = H5Gcreate2(fid, "/big", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR if(new_format) - if(H5G_has_stab_test(cwg) != FALSE) TEST_ERROR + if(H5G__has_stab_test(cwg) != FALSE) TEST_ERROR for(i = 0; i < LARGE_NOBJS; i++) { sprintf(name, "%05d%05d", (HDrandom() % 100000), i); if((dir = H5Gcreate2(cwg, name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR if(H5Gclose(dir) < 0) TEST_ERROR } if(new_format) - if(H5G_is_new_dense_test(cwg) != TRUE) TEST_ERROR + if(H5G__is_new_dense_test(cwg) != TRUE) TEST_ERROR if(H5Gclose(cwg) < 0) TEST_ERROR /* Close file */ @@ -386,21 +386,21 @@ lifecycle(hid_t fapl2) if(est_name_len != LIFECYCLE_EST_NAME_LEN) TEST_ERROR /* Use internal testing routine to check that the group has no links or symbol table */ - if(H5G_is_empty_test(gid) != TRUE) TEST_ERROR + if(H5G__is_empty_test(gid) != TRUE) TEST_ERROR /* Create first "bottom" group */ sprintf(objname, LIFECYCLE_BOTTOM_GROUP, (unsigned)0); if((gid2 = H5Gcreate2(gid, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* Check on bottom group's status */ - if(H5G_is_empty_test(gid2) != TRUE) TEST_ERROR + if(H5G__is_empty_test(gid2) != TRUE) TEST_ERROR /* Close bottom group */ if(H5Gclose(gid2) < 0) TEST_ERROR /* Check on top group's status */ - if(H5G_is_empty_test(gid) == TRUE) TEST_ERROR - if(H5G_has_links_test(gid, &nmsgs) != TRUE) TEST_ERROR + if(H5G__is_empty_test(gid) == TRUE) TEST_ERROR + if(H5G__has_links_test(gid, &nmsgs) != TRUE) TEST_ERROR if(nmsgs != 1) TEST_ERROR /* Create several more bottom groups, to push the top group almost to a symbol table */ @@ -410,17 +410,17 @@ lifecycle(hid_t fapl2) if((gid2 = H5Gcreate2(gid, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* Check on bottom group's status */ - if(H5G_is_empty_test(gid2) != TRUE) TEST_ERROR + if(H5G__is_empty_test(gid2) != TRUE) TEST_ERROR /* Close bottom group */ if(H5Gclose(gid2) < 0) TEST_ERROR } /* end for */ /* Check on top group's status */ - if(H5G_is_empty_test(gid) == TRUE) TEST_ERROR - if(H5G_has_links_test(gid, &nmsgs) != TRUE) TEST_ERROR + if(H5G__is_empty_test(gid) == TRUE) TEST_ERROR + if(H5G__has_links_test(gid, &nmsgs) != TRUE) TEST_ERROR if(nmsgs != LIFECYCLE_MAX_COMPACT) TEST_ERROR - if(H5G_is_new_dense_test(gid) != FALSE) TEST_ERROR + if(H5G__is_new_dense_test(gid) != FALSE) TEST_ERROR /* Check that the object header is only one chunk and the space has been allocated correctly */ if(H5Oget_info(gid, &oinfo) < 0) TEST_ERROR @@ -434,15 +434,15 @@ lifecycle(hid_t fapl2) if((gid2 = H5Gcreate2(gid, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* Check on bottom group's status */ - if(H5G_is_empty_test(gid2) != TRUE) TEST_ERROR + if(H5G__is_empty_test(gid2) != TRUE) TEST_ERROR /* Close bottom group */ if(H5Gclose(gid2) < 0) TEST_ERROR /* Check on top group's status */ - if(H5G_is_empty_test(gid) == TRUE) TEST_ERROR - if(H5G_has_links_test(gid, NULL) == TRUE) TEST_ERROR - if(H5G_is_new_dense_test(gid) != TRUE) TEST_ERROR + if(H5G__is_empty_test(gid) == TRUE) TEST_ERROR + if(H5G__has_links_test(gid, NULL) == TRUE) TEST_ERROR + if(H5G__is_new_dense_test(gid) != TRUE) TEST_ERROR /* Check that the object header is still one chunk and the space has been allocated correctly */ if(H5Oget_info(gid, &oinfo) < 0) TEST_ERROR @@ -461,9 +461,9 @@ lifecycle(hid_t fapl2) } /* end while */ /* Check on top group's status */ - if(H5G_is_empty_test(gid) == TRUE) TEST_ERROR - if(H5G_has_links_test(gid, NULL) == TRUE) TEST_ERROR - if(H5G_is_new_dense_test(gid) != TRUE) TEST_ERROR + if(H5G__is_empty_test(gid) == TRUE) TEST_ERROR + if(H5G__has_links_test(gid, NULL) == TRUE) TEST_ERROR + if(H5G__is_new_dense_test(gid) != TRUE) TEST_ERROR /* Unlink one more object from the group, which should transform back to using links */ sprintf(objname, LIFECYCLE_BOTTOM_GROUP, u); @@ -471,8 +471,8 @@ lifecycle(hid_t fapl2) u--; /* Check on top group's status */ - if(H5G_is_empty_test(gid) == TRUE) TEST_ERROR - if(H5G_has_links_test(gid, &nmsgs) != TRUE) TEST_ERROR + if(H5G__is_empty_test(gid) == TRUE) TEST_ERROR + if(H5G__has_links_test(gid, &nmsgs) != TRUE) TEST_ERROR if(nmsgs != (LIFECYCLE_MIN_DENSE - 1)) TEST_ERROR /* Unlink last two objects from top group */ @@ -483,7 +483,7 @@ lifecycle(hid_t fapl2) if(H5Ldelete(gid, objname, H5P_DEFAULT) < 0) FAIL_STACK_ERROR /* Check on top group's status */ - if(H5G_is_empty_test(gid) != TRUE) TEST_ERROR + if(H5G__is_empty_test(gid) != TRUE) TEST_ERROR /* Close top group */ if(H5Gclose(gid) < 0) TEST_ERROR @@ -568,47 +568,47 @@ long_compact(hid_t fapl2) if((gid = H5Gcreate2(fid, "top", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* Use internal testing routine to check that the group has no links or dense storage */ - if(H5G_is_empty_test(gid) != TRUE) TEST_ERROR + if(H5G__is_empty_test(gid) != TRUE) TEST_ERROR /* Create first group with "long" name */ if((gid2 = H5Gcreate2(gid, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* Check on bottom group's status */ - if(H5G_is_empty_test(gid2) != TRUE) TEST_ERROR + if(H5G__is_empty_test(gid2) != TRUE) TEST_ERROR /* Close bottom group */ if(H5Gclose(gid2) < 0) TEST_ERROR /* Check on top group's status */ /* (Should have dense storage to hold links, since name is too long for object header message) */ - if(H5G_is_empty_test(gid) == TRUE) TEST_ERROR - if(H5G_has_links_test(gid, NULL) == TRUE) TEST_ERROR - if(H5G_is_new_dense_test(gid) != TRUE) TEST_ERROR + if(H5G__is_empty_test(gid) == TRUE) TEST_ERROR + if(H5G__has_links_test(gid, NULL) == TRUE) TEST_ERROR + if(H5G__is_new_dense_test(gid) != TRUE) TEST_ERROR /* Create second group with "long" name */ objname[0] = 'b'; if((gid2 = H5Gcreate2(gid, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* Check on bottom group's status */ - if(H5G_is_empty_test(gid2) != TRUE) TEST_ERROR + if(H5G__is_empty_test(gid2) != TRUE) TEST_ERROR /* Close bottom group */ if(H5Gclose(gid2) < 0) TEST_ERROR /* Check on top group's status */ /* (Should have dense storage to hold links, since name is too long for object header message) */ - if(H5G_is_empty_test(gid) == TRUE) TEST_ERROR - if(H5G_has_links_test(gid, NULL) == TRUE) TEST_ERROR - if(H5G_is_new_dense_test(gid) != TRUE) TEST_ERROR + if(H5G__is_empty_test(gid) == TRUE) TEST_ERROR + if(H5G__has_links_test(gid, NULL) == TRUE) TEST_ERROR + if(H5G__is_new_dense_test(gid) != TRUE) TEST_ERROR /* Unlink second object from top group */ if(H5Ldelete(gid, objname, H5P_DEFAULT) < 0) FAIL_STACK_ERROR /* Check on top group's status */ /* (Should still be dense storage to hold links, since name is too long for object header message) */ - if(H5G_is_empty_test(gid) == TRUE) TEST_ERROR - if(H5G_has_links_test(gid, NULL) == TRUE) TEST_ERROR - if(H5G_is_new_dense_test(gid) != TRUE) TEST_ERROR + if(H5G__is_empty_test(gid) == TRUE) TEST_ERROR + if(H5G__has_links_test(gid, NULL) == TRUE) TEST_ERROR + if(H5G__is_new_dense_test(gid) != TRUE) TEST_ERROR /* Unlink first object from top group */ objname[0] = 'a'; @@ -616,7 +616,7 @@ long_compact(hid_t fapl2) /* Check on top group's status */ /* (Should have deleted the dense storage now) */ - if(H5G_is_empty_test(gid) != TRUE) TEST_ERROR + if(H5G__is_empty_test(gid) != TRUE) TEST_ERROR /* Free object name */ HDfree(objname); @@ -684,9 +684,9 @@ read_old(void) if((gid = H5Gopen2(fid, "old", H5P_DEFAULT)) < 0) TEST_ERROR /* Check on old group's status */ - if(H5G_is_empty_test(gid) == FALSE) TEST_ERROR - if(H5G_has_links_test(gid, NULL) == TRUE) TEST_ERROR - if(H5G_has_stab_test(gid) != TRUE) TEST_ERROR + if(H5G__is_empty_test(gid) == FALSE) TEST_ERROR + if(H5G__has_links_test(gid, NULL) == TRUE) TEST_ERROR + if(H5G__has_stab_test(gid) != TRUE) TEST_ERROR /* Create a bunch of objects in the group */ for(u = 0; u < READ_OLD_NGROUPS; u++) { @@ -694,7 +694,7 @@ read_old(void) if((gid2 = H5Gcreate2(gid, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* Check on bottom group's status */ - if(H5G_is_empty_test(gid2) != TRUE) TEST_ERROR + if(H5G__is_empty_test(gid2) != TRUE) TEST_ERROR /* Close bottom group */ if(H5Gclose(gid2) < 0) TEST_ERROR @@ -702,9 +702,9 @@ read_old(void) /* Check on old group's status */ /* (Should stay in old "symbol table" form) */ - if(H5G_is_empty_test(gid) == TRUE) TEST_ERROR - if(H5G_has_links_test(gid, NULL) == TRUE) TEST_ERROR - if(H5G_has_stab_test(gid) != TRUE) TEST_ERROR + if(H5G__is_empty_test(gid) == TRUE) TEST_ERROR + if(H5G__has_links_test(gid, NULL) == TRUE) TEST_ERROR + if(H5G__has_stab_test(gid) != TRUE) TEST_ERROR /* Delete new objects from old group */ for(u = 0; u < READ_OLD_NGROUPS; u++) { @@ -714,9 +714,9 @@ read_old(void) /* Check on old group's status */ /* (Should stay in old "symbol table" form, but have no links) */ - if(H5G_is_empty_test(gid) == FALSE) TEST_ERROR - if(H5G_has_links_test(gid, NULL) == TRUE) TEST_ERROR - if(H5G_has_stab_test(gid) != TRUE) TEST_ERROR + if(H5G__is_empty_test(gid) == FALSE) TEST_ERROR + if(H5G__has_links_test(gid, NULL) == TRUE) TEST_ERROR + if(H5G__has_stab_test(gid) != TRUE) TEST_ERROR /* Close old group */ if(H5Gclose(gid) < 0) TEST_ERROR @@ -798,29 +798,29 @@ no_compact(hid_t fapl2) if(H5Pclose(gcpl) < 0) TEST_ERROR /* Use internal testing routine to check that the group has no links or dense storage */ - if(H5G_is_empty_test(gid) != TRUE) TEST_ERROR + if(H5G__is_empty_test(gid) != TRUE) TEST_ERROR /* Create first "bottom" group */ sprintf(objname, NO_COMPACT_BOTTOM_GROUP, (unsigned)0); if((gid2 = H5Gcreate2(gid, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* Check on bottom group's status */ - if(H5G_is_empty_test(gid2) != TRUE) TEST_ERROR + if(H5G__is_empty_test(gid2) != TRUE) TEST_ERROR /* Close bottom group */ if(H5Gclose(gid2) < 0) TEST_ERROR /* Check on top group's status */ - if(H5G_is_empty_test(gid) == TRUE) TEST_ERROR - if(H5G_has_links_test(gid, NULL) == TRUE) TEST_ERROR - if(H5G_is_new_dense_test(gid) != TRUE) TEST_ERROR + if(H5G__is_empty_test(gid) == TRUE) TEST_ERROR + if(H5G__has_links_test(gid, NULL) == TRUE) TEST_ERROR + if(H5G__is_new_dense_test(gid) != TRUE) TEST_ERROR /* Unlink object from top group */ sprintf(objname, NO_COMPACT_BOTTOM_GROUP, (unsigned)0); if(H5Ldelete(gid, objname, H5P_DEFAULT) < 0) FAIL_STACK_ERROR /* Check on top group's status */ - if(H5G_is_empty_test(gid) != TRUE) TEST_ERROR + if(H5G__is_empty_test(gid) != TRUE) TEST_ERROR /* Close top group */ if(H5Gclose(gid) < 0) TEST_ERROR diff --git a/test/tattr.c b/test/tattr.c index 60d4ddb..1285f0e 100644 --- a/test/tattr.c +++ b/test/tattr.c @@ -128,6 +128,8 @@ float attr_data5=(float)-5.123; /* Test data for 5th attribute */ #define ATTR7_NAME "attr 1 - 000000" #define ATTR8_NAME "attr 2" +#define LINK1_NAME "Link1" + #define NATTR_MANY_OLD 350 #define NATTR_MANY_NEW 35000 @@ -10216,7 +10218,339 @@ test_attr_bug6(hid_t fcpl, hid_t fapl) ret = H5Sclose(sid); CHECK(ret, FAIL, "H5Sclose"); -} +} /* test_attr_bug6() */ + +/**************************************************************** +** +** test_attr_bug7(): Test basic H5A (attribute) code. +** (Really tests object header allocation code). +** Tests creating and deleting attributes in such a way as +** to change the size of the "chunk #0 size" field. +** Includes testing "skipping" a possible size of the +** field, i.e. going from 1 to 4 bytes or 4 to 1 byte. +** +****************************************************************/ +static void +test_attr_bug7(hid_t fcpl, hid_t fapl) +{ + hid_t fid; /* File ID */ + hid_t aid; /* Attribute ID */ + hid_t sid; /* Dataspace ID */ + hid_t tid; /* Datatype ID */ + hsize_t dims_s = 140; /* Small attribute dimensions */ + hsize_t dims_l = 65480; /* Large attribute dimensions */ + H5A_info_t ainfo; /* Attribute info */ + herr_t ret; /* Generic return status */ + + /* Output message about test being performed */ + MESSAGE(5, ("Testing adding and deleting large attributes\n")); + + + /* Create committed datatype to operate on. Use a committed datatype so that + * there is nothing after the object header and the first chunk can expand and + * contract as necessary. */ + fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl); + CHECK(fid, FAIL, "H5Fcreate"); + tid = H5Tcopy(H5T_STD_I32LE); + CHECK(tid, FAIL, "H5Tcopy"); + ret = H5Tcommit2(fid, TYPE1_NAME, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Tcommit2"); + + /* + * Create small attribute + */ + sid = H5Screate_simple(1, &dims_s, NULL); + CHECK(sid, FAIL, "H5Screate_simple"); + aid = H5Acreate2(tid, ATTR1_NAME, H5T_STD_I8LE, sid, H5P_DEFAULT, H5P_DEFAULT); + CHECK(aid, FAIL, "H5Acreate2"); + + /* Close file */ + ret = H5Aclose(aid); + CHECK(ret, FAIL, "H5Aclose"); + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + ret = H5Tclose(tid); + CHECK(ret, FAIL, "H5Tclose"); + + /* Open file */ + fid = H5Fopen(FILENAME, H5F_ACC_RDWR, fapl); + CHECK(fid, FAIL, "H5Fopen"); + + /* Check attribute */ + tid = H5Topen2(fid, TYPE1_NAME, H5P_DEFAULT); + CHECK(tid, FAIL, "H5Topen2"); + ret = H5Aget_info_by_name(tid, ".", ATTR1_NAME, &ainfo, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Aget_info_by_name"); + if(ainfo.data_size != dims_s) + TestErrPrintf("attribute data size different: data_size=%llu, should be %llu\n", (long long unsigned)ainfo.data_size, (long long unsigned)dims_s); + + /* + * Create another small attribute. Should cause chunk size field to expand by + * 1 byte (1->2). + */ + aid = H5Acreate2(tid, ATTR2_NAME, H5T_STD_I8LE, sid, H5P_DEFAULT, H5P_DEFAULT); + CHECK(aid, FAIL, "H5Acreate2"); + + /* Close file */ + ret = H5Aclose(aid); + CHECK(ret, FAIL, "H5Aclose"); + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + ret = H5Tclose(tid); + CHECK(ret, FAIL, "H5Tclose"); + + /* Open file */ + fid = H5Fopen(FILENAME, H5F_ACC_RDWR, fapl); + CHECK(fid, FAIL, "H5Fopen"); + + /* Check attributes */ + tid = H5Topen2(fid, TYPE1_NAME, H5P_DEFAULT); + CHECK(tid, FAIL, "H5Topen2"); + ret = H5Aget_info_by_name(tid, ".", ATTR1_NAME, &ainfo, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Aget_info_by_name"); + if(ainfo.data_size != dims_s) + TestErrPrintf("attribute data size different: data_size=%llu, should be %llu\n", (long long unsigned)ainfo.data_size, (long long unsigned)dims_s); + ret = H5Aget_info_by_name(tid, ".", ATTR2_NAME, &ainfo, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Aget_info_by_name"); + if(ainfo.data_size != dims_s) + TestErrPrintf("attribute data size different: data_size=%llu, should be %llu\n", (long long unsigned)ainfo.data_size, (long long unsigned)dims_s); + + /* + * Create large attribute. Should cause chunk size field to expand by 2 bytes + * (2->4). + */ + ret = H5Sset_extent_simple(sid, 1, &dims_l, NULL); + CHECK(ret, FAIL, "H5Sset_extent_simple"); + aid = H5Acreate2(tid, ATTR3_NAME, H5T_STD_I8LE, sid, H5P_DEFAULT, H5P_DEFAULT); + CHECK(aid, FAIL, "H5Acreate2"); + + /* Close file */ + ret = H5Aclose(aid); + CHECK(ret, FAIL, "H5Aclose"); + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + ret = H5Tclose(tid); + CHECK(ret, FAIL, "H5Tclose"); + + /* Open file */ + fid = H5Fopen(FILENAME, H5F_ACC_RDWR, fapl); + CHECK(fid, FAIL, "H5Fopen"); + + /* Check attributes */ + tid = H5Topen2(fid, TYPE1_NAME, H5P_DEFAULT); + CHECK(tid, FAIL, "H5Topen2"); + ret = H5Aget_info_by_name(tid, ".", ATTR1_NAME, &ainfo, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Aget_info_by_name"); + if(ainfo.data_size != dims_s) + TestErrPrintf("attribute data size different: data_size=%llu, should be %llu\n", (long long unsigned)ainfo.data_size, (long long unsigned)dims_s); + ret = H5Aget_info_by_name(tid, ".", ATTR2_NAME, &ainfo, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Aget_info_by_name"); + if(ainfo.data_size != dims_s) + TestErrPrintf("attribute data size different: data_size=%llu, should be %llu\n", (long long unsigned)ainfo.data_size, (long long unsigned)dims_s); + ret = H5Aget_info_by_name(tid, ".", ATTR3_NAME, &ainfo, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Aget_info_by_name"); + if(ainfo.data_size != dims_l) + TestErrPrintf("attribute data size different: data_size=%llu, should be %llu\n", (long long unsigned)ainfo.data_size, (long long unsigned)dims_l); + + /* + * Delete last two attributes - should merge into a null message that is too + * large, causing the chunk size field to shrink by 3 bytes (4->1). + */ + ret = H5Sset_extent_simple(sid, 1, &dims_l, NULL); + CHECK(ret, FAIL, "H5Sset_extent_simple"); + ret = H5Adelete(tid, ATTR2_NAME); + CHECK(ret, FAIL, "H5Adelete"); + ret = H5Adelete(tid, ATTR3_NAME); + CHECK(ret, FAIL, "H5Adelete"); + + /* Close file */ + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + ret = H5Tclose(tid); + CHECK(ret, FAIL, "H5Tclose"); + + /* Open file */ + fid = H5Fopen(FILENAME, H5F_ACC_RDWR, fapl); + CHECK(fid, FAIL, "H5Fopen"); + + /* Check attribute */ + tid = H5Topen2(fid, TYPE1_NAME, H5P_DEFAULT); + CHECK(tid, FAIL, "H5Topen2"); + ret = H5Aget_info_by_name(tid, ".", ATTR1_NAME, &ainfo, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Aget_info_by_name"); + if(ainfo.data_size != dims_s) + TestErrPrintf("attribute data size different: data_size=%llu, should be %llu\n", (long long unsigned)ainfo.data_size, (long long unsigned)dims_s); + + /* + * Create large attribute. Should cause chunk size field to expand by 3 bytes + * (1->4). + */ + aid = H5Acreate2(tid, ATTR2_NAME, H5T_STD_I8LE, sid, H5P_DEFAULT, H5P_DEFAULT); + CHECK(aid, FAIL, "H5Acreate2"); + + /* Close file */ + ret = H5Aclose(aid); + CHECK(ret, FAIL, "H5Aclose"); + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + ret = H5Tclose(tid); + CHECK(ret, FAIL, "H5Tclose"); + + /* Open file */ + fid = H5Fopen(FILENAME, H5F_ACC_RDWR, fapl); + CHECK(fid, FAIL, "H5Fopen"); + + /* Check attributes */ + tid = H5Topen2(fid, TYPE1_NAME, H5P_DEFAULT); + CHECK(tid, FAIL, "H5Topen2"); + ret = H5Aget_info_by_name(tid, ".", ATTR1_NAME, &ainfo, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Aget_info_by_name"); + if(ainfo.data_size != dims_s) + TestErrPrintf("attribute data size different: data_size=%llu, should be %llu\n", (long long unsigned)ainfo.data_size, (long long unsigned)dims_s); + ret = H5Aget_info_by_name(tid, ".", ATTR2_NAME, &ainfo, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Aget_info_by_name"); + if(ainfo.data_size != dims_l) + TestErrPrintf("attribute data size different: data_size=%llu, should be %llu\n", (long long unsigned)ainfo.data_size, (long long unsigned)dims_l); + + /* Close IDs */ + ret = H5Tclose(tid); + CHECK(ret, FAIL, "H5Tclose"); + ret = H5Sclose(sid); + CHECK(ret, FAIL, "H5Sclose"); + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); +} /* test_attr_bug7() */ + +/**************************************************************** +** +** test_attr_bug8(): Test basic H5A (attribute) code. +** (Really tests object header code). +** Tests adding a link and attribute to a group in such a +** way as to cause the "chunk #0 size" field to expand +** when some object header messages are not loaded into +** cache. Before the bug was fixed, this would prevent +** these messages from being shifted to the correct +** position as the expansion algorithm marked them dirty, +** invalidating the raw form, when there was no native +** form to encode. +** +****************************************************************/ +static void +test_attr_bug8(hid_t fcpl, hid_t fapl) +{ + hid_t fid; /* File ID */ + hid_t aid; /* Attribute ID */ + hid_t sid; /* Dataspace ID */ + hid_t gid; /* Group ID */ + hid_t oid; /* Object ID */ + hsize_t dims = 256; /* Attribute dimensions */ + H5O_info_t oinfo; /* Object info */ + H5A_info_t ainfo; /* Attribute info */ + haddr_t root_addr; /* Root group address */ + herr_t ret; /* Generic return status */ + + /* Output message about test being performed */ + MESSAGE(5, ("Testing attribute expanding object header with undecoded messages\n")); + + + /* Create committed datatype to operate on. Use a committed datatype so that + * there is nothing after the object header and the first chunk can expand and + * contract as necessary. */ + fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl); + CHECK(fid, FAIL, "H5Fcreate"); + gid = H5Gcreate2(fid, GROUP1_NAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(gid, FAIL, "H5Gcreate2"); + + /* Get root group address */ + ret = H5Oget_info(fid, &oinfo); + CHECK(ret, FAIL, "H5Oget_info"); + root_addr = oinfo.addr; + + /* + * Create link to root group + */ + ret = H5Lcreate_hard(fid, "/", gid, LINK1_NAME, H5P_DEFAULT, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Lcreate_hard"); + + /* Close file */ + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + ret = H5Gclose(gid); + CHECK(ret, FAIL, "H5Gclose"); + + /* Open file */ + fid = H5Fopen(FILENAME, H5F_ACC_RDONLY, fapl); + CHECK(fid, FAIL, "H5Fopen"); + + /* Check link */ + gid = H5Gopen2(fid, GROUP1_NAME, H5P_DEFAULT); + CHECK(gid, FAIL, "H5Gopen2"); + oid = H5Oopen(gid, LINK1_NAME, H5P_DEFAULT); + CHECK(oid, FAIL, "H5Oopen"); + ret = H5Oget_info(oid, &oinfo); + CHECK(ret, FAIL, "H5Oget_info"); + if(oinfo.addr != root_addr) + TestErrPrintf("incorrect link target address: addr: %llu, expected: %llu\n", (long long unsigned)oinfo.addr, (long long unsigned)root_addr); + + /* Close file */ + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + ret = H5Gclose(gid); + CHECK(ret, FAIL, "H5Gclose"); + ret = H5Oclose(oid); + CHECK(ret, FAIL, "H5Oclose"); + + /* Open file */ + fid = H5Fopen(FILENAME, H5F_ACC_RDWR, fapl); + CHECK(fid, FAIL, "H5Fopen"); + + /* + * Create attribute. Should cause chunk size field to expand by 1 byte + * (1->2). + */ + gid = H5Gopen2(fid, GROUP1_NAME, H5P_DEFAULT); + CHECK(gid, FAIL, "H5Gopen2"); + sid = H5Screate_simple(1, &dims, NULL); + CHECK(sid, FAIL, "H5Screate_simple"); + aid = H5Acreate2(gid, ATTR1_NAME, H5T_STD_I8LE, sid, H5P_DEFAULT, H5P_DEFAULT); + CHECK(aid, FAIL, "H5Acreate2"); + + /* Close file */ + ret = H5Aclose(aid); + CHECK(ret, FAIL, "H5Aclose"); + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + ret = H5Gclose(gid); + CHECK(ret, FAIL, "H5Gclose"); + + /* Open file */ + fid = H5Fopen(FILENAME, H5F_ACC_RDONLY, fapl); + CHECK(fid, FAIL, "H5Fopen"); + + /* Check link and attribute */ + gid = H5Gopen2(fid, GROUP1_NAME, H5P_DEFAULT); + CHECK(gid, FAIL, "H5Gopen2"); + oid = H5Oopen(gid, LINK1_NAME, H5P_DEFAULT); + CHECK(oid, FAIL, "H5Oopen"); + ret = H5Oget_info(oid, &oinfo); + CHECK(ret, FAIL, "H5Oget_info"); + if(oinfo.addr != root_addr) + TestErrPrintf("incorrect link target address: addr: %llu, expected: %llu\n", (long long unsigned)oinfo.addr, (long long unsigned)root_addr); + ret = H5Aget_info_by_name(gid, ".", ATTR1_NAME, &ainfo, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Aget_info_by_name"); + if(ainfo.data_size != dims) + TestErrPrintf("attribute data size different: data_size=%llu, should be %llu\n", (long long unsigned)ainfo.data_size, (long long unsigned)dims); + + /* Close IDs */ + ret = H5Oclose(oid); + CHECK(ret, FAIL, "H5Oclose"); + ret = H5Gclose(gid); + CHECK(ret, FAIL, "H5Gclose"); + ret = H5Sclose(sid); + CHECK(ret, FAIL, "H5Sclose"); + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); +} /* test_attr_bug8() */ /**************************************************************** ** @@ -10364,6 +10698,8 @@ test_attr(void) test_attr_bug4(my_fcpl, my_fapl); /* Test attributes on named datatypes */ test_attr_bug5(my_fcpl, my_fapl); /* Test opening/closing attributes through different file handles */ test_attr_bug6(my_fcpl, my_fapl); /* Test reading empty attribute */ + test_attr_bug7(my_fcpl, my_fapl); /* Test creating and deleting large attributes in ohdr chunk 0 */ + test_attr_bug8(my_fcpl, my_fapl); /* Test attribute expanding object header with undecoded messages */ } /* end for */ } /* end if */ else { @@ -10388,6 +10724,10 @@ test_attr(void) test_attr_bug4(fcpl, my_fapl); /* Test attributes on named datatypes */ test_attr_bug5(fcpl, my_fapl); /* Test opening/closing attributes through different file handles */ test_attr_bug6(fcpl, my_fapl); /* Test reading empty attribute */ + /* Skip test_attr_bug7 because it is specific to the new object + * header format and in fact fails if used with the old format, due + * to the attributes being larger than 64K */ + test_attr_bug8(fcpl, my_fapl); /* Test attribute expanding object header with undecoded messages */ } /* end else */ } /* end for */ diff --git a/test/testfiles/error_test_1 b/test/testfiles/error_test_1 index 308ca07..8d6e208 100644 --- a/test/testfiles/error_test_1 +++ b/test/testfiles/error_test_1 @@ -1,8 +1,6 @@ ############################# Expected output for error_test ############################# -Testing error API based on data I/O -All error API tests passed. This program tests the Error API. There're supposed to be some error messages ********* Print error stack in HDF5 default way ********* Second Test-DIAG: Error detected in Second Program (1.0) thread (IDs): @@ -23,6 +21,8 @@ Error Test-DIAG: Error detected in Error Program (1.0) thread (IDs): class: Second Test major: Error in test minor: Error in error stack + +Testing error API based on data I/O HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #000: (file name) line (number) in H5Dwrite(): not a dataset major: Invalid arguments to routine @@ -38,3 +38,23 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #002: (file name) line (number) in H5Dwrite(): not a dataset major: Invalid arguments to routine minor: Inappropriate type + +Testing error message during data reading when filter isn't registered +HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): + #000: (file name) line (number) in H5Dread(): can't read data + major: Dataset + minor: Read failed + #001: (file name) line (number) in H5D_read(): can't read data + major: Dataset + minor: Read failed + #002: (file name) line (number) in H5D_chunk_read(): unable to read raw data chunk + major: Low-level I/O + minor: Read failed + #003: (file name) line (number) in H5D_chunk_lock(): data pipeline read failed + major: Data filters + minor: Filter operation failed + #004: (file name) line (number) in H5Z_pipeline(): required filter 'bogus' is not registered + major: Data filters + minor: Read failed + +All error API tests passed. diff --git a/test/testlinks_env.sh.in b/test/testlinks_env.sh.in index e71dfc8..5a7e045 100644 --- a/test/testlinks_env.sh.in +++ b/test/testlinks_env.sh.in @@ -35,7 +35,7 @@ TEST_BIN=`pwd`/$TEST_NAME # The path of the test binary ENVCMD="env HDF5_EXT_PREFIX=.:tmp" # The environment variable & value # # Run the test -$ENVCMD $TEST_BIN +$ENVCMD $RUNSERIAL $TEST_BIN exitcode=$? if [ $exitcode -eq 0 ]; then echo "Test for HDF5_EXT_PREFIX PASSED" diff --git a/test/tfile.c b/test/tfile.c index 6c3746c..7d26c63 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -1263,6 +1263,79 @@ test_file_perm(void) /**************************************************************** ** +** test_file_perm2(): low-level file test routine. +** This test verifies that no object can be created in a +** file that is opened for read-only. +** +*****************************************************************/ +static void +test_file_perm2(void) +{ + hid_t file; /* File opened with read-write permission */ + hid_t filero; /* Same file opened with read-only permission */ + hid_t dspace; /* Dataspace ID */ + hid_t group; /* Group ID */ + hid_t dset; /* Dataset ID */ + hid_t type; /* Datatype ID */ + hid_t attr; /* Attribute ID */ + herr_t ret; + + /* Output message about test being performed */ + MESSAGE(5, ("Testing Low-Level File Permissions again\n")); + + dspace = H5Screate(H5S_SCALAR); + CHECK(dspace, FAIL, "H5Screate"); + + /* Create the file (with read-write permission) */ + file = H5Fcreate(FILE2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + CHECK(file, FAIL, "H5Fcreate"); + + ret = H5Fclose(file); + CHECK(ret, FAIL, "H5Fclose"); + + /* Open the file (with read-only permission) */ + filero = H5Fopen(FILE2, H5F_ACC_RDONLY, H5P_DEFAULT); + CHECK(filero, FAIL, "H5Fopen"); + + /* Create a group with the read-only file handle (should fail) */ + H5E_BEGIN_TRY { + group = H5Gcreate2(filero, "MY_GROUP", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + } H5E_END_TRY; + VERIFY(group, FAIL, "H5Gcreate2"); + + /* Create a dataset with the read-only file handle (should fail) */ + H5E_BEGIN_TRY { + dset = H5Dcreate2(filero, F2_DSET, H5T_NATIVE_INT, dspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + } H5E_END_TRY; + VERIFY(dset, FAIL, "H5Dcreate2"); + + /* Create an attribute with the read-only file handle (should fail) */ + H5E_BEGIN_TRY { + attr = H5Acreate2(filero, "MY_ATTR", H5T_NATIVE_INT, dspace, H5P_DEFAULT, H5P_DEFAULT); + } H5E_END_TRY; + VERIFY(attr, FAIL, "H5Acreate2"); + + type = H5Tcopy(H5T_NATIVE_SHORT); + CHECK(type, FAIL, "H5Tcopy"); + + /* Commit a datatype with the read-only file handle (should fail) */ + H5E_BEGIN_TRY { + ret = H5Tcommit2(filero, "MY_DTYPE", type, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + } H5E_END_TRY; + VERIFY(ret, FAIL, "H5Tcommit2"); + + ret = H5Tclose(type); + CHECK(ret, FAIL, "H5Tclose"); + + ret = H5Fclose(filero); + CHECK(ret, FAIL, "H5Fclose"); + + ret = H5Sclose(dspace); + CHECK(ret, FAIL, "H5Sclose"); +} /* end test_file_perm2() */ + +/**************************************************************** +** ** test_file_freespace(): low-level file test routine. ** This test checks the free space available in a file in various ** situations. @@ -3057,63 +3130,113 @@ test_filespace_compatible(void) /**************************************************************** ** -** test_libver_bounds(): -** Verify that a file created with "LATEST, LATEST" can be -** opened later, with no setting. (Further testing welcome) +** test_libver_bounds_real(): +** Verify that a file created and modified with the +** specified libver bounds has the specified object header +** versions for the right objects. ** ****************************************************************/ static void -test_libver_bounds(void) +test_libver_bounds_real(H5F_libver_t libver_create, unsigned oh_vers_create, + H5F_libver_t libver_mod, unsigned oh_vers_mod) { hid_t file, group; /* Handles */ hid_t fapl; /* File access property list */ - herr_t ret; /* Return value */ - - /* Output message about test being performed */ - MESSAGE(5, ("Testing setting library version bounds\n")); + H5O_info_t oinfo; /* Object info */ + herr_t ret; /* Return value */ /* - * Create a new file using the default properties. + * Create a new file using the creation properties. */ fapl = H5Pcreate(H5P_FILE_ACCESS); CHECK(fapl, FAIL, "H5Pcreate"); - ret = H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST); + ret = H5Pset_libver_bounds(fapl, libver_create, H5F_LIBVER_LATEST); CHECK(ret, FAIL, "H5Pset_libver_bounds"); file = H5Fcreate("tfile5.h5", H5F_ACC_TRUNC, H5P_DEFAULT, fapl); CHECK(file, FAIL, "H5Fcreate"); + /* + * Make sure the root group has the correct object header version + */ + ret = H5Oget_info_by_name(file, "/", &oinfo, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Oget_info_by_name"); + VERIFY(oinfo.hdr.version, oh_vers_create, "H5Oget_info_by_name"); + + /* + * Reopen the file and make sure the root group still has the correct version + */ ret = H5Fclose(file); CHECK(ret, FAIL, "H5Fclose"); - ret = H5Pset_libver_bounds(fapl, H5F_LIBVER_EARLIEST, H5F_LIBVER_LATEST); + ret = H5Pset_libver_bounds(fapl, libver_mod, H5F_LIBVER_LATEST); CHECK(ret, FAIL, "H5Pset_libver_bounds"); file = H5Fopen("tfile5.h5", H5F_ACC_RDWR, fapl); CHECK(file, FAIL, "H5Fopen"); + ret = H5Oget_info_by_name(file, "/", &oinfo, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Oget_info_by_name"); + VERIFY(oinfo.hdr.version, oh_vers_create, "H5Oget_info_by_name"); + /* - * Create a group named "G1" in the file. + * Create a group named "G1" in the file, and make sure it has the correct + * object header version */ group = H5Gcreate2(file, "/G1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); CHECK(group, FAIL, "H5Gcreate"); + ret = H5Oget_info(group, &oinfo); + CHECK(ret, FAIL, "H5Oget_info_by_name"); + VERIFY(oinfo.hdr.version, oh_vers_mod, "H5Oget_info_by_name"); + ret = H5Gclose(group); CHECK(ret, FAIL, "H5Gclose"); /* - * Create a group named "/G1/G3" in the file. + * Create a group named "/G1/G3" in the file, and make sure it has the + * correct object header version */ group = H5Gcreate2(file, "/G1/G3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); CHECK(group, FAIL, "H5Gcreate"); + ret = H5Oget_info(group, &oinfo); + CHECK(ret, FAIL, "H5Oget_info_by_name"); + VERIFY(oinfo.hdr.version, oh_vers_mod, "H5Oget_info_by_name"); + ret = H5Gclose(group); CHECK(ret, FAIL, "H5Gclose"); + /* + * Make sure the root group still has the correct object header version + */ + ret = H5Oget_info_by_name(file, "/", &oinfo, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Oget_info_by_name"); + VERIFY(oinfo.hdr.version, oh_vers_create, "H5Oget_info_by_name"); + ret = H5Fclose(file); CHECK(ret, FAIL, "H5Fclose"); -} /* test_libver_bounds() */ +} /* end test_libver_bounds_real() */ + +/**************************************************************** +** +** test_libver_bounds(): +** Verify that a file created and modified with various +** libver bounds is handled correctly. (Further testing +** welcome) +** +****************************************************************/ +static void +test_libver_bounds(void) +{ + /* Output message about test being performed */ + MESSAGE(5, ("Testing setting library version bounds\n")); + + /* Run the tests */ + test_libver_bounds_real(H5F_LIBVER_EARLIEST, 1, H5F_LIBVER_LATEST, 2); + test_libver_bounds_real(H5F_LIBVER_LATEST, 2, H5F_LIBVER_EARLIEST, 1); +} /* end test_libver_bounds() */ /**************************************************************** ** @@ -3581,6 +3704,7 @@ test_file(void) #endif /* H5_NO_SHARED_WRITING */ test_get_file_id(); /* Test H5Iget_file_id */ test_file_perm(); /* Test file access permissions */ + test_file_perm2(); /* Test file access permission again */ test_file_freespace(); /* Test file free space information */ test_file_ishdf5(); /* Test detecting HDF5 files correctly */ test_file_open_dot(); /* Test opening objects with "." for a name */ diff --git a/test/th5o.c b/test/th5o.c index 70f8067..c46751e 100644 --- a/test/th5o.c +++ b/test/th5o.c @@ -1351,7 +1351,9 @@ test_h5o(void) test_h5o_link(); /* Test object link routine */ test_h5o_comment(); /* Test routines for comment */ test_h5o_comment_by_name(); /* Test routines for comment by name */ +#ifndef H5_CANNOT_OPEN_TWICE /* OpenVMS can't open a file twice */ test_h5o_getinfo_same_file(); /* Test info for objects in the same file */ +#endif /* H5_CANNOT_OPEN_TWICE */ } /* test_h5o() */ diff --git a/test/th5s.c b/test/th5s.c index d0d176a..87aa0f1 100644 --- a/test/th5s.c +++ b/test/th5s.c @@ -544,70 +544,13 @@ test_h5s_zero_dim(void) hssize_t nelem; /* Number of elements */ H5S_sel_type sel_type; /* Type of selection currently */ H5S_class_t stype; /* dataspace type */ + H5D_alloc_time_t alloc_time; /* Space allocation time */ herr_t ret; /* Generic return value */ unsigned int i, j, k; /* Output message about test being performed */ MESSAGE(5, ("Testing Dataspace with zero dimension size\n")); - /* Make sure we can create the space with the dimension size 0 (starting from v1.8.7). - * The dimension doesn't need to be unlimited. */ - sid1 = H5Screate_simple(SPACE1_RANK, dims1, NULL); - CHECK(sid1, FAIL, "H5Screate_simple"); - - ret = H5Sclose(sid1); - CHECK(ret, FAIL, "H5Sclose"); - - sid1 = H5Screate(H5S_SIMPLE); - CHECK(sid1, FAIL, "H5Screate"); - - /* SID1 has the 1st dimension size as zero. The maximal dimension will be - * the same as the dimension because of the NULL passed in. */ - ret = H5Sset_extent_simple(sid1,SPACE1_RANK,dims1,NULL); - CHECK(ret, FAIL, "H5Sset_extent_simple"); - - /* Check that the dataspace actually has 0 elements */ - nelem = H5Sget_simple_extent_npoints(sid1); - VERIFY(nelem, 0, "H5Sget_simple_extent_npoints"); - - /* Check that the dataspace was created with an "all" selection */ - sel_type = H5Sget_select_type(sid1); - VERIFY(sel_type, H5S_SEL_ALL, "H5Sget_select_type"); - - /* Check that the dataspace has 0 elements selected */ - nelem = H5Sget_select_npoints(sid1); - VERIFY(nelem, 0, "H5Sget_select_npoints"); - - /* Change to "none" selection */ - ret = H5Sselect_none(sid1); - CHECK(ret, FAIL, "H5Sselect_none"); - - /* Check that the dataspace has 0 elements selected */ - nelem = H5Sget_select_npoints(sid1); - VERIFY(nelem, 0, "H5Sget_select_npoints"); - - /* Try to select all dataspace */ - ret = H5Sselect_all(sid1); - CHECK(ret, FAIL, "H5Sselect_all"); - - /* Check that the dataspace has 0 elements selected */ - nelem = H5Sget_select_npoints(sid1); - VERIFY(nelem, 0, "H5Sget_select_npoints"); - - /* Create the dataspace for chunked dataset with the first dimension size as zero. - * The maximal dimensions are bigger than the dimensions for later expansion. */ - sid_chunk = H5Screate_simple(SPACE1_RANK, dims1, max_dims); - CHECK(sid_chunk, FAIL, "H5Screate_simple"); - - /*============================================ - * Make sure we can use 0-dimension to create - * contiguous, chunked, compact, and external - * datasets, and also attribute. - *============================================ - */ - fid1 = H5Fcreate(ZEROFILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - CHECK(fid1, FAIL, "H5Fcreate"); - /* Initialize the data */ for(i=0; ist3h_base); CHECK(ret,FAIL,"H5Tclose"); - free(str3hndl); + HDfree(str3hndl); } static void @@ -778,7 +781,7 @@ delete_struct2(misc5_struct2_hndl *str2hndl) H5Tclose(str2hndl->st2h_base); CHECK(ret,FAIL,"H5Tclose"); - free(str2hndl); + HDfree(str2hndl); } static void @@ -789,7 +792,7 @@ set_struct2(misc5_struct2 *buf) buf->st2_el1=MISC5_DBGELVAL2; buf->st2_el2.len=MISC5_DBGNELM3; - buf->st2_el2.p=malloc((buf->st2_el2.len)*sizeof(misc5_struct3)); + buf->st2_el2.p=HDmalloc((buf->st2_el2.len)*sizeof(misc5_struct3)); CHECK(buf->st2_el2.p,NULL,"malloc"); for(i=0; i<(buf->st2_el2.len); i++) @@ -799,7 +802,7 @@ set_struct2(misc5_struct2 *buf) static void clear_struct2(misc5_struct2 *buf) { - free(buf->st2_el2.p); + HDfree(buf->st2_el2.p); } /*********************** struct1 ***********************/ @@ -844,7 +847,7 @@ delete_struct1(misc5_struct1_hndl *str1hndl) ret=H5Tclose(str1hndl->st1h_base); CHECK(ret,FAIL,"H5Tclose"); - free(str1hndl); + HDfree(str1hndl); } static void @@ -855,7 +858,7 @@ set_struct1(misc5_struct1 *buf) buf->st1_el1=MISC5_DBGELVAL1; buf->st1_el2.len=MISC5_DBGNELM2; - buf->st1_el2.p=malloc((buf->st1_el2.len)*sizeof(misc5_struct2)); + buf->st1_el2.p=HDmalloc((buf->st1_el2.len)*sizeof(misc5_struct2)); CHECK(buf->st1_el2.p,NULL,"malloc"); for(i=0; i<(buf->st1_el2.len); i++) @@ -869,7 +872,7 @@ clear_struct1(misc5_struct1 *buf) for(i=0;ist1_el2.len;i++) clear_struct2(&((( misc5_struct2 *)(buf->st1_el2.p))[i])); - free(buf->st1_el2.p); + HDfree(buf->st1_el2.p); } static void @@ -905,7 +908,7 @@ test_misc5(void) /* Create the variable-length buffer */ buf.len = MISC5_DBGNELM1; - buf.p = malloc((buf.len) * sizeof(misc5_struct1)); + buf.p = HDmalloc((buf.len) * sizeof(misc5_struct1)); CHECK(buf.p, NULL, "malloc"); /* Create the top-level VL information */ @@ -921,7 +924,7 @@ test_misc5(void) clear_struct1(&(((misc5_struct1 *)(buf.p))[j])); /* Free the variable-length buffer */ - free(buf.p); + HDfree(buf.p); /* Close dataset */ ret = H5Dclose(dataset_id); @@ -1231,10 +1234,10 @@ test_misc8(void) MESSAGE(5, ("Testing dataset storage sizes\n")); /* Allocate space for the data to write & read */ - wdata=malloc(sizeof(int)*MISC8_DIM0*MISC8_DIM1); + wdata=HDmalloc(sizeof(int)*MISC8_DIM0*MISC8_DIM1); CHECK(wdata,NULL,"malloc"); #ifdef VERIFY_DATA - rdata=malloc(sizeof(int)*MISC8_DIM0*MISC8_DIM1); + rdata=HDmalloc(sizeof(int)*MISC8_DIM0*MISC8_DIM1); CHECK(rdata,NULL,"malloc"); #endif /* VERIFY_DATA */ @@ -1672,7 +1675,7 @@ test_misc8(void) CHECK(ret, FAIL, "H5Fclose"); /* Free the read & write buffers */ - free(wdata); + HDfree(wdata); #ifdef VERIFY_DATA free(rdata); #endif /* VERIFY_DATA */ @@ -1795,10 +1798,10 @@ test_misc11(void) unsigned sym_ik; /* Symbol table B-tree initial 'K' value */ unsigned istore_ik; /* Indexed storage B-tree initial 'K' value */ unsigned sym_lk; /* Symbol table B-tree leaf 'K' value */ - unsigned nindexes; /* Shared message number of indexes */ - H5F_info2_t finfo; /* global information about file */ - H5F_file_space_type_t strategy; /* File/free space strategy */ - hsize_t threshold; /* Free-space section threshold */ + unsigned nindexes; /* Shared message number of indexes */ + H5F_info2_t finfo; /* global information about file */ + H5F_file_space_type_t strategy; /* File/free space strategy */ + hsize_t threshold; /* Free-space section threshold */ herr_t ret; /* Generic return value */ /* Output message about test being performed */ @@ -1953,10 +1956,10 @@ test_misc12(void) hsize_t dimsn[] = {MISC12_APPEND_SIZE}; hsize_t maxdims1[1] = {H5S_UNLIMITED}; hsize_t chkdims1[1] = {MISC12_CHUNK_SIZE}; - hsize_t newsize[1] = {MISC12_SPACE1_DIM1+MISC12_APPEND_SIZE}; - hsize_t offset[1] = {MISC12_SPACE1_DIM1}; - hsize_t count[1] = {MISC12_APPEND_SIZE}; - int i; /* counting variable */ + hsize_t newsize[1] = {MISC12_SPACE1_DIM1+MISC12_APPEND_SIZE}; + hsize_t offset[1] = {MISC12_SPACE1_DIM1}; + hsize_t count[1] = {MISC12_APPEND_SIZE}; + int i; /* counting variable */ herr_t ret; /* Generic return value */ /* Output message about test being performed */ @@ -2210,7 +2213,7 @@ create_hdf_file(const char *name) /* Close the file */ ret = H5Fclose(fid); - assert(ret >= 0); + HDassert(ret >= 0); CHECK(ret, FAIL, "H5Fclose"); } @@ -2240,7 +2243,7 @@ insert_user_block(const char *old_name, const char *new_name,const char *str,siz VERIFY(written, size, "HDfwrite"); /* Open the old file */ - old_fp=fopen(old_name,"rb"); + old_fp=HDfopen(old_name,"rb"); CHECK(old_fp, NULL, "HDfopen"); /* Allocate space for the copy buffer */ @@ -2263,10 +2266,10 @@ insert_user_block(const char *old_name, const char *new_name,const char *str,siz VERIFY(ret, 0, "HDfclose"); /* Free the copy buffer */ - free(copy_buf); + HDfree(copy_buf); /* Free the user block */ - free(user_block); + HDfree(user_block); } static void @@ -3529,7 +3532,7 @@ test_misc20(void) and encoder is available. EIP 2004/8/04 */ -#if defined H5_HAVE_FILTER_SZIP +#ifdef H5_HAVE_FILTER_SZIP /**************************************************************** ** @@ -4447,7 +4450,6 @@ test_misc25a(void) CHECK(ret, FAIL, "H5Fclose"); - /* Re-open file */ fid = H5Fopen(MISC25A_FILE, H5F_ACC_RDWR, H5P_DEFAULT); CHECK(fid, FAIL, "H5Fopen"); @@ -4491,7 +4493,6 @@ test_misc25a(void) CHECK(ret, FAIL, "H5Fclose"); - /* Re-open file */ fid = H5Fopen(MISC25A_FILE, H5F_ACC_RDWR, H5P_DEFAULT); CHECK(fid, FAIL, "H5Fopen"); @@ -5113,6 +5114,87 @@ test_misc29(void) CHECK(ret, FAIL, "H5Fclose"); } /* end test_misc29() */ + +static int +test_misc30_get_info_cb(hid_t loc_id, const char *name, const H5L_info_t UNUSED *info, + void UNUSED *op_data) +{ + H5O_info_t object_info; + + return H5Oget_info_by_name(loc_id, name, &object_info, H5P_DEFAULT); +} + +static int +test_misc30_get_info(hid_t loc_id) +{ + return H5Literate(loc_id, H5_INDEX_NAME, H5_ITER_INC, NULL, test_misc30_get_info_cb, NULL); +} + + +/**************************************************************** +** +** test_misc30(): Exercise local heap code that loads prefix +** separately from data block, causing the free +** block information to get lost. +** +****************************************************************/ +static void +test_misc30(void) +{ + hsize_t file_size[] = {0, 0}; /* Sizes of file created */ + hbool_t get_info; /* Whether to perform the get info call */ + + /* Output message about test being performed */ + MESSAGE(5, ("Local heap dropping free block info\n")); + + for(get_info = FALSE; get_info <= TRUE; get_info++) { + hid_t fid; /* File ID */ + hid_t gid; /* Group ID */ + int i; /* Local index counter */ + herr_t ret; /* Generic return value */ + + fid = H5Fcreate(MISC30_FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + CHECK(fid, FAIL, "H5Fcreate"); + gid = H5Gcreate2(fid, "/g0", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(gid, FAIL, "H5Gcreate2"); + + ret = H5Gclose(gid); + CHECK(ret, FAIL, "H5Gclose"); + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + + for(i = 0; i < 20; i++) { + char gname[32]; + + fid = H5Fopen(MISC30_FILE, H5F_ACC_RDWR, H5P_DEFAULT); + CHECK(fid, FAIL, "H5Fopen"); + + if(get_info) { + ret = test_misc30_get_info(fid); + CHECK(ret, FAIL, "test_misc30_get_info"); + } + + sprintf(gname, "/g0/group%d", i); + gid = H5Gcreate2(fid, gname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(gid, FAIL, "H5Gcreate2"); + + ret = H5Gclose(gid); + CHECK(ret, FAIL, "H5Gclose"); + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + } + + fid = H5Fopen(MISC30_FILE, H5F_ACC_RDONLY, H5P_DEFAULT); + CHECK(fid, FAIL, "H5Fopen"); + ret = H5Fget_filesize(fid, &file_size[get_info]); + CHECK(fid, FAIL, "H5Fget_filesize"); + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); + } + + VERIFY(file_size[0], file_size[1], "test_misc30"); +} /* end test_misc30() */ + /**************************************************************** ** ** test_misc(): Main misc. test routine. @@ -5144,7 +5226,7 @@ test_misc(void) test_misc18(); /* Test new object header information in H5O_info_t struct */ test_misc19(); /* Test incrementing & decrementing ref count on IDs */ test_misc20(); /* Test problems with truncated dimensions in version 2 of storage layout message */ -#if defined H5_HAVE_FILTER_SZIP +#ifdef H5_HAVE_FILTER_SZIP test_misc21(); /* Test that "late" allocation time is treated the same as "incremental", for chunked datasets w/a filters */ test_misc22(); /* check szip bits per pixel */ #endif /* H5_HAVE_FILTER_SZIP */ @@ -5157,6 +5239,7 @@ test_misc(void) test_misc27(); /* Test opening file with object that has bad # of object header messages */ test_misc28(); /* Test that chunks are cached appropriately */ test_misc29(); /* Test that speculative metadata reads are handled correctly */ + test_misc30(); /* Exercise local heap loading bug where free lists were getting dropped */ } /* test_misc() */ @@ -5201,7 +5284,7 @@ cleanup_misc(void) HDremove(MISC18_FILE); HDremove(MISC19_FILE); HDremove(MISC20_FILE); -#if defined H5_HAVE_FILTER_SZIP +#ifdef H5_HAVE_FILTER_SZIP HDremove(MISC21_FILE); HDremove(MISC22_FILE); #endif /* H5_HAVE_FILTER_SZIP */ @@ -5212,5 +5295,6 @@ cleanup_misc(void) HDremove(MISC26_FILE); HDremove(MISC28_FILE); HDremove(MISC29_COPY_FILE); + HDremove(MISC30_FILE); } diff --git a/test/trefer.c b/test/trefer.c index 4ab3fba..53f7b92 100644 --- a/test/trefer.c +++ b/test/trefer.c @@ -75,6 +75,7 @@ test_reference_params(void) hid_t group; /* Group ID */ hid_t sid1; /* Dataspace ID */ hid_t tid1; /* Datatype ID */ + hid_t dapl_id; /* Dataset access property list */ hsize_t dims1[] = {SPACE1_DIM1}; hobj_ref_t *wbuf, /* buffer to write to disk */ *rbuf, /* buffer read from disk */ @@ -101,6 +102,10 @@ test_reference_params(void) sid1 = H5Screate_simple(SPACE1_RANK, dims1, NULL); CHECK(sid1, FAIL, "H5Screate_simple"); + /* Create dataset access property list */ + dapl_id = H5Pcreate(H5P_DATASET_ACCESS); + CHECK(dapl_id, FAIL, "H5Pcreate"); + /* Create a group */ group = H5Gcreate2(fid1, "Group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); CHECK(group, FAIL, "H5Gcreate2"); @@ -179,12 +184,14 @@ test_reference_params(void) VERIFY(ret, FAIL, "H5Rcreate space"); /* Test parameters to H5Rdereference */ - dset2 = H5Rdereference(-1, H5R_OBJECT, &rbuf[0]); - VERIFY(dset2, FAIL, "H5Rdereference loc_id"); - dset2 = H5Rdereference(dataset, H5R_OBJECT, NULL); - VERIFY(dset2, FAIL, "H5Rdereference ref"); - dset2 = H5Rdereference(dataset, H5R_MAXTYPE, &rbuf[0]); - VERIFY(dset2, FAIL, "H5Rdereference type"); + dset2 = H5Rdereference2(-1, H5P_DEFAULT, H5R_OBJECT, &rbuf[0]); + VERIFY(dset2, FAIL, "H5Rdereference2 loc_id"); + dset2 = H5Rdereference2(dataset, -1, H5R_OBJECT, &rbuf[0]); + VERIFY(dset2, FAIL, "H5Rdereference2 oapl_id"); + dset2 = H5Rdereference2(dataset, dapl_id, H5R_OBJECT, NULL); + VERIFY(dset2, FAIL, "H5Rdereference2 ref"); + dset2 = H5Rdereference2(dataset, dapl_id, H5R_MAXTYPE, &rbuf[0]); + VERIFY(dset2, FAIL, "H5Rdereference2 type"); /* Test parameters to H5Rget_obj_type2 */ ret = H5Rget_obj_type2(-1, H5R_OBJECT, &rbuf[0], NULL); @@ -214,6 +221,10 @@ test_reference_params(void) ret = H5Sclose(sid1); CHECK(ret, FAIL, "H5Sclose"); + /* Close dataset access property list */ + ret = H5Pclose(dapl_id); + CHECK(ret, FAIL, "H5Pclose"); + /* Close Dataset */ ret = H5Dclose(dataset); CHECK(ret, FAIL, "H5Dclose"); @@ -237,23 +248,24 @@ test_reference_params(void) static void test_reference_obj(void) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset, /* Dataset ID */ - dset2; /* Dereferenced dataset ID */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset, /* Dataset ID */ + dset2; /* Dereferenced dataset ID */ hid_t group; /* Group ID */ hid_t sid1; /* Dataspace ID */ hid_t tid1; /* Datatype ID */ hsize_t dims1[] = {SPACE1_DIM1}; - hobj_ref_t *wbuf, /* buffer to write to disk */ - *rbuf, /* buffer read from disk */ - *tbuf; /* temp. buffer read from disk */ + hid_t dapl_id; /* Dataset access property list */ + hobj_ref_t *wbuf, /* buffer to write to disk */ + *rbuf, /* buffer read from disk */ + *tbuf; /* temp. buffer read from disk */ hobj_ref_t nvrbuf[3]={0,101,1000000000}; /* buffer with non-valid refs */ - unsigned *tu32; /* Temporary pointer to uint32 data */ - int i, j; /* counting variables */ + unsigned *tu32; /* Temporary pointer to uint32 data */ + int i, j; /* counting variables */ const char *write_comment="Foo!"; /* Comments for group */ char read_comment[10]; - H5O_type_t obj_type; /* Object type */ - herr_t ret; /* Generic return value */ + H5O_type_t obj_type; /* Object type */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Object Reference Functions\n")); @@ -271,6 +283,10 @@ test_reference_obj(void) sid1 = H5Screate_simple(SPACE1_RANK, dims1, NULL); CHECK(sid1, FAIL, "H5Screate_simple"); + /* Create dataset access property list */ + dapl_id = H5Pcreate(H5P_DATASET_ACCESS); + CHECK(dapl_id, FAIL, "H5Pcreate"); + /* Create a group */ group = H5Gcreate2(fid1, "Group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); CHECK(group, FAIL, "H5Gcreate2"); @@ -389,8 +405,8 @@ test_reference_obj(void) CHECK(ret, FAIL, "H5Dread"); /* Open dataset object */ - dset2 = H5Rdereference(dataset, H5R_OBJECT, &rbuf[0]); - CHECK(dset2, FAIL, "H5Rdereference"); + dset2 = H5Rdereference2(dataset, dapl_id, H5R_OBJECT, &rbuf[0]); + CHECK(dset2, FAIL, "H5Rdereference2"); /* Check information in referenced dataset */ sid1 = H5Dget_space(dset2); @@ -410,9 +426,9 @@ test_reference_obj(void) ret = H5Dclose(dset2); CHECK(ret, FAIL, "H5Dclose"); - /* Open group object */ - group = H5Rdereference(dataset, H5R_OBJECT, &rbuf[2]); - CHECK(group, FAIL, "H5Rdereference"); + /* Open group object. GAPL isn't supported yet. But it's harmless to pass in */ + group = H5Rdereference2(dataset, H5P_DEFAULT, H5R_OBJECT, &rbuf[2]); + CHECK(group, FAIL, "H5Rdereference2"); /* Get group's comment */ ret = H5Oget_comment(group, read_comment, (size_t)10); @@ -426,9 +442,9 @@ test_reference_obj(void) ret = H5Gclose(group); CHECK(ret, FAIL, "H5Gclose"); - /* Open datatype object */ - tid1 = H5Rdereference(dataset, H5R_OBJECT, &rbuf[3]); - CHECK(tid1, FAIL, "H5Rdereference"); + /* Open datatype object. TAPL isn't supported yet. But it's harmless to pass in */ + tid1 = H5Rdereference2(dataset, H5P_DEFAULT, H5R_OBJECT, &rbuf[3]); + CHECK(tid1, FAIL, "H5Rdereference2"); /* Verify correct datatype */ { @@ -457,6 +473,10 @@ test_reference_obj(void) ret = H5Dclose(dataset); CHECK(ret, FAIL, "H5Dclose"); + /* Close dataset access property list */ + ret = H5Pclose(dapl_id); + CHECK(ret, FAIL, "H5Pclose"); + /* Close file */ ret = H5Fclose(fid1); CHECK(ret, FAIL, "H5Fclose"); @@ -481,6 +501,7 @@ test_reference_region(void) dset2; /* Dereferenced dataset ID */ hid_t sid1, /* Dataspace ID #1 */ sid2; /* Dataspace ID #2 */ + hid_t dapl_id; /* Dataset access property list */ hsize_t dims1[] = {SPACE1_DIM1}, dims2[] = {SPACE2_DIM1, SPACE2_DIM2}; hsize_t start[SPACE2_RANK]; /* Starting location of hyperslab */ @@ -518,6 +539,10 @@ test_reference_region(void) sid2 = H5Screate_simple(SPACE2_RANK, dims2, NULL); CHECK(sid2, FAIL, "H5Screate_simple"); + /* Create dataset access property list */ + dapl_id = H5Pcreate(H5P_DATASET_ACCESS); + CHECK(dapl_id, FAIL, "H5Pcreate"); + /* Create a dataset */ dset2 = H5Dcreate2(fid1, "Dataset2", H5T_STD_U8LE, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); CHECK(dset2, FAIL, "H5Dcreate2"); @@ -615,8 +640,8 @@ test_reference_region(void) CHECK(ret, FAIL, "H5Dread"); /* Try to open objects */ - dset2 = H5Rdereference(dset1, H5R_DATASET_REGION, &rbuf[0]); - CHECK(dset2, FAIL, "H5Rdereference"); + dset2 = H5Rdereference2(dset1, dapl_id, H5R_DATASET_REGION, &rbuf[0]); + CHECK(dset2, FAIL, "H5Rdereference2"); /* Check what H5Rget_obj_type2 function returns */ ret = H5Rget_obj_type2(dset1, H5R_DATASET_REGION, &rbuf[0], &obj_type); @@ -729,6 +754,10 @@ test_reference_region(void) ret = H5Dclose(dset1); CHECK(ret, FAIL, "H5Dclose"); + /* Close dataset access property list */ + ret = H5Pclose(dapl_id); + CHECK(ret, FAIL, "H5Pclose"); + /* Close file */ ret = H5Fclose(fid1); CHECK(ret, FAIL, "H5Fclose"); @@ -754,6 +783,7 @@ test_reference_region_1D(void) dset3; /* Dereferenced dataset ID */ hid_t sid1, /* Dataspace ID #1 */ sid3; /* Dataspace ID #3 */ + hid_t dapl_id; /* Dataset access property list */ hsize_t dims1[] = {SPACE1_DIM1}, dims3[] = {SPACE3_DIM1}; hsize_t start[SPACE3_RANK]; /* Starting location of hyperslab */ @@ -790,6 +820,10 @@ test_reference_region_1D(void) sid3 = H5Screate_simple(SPACE3_RANK, dims3, NULL); CHECK(sid3, FAIL, "H5Screate_simple"); + /* Create dataset access property list */ + dapl_id = H5Pcreate(H5P_DATASET_ACCESS); + CHECK(dapl_id, FAIL, "H5Pcreate"); + /* Create a dataset */ dset3 = H5Dcreate2(fid1, "Dataset2", H5T_STD_U8LE, sid3, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); CHECK(dset3, FAIL, "H5Dcreate2"); @@ -887,8 +921,8 @@ test_reference_region_1D(void) CHECK(ret, FAIL, "H5Dread"); /* Try to open objects */ - dset3 = H5Rdereference(dset1, H5R_DATASET_REGION, &rbuf[0]); - CHECK(dset3, FAIL, "H5Rdereference"); + dset3 = H5Rdereference2(dset1, dapl_id, H5R_DATASET_REGION, &rbuf[0]); + CHECK(dset3, FAIL, "H5Rdereference2"); /* Check what H5Rget_obj_type2 function returns */ ret = H5Rget_obj_type2(dset1, H5R_DATASET_REGION, &rbuf[0], &obj_type); @@ -1005,6 +1039,10 @@ test_reference_region_1D(void) ret = H5Dclose(dset1); CHECK(ret, FAIL, "H5Dclose"); + /* Close dataset access property list */ + ret = H5Pclose(dapl_id); + CHECK(ret, FAIL, "H5Pclose"); + /* Close file */ ret = H5Fclose(fid1); CHECK(ret, FAIL, "H5Fclose"); @@ -1094,13 +1132,13 @@ test_reference_obj_deleted(void) CHECK(ret, FAIL, "H5Dread"); /* Open deleted dataset object */ - dset2 = H5Rdereference(dataset, H5R_OBJECT, &oref); - VERIFY(dset2, FAIL, "H5Rdereference"); + dset2 = H5Rdereference2(dataset, H5P_DEFAULT, H5R_OBJECT, &oref); + VERIFY(dset2, FAIL, "H5Rdereference2"); /* Open nonsense reference */ HDmemset(&oref, 0, sizeof(hobj_ref_t)); - dset2 = H5Rdereference(dataset, H5R_OBJECT, &oref); - VERIFY(dset2, FAIL, "H5Rdereference"); + dset2 = H5Rdereference2(dataset, H5P_DEFAULT, H5R_OBJECT, &oref); + VERIFY(dset2, FAIL, "H5Rdereference2"); /* Close Dataset */ ret = H5Dclose(dataset); @@ -1238,8 +1276,8 @@ test_reference_group(void) CHECK(ret, FAIL, "H5Dread"); /* Dereference to get the group */ - gid = H5Rdereference(did, H5R_OBJECT, &rref); - CHECK(gid, FAIL, "H5Rdereference"); + gid = H5Rdereference2(did, H5P_DEFAULT, H5R_OBJECT, &rref); + CHECK(gid, FAIL, "H5Rdereference2"); /* Iterate through objects in dereferenced group */ ret = H5Literate(gid, H5_INDEX_NAME, H5_ITER_INC, NULL, test_deref_iter_op, &count); @@ -1286,11 +1324,11 @@ static void test_reference_compat(void) { hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t group; /* Group ID */ + hid_t dataset, dset2; /* Dataset ID */ + hid_t group, group2; /* Group ID */ hid_t sid1, /* Dataspace IDs */ sid2; - hid_t tid1; /* Datatype ID */ + hid_t tid1, tid2; /* Datatype ID */ hsize_t dims1[] = {SPACE1_DIM1}, dims2[] = {SPACE2_DIM1, SPACE2_DIM2}; hsize_t start[SPACE2_RANK]; /* Starting location of hyperslab */ @@ -1485,6 +1523,32 @@ test_reference_compat(void) CHECK(obj_type, H5G_UNKNOWN, "H5Rget_obj_type1"); VERIFY(obj_type, H5G_TYPE, "H5Rget_obj_type1"); + + /* Make sure the referenced objects can be opened */ + dset2 = H5Rdereference1(dataset, H5R_OBJECT, &rbuf_obj[0]); + CHECK(dset2, FAIL, "H5Rdereference1"); + + ret = H5Dclose(dset2); + CHECK(ret, FAIL, "H5Dclose"); + + dset2 = H5Rdereference1(dataset, H5R_OBJECT, &rbuf_obj[1]); + CHECK(dset2, FAIL, "H5Rdereference1"); + + ret = H5Dclose(dset2); + CHECK(ret, FAIL, "H5Dclose"); + + group2 = H5Rdereference1(dataset, H5R_OBJECT, &rbuf_obj[2]); + CHECK(group2, FAIL, "H5Rdereference1"); + + ret = H5Gclose(group2); + CHECK(ret, FAIL, "H5Gclose"); + + tid2 = H5Rdereference1(dataset, H5R_OBJECT, &rbuf_obj[3]); + CHECK(tid2, FAIL, "H5Rdereference1"); + + ret = H5Tclose(tid2); + CHECK(ret, FAIL, "H5Tclose"); + /* Close Dataset */ ret = H5Dclose(dataset); CHECK(ret, FAIL, "H5Dclose"); @@ -1513,11 +1577,23 @@ test_reference_compat(void) obj_type = H5Rget_obj_type1(dataset, H5R_DATASET_REGION, &rbuf_reg[3]); VERIFY(obj_type, H5G_UNKNOWN, "H5Rget_obj_type1"); + /* Make sure the referenced objects can be opened */ + dset2 = H5Rdereference1(dataset, H5R_DATASET_REGION, &rbuf_reg[0]); + CHECK(dset2, FAIL, "H5Rdereference1"); + + ret = H5Dclose(dset2); + CHECK(ret, FAIL, "H5Dclose"); + + dset2 = H5Rdereference1(dataset, H5R_DATASET_REGION, &rbuf_reg[1]); + CHECK(dset2, FAIL, "H5Rdereference1"); + + ret = H5Dclose(dset2); + CHECK(ret, FAIL, "H5Dclose"); + /* Close Dataset */ ret = H5Dclose(dataset); CHECK(ret, FAIL, "H5Dclose"); - /* Close file */ ret = H5Fclose(fid1); CHECK(ret, FAIL, "H5Fclose"); diff --git a/test/tskiplist.c b/test/tskiplist.c index 8510db2..8966e39 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); + slist = H5SL_create(H5SL_TYPE_INT, NULL); 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); + slist = H5SL_create(H5SL_TYPE_INT, NULL); CHECK(slist, NULL, "H5SL_create"); /* Check that the skip list has no elements */ @@ -160,7 +160,7 @@ test_skiplist_insert(void) /* Try searching for item in empty skip list */ key=37; - found_item=H5SL_search(slist,&key); + found_item=(int *)H5SL_search(slist,&key); VERIFY(found_item, NULL, "H5SL_search"); /* Insert an object into the skip list */ @@ -173,13 +173,13 @@ test_skiplist_insert(void) VERIFY(num, 1, "H5SL_count"); /* Search for the item just inserted */ - found_item=H5SL_search(slist,&key); + found_item=(int *)H5SL_search(slist,&key); CHECK(found_item, NULL, "H5SL_search"); VERIFY(*found_item,item,"H5SL_search"); /* Search for an item not in list */ search_key=37; - found_item=H5SL_search(slist,&search_key); + found_item=(int *)H5SL_search(slist,&search_key); VERIFY(found_item, NULL, "H5SL_search"); /* Attempt to insert duplicate key (should fail) */ @@ -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); + slist = H5SL_create(H5SL_TYPE_INT, NULL); CHECK(slist, NULL, "H5SL_create"); /* Check that the skip list has no elements */ @@ -231,7 +231,7 @@ test_skiplist_insert_many(void) /* Search for all objects in the skip list */ for(u=0; ui, hashed_data[u].i, "H5SL_next"); u++; node=H5SL_next(node); @@ -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); + slist = H5SL_create(H5SL_TYPE_INT, NULL); 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); + slist = H5SL_create(H5SL_TYPE_HSIZE, NULL); CHECK(slist, NULL, "H5SL_create"); /* Check that the skip list has no elements */ @@ -691,7 +691,7 @@ test_skiplist_hsize(void) node=H5SL_first(slist); u=0; while(node!=NULL) { - found_item=H5SL_item(node); + found_item=(hsize_t *)H5SL_item(node); VERIFY(*found_item,sorted_data[u],"H5SL_next"); u++; node=H5SL_next(node); @@ -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); + slist = H5SL_create(H5SL_TYPE_UNSIGNED, NULL); CHECK(slist, NULL, "H5SL_create"); /* Check that the skip list has no elements */ @@ -746,7 +746,7 @@ test_skiplist_unsigned(void) node=H5SL_first(slist); u=0; while(node!=NULL) { - found_item=H5SL_item(node); + found_item=(unsigned *)H5SL_item(node); VERIFY(*found_item,sorted_data[u],"H5SL_next"); u++; node=H5SL_next(node); @@ -760,6 +760,140 @@ test_skiplist_unsigned(void) /**************************************************************** ** +** test_skiplist_obj(): Test H5SL (skip list) code. +** Tests using H5_obj_t's for keys in skip lists. +** +****************************************************************/ +static void +test_skiplist_obj(void) +{ + H5SL_t *slist; /* Skip list created */ + H5SL_node_t *node; /* Skip list node */ + size_t num; /* Number of elements in skip list */ + size_t u; /* Local index variable */ + H5_obj_t data[10]={ {10, 12}, {20, 12}, {10, 32}, {10, 11}, {50, 1}, {8, 12}, {31, 12}, {20, 11}, {31, 11}, {8, 32} }; + H5_obj_t sorted_data[10]={ {8, 12}, {8, 32}, {10, 11}, {10, 12}, {10, 32}, {20, 11}, {20, 12}, {31, 11}, {31, 12}, {50, 1} }; + H5_obj_t *found_item; /* Item found in skip list */ + herr_t ret; /* Generic return value */ + + /* Output message about test being performed */ + MESSAGE(7, ("Testing Skip List With H5_obj_t Keys\n")); + + /* Create a skip list */ + slist = H5SL_create(H5SL_TYPE_OBJ, NULL); + CHECK(slist, NULL, "H5SL_create"); + + /* Check that the skip list has no elements */ + num=H5SL_count(slist); + VERIFY(num, 0, "H5SL_count"); + + /* Insert objects into the skip list */ + for(u=0; u<10; u++) { + ret=H5SL_insert(slist,&data[u],&data[u]); + CHECK(ret, FAIL, "H5SL_insert"); + } /* end for */ + + /* Check that the skip list has correct # of elements */ + num=H5SL_count(slist); + VERIFY(num, 10, "H5SL_count"); + + /* Iterate over all the nodes in the skip list */ + node=H5SL_first(slist); + u=0; + while(node!=NULL) { + found_item=(H5_obj_t *)H5SL_item(node); + VERIFY(found_item->fileno,sorted_data[u].fileno,"H5SL_next"); + VERIFY(found_item->addr,sorted_data[u].addr,"H5SL_next"); + u++; + node=H5SL_next(node); + } /* end while */ + + /* Close the skip list */ + ret=H5SL_close(slist); + CHECK(ret, FAIL, "H5SL_close"); + +} /* end test_skiplist_obj() */ + +/**************************************************************** +** +** test_skiplist_generic(): Test H5SL (skip list) code. +** Tests using generic keys in skip lists. Define +** structure for keys, and define comparison using +** key.a-key.b. +** +****************************************************************/ +typedef struct generic_t { + unsigned a; + unsigned b; +} generic_t; + +static int +test_skiplist_generic_cmp(const void *_key1, const void *_key2) +{ + const generic_t *key1 = (const generic_t *)_key1; + const generic_t *key2 = (const generic_t *)_key2; + long long result = (long long)(key1->a) - (long long)(key1->b) - (long long)(key2->a) + (long long)(key2->b); + + if(result < 0) + return -1; + else if(result > 0) + return 1; + else + return 0; +} /* end test_skiplist_generic_cmp */ + +static void +test_skiplist_generic(void) +{ + H5SL_t *slist; /* Skip list created */ + H5SL_node_t *node; /* Skip list node */ + size_t num; /* Number of elements in skip list */ + size_t u; /* Local index variable */ + generic_t data[10]={ {10, 1}, {20, 13}, {15, 32}, {5, 2}, {50, 37}, {30, 100}, {31, 38}, {32, 34}, {80, 32}, {90, 0} }; + generic_t sorted_data[10]={ {30, 100}, {15, 32}, {31, 38}, {32, 34}, {5, 2}, {20, 13}, {10, 1}, {50, 37}, {80, 32}, {90, 0} }; + generic_t *found_item; /* Item found in skip list */ + herr_t ret; /* Generic return value */ + + /* Output message about test being performed */ + MESSAGE(7, ("Testing Skip List With generic Keys\n")); + + /* Create a skip list */ + slist = H5SL_create(H5SL_TYPE_GENERIC, test_skiplist_generic_cmp); + CHECK(slist, NULL, "H5SL_create"); + + /* Check that the skip list has no elements */ + num=H5SL_count(slist); + VERIFY(num, 0, "H5SL_count"); + + /* Insert objects into the skip list */ + for(u=0; u<10; u++) { + ret=H5SL_insert(slist,&data[u],&data[u]); + CHECK(ret, FAIL, "H5SL_insert"); + } /* end for */ + + /* Check that the skip list has correct # of elements */ + num=H5SL_count(slist); + VERIFY(num, 10, "H5SL_count"); + + /* Iterate over all the nodes in the skip list */ + node=H5SL_first(slist); + u=0; + while(node!=NULL) { + found_item=(generic_t *)H5SL_item(node); + VERIFY(found_item->a,sorted_data[u].a,"H5SL_next"); + VERIFY(found_item->b,sorted_data[u].b,"H5SL_next"); + u++; + node=H5SL_next(node); + } /* end while */ + + /* Close the skip list */ + ret=H5SL_close(slist); + CHECK(ret, FAIL, "H5SL_close"); + +} /* end test_skiplist_generic() */ + +/**************************************************************** +** ** test_skiplist_lastprev(): Test H5SL (skip list) code. ** Tests iterating over nodes in skip list with last/prev calls. ** @@ -778,7 +912,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); + slist = H5SL_create(H5SL_TYPE_INT, NULL); CHECK(slist, NULL, "H5SL_create"); /* Check that the skip list has no elements */ @@ -804,7 +938,7 @@ test_skiplist_lastprev(void) CHECK(node, NULL, "H5SL_last"); u=NUM_ELEMS-1; while(node!=NULL) { - found_item=H5SL_item(node); + found_item=(int *)H5SL_item(node); VERIFY(*found_item,sort_rand_num[u],"H5SL_prev"); u--; node=H5SL_prev(node); @@ -846,7 +980,7 @@ test_skiplist_find(void) MESSAGE(7, ("Testing Skip List 'Find' Operation\n")); /* Create a skip list */ - slist = H5SL_create(H5SL_TYPE_UNSIGNED); + slist = H5SL_create(H5SL_TYPE_UNSIGNED, NULL); CHECK(slist, NULL, "H5SL_create"); /* Insert objects into the skip list */ @@ -863,7 +997,7 @@ test_skiplist_find(void) /* Iterate over the rest of the nodes in the skip list */ u=4; while(node!=NULL) { - found_item=H5SL_item(node); + found_item=(unsigned *)H5SL_item(node); VERIFY(*found_item,sorted_data[u],"H5SL_next"); u++; node=H5SL_next(node); @@ -902,7 +1036,7 @@ test_skiplist_add(void) MESSAGE(7, ("Testing Skip List 'Add' Operation\n")); /* Create a skip list */ - slist = H5SL_create(H5SL_TYPE_UNSIGNED); + slist = H5SL_create(H5SL_TYPE_UNSIGNED, NULL); CHECK(slist, NULL, "H5SL_create"); /* Insert objects into the skip list */ @@ -923,7 +1057,7 @@ test_skiplist_add(void) /* Iterate over the rest of the nodes in the skip list */ u=2; while(node!=NULL) { - found_item=H5SL_item(node); + found_item=(unsigned *)H5SL_item(node); VERIFY(*found_item,sorted_data[u],"H5SL_item"); u++; node=H5SL_next(node); @@ -964,7 +1098,7 @@ test_skiplist_destroy(void) MESSAGE(7, ("Testing Skip List 'Destroy' Operation\n")); /* Create a skip list */ - slist = H5SL_create(H5SL_TYPE_INT); + slist = H5SL_create(H5SL_TYPE_INT, NULL); CHECK(slist, NULL, "H5SL_create"); /* Insert objects into the skip list */ @@ -1000,7 +1134,7 @@ test_skiplist_free(void) MESSAGE(7, ("Testing Skip List 'Free' Operation\n")); /* Create a skip list */ - slist = H5SL_create(H5SL_TYPE_INT); + slist = H5SL_create(H5SL_TYPE_INT, NULL); CHECK(slist, NULL, "H5SL_create"); /* Insert objects into the skip list */ @@ -1056,7 +1190,7 @@ test_skiplist_less(void) MESSAGE(7, ("Testing Skip List 'Less' Operation\n")); /* Create a skip list */ - slist = H5SL_create(H5SL_TYPE_UNSIGNED); + slist = H5SL_create(H5SL_TYPE_UNSIGNED, NULL); CHECK(slist, NULL, "H5SL_create"); /* Insert objects into the skip list */ @@ -1067,30 +1201,30 @@ test_skiplist_less(void) /* Check for exact match of items in various positions */ find_item=20; - found_item=H5SL_less(slist,&find_item); + found_item=(unsigned *)H5SL_less(slist,&find_item); VERIFY(*found_item,find_item,"H5SL_less"); find_item=90; - found_item=H5SL_less(slist,&find_item); + found_item=(unsigned *)H5SL_less(slist,&find_item); VERIFY(*found_item,find_item,"H5SL_less"); find_item=5; - found_item=H5SL_less(slist,&find_item); + found_item=(unsigned *)H5SL_less(slist,&find_item); VERIFY(*found_item,find_item,"H5SL_less"); /* Find item less than a missing key, in various positions */ find_item=19; - found_item=H5SL_less(slist,&find_item); + found_item=(unsigned *)H5SL_less(slist,&find_item); VERIFY(*found_item,15,"H5SL_less"); find_item=89; - found_item=H5SL_less(slist,&find_item); + found_item=(unsigned *)H5SL_less(slist,&find_item); VERIFY(*found_item,80,"H5SL_less"); find_item=100; - found_item=H5SL_less(slist,&find_item); + found_item=(unsigned *)H5SL_less(slist,&find_item); VERIFY(*found_item,90,"H5SL_less"); find_item=9; - found_item=H5SL_less(slist,&find_item); + found_item=(unsigned *)H5SL_less(slist,&find_item); VERIFY(*found_item,5,"H5SL_less"); find_item=4; - found_item=H5SL_less(slist,&find_item); + found_item=(unsigned *)H5SL_less(slist,&find_item); VERIFY(found_item,NULL,"H5SL_less"); /* Close the skip list */ @@ -1120,7 +1254,7 @@ test_skiplist_greater(void) MESSAGE(7, ("Testing Skip List 'Greater' Operation\n")); /* Create a skip list */ - slist = H5SL_create(H5SL_TYPE_UNSIGNED); + slist = H5SL_create(H5SL_TYPE_UNSIGNED, NULL); CHECK(slist, NULL, "H5SL_create"); /* Insert objects into the skip list */ @@ -1131,30 +1265,30 @@ test_skiplist_greater(void) /* Check for exact match of items in various positions */ find_item = 20; - found_item = H5SL_greater(slist, &find_item); + found_item = (unsigned *)H5SL_greater(slist, &find_item); VERIFY(*found_item, find_item, "H5SL_greater"); find_item = 90; - found_item = H5SL_greater(slist, &find_item); + found_item = (unsigned *)H5SL_greater(slist, &find_item); VERIFY(*found_item, find_item, "H5SL_greater"); find_item = 5; - found_item = H5SL_greater(slist, &find_item); + found_item = (unsigned *)H5SL_greater(slist, &find_item); VERIFY(*found_item, find_item, "H5SL_greater"); /* Find item greater than a missing key, in various positions */ find_item = 19; - found_item = H5SL_greater(slist,&find_item); + found_item = (unsigned *)H5SL_greater(slist,&find_item); VERIFY(*found_item, 20, "H5SL_greater"); find_item = 89; - found_item = H5SL_greater(slist, &find_item); + found_item = (unsigned *)H5SL_greater(slist, &find_item); VERIFY(*found_item, 90, "H5SL_greater"); find_item = 100; - found_item = H5SL_greater(slist, &find_item); + found_item = (unsigned *)H5SL_greater(slist, &find_item); VERIFY(found_item, NULL, "H5SL_greater"); find_item = 6; - found_item = H5SL_greater(slist, &find_item); + found_item = (unsigned *)H5SL_greater(slist, &find_item); VERIFY(*found_item, 10, "H5SL_greater"); find_item = 4; - found_item = H5SL_greater(slist, &find_item); + found_item = (unsigned *)H5SL_greater(slist, &find_item); VERIFY(*found_item, 5, "H5SL_greater"); /* Close the skip list */ @@ -1185,7 +1319,7 @@ test_skiplist_below(void) MESSAGE(7, ("Testing Skip List 'Below' Operation\n")); /* Create a skip list */ - slist = H5SL_create(H5SL_TYPE_UNSIGNED); + slist = H5SL_create(H5SL_TYPE_UNSIGNED, NULL); CHECK(slist, NULL, "H5SL_create"); /* Insert objects into the skip list */ @@ -1198,42 +1332,42 @@ test_skiplist_below(void) find_item = 20; node = H5SL_below(slist, &find_item); CHECK(node, NULL, "H5SL_below"); - found_item = H5SL_item(node); + found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, find_item, "H5SL_below"); find_item = 90; node = H5SL_below(slist, &find_item); CHECK(node, NULL, "H5SL_below"); - found_item = H5SL_item(node); + found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, find_item, "H5SL_below"); find_item = 5; node = H5SL_below(slist, &find_item); CHECK(node, NULL, "H5SL_below"); - found_item = H5SL_item(node); + found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, find_item, "H5SL_below"); /* Find item less than a missing key, in various positions */ find_item = 19; node = H5SL_below(slist, &find_item); CHECK(node, NULL, "H5SL_below"); - found_item = H5SL_item(node); + found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, 15, "H5SL_below"); find_item = 89; node = H5SL_below(slist, &find_item); CHECK(node, NULL, "H5SL_below"); - found_item = H5SL_item(node); + found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, 80, "H5SL_below"); find_item = 100; node = H5SL_below(slist, &find_item); CHECK(node, NULL, "H5SL_below"); - found_item = H5SL_item(node); + found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, 90, "H5SL_below"); find_item = 9; node = H5SL_below(slist, &find_item); CHECK(node, NULL, "H5SL_below"); - found_item = H5SL_item(node); + found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, 5, "H5SL_below"); find_item = 4; - node = H5SL_less(slist, &find_item); + node = (H5SL_node_t *)H5SL_less(slist, &find_item); VERIFY(node, NULL, "H5SL_below"); /* Close the skip list */ @@ -1264,7 +1398,7 @@ test_skiplist_above(void) MESSAGE(7, ("Testing Skip List 'Above' Operation\n")); /* Create a skip list */ - slist = H5SL_create(H5SL_TYPE_UNSIGNED); + slist = H5SL_create(H5SL_TYPE_UNSIGNED, NULL); CHECK(slist, NULL, "H5SL_create"); /* Insert objects into the skip list */ @@ -1277,29 +1411,29 @@ test_skiplist_above(void) find_item = 20; node = H5SL_above(slist, &find_item); CHECK(node, NULL, "H5SL_above"); - found_item = H5SL_item(node); + found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, find_item, "H5SL_above"); find_item = 90; node = H5SL_above(slist, &find_item); CHECK(node, NULL, "H5SL_above"); - found_item = H5SL_item(node); + found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, find_item, "H5SL_above"); find_item = 5; node = H5SL_above(slist, &find_item); CHECK(node, NULL, "H5SL_above"); - found_item = H5SL_item(node); + found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, find_item, "H5SL_above"); /* Find item greater than a missing key, in various positions */ find_item = 19; node = H5SL_above(slist, &find_item); CHECK(node, NULL, "H5SL_above"); - found_item = H5SL_item(node); + found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, 20, "H5SL_above"); find_item = 89; node = H5SL_above(slist, &find_item); CHECK(node, NULL, "H5SL_above"); - found_item = H5SL_item(node); + found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, 90, "H5SL_above"); find_item = 100; node = H5SL_above(slist, &find_item); @@ -1307,12 +1441,12 @@ test_skiplist_above(void) find_item = 6; node = H5SL_above(slist, &find_item); CHECK(node, NULL, "H5SL_above"); - found_item = H5SL_item(node); + found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, 10, "H5SL_above"); find_item = 4; node = H5SL_above(slist, &find_item); CHECK(node, NULL, "H5SL_above"); - found_item = H5SL_item(node); + found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, 5, "H5SL_above"); /* Close the skip list */ @@ -1341,7 +1475,7 @@ test_skiplist_remove_first(void) MESSAGE(7, ("Testing Skip List 'Remove First' Operation\n")); /* Create a skip list */ - slist = H5SL_create(H5SL_TYPE_UNSIGNED); + slist = H5SL_create(H5SL_TYPE_UNSIGNED, NULL); CHECK(slist, NULL, "H5SL_create"); /* Insert objects into the skip list */ @@ -1352,12 +1486,12 @@ test_skiplist_remove_first(void) /* Remove objects from the skip list */ for(u = 0; u < 10; u++) { - found_item = H5SL_remove_first(slist); + found_item = (unsigned *)H5SL_remove_first(slist); VERIFY(*found_item, sorted_data[u], "H5SL_remove_first"); } /* end for */ /* Check for removing object from empty list */ - found_item = H5SL_remove_first(slist); + found_item = (unsigned *)H5SL_remove_first(slist); VERIFY(found_item, NULL, "H5SL_remove_first"); /* Close the skip list */ @@ -1385,7 +1519,7 @@ test_skiplist_remove_first_many(void) MESSAGE(7, ("Testing Skip List 'Remove First' Operation\n")); /* Create a skip list */ - slist = H5SL_create(H5SL_TYPE_INT); + slist = H5SL_create(H5SL_TYPE_INT, NULL); CHECK(slist, NULL, "H5SL_create"); /* Insert objects into the skip list */ @@ -1436,6 +1570,8 @@ test_skiplist(void) test_skiplist_iterate(); /* Test iteration over skip list nodes with callback */ test_skiplist_hsize(); /* Test skip list hsize_t keys */ test_skiplist_unsigned(); /* Test skip list unsigned keys */ + test_skiplist_obj(); /* Test skip list H5_obj_t keys */ + test_skiplist_generic(); /* Test skip list generic keys */ test_skiplist_lastprev(); /* Test iteration over skip list nodes with last/prev */ test_skiplist_find(); /* Test 'find' operation */ test_skiplist_add(); /* Test 'add' operation */ diff --git a/test/tunicode.c b/test/tunicode.c index 892e563..3b949e9 100644 --- a/test/tunicode.c +++ b/test/tunicode.c @@ -464,8 +464,8 @@ void test_objnames(hid_t fid, const char* string) CHECK(ret, FAIL, "H5Dread"); /* Ensure that we can open named datatype using object reference */ - type_id = H5Rdereference(dset_id, H5R_OBJECT, &obj_ref); - CHECK(type_id, FAIL, "H5Rdereference"); + type_id = H5Rdereference2(dset_id, H5P_DEFAULT, H5R_OBJECT, &obj_ref); + CHECK(type_id, FAIL, "H5Rdereference2"); ret = H5Tcommitted(type_id); VERIFY(ret, 1, "H5Tcommitted"); diff --git a/test/unlink.c b/test/unlink.c index 604b014..993a7ec 100644 --- a/test/unlink.c +++ b/test/unlink.c @@ -2221,9 +2221,9 @@ test_full_group_compact(hid_t fapl) } /* end for */ /* Check on group's status */ - if(H5G_is_empty_test(gid) == TRUE) TEST_ERROR - if(H5G_has_links_test(gid, NULL) != TRUE) TEST_ERROR - if(H5G_has_stab_test(gid) == TRUE) TEST_ERROR + if(H5G__is_empty_test(gid) == TRUE) TEST_ERROR + if(H5G__has_links_test(gid, NULL) != TRUE) TEST_ERROR + if(H5G__has_stab_test(gid) == TRUE) TEST_ERROR /* Close group with objects to delete */ if(H5Gclose(gid) < 0) FAIL_STACK_ERROR @@ -2367,9 +2367,9 @@ test_full_group_dense(hid_t fapl) } /* end for */ /* Check on group's status */ - if(H5G_is_empty_test(gid) == TRUE) TEST_ERROR - if(H5G_has_links_test(gid, NULL) == TRUE) TEST_ERROR - if(H5G_is_new_dense_test(gid) != TRUE) TEST_ERROR + if(H5G__is_empty_test(gid) == TRUE) TEST_ERROR + if(H5G__has_links_test(gid, NULL) == TRUE) TEST_ERROR + if(H5G__is_new_dense_test(gid) != TRUE) TEST_ERROR /* Close group with objects to delete */ if(H5Gclose(gid) < 0) FAIL_STACK_ERROR diff --git a/test/vfd.c b/test/vfd.c index 9fe0e9e..f6e9f06 100644 --- a/test/vfd.c +++ b/test/vfd.c @@ -50,13 +50,14 @@ const char *FILENAME[] = { "log_file", /*6*/ "stdio_file", /*7*/ "windows_file", /*8*/ + "new_multi_file_v16",/*9*/ NULL }; #define LOG_FILENAME "log_vfd_out.log" #define COMPAT_BASENAME "family_v16_" - +#define MULTI_COMPAT_BASENAME "multi_file_v16" /*------------------------------------------------------------------------- @@ -75,9 +76,9 @@ const char *FILENAME[] = { static herr_t test_sec2(void) { - hid_t file = -1; - hid_t fapl = -1; - hid_t access_fapl = -1; + hid_t file = -1; + hid_t fapl = -1; + hid_t access_fapl = -1; char filename[1024]; int *fhandle = NULL; hsize_t file_size = 0; @@ -156,18 +157,18 @@ test_direct(void) { #ifdef H5_HAVE_DIRECT hid_t file=(-1), fapl, access_fapl = -1; - hid_t dset1=-1, dset2=-1, space1=-1, space2=-1; + hid_t dset1=-1, dset2=-1, space1=-1, space2=-1; char filename[1024]; int *fhandle=NULL; hsize_t file_size; - hsize_t dims1[2], dims2[1]; - size_t mbound; - size_t fbsize; - size_t cbsize; - int *points, *check, *p1, *p2; - int wdata2[DSET2_DIM] = {11,12,13,14}; - int rdata2[DSET2_DIM]; - int i, j, n; + hsize_t dims1[2], dims2[1]; + size_t mbound; + size_t fbsize; + size_t cbsize; + int *points, *check, *p1, *p2; + int wdata2[DSET2_DIM] = {11,12,13,14}; + int rdata2[DSET2_DIM]; + int i, j, n; #endif /*H5_HAVE_DIRECT*/ TESTING("DIRECT I/O file driver"); @@ -188,10 +189,10 @@ test_direct(void) if(H5Pget_fapl_direct(fapl, &mbound, &fbsize, &cbsize) < 0) TEST_ERROR; if(mbound != MBOUNDARY || fbsize != FBSIZE || cbsize != CBSIZE) - TEST_ERROR; + TEST_ERROR; if(H5Pset_alignment(fapl, (hsize_t)THRESHOLD, (hsize_t)FBSIZE) < 0) - TEST_ERROR; + TEST_ERROR; H5E_BEGIN_TRY { file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); @@ -199,7 +200,7 @@ test_direct(void) if(file<0) { H5Pclose (fapl); SKIPPED(); - printf(" Probably the file system doesn't support Direct I/O\n"); + printf(" Probably the file system doesn't support Direct I/O\n"); return 0; } @@ -243,8 +244,8 @@ test_direct(void) /* Initialize the dset1 */ p1 = points; for(i = n = 0; i < DSET1_DIM1; i++) - for(j = 0; j < DSET1_DIM2; j++) - *p1++ = n++; + for(j = 0; j < DSET1_DIM2; j++) + *p1++ = n++; /* Create the data space1 */ dims1[0] = DSET1_DIM1; @@ -274,13 +275,13 @@ test_direct(void) p1 = points; p2 = check; for(i = 0; i < DSET1_DIM1; i++) - for(j = 0; j < DSET1_DIM2; j++) - if(*p1++ != *p2++) { - H5_FAILED(); - printf(" Read different values than written in data set 1.\n"); - printf(" At index %d,%d\n", i, j); - TEST_ERROR; - } /* end if */ + for(j = 0; j < DSET1_DIM2; j++) + if(*p1++ != *p2++) { + H5_FAILED(); + printf(" Read different values than written in data set 1.\n"); + printf(" At index %d,%d\n", i, j); + TEST_ERROR; + } /* end if */ /* Create the data space2. For data set 2, memory address and data size are not aligned. */ dims2[0] = DSET2_DIM; @@ -307,12 +308,12 @@ test_direct(void) /* Check that the values read are the same as the values written */ for(i = 0; i < DSET2_DIM; i++) - if(wdata2[i] != rdata2[i]) { - H5_FAILED(); - printf(" Read different values than written in data set 2.\n"); - printf(" At index %d\n", i); + if(wdata2[i] != rdata2[i]) { + H5_FAILED(); + printf(" Read different values than written in data set 2.\n"); + printf(" At index %d\n", i); TEST_ERROR; - } /* end if */ + } /* end if */ if(H5Sclose(space1) < 0) TEST_ERROR; @@ -325,9 +326,9 @@ test_direct(void) if(H5Fclose(file) < 0) TEST_ERROR; if(points) - free(points); + free(points); if(check) - free(check); + free(check); h5_cleanup(FILENAME, fapl); PASSED(); @@ -367,10 +368,10 @@ test_core(void) char filename[1024]; void *fhandle=NULL; hsize_t file_size; - int *points, *check, *p1, *p2; - hid_t dset1=-1, space1=-1; - hsize_t dims1[2]; - int i, j, n; + int *points, *check, *p1, *p2; + hid_t dset1=-1, space1=-1; + hsize_t dims1[2]; + int i, j, n; TESTING("CORE file driver"); @@ -432,8 +433,8 @@ test_core(void) /* Initialize the dset1 */ p1 = points; for(i = n = 0; i < DSET1_DIM1; i++) - for(j = 0; j < DSET1_DIM2; j++) - *p1++ = n++; + for(j = 0; j < DSET1_DIM2; j++) + *p1++ = n++; /* Create the data space1 */ dims1[0] = DSET1_DIM1; @@ -463,13 +464,13 @@ test_core(void) p1 = points; p2 = check; for(i = 0; i < DSET1_DIM1; i++) - for(j = 0; j < DSET1_DIM2; j++) - if(*p1++ != *p2++) { - H5_FAILED(); - printf(" Read different values than written in data set 1.\n"); - printf(" At index %d,%d\n", i, j); - TEST_ERROR; - } /* end if */ + for(j = 0; j < DSET1_DIM2; j++) + if(*p1++ != *p2++) { + H5_FAILED(); + printf(" Read different values than written in data set 1.\n"); + printf(" At index %d,%d\n", i, j); + TEST_ERROR; + } /* end if */ if(H5Dclose(dset1) < 0) TEST_ERROR; @@ -501,7 +502,7 @@ test_core(void) /* Reallocate memory for reading buffer. */ if(check) - free(check); + free(check); check = (int*)malloc(DSET1_DIM1 * DSET1_DIM2 * sizeof(int)); @@ -513,13 +514,13 @@ test_core(void) p1 = points; p2 = check; for(i = 0; i < DSET1_DIM1; i++) - for(j = 0; j < DSET1_DIM2; j++) - if(*p1++ != *p2++) { - H5_FAILED(); - printf(" Read different values than written in data set 1.\n"); - printf(" At index %d,%d\n", i, j); - TEST_ERROR; - } /* end if */ + for(j = 0; j < DSET1_DIM2; j++) + if(*p1++ != *p2++) { + H5_FAILED(); + printf(" Read different values than written in data set 1.\n"); + printf(" At index %d,%d\n", i, j); + TEST_ERROR; + } /* end if */ /* Check file size API */ if(H5Fget_filesize(file, &file_size) < 0) @@ -537,9 +538,9 @@ test_core(void) if(H5Fclose(file) < 0) TEST_ERROR; if(points) - free(points); + free(points); if(check) - free(check); + free(check); h5_cleanup(FILENAME, fapl); @@ -1123,6 +1124,176 @@ error: /*------------------------------------------------------------------------- + * Function: test_multi_compat + * + * Purpose: Tests the backward compatibility for MULTI driver. + * See if we can open files created with v1.6 library. + * The source file was created by the test/file_handle.c + * of the v1.6 library. This test verifies the fix for + * Issue 2598. In v1.6 library, there was EOA for the whole + * MULTI file saved in the super block. We took it out in + * v1.8 library because it's meaningless for the MULTI file. + * v1.8 library saves the EOA for the metadata file, instead. + * + * Return: Success: 0 + * Failure: -1 + * + * Programmer: Raymond Lu + * 21 June 2011 + * + *------------------------------------------------------------------------- + */ +static herr_t +test_multi_compat(void) +{ + hid_t file=(-1), fapl, fapl2=(-1), dset=(-1), space=(-1); + hid_t access_fapl = -1; + char filename[1024], newname[1024], tmp[1024]; + char filename_s[1024], newname_s[1024]; + char filename_r[1024], newname_r[1024]; + int *fhandle2=NULL, *fhandle=NULL; + hsize_t file_size; + H5FD_mem_t mt, memb_map[H5FD_MEM_NTYPES]; + hid_t memb_fapl[H5FD_MEM_NTYPES]; + haddr_t memb_addr[H5FD_MEM_NTYPES]; + const char *memb_name[H5FD_MEM_NTYPES]; + char sv[H5FD_MEM_NTYPES][32]; + hsize_t dims[2]={MULTI_SIZE, MULTI_SIZE}; + char dname[]="dataset2"; + int i, j; + int buf[MULTI_SIZE][MULTI_SIZE]; + + TESTING("MULTI file driver backward compatibility"); + + /* Set file access property list for MULTI driver */ + fapl = h5_fileaccess(); + + HDmemset(memb_map, 0, sizeof memb_map); + HDmemset(memb_fapl, 0, sizeof memb_fapl); + HDmemset(memb_name, 0, sizeof memb_name); + HDmemset(memb_addr, 0, sizeof memb_addr); + HDmemset(sv, 0, sizeof sv); + + for(mt=H5FD_MEM_DEFAULT; mt 1 ? "S" : ""); - return 1; + printf("***** %d Virtual File Driver TEST%s FAILED! *****\n", + nerrors, nerrors > 1 ? "S" : ""); + return 1; } printf("All Virtual File Driver tests passed.\n"); diff --git a/test/vms_data.h5 b/test/vms_data.h5 deleted file mode 100644 index 14aeef2..0000000 Binary files a/test/vms_data.h5 and /dev/null differ diff --git a/testpar/CMakeLists.txt b/testpar/CMakeLists.txt index 40db59f..d60aea5 100644 --- a/testpar/CMakeLists.txt +++ b/testpar/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8) +cmake_minimum_required (VERSION 2.8.6) PROJECT (HDF5_TEST_PAR) INCLUDE_DIRECTORIES (${HDF5_TEST_SRC_DIR}) @@ -22,21 +22,23 @@ SET (testphdf5_SRCS #-- Adding test for testhdf5 ADD_EXECUTABLE (testphdf5 ${testphdf5_SRCS}) TARGET_NAMING (testphdf5 ${LIB_TYPE}) -TARGET_LINK_LIBRARIES (testphdf5 ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) +TARGET_LINK_LIBRARIES (testphdf5 ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} ${LINK_LIBS}) +SET_TARGET_PROPERTIES (testphdf5 PROPERTIES FOLDER test/par) -ADD_TEST (NAME testphdf5 COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) +ADD_TEST (NAME TEST_PAR_testphdf5 COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) MACRO (ADD_H5P_TEST file) ADD_EXECUTABLE (${file} ${HDF5_TEST_PAR_SOURCE_DIR}/${file}.c) TARGET_NAMING (${file} ${LIB_TYPE}) - TARGET_LINK_LIBRARIES (${file} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) + TARGET_LINK_LIBRARIES (${file} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} ${LINK_LIBS}) + SET_TARGET_PROPERTIES (${file} PROPERTIES FOLDER test/par) - ADD_TEST (NAME ${file} COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $ -p) + ADD_TEST (NAME TEST_PAR_${file} COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) ENDMACRO (ADD_H5P_TEST file) SET (H5P_TESTS t_mpi - t_posix_compliant +# t_posix_compliant t_cache t_pflush1 t_pflush2 @@ -44,9 +46,15 @@ SET (H5P_TESTS ) FOREACH (testp ${H5P_TESTS}) - ADD_H5P_TEST(${testp}) + ADD_H5P_TEST(${testp}) ENDFOREACH (testp ${H5P_TESTS}) +SET_TESTS_PROPERTIES(TEST_PAR_t_pflush2 PROPERTIES DEPENDS TEST_PAR_t_pflush1) + +IF (NOT WIN32) + ADD_H5P_TEST(t_posix_compliant) +ENDIF (NOT WIN32) + IF (HDF5_TEST_VFD) SET (VFD_LIST @@ -91,4 +99,3 @@ IF (HDF5_TEST_VFD) ENDFOREACH (vfd ${VFD_LIST}) ENDIF (HDF5_TEST_VFD) - diff --git a/testpar/Makefile.in b/testpar/Makefile.in index b273ebb..ae0c7d0 100644 --- a/testpar/Makefile.in +++ b/testpar/Makefile.in @@ -202,6 +202,7 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ +FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ @@ -222,10 +223,12 @@ H5_LONE_COLON = @H5_LONE_COLON@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ +HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ +HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ diff --git a/testpar/t_cache.c b/testpar/t_cache.c index b0cad48..14e03c0 100644 --- a/testpar/t_cache.c +++ b/testpar/t_cache.c @@ -49,6 +49,9 @@ hid_t noblock_dxpl_id=(-1); #define NFILENAME 2 #define PARATESTFILE filenames[0] const char *FILENAME[NFILENAME]={"CacheTestDummy", NULL}; +#ifndef PATH_MAX +#define PATH_MAX 512 +#endif /* !PATH_MAX */ char filenames[NFILENAME][PATH_MAX]; hid_t fapl; /* file access property list */ diff --git a/testpar/t_chunk_alloc.c b/testpar/t_chunk_alloc.c index bb13d4e..e8a6ca4 100644 --- a/testpar/t_chunk_alloc.c +++ b/testpar/t_chunk_alloc.c @@ -37,7 +37,7 @@ get_filesize(const char *filename) MPI_File fd; MPI_Offset filesize; #ifndef H5_HAVE_MPI_GET_SIZE - struct stat stat_buf; + h5_stat_t stat_buf; #endif #ifdef H5_HAVE_MPI_GET_SIZE @@ -54,7 +54,7 @@ get_filesize(const char *filename) /* Some systems (only SGI Altix Propack 4 so far) doesn't return correct * file size for MPI_File_get_size. Use stat instead. */ - if((mpierr=stat(filename, &stat_buf))<0) + if((mpierr=HDstat(filename, &stat_buf))<0) VRFY((mpierr == MPI_SUCCESS), ""); /* Hopefully this casting is safe */ diff --git a/testpar/t_dset.c b/testpar/t_dset.c index e4da0d3..699f86d 100644 --- a/testpar/t_dset.c +++ b/testpar/t_dset.c @@ -2516,3 +2516,552 @@ none_selection_chunk(void) if(data_origin) free(data_origin); if(data_array) free(data_array); } + + +/* Function: test_actual_io_mode + * + * Purpose: tests one specific case of collective I/O and checks that the + * actual_chunk_opt_mode property and the actual_io_mode + * properties in the DXPL have the correct values. + * + * Input: selection_mode: changes the way processes select data from the space, as well + * as some dxpl flags to get collective I/O to break in different ways. + * + * The relevant I/O function and expected response for each mode: + * TEST_ACTUAL_IO_MULTI_CHUNK_IND: + * H5D_mpi_chunk_collective_io, each process reports independent I/O + * + * TEST_ACTUAL_IO_MULTI_CHUNK_COL: + * H5D_mpi_chunk_collective_io, each process reports collective I/O + * + * TEST_ACTUAL_IO_MULTI_CHUNK_MIX: + * H5D_mpi_chunk_collective_io, each process reports mixed I/O + * + * TEST_ACTUAL_IO_MULTI_CHUNK_MIX_DISAGREE: + * H5D_mpi_chunk_collective_io, processes disagree. The root reports + * collective, the rest report independent I/O + * + * TEST_ACTUAL_IO_MULTI_CHUNK_NO_OPT_COL: + * H5D_mpi_chunk_collective_io_no_opt, each process reports collective I/O + * + * TEST_ACTUAL_IO_MULTI_CHUNK_NO_OPT_MIX_DISAGREE: + * H5D_mpi_chunk_collective_io_no_opt, processes disagree + * (collective and mixed I/O) + * + * TEST_ACTUAL_IO_LINK_CHUNK: + * H5D_link_chunk_collective_io, processes report linked chunk I/O + * + * TEST_ACTUAL_IO_CONTIGUOUS: + * H5D_contig_collective_write or H5D_contig_collective_read + * each process reports contiguous collective I/O + * + * TEST_ACTUAL_IO_NO_COLLECTIVE: + * Simple independent I/O. This tests that the defaults are properly set. + * + * TEST_ACTUAL_IO_RESET: + * Perfroms collective and then independent I/O wit hthe same dxpl to + * make sure the peroperty is correctly reset to the default on each use. + * Specifically, this test runs TEST_ACTUAL_IO_MULTI_CHUNK_NO_OPT_MIX_DISAGREE + * (The most complex case that works on all builds) and then performs + * an independent read and write with the same dxpls. + * + * It may seem like TEST_ACTUAL_IO_MULTI_CHUNK_NO_OPT_IND and + * TEST_ACTUAL_IO_MULTI_CHUNK_NO_OPT_MIX have been accidentally + * left out. This is intentional; the other test cases sufficiently + * cover all cases for Multi Chunk No Opt I/O. + * + * Programmer: Jacob Gruber + * Date: 2011-04-06 + */ +static void +test_actual_io_mode(int selection_mode) { + H5D_mpio_actual_chunk_opt_mode_t actual_chunk_opt_mode_write = -1; + H5D_mpio_actual_chunk_opt_mode_t actual_chunk_opt_mode_read = -1; + H5D_mpio_actual_chunk_opt_mode_t actual_chunk_opt_mode_expected = -1; + H5D_mpio_actual_io_mode_t actual_io_mode_write = -1; + H5D_mpio_actual_io_mode_t actual_io_mode_read = -1; + H5D_mpio_actual_io_mode_t actual_io_mode_expected = -1; + const char * filename; + const char * test_name; + hbool_t multi_chunk_no_opt; + hbool_t multi_chunk_with_opt; + hbool_t is_chunked; + hbool_t is_collective; + int mpi_size = -1; + int mpi_rank = -1; + int length; + int * buffer; + int i; + MPI_Comm mpi_comm = MPI_COMM_NULL; + MPI_Info mpi_info = MPI_INFO_NULL; + hid_t fid = -1; + hid_t sid = -1; + hid_t dataset = -1; + hid_t data_type = H5T_NATIVE_INT; + hid_t fapl = -1; + hid_t mem_space = -1; + hid_t file_space = -1; + hid_t dcpl = -1; + hid_t dxpl_write = -1; + hid_t dxpl_read = -1; + hsize_t dims[RANK]; + hsize_t chunk_dims[RANK]; + hsize_t start[RANK]; + hsize_t stride[RANK]; + hsize_t count[RANK]; + hsize_t block[RANK]; + hbool_t use_gpfs = FALSE; + herr_t ret; + + /* Set up some flags to make some future if statements slightly more readable */ + multi_chunk_no_opt = ( + selection_mode == TEST_ACTUAL_IO_MULTI_CHUNK_NO_OPT_IND || + selection_mode == TEST_ACTUAL_IO_MULTI_CHUNK_NO_OPT_COL || + selection_mode == TEST_ACTUAL_IO_MULTI_CHUNK_NO_OPT_MIX_DISAGREE ); + + /* Note: RESET performs the same tests as MULTI_CHUNK_MIX_DISAGREE and then + * tests independent I/O + */ + multi_chunk_with_opt = ( + selection_mode == TEST_ACTUAL_IO_MULTI_CHUNK_IND || + selection_mode == TEST_ACTUAL_IO_MULTI_CHUNK_COL || + selection_mode == TEST_ACTUAL_IO_MULTI_CHUNK_MIX || + selection_mode == TEST_ACTUAL_IO_MULTI_CHUNK_MIX_DISAGREE || + selection_mode == TEST_ACTUAL_IO_RESET ); + + is_chunked = ( + selection_mode != TEST_ACTUAL_IO_CONTIGUOUS && + selection_mode != TEST_ACTUAL_IO_NO_COLLECTIVE); + + is_collective = selection_mode != TEST_ACTUAL_IO_NO_COLLECTIVE; + + /* Set up MPI parameters */ + MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); + MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); + + MPI_Barrier(MPI_COMM_WORLD); + + HDassert(mpi_size >= 1); + + mpi_comm = MPI_COMM_WORLD; + mpi_info = MPI_INFO_NULL; + + filename = (const char *)GetTestParameters(); + HDassert(filename != NULL); + + /* Setup the file access template */ + fapl = create_faccess_plist(mpi_comm, mpi_info, facc_type, use_gpfs); + VRFY((fapl >= 0), "create_faccess_plist() succeeded"); + + /* Create the file */ + fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); + VRFY((fid >= 0), "H5Fcreate succeeded"); + + /* Create the basic Space */ + dims[0] = dim0; + dims[1] = dim1; + sid = H5Screate_simple (RANK, dims, NULL); + VRFY((sid >= 0), "H5Screate_simple succeeded"); + + /* Create the dataset creation plist */ + dcpl = H5Pcreate(H5P_DATASET_CREATE); + VRFY((dcpl >= 0), "dataset creation plist created successfully"); + + /* If we are not testing contiguous datasets */ + if(is_chunked) { + /* Set up chunk information. */ + chunk_dims[0] = dims[0]/mpi_size; + chunk_dims[1] = dims[1]; + ret = H5Pset_chunk(dcpl, 2, chunk_dims); + VRFY((ret >= 0),"chunk creation property list succeeded"); + } + + /* Create the dataset */ + dataset = H5Dcreate2(fid, "actual_io", data_type, sid, H5P_DEFAULT, + dcpl, H5P_DEFAULT); + VRFY((dataset >= 0), "H5Dcreate2() dataset succeeded"); + + /* Create the file dataspace */ + file_space = H5Dget_space(dataset); + VRFY((file_space >= 0), "H5Dget_space succeeded"); + + /* Choose a selection method based on the type of I/O we want to occur, + * and also set up some selection-dependeent test info. */ + switch(selection_mode) { + + /* Independent I/O with optimization */ + case TEST_ACTUAL_IO_MULTI_CHUNK_IND: + /* Since the dataset is chunked by row and each process selects a row, + * each process writes to a different chunk. This forces all I/O to be + * independent. + */ + slab_set(mpi_rank, mpi_size, start, count, stride, block, BYROW); + + test_name = "Multi Chunk - Independent"; + actual_chunk_opt_mode_expected = H5D_MPIO_MULTI_CHUNK; + actual_io_mode_expected = H5D_MPIO_CHUNK_INDEPENDENT; + break; + + /* Collective I/O with optimization */ + case TEST_ACTUAL_IO_MULTI_CHUNK_COL: + /* The dataset is chunked by rows, so each process takes a column which + * spans all chunks. Since the processes write non-overlapping regular + * selections to each chunk, the operation is purely collective. + */ + slab_set(mpi_rank, mpi_size, start, count, stride, block, BYCOL); + + test_name = "Multi Chunk - Collective"; + actual_chunk_opt_mode_expected = H5D_MPIO_MULTI_CHUNK; + actual_io_mode_expected = H5D_MPIO_CHUNK_COLLECTIVE; + break; + + /* Mixed I/O with optimization */ + case TEST_ACTUAL_IO_MULTI_CHUNK_MIX: + /* A chunk will be assigned collective I/O only if it is selected by each + * process. To get mixed I/O, have the root select all chunks and each + * subsequent process select the first and nth chunk. The first chunk, + * accessed by all, will be assigned collective I/O while each other chunk + * will be accessed only by the root and the nth procecess and will be + * assigned independent I/O. Each process will access one chunk collectively + * and at least one chunk independently, reporting mixed I/O. + */ + + if(mpi_rank == 0) { + /* Select the first column */ + slab_set(mpi_rank, mpi_size, start, count, stride, block, BYCOL); + } else { + /* Select the first and the nth chunk in the nth column */ + block[0] = dim0 / mpi_size; + block[1] = dim1 / mpi_size; + count[0] = 2; + count[1] = 1; + stride[0] = mpi_rank * block[0]; + stride[1] = 1; + start[0] = 0; + start[1] = mpi_rank*block[1]; + } + + test_name = "Multi Chunk - Mixed"; + actual_chunk_opt_mode_expected = H5D_MPIO_MULTI_CHUNK; + actual_io_mode_expected = H5D_MPIO_CHUNK_MIXED; + break; + + /* RESET tests that the properties are properly reset to defaults each time I/O is + * performed. To acheive this, we have RESET perform collective I/O (which would change + * the values from the defaults) followed by independent I/O (which should report the + * default values). RESET doesn't need to have a unique selection, so we reuse + * MULTI_CHUMK_MIX_DISAGREE, which was chosen because it is a complex case that works + * on all builds. The independent section of RESET can be found at the end of this function. + */ + case TEST_ACTUAL_IO_RESET: + + /* Mixed I/O with optimization and internal disagreement */ + case TEST_ACTUAL_IO_MULTI_CHUNK_MIX_DISAGREE: + /* A chunk will be assigned collective I/O only if it is selected by each + * process. To get mixed I/O with disagreement, assign process n to the + * first chunk and the nth chunk. The first chunk, selected by all, is + * assgigned collective I/O, while each other process gets independent I/O. + * Since the root process with only access the first chunk, it will report + * collective I/O. The subsequent processes will access the first chunk + * collectively, and their other chunk indpendently, reporting mixed I/O. + */ + + if(mpi_rank == 0) { + /* Select the first chunk in the first column */ + slab_set(mpi_rank, mpi_size, start, count, stride, block, BYCOL); + block[0] = block[0] / mpi_size; + } else { + /* Select the first and the nth chunk in the nth column */ + block[0] = dim0 / mpi_size; + block[1] = dim1 / mpi_size; + count[0] = 2; + count[1] = 1; + stride[0] = mpi_rank * block[0]; + stride[1] = 1; + start[0] = 0; + start[1] = mpi_rank*block[1]; + } + + /* If the testname was not already set by the RESET case */ + if (selection_mode == TEST_ACTUAL_IO_RESET) + test_name = "RESET"; + else + test_name = "Multi Chunk - Mixed (Disagreement)"; + + actual_chunk_opt_mode_expected = H5D_MPIO_MULTI_CHUNK; + + if(mpi_rank == 0) + actual_io_mode_expected = H5D_MPIO_CHUNK_COLLECTIVE; + else + actual_io_mode_expected = H5D_MPIO_CHUNK_MIXED; + + break; + + /* Collective I/O without optimization */ + case TEST_ACTUAL_IO_MULTI_CHUNK_NO_OPT_COL: + /* The dataset is chunked by rows, so when each process takes a column, its + * selection spans all chunks. Since no process writes more chunks than any + * other, colective I/O is never broken. */ + slab_set(mpi_rank, mpi_size, start, count, stride, block, BYCOL); + + test_name = "Multi Chunk No Opt - Collective"; + actual_chunk_opt_mode_expected = H5D_MPIO_MULTI_CHUNK_NO_OPT; + actual_io_mode_expected = H5D_MPIO_CHUNK_COLLECTIVE; + break; + + + /* Mixed I/O without optimization with disagreement */ + case TEST_ACTUAL_IO_MULTI_CHUNK_NO_OPT_MIX_DISAGREE: + /* Each process takes a column, but the root's column is shortened so that + * it only reads the first chunk. Since all the other processes are writing + * to more chunks, they will break collective after the first chunk. + */ + slab_set(mpi_rank, mpi_size, start, count, stride, block, BYCOL); + if(mpi_rank == 0) + block[0] = block[0] / mpi_size; + + test_name = "Multi Chunk No Opt - Mixed (Disagreement)"; + actual_chunk_opt_mode_expected = H5D_MPIO_MULTI_CHUNK_NO_OPT; + + if(mpi_rank == 0) + actual_io_mode_expected = H5D_MPIO_CHUNK_COLLECTIVE; + else + actual_io_mode_expected = H5D_MPIO_CHUNK_MIXED; + + break; + + /* Linked Chunk I/O */ + case TEST_ACTUAL_IO_LINK_CHUNK: + /* Nothing special; link chunk I/O is forced in the dxpl settings. */ + slab_set(mpi_rank, mpi_size, start, count, stride, block, BYROW); + + test_name = "Link Chunk"; + actual_chunk_opt_mode_expected = H5D_MPIO_LINK_CHUNK; + actual_io_mode_expected = H5D_MPIO_CHUNK_COLLECTIVE; + break; + + /* Contiguous Dataset */ + case TEST_ACTUAL_IO_CONTIGUOUS: + /* A non overlapping, regular selection in a contiguous dataset leads to + * collective I/O */ + slab_set(mpi_rank, mpi_size, start, count, stride, block, BYROW); + + test_name = "Contiguous"; + actual_chunk_opt_mode_expected = H5D_MPIO_NO_CHUNK_OPTIMIZATION; + actual_io_mode_expected = H5D_MPIO_CONTIGUOUS_COLLECTIVE; + break; + + case TEST_ACTUAL_IO_NO_COLLECTIVE: + slab_set(mpi_rank, mpi_size, start, count, stride, block, BYROW); + + test_name = "Independent"; + actual_chunk_opt_mode_expected = H5D_MPIO_NO_CHUNK_OPTIMIZATION; + actual_io_mode_expected = H5D_MPIO_NO_COLLECTIVE; + break; + + default: + test_name = "Undefined Selection Mode"; + actual_chunk_opt_mode_expected = -1; + actual_io_mode_expected = -1; + break; + } + + /* Reset the expected values to defulats if the MPI_POSIX driver is in use. + * This property is defined only for mpio, not MPI POSIX. */ + if (facc_type == FACC_MPIPOSIX) { + actual_chunk_opt_mode_expected = H5D_MPIO_NO_CHUNK_OPTIMIZATION; + actual_io_mode_expected = H5D_MPIO_NO_COLLECTIVE; + } + + ret = H5Sselect_hyperslab(file_space, H5S_SELECT_SET, start, stride, count, block); + VRFY((ret >= 0), "H5Sset_hyperslab succeeded"); + + /* Create a memory dataspace mirroring the dataset and select the same hyperslab + * as in the file space. + */ + mem_space = H5Screate_simple (RANK, dims, NULL); + VRFY((mem_space >= 0), "mem_space created"); + + ret = H5Sselect_hyperslab(mem_space, H5S_SELECT_SET, start, stride, count, block); + VRFY((ret >= 0), "H5Sset_hyperslab succeeded"); + + + /* Get the number of elements in the selection */ + length = dim0 * dim1; + + /* Allocate and initialize the buffer */ + buffer = (int *)HDmalloc(sizeof(int) * length); + VRFY((buffer != NULL), "malloc of buffer succeeded"); + for(i = 0; i < length; i++) + buffer[i] = i; + + /* Set up the dxpl for the write */ + dxpl_write = H5Pcreate(H5P_DATASET_XFER); + VRFY((dxpl_write >= 0), "H5Pcreate(H5P_DATASET_XFER) succeeded"); + + /* Set collective I/O properties in the dxpl. */ + if(is_collective) { + /* Request collective I/O */ + ret = H5Pset_dxpl_mpio(dxpl_write, H5FD_MPIO_COLLECTIVE); + VRFY((ret >= 0), "H5Pset_dxpl_mpio succeeded"); + + /* Set the threshold number of processes per chunk for link chunk I/O + * to twice mpi_size. This will prevent the threshold from ever being + * met, thus forcing multi chunk io instead of link chunk io. + */ + if(multi_chunk_with_opt) { + ret = H5Pset_dxpl_mpio_chunk_opt_num(dxpl_write, (unsigned) mpi_size*2); + VRFY((ret >= 0), "H5Pset_dxpl_mpio_chunk_opt_num succeeded"); + + ret = H5Pset_dxpl_mpio_chunk_opt_ratio(dxpl_write, (unsigned) 99); + VRFY((ret >= 0), "H5Pset_dxpl_mpio_chunk_opt_ratio succeeded"); + } + + /* Request multi chunk I/O without optimization */ + if(multi_chunk_no_opt) { + ret = H5Pset_dxpl_mpio_chunk_opt(dxpl_write, H5FD_MPIO_CHUNK_MULTI_IO); + VRFY((ret >= 0), "H5Pset_dxpl_mpio succeeded"); + } + } + + /* Make a copy of the dxpl to test the read operation */ + dxpl_read = H5Pcopy(dxpl_write); + VRFY((dxpl_read >= 0), "H5Pcopy succeeded"); + + /* Write */ + ret = H5Dwrite(dataset, data_type, mem_space, file_space, dxpl_write, buffer); + if(ret < 0) H5Eprint2(H5E_DEFAULT, stdout); + VRFY((ret >= 0), "H5Dwrite() dataset multichunk write succeeded"); + + /* Retreive Actual io valuess */ + ret = H5Pget_mpio_actual_io_mode(dxpl_write, &actual_io_mode_write); + VRFY((ret >= 0), "retriving actual io mode suceeded" ); + + ret = H5Pget_mpio_actual_chunk_opt_mode(dxpl_write, &actual_chunk_opt_mode_write); + VRFY((ret >= 0), "retriving actual chunk opt mode succeeded" ); + + /* Read */ + ret = H5Dread(dataset, data_type, mem_space, file_space, dxpl_read, buffer); + if(ret < 0) H5Eprint2(H5E_DEFAULT, stdout); + VRFY((ret >= 0), "H5Dread() dataset multichunk read succeeded"); + + /* Retreive Actual io values */ + ret = H5Pget_mpio_actual_io_mode(dxpl_read, &actual_io_mode_read); + VRFY((ret >= 0), "retriving actual io mode succeeded" ); + + ret = H5Pget_mpio_actual_chunk_opt_mode(dxpl_read, &actual_chunk_opt_mode_read); + VRFY((ret >= 0), "retriving actual chunk opt mode succeeded" ); + + /* Check write vs read */ + VRFY((actual_io_mode_read == actual_io_mode_write), + "reading and writing are the same for actual_io_mode"); + VRFY((actual_chunk_opt_mode_read == actual_chunk_opt_mode_write), + "reading and writing are the same for actual_chunk_opt_mode"); + + + /* Test values */ + if(actual_chunk_opt_mode_expected != (unsigned) -1 && actual_io_mode_expected != (unsigned) -1) { + char message[100]; + sprintf(message, "Actual Chunk Opt Mode has the correct value for %s.\n",test_name); + VRFY((actual_chunk_opt_mode_write == actual_chunk_opt_mode_expected), message); + sprintf(message, "Actual IO Mode has the correct value for %s.\n",test_name); + VRFY((actual_io_mode_write == actual_io_mode_expected), message); + } else { + HDfprintf(stderr, "%s %d -> (%d,%d)\n", test_name, mpi_rank, + actual_chunk_opt_mode_write, actual_io_mode_write); + } + + /* To test that the property is succesfully reset to the default, we perform some + * independent I/O after the collective I/O + */ + if (selection_mode == TEST_ACTUAL_IO_RESET) { + if (mpi_rank == 0) { + /* Switch to independent io */ + ret = H5Pset_dxpl_mpio(dxpl_write, H5FD_MPIO_INDEPENDENT); + VRFY((ret >= 0), "H5Pset_dxpl_mpio succeeded"); + ret = H5Pset_dxpl_mpio(dxpl_read, H5FD_MPIO_INDEPENDENT); + VRFY((ret >= 0), "H5Pset_dxpl_mpio succeeded"); + + /* Write */ + ret = H5Dwrite(dataset, data_type, H5S_ALL, H5S_ALL, dxpl_write, buffer); + VRFY((ret >= 0), "H5Dwrite() dataset multichunk write succeeded"); + + /* Check Properties */ + ret = H5Pget_mpio_actual_io_mode(dxpl_write, &actual_io_mode_write); + VRFY( (ret >= 0), "retriving actual io mode succeeded" ); + ret = H5Pget_mpio_actual_chunk_opt_mode(dxpl_write, &actual_chunk_opt_mode_write); + VRFY( (ret >= 0), "retriving actual chunk opt mode succeeded" ); + + VRFY(actual_chunk_opt_mode_write == H5D_MPIO_NO_CHUNK_OPTIMIZATION, + "actual_chunk_opt_mode has correct value for reset write (independent)"); + VRFY(actual_io_mode_write == H5D_MPIO_NO_COLLECTIVE, + "actual_io_mode has correct value for reset write (independent)"); + + /* Read */ + ret = H5Dread(dataset, data_type, H5S_ALL, H5S_ALL, dxpl_read, buffer); + VRFY((ret >= 0), "H5Dwrite() dataset multichunk write succeeded"); + + /* Check Properties */ + ret = H5Pget_mpio_actual_io_mode(dxpl_read, &actual_io_mode_read); + VRFY( (ret >= 0), "retriving actual io mode succeeded" ); + ret = H5Pget_mpio_actual_chunk_opt_mode(dxpl_read, &actual_chunk_opt_mode_read); + VRFY( (ret >= 0), "retriving actual chunk opt mode succeeded" ); + + VRFY(actual_chunk_opt_mode_read == H5D_MPIO_NO_CHUNK_OPTIMIZATION, + "actual_chunk_opt_mode has correct value for reset read (independent)"); + VRFY(actual_io_mode_read == H5D_MPIO_NO_COLLECTIVE, + "actual_io_mode has correct value for reset read (independent)"); + } + } + + /* Release some resources */ + ret = H5Sclose(sid); + ret = H5Pclose(fapl); + ret = H5Pclose(dcpl); + ret = H5Pclose(dxpl_write); + ret = H5Pclose(dxpl_read); + ret = H5Dclose(dataset); + ret = H5Sclose(mem_space); + ret = H5Sclose(file_space); + ret = H5Fclose(fid); + HDfree(buffer); + return; +} + + +/* Function: actual_io_mode_tests + * + * Purpose: Tests all possible cases of the actual_io_mode property. + * + * Programmer: Jacob Gruber + * Date: 2011-04-06 + */ +void +actual_io_mode_tests(void) { + int mpi_size = -1; + int mpi_rank = -1; + MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); + MPI_Comm_size(MPI_COMM_WORLD, &mpi_rank); + + test_actual_io_mode(TEST_ACTUAL_IO_NO_COLLECTIVE); + + test_actual_io_mode(TEST_ACTUAL_IO_MULTI_CHUNK_IND); + test_actual_io_mode(TEST_ACTUAL_IO_MULTI_CHUNK_COL); + + /* The Multi Chunk Mixed test requires atleast three processes. */ + if (mpi_size > 2) + test_actual_io_mode(TEST_ACTUAL_IO_MULTI_CHUNK_MIX); + else + HDfprintf(stdout, "Multi Chunk Mixed test requires 3 proceses minimum\n"); + + test_actual_io_mode(TEST_ACTUAL_IO_MULTI_CHUNK_MIX_DISAGREE); + + test_actual_io_mode(TEST_ACTUAL_IO_MULTI_CHUNK_NO_OPT_COL); + test_actual_io_mode(TEST_ACTUAL_IO_MULTI_CHUNK_NO_OPT_MIX_DISAGREE); + + test_actual_io_mode(TEST_ACTUAL_IO_LINK_CHUNK); + test_actual_io_mode(TEST_ACTUAL_IO_CONTIGUOUS); + + test_actual_io_mode(TEST_ACTUAL_IO_RESET); + return; +} diff --git a/testpar/t_mpi.c b/testpar/t_mpi.c index c3e04de..6cba5af 100644 --- a/testpar/t_mpi.c +++ b/testpar/t_mpi.c @@ -206,7 +206,7 @@ test_mpio_gb_file(char *filename) MPI_Offset mpi_off; MPI_Offset mpi_off_old; MPI_Status mpi_stat; - struct stat stat_buf; + h5_stat_t stat_buf; int is_signed, sizeof_mpi_offset; nerrs = 0; @@ -395,7 +395,7 @@ test_mpio_gb_file(char *filename) mrc = MPI_File_get_size(fh, &size); VRFY((mrc==MPI_SUCCESS), ""); - mrc=stat(filename, &stat_buf); + mrc=HDstat(filename, &stat_buf); VRFY((mrc==0), ""); /* Hopefully this casting is safe */ @@ -843,33 +843,13 @@ static int test_mpio_derived_dtype(char *filename) { mpi_err = MPI_Barrier(MPI_COMM_WORLD); -#ifdef H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS if(retcode == -1) { if(mpi_rank == 0) { printf("Complicated derived datatype is NOT working at this platform\n"); - printf("Go back to hdf5/config and find the corresponding\n"); - printf("configure-specific file (for example, powerpc-ibm-aix5.x) and add\n"); - printf("hdf5_cv_mpi_complex_derived_datatype_works=${hdf5_cv_mpi_complex_derived_datatype-works='no'}\n"); - printf(" at the end of the file.\n"); - printf(" Please report to hdfhelp@ncsa.uiuc.edu about this problem.\n"); + printf(" Please report to help@hdfgroup.org about this problem.\n"); } retcode = 1; } -#else - if(retcode == 0) { - if(mpi_rank == 0) { - printf(" This is NOT an error, What it really says is\n"); - printf("Complicated derived datatype is WORKING at this platform\n"); - printf(" Go back to hdf5/config and find the corresponding \n"); - printf(" configure-specific file (for example, powerpc-ibm-aix5.x) and delete the line\n"); - printf("hdf5_cv_mpi_complex_derived_datatype_works=${hdf5_cv_mpi_complex_derived_datatype-works='no'}\n"); - printf(" at the end of the file.\n"); - printf("Please report to hdfhelp@ncsa.uiuc.edu about this problem.\n"); - } - retcode = 1; - } - if(retcode == -1) retcode = 0; -#endif return retcode; } /* @@ -907,30 +887,29 @@ test_mpio_special_collective(char *filename) char mpi_err_str[MPI_MAX_ERROR_STRING]; int mpi_err_strlen; int mpi_err; - char writedata[2]; - char *buf; + char writedata[2*DIMSIZE]; + char filerep[7] = "native"; int i; int count,bufcount; int blocklens[2]; MPI_Aint offsets[2]; - MPI_Offset mpi_off; + MPI_Offset mpi_off = 0; MPI_Status mpi_stat; - int retcode; + int retcode = 0; MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); - retcode = 0; /* create MPI data type */ etype = MPI_BYTE; if(mpi_rank == 0 || mpi_rank == 1) { count = DIMSIZE; bufcount = 1; - } + } /* end if */ else { count = 0; bufcount = 0; - } + } /* end else */ blocklens[0] = count; offsets[0] = mpi_rank*count; @@ -938,108 +917,103 @@ test_mpio_special_collective(char *filename) offsets[1] = (mpi_size+mpi_rank)*count; if(count !=0) { - if((mpi_err= MPI_Type_hindexed(2,blocklens,offsets,etype,&filetype)) - != MPI_SUCCESS){ - MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen); - printf("MPI_Type_contiguous failed (%s)\n", mpi_err_str); - return 1; - } - - if((mpi_err=MPI_Type_commit(&filetype))!=MPI_SUCCESS){ - MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen); - printf("MPI_Type_commit failed (%s)\n", mpi_err_str); - return 1; - } - - - if((mpi_err= MPI_Type_hindexed(2,blocklens,offsets,etype,&buftype)) - != MPI_SUCCESS){ - MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen); - printf("MPI_Type_contiguous failed (%s)\n", mpi_err_str); - return 1; - } - - if((mpi_err=MPI_Type_commit(&buftype))!=MPI_SUCCESS){ + if((mpi_err = MPI_Type_hindexed(2, + blocklens, + offsets, + etype, + &filetype)) != MPI_SUCCESS) { + MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen); + printf("MPI_Type_contiguous failed (%s)\n", mpi_err_str); + return 1; + } /* end if */ + + if((mpi_err = MPI_Type_commit(&filetype)) != MPI_SUCCESS) { + MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen); + printf("MPI_Type_commit failed (%s)\n", mpi_err_str); + return 1; + } /* end if */ + + if((mpi_err = MPI_Type_hindexed(2, + blocklens, + offsets, + etype, + &buftype)) != MPI_SUCCESS) { + MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen); + printf("MPI_Type_contiguous failed (%s)\n", mpi_err_str); + return 1; + } /* end if */ + + if((mpi_err = MPI_Type_commit(&buftype)) != MPI_SUCCESS) { + MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen); + printf("MPI_Type_commit failed (%s)\n", mpi_err_str); + return 1; + } /* end if */ + } /* end if */ + else { + filetype = MPI_BYTE; + buftype = MPI_BYTE; + } /* end else */ + + /* Open a file */ + if ((mpi_err = MPI_File_open(MPI_COMM_WORLD, + filename, + MPI_MODE_RDWR | MPI_MODE_CREATE, + MPI_INFO_NULL, + &fh)) != MPI_SUCCESS) { MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen); - printf("MPI_Type_commit failed (%s)\n", mpi_err_str); - return 1; - } - } - else { - - filetype = MPI_BYTE; - buftype = MPI_BYTE; - } - - /* Open a file */ - if ((mpi_err = MPI_File_open(MPI_COMM_WORLD, filename, - MPI_MODE_RDWR | MPI_MODE_CREATE , - MPI_INFO_NULL, &fh)) - != MPI_SUCCESS){ - MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen); - printf("MPI_File_open failed (%s)\n", mpi_err_str); - return 1; - } + printf("MPI_File_open failed (%s)\n", mpi_err_str); + return 1; + } /* end if */ /* each process writes some data */ for (i=0; i < 2*DIMSIZE; i++) - writedata[i] = mpi_rank*DIMSIZE + i; - - - mpi_off = 0; - if((mpi_err = MPI_File_set_view(fh, mpi_off, MPI_BYTE, filetype, "native", MPI_INFO_NULL)) - != MPI_SUCCESS) { - MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen); - printf("MPI_File_set_view failed (%s)\n", mpi_err_str); - return 1; - } - - buf = writedata; - if ((mpi_err = MPI_File_write_at_all(fh, mpi_off, buf, bufcount, buftype, - &mpi_stat)) - != MPI_SUCCESS){ - MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen); - printf("MPI_File_write_at offset(%ld), bytes (%d), failed (%s)\n", - (long) mpi_off, bufcount, mpi_err_str); - return 1; - }; + writedata[i] = (char)(mpi_rank*DIMSIZE + i); + + /* Set the file view */ + if((mpi_err = MPI_File_set_view(fh, + mpi_off, + MPI_BYTE, + filetype, + filerep, + MPI_INFO_NULL)) != MPI_SUCCESS) { + MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen); + printf("MPI_File_set_view failed (%s)\n", mpi_err_str); + return 1; + } /* end if */ + + /* Collectively write into the file */ + if ((mpi_err = MPI_File_write_at_all(fh, + mpi_off, + writedata, + bufcount, + buftype, + &mpi_stat)) != MPI_SUCCESS) { + MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen); + printf("MPI_File_write_at offset(%ld), bytes (%d), failed (%s)\n", + (long) mpi_off, bufcount, mpi_err_str); + return 1; + } /* end if */ - if ((mpi_err = MPI_File_close(&fh)) - != MPI_SUCCESS){ - MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen); - printf("MPI_File_close failed. \n"); - return 1; - }; + /* Close the file */ + if ((mpi_err = MPI_File_close(&fh)) != MPI_SUCCESS) { + MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen); + printf("MPI_File_close failed. \n"); + return 1; + } /* end if */ + /* Perform a barrier */ mpi_err = MPI_Barrier(MPI_COMM_WORLD); -#ifdef H5_MPI_SPECIAL_COLLECTIVE_IO_WORKS if(retcode != 0) { - if(mpi_rank == 0) { - printf("special collective IO is NOT working at this platform\n"); - printf("Go back to hdf5/config and find the corresponding\n"); - printf("configure-specific file (for example, powerpc-ibm-aix5.x) and add\n"); - printf("hdf5_cv_mpi_special_collective_io_works=${hdf5_cv_mpi_special_collective_io_works='no'}\n"); - printf(" at the end of the file.\n"); - printf(" Please report to hdfhelp@ncsa.uiuc.edu about this problem.\n"); - } - retcode = 1; - } -#else - if(retcode == 0) { - if(mpi_rank == 0) { - printf(" This is NOT an error, What it really says is\n"); - printf("special collective IO is WORKING at this platform\n"); - printf(" Go back to hdf5/config and find the corresponding \n"); - printf(" configure-specific file (for example, powerpc-ibm-aix5.x) and delete the line\n"); - printf("hdf5_cv_mpi_special_collective_io_works=${hdf5_cv_mpi_special_collective_io_works='no'}\n"); - printf(" at the end of the file.\n"); - printf("Please report to hdfhelp@ncsa.uiuc.edu about this problem.\n"); - } - retcode = 1; - } -#endif + if(mpi_rank == 0) { + printf("special collective IO is NOT working at this platform\n"); + printf(" Please report to help@hdfgroup.org about this problem.\n"); + } /* end if */ + retcode = 1; + } /* end if */ + return retcode; -} + +} /* test_mpio_special_collective */ /* * parse the command line options @@ -1226,22 +1200,8 @@ main(int argc, char **argv) /*======================================= * MPIO complicated derived datatype test *=======================================*/ - /* test_mpio_derived_dtype often hangs when fails. - * Do not run it if it is known NOT working unless ask to - * run explicitly by high verbose mode. - */ -#ifdef H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS MPI_BANNER("MPIO complicated derived datatype test..."); ret_code = test_mpio_derived_dtype(filenames[0]); -#else - if (VERBOSE_HI){ - MPI_BANNER("MPIO complicated derived datatype test..."); - ret_code = test_mpio_derived_dtype(filenames[0]); - }else{ - MPI_BANNER("MPIO complicated derived datatype test SKIPPED."); - ret_code = 0; /* fake ret_code */ - } -#endif ret_code = errors_sum(ret_code); if (mpi_rank==0 && ret_code > 0){ printf("***FAILED with %d total errors\n", ret_code); @@ -1251,34 +1211,17 @@ main(int argc, char **argv) /*======================================= * MPIO special collective IO test *=======================================*/ - /* test_special_collective_io often hangs when fails. - * Do not run it if it is known NOT working unless ask to - * run explicitly by high verbose mode. - */ - if(mpi_size !=4){ - MPI_BANNER("MPIO special collective io test SKIPPED."); - if(mpi_rank == 0){ - printf("Use FOUR processes to run this test\n"); - printf("If you still see the , use <-vh> option to verify the test\n"); - } - ret_code = 0; - goto sc_finish; - } + if (mpi_size < 4) { + MPI_BANNER("MPIO special collective io test SKIPPED."); + if (mpi_rank == 0) + printf("This test needs at least four processes to run.\n"); + ret_code = 0; + goto sc_finish; + } /* end if */ -#ifdef H5_MPI_SPECIAL_COLLECTIVE_IO_WORKS MPI_BANNER("MPIO special collective io test..."); ret_code = test_mpio_special_collective(filenames[0]); -#else - if (VERBOSE_HI){ - MPI_BANNER("MPIO special collective io test..."); - ret_code = test_mpio_special_collective(filenames[0]); - }else{ - MPI_BANNER("MPIO special collective io test SKIPPED."); - ret_code = 0; /* fake ret_code */ - } -#endif - sc_finish: ret_code = errors_sum(ret_code); if (mpi_rank==0 && ret_code > 0){ diff --git a/testpar/t_posix_compliant.c b/testpar/t_posix_compliant.c index 960f4c8..1bc0053 100644 --- a/testpar/t_posix_compliant.c +++ b/testpar/t_posix_compliant.c @@ -40,7 +40,9 @@ * mpiexec -np 3 ./t_posix_compliant */ +#ifdef H5_HAVE_UNISTD_H #include +#endif #include #include #include diff --git a/testpar/t_shapesame.c b/testpar/t_shapesame.c index a62e4f9..2d379d6 100644 --- a/testpar/t_shapesame.c +++ b/testpar/t_shapesame.c @@ -29,47 +29,6 @@ #include "testphdf5.h" #include "H5Spkg.h" /* Dataspaces */ -/* The following macros are used in the detection of tests that run overlong -- - * so that tests can be ommitted if necessary to get the overall set of tests - * to complete. - * - * Observe that we can't do this if we don't have gettimeofday(), so in that - * case, the macros resolve to the empty string. - */ - -#ifdef H5_HAVE_GETTIMEOFDAY - -#define START_TIMER(time_tests, start_time, vrfy_msg) \ - { \ - int result; \ - if ( time_tests ) { \ - result = HDgettimeofday(&(start_time), NULL); \ - VRFY( (result == 0), (vrfy_msg)); \ - } \ - } - -#define STOP_TIMER_AND_UPDATE(time_tests, end_time, vrfy_msg, times) \ - { \ - int result; \ - long long delta_usecs; \ - if ( time_tests ) { \ - result = HDgettimeofday(&(end_time), NULL); \ - VRFY( (result == 0), (vrfy_msg)); \ - delta_usecs = \ - (1000000 * (timeval_b.tv_sec - timeval_a.tv_sec)) + \ - (timeval_b.tv_usec - timeval_a.tv_usec); \ - HDassert( delta_usecs >= 0L ); \ - (times) += delta_usecs; \ - } \ - } - -#else /* H5_HAVE_GETTIMEOFDAY */ - -#define START_TIMER(time_tests, start_time, vrfy_msg) - -#define STOP_TIMER_AND_UPDATE(time_tests, end_time, vrfy_msg, times) - -#endif /* H5_HAVE_GETTIMEOFDAY */ /* On Lustre (and perhaps other parallel file systems?), we have severe * slow downs if two or more processes attempt to access the same file system @@ -81,101 +40,116 @@ #define SHAPE_SAME_TEST_ALIGNMENT ((hsize_t)(4 * 1024 * 1024)) +#define PAR_SS_DR_MAX_RANK 5 /* must update code if this changes */ + +struct hs_dr_pio_test_vars_t +{ + int mpi_size; + int mpi_rank; + MPI_Comm mpi_comm; + MPI_Info mpi_info; + int test_num; + int edge_size; + int checker_edge_size; + int chunk_edge_size; + int small_rank; + int large_rank; + hid_t dset_type; + uint32_t * small_ds_buf_0; + uint32_t * small_ds_buf_1; + uint32_t * small_ds_buf_2; + uint32_t * small_ds_slice_buf; + uint32_t * large_ds_buf_0; + uint32_t * large_ds_buf_1; + uint32_t * large_ds_buf_2; + uint32_t * large_ds_slice_buf; + int small_ds_offset; + int large_ds_offset; + hid_t fid; /* HDF5 file ID */ + hid_t xfer_plist; + hid_t full_mem_small_ds_sid; + hid_t full_file_small_ds_sid; + hid_t mem_small_ds_sid; + hid_t file_small_ds_sid_0; + hid_t file_small_ds_sid_1; + hid_t small_ds_slice_sid; + hid_t full_mem_large_ds_sid; + hid_t full_file_large_ds_sid; + hid_t mem_large_ds_sid; + hid_t file_large_ds_sid_0; + hid_t file_large_ds_sid_1; + hid_t file_large_ds_process_slice_sid; + hid_t mem_large_ds_process_slice_sid; + hid_t large_ds_slice_sid; + hid_t small_dataset; /* Dataset ID */ + hid_t large_dataset; /* Dataset ID */ + size_t small_ds_size; + size_t small_ds_slice_size; + size_t large_ds_size; + size_t large_ds_slice_size; + hsize_t dims[PAR_SS_DR_MAX_RANK]; + hsize_t chunk_dims[PAR_SS_DR_MAX_RANK]; + hsize_t start[PAR_SS_DR_MAX_RANK]; + hsize_t stride[PAR_SS_DR_MAX_RANK]; + hsize_t count[PAR_SS_DR_MAX_RANK]; + hsize_t block[PAR_SS_DR_MAX_RANK]; + hsize_t * start_ptr; + hsize_t * stride_ptr; + hsize_t * count_ptr; + hsize_t * block_ptr; + int skips; + int max_skips; + int64_t total_tests; + int64_t tests_run; + int64_t tests_skipped; +}; + /*------------------------------------------------------------------------- - * Function: contig_hyperslab_dr_pio_test__run_test() + * Function: hs_dr_pio_test__setup() * - * Purpose: Test I/O to/from hyperslab selections of different rank in - * the parallel. + * Purpose: Do setup for tests of I/O to/from hyperslab selections of + * different rank in the parallel case. * * Return: void * - * Programmer: JRM -- 9/18/09 + * Programmer: JRM -- 8/9/11 * * Modifications: * - * JRM -- 9/16/10 - * Added express_test parameter. Use it to control whether - * we set up the chunks so that no chunk is shared between - * processes, and also whether we set an alignment when we - * create the test file. + * None. * *------------------------------------------------------------------------- */ -#define PAR_SS_DR_MAX_RANK 5 -#define CONTIG_HYPERSLAB_DR_PIO_TEST__RUN_TEST__DEBUG 0 +#define CONTIG_HS_DR_PIO_TEST__SETUP__DEBUG 0 static void -contig_hyperslab_dr_pio_test__run_test(const int test_num, - const int edge_size, - const int chunk_edge_size, - const int small_rank, - const int large_rank, - const hbool_t use_collective_io, - const hid_t dset_type, - const int express_test) +hs_dr_pio_test__setup(const int test_num, + const int edge_size, + const int checker_edge_size, + const int chunk_edge_size, + const int small_rank, + const int large_rank, + const hbool_t use_collective_io, + const hid_t dset_type, + const int express_test, + struct hs_dr_pio_test_vars_t * tv_ptr) { -#if CONTIG_HYPERSLAB_DR_PIO_TEST__RUN_TEST__DEBUG - const char *fcnName = "contig_hyperslab_dr_pio_test__run_test()"; -#endif /* CONTIG_HYPERSLAB_DR_PIO_TEST__RUN_TEST__DEBUG */ +#if CONTIG_HS_DR_PIO_TEST__SETUP__DEBUG + const char *fcnName = "hs_dr_pio_test__setup()"; +#endif /* CONTIG_HS_DR_PIO_TEST__SETUP__DEBUG */ const char *filename; hbool_t use_gpfs = FALSE; /* Use GPFS hints */ hbool_t mis_match = FALSE; - int i, j, k, l; - size_t n; + int i; int mrc; - int mpi_size = -1; - int mpi_rank = -1; - size_t start_index; - size_t stop_index; - const int test_max_rank = 5; /* must update code if this changes */ + int mpi_rank; /* needed by the VRFY macro */ uint32_t expected_value; - uint32_t * small_ds_buf_0 = NULL; - uint32_t * small_ds_buf_1 = NULL; - uint32_t * small_ds_buf_2 = NULL; - uint32_t * small_ds_slice_buf = NULL; - uint32_t * large_ds_buf_0 = NULL; - uint32_t * large_ds_buf_1 = NULL; - uint32_t * large_ds_buf_2 = NULL; - uint32_t * large_ds_slice_buf = NULL; uint32_t * ptr_0; uint32_t * ptr_1; - MPI_Comm mpi_comm = MPI_COMM_NULL; - MPI_Info mpi_info = MPI_INFO_NULL; - hid_t fid; /* HDF5 file ID */ hid_t acc_tpl; /* File access templates */ - hid_t xfer_plist = H5P_DEFAULT; - hid_t full_mem_small_ds_sid; - hid_t full_file_small_ds_sid; - hid_t mem_small_ds_sid; - hid_t file_small_ds_sid; - hid_t small_ds_slice_sid; - hid_t full_mem_large_ds_sid; - hid_t full_file_large_ds_sid; - hid_t mem_large_ds_sid; - hid_t file_large_ds_sid; - hid_t file_large_ds_process_slice_sid; - hid_t mem_large_ds_process_slice_sid; - hid_t large_ds_slice_sid; hid_t small_ds_dcpl_id = H5P_DEFAULT; hid_t large_ds_dcpl_id = H5P_DEFAULT; - hid_t small_dataset; /* Dataset ID */ - hid_t large_dataset; /* Dataset ID */ - size_t small_ds_size = 1; - size_t small_ds_slice_size = 1; - size_t large_ds_size = 1; - size_t large_ds_slice_size = 1; - hsize_t dims[PAR_SS_DR_MAX_RANK]; - hsize_t chunk_dims[PAR_SS_DR_MAX_RANK]; - hsize_t start[PAR_SS_DR_MAX_RANK]; - hsize_t stride[PAR_SS_DR_MAX_RANK]; - hsize_t count[PAR_SS_DR_MAX_RANK]; - hsize_t block[PAR_SS_DR_MAX_RANK]; - hsize_t * start_ptr = NULL; - hsize_t * stride_ptr = NULL; - hsize_t * count_ptr = NULL; - hsize_t * block_ptr = NULL; - htri_t check; /* Shape comparison return value */ herr_t ret; /* Generic return value */ HDassert( edge_size >= 6 ); @@ -183,107 +157,132 @@ contig_hyperslab_dr_pio_test__run_test(const int test_num, HDassert( ( chunk_edge_size == 0 ) || ( chunk_edge_size >= 3 ) ); HDassert( 1 < small_rank ); HDassert( small_rank < large_rank ); - HDassert( large_rank <= test_max_rank ); - HDassert( test_max_rank <= PAR_SS_DR_MAX_RANK ); + HDassert( large_rank <= PAR_SS_DR_MAX_RANK ); - MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); - MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); + tv_ptr->test_num = test_num; + tv_ptr->edge_size = edge_size; + tv_ptr->checker_edge_size = checker_edge_size; + tv_ptr->chunk_edge_size = chunk_edge_size; + tv_ptr->small_rank = small_rank; + tv_ptr->large_rank = large_rank; + tv_ptr->dset_type = dset_type; - HDassert( mpi_size >= 1 ); + MPI_Comm_size(MPI_COMM_WORLD, &(tv_ptr->mpi_size)); + MPI_Comm_rank(MPI_COMM_WORLD, &(tv_ptr->mpi_rank)); + /* the VRFY() macro needs the local variable mpi_rank -- set it up now */ + mpi_rank = tv_ptr->mpi_rank; - mpi_comm = MPI_COMM_WORLD; - mpi_info = MPI_INFO_NULL; + HDassert( tv_ptr->mpi_size >= 1 ); - for ( i = 0; i < small_rank - 1; i++ ) + tv_ptr->mpi_comm = MPI_COMM_WORLD; + tv_ptr->mpi_info = MPI_INFO_NULL; + + for ( i = 0; i < tv_ptr->small_rank - 1; i++ ) { - small_ds_size *= (size_t)edge_size; - small_ds_slice_size *= (size_t)edge_size; + tv_ptr->small_ds_size *= (size_t)(tv_ptr->edge_size); + tv_ptr->small_ds_slice_size *= (size_t)(tv_ptr->edge_size); } - small_ds_size *= (size_t)(mpi_size + 1); + tv_ptr->small_ds_size *= (size_t)(tv_ptr->mpi_size + 1); + + /* used by checker board tests only */ + tv_ptr->small_ds_offset = PAR_SS_DR_MAX_RANK - tv_ptr->small_rank; + HDassert( 0 < tv_ptr->small_ds_offset ); + HDassert( tv_ptr->small_ds_offset < PAR_SS_DR_MAX_RANK ); - for ( i = 0; i < large_rank - 1; i++ ) { + for ( i = 0; i < tv_ptr->large_rank - 1; i++ ) { - large_ds_size *= (size_t)edge_size; - large_ds_slice_size *= (size_t)edge_size; + tv_ptr->large_ds_size *= (size_t)(tv_ptr->edge_size); + tv_ptr->large_ds_slice_size *= (size_t)(tv_ptr->edge_size); } - large_ds_size *= (size_t)(mpi_size + 1); + tv_ptr->large_ds_size *= (size_t)(tv_ptr->mpi_size + 1); + + /* used by checker board tests only */ + tv_ptr->large_ds_offset = PAR_SS_DR_MAX_RANK - tv_ptr->large_rank; + + HDassert( 0 <= tv_ptr->large_ds_offset ); + HDassert( tv_ptr->large_ds_offset < PAR_SS_DR_MAX_RANK ); /* set up the start, stride, count, and block pointers */ - start_ptr = &(start[PAR_SS_DR_MAX_RANK - large_rank]); - stride_ptr = &(stride[PAR_SS_DR_MAX_RANK - large_rank]); - count_ptr = &(count[PAR_SS_DR_MAX_RANK - large_rank]); - block_ptr = &(block[PAR_SS_DR_MAX_RANK - large_rank]); + /* used by contiguous tests only */ + tv_ptr->start_ptr = &(tv_ptr->start[PAR_SS_DR_MAX_RANK - tv_ptr->large_rank]); + tv_ptr->stride_ptr = &(tv_ptr->stride[PAR_SS_DR_MAX_RANK - tv_ptr->large_rank]); + tv_ptr->count_ptr = &(tv_ptr->count[PAR_SS_DR_MAX_RANK - tv_ptr->large_rank]); + tv_ptr->block_ptr = &(tv_ptr->block[PAR_SS_DR_MAX_RANK - tv_ptr->large_rank]); /* Allocate buffers */ - small_ds_buf_0 = (uint32_t *)HDmalloc(sizeof(uint32_t) * small_ds_size); - VRFY((small_ds_buf_0 != NULL), "malloc of small_ds_buf_0 succeeded"); + tv_ptr->small_ds_buf_0 = (uint32_t *)HDmalloc(sizeof(uint32_t) * tv_ptr->small_ds_size); + VRFY((tv_ptr->small_ds_buf_0 != NULL), "malloc of small_ds_buf_0 succeeded"); - small_ds_buf_1 = (uint32_t *)HDmalloc(sizeof(uint32_t) * small_ds_size); - VRFY((small_ds_buf_1 != NULL), "malloc of small_ds_buf_1 succeeded"); + tv_ptr->small_ds_buf_1 = (uint32_t *)HDmalloc(sizeof(uint32_t) * tv_ptr->small_ds_size); + VRFY((tv_ptr->small_ds_buf_1 != NULL), "malloc of small_ds_buf_1 succeeded"); - small_ds_buf_2 = (uint32_t *)HDmalloc(sizeof(uint32_t) * small_ds_size); - VRFY((small_ds_buf_2 != NULL), "malloc of small_ds_buf_2 succeeded"); + tv_ptr->small_ds_buf_2 = (uint32_t *)HDmalloc(sizeof(uint32_t) * tv_ptr->small_ds_size); + VRFY((tv_ptr->small_ds_buf_2 != NULL), "malloc of small_ds_buf_2 succeeded"); - small_ds_slice_buf = - (uint32_t *)HDmalloc(sizeof(uint32_t) * small_ds_slice_size); - VRFY((small_ds_slice_buf != NULL), "malloc of small_ds_slice_buf succeeded"); + tv_ptr->small_ds_slice_buf = + (uint32_t *)HDmalloc(sizeof(uint32_t) * tv_ptr->small_ds_slice_size); + VRFY((tv_ptr->small_ds_slice_buf != NULL), "malloc of small_ds_slice_buf succeeded"); - large_ds_buf_0 = (uint32_t *)HDmalloc(sizeof(uint32_t) * large_ds_size); - VRFY((large_ds_buf_0 != NULL), "malloc of large_ds_buf_0 succeeded"); + tv_ptr->large_ds_buf_0 = (uint32_t *)HDmalloc(sizeof(uint32_t) * tv_ptr->large_ds_size); + VRFY((tv_ptr->large_ds_buf_0 != NULL), "malloc of large_ds_buf_0 succeeded"); - large_ds_buf_1 = (uint32_t *)HDmalloc(sizeof(uint32_t) * large_ds_size); - VRFY((large_ds_buf_1 != NULL), "malloc of large_ds_buf_1 succeeded"); + tv_ptr->large_ds_buf_1 = (uint32_t *)HDmalloc(sizeof(uint32_t) * tv_ptr->large_ds_size); + VRFY((tv_ptr->large_ds_buf_1 != NULL), "malloc of large_ds_buf_1 succeeded"); - large_ds_buf_2 = (uint32_t *)HDmalloc(sizeof(uint32_t) * large_ds_size); - VRFY((large_ds_buf_2 != NULL), "malloc of large_ds_buf_2 succeeded"); + tv_ptr->large_ds_buf_2 = (uint32_t *)HDmalloc(sizeof(uint32_t) * tv_ptr->large_ds_size); + VRFY((tv_ptr->large_ds_buf_2 != NULL), "malloc of large_ds_buf_2 succeeded"); - large_ds_slice_buf = - (uint32_t *)HDmalloc(sizeof(uint32_t) * large_ds_slice_size); - VRFY((large_ds_slice_buf != NULL), "malloc of large_ds_slice_buf succeeded"); + tv_ptr->large_ds_slice_buf = + (uint32_t *)HDmalloc(sizeof(uint32_t) * tv_ptr->large_ds_slice_size); + VRFY((tv_ptr->large_ds_slice_buf != NULL), "malloc of large_ds_slice_buf succeeded"); /* initialize the buffers */ - ptr_0 = small_ds_buf_0; - for(i = 0; i < (int)small_ds_size; i++) + ptr_0 = tv_ptr->small_ds_buf_0; + for(i = 0; i < (int)(tv_ptr->small_ds_size); i++) *ptr_0++ = (uint32_t)i; - HDmemset(small_ds_buf_1, 0, sizeof(uint32_t) * small_ds_size); - HDmemset(small_ds_buf_2, 0, sizeof(uint32_t) * small_ds_size); + HDmemset(tv_ptr->small_ds_buf_1, 0, sizeof(uint32_t) * tv_ptr->small_ds_size); + HDmemset(tv_ptr->small_ds_buf_2, 0, sizeof(uint32_t) * tv_ptr->small_ds_size); - HDmemset(small_ds_slice_buf, 0, sizeof(uint32_t) * small_ds_slice_size); + HDmemset(tv_ptr->small_ds_slice_buf, 0, sizeof(uint32_t) * tv_ptr->small_ds_slice_size); - ptr_0 = large_ds_buf_0; - for(i = 0; i < (int)large_ds_size; i++) + ptr_0 = tv_ptr->large_ds_buf_0; + for(i = 0; i < (int)(tv_ptr->large_ds_size); i++) *ptr_0++ = (uint32_t)i; - HDmemset(large_ds_buf_1, 0, sizeof(uint32_t) * large_ds_size); - HDmemset(large_ds_buf_2, 0, sizeof(uint32_t) * large_ds_size); + HDmemset(tv_ptr->large_ds_buf_1, 0, sizeof(uint32_t) * tv_ptr->large_ds_size); + HDmemset(tv_ptr->large_ds_buf_2, 0, sizeof(uint32_t) * tv_ptr->large_ds_size); - HDmemset(large_ds_slice_buf, 0, sizeof(uint32_t) * large_ds_slice_size); + HDmemset(tv_ptr->large_ds_slice_buf, 0, sizeof(uint32_t) * tv_ptr->large_ds_slice_size); filename = (const char *)GetTestParameters(); HDassert( filename != NULL ); -#if CONTIG_HYPERSLAB_DR_PIO_TEST__RUN_TEST__DEBUG +#if CONTIG_HS_DR_PIO_TEST__SETUP__DEBUG if ( MAINPROCESS ) { - HDfprintf(stdout, "%d: test num = %d.\n", mpi_rank, test_num); - HDfprintf(stdout, "%d: mpi_size = %d.\n", mpi_rank, mpi_size); + HDfprintf(stdout, "%d: test num = %d.\n", tv_ptr->mpi_rank, tv_ptr->test_num); + HDfprintf(stdout, "%d: mpi_size = %d.\n", tv_ptr->mpi_rank, tv_ptr->mpi_size); HDfprintf(stdout, "%d: small/large rank = %d/%d, use_collective_io = %d.\n", - mpi_rank, small_rank, large_rank, (int)use_collective_io); + tv_ptr->mpi_rank, tv_ptr->small_rank, tv_ptr->large_rank, + (int)use_collective_io); HDfprintf(stdout, "%d: edge_size = %d, chunk_edge_size = %d.\n", - mpi_rank, edge_size, chunk_edge_size); + tv_ptr->mpi_rank, tv_ptr->edge_size, tv_ptr->chunk_edge_size); + HDfprintf(stdout, "%d: checker_edge_size = %d.\n", + tv_ptr->mpi_rank, tv_ptr->checker_edge_size); HDfprintf(stdout, "%d: small_ds_size = %d, large_ds_size = %d.\n", - mpi_rank, (int)small_ds_size, (int)large_ds_size); - HDfprintf(stdout, "%d: filename = %s.\n", mpi_rank, filename); + tv_ptr->mpi_rank, (int)(tv_ptr->small_ds_size), + (int)(tv_ptr->large_ds_size)); + HDfprintf(stdout, "%d: filename = %s.\n", tv_ptr->mpi_rank, filename); } -#endif +#endif /* CONTIG_HS_DR_PIO_TEST__SETUP__DEBUG */ /* ---------------------------------------- * CREATE AN HDF5 FILE WITH PARALLEL ACCESS * ---------------------------------------*/ /* setup file access template */ - acc_tpl = create_faccess_plist(mpi_comm, mpi_info, facc_type, use_gpfs); + acc_tpl = create_faccess_plist(tv_ptr->mpi_comm, tv_ptr->mpi_info, facc_type, use_gpfs); VRFY((acc_tpl >= 0), "create_faccess_plist() succeeded"); /* set the alignment -- need it large so that we aren't always hitting the @@ -297,8 +296,8 @@ contig_hyperslab_dr_pio_test__run_test(const int test_num, } /* create the file collectively */ - fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, acc_tpl); - VRFY((fid >= 0), "H5Fcreate succeeded"); + tv_ptr->fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, acc_tpl); + VRFY((tv_ptr->fid >= 0), "H5Fcreate succeeded"); MESG("File opened."); @@ -308,60 +307,79 @@ contig_hyperslab_dr_pio_test__run_test(const int test_num, /* setup dims: */ - dims[0] = (hsize_t)(mpi_size + 1); - dims[1] = dims[2] = dims[3] = dims[4] = (hsize_t)edge_size; + tv_ptr->dims[0] = (hsize_t)(tv_ptr->mpi_size + 1); + tv_ptr->dims[1] = tv_ptr->dims[2] = + tv_ptr->dims[3] = tv_ptr->dims[4] = (hsize_t)(tv_ptr->edge_size); /* Create small ds dataspaces */ - full_mem_small_ds_sid = H5Screate_simple(small_rank, dims, NULL); - VRFY((full_mem_small_ds_sid != 0), + tv_ptr->full_mem_small_ds_sid = + H5Screate_simple(tv_ptr->small_rank, tv_ptr->dims, NULL); + VRFY((tv_ptr->full_mem_small_ds_sid != 0), "H5Screate_simple() full_mem_small_ds_sid succeeded"); - full_file_small_ds_sid = H5Screate_simple(small_rank, dims, NULL); - VRFY((full_file_small_ds_sid != 0), + tv_ptr->full_file_small_ds_sid = + H5Screate_simple(tv_ptr->small_rank, tv_ptr->dims, NULL); + VRFY((tv_ptr->full_file_small_ds_sid != 0), "H5Screate_simple() full_file_small_ds_sid succeeded"); - mem_small_ds_sid = H5Screate_simple(small_rank, dims, NULL); - VRFY((mem_small_ds_sid != 0), - "H5Screate_simple() mem_small_ds_sid succeeded"); + tv_ptr->mem_small_ds_sid = H5Screate_simple(tv_ptr->small_rank, tv_ptr->dims, NULL); + VRFY((tv_ptr->mem_small_ds_sid != 0), + "H5Screate_simple() mem_small_ds_sid succeeded"); + + tv_ptr->file_small_ds_sid_0 = H5Screate_simple(tv_ptr->small_rank, tv_ptr->dims, NULL); + VRFY((tv_ptr->file_small_ds_sid_0 != 0), + "H5Screate_simple() file_small_ds_sid_0 succeeded"); - file_small_ds_sid = H5Screate_simple(small_rank, dims, NULL); - VRFY((file_small_ds_sid != 0), - "H5Screate_simple() file_small_ds_sid succeeded"); + /* used by checker board tests only */ + tv_ptr->file_small_ds_sid_1 = H5Screate_simple(tv_ptr->small_rank, tv_ptr->dims, NULL); + VRFY((tv_ptr->file_small_ds_sid_1 != 0), + "H5Screate_simple() file_small_ds_sid_1 succeeded"); - small_ds_slice_sid = H5Screate_simple(small_rank - 1, &(dims[1]), NULL); - VRFY((small_ds_slice_sid != 0), + tv_ptr->small_ds_slice_sid = + H5Screate_simple(tv_ptr->small_rank - 1, &(tv_ptr->dims[1]), NULL); + VRFY((tv_ptr->small_ds_slice_sid != 0), "H5Screate_simple() small_ds_slice_sid succeeded"); /* Create large ds dataspaces */ - full_mem_large_ds_sid = H5Screate_simple(large_rank, dims, NULL); - VRFY((full_mem_large_ds_sid != 0), + tv_ptr->full_mem_large_ds_sid = + H5Screate_simple(tv_ptr->large_rank, tv_ptr->dims, NULL); + VRFY((tv_ptr->full_mem_large_ds_sid != 0), "H5Screate_simple() full_mem_large_ds_sid succeeded"); - full_file_large_ds_sid = H5Screate_simple(large_rank, dims, NULL); - VRFY((full_file_large_ds_sid != FAIL), + tv_ptr->full_file_large_ds_sid = + H5Screate_simple(tv_ptr->large_rank, tv_ptr->dims, NULL); + VRFY((tv_ptr->full_file_large_ds_sid != FAIL), "H5Screate_simple() full_file_large_ds_sid succeeded"); - mem_large_ds_sid = H5Screate_simple(large_rank, dims, NULL); - VRFY((mem_large_ds_sid != FAIL), + tv_ptr->mem_large_ds_sid = H5Screate_simple(tv_ptr->large_rank, tv_ptr->dims, NULL); + VRFY((tv_ptr->mem_large_ds_sid != FAIL), "H5Screate_simple() mem_large_ds_sid succeeded"); - file_large_ds_sid = H5Screate_simple(large_rank, dims, NULL); - VRFY((file_large_ds_sid != FAIL), - "H5Screate_simple() file_large_ds_sid succeeded"); + tv_ptr->file_large_ds_sid_0 = H5Screate_simple(tv_ptr->large_rank, tv_ptr->dims, NULL); + VRFY((tv_ptr->file_large_ds_sid_0 != FAIL), + "H5Screate_simple() file_large_ds_sid_0 succeeded"); + + /* used by checker board tests only */ + tv_ptr->file_large_ds_sid_1 = H5Screate_simple(tv_ptr->large_rank, tv_ptr->dims, NULL); + VRFY((tv_ptr->file_large_ds_sid_1 != FAIL), + "H5Screate_simple() file_large_ds_sid_1 succeeded"); - mem_large_ds_process_slice_sid = H5Screate_simple(large_rank, dims, NULL); - VRFY((mem_large_ds_process_slice_sid != FAIL), + tv_ptr->mem_large_ds_process_slice_sid = + H5Screate_simple(tv_ptr->large_rank, tv_ptr->dims, NULL); + VRFY((tv_ptr->mem_large_ds_process_slice_sid != FAIL), "H5Screate_simple() mem_large_ds_process_slice_sid succeeded"); - file_large_ds_process_slice_sid = H5Screate_simple(large_rank, dims, NULL); - VRFY((file_large_ds_process_slice_sid != FAIL), + tv_ptr->file_large_ds_process_slice_sid = + H5Screate_simple(tv_ptr->large_rank, tv_ptr->dims, NULL); + VRFY((tv_ptr->file_large_ds_process_slice_sid != FAIL), "H5Screate_simple() file_large_ds_process_slice_sid succeeded"); - large_ds_slice_sid = H5Screate_simple(large_rank - 1, &(dims[1]), NULL); - VRFY((large_ds_slice_sid != 0), + tv_ptr->large_ds_slice_sid = + H5Screate_simple(tv_ptr->large_rank - 1, &(tv_ptr->dims[1]), NULL); + VRFY((tv_ptr->large_ds_slice_sid != 0), "H5Screate_simple() large_ds_slice_sid succeeded"); @@ -369,10 +387,10 @@ contig_hyperslab_dr_pio_test__run_test(const int test_num, * large data set creation property lists to specify chunked * datasets. */ - if ( chunk_edge_size > 0 ) { + if ( tv_ptr->chunk_edge_size > 0 ) { /* Under Lustre (and perhaps other parallel file systems?) we get - * locking delays when two or more processes attempt to access the + * locking delays when two or more processes attempt to access the * same file system block. * * To minimize this problem, I have changed chunk_dims[0] @@ -390,14 +408,15 @@ contig_hyperslab_dr_pio_test__run_test(const int test_num, */ if ( express_test == 0 ) { - chunk_dims[0] = 1; + tv_ptr->chunk_dims[0] = 1; } else { - chunk_dims[0] = 1; + tv_ptr->chunk_dims[0] = 1; } - chunk_dims[1] = chunk_dims[2] = - chunk_dims[3] = chunk_dims[4] = (hsize_t)chunk_edge_size; + tv_ptr->chunk_dims[1] = tv_ptr->chunk_dims[2] = + tv_ptr->chunk_dims[3] = + tv_ptr->chunk_dims[4] = (hsize_t)(tv_ptr->chunk_edge_size); small_ds_dcpl_id = H5Pcreate(H5P_DATASET_CREATE); VRFY((ret != FAIL), "H5Pcreate() small_ds_dcpl_id succeeded"); @@ -405,7 +424,7 @@ contig_hyperslab_dr_pio_test__run_test(const int test_num, ret = H5Pset_layout(small_ds_dcpl_id, H5D_CHUNKED); VRFY((ret != FAIL), "H5Pset_layout() small_ds_dcpl_id succeeded"); - ret = H5Pset_chunk(small_ds_dcpl_id, small_rank, chunk_dims); + ret = H5Pset_chunk(small_ds_dcpl_id, tv_ptr->small_rank, tv_ptr->chunk_dims); VRFY((ret != FAIL), "H5Pset_chunk() small_ds_dcpl_id succeeded"); @@ -415,89 +434,88 @@ contig_hyperslab_dr_pio_test__run_test(const int test_num, ret = H5Pset_layout(large_ds_dcpl_id, H5D_CHUNKED); VRFY((ret != FAIL), "H5Pset_layout() large_ds_dcpl_id succeeded"); - ret = H5Pset_chunk(large_ds_dcpl_id, large_rank, chunk_dims); + ret = H5Pset_chunk(large_ds_dcpl_id, tv_ptr->large_rank, tv_ptr->chunk_dims); VRFY((ret != FAIL), "H5Pset_chunk() large_ds_dcpl_id succeeded"); } /* create the small dataset */ - small_dataset = H5Dcreate2(fid, "small_dataset", dset_type, - file_small_ds_sid, H5P_DEFAULT, - small_ds_dcpl_id, H5P_DEFAULT); + tv_ptr->small_dataset = H5Dcreate2(tv_ptr->fid, "small_dataset", tv_ptr->dset_type, + tv_ptr->file_small_ds_sid_0, H5P_DEFAULT, + small_ds_dcpl_id, H5P_DEFAULT); VRFY((ret != FAIL), "H5Dcreate2() small_dataset succeeded"); /* create the large dataset */ - large_dataset = H5Dcreate2(fid, "large_dataset", dset_type, - file_large_ds_sid, H5P_DEFAULT, - large_ds_dcpl_id, H5P_DEFAULT); + tv_ptr->large_dataset = H5Dcreate2(tv_ptr->fid, "large_dataset", tv_ptr->dset_type, + tv_ptr->file_large_ds_sid_0, H5P_DEFAULT, + large_ds_dcpl_id, H5P_DEFAULT); VRFY((ret != FAIL), "H5Dcreate2() large_dataset succeeded"); - /* setup xfer property list */ - xfer_plist = H5Pcreate(H5P_DATASET_XFER); - VRFY((xfer_plist >= 0), "H5Pcreate(H5P_DATASET_XFER) succeeded"); + tv_ptr->xfer_plist = H5Pcreate(H5P_DATASET_XFER); + VRFY((tv_ptr->xfer_plist >= 0), "H5Pcreate(H5P_DATASET_XFER) succeeded"); if(use_collective_io) { - ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); + ret = H5Pset_dxpl_mpio(tv_ptr->xfer_plist, H5FD_MPIO_COLLECTIVE); VRFY((ret >= 0), "H5Pset_dxpl_mpio succeeded"); } /* setup selection to write initial data to the small and large data sets */ - start[0] = (hsize_t)mpi_rank; - stride[0] = (hsize_t)(2 * (mpi_size + 1)); - count[0] = 1; - block[0] = 1; + tv_ptr->start[0] = (hsize_t)(tv_ptr->mpi_rank); + tv_ptr->stride[0] = (hsize_t)(2 * (tv_ptr->mpi_size + 1)); + tv_ptr->count[0] = 1; + tv_ptr->block[0] = 1; - for ( i = 1; i < large_rank; i++ ) { + for ( i = 1; i < tv_ptr->large_rank; i++ ) { - start[i] = 0; - stride[i] = (hsize_t)(2 * edge_size); - count[i] = 1; - block[i] = (hsize_t)edge_size; + tv_ptr->start[i] = 0; + tv_ptr->stride[i] = (hsize_t)(2 * tv_ptr->edge_size); + tv_ptr->count[i] = 1; + tv_ptr->block[i] = (hsize_t)(tv_ptr->edge_size); } /* setup selections for writing initial data to the small data set */ - ret = H5Sselect_hyperslab(mem_small_ds_sid, + ret = H5Sselect_hyperslab(tv_ptr->mem_small_ds_sid, H5S_SELECT_SET, - start, - stride, - count, - block); + tv_ptr->start, + tv_ptr->stride, + tv_ptr->count, + tv_ptr->block); VRFY((ret >= 0), "H5Sselect_hyperslab(mem_small_ds_sid, set) suceeded"); - ret = H5Sselect_hyperslab(file_small_ds_sid, + ret = H5Sselect_hyperslab(tv_ptr->file_small_ds_sid_0, H5S_SELECT_SET, - start, - stride, - count, - block); - VRFY((ret >= 0), "H5Sselect_hyperslab(file_small_ds_sid, set) suceeded"); + tv_ptr->start, + tv_ptr->stride, + tv_ptr->count, + tv_ptr->block); + VRFY((ret >= 0), "H5Sselect_hyperslab(file_small_ds_sid_0, set) suceeded"); if ( MAINPROCESS ) { /* add an additional slice to the selections */ - start[0] = (hsize_t)mpi_size; + tv_ptr->start[0] = (hsize_t)(tv_ptr->mpi_size); - ret = H5Sselect_hyperslab(mem_small_ds_sid, + ret = H5Sselect_hyperslab(tv_ptr->mem_small_ds_sid, H5S_SELECT_OR, - start, - stride, - count, - block); + tv_ptr->start, + tv_ptr->stride, + tv_ptr->count, + tv_ptr->block); VRFY((ret>= 0), "H5Sselect_hyperslab(mem_small_ds_sid, or) suceeded"); - ret = H5Sselect_hyperslab(file_small_ds_sid, + ret = H5Sselect_hyperslab(tv_ptr->file_small_ds_sid_0, H5S_SELECT_OR, - start, - stride, - count, - block); - VRFY((ret>= 0), "H5Sselect_hyperslab(file_small_ds_sid, or) suceeded"); + tv_ptr->start, + tv_ptr->stride, + tv_ptr->count, + tv_ptr->block); + VRFY((ret>= 0), "H5Sselect_hyperslab(file_small_ds_sid_0, or) suceeded"); } /* write the initial value of the small data set to file */ - ret = H5Dwrite(small_dataset, dset_type, mem_small_ds_sid, file_small_ds_sid, - xfer_plist, small_ds_buf_0); + ret = H5Dwrite(tv_ptr->small_dataset, tv_ptr->dset_type, tv_ptr->mem_small_ds_sid, + tv_ptr->file_small_ds_sid_0, tv_ptr->xfer_plist, tv_ptr->small_ds_buf_0); VRFY((ret >= 0), "H5Dwrite() small_dataset initial write succeeded"); @@ -511,24 +529,24 @@ contig_hyperslab_dr_pio_test__run_test(const int test_num, /* read the small data set back to verify that it contains the * expected data. Note that each process reads in the entire - * data set. + * data set and verifies it. */ - ret = H5Dread(small_dataset, + ret = H5Dread(tv_ptr->small_dataset, H5T_NATIVE_UINT32, - full_mem_small_ds_sid, - full_file_small_ds_sid, - xfer_plist, - small_ds_buf_1); + tv_ptr->full_mem_small_ds_sid, + tv_ptr->full_file_small_ds_sid, + tv_ptr->xfer_plist, + tv_ptr->small_ds_buf_1); VRFY((ret >= 0), "H5Dread() small_dataset initial read succeeded"); /* verify that the correct data was written to the small data set */ expected_value = 0; mis_match = FALSE; - ptr_1 = small_ds_buf_1; + ptr_1 = tv_ptr->small_ds_buf_1; i = 0; - for ( i = 0; i < (int)small_ds_size; i++ ) { + for ( i = 0; i < (int)(tv_ptr->small_ds_size); i++ ) { if ( *ptr_1 != expected_value ) { @@ -540,72 +558,72 @@ contig_hyperslab_dr_pio_test__run_test(const int test_num, VRFY( (mis_match == FALSE), "small ds init data good."); - /* setup selections for writing initial data to the large data set */ - start[0] = (hsize_t)mpi_rank; + tv_ptr->start[0] = (hsize_t)(tv_ptr->mpi_rank); - ret = H5Sselect_hyperslab(mem_large_ds_sid, + ret = H5Sselect_hyperslab(tv_ptr->mem_large_ds_sid, H5S_SELECT_SET, - start, - stride, - count, - block); + tv_ptr->start, + tv_ptr->stride, + tv_ptr->count, + tv_ptr->block); VRFY((ret >= 0), "H5Sselect_hyperslab(mem_large_ds_sid, set) suceeded"); - ret = H5Sselect_hyperslab(file_large_ds_sid, + ret = H5Sselect_hyperslab(tv_ptr->file_large_ds_sid_0, H5S_SELECT_SET, - start, - stride, - count, - block); - VRFY((ret >= 0), "H5Sselect_hyperslab(file_large_ds_sid, set) suceeded"); + tv_ptr->start, + tv_ptr->stride, + tv_ptr->count, + tv_ptr->block); + VRFY((ret >= 0), "H5Sselect_hyperslab(file_large_ds_sid_0, set) suceeded"); /* In passing, setup the process slice data spaces as well */ - ret = H5Sselect_hyperslab(mem_large_ds_process_slice_sid, + ret = H5Sselect_hyperslab(tv_ptr->mem_large_ds_process_slice_sid, H5S_SELECT_SET, - start, - stride, - count, - block); + tv_ptr->start, + tv_ptr->stride, + tv_ptr->count, + tv_ptr->block); VRFY((ret >= 0), "H5Sselect_hyperslab(mem_large_ds_process_slice_sid, set) suceeded"); - ret = H5Sselect_hyperslab(file_large_ds_process_slice_sid, + ret = H5Sselect_hyperslab(tv_ptr->file_large_ds_process_slice_sid, H5S_SELECT_SET, - start, - stride, - count, - block); + tv_ptr->start, + tv_ptr->stride, + tv_ptr->count, + tv_ptr->block); VRFY((ret >= 0), "H5Sselect_hyperslab(file_large_ds_process_slice_sid, set) suceeded"); if ( MAINPROCESS ) { /* add an additional slice to the selections */ - start[0] = (hsize_t)mpi_size; + tv_ptr->start[0] = (hsize_t)(tv_ptr->mpi_size); - ret = H5Sselect_hyperslab(mem_large_ds_sid, + ret = H5Sselect_hyperslab(tv_ptr->mem_large_ds_sid, H5S_SELECT_OR, - start, - stride, - count, - block); + tv_ptr->start, + tv_ptr->stride, + tv_ptr->count, + tv_ptr->block); VRFY((ret>= 0), "H5Sselect_hyperslab(mem_large_ds_sid, or) suceeded"); - ret = H5Sselect_hyperslab(file_large_ds_sid, + ret = H5Sselect_hyperslab(tv_ptr->file_large_ds_sid_0, H5S_SELECT_OR, - start, - stride, - count, - block); - VRFY((ret>= 0), "H5Sselect_hyperslab(file_large_ds_sid, or) suceeded"); + tv_ptr->start, + tv_ptr->stride, + tv_ptr->count, + tv_ptr->block); + VRFY((ret>= 0), "H5Sselect_hyperslab(file_large_ds_sid_0, or) suceeded"); } /* write the initial value of the large data set to file */ - ret = H5Dwrite(large_dataset, dset_type, mem_large_ds_sid, file_large_ds_sid, - xfer_plist, large_ds_buf_0); + ret = H5Dwrite(tv_ptr->large_dataset, tv_ptr->dset_type, + tv_ptr->mem_large_ds_sid, tv_ptr->file_large_ds_sid_0, + tv_ptr->xfer_plist, tv_ptr->large_ds_buf_0); if ( ret < 0 ) H5Eprint2(H5E_DEFAULT, stderr); VRFY((ret >= 0), "H5Dwrite() large_dataset initial write succeeded"); @@ -618,26 +636,26 @@ contig_hyperslab_dr_pio_test__run_test(const int test_num, } - /* read the small data set back to verify that it contains the + /* read the large data set back to verify that it contains the * expected data. Note that each process reads in the entire * data set. */ - ret = H5Dread(large_dataset, + ret = H5Dread(tv_ptr->large_dataset, H5T_NATIVE_UINT32, - full_mem_large_ds_sid, - full_file_large_ds_sid, - xfer_plist, - large_ds_buf_1); + tv_ptr->full_mem_large_ds_sid, + tv_ptr->full_file_large_ds_sid, + tv_ptr->xfer_plist, + tv_ptr->large_ds_buf_1); VRFY((ret >= 0), "H5Dread() large_dataset initial read succeeded"); /* verify that the correct data was written to the large data set */ expected_value = 0; mis_match = FALSE; - ptr_1 = large_ds_buf_1; + ptr_1 = tv_ptr->large_ds_buf_1; i = 0; - for ( i = 0; i < (int)large_ds_size; i++ ) { + for ( i = 0; i < (int)(tv_ptr->large_ds_size); i++ ) { if ( *ptr_1 != expected_value ) { @@ -657,18 +675,170 @@ contig_hyperslab_dr_pio_test__run_test(const int test_num, VRFY((mrc==MPI_SUCCESS), "Sync initial values check"); } + return; + +} /* hs_dr_pio_test__setup() */ + + +/*------------------------------------------------------------------------- + * Function: hs_dr_pio_test__takedown() + * + * Purpose: Do takedown after tests of I/O to/from hyperslab selections + * of different rank in the parallel case. + * + * Return: void + * + * Programmer: JRM -- 9/18/09 + * + * Modifications: + * + * None. + * + *------------------------------------------------------------------------- + */ + +#define HS_DR_PIO_TEST__TAKEDOWN__DEBUG 0 + +static void +hs_dr_pio_test__takedown( struct hs_dr_pio_test_vars_t * tv_ptr) +{ +#if HS_DR_PIO_TEST__TAKEDOWN__DEBUG + const char *fcnName = "hs_dr_pio_test__takedown()"; +#endif /* HS_DR_PIO_TEST__TAKEDOWN__DEBUG */ + int mpi_rank; /* needed by the VRFY macro */ + herr_t ret; /* Generic return value */ + + /* initialize the local copy of mpi_rank */ + mpi_rank = tv_ptr->mpi_rank; + + /* Close property lists */ + if ( tv_ptr->xfer_plist != H5P_DEFAULT ) { + ret = H5Pclose(tv_ptr->xfer_plist); + VRFY((ret != FAIL), "H5Pclose(xfer_plist) succeeded"); + } + + /* Close dataspaces */ + ret = H5Sclose(tv_ptr->full_mem_small_ds_sid); + VRFY((ret != FAIL), "H5Sclose(full_mem_small_ds_sid) succeeded"); + + ret = H5Sclose(tv_ptr->full_file_small_ds_sid); + VRFY((ret != FAIL), "H5Sclose(full_file_small_ds_sid) succeeded"); + + ret = H5Sclose(tv_ptr->mem_small_ds_sid); + VRFY((ret != FAIL), "H5Sclose(mem_small_ds_sid) succeeded"); + + ret = H5Sclose(tv_ptr->file_small_ds_sid_0); + VRFY((ret != FAIL), "H5Sclose(file_small_ds_sid_0) succeeded"); + + ret = H5Sclose(tv_ptr->file_small_ds_sid_1); + VRFY((ret != FAIL), "H5Sclose(file_small_ds_sid_1) succeeded"); + + ret = H5Sclose(tv_ptr->small_ds_slice_sid); + VRFY((ret != FAIL), "H5Sclose(small_ds_slice_sid) succeeded"); + + ret = H5Sclose(tv_ptr->full_mem_large_ds_sid); + VRFY((ret != FAIL), "H5Sclose(full_mem_large_ds_sid) succeeded"); + + ret = H5Sclose(tv_ptr->full_file_large_ds_sid); + VRFY((ret != FAIL), "H5Sclose(full_file_large_ds_sid) succeeded"); + + ret = H5Sclose(tv_ptr->mem_large_ds_sid); + VRFY((ret != FAIL), "H5Sclose(mem_large_ds_sid) succeeded"); + + ret = H5Sclose(tv_ptr->file_large_ds_sid_0); + VRFY((ret != FAIL), "H5Sclose(file_large_ds_sid_0) succeeded"); + + ret = H5Sclose(tv_ptr->file_large_ds_sid_1); + VRFY((ret != FAIL), "H5Sclose(file_large_ds_sid_1) succeeded"); + + ret = H5Sclose(tv_ptr->mem_large_ds_process_slice_sid); + VRFY((ret != FAIL), "H5Sclose(mem_large_ds_process_slice_sid) succeeded"); + + ret = H5Sclose(tv_ptr->file_large_ds_process_slice_sid); + VRFY((ret != FAIL), "H5Sclose(file_large_ds_process_slice_sid) succeeded"); + + ret = H5Sclose(tv_ptr->large_ds_slice_sid); + VRFY((ret != FAIL), "H5Sclose(large_ds_slice_sid) succeeded"); + + /* Close Datasets */ + ret = H5Dclose(tv_ptr->small_dataset); + VRFY((ret != FAIL), "H5Dclose(small_dataset) succeeded"); + + ret = H5Dclose(tv_ptr->large_dataset); + VRFY((ret != FAIL), "H5Dclose(large_dataset) succeeded"); + + /* close the file collectively */ + MESG("about to close file."); + ret = H5Fclose(tv_ptr->fid); + VRFY((ret != FAIL), "file close succeeded"); + + /* Free memory buffers */ + + if ( tv_ptr->small_ds_buf_0 != NULL ) HDfree(tv_ptr->small_ds_buf_0); + if ( tv_ptr->small_ds_buf_1 != NULL ) HDfree(tv_ptr->small_ds_buf_1); + if ( tv_ptr->small_ds_buf_2 != NULL ) HDfree(tv_ptr->small_ds_buf_2); + if ( tv_ptr->small_ds_slice_buf != NULL ) HDfree(tv_ptr->small_ds_slice_buf); + + if ( tv_ptr->large_ds_buf_0 != NULL ) HDfree(tv_ptr->large_ds_buf_0); + if ( tv_ptr->large_ds_buf_1 != NULL ) HDfree(tv_ptr->large_ds_buf_1); + if ( tv_ptr->large_ds_buf_2 != NULL ) HDfree(tv_ptr->large_ds_buf_2); + if ( tv_ptr->large_ds_slice_buf != NULL ) HDfree(tv_ptr->large_ds_slice_buf); + + return; + +} /* hs_dr_pio_test__takedown() */ + + +/*------------------------------------------------------------------------- + * Function: contig_hs_dr_pio_test__d2m_l2s() + * + * Purpose: Part one of a series of tests of I/O to/from hyperslab + * selections of different rank in the parallel. + * + * Verify that we can read from disk correctly using + * selections of different rank that H5S_select_shape_same() + * views as being of the same shape. + * + * In this function, we test this by reading small_rank - 1 + * slices from the on disk large cube, and verifying that the + * data read is correct. Verify that H5S_select_shape_same() + * returns true on the memory and file selections. + * + * Return: void + * + * Programmer: JRM -- 9/10/11 + * + * Modifications: + * + * None. + * + *------------------------------------------------------------------------- + */ + +#define CONTIG_HS_DR_PIO_TEST__D2M_L2S__DEBUG 0 + +static void +contig_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) +{ +#if CONTIG_HS_DR_PIO_TEST__D2M_L2S__DEBUG + const char *fcnName = "contig_hs_dr_pio_test__run_test()"; +#endif /* CONTIG_HS_DR_PIO_TEST__D2M_L2S__DEBUG */ + hbool_t mis_match = FALSE; + int i, j, k, l; + size_t n; + int mpi_rank; /* needed by the VRFY macro */ + uint32_t expected_value; + uint32_t * ptr_1; + htri_t check; /* Shape comparison return value */ + herr_t ret; /* Generic return value */ + + /* initialize the local copy of mpi_rank */ + mpi_rank = tv_ptr->mpi_rank; - /* first, verify that we can read from disk correctly using selections - * of different rank that H5S_select_shape_same() views as being of the - * same shape. - * - * Start by reading small_rank-D - 1 slice from the on disk large cube, - * and verifying that the data read is correct. Verify that - * H5S_select_shape_same() returns true on the memory and file selections. - */ /* We have already done a H5Sselect_all() on the data space - * small_ds_slice_sid, so no need to call H5Sselect_all() again. + * small_ds_slice_sid in the initialization phase, so no need to + * call H5Sselect_all() again. */ /* set up start, stride, count, and block -- note that we will @@ -676,27 +846,28 @@ contig_hyperslab_dr_pio_test__run_test(const int test_num, */ for ( i = 0; i < PAR_SS_DR_MAX_RANK; i++ ) { - start[i] = 0; - stride[i] = (hsize_t)(2 * edge_size); - count[i] = 1; - if ( (PAR_SS_DR_MAX_RANK - i) > (small_rank - 1) ) { + tv_ptr->start[i] = 0; + tv_ptr->stride[i] = (hsize_t)(2 * tv_ptr->edge_size); + tv_ptr->count[i] = 1; + if ( (PAR_SS_DR_MAX_RANK - i) > (tv_ptr->small_rank - 1) ) { - block[i] = 1; + tv_ptr->block[i] = 1; } else { - block[i] = (hsize_t)edge_size; + tv_ptr->block[i] = (hsize_t)(tv_ptr->edge_size); } } /* zero out the buffer we will be reading into */ - HDmemset(small_ds_slice_buf, 0, sizeof(uint32_t) * small_ds_slice_size); + HDmemset(tv_ptr->small_ds_slice_buf, 0, sizeof(uint32_t) * tv_ptr->small_ds_slice_size); -#if CONTIG_HYPERSLAB_DR_PIO_TEST__RUN_TEST__DEBUG +#if CONTIG_HS_DR_PIO_TEST__D2M_L2S__DEBUG HDfprintf(stdout, "%s reading slices from big cube on disk into small cube slice.\n", fcnName); -#endif +#endif /* CONTIG_HS_DR_PIO_TEST__D2M_L2S__DEBUG */ + /* in serial versions of this test, we loop through all the dimensions * of the large data set. However, in the parallel version, each * process only works with that slice of the large cube indicated @@ -704,9 +875,9 @@ contig_hyperslab_dr_pio_test__run_test(const int test_num, * mpi_rank, and don't itterate over it. */ - if ( PAR_SS_DR_MAX_RANK - large_rank == 0 ) { + if ( PAR_SS_DR_MAX_RANK - tv_ptr->large_rank == 0 ) { - i = mpi_rank; + i = tv_ptr->mpi_rank; } else { @@ -719,9 +890,9 @@ contig_hyperslab_dr_pio_test__run_test(const int test_num, * test. */ - if ( PAR_SS_DR_MAX_RANK - large_rank == 1 ) { + if ( PAR_SS_DR_MAX_RANK - tv_ptr->large_rank == 1 ) { - j = mpi_rank; + j = tv_ptr->mpi_rank; } else { @@ -729,9 +900,9 @@ contig_hyperslab_dr_pio_test__run_test(const int test_num, } do { - if ( PAR_SS_DR_MAX_RANK - large_rank == 2 ) { + if ( PAR_SS_DR_MAX_RANK - tv_ptr->large_rank == 2 ) { - k = mpi_rank; + k = tv_ptr->mpi_rank; } else { @@ -751,145 +922,213 @@ contig_hyperslab_dr_pio_test__run_test(const int test_num, l = 0; do { - /* we know that small_rank - 1 >= 1 and that - * large_rank > small_rank by the assertions at the head - * of this function. Thus no need for another inner loop. - */ - start[0] = (hsize_t)i; - start[1] = (hsize_t)j; - start[2] = (hsize_t)k; - start[3] = (hsize_t)l; - start[4] = 0; - - ret = H5Sselect_hyperslab(file_large_ds_sid, - H5S_SELECT_SET, - start_ptr, - stride_ptr, - count_ptr, - block_ptr); - VRFY((ret != FAIL), - "H5Sselect_hyperslab(file_large_cube_sid) succeeded"); - - - /* verify that H5S_select_shape_same() reports the two - * selections as having the same shape. - */ - check = H5S_select_shape_same_test(small_ds_slice_sid, - file_large_ds_sid); - VRFY((check == TRUE), "H5S_select_shape_same_test passed"); - - - /* Read selection from disk */ -#if CONTIG_HYPERSLAB_DR_PIO_TEST__RUN_TEST__DEBUG - HDfprintf(stdout, "%s:%d: start = %d %d %d %d %d.\n", - fcnName, (int)mpi_rank, - (int)start[0], (int)start[1], (int)start[2], - (int)start[3], (int)start[4]); - HDfprintf(stdout, "%s slice/file extent dims = %d/%d.\n", - fcnName, - H5Sget_simple_extent_ndims(small_ds_slice_sid), - H5Sget_simple_extent_ndims(file_large_ds_sid)); -#endif - ret = H5Dread(large_dataset, - H5T_NATIVE_UINT32, - small_ds_slice_sid, - file_large_ds_sid, - xfer_plist, - small_ds_slice_buf); - VRFY((ret >= 0), "H5Dread() slice from large ds succeeded."); + if ( (tv_ptr->skips)++ < tv_ptr->max_skips ) { /* skip the test */ + + (tv_ptr->tests_skipped)++; + } else { /* run the test */ - /* verify that expected data is retrieved */ + tv_ptr->skips = 0; /* reset the skips counter */ - mis_match = FALSE; - ptr_1 = small_ds_slice_buf; - expected_value = (uint32_t)( - (i * edge_size * edge_size * edge_size * edge_size) + - (j * edge_size * edge_size * edge_size) + - (k * edge_size * edge_size) + - (l * edge_size)); + /* we know that small_rank - 1 >= 1 and that + * large_rank > small_rank by the assertions at the head + * of this function. Thus no need for another inner loop. + */ + tv_ptr->start[0] = (hsize_t)i; + tv_ptr->start[1] = (hsize_t)j; + tv_ptr->start[2] = (hsize_t)k; + tv_ptr->start[3] = (hsize_t)l; + tv_ptr->start[4] = 0; + + ret = H5Sselect_hyperslab(tv_ptr->file_large_ds_sid_0, + H5S_SELECT_SET, + tv_ptr->start_ptr, + tv_ptr->stride_ptr, + tv_ptr->count_ptr, + tv_ptr->block_ptr); + VRFY((ret != FAIL), + "H5Sselect_hyperslab(file_large_cube_sid) succeeded"); + + + /* verify that H5S_select_shape_same() reports the two + * selections as having the same shape. + */ + check = H5S_select_shape_same_test(tv_ptr->small_ds_slice_sid, + tv_ptr->file_large_ds_sid_0); + VRFY((check == TRUE), "H5S_select_shape_same_test passed"); + + + /* Read selection from disk */ +#if CONTIG_HS_DR_PIO_TEST__D2M_L2S__DEBUG + HDfprintf(stdout, "%s:%d: start = %d %d %d %d %d.\n", + fcnName, (int)(tv_ptr->mpi_rank), + (int)(tv_ptr->start[0]), (int)(tv_ptr->start[1]), + (int)(tv_ptr->start[2]), (int)(tv_ptr->start[3]), + (int)(tv_ptr->start[4])); + HDfprintf(stdout, "%s slice/file extent dims = %d/%d.\n", + fcnName, + H5Sget_simple_extent_ndims(tv_ptr->small_ds_slice_sid), + H5Sget_simple_extent_ndims(tv_ptr->file_large_ds_sid_0)); +#endif /* CONTIG_HS_DR_PIO_TEST__D2M_L2S__DEBUG */ + ret = H5Dread(tv_ptr->large_dataset, + H5T_NATIVE_UINT32, + tv_ptr->small_ds_slice_sid, + tv_ptr->file_large_ds_sid_0, + tv_ptr->xfer_plist, + tv_ptr->small_ds_slice_buf); + VRFY((ret >= 0), "H5Dread() slice from large ds succeeded."); + + + /* verify that expected data is retrieved */ + + mis_match = FALSE; + ptr_1 = tv_ptr->small_ds_slice_buf; + expected_value = (uint32_t)( + (i * tv_ptr->edge_size * tv_ptr->edge_size * + tv_ptr->edge_size * tv_ptr->edge_size) + + (j * tv_ptr->edge_size * tv_ptr->edge_size * tv_ptr->edge_size) + + (k * tv_ptr->edge_size * tv_ptr->edge_size) + + (l * tv_ptr->edge_size)); + + for ( n = 0; n < tv_ptr->small_ds_slice_size; n++ ) { + + if ( *ptr_1 != expected_value ) { - for ( n = 0; n < small_ds_slice_size; n++ ) { + mis_match = TRUE; + } - if ( *ptr_1 != expected_value ) { + *ptr_1 = 0; /* zero data for next use */ - mis_match = TRUE; + ptr_1++; + expected_value++; } - *ptr_1 = 0; /* zero data for next use */ + VRFY((mis_match == FALSE), + "small slice read from large ds data good."); - ptr_1++; - expected_value++; + (tv_ptr->tests_run)++; } - VRFY((mis_match == FALSE), - "small slice read from large ds data good."); l++; - } while ( ( large_rank > 2 ) && - ( (small_rank - 1) <= 1 ) && - ( l < edge_size ) ); + (tv_ptr->total_tests)++; + + } while ( ( tv_ptr->large_rank > 2 ) && + ( (tv_ptr->small_rank - 1) <= 1 ) && + ( l < tv_ptr->edge_size ) ); k++; - } while ( ( large_rank > 3 ) && - ( (small_rank - 1) <= 2 ) && - ( k < edge_size ) ); + } while ( ( tv_ptr->large_rank > 3 ) && + ( (tv_ptr->small_rank - 1) <= 2 ) && + ( k < tv_ptr->edge_size ) ); j++; - } while ( ( large_rank > 4 ) && - ( (small_rank - 1) <= 3 ) && - ( j < edge_size ) ); + } while ( ( tv_ptr->large_rank > 4 ) && + ( (tv_ptr->small_rank - 1) <= 3 ) && + ( j < tv_ptr->edge_size ) ); + return; - /* similarly, read slices of the on disk small data set into slices +} /* contig_hs_dr_pio_test__d2m_l2s() */ + + +/*------------------------------------------------------------------------- + * Function: contig_hs_dr_pio_test__d2m_s2l() + * + * Purpose: Part two of a series of tests of I/O to/from hyperslab + * selections of different rank in the parallel. + * + * Verify that we can read from disk correctly using + * selections of different rank that H5S_select_shape_same() + * views as being of the same shape. + * + * In this function, we test this by reading slices of the + * on disk small data set into slices through the in memory + * large data set, and verify that the correct data (and + * only the correct data) is read. + * + * Return: void + * + * Programmer: JRM -- 8/10/11 + * + * Modifications: + * + * None. + * + *------------------------------------------------------------------------- + */ + +#define CONTIG_HS_DR_PIO_TEST__D2M_S2L__DEBUG 0 + +static void +contig_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) +{ +#if CONTIG_HS_DR_PIO_TEST__D2M_S2L__DEBUG + const char *fcnName = "contig_hs_dr_pio_test__d2m_s2l()"; +#endif /* CONTIG_HS_DR_PIO_TEST__D2M_S2L__DEBUG */ + hbool_t mis_match = FALSE; + int i, j, k, l; + size_t n; + int mpi_rank; /* needed by the VRFY macro */ + size_t start_index; + size_t stop_index; + uint32_t expected_value; + uint32_t * ptr_1; + htri_t check; /* Shape comparison return value */ + herr_t ret; /* Generic return value */ + + /* initialize the local copy of mpi_rank */ + mpi_rank = tv_ptr->mpi_rank; + + /* Read slices of the on disk small data set into slices * through the in memory large data set, and verify that the correct * data (and only the correct data) is read. */ - start[0] = (hsize_t)mpi_rank; - stride[0] = (hsize_t)(2 * (mpi_size + 1)); - count[0] = 1; - block[0] = 1; + tv_ptr->start[0] = (hsize_t)(tv_ptr->mpi_rank); + tv_ptr->stride[0] = (hsize_t)(2 * (tv_ptr->mpi_size + 1)); + tv_ptr->count[0] = 1; + tv_ptr->block[0] = 1; - for ( i = 1; i < large_rank; i++ ) { + for ( i = 1; i < tv_ptr->large_rank; i++ ) { - start[i] = 0; - stride[i] = (hsize_t)(2 * edge_size); - count[i] = 1; - block[i] = (hsize_t)edge_size; + tv_ptr->start[i] = 0; + tv_ptr->stride[i] = (hsize_t)(2 * tv_ptr->edge_size); + tv_ptr->count[i] = 1; + tv_ptr->block[i] = (hsize_t)(tv_ptr->edge_size); } - ret = H5Sselect_hyperslab(file_small_ds_sid, + ret = H5Sselect_hyperslab(tv_ptr->file_small_ds_sid_0, H5S_SELECT_SET, - start, - stride, - count, - block); - VRFY((ret >= 0), "H5Sselect_hyperslab(file_small_ds_sid, set) suceeded"); + tv_ptr->start, + tv_ptr->stride, + tv_ptr->count, + tv_ptr->block); + VRFY((ret >= 0), "H5Sselect_hyperslab(file_small_ds_sid_0, set) suceeded"); -#if CONTIG_HYPERSLAB_DR_PIO_TEST__RUN_TEST__DEBUG +#if CONTIG_HS_DR_PIO_TEST__D2M_S2L__DEBUG HDfprintf(stdout, "%s reading slices of on disk small data set into slices of big data set.\n", fcnName); -#endif +#endif /* CONTIG_HS_DR_PIO_TEST__D2M_S2L__DEBUG */ /* zero out the in memory large ds */ - HDmemset(large_ds_buf_1, 0, sizeof(uint32_t) * large_ds_size); + HDmemset(tv_ptr->large_ds_buf_1, 0, sizeof(uint32_t) * tv_ptr->large_ds_size); /* set up start, stride, count, and block -- note that we will * change start[] so as to read slices of the large cube. */ for ( i = 0; i < PAR_SS_DR_MAX_RANK; i++ ) { - start[i] = 0; - stride[i] = (hsize_t)(2 * edge_size); - count[i] = 1; - if ( (PAR_SS_DR_MAX_RANK - i) > (small_rank - 1) ) { + tv_ptr->start[i] = 0; + tv_ptr->stride[i] = (hsize_t)(2 * tv_ptr->edge_size); + tv_ptr->count[i] = 1; + if ( (PAR_SS_DR_MAX_RANK - i) > (tv_ptr->small_rank - 1) ) { - block[i] = 1; + tv_ptr->block[i] = 1; } else { - block[i] = (hsize_t)edge_size; + tv_ptr->block[i] = (hsize_t)(tv_ptr->edge_size); } } @@ -904,9 +1143,9 @@ contig_hyperslab_dr_pio_test__run_test(const int test_num, */ - if ( PAR_SS_DR_MAX_RANK - large_rank == 0 ) { + if ( PAR_SS_DR_MAX_RANK - tv_ptr->large_rank == 0 ) { - i = mpi_rank; + i = tv_ptr->mpi_rank; } else { @@ -919,9 +1158,9 @@ contig_hyperslab_dr_pio_test__run_test(const int test_num, * test. */ - if ( PAR_SS_DR_MAX_RANK - large_rank == 1 ) { + if ( PAR_SS_DR_MAX_RANK - tv_ptr->large_rank == 1 ) { - j = mpi_rank; + j = tv_ptr->mpi_rank; } else { @@ -929,9 +1168,9 @@ contig_hyperslab_dr_pio_test__run_test(const int test_num, } do { - if ( PAR_SS_DR_MAX_RANK - large_rank == 2 ) { + if ( PAR_SS_DR_MAX_RANK - tv_ptr->large_rank == 2 ) { - k = mpi_rank; + k = tv_ptr->mpi_rank; } else { @@ -951,147 +1190,218 @@ contig_hyperslab_dr_pio_test__run_test(const int test_num, l = 0; do { - /* we know that small_rank >= 1 and that large_rank > small_rank - * by the assertions at the head of this function. Thus no - * need for another inner loop. - */ - start[0] = (hsize_t)i; - start[1] = (hsize_t)j; - start[2] = (hsize_t)k; - start[3] = (hsize_t)l; - start[4] = 0; - - ret = H5Sselect_hyperslab(mem_large_ds_sid, - H5S_SELECT_SET, - start_ptr, - stride_ptr, - count_ptr, - block_ptr); - VRFY((ret != FAIL), - "H5Sselect_hyperslab(mem_large_ds_sid) succeeded"); - - - /* verify that H5S_select_shape_same() reports the two - * selections as having the same shape. - */ - check = H5S_select_shape_same_test(file_small_ds_sid, - mem_large_ds_sid); - VRFY((check == TRUE), "H5S_select_shape_same_test passed"); - - - /* Read selection from disk */ -#if CONTIG_HYPERSLAB_DR_PIO_TEST__RUN_TEST__DEBUG - HDfprintf(stdout, "%s:%d: start = %d %d %d %d %d.\n", - fcnName, (int)mpi_rank, - (int)start[0], (int)start[1], (int)start[2], - (int)start[3], (int)start[4]); - HDfprintf(stdout, "%s:%d: mem/file extent dims = %d/%d.\n", - fcnName, mpi_rank, - H5Sget_simple_extent_ndims(mem_large_ds_sid), - H5Sget_simple_extent_ndims(file_small_ds_sid)); -#endif - ret = H5Dread(small_dataset, - H5T_NATIVE_UINT32, - mem_large_ds_sid, - file_small_ds_sid, - xfer_plist, - large_ds_buf_1); - VRFY((ret >= 0), "H5Dread() slice from small ds succeeded."); - - /* verify that the expected data and only the - * expected data was read. - */ - ptr_1 = large_ds_buf_1; - expected_value = (uint32_t)((size_t)mpi_rank * small_ds_slice_size); - start_index = (size_t)( - (i * edge_size * edge_size * edge_size * edge_size) + - (j * edge_size * edge_size * edge_size) + - (k * edge_size * edge_size) + - (l * edge_size)); - stop_index = start_index + small_ds_slice_size - 1; - - HDassert( start_index < stop_index ); - HDassert( stop_index <= large_ds_size ); - - for ( n = 0; n < large_ds_size; n++ ) { - - if ( ( n >= start_index ) && ( n <= stop_index ) ) { - - if ( *ptr_1 != expected_value ) { + if ( (tv_ptr->skips)++ < tv_ptr->max_skips ) { /* skip the test */ - mis_match = TRUE; - } - expected_value++; + (tv_ptr->tests_skipped)++; - } else { + } else { /* run the test */ - if ( *ptr_1 != 0 ) { + tv_ptr->skips = 0; /* reset the skips counter */ - mis_match = TRUE; + /* we know that small_rank >= 1 and that large_rank > small_rank + * by the assertions at the head of this function. Thus no + * need for another inner loop. + */ + tv_ptr->start[0] = (hsize_t)i; + tv_ptr->start[1] = (hsize_t)j; + tv_ptr->start[2] = (hsize_t)k; + tv_ptr->start[3] = (hsize_t)l; + tv_ptr->start[4] = 0; + + ret = H5Sselect_hyperslab(tv_ptr->mem_large_ds_sid, + H5S_SELECT_SET, + tv_ptr->start_ptr, + tv_ptr->stride_ptr, + tv_ptr->count_ptr, + tv_ptr->block_ptr); + VRFY((ret != FAIL), + "H5Sselect_hyperslab(mem_large_ds_sid) succeeded"); + + + /* verify that H5S_select_shape_same() reports the two + * selections as having the same shape. + */ + check = H5S_select_shape_same_test(tv_ptr->file_small_ds_sid_0, + tv_ptr->mem_large_ds_sid); + VRFY((check == TRUE), "H5S_select_shape_same_test passed"); + + + /* Read selection from disk */ +#if CONTIG_HS_DR_PIO_TEST__D2M_S2L__DEBUG + HDfprintf(stdout, "%s:%d: start = %d %d %d %d %d.\n", + fcnName, (int)(tv_ptr->mpi_rank), + (int)(tv_ptr->start[0]), (int)(tv_ptr->start[1]), + (int)(tv_ptr->start[2]), (int)(tv_ptr->start[3]), + (int)(tv_ptr->start[4])); + HDfprintf(stdout, "%s:%d: mem/file extent dims = %d/%d.\n", + fcnName, tv_ptr->mpi_rank, + H5Sget_simple_extent_ndims(tv_ptr->mem_large_ds_sid), + H5Sget_simple_extent_ndims(tv_ptr->file_small_ds_sid_0)); +#endif /* CONTIG_HS_DR_PIO_TEST__D2M_S2L__DEBUG */ + ret = H5Dread(tv_ptr->small_dataset, + H5T_NATIVE_UINT32, + tv_ptr->mem_large_ds_sid, + tv_ptr->file_small_ds_sid_0, + tv_ptr->xfer_plist, + tv_ptr->large_ds_buf_1); + VRFY((ret >= 0), "H5Dread() slice from small ds succeeded."); + + /* verify that the expected data and only the + * expected data was read. + */ + ptr_1 = tv_ptr->large_ds_buf_1; + expected_value = (uint32_t) + ((size_t)(tv_ptr->mpi_rank) * tv_ptr->small_ds_slice_size); + start_index = (size_t)( + (i * tv_ptr->edge_size * tv_ptr->edge_size * + tv_ptr->edge_size * tv_ptr->edge_size) + + (j * tv_ptr->edge_size * tv_ptr->edge_size * tv_ptr->edge_size) + + (k * tv_ptr->edge_size * tv_ptr->edge_size) + + (l * tv_ptr->edge_size)); + stop_index = start_index + tv_ptr->small_ds_slice_size - 1; + + HDassert( start_index < stop_index ); + HDassert( stop_index <= tv_ptr->large_ds_size ); + + for ( n = 0; n < tv_ptr->large_ds_size; n++ ) { + + if ( ( n >= start_index ) && ( n <= stop_index ) ) { + + if ( *ptr_1 != expected_value ) { + + mis_match = TRUE; + } + expected_value++; + + } else { + + if ( *ptr_1 != 0 ) { + + mis_match = TRUE; + } } + /* zero out the value for the next pass */ + *ptr_1 = 0; + + ptr_1++; } - /* zero out the value for the next pass */ - *ptr_1 = 0; - ptr_1++; - } + VRFY((mis_match == FALSE), + "small slice read from large ds data good."); - VRFY((mis_match == FALSE), - "small slice read from large ds data good."); + (tv_ptr->tests_run)++; + } l++; - } while ( ( large_rank > 2 ) && - ( (small_rank - 1) <= 1 ) && - ( l < edge_size ) ); + (tv_ptr->total_tests)++; + + } while ( ( tv_ptr->large_rank > 2 ) && + ( (tv_ptr->small_rank - 1) <= 1 ) && + ( l < tv_ptr->edge_size ) ); k++; - } while ( ( large_rank > 3 ) && - ( (small_rank - 1) <= 2 ) && - ( k < edge_size ) ); + } while ( ( tv_ptr->large_rank > 3 ) && + ( (tv_ptr->small_rank - 1) <= 2 ) && + ( k < tv_ptr->edge_size ) ); j++; - } while ( ( large_rank > 4 ) && - ( (small_rank - 1) <= 3 ) && - ( j < edge_size ) ); + } while ( ( tv_ptr->large_rank > 4 ) && + ( (tv_ptr->small_rank - 1) <= 3 ) && + ( j < tv_ptr->edge_size ) ); + + return; + +} /* contig_hs_dr_pio_test__d2m_s2l() */ + + +/*------------------------------------------------------------------------- + * Function: contig_hs_dr_pio_test__m2d_l2s() + * + * Purpose: Part three of a series of tests of I/O to/from hyperslab + * selections of different rank in the parallel. + * + * Verify that we can write from memory to file using + * selections of different rank that H5S_select_shape_same() + * views as being of the same shape. + * + * Do this by writing small_rank - 1 dimensional slices from + * the in memory large data set to the on disk small cube + * dataset. After each write, read the slice of the small + * dataset back from disk, and verify that it contains + * the expected data. Verify that H5S_select_shape_same() + * returns true on the memory and file selections. + * + * Return: void + * + * Programmer: JRM -- 8/10/11 + * + * Modifications: + * + * None. + * + *------------------------------------------------------------------------- + */ + +#define CONTIG_HS_DR_PIO_TEST__M2D_L2S__DEBUG 0 + +static void +contig_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) +{ +#if CONTIG_HS_DR_PIO_TEST__M2D_L2S__DEBUG + const char *fcnName = "contig_hs_dr_pio_test__m2d_l2s()"; +#endif /* CONTIG_HS_DR_PIO_TEST__M2D_L2S__DEBUG */ + hbool_t mis_match = FALSE; + int i, j, k, l; + size_t n; + int mpi_rank; /* needed by the VRFY macro */ + size_t start_index; + size_t stop_index; + uint32_t expected_value; + uint32_t * ptr_1; + htri_t check; /* Shape comparison return value */ + herr_t ret; /* Generic return value */ + + /* initialize the local copy of mpi_rank */ + mpi_rank = tv_ptr->mpi_rank; /* now we go in the opposite direction, verifying that we can write * from memory to file using selections of different rank that * H5S_select_shape_same() views as being of the same shape. * - * Start by writing small_rank - 1 D slices from the in memory large data - * set to the on disk small cube dataset. After each write, read the + * Start by writing small_rank - 1 dimensional slices from the in memory large + * data set to the on disk small cube dataset. After each write, read the * slice of the small dataset back from disk, and verify that it contains * the expected data. Verify that H5S_select_shape_same() returns true on * the memory and file selections. */ - start[0] = (hsize_t)mpi_rank; - stride[0] = (hsize_t)(2 * (mpi_size + 1)); - count[0] = 1; - block[0] = 1; + tv_ptr->start[0] = (hsize_t)(tv_ptr->mpi_rank); + tv_ptr->stride[0] = (hsize_t)(2 * (tv_ptr->mpi_size + 1)); + tv_ptr->count[0] = 1; + tv_ptr->block[0] = 1; - for ( i = 1; i < large_rank; i++ ) { + for ( i = 1; i < tv_ptr->large_rank; i++ ) { - start[i] = 0; - stride[i] = (hsize_t)(2 * edge_size); - count[i] = 1; - block[i] = (hsize_t)edge_size; + tv_ptr->start[i] = 0; + tv_ptr->stride[i] = (hsize_t)(2 * tv_ptr->edge_size); + tv_ptr->count[i] = 1; + tv_ptr->block[i] = (hsize_t)(tv_ptr->edge_size); } - ret = H5Sselect_hyperslab(file_small_ds_sid, + ret = H5Sselect_hyperslab(tv_ptr->file_small_ds_sid_0, H5S_SELECT_SET, - start, - stride, - count, - block); - VRFY((ret >= 0), "H5Sselect_hyperslab(file_small_ds_sid, set) suceeded"); + tv_ptr->start, + tv_ptr->stride, + tv_ptr->count, + tv_ptr->block); + VRFY((ret >= 0), "H5Sselect_hyperslab(file_small_ds_sid_0, set) suceeded"); - ret = H5Sselect_hyperslab(mem_small_ds_sid, + ret = H5Sselect_hyperslab(tv_ptr->mem_small_ds_sid, H5S_SELECT_SET, - start, - stride, - count, - block); + tv_ptr->start, + tv_ptr->stride, + tv_ptr->count, + tv_ptr->block); VRFY((ret >= 0), "H5Sselect_hyperslab(mem_small_ds_sid, set) suceeded"); @@ -1100,28 +1410,28 @@ contig_hyperslab_dr_pio_test__run_test(const int test_num, */ for ( i = 0; i < PAR_SS_DR_MAX_RANK; i++ ) { - start[i] = 0; - stride[i] = (hsize_t)(2 * edge_size); - count[i] = 1; - if ( (PAR_SS_DR_MAX_RANK - i) > (small_rank - 1) ) { + tv_ptr->start[i] = 0; + tv_ptr->stride[i] = (hsize_t)(2 * tv_ptr->edge_size); + tv_ptr->count[i] = 1; + if ( (PAR_SS_DR_MAX_RANK - i) > (tv_ptr->small_rank - 1) ) { - block[i] = 1; + tv_ptr->block[i] = 1; } else { - block[i] = (hsize_t)edge_size; + tv_ptr->block[i] = (hsize_t)(tv_ptr->edge_size); } } /* zero out the in memory small ds */ - HDmemset(small_ds_buf_1, 0, sizeof(uint32_t) * small_ds_size); + HDmemset(tv_ptr->small_ds_buf_1, 0, sizeof(uint32_t) * tv_ptr->small_ds_size); -#if CONTIG_HYPERSLAB_DR_PIO_TEST__RUN_TEST__DEBUG +#if CONTIG_HS_DR_PIO_TEST__M2D_L2S__DEBUG HDfprintf(stdout, "%s writing slices from big ds to slices of small ds on disk.\n", fcnName); -#endif +#endif /* CONTIG_HS_DR_PIO_TEST__M2D_L2S__DEBUG */ /* in serial versions of this test, we loop through all the dimensions * of the large data set that don't appear in the small data set. @@ -1133,9 +1443,9 @@ contig_hyperslab_dr_pio_test__run_test(const int test_num, */ - if ( PAR_SS_DR_MAX_RANK - large_rank == 0 ) { + if ( PAR_SS_DR_MAX_RANK - tv_ptr->large_rank == 0 ) { - i = mpi_rank; + i = tv_ptr->mpi_rank; } else { @@ -1148,9 +1458,9 @@ contig_hyperslab_dr_pio_test__run_test(const int test_num, * test. */ - if ( PAR_SS_DR_MAX_RANK - large_rank == 1 ) { + if ( PAR_SS_DR_MAX_RANK - tv_ptr->large_rank == 1 ) { - j = mpi_rank; + j = tv_ptr->mpi_rank; } else { @@ -1159,9 +1469,9 @@ contig_hyperslab_dr_pio_test__run_test(const int test_num, j = 0; do { - if ( PAR_SS_DR_MAX_RANK - large_rank == 2 ) { + if ( PAR_SS_DR_MAX_RANK - tv_ptr->large_rank == 2 ) { - k = mpi_rank; + k = tv_ptr->mpi_rank; } else { @@ -1181,136 +1491,207 @@ contig_hyperslab_dr_pio_test__run_test(const int test_num, l = 0; do { - /* we know that small_rank >= 1 and that large_rank > small_rank - * by the assertions at the head of this function. Thus no - * need for another inner loop. - */ - - /* zero out this rank's slice of the on disk small data set */ - ret = H5Dwrite(small_dataset, - H5T_NATIVE_UINT32, - mem_small_ds_sid, - file_small_ds_sid, - xfer_plist, - small_ds_buf_2); - VRFY((ret >= 0), "H5Dwrite() zero slice to small ds succeeded."); - - /* select the portion of the in memory large cube from which we - * are going to write data. - */ - start[0] = (hsize_t)i; - start[1] = (hsize_t)j; - start[2] = (hsize_t)k; - start[3] = (hsize_t)l; - start[4] = 0; - - ret = H5Sselect_hyperslab(mem_large_ds_sid, - H5S_SELECT_SET, - start_ptr, - stride_ptr, - count_ptr, - block_ptr); - VRFY((ret >= 0), - "H5Sselect_hyperslab() mem_large_ds_sid succeeded."); - - - /* verify that H5S_select_shape_same() reports the in - * memory slice through the cube selection and the - * on disk full square selections as having the same shape. - */ - check = H5S_select_shape_same_test(file_small_ds_sid, - mem_large_ds_sid); - VRFY((check == TRUE), "H5S_select_shape_same_test passed."); - - - /* write the slice from the in memory large data set to the - * slice of the on disk small dataset. */ -#if CONTIG_HYPERSLAB_DR_PIO_TEST__RUN_TEST__DEBUG - HDfprintf(stdout, "%s:%d: start = %d %d %d %d %d.\n", - fcnName, (int)mpi_rank, - (int)start[0], (int)start[1], (int)start[2], - (int)start[3], (int)start[4]); - HDfprintf(stdout, "%s:%d: mem/file extent dims = %d/%d.\n", - fcnName, mpi_rank, - H5Sget_simple_extent_ndims(mem_large_ds_sid), - H5Sget_simple_extent_ndims(file_small_ds_sid)); -#endif - ret = H5Dwrite(small_dataset, - H5T_NATIVE_UINT32, - mem_large_ds_sid, - file_small_ds_sid, - xfer_plist, - large_ds_buf_0); - VRFY((ret >= 0), "H5Dwrite() slice to large ds succeeded."); + if ( (tv_ptr->skips)++ < tv_ptr->max_skips ) { /* skip the test */ + + (tv_ptr->tests_skipped)++; + } else { /* run the test */ - /* read the on disk square into memory */ - ret = H5Dread(small_dataset, - H5T_NATIVE_UINT32, - mem_small_ds_sid, - file_small_ds_sid, - xfer_plist, - small_ds_buf_1); - VRFY((ret >= 0), "H5Dread() slice from small ds succeeded."); + tv_ptr->skips = 0; /* reset the skips counter */ + /* we know that small_rank >= 1 and that large_rank > small_rank + * by the assertions at the head of this function. Thus no + * need for another inner loop. + */ - /* verify that expected data is retrieved */ + /* zero out this rank's slice of the on disk small data set */ + ret = H5Dwrite(tv_ptr->small_dataset, + H5T_NATIVE_UINT32, + tv_ptr->mem_small_ds_sid, + tv_ptr->file_small_ds_sid_0, + tv_ptr->xfer_plist, + tv_ptr->small_ds_buf_2); + VRFY((ret >= 0), "H5Dwrite() zero slice to small ds succeeded."); + + /* select the portion of the in memory large cube from which we + * are going to write data. + */ + tv_ptr->start[0] = (hsize_t)i; + tv_ptr->start[1] = (hsize_t)j; + tv_ptr->start[2] = (hsize_t)k; + tv_ptr->start[3] = (hsize_t)l; + tv_ptr->start[4] = 0; + + ret = H5Sselect_hyperslab(tv_ptr->mem_large_ds_sid, + H5S_SELECT_SET, + tv_ptr->start_ptr, + tv_ptr->stride_ptr, + tv_ptr->count_ptr, + tv_ptr->block_ptr); + VRFY((ret >= 0), + "H5Sselect_hyperslab() mem_large_ds_sid succeeded."); + + + /* verify that H5S_select_shape_same() reports the in + * memory slice through the cube selection and the + * on disk full square selections as having the same shape. + */ + check = H5S_select_shape_same_test(tv_ptr->file_small_ds_sid_0, + tv_ptr->mem_large_ds_sid); + VRFY((check == TRUE), "H5S_select_shape_same_test passed."); + + + /* write the slice from the in memory large data set to the + * slice of the on disk small dataset. */ +#if CONTIG_HS_DR_PIO_TEST__M2D_L2S__DEBUG + HDfprintf(stdout, "%s:%d: start = %d %d %d %d %d.\n", + fcnName, (int)(tv_ptr->mpi_rank), + (int)(tv_ptr->start[0]), (int)(tv_ptr->start[1]), + (int)(tv_ptr->start[2]), (int)(tv_ptr->start[3]), + (int)(tv_ptr->start[4])); + HDfprintf(stdout, "%s:%d: mem/file extent dims = %d/%d.\n", + fcnName, tv_ptr->mpi_rank, + H5Sget_simple_extent_ndims(tv_ptr->mem_large_ds_sid), + H5Sget_simple_extent_ndims(tv_ptr->file_small_ds_sid_0)); +#endif /* CONTIG_HS_DR_PIO_TEST__M2D_L2S__DEBUG */ + ret = H5Dwrite(tv_ptr->small_dataset, + H5T_NATIVE_UINT32, + tv_ptr->mem_large_ds_sid, + tv_ptr->file_small_ds_sid_0, + tv_ptr->xfer_plist, + tv_ptr->large_ds_buf_0); + VRFY((ret >= 0), "H5Dwrite() slice to large ds succeeded."); + + + /* read the on disk square into memory */ + ret = H5Dread(tv_ptr->small_dataset, + H5T_NATIVE_UINT32, + tv_ptr->mem_small_ds_sid, + tv_ptr->file_small_ds_sid_0, + tv_ptr->xfer_plist, + tv_ptr->small_ds_buf_1); + VRFY((ret >= 0), "H5Dread() slice from small ds succeeded."); + + + /* verify that expected data is retrieved */ + + mis_match = FALSE; + ptr_1 = tv_ptr->small_ds_buf_1; + + expected_value = (uint32_t)( + (i * tv_ptr->edge_size * tv_ptr->edge_size * + tv_ptr->edge_size * tv_ptr->edge_size) + + (j * tv_ptr->edge_size * tv_ptr->edge_size * tv_ptr->edge_size) + + (k * tv_ptr->edge_size * tv_ptr->edge_size) + + (l * tv_ptr->edge_size)); + + start_index = (size_t)(tv_ptr->mpi_rank) * tv_ptr->small_ds_slice_size; + stop_index = start_index + tv_ptr->small_ds_slice_size - 1; + + HDassert( start_index < stop_index ); + HDassert( stop_index <= tv_ptr->small_ds_size ); + + for ( n = 0; n < tv_ptr->small_ds_size; n++ ) { + + if ( ( n >= start_index ) && ( n <= stop_index ) ) { + + if ( *ptr_1 != expected_value ) { + + mis_match = TRUE; + } + expected_value++; - mis_match = FALSE; - ptr_1 = small_ds_buf_1; + } else { - expected_value = (uint32_t)( - (i * edge_size * edge_size * edge_size * edge_size) + - (j * edge_size * edge_size * edge_size) + - (k * edge_size * edge_size) + - (l * edge_size)); + if ( *ptr_1 != 0 ) { - start_index = (size_t)mpi_rank * small_ds_slice_size; - stop_index = start_index + small_ds_slice_size - 1; + mis_match = TRUE; + } + } + /* zero out the value for the next pass */ + *ptr_1 = 0; - HDassert( start_index < stop_index ); - HDassert( stop_index <= small_ds_size ); + ptr_1++; + } - for ( n = 0; n < small_ds_size; n++ ) { + VRFY((mis_match == FALSE), + "small slice write from large ds data good."); - if ( ( n >= start_index ) && ( n <= stop_index ) ) { + (tv_ptr->tests_run)++; + } - if ( *ptr_1 != expected_value ) { + l++; - mis_match = TRUE; - } - expected_value++; + (tv_ptr->total_tests)++; - } else { + } while ( ( tv_ptr->large_rank > 2 ) && + ( (tv_ptr->small_rank - 1) <= 1 ) && + ( l < tv_ptr->edge_size ) ); + k++; + } while ( ( tv_ptr->large_rank > 3 ) && + ( (tv_ptr->small_rank - 1) <= 2 ) && + ( k < tv_ptr->edge_size ) ); + j++; + } while ( ( tv_ptr->large_rank > 4 ) && + ( (tv_ptr->small_rank - 1) <= 3 ) && + ( j < tv_ptr->edge_size ) ); - if ( *ptr_1 != 0 ) { + return; - mis_match = TRUE; - } - } - /* zero out the value for the next pass */ - *ptr_1 = 0; +} /* contig_hs_dr_pio_test__m2d_l2s() */ - ptr_1++; - } - VRFY((mis_match == FALSE), - "small slice write from large ds data good."); +/*------------------------------------------------------------------------- + * Function: contig_hs_dr_pio_test__m2d_s2l() + * + * Purpose: Part four of a series of tests of I/O to/from hyperslab + * selections of different rank in the parallel. + * + * Verify that we can write from memory to file using + * selections of different rank that H5S_select_shape_same() + * views as being of the same shape. + * + * Do this by writing the contents of the process's slice of + * the in memory small data set to slices of the on disk + * large data set. After each write, read the process's + * slice of the large data set back into memory, and verify + * that it contains the expected data. + * + * Verify that H5S_select_shape_same() returns true on the + * memory and file selections. + * + * Return: void + * + * Programmer: JRM -- 8/10/11 + * + * Modifications: + * + * None + * + *------------------------------------------------------------------------- + */ - l++; +#define CONTIG_HS_DR_PIO_TEST__M2D_S2L__DEBUG 0 - } while ( ( large_rank > 2 ) && - ( (small_rank - 1) <= 1 ) && - ( l < edge_size ) ); - k++; - } while ( ( large_rank > 3 ) && - ( (small_rank - 1) <= 2 ) && - ( k < edge_size ) ); - j++; - } while ( ( large_rank > 4 ) && - ( (small_rank - 1) <= 3 ) && - ( j < edge_size ) ); +static void +contig_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) +{ +#if CONTIG_HS_DR_PIO_TEST__M2D_S2L__DEBUG + const char *fcnName = "contig_hs_dr_pio_test__m2d_s2l()"; +#endif /* CONTIG_HS_DR_PIO_TEST__M2D_S2L__DEBUG */ + hbool_t mis_match = FALSE; + int i, j, k, l; + size_t n; + int mpi_rank; /* needed by the VRFY macro */ + size_t start_index; + size_t stop_index; + uint32_t expected_value; + uint32_t * ptr_1; + htri_t check; /* Shape comparison return value */ + herr_t ret; /* Generic return value */ + /* initialize the local copy of mpi_rank */ + mpi_rank = tv_ptr->mpi_rank; /* Now write the contents of the process's slice of the in memory * small data set to slices of the on disk large data set. After @@ -1323,25 +1704,25 @@ contig_hyperslab_dr_pio_test__run_test(const int test_num, /* select the slice of the in memory small data set associated with * the process's mpi rank. */ - start[0] = (hsize_t)mpi_rank; - stride[0] = (hsize_t)(2 * (mpi_size + 1)); - count[0] = 1; - block[0] = 1; + tv_ptr->start[0] = (hsize_t)(tv_ptr->mpi_rank); + tv_ptr->stride[0] = (hsize_t)(2 * (tv_ptr->mpi_size + 1)); + tv_ptr->count[0] = 1; + tv_ptr->block[0] = 1; - for ( i = 1; i < large_rank; i++ ) { + for ( i = 1; i < tv_ptr->large_rank; i++ ) { - start[i] = 0; - stride[i] = (hsize_t)(2 * edge_size); - count[i] = 1; - block[i] = (hsize_t)edge_size; + tv_ptr->start[i] = 0; + tv_ptr->stride[i] = (hsize_t)(2 * tv_ptr->edge_size); + tv_ptr->count[i] = 1; + tv_ptr->block[i] = (hsize_t)(tv_ptr->edge_size); } - ret = H5Sselect_hyperslab(mem_small_ds_sid, + ret = H5Sselect_hyperslab(tv_ptr->mem_small_ds_sid, H5S_SELECT_SET, - start, - stride, - count, - block); + tv_ptr->start, + tv_ptr->stride, + tv_ptr->count, + tv_ptr->block); VRFY((ret >= 0), "H5Sselect_hyperslab(mem_small_ds_sid, set) suceeded"); @@ -1351,31 +1732,31 @@ contig_hyperslab_dr_pio_test__run_test(const int test_num, */ for ( i = 0; i < PAR_SS_DR_MAX_RANK; i++ ) { - start[i] = 0; - stride[i] = (hsize_t)(2 * edge_size); - count[i] = 1; - if ( (PAR_SS_DR_MAX_RANK - i) > (small_rank - 1) ) { + tv_ptr->start[i] = 0; + tv_ptr->stride[i] = (hsize_t)(2 * tv_ptr->edge_size); + tv_ptr->count[i] = 1; + if ( (PAR_SS_DR_MAX_RANK - i) > (tv_ptr->small_rank - 1) ) { - block[i] = 1; + tv_ptr->block[i] = 1; } else { - block[i] = (hsize_t)edge_size; + tv_ptr->block[i] = (hsize_t)(tv_ptr->edge_size); } } /* zero out the in memory large ds */ - HDmemset(large_ds_buf_1, 0, sizeof(uint32_t) * large_ds_size); + HDmemset(tv_ptr->large_ds_buf_1, 0, sizeof(uint32_t) * tv_ptr->large_ds_size); -#if CONTIG_HYPERSLAB_DR_PIO_TEST__RUN_TEST__DEBUG +#if CONTIG_HS_DR_PIO_TEST__M2D_S2L__DEBUG HDfprintf(stdout, "%s writing process slices of small ds to slices of large ds on disk.\n", fcnName); -#endif +#endif /* CONTIG_HS_DR_PIO_TEST__M2D_S2L__DEBUG */ - if ( PAR_SS_DR_MAX_RANK - large_rank == 0 ) { + if ( PAR_SS_DR_MAX_RANK - tv_ptr->large_rank == 0 ) { - i = mpi_rank; + i = tv_ptr->mpi_rank; } else { @@ -1388,9 +1769,9 @@ contig_hyperslab_dr_pio_test__run_test(const int test_num, * test. */ - if ( PAR_SS_DR_MAX_RANK - large_rank == 1 ) { + if ( PAR_SS_DR_MAX_RANK - tv_ptr->large_rank == 1 ) { - j = mpi_rank; + j = tv_ptr->mpi_rank; } else { @@ -1398,9 +1779,9 @@ contig_hyperslab_dr_pio_test__run_test(const int test_num, } do { - if ( PAR_SS_DR_MAX_RANK - large_rank == 2 ) { + if ( PAR_SS_DR_MAX_RANK - tv_ptr->large_rank == 2 ) { - k = mpi_rank; + k = tv_ptr->mpi_rank; } else { @@ -1420,216 +1801,410 @@ contig_hyperslab_dr_pio_test__run_test(const int test_num, l = 0; do { - /* we know that small_rank >= 1 and that large_rank > small_rank - * by the assertions at the head of this function. Thus no - * need for another inner loop. - */ - - /* Zero out this processes slice of the on disk large data set. - * Note that this will leave one slice with its original data - * as there is one more slice than processes. - */ - ret = H5Dwrite(large_dataset, - H5T_NATIVE_UINT32, - large_ds_slice_sid, - file_large_ds_process_slice_sid, - xfer_plist, - large_ds_buf_2); - VRFY((ret != FAIL), "H5Dwrite() to zero large ds suceeded"); - - - /* select the portion of the in memory large cube to which we - * are going to write data. - */ - start[0] = (hsize_t)i; - start[1] = (hsize_t)j; - start[2] = (hsize_t)k; - start[3] = (hsize_t)l; - start[4] = 0; - - ret = H5Sselect_hyperslab(file_large_ds_sid, - H5S_SELECT_SET, - start_ptr, - stride_ptr, - count_ptr, - block_ptr); - VRFY((ret != FAIL), - "H5Sselect_hyperslab() target large ds slice succeeded"); - - - /* verify that H5S_select_shape_same() reports the in - * memory small data set slice selection and the - * on disk slice through the large data set selection - * as having the same shape. - */ - check = H5S_select_shape_same_test(mem_small_ds_sid, - file_large_ds_sid); - VRFY((check == TRUE), "H5S_select_shape_same_test passed"); - - - /* write the small data set slice from memory to the - * target slice of the disk data set - */ -#if CONTIG_HYPERSLAB_DR_PIO_TEST__RUN_TEST__DEBUG - HDfprintf(stdout, "%s:%d: start = %d %d %d %d %d.\n", - fcnName, (int)mpi_rank, - (int)start[0], (int)start[1], (int)start[2], - (int)start[3], (int)start[4]); - HDfprintf(stdout, "%s:%d: mem/file extent dims = %d/%d.\n", - fcnName, mpi_rank, - H5Sget_simple_extent_ndims(mem_small_ds_sid), - H5Sget_simple_extent_ndims(file_large_ds_sid)); -#endif - ret = H5Dwrite(large_dataset, - H5T_NATIVE_UINT32, - mem_small_ds_sid, - file_large_ds_sid, - xfer_plist, - small_ds_buf_0); - VRFY((ret != FAIL), - "H5Dwrite of small ds slice to large ds succeeded"); + if ( (tv_ptr->skips)++ < tv_ptr->max_skips ) { /* skip the test */ + + (tv_ptr->tests_skipped)++; + +#if CONTIG_HS_DR_PIO_TEST__M2D_S2L__DEBUG + tv_ptr->start[0] = (hsize_t)i; + tv_ptr->start[1] = (hsize_t)j; + tv_ptr->start[2] = (hsize_t)k; + tv_ptr->start[3] = (hsize_t)l; + tv_ptr->start[4] = 0; + + HDfprintf(stdout, + "%s:%d: skipping test with start = %d %d %d %d %d.\n", + fcnName, (int)(tv_ptr->mpi_rank), + (int)(tv_ptr->start[0]), (int)(tv_ptr->start[1]), + (int)(tv_ptr->start[2]), (int)(tv_ptr->start[3]), + (int)(tv_ptr->start[4])); + HDfprintf(stdout, "%s:%d: mem/file extent dims = %d/%d.\n", + fcnName, tv_ptr->mpi_rank, + H5Sget_simple_extent_ndims(tv_ptr->mem_small_ds_sid), + H5Sget_simple_extent_ndims(tv_ptr->file_large_ds_sid_0)); +#endif /* CONTIG_HS_DR_PIO_TEST__M2D_S2L__DEBUG */ + } else { /* run the test */ + + tv_ptr->skips = 0; /* reset the skips counter */ + + /* we know that small_rank >= 1 and that large_rank > small_rank + * by the assertions at the head of this function. Thus no + * need for another inner loop. + */ + + /* Zero out this processes slice of the on disk large data set. + * Note that this will leave one slice with its original data + * as there is one more slice than processes. + */ + ret = H5Dwrite(tv_ptr->large_dataset, + H5T_NATIVE_UINT32, + tv_ptr->large_ds_slice_sid, + tv_ptr->file_large_ds_process_slice_sid, + tv_ptr->xfer_plist, + tv_ptr->large_ds_buf_2); + VRFY((ret != FAIL), "H5Dwrite() to zero large ds suceeded"); + + /* select the portion of the in memory large cube to which we + * are going to write data. + */ + tv_ptr->start[0] = (hsize_t)i; + tv_ptr->start[1] = (hsize_t)j; + tv_ptr->start[2] = (hsize_t)k; + tv_ptr->start[3] = (hsize_t)l; + tv_ptr->start[4] = 0; + + ret = H5Sselect_hyperslab(tv_ptr->file_large_ds_sid_0, + H5S_SELECT_SET, + tv_ptr->start_ptr, + tv_ptr->stride_ptr, + tv_ptr->count_ptr, + tv_ptr->block_ptr); + VRFY((ret != FAIL), + "H5Sselect_hyperslab() target large ds slice succeeded"); + + + /* verify that H5S_select_shape_same() reports the in + * memory small data set slice selection and the + * on disk slice through the large data set selection + * as having the same shape. + */ + check = H5S_select_shape_same_test(tv_ptr->mem_small_ds_sid, + tv_ptr->file_large_ds_sid_0); + VRFY((check == TRUE), "H5S_select_shape_same_test passed"); - /* read this processes slice on the on disk large - * data set into memory. - */ - ret = H5Dread(large_dataset, - H5T_NATIVE_UINT32, - mem_large_ds_process_slice_sid, - file_large_ds_process_slice_sid, - xfer_plist, - large_ds_buf_1); - VRFY((ret != FAIL), - "H5Dread() of process slice of large ds succeeded"); + /* write the small data set slice from memory to the + * target slice of the disk data set + */ +#if CONTIG_HS_DR_PIO_TEST__M2D_S2L__DEBUG + HDfprintf(stdout, "%s:%d: start = %d %d %d %d %d.\n", + fcnName, (int)(tv_ptr->mpi_rank), + (int)(tv_ptr->start[0]), (int)(tv_ptr->start[1]), + (int)(tv_ptr->start[2]), (int)(tv_ptr->start[3]), + (int)(tv_ptr->start[4])); + HDfprintf(stdout, "%s:%d: mem/file extent dims = %d/%d.\n", + fcnName, tv_ptr->mpi_rank, + H5Sget_simple_extent_ndims(tv_ptr->mem_small_ds_sid), + H5Sget_simple_extent_ndims(tv_ptr->file_large_ds_sid_0)); +#endif /* CONTIG_HS_DR_PIO_TEST__M2D_S2L__DEBUG */ + ret = H5Dwrite(tv_ptr->large_dataset, + H5T_NATIVE_UINT32, + tv_ptr->mem_small_ds_sid, + tv_ptr->file_large_ds_sid_0, + tv_ptr->xfer_plist, + tv_ptr->small_ds_buf_0); + VRFY((ret != FAIL), + "H5Dwrite of small ds slice to large ds succeeded"); + + + /* read this processes slice on the on disk large + * data set into memory. + */ + ret = H5Dread(tv_ptr->large_dataset, + H5T_NATIVE_UINT32, + tv_ptr->mem_large_ds_process_slice_sid, + tv_ptr->file_large_ds_process_slice_sid, + tv_ptr->xfer_plist, + tv_ptr->large_ds_buf_1); + VRFY((ret != FAIL), + "H5Dread() of process slice of large ds succeeded"); - /* verify that the expected data and only the - * expected data was read. - */ - ptr_1 = large_ds_buf_1; - expected_value = (uint32_t)((size_t)mpi_rank * small_ds_slice_size); - start_index = (size_t)((i * edge_size * edge_size * edge_size * edge_size) + - (j * edge_size * edge_size * edge_size) + - (k * edge_size * edge_size) + - (l * edge_size)); - stop_index = start_index + small_ds_slice_size - 1; + /* verify that the expected data and only the + * expected data was read. + */ + ptr_1 = tv_ptr->large_ds_buf_1; + expected_value = (uint32_t) + ((size_t)(tv_ptr->mpi_rank) * tv_ptr->small_ds_slice_size); - HDassert( start_index < stop_index ); - HDassert( stop_index < large_ds_size ); + start_index = (size_t) + ((i * tv_ptr->edge_size * tv_ptr->edge_size * + tv_ptr->edge_size * tv_ptr->edge_size) + + (j * tv_ptr->edge_size * tv_ptr->edge_size * + tv_ptr->edge_size) + + (k * tv_ptr->edge_size * tv_ptr->edge_size) + + (l * tv_ptr->edge_size)); + stop_index = start_index + tv_ptr->small_ds_slice_size - 1; - for ( n = 0; n < large_ds_size; n++ ) { + HDassert( start_index < stop_index ); + HDassert( stop_index < tv_ptr->large_ds_size ); - if ( ( n >= start_index ) && ( n <= stop_index ) ) { + for ( n = 0; n < tv_ptr->large_ds_size; n++ ) { - if ( *ptr_1 != expected_value ) { + if ( ( n >= start_index ) && ( n <= stop_index ) ) { - mis_match = TRUE; - } + if ( *ptr_1 != expected_value ) { - expected_value++; + mis_match = TRUE; + } - } else { + expected_value++; - if ( *ptr_1 != 0 ) { + } else { - mis_match = TRUE; + if ( *ptr_1 != 0 ) { + + mis_match = TRUE; + } } + /* zero out buffer for next test */ + *ptr_1 = 0; + ptr_1++; } - /* zero out buffer for next test */ - *ptr_1 = 0; - ptr_1++; - } - VRFY((mis_match == FALSE), - "small ds slice write to large ds slice data good."); + VRFY((mis_match == FALSE), + "small ds slice write to large ds slice data good."); + + (tv_ptr->tests_run)++; + } l++; - } while ( ( large_rank > 2 ) && - ( (small_rank - 1) <= 1 ) && - ( l < edge_size ) ); + (tv_ptr->total_tests)++; + + } while ( ( tv_ptr->large_rank > 2 ) && + ( (tv_ptr->small_rank - 1) <= 1 ) && + ( l < tv_ptr->edge_size ) ); k++; - } while ( ( large_rank > 3 ) && - ( (small_rank - 1) <= 2 ) && - ( k < edge_size ) ); + } while ( ( tv_ptr->large_rank > 3 ) && + ( (tv_ptr->small_rank - 1) <= 2 ) && + ( k < tv_ptr->edge_size ) ); j++; - } while ( ( large_rank > 4 ) && - ( (small_rank - 1) <= 3 ) && - ( j < edge_size ) ); + } while ( ( tv_ptr->large_rank > 4 ) && + ( (tv_ptr->small_rank - 1) <= 3 ) && + ( j < tv_ptr->edge_size ) ); + return; - /* Close dataspaces */ - ret = H5Sclose(full_mem_small_ds_sid); - VRFY((ret != FAIL), "H5Sclose(full_mem_small_ds_sid) succeeded"); +} /* contig_hs_dr_pio_test__m2d_s2l() */ - ret = H5Sclose(full_file_small_ds_sid); - VRFY((ret != FAIL), "H5Sclose(full_file_small_ds_sid) succeeded"); - ret = H5Sclose(mem_small_ds_sid); - VRFY((ret != FAIL), "H5Sclose(mem_small_ds_sid) succeeded"); +/*------------------------------------------------------------------------- + * Function: contig_hs_dr_pio_test__run_test() + * + * Purpose: Test I/O to/from hyperslab selections of different rank in + * the parallel. + * + * Return: void + * + * Programmer: JRM -- 9/18/09 + * + * Modifications: + * + * JRM -- 9/16/10 + * Added express_test parameter. Use it to control whether + * we set up the chunks so that no chunk is shared between + * processes, and also whether we set an alignment when we + * create the test file. + * + * JRM -- 8/11/11 + * Refactored function heavily & broke it into six functions. + * Added the skips_ptr, max_skips, total_tests_ptr, + * tests_run_ptr, and tests_skiped_ptr parameters to support + * skipping portions of the test according to the express + * test value. + * + *------------------------------------------------------------------------- + */ - ret = H5Sclose(file_small_ds_sid); - VRFY((ret != FAIL), "H5Sclose(file_small_ds_sid) succeeded"); +#define CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG 0 - ret = H5Sclose(small_ds_slice_sid); - VRFY((ret != FAIL), "H5Sclose(small_ds_slice_sid) succeeded"); +static void +contig_hs_dr_pio_test__run_test(const int test_num, + const int edge_size, + const int chunk_edge_size, + const int small_rank, + const int large_rank, + const hbool_t use_collective_io, + const hid_t dset_type, + int express_test, + int * skips_ptr, + int max_skips, + int64_t * total_tests_ptr, + int64_t * tests_run_ptr, + int64_t * tests_skipped_ptr) +{ +#if CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG + const char *fcnName = "contig_hs_dr_pio_test__run_test()"; +#endif /* CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG */ + int mpi_rank; + struct hs_dr_pio_test_vars_t test_vars = + { + /* int mpi_size = */ -1, + /* int mpi_rank = */ -1, + /* MPI_Comm mpi_comm = */ MPI_COMM_NULL, + /* MPI_Inf mpi_info = */ MPI_INFO_NULL, + /* int test_num = */ -1, + /* int edge_size = */ -1, + /* int checker_edge_size = */ -1, + /* int chunk_edge_size = */ -1, + /* int small_rank = */ -1, + /* int large_rank = */ -1, + /* hid_t dset_type = */ -1, + /* uint32_t * small_ds_buf_0 = */ NULL, + /* uint32_t * small_ds_buf_1 = */ NULL, + /* uint32_t * small_ds_buf_2 = */ NULL, + /* uint32_t * small_ds_slice_buf = */ NULL, + /* uint32_t * large_ds_buf_0 = */ NULL, + /* uint32_t * large_ds_buf_1 = */ NULL, + /* uint32_t * large_ds_buf_2 = */ NULL, + /* uint32_t * large_ds_slice_buf = */ NULL, + /* int small_ds_offset = */ -1, + /* int large_ds_offset = */ -1, + /* hid_t fid = */ -1, /* HDF5 file ID */ + /* hid_t xfer_plist = */ H5P_DEFAULT, + /* hid_t full_mem_small_ds_sid = */ -1, + /* hid_t full_file_small_ds_sid = */ -1, + /* hid_t mem_small_ds_sid = */ -1, + /* hid_t file_small_ds_sid_0 = */ -1, + /* hid_t file_small_ds_sid_1 = */ -1, + /* hid_t small_ds_slice_sid = */ -1, + /* hid_t full_mem_large_ds_sid = */ -1, + /* hid_t full_file_large_ds_sid = */ -1, + /* hid_t mem_large_ds_sid = */ -1, + /* hid_t file_large_ds_sid_0 = */ -1, + /* hid_t file_large_ds_sid_1 = */ -1, + /* hid_t file_large_ds_process_slice_sid = */ -1, + /* hid_t mem_large_ds_process_slice_sid = */ -1, + /* hid_t large_ds_slice_sid = */ -1, + /* hid_t small_dataset = */ -1, /* Dataset ID */ + /* hid_t large_dataset = */ -1, /* Dataset ID */ + /* size_t small_ds_size = */ 1, + /* size_t small_ds_slice_size = */ 1, + /* size_t large_ds_size = */ 1, + /* size_t large_ds_slice_size = */ 1, + /* hsize_t dims[PAR_SS_DR_MAX_RANK] = */ {0,0,0,0,0}, + /* hsize_t chunk_dims[PAR_SS_DR_MAX_RANK] = */ {0,0,0,0,0}, + /* hsize_t start[PAR_SS_DR_MAX_RANK] = */ {0,0,0,0,0}, + /* hsize_t stride[PAR_SS_DR_MAX_RANK] = */ {0,0,0,0,0}, + /* hsize_t count[PAR_SS_DR_MAX_RANK] = */ {0,0,0,0,0}, + /* hsize_t block[PAR_SS_DR_MAX_RANK] = */ {0,0,0,0,0}, + /* hsize_t * start_ptr = */ NULL, + /* hsize_t * stride_ptr = */ NULL, + /* hsize_t * count_ptr = */ NULL, + /* hsize_t * block_ptr = */ NULL, + /* int skips = */ 0, + /* int max_skips = */ 0, + /* int64_t total_tests = */ 0, + /* int64_t tests_run = */ 0, + /* int64_t tests_skipped = */ 0 + }; + struct hs_dr_pio_test_vars_t * tv_ptr = &test_vars; - ret = H5Sclose(full_mem_large_ds_sid); - VRFY((ret != FAIL), "H5Sclose(full_mem_large_ds_sid) succeeded"); + hs_dr_pio_test__setup(test_num, edge_size, -1, chunk_edge_size, + small_rank, large_rank, use_collective_io, + dset_type, express_test, tv_ptr); - ret = H5Sclose(full_file_large_ds_sid); - VRFY((ret != FAIL), "H5Sclose(full_file_large_ds_sid) succeeded"); + /* initialize the local copy of mpi_rank */ + mpi_rank = tv_ptr->mpi_rank; - ret = H5Sclose(mem_large_ds_sid); - VRFY((ret != FAIL), "H5Sclose(mem_large_ds_sid) succeeded"); + /* initialize skips & max_skips */ + tv_ptr->skips = *skips_ptr; + tv_ptr->max_skips = max_skips; - ret = H5Sclose(file_large_ds_sid); - VRFY((ret != FAIL), "H5Sclose(mem_large_ds_sid) succeeded"); +#if CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG + if ( MAINPROCESS ) { + HDfprintf(stdout, "test %d: small rank = %d, large rank = %d.\n", + test_num, small_rank, large_rank); + HDfprintf(stdout, "test %d: Initialization complete.\n", test_num); + } +#endif /* CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG */ - ret = H5Sclose(mem_large_ds_process_slice_sid); - VRFY((ret != FAIL), "H5Sclose(mem_large_ds_process_slice_sid) succeeded"); + /* first, verify that we can read from disk correctly using selections + * of different rank that H5S_select_shape_same() views as being of the + * same shape. + * + * Start by reading small_rank - 1 dimensional slice from the on disk + * large cube, and verifying that the data read is correct. Verify that + * H5S_select_shape_same() returns true on the memory and file selections. + */ - ret = H5Sclose(file_large_ds_process_slice_sid); - VRFY((ret != FAIL), "H5Sclose(file_large_ds_process_slice_sid) succeeded"); +#if CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG + if ( MAINPROCESS ) { + HDfprintf(stdout, "test %d: running contig_hs_dr_pio_test__d2m_l2s.\n", test_num); + } +#endif /* CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG */ + contig_hs_dr_pio_test__d2m_l2s(tv_ptr); - ret = H5Sclose(large_ds_slice_sid); - VRFY((ret != FAIL), "H5Sclose(large_ds_slice_sid) succeeded"); + /* Second, read slices of the on disk small data set into slices + * through the in memory large data set, and verify that the correct + * data (and only the correct data) is read. + */ + +#if CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG + if ( MAINPROCESS ) { + HDfprintf(stdout, "test %d: running contig_hs_dr_pio_test__d2m_s2l.\n", test_num); + } +#endif /* CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG */ + contig_hs_dr_pio_test__d2m_s2l(tv_ptr); - /* Close Datasets */ - ret = H5Dclose(small_dataset); - VRFY((ret != FAIL), "H5Dclose(small_dataset) succeeded"); - ret = H5Dclose(large_dataset); - VRFY((ret != FAIL), "H5Dclose(large_dataset) succeeded"); + /* now we go in the opposite direction, verifying that we can write + * from memory to file using selections of different rank that + * H5S_select_shape_same() views as being of the same shape. + * + * Start by writing small_rank - 1 D slices from the in memory large data + * set to the on disk small cube dataset. After each write, read the + * slice of the small dataset back from disk, and verify that it contains + * the expected data. Verify that H5S_select_shape_same() returns true on + * the memory and file selections. + */ +#if CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG + if ( MAINPROCESS ) { + HDfprintf(stdout, "test %d: running contig_hs_dr_pio_test__m2d_l2s.\n", test_num); + } +#endif /* CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG */ + contig_hs_dr_pio_test__m2d_l2s(tv_ptr); - /* close the file collectively */ - MESG("about to close file."); - ret = H5Fclose(fid); - VRFY((ret != FAIL), "file close succeeded"); - /* Free memory buffers */ + /* Now write the contents of the process's slice of the in memory + * small data set to slices of the on disk large data set. After + * each write, read the process's slice of the large data set back + * into memory, and verify that it contains the expected data. + * Verify that H5S_select_shape_same() returns true on the memory + * and file selections. + */ + +#if CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG + if ( MAINPROCESS ) { + HDfprintf(stdout, "test %d: running contig_hs_dr_pio_test__m2d_s2l.\n", test_num); + } +#endif /* CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG */ + contig_hs_dr_pio_test__m2d_s2l(tv_ptr); - if ( small_ds_buf_0 != NULL ) HDfree(small_ds_buf_0); - if ( small_ds_buf_1 != NULL ) HDfree(small_ds_buf_1); - if ( small_ds_buf_2 != NULL ) HDfree(small_ds_buf_2); - if ( small_ds_slice_buf != NULL ) HDfree(small_ds_slice_buf); +#if CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG + if ( MAINPROCESS ) { + HDfprintf(stdout, + "test %d: Subtests complete -- tests run/skipped/total = %lld/%lld/%lld.\n", + test_num, (long long)(tv_ptr->tests_run), (long long)(tv_ptr->tests_skipped), + (long long)(tv_ptr->total_tests)); + } +#endif /* CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG */ + + hs_dr_pio_test__takedown(tv_ptr); - if ( large_ds_buf_0 != NULL ) HDfree(large_ds_buf_0); - if ( large_ds_buf_1 != NULL ) HDfree(large_ds_buf_1); - if ( large_ds_buf_2 != NULL ) HDfree(large_ds_buf_2); - if ( large_ds_slice_buf != NULL ) HDfree(large_ds_slice_buf); +#if CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG + if ( MAINPROCESS ) { + HDfprintf(stdout, "test %d: Takedown complete.\n", test_num); + } +#endif /* CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG */ + + *skips_ptr = tv_ptr->skips; + *total_tests_ptr += tv_ptr->total_tests; + *tests_run_ptr += tv_ptr->tests_run; + *tests_skipped_ptr += tv_ptr->tests_skipped; return; -} /* contig_hyperslab_dr_pio_test__run_test() */ +} /* contig_hs_dr_pio_test__run_test() */ /*------------------------------------------------------------------------- - * Function: contig_hyperslab_dr_pio_test(ShapeSameTestMethods sstest_type) + * Function: contig_hs_dr_pio_test(ShapeSameTestMethods sstest_type) * * Purpose: Test I/O to/from hyperslab selections of different rank in * the parallel case. @@ -1655,43 +2230,37 @@ contig_hyperslab_dr_pio_test__run_test(const int test_num, *------------------------------------------------------------------------- */ +#define CONTIG_HS_DR_PIO_TEST__DEBUG 0 + void -contig_hyperslab_dr_pio_test(ShapeSameTestMethods sstest_type) +contig_hs_dr_pio_test(ShapeSameTestMethods sstest_type) { + int express_test; + int local_express_test; + int mpi_rank = -1; int test_num = 0; int edge_size = 10; int chunk_edge_size = 0; int small_rank; int large_rank; - int skips[4] = {0, 0, 0, 0}; - int skip_counters[4] = {0, 0, 0, 0}; - int tests_skiped[4] = {0, 0, 0, 0}; int mpi_result; + int skips = 0; + int max_skips = 0; + /* The following table list the number of sub-tests skipped between + * each test that is actually executed as a function of the express + * test level. Note that any value in excess of 4880 will cause all + * sub tests to be skipped. + */ + int max_skips_tbl[4] = {0, 4, 64, 1024}; hid_t dset_type = H5T_NATIVE_UINT; -#ifdef H5_HAVE_GETTIMEOFDAY - hbool_t time_tests = TRUE; - hbool_t display_skips = FALSE; - int local_express_test; - int express_test; - int i; - int samples = 0; - int sample_size = 1; - int mpi_size = -1; - int mpi_rank = -1; - int local_skips[4]; - const int ind_contig_idx = 0; - const int col_contig_idx = 1; - const int ind_chunked_idx = 2; - const int col_chunked_idx = 3; - const int test_types = 4; - long long max_test_time = 3000000; /* for one test */ - long long sample_times[4] = {0, 0, 0, 0}; - struct timeval timeval_a; - struct timeval timeval_b; -#endif /* H5_HAVE_GETTIMEOFDAY */ + int64_t total_tests = 0; + int64_t tests_run = 0; + int64_t tests_skipped = 0; HDcompile_assert(sizeof(uint32_t) == sizeof(unsigned)); + MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); + local_express_test = GetTestExpress(); mpi_result = MPI_Allreduce((void *)&local_express_test, @@ -1703,198 +2272,130 @@ contig_hyperslab_dr_pio_test(ShapeSameTestMethods sstest_type) VRFY((mpi_result == MPI_SUCCESS ), "MPI_Allreduce(0) succeeded"); + if ( local_express_test < 0 ) { + max_skips = max_skips_tbl[0]; + } else if ( local_express_test > 3 ) { + max_skips = max_skips_tbl[3]; + } else { + max_skips = max_skips_tbl[local_express_test]; + } + for ( large_rank = 3; large_rank <= PAR_SS_DR_MAX_RANK; large_rank++ ) { for ( small_rank = 2; small_rank < large_rank; small_rank++ ) { - switch(sstest_type){ - case IND_CONTIG: - /* contiguous data set, independent I/O */ - chunk_edge_size = 0; - if ( skip_counters[ind_contig_idx] < skips[ind_contig_idx] ) { - - skip_counters[ind_contig_idx]++; - tests_skiped[ind_contig_idx]++; - printf("Test skipped\n"); - } else { - skip_counters[ind_contig_idx] = 0; - START_TIMER(time_tests, timeval_a, "HDgettimeofday(0) succeeds."); - contig_hyperslab_dr_pio_test__run_test(test_num, + + switch(sstest_type){ + case IND_CONTIG: + /* contiguous data set, independent I/O */ + chunk_edge_size = 0; + + contig_hs_dr_pio_test__run_test(test_num, edge_size, chunk_edge_size, small_rank, large_rank, FALSE, dset_type, - express_test); - STOP_TIMER_AND_UPDATE(time_tests, timeval_b, \ - "HDgettimeofday(1) succeeds.", \ - sample_times[col_contig_idx]); - } - test_num++; - break; - /* end of case IND_CONTIG */ - - case COL_CONTIG: - /* contiguous data set, collective I/O */ - chunk_edge_size = 0; - if ( skip_counters[col_contig_idx] < skips[col_contig_idx] ) { - - skip_counters[col_contig_idx]++; - tests_skiped[col_contig_idx]++; - printf("Test skipped\n"); - } else { - skip_counters[col_contig_idx] = 0; - START_TIMER(time_tests, timeval_a, "HDgettimeofday(2) succeeds."); - contig_hyperslab_dr_pio_test__run_test(test_num, + express_test, + &skips, + max_skips, + &total_tests, + &tests_run, + &tests_skipped); + test_num++; + break; + /* end of case IND_CONTIG */ + + case COL_CONTIG: + /* contiguous data set, collective I/O */ + chunk_edge_size = 0; + + contig_hs_dr_pio_test__run_test(test_num, edge_size, chunk_edge_size, small_rank, large_rank, TRUE, dset_type, - express_test); - STOP_TIMER_AND_UPDATE(time_tests, timeval_b, \ - "HDgettimeofday(3) succeeds.", \ - sample_times[ind_contig_idx]); - } - test_num++; - break; - /* end of case COL_CONTIG */ - - case IND_CHUNKED: - /* chunked data set, independent I/O */ - chunk_edge_size = 5; - if ( skip_counters[ind_chunked_idx] < skips[ind_chunked_idx] ) { - - skip_counters[ind_chunked_idx]++; - tests_skiped[ind_chunked_idx]++; - printf("Test skipped\n"); - } else { - skip_counters[ind_chunked_idx] = 0; - START_TIMER(time_tests, timeval_a, "HDgettimeofday(4) succeeds."); - contig_hyperslab_dr_pio_test__run_test(test_num, + express_test, + &skips, + max_skips, + &total_tests, + &tests_run, + &tests_skipped); + test_num++; + break; + /* end of case COL_CONTIG */ + + case IND_CHUNKED: + /* chunked data set, independent I/O */ + chunk_edge_size = 5; + + contig_hs_dr_pio_test__run_test(test_num, edge_size, chunk_edge_size, small_rank, large_rank, FALSE, dset_type, - express_test); - STOP_TIMER_AND_UPDATE(time_tests, timeval_b, \ - "HDgettimeofday(5) succeeds.", \ - sample_times[col_chunked_idx]); - } - test_num++; - break; - /* end of case IND_CHUNKED */ - - case COL_CHUNKED: - /* chunked data set, collective I/O */ - chunk_edge_size = 5; - if ( skip_counters[col_chunked_idx] < skips[col_chunked_idx] ) { - - skip_counters[col_chunked_idx]++; - tests_skiped[col_chunked_idx]++; - printf("Test skipped\n"); - } else { - skip_counters[col_chunked_idx] = 0; - START_TIMER(time_tests, timeval_a, "HDgettimeofday(6) succeeds."); - contig_hyperslab_dr_pio_test__run_test(test_num, + express_test, + &skips, + max_skips, + &total_tests, + &tests_run, + &tests_skipped); + test_num++; + break; + /* end of case IND_CHUNKED */ + + case COL_CHUNKED: + /* chunked data set, collective I/O */ + chunk_edge_size = 5; + + contig_hs_dr_pio_test__run_test(test_num, edge_size, chunk_edge_size, small_rank, large_rank, TRUE, dset_type, - express_test); - STOP_TIMER_AND_UPDATE(time_tests, timeval_b, \ - "HDgettimeofday(7) succeeds.", \ - sample_times[ind_chunked_idx]); - } - test_num++; - break; - /* end of case COL_CHUNKED */ - } /* end of switch(sstest_type) */ - -#ifdef H5_HAVE_GETTIMEOFDAY - if ( time_tests ) { - - samples++; - - if ( samples >= sample_size ) { - - int result; - - time_tests = FALSE; - - max_test_time = ((long long)sample_size) * max_test_time; - - for ( i = 0; i < test_types; i++ ) { - - if ( ( express_test == 0 ) || - ( sample_times[i] <= max_test_time ) ) { - - local_skips[i] = 0; - - } else { - - local_skips[i] = (int)(sample_times[i] / max_test_time); - } - } - - /* do an MPI_Allreduce() with the skips vector to ensure that - * all processes agree on its contents. - */ - result = MPI_Allreduce((void *)local_skips, - (void *)skips, - test_types, - MPI_INT, - MPI_MAX, - MPI_COMM_WORLD); - VRFY((result == MPI_SUCCESS ), \ - "MPI_Allreduce(1) succeeded"); - } + express_test, + &skips, + max_skips, + &total_tests, + &tests_run, + &tests_skipped); + test_num++; + break; + /* end of case COL_CHUNKED */ + + default: + VRFY((FALSE), "unknown test type"); + break; + + } /* end of switch(sstest_type) */ +#if CONTIG_HS_DR_PIO_TEST__DEBUG + if ( ( MAINPROCESS ) && ( tests_skipped > 0 ) ) { + HDfprintf(stdout, " run/skipped/total = %lld/%lld/%lld.\n", + tests_run, tests_skipped, total_tests); } -#endif /* H5_HAVE_GETTIMEOFDAY */ - +#endif /* CONTIG_HS_DR_PIO_TEST__DEBUG */ } } -#ifdef H5_HAVE_GETTIMEOFDAY - if ( ( MAINPROCESS ) && ( display_skips ) ) { - - HDfprintf(stdout, "***********************************\n"); - HDfprintf(stdout, "express_test = %d.\n", express_test); - HDfprintf(stdout, "sample_size = %d, max_test_time = %lld.\n", - sample_size, max_test_time); - HDfprintf(stdout, "sample_times[] = %lld, %lld, %lld, %lld.\n", - sample_times[ind_contig_idx], - sample_times[col_contig_idx], - sample_times[ind_chunked_idx], - sample_times[col_chunked_idx]); - HDfprintf(stdout, "skips[] = %d, %d, %d, %d.\n", - skips[ind_contig_idx], - skips[col_contig_idx], - skips[ind_chunked_idx], - skips[col_chunked_idx]); - HDfprintf(stdout, "tests_skiped[] = %d, %d, %d, %d.\n", - tests_skiped[ind_contig_idx], - tests_skiped[col_contig_idx], - tests_skiped[ind_chunked_idx], - tests_skiped[col_chunked_idx]); - HDfprintf(stdout, "test_num = %d.\n", test_num); - HDfprintf(stdout, "***********************************\n"); + if ( ( MAINPROCESS ) && ( tests_skipped > 0 ) ) { + HDfprintf(stdout, " %lld of %lld subtests skipped to expedite testing.\n", + tests_skipped, total_tests); } -#endif /* H5_HAVE_GETTIMEOFDAY */ return; -} /* contig_hyperslab_dr_pio_test() */ +} /* contig_hs_dr_pio_test() */ /**************************************************************** ** -** checker_board_hyperslab_dr_pio_test__select_checker_board(): +** ckrbrd_hs_dr_pio_test__slct_ckrbrd(): ** Given a data space of tgt_rank, and dimensions: ** ** (mpi_size + 1), edge_size, ... , edge_size @@ -1915,21 +2416,19 @@ contig_hyperslab_dr_pio_test(ShapeSameTestMethods sstest_type) ** ****************************************************************/ -#define CHECKER_BOARD_HYPERSLAB_DR_PIO_TEST__SELECT_CHECKER_BOARD__DEBUG 0 +#define CKRBRD_HS_DR_PIO_TEST__SELECT_CHECKER_BOARD__DEBUG 0 static void -checker_board_hyperslab_dr_pio_test__select_checker_board( - const int mpi_rank, - const hid_t tgt_sid, - const int tgt_rank, - const int edge_size, - const int checker_edge_size, - const int sel_rank, - hsize_t sel_start[]) +ckrbrd_hs_dr_pio_test__slct_ckrbrd(const int mpi_rank, + const hid_t tgt_sid, + const int tgt_rank, + const int edge_size, + const int checker_edge_size, + const int sel_rank, + hsize_t sel_start[]) { -#if CHECKER_BOARD_HYPERSLAB_DR_PIO_TEST__SELECT_CHECKER_BOARD__DEBUG - const char * fcnName = - "checker_board_hyperslab_dr_pio_test__select_checker_board():"; +#if CKRBRD_HS_DR_PIO_TEST__SELECT_CHECKER_BOARD__DEBUG + const char * fcnName = "ckrbrd_hs_dr_pio_test__slct_ckrbrd():"; #endif hbool_t first_selection = TRUE; int i, j, k, l, m; @@ -1960,14 +2459,14 @@ checker_board_hyperslab_dr_pio_test__select_checker_board( HDassert( n_cube_offset >= 0 ); HDassert( n_cube_offset <= sel_offset ); -#if CHECKER_BOARD_HYPERSLAB_DR_PIO_TEST__SELECT_CHECKER_BOARD__DEBUG +#if CKRBRD_HS_DR_PIO_TEST__SELECT_CHECKER_BOARD__DEBUG HDfprintf(stdout, "%s:%d: edge_size/checker_edge_size = %d/%d\n", fcnName, mpi_rank, edge_size, checker_edge_size); HDfprintf(stdout, "%s:%d: sel_rank/sel_offset = %d/%d.\n", fcnName, mpi_rank, sel_rank, sel_offset); HDfprintf(stdout, "%s:%d: tgt_rank/n_cube_offset = %d/%d.\n", fcnName, mpi_rank, tgt_rank, n_cube_offset); -#endif /* CHECKER_BOARD_HYPERSLAB_DR_PIO_TEST__SELECT_CHECKER_BOARD__DEBUG */ +#endif /* CKRBRD_HS_DR_PIO_TEST__SELECT_CHECKER_BOARD__DEBUG */ /* First, compute the base count (which assumes start == 0 * for the associated offset) and offset_count (which @@ -2117,7 +2616,7 @@ checker_board_hyperslab_dr_pio_test__select_checker_board( if ( ((i + j + k + l + m) % 2) == 0 ) { -#if CHECKER_BOARD_HYPERSLAB_DR_PIO_TEST__SELECT_CHECKER_BOARD__DEBUG +#if CKRBRD_HS_DR_PIO_TEST__SELECT_CHECKER_BOARD__DEBUG HDfprintf(stdout, "%s%d: *** first_selection = %d ***\n", fcnName, mpi_rank, (int)first_selection); HDfprintf(stdout, "%s:%d: i/j/k/l/m = %d/%d/%d/%d/%d\n", @@ -2204,10 +2703,10 @@ checker_board_hyperslab_dr_pio_test__select_checker_board( } while ( ( i <= 1 ) && ( 0 >= sel_offset ) ); -#if CHECKER_BOARD_HYPERSLAB_DR_PIO_TEST__SELECT_CHECKER_BOARD__DEBUG +#if CKRBRD_HS_DR_PIO_TEST__SELECT_CHECKER_BOARD__DEBUG HDfprintf(stdout, "%s%d: H5Sget_select_npoints(tgt_sid) = %d.\n", fcnName, mpi_rank, (int)H5Sget_select_npoints(tgt_sid)); -#endif /* CHECKER_BOARD_HYPERSLAB_DR_PIO_TEST__SELECT_CHECKER_BOARD__DEBUG */ +#endif /* CKRBRD_HS_DR_PIO_TEST__SELECT_CHECKER_BOARD__DEBUG */ /* Clip the selection back to the data space proper. */ @@ -2224,20 +2723,20 @@ checker_board_hyperslab_dr_pio_test__select_checker_board( VRFY((ret != FAIL), "H5Sselect_hyperslab(AND) succeeded"); -#if CHECKER_BOARD_HYPERSLAB_DR_PIO_TEST__SELECT_CHECKER_BOARD__DEBUG +#if CKRBRD_HS_DR_PIO_TEST__SELECT_CHECKER_BOARD__DEBUG HDfprintf(stdout, "%s%d: H5Sget_select_npoints(tgt_sid) = %d.\n", fcnName, mpi_rank, (int)H5Sget_select_npoints(tgt_sid)); HDfprintf(stdout, "%s%d: done.\n", fcnName, mpi_rank); -#endif /* CHECKER_BOARD_HYPERSLAB_DR_PIO_TEST__SELECT_CHECKER_BOARD__DEBUG */ +#endif /* CKRBRD_HS_DR_PIO_TEST__SELECT_CHECKER_BOARD__DEBUG */ return; -} /* checker_board_hyperslab_dr_pio_test__select_checker_board() */ +} /* ckrbrd_hs_dr_pio_test__slct_ckrbrd() */ /**************************************************************** ** -** checker_board_hyperslab_dr_pio_test__verify_data(): +** ckrbrd_hs_dr_pio_test__verify_data(): ** ** Examine the supplied buffer to see if it contains the ** expected data. Return TRUE if it does, and FALSE @@ -2291,19 +2790,18 @@ checker_board_hyperslab_dr_pio_test__select_checker_board( ** ****************************************************************/ -#define CHECKER_BOARD_HYPERSLAB_DR_PIO_TEST__VERIFY_DATA__DEBUG 0 +#define CKRBRD_HS_DR_PIO_TEST__VERIFY_DATA__DEBUG 0 static hbool_t -checker_board_hyperslab_dr_pio_test__verify_data(uint32_t * buf_ptr, - const int rank, - const int edge_size, - const int checker_edge_size, - uint32_t first_expected_val, - hbool_t buf_starts_in_checker) +ckrbrd_hs_dr_pio_test__verify_data(uint32_t * buf_ptr, + const int rank, + const int edge_size, + const int checker_edge_size, + uint32_t first_expected_val, + hbool_t buf_starts_in_checker) { -#if CHECKER_BOARD_HYPERSLAB_DR_PIO_TEST__VERIFY_DATA__DEBUG - const char * fcnName = - "checker_board_hyperslab_dr_pio_test__verify_data():"; +#if CKRBRD_HS_DR_PIO_TEST__VERIFY_DATA__DEBUG + const char * fcnName = "ckrbrd_hs_dr_pio_test__verify_data():"; #endif hbool_t good_data = TRUE; hbool_t in_checker; @@ -2322,7 +2820,7 @@ checker_board_hyperslab_dr_pio_test__verify_data(uint32_t * buf_ptr, HDassert( checker_edge_size <= edge_size ); HDassert( test_max_rank <= PAR_SS_DR_MAX_RANK ); -#if CHECKER_BOARD_HYPERSLAB_DR_PIO_TEST__VERIFY_DATA__DEBUG +#if CKRBRD_HS_DR_PIO_TEST__VERIFY_DATA__DEBUG int mpi_rank; @@ -2385,13 +2883,13 @@ checker_board_hyperslab_dr_pio_test__verify_data(uint32_t * buf_ptr, m = 0; z = 0; -#if CHECKER_BOARD_HYPERSLAB_DR_PIO_TEST__VERIFY_DATA__DEBUG +#if CKRBRD_HS_DR_PIO_TEST__VERIFY_DATA__DEBUG HDfprintf(stdout, "%d, %d, %d, %d, %d:", i, j, k, l, m); #endif in_checker = start_in_checker[3]; do { -#if CHECKER_BOARD_HYPERSLAB_DR_PIO_TEST__VERIFY_DATA__DEBUG +#if CKRBRD_HS_DR_PIO_TEST__VERIFY_DATA__DEBUG HDfprintf(stdout, " %d", (int)(*val_ptr)); #endif if ( z >= checker_edge_size ) { @@ -2426,7 +2924,7 @@ checker_board_hyperslab_dr_pio_test__verify_data(uint32_t * buf_ptr, } while ( ( rank >= (test_max_rank - 4) ) && ( m < edge_size ) ); -#if CHECKER_BOARD_HYPERSLAB_DR_PIO_TEST__VERIFY_DATA__DEBUG +#if CKRBRD_HS_DR_PIO_TEST__VERIFY_DATA__DEBUG HDfprintf(stdout, "\n"); #endif l++; @@ -2448,668 +2946,118 @@ checker_board_hyperslab_dr_pio_test__verify_data(uint32_t * buf_ptr, return(good_data); -} /* checker_board_hyperslab_dr_pio_test__verify_data() */ +} /* ckrbrd_hs_dr_pio_test__verify_data() */ /*------------------------------------------------------------------------- - * Function: checker_board_hyperslab_dr_pio_test__run_test() + * Function: ckrbrd_hs_dr_pio_test__d2m_l2s() * - * Purpose: Test I/O to/from checkerboard selections of hyperslabs of - * different rank in the parallel. + * Purpose: Part one of a series of tests of I/O to/from hyperslab + * selections of different rank in the parallel. + * + * Verify that we can read from disk correctly using checker + * board selections of different rank that + * H5S_select_shape_same() views as being of the same shape. + * + * In this function, we test this by reading small_rank - 1 + * checker board slices from the on disk large cube, and + * verifying that the data read is correct. Verify that + * H5S_select_shape_same() returns true on the memory and + * file selections. * * Return: void * - * Programmer: JRM -- 10/10/09 + * Programmer: JRM -- 9/15/11 * * Modifications: * - * JRM -- 9/16/10 - * Added the express_test parameter. Use it to control - * whether we set an alignment, and whether we allocate - * chunks such that no two processes will normally touch - * the same chunk. + * None. * *------------------------------------------------------------------------- */ -#define PAR_SS_DR_MAX_RANK 5 -#define CHECKER_BOARD_HYPERSLAB_DR_PIO_TEST__RUN_TEST__DEBUG 0 +#define CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG 0 static void -checker_board_hyperslab_dr_pio_test__run_test(const int test_num, - const int edge_size, - const int checker_edge_size, - const int chunk_edge_size, - const int small_rank, - const int large_rank, - const hbool_t use_collective_io, - const hid_t dset_type, - const int express_test) +ckrbrd_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) { -#if CHECKER_BOARD_HYPERSLAB_DR_PIO_TEST__RUN_TEST__DEBUG - const char *fcnName = "checker_board_hyperslab_dr_pio_test__run_test()"; -#endif /* CHECKER_BOARD_HYPERSLAB_DR_PIO_TEST__RUN_TEST__DEBUG */ - const char *filename; - hbool_t use_gpfs = FALSE; /* Use GPFS hints */ +#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG + const char *fcnName = "ckrbrd_hs_dr_pio_test__d2m_l2s()"; + uint32_t * ptr_0; +#endif /* CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG */ hbool_t data_ok = FALSE; - hbool_t mis_match = FALSE; int i, j, k, l; - size_t u; - int mrc; - size_t start_index; - size_t stop_index; - int small_ds_offset; - int large_ds_offset; - const int test_max_rank = 5; /* must update code if this changes */ uint32_t expected_value; - uint32_t * small_ds_buf_0 = NULL; - uint32_t * small_ds_buf_1 = NULL; - uint32_t * small_ds_buf_2 = NULL; - uint32_t * small_ds_slice_buf = NULL; - uint32_t * large_ds_buf_0 = NULL; - uint32_t * large_ds_buf_1 = NULL; - uint32_t * large_ds_buf_2 = NULL; - uint32_t * large_ds_slice_buf = NULL; - uint32_t * ptr_0; - uint32_t * ptr_1; - int mpi_rank; - int mpi_size; - MPI_Comm mpi_comm = MPI_COMM_NULL; - MPI_Info mpi_info = MPI_INFO_NULL; - hid_t fid; /* HDF5 file ID */ - hid_t acc_tpl; /* File access templates */ - hid_t xfer_plist = H5P_DEFAULT; - hid_t full_mem_small_ds_sid; - hid_t full_file_small_ds_sid; - hid_t mem_small_ds_sid; - hid_t file_small_ds_sid_0; - hid_t file_small_ds_sid_1; - hid_t small_ds_slice_sid; - hid_t full_mem_large_ds_sid; - hid_t full_file_large_ds_sid; - hid_t mem_large_ds_sid; - hid_t file_large_ds_sid_0; - hid_t file_large_ds_sid_1; - hid_t file_large_ds_process_slice_sid; - hid_t mem_large_ds_process_slice_sid; - hid_t large_ds_slice_sid; - hid_t small_ds_dcpl_id = H5P_DEFAULT; - hid_t large_ds_dcpl_id = H5P_DEFAULT; - hid_t small_dataset; /* Dataset ID */ - hid_t large_dataset; /* Dataset ID */ - size_t small_ds_size = 1; - size_t small_ds_slice_size = 1; - size_t large_ds_size = 1; - size_t large_ds_slice_size = 1; - hsize_t dims[PAR_SS_DR_MAX_RANK]; - hsize_t chunk_dims[PAR_SS_DR_MAX_RANK]; - hsize_t start[PAR_SS_DR_MAX_RANK]; - hsize_t stride[PAR_SS_DR_MAX_RANK]; - hsize_t count[PAR_SS_DR_MAX_RANK]; - hsize_t block[PAR_SS_DR_MAX_RANK]; + int mpi_rank; /* needed by VRFY */ hsize_t sel_start[PAR_SS_DR_MAX_RANK]; htri_t check; /* Shape comparison return value */ herr_t ret; /* Generic return value */ - HDassert( edge_size >= 6 ); - HDassert( edge_size >= chunk_edge_size ); - HDassert( ( chunk_edge_size == 0 ) || ( chunk_edge_size >= 3 ) ); - HDassert( 1 < small_rank ); - HDassert( small_rank < large_rank ); - HDassert( large_rank <= test_max_rank ); - HDassert( test_max_rank <= PAR_SS_DR_MAX_RANK ); - - MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); - MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); - - HDassert( mpi_size >= 1 ); - - mpi_comm = MPI_COMM_WORLD; - mpi_info = MPI_INFO_NULL; - - for ( i = 0; i < small_rank - 1; i++ ) - { - small_ds_size *= (size_t)edge_size; - small_ds_slice_size *= (size_t)edge_size; - } - small_ds_size *= (size_t)(mpi_size + 1); - - small_ds_offset = PAR_SS_DR_MAX_RANK - small_rank; - - HDassert( 0 < small_ds_offset ); - HDassert( small_ds_offset < PAR_SS_DR_MAX_RANK ); - - - for ( i = 0; i < large_rank - 1; i++ ) { - - large_ds_size *= (size_t)edge_size; - large_ds_slice_size *= (size_t)edge_size; - } - large_ds_size *= (size_t)(mpi_size + 1); - - large_ds_offset = PAR_SS_DR_MAX_RANK - large_rank; - - HDassert( 0 <= large_ds_offset ); - HDassert( large_ds_offset < PAR_SS_DR_MAX_RANK ); - - - /* Allocate buffers */ - small_ds_buf_0 = (uint32_t *)HDmalloc(sizeof(uint32_t) * small_ds_size); - VRFY((small_ds_buf_0 != NULL), "malloc of small_ds_buf_0 succeeded"); - - small_ds_buf_1 = (uint32_t *)HDmalloc(sizeof(uint32_t) * small_ds_size); - VRFY((small_ds_buf_1 != NULL), "malloc of small_ds_buf_1 succeeded"); - - small_ds_buf_2 = (uint32_t *)HDmalloc(sizeof(uint32_t) * small_ds_size); - VRFY((small_ds_buf_2 != NULL), "malloc of small_ds_buf_2 succeeded"); - - small_ds_slice_buf = - (uint32_t *)HDmalloc(sizeof(uint32_t) * small_ds_slice_size); - VRFY((small_ds_slice_buf != NULL), "malloc of small_ds_slice_buf succeeded"); - - large_ds_buf_0 = (uint32_t *)HDmalloc(sizeof(uint32_t) * large_ds_size); - VRFY((large_ds_buf_0 != NULL), "malloc of large_ds_buf_0 succeeded"); - - large_ds_buf_1 = (uint32_t *)HDmalloc(sizeof(uint32_t) * large_ds_size); - VRFY((large_ds_buf_1 != NULL), "malloc of large_ds_buf_1 succeeded"); - - large_ds_buf_2 = (uint32_t *)HDmalloc(sizeof(uint32_t) * large_ds_size); - VRFY((large_ds_buf_2 != NULL), "malloc of large_ds_buf_2 succeeded"); - - large_ds_slice_buf = - (uint32_t *)HDmalloc(sizeof(uint32_t) * large_ds_slice_size); - VRFY((large_ds_slice_buf != NULL), "malloc of large_ds_slice_buf succeeded"); - - /* initialize the buffers */ - - ptr_0 = small_ds_buf_0; - for(i = 0; i < (int)small_ds_size; i++) - *ptr_0++ = (uint32_t)i; - HDmemset(small_ds_buf_1, 0, sizeof(uint32_t) * small_ds_size); - HDmemset(small_ds_buf_2, 0, sizeof(uint32_t) * small_ds_size); - - HDmemset(small_ds_slice_buf, 0, sizeof(uint32_t) * small_ds_slice_size); - - ptr_0 = large_ds_buf_0; - for(i = 0; i < (int)large_ds_size; i++) - *ptr_0++ = (uint32_t)i; - HDmemset(large_ds_buf_1, 0, sizeof(uint32_t) * large_ds_size); - HDmemset(large_ds_buf_2, 0, sizeof(uint32_t) * large_ds_size); - - HDmemset(large_ds_slice_buf, 0, sizeof(uint32_t) * large_ds_slice_size); - - filename = (const char *)GetTestParameters(); - HDassert( filename != NULL ); - -#if CHECKER_BOARD_HYPERSLAB_DR_PIO_TEST__RUN_TEST__DEBUG - if ( MAINPROCESS ) { - - HDfprintf(stdout, "%s:%d: test num = %d.\n", fcnName, mpi_rank, test_num); - HDfprintf(stdout, "%s:%d: mpi_size = %d.\n", fcnName, mpi_rank, mpi_size); - HDfprintf(stdout, - "%s:%d: small/large rank = %d/%d, use_collective_io = %d.\n", - fcnName, mpi_rank, small_rank, large_rank, (int)use_collective_io); - HDfprintf(stdout, "%s:%d: edge_size = %d, chunk_edge_size = %d.\n", - fcnName, mpi_rank, edge_size, chunk_edge_size); - HDfprintf(stdout, "%s:%d: checker_edge_size = %d.\n", - fcnName, mpi_rank, checker_edge_size); - HDfprintf(stdout, "%s:%d: small_ds_size = %d, large_ds_size = %d.\n", - fcnName, mpi_rank, (int)small_ds_size, (int)large_ds_size); - HDfprintf(stdout, "%s:%d: filename = %s.\n", fcnName, mpi_rank, filename); - } -#endif /* CHECKER_BOARD_HYPERSLAB_DR_PIO_TEST__RUN_TEST__DEBUG */ - - /* ---------------------------------------- - * CREATE AN HDF5 FILE WITH PARALLEL ACCESS - * ---------------------------------------*/ - /* setup file access template */ - acc_tpl = create_faccess_plist(mpi_comm, mpi_info, facc_type, use_gpfs); - VRFY((acc_tpl >= 0), "create_faccess_plist() succeeded"); - - /* set the alignment -- need it large so that we aren't always hitting the - * the same file system block. Do this only if express_test is greater - * than zero. - */ - if ( express_test > 0 ) { - - ret = H5Pset_alignment(acc_tpl, (hsize_t)0, SHAPE_SAME_TEST_ALIGNMENT); - VRFY((ret != FAIL), "H5Pset_alignment() succeeded"); - } - - /* create the file collectively */ - fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, acc_tpl); - VRFY((fid >= 0), "H5Fcreate succeeded"); - - MESG("File opened."); - - /* Release file-access template */ - ret = H5Pclose(acc_tpl); - VRFY((ret >= 0), "H5Pclose(acc_tpl) succeeded"); - - - /* setup dims: */ - dims[0] = (hsize_t)(mpi_size + 1); - dims[1] = dims[2] = dims[3] = dims[4] = (hsize_t)edge_size; - - - /* Create small ds dataspaces */ - full_mem_small_ds_sid = H5Screate_simple(small_rank, dims, NULL); - VRFY((full_mem_small_ds_sid != 0), - "H5Screate_simple() full_mem_small_ds_sid succeeded"); - - full_file_small_ds_sid = H5Screate_simple(small_rank, dims, NULL); - VRFY((full_file_small_ds_sid != 0), - "H5Screate_simple() full_file_small_ds_sid succeeded"); - - mem_small_ds_sid = H5Screate_simple(small_rank, dims, NULL); - VRFY((mem_small_ds_sid != 0), - "H5Screate_simple() mem_small_ds_sid succeeded"); - - file_small_ds_sid_0 = H5Screate_simple(small_rank, dims, NULL); - VRFY((file_small_ds_sid_0 != 0), - "H5Screate_simple() file_small_ds_sid_0 succeeded"); - - file_small_ds_sid_1 = H5Screate_simple(small_rank, dims, NULL); - VRFY((file_small_ds_sid_1 != 0), - "H5Screate_simple() file_small_ds_sid_1 succeeded"); - - small_ds_slice_sid = H5Screate_simple(small_rank - 1, &(dims[1]), NULL); - VRFY((small_ds_slice_sid != 0), - "H5Screate_simple() small_ds_slice_sid succeeded"); - - - /* Create large ds dataspaces */ - full_mem_large_ds_sid = H5Screate_simple(large_rank, dims, NULL); - VRFY((full_mem_large_ds_sid != 0), - "H5Screate_simple() full_mem_large_ds_sid succeeded"); - - full_file_large_ds_sid = H5Screate_simple(large_rank, dims, NULL); - VRFY((full_file_large_ds_sid != FAIL), - "H5Screate_simple() full_file_large_ds_sid succeeded"); - - mem_large_ds_sid = H5Screate_simple(large_rank, dims, NULL); - VRFY((mem_large_ds_sid != FAIL), - "H5Screate_simple() mem_large_ds_sid succeeded"); - - file_large_ds_sid_0 = H5Screate_simple(large_rank, dims, NULL); - VRFY((file_large_ds_sid_0 != FAIL), - "H5Screate_simple() file_large_ds_sid_0 succeeded"); - - file_large_ds_sid_1 = H5Screate_simple(large_rank, dims, NULL); - VRFY((file_large_ds_sid_1 != FAIL), - "H5Screate_simple() file_large_ds_sid_1 succeeded"); - - mem_large_ds_process_slice_sid = H5Screate_simple(large_rank, dims, NULL); - VRFY((mem_large_ds_process_slice_sid != FAIL), - "H5Screate_simple() mem_large_ds_process_slice_sid succeeded"); - - file_large_ds_process_slice_sid = H5Screate_simple(large_rank, dims, NULL); - VRFY((file_large_ds_process_slice_sid != FAIL), - "H5Screate_simple() file_large_ds_process_slice_sid succeeded"); - - - large_ds_slice_sid = H5Screate_simple(large_rank - 1, &(dims[1]), NULL); - VRFY((large_ds_slice_sid != 0), - "H5Screate_simple() large_ds_slice_sid succeeded"); - - - /* if chunk edge size is greater than zero, set up the small and - * large data set creation property lists to specify chunked - * datasets. - */ - if ( chunk_edge_size > 0 ) { - - /* Under Lustre (and perhaps other parallel file systems?) we get - * locking delays when two or more processes attempt to access the - * same file system block. - * - * To minimize this problem, I have changed chunk_dims[0] - * from (mpi_size + 1) to just when any sort of express test is - * selected. Given the structure of the test, and assuming we - * set the alignment large enough, this avoids the contention - * issue by seeing to it that each chunk is only accessed by one - * process. - * - * One can argue as to whether this is a good thing to do in our - * tests, but for now it is necessary if we want the test to complete - * in a reasonable amount of time. - * - * JRM -- 9/16/10 - */ - if ( express_test == 0 ) { - - chunk_dims[0] = 1; - - } else { - - chunk_dims[0] = 1; - } - - chunk_dims[1] = chunk_dims[2] = - chunk_dims[3] = chunk_dims[4] = (hsize_t)chunk_edge_size; - - small_ds_dcpl_id = H5Pcreate(H5P_DATASET_CREATE); - VRFY((ret != FAIL), "H5Pcreate() small_ds_dcpl_id succeeded"); - - ret = H5Pset_layout(small_ds_dcpl_id, H5D_CHUNKED); - VRFY((ret != FAIL), "H5Pset_layout() small_ds_dcpl_id succeeded"); - - ret = H5Pset_chunk(small_ds_dcpl_id, small_rank, chunk_dims); - VRFY((ret != FAIL), "H5Pset_chunk() small_ds_dcpl_id succeeded"); - - - large_ds_dcpl_id = H5Pcreate(H5P_DATASET_CREATE); - VRFY((ret != FAIL), "H5Pcreate() large_ds_dcpl_id succeeded"); - - ret = H5Pset_layout(large_ds_dcpl_id, H5D_CHUNKED); - VRFY((ret != FAIL), "H5Pset_layout() large_ds_dcpl_id succeeded"); - - ret = H5Pset_chunk(large_ds_dcpl_id, large_rank, chunk_dims); - VRFY((ret != FAIL), "H5Pset_chunk() large_ds_dcpl_id succeeded"); - } - - /* create the small dataset */ - small_dataset = H5Dcreate2(fid, "small_dataset", dset_type, - file_small_ds_sid_0, H5P_DEFAULT, - small_ds_dcpl_id, H5P_DEFAULT); - VRFY((ret != FAIL), "H5Dcreate2() small_dataset succeeded"); - - /* create the large dataset */ - large_dataset = H5Dcreate2(fid, "large_dataset", dset_type, - file_large_ds_sid_0, H5P_DEFAULT, - large_ds_dcpl_id, H5P_DEFAULT); - VRFY((ret != FAIL), "H5Dcreate2() large_dataset succeeded"); - - - /* setup xfer property list */ - xfer_plist = H5Pcreate(H5P_DATASET_XFER); - VRFY((xfer_plist >= 0), "H5Pcreate(H5P_DATASET_XFER) succeeded"); - - if(use_collective_io) { - ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); - VRFY((ret >= 0), "H5Pset_dxpl_mpio succeeded"); - } - - - /* setup selection to write initial data to the small and large data sets */ - start[0] = (hsize_t)mpi_rank; - stride[0] = (hsize_t)(2 * (mpi_size + 1)); - count[0] = 1; - block[0] = 1; - - for ( i = 1; i < large_rank; i++ ) { - - start[i] = 0; - stride[i] = (hsize_t)(2 * edge_size); - count[i] = 1; - block[i] = (hsize_t)edge_size; - } - - /* setup selections for writing initial data to the small data set */ - ret = H5Sselect_hyperslab(mem_small_ds_sid, - H5S_SELECT_SET, - start, - stride, - count, - block); - VRFY((ret >= 0), "H5Sselect_hyperslab(mem_small_ds_sid, set) suceeded"); - - ret = H5Sselect_hyperslab(file_small_ds_sid_0, - H5S_SELECT_SET, - start, - stride, - count, - block); - VRFY((ret >= 0), "H5Sselect_hyperslab(file_small_ds_sid_0, set) suceeded"); - - if ( MAINPROCESS ) { /* add an additional slice to the selections */ - - start[0] = (hsize_t)mpi_size; - - ret = H5Sselect_hyperslab(mem_small_ds_sid, - H5S_SELECT_OR, - start, - stride, - count, - block); - VRFY((ret>= 0), "H5Sselect_hyperslab(mem_small_ds_sid, or) suceeded"); - - ret = H5Sselect_hyperslab(file_small_ds_sid_0, - H5S_SELECT_OR, - start, - stride, - count, - block); - VRFY((ret>= 0), "H5Sselect_hyperslab(file_small_ds_sid_0, or) suceeded"); - } - - - /* write the initial value of the small data set to file */ - ret = H5Dwrite(small_dataset, dset_type, mem_small_ds_sid, file_small_ds_sid_0, - xfer_plist, small_ds_buf_0); - VRFY((ret >= 0), "H5Dwrite() small_dataset initial write succeeded"); - - - /* sync with the other processes before checking data */ - if ( ! use_collective_io ) { - - mrc = MPI_Barrier(MPI_COMM_WORLD); - VRFY((mrc==MPI_SUCCESS), "Sync after small dataset writes"); - } - - /* read the small data set back to verify that it contains the - * expected data. Note that each process reads in the entire - * data set and verifies it. - */ - ret = H5Dread(small_dataset, - H5T_NATIVE_UINT32, - full_mem_small_ds_sid, - full_file_small_ds_sid, - xfer_plist, - small_ds_buf_1); - VRFY((ret >= 0), "H5Dread() small_dataset initial read succeeded"); - - - /* verify that the correct data was written to the small data set */ - expected_value = 0; - mis_match = FALSE; - ptr_1 = small_ds_buf_1; - - i = 0; - for ( i = 0; i < (int)small_ds_size; i++ ) { - - if ( *ptr_1 != expected_value ) { - - mis_match = TRUE; - } - ptr_1++; - expected_value++; - } - VRFY( (mis_match == FALSE), "small ds init data good."); - - - - /* setup selections for writing initial data to the large data set */ - - start[0] = (hsize_t)mpi_rank; - - ret = H5Sselect_hyperslab(mem_large_ds_sid, - H5S_SELECT_SET, - start, - stride, - count, - block); - VRFY((ret >= 0), "H5Sselect_hyperslab(mem_large_ds_sid, set) suceeded"); - - ret = H5Sselect_hyperslab(file_large_ds_sid_0, - H5S_SELECT_SET, - start, - stride, - count, - block); - VRFY((ret >= 0), "H5Sselect_hyperslab(file_large_ds_sid_0, set) suceeded"); - - /* In passing, setup the process slice data spaces as well */ - - ret = H5Sselect_hyperslab(mem_large_ds_process_slice_sid, - H5S_SELECT_SET, - start, - stride, - count, - block); - VRFY((ret >= 0), - "H5Sselect_hyperslab(mem_large_ds_process_slice_sid, set) suceeded"); - - ret = H5Sselect_hyperslab(file_large_ds_process_slice_sid, - H5S_SELECT_SET, - start, - stride, - count, - block); - VRFY((ret >= 0), - "H5Sselect_hyperslab(file_large_ds_process_slice_sid, set) suceeded"); - - if ( MAINPROCESS ) { /* add an additional slice to the selections */ - - start[0] = (hsize_t)mpi_size; - - ret = H5Sselect_hyperslab(mem_large_ds_sid, - H5S_SELECT_OR, - start, - stride, - count, - block); - VRFY((ret>= 0), "H5Sselect_hyperslab(mem_large_ds_sid, or) suceeded"); - - ret = H5Sselect_hyperslab(file_large_ds_sid_0, - H5S_SELECT_OR, - start, - stride, - count, - block); - VRFY((ret>= 0), "H5Sselect_hyperslab(file_large_ds_sid_0, or) suceeded"); - } - - - /* write the initial value of the large data set to file */ - ret = H5Dwrite(large_dataset, dset_type, mem_large_ds_sid, file_large_ds_sid_0, - xfer_plist, large_ds_buf_0); - if ( ret < 0 ) H5Eprint2(H5E_DEFAULT, stderr); - VRFY((ret >= 0), "H5Dwrite() large_dataset initial write succeeded"); - - - /* sync with the other processes before checking data */ - if ( ! use_collective_io ) { - - mrc = MPI_Barrier(MPI_COMM_WORLD); - VRFY((mrc==MPI_SUCCESS), "Sync after large dataset writes"); - } - - - /* read the small data set back to verify that it contains the - * expected data. Note that each process reads in the entire - * data set. - */ - ret = H5Dread(large_dataset, - H5T_NATIVE_UINT32, - full_mem_large_ds_sid, - full_file_large_ds_sid, - xfer_plist, - large_ds_buf_1); - VRFY((ret >= 0), "H5Dread() large_dataset initial read succeeded"); - - - /* verify that the correct data was written to the small data set */ - expected_value = 0; - mis_match = FALSE; - ptr_1 = large_ds_buf_1; - - i = 0; - for ( i = 0; i < (int)large_ds_size; i++ ) { - - if ( *ptr_1 != expected_value ) { - - mis_match = TRUE; - } - ptr_1++; - expected_value++; - } - VRFY( (mis_match == FALSE), "large ds init data good."); - - /* sync with the other processes before changing data */ - - if ( ! use_collective_io ) { - - mrc = MPI_Barrier(MPI_COMM_WORLD); - VRFY((mrc==MPI_SUCCESS), "Sync after initial values check"); - } - + /* initialize the local copy of mpi_rank */ + mpi_rank = tv_ptr->mpi_rank; - /***********************************/ - /***** INITIALIZATION COMPLETE *****/ - /***********************************/ /* first, verify that we can read from disk correctly using selections * of different rank that H5S_select_shape_same() views as being of the * same shape. * - * Start by reading a (small_rank - 1)-D slice from this processes slice - * of the on disk large data set, and verifying that the data read is - * correct. Verify that H5S_select_shape_same() returns true on the - * memory and file selections. + * Start by reading a (small_rank - 1)-D checker board slice from this + * processes slice of the on disk large data set, and verifying that the + * data read is correct. Verify that H5S_select_shape_same() returns + * true on the memory and file selections. * * The first step is to set up the needed checker board selection in the * in memory small small cube */ sel_start[0] = sel_start[1] = sel_start[2] = sel_start[3] = sel_start[4] = 0; - sel_start[small_ds_offset] = (hsize_t)mpi_rank; + sel_start[tv_ptr->small_ds_offset] = (hsize_t)(tv_ptr->mpi_rank); - checker_board_hyperslab_dr_pio_test__select_checker_board(mpi_rank, - small_ds_slice_sid, - small_rank - 1, - edge_size, - checker_edge_size, - small_rank - 1, - sel_start); + ckrbrd_hs_dr_pio_test__slct_ckrbrd(tv_ptr->mpi_rank, + tv_ptr->small_ds_slice_sid, + tv_ptr->small_rank - 1, + tv_ptr->edge_size, + tv_ptr->checker_edge_size, + tv_ptr->small_rank - 1, + sel_start); /* zero out the buffer we will be reading into */ - HDmemset(small_ds_slice_buf, 0, sizeof(uint32_t) * small_ds_slice_size); + HDmemset(tv_ptr->small_ds_slice_buf, 0, sizeof(uint32_t) * tv_ptr->small_ds_slice_size); -#if CHECKER_BOARD_HYPERSLAB_DR_PIO_TEST__RUN_TEST__DEBUG +#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG HDfprintf(stdout, "%s:%d: initial small_ds_slice_buf = ", - fcnName, mpi_rank); - ptr_0 = small_ds_slice_buf; - for ( i = 0; i < (int)small_ds_slice_size; i++ ) { - HDfprintf(stdout, "%d ", (int)(*ptr_0)); + fcnName, tv_ptr->mpi_rank); + ptr_0 = tv_ptr->small_ds_slice_buf; + for ( i = 0; i < (int)(tv_ptr->small_ds_slice_size); i++ ) { + HDfprintf(stdout, "%d ", (int)(*ptr_0)); ptr_0++; } HDfprintf(stdout, "\n"); -#endif /* CHECKER_BOARD_HYPERSLAB_DR_PIO_TEST__RUN_TEST__DEBUG */ +#endif /* CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG */ /* set up start, stride, count, and block -- note that we will * change start[] so as to read slices of the large cube. */ for ( i = 0; i < PAR_SS_DR_MAX_RANK; i++ ) { - start[i] = 0; - stride[i] = (hsize_t)(2 * edge_size); - count[i] = 1; - if ( (PAR_SS_DR_MAX_RANK - i) > (small_rank - 1) ) { + tv_ptr->start[i] = 0; + tv_ptr->stride[i] = (hsize_t)(2 * tv_ptr->edge_size); + tv_ptr->count[i] = 1; + if ( (PAR_SS_DR_MAX_RANK - i) > (tv_ptr->small_rank - 1) ) { - block[i] = 1; + tv_ptr->block[i] = 1; } else { - block[i] = (hsize_t)edge_size; + tv_ptr->block[i] = (hsize_t)(tv_ptr->edge_size); } } -#if CHECKER_BOARD_HYPERSLAB_DR_PIO_TEST__RUN_TEST__DEBUG +#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG HDfprintf(stdout, "%s:%d: reading slice from big ds on disk into small ds slice.\n", - fcnName, mpi_rank); -#endif /* CHECKER_BOARD_HYPERSLAB_DR_PIO_TEST__RUN_TEST__DEBUG */ + fcnName, tv_ptr->mpi_rank); +#endif /* CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG */ /* in serial versions of this test, we loop through all the dimensions * of the large data set. However, in the parallel version, each * process only works with that slice of the large cube indicated @@ -3117,9 +3065,9 @@ checker_board_hyperslab_dr_pio_test__run_test(const int test_num, * mpi_rank, and don't itterate over it. */ - if ( PAR_SS_DR_MAX_RANK - large_rank == 0 ) { + if ( PAR_SS_DR_MAX_RANK - tv_ptr->large_rank == 0 ) { - i = mpi_rank; + i = tv_ptr->mpi_rank; } else { @@ -3132,9 +3080,9 @@ checker_board_hyperslab_dr_pio_test__run_test(const int test_num, * test. */ - if ( PAR_SS_DR_MAX_RANK - large_rank == 1 ) { + if ( PAR_SS_DR_MAX_RANK - tv_ptr->large_rank == 1 ) { - j = mpi_rank; + j = tv_ptr->mpi_rank; } else { @@ -3142,9 +3090,9 @@ checker_board_hyperslab_dr_pio_test__run_test(const int test_num, } do { - if ( PAR_SS_DR_MAX_RANK - large_rank == 2 ) { + if ( PAR_SS_DR_MAX_RANK - tv_ptr->large_rank == 2 ) { - k = mpi_rank; + k = tv_ptr->mpi_rank; } else { @@ -3164,98 +3112,167 @@ checker_board_hyperslab_dr_pio_test__run_test(const int test_num, l = 0; do { - /* we know that small_rank - 1 >= 1 and that - * large_rank > small_rank by the assertions at the head - * of this function. Thus no need for another inner loop. - */ - start[0] = (hsize_t)i; - start[1] = (hsize_t)j; - start[2] = (hsize_t)k; - start[3] = (hsize_t)l; - start[4] = 0; - - HDassert( ( start[0] == 0 ) || ( 0 < small_ds_offset + 1 ) ); - HDassert( ( start[1] == 0 ) || ( 1 < small_ds_offset + 1 ) ); - HDassert( ( start[2] == 0 ) || ( 2 < small_ds_offset + 1 ) ); - HDassert( ( start[3] == 0 ) || ( 3 < small_ds_offset + 1 ) ); - HDassert( ( start[4] == 0 ) || ( 4 < small_ds_offset + 1 ) ); - - checker_board_hyperslab_dr_pio_test__select_checker_board - ( - mpi_rank, - file_large_ds_sid_0, - large_rank, - edge_size, - checker_edge_size, - small_rank - 1, - start - ); - - /* verify that H5S_select_shape_same() reports the two - * selections as having the same shape. - */ - check = H5S_select_shape_same_test(small_ds_slice_sid, - file_large_ds_sid_0); - VRFY((check == TRUE), "H5S_select_shape_same_test passed"); - - - /* Read selection from disk */ -#if CHECKER_BOARD_HYPERSLAB_DR_PIO_TEST__RUN_TEST__DEBUG - HDfprintf(stdout, "%s:%d: start = %d %d %d %d %d.\n", fcnName, - mpi_rank, start[0], start[1], start[2], start[3], - start[4]); - HDfprintf(stdout, "%s slice/file extent dims = %d/%d.\n", - fcnName, - H5Sget_simple_extent_ndims(small_ds_slice_sid), - H5Sget_simple_extent_ndims(file_large_ds_sid_0)); -#endif /* CHECKER_BOARD_HYPERSLAB_DR_PIO_TEST__RUN_TEST__DEBUG */ - - ret = H5Dread(large_dataset, - H5T_NATIVE_UINT32, - small_ds_slice_sid, - file_large_ds_sid_0, - xfer_plist, - small_ds_slice_buf); - VRFY((ret >= 0), "H5Dread() slice from large ds succeeded."); - -#if CHECKER_BOARD_HYPERSLAB_DR_PIO_TEST__RUN_TEST__DEBUG - HDfprintf(stdout, "%s:%d: H5Dread() returns.\n", - fcnName, mpi_rank); -#endif + if ( (tv_ptr->skips)++ < tv_ptr->max_skips ) { /* skip the test */ + + (tv_ptr->tests_skipped)++; + + } else { /* run the test */ + + tv_ptr->skips = 0; /* reset the skips counter */ + + /* we know that small_rank - 1 >= 1 and that + * large_rank > small_rank by the assertions at the head + * of this function. Thus no need for another inner loop. + */ + tv_ptr->start[0] = (hsize_t)i; + tv_ptr->start[1] = (hsize_t)j; + tv_ptr->start[2] = (hsize_t)k; + tv_ptr->start[3] = (hsize_t)l; + tv_ptr->start[4] = 0; + + HDassert((tv_ptr->start[0] == 0)||(0 < tv_ptr->small_ds_offset + 1)); + HDassert((tv_ptr->start[1] == 0)||(1 < tv_ptr->small_ds_offset + 1)); + HDassert((tv_ptr->start[2] == 0)||(2 < tv_ptr->small_ds_offset + 1)); + HDassert((tv_ptr->start[3] == 0)||(3 < tv_ptr->small_ds_offset + 1)); + HDassert((tv_ptr->start[4] == 0)||(4 < tv_ptr->small_ds_offset + 1)); + + ckrbrd_hs_dr_pio_test__slct_ckrbrd + ( + tv_ptr->mpi_rank, + tv_ptr->file_large_ds_sid_0, + tv_ptr->large_rank, + tv_ptr->edge_size, + tv_ptr->checker_edge_size, + tv_ptr->small_rank - 1, + tv_ptr->start + ); + + /* verify that H5S_select_shape_same() reports the two + * selections as having the same shape. + */ + check = H5S_select_shape_same_test(tv_ptr->small_ds_slice_sid, + tv_ptr->file_large_ds_sid_0); + VRFY((check == TRUE), "H5S_select_shape_same_test passed"); + + + /* Read selection from disk */ +#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG + HDfprintf(stdout, "%s:%d: start = %d %d %d %d %d.\n", fcnName, + tv_ptr->mpi_rank, tv_ptr->start[0], tv_ptr->start[1], + tv_ptr->start[2], tv_ptr->start[3], tv_ptr->start[4]); + HDfprintf(stdout, "%s slice/file extent dims = %d/%d.\n", + fcnName, + H5Sget_simple_extent_ndims(tv_ptr->small_ds_slice_sid), + H5Sget_simple_extent_ndims(tv_ptr->file_large_ds_sid_0)); +#endif /* CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG */ + + ret = H5Dread(tv_ptr->large_dataset, + H5T_NATIVE_UINT32, + tv_ptr->small_ds_slice_sid, + tv_ptr->file_large_ds_sid_0, + tv_ptr->xfer_plist, + tv_ptr->small_ds_slice_buf); + VRFY((ret >= 0), "H5Dread() slice from large ds succeeded."); + +#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG + HDfprintf(stdout, "%s:%d: H5Dread() returns.\n", + fcnName, tv_ptr->mpi_rank); +#endif /* CHECKER_BOARD_HS_DR_PIO_TEST__D2M_L2S__DEBUG */ + + /* verify that expected data is retrieved */ + + expected_value = (uint32_t) + ((i * tv_ptr->edge_size * tv_ptr->edge_size * + tv_ptr->edge_size * tv_ptr->edge_size) + + (j * tv_ptr->edge_size * tv_ptr->edge_size * tv_ptr->edge_size) + + (k * tv_ptr->edge_size * tv_ptr->edge_size) + + (l * tv_ptr->edge_size)); + + data_ok = ckrbrd_hs_dr_pio_test__verify_data + ( + tv_ptr->small_ds_slice_buf, + tv_ptr->small_rank - 1, + tv_ptr->edge_size, + tv_ptr->checker_edge_size, + expected_value, + (hbool_t)TRUE + ); + + VRFY((data_ok == TRUE), + "small slice read from large ds data good."); + + (tv_ptr->tests_run)++; + } - /* verify that expected data is retrieved */ - - expected_value = (uint32_t) - ((i * edge_size * edge_size * edge_size * edge_size) + - (j * edge_size * edge_size * edge_size) + - (k * edge_size * edge_size) + - (l * edge_size)); - - data_ok = checker_board_hyperslab_dr_pio_test__verify_data - ( - small_ds_slice_buf, - small_rank - 1, - edge_size, - checker_edge_size, - expected_value, - (hbool_t)TRUE - ); - - VRFY((data_ok == TRUE), - "small slice read from large ds data good."); l++; - } while ( ( large_rank > 2 ) && - ( (small_rank - 1) <= 1 ) && - ( l < edge_size ) ); + (tv_ptr->total_tests)++; + + } while ( ( tv_ptr->large_rank > 2 ) && + ( (tv_ptr->small_rank - 1) <= 1 ) && + ( l < tv_ptr->edge_size ) ); k++; - } while ( ( large_rank > 3 ) && - ( (small_rank - 1) <= 2 ) && - ( k < edge_size ) ); + } while ( ( tv_ptr->large_rank > 3 ) && + ( (tv_ptr->small_rank - 1) <= 2 ) && + ( k < tv_ptr->edge_size ) ); j++; - } while ( ( large_rank > 4 ) && - ( (small_rank - 1) <= 3 ) && - ( j < edge_size ) ); + } while ( ( tv_ptr->large_rank > 4 ) && + ( (tv_ptr->small_rank - 1) <= 3 ) && + ( j < tv_ptr->edge_size ) ); + + return; + +} /* ckrbrd_hs_dr_pio_test__d2m_l2s() */ + + +/*------------------------------------------------------------------------- + * Function: ckrbrd_hs_dr_pio_test__d2m_s2l() + * + * Purpose: Part two of a series of tests of I/O to/from hyperslab + * selections of different rank in the parallel. + * + * Verify that we can read from disk correctly using + * selections of different rank that H5S_select_shape_same() + * views as being of the same shape. + * + * In this function, we test this by reading checker board + * slices of the on disk small data set into slices through + * the in memory large data set, and verify that the correct + * data (and only the correct data) is read. + * + * Return: void + * + * Programmer: JRM -- 8/15/11 + * + * Modifications: + * + * None. + * + *------------------------------------------------------------------------- + */ + +#define CHECKER_BOARD_HS_DR_PIO_TEST__D2M_S2L__DEBUG 0 + +static void +ckrbrd_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) +{ +#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_S2L__DEBUG + const char *fcnName = "ckrbrd_hs_dr_pio_test__d2m_s2l()"; +#endif /* CHECKER_BOARD_HS_DR_PIO_TEST__D2M_S2L__DEBUG */ + hbool_t data_ok = FALSE; + int i, j, k, l; + size_t u; + size_t start_index; + size_t stop_index; + uint32_t expected_value; + uint32_t * ptr_1; + int mpi_rank; /* needed by VRFY */ + hsize_t sel_start[PAR_SS_DR_MAX_RANK]; + htri_t check; /* Shape comparison return value */ + herr_t ret; /* Generic return value */ + + /* initialize the local copy of mpi_rank */ + mpi_rank = tv_ptr->mpi_rank; /* similarly, read slices of the on disk small data set into slices @@ -3264,24 +3281,24 @@ checker_board_hyperslab_dr_pio_test__run_test(const int test_num, */ sel_start[0] = sel_start[1] = sel_start[2] = sel_start[3] = sel_start[4] = 0; - sel_start[small_ds_offset] = (hsize_t)mpi_rank; + sel_start[tv_ptr->small_ds_offset] = (hsize_t)(tv_ptr->mpi_rank); - checker_board_hyperslab_dr_pio_test__select_checker_board(mpi_rank, - file_small_ds_sid_0, - small_rank, - edge_size, - checker_edge_size, - small_rank - 1, - sel_start); + ckrbrd_hs_dr_pio_test__slct_ckrbrd(tv_ptr->mpi_rank, + tv_ptr->file_small_ds_sid_0, + tv_ptr->small_rank, + tv_ptr->edge_size, + tv_ptr->checker_edge_size, + tv_ptr->small_rank - 1, + sel_start); -#if CHECKER_BOARD_HYPERSLAB_DR_PIO_TEST__RUN_TEST__DEBUG +#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_S2L__DEBUG HDfprintf(stdout, "%s reading slices of on disk small data set into slices of big data set.\n", fcnName); -#endif +#endif /* CHECKER_BOARD_HS_DR_PIO_TEST__D2M_S2L__DEBUG */ /* zero out the buffer we will be reading into */ - HDmemset(large_ds_buf_1, 0, sizeof(uint32_t) * large_ds_size); + HDmemset(tv_ptr->large_ds_buf_1, 0, sizeof(uint32_t) * tv_ptr->large_ds_size); /* set up start, stride, count, and block -- note that we will * change start[] so as to read the slice of the small data set @@ -3290,20 +3307,19 @@ checker_board_hyperslab_dr_pio_test__run_test(const int test_num, */ for ( i = 0; i < PAR_SS_DR_MAX_RANK; i++ ) { - start[i] = 0; - stride[i] = (hsize_t)(2 * edge_size); - count[i] = 1; - if ( (PAR_SS_DR_MAX_RANK - i) > (small_rank - 1) ) { + tv_ptr->start[i] = 0; + tv_ptr->stride[i] = (hsize_t)(2 * tv_ptr->edge_size); + tv_ptr->count[i] = 1; + if ( (PAR_SS_DR_MAX_RANK - i) > (tv_ptr->small_rank - 1) ) { - block[i] = 1; + tv_ptr->block[i] = 1; } else { - block[i] = (hsize_t)edge_size; + tv_ptr->block[i] = (hsize_t)(tv_ptr->edge_size); } } - /* in serial versions of this test, we loop through all the dimensions * of the large data set that don't appear in the small data set. * @@ -3314,9 +3330,9 @@ checker_board_hyperslab_dr_pio_test__run_test(const int test_num, */ - if ( PAR_SS_DR_MAX_RANK - large_rank == 0 ) { + if ( PAR_SS_DR_MAX_RANK - tv_ptr->large_rank == 0 ) { - i = mpi_rank; + i = tv_ptr->mpi_rank; } else { @@ -3329,9 +3345,9 @@ checker_board_hyperslab_dr_pio_test__run_test(const int test_num, * test. */ - if ( PAR_SS_DR_MAX_RANK - large_rank == 1 ) { + if ( PAR_SS_DR_MAX_RANK - tv_ptr->large_rank == 1 ) { - j = mpi_rank; + j = tv_ptr->mpi_rank; } else { @@ -3339,9 +3355,9 @@ checker_board_hyperslab_dr_pio_test__run_test(const int test_num, } do { - if ( PAR_SS_DR_MAX_RANK - large_rank == 2 ) { + if ( PAR_SS_DR_MAX_RANK - tv_ptr->large_rank == 2 ) { - k = mpi_rank; + k = tv_ptr->mpi_rank; } else { @@ -3361,161 +3377,235 @@ checker_board_hyperslab_dr_pio_test__run_test(const int test_num, l = 0; do { - /* we know that small_rank >= 1 and that large_rank > small_rank - * by the assertions at the head of this function. Thus no - * need for another inner loop. - */ - start[0] = (hsize_t)i; - start[1] = (hsize_t)j; - start[2] = (hsize_t)k; - start[3] = (hsize_t)l; - start[4] = 0; - - HDassert( ( start[0] == 0 ) || ( 0 < small_ds_offset + 1 ) ); - HDassert( ( start[1] == 0 ) || ( 1 < small_ds_offset + 1 ) ); - HDassert( ( start[2] == 0 ) || ( 2 < small_ds_offset + 1 ) ); - HDassert( ( start[3] == 0 ) || ( 3 < small_ds_offset + 1 ) ); - HDassert( ( start[4] == 0 ) || ( 4 < small_ds_offset + 1 ) ); - - checker_board_hyperslab_dr_pio_test__select_checker_board - ( - mpi_rank, - mem_large_ds_sid, - large_rank, - edge_size, - checker_edge_size, - small_rank - 1, - start - ); - - - /* verify that H5S_select_shape_same() reports the two - * selections as having the same shape. - */ - check = H5S_select_shape_same_test(file_small_ds_sid_0, - mem_large_ds_sid); - VRFY((check == TRUE), "H5S_select_shape_same_test passed"); - - - /* Read selection from disk */ -#if CHECKER_BOARD_HYPERSLAB_DR_PIO_TEST__RUN_TEST__DEBUG - HDfprintf(stdout, "%s:%d: start = %d %d %d %d %d.\n", - fcnName, mpi_rank, - start[0], start[1], start[2], start[3], start[4]); - HDfprintf(stdout, "%s:%d: mem/file extent dims = %d/%d.\n", - fcnName, mpi_rank, - H5Sget_simple_extent_ndims(large_ds_slice_sid), - H5Sget_simple_extent_ndims(file_small_ds_sid_0)); -#endif - ret = H5Dread(small_dataset, - H5T_NATIVE_UINT32, - mem_large_ds_sid, - file_small_ds_sid_0, - xfer_plist, - large_ds_buf_1); - VRFY((ret >= 0), "H5Dread() slice from small ds succeeded."); - - /* verify that the expected data and only the - * expected data was read. - */ - data_ok = TRUE; - ptr_1 = large_ds_buf_1; - expected_value = (uint32_t)((size_t)mpi_rank * small_ds_slice_size); - start_index = (size_t)( - (i * edge_size * edge_size * edge_size * edge_size) + - (j * edge_size * edge_size * edge_size) + - (k * edge_size * edge_size) + - (l * edge_size)); - stop_index = start_index + small_ds_slice_size - 1; - -#if CHECKER_BOARD_HYPERSLAB_DR_PIO_TEST__RUN_TEST__DEBUG -{ -int m, n; - - HDfprintf(stdout, "%s:%d: expected_value = %d.\n", - fcnName, mpi_rank, expected_value); - HDfprintf(stdout, "%s:%d: start/stop index = %d/%d.\n", - fcnName, mpi_rank, start_index, stop_index); - n = 0; - for ( m = 0; m < large_ds_size; m ++ ) { - HDfprintf(stdout, "%d ", (int)(*ptr_1)); - ptr_1++; - n++; - if ( n >= edge_size ) { - HDfprintf(stdout, "\n"); + if ( (tv_ptr->skips)++ < tv_ptr->max_skips ) { /* skip the test */ + + (tv_ptr->tests_skipped)++; + + } else { /* run the test */ + + tv_ptr->skips = 0; /* reset the skips counter */ + + /* we know that small_rank >= 1 and that large_rank > small_rank + * by the assertions at the head of this function. Thus no + * need for another inner loop. + */ + tv_ptr->start[0] = (hsize_t)i; + tv_ptr->start[1] = (hsize_t)j; + tv_ptr->start[2] = (hsize_t)k; + tv_ptr->start[3] = (hsize_t)l; + tv_ptr->start[4] = 0; + + HDassert((tv_ptr->start[0] == 0)||(0 < tv_ptr->small_ds_offset + 1)); + HDassert((tv_ptr->start[1] == 0)||(1 < tv_ptr->small_ds_offset + 1)); + HDassert((tv_ptr->start[2] == 0)||(2 < tv_ptr->small_ds_offset + 1)); + HDassert((tv_ptr->start[3] == 0)||(3 < tv_ptr->small_ds_offset + 1)); + HDassert((tv_ptr->start[4] == 0)||(4 < tv_ptr->small_ds_offset + 1)); + + ckrbrd_hs_dr_pio_test__slct_ckrbrd + ( + tv_ptr->mpi_rank, + tv_ptr->mem_large_ds_sid, + tv_ptr->large_rank, + tv_ptr->edge_size, + tv_ptr->checker_edge_size, + tv_ptr->small_rank - 1, + tv_ptr->start + ); + + + /* verify that H5S_select_shape_same() reports the two + * selections as having the same shape. + */ + check = H5S_select_shape_same_test(tv_ptr->file_small_ds_sid_0, + tv_ptr->mem_large_ds_sid); + VRFY((check == TRUE), "H5S_select_shape_same_test passed"); + + + /* Read selection from disk */ +#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_S2L__DEBUG + HDfprintf(stdout, "%s:%d: start = %d %d %d %d %d.\n", + fcnName, tv_ptr->mpi_rank, + tv_ptr->start[0], tv_ptr->start[1], tv_ptr->start[2], + tv_ptr->start[3], tv_ptr->start[4]); + HDfprintf(stdout, "%s:%d: mem/file extent dims = %d/%d.\n", + fcnName, tv_ptr->mpi_rank, + H5Sget_simple_extent_ndims(tv_ptr->large_ds_slice_sid), + H5Sget_simple_extent_ndims(tv_ptr->file_small_ds_sid_0)); +#endif /* CHECKER_BOARD_HS_DR_PIO_TEST__D2M_S2L__DEBUG */ + ret = H5Dread(tv_ptr->small_dataset, + H5T_NATIVE_UINT32, + tv_ptr->mem_large_ds_sid, + tv_ptr->file_small_ds_sid_0, + tv_ptr->xfer_plist, + tv_ptr->large_ds_buf_1); + VRFY((ret >= 0), "H5Dread() slice from small ds succeeded."); + + /* verify that the expected data and only the + * expected data was read. + */ + data_ok = TRUE; + ptr_1 = tv_ptr->large_ds_buf_1; + expected_value = + (uint32_t)((size_t)(tv_ptr->mpi_rank) * tv_ptr->small_ds_slice_size); + start_index = (size_t)( + (i * tv_ptr->edge_size * tv_ptr->edge_size * + tv_ptr->edge_size * tv_ptr->edge_size) + + (j * tv_ptr->edge_size * tv_ptr->edge_size * tv_ptr->edge_size) + + (k * tv_ptr->edge_size * tv_ptr->edge_size) + + (l * tv_ptr->edge_size)); + stop_index = start_index + tv_ptr->small_ds_slice_size - 1; + +#if CHECKER_BOARD_HS_DR_PIO_TEST__D2M_S2L__DEBUG + { + int m, n; + + HDfprintf(stdout, "%s:%d: expected_value = %d.\n", + fcnName, tv_ptr->mpi_rank, expected_value); + HDfprintf(stdout, "%s:%d: start/stop index = %d/%d.\n", + fcnName, tv_ptr->mpi_rank, start_index, stop_index); n = 0; + for ( m = 0; (unsigned)m < tv_ptr->large_ds_size; m ++ ) { + HDfprintf(stdout, "%d ", (int)(*ptr_1)); + ptr_1++; + n++; + if ( n >= tv_ptr->edge_size ) { + HDfprintf(stdout, "\n"); + n = 0; + } + } + HDfprintf(stdout, "\n"); + ptr_1 = tv_ptr->large_ds_buf_1; } - } - HDfprintf(stdout, "\n"); - fsync(stdout); - ptr_1 = large_ds_buf_1; -} -#endif +#endif /* CHECKER_BOARD_HS_DR_PIO_TEST__D2M_S2L__DEBUG */ - HDassert( start_index < stop_index ); - HDassert( stop_index <= large_ds_size ); + HDassert( start_index < stop_index ); + HDassert( stop_index <= tv_ptr->large_ds_size ); - for ( u = 0; u < start_index; u++ ) { + for ( u = 0; u < start_index; u++ ) { - if ( *ptr_1 != 0 ) { + if ( *ptr_1 != 0 ) { - data_ok = FALSE; - } + data_ok = FALSE; + } - /* zero out the value for the next pass */ - *ptr_1 = 0; + /* zero out the value for the next pass */ + *ptr_1 = 0; - ptr_1++; - } + ptr_1++; + } + + VRFY((data_ok == TRUE), + "slice read from small to large ds data good(1)."); - VRFY((data_ok == TRUE), - "slice read from small to large ds data good(1)."); + data_ok = ckrbrd_hs_dr_pio_test__verify_data + ( + ptr_1, + tv_ptr->small_rank - 1, + tv_ptr->edge_size, + tv_ptr->checker_edge_size, + expected_value, + (hbool_t)TRUE + ); - data_ok = checker_board_hyperslab_dr_pio_test__verify_data - ( - ptr_1, - small_rank - 1, - edge_size, - checker_edge_size, - expected_value, - (hbool_t)TRUE - ); + VRFY((data_ok == TRUE), + "slice read from small to large ds data good(2)."); - VRFY((data_ok == TRUE), - "slice read from small to large ds data good(2)."); + ptr_1 = tv_ptr->large_ds_buf_1 + stop_index + 1; - ptr_1 = large_ds_buf_1 + stop_index + 1; + for ( u = stop_index + 1; u < tv_ptr->large_ds_size; u++ ) { + + if ( *ptr_1 != 0 ) { - for ( u = stop_index + 1; u < large_ds_size; u++ ) { + data_ok = FALSE; + } - if ( *ptr_1 != 0 ) { + /* zero out the value for the next pass */ + *ptr_1 = 0; - data_ok = FALSE; - } + ptr_1++; + } - /* zero out the value for the next pass */ - *ptr_1 = 0; + VRFY((data_ok == TRUE), + "slice read from small to large ds data good(3)."); - *ptr_1++; + (tv_ptr->tests_run)++; } - VRFY((data_ok == TRUE), - "slice read from small to large ds data good(3)."); - l++; - } while ( ( large_rank > 2 ) && - ( (small_rank - 1) <= 1 ) && - ( l < edge_size ) ); + (tv_ptr->total_tests)++; + + } while ( ( tv_ptr->large_rank > 2 ) && + ( (tv_ptr->small_rank - 1) <= 1 ) && + ( l < tv_ptr->edge_size ) ); k++; - } while ( ( large_rank > 3 ) && - ( (small_rank - 1) <= 2 ) && - ( k < edge_size ) ); + } while ( ( tv_ptr->large_rank > 3 ) && + ( (tv_ptr->small_rank - 1) <= 2 ) && + ( k < tv_ptr->edge_size ) ); j++; - } while ( ( large_rank > 4 ) && - ( (small_rank - 1) <= 3 ) && - ( j < edge_size ) ); + } while ( ( tv_ptr->large_rank > 4 ) && + ( (tv_ptr->small_rank - 1) <= 3 ) && + ( j < tv_ptr->edge_size ) ); + + return; + +} /* ckrbrd_hs_dr_pio_test__d2m_s2l() */ + + +/*------------------------------------------------------------------------- + * Function: ckrbrd_hs_dr_pio_test__m2d_l2s() + * + * Purpose: Part three of a series of tests of I/O to/from checker + * board hyperslab selections of different rank in the + * parallel. + * + * Verify that we can write from memory to file using checker + * board selections of different rank that + * H5S_select_shape_same() views as being of the same shape. + * + * Do this by writing small_rank - 1 dimensional checker + * board slices from the in memory large data set to the on + * disk small cube dataset. After each write, read the + * slice of the small dataset back from disk, and verify + * that it contains the expected data. Verify that + * H5S_select_shape_same() returns true on the memory and + * file selections. + * + * Return: void + * + * Programmer: JRM -- 8/15/11 + * + * Modifications: + * + * None. + * + *------------------------------------------------------------------------- + */ + +#define CHECKER_BOARD_HS_DR_PIO_TEST__M2D_L2S__DEBUG 0 + +static void +ckrbrd_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) +{ +#if CHECKER_BOARD_HS_DR_PIO_TEST__M2D_L2S__DEBUG + const char *fcnName = "ckrbrd_hs_dr_pio_test__m2d_l2s()"; +#endif /* CHECKER_BOARD_HS_DR_PIO_TEST__M2D_L2S__DEBUG */ + hbool_t data_ok = FALSE; + hbool_t mis_match = FALSE; + int i, j, k, l; + size_t u; + size_t start_index; + size_t stop_index; + uint32_t expected_value; + uint32_t * ptr_1; + int mpi_rank; /* needed by VRFY */ + hsize_t sel_start[PAR_SS_DR_MAX_RANK]; + htri_t check; /* Shape comparison return value */ + herr_t ret; /* Generic return value */ + + /* initialize the local copy of mpi_rank */ + mpi_rank = tv_ptr->mpi_rank; /* now we go in the opposite direction, verifying that we can write @@ -3529,75 +3619,75 @@ int m, n; * the memory and file selections. */ - start[0] = (hsize_t)mpi_rank; - stride[0] = (hsize_t)(2 * (mpi_size + 1)); - count[0] = 1; - block[0] = 1; + tv_ptr->start[0] = (hsize_t)(tv_ptr->mpi_rank); + tv_ptr->stride[0] = (hsize_t)(2 * (tv_ptr->mpi_size + 1)); + tv_ptr->count[0] = 1; + tv_ptr->block[0] = 1; - for ( i = 1; i < large_rank; i++ ) { + for ( i = 1; i < tv_ptr->large_rank; i++ ) { - start[i] = 0; - stride[i] = (hsize_t)(2 * edge_size); - count[i] = 1; - block[i] = (hsize_t)edge_size; + tv_ptr->start[i] = 0; + tv_ptr->stride[i] = (hsize_t)(2 * tv_ptr->edge_size); + tv_ptr->count[i] = 1; + tv_ptr->block[i] = (hsize_t)(tv_ptr->edge_size); } - ret = H5Sselect_hyperslab(file_small_ds_sid_0, + ret = H5Sselect_hyperslab(tv_ptr->file_small_ds_sid_0, H5S_SELECT_SET, - start, - stride, - count, - block); + tv_ptr->start, + tv_ptr->stride, + tv_ptr->count, + tv_ptr->block); VRFY((ret >= 0), "H5Sselect_hyperslab(file_small_ds_sid_0, set) suceeded"); - ret = H5Sselect_hyperslab(mem_small_ds_sid, + ret = H5Sselect_hyperslab(tv_ptr->mem_small_ds_sid, H5S_SELECT_SET, - start, - stride, - count, - block); + tv_ptr->start, + tv_ptr->stride, + tv_ptr->count, + tv_ptr->block); VRFY((ret >= 0), "H5Sselect_hyperslab(mem_small_ds_sid, set) suceeded"); sel_start[0] = sel_start[1] = sel_start[2] = sel_start[3] = sel_start[4] = 0; - sel_start[small_ds_offset] = (hsize_t)mpi_rank; + sel_start[tv_ptr->small_ds_offset] = (hsize_t)(tv_ptr->mpi_rank); - checker_board_hyperslab_dr_pio_test__select_checker_board(mpi_rank, - file_small_ds_sid_1, - small_rank, - edge_size, - checker_edge_size, - small_rank - 1, - sel_start); + ckrbrd_hs_dr_pio_test__slct_ckrbrd(tv_ptr->mpi_rank, + tv_ptr->file_small_ds_sid_1, + tv_ptr->small_rank, + tv_ptr->edge_size, + tv_ptr->checker_edge_size, + tv_ptr->small_rank - 1, + sel_start); /* set up start, stride, count, and block -- note that we will * change start[] so as to read slices of the large cube. */ - for ( i = 0; i < PAR_SS_DR_MAX_RANK; i++ ) { - - start[i] = 0; - stride[i] = (hsize_t)(2 * edge_size); - count[i] = 1; - if ( (PAR_SS_DR_MAX_RANK - i) > (small_rank - 1) ) { + for ( i = 0; i < PAR_SS_DR_MAX_RANK; i++ ) { + + tv_ptr->start[i] = 0; + tv_ptr->stride[i] = (hsize_t)(2 * tv_ptr->edge_size); + tv_ptr->count[i] = 1; + if ( (PAR_SS_DR_MAX_RANK - i) > (tv_ptr->small_rank - 1) ) { - block[i] = 1; + tv_ptr->block[i] = 1; } else { - block[i] = (hsize_t)edge_size; + tv_ptr->block[i] = (hsize_t)(tv_ptr->edge_size); } } /* zero out the in memory small ds */ - HDmemset(small_ds_buf_1, 0, sizeof(uint32_t) * small_ds_size); + HDmemset(tv_ptr->small_ds_buf_1, 0, sizeof(uint32_t) * tv_ptr->small_ds_size); -#if CHECKER_BOARD_HYPERSLAB_DR_PIO_TEST__RUN_TEST__DEBUG +#if CHECKER_BOARD_HS_DR_PIO_TEST__M2D_L2S__DEBUG HDfprintf(stdout, "%s writing checker boards selections of slices from big ds to slices of small ds on disk.\n", fcnName); -#endif +#endif /* CHECKER_BOARD_HS_DR_PIO_TEST__M2D_L2S__DEBUG */ /* in serial versions of this test, we loop through all the dimensions * of the large data set that don't appear in the small data set. @@ -3609,9 +3699,9 @@ int m, n; */ - if ( PAR_SS_DR_MAX_RANK - large_rank == 0 ) { + if ( PAR_SS_DR_MAX_RANK - tv_ptr->large_rank == 0 ) { - i = mpi_rank; + i = tv_ptr->mpi_rank; } else { @@ -3624,9 +3714,9 @@ int m, n; * test. */ - if ( PAR_SS_DR_MAX_RANK - large_rank == 1 ) { + if ( PAR_SS_DR_MAX_RANK - tv_ptr->large_rank == 1 ) { - j = mpi_rank; + j = tv_ptr->mpi_rank; } else { @@ -3635,9 +3725,9 @@ int m, n; j = 0; do { - if ( PAR_SS_DR_MAX_RANK - large_rank == 2 ) { + if ( PAR_SS_DR_MAX_RANK - tv_ptr->large_rank == 2 ) { - k = mpi_rank; + k = tv_ptr->mpi_rank; } else { @@ -3657,154 +3747,228 @@ int m, n; l = 0; do { - /* we know that small_rank >= 1 and that large_rank > small_rank - * by the assertions at the head of this function. Thus no - * need for another inner loop. - */ - - /* zero out this rank's slice of the on disk small data set */ - ret = H5Dwrite(small_dataset, - H5T_NATIVE_UINT32, - mem_small_ds_sid, - file_small_ds_sid_0, - xfer_plist, - small_ds_buf_2); - VRFY((ret >= 0), "H5Dwrite() zero slice to small ds succeeded."); - - /* select the portion of the in memory large cube from which we - * are going to write data. - */ - start[0] = (hsize_t)i; - start[1] = (hsize_t)j; - start[2] = (hsize_t)k; - start[3] = (hsize_t)l; - start[4] = 0; - - HDassert( ( start[0] == 0 ) || ( 0 < small_ds_offset + 1 ) ); - HDassert( ( start[1] == 0 ) || ( 1 < small_ds_offset + 1 ) ); - HDassert( ( start[2] == 0 ) || ( 2 < small_ds_offset + 1 ) ); - HDassert( ( start[3] == 0 ) || ( 3 < small_ds_offset + 1 ) ); - HDassert( ( start[4] == 0 ) || ( 4 < small_ds_offset + 1 ) ); - - checker_board_hyperslab_dr_pio_test__select_checker_board - ( - mpi_rank, - mem_large_ds_sid, - large_rank, - edge_size, - checker_edge_size, - small_rank - 1, - start - ); - - - /* verify that H5S_select_shape_same() reports the in - * memory checkerboard selection of the slice through the - * large dataset and the checkerboard selection of the process - * slice of the small data set as having the same shape. - */ - check = H5S_select_shape_same_test(file_small_ds_sid_1, - mem_large_ds_sid); - VRFY((check == TRUE), "H5S_select_shape_same_test passed."); - - - /* write the checker board selection of the slice from the in - * memory large data set to the slice of the on disk small - * dataset. - */ -#if CHECKER_BOARD_HYPERSLAB_DR_PIO_TEST__RUN_TEST__DEBUG - HDfprintf(stdout, "%s:%d: start = %d %d %d %d %d.\n", - fcnName, mpi_rank, - start[0], start[1], start[2], start[3], start[4]); - HDfprintf(stdout, "%s:%d: mem/file extent dims = %d/%d.\n", - fcnName, mpi_rank, - H5Sget_simple_extent_ndims(mem_large_ds_sid), - H5Sget_simple_extent_ndims(file_small_ds_sid_1)); -#endif - ret = H5Dwrite(small_dataset, - H5T_NATIVE_UINT32, - mem_large_ds_sid, - file_small_ds_sid_1, - xfer_plist, - large_ds_buf_0); - VRFY((ret >= 0), "H5Dwrite() slice to large ds succeeded."); + if ( (tv_ptr->skips)++ < tv_ptr->max_skips ) { /* skip the test */ + (tv_ptr->tests_skipped)++; - /* read the on disk process slice of the small dataset into memory */ - ret = H5Dread(small_dataset, - H5T_NATIVE_UINT32, - mem_small_ds_sid, - file_small_ds_sid_0, - xfer_plist, - small_ds_buf_1); - VRFY((ret >= 0), "H5Dread() slice from small ds succeeded."); + } else { /* run the test */ + tv_ptr->skips = 0; /* reset the skips counter */ - /* verify that expected data is retrieved */ + /* we know that small_rank >= 1 and that large_rank > small_rank + * by the assertions at the head of this function. Thus no + * need for another inner loop. + */ + + /* zero out this rank's slice of the on disk small data set */ + ret = H5Dwrite(tv_ptr->small_dataset, + H5T_NATIVE_UINT32, + tv_ptr->mem_small_ds_sid, + tv_ptr->file_small_ds_sid_0, + tv_ptr->xfer_plist, + tv_ptr->small_ds_buf_2); + VRFY((ret >= 0), "H5Dwrite() zero slice to small ds succeeded."); + + /* select the portion of the in memory large cube from which we + * are going to write data. + */ + tv_ptr->start[0] = (hsize_t)i; + tv_ptr->start[1] = (hsize_t)j; + tv_ptr->start[2] = (hsize_t)k; + tv_ptr->start[3] = (hsize_t)l; + tv_ptr->start[4] = 0; + + HDassert((tv_ptr->start[0] == 0)||(0 < tv_ptr->small_ds_offset + 1)); + HDassert((tv_ptr->start[1] == 0)||(1 < tv_ptr->small_ds_offset + 1)); + HDassert((tv_ptr->start[2] == 0)||(2 < tv_ptr->small_ds_offset + 1)); + HDassert((tv_ptr->start[3] == 0)||(3 < tv_ptr->small_ds_offset + 1)); + HDassert((tv_ptr->start[4] == 0)||(4 < tv_ptr->small_ds_offset + 1)); + + ckrbrd_hs_dr_pio_test__slct_ckrbrd + ( + tv_ptr->mpi_rank, + tv_ptr->mem_large_ds_sid, + tv_ptr->large_rank, + tv_ptr->edge_size, + tv_ptr->checker_edge_size, + tv_ptr->small_rank - 1, + tv_ptr->start + ); + + + /* verify that H5S_select_shape_same() reports the in + * memory checkerboard selection of the slice through the + * large dataset and the checkerboard selection of the process + * slice of the small data set as having the same shape. + */ + check = H5S_select_shape_same_test(tv_ptr->file_small_ds_sid_1, + tv_ptr->mem_large_ds_sid); + VRFY((check == TRUE), "H5S_select_shape_same_test passed."); + + + /* write the checker board selection of the slice from the in + * memory large data set to the slice of the on disk small + * dataset. + */ +#if CHECKER_BOARD_HS_DR_PIO_TEST__M2D_L2S__DEBUG + HDfprintf(stdout, "%s:%d: start = %d %d %d %d %d.\n", + fcnName, tv_ptr->mpi_rank, + tv_ptr->start[0], tv_ptr->start[1], tv_ptr->start[2], + tv_ptr->start[3], tv_ptr->start[4]); + HDfprintf(stdout, "%s:%d: mem/file extent dims = %d/%d.\n", + fcnName, tv_ptr->mpi_rank, + H5Sget_simple_extent_ndims(tv_ptr->mem_large_ds_sid), + H5Sget_simple_extent_ndims(tv_ptr->file_small_ds_sid_1)); +#endif /* CHECKER_BOARD_HS_DR_PIO_TEST__M2D_L2S__DEBUG */ + ret = H5Dwrite(tv_ptr->small_dataset, + H5T_NATIVE_UINT32, + tv_ptr->mem_large_ds_sid, + tv_ptr->file_small_ds_sid_1, + tv_ptr->xfer_plist, + tv_ptr->large_ds_buf_0); + VRFY((ret >= 0), "H5Dwrite() slice to large ds succeeded."); + + + /* read the on disk process slice of the small dataset into memory */ + ret = H5Dread(tv_ptr->small_dataset, + H5T_NATIVE_UINT32, + tv_ptr->mem_small_ds_sid, + tv_ptr->file_small_ds_sid_0, + tv_ptr->xfer_plist, + tv_ptr->small_ds_buf_1); + VRFY((ret >= 0), "H5Dread() slice from small ds succeeded."); + + + /* verify that expected data is retrieved */ + + mis_match = FALSE; + + expected_value = (uint32_t)( + (i * tv_ptr->edge_size * tv_ptr->edge_size * + tv_ptr->edge_size * tv_ptr->edge_size) + + (j * tv_ptr->edge_size * tv_ptr->edge_size * tv_ptr->edge_size) + + (k * tv_ptr->edge_size * tv_ptr->edge_size) + + (l * tv_ptr->edge_size)); + + start_index = (size_t)(tv_ptr->mpi_rank) * tv_ptr->small_ds_slice_size; + stop_index = start_index + tv_ptr->small_ds_slice_size - 1; + + HDassert( start_index < stop_index ); + HDassert( stop_index <= tv_ptr->small_ds_size ); + + data_ok = TRUE; + + ptr_1 = tv_ptr->small_ds_buf_1; + for ( u = 0; u < start_index; u++, ptr_1++ ) { + + if ( *ptr_1 != 0 ) { - mis_match = FALSE; + data_ok = FALSE; + *ptr_1 = 0; + } + } - expected_value = (uint32_t)( - (i * edge_size * edge_size * edge_size * edge_size) + - (j * edge_size * edge_size * edge_size) + - (k * edge_size * edge_size) + - (l * edge_size)); + data_ok &= ckrbrd_hs_dr_pio_test__verify_data + ( + tv_ptr->small_ds_buf_1 + start_index, + tv_ptr->small_rank - 1, + tv_ptr->edge_size, + tv_ptr->checker_edge_size, + expected_value, + (hbool_t)TRUE + ); - start_index = (size_t)mpi_rank * small_ds_slice_size; - stop_index = start_index + small_ds_slice_size - 1; - HDassert( start_index < stop_index ); - HDassert( stop_index <= small_ds_size ); + ptr_1 = tv_ptr->small_ds_buf_1; + for ( u = stop_index; u < tv_ptr->small_ds_size; u++, ptr_1++ ) { - data_ok = TRUE; + if ( *ptr_1 != 0 ) { - ptr_1 = small_ds_buf_1; - for ( u = 0; u < start_index; u++, ptr_1++ ) { + data_ok = FALSE; + *ptr_1 = 0; + } + } - if ( *ptr_1 != 0 ) { + VRFY((data_ok == TRUE), + "large slice write slice to small slice data good."); - data_ok = FALSE; - *ptr_1 = 0; - } + (tv_ptr->tests_run)++; } - data_ok &= checker_board_hyperslab_dr_pio_test__verify_data - ( - small_ds_buf_1 + start_index, - small_rank - 1, - edge_size, - checker_edge_size, - expected_value, - (hbool_t)TRUE - ); + l++; + (tv_ptr->total_tests)++; - ptr_1 = small_ds_buf_1; - for ( u = stop_index; u < small_ds_size; u++, ptr_1++ ) { + } while ( ( tv_ptr->large_rank > 2 ) && + ( (tv_ptr->small_rank - 1) <= 1 ) && + ( l < tv_ptr->edge_size ) ); + k++; + } while ( ( tv_ptr->large_rank > 3 ) && + ( (tv_ptr->small_rank - 1) <= 2 ) && + ( k < tv_ptr->edge_size ) ); + j++; + } while ( ( tv_ptr->large_rank > 4 ) && + ( (tv_ptr->small_rank - 1) <= 3 ) && + ( j < tv_ptr->edge_size ) ); - if ( *ptr_1 != 0 ) { + return; - data_ok = FALSE; - *ptr_1 = 0; - } - } +} /* ckrbrd_hs_dr_pio_test__m2d_l2s() */ - VRFY((data_ok == TRUE), - "large slice write slice to small slice data good."); - l++; +/*------------------------------------------------------------------------- + * Function: ckrbrd_hs_dr_pio_test__m2d_s2l() + * + * Purpose: Part four of a series of tests of I/O to/from checker + * board hyperslab selections of different rank in the parallel. + * + * Verify that we can write from memory to file using + * selections of different rank that H5S_select_shape_same() + * views as being of the same shape. + * + * Do this by writing checker board selections of the contents + * of the process's slice of the in memory small data set to + * slices of the on disk large data set. After each write, + * read the process's slice of the large data set back into + * memory, and verify that it contains the expected data. + * + * Verify that H5S_select_shape_same() returns true on the + * memory and file selections. + * + * Return: void + * + * Programmer: JRM -- 8/15/11 + * + * Modifications: + * + * None + * + *------------------------------------------------------------------------- + */ - } while ( ( large_rank > 2 ) && - ( (small_rank - 1) <= 1 ) && - ( l < edge_size ) ); - k++; - } while ( ( large_rank > 3 ) && - ( (small_rank - 1) <= 2 ) && - ( k < edge_size ) ); - j++; - } while ( ( large_rank > 4 ) && - ( (small_rank - 1) <= 3 ) && - ( j < edge_size ) ); +#define CHECKER_BOARD_HS_DR_PIO_TEST__M2D_S2L__DEBUG 0 + +static void +ckrbrd_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) +{ +#if CHECKER_BOARD_HS_DR_PIO_TEST__M2D_S2L__DEBUG + const char *fcnName = "ckrbrd_hs_dr_pio_test__m2d_s2l()"; +#endif /* CONTIG_HS_DR_PIO_TEST__M2D_S2L__DEBUG */ + hbool_t data_ok = FALSE; + hbool_t mis_match = FALSE; + int i, j, k, l; + size_t u; + size_t start_index; + size_t stop_index; + uint32_t expected_value; + uint32_t * ptr_1; + int mpi_rank; /* needed by VRFY */ + hsize_t sel_start[PAR_SS_DR_MAX_RANK]; + htri_t check; /* Shape comparison return value */ + herr_t ret; /* Generic return value */ + + /* initialize the local copy of mpi_rank */ + mpi_rank = tv_ptr->mpi_rank; /* Now write the contents of the process's slice of the in memory @@ -3815,49 +3979,49 @@ int m, n; * and file selections. */ - start[0] = (hsize_t)mpi_rank; - stride[0] = (hsize_t)(2 * (mpi_size + 1)); - count[0] = 1; - block[0] = 1; + tv_ptr->start[0] = (hsize_t)(tv_ptr->mpi_rank); + tv_ptr->stride[0] = (hsize_t)(2 * (tv_ptr->mpi_size + 1)); + tv_ptr->count[0] = 1; + tv_ptr->block[0] = 1; - for ( i = 1; i < large_rank; i++ ) { + for ( i = 1; i < tv_ptr->large_rank; i++ ) { - start[i] = 0; - stride[i] = (hsize_t)(2 * edge_size); - count[i] = 1; - block[i] = (hsize_t)edge_size; + tv_ptr->start[i] = 0; + tv_ptr->stride[i] = (hsize_t)(2 * tv_ptr->edge_size); + tv_ptr->count[i] = 1; + tv_ptr->block[i] = (hsize_t)(tv_ptr->edge_size); } - ret = H5Sselect_hyperslab(file_large_ds_sid_0, + ret = H5Sselect_hyperslab(tv_ptr->file_large_ds_sid_0, H5S_SELECT_SET, - start, - stride, - count, - block); + tv_ptr->start, + tv_ptr->stride, + tv_ptr->count, + tv_ptr->block); VRFY((ret >= 0), "H5Sselect_hyperslab(file_large_ds_sid_0, set) suceeded"); - ret = H5Sselect_hyperslab(mem_large_ds_sid, + ret = H5Sselect_hyperslab(tv_ptr->mem_large_ds_sid, H5S_SELECT_SET, - start, - stride, - count, - block); - VRFY((ret >= 0), "H5Sselect_hyperslab(mem_small_ds_sid, set) suceeded"); + tv_ptr->start, + tv_ptr->stride, + tv_ptr->count, + tv_ptr->block); + VRFY((ret >= 0), "H5Sselect_hyperslab(tv_ptr->mem_large_ds_sid, set) suceeded"); /* setup a checkerboard selection of the slice of the in memory small * data set associated with the process's mpi rank. */ sel_start[0] = sel_start[1] = sel_start[2] = sel_start[3] = sel_start[4] = 0; - sel_start[small_ds_offset] = (hsize_t)mpi_rank; + sel_start[tv_ptr->small_ds_offset] = (hsize_t)(tv_ptr->mpi_rank); - checker_board_hyperslab_dr_pio_test__select_checker_board(mpi_rank, - mem_small_ds_sid, - small_rank, - edge_size, - checker_edge_size, - small_rank - 1, - sel_start); + ckrbrd_hs_dr_pio_test__slct_ckrbrd(tv_ptr->mpi_rank, + tv_ptr->mem_small_ds_sid, + tv_ptr->small_rank, + tv_ptr->edge_size, + tv_ptr->checker_edge_size, + tv_ptr->small_rank - 1, + sel_start); /* set up start, stride, count, and block -- note that we will * change start[] so as to write checkerboard selections of slices @@ -3865,31 +4029,31 @@ int m, n; */ for ( i = 0; i < PAR_SS_DR_MAX_RANK; i++ ) { - start[i] = 0; - stride[i] = (hsize_t)(2 * edge_size); - count[i] = 1; - if ( (PAR_SS_DR_MAX_RANK - i) > (small_rank - 1) ) { + tv_ptr->start[i] = 0; + tv_ptr->stride[i] = (hsize_t)(2 * tv_ptr->edge_size); + tv_ptr->count[i] = 1; + if ( (PAR_SS_DR_MAX_RANK - i) > (tv_ptr->small_rank - 1) ) { - block[i] = 1; + tv_ptr->block[i] = 1; } else { - block[i] = (hsize_t)edge_size; + tv_ptr->block[i] = (hsize_t)(tv_ptr->edge_size); } } /* zero out the in memory large ds */ - HDmemset(large_ds_buf_1, 0, sizeof(uint32_t) * large_ds_size); + HDmemset(tv_ptr->large_ds_buf_1, 0, sizeof(uint32_t) * tv_ptr->large_ds_size); -#if CONTIG_HYPERSLAB_DR_PIO_TEST__RUN_TEST__DEBUG +#if CHECKER_BOARD_HS_DR_PIO_TEST__M2D_S2L__DEBUG HDfprintf(stdout, "%s writing process checkerboard selections of slices of small ds to process slices of large ds on disk.\n", fcnName); -#endif +#endif /* CHECKER_BOARD_HS_DR_PIO_TEST__M2D_S2L__DEBUG */ - if ( PAR_SS_DR_MAX_RANK - large_rank == 0 ) { + if ( PAR_SS_DR_MAX_RANK - tv_ptr->large_rank == 0 ) { - i = mpi_rank; + i = tv_ptr->mpi_rank; } else { @@ -3902,9 +4066,9 @@ int m, n; * test. */ - if ( PAR_SS_DR_MAX_RANK - large_rank == 1 ) { + if ( PAR_SS_DR_MAX_RANK - tv_ptr->large_rank == 1 ) { - j = mpi_rank; + j = tv_ptr->mpi_rank; } else { @@ -3912,9 +4076,9 @@ int m, n; } do { - if ( PAR_SS_DR_MAX_RANK - large_rank == 2 ) { + if ( PAR_SS_DR_MAX_RANK - tv_ptr->large_rank == 2 ) { - k = mpi_rank; + k = tv_ptr->mpi_rank; } else { @@ -3934,240 +4098,395 @@ int m, n; l = 0; do { - /* we know that small_rank >= 1 and that large_rank > small_rank - * by the assertions at the head of this function. Thus no - * need for another inner loop. - */ - - /* Zero out this processes slice of the on disk large data set. - * Note that this will leave one slice with its original data - * as there is one more slice than processes. - */ - ret = H5Dwrite(large_dataset, - H5T_NATIVE_UINT32, - mem_large_ds_sid, - file_large_ds_sid_0, - xfer_plist, - large_ds_buf_2); - VRFY((ret != FAIL), "H5Dwrite() to zero large ds suceeded"); - - - /* select the portion of the in memory large cube to which we - * are going to write data. - */ - start[0] = (hsize_t)i; - start[1] = (hsize_t)j; - start[2] = (hsize_t)k; - start[3] = (hsize_t)l; - start[4] = 0; - - HDassert( ( start[0] == 0 ) || ( 0 < small_ds_offset + 1 ) ); - HDassert( ( start[1] == 0 ) || ( 1 < small_ds_offset + 1 ) ); - HDassert( ( start[2] == 0 ) || ( 2 < small_ds_offset + 1 ) ); - HDassert( ( start[3] == 0 ) || ( 3 < small_ds_offset + 1 ) ); - HDassert( ( start[4] == 0 ) || ( 4 < small_ds_offset + 1 ) ); - - checker_board_hyperslab_dr_pio_test__select_checker_board - ( - mpi_rank, - file_large_ds_sid_1, - large_rank, - edge_size, - checker_edge_size, - small_rank - 1, - start - ); - - - /* verify that H5S_select_shape_same() reports the in - * memory small data set slice selection and the - * on disk slice through the large data set selection - * as having the same shape. - */ - check = H5S_select_shape_same_test(mem_small_ds_sid, - file_large_ds_sid_1); - VRFY((check == TRUE), "H5S_select_shape_same_test passed"); - - - /* write the small data set slice from memory to the - * target slice of the disk data set - */ -#if CHECKER_BOARD_HYPERSLAB_DR_PIO_TEST__RUN_TEST__DEBUG - HDfprintf(stdout, "%s:%d: start = %d %d %d %d %d.\n", - fcnName, mpi_rank, - start[0], start[1], start[2], start[3], start[4]); - HDfprintf(stdout, "%s:%d: mem/file extent dims = %d/%d.\n", - fcnName, mpi_rank, - H5Sget_simple_extent_ndims(mem_small_ds_sid), - H5Sget_simple_extent_ndims(file_large_ds_sid_1)); -#endif - ret = H5Dwrite(large_dataset, - H5T_NATIVE_UINT32, - mem_small_ds_sid, - file_large_ds_sid_1, - xfer_plist, - small_ds_buf_0); - VRFY((ret != FAIL), - "H5Dwrite of small ds slice to large ds succeeded"); + if ( (tv_ptr->skips)++ < tv_ptr->max_skips ) { /* skip the test */ + + (tv_ptr->tests_skipped)++; + + } else { /* run the test */ + + tv_ptr->skips = 0; /* reset the skips counter */ + + /* we know that small_rank >= 1 and that large_rank > small_rank + * by the assertions at the head of this function. Thus no + * need for another inner loop. + */ + + /* Zero out this processes slice of the on disk large data set. + * Note that this will leave one slice with its original data + * as there is one more slice than processes. + */ + ret = H5Dwrite(tv_ptr->large_dataset, + H5T_NATIVE_UINT32, + tv_ptr->mem_large_ds_sid, + tv_ptr->file_large_ds_sid_0, + tv_ptr->xfer_plist, + tv_ptr->large_ds_buf_2); + VRFY((ret != FAIL), "H5Dwrite() to zero large ds suceeded"); - /* read this processes slice on the on disk large - * data set into memory. - */ + /* select the portion of the in memory large cube to which we + * are going to write data. + */ + tv_ptr->start[0] = (hsize_t)i; + tv_ptr->start[1] = (hsize_t)j; + tv_ptr->start[2] = (hsize_t)k; + tv_ptr->start[3] = (hsize_t)l; + tv_ptr->start[4] = 0; + + HDassert((tv_ptr->start[0] == 0)||(0 < tv_ptr->small_ds_offset + 1)); + HDassert((tv_ptr->start[1] == 0)||(1 < tv_ptr->small_ds_offset + 1)); + HDassert((tv_ptr->start[2] == 0)||(2 < tv_ptr->small_ds_offset + 1)); + HDassert((tv_ptr->start[3] == 0)||(3 < tv_ptr->small_ds_offset + 1)); + HDassert((tv_ptr->start[4] == 0)||(4 < tv_ptr->small_ds_offset + 1)); + + ckrbrd_hs_dr_pio_test__slct_ckrbrd + ( + tv_ptr->mpi_rank, + tv_ptr->file_large_ds_sid_1, + tv_ptr->large_rank, + tv_ptr->edge_size, + tv_ptr->checker_edge_size, + tv_ptr->small_rank - 1, + tv_ptr->start + ); + + + /* verify that H5S_select_shape_same() reports the in + * memory small data set slice selection and the + * on disk slice through the large data set selection + * as having the same shape. + */ + check = H5S_select_shape_same_test(tv_ptr->mem_small_ds_sid, + tv_ptr->file_large_ds_sid_1); + VRFY((check == TRUE), "H5S_select_shape_same_test passed"); - ret = H5Dread(large_dataset, - H5T_NATIVE_UINT32, - mem_large_ds_sid, - file_large_ds_sid_0, - xfer_plist, - large_ds_buf_1); - VRFY((ret != FAIL), - "H5Dread() of process slice of large ds succeeded"); + /* write the small data set slice from memory to the + * target slice of the disk data set + */ +#if CHECKER_BOARD_HS_DR_PIO_TEST__M2D_S2L__DEBUG + HDfprintf(stdout, "%s:%d: start = %d %d %d %d %d.\n", + fcnName, tv_ptr->mpi_rank, + tv_ptr->start[0], tv_ptr->start[1], tv_ptr->start[2], + tv_ptr->start[3], tv_ptr->start[4]); + HDfprintf(stdout, "%s:%d: mem/file extent dims = %d/%d.\n", + fcnName, tv_ptr->mpi_rank, + H5Sget_simple_extent_ndims(tv_ptr->mem_small_ds_sid), + H5Sget_simple_extent_ndims(tv_ptr->file_large_ds_sid_1)); +#endif /* CHECKER_BOARD_HS_DR_PIO_TEST__M2D_S2L__DEBUG */ + ret = H5Dwrite(tv_ptr->large_dataset, + H5T_NATIVE_UINT32, + tv_ptr->mem_small_ds_sid, + tv_ptr->file_large_ds_sid_1, + tv_ptr->xfer_plist, + tv_ptr->small_ds_buf_0); + VRFY((ret != FAIL), + "H5Dwrite of small ds slice to large ds succeeded"); + + + /* read this processes slice on the on disk large + * data set into memory. + */ - /* verify that the expected data and only the - * expected data was read. - */ - expected_value = (uint32_t)((size_t)mpi_rank * small_ds_slice_size); + ret = H5Dread(tv_ptr->large_dataset, + H5T_NATIVE_UINT32, + tv_ptr->mem_large_ds_sid, + tv_ptr->file_large_ds_sid_0, + tv_ptr->xfer_plist, + tv_ptr->large_ds_buf_1); + VRFY((ret != FAIL), + "H5Dread() of process slice of large ds succeeded"); - start_index = (size_t)((i * edge_size * edge_size * edge_size * edge_size) + - (j * edge_size * edge_size * edge_size) + - (k * edge_size * edge_size) + - (l * edge_size)); - stop_index = start_index + small_ds_slice_size - 1; - HDassert( start_index < stop_index ); - HDassert( stop_index < large_ds_size ); + /* verify that the expected data and only the + * expected data was read. + */ + expected_value = + (uint32_t)((size_t)(tv_ptr->mpi_rank) * tv_ptr->small_ds_slice_size); + start_index = (size_t) + ((i * tv_ptr->edge_size * tv_ptr->edge_size * + tv_ptr->edge_size * tv_ptr->edge_size) + + (j * tv_ptr->edge_size * tv_ptr->edge_size * tv_ptr->edge_size) + + (k * tv_ptr->edge_size * tv_ptr->edge_size) + + (l * tv_ptr->edge_size)); + stop_index = start_index + tv_ptr->small_ds_slice_size - 1; - mis_match = FALSE; + HDassert( start_index < stop_index ); + HDassert( stop_index < tv_ptr->large_ds_size ); - data_ok = TRUE; - ptr_1 = large_ds_buf_1; - for ( u = 0; u < start_index; u++, ptr_1++ ) { + mis_match = FALSE; - if ( *ptr_1 != 0 ) { + data_ok = TRUE; - data_ok = FALSE; - *ptr_1 = 0; + ptr_1 = tv_ptr->large_ds_buf_1; + for ( u = 0; u < start_index; u++, ptr_1++ ) { + + if ( *ptr_1 != 0 ) { + + data_ok = FALSE; + *ptr_1 = 0; + } } - } - data_ok &= checker_board_hyperslab_dr_pio_test__verify_data - ( - large_ds_buf_1 + start_index, - small_rank - 1, - edge_size, - checker_edge_size, - expected_value, - (hbool_t)TRUE - ); + data_ok &= ckrbrd_hs_dr_pio_test__verify_data + ( + tv_ptr->large_ds_buf_1 + start_index, + tv_ptr->small_rank - 1, + tv_ptr->edge_size, + tv_ptr->checker_edge_size, + expected_value, + (hbool_t)TRUE + ); - ptr_1 = large_ds_buf_1; - for ( u = stop_index; u < small_ds_size; u++, ptr_1++ ) { + ptr_1 = tv_ptr->large_ds_buf_1; + for ( u = stop_index; u < tv_ptr->small_ds_size; u++, ptr_1++ ) { - if ( *ptr_1 != 0 ) { + if ( *ptr_1 != 0 ) { - data_ok = FALSE; - *ptr_1 = 0; + data_ok = FALSE; + *ptr_1 = 0; + } } - } - VRFY((data_ok == TRUE), - "small ds cb slice write to large ds slice data good."); + VRFY((data_ok == TRUE), + "small ds cb slice write to large ds slice data good."); + + (tv_ptr->tests_run)++; + } l++; - } while ( ( large_rank > 2 ) && - ( (small_rank - 1) <= 1 ) && - ( l < edge_size ) ); + (tv_ptr->total_tests)++; + + } while ( ( tv_ptr->large_rank > 2 ) && + ( (tv_ptr->small_rank - 1) <= 1 ) && + ( l < tv_ptr->edge_size ) ); k++; - } while ( ( large_rank > 3 ) && - ( (small_rank - 1) <= 2 ) && - ( k < edge_size ) ); + } while ( ( tv_ptr->large_rank > 3 ) && + ( (tv_ptr->small_rank - 1) <= 2 ) && + ( k < tv_ptr->edge_size ) ); j++; - } while ( ( large_rank > 4 ) && - ( (small_rank - 1) <= 3 ) && - ( j < edge_size ) ); + } while ( ( tv_ptr->large_rank > 4 ) && + ( (tv_ptr->small_rank - 1) <= 3 ) && + ( j < tv_ptr->edge_size ) ); + return; - /* Close dataspaces */ - ret = H5Sclose(full_mem_small_ds_sid); - VRFY((ret != FAIL), "H5Sclose(full_mem_small_ds_sid) succeeded"); +} /* ckrbrd_hs_dr_pio_test__m2d_s2l() */ - ret = H5Sclose(full_file_small_ds_sid); - VRFY((ret != FAIL), "H5Sclose(full_file_small_ds_sid) succeeded"); - ret = H5Sclose(mem_small_ds_sid); - VRFY((ret != FAIL), "H5Sclose(mem_small_ds_sid) succeeded"); +/*------------------------------------------------------------------------- + * Function: ckrbrd_hs_dr_pio_test__run_test() + * + * Purpose: Test I/O to/from checkerboard selections of hyperslabs of + * different rank in the parallel. + * + * Return: void + * + * Programmer: JRM -- 10/10/09 + * + * Modifications: + * + * JRM -- 9/16/10 + * Added the express_test parameter. Use it to control + * whether we set an alignment, and whether we allocate + * chunks such that no two processes will normally touch + * the same chunk. + * + *------------------------------------------------------------------------- + */ - ret = H5Sclose(file_small_ds_sid_0); - VRFY((ret != FAIL), "H5Sclose(file_small_ds_sid_0) succeeded"); +#define CKRBRD_HS_DR_PIO_TEST__RUN_TEST__DEBUG 0 - ret = H5Sclose(file_small_ds_sid_1); - VRFY((ret != FAIL), "H5Sclose(file_small_ds_sid_1) succeeded"); +static void +ckrbrd_hs_dr_pio_test__run_test(const int test_num, + const int edge_size, + const int checker_edge_size, + const int chunk_edge_size, + const int small_rank, + const int large_rank, + const hbool_t use_collective_io, + const hid_t dset_type, + const int express_test, + int * skips_ptr, + int max_skips, + int64_t * total_tests_ptr, + int64_t * tests_run_ptr, + int64_t * tests_skipped_ptr) - ret = H5Sclose(small_ds_slice_sid); - VRFY((ret != FAIL), "H5Sclose(small_ds_slice_sid) succeeded"); +{ +#if CKRBRD_HS_DR_PIO_TEST__RUN_TEST__DEBUG + const char *fcnName = "ckrbrd_hs_dr_pio_test__run_test()"; +#endif /* CKRBRD_HS_DR_PIO_TEST__RUN_TEST__DEBUG */ + int mpi_rank; /* needed by VRFY */ + struct hs_dr_pio_test_vars_t test_vars = + { + /* int mpi_size = */ -1, + /* int mpi_rank = */ -1, + /* MPI_Comm mpi_comm = */ MPI_COMM_NULL, + /* MPI_Inf mpi_info = */ MPI_INFO_NULL, + /* int test_num = */ -1, + /* int edge_size = */ -1, + /* int checker_edge_size = */ -1, + /* int chunk_edge_size = */ -1, + /* int small_rank = */ -1, + /* int large_rank = */ -1, + /* hid_t dset_type = */ -1, + /* uint32_t * small_ds_buf_0 = */ NULL, + /* uint32_t * small_ds_buf_1 = */ NULL, + /* uint32_t * small_ds_buf_2 = */ NULL, + /* uint32_t * small_ds_slice_buf = */ NULL, + /* uint32_t * large_ds_buf_0 = */ NULL, + /* uint32_t * large_ds_buf_1 = */ NULL, + /* uint32_t * large_ds_buf_2 = */ NULL, + /* uint32_t * large_ds_slice_buf = */ NULL, + /* int small_ds_offset = */ -1, + /* int large_ds_offset = */ -1, + /* hid_t fid = */ -1, /* HDF5 file ID */ + /* hid_t xfer_plist = */ H5P_DEFAULT, + /* hid_t full_mem_small_ds_sid = */ -1, + /* hid_t full_file_small_ds_sid = */ -1, + /* hid_t mem_small_ds_sid = */ -1, + /* hid_t file_small_ds_sid_0 = */ -1, + /* hid_t file_small_ds_sid_1 = */ -1, + /* hid_t small_ds_slice_sid = */ -1, + /* hid_t full_mem_large_ds_sid = */ -1, + /* hid_t full_file_large_ds_sid = */ -1, + /* hid_t mem_large_ds_sid = */ -1, + /* hid_t file_large_ds_sid_0 = */ -1, + /* hid_t file_large_ds_sid_1 = */ -1, + /* hid_t file_large_ds_process_slice_sid = */ -1, + /* hid_t mem_large_ds_process_slice_sid = */ -1, + /* hid_t large_ds_slice_sid = */ -1, + /* hid_t small_dataset = */ -1, /* Dataset ID */ + /* hid_t large_dataset = */ -1, /* Dataset ID */ + /* size_t small_ds_size = */ 1, + /* size_t small_ds_slice_size = */ 1, + /* size_t large_ds_size = */ 1, + /* size_t large_ds_slice_size = */ 1, + /* hsize_t dims[PAR_SS_DR_MAX_RANK] = */ {0,0,0,0,0}, + /* hsize_t chunk_dims[PAR_SS_DR_MAX_RANK] = */ {0,0,0,0,0}, + /* hsize_t start[PAR_SS_DR_MAX_RANK] = */ {0,0,0,0,0}, + /* hsize_t stride[PAR_SS_DR_MAX_RANK] = */ {0,0,0,0,0}, + /* hsize_t count[PAR_SS_DR_MAX_RANK] = */ {0,0,0,0,0}, + /* hsize_t block[PAR_SS_DR_MAX_RANK] = */ {0,0,0,0,0}, + /* hsize_t * start_ptr = */ NULL, + /* hsize_t * stride_ptr = */ NULL, + /* hsize_t * count_ptr = */ NULL, + /* hsize_t * block_ptr = */ NULL, + /* int skips = */ 0, + /* int max_skips = */ 0, + /* int64_t total_tests = */ 0, + /* int64_t tests_run = */ 0, + /* int64_t tests_skipped = */ 0 + }; + struct hs_dr_pio_test_vars_t * tv_ptr = &test_vars; - ret = H5Sclose(full_mem_large_ds_sid); - VRFY((ret != FAIL), "H5Sclose(full_mem_large_ds_sid) succeeded"); + hs_dr_pio_test__setup(test_num, edge_size, checker_edge_size, + chunk_edge_size, small_rank, large_rank, + use_collective_io, dset_type, express_test, + tv_ptr); - ret = H5Sclose(full_file_large_ds_sid); - VRFY((ret != FAIL), "H5Sclose(full_file_large_ds_sid) succeeded"); - ret = H5Sclose(mem_large_ds_sid); - VRFY((ret != FAIL), "H5Sclose(mem_large_ds_sid) succeeded"); + /* initialize the local copy of mpi_rank */ + mpi_rank = tv_ptr->mpi_rank; - ret = H5Sclose(file_large_ds_sid_0); - VRFY((ret != FAIL), "H5Sclose(mem_large_ds_sid) succeeded"); - ret = H5Sclose(file_large_ds_sid_1); - VRFY((ret != FAIL), "H5Sclose(mem_large_ds_sid) succeeded"); + /* initialize skips & max_skips */ + tv_ptr->skips = *skips_ptr; + tv_ptr->max_skips = max_skips; - ret = H5Sclose(mem_large_ds_process_slice_sid); - VRFY((ret != FAIL), "H5Sclose(mem_large_ds_process_slice_sid) succeeded"); - ret = H5Sclose(file_large_ds_process_slice_sid); - VRFY((ret != FAIL), "H5Sclose(file_large_ds_process_slice_sid) succeeded"); +#if CKRBRD_HS_DR_PIO_TEST__RUN_TEST__DEBUG + if ( MAINPROCESS ) { + HDfprintf(stdout, "test %d: small rank = %d, large rank = %d.\n", + test_num, small_rank, large_rank); + HDfprintf(stdout, "test %d: Initialization complete.\n", test_num); + } +#endif /* CKRBRD_HS_DR_PIO_TEST__RUN_TEST__DEBUG */ - ret = H5Sclose(large_ds_slice_sid); - VRFY((ret != FAIL), "H5Sclose(large_ds_slice_sid) succeeded"); + /* first, verify that we can read from disk correctly using selections + * of different rank that H5S_select_shape_same() views as being of the + * same shape. + * + * Start by reading a (small_rank - 1)-D slice from this processes slice + * of the on disk large data set, and verifying that the data read is + * correct. Verify that H5S_select_shape_same() returns true on the + * memory and file selections. + * + * The first step is to set up the needed checker board selection in the + * in memory small small cube + */ + + ckrbrd_hs_dr_pio_test__d2m_l2s(tv_ptr); - /* Close Datasets */ - ret = H5Dclose(small_dataset); - VRFY((ret != FAIL), "H5Dclose(small_dataset) succeeded"); - ret = H5Dclose(large_dataset); - VRFY((ret != FAIL), "H5Dclose(large_dataset) succeeded"); + /* similarly, read slices of the on disk small data set into slices + * through the in memory large data set, and verify that the correct + * data (and only the correct data) is read. + */ + ckrbrd_hs_dr_pio_test__d2m_s2l(tv_ptr); - /* close the file collectively */ - MESG("about to close file."); - ret = H5Fclose(fid); - VRFY((ret != FAIL), "file close succeeded"); - /* Free memory buffers */ - if ( small_ds_buf_0 != NULL ) HDfree(small_ds_buf_0); - if ( small_ds_buf_1 != NULL ) HDfree(small_ds_buf_1); - if ( small_ds_buf_2 != NULL ) HDfree(small_ds_buf_2); - if ( small_ds_slice_buf != NULL ) HDfree(small_ds_slice_buf); + /* now we go in the opposite direction, verifying that we can write + * from memory to file using selections of different rank that + * H5S_select_shape_same() views as being of the same shape. + * + * Start by writing small_rank - 1 D slices from the in memory large data + * set to the on disk small dataset. After each write, read the slice of + * the small dataset back from disk, and verify that it contains the + * expected data. Verify that H5S_select_shape_same() returns true on + * the memory and file selections. + */ + + ckrbrd_hs_dr_pio_test__m2d_l2s(tv_ptr); + + + /* Now write the contents of the process's slice of the in memory + * small data set to slices of the on disk large data set. After + * each write, read the process's slice of the large data set back + * into memory, and verify that it contains the expected data. + * Verify that H5S_select_shape_same() returns true on the memory + * and file selections. + */ + + ckrbrd_hs_dr_pio_test__m2d_s2l(tv_ptr); + + +#if CKRBRD_HS_DR_PIO_TEST__RUN_TEST__DEBUG + if ( MAINPROCESS ) { + HDfprintf(stdout, + "test %d: Subtests complete -- tests run/skipped/total = %lld/%lld/%lld.\n", + test_num, (long long)(tv_ptr->tests_run), (long long)(tv_ptr->tests_skipped), + (long long)(tv_ptr->total_tests)); + } +#endif /* CKRBRD_HS_DR_PIO_TEST__RUN_TEST__DEBUG */ + + hs_dr_pio_test__takedown(tv_ptr); - if ( large_ds_buf_0 != NULL ) HDfree(large_ds_buf_0); - if ( large_ds_buf_1 != NULL ) HDfree(large_ds_buf_1); - if ( large_ds_buf_2 != NULL ) HDfree(large_ds_buf_2); - if ( large_ds_slice_buf != NULL ) HDfree(large_ds_slice_buf); +#if CKRBRD_HS_DR_PIO_TEST__RUN_TEST__DEBUG + if ( MAINPROCESS ) { + HDfprintf(stdout, "test %d: Takedown complete.\n", test_num); + } +#endif /* CKRBRD_HS_DR_PIO_TEST__RUN_TEST__DEBUG */ + + *skips_ptr = tv_ptr->skips; + *total_tests_ptr += tv_ptr->total_tests; + *tests_run_ptr += tv_ptr->tests_run; + *tests_skipped_ptr += tv_ptr->tests_skipped; return; -} /* checker_board_hyperslab_dr_pio_test__run_test() */ +} /* ckrbrd_hs_dr_pio_test__run_test() */ /*------------------------------------------------------------------------- - * Function: checker_board_hyperslab_dr_pio_test() + * Function: ckrbrd_hs_dr_pio_test() * * Purpose: Test I/O to/from hyperslab selections of different rank in * the parallel case. @@ -4193,44 +4512,35 @@ int m, n; *------------------------------------------------------------------------- */ -void -checker_board_hyperslab_dr_pio_test(ShapeSameTestMethods sstest_type) +static void +ckrbrd_hs_dr_pio_test(ShapeSameTestMethods sstest_type) { + int express_test; + int local_express_test; + int mpi_size = -1; + int mpi_rank = -1; int test_num = 0; int edge_size = 10; int checker_edge_size = 3; int chunk_edge_size = 0; int small_rank = 3; int large_rank = 4; - int skips[4] = {0, 0, 0, 0}; - int skip_counters[4] = {0, 0, 0, 0}; - int tests_skiped[4] = {0, 0, 0, 0}; int mpi_result; hid_t dset_type = H5T_NATIVE_UINT; -#ifdef H5_HAVE_GETTIMEOFDAY - hbool_t time_tests = TRUE; - hbool_t display_skips = FALSE; - int local_express_test; - int express_test; - int i; - int samples = 0; - int sample_size = 1; - int mpi_size = -1; - int mpi_rank = -1; - int local_skips[4]; - const int ind_contig_idx = 0; - const int col_contig_idx = 1; - const int ind_chunked_idx = 2; - const int col_chunked_idx = 3; - const int test_types = 4; - long long max_test_time = 3000000; /* for one test */ - long long sample_times[4] = {0, 0, 0, 0}; - struct timeval timeval_a; - struct timeval timeval_b; + int skips = 0; + int max_skips = 0; + /* The following table list the number of sub-tests skipped between + * each test that is actually executed as a function of the express + * test level. Note that any value in excess of 4880 will cause all + * sub tests to be skipped. + */ + int max_skips_tbl[4] = {0, 4, 64, 1024}; + int64_t total_tests = 0; + int64_t tests_run = 0; + int64_t tests_skipped = 0; MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); -#endif /* H5_HAVE_GETTIMEOFDAY */ local_express_test = GetTestExpress(); @@ -4245,6 +4555,14 @@ checker_board_hyperslab_dr_pio_test(ShapeSameTestMethods sstest_type) VRFY((mpi_result == MPI_SUCCESS ), "MPI_Allreduce(0) succeeded"); + if ( local_express_test < 0 ) { + max_skips = max_skips_tbl[0]; + } else if ( local_express_test > 3 ) { + max_skips = max_skips_tbl[3]; + } else { + max_skips = max_skips_tbl[local_express_test]; + } + #if 0 { int DebugWait = 1; @@ -4256,201 +4574,113 @@ checker_board_hyperslab_dr_pio_test(ShapeSameTestMethods sstest_type) for ( large_rank = 3; large_rank <= PAR_SS_DR_MAX_RANK; large_rank++ ) { for ( small_rank = 2; small_rank < large_rank; small_rank++ ) { - switch(sstest_type){ - case IND_CONTIG: - /* contiguous data set, independent I/O */ - chunk_edge_size = 0; - if ( skip_counters[ind_contig_idx] < skips[ind_contig_idx] ) { - - skip_counters[ind_contig_idx]++; - tests_skiped[ind_contig_idx]++; - printf("Test skipped\n"); - } else { - skip_counters[ind_contig_idx] = 0; - START_TIMER(time_tests, timeval_a, "HDgettimeofday(0) succeeds."); - - checker_board_hyperslab_dr_pio_test__run_test(test_num, - edge_size, - checker_edge_size, - chunk_edge_size, - small_rank, - large_rank, - FALSE, - dset_type, - express_test); - STOP_TIMER_AND_UPDATE(time_tests, timeval_b, \ - "HDgettimeofday(1) succeeds.", \ - sample_times[ind_contig_idx]); - - } - test_num++; - break; - /* end of case IND_CONTIG */ - - case COL_CONTIG: - /* contiguous data set, collective I/O */ - chunk_edge_size = 0; - if ( skip_counters[col_contig_idx] < skips[col_contig_idx] ) { - - skip_counters[col_contig_idx]++; - tests_skiped[col_contig_idx]++; - printf("Test skipped\n"); - } else { - skip_counters[col_contig_idx] = 0; - START_TIMER(time_tests, timeval_a, "HDgettimeofday(2) succeeds."); - - checker_board_hyperslab_dr_pio_test__run_test(test_num, - edge_size, - checker_edge_size, - chunk_edge_size, - small_rank, - large_rank, - TRUE, - dset_type, - express_test); - STOP_TIMER_AND_UPDATE(time_tests, timeval_b, \ - "HDgettimeofday(3) succeeds.", \ - sample_times[col_contig_idx]); - - } - test_num++; - break; - /* end of case COL_CONTIG */ - - case IND_CHUNKED: - /* chunked data set, independent I/O */ - chunk_edge_size = 5; - if ( skip_counters[ind_chunked_idx] < skips[ind_chunked_idx] ) { - - skip_counters[ind_chunked_idx]++; - tests_skiped[ind_chunked_idx]++; - printf("Test skipped\n"); - } else { - skip_counters[ind_chunked_idx] = 0; - START_TIMER(time_tests, timeval_a, "HDgettimeofday(4) succeeds."); - - checker_board_hyperslab_dr_pio_test__run_test(test_num, - edge_size, - checker_edge_size, - chunk_edge_size, - small_rank, - large_rank, - FALSE, - dset_type, - express_test); - STOP_TIMER_AND_UPDATE(time_tests, timeval_b, \ - "HDgettimeofday(5) succeeds.", \ - sample_times[ind_chunked_idx]); - - } - test_num++; - break; - /* end of case IND_CHUNKED */ - - case COL_CHUNKED: - /* chunked data set, collective I/O */ - chunk_edge_size = 5; - if ( skip_counters[col_chunked_idx] < skips[col_chunked_idx] ) { - - skip_counters[col_chunked_idx]++; - tests_skiped[col_chunked_idx]++; - printf("Test skipped\n"); - } else { - skip_counters[col_chunked_idx] = 0; - START_TIMER(time_tests, timeval_a, "HDgettimeofday(6) succeeds."); - - checker_board_hyperslab_dr_pio_test__run_test(test_num, - edge_size, - checker_edge_size, - chunk_edge_size, - small_rank, - large_rank, - TRUE, - dset_type, - express_test); - STOP_TIMER_AND_UPDATE(time_tests, timeval_b, \ - "HDgettimeofday(7) succeeds.", \ - sample_times[col_chunked_idx]); - - } - test_num++; - break; - /* end of case COL_CHUNKED */ - } /* end of switch(sstest_type) */ - -#ifdef H5_HAVE_GETTIMEOFDAY - if ( time_tests ) { - - samples++; - - if ( samples >= sample_size ) { - - int result; - - time_tests = FALSE; - - max_test_time = ((long long)sample_size) * max_test_time; - - for ( i = 0; i < test_types; i++ ) { - - if ( ( express_test == 0 ) || - ( sample_times[i] <= max_test_time ) ) { - - local_skips[i] = 0; - - } else { - - local_skips[i] = (int)(sample_times[i] / max_test_time); - } - } - - /* do an MPI_Allreduce() with the skips vector to ensure that - * all processes agree on its contents. - */ - result = MPI_Allreduce((void *)local_skips, - (void *)skips, - test_types, - MPI_INT, - MPI_MAX, - MPI_COMM_WORLD); - VRFY((result == MPI_SUCCESS ), "MPI_Allreduce() succeeded"); - } + switch(sstest_type){ + case IND_CONTIG: + /* contiguous data set, independent I/O */ + chunk_edge_size = 0; + ckrbrd_hs_dr_pio_test__run_test(test_num, + edge_size, + checker_edge_size, + chunk_edge_size, + small_rank, + large_rank, + FALSE, + dset_type, + express_test, + &skips, + max_skips, + &total_tests, + &tests_run, + &tests_skipped); + test_num++; + break; + /* end of case IND_CONTIG */ + + case COL_CONTIG: + /* contiguous data set, collective I/O */ + chunk_edge_size = 0; + ckrbrd_hs_dr_pio_test__run_test(test_num, + edge_size, + checker_edge_size, + chunk_edge_size, + small_rank, + large_rank, + TRUE, + dset_type, + express_test, + &skips, + max_skips, + &total_tests, + &tests_run, + &tests_skipped); + test_num++; + break; + /* end of case COL_CONTIG */ + + case IND_CHUNKED: + /* chunked data set, independent I/O */ + chunk_edge_size = 5; + ckrbrd_hs_dr_pio_test__run_test(test_num, + edge_size, + checker_edge_size, + chunk_edge_size, + small_rank, + large_rank, + FALSE, + dset_type, + express_test, + &skips, + max_skips, + &total_tests, + &tests_run, + &tests_skipped); + test_num++; + break; + /* end of case IND_CHUNKED */ + + case COL_CHUNKED: + /* chunked data set, collective I/O */ + chunk_edge_size = 5; + ckrbrd_hs_dr_pio_test__run_test(test_num, + edge_size, + checker_edge_size, + chunk_edge_size, + small_rank, + large_rank, + TRUE, + dset_type, + express_test, + &skips, + max_skips, + &total_tests, + &tests_run, + &tests_skipped); + test_num++; + break; + /* end of case COL_CHUNKED */ + + default: + VRFY((FALSE), "unknown test type"); + break; + + } /* end of switch(sstest_type) */ +#if CONTIG_HS_DR_PIO_TEST__DEBUG + if ( ( MAINPROCESS ) && ( tests_skipped > 0 ) ) { + HDfprintf(stdout, " run/skipped/total = %lld/%lld/%lld.\n", + tests_run, tests_skipped, total_tests); } -#endif /* H5_HAVE_GETTIMEOFDAY */ - +#endif /* CONTIG_HS_DR_PIO_TEST__DEBUG */ } } -#ifdef H5_HAVE_GETTIMEOFDAY - if ( ( MAINPROCESS ) && ( display_skips ) ) { - - HDfprintf(stdout, "***********************************\n"); - HDfprintf(stdout, "express test = %d.\n", express_test); - HDfprintf(stdout, "sample_size = %d, max_test_time = %lld.\n", - sample_size, max_test_time); - HDfprintf(stdout, "sample_times[] = %lld, %lld, %lld, %lld.\n", - sample_times[ind_contig_idx], - sample_times[col_contig_idx], - sample_times[ind_chunked_idx], - sample_times[col_chunked_idx]); - HDfprintf(stdout, "skips[] = %d, %d, %d, %d.\n", - skips[ind_contig_idx], - skips[col_contig_idx], - skips[ind_chunked_idx], - skips[col_chunked_idx]); - HDfprintf(stdout, "tests_skiped[] = %d, %d, %d, %d.\n", - tests_skiped[ind_contig_idx], - tests_skiped[col_contig_idx], - tests_skiped[ind_chunked_idx], - tests_skiped[col_chunked_idx]); - HDfprintf(stdout, "test_num = %d.\n", test_num); - HDfprintf(stdout, "***********************************\n"); + if ( ( MAINPROCESS ) && ( tests_skipped > 0 ) ) { + HDfprintf(stdout, " %lld of %lld subtests skipped to expedite testing.\n", + tests_skipped, total_tests); } -#endif /* H5_HAVE_GETTIMEOFDAY */ return; -} /* checker_board_hyperslab_dr_pio_test() */ +} /* ckrbrd_hs_dr_pio_test() */ /* Main Body. Here for now, may have to move them to a separated file later. */ @@ -4522,7 +4752,7 @@ void pause_proc(void) MPI_Get_processor_name(mpi_name, &mpi_namelen); if (MAINPROCESS) - while ((stat(greenlight, &statbuf) == -1) && loops < maxloop){ + while ((HDstat(greenlight, &statbuf) == -1) && loops < maxloop){ if (!loops++){ printf("Proc %d (%*s, %d): to debug, attach %d\n", mpi_rank, mpi_namelen, mpi_name, pid, pid); @@ -4756,28 +4986,28 @@ create_faccess_plist(MPI_Comm comm, MPI_Info info, int l_facc_type, static void sscontig1(void) { - contig_hyperslab_dr_pio_test(IND_CONTIG); + contig_hs_dr_pio_test(IND_CONTIG); } /* Shape Same test using contigous hyperslab using collective IO on contigous datasets */ static void sscontig2(void) { - contig_hyperslab_dr_pio_test(COL_CONTIG); + contig_hs_dr_pio_test(COL_CONTIG); } /* Shape Same test using contigous hyperslab using independent IO on chunked datasets */ static void sscontig3(void) { - contig_hyperslab_dr_pio_test(IND_CHUNKED); + contig_hs_dr_pio_test(IND_CHUNKED); } /* Shape Same test using contigous hyperslab using collective IO on chunked datasets */ static void sscontig4(void) { - contig_hyperslab_dr_pio_test(COL_CHUNKED); + contig_hs_dr_pio_test(COL_CHUNKED); } @@ -4785,38 +5015,34 @@ sscontig4(void) static void sschecker1(void) { - checker_board_hyperslab_dr_pio_test(IND_CONTIG); + ckrbrd_hs_dr_pio_test(IND_CONTIG); } /* Shape Same test using checker hyperslab using collective IO on contigous datasets */ static void sschecker2(void) { - checker_board_hyperslab_dr_pio_test(COL_CONTIG); + ckrbrd_hs_dr_pio_test(COL_CONTIG); } /* Shape Same test using checker hyperslab using independent IO on chunked datasets */ static void sschecker3(void) { - checker_board_hyperslab_dr_pio_test(IND_CHUNKED); + ckrbrd_hs_dr_pio_test(IND_CHUNKED); } /* Shape Same test using checker hyperslab using collective IO on chunked datasets */ static void sschecker4(void) { - checker_board_hyperslab_dr_pio_test(COL_CHUNKED); + ckrbrd_hs_dr_pio_test(COL_CHUNKED); } int main(int argc, char **argv) { int mpi_size, mpi_rank; /* mpi variables */ - H5Ptest_param_t ndsets_params, ngroups_params; - H5Ptest_param_t collngroups_params; - H5Ptest_param_t io_mode_confusion_params; - H5Ptest_param_t rr_obj_flush_confusion_params; /* Un-buffer the stdout and stderr */ setbuf(stderr, NULL); @@ -4832,6 +5058,7 @@ int main(int argc, char **argv) if (MAINPROCESS){ printf("===================================\n"); printf("Shape Same Tests Start\n"); + printf(" express_test = %d.\n", GetTestExpress()); printf("===================================\n"); } @@ -4841,7 +5068,7 @@ int main(int argc, char **argv) * calls. By then, MPI calls may not work. */ if (H5dont_atexit() < 0){ - printf("Failed to turn off atexit processing. Continue.\n", mpi_rank); + printf("%d: Failed to turn off atexit processing. Continue.\n", mpi_rank); }; H5open(); h5_show_hostname(); @@ -4850,6 +5077,7 @@ int main(int argc, char **argv) TestInit(argv[0], usage, parse_options); /* Shape Same tests using contigous hyperslab */ +#if 1 AddTest("sscontig1", sscontig1, NULL, "Shape Same, contigous hyperslab, ind IO, contig datasets", PARATESTFILE); AddTest("sscontig2", sscontig2, NULL, @@ -4858,6 +5086,7 @@ int main(int argc, char **argv) "Shape Same, contigous hyperslab, ind IO, chunked datasets", PARATESTFILE); AddTest("sscontig4", sscontig4, NULL, "Shape Same, contigous hyperslab, col IO, chunked datasets", PARATESTFILE); +#endif /* Shape Same tests using checker board hyperslab */ AddTest("sschecker1", sschecker1, NULL, @@ -4919,9 +5148,9 @@ int main(int argc, char **argv) if (MAINPROCESS){ /* only process 0 reports */ printf("===================================\n"); if (nerrors) - printf("***PHDF5 tests detected %d errors***\n", nerrors); + printf("***Shape Same tests detected %d errors***\n", nerrors); else - printf("PHDF5 tests finished with no errors\n"); + printf("Shape Same tests finished with no errors\n"); printf("===================================\n"); } /* close HDF5 library */ diff --git a/testpar/testphdf5.c b/testpar/testphdf5.c index 8b24f87..e3c72ef 100644 --- a/testpar/testphdf5.c +++ b/testpar/testphdf5.c @@ -81,7 +81,7 @@ void pause_proc(void) MPI_Get_processor_name(mpi_name, &mpi_namelen); if (MAINPROCESS) - while ((stat(greenlight, &statbuf) == -1) && loops < maxloop){ + while ((HDstat(greenlight, &statbuf) == -1) && loops < maxloop){ if (!loops++){ printf("Proc %d (%*s, %d): to debug, attach %d\n", mpi_rank, mpi_namelen, mpi_name, pid, pid); @@ -498,6 +498,9 @@ int main(int argc, char **argv) "test mpi derived type management", PARATESTFILE); + AddTest("actualio", actual_io_mode_tests, NULL, + "test actual io mode proprerty", + PARATESTFILE); /* Display testing information */ TestInfo(argv[0]); diff --git a/testpar/testphdf5.h b/testpar/testphdf5.h index 2b83047..11656f9 100644 --- a/testpar/testphdf5.h +++ b/testpar/testphdf5.h @@ -160,6 +160,19 @@ enum H5TEST_COLL_CHUNK_API {API_NONE=0,API_LINK_HARD, #define NPOINTS 4 /* Number of points that will be selected and overwritten */ +/* Definitions of the selection mode for the test_actual_io_function. */ +#define TEST_ACTUAL_IO_NO_COLLECTIVE 0 +#define TEST_ACTUAL_IO_RESET 1 +#define TEST_ACTUAL_IO_MULTI_CHUNK_IND 2 +#define TEST_ACTUAL_IO_MULTI_CHUNK_COL 3 +#define TEST_ACTUAL_IO_MULTI_CHUNK_MIX 4 +#define TEST_ACTUAL_IO_MULTI_CHUNK_MIX_DISAGREE 5 +#define TEST_ACTUAL_IO_MULTI_CHUNK_NO_OPT_IND 6 +#define TEST_ACTUAL_IO_MULTI_CHUNK_NO_OPT_COL 7 +#define TEST_ACTUAL_IO_MULTI_CHUNK_NO_OPT_MIX_DISAGREE 8 +#define TEST_ACTUAL_IO_LINK_CHUNK 9 +#define TEST_ACTUAL_IO_CONTIGUOUS 10 + /* Don't erase these lines, they are put here for debugging purposes */ /* #define MSPACE1_RANK 1 @@ -173,9 +186,9 @@ enum H5TEST_COLL_CHUNK_API {API_NONE=0,API_LINK_HARD, #define MSPACE_DIM1 8 #define MSPACE_DIM2 9 #define NPOINTS 4 +*/ /* end of debugging macro */ -*/ /* end of debugging macro */ /* type definitions */ typedef struct H5Ptest_param_t /* holds extra test parameters */ { @@ -222,6 +235,7 @@ void dataset_readAll(void); void extend_readInd(void); void extend_readAll(void); void none_selection_chunk(void); +void actual_io_mode_tests(void); void test_chunk_alloc(void); void test_filter_read(void); void compact_dataset(void); diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 8c6e41f..6cdfcac 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -1,11 +1,10 @@ -cmake_minimum_required (VERSION 2.8) +cmake_minimum_required (VERSION 2.8.6) PROJECT (HDF5_TOOLS) #----------------------------------------------------------------------------- # Setup include Directories #----------------------------------------------------------------------------- INCLUDE_DIRECTORIES (${HDF5_TOOLS_SOURCE_DIR}/lib) -INCLUDE_DIRECTORIES (${HDF5_PROJECT_DIR}/test) # -------------------------------------------------------------------- # If testing was NOT enabled, then we need to build the tools library diff --git a/tools/Makefile.in b/tools/Makefile.in index 302a64d..70cc001 100644 --- a/tools/Makefile.in +++ b/tools/Makefile.in @@ -179,6 +179,7 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ +FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ @@ -199,10 +200,12 @@ H5_LONE_COLON = @H5_LONE_COLON@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ +HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ +HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ diff --git a/tools/h5copy/CMakeLists.txt b/tools/h5copy/CMakeLists.txt index b15f5c1..f9e7c12 100644 --- a/tools/h5copy/CMakeLists.txt +++ b/tools/h5copy/CMakeLists.txt @@ -1,11 +1,10 @@ -cmake_minimum_required (VERSION 2.8) +cmake_minimum_required (VERSION 2.8.6) PROJECT (HDF5_TOOLS_H5COPY) #----------------------------------------------------------------------------- # Setup include Directories #----------------------------------------------------------------------------- INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib) -INCLUDE_DIRECTORIES (${HDF5_PROJECT_DIR}/test) # -------------------------------------------------------------------- # Add the h5copy and test executables @@ -13,6 +12,7 @@ INCLUDE_DIRECTORIES (${HDF5_PROJECT_DIR}/test) ADD_EXECUTABLE (h5copy ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/h5copy.c) TARGET_NAMING (h5copy ${LIB_TYPE}) TARGET_LINK_LIBRARIES (h5copy ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) +SET_TARGET_PROPERTIES (h5copy PROPERTIES FOLDER tools) SET (H5_DEP_EXECUTABLES h5copy) @@ -26,56 +26,56 @@ IF (BUILD_TESTING) IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) ADD_EXECUTABLE (h5copygentest ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/h5copygentest.c) TARGET_NAMING (h5copygentest ${LIB_TYPE}) - TARGET_LINK_LIBRARIES (h5copygentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + TARGET_LINK_LIBRARIES (h5copygentest ${HDF5_LIB_TARGET}) + SET_TARGET_PROPERTIES (h5copygentest PROPERTIES FOLDER generator/tools) #ADD_TEST (NAME h5copygentest COMMAND $) ENDIF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) # -------------------------------------------------------------------- - # Copy all the HDF5 files from the test directory into the source directory + # Copy all the HDF5 files from the source directory into the test directory # -------------------------------------------------------------------- - SET (HDF5_REFERENCE_FILES - h5copy_extlinks_src.out.ls - h5copy_ref.out.ls - h5copytst.out.ls + SET (LIST_HDF5_TEST_FILES + ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copy_extlinks_src.h5 + ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copy_extlinks_trg.h5 + ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copy_ref.h5 + ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copytst.h5 ) - SET (HDF5_REFERENCE_TEST_FILES - h5copy_extlinks_src.h5 - h5copy_extlinks_trg.h5 - h5copy_ref.h5 - h5copytst.h5 - h5copy_misc1.out + + SET (LIST_OTHER_TEST_FILES + ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copy_misc1.out + ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copy_extlinks_src.out.ls + ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copy_ref.out.ls + ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copytst.out.ls ) FILE (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - FOREACH (ls_file ${HDF5_REFERENCE_FILES}) - SET (lsdest "${PROJECT_BINARY_DIR}/testfiles/${ls_file}") - #MESSAGE (STATUS " Translating ${ls_file}") - ADD_CUSTOM_COMMAND ( - TARGET h5copy - POST_BUILD - COMMAND ${XLATE_UTILITY} - ARGS ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/${ls_file} ${lsdest} -l3 - ) - ENDFOREACH (ls_file ${HDF5_REFERENCE_FILES}) - FOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/${h5_file}") - #MESSAGE (STATUS " Copying ${h5_file}") + FOREACH (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) + GET_FILENAME_COMPONENT(fname "${listfiles}" NAME) + SET (dest "${PROJECT_BINARY_DIR}/testfiles/${fname}") + #MESSAGE (STATUS " Copying ${listfiles}") ADD_CUSTOM_COMMAND ( TARGET h5copy POST_BUILD COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/${h5_file} ${dest} + ARGS -E copy_if_different ${listfiles} ${dest} ) - ENDFOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) - - ADD_CUSTOM_COMMAND ( - TARGET h5copy - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copytst.h5 ${PROJECT_BINARY_DIR}/h5copytst.h5 - ) + ENDFOREACH (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) + + # + # This section can be removed, but leave here for a reference later. + # Purpose: '-l3' ignores top 3 lines when copy text file. + # + #FOREACH (listfiles ${LIST_OTHER_TEST_FILES}) + # SET (lsdest "${PROJECT_BINARY_DIR}/testfiles/${listfiles}") + # ADD_CUSTOM_COMMAND ( + # TARGET h5copy + # POST_BUILD + # COMMAND ${XLATE_UTILITY} + # ARGS ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/${listfiles} ${lsdest} -l3 + # ) + #ENDFOREACH (listfiles ${LIST_OTHER_TEST_FILES}) ############################################################################## ############################################################################## @@ -131,10 +131,10 @@ IF (BUILD_TESTING) MACRO (ADD_H5LS_TEST file filetest) # If using memchecker add tests without using scripts IF (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5COPY-H5LS_${file}-${filetest} COMMAND $ -Svr ./testfiles/${file}.out.h5) + ADD_TEST (NAME H5COPY-h5ls_${file}-${filetest} COMMAND $ -Svr ./testfiles/${file}.out.h5) ELSE (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( - NAME H5COPY-H5LS_${file}-${filetest} + NAME H5COPY-h5ls_${file}-${filetest} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" -D "TEST_ARGS=-Svr;./testfiles/${file}.out.h5" @@ -147,9 +147,9 @@ IF (BUILD_TESTING) ) ENDIF (HDF5_ENABLE_USING_MEMCHECKER) IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5COPY-H5LS_${file}-${filetest} PROPERTIES DEPENDS ${last_test}) + SET_TESTS_PROPERTIES (H5COPY-h5ls_${file}-${filetest} PROPERTIES DEPENDS ${last_test}) ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5COPY-H5LS_${file}-${filetest}") + SET (last_test "H5COPY-h5ls_${file}-${filetest}") ENDMACRO (ADD_H5LS_TEST) # @@ -159,7 +159,7 @@ IF (BUILD_TESTING) MACRO (ADD_H5_CMP_TEST testname resultcode infile outfile vparam sparam srcname dparam dstname) # If using memchecker add tests without using scripts IF (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5COPY-CMP-${testname} COMMAND $ -i ${infile} -o ./testfiles/${outfile} ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN}) + ADD_TEST (NAME H5COPY-CMP-${testname} COMMAND $ -i ./testfiles/${infile} -o ./testfiles/${outfile} ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN}) IF (${resultcode} STREQUAL "1") SET_TESTS_PROPERTIES (H5COPY-CMP-${testname} PROPERTIES WILL_FAIL "true") ENDIF (${resultcode} STREQUAL "1") @@ -168,7 +168,7 @@ IF (BUILD_TESTING) NAME H5COPY-CMP-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" - -D "TEST_ARGS=-i;${infile};-o;./testfiles/${outfile};${vparam};${sparam};${srcname};${dparam};${dstname}" + -D "TEST_ARGS=-i;./testfiles/${infile};-o;./testfiles/${outfile};${vparam};${sparam};${srcname};${dparam};${dstname}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -D "TEST_OUTPUT=./testfiles/${testname}.out.out" -D "TEST_EXPECT=${resultcode}" diff --git a/tools/h5copy/Makefile.in b/tools/h5copy/Makefile.in index 5a300aa..b71ee70 100644 --- a/tools/h5copy/Makefile.in +++ b/tools/h5copy/Makefile.in @@ -181,6 +181,7 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ +FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ @@ -201,10 +202,12 @@ H5_LONE_COLON = @H5_LONE_COLON@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ +HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ +HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ diff --git a/tools/h5copy/h5copy.c b/tools/h5copy/h5copy.c index fb8bb81..574ba94 100644 --- a/tools/h5copy/h5copy.c +++ b/tools/h5copy/h5copy.c @@ -55,7 +55,7 @@ static void leave(int ret) { h5tools_close(); - exit(ret); + HDexit(ret); } @@ -75,7 +75,7 @@ leave(int ret) static void usage (void) { - fprintf(stdout, "\ + HDfprintf(stdout, "\ usage: h5copy [OPTIONS] [OBJECTS...]\n\ OBJECTS\n\ -i, --input input file name\n\ @@ -219,6 +219,7 @@ main (int argc, const char *argv[]) h5tools_setprogname(PROGRAMNAME); h5tools_setstatus(EXIT_SUCCESS); + /* initialize h5tools lib */ h5tools_init(); @@ -464,7 +465,7 @@ main (int argc, const char *argv[]) /* free link info path */ if (linkinfo.trg_path) - HDfree(linkinfo.trg_path); + HDfree((char*)linkinfo.trg_path); /* close propertis */ if(H5Pclose(ocpl_id)<0) @@ -496,7 +497,7 @@ error: /* free link info path */ if (linkinfo.trg_path) - HDfree(linkinfo.trg_path); + HDfree((char*)linkinfo.trg_path); H5E_BEGIN_TRY { H5Pclose(ocpl_id); diff --git a/tools/h5copy/h5copygentest.c b/tools/h5copy/h5copygentest.c index f655c39..ee98d7e 100644 --- a/tools/h5copy/h5copygentest.c +++ b/tools/h5copy/h5copygentest.c @@ -19,10 +19,6 @@ #include #include "hdf5.h" #include "H5private.h" -#include "h5tools.h" - -/* Name of tool */ -#define PROGRAMNAME "h5copygentest" /* HDF file names */ #define HDF_FILE1 "h5copytst.h5" @@ -368,7 +364,7 @@ static void gent_empty_group(hid_t loc_id) * Function: gent_nested_datasets * * Purpose: Generate a group in a location and populate it with the "standard" - * datasets + * datasets * *------------------------------------------------------------------------- */ @@ -390,7 +386,7 @@ static void gent_nested_datasets(hid_t loc_id) * Function: gent_nested_group * * Purpose: Generate a group in a location and populate it with another group - * containing the "standard" datasets + * containing the "standard" datasets * *------------------------------------------------------------------------- */ @@ -435,7 +431,7 @@ static herr_t gen_obj_ref(hid_t loc_id) sid = H5Screate_simple(1, dims1, NULL); if (sid < 0) { - fprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", __FUNCTION__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -443,7 +439,7 @@ static herr_t gen_obj_ref(hid_t loc_id) oid = H5Dcreate2 (loc_id, OBJ_REF_DS, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (oid < 0) { - fprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", __FUNCTION__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -451,7 +447,7 @@ static herr_t gen_obj_ref(hid_t loc_id) status = H5Dwrite(oid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data); if (status < 0) { - fprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", __FUNCTION__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -464,7 +460,7 @@ static herr_t gen_obj_ref(hid_t loc_id) oid = H5Gcreate2 (loc_id, OBJ_REF_GRP, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (oid < 0) { - fprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", __FUNCTION__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -473,14 +469,14 @@ static herr_t gen_obj_ref(hid_t loc_id) status = H5Rcreate (&or_data[0], loc_id, OBJ_REF_DS, H5R_OBJECT, -1); if (status < 0) { - fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __FUNCTION__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } status = H5Rcreate (&or_data[1], loc_id, OBJ_REF_GRP, H5R_OBJECT, -1); if (status < 0) { - fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __FUNCTION__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -488,7 +484,7 @@ static herr_t gen_obj_ref(hid_t loc_id) sid = H5Screate_simple (1, dims2, NULL); if (sid < 0) { - fprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", __FUNCTION__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -496,7 +492,7 @@ static herr_t gen_obj_ref(hid_t loc_id) oid = H5Dcreate2 (loc_id, "Dset_OBJREF", H5T_STD_REF_OBJ, sid, H5P_DEFAULT,H5P_DEFAULT,H5P_DEFAULT); if (oid < 0) { - fprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", __FUNCTION__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -504,7 +500,7 @@ static herr_t gen_obj_ref(hid_t loc_id) status = H5Dwrite(oid, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL, H5P_DEFAULT, or_data); if (status < 0) { - fprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", __FUNCTION__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -544,7 +540,7 @@ static herr_t gen_region_ref(hid_t loc_id) sid = H5Screate_simple (2, dims2, NULL); if (sid < 0) { - fprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", __FUNCTION__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -553,7 +549,7 @@ static herr_t gen_region_ref(hid_t loc_id) oid2 = H5Dcreate2 (loc_id, REG_REF_DS2, H5T_STD_I8LE, sid, H5P_DEFAULT,H5P_DEFAULT,H5P_DEFAULT); if (oid2 < 0) { - fprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", __FUNCTION__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -562,7 +558,7 @@ static herr_t gen_region_ref(hid_t loc_id) status = H5Dwrite (oid2, H5T_NATIVE_CHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT, data); if (status < 0) { - fprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", __FUNCTION__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -571,7 +567,7 @@ static herr_t gen_region_ref(hid_t loc_id) status = H5Sselect_elements (sid, H5S_SELECT_SET, 4, coords[0]); if (status < 0) { - fprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", __FUNCTION__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -580,7 +576,7 @@ static herr_t gen_region_ref(hid_t loc_id) status = H5Rcreate (&rr_data[0], loc_id, REG_REF_DS2, H5R_DATASET_REGION, sid); if (status < 0) { - fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __FUNCTION__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -589,7 +585,7 @@ static herr_t gen_region_ref(hid_t loc_id) status = H5Sselect_hyperslab (sid, H5S_SELECT_SET, start, stride, count, block); if (status < 0) { - fprintf(stderr, "Error: %s %d> H5Sselect_hyperslab failed.\n", __FUNCTION__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Sselect_hyperslab failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -598,7 +594,7 @@ static herr_t gen_region_ref(hid_t loc_id) status = H5Rcreate (&rr_data[1], loc_id, REG_REF_DS2, H5R_DATASET_REGION, sid); if (status < 0) { - fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __FUNCTION__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -609,7 +605,7 @@ static herr_t gen_region_ref(hid_t loc_id) sid = H5Screate_simple (1, dims1, NULL); if (sid < 0) { - fprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", __FUNCTION__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -618,7 +614,7 @@ static herr_t gen_region_ref(hid_t loc_id) oid1 = H5Dcreate2 (loc_id, REG_REF_DS1, H5T_STD_REF_DSETREG, sid, H5P_DEFAULT,H5P_DEFAULT,H5P_DEFAULT); if (oid1 < 0) { - fprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", __FUNCTION__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -627,7 +623,7 @@ static herr_t gen_region_ref(hid_t loc_id) status = H5Dwrite (oid1, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT, rr_data); if (status < 0) { - fprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", __FUNCTION__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -754,7 +750,7 @@ static herr_t gen_extlink_trg(hid_t loc_id) gid = H5Gcreate2(loc_id, "group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (gid < 0) { - fprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", __FUNCTION__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -770,7 +766,7 @@ static herr_t gen_extlink_trg(hid_t loc_id) status = H5Tcommit2(loc_id, "datatype", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s %d> H5Tcommit2 failed.\n", __FUNCTION__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Tcommit2 failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -803,7 +799,7 @@ static herr_t gen_extlink_src(hid_t loc_id) gid = H5Gcreate2(loc_id, "/group_ext", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (gid < 0) { - fprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", __FUNCTION__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -815,7 +811,7 @@ static herr_t gen_extlink_src(hid_t loc_id) status = H5Lcreate_external(HDF_EXT_TRG_FILE, "/simple", gid, "extlink_dset", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", __FUNCTION__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -824,7 +820,7 @@ static herr_t gen_extlink_src(hid_t loc_id) status = H5Lcreate_external(HDF_EXT_TRG_FILE, "/group", gid, "extlink_grp", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", __FUNCTION__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -833,7 +829,7 @@ static herr_t gen_extlink_src(hid_t loc_id) status = H5Lcreate_external(HDF_EXT_TRG_FILE, "/datatype", gid, "extlink_datatype", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", __FUNCTION__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -842,7 +838,7 @@ static herr_t gen_extlink_src(hid_t loc_id) status = H5Lcreate_external(HDF_EXT_TRG_FILE, "notyet", gid, "extlink_notyet1", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", __FUNCTION__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -851,7 +847,7 @@ static herr_t gen_extlink_src(hid_t loc_id) status = H5Lcreate_external("notyet_file.h5", "notyet", gid, "extlink_notyet2", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", __FUNCTION__, __LINE__); + fprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -917,9 +913,6 @@ out: int main(void) { - h5tools_setprogname(PROGRAMNAME); - h5tools_setstatus(EXIT_SUCCESS); - Test_Obj_Copy(); Test_Ref_Copy(); Test_Extlink_Copy(); diff --git a/tools/h5copy/testfiles/h5copy_extlinks_src.out.ls b/tools/h5copy/testfiles/h5copy_extlinks_src.out.ls index e0047a7..0134714 100644 --- a/tools/h5copy/testfiles/h5copy_extlinks_src.out.ls +++ b/tools/h5copy/testfiles/h5copy_extlinks_src.out.ls @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5ls ./testfiles/h5copy_extlinks_src.out.h5' -############################# Opened "./testfiles/h5copy_extlinks_src.out.h5" with sec2 driver. / Group Location: 1:96 diff --git a/tools/h5copy/testfiles/h5copy_misc1.out b/tools/h5copy/testfiles/h5copy_misc1.out index 370b1a5..10dd1a6 100644 --- a/tools/h5copy/testfiles/h5copy_misc1.out +++ b/tools/h5copy/testfiles/h5copy_misc1.out @@ -1,3 +1,3 @@ -Copying file and object to file <./testfiles/h5copytst.out.h5> and object +Copying file <./testfiles/h5copytst.h5> and object to file <./testfiles/h5copytst.out.h5> and object Error in copy...Exiting h5copy error: group doesn't exist. Use -p to create parent groups. diff --git a/tools/h5copy/testfiles/h5copy_ref.out.ls b/tools/h5copy/testfiles/h5copy_ref.out.ls index 8549842..0769dc8 100644 --- a/tools/h5copy/testfiles/h5copy_ref.out.ls +++ b/tools/h5copy/testfiles/h5copy_ref.out.ls @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5ls ./testfiles/h5copy_ref.out.h5' -############################# Opened "./testfiles/h5copy_ref.out.h5" with sec2 driver. / Group Location: 1:96 diff --git a/tools/h5copy/testfiles/h5copytst.out.ls b/tools/h5copy/testfiles/h5copytst.out.ls index af6cd8f..62c860b 100644 --- a/tools/h5copy/testfiles/h5copytst.out.ls +++ b/tools/h5copy/testfiles/h5copytst.out.ls @@ -1,62 +1,59 @@ -############################# -Expected output for 'h5ls ./testfiles/h5copytst.out.h5' -############################# Opened "./testfiles/h5copytst.out.h5" with sec2 driver. / Group Location: 1:96 Links: 1 /A Group - Location: 1:90032 + Location: 1:88336 Links: 1 /A/B1 Group - Location: 1:90736 + Location: 1:89040 Links: 1 /A/B1/simple Dataset {6/6} - Location: 1:89904 + Location: 1:88208 Links: 1 Storage:
Type: 32-bit little-endian integer /A/B2 Group - Location: 1:94272 + Location: 1:92576 Links: 1 /A/B2/simple2 Dataset {6/6} - Location: 1:94144 + Location: 1:92448 Links: 1 Storage:
Type: 32-bit little-endian integer /C Group - Location: 1:97480 + Location: 1:95784 Links: 1 /C/D Group - Location: 1:98184 + Location: 1:96488 Links: 1 /C/D/simple Dataset {6/6} - Location: 1:97352 + Location: 1:95656 Links: 1 Storage:
Type: 32-bit little-endian integer /E Group - Location: 1:112096 + Location: 1:110400 Links: 1 /E/F Group - Location: 1:112800 + Location: 1:111104 Links: 1 /E/F/grp_dsets Group - Location: 1:100296 + Location: 1:98600 Links: 1 /E/F/grp_dsets/chunk Dataset {6/6} - Location: 1:104480 + Location: 1:102784 Links: 1 Chunks: {2} 8 bytes Storage:
Type: 32-bit little-endian integer /E/F/grp_dsets/compact Dataset {6/6} - Location: 1:104936 + Location: 1:103240 Links: 1 Storage:
Type: 32-bit little-endian integer /E/F/grp_dsets/compound Dataset {2/2} - Location: 1:105072 + Location: 1:103376 Links: 1 Storage:
Type: struct { @@ -64,60 +61,60 @@ Opened "./testfiles/h5copytst.out.h5" with sec2 driver. "str2" +20 20-byte null-terminated ASCII string } 40 bytes /E/F/grp_dsets/compressed Dataset {6/6} - Location: 1:107384 + Location: 1:105688 Links: 1 Chunks: {2} 8 bytes Storage:
Filter-0: deflate-1 OPT {1} Type: 32-bit little-endian integer /E/F/grp_dsets/named_vl Dataset {2/2} - Location: 1:111696 + Location: 1:109952 Links: 1 Storage:
- Type: shared-1:107552 variable length of + Type: shared-1:110080 variable length of 32-bit little-endian integer /E/F/grp_dsets/nested_vl Dataset {2/2} - Location: 1:111824 + Location: 1:110128 Links: 1 Storage:
Type: variable length of variable length of 32-bit little-endian integer /E/F/grp_dsets/simple Dataset {6/6} - Location: 1:111968 + Location: 1:110272 Links: 1 Storage:
Type: 32-bit little-endian integer /E/F/grp_dsets/vl Type - Location: 1:107552 + Location: 1:110080 Links: 2 - Type: shared-1:107552 variable length of + Type: shared-1:110080 variable length of 32-bit little-endian integer /G Group - Location: 1:127744 + Location: 1:126048 Links: 1 /G/H Group - Location: 1:128448 + Location: 1:126752 Links: 1 /G/H/grp_nested Group - Location: 1:114824 + Location: 1:113128 Links: 1 /G/H/grp_nested/grp_dsets Group - Location: 1:115616 + Location: 1:113920 Links: 1 /G/H/grp_nested/grp_dsets/chunk Dataset {6/6} - Location: 1:119800 + Location: 1:118104 Links: 1 Chunks: {2} 8 bytes Storage:
Type: 32-bit little-endian integer /G/H/grp_nested/grp_dsets/compact Dataset {6/6} - Location: 1:120256 + Location: 1:118560 Links: 1 Storage:
Type: 32-bit little-endian integer /G/H/grp_nested/grp_dsets/compound Dataset {2/2} - Location: 1:120392 + Location: 1:118696 Links: 1 Storage:
Type: struct { @@ -125,34 +122,34 @@ Opened "./testfiles/h5copytst.out.h5" with sec2 driver. "str2" +20 20-byte null-terminated ASCII string } 40 bytes /G/H/grp_nested/grp_dsets/compressed Dataset {6/6} - Location: 1:122704 + Location: 1:121008 Links: 1 Chunks: {2} 8 bytes Storage:
Filter-0: deflate-1 OPT {1} Type: 32-bit little-endian integer /G/H/grp_nested/grp_dsets/named_vl Dataset {2/2} - Location: 1:127016 + Location: 1:125272 Links: 1 Storage:
- Type: shared-1:122872 variable length of + Type: shared-1:125400 variable length of 32-bit little-endian integer /G/H/grp_nested/grp_dsets/nested_vl Dataset {2/2} - Location: 1:127144 + Location: 1:125448 Links: 1 Storage:
Type: variable length of variable length of 32-bit little-endian integer /G/H/grp_nested/grp_dsets/simple Dataset {6/6} - Location: 1:127288 + Location: 1:125592 Links: 1 Storage:
Type: 32-bit little-endian integer /G/H/grp_nested/grp_dsets/vl Type - Location: 1:122872 + Location: 1:125400 Links: 2 - Type: shared-1:122872 variable length of + Type: shared-1:125400 variable length of 32-bit little-endian integer /chunk Dataset {6/6} Location: 1:6312 @@ -181,21 +178,21 @@ Opened "./testfiles/h5copytst.out.h5" with sec2 driver. Filter-0: deflate-1 OPT {1} Type: 32-bit little-endian integer /grp_dsets Group - Location: 1:33856 + Location: 1:32160 Links: 1 /grp_dsets/chunk Dataset {6/6} - Location: 1:38040 + Location: 1:36344 Links: 1 Chunks: {2} 8 bytes Storage:
Type: 32-bit little-endian integer /grp_dsets/compact Dataset {6/6} - Location: 1:38496 + Location: 1:36800 Links: 1 Storage:
Type: 32-bit little-endian integer /grp_dsets/compound Dataset {2/2} - Location: 1:38632 + Location: 1:36936 Links: 1 Storage:
Type: struct { @@ -203,62 +200,62 @@ Opened "./testfiles/h5copytst.out.h5" with sec2 driver. "str2" +20 20-byte null-terminated ASCII string } 40 bytes /grp_dsets/compressed Dataset {6/6} - Location: 1:40944 + Location: 1:39248 Links: 1 Chunks: {2} 8 bytes Storage:
Filter-0: deflate-1 OPT {1} Type: 32-bit little-endian integer /grp_dsets/named_vl Dataset {2/2} - Location: 1:45256 + Location: 1:43512 Links: 1 Storage:
- Type: shared-1:41112 variable length of + Type: shared-1:43640 variable length of 32-bit little-endian integer /grp_dsets/nested_vl Dataset {2/2} - Location: 1:45384 + Location: 1:43688 Links: 1 Storage:
Type: variable length of variable length of 32-bit little-endian integer /grp_dsets/simple Dataset {6/6} - Location: 1:45528 + Location: 1:43832 Links: 1 Storage:
Type: 32-bit little-endian integer /grp_dsets/simple_group Dataset {6/6} - Location: 1:61640 + Location: 1:59944 Links: 1 Storage:
Type: 32-bit little-endian integer /grp_dsets/vl Type - Location: 1:41112 + Location: 1:43640 Links: 2 - Type: shared-1:41112 variable length of + Type: shared-1:43640 variable length of 32-bit little-endian integer /grp_empty Group - Location: 1:33064 + Location: 1:31368 Links: 1 /grp_nested Group - Location: 1:46320 + Location: 1:44624 Links: 1 /grp_nested/grp_dsets Group - Location: 1:47112 + Location: 1:45416 Links: 1 /grp_nested/grp_dsets/chunk Dataset {6/6} - Location: 1:51296 + Location: 1:49600 Links: 1 Chunks: {2} 8 bytes Storage:
Type: 32-bit little-endian integer /grp_nested/grp_dsets/compact Dataset {6/6} - Location: 1:51752 + Location: 1:50056 Links: 1 Storage:
Type: 32-bit little-endian integer /grp_nested/grp_dsets/compound Dataset {2/2} - Location: 1:51888 + Location: 1:50192 Links: 1 Storage:
Type: struct { @@ -266,51 +263,51 @@ Opened "./testfiles/h5copytst.out.h5" with sec2 driver. "str2" +20 20-byte null-terminated ASCII string } 40 bytes /grp_nested/grp_dsets/compressed Dataset {6/6} - Location: 1:54200 + Location: 1:52504 Links: 1 Chunks: {2} 8 bytes Storage:
Filter-0: deflate-1 OPT {1} Type: 32-bit little-endian integer /grp_nested/grp_dsets/named_vl Dataset {2/2} - Location: 1:58512 + Location: 1:56768 Links: 1 Storage:
- Type: shared-1:54368 variable length of + Type: shared-1:56896 variable length of 32-bit little-endian integer /grp_nested/grp_dsets/nested_vl Dataset {2/2} - Location: 1:58640 + Location: 1:56944 Links: 1 Storage:
Type: variable length of variable length of 32-bit little-endian integer /grp_nested/grp_dsets/simple Dataset {6/6} - Location: 1:58784 + Location: 1:57088 Links: 1 Storage:
Type: 32-bit little-endian integer /grp_nested/grp_dsets/vl Type - Location: 1:54368 + Location: 1:56896 Links: 2 - Type: shared-1:54368 variable length of + Type: shared-1:56896 variable length of 32-bit little-endian integer /grp_rename Group - Location: 1:62848 + Location: 1:61152 Links: 1 /grp_rename/chunk Dataset {6/6} - Location: 1:67032 + Location: 1:65336 Links: 1 Chunks: {2} 8 bytes Storage:
Type: 32-bit little-endian integer /grp_rename/compact Dataset {6/6} - Location: 1:67488 + Location: 1:65792 Links: 1 Storage:
Type: 32-bit little-endian integer /grp_rename/compound Dataset {2/2} - Location: 1:67624 + Location: 1:65928 Links: 1 Storage:
Type: struct { @@ -318,28 +315,28 @@ Opened "./testfiles/h5copytst.out.h5" with sec2 driver. "str2" +20 20-byte null-terminated ASCII string } 40 bytes /grp_rename/compressed Dataset {6/6} - Location: 1:69936 + Location: 1:68240 Links: 1 Chunks: {2} 8 bytes Storage:
Filter-0: deflate-1 OPT {1} Type: 32-bit little-endian integer /grp_rename/grp_dsets Group - Location: 1:75728 + Location: 1:74032 Links: 1 /grp_rename/grp_dsets/chunk Dataset {6/6} - Location: 1:79912 + Location: 1:78216 Links: 1 Chunks: {2} 8 bytes Storage:
Type: 32-bit little-endian integer /grp_rename/grp_dsets/compact Dataset {6/6} - Location: 1:80368 + Location: 1:78672 Links: 1 Storage:
Type: 32-bit little-endian integer /grp_rename/grp_dsets/compound Dataset {2/2} - Location: 1:80504 + Location: 1:78808 Links: 1 Storage:
Type: struct { @@ -347,73 +344,73 @@ Opened "./testfiles/h5copytst.out.h5" with sec2 driver. "str2" +20 20-byte null-terminated ASCII string } 40 bytes /grp_rename/grp_dsets/compressed Dataset {6/6} - Location: 1:82816 + Location: 1:81120 Links: 1 Chunks: {2} 8 bytes Storage:
Filter-0: deflate-1 OPT {1} Type: 32-bit little-endian integer /grp_rename/grp_dsets/named_vl Dataset {2/2} - Location: 1:87128 + Location: 1:85384 Links: 1 Storage:
- Type: shared-1:82984 variable length of + Type: shared-1:85512 variable length of 32-bit little-endian integer /grp_rename/grp_dsets/nested_vl Dataset {2/2} - Location: 1:87256 + Location: 1:85560 Links: 1 Storage:
Type: variable length of variable length of 32-bit little-endian integer /grp_rename/grp_dsets/simple Dataset {6/6} - Location: 1:87400 + Location: 1:85704 Links: 1 Storage:
Type: 32-bit little-endian integer /grp_rename/grp_dsets/vl Type - Location: 1:82984 + Location: 1:85512 Links: 2 - Type: shared-1:82984 variable length of + Type: shared-1:85512 variable length of 32-bit little-endian integer /grp_rename/named_vl Dataset {2/2} - Location: 1:74248 + Location: 1:72504 Links: 1 Storage:
- Type: shared-1:70104 variable length of + Type: shared-1:72632 variable length of 32-bit little-endian integer /grp_rename/nested_vl Dataset {2/2} - Location: 1:74376 + Location: 1:72680 Links: 1 Storage:
Type: variable length of variable length of 32-bit little-endian integer /grp_rename/simple Dataset {6/6} - Location: 1:74520 + Location: 1:72824 Links: 1 Storage:
Type: 32-bit little-endian integer /grp_rename/vl Type - Location: 1:70104 + Location: 1:72632 Links: 2 - Type: shared-1:70104 variable length of + Type: shared-1:72632 variable length of 32-bit little-endian integer /named_vl Dataset {2/2} - Location: 1:13200 + Location: 1:19296 Links: 1 Storage:
- Type: shared-1:13152 variable length of + Type: shared-1:19424 variable length of 32-bit little-endian integer /nested_vl Dataset {2/2} - Location: 1:27488 + Location: 1:25792 Links: 1 Storage:
Type: variable length of variable length of 32-bit little-endian integer /rename Dataset {2/2} - Location: 1:31856 + Location: 1:30160 Links: 1 Storage:
Type: struct { @@ -426,7 +423,7 @@ Opened "./testfiles/h5copytst.out.h5" with sec2 driver. Storage:
Type: 32-bit little-endian integer /simple_top Dataset {6/6} - Location: 1:29680 + Location: 1:27984 Links: 1 Storage:
Type: 32-bit little-endian integer diff --git a/tools/h5copy/testh5copy.sh b/tools/h5copy/testh5copy.sh index 3816def..4501e29 100644 --- a/tools/h5copy/testh5copy.sh +++ b/tools/h5copy/testh5copy.sh @@ -19,15 +19,52 @@ # Thursday, July 20, 2006 # +# The build (current) directory might be different than the source directory. +if test -z "$srcdir"; then + srcdir=. +fi + +# source dirs +SRC_TOOLS="$srcdir/.." +SRC_TOOLS_TESTFILES="$SRC_TOOLS/testfiles" +# testfiles source dirs for tools +SRC_H5LS_TESTFILES="$SRC_TOOLS_TESTFILES" +SRC_H5DUMP_TESTFILES="$SRC_TOOLS_TESTFILES" +SRC_H5DIFF_TESTFILES="$SRC_TOOLS/h5diff/testfiles" +SRC_H5COPY_TESTFILES="$SRC_TOOLS/h5copy/testfiles" +SRC_H5REPACK_TESTFILES="$SRC_TOOLS/h5repack/testfiles" +SRC_H5JAM_TESTFILES="$SRC_TOOLS/h5jam/testfiles" +SRC_H5STAT_TESTFILES="$SRC_TOOLS/h5stat/testfiles" +SRC_H5IMPORT_TESTFILES="$SRC_TOOLS/h5import/testfiles" + TESTNAME=h5copy EXIT_SUCCESS=0 EXIT_FAILURE=1 -# Test files -HDF_FILE1=h5copytst.h5 -HDF_FILE2=h5copy_ref.h5 -HDF_EXT_SRC_FILE=h5copy_extlinks_src.h5 -HDF_EXT_TRG_FILE=h5copy_extlinks_trg.h5 +###################################################################### +# test files +# -------------------------------------------------------------------- +# All the test files copy from source directory to test directory +# NOTE: Keep this framework to add/remove test files. +# Any test files from other tools can be used in this framework. +# This list are also used for checking exist. +# Comment '#' without space can be used. +# -------------------------------------------------------------------- +# List of files that will be copied over to local test dir +LIST_HDF5_TEST_FILES=" +$SRC_H5COPY_TESTFILES/h5copytst.h5 +$SRC_H5COPY_TESTFILES/h5copy_ref.h5 +$SRC_H5COPY_TESTFILES/h5copy_extlinks_src.h5 +$SRC_H5COPY_TESTFILES/h5copy_extlinks_trg.h5 +" + +# List of expect files that will be copied over to local test dir +LIST_OTHER_TEST_FILES=" +$SRC_H5COPY_TESTFILES/h5copy_extlinks_src.out.ls +$SRC_H5COPY_TESTFILES/h5copy_ref.out.ls +$SRC_H5COPY_TESTFILES/h5copytst.out.ls +$SRC_H5COPY_TESTFILES/h5copy_misc1.out +" H5COPY=h5copy # The tool name H5COPY_BIN=`pwd`/$H5COPY # The path of the tool binary @@ -38,19 +75,14 @@ H5LS_ARGS=-Svr # Arguments to the h5ls tool H5LS_BIN=`pwd`/../h5ls/$H5LS # The path of the h5ls tool binary CMP='cmp -s' DIFF='diff -c' +CP='cp' nerrors=0 verbose=yes h5haveexitcode=yes # default is yes -# The build (current) directory might be different than the source directory. -if test -z "$srcdir"; then - srcdir=. -fi -INDIR=$srcdir/testfiles -OUTDIR=./testfiles - -test -d $OUTDIR || mkdir $OUTDIR +TESTDIR=./testfiles +test -d $TESTDIR || mkdir $TESTDIR # RUNSERIAL is used. Check if it can return exit code from executalbe correctly. if [ -n "$RUNSERIAL_NOEXITCODE" ]; then @@ -59,6 +91,31 @@ if [ -n "$RUNSERIAL_NOEXITCODE" ]; then h5haveexitcode=no fi +# +# copy test files and expected output files from source dirs to test dir +# +COPY_TESTFILES="$LIST_HDF5_TEST_FILES $LIST_OTHER_TEST_FILES" + +COPY_TESTFILES_TO_TESTDIR() +{ + # copy test files. Used -f to make sure get a new copy + for tstfile in $COPY_TESTFILES + do + # ignore '#' comment + echo $tstfile | tr -d ' ' | grep '^#' > /dev/null + RET=$? + if [ $RET -eq 1 ]; then + if [ -a $tstfile ]; then + $CP -f $tstfile $TESTDIR + else + echo "Error: FAILED to copy $tstfile." + echo " $tstfile doesn't exist!" + exit $EXIT_FAILURE + fi + fi + done +} + # Print a "SKIP" message SKIP() { TESTING $H5COPY $@ @@ -100,6 +157,9 @@ VERIFY_OUTPUT() echo "Verifying output files $* $SPACES" | cut -c1-70 | tr -d '\012' } +# Source in the output filter function definitions. +. $srcdir/../../bin/output_filter.sh + # Run a test and print PASS or *FAIL*. If h5copy can complete # with exit status 0, consider it pass. If a test fails then increment # the `nerrors' global variable. @@ -112,6 +172,8 @@ VERIFY_OUTPUT() TOOLTEST() { + actualout="$TESTDIR/tooltest.actualout" + actualerr="$TESTDIR/tooltest.actualerr" runh5diff=yes if [ "$1" = -i ]; then inputfile=$2 @@ -130,19 +192,19 @@ TOOLTEST() echo " output for '$H5COPY $@'" echo "#############################" $RUNSERIAL $H5COPY_BIN $@ - ) > output.out + ) > $actualout 2> $actualerr RET=$? if [ $RET != 0 ]; then echo "*FAILED*" echo "failed result is:" - cat output.out + cat $actualout nerrors="`expr $nerrors + 1`" else echo " PASSED" # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f output.out + rm -f $actualout $actualerr fi fi @@ -181,9 +243,11 @@ CMP_OUTPUT() TOOLTEST_FAIL() { - expectout="$INDIR/$1" - actualout="$OUTDIR/$1.out" - actualerr="$OUTDIR/$1.err" + expectout="$TESTDIR/$1" + actualout="$TESTDIR/$1.actualout" + actualerr="$TESTDIR/$1.actualerr" + actualout_sav=${actualout}-sav + actualerr_sav=${actualerr}-sav shift if [ "$1" = -i ]; then inputfile=$2 @@ -199,7 +263,13 @@ TOOLTEST_FAIL() #echo "#############################" $RUNSERIAL $H5COPY_BIN $@ ) > $actualout 2> $actualerr + RET=$? + # save actualout and actualerr in case they are needed later. + cp $actualout $actualout_sav + STDOUT_FILTER $actualout + cp $actualerr $actualerr_sav + STDERR_FILTER $actualerr if [ $RET != 0 ]; then echo " PASSED" # Verifying output text from h5copy @@ -219,7 +289,7 @@ TOOLTEST_FAIL() # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actualout $actualerr + rm -f $actualout $actualerr $actualout_sav $actualerr_sav fi } @@ -259,8 +329,8 @@ H5DIFFTEST_FAIL() # H5LSTEST() { - expect="$INDIR/`basename $1 .h5`.ls" - actual="$OUTDIR/`basename $1 .h5`.out" + expect="$TESTDIR/`basename $1 .h5`.ls" + actual="$TESTDIR/`basename $1 .h5`.ls.actualout" # Stderr is included in stdout so that the diff can detect # any unexpected output from that stream too. @@ -269,9 +339,6 @@ H5LSTEST() # so that the output is more portable VERIFY_H5LS $@ ( - echo "#############################" - echo "Expected output for '$H5LS $@'" - echo "#############################" $RUNSERIAL $H5LS_BIN $H5LS_ARGS $@ ) 2>&1 |sed 's/Modified:.*/Modified: XXXX-XX-XX XX:XX:XX XXX/' |sed 's/Storage:.*/Storage:
/' >$actual @@ -302,8 +369,8 @@ H5LSTEST() # COPY_OBJECTS() { - TESTFILE="$INDIR/$HDF_FILE1" - FILEOUT="$OUTDIR/`basename $HDF_FILE1 .h5`.out.h5" + TESTFILE="$TESTDIR/h5copytst.h5" + FILEOUT="$TESTDIR/`basename h5copytst.h5 .h5`.out.h5" # Remove any output file left over from previous test run rm -f $FILEOUT @@ -362,8 +429,8 @@ COPY_OBJECTS() # COPY_REFERENCES() { - TESTFILE="$INDIR/$HDF_FILE2" - FILEOUT="$OUTDIR/`basename $HDF_FILE2 .h5`.out.h5" + TESTFILE="$TESTDIR/h5copy_ref.h5" + FILEOUT="$TESTDIR/`basename h5copy_ref.h5 .h5`.out.h5" # Remove any output file left over from previous test run rm -f $FILEOUT @@ -388,8 +455,8 @@ COPY_REFERENCES() # COPY_EXT_LINKS() { - TESTFILE="$INDIR/$HDF_EXT_SRC_FILE" - FILEOUT="$OUTDIR/`basename $HDF_EXT_SRC_FILE .h5`.out.h5" + TESTFILE="$TESTDIR/h5copy_extlinks_src.h5" + FILEOUT="$TESTDIR/`basename h5copy_extlinks_src.h5 .h5`.out.h5" # Remove any output file left over from previous test run rm -f $FILEOUT @@ -434,8 +501,8 @@ COPY_EXT_LINKS() # TEST_MISC() { - TESTFILE="$HDF_FILE1" - FILEOUT="$OUTDIR/`basename $HDF_FILE1 .h5`.out.h5" + TESTFILE="$TESTDIR/h5copytst.h5" + FILEOUT="$TESTDIR/`basename h5copytst.h5 .h5`.out.h5" # Remove any output file left over from previous test run rm -f $FILEOUT @@ -462,7 +529,10 @@ TEST_MISC() ############################################################################## ### T H E T E S T S ### ############################################################################## +# prepare for test +COPY_TESTFILES_TO_TESTDIR +# Start tests COPY_OBJECTS COPY_REFERENCES COPY_EXT_LINKS @@ -471,8 +541,6 @@ TEST_MISC # Add newline for nicer formatting echo " " -COPYOBJECTS h5copytst_new.h5 - if test $nerrors -eq 0 ; then echo "All $TESTNAME tests passed." exit $EXIT_SUCCESS diff --git a/tools/h5diff/CMakeLists.txt b/tools/h5diff/CMakeLists.txt index 97c3a3c..f178f19 100644 --- a/tools/h5diff/CMakeLists.txt +++ b/tools/h5diff/CMakeLists.txt @@ -1,11 +1,10 @@ -cmake_minimum_required (VERSION 2.8) +cmake_minimum_required (VERSION 2.8.6) PROJECT (HDF5_TOOLS_H5DIFF) #----------------------------------------------------------------------------- # Setup include Directories #----------------------------------------------------------------------------- INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib) -INCLUDE_DIRECTORIES (${HDF5_PROJECT_DIR}/test) # -------------------------------------------------------------------- # Add the h5diff executables @@ -16,9 +15,20 @@ ADD_EXECUTABLE (h5diff ) TARGET_NAMING (h5diff ${LIB_TYPE}) TARGET_LINK_LIBRARIES (h5diff ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) +SET_TARGET_PROPERTIES (h5diff PROPERTIES FOLDER tools) SET (H5_DEP_EXECUTABLES h5diff) +IF (H5_HAVE_PARALLEL) + ADD_EXECUTABLE (ph5diff + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/h5diff_common.c + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/ph5diff_main.c + ) + TARGET_NAMING (ph5diff ${LIB_TYPE}) + TARGET_LINK_LIBRARIES (ph5diff ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) + SET_TARGET_PROPERTIES (ph5diff PROPERTIES FOLDER tools) +ENDIF (H5_HAVE_PARALLEL) + ############################################################################## ############################################################################## ### T E S T I N G ### @@ -32,7 +42,8 @@ IF (BUILD_TESTING) IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) ADD_EXECUTABLE (h5diffgentest ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/h5diffgentest.c) TARGET_NAMING (h5diffgentest ${LIB_TYPE}) - TARGET_LINK_LIBRARIES (h5diffgentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + TARGET_LINK_LIBRARIES (h5diffgentest ${HDF5_LIB_TARGET}) + SET_TARGET_PROPERTIES (h5diffgentest PROPERTIES FOLDER generator/tools) #ADD_TEST (NAME h5diffgentest COMMAND $) ENDIF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) @@ -69,6 +80,10 @@ IF (BUILD_TESTING) h5diff_205.txt h5diff_206.txt h5diff_207.txt + h5diff_208.txt + h5diff_220.txt + h5diff_221.txt + h5diff_222.txt h5diff_21.txt h5diff_22.txt h5diff_23.txt @@ -114,6 +129,11 @@ IF (BUILD_TESTING) h5diff_457.txt h5diff_458.txt h5diff_459.txt + h5diff_465.txt + h5diff_466.txt + h5diff_467.txt + h5diff_468.txt + h5diff_469.txt h5diff_480.txt h5diff_481.txt h5diff_482.txt @@ -148,6 +168,7 @@ IF (BUILD_TESTING) h5diff_517.txt h5diff_518.txt h5diff_530.txt + h5diff_540.txt h5diff_600.txt h5diff_601.txt h5diff_603.txt @@ -175,6 +196,15 @@ IF (BUILD_TESTING) h5diff_627.txt h5diff_628.txt h5diff_629.txt + h5diff_630.txt + h5diff_631.txt + h5diff_640.txt + h5diff_641.txt + h5diff_642.txt + h5diff_643.txt + h5diff_644.txt + h5diff_645.txt + h5diff_646.txt h5diff_70.txt h5diff_700.txt h5diff_701.txt @@ -209,6 +239,8 @@ IF (BUILD_TESTING) h5diff_extlink_trg.h5 h5diff_ext2softlink_src.h5 h5diff_ext2softlink_trg.h5 + h5diff_dset_zero_dim_size1.h5 + h5diff_dset_zero_dim_size2.h5 h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 h5diff_grp_recurse1.h5 @@ -224,6 +256,10 @@ IF (BUILD_TESTING) h5diff_comp_vl_strs.h5 h5diff_attr_v_level1.h5 h5diff_attr_v_level2.h5 + compounds_array_vlen1.h5 + compounds_array_vlen2.h5 + non_comparables1.h5 + non_comparables2.h5 ) FOREACH (txt_file ${HDF5_REFERENCE_FILES}) @@ -317,8 +353,17 @@ IF (BUILD_TESTING) IF (NOT ${resultcode} STREQUAL "0") SET_TESTS_PROPERTIES (H5DIFF-${resultfile} PROPERTIES WILL_FAIL "true") ENDIF (NOT ${resultcode} STREQUAL "0") + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5DIFF-${resultfile} PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + SET (last_test "H5DIFF-${resultfile}") ELSE (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( + NAME H5DIFF-clear-${resultfile}-objects + COMMAND ${CMAKE_COMMAND} + -E remove ${resultfile}.out ${resultfile}.out.err + ) + ADD_TEST ( NAME H5DIFF-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" @@ -330,12 +375,76 @@ IF (BUILD_TESTING) -D "TEST_APPEND=EXIT CODE:" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) + SET_TESTS_PROPERTIES (H5DIFF-${resultfile} PROPERTIES DEPENDS "H5DIFF-clear-${resultfile}-objects") ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + IF (H5_HAVE_PARALLEL) + ADD_PH5_TEST (${resultfile} ${resultcode} ${ARGN}) + ENDIF (H5_HAVE_PARALLEL) + ENDMACRO (ADD_H5_TEST file) + + MACRO (ADD_PH5_TEST resultfile resultcode) + # If using memchecker add tests without using scripts + IF (HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST (NAME PH5DIFF-${resultfile} COMMAND $ ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} ${ARGN}) + IF (NOT ${resultcode} STREQUAL "0") + SET_TESTS_PROPERTIES (PH5DIFF-${resultfile} PROPERTIES WILL_FAIL "true") + ENDIF (NOT ${resultcode} STREQUAL "0") + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (PH5DIFF-${resultfile} PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + SET (last_test "PH5DIFF-${resultfile}") + ELSE (HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST ( + NAME PH5DIFF-clear-${resultfile}-objects + COMMAND ${CMAKE_COMMAND} + -E remove ${resultfile}_p.out ${resultfile}_p.out.err + ) + ADD_TEST ( + NAME PH5DIFF-${resultfile} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=${MPIEXEC};${MPIEXEC_PREFLAGS};${MPIEXEC_NUMPROC_FLAG};${MPIEXEC_MAX_NUMPROCS};${MPIEXEC_POSTFLAGS};$" + -D "TEST_ARGS:STRING=${ARGN}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_OUTPUT=P_${resultfile}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=${resultfile}.txt" +# -D "TEST_APPEND=EXIT CODE: [0-9]" +# -D "TEST_REF_FILTER=EXIT CODE: 0" + -D "TEST_SKIP_COMPARE=TRUE" + -P "${HDF5_RESOURCES_DIR}/prunTest.cmake" + ) + SET_TESTS_PROPERTIES (PH5DIFF-${resultfile} PROPERTIES DEPENDS "PH5DIFF-clear-${resultfile}-objects") + ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + ENDMACRO (ADD_PH5_TEST file) + + # ADD_H5_NO_OUTPUT_TEST + # Purpose to verify only exitcode without output comparison + # Don't use this if possible; this may be removed. + MACRO (ADD_H5_NO_OUTPUT_TEST testname resultcode) + # If using memchecker add tests without using scripts + IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST ( + NAME H5DIFF-clear-${testname}-objects + COMMAND ${CMAKE_COMMAND} + -E remove ${testname}.out ${testname}.out.err + ) + # if there was a previous test + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5DIFF-clear-${testname}-objects PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + SET (last_test "H5DIFF-clear-${testname}-objects") + ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + + ADD_TEST (NAME H5DIFF-${testname} COMMAND $ ${ARGN}) + IF (NOT ${resultcode} STREQUAL "0") + SET_TESTS_PROPERTIES (H5DIFF-${testname} PROPERTIES WILL_FAIL "true") + ENDIF (NOT ${resultcode} STREQUAL "0") + IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DIFF-${resultfile} PROPERTIES DEPENDS ${last_test}) + SET_TESTS_PROPERTIES (H5DIFF-${testname} PROPERTIES DEPENDS ${last_test}) ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5DIFF-${resultfile}") - ENDMACRO (ADD_H5_TEST file) + SET (last_test "H5DIFF-${testname}") + ENDMACRO (ADD_H5_NO_OUTPUT_TEST) ############################################################################## ############################################################################## @@ -364,6 +473,8 @@ IF (BUILD_TESTING) SET (FILE16 h5diff_extlink_trg.h5) SET (FILE17 h5diff_ext2softlink_src.h5) SET (FILE18 h5diff_ext2softlink_trg.h5) + SET (FILE19 h5diff_dset_zero_dim_size1.h5) + SET (FILE20 h5diff_dset_zero_dim_size2.h5) SET (DANGLE_LINK_FILE1 h5diff_danglelinks1.h5) SET (DANGLE_LINK_FILE2 h5diff_danglelinks2.h5) SET (GRP_RECURSE_FILE1 h5diff_grp_recurse1.h5) @@ -381,13 +492,16 @@ IF (BUILD_TESTING) SET (EXCLUDE_FILE2_2 h5diff_exclude2-2.h5) # compound type with multiple vlen string types SET (COMP_VL_STRS_FILE h5diff_comp_vl_strs.h5) + # container types (array,vlen) with multiple nested compound types + SET (COMPS_ARRAY_VLEN_FILE1 compounds_array_vlen1.h5) + SET (COMPS_ARRAY_VLEN_FILE2 compounds_array_vlen2.h5) # attrs with verbose option level SET (ATTR_VERBOSE_LEVEL_FILE1 h5diff_attr_v_level1.h5) SET (ATTR_VERBOSE_LEVEL_FILE2 h5diff_attr_v_level2.h5) - - # Remove any output file left over from previous test run - ADD_TEST ( + IF (HDF5_ENABLE_USING_MEMCHECKER) + # Remove any output file left over from previous test run + ADD_TEST ( NAME H5DIFF-clearall-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -447,6 +561,14 @@ IF (BUILD_TESTING) h5diff_206.out.err h5diff_207.out h5diff_207.out.err + h5diff_208.out + h5diff_208.out.err + h5diff_220.out + h5diff_220.out.err + h5diff_221.out + h5diff_221.out.err + h5diff_222.out + h5diff_222.out.err h5diff_21.out h5diff_21.out.err h5diff_22.out @@ -537,6 +659,16 @@ IF (BUILD_TESTING) h5diff_458.out.err h5diff_459.out h5diff_459.out.err + h5diff_465.out + h5diff_465.out.err + h5diff_466.out + h5diff_466.out.err + h5diff_467.out + h5diff_467.out.err + h5diff_468.out + h5diff_468.out.err + h5diff_469.out + h5diff_469.out.err h5diff_480.out h5diff_480.out.err h5diff_481.out @@ -605,6 +737,8 @@ IF (BUILD_TESTING) h5diff_518.out.err h5diff_530.out h5diff_530.out.err + h5diff_540.out + h5diff_540.out.err h5diff_600.out h5diff_600.out.err h5diff_601.out @@ -659,6 +793,20 @@ IF (BUILD_TESTING) h5diff_628.out.err h5diff_629.out h5diff_629.out.err + h5diff_640.out + h5diff_640.out.err + h5diff_641.out + h5diff_641.out.err + h5diff_642.out + h5diff_642.out.err + h5diff_643.out + h5diff_643.out.err + h5diff_644.out + h5diff_644.out.err + h5diff_645.out + h5diff_645.out.err + h5diff_646.out + h5diff_646.out.err h5diff_70.out h5diff_70.out.err h5diff_700.out @@ -687,11 +835,12 @@ IF (BUILD_TESTING) h5diff_80.out.err h5diff_90.out h5diff_90.out.err - ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DIFF-clearall-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5DIFF-clearall-objects") + ) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5DIFF-clearall-objects PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + SET (last_test "H5DIFF-clearall-objects") + ENDIF (HDF5_ENABLE_USING_MEMCHECKER) # ############################################################################ # # Common usage @@ -728,10 +877,10 @@ ADD_H5_TEST (h5diff_16_3 1 -v -p 0.02 ${FILE1} ${FILE1} g1/dset9 g1/dset10) ADD_H5_TEST (h5diff_17 1 -v ${FILE1} ${FILE2}) # 1.7 test 32-bit INFINITY -ADD_H5_TEST (h5diff_171 0 -v ${FILE1} ${FILE1} /g1/fp19) +ADD_H5_TEST (h5diff_171 0 -v ${FILE1} ${FILE1} /g1/fp19 /g1/fp19_COPY) # 1.7 test 64-bit INFINITY -ADD_H5_TEST (h5diff_172 0 -v ${FILE1} ${FILE1} /g1/fp20) +ADD_H5_TEST (h5diff_172 0 -v ${FILE1} ${FILE1} /g1/fp20 /g1/fp20_COPY) # 1.8 quiet mode ADD_H5_TEST (h5diff_18 1 -q ${FILE1} ${FILE2}) @@ -739,7 +888,6 @@ ADD_H5_TEST (h5diff_18 1 -q ${FILE1} ${FILE2}) # 1.8 -v and -q ADD_H5_TEST (h5diff_18_1 2 -v -q ${FILE1} ${FILE2}) - # ############################################################################## # # not comparable types # ############################################################################## @@ -775,8 +923,6 @@ ADD_H5_TEST (h5diff_27 1 -v ${FILE3} ${FILE3} t1 t2) # 2.8 ADD_H5_TEST (h5diff_28 1 -v ${FILE3} ${FILE3} l1 l2) - - # ############################################################################## # # Dataset datatypes # ############################################################################## @@ -812,19 +958,16 @@ ADD_H5_TEST (h5diff_58 1 -v ${FILE7} ${FILE8} refreg) # # Error messages # ############################################################################## - # 6.0: Check if the command line number of arguments is less than 3 ADD_H5_TEST (h5diff_600 1 ${FILE1}) # 6.1: Check if non-exist object name is specified ADD_H5_TEST (h5diff_601 2 ${FILE1} ${FILE1} nono_obj) - # ############################################################################## # # -d # ############################################################################## - # 6.3: negative value ADD_H5_TEST (h5diff_603 1 -d -4 ${FILE1} ${FILE2} g1/dset3 g1/dset4) @@ -877,7 +1020,6 @@ ADD_H5_TEST (h5diff_618 0 -p 2 ${FILE1} ${FILE2} g1/dset3 g1/dset4) # 6.19: number smaller than smallest difference ADD_H5_TEST (h5diff_619 1 -p 0.005 ${FILE1} ${FILE2} g1/dset3 g1/dset4) - # ############################################################################## # # -n # ############################################################################## @@ -911,6 +1053,13 @@ ADD_H5_TEST (h5diff_628 1 -n 1 ${FILE1} ${FILE2} g1/dset3 g1/dset4) #ADD_H5_TEST (h5diff_629 2 file1.h6 file2.h6) # ############################################################################## +# # NaN +# ############################################################################## +# 6.30: test (NaN == NaN) must be true based on our documentation -- XCAO +ADD_H5_TEST (h5diff_630 0 -v -d "0.0001" ${FILE1} ${FILE1} g1/fp18 g1/fp18_COPY) +ADD_H5_TEST (h5diff_631 0 -v --use-system-epsilon ${FILE1} ${FILE1} g1/fp18 g1/fp18_COPY) + +# ############################################################################## # 7. attributes # ############################################################################## ADD_H5_TEST (h5diff_70 1 -v ${FILE5} ${FILE6}) @@ -944,8 +1093,6 @@ ADD_H5_TEST (h5diff_709 0 -v2 ${ATTR_VERBOSE_LEVEL_FILE1} ${ATTR_VERBOSE_LEVEL_F # file vs file ADD_H5_TEST (h5diff_710 1 -v2 ${ATTR_VERBOSE_LEVEL_FILE1} ${ATTR_VERBOSE_LEVEL_FILE2}) - - # ############################################################################## # 8. all dataset datatypes # ############################################################################## @@ -988,12 +1135,27 @@ ADD_H5_TEST (h5diff_204 0 -c ${FILE2} ${FILE2} g2/dset4 g2/dset5) ADD_H5_TEST (h5diff_205 0 -c ${FILE2} ${FILE2} g2/dset5 g2/dset6) - # not comparable in compound ADD_H5_TEST (h5diff_206 0 -c ${FILE2} ${FILE2} g2/dset7 g2/dset8) ADD_H5_TEST (h5diff_207 0 -c ${FILE2} ${FILE2} g2/dset8 g2/dset9) +# not comparable in dataspace of zero dimension size +ADD_H5_TEST (h5diff_208 0 -c ${FILE19} ${FILE20}) + +# non-comparable dataset with comparable attribute, and other comparable datasets. +# All the rest comparables should display differences. +ADD_H5_TEST (h5diff_220 1 -c non_comparables1.h5 non_comparables2.h5 /g1) + +# comparable dataset with non-comparable attribute and other comparable attributes. +# Also test non-compatible attributes with different type, dimention, rank. +# All the rest comparables should display differences. +ADD_H5_TEST (h5diff_221 1 -c non_comparables1.h5 non_comparables2.h5 /g2) + +# entire file +# All the rest comparables should display differences +ADD_H5_TEST (h5diff_222 1 -c non_comparables1.h5 non_comparables2.h5) + # ############################################################################## # # Links compare without --follow-symlinks nor --no-dangling-links # ############################################################################## @@ -1081,7 +1243,6 @@ ADD_H5_TEST (h5diff_424 1 --follow-symlinks -v ${FILE18} ${FILE17} /dset2 /ext_l # extlink_to_softlink_to_dset1 vs extlink_to_softlink_to_dset2" ADD_H5_TEST (h5diff_425 1 --follow-symlinks -v ${FILE17} ${FILE17} /ext_link_to_slink1 /ext_link_to_slink2) - # ############################################################################## # # Dangling links compare (--follow-symlinks and --no-dangling-links) # ############################################################################## @@ -1115,6 +1276,19 @@ ADD_H5_TEST (h5diff_458 2 --follow-symlinks -v --no-dangling-links ${FILE15} $ # dangling link found for ext links (obj to obj). Both dangle links ADD_H5_TEST (h5diff_459 2 --follow-symlinks -v --no-dangling-links ${FILE15} ${FILE15} /ext_link_noexist1 /ext_link_noexist2) +# dangling link --follow-symlinks (obj vs obj) +# (HDFFV-7836) +ADD_H5_TEST (h5diff_465 0 --follow-symlinks h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /soft_link1) +# (HDFFV-7835) +# soft dangling vs. soft dangling +ADD_H5_TEST (h5diff_466 0 -v --follow-symlinks h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /soft_link1) +# soft link vs. soft dangling +ADD_H5_TEST (h5diff_467 1 -v --follow-symlinks h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /soft_link2) +# ext dangling vs. ext dangling +ADD_H5_TEST (h5diff_468 0 -v --follow-symlinks h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /ext_link4) +# ext link vs. ext dangling +ADD_H5_TEST (h5diff_469 1 -v --follow-symlinks h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /ext_link2) + # ############################################################################## # # test for group diff recursivly # ############################################################################## @@ -1163,7 +1337,6 @@ ADD_H5_TEST (h5diff_516 0 -v --follow-symlinks ${GRP_RECURSE1_EXT} ${GRP_RECURSE ADD_H5_TEST (h5diff_517 1 -v ${GRP_RECURSE1_EXT} ${GRP_RECURSE2_EXT1} /g1) ADD_H5_TEST (h5diff_518 0 -v --follow-symlinks ${GRP_RECURSE1_EXT} ${GRP_RECURSE2_EXT1} /g1) - # ############################################################################## # # Exclude path (--exclude-path) # ############################################################################## @@ -1189,9 +1362,27 @@ ADD_H5_TEST (h5diff_484 0 -v --exclude-path "/dset3" ${EXCLUDE_FILE1_1} ${EXCLUD # ############################################################################## # # diff various multiple vlen and fixed strings in a compound type dataset # ############################################################################## -ADD_H5_TEST (h5diff_530 0 -v ${COMP_VL_STRS_FILE} ${COMP_VL_STRS_FILE}) +ADD_H5_TEST (h5diff_530 0 -v ${COMP_VL_STRS_FILE} ${COMP_VL_STRS_FILE} /group /group_copy) - +# ############################################################################## +# # Test container types (array,vlen) with multiple nested compound types +# # Complex compound types in dataset and attribute +# ############################################################################## +ADD_H5_TEST (h5diff_540 1 -v ${COMPS_ARRAY_VLEN_FILE1} ${COMPS_ARRAY_VLEN_FILE2}) + +# ############################################################################## +# # Test mutually exclusive options +# ############################################################################## +# +# Test with -d , -p and --use-system-epsilon. +ADD_H5_TEST (h5diff_640 1 -v -d 5 -p 0.05 --use-system-epsilon ${FILE1} ${FILE2} /g1/dset3 /g1/dset4) +ADD_H5_TEST (h5diff_641 1 -v -d 5 -p 0.05 ${FILE1} ${FILE2} /g1/dset3 /g1/dset4) +ADD_H5_TEST (h5diff_642 1 -v -p 0.05 -d 5 ${FILE1} ${FILE2} /g1/dset3 /g1/dset4) +ADD_H5_TEST (h5diff_643 1 -v -d 5 --use-system-epsilon ${FILE1} ${FILE2} /g1/dset3 /g1/dset4) +ADD_H5_TEST (h5diff_644 1 -v --use-system-epsilon -d 5 ${FILE1} ${FILE2} /g1/dset3 /g1/dset4) +ADD_H5_TEST (h5diff_645 1 -v -p 0.05 --use-system-epsilon ${FILE1} ${FILE2} /g1/dset3 /g1/dset4) +ADD_H5_TEST (h5diff_646 1 -v --use-system-epsilon -p 0.05 ${FILE1} ${FILE2} /g1/dset3 /g1/dset4) + ENDIF (BUILD_TESTING) ############################################################################## @@ -1211,3 +1402,14 @@ INSTALL ( COMPONENT toolsapplications ) + +IF (H5_HAVE_PARALLEL) + INSTALL ( + TARGETS + ph5diff + RUNTIME DESTINATION + ${HDF5_INSTALL_BIN_DIR}/tools + COMPONENT + toolsapplications + ) +ENDIF (H5_HAVE_PARALLEL) diff --git a/tools/h5diff/Makefile.in b/tools/h5diff/Makefile.in index 55d7802..25884b2 100644 --- a/tools/h5diff/Makefile.in +++ b/tools/h5diff/Makefile.in @@ -188,6 +188,7 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ +FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ @@ -208,10 +209,12 @@ H5_LONE_COLON = @H5_LONE_COLON@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ +HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ +HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ diff --git a/tools/h5diff/h5diff_common.c b/tools/h5diff/h5diff_common.c index fd679d3..b8e46f3 100644 --- a/tools/h5diff/h5diff_common.c +++ b/tools/h5diff/h5diff_common.c @@ -17,6 +17,7 @@ #include #include "h5diff.h" #include "h5diff_common.h" +#include "h5tools.h" #include "h5tools_utils.h" static int check_n_input( const char* ); @@ -46,6 +47,31 @@ static struct long_options l_opts[] = { { NULL, 0, '\0' } }; +/*------------------------------------------------------------------------- + * Function: check_options + * + * Purpose: parse command line input + * + *------------------------------------------------------------------------- + */ +static void check_options(diff_opt_t* options) +{ + /*-------------------------------------------------------------- + * check for mutually exclusive options + *--------------------------------------------------------------*/ + + /* check between -d , -p, --use-system-epsilon. + * These options are mutually exclusive. + */ + if ((options->d + options->p + options->use_system_epsilon) > 1) + { + printf("%s error: -d, -p and --use-system-epsilon options are mutually-exclusive;\n", PROGRAMNAME); + printf("use no more than one.\n"); + printf("Try '-h' or '--help' option for more information or see the %s entry in the 'HDF5 Reference Manual'.\n", PROGRAMNAME); + h5diff_exit(EXIT_FAILURE); + } +} + /*------------------------------------------------------------------------- * Function: parse_command_line @@ -104,27 +130,27 @@ void parse_command_line(int argc, * short opt */ if (!strcmp (argv[i], "-v")) /* no arg */ - { + { opt_ind--; options->m_verbose_level = 0; break; - } + } else if (!strncmp (argv[i], "-v", 2)) - { + { options->m_verbose_level = atoi(&argv[i][2]); break; - } + } /* * long opt */ if (!strcmp (argv[i], "--verbose")) /* no arg */ - { + { options->m_verbose_level = 0; break; - } - else if ( !strncmp (argv[i], "--verbose", 9) && argv[i][9]=='=') - { + } + else if ( !strncmp (argv[i], "--verbose", 9) && argv[i][9]=='=') + { options->m_verbose_level = atoi(&argv[i][10]); break; } @@ -154,7 +180,7 @@ void parse_command_line(int argc, } /* init */ - exclude_node->obj_path = opt_arg; + exclude_node->obj_path = (char*)opt_arg; exclude_node->obj_type = H5TRAV_TYPE_UNKNOWN; exclude_prev = exclude_head; @@ -231,14 +257,13 @@ void parse_command_line(int argc, } } + /* check options */ + check_options(options); + /* if exclude-path option is used, keep the exclude path list */ if (options->exclude_path) options->exclude = exclude_head; - /* if use system epsilon, unset -p and -d option */ - if (options->use_system_epsilon) - options->d = options->p = 0; - /* check for file names to be processed */ if (argc <= opt_ind || argv[ opt_ind + 1 ] == NULL) { @@ -297,7 +322,10 @@ void parse_command_line(int argc, printf("--------------------------------\n"); printf("Some objects are not comparable\n"); printf("--------------------------------\n"); - printf("Use -c for a list of objects.\n"); + if (options->m_verbose) + printf("Use -c for a list of objects without details of differences.\n"); + else + printf("Use -c for a list of objects.\n"); } @@ -424,97 +452,98 @@ check_d_input( const char *str ) void usage(void) { printf("usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] \n"); - printf(" file1 File name of the first HDF5 file\n"); - printf(" file2 File name of the second HDF5 file\n"); - printf(" [obj1] Name of an HDF5 object, in absolute path\n"); - printf(" [obj2] Name of an HDF5 object, in absolute path\n"); + printf(" file1 File name of the first HDF5 file\n"); + printf(" file2 File name of the second HDF5 file\n"); + printf(" [obj1] Name of an HDF5 object, in absolute path\n"); + printf(" [obj2] Name of an HDF5 object, in absolute path\n"); printf("\n"); printf(" OPTIONS\n"); - printf(" -h, --help Print a usage message and exit.\n"); - printf(" -V, --version Print version number and exit.\n"); - printf(" -r, --report Report mode. Print differences.\n"); - printf(" -v --verbose Verbose mode. Print differences information and list\n"); - printf(" of objects.\n"); - printf(" -vN --verbose=N Verbose mode with level. Print differences and list\n"); - printf(" of objects.\n"); - printf(" Level of detail depends on value of N:\n"); - printf(" 0 : Identical to '-v' or '--verbose'.\n"); - printf(" 1 : All level 0 information plus one-line attribute\n"); - printf(" status summary.\n"); - printf(" 2 : All level 1 information plus extended attribute\n"); - printf(" status report.\n"); - printf(" -q, --quiet Quiet mode. Do not produce output.\n"); - printf(" --follow-symlinks Follow symbolic links (soft links and external links)\n"); - printf(" and compare the links' target objects.\n"); - printf(" If symbolic link(s) with the same name exist in the\n"); - printf(" files being compared, then determine whether the \n"); - printf(" target of each link is an existing object (dataset,\n"); - printf(" group, or named datatype) or the link is a dangling\n"); - printf(" link (a soft or external link pointing to a target\n"); - printf(" object that does not yet exist).\n"); - printf(" - If both symbolic links are dangling links, they\n"); - printf(" are treated as being the same; by default, h5diff\n"); - printf(" returns an exit code of 0. If, however, \n"); - printf(" --no-dangling-links is used with --follow-symlinks,\n"); - printf(" this situation is treated as an error and h5diff \n"); - printf(" returns an exit code of 2.\n"); - printf(" - If only one of the two links is a dangling link,\n"); - printf(" they are treated as being different and h5diff \n"); - printf(" returns an exit code of 1. If, however, \n"); - printf(" --no-dangling-links is used with --follow-symlinks,\n"); - printf(" this situation is treated as an error and h5diff \n"); - printf(" returns an exit code of 2.\n"); - printf(" - If both symbolic links point to existing objects,\n"); - printf(" h5diff compares the two objects.\n"); - printf(" If any symbolic link specified in the call to h5diff\n"); - printf(" does not exist, h5diff treats it as an error and\n"); - printf(" returns an exit code of 2.\n"); - printf(" --no-dangling-links Must be used with --follow-symlinks option;\n"); - printf(" otherwise, h5diff shows error message and returns\n"); - printf(" an exit code of 2.\n"); - printf(" Check for any symbolic links (soft links or external\n"); - printf(" links) that do not resolve to an existing object\n"); - printf(" (dataset, group, or named datatype). If any\n"); - printf(" dangling link is found, this situation is treated as\n"); - printf(" an error and h5diff returns an exit code of 2.\n"); - printf(" -c, --compare List objects that are not comparable\n"); - printf(" -N, --nan Avoid NaNs detection\n"); - printf(" -n C, --count=C Print differences up to C number, C is a positive\n"); - printf(" integer.\n"); - printf(" -d D, --delta=D Print difference if (|a-b| > D), D is a positive\n"); - printf(" number.\n"); - printf(" -p R, --relative=R Print difference if (|(a-b)/b| > R), R is a positive\n"); - printf(" number.\n"); - printf(" --use-system-epsilon Print difference if (|a-b| > EPSILON), EPSILON is\n"); - printf(" a system epsilon value.\n"); - printf(" If the system epsilon is not defined, the below\n"); - printf(" one of the following predefined values will be used:\n"); - printf(" FLT_EPSILON = 1.19209E-07 for floating-point type\n"); - printf(" DBL_EPSILON = 2.22045E-16 for double percision type\n"); - printf(" --exclude-path \"path\" Exclude the specified path to an object when\n"); - printf(" comparing files or groups. If a group is excluded,\n"); - printf(" all member objects will also be excluded.\n"); - printf(" The specified path is excluded wherever it occurs.\n"); - printf(" This flexibility enables the same option to exclude\n"); - printf(" either objects that exist only in one file or\n"); - printf(" common objects that are known to differ.\n"); + printf(" -h, --help\n"); + printf(" Print a usage message and exit.\n"); + printf(" -V, --version\n"); + printf(" Print version number and exit.\n"); + printf(" -r, --report\n"); + printf(" Report mode. Print differences.\n"); + printf(" -v --verbose\n"); + printf(" Verbose mode. Print differences information and list of objects.\n"); + printf(" -vN --verbose=N\n"); + printf(" Verbose mode with level. Print differences and list of objects.\n"); + printf(" Level of detail depends on value of N:\n"); + printf(" 0 : Identical to '-v' or '--verbose'.\n"); + printf(" 1 : All level 0 information plus one-line attribute\n"); + printf(" status summary.\n"); + printf(" 2 : All level 1 information plus extended attribute\n"); + printf(" status report.\n"); + printf(" -q, --quiet\n"); + printf(" Quiet mode. Do not produce output.\n"); + printf(" --follow-symlinks\n"); + printf(" Follow symbolic links (soft links and external links and compare the)\n"); + printf(" links' target objects.\n"); + printf(" If symbolic link(s) with the same name exist in the files being\n"); + printf(" compared, then determine whether the target of each link is an existing\n"); + printf(" object (dataset, group, or named datatype) or the link is a dangling\n"); + printf(" link (a soft or external link pointing to a target object that does\n"); + printf(" not yet exist).\n"); + printf(" - If both symbolic links are dangling links, they are treated as being\n"); + printf(" the same; by default, h5diff returns an exit code of 0.\n"); + printf(" If, however, --no-dangling-links is used with --follow-symlinks,\n"); + printf(" this situation is treated as an error and h5diff returns an\n"); + printf(" exit code of 2.\n"); + printf(" - If only one of the two links is a dangling link,they are treated as\n"); + printf(" being different and h5diff returns an exit code of 1.\n"); + printf(" If, however, --no-dangling-links is used with --follow-symlinks,\n"); + printf(" this situation is treated as an error and h5diff returns an\n"); + printf(" exit code of 2.\n"); + printf(" - If both symbolic links point to existing objects, h5diff compares the\n"); + printf(" two objects.\n"); + printf(" If any symbolic link specified in the call to h5diff does not exist,\n"); + printf(" h5diff treats it as an error and returns an exit code of 2.\n"); + printf(" --no-dangling-links\n"); + printf(" Must be used with --follow-symlinks option; otherwise, h5diff shows\n"); + printf(" error message and returns an exit code of 2.\n"); + printf(" Check for any symbolic links (soft links or external links) that do not\n"); + printf(" resolve to an existing object (dataset, group, or named datatype).\n"); + printf(" If any dangling link is found, this situation is treated as an error\n"); + printf(" and h5diff returns an exit code of 2.\n"); + printf(" -c, --compare\n"); + printf(" List objects that are not comparable\n"); + printf(" -N, --nan\n"); + printf(" Avoid NaNs detection\n"); + printf(" -n C, --count=C\n"); + printf(" Print differences up to C. C must be a positive integer.\n"); + printf(" -d D, --delta=D\n"); + printf(" Print difference if (|a-b| > D). D must be a positive number.\n"); + printf(" Can not use with '-p' or '--use-system-epsilon'.\n"); + printf(" -p R, --relative=R\n"); + printf(" Print difference if (|(a-b)/b| > R). R must be a positive number.\n"); + printf(" Can not use with '-d' or '--use-system-epsilon'.\n"); + printf(" --use-system-epsilon\n"); + printf(" Print difference if (|a-b| > EPSILON), EPSILON is system defined value.\n"); + printf(" If the system epsilon is not defined,one of the following predefined\n"); + printf(" values will be used:\n"); + printf(" FLT_EPSILON = 1.19209E-07 for floating-point type\n"); + printf(" DBL_EPSILON = 2.22045E-16 for double precision type\n"); + printf(" Can not use with '-p' or '-d'.\n"); + printf(" --exclude-path \"path\" \n"); + printf(" Exclude the specified path to an object when comparing files or groups.\n"); + printf(" If a group is excluded, all member objects will also be excluded.\n"); + printf(" The specified path is excluded wherever it occurs.\n"); + printf(" This flexibility enables the same option to exclude either objects that\n"); + printf(" exist only in one file or common objects that are known to differ.\n"); printf("\n"); - printf(" When comparing files, \"path\" is the absolute path to\n"); - printf(" the excluded object; when comparing groups, \"path\" is\n"); - printf(" similar to the relative path from the group to the\n"); - printf(" excluded object. This \"path\" can be taken from the\n"); - printf(" first section of the output of the --verbose option.\n"); - printf(" For example, if you are comparing the group /groupA\n"); - printf(" in two files and you want to exclude\n"); - printf(" /groupA/groupB/groupC in both files, the exclude\n"); - printf(" option would read as follows:\n"); - printf(" --exclude-path \"/groupB/groupC\"\n"); + printf(" When comparing files, \"path\" is the absolute path to the excluded;\n"); + printf(" object; when comparing groups, \"path\" is similar to the relative\n"); + printf(" path from the group to the excluded object. This \"path\" can be\n"); + printf(" taken from the first section of the output of the --verbose option.\n"); + printf(" For example, if you are comparing the group /groupA in two files and\n"); + printf(" you want to exclude /groupA/groupB/groupC in both files, the exclude\n"); + printf(" option would read as follows:\n"); + printf(" --exclude-path \"/groupB/groupC\"\n"); printf("\n"); - printf(" If there are multiple paths to an object, only the\n"); - printf(" specified path(s) will be excluded; the comparison\n"); - printf(" will include any path not explicitly excluded.\n"); - printf(" This option can be used repeatedly to exclude\n"); - printf(" multiple paths.\n"); + printf(" If there are multiple paths to an object, only the specified path(s)\n"); + printf(" will be excluded; the comparison will include any path not explicitly\n"); + printf(" excluded.\n"); + printf(" This option can be used repeatedly to exclude multiple paths.\n"); printf("\n"); printf(" Modes of output:\n"); @@ -567,35 +596,3 @@ void usage(void) printf(" '/g1/dset1' and '/g1/dset2' in the same file\n"); printf("\n"); } - - -/*------------------------------------------------------------------------- - * Function: h5diff_exit - * - * Purpose: dismiss phdiff worker processes and exit - * - * Return: none - * - * Programmer: Albert Cheng - * Date: Feb 6, 2005 - * - * Comments: - * - * Modifications: - * - *------------------------------------------------------------------------- - */ -void h5diff_exit(int status) -{ -#ifdef H5_HAVE_PARALLEL - /* if in parallel mode, dismiss workers, close down MPI, then exit */ - if((g_nTasks > 1) && g_Parallel) { - phdiff_dismiss_workers(); - MPI_Barrier(MPI_COMM_WORLD); - } - if(g_Parallel) - MPI_Finalize(); -#endif - exit(status); -} - diff --git a/tools/h5diff/h5diff_common.h b/tools/h5diff/h5diff_common.h index 5a601df..5b1317f 100644 --- a/tools/h5diff/h5diff_common.h +++ b/tools/h5diff/h5diff_common.h @@ -17,14 +17,13 @@ #define H5DIFFCOMMON_H__ #include "h5tools.h" +/* Name of tool */ +#define PROGRAMNAME "h5diff" #ifdef __cplusplus extern "C" { #endif -H5TOOLS_DLLVAR unsigned char g_Parallel; -H5TOOLS_DLLVAR int g_nTasks; - void usage(void); void parse_command_line(int argc, const char* argv[], const char** fname1, const char** fname2, const char** objname1, const char** objname2, diff_opt_t* options); void h5diff_exit(int status); diff --git a/tools/h5diff/h5diff_main.c b/tools/h5diff/h5diff_main.c index c1538a4..607d58e 100644 --- a/tools/h5diff/h5diff_main.c +++ b/tools/h5diff/h5diff_main.c @@ -15,12 +15,12 @@ #include #include +#include #include "h5diff.h" #include "h5diff_common.h" +#include "h5tools.h" #include "h5tools_utils.h" -/* Name of tool */ -#define PROGRAMNAME "h5diff" /*------------------------------------------------------------------------- * Function: main @@ -82,11 +82,14 @@ int main(int argc, const char *argv[]) h5tools_setprogname(PROGRAMNAME); h5tools_setstatus(EXIT_SUCCESS); + + /* Initialize h5tools lib */ + h5tools_init(); + /*------------------------------------------------------------------------- * process the command-line *------------------------------------------------------------------------- */ - parse_command_line(argc, argv, &fname1, &fname2, &objname1, &objname2, &options); /*------------------------------------------------------------------------- @@ -118,3 +121,24 @@ out: return ret; } +/*------------------------------------------------------------------------- + * Function: h5diff_exit + * + * Purpose: dismiss phdiff worker processes and exit + * + * Return: none + * + * Programmer: Albert Cheng + * Date: Feb 6, 2005 + * + * Comments: + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +void h5diff_exit(int status) +{ + exit(status); +} + diff --git a/tools/h5diff/h5diffgentest.c b/tools/h5diff/h5diffgentest.c index da3c5f8..0b5d68f 100644 --- a/tools/h5diff/h5diffgentest.c +++ b/tools/h5diff/h5diffgentest.c @@ -17,11 +17,18 @@ #include #include "hdf5.h" #include "H5private.h" -#include "h5tools.h" - -/* Name of tool */ -#define PROGRAMNAME "h5diffgentest" +/* + * The output functions need a temporary buffer to hold a piece of the + * dataset while it's being printed. This constant sets the limit on the + * size of that temporary buffer in bytes. For efficiency's sake, choose the + * largest value suitable for your machine (for testing use a small value). + */ +/* Maximum size used in a call to malloc for a dataset + * NOTE: this value should stay in sync with the value defined in the tools + * library file: h5tools_utils.h + */ +hsize_t H5TOOLS_MALLOCSIZE = (128 * 1024 * 1024); /*------------------------------------------------------------------------- * Program: h5diffgentest @@ -53,8 +60,10 @@ #define FILE16 "h5diff_extlink_trg.h5" #define FILE17 "h5diff_ext2softlink_src.h5" #define FILE18 "h5diff_ext2softlink_trg.h5" -#define FILE19 "h5diff_dset_idx1.h5" -#define FILE20 "h5diff_dset_idx2.h5" +#define FILE19 "h5diff_dset_zero_dim_size1.h5" +#define FILE20 "h5diff_dset_zero_dim_size2.h5" +#define FILE21 "h5diff_dset_idx1.h5" +#define FILE22 "h5diff_dset_idx2.h5" #define DANGLE_LINK_FILE1 "h5diff_danglelinks1.h5" #define DANGLE_LINK_FILE2 "h5diff_danglelinks2.h5" #define GRP_RECURSE_FILE1 "h5diff_grp_recurse1.h5" @@ -75,13 +84,26 @@ /* attribute compre with verbose level */ #define ATTR_VERBOSE_LEVEL_FILE1 "h5diff_attr_v_level1.h5" #define ATTR_VERBOSE_LEVEL_FILE2 "h5diff_attr_v_level2.h5" +/* file containing valid/invalid enum value mix */ +#define ENUM_INVALID_VALUES "h5diff_enum_invalid_values.h5" +/* file with container types (array,vlen) with multiple compounds */ +#define COMPS_COMPLEX1 "compounds_array_vlen1.h5" +#define COMPS_COMPLEX2 "compounds_array_vlen2.h5" +/* non-comparable dataset and attribute */ +#define NON_COMPARBLES1 "non_comparables1.h5" +#define NON_COMPARBLES2 "non_comparables2.h5" #define UIMAX 4294967295u /*Maximum value for a variable of type unsigned int */ #define STR_SIZE 3 #define GBLL ((unsigned long long) 1024 * 1024 *1024 ) - #define MY_LINKCLASS 187 + +/* Dataspace of 0 dimension size */ +#define SPACE1_RANK 2 +#define SPACE1_DIM1 0 +#define SPACE1_DIM2 0 + /* 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) @@ -112,6 +134,7 @@ static int test_types(const char *fname); static int test_datatypes(const char *fname); static int test_attributes(const char *fname,int make_diffs); static int test_datasets(const char *fname,int make_diffs); +static int test_special_datasets(const char *fname,int make_diffs); static int test_hyperslab(const char *fname,int make_diffs); static int test_link_name(const char *fname1); static int test_soft_links(const char *fname1); @@ -123,8 +146,14 @@ static int test_group_recurse(const char *fname1, const char *fname2); static int test_group_recurse2(void); static int test_exclude_obj1(const char *fname1, const char *fname2); static int test_exclude_obj2(const char *fname1, const char *fname2); -static int test_comp_vlen_strings(const char *fname1); +static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int is_file_new); static int test_attributes_verbose_level(const char *fname1, const char *fname2); +static int test_enums(const char *fname); +static void test_comps_array (const char *fname, const char *dset, const char *attr,int diff, int is_file_new); +static void test_comps_vlen (const char *fname, const char *dset,const char *attr, int diff, int is_file_new); +static void test_comps_array_vlen (const char *fname, const char *dset, const char *attr, int diff, int is_file_new); +static void test_comps_vlen_arry (const char *fname, const char *dset,const char *attr, int diff, int is_file_new); +static void test_non_comparables (const char *fname, int diff); /* called by test_attributes() and test_datasets() */ static void write_attr_in(hid_t loc_id,const char* dset_name,hid_t fid,int make_diffs); @@ -176,14 +205,18 @@ int main(void) test_ext2soft_links(FILE17, FILE18); + /* generate 2 files, the second call creates a similar file with differences */ + test_special_datasets(FILE19,0); + test_special_datasets(FILE20,1); + /* - * Generate 2 files: FILE12 with old format; FILE13 with new format + * Generate 2 files: FILE21 with old format; FILE22 with new format * Create 2 datasets in each file: * One dataset: chunked layout, w/o filters, fixed dimension * One dataset: chunked layout, w/ filters, fixed dimension */ - gen_dataset_idx(FILE19, 0); - gen_dataset_idx(FILE20, 1); + gen_dataset_idx(FILE21, 0); + gen_dataset_idx(FILE22, 1); test_dangle_links(DANGLE_LINK_FILE1, DANGLE_LINK_FILE2); @@ -194,7 +227,38 @@ int main(void) test_exclude_obj2(EXCLUDE_FILE2_1, EXCLUDE_FILE2_2); /* diff various multiple vlen and fixlen string types in a compound dataset */ - test_comp_vlen_strings(COMP_VL_STRS_FILE ); + test_comp_vlen_strings(COMP_VL_STRS_FILE, "group", 1); + test_comp_vlen_strings(COMP_VL_STRS_FILE, "group_copy", 0); + + /* diff when invalid enum values are present. + * This will probably grow to involve more extensive testing of + * enums so it has been given its own test file and test (apart + * from the basic type testing). + */ + test_enums(ENUM_INVALID_VALUES); + + /* ------------------------------------------------- + * Create test files with dataset and attribute with container types + * (array, vlen) with multiple nested compound types. + */ + /* file1 */ + test_comps_array(COMPS_COMPLEX1,"dset1", "attr1", 0, 1); + test_comps_vlen(COMPS_COMPLEX1,"dset2", "attr2", 0, 0); + test_comps_array_vlen(COMPS_COMPLEX1,"dset3", "attr3", 0, 0); + test_comps_vlen_arry(COMPS_COMPLEX1,"dset4", "attr4", 0, 0); + /* file2 */ + test_comps_array(COMPS_COMPLEX2,"dset1", "attr1", 5, 1); + test_comps_vlen(COMPS_COMPLEX2,"dset2", "attr2",5, 0); + test_comps_array_vlen(COMPS_COMPLEX2,"dset3", "attr3", 5, 0); + test_comps_vlen_arry(COMPS_COMPLEX2,"dset4", "attr4", 5, 0); + + /*------------------------------------------------- + * Create test files with non-comparable dataset and attributes with + * comparable datasets and attributes. All the comparables should display + * differences. + */ + test_non_comparables(NON_COMPARBLES1,0); + test_non_comparables(NON_COMPARBLES2,5); return 0; } @@ -324,7 +388,7 @@ int test_basic(const char *fname1, const char *fname2, const char *fname3) *------------------------------------------------------------------------- */ { - /* epsilon = 0.0000001 = 1e-7 + /* epsilon = 0.0000001 = 1e-7 * system epsilon for float : FLT_EPSILON = 1.19209E-07 */ float data11[3][2] ={{0.000000f,0.0000001f},{0.0000001f, 0.00000022f},{0.0000001f,0.0000001f}}; @@ -405,7 +469,7 @@ int test_basic(const char *fname1, const char *fname2, const char *fname3) data17[5] = 1; data18[0] = (float) sqrt( (double)-1 ); - data18[1] = (float) sqrt( (double)-1 ); + data18[1] = (float) sqrt( (double)-10000 ); data18[2] = 1; data18[3] = 1; data18[4] = 1; @@ -413,6 +477,7 @@ int test_basic(const char *fname1, const char *fname2, const char *fname3) write_dset(gid1,1,dims1,"fp17",H5T_NATIVE_DOUBLE,data17); write_dset(gid1,1,dims1,"fp18",H5T_NATIVE_DOUBLE,data18); + write_dset(gid1,1,dims1,"fp18_COPY",H5T_NATIVE_DOUBLE,data18); } /*------------------------------------------------------------------------ @@ -430,7 +495,9 @@ int test_basic(const char *fname1, const char *fname2, const char *fname3) data20[3] = data20[4] = data20[5] = -log(0); write_dset(gid1,1,dims1,"fp19",H5T_NATIVE_FLOAT,data19); + write_dset(gid1,1,dims1,"fp19_COPY",H5T_NATIVE_FLOAT,data19); write_dset(gid1,1,dims1,"fp20",H5T_NATIVE_DOUBLE,data20); + write_dset(gid1,1,dims1,"fp20_COPY",H5T_NATIVE_DOUBLE,data20); } /*------------------------------------------------------------------------- @@ -919,14 +986,13 @@ int test_attributes(const char *file, /*------------------------------------------------------------------------- * Function: test_attributes_verbose_level * -* Purpose: Cresting test files for testing attributes along with +* Purpose: Cresting test files for testing attributes along with * levels of verbos option * *------------------------------------------------------------------------- */ static int test_attributes_verbose_level(const char *fname1, const char *fname2) { - int i; herr_t status = SUCCEED; hid_t fid1, fid2; hid_t f1_gid, f2_gid; @@ -1027,7 +1093,7 @@ static int test_attributes_verbose_level(const char *fname1, const char *fname2) goto out; } - + /*---------------------------------------------------------------------- @@ -1108,7 +1174,7 @@ static int test_attributes_verbose_level(const char *fname1, const char *fname2) /*---------------------------------- * CASE1 - Same attr number, all Same attr name - * add attr to group + * add attr to group */ write_attr(f1_gid,1,attr_dims,"integer1",H5T_NATIVE_INT,f1_attr_idata); write_attr(f1_gid,1,attr_dims,"float1",H5T_NATIVE_FLOAT,f1_attr_fdata); @@ -1117,8 +1183,8 @@ static int test_attributes_verbose_level(const char *fname1, const char *fname2) write_attr(f2_gid,1,attr_dims,"float1",H5T_NATIVE_FLOAT,f2_attr_fdata); /*---------------------------------- - * CASE2 - Same attr number, some Same attr name - * add attr to dset + * CASE2 - Same attr number, some Same attr name + * add attr to dset */ write_attr(f1_did,1,attr_dims,"integer1",H5T_NATIVE_INT,f1_attr_idata); write_attr(f1_did,1,attr_dims,"float2",H5T_NATIVE_FLOAT,f1_attr_fdata); @@ -1127,8 +1193,8 @@ static int test_attributes_verbose_level(const char *fname1, const char *fname2) write_attr(f2_did,1,attr_dims,"float3",H5T_NATIVE_FLOAT,f2_attr_fdata); /*---------------------------------- - * CASE3 - Same attr number, all different attr name - * add attr to ntype + * CASE3 - Same attr number, all different attr name + * add attr to ntype */ write_attr(f1_tid,1,attr_dims,"integer1",H5T_NATIVE_INT,f1_attr_idata); write_attr(f1_tid,1,attr_dims,"float2",H5T_NATIVE_FLOAT,f1_attr_fdata); @@ -1148,11 +1214,11 @@ static int test_attributes_verbose_level(const char *fname1, const char *fname2) write_attr(f2_gid2,1,attr_dims,"integer1",H5T_NATIVE_INT,f2_attr_idata); write_attr(f2_gid2,1,attr_dims,"float2",H5T_NATIVE_FLOAT,f2_attr_fdata); - + /*---------------------------------- * CASE5 - Different attr number, all different attr name - * add attr to g3 + * add attr to g3 */ write_attr(f1_gid3,1,attr_dims,"integer10",H5T_NATIVE_INT,f1_attr_idata); write_attr(f1_gid3,1,attr_dims,"float11",H5T_NATIVE_FLOAT,f1_attr_fdata); @@ -1262,6 +1328,62 @@ int test_datasets(const char *file, } /*------------------------------------------------------------------------- +* Function: test_special_datasets +* +* Purpose: Check datasets with datasapce of zero dimension size. +*------------------------------------------------------------------------- +*/ +static +int test_special_datasets(const char *file, + int make_diffs /* flag to modify data buffers */) +{ + hid_t fid; + hid_t did; + hid_t sid0, sid; + hsize_t dims0[SPACE1_RANK]={SPACE1_DIM1, SPACE1_DIM2}; + hsize_t dims[SPACE1_RANK]={SPACE1_DIM1, SPACE1_DIM2}; + herr_t status; + + /* Create a file */ + if((fid = H5Fcreate(file, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) + return -1; + + /* Create a dataset with zero dimension size */ + sid0 = H5Screate_simple(SPACE1_RANK, dims0, NULL); + did = H5Dcreate2(fid, "dset1", H5T_NATIVE_INT, sid0, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + + /* close dataset */ + status = H5Dclose(did); + assert(status >= 0); + + /* close dataspace */ + status = H5Sclose(sid0); + assert(status >= 0); + + /* Create a dataset with zero dimension size in one file but the other one + * has a dataset with a non-zero dimension size */ + if(make_diffs) { + dims[1] = SPACE1_DIM2 + 4; + } + + sid = H5Screate_simple(SPACE1_RANK, dims, NULL); + did = H5Dcreate2(fid, "dset2", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + + /* close dataspace */ + status = H5Sclose(sid); + assert(status >= 0); + + /* close dataset */ + status = H5Dclose(did); + assert(status >= 0); + + /* close file */ + status = H5Fclose(fid); + assert(status >= 0); + return status; +} + +/*------------------------------------------------------------------------- * * Purpose: Create test files to compare links, one has longer name than * the other and short name is subset of long name. @@ -2670,9 +2792,9 @@ static int test_group_recurse(const char *fname1, const char *fname2) } /*------------------------------ - * external circle route test + * external circle route test * file1/grp11 <-> file2/grp10 via elink_grp_circle link - */ + */ /* file1 */ status = H5Lcreate_external(fname2, "/grp11", gid10_f1, "elink_grp_circle", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) @@ -2717,7 +2839,7 @@ out: /*------------------------------------------------------------------------- * -* Purpose: +* Purpose: * For testing comparing group member objects recursively via multiple * linked external links * @@ -2732,18 +2854,15 @@ static int test_group_recurse2(void) hid_t grp1=0, grp2; hid_t grp3=0; hid_t grp4=0; - hid_t tid; hid_t dset1, dset2; hid_t datatype, dataspace; /* handles */ hid_t fileid2; hid_t fileid3; hid_t fileid4; - hid_t fileid4_1; hsize_t dimsf[2]; /* dataset dimensions */ herr_t status=0; int data1[4][2] = {{0,0},{1,1},{2,2},{3,3}}; int data2[4][2] = {{0,0},{0,1},{0,2},{3,3}}; - int i, j; /*----------------------------------------------------------------------- * FILE 1 @@ -2817,7 +2936,7 @@ static int test_group_recurse2(void) * datatype and default dataset creation properties. */ dset1 = H5Dcreate2(fileid1, GRP_R_DSETNAME1, datatype, dataspace, - H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* * Write the data to the dataset using default transfer properties. @@ -2833,7 +2952,7 @@ static int test_group_recurse2(void) * datatype and default dataset creation properties. */ dset1 = H5Dcreate2(grp3, GRP_R_DSETNAME1, datatype, dataspace, - H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* * Write the data to the dataset using default transfer properties. @@ -2848,7 +2967,7 @@ static int test_group_recurse2(void) * datatype and default dataset creation properties. */ dset2 = H5Dcreate2(grp4, GRP_R_DSETNAME2, datatype, dataspace, - H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* * Write the data to the dataset using default transfer properties. @@ -2885,7 +3004,7 @@ static int test_group_recurse2(void) fileid4 = H5Fcreate(GRP_RECURSE2_EXT3, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); /*----------------------------------------------- - * Groups + * Groups */ grp4 = H5Gcreate2(fileid4, "/g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (grp4 < 0) @@ -2903,7 +3022,7 @@ static int test_group_recurse2(void) * datatype and default dataset creation properties. */ dset2 = H5Dcreate2(grp4, GRP_R_DSETNAME2, datatype, dataspace, - H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* * Write the data to the dataset using default transfer properties. @@ -2922,7 +3041,7 @@ static int test_group_recurse2(void) fileid3 = H5Fcreate(GRP_RECURSE2_EXT2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); /*----------------------------------------------- - * Groups + * Groups */ grp2 = H5Gcreate2(fileid3, "g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (grp2 < 0) @@ -2948,7 +3067,7 @@ static int test_group_recurse2(void) * datatype and default dataset creation properties. */ dset1 = H5Dcreate2(grp3, GRP_R_DSETNAME1, datatype, dataspace, - H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* * Write the data to the dataset using default transfer properties. @@ -2978,7 +3097,7 @@ static int test_group_recurse2(void) fileid2 = H5Fcreate(GRP_RECURSE2_EXT1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); /*----------------------------------------------- - * Groups + * Groups */ grp1 = H5Gcreate2(fileid2, "g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (grp1 < 0) @@ -2992,7 +3111,7 @@ static int test_group_recurse2(void) * dset1 */ dset1 = H5Dcreate2(fileid2, GRP_R_DSETNAME1, datatype, dataspace, - H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* * Write the data to the dataset using default transfer properties. @@ -3107,7 +3226,7 @@ static int test_exclude_obj1(const char *fname1, const char *fname2) /*----------------------------------------------------------------------- - * Datasets + * Datasets *------------------------------------------------------------------------*/ /* file1 */ status = write_dset(fid1,2,dims2,"dset1",H5T_NATIVE_INT,data1); @@ -3181,7 +3300,7 @@ out: * * Purpose: Create test files for excluding obj. * different structure and name -* Test : exclude different objs to verify the rest are same +* Test : exclude different objs to verify the rest are same * * Programmer: Jonathan Kim (July, 21, 2010) * @@ -3252,7 +3371,7 @@ static int test_exclude_obj2(const char *fname1, const char *fname2) /*----------------------------------------------------------------------- - * Datasets + * Datasets *------------------------------------------------------------------------*/ /* file1 */ status = write_dset(fid1,2,dims2,"dset10",H5T_NATIVE_INT,data1); @@ -3327,7 +3446,7 @@ out: /*------------------------------------------------------------------------- * * Purpose: Create test files for multiple variable length string/string array -* along with fixed length string/string array types in +* along with fixed length string/string array types in * a compound type dataset. * * Programmer: Jonathan Kim (Oct, 26, 2010) @@ -3342,11 +3461,12 @@ out: #define FIXLEN_STR_ARRY_SIZE 30 #define COMP_RANK 1 #define COMP_DIM 1 -static int test_comp_vlen_strings(const char *fname1) +static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int is_file_new) { int i; hid_t fid1; /* file id */ + hid_t gid; /* compound1 datatype */ typedef struct comp1_t @@ -3512,8 +3632,8 @@ static int test_comp_vlen_strings(const char *fname1) /* objref */ hsize_t objref_dims[1]={1}; - /*------------------------------------------ - * compound dataset + /*------------------------------------------ + * compound dataset *------------------------------------------*/ hid_t sid_comp=0; /* dataspace ID */ hid_t tid1_comp=0; /* datatype ID */ @@ -3637,10 +3757,34 @@ static int test_comp_vlen_strings(const char *fname1) /*----------------------------------------------------------------------- * Create file(s) *------------------------------------------------------------------------*/ - fid1 = H5Fcreate (fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - if (fid1 < 0) + if (is_file_new == 1) { - fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1); + fid1 = H5Fcreate (fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + if (fid1 < 0) + { + fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1); + status = FAIL; + goto out; + } + } + else + { + fid1 = H5Fopen (fname1, H5F_ACC_RDWR, H5P_DEFAULT); + if (fid1 < 0) + { + fprintf(stderr, "Error: %s> H5Fopen failed.\n", fname1); + status = FAIL; + goto out; + } + } + + /*----------------------------------------------------------------------- + * Create group + *------------------------------------------------------------------------*/ + gid = H5Gcreate2(fid1, grp_name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + if (gid < 0) + { + fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); status = FAIL; goto out; } @@ -3860,7 +4004,7 @@ static int test_comp_vlen_strings(const char *fname1) /* Write data to compound 1 dataset buffer */ - did_comp = H5Dcreate2(fid1, "Compound_dset1", tid1_comp, sid_comp, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + did_comp = H5Dcreate2(gid, "Compound_dset1", tid1_comp, sid_comp, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); status = H5Dwrite(did_comp, tid1_comp, H5S_ALL, H5S_ALL, H5P_DEFAULT, &comp1_buf); if (status < 0) { @@ -3871,89 +4015,89 @@ static int test_comp_vlen_strings(const char *fname1) H5Dclose(did_comp); /* Write data to compound 2 dataset buffer */ - did_comp = H5Dcreate2(fid1, "Compound_dset2", tid2_comp, sid_comp, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + did_comp = H5Dcreate2(gid, "Compound_dset2", tid2_comp, sid_comp, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); status = H5Dwrite(did_comp, tid2_comp, H5S_ALL, H5S_ALL, H5P_DEFAULT, &comp2_buf); if (status < 0) { fprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1); status = FAIL; goto out; - } + } H5Dclose(did_comp); /* Write data to compound 3 dataset buffer */ - did_comp = H5Dcreate2(fid1, "Compound_dset3", tid3_comp, sid_comp, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + did_comp = H5Dcreate2(gid, "Compound_dset3", tid3_comp, sid_comp, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); status = H5Dwrite(did_comp, tid3_comp, H5S_ALL, H5S_ALL, H5P_DEFAULT, &comp3_buf); if (status < 0) { fprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1); status = FAIL; goto out; - } + } H5Dclose(did_comp); /* Write data to compound 4 dataset buffer */ - did_comp = H5Dcreate2(fid1, "Compound_dset4", tid4_comp, sid_comp, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + did_comp = H5Dcreate2(gid, "Compound_dset4", tid4_comp, sid_comp, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); status = H5Dwrite(did_comp, tid4_comp, H5S_ALL, H5S_ALL, H5P_DEFAULT, &comp4_buf); if (status < 0) { fprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1); status = FAIL; goto out; - } + } H5Dclose(did_comp); /* Write data to compound 5 dataset buffer */ - did_comp = H5Dcreate2(fid1, "Compound_dset5", tid5_comp, sid_comp, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + did_comp = H5Dcreate2(gid, "Compound_dset5", tid5_comp, sid_comp, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); status = H5Dwrite(did_comp, tid5_comp, H5S_ALL, H5S_ALL, H5P_DEFAULT, &comp5_buf); if (status < 0) { fprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1); status = FAIL; goto out; - } + } H5Dclose(did_comp); /* Write data to compound 6 dataset buffer */ - did_comp = H5Dcreate2(fid1, "Compound_dset6", tid6_comp, sid_comp, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + did_comp = H5Dcreate2(gid, "Compound_dset6", tid6_comp, sid_comp, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); status = H5Dwrite(did_comp, tid6_comp, H5S_ALL, H5S_ALL, H5P_DEFAULT, &comp6_buf); if (status < 0) { fprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1); status = FAIL; goto out; - } + } H5Dclose(did_comp); /* Write data to compound 7 dataset buffer */ - did_comp = H5Dcreate2(fid1, "Compound_dset7", tid7_comp, sid_comp, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + did_comp = H5Dcreate2(gid, "Compound_dset7", tid7_comp, sid_comp, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); status = H5Dwrite(did_comp, tid7_comp, H5S_ALL, H5S_ALL, H5P_DEFAULT, &comp7_buf); if (status < 0) { fprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1); status = FAIL; goto out; - } + } H5Dclose(did_comp); /* Write data to compound 8 dataset buffer */ - did_comp = H5Dcreate2(fid1, "Compound_dset8", tid8_comp, sid_comp, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + did_comp = H5Dcreate2(gid, "Compound_dset8", tid8_comp, sid_comp, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); status = H5Dwrite(did_comp, tid8_comp, H5S_ALL, H5S_ALL, H5P_DEFAULT, &comp8_buf); if (status < 0) { fprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1); status = FAIL; goto out; - } + } H5Dclose(did_comp); /* Write data to compound 9 dataset buffer */ - did_comp = H5Dcreate2(fid1, "Compound_dset9", tid9_comp, sid_comp, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + did_comp = H5Dcreate2(gid, "Compound_dset9", tid9_comp, sid_comp, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* obj references */ - status=H5Rcreate(&(comp9_buf.objref1),fid1,"/Compound_dset2",H5R_OBJECT,-1); - status=H5Rcreate(&(comp9_buf.objref2),fid1,"/Compound_dset3",H5R_OBJECT,-1); - status=H5Rcreate(&(comp9_buf.objref3),fid1,"/Compound_dset4",H5R_OBJECT,-1); + status=H5Rcreate(&(comp9_buf.objref1),gid,"Compound_dset2",H5R_OBJECT,-1); + status=H5Rcreate(&(comp9_buf.objref2),gid,"Compound_dset3",H5R_OBJECT,-1); + status=H5Rcreate(&(comp9_buf.objref3),gid,"Compound_dset4",H5R_OBJECT,-1); status = H5Dwrite(did_comp, tid9_comp, H5S_ALL, H5S_ALL, H5P_DEFAULT, &comp9_buf); if (status < 0) @@ -3961,7 +4105,7 @@ static int test_comp_vlen_strings(const char *fname1) fprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1); status = FAIL; goto out; - } + } H5Dclose(did_comp); @@ -3973,6 +4117,8 @@ out: *-----------------------------------------------------------------------*/ if(fid1) H5Fclose(fid1); + if(gid) + H5Gclose(gid); /* vlen string */ if(tid_vlen_str) H5Tclose(tid_vlen_str); @@ -4024,6 +4170,836 @@ out: return status; } + +/*------------------------------------------------------------------------- +* +* Purpose: Test diffs of enum values which may include invalid values. +* +* Programmer: Dana Robinson +* +*-------------------------------------------------------------------------*/ + +static int +test_enums(const char *fname) +{ + hid_t fid = -1; + + hid_t tid = -1; + int enum_val = -1; + + /* The data in the two arrays cover the following cases: + * + * V = valid enum value, I = invalid enum value + * + * 0: I-I (same value) + * 1: V-I + * 2: I-V + * 3: V-V (same value) + * 4: I-I (different values) SKIPPED FOR NOW + * 5: V-V (different values) + */ + /* *** NOTE *** + * + * There is a bug in H5Dread() where invalid enum values are always + * returned as -1 so two different invalid enum values cannot be + * properly compared. Test 4 has been adjusted to pass here + * while we fix the issue. + */ + int data1[6] = {9, 0, 9, 0, 9, 0}; + /*int data1[6] = {9, 0, 9, 0, 8, 0}; */ + int data2[6] = {9, 9, 0, 0, 9, 1}; + + hsize_t dims = 6; + + herr_t status = SUCCEED; + + /*----------------------------------------------------------------------- + * Create the file + *---------------------------------------------------------------------*/ + + fid = H5Fcreate(fname, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + + /*----------------------------------------------------------------------- + * Create enum types + *---------------------------------------------------------------------*/ + + tid = H5Tenum_create(H5T_NATIVE_INT); + enum_val = 0; + status = H5Tenum_insert(tid, "YIN", &enum_val); + enum_val = 1; + status = H5Tenum_insert(tid, "YANG", &enum_val); + + /*----------------------------------------------------------------------- + * Create datasets containing enum data. + *---------------------------------------------------------------------*/ + + status = write_dset(fid, 1, &dims, "dset1", tid, data1); + status = write_dset(fid, 1, &dims, "dset2", tid, data2); + +out: + /*----------------------------------------------------------------------- + * Close + *---------------------------------------------------------------------*/ + if(fid) + H5Fclose(fid); + if(tid) + H5Tclose(tid); + + return status; +} + +/*------------------------------------------------------------------------- +* +* Purpose: +* Create test files with dataset and attribute with container types +* (array, vlen) with multiple nested compound types. +* +* Function: test_comps_array() +* - type: compound->array->compound +* +* Function: test_comps_vlen() +* - type: compound->vlen->compound +* +* Function: test_comps_array_vlen() +* - type: compound->array->compound->vlen->compound +* +* Function: test_comps_vlen_arry() +* - type: compound->vlen->compound->array->compound +* +* Programmer: Jonathan Kim (Sep, 1, 2011) +* +*-------------------------------------------------------------------------*/ +#define SDIM_DSET 2 +#define SDIM_CMPD_ARRAY 2 + +static void test_comps_array (const char *fname, const char *dset, const char *attr,int diff, int is_file_new) +{ + /* sub compound 2 */ + typedef struct { + int i2; + float f2; + } cmpd2_t; + + /* top compound 1 */ + typedef struct { + int i1; + cmpd2_t cmpd2[SDIM_CMPD_ARRAY]; + } cmpd1_t; + + cmpd1_t wdata[SDIM_DSET]; /* dataset with compound1 */ + + hid_t fid; /* HDF5 File IDs */ + hid_t did_dset; /* Dataset ID */ + hid_t sid_dset; /* Dataset space ID */ + hid_t tid_cmpd1; /* Compound1 type ID */ + hid_t tid_arry1; /* Array type ID in compound1 */ + hid_t tid_cmpd2; /* Compound2 type ID */ + hid_t tid_attr; + hsize_t sdims_dset[] = {SDIM_DSET}; + hsize_t sdims_cmpd_arry[] = {SDIM_CMPD_ARRAY}; + int i,j; + herr_t ret; /* Generic return value */ + + /* Initialize array data to write */ + for(i=0; i < SDIM_DSET; i++) + { + wdata[i].i1 = i; + for(j=0; j < SDIM_CMPD_ARRAY; j++) + { + wdata[i].cmpd2[j].i2 = i*10 + diff; + wdata[i].cmpd2[j].f2 = (float)(i*10.5) + diff; + } /* end for */ + } + + /*----------------------------------------------------------------------- + * Create file(s) + *------------------------------------------------------------------------*/ + if (is_file_new == 1) + fid = H5Fcreate(fname, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + else + fid = H5Fopen (fname, H5F_ACC_RDWR, H5P_DEFAULT); + + + /* ------------------------------- + * Create a sub compound2 datatype */ + tid_cmpd2 = H5Tcreate(H5T_COMPOUND, sizeof(cmpd2_t)); + + /* Insert integer field */ + ret = H5Tinsert(tid_cmpd2, "int2", HOFFSET(cmpd2_t, i2), H5T_NATIVE_INT); + assert(ret >= 0); + + /* Insert float field */ + ret = H5Tinsert(tid_cmpd2, "float2", HOFFSET(cmpd2_t, f2), H5T_NATIVE_FLOAT); + assert(ret >= 0); + + /*----------------------------------- + * Create a top compound1. + */ + tid_cmpd1 = H5Tcreate (H5T_COMPOUND, sizeof(cmpd1_t)); + + ret = H5Tinsert(tid_cmpd1, "int1", HOFFSET(cmpd1_t, i1), H5T_NATIVE_INT); + assert(ret >= 0); + + /* Create an array datatype */ + tid_arry1 = H5Tarray_create2(tid_cmpd2, 1, sdims_cmpd_arry); + /* insert the array */ + ret = H5Tinsert(tid_cmpd1, "array_cmpd1", HOFFSET(cmpd1_t, cmpd2), tid_arry1); + assert(ret >= 0); + + + /* ------------------- + * Create a dataset + */ + /* Create dataspace for datasets */ + sid_dset = H5Screate_simple(1, sdims_dset, NULL); + + did_dset = H5Dcreate2(fid, dset, tid_cmpd1, sid_dset, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + + /* Write dataset to disk */ + ret = H5Dwrite(did_dset, tid_cmpd1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); + assert(ret >= 0); + + /*----------------------------------- + * Create an attribute in root group + */ + tid_attr = H5Acreate2(fid, attr, tid_cmpd1, sid_dset, H5P_DEFAULT, H5P_DEFAULT); + ret = H5Awrite(tid_attr, tid_cmpd1, wdata); + assert(ret >= 0); + + /* ---------------- + * Close Dataset */ + ret = H5Aclose(tid_attr); + assert(ret >= 0); + ret = H5Tclose(tid_arry1); + assert(ret >= 0); + ret = H5Dclose(did_dset); + assert(ret >= 0); + ret = H5Tclose(tid_cmpd1); + assert(ret >= 0); + ret = H5Tclose(tid_cmpd2); + assert(ret >= 0); + ret = H5Sclose(sid_dset); + assert(ret >= 0); + ret = H5Fclose(fid); + assert(ret >= 0); +} + + + +static void test_comps_vlen (const char * fname, const char *dset, const char *attr, int diff, int is_file_new) +{ + /* sub compound 2 */ + typedef struct { + int i2; + float f2; + } cmpd2_t; + + /* top compound 1 */ + typedef struct { + int i1; + hvl_t vl; /* VL information for compound2 */ + } cmpd1_t; + + cmpd1_t wdata[SDIM_DSET]; /* Dataset for compound1 */ + + hid_t fid; /* HDF5 File ID */ + hid_t did_dset; /* dataset ID */ + hid_t sid_dset; /* dataset space ID */ + hid_t tid_cmpd2; /* compound2 type ID */ + hid_t tid_cmpd1; /* compound1 type ID */ + hid_t tid_cmpd1_vlen; + hsize_t sdims_dset[] = {SDIM_DSET}; + + unsigned i,j; /* counting variables */ + herr_t ret; /* Generic return value */ + + /* Allocate and initialize VL data to write */ + for(i=0; i= 0); + ret = H5Tinsert(tid_cmpd2, "float2", HOFFSET(cmpd2_t, f2), H5T_NATIVE_FLOAT); + assert(ret >= 0); + + /* --------------------------- + * Create top compound1 type */ + tid_cmpd1 = H5Tcreate(H5T_COMPOUND, sizeof(cmpd1_t)); + /* Insert fields */ + ret = H5Tinsert(tid_cmpd1, "int1", HOFFSET(cmpd1_t, i1), H5T_NATIVE_INT); + assert(ret >= 0); + /* Create a VL datatype */ + tid_cmpd1_vlen = H5Tvlen_create(tid_cmpd2); + + ret = H5Tinsert(tid_cmpd1, "vlen_cmpd1", HOFFSET(cmpd1_t, vl), tid_cmpd1_vlen); + assert(ret >= 0); + + /* ------------------------------- + * Create dataset with compound1 + */ + /* Create dataspace for dataset */ + sid_dset = H5Screate_simple(1, sdims_dset, NULL); + + /* Create a dataset */ + did_dset = H5Dcreate2(fid, dset, tid_cmpd1, sid_dset, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + + /* Write dataset to disk */ + ret = H5Dwrite(did_dset, tid_cmpd1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); + assert(ret >= 0); + + /* Reclaim the write VL data */ + ret = H5Dvlen_reclaim(tid_cmpd1, sid_dset, H5P_DEFAULT, wdata); + assert(ret >= 0); + + /*----------------------------------- + * Create an attribute in root group + */ + /* TODO: creating vlen with compound type doesn't work for attribute now. + * so add this later when it's fixed + tid_attr = H5Acreate2(fid, attr, tid_cmpd1, sid_dset, H5P_DEFAULT, H5P_DEFAULT); + ret = H5Awrite(tid_attr, tid_cmpd1, wdata); + assert(ret >= 0); + */ + + /* ---------------- + * Close IDs */ + ret = H5Dclose(did_dset); + assert(ret >= 0); + ret = H5Tclose(tid_cmpd2); + assert(ret >= 0); + ret = H5Tclose(tid_cmpd1); + assert(ret >= 0); + ret = H5Sclose(sid_dset); + assert(ret >= 0); + ret = H5Tclose(tid_cmpd1_vlen); + assert(ret >= 0); + ret = H5Fclose(fid); + assert(ret >= 0); +} + + +static void test_comps_array_vlen (const char * fname, const char *dset,const char *attr, int diff, int is_file_new) +{ + typedef struct { + int i3; + float f3; + } cmpd3_t; + + typedef struct { /* Typedef for compound datatype */ + int i2; + hvl_t vl; /* VL information to write */ + } cmpd2_t; + + typedef struct { + int i1; + cmpd2_t cmpd2[SDIM_CMPD_ARRAY]; + } cmpd1_t; + + cmpd1_t wdata[SDIM_DSET]; /* Information to write */ + hid_t fid; /* HDF5 File IDs */ + hid_t did_dset; /* Dataset ID */ + hid_t sid_dset; /* Dataspace ID */ + hid_t tid_cmpd1; /* Compound1 Datatype ID */ + hid_t tid_arry1; /* Array Datatype ID */ + hid_t tid_cmpd2; /* Compound2 Datatype ID */ + hid_t tid_cmpd2_vlen; + hid_t tid_cmpd3; /* Compound3 Datatype ID */ + hsize_t sdims_dset[] = {SDIM_DSET}; + hsize_t sdims_arry[] = {SDIM_CMPD_ARRAY}; + int i,j,k; /* counting variables */ + herr_t ret; /* Generic return value */ + + + + /* Initialize array data to write in compound1 */ + for(i=0; i < SDIM_DSET; i++) + { + wdata[i].i1 = i; + /* Allocate and initialize VL data to write in compound2 */ + for(j=0; j < SDIM_CMPD_ARRAY; j++) + { + wdata[i].cmpd2[j].i2 = j*10; + wdata[i].cmpd2[j].vl.p = malloc((j+1)*sizeof(cmpd3_t)); + wdata[i].cmpd2[j].vl.len = j+1; + for(k=0; k<(j+1); k++) + { + /* Initialize data of compound3 */ + ((cmpd3_t *)wdata[i].cmpd2[j].vl.p)[k].i3 = j*10 + diff; + ((cmpd3_t *)wdata[i].cmpd2[j].vl.p)[k].f3 = (float)(j*10.5) + diff; + } /* end for */ + } /* end for */ + } + + /*----------------------------------------------------------------------- + * Create file(s) + *------------------------------------------------------------------------*/ + if (is_file_new == 1) + fid = H5Fcreate(fname, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + else + fid = H5Fopen (fname, H5F_ACC_RDWR, H5P_DEFAULT); + + /* Create dataspace for datasets */ + sid_dset = H5Screate_simple(1, sdims_dset, NULL); + + /*------------------------------------- + * Create a sub compound3 datatype */ + tid_cmpd3 = H5Tcreate(H5T_COMPOUND, sizeof(cmpd3_t)); + + /* Insert integer field */ + ret = H5Tinsert(tid_cmpd3, "int", HOFFSET(cmpd3_t, i3), H5T_NATIVE_INT); + assert(ret >= 0); + + /* Insert float field */ + ret = H5Tinsert(tid_cmpd3, "float", HOFFSET(cmpd3_t, f3), H5T_NATIVE_FLOAT); + assert(ret >= 0); + + + /*------------------------------------- + * Create a sub compound2 datatype */ + tid_cmpd2 = H5Tcreate(H5T_COMPOUND, sizeof(cmpd2_t)); + + /* Insert integer field */ + ret = H5Tinsert(tid_cmpd2, "int", HOFFSET(cmpd2_t, i2), H5T_NATIVE_INT); + assert(ret >= 0); + /* Create a VL datatype */ + tid_cmpd2_vlen = H5Tvlen_create(tid_cmpd3); + ret = H5Tinsert(tid_cmpd2, "vlen", HOFFSET(cmpd2_t, vl), tid_cmpd2_vlen); + assert(ret >= 0); + + + /*----------------------------------- + * Create a top compound1 datatype for dataset. + */ + tid_cmpd1 = H5Tcreate (H5T_COMPOUND, sizeof(cmpd1_t)); + + /* Create an array datatype */ + tid_arry1 = H5Tarray_create2(tid_cmpd2, 1, sdims_arry); + /* insert the array */ + H5Tinsert(tid_cmpd1, "array_comp", HOFFSET(cmpd1_t, cmpd2), tid_arry1); + + + /* ---------------------- + * Create a dataset */ + did_dset = H5Dcreate2(fid, dset, tid_cmpd1, sid_dset, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + + /* Write dataset to disk */ + ret = H5Dwrite(did_dset, tid_cmpd1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); + assert(ret >= 0); + + /* Reclaim the write VL data */ + ret = H5Dvlen_reclaim(tid_cmpd1, sid_dset, H5P_DEFAULT, wdata); + assert(ret >= 0); + + /*----------------------------------- + * Create an attribute in root group + */ + /* TODO: creating vlen with compound type doesn't work for attribute now. + * so add this later when it's fixed + tid_attr = H5Acreate2(fid, attr, tid_cmpd1, sid_dset, H5P_DEFAULT, H5P_DEFAULT); + ret = H5Awrite(tid_attr, tid_cmpd1, wdata); + assert(ret >= 0); + */ + + /*------------------- + * Close IDs */ + ret = H5Tclose(tid_arry1); + assert(ret >= 0); + ret = H5Dclose(did_dset); + assert(ret >= 0); + ret = H5Sclose(sid_dset); + assert(ret >= 0); + ret = H5Tclose(tid_cmpd3); + assert(ret >= 0); + ret = H5Tclose(tid_cmpd2); + assert(ret >= 0); + ret = H5Tclose(tid_cmpd2_vlen); + assert(ret >= 0); + ret = H5Tclose(tid_cmpd1); + assert(ret >= 0); + ret = H5Fclose(fid); + assert(ret >= 0); +} + + +static void test_comps_vlen_arry (const char * fname, const char *dset, const char *attr, int diff, int is_file_new) +{ + /* sub compound 3 */ + typedef struct { + int i3; + float f3; + } cmpd3_t; + + /* sub compound 2 */ + typedef struct { + int i2; + cmpd3_t cmpd3[SDIM_CMPD_ARRAY]; + } cmpd2_t; + + /* top compound 1 */ + typedef struct { + int i1; + hvl_t vl; /* VL information for compound2 */ + } cmpd1_t; + + cmpd1_t wdata[SDIM_DSET]; /* Dataset for compound1 */ + + hid_t fid; /* HDF5 File ID */ + hid_t did_dset; /* dataset ID */ + hid_t sid_dset; /* dataset space ID */ + hid_t tid_cmpd3; /* compound3 type ID */ + hid_t tid_cmpd2; /* compound2 type ID */ + hid_t tid_cmpd2_arry; + hid_t tid_cmpd1; /* compound1 type ID */ + hid_t tid_cmpd1_vlen; + hsize_t sdims_dset[] = {SDIM_DSET}; + hsize_t sdims_cmpd_arry[] = {SDIM_CMPD_ARRAY}; + + unsigned i,j,k; /* counting variables */ + herr_t ret; /* Generic return value */ + + /* Allocate and initialize VL data to write */ + for(i=0; i= 0); + ret = H5Tinsert(tid_cmpd3, "float3", HOFFSET(cmpd3_t, f3), H5T_NATIVE_FLOAT); + assert(ret >= 0); + + /* ----------------------------- + * Create sub compound2 type */ + tid_cmpd2 = H5Tcreate(H5T_COMPOUND, sizeof(cmpd2_t)); + + ret = H5Tinsert(tid_cmpd2, "int2", HOFFSET(cmpd2_t, i2), H5T_NATIVE_INT); + assert(ret >= 0); + + tid_cmpd2_arry = H5Tarray_create2(tid_cmpd3, 1, sdims_cmpd_arry); + ret = H5Tinsert(tid_cmpd2, "array_cmpd2", HOFFSET(cmpd2_t, cmpd3), tid_cmpd2_arry); + assert(ret >= 0); + + /* --------------------------- + * Create top compound1 type + */ + /* Create a VL datatype */ + tid_cmpd1 = H5Tcreate(H5T_COMPOUND, sizeof(cmpd1_t)); + /* Insert fields */ + ret = H5Tinsert(tid_cmpd1, "int1", HOFFSET(cmpd1_t, i1), H5T_NATIVE_INT); + assert(ret >= 0); + tid_cmpd1_vlen = H5Tvlen_create(tid_cmpd2); + ret = H5Tinsert(tid_cmpd1, "vlen_cmpd1", HOFFSET(cmpd1_t, vl), tid_cmpd1_vlen); + assert(ret >= 0); + + /* ------------------------------- + * Create dataset with compound1 + */ + /* Create dataspace for dataset */ + sid_dset = H5Screate_simple(1, sdims_dset, NULL); + + /* Create a dataset */ + did_dset = H5Dcreate2(fid, dset, tid_cmpd1, sid_dset, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + + /* Write dataset to disk */ + ret = H5Dwrite(did_dset, tid_cmpd1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); + assert(ret >= 0); + + /* Reclaim the write VL data */ + ret = H5Dvlen_reclaim(tid_cmpd1, sid_dset, H5P_DEFAULT, wdata); + assert(ret >= 0); + + /*----------------------------------- + * Create an attribute in root group + */ + /* TODO: creating vlen with compound type doesn't work for attribute now. + * so add this later when it's fixed + tid_attr = H5Acreate2(fid, attr, tid_cmpd1, sid_dset, H5P_DEFAULT, H5P_DEFAULT); + ret = H5Awrite(tid_attr, tid_cmpd1, wdata); + assert(ret >= 0); + */ + + /* ---------------- + * Close IDs */ + ret = H5Dclose(did_dset); + assert(ret >= 0); + ret = H5Sclose(sid_dset); + assert(ret >= 0); + ret = H5Tclose(tid_cmpd3); + assert(ret >= 0); + ret = H5Tclose(tid_cmpd2_arry); + assert(ret >= 0); + ret = H5Tclose(tid_cmpd2); + assert(ret >= 0); + ret = H5Tclose(tid_cmpd1_vlen); + assert(ret >= 0); + ret = H5Tclose(tid_cmpd1); + assert(ret >= 0); + ret = H5Fclose(fid); + assert(ret >= 0); +} + + +/*------------------------------------------------------------------------- +* Function: test_non_comparables +* +* Purpose: +* Create test files with non-comparable dataset and attributes with +* comparable datasets and attributes. All the comparables should display +* differences. +* +*-------------------------------------------------------------------------*/ +#define DIM_ARRY 3 +static void test_non_comparables (const char * fname, int make_diffs) +{ + hid_t fid=0; + hid_t gid1=0; + hid_t gid2=0; + hid_t did1=0; + hid_t did2=0; + hid_t sid1=0; + hid_t tid_dset1=0; + hid_t tid_attr1=0; + hsize_t dims1_1[1] = {DIM_ARRY}; + hsize_t dims1_2[1] = {DIM_ARRY+1}; + hsize_t dims2[2] = {DIM_ARRY, 1}; + int data1[DIM_ARRY] = {0,0,0}; + int data2[DIM_ARRY] = {1,1,1}; + int data3[DIM_ARRY+1] = {1,1,1,1}; + int data1_dim2[DIM_ARRY][1] = {0,0,0}; + int rank_attr; + char data1_str[DIM_ARRY][STR_SIZE]= {"ab","cd","ef"}; + herr_t status = SUCCEED; + int i; + void *dset_data_ptr1=NULL; + void *dset_data_ptr2=NULL; + void *dset_data_ptr3=NULL; + void *attr_data_ptr1=NULL; + void *attr_data_ptr2=NULL; + void *attr_data_ptr3=NULL; + void *attr_data_ptr4=NULL; + void *attr2_dim_ptr=NULL; + void *attr3_dim_ptr=NULL; + + /* init */ + tid_dset1=H5Tcopy(H5T_NATIVE_INT); + dset_data_ptr1=(int*)&data1; + dset_data_ptr2=(int*)&data1; + dset_data_ptr3=(int*)&data1; + tid_attr1=H5Tcopy(H5T_NATIVE_INT); + attr_data_ptr1=(int*)&data1; + attr_data_ptr3=(int*)&data1; + attr_data_ptr4=(int*)&data1; + attr2_dim_ptr=(hsize_t*)&dims1_1; + attr3_dim_ptr=(hsize_t*)&dims1_1; + rank_attr=1; + + if (make_diffs) + { + /* ------------ + * group1 */ + tid_dset1=H5Tcopy(H5T_C_S1); + H5Tset_size(tid_dset1, (size_t)STR_SIZE); + dset_data_ptr1=(char*)&data1_str; + dset_data_ptr2=(int*)&data2; + attr_data_ptr1=(int*)&data2; + + /* ----------- + * group2 + */ + dset_data_ptr3=(int*)&data2; + /* dset1/attr1 */ + tid_attr1=H5Tcopy(H5T_C_S1); + H5Tset_size(tid_attr1, (size_t)STR_SIZE); + attr_data_ptr2=(char*)&data1_str; + + /* dset1/attr2 */ + attr2_dim_ptr=(hsize_t*)&dims1_2; + + /* dset1/attr3 */ + attr_data_ptr3=(int*)&data1_dim2; + attr3_dim_ptr=(hsize_t*)&dims2; + rank_attr=2; + + /* dset1/attr4 */ + attr_data_ptr4=(int*)&data2; + + } + + + /*----------------------------------------------------------------------- + * Create file(s) + *------------------------------------------------------------------------*/ + fid = H5Fcreate (fname, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + if (fid < 0) + { + fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname); + status = FAIL; + goto out; + } + + /*----------------------------------------------------------------------- + * Groups + *------------------------------------------------------------------------*/ + gid1 = H5Gcreate2(fid, "g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + if (gid1 < 0) + { + fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname); + status = FAIL; + goto out; + } + + gid2 = H5Gcreate2(fid, "g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + if (gid2 < 0) + { + fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname); + status = FAIL; + goto out; + } + + /*----------------------------------------------------------------------- + * Datasets in /g1 + *------------------------------------------------------------------------*/ + if((sid1 = H5Screate_simple(1, dims1_1, NULL)) < 0) + goto out; + + /* dset1 */ + if((did1 = H5Dcreate2(gid1, "dset1", tid_dset1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + { + fprintf(stderr, "Error: %s> H5Dcreate2 failed.\n", "dset1"); + status = FAIL; + goto out; + } + + if(H5Dwrite(did1, tid_dset1, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset_data_ptr1) < 0) + { + fprintf(stderr, "Error: %s> H5Dwrite failed.\n", "dset1"); + status = FAIL; + goto out; + } + write_attr(did1,1,dims1_1,"attr", H5T_NATIVE_INT, attr_data_ptr1); + + /* dset2 */ + status = write_dset(gid1, 1, dims1_1,"dset2", H5T_NATIVE_INT, dset_data_ptr2); + if (status == FAIL) + { + fprintf(stderr, "Error: %s> write_dset failed\n", fname); + goto out; + } + + /*----------------------------------------------------------------------- + * Datasets in /g2 + *------------------------------------------------------------------------*/ + /* --------- + * dset1 */ + if((did2 = H5Dcreate2(gid2, "dset1", H5T_NATIVE_INT, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + { + fprintf(stderr, "Error: %s> H5Dcreate2 failed.\n", "dset1"); + status = FAIL; + goto out; + } + + if(H5Dwrite(did2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset_data_ptr3) < 0) + { + fprintf(stderr, "Error: %s> H5Dwrite failed.\n", "dset1"); + status = FAIL; + goto out; + } + /* attr1 - non-compatible : different type */ + write_attr(did2,1,dims1_1,"attr1", tid_attr1, attr_data_ptr2); + + + /* attr2 - non-compatible : same rank, different dimention */ + write_attr(did2,1, attr2_dim_ptr,"attr2", H5T_NATIVE_INT, data3); + + /* attr3 - non-compatible : different rank */ + write_attr(did2, rank_attr,attr3_dim_ptr,"attr3", H5T_NATIVE_INT, attr_data_ptr3); + + /* attr4 - compatible : different data values */ + write_attr(did2,1,dims1_1,"attr4", H5T_NATIVE_INT, attr_data_ptr4); + + /*---------- + * dset2 */ + status = write_dset(gid2, 1, dims1_1,"dset2", H5T_NATIVE_INT, dset_data_ptr3); + if (status == FAIL) + { + fprintf(stderr, "Error: %s> write_dset failed\n", fname); + goto out; + } + + + +out: + + /*----------------------------------------------------------------------- + * Close IDs + *-----------------------------------------------------------------------*/ + if(fid) + H5Fclose(fid); + if(gid1) + H5Gclose(gid1); + if(gid2) + H5Gclose(gid2); + if(did1) + H5Dclose(did1); + if(did2) + H5Dclose(did2); + if(sid1) + H5Sclose(sid1); + if(tid_dset1) + H5Tclose(tid_dset1); + if(tid_attr1) + H5Tclose(tid_attr1); +} + /*------------------------------------------------------------------------- * Function: write_attr_in * @@ -5323,9 +6299,9 @@ void write_dset_in(hid_t loc_id, tid = H5Tvlen_create(H5T_NATIVE_INT); did = H5Dcreate2(loc_id, "vlen", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); status = H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf5); - assert(status >= 0); + HDassert(status >= 0); status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf5); - assert(status >= 0); + HDassert(status >= 0); status = H5Dclose(did); status = H5Tclose(tid); status = H5Sclose(sid); @@ -5361,7 +6337,7 @@ void write_dset_in(hid_t loc_id, /* allocate and initialize array data to write */ size = ( H5TOOLS_MALLOCSIZE / sizeof(double) + 1 ) * sizeof(double); - dbuf = malloc( size ); + dbuf = HDmalloc( size ); for( j = 0; j < H5TOOLS_MALLOCSIZE / sizeof(double) + 1; j++) dbuf[j] = j; @@ -5385,7 +6361,7 @@ void write_dset_in(hid_t loc_id, H5Dclose(did); H5Tclose(tid); H5Sclose(sid); - free( dbuf ); + HDfree( dbuf ); } /*------------------------------------------------------------------------- @@ -5828,10 +6804,10 @@ void gen_datareg(hid_t fid, int i; /* allocate the buffer for write the references */ - rbuf = calloc((size_t)2, sizeof(hdset_reg_ref_t)); + rbuf = HDcalloc((size_t)2, sizeof(hdset_reg_ref_t)); /* allocate the buffer for write the data dataset */ - buf = malloc(10 * 10 * sizeof(int)); + buf = HDmalloc(10 * 10 * sizeof(int)); for(i = 0; i < 10 * 10; i++) buf[i] = i; @@ -5840,7 +6816,7 @@ void gen_datareg(hid_t fid, 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); + HDassert(status >= 0); /* create the reference dataset */ sid2 = H5Screate_simple(1, dims2, NULL); @@ -5857,12 +6833,12 @@ void gen_datareg(hid_t fid, } status = H5Sselect_hyperslab(sid1, H5S_SELECT_SET, start, NULL, count, NULL); - assert(status >= 0); + HDassert(status >= 0); H5Sget_select_npoints(sid1); /* store first dataset region */ status = H5Rcreate(&rbuf[0], fid, "dsetref", H5R_DATASET_REGION, sid1); - assert(status >= 0); + HDassert(status >= 0); /* select sequence of five points for second reference */ coord[0][0]=6; coord[0][1]=9; @@ -5884,20 +6860,20 @@ void gen_datareg(hid_t fid, /* write */ status = H5Dwrite(did2,H5T_STD_REF_DSETREG,H5S_ALL,H5S_ALL,H5P_DEFAULT,rbuf); - assert(status >= 0); + HDassert(status >= 0); /* close, free memory buffers */ status = H5Dclose(did1); - assert(status >= 0); + HDassert(status >= 0); status = H5Sclose(sid1); - assert(status >= 0); + HDassert(status >= 0); status = H5Dclose(did2); - assert(status >= 0); + HDassert(status >= 0); status = H5Sclose(sid2); - assert(status >= 0); + HDassert(status >= 0); - free(rbuf); - free(buf); + HDfree(rbuf); + HDfree(buf); } @@ -5977,7 +6953,7 @@ int test_hyperslab(const char *fname, } } - free(buf); + HDfree(buf); buf=NULL; /* close */ diff --git a/tools/h5diff/ph5diff_main.c b/tools/h5diff/ph5diff_main.c index bac1086..1fc563b 100644 --- a/tools/h5diff/ph5diff_main.c +++ b/tools/h5diff/ph5diff_main.c @@ -19,6 +19,7 @@ #include #include #include "h5diff_common.h" +#include "h5tools.h" #include "h5tools_utils.h" /* Name of tool */ @@ -68,6 +69,9 @@ int main(int argc, const char *argv[]) h5tools_setprogname(PROGRAMNAME); h5tools_setstatus(EXIT_SUCCESS); + /* Initialize h5tools lib */ + h5tools_init(); + outBuffOffset = 0; g_Parallel = 1; @@ -136,7 +140,7 @@ int main(int argc, const char *argv[]) static void ph5diff_worker(int nID) { - struct diff_args args; + struct diff_mpi_args args; hid_t file1_id, file2_id; char filenames[2][MAX_FILENAME]; char out_data[PRINT_DATA_MAX_SIZE] = {0}; @@ -177,7 +181,7 @@ ph5diff_worker(int nID) /*Recv parameters for diff from manager task */ MPI_Recv(&args, sizeof(args), MPI_BYTE, 0, MPI_TAG_ARGS, MPI_COMM_WORLD, &Status); /*Do the diff */ - diffs.nfound = diff(file1_id, args.name1, file2_id, args.name2, &(args.options), args.type); + diffs.nfound = diff(file1_id, args.name1, file2_id, args.name2, &(args.options), &(args.argdata)); diffs.not_cmp = args.options.not_cmp; /*If print buffer has something in it, request print token.*/ @@ -245,3 +249,32 @@ ph5diff_worker(int nID) } } +/*------------------------------------------------------------------------- + * Function: h5diff_exit + * + * Purpose: dismiss phdiff worker processes and exit + * + * Return: none + * + * Programmer: Albert Cheng + * Date: Feb 6, 2005 + * + * Comments: + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +void h5diff_exit(int status) +{ + /* if in parallel mode, dismiss workers, close down MPI, then exit */ + if((g_nTasks > 1) && g_Parallel) { + phdiff_dismiss_workers(); + MPI_Barrier(MPI_COMM_WORLD); + } + if(g_Parallel) + MPI_Finalize(); + + exit(status); +} + diff --git a/tools/h5diff/testfiles/compounds_array_vlen1.h5 b/tools/h5diff/testfiles/compounds_array_vlen1.h5 new file mode 100644 index 0000000..398026c Binary files /dev/null and b/tools/h5diff/testfiles/compounds_array_vlen1.h5 differ diff --git a/tools/h5diff/testfiles/compounds_array_vlen2.h5 b/tools/h5diff/testfiles/compounds_array_vlen2.h5 new file mode 100644 index 0000000..f6f0868 Binary files /dev/null and b/tools/h5diff/testfiles/compounds_array_vlen2.h5 differ diff --git a/tools/h5diff/testfiles/h5diff_10.txt b/tools/h5diff/testfiles/h5diff_10.txt index fd13a5c..a699f00 100644 --- a/tools/h5diff/testfiles/h5diff_10.txt +++ b/tools/h5diff/testfiles/h5diff_10.txt @@ -1,95 +1,96 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] - file1 File name of the first HDF5 file - file2 File name of the second HDF5 file - [obj1] Name of an HDF5 object, in absolute path - [obj2] Name of an HDF5 object, in absolute path + file1 File name of the first HDF5 file + file2 File name of the second HDF5 file + [obj1] Name of an HDF5 object, in absolute path + [obj2] Name of an HDF5 object, in absolute path OPTIONS - -h, --help Print a usage message and exit. - -V, --version Print version number and exit. - -r, --report Report mode. Print differences. - -v --verbose Verbose mode. Print differences information and list - of objects. - -vN --verbose=N Verbose mode with level. Print differences and list - of objects. - Level of detail depends on value of N: - 0 : Identical to '-v' or '--verbose'. - 1 : All level 0 information plus one-line attribute - status summary. - 2 : All level 1 information plus extended attribute - status report. - -q, --quiet Quiet mode. Do not produce output. - --follow-symlinks Follow symbolic links (soft links and external links) - and compare the links' target objects. - If symbolic link(s) with the same name exist in the - files being compared, then determine whether the - target of each link is an existing object (dataset, - group, or named datatype) or the link is a dangling - link (a soft or external link pointing to a target - object that does not yet exist). - - If both symbolic links are dangling links, they - are treated as being the same; by default, h5diff - returns an exit code of 0. If, however, - --no-dangling-links is used with --follow-symlinks, - this situation is treated as an error and h5diff - returns an exit code of 2. - - If only one of the two links is a dangling link, - they are treated as being different and h5diff - returns an exit code of 1. If, however, - --no-dangling-links is used with --follow-symlinks, - this situation is treated as an error and h5diff - returns an exit code of 2. - - If both symbolic links point to existing objects, - h5diff compares the two objects. - If any symbolic link specified in the call to h5diff - does not exist, h5diff treats it as an error and - returns an exit code of 2. - --no-dangling-links Must be used with --follow-symlinks option; - otherwise, h5diff shows error message and returns - an exit code of 2. - Check for any symbolic links (soft links or external - links) that do not resolve to an existing object - (dataset, group, or named datatype). If any - dangling link is found, this situation is treated as - an error and h5diff returns an exit code of 2. - -c, --compare List objects that are not comparable - -N, --nan Avoid NaNs detection - -n C, --count=C Print differences up to C number, C is a positive - integer. - -d D, --delta=D Print difference if (|a-b| > D), D is a positive - number. - -p R, --relative=R Print difference if (|(a-b)/b| > R), R is a positive - number. - --use-system-epsilon Print difference if (|a-b| > EPSILON), EPSILON is - a system epsilon value. - If the system epsilon is not defined, the below - one of the following predefined values will be used: - FLT_EPSILON = 1.19209E-07 for floating-point type - DBL_EPSILON = 2.22045E-16 for double percision type - --exclude-path "path" Exclude the specified path to an object when - comparing files or groups. If a group is excluded, - all member objects will also be excluded. - The specified path is excluded wherever it occurs. - This flexibility enables the same option to exclude - either objects that exist only in one file or - common objects that are known to differ. + -h, --help + Print a usage message and exit. + -V, --version + Print version number and exit. + -r, --report + Report mode. Print differences. + -v --verbose + Verbose mode. Print differences information and list of objects. + -vN --verbose=N + Verbose mode with level. Print differences and list of objects. + Level of detail depends on value of N: + 0 : Identical to '-v' or '--verbose'. + 1 : All level 0 information plus one-line attribute + status summary. + 2 : All level 1 information plus extended attribute + status report. + -q, --quiet + Quiet mode. Do not produce output. + --follow-symlinks + Follow symbolic links (soft links and external links and compare the) + links' target objects. + If symbolic link(s) with the same name exist in the files being + compared, then determine whether the target of each link is an existing + object (dataset, group, or named datatype) or the link is a dangling + link (a soft or external link pointing to a target object that does + not yet exist). + - If both symbolic links are dangling links, they are treated as being + the same; by default, h5diff returns an exit code of 0. + If, however, --no-dangling-links is used with --follow-symlinks, + this situation is treated as an error and h5diff returns an + exit code of 2. + - If only one of the two links is a dangling link,they are treated as + being different and h5diff returns an exit code of 1. + If, however, --no-dangling-links is used with --follow-symlinks, + this situation is treated as an error and h5diff returns an + exit code of 2. + - If both symbolic links point to existing objects, h5diff compares the + two objects. + If any symbolic link specified in the call to h5diff does not exist, + h5diff treats it as an error and returns an exit code of 2. + --no-dangling-links + Must be used with --follow-symlinks option; otherwise, h5diff shows + error message and returns an exit code of 2. + Check for any symbolic links (soft links or external links) that do not + resolve to an existing object (dataset, group, or named datatype). + If any dangling link is found, this situation is treated as an error + and h5diff returns an exit code of 2. + -c, --compare + List objects that are not comparable + -N, --nan + Avoid NaNs detection + -n C, --count=C + Print differences up to C. C must be a positive integer. + -d D, --delta=D + Print difference if (|a-b| > D). D must be a positive number. + Can not use with '-p' or '--use-system-epsilon'. + -p R, --relative=R + Print difference if (|(a-b)/b| > R). R must be a positive number. + Can not use with '-d' or '--use-system-epsilon'. + --use-system-epsilon + Print difference if (|a-b| > EPSILON), EPSILON is system defined value. + If the system epsilon is not defined,one of the following predefined + values will be used: + FLT_EPSILON = 1.19209E-07 for floating-point type + DBL_EPSILON = 2.22045E-16 for double precision type + Can not use with '-p' or '-d'. + --exclude-path "path" + Exclude the specified path to an object when comparing files or groups. + If a group is excluded, all member objects will also be excluded. + The specified path is excluded wherever it occurs. + This flexibility enables the same option to exclude either objects that + exist only in one file or common objects that are known to differ. - When comparing files, "path" is the absolute path to - the excluded object; when comparing groups, "path" is - similar to the relative path from the group to the - excluded object. This "path" can be taken from the - first section of the output of the --verbose option. - For example, if you are comparing the group /groupA - in two files and you want to exclude - /groupA/groupB/groupC in both files, the exclude - option would read as follows: - --exclude-path "/groupB/groupC" + When comparing files, "path" is the absolute path to the excluded; + object; when comparing groups, "path" is similar to the relative + path from the group to the excluded object. This "path" can be + taken from the first section of the output of the --verbose option. + For example, if you are comparing the group /groupA in two files and + you want to exclude /groupA/groupB/groupC in both files, the exclude + option would read as follows: + --exclude-path "/groupB/groupC" - If there are multiple paths to an object, only the - specified path(s) will be excluded; the comparison - will include any path not explicitly excluded. - This option can be used repeatedly to exclude - multiple paths. + If there are multiple paths to an object, only the specified path(s) + will be excluded; the comparison will include any path not explicitly + excluded. + This option can be used repeatedly to exclude multiple paths. Modes of output: Default mode: print the number of differences found and where they occured diff --git a/tools/h5diff/testfiles/h5diff_17.txt b/tools/h5diff/testfiles/h5diff_17.txt index 5cb604d..4906a2a 100644 --- a/tools/h5diff/testfiles/h5diff_17.txt +++ b/tools/h5diff/testfiles/h5diff_17.txt @@ -22,9 +22,12 @@ file1 file2 x /g1/fp16 x /g1/fp17 x /g1/fp18 + x /g1/fp18_COPY x /g1/fp19 + x /g1/fp19_COPY x /g1/fp2 x /g1/fp20 + x /g1/fp20_COPY x /g1/ld x /g2 x /g2/dset1 diff --git a/tools/h5diff/testfiles/h5diff_171.txt b/tools/h5diff/testfiles/h5diff_171.txt index 5314a79..aabe16a 100644 --- a/tools/h5diff/testfiles/h5diff_171.txt +++ b/tools/h5diff/testfiles/h5diff_171.txt @@ -1,3 +1,3 @@ -dataset: and +dataset: and 0 differences found EXIT CODE: 0 diff --git a/tools/h5diff/testfiles/h5diff_172.txt b/tools/h5diff/testfiles/h5diff_172.txt index 0269194..852f7b5 100644 --- a/tools/h5diff/testfiles/h5diff_172.txt +++ b/tools/h5diff/testfiles/h5diff_172.txt @@ -1,3 +1,3 @@ -dataset: and +dataset: and 0 differences found EXIT CODE: 0 diff --git a/tools/h5diff/testfiles/h5diff_20.txt b/tools/h5diff/testfiles/h5diff_20.txt index 6eba851..3edb543 100644 --- a/tools/h5diff/testfiles/h5diff_20.txt +++ b/tools/h5diff/testfiles/h5diff_20.txt @@ -2,5 +2,5 @@ -------------------------------- Some objects are not comparable -------------------------------- -Use -c for a list of objects. +Use -c for a list of objects without details of differences. EXIT CODE: 0 diff --git a/tools/h5diff/testfiles/h5diff_202.txt b/tools/h5diff/testfiles/h5diff_202.txt index 53657d3..95ef1da 100644 --- a/tools/h5diff/testfiles/h5diff_202.txt +++ b/tools/h5diff/testfiles/h5diff_202.txt @@ -1,3 +1,2 @@ Not comparable: is of class H5T_FLOAT and is of class H5T_INTEGER -Not comparable: has sign H5T_SGN_ERROR and has sign H5T_SGN_2 EXIT CODE: 0 diff --git a/tools/h5diff/testfiles/h5diff_205.txt b/tools/h5diff/testfiles/h5diff_205.txt index d72797b..bf5650f 100644 --- a/tools/h5diff/testfiles/h5diff_205.txt +++ b/tools/h5diff/testfiles/h5diff_205.txt @@ -1,4 +1,3 @@ Not comparable: has rank 2, dimensions [2x2], max dimensions [2x2] and has rank 2, dimensions [3x2], max dimensions [3x2] -Not comparable: has sign H5T_SGN_2 and has sign H5T_SGN_NONE EXIT CODE: 0 diff --git a/tools/h5diff/testfiles/h5diff_208.txt b/tools/h5diff/testfiles/h5diff_208.txt new file mode 100644 index 0000000..783be90 --- /dev/null +++ b/tools/h5diff/testfiles/h5diff_208.txt @@ -0,0 +1,5 @@ +Not comparable: or is an empty dataset +Not comparable: or is an empty dataset +Not comparable: has rank 2, dimensions [0x0], max dimensions [0x0] +and has rank 2, dimensions [0x4], max dimensions [0x4] +EXIT CODE: 0 diff --git a/tools/h5diff/testfiles/h5diff_21.txt b/tools/h5diff/testfiles/h5diff_21.txt index 238c8b8..1479457 100644 --- a/tools/h5diff/testfiles/h5diff_21.txt +++ b/tools/h5diff/testfiles/h5diff_21.txt @@ -2,5 +2,5 @@ -------------------------------- Some objects are not comparable -------------------------------- -Use -c for a list of objects. +Use -c for a list of objects without details of differences. EXIT CODE: 0 diff --git a/tools/h5diff/testfiles/h5diff_22.txt b/tools/h5diff/testfiles/h5diff_22.txt index 33c3a3d..3ccb06b 100644 --- a/tools/h5diff/testfiles/h5diff_22.txt +++ b/tools/h5diff/testfiles/h5diff_22.txt @@ -2,5 +2,5 @@ -------------------------------- Some objects are not comparable -------------------------------- -Use -c for a list of objects. +Use -c for a list of objects without details of differences. EXIT CODE: 0 diff --git a/tools/h5diff/testfiles/h5diff_220.txt b/tools/h5diff/testfiles/h5diff_220.txt new file mode 100644 index 0000000..cadbb6d --- /dev/null +++ b/tools/h5diff/testfiles/h5diff_220.txt @@ -0,0 +1,8 @@ +Not comparable: is of class H5T_INTEGER and is of class H5T_STRING +attribute: > and > +3 differences found +dataset: and +3 differences found +dataset: and +3 differences found +EXIT CODE: 1 diff --git a/tools/h5diff/testfiles/h5diff_221.txt b/tools/h5diff/testfiles/h5diff_221.txt new file mode 100644 index 0000000..621f5c3 --- /dev/null +++ b/tools/h5diff/testfiles/h5diff_221.txt @@ -0,0 +1,12 @@ +Not comparable: is of class H5T_INTEGER and is of class H5T_STRING +Not comparable: has rank 1, dimensions [3], max dimensions [3] +and has rank 1, dimensions [4], max dimensions [4] +Not comparable: has rank 1, dimensions [3], max dimensions [3] +and has rank 2, dimensions [3x1], max dimensions [3x1] +attribute: > and > +3 differences found +dataset: and +6 differences found +dataset: and +3 differences found +EXIT CODE: 1 diff --git a/tools/h5diff/testfiles/h5diff_222.txt b/tools/h5diff/testfiles/h5diff_222.txt new file mode 100644 index 0000000..bdecb8a --- /dev/null +++ b/tools/h5diff/testfiles/h5diff_222.txt @@ -0,0 +1,19 @@ +Not comparable: is of class H5T_INTEGER and is of class H5T_STRING +attribute: > and > +3 differences found +dataset: and +3 differences found +dataset: and +3 differences found +Not comparable: is of class H5T_INTEGER and is of class H5T_STRING +Not comparable: has rank 1, dimensions [3], max dimensions [3] +and has rank 1, dimensions [4], max dimensions [4] +Not comparable: has rank 1, dimensions [3], max dimensions [3] +and has rank 2, dimensions [3x1], max dimensions [3x1] +attribute: > and > +3 differences found +dataset: and +6 differences found +dataset: and +3 differences found +EXIT CODE: 1 diff --git a/tools/h5diff/testfiles/h5diff_30.txt b/tools/h5diff/testfiles/h5diff_30.txt new file mode 100644 index 0000000..187589a --- /dev/null +++ b/tools/h5diff/testfiles/h5diff_30.txt @@ -0,0 +1,9 @@ +dataset: and +size: [6] [6] +position dset1 dset2 difference +------------------------------------------------------------ +[ 1 ] YIN **INVALID VALUE** +[ 2 ] **INVALID VALUE** YIN +[ 5 ] YIN YANG +3 differences found +EXIT CODE: 1 diff --git a/tools/h5diff/testfiles/h5diff_465.txt b/tools/h5diff/testfiles/h5diff_465.txt new file mode 100644 index 0000000..eca5994 --- /dev/null +++ b/tools/h5diff/testfiles/h5diff_465.txt @@ -0,0 +1 @@ +EXIT CODE: 0 diff --git a/tools/h5diff/testfiles/h5diff_466.txt b/tools/h5diff/testfiles/h5diff_466.txt new file mode 100644 index 0000000..3e00ca3 --- /dev/null +++ b/tools/h5diff/testfiles/h5diff_466.txt @@ -0,0 +1,5 @@ +obj1 is a dangling link. +obj2 is a dangling link. +dangling link: and +0 differences found +EXIT CODE: 0 diff --git a/tools/h5diff/testfiles/h5diff_467.txt b/tools/h5diff/testfiles/h5diff_467.txt new file mode 100644 index 0000000..f5195c0 --- /dev/null +++ b/tools/h5diff/testfiles/h5diff_467.txt @@ -0,0 +1,3 @@ +obj2 is a dangling link. +1 differences found +EXIT CODE: 1 diff --git a/tools/h5diff/testfiles/h5diff_468.txt b/tools/h5diff/testfiles/h5diff_468.txt new file mode 100644 index 0000000..75b16c6 --- /dev/null +++ b/tools/h5diff/testfiles/h5diff_468.txt @@ -0,0 +1,5 @@ +obj1 is a dangling link. +obj2 is a dangling link. +dangling link: and +0 differences found +EXIT CODE: 0 diff --git a/tools/h5diff/testfiles/h5diff_469.txt b/tools/h5diff/testfiles/h5diff_469.txt new file mode 100644 index 0000000..594fd80 --- /dev/null +++ b/tools/h5diff/testfiles/h5diff_469.txt @@ -0,0 +1,3 @@ +obj2 is a dangling link. +1 differences found +EXIT CODE: 1 diff --git a/tools/h5diff/testfiles/h5diff_505.txt b/tools/h5diff/testfiles/h5diff_505.txt index 28640b7..a220730 100644 --- a/tools/h5diff/testfiles/h5diff_505.txt +++ b/tools/h5diff/testfiles/h5diff_505.txt @@ -2,5 +2,5 @@ -------------------------------- Some objects are not comparable -------------------------------- -Use -c for a list of objects. +Use -c for a list of objects without details of differences. EXIT CODE: 0 diff --git a/tools/h5diff/testfiles/h5diff_507.txt b/tools/h5diff/testfiles/h5diff_507.txt index ed2b799..6176f3f 100644 --- a/tools/h5diff/testfiles/h5diff_507.txt +++ b/tools/h5diff/testfiles/h5diff_507.txt @@ -2,5 +2,5 @@ -------------------------------- Some objects are not comparable -------------------------------- -Use -c for a list of objects. +Use -c for a list of objects without details of differences. EXIT CODE: 0 diff --git a/tools/h5diff/testfiles/h5diff_509.txt b/tools/h5diff/testfiles/h5diff_509.txt index 145cd9d..a51ab35 100644 --- a/tools/h5diff/testfiles/h5diff_509.txt +++ b/tools/h5diff/testfiles/h5diff_509.txt @@ -2,5 +2,5 @@ -------------------------------- Some objects are not comparable -------------------------------- -Use -c for a list of objects. +Use -c for a list of objects without details of differences. EXIT CODE: 0 diff --git a/tools/h5diff/testfiles/h5diff_530.txt b/tools/h5diff/testfiles/h5diff_530.txt index bd2b435..73d736e 100644 --- a/tools/h5diff/testfiles/h5diff_530.txt +++ b/tools/h5diff/testfiles/h5diff_530.txt @@ -1,7 +1,7 @@ -file1 file2 +group1 group2 --------------------------------------- - x x / + x x x x /Compound_dset1 x x /Compound_dset2 x x /Compound_dset3 @@ -12,24 +12,24 @@ file1 file2 x x /Compound_dset8 x x /Compound_dset9 -group : and +group : and 0 differences found -dataset: and +dataset: and 0 differences found -dataset: and +dataset: and 0 differences found -dataset: and +dataset: and 0 differences found -dataset: and +dataset: and 0 differences found -dataset: and +dataset: and 0 differences found -dataset: and +dataset: and 0 differences found -dataset: and +dataset: and 0 differences found -dataset: and +dataset: and 0 differences found -dataset: and +dataset: and 0 differences found EXIT CODE: 0 diff --git a/tools/h5diff/testfiles/h5diff_540.txt b/tools/h5diff/testfiles/h5diff_540.txt new file mode 100644 index 0000000..a6903c8 --- /dev/null +++ b/tools/h5diff/testfiles/h5diff_540.txt @@ -0,0 +1,86 @@ + +file1 file2 +--------------------------------------- + x x / + x x /dset1 + x x /dset2 + x x /dset3 + x x /dset4 + +group : and +0 differences found +attribute: > and > +size: [2] [2] +position attr1 of attr1 of difference +------------------------------------------------------------ +[ 0 ] 0 5 5 +[ 0 ] 0 5 5 +[ 0 ] 0 5 5 +[ 0 ] 0 5 5 +[ 1 ] 10 15 5 +[ 1 ] 10.5 15.5 5 +[ 1 ] 10 15 5 +[ 1 ] 10.5 15.5 5 +8 differences found +dataset: and +size: [2] [2] +position dset1 dset1 difference +------------------------------------------------------------ +[ 0 ] 0 5 5 +[ 0 ] 0 5 5 +[ 0 ] 0 5 5 +[ 0 ] 0 5 5 +[ 1 ] 10 15 5 +[ 1 ] 10.5 15.5 5 +[ 1 ] 10 15 5 +[ 1 ] 10.5 15.5 5 +8 differences found +dataset: and +size: [2] [2] +position dset2 dset2 difference +------------------------------------------------------------ +[ 0 ] 0 5 5 +[ 0 ] 0 5 5 +[ 1 ] 10 15 5 +[ 1 ] 10.5 15.5 5 +[ 1 ] 10 15 5 +[ 1 ] 10.5 15.5 5 +6 differences found +dataset: and +size: [2] [2] +position dset3 dset3 difference +------------------------------------------------------------ +[ 0 ] 0 5 5 +[ 0 ] 0 5 5 +[ 0 ] 10 15 5 +[ 0 ] 10.5 15.5 5 +[ 0 ] 10 15 5 +[ 0 ] 10.5 15.5 5 +[ 1 ] 0 5 5 +[ 1 ] 0 5 5 +[ 1 ] 10 15 5 +[ 1 ] 10.5 15.5 5 +[ 1 ] 10 15 5 +[ 1 ] 10.5 15.5 5 +12 differences found +dataset: and +size: [2] [2] +position dset4 dset4 difference +------------------------------------------------------------ +[ 0 ] 0 5 5 +[ 0 ] 0 5 5 +[ 0 ] 0 5 5 +[ 0 ] 10 15 5 +[ 0 ] 10.5 15.5 5 +[ 1 ] 10 15 5 +[ 1 ] 0 5 5 +[ 1 ] 0 5 5 +[ 1 ] 10 15 5 +[ 1 ] 10.5 15.5 5 +[ 1 ] 10 15 5 +[ 1 ] 0 5 5 +[ 1 ] 0 5 5 +[ 1 ] 10 15 5 +[ 1 ] 10.5 15.5 5 +15 differences found +EXIT CODE: 1 diff --git a/tools/h5diff/testfiles/h5diff_57.txt b/tools/h5diff/testfiles/h5diff_57.txt index 61aaa57..d5125fe 100644 --- a/tools/h5diff/testfiles/h5diff_57.txt +++ b/tools/h5diff/testfiles/h5diff_57.txt @@ -7,5 +7,5 @@ Not comparable: has sign H5T_SGN_2 and has sign H5T_SGN_NONE -------------------------------- Some objects are not comparable -------------------------------- -Use -c for a list of objects. +Use -c for a list of objects without details of differences. EXIT CODE: 0 diff --git a/tools/h5diff/testfiles/h5diff_600.txt b/tools/h5diff/testfiles/h5diff_600.txt index ecf73d8..3c3ad9f 100644 --- a/tools/h5diff/testfiles/h5diff_600.txt +++ b/tools/h5diff/testfiles/h5diff_600.txt @@ -1,95 +1,96 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] - file1 File name of the first HDF5 file - file2 File name of the second HDF5 file - [obj1] Name of an HDF5 object, in absolute path - [obj2] Name of an HDF5 object, in absolute path + file1 File name of the first HDF5 file + file2 File name of the second HDF5 file + [obj1] Name of an HDF5 object, in absolute path + [obj2] Name of an HDF5 object, in absolute path OPTIONS - -h, --help Print a usage message and exit. - -V, --version Print version number and exit. - -r, --report Report mode. Print differences. - -v --verbose Verbose mode. Print differences information and list - of objects. - -vN --verbose=N Verbose mode with level. Print differences and list - of objects. - Level of detail depends on value of N: - 0 : Identical to '-v' or '--verbose'. - 1 : All level 0 information plus one-line attribute - status summary. - 2 : All level 1 information plus extended attribute - status report. - -q, --quiet Quiet mode. Do not produce output. - --follow-symlinks Follow symbolic links (soft links and external links) - and compare the links' target objects. - If symbolic link(s) with the same name exist in the - files being compared, then determine whether the - target of each link is an existing object (dataset, - group, or named datatype) or the link is a dangling - link (a soft or external link pointing to a target - object that does not yet exist). - - If both symbolic links are dangling links, they - are treated as being the same; by default, h5diff - returns an exit code of 0. If, however, - --no-dangling-links is used with --follow-symlinks, - this situation is treated as an error and h5diff - returns an exit code of 2. - - If only one of the two links is a dangling link, - they are treated as being different and h5diff - returns an exit code of 1. If, however, - --no-dangling-links is used with --follow-symlinks, - this situation is treated as an error and h5diff - returns an exit code of 2. - - If both symbolic links point to existing objects, - h5diff compares the two objects. - If any symbolic link specified in the call to h5diff - does not exist, h5diff treats it as an error and - returns an exit code of 2. - --no-dangling-links Must be used with --follow-symlinks option; - otherwise, h5diff shows error message and returns - an exit code of 2. - Check for any symbolic links (soft links or external - links) that do not resolve to an existing object - (dataset, group, or named datatype). If any - dangling link is found, this situation is treated as - an error and h5diff returns an exit code of 2. - -c, --compare List objects that are not comparable - -N, --nan Avoid NaNs detection - -n C, --count=C Print differences up to C number, C is a positive - integer. - -d D, --delta=D Print difference if (|a-b| > D), D is a positive - number. - -p R, --relative=R Print difference if (|(a-b)/b| > R), R is a positive - number. - --use-system-epsilon Print difference if (|a-b| > EPSILON), EPSILON is - a system epsilon value. - If the system epsilon is not defined, the below - one of the following predefined values will be used: - FLT_EPSILON = 1.19209E-07 for floating-point type - DBL_EPSILON = 2.22045E-16 for double percision type - --exclude-path "path" Exclude the specified path to an object when - comparing files or groups. If a group is excluded, - all member objects will also be excluded. - The specified path is excluded wherever it occurs. - This flexibility enables the same option to exclude - either objects that exist only in one file or - common objects that are known to differ. + -h, --help + Print a usage message and exit. + -V, --version + Print version number and exit. + -r, --report + Report mode. Print differences. + -v --verbose + Verbose mode. Print differences information and list of objects. + -vN --verbose=N + Verbose mode with level. Print differences and list of objects. + Level of detail depends on value of N: + 0 : Identical to '-v' or '--verbose'. + 1 : All level 0 information plus one-line attribute + status summary. + 2 : All level 1 information plus extended attribute + status report. + -q, --quiet + Quiet mode. Do not produce output. + --follow-symlinks + Follow symbolic links (soft links and external links and compare the) + links' target objects. + If symbolic link(s) with the same name exist in the files being + compared, then determine whether the target of each link is an existing + object (dataset, group, or named datatype) or the link is a dangling + link (a soft or external link pointing to a target object that does + not yet exist). + - If both symbolic links are dangling links, they are treated as being + the same; by default, h5diff returns an exit code of 0. + If, however, --no-dangling-links is used with --follow-symlinks, + this situation is treated as an error and h5diff returns an + exit code of 2. + - If only one of the two links is a dangling link,they are treated as + being different and h5diff returns an exit code of 1. + If, however, --no-dangling-links is used with --follow-symlinks, + this situation is treated as an error and h5diff returns an + exit code of 2. + - If both symbolic links point to existing objects, h5diff compares the + two objects. + If any symbolic link specified in the call to h5diff does not exist, + h5diff treats it as an error and returns an exit code of 2. + --no-dangling-links + Must be used with --follow-symlinks option; otherwise, h5diff shows + error message and returns an exit code of 2. + Check for any symbolic links (soft links or external links) that do not + resolve to an existing object (dataset, group, or named datatype). + If any dangling link is found, this situation is treated as an error + and h5diff returns an exit code of 2. + -c, --compare + List objects that are not comparable + -N, --nan + Avoid NaNs detection + -n C, --count=C + Print differences up to C. C must be a positive integer. + -d D, --delta=D + Print difference if (|a-b| > D). D must be a positive number. + Can not use with '-p' or '--use-system-epsilon'. + -p R, --relative=R + Print difference if (|(a-b)/b| > R). R must be a positive number. + Can not use with '-d' or '--use-system-epsilon'. + --use-system-epsilon + Print difference if (|a-b| > EPSILON), EPSILON is system defined value. + If the system epsilon is not defined,one of the following predefined + values will be used: + FLT_EPSILON = 1.19209E-07 for floating-point type + DBL_EPSILON = 2.22045E-16 for double precision type + Can not use with '-p' or '-d'. + --exclude-path "path" + Exclude the specified path to an object when comparing files or groups. + If a group is excluded, all member objects will also be excluded. + The specified path is excluded wherever it occurs. + This flexibility enables the same option to exclude either objects that + exist only in one file or common objects that are known to differ. - When comparing files, "path" is the absolute path to - the excluded object; when comparing groups, "path" is - similar to the relative path from the group to the - excluded object. This "path" can be taken from the - first section of the output of the --verbose option. - For example, if you are comparing the group /groupA - in two files and you want to exclude - /groupA/groupB/groupC in both files, the exclude - option would read as follows: - --exclude-path "/groupB/groupC" + When comparing files, "path" is the absolute path to the excluded; + object; when comparing groups, "path" is similar to the relative + path from the group to the excluded object. This "path" can be + taken from the first section of the output of the --verbose option. + For example, if you are comparing the group /groupA in two files and + you want to exclude /groupA/groupB/groupC in both files, the exclude + option would read as follows: + --exclude-path "/groupB/groupC" - If there are multiple paths to an object, only the - specified path(s) will be excluded; the comparison - will include any path not explicitly excluded. - This option can be used repeatedly to exclude - multiple paths. + If there are multiple paths to an object, only the specified path(s) + will be excluded; the comparison will include any path not explicitly + excluded. + This option can be used repeatedly to exclude multiple paths. Modes of output: Default mode: print the number of differences found and where they occured diff --git a/tools/h5diff/testfiles/h5diff_603.txt b/tools/h5diff/testfiles/h5diff_603.txt index 776c468..087764a 100644 --- a/tools/h5diff/testfiles/h5diff_603.txt +++ b/tools/h5diff/testfiles/h5diff_603.txt @@ -1,96 +1,97 @@ <-d -4> is not a valid option usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] - file1 File name of the first HDF5 file - file2 File name of the second HDF5 file - [obj1] Name of an HDF5 object, in absolute path - [obj2] Name of an HDF5 object, in absolute path + file1 File name of the first HDF5 file + file2 File name of the second HDF5 file + [obj1] Name of an HDF5 object, in absolute path + [obj2] Name of an HDF5 object, in absolute path OPTIONS - -h, --help Print a usage message and exit. - -V, --version Print version number and exit. - -r, --report Report mode. Print differences. - -v --verbose Verbose mode. Print differences information and list - of objects. - -vN --verbose=N Verbose mode with level. Print differences and list - of objects. - Level of detail depends on value of N: - 0 : Identical to '-v' or '--verbose'. - 1 : All level 0 information plus one-line attribute - status summary. - 2 : All level 1 information plus extended attribute - status report. - -q, --quiet Quiet mode. Do not produce output. - --follow-symlinks Follow symbolic links (soft links and external links) - and compare the links' target objects. - If symbolic link(s) with the same name exist in the - files being compared, then determine whether the - target of each link is an existing object (dataset, - group, or named datatype) or the link is a dangling - link (a soft or external link pointing to a target - object that does not yet exist). - - If both symbolic links are dangling links, they - are treated as being the same; by default, h5diff - returns an exit code of 0. If, however, - --no-dangling-links is used with --follow-symlinks, - this situation is treated as an error and h5diff - returns an exit code of 2. - - If only one of the two links is a dangling link, - they are treated as being different and h5diff - returns an exit code of 1. If, however, - --no-dangling-links is used with --follow-symlinks, - this situation is treated as an error and h5diff - returns an exit code of 2. - - If both symbolic links point to existing objects, - h5diff compares the two objects. - If any symbolic link specified in the call to h5diff - does not exist, h5diff treats it as an error and - returns an exit code of 2. - --no-dangling-links Must be used with --follow-symlinks option; - otherwise, h5diff shows error message and returns - an exit code of 2. - Check for any symbolic links (soft links or external - links) that do not resolve to an existing object - (dataset, group, or named datatype). If any - dangling link is found, this situation is treated as - an error and h5diff returns an exit code of 2. - -c, --compare List objects that are not comparable - -N, --nan Avoid NaNs detection - -n C, --count=C Print differences up to C number, C is a positive - integer. - -d D, --delta=D Print difference if (|a-b| > D), D is a positive - number. - -p R, --relative=R Print difference if (|(a-b)/b| > R), R is a positive - number. - --use-system-epsilon Print difference if (|a-b| > EPSILON), EPSILON is - a system epsilon value. - If the system epsilon is not defined, the below - one of the following predefined values will be used: - FLT_EPSILON = 1.19209E-07 for floating-point type - DBL_EPSILON = 2.22045E-16 for double percision type - --exclude-path "path" Exclude the specified path to an object when - comparing files or groups. If a group is excluded, - all member objects will also be excluded. - The specified path is excluded wherever it occurs. - This flexibility enables the same option to exclude - either objects that exist only in one file or - common objects that are known to differ. + -h, --help + Print a usage message and exit. + -V, --version + Print version number and exit. + -r, --report + Report mode. Print differences. + -v --verbose + Verbose mode. Print differences information and list of objects. + -vN --verbose=N + Verbose mode with level. Print differences and list of objects. + Level of detail depends on value of N: + 0 : Identical to '-v' or '--verbose'. + 1 : All level 0 information plus one-line attribute + status summary. + 2 : All level 1 information plus extended attribute + status report. + -q, --quiet + Quiet mode. Do not produce output. + --follow-symlinks + Follow symbolic links (soft links and external links and compare the) + links' target objects. + If symbolic link(s) with the same name exist in the files being + compared, then determine whether the target of each link is an existing + object (dataset, group, or named datatype) or the link is a dangling + link (a soft or external link pointing to a target object that does + not yet exist). + - If both symbolic links are dangling links, they are treated as being + the same; by default, h5diff returns an exit code of 0. + If, however, --no-dangling-links is used with --follow-symlinks, + this situation is treated as an error and h5diff returns an + exit code of 2. + - If only one of the two links is a dangling link,they are treated as + being different and h5diff returns an exit code of 1. + If, however, --no-dangling-links is used with --follow-symlinks, + this situation is treated as an error and h5diff returns an + exit code of 2. + - If both symbolic links point to existing objects, h5diff compares the + two objects. + If any symbolic link specified in the call to h5diff does not exist, + h5diff treats it as an error and returns an exit code of 2. + --no-dangling-links + Must be used with --follow-symlinks option; otherwise, h5diff shows + error message and returns an exit code of 2. + Check for any symbolic links (soft links or external links) that do not + resolve to an existing object (dataset, group, or named datatype). + If any dangling link is found, this situation is treated as an error + and h5diff returns an exit code of 2. + -c, --compare + List objects that are not comparable + -N, --nan + Avoid NaNs detection + -n C, --count=C + Print differences up to C. C must be a positive integer. + -d D, --delta=D + Print difference if (|a-b| > D). D must be a positive number. + Can not use with '-p' or '--use-system-epsilon'. + -p R, --relative=R + Print difference if (|(a-b)/b| > R). R must be a positive number. + Can not use with '-d' or '--use-system-epsilon'. + --use-system-epsilon + Print difference if (|a-b| > EPSILON), EPSILON is system defined value. + If the system epsilon is not defined,one of the following predefined + values will be used: + FLT_EPSILON = 1.19209E-07 for floating-point type + DBL_EPSILON = 2.22045E-16 for double precision type + Can not use with '-p' or '-d'. + --exclude-path "path" + Exclude the specified path to an object when comparing files or groups. + If a group is excluded, all member objects will also be excluded. + The specified path is excluded wherever it occurs. + This flexibility enables the same option to exclude either objects that + exist only in one file or common objects that are known to differ. - When comparing files, "path" is the absolute path to - the excluded object; when comparing groups, "path" is - similar to the relative path from the group to the - excluded object. This "path" can be taken from the - first section of the output of the --verbose option. - For example, if you are comparing the group /groupA - in two files and you want to exclude - /groupA/groupB/groupC in both files, the exclude - option would read as follows: - --exclude-path "/groupB/groupC" + When comparing files, "path" is the absolute path to the excluded; + object; when comparing groups, "path" is similar to the relative + path from the group to the excluded object. This "path" can be + taken from the first section of the output of the --verbose option. + For example, if you are comparing the group /groupA in two files and + you want to exclude /groupA/groupB/groupC in both files, the exclude + option would read as follows: + --exclude-path "/groupB/groupC" - If there are multiple paths to an object, only the - specified path(s) will be excluded; the comparison - will include any path not explicitly excluded. - This option can be used repeatedly to exclude - multiple paths. + If there are multiple paths to an object, only the specified path(s) + will be excluded; the comparison will include any path not explicitly + excluded. + This option can be used repeatedly to exclude multiple paths. Modes of output: Default mode: print the number of differences found and where they occured diff --git a/tools/h5diff/testfiles/h5diff_606.txt b/tools/h5diff/testfiles/h5diff_606.txt index 762698d..c31a67e 100644 --- a/tools/h5diff/testfiles/h5diff_606.txt +++ b/tools/h5diff/testfiles/h5diff_606.txt @@ -1,96 +1,97 @@ <-d 0x1> is not a valid option usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] - file1 File name of the first HDF5 file - file2 File name of the second HDF5 file - [obj1] Name of an HDF5 object, in absolute path - [obj2] Name of an HDF5 object, in absolute path + file1 File name of the first HDF5 file + file2 File name of the second HDF5 file + [obj1] Name of an HDF5 object, in absolute path + [obj2] Name of an HDF5 object, in absolute path OPTIONS - -h, --help Print a usage message and exit. - -V, --version Print version number and exit. - -r, --report Report mode. Print differences. - -v --verbose Verbose mode. Print differences information and list - of objects. - -vN --verbose=N Verbose mode with level. Print differences and list - of objects. - Level of detail depends on value of N: - 0 : Identical to '-v' or '--verbose'. - 1 : All level 0 information plus one-line attribute - status summary. - 2 : All level 1 information plus extended attribute - status report. - -q, --quiet Quiet mode. Do not produce output. - --follow-symlinks Follow symbolic links (soft links and external links) - and compare the links' target objects. - If symbolic link(s) with the same name exist in the - files being compared, then determine whether the - target of each link is an existing object (dataset, - group, or named datatype) or the link is a dangling - link (a soft or external link pointing to a target - object that does not yet exist). - - If both symbolic links are dangling links, they - are treated as being the same; by default, h5diff - returns an exit code of 0. If, however, - --no-dangling-links is used with --follow-symlinks, - this situation is treated as an error and h5diff - returns an exit code of 2. - - If only one of the two links is a dangling link, - they are treated as being different and h5diff - returns an exit code of 1. If, however, - --no-dangling-links is used with --follow-symlinks, - this situation is treated as an error and h5diff - returns an exit code of 2. - - If both symbolic links point to existing objects, - h5diff compares the two objects. - If any symbolic link specified in the call to h5diff - does not exist, h5diff treats it as an error and - returns an exit code of 2. - --no-dangling-links Must be used with --follow-symlinks option; - otherwise, h5diff shows error message and returns - an exit code of 2. - Check for any symbolic links (soft links or external - links) that do not resolve to an existing object - (dataset, group, or named datatype). If any - dangling link is found, this situation is treated as - an error and h5diff returns an exit code of 2. - -c, --compare List objects that are not comparable - -N, --nan Avoid NaNs detection - -n C, --count=C Print differences up to C number, C is a positive - integer. - -d D, --delta=D Print difference if (|a-b| > D), D is a positive - number. - -p R, --relative=R Print difference if (|(a-b)/b| > R), R is a positive - number. - --use-system-epsilon Print difference if (|a-b| > EPSILON), EPSILON is - a system epsilon value. - If the system epsilon is not defined, the below - one of the following predefined values will be used: - FLT_EPSILON = 1.19209E-07 for floating-point type - DBL_EPSILON = 2.22045E-16 for double percision type - --exclude-path "path" Exclude the specified path to an object when - comparing files or groups. If a group is excluded, - all member objects will also be excluded. - The specified path is excluded wherever it occurs. - This flexibility enables the same option to exclude - either objects that exist only in one file or - common objects that are known to differ. + -h, --help + Print a usage message and exit. + -V, --version + Print version number and exit. + -r, --report + Report mode. Print differences. + -v --verbose + Verbose mode. Print differences information and list of objects. + -vN --verbose=N + Verbose mode with level. Print differences and list of objects. + Level of detail depends on value of N: + 0 : Identical to '-v' or '--verbose'. + 1 : All level 0 information plus one-line attribute + status summary. + 2 : All level 1 information plus extended attribute + status report. + -q, --quiet + Quiet mode. Do not produce output. + --follow-symlinks + Follow symbolic links (soft links and external links and compare the) + links' target objects. + If symbolic link(s) with the same name exist in the files being + compared, then determine whether the target of each link is an existing + object (dataset, group, or named datatype) or the link is a dangling + link (a soft or external link pointing to a target object that does + not yet exist). + - If both symbolic links are dangling links, they are treated as being + the same; by default, h5diff returns an exit code of 0. + If, however, --no-dangling-links is used with --follow-symlinks, + this situation is treated as an error and h5diff returns an + exit code of 2. + - If only one of the two links is a dangling link,they are treated as + being different and h5diff returns an exit code of 1. + If, however, --no-dangling-links is used with --follow-symlinks, + this situation is treated as an error and h5diff returns an + exit code of 2. + - If both symbolic links point to existing objects, h5diff compares the + two objects. + If any symbolic link specified in the call to h5diff does not exist, + h5diff treats it as an error and returns an exit code of 2. + --no-dangling-links + Must be used with --follow-symlinks option; otherwise, h5diff shows + error message and returns an exit code of 2. + Check for any symbolic links (soft links or external links) that do not + resolve to an existing object (dataset, group, or named datatype). + If any dangling link is found, this situation is treated as an error + and h5diff returns an exit code of 2. + -c, --compare + List objects that are not comparable + -N, --nan + Avoid NaNs detection + -n C, --count=C + Print differences up to C. C must be a positive integer. + -d D, --delta=D + Print difference if (|a-b| > D). D must be a positive number. + Can not use with '-p' or '--use-system-epsilon'. + -p R, --relative=R + Print difference if (|(a-b)/b| > R). R must be a positive number. + Can not use with '-d' or '--use-system-epsilon'. + --use-system-epsilon + Print difference if (|a-b| > EPSILON), EPSILON is system defined value. + If the system epsilon is not defined,one of the following predefined + values will be used: + FLT_EPSILON = 1.19209E-07 for floating-point type + DBL_EPSILON = 2.22045E-16 for double precision type + Can not use with '-p' or '-d'. + --exclude-path "path" + Exclude the specified path to an object when comparing files or groups. + If a group is excluded, all member objects will also be excluded. + The specified path is excluded wherever it occurs. + This flexibility enables the same option to exclude either objects that + exist only in one file or common objects that are known to differ. - When comparing files, "path" is the absolute path to - the excluded object; when comparing groups, "path" is - similar to the relative path from the group to the - excluded object. This "path" can be taken from the - first section of the output of the --verbose option. - For example, if you are comparing the group /groupA - in two files and you want to exclude - /groupA/groupB/groupC in both files, the exclude - option would read as follows: - --exclude-path "/groupB/groupC" + When comparing files, "path" is the absolute path to the excluded; + object; when comparing groups, "path" is similar to the relative + path from the group to the excluded object. This "path" can be + taken from the first section of the output of the --verbose option. + For example, if you are comparing the group /groupA in two files and + you want to exclude /groupA/groupB/groupC in both files, the exclude + option would read as follows: + --exclude-path "/groupB/groupC" - If there are multiple paths to an object, only the - specified path(s) will be excluded; the comparison - will include any path not explicitly excluded. - This option can be used repeatedly to exclude - multiple paths. + If there are multiple paths to an object, only the specified path(s) + will be excluded; the comparison will include any path not explicitly + excluded. + This option can be used repeatedly to exclude multiple paths. Modes of output: Default mode: print the number of differences found and where they occured diff --git a/tools/h5diff/testfiles/h5diff_612.txt b/tools/h5diff/testfiles/h5diff_612.txt index c5b3464..05318bd 100644 --- a/tools/h5diff/testfiles/h5diff_612.txt +++ b/tools/h5diff/testfiles/h5diff_612.txt @@ -1,96 +1,97 @@ <-p -4> is not a valid option usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] - file1 File name of the first HDF5 file - file2 File name of the second HDF5 file - [obj1] Name of an HDF5 object, in absolute path - [obj2] Name of an HDF5 object, in absolute path + file1 File name of the first HDF5 file + file2 File name of the second HDF5 file + [obj1] Name of an HDF5 object, in absolute path + [obj2] Name of an HDF5 object, in absolute path OPTIONS - -h, --help Print a usage message and exit. - -V, --version Print version number and exit. - -r, --report Report mode. Print differences. - -v --verbose Verbose mode. Print differences information and list - of objects. - -vN --verbose=N Verbose mode with level. Print differences and list - of objects. - Level of detail depends on value of N: - 0 : Identical to '-v' or '--verbose'. - 1 : All level 0 information plus one-line attribute - status summary. - 2 : All level 1 information plus extended attribute - status report. - -q, --quiet Quiet mode. Do not produce output. - --follow-symlinks Follow symbolic links (soft links and external links) - and compare the links' target objects. - If symbolic link(s) with the same name exist in the - files being compared, then determine whether the - target of each link is an existing object (dataset, - group, or named datatype) or the link is a dangling - link (a soft or external link pointing to a target - object that does not yet exist). - - If both symbolic links are dangling links, they - are treated as being the same; by default, h5diff - returns an exit code of 0. If, however, - --no-dangling-links is used with --follow-symlinks, - this situation is treated as an error and h5diff - returns an exit code of 2. - - If only one of the two links is a dangling link, - they are treated as being different and h5diff - returns an exit code of 1. If, however, - --no-dangling-links is used with --follow-symlinks, - this situation is treated as an error and h5diff - returns an exit code of 2. - - If both symbolic links point to existing objects, - h5diff compares the two objects. - If any symbolic link specified in the call to h5diff - does not exist, h5diff treats it as an error and - returns an exit code of 2. - --no-dangling-links Must be used with --follow-symlinks option; - otherwise, h5diff shows error message and returns - an exit code of 2. - Check for any symbolic links (soft links or external - links) that do not resolve to an existing object - (dataset, group, or named datatype). If any - dangling link is found, this situation is treated as - an error and h5diff returns an exit code of 2. - -c, --compare List objects that are not comparable - -N, --nan Avoid NaNs detection - -n C, --count=C Print differences up to C number, C is a positive - integer. - -d D, --delta=D Print difference if (|a-b| > D), D is a positive - number. - -p R, --relative=R Print difference if (|(a-b)/b| > R), R is a positive - number. - --use-system-epsilon Print difference if (|a-b| > EPSILON), EPSILON is - a system epsilon value. - If the system epsilon is not defined, the below - one of the following predefined values will be used: - FLT_EPSILON = 1.19209E-07 for floating-point type - DBL_EPSILON = 2.22045E-16 for double percision type - --exclude-path "path" Exclude the specified path to an object when - comparing files or groups. If a group is excluded, - all member objects will also be excluded. - The specified path is excluded wherever it occurs. - This flexibility enables the same option to exclude - either objects that exist only in one file or - common objects that are known to differ. + -h, --help + Print a usage message and exit. + -V, --version + Print version number and exit. + -r, --report + Report mode. Print differences. + -v --verbose + Verbose mode. Print differences information and list of objects. + -vN --verbose=N + Verbose mode with level. Print differences and list of objects. + Level of detail depends on value of N: + 0 : Identical to '-v' or '--verbose'. + 1 : All level 0 information plus one-line attribute + status summary. + 2 : All level 1 information plus extended attribute + status report. + -q, --quiet + Quiet mode. Do not produce output. + --follow-symlinks + Follow symbolic links (soft links and external links and compare the) + links' target objects. + If symbolic link(s) with the same name exist in the files being + compared, then determine whether the target of each link is an existing + object (dataset, group, or named datatype) or the link is a dangling + link (a soft or external link pointing to a target object that does + not yet exist). + - If both symbolic links are dangling links, they are treated as being + the same; by default, h5diff returns an exit code of 0. + If, however, --no-dangling-links is used with --follow-symlinks, + this situation is treated as an error and h5diff returns an + exit code of 2. + - If only one of the two links is a dangling link,they are treated as + being different and h5diff returns an exit code of 1. + If, however, --no-dangling-links is used with --follow-symlinks, + this situation is treated as an error and h5diff returns an + exit code of 2. + - If both symbolic links point to existing objects, h5diff compares the + two objects. + If any symbolic link specified in the call to h5diff does not exist, + h5diff treats it as an error and returns an exit code of 2. + --no-dangling-links + Must be used with --follow-symlinks option; otherwise, h5diff shows + error message and returns an exit code of 2. + Check for any symbolic links (soft links or external links) that do not + resolve to an existing object (dataset, group, or named datatype). + If any dangling link is found, this situation is treated as an error + and h5diff returns an exit code of 2. + -c, --compare + List objects that are not comparable + -N, --nan + Avoid NaNs detection + -n C, --count=C + Print differences up to C. C must be a positive integer. + -d D, --delta=D + Print difference if (|a-b| > D). D must be a positive number. + Can not use with '-p' or '--use-system-epsilon'. + -p R, --relative=R + Print difference if (|(a-b)/b| > R). R must be a positive number. + Can not use with '-d' or '--use-system-epsilon'. + --use-system-epsilon + Print difference if (|a-b| > EPSILON), EPSILON is system defined value. + If the system epsilon is not defined,one of the following predefined + values will be used: + FLT_EPSILON = 1.19209E-07 for floating-point type + DBL_EPSILON = 2.22045E-16 for double precision type + Can not use with '-p' or '-d'. + --exclude-path "path" + Exclude the specified path to an object when comparing files or groups. + If a group is excluded, all member objects will also be excluded. + The specified path is excluded wherever it occurs. + This flexibility enables the same option to exclude either objects that + exist only in one file or common objects that are known to differ. - When comparing files, "path" is the absolute path to - the excluded object; when comparing groups, "path" is - similar to the relative path from the group to the - excluded object. This "path" can be taken from the - first section of the output of the --verbose option. - For example, if you are comparing the group /groupA - in two files and you want to exclude - /groupA/groupB/groupC in both files, the exclude - option would read as follows: - --exclude-path "/groupB/groupC" + When comparing files, "path" is the absolute path to the excluded; + object; when comparing groups, "path" is similar to the relative + path from the group to the excluded object. This "path" can be + taken from the first section of the output of the --verbose option. + For example, if you are comparing the group /groupA in two files and + you want to exclude /groupA/groupB/groupC in both files, the exclude + option would read as follows: + --exclude-path "/groupB/groupC" - If there are multiple paths to an object, only the - specified path(s) will be excluded; the comparison - will include any path not explicitly excluded. - This option can be used repeatedly to exclude - multiple paths. + If there are multiple paths to an object, only the specified path(s) + will be excluded; the comparison will include any path not explicitly + excluded. + This option can be used repeatedly to exclude multiple paths. Modes of output: Default mode: print the number of differences found and where they occured diff --git a/tools/h5diff/testfiles/h5diff_615.txt b/tools/h5diff/testfiles/h5diff_615.txt index 58d5c70..fd756b3 100644 --- a/tools/h5diff/testfiles/h5diff_615.txt +++ b/tools/h5diff/testfiles/h5diff_615.txt @@ -1,96 +1,97 @@ <-p 0x1> is not a valid option usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] - file1 File name of the first HDF5 file - file2 File name of the second HDF5 file - [obj1] Name of an HDF5 object, in absolute path - [obj2] Name of an HDF5 object, in absolute path + file1 File name of the first HDF5 file + file2 File name of the second HDF5 file + [obj1] Name of an HDF5 object, in absolute path + [obj2] Name of an HDF5 object, in absolute path OPTIONS - -h, --help Print a usage message and exit. - -V, --version Print version number and exit. - -r, --report Report mode. Print differences. - -v --verbose Verbose mode. Print differences information and list - of objects. - -vN --verbose=N Verbose mode with level. Print differences and list - of objects. - Level of detail depends on value of N: - 0 : Identical to '-v' or '--verbose'. - 1 : All level 0 information plus one-line attribute - status summary. - 2 : All level 1 information plus extended attribute - status report. - -q, --quiet Quiet mode. Do not produce output. - --follow-symlinks Follow symbolic links (soft links and external links) - and compare the links' target objects. - If symbolic link(s) with the same name exist in the - files being compared, then determine whether the - target of each link is an existing object (dataset, - group, or named datatype) or the link is a dangling - link (a soft or external link pointing to a target - object that does not yet exist). - - If both symbolic links are dangling links, they - are treated as being the same; by default, h5diff - returns an exit code of 0. If, however, - --no-dangling-links is used with --follow-symlinks, - this situation is treated as an error and h5diff - returns an exit code of 2. - - If only one of the two links is a dangling link, - they are treated as being different and h5diff - returns an exit code of 1. If, however, - --no-dangling-links is used with --follow-symlinks, - this situation is treated as an error and h5diff - returns an exit code of 2. - - If both symbolic links point to existing objects, - h5diff compares the two objects. - If any symbolic link specified in the call to h5diff - does not exist, h5diff treats it as an error and - returns an exit code of 2. - --no-dangling-links Must be used with --follow-symlinks option; - otherwise, h5diff shows error message and returns - an exit code of 2. - Check for any symbolic links (soft links or external - links) that do not resolve to an existing object - (dataset, group, or named datatype). If any - dangling link is found, this situation is treated as - an error and h5diff returns an exit code of 2. - -c, --compare List objects that are not comparable - -N, --nan Avoid NaNs detection - -n C, --count=C Print differences up to C number, C is a positive - integer. - -d D, --delta=D Print difference if (|a-b| > D), D is a positive - number. - -p R, --relative=R Print difference if (|(a-b)/b| > R), R is a positive - number. - --use-system-epsilon Print difference if (|a-b| > EPSILON), EPSILON is - a system epsilon value. - If the system epsilon is not defined, the below - one of the following predefined values will be used: - FLT_EPSILON = 1.19209E-07 for floating-point type - DBL_EPSILON = 2.22045E-16 for double percision type - --exclude-path "path" Exclude the specified path to an object when - comparing files or groups. If a group is excluded, - all member objects will also be excluded. - The specified path is excluded wherever it occurs. - This flexibility enables the same option to exclude - either objects that exist only in one file or - common objects that are known to differ. + -h, --help + Print a usage message and exit. + -V, --version + Print version number and exit. + -r, --report + Report mode. Print differences. + -v --verbose + Verbose mode. Print differences information and list of objects. + -vN --verbose=N + Verbose mode with level. Print differences and list of objects. + Level of detail depends on value of N: + 0 : Identical to '-v' or '--verbose'. + 1 : All level 0 information plus one-line attribute + status summary. + 2 : All level 1 information plus extended attribute + status report. + -q, --quiet + Quiet mode. Do not produce output. + --follow-symlinks + Follow symbolic links (soft links and external links and compare the) + links' target objects. + If symbolic link(s) with the same name exist in the files being + compared, then determine whether the target of each link is an existing + object (dataset, group, or named datatype) or the link is a dangling + link (a soft or external link pointing to a target object that does + not yet exist). + - If both symbolic links are dangling links, they are treated as being + the same; by default, h5diff returns an exit code of 0. + If, however, --no-dangling-links is used with --follow-symlinks, + this situation is treated as an error and h5diff returns an + exit code of 2. + - If only one of the two links is a dangling link,they are treated as + being different and h5diff returns an exit code of 1. + If, however, --no-dangling-links is used with --follow-symlinks, + this situation is treated as an error and h5diff returns an + exit code of 2. + - If both symbolic links point to existing objects, h5diff compares the + two objects. + If any symbolic link specified in the call to h5diff does not exist, + h5diff treats it as an error and returns an exit code of 2. + --no-dangling-links + Must be used with --follow-symlinks option; otherwise, h5diff shows + error message and returns an exit code of 2. + Check for any symbolic links (soft links or external links) that do not + resolve to an existing object (dataset, group, or named datatype). + If any dangling link is found, this situation is treated as an error + and h5diff returns an exit code of 2. + -c, --compare + List objects that are not comparable + -N, --nan + Avoid NaNs detection + -n C, --count=C + Print differences up to C. C must be a positive integer. + -d D, --delta=D + Print difference if (|a-b| > D). D must be a positive number. + Can not use with '-p' or '--use-system-epsilon'. + -p R, --relative=R + Print difference if (|(a-b)/b| > R). R must be a positive number. + Can not use with '-d' or '--use-system-epsilon'. + --use-system-epsilon + Print difference if (|a-b| > EPSILON), EPSILON is system defined value. + If the system epsilon is not defined,one of the following predefined + values will be used: + FLT_EPSILON = 1.19209E-07 for floating-point type + DBL_EPSILON = 2.22045E-16 for double precision type + Can not use with '-p' or '-d'. + --exclude-path "path" + Exclude the specified path to an object when comparing files or groups. + If a group is excluded, all member objects will also be excluded. + The specified path is excluded wherever it occurs. + This flexibility enables the same option to exclude either objects that + exist only in one file or common objects that are known to differ. - When comparing files, "path" is the absolute path to - the excluded object; when comparing groups, "path" is - similar to the relative path from the group to the - excluded object. This "path" can be taken from the - first section of the output of the --verbose option. - For example, if you are comparing the group /groupA - in two files and you want to exclude - /groupA/groupB/groupC in both files, the exclude - option would read as follows: - --exclude-path "/groupB/groupC" + When comparing files, "path" is the absolute path to the excluded; + object; when comparing groups, "path" is similar to the relative + path from the group to the excluded object. This "path" can be + taken from the first section of the output of the --verbose option. + For example, if you are comparing the group /groupA in two files and + you want to exclude /groupA/groupB/groupC in both files, the exclude + option would read as follows: + --exclude-path "/groupB/groupC" - If there are multiple paths to an object, only the - specified path(s) will be excluded; the comparison - will include any path not explicitly excluded. - This option can be used repeatedly to exclude - multiple paths. + If there are multiple paths to an object, only the specified path(s) + will be excluded; the comparison will include any path not explicitly + excluded. + This option can be used repeatedly to exclude multiple paths. Modes of output: Default mode: print the number of differences found and where they occured diff --git a/tools/h5diff/testfiles/h5diff_621.txt b/tools/h5diff/testfiles/h5diff_621.txt index 1c8f745..fd8c680 100644 --- a/tools/h5diff/testfiles/h5diff_621.txt +++ b/tools/h5diff/testfiles/h5diff_621.txt @@ -1,96 +1,97 @@ <-n -4> is not a valid option usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] - file1 File name of the first HDF5 file - file2 File name of the second HDF5 file - [obj1] Name of an HDF5 object, in absolute path - [obj2] Name of an HDF5 object, in absolute path + file1 File name of the first HDF5 file + file2 File name of the second HDF5 file + [obj1] Name of an HDF5 object, in absolute path + [obj2] Name of an HDF5 object, in absolute path OPTIONS - -h, --help Print a usage message and exit. - -V, --version Print version number and exit. - -r, --report Report mode. Print differences. - -v --verbose Verbose mode. Print differences information and list - of objects. - -vN --verbose=N Verbose mode with level. Print differences and list - of objects. - Level of detail depends on value of N: - 0 : Identical to '-v' or '--verbose'. - 1 : All level 0 information plus one-line attribute - status summary. - 2 : All level 1 information plus extended attribute - status report. - -q, --quiet Quiet mode. Do not produce output. - --follow-symlinks Follow symbolic links (soft links and external links) - and compare the links' target objects. - If symbolic link(s) with the same name exist in the - files being compared, then determine whether the - target of each link is an existing object (dataset, - group, or named datatype) or the link is a dangling - link (a soft or external link pointing to a target - object that does not yet exist). - - If both symbolic links are dangling links, they - are treated as being the same; by default, h5diff - returns an exit code of 0. If, however, - --no-dangling-links is used with --follow-symlinks, - this situation is treated as an error and h5diff - returns an exit code of 2. - - If only one of the two links is a dangling link, - they are treated as being different and h5diff - returns an exit code of 1. If, however, - --no-dangling-links is used with --follow-symlinks, - this situation is treated as an error and h5diff - returns an exit code of 2. - - If both symbolic links point to existing objects, - h5diff compares the two objects. - If any symbolic link specified in the call to h5diff - does not exist, h5diff treats it as an error and - returns an exit code of 2. - --no-dangling-links Must be used with --follow-symlinks option; - otherwise, h5diff shows error message and returns - an exit code of 2. - Check for any symbolic links (soft links or external - links) that do not resolve to an existing object - (dataset, group, or named datatype). If any - dangling link is found, this situation is treated as - an error and h5diff returns an exit code of 2. - -c, --compare List objects that are not comparable - -N, --nan Avoid NaNs detection - -n C, --count=C Print differences up to C number, C is a positive - integer. - -d D, --delta=D Print difference if (|a-b| > D), D is a positive - number. - -p R, --relative=R Print difference if (|(a-b)/b| > R), R is a positive - number. - --use-system-epsilon Print difference if (|a-b| > EPSILON), EPSILON is - a system epsilon value. - If the system epsilon is not defined, the below - one of the following predefined values will be used: - FLT_EPSILON = 1.19209E-07 for floating-point type - DBL_EPSILON = 2.22045E-16 for double percision type - --exclude-path "path" Exclude the specified path to an object when - comparing files or groups. If a group is excluded, - all member objects will also be excluded. - The specified path is excluded wherever it occurs. - This flexibility enables the same option to exclude - either objects that exist only in one file or - common objects that are known to differ. + -h, --help + Print a usage message and exit. + -V, --version + Print version number and exit. + -r, --report + Report mode. Print differences. + -v --verbose + Verbose mode. Print differences information and list of objects. + -vN --verbose=N + Verbose mode with level. Print differences and list of objects. + Level of detail depends on value of N: + 0 : Identical to '-v' or '--verbose'. + 1 : All level 0 information plus one-line attribute + status summary. + 2 : All level 1 information plus extended attribute + status report. + -q, --quiet + Quiet mode. Do not produce output. + --follow-symlinks + Follow symbolic links (soft links and external links and compare the) + links' target objects. + If symbolic link(s) with the same name exist in the files being + compared, then determine whether the target of each link is an existing + object (dataset, group, or named datatype) or the link is a dangling + link (a soft or external link pointing to a target object that does + not yet exist). + - If both symbolic links are dangling links, they are treated as being + the same; by default, h5diff returns an exit code of 0. + If, however, --no-dangling-links is used with --follow-symlinks, + this situation is treated as an error and h5diff returns an + exit code of 2. + - If only one of the two links is a dangling link,they are treated as + being different and h5diff returns an exit code of 1. + If, however, --no-dangling-links is used with --follow-symlinks, + this situation is treated as an error and h5diff returns an + exit code of 2. + - If both symbolic links point to existing objects, h5diff compares the + two objects. + If any symbolic link specified in the call to h5diff does not exist, + h5diff treats it as an error and returns an exit code of 2. + --no-dangling-links + Must be used with --follow-symlinks option; otherwise, h5diff shows + error message and returns an exit code of 2. + Check for any symbolic links (soft links or external links) that do not + resolve to an existing object (dataset, group, or named datatype). + If any dangling link is found, this situation is treated as an error + and h5diff returns an exit code of 2. + -c, --compare + List objects that are not comparable + -N, --nan + Avoid NaNs detection + -n C, --count=C + Print differences up to C. C must be a positive integer. + -d D, --delta=D + Print difference if (|a-b| > D). D must be a positive number. + Can not use with '-p' or '--use-system-epsilon'. + -p R, --relative=R + Print difference if (|(a-b)/b| > R). R must be a positive number. + Can not use with '-d' or '--use-system-epsilon'. + --use-system-epsilon + Print difference if (|a-b| > EPSILON), EPSILON is system defined value. + If the system epsilon is not defined,one of the following predefined + values will be used: + FLT_EPSILON = 1.19209E-07 for floating-point type + DBL_EPSILON = 2.22045E-16 for double precision type + Can not use with '-p' or '-d'. + --exclude-path "path" + Exclude the specified path to an object when comparing files or groups. + If a group is excluded, all member objects will also be excluded. + The specified path is excluded wherever it occurs. + This flexibility enables the same option to exclude either objects that + exist only in one file or common objects that are known to differ. - When comparing files, "path" is the absolute path to - the excluded object; when comparing groups, "path" is - similar to the relative path from the group to the - excluded object. This "path" can be taken from the - first section of the output of the --verbose option. - For example, if you are comparing the group /groupA - in two files and you want to exclude - /groupA/groupB/groupC in both files, the exclude - option would read as follows: - --exclude-path "/groupB/groupC" + When comparing files, "path" is the absolute path to the excluded; + object; when comparing groups, "path" is similar to the relative + path from the group to the excluded object. This "path" can be + taken from the first section of the output of the --verbose option. + For example, if you are comparing the group /groupA in two files and + you want to exclude /groupA/groupB/groupC in both files, the exclude + option would read as follows: + --exclude-path "/groupB/groupC" - If there are multiple paths to an object, only the - specified path(s) will be excluded; the comparison - will include any path not explicitly excluded. - This option can be used repeatedly to exclude - multiple paths. + If there are multiple paths to an object, only the specified path(s) + will be excluded; the comparison will include any path not explicitly + excluded. + This option can be used repeatedly to exclude multiple paths. Modes of output: Default mode: print the number of differences found and where they occured diff --git a/tools/h5diff/testfiles/h5diff_622.txt b/tools/h5diff/testfiles/h5diff_622.txt index 22f216f..f0d38af 100644 --- a/tools/h5diff/testfiles/h5diff_622.txt +++ b/tools/h5diff/testfiles/h5diff_622.txt @@ -1,96 +1,97 @@ <-n 0> is not a valid option usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] - file1 File name of the first HDF5 file - file2 File name of the second HDF5 file - [obj1] Name of an HDF5 object, in absolute path - [obj2] Name of an HDF5 object, in absolute path + file1 File name of the first HDF5 file + file2 File name of the second HDF5 file + [obj1] Name of an HDF5 object, in absolute path + [obj2] Name of an HDF5 object, in absolute path OPTIONS - -h, --help Print a usage message and exit. - -V, --version Print version number and exit. - -r, --report Report mode. Print differences. - -v --verbose Verbose mode. Print differences information and list - of objects. - -vN --verbose=N Verbose mode with level. Print differences and list - of objects. - Level of detail depends on value of N: - 0 : Identical to '-v' or '--verbose'. - 1 : All level 0 information plus one-line attribute - status summary. - 2 : All level 1 information plus extended attribute - status report. - -q, --quiet Quiet mode. Do not produce output. - --follow-symlinks Follow symbolic links (soft links and external links) - and compare the links' target objects. - If symbolic link(s) with the same name exist in the - files being compared, then determine whether the - target of each link is an existing object (dataset, - group, or named datatype) or the link is a dangling - link (a soft or external link pointing to a target - object that does not yet exist). - - If both symbolic links are dangling links, they - are treated as being the same; by default, h5diff - returns an exit code of 0. If, however, - --no-dangling-links is used with --follow-symlinks, - this situation is treated as an error and h5diff - returns an exit code of 2. - - If only one of the two links is a dangling link, - they are treated as being different and h5diff - returns an exit code of 1. If, however, - --no-dangling-links is used with --follow-symlinks, - this situation is treated as an error and h5diff - returns an exit code of 2. - - If both symbolic links point to existing objects, - h5diff compares the two objects. - If any symbolic link specified in the call to h5diff - does not exist, h5diff treats it as an error and - returns an exit code of 2. - --no-dangling-links Must be used with --follow-symlinks option; - otherwise, h5diff shows error message and returns - an exit code of 2. - Check for any symbolic links (soft links or external - links) that do not resolve to an existing object - (dataset, group, or named datatype). If any - dangling link is found, this situation is treated as - an error and h5diff returns an exit code of 2. - -c, --compare List objects that are not comparable - -N, --nan Avoid NaNs detection - -n C, --count=C Print differences up to C number, C is a positive - integer. - -d D, --delta=D Print difference if (|a-b| > D), D is a positive - number. - -p R, --relative=R Print difference if (|(a-b)/b| > R), R is a positive - number. - --use-system-epsilon Print difference if (|a-b| > EPSILON), EPSILON is - a system epsilon value. - If the system epsilon is not defined, the below - one of the following predefined values will be used: - FLT_EPSILON = 1.19209E-07 for floating-point type - DBL_EPSILON = 2.22045E-16 for double percision type - --exclude-path "path" Exclude the specified path to an object when - comparing files or groups. If a group is excluded, - all member objects will also be excluded. - The specified path is excluded wherever it occurs. - This flexibility enables the same option to exclude - either objects that exist only in one file or - common objects that are known to differ. + -h, --help + Print a usage message and exit. + -V, --version + Print version number and exit. + -r, --report + Report mode. Print differences. + -v --verbose + Verbose mode. Print differences information and list of objects. + -vN --verbose=N + Verbose mode with level. Print differences and list of objects. + Level of detail depends on value of N: + 0 : Identical to '-v' or '--verbose'. + 1 : All level 0 information plus one-line attribute + status summary. + 2 : All level 1 information plus extended attribute + status report. + -q, --quiet + Quiet mode. Do not produce output. + --follow-symlinks + Follow symbolic links (soft links and external links and compare the) + links' target objects. + If symbolic link(s) with the same name exist in the files being + compared, then determine whether the target of each link is an existing + object (dataset, group, or named datatype) or the link is a dangling + link (a soft or external link pointing to a target object that does + not yet exist). + - If both symbolic links are dangling links, they are treated as being + the same; by default, h5diff returns an exit code of 0. + If, however, --no-dangling-links is used with --follow-symlinks, + this situation is treated as an error and h5diff returns an + exit code of 2. + - If only one of the two links is a dangling link,they are treated as + being different and h5diff returns an exit code of 1. + If, however, --no-dangling-links is used with --follow-symlinks, + this situation is treated as an error and h5diff returns an + exit code of 2. + - If both symbolic links point to existing objects, h5diff compares the + two objects. + If any symbolic link specified in the call to h5diff does not exist, + h5diff treats it as an error and returns an exit code of 2. + --no-dangling-links + Must be used with --follow-symlinks option; otherwise, h5diff shows + error message and returns an exit code of 2. + Check for any symbolic links (soft links or external links) that do not + resolve to an existing object (dataset, group, or named datatype). + If any dangling link is found, this situation is treated as an error + and h5diff returns an exit code of 2. + -c, --compare + List objects that are not comparable + -N, --nan + Avoid NaNs detection + -n C, --count=C + Print differences up to C. C must be a positive integer. + -d D, --delta=D + Print difference if (|a-b| > D). D must be a positive number. + Can not use with '-p' or '--use-system-epsilon'. + -p R, --relative=R + Print difference if (|(a-b)/b| > R). R must be a positive number. + Can not use with '-d' or '--use-system-epsilon'. + --use-system-epsilon + Print difference if (|a-b| > EPSILON), EPSILON is system defined value. + If the system epsilon is not defined,one of the following predefined + values will be used: + FLT_EPSILON = 1.19209E-07 for floating-point type + DBL_EPSILON = 2.22045E-16 for double precision type + Can not use with '-p' or '-d'. + --exclude-path "path" + Exclude the specified path to an object when comparing files or groups. + If a group is excluded, all member objects will also be excluded. + The specified path is excluded wherever it occurs. + This flexibility enables the same option to exclude either objects that + exist only in one file or common objects that are known to differ. - When comparing files, "path" is the absolute path to - the excluded object; when comparing groups, "path" is - similar to the relative path from the group to the - excluded object. This "path" can be taken from the - first section of the output of the --verbose option. - For example, if you are comparing the group /groupA - in two files and you want to exclude - /groupA/groupB/groupC in both files, the exclude - option would read as follows: - --exclude-path "/groupB/groupC" + When comparing files, "path" is the absolute path to the excluded; + object; when comparing groups, "path" is similar to the relative + path from the group to the excluded object. This "path" can be + taken from the first section of the output of the --verbose option. + For example, if you are comparing the group /groupA in two files and + you want to exclude /groupA/groupB/groupC in both files, the exclude + option would read as follows: + --exclude-path "/groupB/groupC" - If there are multiple paths to an object, only the - specified path(s) will be excluded; the comparison - will include any path not explicitly excluded. - This option can be used repeatedly to exclude - multiple paths. + If there are multiple paths to an object, only the specified path(s) + will be excluded; the comparison will include any path not explicitly + excluded. + This option can be used repeatedly to exclude multiple paths. Modes of output: Default mode: print the number of differences found and where they occured diff --git a/tools/h5diff/testfiles/h5diff_623.txt b/tools/h5diff/testfiles/h5diff_623.txt index 5dce69c..4ab66a5 100644 --- a/tools/h5diff/testfiles/h5diff_623.txt +++ b/tools/h5diff/testfiles/h5diff_623.txt @@ -1,96 +1,97 @@ <-n u> is not a valid option usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] - file1 File name of the first HDF5 file - file2 File name of the second HDF5 file - [obj1] Name of an HDF5 object, in absolute path - [obj2] Name of an HDF5 object, in absolute path + file1 File name of the first HDF5 file + file2 File name of the second HDF5 file + [obj1] Name of an HDF5 object, in absolute path + [obj2] Name of an HDF5 object, in absolute path OPTIONS - -h, --help Print a usage message and exit. - -V, --version Print version number and exit. - -r, --report Report mode. Print differences. - -v --verbose Verbose mode. Print differences information and list - of objects. - -vN --verbose=N Verbose mode with level. Print differences and list - of objects. - Level of detail depends on value of N: - 0 : Identical to '-v' or '--verbose'. - 1 : All level 0 information plus one-line attribute - status summary. - 2 : All level 1 information plus extended attribute - status report. - -q, --quiet Quiet mode. Do not produce output. - --follow-symlinks Follow symbolic links (soft links and external links) - and compare the links' target objects. - If symbolic link(s) with the same name exist in the - files being compared, then determine whether the - target of each link is an existing object (dataset, - group, or named datatype) or the link is a dangling - link (a soft or external link pointing to a target - object that does not yet exist). - - If both symbolic links are dangling links, they - are treated as being the same; by default, h5diff - returns an exit code of 0. If, however, - --no-dangling-links is used with --follow-symlinks, - this situation is treated as an error and h5diff - returns an exit code of 2. - - If only one of the two links is a dangling link, - they are treated as being different and h5diff - returns an exit code of 1. If, however, - --no-dangling-links is used with --follow-symlinks, - this situation is treated as an error and h5diff - returns an exit code of 2. - - If both symbolic links point to existing objects, - h5diff compares the two objects. - If any symbolic link specified in the call to h5diff - does not exist, h5diff treats it as an error and - returns an exit code of 2. - --no-dangling-links Must be used with --follow-symlinks option; - otherwise, h5diff shows error message and returns - an exit code of 2. - Check for any symbolic links (soft links or external - links) that do not resolve to an existing object - (dataset, group, or named datatype). If any - dangling link is found, this situation is treated as - an error and h5diff returns an exit code of 2. - -c, --compare List objects that are not comparable - -N, --nan Avoid NaNs detection - -n C, --count=C Print differences up to C number, C is a positive - integer. - -d D, --delta=D Print difference if (|a-b| > D), D is a positive - number. - -p R, --relative=R Print difference if (|(a-b)/b| > R), R is a positive - number. - --use-system-epsilon Print difference if (|a-b| > EPSILON), EPSILON is - a system epsilon value. - If the system epsilon is not defined, the below - one of the following predefined values will be used: - FLT_EPSILON = 1.19209E-07 for floating-point type - DBL_EPSILON = 2.22045E-16 for double percision type - --exclude-path "path" Exclude the specified path to an object when - comparing files or groups. If a group is excluded, - all member objects will also be excluded. - The specified path is excluded wherever it occurs. - This flexibility enables the same option to exclude - either objects that exist only in one file or - common objects that are known to differ. + -h, --help + Print a usage message and exit. + -V, --version + Print version number and exit. + -r, --report + Report mode. Print differences. + -v --verbose + Verbose mode. Print differences information and list of objects. + -vN --verbose=N + Verbose mode with level. Print differences and list of objects. + Level of detail depends on value of N: + 0 : Identical to '-v' or '--verbose'. + 1 : All level 0 information plus one-line attribute + status summary. + 2 : All level 1 information plus extended attribute + status report. + -q, --quiet + Quiet mode. Do not produce output. + --follow-symlinks + Follow symbolic links (soft links and external links and compare the) + links' target objects. + If symbolic link(s) with the same name exist in the files being + compared, then determine whether the target of each link is an existing + object (dataset, group, or named datatype) or the link is a dangling + link (a soft or external link pointing to a target object that does + not yet exist). + - If both symbolic links are dangling links, they are treated as being + the same; by default, h5diff returns an exit code of 0. + If, however, --no-dangling-links is used with --follow-symlinks, + this situation is treated as an error and h5diff returns an + exit code of 2. + - If only one of the two links is a dangling link,they are treated as + being different and h5diff returns an exit code of 1. + If, however, --no-dangling-links is used with --follow-symlinks, + this situation is treated as an error and h5diff returns an + exit code of 2. + - If both symbolic links point to existing objects, h5diff compares the + two objects. + If any symbolic link specified in the call to h5diff does not exist, + h5diff treats it as an error and returns an exit code of 2. + --no-dangling-links + Must be used with --follow-symlinks option; otherwise, h5diff shows + error message and returns an exit code of 2. + Check for any symbolic links (soft links or external links) that do not + resolve to an existing object (dataset, group, or named datatype). + If any dangling link is found, this situation is treated as an error + and h5diff returns an exit code of 2. + -c, --compare + List objects that are not comparable + -N, --nan + Avoid NaNs detection + -n C, --count=C + Print differences up to C. C must be a positive integer. + -d D, --delta=D + Print difference if (|a-b| > D). D must be a positive number. + Can not use with '-p' or '--use-system-epsilon'. + -p R, --relative=R + Print difference if (|(a-b)/b| > R). R must be a positive number. + Can not use with '-d' or '--use-system-epsilon'. + --use-system-epsilon + Print difference if (|a-b| > EPSILON), EPSILON is system defined value. + If the system epsilon is not defined,one of the following predefined + values will be used: + FLT_EPSILON = 1.19209E-07 for floating-point type + DBL_EPSILON = 2.22045E-16 for double precision type + Can not use with '-p' or '-d'. + --exclude-path "path" + Exclude the specified path to an object when comparing files or groups. + If a group is excluded, all member objects will also be excluded. + The specified path is excluded wherever it occurs. + This flexibility enables the same option to exclude either objects that + exist only in one file or common objects that are known to differ. - When comparing files, "path" is the absolute path to - the excluded object; when comparing groups, "path" is - similar to the relative path from the group to the - excluded object. This "path" can be taken from the - first section of the output of the --verbose option. - For example, if you are comparing the group /groupA - in two files and you want to exclude - /groupA/groupB/groupC in both files, the exclude - option would read as follows: - --exclude-path "/groupB/groupC" + When comparing files, "path" is the absolute path to the excluded; + object; when comparing groups, "path" is similar to the relative + path from the group to the excluded object. This "path" can be + taken from the first section of the output of the --verbose option. + For example, if you are comparing the group /groupA in two files and + you want to exclude /groupA/groupB/groupC in both files, the exclude + option would read as follows: + --exclude-path "/groupB/groupC" - If there are multiple paths to an object, only the - specified path(s) will be excluded; the comparison - will include any path not explicitly excluded. - This option can be used repeatedly to exclude - multiple paths. + If there are multiple paths to an object, only the specified path(s) + will be excluded; the comparison will include any path not explicitly + excluded. + This option can be used repeatedly to exclude multiple paths. Modes of output: Default mode: print the number of differences found and where they occured diff --git a/tools/h5diff/testfiles/h5diff_624.txt b/tools/h5diff/testfiles/h5diff_624.txt index 863e422..f5e7ee3 100644 --- a/tools/h5diff/testfiles/h5diff_624.txt +++ b/tools/h5diff/testfiles/h5diff_624.txt @@ -1,96 +1,97 @@ <-n 0x1> is not a valid option usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]] - file1 File name of the first HDF5 file - file2 File name of the second HDF5 file - [obj1] Name of an HDF5 object, in absolute path - [obj2] Name of an HDF5 object, in absolute path + file1 File name of the first HDF5 file + file2 File name of the second HDF5 file + [obj1] Name of an HDF5 object, in absolute path + [obj2] Name of an HDF5 object, in absolute path OPTIONS - -h, --help Print a usage message and exit. - -V, --version Print version number and exit. - -r, --report Report mode. Print differences. - -v --verbose Verbose mode. Print differences information and list - of objects. - -vN --verbose=N Verbose mode with level. Print differences and list - of objects. - Level of detail depends on value of N: - 0 : Identical to '-v' or '--verbose'. - 1 : All level 0 information plus one-line attribute - status summary. - 2 : All level 1 information plus extended attribute - status report. - -q, --quiet Quiet mode. Do not produce output. - --follow-symlinks Follow symbolic links (soft links and external links) - and compare the links' target objects. - If symbolic link(s) with the same name exist in the - files being compared, then determine whether the - target of each link is an existing object (dataset, - group, or named datatype) or the link is a dangling - link (a soft or external link pointing to a target - object that does not yet exist). - - If both symbolic links are dangling links, they - are treated as being the same; by default, h5diff - returns an exit code of 0. If, however, - --no-dangling-links is used with --follow-symlinks, - this situation is treated as an error and h5diff - returns an exit code of 2. - - If only one of the two links is a dangling link, - they are treated as being different and h5diff - returns an exit code of 1. If, however, - --no-dangling-links is used with --follow-symlinks, - this situation is treated as an error and h5diff - returns an exit code of 2. - - If both symbolic links point to existing objects, - h5diff compares the two objects. - If any symbolic link specified in the call to h5diff - does not exist, h5diff treats it as an error and - returns an exit code of 2. - --no-dangling-links Must be used with --follow-symlinks option; - otherwise, h5diff shows error message and returns - an exit code of 2. - Check for any symbolic links (soft links or external - links) that do not resolve to an existing object - (dataset, group, or named datatype). If any - dangling link is found, this situation is treated as - an error and h5diff returns an exit code of 2. - -c, --compare List objects that are not comparable - -N, --nan Avoid NaNs detection - -n C, --count=C Print differences up to C number, C is a positive - integer. - -d D, --delta=D Print difference if (|a-b| > D), D is a positive - number. - -p R, --relative=R Print difference if (|(a-b)/b| > R), R is a positive - number. - --use-system-epsilon Print difference if (|a-b| > EPSILON), EPSILON is - a system epsilon value. - If the system epsilon is not defined, the below - one of the following predefined values will be used: - FLT_EPSILON = 1.19209E-07 for floating-point type - DBL_EPSILON = 2.22045E-16 for double percision type - --exclude-path "path" Exclude the specified path to an object when - comparing files or groups. If a group is excluded, - all member objects will also be excluded. - The specified path is excluded wherever it occurs. - This flexibility enables the same option to exclude - either objects that exist only in one file or - common objects that are known to differ. + -h, --help + Print a usage message and exit. + -V, --version + Print version number and exit. + -r, --report + Report mode. Print differences. + -v --verbose + Verbose mode. Print differences information and list of objects. + -vN --verbose=N + Verbose mode with level. Print differences and list of objects. + Level of detail depends on value of N: + 0 : Identical to '-v' or '--verbose'. + 1 : All level 0 information plus one-line attribute + status summary. + 2 : All level 1 information plus extended attribute + status report. + -q, --quiet + Quiet mode. Do not produce output. + --follow-symlinks + Follow symbolic links (soft links and external links and compare the) + links' target objects. + If symbolic link(s) with the same name exist in the files being + compared, then determine whether the target of each link is an existing + object (dataset, group, or named datatype) or the link is a dangling + link (a soft or external link pointing to a target object that does + not yet exist). + - If both symbolic links are dangling links, they are treated as being + the same; by default, h5diff returns an exit code of 0. + If, however, --no-dangling-links is used with --follow-symlinks, + this situation is treated as an error and h5diff returns an + exit code of 2. + - If only one of the two links is a dangling link,they are treated as + being different and h5diff returns an exit code of 1. + If, however, --no-dangling-links is used with --follow-symlinks, + this situation is treated as an error and h5diff returns an + exit code of 2. + - If both symbolic links point to existing objects, h5diff compares the + two objects. + If any symbolic link specified in the call to h5diff does not exist, + h5diff treats it as an error and returns an exit code of 2. + --no-dangling-links + Must be used with --follow-symlinks option; otherwise, h5diff shows + error message and returns an exit code of 2. + Check for any symbolic links (soft links or external links) that do not + resolve to an existing object (dataset, group, or named datatype). + If any dangling link is found, this situation is treated as an error + and h5diff returns an exit code of 2. + -c, --compare + List objects that are not comparable + -N, --nan + Avoid NaNs detection + -n C, --count=C + Print differences up to C. C must be a positive integer. + -d D, --delta=D + Print difference if (|a-b| > D). D must be a positive number. + Can not use with '-p' or '--use-system-epsilon'. + -p R, --relative=R + Print difference if (|(a-b)/b| > R). R must be a positive number. + Can not use with '-d' or '--use-system-epsilon'. + --use-system-epsilon + Print difference if (|a-b| > EPSILON), EPSILON is system defined value. + If the system epsilon is not defined,one of the following predefined + values will be used: + FLT_EPSILON = 1.19209E-07 for floating-point type + DBL_EPSILON = 2.22045E-16 for double precision type + Can not use with '-p' or '-d'. + --exclude-path "path" + Exclude the specified path to an object when comparing files or groups. + If a group is excluded, all member objects will also be excluded. + The specified path is excluded wherever it occurs. + This flexibility enables the same option to exclude either objects that + exist only in one file or common objects that are known to differ. - When comparing files, "path" is the absolute path to - the excluded object; when comparing groups, "path" is - similar to the relative path from the group to the - excluded object. This "path" can be taken from the - first section of the output of the --verbose option. - For example, if you are comparing the group /groupA - in two files and you want to exclude - /groupA/groupB/groupC in both files, the exclude - option would read as follows: - --exclude-path "/groupB/groupC" + When comparing files, "path" is the absolute path to the excluded; + object; when comparing groups, "path" is similar to the relative + path from the group to the excluded object. This "path" can be + taken from the first section of the output of the --verbose option. + For example, if you are comparing the group /groupA in two files and + you want to exclude /groupA/groupB/groupC in both files, the exclude + option would read as follows: + --exclude-path "/groupB/groupC" - If there are multiple paths to an object, only the - specified path(s) will be excluded; the comparison - will include any path not explicitly excluded. - This option can be used repeatedly to exclude - multiple paths. + If there are multiple paths to an object, only the specified path(s) + will be excluded; the comparison will include any path not explicitly + excluded. + This option can be used repeatedly to exclude multiple paths. Modes of output: Default mode: print the number of differences found and where they occured diff --git a/tools/h5diff/testfiles/h5diff_630.txt b/tools/h5diff/testfiles/h5diff_630.txt new file mode 100644 index 0000000..aaf0148 --- /dev/null +++ b/tools/h5diff/testfiles/h5diff_630.txt @@ -0,0 +1,3 @@ +dataset: and +0 differences found +EXIT CODE: 0 diff --git a/tools/h5diff/testfiles/h5diff_631.txt b/tools/h5diff/testfiles/h5diff_631.txt new file mode 100644 index 0000000..aaf0148 --- /dev/null +++ b/tools/h5diff/testfiles/h5diff_631.txt @@ -0,0 +1,3 @@ +dataset: and +0 differences found +EXIT CODE: 0 diff --git a/tools/h5diff/testfiles/h5diff_640.txt b/tools/h5diff/testfiles/h5diff_640.txt new file mode 100644 index 0000000..4c956a6 --- /dev/null +++ b/tools/h5diff/testfiles/h5diff_640.txt @@ -0,0 +1,4 @@ +h5diff error: -d, -p and --use-system-epsilon options are mutually-exclusive; +use no more than one. +Try '-h' or '--help' option for more information or see the h5diff entry in the 'HDF5 Reference Manual'. +EXIT CODE: 1 diff --git a/tools/h5diff/testfiles/h5diff_641.txt b/tools/h5diff/testfiles/h5diff_641.txt new file mode 100644 index 0000000..4c956a6 --- /dev/null +++ b/tools/h5diff/testfiles/h5diff_641.txt @@ -0,0 +1,4 @@ +h5diff error: -d, -p and --use-system-epsilon options are mutually-exclusive; +use no more than one. +Try '-h' or '--help' option for more information or see the h5diff entry in the 'HDF5 Reference Manual'. +EXIT CODE: 1 diff --git a/tools/h5diff/testfiles/h5diff_642.txt b/tools/h5diff/testfiles/h5diff_642.txt new file mode 100644 index 0000000..4c956a6 --- /dev/null +++ b/tools/h5diff/testfiles/h5diff_642.txt @@ -0,0 +1,4 @@ +h5diff error: -d, -p and --use-system-epsilon options are mutually-exclusive; +use no more than one. +Try '-h' or '--help' option for more information or see the h5diff entry in the 'HDF5 Reference Manual'. +EXIT CODE: 1 diff --git a/tools/h5diff/testfiles/h5diff_643.txt b/tools/h5diff/testfiles/h5diff_643.txt new file mode 100644 index 0000000..4c956a6 --- /dev/null +++ b/tools/h5diff/testfiles/h5diff_643.txt @@ -0,0 +1,4 @@ +h5diff error: -d, -p and --use-system-epsilon options are mutually-exclusive; +use no more than one. +Try '-h' or '--help' option for more information or see the h5diff entry in the 'HDF5 Reference Manual'. +EXIT CODE: 1 diff --git a/tools/h5diff/testfiles/h5diff_644.txt b/tools/h5diff/testfiles/h5diff_644.txt new file mode 100644 index 0000000..4c956a6 --- /dev/null +++ b/tools/h5diff/testfiles/h5diff_644.txt @@ -0,0 +1,4 @@ +h5diff error: -d, -p and --use-system-epsilon options are mutually-exclusive; +use no more than one. +Try '-h' or '--help' option for more information or see the h5diff entry in the 'HDF5 Reference Manual'. +EXIT CODE: 1 diff --git a/tools/h5diff/testfiles/h5diff_645.txt b/tools/h5diff/testfiles/h5diff_645.txt new file mode 100644 index 0000000..4c956a6 --- /dev/null +++ b/tools/h5diff/testfiles/h5diff_645.txt @@ -0,0 +1,4 @@ +h5diff error: -d, -p and --use-system-epsilon options are mutually-exclusive; +use no more than one. +Try '-h' or '--help' option for more information or see the h5diff entry in the 'HDF5 Reference Manual'. +EXIT CODE: 1 diff --git a/tools/h5diff/testfiles/h5diff_646.txt b/tools/h5diff/testfiles/h5diff_646.txt new file mode 100644 index 0000000..4c956a6 --- /dev/null +++ b/tools/h5diff/testfiles/h5diff_646.txt @@ -0,0 +1,4 @@ +h5diff error: -d, -p and --use-system-epsilon options are mutually-exclusive; +use no more than one. +Try '-h' or '--help' option for more information or see the h5diff entry in the 'HDF5 Reference Manual'. +EXIT CODE: 1 diff --git a/tools/h5diff/testfiles/h5diff_70.txt b/tools/h5diff/testfiles/h5diff_70.txt index c6aeb68..47b057c 100644 --- a/tools/h5diff/testfiles/h5diff_70.txt +++ b/tools/h5diff/testfiles/h5diff_70.txt @@ -2028,5 +2028,5 @@ position vlen3D of vlen3D of difference -------------------------------- Some objects are not comparable -------------------------------- -Use -c for a list of objects. +Use -c for a list of objects without details of differences. EXIT CODE: 1 diff --git a/tools/h5diff/testfiles/h5diff_700.txt b/tools/h5diff/testfiles/h5diff_700.txt index 99398a9..00c5b07 100644 --- a/tools/h5diff/testfiles/h5diff_700.txt +++ b/tools/h5diff/testfiles/h5diff_700.txt @@ -2034,5 +2034,5 @@ position vlen3D of vlen3D of difference -------------------------------- Some objects are not comparable -------------------------------- -Use -c for a list of objects. +Use -c for a list of objects without details of differences. EXIT CODE: 1 diff --git a/tools/h5diff/testfiles/h5diff_701.txt b/tools/h5diff/testfiles/h5diff_701.txt index 3b3e5b6..a4b436f 100644 --- a/tools/h5diff/testfiles/h5diff_701.txt +++ b/tools/h5diff/testfiles/h5diff_701.txt @@ -2133,5 +2133,5 @@ position vlen3D of vlen3D of difference -------------------------------- Some objects are not comparable -------------------------------- -Use -c for a list of objects. +Use -c for a list of objects without details of differences. EXIT CODE: 1 diff --git a/tools/h5diff/testfiles/h5diff_702.txt b/tools/h5diff/testfiles/h5diff_702.txt index 99398a9..00c5b07 100644 --- a/tools/h5diff/testfiles/h5diff_702.txt +++ b/tools/h5diff/testfiles/h5diff_702.txt @@ -2034,5 +2034,5 @@ position vlen3D of vlen3D of difference -------------------------------- Some objects are not comparable -------------------------------- -Use -c for a list of objects. +Use -c for a list of objects without details of differences. EXIT CODE: 1 diff --git a/tools/h5diff/testfiles/h5diff_703.txt b/tools/h5diff/testfiles/h5diff_703.txt index 3b3e5b6..a4b436f 100644 --- a/tools/h5diff/testfiles/h5diff_703.txt +++ b/tools/h5diff/testfiles/h5diff_703.txt @@ -2133,5 +2133,5 @@ position vlen3D of vlen3D of difference -------------------------------- Some objects are not comparable -------------------------------- -Use -c for a list of objects. +Use -c for a list of objects without details of differences. EXIT CODE: 1 diff --git a/tools/h5diff/testfiles/h5diff_80.txt b/tools/h5diff/testfiles/h5diff_80.txt index 1c55b1a..5957d72 100644 --- a/tools/h5diff/testfiles/h5diff_80.txt +++ b/tools/h5diff/testfiles/h5diff_80.txt @@ -877,5 +877,5 @@ point #4 (2,8) (1,7) -------------------------------- Some objects are not comparable -------------------------------- -Use -c for a list of objects. +Use -c for a list of objects without details of differences. EXIT CODE: 1 diff --git a/tools/h5diff/testfiles/h5diff_90.txt b/tools/h5diff/testfiles/h5diff_90.txt index fb23843..9965ab0 100644 --- a/tools/h5diff/testfiles/h5diff_90.txt +++ b/tools/h5diff/testfiles/h5diff_90.txt @@ -30,7 +30,6 @@ dataset: and group : and 0 differences found dataset: and -Not comparable: or is an empty dataset 0 differences found dataset: and 0 differences found @@ -47,10 +46,5 @@ dataset: and dataset: and 0 differences found dataset: and -Not comparable: or is an empty dataset 0 differences found --------------------------------- -Some objects are not comparable --------------------------------- -Use -c for a list of objects. EXIT CODE: 0 diff --git a/tools/h5diff/testfiles/h5diff_basic1.h5 b/tools/h5diff/testfiles/h5diff_basic1.h5 index 4f3cf9a..e1396be 100644 Binary files a/tools/h5diff/testfiles/h5diff_basic1.h5 and b/tools/h5diff/testfiles/h5diff_basic1.h5 differ diff --git a/tools/h5diff/testfiles/h5diff_comp_vl_strs.h5 b/tools/h5diff/testfiles/h5diff_comp_vl_strs.h5 index dac510f..4ad6f19 100644 Binary files a/tools/h5diff/testfiles/h5diff_comp_vl_strs.h5 and b/tools/h5diff/testfiles/h5diff_comp_vl_strs.h5 differ diff --git a/tools/h5diff/testfiles/h5diff_dset_zero_dim_size1.h5 b/tools/h5diff/testfiles/h5diff_dset_zero_dim_size1.h5 new file mode 100644 index 0000000..cdc7644 Binary files /dev/null and b/tools/h5diff/testfiles/h5diff_dset_zero_dim_size1.h5 differ diff --git a/tools/h5diff/testfiles/h5diff_dset_zero_dim_size2.h5 b/tools/h5diff/testfiles/h5diff_dset_zero_dim_size2.h5 new file mode 100644 index 0000000..4752ed1 Binary files /dev/null and b/tools/h5diff/testfiles/h5diff_dset_zero_dim_size2.h5 differ diff --git a/tools/h5diff/testfiles/h5diff_enum_invalid_values.h5 b/tools/h5diff/testfiles/h5diff_enum_invalid_values.h5 new file mode 100755 index 0000000..dd02db9 Binary files /dev/null and b/tools/h5diff/testfiles/h5diff_enum_invalid_values.h5 differ diff --git a/tools/h5diff/testfiles/non_comparables1.h5 b/tools/h5diff/testfiles/non_comparables1.h5 new file mode 100644 index 0000000..71b65c8 Binary files /dev/null and b/tools/h5diff/testfiles/non_comparables1.h5 differ diff --git a/tools/h5diff/testfiles/non_comparables2.h5 b/tools/h5diff/testfiles/non_comparables2.h5 new file mode 100644 index 0000000..188ceb9 Binary files /dev/null and b/tools/h5diff/testfiles/non_comparables2.h5 differ diff --git a/tools/h5diff/testh5diff.sh b/tools/h5diff/testh5diff.sh index 62749c1..005510f 100755 --- a/tools/h5diff/testh5diff.sh +++ b/tools/h5diff/testh5diff.sh @@ -30,51 +30,6 @@ # Added test 450 - 459 (dangling links) -############################################################################### -## test file names -############################################################################### - -FILE1=h5diff_basic1.h5 -FILE2=h5diff_basic2.h5 -FILE3=h5diff_types.h5 -FILE4=h5diff_dtypes.h5 -FILE5=h5diff_attr1.h5 -FILE6=h5diff_attr2.h5 -FILE7=h5diff_dset1.h5 -FILE8=h5diff_dset2.h5 -FILE9=h5diff_hyper1.h5 -FILE10=h5diff_hyper2.h5 -FILE11=h5diff_empty.h5 -FILE12=h5diff_links.h5 -FILE13=h5diff_softlinks.h5 -FILE14=h5diff_linked_softlink.h5 -FILE15=h5diff_extlink_src.h5 -FILE16=h5diff_extlink_trg.h5 -FILE17=h5diff_ext2softlink_src.h5 -FILE18=h5diff_ext2softlink_trg.h5 -FILE19=h5diff_dset_idx1.h5 -FILE20=h5diff_dset_idx2.h5 -DANGLE_LINK_FILE1=h5diff_danglelinks1.h5 -DANGLE_LINK_FILE2=h5diff_danglelinks2.h5 -# group recursive -GRP_RECURSE_FILE1=h5diff_grp_recurse1.h5 -GRP_RECURSE_FILE2=h5diff_grp_recurse2.h5 -# group recursive - same structure via external links through files -GRP_RECURSE1_EXT=h5diff_grp_recurse_ext1.h5 -GRP_RECURSE2_EXT1=h5diff_grp_recurse_ext2-1.h5 -GRP_RECURSE2_EXT2=h5diff_grp_recurse_ext2-2.h5 -GRP_RECURSE2_EXT3=h5diff_grp_recurse_ext2-3.h5 -# same structure, same obj name with different value -EXCLUDE_FILE1_1=h5diff_exclude1-1.h5 -EXCLUDE_FILE1_2=h5diff_exclude1-2.h5 -# different structure and obj names -EXCLUDE_FILE2_1=h5diff_exclude2-1.h5 -EXCLUDE_FILE2_2=h5diff_exclude2-2.h5 -# compound type with multiple vlen string types -COMP_VL_STRS_FILE=h5diff_comp_vl_strs.h5 - -ATTR_VERBOSE_LEVEL_FILE1=h5diff_attr_v_level1.h5 -ATTR_VERBOSE_LEVEL_FILE2=h5diff_attr_v_level2.h5 TESTNAME=h5diff EXIT_SUCCESS=0 @@ -85,6 +40,7 @@ H5DIFF_BIN=`pwd`/$H5DIFF # The path of the tool binary CMP='cmp -s' DIFF='diff -c' +CP='cp' nerrors=0 verbose=yes @@ -97,7 +53,273 @@ if test -z "$srcdir"; then srcdir=. fi -test -d ./testfiles || mkdir ./testfiles +# source dirs +SRC_TOOLS="$srcdir/.." +SRC_TOOLS_TESTFILES="$SRC_TOOLS/testfiles" +# testfiles source dirs for tools +SRC_H5LS_TESTFILES="$SRC_TOOLS_TESTFILES" +SRC_H5DUMP_TESTFILES="$SRC_TOOLS_TESTFILES" +SRC_H5DIFF_TESTFILES="$SRC_TOOLS/h5diff/testfiles" +SRC_H5COPY_TESTFILES="$SRC_TOOLS/h5copy/testfiles" +SRC_H5REPACK_TESTFILES="$SRC_TOOLS/h5repack/testfiles" +SRC_H5JAM_TESTFILES="$SRC_TOOLS/h5jam/testfiles" +SRC_H5STAT_TESTFILES="$SRC_TOOLS/h5stat/testfiles" +SRC_H5IMPORT_TESTFILES="$SRC_TOOLS/h5import/testfiles" + +TESTDIR=./testfiles +test -d $TESTDIR || mkdir $TESTDIR + +###################################################################### +# test files +# -------------------------------------------------------------------- +# All the test files copy from source directory to test directory +# NOTE: Keep this framework to add/remove test files. +# Any test files from other tools can be used in this framework. +# This list are also used for checking exist. +# Comment '#' without space can be used. +# -------------------------------------------------------------------- +LIST_HDF5_TEST_FILES=" +$SRC_H5DIFF_TESTFILES/h5diff_basic1.h5 +$SRC_H5DIFF_TESTFILES/h5diff_basic2.h5 +$SRC_H5DIFF_TESTFILES/h5diff_types.h5 +$SRC_H5DIFF_TESTFILES/h5diff_dtypes.h5 +$SRC_H5DIFF_TESTFILES/h5diff_attr1.h5 +$SRC_H5DIFF_TESTFILES/h5diff_attr2.h5 +$SRC_H5DIFF_TESTFILES/h5diff_dset1.h5 +$SRC_H5DIFF_TESTFILES/h5diff_dset2.h5 +$SRC_H5DIFF_TESTFILES/h5diff_hyper1.h5 +$SRC_H5DIFF_TESTFILES/h5diff_hyper2.h5 +$SRC_H5DIFF_TESTFILES/h5diff_empty.h5 +$SRC_H5DIFF_TESTFILES/h5diff_links.h5 +$SRC_H5DIFF_TESTFILES/h5diff_softlinks.h5 +$SRC_H5DIFF_TESTFILES/h5diff_linked_softlink.h5 +$SRC_H5DIFF_TESTFILES/h5diff_extlink_src.h5 +$SRC_H5DIFF_TESTFILES/h5diff_extlink_trg.h5 +$SRC_H5DIFF_TESTFILES/h5diff_ext2softlink_src.h5 +$SRC_H5DIFF_TESTFILES/h5diff_ext2softlink_trg.h5 +$SRC_H5DIFF_TESTFILES/h5diff_dset_idx1.h5 +$SRC_H5DIFF_TESTFILES/h5diff_dset_idx2.h5 +$SRC_H5DIFF_TESTFILES/h5diff_dset_zero_dim_size1.h5 +$SRC_H5DIFF_TESTFILES/h5diff_dset_zero_dim_size2.h5 +$SRC_H5DIFF_TESTFILES/h5diff_danglelinks1.h5 +$SRC_H5DIFF_TESTFILES/h5diff_danglelinks2.h5 +$SRC_H5DIFF_TESTFILES/h5diff_grp_recurse1.h5 +$SRC_H5DIFF_TESTFILES/h5diff_grp_recurse2.h5 +$SRC_H5DIFF_TESTFILES/h5diff_grp_recurse_ext1.h5 +$SRC_H5DIFF_TESTFILES/h5diff_grp_recurse_ext2-1.h5 +$SRC_H5DIFF_TESTFILES/h5diff_grp_recurse_ext2-2.h5 +$SRC_H5DIFF_TESTFILES/h5diff_grp_recurse_ext2-3.h5 +$SRC_H5DIFF_TESTFILES/h5diff_exclude1-1.h5 +$SRC_H5DIFF_TESTFILES/h5diff_exclude1-2.h5 +$SRC_H5DIFF_TESTFILES/h5diff_exclude2-1.h5 +$SRC_H5DIFF_TESTFILES/h5diff_exclude2-2.h5 +$SRC_H5DIFF_TESTFILES/h5diff_comp_vl_strs.h5 +$SRC_H5DIFF_TESTFILES/compounds_array_vlen1.h5 +$SRC_H5DIFF_TESTFILES/compounds_array_vlen2.h5 +$SRC_H5DIFF_TESTFILES/h5diff_attr_v_level1.h5 +$SRC_H5DIFF_TESTFILES/h5diff_attr_v_level2.h5 +$SRC_H5DIFF_TESTFILES/h5diff_enum_invalid_values.h5 +$SRC_H5DIFF_TESTFILES/non_comparables1.h5 +$SRC_H5DIFF_TESTFILES/non_comparables2.h5 +" + +LIST_OTHER_TEST_FILES=" +$SRC_H5DIFF_TESTFILES/h5diff_10.txt +$SRC_H5DIFF_TESTFILES/h5diff_100.txt +$SRC_H5DIFF_TESTFILES/h5diff_101.txt +$SRC_H5DIFF_TESTFILES/h5diff_102.txt +$SRC_H5DIFF_TESTFILES/h5diff_103.txt +$SRC_H5DIFF_TESTFILES/h5diff_104.txt +$SRC_H5DIFF_TESTFILES/h5diff_11.txt +$SRC_H5DIFF_TESTFILES/h5diff_12.txt +$SRC_H5DIFF_TESTFILES/h5diff_13.txt +$SRC_H5DIFF_TESTFILES/h5diff_14.txt +$SRC_H5DIFF_TESTFILES/h5diff_15.txt +$SRC_H5DIFF_TESTFILES/h5diff_16_1.txt +$SRC_H5DIFF_TESTFILES/h5diff_16_2.txt +$SRC_H5DIFF_TESTFILES/h5diff_16_3.txt +$SRC_H5DIFF_TESTFILES/h5diff_17.txt +$SRC_H5DIFF_TESTFILES/h5diff_171.txt +$SRC_H5DIFF_TESTFILES/h5diff_172.txt +$SRC_H5DIFF_TESTFILES/h5diff_18_1.txt +$SRC_H5DIFF_TESTFILES/h5diff_18.txt +$SRC_H5DIFF_TESTFILES/h5diff_20.txt +$SRC_H5DIFF_TESTFILES/h5diff_200.txt +$SRC_H5DIFF_TESTFILES/h5diff_201.txt +$SRC_H5DIFF_TESTFILES/h5diff_202.txt +$SRC_H5DIFF_TESTFILES/h5diff_203.txt +$SRC_H5DIFF_TESTFILES/h5diff_204.txt +$SRC_H5DIFF_TESTFILES/h5diff_205.txt +$SRC_H5DIFF_TESTFILES/h5diff_206.txt +$SRC_H5DIFF_TESTFILES/h5diff_207.txt +$SRC_H5DIFF_TESTFILES/h5diff_208.txt +$SRC_H5DIFF_TESTFILES/h5diff_220.txt +$SRC_H5DIFF_TESTFILES/h5diff_221.txt +$SRC_H5DIFF_TESTFILES/h5diff_222.txt +$SRC_H5DIFF_TESTFILES/h5diff_21.txt +$SRC_H5DIFF_TESTFILES/h5diff_22.txt +$SRC_H5DIFF_TESTFILES/h5diff_23.txt +$SRC_H5DIFF_TESTFILES/h5diff_24.txt +$SRC_H5DIFF_TESTFILES/h5diff_25.txt +$SRC_H5DIFF_TESTFILES/h5diff_26.txt +$SRC_H5DIFF_TESTFILES/h5diff_27.txt +$SRC_H5DIFF_TESTFILES/h5diff_28.txt +$SRC_H5DIFF_TESTFILES/h5diff_30.txt +$SRC_H5DIFF_TESTFILES/h5diff_300.txt +$SRC_H5DIFF_TESTFILES/h5diff_400.txt +$SRC_H5DIFF_TESTFILES/h5diff_401.txt +$SRC_H5DIFF_TESTFILES/h5diff_402.txt +$SRC_H5DIFF_TESTFILES/h5diff_403.txt +$SRC_H5DIFF_TESTFILES/h5diff_404.txt +$SRC_H5DIFF_TESTFILES/h5diff_405.txt +$SRC_H5DIFF_TESTFILES/h5diff_406.txt +$SRC_H5DIFF_TESTFILES/h5diff_407.txt +$SRC_H5DIFF_TESTFILES/h5diff_408.txt +$SRC_H5DIFF_TESTFILES/h5diff_409.txt +$SRC_H5DIFF_TESTFILES/h5diff_410.txt +$SRC_H5DIFF_TESTFILES/h5diff_411.txt +$SRC_H5DIFF_TESTFILES/h5diff_412.txt +$SRC_H5DIFF_TESTFILES/h5diff_413.txt +$SRC_H5DIFF_TESTFILES/h5diff_414.txt +$SRC_H5DIFF_TESTFILES/h5diff_415.txt +$SRC_H5DIFF_TESTFILES/h5diff_416.txt +$SRC_H5DIFF_TESTFILES/h5diff_417.txt +$SRC_H5DIFF_TESTFILES/h5diff_418.txt +$SRC_H5DIFF_TESTFILES/h5diff_419.txt +$SRC_H5DIFF_TESTFILES/h5diff_420.txt +$SRC_H5DIFF_TESTFILES/h5diff_421.txt +$SRC_H5DIFF_TESTFILES/h5diff_422.txt +$SRC_H5DIFF_TESTFILES/h5diff_423.txt +$SRC_H5DIFF_TESTFILES/h5diff_424.txt +$SRC_H5DIFF_TESTFILES/h5diff_425.txt +$SRC_H5DIFF_TESTFILES/h5diff_450.txt +$SRC_H5DIFF_TESTFILES/h5diff_451.txt +$SRC_H5DIFF_TESTFILES/h5diff_452.txt +$SRC_H5DIFF_TESTFILES/h5diff_453.txt +$SRC_H5DIFF_TESTFILES/h5diff_454.txt +$SRC_H5DIFF_TESTFILES/h5diff_455.txt +$SRC_H5DIFF_TESTFILES/h5diff_456.txt +$SRC_H5DIFF_TESTFILES/h5diff_457.txt +$SRC_H5DIFF_TESTFILES/h5diff_458.txt +$SRC_H5DIFF_TESTFILES/h5diff_459.txt +$SRC_H5DIFF_TESTFILES/h5diff_465.txt +$SRC_H5DIFF_TESTFILES/h5diff_466.txt +$SRC_H5DIFF_TESTFILES/h5diff_467.txt +$SRC_H5DIFF_TESTFILES/h5diff_468.txt +$SRC_H5DIFF_TESTFILES/h5diff_469.txt +$SRC_H5DIFF_TESTFILES/h5diff_480.txt +$SRC_H5DIFF_TESTFILES/h5diff_481.txt +$SRC_H5DIFF_TESTFILES/h5diff_482.txt +$SRC_H5DIFF_TESTFILES/h5diff_483.txt +$SRC_H5DIFF_TESTFILES/h5diff_484.txt +$SRC_H5DIFF_TESTFILES/h5diff_50.txt +$SRC_H5DIFF_TESTFILES/h5diff_51.txt +$SRC_H5DIFF_TESTFILES/h5diff_52.txt +$SRC_H5DIFF_TESTFILES/h5diff_53.txt +$SRC_H5DIFF_TESTFILES/h5diff_54.txt +$SRC_H5DIFF_TESTFILES/h5diff_55.txt +$SRC_H5DIFF_TESTFILES/h5diff_56.txt +$SRC_H5DIFF_TESTFILES/h5diff_57.txt +$SRC_H5DIFF_TESTFILES/h5diff_58.txt +$SRC_H5DIFF_TESTFILES/h5diff_500.txt +$SRC_H5DIFF_TESTFILES/h5diff_501.txt +$SRC_H5DIFF_TESTFILES/h5diff_502.txt +$SRC_H5DIFF_TESTFILES/h5diff_503.txt +$SRC_H5DIFF_TESTFILES/h5diff_504.txt +$SRC_H5DIFF_TESTFILES/h5diff_505.txt +$SRC_H5DIFF_TESTFILES/h5diff_506.txt +$SRC_H5DIFF_TESTFILES/h5diff_507.txt +$SRC_H5DIFF_TESTFILES/h5diff_508.txt +$SRC_H5DIFF_TESTFILES/h5diff_509.txt +$SRC_H5DIFF_TESTFILES/h5diff_510.txt +$SRC_H5DIFF_TESTFILES/h5diff_511.txt +$SRC_H5DIFF_TESTFILES/h5diff_512.txt +$SRC_H5DIFF_TESTFILES/h5diff_513.txt +$SRC_H5DIFF_TESTFILES/h5diff_514.txt +$SRC_H5DIFF_TESTFILES/h5diff_515.txt +$SRC_H5DIFF_TESTFILES/h5diff_516.txt +$SRC_H5DIFF_TESTFILES/h5diff_517.txt +$SRC_H5DIFF_TESTFILES/h5diff_518.txt +$SRC_H5DIFF_TESTFILES/h5diff_530.txt +$SRC_H5DIFF_TESTFILES/h5diff_540.txt +$SRC_H5DIFF_TESTFILES/h5diff_600.txt +$SRC_H5DIFF_TESTFILES/h5diff_601.txt +$SRC_H5DIFF_TESTFILES/h5diff_603.txt +$SRC_H5DIFF_TESTFILES/h5diff_604.txt +$SRC_H5DIFF_TESTFILES/h5diff_605.txt +$SRC_H5DIFF_TESTFILES/h5diff_606.txt +$SRC_H5DIFF_TESTFILES/h5diff_607.txt +$SRC_H5DIFF_TESTFILES/h5diff_608.txt +$SRC_H5DIFF_TESTFILES/h5diff_609.txt +$SRC_H5DIFF_TESTFILES/h5diff_610.txt +$SRC_H5DIFF_TESTFILES/h5diff_612.txt +$SRC_H5DIFF_TESTFILES/h5diff_613.txt +$SRC_H5DIFF_TESTFILES/h5diff_614.txt +$SRC_H5DIFF_TESTFILES/h5diff_615.txt +$SRC_H5DIFF_TESTFILES/h5diff_616.txt +$SRC_H5DIFF_TESTFILES/h5diff_617.txt +$SRC_H5DIFF_TESTFILES/h5diff_618.txt +$SRC_H5DIFF_TESTFILES/h5diff_619.txt +$SRC_H5DIFF_TESTFILES/h5diff_621.txt +$SRC_H5DIFF_TESTFILES/h5diff_622.txt +$SRC_H5DIFF_TESTFILES/h5diff_623.txt +$SRC_H5DIFF_TESTFILES/h5diff_624.txt +$SRC_H5DIFF_TESTFILES/h5diff_625.txt +$SRC_H5DIFF_TESTFILES/h5diff_626.txt +$SRC_H5DIFF_TESTFILES/h5diff_627.txt +$SRC_H5DIFF_TESTFILES/h5diff_628.txt +$SRC_H5DIFF_TESTFILES/h5diff_629.txt +$SRC_H5DIFF_TESTFILES/h5diff_630.txt +$SRC_H5DIFF_TESTFILES/h5diff_631.txt +$SRC_H5DIFF_TESTFILES/h5diff_640.txt +$SRC_H5DIFF_TESTFILES/h5diff_641.txt +$SRC_H5DIFF_TESTFILES/h5diff_642.txt +$SRC_H5DIFF_TESTFILES/h5diff_643.txt +$SRC_H5DIFF_TESTFILES/h5diff_644.txt +$SRC_H5DIFF_TESTFILES/h5diff_645.txt +$SRC_H5DIFF_TESTFILES/h5diff_646.txt +$SRC_H5DIFF_TESTFILES/h5diff_70.txt +$SRC_H5DIFF_TESTFILES/h5diff_700.txt +$SRC_H5DIFF_TESTFILES/h5diff_701.txt +$SRC_H5DIFF_TESTFILES/h5diff_702.txt +$SRC_H5DIFF_TESTFILES/h5diff_703.txt +$SRC_H5DIFF_TESTFILES/h5diff_704.txt +$SRC_H5DIFF_TESTFILES/h5diff_705.txt +$SRC_H5DIFF_TESTFILES/h5diff_706.txt +$SRC_H5DIFF_TESTFILES/h5diff_707.txt +$SRC_H5DIFF_TESTFILES/h5diff_708.txt +$SRC_H5DIFF_TESTFILES/h5diff_709.txt +$SRC_H5DIFF_TESTFILES/h5diff_710.txt +$SRC_H5DIFF_TESTFILES/h5diff_80.txt +$SRC_H5DIFF_TESTFILES/h5diff_90.txt +" + +# +# copy test files and expected output files from source dirs to test dir +# +COPY_TESTFILES="$LIST_HDF5_TEST_FILES $LIST_OTHER_TEST_FILES $LIST_HDF5_TEST_FILES_XML $LIST_OTHER_TEST_FILES_XML" + +COPY_TESTFILES_TO_TESTDIR() +{ + # copy test files. Used -f to make sure get a new copy + for tstfile in $COPY_TESTFILES + do + # ignore '#' comment + echo $tstfile | tr -d ' ' | grep '^#' > /dev/null + RET=$? + if [ $RET -eq 1 ]; then + if [ -a $tstfile ]; then + $CP -f $tstfile $TESTDIR + else + echo "Error: FAILED to copy $tstfile ." + echo " $tstfile doesn't exist!" + + # Comment out this to CREATE expected file + exit $EXIT_FAILURE + fi + fi + done +} # Parse option # -p run ph5diff tests @@ -140,80 +362,8 @@ TESTING() { echo "Testing $* $SPACES" | cut -c1-70 | tr -d '\012' } -# Some systems will dump some messages to stdout for various reasons. -# Remove them from the stdout result file. -# $1 is the file name of the file to be filtered. -# Cases of filter needed: -# 1. Sandia Red-Storm -# yod always prints these two lines at the beginning. -# LibLustre: NAL NID: 0004a605 (5) -# Lustre: OBD class driver Build Version: 1, info@clusterfs.com -# 2. LANL Lambda -# mpijob mirun -np always add an extra line at the end like: -# P4 procgroup file is /users/acheng/.lsbatch/host10524.l82 -STDOUT_FILTER() { - result_file=$1 - tmp_file=/tmp/h5test_tmp_$$ - # Filter Sandia Red-Storm yod messages. - cp $result_file $tmp_file - sed -e '/^LibLustre:/d' -e '/^Lustre:/d' \ - < $tmp_file > $result_file - # Filter LANL Lambda mpirun message. - cp $result_file $tmp_file - sed -e '/^P4 procgroup file is/d' \ - < $tmp_file > $result_file - # cleanup - rm -f $tmp_file -} - -# Some systems will dump some messages to stderr for various reasons. -# Remove them from the stderr result file. -# $1 is the file name of the file to be filtered. -# Cases of filter needed: -# 1. MPE: -# In parallel mode and if MPE library is used, it prints the following -# two message lines whether the MPE tracing is used or not. -# Writing logfile. -# Finished writing logfile. -# 2. LANL MPI: -# The LANL MPI will print some messages like the following, -# LA-MPI: *** mpirun (1.5.10) -# LA-MPI: *** 3 process(es) on 2 host(s): 2*fln21 1*fln22 -# LA-MPI: *** libmpi (1.5.10) -# LA-MPI: *** Copyright 2001-2004, ACL, Los Alamos National Laboratory -# 3. h5diff debug output: -# Debug output all have prefix "h5diff debug: ". -# 4. AIX system prints messages like these when it is aborting: -# ERROR: 0031-300 Forcing all remote tasks to exit due to exit code 1 in task 0 -# ERROR: 0031-250 task 4: Terminated -# ERROR: 0031-250 task 3: Terminated -# ERROR: 0031-250 task 2: Terminated -# ERROR: 0031-250 task 1: Terminated - -STDERR_FILTER() { - result_file=$1 - tmp_file=/tmp/h5test_tmp_$$ - # Filter MPE messages - if test -n "$pmode"; then - cp $result_file $tmp_file - sed -e '/^Writing logfile./d' -e '/^Finished writing logfile./d' \ - < $tmp_file > $result_file - fi - # Filter LANL MPI messages - # and LLNL srun messages - # and AIX error messages - if test -n "$pmode"; then - cp $result_file $tmp_file - sed -e '/^LA-MPI:/d' -e '/^srun:/d' -e '/^ERROR:/d' \ - < $tmp_file > $result_file - fi - # Filter h5diff debug output - cp $result_file $tmp_file - sed -e '/^h5diff debug: /d' \ - < $tmp_file > $result_file - # clean up temporary files. - rm -f $tmp_file -} +# Source in the output filter function definitions. +. $srcdir/../../bin/output_filter.sh # Run a test and print PASS or *FAIL*. If a test fails then increment # the `nerrors' global variable and (if $verbose is set) display the @@ -229,9 +379,9 @@ STDERR_FILTER() { # that throws the shell script off. # TOOLTEST() { - expect="$srcdir/testfiles/$1" - actual="./testfiles/`basename $1 .txt`.out" - actual_err="./testfiles/`basename $1 .txt`.err" + expect="$TESTDIR/$1" + actual="$TESTDIR/`basename $1 .txt`.out" + actual_err="$TESTDIR/`basename $1 .txt`.err" actual_sav=${actual}-sav actual_err_sav=${actual_err}-sav shift @@ -247,7 +397,7 @@ TOOLTEST() { #echo "#############################" #echo "Expected output for '$H5DIFF $@'" #echo "#############################" - cd $srcdir/testfiles + cd $TESTDIR eval $RUNCMD $H5DIFF_BIN "$@" ) >$actual 2>$actual_err EXIT_CODE=$? @@ -329,6 +479,8 @@ SKIP() { # is done first in # TESTING with the name only of the test file $TOOL, not its full path $TESTFILE ############################################################################## +# prepare for test +COPY_TESTFILES_TO_TESTDIR # ############################################################################ # # Common usage @@ -338,43 +490,43 @@ SKIP() { TOOLTEST h5diff_10.txt -h # 1.1 normal mode -TOOLTEST h5diff_11.txt $FILE1 $FILE2 +TOOLTEST h5diff_11.txt h5diff_basic1.h5 h5diff_basic2.h5 # 1.2 normal mode with objects -TOOLTEST h5diff_12.txt $FILE1 $FILE2 g1/dset1 g1/dset2 +TOOLTEST h5diff_12.txt h5diff_basic1.h5 h5diff_basic2.h5 g1/dset1 g1/dset2 # 1.3 report mode -TOOLTEST h5diff_13.txt -r $FILE1 $FILE2 +TOOLTEST h5diff_13.txt -r h5diff_basic1.h5 h5diff_basic2.h5 # 1.4 report mode with objects -TOOLTEST h5diff_14.txt -r $FILE1 $FILE2 g1/dset1 g1/dset2 +TOOLTEST h5diff_14.txt -r h5diff_basic1.h5 h5diff_basic2.h5 g1/dset1 g1/dset2 # 1.5 with -d -TOOLTEST h5diff_15.txt --report --delta=5 $FILE1 $FILE2 g1/dset3 g1/dset4 +TOOLTEST h5diff_15.txt --report --delta=5 h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dset4 # 1.6.1 with -p (int) -TOOLTEST h5diff_16_1.txt -v -p 0.02 $FILE1 $FILE1 g1/dset5 g1/dset6 +TOOLTEST h5diff_16_1.txt -v -p 0.02 h5diff_basic1.h5 h5diff_basic1.h5 g1/dset5 g1/dset6 # 1.6.2 with -p (unsigned long_long) -TOOLTEST h5diff_16_2.txt --verbose --relative=0.02 $FILE1 $FILE1 g1/dset7 g1/dset8 +TOOLTEST h5diff_16_2.txt --verbose --relative=0.02 h5diff_basic1.h5 h5diff_basic1.h5 g1/dset7 g1/dset8 # 1.6.3 with -p (double) -TOOLTEST h5diff_16_3.txt -v -p 0.02 $FILE1 $FILE1 g1/dset9 g1/dset10 +TOOLTEST h5diff_16_3.txt -v -p 0.02 h5diff_basic1.h5 h5diff_basic1.h5 g1/dset9 g1/dset10 # 1.7 verbose mode -TOOLTEST h5diff_17.txt -v $FILE1 $FILE2 +TOOLTEST h5diff_17.txt -v h5diff_basic1.h5 h5diff_basic2.h5 # 1.7 test 32-bit INFINITY -TOOLTEST h5diff_171.txt -v $FILE1 $FILE1 /g1/fp19 +TOOLTEST h5diff_171.txt -v h5diff_basic1.h5 h5diff_basic1.h5 /g1/fp19 /g1/fp19_COPY # 1.7 test 64-bit INFINITY -TOOLTEST h5diff_172.txt -v $FILE1 $FILE1 /g1/fp20 +TOOLTEST h5diff_172.txt -v h5diff_basic1.h5 h5diff_basic1.h5 /g1/fp20 /g1/fp20_COPY # 1.8 quiet mode -TOOLTEST h5diff_18.txt -q $FILE1 $FILE2 +TOOLTEST h5diff_18.txt -q h5diff_basic1.h5 h5diff_basic2.h5 # 1.8 -v and -q -TOOLTEST h5diff_18_1.txt -v -q $FILE1 $FILE2 +TOOLTEST h5diff_18_1.txt -v -q h5diff_basic1.h5 h5diff_basic2.h5 # ############################################################################## @@ -382,35 +534,45 @@ TOOLTEST h5diff_18_1.txt -v -q $FILE1 $FILE2 # ############################################################################## # 2.0 -TOOLTEST h5diff_20.txt -v $FILE3 $FILE3 dset g1 +TOOLTEST h5diff_20.txt -v h5diff_types.h5 h5diff_types.h5 dset g1 # 2.1 -TOOLTEST h5diff_21.txt -v $FILE3 $FILE3 dset l1 +TOOLTEST h5diff_21.txt -v h5diff_types.h5 h5diff_types.h5 dset l1 # 2.2 -TOOLTEST h5diff_22.txt -v $FILE3 $FILE3 dset t1 +TOOLTEST h5diff_22.txt -v h5diff_types.h5 h5diff_types.h5 dset t1 # ############################################################################## # # compare groups, types, links (no differences and differences) # ############################################################################## # 2.3 -TOOLTEST h5diff_23.txt -v $FILE3 $FILE3 g1 g1 +TOOLTEST h5diff_23.txt -v h5diff_types.h5 h5diff_types.h5 g1 g1 # 2.4 -TOOLTEST h5diff_24.txt -v $FILE3 $FILE3 t1 t1 +TOOLTEST h5diff_24.txt -v h5diff_types.h5 h5diff_types.h5 t1 t1 # 2.5 -TOOLTEST h5diff_25.txt -v $FILE3 $FILE3 l1 l1 +TOOLTEST h5diff_25.txt -v h5diff_types.h5 h5diff_types.h5 l1 l1 # 2.6 -TOOLTEST h5diff_26.txt -v $FILE3 $FILE3 g1 g2 +TOOLTEST h5diff_26.txt -v h5diff_types.h5 h5diff_types.h5 g1 g2 # 2.7 -TOOLTEST h5diff_27.txt -v $FILE3 $FILE3 t1 t2 +TOOLTEST h5diff_27.txt -v h5diff_types.h5 h5diff_types.h5 t1 t2 # 2.8 -TOOLTEST h5diff_28.txt -v $FILE3 $FILE3 l1 l2 +TOOLTEST h5diff_28.txt -v h5diff_types.h5 h5diff_types.h5 l1 l2 + + +# ############################################################################## +# # Enum value tests (may become more comprehensive in the future) +# ############################################################################## + +# 3.0 +# test enum types which may have invalid values +TOOLTEST h5diff_30.txt -v h5diff_enum_invalid_values.h5 h5diff_enum_invalid_values.h5 dset1 dset2 + @@ -419,31 +581,31 @@ TOOLTEST h5diff_28.txt -v $FILE3 $FILE3 l1 l2 # ############################################################################## # 5.0 -TOOLTEST h5diff_50.txt -v $FILE4 $FILE4 dset0a dset0b +TOOLTEST h5diff_50.txt -v h5diff_dtypes.h5 h5diff_dtypes.h5 dset0a dset0b # 5.1 -TOOLTEST h5diff_51.txt -v $FILE4 $FILE4 dset1a dset1b +TOOLTEST h5diff_51.txt -v h5diff_dtypes.h5 h5diff_dtypes.h5 dset1a dset1b # 5.2 -TOOLTEST h5diff_52.txt -v $FILE4 $FILE4 dset2a dset2b +TOOLTEST h5diff_52.txt -v h5diff_dtypes.h5 h5diff_dtypes.h5 dset2a dset2b # 5.3 -TOOLTEST h5diff_53.txt -v $FILE4 $FILE4 dset3a dset4b +TOOLTEST h5diff_53.txt -v h5diff_dtypes.h5 h5diff_dtypes.h5 dset3a dset4b # 5.4 -TOOLTEST h5diff_54.txt -v $FILE4 $FILE4 dset4a dset4b +TOOLTEST h5diff_54.txt -v h5diff_dtypes.h5 h5diff_dtypes.h5 dset4a dset4b # 5.5 -TOOLTEST h5diff_55.txt -v $FILE4 $FILE4 dset5a dset5b +TOOLTEST h5diff_55.txt -v h5diff_dtypes.h5 h5diff_dtypes.h5 dset5a dset5b # 5.6 -TOOLTEST h5diff_56.txt -v $FILE4 $FILE4 dset6a dset6b +TOOLTEST h5diff_56.txt -v h5diff_dtypes.h5 h5diff_dtypes.h5 dset6a dset6b # 5.7 -TOOLTEST h5diff_57.txt -v $FILE4 $FILE4 dset7a dset7b +TOOLTEST h5diff_57.txt -v h5diff_dtypes.h5 h5diff_dtypes.h5 dset7a dset7b # 5.8 (region reference) -TOOLTEST h5diff_58.txt -v $FILE7 $FILE8 refreg +TOOLTEST h5diff_58.txt -v h5diff_dset1.h5 h5diff_dset2.h5 refreg # ############################################################################## # # Error messages @@ -451,10 +613,10 @@ TOOLTEST h5diff_58.txt -v $FILE7 $FILE8 refreg # 6.0: Check if the command line number of arguments is less than 3 -TOOLTEST h5diff_600.txt $FILE1 +TOOLTEST h5diff_600.txt h5diff_basic1.h5 # 6.1: Check if non-exist object name is specified -TOOLTEST h5diff_601.txt $FILE1 $FILE1 nono_obj +TOOLTEST h5diff_601.txt h5diff_basic1.h5 h5diff_basic1.h5 nono_obj # ############################################################################## @@ -463,28 +625,28 @@ TOOLTEST h5diff_601.txt $FILE1 $FILE1 nono_obj # 6.3: negative value -TOOLTEST h5diff_603.txt -d -4 $FILE1 $FILE2 g1/dset3 g1/dset4 +TOOLTEST h5diff_603.txt -d -4 h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dset4 # 6.4: zero -TOOLTEST h5diff_604.txt -d 0 $FILE1 $FILE2 g1/dset3 g1/dset4 +TOOLTEST h5diff_604.txt -d 0 h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dset4 # 6.5: non number -TOOLTEST h5diff_605.txt -d u $FILE1 $FILE2 g1/dset3 g1/dset4 +TOOLTEST h5diff_605.txt -d u h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dset4 # 6.6: hexadecimal -TOOLTEST h5diff_606.txt -d 0x1 $FILE1 $FILE2 g1/dset3 g1/dset4 +TOOLTEST h5diff_606.txt -d 0x1 h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dset4 # 6.7: string -TOOLTEST h5diff_607.txt -d "1" $FILE1 $FILE2 g1/dset3 g1/dset4 +TOOLTEST h5diff_607.txt -d "1" h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dset4 # 6.8: use system epsilon -TOOLTEST h5diff_608.txt --use-system-epsilon $FILE1 $FILE2 g1/dset3 g1/dset4 +TOOLTEST h5diff_608.txt --use-system-epsilon h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dset4 # 6.9: number larger than biggest difference -TOOLTEST h5diff_609.txt -d 200 $FILE1 $FILE2 g1/dset3 g1/dset4 +TOOLTEST h5diff_609.txt -d 200 h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dset4 # 6.10: number smaller than smallest difference -TOOLTEST h5diff_610.txt -d 1 $FILE1 $FILE2 g1/dset3 g1/dset4 +TOOLTEST h5diff_610.txt -d 1 h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dset4 # ############################################################################## @@ -493,28 +655,28 @@ TOOLTEST h5diff_610.txt -d 1 $FILE1 $FILE2 g1/dset3 g1/dset4 # 6.12: negative value -TOOLTEST h5diff_612.txt -p -4 $FILE1 $FILE2 g1/dset3 g1/dset4 +TOOLTEST h5diff_612.txt -p -4 h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dset4 # 6.13: zero -TOOLTEST h5diff_613.txt -p 0 $FILE1 $FILE2 g1/dset3 g1/dset4 +TOOLTEST h5diff_613.txt -p 0 h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dset4 # 6.14: non number -TOOLTEST h5diff_614.txt -p u $FILE1 $FILE2 g1/dset3 g1/dset4 +TOOLTEST h5diff_614.txt -p u h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dset4 # 6.15: hexadecimal -TOOLTEST h5diff_615.txt -p 0x1 $FILE1 $FILE2 g1/dset3 g1/dset4 +TOOLTEST h5diff_615.txt -p 0x1 h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dset4 # 6.16: string -TOOLTEST h5diff_616.txt -p "0.21" $FILE1 $FILE2 g1/dset3 g1/dset4 +TOOLTEST h5diff_616.txt -p "0.21" h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dset4 # 6.17: repeated option -TOOLTEST h5diff_617.txt -p 0.21 -p 0.22 $FILE1 $FILE2 g1/dset3 g1/dset4 +TOOLTEST h5diff_617.txt -p 0.21 -p 0.22 h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dset4 # 6.18: number larger than biggest difference -TOOLTEST h5diff_618.txt -p 2 $FILE1 $FILE2 g1/dset3 g1/dset4 +TOOLTEST h5diff_618.txt -p 2 h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dset4 # 6.19: number smaller than smallest difference -TOOLTEST h5diff_619.txt -p 0.005 $FILE1 $FILE2 g1/dset3 g1/dset4 +TOOLTEST h5diff_619.txt -p 0.005 h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dset4 @@ -523,204 +685,232 @@ TOOLTEST h5diff_619.txt -p 0.005 $FILE1 $FILE2 g1/dset3 g1/dset4 # ############################################################################## # 6.21: negative value -TOOLTEST h5diff_621.txt -n -4 $FILE1 $FILE2 g1/dset3 g1/dset4 +TOOLTEST h5diff_621.txt -n -4 h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dset4 # 6.22: zero -TOOLTEST h5diff_622.txt -n 0 $FILE1 $FILE2 g1/dset3 g1/dset4 +TOOLTEST h5diff_622.txt -n 0 h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dset4 # 6.23: non number -TOOLTEST h5diff_623.txt -n u $FILE1 $FILE2 g1/dset3 g1/dset4 +TOOLTEST h5diff_623.txt -n u h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dset4 # 6.24: hexadecimal -TOOLTEST h5diff_624.txt -n 0x1 $FILE1 $FILE2 g1/dset3 g1/dset4 +TOOLTEST h5diff_624.txt -n 0x1 h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dset4 # 6.25: string -TOOLTEST h5diff_625.txt -n "2" $FILE1 $FILE2 g1/dset3 g1/dset4 +TOOLTEST h5diff_625.txt -n "2" h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dset4 # 6.26: repeated option -TOOLTEST h5diff_626.txt -n 2 -n 3 $FILE1 $FILE2 g1/dset3 g1/dset4 +TOOLTEST h5diff_626.txt -n 2 -n 3 h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dset4 # 6.27: number larger than biggest difference -TOOLTEST h5diff_627.txt --count=200 $FILE1 $FILE2 g1/dset3 g1/dset4 +TOOLTEST h5diff_627.txt --count=200 h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dset4 # 6.28: number smaller than smallest difference -TOOLTEST h5diff_628.txt -n 1 $FILE1 $FILE2 g1/dset3 g1/dset4 +TOOLTEST h5diff_628.txt -n 1 h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dset4 # Disabling this test as it hangs - LRK 20090618 # 6.29 non valid files #TOOLTEST h5diff_629.txt file1.h6 file2.h6 +# ############################################################################## +# # NaN +# ############################################################################## +# 6.30: test (NaN == NaN) must be true based on our documentation -- XCAO +TOOLTEST h5diff_630.txt -v -d "0.0001" h5diff_basic1.h5 h5diff_basic1.h5 g1/fp18 g1/fp18_COPY +TOOLTEST h5diff_631.txt -v --use-system-epsilon h5diff_basic1.h5 h5diff_basic1.h5 g1/fp18 g1/fp18_COPY + # ############################################################################## # 7. attributes # ############################################################################## -TOOLTEST h5diff_70.txt -v $FILE5 $FILE6 +TOOLTEST h5diff_70.txt -v h5diff_attr1.h5 h5diff_attr2.h5 # ################################################## # attrs with verbose option level # ################################################## -TOOLTEST h5diff_700.txt -v1 $FILE5 $FILE6 -TOOLTEST h5diff_701.txt -v2 $FILE5 $FILE6 -TOOLTEST h5diff_702.txt --verbose=1 $FILE5 $FILE6 -TOOLTEST h5diff_703.txt --verbose=2 $FILE5 $FILE6 +TOOLTEST h5diff_700.txt -v1 h5diff_attr1.h5 h5diff_attr2.h5 +TOOLTEST h5diff_701.txt -v2 h5diff_attr1.h5 h5diff_attr2.h5 +TOOLTEST h5diff_702.txt --verbose=1 h5diff_attr1.h5 h5diff_attr2.h5 +TOOLTEST h5diff_703.txt --verbose=2 h5diff_attr1.h5 h5diff_attr2.h5 # same attr number , all same attr name -TOOLTEST h5diff_704.txt -v2 $ATTR_VERBOSE_LEVEL_FILE1 $ATTR_VERBOSE_LEVEL_FILE2 /g +TOOLTEST h5diff_704.txt -v2 h5diff_attr_v_level1.h5 h5diff_attr_v_level2.h5 /g # same attr number , some same attr name -TOOLTEST h5diff_705.txt -v2 $ATTR_VERBOSE_LEVEL_FILE1 $ATTR_VERBOSE_LEVEL_FILE2 /dset +TOOLTEST h5diff_705.txt -v2 h5diff_attr_v_level1.h5 h5diff_attr_v_level2.h5 /dset # same attr number , all different attr name -TOOLTEST h5diff_706.txt -v2 $ATTR_VERBOSE_LEVEL_FILE1 $ATTR_VERBOSE_LEVEL_FILE2 /ntype +TOOLTEST h5diff_706.txt -v2 h5diff_attr_v_level1.h5 h5diff_attr_v_level2.h5 /ntype # different attr number , same attr name (intersected) -TOOLTEST h5diff_707.txt -v2 $ATTR_VERBOSE_LEVEL_FILE1 $ATTR_VERBOSE_LEVEL_FILE2 /g2 +TOOLTEST h5diff_707.txt -v2 h5diff_attr_v_level1.h5 h5diff_attr_v_level2.h5 /g2 # different attr number , all different attr name -TOOLTEST h5diff_708.txt -v2 $ATTR_VERBOSE_LEVEL_FILE1 $ATTR_VERBOSE_LEVEL_FILE2 /g3 +TOOLTEST h5diff_708.txt -v2 h5diff_attr_v_level1.h5 h5diff_attr_v_level2.h5 /g3 # when no attributes exist in both objects -TOOLTEST h5diff_709.txt -v2 $ATTR_VERBOSE_LEVEL_FILE1 $ATTR_VERBOSE_LEVEL_FILE2 /g4 +TOOLTEST h5diff_709.txt -v2 h5diff_attr_v_level1.h5 h5diff_attr_v_level2.h5 /g4 # file vs file -TOOLTEST h5diff_710.txt -v2 $ATTR_VERBOSE_LEVEL_FILE1 $ATTR_VERBOSE_LEVEL_FILE2 +TOOLTEST h5diff_710.txt -v2 h5diff_attr_v_level1.h5 h5diff_attr_v_level2.h5 # ############################################################################## # 8. all dataset datatypes # ############################################################################## -TOOLTEST h5diff_80.txt -v $FILE7 $FILE8 +TOOLTEST h5diff_80.txt -v h5diff_dset1.h5 h5diff_dset2.h5 # 9. compare a file with itself -TOOLTEST h5diff_90.txt -v $FILE2 $FILE2 +TOOLTEST h5diff_90.txt -v h5diff_basic2.h5 h5diff_basic2.h5 # 10. read by hyperslab, print indexes if test -n "$pmode" -a "$mydomainname" = hdfgroup.uiuc.edu; then # skip this test which sometimes hangs in some THG machines - SKIP -v $FILE9 $FILE10 + SKIP -v h5diff_hyper1.h5 h5diff_hyper2.h5 else - TOOLTEST h5diff_100.txt -v $FILE9 $FILE10 + TOOLTEST h5diff_100.txt -v h5diff_hyper1.h5 h5diff_hyper2.h5 fi # 11. floating point comparison # double value -TOOLTEST h5diff_101.txt -v $FILE1 $FILE1 g1/d1 g1/d2 +TOOLTEST h5diff_101.txt -v h5diff_basic1.h5 h5diff_basic1.h5 g1/d1 g1/d2 # float value -TOOLTEST h5diff_102.txt -v $FILE1 $FILE1 g1/fp1 g1/fp2 +TOOLTEST h5diff_102.txt -v h5diff_basic1.h5 h5diff_basic1.h5 g1/fp1 g1/fp2 # with --use-system-epsilon for double value -TOOLTEST h5diff_103.txt -v --use-system-epsilon $FILE1 $FILE1 g1/d1 g1/d2 +TOOLTEST h5diff_103.txt -v --use-system-epsilon h5diff_basic1.h5 h5diff_basic1.h5 g1/d1 g1/d2 # with --use-system-epsilon for float value -TOOLTEST h5diff_104.txt -v --use-system-epsilon $FILE1 $FILE1 g1/fp1 g1/fp2 +TOOLTEST h5diff_104.txt -v --use-system-epsilon h5diff_basic1.h5 h5diff_basic1.h5 g1/fp1 g1/fp2 # not comparable -c flag -TOOLTEST h5diff_200.txt $FILE2 $FILE2 g2/dset1 g2/dset2 - -TOOLTEST h5diff_201.txt -c $FILE2 $FILE2 g2/dset1 g2/dset2 +TOOLTEST h5diff_200.txt h5diff_basic2.h5 h5diff_basic2.h5 g2/dset1 g2/dset2 -TOOLTEST h5diff_202.txt -c $FILE2 $FILE2 g2/dset2 g2/dset3 +TOOLTEST h5diff_201.txt -c h5diff_basic2.h5 h5diff_basic2.h5 g2/dset1 g2/dset2 -TOOLTEST h5diff_203.txt -c $FILE2 $FILE2 g2/dset3 g2/dset4 +TOOLTEST h5diff_202.txt -c h5diff_basic2.h5 h5diff_basic2.h5 g2/dset2 g2/dset3 -TOOLTEST h5diff_204.txt -c $FILE2 $FILE2 g2/dset4 g2/dset5 +TOOLTEST h5diff_203.txt -c h5diff_basic2.h5 h5diff_basic2.h5 g2/dset3 g2/dset4 -TOOLTEST h5diff_205.txt -c $FILE2 $FILE2 g2/dset5 g2/dset6 +TOOLTEST h5diff_204.txt -c h5diff_basic2.h5 h5diff_basic2.h5 g2/dset4 g2/dset5 +TOOLTEST h5diff_205.txt -c h5diff_basic2.h5 h5diff_basic2.h5 g2/dset5 g2/dset6 # not comparable in compound -TOOLTEST h5diff_206.txt -c $FILE2 $FILE2 g2/dset7 g2/dset8 +TOOLTEST h5diff_206.txt -c h5diff_basic2.h5 h5diff_basic2.h5 g2/dset7 g2/dset8 -TOOLTEST h5diff_207.txt -c $FILE2 $FILE2 g2/dset8 g2/dset9 +TOOLTEST h5diff_207.txt -c h5diff_basic2.h5 h5diff_basic2.h5 g2/dset8 g2/dset9 +# not comparable in dataspace of zero dimension size +TOOLTEST h5diff_208.txt -c h5diff_dset_zero_dim_size1.h5 h5diff_dset_zero_dim_size2.h5 + +# non-comparable dataset with comparable attribute, and other comparable datasets. +# Also test non-compatible attributes with different type, dimention, rank. +# All the comparables should display differences. +TOOLTEST h5diff_220.txt -c non_comparables1.h5 non_comparables2.h5 /g1 + +# comparable dataset with non-comparable attribute and other comparable attributes. +# All the comparables should display differences. +TOOLTEST h5diff_221.txt -c non_comparables1.h5 non_comparables2.h5 /g2 + +# entire file +# All the comparables should display differences. +if test -n "$pmode" -a "$mydomainname" = hdfgroup.uiuc.edu; then + # parallel mode: + # skip due to ph5diff hangs on koala (linux64-LE) randomly. + SKIP -c non_comparables1.h5 non_comparables2.h5 +else + TOOLTEST h5diff_222.txt -c non_comparables1.h5 non_comparables2.h5 +fi + # ############################################################################## # # Links compare without --follow-symlinks nor --no-dangling-links # ############################################################################## # test for bug1749 -TOOLTEST h5diff_300.txt -v $FILE12 $FILE12 /link_g1 /link_g2 +TOOLTEST h5diff_300.txt -v h5diff_links.h5 h5diff_links.h5 /link_g1 /link_g2 # ############################################################################## # # Links compare with --follow-symlinks Only # ############################################################################## # soft links file to file -TOOLTEST h5diff_400.txt --follow-symlinks -v $FILE13 $FILE13 +TOOLTEST h5diff_400.txt --follow-symlinks -v h5diff_softlinks.h5 h5diff_softlinks.h5 # softlink vs dset" -TOOLTEST h5diff_401.txt --follow-symlinks -v $FILE13 $FILE13 /softlink_dset1_1 /target_dset2 +TOOLTEST h5diff_401.txt --follow-symlinks -v h5diff_softlinks.h5 h5diff_softlinks.h5 /softlink_dset1_1 /target_dset2 # dset vs softlink" -TOOLTEST h5diff_402.txt --follow-symlinks -v $FILE13 $FILE13 /target_dset2 /softlink_dset1_1 +TOOLTEST h5diff_402.txt --follow-symlinks -v h5diff_softlinks.h5 h5diff_softlinks.h5 /target_dset2 /softlink_dset1_1 # softlink vs softlink" -TOOLTEST h5diff_403.txt --follow-symlinks -v $FILE13 $FILE13 /softlink_dset1_1 /softlink_dset2 +TOOLTEST h5diff_403.txt --follow-symlinks -v h5diff_softlinks.h5 h5diff_softlinks.h5 /softlink_dset1_1 /softlink_dset2 # extlink vs extlink (FILE)" -TOOLTEST h5diff_404.txt --follow-symlinks -v $FILE15 $FILE15 +TOOLTEST h5diff_404.txt --follow-symlinks -v h5diff_extlink_src.h5 h5diff_extlink_src.h5 # extlink vs dset" -TOOLTEST h5diff_405.txt --follow-symlinks -v $FILE15 $FILE16 /ext_link_dset1 /target_group2/x_dset +TOOLTEST h5diff_405.txt --follow-symlinks -v h5diff_extlink_src.h5 h5diff_extlink_trg.h5 /ext_link_dset1 /target_group2/x_dset # dset vs extlink" -TOOLTEST h5diff_406.txt --follow-symlinks -v $FILE16 $FILE15 /target_group2/x_dset /ext_link_dset1 +TOOLTEST h5diff_406.txt --follow-symlinks -v h5diff_extlink_trg.h5 h5diff_extlink_src.h5 /target_group2/x_dset /ext_link_dset1 # extlink vs extlink" -TOOLTEST h5diff_407.txt --follow-symlinks -v $FILE15 $FILE15 /ext_link_dset1 /ext_link_dset2 +TOOLTEST h5diff_407.txt --follow-symlinks -v h5diff_extlink_src.h5 h5diff_extlink_src.h5 /ext_link_dset1 /ext_link_dset2 # softlink vs extlink" -TOOLTEST h5diff_408.txt --follow-symlinks -v $FILE13 $FILE15 /softlink_dset1_1 /ext_link_dset2 +TOOLTEST h5diff_408.txt --follow-symlinks -v h5diff_softlinks.h5 h5diff_extlink_src.h5 /softlink_dset1_1 /ext_link_dset2 # extlink vs softlink " -TOOLTEST h5diff_409.txt --follow-symlinks -v $FILE15 $FILE13 /ext_link_dset2 /softlink_dset1_1 +TOOLTEST h5diff_409.txt --follow-symlinks -v h5diff_extlink_src.h5 h5diff_softlinks.h5 /ext_link_dset2 /softlink_dset1_1 # linked_softlink vs linked_softlink (FILE)" -TOOLTEST h5diff_410.txt --follow-symlinks -v $FILE14 $FILE14 +TOOLTEST h5diff_410.txt --follow-symlinks -v h5diff_linked_softlink.h5 h5diff_linked_softlink.h5 # dset2 vs linked_softlink_dset1" -TOOLTEST h5diff_411.txt --follow-symlinks -v $FILE14 $FILE14 /target_dset2 /softlink1_to_slink2 +TOOLTEST h5diff_411.txt --follow-symlinks -v h5diff_linked_softlink.h5 h5diff_linked_softlink.h5 /target_dset2 /softlink1_to_slink2 # linked_softlink_dset1 vs dset2" -TOOLTEST h5diff_412.txt --follow-symlinks -v $FILE14 $FILE14 /softlink1_to_slink2 /target_dset2 +TOOLTEST h5diff_412.txt --follow-symlinks -v h5diff_linked_softlink.h5 h5diff_linked_softlink.h5 /softlink1_to_slink2 /target_dset2 # linked_softlink_to_dset1 vs linked_softlink_to_dset2" -TOOLTEST h5diff_413.txt --follow-symlinks -v $FILE14 $FILE14 /softlink1_to_slink2 /softlink2_to_slink2 +TOOLTEST h5diff_413.txt --follow-symlinks -v h5diff_linked_softlink.h5 h5diff_linked_softlink.h5 /softlink1_to_slink2 /softlink2_to_slink2 # group vs linked_softlink_group1" -TOOLTEST h5diff_414.txt --follow-symlinks -v $FILE14 $FILE14 /target_group /softlink3_to_slink2 +TOOLTEST h5diff_414.txt --follow-symlinks -v h5diff_linked_softlink.h5 h5diff_linked_softlink.h5 /target_group /softlink3_to_slink2 # linked_softlink_group1 vs group" -TOOLTEST h5diff_415.txt --follow-symlinks -v $FILE14 $FILE14 /softlink3_to_slink2 /target_group +TOOLTEST h5diff_415.txt --follow-symlinks -v h5diff_linked_softlink.h5 h5diff_linked_softlink.h5 /softlink3_to_slink2 /target_group # linked_softlink_to_group1 vs linked_softlink_to_group2" -TOOLTEST h5diff_416.txt --follow-symlinks -v $FILE14 $FILE14 /softlink3_to_slink2 /softlink4_to_slink2 +TOOLTEST h5diff_416.txt --follow-symlinks -v h5diff_linked_softlink.h5 h5diff_linked_softlink.h5 /softlink3_to_slink2 /softlink4_to_slink2 # non-exist-softlink vs softlink" -TOOLTEST h5diff_417.txt --follow-symlinks -v $FILE13 $FILE13 /softlink_noexist /softlink_dset2 +TOOLTEST h5diff_417.txt --follow-symlinks -v h5diff_softlinks.h5 h5diff_softlinks.h5 /softlink_noexist /softlink_dset2 # softlink vs non-exist-softlink" -TOOLTEST h5diff_418.txt --follow-symlinks -v $FILE13 $FILE13 /softlink_dset2 /softlink_noexist +TOOLTEST h5diff_418.txt --follow-symlinks -v h5diff_softlinks.h5 h5diff_softlinks.h5 /softlink_dset2 /softlink_noexist # non-exist-extlink_file vs extlink" -TOOLTEST h5diff_419.txt --follow-symlinks -v $FILE15 $FILE15 /ext_link_noexist2 /ext_link_dset2 +TOOLTEST h5diff_419.txt --follow-symlinks -v h5diff_extlink_src.h5 h5diff_extlink_src.h5 /ext_link_noexist2 /ext_link_dset2 # exlink vs non-exist-extlink_file" -TOOLTEST h5diff_420.txt --follow-symlinks -v $FILE15 $FILE15 /ext_link_dset2 /ext_link_noexist2 +TOOLTEST h5diff_420.txt --follow-symlinks -v h5diff_extlink_src.h5 h5diff_extlink_src.h5 /ext_link_dset2 /ext_link_noexist2 # extlink vs non-exist-extlink_obj" -TOOLTEST h5diff_421.txt --follow-symlinks -v $FILE15 $FILE15 /ext_link_dset2 /ext_link_noexist1 +TOOLTEST h5diff_421.txt --follow-symlinks -v h5diff_extlink_src.h5 h5diff_extlink_src.h5 /ext_link_dset2 /ext_link_noexist1 # non-exist-extlink_obj vs extlink" -TOOLTEST h5diff_422.txt --follow-symlinks -v $FILE15 $FILE15 /ext_link_noexist1 /ext_link_dset2 +TOOLTEST h5diff_422.txt --follow-symlinks -v h5diff_extlink_src.h5 h5diff_extlink_src.h5 /ext_link_noexist1 /ext_link_dset2 # extlink_to_softlink_to_dset1 vs dset2" -TOOLTEST h5diff_423.txt --follow-symlinks -v $FILE17 $FILE18 /ext_link_to_slink1 /dset2 +TOOLTEST h5diff_423.txt --follow-symlinks -v h5diff_ext2softlink_src.h5 h5diff_ext2softlink_trg.h5 /ext_link_to_slink1 /dset2 # dset2 vs extlink_to_softlink_to_dset1" -TOOLTEST h5diff_424.txt --follow-symlinks -v $FILE18 $FILE17 /dset2 /ext_link_to_slink1 +TOOLTEST h5diff_424.txt --follow-symlinks -v h5diff_ext2softlink_trg.h5 h5diff_ext2softlink_src.h5 /dset2 /ext_link_to_slink1 # extlink_to_softlink_to_dset1 vs extlink_to_softlink_to_dset2" -TOOLTEST h5diff_425.txt --follow-symlinks -v $FILE17 $FILE17 /ext_link_to_slink1 /ext_link_to_slink2 +TOOLTEST h5diff_425.txt --follow-symlinks -v h5diff_ext2softlink_src.h5 h5diff_ext2softlink_src.h5 /ext_link_to_slink1 /ext_link_to_slink2 # ############################################################################## # 19. The comparision for the two datasets between the 2 files should be the same @@ -733,83 +923,95 @@ TOOLTEST h5diff_idx.txt -v $FILE19 $FILE20 # # Dangling links compare (--follow-symlinks and --no-dangling-links) # ############################################################################## # dangling links --follow-symlinks (FILE to FILE) -TOOLTEST h5diff_450.txt --follow-symlinks -v $DANGLE_LINK_FILE1 $DANGLE_LINK_FILE2 +TOOLTEST h5diff_450.txt --follow-symlinks -v h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 # dangling links --follow-symlinks and --no-dangling-links (FILE to FILE) -TOOLTEST h5diff_451.txt --follow-symlinks -v --no-dangling-links $DANGLE_LINK_FILE1 $DANGLE_LINK_FILE2 +TOOLTEST h5diff_451.txt --follow-symlinks -v --no-dangling-links h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 # try --no-dangling-links without --follow-symlinks options -TOOLTEST h5diff_452.txt --no-dangling-links $FILE13 $FILE13 +TOOLTEST h5diff_452.txt --no-dangling-links h5diff_softlinks.h5 h5diff_softlinks.h5 # dangling link found for soft links (FILE to FILE) -TOOLTEST h5diff_453.txt --follow-symlinks -v --no-dangling-links $FILE13 $FILE13 +TOOLTEST h5diff_453.txt --follow-symlinks -v --no-dangling-links h5diff_softlinks.h5 h5diff_softlinks.h5 # dangling link found for soft links (obj to obj) -TOOLTEST h5diff_454.txt --follow-symlinks -v --no-dangling-links $FILE13 $FILE13 /softlink_dset2 /softlink_noexist +TOOLTEST h5diff_454.txt --follow-symlinks -v --no-dangling-links h5diff_softlinks.h5 h5diff_softlinks.h5 /softlink_dset2 /softlink_noexist # dangling link found for soft links (obj to obj) Both dangle links -TOOLTEST h5diff_455.txt --follow-symlinks -v --no-dangling-links $FILE13 $FILE13 /softlink_noexist /softlink_noexist +TOOLTEST h5diff_455.txt --follow-symlinks -v --no-dangling-links h5diff_softlinks.h5 h5diff_softlinks.h5 /softlink_noexist /softlink_noexist # dangling link found for ext links (FILE to FILE) -TOOLTEST h5diff_456.txt --follow-symlinks -v --no-dangling-links $FILE15 $FILE15 +TOOLTEST h5diff_456.txt --follow-symlinks -v --no-dangling-links h5diff_extlink_src.h5 h5diff_extlink_src.h5 # dangling link found for ext links (obj to obj). target file exist -TOOLTEST h5diff_457.txt --follow-symlinks -v --no-dangling-links $FILE15 $FILE15 /ext_link_dset1 /ext_link_noexist1 +TOOLTEST h5diff_457.txt --follow-symlinks -v --no-dangling-links h5diff_extlink_src.h5 h5diff_extlink_src.h5 /ext_link_dset1 /ext_link_noexist1 # dangling link found for ext links (obj to obj). target file NOT exist -TOOLTEST h5diff_458.txt --follow-symlinks -v --no-dangling-links $FILE15 $FILE15 /ext_link_dset1 /ext_link_noexist2 +TOOLTEST h5diff_458.txt --follow-symlinks -v --no-dangling-links h5diff_extlink_src.h5 h5diff_extlink_src.h5 /ext_link_dset1 /ext_link_noexist2 # dangling link found for ext links (obj to obj). Both dangle links -TOOLTEST h5diff_459.txt --follow-symlinks -v --no-dangling-links $FILE15 $FILE15 /ext_link_noexist1 /ext_link_noexist2 - +TOOLTEST h5diff_459.txt --follow-symlinks -v --no-dangling-links h5diff_extlink_src.h5 h5diff_extlink_src.h5 /ext_link_noexist1 /ext_link_noexist2 + +# dangling link --follow-symlinks (obj vs obj) +# (HDFFV-7836) +TOOLTEST h5diff_465.txt --follow-symlinks h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /soft_link1 +# (HDFFV-7835) +# soft dangling vs. soft dangling +TOOLTEST h5diff_466.txt -v --follow-symlinks h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /soft_link1 +# soft link vs. soft dangling +TOOLTEST h5diff_467.txt -v --follow-symlinks h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /soft_link2 +# ext dangling vs. ext dangling +TOOLTEST h5diff_468.txt -v --follow-symlinks h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /ext_link4 +# ext link vs. ext dangling +TOOLTEST h5diff_469.txt -v --follow-symlinks h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /ext_link2 # ############################################################################## # # test for group diff recursivly # ############################################################################## # root -TOOLTEST h5diff_500.txt -v $GRP_RECURSE_FILE1 $GRP_RECURSE_FILE2 / / -TOOLTEST h5diff_501.txt -v --follow-symlinks $GRP_RECURSE_FILE1 $GRP_RECURSE_FILE2 / / +TOOLTEST h5diff_500.txt -v h5diff_grp_recurse1.h5 h5diff_grp_recurse2.h5 / / +TOOLTEST h5diff_501.txt -v --follow-symlinks h5diff_grp_recurse1.h5 h5diff_grp_recurse2.h5 / / # root vs group -TOOLTEST h5diff_502.txt -v $GRP_RECURSE_FILE1 $GRP_RECURSE_FILE2 / /grp1/grp2/grp3 +TOOLTEST h5diff_502.txt -v h5diff_grp_recurse1.h5 h5diff_grp_recurse2.h5 / /grp1/grp2/grp3 # group vs group (same name and structure) -TOOLTEST h5diff_503.txt -v $GRP_RECURSE_FILE1 $GRP_RECURSE_FILE2 /grp1 /grp1 +TOOLTEST h5diff_503.txt -v h5diff_grp_recurse1.h5 h5diff_grp_recurse2.h5 /grp1 /grp1 # group vs group (different name and structure) -TOOLTEST h5diff_504.txt -v $GRP_RECURSE_FILE1 $GRP_RECURSE_FILE2 /grp1/grp2 /grp1/grp2/grp3 +TOOLTEST h5diff_504.txt -v h5diff_grp_recurse1.h5 h5diff_grp_recurse2.h5 /grp1/grp2 /grp1/grp2/grp3 # groups vs soft-link -TOOLTEST h5diff_505.txt -v $GRP_RECURSE_FILE1 $GRP_RECURSE_FILE2 /grp1 /slink_grp1 -TOOLTEST h5diff_506.txt -v --follow-symlinks $GRP_RECURSE_FILE1 $GRP_RECURSE_FILE2 /grp1/grp2 /slink_grp2 +TOOLTEST h5diff_505.txt -v h5diff_grp_recurse1.h5 h5diff_grp_recurse2.h5 /grp1 /slink_grp1 +TOOLTEST h5diff_506.txt -v --follow-symlinks h5diff_grp_recurse1.h5 h5diff_grp_recurse2.h5 /grp1/grp2 /slink_grp2 # groups vs ext-link -TOOLTEST h5diff_507.txt -v $GRP_RECURSE_FILE1 $GRP_RECURSE_FILE2 /grp1 /elink_grp1 -TOOLTEST h5diff_508.txt -v --follow-symlinks $GRP_RECURSE_FILE1 $GRP_RECURSE_FILE2 /grp1 /elink_grp1 +TOOLTEST h5diff_507.txt -v h5diff_grp_recurse1.h5 h5diff_grp_recurse2.h5 /grp1 /elink_grp1 +TOOLTEST h5diff_508.txt -v --follow-symlinks h5diff_grp_recurse1.h5 h5diff_grp_recurse2.h5 /grp1 /elink_grp1 # soft-link vs ext-link -TOOLTEST h5diff_509.txt -v $GRP_RECURSE_FILE1 $GRP_RECURSE_FILE2 /slink_grp1 /elink_grp1 -TOOLTEST h5diff_510.txt -v --follow-symlinks $GRP_RECURSE_FILE1 $GRP_RECURSE_FILE2 /slink_grp1 /elink_grp1 +TOOLTEST h5diff_509.txt -v h5diff_grp_recurse1.h5 h5diff_grp_recurse2.h5 /slink_grp1 /elink_grp1 +TOOLTEST h5diff_510.txt -v --follow-symlinks h5diff_grp_recurse1.h5 h5diff_grp_recurse2.h5 /slink_grp1 /elink_grp1 # circled ext links -TOOLTEST h5diff_511.txt -v $GRP_RECURSE_FILE1 $GRP_RECURSE_FILE2 /grp10 /grp11 -TOOLTEST h5diff_512.txt -v --follow-symlinks $GRP_RECURSE_FILE1 $GRP_RECURSE_FILE2 /grp10 /grp11 +TOOLTEST h5diff_511.txt -v h5diff_grp_recurse1.h5 h5diff_grp_recurse2.h5 /grp10 /grp11 +TOOLTEST h5diff_512.txt -v --follow-symlinks h5diff_grp_recurse1.h5 h5diff_grp_recurse2.h5 /grp10 /grp11 # circled soft2ext-link vs soft2ext-link -TOOLTEST h5diff_513.txt -v $GRP_RECURSE_FILE1 $GRP_RECURSE_FILE2 /slink_grp10 /slink_grp11 -TOOLTEST h5diff_514.txt -v --follow-symlinks $GRP_RECURSE_FILE1 $GRP_RECURSE_FILE2 /slink_grp10 /slink_grp11 +TOOLTEST h5diff_513.txt -v h5diff_grp_recurse1.h5 h5diff_grp_recurse2.h5 /slink_grp10 /slink_grp11 +TOOLTEST h5diff_514.txt -v --follow-symlinks h5diff_grp_recurse1.h5 h5diff_grp_recurse2.h5 /slink_grp10 /slink_grp11 ############################################################################### # Test for group recursive diff via multi-linked external links -# With follow-symlinks, file $GRP_RECURSE1_EXT and $GRP_RECURSE2_EXT1 should +# With follow-symlinks, file h5diff_grp_recurse_ext1.h5 and h5diff_grp_recurse_ext2-1.h5 should # be same with the external links. ############################################################################### # file vs file -TOOLTEST h5diff_515.txt -v $GRP_RECURSE1_EXT $GRP_RECURSE2_EXT1 -TOOLTEST h5diff_516.txt -v --follow-symlinks $GRP_RECURSE1_EXT $GRP_RECURSE2_EXT1 +TOOLTEST h5diff_515.txt -v h5diff_grp_recurse_ext1.h5 h5diff_grp_recurse_ext2-1.h5 +TOOLTEST h5diff_516.txt -v --follow-symlinks h5diff_grp_recurse_ext1.h5 h5diff_grp_recurse_ext2-1.h5 # group vs group -TOOLTEST h5diff_517.txt -v $GRP_RECURSE1_EXT $GRP_RECURSE2_EXT1 /g1 -TOOLTEST h5diff_518.txt -v --follow-symlinks $GRP_RECURSE1_EXT $GRP_RECURSE2_EXT1 /g1 +TOOLTEST h5diff_517.txt -v h5diff_grp_recurse_ext1.h5 h5diff_grp_recurse_ext2-1.h5 /g1 +TOOLTEST h5diff_518.txt -v --follow-symlinks h5diff_grp_recurse_ext1.h5 h5diff_grp_recurse_ext2-1.h5 /g1 # ############################################################################## # # Exclude objects (--exclude-path) @@ -818,25 +1020,44 @@ TOOLTEST h5diff_518.txt -v --follow-symlinks $GRP_RECURSE1_EXT $GRP_RECURSE2_EXT # Same structure, same names and different value. # # Exclude the object with different value. Expect return - same -TOOLTEST h5diff_480.txt -v --exclude-path /group1/dset3 $EXCLUDE_FILE1_1 $EXCLUDE_FILE1_2 +TOOLTEST h5diff_480.txt -v --exclude-path /group1/dset3 h5diff_exclude1-1.h5 h5diff_exclude1-2.h5 # Verify different by not excluding. Expect return - diff -TOOLTEST h5diff_481.txt -v $EXCLUDE_FILE1_1 $EXCLUDE_FILE1_2 +TOOLTEST h5diff_481.txt -v h5diff_exclude1-1.h5 h5diff_exclude1-2.h5 # # Different structure, different names. # # Exclude all the different objects. Expect return - same -TOOLTEST h5diff_482.txt -v --exclude-path "/group1" --exclude-path "/dset1" $EXCLUDE_FILE2_1 $EXCLUDE_FILE2_2 +TOOLTEST h5diff_482.txt -v --exclude-path "/group1" --exclude-path "/dset1" h5diff_exclude2-1.h5 h5diff_exclude2-2.h5 # Exclude only some different objects. Expect return - diff -TOOLTEST h5diff_483.txt -v --exclude-path "/group1" $EXCLUDE_FILE2_1 $EXCLUDE_FILE2_2 +TOOLTEST h5diff_483.txt -v --exclude-path "/group1" h5diff_exclude2-1.h5 h5diff_exclude2-2.h5 # Exclude from group compare -TOOLTEST h5diff_484.txt -v --exclude-path "/dset3" $EXCLUDE_FILE1_1 $EXCLUDE_FILE1_2 /group1 +TOOLTEST h5diff_484.txt -v --exclude-path "/dset3" h5diff_exclude1-1.h5 h5diff_exclude1-2.h5 /group1 # ############################################################################## # # diff various multiple vlen and fixed strings in a compound type dataset # ############################################################################## -TOOLTEST h5diff_530.txt -v $COMP_VL_STRS_FILE $COMP_VL_STRS_FILE +TOOLTEST h5diff_530.txt -v h5diff_comp_vl_strs.h5 h5diff_comp_vl_strs.h5 /group /group_copy + +# ############################################################################## +# # Test container types (array,vlen) with multiple nested compound types +# # Complex compound types in dataset and attribute +# ############################################################################## +TOOLTEST h5diff_540.txt -v compounds_array_vlen1.h5 compounds_array_vlen2.h5 + +# ############################################################################## +# # Test mutually exclusive options +# ############################################################################## +# Test with -d , -p and --use-system-epsilon. +TOOLTEST h5diff_640.txt -v -d 5 -p 0.05 --use-system-epsilon h5diff_basic1.h5 h5diff_basic2.h5 /g1/dset3 /g1/dset4 +TOOLTEST h5diff_641.txt -v -d 5 -p 0.05 h5diff_basic1.h5 h5diff_basic2.h5 /g1/dset3 /g1/dset4 +TOOLTEST h5diff_642.txt -v -p 0.05 -d 5 h5diff_basic1.h5 h5diff_basic2.h5 /g1/dset3 /g1/dset4 +TOOLTEST h5diff_643.txt -v -d 5 --use-system-epsilon h5diff_basic1.h5 h5diff_basic2.h5 /g1/dset3 /g1/dset4 +TOOLTEST h5diff_644.txt -v --use-system-epsilon -d 5 h5diff_basic1.h5 h5diff_basic2.h5 /g1/dset3 /g1/dset4 +TOOLTEST h5diff_645.txt -v -p 0.05 --use-system-epsilon h5diff_basic1.h5 h5diff_basic2.h5 /g1/dset3 /g1/dset4 +TOOLTEST h5diff_646.txt -v --use-system-epsilon -p 0.05 h5diff_basic1.h5 h5diff_basic2.h5 /g1/dset3 /g1/dset4 + # ############################################################################## # # END diff --git a/tools/h5dump/CMakeLists.txt b/tools/h5dump/CMakeLists.txt index b732bfe..a6e452d 100644 --- a/tools/h5dump/CMakeLists.txt +++ b/tools/h5dump/CMakeLists.txt @@ -1,18 +1,22 @@ -cmake_minimum_required (VERSION 2.8) +cmake_minimum_required (VERSION 2.8.6) PROJECT (HDF5_TOOLS_H5DUMP) #----------------------------------------------------------------------------- # Setup include Directories #----------------------------------------------------------------------------- INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib) -INCLUDE_DIRECTORIES (${HDF5_PROJECT_DIR}/test) # -------------------------------------------------------------------- # Add the h5dump executables # -------------------------------------------------------------------- -ADD_EXECUTABLE (h5dump ${HDF5_TOOLS_H5DUMP_SOURCE_DIR}/h5dump.c) +ADD_EXECUTABLE (h5dump + ${HDF5_TOOLS_H5DUMP_SOURCE_DIR}/h5dump.c + ${HDF5_TOOLS_H5DUMP_SOURCE_DIR}/h5dump_ddl.c + ${HDF5_TOOLS_H5DUMP_SOURCE_DIR}/h5dump_xml.c +) TARGET_NAMING (h5dump ${LIB_TYPE}) TARGET_LINK_LIBRARIES (h5dump ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) +SET_TARGET_PROPERTIES (h5dump PROPERTIES FOLDER tools) SET (H5_DEP_EXECUTABLES h5dump) @@ -30,6 +34,7 @@ IF (BUILD_TESTING) ADD_EXECUTABLE (h5dumpgentest ${HDF5_TOOLS_H5DUMP_SOURCE_DIR}/h5dumpgentest.c) TARGET_NAMING (h5dumpgentest ${LIB_TYPE}) TARGET_LINK_LIBRARIES (h5dumpgentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + SET_TARGET_PROPERTIES (h5dumpgentest PROPERTIES FOLDER generator/tools) #ADD_TEST (NAME h5dumpgentest COMMAND $) ENDIF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) @@ -38,6 +43,7 @@ IF (BUILD_TESTING) # Copy all the HDF5 files from the test directory into the source directory # -------------------------------------------------------------------- SET (HDF5_REFERENCE_FILES + file_space.ddl filter_fail.ddl packedbits.ddl tall-1.ddl @@ -47,6 +53,7 @@ IF (BUILD_TESTING) tall-3.ddl tall-4s.ddl tall-5s.ddl + tall-6.ddl tallfilters.ddl tarray1.ddl tarray1_big.ddl @@ -60,8 +67,14 @@ IF (BUILD_TESTING) tattr-1.ddl tattr-2.ddl tattr-3.ddl + tattr-4_be.ddl tattrreg.ddl tattrregR.ddl + tbin1.ddl + tbin1.ddl + tbin2.ddl + tbin3.ddl + tbin4.ddl tbinregR.ddl tbigdims.ddl tboot1.ddl @@ -82,6 +95,10 @@ IF (BUILD_TESTING) tdset-2.ddl tdset-3s.ddl tempty.ddl + texceedsubstart.ddl + texceedsubcount.ddl + texceedsubstride.ddl + texceedsubblock.ddl texternal.ddl textlinksrc.ddl textlinkfar.ddl @@ -110,11 +127,15 @@ IF (BUILD_TESTING) tlonglinks.ddl tloop-1.ddl tmulti.ddl + tmultifile.ddl +# tqmarkfile.ddl +# tstarfile.ddl tnamed_dtype_attr.ddl tnestcomp-1.ddl tnbit.ddl - tnofilename.ddl + tno-subset.ddl tnullspace.ddl + zerodim.ddl tordergr1.ddl tordergr2.ddl tordergr3.ddl @@ -131,6 +152,7 @@ IF (BUILD_TESTING) tshuffle.ddl tslink-1.ddl tslink-2.ddl + tslink-D.ddl tsplit_file.ddl tstr-1.ddl tstr-2.ddl @@ -148,6 +170,8 @@ IF (BUILD_TESTING) tvldtypes5.ddl tvlstr.ddl tvms.ddl + h5dump-help.txt + out3.h5import ) SET (HDF5_XML_REFERENCE_FILES tall.h5.xml @@ -215,17 +239,7 @@ IF (BUILD_TESTING) tvlstr.h5.xml ) SET (HDF5_REFERENCE_TEST_FILES - tbin1.ddl - tbin1.ddl - tbin2.ddl - tbin3.ddl - tbin4.ddl - tall-6.ddl - texceedsubstart.ddl - texceedsubcount.ddl - texceedsubstride.ddl - texceedsubblock.ddl - out3.h5import + file_space.h5 filter_fail.h5 packedbits.h5 taindices.h5 @@ -241,6 +255,7 @@ IF (BUILD_TESTING) tarray8.h5 tattr.h5 tattr2.h5 + tattr4_be.h5 tattrreg.h5 tbigdims.h5 tbinary.h5 @@ -250,6 +265,7 @@ IF (BUILD_TESTING) tdatareg.h5 tdset.h5 tempty.h5 + tsoftlinks.h5 textlinkfar.h5 textlinksrc.h5 textlinktar.h5 @@ -286,7 +302,9 @@ IF (BUILD_TESTING) tmulti-s.h5 tnamed_dtype_attr.h5 tnestedcomp.h5 + tno-subset.h5 tnullspace.h5 + zerodim.h5 torderattr.h5 tordergr.h5 tsaf.h5 @@ -331,23 +349,23 @@ IF (BUILD_TESTING) FOREACH (ddl_file ${HDF5_REFERENCE_FILES}) SET (ddldest "${PROJECT_BINARY_DIR}/${ddl_file}") - #MESSAGE (STATUS " Translating ${ddl_file}") + #MESSAGE (STATUS " Copying ${ddl_file}") ADD_CUSTOM_COMMAND ( TARGET h5dump POST_BUILD - COMMAND ${XLATE_UTILITY} - ARGS ${HDF5_TOOLS_SRC_DIR}/testfiles/${ddl_file} ${ddldest} -l3 + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different ${HDF5_TOOLS_SRC_DIR}/testfiles/${ddl_file} ${ddldest} ) ENDFOREACH (ddl_file ${HDF5_REFERENCE_FILES}) FOREACH (xml_file ${HDF5_XML_REFERENCE_FILES}) SET (xmldest "${PROJECT_BINARY_DIR}/${xml_file}") - #MESSAGE (STATUS " Translating ${xml_file}") + #MESSAGE (STATUS " Copying ${xml_file}") ADD_CUSTOM_COMMAND ( TARGET h5dump POST_BUILD - COMMAND ${XLATE_UTILITY} - ARGS ${HDF5_TOOLS_SRC_DIR}/testfiles/${xml_file} ${xmldest} -l3 + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different ${HDF5_TOOLS_SRC_DIR}/testfiles/${xml_file} ${xmldest} ) ENDFOREACH (xml_file ${HDF5_XML_REFERENCE_FILES}) @@ -395,12 +413,112 @@ IF (BUILD_TESTING) ) ENDIF (WIN32 AND NOT CYGWIN) + # -------------------------------------------------------------------- + # Packed Bits + # -------------------------------------------------------------------- + #-- Copy all the HDF5 files from the test directory into the source directory + SET (HDF5_REFERENCE_PBITS + tnofilename-with-packed-bits.ddl + tpbitsArray.ddl + tpbitsCompound.ddl + tpbitsIncomplete.ddl + tpbitsLengthExceeded.ddl + tpbitsCharLengthExceeded.ddl + tpbitsIntLengthExceeded.ddl + tpbitsLongLengthExceeded.ddl + tpbitsLengthPositive.ddl + tpbitsMax.ddl + tpbitsMaxExceeded.ddl + tpbitsOffsetExceeded.ddl + tpbitsCharOffsetExceeded.ddl + tpbitsIntOffsetExceeded.ddl + tpbitsLongOffsetExceeded.ddl + tpbitsOffsetNegative.ddl + tpbitsOverlapped.ddl + tpbitsSigned.ddl + tpbitsUnsigned.ddl + tpbitsSignedInt.ddl + tpbitsUnsignedInt.ddl + tpbitsSignedLong.ddl + tpbitsUnsignedLong.ddl + tpbitsSignedLongLong.ddl + tpbitsUnsignedLongLong.ddl + tpbitsSignedWhole.ddl + tpbitsUnsignedWhole.ddl + tpbitsSignedIntWhole.ddl + tpbitsUnsignedIntWhole.ddl + tpbitsSignedLongWhole.ddl + tpbitsUnsignedLongWhole.ddl + tpbitsSignedLongLongWhole.ddl + tpbitsUnsignedLongLongWhole.ddl + tpbitsSignedLongLongWhole1.ddl + tpbitsUnsignedLongLongWhole1.ddl + tpbitsSignedLongLongWhole63.ddl + tpbitsUnsignedLongLongWhole63.ddl + tpbitsSigned4.ddl + tpbitsUnsigned4.ddl + tpbitsSignedInt8.ddl + tpbitsUnsignedInt8.ddl + tpbitsSignedLong16.ddl + tpbitsUnsignedLong16.ddl + tpbitsSignedLongLong32.ddl + tpbitsUnsignedLongLong32.ddl + tpbitsSigned2.ddl + tpbitsUnsigned2.ddl + tpbitsSignedInt4.ddl + tpbitsUnsignedInt4.ddl + tpbitsSignedLong8.ddl + tpbitsUnsignedLong8.ddl + tpbitsSignedLongLong16.ddl + tpbitsUnsignedLongLong16.ddl + ) + + FOREACH (ddl_pbits ${HDF5_REFERENCE_PBITS}) + SET (ddldest "${PROJECT_BINARY_DIR}/${ddl_pbits}") + #MESSAGE (STATUS " Translating ${ddl_pbits}") + ADD_CUSTOM_COMMAND ( + TARGET h5dump + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different ${HDF5_TOOLS_SRC_DIR}/testfiles/${ddl_pbits} ${ddldest} + ) + ENDFOREACH (ddl_pbits ${HDF5_REFERENCE_PBITS}) + ############################################################################## ############################################################################## ### T H E T E S T S M A C R O S ### ############################################################################## ############################################################################## + MACRO (ADD_HELP_TEST testname resultcode) + # If using memchecker add tests without using scripts + IF (HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST (NAME H5DUMP-${testname} COMMAND $ ${ARGN}) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5DUMP-${testname} PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + SET (last_test "H5DUMP-${testname}") + ELSE (HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST ( + NAME H5DUMP-clear-h5dump-${testname}-objects + COMMAND ${CMAKE_COMMAND} + -E remove h5dump-${testname}.out h5dump-${testname}.out.err + ) + ADD_TEST ( + NAME H5DUMP-h5dump-${testname} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=${ARGN}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_OUTPUT=h5dump-${testname}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=h5dump-${testname}.txt" + -P "${HDF5_RESOURCES_DIR}/runTest.cmake" + ) + SET_TESTS_PROPERTIES (H5DUMP-h5dump-${testname} PROPERTIES DEPENDS "H5DUMP-clear-h5dump-${testname}-objects") + ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + ENDMACRO (ADD_HELP_TEST) + MACRO (ADD_SKIP_H5_TEST skipresultfile skipresultcode testtype) IF (${testtype} STREQUAL "SKIP") IF (NOT HDF5_ENABLE_USING_MEMCHECKER) @@ -421,8 +539,17 @@ IF (BUILD_TESTING) IF (NOT ${resultcode} STREQUAL "0") SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true") ENDIF (NOT ${resultcode} STREQUAL "0") + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + SET (last_test "H5DUMP-${resultfile}") ELSE (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( + NAME H5DUMP-clear-${resultfile}-objects + COMMAND ${CMAKE_COMMAND} + -E remove ${resultfile}.out ${resultfile}.out.err + ) + ADD_TEST ( NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" @@ -433,17 +560,14 @@ IF (BUILD_TESTING) -D "TEST_REFERENCE=${resultfile}.ddl" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) + SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-clear-${resultfile}-objects") ENDIF (HDF5_ENABLE_USING_MEMCHECKER) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5DUMP-${resultfile}") ENDMACRO (ADD_H5_TEST file) MACRO (ADD_H5_EXPORT_TEST resultfile targetfile resultcode) ADD_TEST ( NAME H5DUMP-output-${resultfile} - COMMAND $ -d /Dataset1 -s 0 -R -y -o ${PROJECT_BINARY_DIR}/${resultfile}.txt ${PROJECT_BINARY_DIR}/${targetfile} + COMMAND $ ${ARGN} ${PROJECT_BINARY_DIR}/${resultfile}.txt ${PROJECT_BINARY_DIR}/${targetfile} ) IF (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5DUMP-output-${resultfile} PROPERTIES DEPENDS ${last_test}) @@ -465,6 +589,11 @@ IF (BUILD_TESTING) MACRO (ADD_H5_MASK_TEST resultfile resultcode) IF (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( + NAME H5DUMP-clear-${resultfile}-objects + COMMAND ${CMAKE_COMMAND} + -E remove ${resultfile}.out ${resultfile}.out.err + ) + ADD_TEST ( NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" @@ -476,10 +605,7 @@ IF (BUILD_TESTING) -D "TEST_MASK_ERROR=true" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5DUMP-${resultfile}") + SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-clear-${resultfile}-objects") ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_MASK_TEST file) @@ -502,8 +628,17 @@ IF (BUILD_TESTING) IF (NOT ${resultcode} STREQUAL "0") SET_TESTS_PROPERTIES (H5DUMP-XML-${resultfile} PROPERTIES WILL_FAIL "true") ENDIF (NOT ${resultcode} STREQUAL "0") + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5DUMP-XML-${resultfile} PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + SET (last_test "H5DUMP-XML-${resultfile}") ELSE (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( + NAME H5DUMP-XML-clear-${resultfile}-objects + COMMAND ${CMAKE_COMMAND} + -E remove ${resultfile}.out ${resultfile}.out.err + ) + ADD_TEST ( NAME H5DUMP-XML-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" @@ -514,11 +649,8 @@ IF (BUILD_TESTING) -D "TEST_REFERENCE=${resultfile}.xml" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) + SET_TESTS_PROPERTIES (H5DUMP-XML-${resultfile} PROPERTIES DEPENDS "H5DUMP-XML-clear-${resultfile}-objects") ENDIF (HDF5_ENABLE_USING_MEMCHECKER) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DUMP-XML-${resultfile} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5DUMP-XML-${resultfile}") ENDMACRO (ADD_XML_H5_TEST file) # -------------------------------------------------------------------- @@ -531,22 +663,21 @@ IF (BUILD_TESTING) SET (USE_FILTER_NBIT H5_HAVE_FILTER_NBIT) SET (USE_FILTER_SCALEOFFSET H5_HAVE_FILTER_SCALEOFFSET) - # -------------------------------------------------------------------- - # Determine if H5dump packed bits feature is included - # -------------------------------------------------------------------- - SET (USE_PACKED_BITS HDF5_USE_H5DUMP_PACKED_BITS) - ############################################################################## ############################################################################## ### T H E T E S T S ### ############################################################################## ############################################################################## - # Remove any output file left over from previous test run - ADD_TEST ( + IF (HDF5_ENABLE_USING_MEMCHECKER) + # Remove any output file left over from previous test run + ADD_TEST ( NAME H5DUMP-clearall-objects COMMAND ${CMAKE_COMMAND} -E remove + h5dump-help.out + file_space.out + file_space.out.err filter_fail.out filter_fail.out.err packedbits.out @@ -593,6 +724,8 @@ IF (BUILD_TESTING) tattr-2.out.err tattr-3.out tattr-3.out.err + tattr-4_be.out + tattr-4_be.out.err tattrreg.out tattrreg.out.err tattrregR.out @@ -701,16 +834,24 @@ IF (BUILD_TESTING) tloop-1.out.err tmulti.out tmulti.out.err + tmultifile.out + tmultifile.out.err +# tqmarkfile.out +# tqmarkfile.out.err +# tstarfile.out +# tstarfile.out.err tnamed_dtype_attr.out tnamed_dtype_attr.out.err tnestcomp-1.out tnestcomp-1.out.err tnbit.out tnbit.out.err - tnofilename.out - tnofilename.out.err + tno-subset.out + tno-subset.out.err tnullspace.out tnullspace.out.err + zerodim.out + zerodim.out.err tordergr1.out tordergr1.out.err tordergr2.out @@ -743,6 +884,8 @@ IF (BUILD_TESTING) tslink-1.out.err tslink-2.out tslink-2.out.err + tslink-D.out + tslink-D.out.err tsplit_file.out tsplit_file.out.err tstr-1.out @@ -777,184 +920,202 @@ IF (BUILD_TESTING) tvlstr.out.err tvms.out tvms.out.err - ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DUMP-clearall-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5DUMP-clearall-objects") + ) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5DUMP-clearall-objects PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + SET (last_test "H5DUMP-clearall-objects") + ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + + ADD_HELP_TEST(help 0 -h) # test for signed/unsigned datasets - ADD_H5_TEST (packedbits 0 packedbits.h5) + ADD_H5_TEST (packedbits 0 --enable-error-stack packedbits.h5) # test for displaying groups - ADD_H5_TEST (tgroup-1 0 tgroup.h5) + ADD_H5_TEST (tgroup-1 0 --enable-error-stack tgroup.h5) # test for displaying the selected groups + # JIRA HDFFV-7936 ADD_H5_MASK_TEST (tgroup-2 1 --enable-error-stack --group=/g2 --group / -g /y tgroup.h5) + # cannot use TEST_MASK_ERROR and --enable-error-stack on this test because group names are similar to version numbers ADD_H5_TEST (tgroup-2 1 --group=/g2 --group / -g /y tgroup.h5) # test for displaying simple space datasets - ADD_H5_TEST (tdset-1 0 tdset.h5) + ADD_H5_TEST (tdset-1 0 --enable-error-stack tdset.h5) # test for displaying selected datasets - ADD_H5_TEST (tdset-2 1 -H -d dset1 -d /dset2 --dataset=dset3 tdset.h5) + ADD_H5_MASK_TEST (tdset-2 1 --enable-error-stack -H -d dset1 -d /dset2 --dataset=dset3 tdset.h5) # test for displaying attributes - ADD_H5_TEST (tattr-1 0 tattr.h5) + ADD_H5_TEST (tattr-1 0 --enable-error-stack tattr.h5) # test for displaying the selected attributes of string type and scalar space - ADD_H5_TEST (tattr-2 0 -a /attr1 --attribute /attr4 --attribute=/attr5 tattr.h5) + ADD_H5_TEST (tattr-2 0 --enable-error-stack -a /\\\\/attr1 --attribute /attr4 --attribute=/attr5 tattr.h5) # test for header and error messages - ADD_H5_TEST (tattr-3 1 --header -a /attr2 --attribute=/attr tattr.h5) + ADD_H5_MASK_TEST (tattr-3 1 --enable-error-stack --header -a /attr2 --attribute=/attr tattr.h5) # test for displaying attributes in shared datatype (also in group and dataset) - ADD_H5_TEST (tnamed_dtype_attr 0 tnamed_dtype_attr.h5) + ADD_H5_TEST (tnamed_dtype_attr 0 --enable-error-stack tnamed_dtype_attr.h5) + # test for displaying at least 9 attributes on root from a be machine + ADD_H5_TEST (tattr-4_be 0 --enable-error-stack tattr4_be.h5) # test for displaying soft links and user-defined links - ADD_H5_TEST (tslink-1 0 tslink.h5) - ADD_H5_TEST (tudlink-1 0 tudlink.h5) + ADD_H5_TEST (tslink-1 0 --enable-error-stack tslink.h5) + ADD_H5_TEST (tudlink-1 0 --enable-error-stack tudlink.h5) # test for displaying the selected link - ADD_H5_TEST (tslink-2 0 -l slink2 tslink.h5) - ADD_H5_TEST (tudlink-2 0 -l udlink2 tudlink.h5) + ADD_H5_TEST (tslink-2 0 --enable-error-stack -l slink2 tslink.h5) + ADD_H5_TEST (tudlink-2 0 --enable-error-stack -l udlink2 tudlink.h5) + # test for displaying dangling soft links + ADD_H5_MASK_TEST (tslink-D 0 --enable-error-stack -d /slink1 tslink.h5) # tests for hard links - ADD_H5_TEST (thlink-1 0 thlink.h5) - ADD_H5_TEST (thlink-2 0 -d /g1/dset2 --dataset /dset1 --dataset=/g1/g1.1/dset3 thlink.h5) - ADD_H5_TEST (thlink-3 0 -d /g1/g1.1/dset3 --dataset /g1/dset2 --dataset=/dset1 thlink.h5) - ADD_H5_TEST (thlink-4 0 -g /g1 thlink.h5) - ADD_H5_TEST (thlink-5 0 -d /dset1 -g /g2 -d /g1/dset2 thlink.h5) + ADD_H5_TEST (thlink-1 0 --enable-error-stack thlink.h5) + ADD_H5_TEST (thlink-2 0 --enable-error-stack -d /g1/dset2 --dataset /dset1 --dataset=/g1/g1.1/dset3 thlink.h5) + ADD_H5_TEST (thlink-3 0 --enable-error-stack -d /g1/g1.1/dset3 --dataset /g1/dset2 --dataset=/dset1 thlink.h5) + ADD_H5_TEST (thlink-4 0 --enable-error-stack -g /g1 thlink.h5) + ADD_H5_TEST (thlink-5 0 --enable-error-stack -d /dset1 -g /g2 -d /g1/dset2 thlink.h5) # tests for compound data types - ADD_H5_TEST (tcomp-1 0 tcompound.h5) + ADD_H5_TEST (tcomp-1 0 --enable-error-stack tcompound.h5) # test for named data types - ADD_H5_TEST (tcomp-2 0 -t /type1 --datatype /type2 --datatype=/group1/type3 tcompound.h5) + ADD_H5_TEST (tcomp-2 0 --enable-error-stack -t /type1 --datatype /type2 --datatype=/group1/type3 tcompound.h5) # test for unamed type - #ADD_H5_TEST (tcomp-3 0 -t /#6632 -g /group2 tcompound.h5) + # JIRA HDFFV-7936 ADD_H5_TEST (tcomp-3 0 "--enable-error-stack;-t;/#6632;-g;/group2;tcompound.h5") + ADD_H5_TEST (tcomp-3 0 "-t;/#6632;-g;/group2;tcompound.h5") # test complicated compound datatype - ADD_H5_TEST (tcomp-4 0 tcompound_complex.h5) + ADD_H5_TEST (tcomp-4 0 --enable-error-stack tcompound_complex.h5) #test for the nested compound type - ADD_H5_TEST (tnestcomp-1 0 tnestedcomp.h5) + ADD_H5_TEST (tnestcomp-1 0 --enable-error-stack tnestedcomp.h5) # test for options + # JIRA HDFFV-7936 ADD_H5_MASK_TEST (tall-1 0 --enable-error-stack tall.h5) + # cannot use TEST_MASK_ERROR and --enable-error-stack on this test because group/dataset names are similar to version numbers ADD_H5_TEST (tall-1 0 tall.h5) - ADD_H5_TEST (tall-2 0 --header -g /g1/g1.1 -a attr2 tall.h5) - ADD_H5_TEST (tall-3 0 -d /g2/dset2.1 -l /g1/g1.2/g1.2.1/slink tall.h5) + ADD_H5_TEST (tall-2 0 --enable-error-stack --header -g /g1/g1.1 -a attr2 tall.h5) + ADD_H5_TEST (tall-3 0 --enable-error-stack -d /g2/dset2.1 -l /g1/g1.2/g1.2.1/slink tall.h5) # test for loop detection - ADD_H5_TEST (tloop-1 0 tloop.h5) + ADD_H5_TEST (tloop-1 0 --enable-error-stack tloop.h5) # test for string - ADD_H5_TEST (tstr-1 0 tstr.h5) - ADD_H5_TEST (tstr-2 0 tstr2.h5) + ADD_H5_TEST (tstr-1 0 --enable-error-stack tstr.h5) + ADD_H5_TEST (tstr-2 0 --enable-error-stack tstr2.h5) # test for file created by Lib SAF team - ADD_H5_TEST (tsaf 0 tsaf.h5) + ADD_H5_TEST (tsaf 0 --enable-error-stack tsaf.h5) # test for file with variable length data - ADD_H5_TEST (tvldtypes1 0 tvldtypes1.h5) - ADD_H5_TEST (tvldtypes2 0 tvldtypes2.h5) - ADD_H5_TEST (tvldtypes3 0 tvldtypes3.h5) - ADD_H5_TEST (tvldtypes4 0 tvldtypes4.h5) - ADD_H5_TEST (tvldtypes5 0 tvldtypes5.h5) + ADD_H5_TEST (tvldtypes1 0 --enable-error-stack tvldtypes1.h5) + ADD_H5_TEST (tvldtypes2 0 --enable-error-stack tvldtypes2.h5) + ADD_H5_TEST (tvldtypes3 0 --enable-error-stack tvldtypes3.h5) + ADD_H5_TEST (tvldtypes4 0 --enable-error-stack tvldtypes4.h5) + ADD_H5_TEST (tvldtypes5 0 --enable-error-stack tvldtypes5.h5) #test for file with variable length string data - ADD_H5_TEST (tvlstr 0 tvlstr.h5) + ADD_H5_TEST (tvlstr 0 --enable-error-stack tvlstr.h5) # test for files with array data - ADD_H5_TEST (tarray1 0 tarray1.h5) + ADD_H5_TEST (tarray1 0 --enable-error-stack tarray1.h5) # # added for bug# 2092 - tarray1_big.h5 + # JIRA HDFFV-7936 ADD_H5_TEST (tarray1_big 0 --enable-error-stack -R tarray1_big.h5) ADD_H5_TEST (tarray1_big 0 -R tarray1_big.h5) - ADD_H5_TEST (tarray2 0 tarray2.h5) - ADD_H5_TEST (tarray3 0 tarray3.h5) - ADD_H5_TEST (tarray4 0 tarray4.h5) - ADD_H5_TEST (tarray5 0 tarray5.h5) - ADD_H5_TEST (tarray6 0 tarray6.h5) - ADD_H5_TEST (tarray7 0 tarray7.h5) - ADD_H5_TEST (tarray8 0 tarray8.h5) - + ADD_H5_TEST (tarray2 0 --enable-error-stack tarray2.h5) + ADD_H5_TEST (tarray3 0 --enable-error-stack tarray3.h5) + ADD_H5_TEST (tarray4 0 --enable-error-stack tarray4.h5) + ADD_H5_TEST (tarray5 0 --enable-error-stack tarray5.h5) + ADD_H5_TEST (tarray6 0 --enable-error-stack tarray6.h5) + ADD_H5_TEST (tarray7 0 --enable-error-stack tarray7.h5) + ADD_H5_TEST (tarray8 0 --enable-error-stack tarray8.h5) + + # test for wildcards in filename (does not work with cmake) + #ADD_H5_MASK_TEST (tstarfile 0 --enable-error-stack -H -d Dataset1 tarr*.h5) + #ADD_H5_MASK_TEST (tqmarkfile 0 --enable-error-stack -H -d Dataset1 tarray?.h5) + ADD_H5_TEST (tmultifile 0 --enable-error-stack -H -d Dataset1 tarray2.h5 tarray3.h5 tarray4.h5 tarray5.h5 tarray6.h5 tarray7.h5) + # test for files with empty data - ADD_H5_TEST (tempty 0 tempty.h5) + ADD_H5_TEST (tempty 0 --enable-error-stack tempty.h5) # test for files with groups that have comments - ADD_H5_TEST (tgrp_comments 0 tgrp_comments.h5) + ADD_H5_TEST (tgrp_comments 0 --enable-error-stack tgrp_comments.h5) # test the --filedriver flag - ADD_H5_TEST (tsplit_file 0 --filedriver=split tsplit_file) - ADD_H5_TEST (tfamily 0 --filedriver=family tfamily%05d.h5) - ADD_H5_TEST (tmulti 0 --filedriver=multi tmulti) + ADD_H5_TEST (tsplit_file 0 --enable-error-stack --filedriver=split tsplit_file) + ADD_H5_TEST (tfamily 0 --enable-error-stack --filedriver=family tfamily%05d.h5) + ADD_H5_TEST (tmulti 0 --enable-error-stack --filedriver=multi tmulti) # test for files with group names which reach > 1024 bytes in size - ADD_H5_TEST (tlarge_objname 0 -w157 tlarge_objname.h5) + ADD_H5_TEST (tlarge_objname 0 --enable-error-stack -w157 tlarge_objname.h5) # test '-A' to suppress data but print attr's + # JIRA HDFFV-7936 ADD_H5_MASK_TEST (tall-2A 0 --enable-error-stack -A tall.h5) + # cannot use TEST_MASK_ERROR and --enable-error-stack on this test because group/dataset names are similar to version numbers ADD_H5_TEST (tall-2A 0 -A tall.h5) # test '-r' to print attributes in ASCII instead of decimal + # JIRA HDFFV-7936 ADD_H5_TEST (tall-2B 0 --enable-error-stack -A -r tall.h5) ADD_H5_TEST (tall-2B 0 -A -r tall.h5) # test Subsetting - ADD_H5_TEST (tall-4s 0 --dataset=/g1/g1.1/dset1.1.1 --start=1,1 --stride=2,3 --count=3,2 --block=1,1 tall.h5) - ADD_H5_TEST (tall-5s 0 -d "/g1/g1.1/dset1.1.2[0;2;10;]" tall.h5) - ADD_H5_TEST (tdset-3s 0 -d "/dset1[1,1;;;]" tdset.h5) + ADD_H5_TEST (tall-4s 0 --enable-error-stack --dataset=/g1/g1.1/dset1.1.1 --start=1,1 --stride=2,3 --count=3,2 --block=1,1 tall.h5) + ADD_H5_TEST (tall-5s 0 --enable-error-stack -d "/g1/g1.1/dset1.1.2[0;2;10;]" tall.h5) + ADD_H5_TEST (tdset-3s 0 --enable-error-stack -d "/dset1[1,1;;;]" tdset.h5) + ADD_H5_TEST (tno-subset 0 --enable-error-stack --no-compact-subset -d "AHFINDERDIRECT::ah_centroid_t[0] it=0 tl=0" tno-subset.h5) # test printing characters in ASCII instead of decimal - ADD_H5_TEST (tchar1 0 -r tchar.h5) - - # test failure handling - # Missing file name - ADD_H5_TEST (tnofilename 1) + ADD_H5_TEST (tchar1 0 --enable-error-stack -r tchar.h5) # rev. 2004 - # tests for super block - ADD_H5_TEST (tboot1 0 -H -B -d dset tfcontents1.h5) - ADD_H5_TEST (tboot2 0 -B tfcontents2.h5) + ADD_H5_TEST (tboot1 0 --enable-error-stack -H -B -d dset tfcontents1.h5) + ADD_H5_TEST (tboot2 0 --enable-error-stack -B tfcontents2.h5) + ADD_H5_TEST (file_space 0 --enable-error-stack -B file_space.h5) # test -p with a non existing dataset - ADD_H5_TEST (tperror 1 -p -d bogus tfcontents1.h5) + ADD_H5_MASK_TEST (tperror 1 --enable-error-stack -p -d bogus tfcontents1.h5) # test for file contents - ADD_H5_TEST (tcontents 0 -n tfcontents1.h5) + ADD_H5_TEST (tcontents 0 --enable-error-stack -n tfcontents1.h5) # tests for storage layout # compact - ADD_H5_TEST (tcompact 0 -H -p -d compact tfilters.h5) + ADD_H5_TEST (tcompact 0 --enable-error-stack -H -p -d compact tfilters.h5) # contiguous - ADD_H5_TEST (tcontiguos 0 -H -p -d contiguous tfilters.h5) + ADD_H5_TEST (tcontiguos 0 --enable-error-stack -H -p -d contiguous tfilters.h5) # chunked - ADD_H5_TEST (tchunked 0 -H -p -d chunked tfilters.h5) + ADD_H5_TEST (tchunked 0 --enable-error-stack -H -p -d chunked tfilters.h5) # external - ADD_H5_TEST (texternal 0 -H -p -d external tfilters.h5) + ADD_H5_TEST (texternal 0 --enable-error-stack -H -p -d external tfilters.h5) # fill values - ADD_H5_TEST (tfill 0 -p tfvalues.h5) + ADD_H5_TEST (tfill 0 --enable-error-stack -p tfvalues.h5) # several datatype, with references , print path - ADD_H5_TEST (treference 0 tattr2.h5) + ADD_H5_TEST (treference 0 --enable-error-stack tattr2.h5) # escape/not escape non printable characters - ADD_H5_TEST (tstringe 0 -e tstr3.h5) - ADD_H5_TEST (tstring 0 tstr3.h5) + ADD_H5_TEST (tstringe 0 --enable-error-stack -e tstr3.h5) + ADD_H5_TEST (tstring 0 --enable-error-stack tstr3.h5) # char data as ASCII with non escape - ADD_H5_TEST (tstring2 0 -r -d str4 tstr3.h5) + ADD_H5_TEST (tstring2 0 --enable-error-stack -r -d str4 tstr3.h5) # array indices print/not print - ADD_H5_TEST (tindicesyes 0 taindices.h5) - ADD_H5_TEST (tindicesno 0 -y taindices.h5) + ADD_H5_TEST (tindicesyes 0 --enable-error-stack taindices.h5) + ADD_H5_TEST (tindicesno 0 --enable-error-stack -y taindices.h5) ########## array indices with subsetting # 1D case - ADD_H5_TEST (tindicessub1 0 -d 1d -s 1 -S 10 -c 2 -k 3 taindices.h5) + ADD_H5_TEST (tindicessub1 0 --enable-error-stack -d 1d -s 1 -S 10 -c 2 -k 3 taindices.h5) # 2D case - ADD_H5_TEST (tindicessub2 0 -d 2d -s 1,2 -S 3,3 -c 3,2 -k 2,2 taindices.h5) + ADD_H5_TEST (tindicessub2 0 --enable-error-stack -d 2d -s 1,2 -S 3,3 -c 3,2 -k 2,2 taindices.h5) # 3D case - ADD_H5_TEST (tindicessub3 0 -d 3d -s 0,1,2 -S 1,3,3 -c 2,2,2 -k 1,2,2 taindices.h5) + ADD_H5_TEST (tindicessub3 0 --enable-error-stack -d 3d -s 0,1,2 -S 1,3,3 -c 2,2,2 -k 1,2,2 taindices.h5) # 4D case - ADD_H5_TEST (tindicessub4 0 -d 4d -s 0,0,1,2 -c 2,2,3,2 -S 1,1,3,3 -k 1,1,2,2 taindices.h5) + ADD_H5_TEST (tindicessub4 0 --enable-error-stack -d 4d -s 0,0,1,2 -c 2,2,3,2 -S 1,1,3,3 -k 1,1,2,2 taindices.h5) # Exceed the dimensions for subsetting - ADD_H5_TEST (texceedsubstart 1 -d 1d -s 1,3 taindices.h5) - ADD_H5_TEST (texceedsubcount 1 -d 1d -c 1,3 taindices.h5) - ADD_H5_TEST (texceedsubstride 1 -d 1d -S 1,3 taindices.h5) - ADD_H5_TEST (texceedsubblock 1 -d 1d -k 1,3 taindices.h5) + ADD_H5_TEST (texceedsubstart 1 --enable-error-stack -d 1d -s 1,3 taindices.h5) + ADD_H5_TEST (texceedsubcount 1 --enable-error-stack -d 1d -c 1,3 taindices.h5) + ADD_H5_TEST (texceedsubstride 1 --enable-error-stack -d 1d -S 1,3 taindices.h5) + ADD_H5_TEST (texceedsubblock 1 --enable-error-stack -d 1d -k 1,3 taindices.h5) # tests for filters # SZIP @@ -962,76 +1123,86 @@ IF (BUILD_TESTING) IF (NOT USE_FILTER_SZIP) SET (TESTTYPE "SKIP") ENDIF (NOT USE_FILTER_SZIP) - ADD_SKIP_H5_TEST (tszip 0 ${TESTTYPE} -H -p -d szip tfilters.h5) + ADD_SKIP_H5_TEST (tszip 0 ${TESTTYPE} --enable-error-stack -H -p -d szip tfilters.h5) # deflate SET (TESTTYPE "TEST") IF (NOT USE_FILTER_DEFLATE) SET (TESTTYPE "SKIP") ENDIF (NOT USE_FILTER_DEFLATE) - ADD_SKIP_H5_TEST (tdeflate 0 ${TESTTYPE} -H -p -d deflate tfilters.h5) + ADD_SKIP_H5_TEST (tdeflate 0 ${TESTTYPE} --enable-error-stack -H -p -d deflate tfilters.h5) # shuffle SET (TESTTYPE "TEST") IF (NOT USE_FILTER_SHUFFLE) SET (TESTTYPE "SKIP") ENDIF (NOT USE_FILTER_SHUFFLE) - ADD_SKIP_H5_TEST (tshuffle 0 ${TESTTYPE} -H -p -d shuffle tfilters.h5) + ADD_SKIP_H5_TEST (tshuffle 0 ${TESTTYPE} --enable-error-stack -H -p -d shuffle tfilters.h5) # fletcher32 SET (TESTTYPE "TEST") IF (NOT USE_FILTER_FLETCHER32) SET (TESTTYPE "SKIP") ENDIF (NOT USE_FILTER_FLETCHER32) - ADD_SKIP_H5_TEST (tfletcher32 0 ${TESTTYPE} -H -p -d fletcher32 tfilters.h5) + ADD_SKIP_H5_TEST (tfletcher32 0 ${TESTTYPE} --enable-error-stack -H -p -d fletcher32 tfilters.h5) # nbit SET (TESTTYPE "TEST") IF (NOT USE_FILTER_NBIT) SET (TESTTYPE "SKIP") ENDIF (NOT USE_FILTER_NBIT) - ADD_SKIP_H5_TEST (tnbit 0 ${TESTTYPE} -H -p -d nbit tfilters.h5) + ADD_SKIP_H5_TEST (tnbit 0 ${TESTTYPE} --enable-error-stack -H -p -d nbit tfilters.h5) # scaleoffset SET (TESTTYPE "TEST") IF (NOT USE_FILTER_SCALEOFFSET) SET (TESTTYPE "SKIP") ENDIF (NOT USE_FILTER_SCALEOFFSET) - ADD_SKIP_H5_TEST (tscaleoffset 0 ${TESTTYPE} -H -p -d scaleoffset tfilters.h5) + ADD_SKIP_H5_TEST (tscaleoffset 0 ${TESTTYPE} --enable-error-stack -H -p -d scaleoffset tfilters.h5) # all SET (TESTTYPE "TEST") IF (NOT USE_FILTER_SZIP OR NOT USE_FILTER_SHUFFLE OR NOT USE_FILTER_FLETCHER32 OR NOT USE_FILTER_DEFLATE OR NOT USE_FILTER_NBIT OR NOT USE_FILTER_SCALEOFFSET) SET (TESTTYPE "SKIP") ENDIF (NOT USE_FILTER_SZIP OR NOT USE_FILTER_SHUFFLE OR NOT USE_FILTER_FLETCHER32 OR NOT USE_FILTER_DEFLATE OR NOT USE_FILTER_NBIT OR NOT USE_FILTER_SCALEOFFSET) - ADD_SKIP_H5_TEST (tallfilters 0 ${TESTTYPE} -H -p -d all tfilters.h5) + ADD_SKIP_H5_TEST (tallfilters 0 ${TESTTYPE} --enable-error-stack -H -p -d all tfilters.h5) # user defined - ADD_H5_TEST (tuserfilter 0 -H -p -d myfilter tfilters.h5) + ADD_H5_TEST (tuserfilter 0 --enable-error-stack -H -p -d myfilter tfilters.h5) # test for displaying objects with very long names - ADD_H5_TEST (tlonglinks 0 tlonglinks.h5) + ADD_H5_TEST (tlonglinks 0 --enable-error-stack tlonglinks.h5) # dimensions over 4GB, print boundary - ADD_H5_TEST (tbigdims 0 -d dset4gb -s 4294967284 -c 22 tbigdims.h5) + ADD_H5_TEST (tbigdims 0 --enable-error-stack -d dset4gb -s 4294967284 -c 22 tbigdims.h5) # hyperslab read - ADD_H5_TEST (thyperslab 0 thyperslab.h5) + ADD_H5_TEST (thyperslab 0 --enable-error-stack thyperslab.h5) # test for displaying dataset and attribute of null space - ADD_H5_TEST (tnullspace 0 tnullspace.h5) + ADD_H5_TEST (tnullspace 0 --enable-error-stack tnullspace.h5) + + # test for displaying dataset and attribute of space with 0 dimension size + ADD_H5_TEST (zerodim 0 --enable-error-stack zerodim.h5) # test for long double (some systems do not have long double) - #ADD_H5_TEST (tldouble 0 tldouble.h5) + #ADD_H5_TEST (tldouble 0 --enable-error-stack tldouble.h5) # test for vms - ADD_H5_TEST (tvms 0 tvms.h5) + ADD_H5_TEST (tvms 0 --enable-error-stack tvms.h5) # test for binary output - ADD_H5_TEST (tbin1LE 0 -d integer -o out1LE.bin -b LE tbinary.h5) + ADD_H5_TEST (tbin1LE 0 --enable-error-stack -d integer -o out1LE.bin -b LE tbinary.h5) # NATIVE default. the NATIVE test can be validated with h5import/h5diff - ADD_H5_TEST (tbin1 0 -d integer -o out1.bin -b tbinary.h5) + ADD_H5_TEST (tbin1 0 --enable-error-stack -d integer -o out1.bin -b tbinary.h5) + IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5DUMP-tbin1 PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + SET (last_test "H5DUMP-tbin1") + ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST (NAME H5DUMP-clear-out1 COMMAND ${CMAKE_COMMAND} -E remove out1.h5) IF (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5DUMP-clear-out1 PROPERTIES DEPENDS ${last_test}) @@ -1042,10 +1213,23 @@ IF (BUILD_TESTING) SET_TESTS_PROPERTIES (H5DUMP-h5diff-out1 PROPERTIES DEPENDS H5DUMP-h5import-out1) SET (last_test "H5DUMP-h5diff-out1") - ADD_H5_TEST (tbin2 0 -b BE -d float -o out2.bin tbinary.h5) + ADD_H5_TEST (tbin2 0 --enable-error-stack -b BE -d float -o out2.bin tbinary.h5) + IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5DUMP-tbin2 PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + SET (last_test "H5DUMP-tbin2") + ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) # the NATIVE test can be validated with h5import/h5diff - ADD_H5_TEST (tbin3 0 -d integer -o out3.bin -b NATIVE tbinary.h5) + ADD_H5_TEST (tbin3 0 --enable-error-stack -d integer -o out3.bin -b NATIVE tbinary.h5) + IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5DUMP-tbin3 PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + SET (last_test "H5DUMP-tbin3") + ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST (NAME H5DUMP-clear-out3 COMMAND ${CMAKE_COMMAND} -E remove out3.h5) IF (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5DUMP-clear-out3 PROPERTIES DEPENDS ${last_test}) @@ -1056,7 +1240,13 @@ IF (BUILD_TESTING) SET_TESTS_PROPERTIES (H5DUMP-h5diff-out3 PROPERTIES DEPENDS H5DUMP-h5import-out3) SET (last_test "H5DUMP-h5diff-out3") - ADD_H5_TEST (tbin4 0 -d double -b FILE -o out4.bin tbinary.h5) + ADD_H5_TEST (tbin4 0 --enable-error-stack -d double -b FILE -o out4.bin tbinary.h5) + IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5DUMP-tbin4 PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + SET (last_test "H5DUMP-tbin4") + ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) # Clean up binary output files IF (NOT HDF5_NOCLEANUP) @@ -1079,64 +1269,248 @@ IF (BUILD_TESTING) SET (last_test "H5DUMP-clear-objects") # test for dataset region references - ADD_H5_TEST (tdatareg 0 tdatareg.h5) + ADD_H5_TEST (tdatareg 0 --enable-error-stack tdatareg.h5) + # JIRA HDFFV-7936 ADD_H5_TEST (tdataregR 0 --enable-error-stack -R tdatareg.h5) ADD_H5_TEST (tdataregR 0 -R tdatareg.h5) - ADD_H5_TEST (tattrreg 0 tattrreg.h5) + ADD_H5_TEST (tattrreg 0 --enable-error-stack tattrreg.h5) + # JIRA HDFFV-7936 ADD_H5_TEST (tattrregR 0 --enable-error-stack -R tattrreg.h5) ADD_H5_TEST (tattrregR 0 -R tattrreg.h5) - ADD_H5_EXPORT_TEST (tbinregR tdatareg.h5 0 -d /Dataset1 -s 0 -R -y -o) + ADD_H5_EXPORT_TEST (tbinregR tdatareg.h5 0 --enable-error-stack -d /Dataset1 -s 0 -R -y -o) # tests for group creation order # "1" tracked, "2" name, root tracked - ADD_H5_TEST (tordergr1 0 --group=1 --sort_by=creation_order --sort_order=ascending tordergr.h5) - ADD_H5_TEST (tordergr2 0 --group=1 --sort_by=creation_order --sort_order=descending tordergr.h5) - ADD_H5_TEST (tordergr3 0 -g 2 -q name -z ascending tordergr.h5) - ADD_H5_TEST (tordergr4 0 -g 2 -q name -z descending tordergr.h5) - ADD_H5_TEST (tordergr5 0 -q creation_order tordergr.h5) + ADD_H5_TEST (tordergr1 0 --enable-error-stack --group=1 --sort_by=creation_order --sort_order=ascending tordergr.h5) + ADD_H5_TEST (tordergr2 0 --enable-error-stack --group=1 --sort_by=creation_order --sort_order=descending tordergr.h5) + ADD_H5_TEST (tordergr3 0 --enable-error-stack -g 2 -q name -z ascending tordergr.h5) + ADD_H5_TEST (tordergr4 0 --enable-error-stack -g 2 -q name -z descending tordergr.h5) + ADD_H5_TEST (tordergr5 0 --enable-error-stack -q creation_order tordergr.h5) # tests for attribute order - ADD_H5_TEST (torderattr1 0 -H --sort_by=name --sort_order=ascending torderattr.h5) - ADD_H5_TEST (torderattr2 0 -H --sort_by=name --sort_order=descending torderattr.h5) - ADD_H5_TEST (torderattr3 0 -H --sort_by=creation_order --sort_order=ascending torderattr.h5) - ADD_H5_TEST (torderattr4 0 -H --sort_by=creation_order --sort_order=descending torderattr.h5) + ADD_H5_TEST (torderattr1 0 --enable-error-stack -H --sort_by=name --sort_order=ascending torderattr.h5) + ADD_H5_TEST (torderattr2 0 --enable-error-stack -H --sort_by=name --sort_order=descending torderattr.h5) + ADD_H5_TEST (torderattr3 0 --enable-error-stack -H --sort_by=creation_order --sort_order=ascending torderattr.h5) + ADD_H5_TEST (torderattr4 0 --enable-error-stack -H --sort_by=creation_order --sort_order=descending torderattr.h5) # tests for floating point user defined printf format - ADD_H5_TEST (tfpformat 0 -m %.7f tfpformat.h5) + ADD_H5_TEST (tfpformat 0 --enable-error-stack -m %.7f tfpformat.h5) # tests for traversal of external links + # JIRA HDFFV-7936 ADD_H5_TEST (textlinksrc 0 --enable-error-stack textlinksrc.h5) ADD_H5_TEST (textlinksrc 0 textlinksrc.h5) + # JIRA HDFFV-7936 ADD_H5_TEST (textlinkfar 0 --enable-error-stack textlinkfar.h5) ADD_H5_TEST (textlinkfar 0 textlinkfar.h5) # test for dangling external links - ADD_H5_TEST (textlink 0 textlink.h5) + ADD_H5_MASK_TEST (textlink 0 --enable-error-stack textlink.h5) # test for error stack display (BZ2048) ADD_H5_MASK_TEST (filter_fail 1 --enable-error-stack filter_fail.h5) # test for -o -y for dataset with attributes - ADD_H5_TEST (tall-6 0 -y -o data -d /g1/g1.1/dset1.1.1 tall.h5) + ADD_H5_TEST (tall-6 0 --enable-error-stack -y -o data -d /g1/g1.1/dset1.1.1 tall.h5) ####### test for dataset packed bits ###### - IF (HDF5_USE_H5DUMP_PACKED_BITS) + IF (HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run ADD_TEST ( - NAME H5DUMP_PACKED_BITS-clearall-objects - COMMAND ${CMAKE_COMMAND} - -E remove - tpackedbits.out - tpackedbits.out.err - tpackedbits2.out - tpackedbits2.out.err + NAME H5DUMP_PACKED_BITS-clearall-objects + COMMAND ${CMAKE_COMMAND} + -E remove + tnofilename-with-packed-bits.out + tnofilename-with-packed-bits.out.err + tpbitsArray.out + tpbitsArray.out.err + tpbitsCompound.out + tpbitsCompound.out.err + tpbitsIncomplete.out + tpbitsIncomplete.out.err + tpbitsLengthExceeded.out + tpbitsLengthExceeded.out.err + tpbitsCharLengthExceeded.out + tpbitsCharLengthExceeded.out.err + tpbitsIntLengthExceeded.out + tpbitsIntLengthExceeded.out.err + tpbitsLongLengthExceeded.out + tpbitsLongLengthExceeded.out.err + tpbitsLengthPositive.out + tpbitsLengthPositive.out.err + tpbitsMax.out + tpbitsMax.out.err + tpbitsMaxExceeded.out + tpbitsMaxExceeded.out.err + tpbitsOffsetExceeded.out + tpbitsOffsetExceeded.out.err + tpbitsCharOffsetExceeded.out + tpbitsCharOffsetExceeded.out.err + tpbitsIntOffsetExceeded.out + tpbitsIntOffsetExceeded.out.err + tpbitsLongOffsetExceeded.out + tpbitsLongOffsetExceeded.out.err + tpbitsOffsetNegative.out + tpbitsOffsetNegative.out.err + tpbitsOverlapped.out + tpbitsOverlapped.out.err + tpbitsSigned.out + tpbitsSigned.out.err + tpbitsUnsigned.out + tpbitsUnsigned.out.err + tpbitsSignedInt.out + tpbitsSignedInt.out.err + tpbitsUnsignedInt.out + tpbitsUnsignedInt.out.err + tpbitsSignedLong.out + tpbitsSignedLong.out.err + tpbitsUnsignedLong.out + tpbitsUnsignedLong.out.err + tpbitsSignedLongLong.out + tpbitsSignedLongLong.out.err + tpbitsUnsignedLongLong.out + tpbitsUnsignedLongLong.out.err + tpbitsSignedWhole.out + tpbitsSignedWhole.out.err + tpbitsUnsignedWhole.out + tpbitsUnsignedWhole.out.err + tpbitsSignedIntWhole.out + tpbitsSignedIntWhole.out.err + tpbitsUnsignedIntWhole.out + tpbitsUnsignedIntWhole.out.err + tpbitsSignedLongWhole.out + tpbitsSignedLongWhole.out.err + tpbitsUnsignedLongWhole.out + tpbitsUnsignedLongWhole.out.err + tpbitsSignedLongLongWhole.out + tpbitsSignedLongLongWhole.out.err + tpbitsUnsignedLongLongWhole.out + tpbitsUnsignedLongLongWhole.out.err + tpbitsSignedLongLongWhole1.out + tpbitsSignedLongLongWhole1.out.err + tpbitsUnsignedLongLongWhole1.out + tpbitsUnsignedLongLongWhole1.out.err + tpbitsSignedLongLongWhole63.out + tpbitsSignedLongLongWhole63.out.err + tpbitsUnsignedLongLongWhole63.out + tpbitsUnsignedLongLongWhole63.out.err + tpbitsSigned4.out + tpbitsSigned4.out.err + tpbitsUnsigned4.out + tpbitsUnsigned4.out.err + tpbitsSignedInt8.out + tpbitsSignedInt8.out.err + tpbitsUnsignedInt8.out + tpbitsUnsignedInt8.out.err + tpbitsSignedLong16.out + tpbitsSignedLong16.out.err + tpbitsUnsignedLong16.out + tpbitsUnsignedLong16.out.err + tpbitsSignedLongLong32.out + tpbitsSignedLongLong32.out.err + tpbitsUnsignedLongLong32.out + tpbitsUnsignedLongLong32.out.err + tpbitsSigned2.out + tpbitsSigned2.out.err + tpbitsUnsigned2.out + tpbitsUnsigned2.out.err + tpbitsSignedInt4.out + tpbitsSignedInt4.out.err + tpbitsUnsignedInt4.out + tpbitsUnsignedInt4.out.err + tpbitsSignedLong8.out + tpbitsSignedLong8.out.err + tpbitsUnsignedLong8.out + tpbitsUnsignedLong8.out.err + tpbitsSignedLongLong16.out + tpbitsSignedLongLong16.out.err + tpbitsUnsignedLongLong16.out + tpbitsUnsignedLongLong16.out.err ) IF (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5DUMP_PACKED_BITS-clearall-objects PROPERTIES DEPENDS ${last_test}) ENDIF (NOT "${last_test}" STREQUAL "") SET (last_test "H5DUMP_PACKED_BITS-clearall-objects") - ADD_H5_TEST (tpackedbits 0 -d /dset1 -M 0,2 tdset.h5) - ADD_H5_TEST (tpackedbits2 0 -d /dset1 -M 0,2,2,1 tdset.h5) - ENDIF (HDF5_USE_H5DUMP_PACKED_BITS) + ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + + # test failure handling + # Missing file name + ADD_H5_TEST (tnofilename-with-packed-bits 1 --enable-error-stack) + # Limits: + # Maximum number of packed bits is 8 (for now). + # Maximum integer size is 8*sizeof(long long). + # Maximun Offset is Maximum size - 1. + # Maximum Offset+Length is Maximum size. + # Tests: + # Normal operation on both signed and unsigned int datasets. + # Sanity check + # Their rawdata output should be the same. + ADD_H5_TEST (tpbitsSignedWhole 0 --enable-error-stack -d /DS08BITS -M 0,8 packedbits.h5) + ADD_H5_TEST (tpbitsUnsignedWhole 0 --enable-error-stack -d /DU08BITS -M 0,8 packedbits.h5) + ADD_H5_TEST (tpbitsSignedIntWhole 0 --enable-error-stack -d /DS16BITS -M 0,16 packedbits.h5) + ADD_H5_TEST (tpbitsUnsignedIntWhole 0 --enable-error-stack -d /DU16BITS -M 0,16 packedbits.h5) + ADD_H5_TEST (tpbitsSignedLongWhole 0 --enable-error-stack -d /DS32BITS -M 0,32 packedbits.h5) + ADD_H5_TEST (tpbitsUnsignedLongWhole 0 --enable-error-stack -d /DU32BITS -M 0,32 packedbits.h5) + ADD_H5_TEST (tpbitsSignedLongLongWhole 0 --enable-error-stack -d /DS64BITS -M 0,64 packedbits.h5) + ADD_H5_TEST (tpbitsUnsignedLongLongWhole 0 --enable-error-stack -d /DU64BITS -M 0,64 packedbits.h5) + ADD_H5_TEST (tpbitsSignedLongLongWhole63 0 --enable-error-stack -d /DS64BITS -M 0,63 packedbits.h5) + ADD_H5_TEST (tpbitsUnsignedLongLongWhole63 0 --enable-error-stack -d /DU64BITS -M 0,63 packedbits.h5) + ADD_H5_TEST (tpbitsSignedLongLongWhole1 0 --enable-error-stack -d /DS64BITS -M 1,63 packedbits.h5) + ADD_H5_TEST (tpbitsUnsignedLongLongWhole1 0 --enable-error-stack -d /DU64BITS -M 1,63 packedbits.h5) + # Half sections + ADD_H5_TEST (tpbitsSigned4 0 --enable-error-stack -d /DS08BITS -M 0,4,4,4 packedbits.h5) + ADD_H5_TEST (tpbitsUnsigned4 0 --enable-error-stack -d /DU08BITS -M 0,4,4,4 packedbits.h5) + ADD_H5_TEST (tpbitsSignedInt8 0 --enable-error-stack -d /DS16BITS -M 0,8,8,8 packedbits.h5) + ADD_H5_TEST (tpbitsUnsignedInt8 0 --enable-error-stack -d /DU16BITS -M 0,8,8,8 packedbits.h5) + ADD_H5_TEST (tpbitsSignedLong16 0 --enable-error-stack -d /DS32BITS -M 0,16,16,16 packedbits.h5) + ADD_H5_TEST (tpbitsUnsignedLong16 0 --enable-error-stack -d /DU32BITS -M 0,16,16,16 packedbits.h5) + ADD_H5_TEST (tpbitsSignedLongLong32 0 --enable-error-stack -d /DS64BITS -M 0,32,32,32 packedbits.h5) + ADD_H5_TEST (tpbitsUnsignedLongLong32 0 --enable-error-stack -d /DU64BITS -M 0,32,32,32 packedbits.h5) + # Quarter sections + ADD_H5_TEST (tpbitsSigned2 0 --enable-error-stack -d /DS08BITS -M 0,2,2,2,4,2,6,2 packedbits.h5) + ADD_H5_TEST (tpbitsUnsigned2 0 --enable-error-stack -d /DU08BITS -M 0,2,2,2,4,2,6,2 packedbits.h5) + ADD_H5_TEST (tpbitsSignedInt4 0 --enable-error-stack -d /DS16BITS -M 0,4,4,4,8,4,12,4 packedbits.h5) + ADD_H5_TEST (tpbitsUnsignedInt4 0 --enable-error-stack -d /DU16BITS -M 0,4,4,4,8,4,12,4 packedbits.h5) + ADD_H5_TEST (tpbitsSignedLong8 0 --enable-error-stack -d /DS32BITS -M 0,8,8,8,16,8,24,8 packedbits.h5) + ADD_H5_TEST (tpbitsUnsignedLong8 0 --enable-error-stack -d /DU32BITS -M 0,8,8,8,16,8,24,8 packedbits.h5) + ADD_H5_TEST (tpbitsSignedLongLong16 0 --enable-error-stack -d /DS64BITS -M 0,16,16,16,32,16,48,16 packedbits.h5) + ADD_H5_TEST (tpbitsUnsignedLongLong16 0 --enable-error-stack -d /DU64BITS -M 0,16,16,16,32,16,48,16 packedbits.h5) + # Begin and End + ADD_H5_TEST (tpbitsSigned 0 --enable-error-stack -d /DS08BITS -M 0,2,2,6 packedbits.h5) + ADD_H5_TEST (tpbitsUnsigned 0 --enable-error-stack -d /DU08BITS -M 0,2,2,6 packedbits.h5) + ADD_H5_TEST (tpbitsSignedInt 0 --enable-error-stack -d /DS16BITS -M 0,2,10,6 packedbits.h5) + ADD_H5_TEST (tpbitsUnsignedInt 0 --enable-error-stack -d /DU16BITS -M 0,2,10,6 packedbits.h5) + ADD_H5_TEST (tpbitsSignedLong 0 --enable-error-stack -d /DS32BITS -M 0,2,26,6 packedbits.h5) + ADD_H5_TEST (tpbitsUnsignedLong 0 --enable-error-stack -d /DU32BITS -M 0,2,26,6 packedbits.h5) + ADD_H5_TEST (tpbitsSignedLongLong 0 --enable-error-stack -d /DS64BITS -M 0,2,58,6 packedbits.h5) + ADD_H5_TEST (tpbitsUnsignedLongLong 0 --enable-error-stack -d /DU64BITS -M 0,2,58,6 packedbits.h5) + # Overlapped packed bits. + ADD_H5_TEST (tpbitsOverlapped 0 --enable-error-stack -d /DS08BITS -M 0,1,1,1,2,1,0,3 packedbits.h5) + # Maximum number of packed bits. + ADD_H5_TEST (tpbitsMax 0 --enable-error-stack -d /DS08BITS -M 0,1,1,1,2,1,3,1,4,1,5,1,6,1,7,1 packedbits.h5) + # Compound type. + ADD_H5_TEST (tpbitsCompound 0 --enable-error-stack -d /dset1 -M 0,1,1,1 tcompound.h5) + # Array type. + ADD_H5_TEST (tpbitsArray 0 --enable-error-stack -d /Dataset1 -M 0,1,1,1 tarray1.h5) + # Test Error handling. + # Too many packed bits requested. Max is 8 for now. + ADD_H5_TEST (tpbitsMaxExceeded 1 --enable-error-stack -d /DS08BITS -M 0,1,0,1,1,1,2,1,3,1,4,1,5,1,6,1,7,1 packedbits.h5) + # Offset too large. Max is 8*sizeof(long long. + ADD_H5_TEST (tpbitsOffsetExceeded 1 --enable-error-stack -d /DS08BITS -M 64,1 packedbits.h5) + ADD_H5_TEST (tpbitsCharOffsetExceeded 0 --enable-error-stack -d /DS08BITS -M 8,1 packedbits.h5) + ADD_H5_TEST (tpbitsIntOffsetExceeded 0 --enable-error-stack -d /DS16BITS -M 16,1 packedbits.h5) + ADD_H5_TEST (tpbitsLongOffsetExceeded 0 --enable-error-stack -d /DS32BITS -M 32,1 packedbits.h5) + # Bad offset, must not be negative. + ADD_H5_TEST (tpbitsOffsetNegative 1 --enable-error-stack -d /DS08BITS -M -1,1 packedbits.h5) + # Bad length, must not be positive. + ADD_H5_TEST (tpbitsLengthPositive 1 --enable-error-stack -d /DS08BITS -M 4,0 packedbits.h5) + # Offset+Length is too large. Max is 8*sizeof(long long). + ADD_H5_TEST (tpbitsLengthExceeded 1 --enable-error-stack -d /DS08BITS -M 37,28 packedbits.h5) + ADD_H5_TEST (tpbitsCharLengthExceeded 0 --enable-error-stack -d /DS08BITS -M 2,7 packedbits.h5) + ADD_H5_TEST (tpbitsIntLengthExceeded 0 --enable-error-stack -d /DS16BITS -M 10,7 packedbits.h5) + ADD_H5_TEST (tpbitsLongLengthExceeded 0 --enable-error-stack -d /DS32BITS -M 26,7 packedbits.h5) + # Incomplete pair of packed bits request. + ADD_H5_TEST (tpbitsIncomplete 1 --enable-error-stack -d /DS08BITS -M 0,2,2,1,0,2,2, packedbits.h5) - # Remove any output file left over from previous test run - ADD_TEST ( + IF (HDF5_ENABLE_USING_MEMCHECKER) + # Remove any output file left over from previous test run + ADD_TEST ( NAME H5DUMP-XML-clearall-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -1268,11 +1642,12 @@ IF (BUILD_TESTING) tvldtypes5.h5.out.err tvlstr.h5.out tvlstr.h5.out.err - ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DUMP-XML-clearall-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5DUMP-XML-clearall-objects") + ) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5DUMP-XML-clearall-objects PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + SET (last_test "H5DUMP-XML-clearall-objects") + ENDIF (HDF5_ENABLE_USING_MEMCHECKER) ########## test XML ADD_XML_H5_TEST (tall.h5 0 tall.h5) @@ -1327,6 +1702,8 @@ IF (BUILD_TESTING) ##Test dataset and attribute of null space. Commented out: ## wait until the XML schema is updated for null space. ## ADD_XML_H5_TEST (tnullspace.h5 0 tnulspace.h5) + ## So is dataspace with 0 dimension size. + ## ADD_XML_H5_TEST (zerodim.h5 0 zerodim.h5) # other options for xml diff --git a/tools/h5dump/Makefile.am b/tools/h5dump/Makefile.am index 81e38d1..97d81c2 100644 --- a/tools/h5dump/Makefile.am +++ b/tools/h5dump/Makefile.am @@ -40,6 +40,9 @@ h5dump_LDFLAGS = $(LT_STATIC_EXEC) $(AM_LDFLAGS) # All the programs depend on the hdf5 and h5tools libraries LDADD=$(LIBH5TOOLS) $(LIBHDF5) +# Source files for the program +h5dump_SOURCES=h5dump.c h5dump_ddl.c h5dump_xml.c + # Temporary files. *.h5 are generated by h5dumpgentest. They should # copied to the testfiles/ directory if update is required. CHECK_CLEANFILES+=*.h5 *.bin diff --git a/tools/h5dump/Makefile.in b/tools/h5dump/Makefile.in index 57e66a2..9d46557 100644 --- a/tools/h5dump/Makefile.in +++ b/tools/h5dump/Makefile.in @@ -77,8 +77,9 @@ binread_DEPENDENCIES = $(LIBH5TOOLS) $(LIBHDF5) AM_V_lt = $(am__v_lt_$(V)) am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) am__v_lt_0 = --silent -h5dump_SOURCES = h5dump.c -h5dump_OBJECTS = h5dump.$(OBJEXT) +am_h5dump_OBJECTS = h5dump.$(OBJEXT) h5dump_ddl.$(OBJEXT) \ + h5dump_xml.$(OBJEXT) +h5dump_OBJECTS = $(am_h5dump_OBJECTS) h5dump_LDADD = $(LDADD) h5dump_DEPENDENCIES = $(LIBH5TOOLS) $(LIBHDF5) h5dump_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ @@ -114,8 +115,8 @@ am__v_CCLD_0 = @echo " CCLD " $@; AM_V_GEN = $(am__v_GEN_$(V)) am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) am__v_GEN_0 = @echo " GEN " $@; -SOURCES = binread.c h5dump.c h5dumpgentest.c -DIST_SOURCES = binread.c h5dump.c h5dumpgentest.c +SOURCES = binread.c $(h5dump_SOURCES) h5dumpgentest.c +DIST_SOURCES = binread.c $(h5dump_SOURCES) h5dumpgentest.c ETAGS = etags CTAGS = ctags am__tty_colors = \ @@ -186,6 +187,7 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ +FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ @@ -206,10 +208,12 @@ H5_LONE_COLON = @H5_LONE_COLON@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ +HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ +HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ @@ -417,6 +421,9 @@ h5dump_LDFLAGS = $(LT_STATIC_EXEC) $(AM_LDFLAGS) # All the programs depend on the hdf5 and h5tools libraries LDADD = $(LIBH5TOOLS) $(LIBHDF5) + +# Source files for the program +h5dump_SOURCES = h5dump.c h5dump_ddl.c h5dump_xml.c DISTCLEANFILES = testh5dump.sh # Automake needs to be taught how to build lib, progs, and tests targets. @@ -542,6 +549,8 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/binread.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/h5dump.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/h5dump_ddl.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/h5dump_xml.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/h5dumpgentest.Po@am__quote@ .c.o: diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c index a6f5510..650846a 100644 --- a/tools/h5dump/h5dump.c +++ b/tools/h5dump/h5dump.c @@ -16,365 +16,46 @@ #include #include "h5dump.h" -#include "H5private.h" -#include "h5tools.h" -#include "h5tools_utils.h" -#include "h5tools_ref.h" -#include "h5trav.h" +#include "h5dump_ddl.h" +#include "h5dump_xml.h" /* Name of tool */ #define PROGRAMNAME "h5dump" -/* Macros for displaying objects */ -#define begin_obj(obj,name,begin) \ - do { \ - if (name) \ - printf("%s \"%s\" %s\n", (obj), (name), (begin)); \ - else \ - printf("%s %s\n", (obj), (begin)); \ - } while(0); - -#define end_obj(obj,end) \ - do { \ - if(HDstrlen(end)) { \ - printf("%s", end); \ - if(HDstrlen(obj)) \ - printf(" "); \ - } \ - if(HDstrlen(obj)) \ - printf("%s", obj); \ - printf("\n"); \ - } while(0); - -/* 3 private values: can't be set, but can be read. - Note: these are defined in H5Zprivate, they are - duplicated here. - */ -#define H5_SZIP_LSB_OPTION_MASK 8 -#define H5_SZIP_MSB_OPTION_MASK 16 -#define H5_SZIP_RAW_OPTION_MASK 128 - -/* List of table structures. There is one table structure for each file */ -typedef struct h5dump_table_list_t { - size_t nalloc; - size_t nused; - struct { - unsigned long fileno; /* File number that these tables refer to */ - hid_t oid; /* ID of an object in this file, held open so fileno is consistent */ - table_t *group_table; /* Table of groups */ - table_t *dset_table; /* Table of datasets */ - table_t *type_table; /* Table of datatypes */ - } *tables; -} h5dump_table_list_t; - -static int unamedtype = 0; /* shared datatype with no name */ -static h5dump_table_list_t table_list = {0, 0, NULL}; -static table_t *group_table = NULL, *dset_table = NULL, *type_table = NULL; -static hbool_t hit_elink = FALSE; /* whether we have traversed an external link */ -static size_t prefix_len = 1024; -static char *prefix; static const char *driver = NULL; /* The driver to open the file with. */ -static const h5dump_header_t *dump_header_format; -static const char *fp_format = NULL; const char *outfname=NULL; - - -/* things to display or which are set via command line parameters */ -static int display_all = TRUE; -static int display_oid = FALSE; -static int display_data = TRUE; -static int display_attr_data = TRUE; -static int display_char = FALSE; /*print 1-byte numbers as ASCII */ -static int usingdasho = FALSE; -static int display_bb = FALSE; /*superblock */ -static int display_dcpl = FALSE; /*dcpl */ -static int display_fi = FALSE; /*file index */ -static int display_ai = TRUE; /*array index */ -static int display_escape = FALSE; /*escape non printable characters */ -static int display_region = FALSE; /*print region reference data */ -static int enable_error_stack= FALSE; /* re-enable error stack */ - -/* sort parameters */ -static H5_index_t sort_by = H5_INDEX_NAME; /*sort_by [creation_order | name] */ -static H5_iter_order_t sort_order = H5_ITER_INC; /*sort_order [ascending | descending] */ - -/** - ** Added for XML ** - **/ +static int doxml = 0; +static int useschema = 1; +static const char *xml_dtd_uri = NULL; /* module-scoped variables for XML option */ -#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; -static const char *xml_dtd_uri = NULL; -static const char *xmlnsprefix="hdf5:"; -static int indent; /*how far in to indent the line */ - -/** end XML **/ - -/* internal functions */ -static hid_t h5_fileaccess(void); -static void dump_oid(hid_t oid); -static void print_enum(hid_t type); -static int xml_name_to_XID(const char *, char *, int , int ); -static void init_prefix(char **prfx, size_t prfx_len); -static void add_prefix(char **prfx, size_t *prfx_len, const char *name); -/* callback function used by H5Literate() */ -static herr_t dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void *op_data); -static int dump_extlink(hid_t group, const char *linkname, const char *objname); - - - -static h5tool_format_t dataformat = { - 0, /*raw */ - - "", /*fmt_raw */ - "%d", /*fmt_int */ - "%u", /*fmt_uint */ - "%hhd", /*fmt_schar */ - "%u", /*fmt_uchar */ - "%d", /*fmt_short */ - "%u", /*fmt_ushort */ - "%ld", /*fmt_long */ - "%lu", /*fmt_ulong */ - NULL, /*fmt_llong */ - NULL, /*fmt_ullong */ - "%g", /*fmt_double */ - "%g", /*fmt_float */ - - 0, /*ascii */ - 0, /*str_locale */ - 0, /*str_repeat */ - - "[ ", /*arr_pre */ - ",", /*arr_sep */ - " ]", /*arr_suf */ - 1, /*arr_linebreak */ - - "", /*cmpd_name */ - ",\n", /*cmpd_sep */ - "{\n", /*cmpd_pre */ - "}", /*cmpd_suf */ - "\n", /*cmpd_end */ - NULL, /* cmpd_listv */ - ", ", /*vlen_sep */ - "(", /*vlen_pre */ - ")", /*vlen_suf */ - "", /*vlen_end */ - - "%s", /*elmt_fmt */ - ",", /*elmt_suf1 */ - " ", /*elmt_suf2 */ - - "", /*idx_n_fmt */ - "", /*idx_sep */ - "", /*idx_fmt */ - - 80, /*line_ncols *//*standard default columns */ - 0, /*line_per_line */ - "", /*line_pre */ - "%s", /*line_1st */ - "%s", /*line_cont */ - "", /*line_suf */ - "", /*line_sep */ - 1, /*line_multi_new */ - " ", /*line_indent */ - - 1, /*skip_first */ - - 1, /*obj_hidefileno */ - " "H5_PRINTF_HADDR_FMT, /*obj_format */ - - 1, /*dset_hidefileno */ - "DATASET %s ", /*dset_format */ - "%s", /*dset_blockformat_pre */ - "%s", /*dset_ptformat_pre */ - "%s", /*dset_ptformat */ - 1, /*array indices */ - 1 /*escape non printable characters */ -}; +#define DEFAULT_XSD "http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd" +#define DEFAULT_DTD "http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.dtd" -/** - ** Added for XML ** - **/ -/* - * Alternative formating for data dumped to XML - * In general, the numbers are the same, but separators - * except spaces are not used. - * - * Some of these are not used, as some kinds of data are - * dumped in completely new subroutines. - * - * Some of this formatting may yet need to change. - * - * This table only affects XML output. - */ -static h5tool_format_t xml_dataformat = { - 0, /*raw */ - - "", /*fmt_raw */ - "%d", /*fmt_int */ - "%u", /*fmt_uint */ - "%hhd", /*fmt_schar */ - "%u", /*fmt_uchar */ - "%d", /*fmt_short */ - "%u", /*fmt_ushort */ - "%ld", /*fmt_long */ - "%lu", /*fmt_ulong */ - NULL, /*fmt_llong */ - NULL, /*fmt_ullong */ - "%g", /*fmt_double */ - "%g", /*fmt_float */ - - 0, /*ascii */ - 0, /*str_locale */ - 0, /*str_repeat */ - - " ", /*arr_pre */ - "", /*arr_sep */ - "", /*arr_suf */ - 1, /*arr_linebreak */ - - "", /*cmpd_name */ - " ", /*cmpd_sep */ - "", /*cmpd_pre */ - "", /*cmpd_suf */ - "", /*cmpd_end */ - "", /*cmpd_listv */ - - " ", /*vlen_sep */ - " ", /*vlen_pre */ - "", /*vlen_suf */ - "", /*vlen_end */ - - "%s", /*elmt_fmt */ - "", /*elmt_suf1 */ - " ", /*elmt_suf2 */ - - "", /*idx_n_fmt */ - "", /*idx_sep */ - "", /*idx_fmt */ - - 80, /*line_ncols *//*standard default columns */ - 0, /*line_per_line */ - "", /*line_pre */ - "%s", /*line_1st */ - "%s", /*line_cont */ - "", /*line_suf */ - "", /*line_sep */ - 1, /*line_multi_new */ - " ", /*line_indent */ - - 1, /*skip_first */ - - 1, /*obj_hidefileno */ - " "H5_PRINTF_HADDR_FMT, /*obj_format */ - - 1, /*dset_hidefileno */ - "DATASET %s ", /*dset_format */ - "%s", /*dset_blockformat_pre */ - "%s", /*dset_ptformat_pre */ - "%s", /*dset_ptformat */ - 0, /*array indices */ - 0 /*escape non printable characters */ +/* Standard DDL output */ +static const dump_functions ddl_function_table = { + dump_group, + dump_named_datatype, + dump_dataset, + dump_dataspace, + dump_datatype, + dump_attr_cb, + dump_data }; -/** XML **/ - -static const h5dump_header_t standardformat = { - "standardformat", /*name */ - "HDF5", /*fileebgin */ - "", /*fileend */ - SUPER_BLOCK, /*bootblockbegin */ - "", /*bootblockend */ - H5_TOOLS_GROUP, /*groupbegin */ - "", /*groupend */ - H5_TOOLS_DATASET, /*datasetbegin */ - "", /*datasetend */ - ATTRIBUTE, /*attributebegin */ - "", /*attributeend */ - H5_TOOLS_DATATYPE, /*datatypebegin */ - "", /*datatypeend */ - DATASPACE, /*dataspacebegin */ - "", /*dataspaceend */ - DATA, /*databegin */ - "", /*dataend */ - SOFTLINK, /*softlinkbegin */ - "", /*softlinkend */ - EXTLINK, /*extlinkbegin */ - "", /*extlinkend */ - UDLINK, /*udlinkbegin */ - "", /*udlinkend */ - SUBSET, /*subsettingbegin */ - "", /*subsettingend */ - START, /*startbegin */ - "", /*startend */ - STRIDE, /*stridebegin */ - "", /*strideend */ - COUNT, /*countbegin */ - "", /*countend */ - BLOCK, /*blockbegin */ - "", /*blockend */ - - "{", /*fileblockbegin */ - "}", /*fileblockend */ - "{", /*bootblockblockbegin */ - "}", /*bootblockblockend */ - "{", /*groupblockbegin */ - "}", /*groupblockend */ - "{", /*datasetblockbegin */ - "}", /*datasetblockend */ - "{", /*attributeblockbegin */ - "}", /*attributeblockend */ - "", /*datatypeblockbegin */ - "", /*datatypeblockend */ - "", /*dataspaceblockbegin */ - "", /*dataspaceblockend */ - "{", /*datablockbegin */ - "}", /*datablockend */ - "{", /*softlinkblockbegin */ - "}", /*softlinkblockend */ - "{", /*extlinkblockbegin */ - "}", /*extlinkblockend */ - "{", /*udlinkblockbegin */ - "}", /*udlinkblockend */ - "{", /*strblockbegin */ - "}", /*strblockend */ - "{", /*enumblockbegin */ - "}", /*enumblockend */ - "{", /*structblockbegin */ - "}", /*structblockend */ - "{", /*vlenblockbegin */ - "}", /*vlenblockend */ - "{", /*subsettingblockbegin */ - "}", /*subsettingblockend */ - "(", /*startblockbegin */ - ");", /*startblockend */ - "(", /*strideblockbegin */ - ");", /*strideblockend */ - "(", /*countblockbegin */ - ");", /*countblockend */ - "(", /*blockblockbegin */ - ");", /*blockblockend */ - - "", /*dataspacedescriptionbegin */ - "", /*dataspacedescriptionend */ - "(", /*dataspacedimbegin */ - ")", /*dataspacedimend */ +/* XML output */ +static const dump_functions xml_function_table = { + xml_dump_group, + xml_dump_named_datatype, + xml_dump_dataset, + xml_dump_dataspace, + xml_dump_datatype, + xml_dump_attr, + xml_dump_data }; -/** - ** Added for XML ** - **/ -/* internal functions used by XML option */ -static void xml_print_datatype(hid_t, unsigned); -static void xml_print_enum(hid_t); -static int xml_print_refs(hid_t, int); -static int xml_print_strs(hid_t, int); -static char *xml_escape_the_string(const char *, int); -static char *xml_escape_the_name(const char *); +/* internal functions */ +static void init_prefix(char **prfx, size_t prfx_len); /* a structure for handling the order command-line parameters come in */ struct handler_t { @@ -388,7 +69,9 @@ struct handler_t { * parameters. The long-named ones can be partially spelled. When * adding more, make sure that they don't clash with each other. */ -static const char *s_opts = "hnpeyBHirVa:c:d:f:g:k:l:t:w:xD:uX:o:b*F:s:S:Aq:z:m:RE"; +/* The following initialization makes use of C language cancatenating */ +/* "xxx" "yyy" into "xxxyyy". */ +static const char *s_opts = "hnpeyBHirVa:c:d:f:g:k:l:t:w:xD:uX:o:b*F:s:S:Aq:z:m:RECM:"; static struct long_options l_opts[] = { { "help", no_arg, 'h' }, { "hel", no_arg, 'h' }, @@ -502,93 +185,11 @@ static struct long_options l_opts[] = { { "format", require_arg, 'm' }, { "region", no_arg, 'R' }, { "enable-error-stack", no_arg, 'E' }, + { "packed-bits", require_arg, 'M' }, + { "no-compact-subset", no_arg, 'C' }, { NULL, 0, '\0' } }; - -/** - ** Change for XML ** - ** - ** The 'dump_xxx' functions have two versions, standard and XML. - ** - ** They are called indirectly through the 'dump_function_table'. - ** e.g., dump_group(...) becomes dump_functions->dump_group(...); - ** - ** The standard functions are unchanged except for the way - ** they are called - **/ - -/* The dump functions of the dump_function_table */ - -/* standard format: no change */ -static void dump_group(hid_t, const char *); -static void dump_named_datatype(hid_t, const char *); -static void dump_dataset(hid_t, const char *, struct subset_t *); -static void dump_dataspace(hid_t space); -static void dump_datatype(hid_t type); -static void dump_data(hid_t, int, struct subset_t *, int); -static void dump_dcpl(hid_t dcpl, hid_t type_id, hid_t obj_id); -static void dump_comment(hid_t obj_id); -static void dump_fcpl(hid_t fid); -static void dump_fcontents(hid_t fid); -/* callback function used by H5Aiterate2() */ -static herr_t dump_attr_cb(hid_t loc_id, const char *attr_name, const H5A_info_t *info, void *_op_data); - - -/* XML format: same interface, alternative output */ - -static void xml_dump_group(hid_t, const char *); -static void xml_dump_named_datatype(hid_t, const char *); -static void xml_dump_dataset(hid_t, const char *, struct subset_t *); -static void xml_dump_dataspace(hid_t space); -static void xml_dump_datatype(hid_t type); -static herr_t xml_dump_attr(hid_t, const char *, const H5A_info_t *, void *); -static void xml_dump_data(hid_t, int, struct subset_t *, int); - -/** - ** Added for XML ** - ** - ** This is the global dispatch table for the dump functions. - **/ -/* the table of dump functions */ -typedef struct dump_functions_t { - void (*dump_group_function) (hid_t, const char *); - void (*dump_named_datatype_function) (hid_t, const char *); - void (*dump_dataset_function) (hid_t, const char *, struct subset_t *); - void (*dump_dataspace_function) (hid_t); - void (*dump_datatype_function) (hid_t); - herr_t (*dump_attribute_function) (hid_t, const char *, const H5A_info_t *, void *); - void (*dump_data_function) (hid_t, int, struct subset_t *, int); -} dump_functions; - -/* Standard DDL output */ -static const dump_functions ddl_function_table = { - dump_group, - dump_named_datatype, - dump_dataset, - dump_dataspace, - dump_datatype, - dump_attr_cb, - dump_data -}; - -/* XML output */ -static const dump_functions xml_function_table = { - xml_dump_group, - xml_dump_named_datatype, - xml_dump_dataset, - xml_dump_dataspace, - xml_dump_datatype, - xml_dump_attr, - xml_dump_data -}; - -/* - * The global table is set to either ddl_function_table or - * xml_function_table in the initialization. - */ -static const dump_functions *dump_function_table; - /*------------------------------------------------------------------------- * Function: leave @@ -609,7 +210,7 @@ leave(int ret) { h5tools_close(); - exit(ret); + HDexit(ret); } @@ -629,91 +230,109 @@ leave(int ret) static void usage(const char *prog) { - fflush(stdout); - fprintf(stdout, "usage: %s [OPTIONS] file\n", prog); - fprintf(stdout, " OPTIONS\n"); - fprintf(stdout, " -h, --help Print a usage message and exit\n"); - fprintf(stdout, " -n, --contents Print a list of the file contents and exit\n"); - fprintf(stdout, " -B, --superblock Print the content of the super block\n"); - fprintf(stdout, " -H, --header Print the header only; no data is displayed\n"); - fprintf(stdout, " -A, --onlyattr Print the header and value of attributes\n"); - fprintf(stdout, " -i, --object-ids Print the object ids\n"); - fprintf(stdout, " -r, --string Print 1-byte integer datasets as ASCII\n"); - fprintf(stdout, " -e, --escape Escape non printing characters\n"); - fprintf(stdout, " -V, --version Print version number and exit\n"); - fprintf(stdout, " -a P, --attribute=P Print the specified attribute\n"); - fprintf(stdout, " -d P, --dataset=P Print the specified dataset\n"); - fprintf(stdout, " -y, --noindex Do not print array indices with the data\n"); - fprintf(stdout, " -p, --properties Print dataset filters, storage layout and fill value\n"); - fprintf(stdout, " -f D, --filedriver=D Specify which driver to open the file with\n"); - fprintf(stdout, " -g P, --group=P Print the specified group and all members\n"); - fprintf(stdout, " -l P, --soft-link=P Print the value(s) of the specified soft link\n"); - fprintf(stdout, " -o F, --output=F Output raw data into file F\n"); - fprintf(stdout, " -b B, --binary=B Binary file output, of form B\n"); - fprintf(stdout, " -t P, --datatype=P Print the specified named datatype\n"); - fprintf(stdout, " -w N, --width=N Set the number of columns of output. A value of 0 (zero)\n"); - fprintf(stdout, " sets the number of columns to the maximum (65535).\n"); - fprintf(stdout, " Default width is 80 columns.\n"); - fprintf(stdout, " -m T, --format=T Set the floating point output format\n"); - fprintf(stdout, " -q Q, --sort_by=Q Sort groups and attributes by index Q\n"); - fprintf(stdout, " -z Z, --sort_order=Z Sort groups and attributes by order Z\n"); - fprintf(stdout, " -R, --region Print dataset pointed by region references\n"); - fprintf(stdout, " -x, --xml Output in XML using Schema\n"); - fprintf(stdout, " -u, --use-dtd Output in XML using DTD\n"); - fprintf(stdout, " -D U, --xml-dtd=U Use the DTD or schema at U\n"); - fprintf(stdout, " -X S, --xml-ns=S (XML Schema) Use qualified names n the XML\n"); - fprintf(stdout, " \":\": no namespace, default: \"hdf5:\"\n"); - fprintf(stdout, " E.g., to dump a file called `-f', use h5dump -- -f\n"); - fprintf(stdout, " --enable-error-stack Prints messages from the HDF5 error stack as they\n"); - fprintf(stdout, " occur.\n"); - fprintf(stdout, "\n"); - fprintf(stdout, " Subsetting is available by using the following options with a dataset\n"); - fprintf(stdout, " attribute. Subsetting is done by selecting a hyperslab from the data.\n"); - fprintf(stdout, " Thus, the options mirror those for performing a hyperslab selection.\n"); - fprintf(stdout, " One of the START, COUNT, STRIDE, or BLOCK parameters are mandatory if you do subsetting.\n"); - fprintf(stdout, " The STRIDE, COUNT, and BLOCK parameters are optional and will default to 1 in\n"); - fprintf(stdout, " each dimension. START is optional and will default to 0 in each dimension.\n"); - fprintf(stdout, "\n"); - fprintf(stdout, " -s START, --start=START Offset of start of subsetting selection\n"); - fprintf(stdout, " -S STRIDE, --stride=STRIDE Hyperslab stride\n"); - fprintf(stdout, " -c COUNT, --count=COUNT Number of blocks to include in selection\n"); - fprintf(stdout, " -k BLOCK, --block=BLOCK Size of block in hyperslab\n"); - fprintf(stdout, " START, COUNT, STRIDE, and BLOCK - is a list of integers the number of which are equal to the\n"); - fprintf(stdout, " number of dimensions in the dataspace being queried\n"); - fprintf(stdout, "\n"); - fprintf(stdout, " D - is the file driver to use in opening the file. Acceptable values\n"); - fprintf(stdout, " are \"sec2\", \"family\", \"split\", \"multi\", \"direct\", and \"stream\". Without\n"); - fprintf(stdout, " the file driver flag, the file will be opened with each driver in\n"); - fprintf(stdout, " turn and in the order specified above until one driver succeeds\n"); - fprintf(stdout, " in opening the file.\n"); - fprintf(stdout, " F - is a filename.\n"); - fprintf(stdout, " P - is the full path from the root group to the object.\n"); - fprintf(stdout, " N - is an integer greater than 1.\n"); - fprintf(stdout, " T - is a string containing the floating point format, e.g '%%.3f'\n"); - fprintf(stdout, " U - is a URI reference (as defined in [IETF RFC 2396],\n"); - fprintf(stdout, " updated by [IETF RFC 2732])\n"); - fprintf(stdout, " B - is the form of binary output: NATIVE for a memory type, FILE for the\n"); - fprintf(stdout, " file type, LE or BE for pre-existing little or big endian types.\n"); - fprintf(stdout, " Must be used with -o (output file) and it is recommended that\n"); - fprintf(stdout, " -d (dataset) is used. B is an optional argument, defaults to NATIVE\n"); - fprintf(stdout, " Q - is the sort index type. It can be \"creation_order\" or \"name\" (default)\n"); - fprintf(stdout, " Z - is the sort order type. It can be \"descending\" or \"ascending\" (default)\n"); - fprintf(stdout, "\n"); - fprintf(stdout, " Examples:\n"); - fprintf(stdout, "\n"); - fprintf(stdout, " 1) Attribute foo of the group /bar_none in file quux.h5\n"); - fprintf(stdout, "\n"); - fprintf(stdout, " h5dump -a /bar_none/foo quux.h5\n"); - fprintf(stdout, "\n"); - fprintf(stdout, " 2) Selecting a subset from dataset /foo in file quux.h5\n"); - fprintf(stdout, "\n"); - fprintf(stdout, " h5dump -d /foo -s \"0,1\" -S \"1,1\" -c \"2,3\" -k \"2,2\" quux.h5\n"); - fprintf(stdout, "\n"); - fprintf(stdout, " 3) Saving dataset 'dset' in file quux.h5 to binary file 'out.bin'\n"); - fprintf(stdout, " using a little-endian type\n"); - fprintf(stdout, "\n"); - fprintf(stdout, " h5dump -d /dset -b LE -o out.bin quux.h5\n"); - fprintf(stdout, "\n"); + HDfflush(rawoutstream); + HDfprintf(rawoutstream, "usage: %s [OPTIONS] files\n", prog); + HDfprintf(rawoutstream, " OPTIONS\n"); + HDfprintf(rawoutstream, " -h, --help Print a usage message and exit\n"); + HDfprintf(rawoutstream, " -n, --contents Print a list of the file contents and exit\n"); + HDfprintf(rawoutstream, " -B, --superblock Print the content of the super block\n"); + HDfprintf(rawoutstream, " -H, --header Print the header only; no data is displayed\n"); + HDfprintf(rawoutstream, " -A, --onlyattr Print the header and value of attributes\n"); + HDfprintf(rawoutstream, " -i, --object-ids Print the object ids\n"); + HDfprintf(rawoutstream, " -r, --string Print 1-byte integer datasets as ASCII\n"); + HDfprintf(rawoutstream, " -e, --escape Escape non printing characters\n"); + HDfprintf(rawoutstream, " -V, --version Print version number and exit\n"); + HDfprintf(rawoutstream, " -a P, --attribute=P Print the specified attribute\n"); + HDfprintf(rawoutstream, " -d P, --dataset=P Print the specified dataset\n"); + HDfprintf(rawoutstream, " -y, --noindex Do not print array indices with the data\n"); + HDfprintf(rawoutstream, " -p, --properties Print dataset filters, storage layout and fill value\n"); + HDfprintf(rawoutstream, " -f D, --filedriver=D Specify which driver to open the file with\n"); + HDfprintf(rawoutstream, " -g P, --group=P Print the specified group and all members\n"); + HDfprintf(rawoutstream, " -l P, --soft-link=P Print the value(s) of the specified soft link\n"); + HDfprintf(rawoutstream, " -o F, --output=F Output raw data into file F\n"); + HDfprintf(rawoutstream, " -b B, --binary=B Binary file output, of form B\n"); + HDfprintf(rawoutstream, " -t P, --datatype=P Print the specified named datatype\n"); + HDfprintf(rawoutstream, " -w N, --width=N Set the number of columns of output. A value of 0 (zero)\n"); + HDfprintf(rawoutstream, " sets the number of columns to the maximum (65535).\n"); + HDfprintf(rawoutstream, " Default width is 80 columns.\n"); + HDfprintf(rawoutstream, " -m T, --format=T Set the floating point output format\n"); + HDfprintf(rawoutstream, " -q Q, --sort_by=Q Sort groups and attributes by index Q\n"); + HDfprintf(rawoutstream, " -z Z, --sort_order=Z Sort groups and attributes by order Z\n"); + HDfprintf(rawoutstream, + " -M L, --packedbits=L Print packed bits as unsigned integers, using mask\n" + " format L for an integer dataset specified with\n" + " option -d. L is a list of offset,length values,\n" + " separated by commas. Offset is the beginning bit in\n" + " the data value and length is the number of bits of\n" + " the mask.\n" + ); + HDfprintf(rawoutstream, " -R, --region Print dataset pointed by region references\n"); + HDfprintf(rawoutstream, " -x, --xml Output in XML using Schema\n"); + HDfprintf(rawoutstream, " -u, --use-dtd Output in XML using DTD\n"); + HDfprintf(rawoutstream, " -D U, --xml-dtd=U Use the DTD or schema at U\n"); + HDfprintf(rawoutstream, " -X S, --xml-ns=S (XML Schema) Use qualified names n the XML\n"); + HDfprintf(rawoutstream, " \":\": no namespace, default: \"hdf5:\"\n"); + HDfprintf(rawoutstream, " E.g., to dump a file called `-f', use h5dump -- -f\n"); + HDfprintf(rawoutstream, " --enable-error-stack Prints messages from the HDF5 error stack as they\n"); + HDfprintf(rawoutstream, " occur.\n"); + HDfprintf(rawoutstream, " --no-compact-subset Disable compact form of subsetting and allow the use\n"); + HDfprintf(rawoutstream, " of \"[\" in datset names.\n"); + HDfprintf(rawoutstream, "\n"); + HDfprintf(rawoutstream, " Subsetting is available by using the following options with a dataset\n"); + HDfprintf(rawoutstream, " attribute. Subsetting is done by selecting a hyperslab from the data.\n"); + HDfprintf(rawoutstream, " Thus, the options mirror those for performing a hyperslab selection.\n"); + HDfprintf(rawoutstream, " One of the START, COUNT, STRIDE, or BLOCK parameters are mandatory if you do subsetting.\n"); + HDfprintf(rawoutstream, " The STRIDE, COUNT, and BLOCK parameters are optional and will default to 1 in\n"); + HDfprintf(rawoutstream, " each dimension. START is optional and will default to 0 in each dimension.\n"); + HDfprintf(rawoutstream, "\n"); + HDfprintf(rawoutstream, " -s START, --start=START Offset of start of subsetting selection\n"); + HDfprintf(rawoutstream, " -S STRIDE, --stride=STRIDE Hyperslab stride\n"); + HDfprintf(rawoutstream, " -c COUNT, --count=COUNT Number of blocks to include in selection\n"); + HDfprintf(rawoutstream, " -k BLOCK, --block=BLOCK Size of block in hyperslab\n"); + HDfprintf(rawoutstream, " START, COUNT, STRIDE, and BLOCK - is a list of integers the number of which are equal to the\n"); + HDfprintf(rawoutstream, " number of dimensions in the dataspace being queried\n"); + HDfprintf(rawoutstream, "\n"); + HDfprintf(rawoutstream, " D - is the file driver to use in opening the file. Acceptable values\n"); + HDfprintf(rawoutstream, " are \"sec2\", \"family\", \"split\", \"multi\", \"direct\", and \"stream\". Without\n"); + HDfprintf(rawoutstream, " the file driver flag, the file will be opened with each driver in\n"); + HDfprintf(rawoutstream, " turn and in the order specified above until one driver succeeds\n"); + HDfprintf(rawoutstream, " in opening the file.\n"); + HDfprintf(rawoutstream, " F - is a filename.\n"); + HDfprintf(rawoutstream, " P - is the full path from the root group to the object.\n"); + HDfprintf(rawoutstream, " N - is an integer greater than 1.\n"); + HDfprintf(rawoutstream, " T - is a string containing the floating point format, e.g '%%.3f'\n"); + HDfprintf(rawoutstream, " U - is a URI reference (as defined in [IETF RFC 2396],\n"); + HDfprintf(rawoutstream, " updated by [IETF RFC 2732])\n"); + HDfprintf(rawoutstream, " B - is the form of binary output: NATIVE for a memory type, FILE for the\n"); + HDfprintf(rawoutstream, " file type, LE or BE for pre-existing little or big endian types.\n"); + HDfprintf(rawoutstream, " Must be used with -o (output file) and it is recommended that\n"); + HDfprintf(rawoutstream, " -d (dataset) is used. B is an optional argument, defaults to NATIVE\n"); + HDfprintf(rawoutstream, " Q - is the sort index type. It can be \"creation_order\" or \"name\" (default)\n"); + HDfprintf(rawoutstream, " Z - is the sort order type. It can be \"descending\" or \"ascending\" (default)\n"); + HDfprintf(rawoutstream, "\n"); + HDfprintf(rawoutstream, " Examples:\n"); + HDfprintf(rawoutstream, "\n"); + HDfprintf(rawoutstream, " 1) Attribute foo of the group /bar_none in file quux.h5\n"); + HDfprintf(rawoutstream, "\n"); + HDfprintf(rawoutstream, " h5dump -a /bar_none/foo quux.h5\n"); + HDfprintf(rawoutstream, "\n"); + HDfprintf(rawoutstream, " 2) Selecting a subset from dataset /foo in file quux.h5\n"); + HDfprintf(rawoutstream, "\n"); + HDfprintf(rawoutstream, " h5dump -d /foo -s \"0,1\" -S \"1,1\" -c \"2,3\" -k \"2,2\" quux.h5\n"); + HDfprintf(rawoutstream, "\n"); + HDfprintf(rawoutstream, " 3) Saving dataset 'dset' in file quux.h5 to binary file 'out.bin'\n"); + HDfprintf(rawoutstream, " using a little-endian type\n"); + HDfprintf(rawoutstream, "\n"); + HDfprintf(rawoutstream, " h5dump -d /dset -b LE -o out.bin quux.h5\n"); + HDfprintf(rawoutstream, "\n"); + HDfprintf(rawoutstream, " 4) Display two packed bits (bits 0-1 and bits 4-6) in the dataset /dset\n"); + HDfprintf(rawoutstream, "\n"); + HDfprintf(rawoutstream, " h5dump -d /dset -M 0,1,4,3 quux.h5\n"); + HDfprintf(rawoutstream, "\n"); + HDfprintf(rawoutstream, " 5) Dataset foo in files multi1.h5 multi2.h5 multi3.h5\n"); + HDfprintf(rawoutstream, "\n"); + HDfprintf(rawoutstream, " h5dump -d /foo multi1.h5 multi2.h5 multi3.h5\n"); + HDfprintf(rawoutstream, "\n"); } @@ -731,7 +350,7 @@ usage(const char *prog) * *------------------------------------------------------------------------- */ -static ssize_t +ssize_t table_list_add(hid_t oid, unsigned long file_no) { size_t idx; /* Index of table to use */ @@ -756,7 +375,7 @@ table_list_add(hid_t oid, unsigned long file_no) return -1; } if(init_objs(oid, &info, &table_list.tables[idx].group_table, - &table_list.tables[idx].dset_table, &table_list.tables[idx].type_table) < 0) { + &table_list.tables[idx].dset_table, &table_list.tables[idx].type_table) < 0) { H5Idec_ref(oid); table_list.nused--; return -1; @@ -784,7 +403,7 @@ table_list_add(hid_t oid, unsigned long file_no) * *------------------------------------------------------------------------- */ -static ssize_t +ssize_t table_list_visited(unsigned long file_no) { size_t u; /* Local index variable */ @@ -839,6142 +458,1201 @@ table_list_free(void) table_list.nalloc = table_list.nused = 0; } /* end table_list_free() */ - /*------------------------------------------------------------------------- - * Function: print_datatype + * Function: set_data_output_file * - * Purpose: print the datatype. + * Purpose: Open fname as the output file for dataset raw data. + * Set rawdatastream as its file stream. * - * Return: void + * Return: 0 -- succeeded + * negative -- failed * - * Programmer: Ruey-Hsia Li + * Programmer: Albert Cheng, 2000/09/30 * - * Modifications: pvn, March 28, 2006 - * print information about type when a native match is not possible + * Modifications: + * pvn June, 1, 2006. Add a switch for binary output * *------------------------------------------------------------------------- */ -static void -print_datatype(hid_t type,unsigned in_group) +static int +set_data_output_file(const char *fname, int is_bin) { - char *mname; - hid_t mtype, str_type; - unsigned nmembers; - unsigned ndims; - unsigned i; - size_t size=0; - hsize_t dims[H5DUMP_MAX_RANK]; - H5T_str_t str_pad; - H5T_cset_t cset; - H5T_order_t order; - hid_t super; - hid_t tmp_type; - htri_t is_vlstr=FALSE; - const char *order_s=NULL; /* byte order string */ - H5T_sign_t sign; /* sign scheme value */ - const char *sign_s=NULL; /* sign scheme string */ - - if (!in_group && H5Tcommitted(type) > 0) { - H5O_info_t oinfo; - obj_t *obj; /* Found object */ - - H5Oget_info(type, &oinfo); - obj = search_obj(type_table, oinfo.addr); - - if(obj) { - if(!obj->recorded) - HDfprintf(stdout,"\"/#%a\"", obj->objno); - else - printf("\"%s\"", obj->objname); - } else { - error_msg("unknown committed type.\n"); - h5tools_setstatus(EXIT_FAILURE); - } - } else { - switch(H5Tget_class(type)) { - case H5T_INTEGER: - if(H5Tequal(type, H5T_STD_I8BE) == TRUE) { - printf("H5T_STD_I8BE"); - } else if(H5Tequal(type, H5T_STD_I8LE) == TRUE) { - printf("H5T_STD_I8LE"); - } else if(H5Tequal(type, H5T_STD_I16BE) == TRUE) { - printf("H5T_STD_I16BE"); - } else if(H5Tequal(type, H5T_STD_I16LE) == TRUE) { - printf("H5T_STD_I16LE"); - } else if(H5Tequal(type, H5T_STD_I32BE) == TRUE) { - printf("H5T_STD_I32BE"); - } else if(H5Tequal(type, H5T_STD_I32LE) == TRUE) { - printf("H5T_STD_I32LE"); - } else if(H5Tequal(type, H5T_STD_I64BE) == TRUE) { - printf("H5T_STD_I64BE"); - } else if(H5Tequal(type, H5T_STD_I64LE) == TRUE) { - printf("H5T_STD_I64LE"); - } else if(H5Tequal(type, H5T_STD_U8BE) == TRUE) { - printf("H5T_STD_U8BE"); - } else if(H5Tequal(type, H5T_STD_U8LE) == TRUE) { - printf("H5T_STD_U8LE"); - } else if(H5Tequal(type, H5T_STD_U16BE) == TRUE) { - printf("H5T_STD_U16BE"); - } else if(H5Tequal(type, H5T_STD_U16LE) == TRUE) { - printf("H5T_STD_U16LE"); - } else if(H5Tequal(type, H5T_STD_U32BE) == TRUE) { - printf("H5T_STD_U32BE"); - } else if(H5Tequal(type, H5T_STD_U32LE) == TRUE) { - printf("H5T_STD_U32LE"); - } else if(H5Tequal(type, H5T_STD_U64BE) == TRUE) { - printf("H5T_STD_U64BE"); - } else if(H5Tequal(type, H5T_STD_U64LE) == TRUE) { - printf("H5T_STD_U64LE"); - } else if(H5Tequal(type, H5T_NATIVE_SCHAR) == TRUE) { - printf("H5T_NATIVE_SCHAR"); - } else if(H5Tequal(type, H5T_NATIVE_UCHAR) == TRUE) { - printf("H5T_NATIVE_UCHAR"); - } else if(H5Tequal(type, H5T_NATIVE_SHORT) == TRUE) { - printf("H5T_NATIVE_SHORT"); - } else if(H5Tequal(type, H5T_NATIVE_USHORT) == TRUE) { - printf("H5T_NATIVE_USHORT"); - } else if(H5Tequal(type, H5T_NATIVE_INT) == TRUE) { - printf("H5T_NATIVE_INT"); - } else if(H5Tequal(type, H5T_NATIVE_UINT) == TRUE) { - printf("H5T_NATIVE_UINT"); - } else if(H5Tequal(type, H5T_NATIVE_LONG) == TRUE) { - printf("H5T_NATIVE_LONG"); - } else if(H5Tequal(type, H5T_NATIVE_ULONG) == TRUE) { - printf("H5T_NATIVE_ULONG"); - } else if(H5Tequal(type, H5T_NATIVE_LLONG) == TRUE) { - printf("H5T_NATIVE_LLONG"); - } else if(H5Tequal(type, H5T_NATIVE_ULLONG) == TRUE) { - printf("H5T_NATIVE_ULLONG"); - } else { - - /* byte order */ - if(H5Tget_size(type)>1) { - order = H5Tget_order(type); - if (H5T_ORDER_LE == order) { - order_s = " little-endian"; - } else if (H5T_ORDER_BE == order) { - order_s = " big-endian"; - } else if (H5T_ORDER_VAX == order) { - order_s = " mixed-endian"; - } else { - order_s = " unknown-byte-order"; - } - } else { - order_s = ""; - } - - /* sign */ - if ((sign=H5Tget_sign(type))>=0) - { - if (H5T_SGN_NONE == sign) { - sign_s = " unsigned"; - } else if (H5T_SGN_2 == sign) { - sign_s = ""; - } else { - sign_s = " unknown-sign"; - } - } else { - sign_s = " unknown-sign"; - } - - /* print size, order, and sign */ - printf("%lu-bit%s%s integer", - (unsigned long)(8*H5Tget_size(type)), order_s, sign_s); - } - break; - - case H5T_FLOAT: - if(H5Tequal(type, H5T_IEEE_F32BE) == TRUE) { - printf("H5T_IEEE_F32BE"); - } else if(H5Tequal(type, H5T_IEEE_F32LE) == TRUE) { - printf("H5T_IEEE_F32LE"); - } else if(H5Tequal(type, H5T_IEEE_F64BE) == TRUE) { - printf("H5T_IEEE_F64BE"); - } else if(H5Tequal(type, H5T_IEEE_F64LE) == TRUE) { - printf("H5T_IEEE_F64LE"); - } else if(H5Tequal(type, H5T_VAX_F32) == TRUE) { - printf("H5T_VAX_F32"); - } else if(H5Tequal(type, H5T_VAX_F64) == TRUE) { - printf("H5T_VAX_F64"); - } else if(H5Tequal(type, H5T_NATIVE_FLOAT) == TRUE) { - printf("H5T_NATIVE_FLOAT"); - } else if(H5Tequal(type, H5T_NATIVE_DOUBLE) == TRUE) { - printf("H5T_NATIVE_DOUBLE"); -#if H5_SIZEOF_LONG_DOUBLE !=0 - } else if(H5Tequal(type, H5T_NATIVE_LDOUBLE) == TRUE) { - printf("H5T_NATIVE_LDOUBLE"); -#endif - } else { - - /* byte order */ - if(H5Tget_size(type)>1) { - order = H5Tget_order(type); - if (H5T_ORDER_LE == order) { - order_s = " little-endian"; - } else if (H5T_ORDER_BE == order) { - order_s = " big-endian"; - } else if (H5T_ORDER_VAX == order) { - order_s = " mixed-endian"; - } else { - order_s = " unknown-byte-order"; - } - } else { - order_s = ""; - } - - /* print size and byte order */ - printf("%lu-bit%s floating-point", - (unsigned long)(8*H5Tget_size(type)), order_s); - - } - break; - - case H5T_TIME: - printf("H5T_TIME: not yet implemented"); - break; - - case H5T_STRING: - /* Make a copy of type in memory in case when TYPE is on disk, the size - * will be bigger than in memory. This makes it easier to compare - * types in memory. */ - tmp_type = H5Tcopy(type); - size = H5Tget_size(tmp_type); - str_pad = H5Tget_strpad(tmp_type); - cset = H5Tget_cset(tmp_type); - is_vlstr = H5Tis_variable_str(tmp_type); - - printf("H5T_STRING %s\n", dump_header_format->strblockbegin); - indent += COL; - - indentation(indent + COL); - if(is_vlstr) - printf("%s H5T_VARIABLE;\n", STRSIZE); - else - printf("%s %d;\n", STRSIZE, (int) size); - - indentation(indent + COL); - printf("%s ", STRPAD); - if (str_pad == H5T_STR_NULLTERM) - printf("H5T_STR_NULLTERM;\n"); - else if (str_pad == H5T_STR_NULLPAD) - printf("H5T_STR_NULLPAD;\n"); - else if (str_pad == H5T_STR_SPACEPAD) - printf("H5T_STR_SPACEPAD;\n"); - else - printf("H5T_STR_ERROR;\n"); - - indentation(indent + COL); - printf("%s ", CSET); - - if (cset == H5T_CSET_ASCII) - printf("H5T_CSET_ASCII;\n"); - else - printf("unknown_cset;\n"); - - str_type = H5Tcopy(H5T_C_S1); - if(is_vlstr) - H5Tset_size(str_type, H5T_VARIABLE); - else - H5Tset_size(str_type, size); - H5Tset_cset(str_type, cset); - H5Tset_strpad(str_type, str_pad); - - indentation(indent + COL); - printf("%s ", CTYPE); - - /* Check C variable-length string first. Are the two types equal? */ - if (H5Tequal(tmp_type, str_type)) { - printf("H5T_C_S1;\n"); - goto done; - } - - /* Change the endianness and see if they're equal. */ - order = H5Tget_order(tmp_type); - if(order==H5T_ORDER_LE) - H5Tset_order(str_type, H5T_ORDER_LE); - else if(order==H5T_ORDER_BE) - H5Tset_order(str_type, H5T_ORDER_BE); - - if (H5Tequal(tmp_type, str_type)) { - printf("H5T_C_S1;\n"); - goto done; - } - - /* If not equal to C variable-length string, check Fortran type. */ - H5Tclose(str_type); - str_type = H5Tcopy(H5T_FORTRAN_S1); - H5Tset_cset(str_type, cset); - H5Tset_size(str_type, size); - H5Tset_strpad(str_type, str_pad); - - /* Are the two types equal? */ - if (H5Tequal(tmp_type, str_type)) { - printf("H5T_FORTRAN_S1;\n"); - goto done; - } - - /* Change the endianness and see if they're equal. */ - order = H5Tget_order(tmp_type); - if(order==H5T_ORDER_LE) - H5Tset_order(str_type, H5T_ORDER_LE); - else if(order==H5T_ORDER_BE) - H5Tset_order(str_type, H5T_ORDER_BE); - - if (H5Tequal(tmp_type, str_type)) { - printf("H5T_FORTRAN_S1;\n"); - goto done; - } - - /* Type doesn't match any of above. */ - printf("unknown_one_character_type;\n "); - h5tools_setstatus(EXIT_FAILURE); - - done: - H5Tclose(str_type); - H5Tclose(tmp_type); - - indent -= COL; - indentation(indent + COL); - printf("%s", dump_header_format->strblockend); - break; - - case H5T_BITFIELD: - if (H5Tequal(type, H5T_STD_B8BE)==TRUE) { - printf("H5T_STD_B8BE"); - } else if (H5Tequal(type, H5T_STD_B8LE)==TRUE) { - printf("H5T_STD_B8LE"); - } else if (H5Tequal(type, H5T_STD_B16BE)==TRUE) { - printf("H5T_STD_B16BE"); - } else if (H5Tequal(type, H5T_STD_B16LE)==TRUE) { - printf("H5T_STD_B16LE"); - } else if (H5Tequal(type, H5T_STD_B32BE)==TRUE) { - printf("H5T_STD_B32BE"); - } else if (H5Tequal(type, H5T_STD_B32LE)==TRUE) { - printf("H5T_STD_B32LE"); - } else if (H5Tequal(type, H5T_STD_B64BE)==TRUE) { - printf("H5T_STD_B64BE"); - } else if (H5Tequal(type, H5T_STD_B64LE)==TRUE) { - printf("H5T_STD_B64LE"); - } else { - printf("undefined bitfield"); - h5tools_setstatus(EXIT_FAILURE); - } - break; - - case H5T_OPAQUE: - printf("\n"); - indentation(indent + COL); - printf("H5T_OPAQUE;\n"); - indentation(indent + COL); - mname = H5Tget_tag(type); - printf("OPAQUE_TAG \"%s\";\n", mname); - free(mname); - indentation(indent); - break; - - case H5T_COMPOUND: - nmembers = H5Tget_nmembers(type); - printf("H5T_COMPOUND %s\n", dump_header_format->structblockbegin); - - for (i = 0; i < nmembers; i++) { - mname = H5Tget_member_name(type, i); - mtype = H5Tget_member_type(type, i); - indentation(indent + COL); - - if (H5Tget_class(mtype) == H5T_COMPOUND) - indent += COL; - - print_datatype(mtype,0); - - if (H5Tget_class(mtype) == H5T_COMPOUND) - indent -= COL; - - printf(" \"%s\";\n", mname); - free(mname); - } - - indentation(indent); - printf("%s", dump_header_format->structblockend); - break; - - case H5T_REFERENCE: - printf("H5T_REFERENCE"); - /* The BNF document states that the type of reference should be - * displayed after "H5T_REFERENCE". */ - if (H5Tequal(type, H5T_STD_REF_DSETREG)==TRUE) { - printf(" { H5T_STD_REF_DSETREG }"); - } - else { - printf(" { H5T_STD_REF_OBJECT }"); - } - break; - - case H5T_ENUM: - printf("H5T_ENUM %s\n", dump_header_format->enumblockbegin); - indent += COL; - indentation(indent + COL); - super = H5Tget_super(type); - print_datatype(super,0); - printf(";\n"); - print_enum(type); - indent -= COL; - indentation(indent + COL); - printf("%s", dump_header_format->enumblockend); - break; - - case H5T_VLEN: - printf("H5T_VLEN %s ", dump_header_format->vlenblockbegin); - super = H5Tget_super(type); - print_datatype(super,0); - H5Tclose(super); + FILE *f; /* temporary holding place for the stream pointer + * so that rawdatastream is changed only when succeeded */ - /* Print closing */ - printf("%s", dump_header_format->vlenblockend); - break; - - case H5T_ARRAY: - /* Get array base type */ - super = H5Tget_super(type); - - /* Print lead-in */ - printf("H5T_ARRAY { "); - - /* Get array information */ - ndims = H5Tget_array_ndims(type); - H5Tget_array_dims2(type, dims); - - /* Print array dimensions */ - for (i = 0; i < ndims; i++) - printf("[%d]", (int) dims[i]); - - printf(" "); - - /* Print base type */ - print_datatype(super,0); - - /* Close array base type */ - H5Tclose(super); - - /* Print closing */ - printf(" }"); - - break; + if (rawdatastream && rawdatastream != stdout) { + if (HDfclose(rawdatastream)) + HDperror("closing rawdatastream"); + else + rawdatastream = NULL; + } - default: - printf("unknown datatype"); - h5tools_setstatus(EXIT_FAILURE); - break; + /* binary output */ + if (is_bin) { + if ((f = HDfopen(fname, "wb")) != NULL) { + rawdatastream = f; + return 0; } - } /* end else */ -} + } + else { + if ((f = HDfopen(fname, "w")) != NULL) { + rawdatastream = f; + return 0; + } + } + return -1; +} /*------------------------------------------------------------------------- - * Function: dump_datatype - * - * Purpose: Dump the datatype. Datatype can be HDF5 predefined - * atomic datatype or committed/transient datatype. - * - * Return: void + * Function: set_output_file * - * Programmer: Ruey-Hsia Li + * Purpose: Open fname as the output file for raw output. + * Set rawoutstream as its file stream. * - * Modifications: + * Return: 0 -- succeeded + * negative -- failed * *------------------------------------------------------------------------- */ -static void -dump_datatype(hid_t type) +static int +set_output_file(const char *fname) { - indent += COL; + FILE *f; /* temporary holding place for the stream pointer + * so that rawoutstream is changed only when succeeded */ - indentation(indent); - printf("%s %s ", dump_header_format->datatypebegin, - dump_header_format->datatypeblockbegin); + if (rawoutstream && rawoutstream != stdout) { + if (HDfclose(rawoutstream)) + HDperror("closing rawoutstream"); + else + rawoutstream = NULL; + } - print_datatype(type,0); + if ((f = HDfopen(fname, "w")) != NULL) { + rawoutstream = f; + return 0; + } - end_obj(dump_header_format->datatypeend, - dump_header_format->datatypeblockend); - indent -= COL; + return -1; } /*------------------------------------------------------------------------- - * Function: dump_dataspace - * - * Purpose: Dump the dataspace. Dataspace can be named dataspace, - * array, or others. - * - * Return: void + * Function: set_error_file * - * Programmer: Ruey-Hsia Li + * Purpose: Open fname as the error output file for dataset raw error. + * Set rawerrorstream as its file stream. * - * Modifications: + * Return: 0 -- succeeded + * negative -- failed * *------------------------------------------------------------------------- */ -static void -dump_dataspace(hid_t space) +static int +set_error_file(const char *fname) { - hsize_t size[H5DUMP_MAX_RANK]; - hsize_t maxsize[H5DUMP_MAX_RANK]; - int ndims = H5Sget_simple_extent_dims(space, size, maxsize); - H5S_class_t space_type = H5Sget_simple_extent_type(space); - int i; - - indentation(indent + COL); - printf("%s ", dump_header_format->dataspacebegin); - - switch(space_type) { - case H5S_SCALAR: - /* scalar dataspace */ - HDfprintf(stdout, "%s %s", - dump_header_format->dataspacedescriptionbegin, S_SCALAR); - break; - - case H5S_SIMPLE: - /* simple dataspace */ - HDfprintf(stdout, "%s %s { %s %Hu", - dump_header_format->dataspacedescriptionbegin, S_SIMPLE, - dump_header_format->dataspacedimbegin, size[0]); - - for(i = 1; i < ndims; i++) - HDfprintf(stdout, ", %Hu", size[i]); - - printf(" %s / ", dump_header_format->dataspacedimend); - - if(maxsize[0] == H5S_UNLIMITED) - HDfprintf(stdout, "%s %s", - dump_header_format->dataspacedimbegin, - "H5S_UNLIMITED"); - else - HDfprintf(stdout, "%s %Hu", - dump_header_format->dataspacedimbegin, maxsize[0]); - - for(i = 1; i < ndims; i++) - if(maxsize[i] == H5S_UNLIMITED) - HDfprintf(stdout, ", %s", "H5S_UNLIMITED"); - else - HDfprintf(stdout, ", %Hu", maxsize[i]); - - printf(" %s }", dump_header_format->dataspacedimend); - break; + FILE *f; /* temporary holding place for the stream pointer + * so that rawerrorstream is changed only when succeeded */ - case H5S_NULL: - /* null dataspace */ - HDfprintf(stdout, "%s %s", - dump_header_format->dataspacedescriptionbegin, S_NULL); - break; + if (rawerrorstream && rawerrorstream != stderr) { + if (HDfclose(rawerrorstream)) + HDperror("closing rawerrorstream"); + else + rawerrorstream = NULL; + } - case H5S_NO_CLASS: - default: - printf("%s unknown dataspace %s\n", BEGIN, END); - break; - } /* end switch */ + if ((f = HDfopen(fname, "w")) != NULL) { + rawerrorstream = f; + return 0; + } - end_obj(dump_header_format->dataspaceend, - dump_header_format->dataspaceblockend); + return -1; } - /*------------------------------------------------------------------------- - * Function: dump_attr_cb - * - * Purpose: attribute function callback called by H5Aiterate2, displays the attribute + * Function: set_binary_form * - * Return: Success: SUCCEED + * Purpose: set the binary form of output by translating from a string input + * parameter to a integer return value * - * Failure: FAIL + * Return: integer form of binary output or -1 if none found * - * Programmer: Ruey-Hsia Li + * Programmer: Pedro Vicente Nunes + * June 28, 2006 * - * Modifications: Pedro Vicente, October 4, 2007 - * Added H5A_info_t parameter to conform with H5Aiterate2 + * Modifications: * *------------------------------------------------------------------------- */ -static herr_t -dump_attr_cb(hid_t oid, const char *attr_name, const H5A_info_t UNUSED *info, void UNUSED *_op_data) +static int +set_binary_form(const char *form) { - hid_t attr_id; - herr_t ret = SUCCEED; - - indentation(indent); - begin_obj(dump_header_format->attributebegin, attr_name, - dump_header_format->attributeblockbegin); - - if((attr_id = H5Aopen(oid, attr_name, H5P_DEFAULT)) < 0) { - indentation(indent + COL); - error_msg("unable to open attribute \"%s\"\n", attr_name); - indentation(indent); - end_obj(dump_header_format->attributeend, - dump_header_format->attributeblockend); - h5tools_setstatus(EXIT_FAILURE); - ret = FAIL; - } else { - hid_t type, space; - - type = H5Aget_type(attr_id); - space = H5Aget_space(attr_id); - dump_datatype(type); - dump_dataspace(space); - - if(display_oid) - dump_oid(attr_id); - - if(display_data || display_attr_data) - dump_data(attr_id, ATTRIBUTE_DATA, NULL, display_ai); + int bform = -1; - H5Tclose(type); - H5Sclose(space); - H5Aclose(attr_id); - - indentation(indent); - end_obj(dump_header_format->attributeend,dump_header_format->attributeblockend); + if (HDstrcmp(form,"NATIVE") == 0 || HDstrcmp(form,"MEMORY") == 0) { + /* native form */ + bform = 0; } + else if (HDstrcmp(form,"FILE") == 0) /* file type form */ + bform = 1; + else if (HDstrcmp(form,"LE") == 0) /* convert to little endian */ + bform = 2; + else if (HDstrcmp(form,"BE") == 0) /* convert to big endian */ + bform = 3; - return ret; + return bform; } /*------------------------------------------------------------------------- - * Function: dump_selected_attr - * - * Purpose: dump the selected attribute + * Function: set_sort_by * - * Return: Success: SUCCEED + * Purpose: set the "by" form of sorting by translating from a string input + * parameter to a H5_index_t return value + * current sort values are [creation_order | name] * - * Failure: FAIL + * Return: H5_index_t form of sort or H5_INDEX_UNKNOWN if none found * - * Programmer: Ruey-Hsia Li + * Programmer: Pedro Vicente Nunes + * October 1, 2007 * * Modifications: * *------------------------------------------------------------------------- */ -static herr_t -dump_selected_attr(hid_t loc_id, const char *name) +static H5_index_t +set_sort_by(const char *form) { - hid_t oid = -1; - hid_t attr_id = -1; - char *obj_name; - const char *attr_name; - int j; - - j = (int)HDstrlen(name) - 1; - obj_name = (char *)HDmalloc((size_t)j + 2); - if(obj_name == NULL) - goto error; - - /* find the last / */ - while(j >= 0) { - if (name[j] == '/') - break; - j--; - } - - /* object name */ - if(j == -1) - HDstrcpy(obj_name, "/"); - else { - HDstrncpy(obj_name, name, (size_t)j + 1); - obj_name[j + 1] = '\0'; - } /* end else */ - - attr_name = name + j + 1; - begin_obj(dump_header_format->attributebegin, name, - dump_header_format->attributeblockbegin); - - /* Open the object with the attribute */ - if((oid = H5Oopen(loc_id, obj_name, H5P_DEFAULT)) < 0) { - indentation(COL); - error_msg("unable to open object \"%s\"\n", obj_name); - end_obj(dump_header_format->attributeend, dump_header_format->attributeblockend); - goto error; - } /* end if */ - - if((attr_id = H5Aopen(oid, attr_name, H5P_DEFAULT)) >= 0) { - hid_t type, space; - - type = H5Aget_type(attr_id); - space = H5Aget_space(attr_id); - dump_datatype(type); - dump_dataspace(space); - - if(display_oid) - dump_oid(attr_id); - - if(display_data || display_attr_data) - dump_data(attr_id, ATTRIBUTE_DATA, NULL, display_ai); - - H5Tclose(type); - H5Sclose(space); - H5Aclose(attr_id); - end_obj(dump_header_format->attributeend, - dump_header_format->attributeblockend); - } else { - indentation(COL); - error_msg("unable to open attribute \"%s\"\n", obj_name); - end_obj(dump_header_format->attributeend, dump_header_format->attributeblockend); - goto error; - } + H5_index_t idx_type = H5_INDEX_UNKNOWN; - /* Close object */ - if(H5Oclose(oid) < 0) { - goto error; - } /* end if */ + if (HDstrcmp(form,"name")==0) /* H5_INDEX_NAME */ + idx_type = H5_INDEX_NAME; + else if (HDstrcmp(form,"creation_order")==0) /* H5_INDEX_CRT_ORDER */ + idx_type = H5_INDEX_CRT_ORDER; - HDfree(obj_name); - return SUCCEED; - -error: - h5tools_setstatus(EXIT_FAILURE); - if(obj_name) - HDfree(obj_name); - - H5E_BEGIN_TRY { - H5Oclose(oid); - H5Aclose(attr_id); - } H5E_END_TRY; - return FAIL; + return idx_type; } /*------------------------------------------------------------------------- - * Function: dump_all_cb - * - * Purpose: function callback called by H5Literate, - * displays everything in the specified object + * Function: set_sort_order * - * Return: Success: SUCCEED + * Purpose: set the order of sorting by translating from a string input + * parameter to a H5_iter_order_t return value + * current order values are [ascending | descending ] * - * Failure: FAIL + * Return: H5_iter_order_t form of order or H5_ITER_UNKNOWN if none found * - * Programmer: Ruey-Hsia Li + * Programmer: Pedro Vicente Nunes + * October 1, 2007 * * Modifications: - * RMcG, November 2000 - * Added XML support. Also, optionally checks the op_data argument - * - * PVN, May 2008 - * Dump external links * *------------------------------------------------------------------------- */ -static herr_t -dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void UNUSED *op_data) +static H5_iter_order_t +set_sort_order(const char *form) { - hid_t obj; - char *obj_path = NULL; /* Full path of object */ - herr_t ret = SUCCEED; - - /* Build the object's path name */ - obj_path = (char *)HDmalloc(HDstrlen(prefix) + HDstrlen(name) + 2); - if(!obj_path) { - ret = FAIL; - goto done; - } - - HDstrcpy(obj_path, prefix); - HDstrcat(obj_path, "/"); - HDstrcat(obj_path, name); + H5_iter_order_t iter_order = H5_ITER_UNKNOWN; - if(linfo->type == H5L_TYPE_HARD) { - H5O_info_t oinfo; + if (HDstrcmp(form,"ascending")==0) /* H5_ITER_INC */ + iter_order = H5_ITER_INC; + else if (HDstrcmp(form,"descending")==0) /* H5_ITER_DEC */ + iter_order = H5_ITER_DEC; - /* Stat the object */ - if(H5Oget_info_by_name(group, name, &oinfo, H5P_DEFAULT) < 0) { - error_msg("unable to get object information for \"%s\"\n", name); - h5tools_setstatus(EXIT_FAILURE); - ret = FAIL; - goto done; - } /* end if */ - - switch(oinfo.type) { - case H5O_TYPE_GROUP: - if((obj = H5Gopen2(group, name, H5P_DEFAULT)) < 0) { - error_msg("unable to dump group \"%s\"\n", name); - h5tools_setstatus(EXIT_FAILURE); - ret = FAIL; - } - else { - char *old_prefix; /* Pointer to previous prefix */ - - /* Keep copy of prefix before iterating into group */ - old_prefix = HDstrdup(prefix); - HDassert(old_prefix); - - /* Append group name to prefix */ - add_prefix(&prefix, &prefix_len, name); - - /* Iterate into group */ - dump_function_table->dump_group_function(obj, name); - - /* Restore old prefix name */ - HDstrcpy(prefix, old_prefix); - HDfree(old_prefix); - - /* Close group */ - H5Gclose(obj); - } - break; - - case H5O_TYPE_DATASET: - if((obj = H5Dopen2(group, name, H5P_DEFAULT)) >= 0) { - if(oinfo.rc > 1 || hit_elink) { - obj_t *found_obj; /* Found object */ - - found_obj = search_obj(dset_table, oinfo.addr); - - if(found_obj == NULL) { - indentation(indent); - begin_obj(dump_header_format->datasetbegin, name, - dump_header_format->datasetblockbegin); - indentation(indent + COL); - error_msg("internal error (file %s:line %d)\n", - __FILE__, __LINE__); - indentation(indent); - end_obj(dump_header_format->datasetend, - dump_header_format->datasetblockend); - h5tools_setstatus(EXIT_FAILURE); - ret = FAIL; - H5Dclose(obj); - goto done; - } - else if(found_obj->displayed) { - indentation(indent); - - if(!doxml) { - begin_obj(dump_header_format->datasetbegin, name, - dump_header_format->datasetblockbegin); - indentation(indent + COL); - printf("%s \"%s\"\n", HARDLINK, found_obj->objname); - indentation(indent); - end_obj(dump_header_format->datasetend, - dump_header_format->datasetblockend); - } - else { - /* the XML version */ - char *t_obj_path = xml_escape_the_name(obj_path); - char *t_prefix = xml_escape_the_name(HDstrcmp(prefix,"") ? prefix : "/"); - char *t_name = xml_escape_the_name(name); - char *t_objname = xml_escape_the_name(found_obj->objname); - char dsetxid[100]; - char parentxid[100]; - char pointerxid[100]; - - /* Create OBJ-XIDs for the parent and object */ - xml_name_to_XID(obj_path, dsetxid, sizeof(dsetxid), 1); - xml_name_to_XID(prefix, parentxid, sizeof(parentxid), 1); - - printf("<%sDataset Name=\"%s\" OBJ-XID=\"%s-%d\" " - "H5Path=\"%s\" Parents=\"%s\" " - "H5ParentPaths=\"%s\">\n", - xmlnsprefix, - t_name, /* Dataset Name */ - dsetxid, get_next_xid(), /* OBJ-XID */ - t_obj_path, /* H5Path */ - parentxid, /* Parents */ - t_prefix); /* H5ParentPaths */ - - indentation(indent + COL); - xml_name_to_XID(found_obj->objname, pointerxid, sizeof(pointerxid), 1); - printf("<%sDatasetPtr OBJ-XID=\"%s\" H5Path=\"%s\"/>\n", - xmlnsprefix, - pointerxid,t_objname); - indentation(indent); - printf("\n", xmlnsprefix); - - HDfree(t_name); - HDfree(t_obj_path); - HDfree(t_prefix); - HDfree(t_objname); - } - - H5Dclose(obj); - goto done; - } - else { - found_obj->displayed = TRUE; - } - } /* end if */ - - dump_function_table->dump_dataset_function(obj, name, NULL); - H5Dclose(obj); - } - else { - error_msg("unable to dump dataset \"%s\"\n", name); - h5tools_setstatus(EXIT_FAILURE); - ret = FAIL; - } - break; - - case H5O_TYPE_NAMED_DATATYPE: - if((obj = H5Topen2(group, name, H5P_DEFAULT)) < 0) { - error_msg("unable to dump datatype \"%s\"\n", name); - h5tools_setstatus(EXIT_FAILURE); - ret = FAIL; - } - else { - dump_function_table->dump_named_datatype_function(obj, name); - H5Tclose(obj); - } - break; - - default: - error_msg("unknown object \"%s\"\n", name); - h5tools_setstatus(EXIT_FAILURE); - ret = FAIL; - } - } /* end if */ - else { - char *targbuf; - - switch(linfo->type) { - case H5L_TYPE_SOFT: - indentation(indent); - targbuf = (char *)HDmalloc(linfo->u.val_size); - HDassert(targbuf); - - if(!doxml) { - begin_obj(dump_header_format->softlinkbegin, name, - dump_header_format->softlinkblockbegin); - indentation(indent + COL); - } - - if(H5Lget_val(group, name, targbuf, linfo->u.val_size, H5P_DEFAULT) < 0) { - error_msg("unable to get link value\n"); - h5tools_setstatus(EXIT_FAILURE); - ret = FAIL; - } - else { - /* print the value of a soft link */ - if (!doxml) { - /* Standard DDL: no modification */ - printf("LINKTARGET \"%s\"\n", targbuf); - } - else { - /* XML */ - char linkxid[100]; - char parentxid[100]; - char targetxid[100]; - char *t_prefix = xml_escape_the_name(HDstrcmp(prefix,"") ? prefix : "/"); - char *t_name = xml_escape_the_name(name); - char *t_targbuf = xml_escape_the_name(targbuf); - char *t_obj_path = xml_escape_the_name(obj_path); - char *t_link_path; - int res; - - t_link_path = (char *)HDmalloc(HDstrlen(prefix) + linfo->u.val_size + 1); - if(targbuf[0] == '/') - HDstrcpy(t_link_path, targbuf); - else { - HDstrcpy(t_link_path, prefix); - HDstrcat(HDstrcat(t_link_path, "/"), targbuf); - } /* end else */ - - /* Create OBJ-XIDs for the parent and object */ - xml_name_to_XID(t_obj_path, linkxid, sizeof(linkxid), 1); - xml_name_to_XID(prefix, parentxid, sizeof(parentxid), 1); - - /* Try to create an OBJ-XID for the object pointed to */ - res = xml_name_to_XID(t_link_path, targetxid, sizeof(targetxid), 0); - if (res == 0) { - /* target obj found */ - printf("<%sSoftLink LinkName=\"%s\" " - "OBJ-XID=\"%s\" " - "H5SourcePath=\"%s\" " - "TargetPath=\"%s\" TargetObj=\"%s\" " - "Parents=\"%s\" H5ParentPaths=\"%s\" />\n", - xmlnsprefix, - t_name, /* LinkName */ - linkxid, /* OBJ-XID */ - t_obj_path, /* H5SourcePath */ - t_targbuf, /* TargetPath */ - targetxid, /* TargetObj */ - parentxid, /* Parents */ - t_prefix); /* H5ParentPaths */ - } - else { - /* dangling link -- omit from xml attributes */ - printf("<%sSoftLink LinkName=\"%s\" " - "OBJ-XID=\"%s\" " - "H5SourcePath=\"%s\" " - "TargetPath=\"%s\" " - "Parents=\"%s\" H5ParentPaths=\"%s\" />\n", - xmlnsprefix, - t_name, /* LinkName */ - linkxid, /* OBJ-XID */ - t_obj_path, /* H5SourcePath */ - t_targbuf, /* TargetPath */ - parentxid, /* Parents */ - t_prefix); /* H5ParentPaths */ - } - - HDfree(t_prefix); - HDfree(t_name); - HDfree(t_targbuf); - HDfree(t_obj_path); - HDfree(t_link_path); - } - } - - if (!doxml) { - indentation(indent); - end_obj(dump_header_format->softlinkend, - dump_header_format->softlinkblockend); - } - - HDfree(targbuf); - break; - - case H5L_TYPE_EXTERNAL: - targbuf = (char *)HDmalloc(linfo->u.val_size); - HDassert(targbuf); - - indentation(indent); - if(!doxml) - begin_obj(dump_header_format->extlinkbegin, name, dump_header_format->extlinkblockbegin); - - if(H5Lget_val(group, name, targbuf, linfo->u.val_size, H5P_DEFAULT) < 0) { - error_msg("unable to get external link value\n"); - h5tools_setstatus(EXIT_FAILURE); - ret = FAIL; - } /* end if */ - else { - const char *filename; - const char *targname; - - if(H5Lunpack_elink_val(targbuf, linfo->u.val_size, NULL, &filename, &targname) < 0) { - error_msg("unable to unpack external link value\n"); - h5tools_setstatus(EXIT_FAILURE); - ret = FAIL; - } /* end if */ - else { - if(!doxml) { - indentation(indent + COL); - printf("TARGETFILE \"%s\"\n", filename); - indentation(indent + COL); - printf("TARGETPATH \"%s\"\n", targname); - - /* dump the external link */ - dump_extlink(group, name, targname); - - - } /* end if */ - /* XML */ - else { - char linkxid[100]; - char parentxid[100]; - char *t_name = xml_escape_the_name(name); - char *t_prefix = xml_escape_the_name(HDstrcmp(prefix,"") ? prefix : "/"); - char *t_obj_path = xml_escape_the_name(obj_path); - char *t_filename = xml_escape_the_name(filename); - char *t_targname = xml_escape_the_name(targname); - - /* Create OBJ-XIDs for the parent and object */ - xml_name_to_XID(t_obj_path, linkxid, sizeof(linkxid), 1); - xml_name_to_XID(prefix, parentxid, sizeof(parentxid), 1); - - printf("<%sExternalLink LinkName=\"%s\" " - "OBJ-XID=\"%s\" " - "H5SourcePath=\"%s\" " - "TargetFilename=\"%s\" " - "TargetPath=\"%s\" " - "Parents=\"%s\" H5ParentPaths=\"%s\" />\n", - xmlnsprefix, - t_name, /* LinkName */ - linkxid, /* OBJ-XID */ - t_obj_path, /* H5SourcePath */ - filename, /* TargetFilename */ - targname, /* TargetPath*/ - parentxid, /* Parents */ - t_prefix); /* H5ParentPaths */ - HDfree(t_prefix); - HDfree(t_name); - HDfree(t_filename); - HDfree(t_targname); - HDfree(t_obj_path); - } /* end else */ - } /* end else */ - } /* end else */ - if(!doxml) { - indentation(indent); - end_obj(dump_header_format->extlinkend, dump_header_format->extlinkblockend); - } /* end if */ - HDfree(targbuf); - break; - - default: - indentation(indent); - if(!doxml) { - begin_obj(dump_header_format->udlinkbegin, name, dump_header_format->udlinkblockbegin); - indentation(indent + COL); - printf("LINKCLASS %d\n", linfo->type); - indentation(indent); - end_obj(dump_header_format->udlinkend, dump_header_format->udlinkblockend); - } /* end if */ - /* XML */ - else { - char linkxid[100]; - char parentxid[100]; - char *t_name = xml_escape_the_name(name); - char *t_prefix = xml_escape_the_name(HDstrcmp(prefix,"") ? prefix : "/"); - char *t_obj_path = xml_escape_the_name(obj_path); - - /* Create OBJ-XIDs for the parent and object */ - xml_name_to_XID(t_obj_path, linkxid, sizeof(linkxid), 1); - xml_name_to_XID(prefix, parentxid, sizeof(parentxid), 1); - - printf("<%sUserDefined LinkName=\"%s\" " - "OBJ-XID=\"%s\" " - "H5SourcePath=\"%s\" " - "LinkClass=\"%d\" " - "Parents=\"%s\" H5ParentPaths=\"%s\" />\n", - xmlnsprefix, - t_name, /* LinkName */ - linkxid, /* OBJ-XID */ - t_obj_path, /* H5SourcePath */ - linfo->type, /* LinkClass */ - parentxid, /* Parents */ - t_prefix); /* H5ParentPaths */ - HDfree(t_prefix); - HDfree(t_name); - HDfree(t_obj_path); - } /* end else */ - break; - } /* end switch */ - } /* end else */ - -done: - if(obj_path) - HDfree(obj_path); - return ret; -} + return iter_order; +} /*------------------------------------------------------------------------- - * Function: dump_named_datatype + * Function: parse_hsize_list * - * Purpose: Dump named datatype + * Purpose: Parse a list of comma or space separated integers and return + * them in a list. The string being passed into this function + * should be at the start of the list you want to parse. You are + * responsible for freeing the array returned from here. * - * Return: void + * Lists in the so-called "terse" syntax are separated by + * semicolons (;). The lists themselves can be separated by + * either commas (,) or white spaces. * - * Programmer: Ruey-Hsia Li + * Return: * - * Modifications: - * Pedro Vicente, March 27, 2006 - * added display of attributes - * Pedro Vicente, October 4, 2007, added parameters to H5Aiterate2() to allow for - * other iteration orders + * Programmer: Bill Wendling + * Tuesday, 6. February 2001 * *------------------------------------------------------------------------- */ static void -dump_named_datatype(hid_t tid, const char *name) +parse_hsize_list(const char *h_list, subset_d *d) { - H5O_info_t oinfo; - unsigned attr_crt_order_flags; - hid_t tcpl_id; /* datatype creation property list ID */ - - - if ((tcpl_id = H5Tget_create_plist(tid)) < 0) - { - error_msg("error in getting creation property list ID\n"); - h5tools_setstatus(EXIT_FAILURE); - } - - /* query the creation properties for attributes */ - if (H5Pget_attr_creation_order(tcpl_id, &attr_crt_order_flags) < 0) - { - error_msg("error in getting creation properties\n"); - h5tools_setstatus(EXIT_FAILURE); - } - - if(H5Pclose(tcpl_id) < 0) { - error_msg("error in closing creation property list ID\n"); - h5tools_setstatus(EXIT_FAILURE); - } - - - indentation(indent); - printf("%s \"%s\" %s", dump_header_format->datatypebegin, name, - dump_header_format->datatypeblockbegin); - - H5Oget_info(tid, &oinfo); + hsize_t *p_list; + const char *ptr; + unsigned int size_count = 0; + unsigned int i = 0; + unsigned int last_digit = 0; - /* Must check for uniqueness of all objects if we've traversed an elink, - * otherwise only check if the reference count > 1. - */ - if(oinfo.rc > 1 || hit_elink) { - obj_t *found_obj; /* Found object */ + if (!h_list || !*h_list || *h_list == ';') + return; - found_obj = search_obj(type_table, oinfo.addr); + /* count how many integers do we have */ + for (ptr = h_list; ptr && *ptr && *ptr != ';' && *ptr != ']'; ptr++) + if (HDisdigit(*ptr)) { + if (!last_digit) + /* the last read character wasn't a digit */ + size_count++; - if (found_obj == NULL) { - error_msg("internal error (file %s:line %d)\n", - __FILE__, __LINE__); - h5tools_setstatus(EXIT_FAILURE); - goto done; - } - else if (found_obj->displayed) { - printf("%s \"%s\"\n", HARDLINK, found_obj->objname); - goto done; + last_digit = 1; + } + else { + last_digit = 0; } - else - found_obj->displayed = TRUE; - } /* end if */ - - print_datatype(tid, 1); - if(H5Tget_class(tid) != H5T_COMPOUND) - printf(";\n"); - /* print attributes */ - indent += COL; - - /* attribute iteration: if there is a request to do H5_INDEX_CRT_ORDER and tracking order is set - in the datatype's create property list for attributes, then, sort by creation order, otherwise by name */ + if (size_count == 0) + /* there aren't any integers to read */ + return; - if( (sort_by == H5_INDEX_CRT_ORDER) && (attr_crt_order_flags & H5P_CRT_ORDER_TRACKED)) { - if(H5Aiterate2(tid, sort_by, sort_order, NULL, dump_attr_cb, NULL) < 0) { - error_msg("error getting attribute information\n"); - h5tools_setstatus(EXIT_FAILURE); - } /* end if */ - } /* end if */ - else { - if(H5Aiterate2(tid, H5_INDEX_NAME, sort_order, NULL, dump_attr_cb, NULL) < 0) { - error_msg("error getting attribute information\n"); - h5tools_setstatus(EXIT_FAILURE); - } /* end if */ - } /* end else */ + /* allocate an array for the integers in the list */ + p_list = (hsize_t *)HDcalloc(size_count, sizeof(hsize_t)); - indent -= COL; + for (ptr = h_list; i < size_count && ptr && *ptr && *ptr != ';' && *ptr != ']'; ptr++) + if(HDisdigit(*ptr)) { + /* we should have an integer now */ + p_list[i++] = (hsize_t)HDatof(ptr); -done: - end_obj(dump_header_format->datatypeend, - dump_header_format->datatypeblockend); + while (HDisdigit(*ptr)) + /* scroll to end of integer */ + ptr++; + } + d->data = p_list; + d->len = size_count; + + return; } /*------------------------------------------------------------------------- - * Function: dump_group + * Function: parse_subset_params * - * Purpose: Dump everything within the specified group + * Purpose: Parse the so-called "terse" syntax for specifying subsetting + * parameters. * - * Return: void + * Return: Success: struct subset_t object + * Failure: NULL * - * Programmer: Ruey-Hsia Li + * Programmer: Bill Wendling + * Tuesday, 6. February 2001 * * Modifications: * - * Call to dump_all_cb -- add parameter to select everything. - * - * Pedro Vicente, October 1, 2007 - * handle several iteration orders for attributes and groups - * *------------------------------------------------------------------------- */ -static void -dump_group(hid_t gid, const char *name) +static struct subset_t * +parse_subset_params(char *dset) { - H5O_info_t oinfo; - hid_t dset, type; - char type_name[1024], *tmp; - unsigned crt_order_flags; - unsigned attr_crt_order_flags; - hid_t gcpl_id; - - - if ((gcpl_id = H5Gget_create_plist(gid)) < 0) - { - error_msg("error in getting group creation property list ID\n"); - h5tools_setstatus(EXIT_FAILURE); - } - - /* query the group creation properties for attributes */ - if (H5Pget_attr_creation_order(gcpl_id, &attr_crt_order_flags) < 0) - { - error_msg("error in getting group creation properties\n"); - h5tools_setstatus(EXIT_FAILURE); - } - - /* query the group creation properties */ - if(H5Pget_link_creation_order(gcpl_id, &crt_order_flags) < 0) - { - error_msg("error in getting group creation properties\n"); - h5tools_setstatus(EXIT_FAILURE); - } - - if(H5Pclose(gcpl_id) < 0) { - error_msg("error in closing group creation property list ID\n"); - h5tools_setstatus(EXIT_FAILURE); - } - - - tmp = (char *)HDmalloc(HDstrlen(prefix) + HDstrlen(name) + 2); - HDstrcpy(tmp, prefix); - indentation(indent); - begin_obj(dump_header_format->groupbegin, name, dump_header_format->groupblockbegin); - indent += COL; - - if(display_oid) - dump_oid(gid); - - dump_comment(gid); - - if(!HDstrcmp(name, "/") && unamedtype) { - unsigned u; /* Local index variable */ - - /* dump unamed type in root group */ - for(u = 0; u < type_table->nobjs; u++) - if(!type_table->objs[u].recorded) { - dset = H5Dopen2(gid, type_table->objs[u].objname, H5P_DEFAULT); - type = H5Dget_type(dset); - sprintf(type_name, "#"H5_PRINTF_HADDR_FMT, type_table->objs[u].objno); - dump_function_table->dump_named_datatype_function(type, type_name); - H5Tclose(type); - H5Dclose(dset); - } - } /* end if */ - - H5Oget_info(gid, &oinfo); - - /* Must check for uniqueness of all objects if we've traversed an elink, - * otherwise only check if the reference count > 1. - */ - if(oinfo.rc > 1 || hit_elink) { - obj_t *found_obj; /* Found object */ - - found_obj = search_obj(group_table, oinfo.addr); - - if (found_obj == NULL) { - indentation(indent); - error_msg("internal error (file %s:line %d)\n", __FILE__, __LINE__); - h5tools_setstatus(EXIT_FAILURE); - } - else if (found_obj->displayed) { - indentation(indent); - printf("%s \"%s\"\n", HARDLINK, found_obj->objname); - } - else { - found_obj->displayed = TRUE; - /* attribute iteration: if there is a request to do H5_INDEX_CRT_ORDER and tracking order is set - in the group for attributes, then, sort by creation order, otherwise by name */ - - if((sort_by == H5_INDEX_CRT_ORDER) && (attr_crt_order_flags & H5P_CRT_ORDER_TRACKED)) { - if(H5Aiterate2(gid, sort_by, sort_order, NULL, dump_attr_cb, NULL) < 0) { - error_msg("error getting attribute information\n"); - h5tools_setstatus(EXIT_FAILURE); - } /* end if */ - } /* end if */ - else { - if(H5Aiterate2(gid, H5_INDEX_NAME, sort_order, NULL, dump_attr_cb, NULL) < 0) { - error_msg("error getting attribute information\n"); - h5tools_setstatus(EXIT_FAILURE); - } /* end if */ - } /* end else */ + struct subset_t *s = NULL; + register char *brace; - /* if there is a request to do H5_INDEX_CRT_ORDER and tracking order is set - in the group, then, sort by creation order, otherwise by name */ + if (!disable_compact_subset && ((brace = HDstrrchr(dset, '[')) != NULL)) { + *brace++ = '\0'; - if((sort_by == H5_INDEX_CRT_ORDER) && (crt_order_flags & H5P_CRT_ORDER_TRACKED)) - H5Literate(gid, sort_by, sort_order, NULL, dump_all_cb, NULL); - else - H5Literate(gid, H5_INDEX_NAME, sort_order, NULL, dump_all_cb, NULL); + s = (struct subset_t *)HDcalloc(1, sizeof(struct subset_t)); + parse_hsize_list(brace, &s->start); - } - } + while (*brace && *brace != ';') + brace++; + if (*brace) brace++; - else - { + parse_hsize_list(brace, &s->stride); - /* attribute iteration: if there is a request to do H5_INDEX_CRT_ORDER and tracking order is set - in the group for attributes, then, sort by creation order, otherwise by name */ + while (*brace && *brace != ';') + brace++; - if((sort_by == H5_INDEX_CRT_ORDER) && (attr_crt_order_flags & H5P_CRT_ORDER_TRACKED)) { - if(H5Aiterate2(gid, sort_by, sort_order, NULL, dump_attr_cb, NULL) < 0) { - error_msg("error getting attribute information\n"); - h5tools_setstatus(EXIT_FAILURE); - } /* end if */ - } /* end if */ - else { - if(H5Aiterate2(gid, H5_INDEX_NAME, sort_order, NULL, dump_attr_cb, NULL) < 0) { - error_msg("error getting attribute information\n"); - h5tools_setstatus(EXIT_FAILURE); - } /* end if */ - } /* end else */ + if (*brace) brace++; - /* if there is a request to do H5_INDEX_CRT_ORDER and tracking order is set - in the group, then, sort by creation order, otherwise by name */ + parse_hsize_list(brace, &s->count); - if((sort_by == H5_INDEX_CRT_ORDER) && (crt_order_flags & H5P_CRT_ORDER_TRACKED)) - H5Literate(gid, sort_by, sort_order, NULL, dump_all_cb, NULL); - else - H5Literate(gid, H5_INDEX_NAME, sort_order, NULL, dump_all_cb, NULL); + while (*brace && *brace != ';') + brace++; + if (*brace) brace++; + parse_hsize_list(brace, &s->block); } - indent -= COL; - indentation(indent); - end_obj(dump_header_format->groupend, dump_header_format->groupblockend); - free(tmp); + return s; } /*------------------------------------------------------------------------- - * Function: dump_dataset + * Function: parse_mask_list * - * Purpose: Dump the specified data set + * Purpose: Parse a list of comma or space separated integers and fill + * the packed_bits list and counter. The string being passed into this function + * should be at the start of the list you want to parse. * - * Return: void + * Return: Success: SUCCEED * - * Programmer: Ruey-Hsia Li + * Failure: FAIL * - * Modifications: - * Pedro Vicente, 2004, added dataset creation property list display - * Pedro Vicente, October 4, 2007, added parameters to H5Aiterate2() to allow for - * other iteration orders * *------------------------------------------------------------------------- */ -static void -dump_dataset(hid_t did, const char *name, struct subset_t *sset) +static int +parse_mask_list(const char *h_list) { - hid_t type, space; - unsigned attr_crt_order_flags; - hid_t dcpl_id; /* dataset creation property list ID */ - - if ((dcpl_id = H5Dget_create_plist(did)) < 0) - { - error_msg("error in getting creation property list ID\n"); - h5tools_setstatus(EXIT_FAILURE); - } - - /* query the creation properties for attributes */ - if (H5Pget_attr_creation_order(dcpl_id, &attr_crt_order_flags) < 0) - { - error_msg("error in getting creation properties\n"); - h5tools_setstatus(EXIT_FAILURE); + int offset_value; + int length_value; + unsigned long long temp_mask; + const char *ptr = NULL; + + /* sanity check */ + HDassert(h_list); + + HDmemset(packed_mask,0,sizeof(packed_mask)); + + packed_bits_num = 0; + /* scan in pair of offset,length separated by commas. */ + ptr = h_list; + while (*ptr) { + /* scan for an offset which is an unsigned int */ + if (!HDisdigit(*ptr)) { + error_msg("Bad mask list(%s)\n", h_list); + return FAIL; + } + offset_value = HDatoi(ptr); + if (offset_value < 0 || offset_value >= PACKED_BITS_SIZE_MAX) { + error_msg("Packed Bit offset value(%d) must be between 0 and %d\n", + offset_value, PACKED_BITS_SIZE_MAX - 1); + return FAIL; + } + + /* skip to end of integer */ + while (HDisdigit(*++ptr)) + ; + /* Look for the common separator */ + if (*ptr++ != ',') { + error_msg("Bad mask list(%s), missing expected comma separator.\n", h_list); + return FAIL; + } + + /* scan for a length which is a positive int */ + if (!HDisdigit(*ptr)) { + error_msg("Bad mask list(%s)\n", h_list); + return FAIL; + } + length_value = HDatoi(ptr); + if (length_value <= 0) { + error_msg("Packed Bit length value(%d) must be positive.\n", length_value); + return FAIL; + } + if ((offset_value + length_value) > PACKED_BITS_SIZE_MAX){ + error_msg("Packed Bit offset+length value(%d) too large. Max is %d\n", + offset_value+length_value, PACKED_BITS_SIZE_MAX); + return FAIL; + } + + /* skip to end of int */ + while (HDisdigit(*++ptr)) + ; + + /* store the offset,length pair */ + if (packed_bits_num >= PACKED_BITS_MAX) { + /* too many requests */ + error_msg("Too many masks requested (max. %d). Mask list(%s)\n", PACKED_BITS_MAX, h_list); + return FAIL; + } + packed_offset[packed_bits_num] = offset_value; + packed_length[packed_bits_num] = length_value; + /* create the bit mask by left shift 1's by length, then negate it. */ + /* After packed_mask is calculated, packed_length is not needed but */ + /* keep it for debug purpose. */ + temp_mask = ~0L; + if(length_value<8*sizeof(unsigned long long)) { + temp_mask = temp_mask << length_value; + packed_mask[packed_bits_num] = ~temp_mask; + } + else + packed_mask[packed_bits_num] = temp_mask; + packed_bits_num++; + + /* skip a possible comma separator */ + if (*ptr == ',') { + if (!(*++ptr)) { + /* unexpected end of string */ + error_msg("Bad mask list(%s), unexpected end of string.\n", h_list); + return FAIL; + } + } } - - indentation(indent); - begin_obj(dump_header_format->datasetbegin, name, - dump_header_format->datasetblockbegin); - - type = H5Dget_type(did); - space = H5Dget_space(did); - - dump_comment(did); - dump_datatype(type); - dump_dataspace(space); - - if(display_oid) - dump_oid(did); - - if(display_dcpl) - dump_dcpl(dcpl_id, type, did); - - if(display_data) - switch(H5Tget_class(type)) { - case H5T_TIME: - indentation(indent + COL); - printf("DATA{ not yet implemented.}\n"); - break; - - case H5T_INTEGER: - case H5T_FLOAT: - case H5T_STRING: - case H5T_BITFIELD: - case H5T_OPAQUE: - case H5T_COMPOUND: - case H5T_REFERENCE: - case H5T_ENUM: - case H5T_VLEN: - case H5T_ARRAY: - dump_data(did, DATASET_DATA, sset, display_ai); - break; - - default: - break; - } /* end switch */ - - indent += COL; - - if ( !bin_output ) - { - - /* attribute iteration: if there is a request to do H5_INDEX_CRT_ORDER and tracking order is set - in the group for attributes, then, sort by creation order, otherwise by name */ - - if( (sort_by == H5_INDEX_CRT_ORDER) && (attr_crt_order_flags & H5P_CRT_ORDER_TRACKED)) { - if(H5Aiterate2(did, sort_by, sort_order, NULL, dump_attr_cb, NULL) < 0) { - error_msg("error getting attribute information\n"); - h5tools_setstatus(EXIT_FAILURE); - } /* end if */ - } /* end if */ - else { - if(H5Aiterate2(did, H5_INDEX_NAME, sort_order, NULL, dump_attr_cb, NULL) < 0) { - error_msg("error getting attribute information\n"); - h5tools_setstatus(EXIT_FAILURE); - } /* end if */ - } /* end else */ - + HDassert(packed_bits_num <= PACKED_BITS_MAX); + if (packed_bits_num == 0) { + /* got no masks! */ + error_msg("Bad mask list(%s)\n", h_list); + return FAIL; } - - indent -= COL; - - H5Tclose(type); - H5Sclose(space); - H5Pclose(dcpl_id); - - - indentation(indent); - end_obj(dump_header_format->datasetend,dump_header_format->datasetblockend); + return SUCCEED; } + /*------------------------------------------------------------------------- - * Function: dump_dims + * Function: free_handler * - * Purpose: Dump the dimensions handed to it in a comma separated list + * Purpose: Convenience function to free the handler_t structures. Needs a + * length variable (LEN) to know how many in the array it needs + * to free * - * Return: void + * Return: Nothing * * Programmer: Bill Wendling - * Tuesday, 27. February 2001 + * Tuesday, 20. February 2001 * * Modifications: * *------------------------------------------------------------------------- */ static void -dump_dims(hsize_t *s, int dims) +free_handler(struct handler_t *hand, int len) { - int i; + register int i; + + if(hand) { + for (i = 0; i < len; i++) { + if(hand[i].obj) { + HDfree(hand[i].obj); + hand[i].obj=NULL; + } - for (i = 0; i < dims; i++) { - printf(HSIZE_T_FORMAT, s[i]); + if (hand[i].subset_info) { + if(hand[i].subset_info->start.data) + HDfree(hand[i].subset_info->start.data); + if(hand[i].subset_info->stride.data) + HDfree(hand[i].subset_info->stride.data); + if(hand[i].subset_info->count.data) + HDfree(hand[i].subset_info->count.data); + if(hand[i].subset_info->block.data) + HDfree(hand[i].subset_info->block.data); + + HDfree(hand[i].subset_info); + hand[i].subset_info=NULL; + } + } - if (i + 1 != dims) - printf(", "); + HDfree(hand); } } + /*------------------------------------------------------------------------- - * Function: dump_subsetting_header + * Function: parse_command_line * - * Purpose: Dump the subsetting header like specified in the DDL. + * Purpose: Parse the command line for the h5dumper. * - * Return: void + * Return: Success: A pointer to an array of handler_t structures. + * These contain all the information needed to dump + * the necessary object. + * + * Failure: Exits program with EXIT_FAILURE value. * * Programmer: Bill Wendling - * Tuesday, 27. February 2001 + * Tuesday, 20. February 2001 * * Modifications: + * pvn June, 1, 2006. Add a switch for binary output * *------------------------------------------------------------------------- */ -static void -dump_subsetting_header(struct subset_t *sset, int dims) +static struct handler_t * +parse_command_line(int argc, const char *argv[]) { - indentation(indent); - printf("%s %s\n", dump_header_format->subsettingbegin, - dump_header_format->subsettingblockbegin); - - indent += COL; - indentation(indent); - printf("%s %s ", dump_header_format->startbegin, - dump_header_format->startblockbegin); - dump_dims(sset->start.data, dims); - printf("%s %s\n", dump_header_format->startend, - dump_header_format->startblockend); - - indentation(indent); - printf("%s %s ", dump_header_format->stridebegin, - dump_header_format->strideblockbegin); - dump_dims(sset->stride.data, dims); - printf("%s %s\n", dump_header_format->strideend, - dump_header_format->strideblockend); - - indentation(indent); - printf("%s %s ", dump_header_format->countbegin, - dump_header_format->countblockbegin); - - if(sset->count.data) - dump_dims(sset->count.data, dims); - else - printf("DEFAULT"); - - printf("%s %s\n", dump_header_format->countend, - dump_header_format->countblockend); - - indentation(indent); - printf("%s %s ", dump_header_format->blockbegin, - dump_header_format->blockblockbegin); - - if(sset->block.data) - dump_dims(sset->block.data, dims); - else - printf("DEFAULT"); - - printf("%s %s\n", dump_header_format->blockend, - dump_header_format->blockblockend); -} + struct handler_t *hand = NULL; + struct handler_t *last_dset = NULL; + int i; + int opt; + int last_was_dset = FALSE; -/*------------------------------------------------------------------------- - * Function: dump_data - * - * Purpose: Dump attribute or dataset data - * - * Return: void - * - * Programmer: Ruey-Hsia Li - * - * Modifications: pvn, print the matrix indices - * Albert Cheng, 2004/11/18 - * Add --string printing for attributes too. - * - *------------------------------------------------------------------------- - */ -static void -dump_data(hid_t obj_id, int obj_data, struct subset_t *sset, int display_index) -{ - h5tool_format_t *outputformat = &dataformat; - int status = -1; - void *buf; - hid_t space, type, p_type; - H5S_class_t space_type; - int ndims, i; - hsize_t size[64], nelmts = 1, alloc_size; - int depth; - int stdindent = COL; /* should be 3 */ - - if (fp_format) - { - outputformat->fmt_double = fp_format; - outputformat->fmt_float = fp_format; - } - - if (nCols==0) { - outputformat->line_ncols = 65535; - outputformat->line_per_line = 1; - } - else - outputformat->line_ncols = nCols; - outputformat->do_escape=display_escape; - /* print the matrix indices */ - outputformat->pindex=display_index; - - /* do not print indices for regions */ - if(obj_data == DATASET_DATA) { - hid_t f_type = H5Dget_type(obj_id); - - if (H5Tequal(f_type, H5T_STD_REF_DSETREG)) { - /* For the region option, correct the display of indices */ - if (display_region) { - if (display_index) { - outputformat->pindex = 1; - outputformat->idx_fmt = "(%s): "; - outputformat->idx_n_fmt = HSIZE_T_FORMAT; - outputformat->idx_sep = ","; - outputformat->line_pre = "%s"; - } - else { - outputformat->pindex = 0; - outputformat->idx_fmt = ""; - outputformat->idx_n_fmt = ""; - outputformat->idx_sep = ""; - outputformat->line_pre = ""; - } - } - else - outputformat->pindex = 0; - } - H5Tclose(f_type); - } - - if (outputformat->pindex) { - outputformat->idx_fmt = "(%s): "; - outputformat->idx_n_fmt = HSIZE_T_FORMAT; - outputformat->idx_sep = ","; - outputformat->line_pre = "%s"; - } - - indent += COL; - - /* - * the depth will tell us how far we need to indent extra. we use to just - * use indent but with the merging of the tools lib we have to do - * something different for the lib funtions... the normal indentation is 6 - * so when we don't need any extra indentation, depth will be 0. - */ - depth = indent / stdindent + 1; - - if (sset && obj_data == DATASET_DATA) { - hid_t f_space = H5Dget_space(obj_id); - - dump_subsetting_header(sset, H5Sget_simple_extent_ndims(f_space)); - H5Sclose(f_space); - - /* recalculate the depth of the data */ - depth = indent / stdindent + 1; - } - - indentation(indent); - begin_obj(dump_header_format->databegin, (const char *)NULL, - dump_header_format->datablockbegin); - - /* Print all the values. */ - if(obj_data == DATASET_DATA) { - hid_t f_type = H5Dget_type(obj_id); - char string_prefix[64]; - h5tool_format_t string_dataformat; - - if(display_char && H5Tget_size(f_type) == 1 && H5Tget_class(f_type) == H5T_INTEGER) { - /* - * Print 1-byte integer data as an ASCII character string - * instead of integers if the `-r' or `--string' command-line - * option was given. - * - * We don't want to modify the global dataformat, so make a - * copy of it instead. - */ - string_dataformat = *outputformat; - string_dataformat.idx_fmt = " "; - string_dataformat.line_multi_new = 1; - string_dataformat.line_1st = " %s\""; - string_dataformat.line_pre = " %s"; - string_dataformat.line_cont = " %s"; - string_dataformat.str_repeat = 8; - string_dataformat.ascii = TRUE; - string_dataformat.elmt_suf1 = ""; - string_dataformat.elmt_suf2 = ""; - string_dataformat.line_indent = ""; - strcpy(string_prefix, string_dataformat.line_pre); - strcat(string_prefix, "\""); - string_dataformat.line_pre = string_prefix; - string_dataformat.line_suf = "\""; - outputformat = &string_dataformat; - } - - - status = h5tools_dump_dset(stdout, outputformat, obj_id, -1, sset, depth); - - H5Tclose(f_type); - } - else { - /* need to call h5tools_dump_mem for the attribute data */ - space = H5Aget_space(obj_id); - space_type = H5Sget_simple_extent_type(space); - if(space_type == H5S_NULL || space_type == H5S_NO_CLASS) { - status = SUCCEED; - } - else { - char string_prefix[64]; - h5tool_format_t string_dataformat; - - /* VL data special information */ - unsigned int vl_data = 0; /* contains VL datatypes */ - - type = H5Aget_type(obj_id); - p_type = h5tools_get_native_type(type); - - ndims = H5Sget_simple_extent_dims(space, size, NULL); - - /* Check if we have VL data in the dataset's datatype */ - if (h5tools_detect_vlen(p_type) == TRUE) - vl_data = TRUE; - - for (i = 0; i < ndims; i++) - nelmts *= size[i]; - - alloc_size = nelmts * MAX(H5Tget_size(type), H5Tget_size(p_type)); - assert(alloc_size == (hsize_t)((size_t)alloc_size)); /*check for overflow*/ - - buf = malloc((size_t)alloc_size); - assert(buf); - - if (H5Aread(obj_id, p_type, buf) >= 0) - if (display_char && H5Tget_size(type) == 1 && H5Tget_class(type) == H5T_INTEGER) { - /* - * Print 1-byte integer data as an ASCII character string - * instead of integers if the `-r' or `--string' command-line - * option was given. - * - * We don't want to modify the global dataformat, so make a - * copy of it instead. - */ - string_dataformat = *outputformat; - string_dataformat.idx_fmt = " "; - string_dataformat.line_multi_new = 1; - string_dataformat.line_1st = " %s\""; - string_dataformat.line_pre = " %s"; - string_dataformat.line_cont = " %s"; - string_dataformat.str_repeat = 8; - string_dataformat.ascii = TRUE; - string_dataformat.elmt_suf1 = ""; - string_dataformat.elmt_suf2 = ""; - string_dataformat.line_indent = ""; - strcpy(string_prefix, string_dataformat.line_pre); - strcat(string_prefix, "\""); - string_dataformat.line_pre = string_prefix; - string_dataformat.line_suf = "\""; - outputformat = &string_dataformat; - } - - status = h5tools_dump_mem(stdout, outputformat, obj_id, p_type, - space, buf, depth); - - /* Reclaim any VL memory, if necessary */ - if (vl_data) - H5Dvlen_reclaim(p_type, space, H5P_DEFAULT, buf); - - free(buf); - H5Tclose(p_type); - H5Tclose(type); - } - H5Sclose(space); - } - - if (status == FAIL) { - indentation(indent + COL); - error_msg("unable to print data\n"); - h5tools_setstatus(EXIT_FAILURE); - } - - indentation(indent); - end_obj(dump_header_format->dataend, dump_header_format->datablockend); - indent -= COL; - - if (sset && obj_data == DATASET_DATA) { - indentation(indent); - end_obj(dump_header_format->subsettingend, - dump_header_format->subsettingblockend); - indent -= COL; - } -} - -/*------------------------------------------------------------------------- - * Function: dump_oid - * - * Purpose: Prints the object ids - * - * Return: void - * - * Programmer: Patrick Lu - * - * Modifications: - * - *------------------------------------------------------------------------- - */ -static void -dump_oid(hid_t oid) -{ - indentation(indent + COL); - printf("%s %s %d %s\n", OBJID, BEGIN, oid, END); -} - -/*------------------------------------------------------------------------- - * Function: dump_comment - * - * Purpose: prints the comment for the the object name - * - * Return: void - * - * Programmer: pvn - * - * Modifications: - * - *------------------------------------------------------------------------- - */ -static void -dump_comment(hid_t obj_id) -{ - size_t buf_size = 0; - char* comment = NULL; - ssize_t cmt_bufsize = -1; - - cmt_bufsize = H5Oget_comment(obj_id, comment, buf_size); - - /* call H5Oget_comment again with the correct value. - * If the call to H5Oget_comment returned an error, skip this block */ - if (cmt_bufsize > 0) { - comment = (char *)HDmalloc((size_t)(cmt_bufsize+1)); /* new_size including null terminator */ - if(comment) { - cmt_bufsize = H5Oget_comment(obj_id, comment, cmt_bufsize); - if(cmt_bufsize > 0) { - comment[cmt_bufsize] = '\0'; /* necessary because null char is not returned */ - indentation(indent); - printf("COMMENT \"%s\"\n", comment); - } /* end if */ - HDfree(comment); - } - } - -} /* end dump_comment() */ - - -/*------------------------------------------------------------------------- - * Function: dump_fill_value - * - * Purpose: prints the fill value - * - * Return: void - * - * Programmer: pvn - * - * Modifications: - * - *------------------------------------------------------------------------- - */ - -static void dump_fill_value(hid_t dcpl,hid_t type_id, hid_t obj_id) -{ - h5tools_context_t ctx; /*print context */ - size_t size; - void *buf=NULL; - hsize_t nelmts=1; - h5tool_format_t *outputformat = &dataformat; - hid_t n_type; - - memset(&ctx, 0, sizeof(ctx)); - ctx.indent_level=2; - - n_type = h5tools_get_native_type(type_id); - - size = H5Tget_size(n_type); - buf = malloc(size); - - H5Pget_fill_value(dcpl, n_type, buf); - - h5tools_dump_simple_data(stdout, outputformat, obj_id, &ctx, START_OF_DATA | END_OF_DATA, nelmts, n_type, buf); - - H5Tclose(n_type); - - if (buf) - free (buf); -} - - -/*------------------------------------------------------------------------- - * Function: dump_dcpl - * - * Purpose: prints several dataset create property list properties - * - * Return: void - * - * Programmer: pvn - * - * Modifications: pvn, March 28, 2008 - * Add a COMPRESSION ratio information for cases when filters are present - * - *------------------------------------------------------------------------- - */ -static void -dump_dcpl(hid_t dcpl_id,hid_t type_id, hid_t obj_id) -{ - int nfilters; /* number of filters */ - unsigned filt_flags; /* filter flags */ - H5Z_filter_t filtn; /* filter identification number */ - unsigned cd_values[20]; /* filter client data values */ - size_t cd_nelmts; /* filter client number of values */ - char f_name[256]; /* filter name */ - unsigned szip_options_mask; - unsigned szip_pixels_per_block; - hsize_t chsize[64]; /* chunk size in elements */ - int rank; /* rank */ - char name[256]; /* external file name */ - off_t offset; /* offset of external file */ - hsize_t size; /* size of external file */ - H5D_fill_value_t fvstatus; - H5D_alloc_time_t at; - H5D_fill_time_t ft; - hsize_t storage_size; - haddr_t ioffset; - int i; - unsigned j; - - storage_size = H5Dget_storage_size(obj_id); - nfilters = H5Pget_nfilters(dcpl_id); - ioffset = H5Dget_offset(obj_id); - HDstrcpy(f_name,"\0"); - - /*------------------------------------------------------------------------- - * STORAGE_LAYOUT - *------------------------------------------------------------------------- - */ - indentation(indent + COL); - printf("%s %s\n", STORAGE_LAYOUT, BEGIN); - - if (H5D_CHUNKED == H5Pget_layout(dcpl_id)) { - /*start indent */ - indent += COL; - indentation(indent + COL); - printf("%s ", CHUNKED); - - rank = H5Pget_chunk(dcpl_id,NELMTS(chsize),chsize); - HDfprintf(stdout,"%s %Hu", dump_header_format->dataspacedimbegin, chsize[0]); - for ( i=1; idataspacedimend); - indentation(indent + COL); - - - /* if there are filters, print a compression ratio */ - if ( nfilters ) - { - - hid_t sid = H5Dget_space( obj_id ); - hid_t tid = H5Dget_type( obj_id ); - size_t datum_size = H5Tget_size( tid ); - hsize_t dims[H5S_MAX_RANK]; - int ndims = H5Sget_simple_extent_dims( sid, dims, NULL); - hsize_t nelmts = 1; - double ratio = 0; - int ok = 0; - - /* only print the compression ratio for these filters */ - 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_name), f_name, NULL); - - switch (filtn) - { - case H5Z_FILTER_DEFLATE: - case H5Z_FILTER_SZIP: - case H5Z_FILTER_NBIT: - case H5Z_FILTER_SCALEOFFSET: - ok = 1; - break; - } - } - - if (ndims && ok ) - { - hsize_t uncomp_size; - - for (i = 0; i < ndims; i++) - { - nelmts *= dims[i]; - } - uncomp_size = nelmts * datum_size; - - /* compression ratio = uncompressed size / compressed size */ - - if (storage_size != 0) - ratio = (double) uncomp_size / (double) storage_size; - - HDfprintf(stdout, "SIZE %Hu (%.3f:1 COMPRESSION)\n ", storage_size, ratio); - - } - else - HDfprintf(stdout, "SIZE %Hu\n ", storage_size); - - - H5Sclose(sid); - H5Tclose(tid); - - } - else - { - HDfprintf(stdout, "SIZE %Hu\n ", storage_size); - } - - /*end indent */ - indent -= COL; - indentation(indent + COL); - printf("%s\n",END); - } - else if (H5D_COMPACT == H5Pget_layout(dcpl_id)) { - /*start indent */ - indent += COL; - indentation(indent + COL); - printf("%s\n", COMPACT); - - indentation(indent + COL); - HDfprintf(stdout, "SIZE %Hu\n", storage_size); - - /*end indent */ - indent -= COL; - indentation(indent + COL); - printf("%s\n",END); - } - else if (H5D_CONTIGUOUS == H5Pget_layout(dcpl_id)) { - int next; - - next = H5Pget_external_count(dcpl_id); - - /*------------------------------------------------------------------------- - * EXTERNAL_FILE - *------------------------------------------------------------------------- - */ - if (next) { - /*start indent */ - indent += COL; - indentation(indent + COL); - printf("%s\n", CONTIGUOUS); - - indentation(indent + COL); - printf("%s %s\n", EXTERNAL, BEGIN); - - /*start indent */ - indent += COL; - for ( j=0; j<(unsigned)next; j++) { - H5Pget_external(dcpl_id,j,sizeof(name),name,&offset,&size); - indentation(indent + COL); - HDfprintf(stdout,"FILENAME %s SIZE %Hu OFFSET %ld\n",name,size,offset); - } - /*end indent */ - indent -= COL; - indentation(indent + COL); - printf("%s\n",END); - - /*end indent */ - indent -= COL; - indentation(indent + COL); - printf("%s\n",END); - } - else { - /*start indent */ - indent += COL; - indentation(indent + COL); - printf("%s\n", CONTIGUOUS); - - indentation(indent + COL); - HDfprintf(stdout,"SIZE %Hu\n", storage_size); - indentation(indent + COL); - HDfprintf(stdout,"OFFSET %Hu\n", ioffset); - - /*end indent */ - indent -= COL; - indentation(indent + COL); - printf("%s\n",END); - } - } - /*------------------------------------------------------------------------- - * FILTERS - *------------------------------------------------------------------------- - */ - - - indentation(indent + COL); - printf("%s %s\n", FILTERS, BEGIN); - indent += COL; - - if (nfilters) { - for (i=0; inobjs; u++) { - if (!type_table->objs[u].recorded) - printf(" %-10s /#"H5_PRINTF_HADDR_FMT"\n", "datatype", type_table->objs[u].objno); - } - } - - /* print objects in the files */ - h5trav_print(fid); - - printf(" %s\n",END); -} - - -/*------------------------------------------------------------------------- - * Function: set_output_file - * - * Purpose: Open fname as the output file for dataset raw data. - * Set rawdatastream as its file stream. - * - * Return: 0 -- succeeded - * negative -- failed - * - * Programmer: Albert Cheng, 2000/09/30 - * - * Modifications: - * pvn June, 1, 2006. Add a switch for binary output - * - *------------------------------------------------------------------------- - */ -static int -set_output_file(const char *fname, int is_bin) -{ - FILE *f; /* temporary holding place for the stream pointer -* so that rawdatastream is changed only when succeeded */ - - if (rawdatastream && rawdatastream != stdout) { - if (fclose(rawdatastream)) - perror("closing rawdatastream"); - else - rawdatastream = NULL; - } - - /* binary output */ - if (is_bin) - { - if ((f = fopen(fname, "wb")) != NULL) { - rawdatastream = f; - return 0; - } - } - else - { - if ((f = fopen(fname, "w")) != NULL) { - rawdatastream = f; - return 0; - } - } - - return -1; -} - - - -/*------------------------------------------------------------------------- - * Function: set_binary_form - * - * Purpose: set the binary form of output by translating from a string input - * parameter to a integer return value - * - * Return: integer form of binary output or -1 if none found - * - * Programmer: Pedro Vicente Nunes - * June 28, 2006 - * - * Modifications: - * - *------------------------------------------------------------------------- - */ -static int -set_binary_form(const char *form) -{ - int bform=-1; - - if (strcmp(form,"NATIVE")==0 || - strcmp(form,"MEMORY")==0) - {/* native form */ - bform = 0; - } - else if (strcmp(form,"FILE")==0) /* file type form */ - bform = 1; - else if (strcmp(form,"LE")==0) /* convert to little endian */ - bform = 2; - else if (strcmp(form,"BE")==0) /* convert to big endian */ - bform = 3; - - return bform; -} - -/*------------------------------------------------------------------------- - * Function: set_sort_by - * - * Purpose: set the "by" form of sorting by translating from a string input - * parameter to a H5_index_t return value - * current sort values are [creation_order | name] - * - * Return: H5_index_t form of sort or H5_INDEX_UNKNOWN if none found - * - * Programmer: Pedro Vicente Nunes - * October 1, 2007 - * - * Modifications: - * - *------------------------------------------------------------------------- - */ -static H5_index_t -set_sort_by(const char *form) -{ - H5_index_t idx_type = H5_INDEX_UNKNOWN; - - if (strcmp(form,"name")==0) /* H5_INDEX_NAME */ - idx_type = H5_INDEX_NAME; - else if (strcmp(form,"creation_order")==0) /* H5_INDEX_CRT_ORDER */ - idx_type = H5_INDEX_CRT_ORDER; - - return idx_type; -} - - - -/*------------------------------------------------------------------------- - * Function: set_sort_order - * - * Purpose: set the order of sorting by translating from a string input - * parameter to a H5_iter_order_t return value - * current order values are [ascending | descending ] - * - * Return: H5_iter_order_t form of order or H5_ITER_UNKNOWN if none found - * - * Programmer: Pedro Vicente Nunes - * October 1, 2007 - * - * Modifications: - * - *------------------------------------------------------------------------- - */ -static H5_iter_order_t -set_sort_order(const char *form) -{ - H5_iter_order_t iter_order = H5_ITER_UNKNOWN; - - if (strcmp(form,"ascending")==0) /* H5_ITER_INC */ - iter_order = H5_ITER_INC; - else if (strcmp(form,"descending")==0) /* H5_ITER_DEC */ - iter_order = H5_ITER_DEC; - - return iter_order; -} - - -/*------------------------------------------------------------------------- - * Function: handle_attributes - * - * Purpose: Handle the attributes from the command. - * - * Return: void - * - * Programmer: Bill Wendling - * Tuesday, 9. January 2001 - * - * Modifications: - * - * PVN, May 2008 - * add an extra parameter PE, to allow printing/not printing of error messages - * - *------------------------------------------------------------------------- - */ -static void -handle_attributes(hid_t fid, const char *attr, void UNUSED * data, int UNUSED pe, const char UNUSED *display_name) -{ - dump_selected_attr(fid, attr); -} - -/*------------------------------------------------------------------------- - * Function: parse_hsize_list - * - * Purpose: Parse a list of comma or space separated integers and return - * them in a list. The string being passed into this function - * should be at the start of the list you want to parse. You are - * responsible for freeing the array returned from here. - * - * Lists in the so-called "terse" syntax are separated by - * semicolons (;). The lists themselves can be separated by - * either commas (,) or white spaces. - * - * Return: - * - * Programmer: Bill Wendling - * Tuesday, 6. February 2001 - * - *------------------------------------------------------------------------- - */ -static void -parse_hsize_list(const char *h_list, subset_d *d) -{ - hsize_t *p_list; - const char *ptr; - unsigned int size_count = 0, i = 0, last_digit = 0; - - if (!h_list || !*h_list || *h_list == ';') - return; - - /* count how many integers do we have */ - for (ptr = h_list; ptr && *ptr && *ptr != ';' && *ptr != ']'; ptr++) - if (isdigit(*ptr)) { - if (!last_digit) - /* the last read character wasn't a digit */ - size_count++; - - last_digit = 1; - } else { - last_digit = 0; - } - - if (size_count == 0) - /* there aren't any integers to read */ - return; - - /* allocate an array for the integers in the list */ - p_list = (hsize_t *)calloc(size_count, sizeof(hsize_t)); - - for (ptr = h_list; i < size_count && ptr && *ptr && *ptr != ';' && *ptr != ']'; ptr++) - if(isdigit(*ptr)) { - /* we should have an integer now */ - p_list[i++] = (hsize_t)atof(ptr); - - while (isdigit(*ptr)) - /* scroll to end of integer */ - ptr++; - } - d->data = p_list; - d->len = size_count; - - return; -} - -/*------------------------------------------------------------------------- - * Function: parse_subset_params - * - * Purpose: Parse the so-called "terse" syntax for specifying subsetting - * parameters. - * - * Return: Success: struct subset_t object - * Failure: NULL - * - * Programmer: Bill Wendling - * Tuesday, 6. February 2001 - * - * Modifications: - * - *------------------------------------------------------------------------- - */ -static struct subset_t * -parse_subset_params(char *dset) -{ - struct subset_t *s = NULL; - register char *brace; - - if ((brace = strrchr(dset, '[')) != NULL) { - char *slash = strrchr(dset, '/'); - - /* sanity check to make sure the [ isn't part of the dataset name */ - if (brace > slash) { - *brace++ = '\0'; - - s = (struct subset_t *)calloc(1, sizeof(struct subset_t)); - parse_hsize_list(brace, &s->start); - - while (*brace && *brace != ';') - brace++; - - if (*brace) - brace++; - - parse_hsize_list(brace, &s->stride); - - while (*brace && *brace != ';') - brace++; - - if (*brace) - brace++; - - parse_hsize_list(brace, &s->count); - - while (*brace && *brace != ';') - brace++; - - if (*brace) - brace++; - - parse_hsize_list(brace, &s->block); - } - } - - return s; -} - -/*------------------------------------------------------------------------- - * Function: handle_datasets - * - * Purpose: Handle the datasets from the command. - * - * Return: void - * - * Programmer: Bill Wendling - * Tuesday, 9. January 2001 - * - * Modifications: - * Pedro Vicente, Tuesday, January 15, 2008 - * check for block overlap\ - * - * Pedro Vicente, May 8, 2008 - * added a flag PE that prints/not prints error messages - * added for cases of external links not found, to avoid printing of - * objects not found, since external links are dumped on a trial error basis - * - *------------------------------------------------------------------------- - */ -static void -handle_datasets(hid_t fid, const char *dset, void *data, int pe, const char *display_name) -{ - H5O_info_t oinfo; - hid_t dsetid; - struct subset_t *sset = (struct subset_t *)data; - const char *real_name = display_name ? display_name : dset; - - if((dsetid = H5Dopen2(fid, dset, H5P_DEFAULT)) < 0) - { - if (pe) - { - begin_obj(dump_header_format->datasetbegin, real_name, - dump_header_format->datasetblockbegin); - indentation(COL); - error_msg("unable to open dataset \"%s\"\n", real_name); - end_obj(dump_header_format->datasetend, - dump_header_format->datasetblockend); - h5tools_setstatus(EXIT_FAILURE); - } - return; - } /* end if */ - - if(sset) { - unsigned int i; - hid_t sid = H5Dget_space(dsetid); - int ndims = H5Sget_simple_extent_ndims(sid); - - H5Sclose(sid); - if(ndims < 0) { - error_msg("H5Sget_simple_extent_ndims failed\n"); - h5tools_setstatus(EXIT_FAILURE); - return; - } - - if(!sset->start.data || !sset->stride.data || !sset->count.data || !sset->block.data) { - /* they didn't specify a ``stride'' or ``block''. default to 1 in all - * dimensions */ - if(!sset->start.data) { - /* default to (0, 0, ...) for the start coord */ - sset->start.data = (hsize_t *)calloc((size_t)ndims, sizeof(hsize_t)); - sset->start.len = ndims; - } - - if(!sset->stride.data) { - sset->stride.data = (hsize_t *)calloc((size_t)ndims, sizeof(hsize_t)); - sset->stride.len = ndims; - for (i = 0; i < ndims; i++) - sset->stride.data[i] = 1; - } - - if(!sset->count.data) { - sset->count.data = (hsize_t *)calloc((size_t)ndims, sizeof(hsize_t)); - sset->count.len = ndims; - for (i = 0; i < ndims; i++) - sset->count.data[i] = 1; - } - - if(!sset->block.data) { - sset->block.data = (hsize_t *)calloc((size_t)ndims, sizeof(hsize_t)); - sset->block.len = ndims; - for (i = 0; i < ndims; i++) - sset->block.data[i] = 1; - } - } - - /*------------------------------------------------------------------------- - * check for dimension overflow - *------------------------------------------------------------------------- - */ - if(sset->start.len > ndims) { - error_msg("number of start dims (%u) exceed dataset dims (%u)\n", sset->start.len, ndims); - h5tools_setstatus(EXIT_FAILURE); - return; - } - if(sset->stride.len > ndims) { - error_msg("number of stride dims (%u) exceed dataset dims (%u)\n", sset->stride.len, ndims); - h5tools_setstatus(EXIT_FAILURE); - return; - } - if(sset->count.len > ndims) { - error_msg("number of count dims (%u) exceed dataset dims (%u)\n", sset->count.len, ndims); - h5tools_setstatus(EXIT_FAILURE); - return; - } - if(sset->block.len > ndims) { - error_msg("number of block dims (%u) exceed dataset dims (%u)\n", sset->block.len, ndims); - h5tools_setstatus(EXIT_FAILURE); - return; - } - - /*------------------------------------------------------------------------- - * check for block overlap - *------------------------------------------------------------------------- - */ - for(i = 0; i < ndims; i++) { - if(sset->count.data[i] > 1) { - if(sset->stride.data[i] < sset->block.data[i]) { - error_msg("wrong subset selection; blocks overlap\n"); - h5tools_setstatus(EXIT_FAILURE); - return; - } /* end if */ - } /* end if */ - } /* end for */ - } /* end if */ - - - H5Oget_info(dsetid, &oinfo); - if(oinfo.rc > 1 || hit_elink) { - obj_t *found_obj; /* Found object */ - - found_obj = search_obj(dset_table, oinfo.addr); - - if(found_obj) { - if (found_obj->displayed) { - indentation(indent); - begin_obj(dump_header_format->datasetbegin, real_name, - dump_header_format->datasetblockbegin); - indentation(indent + COL); - printf("%s \"%s\"\n", HARDLINK, found_obj->objname); - indentation(indent); - end_obj(dump_header_format->datasetend, - dump_header_format->datasetblockend); - } else { - found_obj->displayed = TRUE; - dump_dataset(dsetid, real_name, sset); - } - } - else - h5tools_setstatus(EXIT_FAILURE); - } - else - dump_dataset(dsetid, real_name, sset); - - if(H5Dclose(dsetid) < 0) - h5tools_setstatus(EXIT_FAILURE); -} - -/*------------------------------------------------------------------------- - * Function: handle_groups - * - * Purpose: Handle the groups from the command. - * - * Return: void - * - * Programmer: Bill Wendling - * Tuesday, 9. January 2001 - * - * Modifications: Pedro Vicente, September 26, 2007 - * handle creation order - * - * Pedro Vicente, May 8, 2008 - * added a flag PE that prints/not prints error messages - * added for cases of external links not found, to avoid printing of - * objects not found, since external links are dumped on a trial error basis - * - *------------------------------------------------------------------------- - */ -static void -handle_groups(hid_t fid, const char *group, void UNUSED * data, int pe, const char * display_name) -{ - hid_t gid; - const char *real_name = display_name ? display_name : group; - - - if((gid = H5Gopen2(fid, group, H5P_DEFAULT)) < 0) - { - if ( pe ) - { - begin_obj(dump_header_format->groupbegin, real_name, dump_header_format->groupblockbegin); - indentation(COL); - error_msg("unable to open group \"%s\"\n", real_name); - end_obj(dump_header_format->groupend, dump_header_format->groupblockend); - h5tools_setstatus(EXIT_FAILURE); - } - } - else - { - size_t new_len = HDstrlen(group) + 1; - - if(prefix_len <= new_len) - { - prefix_len = new_len; - prefix = (char *)HDrealloc(prefix, prefix_len); - } /* end if */ - - HDstrcpy(prefix, group); - - dump_group(gid, real_name); - - if(H5Gclose(gid) < 0) - h5tools_setstatus(EXIT_FAILURE); - } /* end else */ -} /* end handle_groups() */ - -/*------------------------------------------------------------------------- - * Function: handle_links - * - * Purpose: Handle soft or UD links from the command. - * - * Return: void - * - * Programmer: Bill Wendling - * Tuesday, 9. January 2001 - * - * Modifications: - * - *------------------------------------------------------------------------- - */ -static void -handle_links(hid_t fid, const char *links, void UNUSED * data, int UNUSED pe, const char UNUSED *display_name) -{ - H5L_info_t linfo; - - if(H5Lget_info(fid, links, &linfo, H5P_DEFAULT) < 0) { - error_msg("unable to get link info from \"%s\"\n", links); - h5tools_setstatus(EXIT_FAILURE); - } else if(linfo.type == H5L_TYPE_HARD) { - error_msg("\"%s\" is a hard link\n", links); - h5tools_setstatus(EXIT_FAILURE); - } else { - char *buf = (char *)HDmalloc(linfo.u.val_size); - - switch(linfo.type) { - case H5L_TYPE_SOFT: /* Soft link */ - begin_obj(dump_header_format->softlinkbegin, links, - dump_header_format->softlinkblockbegin); - indentation(COL); - if(H5Lget_val(fid, links, buf, linfo.u.val_size, H5P_DEFAULT) >= 0) - printf("LINKTARGET \"%s\"\n", buf); - else { - error_msg("h5dump error: unable to get link value for \"%s\"\n", - links); - h5tools_setstatus(EXIT_FAILURE); - } - end_obj(dump_header_format->softlinkend, - dump_header_format->softlinkblockend); - break; - - case H5L_TYPE_EXTERNAL: - begin_obj(dump_header_format->udlinkbegin, links, - dump_header_format->udlinkblockbegin); - indentation(COL); - begin_obj(dump_header_format->extlinkbegin, links, - dump_header_format->extlinkblockbegin); - if(H5Lget_val(fid, links, buf, linfo.u.val_size, H5P_DEFAULT) >= 0) { - const char *elink_file; - const char *elink_path; - - if(H5Lunpack_elink_val(buf, linfo.u.val_size, NULL, &elink_file, &elink_path)>=0) { - indentation(COL); - printf("LINKCLASS %d\n", linfo.type); - indentation(COL); - printf("TARGETFILE \"%s\"\n", elink_file); - indentation(COL); - printf("TARGETPATH \"%s\"\n", elink_path); - } else { - error_msg("h5dump error: unable to unpack external link value for \"%s\"\n", links); - h5tools_setstatus(EXIT_FAILURE); - } - } else { - error_msg("h5dump error: unable to get external link value for \"%s\"\n", links); - h5tools_setstatus(EXIT_FAILURE); - } - end_obj(dump_header_format->extlinkend, - dump_header_format->extlinkblockend); - break; - - default: - begin_obj(dump_header_format->udlinkbegin, links, - dump_header_format->udlinkblockbegin); - indentation(COL); - begin_obj(dump_header_format->udlinkbegin, links, - dump_header_format->udlinkblockbegin); - indentation(COL); - printf("LINKCLASS %d\n", linfo.type); - end_obj(dump_header_format->udlinkend, - dump_header_format->udlinkblockend); - break; - } /* end switch */ - HDfree(buf); - } /* end else */ -} - -/*------------------------------------------------------------------------- - * Function: handle_datatypes - * - * Purpose: Handle the datatypes from the command. - * - * Return: void - * - * Programmer: Bill Wendling - * Tuesday, 9. January 2001 - * - * Modifications: - * - * Pedro Vicente, May 8, 2008 - * added a flag PE that prints/not prints error messages - * added for cases of external links not found, to avoid printing of - * objects not found, since external links are dumped on a trial error basis - * - *------------------------------------------------------------------------- - */ -static void -handle_datatypes(hid_t fid, const char *type, void UNUSED * data, int pe, const char *display_name) -{ - hid_t type_id; - const char *real_name = display_name ? display_name : type; - - if((type_id = H5Topen2(fid, type, H5P_DEFAULT)) < 0) - { - /* check if type is unamed datatype */ - unsigned idx = 0; - - while(idx < type_table->nobjs ) - { - char name[128]; - - if(!type_table->objs[idx].recorded) - { - /* unamed datatype */ - sprintf(name, "/#"H5_PRINTF_HADDR_FMT, type_table->objs[idx].objno); - - if(!HDstrcmp(name, real_name)) - break; - } /* end if */ - - idx++; - } /* end while */ - - if(idx == type_table->nobjs) - { - if ( pe ) - { - /* unknown type */ - begin_obj(dump_header_format->datatypebegin, real_name, - dump_header_format->datatypeblockbegin); - indentation(COL); - error_msg("unable to open datatype \"%s\"\n", real_name); - end_obj(dump_header_format->datatypeend, - dump_header_format->datatypeblockend); - h5tools_setstatus(EXIT_FAILURE); - } - } - else - { - hid_t dsetid = H5Dopen2(fid, type_table->objs[idx].objname, H5P_DEFAULT); - type_id = H5Dget_type(dsetid); - dump_named_datatype(type_id, real_name); - H5Tclose(type_id); - H5Dclose(dsetid); - } - } - else - { - dump_named_datatype(type_id, real_name); - - if(H5Tclose(type_id) < 0) - h5tools_setstatus(EXIT_FAILURE); - } -} - - -/*------------------------------------------------------------------------- - * Function: parse_command_line - * - * Purpose: Parse the command line for the h5dumper. - * - * Return: Success: A pointer to an array of handler_t structures. - * These contain all the information needed to dump - * the necessary object. - * - * Failure: Exits program with EXIT_FAILURE value. - * - * Programmer: Bill Wendling - * Tuesday, 20. February 2001 - * - * Modifications: - * pvn June, 1, 2006. Add a switch for binary output - * - *------------------------------------------------------------------------- - */ -static struct handler_t * -parse_command_line(int argc, const char *argv[]) -{ - struct handler_t *hand, *last_dset = NULL; - int i, opt, last_was_dset = FALSE; - - /* no arguments */ - if (argc == 1) { - usage(h5tools_getprogname()); - leave(EXIT_FAILURE); - } - - /* this will be plenty big enough to hold the info */ - hand = (struct handler_t *)calloc((size_t)argc, sizeof(struct handler_t)); - - /* parse command line options */ - while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) { -parse_start: - switch ((char)opt) { - case 'R': - display_region = TRUE; - region_output = TRUE; - break; - case 'B': - display_bb = TRUE; - last_was_dset = FALSE; - break; - case 'n': - display_fi = TRUE; - last_was_dset = FALSE; - break; - case 'p': - display_dcpl = TRUE; - break; - case 'y': - display_ai = FALSE; - break; - case 'e': - display_escape = TRUE; - break; - case 'H': - display_data = FALSE; - display_attr_data = FALSE; - last_was_dset = FALSE; - break; - case 'A': - display_data = FALSE; - display_attr_data = TRUE; - last_was_dset = FALSE; - break; - case 'i': - display_oid = TRUE; - last_was_dset = FALSE; - break; - case 'r': - display_char = TRUE; - break; - case 'V': - print_version(h5tools_getprogname()); - leave(EXIT_SUCCESS); - break; - case 'w': - nCols = HDatoi(opt_arg); - last_was_dset = FALSE; - break; - case 'a': - display_all = 0; - - for (i = 0; i < argc; i++) - if (!hand[i].func) { - hand[i].func = handle_attributes; - hand[i].obj = HDstrdup(opt_arg); - break; - } - - last_was_dset = FALSE; - break; - case 'd': - display_all = 0; - - for (i = 0; i < argc; i++) - if (!hand[i].func) { - hand[i].func = handle_datasets; - hand[i].obj = HDstrdup(opt_arg); - hand[i].subset_info = parse_subset_params(hand[i].obj); - last_dset = &hand[i]; - break; - } - - last_was_dset = TRUE; - break; - case 'f': - driver = opt_arg; - break; - case 'g': - display_all = 0; - - for (i = 0; i < argc; i++) - if (!hand[i].func) { - hand[i].func = handle_groups; - hand[i].obj = HDstrdup(opt_arg); - break; - } - - last_was_dset = FALSE; - break; - case 'l': - display_all = 0; - - for (i = 0; i < argc; i++) - if (!hand[i].func) { - hand[i].func = handle_links; - hand[i].obj = HDstrdup(opt_arg); - break; - } - - last_was_dset = FALSE; - break; - case 't': - display_all = 0; - - for (i = 0; i < argc; i++) - if (!hand[i].func) { - hand[i].func = handle_datatypes; - hand[i].obj = HDstrdup(opt_arg); - break; - } - - last_was_dset = FALSE; - break; - - case 'o': - if ( bin_output ) { - if (set_output_file(opt_arg, 1) < 0) { - usage(h5tools_getprogname()); - leave(EXIT_FAILURE); - } - } - else { - if (set_output_file(opt_arg, 0) < 0) { - usage(h5tools_getprogname()); - leave(EXIT_FAILURE); - } - } - - usingdasho = TRUE; - last_was_dset = FALSE; - outfname = opt_arg; - break; - - case 'b': - if ( opt_arg != NULL) { - if ( ( bin_form = set_binary_form(opt_arg)) < 0) { - /* failed to set binary form */ - usage(h5tools_getprogname()); - leave(EXIT_FAILURE); - } - } - bin_output = TRUE; - if (outfname!=NULL) { - if (set_output_file(outfname, 1) < 0) { - /* failed to set output file */ - usage(h5tools_getprogname()); - leave(EXIT_FAILURE); - } - - last_was_dset = FALSE; - } - break; - - case 'q': - if ( ( sort_by = set_sort_by(opt_arg)) < 0) { - /* failed to set "sort by" form */ - usage(h5tools_getprogname()); - leave(EXIT_FAILURE); - } - break; - - case 'z': - if ( ( sort_order = set_sort_order(opt_arg)) < 0) { - /* failed to set "sort order" form */ - usage(h5tools_getprogname()); - leave(EXIT_FAILURE); - } - break; - - /** begin XML parameters **/ - case 'x': - /* select XML output */ - doxml = TRUE; - useschema = TRUE; - dump_header_format = NULL; - dump_function_table = &xml_function_table; - break; - case 'u': - doxml = TRUE; - useschema = FALSE; - xmlnsprefix = ""; - dump_header_format = NULL; - dump_function_table = &xml_function_table; - break; - case 'D': - /* specify alternative XML DTD or schema */ - /* To Do: check format of this value? */ - xml_dtd_uri = opt_arg; - break; - - case 'm': - /* specify alternative floating point printing format */ - fp_format = opt_arg; - break; - - - - - case 'X': - /* specify XML namespace (default="hdf5:"), or none */ - /* To Do: check format of this value? */ - if (!useschema) { - usage(h5tools_getprogname()); - leave(EXIT_FAILURE); - } - if (strcmp(opt_arg,":") == 0) { - xmlnsprefix = ""; - } else { - xmlnsprefix = opt_arg; - } - break; - /** end XML parameters **/ - - /** begin subsetting parameters **/ - case 's': - case 'S': - case 'c': - case 'k': { - struct subset_t *s; - - if (!last_was_dset) { - error_msg("option `-%c' can only be used after --dataset option\n", - opt); - leave(EXIT_FAILURE); - } - - if (last_dset->subset_info) { - /* - * This overrides the "terse" syntax if they actually mixed - * the two. - */ - s = last_dset->subset_info; - } else { - last_dset->subset_info = s = (struct subset_t *)calloc(1, sizeof(struct subset_t)); - } - - /* - * slightly convoluted, but...we are only interested in options - * for subsetting: "--start", "--stride", "--count", and "--block" - * which can come in any order. If we run out of parameters (EOF) - * or run into one which isn't a subsetting parameter (NOT s, S, - * c, or K), then we exit the do-while look, set the subset_info - * to the structure we've been filling. If we've reached the end - * of the options, we exit the parsing (goto parse_end) otherwise, - * since we've "read" the next option, we need to parse it. So we - * jump to the beginning of the switch statement (goto parse_start). - */ - do { - switch ((char)opt) { - case 's': if(s->start.data) free(s->start.data); parse_hsize_list(opt_arg, &s->start); break; - case 'S': if(s->stride.data) free(s->stride.data); parse_hsize_list(opt_arg, &s->stride); break; - case 'c': if(s->count.data) free(s->count.data); parse_hsize_list(opt_arg, &s->count); break; - case 'k': if(s->block.data) free(s->block.data); parse_hsize_list(opt_arg, &s->block); break; - default: goto end_collect; - } - } while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF); - -end_collect: - last_was_dset = FALSE; - - if (opt != EOF) - goto parse_start; - else - goto parse_end; - } - /** end subsetting parameters **/ - - case 'E': - enable_error_stack = TRUE; - break; - case 'h': - usage(h5tools_getprogname()); - leave(EXIT_SUCCESS); - case '?': - default: - usage(h5tools_getprogname()); - leave(EXIT_FAILURE); - } - } - -parse_end: - /* check for file name to be processed */ - if (argc <= opt_ind) { - error_msg("missing file name\n"); - usage(h5tools_getprogname()); - leave(EXIT_FAILURE); - } - return hand; -} - - -/*------------------------------------------------------------------------- - * Function: free_handler - * - * Purpose: Convenience function to free the handler_t structures. Needs a - * length variable (LEN) to know how many in the array it needs - * to free - * - * Return: Nothing - * - * Programmer: Bill Wendling - * Tuesday, 20. February 2001 - * - * Modifications: - * - *------------------------------------------------------------------------- - */ -static void -free_handler(struct handler_t *hand, int len) -{ - register int i; - - for (i = 0; i < len; i++) { - free(hand[i].obj); - - if (hand[i].subset_info) { - free(hand[i].subset_info->start.data); - free(hand[i].subset_info->stride.data); - free(hand[i].subset_info->count.data); - free(hand[i].subset_info->block.data); - free(hand[i].subset_info); - } - } - - free(hand); -} - -/*------------------------------------------------------------------------- - * Function: main - * - * Purpose: HDF5 dumper - * - * Return: Success: 0 - * Failure: 1 - * - * Programmer: Ruey-Hsia Li - * - * Modifications: - * Albert Cheng - * 30. September 2000 - * Add the -o option--output file for datasets raw data - * - * REMcG - * November 2000 - * Changes to support XML. - * - * Bill Wendling - * Wednesday, 10. January 2001 - * Modified the way command line parameters are interpreted. They go - * through one function call now (get_option). - * - * Bill Wendling - * Tuesday, 20. February 2001 - * Moved command line parsing to separate function. Made various - * "display_*" flags global. - * - * REMcG - * August 2003 - * Major upgrade to XML support. - * - * Pedro Vicente - * September 2007 - * list objects in requested order (creation order or alphabetically) - * - *------------------------------------------------------------------------- - */ -int -main(int argc, const char *argv[]) -{ - hid_t fid, gid; - char *fname = NULL; - void *edata; - H5E_auto2_t func; - H5O_info_t oi; - struct handler_t *hand; - int i; - unsigned u; - - h5tools_setprogname(PROGRAMNAME); - h5tools_setstatus(EXIT_SUCCESS); - dump_header_format = &standardformat; - dump_function_table = &ddl_function_table; - - /* Disable error reporting */ - H5Eget_auto2(H5E_DEFAULT, &func, &edata); - H5Eset_auto2(H5E_DEFAULT, NULL, NULL); - - /* Initialize h5tools lib */ - h5tools_init(); - hand = parse_command_line(argc, argv); - - if (bin_output && outfname == NULL) { - error_msg("binary output requires a file name, use -o \n"); - leave(EXIT_FAILURE); - } - - if (enable_error_stack) - H5Eset_auto2(H5E_DEFAULT, func, edata); - - /* Check for conflicting options */ - if (doxml) { - if (!display_all) { - error_msg("option \"%s\" not available for XML\n", - "to display selected objects"); - leave(EXIT_FAILURE); - } else if (display_bb) { - error_msg("option \"%s\" not available for XML\n", - "--boot-block"); - leave(EXIT_FAILURE); - } else if (display_oid == 1) { - error_msg("option \"%s\" not available for XML\n", - "--object-ids"); - leave(EXIT_FAILURE); - } else if (display_char == TRUE) { - error_msg("option \"%s\" not available for XML\n", - "--string"); - leave(EXIT_FAILURE); - } else if (usingdasho) { - error_msg("option \"%s\" not available for XML\n", - "--output"); - leave(EXIT_FAILURE); - } - } else { - if (xml_dtd_uri) { - warn_msg("option \"%s\" only applies with XML: %s\n", - "--xml-dtd", xml_dtd_uri); - } - } - - if (argc <= opt_ind) { - error_msg("missing file name\n"); - usage(h5tools_getprogname()); - leave(EXIT_FAILURE); - } - fname = HDstrdup(argv[opt_ind]); - - fid = h5tools_fopen(fname, H5F_ACC_RDONLY, H5P_DEFAULT, driver, NULL, 0); - - if (fid < 0) { - error_msg("unable to open file \"%s\"\n", fname); - leave(EXIT_FAILURE); - } - - /* allocate and initialize internal data structure */ - init_prefix(&prefix, prefix_len); - - /* Prepare to find objects that might be targets of a reference */ - fill_ref_path_table(fid); - - if(doxml) { - /* initialize XML */ - - /* reset prefix! */ - HDstrcpy(prefix, ""); - - /* make sure the URI is initialized to something */ - if (xml_dtd_uri == NULL) { - if (useschema) { - xml_dtd_uri = DEFAULT_XSD; - } else { - xml_dtd_uri = DEFAULT_DTD; - xmlnsprefix = ""; - } - } else { - if (useschema && strcmp(xmlnsprefix,"")) { - error_msg("Cannot set Schema URL for a qualified namespace--use -X or -U option with -D \n"); - leave(EXIT_FAILURE); - } - } - } - - - /* Get object info for root group */ - if(H5Oget_info_by_name(fid, "/", &oi, H5P_DEFAULT) < 0) { - error_msg("internal error (file %s:line %d)\n", __FILE__, __LINE__); - h5tools_setstatus(EXIT_FAILURE); - goto done; - } - - /* Initialize object tables */ - if(table_list_add(fid, oi.fileno) < 0) { - error_msg("internal error (file %s:line %d)\n", __FILE__, __LINE__); - h5tools_setstatus(EXIT_FAILURE); - goto done; - } - group_table = table_list.tables[0].group_table; - dset_table = table_list.tables[0].dset_table; - type_table = table_list.tables[0].type_table; - - /* does there exist unamed committed datatype */ - for (u = 0; u < type_table->nobjs; u++) - if (!type_table->objs[u].recorded) { - unamedtype = 1; - break; - } /* end if */ - - /* start to dump - display file header information */ - if (!doxml) { - begin_obj(dump_header_format->filebegin, fname, - dump_header_format->fileblockbegin); - } else { - printf("\n"); - - /* alternative first element, depending on schema or DTD. */ - if (useschema) { - if (strcmp(xmlnsprefix,"") == 0) { - printf("\n", - xml_dtd_uri); - } else { -/* TO DO: make -url option work in this case (may need new option) */ - char * ns; - char *indx; - - ns = HDstrdup(xmlnsprefix); - indx = strrchr(ns,(int)':'); - if (indx) *indx = '\0'; - - 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/HDF5-File " - "http://www.hdfgroup.org/DTDs/HDF5-File.xsd\">\n",xmlnsprefix,ns); - HDfree(ns); - } - } else { - printf("\n", - xml_dtd_uri); - printf("\n"); - } - } - - if (!doxml) { - if (display_fi) { - dump_fcontents(fid); - end_obj(dump_header_format->fileend,dump_header_format->fileblockend); - goto done; - } - - if (display_bb) - dump_fcpl(fid); - } - - if(display_all) - { - if((gid = H5Gopen2(fid, "/", H5P_DEFAULT)) < 0) - { - error_msg("unable to open root group\n"); - h5tools_setstatus(EXIT_FAILURE); - } - else - { - - dump_function_table->dump_group_function(gid, "/" ); - - } - - if(H5Gclose(gid) < 0) - { - error_msg("unable to close root group\n"); - h5tools_setstatus(EXIT_FAILURE); - } - - - } - else - { - /* Note: this option is not supported for XML */ - if(doxml) { - error_msg("internal error (file %s:line %d)\n", __FILE__, __LINE__); - h5tools_setstatus(EXIT_FAILURE); - goto done; - } /* end if */ - - for(i = 0; i < argc; i++) - if(hand[i].func) - hand[i].func(fid, hand[i].obj, hand[i].subset_info, 1, NULL); - } - - if (!doxml) { - end_obj(dump_header_format->fileend, dump_header_format->fileblockend); - } else { - printf("\n", xmlnsprefix); - } - -done: - /* Free tables for objects */ - table_list_free(); - - if (H5Fclose(fid) < 0) - h5tools_setstatus(EXIT_FAILURE); - - free_handler(hand, argc); - - HDfree(prefix); - HDfree(fname); - - /* To Do: clean up XML table */ - - H5Eset_auto2(H5E_DEFAULT, func, edata); - - leave(h5tools_getstatus()); -} - -/*------------------------------------------------------------------------- - * Function: print_enum - * - * Purpose: prints the enum data - * - * Return: void - * - * Programmer: Patrick Lu - * - * Modifications: - * - * NOTE: this function was taken from h5ls. should be moved into the toolslib - * - *-----------------------------------------------------------------------*/ -static void -print_enum(hid_t type) -{ - char **name = NULL; /*member names */ - unsigned char *value = NULL; /*value array */ - unsigned char *copy = NULL; /*a pointer to value array */ - unsigned nmembs; /*number of members */ - int nchars; /*number of output characters */ - hid_t super; /*enum base integer type */ - hid_t native = -1; /*native integer datatype */ - size_t dst_size; /*destination value type size */ - unsigned i; - - nmembs = (unsigned)H5Tget_nmembers(type); - super = H5Tget_super(type); - - /* - * Determine what datatype to use for the native values. To simplify - * things we entertain three possibilities: - * 1. long long -- the largest native signed integer - * 2. unsigned long long -- the largest native unsigned integer - * 3. raw format - */ - if(H5Tget_size(type) <= sizeof(long long)) { - dst_size = sizeof(long long); - - if(H5T_SGN_NONE == H5Tget_sign(type)) - native = H5T_NATIVE_ULLONG; - else - native = H5T_NATIVE_LLONG; - } /* end if */ - else - dst_size = H5Tget_size(type); - - /* Get the names and raw values of all members */ - name = (char **)calloc(nmembs, sizeof(char *)); - value = (unsigned char *)calloc(nmembs, MAX(H5Tget_size(type), dst_size)); - - for (i = 0; i < nmembs; i++) { - name[i] = H5Tget_member_name(type, i); - H5Tget_member_value(type, i, value + i * H5Tget_size(type)); - } - - /* Convert values to native datatype */ - if (native > 0) - H5Tconvert(super, native, nmembs, value, NULL, H5P_DEFAULT); - - /* - * Sort members by increasing value - * ***not implemented yet*** - */ - - /* Print members */ - for (i = 0; i < nmembs; i++) { - indentation(indent + COL); - nchars = printf("\"%s\"", name[i]); - printf("%*s ", MAX(0, 16 - nchars), ""); - - if (native < 0) { - size_t j; - - printf("0x"); - - for (j = 0; j < dst_size; j++) - printf("%02x", value[i * dst_size + j]); - } else 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; - HDfprintf(stdout,"%" H5_PRINTF_LL_WIDTH "u", *((unsigned long long *) - ((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; - HDfprintf(stdout,"%" H5_PRINTF_LL_WIDTH "d", - *((long long *) ((void *)copy))); - } - - printf(";\n"); - } - - /* Release resources */ - for (i = 0; i < nmembs; i++) - free(name[i]); - - free(name); - free(value); - H5Tclose(super); - - if (0 == nmembs) - printf("\n%*s ", indent + 4, ""); -} - - -/* - * create a string suitable for and XML NCNAME. Uses the - * object reference to create the string. - * - * 'gen'; 0 - return null if not found - * 1 - generate a fake entry and return fake id. - */ - -int -xml_name_to_XID(const char *str , char *outstr, int outlen, int gen) -{ - haddr_t objno; /* Object ID for object at path */ - - if (outlen < 22) return 1; - - objno = ref_path_table_lookup(str); - if (objno == HADDR_UNDEF) { - if (HDstrlen(str) == 0) { - objno = ref_path_table_lookup("/"); - if (objno == HADDR_UNDEF) { - if (gen) { - objno = ref_path_table_gen_fake(str); - sprintf(outstr, "xid_"H5_PRINTF_HADDR_FMT, objno); - return 0; - } else { - return 1; - } - } - } else { - if (gen) { - objno = ref_path_table_gen_fake(str); - sprintf(outstr, "xid_"H5_PRINTF_HADDR_FMT, objno); - return 0; - } else { - return 1; - } - } - } - - sprintf(outstr, "xid_"H5_PRINTF_HADDR_FMT, objno); - - return(0); -} - -static const char *quote = """; -static const char *amp = "&"; -static const char *lt = "<"; -static const char *gt = ">"; -static const char *apos = "'"; - -/*------------------------------------------------------------------------- - * Function: xml_escape_the_name - * - * Purpose: Escape XML reserved chars in a name, so HDF5 strings - * and paths can be correctly read back in XML element. - * - * Return: The revised string. - * - * Programmer: REMcG - * - * Modifications: - * - *------------------------------------------------------------------------- - */ -static char * -xml_escape_the_name(const char *str) -{ - size_t extra; - size_t len; - size_t i; - const char *cp; - char *ncp; - char *rcp; - - if (!str) - return NULL; - - cp = str; - len = strlen(str); - extra = 0; - - for (i = 0; i < len; i++) { - if (*cp == '\"') { - extra += (strlen(quote) - 1); - } else if (*cp == '\'') { - extra += (strlen(apos) - 1); - } else if (*cp == '<') { - extra += (strlen(lt) - 1); - } else if (*cp == '>') { - extra += (strlen(gt) - 1); - } else if (*cp == '&') { - extra += (strlen(amp) - 1); - } - - cp++; - } - - if (extra == 0) - return HDstrdup(str); - - cp = str; - rcp = ncp = (char *)HDmalloc(len + extra + 1); - - if (!ncp) - return NULL; /* ?? */ - - for (i = 0; i < len; i++) { - if (*cp == '\'') { - strncpy(ncp, apos, strlen(apos)); - ncp += strlen(apos); - cp++; - } else if (*cp == '<') { - strncpy(ncp, lt, strlen(lt)); - ncp += strlen(lt); - cp++; - } else if (*cp == '>') { - strncpy(ncp, gt, strlen(gt)); - ncp += strlen(gt); - cp++; - } else if (*cp == '\"') { - strncpy(ncp, quote, strlen(quote)); - ncp += strlen(quote); - cp++; - } else if (*cp == '&') { - strncpy(ncp, amp, strlen(amp)); - ncp += strlen(amp); - cp++; - } else { - *ncp++ = *cp++; - } - } - - *ncp = '\0'; - return rcp; -} - -/*------------------------------------------------------------------------- - * Function: xml_escape_the_string - * - * Purpose: Escape XML reserved chars in a string, so HDF5 strings - * and paths can be correctly read back in XML CDATA. - * - * Return: The revised string. - * - * Programmer: REMcG - * - * Modifications: - * - *------------------------------------------------------------------------- - */ -static char * -xml_escape_the_string(const char *str, int slen) -{ - size_t extra; - size_t len; - size_t i; - const char *cp; - char *ncp; - char *rcp; - - if (!str) - return NULL; - - cp = str; - - if (slen < 0) - len = strlen(str); - else - len = slen; - - extra = 0; - - for (i = 0; i < len; i++) { - if (*cp == '\\') { - extra++; - } else if (*cp == '\"') { - extra++; - } else if (*cp == '\'') { - extra += (strlen(apos) - 1); - } else if (*cp == '<') { - extra += (strlen(lt) - 1); - } else if (*cp == '>') { - extra += (strlen(gt) - 1); - } else if (*cp == '&') { - extra += (strlen(amp) - 1); - } - cp++; - } - - cp = str; - rcp = ncp = (char *)calloc((len + extra + 1), sizeof(char)); - - if (ncp == NULL) - return NULL; /* ?? */ - - for (i = 0; i < len; i++) { - if (*cp == '\\') { - *ncp++ = '\\'; - *ncp++ = *cp++; - } else if (*cp == '\"') { - *ncp++ = '\\'; - *ncp++ = *cp++; - } else if (*cp == '\'') { - strncpy(ncp, apos, strlen(apos)); - ncp += strlen(apos); - cp++; - } else if (*cp == '<') { - strncpy(ncp, lt, strlen(lt)); - ncp += strlen(lt); - cp++; - } else if (*cp == '>') { - strncpy(ncp, gt, strlen(gt)); - ncp += strlen(gt); - cp++; - } else if (*cp == '&') { - strncpy(ncp, amp, strlen(amp)); - ncp += strlen(amp); - cp++; - } else { - *ncp++ = *cp++; - } - } - - *ncp = '\0'; - return rcp; -} - -/** - ** XML print functions--these replace some functions in the - ** h5tools.c suite. - **/ - -/*------------------------------------------------------------------------- - * Function: xml_print_datatype - * - * Purpose: Print description of a datatype in XML. - * Note: this is called inside a element. - * - * Return: void - * - * Programmer: REMcG - * - * Modifications: - * - *------------------------------------------------------------------------- - */ -static void -xml_print_datatype(hid_t type, unsigned in_group) -{ - char *mname; - hid_t mtype; - unsigned nmembers; - unsigned ndims; - unsigned i; - size_t size; - hsize_t dims[H5DUMP_MAX_RANK]; - H5T_str_t str_pad; - H5T_cset_t cset; - hid_t super; - H5T_order_t ord; - H5T_sign_t sgn; - size_t sz; - size_t spos; - size_t epos; - size_t esize; - size_t mpos; - size_t msize; - int nmembs; - htri_t is_vlstr=FALSE; - - if(!in_group && H5Tcommitted(type) > 0) { - H5O_info_t oinfo; - obj_t *found_obj; /* Found object */ - - /* detect a shared datatype, output only once */ - H5Oget_info(type, &oinfo); - found_obj = search_obj(type_table, oinfo.addr); - - if(found_obj) { - /* This should be defined somewhere else */ - /* These 2 cases are handled the same right now, but - probably will have something different eventually */ - char * dtxid = (char *)malloc(100); - - xml_name_to_XID(found_obj->objname, dtxid, 100, 1); - if (!found_obj->recorded) { - /* 'anonymous' NDT. Use it's object num. - as it's name. */ - printf("<%sNamedDataTypePtr OBJ-XID=\"/%s\"/>\n", - xmlnsprefix, dtxid); - } else { - /* point to the NDT by name */ - char *t_objname = xml_escape_the_name(found_obj->objname); - - printf("<%sNamedDataTypePtr OBJ-XID=\"%s\" H5Path=\"%s\"/>\n", - xmlnsprefix, dtxid, t_objname); - free(t_objname); - } - free(dtxid); - } else { - printf("\n"); - h5tools_setstatus(EXIT_FAILURE); - } - } else { - - switch (H5Tget_class(type)) { - case H5T_INTEGER: - indentation(indent); - printf("<%sAtomicType>\n",xmlnsprefix); - indent += COL; - /* */ - ord = H5Tget_order(type); - sgn = H5Tget_sign(type); - indentation(indent); - printf("<%sIntegerType ByteOrder=\"",xmlnsprefix); - switch (ord) { - case H5T_ORDER_LE: - printf("LE"); - break; - case H5T_ORDER_BE: - printf("BE"); - break; - case H5T_ORDER_VAX: - default: - printf("ERROR_UNKNOWN"); - } - printf("\" Sign=\""); - switch (sgn) { - case H5T_SGN_NONE: - printf("false"); - break; - case H5T_SGN_2: - printf("true"); - break; - default: - printf("ERROR_UNKNOWN"); - } - printf("\" Size=\""); - sz = H5Tget_size(type); - printf("%lu", (unsigned long)sz); - printf("\" />\n"); - indent -= COL; - indentation(indent); - printf("\n",xmlnsprefix); - break; - - case H5T_FLOAT: - /* */ - ord = H5Tget_order(type); - indentation(indent); - printf("<%sAtomicType>\n",xmlnsprefix); - indent += COL; - indentation(indent); - printf("<%sFloatType ByteOrder=\"",xmlnsprefix); - switch (ord) { - case H5T_ORDER_LE: - printf("LE"); - break; - case H5T_ORDER_BE: - printf("BE"); - break; - case H5T_ORDER_VAX: - printf("VAX"); - break; - default: - printf("ERROR_UNKNOWN"); - } - printf("\" Size=\""); - sz = H5Tget_size(type); - printf("%lu", (unsigned long)sz); - H5Tget_fields(type, &spos, &epos, &esize, &mpos, &msize); - printf("\" SignBitLocation=\"%lu\" ", (unsigned long)spos); - printf("ExponentBits=\"%lu\" ExponentLocation=\"%lu\" ", (unsigned long)esize, (unsigned long)epos); - printf("MantissaBits=\"%lu\" MantissaLocation=\"%lu\" />\n", - (unsigned long)msize, (unsigned long)mpos); - indent -= COL; - indentation(indent); - printf("\n",xmlnsprefix); - break; - - case H5T_TIME: - indentation(indent); - printf("<%sAtomicType>\n",xmlnsprefix); - indent += COL; - indentation(indent); - printf("<%sTimeType />\n",xmlnsprefix); - printf(""); - indent -= COL; - indentation(indent); - printf("\n",xmlnsprefix); - break; - - case H5T_STRING: - /* */ - size = H5Tget_size(type); - str_pad = H5Tget_strpad(type); - cset = H5Tget_cset(type); - is_vlstr = H5Tis_variable_str(type); - - indentation(indent); - printf("<%sAtomicType>\n",xmlnsprefix); - indent += COL; - indentation(indent); - printf("<%sStringType Cset=\"",xmlnsprefix); - if (cset == H5T_CSET_ASCII) { - printf("H5T_CSET_ASCII\" "); - } else { - printf("unknown_cset\" "); - } - if(is_vlstr) - printf("StrSize=\"H5T_VARIABLE\" StrPad=\""); - else - printf("StrSize=\"%d\" StrPad=\"", (int) size); - if (str_pad == H5T_STR_NULLTERM) { - printf("H5T_STR_NULLTERM\"/>\n"); - } else if (str_pad == H5T_STR_NULLPAD) { - printf("H5T_STR_NULLPAD\"/>\n"); - } else if (str_pad == H5T_STR_SPACEPAD) { - printf("H5T_STR_SPACEPAD\"/>\n"); - } else { - printf("H5T_STR_ERROR\"/>\n"); - } - indent -= COL; - indentation(indent); - printf("\n",xmlnsprefix); - break; - - case H5T_BITFIELD: - /* */ - ord = H5Tget_order(type); - indentation(indent); - printf("<%sAtomicType>\n",xmlnsprefix); - indent += COL; - indentation(indent); - printf("<%sBitfieldType ByteOrder=\"",xmlnsprefix); - switch (ord) { - case H5T_ORDER_LE: - printf("LE"); - break; - case H5T_ORDER_BE: - printf("BE"); - break; - case H5T_ORDER_VAX: - default: - printf("ERROR_UNKNOWN"); - } - size = H5Tget_size(type); - printf("\" Size=\"%lu\"/>\n", (unsigned long)size); - indent -= COL; - indentation(indent); - printf("\n",xmlnsprefix); - break; - - case H5T_OPAQUE: - /* */ - indentation(indent); - printf("<%sAtomicType>\n",xmlnsprefix); - indent += COL; - indentation(indent); - mname = H5Tget_tag(type); - printf("<%sOpaqueType Tag=\"%s\" ",xmlnsprefix, mname); - free(mname); - size = H5Tget_size(type); - printf("Size=\"%lu\"/>\n", (unsigned long)size); - indent -= COL; - indentation(indent); - printf("\n",xmlnsprefix); - break; - - case H5T_COMPOUND: - /* recursively describe the components of a compound datatype */ - - /* type of a dataset */ - nmembers = H5Tget_nmembers(type); - - indentation(indent); - printf("<%sCompoundType>\n",xmlnsprefix); - - /* List each member Field of the type */ - /* */ - /* */ - indent += COL; - for (i = 0; i < nmembers; i++) { - char *t_fname; - - mname = H5Tget_member_name(type, i); - mtype = H5Tget_member_type(type, i); - indentation(indent); - t_fname = xml_escape_the_name(mname); - printf("<%sField FieldName=\"%s\">\n",xmlnsprefix, t_fname); - - free(mname); - free(t_fname); - indent += COL; - indentation(indent); - printf("<%sDataType>\n",xmlnsprefix); - indent += COL; - xml_print_datatype(mtype,0); - indent -= COL; - indentation(indent); - printf("\n",xmlnsprefix); - indent -= COL; - - indentation(indent); - printf("\n",xmlnsprefix); - } - indent -= COL; - indentation(indent); - printf("\n",xmlnsprefix); - break; - - case H5T_REFERENCE: - indentation(indent); - printf("<%sAtomicType>\n",xmlnsprefix); - indent += COL; - indentation(indent); - /* Only Object references supported at this time */ - printf("<%sReferenceType>\n",xmlnsprefix); - indentation(indent + COL); - printf("<%sObjectReferenceType />\n",xmlnsprefix); - indentation(indent); - printf("\n",xmlnsprefix); - indent -= COL; - indentation(indent); - printf("\n",xmlnsprefix); - break; - - case H5T_ENUM: - /* - list Name, values of enum - */ - nmembs = H5Tget_nmembers(type); - indentation(indent); - printf("<%sAtomicType>\n",xmlnsprefix); - indent += COL; - indentation(indent); - printf("<%sEnumType Nelems=\"%d\">\n",xmlnsprefix, nmembs); - xml_print_enum(type); - indentation(indent); - printf("\n",xmlnsprefix); - indent -= COL; - indentation(indent); - printf("\n",xmlnsprefix); - break; - - case H5T_VLEN: - indentation(indent); - printf("<%sVLType>\n",xmlnsprefix); - super = H5Tget_super(type); - indent += COL; - indentation(indent); - printf("<%sDataType>\n",xmlnsprefix); - indent += COL; - xml_print_datatype(super,0); - indent -= COL; - indentation(indent); - printf("\n",xmlnsprefix); - indent -= COL; - indentation(indent); - printf("\n",xmlnsprefix); - H5Tclose(super); - - break; - - case H5T_ARRAY: - /* Get array base type */ - super = H5Tget_super(type); - - /* Print lead-in */ - indentation(indent); - printf("<%sArrayType Ndims=\"",xmlnsprefix); - ndims = H5Tget_array_ndims(type); - printf("%u\">\n", ndims); - - /* Get array information */ - H5Tget_array_dims2(type, dims); - - /* list of dimensions */ - indent += COL; - for (i = 0; i < ndims; i++) { - indentation(indent); - printf("<%sArrayDimension DimSize=\"%u\"/>\n", - xmlnsprefix, - (int) dims[i]); - } - indent -= COL; - - indent += COL; - indentation(indent); - printf("<%sDataType>\n",xmlnsprefix); - indent += COL; - xml_print_datatype(super,0); - indent -= COL; - indentation(indent); - printf("\n",xmlnsprefix); - indent -= COL; - indentation(indent); - printf("\n",xmlnsprefix); - /* Close array base type */ - H5Tclose(super); - break; - - default: - printf(""); - h5tools_setstatus(EXIT_FAILURE); - break; - } - } /* end else */ -} - -/*------------------------------------------------------------------------- - * Function: xml_dump_datatype - * - * Purpose: Dump description of a datatype in XML. - * - * Return: void - * - * Programmer: REMcG - * - * Modifications: - * - *------------------------------------------------------------------------- - */ -static void -xml_dump_datatype(hid_t type) -{ - - indent += COL; - indentation(indent); - - if(H5Tcommitted(type) > 0) { - H5O_info_t oinfo; - obj_t *found_obj; /* Found object */ - - /* Datatype is a shared or named datatype */ - H5Oget_info(type, &oinfo); - found_obj = search_obj(type_table, oinfo.addr); - - if(found_obj) { - /* Shared datatype, must be entered as an object */ - /* These 2 cases are the same now, but may change */ - char * dtxid = (char *)malloc(100); - - xml_name_to_XID(found_obj->objname, dtxid, 100, 1); - if (!found_obj->recorded) { - /* anonymous stored datatype: - following the dumper's current - practice: - use it's object ref as its name - */ - printf("<%sNamedDataTypePtr OBJ-XID=\"%s\"/>\n", - xmlnsprefix, dtxid); - } else { - /* pointer to a named datatype already in XML */ - char *t_objname = xml_escape_the_name(found_obj->objname); - - printf("<%sNamedDataTypePtr OBJ-XID=\"%s\" H5Path=\"%s\" />\n", - xmlnsprefix, dtxid, t_objname); - free(t_objname); - } - free(dtxid); - } else { - printf("\n"); - } - indent -= COL; + /* no arguments */ + if (argc == 1) { + usage(h5tools_getprogname()); + goto error; } - else { - printf("<%sDataType>\n", xmlnsprefix); - indent += COL; - xml_print_datatype(type, 0); - indent -= COL; - indentation(indent); - printf("\n", xmlnsprefix); - indent -= COL; + + /* this will be plenty big enough to hold the info */ + if((hand = (struct handler_t *)HDcalloc((size_t)argc, sizeof(struct handler_t)))==NULL) { + goto error; } -} -/*------------------------------------------------------------------------- - * Function: xml_dump_dataspace - * - * Purpose: Dump description of a dataspace in XML. - * - * Return: void - * - * Programmer: REMcG - * - * Modifications: - * - *------------------------------------------------------------------------- - */ -static void -xml_dump_dataspace(hid_t space) -{ - hsize_t size[H5DUMP_MAX_RANK]; - hsize_t maxsize[H5DUMP_MAX_RANK]; - int ndims = - H5Sget_simple_extent_dims(space, size, maxsize); - H5S_class_t space_type = H5Sget_simple_extent_type(space); - int i; - - indentation(indent + COL); - printf("<%sDataspace>\n", xmlnsprefix); - indentation(indent + COL + COL); - - switch (space_type) { - case H5S_SCALAR: - /* scalar dataspace (just a tag, no XML attrs. defined */ - printf("<%sScalarDataspace />\n",xmlnsprefix); + /* parse command line options */ + while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) { +parse_start: + switch ((char)opt) { + case 'R': + display_region = TRUE; + region_output = TRUE; break; - - case H5S_SIMPLE: - /* simple dataspace */ - /* */ - printf("<%sSimpleDataspace Ndims=\"%d\">\n",xmlnsprefix, ndims); - - /* print the elements */ - for (i = 0; i < ndims; i++) { - indentation(indent + COL + COL + COL); - if (maxsize[i] == H5S_UNLIMITED) { - HDfprintf(stdout, - "<%sDimension DimSize=\"%Hu\" MaxDimSize=\"UNLIMITED\"/>\n", - xmlnsprefix,size[i]); - } else if (maxsize[i] == (hsize_t) 0) { - HDfprintf(stdout, - "<%sDimension DimSize=\"%Hu\" MaxDimSize=\"%Hu\"/>\n", - xmlnsprefix,size[i], size[i]); - } else { - HDfprintf(stdout, - "<%sDimension DimSize=\"%Hu\" MaxDimSize=\"%Hu\"/>\n", - xmlnsprefix, size[i], maxsize[i]); - } - } - indentation(indent + COL + COL); - printf("\n", xmlnsprefix ); + case 'B': + display_bb = TRUE; + last_was_dset = FALSE; break; - -#ifdef TMP - /* Commented out: wait until the schema is updated first */ - case H5S_NULL: - /* null dataspace (just a tag, no XML attrs. defined */ - printf("<%sNullDataspace />\n",xmlnsprefix); + case 'n': + display_fi = TRUE; + last_was_dset = FALSE; break; -#endif /* TMP */ - - case H5S_NO_CLASS: - default: - printf("\n"); - } - - indentation(indent + COL); - printf("\n", xmlnsprefix); -} - -/*------------------------------------------------------------------------- - * Function: xml_dump_data - * - * Purpose: Dump description of data in XML. - * Note that this calls the h5dump_xxx calls in - * the h5tools library. - * - * Return: void - * - * Programmer: REMcG - * - * Modifications: - * - *------------------------------------------------------------------------- - */ -static void -xml_dump_data(hid_t obj_id, int obj_data, struct subset_t UNUSED * sset, int UNUSED pindex) -{ - h5tool_format_t *outputformat = &xml_dataformat; - int status = -1; - void *buf; - hid_t space, type, p_type; - int ndims, i; - hsize_t size[64], nelmts = 1; - int depth; - int stdindent = COL; /* should be 3 */ - - if (fp_format) - { - outputformat->fmt_double = fp_format; - outputformat->fmt_float = fp_format; - } - - if (nCols==0) { - outputformat->line_ncols = 65535; - outputformat->line_per_line = 1; - } - else - outputformat->line_ncols = nCols; - indent += COL; - - /* - * the depth will tell us how far we need to indent extra. we use to just - * use indent but with the merging of the tools lib we have to do - * something different for the lib funtions... the normal indentation is 6 - * so when we don't need any extra indentation, depth will be 0. - */ - depth = indent / stdindent + 1; - - /* Print all the values. */ - indentation(indent); - printf("<%sData>\n", xmlnsprefix); - indentation(indent + COL); - printf("<%sDataFromFile>\n",xmlnsprefix); - if (obj_data == DATASET_DATA) { - type = H5Dget_type(obj_id); - if (H5Tget_class(type) == H5T_REFERENCE) { - status = xml_print_refs(obj_id, DATASET_DATA); - } else if (H5Tget_class(type) == H5T_STRING) { - status = xml_print_strs(obj_id, DATASET_DATA); - } else { - status = h5tools_dump_dset(stdout, outputformat, obj_id, -1, NULL, depth); - } - } else { - /* Attribute data */ - type = H5Aget_type(obj_id); - - if (H5Tget_class(type) == H5T_REFERENCE) { - /* references are done differently than - the standard output: - XML dumps a path to the object - referenced. - */ - status = xml_print_refs(obj_id, ATTRIBUTE_DATA); - H5Tclose(type); - } else if (H5Tget_class(type) == H5T_STRING) { - status = xml_print_strs(obj_id, ATTRIBUTE_DATA); - } else { /* all other data */ - /* VL data special information */ - unsigned int vl_data = 0; /* contains VL datatypes */ - - p_type = h5tools_get_native_type(type); - - /* Check if we have VL data in the dataset's datatype */ - if (h5tools_detect_vlen(p_type) == TRUE) - vl_data = TRUE; - - H5Tclose(type); - - space = H5Aget_space(obj_id); - - ndims = H5Sget_simple_extent_dims(space, size, NULL); - - for (i = 0; i < ndims; i++) - nelmts *= size[i]; - - buf = malloc((size_t)(nelmts * MAX(H5Tget_size(type), H5Tget_size(p_type)))); - assert(buf); - - if (H5Aread(obj_id, p_type, buf) >= 0) - status = h5tools_dump_mem(stdout, outputformat, obj_id, - p_type, space, buf, depth); - - /* Reclaim any VL memory, if necessary */ - if (vl_data) - H5Dvlen_reclaim(p_type, space, H5P_DEFAULT, buf); - - free(buf); - H5Tclose(p_type); - H5Sclose(space); - H5Tclose(type); - } - } - - if (status == FAIL) { - indentation(indent + COL); - printf("Unable to print data.\n"); - status = 1; - } - - indentation(indent + COL); - printf("\n",xmlnsprefix); - indentation(indent); - printf("\n", xmlnsprefix); - indent -= COL; -} + case 'p': + display_dcpl = TRUE; + break; + case 'y': + display_ai = FALSE; + break; + case 'e': + display_escape = TRUE; + break; + case 'H': + display_data = FALSE; + display_attr_data = FALSE; + last_was_dset = FALSE; + break; + case 'A': + display_data = FALSE; + display_attr_data = TRUE; + last_was_dset = FALSE; + break; + case 'i': + display_oid = TRUE; + last_was_dset = FALSE; + break; + case 'r': + display_char = TRUE; + break; + case 'V': + print_version(h5tools_getprogname()); + free_handler(hand, argc); + hand = NULL; + h5tools_setstatus(EXIT_SUCCESS); + goto done; + break; + case 'w': + h5tools_nCols = HDatoi(opt_arg); + last_was_dset = FALSE; + break; + case 'a': + display_all = 0; -/*------------------------------------------------------------------------- - * Function: xml_dump_attr - * - * Purpose: Dump a description of an HDF5 attribute in XML. - * - * Return: herr_t - * - * Programmer: REMcG - * - * Modifications: - * - *------------------------------------------------------------------------- - */ -static herr_t -xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t UNUSED *info, - void UNUSED * op_data) -{ - hid_t attr_id, type, space; - H5S_class_t space_type; - char *t_aname = xml_escape_the_name(attr_name); - - indentation(indent); - printf("<%sAttribute Name=\"%s\">\n",xmlnsprefix, t_aname); - free(t_aname); - - if ((attr_id = H5Aopen(attr, attr_name, H5P_DEFAULT)) >= 0) { - type = H5Aget_type(attr_id); - space = H5Aget_space(attr_id); - space_type = H5Sget_simple_extent_type(space); - - dump_function_table->dump_dataspace_function(space); - dump_function_table->dump_datatype_function(type); - - if (display_attr_data && space_type!=H5S_NULL) { - switch (H5Tget_class(type)) { - case H5T_INTEGER: - case H5T_FLOAT: - case H5T_STRING: - case H5T_BITFIELD: - case H5T_OPAQUE: - case H5T_ENUM: - case H5T_ARRAY: - dump_function_table->dump_data_function(attr_id, ATTRIBUTE_DATA, NULL, 0); + for (i = 0; i < argc; i++) + if (!hand[i].func) { + hand[i].func = handle_attributes; + hand[i].obj = HDstrdup(opt_arg); break; + } - case H5T_TIME: - indent += COL; - indentation(indent); - printf("<%sData>\n",xmlnsprefix); - indentation(indent); - printf("\n"); - indentation(indent); - printf("<%sNoData/>\n",xmlnsprefix); - indentation(indent); - printf("\n"); - printf("\n",xmlnsprefix); - indent -= COL; - break; + last_was_dset = FALSE; + break; + case 'd': + display_all = 0; - case H5T_COMPOUND: - indentation(indent); - printf("\n"); - dump_function_table->dump_data_function(attr_id, ATTRIBUTE_DATA, NULL, 0); + for (i = 0; i < argc; i++) + if (!hand[i].func) { + hand[i].func = handle_datasets; + hand[i].obj = HDstrdup(opt_arg); + hand[i].subset_info = parse_subset_params(hand[i].obj); + last_dset = &hand[i]; break; + } - case H5T_REFERENCE: - indentation(indent); - printf("<%sData>\n",xmlnsprefix); - indentation(indent); - if (!H5Tequal(type, H5T_STD_REF_OBJ)) { - printf("\n"); - indentation(indent); - printf("<%sNoData />\n",xmlnsprefix); - } else { - printf("<%sDataFromFile>\n",xmlnsprefix); - xml_print_refs(attr_id, ATTRIBUTE_DATA); - indentation(indent); - printf("\n",xmlnsprefix); - } - indentation(indent); - printf("\n",xmlnsprefix); - break; + last_was_dset = TRUE; + break; + case 'f': + driver = opt_arg; + break; + case 'g': + display_all = 0; - case H5T_VLEN: - printf("\n"); - dump_function_table->dump_data_function(attr_id, ATTRIBUTE_DATA, NULL, 0); - break; - default: - indentation(indent); - printf("<%sData>\n",xmlnsprefix); - indentation(indent); - printf("\n", H5Tget_class(type)); - indentation(indent); - printf("<%sNoData/>\n",xmlnsprefix); - indentation(indent); - printf("\n",xmlnsprefix); + for (i = 0; i < argc; i++) + if (!hand[i].func) { + hand[i].func = handle_groups; + hand[i].obj = HDstrdup(opt_arg); break; - } - } else { - /* The case of an attribute never yet written ?? - * Or dataspace is H5S_NULL. */ - indentation(indent + COL); - printf("<%sData>\n",xmlnsprefix); - indentation(indent + COL + COL); - printf("<%sNoData/>\n",xmlnsprefix); - indentation(indent + COL); - printf("\n",xmlnsprefix); - } - - H5Tclose(type); - H5Sclose(space); - H5Aclose(attr_id); - indentation(indent); - printf("\n", xmlnsprefix ); - return SUCCEED; - - } else { - /* ?? failed */ - indentation(indent + COL); - printf("\n"); - indentation(indent); - printf("\n", xmlnsprefix ); - h5tools_setstatus(EXIT_FAILURE); - return FAIL; - } -} - -/*------------------------------------------------------------------------- - * Function: xml_dump_named_datatype - * - * Purpose: Dump a description of an HDF5 NDT in XML. - * - * Return: herr_t - * - * Programmer: REMcG - * - * Modifications: - * - *------------------------------------------------------------------------- - */ -static void -xml_dump_named_datatype(hid_t type, const char *name) -{ - char *tmp; - char * dtxid; - char * parentxid; - char *t_tmp; - char *t_prefix; - char *t_name; - - tmp = (char *)HDmalloc(HDstrlen(prefix) + HDstrlen(name) + 2); - HDstrcpy(tmp, prefix); - HDstrcat(tmp, "/"); - HDstrcat(tmp, name); - - indentation(indent); - dtxid = (char *)HDmalloc(100); - parentxid = (char *)HDmalloc(100); - t_tmp = xml_escape_the_name(tmp); - t_prefix = xml_escape_the_name(prefix); - t_name = xml_escape_the_name(name); - - xml_name_to_XID(tmp, dtxid, 100, 1); - xml_name_to_XID(prefix, parentxid, 100, 1); - if(HDstrncmp(name, "#", 1) == 0) { - /* Special: this is an 'anonymous' NDT, deleted but - still in use. - We follow the dumper's undocumented practice, and - use its object id as its name. - Exactly the same as normal, but a separate case - in the event we want to do something else in - the future. - */ - printf("<%sNamedDataType Name=\"%s\" OBJ-XID=\"%s\" " - "Parents=\"%s\" H5ParentPaths=\"%s\">\n", - xmlnsprefix, - name, dtxid, - parentxid, HDstrcmp(prefix,"") ? t_prefix : "/"); - } else { - H5O_info_t oinfo; /* Object info */ - - printf("<%sNamedDataType Name=\"%s\" OBJ-XID=\"%s\" " - "H5Path=\"%s\" Parents=\"%s\" H5ParentPaths=\"%s\">\n", - xmlnsprefix, - t_name, dtxid, - t_tmp, parentxid, (HDstrcmp(prefix, "") ? t_prefix : "/")); - - /* Check uniqueness of named datatype */ - H5Oget_info(type, &oinfo); - if(oinfo.rc > 1) { - obj_t *found_obj; /* Found object */ - - /* Group with more than one link to it... */ - found_obj = search_obj(type_table, oinfo.addr); - - if (found_obj == NULL) { - indentation(indent); - error_msg("internal error (file %s:line %d)\n", - __FILE__, __LINE__); - h5tools_setstatus(EXIT_FAILURE); - goto done; - } else if(found_obj->displayed) { - /* We have already printed this named datatype, print it as a - * NamedDatatypePtr - */ - char pointerxid[100]; - char *t_objname = xml_escape_the_name(found_obj->objname); - - indentation(indent + COL); - xml_name_to_XID(found_obj->objname, pointerxid, sizeof(pointerxid), 1); - printf("<%sNamedDatatypePtr OBJ-XID=\"%s\" H5Path=\"%s\"/>\n", - xmlnsprefix, pointerxid, t_objname); - indentation(indent); - printf("\n", xmlnsprefix); - HDfree(t_objname); - goto done; - } else - found_obj->displayed = TRUE; - } - } - - indent += COL; - indentation(indent); - printf("<%sDataType>\n",xmlnsprefix); - - indent += COL; - xml_print_datatype(type,1); - - indent -= COL; - indentation(indent); - printf("\n",xmlnsprefix); - - indent -= COL; - indentation(indent); - printf("\n",xmlnsprefix); - -done: - HDfree(dtxid); - HDfree(parentxid); - HDfree(t_tmp); - HDfree(t_prefix); - HDfree(t_name); - HDfree(tmp); -} - -/*------------------------------------------------------------------------- - * Function: xml_dump_group - * - * Purpose: Dump a description of an HDF5 Group (and its members) in XML. - * - * Return: void - * - * Programmer: REMcG - * - * Modifications: - * Pedro Vicente, October 9, 2007 - * added parameters to H5A(L)iterate to allow for other iteration orders - * - *------------------------------------------------------------------------- - */ -static void -xml_dump_group(hid_t gid, const char *name) -{ - H5O_info_t oinfo; - char *cp; - hid_t dset, type; - char type_name[1024], *tmp = NULL; - char *par = NULL; - int isRoot = 0; - char *t_objname; - char *par_name; - unsigned crt_order_flags; - unsigned attr_crt_order_flags; - hid_t gcpl_id; - - - if ((gcpl_id = H5Gget_create_plist(gid)) < 0) - { - error_msg("error in getting group creation property list ID\n"); - h5tools_setstatus(EXIT_FAILURE); - } - - /* query the group creation properties for attributes */ - if (H5Pget_attr_creation_order(gcpl_id, &attr_crt_order_flags) < 0) - { - error_msg("error in getting group creation properties\n"); - h5tools_setstatus(EXIT_FAILURE); - } - - /* query the group creation properties */ - if(H5Pget_link_creation_order(gcpl_id, &crt_order_flags) < 0) - { - error_msg("error in getting group creation properties\n"); - h5tools_setstatus(EXIT_FAILURE); - } - - if(H5Pclose(gcpl_id) < 0) { - error_msg("error in closing group creation property list ID\n"); - h5tools_setstatus(EXIT_FAILURE); - } + } - if(HDstrcmp(name, "/") == 0) { - isRoot = 1; - tmp = HDstrdup("/"); - } else { - tmp = (char *)HDmalloc(HDstrlen(prefix) + HDstrlen(name) + 2); - HDstrcpy(tmp, prefix); - par = HDstrdup(tmp); - cp = HDstrrchr(par, '/'); - if(cp) { - if((cp == par) && HDstrlen(par) > 1) - *(cp + 1) = '\0'; - else - *cp = '\0'; - } - } + last_was_dset = FALSE; + break; + case 'l': + display_all = 0; - indentation(indent); - indent += COL; + for (i = 0; i < argc; i++) + if (!hand[i].func) { + hand[i].func = handle_links; + hand[i].obj = HDstrdup(opt_arg); + break; + } - H5Oget_info(gid, &oinfo); + last_was_dset = FALSE; + break; + case 't': + display_all = 0; - if(oinfo.rc > 1) { - obj_t *found_obj; /* Found object */ + for (i = 0; i < argc; i++) + if (!hand[i].func) { + hand[i].func = handle_datatypes; + hand[i].obj = HDstrdup(opt_arg); + break; + } - /* Group with more than one link to it... */ - found_obj = search_obj(group_table, oinfo.addr); + last_was_dset = FALSE; + break; - if (found_obj == NULL) { - indentation(indent); - error_msg("internal error (file %s:line %d)\n", - __FILE__, __LINE__); - h5tools_setstatus(EXIT_FAILURE); - } else { - char *t_name = xml_escape_the_name(name); - char *grpxid = (char *)malloc(100); - char *parentxid = (char *)malloc(100); - - if(found_obj->displayed) { - char *ptrstr = (char *)malloc(100); - - /* already seen: enter a groupptr */ - if(isRoot) { - /* probably can't happen! */ - xml_name_to_XID("/", grpxid, 100, 1); - printf("<%sRootGroup OBJ-XID=\"%s\" H5Path=\"%s\">\n", - xmlnsprefix, grpxid, "/"); - } else { - t_objname = xml_escape_the_name(found_obj->objname); - par_name = xml_escape_the_name(par); - xml_name_to_XID(tmp, grpxid, 100, 1); - xml_name_to_XID(par, parentxid, 100, 1); - printf("<%sGroup Name=\"%s\" OBJ-XID=\"%s-%d\" H5Path=\"%s\" " - "Parents=\"%s\" H5ParentPaths=\"%s\">\n", - xmlnsprefix,t_name, grpxid, get_next_xid(), - t_objname, parentxid, par_name); - free(t_objname); - free(par_name); - - indentation(indent + COL); - t_objname = xml_escape_the_name(found_obj->objname);/* point to the NDT by name */ - par_name = xml_escape_the_name(par); - xml_name_to_XID(found_obj->objname, ptrstr, 100, 1); - xml_name_to_XID(par, parentxid, 100, 1); - printf("<%sGroupPtr OBJ-XID=\"%s\" H5Path=\"%s\" " - "Parents=\"%s\" H5ParentPaths=\"%s\" />\n", - xmlnsprefix, - ptrstr, t_objname, parentxid, par_name); - free(t_objname); - free(par_name); + case 'o': + if ( bin_output ) { + if (set_data_output_file(opt_arg, 1) < 0) { + usage(h5tools_getprogname()); + goto error; } - free(ptrstr); - } else { - - /* first time this group has been seen -- describe it */ - if(isRoot) { - xml_name_to_XID("/", grpxid, 100, 1); - printf("<%sRootGroup OBJ-XID=\"%s\" H5Path=\"%s\">\n", - xmlnsprefix, grpxid, "/"); - } else { - char *t_tmp = xml_escape_the_name(tmp); - - par_name = xml_escape_the_name(par); - xml_name_to_XID(tmp, grpxid, 100, 1); - xml_name_to_XID(par, parentxid, 100, 1); - printf("<%sGroup Name=\"%s\" OBJ-XID=\"%s\" H5Path=\"%s\" " - "Parents=\"%s\" H5ParentPaths=\"%s\" >\n", - xmlnsprefix,t_name, grpxid, t_tmp, parentxid, par_name); - free(t_tmp); - free(par_name); + } + else { + if (set_data_output_file(opt_arg, 0) < 0) { + usage(h5tools_getprogname()); + goto error; } - found_obj->displayed = TRUE; + } - /* 1. do all the attributes of the group */ + usingdasho = TRUE; + last_was_dset = FALSE; + outfname = opt_arg; + break; - if((sort_by == H5_INDEX_CRT_ORDER) && (attr_crt_order_flags & H5P_CRT_ORDER_TRACKED)) { - if(H5Aiterate2(gid, sort_by, sort_order, NULL, dump_function_table->dump_attribute_function, NULL) < 0) { - error_msg("error getting attribute information\n"); - h5tools_setstatus(EXIT_FAILURE); - } /* end if */ - } /* end if */ - else { - if(H5Aiterate2(gid, H5_INDEX_NAME, sort_order, NULL, dump_function_table->dump_attribute_function, NULL) < 0) { - error_msg("error getting attribute information\n"); - h5tools_setstatus(EXIT_FAILURE); - } /* end if */ - } /* end else */ - - if(isRoot && unamedtype) { - unsigned u; - - /* Very special case: dump unamed type in root group */ - for(u = 0; u < type_table->nobjs; u++) { - if(!type_table->objs[u].recorded) { - dset = H5Dopen2(gid, type_table->objs[u].objname, H5P_DEFAULT); - type = H5Dget_type(dset); - sprintf(type_name, "#"H5_PRINTF_HADDR_FMT, type_table->objs[u].objno); - dump_function_table->dump_named_datatype_function(type, type_name); - H5Tclose(type); - H5Dclose(dset); - } - } + case 'b': + if ( opt_arg != NULL) { + if ( ( bin_form = set_binary_form(opt_arg)) < 0) { + /* failed to set binary form */ + usage(h5tools_getprogname()); + goto error; + } + } + bin_output = TRUE; + if (outfname!=NULL) { + if (set_data_output_file(outfname, 1) < 0) { + /* failed to set output file */ + usage(h5tools_getprogname()); + goto error; } - /* iterate through all the links */ + last_was_dset = FALSE; + } + break; - if( (sort_by == H5_INDEX_CRT_ORDER) && (crt_order_flags & H5P_CRT_ORDER_TRACKED)) - H5Literate(gid, sort_by, sort_order, NULL, dump_all_cb, NULL); - else - H5Literate(gid, H5_INDEX_NAME, sort_order, NULL, dump_all_cb, NULL); + case 'q': + if ( ( sort_by = set_sort_by(opt_arg)) < 0) { + /* failed to set "sort by" form */ + usage(h5tools_getprogname()); + goto error; + } + break; + case 'z': + if ( ( sort_order = set_sort_order(opt_arg)) < 0) { + /* failed to set "sort order" form */ + usage(h5tools_getprogname()); + goto error; + } + break; + case 'M': + if (!last_was_dset) { + error_msg("option `-%c' can only be used after --dataset option\n", opt); + goto error; } - free(t_name); - free(grpxid); - free(parentxid); - } - } else { - - /* only link -- must be first time! */ - char *t_name = xml_escape_the_name(name); - char *grpxid = (char *)malloc(100); - char *parentxid = (char *)malloc(100); - - if(isRoot) { - xml_name_to_XID("/", grpxid, 100, 1); - printf("<%sRootGroup OBJ-XID=\"%s\" H5Path=\"%s\">\n", - xmlnsprefix, grpxid, "/"); - } else { - char *t_tmp = xml_escape_the_name(tmp); - - par_name = xml_escape_the_name(par); - xml_name_to_XID(tmp, grpxid, 100, 1); - xml_name_to_XID(par, parentxid, 100, 1); - printf("<%sGroup Name=\"%s\" OBJ-XID=\"%s\" H5Path=\"%s\" " - "Parents=\"%s\" H5ParentPaths=\"%s\" >\n", - xmlnsprefix, t_name, grpxid, t_tmp, - parentxid, par_name); - free(t_tmp); - free(par_name); - } - free(t_name); - free(grpxid); - free(parentxid); + if (parse_mask_list(opt_arg) != SUCCEED){ + usage(h5tools_getprogname()); + goto error; + } + display_packed_bits = TRUE; + break; - /* 1. do all the attributes of the group */ + /** begin XML parameters **/ + case 'x': + /* select XML output */ + doxml = TRUE; + useschema = TRUE; + h5tools_dump_header_format = NULL; + dump_function_table = &xml_function_table; + h5tools_nCols = 0; + break; + case 'u': + doxml = TRUE; + useschema = FALSE; + xmlnsprefix = ""; + h5tools_dump_header_format = NULL; + dump_function_table = &xml_function_table; + h5tools_nCols = 0; + break; + case 'D': + /* specify alternative XML DTD or schema */ + /* To Do: check format of this value? */ + xml_dtd_uri = opt_arg; + h5tools_nCols = 0; + break; - if((sort_by == H5_INDEX_CRT_ORDER) && (attr_crt_order_flags & H5P_CRT_ORDER_TRACKED)) { - if(H5Aiterate2(gid, sort_by, sort_order, NULL, dump_function_table->dump_attribute_function, NULL) < 0) { - error_msg("error getting attribute information\n"); - h5tools_setstatus(EXIT_FAILURE); - } /* end if */ - } /* end if */ - else { - if(H5Aiterate2(gid, H5_INDEX_NAME, sort_order, NULL, dump_function_table->dump_attribute_function, NULL) < 0) { - error_msg("error getting attribute information\n"); - h5tools_setstatus(EXIT_FAILURE); - } /* end if */ - } /* end else */ + case 'm': + /* specify alternative floating point printing format */ + fp_format = opt_arg; + h5tools_nCols = 0; + break; + case 'X': + /* specify XML namespace (default="hdf5:"), or none */ + /* To Do: check format of this value? */ + if (!useschema) { + usage(h5tools_getprogname()); + goto error; + } + if (HDstrcmp(opt_arg,":") == 0) { + xmlnsprefix = ""; + } + else { + xmlnsprefix = opt_arg; + } + h5tools_nCols = 0; + break; + /** end XML parameters **/ - if(isRoot && unamedtype) { - unsigned u; + /** begin subsetting parameters **/ + case 's': + case 'S': + case 'c': + case 'k': { + struct subset_t *s; - /* Very special case: dump unamed type in root group */ - for(u = 0; u < type_table->nobjs; u++) { - if(!type_table->objs[u].recorded) { - dset = H5Dopen2(gid, type_table->objs[u].objname, H5P_DEFAULT); - type = H5Dget_type(dset); - sprintf(type_name, "#"H5_PRINTF_HADDR_FMT, type_table->objs[u].objno); - dump_function_table->dump_named_datatype_function(type, type_name); - H5Tclose(type); - H5Dclose(dset); - } + if (!last_was_dset) { + error_msg("option `-%c' can only be used after --dataset option\n", opt); + goto error; } - } - /* iterate through all the links */ - - if( (sort_by == H5_INDEX_CRT_ORDER) && (crt_order_flags & H5P_CRT_ORDER_TRACKED)) - H5Literate(gid, sort_by, sort_order, NULL, dump_all_cb, NULL); - else - H5Literate(gid, H5_INDEX_NAME, sort_order, NULL, dump_all_cb, NULL); - } + if (last_dset->subset_info) { + /* + * This overrides the "terse" syntax if they actually mixed + * the two. + */ + s = last_dset->subset_info; + } + else { + last_dset->subset_info = s = (struct subset_t *)HDcalloc(1, sizeof(struct subset_t)); + } - indent -= COL; - indentation(indent); - if(isRoot) - printf("\n", xmlnsprefix); - else - printf("\n" , xmlnsprefix); - free(tmp); -} + /* + * slightly convoluted, but...we are only interested in options + * for subsetting: "--start", "--stride", "--count", and "--block" + * which can come in any order. If we run out of parameters (EOF) + * or run into one which isn't a subsetting parameter (NOT s, S, + * c, or K), then we exit the do-while look, set the subset_info + * to the structure we've been filling. If we've reached the end + * of the options, we exit the parsing (goto parse_end) otherwise, + * since we've "read" the next option, we need to parse it. So we + * jump to the beginning of the switch statement (goto parse_start). + */ + do { + switch ((char)opt) { + case 's': + if (s->start.data) { + HDfree(s->start.data); + s->start.data = NULL; + } + parse_hsize_list(opt_arg, &s->start); + break; + case 'S': + if (s->stride.data) { + HDfree(s->stride.data); + s->stride.data = NULL; + } + parse_hsize_list(opt_arg, &s->stride); + break; + case 'c': + if (s->count.data) { + HDfree(s->count.data); + s->count.data = NULL; + } + parse_hsize_list(opt_arg, &s->count); + break; + case 'k': + if (s->block.data) { + HDfree(s->block.data); + s->block.data = NULL; + } + parse_hsize_list(opt_arg, &s->block); + break; + default: + goto end_collect; + } + } while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF); -/*------------------------------------------------------------------------- - * Function: xml_print_refs - * - * Purpose: Print a path to the objects referenced by HDF5 Referneces. - * - * Return: void - * - * Programmer: REMcG - * - * Modifications: - * - *------------------------------------------------------------------------- - */ -static int -xml_print_refs(hid_t did, int source) -{ - herr_t e; - hid_t type, space; - char *buf = NULL; - hobj_ref_t *refbuf = NULL; - hssize_t ssiz; - hsize_t i; - size_t tsiz; - - if (source == DATASET_DATA) { - type = H5Dget_type(did); - } - else if (source == ATTRIBUTE_DATA) { - type = H5Aget_type(did); - } - else { - /* return an error */ - return FAIL; - } - if (H5Tget_class(type) != H5T_REFERENCE) { - /* return an error */ - goto error; - } - if (!H5Tequal(type, H5T_STD_REF_OBJ)) { - /* region ref not supported yet... */ - /* return an error */ - goto error; - } - if (source == DATASET_DATA) { - space = H5Dget_space(did); - if ((ssiz = H5Sget_simple_extent_npoints(space)) < 0) - goto error; - if ((tsiz = H5Tget_size(type)) == 0) - goto error; +end_collect: + last_was_dset = FALSE; - buf = (char *) calloc((size_t)(ssiz * tsiz), sizeof(char)); - if (buf == NULL) - goto error; - e = H5Dread(did, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); - /* need to check result here */ - if (e < 0) { - goto error; + if (opt != EOF) + goto parse_start; + else + goto parse_end; } - } - else if (source == ATTRIBUTE_DATA) { - space = H5Aget_space(did); - if ((ssiz = H5Sget_simple_extent_npoints(space)) < 0) - goto error; - if ((tsiz = H5Tget_size(type)) == 0) - goto error; + /** end subsetting parameters **/ - buf = (char *) calloc((size_t)(ssiz * tsiz), sizeof(char)); - if (buf == NULL) { - goto error; - } - e = H5Aread(did, H5T_STD_REF_OBJ, buf); - /* need to check the result here */ - if (e < 0) { + case 'E': + enable_error_stack = TRUE; + break; + case 'C': + disable_compact_subset = TRUE; + break; + case 'h': + usage(h5tools_getprogname()); + free_handler(hand, argc); + hand = NULL; + h5tools_setstatus(EXIT_SUCCESS); + goto done; + case '?': + default: + usage(h5tools_getprogname()); goto error; } } - refbuf = (hobj_ref_t *) buf; - - for (i = 0; i < ssiz; i++) { - const char *path; - - path = lookup_ref_path(*refbuf); - indentation(indent + COL); - - if (!path) { - printf("\"%s\"\n", "NULL"); - } - else { - char *t_path = xml_escape_the_string(path, -1); - - printf("\"%s\"\n", t_path); - free(t_path); - } - - refbuf++; +parse_end: + /* check for file name to be processed */ + if (argc <= opt_ind) { + error_msg("missing file name\n"); + usage(h5tools_getprogname()); + goto error; } +done: + return hand; - free(buf); - H5Tclose(type); - H5Sclose(space); - return SUCCEED; - error: - if(buf) - free(buf); - - H5E_BEGIN_TRY { - H5Tclose(type); - H5Sclose(space); - } H5E_END_TRY; - return FAIL; -} + if (hand) { + free_handler(hand, argc); + hand = NULL; + } + h5tools_setstatus(EXIT_FAILURE); + return hand; +} + /*------------------------------------------------------------------------- - * Function: xml_print_strs + * Function: main * - * Purpose: Print strings. + * Purpose: HDF5 dumper * - * Return: void + * Return: Success: 0 + * Failure: 1 * - * Programmer: REMcG + * Programmer: Ruey-Hsia Li * * Modifications: + * Albert Cheng + * 30. September 2000 + * Add the -o option--output file for datasets raw data + * + * REMcG + * November 2000 + * Changes to support XML. + * + * Bill Wendling + * Wednesday, 10. January 2001 + * Modified the way command line parameters are interpreted. They go + * through one function call now (get_option). + * + * Bill Wendling + * Tuesday, 20. February 2001 + * Moved command line parsing to separate function. Made various + * "display_*" flags global. + * + * REMcG + * August 2003 + * Major upgrade to XML support. + * + * Pedro Vicente + * September 2007 + * list objects in requested order (creation order or alphabetically) * *------------------------------------------------------------------------- */ -static int -xml_print_strs(hid_t did, int source) +int +main(int argc, const char *argv[]) { - herr_t e; - hid_t type, space; - void *buf = NULL; - char *bp; - char *onestring = NULL; - hssize_t ssiz; - size_t tsiz; - size_t str_size = 0; - size_t i; - htri_t is_vlstr; - - if (source == DATASET_DATA) { - type = H5Dget_type(did); - } - else if (source == ATTRIBUTE_DATA) { - type = H5Aget_type(did); - } - else { - /* return an error */ - return FAIL; - } - if (H5Tget_class(type) != H5T_STRING) { - /* return an error */ - goto error; + hid_t fid = -1; + hid_t gid = -1; + H5E_auto2_t func; + H5E_auto2_t tools_func; + H5O_info_t oi; + struct handler_t *hand = NULL; + int i; + unsigned u; + void *edata; + void *tools_edata; + char *fname = NULL; + + h5tools_setprogname(PROGRAMNAME); + h5tools_setstatus(EXIT_SUCCESS); + h5tools_dump_header_format = &h5tools_standardformat; + dump_function_table = &ddl_function_table; + dump_indent = 0; + + /* Disable error reporting */ + H5Eget_auto2(H5E_DEFAULT, &func, &edata); + H5Eset_auto2(H5E_DEFAULT, NULL, NULL); + + /* Initialize h5tools lib */ + h5tools_init(); + /* Disable tools error reporting */ + H5Eget_auto2(H5tools_ERR_STACK_g, &tools_func, &tools_edata); + H5Eset_auto2(H5tools_ERR_STACK_g, NULL, NULL); + + if((hand = parse_command_line(argc, argv))==NULL) { + goto done; } - /* Check if we have VL data in the dataset's datatype */ - is_vlstr = (TRUE == H5Tis_variable_str(type)); - if (source == DATASET_DATA) { - space = H5Dget_space(did); - if((ssiz = H5Sget_simple_extent_npoints(space)) < 0) - goto error; - if((tsiz = H5Tget_size(type)) == 0) - goto error; + if (bin_output && outfname == NULL) { + error_msg("binary output requires a file name, use -o \n"); + h5tools_setstatus(EXIT_FAILURE); + goto done; + } - buf = malloc((size_t)(ssiz * tsiz)); - if (buf == NULL) - goto error; + if (enable_error_stack) { + H5Eset_auto2(H5E_DEFAULT, func, edata); + H5Eset_auto2(H5tools_ERR_STACK_g, tools_func, tools_edata); + } - e = H5Dread(did, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); - if (e < 0) { - goto error; + /* Check for conflicting options */ + if (doxml) { + if (!display_all) { + error_msg("option \"%s\" not available for XML\n", + "to display selected objects"); + h5tools_setstatus(EXIT_FAILURE); + goto done; + } + else if (display_bb) { + error_msg("option \"%s\" not available for XML\n", "--boot-block"); + h5tools_setstatus(EXIT_FAILURE); + goto done; + } + else if (display_oid == 1) { + error_msg("option \"%s\" not available for XML\n", "--object-ids"); + h5tools_setstatus(EXIT_FAILURE); + goto done; + } + else if (display_char == TRUE) { + error_msg("option \"%s\" not available for XML\n", "--string"); + h5tools_setstatus(EXIT_FAILURE); + goto done; + } + else if (usingdasho) { + error_msg("option \"%s\" not available for XML\n", "--output"); + h5tools_setstatus(EXIT_FAILURE); + goto done; + } + } + else { + if (xml_dtd_uri) { + warn_msg("option \"%s\" only applies with XML: %s\n", "--xml-dtd", xml_dtd_uri); } } - else if (source == ATTRIBUTE_DATA) { - space = H5Aget_space(did); - if((ssiz = H5Sget_simple_extent_npoints(space)) < 0) - goto error; - if((tsiz = H5Tget_size(type)) == 0) - goto error; - buf = malloc((size_t)(ssiz * tsiz)); - if (buf == NULL) - goto error; + if (argc <= opt_ind) { + error_msg("missing file name\n"); + usage(h5tools_getprogname()); + h5tools_setstatus(EXIT_FAILURE); + goto done; + } + while(opt_ind < argc) { + fname = HDstrdup(argv[opt_ind++]); - e = H5Aread(did, type, buf); - if (e < 0) { - goto error; + fid = h5tools_fopen(fname, H5F_ACC_RDONLY, H5P_DEFAULT, driver, NULL, 0); + + if (fid < 0) { + error_msg("unable to open file \"%s\"\n", fname); + h5tools_setstatus(EXIT_FAILURE); + goto done; } - } - bp = (char*) buf; - if (!is_vlstr) - onestring = (char *) calloc(tsiz, sizeof(char)); + /* allocate and initialize internal data structure */ + init_prefix(&prefix, prefix_len); - for (i = 0; i < ssiz; i++) { - if (is_vlstr) { - onestring = *(char **) bp; - if (onestring) - str_size = (size_t) HDstrlen(onestring); + /* Prepare to find objects that might be targets of a reference */ + fill_ref_path_table(fid); + + if(doxml) { + /* initialize XML */ + /* reset prefix! */ + HDstrcpy(prefix, ""); + + /* make sure the URI is initialized to something */ + if (xml_dtd_uri == NULL) { + if (useschema) { + xml_dtd_uri = DEFAULT_XSD; + } + else { + xml_dtd_uri = DEFAULT_DTD; + xmlnsprefix = ""; + } + } + else { + if (useschema && HDstrcmp(xmlnsprefix,"")) { + error_msg("Cannot set Schema URL for a qualified namespace--use -X or -U option with -D \n"); + h5tools_setstatus(EXIT_FAILURE); + goto done; + } + } } - else { - HDstrncpy(onestring, bp, tsiz); - str_size = tsiz; + + /* Get object info for root group */ + if(H5Oget_info_by_name(fid, "/", &oi, H5P_DEFAULT) < 0) { + error_msg("internal error (file %s:line %d)\n", __FILE__, __LINE__); + h5tools_setstatus(EXIT_FAILURE); + goto done; } - indentation(indent + COL); - if (!onestring) { - printf("NULL\n"); + /* Initialize object tables */ + if(table_list_add(fid, oi.fileno) < 0) { + error_msg("internal error (file %s:line %d)\n", __FILE__, __LINE__); + h5tools_setstatus(EXIT_FAILURE); + goto done; } + group_table = table_list.tables[0].group_table; + dset_table = table_list.tables[0].dset_table; + type_table = table_list.tables[0].type_table; + + /* does there exist unamed committed datatype */ + for (u = 0; u < type_table->nobjs; u++) + if (!type_table->objs[u].recorded) { + unamedtype = 1; + break; + } /* end if */ + + /* start to dump - display file header information */ + if (!doxml) { + begin_obj(h5tools_dump_header_format->filebegin, fname, h5tools_dump_header_format->fileblockbegin); + } else { - char *t_onestring = xml_escape_the_string(onestring, (int) str_size); - if (t_onestring) { - printf("\"%s\"\n", t_onestring); - free(t_onestring); + HDfprintf(rawoutstream, "\n"); + + /* alternative first element, depending on schema or DTD. */ + if (useschema) { + if (HDstrcmp(xmlnsprefix,"") == 0) { + HDfprintf(rawoutstream, "\n", + xml_dtd_uri); + } + else { + /* TO DO: make -url option work in this case (may need new option) */ + char *ns; + char *indx; + + ns = HDstrdup(xmlnsprefix); + indx = HDstrrchr(ns,(int)':'); + if (indx) *indx = '\0'; + + HDfprintf(rawoutstream, "<%sHDF5-File xmlns:%s=\"http://hdfgroup.org/HDF5/XML/schema/HDF5-File\" " + "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" " + "xsi:schemaLocation=\"http://hdfgroup.org/HDF5/XML/schema/HDF5-File " + "http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd\">\n",xmlnsprefix,ns); + HDfree(ns); + } + } + else { + HDfprintf(rawoutstream, "\n", xml_dtd_uri); + HDfprintf(rawoutstream, "\n"); } } - bp += tsiz; - } + if (!doxml) { + if (display_fi) { + HDfprintf(rawoutstream, "\n"); + dump_fcontents(fid); + end_obj(h5tools_dump_header_format->fileend,h5tools_dump_header_format->fileblockend); + HDfprintf(rawoutstream, "\n"); + goto done; + } - /* Reclaim any VL memory, if necessary */ - if (!is_vlstr) - if (onestring) - free(onestring); - if (buf) { - if (is_vlstr) - H5Dvlen_reclaim(type, space, H5P_DEFAULT, buf); - free(buf); - } - H5Tclose(type); - H5Sclose(space); - return SUCCEED; - -error: - if(buf) - free(buf); - - H5E_BEGIN_TRY { - H5Tclose(type); - H5Sclose(space); - } H5E_END_TRY; - return FAIL; -} + if (display_bb) + dump_fcpl(fid); + } -/*------------------------------------------------------------------------- - * Function: check_filters - * - * Purpose: private function to check for the filters and - * put tags in the XML. - * - * Return: void - * - * Programmer: REMcG - * - * Modifications: - * - *------------------------------------------------------------------------- - */ -static void -check_filters(hid_t dcpl) -{ - int nfilt; - int i; - H5Z_filter_t filter; - char namebuf[120]; - size_t cd_nelmts = 20; - unsigned int cd_values[20]; - unsigned int flags; - - nfilt = H5Pget_nfilters(dcpl); - if (nfilt <= 0) - return; - for (i = 0; i < nfilt; i++) { - filter = H5Pget_filter2(dcpl, (unsigned)i, &flags, - (size_t *) &cd_nelmts, - cd_values, 120, namebuf, NULL); - if (filter == H5Z_FILTER_DEFLATE) { - indentation(indent + COL); - printf("<%sDeflate Level=\"",xmlnsprefix); - if (cd_nelmts < 1) { - /* not sure what this means? */ - printf("6"); - } else { - printf("%d",cd_values[0]); - } - printf("\"/>\n"); - } else if (filter == H5Z_FILTER_FLETCHER32) { - indentation(indent + COL); - printf("<%sFletcher32 />",xmlnsprefix); - } else if (filter == H5Z_FILTER_SHUFFLE) { - indentation(indent + COL); - printf("<%sShuffle />",xmlnsprefix); - } else if (filter == H5Z_FILTER_SZIP) { - - indentation(indent + COL); - printf("<%sSZIP ",xmlnsprefix); - if (cd_nelmts < 2) { - /* no pixels ? */ - printf("Pixels_per_block=\"-1\" "); - } else { - printf("Pixels_per_block=\"%d\" ",cd_values[1]); - } - /* analyse the options mask */ - if (cd_values[0] & H5_SZIP_CHIP_OPTION_MASK) { - printf("Mode =\"Hardware\" "); - } else if (cd_values[0] & H5_SZIP_ALLOW_K13_OPTION_MASK) { - printf("Mode =\"K13\" "); + if(display_all) { + if((gid = H5Gopen2(fid, "/", H5P_DEFAULT)) < 0) { + error_msg("unable to open root group\n"); + h5tools_setstatus(EXIT_FAILURE); } - printf("Coding=\""); - if (cd_values[0] & H5_SZIP_EC_OPTION_MASK) { - printf("Entropy"); - } else if (cd_values[0] & H5_SZIP_NN_OPTION_MASK) { - printf("NN"); + else { + if (!doxml) + dump_indent += COL; + dump_function_table->dump_group_function(gid, "/" ); + if (!doxml) + dump_indent -= COL; + HDfprintf(rawoutstream, "\n"); } - printf("\" "); - printf("ByteOrder=\""); - if (cd_values[0] & H5_SZIP_LSB_OPTION_MASK) { - printf("LSB"); - } else if (cd_values[0] & H5_SZIP_MSB_OPTION_MASK) { - printf("MSB"); + if(H5Gclose(gid) < 0) { + error_msg("unable to close root group\n"); + h5tools_setstatus(EXIT_FAILURE); } - printf("\" "); - if (cd_values[0] & H5_SZIP_RAW_OPTION_MASK) { - printf("Header=\"Raw\""); - } - printf("/>\n"); - } else { - /* unknown option */ } - } -} - -static void -xml_dump_fill_value(hid_t dcpl, hid_t type) -{ - size_t sz; - size_t i; - hsize_t space; - void * buf; - char * name; - - indent += COL; - indentation(indent); - printf("<%sData>\n",xmlnsprefix); - indent += COL; - - space = H5Tget_size(type); - buf = malloc((size_t)space); - - H5Pget_fill_value(dcpl, type, buf); - - if (H5Tget_class(type) == H5T_REFERENCE) { - const char * path; - - path = lookup_ref_path(*(hobj_ref_t *)buf); - - indentation(indent); - printf("<%sDataFromFile>\n",xmlnsprefix); - if (!path) { - printf("\"%s\"\n", "NULL"); - } else { - char *t_path = xml_escape_the_string(path, -1); + else { + /* Note: this option is not supported for XML */ + if(doxml) { + error_msg("internal error (file %s:line %d)\n", __FILE__, __LINE__); + h5tools_setstatus(EXIT_FAILURE); + goto done; + } /* end if */ - printf("\"%s\"\n", t_path); - free(t_path); - } - indentation(indent); - printf("\n",xmlnsprefix); - } else if (H5Tget_class(type) == H5T_STRING) { - /* ????? */ - indentation(indent); - printf("\n"); - indentation(indent); - printf("<%sNoData />\n",xmlnsprefix); - } else { - /* all other data */ - switch (H5Tget_class(type)) { - case H5T_INTEGER: - indentation(indent); - printf("<%sDataFromFile>\n",xmlnsprefix); - indentation(indent); - printf("\"%d\"\n",*(int *)buf); - indentation(indent); - printf("\n",xmlnsprefix); - break; - case H5T_FLOAT: - indentation(indent); - printf("<%sDataFromFile>\n",xmlnsprefix); - indentation(indent); - printf("\"%f\"\n",*(float *)buf); - indentation(indent); - printf("\n",xmlnsprefix); - break; - case H5T_BITFIELD: - case H5T_OPAQUE: - indentation(indent); - printf("<%sDataFromFile>\n",xmlnsprefix); - sz = H5Tget_size(type); - indentation(indent); - printf("\""); - for (i = 0; i < sz; i++) { - printf("%x ",*(unsigned int *)buf); - buf = (char *)buf + sizeof(unsigned int); + for(i = 0; i < argc; i++) { + if(hand[i].func) { + hand[i].func(fid, hand[i].obj, hand[i].subset_info, 1, NULL); } - printf("\"\n"); - indentation(indent); - printf("\n",xmlnsprefix); - break; - case H5T_ENUM: - indentation(indent); - printf("<%sDataFromFile>\n",xmlnsprefix); - name = H5Tget_member_name(type, *(unsigned *)buf); - indentation(indent); - printf("\"%s\"\n",name); - indentation(indent); - printf("\n",xmlnsprefix); - break; - case H5T_ARRAY: - indentation(indent); - printf("\n"); - indentation(indent); - printf("<%sNoData />\n",xmlnsprefix); - break; - case H5T_TIME: - indentation(indent); - printf("\n"); - indentation(indent); - printf("<%sNoData />\n",xmlnsprefix); - break; - case H5T_COMPOUND: - indentation(indent); - printf("\n"); - indentation(indent); - printf("<%sNoData />\n",xmlnsprefix); - break; - case H5T_VLEN: - indentation(indent); - printf("\n"); - indentation(indent); - printf("<%sNoData />\n",xmlnsprefix); - break; - default: - indentation(indent); - printf("\n", H5Tget_class(type)); - indentation(indent); - printf("<%sNoData/>\n",xmlnsprefix); - break; + } + HDfprintf(rawoutstream, "\n"); } - } - free(buf); - indent -= COL; - indentation(indent); - printf("\n",xmlnsprefix); - indent -= COL; -} -/*------------------------------------------------------------------------- - * Function: xml_dump_dataset - * - * Purpose: Dump a description of an HDF5 dataset in XML. - * - * Return: void - * - * Programmer: REMcG - * - * Modifications: - * Pedro Vicente, October 9, 2007 - * added parameters to H5Aiterate2 to allow for other iteration orders - * - *------------------------------------------------------------------------- - */ -static void -xml_dump_dataset(hid_t did, const char *name, struct subset_t UNUSED * sset) -{ - hid_t type, space; - hid_t dcpl; - H5D_fill_value_t fvstatus; - int maxdims; - hsize_t *chsize; - int ndims; - int i; - H5D_alloc_time_t at; - H5D_fill_time_t ft; - hsize_t tempi; - char *tmp; - char *t_name, *t_tmp, *t_prefix; - unsigned attr_crt_order_flags; - char *rstr = (char *)HDmalloc(100); - char *pstr = (char *)HDmalloc(100); - - tmp = (char *)HDmalloc(HDstrlen(prefix) + HDstrlen(name) + 2); - HDstrcpy(tmp, prefix); - HDstrcat(tmp, "/"); - HDstrcat(tmp, name); - indentation(indent); - - t_name = xml_escape_the_name(name); - t_tmp = xml_escape_the_name(tmp); - t_prefix = xml_escape_the_name(prefix); - - xml_name_to_XID(tmp, rstr, 100, 1); - xml_name_to_XID(prefix, pstr, 100, 1); - printf("<%sDataset Name=\"%s\" OBJ-XID=\"%s\" H5Path= \"%s\" Parents=\"%s\" H5ParentPaths=\"%s\">\n",xmlnsprefix, - t_name, rstr, t_tmp, pstr, strcmp(prefix, "") ? t_prefix : "/"); - - HDfree(t_name); - HDfree(t_tmp); - HDfree(t_prefix); - HDfree(rstr); - HDfree(pstr); - HDfree(tmp); - - dcpl = H5Dget_create_plist(did); - type = H5Dget_type(did); - space = H5Dget_space(did); - - /* query the creation properties for attributes */ - H5Pget_attr_creation_order(dcpl, &attr_crt_order_flags); - - /* Print information about storage layout */ - if(H5D_CHUNKED == H5Pget_layout(dcpl)) { - maxdims = H5Sget_simple_extent_ndims(space); - chsize = (hsize_t *)malloc(maxdims * sizeof(hsize_t)); - indent += COL; - indentation(indent); - printf("<%sStorageLayout>\n",xmlnsprefix); - indent += COL; - indentation(indent); - printf("<%sChunkedLayout ",xmlnsprefix); - ndims = H5Pget_chunk(dcpl, maxdims, chsize); - printf("Ndims=\"%d\">\n", ndims); - - indent += COL; - - for (i = 0; i < ndims; i++) { - indentation(indent); - HDfprintf(stdout, "<%sChunkDimension DimSize=\"%Hu\" />\n", - xmlnsprefix, chsize[i]); + if (!doxml) { + end_obj(h5tools_dump_header_format->fileend, h5tools_dump_header_format->fileblockend); + HDfprintf(rawoutstream, "\n"); + } + else { + HDfprintf(rawoutstream, "\n", xmlnsprefix); } + /* Free tables for objects */ + table_list_free(); - indentation(indent); - printf("<%sRequiredFilter>\n",xmlnsprefix); - indent += COL; - check_filters(dcpl); - indent -= COL; - indentation(indent); - printf("\n",xmlnsprefix); - - indent -= COL; - - indentation(indent); - printf("\n",xmlnsprefix); - indent -= COL; - indentation(indent); - printf("\n",xmlnsprefix); - indent -= COL; - free(chsize); - } else if (H5D_CONTIGUOUS == H5Pget_layout(dcpl)) { - indent += COL; - indentation(indent); - printf("<%sStorageLayout>\n",xmlnsprefix); - indent += COL; - indentation(indent); - printf("<%sContiguousLayout/>\n",xmlnsprefix); - indent -= COL; - indentation(indent); - printf("\n",xmlnsprefix); - indent -= COL; - indentation(indent); - } else if (H5D_COMPACT == H5Pget_layout(dcpl)) { - indent += COL; - indentation(indent); - printf("<%sStorageLayout>\n",xmlnsprefix); - indent += COL; - indentation(indent); - printf("<%sCompactLayout/>\n",xmlnsprefix); - indent -= COL; - indentation(indent); - printf("\n",xmlnsprefix); - indent -= COL; - indentation(indent); - } - /* and check for external.... ?? */ - - /* fill value */ - - indent += COL; - indentation(indent); - printf("<%sFillValueInfo ",xmlnsprefix); - H5Pget_fill_time(dcpl, &ft); - printf("FillTime=\""); - switch ( ft ) { - case H5D_FILL_TIME_ALLOC: - printf("FillOnAlloc"); - break; - case H5D_FILL_TIME_NEVER: - printf("FillNever"); - break; - case H5D_FILL_TIME_IFSET: - printf("FillIfSet"); - break; - default: - printf("?"); - break; - } - printf("\" "); - H5Pget_alloc_time(dcpl, &at); - printf("AllocationTime=\""); - switch ( at ) { - case H5D_ALLOC_TIME_EARLY: - printf("Early"); - break; - case H5D_ALLOC_TIME_INCR: - printf("Incremental"); - break; - case H5D_ALLOC_TIME_LATE: - printf("Late"); - break; - case H5D_ALLOC_TIME_DEFAULT: - default: - printf("?"); - break; - } - printf("\""); - printf(">\n"); - - indent += COL; - indentation(indent); - printf("<%sFillValue>\n",xmlnsprefix); - indent += COL; - H5Pfill_value_defined(dcpl, &fvstatus); - if (fvstatus == H5D_FILL_VALUE_UNDEFINED || - (fvstatus==H5D_FILL_VALUE_DEFAULT && ft==H5D_FILL_TIME_IFSET)) { - indentation(indent + COL); - printf("<%sNoFill/>\n",xmlnsprefix); - } else { - xml_dump_fill_value(dcpl,type); - } - - indent -= COL; - indentation(indent); - printf("\n",xmlnsprefix); - - indent -= COL; - indentation(indent); - printf("\n",xmlnsprefix); - indent -= COL; - - dump_function_table->dump_dataspace_function(space); - dump_function_table->dump_datatype_function(type); - - indent += COL; - - if((sort_by == H5_INDEX_CRT_ORDER) && (attr_crt_order_flags & H5P_CRT_ORDER_TRACKED)) { - if(H5Aiterate2(did, sort_by, sort_order, NULL, dump_function_table->dump_attribute_function, NULL) < 0) { - error_msg("error getting attribute information\n"); - h5tools_setstatus(EXIT_FAILURE); - } /* end if */ - } /* end if */ - else { - if(H5Aiterate2(did, H5_INDEX_NAME, sort_order, NULL, dump_function_table->dump_attribute_function, NULL) < 0) { - error_msg("error getting attribute information\n"); - h5tools_setstatus(EXIT_FAILURE); - } /* end if */ - } /* end else */ - - indent -= COL; - tempi = H5Dget_storage_size(did); - - if (display_data && (tempi > 0)) { - switch (H5Tget_class(type)) { - case H5T_INTEGER: - case H5T_FLOAT: - case H5T_STRING: - case H5T_BITFIELD: - case H5T_OPAQUE: - case H5T_ENUM: - case H5T_ARRAY: - dump_function_table->dump_data_function(did, DATASET_DATA, NULL, 0); - break; - - case H5T_TIME: - indent += COL; - indentation(indent); - printf("<%sData>\n",xmlnsprefix); - indentation(indent); - printf("\n"); - indentation(indent); - printf("<%sNoData />\n",xmlnsprefix); - indentation(indent); - printf("<%sData>\n",xmlnsprefix); - indent -= COL; - break; - - case H5T_COMPOUND: - indentation(indent); - printf("\n"); - dump_function_table->dump_data_function(did, DATASET_DATA, NULL, 0); - break; + if(fid >=0) + if (H5Fclose(fid) < 0) + h5tools_setstatus(EXIT_FAILURE); - case H5T_REFERENCE: - indentation(indent); - printf("<%sData>\n",xmlnsprefix); - indentation(indent); - if (!H5Tequal(type, H5T_STD_REF_OBJ)) { - printf("\n"); - indentation(indent); - printf("<%sNoData />\n",xmlnsprefix); - } else { - printf("<%sDataFromFile>\n",xmlnsprefix); - xml_print_refs(did, DATASET_DATA); - indentation(indent); - printf("\n",xmlnsprefix); - } - indentation(indent); - printf("\n",xmlnsprefix); - break; + if(prefix) + HDfree(prefix); + if(fname) + HDfree(fname); + } /* end while */ - case H5T_VLEN: - printf("\n"); - dump_function_table->dump_data_function(did, DATASET_DATA, NULL, 0); - break; - default: - indentation(indent); - printf("<%sData>\n",xmlnsprefix); - indentation(indent); - printf("\n", H5Tget_class(type)); - indentation(indent); - printf("<%sNoData/>\n",xmlnsprefix); - indentation(indent); - printf("\n",xmlnsprefix); - break; - } - } else { - /* no data written */ - indentation(indent + COL); - printf("<%sData>\n",xmlnsprefix); - indentation(indent + COL + COL); - printf("<%sNoData/>\n",xmlnsprefix); - indentation(indent + COL); - printf("\n",xmlnsprefix); - } + if(hand) + free_handler(hand, argc); - H5Tclose(type); - H5Sclose(space); - H5Pclose(dcpl); - indentation(indent); - printf("\n", xmlnsprefix); -} + /* To Do: clean up XML table */ -/*------------------------------------------------------------------------- - * Function: xml_print_enum - * - * Purpose: Print the values of an HDF5 ENUM in XML. - * Very similar to regular DDL output. - * - * Return: void - * - * Programmer: REMcG - * - * Modifications: - * - *------------------------------------------------------------------------- - */ -static void -xml_print_enum(hid_t type) -{ - char **name = NULL; /*member names */ - unsigned char *value = NULL; /*value array */ - unsigned nmembs; /*number of members */ - hid_t super; /*enum base integer type */ - hid_t native = -1; /*native integer datatype */ - size_t dst_size; /*destination value type size */ - unsigned i; /*miscellaneous counters */ - size_t j; - - nmembs = (unsigned)H5Tget_nmembers(type); - super = H5Tget_super(type); - - indentation(indent); - printf("<%sDataType>\n",xmlnsprefix); - xml_print_datatype(super,0); - indentation(indent); - printf("\n",xmlnsprefix); - - /* - * Determine what datatype to use for the native values. To simplify - * things we entertain three possibilities: - * 1. long long -- the largest native signed integer - * 2. unsigned long long -- the largest native unsigned integer - * 3. raw format - */ - if (H5Tget_size(type) <= sizeof(long long)) { - dst_size = sizeof(long long); - - if (H5T_SGN_NONE == H5Tget_sign(type)) { - native = H5T_NATIVE_ULLONG; - } else { - native = H5T_NATIVE_LLONG; - } - } else { - dst_size = H5Tget_size(type); - } + leave(h5tools_getstatus()); - /* Get the names and raw values of all members */ - name = (char **)calloc(nmembs, sizeof(char *)); - value = (unsigned char *)calloc(nmembs, MAX(H5Tget_size(type), dst_size)); +done: + /* Free tables for objects */ + table_list_free(); - for (i = 0; i < nmembs; i++) { - name[i] = H5Tget_member_name(type, i); - H5Tget_member_value(type, i, value + i * H5Tget_size(type)); - } + if(fid >=0) + if (H5Fclose(fid) < 0) + h5tools_setstatus(EXIT_FAILURE); + + if(prefix) + HDfree(prefix); + if(fname) + HDfree(fname); - /* Convert values to native datatype */ - if (native > 0) - H5Tconvert(super, native, nmembs, value, NULL, H5P_DEFAULT); - - /* Sort members by increasing value */ - /*not implemented yet */ - - /* Print members */ - indent += COL; - for (i = 0; i < nmembs; i++) { - char *t_name = xml_escape_the_name(name[i]); - - indentation(indent); - printf("<%sEnumElement>\n",xmlnsprefix); - indentation(indent + COL); - printf("%s\n", t_name); - free(t_name); - indentation(indent); - printf("\n",xmlnsprefix); - indentation(indent); - printf("<%sEnumValue>\n",xmlnsprefix); - indentation(indent + COL); - if (native < 0) { - printf("0x"); - - for (j = 0; j < dst_size; j++) - printf("%02x", value[i * dst_size + j]); - } else if (H5T_SGN_NONE == H5Tget_sign(native)) { - HDfprintf(stdout,"%" H5_PRINTF_LL_WIDTH "u", *((unsigned long long *) - ((void *) (value + i * dst_size)))); - } else { - HDfprintf(stdout,"%" H5_PRINTF_LL_WIDTH "d", - *((long long *) ((void *) (value + i * dst_size)))); - } - printf("\n"); - indentation(indent); - printf("\n",xmlnsprefix); + if(hand) + free_handler(hand, argc); - } - indent -= COL; + /* To Do: clean up XML table */ - /* Release resources */ - for (i = 0; i < nmembs; i++) - free(name[i]); + H5Eset_auto2(H5E_DEFAULT, func, edata); - free(name); - free(value); - H5Tclose(super); + leave(h5tools_getstatus()); } - /*------------------------------------------------------------------------- * Function: h5_fileaccess * @@ -6993,14 +1671,14 @@ xml_print_enum(hid_t type) * *------------------------------------------------------------------------- */ -static hid_t +hid_t h5_fileaccess(void) { static const char *multi_letters = "msbrglo"; const char *val = NULL; const char *name; - char s[1024]; - hid_t fapl = -1; + char s[1024]; + hid_t fapl = -1; /* First use the environment variable, then the constant */ val = HDgetenv("HDF5_DRIVER"); @@ -7018,53 +1696,56 @@ h5_fileaccess(void) if (!HDstrcmp(name, "sec2")) { /* Unix read() and write() system calls */ if (H5Pset_fapl_sec2(fapl)<0) return -1; - } else if (!HDstrcmp(name, "stdio")) { + } + else if (!HDstrcmp(name, "stdio")) { /* Standard C fread() and fwrite() system calls */ if (H5Pset_fapl_stdio(fapl)<0) return -1; - } else if (!HDstrcmp(name, "core")) { + } + else if (!HDstrcmp(name, "core")) { /* In-core temporary file with 1MB increment */ if (H5Pset_fapl_core(fapl, 1024*1024, FALSE)<0) return -1; - } else if (!HDstrcmp(name, "split")) { + } + else if (!HDstrcmp(name, "split")) { /* Split meta data and raw data each using default driver */ - if (H5Pset_fapl_split(fapl, - "-m.h5", H5P_DEFAULT, - "-r.h5", H5P_DEFAULT)<0) - return -1; - } else if (!HDstrcmp(name, "multi")) { + if (H5Pset_fapl_split(fapl, "-m.h5", H5P_DEFAULT, "-r.h5", H5P_DEFAULT) < 0) + return -1; + } + else if (!HDstrcmp(name, "multi")) { /* Multi-file driver, general case of the split driver */ - H5FD_mem_t memb_map[H5FD_MEM_NTYPES]; - hid_t memb_fapl[H5FD_MEM_NTYPES]; - const char *memb_name[H5FD_MEM_NTYPES]; - char sv[H5FD_MEM_NTYPES][1024]; - haddr_t memb_addr[H5FD_MEM_NTYPES]; - H5FD_mem_t mt; + H5FD_mem_t memb_map[H5FD_MEM_NTYPES]; + hid_t memb_fapl[H5FD_MEM_NTYPES]; + const char *memb_name[H5FD_MEM_NTYPES]; + char sv[H5FD_MEM_NTYPES][1024]; + haddr_t memb_addr[H5FD_MEM_NTYPES]; + H5FD_mem_t mt; HDmemset(memb_map, 0, sizeof memb_map); HDmemset(memb_fapl, 0, sizeof memb_fapl); HDmemset(memb_name, 0, sizeof memb_name); HDmemset(memb_addr, 0, sizeof memb_addr); - assert(HDstrlen(multi_letters)==H5FD_MEM_NTYPES); + HDassert(HDstrlen(multi_letters)==H5FD_MEM_NTYPES); for (mt=H5FD_MEM_DEFAULT; mt +#include + +#include "H5private.h" +#include "h5tools.h" +#include "h5tools_dump.h" +#include "h5tools_utils.h" +#include "h5tools_ref.h" +#include "h5trav.h" +#include "h5dump_extern.h" +#include "h5dump_ddl.h" + +/*------------------------------------------------------------------------- + * Function: dump_datatype + * + * Purpose: Dump the datatype. Datatype can be HDF5 predefined + * atomic datatype or committed/transient datatype. + * + * Return: void + * + * Programmer: Ruey-Hsia Li + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +void +dump_datatype(hid_t type) +{ + h5tools_context_t ctx; /* print context */ + h5tool_format_t *outputformat = &h5tools_dataformat; + + HDmemset(&ctx, 0, sizeof(ctx)); + ctx.indent_level = dump_indent/COL; + ctx.cur_column = dump_indent; + + h5dump_type_table = type_table; + h5tools_dump_datatype(rawoutstream, outputformat, &ctx, type); + h5dump_type_table = NULL; +} + +/*------------------------------------------------------------------------- + * Function: dump_dataspace + * + * Purpose: Dump the dataspace. Dataspace can be named dataspace, + * array, or others. + * + * Return: void + * + * Programmer: Ruey-Hsia Li + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +void +dump_dataspace(hid_t space) +{ + h5tools_context_t ctx; /* print context */ + h5tool_format_t *outputformat = &h5tools_dataformat; + + HDmemset(&ctx, 0, sizeof(ctx)); + ctx.indent_level = dump_indent/COL; + ctx.cur_column = dump_indent; + + h5tools_dump_dataspace(rawoutstream, outputformat, &ctx, space); +} + + +/*------------------------------------------------------------------------- + * Function: dump_attr_cb + * + * Purpose: attribute function callback called by H5Aiterate2, displays the attribute + * + * Return: Success: SUCCEED + * + * Failure: FAIL + * + * Programmer: Ruey-Hsia Li + * + * Modifications: Pedro Vicente, October 4, 2007 + * Added H5A_info_t parameter to conform with H5Aiterate2 + * + *------------------------------------------------------------------------- + */ +herr_t +dump_attr_cb(hid_t oid, const char *attr_name, const H5A_info_t UNUSED *info, void UNUSED *_op_data) +{ + h5tools_context_t ctx; /* print context */ + h5tool_format_t *outputformat = &h5tools_dataformat; + h5tool_format_t string_dataformat; + + hid_t attr_id; + herr_t ret = SUCCEED; + + HDmemset(&ctx, 0, sizeof(ctx)); + ctx.indent_level = dump_indent/COL; + ctx.cur_column = dump_indent; + + attr_id = H5Aopen(oid, attr_name, H5P_DEFAULT); + oid_output = display_oid; + data_output = display_data; + attr_data_output = display_attr_data; + + string_dataformat = *outputformat; + + if (fp_format) { + string_dataformat.fmt_double = fp_format; + string_dataformat.fmt_float = fp_format; + } + + if (h5tools_nCols==0) { + string_dataformat.line_ncols = 65535; + string_dataformat.line_per_line = 1; + } + else + string_dataformat.line_ncols = h5tools_nCols; + + string_dataformat.do_escape = display_escape; + outputformat = &string_dataformat; + + h5dump_type_table = type_table; + h5tools_dump_attribute(rawoutstream, outputformat, &ctx, oid, attr_name, attr_id, display_ai, display_char); + h5dump_type_table = NULL; + + if(attr_id < 0) { + h5tools_setstatus(EXIT_FAILURE); + ret = FAIL; + } + + return ret; +} + +/*------------------------------------------------------------------------- + * Function: dump_all_cb + * + * Purpose: function callback called by H5Literate, + * displays everything in the specified object + * + * Return: Success: SUCCEED + * + * Failure: FAIL + * + * Programmer: Ruey-Hsia Li + * + * Modifications: + * RMcG, November 2000 + * Added XML support. Also, optionally checks the op_data argument + * + * PVN, May 2008 + * Dump external links + * + *------------------------------------------------------------------------- + */ +herr_t +dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void UNUSED *op_data) +{ + hid_t obj; + herr_t ret = SUCCEED; + char *obj_path = NULL; /* Full path of object */ + h5tools_str_t buffer; /* string into which to render */ + h5tools_context_t ctx; /* print context */ + h5tool_format_t *outputformat = &h5tools_dataformat; + h5tool_format_t string_dataformat; + hsize_t curr_pos = 0; /* total data element position */ + + /* setup */ + HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + + HDmemset(&ctx, 0, sizeof(ctx)); + ctx.indent_level = dump_indent/COL; + ctx.cur_column = dump_indent; + + string_dataformat = *outputformat; + + if (fp_format) { + string_dataformat.fmt_double = fp_format; + string_dataformat.fmt_float = fp_format; + } + + if (h5tools_nCols==0) { + string_dataformat.line_ncols = 65535; + string_dataformat.line_per_line = 1; + } + else + string_dataformat.line_ncols = h5tools_nCols; + + string_dataformat.do_escape = display_escape; + outputformat = &string_dataformat; + + /* Build the object's path name */ + obj_path = (char *)HDmalloc(HDstrlen(prefix) + HDstrlen(name) + 2); + if(!obj_path) { + ret = FAIL; + goto done; + } + + HDstrcpy(obj_path, prefix); + HDstrcat(obj_path, "/"); + HDstrcat(obj_path, name); + + if(linfo->type == H5L_TYPE_HARD) { + H5O_info_t oinfo; + + /* Stat the object */ + if(H5Oget_info_by_name(group, name, &oinfo, H5P_DEFAULT) < 0) { + error_msg("unable to get object information for \"%s\"\n", name); + h5tools_setstatus(EXIT_FAILURE); + ret = FAIL; + goto done; + } /* end if */ + + switch(oinfo.type) { + case H5O_TYPE_GROUP: + if((obj = H5Gopen2(group, name, H5P_DEFAULT)) < 0) { + error_msg("unable to dump group \"%s\"\n", name); + h5tools_setstatus(EXIT_FAILURE); + ret = FAIL; + } + else { + char *old_prefix; /* Pointer to previous prefix */ + + /* Keep copy of prefix before iterating into group */ + old_prefix = HDstrdup(prefix); + HDassert(old_prefix); + + /* Append group name to prefix */ + add_prefix(&prefix, &prefix_len, name); + + /* Iterate into group */ + dump_function_table->dump_group_function(obj, name); + + /* Restore old prefix name */ + HDstrcpy(prefix, old_prefix); + HDfree(old_prefix); + + /* Close group */ + H5Gclose(obj); + } + break; + + case H5O_TYPE_DATASET: + if((obj = H5Dopen2(group, name, H5P_DEFAULT)) >= 0) { + if(oinfo.rc > 1 || hit_elink) { + obj_t *found_obj; /* Found object */ + + found_obj = search_obj(dset_table, oinfo.addr); + + if(found_obj == NULL) { + ctx.indent_level++; + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "%s \"%s\" %s", + h5tools_dump_header_format->datasetbegin, name, + h5tools_dump_header_format->datasetblockbegin); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + error_msg("internal error (file %s:line %d)\n", __FILE__, __LINE__); + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + if(HDstrlen(h5tools_dump_header_format->datasetblockend)) { + h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->datasetblockend); + if(HDstrlen(h5tools_dump_header_format->datasetend)) + h5tools_str_append(&buffer, " "); + } + if(HDstrlen(h5tools_dump_header_format->datasetend)) + h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->datasetend); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + ctx.indent_level--; + + h5tools_setstatus(EXIT_FAILURE); + ret = FAIL; + H5Dclose(obj); + goto done; + } + else if(found_obj->displayed) { + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "%s \"%s\" %s", + h5tools_dump_header_format->datasetbegin, name, + h5tools_dump_header_format->datasetblockbegin); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + ctx.indent_level++; + + ctx.need_prefix = TRUE; + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "%s \"%s\"", HARDLINK, found_obj->objname); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + ctx.indent_level--; + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + if(HDstrlen(h5tools_dump_header_format->datasetblockend)) { + h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->datasetblockend); + if(HDstrlen(h5tools_dump_header_format->datasetend)) + h5tools_str_append(&buffer, " "); + } + if(HDstrlen(h5tools_dump_header_format->datasetend)) + h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->datasetend); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + H5Dclose(obj); + goto done; + } + else { + found_obj->displayed = TRUE; + } + } /* end if */ + + dump_function_table->dump_dataset_function(obj, name, NULL); + H5Dclose(obj); + } + else { + error_msg("unable to dump dataset \"%s\"\n", name); + h5tools_setstatus(EXIT_FAILURE); + ret = FAIL; + } + break; + + case H5O_TYPE_NAMED_DATATYPE: + if((obj = H5Topen2(group, name, H5P_DEFAULT)) < 0) { + error_msg("unable to dump datatype \"%s\"\n", name); + h5tools_setstatus(EXIT_FAILURE); + ret = FAIL; + } + else { + dump_function_table->dump_named_datatype_function(obj, name); + H5Tclose(obj); + } + break; + + default: + error_msg("unknown object \"%s\"\n", name); + h5tools_setstatus(EXIT_FAILURE); + ret = FAIL; + } + } /* end if */ + else { + char *targbuf; + + switch(linfo->type) { + case H5L_TYPE_SOFT: + targbuf = (char *)HDmalloc(linfo->u.val_size); + HDassert(targbuf); + + ctx.need_prefix = TRUE; + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "%s \"%s\" %s", + h5tools_dump_header_format->softlinkbegin, name, + h5tools_dump_header_format->softlinkblockbegin); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + ctx.indent_level++; + + if(H5Lget_val(group, name, targbuf, linfo->u.val_size, H5P_DEFAULT) < 0) { + error_msg("unable to get link value\n"); + h5tools_setstatus(EXIT_FAILURE); + ret = FAIL; + } + else { + /* print the value of a soft link */ + /* Standard DDL: no modification */ + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "LINKTARGET \"%s\"", targbuf); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + } + + ctx.indent_level--; + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + if(HDstrlen(h5tools_dump_header_format->softlinkblockend)) { + h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->softlinkblockend); + if(HDstrlen(h5tools_dump_header_format->softlinkend)) + h5tools_str_append(&buffer, " "); + } + if(HDstrlen(h5tools_dump_header_format->softlinkend)) + h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->softlinkend); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + HDfree(targbuf); + break; + + case H5L_TYPE_EXTERNAL: + targbuf = (char *)HDmalloc(linfo->u.val_size); + HDassert(targbuf); + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "%s \"%s\" %s", + h5tools_dump_header_format->extlinkbegin, name, + h5tools_dump_header_format->extlinkblockbegin); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + if(H5Lget_val(group, name, targbuf, linfo->u.val_size, H5P_DEFAULT) < 0) { + indentation(dump_indent); + error_msg("unable to get external link value\n"); + h5tools_setstatus(EXIT_FAILURE); + ret = FAIL; + } /* end if */ + else { + const char *filename; + const char *targname; + + if(H5Lunpack_elink_val(targbuf, linfo->u.val_size, NULL, &filename, &targname) < 0) { + indentation(dump_indent); + error_msg("unable to unpack external link value\n"); + h5tools_setstatus(EXIT_FAILURE); + ret = FAIL; + } /* end if */ + else { + ctx.indent_level++; + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "TARGETFILE \"%s\"", filename); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "TARGETPATH \"%s\"", targname); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + /* dump the external link */ + dump_extlink(group, name, targname); + ctx.indent_level--; + } /* end else */ + } /* end else */ + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + if(HDstrlen(h5tools_dump_header_format->extlinkblockend)) { + h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->extlinkblockend); + if(HDstrlen(h5tools_dump_header_format->extlinkend)) + h5tools_str_append(&buffer, " "); + } + if(HDstrlen(h5tools_dump_header_format->extlinkend)) + h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->extlinkend); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + HDfree(targbuf); + break; + + default: + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "%s \"%s\" %s", + h5tools_dump_header_format->udlinkbegin, name, + h5tools_dump_header_format->udlinkblockbegin); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + ctx.indent_level++; + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "LINKCLASS %d", linfo->type); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + ctx.indent_level--; + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + /* Render the element */ + h5tools_str_reset(&buffer); + if(HDstrlen(h5tools_dump_header_format->udlinkblockend)) { + h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->udlinkblockend); + if(HDstrlen(h5tools_dump_header_format->udlinkend)) + h5tools_str_append(&buffer, " "); + } + if(HDstrlen(h5tools_dump_header_format->udlinkend)) + h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->udlinkend); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + break; + } /* end switch */ + } /* end else */ + +done: + + h5tools_str_close(&buffer); + + if(obj_path) + HDfree(obj_path); + return ret; +} + +/*------------------------------------------------------------------------- + * Function: dump_named_datatype + * + * Purpose: Dump named datatype + * + * Return: void + * + * Programmer: Ruey-Hsia Li + * + * Modifications: + * Pedro Vicente, March 27, 2006 + * added display of attributes + * Pedro Vicente, October 4, 2007, added parameters to H5Aiterate2() to allow for + * other iteration orders + * + *------------------------------------------------------------------------- + */ +void +dump_named_datatype(hid_t tid, const char *name) +{ + H5O_info_t oinfo; + unsigned attr_crt_order_flags; + hid_t tcpl_id = -1; /* datatype creation property list ID */ + hsize_t curr_pos = 0; /* total data element position */ + h5tools_str_t buffer; /* string into which to render */ + h5tools_context_t ctx; /* print context */ + h5tool_format_t *outputformat = &h5tools_dataformat; + h5tool_format_t string_dataformat; + + /* setup */ + HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + + HDmemset(&ctx, 0, sizeof(ctx)); + ctx.indent_level = dump_indent/COL; + ctx.cur_column = dump_indent; + + string_dataformat = *outputformat; + + if (fp_format) { + string_dataformat.fmt_double = fp_format; + string_dataformat.fmt_float = fp_format; + } + + if (h5tools_nCols==0) { + string_dataformat.line_ncols = 65535; + string_dataformat.line_per_line = 1; + } + else + string_dataformat.line_ncols = h5tools_nCols; + + string_dataformat.do_escape = display_escape; + outputformat = &string_dataformat; + + if ((tcpl_id = H5Tget_create_plist(tid)) < 0) { + error_msg("error in getting creation property list ID\n"); + h5tools_setstatus(EXIT_FAILURE); + } + + /* query the creation properties for attributes */ + if (H5Pget_attr_creation_order(tcpl_id, &attr_crt_order_flags) < 0) { + error_msg("error in getting creation properties\n"); + h5tools_setstatus(EXIT_FAILURE); + } + + if(H5Pclose(tcpl_id) < 0) { + error_msg("error in closing creation property list ID\n"); + h5tools_setstatus(EXIT_FAILURE); + } + + ctx.need_prefix = TRUE; + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "%s \"%s\" %s", + h5tools_dump_header_format->datatypebegin, name, + h5tools_dump_header_format->datatypeblockbegin); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + H5Oget_info(tid, &oinfo); + + /* Must check for uniqueness of all objects if we've traversed an elink, + * otherwise only check if the reference count > 1. + */ + if(oinfo.rc > 1 || hit_elink) { + obj_t *found_obj; /* Found object */ + + found_obj = search_obj(type_table, oinfo.addr); + + if (found_obj == NULL) { + error_msg("internal error (file %s:line %d)\n", __FILE__, __LINE__); + h5tools_setstatus(EXIT_FAILURE); + goto done; + } + else if (found_obj->displayed) { + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "%s \"%s\"", HARDLINK, found_obj->objname); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + goto done; + } + else + found_obj->displayed = TRUE; + } /* end if */ + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_print_datatype(rawoutstream, &buffer, outputformat, &ctx, tid, FALSE); + + if(H5Tget_class(tid) != H5T_COMPOUND) { + h5tools_str_append(&buffer, ";"); + } + + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + /* print attributes */ + dump_indent += COL; + + /* attribute iteration: if there is a request to do H5_INDEX_CRT_ORDER and tracking order is set + in the datatype's create property list for attributes, then, sort by creation order, otherwise by name */ + + if((sort_by == H5_INDEX_CRT_ORDER) && (attr_crt_order_flags & H5P_CRT_ORDER_TRACKED)) { + if(H5Aiterate2(tid, sort_by, sort_order, NULL, dump_attr_cb, NULL) < 0) { + error_msg("error getting attribute information\n"); + h5tools_setstatus(EXIT_FAILURE); + } /* end if */ + } /* end if */ + else { + if(H5Aiterate2(tid, H5_INDEX_NAME, sort_order, NULL, dump_attr_cb, NULL) < 0) { + error_msg("error getting attribute information\n"); + h5tools_setstatus(EXIT_FAILURE); + } /* end if */ + } /* end else */ + + dump_indent -= COL; + +done: + /* Render the element */ + h5tools_str_reset(&buffer); + if(HDstrlen(h5tools_dump_header_format->datatypeblockend)) { + h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->datatypeblockend); + if(HDstrlen(h5tools_dump_header_format->datatypeend)) + h5tools_str_append(&buffer, " "); + } + if(HDstrlen(h5tools_dump_header_format->datatypeend)) + h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->datatypeend); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + h5tools_str_close(&buffer); +} + +/*------------------------------------------------------------------------- + * Function: dump_group + * + * Purpose: Dump everything within the specified group + * + * Return: void + * + * Programmer: Ruey-Hsia Li + * + * Modifications: + * + * Call to dump_all_cb -- add parameter to select everything. + * + * Pedro Vicente, October 1, 2007 + * handle several iteration orders for attributes and groups + * + *------------------------------------------------------------------------- + */ +void +dump_group(hid_t gid, const char *name) +{ + H5O_info_t oinfo; + hid_t dset; + hid_t type; + hid_t gcpl_id; + unsigned crt_order_flags; + unsigned attr_crt_order_flags; + char type_name[1024]; + h5tools_str_t buffer; /* string into which to render */ + h5tools_context_t ctx; /* print context */ + h5tool_format_t *outputformat = &h5tools_dataformat; + h5tool_format_t string_dataformat; + hsize_t curr_pos = 0; /* total data element position */ + + if ((gcpl_id = H5Gget_create_plist(gid)) < 0) { + error_msg("error in getting group creation property list ID\n"); + h5tools_setstatus(EXIT_FAILURE); + } + + /* query the group creation properties for attributes */ + if (H5Pget_attr_creation_order(gcpl_id, &attr_crt_order_flags) < 0) { + error_msg("error in getting group creation properties\n"); + h5tools_setstatus(EXIT_FAILURE); + } + + /* query the group creation properties */ + if(H5Pget_link_creation_order(gcpl_id, &crt_order_flags) < 0) { + error_msg("error in getting group creation properties\n"); + h5tools_setstatus(EXIT_FAILURE); + } + + if(H5Pclose(gcpl_id) < 0) { + error_msg("error in closing group creation property list ID\n"); + h5tools_setstatus(EXIT_FAILURE); + } + + /* setup */ + HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + + HDmemset(&ctx, 0, sizeof(ctx)); + ctx.indent_level = dump_indent/COL; + ctx.cur_column = dump_indent; + + string_dataformat = *outputformat; + + if (fp_format) { + string_dataformat.fmt_double = fp_format; + string_dataformat.fmt_float = fp_format; + } + + if (h5tools_nCols==0) { + string_dataformat.line_ncols = 65535; + string_dataformat.line_per_line = 1; + } + else + string_dataformat.line_ncols = h5tools_nCols; + + string_dataformat.do_escape = display_escape; + outputformat = &string_dataformat; + + ctx.need_prefix = TRUE; + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "%s \"%s\" %s", + h5tools_dump_header_format->groupbegin, name, + h5tools_dump_header_format->groupblockbegin); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + ctx.indent_level++; + dump_indent += COL; + + if(!HDstrcmp(name, "/") && unamedtype) { + unsigned u; /* Local index variable */ + + /* dump unamed type in root group */ + for(u = 0; u < type_table->nobjs; u++) + if(!type_table->objs[u].recorded) { + dset = H5Dopen2(gid, type_table->objs[u].objname, H5P_DEFAULT); + type = H5Dget_type(dset); + sprintf(type_name, "#"H5_PRINTF_HADDR_FMT, type_table->objs[u].objno); + dump_function_table->dump_named_datatype_function(type, type_name); + H5Tclose(type); + H5Dclose(dset); + } + } /* end if */ + + if(display_oid) { + h5tools_dump_oid(rawoutstream, outputformat, &ctx, gid); + } + + h5tools_dump_comment(rawoutstream, outputformat, &ctx, gid); + + H5Oget_info(gid, &oinfo); + + /* Must check for uniqueness of all objects if we've traversed an elink, + * otherwise only check if the reference count > 1. + */ + if(oinfo.rc > 1 || hit_elink) { + obj_t *found_obj; /* Found object */ + + found_obj = search_obj(group_table, oinfo.addr); + + if (found_obj == NULL) { + error_msg("internal error (file %s:line %d)\n", __FILE__, __LINE__); + h5tools_setstatus(EXIT_FAILURE); + } + else if (found_obj->displayed) { + ctx.need_prefix = TRUE; + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "%s \"%s\"", HARDLINK, found_obj->objname); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + } + else { + found_obj->displayed = TRUE; + /* attribute iteration: if there is a request to do H5_INDEX_CRT_ORDER and tracking order is set + in the group for attributes, then, sort by creation order, otherwise by name */ + + if((sort_by == H5_INDEX_CRT_ORDER) && (attr_crt_order_flags & H5P_CRT_ORDER_TRACKED)) { + if(H5Aiterate2(gid, sort_by, sort_order, NULL, dump_attr_cb, NULL) < 0) { + error_msg("error getting attribute information\n"); + h5tools_setstatus(EXIT_FAILURE); + } /* end if */ + } /* end if */ + else { + if(H5Aiterate2(gid, H5_INDEX_NAME, sort_order, NULL, dump_attr_cb, NULL) < 0) { + error_msg("error getting attribute information\n"); + h5tools_setstatus(EXIT_FAILURE); + } /* end if */ + } /* end else */ + + /* if there is a request to do H5_INDEX_CRT_ORDER and tracking order is set + in the group, then, sort by creation order, otherwise by name */ + if((sort_by == H5_INDEX_CRT_ORDER) && (crt_order_flags & H5P_CRT_ORDER_TRACKED)) + H5Literate(gid, sort_by, sort_order, NULL, dump_all_cb, NULL); + else + H5Literate(gid, H5_INDEX_NAME, sort_order, NULL, dump_all_cb, NULL); + } + } + else { + /* attribute iteration: if there is a request to do H5_INDEX_CRT_ORDER and tracking order is set + in the group for attributes, then, sort by creation order, otherwise by name */ + + if((sort_by == H5_INDEX_CRT_ORDER) && (attr_crt_order_flags & H5P_CRT_ORDER_TRACKED)) { + if(H5Aiterate2(gid, sort_by, sort_order, NULL, dump_attr_cb, NULL) < 0) { + error_msg("error getting attribute information\n"); + h5tools_setstatus(EXIT_FAILURE); + } /* end if */ + } /* end if */ + else { + if(H5Aiterate2(gid, H5_INDEX_NAME, sort_order, NULL, dump_attr_cb, NULL) < 0) { + error_msg("error getting attribute information\n"); + h5tools_setstatus(EXIT_FAILURE); + } /* end if */ + } /* end else */ + + /* if there is a request to do H5_INDEX_CRT_ORDER and tracking order is set + in the group, then, sort by creation order, otherwise by name */ + if((sort_by == H5_INDEX_CRT_ORDER) && (crt_order_flags & H5P_CRT_ORDER_TRACKED)) + H5Literate(gid, sort_by, sort_order, NULL, dump_all_cb, NULL); + else + H5Literate(gid, H5_INDEX_NAME, sort_order, NULL, dump_all_cb, NULL); + } + + dump_indent -= COL; + ctx.indent_level--; + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + if(HDstrlen(h5tools_dump_header_format->groupblockend)) { + h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->groupblockend); + if(HDstrlen(h5tools_dump_header_format->groupend)) + h5tools_str_append(&buffer, " "); + } + if(HDstrlen(h5tools_dump_header_format->groupend)) + h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->groupend); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + h5tools_str_close(&buffer); +} + +/*------------------------------------------------------------------------- + * Function: dump_dataset + * + * Purpose: Dump the specified data set + * + * Return: void + * + * Programmer: Ruey-Hsia Li + * + * Modifications: + * Pedro Vicente, 2004, added dataset creation property list display + * Pedro Vicente, October 4, 2007, added parameters to H5Aiterate2() to allow for + * other iteration orders + * + *------------------------------------------------------------------------- + */ +void +dump_dataset(hid_t did, const char *name, struct subset_t *sset) +{ + h5tools_context_t ctx; /* print context */ + h5tool_format_t *outputformat = &h5tools_dataformat; + h5tool_format_t string_dataformat; + hid_t type, space; + unsigned attr_crt_order_flags; + hid_t dcpl_id; /* dataset creation property list ID */ + h5tools_str_t buffer; /* string into which to render */ + hsize_t curr_pos = 0; /* total data element position */ + + HDmemset(&ctx, 0, sizeof(ctx)); + ctx.indent_level = dump_indent/COL; + ctx.cur_column = dump_indent; + + string_dataformat = *outputformat; + + if (fp_format) { + string_dataformat.fmt_double = fp_format; + string_dataformat.fmt_float = fp_format; + } + + if (h5tools_nCols==0) { + string_dataformat.line_ncols = 65535; + string_dataformat.line_per_line = 1; + } + else + string_dataformat.line_ncols = h5tools_nCols; + + string_dataformat.do_escape = display_escape; + outputformat = &string_dataformat; + + if ((dcpl_id = H5Dget_create_plist(did)) < 0) { + error_msg("error in getting creation property list ID\n"); + h5tools_setstatus(EXIT_FAILURE); + } + + /* query the creation properties for attributes */ + if (H5Pget_attr_creation_order(dcpl_id, &attr_crt_order_flags) < 0) { + error_msg("error in getting creation properties\n"); + h5tools_setstatus(EXIT_FAILURE); + } + + /* setup */ + HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "%s \"%s\" %s", + h5tools_dump_header_format->datasetbegin, name, + h5tools_dump_header_format->datasetblockbegin); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + h5tools_dump_comment(rawoutstream, outputformat, &ctx, did); + + dump_indent += COL; + ctx.indent_level++; + + type = H5Dget_type(did); + h5dump_type_table = type_table; + h5tools_dump_datatype(rawoutstream, outputformat, &ctx, type); + h5dump_type_table = NULL; + + space = H5Dget_space(did); + h5tools_dump_dataspace(rawoutstream, outputformat, &ctx, space); + H5Sclose(space); + + if(display_oid) { + h5tools_dump_oid(rawoutstream, outputformat, &ctx, did); + } + + if(display_dcpl) { + h5dump_type_table = type_table; + h5tools_dump_dcpl(rawoutstream, outputformat, &ctx, dcpl_id, type, did); + h5dump_type_table = NULL; + } + H5Pclose(dcpl_id); + + if(display_data) { + int data_loop = 1; + int i; + if(display_packed_bits) + data_loop = packed_bits_num; + for(i=0; iline_ncols, 0, 0); + } + switch(H5Tget_class(type)) { + case H5T_TIME: + ctx.indent_level++; + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "DATA{ not yet implemented.}"); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + ctx.indent_level--; + break; + + case H5T_INTEGER: + case H5T_FLOAT: + case H5T_STRING: + case H5T_BITFIELD: + case H5T_OPAQUE: + case H5T_COMPOUND: + case H5T_REFERENCE: + case H5T_ENUM: + case H5T_VLEN: + case H5T_ARRAY: + { + h5tools_dump_data(rawoutstream, outputformat, &ctx, did, TRUE, sset, display_ai, display_char); + } + break; + + default: + break; + } /* end switch */ + } /* for(i=0;idatasetblockend)) { + h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->datasetblockend); + if(HDstrlen(h5tools_dump_header_format->datasetend)) + h5tools_str_append(&buffer, " "); + } + if(HDstrlen(h5tools_dump_header_format->datasetend)) + h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->datasetend); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + h5tools_str_close(&buffer); +} + +/*------------------------------------------------------------------------- + * Function: dump_data + * + * Purpose: Dump attribute or dataset data + * + * Return: void + * + * Programmer: Ruey-Hsia Li + * + * Modifications: pvn, print the matrix indices + * Albert Cheng, 2004/11/18 + * Add --string printing for attributes too. + * + *------------------------------------------------------------------------- + */ +void +dump_data(hid_t obj_id, int obj_data, struct subset_t *sset, int display_index) +{ + h5tools_context_t ctx; /* print context */ + h5tool_format_t *outputformat = &h5tools_dataformat; + h5tool_format_t string_dataformat; + int print_dataset = FALSE; + + string_dataformat = *outputformat; + + if (fp_format) { + string_dataformat.fmt_double = fp_format; + string_dataformat.fmt_float = fp_format; + } + + if (h5tools_nCols==0) { + string_dataformat.line_ncols = 65535; + string_dataformat.line_per_line = 1; + } + else + string_dataformat.line_ncols = h5tools_nCols; + + string_dataformat.do_escape = display_escape; + outputformat = &string_dataformat; + + HDmemset(&ctx, 0, sizeof(ctx)); + ctx.indent_level = dump_indent/COL; + ctx.cur_column = dump_indent; + + if(obj_data == DATASET_DATA) + print_dataset = TRUE; + h5tools_dump_data(rawoutstream, outputformat, &ctx, obj_id, print_dataset, sset, display_index, display_char); +} + + +/*------------------------------------------------------------------------- + * Function: dump_fcpl + * + * Purpose: prints file creation property list information + * + * Return: void + * + * Programmer: pvn + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +void +dump_fcpl(hid_t fid) +{ + hid_t fcpl; /* file creation property list ID */ + hsize_t userblock; /* userblock size retrieved from FCPL */ + size_t off_size; /* size of offsets in the file */ + size_t len_size; /* size of lengths in the file */ +#ifdef SHOW_FILE_DRIVER + hid_t fapl; /* file access property list ID */ + hid_t fdriver; /* file driver */ + char dname[32]; /* buffer to store driver name */ +#endif + unsigned sym_lk; /* symbol table B-tree leaf 'K' value */ + unsigned sym_ik; /* symbol table B-tree internal 'K' value */ + unsigned istore_ik; /* indexed storage B-tree internal 'K' value */ + H5F_file_space_type_t fs_strategy; /* file space strategy */ + hsize_t fs_threshold; /* free-space section threshold */ + H5F_info2_t finfo; /* file information */ + + fcpl=H5Fget_create_plist(fid); + H5Fget_info2(fid, &finfo); + H5Pget_userblock(fcpl,&userblock); + H5Pget_sizes(fcpl,&off_size,&len_size); + H5Pget_sym_k(fcpl,&sym_ik,&sym_lk); + H5Pget_istore_k(fcpl,&istore_ik); + H5Pget_file_space(fcpl, &fs_strategy, &fs_threshold); + H5Pclose(fcpl); +#ifdef SHOW_FILE_DRIVER + fapl=h5_fileaccess(); + fdriver=H5Pget_driver(fapl); + H5Pclose(fapl); +#endif + + /*------------------------------------------------------------------------- + * SUPER_BLOCK + *------------------------------------------------------------------------- + */ + HDfprintf(rawoutstream, "\n%s %s\n",SUPER_BLOCK, BEGIN); + indentation(dump_indent + COL); + HDfprintf(rawoutstream, "%s %u\n","SUPERBLOCK_VERSION", finfo.super.version); + indentation(dump_indent + COL); + HDfprintf(rawoutstream, "%s %u\n","FREELIST_VERSION", finfo.free.version); + indentation(dump_indent + COL); + HDfprintf(rawoutstream, "%s %u\n","SYMBOLTABLE_VERSION", 0); /* Retain this for backward compatibility, for now (QAK) */ + indentation(dump_indent + COL); + HDfprintf(rawoutstream, "%s %u\n","OBJECTHEADER_VERSION", finfo.sohm.version); + indentation(dump_indent + COL); + HDfprintf(rawoutstream,"%s %Hd\n","OFFSET_SIZE", (long long)off_size); + indentation(dump_indent + COL); + HDfprintf(rawoutstream,"%s %Hd\n","LENGTH_SIZE", (long long)len_size); + indentation(dump_indent + COL); + HDfprintf(rawoutstream, "%s %u\n","BTREE_RANK", sym_ik); + indentation(dump_indent + COL); + HDfprintf(rawoutstream, "%s %d\n","BTREE_LEAF", sym_lk); + +#ifdef SHOW_FILE_DRIVER + if (H5FD_CORE==fdriver) + HDstrcpy(dname,"H5FD_CORE"); +#ifdef H5_HAVE_DIRECT + else if (H5FD_DIRECT==fdriver) + HDstrcpy(dname,"H5FD_DIRECT"); +#endif + else if (H5FD_FAMILY==fdriver) + HDstrcpy(dname,"H5FD_FAMILY"); + else if (H5FD_LOG==fdriver) + HDstrcpy(dname,"H5FD_LOG"); + else if (H5FD_MPIO==fdriver) + HDstrcpy(dname,"H5FD_MPIO"); + else if (H5FD_MULTI==fdriver) + HDstrcpy(dname,"H5FD_MULTI"); + else if (H5FD_SEC2==fdriver) + HDstrcpy(dname,"H5FD_SEC2"); + else if (H5FD_STDIO==fdriver) + HDstrcpy(dname,"H5FD_STDIO"); +#ifdef H5_HAVE_STREAM + else if (H5FD_STREAM==fdriver) + HDstrcpy(dname,"H5FD_STREAM"); +#endif + else + HDstrcpy(dname,"Unknown driver"); + + /* Take out this because the driver used can be different from the + * standard output. */ + /*indentation(dump_indent + COL); + HDfprintf(rawoutstream, "%s %s\n","FILE_DRIVER", dname);*/ +#endif + indentation(dump_indent + COL); + HDfprintf(rawoutstream, "%s %u\n","ISTORE_K", istore_ik); + + indentation(dump_indent + COL); + if(fs_strategy == H5F_FILE_SPACE_ALL_PERSIST) + HDfprintf(rawoutstream, "%s %s\n", "FILE_SPACE_STRATEGY", "H5F_FILE_SPACE_ALL_PERSIST"); + else if(fs_strategy == H5F_FILE_SPACE_ALL) + HDfprintf(rawoutstream, "%s %s\n", "FILE_SPACE_STRATEGY", "H5F_FILE_SPACE_ALL"); + else if(fs_strategy == H5F_FILE_SPACE_AGGR_VFD) + HDfprintf(rawoutstream, "%s %s\n", "FILE_SPACE_STRATEGY", "H5F_FILE_SPACE_AGGR_VFD"); + else if(fs_strategy == H5F_FILE_SPACE_VFD) + HDfprintf(rawoutstream, "%s %s\n", "FILE_SPACE_STRATEGY", "H5F_FILE_SPACE_VFD"); + else + HDfprintf(rawoutstream, "%s %s\n", "FILE_SPACE_STRATEGY", "Unknown strategy"); + indentation(dump_indent + COL); + HDfprintf(rawoutstream, "%s %Hu\n","FREE_SPACE_THRESHOLD", fs_threshold); + + /*------------------------------------------------------------------------- + * USER_BLOCK + *------------------------------------------------------------------------- + */ + indentation(dump_indent + COL); + HDfprintf(rawoutstream, "USER_BLOCK %s\n",BEGIN); + indentation(dump_indent + COL + COL); + HDfprintf(rawoutstream,"%s %Hu\n","USERBLOCK_SIZE", userblock); + indentation(dump_indent + COL); + HDfprintf(rawoutstream, "%s\n",END); + + HDfprintf(rawoutstream, "%s",END); +} + +/*------------------------------------------------------------------------- + * Function: dump_fcontents + * + * Purpose: prints all objects + * + * Return: void + * + * Programmer: pvn + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +void +dump_fcontents(hid_t fid) +{ + HDfprintf(rawoutstream, "%s %s\n",FILE_CONTENTS, BEGIN); + + /* special case of unamed types in root group */ + if (unamedtype) { + unsigned u; + + for (u = 0; u < type_table->nobjs; u++) { + if (!type_table->objs[u].recorded) + HDfprintf(rawoutstream, " %-10s /#"H5_PRINTF_HADDR_FMT"\n", "datatype", type_table->objs[u].objno); + } + } + + /* print objects in the files */ + h5trav_print(fid); + + HDfprintf(rawoutstream, " %s\n",END); +} + +/*------------------------------------------------------------------------- + * Function: handle_attributes + * + * Purpose: Handle the attributes from the command. + * + * Return: void + * + * Programmer: Bill Wendling + * Tuesday, 9. January 2001 + * + * Modifications: + * + * PVN, May 2008 + * add an extra parameter PE, to allow printing/not printing of error messages + * + *------------------------------------------------------------------------- + */ +void +handle_attributes(hid_t fid, const char *attr, void UNUSED * data, int UNUSED pe, const char UNUSED *display_name) +{ + hid_t oid = -1; + hid_t attr_id = -1; + char *obj_name; + char *attr_name; + int j; + h5tools_str_t buffer; /* string into which to render */ + h5tools_context_t ctx; /* print context */ + h5tool_format_t *outputformat = &h5tools_dataformat; + h5tool_format_t string_dataformat; + hsize_t curr_pos = 0; /* total data element position */ + + j = (int)HDstrlen(attr) - 1; + obj_name = (char *)HDmalloc((size_t)j + 2); + if(obj_name == NULL) + goto error; + + /* find the last / */ + while(j >= 0) { + if (attr[j] == '/' && (j==0 || (j>0 && attr[j-1]!='\\'))) + break; + j--; + } + + /* object name */ + if(j == -1) + HDstrcpy(obj_name, "/"); + else { + HDstrncpy(obj_name, attr, (size_t)j + 1); + obj_name[j + 1] = '\0'; + } /* end else */ + + dump_indent += COL; + HDmemset(&ctx, 0, sizeof(ctx)); + ctx.indent_level = dump_indent/COL; + ctx.cur_column = dump_indent; + + string_dataformat = *outputformat; + + if (fp_format) { + string_dataformat.fmt_double = fp_format; + string_dataformat.fmt_float = fp_format; + } + + if (h5tools_nCols==0) { + string_dataformat.line_ncols = 65535; + string_dataformat.line_per_line = 1; + } + else + string_dataformat.line_ncols = h5tools_nCols; + + string_dataformat.do_escape = display_escape; + outputformat = &string_dataformat; + + //attr_name = attr + j + 1; + // need to replace escape characters + attr_name = h5tools_str_replace(attr + j + 1, "\\/", "/"); + + + /* handle error case: cannot open the object with the attribute */ + if((oid = H5Oopen(fid, obj_name, H5P_DEFAULT)) < 0) { + /* setup */ + HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "%s \"%s\" %s", + h5tools_dump_header_format->attributebegin, attr, + h5tools_dump_header_format->attributeblockbegin); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + error_msg("unable to open object \"%s\"\n", obj_name); + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + /* Render the element */ + h5tools_str_reset(&buffer); + if(HDstrlen(h5tools_dump_header_format->attributeblockend)) { + h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->attributeblockend); + if(HDstrlen(h5tools_dump_header_format->attributeend)) + h5tools_str_append(&buffer, " "); + } + if(HDstrlen(h5tools_dump_header_format->attributeend)) + h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->attributeend); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + h5tools_str_close(&buffer); + + goto error; + } /* end if */ + + attr_id = H5Aopen(oid, attr_name, H5P_DEFAULT); + oid_output = display_oid; + data_output = display_data; + attr_data_output = display_attr_data; + + h5dump_type_table = type_table; + h5tools_dump_attribute(rawoutstream, outputformat, &ctx, oid, attr_name, attr_id, display_ai, display_char); + h5dump_type_table = NULL; + + if(attr_id < 0) { + goto error; + } + + /* Close object */ + if(H5Oclose(oid) < 0) { + goto error; + } /* end if */ + + HDfree(obj_name); + HDfree(attr_name); + dump_indent -= COL; + return; + +error: + h5tools_setstatus(EXIT_FAILURE); + if(obj_name) + HDfree(obj_name); + + if (attr_name) + HDfree(attr_name); + + H5E_BEGIN_TRY { + H5Oclose(oid); + H5Aclose(attr_id); + } H5E_END_TRY; + dump_indent -= COL; +} + +/*------------------------------------------------------------------------- + * Function: handle_datasets + * + * Purpose: Handle the datasets from the command. + * + * Return: void + * + * Programmer: Bill Wendling + * Tuesday, 9. January 2001 + * + * Modifications: + * Pedro Vicente, Tuesday, January 15, 2008 + * check for block overlap\ + * + * Pedro Vicente, May 8, 2008 + * added a flag PE that prints/not prints error messages + * added for cases of external links not found, to avoid printing of + * objects not found, since external links are dumped on a trial error basis + * + *------------------------------------------------------------------------- + */ +void +handle_datasets(hid_t fid, const char *dset, void *data, int pe, const char *display_name) +{ + H5O_info_t oinfo; + hid_t dsetid; + struct subset_t *sset = (struct subset_t *)data; + const char *real_name = display_name ? display_name : dset; + + if((dsetid = H5Dopen2(fid, dset, H5P_DEFAULT)) < 0) { + if (pe) { + handle_links(fid, dset, data, pe, display_name); + } + return; + } /* end if */ + + if(sset) { + unsigned int i; + hid_t sid = H5Dget_space(dsetid); + int ndims = H5Sget_simple_extent_ndims(sid); + + H5Sclose(sid); + if(ndims < 0) { + error_msg("H5Sget_simple_extent_ndims failed\n"); + h5tools_setstatus(EXIT_FAILURE); + return; + } + + if(!sset->start.data || !sset->stride.data || !sset->count.data || !sset->block.data) { + /* they didn't specify a ``stride'' or ``block''. default to 1 in all + * dimensions */ + if(!sset->start.data) { + /* default to (0, 0, ...) for the start coord */ + sset->start.data = (hsize_t *)HDcalloc((size_t)ndims, sizeof(hsize_t)); + sset->start.len = ndims; + } + + if(!sset->stride.data) { + sset->stride.data = (hsize_t *)HDcalloc((size_t)ndims, sizeof(hsize_t)); + sset->stride.len = ndims; + for (i = 0; i < ndims; i++) + sset->stride.data[i] = 1; + } + + if(!sset->count.data) { + sset->count.data = (hsize_t *)HDcalloc((size_t)ndims, sizeof(hsize_t)); + sset->count.len = ndims; + for (i = 0; i < ndims; i++) + sset->count.data[i] = 1; + } + + if(!sset->block.data) { + sset->block.data = (hsize_t *)HDcalloc((size_t)ndims, sizeof(hsize_t)); + sset->block.len = ndims; + for (i = 0; i < ndims; i++) + sset->block.data[i] = 1; + } + } + + /*------------------------------------------------------------------------- + * check for dimension overflow + *------------------------------------------------------------------------- + */ + if(sset->start.len > ndims) { + error_msg("number of start dims (%u) exceed dataset dims (%u)\n", sset->start.len, ndims); + h5tools_setstatus(EXIT_FAILURE); + return; + } + if(sset->stride.len > ndims) { + error_msg("number of stride dims (%u) exceed dataset dims (%u)\n", sset->stride.len, ndims); + h5tools_setstatus(EXIT_FAILURE); + return; + } + if(sset->count.len > ndims) { + error_msg("number of count dims (%u) exceed dataset dims (%u)\n", sset->count.len, ndims); + h5tools_setstatus(EXIT_FAILURE); + return; + } + if(sset->block.len > ndims) { + error_msg("number of block dims (%u) exceed dataset dims (%u)\n", sset->block.len, ndims); + h5tools_setstatus(EXIT_FAILURE); + return; + } + + /*------------------------------------------------------------------------- + * check for block overlap + *------------------------------------------------------------------------- + */ + for(i = 0; i < ndims; i++) { + if(sset->count.data[i] > 1) { + if(sset->stride.data[i] < sset->block.data[i]) { + error_msg("wrong subset selection; blocks overlap\n"); + h5tools_setstatus(EXIT_FAILURE); + return; + } /* end if */ + } /* end if */ + } /* end for */ + } /* end if */ + + + H5Oget_info(dsetid, &oinfo); + if(oinfo.rc > 1 || hit_elink) { + obj_t *found_obj; /* Found object */ + + found_obj = search_obj(dset_table, oinfo.addr); + + if(found_obj) { + if (found_obj->displayed) { + HDfprintf(rawoutstream, "\n"); + indentation(dump_indent); + begin_obj(h5tools_dump_header_format->datasetbegin, real_name, h5tools_dump_header_format->datasetblockbegin); + HDfprintf(rawoutstream, "\n"); + indentation(dump_indent + COL); + HDfprintf(rawoutstream, "%s \"%s\"\n", HARDLINK, found_obj->objname); + indentation(dump_indent); + end_obj(h5tools_dump_header_format->datasetend, h5tools_dump_header_format->datasetblockend); + } + else { + found_obj->displayed = TRUE; + dump_indent += COL; + dump_dataset(dsetid, real_name, sset); + dump_indent -= COL; + } + } + else + h5tools_setstatus(EXIT_FAILURE); + } + else { + dump_indent += COL; + dump_dataset(dsetid, real_name, sset); + dump_indent -= COL; + } + + if(H5Dclose(dsetid) < 0) + h5tools_setstatus(EXIT_FAILURE); +} + +/*------------------------------------------------------------------------- + * Function: handle_groups + * + * Purpose: Handle the groups from the command. + * + * Return: void + * + * Programmer: Bill Wendling + * Tuesday, 9. January 2001 + * + * Modifications: Pedro Vicente, September 26, 2007 + * handle creation order + * + * Pedro Vicente, May 8, 2008 + * added a flag PE that prints/not prints error messages + * added for cases of external links not found, to avoid printing of + * objects not found, since external links are dumped on a trial error basis + * + *------------------------------------------------------------------------- + */ +void +handle_groups(hid_t fid, const char *group, void UNUSED *data, int pe, const char *display_name) +{ + hid_t gid; + const char *real_name = display_name ? display_name : group; + + if((gid = H5Gopen2(fid, group, H5P_DEFAULT)) < 0) { + if (pe) { + HDfprintf(rawoutstream, "\n"); + begin_obj(h5tools_dump_header_format->groupbegin, real_name, h5tools_dump_header_format->groupblockbegin); + HDfprintf(rawoutstream, "\n"); + indentation(COL); + error_msg("unable to open group \"%s\"\n", real_name); + end_obj(h5tools_dump_header_format->groupend, h5tools_dump_header_format->groupblockend); + h5tools_setstatus(EXIT_FAILURE); + } + } + else { + size_t new_len = HDstrlen(group) + 1; + + if(prefix_len <= new_len) { + prefix_len = new_len; + prefix = (char *)HDrealloc(prefix, prefix_len); + } /* end if */ + + HDstrcpy(prefix, group); + + dump_indent += COL; + dump_group(gid, real_name); + dump_indent -= COL; + + if(H5Gclose(gid) < 0) + h5tools_setstatus(EXIT_FAILURE); + } /* end else */ +} /* end handle_groups() */ + +/*------------------------------------------------------------------------- + * Function: handle_links + * + * Purpose: Handle soft or UD links from the command. + * + * Return: void + * + * Programmer: Bill Wendling + * Tuesday, 9. January 2001 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +void +handle_links(hid_t fid, const char *links, void UNUSED * data, int UNUSED pe, const char UNUSED *display_name) +{ + H5L_info_t linfo; + + if(H5Lget_info(fid, links, &linfo, H5P_DEFAULT) < 0) { + error_msg("unable to get link info from \"%s\"\n", links); + h5tools_setstatus(EXIT_FAILURE); + } + else if(linfo.type == H5L_TYPE_HARD) { + error_msg("\"%s\" is a hard link\n", links); + h5tools_setstatus(EXIT_FAILURE); + } + else { + char *buf = (char *)HDmalloc(linfo.u.val_size); + HDfprintf(rawoutstream, "\n"); + + switch(linfo.type) { + case H5L_TYPE_SOFT: /* Soft link */ + begin_obj(h5tools_dump_header_format->softlinkbegin, links, h5tools_dump_header_format->softlinkblockbegin); + HDfprintf(rawoutstream, "\n"); + indentation(COL); + if(H5Lget_val(fid, links, buf, linfo.u.val_size, H5P_DEFAULT) >= 0) + HDfprintf(rawoutstream, "LINKTARGET \"%s\"\n", buf); + else { + error_msg("h5dump error: unable to get link value for \"%s\"\n", links); + h5tools_setstatus(EXIT_FAILURE); + } + end_obj(h5tools_dump_header_format->softlinkend, h5tools_dump_header_format->softlinkblockend); + break; + + case H5L_TYPE_EXTERNAL: + begin_obj(h5tools_dump_header_format->udlinkbegin, links, h5tools_dump_header_format->udlinkblockbegin); + HDfprintf(rawoutstream, "\n"); + indentation(COL); + begin_obj(h5tools_dump_header_format->extlinkbegin, links, h5tools_dump_header_format->extlinkblockbegin); + HDfprintf(rawoutstream, "\n"); + if(H5Lget_val(fid, links, buf, linfo.u.val_size, H5P_DEFAULT) >= 0) { + const char *elink_file; + const char *elink_path; + + if(H5Lunpack_elink_val(buf, linfo.u.val_size, NULL, &elink_file, &elink_path)>=0) { + indentation(COL); + HDfprintf(rawoutstream, "LINKCLASS %d\n", linfo.type); + indentation(COL); + HDfprintf(rawoutstream, "TARGETFILE \"%s\"\n", elink_file); + indentation(COL); + HDfprintf(rawoutstream, "TARGETPATH \"%s\"\n", elink_path); + } + else { + error_msg("h5dump error: unable to unpack external link value for \"%s\"\n", links); + h5tools_setstatus(EXIT_FAILURE); + } + } + else { + error_msg("h5dump error: unable to get external link value for \"%s\"\n", links); + h5tools_setstatus(EXIT_FAILURE); + } + end_obj(h5tools_dump_header_format->extlinkend, h5tools_dump_header_format->extlinkblockend); + break; + + default: + begin_obj(h5tools_dump_header_format->udlinkbegin, links, h5tools_dump_header_format->udlinkblockbegin); + HDfprintf(rawoutstream, "\n"); + indentation(COL); + begin_obj(h5tools_dump_header_format->udlinkbegin, links, h5tools_dump_header_format->udlinkblockbegin); + HDfprintf(rawoutstream, "\n"); + indentation(COL); + HDfprintf(rawoutstream, "LINKCLASS %d\n", linfo.type); + end_obj(h5tools_dump_header_format->udlinkend, h5tools_dump_header_format->udlinkblockend); + break; + } /* end switch */ + HDfree(buf); + } /* end else */ +} + +/*------------------------------------------------------------------------- + * Function: handle_datatypes + * + * Purpose: Handle the datatypes from the command. + * + * Return: void + * + * Programmer: Bill Wendling + * Tuesday, 9. January 2001 + * + * Modifications: + * + * Pedro Vicente, May 8, 2008 + * added a flag PE that prints/not prints error messages + * added for cases of external links not found, to avoid printing of + * objects not found, since external links are dumped on a trial error basis + * + *------------------------------------------------------------------------- + */ +void +handle_datatypes(hid_t fid, const char *type, void UNUSED * data, int pe, const char *display_name) +{ + hid_t type_id; + const char *real_name = display_name ? display_name : type; + + if((type_id = H5Topen2(fid, type, H5P_DEFAULT)) < 0) { + /* check if type is unamed datatype */ + unsigned idx = 0; + + while(idx < type_table->nobjs ) { + char name[128]; + + if(!type_table->objs[idx].recorded) { + /* unamed datatype */ + sprintf(name, "/#"H5_PRINTF_HADDR_FMT, type_table->objs[idx].objno); + + if(!HDstrcmp(name, real_name)) + break; + } /* end if */ + + idx++; + } /* end while */ + + if(idx == type_table->nobjs) { + if (pe) { + /* unknown type */ + HDfprintf(rawoutstream, "\n"); + begin_obj(h5tools_dump_header_format->datatypebegin, real_name, h5tools_dump_header_format->datatypeblockbegin); + HDfprintf(rawoutstream, "\n"); + indentation(COL); + error_msg("unable to open datatype \"%s\"\n", real_name); + end_obj(h5tools_dump_header_format->datatypeend, h5tools_dump_header_format->datatypeblockend); + h5tools_setstatus(EXIT_FAILURE); + } + } + else { + hid_t dsetid = H5Dopen2(fid, type_table->objs[idx].objname, H5P_DEFAULT); + type_id = H5Dget_type(dsetid); + + dump_indent += COL; + dump_named_datatype(type_id, real_name); + dump_indent -= COL; + + H5Tclose(type_id); + H5Dclose(dsetid); + } + } + else { + dump_indent += COL; + dump_named_datatype(type_id, real_name); + dump_indent -= COL; + + if(H5Tclose(type_id) < 0) + h5tools_setstatus(EXIT_FAILURE); + } +} + + +/*------------------------------------------------------------------------- + * Function: dump_extlink + * + * made by: PVN + * + * Purpose: Dump an external link + * Since external links are soft links, they are dumped on a trial error + * basis, attempting to dump as a dataset, as a group and as a named datatype + * Error messages are supressed + * + * Modifications: + * Neil Fortner + * 13 October 2008 + * Function basically rewritten. No longer directly opens the target file, + * now initializes a new set of tables for the external file. No longer + * dumps on a trial and error basis, but errors are still suppressed. + * + *------------------------------------------------------------------------- + */ + + +static int dump_extlink(hid_t group, const char *linkname, const char *objname) +{ + hid_t oid; + H5O_info_t oi; + table_t *old_group_table = group_table; + table_t *old_dset_table = dset_table; + table_t *old_type_table = type_table; + hbool_t old_hit_elink; + ssize_t idx; + + /* Open target object */ + if ((oid = H5Oopen(group, linkname, H5P_DEFAULT)) < 0) + goto fail; + + /* Get object info */ + if (H5Oget_info(oid, &oi) < 0) { + H5Oclose(oid); + goto fail; + } + + /* Check if we have visited this file already */ + if ((idx = table_list_visited(oi.fileno)) < 0) { + /* We have not visited this file, build object tables */ + if ((idx = table_list_add(oid, oi.fileno)) < 0) { + H5Oclose(oid); + goto fail; + } + } + + /* Do not recurse through an external link into the original file (idx=0) */ + if (idx) { + /* Update table pointers */ + group_table = table_list.tables[idx].group_table; + dset_table = table_list.tables[idx].dset_table; + type_table = table_list.tables[idx].type_table; + + /* We will now traverse the external link, set this global to indicate this */ + old_hit_elink = hit_elink; + hit_elink = TRUE; + + /* add some indentation to distinguish that these objects are external */ + dump_indent += COL; + + /* Recurse into the external file */ + switch (oi.type) { + case H5O_TYPE_GROUP: + handle_groups(group, linkname, NULL, 0, objname); + break; + case H5O_TYPE_DATASET: + handle_datasets(group, linkname, NULL, 0, objname); + break; + case H5O_TYPE_NAMED_DATATYPE: + handle_datatypes(group, linkname, NULL, 0, objname); + break; + default: + h5tools_setstatus(EXIT_FAILURE); + } + + dump_indent -= COL; + + /* Reset table pointers */ + group_table = old_group_table; + dset_table = old_dset_table; + type_table = old_type_table; + + /* Reset hit_elink */ + hit_elink = old_hit_elink; + } /* end if */ + + if (H5Idec_ref(oid) < 0) + h5tools_setstatus(EXIT_FAILURE); + + return SUCCEED; + +fail: + return FAIL; +} + diff --git a/tools/h5dump/h5dump_ddl.h b/tools/h5dump/h5dump_ddl.h new file mode 100644 index 0000000..c769194 --- /dev/null +++ b/tools/h5dump/h5dump_ddl.h @@ -0,0 +1,50 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +#ifndef H5DUMP_DDL_H__ +#define H5DUMP_DDL_H__ + +/* callback function used by H5Literate() */ +static herr_t dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void *op_data); +static int dump_extlink(hid_t group, const char *linkname, const char *objname); + +#ifdef __cplusplus +extern "C" { +#endif + +/* The dump functions of the dump_function_table */ +/* standard format: no change */ +void dump_group(hid_t, const char *); +void dump_named_datatype(hid_t, const char *); +void dump_dataset(hid_t, const char *, struct subset_t *); +void dump_dataspace(hid_t space); +void dump_datatype(hid_t type); +void dump_data(hid_t, int, struct subset_t *, int); +void dump_fcpl(hid_t fid); +void dump_fcontents(hid_t fid); + +/* callback function used by H5Aiterate2() */ +herr_t dump_attr_cb(hid_t loc_id, const char *attr_name, const H5A_info_t *info, void *_op_data); + +void handle_datasets(hid_t fid, const char *dset, void *data, int pe, const char *display_name); +void handle_attributes(hid_t fid, const char *attr, void UNUSED * data, int UNUSED pe, const char UNUSED *display_name); +void handle_groups(hid_t fid, const char *group, void UNUSED *data, int pe, const char *display_name); +void handle_links(hid_t fid, const char *links, void UNUSED * data, int UNUSED pe, const char UNUSED *display_name); +void handle_datatypes(hid_t fid, const char *type, void UNUSED * data, int pe, const char *display_name); + +#ifdef __cplusplus +} +#endif + +#endif /* !H5DUMP_DDL_H__ */ diff --git a/tools/h5dump/h5dump_defines.h b/tools/h5dump/h5dump_defines.h new file mode 100644 index 0000000..4af5360 --- /dev/null +++ b/tools/h5dump/h5dump_defines.h @@ -0,0 +1,54 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +#ifndef H5DUMP_DEFINES_H__ +#define H5DUMP_DEFINES_H__ + +#define H5DUMP_MAX_RANK H5S_MAX_RANK + +#define ATTRIBUTE_DATA 0 +#define DATASET_DATA 1 +#define ENUM_DATA 2 +#define COL 3 + +/* Macros for displaying objects */ +#define begin_obj(obj,name,begin) \ + do { \ + if (name) \ + HDfprintf(rawoutstream, "%s \"%s\" %s", (obj), (name), (begin)); \ + else \ + HDfprintf(rawoutstream, "%s %s", (obj), (begin)); \ + } while(0); + +#define end_obj(obj,end) \ + do { \ + if(HDstrlen(end)) { \ + HDfprintf(rawoutstream, "%s", end); \ + if(HDstrlen(obj)) \ + HDfprintf(rawoutstream, " "); \ + } \ + if(HDstrlen(obj)) \ + HDfprintf(rawoutstream, "%s", obj); \ + } while(0); + + +/* 3 private values: can't be set, but can be read. + Note: these are defined in H5Zprivate, they are + duplicated here. + */ +#define H5_SZIP_LSB_OPTION_MASK 8 +#define H5_SZIP_MSB_OPTION_MASK 16 +#define H5_SZIP_RAW_OPTION_MASK 128 + +#endif /* !H5DUMP_DEFINES_H__ */ diff --git a/tools/h5dump/h5dump_extern.h b/tools/h5dump/h5dump_extern.h new file mode 100644 index 0000000..5a0f2bd --- /dev/null +++ b/tools/h5dump/h5dump_extern.h @@ -0,0 +1,112 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +#ifndef H5DUMP_EXTERN_H__ +#define H5DUMP_EXTERN_H__ + +#include "hdf5.h" +#include "H5private.h" +#include "h5tools.h" +#include "h5tools_utils.h" +#include "h5tools_ref.h" +#include "h5trav.h" +#include "h5dump_defines.h" + +/** + ** This is the global dispatch table for the dump functions. + **/ +/* the table of dump functions */ +typedef struct dump_functions_t { + void (*dump_group_function) (hid_t, const char *); + void (*dump_named_datatype_function) (hid_t, const char *); + void (*dump_dataset_function) (hid_t, const char *, struct subset_t *); + void (*dump_dataspace_function) (hid_t); + void (*dump_datatype_function) (hid_t); + herr_t (*dump_attribute_function) (hid_t, const char *, const H5A_info_t *, void *); + void (*dump_data_function) (hid_t, int, struct subset_t *, int); +} dump_functions; + +/* List of table structures. There is one table structure for each file */ +typedef struct h5dump_table_list_t { + size_t nalloc; + size_t nused; + struct { + unsigned long fileno; /* File number that these tables refer to */ + hid_t oid; /* ID of an object in this file, held open so fileno is consistent */ + table_t *group_table; /* Table of groups */ + table_t *dset_table; /* Table of datasets */ + table_t *type_table; /* Table of datatypes */ + } *tables; +} h5dump_table_list_t; + +extern h5dump_table_list_t table_list; +extern table_t *group_table, *dset_table, *type_table; +extern int dump_indent; /*how far in to indent the line */ + +extern int unamedtype; /* shared datatype with no name */ +extern hbool_t hit_elink; /* whether we have traversed an external link */ +extern size_t prefix_len; +extern char *prefix; +extern const char *fp_format; + +/* things to display or which are set via command line parameters */ +extern int display_all; +extern int display_oid; +extern int display_data; +extern int display_attr_data; +extern int display_char; /*print 1-byte numbers as ASCII */ +extern int usingdasho; +extern int display_bb; /*superblock */ +extern int display_dcpl; /*dcpl */ +extern int display_fi; /*file index */ +extern int display_ai; /*array index */ +extern int display_escape; /*escape non printable characters */ +extern int display_region; /*print region reference data */ +extern int enable_error_stack; /* re-enable error stack */ +extern int disable_compact_subset; /* disable compact form of subset notation */ +extern int display_packed_bits; /*print 1-8 byte numbers as packed bits*/ + +/* sort parameters */ +extern H5_index_t sort_by; /*sort_by [creation_order | name] */ +extern H5_iter_order_t sort_order; /*sort_order [ascending | descending] */ + +#define PACKED_BITS_MAX 8 /* Maximum number of packed-bits to display */ +#define PACKED_BITS_SIZE_MAX 8*sizeof(long long) /* Maximum bits size of integer types of packed-bits */ +/* mask list for packed bits */ +extern unsigned long long packed_mask[PACKED_BITS_MAX]; /* packed bits are restricted to 8*sizeof(llong) bytes */ + +/* packed bits display parameters */ +extern int packed_offset[PACKED_BITS_MAX]; +extern int packed_length[PACKED_BITS_MAX]; + +/* + * The global table is set to either ddl_function_table or + * xml_function_table in the initialization. + */ +extern const dump_functions *dump_function_table; + +#ifdef __cplusplus +extern "C" { +#endif + +void add_prefix(char **prfx, size_t *prfx_len, const char *name); +hid_t h5_fileaccess(void); +ssize_t table_list_add(hid_t oid, unsigned long file_no); +ssize_t table_list_visited(unsigned long file_no); + +#ifdef __cplusplus +} +#endif + +#endif /* !H5DUMP_EXTERN_H__ */ diff --git a/tools/h5dump/h5dump_xml.c b/tools/h5dump/h5dump_xml.c new file mode 100644 index 0000000..e6f8043 --- /dev/null +++ b/tools/h5dump/h5dump_xml.c @@ -0,0 +1,4456 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * 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 + +#include "H5private.h" +#include "h5tools.h" +#include "h5tools_dump.h" +#include "h5tools_utils.h" +#include "h5tools_ref.h" +#include "h5trav.h" +#include "h5dump_extern.h" +#include "h5dump_xml.h" + +const char *xmlnsprefix="hdf5:"; + +/* internal functions */ +static int xml_name_to_XID(const char *, char *, int , int ); + +/* internal functions used by XML option */ +static void xml_print_datatype(hid_t, unsigned); +static void xml_print_enum(hid_t); +static int xml_print_refs(hid_t, int); +static int xml_print_strs(hid_t, int); +static char *xml_escape_the_string(const char *, int); +static char *xml_escape_the_name(const char *); + +/*------------------------------------------------------------------------- + * Function: dump_all_cb + * + * Purpose: function callback called by H5Literate, + * displays everything in the specified object + * + * Return: Success: SUCCEED + * + * Failure: FAIL + * + * Programmer: Ruey-Hsia Li + * + * Modifications: + * RMcG, November 2000 + * Added XML support. Also, optionally checks the op_data argument + * + * PVN, May 2008 + * Dump external links + * + *------------------------------------------------------------------------- + */ +static herr_t +xml_dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void UNUSED *op_data) +{ + hid_t obj; + herr_t ret = SUCCEED; + char *obj_path = NULL; /* Full path of object */ + h5tools_str_t buffer; /* string into which to render */ + h5tools_context_t ctx; /* print context */ + h5tool_format_t *outputformat = &xml_dataformat; + h5tool_format_t string_dataformat; + hsize_t curr_pos = 0; /* total data element position */ + + /* setup */ + HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + + HDmemset(&ctx, 0, sizeof(ctx)); + ctx.indent_level = dump_indent/COL; + ctx.cur_column = dump_indent; + + string_dataformat = *outputformat; + + if (fp_format) { + string_dataformat.fmt_double = fp_format; + string_dataformat.fmt_float = fp_format; + } + + if (h5tools_nCols==0) { + string_dataformat.line_ncols = 65535; + string_dataformat.line_per_line = 1; + } + else + string_dataformat.line_ncols = h5tools_nCols; + + string_dataformat.do_escape = display_escape; + outputformat = &string_dataformat; + + /* Build the object's path name */ + obj_path = (char *)HDmalloc(HDstrlen(prefix) + HDstrlen(name) + 2); + if(!obj_path) { + ret = FAIL; + goto done; + } + + HDstrcpy(obj_path, prefix); + HDstrcat(obj_path, "/"); + HDstrcat(obj_path, name); + + if(linfo->type == H5L_TYPE_HARD) { + H5O_info_t oinfo; + + /* Stat the object */ + if(H5Oget_info_by_name(group, name, &oinfo, H5P_DEFAULT) < 0) { + error_msg("unable to get object information for \"%s\"\n", name); + h5tools_setstatus(EXIT_FAILURE); + ret = FAIL; + goto done; + } /* end if */ + + switch(oinfo.type) { + case H5O_TYPE_GROUP: + if((obj = H5Gopen2(group, name, H5P_DEFAULT)) < 0) { + error_msg("unable to dump group \"%s\"\n", name); + h5tools_setstatus(EXIT_FAILURE); + ret = FAIL; + } + else { + char *old_prefix; /* Pointer to previous prefix */ + + /* Keep copy of prefix before iterating into group */ + old_prefix = HDstrdup(prefix); + HDassert(old_prefix); + + /* Append group name to prefix */ + add_prefix(&prefix, &prefix_len, name); + + /* Iterate into group */ + dump_function_table->dump_group_function(obj, name); + + /* Restore old prefix name */ + HDstrcpy(prefix, old_prefix); + HDfree(old_prefix); + + /* Close group */ + H5Gclose(obj); + } + break; + + case H5O_TYPE_DATASET: + if((obj = H5Dopen2(group, name, H5P_DEFAULT)) >= 0) { + if(oinfo.rc > 1 || hit_elink) { + obj_t *found_obj; /* Found object */ + + found_obj = search_obj(dset_table, oinfo.addr); + + if(found_obj == NULL) { + ctx.indent_level++; + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "%s \"%s\" %s", + h5tools_dump_header_format->datasetbegin, name, + h5tools_dump_header_format->datasetblockbegin); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + error_msg("internal error (file %s:line %d)\n", __FILE__, __LINE__); + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + if(HDstrlen(h5tools_dump_header_format->datasetblockend)) { + h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->datasetblockend); + if(HDstrlen(h5tools_dump_header_format->datasetend)) + h5tools_str_append(&buffer, " "); + } + if(HDstrlen(h5tools_dump_header_format->datasetend)) + h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->datasetend); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + ctx.indent_level--; + + h5tools_setstatus(EXIT_FAILURE); + ret = FAIL; + H5Dclose(obj); + goto done; + } + else if(found_obj->displayed) { + /* the XML version */ + char *t_obj_path = xml_escape_the_name(obj_path); + char *t_prefix = xml_escape_the_name(HDstrcmp(prefix,"") ? prefix : "/"); + char *t_name = xml_escape_the_name(name); + char *t_objname = xml_escape_the_name(found_obj->objname); + char dsetxid[100]; + char parentxid[100]; + char pointerxid[100]; + + /* Create OBJ-XIDs for the parent and object */ + xml_name_to_XID(obj_path, dsetxid, sizeof(dsetxid), 1); + xml_name_to_XID(prefix, parentxid, sizeof(parentxid), 1); + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sDataset Name=\"%s\" OBJ-XID=\"%s-%d\" " + "H5Path=\"%s\" Parents=\"%s\" " + "H5ParentPaths=\"%s\">", + xmlnsprefix, + t_name, /* Dataset Name */ + dsetxid, get_next_xid(), /* OBJ-XID */ + t_obj_path, /* H5Path */ + parentxid, /* Parents */ + t_prefix); /* H5ParentPaths */ + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + xml_name_to_XID(found_obj->objname, pointerxid, sizeof(pointerxid), 1); + + ctx.indent_level++; + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sDatasetPtr OBJ-XID=\"%s\" H5Path=\"%s\"/>", + xmlnsprefix, + pointerxid,t_objname); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + ctx.indent_level--; + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + HDfree(t_name); + HDfree(t_obj_path); + HDfree(t_prefix); + HDfree(t_objname); + + H5Dclose(obj); + goto done; + } + else { + found_obj->displayed = TRUE; + } + } /* end if */ + + dump_function_table->dump_dataset_function(obj, name, NULL); + H5Dclose(obj); + } + else { + error_msg("unable to dump dataset \"%s\"\n", name); + h5tools_setstatus(EXIT_FAILURE); + ret = FAIL; + } + break; + + case H5O_TYPE_NAMED_DATATYPE: + if((obj = H5Topen2(group, name, H5P_DEFAULT)) < 0) { + error_msg("unable to dump datatype \"%s\"\n", name); + h5tools_setstatus(EXIT_FAILURE); + ret = FAIL; + } + else { + dump_function_table->dump_named_datatype_function(obj, name); + H5Tclose(obj); + } + break; + + default: + error_msg("unknown object \"%s\"\n", name); + h5tools_setstatus(EXIT_FAILURE); + ret = FAIL; + } + } /* end if */ + else { + char *targbuf; + + switch(linfo->type) { + case H5L_TYPE_SOFT: + targbuf = (char *)HDmalloc(linfo->u.val_size); + HDassert(targbuf); + + if(H5Lget_val(group, name, targbuf, linfo->u.val_size, H5P_DEFAULT) < 0) { + error_msg("unable to get link value\n"); + h5tools_setstatus(EXIT_FAILURE); + ret = FAIL; + } + else { + /* print the value of a soft link */ + /* XML */ + char linkxid[100]; + char parentxid[100]; + char targetxid[100]; + char *t_prefix = xml_escape_the_name(HDstrcmp(prefix,"") ? prefix : "/"); + char *t_name = xml_escape_the_name(name); + char *t_targbuf = xml_escape_the_name(targbuf); + char *t_obj_path = xml_escape_the_name(obj_path); + char *t_link_path; + int res; + + t_link_path = (char *)HDmalloc(HDstrlen(prefix) + linfo->u.val_size + 1); + if(targbuf[0] == '/') + HDstrcpy(t_link_path, targbuf); + else { + HDstrcpy(t_link_path, prefix); + HDstrcat(HDstrcat(t_link_path, "/"), targbuf); + } /* end else */ + + /* Create OBJ-XIDs for the parent and object */ + xml_name_to_XID(t_obj_path, linkxid, sizeof(linkxid), 1); + xml_name_to_XID(prefix, parentxid, sizeof(parentxid), 1); + + /* Try to create an OBJ-XID for the object pointed to */ + res = xml_name_to_XID(t_link_path, targetxid, sizeof(targetxid), 0); + if (res == 0) { + /* target obj found */ + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sSoftLink LinkName=\"%s\" " + "OBJ-XID=\"%s\" " + "H5SourcePath=\"%s\" " + "TargetPath=\"%s\" TargetObj=\"%s\" " + "Parents=\"%s\" H5ParentPaths=\"%s\" />", + xmlnsprefix, + t_name, /* LinkName */ + linkxid, /* OBJ-XID */ + t_obj_path, /* H5SourcePath */ + t_targbuf, /* TargetPath */ + targetxid, /* TargetObj */ + parentxid, /* Parents */ + t_prefix); /* H5ParentPaths */ + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + } + else { + /* dangling link -- omit from xml attributes */ + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sSoftLink LinkName=\"%s\" " + "OBJ-XID=\"%s\" " + "H5SourcePath=\"%s\" " + "TargetPath=\"%s\" " + "Parents=\"%s\" H5ParentPaths=\"%s\" />", + xmlnsprefix, + t_name, /* LinkName */ + linkxid, /* OBJ-XID */ + t_obj_path, /* H5SourcePath */ + t_targbuf, /* TargetPath */ + parentxid, /* Parents */ + t_prefix); /* H5ParentPaths */ + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + } + + HDfree(t_prefix); + HDfree(t_name); + HDfree(t_targbuf); + HDfree(t_obj_path); + HDfree(t_link_path); + } + + HDfree(targbuf); + break; + + case H5L_TYPE_EXTERNAL: + targbuf = (char *)HDmalloc(linfo->u.val_size); + HDassert(targbuf); + + if(H5Lget_val(group, name, targbuf, linfo->u.val_size, H5P_DEFAULT) < 0) { + error_msg("unable to get external link value\n"); + h5tools_setstatus(EXIT_FAILURE); + ret = FAIL; + } /* end if */ + else { + const char *filename; + const char *targname; + + if(H5Lunpack_elink_val(targbuf, linfo->u.val_size, NULL, &filename, &targname) < 0) { + error_msg("unable to unpack external link value\n"); + h5tools_setstatus(EXIT_FAILURE); + ret = FAIL; + } /* end if */ + else { + char linkxid[100]; + char parentxid[100]; + char *t_name = xml_escape_the_name(name); + char *t_prefix = xml_escape_the_name(HDstrcmp(prefix,"") ? prefix : "/"); + char *t_obj_path = xml_escape_the_name(obj_path); + char *t_filename = xml_escape_the_name(filename); + char *t_targname = xml_escape_the_name(targname); + + /* Create OBJ-XIDs for the parent and object */ + xml_name_to_XID(t_obj_path, linkxid, sizeof(linkxid), 1); + xml_name_to_XID(prefix, parentxid, sizeof(parentxid), 1); + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sExternalLink LinkName=\"%s\" " + "OBJ-XID=\"%s\" " + "H5SourcePath=\"%s\" " + "TargetFilename=\"%s\" " + "TargetPath=\"%s\" " + "Parents=\"%s\" H5ParentPaths=\"%s\" />", + xmlnsprefix, + t_name, /* LinkName */ + linkxid, /* OBJ-XID */ + t_obj_path, /* H5SourcePath */ + filename, /* TargetFilename */ + targname, /* TargetPath*/ + parentxid, /* Parents */ + t_prefix); /* H5ParentPaths */ + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + HDfree(t_prefix); + HDfree(t_name); + HDfree(t_filename); + HDfree(t_targname); + HDfree(t_obj_path); + } /* end else */ + } /* end else */ + HDfree(targbuf); + break; + + default: + { + char linkxid[100]; + char parentxid[100]; + char *t_name = xml_escape_the_name(name); + char *t_prefix = xml_escape_the_name(HDstrcmp(prefix,"") ? prefix : "/"); + char *t_obj_path = xml_escape_the_name(obj_path); + + /* Create OBJ-XIDs for the parent and object */ + xml_name_to_XID(t_obj_path, linkxid, sizeof(linkxid), 1); + xml_name_to_XID(prefix, parentxid, sizeof(parentxid), 1); + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sUserDefined LinkName=\"%s\" " + "OBJ-XID=\"%s\" " + "H5SourcePath=\"%s\" " + "LinkClass=\"%d\" " + "Parents=\"%s\" H5ParentPaths=\"%s\" />", + xmlnsprefix, + t_name, /* LinkName */ + linkxid, /* OBJ-XID */ + t_obj_path, /* H5SourcePath */ + linfo->type, /* LinkClass */ + parentxid, /* Parents */ + t_prefix); /* H5ParentPaths */ + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + HDfree(t_prefix); + HDfree(t_name); + HDfree(t_obj_path); + } + break; + } /* end switch */ + } /* end else */ + +done: + + h5tools_str_close(&buffer); + + if(obj_path) + HDfree(obj_path); + return ret; +} + +/* + * create a string suitable for and XML NCNAME. Uses the + * object reference to create the string. + * + * 'gen'; 0 - return null if not found + * 1 - generate a fake entry and return fake id. + */ +int +xml_name_to_XID(const char *str , char *outstr, int outlen, int gen) +{ + haddr_t objno; /* Object ID for object at path */ + + if (outlen < 22) return 1; + + objno = ref_path_table_lookup(str); + if (objno == HADDR_UNDEF) { + if (HDstrlen(str) == 0) { + objno = ref_path_table_lookup("/"); + if (objno == HADDR_UNDEF) { + if (gen) { + objno = ref_path_table_gen_fake(str); + sprintf(outstr, "xid_"H5_PRINTF_HADDR_FMT, objno); + return 0; + } + else { + return 1; + } + } + } + else { + if (gen) { + objno = ref_path_table_gen_fake(str); + sprintf(outstr, "xid_"H5_PRINTF_HADDR_FMT, objno); + return 0; + } + else { + return 1; + } + } + } + + sprintf(outstr, "xid_"H5_PRINTF_HADDR_FMT, objno); + + return(0); +} + +static const char *quote = """; +static const char *amp = "&"; +static const char *lt = "<"; +static const char *gt = ">"; +static const char *apos = "'"; + +/*------------------------------------------------------------------------- + * Function: xml_escape_the_name + * + * Purpose: Escape XML reserved chars in a name, so HDF5 strings + * and paths can be correctly read back in XML element. + * + * Return: The revised string. + * + * Programmer: REMcG + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +static char * +xml_escape_the_name(const char *str) +{ + size_t extra; + size_t len; + size_t i; + const char *cp; + char *ncp; + char *rcp; + + if (!str) + return NULL; + + cp = str; + len = HDstrlen(str); + extra = 0; + + for (i = 0; i < len; i++) { + if (*cp == '\"') { + extra += (HDstrlen(quote) - 1); + } + else if (*cp == '\'') { + extra += (HDstrlen(apos) - 1); + } + else if (*cp == '<') { + extra += (HDstrlen(lt) - 1); + } + else if (*cp == '>') { + extra += (HDstrlen(gt) - 1); + } + else if (*cp == '&') { + extra += (HDstrlen(amp) - 1); + } + + cp++; + } + + if (extra == 0) + return HDstrdup(str); + + cp = str; + rcp = ncp = (char *)HDmalloc(len + extra + 1); + + if (!ncp) + return NULL; /* ?? */ + + for (i = 0; i < len; i++) { + if (*cp == '\'') { + HDstrncpy(ncp, apos, HDstrlen(apos)); + ncp += HDstrlen(apos); + cp++; + } + else if (*cp == '<') { + HDstrncpy(ncp, lt, HDstrlen(lt)); + ncp += HDstrlen(lt); + cp++; + } + else if (*cp == '>') { + HDstrncpy(ncp, gt, HDstrlen(gt)); + ncp += HDstrlen(gt); + cp++; + } + else if (*cp == '\"') { + HDstrncpy(ncp, quote, HDstrlen(quote)); + ncp += HDstrlen(quote); + cp++; + } + else if (*cp == '&') { + HDstrncpy(ncp, amp, HDstrlen(amp)); + ncp += HDstrlen(amp); + cp++; + } + else { + *ncp++ = *cp++; + } + } + + *ncp = '\0'; + return rcp; +} + +/*------------------------------------------------------------------------- + * Function: xml_escape_the_string + * + * Purpose: Escape XML reserved chars in a string, so HDF5 strings + * and paths can be correctly read back in XML CDATA. + * + * Return: The revised string. + * + * Programmer: REMcG + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +static char * +xml_escape_the_string(const char *str, int slen) +{ + size_t extra; + size_t len; + size_t i; + const char *cp; + char *ncp; + char *rcp; + + if (!str) + return NULL; + + cp = str; + + if (slen < 0) + len = HDstrlen(str); + else + len = slen; + + extra = 0; + + for (i = 0; i < len; i++) { + if (*cp == '\\') { + extra++; + } + else if (*cp == '\"') { + extra++; + } + else if (*cp == '\'') { + extra += (HDstrlen(apos) - 1); + } + else if (*cp == '<') { + extra += (HDstrlen(lt) - 1); + } + else if (*cp == '>') { + extra += (HDstrlen(gt) - 1); + } + else if (*cp == '&') { + extra += (HDstrlen(amp) - 1); + } + cp++; + } + + cp = str; + rcp = ncp = (char *) HDcalloc((len + extra + 1), sizeof(char)); + + if (ncp == NULL) + return NULL; /* ?? */ + + for (i = 0; i < len; i++) { + if (*cp == '\\') { + *ncp++ = '\\'; + *ncp++ = *cp++; + } + else if (*cp == '\"') { + *ncp++ = '\\'; + *ncp++ = *cp++; + } + else if (*cp == '\'') { + HDstrncpy(ncp, apos, HDstrlen(apos)); + ncp += HDstrlen(apos); + cp++; + } + else if (*cp == '<') { + HDstrncpy(ncp, lt, HDstrlen(lt)); + ncp += HDstrlen(lt); + cp++; + } + else if (*cp == '>') { + HDstrncpy(ncp, gt, HDstrlen(gt)); + ncp += HDstrlen(gt); + cp++; + } + else if (*cp == '&') { + HDstrncpy(ncp, amp, HDstrlen(amp)); + ncp += HDstrlen(amp); + cp++; + } + else { + *ncp++ = *cp++; + } + } + + *ncp = '\0'; + return rcp; +} + +/** + ** XML print functions--these replace some functions in the + ** h5tools.c suite. + **/ + +/*------------------------------------------------------------------------- + * Function: xml_print_datatype + * + * Purpose: Print description of a datatype in XML. + * Note: this is called inside a element. + * + * Return: void + * + * Programmer: REMcG + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +static void +xml_print_datatype(hid_t type, unsigned in_group) +{ + char *mname; + hid_t mtype; + unsigned nmembers; + unsigned ndims; + unsigned i; + size_t size; + hsize_t dims[H5DUMP_MAX_RANK]; + H5T_str_t str_pad; + H5T_cset_t cset; + hid_t super; + H5T_order_t ord; + H5T_sign_t sgn; + size_t sz; + size_t spos; + size_t epos; + size_t esize; + size_t mpos; + size_t msize; + int nmembs; + htri_t is_vlstr=FALSE; + h5tools_str_t buffer; /* string into which to render */ + h5tools_context_t ctx; /* print context */ + h5tool_format_t *outputformat = &xml_dataformat; + h5tool_format_t string_dataformat; + hsize_t curr_pos = 0; /* total data element position */ + + /* setup */ + HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + + HDmemset(&ctx, 0, sizeof(ctx)); + ctx.indent_level = dump_indent/COL; + ctx.cur_column = dump_indent; + + string_dataformat = *outputformat; + + if (fp_format) { + string_dataformat.fmt_double = fp_format; + string_dataformat.fmt_float = fp_format; + } + + if (h5tools_nCols==0) { + string_dataformat.line_ncols = 65535; + string_dataformat.line_per_line = 1; + } + else + string_dataformat.line_ncols = h5tools_nCols; + + string_dataformat.do_escape = display_escape; + outputformat = &string_dataformat; + + if(!in_group && H5Tcommitted(type) > 0) { + H5O_info_t oinfo; + obj_t *found_obj; /* Found object */ + + /* detect a shared datatype, output only once */ + H5Oget_info(type, &oinfo); + found_obj = search_obj(type_table, oinfo.addr); + + if(found_obj) { + /* This should be defined somewhere else */ + /* These 2 cases are handled the same right now, but + probably will have something different eventually */ + char * dtxid = (char *)HDmalloc(100); + + xml_name_to_XID(found_obj->objname, dtxid, 100, 1); + if (!found_obj->recorded) { + /* 'anonymous' NDT. Use it's object num. + as it's name. */ + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sNamedDataTypePtr OBJ-XID=\"/%s\"/>", + xmlnsprefix, dtxid); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + } + else { + /* point to the NDT by name */ + char *t_objname = xml_escape_the_name(found_obj->objname); + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sNamedDataTypePtr OBJ-XID=\"%s\" H5Path=\"%s\"/>", + xmlnsprefix, dtxid, t_objname); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + HDfree(t_objname); + } + HDfree(dtxid); + } + else { + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, ""); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_setstatus(EXIT_FAILURE); + } + } + else { + + switch (H5Tget_class(type)) { + case H5T_INTEGER: + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sAtomicType>",xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + ctx.indent_level++; + + /* */ + ord = H5Tget_order(type); + sgn = H5Tget_sign(type); + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sIntegerType ByteOrder=\"",xmlnsprefix); + switch (ord) { + case H5T_ORDER_LE: + h5tools_str_append(&buffer, "LE"); + break; + case H5T_ORDER_BE: + h5tools_str_append(&buffer, "BE"); + break; + case H5T_ORDER_VAX: + default: + h5tools_str_append(&buffer, "ERROR_UNKNOWN"); + } + + h5tools_str_append(&buffer, "\" Sign=\""); + + switch (sgn) { + case H5T_SGN_NONE: + h5tools_str_append(&buffer, "false"); + break; + case H5T_SGN_2: + h5tools_str_append(&buffer, "true"); + break; + default: + h5tools_str_append(&buffer, "ERROR_UNKNOWN"); + } + + h5tools_str_append(&buffer, "\" Size=\""); + sz = H5Tget_size(type); + h5tools_str_append(&buffer, "%lu", (unsigned long)sz); + h5tools_str_append(&buffer, "\" />"); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + ctx.indent_level--; + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "",xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + break; + + case H5T_FLOAT: + /* */ + ord = H5Tget_order(type); + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sAtomicType>",xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + ctx.indent_level++; + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sFloatType ByteOrder=\"",xmlnsprefix); + + switch (ord) { + case H5T_ORDER_LE: + h5tools_str_append(&buffer, "LE"); + break; + case H5T_ORDER_BE: + h5tools_str_append(&buffer, "BE"); + break; + case H5T_ORDER_VAX: + h5tools_str_append(&buffer, "VAX"); + break; + default: + h5tools_str_append(&buffer, "ERROR_UNKNOWN"); + } + + h5tools_str_append(&buffer, "\" Size=\""); + sz = H5Tget_size(type); + h5tools_str_append(&buffer, "%lu", (unsigned long)sz); + H5Tget_fields(type, &spos, &epos, &esize, &mpos, &msize); + h5tools_str_append(&buffer, "\" SignBitLocation=\"%lu\" ", (unsigned long)spos); + h5tools_str_append(&buffer, "ExponentBits=\"%lu\" ExponentLocation=\"%lu\" ", (unsigned long)esize, (unsigned long)epos); + h5tools_str_append(&buffer, "MantissaBits=\"%lu\" MantissaLocation=\"%lu\" />", (unsigned long)msize, (unsigned long)mpos); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + ctx.indent_level--; + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "",xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + break; + + case H5T_TIME: + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sAtomicType>",xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + ctx.indent_level++; + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sTimeType />",xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_str_append(&buffer, ""); + ctx.indent_level--; + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "",xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + break; + + case H5T_STRING: + /* */ + size = H5Tget_size(type); + str_pad = H5Tget_strpad(type); + cset = H5Tget_cset(type); + is_vlstr = H5Tis_variable_str(type); + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sAtomicType>",xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + ctx.indent_level++; + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sStringType Cset=\"",xmlnsprefix); + if (cset == H5T_CSET_ASCII) { + h5tools_str_append(&buffer, "H5T_CSET_ASCII\" "); + } + else { + h5tools_str_append(&buffer, "unknown_cset\" "); + } + if(is_vlstr) + h5tools_str_append(&buffer, "StrSize=\"H5T_VARIABLE\" StrPad=\""); + else + h5tools_str_append(&buffer, "StrSize=\"%d\" StrPad=\"", (int) size); + if (str_pad == H5T_STR_NULLTERM) { + h5tools_str_append(&buffer, "H5T_STR_NULLTERM\"/>"); + } + else if (str_pad == H5T_STR_NULLPAD) { + h5tools_str_append(&buffer, "H5T_STR_NULLPAD\"/>"); + } + else if (str_pad == H5T_STR_SPACEPAD) { + h5tools_str_append(&buffer, "H5T_STR_SPACEPAD\"/>"); + } + else { + h5tools_str_append(&buffer, "H5T_STR_ERROR\"/>"); + } + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + ctx.indent_level--; + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "",xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + break; + + case H5T_BITFIELD: + /* */ + ord = H5Tget_order(type); + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sAtomicType>",xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + ctx.indent_level++; + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sBitfieldType ByteOrder=\"",xmlnsprefix); + + switch (ord) { + case H5T_ORDER_LE: + h5tools_str_append(&buffer, "LE"); + break; + case H5T_ORDER_BE: + h5tools_str_append(&buffer, "BE"); + break; + case H5T_ORDER_VAX: + default: + h5tools_str_append(&buffer, "ERROR_UNKNOWN"); + } + + size = H5Tget_size(type); + h5tools_str_append(&buffer, "\" Size=\"%lu\"/>", (unsigned long)size); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + ctx.indent_level--; + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "",xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + break; + + case H5T_OPAQUE: + /* */ + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sAtomicType>",xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + ctx.indent_level++; + mname = H5Tget_tag(type); + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sOpaqueType Tag=\"%s\" ",xmlnsprefix, mname); + HDfree(mname); + size = H5Tget_size(type); + h5tools_str_append(&buffer, "Size=\"%lu\"/>", (unsigned long)size); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + ctx.indent_level--; + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "",xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + break; + + case H5T_COMPOUND: + /* recursively describe the components of a compound datatype */ + + /* type of a dataset */ + nmembers = H5Tget_nmembers(type); + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sCompoundType>",xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + /* List each member Field of the type */ + /* */ + /* */ + ctx.indent_level++; + dump_indent += COL; + for (i = 0; i < nmembers; i++) { + char *t_fname; + + mname = H5Tget_member_name(type, i); + mtype = H5Tget_member_type(type, i); + t_fname = xml_escape_the_name(mname); + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sField FieldName=\"%s\">",xmlnsprefix, t_fname); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + HDfree(mname); + HDfree(t_fname); + dump_indent += COL; + ctx.indent_level++; + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sDataType>",xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + ctx.indent_level++; + dump_indent += COL; + xml_print_datatype(mtype,0); + dump_indent -= COL; + ctx.indent_level--; + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "",xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + dump_indent -= COL; + ctx.indent_level--; + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "",xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + } + dump_indent -= COL; + ctx.indent_level--; + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "",xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + break; + + case H5T_REFERENCE: + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sAtomicType>",xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + ctx.indent_level++; + /* Only Object references supported at this time */ + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sReferenceType>",xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + ctx.indent_level++; + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sObjectReferenceType />",xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + ctx.indent_level--; + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "",xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + ctx.indent_level--; + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "",xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + break; + + case H5T_ENUM: + /* list Name, values of enum */ + nmembs = H5Tget_nmembers(type); + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sAtomicType>",xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + dump_indent += COL; + ctx.indent_level++; + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sEnumType Nelems=\"%d\">",xmlnsprefix, nmembs); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + xml_print_enum(type); + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "",xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + dump_indent -= COL; + ctx.indent_level--; + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "",xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + break; + + case H5T_VLEN: + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sVLType>",xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + super = H5Tget_super(type); + dump_indent += COL; + ctx.indent_level++; + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sDataType>",xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + dump_indent += COL; + ctx.indent_level++; + xml_print_datatype(super,0); + dump_indent -= COL; + ctx.indent_level--; + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "",xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + dump_indent -= COL; + ctx.indent_level--; + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "",xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + H5Tclose(super); + + break; + + case H5T_ARRAY: + /* Get array base type */ + super = H5Tget_super(type); + + /* Print lead-in */ + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sArrayType Ndims=\"",xmlnsprefix); + ndims = H5Tget_array_ndims(type); + h5tools_str_append(&buffer, "%u\">", ndims); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + /* Get array information */ + H5Tget_array_dims2(type, dims); + + /* list of dimensions */ + ctx.indent_level++; + for (i = 0; i < ndims; i++) { + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sArrayDimension DimSize=\"%u\"/>", xmlnsprefix, (int) dims[i]); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + } + ctx.indent_level--; + + dump_indent += COL; + ctx.indent_level++; + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sDataType>",xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + dump_indent += COL; + ctx.indent_level++; + xml_print_datatype(super,0); + dump_indent -= COL; + ctx.indent_level--; + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "",xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + dump_indent -= COL; + ctx.indent_level--; + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "",xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + /* Close array base type */ + H5Tclose(super); + break; + + default: + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, ""); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + h5tools_setstatus(EXIT_FAILURE); + break; + } + } /* end else */ + + h5tools_str_close(&buffer); +} + +/*------------------------------------------------------------------------- + * Function: xml_dump_datatype + * + * Purpose: Dump description of a datatype in XML. + * + * Return: void + * + * Programmer: REMcG + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +void +xml_dump_datatype(hid_t type) +{ + h5tools_str_t buffer; /* string into which to render */ + h5tools_context_t ctx; /* print context */ + h5tool_format_t *outputformat = &xml_dataformat; + h5tool_format_t string_dataformat; + hsize_t curr_pos = 0; /* total data element position */ + + /* setup */ + HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + + HDmemset(&ctx, 0, sizeof(ctx)); + ctx.indent_level = dump_indent/COL; + ctx.cur_column = dump_indent; + + string_dataformat = *outputformat; + + if (fp_format) { + string_dataformat.fmt_double = fp_format; + string_dataformat.fmt_float = fp_format; + } + + if (h5tools_nCols==0) { + string_dataformat.line_ncols = 65535; + string_dataformat.line_per_line = 1; + } + else + string_dataformat.line_ncols = h5tools_nCols; + + string_dataformat.do_escape = display_escape; + outputformat = &string_dataformat; + + ctx.indent_level++; + dump_indent += COL; + + if(H5Tcommitted(type) > 0) { + H5O_info_t oinfo; + obj_t *found_obj; /* Found object */ + + /* Datatype is a shared or named datatype */ + H5Oget_info(type, &oinfo); + found_obj = search_obj(type_table, oinfo.addr); + + if(found_obj) { + /* Shared datatype, must be entered as an object */ + /* These 2 cases are the same now, but may change */ + char *dtxid = (char *)HDmalloc(100); + + xml_name_to_XID(found_obj->objname, dtxid, 100, 1); + if (!found_obj->recorded) { + /* anonymous stored datatype: + following the dumper's current + practice: + use it's object ref as its name + */ + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sNamedDataTypePtr OBJ-XID=\"%s\"/>", + xmlnsprefix, dtxid); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + } + else { + /* pointer to a named datatype already in XML */ + char *t_objname = xml_escape_the_name(found_obj->objname); + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sNamedDataTypePtr OBJ-XID=\"%s\" H5Path=\"%s\" />", + xmlnsprefix, dtxid, t_objname); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + HDfree(t_objname); + } + HDfree(dtxid); + } + else { + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, ""); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + } + } + else { + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sDataType>", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + ctx.indent_level++; + dump_indent += COL; + xml_print_datatype(type, 0); + ctx.indent_level--; + dump_indent -= COL; + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + } + ctx.indent_level--; + dump_indent -= COL; + + h5tools_str_close(&buffer); +} + +/*------------------------------------------------------------------------- + * Function: xml_dump_dataspace + * + * Purpose: Dump description of a dataspace in XML. + * + * Return: void + * + * Programmer: REMcG + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +void +xml_dump_dataspace(hid_t space) +{ + hsize_t size[H5DUMP_MAX_RANK]; + hsize_t maxsize[H5DUMP_MAX_RANK]; + int i; + h5tools_str_t buffer; /* string into which to render */ + h5tools_context_t ctx; /* print context */ + h5tool_format_t *outputformat = &xml_dataformat; + h5tool_format_t string_dataformat; + hsize_t curr_pos = 0; /* total data element position */ + + int ndims = H5Sget_simple_extent_dims(space, size, maxsize); + H5S_class_t space_type = H5Sget_simple_extent_type(space); + + /* setup */ + HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + + HDmemset(&ctx, 0, sizeof(ctx)); + ctx.indent_level = dump_indent/COL; + ctx.cur_column = dump_indent; + + string_dataformat = *outputformat; + + if (fp_format) { + string_dataformat.fmt_double = fp_format; + string_dataformat.fmt_float = fp_format; + } + + if (h5tools_nCols==0) { + string_dataformat.line_ncols = 65535; + string_dataformat.line_per_line = 1; + } + else + string_dataformat.line_ncols = h5tools_nCols; + + string_dataformat.do_escape = display_escape; + outputformat = &string_dataformat; + + ctx.indent_level++; + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sDataspace>", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + ctx.indent_level++; + + switch (space_type) { + case H5S_SCALAR: + /* scalar dataspace (just a tag, no XML attrs. defined */ + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sScalarDataspace />",xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + break; + + case H5S_SIMPLE: + /* simple dataspace */ + /* */ + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sSimpleDataspace Ndims=\"%d\">",xmlnsprefix, ndims); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + /* print the elements */ + ctx.indent_level++; + for (i = 0; i < ndims; i++) { + if (maxsize[i] == H5S_UNLIMITED) { + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sDimension DimSize=\"%" H5_PRINTF_LL_WIDTH "u\" MaxDimSize=\"UNLIMITED\"/>", + xmlnsprefix,size[i]); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + } + else if (maxsize[i] == (hsize_t) 0) { + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sDimension DimSize=\"%" H5_PRINTF_LL_WIDTH "u\" MaxDimSize=\"%" H5_PRINTF_LL_WIDTH "u\"/>", + xmlnsprefix,size[i], size[i]); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + } + else { + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sDimension DimSize=\"%" H5_PRINTF_LL_WIDTH "u\" MaxDimSize=\"%" H5_PRINTF_LL_WIDTH "u\"/>", + xmlnsprefix, size[i], maxsize[i]); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + } + } + ctx.indent_level--; + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "", xmlnsprefix ); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + break; + +#ifdef TMP + /* Commented out: wait until the schema is updated first */ + case H5S_NULL: + /* null dataspace (just a tag, no XML attrs. defined */ + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sNullDataspace />",xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + break; +#endif /* TMP */ + + case H5S_NO_CLASS: + default: + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, ""); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + } + + ctx.indent_level--; + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + ctx.indent_level--; + + h5tools_str_close(&buffer); +} + +/*------------------------------------------------------------------------- + * Function: xml_dump_data + * + * Purpose: Dump description of data in XML. + * Note that this calls the h5dump_xxx calls in + * the h5tools library. + * + * Return: void + * + * Programmer: REMcG + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +void +xml_dump_data(hid_t obj_id, int obj_data, struct subset_t UNUSED * sset, int UNUSED pindex) +{ + hid_t space = -1; + hid_t type = -1; + hid_t p_type = -1; + hsize_t size[64]; + hsize_t nelmts = 1; + int ndims; + int i; + int depth; + int status = -1; + int stdindent = COL; /* should be 3 */ + void *buf = NULL; + hsize_t curr_pos = 0; /* total data element position */ + h5tools_str_t buffer; /* string into which to render */ + h5tools_context_t ctx; /* print context */ + h5tool_format_t *outputformat = &xml_dataformat; + h5tool_format_t string_dataformat; + + HDmemset(&ctx, 0, sizeof(ctx)); + ctx.indent_level = dump_indent/COL; + ctx.cur_column = dump_indent; + + /* Print all the values. */ + /* setup */ + HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + + string_dataformat = *outputformat; + + if (fp_format) { + string_dataformat.fmt_double = fp_format; + string_dataformat.fmt_float = fp_format; + } + + if (h5tools_nCols==0) { + string_dataformat.line_ncols = 65535; + string_dataformat.line_per_line = 1; + } + else + string_dataformat.line_ncols = h5tools_nCols; + string_dataformat.cmpd_sep = " "; + string_dataformat.cmpd_pre = ""; + string_dataformat.cmpd_suf = ""; + string_dataformat.cmpd_end = ""; + string_dataformat.arr_linebreak = 0; + string_dataformat.arr_pre = ""; + outputformat = &string_dataformat; + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sData>", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + ctx.indent_level++; + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sDataFromFile>", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + ctx.indent_level--; + + dump_indent += COL; + ctx.indent_level++; + + if (obj_data == DATASET_DATA) { + type = H5Dget_type(obj_id); + if (H5Tget_class(type) == H5T_REFERENCE) { + status = xml_print_refs(obj_id, DATASET_DATA); + } + else if (H5Tget_class(type) == H5T_STRING) { + status = xml_print_strs(obj_id, DATASET_DATA); + } + else { + h5tools_context_t datactx; + HDmemset(&datactx, 0, sizeof(datactx)); + datactx.need_prefix = TRUE; + datactx.indent_level = ctx.indent_level; + datactx.cur_column = ctx.cur_column; + status = h5tools_dump_dset(rawoutstream, outputformat, &datactx, obj_id, -1, NULL); + } + } + else { + /* Attribute data */ + type = H5Aget_type(obj_id); + + if (H5Tget_class(type) == H5T_REFERENCE) { + /* references are done differently than + the standard output: + XML dumps a path to the object + referenced. + */ + status = xml_print_refs(obj_id, ATTRIBUTE_DATA); + H5Tclose(type); + } + else if (H5Tget_class(type) == H5T_STRING) { + status = xml_print_strs(obj_id, ATTRIBUTE_DATA); + } + else { /* all other data */ + /* VL data special information */ + unsigned int vl_data = 0; /* contains VL datatypes */ + + p_type = h5tools_get_native_type(type); + + /* Check if we have VL data in the dataset's datatype */ + if (h5tools_detect_vlen_str(p_type) == TRUE) + vl_data = TRUE; + if (H5Tdetect_class(p_type, H5T_VLEN) == TRUE) + vl_data = TRUE; + + H5Tclose(type); + + space = H5Aget_space(obj_id); + + ndims = H5Sget_simple_extent_dims(space, size, NULL); + + for (i = 0; i < ndims; i++) + nelmts *= size[i]; + + buf = HDmalloc((size_t)(nelmts * MAX(H5Tget_size(type), H5Tget_size(p_type)))); + HDassert(buf); + + if (H5Aread(obj_id, p_type, buf) >= 0) { + h5tools_context_t datactx; + HDmemset(&datactx, 0, sizeof(datactx)); + datactx.need_prefix = TRUE; + datactx.indent_level = ctx.indent_level; + datactx.cur_column = ctx.cur_column; + status = h5tools_dump_mem(rawoutstream, outputformat, &datactx, obj_id, p_type, space, buf); + } + /* Reclaim any VL memory, if necessary */ + if (vl_data) + H5Dvlen_reclaim(p_type, space, H5P_DEFAULT, buf); + + HDfree(buf); + H5Tclose(p_type); + H5Sclose(space); + H5Tclose(type); + } + } + + if (status == FAIL) { + ctx.indent_level++; + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "Unable to print data."); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + ctx.indent_level--; + + status = 1; + } + ctx.indent_level--; + dump_indent -= COL; + + ctx.indent_level++; + + ctx.need_prefix = TRUE; + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "",xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + ctx.indent_level--; + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + h5tools_str_close(&buffer); +} + +/*------------------------------------------------------------------------- + * Function: xml_dump_attr + * + * Purpose: Dump a description of an HDF5 attribute in XML. + * + * Return: herr_t + * + * Programmer: REMcG + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +herr_t +xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t UNUSED *info, + void UNUSED * op_data) +{ + hid_t attr_id = -1; + hid_t type = -1; + hid_t space = -1; + H5S_class_t space_type; + hsize_t curr_pos = 0; /* total data element position */ + h5tools_str_t buffer; /* string into which to render */ + h5tools_context_t ctx; /* print context */ + h5tool_format_t *outputformat = &xml_dataformat; + h5tool_format_t string_dataformat; + + char *t_aname = xml_escape_the_name(attr_name); + + /* setup */ + HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + + HDmemset(&ctx, 0, sizeof(ctx)); + ctx.indent_level = dump_indent/COL; + ctx.cur_column = dump_indent; + + string_dataformat = *outputformat; + + if (fp_format) { + string_dataformat.fmt_double = fp_format; + string_dataformat.fmt_float = fp_format; + } + + if (h5tools_nCols==0) { + string_dataformat.line_ncols = 65535; + string_dataformat.line_per_line = 1; + } + else + string_dataformat.line_ncols = h5tools_nCols; + + string_dataformat.do_escape = display_escape; + outputformat = &string_dataformat; + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sAttribute Name=\"%s\">", xmlnsprefix, t_aname); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + HDfree(t_aname); + + if ((attr_id = H5Aopen(attr, attr_name, H5P_DEFAULT)) >= 0) { + type = H5Aget_type(attr_id); + space = H5Aget_space(attr_id); + space_type = H5Sget_simple_extent_type(space); + + dump_function_table->dump_dataspace_function(space); + dump_function_table->dump_datatype_function(type); + + ctx.indent_level++; + dump_indent += COL; + + if (display_attr_data && space_type != H5S_NULL) { + switch (H5Tget_class(type)) { + case H5T_INTEGER: + case H5T_FLOAT: + case H5T_STRING: + case H5T_BITFIELD: + case H5T_OPAQUE: + case H5T_ENUM: + case H5T_ARRAY: + dump_function_table->dump_data_function(attr_id, ATTRIBUTE_DATA, NULL, 0); + break; + + case H5T_TIME: + ctx.indent_level++; + dump_indent += COL; + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sData>", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, ""); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sNoData/>", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, ""); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + ctx.indent_level--; + dump_indent -= COL; + break; + + case H5T_COMPOUND: + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, ""); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + dump_function_table->dump_data_function(attr_id, ATTRIBUTE_DATA, NULL, 0); + break; + + case H5T_REFERENCE: + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sData>", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + if (!H5Tequal(type, H5T_STD_REF_OBJ)) { + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, ""); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sNoData />", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + } + else { + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sDataFromFile>", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + xml_print_refs(attr_id, ATTRIBUTE_DATA); + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + } + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + break; + + case H5T_VLEN: + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, ""); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + dump_function_table->dump_data_function(attr_id, ATTRIBUTE_DATA, NULL, 0); + break; + default: + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sData>", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "", H5Tget_class(type)); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sNoData/>", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + break; + } + } + else { + /* The case of an attribute never yet written ?? + * Or dataspace is H5S_NULL. */ + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sData>", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + ctx.indent_level++; + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sNoData/>", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + ctx.indent_level--; + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + } + ctx.indent_level--; + dump_indent -= COL; + + H5Tclose(type); + H5Sclose(space); + H5Aclose(attr_id); + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + h5tools_str_close(&buffer); + return SUCCEED; + } + else { + /* ?? failed */ + ctx.indent_level++; + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, ""); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + ctx.indent_level--; + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + h5tools_str_close(&buffer); + + h5tools_setstatus(EXIT_FAILURE); + return FAIL; + } +} + +/*------------------------------------------------------------------------- + * Function: xml_dump_named_datatype + * + * Purpose: Dump a description of an HDF5 NDT in XML. + * + * Return: herr_t + * + * Programmer: REMcG + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +void +xml_dump_named_datatype(hid_t type, const char *name) +{ + hsize_t curr_pos = 0; /* total data element position */ + h5tools_str_t buffer; /* string into which to render */ + h5tools_context_t ctx; /* print context */ + h5tool_format_t *outputformat = &xml_dataformat; + h5tool_format_t string_dataformat; + char *tmp; + char *dtxid; + char *parentxid; + char *t_tmp; + char *t_prefix; + char *t_name; + + tmp = (char *)HDmalloc(HDstrlen(prefix) + HDstrlen(name) + 2); + HDstrcpy(tmp, prefix); + HDstrcat(tmp, "/"); + HDstrcat(tmp, name); + + /* setup */ + HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + + HDmemset(&ctx, 0, sizeof(ctx)); + ctx.indent_level = dump_indent/COL; + ctx.cur_column = dump_indent; + + string_dataformat = *outputformat; + + if (fp_format) { + string_dataformat.fmt_double = fp_format; + string_dataformat.fmt_float = fp_format; + } + + if (h5tools_nCols==0) { + string_dataformat.line_ncols = 65535; + string_dataformat.line_per_line = 1; + } + else + string_dataformat.line_ncols = h5tools_nCols; + + string_dataformat.do_escape = display_escape; + outputformat = &string_dataformat; + + dtxid = (char *)HDmalloc(100); + parentxid = (char *)HDmalloc(100); + t_tmp = xml_escape_the_name(tmp); + t_prefix = xml_escape_the_name(prefix); + t_name = xml_escape_the_name(name); + + xml_name_to_XID(tmp, dtxid, 100, 1); + xml_name_to_XID(prefix, parentxid, 100, 1); + if(HDstrncmp(name, "#", 1) == 0) { + /* Special: this is an 'anonymous' NDT, deleted but + still in use. + We follow the dumper's undocumented practice, and + use its object id as its name. + Exactly the same as normal, but a separate case + in the event we want to do something else in + the future. + */ + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sNamedDataType Name=\"%s\" OBJ-XID=\"%s\" " + "Parents=\"%s\" H5ParentPaths=\"%s\">", + xmlnsprefix, + name, dtxid, + parentxid, HDstrcmp(prefix,"") ? t_prefix : "/"); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + } + else { + H5O_info_t oinfo; /* Object info */ + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sNamedDataType Name=\"%s\" OBJ-XID=\"%s\" " + "H5Path=\"%s\" Parents=\"%s\" H5ParentPaths=\"%s\">", + xmlnsprefix, + t_name, dtxid, + t_tmp, parentxid, (HDstrcmp(prefix, "") ? t_prefix : "/")); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + /* Check uniqueness of named datatype */ + H5Oget_info(type, &oinfo); + if(oinfo.rc > 1) { + obj_t *found_obj; /* Found object */ + + /* Group with more than one link to it... */ + found_obj = search_obj(type_table, oinfo.addr); + + if (found_obj == NULL) { + indentation(dump_indent); + error_msg("internal error (file %s:line %d)\n", __FILE__, __LINE__); + h5tools_setstatus(EXIT_FAILURE); + goto done; + } + else if(found_obj->displayed) { + /* We have already printed this named datatype, print it as a + * NamedDatatypePtr + */ + char pointerxid[100]; + char *t_objname = xml_escape_the_name(found_obj->objname); + + ctx.indent_level++; + + xml_name_to_XID(found_obj->objname, pointerxid, sizeof(pointerxid), 1); + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sNamedDatatypePtr OBJ-XID=\"%s\" H5Path=\"%s\"/>", xmlnsprefix, pointerxid, t_objname); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + ctx.indent_level--; + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + HDfree(t_objname); + goto done; + } + else + found_obj->displayed = TRUE; + } + } + + ctx.indent_level++; + dump_indent += COL; + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sDataType>",xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + ctx.indent_level++; + dump_indent += COL; + xml_print_datatype(type,1); + ctx.indent_level--; + dump_indent -= COL; + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "",xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + ctx.indent_level--; + dump_indent -= COL; + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "",xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + +done: + + h5tools_str_close(&buffer); + + HDfree(dtxid); + HDfree(parentxid); + HDfree(t_tmp); + HDfree(t_prefix); + HDfree(t_name); + HDfree(tmp); +} + +/*------------------------------------------------------------------------- + * Function: xml_dump_group + * + * Purpose: Dump a description of an HDF5 Group (and its members) in XML. + * + * Return: void + * + * Programmer: REMcG + * + * Modifications: + * Pedro Vicente, October 9, 2007 + * added parameters to H5A(L)iterate to allow for other iteration orders + * + *------------------------------------------------------------------------- + */ +void +xml_dump_group(hid_t gid, const char *name) +{ + H5O_info_t oinfo; + hid_t gcpl_id; + hid_t dset, type; + unsigned crt_order_flags; + unsigned attr_crt_order_flags; + int isRoot = 0; + char type_name[1024]; + char *t_objname = NULL; + char *par_name = NULL; + char *cp = NULL; + char *tmp = NULL; + char *par = NULL; + h5tools_str_t buffer; /* string into which to render */ + h5tools_context_t ctx; /* print context */ + h5tool_format_t *outputformat = &xml_dataformat; + h5tool_format_t string_dataformat; + hsize_t curr_pos = 0; /* total data element position */ + + if ((gcpl_id = H5Gget_create_plist(gid)) < 0) { + error_msg("error in getting group creation property list ID\n"); + h5tools_setstatus(EXIT_FAILURE); + } + + /* query the group creation properties for attributes */ + if (H5Pget_attr_creation_order(gcpl_id, &attr_crt_order_flags) < 0) { + error_msg("error in getting group creation properties\n"); + h5tools_setstatus(EXIT_FAILURE); + } + + /* query the group creation properties */ + if(H5Pget_link_creation_order(gcpl_id, &crt_order_flags) < 0) { + error_msg("error in getting group creation properties\n"); + h5tools_setstatus(EXIT_FAILURE); + } + + if(H5Pclose(gcpl_id) < 0) { + error_msg("error in closing group creation property list ID\n"); + h5tools_setstatus(EXIT_FAILURE); + } + + /* setup */ + HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + + HDmemset(&ctx, 0, sizeof(ctx)); + ctx.indent_level = dump_indent/COL; + ctx.cur_column = dump_indent; + + string_dataformat = *outputformat; + + if (fp_format) { + string_dataformat.fmt_double = fp_format; + string_dataformat.fmt_float = fp_format; + } + + if (h5tools_nCols==0) { + string_dataformat.line_ncols = 65535; + string_dataformat.line_per_line = 1; + } + else + string_dataformat.line_ncols = h5tools_nCols; + + string_dataformat.do_escape = display_escape; + outputformat = &string_dataformat; + + if(HDstrcmp(name, "/") == 0) { + isRoot = 1; + tmp = HDstrdup("/"); + } + else { + tmp = (char *)HDmalloc(HDstrlen(prefix) + HDstrlen(name) + 2); + HDstrcpy(tmp, prefix); + par = HDstrdup(tmp); + cp = HDstrrchr(par, '/'); + if(cp) { + if((cp == par) && HDstrlen(par) > 1) + *(cp + 1) = '\0'; + else + *cp = '\0'; + } + } + + H5Oget_info(gid, &oinfo); + + if(oinfo.rc > 1) { + obj_t *found_obj; /* Found object */ + + /* Group with more than one link to it... */ + found_obj = search_obj(group_table, oinfo.addr); + + if (found_obj == NULL) { + indentation(dump_indent); + error_msg("internal error (file %s:line %d)\n", __FILE__, __LINE__); + h5tools_setstatus(EXIT_FAILURE); + } + else { + char *t_name = xml_escape_the_name(name); + char *grpxid = (char *)HDmalloc(100); + char *parentxid = (char *)HDmalloc(100); + + if(found_obj->displayed) { + char *ptrstr = (char *)HDmalloc(100); + + /* already seen: enter a groupptr */ + if(isRoot) { + /* probably can't happen! */ + xml_name_to_XID("/", grpxid, 100, 1); + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sRootGroup OBJ-XID=\"%s\" H5Path=\"%s\">", + xmlnsprefix, grpxid, "/"); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + } + else { + t_objname = xml_escape_the_name(found_obj->objname); + par_name = xml_escape_the_name(par); + xml_name_to_XID(tmp, grpxid, 100, 1); + xml_name_to_XID(par, parentxid, 100, 1); + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sGroup Name=\"%s\" OBJ-XID=\"%s-%d\" H5Path=\"%s\" " + "Parents=\"%s\" H5ParentPaths=\"%s\">", + xmlnsprefix,t_name, grpxid, get_next_xid(), + t_objname, parentxid, par_name); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + HDfree(t_objname); + HDfree(par_name); + + ctx.indent_level++; + + t_objname = xml_escape_the_name(found_obj->objname);/* point to the NDT by name */ + par_name = xml_escape_the_name(par); + xml_name_to_XID(found_obj->objname, ptrstr, 100, 1); + xml_name_to_XID(par, parentxid, 100, 1); + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sGroupPtr OBJ-XID=\"%s\" H5Path=\"%s\" " + "Parents=\"%s\" H5ParentPaths=\"%s\" />", + xmlnsprefix, + ptrstr, t_objname, parentxid, par_name); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + ctx.indent_level--; + + HDfree(t_objname); + HDfree(par_name); + } + HDfree(ptrstr); + } + else { + + /* first time this group has been seen -- describe it */ + if(isRoot) { + xml_name_to_XID("/", grpxid, 100, 1); + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sRootGroup OBJ-XID=\"%s\" H5Path=\"%s\">", + xmlnsprefix, grpxid, "/"); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + } + else { + char *t_tmp = xml_escape_the_name(tmp); + + par_name = xml_escape_the_name(par); + xml_name_to_XID(tmp, grpxid, 100, 1); + xml_name_to_XID(par, parentxid, 100, 1); + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sGroup Name=\"%s\" OBJ-XID=\"%s\" H5Path=\"%s\" " + "Parents=\"%s\" H5ParentPaths=\"%s\" >", + xmlnsprefix,t_name, grpxid, t_tmp, parentxid, par_name); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + HDfree(t_tmp); + HDfree(par_name); + } + found_obj->displayed = TRUE; + + /* 1. do all the attributes of the group */ + + ctx.indent_level++; + dump_indent += COL; + + if((sort_by == H5_INDEX_CRT_ORDER) && (attr_crt_order_flags & H5P_CRT_ORDER_TRACKED)) { + if(H5Aiterate2(gid, sort_by, sort_order, NULL, dump_function_table->dump_attribute_function, NULL) < 0) { + error_msg("error getting attribute information\n"); + h5tools_setstatus(EXIT_FAILURE); + } /* end if */ + } /* end if */ + else { + if(H5Aiterate2(gid, H5_INDEX_NAME, sort_order, NULL, dump_function_table->dump_attribute_function, NULL) < 0) { + error_msg("error getting attribute information\n"); + h5tools_setstatus(EXIT_FAILURE); + } /* end if */ + } /* end else */ + + if(isRoot && unamedtype) { + unsigned u; + + /* Very special case: dump unamed type in root group */ + for(u = 0; u < type_table->nobjs; u++) { + if(!type_table->objs[u].recorded) { + dset = H5Dopen2(gid, type_table->objs[u].objname, H5P_DEFAULT); + type = H5Dget_type(dset); + sprintf(type_name, "#"H5_PRINTF_HADDR_FMT, type_table->objs[u].objno); + dump_function_table->dump_named_datatype_function(type, type_name); + H5Tclose(type); + H5Dclose(dset); + } + } + } + + /* iterate through all the links */ + + if((sort_by == H5_INDEX_CRT_ORDER) && (crt_order_flags & H5P_CRT_ORDER_TRACKED)) + H5Literate(gid, sort_by, sort_order, NULL, xml_dump_all_cb, NULL); + else + H5Literate(gid, H5_INDEX_NAME, sort_order, NULL, xml_dump_all_cb, NULL); + + dump_indent -= COL; + ctx.indent_level--; + } + HDfree(t_name); + HDfree(grpxid); + HDfree(parentxid); + } + } + else { + /* only link -- must be first time! */ + char *t_name = xml_escape_the_name(name); + char *grpxid = (char *)HDmalloc(100); + char *parentxid = (char *)HDmalloc(100); + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + + if(isRoot) { + xml_name_to_XID("/", grpxid, 100, 1); + h5tools_str_append(&buffer, "<%sRootGroup OBJ-XID=\"%s\" H5Path=\"%s\">", xmlnsprefix, grpxid, "/"); + } + else { + char *t_tmp = xml_escape_the_name(tmp); + + par_name = xml_escape_the_name(par); + xml_name_to_XID(tmp, grpxid, 100, 1); + xml_name_to_XID(par, parentxid, 100, 1); + h5tools_str_append(&buffer, "<%sGroup Name=\"%s\" OBJ-XID=\"%s\" H5Path=\"%s\" " + "Parents=\"%s\" H5ParentPaths=\"%s\" >", + xmlnsprefix, t_name, grpxid, t_tmp, parentxid, par_name); + HDfree(t_tmp); + HDfree(par_name); + } + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + HDfree(t_name); + HDfree(grpxid); + HDfree(parentxid); + + /* 1. do all the attributes of the group */ + + ctx.indent_level++; + dump_indent += COL; + + if((sort_by == H5_INDEX_CRT_ORDER) && (attr_crt_order_flags & H5P_CRT_ORDER_TRACKED)) { + if(H5Aiterate2(gid, sort_by, sort_order, NULL, dump_function_table->dump_attribute_function, NULL) < 0) { + error_msg("error getting attribute information\n"); + h5tools_setstatus(EXIT_FAILURE); + } /* end if */ + } /* end if */ + else { + if(H5Aiterate2(gid, H5_INDEX_NAME, sort_order, NULL, dump_function_table->dump_attribute_function, NULL) < 0) { + error_msg("error getting attribute information\n"); + h5tools_setstatus(EXIT_FAILURE); + } /* end if */ + } /* end else */ + + if(isRoot && unamedtype) { + unsigned u; + + /* Very special case: dump unamed type in root group */ + for(u = 0; u < type_table->nobjs; u++) { + if(!type_table->objs[u].recorded) { + dset = H5Dopen2(gid, type_table->objs[u].objname, H5P_DEFAULT); + type = H5Dget_type(dset); + sprintf(type_name, "#"H5_PRINTF_HADDR_FMT, type_table->objs[u].objno); + dump_function_table->dump_named_datatype_function(type, type_name); + H5Tclose(type); + H5Dclose(dset); + } + } + } + + /* iterate through all the links */ + + if((sort_by == H5_INDEX_CRT_ORDER) && (crt_order_flags & H5P_CRT_ORDER_TRACKED)) + H5Literate(gid, sort_by, sort_order, NULL, xml_dump_all_cb, NULL); + else + H5Literate(gid, H5_INDEX_NAME, sort_order, NULL, xml_dump_all_cb, NULL); + + dump_indent -= COL; + ctx.indent_level--; + } + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + if(isRoot) + h5tools_str_append(&buffer, "", xmlnsprefix); + else + h5tools_str_append(&buffer, "", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + h5tools_str_close(&buffer); + + if(par) + HDfree(par); + if(tmp) + HDfree(tmp); +} + +/*------------------------------------------------------------------------- + * Function: xml_print_refs + * + * Purpose: Print a path to the objects referenced by HDF5 Referneces. + * + * Return: void + * + * Programmer: REMcG + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +static int +xml_print_refs(hid_t did, int source) +{ + herr_t e; + hid_t type; + hid_t space; + hssize_t ssiz; + hsize_t i; + size_t tsiz; + hobj_ref_t *refbuf = NULL; + char *buf = NULL; + h5tools_str_t buffer; /* string into which to render */ + h5tools_context_t ctx; /* print context */ + h5tool_format_t *outputformat = &xml_dataformat; + h5tool_format_t string_dataformat; + hsize_t curr_pos = 0; /* total data element position */ + + if (source == DATASET_DATA) { + type = H5Dget_type(did); + } + else if (source == ATTRIBUTE_DATA) { + type = H5Aget_type(did); + } + else { + /* return an error */ + return FAIL; + } + if (H5Tget_class(type) != H5T_REFERENCE) { + /* return an error */ + goto error; + } + if (!H5Tequal(type, H5T_STD_REF_OBJ)) { + /* region ref not supported yet... */ + /* return an error */ + goto error; + } + if (source == DATASET_DATA) { + space = H5Dget_space(did); + if ((ssiz = H5Sget_simple_extent_npoints(space)) < 0) + goto error; + if ((tsiz = H5Tget_size(type)) == 0) + goto error; + + buf = (char *) HDcalloc((size_t)(ssiz * tsiz), sizeof(char)); + if (buf == NULL) + goto error; + e = H5Dread(did, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); + /* need to check result here */ + if (e < 0) { + goto error; + } + } + else if (source == ATTRIBUTE_DATA) { + space = H5Aget_space(did); + if ((ssiz = H5Sget_simple_extent_npoints(space)) < 0) + goto error; + if ((tsiz = H5Tget_size(type)) == 0) + goto error; + + buf = (char *) HDcalloc((size_t)(ssiz * tsiz), sizeof(char)); + if (buf == NULL) { + goto error; + } + e = H5Aread(did, H5T_STD_REF_OBJ, buf); + /* need to check the result here */ + if (e < 0) { + goto error; + } + } + + refbuf = (hobj_ref_t *) buf; + + /* setup */ + HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + + HDmemset(&ctx, 0, sizeof(ctx)); + ctx.indent_level = dump_indent/COL; + ctx.cur_column = dump_indent; + + string_dataformat = *outputformat; + + if (fp_format) { + string_dataformat.fmt_double = fp_format; + string_dataformat.fmt_float = fp_format; + } + + if (h5tools_nCols==0) { + string_dataformat.line_ncols = 65535; + string_dataformat.line_per_line = 1; + } + else + string_dataformat.line_ncols = h5tools_nCols; + + string_dataformat.do_escape = display_escape; + outputformat = &string_dataformat; + + for (i = 0; i < ssiz; i++) { + const char *path = lookup_ref_path(*refbuf); + ctx.indent_level++; + + if (!path) { + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "\"%s\"", "NULL"); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + } + else { + char *t_path = xml_escape_the_string(path, -1); + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "\"%s\"", t_path); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + HDfree(t_path); + } + ctx.indent_level--; + + refbuf++; + } + + h5tools_str_close(&buffer); + + HDfree(buf); + H5Tclose(type); + H5Sclose(space); + return SUCCEED; + +error: + if(buf) + HDfree(buf); + + H5E_BEGIN_TRY { + H5Tclose(type); + H5Sclose(space); + } H5E_END_TRY; + return FAIL; +} + +/*------------------------------------------------------------------------- + * Function: xml_print_strs + * + * Purpose: Print strings. + * + * Return: void + * + * Programmer: REMcG + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +static int +xml_print_strs(hid_t did, int source) +{ + herr_t e; + hid_t type; + hid_t space; + hssize_t ssiz; + htri_t is_vlstr = FALSE; + size_t tsiz; + size_t i; + size_t str_size = 0; + char *bp = NULL; + char *onestring = NULL; + void *buf = NULL; + h5tools_str_t buffer; /* string into which to render */ + h5tools_context_t ctx; /* print context */ + h5tool_format_t *outputformat = &xml_dataformat; + h5tool_format_t string_dataformat; + hsize_t curr_pos = 0; /* total data element position */ + + if (source == DATASET_DATA) { + type = H5Dget_type(did); + } + else if (source == ATTRIBUTE_DATA) { + type = H5Aget_type(did); + } + else { + /* return an error */ + return FAIL; + } + if (H5Tget_class(type) != H5T_STRING) { + /* return an error */ + goto error; + } + /* Check if we have VL data in the dataset's datatype */ + is_vlstr = H5Tis_variable_str(type); + + if (source == DATASET_DATA) { + space = H5Dget_space(did); + if((ssiz = H5Sget_simple_extent_npoints(space)) < 0) + goto error; + if((tsiz = H5Tget_size(type)) == 0) + goto error; + + buf = HDmalloc((size_t)(ssiz * tsiz)); + if (buf == NULL) + goto error; + + e = H5Dread(did, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); + if (e < 0) { + goto error; + } + } + else if (source == ATTRIBUTE_DATA) { + space = H5Aget_space(did); + if((ssiz = H5Sget_simple_extent_npoints(space)) < 0) + goto error; + if((tsiz = H5Tget_size(type)) == 0) + goto error; + + buf = HDmalloc((size_t)(ssiz * tsiz)); + if (buf == NULL) + goto error; + + e = H5Aread(did, type, buf); + if (e < 0) { + goto error; + } + } + + bp = (char*) buf; + if (!is_vlstr) + onestring = (char *) HDcalloc(tsiz, sizeof(char)); + + /* setup */ + HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + + HDmemset(&ctx, 0, sizeof(ctx)); + ctx.indent_level = dump_indent/COL; + ctx.cur_column = dump_indent; + + string_dataformat = *outputformat; + + if (fp_format) { + string_dataformat.fmt_double = fp_format; + string_dataformat.fmt_float = fp_format; + } + + if (h5tools_nCols==0) { + string_dataformat.line_ncols = 65535; + string_dataformat.line_per_line = 1; + } + else + string_dataformat.line_ncols = h5tools_nCols; + + string_dataformat.do_escape = display_escape; + outputformat = &string_dataformat; + + for (i = 0; i < ssiz; i++) { + if (is_vlstr) { + onestring = *(char **) bp; + if (onestring) + str_size = (size_t) HDstrlen(onestring); + } + else { + HDstrncpy(onestring, bp, tsiz); + str_size = tsiz; + } + + if (!onestring) { + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "NULL"); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + } + else { + char *t_onestring = xml_escape_the_string(onestring, (int) str_size); + if (t_onestring) { + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "\"%s\"", t_onestring); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + HDfree(t_onestring); + } + } + bp += tsiz; + } + + h5tools_str_close(&buffer); + + /* Reclaim any VL memory, if necessary */ + if (!is_vlstr) + if (onestring) + HDfree(onestring); + if (buf) { + if (is_vlstr) + H5Dvlen_reclaim(type, space, H5P_DEFAULT, buf); + HDfree(buf); + } + H5Tclose(type); + H5Sclose(space); + return SUCCEED; + +error: + if(buf) + HDfree(buf); + + H5E_BEGIN_TRY { + H5Tclose(type); + H5Sclose(space); + } H5E_END_TRY; + return FAIL; +} + +/*------------------------------------------------------------------------- + * Function: check_filters + * + * Purpose: private function to check for the filters and + * put tags in the XML. + * + * Return: void + * + * Programmer: REMcG + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +static void +check_filters(hid_t dcpl) +{ + int nfilt; + int i; + H5Z_filter_t filter; + char namebuf[120]; + size_t cd_nelmts = 20; + unsigned int cd_values[20]; + unsigned int flags; + h5tools_str_t buffer; /* string into which to render */ + h5tools_context_t ctx; /* print context */ + h5tool_format_t *outputformat = &xml_dataformat; + h5tool_format_t string_dataformat; + hsize_t curr_pos = 0; /* total data element position */ + + /* setup */ + HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + + HDmemset(&ctx, 0, sizeof(ctx)); + ctx.indent_level = dump_indent/COL; + ctx.cur_column = dump_indent; + + string_dataformat = *outputformat; + + if (fp_format) { + string_dataformat.fmt_double = fp_format; + string_dataformat.fmt_float = fp_format; + } + + if (h5tools_nCols==0) { + string_dataformat.line_ncols = 65535; + string_dataformat.line_per_line = 1; + } + else + string_dataformat.line_ncols = h5tools_nCols; + + string_dataformat.do_escape = display_escape; + outputformat = &string_dataformat; + + nfilt = H5Pget_nfilters(dcpl); + if (nfilt <= 0) + return; + for (i = 0; i < nfilt; i++) { + filter = H5Pget_filter2(dcpl, (unsigned) i, &flags, (size_t *) &cd_nelmts, cd_values, 120, namebuf, NULL); + if (filter == H5Z_FILTER_DEFLATE) { + ctx.indent_level++; + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sDeflate Level=\"", xmlnsprefix); + if (cd_nelmts < 1) { + /* not sure what this means? */ + h5tools_str_append(&buffer, "6"); + } + else { + h5tools_str_append(&buffer, "%d", cd_values[0]); + } + h5tools_str_append(&buffer, "\"/>"); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + ctx.indent_level--; + } + else if (filter == H5Z_FILTER_FLETCHER32) { + ctx.indent_level++; + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sFletcher32 />", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + ctx.indent_level--; + } + else if (filter == H5Z_FILTER_SHUFFLE) { + ctx.indent_level++; + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sShuffle />", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + ctx.indent_level--; + } + else if (filter == H5Z_FILTER_SZIP) { + ctx.indent_level++; + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sSZIP ", xmlnsprefix); + if (cd_nelmts < 2) { + /* no pixels ? */ + h5tools_str_append(&buffer, "Pixels_per_block=\"-1\" "); + } + else { + h5tools_str_append(&buffer, "Pixels_per_block=\"%d\" ", cd_values[1]); + } + /* analyse the options mask */ + if (cd_values[0] & H5_SZIP_CHIP_OPTION_MASK) { + h5tools_str_append(&buffer, "Mode =\"Hardware\" "); + } + else if (cd_values[0] & H5_SZIP_ALLOW_K13_OPTION_MASK) { + h5tools_str_append(&buffer, "Mode =\"K13\" "); + } + h5tools_str_append(&buffer, "Coding=\""); + if (cd_values[0] & H5_SZIP_EC_OPTION_MASK) { + h5tools_str_append(&buffer, "Entropy"); + } + else if (cd_values[0] & H5_SZIP_NN_OPTION_MASK) { + h5tools_str_append(&buffer, "NN"); + } + h5tools_str_append(&buffer, "\" "); + + h5tools_str_append(&buffer, "ByteOrder=\""); + if (cd_values[0] & H5_SZIP_LSB_OPTION_MASK) { + h5tools_str_append(&buffer, "LSB"); + } + else if (cd_values[0] & H5_SZIP_MSB_OPTION_MASK) { + h5tools_str_append(&buffer, "MSB"); + } + h5tools_str_append(&buffer, "\" "); + + if (cd_values[0] & H5_SZIP_RAW_OPTION_MASK) { + h5tools_str_append(&buffer, "Header=\"Raw\""); + } + h5tools_str_append(&buffer, "/>"); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + ctx.indent_level--; + } + else { + /* unknown option */ + } + } + + h5tools_str_close(&buffer); +} + +static void +xml_dump_fill_value(hid_t dcpl, hid_t type) +{ + size_t sz; + size_t i; + hsize_t space; + void *buf; + char *name; + h5tools_str_t buffer; /* string into which to render */ + h5tools_context_t ctx; /* print context */ + h5tool_format_t *outputformat = &xml_dataformat; + h5tool_format_t string_dataformat; + hsize_t curr_pos = 0; /* total data element position */ + + /* setup */ + HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + + HDmemset(&ctx, 0, sizeof(ctx)); + ctx.indent_level = dump_indent/COL; + ctx.cur_column = dump_indent; + + string_dataformat = *outputformat; + + if (fp_format) { + string_dataformat.fmt_double = fp_format; + string_dataformat.fmt_float = fp_format; + } + + if (h5tools_nCols==0) { + string_dataformat.line_ncols = 65535; + string_dataformat.line_per_line = 1; + } + else + string_dataformat.line_ncols = h5tools_nCols; + + string_dataformat.do_escape = display_escape; + outputformat = &string_dataformat; + + ctx.indent_level++; + dump_indent += COL; + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sData>", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + ctx.indent_level++; + dump_indent += COL; + + space = H5Tget_size(type); + buf = HDmalloc((size_t) space); + + H5Pget_fill_value(dcpl, type, buf); + + if (H5Tget_class(type) == H5T_REFERENCE) { + const char * path = lookup_ref_path(*(hobj_ref_t *) buf); + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sDataFromFile>", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + if (!path) { + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "\"%s\"", "NULL"); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + } + else { + char *t_path = xml_escape_the_string(path, -1); + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "\"%s\"", t_path); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + HDfree(t_path); + } + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + } + else if (H5Tget_class(type) == H5T_STRING) { + /* ????? */ + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, ""); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sNoData />", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + } + else { + /* all other data */ + switch (H5Tget_class(type)) { + case H5T_INTEGER: + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sDataFromFile>", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "\"%d\"", *(int *) buf); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + break; + case H5T_FLOAT: + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sDataFromFile>", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "\"%f\"", *(float *) buf); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + break; + case H5T_BITFIELD: + case H5T_OPAQUE: + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sDataFromFile>", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + sz = H5Tget_size(type); + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "\""); + for (i = 0; i < sz; i++) { + h5tools_str_append(&buffer, "%x ", *(unsigned int *) buf); + buf = (char *) buf + sizeof(unsigned int); + } + h5tools_str_append(&buffer, "\""); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + break; + case H5T_ENUM: + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sDataFromFile>", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + name = H5Tget_member_name(type, *(unsigned *) buf); + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "\"%s\"", name); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + break; + case H5T_ARRAY: + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, ""); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sNoData />", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + break; + case H5T_TIME: + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, ""); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sNoData />", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + break; + case H5T_COMPOUND: + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, ""); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sNoData />", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + break; + case H5T_VLEN: + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, ""); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sNoData />", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + break; + default: + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "", H5Tget_class(type)); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sNoData/>", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + break; + } + } + HDfree(buf); + ctx.indent_level--; + dump_indent -= COL; + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + ctx.indent_level--; + dump_indent -= COL; + + h5tools_str_close(&buffer); +} + +/*------------------------------------------------------------------------- + * Function: xml_dump_dataset + * + * Purpose: Dump a description of an HDF5 dataset in XML. + * + * Return: void + * + * Programmer: REMcG + * + * Modifications: + * Pedro Vicente, October 9, 2007 + * added parameters to H5Aiterate2 to allow for other iteration orders + * + *------------------------------------------------------------------------- + */ +void +xml_dump_dataset(hid_t did, const char *name, struct subset_t UNUSED * sset) +{ + hid_t type; + hid_t space; + hid_t dcpl; + H5D_fill_value_t fvstatus; + int maxdims; + hsize_t *chsize; + int ndims; + int i; + H5D_alloc_time_t at; + H5D_fill_time_t ft; + hsize_t tempi; + char *tmp; + char *t_name; + char *t_tmp; + char *t_prefix; + unsigned attr_crt_order_flags; + h5tools_str_t buffer; /* string into which to render */ + h5tools_context_t ctx; /* print context */ + h5tool_format_t *outputformat = &xml_dataformat; + h5tool_format_t string_dataformat; + hsize_t curr_pos = 0; /* total data element position */ + + char *rstr = (char*) HDmalloc(100); + char *pstr = (char*) HDmalloc(100); + + tmp = (char*) HDmalloc(HDstrlen(prefix) + HDstrlen(name) + 2); + HDstrcpy(tmp, prefix); + HDstrcat(tmp, "/"); + HDstrcat(tmp, name); + + /* setup */ + HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + + HDmemset(&ctx, 0, sizeof(ctx)); + ctx.indent_level = dump_indent/COL; + ctx.cur_column = dump_indent; + + t_name = xml_escape_the_name(name); + t_tmp = xml_escape_the_name(tmp); + t_prefix = xml_escape_the_name(prefix); + + string_dataformat = *outputformat; + + if (fp_format) { + string_dataformat.fmt_double = fp_format; + string_dataformat.fmt_float = fp_format; + } + + if (h5tools_nCols==0) { + string_dataformat.line_ncols = 65535; + string_dataformat.line_per_line = 1; + } + else + string_dataformat.line_ncols = h5tools_nCols; + + string_dataformat.do_escape = display_escape; + outputformat = &string_dataformat; + + xml_name_to_XID(tmp, rstr, 100, 1); + xml_name_to_XID(prefix, pstr, 100, 1); + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sDataset Name=\"%s\" OBJ-XID=\"%s\" H5Path= \"%s\" Parents=\"%s\" H5ParentPaths=\"%s\">", + xmlnsprefix, t_name, rstr, t_tmp, pstr, + strcmp(prefix, "") ? t_prefix : "/"); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + HDfree(t_name); + HDfree(t_tmp); + HDfree(t_prefix); + HDfree(rstr); + HDfree(pstr); + HDfree(tmp); + + dcpl = H5Dget_create_plist(did); + type = H5Dget_type(did); + space = H5Dget_space(did); + + /* query the creation properties for attributes */ + H5Pget_attr_creation_order(dcpl, &attr_crt_order_flags); + + /* Print information about storage layout */ + if (H5D_CHUNKED == H5Pget_layout(dcpl)) { + maxdims = H5Sget_simple_extent_ndims(space); + chsize = (hsize_t *) HDmalloc(maxdims * sizeof(hsize_t)); + ctx.indent_level++; + dump_indent += COL; + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sStorageLayout>", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + ctx.indent_level++; + dump_indent += COL; + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sChunkedLayout ", xmlnsprefix); + ndims = H5Pget_chunk(dcpl, maxdims, chsize); + h5tools_str_append(&buffer, "Ndims=\"%d\">", ndims); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + ctx.indent_level++; + dump_indent += COL; + + for (i = 0; i < ndims; i++) { + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sChunkDimension DimSize=\"%" H5_PRINTF_LL_WIDTH "u\" />", xmlnsprefix, chsize[i]); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + } + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sRequiredFilter>", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + ctx.indent_level++; + dump_indent += COL; + check_filters(dcpl); + ctx.indent_level--; + dump_indent -= COL; + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + ctx.indent_level--; + dump_indent -= COL; + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + ctx.indent_level--; + dump_indent -= COL; + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + ctx.indent_level--; + dump_indent -= COL; + HDfree(chsize); + } + else if (H5D_CONTIGUOUS == H5Pget_layout(dcpl)) { + ctx.indent_level++; + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sStorageLayout>", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + ctx.indent_level++; + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sContiguousLayout/>", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + ctx.indent_level--; + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + ctx.indent_level--; + } + else if (H5D_COMPACT == H5Pget_layout(dcpl)) { + ctx.indent_level++; + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sStorageLayout>", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + ctx.indent_level++; + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sCompactLayout/>", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + ctx.indent_level--; + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + ctx.indent_level--; + } + /* and check for external.... ?? */ + + /* fill value */ + + ctx.indent_level++; + dump_indent += COL; + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sFillValueInfo ", xmlnsprefix); + H5Pget_fill_time(dcpl, &ft); + h5tools_str_append(&buffer, "FillTime=\""); + switch (ft) { + case H5D_FILL_TIME_ALLOC: + h5tools_str_append(&buffer, "FillOnAlloc"); + break; + case H5D_FILL_TIME_NEVER: + h5tools_str_append(&buffer, "FillNever"); + break; + case H5D_FILL_TIME_IFSET: + h5tools_str_append(&buffer, "FillIfSet"); + break; + default: + h5tools_str_append(&buffer, "?"); + break; + } + h5tools_str_append(&buffer, "\" "); + H5Pget_alloc_time(dcpl, &at); + h5tools_str_append(&buffer, "AllocationTime=\""); + switch (at) { + case H5D_ALLOC_TIME_EARLY: + h5tools_str_append(&buffer, "Early"); + break; + case H5D_ALLOC_TIME_INCR: + h5tools_str_append(&buffer, "Incremental"); + break; + case H5D_ALLOC_TIME_LATE: + h5tools_str_append(&buffer, "Late"); + break; + case H5D_ALLOC_TIME_DEFAULT: + default: + h5tools_str_append(&buffer, "?"); + break; + } + h5tools_str_append(&buffer, "\""); + h5tools_str_append(&buffer, ">"); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + ctx.indent_level++; + dump_indent += COL; + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sFillValue>", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + H5Pfill_value_defined(dcpl, &fvstatus); + if (fvstatus == H5D_FILL_VALUE_UNDEFINED || (fvstatus == H5D_FILL_VALUE_DEFAULT && ft == H5D_FILL_TIME_IFSET)) { + ctx.indent_level++; + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sNoFill/>", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + ctx.indent_level--; + } + else { + xml_dump_fill_value(dcpl, type); + } + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + ctx.indent_level--; + dump_indent -= COL; + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + ctx.indent_level--; + dump_indent -= COL; + + dump_function_table->dump_dataspace_function(space); + dump_function_table->dump_datatype_function(type); + + ctx.indent_level++; + dump_indent += COL; + + if ((sort_by == H5_INDEX_CRT_ORDER) && (attr_crt_order_flags & H5P_CRT_ORDER_TRACKED)) { + if (H5Aiterate2(did, sort_by, sort_order, NULL, dump_function_table->dump_attribute_function, NULL) < 0) { + error_msg("error getting attribute information\n"); + h5tools_setstatus(EXIT_FAILURE); + } /* end if */ + } /* end if */ + else { + if (H5Aiterate2(did, H5_INDEX_NAME, sort_order, NULL, dump_function_table->dump_attribute_function, NULL) < 0) { + error_msg("error getting attribute information\n"); + h5tools_setstatus(EXIT_FAILURE); + } /* end if */ + } /* end else */ + + ctx.indent_level--; + dump_indent -= COL; + tempi = H5Dget_storage_size(did); + + if (display_data && (tempi > 0)) { + switch (H5Tget_class(type)) { + case H5T_INTEGER: + case H5T_FLOAT: + case H5T_STRING: + case H5T_BITFIELD: + case H5T_OPAQUE: + case H5T_ENUM: + case H5T_ARRAY: + ctx.indent_level++; + dump_indent += COL; + dump_function_table->dump_data_function(did, DATASET_DATA, NULL, 0); + ctx.indent_level--; + dump_indent -= COL; + break; + + case H5T_TIME: + ctx.indent_level++; + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sData>", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, ""); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sNoData />", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sData>", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + ctx.indent_level--; + break; + + case H5T_COMPOUND: + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, ""); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + ctx.indent_level++; + dump_indent += COL; + dump_function_table->dump_data_function(did, DATASET_DATA, NULL, 0); + ctx.indent_level--; + dump_indent -= COL; + break; + + case H5T_REFERENCE: + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sData>", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + if (!H5Tequal(type, H5T_STD_REF_OBJ)) { + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, ""); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sNoData />", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + } + else { + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sDataFromFile>", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + xml_print_refs(did, DATASET_DATA); + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + } + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + break; + + case H5T_VLEN: + ctx.indent_level--; + dump_indent -= COL; + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, ""); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + ctx.indent_level++; + dump_indent += COL; + + ctx.indent_level++; + dump_indent += COL; + dump_function_table->dump_data_function(did, DATASET_DATA, NULL, 0); + ctx.indent_level--; + dump_indent -= COL; + break; + default: + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sData>", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "", H5Tget_class(type)); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sNoData/>", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + break; + } + } + else { + /* no data written */ + ctx.indent_level++; + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sData>", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + ctx.indent_level++; + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sNoData/>", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + ctx.indent_level--; + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + ctx.indent_level--; + } + + H5Tclose(type); + H5Sclose(space); + H5Pclose(dcpl); + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "", xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + h5tools_str_close(&buffer); +} + +/*------------------------------------------------------------------------- + * Function: xml_print_enum + * + * Purpose: Print the values of an HDF5 ENUM in XML. + * Very similar to regular DDL output. + * + * Return: void + * + * Programmer: REMcG + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +static void +xml_print_enum(hid_t type) +{ + char **name = NULL; /*member names */ + unsigned char *value = NULL; /*value array */ + unsigned nmembs; /*number of members */ + hid_t super; /*enum base integer type */ + hid_t native = -1; /*native integer datatype */ + size_t dst_size; /*destination value type size */ + unsigned i; /*miscellaneous counters */ + size_t j; + h5tools_str_t buffer; /* string into which to render */ + h5tools_context_t ctx; /* print context */ + h5tool_format_t *outputformat = &xml_dataformat; + h5tool_format_t string_dataformat; + hsize_t curr_pos = 0; /* total data element position */ + + /* setup */ + HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + + HDmemset(&ctx, 0, sizeof(ctx)); + ctx.indent_level = dump_indent/COL; + ctx.cur_column = dump_indent; + + string_dataformat = *outputformat; + + if (fp_format) { + string_dataformat.fmt_double = fp_format; + string_dataformat.fmt_float = fp_format; + } + + if (h5tools_nCols==0) { + string_dataformat.line_ncols = 65535; + string_dataformat.line_per_line = 1; + } + else + string_dataformat.line_ncols = h5tools_nCols; + + string_dataformat.do_escape = display_escape; + outputformat = &string_dataformat; + + nmembs = (unsigned)H5Tget_nmembers(type); + super = H5Tget_super(type); + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sDataType>",xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + xml_print_datatype(super,0); + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "",xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + /* + * Determine what datatype to use for the native values. To simplify + * things we entertain three possibilities: + * 1. long long -- the largest native signed integer + * 2. unsigned long long -- the largest native unsigned integer + * 3. raw format + */ + if (H5Tget_size(type) <= sizeof(long long)) { + dst_size = sizeof(long long); + + if (H5T_SGN_NONE == H5Tget_sign(type)) { + native = H5T_NATIVE_ULLONG; + } + else { + native = H5T_NATIVE_LLONG; + } + } + else { + dst_size = H5Tget_size(type); + } + + /* Get the names and raw values of all members */ + name = (char **)HDcalloc(nmembs, sizeof(char *)); + value = (unsigned char *)HDcalloc(nmembs, MAX(H5Tget_size(type), dst_size)); + + for (i = 0; i < nmembs; i++) { + name[i] = H5Tget_member_name(type, i); + H5Tget_member_value(type, i, value + i * H5Tget_size(type)); + } + + /* Convert values to native datatype */ + if (native > 0) + H5Tconvert(super, native, nmembs, value, NULL, H5P_DEFAULT); + + /* Sort members by increasing value */ + /*not implemented yet */ + + /* Print members */ + ctx.indent_level++; + dump_indent += COL; + for (i = 0; i < nmembs; i++) { + char *t_name = xml_escape_the_name(name[i]); + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sEnumElement>",xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + ctx.indent_level++; + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "%s", t_name); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + HDfree(t_name); + ctx.indent_level--; + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "",xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "<%sEnumValue>",xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + ctx.indent_level++; + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + if (native < 0) { + h5tools_str_append(&buffer, "0x"); + + for (j = 0; j < dst_size; j++) + h5tools_str_append(&buffer, "%02x", value[i * dst_size + j]); + } + else if (H5T_SGN_NONE == H5Tget_sign(native)) { + h5tools_str_append(&buffer,"%" H5_PRINTF_LL_WIDTH "u", *((unsigned long long *) + ((void *) (value + i * dst_size)))); + } + else { + h5tools_str_append(&buffer,"%" H5_PRINTF_LL_WIDTH "d", + *((long long *) ((void *) (value + i * dst_size)))); + } + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + ctx.indent_level--; + + ctx.need_prefix = TRUE; + h5tools_simple_prefix(rawoutstream, outputformat, &ctx, 0, 0); + + /* Render the element */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "",xmlnsprefix); + h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, outputformat->line_ncols, 0, 0); + } + ctx.indent_level--; + dump_indent -= COL; + + h5tools_str_close(&buffer); + + /* Release resources */ + for (i = 0; i < nmembs; i++) + HDfree(name[i]); + + HDfree(name); + HDfree(value); + H5Tclose(super); +} + diff --git a/tools/h5dump/h5dump_xml.h b/tools/h5dump/h5dump_xml.h new file mode 100644 index 0000000..04d02c9 --- /dev/null +++ b/tools/h5dump/h5dump_xml.h @@ -0,0 +1,129 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +#ifndef H5DUMP_XML_H__ +#define H5DUMP_XML_H__ + +extern const char *xmlnsprefix; + +/* + * Alternative formating for data dumped to XML + * In general, the numbers are the same, but separators + * except spaces are not used. + * + * Some of these are not used, as some kinds of data are + * dumped in completely new subroutines. + * + * Some of this formatting may yet need to change. + * + * This table only affects XML output. + */ +static h5tool_format_t xml_dataformat = { + 0, /*raw */ + + "", /*fmt_raw */ + "%d", /*fmt_int */ + "%u", /*fmt_uint */ + "%hhd", /*fmt_schar */ + "%u", /*fmt_uchar */ + "%d", /*fmt_short */ + "%u", /*fmt_ushort */ + "%ld", /*fmt_long */ + "%lu", /*fmt_ulong */ + NULL, /*fmt_llong */ + NULL, /*fmt_ullong */ + "%g", /*fmt_double */ + "%g", /*fmt_float */ + + 0, /*ascii */ + 0, /*str_locale */ + 0, /*str_repeat */ + + "", /*arr_pre */ + "", /*arr_sep */ + "", /*arr_suf */ + 1, /*arr_linebreak */ + + "", /*cmpd_name */ + "", /*cmpd_sep */ + "", /*cmpd_pre */ + "", /*cmpd_suf */ + "", /*cmpd_end */ + "", /*cmpd_listv */ + + " ", /*vlen_sep */ + " ", /*vlen_pre */ + "", /*vlen_suf */ + "", /*vlen_end */ + + "%s", /*elmt_fmt */ + "", /*elmt_suf1 */ + " ", /*elmt_suf2 */ + + "", /*idx_n_fmt */ + "", /*idx_sep */ + "", /*idx_fmt */ + + 80, /*line_ncols *//*standard default columns */ + 0, /*line_per_line */ + "", /*line_pre */ + "%s", /*line_1st */ + "%s", /*line_cont */ + "", /*line_suf */ + "", /*line_sep */ + 1, /*line_multi_new */ + " ", /*line_indent */ + + 1, /*skip_first */ + + 1, /*obj_hidefileno */ + " "H5_PRINTF_HADDR_FMT, /*obj_format */ + + 1, /*dset_hidefileno */ + "DATASET %s ", /*dset_format */ + "%s", /*dset_blockformat_pre */ + "%s", /*dset_ptformat_pre */ + "%s", /*dset_ptformat */ + 0, /*array indices */ + 0 /*escape non printable characters */ +}; + +#ifdef __cplusplus +extern "C" { +#endif + +/* internal functions used by XML option */ +static void xml_print_datatype(hid_t, unsigned); +static void xml_print_enum(hid_t); +static int xml_print_refs(hid_t, int); +static int xml_print_strs(hid_t, int); +static char *xml_escape_the_string(const char *, int); +static char *xml_escape_the_name(const char *); + +/* The dump functions of the dump_function_table */ +/* XML format: same interface, alternative output */ + +void xml_dump_group(hid_t, const char *); +void xml_dump_named_datatype(hid_t, const char *); +void xml_dump_dataset(hid_t, const char *, struct subset_t *); +void xml_dump_dataspace(hid_t space); +void xml_dump_datatype(hid_t type); +herr_t xml_dump_attr(hid_t, const char *, const H5A_info_t *, void *); +void xml_dump_data(hid_t, int, struct subset_t *, int); + +#ifdef __cplusplus +} +#endif + +#endif /* !H5DUMP_XML_H__ */ diff --git a/tools/h5dump/h5dumpgentest.c b/tools/h5dump/h5dumpgentest.c index c4df6fd..e3c072d 100644 --- a/tools/h5dump/h5dumpgentest.c +++ b/tools/h5dump/h5dumpgentest.c @@ -96,6 +96,7 @@ #define FILE64 "tattrreg.h5" #define FILE65 "file_space.h5" #define FILE66 "packedbits.h5" +#define FILE67 "zerodim.h5" #define FILE68 "tdset_idx.h5" @@ -178,6 +179,11 @@ const H5L_class_t UD_link_class[1] = {{ #define CDIM2 DIM2/2 #define RANK 2 +/* Dataspace of 0 dimension size */ +#define SPACE3_RANK 2 +#define SPACE3_DIM1 0 +#define SPACE3_DIM2 0 + /* Element selection information */ #define POINT1_NPOINTS 10 @@ -252,24 +258,24 @@ typedef struct s1_t { #define F64_DIM1 (F64_ARRAY_BUF_LEN / sizeof(int) + 1) /* File 65 macros */ -#define STRATEGY H5F_FILE_SPACE_AGGR_VFD /* File space handling strategy */ -#define THRESHOLD10 10 /* Free space section threshold */ +#define STRATEGY H5F_FILE_SPACE_AGGR_VFD /* File space handling strategy */ +#define THRESHOLD10 10 /* Free space section threshold */ /* "FILE66" macros */ -#define F66_XDIM 8 +#define F66_XDIM 8 #define F66_DATASETU08 "DU08BITS" #define F66_DATASETS08 "DS08BITS" -#define F66_YDIM8 8 +#define F66_YDIM8 8 #define F66_DATASETU16 "DU16BITS" #define F66_DATASETS16 "DS16BITS" -#define F66_YDIM16 16 +#define F66_YDIM16 16 #define F66_DATASETU32 "DU32BITS" #define F66_DATASETS32 "DS32BITS" -#define F66_YDIM32 32 +#define F66_YDIM32 32 #define F66_DATASETU64 "DU64BITS" #define F66_DATASETS64 "DS64BITS" #define F66_YDIM64 64 -#define F66_DUMMYDBL "DummyDBL" +#define F66_DUMMYDBL "DummyDBL" /* Declarations for gent_dataset_idx() for "FILE68" */ #define DSET_FIXED "dset_fixed" @@ -580,7 +586,7 @@ static int gent_softlink2(void) */ /* Create a new dataset as sample object */ dset1 = H5Dcreate2(fileid1, "/dset1", H5T_NATIVE_INT, dataspace, - H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (dset1 < 0) { fprintf(stderr, "Error: %s> H5Dcreate2 failed.\n", FILE4_1); @@ -601,7 +607,7 @@ static int gent_softlink2(void) */ /* Create a new dataset as sample object */ dset2 = H5Dcreate2(fileid1, "/dset2", H5T_NATIVE_INT, dataspace, - H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (dset2 < 0) { fprintf(stderr, "Error: %s> H5Dcreate2 failed.\n", FILE4_1); @@ -1955,9 +1961,9 @@ static void gent_objref(void) const char *write_comment = "Foo!"; /* Comments for group */ /* Allocate write & read buffers */ - wbuf = (hobj_ref_t*) malloc(sizeof(hobj_ref_t) * SPACE1_DIM1); - rbuf = (hobj_ref_t*) malloc(sizeof(hobj_ref_t) * SPACE1_DIM1); - tbuf = (hobj_ref_t*) malloc(sizeof(hobj_ref_t) * SPACE1_DIM1); + wbuf = (hobj_ref_t*) HDmalloc(sizeof(hobj_ref_t) * SPACE1_DIM1); + rbuf = (hobj_ref_t*) HDmalloc(sizeof(hobj_ref_t) * SPACE1_DIM1); + tbuf = (hobj_ref_t*) HDmalloc(sizeof(hobj_ref_t) * SPACE1_DIM1); /* Create file */ fid1 = H5Fcreate(FILE16, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -2036,9 +2042,9 @@ static void gent_objref(void) H5Fclose(fid1); /* Free memory buffers */ - free(wbuf); - free(rbuf); - free(tbuf); + HDfree(wbuf); + HDfree(rbuf); + HDfree(tbuf); } static void gent_datareg(void) @@ -2065,10 +2071,10 @@ static void gent_datareg(void) int i; /* counting variables */ /* Allocate write & read buffers */ - wbuf = (hdset_reg_ref_t*) calloc(sizeof(hdset_reg_ref_t), SPACE1_DIM1); - rbuf = (hdset_reg_ref_t*) malloc(sizeof(hdset_reg_ref_t)*SPACE1_DIM1); - dwbuf = (uint8_t*) malloc(sizeof(uint8_t)*SPACE2_DIM1*SPACE2_DIM2); - drbuf = (uint8_t*) calloc(sizeof(uint8_t),SPACE2_DIM1*SPACE2_DIM2); + wbuf = (hdset_reg_ref_t*) HDcalloc(sizeof(hdset_reg_ref_t), SPACE1_DIM1); + rbuf = (hdset_reg_ref_t*) HDmalloc(sizeof(hdset_reg_ref_t)*SPACE1_DIM1); + dwbuf = (uint8_t*) HDmalloc(sizeof(uint8_t)*SPACE2_DIM1*SPACE2_DIM2); + drbuf = (uint8_t*) HDcalloc(sizeof(uint8_t),SPACE2_DIM1*SPACE2_DIM2); /* Create file */ fid1 = H5Fcreate(FILE17, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -2142,10 +2148,10 @@ static void gent_datareg(void) H5Fclose(fid1); /* Free memory buffers */ - free(wbuf); - free(rbuf); - free(dwbuf); - free(drbuf); + HDfree(wbuf); + HDfree(rbuf); + HDfree(dwbuf); + HDfree(drbuf); } static void gent_attrreg(void) @@ -2174,10 +2180,10 @@ static void gent_attrreg(void) int i; /* counting variables */ /* Allocate write & read buffers */ - wbuf = (hdset_reg_ref_t*) calloc(sizeof(hdset_reg_ref_t), SPACE1_DIM1); - rbuf = (hdset_reg_ref_t*) malloc(sizeof(hdset_reg_ref_t)*SPACE1_DIM1); - dwbuf = (uint8_t*) malloc(sizeof(uint8_t)*SPACE2_DIM1*SPACE2_DIM2); - drbuf = (uint8_t*) calloc(sizeof(uint8_t),SPACE2_DIM1*SPACE2_DIM2); + wbuf = (hdset_reg_ref_t*) HDcalloc(sizeof(hdset_reg_ref_t), SPACE1_DIM1); + rbuf = (hdset_reg_ref_t*) HDmalloc(sizeof(hdset_reg_ref_t)*SPACE1_DIM1); + dwbuf = (uint8_t*) HDmalloc(sizeof(uint8_t)*SPACE2_DIM1*SPACE2_DIM2); + drbuf = (uint8_t*) HDcalloc(sizeof(uint8_t),SPACE2_DIM1*SPACE2_DIM2); /* Create file */ fid1 = H5Fcreate(FILE64, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -2262,10 +2268,10 @@ static void gent_attrreg(void) H5Fclose(fid1); /* Free memory buffers */ - free(wbuf); - free(rbuf); - free(dwbuf); - free(drbuf); + HDfree(wbuf); + HDfree(rbuf); + HDfree(dwbuf); + HDfree(drbuf); } /*taken from Elena's compound test file*/ @@ -2480,7 +2486,7 @@ static void gent_vldatatypes(void) for(i = 0; i < SPACE1_DIM1; i++) { int j; - wdata[i].p = malloc((i + 1) * sizeof(int)); + wdata[i].p = HDmalloc((i + 1) * sizeof(int)); wdata[i].len = i + 1; for(j = 0; j < i + 1; j++) @@ -2492,22 +2498,22 @@ static void gent_vldatatypes(void) type = H5Tvlen_create(H5T_NATIVE_INT); dset = H5Dcreate2(file, "Dataset1.0", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); ret = H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Dvlen_reclaim(type, space, H5P_DEFAULT, wdata); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Dclose(dset); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Tclose(type); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Sclose(space); - assert(ret >= 0); + HDassert(ret >= 0); /* Allocate and initialize VL dataset to write */ for(i = 0; i < SPACE1_DIM1; i++) { int j; - wdata[i].p = malloc((i + 1) * sizeof(float)); + wdata[i].p = HDmalloc((i + 1) * sizeof(float)); wdata[i].len = i + 1; for(j = 0; j < i + 1; j++) @@ -2519,19 +2525,19 @@ static void gent_vldatatypes(void) type = H5Tvlen_create(H5T_NATIVE_FLOAT); dset = H5Dcreate2(file, "Dataset2.0", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); ret = H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Dvlen_reclaim(type, space, H5P_DEFAULT, wdata); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Dclose(dset); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Tclose(type); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Sclose(space); - assert(ret >= 0); + HDassert(ret >= 0); /* Allocate and initialize a scalar VL dataset to write */ - adata.p = malloc(37 * sizeof(int)); + adata.p = HDmalloc(37 * sizeof(int)); adata.len = 37; for(i = 0; i < 37; i++) @@ -2542,18 +2548,18 @@ static void gent_vldatatypes(void) type = H5Tvlen_create(H5T_NATIVE_INT); dset = H5Dcreate2(file, "Dataset3.0", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); ret = H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, &adata); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Dvlen_reclaim(type, space, H5P_DEFAULT, &adata); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Dclose(dset); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Tclose(type); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Sclose(space); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Fclose(file); - assert(ret >= 0); + HDassert(ret >= 0); } static void @@ -2571,14 +2577,14 @@ gent_vldatatypes2(void) /* Allocate and initialize VL data to write */ for(i = 0; i < SPACE1_DIM1; i++) { - wdata[i].p = (hvl_t *)malloc((i + 1) * sizeof(hvl_t)); + wdata[i].p = (hvl_t *)HDmalloc((i + 1) * sizeof(hvl_t)); if(wdata[i].p == NULL) { printf("Cannot allocate memory for VL data! i=%u\n", i); return; } /* end if */ wdata[i].len = i + 1; for(t1 = (hvl_t *)wdata[i].p, j = 0; j < (i + 1); j++, t1++) { - t1->p = (unsigned *)malloc((j + 1) * sizeof(unsigned)); + t1->p = (unsigned *)HDmalloc((j + 1) * sizeof(unsigned)); if(t1->p == NULL) { printf("Cannot allocate memory for VL data! i=%u, j=%u\n",i,j); return; @@ -2606,23 +2612,23 @@ gent_vldatatypes2(void) /* Write dataset to disk */ ret = H5Dwrite(dataset, tid2, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); - assert(ret >= 0); + HDassert(ret >= 0); /* Reclaim the write VL data */ ret = H5Dvlen_reclaim(tid2, sid1, H5P_DEFAULT, wdata); - assert(ret >= 0); + HDassert(ret >= 0); /* Close Dataset */ ret = H5Dclose(dataset); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Tclose(tid2); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Tclose(tid1); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Sclose(sid1); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Fclose(fid1); - assert(ret >= 0); + HDassert(ret >= 0); } @@ -2646,7 +2652,7 @@ static void gent_vldatatypes3(void) for(i=0; i= 0); + HDassert(ret >= 0); ret = H5Tinsert(tid2, "f", HOFFSET(s1, f), H5T_NATIVE_FLOAT); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Tinsert(tid2, "v", HOFFSET(s1, v), tid1); - assert(ret >= 0); + HDassert(ret >= 0); /* Create a dataset */ dataset = H5Dcreate2(fid1, "Dataset1", tid2, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write dataset to disk */ ret = H5Dwrite(dataset, tid2, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); - assert(ret >= 0); + HDassert(ret >= 0); /* Reclaim the write VL data */ ret = H5Dvlen_reclaim(tid2, sid1, H5P_DEFAULT, wdata); - assert(ret >= 0); + HDassert(ret >= 0); /* Close Dataset */ ret = H5Dclose(dataset); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Tclose(tid2); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Tclose(tid1); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Sclose(sid1); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Fclose(fid1); - assert(ret >= 0); + HDassert(ret >= 0); } static void gent_vldatatypes4(void) @@ -2713,7 +2719,7 @@ static void gent_vldatatypes4(void) /* Allocate and initialize VL data to write */ for(i=0; i= 0); + HDassert(ret >= 0); ret = H5Tinsert(tid2, "f", HOFFSET(s1, f), H5T_NATIVE_FLOAT); - assert(ret >= 0); + HDassert(ret >= 0); /* Create a datatype to refer to */ tid1 = H5Tvlen_create(tid2); @@ -2744,23 +2750,23 @@ static void gent_vldatatypes4(void) /* Write dataset to disk */ ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); - assert(ret >= 0); + HDassert(ret >= 0); /* Reclaim the write VL data */ ret = H5Dvlen_reclaim(tid1, sid1, H5P_DEFAULT, wdata); - assert(ret >= 0); + HDassert(ret >= 0); /* Close Dataset */ ret = H5Dclose(dataset); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Tclose(tid1); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Tclose(tid2); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Sclose(sid1); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Fclose(fid1); - assert(ret >= 0); + HDassert(ret >= 0); } /* Generate a variable-length dataset with NULL values in it */ @@ -2783,7 +2789,7 @@ static void gent_vldatatypes5(void) } /* end if */ else { wdata[i].len=i+5; - wdata[i].p=malloc(sizeof(unsigned)*(i+5)); + wdata[i].p=HDmalloc(sizeof(unsigned)*(i+5)); for(j=0; j0); + HDassert(fid1>0); /* Create dataspace for datasets */ sid1 = H5Screate_simple(SPACE1_RANK, dims1, NULL); - assert(sid1>0); + HDassert(sid1>0); /* Create a datatype to refer to */ tid1 = H5Tvlen_create(H5T_NATIVE_UINT); - assert(tid1>0); + HDassert(tid1>0); /* Create a dataset */ dataset = H5Dcreate2(fid1, F43_DSETNAME, tid1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - assert(dataset>0); + HDassert(dataset>0); ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Dclose(dataset); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Dvlen_reclaim(tid1, sid1, H5P_DEFAULT, wdata); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Tclose(tid1); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Sclose (sid1); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Fclose (fid1); - assert(ret >= 0); + HDassert(ret >= 0); } /* This is big enough to make h5dump to use hyperslap to read @@ -2862,8 +2868,8 @@ static void gent_array1_big(void) block[0] = 1; /* Allocate write & read buffers */ - wbuf = (hdset_reg_ref_t*) calloc(sizeof(hdset_reg_ref_t), SPACE1_DIM1); - wdata = (int *)malloc(sizeof(int) * (size_t)(SPACE_ARRAY1BIG_DIM * ARRAY1BIG_DIM)); + wbuf = (hdset_reg_ref_t*) HDcalloc(sizeof(hdset_reg_ref_t), SPACE1_DIM1); + wdata = (int *)HDmalloc(sizeof(int) * (size_t)(SPACE_ARRAY1BIG_DIM * ARRAY1BIG_DIM)); /* Allocate and initialize array data to write */ for(i = 0; i < SPACE_ARRAY1BIG_DIM; i++) @@ -2887,7 +2893,7 @@ static void gent_array1_big(void) /* Write dataset to disk */ ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); - assert(ret >= 0); + HDassert(ret >= 0); /*--------------------------- * Region Reference dataset @@ -2911,17 +2917,17 @@ static void gent_array1_big(void) /* Close Dataset */ ret = H5Dclose(dataset); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Tclose(tid1); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Sclose(sid1); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Fclose(fid1); - assert(ret >= 0); + HDassert(ret >= 0); /* Release memory */ - free(wbuf); - free(wdata); + HDfree(wbuf); + HDfree(wdata); } static void gent_array1(void) @@ -2955,17 +2961,17 @@ static void gent_array1(void) /* Write dataset to disk */ ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); - assert(ret >= 0); + HDassert(ret >= 0); /* Close Dataset */ ret = H5Dclose(dataset); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Tclose(tid1); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Sclose(sid1); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Fclose(fid1); - assert(ret >= 0); + HDassert(ret >= 0); } static void gent_array2(void) @@ -3001,17 +3007,17 @@ static void gent_array2(void) /* Write dataset to disk */ ret = H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); - assert(ret >= 0); + HDassert(ret >= 0); /* Close Dataset */ ret = H5Dclose(dataset); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Tclose(tid); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Sclose(sid); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Fclose(fid); - assert(ret >= 0); + HDassert(ret >= 0); } static void gent_array3(void) @@ -3052,19 +3058,19 @@ static void gent_array3(void) /* Write dataset to disk */ ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); - assert(ret >= 0); + HDassert(ret >= 0); /* Close Dataset */ ret = H5Dclose(dataset); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Tclose(tid1); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Tclose(tid2); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Sclose(sid); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Fclose(fid); - assert(ret >= 0); + HDassert(ret >= 0); } static void gent_array4(void) @@ -3102,35 +3108,35 @@ static void gent_array4(void) /* Insert integer field */ ret = H5Tinsert(tid2, "i", HOFFSET(s2_t, i), H5T_NATIVE_INT); - assert(ret >= 0); + HDassert(ret >= 0); /* Insert float field */ ret = H5Tinsert(tid2, "f", HOFFSET(s2_t, f), H5T_NATIVE_FLOAT); - assert(ret >= 0); + HDassert(ret >= 0); /* Create an array datatype to refer to */ tid1 = H5Tarray_create2(tid2, ARRAY1_RANK, tdims1); /* Close compound datatype */ ret = H5Tclose(tid2); - assert(ret >= 0); + HDassert(ret >= 0); /* Create a dataset */ dataset = H5Dcreate2(fid1, "Dataset1", tid1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write dataset to disk */ ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); - assert(ret >= 0); + HDassert(ret >= 0); /* Close Dataset */ ret = H5Dclose(dataset); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Tclose(tid1); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Sclose(sid1); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Fclose(fid1); - assert(ret >= 0); + HDassert(ret >= 0); } static void gent_array5(void) @@ -3170,42 +3176,42 @@ static void gent_array5(void) /* Insert integer field */ ret = H5Tinsert (tid2, "i", HOFFSET(s2_t,i), H5T_NATIVE_INT); - assert(ret >= 0); + HDassert(ret >= 0); /* Create an array of floats datatype */ tid3 = H5Tarray_create2(H5T_NATIVE_FLOAT, ARRAY1_RANK, tdims1); /* Insert float array field */ ret = H5Tinsert (tid2, "f", HOFFSET(s2_t,f), tid3); - assert(ret >= 0); + HDassert(ret >= 0); /* Close array of floats field datatype */ ret = H5Tclose(tid3); - assert(ret >= 0); + HDassert(ret >= 0); /* Create an array datatype to refer to */ tid1 = H5Tarray_create2(tid2, ARRAY1_RANK, tdims1); /* Close compound datatype */ ret = H5Tclose(tid2); - assert(ret >= 0); + HDassert(ret >= 0); /* Create a dataset */ dataset = H5Dcreate2(fid1, "Dataset1", tid1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write dataset to disk */ ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); - assert(ret >= 0); + HDassert(ret >= 0); /* Close Dataset */ ret = H5Dclose(dataset); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Tclose(tid1); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Sclose(sid1); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Fclose(fid1); - assert(ret >= 0); + HDassert(ret >= 0); } static void gent_array6(void) @@ -3224,7 +3230,7 @@ static void gent_array6(void) /* Initialize array data to write */ for(i=0; i= 0); + HDassert(ret >= 0); /* Create a dataset */ dataset = H5Dcreate2(fid1, "Dataset1", tid1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write dataset to disk */ ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); - assert(ret >= 0); + HDassert(ret >= 0); /* Reclaim the write VL data */ ret = H5Dvlen_reclaim(tid1, sid1, H5P_DEFAULT, wdata); - assert(ret >= 0); + HDassert(ret >= 0); /* Close Dataset */ ret = H5Dclose(dataset); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Tclose(tid1); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Sclose(sid1); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Fclose(fid1); - assert(ret >= 0); + HDassert(ret >= 0); } static void gent_array7(void) @@ -3285,7 +3291,7 @@ static void gent_array7(void) /* Initialize array data to write */ for(i=0; i= 0); + HDassert(ret >= 0); /* Create an array datatype to refer to */ tid1 = H5Tarray_create2(tid2, ARRAY1_RANK, tdims1); /* Close VL datatype */ ret = H5Tclose(tid2); - assert(ret >= 0); + HDassert(ret >= 0); /* Create a dataset */ dataset = H5Dcreate2(fid1, "Dataset1", tid1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write dataset to disk */ ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); - assert(ret >= 0); + HDassert(ret >= 0); /* Reclaim the write VL data */ ret = H5Dvlen_reclaim(tid1, sid1, H5P_DEFAULT, wdata); - assert(ret >= 0); + HDassert(ret >= 0); /* Close Dataset */ ret = H5Dclose(dataset); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Tclose(tid1); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Sclose(sid1); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Fclose(fid1); - assert(ret >= 0); + HDassert(ret >= 0); } /* Test the boundary of the display output buffer at the reallocation event */ @@ -3411,30 +3417,30 @@ static void gent_empty(void) dset = H5Dcreate2(file, "Dataset1.0", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Don't write any data */ ret = H5Dclose(dset); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Tclose(type); - assert(ret >= 0); + HDassert(ret >= 0); /* write out an empty native integer dataset dataset */ dset = H5Dcreate2(file, "Dataset2.0", H5T_NATIVE_INT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Don't write any data */ ret = H5Dclose(dset); - assert(ret >= 0); + HDassert(ret >= 0); /* write out an empty native floating-point dataset dataset */ dset = H5Dcreate2(file, "Dataset3.0", H5T_NATIVE_FLOAT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Don't write any data */ ret = H5Dclose(dset); - assert(ret >= 0); + HDassert(ret >= 0); /* write out an empty array dataset */ type = H5Tarray_create2(H5T_NATIVE_INT, SPACE1_RANK, dims); dset = H5Dcreate2(file, "Dataset4.0", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Don't write any data */ ret = H5Dclose(dset); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Tclose(type); - assert(ret >= 0); + HDassert(ret >= 0); /* write out an empty compound dataset */ type = H5Tcreate(H5T_COMPOUND,sizeof(empty_struct)); @@ -3444,15 +3450,15 @@ static void gent_empty(void) dset = H5Dcreate2(file, "Dataset5.0", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Don't write any data */ ret = H5Dclose(dset); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Tclose(type); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Sclose(space); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Fclose(file); - assert(ret >= 0); + HDassert(ret >= 0); } static void @@ -3533,7 +3539,7 @@ void gent_split_file(void) root = H5Gopen2(fid, "/", H5P_DEFAULT); atype = H5Tcopy(H5T_C_S1); - H5Tset_size(atype, strlen(meta) + 1); + H5Tset_size(atype, HDstrlen(meta) + 1); H5Tset_strpad(atype, H5T_STR_NULLTERM); dims[0] = 1; @@ -3616,7 +3622,7 @@ void gent_multi(void) HDmemset(memb_name, 0, sizeof memb_name); HDmemset(memb_addr, 0, sizeof memb_addr); - assert(HDstrlen(multi_letters) == H5FD_MEM_NTYPES); + HDassert(HDstrlen(multi_letters) == H5FD_MEM_NTYPES); for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t,mt)) { memb_fapl[mt] = H5P_DEFAULT; @@ -3734,7 +3740,7 @@ static void gent_char(void) hid_t sid1; /* Dataspace ID */ hsize_t dims1[1]; - dims1[0] = strlen(wdata); + dims1[0] = HDstrlen(wdata); /* Create file */ fid1 = H5Fcreate(FILE39, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -3900,10 +3906,10 @@ static void write_attr_in(hid_t loc_id, /* Allocate and initialize VL dataset to write */ buf5[0].len = 1; - buf5[0].p = malloc(1 * sizeof(int)); + buf5[0].p = HDmalloc(1 * sizeof(int)); ((int *)buf5[0].p)[0] = 1; buf5[1].len = 2; - buf5[1].p = malloc(2 * sizeof(int)); + buf5[1].p = HDmalloc(2 * sizeof(int)); ((int *)buf5[1].p)[0] = 2; ((int *)buf5[1].p)[1] = 3; @@ -3911,9 +3917,9 @@ static void write_attr_in(hid_t loc_id, tid = H5Tvlen_create(H5T_NATIVE_INT); aid = H5Acreate2(loc_id, "vlen", tid, sid, H5P_DEFAULT, H5P_DEFAULT); status = H5Awrite(aid, tid, buf5); - assert(status >= 0); + HDassert(status >= 0); status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf5); - assert(status >= 0); + HDassert(status >= 0); status = H5Aclose(aid); status = H5Tclose(tid); status = H5Sclose(sid); @@ -4011,7 +4017,7 @@ static void write_attr_in(hid_t loc_id, for(j = 0; j < 2; j++) { int l; - buf52[i][j].p = malloc((i + 1) * sizeof(int)); + buf52[i][j].p = HDmalloc((i + 1) * sizeof(int)); buf52[i][j].len = i + 1; for(l = 0; l < i + 1; l++) ((int *)buf52[i][j].p)[l] = n++; @@ -4022,9 +4028,9 @@ static void write_attr_in(hid_t loc_id, tid = H5Tvlen_create(H5T_NATIVE_INT); aid = H5Acreate2(loc_id, "vlen2D", tid, sid, H5P_DEFAULT, H5P_DEFAULT); status = H5Awrite(aid, tid, buf52); - assert(status >= 0); + HDassert(status >= 0); status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf52); - assert(status >= 0); + HDassert(status >= 0); status = H5Aclose(aid); status = H5Tclose(tid); status = H5Sclose(sid); @@ -4143,7 +4149,7 @@ static void write_attr_in(hid_t loc_id, for(k = 0; k < 2; k++) { int l; - buf53[i][j][k].p = malloc((i + 1) * sizeof(int)); + buf53[i][j][k].p = HDmalloc((i + 1) * sizeof(int)); buf53[i][j][k].len = i + 1; for(l = 0; l < i + 1; l++) ((int *)buf53[i][j][k].p)[l] = n++; @@ -4155,9 +4161,9 @@ static void write_attr_in(hid_t loc_id, tid = H5Tvlen_create(H5T_NATIVE_INT); aid = H5Acreate2(loc_id, "vlen3D", tid, sid, H5P_DEFAULT, H5P_DEFAULT); status = H5Awrite(aid, tid, buf53); - assert(status >= 0); + HDassert(status >= 0); status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf53); - assert(status >= 0); + HDassert(status >= 0); status = H5Aclose(aid); status = H5Tclose(tid); status = H5Sclose(sid); @@ -4342,10 +4348,10 @@ static void write_dset_in(hid_t loc_id, /* Allocate and initialize VL dataset to write */ buf5[0].len = 1; - buf5[0].p = malloc( 1 * sizeof(int)); + buf5[0].p = HDmalloc( 1 * sizeof(int)); ((int *)buf5[0].p)[0]=1; buf5[1].len = 2; - buf5[1].p = malloc( 2 * sizeof(int)); + buf5[1].p = HDmalloc( 2 * sizeof(int)); ((int *)buf5[1].p)[0]=2; ((int *)buf5[1].p)[1]=3; @@ -4353,9 +4359,9 @@ static void write_dset_in(hid_t loc_id, tid = H5Tvlen_create(H5T_NATIVE_INT); did = H5Dcreate2(loc_id, "vlen", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); status = H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf5); - assert(status >= 0); + HDassert(status >= 0); status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf5); - assert(status >= 0); + HDassert(status >= 0); status = H5Dclose(did); status = H5Tclose(tid); status = H5Sclose(sid); @@ -4453,7 +4459,7 @@ static void write_dset_in(hid_t loc_id, for(j = 0; j < 2; j++) { int l; - buf52[i][j].p = malloc((i + 1) * sizeof(int)); + buf52[i][j].p = HDmalloc((i + 1) * sizeof(int)); buf52[i][j].len = i + 1; for(l = 0; l < i + 1; l++) ((int *)buf52[i][j].p)[l] = n++; @@ -4463,9 +4469,9 @@ static void write_dset_in(hid_t loc_id, tid = H5Tvlen_create(H5T_NATIVE_INT); did = H5Dcreate2(loc_id, "vlen2D", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); status = H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf52); - assert(status >= 0); + HDassert(status >= 0); status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf52); - assert(status >= 0); + HDassert(status >= 0); status = H5Dclose(did); status = H5Tclose(tid); status = H5Sclose(sid); @@ -4597,7 +4603,7 @@ static void write_dset_in(hid_t loc_id, for(k = 0; k < 2; k++) { int l; - buf53[i][j][k].p = malloc((i + 1) * sizeof(int)); + buf53[i][j][k].p = HDmalloc((i + 1) * sizeof(int)); buf53[i][j][k].len = i + 1; for(l = 0; l < i + 1; l++) ((int *)buf53[i][j][k].p)[l] = n++; @@ -4607,9 +4613,9 @@ static void write_dset_in(hid_t loc_id, tid = H5Tvlen_create(H5T_NATIVE_INT); did = H5Dcreate2(loc_id, "vlen3D", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); status = H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf53); - assert(status >= 0); + HDassert(status >= 0); status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf53); - assert(status >= 0); + HDassert(status >= 0); status = H5Dclose(did); status = H5Tclose(tid); status = H5Sclose(sid); @@ -4681,7 +4687,7 @@ static void gent_attr_all(void) 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); + HDassert(status >= 0); /* Create groups */ group_id = H5Gcreate2(fid, "g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); @@ -4706,17 +4712,17 @@ static void gent_attr_all(void) /* Close */ status = H5Dclose(did); - assert(status >= 0); + HDassert(status >= 0); status = H5Gclose(group_id); - assert(status >= 0); + HDassert(status >= 0); status = H5Gclose(group2_id); - assert(status >= 0); + HDassert(status >= 0); status = H5Gclose(root_id); - assert(status >= 0); + HDassert(status >= 0); /* Close file */ status = H5Fclose(fid); - assert(status >= 0); + HDassert(status >= 0); } @@ -4868,73 +4874,73 @@ static void gent_compound_complex(void) /* Create the dataspace */ dataspace = H5Screate_simple(F41_RANK, dim, NULL); - assert(dataspace >= 0); + HDassert(dataspace >= 0); /* Create the file */ datafile = H5Fcreate(FILE41, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - assert(datafile >= 0); + HDassert(datafile >= 0); /* Copy the array data type for the string array */ array_tid = H5Tcopy (H5T_C_S1); - assert(array_tid >= 0); + HDassert(array_tid >= 0); /* Set the string array size to Variable */ status = H5Tset_size (array_tid,H5T_VARIABLE); - assert(status >= 0); + HDassert(status >= 0); /* Create the array data type for the string array */ str_array_id = H5Tarray_create2(array_tid, F41_ARRAY_RANK, array_dimb); - assert(str_array_id >= 0); + HDassert(str_array_id >= 0); /* Copy the array data type for the character array */ array1_tid = H5Tcopy (H5T_C_S1); - assert(array1_tid >= 0); + HDassert(array1_tid >= 0); /* Set the character array size */ status = H5Tset_size (array1_tid, F41_ARRAY_DIMc); - assert(status >= 0); + HDassert(status >= 0); /* Create the array data type for the character array */ array2_tid = H5Tarray_create2(H5T_NATIVE_SHORT, F41_ARRAY_RANKd, array_dimd); - assert(array2_tid >= 0); + HDassert(array2_tid >= 0); /* Create the array data type for the character array */ array4_tid = H5Tarray_create2(H5T_NATIVE_DOUBLE, F41_ARRAY_RANK, array_dimf); - assert(array4_tid >= 0); + HDassert(array4_tid >= 0); /* Create the memory data type */ Array1Structid = H5Tcreate (H5T_COMPOUND, sizeof(Array1Struct)); - assert(Array1Structid >= 0); + HDassert(Array1Structid >= 0); /* Insert the arrays and variables into the structure */ status = H5Tinsert(Array1Structid, "a_name", HOFFSET(Array1Struct, a), H5T_NATIVE_INT); - assert(status >= 0); + HDassert(status >= 0); status = H5Tinsert(Array1Structid, "b_name", HOFFSET(Array1Struct, b), str_array_id); - assert(status >= 0); + HDassert(status >= 0); status = H5Tinsert(Array1Structid, "c_name", HOFFSET(Array1Struct, c), array1_tid); - assert(status >= 0); + HDassert(status >= 0); status = H5Tinsert(Array1Structid, "d_name", HOFFSET(Array1Struct, d), array2_tid); - assert(status >= 0); + HDassert(status >= 0); status = H5Tinsert(Array1Structid, "e_name", HOFFSET(Array1Struct, e), H5T_NATIVE_FLOAT); - assert(status >= 0); + HDassert(status >= 0); status = H5Tinsert(Array1Structid, "f_name", HOFFSET(Array1Struct, f), array4_tid); - assert(status >= 0); + HDassert(status >= 0); status = H5Tinsert(Array1Structid, "g_name", HOFFSET(Array1Struct, g), H5T_NATIVE_CHAR); - assert(status >= 0); + HDassert(status >= 0); /* Create the dataset */ dataset = H5Dcreate2(datafile, F41_DATASETNAME, Array1Structid, @@ -4943,35 +4949,35 @@ static void gent_compound_complex(void) /* Write data to the dataset */ status = H5Dwrite(dataset, Array1Structid, H5S_ALL, H5S_ALL, H5P_DEFAULT, Array1); - assert(status >= 0); + HDassert(status >= 0); /* Release resources */ status = H5Tclose(Array1Structid); - assert(status >= 0); + HDassert(status >= 0); status = H5Tclose(array_tid); - assert(status >= 0); + HDassert(status >= 0); status = H5Tclose(array1_tid); - assert(status >= 0); + HDassert(status >= 0); status = H5Tclose(array2_tid); - assert(status >= 0); + HDassert(status >= 0); status = H5Tclose(array4_tid); - assert(status >= 0); + HDassert(status >= 0); status = H5Tclose(str_array_id); - assert(status >= 0); + HDassert(status >= 0); status = H5Sclose(dataspace); - assert(status >= 0); + HDassert(status >= 0); status = H5Dclose(dataset); - assert(status >= 0); + HDassert(status >= 0); status = H5Fclose(datafile); - assert(status >= 0); + HDassert(status >= 0); } @@ -4988,7 +4994,7 @@ static void gent_named_dtype_attr(void) /* Create a file */ fid=H5Fcreate(FILE42, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - assert(fid>0); + HDassert(fid>0); /*------------------------------------------------------------------------- * datatype @@ -4997,27 +5003,27 @@ static void gent_named_dtype_attr(void) /* Create a datatype to commit and use */ tid=H5Tcopy(H5T_NATIVE_INT); - assert(tid>0); + HDassert(tid>0); /* Commit datatype to file */ ret = H5Tcommit2(fid, F42_TYPENAME, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - assert(ret >= 0); + HDassert(ret >= 0); /* Create a hard link to the datatype */ ret = H5Lcreate_hard(fid, F42_TYPENAME, fid, F42_LINKNAME, H5P_DEFAULT, H5P_DEFAULT); - assert(ret >= 0); + HDassert(ret >= 0); /* Create a scalar dataspace used for all objects */ sid = H5Screate(H5S_SCALAR); - assert(sid > 0); + HDassert(sid > 0); /* Create attribute on commited datatype */ aid = H5Acreate2(tid, F42_ATTRNAME, H5T_STD_I32LE, sid, H5P_DEFAULT, H5P_DEFAULT); - assert(aid > 0); + HDassert(aid > 0); /* Write data into the attribute */ ret = H5Awrite(aid, H5T_NATIVE_INT, &data); - assert(ret >= 0); + HDassert(ret >= 0); /*------------------------------------------------------------------------- * dataset @@ -5026,15 +5032,15 @@ static void gent_named_dtype_attr(void) /* Create dataset */ did = H5Dcreate2(fid, F42_DSETNAME, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - assert(did > 0); + HDassert(did > 0); /* Create attribute on dataset */ aid = H5Acreate2(did, F42_ATTRNAME, tid, sid, H5P_DEFAULT, H5P_DEFAULT); - assert(aid > 0); + HDassert(aid > 0); /* Write data into the attribute */ ret = H5Awrite(aid, H5T_NATIVE_INT, &data); - assert(ret >= 0); + HDassert(ret >= 0); /*------------------------------------------------------------------------- * group @@ -5043,15 +5049,15 @@ static void gent_named_dtype_attr(void) /* Create a group */ gid = H5Gcreate2(fid, "g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - assert(gid > 0); + HDassert(gid > 0); /* Create attribute on group */ aid = H5Acreate2(gid, F42_ATTRNAME, tid, sid, H5P_DEFAULT, H5P_DEFAULT); - assert(aid > 0); + HDassert(aid > 0); /* Write data into the attribute */ ret = H5Awrite(aid, H5T_NATIVE_INT, &data); - assert(ret >= 0); + HDassert(ret >= 0); /*------------------------------------------------------------------------- * close @@ -5060,23 +5066,23 @@ static void gent_named_dtype_attr(void) /* Close attribute */ ret = H5Aclose(aid); - assert(ret >= 0); + HDassert(ret >= 0); /* Close dataset */ ret = H5Dclose(did); - assert(ret >= 0); + HDassert(ret >= 0); /* Close dataspace */ ret = H5Sclose(sid); - assert(ret >= 0); + HDassert(ret >= 0); /* Close datatype */ ret = H5Tclose(tid); - assert(ret >= 0); + HDassert(ret >= 0); /* Close file */ ret = H5Fclose(fid); - assert(ret >= 0); + HDassert(ret >= 0); } @@ -5114,7 +5120,41 @@ static void gent_null_space(void) H5Fclose(fid); } +/*------------------------------------------------------------------------- + * Function: gent_zero_dim_size + * + * Purpose: generates dataset and attribute with dataspace of 0 dimension size + *------------------------------------------------------------------------- + */ +static void gent_zero_dim_size(void) +{ + hid_t fid, root, dataset, space, attr; + hsize_t dims1[] = {SPACE3_DIM1, SPACE3_DIM2}; + int dset_buf = 10; + int point = 4; + + fid = H5Fcreate(FILE67, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + root = H5Gopen2(fid, "/", H5P_DEFAULT); + + /* dataspace of 0 dimension size */ + space = H5Screate_simple(SPACE3_RANK, dims1, NULL); + + /* dataset */ + dataset = H5Dcreate2(fid, "dset of 0 dimension size", H5T_STD_I32BE, space, H5P_DEFAULT, + H5P_DEFAULT, H5P_DEFAULT); + /* nothing should be written */ + H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &dset_buf); + /* attribute */ + attr = H5Acreate2(root, "attr of 0 dimension size", H5T_NATIVE_UINT, space, H5P_DEFAULT, H5P_DEFAULT); + H5Awrite(attr, H5T_NATIVE_INT, &point); /* Nothing can be written */ + + H5Dclose(dataset); + H5Aclose(attr); + H5Gclose(root); + H5Sclose(space); + H5Fclose(fid); +} /*------------------------------------------------------------------------- * Function: make_dset @@ -5179,25 +5219,25 @@ make_external(hid_t fid) dcpl = H5Pcreate(H5P_DATASET_CREATE); ret = H5Pset_external(dcpl, "ext1.bin", (off_t)0, size); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Pset_external(dcpl, "ext2.bin", (off_t)0, size); - assert(ret >= 0); + HDassert(ret >= 0); sid = H5Screate_simple(1, cur_size, max_size); - assert(ret >= 0); + HDassert(ret >= 0); dsid = H5Dcreate2(fid, "external", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); - assert(ret >= 0); + HDassert(ret >= 0); H5Dclose(dsid); - assert(ret >= 0); + HDassert(ret >= 0); H5Sclose(sid); - assert(ret >= 0); + HDassert(ret >= 0); H5Pclose(dcpl); - assert(ret >= 0); + HDassert(ret >= 0); } /*------------------------------------------------------------------------- @@ -5230,7 +5270,7 @@ static void gent_filters(void) /* create a file */ fid = H5Fcreate(FILE44, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - assert(fid>=0); + HDassert(fid>=0); /* create a space */ sid = H5Screate_simple(SPACE2_RANK, dims1, NULL); @@ -5244,34 +5284,34 @@ static void gent_filters(void) *------------------------------------------------------------------------- */ ret = H5Pset_layout(dcpl, H5D_COMPACT); - assert(ret >= 0); + HDassert(ret >= 0); ret=make_dset(fid,"compact",sid,H5T_NATIVE_INT,dcpl,buf1); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Oset_comment_by_name(fid, "compact", "This is a dataset with compact storage", H5P_DEFAULT); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Pset_layout(dcpl, H5D_CONTIGUOUS); - assert(ret >= 0); + HDassert(ret >= 0); ret=make_dset(fid,"contiguous",sid,H5T_NATIVE_INT,dcpl,buf1); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Oset_comment_by_name(fid, "contiguous", "This is a dataset with contiguous storage", H5P_DEFAULT); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Pset_layout(dcpl, H5D_CHUNKED); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Pset_chunk(dcpl, SPACE2_RANK, chunk_dims); - assert(ret >= 0); + HDassert(ret >= 0); ret=make_dset(fid,"chunked",sid,H5T_NATIVE_INT,dcpl,buf1); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Oset_comment_by_name(fid, "chunked", "This is a dataset with chunked storage", H5P_DEFAULT); - assert(ret >= 0); + HDassert(ret >= 0); /*------------------------------------------------------------------------- * make several dataset with filters @@ -5280,7 +5320,7 @@ static void gent_filters(void) /* set up chunk */ ret = H5Pset_chunk(dcpl, SPACE2_RANK, chunk_dims); - assert(ret >= 0); + HDassert(ret >= 0); /*------------------------------------------------------------------------- * SZIP @@ -5290,14 +5330,14 @@ static void gent_filters(void) if(h5tools_can_encode(H5Z_FILTER_SZIP) == 1) { /* remove the filters from the dcpl */ ret = H5Premove_filter(dcpl,H5Z_FILTER_ALL); - assert(ret >= 0); + HDassert(ret >= 0); /* set szip data */ ret = H5Pset_szip (dcpl,szip_options_mask,szip_pixels_per_block); - assert(ret >= 0); + HDassert(ret >= 0); ret=make_dset(fid,"szip",sid,H5T_NATIVE_INT,dcpl,buf1); - assert(ret >= 0); + HDassert(ret >= 0); } #endif /* H5_HAVE_FILTER_SZIP */ @@ -5308,14 +5348,14 @@ static void gent_filters(void) #if defined (H5_HAVE_FILTER_DEFLATE) /* remove the filters from the dcpl */ ret = H5Premove_filter(dcpl,H5Z_FILTER_ALL); - assert(ret >= 0); + HDassert(ret >= 0); /* set deflate data */ ret = H5Pset_deflate(dcpl, 9); - assert(ret >= 0); + HDassert(ret >= 0); ret=make_dset(fid,"deflate",sid,H5T_NATIVE_INT,dcpl,buf1); - assert(ret >= 0); + HDassert(ret >= 0); #endif @@ -5326,14 +5366,14 @@ static void gent_filters(void) #if defined (H5_HAVE_FILTER_SHUFFLE) /* remove the filters from the dcpl */ ret = H5Premove_filter(dcpl,H5Z_FILTER_ALL); - assert(ret >= 0); + HDassert(ret >= 0); /* set the shuffle filter */ ret = H5Pset_shuffle(dcpl); - assert(ret >= 0); + HDassert(ret >= 0); ret=make_dset(fid,"shuffle",sid,H5T_NATIVE_INT,dcpl,buf1); - assert(ret >= 0); + HDassert(ret >= 0); #endif @@ -5344,14 +5384,14 @@ static void gent_filters(void) #if defined (H5_HAVE_FILTER_FLETCHER32) /* remove the filters from the dcpl */ ret = H5Premove_filter(dcpl,H5Z_FILTER_ALL); - assert(ret >= 0); + HDassert(ret >= 0); /* set the checksum filter */ ret = H5Pset_fletcher32(dcpl); - assert(ret >= 0); + HDassert(ret >= 0); ret=make_dset(fid,"fletcher32",sid,H5T_NATIVE_INT,dcpl,buf1); - assert(ret >= 0); + HDassert(ret >= 0); #endif /*------------------------------------------------------------------------- @@ -5361,16 +5401,16 @@ static void gent_filters(void) #if defined (H5_HAVE_FILTER_NBIT) /* remove the filters from the dcpl */ ret = H5Premove_filter(dcpl,H5Z_FILTER_ALL); - assert(ret >= 0); + HDassert(ret >= 0); /* set the checksum filter */ ret = H5Pset_nbit(dcpl); - assert(ret >= 0); + HDassert(ret >= 0); tid=H5Tcopy(H5T_NATIVE_INT); H5Tset_precision(tid,H5Tget_size(tid)-1); ret=make_dset(fid,"nbit",sid,tid,dcpl,buf1); - assert(ret >= 0); + HDassert(ret >= 0); #endif /*------------------------------------------------------------------------- @@ -5380,14 +5420,14 @@ static void gent_filters(void) #if defined (H5_HAVE_FILTER_SCALEOFFSET) /* remove the filters from the dcpl */ ret = H5Premove_filter(dcpl,H5Z_FILTER_ALL); - assert(ret >= 0); + HDassert(ret >= 0); /* set the scaleoffset filter */ ret = H5Pset_scaleoffset(dcpl,H5Z_SO_INT,(int)H5Tget_size(H5T_NATIVE_INT)); - assert(ret >= 0); + HDassert(ret >= 0); ret=make_dset(fid,"scaleoffset",sid,H5T_NATIVE_INT,dcpl,buf1); - assert(ret >= 0); + HDassert(ret >= 0); #endif /*------------------------------------------------------------------------- @@ -5396,12 +5436,12 @@ static void gent_filters(void) */ /* remove the filters from the dcpl */ ret = H5Premove_filter(dcpl,H5Z_FILTER_ALL); - assert(ret >= 0); + HDassert(ret >= 0); #if defined (H5_HAVE_FILTER_SHUFFLE) /* set the shuffle filter */ ret = H5Pset_shuffle(dcpl); - assert(ret >= 0); + HDassert(ret >= 0); #endif #ifdef H5_HAVE_FILTER_SZIP @@ -5409,30 +5449,30 @@ static void gent_filters(void) szip_options_mask=H5_SZIP_CHIP_OPTION_MASK | H5_SZIP_EC_OPTION_MASK; /* set szip data */ ret = H5Pset_szip (dcpl,szip_options_mask,szip_pixels_per_block); - assert(ret >= 0); + HDassert(ret >= 0); } #endif /* H5_HAVE_FILTER_SZIP */ #if defined (H5_HAVE_FILTER_DEFLATE) /* set deflate data */ ret = H5Pset_deflate(dcpl, 5); - assert(ret >= 0); + HDassert(ret >= 0); #endif #if defined (H5_HAVE_FILTER_FLETCHER32) /* set the checksum filter */ ret = H5Pset_fletcher32(dcpl); - assert(ret >= 0); + HDassert(ret >= 0); #endif #if defined (H5_HAVE_FILTER_NBIT) /* set the nbit filter */ ret = H5Pset_nbit(dcpl); - assert(ret >= 0); + HDassert(ret >= 0); #endif ret=make_dset(fid,"all",sid,H5T_NATIVE_INT,dcpl,buf1); - assert(ret >= 0); + HDassert(ret >= 0); /*------------------------------------------------------------------------- @@ -5441,20 +5481,20 @@ static void gent_filters(void) */ /* remove the filters from the dcpl */ ret = H5Premove_filter(dcpl,H5Z_FILTER_ALL); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Zregister (H5Z_MYFILTER); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Pset_filter (dcpl, MYFILTER_ID, 0, 0, NULL); - assert(ret >= 0); + HDassert(ret >= 0); ret=make_dset(fid,"myfilter",sid,H5T_NATIVE_INT,dcpl,buf1); - assert(ret >= 0); + HDassert(ret >= 0); /* remove the filters from the dcpl */ ret = H5Premove_filter(dcpl,H5Z_FILTER_ALL); - assert(ret >= 0); + HDassert(ret >= 0); /*------------------------------------------------------------------------- * make an external dataset @@ -5467,27 +5507,27 @@ static void gent_filters(void) *------------------------------------------------------------------------- */ ret = H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_EARLY); - assert(ret >= 0); + HDassert(ret >= 0); ret=make_dset(fid,"alloc_time_early",sid,H5T_NATIVE_INT,dcpl,buf1); - assert(ret >= 0); + HDassert(ret >= 0); /*------------------------------------------------------------------------- * H5D_ALLOC_TIME_INCR *------------------------------------------------------------------------- */ ret = H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_INCR); - assert(ret >= 0); + HDassert(ret >= 0); ret=make_dset(fid,"alloc_time_incr",sid,H5T_NATIVE_INT,dcpl,buf1); - assert(ret >= 0); + HDassert(ret >= 0); /*------------------------------------------------------------------------- * H5D_ALLOC_TIME_LATE *------------------------------------------------------------------------- */ ret = H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_LATE); - assert(ret >= 0); + HDassert(ret >= 0); ret=make_dset(fid,"alloc_time_late",sid,H5T_NATIVE_INT,dcpl,buf1); - assert(ret >= 0); + HDassert(ret >= 0); /*------------------------------------------------------------------------- * commit a H5G_TYPE type with a comment @@ -5495,26 +5535,26 @@ static void gent_filters(void) */ tid = H5Tcopy(H5T_STD_B8LE); ret = H5Tcommit2(fid, "mytype", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Oset_comment_by_name(fid, "mytype", "This is a commited datatype", H5P_DEFAULT); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Tclose(tid); - assert(ret >= 0); + HDassert(ret >= 0); /*------------------------------------------------------------------------- * close *------------------------------------------------------------------------- */ ret = H5Sclose(sid); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Pclose(dcpl); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Fclose(fid); - assert(ret >= 0); + HDassert(ret >= 0); } @@ -5581,7 +5621,7 @@ static void gent_fcontents(void) /* create a file */ fid = H5Fcreate(FILE46, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - assert(fid>=0); + HDassert(fid>=0); write_dset(fid,1,dims,"dset",H5T_NATIVE_INT,buf); @@ -5613,30 +5653,30 @@ static void gent_fcontents(void) /* hard link to "dset" */ ret = H5Lcreate_hard(fid, "/dset", H5L_SAME_LOC, "dset3", H5P_DEFAULT, H5P_DEFAULT); - assert(ret >= 0); + HDassert(ret >= 0); /* hard link to "dset" */ ret = H5Lcreate_hard(fid, "/dset", H5L_SAME_LOC, "dset4", H5P_DEFAULT, H5P_DEFAULT); - assert(ret >= 0); + HDassert(ret >= 0); /* soft link to itself */ ret = H5Lcreate_soft("mylink", fid, "mylink", H5P_DEFAULT, H5P_DEFAULT); - assert(ret >= 0); + HDassert(ret >= 0); /* soft link to "dset" */ ret = H5Lcreate_soft("/dset", fid, "softlink", H5P_DEFAULT, H5P_DEFAULT); - assert(ret >= 0); + HDassert(ret >= 0); /* dangling external link */ ret = H5Lcreate_external("fname", "oname", fid, "extlink", H5P_DEFAULT, H5P_DEFAULT); - assert(ret >= 0); + HDassert(ret >= 0); /* dangling udlink */ ret = H5Lcreate_ud(fid, "udlink", (H5L_type_t)MY_LINKCLASS, NULL, 0, H5P_DEFAULT, H5P_DEFAULT); - assert(ret >= 0); + HDassert(ret >= 0); /*------------------------------------------------------------------------- * datatypes @@ -5644,20 +5684,20 @@ static void gent_fcontents(void) */ tid = H5Tcopy(H5T_NATIVE_INT); ret = H5Tcommit2(fid, "mytype", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Tclose(tid); - assert(ret >= 0); + HDassert(ret >= 0); /* no name datatype */ tid = H5Tcopy(H5T_NATIVE_INT); ret = H5Tcommit2(fid, "mytype2", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - assert(ret >= 0); + HDassert(ret >= 0); write_dset(fid, 1, dims, "dsetmytype2", tid, buf); ret = H5Ldelete(fid, "mytype2", H5P_DEFAULT); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Tclose(tid); - assert(ret >= 0); + HDassert(ret >= 0); /*------------------------------------------------------------------------- @@ -5667,16 +5707,16 @@ static void gent_fcontents(void) ret = H5Fclose(fid); - assert(ret >= 0); + HDassert(ret >= 0); /* create a file for the bootblock test */ fid = H5Fcreate(FILE47, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - assert(fid>=0); + HDassert(fid>=0); ret = H5Fclose(fid); - assert(ret >= 0); + HDassert(ret >= 0); } /*------------------------------------------------------------------------- @@ -5714,7 +5754,7 @@ static void gent_fvalues(void) /* create a file */ fid = H5Fcreate(FILE48, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - assert(fid>=0); + HDassert(fid>=0); /* create a space */ sid = H5Screate_simple(1, dims, NULL); @@ -5728,42 +5768,42 @@ static void gent_fvalues(void) *------------------------------------------------------------------------- */ ret = H5Pset_fill_time(dcpl, H5D_FILL_TIME_IFSET); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fillval1); - assert(ret >= 0); + HDassert(ret >= 0); ret=make_dset(fid,"fill_time_ifset",sid,H5T_NATIVE_INT,dcpl,buf); - assert(ret >= 0); + HDassert(ret >= 0); /*------------------------------------------------------------------------- * H5D_FILL_TIME_NEVER *------------------------------------------------------------------------- */ ret = H5Pset_fill_time(dcpl, H5D_FILL_TIME_NEVER); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fillval1); - assert(ret >= 0); + HDassert(ret >= 0); ret=make_dset(fid,"fill_time_never",sid,H5T_NATIVE_INT,dcpl,buf); - assert(ret >= 0); + HDassert(ret >= 0); /*------------------------------------------------------------------------- * H5D_FILL_TIME_ALLOC *------------------------------------------------------------------------- */ ret = H5Pset_fill_time(dcpl, H5D_FILL_TIME_ALLOC); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fillval1); - assert(ret >= 0); + HDassert(ret >= 0); ret=make_dset(fid,"fill_time_alloc",sid,H5T_NATIVE_INT,dcpl,buf); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Pclose(dcpl); - assert(ret >= 0); + HDassert(ret >= 0); /*------------------------------------------------------------------------- * dataset with no fill value @@ -5780,23 +5820,23 @@ static void gent_fvalues(void) H5Tinsert(tid, "a", HOFFSET(c_t, a), H5T_NATIVE_CHAR); H5Tinsert(tid, "b", HOFFSET(c_t, b), H5T_NATIVE_DOUBLE); ret = H5Pset_fill_value(dcpl, tid, &fillval2); - assert(ret >= 0); + HDassert(ret >= 0); ret=make_dset(fid,"fill_compound",sid,tid,dcpl,buf2); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Tclose(tid); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Pclose(dcpl); - assert(ret >= 0); + HDassert(ret >= 0); /*------------------------------------------------------------------------- * dataset with a H5T_VLEN fill value *------------------------------------------------------------------------- */ buf3[0].len = 1; - buf3[0].p = malloc( 1 * sizeof(int)); + buf3[0].p = HDmalloc( 1 * sizeof(int)); ((int *)buf3[0].p)[0]=1; buf3[1].len = 2; - buf3[1].p = malloc(2 * sizeof(int)); + buf3[1].p = HDmalloc(2 * sizeof(int)); ((int *)buf3[1].p)[0] = 2; ((int *)buf3[1].p)[1] = 3; @@ -5805,17 +5845,17 @@ static void gent_fvalues(void) fillval3.p=NULL; fillval3.len=0; ret = H5Pset_fill_value(dcpl, tid, &fillval3); - assert(ret >= 0); + HDassert(ret >= 0); did = H5Dcreate2(fid, "fill_vlen", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); ret = H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf3); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf3); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Dclose(did); ret = H5Tclose(tid); ret = H5Pclose(dcpl); - assert(ret >= 0); + HDassert(ret >= 0); /*------------------------------------------------------------------------- * dataset with a H5T_ARRAY fill value @@ -5831,9 +5871,9 @@ static void gent_fvalues(void) *------------------------------------------------------------------------- */ ret = H5Sclose(sid); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Fclose(fid); - assert(ret >= 0); + HDassert(ret >= 0); } @@ -5876,7 +5916,7 @@ static void gent_string(void) /* create a file */ fid = H5Fcreate(FILE49, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - assert(fid>=0); + HDassert(fid>=0); /*------------------------------------------------------------------------- * str1 @@ -5885,11 +5925,11 @@ static void gent_string(void) tid=H5Tcopy(H5T_C_S1); ret = H5Tset_size(tid, sizeof(buf1)); - assert(ret >= 0); + HDassert(ret >= 0); write_dset(fid,1,dims1,"str1",tid,buf1); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Tclose(tid); - assert(ret >= 0); + HDassert(ret >= 0); /*------------------------------------------------------------------------- * str2 @@ -5898,16 +5938,16 @@ static void gent_string(void) sid = H5Screate_simple(SPACE1_RANK, dims2, NULL); tid = H5Tcopy(H5T_C_S1); ret = H5Tset_size(tid, H5T_VARIABLE); - assert(ret >= 0); + HDassert(ret >= 0); did = H5Dcreate2(fid, "str2", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); ret = H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf2); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Tclose(tid); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Dclose(did); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Sclose(sid); - assert(ret >= 0); + HDassert(ret >= 0); /*------------------------------------------------------------------------- * str3 @@ -5920,13 +5960,13 @@ static void gent_string(void) H5Tinsert(tid, "a", HOFFSET(c_t, a), H5T_NATIVE_INT); H5Tinsert(tid, "str", HOFFSET(c_t, str), str_tid ); ret=make_dset(fid,"str3",sid,tid,H5P_DEFAULT,&buf3); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Tclose(tid); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Tclose(str_tid); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Sclose(sid); - assert(ret >= 0); + HDassert(ret >= 0); /*------------------------------------------------------------------------- * str4 @@ -5935,14 +5975,14 @@ static void gent_string(void) sid = H5Screate_simple(SPACE1_RANK, dims4, NULL); ret=make_dset(fid,"str4",sid,H5T_NATIVE_CHAR,H5P_DEFAULT,buf4); ret = H5Sclose(sid); - assert(ret >= 0); + HDassert(ret >= 0); /*------------------------------------------------------------------------- * close *------------------------------------------------------------------------- */ ret = H5Fclose(fid); - assert(ret >= 0); + HDassert(ret >= 0); } @@ -5985,7 +6025,7 @@ static void gent_aindices(void) /* create a file */ fid = H5Fcreate(FILE50, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - assert(fid>=0); + HDassert(fid>=0); /*------------------------------------------------------------------------- * root datasets @@ -6018,7 +6058,7 @@ static void gent_aindices(void) *------------------------------------------------------------------------- */ ret = H5Fclose(fid); - assert(ret >= 0); + HDassert(ret >= 0); } @@ -6040,34 +6080,34 @@ static void gent_longlinks(void) /* Create files */ fid = H5Fcreate(FILE51, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - assert(fid >= 0); + HDassert(fid >= 0); /* Create group with short name in file (used as target for hard links) */ gid = H5Gcreate2(fid, "grp1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - assert(gid >= 0); + HDassert(gid >= 0); /* Construct very long file name */ objname = (char*) HDmalloc((size_t)(F51_MAX_NAME_LEN + 1)); - assert(objname); + HDassert(objname); for(u = 0; u < F51_MAX_NAME_LEN; u++) objname[u] = 'a'; objname[F51_MAX_NAME_LEN] = '\0'; /* Create hard link to existing object */ - assert(H5Lcreate_hard(fid, "grp1", fid, objname, H5P_DEFAULT, H5P_DEFAULT) >= 0); + HDassert(H5Lcreate_hard(fid, "grp1", fid, objname, H5P_DEFAULT, H5P_DEFAULT) >= 0); /* Create soft link to existing object */ objname[0] = 'b'; - assert(H5Lcreate_soft("grp1", fid, objname, H5P_DEFAULT, H5P_DEFAULT) >= 0); + HDassert(H5Lcreate_soft("grp1", fid, objname, H5P_DEFAULT, H5P_DEFAULT) >= 0); /* Create group with long name in existing group */ gid2 = H5Gcreate2(gid, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - assert(gid2 >= 0); + HDassert(gid2 >= 0); /* Close objects */ - assert(H5Gclose(gid2) >= 0); - assert(H5Gclose(gid) >= 0); - assert(H5Fclose(fid) >= 0); + HDassert(H5Gclose(gid2) >= 0); + HDassert(H5Gclose(gid) >= 0); + HDassert(H5Fclose(fid) >= 0); /* Release memory */ HDfree(objname); @@ -6217,7 +6257,7 @@ gent_bigdims(void) /* create a file */ fid = H5Fcreate(FILE56, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - assert(fid >= 0); + HDassert(fid >= 0); /* create dataset */ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) @@ -6243,7 +6283,7 @@ gent_bigdims(void) if((m_sid = H5Screate_simple(1, hs_size, hs_size)) < 0) goto out; - buf=(char *) malloc((unsigned)(nelmts*size)); + buf=(char *) HDmalloc((unsigned)(nelmts*size)); for(i=0, c=0; i= 0); + HDassert(ret >= 0); return; @@ -6311,20 +6351,20 @@ gent_hyperslab(void) double *buf; int i, ret; - buf = (double*) malloc(32 * 4097 * sizeof(double) ); + buf = (double*) HDmalloc(32 * 4097 * sizeof(double) ); for(i = 0; i < 32 * 4097; i++) buf[i] = 1; /* create a file */ fid = H5Fcreate(FILE57, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - assert(fid>=0); + HDassert(fid>=0); write_dset(fid,2,dims,"stripmine",H5T_NATIVE_DOUBLE,buf); ret = H5Fclose(fid); - assert(ret >= 0); + HDassert(ret >= 0); - free(buf); + HDfree(buf); } /*------------------------------------------------------------------------- @@ -6867,6 +6907,11 @@ gent_extlinks(void) H5Lcreate_external(FILE62, "type", source_fid, "ext_link3", H5P_DEFAULT, H5P_DEFAULT); H5Lcreate_external(FILE62, "group/elink_t2", source_fid, "ext_link4", H5P_DEFAULT, H5P_DEFAULT); H5Lcreate_external(FILE62, "empty_group", source_fid, "ext_link5", H5P_DEFAULT, H5P_DEFAULT); +/* external link to soft link which linked to a dataset */ + H5Lcreate_external(FILE4_1, "/soft_dset1", source_fid, "ext2soft_link1", H5P_DEFAULT, H5P_DEFAULT); + +/* external link to dangle soft link */ + H5Lcreate_external(FILE4_1, "/soft_dangle", source_fid, "ext2softdangle_link1", H5P_DEFAULT, H5P_DEFAULT); /*------------------------------------------------------------------------- * create external link in the "far" file pointing to the source file @@ -6884,14 +6929,14 @@ gent_extlinks(void) * Function: gent_fs_strategy_threshold * * Purpose: Generate a file with non-default file space strategy and - * non-default free-space section threshold. + * non-default free-space section threshold. *------------------------------------------------------------------------- */ static void gent_fs_strategy_threshold(void) { - hid_t fid; /* File id */ - hid_t fcpl; /* File creation property */ + hid_t fid; /* File id */ + hid_t fcpl; /* File creation property */ /* Create file-creation template */ fcpl = H5Pcreate(H5P_FILE_CREATE); @@ -6999,7 +7044,7 @@ gent_dataset_idx(void) * Three more datasets of 1, 2 and 4 bytes of signed int types are created. * Fill them with raw data such that no bit will be all zero in a dataset. * A dummy dataset of double type is created for failure test. - * Created: Albert Cheng, 2010/5/10. + * Created: Albert Cheng, 2010/5/10. * Modified: Allen Byrne, 2011/1/5 Use file to test Signed/Unsigned datatypes *------------------------------------------------------------------------- */ @@ -7026,13 +7071,13 @@ gent_packedbits(void) space = H5Screate_simple(2, dims, NULL); dataset = H5Dcreate2(fid, F66_DATASETU08, H5T_STD_U8LE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - valu8bits = (uint8_t) ~0u; /* all 1s */ + valu8bits = (uint8_t) ~0u; /* all 1s */ for(i = 0; i < dims[0]; i++){ - dsetu8[i][0] = valu8bits; - for(j = 1; j < dims[1]; j++) { + dsetu8[i][0] = valu8bits; + for(j = 1; j < dims[1]; j++) { dsetu8[i][j] = dsetu8[i][j-1] << 1; - } - valu8bits <<= 1; + } + valu8bits <<= 1; } H5Dwrite(dataset, H5T_NATIVE_UINT8, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetu8); @@ -7044,13 +7089,13 @@ gent_packedbits(void) space = H5Screate_simple(2, dims, NULL); dataset = H5Dcreate2(fid, F66_DATASETU16, H5T_STD_U16LE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - valu16bits = (uint16_t) ~0u; /* all 1s */ + valu16bits = (uint16_t) ~0u; /* all 1s */ for(i = 0; i < dims[0]; i++){ - dsetu16[i][0] = valu16bits; - for(j = 1; j < dims[1]; j++) { + dsetu16[i][0] = valu16bits; + for(j = 1; j < dims[1]; j++) { dsetu16[i][j] = dsetu16[i][j-1] << 1; - } - valu16bits <<= 1; + } + valu16bits <<= 1; } H5Dwrite(dataset, H5T_NATIVE_UINT16, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetu16); @@ -7062,13 +7107,13 @@ gent_packedbits(void) space = H5Screate_simple(2, dims, NULL); dataset = H5Dcreate2(fid, F66_DATASETU32, H5T_STD_U32LE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - valu32bits = (uint32_t) ~0u; /* all 1s */ + valu32bits = (uint32_t) ~0u; /* all 1s */ for(i = 0; i < dims[0]; i++){ - dsetu32[i][0] = valu32bits; - for(j = 1; j < dims[1]; j++) { + dsetu32[i][0] = valu32bits; + for(j = 1; j < dims[1]; j++) { dsetu32[i][j] = dsetu32[i][j-1] << 1; - } - valu32bits <<= 1; + } + valu32bits <<= 1; } H5Dwrite(dataset, H5T_NATIVE_UINT32, H5S_ALL, H5S_ALL, H5P_DEFAULT, dsetu32); @@ -7098,13 +7143,13 @@ gent_packedbits(void) space = H5Screate_simple(2, dims, NULL); dataset = H5Dcreate2(fid, F66_DATASETS08, H5T_STD_I8LE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - val8bits = (int8_t) ~0; /* all 1s */ + val8bits = (int8_t) ~0; /* all 1s */ for(i = 0; i < dims[0]; i++){ - dset8[i][0] = val8bits; - for(j = 1; j < dims[1]; j++) { + dset8[i][0] = val8bits; + for(j = 1; j < dims[1]; j++) { dset8[i][j] = dset8[i][j-1] << 1; - } - val8bits <<= 1; + } + val8bits <<= 1; } H5Dwrite(dataset, H5T_NATIVE_INT8, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset8); @@ -7116,13 +7161,13 @@ gent_packedbits(void) space = H5Screate_simple(2, dims, NULL); dataset = H5Dcreate2(fid, F66_DATASETS16, H5T_STD_I16LE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - val16bits = (int16_t) ~0; /* all 1s */ + val16bits = (int16_t) ~0; /* all 1s */ for(i = 0; i < dims[0]; i++){ - dset16[i][0] = val16bits; - for(j = 1; j < dims[1]; j++) { + dset16[i][0] = val16bits; + for(j = 1; j < dims[1]; j++) { dset16[i][j] = dset16[i][j-1] << 1; - } - val16bits <<= 1; + } + val16bits <<= 1; } H5Dwrite(dataset, H5T_NATIVE_INT16, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset16); @@ -7134,13 +7179,13 @@ gent_packedbits(void) space = H5Screate_simple(2, dims, NULL); dataset = H5Dcreate2(fid, F66_DATASETS32, H5T_STD_I32LE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - val32bits = (int32_t) ~0; /* all 1s */ + val32bits = (int32_t) ~0; /* all 1s */ for(i = 0; i < dims[0]; i++){ - dset32[i][0] = val32bits; - for(j = 1; j < dims[1]; j++) { + dset32[i][0] = val32bits; + for(j = 1; j < dims[1]; j++) { dset32[i][j] = dset32[i][j-1] << 1; - } - val32bits <<= 1; + } + val32bits <<= 1; } H5Dwrite(dataset, H5T_NATIVE_INT32, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset32); @@ -7239,6 +7284,7 @@ int main(void) gent_compound_complex(); gent_named_dtype_attr(); gent_null_space(); + gent_zero_dim_size(); gent_filters(); gent_fvalues(); diff --git a/tools/h5dump/testh5dump.sh.in b/tools/h5dump/testh5dump.sh.in index f2f0fa5..771b5d5 100644 --- a/tools/h5dump/testh5dump.sh.in +++ b/tools/h5dump/testh5dump.sh.in @@ -29,7 +29,6 @@ EXIT_FAILURE=1 DUMPER=h5dump # The tool name DUMPER_BIN=`pwd`/$DUMPER # The path of the tool binary -TESTDIR=`pwd`/../testfiles H5DIFF=../h5diff/h5diff # The h5diff tool name H5DIFF_BIN=`pwd`/$H5DIFF # The path of the h5diff tool binary @@ -40,6 +39,7 @@ H5IMPORT_BIN=`pwd`/$H5IMPORT # The path of the h5import tool binary CMP='cmp -s' DIFF='diff -c' +CP='cp' nerrors=0 verbose=yes @@ -48,9 +48,420 @@ verbose=yes if test -z "$srcdir"; then srcdir=. fi - +# source dirs +SRC_TOOLS="$srcdir/../" + +SRC_TOOLS_TESTFILES="$SRC_TOOLS/testfiles" +# testfiles source dirs for tools +SRC_H5LS_TESTFILES="$SRC_TOOLS_TESTFILES" +SRC_H5DUMP_TESTFILES="$SRC_TOOLS_TESTFILES" +SRC_H5DIFF_TESTFILES="$SRC_TOOLS/h5diff/testfiles" +SRC_H5COPY_TESTFILES="$SRC_TOOLS/h5copy/testfiles" +SRC_H5REPACK_TESTFILES="$SRC_TOOLS/h5repack/testfiles" +SRC_H5JAM_TESTFILES="$SRC_TOOLS/h5jam/testfiles" +SRC_H5STAT_TESTFILES="$SRC_TOOLS/h5stat/testfiles" +SRC_H5IMPORT_TESTFILES="$SRC_TOOLS/h5import/testfiles" + +TESTDIR=./testfiles test -d $TESTDIR || mkdir $TESTDIR +###################################################################### +# test files +# -------------------------------------------------------------------- +# All the test files copy from source directory to test directory +# NOTE: Keep this framework to add/remove test files. +# Any test files from other tools can be used in this framework. +# This list are also used for checking exist. +# Comment '#' without space can be used. +# -------------------------------------------------------------------- +LIST_HDF5_TEST_FILES=" +$SRC_H5DUMP_TESTFILES/file_space.h5 +$SRC_H5DUMP_TESTFILES/filter_fail.h5 +$SRC_H5DUMP_TESTFILES/packedbits.h5 +$SRC_H5DUMP_TESTFILES/taindices.h5 +$SRC_H5DUMP_TESTFILES/tall.h5 +$SRC_H5DUMP_TESTFILES/tarray1.h5 +$SRC_H5DUMP_TESTFILES/tarray1_big.h5 +$SRC_H5DUMP_TESTFILES/tarray2.h5 +$SRC_H5DUMP_TESTFILES/tarray3.h5 +$SRC_H5DUMP_TESTFILES/tarray4.h5 +$SRC_H5DUMP_TESTFILES/tarray5.h5 +$SRC_H5DUMP_TESTFILES/tarray6.h5 +$SRC_H5DUMP_TESTFILES/tarray7.h5 +$SRC_H5DUMP_TESTFILES/tarray8.h5 +$SRC_H5DUMP_TESTFILES/tattr.h5 +$SRC_H5DUMP_TESTFILES/tattr2.h5 +$SRC_H5DUMP_TESTFILES/tattr4_be.h5 +$SRC_H5DUMP_TESTFILES/tattrreg.h5 +$SRC_H5DUMP_TESTFILES/tbigdims.h5 +$SRC_H5DUMP_TESTFILES/tbinary.h5 +$SRC_H5DUMP_TESTFILES/tchar.h5 +$SRC_H5DUMP_TESTFILES/tcompound.h5 +$SRC_H5DUMP_TESTFILES/tcompound_complex.h5 +$SRC_H5DUMP_TESTFILES/tdatareg.h5 +$SRC_H5DUMP_TESTFILES/tdset.h5 +$SRC_H5DUMP_TESTFILES/tempty.h5 +$SRC_H5DUMP_TESTFILES/tsoftlinks.h5 +$SRC_H5DUMP_TESTFILES/textlinkfar.h5 +$SRC_H5DUMP_TESTFILES/textlinksrc.h5 +$SRC_H5DUMP_TESTFILES/textlinktar.h5 +$SRC_H5DUMP_TESTFILES/textlink.h5 +$SRC_H5DUMP_TESTFILES/tfamily00000.h5 +$SRC_H5DUMP_TESTFILES/tfamily00001.h5 +$SRC_H5DUMP_TESTFILES/tfamily00002.h5 +$SRC_H5DUMP_TESTFILES/tfamily00003.h5 +$SRC_H5DUMP_TESTFILES/tfamily00004.h5 +$SRC_H5DUMP_TESTFILES/tfamily00005.h5 +$SRC_H5DUMP_TESTFILES/tfamily00006.h5 +$SRC_H5DUMP_TESTFILES/tfamily00007.h5 +$SRC_H5DUMP_TESTFILES/tfamily00008.h5 +$SRC_H5DUMP_TESTFILES/tfamily00009.h5 +$SRC_H5DUMP_TESTFILES/tfamily00010.h5 +$SRC_H5DUMP_TESTFILES/tfcontents1.h5 +$SRC_H5DUMP_TESTFILES/tfcontents2.h5 +$SRC_H5DUMP_TESTFILES/tfilters.h5 +$SRC_H5DUMP_TESTFILES/tfpformat.h5 +$SRC_H5DUMP_TESTFILES/tfvalues.h5 +$SRC_H5DUMP_TESTFILES/tgroup.h5 +$SRC_H5DUMP_TESTFILES/tgrp_comments.h5 +$SRC_H5DUMP_TESTFILES/thlink.h5 +$SRC_H5DUMP_TESTFILES/thyperslab.h5 +$SRC_H5DUMP_TESTFILES/tlarge_objname.h5 +#$SRC_H5DUMP_TESTFILES/tldouble.h5 +$SRC_H5DUMP_TESTFILES/tlonglinks.h5 +$SRC_H5DUMP_TESTFILES/tloop.h5 +$SRC_H5DUMP_TESTFILES/tmulti-b.h5 +$SRC_H5DUMP_TESTFILES/tmulti-g.h5 +$SRC_H5DUMP_TESTFILES/tmulti-l.h5 +$SRC_H5DUMP_TESTFILES/tmulti-o.h5 +$SRC_H5DUMP_TESTFILES/tmulti-r.h5 +$SRC_H5DUMP_TESTFILES/tmulti-s.h5 +$SRC_H5DUMP_TESTFILES/tnamed_dtype_attr.h5 +$SRC_H5DUMP_TESTFILES/tnestedcomp.h5 +$SRC_H5DUMP_TESTFILES/tno-subset.h5 +$SRC_H5DUMP_TESTFILES/tnullspace.h5 +$SRC_H5DUMP_TESTFILES/zerodim.h5 +$SRC_H5DUMP_TESTFILES/torderattr.h5 +$SRC_H5DUMP_TESTFILES/tordergr.h5 +$SRC_H5DUMP_TESTFILES/tsaf.h5 +$SRC_H5DUMP_TESTFILES/tslink.h5 +$SRC_H5DUMP_TESTFILES/tsplit_file-m.h5 +$SRC_H5DUMP_TESTFILES/tsplit_file-r.h5 +$SRC_H5DUMP_TESTFILES/tstr.h5 +$SRC_H5DUMP_TESTFILES/tstr2.h5 +$SRC_H5DUMP_TESTFILES/tstr3.h5 +$SRC_H5DUMP_TESTFILES/tudlink.h5 +$SRC_H5DUMP_TESTFILES/tvldtypes1.h5 +$SRC_H5DUMP_TESTFILES/tvldtypes2.h5 +$SRC_H5DUMP_TESTFILES/tvldtypes3.h5 +$SRC_H5DUMP_TESTFILES/tvldtypes4.h5 +$SRC_H5DUMP_TESTFILES/tvldtypes5.h5 +$SRC_H5DUMP_TESTFILES/tvlstr.h5 +$SRC_H5DUMP_TESTFILES/tvms.h5 +" + +LIST_OTHER_TEST_FILES=" +$SRC_H5DUMP_TESTFILES/file_space.ddl +$SRC_H5DUMP_TESTFILES/filter_fail.ddl +$SRC_H5DUMP_TESTFILES/packedbits.ddl +$SRC_H5DUMP_TESTFILES/tall-1.ddl +$SRC_H5DUMP_TESTFILES/tall-2.ddl +$SRC_H5DUMP_TESTFILES/tall-2A.ddl +$SRC_H5DUMP_TESTFILES/tall-2B.ddl +$SRC_H5DUMP_TESTFILES/tall-3.ddl +$SRC_H5DUMP_TESTFILES/tall-4s.ddl +$SRC_H5DUMP_TESTFILES/tall-5s.ddl +$SRC_H5DUMP_TESTFILES/tall-6.ddl +$SRC_H5DUMP_TESTFILES/tallfilters.ddl +$SRC_H5DUMP_TESTFILES/tarray1.ddl +$SRC_H5DUMP_TESTFILES/tarray1_big.ddl +$SRC_H5DUMP_TESTFILES/tarray2.ddl +$SRC_H5DUMP_TESTFILES/tarray3.ddl +$SRC_H5DUMP_TESTFILES/tarray4.ddl +$SRC_H5DUMP_TESTFILES/tarray5.ddl +$SRC_H5DUMP_TESTFILES/tarray6.ddl +$SRC_H5DUMP_TESTFILES/tarray7.ddl +$SRC_H5DUMP_TESTFILES/tarray8.ddl +$SRC_H5DUMP_TESTFILES/tattr-1.ddl +$SRC_H5DUMP_TESTFILES/tattr-2.ddl +$SRC_H5DUMP_TESTFILES/tattr-3.ddl +$SRC_H5DUMP_TESTFILES/tattr-4_be.ddl +$SRC_H5DUMP_TESTFILES/tattrreg.ddl +$SRC_H5DUMP_TESTFILES/tattrregR.ddl +$SRC_H5DUMP_TESTFILES/tbin1.ddl +$SRC_H5DUMP_TESTFILES/tbin1.ddl +$SRC_H5DUMP_TESTFILES/tbin2.ddl +$SRC_H5DUMP_TESTFILES/tbin3.ddl +$SRC_H5DUMP_TESTFILES/tbin4.ddl +$SRC_H5DUMP_TESTFILES/tbinregR.ddl +$SRC_H5DUMP_TESTFILES/tbigdims.ddl +$SRC_H5DUMP_TESTFILES/tboot1.ddl +$SRC_H5DUMP_TESTFILES/tboot2.ddl +$SRC_H5DUMP_TESTFILES/tchar1.ddl +$SRC_H5DUMP_TESTFILES/tchunked.ddl +$SRC_H5DUMP_TESTFILES/tcomp-1.ddl +$SRC_H5DUMP_TESTFILES/tcomp-2.ddl +$SRC_H5DUMP_TESTFILES/tcomp-3.ddl +$SRC_H5DUMP_TESTFILES/tcomp-4.ddl +$SRC_H5DUMP_TESTFILES/tcompact.ddl +$SRC_H5DUMP_TESTFILES/tcontents.ddl +$SRC_H5DUMP_TESTFILES/tcontiguos.ddl +$SRC_H5DUMP_TESTFILES/tdatareg.ddl +$SRC_H5DUMP_TESTFILES/tdataregR.ddl +$SRC_H5DUMP_TESTFILES/tdeflate.ddl +$SRC_H5DUMP_TESTFILES/tdset-1.ddl +$SRC_H5DUMP_TESTFILES/tdset-2.ddl +$SRC_H5DUMP_TESTFILES/tdset-3s.ddl +$SRC_H5DUMP_TESTFILES/tempty.ddl +$SRC_H5DUMP_TESTFILES/texceedsubstart.ddl +$SRC_H5DUMP_TESTFILES/texceedsubcount.ddl +$SRC_H5DUMP_TESTFILES/texceedsubstride.ddl +$SRC_H5DUMP_TESTFILES/texceedsubblock.ddl +$SRC_H5DUMP_TESTFILES/texternal.ddl +$SRC_H5DUMP_TESTFILES/textlinksrc.ddl +$SRC_H5DUMP_TESTFILES/textlinkfar.ddl +$SRC_H5DUMP_TESTFILES/textlink.ddl +$SRC_H5DUMP_TESTFILES/tfamily.ddl +$SRC_H5DUMP_TESTFILES/tfill.ddl +$SRC_H5DUMP_TESTFILES/tfletcher32.ddl +$SRC_H5DUMP_TESTFILES/tfpformat.ddl +$SRC_H5DUMP_TESTFILES/tgroup-1.ddl +$SRC_H5DUMP_TESTFILES/tgroup-2.ddl +$SRC_H5DUMP_TESTFILES/tgrp_comments.ddl +$SRC_H5DUMP_TESTFILES/thlink-1.ddl +$SRC_H5DUMP_TESTFILES/thlink-2.ddl +$SRC_H5DUMP_TESTFILES/thlink-3.ddl +$SRC_H5DUMP_TESTFILES/thlink-4.ddl +$SRC_H5DUMP_TESTFILES/thlink-5.ddl +$SRC_H5DUMP_TESTFILES/thyperslab.ddl +$SRC_H5DUMP_TESTFILES/tindicesno.ddl +$SRC_H5DUMP_TESTFILES/tindicessub1.ddl +$SRC_H5DUMP_TESTFILES/tindicessub2.ddl +$SRC_H5DUMP_TESTFILES/tindicessub3.ddl +$SRC_H5DUMP_TESTFILES/tindicessub4.ddl +$SRC_H5DUMP_TESTFILES/tindicesyes.ddl +$SRC_H5DUMP_TESTFILES/tlarge_objname.ddl +#$SRC_H5DUMP_TESTFILES/tldouble.ddl +$SRC_H5DUMP_TESTFILES/tlonglinks.ddl +$SRC_H5DUMP_TESTFILES/tloop-1.ddl +$SRC_H5DUMP_TESTFILES/tmulti.ddl +$SRC_H5DUMP_TESTFILES/tmultifile.ddl +$SRC_H5DUMP_TESTFILES/tqmarkfile.ddl +$SRC_H5DUMP_TESTFILES/tstarfile.ddl +$SRC_H5DUMP_TESTFILES/tnamed_dtype_attr.ddl +$SRC_H5DUMP_TESTFILES/tnestcomp-1.ddl +$SRC_H5DUMP_TESTFILES/tnbit.ddl +$SRC_H5DUMP_TESTFILES/tno-subset.ddl +$SRC_H5DUMP_TESTFILES/tnullspace.ddl +$SRC_H5DUMP_TESTFILES/zerodim.ddl +$SRC_H5DUMP_TESTFILES/tordergr1.ddl +$SRC_H5DUMP_TESTFILES/tordergr2.ddl +$SRC_H5DUMP_TESTFILES/tordergr3.ddl +$SRC_H5DUMP_TESTFILES/tordergr4.ddl +$SRC_H5DUMP_TESTFILES/tordergr5.ddl +$SRC_H5DUMP_TESTFILES/torderattr1.ddl +$SRC_H5DUMP_TESTFILES/torderattr2.ddl +$SRC_H5DUMP_TESTFILES/torderattr3.ddl +$SRC_H5DUMP_TESTFILES/torderattr4.ddl +$SRC_H5DUMP_TESTFILES/tperror.ddl +$SRC_H5DUMP_TESTFILES/treference.ddl +$SRC_H5DUMP_TESTFILES/tsaf.ddl +$SRC_H5DUMP_TESTFILES/tscaleoffset.ddl +$SRC_H5DUMP_TESTFILES/tshuffle.ddl +$SRC_H5DUMP_TESTFILES/tslink-1.ddl +$SRC_H5DUMP_TESTFILES/tslink-2.ddl +$SRC_H5DUMP_TESTFILES/tslink-D.ddl +$SRC_H5DUMP_TESTFILES/tsplit_file.ddl +$SRC_H5DUMP_TESTFILES/tstr-1.ddl +$SRC_H5DUMP_TESTFILES/tstr-2.ddl +$SRC_H5DUMP_TESTFILES/tstring.ddl +$SRC_H5DUMP_TESTFILES/tstring2.ddl +$SRC_H5DUMP_TESTFILES/tstringe.ddl +$SRC_H5DUMP_TESTFILES/tszip.ddl +$SRC_H5DUMP_TESTFILES/tudlink-1.ddl +$SRC_H5DUMP_TESTFILES/tudlink-2.ddl +$SRC_H5DUMP_TESTFILES/tuserfilter.ddl +$SRC_H5DUMP_TESTFILES/tvldtypes1.ddl +$SRC_H5DUMP_TESTFILES/tvldtypes2.ddl +$SRC_H5DUMP_TESTFILES/tvldtypes3.ddl +$SRC_H5DUMP_TESTFILES/tvldtypes4.ddl +$SRC_H5DUMP_TESTFILES/tvldtypes5.ddl +$SRC_H5DUMP_TESTFILES/tvlstr.ddl +$SRC_H5DUMP_TESTFILES/tvms.ddl +$SRC_H5DUMP_TESTFILES/h5dump-help.txt +$SRC_H5DUMP_TESTFILES/out3.h5import +$SRC_H5DUMP_TESTFILES/tnofilename-with-packed-bits.ddl +$SRC_H5DUMP_TESTFILES/tpbitsArray.ddl +$SRC_H5DUMP_TESTFILES/tpbitsCompound.ddl +$SRC_H5DUMP_TESTFILES/tpbitsIncomplete.ddl +$SRC_H5DUMP_TESTFILES/tpbitsLengthExceeded.ddl +$SRC_H5DUMP_TESTFILES/tpbitsCharLengthExceeded.ddl +$SRC_H5DUMP_TESTFILES/tpbitsIntLengthExceeded.ddl +$SRC_H5DUMP_TESTFILES/tpbitsLongLengthExceeded.ddl +$SRC_H5DUMP_TESTFILES/tpbitsLengthPositive.ddl +$SRC_H5DUMP_TESTFILES/tpbitsMax.ddl +$SRC_H5DUMP_TESTFILES/tpbitsMaxExceeded.ddl +$SRC_H5DUMP_TESTFILES/tpbitsOffsetExceeded.ddl +$SRC_H5DUMP_TESTFILES/tpbitsCharOffsetExceeded.ddl +$SRC_H5DUMP_TESTFILES/tpbitsIntOffsetExceeded.ddl +$SRC_H5DUMP_TESTFILES/tpbitsLongOffsetExceeded.ddl +$SRC_H5DUMP_TESTFILES/tpbitsOffsetNegative.ddl +$SRC_H5DUMP_TESTFILES/tpbitsOverlapped.ddl +$SRC_H5DUMP_TESTFILES/tpbitsSigned.ddl +$SRC_H5DUMP_TESTFILES/tpbitsUnsigned.ddl +$SRC_H5DUMP_TESTFILES/tpbitsSignedInt.ddl +$SRC_H5DUMP_TESTFILES/tpbitsUnsignedInt.ddl +$SRC_H5DUMP_TESTFILES/tpbitsSignedLong.ddl +$SRC_H5DUMP_TESTFILES/tpbitsUnsignedLong.ddl +$SRC_H5DUMP_TESTFILES/tpbitsSignedLongLong.ddl +$SRC_H5DUMP_TESTFILES/tpbitsUnsignedLongLong.ddl +$SRC_H5DUMP_TESTFILES/tpbitsSignedWhole.ddl +$SRC_H5DUMP_TESTFILES/tpbitsUnsignedWhole.ddl +$SRC_H5DUMP_TESTFILES/tpbitsSignedIntWhole.ddl +$SRC_H5DUMP_TESTFILES/tpbitsUnsignedIntWhole.ddl +$SRC_H5DUMP_TESTFILES/tpbitsSignedLongWhole.ddl +$SRC_H5DUMP_TESTFILES/tpbitsUnsignedLongWhole.ddl +$SRC_H5DUMP_TESTFILES/tpbitsSignedLongLongWhole.ddl +$SRC_H5DUMP_TESTFILES/tpbitsUnsignedLongLongWhole.ddl +$SRC_H5DUMP_TESTFILES/tpbitsSignedLongLongWhole1.ddl +$SRC_H5DUMP_TESTFILES/tpbitsUnsignedLongLongWhole1.ddl +$SRC_H5DUMP_TESTFILES/tpbitsSignedLongLongWhole63.ddl +$SRC_H5DUMP_TESTFILES/tpbitsUnsignedLongLongWhole63.ddl +$SRC_H5DUMP_TESTFILES/tpbitsSigned4.ddl +$SRC_H5DUMP_TESTFILES/tpbitsUnsigned4.ddl +$SRC_H5DUMP_TESTFILES/tpbitsSignedInt8.ddl +$SRC_H5DUMP_TESTFILES/tpbitsUnsignedInt8.ddl +$SRC_H5DUMP_TESTFILES/tpbitsSignedLong16.ddl +$SRC_H5DUMP_TESTFILES/tpbitsUnsignedLong16.ddl +$SRC_H5DUMP_TESTFILES/tpbitsSignedLongLong32.ddl +$SRC_H5DUMP_TESTFILES/tpbitsUnsignedLongLong32.ddl +$SRC_H5DUMP_TESTFILES/tpbitsSigned2.ddl +$SRC_H5DUMP_TESTFILES/tpbitsUnsigned2.ddl +$SRC_H5DUMP_TESTFILES/tpbitsSignedInt4.ddl +$SRC_H5DUMP_TESTFILES/tpbitsUnsignedInt4.ddl +$SRC_H5DUMP_TESTFILES/tpbitsSignedLong8.ddl +$SRC_H5DUMP_TESTFILES/tpbitsUnsignedLong8.ddl +$SRC_H5DUMP_TESTFILES/tpbitsSignedLongLong16.ddl +$SRC_H5DUMP_TESTFILES/tpbitsUnsignedLongLong16.ddl +$SRC_H5DUMP_TESTFILES/tbinregR.exp +" + +LIST_HDF5_TEST_FILES_XML=" +$SRC_H5DUMP_TESTFILES/tbitfields.h5 +$SRC_H5DUMP_TESTFILES/tcompound2.h5 +$SRC_H5DUMP_TESTFILES/tdset2.h5 +$SRC_H5DUMP_TESTFILES/tenum.h5 +$SRC_H5DUMP_TESTFILES/textlink.h5 +$SRC_H5DUMP_TESTFILES/tloop2.h5 +$SRC_H5DUMP_TESTFILES/tmany.h5 +$SRC_H5DUMP_TESTFILES/tname-amp.h5 +$SRC_H5DUMP_TESTFILES/tname-apos.h5 +$SRC_H5DUMP_TESTFILES/tname-gt.h5 +$SRC_H5DUMP_TESTFILES/tname-lt.h5 +$SRC_H5DUMP_TESTFILES/tname-quot.h5 +$SRC_H5DUMP_TESTFILES/tname-sp.h5 +$SRC_H5DUMP_TESTFILES/tnodata.h5 +$SRC_H5DUMP_TESTFILES/tobjref.h5 +$SRC_H5DUMP_TESTFILES/topaque.h5 +$SRC_H5DUMP_TESTFILES/tref.h5 +$SRC_H5DUMP_TESTFILES/tref-escapes.h5 +$SRC_H5DUMP_TESTFILES/tref-escapes-at.h5 +$SRC_H5DUMP_TESTFILES/tstring.h5 +$SRC_H5DUMP_TESTFILES/tstring-at.h5 +" + +LIST_OTHER_TEST_FILES_XML=" +$SRC_H5DUMP_TESTFILES/tall.h5.xml +$SRC_H5DUMP_TESTFILES/tall-2A.h5.xml +$SRC_H5DUMP_TESTFILES/tarray1.h5.xml +$SRC_H5DUMP_TESTFILES/tarray2.h5.xml +$SRC_H5DUMP_TESTFILES/tarray3.h5.xml +$SRC_H5DUMP_TESTFILES/tarray6.h5.xml +$SRC_H5DUMP_TESTFILES/tarray7.h5.xml +$SRC_H5DUMP_TESTFILES/tattr.h5.xml +$SRC_H5DUMP_TESTFILES/tbitfields.h5.xml +$SRC_H5DUMP_TESTFILES/tcompound_complex.h5.xml +$SRC_H5DUMP_TESTFILES/tcompound.h5.xml +$SRC_H5DUMP_TESTFILES/tcompound2.h5.xml +$SRC_H5DUMP_TESTFILES/tdatareg.h5.xml +$SRC_H5DUMP_TESTFILES/tdset.h5.xml +$SRC_H5DUMP_TESTFILES/tdset2.h5.xml +$SRC_H5DUMP_TESTFILES/tempty.h5.xml +$SRC_H5DUMP_TESTFILES/tempty-dtd.h5.xml +$SRC_H5DUMP_TESTFILES/tempty-dtd-2.h5.xml +$SRC_H5DUMP_TESTFILES/tempty-dtd-uri.h5.xml +$SRC_H5DUMP_TESTFILES/tempty-nons.h5.xml +$SRC_H5DUMP_TESTFILES/tempty-nons-2.h5.xml +$SRC_H5DUMP_TESTFILES/tempty-nons-uri.h5.xml +$SRC_H5DUMP_TESTFILES/tempty-ns.h5.xml +$SRC_H5DUMP_TESTFILES/tempty-ns-2.h5.xml +$SRC_H5DUMP_TESTFILES/tenum.h5.xml +$SRC_H5DUMP_TESTFILES/textlink.h5.xml +$SRC_H5DUMP_TESTFILES/tfpformat.h5.xml +$SRC_H5DUMP_TESTFILES/tgroup.h5.xml +$SRC_H5DUMP_TESTFILES/thlink.h5.xml +$SRC_H5DUMP_TESTFILES/tloop.h5.xml +$SRC_H5DUMP_TESTFILES/tloop2.h5.xml +$SRC_H5DUMP_TESTFILES/tmany.h5.xml +$SRC_H5DUMP_TESTFILES/tname-amp.h5.xml +$SRC_H5DUMP_TESTFILES/tname-apos.h5.xml +$SRC_H5DUMP_TESTFILES/tnamed_dtype_attr.h5.xml +$SRC_H5DUMP_TESTFILES/tname-gt.h5.xml +$SRC_H5DUMP_TESTFILES/tname-lt.h5.xml +$SRC_H5DUMP_TESTFILES/tname-quot.h5.xml +$SRC_H5DUMP_TESTFILES/tname-sp.h5.xml +$SRC_H5DUMP_TESTFILES/tnestedcomp.h5.xml +$SRC_H5DUMP_TESTFILES/tnodata.h5.xml +$SRC_H5DUMP_TESTFILES/tobjref.h5.xml +$SRC_H5DUMP_TESTFILES/topaque.h5.xml +$SRC_H5DUMP_TESTFILES/torderattr1.h5.xml +$SRC_H5DUMP_TESTFILES/torderattr2.h5.xml +$SRC_H5DUMP_TESTFILES/torderattr3.h5.xml +$SRC_H5DUMP_TESTFILES/torderattr4.h5.xml +$SRC_H5DUMP_TESTFILES/tref.h5.xml +$SRC_H5DUMP_TESTFILES/tref-escapes.h5.xml +$SRC_H5DUMP_TESTFILES/tref-escapes-at.h5.xml +$SRC_H5DUMP_TESTFILES/tsaf.h5.xml +$SRC_H5DUMP_TESTFILES/tslink.h5.xml +$SRC_H5DUMP_TESTFILES/tstr.h5.xml +$SRC_H5DUMP_TESTFILES/tstr2.h5.xml +$SRC_H5DUMP_TESTFILES/tstring.h5.xml +$SRC_H5DUMP_TESTFILES/tstring-at.h5.xml +$SRC_H5DUMP_TESTFILES/tudlink.h5.xml +$SRC_H5DUMP_TESTFILES/tvldtypes1.h5.xml +$SRC_H5DUMP_TESTFILES/tvldtypes2.h5.xml +$SRC_H5DUMP_TESTFILES/tvldtypes3.h5.xml +$SRC_H5DUMP_TESTFILES/tvldtypes4.h5.xml +$SRC_H5DUMP_TESTFILES/tvldtypes5.h5.xml +$SRC_H5DUMP_TESTFILES/tvlstr.h5.xml +" + +# +# copy test files and expected output files from source dirs to test dir +# +COPY_TESTFILES="$LIST_HDF5_TEST_FILES $LIST_OTHER_TEST_FILES $LIST_HDF5_TEST_FILES_XML $LIST_OTHER_TEST_FILES_XML" + +COPY_TESTFILES_TO_TESTDIR() +{ + # copy test files. Used -f to make sure get a new copy + for tstfile in $COPY_TESTFILES + do + # ignore '#' comment + echo $tstfile | tr -d ' ' | grep '^#' > /dev/null + RET=$? + if [ $RET -eq 1 ]; then + if [ -a $tstfile ]; then + $CP -f $tstfile $TESTDIR + else + echo "Error: FAILED to copy $tstfile" + echo " $tstfile doesn't exist!" + exit $EXIT_FAILURE + fi + fi + done +} + + # Print a line-line message left justified in a field of 70 characters # beginning with the word "Testing". # @@ -59,6 +470,9 @@ TESTING() { echo "Testing $* $SPACES" | cut -c1-70 | tr -d '\012' } +# Source in the output filter function definitions. +. $srcdir/../../bin/output_filter.sh + # Run a test and print PASS or *FAIL*. If a test fails then increment # the `nerrors' global variable and (if $verbose is set) display the # difference between the actual output and the expected output. The @@ -68,62 +482,28 @@ TESTING() { # non-zero value. # TOOLTEST() { - expect="$srcdir/../testfiles/$1" - actual="../testfiles/`basename $1 .ddl`.out" - actual_err="../testfiles/`basename $1 .ddl`.err" + expect="$TESTDIR/$1" + actual="$TESTDIR/`basename $1 .ddl`.out" + actual_err="$TESTDIR/`basename $1 .ddl`.err" + actual_sav=${actual}-sav + actual_err_sav=${actual_err}-sav shift # Run test. TESTING $DUMPER $@ ( - echo "#############################" - echo "Expected output for '$DUMPER $@'" - echo "#############################" - cd $srcdir/../testfiles - $RUNSERIAL $DUMPER_BIN $@ + cd $TESTDIR + $RUNSERIAL $DUMPER_BIN "$@" ) >$actual 2>$actual_err - cat $actual_err >> $actual - - if [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. - echo " CREATED" - cp $actual $expect - elif $CMP $expect $actual; then - echo " PASSED" - else - echo "*FAILED*" - echo " Expected result (*.ddl) differs from actual result (*.out)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' - fi - - # Clean up output file - if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err - fi - -} - - -# same as TOOLTEST but does not print the header Expected output -# used for the binary tests that expect a full path in -o -TOOLTEST1() { - - expect="$srcdir/../testfiles/$1" - actual="../testfiles/`basename $1 .ddl`.out" - actual_err="../testfiles/`basename $1 .ddl`.err" - shift - # Run test. - TESTING $DUMPER $@ - ( - - cd $srcdir/../testfiles - $RUNSERIAL $DUMPER_BIN $@ - ) >$actual 2>$actual_err + # save actual and actual_err in case they are needed later. + cp $actual $actual_sav + STDOUT_FILTER $actual + cp $actual_err $actual_err_sav + STDERR_FILTER $actual_err cat $actual_err >> $actual - if [ ! -f $expect ]; then + if [ ! -f $expect ]; then # Create the expect file if it doesn't yet exist. echo " CREATED" cp $actual $expect @@ -132,35 +512,35 @@ TOOLTEST1() { else echo "*FAILED*" echo " Expected result (*.ddl) differs from actual result (*.out)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err + rm -f $actual $actual_err $actual_sav $actual_err_sav $actual_ext fi } + # same as TOOLTEST1 but compares generated file to expected output # and compares the generated data file to the expected data file # used for the binary tests that expect a full path in -o without -b TOOLTEST2() { - expectdata="$srcdir/../testfiles/$1" - expect="$srcdir/../testfiles/`basename $1 .exp`.ddl" - actualdata="../testfiles/`basename $1 .exp`.txt" - actual="../testfiles/`basename $1 .exp`.out" - actual_err="../testfiles/`basename $1 .exp`.err" + expectdata="$TESTDIR/$1" + expect="$TESTDIR/`basename $1 .exp`.ddl" + actualdata="$TESTDIR/`basename $1 .exp`.txt" + actual="$TESTDIR/`basename $1 .exp`.out" + actual_err="$TESTDIR/`basename $1 .exp`.err" shift # Run test. TESTING $DUMPER $@ ( - - cd $srcdir/../testfiles - $RUNSERIAL $DUMPER_BIN $@ + cd $TESTDIR + $RUNSERIAL $DUMPER_BIN "$@" ) >$actual 2>$actual_err cat $actual_err >> $actual @@ -199,22 +579,27 @@ TOOLTEST2() { # Extract file name, line number, version and thread IDs because they may be different TOOLTEST3() { - expect="$srcdir/../testfiles/$1" - actual="../testfiles/`basename $1 .ddl`.out" - actual_err="../testfiles/`basename $1 .ddl`.err" - actual_ext="../testfiles/`basename $1 .ddl`.ext" + expect="$TESTDIR/$1" + actual="$TESTDIR/`basename $1 .ddl`.out" + actual_err="$TESTDIR/`basename $1 .ddl`.err" + actual_ext="$TESTDIR/`basename $1 .ddl`.ext" + actual_sav=${actual}-sav + actual_err_sav=${actual_err}-sav shift # Run test. TESTING $DUMPER $@ ( - echo "#############################" - echo "Expected output for '$DUMPER $@'" - echo "#############################" - cd $srcdir/../testfiles - $RUNSERIAL $DUMPER_BIN $@ + cd $TESTDIR + $RUNSERIAL $DUMPER_BIN "$@" ) >$actual 2>$actual_err + # save actual and actual_err in case they are needed later. + cp $actual $actual_sav + STDOUT_FILTER $actual + cp $actual_err $actual_err_sav + STDERR_FILTER $actual_err + # Extract file name, line number, version and thread IDs because they may be different sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \ -e 's/line [0-9]*/line (number)/' \ @@ -240,15 +625,15 @@ TOOLTEST3() { # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err + rm -f $actual $actual_err $actual_sav $actual_err_sav fi } # Print a "SKIP" message SKIP() { - TESTING $DUMPER $@ - echo " -SKIP-" + TESTING $DUMPER $@ + echo " -SKIP-" } # Print a line-line message left justified in a field of 70 characters @@ -265,8 +650,8 @@ DIFFTEST() { PRINT_H5DIFF $@ ( - cd $srcdir/../testfiles - $RUNSERIAL $H5DIFF_BIN "$@" -q + cd $TESTDIR + $RUNSERIAL $H5DIFF_BIN "$@" -q ) RET=$? if [ $RET != 0 ] ; then @@ -291,15 +676,15 @@ PRINT_H5IMPORT() { IMPORTTEST() { # remove the output hdf5 file if it exists - hdf5_file="$srcdir/../testfiles/$5" + hdf5_file="$TESTDIR/$5" if [ -f $hdf5_file ]; then rm -f $hdf5_file fi PRINT_H5IMPORT $@ ( - cd $srcdir/../testfiles - $RUNSERIAL $H5IMPORT_BIN "$@" + cd $TESTDIR + $RUNSERIAL $H5IMPORT_BIN "$@" ) RET=$? if [ $RET != 0 ] ; then @@ -314,326 +699,430 @@ IMPORTTEST() ############################################################################## ############################################################################## -### T H E T E S T S ### +### T H E T E S T S ### ############################################################################## ############################################################################## +# prepare for test +COPY_TESTFILES_TO_TESTDIR + +#TOOLTEST h5dump-help.txt -h # test for signed/unsigned datasets -TOOLTEST packedbits.ddl packedbits.h5 +TOOLTEST packedbits.ddl --enable-error-stack packedbits.h5 # test for displaying groups -TOOLTEST tgroup-1.ddl tgroup.h5 +TOOLTEST tgroup-1.ddl --enable-error-stack tgroup.h5 # test for displaying the selected groups TOOLTEST tgroup-2.ddl --group=/g2 --group / -g /y tgroup.h5 # test for displaying simple space datasets -TOOLTEST tdset-1.ddl tdset.h5 +TOOLTEST tdset-1.ddl --enable-error-stack tdset.h5 # test for displaying selected datasets -TOOLTEST tdset-2.ddl -H -d dset1 -d /dset2 --dataset=dset3 tdset.h5 +TOOLTEST3 tdset-2.ddl --enable-error-stack -H -d dset1 -d /dset2 --dataset=dset3 tdset.h5 # test for displaying attributes -TOOLTEST tattr-1.ddl tattr.h5 +TOOLTEST tattr-1.ddl --enable-error-stack tattr.h5 # test for displaying the selected attributes of string type and scalar space -TOOLTEST tattr-2.ddl -a /attr1 --attribute /attr4 --attribute=/attr5 tattr.h5 +TOOLTEST tattr-2.ddl --enable-error-stack -a "/\/attr1" --attribute /attr4 --attribute=/attr5 tattr.h5 # test for header and error messages -TOOLTEST tattr-3.ddl --header -a /attr2 --attribute=/attr tattr.h5 +TOOLTEST3 tattr-3.ddl --enable-error-stack --header -a /attr2 --attribute=/attr tattr.h5 +# test for displaying at least 9 attributes on root from a BE machine +TOOLTEST tattr-4_be.ddl --enable-error-stack tattr4_be.h5 # test for displaying attributes in shared datatype (also in group and dataset) -TOOLTEST tnamed_dtype_attr.ddl tnamed_dtype_attr.h5 +TOOLTEST tnamed_dtype_attr.ddl --enable-error-stack tnamed_dtype_attr.h5 # test for displaying soft links and user-defined links -TOOLTEST tslink-1.ddl tslink.h5 -TOOLTEST tudlink-1.ddl tudlink.h5 +TOOLTEST tslink-1.ddl --enable-error-stack tslink.h5 +TOOLTEST tudlink-1.ddl --enable-error-stack tudlink.h5 # test for displaying the selected link -TOOLTEST tslink-2.ddl -l slink2 tslink.h5 -TOOLTEST tudlink-2.ddl -l udlink2 tudlink.h5 +TOOLTEST tslink-2.ddl --enable-error-stack -l slink2 tslink.h5 +TOOLTEST tudlink-2.ddl --enable-error-stack -l udlink2 tudlink.h5 +# test for displaying dangling soft links +TOOLTEST3 tslink-D.ddl --enable-error-stack -d /slink1 tslink.h5 # tests for hard links -TOOLTEST thlink-1.ddl thlink.h5 -TOOLTEST thlink-2.ddl -d /g1/dset2 --dataset /dset1 --dataset=/g1/g1.1/dset3 thlink.h5 -TOOLTEST thlink-3.ddl -d /g1/g1.1/dset3 --dataset /g1/dset2 --dataset=/dset1 thlink.h5 -TOOLTEST thlink-4.ddl -g /g1 thlink.h5 -TOOLTEST thlink-5.ddl -d /dset1 -g /g2 -d /g1/dset2 thlink.h5 +TOOLTEST thlink-1.ddl --enable-error-stack thlink.h5 +TOOLTEST thlink-2.ddl --enable-error-stack -d /g1/dset2 --dataset /dset1 --dataset=/g1/g1.1/dset3 thlink.h5 +TOOLTEST thlink-3.ddl --enable-error-stack -d /g1/g1.1/dset3 --dataset /g1/dset2 --dataset=/dset1 thlink.h5 +TOOLTEST thlink-4.ddl --enable-error-stack -g /g1 thlink.h5 +TOOLTEST thlink-5.ddl --enable-error-stack -d /dset1 -g /g2 -d /g1/dset2 thlink.h5 # tests for compound data types -TOOLTEST tcomp-1.ddl tcompound.h5 +TOOLTEST tcomp-1.ddl --enable-error-stack tcompound.h5 # test for named data types -TOOLTEST tcomp-2.ddl -t /type1 --datatype /type2 --datatype=/group1/type3 tcompound.h5 +TOOLTEST tcomp-2.ddl --enable-error-stack -t /type1 --datatype /type2 --datatype=/group1/type3 tcompound.h5 # test for unamed type +# JIRA HDFFV-7936 TOOLTEST tcomp-3.ddl --enable-error-stack -t /#6632 -g /group2 tcompound.h5 TOOLTEST tcomp-3.ddl -t /#6632 -g /group2 tcompound.h5 # test complicated compound datatype -TOOLTEST tcomp-4.ddl tcompound_complex.h5 +TOOLTEST tcomp-4.ddl --enable-error-stack tcompound_complex.h5 #test for the nested compound type -TOOLTEST tnestcomp-1.ddl tnestedcomp.h5 +TOOLTEST tnestcomp-1.ddl --enable-error-stack tnestedcomp.h5 # test for options +# JIRA HDFFV-7936 TOOLTEST tall-1.ddl --enable-error-stack tall.h5 TOOLTEST tall-1.ddl tall.h5 -TOOLTEST tall-2.ddl --header -g /g1/g1.1 -a attr2 tall.h5 -TOOLTEST tall-3.ddl -d /g2/dset2.1 -l /g1/g1.2/g1.2.1/slink tall.h5 +TOOLTEST tall-2.ddl --enable-error-stack --header -g /g1/g1.1 -a attr2 tall.h5 +TOOLTEST tall-3.ddl --enable-error-stack -d /g2/dset2.1 -l /g1/g1.2/g1.2.1/slink tall.h5 # test for loop detection -TOOLTEST tloop-1.ddl tloop.h5 +TOOLTEST tloop-1.ddl --enable-error-stack tloop.h5 # test for string -TOOLTEST tstr-1.ddl tstr.h5 -TOOLTEST tstr-2.ddl tstr2.h5 +TOOLTEST tstr-1.ddl --enable-error-stack tstr.h5 +TOOLTEST tstr-2.ddl --enable-error-stack tstr2.h5 # test for file created by Lib SAF team -TOOLTEST tsaf.ddl tsaf.h5 +TOOLTEST tsaf.ddl --enable-error-stack tsaf.h5 # test for file with variable length data -TOOLTEST tvldtypes1.ddl tvldtypes1.h5 -TOOLTEST tvldtypes2.ddl tvldtypes2.h5 -TOOLTEST tvldtypes3.ddl tvldtypes3.h5 -TOOLTEST tvldtypes4.ddl tvldtypes4.h5 -TOOLTEST tvldtypes5.ddl tvldtypes5.h5 +TOOLTEST tvldtypes1.ddl --enable-error-stack tvldtypes1.h5 +TOOLTEST tvldtypes2.ddl --enable-error-stack tvldtypes2.h5 +TOOLTEST tvldtypes3.ddl --enable-error-stack tvldtypes3.h5 +TOOLTEST tvldtypes4.ddl --enable-error-stack tvldtypes4.h5 +TOOLTEST tvldtypes5.ddl --enable-error-stack tvldtypes5.h5 #test for file with variable length string data -TOOLTEST tvlstr.ddl tvlstr.h5 +TOOLTEST tvlstr.ddl --enable-error-stack tvlstr.h5 # test for files with array data -TOOLTEST tarray1.ddl tarray1.h5 +TOOLTEST tarray1.ddl --enable-error-stack tarray1.h5 # # added for bug# 2092 - tarray1_big.h +# JIRA HDFFV-7936 TOOLTEST tarray1_big.ddl --enable-error-stack -R tarray1_big.h5 TOOLTEST tarray1_big.ddl -R tarray1_big.h5 -TOOLTEST tarray2.ddl tarray2.h5 -TOOLTEST tarray3.ddl tarray3.h5 -TOOLTEST tarray4.ddl tarray4.h5 -TOOLTEST tarray5.ddl tarray5.h5 -TOOLTEST tarray6.ddl tarray6.h5 -TOOLTEST tarray7.ddl tarray7.h5 -TOOLTEST tarray8.ddl tarray8.h5 +TOOLTEST tarray2.ddl --enable-error-stack tarray2.h5 +TOOLTEST tarray3.ddl --enable-error-stack tarray3.h5 +TOOLTEST tarray4.ddl --enable-error-stack tarray4.h5 +TOOLTEST tarray5.ddl --enable-error-stack tarray5.h5 +TOOLTEST tarray6.ddl --enable-error-stack tarray6.h5 +TOOLTEST tarray7.ddl --enable-error-stack tarray7.h5 +TOOLTEST tarray8.ddl --enable-error-stack tarray8.h5 + +# test for wildcards in filename (does not work with cmake) +TOOLTEST3 tstarfile --enable-error-stack -H -d Dataset1 tarr*.h5 +TOOLTEST3 tqmarkfile --enable-error-stack -H -d Dataset1 tarray?.h5 +TOOLTEST tmultifile --enable-error-stack -H -d Dataset1 tarray2.h5 tarray3.h5 tarray4.h5 tarray5.h5 tarray6.h5 tarray7.h5 # test for files with empty data -TOOLTEST tempty.ddl tempty.h5 +TOOLTEST tempty.ddl --enable-error-stack tempty.h5 # test for files with groups that have comments -TOOLTEST tgrp_comments.ddl tgrp_comments.h5 +TOOLTEST tgrp_comments.ddl --enable-error-stack tgrp_comments.h5 # test the --filedriver flag -TOOLTEST tsplit_file.ddl --filedriver=split tsplit_file -TOOLTEST tfamily.ddl --filedriver=family tfamily%05d.h5 -TOOLTEST tmulti.ddl --filedriver=multi tmulti +TOOLTEST tsplit_file.ddl --enable-error-stack --filedriver=split tsplit_file +TOOLTEST tfamily.ddl --enable-error-stack --filedriver=family tfamily%05d.h5 +TOOLTEST tmulti.ddl --enable-error-stack --filedriver=multi tmulti # test for files with group names which reach > 1024 bytes in size -TOOLTEST tlarge_objname.ddl -w157 tlarge_objname.h5 +TOOLTEST tlarge_objname.ddl --enable-error-stack -w157 tlarge_objname.h5 # test '-A' to suppress data but print attr's +# JIRA HDFFV-7936 TOOLTEST tall-2A.ddl --enable-error-stack -A tall.h5 TOOLTEST tall-2A.ddl -A tall.h5 # test '-r' to print attributes in ASCII instead of decimal +# JIRA HDFFV-7936 TOOLTEST tall-2B.ddl --enable-error-stack -A -r tall.h5 TOOLTEST tall-2B.ddl -A -r tall.h5 # test Subsetting -TOOLTEST tall-4s.ddl --dataset=/g1/g1.1/dset1.1.1 --start=1,1 --stride=2,3 --count=3,2 --block=1,1 tall.h5 -TOOLTEST tall-5s.ddl -d "/g1/g1.1/dset1.1.2[0;2;10;]" tall.h5 -TOOLTEST tdset-3s.ddl -d "/dset1[1,1;;;]" tdset.h5 - +TOOLTEST tall-4s.ddl --enable-error-stack --dataset=/g1/g1.1/dset1.1.1 --start=1,1 --stride=2,3 --count=3,2 --block=1,1 tall.h5 +TOOLTEST tall-5s.ddl --enable-error-stack -d "/g1/g1.1/dset1.1.2[0;2;10;]" tall.h5 +TOOLTEST tdset-3s.ddl --enable-error-stack -d "/dset1[1,1;;;]" tdset.h5 +TOOLTEST tno-subset.ddl --no-compact-subset -d "AHFINDERDIRECT::ah_centroid_t[0] it=0 tl=0" tno-subset.h5 # test printing characters in ASCII instead of decimal -TOOLTEST tchar1.ddl -r tchar.h5 - -# test failure handling -# Missing file name -TOOLTEST tnofilename.ddl +TOOLTEST tchar1.ddl --enable-error-stack -r tchar.h5 # rev. 2004 # tests for super block -TOOLTEST tboot1.ddl -H -B -d dset tfcontents1.h5 -TOOLTEST tboot2.ddl -B tfcontents2.h5 -TOOLTEST file_space.ddl -B file_space.h5 +TOOLTEST tboot1.ddl --enable-error-stack -H -B -d dset tfcontents1.h5 +TOOLTEST tboot2.ddl --enable-error-stack -B tfcontents2.h5 +TOOLTEST file_space.ddl --enable-error-stack -B file_space.h5 # test -p with a non existing dataset -TOOLTEST tperror.ddl -p -d bogus tfcontents1.h5 +TOOLTEST3 tperror.ddl --enable-error-stack -p -d bogus tfcontents1.h5 # test for file contents -TOOLTEST tcontents.ddl -n tfcontents1.h5 +TOOLTEST tcontents.ddl --enable-error-stack -n tfcontents1.h5 # tests for storage layout # compact -TOOLTEST tcompact.ddl -H -p -d compact tfilters.h5 +TOOLTEST tcompact.ddl --enable-error-stack -H -p -d compact tfilters.h5 # contiguous -TOOLTEST tcontiguos.ddl -H -p -d contiguous tfilters.h5 +TOOLTEST tcontiguos.ddl --enable-error-stack -H -p -d contiguous tfilters.h5 # chunked -TOOLTEST tchunked.ddl -H -p -d chunked tfilters.h5 +TOOLTEST tchunked.ddl --enable-error-stack -H -p -d chunked tfilters.h5 # external -TOOLTEST texternal.ddl -H -p -d external tfilters.h5 +TOOLTEST texternal.ddl --enable-error-stack -H -p -d external tfilters.h5 # fill values -TOOLTEST tfill.ddl -p tfvalues.h5 +TOOLTEST tfill.ddl --enable-error-stack -p tfvalues.h5 # several datatype, with references , print path -TOOLTEST treference.ddl tattr2.h5 +TOOLTEST treference.ddl --enable-error-stack tattr2.h5 # escape/not escape non printable characters -TOOLTEST tstringe.ddl -e tstr3.h5 -TOOLTEST tstring.ddl tstr3.h5 +TOOLTEST tstringe.ddl --enable-error-stack -e tstr3.h5 +TOOLTEST tstring.ddl --enable-error-stack tstr3.h5 # char data as ASCII with non escape -TOOLTEST tstring2.ddl -r -d str4 tstr3.h5 +TOOLTEST tstring2.ddl --enable-error-stack -r -d str4 tstr3.h5 # array indices print/not print -TOOLTEST tindicesyes.ddl taindices.h5 -TOOLTEST tindicesno.ddl -y taindices.h5 +TOOLTEST tindicesyes.ddl --enable-error-stack taindices.h5 +TOOLTEST tindicesno.ddl --enable-error-stack -y taindices.h5 ########## array indices with subsetting # 1D case -TOOLTEST tindicessub1.ddl -d 1d -s 1 -S 10 -c 2 -k 3 taindices.h5 +TOOLTEST tindicessub1.ddl --enable-error-stack -d 1d -s 1 -S 10 -c 2 -k 3 taindices.h5 # 2D case -TOOLTEST tindicessub2.ddl -d 2d -s 1,2 -S 3,3 -c 3,2 -k 2,2 taindices.h5 +TOOLTEST tindicessub2.ddl --enable-error-stack -d 2d -s 1,2 -S 3,3 -c 3,2 -k 2,2 taindices.h5 # 3D case -TOOLTEST tindicessub3.ddl -d 3d -s 0,1,2 -S 1,3,3 -c 2,2,2 -k 1,2,2 taindices.h5 +TOOLTEST tindicessub3.ddl --enable-error-stack -d 3d -s 0,1,2 -S 1,3,3 -c 2,2,2 -k 1,2,2 taindices.h5 # 4D case -TOOLTEST tindicessub4.ddl -d 4d -s 0,0,1,2 -c 2,2,3,2 -S 1,1,3,3 -k 1,1,2,2 taindices.h5 +TOOLTEST tindicessub4.ddl --enable-error-stack -d 4d -s 0,0,1,2 -c 2,2,3,2 -S 1,1,3,3 -k 1,1,2,2 taindices.h5 #Exceed the dimensions for subsetting -TOOLTEST1 texceedsubstart.ddl -d 1d -s 1,3 taindices.h5 -TOOLTEST1 texceedsubcount.ddl -d 1d -c 1,3 taindices.h5 -TOOLTEST1 texceedsubstride.ddl -d 1d -S 1,3 taindices.h5 -TOOLTEST1 texceedsubblock.ddl -d 1d -k 1,3 taindices.h5 +TOOLTEST texceedsubstart.ddl --enable-error-stack -d 1d -s 1,3 taindices.h5 +TOOLTEST texceedsubcount.ddl --enable-error-stack -d 1d -c 1,3 taindices.h5 +TOOLTEST texceedsubstride.ddl --enable-error-stack -d 1d -S 1,3 taindices.h5 +TOOLTEST texceedsubblock.ddl --enable-error-stack -d 1d -k 1,3 taindices.h5 # tests for filters # SZIP -option="-H -p -d szip tfilters.h5" +option="--enable-error-stack -H -p -d szip tfilters.h5" if test $USE_FILTER_SZIP != "yes"; then SKIP $option else TOOLTEST tszip.ddl $option fi # deflate -option="-H -p -d deflate tfilters.h5" +option="--enable-error-stack -H -p -d deflate tfilters.h5" if test $USE_FILTER_DEFLATE != "yes"; then SKIP $option else TOOLTEST tdeflate.ddl $option fi # shuffle -option="-H -p -d shuffle tfilters.h5" +option="--enable-error-stack -H -p -d shuffle tfilters.h5" if test $USE_FILTER_SHUFFLE != "yes"; then SKIP $option else TOOLTEST tshuffle.ddl $option fi # fletcher32 -option="-H -p -d fletcher32 tfilters.h5" +option="--enable-error-stack -H -p -d fletcher32 tfilters.h5" if test $USE_FILTER_FLETCHER32 != "yes"; then SKIP $option else TOOLTEST tfletcher32.ddl $option fi # nbit -option="-H -p -d nbit tfilters.h5" +option="--enable-error-stack -H -p -d nbit tfilters.h5" if test $USE_FILTER_NBIT != "yes"; then SKIP $option else TOOLTEST tnbit.ddl $option fi # scaleoffset -option="-H -p -d scaleoffset tfilters.h5" +option="--enable-error-stack -H -p -d scaleoffset tfilters.h5" if test $USE_FILTER_SCALEOFFSET != "yes"; then SKIP $option else TOOLTEST tscaleoffset.ddl $option fi # all -option="-H -p -d all tfilters.h5" +option="--enable-error-stack -H -p -d all tfilters.h5" if test $USE_FILTER_FLETCHER32 != "yes" -o $USE_FILTER_SZIP != "yes" -o $USE_FILTER_DEFLATE != "yes" -o $USE_FILTER_SHUFFLE != "yes" -o $USE_FILTER_NBIT != "yes" -o $USE_FILTER_SCALEOFFSET != "yes"; then SKIP $option else TOOLTEST tallfilters.ddl $option fi # user defined -TOOLTEST tuserfilter.ddl -H -p -d myfilter tfilters.h5 +TOOLTEST tuserfilter.ddl --enable-error-stack -H -p -d myfilter tfilters.h5 # test for displaying objects with very long names -TOOLTEST tlonglinks.ddl tlonglinks.h5 +TOOLTEST tlonglinks.ddl --enable-error-stack tlonglinks.h5 # dimensions over 4GB, print boundary -TOOLTEST tbigdims.ddl -d dset4gb -s 4294967284 -c 22 tbigdims.h5 +TOOLTEST tbigdims.ddl --enable-error-stack -d dset4gb -s 4294967284 -c 22 tbigdims.h5 # hyperslab read -TOOLTEST thyperslab.ddl thyperslab.h5 +TOOLTEST thyperslab.ddl --enable-error-stack thyperslab.h5 # # test for displaying dataset and attribute of null space -TOOLTEST tnullspace.ddl tnullspace.h5 +TOOLTEST tnullspace.ddl --enable-error-stack tnullspace.h5 + +# test for displaying dataset and attribute of space with 0 dimension size +TOOLTEST zerodim.ddl --enable-error-stack zerodim.h5 # test for long double (some systems do not have long double) -#TOOLTEST tldouble.ddl tldouble.h5 +#TOOLTEST tldouble.ddl --enable-error-stack tldouble.h5 # test for vms -TOOLTEST tvms.ddl tvms.h5 +TOOLTEST tvms.ddl --enable-error-stack tvms.h5 # test for binary output -TOOLTEST1 tbin1.ddl -d integer -o $TESTDIR/out1.bin -b LE tbinary.h5 +TOOLTEST tbin1.ddl --enable-error-stack -d integer -o out1.bin -b LE tbinary.h5 # NATIVE default. the NATIVE test can be validated with h5import/h5diff -TOOLTEST1 tbin1.ddl -d integer -o $TESTDIR/out1.bin -b tbinary.h5 -IMPORTTEST $TESTDIR/out1.bin -c out3.h5import -o $TESTDIR/out1.h5 -DIFFTEST tbinary.h5 $TESTDIR/out1.h5 /integer /integer +TOOLTEST tbin1.ddl --enable-error-stack -d integer -o out1.bin -b tbinary.h5 +IMPORTTEST out1.bin -c out3.h5import -o out1.h5 +DIFFTEST tbinary.h5 out1.h5 /integer /integer -TOOLTEST1 tbin2.ddl -b BE -d float -o $TESTDIR/out2.bin tbinary.h5 +TOOLTEST tbin2.ddl --enable-error-stack -b BE -d float -o out2.bin tbinary.h5 # the NATIVE test can be validated with h5import/h5diff -TOOLTEST1 tbin3.ddl -d integer -o $TESTDIR/out3.bin -b NATIVE tbinary.h5 -IMPORTTEST $TESTDIR/out3.bin -c out3.h5import -o $TESTDIR/out3.h5 -DIFFTEST tbinary.h5 $TESTDIR/out3.h5 /integer /integer +TOOLTEST tbin3.ddl --enable-error-stack -d integer -o out3.bin -b NATIVE tbinary.h5 +IMPORTTEST out3.bin -c out3.h5import -o out3.h5 +DIFFTEST tbinary.h5 out3.h5 /integer /integer -TOOLTEST1 tbin4.ddl -d double -b FILE -o $TESTDIR/out4.bin tbinary.h5 +TOOLTEST tbin4.ddl --enable-error-stack -d double -b FILE -o out4.bin tbinary.h5 # Clean up binary output files if test -z "$HDF5_NOCLEANUP"; then - rm -f $TESTDIR/out[1-4].bin - rm -f $TESTDIR/out1.h5 - rm -f $TESTDIR/out3.h5 + rm -f out[1-4].bin + rm -f out1.h5 + rm -f out3.h5 fi # test for dataset region references -TOOLTEST tdatareg.ddl tdatareg.h5 +TOOLTEST tdatareg.ddl --enable-error-stack tdatareg.h5 +# JIRA HDFFV-7936 TOOLTEST tdataregR.ddl --enable-error-stack -R tdatareg.h5 TOOLTEST tdataregR.ddl -R tdatareg.h5 -TOOLTEST tattrreg.ddl tattrreg.h5 +TOOLTEST tattrreg.ddl --enable-error-stack tattrreg.h5 +# JIRA HDFFV-7936 TOOLTEST tattrregR.ddl --enable-error-stack -R tattrreg.h5 TOOLTEST tattrregR.ddl -R tattrreg.h5 -TOOLTEST2 tbinregR.exp -d /Dataset1 -s 0 -R -y -o $TESTDIR/tbinregR.txt tdatareg.h5 +TOOLTEST2 tbinregR.exp --enable-error-stack -d /Dataset1 -s 0 -R -y -o tbinregR.txt tdatareg.h5 # Clean up text output files if test -z "$HDF5_NOCLEANUP"; then - rm -f $TESTDIR/tbinregR.txt + rm -f tbinregR.txt fi # tests for group creation order # "1" tracked, "2" name, root tracked -TOOLTEST tordergr1.ddl --group=1 --sort_by=creation_order --sort_order=ascending tordergr.h5 -TOOLTEST tordergr2.ddl --group=1 --sort_by=creation_order --sort_order=descending tordergr.h5 -TOOLTEST tordergr3.ddl -g 2 -q name -z ascending tordergr.h5 -TOOLTEST tordergr4.ddl -g 2 -q name -z descending tordergr.h5 -TOOLTEST tordergr5.ddl -q creation_order tordergr.h5 +TOOLTEST tordergr1.ddl --enable-error-stack --group=1 --sort_by=creation_order --sort_order=ascending tordergr.h5 +TOOLTEST tordergr2.ddl --enable-error-stack --group=1 --sort_by=creation_order --sort_order=descending tordergr.h5 +TOOLTEST tordergr3.ddl --enable-error-stack -g 2 -q name -z ascending tordergr.h5 +TOOLTEST tordergr4.ddl --enable-error-stack -g 2 -q name -z descending tordergr.h5 +TOOLTEST tordergr5.ddl --enable-error-stack -q creation_order tordergr.h5 # tests for attribute order -TOOLTEST torderattr1.ddl -H --sort_by=name --sort_order=ascending torderattr.h5 -TOOLTEST torderattr2.ddl -H --sort_by=name --sort_order=descending torderattr.h5 -TOOLTEST torderattr3.ddl -H --sort_by=creation_order --sort_order=ascending torderattr.h5 -TOOLTEST torderattr4.ddl -H --sort_by=creation_order --sort_order=descending torderattr.h5 +TOOLTEST torderattr1.ddl --enable-error-stack -H --sort_by=name --sort_order=ascending torderattr.h5 +TOOLTEST torderattr2.ddl --enable-error-stack -H --sort_by=name --sort_order=descending torderattr.h5 +TOOLTEST torderattr3.ddl --enable-error-stack -H --sort_by=creation_order --sort_order=ascending torderattr.h5 +TOOLTEST torderattr4.ddl --enable-error-stack -H --sort_by=creation_order --sort_order=descending torderattr.h5 # tests for floating point user defined printf format -TOOLTEST tfpformat.ddl -m %.7f tfpformat.h5 +TOOLTEST tfpformat.ddl --enable-error-stack -m %.7f tfpformat.h5 # tests for traversal of external links +# JIRA HDFFV-7936 TOOLTEST textlinksrc.ddl --enable-error-stack textlinksrc.h5 TOOLTEST textlinksrc.ddl textlinksrc.h5 +# JIRA HDFFV-7936 TOOLTEST textlinkfar.ddl --enable-error-stack textlinkfar.h5 TOOLTEST textlinkfar.ddl textlinkfar.h5 # test for dangling external links -TOOLTEST textlink.ddl textlink.h5 +# JIRA HDFFV-7936 TOOLTEST textlink.ddl --enable-error-stack textlink.h5 +TOOLTEST3 textlink.ddl --enable-error-stack textlink.h5 # test for error stack display (BZ2048) TOOLTEST3 filter_fail.ddl --enable-error-stack filter_fail.h5 # test for -o -y for dataset with attributes -TOOLTEST1 tall-6.ddl -y -o $TESTDIR/data -d /g1/g1.1/dset1.1.1 tall.h5 +TOOLTEST tall-6.ddl --enable-error-stack -y -o data -d /g1/g1.1/dset1.1.1 tall.h5 + +####### test for dataset packed bits ###### + +# test failure handling +# Missing file name +TOOLTEST tnofilename-with-packed-bits.ddl --enable-error-stack +# Limits: +# Maximum number of packed bits is 8 (for now). +# Maximum integer size is 64 (for now). +# Maximun Offset is 63 (Maximum size - 1). +# Maximum Offset+Length is 64 (Maximum size). +# Tests: +# Normal operation on both signed and unsigned int datasets. +# Sanity check +# Their rawdata output should be the same. +TOOLTEST tpbitsSignedWhole.ddl --enable-error-stack -d /DS08BITS -M 0,8 packedbits.h5 +TOOLTEST tpbitsUnsignedWhole.ddl --enable-error-stack -d /DU08BITS -M 0,8 packedbits.h5 +TOOLTEST tpbitsSignedIntWhole.ddl --enable-error-stack -d /DS16BITS -M 0,16 packedbits.h5 +TOOLTEST tpbitsUnsignedIntWhole.ddl --enable-error-stack -d /DU16BITS -M 0,16 packedbits.h5 +TOOLTEST tpbitsSignedLongWhole.ddl --enable-error-stack -d /DS32BITS -M 0,32 packedbits.h5 +TOOLTEST tpbitsUnsignedLongWhole.ddl --enable-error-stack -d /DU32BITS -M 0,32 packedbits.h5 +TOOLTEST tpbitsSignedLongLongWhole.ddl --enable-error-stack -d /DS64BITS -M 0,64 packedbits.h5 +TOOLTEST tpbitsUnsignedLongLongWhole.ddl --enable-error-stack -d /DU64BITS -M 0,64 packedbits.h5 +TOOLTEST tpbitsSignedLongLongWhole63.ddl --enable-error-stack -d /DS64BITS -M 0,63 packedbits.h5 +TOOLTEST tpbitsUnsignedLongLongWhole63.ddl --enable-error-stack -d /DU64BITS -M 0,63 packedbits.h5 +TOOLTEST tpbitsSignedLongLongWhole1.ddl --enable-error-stack -d /DS64BITS -M 1,63 packedbits.h5 +TOOLTEST tpbitsUnsignedLongLongWhole1.ddl --enable-error-stack -d /DU64BITS -M 1,63 packedbits.h5 +# Half sections +TOOLTEST tpbitsSigned4.ddl --enable-error-stack -d /DS08BITS -M 0,4,4,4 packedbits.h5 +TOOLTEST tpbitsUnsigned4.ddl --enable-error-stack -d /DU08BITS -M 0,4,4,4 packedbits.h5 +TOOLTEST tpbitsSignedInt8.ddl --enable-error-stack -d /DS16BITS -M 0,8,8,8 packedbits.h5 +TOOLTEST tpbitsUnsignedInt8.ddl --enable-error-stack -d /DU16BITS -M 0,8,8,8 packedbits.h5 +TOOLTEST tpbitsSignedLong16.ddl --enable-error-stack -d /DS32BITS -M 0,16,16,16 packedbits.h5 +TOOLTEST tpbitsUnsignedLong16.ddl --enable-error-stack -d /DU32BITS -M 0,16,16,16 packedbits.h5 +TOOLTEST tpbitsSignedLongLong32.ddl --enable-error-stack -d /DS64BITS -M 0,32,32,32 packedbits.h5 +TOOLTEST tpbitsUnsignedLongLong32.ddl --enable-error-stack -d /DU64BITS -M 0,32,32,32 packedbits.h5 +# Quarter sections +TOOLTEST tpbitsSigned2.ddl --enable-error-stack -d /DS08BITS -M 0,2,2,2,4,2,6,2 packedbits.h5 +TOOLTEST tpbitsUnsigned2.ddl --enable-error-stack -d /DU08BITS -M 0,2,2,2,4,2,6,2 packedbits.h5 +TOOLTEST tpbitsSignedInt4.ddl --enable-error-stack -d /DS16BITS -M 0,4,4,4,8,4,12,4 packedbits.h5 +TOOLTEST tpbitsUnsignedInt4.ddl --enable-error-stack -d /DU16BITS -M 0,4,4,4,8,4,12,4 packedbits.h5 +TOOLTEST tpbitsSignedLong8.ddl --enable-error-stack -d /DS32BITS -M 0,8,8,8,16,8,24,8 packedbits.h5 +TOOLTEST tpbitsUnsignedLong8.ddl --enable-error-stack -d /DU32BITS -M 0,8,8,8,16,8,24,8 packedbits.h5 +TOOLTEST tpbitsSignedLongLong16.ddl --enable-error-stack -d /DS64BITS -M 0,16,16,16,32,16,48,16 packedbits.h5 +TOOLTEST tpbitsUnsignedLongLong16.ddl --enable-error-stack -d /DU64BITS -M 0,16,16,16,32,16,48,16 packedbits.h5 +# Begin and End +TOOLTEST tpbitsSigned.ddl --enable-error-stack -d /DS08BITS -M 0,2,2,6 packedbits.h5 +TOOLTEST tpbitsUnsigned.ddl --enable-error-stack -d /DU08BITS -M 0,2,2,6 packedbits.h5 +TOOLTEST tpbitsSignedInt.ddl --enable-error-stack -d /DS16BITS -M 0,2,10,6 packedbits.h5 +TOOLTEST tpbitsUnsignedInt.ddl --enable-error-stack -d /DU16BITS -M 0,2,10,6 packedbits.h5 +TOOLTEST tpbitsSignedLong.ddl --enable-error-stack -d /DS32BITS -M 0,2,26,6 packedbits.h5 +TOOLTEST tpbitsUnsignedLong.ddl --enable-error-stack -d /DU32BITS -M 0,2,26,6 packedbits.h5 +TOOLTEST tpbitsSignedLongLong.ddl --enable-error-stack -d /DS64BITS -M 0,2,58,6 packedbits.h5 +TOOLTEST tpbitsUnsignedLongLong.ddl --enable-error-stack -d /DU64BITS -M 0,2,58,6 packedbits.h5 +# Overlapped packed bits. +TOOLTEST tpbitsOverlapped.ddl --enable-error-stack -d /DS08BITS -M 0,1,1,1,2,1,0,3 packedbits.h5 +# Maximum number of packed bits. +TOOLTEST tpbitsMax.ddl --enable-error-stack -d /DS08BITS -M 0,1,1,1,2,1,3,1,4,1,5,1,6,1,7,1 packedbits.h5 +# Compound type. +TOOLTEST tpbitsCompound.ddl --enable-error-stack -d /dset1 -M 0,1,1,1 tcompound.h5 +# Array type. +TOOLTEST tpbitsArray.ddl --enable-error-stack -d /Dataset1 -M 0,1,1,1 tarray1.h5 +# Test Error handling. +# Too many packed bits requested. Max is 8 for now. +TOOLTEST tpbitsMaxExceeded.ddl --enable-error-stack -d /DS08BITS -M 0,1,0,1,1,1,2,1,3,1,4,1,5,1,6,1,7,1 packedbits.h5 +# Offset too large. Max is 7 (8-1) for now. +TOOLTEST tpbitsOffsetExceeded.ddl --enable-error-stack -d /DS08BITS -M 64,1 packedbits.h5 +TOOLTEST tpbitsCharOffsetExceeded.ddl --enable-error-stack -d /DS08BITS -M 8,1 packedbits.h5 +TOOLTEST tpbitsIntOffsetExceeded.ddl --enable-error-stack -d /DS16BITS -M 16,1 packedbits.h5 +TOOLTEST tpbitsLongOffsetExceeded.ddl --enable-error-stack -d /DS32BITS -M 32,1 packedbits.h5 +# Bad offset, must not be negative. +TOOLTEST tpbitsOffsetNegative.ddl --enable-error-stack -d /DS08BITS -M -1,1 packedbits.h5 +# Bad length, must not be positive. +TOOLTEST tpbitsLengthPositive.ddl --enable-error-stack -d /DS08BITS -M 4,0 packedbits.h5 +# Offset+Length is too large. Max is 8 for now. +TOOLTEST tpbitsLengthExceeded.ddl --enable-error-stack -d /DS08BITS -M 37,28 packedbits.h5 +TOOLTEST tpbitsCharLengthExceeded.ddl --enable-error-stack -d /DS08BITS -M 2,7 packedbits.h5 +TOOLTEST tpbitsIntLengthExceeded.ddl --enable-error-stack -d /DS16BITS -M 10,7 packedbits.h5 +TOOLTEST tpbitsLongLengthExceeded.ddl --enable-error-stack -d /DS32BITS -M 26,7 packedbits.h5 +# Incomplete pair of packed bits request. +TOOLTEST tpbitsIncomplete.ddl --enable-error-stack -d /DS08BITS -M 0,2,2,1,0,2,2, packedbits.h5 + # tests for Fixed Array chunk indices TOOLTEST tdset_idx.ddl -p -H tdset_idx.h5 diff --git a/tools/h5dump/testh5dumpxml.sh.in b/tools/h5dump/testh5dumpxml.sh.in index c9f1ad2..1bbf232 100755 --- a/tools/h5dump/testh5dumpxml.sh.in +++ b/tools/h5dump/testh5dumpxml.sh.in @@ -62,9 +62,6 @@ TOOLTEST() { # Run test. TESTING $DUMPER $@ ( - echo "#############################" - echo "Expected output for '$DUMPER $@'" - echo "#############################" cd $srcdir/../testfiles $RUNSERIAL $DUMPER_BIN $@ ) >$actual 2>$actual_err @@ -74,7 +71,7 @@ TOOLTEST() { if [ ! -f $expect ]; then # Create the expect file if it doesn't yet exist. echo " CREATED" - cp $actual $expect + cp $actual $expect elif $CMP $expect $actual; then echo " PASSED" else @@ -99,7 +96,7 @@ SKIP() { ############################################################################## ############################################################################## -### T H E T E S T S ### +### T H E T E S T S ### ############################################################################## ############################################################################## diff --git a/tools/h5import/CMakeLists.txt b/tools/h5import/CMakeLists.txt index a2955db..76dcf26 100644 --- a/tools/h5import/CMakeLists.txt +++ b/tools/h5import/CMakeLists.txt @@ -1,11 +1,10 @@ -cmake_minimum_required (VERSION 2.8) +cmake_minimum_required (VERSION 2.8.6) PROJECT (HDF5_TOOLS_H5IMPORT) #----------------------------------------------------------------------------- # Setup include Directories #----------------------------------------------------------------------------- INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib) -INCLUDE_DIRECTORIES (${HDF5_PROJECT_DIR}/test) # -------------------------------------------------------------------- # Add the h5import executables @@ -13,6 +12,7 @@ INCLUDE_DIRECTORIES (${HDF5_PROJECT_DIR}/test) ADD_EXECUTABLE (h5import ${HDF5_TOOLS_H5IMPORT_SOURCE_DIR}/h5import.c) TARGET_NAMING (h5import ${LIB_TYPE}) TARGET_LINK_LIBRARIES (h5import ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) +SET_TARGET_PROPERTIES (h5import PROPERTIES FOLDER tools) SET (H5_DEP_EXECUTABLES h5import) @@ -29,6 +29,7 @@ IF (BUILD_TESTING) ADD_EXECUTABLE (h5importtest ${HDF5_TOOLS_H5IMPORT_SOURCE_DIR}/h5importtest.c) TARGET_NAMING (h5importtest ${LIB_TYPE}) TARGET_LINK_LIBRARIES (h5importtest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + SET_TARGET_PROPERTIES (h5importtest PROPERTIES FOLDER tools) SET (HDF5_REFERENCE_CONF_FILES binfp64.conf @@ -54,7 +55,7 @@ IF (BUILD_TESTING) txtuin32.txt txtin16.txt txtin32.txt - in64.txt + textpfe64.txt txtstr.txt ) SET (HDF5_REFERENCE_TEST_FILES @@ -73,7 +74,7 @@ IF (BUILD_TESTING) txtuin16.h5 txtuin32.h5 txtstr.h5 - test15.h5 + textpfe.h5 ) FILE (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") @@ -116,27 +117,33 @@ IF (BUILD_TESTING) ############################################################################## ############################################################################## MACRO (ADD_H5_TEST testname importfile conffile testfile) - ADD_TEST ( - NAME H5IMPORT-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ${testfile} - ${testfile}.new - ${testfile}.new.err - ${testfile}.out - ${testfile}.out.err - ) + IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST ( + NAME H5IMPORT-${testname}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ${testfile} + ${testfile}.new + ${testfile}.new.err + ${testfile}.out + ${testfile}.out.err + ) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5IMPORT-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + SET (last_test "H5IMPORT-${testname}-clear-objects") + ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + + ADD_TEST (NAME H5IMPORT-${testname} COMMAND $ ${importfile} -c testfiles/${conffile} -o ${testfile}) IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5IMPORT-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) + SET_TESTS_PROPERTIES (H5IMPORT-${testname} PROPERTIES DEPENDS ${last_test}) ENDIF (NOT "${last_test}" STREQUAL "") - ADD_TEST (NAME H5IMPORT-${testname} COMMAND $ ${importfile} -c testfiles/${conffile} -o ${testfile}) - SET_TESTS_PROPERTIES (H5IMPORT-${testname} PROPERTIES DEPENDS H5IMPORT-${testname}-clear-objects) SET (last_test "H5IMPORT-${testname}") # If using memchecker add tests without using scripts IF (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( - NAME H5IMPORT-H5DUMP-${testname} + NAME H5IMPORT-H5DMP-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" -D "TEST_ARGS:STRING=${testfile}" @@ -147,9 +154,9 @@ IF (BUILD_TESTING) -D "TEST_SKIP_COMPARE=TRUE" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5IMPORT-H5DUMP-${testname} PROPERTIES DEPENDS H5IMPORT-${testname}) + SET_TESTS_PROPERTIES (H5IMPORT-H5DMP-${testname} PROPERTIES DEPENDS H5IMPORT-${testname}) ADD_TEST ( - NAME H5IMPORT-H5DUMP_CMP-${testname} + NAME H5IMPORT-H5DMP_CMP-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" -D "TEST_ARGS:STRING=testfiles/${testfile}" @@ -160,8 +167,8 @@ IF (BUILD_TESTING) -D "TEST_REFERENCE=${testfile}.new" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5IMPORT-H5DUMP_CMP-${testname} PROPERTIES DEPENDS H5IMPORT-H5DUMP-${testname}) - SET (last_test "H5IMPORT-H5DUMP_CMP-${testname}") + SET_TESTS_PROPERTIES (H5IMPORT-H5DMP_CMP-${testname} PROPERTIES DEPENDS H5IMPORT-H5DMP-${testname}) + SET (last_test "H5IMPORT-H5DMP_CMP-${testname}") ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5_TEST testname resultcode testfile vparam srcname dstname) @@ -187,9 +194,12 @@ IF (BUILD_TESTING) txtin32.txt ${HDF5_REFERENCE_TEST_FILES} ) + SET (last_test "H5IMPORT-clear-objects") ADD_TEST (NAME H5IMPORT-h5importtest COMMAND $) - SET_TESTS_PROPERTIES (H5IMPORT-h5importtest PROPERTIES DEPENDS H5IMPORT-clear-objects) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5IMPORT-h5importtest PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") SET (last_test "H5IMPORT-h5importtest") # ----- TESTING "ASCII I32 rank 3 - Output BE " ; @@ -238,7 +248,7 @@ IF (BUILD_TESTING) ADD_H5_TEST (BINARY_I8_EOF binin8w.bin binin8w.conf binin8w.h5) # ----- TESTING "ASCII F64 - rank 1 - INPUT-CLASS TEXTFPE " - ADD_H5_TEST (ASCII_F64_R1 in64.txt textpfe.conf test15.h5) + ADD_H5_TEST (ASCII_F64_R1 textpfe64.txt textpfe.conf textpfe.h5) ENDIF (BUILD_TESTING) diff --git a/tools/h5import/Makefile.in b/tools/h5import/Makefile.in index 8867bd0..b2a90ff 100755 --- a/tools/h5import/Makefile.in +++ b/tools/h5import/Makefile.in @@ -181,6 +181,7 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ +FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ @@ -201,10 +202,12 @@ H5_LONE_COLON = @H5_LONE_COLON@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ +HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ +HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ diff --git a/tools/h5import/h5import.c b/tools/h5import/h5import.c index 82b92d2..56dc5ab 100755 --- a/tools/h5import/h5import.c +++ b/tools/h5import/h5import.c @@ -20,252 +20,269 @@ #include #include #include "h5import.h" +#include "h5tools.h" #include "h5tools_utils.h" - /* Name of tool */ #define PROGRAMNAME "h5import" +#ifdef H5_HAVE_WIN32_API +#define READ_OPEN_FLAGS "rb" +#else +#define READ_OPEN_FLAGS "r" +#endif + int main(int argc, char *argv[]) { - struct Options opt; - int outfile_named = FALSE; - int token; - int i; - int state = 0; - struct Input *in=NULL; - - const char *err1 = "Invalid number of arguments: %d.\n"; - const char *err2 = "Error in state table.\n"; - const char *err3 = "No output file given.\n"; - const char *err4 = "Program aborted.\n"; - const char *err5 = "Invalid path %s.\n"; - const char *err6 = "Invalid dimensions - %s.\n"; - const char *err7 = "Invalid type of data - %s.\n"; - const char *err8 = "Invalid size of data - %s.\n"; - const char *err9 = "Cannot specify more than 30 input files in one call to h5import.\n"; + struct Options opt; + int outfile_named = FALSE; + int token; + int i; + int state = 0; + struct Input *in = NULL; + + const char *err1 = "Invalid number of arguments: %d.\n"; + const char *err2 = "Error in state table.\n"; + const char *err3 = "No output file given.\n"; + const char *err4 = "Program aborted.\n"; + const char *err5 = "Invalid path %s.\n"; + const char *err6 = "Invalid dimensions - %s.\n"; + const char *err7 = "Invalid type of data - %s.\n"; + const char *err8 = "Invalid size of data - %s.\n"; + const char *err9 = "Cannot specify more than 30 input files in one call to h5import.\n"; h5tools_setprogname(PROGRAMNAME); h5tools_setstatus(EXIT_SUCCESS); - (void)HDsetvbuf(stderr, (char *) NULL, _IOLBF, 0); - (void)HDsetvbuf(stdout, (char *) NULL, _IOLBF, 0); + /* Initialize h5tools lib */ + h5tools_init(); - if ( argv[1] && (strcmp("-V",argv[1])==0) ) - { - print_version("h5import"); - exit(EXIT_SUCCESS); + (void) HDsetvbuf(stderr, (char *) NULL, _IOLBF, 0); + (void) HDsetvbuf(stdout, (char *) NULL, _IOLBF, 0); + if (argv[1] && (HDstrcmp("-V", argv[1]) == 0)) { + print_version(PROGRAMNAME); + HDexit(EXIT_SUCCESS); } - /* - * validate the number of command line arguments - */ + /* + * validate the number of command line arguments + */ + if (argc < 2) { + (void) HDfprintf(stderr, err1, argc); + usage(argv[0]); + goto err; + } - if (argc < 2) - { - (void) fprintf(stderr, err1, argc); - usage(argv[0]); - goto err; - } + /* Initialize the file structure to 0 */ + HDmemset(&opt, 0, sizeof(struct Options)); - /* Initialize the file count to 0 */ - opt.fcount = 0; + /* + * parse the command line + */ + for (i = 1; i < argc; i++) { + if ((token = gtoken(argv[i])) == ERR) { + usage(argv[0]); + goto err; + } - /* - * parse the command line - */ + state = state_table[state][token]; - for (i = 1; i < argc; i++) - { - if ((token = gtoken(argv[i])) == ERR) - { - usage(argv[0]); - goto err; - } + switch (state) { - state = state_table[state][token]; + case 1: /* counting input files */ + if (opt.fcount < 29) { + (void) HDstrcpy(opt.infiles[opt.fcount].datafile, argv[i]); + in = &(opt.infiles[opt.fcount].in); + opt.infiles[opt.fcount].config = 0; + setDefaultValues(in, opt.fcount); + opt.fcount++; + } + else { + (void) HDfprintf(stderr, err9, argv[i]); + goto err; + } - switch (state) - { + break; - case 1: /* counting input files */ - if (opt.fcount < 29) { - (void) HDstrcpy(opt.infiles[opt.fcount].datafile, argv[i]); - in = &(opt.infiles[opt.fcount].in); - opt.infiles[opt.fcount].config = 0; - setDefaultValues(in, opt.fcount); - opt.fcount++; - } - else { - (void) fprintf(stderr, err9, argv[i]); - goto err; - } - - break; - - case 2: /* -c found; look for configfile */ - break; - - case 3: /* get configfile name */ - (void) HDstrcpy(opt.infiles[opt.fcount-1].configfile, argv[i]); - opt.infiles[opt.fcount-1].config = 1; - break; - - case 4: /* -o found; look for outfile */ - break; - - case 5: /* get outfile found */ - (void) HDstrcpy(opt.outfile, argv[i]); - outfile_named = TRUE; - break; - - case 6: /* -h found; help, then exit */ - help(argv[0]); - exit(EXIT_SUCCESS); - break; - - case 7: /* -d found; look for dimensions */ - break; - - case 8: /* read dimensions */ - if (parseDimensions(in, argv[i]) == -1) - { - (void) fprintf(stderr, err6, argv[i]); - goto err; - } - break; + case 2: /* -c found; look for configfile */ + break; - case 9: /* -p found; look for path name */ - break; + case 3: /* get configfile name */ + (void) HDstrcpy(opt.infiles[opt.fcount-1].configfile, argv[i]); + opt.infiles[opt.fcount - 1].config = 1; + break; - case 10: /* read path name */ - if (parsePathInfo(&in->path, argv[i]) == -1) - { - (void) fprintf(stderr, err5, argv[i]); - goto err; - } - break; + case 4: /* -o found; look for outfile */ + break; - case 11: /* -t found; look for data type */ - break; + case 5: /* get outfile found */ + (void) HDstrcpy(opt.outfile, argv[i]); + outfile_named = TRUE; + break; - case 12: /* read data type */ - if (getInputClass(in, argv[i]) == -1) - { - (void) fprintf(stderr, err7, argv[i]); - goto err; - } + case 6: /* -h found; help, then exit */ + help(argv[0]); + HDexit(EXIT_SUCCESS); + break; + + case 7: /* -d found; look for dimensions */ + break; + + case 8: /* read dimensions */ + if (parseDimensions(in, argv[i]) == -1) { + (void) HDfprintf(stderr, err6, argv[i]); + goto err; + } + break; + + case 9: /* -p found; look for path name */ + break; + + case 10: /* read path name */ + if (parsePathInfo(&in->path, argv[i]) == -1) { + (void) HDfprintf(stderr, err5, argv[i]); + goto err; + } + break; + + case 11: /* -t found; look for data type */ + break; + + case 12: /* read data type */ + if (getInputClass(in, argv[i]) == -1) { + (void) HDfprintf(stderr, err7, argv[i]); + goto err; + } + + if (in->inputClass == 0 || in->inputClass == 4) + in->outputClass = 0; + if (in->inputClass == 1 || in->inputClass == 2 || in->inputClass == 3) + in->outputClass = 1; + if (in->inputClass == 6 || in->inputClass == 7) + in->outputClass = 2; + break; + + case 13: /* -s found; look for data size */ + break; + + case 14: /* read data size */ + if (getInputSize(in, (int) HDstrtol(argv[i], NULL, BASE_10)) == -1) { + (void) HDfprintf(stderr, err8, argv[i]); + goto err; + } + /*set default value for output-size */ + in->outputSize = in->inputSize; + break; - if (in->inputClass == 0 || in->inputClass == 4) - in->outputClass = 0; - if (in->inputClass == 1 || in->inputClass == 2 || in->inputClass == 3) - in->outputClass = 1; - if (in->inputClass == 6 || in->inputClass == 7) - in->outputClass = 2; - break; - - case 13: /* -s found; look for data size */ - break; - - case 14: /* read data size */ - if (getInputSize(in, (int)HDstrtol(argv[i], NULL, BASE_10)) == -1) - { - (void) fprintf(stderr, err8, argv[i]); - goto err; + case ERR: /* command syntax error */ + default: + (void) HDfprintf(stderr, "%s", err2); + usage(argv[0]); + goto err; } - /*set default value for output-size */ - in->outputSize = in->inputSize; - break; + } - case ERR: /* command syntax error */ - default: - (void) fprintf(stderr, "%s", err2); + if (FALSE == outfile_named) { + (void) HDfprintf(stderr, "%s", err3); usage(argv[0]); goto err; } - } - - if (FALSE == outfile_named) - { - (void) fprintf(stderr, "%s", err3); - usage(argv[0]); - goto err; - } - - if (process(&opt) == -1) - goto err; - - return(EXIT_SUCCESS); - err: - (void) fprintf(stderr, "%s", err4); - return(EXIT_FAILURE); -} -static int -gtoken(char *s) -{ - size_t len; - int token; - - const char *err1 = "Illegal argument: %s.\n"; - - /* - * identify the token type - */ - if (s[0] == '-') - { /* option name (or negative number) */ - token = ERR; - len = HDstrlen(&s[1]); - switch (s[1]) - { - case 'o': - if (!HDstrncmp("outfile", &s[1], len)) - token = OPT_o; - break; - - case 'c': - if (!HDstrncmp("config", &s[1], len)) - token = OPT_c; - break; - - case 'h': - if (!HDstrncmp("help", &s[1], len)) - token = OPT_h; - break; - - case 'd': - if (!HDstrncmp("dims", &s[1], len)) - token = OPT_d; - break; - - case 'p': - if (!HDstrncmp("path", &s[1], len)) - token = OPT_p; - break; - - case 't': - if (!HDstrncmp("type", &s[1], len)) - token = OPT_t; - break; - - case 's': - if (!HDstrncmp("size", &s[1], len)) - token = OPT_s; - break; + if (process(&opt) == -1) + goto err; + + for (i = 0; i < opt.fcount; i++) { + in = &(opt.infiles[i].in); + if (in->sizeOfDimension) + HDfree(in->sizeOfDimension); + if (in->sizeOfChunk) + HDfree(in->sizeOfChunk); + if (in->maxsizeOfDimension) + HDfree(in->maxsizeOfDimension); + if (in->externFilename) + HDfree(in->externFilename); + if (in->data) + HDfree(in->data); } - if (token == ERR) - (void) fprintf(stderr, err1, s); - } - else /* filename */ - { - token = FILNAME; - } - return (token); + return (EXIT_SUCCESS); +err: + (void) HDfprintf(stderr, "%s", err4); + for (i = 0; i < opt.fcount; i++) { + in = &(opt.infiles[i].in); + if (in->sizeOfDimension) + HDfree(in->sizeOfDimension); + if (in->sizeOfChunk) + HDfree(in->sizeOfChunk); + if (in->maxsizeOfDimension) + HDfree(in->maxsizeOfDimension); + if (in->externFilename) + HDfree(in->externFilename); + if (in->data) + HDfree(in->data); + } + return (EXIT_FAILURE); } +static int gtoken(char *s) +{ + size_t len; + int token; + + const char *err1 = "Illegal argument: %s.\n"; + + /* + * identify the token type + */ + if (s[0] == '-') { /* option name (or negative number) */ + token = ERR; + len = HDstrlen(&s[1]); + switch (s[1]) { + case 'o': + if (!HDstrncmp("outfile", &s[1], len)) + token = OPT_o; + break; + + case 'c': + if (!HDstrncmp("config", &s[1], len)) + token = OPT_c; + break; + + case 'h': + if (!HDstrncmp("help", &s[1], len)) + token = OPT_h; + break; + + case 'd': + if (!HDstrncmp("dims", &s[1], len)) + token = OPT_d; + break; + + case 'p': + if (!HDstrncmp("path", &s[1], len)) + token = OPT_p; + break; + + case 't': + if (!HDstrncmp("type", &s[1], len)) + token = OPT_t; + break; + + case 's': + if (!HDstrncmp("size", &s[1], len)) + token = OPT_s; + break; + } + if (token == ERR) + (void) HDfprintf(stderr, err1, s); + } + else { /* filename */ + token = FILNAME; + } + return (token); +} /*------------------------------------------------------------------------- * Function: processDataFile @@ -282,502 +299,430 @@ gtoken(char *s) *------------------------------------------------------------------------- */ -static int -processDataFile(char *infile, struct Input *in, FILE **strm, hid_t file_id) +static int processDataFile(char *infile, struct Input *in, hid_t file_id) { - const char *err1 = "Unable to open the input file %s for reading.\n"; - const char *err2 = "Error in allocating integer data storage.\n"; - const char *err3 = "Error in allocating floating-point data storage.\n"; - const char *err4 = "Error in reading integer data.\n"; - const char *err5 = "Error in reading floating-point data.\n"; - const char *err6 = "Error in allocating unsigned integer data storage.\n"; - const char *err7 = "Error in reading unsigned integer data.\n"; - const char *err10 = "Unrecognized input class type.\n"; - const char *err11 = "Error in reading string data.\n"; - - /*------------------------------------------------------------------------- - * special case for opening binary classes in WIN32 - * "FP" denotes a floating point binary file, - * "IN" denotes a signed integer binary file, - * "UIN" denotes an unsigned integer binary file, - *------------------------------------------------------------------------- - */ - if ( in->inputClass == 4 /* "IN" */ || - in->inputClass == 3 /* "FP" */ || - in->inputClass == 7 /* "UIN" */ - - ) - { - -#ifdef WIN32 - - if ((*strm = fopen(infile, "rb")) == NULL) - { - (void) fprintf(stderr, err1, infile); - return(-1); - } -#else - - if ((*strm = fopen(infile, "r")) == NULL) - { - (void) fprintf(stderr, err1, infile); - return(-1); - } - -#endif - - } - /*------------------------------------------------------------------------- - * if the input class is not binary, just use "r" - *------------------------------------------------------------------------- - */ - else - { - if ((*strm = fopen(infile, "r")) == NULL) - { - (void) fprintf(stderr, err1, infile); - return(-1); - } - } - - + FILE *strm; + const char *err1 = "Unable to open the input file %s for reading.\n"; + const char *err2 = "Error in allocating integer data storage.\n"; + const char *err3 = "Error in allocating floating-point data storage.\n"; + const char *err4 = "Error in reading integer data.\n"; + const char *err5 = "Error in reading floating-point data.\n"; + const char *err6 = "Error in allocating unsigned integer data storage.\n"; + const char *err7 = "Error in reading unsigned integer data.\n"; + const char *err10 = "Unrecognized input class type.\n"; + const char *err11 = "Error in reading string data.\n"; + + /*------------------------------------------------------------------------- + * special case for opening binary classes in H5_HAVE_WIN32_API + * "FP" denotes a floating point binary file, + * "IN" denotes a signed integer binary file, + * "UIN" denotes an unsigned integer binary file, + *------------------------------------------------------------------------- + */ + if (in->inputClass == 4 /* "IN" */|| in->inputClass == 3 /* "FP" */|| in->inputClass == 7 /* "UIN" */) { + + if ((strm = HDfopen(infile, READ_OPEN_FLAGS)) == NULL) { + (void) HDfprintf(stderr, err1, infile); + return (-1); + } + } + /*------------------------------------------------------------------------- + * if the input class is not binary, just use "r" + *------------------------------------------------------------------------- + */ + else { + if ((strm = HDfopen(infile, "r")) == NULL) { + (void) HDfprintf(stderr, err1, infile); + return (-1); + } + } - switch(in->inputClass) - { + switch (in->inputClass) { case 0: /* TEXTIN */ case 4: /* IN */ - if (allocateIntegerStorage(in) == -1) - { - (void) fprintf(stderr, err2, infile); - return(-1); - } - - if (readIntegerData(strm, in) == -1) - { - (void) fprintf(stderr, err4, infile); - return(-1); - } - break; + if (allocateIntegerStorage(in) == -1) { + (void) HDfprintf(stderr, err2, infile); + HDfclose(strm); + return (-1); + } + + if (readIntegerData(strm, in) == -1) { + (void) HDfprintf(stderr, err4, infile); + HDfclose(strm); + return (-1); + } + break; case 1: /* TEXTFP */ case 2: /* TEXTFPE */ case 3: /* FP */ - if (allocateFloatStorage(in) == -1) - { - (void) fprintf(stderr, err3, infile); - return(-1); + if (allocateFloatStorage(in) == -1) { + (void) HDfprintf(stderr, err3, infile); + HDfclose(strm); + return (-1); - } + } - if (readFloatData(strm, in) == -1) - { - (void) fprintf(stderr, err5, infile); - return(-1); - } - break; + if (readFloatData(strm, in) == -1) { + (void) HDfprintf(stderr, err5, infile); + HDfclose(strm); + return (-1); + } + break; case 5: /* STR */ - if (processStrData(strm, in, file_id) == -1) - { - (void) fprintf(stderr, err11, infile); - return(-1); + if (processStrData(strm, in, file_id) == -1) { + (void) HDfprintf(stderr, err11, infile); + HDfclose(strm); + return (-1); } - - - break; + break; case 6: /* TEXTUIN */ case 7: /* UIN */ - if (allocateUIntegerStorage(in) == -1) - { - (void) fprintf(stderr, err6, infile); - return(-1); - } - if (readUIntegerData(strm, in) == -1) - { - (void) fprintf(stderr, err7, infile); - return(-1); - } - break; + if (allocateUIntegerStorage(in) == -1) { + (void) HDfprintf(stderr, err6, infile); + HDfclose(strm); + return (-1); + } + if (readUIntegerData(strm, in) == -1) { + (void) HDfprintf(stderr, err7, infile); + HDfclose(strm); + return (-1); + } + break; default: - (void) fprintf(stderr, "%s", err10); - return(-1); - } - return (0); + (void) HDfprintf(stderr, "%s", err10); + HDfclose(strm); + return (-1); + } + HDfclose(strm); + return (0); } -static int -readIntegerData(FILE **strm, struct Input *in) +static int readIntegerData(FILE *strm, struct Input *in) { - H5DT_INT8 *in08; - H5DT_INT16 *in16, temp; - H5DT_INT32 *in32; -#ifndef WIN32 - H5DT_INT64 *in64; - char buffer[256]; + H5DT_INT8 *in08; + H5DT_INT16 *in16; + H5DT_INT16 temp; + H5DT_INT32 *in32; +#ifdef H5_SIZEOF_LONG_LONG + H5DT_INT64 *in64; + char buffer[256]; #endif - hsize_t len=1; - hsize_t i; - int j; + hsize_t len = 1; + hsize_t i; + int j; - const char *err1 = "Unable to get integer value from file.\n"; - const char *err2 = "Unrecognized input class type.\n"; - const char *err3 = "Invalid input size.\n"; + const char *err1 = "Unable to get integer value from file.\n"; + const char *err2 = "Unrecognized input class type.\n"; + const char *err3 = "Invalid input size.\n"; - for (j=0; jrank;j++) - len *= in->sizeOfDimension[j]; + for (j = 0; j < in->rank; j++) + len *= in->sizeOfDimension[j]; - switch(in->inputSize) - { + switch (in->inputSize) { case 8: - switch(in->inputClass) - { + switch (in->inputClass) { case 0: /* TEXTIN */ - in08 = (H5DT_INT8 *) in->data; - for (i = 0; i < len; i++, in08++) - { - if (fscanf(*strm, "%hd", &temp) != 1) - { - (void) fprintf(stderr, "%s", err1); - return (-1); + in08 = (H5DT_INT8 *) in->data; + for (i = 0; i < len; i++, in08++) { + if (fscanf(strm, "%hd", &temp) != 1) { + (void) HDfprintf(stderr, "%s", err1); + return (-1); + } + (*in08) = (H5DT_INT8) temp; } - (*in08) = (H5DT_INT8)temp; - } - break; + break; case 4: /* IN */ - in08 = (H5DT_INT8 *) in->data; - for (i = 0; i < len; i++, in08++) - { - if (fread((char *) in08, sizeof(H5DT_INT8), 1, *strm) != 1) - { - (void) fprintf(stderr, "%s", err1); - return (-1); + in08 = (H5DT_INT8 *) in->data; + for (i = 0; i < len; i++, in08++) { + if (HDfread((char *) in08, sizeof(H5DT_INT8), 1, strm) != 1) { + (void) HDfprintf(stderr, "%s", err1); + return (-1); + } } - } - break; + break; default: - (void) fprintf(stderr, "%s", err2); - return (-1); - } - break; + (void) HDfprintf(stderr, "%s", err2); + return (-1); + } + break; case 16: - in16 = (H5DT_INT16 *) in->data; - switch(in->inputClass) - { + in16 = (H5DT_INT16 *) in->data; + switch (in->inputClass) { case 0: /* TEXTIN */ - for (i = 0; i < len; i++, in16++) - { - if (fscanf(*strm, "%hd", in16) != 1) - { - (void) fprintf(stderr, "%s", err1); - return (-1); + for (i = 0; i < len; i++, in16++) { + if (fscanf(strm, "%hd", in16) != 1) { + (void) HDfprintf(stderr, "%s", err1); + return (-1); + } } - } - in16 = (H5DT_INT16 *) in->data; - break; + in16 = (H5DT_INT16 *) in->data; + break; case 4: /* IN */ - for (i = 0; i < len; i++, in16++) - { - if (fread((char *) in16, sizeof(H5DT_INT16), 1, *strm) != 1) - { - (void) fprintf(stderr, "%s", err1); - return (-1); + for (i = 0; i < len; i++, in16++) { + if (HDfread((char *) in16, sizeof(H5DT_INT16), 1, strm) != 1) { + (void) HDfprintf(stderr, "%s", err1); + return (-1); + } } - } - break; + break; default: - (void) fprintf(stderr, "%s", err2); - return (-1); - } - break; + (void) HDfprintf(stderr, "%s", err2); + return (-1); + } + break; case 32: - in32 = (H5DT_INT32 *) in->data; - switch(in->inputClass) - { + in32 = (H5DT_INT32 *) in->data; + switch (in->inputClass) { case 0: /* TEXTIN */ - for (i = 0; i < len; i++, in32++) - { - if (fscanf(*strm, "%d", in32) != 1) - { - (void) fprintf(stderr, "%s", err1); - return (-1); + for (i = 0; i < len; i++, in32++) { + if (fscanf(strm, "%d", in32) != 1) { + (void) HDfprintf(stderr, "%s", err1); + return (-1); + } } - } - break; + break; case 4: /* IN */ - for (i = 0; i < len; i++, in32++) - { - if (fread((char *) in32, sizeof(H5DT_INT32), 1, *strm) != 1) - { - (void) fprintf(stderr, "%s", err1); - return (-1); + for (i = 0; i < len; i++, in32++) { + if (HDfread((char *) in32, sizeof(H5DT_INT32), 1, strm) != 1) { + (void) HDfprintf(stderr, "%s", err1); + return (-1); + } } - } - break; + break; default: - (void) fprintf(stderr, "%s", err2); - return (-1); - } - break; + (void) HDfprintf(stderr, "%s", err2); + return (-1); + } + break; -#ifndef _WIN32 +#ifdef H5_SIZEOF_LONG_LONG case 64: - in64 = (H5DT_INT64 *) in->data; - switch(in->inputClass) - { + in64 = (H5DT_INT64 *) in->data; + switch (in->inputClass) { case 0: /* TEXTIN */ - for (i = 0; i < len; i++, in64++) - { - if (fscanf(*strm, "%s", buffer) < 1) - { - (void) fprintf(stderr, "%s", err1); - return (-1); + for (i = 0; i < len; i++, in64++) { + if (fscanf(strm, "%s", buffer) < 1) { + (void) HDfprintf(stderr, "%s", err1); + return (-1); + } + *in64 = (H5DT_INT64) HDstrtoll(buffer, NULL, 10); } - *in64 = (H5DT_INT64) HDstrtoll(buffer, NULL, 10); - } - break; + break; case 4: /* IN */ - for (i = 0; i < len; i++, in64++) - { - if (fread((char *) in64, sizeof(H5DT_INT64), 1, *strm) != 1) - { - (void) fprintf(stderr, "%s", err1); - return (-1); + for (i = 0; i < len; i++, in64++) { + if (HDfread((char *) in64, sizeof(H5DT_INT64), 1, strm) != 1) { + (void) HDfprintf(stderr, "%s", err1); + return (-1); + } } - } - break; + break; default: - (void) fprintf(stderr, "%s", err2); - return (-1); - } - break; -#endif /* ifndef _WIN32 */ + (void) HDfprintf(stderr, "%s", err2); + return (-1); + } + break; +#endif /* ifdef H5_SIZEOF_LONG_LONG */ default: - (void) fprintf(stderr, "%s", err3); - break; - } - return(0); + (void) HDfprintf(stderr, "%s", err3); + break; + } + return (0); } -static int -readUIntegerData(FILE **strm, struct Input *in) +static int readUIntegerData(FILE *strm, struct Input *in) { - H5DT_UINT8 *in08; - H5DT_UINT16 *in16, temp; - H5DT_UINT32 *in32; -#ifndef _WIN32 - H5DT_UINT64 *in64; - char buffer[256]; + H5DT_UINT8 *in08; + H5DT_UINT16 *in16; + H5DT_UINT16 temp; + H5DT_UINT32 *in32; +#ifdef H5_SIZEOF_LONG_LONG + H5DT_UINT64 *in64; + char buffer[256]; #endif - hsize_t len=1; - hsize_t i; - int j; - const char *err1 = "Unable to get unsigned integer value from file.\n"; - const char *err2 = "Unrecognized input class type.\n"; - const char *err3 = "Invalid input size.\n"; - - for (j=0; jrank;j++) - len *= in->sizeOfDimension[j]; - - switch(in->inputSize) - { + hsize_t len = 1; + hsize_t i; + int j; + const char *err1 = "Unable to get unsigned integer value from file.\n"; + const char *err2 = "Unrecognized input class type.\n"; + const char *err3 = "Invalid input size.\n"; + + for (j = 0; j < in->rank; j++) + len *= in->sizeOfDimension[j]; + + switch (in->inputSize) { case 8: - switch(in->inputClass) - { + switch (in->inputClass) { case 6: /* TEXTUIN */ - in08 = (H5DT_UINT8 *) in->data; - for (i = 0; i < len; i++, in08++) - { - if (fscanf(*strm, "%hu", &temp) != 1) - { - (void) fprintf(stderr, "%s", err1); - return (-1); + in08 = (H5DT_UINT8 *) in->data; + for (i = 0; i < len; i++, in08++) { + if (fscanf(strm, "%hu", &temp) != 1) { + (void) HDfprintf(stderr, "%s", err1); + return (-1); + } + (*in08) = (H5DT_UINT8) temp; } - (*in08) = (H5DT_UINT8)temp; - } - break; + break; case 7: /* UIN */ - in08 = (H5DT_UINT8 *) in->data; - for (i = 0; i < len; i++, in08++) - { - if (fread((char *) in08, sizeof(H5DT_UINT8), 1, *strm) != 1) - { - (void) fprintf(stderr, "%s", err1); - return (-1); + in08 = (H5DT_UINT8 *) in->data; + for (i = 0; i < len; i++, in08++) { + if (HDfread((char *) in08, sizeof(H5DT_UINT8), 1, strm) != 1) { + (void) HDfprintf(stderr, "%s", err1); + return (-1); + } } - } - break; + break; default: - (void) fprintf(stderr, "%s", err2); - return (-1); - } - break; + (void) HDfprintf(stderr, "%s", err2); + return (-1); + } + break; case 16: - in16 = (H5DT_UINT16 *) in->data; - switch(in->inputClass) - { + in16 = (H5DT_UINT16 *) in->data; + switch (in->inputClass) { case 6: /* TEXTUIN */ - for (i = 0; i < len; i++, in16++) - { - if (fscanf(*strm, "%hu", in16) != 1) - { - (void) fprintf(stderr, "%s", err1); - return (-1); + for (i = 0; i < len; i++, in16++) { + if (fscanf(strm, "%hu", in16) != 1) { + (void) HDfprintf(stderr, "%s", err1); + return (-1); + } } - } - break; + break; case 7: /* UIN */ - for (i = 0; i < len; i++, in16++) - { - if (fread((char *) in16, sizeof(H5DT_UINT16), 1, *strm) != 1) - { - (void) fprintf(stderr, "%s", err1); - return (-1); + for (i = 0; i < len; i++, in16++) { + if (HDfread((char *) in16, sizeof(H5DT_UINT16), 1, strm) != 1) { + (void) HDfprintf(stderr, "%s", err1); + return (-1); + } } - } - break; + break; default: - (void) fprintf(stderr, "%s", err2); - return (-1); - } - break; + (void) HDfprintf(stderr, "%s", err2); + return (-1); + } + break; case 32: - in32 = (H5DT_UINT32 *) in->data; - switch(in->inputClass) - { + in32 = (H5DT_UINT32 *) in->data; + switch (in->inputClass) { case 6: /* TEXTUIN */ - for (i = 0; i < len; i++, in32++) - { - if (fscanf(*strm, "%u", in32) != 1) - { - (void) fprintf(stderr, "%s", err1); - return (-1); + for (i = 0; i < len; i++, in32++) { + if (fscanf(strm, "%u", in32) != 1) { + (void) HDfprintf(stderr, "%s", err1); + return (-1); + } } - } - break; + break; case 7: /* UIN */ - for (i = 0; i < len; i++, in32++) - { - if (fread((char *) in32, sizeof(H5DT_UINT32), 1, *strm) != 1) - { - (void) fprintf(stderr, "%s", err1); - return (-1); + for (i = 0; i < len; i++, in32++) { + if (HDfread((char *) in32, sizeof(H5DT_UINT32), 1, strm) != 1) { + (void) HDfprintf(stderr, "%s", err1); + return (-1); + } } - } - break; + break; default: - (void) fprintf(stderr, "%s", err2); - return (-1); - } - break; + (void) HDfprintf(stderr, "%s", err2); + return (-1); + } + break; -#ifndef _WIN32 +#ifdef H5_SIZEOF_LONG_LONG case 64: - in64 = (H5DT_UINT64 *) in->data; - switch(in->inputClass) - { + in64 = (H5DT_UINT64 *) in->data; + switch (in->inputClass) { case 6: /* TEXTUIN */ - for (i = 0; i < len; i++, in64++) - { - if (fscanf(*strm, "%s", buffer) < 1) - { - (void) fprintf(stderr, "%s", err1); - return (-1); + for (i = 0; i < len; i++, in64++) { + if (fscanf(strm, "%s", buffer) < 1) { + (void) HDfprintf(stderr, "%s", err1); + return (-1); + } + *in64 = (H5DT_UINT64) HDstrtoll(buffer, NULL, 10); } - *in64 = (H5DT_UINT64) HDstrtoll(buffer, NULL, 10); - } - break; + break; case 7: /* UIN */ - for (i = 0; i < len; i++, in64++) - { - if (fread((char *) in64, sizeof(H5DT_UINT64), 1, *strm) != 1) - { - (void) fprintf(stderr, "%s", err1); - return (-1); + for (i = 0; i < len; i++, in64++) { + if (HDfread((char *) in64, sizeof(H5DT_UINT64), 1, strm) != 1) { + (void) HDfprintf(stderr, "%s", err1); + return (-1); + } } - } - break; + break; default: - (void) fprintf(stderr, "%s", err2); - return (-1); - } - break; -#endif /* ifndef _WIN32 */ + (void) HDfprintf(stderr, "%s", err2); + return (-1); + } + break; +#endif /* ifdef H5_SIZEOF_LONG_LONG */ default: - (void) fprintf(stderr, "%s", err3); - break; - } - return(0); + (void) HDfprintf(stderr, "%s", err3); + break; + } + return (0); } -static int -readFloatData(FILE **strm, struct Input *in) +static int readFloatData(FILE *strm, struct Input *in) { - H5DT_FLOAT32 *fp32; - H5DT_FLOAT64 *fp64; + H5DT_FLOAT32 *fp32; + H5DT_FLOAT64 *fp64; - hsize_t len=1; - hsize_t i; - int j; - const char *err1 = "Unable to get integer value from file.\n"; - const char *err2 = "Unrecognized input class type.\n"; - const char *err3 = "Invalid input size type.\n"; + hsize_t len = 1; + hsize_t i; + int j; + const char *err1 = "Unable to get integer value from file.\n"; + const char *err2 = "Unrecognized input class type.\n"; + const char *err3 = "Invalid input size type.\n"; - for (j=0; jrank;j++) - len *= in->sizeOfDimension[j]; + for (j = 0; j < in->rank; j++) + len *= in->sizeOfDimension[j]; - switch(in->inputSize) - { + switch (in->inputSize) { case 32: - fp32 = (H5DT_FLOAT32 *) in->data; - switch(in->inputClass) - { + fp32 = (H5DT_FLOAT32 *) in->data; + switch (in->inputClass) { case 1: /* TEXTFP */ - for (i = 0; i < len; i++, fp32++) - { - if (fscanf(*strm, "%f", fp32) != 1) - { - (void) fprintf(stderr, "%s", err1); - return (-1); + for (i = 0; i < len; i++, fp32++) { + if (fscanf(strm, "%f", fp32) != 1) { + (void) HDfprintf(stderr, "%s", err1); + return (-1); + } } - } - fp32 = (H5DT_FLOAT32 *) in->data; - break; + fp32 = (H5DT_FLOAT32 *) in->data; + break; - /* same as TEXTFP */ + /* same as TEXTFP */ case 2: /*TEXTFPE */ - for (i = 0; i < len; i++, fp32++) - { - if (fscanf(*strm, "%f", fp32) != 1) - { - (void) fprintf(stderr, "%s", err1); + for (i = 0; i < len; i++, fp32++) { + if (fscanf(strm, "%f", fp32) != 1) { + (void) HDfprintf(stderr, "%s", err1); return (-1); } } @@ -786,47 +731,40 @@ readFloatData(FILE **strm, struct Input *in) break; case 3: /* FP */ - for (i = 0; i < len; i++, fp32++) - { - if (fread((char *) fp32, sizeof(H5DT_FLOAT32), 1, *strm) != 1) - { - (void) fprintf(stderr, "%s", err1); - return (-1); + for (i = 0; i < len; i++, fp32++) { + if (HDfread((char *) fp32, sizeof(H5DT_FLOAT32), 1, strm) != 1) { + (void) HDfprintf(stderr, "%s", err1); + return (-1); + } } - } - break; + break; default: - (void) fprintf(stderr, "%s", err2); - return (-1); - } - break; + (void) HDfprintf(stderr, "%s", err2); + return (-1); + } + break; case 64: - fp64 = (H5DT_FLOAT64 *) in->data; - switch(in->inputClass) - { + fp64 = (H5DT_FLOAT64 *) in->data; + switch (in->inputClass) { case 1: /* TEXTFP */ - for (i = 0; i < len; i++, fp64++) - { - if (fscanf(*strm, "%lf", fp64) != 1) - { - (void) fprintf(stderr, "%s", err1); - return (-1); + for (i = 0; i < len; i++, fp64++) { + if (fscanf(strm, "%lf", fp64) != 1) { + (void) HDfprintf(stderr, "%s", err1); + return (-1); + } } - } - fp64 = (H5DT_FLOAT64 *) in->data; - break; + fp64 = (H5DT_FLOAT64 *) in->data; + break; - /* same as TEXTFP */ + /* same as TEXTFP */ case 2: /*TEXTFPE */ - for (i = 0; i < len; i++, fp64++) - { - if (fscanf(*strm, "%lf", fp64) != 1) - { - (void) fprintf(stderr, "%s", err1); + for (i = 0; i < len; i++, fp64++) { + if (fscanf(strm, "%lf", fp64) != 1) { + (void) HDfprintf(stderr, "%s", err1); return (-1); } } @@ -835,31 +773,27 @@ readFloatData(FILE **strm, struct Input *in) break; case 3: /* FP */ - for (i = 0; i < len; i++, fp64++) - { - if (fread((char *) fp64, sizeof(H5DT_FLOAT64), 1, *strm) != 1) - { - (void) fprintf(stderr, "%s", err1); - return (-1); + for (i = 0; i < len; i++, fp64++) { + if (HDfread((char *) fp64, sizeof(H5DT_FLOAT64), 1, strm) != 1) { + (void) HDfprintf(stderr, "%s", err1); + return (-1); + } } - } - break; + break; default: - (void) fprintf(stderr, "%s", err2); - return (-1); - } - break; + (void) HDfprintf(stderr, "%s", err2); + return (-1); + } + break; default: - (void) fprintf(stderr, "%s", err3); - break; - } - return(0); + (void) HDfprintf(stderr, "%s", err3); + break; + } + return (0); } - - /*------------------------------------------------------------------------- * Function: processStrData * @@ -874,63 +808,66 @@ readFloatData(FILE **strm, struct Input *in) * *------------------------------------------------------------------------- */ -static int -processStrData(FILE **strm, struct Input *in, hid_t file_id) +static int processStrData(FILE *strm, struct Input *in, hid_t file_id) { - hid_t group_id, dset_id, space_id, mspace_id, type_id, handle; + hid_t group_id; + hid_t dset_id; + hid_t space_id; + hid_t mspace_id; + hid_t type_id; + hid_t handle; hsize_t dims[1]; char str[1024]; char c; - int i = 0, j, nlines = 0, line; + int i = 0; + int j; + int nlines = 0; + int line; -/*------------------------------------------------------------------------- - * get number of lines in the input file - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * get number of lines in the input file + *------------------------------------------------------------------------- + */ - while ( !feof( *strm ) ) - { - c = fgetc( *strm ); + while (!HDfeof(strm)) { + c = HDfgetc(strm); - if ( c == 10 ) /* eol */ - { + if (c == 10) { /* eol */ nlines++; - } } - if ( !nlines ) + if (!nlines) return 0; /* number of records */ dims[0] = nlines; /* rewind */ - fseek(*strm,0L,0); + HDfseek(strm, 0L, 0); -/*------------------------------------------------------------------------- - * read file again and generate an HDF5 dataset - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * read file again and generate an HDF5 dataset + *------------------------------------------------------------------------- + */ - if (( type_id = H5Tcopy(H5T_C_S1)) < 0 ) + if ((type_id = H5Tcopy(H5T_C_S1)) < 0) goto out; - if ( H5Tset_size (type_id,H5T_VARIABLE) < 0 ) + if (H5Tset_size(type_id, H5T_VARIABLE) < 0) goto out; /* disable error reporting */ - H5E_BEGIN_TRY + H5E_BEGIN_TRY { - /* create parent groups */ - if(in->path.count > 1) { + if (in->path.count > 1) { j = 0; handle = file_id; - while(j < in->path.count - 1) { - if((group_id = H5Gopen2(handle, in->path.group[j], H5P_DEFAULT)) < 0) { + while (j < in->path.count - 1) { + if ((group_id = H5Gopen2(handle, in->path.group[j], H5P_DEFAULT)) < 0) { group_id = H5Gcreate2(handle, in->path.group[j++], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - for(; j < in->path.count - 1; j++) + for (; j < in->path.count - 1; j++) group_id = H5Gcreate2(group_id, in->path.group[j], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); handle = group_id; break; @@ -945,1500 +882,1355 @@ processStrData(FILE **strm, struct Input *in, hid_t file_id) } /*enable error reporting */ - } H5E_END_TRY; + } + H5E_END_TRY; - if((space_id = H5Screate_simple(1, dims, NULL)) < 0) + if ((space_id = H5Screate_simple(1, dims, NULL)) < 0) goto out; - if((mspace_id = H5Screate(H5S_SCALAR)) < 0) + if ((mspace_id = H5Screate(H5S_SCALAR)) < 0) goto out; - if((dset_id = H5Dcreate2(handle, in->path.group[j], type_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if ((dset_id = H5Dcreate2(handle, in->path.group[j], type_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; line = 0; - while(!feof(*strm)) { - c = fgetc(*strm); + while (!HDfeof(strm)) { + c = HDfgetc(strm); str[i] = c; i++; - if(c == 10) /* eol */ - { - char *str2 = str; - hid_t fspace_id; + if (c == 10) { /* eol */ + char *str2 = str; + hid_t fspace_id; hsize_t start[1]; hsize_t count[1] = { 1 }; - str[ i-1 ] = '\0'; /* terminate string */ + str[i - 1] = '\0'; /* terminate string */ - if (( fspace_id = H5Dget_space (dset_id)) < 0 ) + if ((fspace_id = H5Dget_space(dset_id)) < 0) goto out; - start[0] = line ++ ; + start[0] = line++; - if ( H5Sselect_hyperslab(fspace_id,H5S_SELECT_SET,start,NULL,count,NULL) < 0 ) + if (H5Sselect_hyperslab(fspace_id, H5S_SELECT_SET, start, NULL, count, NULL) < 0) goto out; - if ( H5Dwrite(dset_id,type_id,mspace_id,fspace_id,H5P_DEFAULT, &str2 ) < 0 ) + if (H5Dwrite(dset_id, type_id, mspace_id, fspace_id, H5P_DEFAULT, &str2) < 0) goto out; - if ( H5Sclose(fspace_id) < 0 ) + if (H5Sclose(fspace_id) < 0) goto out; i = 0; - str[ 0 ] = '\0'; + str[0] = '\0'; } } - /* close */ H5Dclose(dset_id); H5Sclose(space_id); H5Sclose(mspace_id); H5Tclose(type_id); - return(0); + return (0); out: return (-1); } - -static int -allocateIntegerStorage(struct Input *in) +static int allocateIntegerStorage(struct Input *in) { - hsize_t len=1; - int j; - const char *err1 = "Unable to allocate dynamic memory.\n"; - const char *err2 = "Invalid storage size for integer input data.\n"; + hsize_t len = 1; + int j; + const char *err1 = "Unable to allocate dynamic memory.\n"; + const char *err2 = "Invalid storage size for integer input data.\n"; - for (j=0; jrank;j++) - len *= in->sizeOfDimension[j]; + for (j = 0; j < in->rank; j++) + len *= in->sizeOfDimension[j]; - switch(in->inputSize) - { + switch (in->inputSize) { case 8: - if ((in->data = (VOIDP) HDmalloc((size_t) len * sizeof(H5DT_INT8))) == NULL) - { - (void) fprintf(stderr, "%s", err1); - return (-1); - } - break; + if ((in->data = (VOIDP) HDmalloc((size_t) len * sizeof(H5DT_INT8))) == NULL) { + (void) HDfprintf(stderr, "%s", err1); + return (-1); + } + break; case 16: - if ((in->data = (VOIDP) HDmalloc((size_t) len * sizeof(H5DT_INT16))) == NULL) - { - (void) fprintf(stderr, "%s", err1); - return (-1); - } - break; + if ((in->data = (VOIDP) HDmalloc((size_t) len * sizeof(H5DT_INT16))) == NULL) { + (void) HDfprintf(stderr, "%s", err1); + return (-1); + } + break; case 32: - if ((in->data = (VOIDP) HDmalloc((size_t) len * sizeof(H5DT_INT32))) == NULL) - { - (void) fprintf(stderr, "%s", err1); - return (-1); - } - break; + if ((in->data = (VOIDP) HDmalloc((size_t) len * sizeof(H5DT_INT32))) == NULL) { + (void) HDfprintf(stderr, "%s", err1); + return (-1); + } + break; case 64: - if ((in->data = (VOIDP) HDmalloc((size_t) len * sizeof(H5DT_INT64))) == NULL) - { - (void) fprintf(stderr, "%s", err1); - return (-1); - } - break; + if ((in->data = (VOIDP) HDmalloc((size_t) len * sizeof(H5DT_INT64))) == NULL) { + (void) HDfprintf(stderr, "%s", err1); + return (-1); + } + break; default: - (void) fprintf(stderr, "%s", err2); - break; - } - return(0); + (void) HDfprintf(stderr, "%s", err2); + break; + } + return (0); } static int allocateUIntegerStorage(struct Input *in) { - hsize_t len=1; - const char *err1 = "Unable to allocate dynamic memory.\n"; - const char *err2 = "Invalid storage size for unsigned integer input data.\n"; - int j; + hsize_t len = 1; + const char *err1 = "Unable to allocate dynamic memory.\n"; + const char *err2 = "Invalid storage size for unsigned integer input data.\n"; + int j; - for (j=0; jrank;j++) - len *= in->sizeOfDimension[j]; + for (j = 0; j < in->rank; j++) + len *= in->sizeOfDimension[j]; - switch(in->inputSize) - { + switch (in->inputSize) { case 8: - if ((in->data = (VOIDP) HDmalloc((size_t) len * sizeof(H5DT_UINT8))) == NULL) - { - (void) fprintf(stderr, "%s", err1); - return (-1); - } - break; + if ((in->data = (VOIDP) HDmalloc((size_t) len * sizeof(H5DT_UINT8))) == NULL) { + (void) HDfprintf(stderr, "%s", err1); + return (-1); + } + break; case 16: - if ((in->data = (VOIDP) HDmalloc((size_t) len * sizeof(H5DT_UINT16))) == NULL) - { - (void) fprintf(stderr, "%s", err1); - return (-1); - } - break; + if ((in->data = (VOIDP) HDmalloc((size_t) len * sizeof(H5DT_UINT16))) == NULL) { + (void) HDfprintf(stderr, "%s", err1); + return (-1); + } + break; case 32: - if ((in->data = (VOIDP) HDmalloc((size_t) len * sizeof(H5DT_UINT32))) == NULL) - { - (void) fprintf(stderr, "%s", err1); - return (-1); - } - break; + if ((in->data = (VOIDP) HDmalloc((size_t) len * sizeof(H5DT_UINT32))) == NULL) { + (void) HDfprintf(stderr, "%s", err1); + return (-1); + } + break; case 64: - if ((in->data = (VOIDP) HDmalloc((size_t) len * sizeof(H5DT_UINT64))) == NULL) - { - (void) fprintf(stderr, "%s", err1); - return (-1); - } - break; + if ((in->data = (VOIDP) HDmalloc((size_t) len * sizeof(H5DT_UINT64))) == NULL) { + (void) HDfprintf(stderr, "%s", err1); + return (-1); + } + break; default: - (void) fprintf(stderr, "%s", err2); - break; - } - return(0); + (void) HDfprintf(stderr, "%s", err2); + break; + } + return (0); } -static int -allocateFloatStorage(struct Input *in) +static int allocateFloatStorage(struct Input *in) { - hsize_t len = 1; - int j; - const char *err1 = "Unable to allocate dynamic memory.\n"; - const char *err2 = "Invalid storage size for float input data.\n"; + hsize_t len = 1; + int j; + const char *err1 = "Unable to allocate dynamic memory.\n"; + const char *err2 = "Invalid storage size for float input data.\n"; - for (j=0; jrank;j++) - len *= in->sizeOfDimension[j]; + for (j = 0; j < in->rank; j++) + len *= in->sizeOfDimension[j]; - switch(in->inputSize) - { + switch (in->inputSize) { case 32: - if ((in->data = (VOIDP) HDmalloc((size_t) len * sizeof(H5DT_FLOAT32))) == NULL) - { - (void) fprintf(stderr, "%s", err1); - return (-1); - } - break; + if ((in->data = (VOIDP) HDmalloc((size_t) len * sizeof(H5DT_FLOAT32))) == NULL) { + (void) HDfprintf(stderr, "%s", err1); + return (-1); + } + break; case 64: - if ((in->data = (VOIDP) HDmalloc((size_t) len * sizeof(H5DT_FLOAT64))) == NULL) - { - (void) fprintf(stderr, "%s", err1); - return (-1); - } - break; + if ((in->data = (VOIDP) HDmalloc((size_t) len * sizeof(H5DT_FLOAT64))) == NULL) { + (void) HDfprintf(stderr, "%s", err1); + return (-1); + } + break; default: - (void) fprintf(stderr, "%s", err2); - break; - } - return(0); + (void) HDfprintf(stderr, "%s", err2); + break; + } + return (0); } -static int -processConfigurationFile(char *infile, struct Input *in, FILE **strm) +static int processConfigurationFile(char *infile, struct Input *in) { - char key[255]; - int kindex; - char temp[255]; - int ival; - - const char *err1 = "Unable to open the configuration file: %s for reading.\n"; - const char *err2 = "Unknown keyword in configuration file: %s\n"; - const char *err3a = "PATH keyword appears twice in %s.\n"; - const char *err3b = "Error in parsing the path information from %s.\n"; - const char *err4a = "INPUT-CLASS keyword appears twice in %s.\n"; - const char *err4b = "Error in retrieving the input class from %s.\n"; - const char *err5a = "INPUT-SIZE keyword appears twice in %s.\n"; - const char *err5b = "Error in retrieving the input size from %s.\n"; - const char *err6a = "RANK keyword appears twice in %s.\n"; - const char *err6b = "Error in retrieving the rank from %s.\n"; - const char *err7a = "DIMENSION-SIZES keyword appears twice in %s.\n"; - const char *err7b = "DIMENSION-SIZES cannot appear before RANK is provided.\n"; - const char *err7c = "Error in retrieving the dimension sizes from %s.\n"; - const char *err8a = "OUTPUT-CLASS keyword appears twice in %s.\n"; - const char *err8b = "Error in retrieving the output class from %s.\n"; - const char *err9a = "OUTPUT-SIZE keyword appears twice in %s.\n"; - const char *err9b = "Error in retrieving the output size from %s.\n"; - const char *err10a = "OUTPUT-ARCHITECTURE keyword appears twice in %s.\n"; - const char *err10b = "Error in retrieving the output architecture from %s.\n"; - const char *err11a = "OUTPUT-BYTE-ORDER keyword appears twice in %s.\n"; - const char *err11b = "Error in retrieving the output byte order from %s.\n"; - const char *err12a = "CHUNKED-DIMENSION-SIZES keyword appears twice in %s.\n"; - const char *err12b = "CHUNKED-DIMENSION-SIZES cannot appear before DIMENSION-SIZES are provided.\n"; - const char *err12c = "Error in retrieving the chunked dimension sizes from %s.\n"; - const char *err13a = "COMPRESSION-TYPE keyword appears twice in %s.\n"; - const char *err13b = "Error in retrieving the compression type from %s.\n"; - const char *err14a = "COMPRESSION-PARAM keyword appears twice in %s.\n"; - const char *err14b = "Error in retrieving the compression parameter from %s.\n"; - const char *err15a = "EXTERNAL-STORAGE keyword appears twice in %s.\n"; - const char *err15b = "Error in retrieving the external storage paramters from %s.\n"; - const char *err16a = "MAXIMUM-DIMENSIONS keyword appears twice in %s.\n"; - const char *err16b = "MAXIMUM-DIMENSIONS cannot appear before DIMENSION-SIZES are provided.\n"; - const char *err16c = "Error in retrieving the maximum dimension sizes from %s.\n"; - const char *err17 = "Configuration parameters are invalid in %s.\n"; - const char *err18 = "Unable to get string value.\n"; - const char *err19 = "Unable to get integer value.\n"; - - /* create vector to map which keywords have been found - check vector after each keyword to check for violation - at the end check vector to see if required fields have been provided - process the output file according to the options - */ - - if ((*strm = fopen(infile, "r")) == NULL) - { - (void) fprintf(stderr, err1, infile); - return (-1); - } - - while (fscanf(*strm, "%s", key) == 1) - { - if ((kindex = mapKeywordToIndex(key)) == -1) - { - (void) fprintf(stderr, err2, infile); - return (-1); + FILE *strm; + char key[255]; + int kindex; + char temp[255]; + int ival; + + const char *err1 = "Unable to open the configuration file: %s for reading.\n"; + const char *err2 = "Unknown keyword in configuration file: %s\n"; + const char *err3a = "PATH keyword appears twice in %s.\n"; + const char *err3b = "Error in parsing the path information from %s.\n"; + const char *err4a = "INPUT-CLASS keyword appears twice in %s.\n"; + const char *err4b = "Error in retrieving the input class from %s.\n"; + const char *err5a = "INPUT-SIZE keyword appears twice in %s.\n"; + const char *err5b = "Error in retrieving the input size from %s.\n"; + const char *err6a = "RANK keyword appears twice in %s.\n"; + const char *err6b = "Error in retrieving the rank from %s.\n"; + const char *err7a = "DIMENSION-SIZES keyword appears twice in %s.\n"; + const char *err7b = "DIMENSION-SIZES cannot appear before RANK is provided.\n"; + const char *err7c = "Error in retrieving the dimension sizes from %s.\n"; + const char *err8a = "OUTPUT-CLASS keyword appears twice in %s.\n"; + const char *err8b = "Error in retrieving the output class from %s.\n"; + const char *err9a = "OUTPUT-SIZE keyword appears twice in %s.\n"; + const char *err9b = "Error in retrieving the output size from %s.\n"; + const char *err10a = "OUTPUT-ARCHITECTURE keyword appears twice in %s.\n"; + const char *err10b = "Error in retrieving the output architecture from %s.\n"; + const char *err11a = "OUTPUT-BYTE-ORDER keyword appears twice in %s.\n"; + const char *err11b = "Error in retrieving the output byte order from %s.\n"; + const char *err12a = "CHUNKED-DIMENSION-SIZES keyword appears twice in %s.\n"; + const char *err12b = "CHUNKED-DIMENSION-SIZES cannot appear before DIMENSION-SIZES are provided.\n"; + const char *err12c = "Error in retrieving the chunked dimension sizes from %s.\n"; + const char *err13a = "COMPRESSION-TYPE keyword appears twice in %s.\n"; + const char *err13b = "Error in retrieving the compression type from %s.\n"; + const char *err14a = "COMPRESSION-PARAM keyword appears twice in %s.\n"; + const char *err14b = "Error in retrieving the compression parameter from %s.\n"; + const char *err15a = "EXTERNAL-STORAGE keyword appears twice in %s.\n"; + const char *err15b = "Error in retrieving the external storage paramters from %s.\n"; + const char *err16a = "MAXIMUM-DIMENSIONS keyword appears twice in %s.\n"; + const char *err16b = "MAXIMUM-DIMENSIONS cannot appear before DIMENSION-SIZES are provided.\n"; + const char *err16c = "Error in retrieving the maximum dimension sizes from %s.\n"; + const char *err17 = "Configuration parameters are invalid in %s.\n"; + const char *err18 = "Unable to get string value.\n"; + const char *err19 = "Unable to get integer value.\n"; + + /* create vector to map which keywords have been found + check vector after each keyword to check for violation + at the end check vector to see if required fields have been provided + process the output file according to the options + */ + + if ((strm = HDfopen(infile, "r")) == NULL) { + (void) HDfprintf(stderr, err1, infile); + return (-1); } - switch (kindex) - { - case 0: /* PATH */ - if (in->configOptionVector[PATH] == 1) - { - (void) fprintf(stderr, err3a, infile); - return (-1); - } - if (fscanf(*strm, "%s", temp) != 1) - { - (void) fprintf(stderr, "%s", err18); - return (-1); - } - if (parsePathInfo(&in->path, temp) == -1) - { - (void) fprintf(stderr, err3b, infile); - return (-1); - } - in->configOptionVector[PATH] = 1; - break; - - case 1: /* INPUT-CLASS */ - if (in->configOptionVector[INPUT_CLASS] == 1) - { - (void) fprintf(stderr, err4a, infile); - return (-1); - } - if (fscanf(*strm, "%s", temp) != 1) - { - (void) fprintf(stderr, "%s", err18); - return (-1); - } - if (getInputClass(in, temp) == -1) - { - (void) fprintf(stderr, err4b, infile); - return (-1); + while (fscanf(strm, "%s", key) == 1) { + if ((kindex = mapKeywordToIndex(key)) == -1) { + (void) HDfprintf(stderr, err2, infile); + HDfclose(strm); + return (-1); } + switch (kindex) { + case 0: /* PATH */ + if (in->configOptionVector[PATH] == 1) { + (void) HDfprintf(stderr, err3a, infile); + HDfclose(strm); + return (-1); + } + if (fscanf(strm, "%s", temp) != 1) { + (void) HDfprintf(stderr, "%s", err18); + HDfclose(strm); + return (-1); + } + if (parsePathInfo(&in->path, temp) == -1) { + (void) HDfprintf(stderr, err3b, infile); + HDfclose(strm); + return (-1); + } + in->configOptionVector[PATH] = 1; + break; - in->configOptionVector[INPUT_CLASS] = 1; - - /*set default value for output-class */ - if (in->configOptionVector[OUTPUT_CLASS] == 0) - { - if (in->inputClass == 0 || in->inputClass == 4) - in->outputClass = 0; - if (in->inputClass == 1 || in->inputClass == 2 || in->inputClass == 3) - in->outputClass = 1; - if (in->inputClass == 6 || in->inputClass == 7) - in->outputClass = 2; - } - break; + case 1: /* INPUT-CLASS */ + if (in->configOptionVector[INPUT_CLASS] == 1) { + (void) HDfprintf(stderr, err4a, infile); + HDfclose(strm); + return (-1); + } - case 2: /* INPUT-SIZE */ - if (in->configOptionVector[INPUT_SIZE] == 1) - { - (void) fprintf(stderr, err5a, infile); - return (-1); - } - if (fscanf(*strm, "%d", (&ival)) != 1) - { - (void) fprintf(stderr, "%s", err19); - return (-1); - } - if (getInputSize(in, ival) == -1) - { - (void) fprintf(stderr, err5b, infile); - return (-1); - } - in->configOptionVector[INPUT_SIZE] = 1; - - /*set default value for output-size */ - if (in->configOptionVector[OUTPUT_SIZE] == 0) - in->outputSize = in->inputSize; - break; - - case 3: /* RANK */ - if (in->configOptionVector[RANK] == 1) - { - (void) fprintf(stderr, err6a, infile); - return (-1); - } + if (fscanf(strm, "%s", temp) != 1) { + (void) HDfprintf(stderr, "%s", err18); + HDfclose(strm); + return (-1); + } + if (getInputClass(in, temp) == -1) { + (void) HDfprintf(stderr, err4b, infile); + HDfclose(strm); + return (-1); + } - if (getRank(in, strm) == -1) - { - (void) fprintf(stderr, err6b, infile); - return (-1); - } - in->configOptionVector[RANK] = 1; - break; - - case 4: /* DIMENSION-SIZES */ - if (in->configOptionVector[DIM] == 1) - { - (void) fprintf(stderr, err7a, infile); - return (-1); - } + in->configOptionVector[INPUT_CLASS] = 1; + + /*set default value for output-class */ + if (in->configOptionVector[OUTPUT_CLASS] == 0) { + if (in->inputClass == 0 || in->inputClass == 4) + in->outputClass = 0; + if (in->inputClass == 1 || in->inputClass == 2 + || in->inputClass == 3) + in->outputClass = 1; + if (in->inputClass == 6 || in->inputClass == 7) + in->outputClass = 2; + } + break; - if (in->configOptionVector[RANK] == 0) - { - (void) fprintf(stderr, err7b, infile); - return (-1); - } - if (getDimensionSizes(in, strm) == -1) - { - (void) fprintf(stderr, err7c, infile); - return (-1); - } - in->configOptionVector[DIM] = 1; - break; - - case 5: /* OUTPUT-CLASS */ - if (in->configOptionVector[OUTPUT_CLASS] == 1) - { - (void) fprintf(stderr, err8a, infile); - return (-1); - } + case 2: /* INPUT-SIZE */ + if (in->configOptionVector[INPUT_SIZE] == 1) { + (void) HDfprintf(stderr, err5a, infile); + HDfclose(strm); + return (-1); + } + if (fscanf(strm, "%d", (&ival)) != 1) { + (void) HDfprintf(stderr, "%s", err19); + HDfclose(strm); + return (-1); + } + if (getInputSize(in, ival) == -1) { + (void) HDfprintf(stderr, err5b, infile); + HDfclose(strm); + return (-1); + } + in->configOptionVector[INPUT_SIZE] = 1; - if (getOutputClass(in, strm) == -1) - { - (void) fprintf(stderr, err8b, infile); - return (-1); - } - in->configOptionVector[OUTPUT_CLASS] = 1; - break; - - case 6: /* OUTPUT-SIZE */ - if (in->configOptionVector[OUTPUT_SIZE] == 1) - { - (void) fprintf(stderr, err9a, infile); - return (-1); - } + /*set default value for output-size */ + if (in->configOptionVector[OUTPUT_SIZE] == 0) + in->outputSize = in->inputSize; + break; - if (getOutputSize(in, strm) == -1) - { - (void) fprintf(stderr, err9b, infile); - return (-1); - } - in->configOptionVector[OUTPUT_SIZE] = 1; - break; - - case 7: /* OUTPUT-ARCHITECTURE */ - if (in->configOptionVector[OUTPUT_ARCH] == 1) - { - (void) fprintf(stderr, err10a, infile); - return (-1); - } + case 3: /* RANK */ + if (in->configOptionVector[RANK] == 1) { + (void) HDfprintf(stderr, err6a, infile); + HDfclose(strm); + return (-1); + } - if (getOutputArchitecture(in, strm) == -1) - { - (void) fprintf(stderr, err10b, infile); - return (-1); - } - in->configOptionVector[OUTPUT_ARCH] = 1; - break; - - case 8: /* OUTPUT-BYTE-ORDER */ - if (in->configOptionVector[OUTPUT_B_ORDER] == 1) - { - (void) fprintf(stderr, err11a, infile); - return (-1); - } + if (getRank(in, strm) == -1) { + (void) HDfprintf(stderr, err6b, infile); + HDfclose(strm); + return (-1); + } + in->configOptionVector[RANK] = 1; + break; - if (getOutputByteOrder(in, strm) == -1) - { - (void) fprintf(stderr, err11b, infile); - return (-1); - } - in->configOptionVector[OUTPUT_B_ORDER] = 1; - break; - - case 9: /* CHUNKED-DIMENSION-SIZES */ - if (in->configOptionVector[CHUNK] == 1) - { - (void) fprintf(stderr, err12a, infile); - return (-1); - } - /* cant appear before dimension sizes have been provided */ - if (in->configOptionVector[DIM] == 0) - { - (void) fprintf(stderr, err12b, infile); - return (-1); - } + case 4: /* DIMENSION-SIZES */ + if (in->configOptionVector[DIM] == 1) { + (void) HDfprintf(stderr, err7a, infile); + HDfclose(strm); + return (-1); + } - if (getChunkedDimensionSizes(in, strm) == -1) - { - (void) fprintf(stderr, err12c, infile); - return (-1); - } - in->configOptionVector[CHUNK] = 1; - break; - - case 10: /* COMPRESSION-TYPE */ - if (in->configOptionVector[COMPRESS] == 1) - { - (void) fprintf(stderr, err13a, infile); - return (-1); - } + if (in->configOptionVector[RANK] == 0) { + (void) HDfprintf(stderr, err7b, infile); + HDfclose(strm); + return (-1); + } + if (getDimensionSizes(in, strm) == -1) { + (void) HDfprintf(stderr, err7c, infile); + HDfclose(strm); + return (-1); + } + in->configOptionVector[DIM] = 1; + break; - if (getCompressionType(in, strm) == -1) - { - (void) fprintf(stderr, err13b, infile); - return (-1); - } - in->configOptionVector[COMPRESS] = 1; + case 5: /* OUTPUT-CLASS */ + if (in->configOptionVector[OUTPUT_CLASS] == 1) { + (void) HDfprintf(stderr, err8a, infile); + HDfclose(strm); + return (-1); + } - if (in->configOptionVector[COMPRESS_PARAM] == 0) - { - if (in->compressionType == 0) - in->compressionParam = 6; /* default value if compressionType is GZIP */ - } - break; + if (getOutputClass(in, strm) == -1) { + (void) HDfprintf(stderr, err8b, infile); + HDfclose(strm); + return (-1); + } + in->configOptionVector[OUTPUT_CLASS] = 1; + break; - case 11: /* COMPRESSION-PARAM */ - if (in->configOptionVector[COMPRESS_PARAM] == 1) - { - (void) fprintf(stderr, err14a, infile); - return (-1); - } + case 6: /* OUTPUT-SIZE */ + if (in->configOptionVector[OUTPUT_SIZE] == 1) { + (void) HDfprintf(stderr, err9a, infile); + HDfclose(strm); + return (-1); + } - if (getCompressionParameter(in, strm) == -1) - { - (void) fprintf(stderr, err14b, infile); - return (-1); - } + if (getOutputSize(in, strm) == -1) { + (void) HDfprintf(stderr, err9b, infile); + HDfclose(strm); + return (-1); + } + in->configOptionVector[OUTPUT_SIZE] = 1; + break; - in->configOptionVector[COMPRESS_PARAM] = 1; + case 7: /* OUTPUT-ARCHITECTURE */ + if (in->configOptionVector[OUTPUT_ARCH] == 1) { + (void) HDfprintf(stderr, err10a, infile); + HDfclose(strm); + return (-1); + } - if (in->configOptionVector[COMPRESS] == 0) - in->compressionType = 0; + if (getOutputArchitecture(in, strm) == -1) { + (void) HDfprintf(stderr, err10b, infile); + HDfclose(strm); + return (-1); + } + in->configOptionVector[OUTPUT_ARCH] = 1; + break; + case 8: /* OUTPUT-BYTE-ORDER */ + if (in->configOptionVector[OUTPUT_B_ORDER] == 1) { + (void) HDfprintf(stderr, err11a, infile); + HDfclose(strm); + return (-1); + } - break; + if (getOutputByteOrder(in, strm) == -1) { + (void) HDfprintf(stderr, err11b, infile); + HDfclose(strm); + return (-1); + } + in->configOptionVector[OUTPUT_B_ORDER] = 1; + break; - case 12: /* EXTERNAL-STORAGE */ - if (in->configOptionVector[EXTERNAL] == 1) - { - (void) fprintf(stderr, err15a, infile); - return (-1); - } + case 9: /* CHUNKED-DIMENSION-SIZES */ + if (in->configOptionVector[CHUNK] == 1) { + (void) HDfprintf(stderr, err12a, infile); + HDfclose(strm); + return (-1); + } + /* cant appear before dimension sizes have been provided */ + if (in->configOptionVector[DIM] == 0) { + (void) HDfprintf(stderr, err12b, infile); + HDfclose(strm); + return (-1); + } - if (getExternalFilename(in, strm) == -1) - { - (void) fprintf(stderr, err15b, infile); - return (-1); - } - in->configOptionVector[EXTERNAL] = 1; - break; - - case 13: /* MAXIMUM-DIMENSIONS */ - if (in->configOptionVector[EXTEND] == 1) - { - (void) fprintf(stderr, err16a, infile); - return (-1); - } - /* cant appear before dimension sizes have been provided */ - if (in->configOptionVector[DIM] == 0) - { - (void) fprintf(stderr, err16b, infile); - return (-1); - } - if (getMaximumDimensionSizes(in, strm) == -1) - { - (void) fprintf(stderr, err16c, infile); - return (-1); - } - in->configOptionVector[EXTEND] = 1; - break; + if (getChunkedDimensionSizes(in, strm) == -1) { + (void) HDfprintf(stderr, err12c, infile); + HDfclose(strm); + return (-1); + } + in->configOptionVector[CHUNK] = 1; + break; - default: - break; + case 10: /* COMPRESSION-TYPE */ + if (in->configOptionVector[COMPRESS] == 1) { + (void) HDfprintf(stderr, err13a, infile); + HDfclose(strm); + return (-1); + } + + if (getCompressionType(in, strm) == -1) { + (void) HDfprintf(stderr, err13b, infile); + HDfclose(strm); + return (-1); + } + in->configOptionVector[COMPRESS] = 1; + + if (in->configOptionVector[COMPRESS_PARAM] == 0) { + if (in->compressionType == 0) + in->compressionParam = 6; /* default value if compressionType is GZIP */ + } + break; + + case 11: /* COMPRESSION-PARAM */ + if (in->configOptionVector[COMPRESS_PARAM] == 1) { + (void) HDfprintf(stderr, err14a, infile); + HDfclose(strm); + return (-1); + } + + if (getCompressionParameter(in, strm) == -1) { + (void) HDfprintf(stderr, err14b, infile); + HDfclose(strm); + return (-1); + } + + in->configOptionVector[COMPRESS_PARAM] = 1; + + if (in->configOptionVector[COMPRESS] == 0) + in->compressionType = 0; + + break; + + case 12: /* EXTERNAL-STORAGE */ + if (in->configOptionVector[EXTERNALSTORE] == 1) { + (void) HDfprintf(stderr, err15a, infile); + HDfclose(strm); + return (-1); + } + + if (getExternalFilename(in, strm) == -1) { + (void) HDfprintf(stderr, err15b, infile); + HDfclose(strm); + return (-1); + } + in->configOptionVector[EXTERNALSTORE] = 1; + break; + + case 13: /* MAXIMUM-DIMENSIONS */ + if (in->configOptionVector[EXTEND] == 1) { + (void) HDfprintf(stderr, err16a, infile); + HDfclose(strm); + return (-1); + } + /* cant appear before dimension sizes have been provided */ + if (in->configOptionVector[DIM] == 0) { + (void) HDfprintf(stderr, err16b, infile); + HDfclose(strm); + return (-1); + } + if (getMaximumDimensionSizes(in, strm) == -1) { + (void) HDfprintf(stderr, err16c, infile); + HDfclose(strm); + return (-1); + } + in->configOptionVector[EXTEND] = 1; + break; + + default: + break; + } + } + /* + check if keywords obtained are valid + if yes, return 0 else error + */ + + if (validateConfigurationParameters(in) == -1) { + (void) HDfprintf(stderr, err17, infile); + HDfclose(strm); + return (-1); } - } - /* - check if keywords obtained are valid - if yes, return 0 else error - */ - - if (validateConfigurationParameters(in) == -1) - { - (void) fprintf(stderr, err17, infile); - return (-1); - } - return (0); + HDfclose(strm); + return (0); } -static int -validateConfigurationParameters(struct Input * in) +static int validateConfigurationParameters(struct Input *in) { - const char *err1 = "One or more of the required fields (RANK, DIMENSION-SIZES) missing.\n"; - const char *err2 = "Cannot specify chunking or compression or extendible data sets with the external file option.\n"; - const char *err3 = "Cannot specify the compression or the extendible data sets without the chunking option.\n"; - const char *err4a = "OUTPUT-ARCHITECTURE cannot be STD if OUTPUT-CLASS is floating point (FP).\n"; - const char *err4b = "OUTPUT-ARCHITECTURE cannot be IEEE if OUTPUT-CLASS is integer (IN).\n"; - const char *err5 = "For OUTPUT-CLASS FP, valid values for OUTPUT-SIZE are (32, 64) .\n"; -#ifdef _WIN32 - const char *err6 = "No support for reading 64-bit integer (INPUT-CLASS: IN, TEXTIN, UIN, TEXTUIN files\n"; + const char *err1 = "One or more of the required fields (RANK, DIMENSION-SIZES) missing.\n"; + const char *err2 = "Cannot specify chunking or compression or extendible data sets with the external file option.\n"; + const char *err3 = "Cannot specify the compression or the extendible data sets without the chunking option.\n"; + const char *err4a = "OUTPUT-ARCHITECTURE cannot be STD if OUTPUT-CLASS is floating point (FP).\n"; + const char *err4b = "OUTPUT-ARCHITECTURE cannot be IEEE if OUTPUT-CLASS is integer (IN).\n"; + const char *err5 = "For OUTPUT-CLASS FP, valid values for OUTPUT-SIZE are (32, 64) .\n"; +#ifndef H5_SIZEOF_LONG_LONG + const char *err6 = "No support for reading 64-bit integer (INPUT-CLASS: IN, TEXTIN, UIN, TEXTUIN files\n"; #endif - /* for class STR other parameters are ignored */ - if (in->inputClass == 5) /* STR */ - return (0); - - if ( - (in->configOptionVector[DIM] != 1) || - (in->configOptionVector[RANK] != 1)) - { - (void) fprintf(stderr, "%s", err1); - return (-1); - } + /* for class STR other parameters are ignored */ + if (in->inputClass == 5) /* STR */ + return (0); - if (in->configOptionVector[EXTERNAL] == 1) - { - if ((in->configOptionVector[COMPRESS] == 1) || - (in->configOptionVector[CHUNK] == 1) || - (in->configOptionVector[EXTEND] == 1)) - { - (void) fprintf(stderr, "%s", err2); - return (-1); + if ((in->configOptionVector[DIM] != 1) || (in->configOptionVector[RANK] != 1)) { + (void) HDfprintf(stderr, "%s", err1); + return (-1); } - } - if ((in->configOptionVector[COMPRESS] == 1) || - (in->configOptionVector[EXTEND] == 1)) - { - if (in->configOptionVector[CHUNK] != 1) - { - (void) fprintf(stderr, "%s", err3); - return (-1); + if (in->configOptionVector[EXTERNALSTORE] == 1) { + if ((in->configOptionVector[COMPRESS] == 1) || (in->configOptionVector[CHUNK] == 1) || (in->configOptionVector[EXTEND] == 1)) { + (void) HDfprintf(stderr, "%s", err2); + return (-1); + } } - } - /* Arch cant be STD if O/p class is FP */ - if (in->outputArchitecture == 1) - if (in->outputClass == 1) - { - (void) fprintf(stderr, "%s", err4a); - return (-1); + if ((in->configOptionVector[COMPRESS] == 1) || (in->configOptionVector[EXTEND] == 1)) { + if (in->configOptionVector[CHUNK] != 1) { + (void) HDfprintf(stderr, "%s", err3); + return (-1); + } } - /* Arch cant be IEEE if O/p class is IN */ - if (in->outputArchitecture == 2) - if (in->outputClass == 0) - { - (void) fprintf(stderr, "%s", err4b); - return (-1); - } + /* Arch cant be STD if O/p class is FP */ + if (in->outputArchitecture == 1) + if (in->outputClass == 1) { + (void) HDfprintf(stderr, "%s", err4a); + return (-1); + } - if (in->outputClass == 1) - if(in->outputSize != 32 && - in->outputSize != 64 ) - { - (void) fprintf(stderr, "%s", err5); - return (-1); - } + /* Arch cant be IEEE if O/p class is IN */ + if (in->outputArchitecture == 2) + if (in->outputClass == 0) { + (void) HDfprintf(stderr, "%s", err4b); + return (-1); + } -#ifdef _WIN32 - if (in->inputSize == 64 && (in->inputClass == 0 || in->inputClass == 4 || in->inputClass == 6 || in->inputClass == 7) ) - { - (void) fprintf(stderr, "%s", err6); - return -1; - } + if (in->outputClass == 1) + if (in->outputSize != 32 && in->outputSize != 64) { + (void) HDfprintf(stderr, "%s", err5); + return (-1); + } + +#ifndef H5_SIZEOF_LONG_LONG + if (in->inputSize == 64 && (in->inputClass == 0 || in->inputClass == 4 || in->inputClass == 6 || in->inputClass == 7) ) { + (void) HDfprintf(stderr, "%s", err6); + return -1; + } #endif - return (0); + return (0); } -static int -mapKeywordToIndex(char *key) +static int mapKeywordToIndex(char *key) { - int i; + int i; - for (i=0; i= MAX_PATH_NAME_LENGTH) - { - (void) fprintf(stderr, err1); - return (-1); - } - HDstrcpy(path->group[i++],token); - - - while (1) - { - token = HDstrtok (NULL, delimiter); - if (token == NULL) - break; - if (HDstrlen(token) >= MAX_PATH_NAME_LENGTH) - { - (void) fprintf(stderr, err1); - return (-1); + const char delimiter[] = "/"; + char *token; + int i = 0; + const char *err1 = "Path string larger than MAX_PATH_NAME_LENGTH.\n"; + + token = HDstrtok (temp, delimiter); + if (HDstrlen(token) >= MAX_PATH_NAME_LENGTH) { + (void) HDfprintf(stderr, err1); + return (-1); } HDstrcpy(path->group[i++],token); - } - path->count = i; - return (0); + + while (1) { + token = HDstrtok (NULL, delimiter); + if (token == NULL) + break; + if (HDstrlen(token) >= MAX_PATH_NAME_LENGTH) { + (void) HDfprintf(stderr, err1); + return (-1); + } + HDstrcpy(path->group[i++],token); + } + path->count = i; + return (0); } -static int -parseDimensions(struct Input *in, char *strm) +static int parseDimensions(struct Input *in, char *strm) { - const char delimiter[] = ","; - char temp[255]; - char *token; - int i=0; - const char *err1 = "Unable to allocate dynamic memory.\n"; - - HDstrncpy(temp, strm, sizeof(temp)); - temp[sizeof(temp)-1] = '\0'; - HDstrtok (temp, delimiter); - - while (1) - { - token = HDstrtok (NULL, delimiter); - if (token == NULL) - break; - i++; - } - in->rank = i+1; - if ((in->sizeOfDimension = - (hsize_t *) HDmalloc ((size_t) in->rank * sizeof(hsize_t))) == NULL) - { - (void) fprintf(stderr, "%s", err1); - return (-1); - } - - i=0; - HDstrncpy(temp, strm, sizeof(temp)); - temp[sizeof(temp)-1] = '\0'; - in->sizeOfDimension[i++] = HDstrtol(HDstrtok (temp, delimiter), NULL, BASE_10); - - while (1) - { - token = HDstrtok (NULL, delimiter); - if (token == NULL) - break; - in->sizeOfDimension[i++] = HDstrtol(token, NULL, BASE_10); - } - return (0); + const char delimiter[] = ","; + char temp[255]; + char *token; + int i = 0; + const char *err1 = "Unable to allocate dynamic memory.\n"; + + HDstrncpy(temp, strm, sizeof(temp)); + temp[sizeof(temp) - 1] = '\0'; + HDstrtok (temp, delimiter); + + while (1) { + token = HDstrtok (NULL, delimiter); + if (token == NULL) + break; + i++; + } + in->rank = i + 1; + if ((in->sizeOfDimension = (hsize_t *) HDmalloc ((size_t) in->rank * sizeof(hsize_t))) == NULL) { + (void) HDfprintf(stderr, "%s", err1); + return (-1); + } + + i = 0; + HDstrncpy(temp, strm, sizeof(temp)); + temp[sizeof(temp) - 1] = '\0'; + in->sizeOfDimension[i++] + = HDstrtol(HDstrtok (temp, delimiter), NULL, BASE_10); + + while (1) { + token = HDstrtok (NULL, delimiter); + if (token == NULL) + break; + in->sizeOfDimension[i++] = HDstrtol(token, NULL, BASE_10); + } + return (0); } -static int -getOutputClass(struct Input *in, FILE** strm) +static int getOutputClass(struct Input *in, FILE *strm) { - char temp[255]; - int kindex; - const char *err1 = "Unable to get 'string' value.\n"; - const char *err2 = "Invalid value for output class.\n"; + char temp[255]; + int kindex; + const char *err1 = "Unable to get 'string' value.\n"; + const char *err2 = "Invalid value for output class.\n"; - if (fscanf(*strm, "%s", temp) != 1) - { - (void) fprintf(stderr, "%s", err1); - return (-1); - } + if (fscanf(strm, "%s", temp) != 1) { + (void) HDfprintf(stderr, "%s", err1); + return (-1); + } - if ((kindex = OutputClassStrToInt(temp)) == -1) - { - (void) fprintf(stderr, "%s", err2); - return (-1); - } + if ((kindex = OutputClassStrToInt(temp)) == -1) { + (void) HDfprintf(stderr, "%s", err2); + return (-1); + } - in->outputClass = kindex; - return (0); + in->outputClass = kindex; + return (0); } -static int -OutputClassStrToInt(char *temp) +static int OutputClassStrToInt(char *temp) { - int i; - char classKeywordTable[3][15] = { - "IN", - "FP", - "UIN" - }; - for (i=0; i<3; i++) - if (!HDstrcmp(classKeywordTable[i], temp)) return i; - - return -1; + int i; + char classKeywordTable[3][15] = { "IN", "FP", "UIN" }; + for (i = 0; i < 3; i++) + if (!HDstrcmp(classKeywordTable[i], temp)) + return i; + + return -1; } - /* same as getInputSize. But defined separately for extensibility */ -static int -getOutputSize(struct Input *in, FILE** strm) +/* same as getInputSize. But defined separately for extensibility */ +static int getOutputSize(struct Input *in, FILE *strm) { - int ival; - int i; - int outputSizeValidValues[4] = {8,16,32,64}; - const char *err1 = "Unable to get integer value.\n"; - const char *err2 = "Invalid value for output size.\n"; - - if (fscanf(*strm, "%d", (&ival)) != 1) - { - (void) fprintf(stderr, "%s", err1); + int ival; + int i; + int outputSizeValidValues[4] = { 8, 16, 32, 64 }; + const char *err1 = "Unable to get integer value.\n"; + const char *err2 = "Invalid value for output size.\n"; + + if (fscanf(strm, "%d", (&ival)) != 1) { + (void) HDfprintf(stderr, "%s", err1); return (-1); - } - - for (i=0; i<4; i++) - if (outputSizeValidValues[i] == ival) - { - in->outputSize = ival; - return (0); } - (void) fprintf(stderr, "%s", err2); - return(-1); + + for (i = 0; i < 4; i++) + if (outputSizeValidValues[i] == ival) { + in->outputSize = ival; + return (0); + } + (void) HDfprintf(stderr, "%s", err2); + return (-1); } -static int -getInputClass(struct Input *in, char * temp) +static int getInputClass(struct Input *in, char * temp) { - int kindex; - const char *err1 = "Invalid value for input class.\n"; + int kindex; + const char *err1 = "Invalid value for input class.\n"; - if ((kindex = InputClassStrToInt(temp)) == -1) - { - (void) fprintf(stderr, "%s", err1); - return (-1); - } + if ((kindex = InputClassStrToInt(temp)) == -1) { + (void) HDfprintf(stderr, "%s", err1); + return (-1); + } - in->inputClass = kindex; - return (0); + in->inputClass = kindex; + return (0); } -static int -InputClassStrToInt(char *temp) +static int InputClassStrToInt(char *temp) { - int i; - char classKeywordTable[8][15] = { - "TEXTIN", - "TEXTFP", - "TEXTFPE", - "FP", - "IN", - "STR", - "TEXTUIN", - "UIN" - }; - for (i=0; i<8; i++) - if (!HDstrcmp(classKeywordTable[i], temp)) return i; - return -1; + int i; + char classKeywordTable[8][15] = { "TEXTIN", "TEXTFP", "TEXTFPE", "FP", "IN", "STR", "TEXTUIN", "UIN" }; + for (i = 0; i < 8; i++) + if (!HDstrcmp(classKeywordTable[i], temp)) + return i; + return -1; } - /* same as getOutputSize. But defined separately for extensibility */ -static int -getInputSize(struct Input *in, int ival) +/* same as getOutputSize. But defined separately for extensibility */ +static int getInputSize(struct Input *in, int ival) { - int i; - int inputSizeValidValues[4] = {8,16,32,64}; - const char *err1 = "Invalid value for input size.\n"; - - for (i=0; i<4; i++) - if (inputSizeValidValues[i] == ival) - { - in->inputSize = ival; - return (0); - } - (void) fprintf(stderr, "%s", err1); - return(-1); + int i; + int inputSizeValidValues[4] = { 8, 16, 32, 64 }; + const char *err1 = "Invalid value for input size.\n"; + + for (i = 0; i < 4; i++) + if (inputSizeValidValues[i] == ival) { + in->inputSize = ival; + return (0); + } + (void) HDfprintf(stderr, "%s", err1); + return (-1); } -static int -getRank(struct Input *in, FILE** strm) +static int getRank(struct Input *in, FILE *strm) { - int ival; + int ival; - const char *err1 = "Unable to get integer value.\n"; - const char *err2 = "Invalid value for rank.\n"; + const char *err1 = "Unable to get integer value.\n"; + const char *err2 = "Invalid value for rank.\n"; - if (fscanf(*strm, "%d", (&ival)) != 1) - { - (void) fprintf(stderr, "%s", err1); - return (-1); - } - if (ival >=MIN_NUM_DIMENSION && ival <=MAX_NUM_DIMENSION ) - { - in->rank = ival; - return (0); - } + if (fscanf(strm, "%d", (&ival)) != 1) { + (void) HDfprintf(stderr, "%s", err1); + return (-1); + } + if (ival >= MIN_NUM_DIMENSION && ival <= MAX_NUM_DIMENSION) { + in->rank = ival; + return (0); + } - (void) fprintf(stderr, "%s", err2); - return(-1); + (void) HDfprintf(stderr, "%s", err2); + return (-1); } - /* same as getChunkedDimensionSizes. But defined separately for extensibility */ -static int -getDimensionSizes(struct Input *in, FILE **strm) +/* same as getChunkedDimensionSizes. But defined separately for extensibility */ +static int getDimensionSizes(struct Input *in, FILE *strm) { - int ival; - int i=0; + int ival; + int i = 0; - const char *err1 = "Unable to allocate dynamic memory.\n"; - const char *err2 = "No. of dimensions for which dimension sizes provided is not equal to provided rank.\n"; + const char *err1 = "Unable to allocate dynamic memory.\n"; + const char *err2 = "No. of dimensions for which dimension sizes provided is not equal to provided rank.\n"; - if ((in->sizeOfDimension = - (hsize_t *) HDmalloc ((size_t) in->rank * sizeof(hsize_t))) == NULL) - { - (void) fprintf(stderr, "%s", err1); - return (-1); - } + if ((in->sizeOfDimension = (hsize_t *) HDmalloc ((size_t) in->rank * sizeof(hsize_t))) == NULL) { + (void) HDfprintf(stderr, "%s", err1); + return (-1); + } - while (fscanf(*strm, "%d", (&ival)) == 1) - in->sizeOfDimension[i++] = ival; + while (fscanf(strm, "%d", (&ival)) == 1) + in->sizeOfDimension[i++] = ival; - if (in->rank != i) - { - (void) fprintf(stderr, "%s", err2); - return (-1); - } - return (0); + if (in->rank != i) { + (void) HDfprintf(stderr, "%s", err2); + return (-1); + } + return (0); } - /* same as getDimensionSizes. But defined separately for extensibility */ -static int -getChunkedDimensionSizes(struct Input *in, FILE **strm) +/* same as getDimensionSizes. But defined separately for extensibility */ +static int getChunkedDimensionSizes(struct Input *in, FILE *strm) { - int ival; - int i=0; + int ival; + int i = 0; - const char *err1 = "Unable to allocate dynamic memory.\n"; - const char *err2 = "No. of dimensions for which chunked dimension sizes provided is not equal to provided rank.\n"; - const char *err3 = "The CHUNKED-DIMENSION-SIZES cannot exceed the sizes of DIMENSION-SIZES\n"; + const char *err1 = "Unable to allocate dynamic memory.\n"; + const char *err2 = "No. of dimensions for which chunked dimension sizes provided is not equal to provided rank.\n"; + const char *err3 = "The CHUNKED-DIMENSION-SIZES cannot exceed the sizes of DIMENSION-SIZES\n"; - if ((in->sizeOfChunk = - (hsize_t *) HDmalloc ((size_t) in->rank * sizeof(hsize_t))) == NULL) - { - (void) fprintf(stderr, "%s", err1); - return (-1); - } - - while (fscanf(*strm, "%d", (&ival)) == 1) - in->sizeOfChunk[i++] = ival; + if ((in->sizeOfChunk = (hsize_t *) HDmalloc ((size_t) in->rank * sizeof(hsize_t))) == NULL) { + (void) HDfprintf(stderr, "%s", err1); + return (-1); + } - if (in->rank != i) - { - (void) fprintf(stderr, "%s", err2); - return (-1); - } + while (fscanf(strm, "%d", (&ival)) == 1) + in->sizeOfChunk[i++] = ival; - for (i=0; irank; i++) - if (in->sizeOfChunk[i] > in->sizeOfDimension[i]) - { - (void) fprintf(stderr, "%s", err3); - return (-1); + if (in->rank != i) { + (void) HDfprintf(stderr, "%s", err2); + return (-1); } - return (0); + + for (i = 0; i < in->rank; i++) + if (in->sizeOfChunk[i] > in->sizeOfDimension[i]) { + (void) HDfprintf(stderr, "%s", err3); + return (-1); + } + return (0); } -static int -getMaximumDimensionSizes(struct Input *in, FILE **strm) +static int getMaximumDimensionSizes(struct Input *in, FILE *strm) { - int ival; - int i=0; + int ival; + int i = 0; - const char *err1 = "Unable to allocate dynamic memory.\n"; - const char *err2 = "No. of dimensions for which maximum dimension sizes provided is not equal to provided rank.\n"; - const char *err3 = "The MAXIMUM-DIMENSIONS cannot be less than the sizes of DIMENSION-SIZES. Exception: can be -1 to indicate unlimited size\n"; + const char *err1 = "Unable to allocate dynamic memory.\n"; + const char *err2 = "No. of dimensions for which maximum dimension sizes provided is not equal to provided rank.\n"; + const char *err3 = "The MAXIMUM-DIMENSIONS cannot be less than the sizes of DIMENSION-SIZES. Exception: can be -1 to indicate unlimited size\n"; - if ((in->maxsizeOfDimension = - (hsize_t *) HDmalloc ((size_t) in->rank * sizeof(hsize_t))) == NULL) - { - (void) fprintf(stderr, "%s", err1); - return (-1); - } - - while (fscanf(*strm, "%d", (&ival)) == 1) - { - if (ival == -1) - in->maxsizeOfDimension[i++] = H5S_UNLIMITED; - else - in->maxsizeOfDimension[i++] = ival; - } - - if (in->rank != i) - { - (void) fprintf(stderr, "%s", err2); - return (-1); - } - - for (i=0; irank; i++) - { - if (in->maxsizeOfDimension[i] != H5S_UNLIMITED) - if (in->maxsizeOfDimension[i] < in->sizeOfDimension[i]) - { - (void) fprintf(stderr, "%s", err3); + if ((in->maxsizeOfDimension = (hsize_t *) HDmalloc ((size_t) in->rank * sizeof(hsize_t))) == NULL) { + (void) HDfprintf(stderr, "%s", err1); + return (-1); + } + + while (fscanf(strm, "%d", (&ival)) == 1) { + if (ival == -1) + in->maxsizeOfDimension[i++] = H5S_UNLIMITED; + else + in->maxsizeOfDimension[i++] = ival; + } + + if (in->rank != i) { + (void) HDfprintf(stderr, "%s", err2); return (-1); - } - } - return (0); + } + + for (i = 0; i < in->rank; i++) { + if (in->maxsizeOfDimension[i] != H5S_UNLIMITED) + if (in->maxsizeOfDimension[i] < in->sizeOfDimension[i]) { + (void) HDfprintf(stderr, "%s", err3); + return (-1); + } + } + return (0); } -static int -getOutputArchitecture(struct Input *in, FILE** strm) +static int getOutputArchitecture(struct Input *in, FILE *strm) { - char temp[255]; - int kindex; - const char *err1 = "Unable to get 'string' value.\n"; - const char *err2 = "Invalid value for output architecture.\n"; - - if (fscanf(*strm, "%s", temp) != 1) - { - (void) fprintf(stderr, "%s", err1); - return (-1); - } + char temp[255]; + int kindex; + const char *err1 = "Unable to get 'string' value.\n"; + const char *err2 = "Invalid value for output architecture.\n"; - if ((kindex = OutputArchStrToInt(temp)) == -1) - { - (void) fprintf(stderr, "%s", err2); - return (-1); - } + if (fscanf(strm, "%s", temp) != 1) { + (void) HDfprintf(stderr, "%s", err1); + return (-1); + } + + if ((kindex = OutputArchStrToInt(temp)) == -1) { + (void) HDfprintf(stderr, "%s", err2); + return (-1); + } - in->outputArchitecture = kindex; - return (0); + in->outputArchitecture = kindex; + return (0); } -static int -OutputArchStrToInt(char *temp) +static int OutputArchStrToInt(char *temp) { - int i; - char outputArchKeywordTable[8][15] = { - "NATIVE", - "STD", - "IEEE", - "INTEL", - "CRAY", - "MIPS", - "ALPHA", - "UNIX" - }; - for (i=0; i<8; i++) - if (!HDstrcmp(outputArchKeywordTable[i], temp)) return i; - return -1; + int i; + char outputArchKeywordTable[8][15] = { "NATIVE", "STD", "IEEE", "INTEL", + "CRAY", "MIPS", "ALPHA", "UNIX" }; + for (i = 0; i < 8; i++) + if (!HDstrcmp(outputArchKeywordTable[i], temp)) + return i; + return -1; } -static int -getOutputByteOrder(struct Input *in, FILE** strm) +static int getOutputByteOrder(struct Input *in, FILE *strm) { - char temp[255]; - int kindex; - const char *err1 = "Unable to get 'string' value.\n"; - const char *err2 = "Invalid value for output byte-order.\n"; - - if (fscanf(*strm, "%s", temp) != 1) - { - (void) fprintf(stderr, "%s", err1); - return (-1); - } + char temp[255]; + int kindex; + const char *err1 = "Unable to get 'string' value.\n"; + const char *err2 = "Invalid value for output byte-order.\n"; - if ((kindex = OutputByteOrderStrToInt(temp)) == -1) - { - (void) fprintf(stderr, "%s", err2); - return (-1); - } + if (fscanf(strm, "%s", temp) != 1) { + (void) HDfprintf(stderr, "%s", err1); + return (-1); + } - in->outputByteOrder = kindex; - return (0); + if ((kindex = OutputByteOrderStrToInt(temp)) == -1) { + (void) HDfprintf(stderr, "%s", err2); + return (-1); + } + + in->outputByteOrder = kindex; + return (0); } -static int -OutputByteOrderStrToInt(char *temp) +static int OutputByteOrderStrToInt(char *temp) { - int i; - char outputByteOrderKeywordTable[2][15] = { - "BE", - "LE" - }; - for (i=0; i<2; i++) - if (!HDstrcmp(outputByteOrderKeywordTable[i], temp)) return i; - return -1; + int i; + char outputByteOrderKeywordTable[2][15] = { "BE", "LE" }; + for (i = 0; i < 2; i++) + if (!HDstrcmp(outputByteOrderKeywordTable[i], temp)) + return i; + return -1; } -static int -getCompressionType(struct Input *in, FILE** strm) +static int getCompressionType(struct Input *in, FILE *strm) { - char temp[255]; - int kindex; - const char *err1 = "Unable to get 'string' value.\n"; - const char *err2 = "Invalid value for compression.\n"; - - if (fscanf(*strm, "%s", temp) != 1) - { - (void) fprintf(stderr, "%s", err1); - return (-1); - } + char temp[255]; + int kindex; + const char *err1 = "Unable to get 'string' value.\n"; + const char *err2 = "Invalid value for compression.\n"; - if ((kindex = CompressionTypeStrToInt(temp)) == -1) - { - (void) fprintf(stderr, "%s", err2); - return (-1); - } + if (fscanf(strm, "%s", temp) != 1) { + (void) HDfprintf(stderr, "%s", err1); + return (-1); + } - in->compressionType = kindex; - return (0); + if ((kindex = CompressionTypeStrToInt(temp)) == -1) { + (void) HDfprintf(stderr, "%s", err2); + return (-1); + } + + in->compressionType = kindex; + return (0); } -static int -CompressionTypeStrToInt(char *temp) +static int CompressionTypeStrToInt(char *temp) { - /* currently supports only GZIP */ - /* can be extended by adding fields to the table */ - - int i; - char CompressionTypeKeywordTable[1][15] = { - "GZIP" - }; - for (i=0; i<1; i++) - if (!HDstrcmp(CompressionTypeKeywordTable[i], temp)) return i; - return -1; + /* currently supports only GZIP */ + /* can be extended by adding fields to the table */ + + int i; + char CompressionTypeKeywordTable[1][15] = { "GZIP" }; + for (i = 0; i < 1; i++) + if (!HDstrcmp(CompressionTypeKeywordTable[i], temp)) + return i; + return -1; } -static int -getCompressionParameter(struct Input *in, FILE** strm) +static int getCompressionParameter(struct Input *in, FILE *strm) { - /* currently supports only GZIP */ - /* can be extended by adding more values to COMPRESSION-TYPE and - handling the paramters here by adding more cases */ - - int ival; - const char *err1 = "Unable to get integer value.\n"; - const char *err2 = "Invalid value for compression paramter.\n"; - const char *err3 = "Unsupported Compression Type.\n"; - - switch (in->compressionType) - { - case 0: /* GZIP */ - if (fscanf(*strm, "%d", (&ival)) != 1) - { - (void) fprintf(stderr, "%s", err1); - return (-1); - } + /* currently supports only GZIP */ + /* can be extended by adding more values to COMPRESSION-TYPE and */ + /* handling the paramters here by adding more cases */ + + int ival; + const char *err1 = "Unable to get integer value.\n"; + const char *err2 = "Invalid value for compression paramter.\n"; + const char *err3 = "Unsupported Compression Type.\n"; + + switch (in->compressionType) { + case 0: /* GZIP */ + if (fscanf(strm, "%d", (&ival)) != 1) { + (void) HDfprintf(stderr, "%s", err1); + return (-1); + } - if (ival <0 || ival > 9) - { - (void) fprintf(stderr, "%s", err2); - return (-1); - } - in->compressionParam = ival; - return (0); + if (ival < 0 || ival > 9) { + (void) HDfprintf(stderr, "%s", err2); + return (-1); + } + in->compressionParam = ival; + return (0); default: - (void) fprintf(stderr, "%s", err3); - return (-1); - } + (void) HDfprintf(stderr, "%s", err3); + return (-1); + } } -static int -getExternalFilename(struct Input *in, FILE** strm) +static int getExternalFilename(struct Input *in, FILE *strm) { - char temp[255]; - const char *err1 = "Unable to get 'string' value.\n"; + char temp[255]; + const char *err1 = "Unable to get 'string' value.\n"; - if (fscanf(*strm, "%s", temp) != 1) - { - (void) fprintf(stderr, "%s", err1); - return (-1); - } + if (fscanf(strm, "%s", temp) != 1) { + (void) HDfprintf(stderr, "%s", err1); + return (-1); + } - in->externFilename = (char *) HDmalloc ((size_t) (HDstrlen(temp)) * sizeof(char)); - (void) HDstrcpy(in->externFilename, temp); - return (0); + in->externFilename = (char *) HDmalloc ((size_t) (HDstrlen(temp)) * sizeof(char)); + (void) HDstrcpy(in->externFilename, temp); + return (0); } -void -setDefaultValues(struct Input *in, int count) +void setDefaultValues(struct Input *in, int count) { - int i; - char temp[255]; - char num[255]; - - in->inputClass = 3; /* FP */ - in->inputSize = 32; - in->outputClass = 1; /* FP */ - in->outputSize = 32; - in->rank = 0; - in->path.count = 1; - - HDstrcpy(temp, "dataset"); - sprintf(num, "%d", count); - HDstrcat(temp, num); - HDstrcpy(in->path.group[0], temp); - - in->outputArchitecture = 0; /* NATIVE */ - in->outputByteOrder = -1; /* use default */ - in->compressionType = 0; /* GZIP */ - for (i=0; iconfigOptionVector[i] = 0; + int i; + char temp[255]; + char num[255]; + + in->inputClass = 3; /* FP */ + in->inputSize = 32; + in->outputClass = 1; /* FP */ + in->outputSize = 32; + in->rank = 0; + in->path.count = 1; + + HDstrcpy(temp, "dataset"); + sprintf(num, "%d", count); + HDstrcat(temp, num); + HDstrcpy(in->path.group[0], temp); + + in->outputArchitecture = 0; /* NATIVE */ + in->outputByteOrder = -1; /* use default */ + in->compressionType = 0; /* GZIP */ + for (i = 0; i < NUM_KEYS; i++) + in->configOptionVector[i] = 0; } -hid_t -createOutputDataType(struct Input *in) +hid_t createOutputDataType(struct Input *in) { - hid_t new_type = (-1); - const char *err1 = "Invalid value for output class.\n"; + hid_t new_type = (-1); + const char *err1 = "Invalid value for output class.\n"; - switch (in->outputClass) - { + switch (in->outputClass) { case 0: - switch (in->outputArchitecture) - { + switch (in->outputArchitecture) { case 0: /* NATIVE */ - switch(in->outputSize) - { + switch (in->outputSize) { case 8: - new_type = H5Tcopy (H5T_NATIVE_CHAR); - break; + new_type = H5Tcopy(H5T_NATIVE_CHAR); + break; case 16: - new_type = H5Tcopy (H5T_NATIVE_SHORT); - break; + new_type = H5Tcopy(H5T_NATIVE_SHORT); + break; case 32: - new_type = H5Tcopy (H5T_NATIVE_INT); - break; + new_type = H5Tcopy(H5T_NATIVE_INT); + break; case 64: - new_type = H5Tcopy (H5T_NATIVE_LLONG); - break; - } - switch(in->outputByteOrder) - { - case -1: /* default */ + new_type = H5Tcopy(H5T_NATIVE_LLONG); break; - case 0: - H5Tset_order (new_type,H5T_ORDER_BE); + } + switch (in->outputByteOrder) { + case -1: /* default */ + break; + case 0: + H5Tset_order(new_type, H5T_ORDER_BE); break; - case 1: - H5Tset_order (new_type,H5T_ORDER_LE); + case 1: + H5Tset_order(new_type, H5T_ORDER_LE); break; - } - break; + } + break; case 1: /* STD */ - switch(in->outputSize) - { + switch (in->outputSize) { case 8: - switch(in->outputByteOrder) - { + switch (in->outputByteOrder) { case -1: case 0: - new_type = H5Tcopy (H5T_STD_I8BE); - break; + new_type = H5Tcopy(H5T_STD_I8BE); + break; case 1: - new_type = H5Tcopy (H5T_STD_I8LE); + new_type = H5Tcopy(H5T_STD_I8LE); + break; + } break; - } - break; case 16: - switch(in->outputByteOrder) - { + switch (in->outputByteOrder) { case -1: case 0: - new_type = H5Tcopy (H5T_STD_I16BE); - break; + new_type = H5Tcopy(H5T_STD_I16BE); + break; case 1: - new_type = H5Tcopy (H5T_STD_I16LE); + new_type = H5Tcopy(H5T_STD_I16LE); + break; + } break; - } - break; case 32: - switch(in->outputByteOrder) - { + switch (in->outputByteOrder) { case -1: case 0: - new_type = H5Tcopy (H5T_STD_I32BE); - break; + new_type = H5Tcopy(H5T_STD_I32BE); + break; case 1: - new_type = H5Tcopy (H5T_STD_I32LE); + new_type = H5Tcopy(H5T_STD_I32LE); + break; + } break; - } - break; case 64: - switch(in->outputByteOrder) - { + switch (in->outputByteOrder) { case -1: case 0: - new_type = H5Tcopy (H5T_STD_I64BE); - break; + new_type = H5Tcopy(H5T_STD_I64BE); + break; case 1: - new_type = H5Tcopy (H5T_STD_I64LE); + new_type = H5Tcopy(H5T_STD_I64LE); + break; + } break; - } + } break; - } - break; } break; case 1: - switch (in->outputArchitecture) - { + switch (in->outputArchitecture) { case 0: - switch(in->outputSize) - { + switch (in->outputSize) { case 32: - new_type = H5Tcopy (H5T_NATIVE_FLOAT); - break; + new_type = H5Tcopy(H5T_NATIVE_FLOAT); + break; case 64: - new_type = H5Tcopy (H5T_NATIVE_DOUBLE); - break; - } - switch(in->outputByteOrder) - { - case -1: /* DEFAULT */ + new_type = H5Tcopy(H5T_NATIVE_DOUBLE); break; - case 0: - H5Tset_order (new_type,H5T_ORDER_BE); + } + switch (in->outputByteOrder) { + case -1: /* DEFAULT */ + break; + case 0: + H5Tset_order(new_type, H5T_ORDER_BE); break; - case 1: - H5Tset_order (new_type,H5T_ORDER_LE); + case 1: + H5Tset_order(new_type, H5T_ORDER_LE); break; - } - break; + } + break; case 1: - /* STD not supported for float */ - break; + /* STD not supported for float */ + break; case 2: - switch(in->outputSize) - { + switch (in->outputSize) { case 32: - switch(in->outputByteOrder) - { + switch (in->outputByteOrder) { case -1: case 0: - new_type = H5Tcopy (H5T_IEEE_F32BE); - break; + new_type = H5Tcopy(H5T_IEEE_F32BE); + break; case 1: - new_type = H5Tcopy (H5T_IEEE_F32LE); + new_type = H5Tcopy(H5T_IEEE_F32LE); + break; + } break; - } - break; case 64: - switch(in->outputByteOrder) - { + switch (in->outputByteOrder) { case -1: case 0: - new_type = H5Tcopy (H5T_IEEE_F64BE); - break; + new_type = H5Tcopy(H5T_IEEE_F64BE); + break; case 1: - new_type = H5Tcopy (H5T_IEEE_F64LE); + new_type = H5Tcopy(H5T_IEEE_F64LE); + break; + } break; - } + } break; - } - break; - } - break; + } + break; case 2: - switch (in->outputArchitecture) - { - case 0: - switch(in->outputSize) - { - case 8: - new_type = H5Tcopy (H5T_NATIVE_UCHAR); - break; + switch (in->outputArchitecture) { + case 0: + switch (in->outputSize) { + case 8: + new_type = H5Tcopy(H5T_NATIVE_UCHAR); + break; - case 16: - new_type = H5Tcopy (H5T_NATIVE_USHORT); - break; + case 16: + new_type = H5Tcopy(H5T_NATIVE_USHORT); + break; - case 32: - new_type = H5Tcopy (H5T_NATIVE_UINT); - break; + case 32: + new_type = H5Tcopy(H5T_NATIVE_UINT); + break; - case 64: - new_type = H5Tcopy (H5T_NATIVE_ULLONG); - break; + case 64: + new_type = H5Tcopy(H5T_NATIVE_ULLONG); + break; } - switch(in->outputByteOrder) - { - case -1: /* Default */ + switch (in->outputByteOrder) { + case -1: /* Default */ break; - case 0: - H5Tset_order (new_type,H5T_ORDER_BE); + case 0: + H5Tset_order(new_type, H5T_ORDER_BE); break; - case 1: - H5Tset_order (new_type,H5T_ORDER_LE); + case 1: + H5Tset_order(new_type, H5T_ORDER_LE); break; - } + } break; - case 1: - switch(in->outputSize) - { - case 8: - switch(in->outputByteOrder) - { - case -1: - case 0: - new_type = H5Tcopy (H5T_STD_U8BE); - break; - - case 1: - new_type = H5Tcopy (H5T_STD_U8LE); - break; + case 1: + switch (in->outputSize) { + case 8: + switch (in->outputByteOrder) { + case -1: + case 0: + new_type = H5Tcopy(H5T_STD_U8BE); + break; + + case 1: + new_type = H5Tcopy(H5T_STD_U8LE); + break; } break; - case 16: - switch(in->outputByteOrder) - { - case -1: - case 0: - new_type = H5Tcopy (H5T_STD_U16BE); - break; - - case 1: - new_type = H5Tcopy (H5T_STD_U16LE); - break; + case 16: + switch (in->outputByteOrder) { + case -1: + case 0: + new_type = H5Tcopy(H5T_STD_U16BE); + break; + + case 1: + new_type = H5Tcopy(H5T_STD_U16LE); + break; } break; - case 32: - switch(in->outputByteOrder) - { - case -1: - case 0: - new_type = H5Tcopy (H5T_STD_U32BE); - break; - - case 1: - new_type = H5Tcopy (H5T_STD_U32LE); - break; + case 32: + switch (in->outputByteOrder) { + case -1: + case 0: + new_type = H5Tcopy(H5T_STD_U32BE); + break; + + case 1: + new_type = H5Tcopy(H5T_STD_U32LE); + break; } break; - case 64: - switch(in->outputByteOrder) - { - case -1: - case 0: - new_type = H5Tcopy (H5T_STD_U64BE); - break; - - case 1: - new_type = H5Tcopy (H5T_STD_U64LE); - break; + case 64: + switch (in->outputByteOrder) { + case -1: + case 0: + new_type = H5Tcopy(H5T_STD_U64BE); + break; + + case 1: + new_type = H5Tcopy(H5T_STD_U64LE); + break; } break; } break; - case 2: + case 2: /* IEEE not supported for INT */ - break; + break; } break; default: - (void) fprintf(stderr, "%s", err1); + (void) HDfprintf(stderr, "%s", err1); return (-1); } return new_type; } -hid_t -createInputDataType(struct Input *in) +hid_t createInputDataType(struct Input *in) { - hid_t new_type = (-1); - const char *err1 = "Invalid value for input class.\n"; + hid_t new_type = (-1); + const char *err1 = "Invalid value for input class.\n"; - switch (in->inputClass) - { + switch (in->inputClass) { case 0: case 4: - switch(in->inputSize) - { - case 8: - new_type = H5Tcopy (H5T_NATIVE_CHAR); - break; - - case 16: - new_type = H5Tcopy (H5T_NATIVE_SHORT); - break; - - case 32: - new_type = H5Tcopy (H5T_NATIVE_INT); - break; - - case 64: - new_type = H5Tcopy (H5T_NATIVE_LLONG); - break; + switch (in->inputSize) { + case 8: + new_type = H5Tcopy(H5T_NATIVE_CHAR); + break; + + case 16: + new_type = H5Tcopy(H5T_NATIVE_SHORT); + break; + + case 32: + new_type = H5Tcopy(H5T_NATIVE_INT); + break; + + case 64: + new_type = H5Tcopy(H5T_NATIVE_LLONG); + break; } break; case 1: case 2: case 3: - switch(in->inputSize) - { - case 32: - new_type = H5Tcopy (H5T_NATIVE_FLOAT); - break; - - case 64: - new_type = H5Tcopy (H5T_NATIVE_DOUBLE); - break; + switch (in->inputSize) { + case 32: + new_type = H5Tcopy(H5T_NATIVE_FLOAT); + break; + + case 64: + new_type = H5Tcopy(H5T_NATIVE_DOUBLE); + break; } break; @@ -2447,185 +2239,182 @@ createInputDataType(struct Input *in) case 6: case 7: - switch(in->inputSize) - { - case 8: - new_type = H5Tcopy (H5T_NATIVE_UCHAR); - break; - - case 16: - new_type = H5Tcopy (H5T_NATIVE_USHORT); - break; - - case 32: - new_type = H5Tcopy (H5T_NATIVE_UINT); - break; - - case 64: - new_type = H5Tcopy (H5T_NATIVE_ULLONG); - break; + switch (in->inputSize) { + case 8: + new_type = H5Tcopy(H5T_NATIVE_UCHAR); + break; + + case 16: + new_type = H5Tcopy(H5T_NATIVE_USHORT); + break; + + case 32: + new_type = H5Tcopy(H5T_NATIVE_UINT); + break; + + case 64: + new_type = H5Tcopy(H5T_NATIVE_ULLONG); + break; } break; default: - (void) fprintf(stderr, "%s", err1); + (void) HDfprintf(stderr, "%s", err1); return (-1); } - return new_type; + return new_type; } -static int -process(struct Options *opt) +static int process(struct Options *opt) { - struct Input *in; - hid_t file_id, group_id, handle; - hid_t dataset, dataspace = (-1); - FILE *strm, *extfile; - hid_t intype, outtype; - hid_t proplist; - hsize_t numOfElements = 1; - int j,k; - - const char *err1 = "Error creating HDF output file: %s.\n"; - const char *err2 = "Error in processing the configuration file: %s.\n"; - const char *err3 = "Error in reading the input file: %s.\n"; - const char *err4 = "Error in creating or opening external file.\n"; - const char *err5 = "Error in creating the output data set. Dataset with the same name may exist at the specified path\n"; - const char *err6 = "Error in writing the output data set.\n"; - - H5E_BEGIN_TRY { - if ((file_id = H5Fopen(opt->outfile, H5F_ACC_RDWR, H5P_DEFAULT)) < 0) { - if ((file_id = H5Fcreate(opt->outfile, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) == FAIL) - { - (void) fprintf(stderr, err1, opt->outfile); - return (-1); - } - } - } H5E_END_TRY; + struct Input *in; + FILE *extfile; + hid_t file_id; + hid_t group_id; + hid_t handle; + hid_t dataset; + hid_t dataspace = (-1); + hid_t intype; + hid_t outtype; + hid_t proplist; + hsize_t numOfElements = 1; + int j; + int k; + + const char *err1 = "Error creating HDF output file: %s.\n"; + const char *err2 = "Error in processing the configuration file: %s.\n"; + const char *err3 = "Error in reading the input file: %s.\n"; + const char *err4 = "Error in creating or opening external file.\n"; + const char *err5 = "Error in creating the output data set. Dataset with the same name may exist at the specified path\n"; + const char *err6 = "Error in writing the output data set.\n"; - for (k = 0; k < opt->fcount; k++) - { - in = &(opt->infiles[k].in); - if (opt->infiles[k].config == 1) + H5E_BEGIN_TRY { - if (processConfigurationFile(opt->infiles[k].configfile, in, &strm) == -1) - { - (void) fprintf(stderr, err2, opt->infiles[k].configfile); - return (-1); + if ((file_id = H5Fopen(opt->outfile, H5F_ACC_RDWR, H5P_DEFAULT)) < 0) { + if ((file_id = H5Fcreate(opt->outfile, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) == FAIL) { + (void) HDfprintf(stderr, err1, opt->outfile); + return (-1); + } } } - - if (processDataFile(opt->infiles[k].datafile, in, &strm, file_id ) == -1) - { - (void) fprintf(stderr, err3, opt->infiles[k].datafile); - return (-1); - } - - if (in->inputClass != 5) /* STR */ - { - - for (j=0; jrank;j++) - numOfElements *= in->sizeOfDimension[j]; - - /* disable error reporting */ - H5E_BEGIN_TRY { - /* create parent groups */ - if(in->path.count > 1) { - j = 0; - handle = file_id; - while(j < in->path.count - 1) { - if((group_id = H5Gopen2(handle, in->path.group[j], H5P_DEFAULT)) < 0) { - group_id = H5Gcreate2(handle, in->path.group[j++], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - for (; j < in->path.count - 1; j++) - group_id = H5Gcreate2(group_id, in->path.group[j], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - handle = group_id; - break; - } - handle = group_id; - j++; + H5E_END_TRY; + + for (k = 0; k < opt->fcount; k++) { + in = &(opt->infiles[k].in); + if (opt->infiles[k].config == 1) { + if (processConfigurationFile(opt->infiles[k].configfile, in) == -1) { + (void) HDfprintf(stderr, err2, opt->infiles[k].configfile); + return (-1); } } - else { - handle = file_id; - j=0; - } - /*enable error reporting */ - } H5E_END_TRY; + if (processDataFile(opt->infiles[k].datafile, in, file_id) == -1) { + (void) HDfprintf(stderr, err3, opt->infiles[k].datafile); + return (-1); + } - /*create data type */ - intype = createInputDataType(in); - outtype = createOutputDataType(in); + if (in->inputClass != 5) { /* STR */ + for (j = 0; j < in->rank; j++) + numOfElements *= in->sizeOfDimension[j]; - /* create property list */ - proplist = H5Pcreate (H5P_DATASET_CREATE); - if (in->configOptionVector[CHUNK] == 1) - { - H5Pset_layout (proplist, H5D_CHUNKED); - /* not reqd chunking is implied if set_chunk is used */ - H5Pset_chunk (proplist, in->rank, in->sizeOfChunk); - } + /* disable error reporting */ + H5E_BEGIN_TRY + { + /* create parent groups */ + if (in->path.count > 1) { + j = 0; + handle = file_id; + while (j < in->path.count - 1) { + if ((group_id = H5Gopen2(handle, in->path.group[j], H5P_DEFAULT)) < 0) { + group_id = H5Gcreate2(handle, in->path.group[j++], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + for (; j < in->path.count - 1; j++) + group_id = H5Gcreate2(group_id, in->path.group[j], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + handle = group_id; + break; + } + handle = group_id; + j++; + } + } + else { + handle = file_id; + j = 0; + } - if (in->configOptionVector[COMPRESS] == 1) - { - H5Pset_deflate (proplist, (unsigned) in->compressionParam); - } + /*enable error reporting */ + } + H5E_END_TRY; + + /*create data type */ + intype = createInputDataType(in); + outtype = createOutputDataType(in); + + /* create property list */ + proplist = H5Pcreate(H5P_DATASET_CREATE); + if (in->configOptionVector[CHUNK] == 1) { + H5Pset_layout(proplist, H5D_CHUNKED); + /* not reqd chunking is implied if set_chunk is used */ + H5Pset_chunk(proplist, in->rank, in->sizeOfChunk); + } - if (in->configOptionVector[EXTERNAL] == 1) - { - /* creating the external file if it doesnt exist */ - if ((extfile = HDfopen(in->externFilename, "ab")) == NULL) - { - (void) fprintf(stderr, "%s", err4); - H5Pclose(proplist); - H5Sclose(dataspace); - H5Fclose(file_id); - return (-1); - } - HDfclose(extfile); - H5Pset_external (proplist, in->externFilename, (off_t)0, numOfElements * in->inputSize / 8); - } + if (in->configOptionVector[COMPRESS] == 1) { + H5Pset_deflate(proplist, (unsigned) in->compressionParam); + } - /* create dataspace */ - if(in->configOptionVector[EXTEND] == 1) - dataspace = H5Screate_simple(in->rank, in->sizeOfDimension, in->maxsizeOfDimension); - else - dataspace = H5Screate_simple(in->rank, in->sizeOfDimension, NULL); + if (in->configOptionVector[EXTERNALSTORE] == 1) { + /* creating the external file if it doesnt exist */ + if ((extfile = HDfopen(in->externFilename, "ab")) == NULL) { + (void) HDfprintf(stderr, "%s", err4); + H5Pclose(proplist); + H5Sclose(dataspace); + H5Fclose(file_id); + return (-1); + } + HDfclose(extfile); + H5Pset_external(proplist, in->externFilename, (off_t) 0, numOfElements * in->inputSize / 8); + } - /* disable error reporting */ - H5E_BEGIN_TRY { - /* create data set */ - if((dataset = H5Dcreate2(handle, in->path.group[j], outtype, dataspace, H5P_DEFAULT, proplist, H5P_DEFAULT)) < 0) { - (void)fprintf(stderr, "%s", err5); - H5Pclose(proplist); - H5Sclose(dataspace); - H5Fclose(file_id); - return (-1); - } + /* create dataspace */ + if (in->configOptionVector[EXTEND] == 1) + dataspace = H5Screate_simple(in->rank, in->sizeOfDimension, in->maxsizeOfDimension); + else + dataspace = H5Screate_simple(in->rank, in->sizeOfDimension, NULL); - /*enable error reporting */ - } H5E_END_TRY; - - /* write dataset */ - if(H5Dwrite(dataset, intype, H5S_ALL, H5S_ALL, H5P_DEFAULT, (VOIDP)in->data) < 0) { - (void) fprintf(stderr, "%s", err6); - H5Dclose(dataset); - H5Pclose(proplist); - H5Sclose(dataspace); - H5Fclose(file_id); - return (-1); - } + /* disable error reporting */ + H5E_BEGIN_TRY + { + /* create data set */ + if ((dataset = H5Dcreate2(handle, in->path.group[j], outtype, dataspace, H5P_DEFAULT, proplist, H5P_DEFAULT)) < 0) { + (void) HDfprintf(stderr, "%s", err5); + H5Pclose(proplist); + H5Sclose(dataspace); + H5Fclose(file_id); + return (-1); + } - H5Dclose(dataset); - H5Pclose(proplist); - H5Sclose(dataspace); - } + /*enable error reporting */ + } + H5E_END_TRY; + + /* write dataset */ + if (H5Dwrite(dataset, intype, H5S_ALL, H5S_ALL, H5P_DEFAULT, (VOIDP) in->data) < 0) { + (void) HDfprintf(stderr, "%s", err6); + H5Dclose(dataset); + H5Pclose(proplist); + H5Sclose(dataspace); + H5Fclose(file_id); + return (-1); + } - } /* STR */ + H5Dclose(dataset); + H5Pclose(proplist); + H5Sclose(dataspace); + } + } /* STR */ - H5Fclose(file_id); - return (0); + H5Fclose(file_id); + return (0); } /* @@ -2636,294 +2425,409 @@ process(struct Options *opt) * Print a helpful summary of command usage and features. */ -void -help(char *name) +void help(char *name) { - (void) fprintf(stdout, "Name:\n\n"); - (void) fprintf(stdout, "\t%s\n\n", name); - (void) fprintf(stdout, "\t TOOL NAME:\n"); - (void) fprintf(stdout, "\t %s\n", name); - (void) fprintf(stdout, "\t SYNTAX:\n"); - (void) fprintf(stdout, "\t %s -h[elp], OR\n", name); - (void) fprintf(stdout, "\t %s -c[onfig] [ -c[config] ...]", name); - (void) fprintf(stdout, "\t\t\t\t -o[utfile] \n\n"); - (void) fprintf(stdout, "\t PURPOSE:\n"); - (void) fprintf(stdout, "\t To convert data stored in one or more ASCII or binary files\n"); - (void) fprintf(stdout, "\t into one or more datasets (in accordance with the \n"); - (void) fprintf(stdout, "\t user-specified type and storage properties) in an existing \n"); - (void) fprintf(stdout, "\t or new HDF5 file.\n\n"); - (void) fprintf(stdout, "\t DESCRIPTION:\n"); - (void) fprintf(stdout, "\t The primary objective of the utility is to convert floating\n"); - (void) fprintf(stdout, "\t point or integer data stored in ASCII text or binary form \n"); - (void) fprintf(stdout, "\t into a data-set according to the type and storage properties\n"); - (void) fprintf(stdout, "\t specified by the user. The utility can also accept ASCII\n"); - (void) fprintf(stdout, "\t text files and store the contents in a compact form as an\n"); - (void) fprintf(stdout, "\t array of one-dimensional strings.\n\n"); - (void) fprintf(stdout, "\t The input data to be written as a data-set can be provided\n"); - (void) fprintf(stdout, "\t to the utility in one of the following forms:\n"); - (void) fprintf(stdout, "\t 1. ASCII text file with numeric data (floating point or \n"); - (void) fprintf(stdout, "\t integer data). \n"); - (void) fprintf(stdout, "\t 2. Binary file with native floating point data (32-bit or \n"); - (void) fprintf(stdout, "\t 64-bit) \n"); - (void) fprintf(stdout, "\t 3. Binary file with native integer (signed or unsigned)\n"); - (void) fprintf(stdout, "\t data (8-bit or 16-bit or 32-bit or 64-bit). \n"); - (void) fprintf(stdout, "\t 4. ASCII text file containing strings (text data).\n"); - (void) fprintf(stdout, "\t \n"); - (void) fprintf(stdout, "\t Every input file is associated with a configuration file \n"); - (void) fprintf(stdout, "\t also provided as an input to the utility. (See Section \n"); - (void) fprintf(stdout, "\t \"CONFIGURATION FILE\" to know how it is to be organized).\n"); - (void) fprintf(stdout, "\t The class, size and dimensions of the input data is \n"); - (void) fprintf(stdout, "\t specified in this configuration file. A point to note is\n"); - (void) fprintf(stdout, "\t that the floating point data in the ASCII text file may be\n"); - (void) fprintf(stdout, "\t organized in the fixed floating form (for example 323.56)\n"); - (void) fprintf(stdout, "\t or in a scientific notation (for example 3.23E+02). A \n"); - (void) fprintf(stdout, "\t different input-class specification is to be used for both\n"); - (void) fprintf(stdout, "\t forms.\n\n"); - (void) fprintf(stdout, "\t The utility extracts the input data from the input file \n"); - (void) fprintf(stdout, "\t according to the specified parameters and saves it into \n"); - (void) fprintf(stdout, "\t an H5 dataset. \n\n"); - (void) fprintf(stdout, "\t The user can specify output type and storage properties in \n"); - (void) fprintf(stdout, "\t the configuration file. The user is requited to specify the \n"); - (void) fprintf(stdout, "\t path of the dataset. If the groups in the path leading to \n"); - (void) fprintf(stdout, "\t the data-set do not exist, the groups will be created by the\n"); - (void) fprintf(stdout, "\t utility. If no group is specified, the dataset will be\n"); - (void) fprintf(stdout, "\t created under the root group.\n\n"); - (void) fprintf(stdout, "\t In addition to the name, the user is also required to \n"); - (void) fprintf(stdout, "\t provide the class and size of output data to be written to \n"); - (void) fprintf(stdout, "\t the dataset and may optionally specify the output-architecure,\n"); - (void) fprintf(stdout, "\t and the output-byte-order. If output-architecture is not \n"); - (void) fprintf(stdout, "\t specified the default is NATIVE. Output-byte-orders are fixed\n"); - (void) fprintf(stdout, "\t for some architectures and may be specified only if output-\n"); - (void) fprintf(stdout, "\t architecture is IEEE, UNIX or STD.\n\n"); - (void) fprintf(stdout, "\t Also, layout and other storage properties such as \n"); - (void) fprintf(stdout, "\t compression, external storage and extendible data-sets may be\n"); - (void) fprintf(stdout, "\t optionally specified. The layout and storage properties \n"); - (void) fprintf(stdout, "\t denote how raw data is to be organized on the disk. If these \n"); - (void) fprintf(stdout, "\t options are not specified the default is Contiguous layout \n"); - (void) fprintf(stdout, "\t and storage.\n\n"); - (void) fprintf(stdout, "\t The dataset can be organized in any of the following ways:\n"); - (void) fprintf(stdout, "\t 1. Contiguous.\n"); - (void) fprintf(stdout, "\t 2. Chunked.\n"); - (void) fprintf(stdout, "\t 3. External Storage File (has to be contiguous)\n"); - (void) fprintf(stdout, "\t 4. Extendible data sets (has to be chunked)\n"); - (void) fprintf(stdout, "\t 5. Compressed. (has to be chunked)\n"); - (void) fprintf(stdout, "\t 6. Compressed & Extendible (has to be chunked)\n\n"); - (void) fprintf(stdout, "\t If the user wants to store raw data in a non-HDF file then \n"); - (void) fprintf(stdout, "\t the external storage file option is to be used and the name \n"); - (void) fprintf(stdout, "\t of the file is to be specified. \n\n"); - (void) fprintf(stdout, "\t If the user wants the dimensions of the data-set to be\n"); - (void) fprintf(stdout, "\t unlimited, the extendible data set option can be chosen. \n\n"); - (void) fprintf(stdout, "\t The user may also specify the type of compression and the \n"); - (void) fprintf(stdout, "\t level to which the data set must be compresses by setting \n"); - (void) fprintf(stdout, "\t the compressed option.\n\n"); - (void) fprintf(stdout, "\t SYNOPSIS:\n"); - (void) fprintf(stdout, "\t h5import -h[elp], OR\n"); - (void) fprintf(stdout, "\t h5import -c[onfig] \ + (void) HDfprintf(stdout, "Name:\n\n"); + (void) HDfprintf(stdout, "\t%s\n\n", name); + (void) HDfprintf(stdout, "\t TOOL NAME:\n"); + (void) HDfprintf(stdout, "\t %s\n", name); + (void) HDfprintf(stdout, "\t SYNTAX:\n"); + (void) HDfprintf(stdout, "\t %s -h[elp], OR\n", name); + (void) HDfprintf(stdout, + "\t %s -c[onfig] [ -c[config] ...]", name); + (void) HDfprintf(stdout, "\t\t\t\t -o[utfile] \n\n"); + (void) HDfprintf(stdout, "\t PURPOSE:\n"); + (void) HDfprintf(stdout, + "\t To convert data stored in one or more ASCII or binary files\n"); + (void) HDfprintf(stdout, + "\t into one or more datasets (in accordance with the \n"); + (void) HDfprintf(stdout, + "\t user-specified type and storage properties) in an existing \n"); + (void) HDfprintf(stdout, "\t or new HDF5 file.\n\n"); + (void) HDfprintf(stdout, "\t DESCRIPTION:\n"); + (void) HDfprintf(stdout, + "\t The primary objective of the utility is to convert floating\n"); + (void) HDfprintf(stdout, + "\t point or integer data stored in ASCII text or binary form \n"); + (void) HDfprintf(stdout, + "\t into a data-set according to the type and storage properties\n"); + (void) HDfprintf(stdout, + "\t specified by the user. The utility can also accept ASCII\n"); + (void) HDfprintf(stdout, + "\t text files and store the contents in a compact form as an\n"); + (void) HDfprintf(stdout, "\t array of one-dimensional strings.\n\n"); + (void) HDfprintf(stdout, + "\t The input data to be written as a data-set can be provided\n"); + (void) HDfprintf(stdout, "\t to the utility in one of the following forms:\n"); + (void) HDfprintf(stdout, + "\t 1. ASCII text file with numeric data (floating point or \n"); + (void) HDfprintf(stdout, "\t integer data). \n"); + (void) HDfprintf(stdout, + "\t 2. Binary file with native floating point data (32-bit or \n"); + (void) HDfprintf(stdout, "\t 64-bit) \n"); + (void) HDfprintf(stdout, + "\t 3. Binary file with native integer (signed or unsigned)\n"); + (void) HDfprintf(stdout, "\t data (8-bit or 16-bit or 32-bit or 64-bit). \n"); + (void) HDfprintf(stdout, + "\t 4. ASCII text file containing strings (text data).\n"); + (void) HDfprintf(stdout, "\t \n"); + (void) HDfprintf(stdout, + "\t Every input file is associated with a configuration file \n"); + (void) HDfprintf(stdout, + "\t also provided as an input to the utility. (See Section \n"); + (void) HDfprintf(stdout, + "\t \"CONFIGURATION FILE\" to know how it is to be organized).\n"); + (void) HDfprintf(stdout, + "\t The class, size and dimensions of the input data is \n"); + (void) HDfprintf(stdout, + "\t specified in this configuration file. A point to note is\n"); + (void) HDfprintf(stdout, + "\t that the floating point data in the ASCII text file may be\n"); + (void) HDfprintf(stdout, + "\t organized in the fixed floating form (for example 323.56)\n"); + (void) HDfprintf(stdout, + "\t or in a scientific notation (for example 3.23E+02). A \n"); + (void) HDfprintf(stdout, + "\t different input-class specification is to be used for both\n"); + (void) HDfprintf(stdout, "\t forms.\n\n"); + (void) HDfprintf(stdout, + "\t The utility extracts the input data from the input file \n"); + (void) HDfprintf(stdout, + "\t according to the specified parameters and saves it into \n"); + (void) HDfprintf(stdout, "\t an H5 dataset. \n\n"); + (void) HDfprintf(stdout, + "\t The user can specify output type and storage properties in \n"); + (void) HDfprintf(stdout, + "\t the configuration file. The user is requited to specify the \n"); + (void) HDfprintf(stdout, + "\t path of the dataset. If the groups in the path leading to \n"); + (void) HDfprintf(stdout, + "\t the data-set do not exist, the groups will be created by the\n"); + (void) HDfprintf(stdout, + "\t utility. If no group is specified, the dataset will be\n"); + (void) HDfprintf(stdout, "\t created under the root group.\n\n"); + (void) HDfprintf(stdout, + "\t In addition to the name, the user is also required to \n"); + (void) HDfprintf(stdout, + "\t provide the class and size of output data to be written to \n"); + (void) HDfprintf(stdout, + "\t the dataset and may optionally specify the output-architecure,\n"); + (void) HDfprintf(stdout, + "\t and the output-byte-order. If output-architecture is not \n"); + (void) HDfprintf(stdout, + "\t specified the default is NATIVE. Output-byte-orders are fixed\n"); + (void) HDfprintf(stdout, + "\t for some architectures and may be specified only if output-\n"); + (void) HDfprintf(stdout, "\t architecture is IEEE, UNIX or STD.\n\n"); + (void) HDfprintf(stdout, + "\t Also, layout and other storage properties such as \n"); + (void) HDfprintf(stdout, + "\t compression, external storage and extendible data-sets may be\n"); + (void) HDfprintf(stdout, + "\t optionally specified. The layout and storage properties \n"); + (void) HDfprintf(stdout, + "\t denote how raw data is to be organized on the disk. If these \n"); + (void) HDfprintf(stdout, + "\t options are not specified the default is Contiguous layout \n"); + (void) HDfprintf(stdout, "\t and storage.\n\n"); + (void) HDfprintf(stdout, + "\t The dataset can be organized in any of the following ways:\n"); + (void) HDfprintf(stdout, "\t 1. Contiguous.\n"); + (void) HDfprintf(stdout, "\t 2. Chunked.\n"); + (void) HDfprintf(stdout, + "\t 3. External Storage File (has to be contiguous)\n"); + (void) HDfprintf(stdout, + "\t 4. Extendible data sets (has to be chunked)\n"); + (void) HDfprintf(stdout, "\t 5. Compressed. (has to be chunked)\n"); + (void) HDfprintf(stdout, + "\t 6. Compressed & Extendible (has to be chunked)\n\n"); + (void) HDfprintf(stdout, + "\t If the user wants to store raw data in a non-HDF file then \n"); + (void) HDfprintf(stdout, + "\t the external storage file option is to be used and the name \n"); + (void) HDfprintf(stdout, "\t of the file is to be specified. \n\n"); + (void) HDfprintf(stdout, + "\t If the user wants the dimensions of the data-set to be\n"); + (void) HDfprintf(stdout, + "\t unlimited, the extendible data set option can be chosen. \n\n"); + (void) HDfprintf(stdout, + "\t The user may also specify the type of compression and the \n"); + (void) HDfprintf(stdout, + "\t level to which the data set must be compresses by setting \n"); + (void) HDfprintf(stdout, "\t the compressed option.\n\n"); + (void) HDfprintf(stdout, "\t SYNOPSIS:\n"); + (void) HDfprintf(stdout, "\t h5import -h[elp], OR\n"); + (void) HDfprintf( stdout, + "\t h5import -c[onfig] \ [ -c[config] ...] -o[utfile] \n\n"); - (void) fprintf(stdout, "\t -h[elp]:\n"); - (void) fprintf(stdout, "\t Prints this summary of usage, and exits.\n\n"); - (void) fprintf(stdout, "\t :\n"); - (void) fprintf(stdout, "\t Name of the Input file(s), containing a \n"); - (void) fprintf(stdout, "\t single n-dimensional floating point or integer array \n"); - (void) fprintf(stdout, "\t in either ASCII text, native floating point(32-bit \n"); - (void) fprintf(stdout, "\t or 64-bit) or native integer(8-bit or 16-bit or \n"); - (void) fprintf(stdout, "\t 32-bit or 64-bit). Data to be specified in the order\n"); - (void) fprintf(stdout, "\t of fastest changing dimensions first.\n\n"); - (void) fprintf(stdout, "\t -c[config] :\n"); - (void) fprintf(stdout, "\t Every input file should be associated with a \n"); - (void) fprintf(stdout, "\t configuration file and this is done by the -c option.\n"); - (void) fprintf(stdout, "\t is the name of the configuration file.\n"); - (void) fprintf(stdout, "\t (See Section \"CONFIGURATION FILE\")\n\n"); - (void) fprintf(stdout, "\t -o[utfile] :\n"); - (void) fprintf(stdout, "\t Name of the HDF5 output file. Data from one or more \n"); - (void) fprintf(stdout, "\t input files are stored as one or more data sets in \n"); - (void) fprintf(stdout, "\t . The output file may be an existing file or \n"); - (void) fprintf(stdout, "\t it maybe new in which case it will be created.\n\n\n"); - (void) fprintf(stdout, "\t CONFIGURATION FILE:\n"); - (void) fprintf(stdout, "\t The configuration file is an ASCII text file and must be \n"); - (void) fprintf(stdout, "\t organized as \"CONFIG-KEYWORD VALUE\" pairs, one pair on each \n"); - (void) fprintf(stdout, "\t line.\n\n"); - (void) fprintf(stdout, "\t The configuration file may have the following keywords each \n"); - (void) fprintf(stdout, "\t followed by an acceptable value.\n\n"); - (void) fprintf(stdout, "\t Required KEYWORDS:\n"); - (void) fprintf(stdout, "\t PATH\n"); - (void) fprintf(stdout, "\t INPUT-CLASS\n"); - (void) fprintf(stdout, "\t INPUT-SIZE\n"); - (void) fprintf(stdout, "\t RANK\n"); - (void) fprintf(stdout, "\t DIMENSION-SIZES\n"); - (void) fprintf(stdout, "\t OUTPUT-CLASS\n"); - (void) fprintf(stdout, "\t OUTPUT-SIZE\n\n"); - (void) fprintf(stdout, "\t Optional KEYWORDS:\n"); - (void) fprintf(stdout, "\t OUTPUT-ARCHITECTURE\n"); - (void) fprintf(stdout, "\t OUTPUT-BYTE-ORDER\n"); - (void) fprintf(stdout, "\t CHUNKED-DIMENSION-SIZES\n"); - (void) fprintf(stdout, "\t COMPRESSION-TYPE\n"); - (void) fprintf(stdout, "\t COMPRESSION-PARAM\n"); - (void) fprintf(stdout, "\t EXTERNAL-STORAGE\n"); - (void) fprintf(stdout, "\t MAXIMUM-DIMENSIONS\n\n\n"); - (void) fprintf(stdout, "\t Values for keywords:\n"); - (void) fprintf(stdout, "\t PATH:\n"); - (void) fprintf(stdout, "\t Strings separated by spaces to represent\n"); - (void) fprintf(stdout, "\t the path of the data-set. If the groups in\n"); - (void) fprintf(stdout, "\t the path do no exist, they will be created. \n"); - (void) fprintf(stdout, "\t For example,\n"); - (void) fprintf(stdout, "\t PATH grp1/grp2/dataset1\n"); - (void) fprintf(stdout, "\t PATH: keyword\n"); - (void) fprintf(stdout, "\t grp1: group under the root. If\n"); - (void) fprintf(stdout, "\t non-existent will be created.\n"); - (void) fprintf(stdout, "\t grp2: group under grp1. If \n"); - (void) fprintf(stdout, "\t non-existent will be created \n"); - (void) fprintf(stdout, "\t under grp1.\n"); - (void) fprintf(stdout, "\t dataset1: the name of the data-set \n"); - (void) fprintf(stdout, "\t to be created.\n\n"); - (void) fprintf(stdout, "\t INPUT-CLASS:\n"); - (void) fprintf(stdout, "\t String denoting the type of input data.\n"); - (void) fprintf(stdout, "\t (\"TEXTIN\", \"TEXTFP\", \"FP\", \"IN\", \n"); - (void) fprintf(stdout, "\t \"STR\", \"TEXTUIN\", \"UIN\"). \n"); - (void) fprintf(stdout, "\t INPUT-CLASS \"TEXTIN\" denotes an ASCII text \n"); - (void) fprintf(stdout, "\t file with signed integer data in ASCII form,\n"); - (void) fprintf(stdout, "\t INPUT-CLASS \"TEXTUIN\" denotes an ASCII text \n"); - (void) fprintf(stdout, "\t file with unsigned integer data in ASCII form,\n"); - (void) fprintf(stdout, "\t \"TEXTFP\" denotes an ASCII text file containing\n"); - (void) fprintf(stdout, "\t floating point data in the fixed notation\n"); - (void) fprintf(stdout, "\t (325.34),\n"); - (void) fprintf(stdout, "\t \"FP\" denotes a floating point binary file,\n"); - (void) fprintf(stdout, "\t \"IN\" denotes a signed integer binary file,\n"); - (void) fprintf(stdout, "\t \"UIN\" denotes an unsigned integer binary file,\n"); - (void) fprintf(stdout, "\t & \"STR\" denotes an ASCII text file the \n"); - (void) fprintf(stdout, "\t contents of which should be stored as an 1-D \n"); - (void) fprintf(stdout, "\t array of strings.\n"); - (void) fprintf(stdout, "\t If INPUT-CLASS is \"STR\", then RANK, \n"); - (void) fprintf(stdout, "\t DIMENSION-SIZES, OUTPUT-CLASS, OUTPUT-SIZE, \n"); - (void) fprintf(stdout, "\t OUTPUT-ARCHITECTURE and OUTPUT-BYTE-ORDER \n"); - (void) fprintf(stdout, "\t will be ignored.\n\n\n"); - (void) fprintf(stdout, "\t INPUT-SIZE:\n"); - (void) fprintf(stdout, "\t Integer denoting the size of the input data \n"); - (void) fprintf(stdout, "\t (8, 16, 32, 64). \n\n"); - (void) fprintf(stdout, "\t For floating point,\n"); - (void) fprintf(stdout, "\t INPUT-SIZE can be 32 or 64.\n"); - (void) fprintf(stdout, "\t For integers (signed and unsigned)\n"); - (void) fprintf(stdout, "\t INPUT-SIZE can be 8, 16, 32 or 64.\n\n"); - (void) fprintf(stdout, "\t RANK:\n"); - (void) fprintf(stdout, "\t Integer denoting the number of dimensions.\n\n"); - (void) fprintf(stdout, "\t DIMENSION-SIZES:\n"); - (void) fprintf(stdout, "\t Integers separated by spaces to denote the \n"); - (void) fprintf(stdout, "\t dimension sizes for the no. of dimensions \n"); - (void) fprintf(stdout, "\t determined by rank.\n\n"); - (void) fprintf(stdout, "\t OUTPUT-CLASS:\n"); - (void) fprintf(stdout, "\t String dentoting data type of the dataset to \n"); - (void) fprintf(stdout, "\t be written (\"IN\",\"FP\", \"UIN\")\n\n"); - (void) fprintf(stdout, "\t OUTPUT-SIZE:\n"); - (void) fprintf(stdout, "\t Integer denoting the size of the data in the \n"); - (void) fprintf(stdout, "\t output dataset to be written.\n"); - (void) fprintf(stdout, "\t If OUTPUT-CLASS is \"FP\", OUTPUT-SIZE can be \n"); - (void) fprintf(stdout, "\t 32 or 64.\n"); - (void) fprintf(stdout, "\t If OUTPUT-CLASS is \"IN\" or \"UIN\", OUTPUT-SIZE\n"); - (void) fprintf(stdout, "\t can be 8, 16, 32 or 64.\n\n"); - (void) fprintf(stdout, "\t OUTPUT-ARCHITECTURE:\n"); - (void) fprintf(stdout, "\t STRING denoting the type of output \n"); - (void) fprintf(stdout, "\t architecture. Can accept the following values\n"); - (void) fprintf(stdout, "\t STD\n"); - (void) fprintf(stdout, "\t IEEE\n"); - (void) fprintf(stdout, "\t INTEL\n"); - (void) fprintf(stdout, "\t CRAY\n"); - (void) fprintf(stdout, "\t MIPS\n"); - (void) fprintf(stdout, "\t ALPHA\n"); - (void) fprintf(stdout, "\t NATIVE (default)\n"); - (void) fprintf(stdout, "\t UNIX\n\n"); - (void) fprintf(stdout, "\t OUTPUT-BYTE-ORDER:\n"); - (void) fprintf(stdout, "\t String denoting the output-byte-order. Ignored\n"); - (void) fprintf(stdout, "\t if the OUTPUT-ARCHITECTURE is not specified or\n"); - (void) fprintf(stdout, "\t if it is IEEE, UNIX or STD. Can accept the \n"); - (void) fprintf(stdout, "\t following values.\n"); - (void) fprintf(stdout, "\t BE (default)\n"); - (void) fprintf(stdout, "\t LE\n\n"); - (void) fprintf(stdout, "\t CHUNKED-DIMENSION-SIZES:\n"); - (void) fprintf(stdout, "\t Integers separated by spaces to denote the \n"); - (void) fprintf(stdout, "\t dimension sizes of the chunk for the no. of \n"); - (void) fprintf(stdout, "\t dimensions determined by rank. Required field\n"); - (void) fprintf(stdout, "\t to denote that the dataset will be stored with\n"); - (void) fprintf(stdout, "\t chunked storage. If this field is absent the\n"); - (void) fprintf(stdout, "\t dataset will be stored with contiguous storage.\n\n"); - (void) fprintf(stdout, "\t COMPRESSION-TYPE:\n"); - (void) fprintf(stdout, "\t String denoting the type of compression to be\n"); - (void) fprintf(stdout, "\t used with the chunked storage. Requires the\n"); - (void) fprintf(stdout, "\t CHUNKED-DIMENSION-SIZES to be specified. The only \n"); - (void) fprintf(stdout, "\t currently supported compression method is GZIP. \n"); - (void) fprintf(stdout, "\t Will accept the following value\n"); - (void) fprintf(stdout, "\t GZIP\n\n"); - (void) fprintf(stdout, "\t COMPRESSION-PARAM:\n"); - (void) fprintf(stdout, "\t Integer used to denote compression level and \n"); - (void) fprintf(stdout, "\t this option is to be always specified when \n"); - (void) fprintf(stdout, "\t the COMPRESSION-TYPE option is specified. The\n"); - (void) fprintf(stdout, "\t values are applicable only to GZIP \n"); - (void) fprintf(stdout, "\t compression.\n"); - (void) fprintf(stdout, "\t Value 1-9: The level of Compression. \n"); - (void) fprintf(stdout, "\t 1 will result in the fastest \n"); - (void) fprintf(stdout, "\t compression while 9 will result in \n"); - (void) fprintf(stdout, "\t the best compression ratio. The default\n"); - (void) fprintf(stdout, "\t level of compression is 6.\n\n"); - (void) fprintf(stdout, "\t EXTERNAL-STORAGE:\n"); - (void) fprintf(stdout, "\t String to denote the name of the non-HDF5 file \n"); - (void) fprintf(stdout, "\t to store data to. Cannot be used if CHUNKED-\n"); - (void) fprintf(stdout, "\t DIMENSIONS or COMPRESSION-TYPE or EXTENDIBLE-\n"); - (void) fprintf(stdout, "\t DATASET is specified.\n"); - (void) fprintf(stdout, "\t Value : the name of the \n"); - (void) fprintf(stdout, "\t external file as a string to be used.\n\n"); - (void) fprintf(stdout, "\t MAXIMUM-DIMENSIONS:\n"); - (void) fprintf(stdout, "\t Integers separated by spaces to denote the \n"); - (void) fprintf(stdout, "\t maximum dimension sizes of all the \n"); - (void) fprintf(stdout, "\t dimensions determined by rank. Requires the\n"); - (void) fprintf(stdout, "\t CHUNKED-DIMENSION-SIZES to be specified. A value of \n"); - (void) fprintf(stdout, "\t -1 for any dimension implies UNLIMITED \n"); - (void) fprintf(stdout, "\t DIMENSION size for that particular dimension.\n\n"); - (void) fprintf(stdout, "\t EXAMPLES:\n"); - (void) fprintf(stdout, "\t 1. Configuration File may look like:\n\n"); - (void) fprintf(stdout, "\t PATH work h5 pkamat First-set\n"); - (void) fprintf(stdout, "\t INPUT-CLASS TEXTFP\n"); - (void) fprintf(stdout, "\t RANK 3\n"); - (void) fprintf(stdout, "\t DIMENSION-SIZES 5 2 4\n"); - (void) fprintf(stdout, "\t OUTPUT-CLASS FP\n"); - (void) fprintf(stdout, "\t OUTPUT-SIZE 64\n"); - (void) fprintf(stdout, "\t OUTPUT-ARCHITECTURE IEEE\n"); - (void) fprintf(stdout, "\t OUTPUT-BYTE-ORDER LE\n"); - (void) fprintf(stdout, "\t CHUNKED-DIMENSION-SIZES 2 2 2 \n\n"); - (void) fprintf(stdout, "\t The above configuration will accept a floating point array \n"); - (void) fprintf(stdout, "\t (5 x 2 x 4) in an ASCII file with the rank and dimension sizes \n"); - (void) fprintf(stdout, "\t specified and will save it in a chunked data-set (of pattern \n"); - (void) fprintf(stdout, "\t 2 X 2 X 2) of 64-bit floating point in the little-endian order \n"); - (void) fprintf(stdout, "\t and IEEE architecture. The dataset will be stored at\n"); - (void) fprintf(stdout, "\t \"/work/h5/pkamat/First-set\"\n\n"); - (void) fprintf(stdout, "\t 2. Another configuration could be:\n\n"); - (void) fprintf(stdout, "\t PATH Second-set\n"); - (void) fprintf(stdout, "\t INPUT-CLASS IN \n"); - (void) fprintf(stdout, "\t RANK 5\n"); - (void) fprintf(stdout, "\t DIMENSION-SIZES 6 3 5 2 4\n"); - (void) fprintf(stdout, "\t OUTPUT-CLASS IN\n"); - (void) fprintf(stdout, "\t OUTPUT-SIZE 32\n"); - (void) fprintf(stdout, "\t CHUNKED-DIMENSION-SIZES 2 2 2 2 2\n"); - (void) fprintf(stdout, "\t EXTENDIBLE-DATASET 1 3 \n"); - (void) fprintf(stdout, "\t COMPRESSION-TYPE GZIP\n"); - (void) fprintf(stdout, "\t COMPRESSION-PARAM 7\n\n\n"); - (void) fprintf(stdout, "\t The above configuration will accept an integer array \n"); - (void) fprintf(stdout, "\t (6 X 3 X 5 x 2 x 4) in a binary file with the rank and \n"); - (void) fprintf(stdout, "\t dimension sizes specified and will save it in a chunked data-set\n"); - (void) fprintf(stdout, "\t (of pattern 2 X 2 X 2 X 2 X 2) of 32-bit floating point in \n"); - (void) fprintf(stdout, "\t native format (as output-architecture is not specified). The \n"); - (void) fprintf(stdout, "\t first and the third dimension will be defined as unlimited. The \n"); - (void) fprintf(stdout, "\t data-set will be compressed using GZIP and a compression level \n"); - (void) fprintf(stdout, "\t of 7.\n"); - (void) fprintf(stdout, "\t The dataset will be stored at \"/Second-set\"\n\n"); - return; + (void) HDfprintf(stdout, "\t -h[elp]:\n"); + (void) HDfprintf(stdout, + "\t Prints this summary of usage, and exits.\n\n"); + (void) HDfprintf(stdout, "\t :\n"); + (void) HDfprintf(stdout, + "\t Name of the Input file(s), containing a \n"); + (void) HDfprintf(stdout, + "\t single n-dimensional floating point or integer array \n"); + (void) HDfprintf(stdout, + "\t in either ASCII text, native floating point(32-bit \n"); + (void) HDfprintf(stdout, + "\t or 64-bit) or native integer(8-bit or 16-bit or \n"); + (void) HDfprintf(stdout, + "\t 32-bit or 64-bit). Data to be specified in the order\n"); + (void) HDfprintf(stdout, "\t of fastest changing dimensions first.\n\n"); + (void) HDfprintf(stdout, "\t -c[config] :\n"); + (void) HDfprintf(stdout, + "\t Every input file should be associated with a \n"); + (void) HDfprintf(stdout, + "\t configuration file and this is done by the -c option.\n"); + (void) HDfprintf(stdout, + "\t is the name of the configuration file.\n"); + (void) HDfprintf(stdout, "\t (See Section \"CONFIGURATION FILE\")\n\n"); + (void) HDfprintf(stdout, "\t -o[utfile] :\n"); + (void) HDfprintf(stdout, + "\t Name of the HDF5 output file. Data from one or more \n"); + (void) HDfprintf(stdout, + "\t input files are stored as one or more data sets in \n"); + (void) HDfprintf(stdout, + "\t . The output file may be an existing file or \n"); + (void) HDfprintf(stdout, + "\t it maybe new in which case it will be created.\n\n\n"); + (void) HDfprintf(stdout, "\t CONFIGURATION FILE:\n"); + (void) HDfprintf(stdout, + "\t The configuration file is an ASCII text file and must be \n"); + (void) HDfprintf(stdout, + "\t organized as \"CONFIG-KEYWORD VALUE\" pairs, one pair on each \n"); + (void) HDfprintf(stdout, "\t line.\n\n"); + (void) HDfprintf(stdout, + "\t The configuration file may have the following keywords each \n"); + (void) HDfprintf(stdout, "\t followed by an acceptable value.\n\n"); + (void) HDfprintf(stdout, "\t Required KEYWORDS:\n"); + (void) HDfprintf(stdout, "\t PATH\n"); + (void) HDfprintf(stdout, "\t INPUT-CLASS\n"); + (void) HDfprintf(stdout, "\t INPUT-SIZE\n"); + (void) HDfprintf(stdout, "\t RANK\n"); + (void) HDfprintf(stdout, "\t DIMENSION-SIZES\n"); + (void) HDfprintf(stdout, "\t OUTPUT-CLASS\n"); + (void) HDfprintf(stdout, "\t OUTPUT-SIZE\n\n"); + (void) HDfprintf(stdout, "\t Optional KEYWORDS:\n"); + (void) HDfprintf(stdout, "\t OUTPUT-ARCHITECTURE\n"); + (void) HDfprintf(stdout, "\t OUTPUT-BYTE-ORDER\n"); + (void) HDfprintf(stdout, "\t CHUNKED-DIMENSION-SIZES\n"); + (void) HDfprintf(stdout, "\t COMPRESSION-TYPE\n"); + (void) HDfprintf(stdout, "\t COMPRESSION-PARAM\n"); + (void) HDfprintf(stdout, "\t EXTERNAL-STORAGE\n"); + (void) HDfprintf(stdout, "\t MAXIMUM-DIMENSIONS\n\n\n"); + (void) HDfprintf(stdout, "\t Values for keywords:\n"); + (void) HDfprintf(stdout, "\t PATH:\n"); + (void) HDfprintf(stdout, "\t Strings separated by spaces to represent\n"); + (void) HDfprintf(stdout, "\t the path of the data-set. If the groups in\n"); + (void) HDfprintf(stdout, + "\t the path do no exist, they will be created. \n"); + (void) HDfprintf(stdout, "\t For example,\n"); + (void) HDfprintf(stdout, "\t PATH grp1/grp2/dataset1\n"); + (void) HDfprintf(stdout, "\t PATH: keyword\n"); + (void) HDfprintf(stdout, "\t grp1: group under the root. If\n"); + (void) HDfprintf(stdout, "\t non-existent will be created.\n"); + (void) HDfprintf(stdout, "\t grp2: group under grp1. If \n"); + (void) HDfprintf(stdout, "\t non-existent will be created \n"); + (void) HDfprintf(stdout, "\t under grp1.\n"); + (void) HDfprintf(stdout, "\t dataset1: the name of the data-set \n"); + (void) HDfprintf(stdout, "\t to be created.\n\n"); + (void) HDfprintf(stdout, "\t INPUT-CLASS:\n"); + (void) HDfprintf(stdout, "\t String denoting the type of input data.\n"); + (void) HDfprintf(stdout, "\t (\"TEXTIN\", \"TEXTFP\", \"FP\", \"IN\", \n"); + (void) HDfprintf(stdout, "\t \"STR\", \"TEXTUIN\", \"UIN\"). \n"); + (void) HDfprintf(stdout, + "\t INPUT-CLASS \"TEXTIN\" denotes an ASCII text \n"); + (void) HDfprintf(stdout, + "\t file with signed integer data in ASCII form,\n"); + (void) HDfprintf(stdout, + "\t INPUT-CLASS \"TEXTUIN\" denotes an ASCII text \n"); + (void) HDfprintf(stdout, + "\t file with unsigned integer data in ASCII form,\n"); + (void) HDfprintf(stdout, + "\t \"TEXTFP\" denotes an ASCII text file containing\n"); + (void) HDfprintf(stdout, "\t floating point data in the fixed notation\n"); + (void) HDfprintf(stdout, "\t (325.34),\n"); + (void) HDfprintf(stdout, + "\t \"FP\" denotes a floating point binary file,\n"); + (void) HDfprintf(stdout, + "\t \"IN\" denotes a signed integer binary file,\n"); + (void) HDfprintf(stdout, + "\t \"UIN\" denotes an unsigned integer binary file,\n"); + (void) HDfprintf(stdout, "\t & \"STR\" denotes an ASCII text file the \n"); + (void) HDfprintf(stdout, + "\t contents of which should be stored as an 1-D \n"); + (void) HDfprintf(stdout, "\t array of strings.\n"); + (void) HDfprintf(stdout, "\t If INPUT-CLASS is \"STR\", then RANK, \n"); + (void) HDfprintf(stdout, + "\t DIMENSION-SIZES, OUTPUT-CLASS, OUTPUT-SIZE, \n"); + (void) HDfprintf(stdout, "\t OUTPUT-ARCHITECTURE and OUTPUT-BYTE-ORDER \n"); + (void) HDfprintf(stdout, "\t will be ignored.\n\n\n"); + (void) HDfprintf(stdout, "\t INPUT-SIZE:\n"); + (void) HDfprintf(stdout, + "\t Integer denoting the size of the input data \n"); + (void) HDfprintf(stdout, "\t (8, 16, 32, 64). \n\n"); + (void) HDfprintf(stdout, "\t For floating point,\n"); + (void) HDfprintf(stdout, "\t INPUT-SIZE can be 32 or 64.\n"); + (void) HDfprintf(stdout, "\t For integers (signed and unsigned)\n"); + (void) HDfprintf(stdout, "\t INPUT-SIZE can be 8, 16, 32 or 64.\n\n"); + (void) HDfprintf(stdout, "\t RANK:\n"); + (void) HDfprintf(stdout, + "\t Integer denoting the number of dimensions.\n\n"); + (void) HDfprintf(stdout, "\t DIMENSION-SIZES:\n"); + (void) HDfprintf(stdout, + "\t Integers separated by spaces to denote the \n"); + (void) HDfprintf(stdout, "\t dimension sizes for the no. of dimensions \n"); + (void) HDfprintf(stdout, "\t determined by rank.\n\n"); + (void) HDfprintf(stdout, "\t OUTPUT-CLASS:\n"); + (void) HDfprintf(stdout, + "\t String dentoting data type of the dataset to \n"); + (void) HDfprintf(stdout, "\t be written (\"IN\",\"FP\", \"UIN\")\n\n"); + (void) HDfprintf(stdout, "\t OUTPUT-SIZE:\n"); + (void) HDfprintf(stdout, + "\t Integer denoting the size of the data in the \n"); + (void) HDfprintf(stdout, "\t output dataset to be written.\n"); + (void) HDfprintf(stdout, + "\t If OUTPUT-CLASS is \"FP\", OUTPUT-SIZE can be \n"); + (void) HDfprintf(stdout, "\t 32 or 64.\n"); + (void) HDfprintf(stdout, + "\t If OUTPUT-CLASS is \"IN\" or \"UIN\", OUTPUT-SIZE\n"); + (void) HDfprintf(stdout, "\t can be 8, 16, 32 or 64.\n\n"); + (void) HDfprintf(stdout, "\t OUTPUT-ARCHITECTURE:\n"); + (void) HDfprintf(stdout, "\t STRING denoting the type of output \n"); + (void) HDfprintf(stdout, + "\t architecture. Can accept the following values\n"); + (void) HDfprintf(stdout, "\t STD\n"); + (void) HDfprintf(stdout, "\t IEEE\n"); + (void) HDfprintf(stdout, "\t INTEL\n"); + (void) HDfprintf(stdout, "\t CRAY\n"); + (void) HDfprintf(stdout, "\t MIPS\n"); + (void) HDfprintf(stdout, "\t ALPHA\n"); + (void) HDfprintf(stdout, "\t NATIVE (default)\n"); + (void) HDfprintf(stdout, "\t UNIX\n\n"); + (void) HDfprintf(stdout, "\t OUTPUT-BYTE-ORDER:\n"); + (void) HDfprintf(stdout, + "\t String denoting the output-byte-order. Ignored\n"); + (void) HDfprintf(stdout, + "\t if the OUTPUT-ARCHITECTURE is not specified or\n"); + (void) HDfprintf(stdout, "\t if it is IEEE, UNIX or STD. Can accept the \n"); + (void) HDfprintf(stdout, "\t following values.\n"); + (void) HDfprintf(stdout, "\t BE (default)\n"); + (void) HDfprintf(stdout, "\t LE\n\n"); + (void) HDfprintf(stdout, "\t CHUNKED-DIMENSION-SIZES:\n"); + (void) HDfprintf(stdout, "\t Integers separated by spaces to denote the \n"); + (void) HDfprintf(stdout, + "\t dimension sizes of the chunk for the no. of \n"); + (void) HDfprintf(stdout, + "\t dimensions determined by rank. Required field\n"); + (void) HDfprintf(stdout, + "\t to denote that the dataset will be stored with\n"); + (void) HDfprintf(stdout, + "\t chunked storage. If this field is absent the\n"); + (void) HDfprintf(stdout, + "\t dataset will be stored with contiguous storage.\n\n"); + (void) HDfprintf(stdout, "\t COMPRESSION-TYPE:\n"); + (void) HDfprintf(stdout, + "\t String denoting the type of compression to be\n"); + (void) HDfprintf(stdout, "\t used with the chunked storage. Requires the\n"); + (void) HDfprintf(stdout, + "\t CHUNKED-DIMENSION-SIZES to be specified. The only \n"); + (void) HDfprintf(stdout, + "\t currently supported compression method is GZIP. \n"); + (void) HDfprintf(stdout, "\t Will accept the following value\n"); + (void) HDfprintf(stdout, "\t GZIP\n\n"); + (void) HDfprintf(stdout, "\t COMPRESSION-PARAM:\n"); + (void) HDfprintf(stdout, + "\t Integer used to denote compression level and \n"); + (void) HDfprintf(stdout, "\t this option is to be always specified when \n"); + (void) HDfprintf(stdout, + "\t the COMPRESSION-TYPE option is specified. The\n"); + (void) HDfprintf(stdout, "\t values are applicable only to GZIP \n"); + (void) HDfprintf(stdout, "\t compression.\n"); + (void) HDfprintf(stdout, "\t Value 1-9: The level of Compression. \n"); + (void) HDfprintf(stdout, "\t 1 will result in the fastest \n"); + (void) HDfprintf(stdout, "\t compression while 9 will result in \n"); + (void) HDfprintf(stdout, "\t the best compression ratio. The default\n"); + (void) HDfprintf(stdout, "\t level of compression is 6.\n\n"); + (void) HDfprintf(stdout, "\t EXTERNAL-STORAGE:\n"); + (void) HDfprintf(stdout, + "\t String to denote the name of the non-HDF5 file \n"); + (void) HDfprintf(stdout, + "\t to store data to. Cannot be used if CHUNKED-\n"); + (void) HDfprintf(stdout, + "\t DIMENSIONS or COMPRESSION-TYPE or EXTENDIBLE-\n"); + (void) HDfprintf(stdout, "\t DATASET is specified.\n"); + (void) HDfprintf(stdout, "\t Value : the name of the \n"); + (void) HDfprintf(stdout, "\t external file as a string to be used.\n\n"); + (void) HDfprintf(stdout, "\t MAXIMUM-DIMENSIONS:\n"); + (void) HDfprintf(stdout, "\t Integers separated by spaces to denote the \n"); + (void) HDfprintf(stdout, "\t maximum dimension sizes of all the \n"); + (void) HDfprintf(stdout, "\t dimensions determined by rank. Requires the\n"); + (void) HDfprintf(stdout, + "\t CHUNKED-DIMENSION-SIZES to be specified. A value of \n"); + (void) HDfprintf(stdout, "\t -1 for any dimension implies UNLIMITED \n"); + (void) HDfprintf(stdout, + "\t DIMENSION size for that particular dimension.\n\n"); + (void) HDfprintf(stdout, "\t EXAMPLES:\n"); + (void) HDfprintf(stdout, "\t 1. Configuration File may look like:\n\n"); + (void) HDfprintf(stdout, "\t PATH work h5 pkamat First-set\n"); + (void) HDfprintf(stdout, "\t INPUT-CLASS TEXTFP\n"); + (void) HDfprintf(stdout, "\t RANK 3\n"); + (void) HDfprintf(stdout, "\t DIMENSION-SIZES 5 2 4\n"); + (void) HDfprintf(stdout, "\t OUTPUT-CLASS FP\n"); + (void) HDfprintf(stdout, "\t OUTPUT-SIZE 64\n"); + (void) HDfprintf(stdout, "\t OUTPUT-ARCHITECTURE IEEE\n"); + (void) HDfprintf(stdout, "\t OUTPUT-BYTE-ORDER LE\n"); + (void) HDfprintf(stdout, "\t CHUNKED-DIMENSION-SIZES 2 2 2 \n\n"); + (void) HDfprintf(stdout, + "\t The above configuration will accept a floating point array \n"); + (void) HDfprintf(stdout, + "\t (5 x 2 x 4) in an ASCII file with the rank and dimension sizes \n"); + (void) HDfprintf(stdout, + "\t specified and will save it in a chunked data-set (of pattern \n"); + (void) HDfprintf(stdout, + "\t 2 X 2 X 2) of 64-bit floating point in the little-endian order \n"); + (void) HDfprintf(stdout, + "\t and IEEE architecture. The dataset will be stored at\n"); + (void) HDfprintf(stdout, "\t \"/work/h5/pkamat/First-set\"\n\n"); + (void) HDfprintf(stdout, "\t 2. Another configuration could be:\n\n"); + (void) HDfprintf(stdout, "\t PATH Second-set\n"); + (void) HDfprintf(stdout, "\t INPUT-CLASS IN \n"); + (void) HDfprintf(stdout, "\t RANK 5\n"); + (void) HDfprintf(stdout, "\t DIMENSION-SIZES 6 3 5 2 4\n"); + (void) HDfprintf(stdout, "\t OUTPUT-CLASS IN\n"); + (void) HDfprintf(stdout, "\t OUTPUT-SIZE 32\n"); + (void) HDfprintf(stdout, "\t CHUNKED-DIMENSION-SIZES 2 2 2 2 2\n"); + (void) HDfprintf(stdout, "\t EXTENDIBLE-DATASET 1 3 \n"); + (void) HDfprintf(stdout, "\t COMPRESSION-TYPE GZIP\n"); + (void) HDfprintf(stdout, "\t COMPRESSION-PARAM 7\n\n\n"); + (void) HDfprintf(stdout, + "\t The above configuration will accept an integer array \n"); + (void) HDfprintf(stdout, + "\t (6 X 3 X 5 x 2 x 4) in a binary file with the rank and \n"); + (void) HDfprintf(stdout, + "\t dimension sizes specified and will save it in a chunked data-set\n"); + (void) HDfprintf(stdout, + "\t (of pattern 2 X 2 X 2 X 2 X 2) of 32-bit floating point in \n"); + (void) HDfprintf(stdout, + "\t native format (as output-architecture is not specified). The \n"); + (void) HDfprintf(stdout, + "\t first and the third dimension will be defined as unlimited. The \n"); + (void) HDfprintf(stdout, + "\t data-set will be compressed using GZIP and a compression level \n"); + (void) HDfprintf(stdout, "\t of 7.\n"); + (void) HDfprintf(stdout, + "\t The dataset will be stored at \"/Second-set\"\n\n"); + return; } - -void -usage(char *name) +void usage(char *name) { - (void) fprintf(stdout, "\nUsage:\t%s -h[elp], OR\n", name); - (void) fprintf(stdout, "\t%s -c[onfig] \ + (void) HDfprintf(stdout, "\nUsage:\t%s -h[elp], OR\n", name); + (void) HDfprintf(stdout, + "\t%s -c[onfig] \ [ -c[config] ...] -o[utfile] \n\n", name); - return; + return; } diff --git a/tools/h5import/h5import.h b/tools/h5import/h5import.h index 9e4f6e8..dbc6844 100755 --- a/tools/h5import/h5import.h +++ b/tools/h5import/h5import.h @@ -47,7 +47,7 @@ #define CHUNK 0 #define COMPRESS 1 #define EXTEND 2 -#define EXTERNAL 3 +#define EXTERNALSTORE 3 #define DIM 4 #define RANK 5 #define PATH 6 @@ -74,111 +74,110 @@ struct path_info { - char group[MAX_GROUPS_IN_PATH][MAX_PATH_NAME_LENGTH]; - int count; + char group[MAX_GROUPS_IN_PATH][MAX_PATH_NAME_LENGTH]; + int count; }; struct Input { - struct path_info path; - int inputClass; - int inputSize; - int rank; - hsize_t* sizeOfDimension; - int outputClass; - int outputSize; - int outputArchitecture; - int outputByteOrder; - hsize_t* sizeOfChunk; - hsize_t* maxsizeOfDimension; - int compressionType; - int compressionParam; - char *externFilename; - VOIDP data; - int configOptionVector[NUM_KEYS]; + struct path_info path; + int inputClass; + int inputSize; + int rank; + hsize_t* sizeOfDimension; + int outputClass; + int outputSize; + int outputArchitecture; + int outputByteOrder; + hsize_t* sizeOfChunk; + hsize_t* maxsizeOfDimension; + int compressionType; + int compressionParam; + char *externFilename; + VOIDP data; + int configOptionVector[NUM_KEYS]; }; struct infilesformat { - char datafile[255]; - char configfile[255]; - struct Input in; - int config; /* Configfile present? No - 0. Yes - 1 */ + char datafile[255]; + char configfile[255]; + struct Input in; + int config; /* Configfile present? No - 0. Yes - 1 */ }; struct Options { - struct infilesformat infiles[30]; /* structure to hold the list of input file names. Limited to 30*/ - char outfile[256]; /* output file name */ - int fcount; /* number of input files */ + struct infilesformat infiles[30]; /* structure to hold the list of input file names. Limited to 30*/ + char outfile[256]; /* output file name */ + int fcount; /* number of input files */ }; char keytable[NUM_KEYS][30] = { - "PATH", - "INPUT-CLASS", - "INPUT-SIZE", - "RANK", - "DIMENSION-SIZES", - "OUTPUT-CLASS", - "OUTPUT-SIZE", - "OUTPUT-ARCHITECTURE", - "OUTPUT-BYTE-ORDER", - "CHUNKED-DIMENSION-SIZES", - "COMPRESSION-TYPE", - "COMPRESSION-PARAM", - "EXTERNAL-STORAGE", - "MAXIMUM-DIMENSIONS" + "PATH", + "INPUT-CLASS", + "INPUT-SIZE", + "RANK", + "DIMENSION-SIZES", + "OUTPUT-CLASS", + "OUTPUT-SIZE", + "OUTPUT-ARCHITECTURE", + "OUTPUT-BYTE-ORDER", + "CHUNKED-DIMENSION-SIZES", + "COMPRESSION-TYPE", + "COMPRESSION-PARAM", + "EXTERNAL-STORAGE", + "MAXIMUM-DIMENSIONS" }; static int state_table[15][8] = { - /* token ordering: - FILNAME OPT_o OPT_c OPT_h OPT_d OPT_p OPT_t OPT_s */ + /* token ordering: FILNAME OPT_o OPT_c OPT_h OPT_d OPT_p OPT_t OPT_s */ - /* state 0: start */ - {1, ERR, ERR, 6, ERR, ERR, ERR, ERR}, + /* state 0: start */ + {1, ERR, ERR, 6, ERR, ERR, ERR, ERR}, - /* state 1: input files */ - {ERR, ERR, 2, ERR, 7, ERR, ERR, ERR}, + /* state 1: input files */ + {ERR, ERR, 2, ERR, 7, ERR, ERR, ERR}, - /* state 2: -c[onfigfile] */ - {3, ERR, ERR, ERR, ERR, ERR, ERR, ERR}, + /* state 2: -c[onfigfile] */ + {3, ERR, ERR, ERR, ERR, ERR, ERR, ERR}, - /* state 3: configfile */ - {1, 4, ERR, ERR, ERR, ERR, ERR, ERR}, + /* state 3: configfile */ + {1, 4, ERR, ERR, ERR, ERR, ERR, ERR}, - /* state 4: -o[utfile] */ - {5, ERR, ERR, ERR, ERR, ERR, ERR, ERR}, + /* state 4: -o[utfile] */ + {5, ERR, ERR, ERR, ERR, ERR, ERR, ERR}, - /* state 5: outfile */ - {ERR, ERR, ERR, ERR, ERR, ERR, ERR, ERR}, + /* state 5: outfile */ + {ERR, ERR, ERR, ERR, ERR, ERR, ERR, ERR}, - /* state 6: -h[elp] */ - {ERR, ERR, ERR, ERR, ERR, ERR, ERR, ERR}, + /* state 6: -h[elp] */ + {ERR, ERR, ERR, ERR, ERR, ERR, ERR, ERR}, - /* state 7: -d[ims] */ - {8, ERR, ERR, ERR, ERR, ERR, ERR, ERR}, + /* state 7: -d[ims] */ + {8, ERR, ERR, ERR, ERR, ERR, ERR, ERR}, - /* state 8: dimensions */ - {1, 4, ERR, ERR, ERR, 9, 11, 13}, + /* state 8: dimensions */ + {1, 4, ERR, ERR, ERR, 9, 11, 13}, - /* state 9: -p[ath] */ - {10, ERR, ERR, ERR, ERR, ERR, ERR, ERR}, + /* state 9: -p[ath] */ + {10, ERR, ERR, ERR, ERR, ERR, ERR, ERR}, - /* state 10: path name */ - {1, 4, ERR, ERR, ERR, ERR, 11, 13}, + /* state 10: path name */ + {1, 4, ERR, ERR, ERR, ERR, 11, 13}, - /* state 11: -t[ype] */ - {12, ERR, ERR, ERR, ERR, ERR, ERR, ERR}, + /* state 11: -t[ype] */ + {12, ERR, ERR, ERR, ERR, ERR, ERR, ERR}, - /* state 12: data type */ - {1, 4, ERR, ERR, ERR, ERR, ERR, 13}, + /* state 12: data type */ + {1, 4, ERR, ERR, ERR, ERR, ERR, 13}, - /* state 13: -s[ize] */ - {14, ERR, ERR, ERR, ERR, ERR, ERR, ERR}, + /* state 13: -s[ize] */ + {14, ERR, ERR, ERR, ERR, ERR, ERR, ERR}, - /* state 14: data size */ - {1, 4, ERR, ERR, ERR, ERR, ERR, ERR} + /* state 14: data size */ + {1, 4, ERR, ERR, ERR, ERR, ERR, ERR} }; @@ -193,39 +192,39 @@ void help(char *); static int gtoken(char *s); static int process(struct Options *opt); -static int processConfigurationFile(char *infile, struct Input *in, FILE **strm); +static int processConfigurationFile(char *infile, struct Input *in); static int mapKeywordToIndex(char *key); static int parsePathInfo(struct path_info *path, char *strm); static int parseDimensions(struct Input *in, char *strm); static int getInputSize(struct Input *in, int ival); static int getInputClass(struct Input *in, char * strm); static int InputClassStrToInt(char *temp); -static int getRank(struct Input *in, FILE** strm); -static int getDimensionSizes(struct Input *in, FILE** strm); -static int getOutputSize(struct Input *in, FILE** strm); -static int getOutputClass(struct Input *in, FILE** strm); +static int getRank(struct Input *in, FILE *strm); +static int getDimensionSizes(struct Input *in, FILE *strm); +static int getOutputSize(struct Input *in, FILE *strm); +static int getOutputClass(struct Input *in, FILE *strm); static int OutputClassStrToInt(char *temp); -static int getOutputArchitecture(struct Input *in, FILE** strm); +static int getOutputArchitecture(struct Input *in, FILE *strm); static int OutputArchStrToInt(char *temp); -static int getOutputByteOrder(struct Input *in, FILE** strm); +static int getOutputByteOrder(struct Input *in, FILE *strm); static int OutputByteOrderStrToInt(char *temp); -static int getChunkedDimensionSizes(struct Input *in, FILE **strm); -static int getCompressionType(struct Input *in, FILE** strm); +static int getChunkedDimensionSizes(struct Input *in, FILE *strm); +static int getCompressionType(struct Input *in, FILE *strm); static int CompressionTypeStrToInt(char *temp); -static int getCompressionParameter(struct Input *in, FILE** strm); -static int getExternalFilename(struct Input *in, FILE** strm); -static int getMaximumDimensionSizes(struct Input *in, FILE **strm); -static int processDataFile(char *infile, struct Input *in, FILE **strm, hid_t file_id); -static int readIntegerData(FILE **strm, struct Input *in); -static int readFloatData(FILE **strm, struct Input *in); +static int getCompressionParameter(struct Input *in, FILE *strm); +static int getExternalFilename(struct Input *in, FILE *strm); +static int getMaximumDimensionSizes(struct Input *in, FILE *strm); +static int processDataFile(char *infile, struct Input *in, hid_t file_id); +static int readIntegerData(FILE *strm, struct Input *in); +static int readFloatData(FILE *strm, struct Input *in); static int allocateIntegerStorage(struct Input *in); static int allocateFloatStorage(struct Input *in); hid_t createOutputDataType(struct Input *in); hid_t createInputDataType(struct Input *in); -static int readUIntegerData(FILE **strm, struct Input *in); +static int readUIntegerData(FILE *strm, struct Input *in); static int allocateUIntegerStorage(struct Input *in); -static int validateConfigurationParameters(struct Input * in); -static int processStrData(FILE **strm, struct Input *in, hid_t file_id); +static int validateConfigurationParameters(struct Input *in); +static int processStrData(FILE *strm, struct Input *in, hid_t file_id); #endif /* H5IMPORT_H__ */ diff --git a/tools/h5import/h5importtest.c b/tools/h5import/h5importtest.c index 9c839a3..434cba7 100755 --- a/tools/h5import/h5importtest.c +++ b/tools/h5import/h5importtest.c @@ -16,6 +16,12 @@ #include #include "H5private.h" +#ifdef H5_HAVE_WIN32_API +#define OPEN_FLAGS "wb" +#else +#define OPEN_FLAGS "w" +#endif + /* * Name: * h5importtest @@ -42,7 +48,7 @@ main(void) int rowo4i = (int)11 , colo4i = (int)21 , plno4i = (int)51 ; int rowi4i = (int)1 , coli4i = (int)2 , plni4i = (int)5 ; -#ifndef WIN32 +#ifdef H5_SIZEOF_LONG_LONG long long row4i64[3], col4i64[4], pln4i64[5]; long long rowo4i64 = (long long)11 , colo4i64 = (long long)21 , plno4i64 = (long long)51 ; long long rowi4i64 = (long long)1 , coli4i64 = (long long)2 , plni4i64 = (long long)5 ; @@ -91,7 +97,7 @@ main(void) col4i[0] = colo4i; pln4i[0] = plno4i; -#ifndef WIN32 +#ifdef H5_SIZEOF_LONG_LONG row4i64[0] = rowo4i64; col4i64[0] = colo4i64; pln4i64[0] = plno4i64; @@ -110,7 +116,7 @@ main(void) row4[i] = row4[i - 1] + rowi4; row8[i] = row8[i - 1] + rowi8; row4i[i] = row4i[i - 1] + rowi4i; -#ifndef WIN32 +#ifdef H5_SIZEOF_LONG_LONG row4i64[i] = row4i64[i - 1] + rowi4i64; #endif row4i16[i] = row4i16[i - 1] + rowi4i16; @@ -122,7 +128,7 @@ main(void) col4[j] = col4[j - 1] + coli4; col8[j] = col8[j - 1] + coli8; col4i[j] = col4i[j - 1] + coli4i; -#ifndef WIN32 +#ifdef H5_SIZEOF_LONG_LONG col4i64[j] = col4i64[j - 1] + coli4i64; #endif col4i16[j] = col4i16[j - 1] + coli4i16; @@ -133,7 +139,7 @@ main(void) pln4[k] = pln4[k - 1] + plni4; pln8[k] = pln8[k - 1] + plni8; pln4i[k] = pln4i[k - 1] + plni4i; -#ifndef WIN32 +#ifdef H5_SIZEOF_LONG_LONG pln4i64[k] = pln4i64[k - 1] + plni4i64; #endif pln4i16[k] = pln4i16[k - 1] + plni4i16; @@ -165,7 +171,7 @@ main(void) */ - sp = fopen("txtin16.txt", "w"); + sp = HDfopen("txtin16.txt", "w"); for (k = 0; k < npln; k++) { for (i = 0; i < nrow; i++) @@ -175,14 +181,14 @@ main(void) (void) fprintf(sp, "\n"); } } - (void) fclose(sp); + (void) HDfclose(sp); /*------------------------------------------------------------------------- * TOOLTEST txtin32.txt -c $srcdir/testfiles/textin32.conf -o textin32.h5 *------------------------------------------------------------------------- */ - sp = fopen("txtin32.txt", "w"); + sp = HDfopen("txtin32.txt", "w"); for (k = 0; k < npln; k++) { for (i = 0; i < nrow; i++) @@ -192,51 +198,43 @@ main(void) (void) fprintf(sp, "\n"); } } - (void) fclose(sp); + (void) HDfclose(sp); /*------------------------------------------------------------------------- * TOOLTEST binin32.bin -c $srcdir/testfiles/binin32.conf -o binin32.h5 *------------------------------------------------------------------------- */ -#ifdef WIN32 - sp = fopen("binin32.bin", "wb"); -#else - sp = fopen("binin32.bin", "w"); -#endif + sp = HDfopen("binin32.bin", OPEN_FLAGS); for (k = 0; k < npln; k++) { for (i = 0; i < nrow; i++) { for (j = 0; j < ncol; j++) { - (void) fwrite((char *) &b32i3[k][i][j], sizeof(int), 1, sp); + (void) HDfwrite((char *) &b32i3[k][i][j], sizeof(int), 1, sp); } } } - (void) fclose(sp); + (void) HDfclose(sp); /*------------------------------------------------------------------------- * TOOLTEST binuin32.bin -c $srcdir/testfiles/binuin32.conf -o binuin32.h5 *------------------------------------------------------------------------- */ -#ifdef WIN32 - sp = fopen("binuin32.bin", "wb"); -#else - sp = fopen("binuin32.bin", "w"); -#endif + sp = HDfopen("binuin32.bin", OPEN_FLAGS); for (k = 0; k < npln; k++) { for (i = 0; i < nrow; i++) { for (j = 0; j < ncol; j++) { - (void) fwrite((char *) &b32i3[k][i][j], sizeof(unsigned int), 1, sp); + (void) HDfwrite((char *) &b32i3[k][i][j], sizeof(unsigned int), 1, sp); } } } - (void) fclose(sp); + (void) HDfclose(sp); @@ -246,43 +244,35 @@ main(void) *------------------------------------------------------------------------- */ -#ifdef WIN32 - sp = fopen("binin16.bin", "wb"); -#else - sp = fopen("binin16.bin", "w"); -#endif + sp = HDfopen("binin16.bin", OPEN_FLAGS); for (k = 0; k < npln; k++) { for (i = 0; i < nrow; i++) { for (j = 0; j < ncol; j++) { - (void) fwrite((char *) &b16i3[k][i][j], sizeof(short), 1, sp); + (void) HDfwrite((char *) &b16i3[k][i][j], sizeof(short), 1, sp); } } } - (void) fclose(sp); + (void) HDfclose(sp); /*------------------------------------------------------------------------- * TOOLTEST binuin16.bin -c $srcdir/testfiles/binuin16.conf -o binuin16.h5 *------------------------------------------------------------------------- */ -#ifdef WIN32 - sp = fopen("binuin16.bin", "wb"); -#else - sp = fopen("binuin16.bin", "w"); -#endif + sp = HDfopen("binuin16.bin", OPEN_FLAGS); for (k = 0; k < npln; k++) { for (i = 0; i < nrow; i++) { for (j = 0; j < ncol; j++) { - (void) fwrite((char *) &b16i3[k][i][j], sizeof(unsigned short), 1, sp); + (void) HDfwrite((char *) &b16i3[k][i][j], sizeof(unsigned short), 1, sp); } } } - (void) fclose(sp); + (void) HDfclose(sp); @@ -291,22 +281,18 @@ main(void) *------------------------------------------------------------------------- */ -#ifdef WIN32 - sp = fopen("binin8.bin", "wb"); -#else - sp = fopen("binin8.bin", "w"); -#endif + sp = HDfopen("binin8.bin", OPEN_FLAGS); for (k = 0; k < npln; k++) { for (i = 0; i < nrow; i++) { for (j = 0; j < ncol; j++) { - (void) fwrite((char *) &b8i3[k][i][j], sizeof(char), 1, sp); + (void) HDfwrite((char *) &b8i3[k][i][j], sizeof(char), 1, sp); } } } - (void) fclose(sp); + (void) HDfclose(sp); #endif /* UNICOS */ @@ -322,22 +308,18 @@ main(void) * binary 64-bit file - rank 2 & 3 */ -#ifdef WIN32 - sp = fopen("binfp64.bin", "wb"); -#else - sp = fopen("binfp64.bin", "w"); -#endif + sp = HDfopen("binfp64.bin", OPEN_FLAGS); for (k = 0; k < npln; k++) { for (i = 0; i < nrow; i++) { for (j = 0; j < ncol; j++) { - (void) fwrite((char *) &b64r3[k][i][j], sizeof(double), 1, sp); + (void) HDfwrite((char *) &b64r3[k][i][j], sizeof(double), 1, sp); } } } - (void) fclose(sp); + (void) HDfclose(sp); @@ -350,18 +332,14 @@ main(void) /* test CR+LF (13,10) and EOF (26) in windows */ char bin8w[4] = {13,10,26,0}; -#ifdef WIN32 - sp = fopen("binin8w.bin", "wb"); -#else - sp = fopen("binin8w.bin", "w"); -#endif + sp = HDfopen("binin8w.bin", OPEN_FLAGS); for (i = 0; i < 4; i++) { char c = bin8w[i]; - if ( fwrite( &c, sizeof(char), 1, sp) != 1 ) + if ( HDfwrite( &c, sizeof(char), 1, sp) != 1 ) printf("error writing file\n"); } - fclose(sp); + HDfclose(sp); } diff --git a/tools/h5import/h5importtestutil.sh b/tools/h5import/h5importtestutil.sh index 6dbec84..943b194 100755 --- a/tools/h5import/h5importtestutil.sh +++ b/tools/h5import/h5importtestutil.sh @@ -20,9 +20,112 @@ TESTNAME=h5import EXIT_SUCCESS=0 EXIT_FAILURE=1 +CP='cp' + # initialize errors variable nerrors=0 +# The build (current) directory might be different than the source directory. +if test -z "$srcdir"; then + srcdir=. +fi + +# source dirs +SRC_TOOLS="$srcdir/.." +SRC_TOOLS_TESTFILES="$SRC_TOOLS/testfiles" + +# testfiles source dirs for tools +SRC_H5LS_TESTFILES="$SRC_TOOLS_TESTFILES" +SRC_H5DUMP_TESTFILES="$SRC_TOOLS_TESTFILES" +SRC_H5DIFF_TESTFILES="$SRC_TOOLS/h5diff/testfiles" +SRC_H5COPY_TESTFILES="$SRC_TOOLS/h5copy/testfiles" +SRC_H5REPACK_TESTFILES="$SRC_TOOLS/h5repack/testfiles" +SRC_H5JAM_TESTFILES="$SRC_TOOLS/h5jam/testfiles" +SRC_H5STAT_TESTFILES="$SRC_TOOLS/h5stat/testfiles" +SRC_H5IMPORT_TESTFILES="$SRC_TOOLS/h5import/testfiles" + +TESTDIR=./testfiles +test -d $TESTDIR || mkdir $TESTDIR + +###################################################################### +# test files +# -------------------------------------------------------------------- +# All the test files copy from source directory to test directory +# NOTE: Keep this framework to add/remove test files. +# Any test files from other tools can be used in this framework. +# This list are also used for checking exist. +# Comment '#' without space can be used. +# -------------------------------------------------------------------- +LIST_HDF5_TEST_FILES=" +$SRC_H5IMPORT_TESTFILES/binfp64.h5 +$SRC_H5IMPORT_TESTFILES/binin8.h5 +$SRC_H5IMPORT_TESTFILES/binin8w.h5 +$SRC_H5IMPORT_TESTFILES/binin16.h5 +$SRC_H5IMPORT_TESTFILES/binin32.h5 +$SRC_H5IMPORT_TESTFILES/binuin16.h5 +$SRC_H5IMPORT_TESTFILES/binuin32.h5 +$SRC_H5IMPORT_TESTFILES/txtfp32.h5 +$SRC_H5IMPORT_TESTFILES/txtfp64.h5 +$SRC_H5IMPORT_TESTFILES/txtin8.h5 +$SRC_H5IMPORT_TESTFILES/txtin16.h5 +$SRC_H5IMPORT_TESTFILES/txtin32.h5 +$SRC_H5IMPORT_TESTFILES/txtuin16.h5 +$SRC_H5IMPORT_TESTFILES/txtuin32.h5 +$SRC_H5IMPORT_TESTFILES/txtstr.h5 +$SRC_H5IMPORT_TESTFILES/textpfe.h5 +" + +LIST_OTHER_TEST_FILES=" +$SRC_H5IMPORT_TESTFILES/binfp64.conf +$SRC_H5IMPORT_TESTFILES/binin8.conf +$SRC_H5IMPORT_TESTFILES/binin8w.conf +$SRC_H5IMPORT_TESTFILES/binin16.conf +$SRC_H5IMPORT_TESTFILES/binin32.conf +$SRC_H5IMPORT_TESTFILES/binuin16.conf +$SRC_H5IMPORT_TESTFILES/binuin32.conf +$SRC_H5IMPORT_TESTFILES/txtfp32.conf +$SRC_H5IMPORT_TESTFILES/txtfp64.conf +$SRC_H5IMPORT_TESTFILES/txtin8.conf +$SRC_H5IMPORT_TESTFILES/txtin16.conf +$SRC_H5IMPORT_TESTFILES/txtin32.conf +$SRC_H5IMPORT_TESTFILES/txtuin16.conf +$SRC_H5IMPORT_TESTFILES/txtuin32.conf +$SRC_H5IMPORT_TESTFILES/textpfe.conf +$SRC_H5IMPORT_TESTFILES/txtstr.conf +$SRC_H5IMPORT_TESTFILES/txtfp32.txt +$SRC_H5IMPORT_TESTFILES/txtfp64.txt +$SRC_H5IMPORT_TESTFILES/txtuin32.txt +$SRC_H5IMPORT_TESTFILES/txtin16.txt +$SRC_H5IMPORT_TESTFILES/txtin32.txt +$SRC_H5IMPORT_TESTFILES/textpfe64.txt +$SRC_H5IMPORT_TESTFILES/txtstr.txt +" + +# +# copy test files and expected output files from source dirs to test dir +# +COPY_TESTFILES="$LIST_HDF5_TEST_FILES $LIST_OTHER_TEST_FILES" + +COPY_TESTFILES_TO_TESTDIR() +{ + # copy test files. Used -f to make sure get a new copy + for tstfile in $COPY_TESTFILES + do + # ignore '#' comment + echo $tstfile | tr -d ' ' | grep '^#' > /dev/null + RET=$? + if [ $RET -eq 1 ]; then + if [ -a $tstfile ]; then + $CP -f $tstfile $TESTDIR + else + echo "Error: FAILED to copy $tstfile" + echo " $tstfile doesn't exist!" + exit $EXIT_FAILURE + fi + fi + done +} + TESTING() { SPACES=" " echo "Testing $* $SPACES" | cut -c1-70 | tr -d '\012' @@ -58,73 +161,80 @@ if [ -f h5import -a -f h5importtest ]; then rm -f output.h5 log1 tx* b* *.dat +# prepare for test +COPY_TESTFILES_TO_TESTDIR + mkdir tmp_testfiles -cp $srcdir/testfiles/*.h5 tmp_testfiles/ +$CP $TESTDIR/*.h5 ./tmp_testfiles/ $RUNSERIAL ./h5importtest +################################################ +### T H E T E S T S +################################################ + TESTING "ASCII I32 rank 3 - Output BE " ; -TOOLTEST $srcdir/testfiles/txtin16.txt -c $srcdir/testfiles/txtin32.conf -o txtin32.h5 +TOOLTEST $TESTDIR/txtin16.txt -c $TESTDIR/txtin32.conf -o txtin32.h5 TESTING "ASCII I16 rank 3 - Output LE - CHUNKED - extended" -TOOLTEST $srcdir/testfiles/txtin16.txt -c $srcdir/testfiles/txtin16.conf -o txtin16.h5 +TOOLTEST $TESTDIR/txtin16.txt -c $TESTDIR/txtin16.conf -o txtin16.h5 TESTING "ASCII I8 - rank 3 - Output I8 LE-Chunked+Extended+Compressed " -TOOLTEST $srcdir/testfiles/txtin16.txt -c $srcdir/testfiles/txtin8.conf -o txtin8.h5 +TOOLTEST $TESTDIR/txtin16.txt -c $TESTDIR/txtin8.conf -o txtin8.h5 TESTING "ASCII UI32 - rank 3 - Output BE" -TOOLTEST $srcdir/testfiles/txtuin32.txt -c $srcdir/testfiles/txtuin32.conf -o txtuin32.h5 +TOOLTEST $TESTDIR/txtuin32.txt -c $TESTDIR/txtuin32.conf -o txtuin32.h5 TESTING "ASCII UI16 - rank 2 - Output LE+Chunked+Compressed " -TOOLTEST $srcdir/testfiles/txtuin32.txt -c $srcdir/testfiles/txtuin16.conf -o txtuin16.h5 +TOOLTEST $TESTDIR/txtuin32.txt -c $TESTDIR/txtuin16.conf -o txtuin16.h5 TESTING "ASCII F32 - rank 3 - Output LE " -TOOLTEST $srcdir/testfiles/txtfp32.txt -c $srcdir/testfiles/txtfp32.conf -o txtfp32.h5 +TOOLTEST $TESTDIR/txtfp32.txt -c $TESTDIR/txtfp32.conf -o txtfp32.h5 TESTING "ASCII F64 - rank 3 - Output BE + CHUNKED+Extended+Compressed " -TOOLTEST $srcdir/testfiles/txtfp64.txt -c $srcdir/testfiles/txtfp64.conf -o txtfp64.h5 +TOOLTEST $TESTDIR/txtfp64.txt -c $TESTDIR/txtfp64.conf -o txtfp64.h5 TESTING "BINARY F64 - rank 3 - Output LE+CHUNKED+Extended+Compressed " -TOOLTEST binfp64.bin -c $srcdir/testfiles/binfp64.conf -o binfp64.h5 +TOOLTEST binfp64.bin -c $TESTDIR/binfp64.conf -o binfp64.h5 TESTING "BINARY I16 - rank 3 - Output order LE + CHUNKED + extended " -TOOLTEST binin16.bin -c $srcdir/testfiles/binin16.conf -o binin16.h5 +TOOLTEST binin16.bin -c $TESTDIR/binin16.conf -o binin16.h5 TESTING "BINARY I8 - rank 3 - Output I16LE + Chunked+Extended+Compressed " -TOOLTEST binin8.bin -c $srcdir/testfiles/binin8.conf -o binin8.h5 +TOOLTEST binin8.bin -c $TESTDIR/binin8.conf -o binin8.h5 TESTING "BINARY I32 - rank 3 - Output BE + CHUNKED " -TOOLTEST binin32.bin -c $srcdir/testfiles/binin32.conf -o binin32.h5 +TOOLTEST binin32.bin -c $TESTDIR/binin32.conf -o binin32.h5 TESTING "BINARY UI16 - rank 3 - Output byte BE + CHUNKED " -TOOLTEST binuin16.bin -c $srcdir/testfiles/binuin16.conf -o binuin16.h5 +TOOLTEST binuin16.bin -c $TESTDIR/binuin16.conf -o binuin16.h5 TESTING "BINARY UI32 - rank 3 - Output LE + CHUNKED " -TOOLTEST binuin32.bin -c $srcdir/testfiles/binuin32.conf -o binuin32.h5 +TOOLTEST binuin32.bin -c $TESTDIR/binuin32.conf -o binuin32.h5 TESTING "STR" -TOOLTEST $srcdir/testfiles/txtstr.txt -c $srcdir/testfiles/txtstr.conf -o txtstr.h5 +TOOLTEST $TESTDIR/txtstr.txt -c $TESTDIR/txtstr.conf -o txtstr.h5 TESTING "BINARY I8 CR LF EOF" -TOOLTEST binin8w.bin -c $srcdir/testfiles/binin8w.conf -o binin8w.h5 +TOOLTEST binin8w.bin -c $TESTDIR/binin8w.conf -o binin8w.h5 TESTING "ASCII F64 - rank 1 - INPUT-CLASS TEXTFPE " -TOOLTEST $srcdir/testfiles/in64.txt -c $srcdir/testfiles/textpfe.conf -o test15.h5 +TOOLTEST $TESTDIR/textpfe64.txt -c $TESTDIR/textpfe.conf -o textpfe.h5 rm -f txtin32.txt txtin16.txt *.bin *.h5 rm -rf tmp_testfiles else - echo "** h5import or h5importtest not available ***" - nerrors="` expr $nerrors + 1 `"; + echo "** h5import or h5importtest not available ***" + nerrors="` expr $nerrors + 1 `"; fi # diff --git a/tools/h5import/testfiles/in64.txt b/tools/h5import/testfiles/in64.txt deleted file mode 100644 index f6dd7f4..0000000 --- a/tools/h5import/testfiles/in64.txt +++ /dev/null @@ -1,2 +0,0 @@ -6.02E+24 -3.14159265E+00 diff --git a/tools/h5import/testfiles/test15.h5 b/tools/h5import/testfiles/test15.h5 deleted file mode 100644 index 213051d..0000000 Binary files a/tools/h5import/testfiles/test15.h5 and /dev/null differ diff --git a/tools/h5import/testfiles/textpfe.h5 b/tools/h5import/testfiles/textpfe.h5 new file mode 100644 index 0000000..213051d Binary files /dev/null and b/tools/h5import/testfiles/textpfe.h5 differ diff --git a/tools/h5import/testfiles/textpfe64.txt b/tools/h5import/testfiles/textpfe64.txt new file mode 100644 index 0000000..f6dd7f4 --- /dev/null +++ b/tools/h5import/testfiles/textpfe64.txt @@ -0,0 +1,2 @@ +6.02E+24 +3.14159265E+00 diff --git a/tools/h5jam/CMakeLists.txt b/tools/h5jam/CMakeLists.txt index 81a624d..a03d139 100644 --- a/tools/h5jam/CMakeLists.txt +++ b/tools/h5jam/CMakeLists.txt @@ -1,11 +1,10 @@ -cmake_minimum_required (VERSION 2.8) +cmake_minimum_required (VERSION 2.8.6) PROJECT (HDF5_TOOLS_H5JAM) #----------------------------------------------------------------------------- # Setup include Directories #----------------------------------------------------------------------------- INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib) -INCLUDE_DIRECTORIES (${HDF5_PROJECT_DIR}/test) # -------------------------------------------------------------------- # Add the h5jam executables @@ -13,18 +12,22 @@ INCLUDE_DIRECTORIES (${HDF5_PROJECT_DIR}/test) ADD_EXECUTABLE (h5jam ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/h5jam.c) TARGET_NAMING (h5jam ${LIB_TYPE}) TARGET_LINK_LIBRARIES (h5jam ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) +SET_TARGET_PROPERTIES (h5jam PROPERTIES FOLDER tools) ADD_EXECUTABLE (getub ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/getub.c) TARGET_NAMING (getub ${LIB_TYPE}) TARGET_LINK_LIBRARIES (getub ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) +SET_TARGET_PROPERTIES (getub PROPERTIES FOLDER tools) ADD_EXECUTABLE (tellub ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/tellub.c) TARGET_NAMING (tellub ${LIB_TYPE}) TARGET_LINK_LIBRARIES (tellub ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) +SET_TARGET_PROPERTIES (tellub PROPERTIES FOLDER tools) ADD_EXECUTABLE (h5unjam ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/h5unjam.c) TARGET_NAMING (h5unjam ${LIB_TYPE}) TARGET_LINK_LIBRARIES (h5unjam ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) +SET_TARGET_PROPERTIES (h5unjam PROPERTIES FOLDER tools) SET (H5_DEP_EXECUTABLES h5jam @@ -46,7 +49,8 @@ IF (BUILD_TESTING) IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) ADD_EXECUTABLE (h5jamgentest ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/h5jamgentest.c) TARGET_NAMING (h5jamgentest ${LIB_TYPE}) - TARGET_LINK_LIBRARIES (h5jamgentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + TARGET_LINK_LIBRARIES (h5jamgentest ${HDF5_LIB_TARGET}) + SET_TARGET_PROPERTIES (h5jamgentest PROPERTIES FOLDER generator/tools) #ADD_TEST (NAME h5jamgentest COMMAND $) ENDIF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) @@ -56,6 +60,9 @@ IF (BUILD_TESTING) u511.txt u512.txt u513.txt + h5jam-help.txt + h5unjam-help.txt + h5jam-ub-nohdf5.txt ) SET (HDF5_REFERENCE_TEST_FILES tall.h5 @@ -92,6 +99,58 @@ IF (BUILD_TESTING) ############################################################################## ############################################################################## + # ============================================================ + # TEST_H5JAM_OUTPUT + # For the purpose to verify only output & exitcode from h5jam + # + MACRO (TEST_H5JAM_OUTPUT expectfile resultcode) + # If using memchecker add tests without using scripts + IF (HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST (NAME H5JAM-${expectfile} COMMAND $ ${ARGN}) + IF (NOT "${resultcode}" STREQUAL "0") + SET_TESTS_PROPERTIES (H5JAM-${expectfile} PROPERTIES WILL_FAIL "true") + ENDIF (NOT "${resultcode}" STREQUAL "0") + ELSE (HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST ( + NAME H5JAM-${expectfile} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=${ARGN}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_OUTPUT=${expectfile}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=testfiles/${expectfile}.txt" + -P "${HDF5_RESOURCES_DIR}/runTest.cmake" + ) + ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + ENDMACRO (TEST_H5JAM_OUTPUT) + + # ============================================================ + # TEST_H5UNJAM_OUTPUT + # For the purpose to verify only output & exitcode from h5unjam + # + MACRO (TEST_H5UNJAM_OUTPUT expectfile resultcode) + # If using memchecker add tests without using scripts + IF (HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST (NAME H5JAM-UNJAM-${expectfile} COMMAND $ ${ARGN}) + IF (NOT "${resultcode}" STREQUAL "0") + SET_TESTS_PROPERTIES (H5JAM-UNJAM-${expectfile} PROPERTIES WILL_FAIL "true") + ENDIF (NOT "${resultcode}" STREQUAL "0") + ELSE (HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST ( + NAME H5JAM-UNJAM-${expectfile} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS=${ARGN}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_OUTPUT=${expectfile}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=testfiles/${expectfile}.txt" + -P "${HDF5_RESOURCES_DIR}/runTest.cmake" + ) + ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + ENDMACRO (TEST_H5UNJAM_OUTPUT) + MACRO (CLEANUP testname) ADD_TEST ( NAME H5JAM-CLEANUP-${testname}-clear-objects @@ -119,7 +178,7 @@ IF (BUILD_TESTING) SET_TESTS_PROPERTIES (H5JAM-CHECKFILE-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) ENDIF (NOT "${last_test}" STREQUAL "") ADD_TEST ( - NAME H5JAM-CHECKFILE-H5DUMP-${testname} + NAME H5JAM-CHECKFILE-H5DMP-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" -D "TEST_ARGS:STRING=testfiles/${expected}" @@ -130,9 +189,9 @@ IF (BUILD_TESTING) -D "TEST_SKIP_COMPARE=TRUE" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5JAM-CHECKFILE-H5DUMP-${testname} PROPERTIES DEPENDS H5JAM-CHECKFILE-${testname}-clear-objects) + SET_TESTS_PROPERTIES (H5JAM-CHECKFILE-H5DMP-${testname} PROPERTIES DEPENDS H5JAM-CHECKFILE-${testname}-clear-objects) ADD_TEST ( - NAME H5JAM-CHECKFILE-H5DUMP_CMP-${testname} + NAME H5JAM-CHECKFILE-H5DMP_CMP-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" -D "TEST_ARGS:STRING=${actual}" @@ -143,8 +202,8 @@ IF (BUILD_TESTING) -D "TEST_REFERENCE=${expected}.new" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5JAM-CHECKFILE-H5DUMP_CMP-${testname} PROPERTIES DEPENDS H5JAM-CHECKFILE-H5DUMP-${testname}) - SET (last_test "H5JAM-CHECKFILE-H5DUMP_CMP-${testname}") + SET_TESTS_PROPERTIES (H5JAM-CHECKFILE-H5DMP_CMP-${testname} PROPERTIES DEPENDS H5JAM-CHECKFILE-H5DMP-${testname}) + SET (last_test "H5JAM-CHECKFILE-H5DMP_CMP-${testname}") ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO(CHECKFILE testname expected actual) @@ -309,6 +368,15 @@ IF (BUILD_TESTING) ############################################################################## ############################################################################## +#------------------------------- +# Testing h5jam +#------------------------------- + # help page + TEST_H5JAM_OUTPUT(h5jam-help 0 -h) + + # don't allow HDF5 format file as an user block file + TEST_H5JAM_OUTPUT(h5jam-ub-nohdf5 1 -i testfiles/tall.h5 -u testfiles/tall.h5 -o tall-tmp.h5) + JAMTEST (tall_u10 u10.txt tall.h5 ta2.h5) CHECKFILE (tall_u10 tall.h5 ta2.h5) # CLEANUP (tall_u10 ta2.h5) @@ -422,6 +490,12 @@ IF (BUILD_TESTING) CHECKFILE (N_twithub513_u513_c tall.h5 tay9.h5) # CLEANUP (N_twithub513_u513_c tay9.h5) +#------------------------------- +# Testing h5unjam +#------------------------------- + # help page + TEST_H5UNJAM_OUTPUT(h5unjam-help 0 -h) + SETUP (twithub_tall twithub.h5 tai1.h5) UNJAMTEST (twithub_tall tai1.h5 o10.txt taa1.h5) CHECKFILE (twithub_tall tall.h5 taa1.h5) diff --git a/tools/h5jam/Makefile.in b/tools/h5jam/Makefile.in index 78e446d..31190ec 100644 --- a/tools/h5jam/Makefile.in +++ b/tools/h5jam/Makefile.in @@ -195,6 +195,7 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ +FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ @@ -215,10 +216,12 @@ H5_LONE_COLON = @H5_LONE_COLON@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ +HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ +HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ diff --git a/tools/h5jam/getub.c b/tools/h5jam/getub.c index 293aa17..f536605 100644 --- a/tools/h5jam/getub.c +++ b/tools/h5jam/getub.c @@ -21,6 +21,7 @@ #endif #include "H5private.h" +#include "h5tools.h" #include "h5tools_utils.h" void parse_command_line (int argc, const char *argv[]); @@ -32,9 +33,9 @@ void parse_command_line (int argc, const char *argv[]); #define PROGRAMNAME "getub" char *nbytes = NULL; -static const char *s_opts = "c:"; /* add more later ? */ +static const char *s_opts = "c:"; /* add more later ? */ static struct long_options l_opts[] = { - {"c", require_arg, 'c'}, /* input file */ + {"c", require_arg, 'c'}, /* input file */ {NULL, 0, '\0'} }; @@ -84,15 +85,15 @@ parse_command_line (int argc, const char *argv[]) while ((opt = get_option (argc, argv, s_opts, l_opts)) != EOF) { switch ((char) opt) - { - case 'c': - nbytes = HDstrdup (opt_arg); - break; - case '?': - default: - usage (h5tools_getprogname()); - exit (EXIT_FAILURE); - } + { + case 'c': + nbytes = HDstrdup (opt_arg); + break; + case '?': + default: + usage (h5tools_getprogname()); + exit (EXIT_FAILURE); + } } if (argc <= opt_ind) @@ -115,6 +116,9 @@ main (int argc, const char *argv[]) h5tools_setprogname(PROGRAMNAME); h5tools_setstatus(EXIT_SUCCESS); + /* Initialize h5tools lib */ + h5tools_init(); + parse_command_line (argc, argv); if (nbytes == NULL) @@ -161,7 +165,7 @@ main (int argc, const char *argv[]) if (res < (long)size) { if (buf) - free (buf); + free (buf); HDclose (fd); exit (EXIT_FAILURE); } diff --git a/tools/h5jam/h5jam.c b/tools/h5jam/h5jam.c index 5eaa26a..981eead 100644 --- a/tools/h5jam/h5jam.c +++ b/tools/h5jam/h5jam.c @@ -15,6 +15,7 @@ #include "hdf5.h" #include "H5private.h" +#include "h5tools.h" #include "h5tools_utils.h" /* Name of tool */ @@ -38,14 +39,14 @@ char *ub_file = NULL; * parameters. The long-named ones can be partially spelled. When * adding more, make sure that they don't clash with each other. */ -static const char *s_opts = "hi:u:o:c:V"; /* add more later ? */ +static const char *s_opts = "hi:u:o:c:V"; /* add more later ? */ static struct long_options l_opts[] = { {"help", no_arg, 'h'}, {"hel", no_arg, 'h'}, - {"i", require_arg, 'i'}, /* input file */ - {"u", require_arg, 'u'}, /* user block file */ - {"o", require_arg, 'o'}, /* output file */ - {"clobber", no_arg, 'c'}, /* clobber existing UB */ + {"i", require_arg, 'i'}, /* input file */ + {"u", require_arg, 'u'}, /* user block file */ + {"o", require_arg, 'o'}, /* output file */ + {"clobber", no_arg, 'c'}, /* clobber existing UB */ {"clobbe", no_arg, 'c'}, {"clobb", no_arg, 'c'}, {"clob", no_arg, 'c'}, @@ -70,20 +71,76 @@ static struct long_options l_opts[] = { static void usage (const char *prog) { - fflush (stdout); - fprintf (stdout, - "usage: %s -u user_block_file -i h5_file [-o ofile | --clobber] \n", - prog); - fprintf (stdout, " Add 'user_block_file' to front of \n"); - fprintf (stdout, - " 'h5_file', pad so 'h5_file' starts on proper\n"); - fprintf (stdout, " byte.\n"); - fprintf (stdout, "\n"); - fprintf (stdout, " %s -h \n", prog); - fprintf (stdout, " Print a usage message and exit\n"); - fprintf (stdout, " %s -V \n", prog); - fprintf (stdout, " Print HDF5 library version and exit\n"); + HDfflush (stdout); + HDfprintf (stdout, + "usage: %s -i -u [-o ] [--clobber]\n", prog); + HDfprintf (stdout, "\n"); + HDfprintf (stdout, + "Adds user block to front of an HDF5 file and creates a new concatenated file.\n"); + HDfprintf (stdout, "\n"); + HDfprintf (stdout, + "OPTIONS\n"); + HDfprintf (stdout, + " -i in_file.h5 Specifies the input HDF5 file.\n"); + HDfprintf (stdout, + " -u in_user_file Specifies the file to be inserted into the user block.\n"); + HDfprintf (stdout, + " Can be any file format except an HDF5 format.\n"); + HDfprintf (stdout, + " -o out_file.h5 Specifies the output HDF5 file.\n"); + HDfprintf (stdout, + " If not specified, the user block will be concatenated in\n"); + HDfprintf (stdout, + " place to the input HDF5 file.\n"); + HDfprintf (stdout, + " --clobber Wipes out any existing user block before concatenating\n"); + HDfprintf (stdout, + " the given user block.\n"); + HDfprintf (stdout, + " The size of the new user block will be the larger of;\n"); + HDfprintf (stdout, + " - the size of existing user block in the input HDF5 file\n"); + HDfprintf (stdout, + " - the size of user block required by new input user file\n"); + HDfprintf (stdout, + " (size = 512 x 2N, N is positive integer.)\n"); + HDfprintf (stdout, "\n"); + HDfprintf (stdout, + " -h Prints a usage message and exits.\n"); + HDfprintf (stdout, + " -V Prints the HDF5 library version and exits.\n"); + HDfprintf (stdout, "\n"); + HDfprintf (stdout, + "Exit Status:\n"); + HDfprintf (stdout, + " 0 Succeeded.\n"); + HDfprintf (stdout, + " >0 An error occurred.\n"); +} + + +/*------------------------------------------------------------------------- + * Function: leave + * + * Purpose: Shutdown and call exit() + * + * Return: Does not return + * + *------------------------------------------------------------------------- + */ +static void +leave(int ret) +{ + if (ub_file) + HDfree (ub_file); + if (input_file) + HDfree (input_file); + if (output_file) + HDfree (output_file); + h5tools_close(); + + HDexit(ret); } /*------------------------------------------------------------------------- @@ -111,30 +168,30 @@ parse_command_line (int argc, const char *argv[]) while ((opt = get_option (argc, argv, s_opts, l_opts)) != EOF) { switch ((char) opt) - { - case 'o': - output_file = HDstrdup (opt_arg); - break; - case 'i': - input_file = HDstrdup (opt_arg); - break; - case 'u': - ub_file = HDstrdup (opt_arg); - break; - case 'c': - do_clobber = TRUE; - break; - case 'h': - usage (h5tools_getprogname()); - exit (EXIT_SUCCESS); - case 'V': - print_version (h5tools_getprogname()); - exit (EXIT_SUCCESS); - case '?': - default: - usage (h5tools_getprogname()); - exit (EXIT_FAILURE); - } + { + case 'o': + output_file = HDstrdup (opt_arg); + break; + case 'i': + input_file = HDstrdup (opt_arg); + break; + case 'u': + ub_file = HDstrdup (opt_arg); + break; + case 'c': + do_clobber = TRUE; + break; + case 'h': + usage (h5tools_getprogname()); + leave (EXIT_SUCCESS); + case 'V': + print_version (h5tools_getprogname()); + leave (EXIT_SUCCESS); + case '?': + default: + usage (h5tools_getprogname()); + leave (EXIT_FAILURE); + } } } @@ -155,204 +212,208 @@ parse_command_line (int argc, const char *argv[]) int main (int argc, const char *argv[]) { - int ufid; - int h5fid; - int ofid; - void *edata; - H5E_auto2_t func; - hid_t ifile; - hid_t plist; - herr_t status; - htri_t testval; - hsize_t usize; - hsize_t h5fsize; - hsize_t startub; - hsize_t where; - hsize_t newubsize; - off_t fsize; - h5_stat_t sbuf; - h5_stat_t sbuf2; - int res; - - h5tools_setprogname(PROGRAMNAME); - h5tools_setstatus(EXIT_SUCCESS); - - /* Disable error reporting */ - H5Eget_auto2(H5E_DEFAULT, &func, &edata); - H5Eset_auto2(H5E_DEFAULT, NULL, NULL); + int ufid = -1; + int h5fid = -1; + int ofid = -1; + void *edata; + H5E_auto2_t func; + hid_t ifile = -1; + hid_t plist = -1; + herr_t status; + htri_t testval; + hsize_t usize; + hsize_t h5fsize; + hsize_t startub; + hsize_t where; + hsize_t newubsize; + off_t fsize; + h5_stat_t sbuf; + h5_stat_t sbuf2; + int res; + + h5tools_setprogname(PROGRAMNAME); + h5tools_setstatus(EXIT_SUCCESS); + + /* Disable error reporting */ + H5Eget_auto2(H5E_DEFAULT, &func, &edata); + H5Eset_auto2(H5E_DEFAULT, NULL, NULL); + + /* Initialize h5tools lib */ + h5tools_init(); + + parse_command_line (argc, argv); + + if (ub_file == NULL) { + /* no user block */ + error_msg("missing arguemnt for -u .\n"); + help_ref_msg(stderr); + leave (EXIT_FAILURE); + } - parse_command_line (argc, argv); + testval = H5Fis_hdf5 (ub_file); - if (ub_file == NULL) - { - /* no user block */ - error_msg("no user block file name\n"); - usage (h5tools_getprogname()); - exit (EXIT_FAILURE); + if (testval > 0) { + error_msg("-u cannot be HDF5 file, but it appears to be an HDF5 file.\n"); + help_ref_msg(stderr); + leave (EXIT_FAILURE); } - if (input_file == NULL) - { - /* no user block */ - error_msg("no HDF5 file\n"); - usage (h5tools_getprogname()); - exit (EXIT_FAILURE); + if (input_file == NULL) { + error_msg("missing arguemnt for -i .\n"); + help_ref_msg(stderr); + leave (EXIT_FAILURE); } - testval = H5Fis_hdf5 (input_file); + testval = H5Fis_hdf5 (input_file); - if (testval <= 0) - { - error_msg("Input HDF5 file is not HDF \"%s\"\n", input_file); - exit (EXIT_FAILURE); + if (testval <= 0) { + error_msg("Input HDF5 file \"%s\" is not HDF5 format.\n", input_file); + help_ref_msg(stderr); + leave (EXIT_FAILURE); } - ifile = H5Fopen (input_file, H5F_ACC_RDONLY, H5P_DEFAULT); + ifile = H5Fopen (input_file, H5F_ACC_RDONLY, H5P_DEFAULT); - if (ifile < 0) - { - error_msg("Can't open input HDF5 file \"%s\"\n", input_file); - exit (EXIT_FAILURE); + if (ifile < 0) { + error_msg("Can't open input HDF5 file \"%s\"\n", input_file); + leave (EXIT_FAILURE); } - plist = H5Fget_create_plist (ifile); - if (plist < 0) - { - error_msg("Can't get file creation plist for file \"%s\"\n", - input_file); - exit (EXIT_FAILURE); + plist = H5Fget_create_plist (ifile); + if (plist < 0) { + error_msg("Can't get file creation plist for file \"%s\"\n", input_file); + H5Fclose(ifile); + leave (EXIT_FAILURE); } - status = H5Pget_userblock (plist, &usize); - if (status < 0) - { - error_msg("Can't get user block for file \"%s\"\n", - input_file); - exit (EXIT_FAILURE); + status = H5Pget_userblock (plist, &usize); + if (status < 0) { + error_msg("Can't get user block for file \"%s\"\n", input_file); + H5Pclose(plist); + H5Fclose(ifile); + leave (EXIT_FAILURE); } - H5Pclose(plist); - H5Fclose(ifile); + H5Pclose(plist); + H5Fclose(ifile); - ufid = HDopen(ub_file, O_RDONLY, 0); - if(ufid < 0) { - error_msg("unable to open user block file \"%s\"\n", - ub_file); - exit (EXIT_FAILURE); + ufid = HDopen(ub_file, O_RDONLY, 0); + if(ufid < 0) { + error_msg("unable to open user block file \"%s\"\n", ub_file); + leave (EXIT_FAILURE); } - res = HDfstat(ufid, &sbuf); - if(res < 0) { - error_msg("Can't stat file \"%s\"\n", ub_file); - exit (EXIT_FAILURE); + res = HDfstat(ufid, &sbuf); + if(res < 0) { + error_msg("Can't stat file \"%s\"\n", ub_file); + HDclose (ufid); + leave (EXIT_FAILURE); } - fsize = sbuf.st_size; + fsize = sbuf.st_size; - h5fid = HDopen(input_file, O_RDONLY, 0); - if(h5fid < 0) { - error_msg("unable to open HDF5 file for read \"%s\"\n", - input_file); - exit (EXIT_FAILURE); + h5fid = HDopen(input_file, O_RDONLY, 0); + if(h5fid < 0) { + error_msg("unable to open HDF5 file for read \"%s\"\n", input_file); + HDclose (ufid); + leave (EXIT_FAILURE); } - res = HDfstat(h5fid, &sbuf2); - if(res < 0) { - error_msg("Can't stat file \"%s\"\n", input_file); - exit (EXIT_FAILURE); + res = HDfstat(h5fid, &sbuf2); + if(res < 0) { + error_msg("Can't stat file \"%s\"\n", input_file); + HDclose (h5fid); + HDclose (ufid); + leave (EXIT_FAILURE); } - h5fsize = sbuf2.st_size; + h5fsize = sbuf2.st_size; - if (output_file == NULL) - { - ofid = HDopen (input_file, O_WRONLY, 0); - - if (ofid < 0) - { - error_msg("unable to open output file \"%s\"\n", - output_file); - exit (EXIT_FAILURE); - } + if (output_file == NULL) { + ofid = HDopen (input_file, O_WRONLY, 0); + + if (ofid < 0) { + error_msg("unable to open output file \"%s\"\n", output_file); + HDclose (h5fid); + HDclose (ufid); + leave (EXIT_FAILURE); + } } - else - { - ofid = HDopen (output_file, O_WRONLY | O_CREAT | O_TRUNC, 0644); - - if (ofid < 0) - { - error_msg("unable to create output file \"%s\"\n", - output_file); - exit (EXIT_FAILURE); - } + else { + ofid = HDopen (output_file, O_WRONLY | O_CREAT | O_TRUNC, 0644); + + if (ofid < 0) { + error_msg("unable to create output file \"%s\"\n", output_file); + HDclose (h5fid); + HDclose (ufid); + leave (EXIT_FAILURE); + } } - newubsize = compute_user_block_size ((hsize_t) fsize); - - startub = usize; - - if (usize > 0) - { - if (do_clobber == TRUE) - { - /* where is max of the current size or the new UB */ - if (usize > newubsize) - { - newubsize = usize; - } - startub = 0; /*blast the old */ - } - else - { - /* add new ub to current ublock, pad to new offset */ - newubsize += usize; - newubsize = compute_user_block_size ((hsize_t) newubsize); - } + newubsize = compute_user_block_size ((hsize_t) fsize); + + startub = usize; + + if (usize > 0) { + if (do_clobber == TRUE) { + /* where is max of the current size or the new UB */ + if (usize > newubsize) { + newubsize = usize; + } + startub = 0; /*blast the old */ + } + else { + /* add new ub to current ublock, pad to new offset */ + newubsize += usize; + newubsize = compute_user_block_size ((hsize_t) newubsize); + } } - /* copy the HDF5 from starting at usize to starting at newubsize: - * makes room at 'from' for new ub */ - /* if no current ub, usize is 0 */ - copy_some_to_file (h5fid, ofid, usize, newubsize, - (ssize_t) (h5fsize - usize)); + /* copy the HDF5 from starting at usize to starting at newubsize: + * makes room at 'from' for new ub */ + /* if no current ub, usize is 0 */ + copy_some_to_file (h5fid, ofid, usize, newubsize, (ssize_t) (h5fsize - usize)); - /* copy the old ub to the beginning of the new file */ - if (!do_clobber) - { - where = - copy_some_to_file (h5fid, ofid, (hsize_t) 0, (hsize_t) 0, - (ssize_t) usize); + /* copy the old ub to the beginning of the new file */ + if (!do_clobber) { + where = copy_some_to_file (h5fid, ofid, (hsize_t) 0, (hsize_t) 0, (ssize_t) usize); } - /* copy the new ub to the end of the ub */ - where = copy_some_to_file (ufid, ofid, (hsize_t) 0, startub, (ssize_t) - 1); - - /* pad the ub */ - where = write_pad (ofid, where); + /* copy the new ub to the end of the ub */ + where = copy_some_to_file (ufid, ofid, (hsize_t) 0, startub, (ssize_t) - 1); + /* pad the ub */ + where = write_pad (ofid, where); - HDclose (ufid); - HDclose (h5fid); - HDclose (ofid); + if (ub_file) + HDfree (ub_file); + if (input_file) + HDfree (input_file); + if (output_file) + HDfree (output_file); + + if (ufid >= 0) HDclose (ufid); + if (h5fid >= 0) HDclose (h5fid); + if (ofid >= 0) HDclose (ofid); - return h5tools_getstatus(); + return h5tools_getstatus(); } /*------------------------------------------------------------------------- * Function: copy_some_to_file * * Purpose: Copy part of the input file to output. - * infid: fd of file to read - * outfid: fd of file to write - * startin: offset of where to read from infid - * startout: offset of where to write to outfid - * limit: bytes to read/write + * infid: fd of file to read + * outfid: fd of file to write + * startin: offset of where to read from infid + * startout: offset of where to write to outfid + * limit: bytes to read/write * - * If limit is < 0, the entire input file is copied. + * If limit is < 0, the entire input file is copied. * - * Note: this routine can be used to copy within - * the same file, i.e., infid and outfid can be the - * same file. + * Note: this routine can be used to copy within + * the same file, i.e., infid and outfid can be the + * same file. * * Return: Success: last byte written in the output. * Failure: Exits program with EXIT_FAILURE value. @@ -365,7 +426,7 @@ main (int argc, const char *argv[]) */ hsize_t copy_some_to_file (int infid, int outfid, hsize_t startin, hsize_t startout, - ssize_t limit) + ssize_t limit) { char buf[1024]; h5_stat_t sbuf; @@ -390,9 +451,9 @@ copy_some_to_file (int infid, int outfid, hsize_t startin, hsize_t startout, if(limit < 0) { res = HDfstat(infid, &sbuf); if(res < 0) { - error_msg("Can't stat file \n"); - exit (EXIT_FAILURE); - } + error_msg("Can't stat file \n"); + exit (EXIT_FAILURE); + } howmuch = sbuf.st_size; } @@ -424,19 +485,19 @@ copy_some_to_file (int infid, int outfid, hsize_t startin, hsize_t startout, HDlseek (infid, (off_t) from, SEEK_SET); if (howmuch > 512) - { - nchars = HDread (infid, buf, (unsigned) 512); - } + { + nchars = HDread (infid, buf, (unsigned) 512); + } else - { - nchars = HDread (infid, buf, (unsigned)howmuch); - } + { + nchars = HDread (infid, buf, (unsigned)howmuch); + } if (nchars <= 0) - { - printf ("huh? \n"); - exit (EXIT_FAILURE); - } + { + printf ("huh? \n"); + exit (EXIT_FAILURE); + } /*ncw = */ HDwrite (outfid, buf, (unsigned) nchars); /* assert (ncw == nchars) */ @@ -444,15 +505,15 @@ copy_some_to_file (int infid, int outfid, hsize_t startin, hsize_t startout, tot += nchars; howmuch -= nchars; if (howmuch > 512) - { - to -= nchars; - from -= nchars; - } + { + to -= nchars; + from -= nchars; + } else - { - to -= howmuch; - from -= howmuch; - } + { + to -= howmuch; + from -= howmuch; + } } /* assert howmuch == 0 */ @@ -467,10 +528,10 @@ copy_some_to_file (int infid, int outfid, hsize_t startin, hsize_t startout, * * Purpose: Find the offset of the HDF5 header after the user block: * align at 0, 512, 1024, etc. - * ublock_size: the size of the user block (bytes). + * ublock_size: the size of the user block (bytes). * * Return: Success: the location of the header == the size of the - * padded user block. + * padded user block. * Failure: none * * Return: Success: last byte written in the output. @@ -520,6 +581,6 @@ write_pad(int ofile, hsize_t where) for(i = 0; i < psize; i++) HDwrite (ofile, buf, 1); - return(where + psize); /* the new size of the file. */ + return(where + psize); /* the new size of the file. */ } diff --git a/tools/h5jam/h5jamgentest.c b/tools/h5jam/h5jamgentest.c index ec79215..ca3d86c 100644 --- a/tools/h5jam/h5jamgentest.c +++ b/tools/h5jam/h5jamgentest.c @@ -310,18 +310,18 @@ gent_ub(const char * filename, size_t ub_size, size_t ub_fill) { HDassert(ub_size <= BUF_SIZE); - fd = HDopen(filename, O_RDWR, 0); + fd = HDopen(filename, O_RDWR, 0); HDassert(fd >= 0); - /* fill buf with pattern */ - HDmemset(buf, '\0', ub_size); - bp = buf; - for (u = 0; u < ub_fill; u++) + /* fill buf with pattern */ + HDmemset(buf, '\0', ub_size); + bp = buf; + for (u = 0; u < ub_fill; u++) *bp++ = pattern[u % 10]; - HDwrite(fd, buf, ub_size); + HDwrite(fd, buf, ub_size); - HDclose(fd); + HDclose(fd); } } @@ -334,9 +334,9 @@ create_textfile(const char *name, size_t size) char *bp; fd = HDcreat(name,0777); - assert(fd >= 0); - buf = calloc(size, (size_t)1); - assert(buf); + HDassert(fd >= 0); + buf = HDcalloc(size, (size_t)1); + HDassert(buf); /* fill buf with pattern */ bp = buf; @@ -345,7 +345,7 @@ create_textfile(const char *name, size_t size) HDwrite(fd, buf, size); - free(buf); + HDfree(buf); HDclose(fd); } @@ -363,7 +363,7 @@ create_binfile(char *name, off_t size) fd = creat(name,0777); HDassert(fd >= 0); - buf = calloc(size,1); + buf = HDcalloc(size,1); HDassert(buf); /* fill buf with pattern */ diff --git a/tools/h5jam/h5unjam.c b/tools/h5jam/h5unjam.c index bfebc6c..4751dad 100644 --- a/tools/h5jam/h5unjam.c +++ b/tools/h5jam/h5unjam.c @@ -15,6 +15,7 @@ #include "hdf5.h" #include "H5private.h" +#include "h5tools.h" #include "h5tools_utils.h" /* Name of tool */ @@ -42,10 +43,10 @@ static const char *s_opts = "hu:i:o:d:V"; static struct long_options l_opts[] = { { "help", no_arg, 'h' }, { "hel", no_arg, 'h' }, - {"i", require_arg, 'i'}, /* input file */ - {"u", require_arg, 'u'}, /* user block file */ - {"o", require_arg, 'o'}, /* output file */ - {"delete", no_arg, 'd'}, /* delete ub */ + {"i", require_arg, 'i'}, /* input file */ + {"u", require_arg, 'u'}, /* user block file */ + {"o", require_arg, 'o'}, /* output file */ + {"delete", no_arg, 'd'}, /* delete ub */ {"delet", no_arg, 'd'}, {"dele", no_arg, 'd'}, {"del", no_arg, 'd'}, @@ -69,15 +70,80 @@ static struct long_options l_opts[] = { static void usage(const char *prog) { - fflush(stdout); - fprintf(stdout, "usage: %s -i h5_file -o user_block_file_out -o h5_file_out [-d | --delete]\n", prog); - fprintf(stdout, " Extract user block from 'h5_file' into 'user_block_file'\n"); - fprintf(stdout, " and HDF5 file into 'h5_file_out'\n"); - - fprintf(stdout, " %s -h\n",prog); - fprintf(stdout, " Print a usage message and exit\n"); - fprintf(stdout, " %s -V \n", prog); - fprintf(stdout, " Print HDF5 library version and exit\n"); + HDfflush(stdout); + HDfprintf(stdout, + "usage: %s -i [-o ] [-u | --delete]\n", prog); + HDfprintf(stdout, "\n"); + HDfprintf(stdout, + "Splits user file and HDF5 file into two files: user block data and HDF5 data.\n"); + HDfprintf(stdout, "\n"); + HDfprintf(stdout, + "OPTIONS\n"); + HDfprintf(stdout, + " -i in_file.h5 Specifies the HDF5 as input. If the input HDF5 file\n"); + HDfprintf(stdout, + " contains no user block, exit with an error message.\n"); + HDfprintf(stdout, + " -o out_file.h5 Specifies output HDF5 file without a user block.\n"); + HDfprintf(stdout, + " If not specified, the user block will be removed from the\n"); + HDfprintf(stdout, + " input HDF5 file.\n"); + HDfprintf(stdout, + " -u out_user_file\n"); + HDfprintf(stdout, + " Specifies the output file containing the data from the\n"); + HDfprintf(stdout, + " user block.\n"); + HDfprintf(stdout, + " Cannot be used with --delete option.\n"); + HDfprintf(stdout, + " --delete Remove the user block from the input HDF5 file. The content\n"); + HDfprintf(stdout, + " of the user block is discarded.\n"); + HDfprintf(stdout, + " Cannot be used with the -u option.\n"); + HDfprintf(stdout, "\n"); + HDfprintf(stdout, + " -h Prints a usage message and exits.\n"); + HDfprintf(stdout, + " -V Prints the HDF5 library version and exits.\n"); + HDfprintf(stdout, "\n"); + HDfprintf(stdout, + " If neither --delete nor -u is specified, the user block from the input file\n"); + HDfprintf(stdout, + " will be displayed to stdout.\n"); + HDfprintf(stdout, "\n"); + HDfprintf(stdout, + "Exit Status:\n"); + HDfprintf(stdout, + " 0 Succeeded.\n"); + HDfprintf(stdout, + " >0 An error occurred.\n"); +} + +/*------------------------------------------------------------------------- + * Function: leave + * + * Purpose: Shutdown and call exit() + * + * Return: Does not return + * + *------------------------------------------------------------------------- + */ +static void +leave(int ret) +{ + if (ub_file) + HDfree (ub_file); + if (input_file) + HDfree (input_file); + if (output_file) + HDfree (output_file); + + h5tools_close(); + + HDexit(ret); } /*------------------------------------------------------------------------- @@ -99,33 +165,33 @@ usage(const char *prog) static void parse_command_line(int argc, const char *argv[]) { - int opt = FALSE; + int opt = FALSE; /* parse command line options */ while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) { - switch ((char)opt) { - case 'o': - output_file = HDstrdup (opt_arg); - break; - case 'i': - input_file = HDstrdup (opt_arg); - break; - case 'u': - ub_file = HDstrdup (opt_arg); - break; - case 'd': - do_delete = TRUE; - break; - case 'h': - usage(h5tools_getprogname()); - exit(EXIT_SUCCESS); - case 'V': - print_version (h5tools_getprogname()); - exit (EXIT_SUCCESS); - case '?': - default: - usage(h5tools_getprogname()); - exit(EXIT_FAILURE); + switch ((char) opt) { + case 'o': + output_file = HDstrdup (opt_arg); + break; + case 'i': + input_file = HDstrdup (opt_arg); + break; + case 'u': + ub_file = HDstrdup (opt_arg); + break; + case 'd': + do_delete = TRUE; + break; + case 'h': + usage(h5tools_getprogname()); + leave(EXIT_SUCCESS); + case 'V': + print_version(h5tools_getprogname()); + leave(EXIT_SUCCESS); + case '?': + default: + usage(h5tools_getprogname()); + leave(EXIT_FAILURE); } } @@ -134,7 +200,7 @@ parse_command_line(int argc, const char *argv[]) if (argc <= opt_ind+2) { error_msg("missing file name\n"); usage(h5tools_getprogname()); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } */ } @@ -156,19 +222,19 @@ parse_command_line(int argc, const char *argv[]) int main(int argc, const char *argv[]) { - int ifid; - int ufid; - int h5fid; + int ifid = -1; + int ufid = -1; + int h5fid = -1; void *edata; - H5E_auto2_t func; - hid_t ifile; - off_t fsize; - hsize_t usize; - htri_t testval; - herr_t status; - hid_t plist; - int res; - h5_stat_t sbuf; + H5E_auto2_t func; + hid_t ifile = -1; + hid_t plist = -1; + off_t fsize; + hsize_t usize; + htri_t testval; + herr_t status; + int res; + h5_stat_t sbuf; h5tools_setprogname(PROGRAMNAME); h5tools_setstatus(EXIT_SUCCESS); @@ -179,67 +245,87 @@ main(int argc, const char *argv[]) parse_command_line(argc, argv); + if (input_file == NULL) { + /* no user block */ + error_msg("missing arguemnt for HDF5 file input.\n"); + help_ref_msg(stderr); + leave (EXIT_FAILURE); + } + testval = H5Fis_hdf5(input_file); if (testval <= 0) { - error_msg("Input HDF5 file is not HDF \"%s\"\n", input_file); - exit(EXIT_FAILURE); + error_msg("Input HDF5 file \"%s\" is not HDF\n", input_file); + help_ref_msg (stderr); + h5tools_setstatus(EXIT_FAILURE); + goto done; } ifile = H5Fopen(input_file, H5F_ACC_RDONLY , H5P_DEFAULT); if (ifile < 0) { error_msg("Can't open input HDF5 file \"%s\"\n", input_file); - exit(EXIT_FAILURE); + h5tools_setstatus(EXIT_FAILURE); + goto done; } plist = H5Fget_create_plist(ifile); if (plist < 0) { error_msg("Can't get file creation plist for file \"%s\"\n", input_file); - exit(EXIT_FAILURE); + h5tools_setstatus(EXIT_FAILURE); + goto done; } - status = H5Pget_userblock(plist, & usize ); + status = H5Pget_userblock(plist, & usize); if (status < 0) { error_msg("Can't get user block for file \"%s\"\n", input_file); - exit(EXIT_FAILURE); + h5tools_setstatus(EXIT_FAILURE); + goto done; } + H5Pclose(plist); + H5Fclose(ifile); + if (usize == 0) { - /* no user block to remove: message? */ + /* no user block to remove: message? */ error_msg("\"%s\" has no user block: no change to file\n", input_file); - exit(EXIT_SUCCESS); - + h5tools_setstatus(EXIT_SUCCESS); + goto done; } ifid = HDopen(input_file,O_RDONLY,0); if(ifid < 0) { error_msg("unable to open input HDF5 file \"%s\"\n", input_file); - exit(EXIT_FAILURE); + h5tools_setstatus(EXIT_FAILURE); + goto done; } res = HDfstat(ifid, &sbuf); if(res < 0) { error_msg("Can't stat file \"%s\"\n", input_file); - exit(EXIT_FAILURE); + h5tools_setstatus(EXIT_FAILURE); + goto done; } fsize = sbuf.st_size; if (do_delete && (ub_file != NULL)) { - error_msg("??\"%s\"\n", ub_file); - exit(EXIT_FAILURE); + error_msg("??\"%s\"\n", ub_file); + h5tools_setstatus(EXIT_FAILURE); + goto done; } if (ub_file == NULL) { - /* write to sdtout */ - ufid = HDdup(1); - } else { + /* write to sdtout */ + ufid = HDdup(1); + } + else { ufid = HDopen(ub_file,O_WRONLY|O_CREAT|O_TRUNC, 0644 ); if (ufid < 0) { error_msg("unable to open user block file for output\"%s\"\n", ub_file); - exit(EXIT_FAILURE); + h5tools_setstatus(EXIT_FAILURE); + goto done; } } @@ -248,23 +334,27 @@ main(int argc, const char *argv[]) if (h5fid < 0) { error_msg("unable to open output HDF5 file \"%s\"\n", input_file); - exit(EXIT_FAILURE); + h5tools_setstatus(EXIT_FAILURE); + goto done; } - } else { + } + else { h5fid = HDopen(output_file,O_WRONLY|O_CREAT|O_TRUNC, 0644 ); if (h5fid < 0) { error_msg("unable to open output HDF5 file \"%s\"\n", output_file); - exit(EXIT_FAILURE); + h5tools_setstatus(EXIT_FAILURE); + goto done; } } /* copy from 0 to 'usize - 1' into ufid */ if (!do_delete) { - if(copy_to_file(ifid, ufid, 0, (ssize_t) usize) < 0) { + if(copy_to_file(ifid, ufid, 0, (ssize_t) usize) < 0) { error_msg("unable to copy user block to output file \"%s\"\n", ub_file); - exit(EXIT_FAILURE); + h5tools_setstatus(EXIT_FAILURE); + goto done; } } @@ -273,13 +363,22 @@ main(int argc, const char *argv[]) */ if(copy_to_file(ifid, h5fid, (ssize_t) usize, (ssize_t)(fsize - (ssize_t)usize)) < 0) { error_msg("unable to copy hdf5 data to output file \"%s\"\n", output_file); - exit(EXIT_FAILURE); + h5tools_setstatus(EXIT_FAILURE); + goto done; } +done: + if (ub_file) { + HDfree (ub_file); + if (ufid >= 0) HDclose(ufid); + } + if (input_file) + HDfree (input_file); + if (output_file) + HDfree (output_file); - HDclose(ufid); - HDclose(h5fid); - HDclose(ifid); + if (h5fid >= 0) HDclose(h5fid); + if (ifid >= 0) HDclose(ifid); return h5tools_getstatus(); } diff --git a/tools/h5jam/tellub.c b/tools/h5jam/tellub.c index f1b6756..0169d71 100644 --- a/tools/h5jam/tellub.c +++ b/tools/h5jam/tellub.c @@ -21,6 +21,7 @@ #include "hdf5.h" #include "H5private.h" +#include "h5tools.h" #include "h5tools_utils.h" #define TRUE 1 @@ -60,7 +61,7 @@ usage (const char *prog) fflush (stdout); fprintf (stdout, "usage: %s h5_file\n", prog); fprintf (stdout, - " Check that h5_fil is HDF5 file and print size of user block \n"); + " Check that h5_fil is HDF5 file and print size of user block \n"); fprintf (stdout, " %s -h\n", prog); fprintf (stdout, " Print a usage message and exit\n"); } @@ -90,15 +91,15 @@ parse_command_line (int argc, const char *argv[]) while ((opt = get_option (argc, argv, s_opts, l_opts)) != EOF) { switch ((char) opt) - { - case 'h': - usage (h5tools_getprogname()); - exit (EXIT_SUCCESS); - case '?': - default: - usage (h5tools_getprogname()); - exit (EXIT_FAILURE); - } + { + case 'h': + usage (h5tools_getprogname()); + exit (EXIT_SUCCESS); + case '?': + default: + usage (h5tools_getprogname()); + exit (EXIT_FAILURE); + } } /* check for file name to be processed */ @@ -139,6 +140,9 @@ main (int argc, const char *argv[]) h5tools_setprogname(PROGRAMNAME); h5tools_setstatus(EXIT_SUCCESS); + /* Initialize h5tools lib */ + h5tools_init(); + /* Disable error reporting */ H5Eget_auto2(H5E_DEFAULT, &func, &edata); H5Eset_auto2(H5E_DEFAULT, NULL, NULL); @@ -174,7 +178,7 @@ main (int argc, const char *argv[]) if (plist < 0) { error_msg("Can't get file creation plist for file \"%s\"\n", - ifname); + ifname); return (EXIT_FAILURE); } diff --git a/tools/h5jam/testfiles/h5jam-help.txt b/tools/h5jam/testfiles/h5jam-help.txt new file mode 100644 index 0000000..ce97c22 --- /dev/null +++ b/tools/h5jam/testfiles/h5jam-help.txt @@ -0,0 +1,24 @@ +usage: h5jam -i -u [-o ] [--clobber] + +Adds user block to front of an HDF5 file and creates a new concatenated file. + +OPTIONS + -i in_file.h5 Specifies the input HDF5 file. + -u in_user_file Specifies the file to be inserted into the user block. + Can be any file format except an HDF5 format. + -o out_file.h5 Specifies the output HDF5 file. + If not specified, the user block will be concatenated in + place to the input HDF5 file. + --clobber Wipes out any existing user block before concatenating + the given user block. + The size of the new user block will be the larger of; + - the size of existing user block in the input HDF5 file + - the size of user block required by new input user file + (size = 512 x 2N, N is positive integer.) + + -h Prints a usage message and exits. + -V Prints the HDF5 library version and exits. + +Exit Status: + 0 Succeeded. + >0 An error occurred. diff --git a/tools/h5jam/testfiles/h5jam-ub-nohdf5.txt b/tools/h5jam/testfiles/h5jam-ub-nohdf5.txt new file mode 100644 index 0000000..72c0b17 --- /dev/null +++ b/tools/h5jam/testfiles/h5jam-ub-nohdf5.txt @@ -0,0 +1,2 @@ +h5jam error: -u cannot be HDF5 file, but it appears to be an HDF5 file. +Try '-h' or '--help' for more information or see the entry in the 'HDF5 Reference Manual'. diff --git a/tools/h5jam/testfiles/h5unjam-help.txt b/tools/h5jam/testfiles/h5unjam-help.txt new file mode 100644 index 0000000..f0d92e9 --- /dev/null +++ b/tools/h5jam/testfiles/h5unjam-help.txt @@ -0,0 +1,27 @@ +usage: h5unjam -i [-o ] [-u | --delete] + +Splits user file and HDF5 file into two files: user block data and HDF5 data. + +OPTIONS + -i in_file.h5 Specifies the HDF5 as input. If the input HDF5 file + contains no user block, exit with an error message. + -o out_file.h5 Specifies output HDF5 file without a user block. + If not specified, the user block will be removed from the + input HDF5 file. + -u out_user_file + Specifies the output file containing the data from the + user block. + Cannot be used with --delete option. + --delete Remove the user block from the input HDF5 file. The content + of the user block is discarded. + Cannot be used with the -u option. + + -h Prints a usage message and exits. + -V Prints the HDF5 library version and exits. + + If neither --delete nor -u is specified, the user block from the input file + will be displayed to stdout. + +Exit Status: + 0 Succeeded. + >0 An error occurred. diff --git a/tools/h5jam/testh5jam.sh.in b/tools/h5jam/testh5jam.sh.in index cfefcdc..f359926 100644 --- a/tools/h5jam/testh5jam.sh.in +++ b/tools/h5jam/testh5jam.sh.in @@ -35,6 +35,7 @@ UNJAM_BIN=`pwd` # The path of the jam binary CMP='cmp -s' DIFF='diff -c' AWK='awk' +CP='cp' nerrors=0 verbose=yes @@ -43,8 +44,75 @@ verbose=yes if test -z "$srcdir"; then srcdir=. fi -TESTFILES="$srcdir/testfiles" +# source dirs +SRC_TOOLS="$srcdir/.." +SRC_TOOLS_TESTFILES="$SRC_TOOLS/testfiles" + +# testfiles source dirs for tools +SRC_H5LS_TESTFILES="$SRC_TOOLS_TESTFILES" +SRC_H5DUMP_TESTFILES="$SRC_TOOLS_TESTFILES" +SRC_H5DIFF_TESTFILES="$SRC_TOOLS/h5diff/testfiles" +SRC_H5COPY_TESTFILES="$SRC_TOOLS/h5copy/testfiles" +SRC_H5REPACK_TESTFILES="$SRC_TOOLS/h5repack/testfiles" +SRC_H5JAM_TESTFILES="$SRC_TOOLS/h5jam/testfiles" +SRC_H5STAT_TESTFILES="$SRC_TOOLS/h5stat/testfiles" +SRC_H5IMPORT_TESTFILES="$SRC_TOOLS/h5import/testfiles" + +TESTDIR=./testfiles +test -d $TESTDIR || mkdir $TESTDIR + +###################################################################### +# test files +# -------------------------------------------------------------------- +# All the test files copy from source directory to test directory +# NOTE: Keep this framework to add/remove test files. +# Any test files from other tools can be used in this framework. +# This list are also used for checking exist. +# Comment '#' without space can be used. +# -------------------------------------------------------------------- +LIST_HDF5_TEST_FILES=" +$SRC_H5JAM_TESTFILES/tall.h5 +$SRC_H5JAM_TESTFILES/twithub.h5 +$SRC_H5JAM_TESTFILES/twithub513.h5 +" +LIST_OTHER_TEST_FILES=" +$SRC_H5JAM_TESTFILES/u10.txt +$SRC_H5JAM_TESTFILES/u511.txt +$SRC_H5JAM_TESTFILES/u512.txt +$SRC_H5JAM_TESTFILES/u513.txt +$SRC_H5JAM_TESTFILES/h5jam-help.txt +$SRC_H5JAM_TESTFILES/h5unjam-help.txt +$SRC_H5JAM_TESTFILES/h5jam-ub-nohdf5.txt +" + +# Source in the output filter function definitions. +. $srcdir/../../bin/output_filter.sh + +# +# copy test files and expected output files from source dirs to test dir +# +COPY_TESTFILES="$LIST_HDF5_TEST_FILES $LIST_OTHER_TEST_FILES" + +COPY_TESTFILES_TO_TESTDIR() +{ + # copy test files. Used -f to make sure get a new copy + for tstfile in $COPY_TESTFILES + do + # ignore '#' comment + echo $tstfile | tr -d ' ' | grep '^#' > /dev/null + RET=$? + if [ $RET -eq 1 ]; then + if [ -a $tstfile ]; then + $CP -f $tstfile $TESTDIR + else + echo "Error: FAILED to copy $tstfile" + echo " $tstfile doesn't exist!" + exit $EXIT_FAILURE + fi + fi + done +} # Print a line-line message left justified in a field of 70 characters # beginning with the word "Testing". @@ -381,150 +449,219 @@ UNJAMTEST () { } +# +# TOOLTEST_OUTPUT < JAM | UNJAM > expect-output.txt exit-code options +# +# Only verify stdout/stderr output from h5jam and j5unjam +# + +TOOLTEST_OUTPUT() { + if [ "$1" == "JAM" ]; then + TOOLCMD=$JAM_BIN/$JAM + elif [ "$1" == "UNJAM" ]; then + TOOLCMD=$JAM_BIN/$UNJAM + fi + shift + expect="$TESTDIR/$1" + actual="$TESTDIR/`basename $1 .ls`.out" + actual_err="$TESTDIR/`basename $1 .ls`.err" + actual_sav=${actual}-sav + actual_err_sav=${actual_err}-sav + shift + retvalexpect=$1 + shift + + TESTING h5jam $@ + ( + cd $TESTDIR + $TOOLCMD "$@" + ) >$actual 2>$actual_err + + # save actual and actual_err in case they are needed later. + cp $actual $actual_sav + STDOUT_FILTER $actual + cp $actual_err $actual_err_sav + STDERR_FILTER $actual_err + # combine stderr to stdout for output compare + cat $actual_err >> $actual + + if [ ! -f $expect ]; then + # Create the expect file if it doesn't yet exist. + echo " CREATED" + cp $actual $expect + rm -f $actual $actual_err + elif $CMP $expect $actual; then + echo " PASSED" + rm -f $actual $actual_err + else + echo "*FAILED*" + echo " Expected result differs from actual result" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + fi +} + ############################################################################## ############################################################################## ### T H E T E S T S ### ############################################################################## ############################################################################## +# prepare for test +COPY_TESTFILES_TO_TESTDIR -JAMTEST $TESTFILES/u10.txt $TESTFILES/tall.h5 ta2.h5 -CHECKFILE $TESTFILES/tall.h5 ta2.h5 +#------------------------------- +# Testing h5jam +#------------------------------- +# help page +TOOLTEST_OUTPUT JAM h5jam-help.txt 0 -h + +# don't allow HDF5 format file as an user block file +TOOLTEST_OUTPUT JAM h5jam-ub-nohdf5.txt 1 -i tall.h5 -u tall.h5 -o tall-tmp.h5 + +JAMTEST $TESTDIR/u10.txt $TESTDIR/tall.h5 ta2.h5 +CHECKFILE $TESTDIR/tall.h5 ta2.h5 CLEANUP ta2.h5 -JAMTEST $TESTFILES/u511.txt $TESTFILES/tall.h5 ta3.h5 -CHECKFILE $TESTFILES/tall.h5 ta3.h5 +JAMTEST $TESTDIR/u511.txt $TESTDIR/tall.h5 ta3.h5 +CHECKFILE $TESTDIR/tall.h5 ta3.h5 CLEANUP ta3.h5 -JAMTEST $TESTFILES/u512.txt $TESTFILES/tall.h5 ta4.h5 -CHECKFILE $TESTFILES/tall.h5 ta4.h5 +JAMTEST $TESTDIR/u512.txt $TESTDIR/tall.h5 ta4.h5 +CHECKFILE $TESTDIR/tall.h5 ta4.h5 CLEANUP ta4.h5 -JAMTEST $TESTFILES/u513.txt $TESTFILES/tall.h5 ta5.h5 -CHECKFILE $TESTFILES/tall.h5 ta5.h5 +JAMTEST $TESTDIR/u513.txt $TESTDIR/tall.h5 ta5.h5 +CHECKFILE $TESTDIR/tall.h5 ta5.h5 CLEANUP ta5.h5 -SETUP $TESTFILES/tall.h5 ta.h5 -JAMTEST $TESTFILES/u10.txt ta.h5 -CHECKFILE $TESTFILES/tall.h5 ta.h5 -SETUP $TESTFILES/tall.h5 ta.h5 -JAMTEST $TESTFILES/u511.txt ta.h5 -CHECKFILE $TESTFILES/tall.h5 ta.h5 -SETUP $TESTFILES/tall.h5 ta.h5 -JAMTEST $TESTFILES/u512.txt ta.h5 -CHECKFILE $TESTFILES/tall.h5 ta.h5 -SETUP $TESTFILES/tall.h5 ta.h5 -JAMTEST $TESTFILES/u513.txt ta.h5 -CHECKFILE $TESTFILES/tall.h5 ta.h5 +SETUP $TESTDIR/tall.h5 ta.h5 +JAMTEST $TESTDIR/u10.txt ta.h5 +CHECKFILE $TESTDIR/tall.h5 ta.h5 +SETUP $TESTDIR/tall.h5 ta.h5 +JAMTEST $TESTDIR/u511.txt ta.h5 +CHECKFILE $TESTDIR/tall.h5 ta.h5 +SETUP $TESTDIR/tall.h5 ta.h5 +JAMTEST $TESTDIR/u512.txt ta.h5 +CHECKFILE $TESTDIR/tall.h5 ta.h5 +SETUP $TESTDIR/tall.h5 ta.h5 +JAMTEST $TESTDIR/u513.txt ta.h5 +CHECKFILE $TESTDIR/tall.h5 ta.h5 CLEANUP ta.h5 -JAMTEST $TESTFILES/u10.txt $TESTFILES/twithub.h5 tax2.h5 -CHECKFILE $TESTFILES/tall.h5 tax2.h5 +JAMTEST $TESTDIR/u10.txt $TESTDIR/twithub.h5 tax2.h5 +CHECKFILE $TESTDIR/tall.h5 tax2.h5 CLEANUP tax2.h5 -JAMTEST $TESTFILES/u511.txt $TESTFILES/twithub.h5 tax3.h5 -CHECKFILE $TESTFILES/tall.h5 tax3.h5 +JAMTEST $TESTDIR/u511.txt $TESTDIR/twithub.h5 tax3.h5 +CHECKFILE $TESTDIR/tall.h5 tax3.h5 CLEANUP tax3.h5 -JAMTEST $TESTFILES/u512.txt $TESTFILES/twithub.h5 tax4.h5 -CHECKFILE $TESTFILES/tall.h5 tax4.h5 +JAMTEST $TESTDIR/u512.txt $TESTDIR/twithub.h5 tax4.h5 +CHECKFILE $TESTDIR/tall.h5 tax4.h5 CLEANUP tax4.h5 -JAMTEST $TESTFILES/u513.txt $TESTFILES/twithub.h5 tax5.h5 -CHECKFILE $TESTFILES/tall.h5 tax5.h5 +JAMTEST $TESTDIR/u513.txt $TESTDIR/twithub.h5 tax5.h5 +CHECKFILE $TESTDIR/tall.h5 tax5.h5 CLEANUP tax5.h5 -JAMTEST $TESTFILES/u10.txt $TESTFILES/twithub513.h5 tax6.h5 -CHECKFILE $TESTFILES/tall.h5 tax6.h5 +JAMTEST $TESTDIR/u10.txt $TESTDIR/twithub513.h5 tax6.h5 +CHECKFILE $TESTDIR/tall.h5 tax6.h5 CLEANUP tax6.h5 -JAMTEST $TESTFILES/u511.txt $TESTFILES/twithub513.h5 tax7.h5 -CHECKFILE $TESTFILES/tall.h5 tax7.h5 +JAMTEST $TESTDIR/u511.txt $TESTDIR/twithub513.h5 tax7.h5 +CHECKFILE $TESTDIR/tall.h5 tax7.h5 CLEANUP tax7.h5 -JAMTEST $TESTFILES/u512.txt $TESTFILES/twithub513.h5 tax8.h5 -CHECKFILE $TESTFILES/tall.h5 tax8.h5 +JAMTEST $TESTDIR/u512.txt $TESTDIR/twithub513.h5 tax8.h5 +CHECKFILE $TESTDIR/tall.h5 tax8.h5 CLEANUP tax8.h5 -JAMTEST $TESTFILES/u513.txt $TESTFILES/twithub513.h5 tax9.h5 -CHECKFILE $TESTFILES/tall.h5 tax9.h5 +JAMTEST $TESTDIR/u513.txt $TESTDIR/twithub513.h5 tax9.h5 +CHECKFILE $TESTDIR/tall.h5 tax9.h5 CLEANUP tax9.h5 -JAMTEST $TESTFILES/u10.txt $TESTFILES/twithub.h5 --clobber taz2.h5 -CHECKFILE $TESTFILES/tall.h5 taz2.h5 +JAMTEST $TESTDIR/u10.txt $TESTDIR/twithub.h5 --clobber taz2.h5 +CHECKFILE $TESTDIR/tall.h5 taz2.h5 CLEANUP taz2.h5 -JAMTEST $TESTFILES/u511.txt $TESTFILES/twithub.h5 --clobber taz3.h5 -CHECKFILE $TESTFILES/tall.h5 taz3.h5 +JAMTEST $TESTDIR/u511.txt $TESTDIR/twithub.h5 --clobber taz3.h5 +CHECKFILE $TESTDIR/tall.h5 taz3.h5 CLEANUP taz3.h5 -JAMTEST $TESTFILES/u512.txt $TESTFILES/twithub.h5 --clobber taz4.h5 -CHECKFILE $TESTFILES/tall.h5 taz4.h5 +JAMTEST $TESTDIR/u512.txt $TESTDIR/twithub.h5 --clobber taz4.h5 +CHECKFILE $TESTDIR/tall.h5 taz4.h5 CLEANUP taz4.h5 -JAMTEST $TESTFILES/u513.txt $TESTFILES/twithub.h5 --clobber taz5.h5 -CHECKFILE $TESTFILES/tall.h5 taz5.h5 +JAMTEST $TESTDIR/u513.txt $TESTDIR/twithub.h5 --clobber taz5.h5 +CHECKFILE $TESTDIR/tall.h5 taz5.h5 CLEANUP taz5.h5 -JAMTEST $TESTFILES/u10.txt $TESTFILES/twithub513.h5 --clobber taz6.h5 -CHECKFILE $TESTFILES/tall.h5 taz6.h5 +JAMTEST $TESTDIR/u10.txt $TESTDIR/twithub513.h5 --clobber taz6.h5 +CHECKFILE $TESTDIR/tall.h5 taz6.h5 CLEANUP taz6.h5 -JAMTEST $TESTFILES/u511.txt $TESTFILES/twithub513.h5 --clobber taz7.h5 -CHECKFILE $TESTFILES/tall.h5 taz7.h5 +JAMTEST $TESTDIR/u511.txt $TESTDIR/twithub513.h5 --clobber taz7.h5 +CHECKFILE $TESTDIR/tall.h5 taz7.h5 CLEANUP taz7.h5 -JAMTEST $TESTFILES/u512.txt $TESTFILES/twithub513.h5 --clobber taz8.h5 -CHECKFILE $TESTFILES/tall.h5 taz8.h5 +JAMTEST $TESTDIR/u512.txt $TESTDIR/twithub513.h5 --clobber taz8.h5 +CHECKFILE $TESTDIR/tall.h5 taz8.h5 CLEANUP taz8.h5 -JAMTEST $TESTFILES/u513.txt $TESTFILES/twithub513.h5 --clobber taz9.h5 -CHECKFILE $TESTFILES/tall.h5 taz9.h5 +JAMTEST $TESTDIR/u513.txt $TESTDIR/twithub513.h5 --clobber taz9.h5 +CHECKFILE $TESTDIR/tall.h5 taz9.h5 CLEANUP taz9.h5 -SETUP $TESTFILES/twithub.h5 tay2.h5 -JAMTEST $TESTFILES/u10.txt tay2.h5 --clobber -CHECKFILE $TESTFILES/tall.h5 tay2.h5 +SETUP $TESTDIR/twithub.h5 tay2.h5 +JAMTEST $TESTDIR/u10.txt tay2.h5 --clobber +CHECKFILE $TESTDIR/tall.h5 tay2.h5 CLEANUP tay2.h5 -SETUP $TESTFILES/twithub.h5 tay3.h5 -JAMTEST $TESTFILES/u511.txt tay3.h5 --clobber -CHECKFILE $TESTFILES/tall.h5 tay3.h5 +SETUP $TESTDIR/twithub.h5 tay3.h5 +JAMTEST $TESTDIR/u511.txt tay3.h5 --clobber +CHECKFILE $TESTDIR/tall.h5 tay3.h5 CLEANUP tay3.h5 -SETUP $TESTFILES/twithub.h5 tay4.h5 -JAMTEST $TESTFILES/u512.txt tay4.h5 --clobber -CHECKFILE $TESTFILES/tall.h5 tay4.h5 +SETUP $TESTDIR/twithub.h5 tay4.h5 +JAMTEST $TESTDIR/u512.txt tay4.h5 --clobber +CHECKFILE $TESTDIR/tall.h5 tay4.h5 CLEANUP tay4.h5 -SETUP $TESTFILES/twithub.h5 tay5.h5 -JAMTEST $TESTFILES/u513.txt tay5.h5 --clobber -CHECKFILE $TESTFILES/tall.h5 tay5.h5 +SETUP $TESTDIR/twithub.h5 tay5.h5 +JAMTEST $TESTDIR/u513.txt tay5.h5 --clobber +CHECKFILE $TESTDIR/tall.h5 tay5.h5 CLEANUP tay5.h5 -SETUP $TESTFILES/twithub513.h5 tay6.h5 -JAMTEST $TESTFILES/u10.txt tay6.h5 --clobber -CHECKFILE $TESTFILES/tall.h5 tay6.h5 +SETUP $TESTDIR/twithub513.h5 tay6.h5 +JAMTEST $TESTDIR/u10.txt tay6.h5 --clobber +CHECKFILE $TESTDIR/tall.h5 tay6.h5 CLEANUP tay6.h5 -SETUP $TESTFILES/twithub513.h5 tay7.h5 -JAMTEST $TESTFILES/u511.txt tay7.h5 --clobber -CHECKFILE $TESTFILES/tall.h5 tay7.h5 +SETUP $TESTDIR/twithub513.h5 tay7.h5 +JAMTEST $TESTDIR/u511.txt tay7.h5 --clobber +CHECKFILE $TESTDIR/tall.h5 tay7.h5 CLEANUP tay7.h5 -SETUP $TESTFILES/twithub513.h5 tay8.h5 -JAMTEST $TESTFILES/u512.txt tay8.h5 --clobber -CHECKFILE $TESTFILES/tall.h5 tay8.h5 +SETUP $TESTDIR/twithub513.h5 tay8.h5 +JAMTEST $TESTDIR/u512.txt tay8.h5 --clobber +CHECKFILE $TESTDIR/tall.h5 tay8.h5 CLEANUP tay8.h5 -SETUP $TESTFILES/twithub513.h5 tay9.h5 -JAMTEST $TESTFILES/u513.txt tay9.h5 --clobber -CHECKFILE $TESTFILES/tall.h5 tay9.h5 +SETUP $TESTDIR/twithub513.h5 tay9.h5 +JAMTEST $TESTDIR/u513.txt tay9.h5 --clobber +CHECKFILE $TESTDIR/tall.h5 tay9.h5 CLEANUP tay9.h5 -SETUP $TESTFILES/twithub.h5 tai1.h5 +#--------------------------------- +# Testing h5unjam +#--------------------------------- +# help page +TOOLTEST_OUTPUT UNJAM h5unjam-help.txt 0 -h + +SETUP $TESTDIR/twithub.h5 tai1.h5 UNJAMTEST tai1.h5 o10.txt taa1.h5 -CHECKFILE $TESTFILES/tall.h5 taa1.h5 +CHECKFILE $TESTDIR/tall.h5 taa1.h5 CLEANUP taa1.h5 tai1.h5 o10.txt -SETUP $TESTFILES/twithub513.h5 tai2.h5 +SETUP $TESTDIR/twithub513.h5 tai2.h5 UNJAMTEST tai2.h5 o512.txt taa2.h5 -CHECKFILE $TESTFILES/tall.h5 taa2.h5 +CHECKFILE $TESTDIR/tall.h5 taa2.h5 CLEANUP taa2.h5 tai2.h5 o512.txt -SETUP $TESTFILES/twithub.h5 tai3.h5 +SETUP $TESTDIR/twithub.h5 tai3.h5 UNJAMTEST tai3.h5 - taa3.h5 -CHECKFILE $TESTFILES/tall.h5 taa3.h5 +CHECKFILE $TESTDIR/tall.h5 taa3.h5 CLEANUP taa3.h5 tai3.h5 -SETUP $TESTFILES/twithub513.h5 tai4.h5 +SETUP $TESTDIR/twithub513.h5 tai4.h5 UNJAMTEST tai4.h5 - taa4.h5 -CHECKFILE $TESTFILES/tall.h5 taa4.h5 +CHECKFILE $TESTDIR/tall.h5 taa4.h5 CLEANUP taa4.h5 tai4.h5 -SETUP $TESTFILES/twithub.h5 taj2.h5 +SETUP $TESTDIR/twithub.h5 taj2.h5 UNJAMTEST taj2.h5 --delete tac2.h5 -CHECKFILE $TESTFILES/tall.h5 tac2.h5 +CHECKFILE $TESTDIR/tall.h5 tac2.h5 CLEANUP tac2.h5 taj2.h5 -SETUP $TESTFILES/twithub513.h5 taj3.h5 +SETUP $TESTDIR/twithub513.h5 taj3.h5 UNJAMTEST taj3.h5 --delete tac3.h5 -CHECKFILE $TESTFILES/tall.h5 tac3.h5 +CHECKFILE $TESTDIR/tall.h5 tac3.h5 CLEANUP tac3.h5 taj3.h5 diff --git a/tools/h5ls/CMakeLists.txt b/tools/h5ls/CMakeLists.txt index 6956c4e..0dec21c 100644 --- a/tools/h5ls/CMakeLists.txt +++ b/tools/h5ls/CMakeLists.txt @@ -1,11 +1,10 @@ -cmake_minimum_required (VERSION 2.8) +cmake_minimum_required (VERSION 2.8.6) PROJECT (HDF5_TOOLS_H5LS) #----------------------------------------------------------------------------- # Setup include Directories #----------------------------------------------------------------------------- INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib) -INCLUDE_DIRECTORIES (${HDF5_PROJECT_DIR}/test) #----------------------------------------------------------------------------- # Add the h5ls executable @@ -13,6 +12,7 @@ INCLUDE_DIRECTORIES (${HDF5_PROJECT_DIR}/test) ADD_EXECUTABLE (h5ls ${HDF5_TOOLS_H5LS_SOURCE_DIR}/h5ls.c) TARGET_NAMING (h5ls ${LIB_TYPE}) TARGET_LINK_LIBRARIES (h5ls ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) +SET_TARGET_PROPERTIES (h5ls PROPERTIES FOLDER tools) SET (H5_DEP_EXECUTABLES h5ls @@ -26,108 +26,107 @@ SET (H5_DEP_EXECUTABLES IF (BUILD_TESTING) # -------------------------------------------------------------------- - # Copy all the HDF5 files from the test directory into the source directory + # Copy all the test files from source directory to test directory # -------------------------------------------------------------------- - SET (HDF5_REFERENCE_FILES - help-1.ls - help-2.ls - help-3.ls - nosuchfile.ls - tall-1.ls - tall-2.ls - tarray1.ls - tattr2.ls - tcomp-1.ls - tdataregbe.ls - tdataregle.ls - tdset-1.ls - tempty.ls - textlink-1.ls - textlinksrc-1.ls - textlinksrc-2.ls - textlinksrc-3.ls - textlinksrc-4.ls - textlinksrc-5.ls - textlinksrc-6.ls - textlinksrc-7.ls - textlinksrc-1-old.ls - textlinksrc-2-old.ls - textlinksrc-3-old.ls - textlinksrc-6-old.ls - textlinksrc-7-old.ls - tsoftlinks-1.ls - tsoftlinks-2.ls - tsoftlinks-3.ls - tsoftlinks-4.ls - tsoftlinks-5.ls - textlinksrc-nodangle-1.ls - textlinksrc-nodangle-2.ls - tgrp_comments.ls - tsoftlinks-nodangle-1.ls - thlinks-nodangle-1.ls - tgroup.ls - tgroup-1.ls - tgroup-2.ls - tgroup-3.ls - thlink-1.ls - tloop-1.ls - tnestcomp-1.ls - tnestcomp-2.ls - tnestcomp-3.ls - tnestcomp-4.ls - tsaf.ls - tslink-1.ls - tstr-1.ls - tudlink-1.ls - tvldtypes1.ls - tvldtypes2le.ls - tvldtypes2be.ls + SET (LIST_HDF5_TEST_FILES + ${HDF5_TOOLS_SRC_DIR}/testfiles/tall.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray1.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tattr2.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tattrreg.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tcompound.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tdatareg.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tdset.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tempty.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/textlink.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinktar.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tgroup.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tgrp_comments.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/thlink.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tloop.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tnestedcomp.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tsaf.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tslink.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tsoftlinks.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tstr.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tudlink.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tvldtypes1.h5 ) - SET (HDF5_REFERENCE_TEST_FILES - tall.h5 - tarray1.h5 - tattr2.h5 - tcompound.h5 - tdatareg.h5 - tdset.h5 - tempty.h5 - textlink.h5 - textlinksrc.h5 - textlinktar.h5 - tgroup.h5 - tgrp_comments.h5 - thlink.h5 - tloop.h5 - tnestedcomp.h5 - tsaf.h5 - tslink.h5 - tsoftlinks.h5 - tstr.h5 - tudlink.h5 - tvldtypes1.h5 + + SET (LIST_OTHER_TEST_FILES + ${HDF5_TOOLS_SRC_DIR}/testfiles/help-1.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/help-2.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/help-3.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/nosuchfile.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tall-1.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tall-2.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray1.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tattr2.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tattrreg_le.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tattrreg_be.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tcomp-1.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tdataregbe.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tdataregle.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tdset-1.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tempty.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/textlink-1.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc-1.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc-2.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc-3.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc-4.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc-5.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc-6.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc-7.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc-1-old.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc-2-old.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc-3-old.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc-6-old.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc-7-old.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tsoftlinks-1.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tsoftlinks-2.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tsoftlinks-3.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tsoftlinks-4.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tsoftlinks-5.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc-nodangle-1.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc-nodangle-2.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tgrp_comments.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tsoftlinks-nodangle-1.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/thlinks-nodangle-1.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tgroup.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tgroup-1.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tgroup-2.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tgroup-3.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/thlink-1.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tloop-1.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tmultifile.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tnestcomp-1.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tnestcomp-2.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tnestcomp-3.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tnestcomp-4.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tsaf.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tslink-1.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tstr-1.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tudlink-1.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tvldtypes1.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tvldtypes2le.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tvldtypes2be.ls ) - FOREACH (ls_file ${HDF5_REFERENCE_FILES}) - SET (lsdest "${PROJECT_BINARY_DIR}/${ls_file}") - #MESSAGE (STATUS " Translating ${ls_file}") - ADD_CUSTOM_COMMAND ( - TARGET h5ls - POST_BUILD - COMMAND ${XLATE_UTILITY} - ARGS ${HDF5_TOOLS_SRC_DIR}/testfiles/${ls_file} ${lsdest} -l3 - ) - ENDFOREACH (ls_file ${HDF5_REFERENCE_FILES}) + FILE (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - FOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) - SET (dest "${PROJECT_BINARY_DIR}/${h5_file}") - #MESSAGE (STATUS " Copying ${h5_file}") + # copy the list of test files + FOREACH (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) + GET_FILENAME_COMPONENT(fname "${listfiles}" NAME) + SET (dest "${PROJECT_BINARY_DIR}/testfiles/${fname}") + #MESSAGE (STATUS " Copying ${listfiles} to ${dest}") ADD_CUSTOM_COMMAND ( TARGET h5ls POST_BUILD COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different ${HDF5_TOOLS_SRC_DIR}/testfiles/${h5_file} ${dest} + ARGS -E copy_if_different ${listfiles} ${dest} ) - ENDFOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) + ENDFOREACH (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) + ############################################################################## ############################################################################## @@ -139,26 +138,33 @@ IF (BUILD_TESTING) # If using memchecker add tests without using scripts IF (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST (NAME H5LS-${resultfile} COMMAND $ ${ARGN}) + SET_TESTS_PROPERTIES (H5LS-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") IF (${resultcode} STREQUAL "1") SET_TESTS_PROPERTIES (H5LS-${resultfile} PROPERTIES WILL_FAIL "true") ENDIF (${resultcode} STREQUAL "1") + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5LS-${resultfile} PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + SET (last_test "H5LS-${resultfile}") ELSE (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( + NAME H5LS-clear-${resultfile}-objects + COMMAND ${CMAKE_COMMAND} + -E remove ./testfiles/${resultfile}.out ./testfiles/${resultfile}.out.err + ) + ADD_TEST ( NAME H5LS-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" -D "TEST_ARGS=${ARGN}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${resultfile}.out" -D "TEST_EXPECT=${resultcode}" -D "TEST_REFERENCE=${resultfile}.ls" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) + SET_TESTS_PROPERTIES (H5LS-${resultfile} PROPERTIES DEPENDS "H5LS-clear-${resultfile}-objects") ENDIF (HDF5_ENABLE_USING_MEMCHECKER) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5LS-${resultfile} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5LS-${resultfile}") ENDMACRO (ADD_H5_TEST file) ############################################################################## @@ -167,8 +173,9 @@ IF (BUILD_TESTING) ############################################################################## ############################################################################## - # Remove any output file left over from previous test run - ADD_TEST ( + IF (HDF5_ENABLE_USING_MEMCHECKER) + # Remove any output file left over from previous test run + ADD_TEST ( NAME H5LS-clearall-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -278,11 +285,12 @@ IF (BUILD_TESTING) tvldtypes2le.out.err tvldtypes2be.out tvldtypes2be.out.err - ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5LS-clearall-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5LS-clearall-objects") + ) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5LS-clearall-objects PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + SET (last_test "H5LS-clearall-objects") + ENDIF (HDF5_ENABLE_USING_MEMCHECKER) # test the help syntax ADD_H5_TEST (help-1 0 -w80 -h) @@ -347,6 +355,11 @@ IF (BUILD_TESTING) # when used file with no dangling links - expected exit code 0 ADD_H5_TEST (thlinks-nodangle-1 0 -w80 --follow-symlinks --no-dangling-links thlink.h5) +# test for wildcards in filename (does not work with cmake) +# ADD_H5_TEST (tstarfile 0 -w80 t*link.h5) +# ADD_H5_TEST (tqmarkfile 0 -w80 t?link.h5) + ADD_H5_TEST (tmultifile 0 -w80 thlink.h5 tslink.h5) + # tests for hard links ADD_H5_TEST (thlink-1 0 -w80 thlink.h5) @@ -384,18 +397,30 @@ IF (BUILD_TESTING) # enable -S for avoiding printing NATIVE types ADD_H5_TEST (tattr2 0 -w80 -v -S tattr2.h5) + # test for attribute with region references wo verbose mode + # ( HDFFV-7838, ) + IF (H5_WORDS_BIGENDIAN) + ADD_H5_TEST (tattrreg_be 0 -w80 -v -d tattrreg.h5) + ELSE (H5_WORDS_BIGENDIAN) + ADD_H5_TEST (tattrreg_le 0 -w80 -v -d tattrreg.h5) + ENDIF (H5_WORDS_BIGENDIAN) + # test for non-existing file ADD_H5_TEST (nosuchfile 1 nosuchfile.h5) - IF (WORDS_BIGENDIAN) - # test for variable length data types in verbose mode + # test for variable length data types in verbose mode + IF (H5_WORDS_BIGENDIAN) ADD_H5_TEST (tvldtypes2be 0 -v tvldtypes1.h5) - # test for dataset region references data types in verbose mode - ADD_H5_TEST (tdataregbe 0 -v tdatareg.h5) - ELSE (WORDS_BIGENDIAN) + ELSE (H5_WORDS_BIGENDIAN) ADD_H5_TEST (tvldtypes2le 0 -v tvldtypes1.h5) + ENDIF (H5_WORDS_BIGENDIAN) + + # test for dataset region references data types in verbose mode + IF (H5_WORDS_BIGENDIAN) + ADD_H5_TEST (tdataregbe 0 -v tdatareg.h5) + ELSE (H5_WORDS_BIGENDIAN) ADD_H5_TEST (tdataregle 0 -v tdatareg.h5) - ENDIF (WORDS_BIGENDIAN) + ENDIF (H5_WORDS_BIGENDIAN) ENDIF (BUILD_TESTING) diff --git a/tools/h5ls/Makefile.in b/tools/h5ls/Makefile.in index 0912c71..1a33335 100644 --- a/tools/h5ls/Makefile.in +++ b/tools/h5ls/Makefile.in @@ -175,6 +175,7 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ +FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ @@ -195,10 +196,12 @@ H5_LONE_COLON = @H5_LONE_COLON@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ +HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ +HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ diff --git a/tools/h5ls/h5ls.c b/tools/h5ls/h5ls.c index 722f45c..e7a0304 100644 --- a/tools/h5ls/h5ls.c +++ b/tools/h5ls/h5ls.c @@ -27,12 +27,87 @@ #include "H5private.h" #include "h5tools.h" #include "h5tools_utils.h" +#include "h5tools_dump.h" #include "h5trav.h" /* Name of tool */ #define PROGRAMNAME "h5ls" #define NAME_BUF_SIZE 2048 +/* + * Alternative formating for data dumped by H5LS + * + * This table only affects H5LS output. + */ +static h5tool_format_t ls_dataformat = { + 0, /*raw */ + + "", /*fmt_raw */ + "%d", /*fmt_int */ + "%u", /*fmt_uint */ + "%hhd", /*fmt_schar */ + "%u", /*fmt_uchar */ + "%d", /*fmt_short */ + "%u", /*fmt_ushort */ + "%ld", /*fmt_long */ + "%lu", /*fmt_ulong */ + NULL, /*fmt_llong */ + NULL, /*fmt_ullong */ + "%g", /*fmt_double */ + "%g", /*fmt_float */ + + 0, /*ascii */ + 0, /*str_locale */ + 0, /*str_repeat */ + + "[", /*arr_pre */ + ",", /*arr_sep */ + "]", /*arr_suf */ + 1, /*arr_linebreak */ + + "", /*cmpd_name */ + ",", /*cmpd_sep */ + "{", /*cmpd_pre */ + "}", /*cmpd_suf */ + "", /*cmpd_end */ + NULL, /* cmpd_listv */ + + ",", /*vlen_sep */ + "(", /*vlen_pre */ + ")", /*vlen_suf */ + "", /*vlen_end */ + + "%s", /*elmt_fmt */ + ",", /*elmt_suf1 */ + " ", /*elmt_suf2 */ + + HSIZE_T_FORMAT, /*idx_n_fmt */ + ",", /*idx_sep */ + "(%s)", /*idx_fmt */ + + 65535, /*line_ncols *//*standard default columns */ + 0, /*line_per_line */ + "", /*line_pre */ + "%s", /*line_1st */ + "%s", /*line_cont */ + "", /*line_suf */ + "", /*line_sep */ + 1, /*line_multi_new */ + "", /*line_indent */ + + 0, /*skip_first */ + + 0, /*obj_hidefileno */ + "-%lu:"H5_PRINTF_HADDR_FMT, /*obj_format */ + + 0, /*dset_hidefileno */ + "DSET-%s ", /*dset_format */ + "%sBlk%lu: ", /*dset_blockformat_pre */ + "%sPt%lu: ", /*dset_ptformat_pre */ + "%s", /*dset_ptformat */ + 1, /*array indices */ + 1 /*escape non printable characters */ +}; /* Struct to pass through to visitors */ typedef struct { @@ -81,6 +156,7 @@ static struct dispatch_t { } static void display_type(hid_t type, int ind); +static void print_type(h5tools_str_t *buffer, hid_t type, int ind); static herr_t visit_obj(hid_t file, const char *oname, iter_t *iter); @@ -101,7 +177,7 @@ static herr_t visit_obj(hid_t file, const char *oname, iter_t *iter); static void usage (void) { - fprintf(stderr, "\ + HDfprintf(rawerrorstream, "\ usage: %s [OPTIONS] [OBJECTS...]\n\ OPTIONS\n\ -h, -?, --help Print a usage message and exit\n\ @@ -164,8 +240,9 @@ usage: %s [OPTIONS] [OBJECTS...]\n\ } + /*------------------------------------------------------------------------- - * Function: display_string + * Function: print_string * * Purpose: Print a string value by escaping unusual characters. If * STREAM is null then we only count how large the output would @@ -181,57 +258,57 @@ usage: %s [OPTIONS] [OBJECTS...]\n\ *------------------------------------------------------------------------- */ static int -display_string(FILE *stream, const char *s, hbool_t escape_spaces) +print_string(h5tools_str_t *buffer, const char *s, hbool_t escape_spaces) { int nprint=0; for (/*void*/; s && *s; s++) { switch (*s) { case '"': - if (stream) fprintf(stream, "\\\""); + if (buffer) h5tools_str_append(buffer, "\\\""); nprint += 2; break; case '\\': - if (stream) fprintf(stream, "\\\\"); + if (buffer) h5tools_str_append(buffer, "\\\\"); nprint += 2; break; case '\b': - if (stream) fprintf(stream, "\\b"); + if (buffer) h5tools_str_append(buffer, "\\b"); nprint += 2; break; case '\f': - if (stream) fprintf(stream, "\\f"); + if (buffer) h5tools_str_append(buffer, "\\f"); nprint += 2; break; case '\n': - if (stream) fprintf(stream, "\\n"); + if (buffer) h5tools_str_append(buffer, "\\n"); nprint += 2; break; case '\r': - if (stream) fprintf(stream, "\\r"); + if (buffer) h5tools_str_append(buffer, "\\r"); nprint += 2; break; case '\t': - if (stream) fprintf(stream, "\\t"); + if (buffer) h5tools_str_append(buffer, "\\t"); nprint += 2; break; case ' ': if (escape_spaces) { - if (stream) fprintf(stream, "\\ "); + if (buffer) h5tools_str_append(buffer, "\\ "); nprint += 2; - } else { - if (stream) fprintf(stream, " "); + } + else { + if (buffer) h5tools_str_append(buffer, " "); nprint++; } break; default: if (isprint((int)*s)) { - if (stream) putc(*s, stream); + if (buffer) h5tools_str_append(buffer, "%c", *s); nprint++; - } else { - if (stream) { - fprintf(stream, "\\%03o", *((const unsigned char*)s)); - } + } + else { + if (buffer) h5tools_str_append(buffer, "\\%03o", *((const unsigned char*)s)); nprint += 4; } break; @@ -242,7 +319,7 @@ display_string(FILE *stream, const char *s, hbool_t escape_spaces) /*------------------------------------------------------------------------- - * Function: display_obj_name + * Function: print_obj_name * * Purpose: Print an object name and another string. * @@ -258,7 +335,7 @@ display_string(FILE *stream, const char *s, hbool_t escape_spaces) *------------------------------------------------------------------------- */ static int -display_obj_name(FILE *stream, const iter_t *iter, const char *oname, +print_obj_name(h5tools_str_t *buffer, const iter_t *iter, const char *oname, const char *s) { static char fullname[NAME_BUF_SIZE]; /* Buffer for file and/or object name */ @@ -272,7 +349,7 @@ display_obj_name(FILE *stream, const iter_t *iter, const char *oname, /* Print the object name, either full name or base name */ if(fullname_g) - n = display_string(stream, name, TRUE); + n = print_string(buffer, name, TRUE); else { const char *last_sep; /* The location of the last group separator */ @@ -282,16 +359,16 @@ display_obj_name(FILE *stream, const iter_t *iter, const char *oname, else { last_sep++; } /* end else */ - n = display_string(stream, last_sep, TRUE); + n = print_string(buffer, last_sep, TRUE); } /* end else */ - printf("%*s ", MAX(0, (24 - n)), s); + h5tools_str_append(buffer, "%*s ", MAX(0, (24 - n)), s); return TRUE; } /*------------------------------------------------------------------------- - * Function: display_native_type + * Function: print_native_type * * Purpose: Prints the name of a native C data type. * @@ -310,100 +387,100 @@ display_obj_name(FILE *stream, const iter_t *iter, const char *oname, *------------------------------------------------------------------------- */ static hbool_t -display_native_type(hid_t type, int UNUSED ind) +print_native_type(h5tools_str_t *buffer, hid_t type, int UNUSED ind) { if (H5Tequal(type, H5T_NATIVE_SCHAR)==TRUE) { - printf("native signed char"); + h5tools_str_append(buffer, "native signed char"); } else if (H5Tequal(type, H5T_NATIVE_UCHAR)==TRUE) { - printf("native unsigned char"); + h5tools_str_append(buffer, "native unsigned char"); } else if (H5Tequal(type, H5T_NATIVE_INT)==TRUE) { - printf("native int"); + h5tools_str_append(buffer, "native int"); } else if (H5Tequal(type, H5T_NATIVE_UINT)==TRUE) { - printf("native unsigned int"); + h5tools_str_append(buffer, "native unsigned int"); } else if (H5Tequal(type, H5T_NATIVE_SHORT)==TRUE) { - printf("native short"); + h5tools_str_append(buffer, "native short"); } else if (H5Tequal(type, H5T_NATIVE_USHORT)==TRUE) { - printf("native unsigned short"); + h5tools_str_append(buffer, "native unsigned short"); } else if (H5Tequal(type, H5T_NATIVE_LONG)==TRUE) { - printf("native long"); + h5tools_str_append(buffer, "native long"); } else if (H5Tequal(type, H5T_NATIVE_ULONG)==TRUE) { - printf("native unsigned long"); + h5tools_str_append(buffer, "native unsigned long"); } else if (H5Tequal(type, H5T_NATIVE_LLONG)==TRUE) { - printf("native long long"); + h5tools_str_append(buffer, "native long long"); } else if (H5Tequal(type, H5T_NATIVE_ULLONG)==TRUE) { - printf("native unsigned long long"); + h5tools_str_append(buffer, "native unsigned long long"); } else if (H5Tequal(type, H5T_NATIVE_FLOAT)==TRUE) { - printf("native float"); + h5tools_str_append(buffer, "native float"); } else if (H5Tequal(type, H5T_NATIVE_DOUBLE)==TRUE) { - printf("native double"); + h5tools_str_append(buffer, "native double"); #if H5_SIZEOF_LONG_DOUBLE !=0 } else if (H5Tequal(type, H5T_NATIVE_LDOUBLE)==TRUE) { - printf("native long double"); + h5tools_str_append(buffer, "native long double"); #endif } else if (H5Tequal(type, H5T_NATIVE_INT8)==TRUE) { - printf("native int8_t"); + h5tools_str_append(buffer, "native int8_t"); } else if (H5Tequal(type, H5T_NATIVE_UINT8)==TRUE) { - printf("native uint8_t"); + h5tools_str_append(buffer, "native uint8_t"); } else if (H5Tequal(type, H5T_NATIVE_INT16)==TRUE) { - printf("native int16_t"); + h5tools_str_append(buffer, "native int16_t"); } else if (H5Tequal(type, H5T_NATIVE_UINT16)==TRUE) { - printf("native uint16_t"); + h5tools_str_append(buffer, "native uint16_t"); } else if (H5Tequal(type, H5T_NATIVE_INT32)==TRUE) { - printf("native int32_t"); + h5tools_str_append(buffer, "native int32_t"); } else if (H5Tequal(type, H5T_NATIVE_UINT32)==TRUE) { - printf("native uint32_t"); + h5tools_str_append(buffer, "native uint32_t"); } else if (H5Tequal(type, H5T_NATIVE_INT64)==TRUE) { - printf("native int64_t"); + h5tools_str_append(buffer, "native int64_t"); } else if (H5Tequal(type, H5T_NATIVE_UINT64)==TRUE) { - printf("native uint64_t"); + h5tools_str_append(buffer, "native uint64_t"); } else if (H5Tequal(type, H5T_NATIVE_INT_LEAST8)==TRUE) { - printf("native int_least8_t"); + h5tools_str_append(buffer, "native int_least8_t"); } else if (H5Tequal(type, H5T_NATIVE_UINT_LEAST8)==TRUE) { - printf("native uint_least8_t"); + h5tools_str_append(buffer, "native uint_least8_t"); } else if (H5Tequal(type, H5T_NATIVE_INT_LEAST16)==TRUE) { - printf("native int_least16_t"); + h5tools_str_append(buffer, "native int_least16_t"); } else if (H5Tequal(type, H5T_NATIVE_UINT_LEAST16)==TRUE) { - printf("native uint_least16_t"); + h5tools_str_append(buffer, "native uint_least16_t"); } else if (H5Tequal(type, H5T_NATIVE_INT_LEAST32)==TRUE) { - printf("native int_least32_t"); + h5tools_str_append(buffer, "native int_least32_t"); } else if (H5Tequal(type, H5T_NATIVE_UINT_LEAST32)==TRUE) { - printf("native uint_least32_t"); + h5tools_str_append(buffer, "native uint_least32_t"); } else if (H5Tequal(type, H5T_NATIVE_INT_LEAST64)==TRUE) { - printf("native int_least64_t"); + h5tools_str_append(buffer, "native int_least64_t"); } else if (H5Tequal(type, H5T_NATIVE_UINT_LEAST64)==TRUE) { - printf("native uint_least64_t"); + h5tools_str_append(buffer, "native uint_least64_t"); } else if (H5Tequal(type, H5T_NATIVE_INT_FAST8)==TRUE) { - printf("native int_fast8_t"); + h5tools_str_append(buffer, "native int_fast8_t"); } else if (H5Tequal(type, H5T_NATIVE_UINT_FAST8)==TRUE) { - printf("native uint_fast8_t"); + h5tools_str_append(buffer, "native uint_fast8_t"); } else if (H5Tequal(type, H5T_NATIVE_INT_FAST16)==TRUE) { - printf("native int_fast16_t"); + h5tools_str_append(buffer, "native int_fast16_t"); } else if (H5Tequal(type, H5T_NATIVE_UINT_FAST16)==TRUE) { - printf("native uint_fast16_t"); + h5tools_str_append(buffer, "native uint_fast16_t"); } else if (H5Tequal(type, H5T_NATIVE_INT_FAST32)==TRUE) { - printf("native int_fast32_t"); + h5tools_str_append(buffer, "native int_fast32_t"); } else if (H5Tequal(type, H5T_NATIVE_UINT_FAST32)==TRUE) { - printf("native uint_fast32_t"); + h5tools_str_append(buffer, "native uint_fast32_t"); } else if (H5Tequal(type, H5T_NATIVE_INT_FAST64)==TRUE) { - printf("native int_fast64_t"); + h5tools_str_append(buffer, "native int_fast64_t"); } else if (H5Tequal(type, H5T_NATIVE_UINT_FAST64)==TRUE) { - printf("native uint_fast64_t"); + h5tools_str_append(buffer, "native uint_fast64_t"); } else if (H5Tequal(type, H5T_NATIVE_B8)==TRUE) { - printf("native 8-bit field"); + h5tools_str_append(buffer, "native 8-bit field"); } else if (H5Tequal(type, H5T_NATIVE_B16)==TRUE) { - printf("native 16-bit field"); + h5tools_str_append(buffer, "native 16-bit field"); } else if (H5Tequal(type, H5T_NATIVE_B32)==TRUE) { - printf("native 32-bit field"); + h5tools_str_append(buffer, "native 32-bit field"); } else if (H5Tequal(type, H5T_NATIVE_B64)==TRUE) { - printf("native 64-bit field"); + h5tools_str_append(buffer, "native 64-bit field"); } else if (H5Tequal(type, H5T_NATIVE_HSIZE)==TRUE) { - printf("native hsize_t"); + h5tools_str_append(buffer, "native hsize_t"); } else if (H5Tequal(type, H5T_NATIVE_HSSIZE)==TRUE) { - printf("native hssize_t"); + h5tools_str_append(buffer, "native hssize_t"); } else if (H5Tequal(type, H5T_NATIVE_HERR)==TRUE) { - printf("native herr_t"); + h5tools_str_append(buffer, "native herr_t"); } else if (H5Tequal(type, H5T_NATIVE_HBOOL)==TRUE) { - printf("native hbool_t"); + h5tools_str_append(buffer, "native hbool_t"); } else { return FALSE; } @@ -412,7 +489,7 @@ display_native_type(hid_t type, int UNUSED ind) /*------------------------------------------------------------------------- - * Function: display_ieee_type + * Function: print_ieee_type * * Purpose: Print the name of an IEEE floating-point data type. * @@ -428,17 +505,21 @@ display_native_type(hid_t type, int UNUSED ind) *------------------------------------------------------------------------- */ static hbool_t -display_ieee_type(hid_t type, int UNUSED ind) +print_ieee_type(h5tools_str_t *buffer, hid_t type, int UNUSED ind) { if (H5Tequal(type, H5T_IEEE_F32BE)==TRUE) { - printf("IEEE 32-bit big-endian float"); - } else if (H5Tequal(type, H5T_IEEE_F32LE)==TRUE) { - printf("IEEE 32-bit little-endian float"); - } else if (H5Tequal(type, H5T_IEEE_F64BE)==TRUE) { - printf("IEEE 64-bit big-endian float"); - } else if (H5Tequal(type, H5T_IEEE_F64LE)==TRUE) { - printf("IEEE 64-bit little-endian float"); - } else { + h5tools_str_append(buffer, "IEEE 32-bit big-endian float"); + } + else if (H5Tequal(type, H5T_IEEE_F32LE)==TRUE) { + h5tools_str_append(buffer, "IEEE 32-bit little-endian float"); + } + else if (H5Tequal(type, H5T_IEEE_F64BE)==TRUE) { + h5tools_str_append(buffer, "IEEE 64-bit big-endian float"); + } + else if (H5Tequal(type, H5T_IEEE_F64LE)==TRUE) { + h5tools_str_append(buffer, "IEEE 64-bit little-endian float"); + } + else { return FALSE; } return TRUE; @@ -446,7 +527,7 @@ display_ieee_type(hid_t type, int UNUSED ind) /*------------------------------------------------------------------------- - * Function: display_precision + * Function: print_precision * * Purpose: Prints information on the next line about precision and * padding if the precision is less than the total data type @@ -462,7 +543,7 @@ display_ieee_type(hid_t type, int UNUSED ind) *------------------------------------------------------------------------- */ static void -display_precision(hid_t type, int ind) +print_precision(h5tools_str_t *buffer, hid_t type, int ind) { size_t prec; /* precision */ H5T_pad_t plsb, pmsb; /* lsb and msb padding */ @@ -474,7 +555,7 @@ display_precision(hid_t type, int ind) * and offset on the following line. Also display the padding * information. */ if (8*H5Tget_size(type)!=(prec=H5Tget_precision(type))) { - printf("\n%*s(%lu bit%s of precision beginning at bit %lu)", + h5tools_str_append(buffer, "\n%*s(%lu bit%s of precision beginning at bit %lu)", ind, "", (unsigned long)prec, 1==prec?"":"s", (unsigned long)H5Tget_offset(type)); @@ -520,27 +601,27 @@ display_precision(hid_t type, int ind) } } if (plsb_s || pmsb_s) { - printf("\n%*s(", ind, ""); + h5tools_str_append(buffer, "\n%*s(", ind, ""); if (plsb_s) { nbits = H5Tget_offset(type); - printf("%lu %s bit%s at bit 0", + h5tools_str_append(buffer, "%lu %s bit%s at bit 0", (unsigned long)nbits, plsb_s, 1==nbits?"":"s"); } - if (plsb_s && pmsb_s) printf(", "); + if (plsb_s && pmsb_s) h5tools_str_append(buffer, ", "); if (pmsb_s) { nbits = 8*H5Tget_size(type)-(H5Tget_offset(type)+prec); - printf("%lu %s bit%s at bit %lu", + h5tools_str_append(buffer, "%lu %s bit%s at bit %lu", (unsigned long)nbits, pmsb_s, 1==nbits?"":"s", (unsigned long)(8*H5Tget_size(type)-nbits)); } - printf(")"); + h5tools_str_append(buffer, ")"); } } } /*------------------------------------------------------------------------- - * Function: display_int_type + * Function: print_int_type * * Purpose: Print the name of an integer data type. Common information * like number of bits, byte order, and sign scheme appear on @@ -559,7 +640,7 @@ display_precision(hid_t type, int ind) *------------------------------------------------------------------------- */ static hbool_t -display_int_type(hid_t type, int ind) +print_int_type(h5tools_str_t *buffer, hid_t type, int ind) { H5T_order_t order; /* byte order value */ const char *order_s=NULL; /* byte order string */ @@ -573,14 +654,18 @@ display_int_type(hid_t type, int ind) order = H5Tget_order(type); if (H5T_ORDER_LE==order) { order_s = " little-endian"; - } else if (H5T_ORDER_BE==order) { + } + else if (H5T_ORDER_BE==order) { order_s = " big-endian"; - } else if (H5T_ORDER_VAX==order) { + } + else if (H5T_ORDER_VAX==order) { order_s = " mixed-endian"; - } else { + } + else { order_s = " unknown-byte-order"; } - } else { + } + else { order_s = ""; } @@ -588,26 +673,29 @@ display_int_type(hid_t type, int ind) if ((sign=H5Tget_sign(type))>=0) { if (H5T_SGN_NONE==sign) { sign_s = " unsigned"; - } else if (H5T_SGN_2==sign) { + } + else if (H5T_SGN_2==sign) { sign_s = ""; - } else { + } + else { sign_s = " unknown-sign"; } - } else { + } + else { sign_s = " unknown-sign"; } /* Print size, order, and sign on first line, precision and padding * information on the subsequent lines */ - printf("%lu-bit%s%s integer", + h5tools_str_append(buffer, "%lu-bit%s%s integer", (unsigned long)(8*H5Tget_size(type)), order_s, sign_s); - display_precision(type, ind); + print_precision(buffer, type, ind); return TRUE; } /*------------------------------------------------------------------------- - * Function: display_float_type + * Function: print_float_type * * Purpose: Print info about a floating point data type. * @@ -623,7 +711,7 @@ display_int_type(hid_t type, int ind) *------------------------------------------------------------------------- */ static hbool_t -display_float_type(hid_t type, int ind) +print_float_type(h5tools_str_t *buffer, hid_t type, int ind) { H5T_order_t order; /* byte order value */ const char *order_s=NULL; /* byte order string */ @@ -643,22 +731,26 @@ display_float_type(hid_t type, int ind) order = H5Tget_order(type); if (H5T_ORDER_LE==order) { order_s = " little-endian"; - } else if (H5T_ORDER_BE==order) { + } + else if (H5T_ORDER_BE==order) { order_s = " big-endian"; - } else if (H5T_ORDER_VAX==order) { + } + else if (H5T_ORDER_VAX==order) { order_s = " mixed-endian"; - } else { + } + else { order_s = " unknown-byte-order"; } - } else { + } + else { order_s = ""; } /* Print size and byte order on first line, precision and padding on * subsequent lines. */ - printf("%lu-bit%s floating-point", + h5tools_str_append(buffer, "%lu-bit%s floating-point", (unsigned long)(8*H5Tget_size(type)), order_s); - display_precision(type, ind); + print_precision(buffer, type, ind); /* Print sizes, locations, and other information about each field */ H5Tget_fields (type, &spos, &epos, &esize, &mpos, &msize); @@ -681,13 +773,13 @@ display_float_type(hid_t type, int ind) ; break; } - printf("\n%*s(significant for %lu bit%s at bit %lu%s)", ind, "", + h5tools_str_append(buffer, "\n%*s(significant for %lu bit%s at bit %lu%s)", ind, "", (unsigned long)msize, 1==msize?"":"s", (unsigned long)mpos, norm_s); - printf("\n%*s(exponent for %lu bit%s at bit %lu, bias is 0x%lx)", + h5tools_str_append(buffer, "\n%*s(exponent for %lu bit%s at bit %lu, bias is 0x%lx)", ind, "", (unsigned long)esize, 1==esize?"":"s", (unsigned long)epos, (unsigned long)ebias); - printf("\n%*s(sign bit at %lu)", ind, "", (unsigned long)spos); + h5tools_str_append(buffer, "\n%*s(sign bit at %lu)", ind, "", (unsigned long)spos); /* Display internal padding */ if (1+esize+msize0); + HDassert(nmembs>0); super = H5Tget_super(type); - printf("enum "); - display_type(super, ind+4); - printf(" {"); + h5tools_str_append(buffer, "enum "); + print_type(buffer, super, ind+4); + h5tools_str_append(buffer, " {"); /* Determine what data type to use for the native values. To simplify * things we entertain three possibilities: @@ -822,8 +914,8 @@ display_enum_type(hid_t type, int ind) } /* Get the names and raw values of all members */ - name = calloc(nmembs, sizeof(char*)); - value = (unsigned char *)calloc(nmembs, MAX(H5Tget_size(type), dst_size)); + name = HDcalloc(nmembs, sizeof(char*)); + value = (unsigned char *)HDcalloc(nmembs, MAX(H5Tget_size(type), dst_size)); for (i=0; i", ind+4, ""); - printf("\n%*s}", ind, ""); + if (0==nmembs) h5tools_str_append(buffer, "\n%*s ", ind+4, ""); + h5tools_str_append(buffer, "\n%*s}", ind, ""); return TRUE; } /*------------------------------------------------------------------------- - * Function: display_string_type + * Function: print_string_type * * Purpose: Print information about a string data type. * @@ -889,7 +982,7 @@ display_enum_type(hid_t type, int ind) *------------------------------------------------------------------------- */ static hbool_t -display_string_type(hid_t type, int UNUSED ind) +print_string_type(h5tools_str_t *buffer, hid_t type, int UNUSED ind) { H5T_str_t pad; const char *pad_s=NULL; @@ -963,17 +1056,18 @@ display_string_type(hid_t type, int UNUSED ind) } if (H5Tis_variable_str(type)) { - printf("variable-length"); - } else { - printf("%lu-byte", (unsigned long)H5Tget_size(type)); + h5tools_str_append(buffer, "variable-length"); + } + else { + h5tools_str_append(buffer, "%lu-byte", (unsigned long)H5Tget_size(type)); } - printf(" %s %s string", pad_s, cset_s); + h5tools_str_append(buffer, " %s %s string", pad_s, cset_s); return TRUE; } /*------------------------------------------------------------------------- - * Function: display_reference_type + * Function: print_reference_type * * Purpose: Prints information about a reference data type. * @@ -991,16 +1085,18 @@ display_string_type(hid_t type, int UNUSED ind) *------------------------------------------------------------------------- */ static hbool_t -display_reference_type(hid_t type, int UNUSED ind) +print_reference_type(h5tools_str_t *buffer, hid_t type, int UNUSED ind) { if (H5T_REFERENCE!=H5Tget_class(type)) return FALSE; if (H5Tequal(type, H5T_STD_REF_OBJ)==TRUE) { - printf("object reference"); - } else if (H5Tequal(type, H5T_STD_REF_DSETREG)==TRUE) { - printf("dataset region reference"); - } else { - printf("%lu-byte unknown reference", + h5tools_str_append(buffer, "object reference"); + } + else if (H5Tequal(type, H5T_STD_REF_DSETREG)==TRUE) { + h5tools_str_append(buffer, "dataset region reference"); + } + else { + h5tools_str_append(buffer, "%lu-byte unknown reference", (unsigned long)H5Tget_size(type)); } @@ -1009,7 +1105,7 @@ display_reference_type(hid_t type, int UNUSED ind) /*------------------------------------------------------------------------- - * Function: display_opaque_type + * Function: print_opaque_type * * Purpose: Prints information about an opaque data type. * @@ -1025,7 +1121,7 @@ display_reference_type(hid_t type, int UNUSED ind) *------------------------------------------------------------------------- */ static hbool_t -display_opaque_type(hid_t type, int ind) +print_opaque_type(h5tools_str_t *buffer, hid_t type, int ind) { char *tag; size_t size; @@ -1033,19 +1129,19 @@ display_opaque_type(hid_t type, int ind) if (H5T_OPAQUE!=H5Tget_class(type)) return FALSE; size = H5Tget_size(type); - printf("%lu-byte opaque type", (unsigned long)size); + h5tools_str_append(buffer, "%lu-byte opaque type", (unsigned long)size); if ((tag=H5Tget_tag(type))) { - printf("\n%*s(tag = \"", ind, ""); - display_string(stdout, tag, FALSE); - printf("\")"); - free(tag); + h5tools_str_append(buffer, "\n%*s(tag = \"", ind, ""); + print_string(buffer, tag, FALSE); + h5tools_str_append(buffer, "\")"); + HDfree(tag); } return TRUE; } /*------------------------------------------------------------------------- - * Function: display_vlen_type + * Function: print_vlen_type * * Purpose: Print information about a variable-length type * @@ -1060,15 +1156,15 @@ display_opaque_type(hid_t type, int ind) *------------------------------------------------------------------------- */ static hbool_t -display_vlen_type(hid_t type, int ind) +print_vlen_type(h5tools_str_t *buffer, hid_t type, int ind) { hid_t super; if (H5T_VLEN!=H5Tget_class(type)) return FALSE; - printf("variable length of\n%*s", ind+4, ""); + h5tools_str_append(buffer, "variable length of\n%*s", ind+4, ""); super = H5Tget_super(type); - display_type(super, ind+4); + print_type(buffer, super, ind+4); H5Tclose(super); return TRUE; } @@ -1088,7 +1184,7 @@ display_vlen_type(hid_t type, int ind) *--------------------------------------------------------------------------- */ static hbool_t -display_array_type(hid_t type, int ind) +print_array_type(h5tools_str_t *buffer, hid_t type, int ind) { hid_t super; int ndims, i; @@ -1097,31 +1193,32 @@ display_array_type(hid_t type, int ind) if (H5T_ARRAY!=H5Tget_class(type)) return FALSE; ndims = H5Tget_array_ndims(type); if (ndims) { - dims = (hsize_t *)malloc(ndims*sizeof(dims[0])); + dims = (hsize_t *)HDmalloc(ndims*sizeof(dims[0])); H5Tget_array_dims2(type, dims); /* Print dimensions */ for (i=0; i"); + h5tools_str_append(buffer,""); return; } @@ -1203,29 +1300,29 @@ display_type(hid_t type, int ind) H5O_info_t oi; if(H5Oget_info(type, &oi) >= 0) - printf("shared-%lu:"H5_PRINTF_HADDR_FMT" ", + h5tools_str_append(buffer,"shared-%lu:"H5_PRINTF_HADDR_FMT" ", oi.fileno, oi.addr); else - printf("shared "); + h5tools_str_append(buffer,"shared "); } /* end if */ /* Print the type */ - if((!simple_output_g && display_native_type(type, ind)) || - display_ieee_type(type, ind) || - display_int_type(type, ind) || - display_float_type(type, ind) || - display_cmpd_type(type, ind) || - display_enum_type(type, ind) || - display_string_type(type, ind) || - display_reference_type(type, ind) || - display_vlen_type(type, ind) || - display_array_type(type, ind) || - display_opaque_type(type, ind) || - display_bitfield_type(type, ind)) + if((!simple_output_g && print_native_type(buffer, type, ind)) || + print_ieee_type(buffer, type, ind) || + print_int_type(buffer, type, ind) || + print_float_type(buffer, type, ind) || + print_cmpd_type(buffer, type, ind) || + print_enum_type(buffer, type, ind) || + print_string_type(buffer, type, ind) || + print_reference_type(buffer, type, ind) || + print_vlen_type(buffer, type, ind) || + print_array_type(buffer, type, ind) || + print_opaque_type(buffer, type, ind) || + print_bitfield_type(buffer, type, ind)) return; /* Unknown type */ - printf("%lu-byte class-%u unknown", + h5tools_str_append(buffer,"%lu-byte class-%u unknown", (unsigned long)H5Tget_size(type), (unsigned)data_class); } @@ -1249,98 +1346,115 @@ display_type(hid_t type, int ind) static void dump_dataset_values(hid_t dset) { + char string_prefix[64]; + static char fmt_double[16]; + static char fmt_float[16]; + hsize_t curr_pos = 0; /* total data element position */ + h5tools_str_t buffer; /* string into which to render */ + h5tools_context_t ctx; /* print context */ + h5tool_format_t outputformat; + h5tool_format_t *info = &ls_dataformat; + hid_t f_type = H5Dget_type(dset); size_t size = H5Tget_size(f_type); - h5tool_format_t info; - char string_prefix[64]; - static char fmt_double[16], fmt_float[16]; - /* Set to all default values and then override */ - memset(&info, 0, sizeof info); + HDmemset(&ctx, 0, sizeof(ctx)); + HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + outputformat = *info; + outputformat.line_1st = NULL; if (simple_output_g) { - info.idx_fmt = ""; - info.line_ncols = 65535; /*something big*/ - info.line_per_line = 1; - info.line_multi_new = 0; - info.line_pre = " "; - info.line_cont = " "; - - info.arr_pre = ""; - info.arr_suf = ""; - info.arr_sep = " "; - - if (label_g) - { - info.cmpd_pre = "{"; - info.cmpd_suf = "}"; + outputformat.idx_fmt = ""; + outputformat.line_per_line = 1; + outputformat.line_multi_new = 0; + outputformat.line_pre = " "; + outputformat.line_cont = " "; + + outputformat.arr_pre = ""; + outputformat.arr_suf = ""; + outputformat.arr_sep = " "; + + if (!label_g) { + outputformat.cmpd_pre = ""; + outputformat.cmpd_suf = ""; } - else - { - info.cmpd_pre = ""; - info.cmpd_suf = ""; - } - info.cmpd_sep = " "; + outputformat.cmpd_sep = " "; - if (label_g) info.cmpd_name = "%s="; + if (label_g) outputformat.cmpd_name = "%s="; - info.elmt_suf1 = " "; - info.str_locale = ESCAPE_HTML; + outputformat.elmt_suf1 = " "; + outputformat.str_locale = ESCAPE_HTML; - } else { - info.idx_fmt = "(%s)"; + } + else { if (no_line_wrap_g) { - info.line_ncols = 65535; - info.line_per_line = 1; + outputformat.line_per_line = 1; } - else - info.line_ncols = width_g; - info.line_multi_new = 1; - if (label_g) info.cmpd_name = "%s="; - info.line_pre = " %s "; - info.line_cont = " %s "; - info.str_repeat = 8; + else { + outputformat.line_ncols = width_g; + } + if (label_g) outputformat.cmpd_name = "%s="; + outputformat.line_pre = " %s "; + outputformat.line_cont = " %s "; + outputformat.str_repeat = 8; + + outputformat.arr_pre = NULL; + outputformat.arr_suf = NULL; + outputformat.arr_sep = NULL; + + outputformat.cmpd_pre = NULL; + outputformat.cmpd_suf = NULL; + outputformat.cmpd_sep = NULL; + + outputformat.vlen_sep = NULL; + outputformat.vlen_pre = NULL; + outputformat.vlen_suf = NULL; + outputformat.vlen_end = NULL; } - + outputformat.arr_linebreak = 0; /* Floating point types should display full precision */ sprintf(fmt_float, "%%1.%dg", FLT_DIG); - info.fmt_float = fmt_float; + outputformat.fmt_float = fmt_float; sprintf(fmt_double, "%%1.%dg", DBL_DIG); - info.fmt_double = fmt_double; - - info.dset_format = "DSET-%s "; - info.dset_hidefileno = 0; - - info.obj_format = "-%lu:"H5_PRINTF_HADDR_FMT; - info.obj_hidefileno = 0; - - info.dset_blockformat_pre = "%sBlk%lu: "; - info.dset_ptformat_pre = "%sPt%lu: "; - - info.line_indent = ""; + outputformat.fmt_double = fmt_double; if (hexdump_g) { /* Print all data in hexadecimal format if the `-x' or `--hexdump' * command line switch was given. */ - info.raw = TRUE; - } else if (string_g && 1==size && H5T_INTEGER==H5Tget_class(f_type)) { + outputformat.raw = TRUE; + } + else if (string_g && 1==size && H5T_INTEGER==H5Tget_class(f_type)) { /* Print 1-byte integer data as an ASCI character string instead of * integers if the `-s' or `--string' command-line option was given. */ - info.ascii = TRUE; - info.elmt_suf1 = ""; - info.elmt_suf2 = ""; - strcpy(string_prefix, info.line_pre); + outputformat.ascii = TRUE; + outputformat.elmt_suf1 = ""; + outputformat.elmt_suf2 = ""; + strcpy(string_prefix, outputformat.line_pre); strcat(string_prefix, "\""); - info.line_pre = string_prefix; - info.line_suf = "\""; + outputformat.line_pre = string_prefix; + outputformat.line_suf = "\""; } + info = &outputformat; + ctx.indent_level = 2; + ctx.cur_column = curr_pos; /* Print all the values. */ - printf(" Data:\n"); - if (h5tools_dump_dset(stdout, &info, dset, -1, NULL, -1) < 0) - printf(" Unable to print data.\n"); + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, " Data:\n"); + h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0); + ctx.need_prefix = TRUE; + ctx.cur_column = curr_pos; + if (h5tools_dump_dset(rawoutstream, info, &ctx, dset, -1, NULL) < 0) { + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, " Unable to print data."); + h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0); + } H5Tclose(f_type); + + h5tools_str_close(&buffer); + + HDfprintf(rawoutstream, "\n"); } @@ -1364,18 +1478,32 @@ static herr_t list_attr(hid_t obj, const char *attr_name, const H5A_info_t UNUSED *ainfo, void UNUSED *op_data) { - hid_t attr, space, type, p_type; - hsize_t size[H5S_MAX_RANK], nelmts = 1; - int ndims, i, n; - size_t need; - hsize_t temp_need; - void *buf; - h5tool_format_t info; - H5S_class_t space_type; - - printf(" Attribute: "); - n = display_string(stdout, attr_name, TRUE); - printf("%*s", MAX(0, (9 - n)), ""); + hid_t attr = -1; + hid_t space = -1; + hid_t type = -1; + hid_t p_type = -1; + hsize_t size[H5S_MAX_RANK]; + hsize_t nelmts = 1; + hsize_t temp_need; + size_t need; + int ndims; + int i; + int n; + void *buf; + H5S_class_t space_type; + hsize_t curr_pos = 0; /* total data element position */ + h5tools_str_t buffer; /* string into which to render */ + h5tools_context_t ctx; /* print context */ + h5tool_format_t *info = &ls_dataformat; + h5tool_format_t outputformat; + + HDmemset(&ctx, 0, sizeof(ctx)); + HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, " Attribute: "); + + n = print_string(&buffer, attr_name, TRUE); if((attr = H5Aopen(obj, attr_name, H5P_DEFAULT))) { space = H5Aget_space(attr); @@ -1387,69 +1515,90 @@ list_attr(hid_t obj, const char *attr_name, const H5A_info_t UNUSED *ainfo, switch(space_type) { case H5S_SCALAR: /* scalar dataspace */ - puts(" scalar"); + h5tools_str_append(&buffer, " scalar\n"); + h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0); break; case H5S_SIMPLE: /* simple dataspace */ - printf(" {"); + h5tools_str_append(&buffer, " {"); for (i=0; iline_ncols, 0, 0); break; case H5S_NULL: /* null dataspace */ - puts(" null"); + h5tools_str_append(&buffer, " null\n"); + h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0); break; default: /* Unknown dataspace type */ - puts(" unknown"); + h5tools_str_append(&buffer, " unknown\n"); + h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0); break; } /* end switch */ /* Data type */ - printf(" Type: "); - display_type(type, 15); - putchar('\n'); + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, " Type: "); + print_type(&buffer, type, 15); + h5tools_str_append(&buffer, "\n"); + h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0); /* Data */ - memset(&info, 0, sizeof info); - info.line_multi_new = 1; + outputformat = *info; + if(nelmts < 5) { - info.idx_fmt = ""; - info.line_1st = " Data: "; - info.line_pre = " "; - info.line_cont = " "; - info.str_repeat = 8; + outputformat.idx_fmt = ""; + outputformat.line_1st = " Data: "; + outputformat.line_pre = " "; + outputformat.line_cont = " "; + outputformat.str_repeat = 8; - } else { - printf(" Data:\n"); - info.idx_fmt = "(%s)"; - info.line_pre = " %s "; - info.line_cont = " %s "; - info.str_repeat = 8; + } + else { + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, " Data:\n"); + h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0); + outputformat.line_1st = NULL; + outputformat.line_pre = " %s "; + outputformat.line_cont = " %s "; + outputformat.str_repeat = 8; } - info.line_ncols = width_g; + outputformat.line_ncols = width_g; if(label_g) - info.cmpd_name = "%s="; + outputformat.cmpd_name = "%s="; if(string_g && 1==H5Tget_size(type) && H5T_INTEGER==H5Tget_class(type)) { - info.ascii = TRUE; - info.elmt_suf1 = ""; - info.elmt_suf2 = ""; - info.idx_fmt = "(%s)"; - info.line_pre = " %s \""; - info.line_suf = "\""; + outputformat.ascii = TRUE; + outputformat.elmt_suf1 = ""; + outputformat.elmt_suf2 = ""; + outputformat.line_pre = " %s \""; + outputformat.line_suf = "\""; } /* end if */ - /* values of type reference */ - info.obj_format = "-%lu:"H5_PRINTF_HADDR_FMT; - info.obj_hidefileno = 0; + + outputformat.arr_pre = NULL; + outputformat.arr_suf = NULL; + outputformat.arr_sep = NULL; + + outputformat.cmpd_pre = NULL; + outputformat.cmpd_suf = NULL; + outputformat.cmpd_sep = NULL; + + outputformat.vlen_sep = NULL; + outputformat.vlen_pre = NULL; + outputformat.vlen_suf = NULL; + outputformat.vlen_end = NULL; + + info = &outputformat; + if(hexdump_g) p_type = H5Tcopy(type); else @@ -1464,26 +1613,32 @@ list_attr(hid_t obj, const char *attr_name, const H5A_info_t UNUSED *ainfo, vl_data = TRUE; temp_need= nelmts * MAX(H5Tget_size(type), H5Tget_size(p_type)); - assert(temp_need == (hsize_t)((size_t)temp_need)); + HDassert(temp_need == (hsize_t)((size_t)temp_need)); need = (size_t)temp_need; - buf = malloc(need); - assert(buf); - if(H5Aread(attr, p_type, buf) >= 0) - h5tools_dump_mem(stdout, &info, attr, p_type, space, buf, -1); + buf = HDmalloc(need); + HDassert(buf); + if(H5Aread(attr, p_type, buf) >= 0) { + ctx.need_prefix = TRUE; + ctx.indent_level = 2; + ctx.cur_column = curr_pos; + h5tools_dump_mem(rawoutstream, info, &ctx, attr, p_type, space, buf); + } /* Reclaim any VL memory, if necessary */ if (vl_data) H5Dvlen_reclaim(p_type, space, H5P_DEFAULT, buf); - free(buf); + HDfree(buf); H5Tclose(p_type); } /* end if */ H5Sclose(space); H5Tclose(type); H5Aclose(attr); - } else - putchar('\n'); + } + h5tools_str_close(&buffer); + + HDfprintf(rawoutstream, "\n"); return 0; } @@ -1517,26 +1672,41 @@ dataset_list1(hid_t dset) int ndims; /* dimensionality */ H5S_class_t space_type; /* type of dataspace */ int i; + hsize_t curr_pos = 0; /* total data element position */ + h5tool_link_info_t lnk_info; + h5tools_str_t buffer; /* string into which to render */ + h5tools_context_t ctx; /* print context */ + h5tool_format_t *info = &ls_dataformat; + h5tool_format_t outputformat; + + HDmemset(&ctx, 0, sizeof(ctx)); + HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + + h5tools_str_reset(&buffer); /* Information that goes on the same row as the name. The name has * already been printed. */ space = H5Dget_space(dset); space_type = H5Sget_simple_extent_type(space); ndims = H5Sget_simple_extent_dims(space, cur_size, max_size); - printf (" {"); + h5tools_str_append(&buffer, " {"); for (i=0; i0) { - HDfprintf(stdout, "/%Hu", max_size[i]); + h5tools_str_append(&buffer, "/%s", "Inf"); + } + else if (max_size[i]!=cur_size[i] || verbose_g>0) { + h5tools_str_append(&buffer, "/"HSIZE_T_FORMAT, max_size[i]); } } - if (space_type==H5S_SCALAR) printf("SCALAR"); - else if (space_type==H5S_NULL) printf("NULL"); - putchar('}'); + if (space_type==H5S_SCALAR) h5tools_str_append(&buffer, "SCALAR"); + else if (space_type==H5S_NULL) h5tools_str_append(&buffer, "NULL"); + h5tools_str_append(&buffer, "}"); + h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0); H5Sclose (space); + h5tools_str_close(&buffer); + return 0; } @@ -1580,6 +1750,16 @@ dataset_list2(hid_t dset, const char UNUSED *name) double utilization; /* percent utilization of storage */ H5T_class_t tclass; /* datatype class identifier */ int i; + hsize_t curr_pos = 0; /* total data element position */ + h5tools_str_t buffer; /* string into which to render */ + h5tools_context_t ctx; /* print context */ + h5tool_format_t *info = &ls_dataformat; + h5tool_format_t outputformat; + + HDmemset(&ctx, 0, sizeof(ctx)); + HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + + h5tools_str_reset(&buffer); if(verbose_g > 0) { dcpl = H5Dget_create_plist(dset); @@ -1591,87 +1771,87 @@ dataset_list2(hid_t dset, const char UNUSED *name) hsize_t chsize[64]; /* chunk size in elements */ ndims = H5Pget_chunk(dcpl, NELMTS(chsize), chsize/*out*/); - printf(" %-10s {", "Chunks:"); + h5tools_str_append(&buffer, " %-10s {", "Chunks:"); total = H5Tget_size(type); for (i=0; i0) { utilization = (total*100.0)/used; - printf(", %1.2f%% utilization", utilization); + h5tools_str_append(&buffer, ", %1.2f%% utilization", utilization); } - } - - putchar('\n'); + h5tools_str_append(&buffer, "\n"); /* Print information about external strorage */ if((nf = H5Pget_external_count(dcpl)) > 0) { for(i = 0, max_len = 0; i < nf; i++) { H5Pget_external(dcpl, (unsigned)i, sizeof(f_name), f_name, NULL, NULL); - n = display_string(NULL, f_name, TRUE); + n = print_string(NULL, f_name, TRUE); max_len = MAX(max_len, n); } /* end for */ - printf(" %-10s %d external file%s\n", + h5tools_str_append(&buffer, " %-10s %d external file%s\n", "Extern:", nf, 1==nf?"":"s"); - printf(" %4s %10s %10s %10s %s\n", + h5tools_str_append(&buffer, " %4s %10s %10s %10s %s\n", "ID", "DSet-Addr", "File-Addr", "Bytes", "File"); - printf(" %4s %10s %10s %10s ", + h5tools_str_append(&buffer, " %4s %10s %10s %10s ", "----", "----------", "----------", "----------"); - for (i=0; iline_ncols, 0, 0); /* Print address information */ if(address_g) @@ -1707,6 +1888,8 @@ dataset_list2(hid_t dset, const char UNUSED *name) H5Pclose(dcpl); } /* end if */ + h5tools_str_close(&buffer); + if(data_g) dump_dataset_values(dset); @@ -1735,9 +1918,23 @@ static herr_t datatype_list2(hid_t type, const char UNUSED *name) { if (verbose_g>0) { - printf(" %-10s ", "Type:"); - display_type(type, 15); - printf("\n"); + hsize_t curr_pos = 0; /* total data element position */ + h5tools_str_t buffer; /* string into which to render */ + h5tools_context_t ctx; /* print context */ + h5tool_format_t *info = &ls_dataformat; + h5tool_format_t outputformat; + + HDmemset(&ctx, 0, sizeof(ctx)); + HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + + h5tools_str_reset(&buffer); + + h5tools_str_append(&buffer, " %-10s ", "Type:"); + print_type(&buffer, type, 15); + h5tools_str_append(&buffer, "\n"); + h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0); + + h5tools_str_close(&buffer); } return 0; } @@ -1760,29 +1957,43 @@ datatype_list2(hid_t type, const char UNUSED *name) static herr_t list_obj(const char *name, const H5O_info_t *oinfo, const char *first_seen, void *_iter) { - H5O_type_t obj_type = oinfo->type; /* Type of the object */ - iter_t *iter = (iter_t*)_iter; + H5O_type_t obj_type = oinfo->type; /* Type of the object */ + iter_t *iter = (iter_t*)_iter; + hsize_t curr_pos = 0; /* total data element position */ + h5tools_str_t buffer; /* string into which to render */ + h5tools_context_t ctx; /* print context */ + h5tool_format_t *info = &ls_dataformat; + h5tool_format_t outputformat; + + HDmemset(&ctx, 0, sizeof(ctx)); + HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + + h5tools_str_reset(&buffer); /* Print the link's name, either full name or base name */ if(!iter->symlink_target) - display_obj_name(stdout, iter, name, ""); + print_obj_name(&buffer, iter, name, ""); /* Check object information */ if(oinfo->type < 0 || oinfo->type >= H5O_TYPE_NTYPES) { - printf("Unknown type(%d)", (int)oinfo->type); + h5tools_str_append(&buffer, "Unknown type(%d)", (int)oinfo->type); obj_type = H5O_TYPE_UNKNOWN; } if(iter->symlink_target) - fputc('{', stdout); + h5tools_str_append(&buffer, "{"); if(obj_type >= 0 && dispatch_g[obj_type].name) - fputs(dispatch_g[obj_type].name, stdout); + h5tools_str_append(&buffer, "%s", dispatch_g[obj_type].name); + h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0); /* Check if we've seen this object before */ if(first_seen) { - printf(", same as "); - display_string(stdout, first_seen, TRUE); - if(!iter->symlink_target) - printf("\n"); + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, ", same as "); + print_string(&buffer, first_seen, TRUE); + if(!iter->symlink_target) { + h5tools_str_append(&buffer, "\n"); + } + h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0); } /* end if */ else { hid_t obj = (-1); /* ID of object opened */ @@ -1791,15 +2002,20 @@ list_obj(const char *name, const H5O_info_t *oinfo, const char *first_seen, void * then return right away. */ if(obj_type >= 0 && (obj = H5Oopen(iter->fid, name, H5P_DEFAULT)) < 0) { - printf(" *ERROR*\n"); + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, " *ERROR*\n"); + h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0); goto done; } /* end if */ /* List the first line of information for the object. */ if(obj_type >= 0 && dispatch_g[obj_type].list1) (dispatch_g[obj_type].list1)(obj); - if(!iter->symlink_target || (verbose_g > 0)) - putchar('\n'); + if(!iter->symlink_target || (verbose_g > 0)) { + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "\n"); + h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0); + } /* Show detailed information about the object, beginning with information * which is common to all objects. */ @@ -1813,8 +2029,10 @@ list_obj(const char *name, const H5O_info_t *oinfo, const char *first_seen, void H5Aiterate2(obj, H5_INDEX_NAME, H5_ITER_INC, NULL, list_attr, NULL); /* Object location & reference count */ - printf(" %-10s %lu:"H5_PRINTF_HADDR_FMT"\n", "Location:", oinfo->fileno, oinfo->addr); - printf(" %-10s %u\n", "Links:", (unsigned)oinfo->rc); + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, " %-10s %lu:"H5_PRINTF_HADDR_FMT"\n", "Location:", oinfo->fileno, oinfo->addr); + h5tools_str_append(&buffer, " %-10s %u\n", "Links:", (unsigned)oinfo->rc); + h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0); /* Modification time */ if(oinfo->mtime > 0) { @@ -1827,7 +2045,9 @@ list_obj(const char *name, const H5O_info_t *oinfo, const char *first_seen, void tm = HDlocaltime(&(oinfo->mtime)); if(tm) { HDstrftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S %Z", tm); - printf(" %-10s %s\n", "Modified:", buf); + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, " %-10s %s\n", "Modified:", buf); + h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0); } /* end if */ } /* end if */ @@ -1838,13 +2058,16 @@ list_obj(const char *name, const H5O_info_t *oinfo, const char *first_seen, void * H5Oget_comment again with the correct value. * If the call to H5Oget_comment returned an error, skip this block */ if (cmt_bufsize > 0) { - comment = (char *)HDmalloc((size_t)cmt_bufsize); /* new_size including null terminator */ + comment = (char *)HDmalloc((size_t)cmt_bufsize + 1); /* new_size including null terminator */ if(comment) { cmt_bufsize = H5Oget_comment(obj, comment, cmt_bufsize); if(cmt_bufsize > 0) { - printf(" %-10s \"", "Comment:"); - display_string(stdout, comment, FALSE); - puts("\""); + comment[cmt_bufsize] = 0; + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, " %-10s \"", "Comment:"); + print_string(&buffer, comment, FALSE); + h5tools_str_append(&buffer, "\"\n"); + h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0); } /* end if */ HDfree(comment); } @@ -1862,9 +2085,13 @@ list_obj(const char *name, const H5O_info_t *oinfo, const char *first_seen, void done: if(iter->symlink_target) { - fputs("}\n", stdout); + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "}\n"); + h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0); iter->symlink_target = FALSE; } + h5tools_str_close(&buffer); + return 0; } /* end list_obj() */ @@ -1890,24 +2117,34 @@ list_lnk(const char *name, const H5L_info_t *linfo, void *_iter) char *buf=NULL; iter_t *iter = (iter_t*)_iter; int ret; + hsize_t curr_pos = 0; /* total data element position */ h5tool_link_info_t lnk_info; + h5tools_str_t buffer; /* string into which to render */ + h5tools_context_t ctx; /* print context */ + h5tool_format_t *info = &ls_dataformat; + h5tool_format_t outputformat; + + HDmemset(&ctx, 0, sizeof(ctx)); + HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + + h5tools_str_reset(&buffer); /* init linkinfo struct */ - memset(&lnk_info, 0, sizeof(h5tool_link_info_t)); + HDmemset(&lnk_info, 0, sizeof(h5tool_link_info_t)); /* if verbose, make H5tools_get_symlink_info() display more */ if (verbose_g) lnk_info.opt.msg_mode=1; /* Print the link's name, either full name or base name */ - display_obj_name(stdout, iter, name, ""); + print_obj_name(&buffer, iter, name, ""); switch(linfo->type) { case H5L_TYPE_SOFT: ret = H5tools_get_symlink_info(iter->fid, name, &lnk_info, follow_symlink_g); /* lnk_info.trg_path is malloced in H5tools_get_symlink_info() * so it will be freed via buf later */ - buf = lnk_info.trg_path; + buf = (char*)lnk_info.trg_path; /* error */ if (ret < 0) goto done; @@ -1915,20 +2152,24 @@ list_lnk(const char *name, const H5L_info_t *linfo, void *_iter) else if (no_dangling_link_g && ret == 0) iter->symlink_list->dangle_link = TRUE; - HDfputs("Soft Link {", stdout); - HDfputs(buf, stdout); - HDfputc('}', stdout); + h5tools_str_append(&buffer, "Soft Link {"); + h5tools_str_append(&buffer, buf); + h5tools_str_append(&buffer, "}"); + h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0); if(follow_symlink_g) { hbool_t orig_grp_literal = grp_literal_g; - HDfputc(' ', stdout); + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, " "); /* Check if we have already seen this softlink */ if(symlink_is_visited(iter->symlink_list, linfo->type, NULL, buf)) { - HDfputs("{Already Visited}\n", stdout); + h5tools_str_append(&buffer, "{Already Visited}\n"); + h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0); goto done; } + h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0); /* Add this link to the list of seen softlinks */ if(symlink_visit_add(iter->symlink_list, linfo->type, NULL, buf) < 0) @@ -1951,8 +2192,11 @@ list_lnk(const char *name, const H5L_info_t *linfo, void *_iter) grp_literal_g = orig_grp_literal; } - else - HDfputc('\n', stdout); + else { + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "\n"); + h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0); + } break; @@ -1965,7 +2209,7 @@ list_lnk(const char *name, const H5L_info_t *linfo, void *_iter) ret = H5tools_get_symlink_info(iter->fid, name, &lnk_info, follow_link); /* lnk_info.trg_path is malloced in H5tools_get_symlink_info() * so it will be freed via buf later */ - buf = lnk_info.trg_path; + buf = (char*)lnk_info.trg_path; /* error */ if (ret < 0) goto done; @@ -1976,27 +2220,31 @@ list_lnk(const char *name, const H5L_info_t *linfo, void *_iter) if(H5Lunpack_elink_val(buf, linfo->u.val_size, NULL, &filename, &path) < 0) goto done; - HDfputs("External Link {", stdout); - HDfputs(filename, stdout); - HDfputc('/', stdout); + h5tools_str_append(&buffer, "External Link {"); + h5tools_str_append(&buffer, filename); + h5tools_str_append(&buffer, "/"); if(*path != '/') - HDfputc('/', stdout); - HDfputs(path, stdout); - HDfputc('}', stdout); + h5tools_str_append(&buffer, "/"); + h5tools_str_append(&buffer, path); + h5tools_str_append(&buffer, "}"); + h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0); /* Recurse through the external link */ /* keep the follow_elink_g for backward compatibility with -E */ if(follow_link) { hbool_t orig_grp_literal = grp_literal_g; - HDfputc(' ', stdout); + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, " "); /* Check if we have already seen this elink */ if(symlink_is_visited(iter->symlink_list, linfo->type, filename, path)) { - HDfputs("{Already Visited}\n", stdout); + h5tools_str_append(&buffer, "{Already Visited}\n"); + h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0); goto done; } + h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0); /* Add this link to the list of seen elinks */ if(symlink_visit_add(iter->symlink_list, linfo->type, filename, path) < 0) @@ -2022,17 +2270,19 @@ list_lnk(const char *name, const H5L_info_t *linfo, void *_iter) grp_literal_g = orig_grp_literal; } else - HDfputc('\n', stdout); - + HDfprintf(rawoutstream, "\n"); } break; default: - HDfputs("UD Link {cannot follow UD links}\n", stdout); + h5tools_str_append(&buffer, "UD Link {cannot follow UD links}\n"); + h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0); break; } /* end switch */ done: + h5tools_str_close(&buffer); + if (buf) HDfree(buf); return 0; @@ -2057,25 +2307,40 @@ done: static herr_t visit_obj(hid_t file, const char *oname, iter_t *iter) { + int retval = 0; H5O_info_t oi; /* Information for object */ + hsize_t curr_pos = 0; /* total data element position */ + h5tool_link_info_t lnk_info; + h5tools_str_t buffer; /* string into which to render */ + h5tools_context_t ctx; /* print context */ + h5tool_format_t *info = &ls_dataformat; + h5tool_format_t outputformat; + + HDmemset(&ctx, 0, sizeof(ctx)); + HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + + h5tools_str_reset(&buffer); /* Retrieve info for object to list */ if(H5Oget_info_by_name(file, oname, &oi, H5P_DEFAULT) < 0) { if(iter->symlink_target) { - HDfputs("{**NOT FOUND**}\n", stdout); + h5tools_str_append(&buffer, "{**NOT FOUND**}\n"); iter->symlink_target = FALSE; } else - display_obj_name(stdout, iter, oname, "**NOT FOUND**"); - return -1; + print_obj_name(&buffer, iter, oname, "**NOT FOUND**"); + h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0); + retval = -1; + goto done; } /* end if */ /* Check for group iteration */ if(H5O_TYPE_GROUP == oi.type && !grp_literal_g) { /* Get ID for group */ if(!iter->symlink_target && (iter->gid = H5Gopen2(file, oname, H5P_DEFAULT)) < 0) { - fprintf(stderr, "%s: unable to open '%s' as group\n", iter->fname, oname); - return 0; /* Previously "continue", when this code was in main(). + h5tools_str_append(&buffer, "%s: unable to open '%s' as group\n", iter->fname, oname); + h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0); + goto done; /* Previously "continue", when this code was in main(). * We don't "continue" here in order to close the file * and free the file name properly. */ } /* end if */ @@ -2099,7 +2364,10 @@ visit_obj(hid_t file, const char *oname, iter_t *iter) list_obj(oname, &oi, NULL, iter); } /* end else */ - return 0; +done: + h5tools_str_close(&buffer); + + return retval; } @@ -2130,8 +2398,8 @@ get_width(void) /* Try to get it from the COLUMNS environment variable first since it's * value is sometimes wrong. */ - if ((s=getenv("COLUMNS")) && *s && isdigit((int)*s)) - width = (int)strtol(s, NULL, 0); + if ((s=HDgetenv("COLUMNS")) && *s && isdigit((int)*s)) + width = (int)HDstrtol(s, NULL, 0); #if defined(H5_HAVE_STRUCT_VIDEOCONFIG) && defined(H5_HAVE__GETVIDEOCONFIG) { @@ -2202,14 +2470,14 @@ is_valid_args(void) if(recursive_g && grp_literal_g) { - fprintf(stderr, "Error: 'recursive' option not compatible with 'group info' option!\n\n"); + HDfprintf(rawerrorstream, "Error: 'recursive' option not compatible with 'group info' option!\n\n"); ret = FALSE; goto out; } if(no_dangling_link_g && !follow_symlink_g) { - fprintf(stderr, "Error: --no-dangling-links must be used along with --follow-symlinks option!\n\n"); + HDfprintf(rawerrorstream, "Error: --no-dangling-links must be used along with --follow-symlinks option!\n\n"); ret = FALSE; goto out; } @@ -2238,7 +2506,7 @@ leave(int ret) { h5tools_close(); - exit(ret); + HDexit(ret); } @@ -2490,7 +2758,7 @@ main(int argc, const char *argv[]) if(file >= 0) { if(verbose_g) - printf("Opened \"%s\" with %s driver.\n", fname, drivername); + HDfprintf(rawoutstream, "Opened \"%s\" with %s driver.\n", fname, drivername); break; /*success*/ } /* end if */ @@ -2505,7 +2773,7 @@ main(int argc, const char *argv[]) } /* end while */ if(file < 0) { - fprintf(stderr, "%s: unable to open file\n", argv[argno-1]); + HDfprintf(rawerrorstream, "%s: unable to open file\n", argv[argno-1]); HDfree(fname); err_exit = 1; continue; @@ -2518,7 +2786,7 @@ main(int argc, const char *argv[]) iter.base_len -= oname[iter.base_len-1] == '/'; x = oname; if(NULL == (oname = HDstrdup(oname))) { - fprintf(stderr, "memory allocation failed\n"); + HDfprintf(rawerrorstream, "memory allocation failed\n"); leave(EXIT_FAILURE); } *x = '\0'; @@ -2552,7 +2820,19 @@ main(int argc, const char *argv[]) if(HDstrcmp(oname, root_name)) { /* Check the type of link given */ if(H5Lget_info(file, oname, &li, H5P_DEFAULT) < 0) { - display_obj_name(stdout, &iter, oname, "**NOT FOUND**"); + hsize_t curr_pos = 0; /* total data element position */ + h5tool_link_info_t lnk_info; + h5tools_str_t buffer; /* string into which to render */ + h5tools_context_t ctx; /* print context */ + h5tool_format_t *info = &ls_dataformat; + h5tool_format_t outputformat; + + HDmemset(&ctx, 0, sizeof(ctx)); + HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + + h5tools_str_reset(&buffer); + print_obj_name(&buffer, &iter, oname, "**NOT FOUND**"); + h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0); leave(EXIT_FAILURE); } /* end if */ } /* end if */ diff --git a/tools/h5ls/testh5ls.sh.in b/tools/h5ls/testh5ls.sh.in index f9b68d7..dc78174 100644 --- a/tools/h5ls/testh5ls.sh.in +++ b/tools/h5ls/testh5ls.sh.in @@ -24,19 +24,129 @@ H5LS_BIN=`pwd`/$H5LS # The path of the tool binary CMP='cmp -s' DIFF='diff -c' -NLINES=20 # Max. lines of output to display if test fails +CP='cp' +NLINES=20 # Max. lines of output to display if test fails WORDS_BIGENDIAN="@WORDS_BIGENDIAN@" nerrors=0 verbose=yes -h5haveexitcode=yes # default is yes - +h5haveexitcode=yes # default is yes # The build (current) directory might be different than the source directory. if test -z "$srcdir"; then srcdir=. fi -test -d ../testfiles || mkdir ../testfiles +# source dirs +SRC_TOOLS="$srcdir/.." +SRC_TOOLS_TESTFILES="$SRC_TOOLS/testfiles" +# testfiles source dirs for tools +SRC_H5LS_TESTFILES="$SRC_TOOLS_TESTFILES" +SRC_H5DUMP_TESTFILES="$SRC_TOOLS_TESTFILES" +SRC_H5DIFF_TESTFILES="$SRC_TOOLS/h5diff/testfiles" +SRC_H5COPY_TESTFILES="$SRC_TOOLS/h5copy/testfiles" +SRC_H5REPACK_TESTFILES="$SRC_TOOLS/h5repack/testfiles" +SRC_H5JAM_TESTFILES="$SRC_TOOLS/h5jam/testfiles" +SRC_H5STAT_TESTFILES="$SRC_TOOLS/h5stat/testfiles" +SRC_H5IMPORT_TESTFILES="$SRC_TOOLS/h5import/testfiles" + +TESTDIR=./testfiles +test -d $TESTDIR || mkdir $TESTDIR + +###################################################################### +# test files +# -------------------------------------------------------------------- +# All the test files copy from source directory to test directory +# NOTE: Keep this framework to add/remove test files. +# Any test files from other tools can be used in this framework. +# This list are also used for checking exist. +# Comment '#' without space can be used. +# -------------------------------------------------------------------- +LIST_HDF5_TEST_FILES=" +$SRC_H5LS_TESTFILES/tall.h5 +$SRC_H5LS_TESTFILES/tarray1.h5 +$SRC_H5LS_TESTFILES/tattr2.h5 +$SRC_H5LS_TESTFILES/tattrreg.h5 +$SRC_H5LS_TESTFILES/tcompound.h5 +$SRC_H5LS_TESTFILES/tdatareg.h5 +$SRC_H5LS_TESTFILES/tdset.h5 +$SRC_H5LS_TESTFILES/tempty.h5 +$SRC_H5LS_TESTFILES/textlink.h5 +$SRC_H5LS_TESTFILES/textlinksrc.h5 +$SRC_H5LS_TESTFILES/textlinktar.h5 +$SRC_H5LS_TESTFILES/tgroup.h5 +$SRC_H5LS_TESTFILES/tgrp_comments.h5 +$SRC_H5LS_TESTFILES/thlink.h5 +$SRC_H5LS_TESTFILES/tloop.h5 +$SRC_H5LS_TESTFILES/tnestedcomp.h5 +$SRC_H5LS_TESTFILES/tsaf.h5 +$SRC_H5LS_TESTFILES/tslink.h5 +$SRC_H5LS_TESTFILES/tsoftlinks.h5 +$SRC_H5LS_TESTFILES/tstr.h5 +$SRC_H5LS_TESTFILES/tudlink.h5 +$SRC_H5LS_TESTFILES/tvldtypes1.h5 +$SRC_H5LS_TESTFILES/tdset_idx.h5 +" + +LIST_OTHER_TEST_FILES=" +$SRC_H5LS_TESTFILES/help-1.ls +$SRC_H5LS_TESTFILES/help-2.ls +$SRC_H5LS_TESTFILES/help-3.ls +$SRC_H5LS_TESTFILES/nosuchfile.ls +$SRC_H5LS_TESTFILES/tall-1.ls +$SRC_H5LS_TESTFILES/tall-2.ls +$SRC_H5LS_TESTFILES/tarray1.ls +$SRC_H5LS_TESTFILES/tattr2.ls +$SRC_H5LS_TESTFILES/tattrreg_le.ls +$SRC_H5LS_TESTFILES/tattrreg_be.ls +$SRC_H5LS_TESTFILES/tcomp-1.ls +$SRC_H5LS_TESTFILES/tdataregbe.ls +$SRC_H5LS_TESTFILES/tdataregle.ls +$SRC_H5LS_TESTFILES/tdset-1.ls +$SRC_H5LS_TESTFILES/tempty.ls +$SRC_H5LS_TESTFILES/textlink-1.ls +$SRC_H5LS_TESTFILES/textlinksrc-1.ls +$SRC_H5LS_TESTFILES/textlinksrc-2.ls +$SRC_H5LS_TESTFILES/textlinksrc-3.ls +$SRC_H5LS_TESTFILES/textlinksrc-4.ls +$SRC_H5LS_TESTFILES/textlinksrc-5.ls +$SRC_H5LS_TESTFILES/textlinksrc-6.ls +$SRC_H5LS_TESTFILES/textlinksrc-7.ls +$SRC_H5LS_TESTFILES/textlinksrc-1-old.ls +$SRC_H5LS_TESTFILES/textlinksrc-2-old.ls +$SRC_H5LS_TESTFILES/textlinksrc-3-old.ls +$SRC_H5LS_TESTFILES/textlinksrc-6-old.ls +$SRC_H5LS_TESTFILES/textlinksrc-7-old.ls +$SRC_H5LS_TESTFILES/tsoftlinks-1.ls +$SRC_H5LS_TESTFILES/tsoftlinks-2.ls +$SRC_H5LS_TESTFILES/tsoftlinks-3.ls +$SRC_H5LS_TESTFILES/tsoftlinks-4.ls +$SRC_H5LS_TESTFILES/tsoftlinks-5.ls +$SRC_H5LS_TESTFILES/textlinksrc-nodangle-1.ls +$SRC_H5LS_TESTFILES/textlinksrc-nodangle-2.ls +$SRC_H5LS_TESTFILES/tgrp_comments.ls +$SRC_H5LS_TESTFILES/tsoftlinks-nodangle-1.ls +$SRC_H5LS_TESTFILES/thlinks-nodangle-1.ls +$SRC_H5LS_TESTFILES/tgroup.ls +$SRC_H5LS_TESTFILES/tgroup-1.ls +$SRC_H5LS_TESTFILES/tgroup-2.ls +$SRC_H5LS_TESTFILES/tgroup-3.ls +$SRC_H5LS_TESTFILES/thlink-1.ls +$SRC_H5LS_TESTFILES/tloop-1.ls +$SRC_H5LS_TESTFILES/tmultifile.ls +$SRC_H5LS_TESTFILES/tnestcomp-1.ls +$SRC_H5LS_TESTFILES/tnestcomp-2.ls +$SRC_H5LS_TESTFILES/tnestcomp-3.ls +$SRC_H5LS_TESTFILES/tnestcomp-4.ls +$SRC_H5LS_TESTFILES/tsaf.ls +$SRC_H5LS_TESTFILES/tslink-1.ls +$SRC_H5LS_TESTFILES/tstr-1.ls +$SRC_H5LS_TESTFILES/tudlink-1.ls +$SRC_H5LS_TESTFILES/tvldtypes1.ls +$SRC_H5LS_TESTFILES/tvldtypes2le.ls +$SRC_H5LS_TESTFILES/tvldtypes2be.ls +$SRC_H5LS_TESTFILES/tdset_idx.ls +" + # RUNSERIAL is used. Check if it can return exit code from executalbe correctly. if [ -n "$RUNSERIAL_NOEXITCODE" ]; then @@ -45,6 +155,31 @@ if [ -n "$RUNSERIAL_NOEXITCODE" ]; then h5haveexitcode=no fi +# +# copy test files and expected output files from source dirs to test dir +# +COPY_TESTFILES="$LIST_HDF5_TEST_FILES $LIST_OTHER_TEST_FILES" + +COPY_TESTFILES_TO_TESTDIR() +{ + # copy test files. Used -f to make sure get a new copy + for tstfile in $COPY_TESTFILES + do + # ignore '#' comment + echo $tstfile | tr -d ' ' | grep '^#' > /dev/null + RET=$? + if [ $RET -eq 1 ]; then + if [ -a $tstfile ]; then + $CP -f $tstfile $TESTDIR + else + echo "Error: FAILED to copy $tstfile" + echo " $tstfile doesn't exist!" + exit $EXIT_FAILURE + fi + fi + done +} + # Print a line-line message left justified in a field of 70 characters # beginning with the word "Testing". TESTING() { @@ -52,6 +187,9 @@ TESTING() { echo "Testing $* $SPACES" |cut -c1-70 |tr -d '\012' } +# Source in the output filter function definitions. +. $srcdir/../../bin/output_filter.sh + # Run a test and print PASS or *FAIL*. For now, if h5ls can complete # with exit status 0, consider it pass. If a test fails then increment # the `nerrors' global variable and (if $verbose is set) display up to $NLINS @@ -61,9 +199,11 @@ TESTING() { # $1 -- actual output filename to use # $2 and on -- argument for the h5ls tool TOOLTEST() { - expect="$srcdir/../testfiles/$1" - actual="../testfiles/`basename $1 .ls`.out" - actual_err="../testfiles/`basename $1 .ls`.err" + expect="$TESTDIR/$1" + actual="$TESTDIR/`basename $1 .ls`.out" + actual_err="$TESTDIR/`basename $1 .ls`.err" + actual_sav=${actual}-sav + actual_err_sav=${actual_err}-sav shift retvalexpect=$1 shift @@ -73,49 +213,53 @@ TOOLTEST() { # any unexpected output from that stream too. TESTING $H5LS $@ ( - echo "#############################" - echo " output for '$H5LS $@'" - echo "#############################" - cd $srcdir/../testfiles + cd $TESTDIR $RUNSERIAL $H5LS_BIN "$@" ) >$actual 2>$actual_err exitcode=$? + # save actual and actual_err in case they are needed later. + cp $actual $actual_sav + STDOUT_FILTER $actual + cp $actual_err $actual_err_sav + STDERR_FILTER $actual_err cat $actual_err >> $actual if [ $h5haveexitcode = 'yes' -a $exitcode -ne $retvalexpect ]; then - echo "*FAILED*" - nerrors="`expr $nerrors + 1`" - if [ yes = "$verbose" ]; then - echo "test returned with exit code $exitcode" - echo "test output: (up to $NLINES lines)" - head -$NLINES $actual - echo "***end of test output***" - echo "" - fi + echo "*FAILED*" + nerrors="`expr $nerrors + 1`" + if [ yes = "$verbose" ]; then + echo "test returned with exit code $exitcode" + echo "test output: (up to $NLINES lines)" + head -$NLINES $actual + echo "***end of test output***" + echo "" + fi elif [ ! -f $expect ]; then - # Create the expect file if it doesn't yet exist. + # Create the expect file if it doesn't yet exist. echo " CREATED" cp $actual $expect elif $CMP $expect $actual; then echo " PASSED" else echo "*FAILED*" - echo " Expected result differs from actual result" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + echo " Expected result differs from actual result" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err + rm -f $actual $actual_err $actual_sav $actual_err_sav fi } ############################################################################## ############################################################################## -### T H E T E S T S ### +### T H E T E S T S ### ############################################################################## ############################################################################## +# prepare for test +COPY_TESTFILES_TO_TESTDIR # Toss in a bunch of tests. Not sure if they are the right kinds. # test the help syntax @@ -181,6 +325,11 @@ TOOLTEST tsoftlinks-nodangle-1.ls 1 -w80 --follow-symlinks --no-dangling-links t # when used file with no dangling links - expected exit code 0 TOOLTEST thlinks-nodangle-1.ls 0 -w80 --follow-symlinks --no-dangling-links thlink.h5 +# test for wildcards in filename (does not work with cmake) +# this h5ls test script does not pass the filename properly like the h5dump test script??? +#TOOLTEST tstarfile 0 -w80 t*link.h5 +#TOOLTEST tqmarkfile 0 -w80 t?link.h5 +TOOLTEST tmultifile 0 -w80 thlink.h5 tslink.h5 # tests for hard links TOOLTEST thlink-1.ls 0 -w80 thlink.h5 @@ -219,6 +368,14 @@ TOOLTEST tempty.ls 0 -w80 -d tempty.h5 # enable -S for avoiding printing NATIVE types TOOLTEST tattr2.ls 0 -w80 -v -S tattr2.h5 +# test for attribute with region references without verbose mode +# ( HDFFV-7838, ) +if test $WORDS_BIGENDIAN != "yes"; then +TOOLTEST tattrreg_le.ls 0 -w80 -v -d tattrreg.h5 +else +TOOLTEST tattrreg_be.ls 0 -w80 -v -d tattrreg.h5 +fi + # tests for error handling. # test for non-existing file TOOLTEST nosuchfile.ls 1 nosuchfile.h5 diff --git a/tools/h5repack/CMakeLists.txt b/tools/h5repack/CMakeLists.txt index 1593d35..6460375 100644 --- a/tools/h5repack/CMakeLists.txt +++ b/tools/h5repack/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8) +cmake_minimum_required (VERSION 2.8.6) PROJECT (HDF5_TOOLS_H5REPACK) #----------------------------------------------------------------------------- @@ -23,6 +23,7 @@ SET (REPACK_COMMON_SRCS ADD_EXECUTABLE (h5repack ${REPACK_COMMON_SRCS} ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/h5repack_main.c) TARGET_NAMING (h5repack ${LIB_TYPE}) TARGET_LINK_LIBRARIES (h5repack ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) +SET_TARGET_PROPERTIES (h5repack PROPERTIES FOLDER tools) SET (H5_DEP_EXECUTABLES h5repack) @@ -39,30 +40,14 @@ IF (BUILD_TESTING) ADD_EXECUTABLE (testh5repack_detect_szip ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testh5repack_detect_szip.c) TARGET_NAMING (testh5repack_detect_szip ${LIB_TYPE}) TARGET_LINK_LIBRARIES (testh5repack_detect_szip ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) - - ADD_TEST (NAME testh5repack_detect_szip COMMAND $) - IF (HDF5_ENABLE_SZIP_SUPPORT) - IF (HDF5_ENABLE_SZIP_ENCODING) - SET (passRegex "yes") - SET_TESTS_PROPERTIES (testh5repack_detect_szip PROPERTIES PASS_REGULAR_EXPRESSION "yes") - ELSE (HDF5_ENABLE_SZIP_ENCODING) - SET (passRegex "no") - SET_TESTS_PROPERTIES (testh5repack_detect_szip PROPERTIES PASS_REGULAR_EXPRESSION "no") - ENDIF (HDF5_ENABLE_SZIP_ENCODING) - ELSE (HDF5_ENABLE_SZIP_SUPPORT) - SET (passRegex "no") - SET_TESTS_PROPERTIES (testh5repack_detect_szip PROPERTIES PASS_REGULAR_EXPRESSION "no") - ENDIF (HDF5_ENABLE_SZIP_SUPPORT) + SET_TARGET_PROPERTIES (testh5repack_detect_szip PROPERTIES FOLDER tools) ADD_EXECUTABLE (h5repacktest ${REPACK_COMMON_SRCS} ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/h5repacktst.c) TARGET_NAMING (h5repacktest ${LIB_TYPE}) TARGET_LINK_LIBRARIES (h5repacktest ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) - - ADD_TEST (NAME h5repacktest COMMAND $) - SET_TESTS_PROPERTIES (h5repacktest PROPERTIES DEPENDS testh5repack_detect_szip) + SET_TARGET_PROPERTIES (h5repacktest PROPERTIES FOLDER tools) IF (HDF5_TEST_VFD) - SET (VFD_LIST sec2 stdio @@ -78,7 +63,7 @@ IF (BUILD_TESTING) MACRO (ADD_VFD_TEST vfdname resultcode) ADD_TEST ( - NAME VFD-${vfdname}-h5repacktest + NAME H5REPACK-VFD-${vfdname}-h5repacktest COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" -D "TEST_ARGS:STRING=" @@ -88,79 +73,72 @@ IF (BUILD_TESTING) -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -P "${HDF5_RESOURCES_DIR}/vfdTest.cmake" ) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5REPACK-VFD-${vfdname}-h5repacktest PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + SET (last_test "H5REPACK-VFD-${vfdname}-h5repacktest") ENDMACRO (ADD_VFD_TEST) - - # Run test with different Virtual File Driver - FOREACH (vfd ${VFD_LIST}) - ADD_VFD_TEST (${vfd} 0) - ENDFOREACH (vfd ${VFD_LIST}) - ENDIF (HDF5_TEST_VFD) # -------------------------------------------------------------------- - # Copy all the HDF5 files from the test directory into the source directory + # Copy all the HDF5 files from the source directory into the test directory # -------------------------------------------------------------------- - SET (HDF5_REFERENCE_TEST_FILES - h5repack_ext.bin - ublock.bin - h5repack.info - h5repack_attr.h5 - h5repack_attr_refs.h5 - h5repack_deflate.h5 - h5repack_early.h5 - h5repack_ext.h5 - h5repack_fill.h5 - h5repack_filters.h5 - h5repack_fletcher.h5 - h5repack_hlink.h5 - h5repack_layout.h5 - h5repack_layouto.h5 - h5repack_layout2.h5 - h5repack_named_dtypes.h5 - h5repack_nbit.h5 - h5repack_objs.h5 - h5repack_refs.h5 - h5repack_shuffle.h5 - h5repack_soffset.h5 - h5repack_szip.h5 + SET (LIST_HDF5_TEST_FILES + ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_attr.h5 + ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_attr_refs.h5 + ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_deflate.h5 + ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_early.h5 + ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_ext.h5 + ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_fill.h5 + ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_filters.h5 + ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_fletcher.h5 + ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_hlink.h5 + ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_layout.h5 + ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_layouto.h5 + ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_layout2.h5 + ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_named_dtypes.h5 + ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_nbit.h5 + ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_objs.h5 + ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_refs.h5 + ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_shuffle.h5 + ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_soffset.h5 + ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_szip.h5 + # h5diff/testfile + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_attr1.h5 + # tools/testfiles + ${HDF5_TOOLS_SRC_DIR}/testfiles/tfamily00000.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tfamily00001.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tfamily00002.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tfamily00003.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tfamily00004.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tfamily00005.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tfamily00006.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tfamily00007.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tfamily00008.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tfamily00009.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tfamily00010.h5 ) - SET (HDF5_COMMON_TEST_FILES - tfamily00000.h5 - tfamily00001.h5 - tfamily00002.h5 - tfamily00003.h5 - tfamily00004.h5 - tfamily00005.h5 - tfamily00006.h5 - tfamily00007.h5 - tfamily00008.h5 - tfamily00009.h5 - tfamily00010.h5 - h5repack_filters.h5.ddl + + SET (LIST_OTHER_TEST_FILES + ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_ext.bin + ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/ublock.bin + ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack.info + # tools/testfiles + ${HDF5_TOOLS_SRC_DIR}/testfiles/h5repack_filters.h5.ddl ) - FOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/${h5_file}") + FOREACH (h5_file ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) + GET_FILENAME_COMPONENT(fname "${h5_file}" NAME) + SET (dest "${PROJECT_BINARY_DIR}/testfiles/${fname}") #MESSAGE (STATUS " Copying ${h5_file}") ADD_CUSTOM_COMMAND ( TARGET h5repack POST_BUILD COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/${h5_file} ${dest} + ARGS -E copy_if_different ${h5_file} ${dest} ) - ENDFOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) + ENDFOREACH (h5_file ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) - FOREACH (h5c_file ${HDF5_COMMON_TEST_FILES}) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/${h5c_file}") - #MESSAGE (STATUS " Copying ${h5_file}") - ADD_CUSTOM_COMMAND ( - TARGET h5repack - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different ${HDF5_TOOLS_SRC_DIR}/testfiles/${h5c_file} ${dest} - ) - ENDFOREACH (h5c_file ${HDF5_COMMON_TEST_FILES}) - ############################################################################## ############################################################################## ### T H E T E S T S M A C R O S ### @@ -211,7 +189,7 @@ IF (BUILD_TESTING) -D "TEST_PROGRAM=$" -D "TEST_ARGS:STRING=${ARGN};testfiles/${resultfile};testfiles/out.${resultfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -D "TEST_OUTPUT=${resultfile}.out" + -D "TEST_OUTPUT=./testfiles/${resultfile}.out" -D "TEST_EXPECT=${resultcode}" -D "TEST_FILTER:STRING=${testfilter}" -D "TEST_REFERENCE=testfiles/${resultfile}.ddl" @@ -242,7 +220,7 @@ IF (BUILD_TESTING) -D "TEST_PROGRAM=$" -D "TEST_ARGS:STRING=-d;${testdset};-pH;testfiles/out.${testfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -D "TEST_OUTPUT=${testfile}-v.out" + -D "TEST_OUTPUT=./testfiles/${testfile}-v.out" -D "TEST_EXPECT=${resultcode}" -D "TEST_FILTER:STRING=${testfilter}" -D "TEST_REFERENCE=${testfilter}" @@ -268,7 +246,7 @@ IF (BUILD_TESTING) -D "TEST_PROGRAM=$" -D "TEST_ARGS:STRING=-pH;testfiles/out.${testfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -D "TEST_OUTPUT=${testfile}-v.out" + -D "TEST_OUTPUT=./testfiles/${testfile}-v.out" -D "TEST_EXPECT=${resultcode}" -D "TEST_FILTER:STRING=${nottestfilter}" -D "TEST_REFERENCE=${testfilter}" @@ -294,65 +272,69 @@ IF (BUILD_TESTING) NAME H5REPACK-clearall-objects COMMAND ${CMAKE_COMMAND} -E remove - h5repack_attr.h5.out - h5repack_attr.h5.out.err - h5repack_deflate.h5.out - h5repack_deflate.h5.out.err - h5repack_early.h5.out - h5repack_early.h5.out.err - h5repack_ext.h5.out - h5repack_ext.h5.out.err - h5repack_fill.h5.out - h5repack_fill.h5.out.err - h5repack_filters.h5.out - h5repack_filters.h5.out.err - h5repack_fletcher.h5.out - h5repack_fletcher.h5.out.err - h5repack_hlink.h5.out - h5repack_hlink.h5.out.err - h5repack_layout.h5.out - h5repack_layout.h5.out.err - h5repack_layout.h5-v.out - h5repack_layout.h5-v.out.err - h5repack_layouto.h5.out - h5repack_layouto.h5.out.err - h5repack_layout2.h5-v.out - h5repack_layout2.h5-v.out.err - h5repack_named_dtypes.h5.out - h5repack_named_dtypes.h5.out.err - h5repack_nbit.h5.out - h5repack_nbit.h5.out.err - h5repack_objs.h5.out - h5repack_objs.h5.out.err - h5repack_refs.h5.out - h5repack_refs.h5.out.err - h5repack_shuffle.h5.out - h5repack_shuffle.h5.out.err - h5repack_soffset.h5.out - h5repack_soffset.h5.out.err - h5repack_szip.h5.out - h5repack_szip.h5.out.err - h5repack_attr_out.h5 - h5repack_deflate_out.h5 - h5repack_early_out.h5 - h5repack_ext_out.h5 - h5repack_fill_out.h5 - h5repack_filters_out.h5 - h5repack_fletcher_out.h5 - h5repack_hlink_out.h5 - h5repack_layout_out.h5 - h5repack_layouto_out.h5 - h5repack_layout2_out.h5 - h5repack_named_dtypes_out.h5 - h5repack_nbit_out.h5 - h5repack_objs_out.h5 - h5repack_refs_out.h5 - h5repack_shuffle_out.h5 - h5repack_soffset_out.h5 - h5repack_szip_out.h5 - h5repack_ub.h5 - h5repack_ub_out.h5 - h5repack_attr_refs_out.h5 + ./testfiles/h5repack_filters.h5.out + ./testfiles/h5repack_filters.h5.out.err + ./testfiles/h5repack_layout2.h5-v.out + ./testfiles/h5repack_layout2.h5-v.out.err + ./testfiles/h5repack_layout.h5-v.out + ./testfiles/h5repack_layout.h5-v.out.err + ./testfiles/out.h5diff_attr1.h5 + ./testfiles/out.h5repack_attr.h5 + ./testfiles/out.h5repack_deflate.h5 + ./testfiles/out.h5repack_early.h5 + ./testfiles/out.h5repack_fill.h5 + ./testfiles/out.h5repack_filters.h5 + ./testfiles/out.h5repack_fletcher.h5 + ./testfiles/out.h5repack_hlink.h5 + ./testfiles/out.h5repack_layout2.h5 + ./testfiles/out.h5repack_layout.h5 + ./testfiles/out.h5repack_layouto.h5 + ./testfiles/out.h5repack_named_dtypes.h5 + ./testfiles/out.h5repack_nbit.h5 + ./testfiles/out.h5repack_objs.h5 + ./testfiles/out.h5repack_refs.h5 + ./testfiles/out.h5repack_shuffle.h5 + ./testfiles/out.h5repack_soffset.h5 + # from the h5repacktst + h5repack_attr.h5 + h5repack_attr_out.h5 + h5repack_attr_refs.h5 + h5repack_big.h5 + h5repack_deflate.h5 + h5repack_deflate_out.h5 + h5repack_early2.h5 + h5repack_early.h5 + h5repack_early_out.h5 + h5repack_ext.h5 + h5repack_ext_out.h5 + h5repack_fill.h5 + h5repack_fill_out.h5 + h5repack_filters.h5 + h5repack_filters_out.h5 + h5repack_fletcher.h5 + h5repack_fletcher_out.h5 + h5repack_hlink.h5 + h5repack_hlink_out.h5 + h5repack_layout2.h5 + h5repack_layout.h5 + h5repack_layout_out.h5 + h5repack_named_dtypes.h5 + h5repack_named_dtypes_out.h5 + h5repack_nbit.h5 + h5repack_nbit_out.h5 + h5repack_objs.h5 + h5repack_objs_out.h5 + h5repack_refs.h5 + h5repack_shuffle.h5 + h5repack_shuffle_out.h5 + h5repack_soffset.h5 + h5repack_soffset_out.h5 + h5repack_szip.h5 + h5repack_szip_out.h5 + h5repack_ub.h5 + h5repack_ub_out.h5 + h5repack_ext.bin + ublock.bin ) IF (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5REPACK-clearall-objects PROPERTIES DEPENDS ${last_test}) @@ -384,6 +366,30 @@ IF (BUILD_TESTING) SET (FILE_REF h5repack_refs.h5) SET (FILE_ATTR_REF h5repack_attr_refs.h5) + ADD_TEST (NAME H5REPACK-testh5repack_detect_szip COMMAND $) + IF (HDF5_ENABLE_SZIP_SUPPORT) + IF (HDF5_ENABLE_SZIP_ENCODING) + SET (passRegex "yes") + SET_TESTS_PROPERTIES (H5REPACK-testh5repack_detect_szip PROPERTIES PASS_REGULAR_EXPRESSION "yes") + ELSE (HDF5_ENABLE_SZIP_ENCODING) + SET (passRegex "no") + SET_TESTS_PROPERTIES (H5REPACK-testh5repack_detect_szip PROPERTIES PASS_REGULAR_EXPRESSION "no") + ENDIF (HDF5_ENABLE_SZIP_ENCODING) + ELSE (HDF5_ENABLE_SZIP_SUPPORT) + SET (passRegex "no") + SET_TESTS_PROPERTIES (H5REPACK-testh5repack_detect_szip PROPERTIES PASS_REGULAR_EXPRESSION "no") + ENDIF (HDF5_ENABLE_SZIP_SUPPORT) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5REPACK-testh5repack_detect_szip PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + SET (last_test "H5REPACK-testh5repack_detect_szip") + + ADD_TEST (NAME H5REPACK-h5repacktest COMMAND $) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5REPACK-h5repacktest PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + SET (last_test "H5REPACK-h5repacktest") + # # The tests # We use the files generated by h5repacktst @@ -398,398 +404,409 @@ IF (BUILD_TESTING) # filters are defined. # detect whether the encoder is present. -SET (USE_FILTER_SZIP_ENCODER "no") -IF (HDF5_ENABLE_SZIP_ENCODING) - SET (USE_FILTER_SZIP_ENCODER ${testh5repack_detect_szip}) -ENDIF (HDF5_ENABLE_SZIP_ENCODING) - -IF (H5_HAVE_FILTER_DEFLATE) - SET (USE_FILTER_DEFLATE "true") -ENDIF (H5_HAVE_FILTER_DEFLATE) - -IF (H5_HAVE_FILTER_SZIP) - SET (USE_FILTER_SZIP "true") -ENDIF (H5_HAVE_FILTER_SZIP) - -IF (H5_HAVE_FILTER_SHUFFLE) - SET (USE_FILTER_SHUFFLE "true") -ENDIF (H5_HAVE_FILTER_SHUFFLE) - -IF (H5_HAVE_FILTER_FLETCHER32) - SET (USE_FILTER_FLETCHER32 "true") -ENDIF (H5_HAVE_FILTER_FLETCHER32) - -IF (H5_HAVE_FILTER_NBIT) - SET (USE_FILTER_NBIT "true") -ENDIF (H5_HAVE_FILTER_NBIT) - -IF (H5_HAVE_FILTER_SCALEOFFSET) - SET (USE_FILTER_SCALEOFFSET "true") -ENDIF (H5_HAVE_FILTER_SCALEOFFSET) + SET (USE_FILTER_SZIP_ENCODER "no") + IF (HDF5_ENABLE_SZIP_ENCODING) + SET (USE_FILTER_SZIP_ENCODER ${testh5repack_detect_szip}) + ENDIF (HDF5_ENABLE_SZIP_ENCODING) + + IF (H5_HAVE_FILTER_DEFLATE) + SET (USE_FILTER_DEFLATE "true") + ENDIF (H5_HAVE_FILTER_DEFLATE) + + IF (H5_HAVE_FILTER_SZIP) + SET (USE_FILTER_SZIP "true") + ENDIF (H5_HAVE_FILTER_SZIP) + + IF (H5_HAVE_FILTER_SHUFFLE) + SET (USE_FILTER_SHUFFLE "true") + ENDIF (H5_HAVE_FILTER_SHUFFLE) + + IF (H5_HAVE_FILTER_FLETCHER32) + SET (USE_FILTER_FLETCHER32 "true") + ENDIF (H5_HAVE_FILTER_FLETCHER32) + + IF (H5_HAVE_FILTER_NBIT) + SET (USE_FILTER_NBIT "true") + ENDIF (H5_HAVE_FILTER_NBIT) + + IF (H5_HAVE_FILTER_SCALEOFFSET) + SET (USE_FILTER_SCALEOFFSET "true") + ENDIF (H5_HAVE_FILTER_SCALEOFFSET) # copy files (these files have no filters) -ADD_H5_TEST (fill "TEST" ${FILE0}) -ADD_H5_TEST (objs "TEST" ${FILE1}) -ADD_H5_TEST (attr "TEST" ${FILE2}) -ADD_H5_TEST (hlink "TEST" ${FILE3}) -ADD_H5_TEST (layout "TEST" ${FILE4}) -ADD_H5_TEST (early "TEST" ${FILE5}) + ADD_H5_TEST (fill "TEST" ${FILE0}) + ADD_H5_TEST (objs "TEST" ${FILE1}) + ADD_H5_TEST (attr "TEST" ${FILE2}) + ADD_H5_TEST (hlink "TEST" ${FILE3}) + ADD_H5_TEST (layout "TEST" ${FILE4}) + ADD_H5_TEST (early "TEST" ${FILE5}) # use $FILE4 to write some filters (this file has no filters) # gzip with individual object -SET (arg ${FILE4} -f dset1:GZIP=1 -l dset1:CHUNK=20x10) -SET (TESTTYPE "TEST") -IF (NOT USE_FILTER_DEFLATE) - SET (TESTTYPE "SKIP") -ENDIF (NOT USE_FILTER_DEFLATE) -ADD_H5_TEST (gzip_individual ${TESTTYPE} ${arg}) + SET (arg ${FILE4} -f dset1:GZIP=1 -l dset1:CHUNK=20x10) + SET (TESTTYPE "TEST") + IF (NOT USE_FILTER_DEFLATE) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_DEFLATE) + ADD_H5_TEST (gzip_individual ${TESTTYPE} ${arg}) # gzip for all -SET (arg ${FILE4} -f GZIP=1) -SET (TESTTYPE "TEST") -IF (NOT USE_FILTER_DEFLATE) - SET (TESTTYPE "SKIP") -ENDIF (NOT USE_FILTER_DEFLATE) -ADD_H5_TEST (gzip_all ${TESTTYPE} ${arg}) + SET (arg ${FILE4} -f GZIP=1) + SET (TESTTYPE "TEST") + IF (NOT USE_FILTER_DEFLATE) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_DEFLATE) + ADD_H5_TEST (gzip_all ${TESTTYPE} ${arg}) # szip with individual object -SET (arg ${FILE4} -f dset2:SZIP=8,EC -l dset2:CHUNK=20x10) -SET (TESTTYPE "TEST") -IF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) - SET (TESTTYPE "SKIP") -ENDIF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) -ADD_H5_TEST (szip_individual ${TESTTYPE} ${arg}) + SET (arg ${FILE4} -f dset2:SZIP=8,EC -l dset2:CHUNK=20x10) + SET (TESTTYPE "TEST") + IF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) + ADD_H5_TEST (szip_individual ${TESTTYPE} ${arg}) # szip for all -SET (arg ${FILE4} -f SZIP=8,NN) -SET (TESTTYPE "TEST") -IF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) - SET (TESTTYPE "SKIP") -ENDIF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) -ADD_H5_TEST (szip_all ${TESTTYPE} ${arg}) + SET (arg ${FILE4} -f SZIP=8,NN) + SET (TESTTYPE "TEST") + IF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) + ADD_H5_TEST (szip_all ${TESTTYPE} ${arg}) # shuffle with individual object -SET (arg ${FILE4} -f dset2:SHUF -l dset2:CHUNK=20x10) -SET (TESTTYPE "TEST") -IF (NOT USE_FILTER_SHUFFLE) - SET (TESTTYPE "SKIP") -ENDIF (NOT USE_FILTER_SHUFFLE) -ADD_H5_TEST (shuffle_individual ${TESTTYPE} ${arg}) + SET (arg ${FILE4} -f dset2:SHUF -l dset2:CHUNK=20x10) + SET (TESTTYPE "TEST") + IF (NOT USE_FILTER_SHUFFLE) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_SHUFFLE) + ADD_H5_TEST (shuffle_individual ${TESTTYPE} ${arg}) # shuffle for all -SET (arg ${FILE4} -f SHUF) -SET (TESTTYPE "TEST") -IF (NOT USE_FILTER_SHUFFLE) - SET (TESTTYPE "SKIP") -ENDIF (NOT USE_FILTER_SHUFFLE) -ADD_H5_TEST (shuffle_all ${TESTTYPE} ${arg}) + SET (arg ${FILE4} -f SHUF) + SET (TESTTYPE "TEST") + IF (NOT USE_FILTER_SHUFFLE) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_SHUFFLE) + ADD_H5_TEST (shuffle_all ${TESTTYPE} ${arg}) # fletcher32 with individual object -SET (arg ${FILE4} -f dset2:FLET -l dset2:CHUNK=20x10) -SET (TESTTYPE "TEST") -IF (NOT USE_FILTER_FLETCHER32) - SET (TESTTYPE "SKIP") -ENDIF (NOT USE_FILTER_FLETCHER32) -ADD_H5_TEST (fletcher_individual ${TESTTYPE} ${arg}) + SET (arg ${FILE4} -f dset2:FLET -l dset2:CHUNK=20x10) + SET (TESTTYPE "TEST") + IF (NOT USE_FILTER_FLETCHER32) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_FLETCHER32) + ADD_H5_TEST (fletcher_individual ${TESTTYPE} ${arg}) # fletcher32 for all -SET (arg ${FILE4} -f FLET) -SET (TESTTYPE "TEST") -IF (NOT USE_FILTER_FLETCHER32) - SET (TESTTYPE "SKIP") -ENDIF (NOT USE_FILTER_FLETCHER32) -ADD_H5_TEST (fletcher_all ${TESTTYPE} ${arg}) + SET (arg ${FILE4} -f FLET) + SET (TESTTYPE "TEST") + IF (NOT USE_FILTER_FLETCHER32) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_FLETCHER32) + ADD_H5_TEST (fletcher_all ${TESTTYPE} ${arg}) # all filters -SET (arg ${FILE4} -f dset2:SHUF -f dset2:FLET -f dset2:SZIP=8,NN -f dset2:GZIP=1 -l dset2:CHUNK=20x10) -SET (TESTTYPE "TEST") -IF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_SHUFFLE OR NOT USE_FILTER_FLETCHER32 OR NOT USE_FILTER_DEFLATE) - SET (TESTTYPE "SKIP") -ENDIF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_SHUFFLE OR NOT USE_FILTER_FLETCHER32 OR NOT USE_FILTER_DEFLATE) -ADD_H5_TEST (all_filters ${TESTTYPE} ${arg}) + SET (arg ${FILE4} -f dset2:SHUF -f dset2:FLET -f dset2:SZIP=8,NN -f dset2:GZIP=1 -l dset2:CHUNK=20x10) + SET (TESTTYPE "TEST") + IF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_SHUFFLE OR NOT USE_FILTER_FLETCHER32 OR NOT USE_FILTER_DEFLATE) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_SHUFFLE OR NOT USE_FILTER_FLETCHER32 OR NOT USE_FILTER_DEFLATE) + ADD_H5_TEST (all_filters ${TESTTYPE} ${arg}) # verbose gzip with individual object -SET (arg ${FILE11} -v -f /dset_deflate:GZIP=9) -SET (TESTTYPE "TEST") -IF (NOT USE_FILTER_DEFLATE) - SET (TESTTYPE "SKIP") -ENDIF (NOT USE_FILTER_DEFLATE) -ADD_H5_CMP_TEST (gzip_verbose_filters "O?...ing file[^\n]+\n" ${TESTTYPE} 0 ${arg}) + SET (arg ${FILE11} -v -f /dset_deflate:GZIP=9) + SET (TESTTYPE "TEST") + IF (NOT USE_FILTER_DEFLATE) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_DEFLATE) + ADD_H5_CMP_TEST (gzip_verbose_filters "O?...ing file[^\n]+\n" ${TESTTYPE} 0 ${arg}) ########################################################### # the following tests assume the input files have filters ########################################################### # szip copy -SET (arg ${FILE7}) -SET (TESTTYPE "TEST") -IF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) - SET (TESTTYPE "SKIP") -ENDIF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) -ADD_H5_TEST (szip_copy ${TESTTYPE} ${arg}) + SET (arg ${FILE7}) + SET (TESTTYPE "TEST") + IF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) + ADD_H5_TEST (szip_copy ${TESTTYPE} ${arg}) # szip remove -SET (arg ${FILE7} --filter=dset_szip:NONE) -SET (TESTTYPE "TEST") -IF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) - SET (TESTTYPE "SKIP") -ENDIF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) -ADD_H5_TEST (szip_remove ${TESTTYPE} ${arg}) + SET (arg ${FILE7} --filter=dset_szip:NONE) + SET (TESTTYPE "TEST") + IF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) + ADD_H5_TEST (szip_remove ${TESTTYPE} ${arg}) # deflate copy -SET (arg ${FILE8}) -SET (TESTTYPE "TEST") -IF (NOT USE_FILTER_DEFLATE) - SET (TESTTYPE "SKIP") -ENDIF (NOT USE_FILTER_DEFLATE) -ADD_H5_TEST (deflate_copy ${TESTTYPE} ${arg}) + SET (arg ${FILE8}) + SET (TESTTYPE "TEST") + IF (NOT USE_FILTER_DEFLATE) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_DEFLATE) + ADD_H5_TEST (deflate_copy ${TESTTYPE} ${arg}) # deflate remove -SET (arg ${FILE8} -f dset_deflate:NONE) -SET (TESTTYPE "TEST") -IF (NOT USE_FILTER_DEFLATE) - SET (TESTTYPE "SKIP") -ENDIF (NOT USE_FILTER_DEFLATE) -ADD_H5_TEST (deflate_remove ${TESTTYPE} ${arg}) + SET (arg ${FILE8} -f dset_deflate:NONE) + SET (TESTTYPE "TEST") + IF (NOT USE_FILTER_DEFLATE) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_DEFLATE) + ADD_H5_TEST (deflate_remove ${TESTTYPE} ${arg}) # shuffle copy -SET (arg ${FILE9}) -SET (TESTTYPE "TEST") -IF (NOT USE_FILTER_SHUFFLE) - SET (TESTTYPE "SKIP") -ENDIF (NOT USE_FILTER_SHUFFLE) -ADD_H5_TEST (shuffle_copy ${TESTTYPE} ${arg}) + SET (arg ${FILE9}) + SET (TESTTYPE "TEST") + IF (NOT USE_FILTER_SHUFFLE) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_SHUFFLE) + ADD_H5_TEST (shuffle_copy ${TESTTYPE} ${arg}) # shuffle remove -SET (arg ${FILE9} -f dset_shuffle:NONE) -SET (TESTTYPE "TEST") -IF (NOT USE_FILTER_SHUFFLE) - SET (TESTTYPE "SKIP") -ENDIF (NOT USE_FILTER_SHUFFLE) -ADD_H5_TEST (shuffle_remove ${TESTTYPE} ${arg}) + SET (arg ${FILE9} -f dset_shuffle:NONE) + SET (TESTTYPE "TEST") + IF (NOT USE_FILTER_SHUFFLE) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_SHUFFLE) + ADD_H5_TEST (shuffle_remove ${TESTTYPE} ${arg}) # fletcher32 copy -SET (arg ${FILE10}) -SET (TESTTYPE "TEST") -IF (NOT USE_FILTER_FLETCHER32) - SET (TESTTYPE "SKIP") -ENDIF (NOT USE_FILTER_FLETCHER32) -ADD_H5_TEST (fletcher_copy ${TESTTYPE} ${arg}) + SET (arg ${FILE10}) + SET (TESTTYPE "TEST") + IF (NOT USE_FILTER_FLETCHER32) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_FLETCHER32) + ADD_H5_TEST (fletcher_copy ${TESTTYPE} ${arg}) # fletcher32 remove -SET (arg ${FILE10} -f dset_fletcher32:NONE) -SET (TESTTYPE "TEST") -IF (NOT USE_FILTER_FLETCHER32) - SET (TESTTYPE "SKIP") -ENDIF (NOT USE_FILTER_FLETCHER32) -ADD_H5_TEST (fletcher_remove ${TESTTYPE} ${arg}) + SET (arg ${FILE10} -f dset_fletcher32:NONE) + SET (TESTTYPE "TEST") + IF (NOT USE_FILTER_FLETCHER32) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_FLETCHER32) + ADD_H5_TEST (fletcher_remove ${TESTTYPE} ${arg}) # nbit copy -SET (arg ${FILE12}) -SET (TESTTYPE "TEST") -IF (NOT USE_FILTER_NBIT) - SET (TESTTYPE "SKIP") -ENDIF (NOT USE_FILTER_NBIT) -ADD_H5_TEST (nbit_copy ${TESTTYPE} ${arg}) + SET (arg ${FILE12}) + SET (TESTTYPE "TEST") + IF (NOT USE_FILTER_NBIT) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_NBIT) + ADD_H5_TEST (nbit_copy ${TESTTYPE} ${arg}) # nbit remove -SET (arg ${FILE12} -f dset_nbit:NONE) -SET (TESTTYPE "TEST") -IF (NOT USE_FILTER_NBIT) - SET (TESTTYPE "SKIP") -ENDIF (NOT USE_FILTER_NBIT) -ADD_H5_TEST (nbit_remove ${TESTTYPE} ${arg}) + SET (arg ${FILE12} -f dset_nbit:NONE) + SET (TESTTYPE "TEST") + IF (NOT USE_FILTER_NBIT) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_NBIT) + ADD_H5_TEST (nbit_remove ${TESTTYPE} ${arg}) # nbit add -SET (arg ${FILE12} -f dset_int31:NBIT) -SET (TESTTYPE "TEST") -IF (NOT USE_FILTER_NBIT) - SET (TESTTYPE "SKIP") -ENDIF (NOT USE_FILTER_NBIT) -ADD_H5_TEST (nbit_add ${TESTTYPE} ${arg}) + SET (arg ${FILE12} -f dset_int31:NBIT) + SET (TESTTYPE "TEST") + IF (NOT USE_FILTER_NBIT) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_NBIT) + ADD_H5_TEST (nbit_add ${TESTTYPE} ${arg}) # scaleoffset copy -SET (arg ${FILE13}) -SET (TESTTYPE "TEST") -IF (NOT USE_FILTER_SCALEOFFSET) - SET (TESTTYPE "SKIP") -ENDIF (NOT USE_FILTER_SCALEOFFSET) -ADD_H5_TEST (scale_copy ${TESTTYPE} ${arg}) + SET (arg ${FILE13}) + SET (TESTTYPE "TEST") + IF (NOT USE_FILTER_SCALEOFFSET) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_SCALEOFFSET) + ADD_H5_TEST (scale_copy ${TESTTYPE} ${arg}) # scaleoffset add -SET (arg ${FILE13} -f dset_none:SOFF=31,IN) -SET (TESTTYPE "TEST") -IF (NOT USE_FILTER_SCALEOFFSET) - SET (TESTTYPE "SKIP") -ENDIF (NOT USE_FILTER_SCALEOFFSET) -ADD_H5_TEST (scale_add ${TESTTYPE} ${arg}) + SET (arg ${FILE13} -f dset_none:SOFF=31,IN) + SET (TESTTYPE "TEST") + IF (NOT USE_FILTER_SCALEOFFSET) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_SCALEOFFSET) + ADD_H5_TEST (scale_add ${TESTTYPE} ${arg}) # scaleoffset remove -SET (arg ${FILE13} -f dset_scaleoffset:NONE) -SET (TESTTYPE "TEST") -IF (NOT USE_FILTER_SCALEOFFSET) - SET (TESTTYPE "SKIP") -ENDIF (NOT USE_FILTER_SCALEOFFSET) -ADD_H5_TEST (scale_remove ${TESTTYPE} ${arg}) + SET (arg ${FILE13} -f dset_scaleoffset:NONE) + SET (TESTTYPE "TEST") + IF (NOT USE_FILTER_SCALEOFFSET) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_SCALEOFFSET) + ADD_H5_TEST (scale_remove ${TESTTYPE} ${arg}) # remove all filters -SET (arg ${FILE11} -f NONE) -SET (TESTTYPE "TEST") -IF (NOT USE_FILTER_FLETCHER32 OR NOT USE_FILTER_DEFLATE OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SHUFFLE OR NOT USE_FILTER_NBIT OR NOT USE_FILTER_SCALEOFFSET) - SET (TESTTYPE "SKIP") -ENDIF (NOT USE_FILTER_FLETCHER32 OR NOT USE_FILTER_DEFLATE OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SHUFFLE OR NOT USE_FILTER_NBIT OR NOT USE_FILTER_SCALEOFFSET) -ADD_H5_TEST (remove_all ${TESTTYPE} ${arg}) + SET (arg ${FILE11} -f NONE) + SET (TESTTYPE "TEST") + IF (NOT USE_FILTER_FLETCHER32 OR NOT USE_FILTER_DEFLATE OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SHUFFLE OR NOT USE_FILTER_NBIT OR NOT USE_FILTER_SCALEOFFSET) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_FLETCHER32 OR NOT USE_FILTER_DEFLATE OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SHUFFLE OR NOT USE_FILTER_NBIT OR NOT USE_FILTER_SCALEOFFSET) + ADD_H5_TEST (remove_all ${TESTTYPE} ${arg}) #filter conversions - -SET (arg ${FILE8} -f dset_deflate:SZIP=8,NN) -SET (TESTTYPE "TEST") -IF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_DEFLATE) - SET (TESTTYPE "SKIP") -ENDIF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_DEFLATE) -ADD_H5_TEST (deflate_convert ${TESTTYPE} ${arg}) - -SET (arg ${FILE7} -f dset_szip:GZIP=1) -SET (TESTTYPE "TEST") -IF (NOT USE_FILTER_SZIP OR NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_DEFLATE) - SET (TESTTYPE "SKIP") -ENDIF (NOT USE_FILTER_SZIP OR NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_DEFLATE) -ADD_H5_TEST (szip_convert ${TESTTYPE} ${arg}) + SET (arg ${FILE8} -f dset_deflate:SZIP=8,NN) + SET (TESTTYPE "TEST") + IF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_DEFLATE) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_DEFLATE) + ADD_H5_TEST (deflate_convert ${TESTTYPE} ${arg}) + + SET (arg ${FILE7} -f dset_szip:GZIP=1) + SET (TESTTYPE "TEST") + IF (NOT USE_FILTER_SZIP OR NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_DEFLATE) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_SZIP OR NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_DEFLATE) + ADD_H5_TEST (szip_convert ${TESTTYPE} ${arg}) #limit -SET (arg ${FILE4} -f GZIP=1 -m 1024) -SET (TESTTYPE "TEST") -IF (NOT USE_FILTER_DEFLATE) - SET (TESTTYPE "SKIP") -ENDIF (NOT USE_FILTER_DEFLATE) -ADD_H5_TEST (deflate_limit ${TESTTYPE} ${arg}) + SET (arg ${FILE4} -f GZIP=1 -m 1024) + SET (TESTTYPE "TEST") + IF (NOT USE_FILTER_DEFLATE) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_DEFLATE) + ADD_H5_TEST (deflate_limit ${TESTTYPE} ${arg}) #file -SET (arg ${FILE4} -e ${INFO_FILE}) -SET (TESTTYPE "TEST") -IF (NOT USE_FILTER_DEFLATE) - SET (TESTTYPE "SKIP") -ENDIF (NOT USE_FILTER_DEFLATE) -ADD_H5_TEST (deflate_file ${TESTTYPE} ${arg}) + SET (arg ${FILE4} -e ${INFO_FILE}) + SET (TESTTYPE "TEST") + IF (NOT USE_FILTER_DEFLATE) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_DEFLATE) + ADD_H5_TEST (deflate_file ${TESTTYPE} ${arg}) ######################################################### # layout options (these files have no filters) ######################################################### - -ADD_H5_TEST (dset2_chunk_20x10 "TEST" ${FILE4} --layout=dset2:CHUNK=20x10) -ADD_H5_VERIFY_TEST (dset2_chunk_20x10 "TEST" 0 ${FILE4} dset2 CHUNKED) -ADD_H5_TEST (chunk_20x10 "TEST" ${FILE4} -l CHUNK=20x10) -ADD_H5_VERIFY_TEST (chunk_20x10 "TEST" 1 ${FILE4} null CHUNKED) -ADD_H5_TEST (dset2_conti "TEST" ${FILE4} -l dset2:CONTI) -ADD_H5_VERIFY_TEST (dset2_conti "TEST" 0 ${FILE4} dset2 CONTIGUOUS) -ADD_H5_TEST (conti "TEST" ${FILE4} -l CONTI) -ADD_H5_VERIFY_TEST (conti "TEST" 1 ${FILE4} null CONTIGUOUS) -ADD_H5_TEST (dset2_compa "TEST" ${FILE4} -l dset2:COMPA) -ADD_H5_VERIFY_TEST (dset2_compa "TEST" 0 ${FILE4} dset2 COMPACT) -ADD_H5_TEST (compa "TEST" ${FILE4} -l COMPA) -ADD_H5_VERIFY_TEST (compa "TEST" 1 ${FILE4} null COMPACT) + ADD_H5_TEST (dset2_chunk_20x10 "TEST" ${FILE4} --layout=dset2:CHUNK=20x10) + ADD_H5_VERIFY_TEST (dset2_chunk_20x10 "TEST" 0 ${FILE4} dset2 CHUNKED) + ADD_H5_TEST (chunk_20x10 "TEST" ${FILE4} -l CHUNK=20x10) + ADD_H5_VERIFY_TEST (chunk_20x10 "TEST" 1 ${FILE4} null CHUNKED) + ADD_H5_TEST (dset2_conti "TEST" ${FILE4} -l dset2:CONTI) + ADD_H5_VERIFY_TEST (dset2_conti "TEST" 0 ${FILE4} dset2 CONTIGUOUS) + ADD_H5_TEST (conti "TEST" ${FILE4} -l CONTI) + ADD_H5_VERIFY_TEST (conti "TEST" 1 ${FILE4} null CONTIGUOUS) + ADD_H5_TEST (dset2_compa "TEST" ${FILE4} -l dset2:COMPA) + ADD_H5_VERIFY_TEST (dset2_compa "TEST" 0 ${FILE4} dset2 COMPACT) + ADD_H5_TEST (compa "TEST" ${FILE4} -l COMPA) + ADD_H5_VERIFY_TEST (compa "TEST" 1 ${FILE4} null COMPACT) ################################################################ # layout conversions (file has no filters) ############################################################### - -ADD_H5_TEST (dset_compa_conti "TEST" ${FILE4} -l dset_compact:CONTI) -ADD_H5_VERIFY_TEST (dset_compa_conti "TEST" 0 ${FILE4} dset_compact CONTIGUOUS) -ADD_H5_TEST (dset_compa_chunk "TEST" ${FILE4} -l dset_compact:CHUNK=2x5) -ADD_H5_VERIFY_TEST (dset_compa_chunk "TEST" 0 ${FILE4} dset_compact CHUNKED) -ADD_H5_TEST (dset_compa_compa "TEST" ${FILE4} -l dset_compact:COMPA) -ADD_H5_VERIFY_TEST (dset_compa_compa "TEST" 0 ${FILE4} dset_compact COMPACT) -ADD_H5_TEST (dset_conti_compa "TEST" ${FILE4} -l dset_contiguous:COMPA) -ADD_H5_VERIFY_TEST (dset_conti_compa "TEST" 0 ${FILE4} dset_contiguous COMPACT) -ADD_H5_TEST (dset_conti_chunk "TEST" ${FILE4} -l dset_contiguous:CHUNK=3x6) -ADD_H5_VERIFY_TEST (dset_conti_chunk "TEST" 0 ${FILE4} dset_contiguous CHUNKED) -ADD_H5_TEST (dset_conti_conti "TEST" ${FILE4} -l dset_contiguous:CONTI) -ADD_H5_VERIFY_TEST (dset_conti_conti "TEST" 0 ${FILE4} dset_contiguous CONTIGUOUS) -ADD_H5_TEST (chunk_compa "TEST" ${FILE4} -l dset_chunk:COMPA) -ADD_H5_VERIFY_TEST (chunk_compa "TEST" 0 ${FILE4} dset_chunk COMPACT) -ADD_H5_TEST (chunk_conti "TEST" ${FILE4} -l dset_chunk:CONTI) -ADD_H5_VERIFY_TEST (chunk_conti "TEST" 0 ${FILE4} dset_chunk CONTIGUOUS) -ADD_H5_TEST (chunk_18x13 "TEST" ${FILE4} -l dset_chunk:CHUNK=18x13) -ADD_H5_VERIFY_TEST (chunk_18x13 "TEST" 0 ${FILE4} dset_chunk CHUNKED) + ADD_H5_TEST (dset_compa_conti "TEST" ${FILE4} -l dset_compact:CONTI) + ADD_H5_VERIFY_TEST (dset_compa_conti "TEST" 0 ${FILE4} dset_compact CONTIGUOUS) + ADD_H5_TEST (dset_compa_chunk "TEST" ${FILE4} -l dset_compact:CHUNK=2x5) + ADD_H5_VERIFY_TEST (dset_compa_chunk "TEST" 0 ${FILE4} dset_compact CHUNKED) + ADD_H5_TEST (dset_compa_compa "TEST" ${FILE4} -l dset_compact:COMPA) + ADD_H5_VERIFY_TEST (dset_compa_compa "TEST" 0 ${FILE4} dset_compact COMPACT) + ADD_H5_TEST (dset_conti_compa "TEST" ${FILE4} -l dset_contiguous:COMPA) + ADD_H5_VERIFY_TEST (dset_conti_compa "TEST" 0 ${FILE4} dset_contiguous COMPACT) + ADD_H5_TEST (dset_conti_chunk "TEST" ${FILE4} -l dset_contiguous:CHUNK=3x6) + ADD_H5_VERIFY_TEST (dset_conti_chunk "TEST" 0 ${FILE4} dset_contiguous CHUNKED) + ADD_H5_TEST (dset_conti_conti "TEST" ${FILE4} -l dset_contiguous:CONTI) + ADD_H5_VERIFY_TEST (dset_conti_conti "TEST" 0 ${FILE4} dset_contiguous CONTIGUOUS) + ADD_H5_TEST (chunk_compa "TEST" ${FILE4} -l dset_chunk:COMPA) + ADD_H5_VERIFY_TEST (chunk_compa "TEST" 0 ${FILE4} dset_chunk COMPACT) + ADD_H5_TEST (chunk_conti "TEST" ${FILE4} -l dset_chunk:CONTI) + ADD_H5_VERIFY_TEST (chunk_conti "TEST" 0 ${FILE4} dset_chunk CONTIGUOUS) + ADD_H5_TEST (chunk_18x13 "TEST" ${FILE4} -l dset_chunk:CHUNK=18x13) + ADD_H5_VERIFY_TEST (chunk_18x13 "TEST" 0 ${FILE4} dset_chunk CHUNKED) # test convert small size dataset ( < 1k) to compact layout without -m -ADD_H5_TEST (contig_small_compa "TEST" ${FILE18} -l contig_small:COMPA) -ADD_H5_VERIFY_TEST (contig_small_compa "TEST" 0 ${FILE18} contig_small COMPACT) + ADD_H5_TEST (contig_small_compa "TEST" ${FILE18} -l contig_small:COMPA) + ADD_H5_VERIFY_TEST (contig_small_compa "TEST" 0 ${FILE18} contig_small COMPACT) -ADD_H5_TEST (contig_small_fixed_compa "TEST" ${FILE18} -l chunked_small_fixed:COMPA) -ADD_H5_VERIFY_TEST (contig_small_fixed_compa "TEST" 0 ${FILE18} chunked_small_fixed COMPACT) + ADD_H5_TEST (contig_small_fixed_compa "TEST" ${FILE18} -l chunked_small_fixed:COMPA) + ADD_H5_VERIFY_TEST (contig_small_fixed_compa "TEST" 0 ${FILE18} chunked_small_fixed COMPACT) # Native option # Do not use FILE1, as the named dtype will be converted to native, and h5diff will # report a difference. -ADD_H5_TEST (native_fill "TEST" ${FILE0} -n) -ADD_H5_TEST (native_attr "TEST" ${FILE2} -n) - + ADD_H5_TEST (native_fill "TEST" ${FILE0} -n) + ADD_H5_TEST (native_attr "TEST" ${FILE2} -n) # latest file format with long switches. use FILE4=h5repack_layout.h5 (no filters) -SET (arg ${FILE4} --layout CHUNK=20x10 --filter GZIP=1 --minimum=10 --native --latest --compact=8 --indexed=6 --ssize=8[:dtype]) -SET (TESTTYPE "TEST") -IF (NOT USE_FILTER_DEFLATE) - SET (TESTTYPE "SKIP") -ENDIF (NOT USE_FILTER_DEFLATE) -ADD_H5_TEST (layout_long_switches ${TESTTYPE} ${arg}) -ADD_H5_VERIFY_TEST (layout_long_switches ${TESTTYPE} 1 ${FILE4} null CHUNKED) + SET (arg ${FILE4} --layout CHUNK=20x10 --filter GZIP=1 --minimum=10 --native --latest --compact=8 --indexed=6 --ssize=8[:dtype]) + SET (TESTTYPE "TEST") + IF (NOT USE_FILTER_DEFLATE) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_DEFLATE) + ADD_H5_TEST (layout_long_switches ${TESTTYPE} ${arg}) + ADD_H5_VERIFY_TEST (layout_long_switches ${TESTTYPE} 1 ${FILE4} null CHUNKED) # latest file format with short switches. use FILE4=h5repack_layout.h5 (no filters) -SET (arg ${FILE4} -l CHUNK=20x10 -f GZIP=1 -m 10 -n -L -c 8 -d 6 -s 8[:dtype]) -SET (TESTTYPE "TEST") -IF (NOT USE_FILTER_DEFLATE) - SET (TESTTYPE "SKIP") -ENDIF (NOT USE_FILTER_DEFLATE) -ADD_H5_TEST (layout_short_switches ${TESTTYPE} ${arg}) -ADD_H5_VERIFY_TEST (layout_short_switches ${TESTTYPE} 1 ${FILE4} null CHUNKED) + SET (arg ${FILE4} -l CHUNK=20x10 -f GZIP=1 -m 10 -n -L -c 8 -d 6 -s 8[:dtype]) + SET (TESTTYPE "TEST") + IF (NOT USE_FILTER_DEFLATE) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_DEFLATE) + ADD_H5_TEST (layout_short_switches ${TESTTYPE} ${arg}) + ADD_H5_VERIFY_TEST (layout_short_switches ${TESTTYPE} 1 ${FILE4} null CHUNKED) # several global filters -SET (arg ${FILE4} --filter GZIP=1 --filter SHUF) -SET (TESTTYPE "TEST") -IF (NOT USE_FILTER_DEFLATE OR NOT USE_FILTER_SHUFFLE) - SET (TESTTYPE "SKIP") -ENDIF (NOT USE_FILTER_DEFLATE OR NOT USE_FILTER_SHUFFLE) -ADD_H5_TEST (global_filters ${TESTTYPE} ${arg}) + SET (arg ${FILE4} --filter GZIP=1 --filter SHUF) + SET (TESTTYPE "TEST") + IF (NOT USE_FILTER_DEFLATE OR NOT USE_FILTER_SHUFFLE) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_DEFLATE OR NOT USE_FILTER_SHUFFLE) + ADD_H5_TEST (global_filters ${TESTTYPE} ${arg}) # syntax of -i infile -o outfile # latest file format with short switches. use FILE4=h5repack_layout.h5 (no filters) -SET (arg ${FILE4} -l CHUNK=20x10 -f GZIP=1 -m 10 -n -L -c 8 -d 6 -s 8[:dtype]) -SET (TESTTYPE "LEGACY") -IF (NOT USE_FILTER_DEFLATE) - SET (TESTTYPE "SKIP") -ENDIF (NOT USE_FILTER_DEFLATE) -#ADD_H5_TEST (old_style_layout_short_switches ${TESTTYPE} ${arg}) + SET (arg ${FILE4} -l CHUNK=20x10 -f GZIP=1 -m 10 -n -L -c 8 -d 6 -s 8[:dtype]) + SET (TESTTYPE "LEGACY") + IF (NOT USE_FILTER_DEFLATE) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_DEFLATE) +# ADD_H5_TEST (old_style_layout_short_switches ${TESTTYPE} ${arg}) # add a userblock to file -SET (arg ${FILE1} -u ${PROJECT_BINARY_DIR}/testfiles/ublock.bin -b 2048) -ADD_H5_TEST (add_userblock "TEST" ${arg}) + SET (arg ${FILE1} -u ${PROJECT_BINARY_DIR}/testfiles/ublock.bin -b 2048) + ADD_H5_TEST (add_userblock "TEST" ${arg}) # add alignment -SET (arg ${FILE1} -t 1 -a 1) -ADD_H5_TEST (add_alignment "TEST" ${arg}) + SET (arg ${FILE1} -t 1 -a 1) + ADD_H5_TEST (add_alignment "TEST" ${arg}) # Check repacking file with old version of layout message (should get upgraded -# to new version and be readable, etc.) -ADD_H5_TEST (upgrade_layout "TEST" ${FILE14}) +# to new version and be readable, etc.) + ADD_H5_TEST (upgrade_layout "TEST" ${FILE14}) # test for datum size > H5TOOLS_MALLOCSIZE -ADD_H5_TEST (gt_mallocsize "TEST" ${FILE1} -f GZIP=1) + ADD_H5_TEST (gt_mallocsize "TEST" ${FILE1} -f GZIP=1) # Check repacking file with committed datatypes in odd configurations -ADD_H5_TEST (committed_dt "TEST" ${FILE15}) + ADD_H5_TEST (committed_dt "TEST" ${FILE15}) # tests family driver (file is located in common testfiles folder, uses TOOLTEST1 -#ADD_H5_TEST ( family "FAMILY" ${FILE16}) +# ADD_H5_TEST ( family "FAMILY" ${FILE16}) # test various references (bug 1814 and 1726) -ADD_H5_TEST (bug1814 "TEST" ${FILE_REF}) + ADD_H5_TEST (bug1814 "TEST" ${FILE_REF}) -# test attribute with various references (bug 1797) -# the references in attribute of compund or vlen datatype +# test attribute with various references in attribute of compund +# or vlen datatype +# (HDFFV-2605, 7513) # TODO: include this test when code portion is completed. -ADD_H5_TEST (bug1797 "SKIP" ${FILE_ATTR_REF}) + ADD_H5_TEST (HDFFV-2605 "SKIP" ${FILE_ATTR_REF}) + +# Add test for memory leak in attirbute. This test is verified by CTEST. +# 1. leak from vlen string +# 2. leak from compound type without reference member +# (HDFFV-7840, ) +# Note: this test is experimental for sharing test file among tools + ADD_H5_TEST (HDFFV-7840 "TEST" h5diff_attr1.h5) + + IF (HDF5_TEST_VFD) + # Run test with different Virtual File Driver + FOREACH (vfd ${VFD_LIST}) + ADD_VFD_TEST (${vfd} 0) + ENDFOREACH (vfd ${VFD_LIST}) + ENDIF (HDF5_TEST_VFD) ENDIF (BUILD_TESTING) diff --git a/tools/h5repack/Makefile.in b/tools/h5repack/Makefile.in index 0d067a1..0d749d3 100644 --- a/tools/h5repack/Makefile.in +++ b/tools/h5repack/Makefile.in @@ -195,6 +195,7 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ +FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ @@ -215,10 +216,12 @@ H5_LONE_COLON = @H5_LONE_COLON@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ +HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ +HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ diff --git a/tools/h5repack/h5repack.c b/tools/h5repack/h5repack.c index 1e7e0ed..05160d8 100644 --- a/tools/h5repack/h5repack.c +++ b/tools/h5repack/h5repack.c @@ -91,7 +91,7 @@ h5repack_init(pack_opt_t *options, int verbose, int latest, H5F_file_space_type_t strategy, hsize_t threshold) { int k, n; - memset(options,0,sizeof(pack_opt_t)); + HDmemset(options,0,sizeof(pack_opt_t)); options->min_comp = 1024; options->verbose = verbose; options->latest = latest; @@ -110,7 +110,7 @@ h5repack_init(pack_opt_t *options, int verbose, int latest, return (options_table_init(&(options->op_tbl))); } - + /*------------------------------------------------------------------------- * Function: h5repack_end * @@ -124,7 +124,7 @@ int h5repack_end (pack_opt_t *options) return options_table_free(options->op_tbl); } - + /*------------------------------------------------------------------------- * Function: h5repack_addfilter * @@ -159,7 +159,7 @@ int h5repack_addfilter(const char* str, if(options->n_filter_g > H5_REPACK_MAX_NFILTERS) { error_msg("maximum number of filters exceeded for <%s>\n", str); - free(obj_list); + HDfree(obj_list); return -1; } @@ -168,11 +168,11 @@ int h5repack_addfilter(const char* str, else options_add_filter(obj_list, n_objs, filter, options->op_tbl); - free(obj_list); + HDfree(obj_list); return 0; } - + /*------------------------------------------------------------------------- * Function: h5repack_addlayout * @@ -234,13 +234,13 @@ int h5repack_addlayout(const char* str, &pack, options->op_tbl); - free(obj_list); + HDfree(obj_list); return 0; } -/* Note: The below copy_named_datatype(), named_datatype_free(), copy_attr() - * were located in h5repack_copy.c as static prior to bugfix1726. - * Made shared functions as copy_attr() was needed in h5repack_refs.c. +/* Note: The below copy_named_datatype(), named_datatype_free(), copy_attr() + * were located in h5repack_copy.c as static prior to bugfix1726. + * Made shared functions as copy_attr() was needed in h5repack_refs.c. * However copy_attr() may be obsoleted when H5Acopy is available and put back * others to static in h5repack_copy.c. */ @@ -271,21 +271,21 @@ hid_t copy_named_datatype(hid_t type_in, hid_t fidout, named_dt_t **named_dt_hea if(H5Oget_info(type_in, &oinfo) < 0) goto error; - if(*named_dt_head_p) + 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 + } + else { /* Create the stack */ size_t i; for(i=0; inobjs; i++) - if(travt->objs[i].type == H5TRAV_TYPE_NAMED_DATATYPE) + if(travt->objs[i].type == H5TRAV_TYPE_NAMED_DATATYPE) { /* Push onto the stack */ if(NULL == (dt = (named_dt_t *) HDmalloc(sizeof(named_dt_t)))) @@ -298,7 +298,7 @@ hid_t copy_named_datatype(hid_t type_in, hid_t fidout, named_dt_t **named_dt_hea dt->id_out = -1; /* Check if this type is the one requested */ - if(oinfo.addr == dt->addr_in) + if(oinfo.addr == dt->addr_in) { HDassert(!dt_ret); dt_ret = dt; @@ -308,7 +308,7 @@ hid_t copy_named_datatype(hid_t type_in, hid_t fidout, named_dt_t **named_dt_hea /* 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) + if(!dt_ret) { /* Push the new datatype onto the stack */ if(NULL == (dt_ret = (named_dt_t *) HDmalloc(sizeof(named_dt_t)))) @@ -323,7 +323,7 @@ hid_t copy_named_datatype(hid_t type_in, hid_t fidout, named_dt_t **named_dt_hea /* If the requested datatype does not yet exist in the output file, copy it * anonymously */ - if(dt_ret->id_out < 0) + if(dt_ret->id_out < 0) { if (options->use_native==1) dt_ret->id_out = h5tools_get_native_type(type_in); @@ -365,7 +365,7 @@ int named_datatype_free(named_dt_t **named_dt_head_p, int ignore_err) { named_dt_t *dt = *named_dt_head_p; - while(dt) + while(dt) { /* Pop the datatype off the stack and free it */ if(H5Tclose(dt->id_out) < 0 && !ignore_err) @@ -418,6 +418,8 @@ int copy_attr(hid_t loc_in, H5O_info_t oinfo; /* object info */ int j; unsigned u; + hbool_t is_ref=0; + H5T_class_t type_class = -1; if(H5Oget_info(loc_in, &oinfo) < 0) goto error; @@ -451,7 +453,7 @@ int copy_attr(hid_t loc_in, /* Copy named dt */ if((wtype_id = copy_named_datatype(ftype_id, fidout, named_dt_head_p, - travt, options)) < 0) + travt, options)) < 0) { H5Fclose(fidout); goto error; @@ -484,15 +486,37 @@ int copy_attr(hid_t loc_in, 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 + * 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 at copy_refs_attr() *------------------------------------------------------------------------- */ + type_class = H5Tget_class(wtype_id); + is_ref = (type_class == H5T_REFERENCE); + if (type_class == H5T_VLEN ||type_class == H5T_ARRAY ) { + hid_t base_type = -1; + base_type = H5Tget_super(ftype_id); + is_ref = (is_ref || (H5Tget_class(base_type)==H5T_REFERENCE)); + H5Tclose(base_type); + } - if(H5T_REFERENCE == H5Tget_class(wtype_id)) { - ; + if (type_class == H5T_COMPOUND) { + int nmembers = H5Tget_nmembers(wtype_id) ; + for (j=0; j /dev/null + RET=$? + if [ $RET -eq 1 ]; then + if [ -a $tstfile ]; then + $CP -f $tstfile $TESTDIR + else + echo "Error: FAILED to copy $tstfile" + echo " $tstfile doesn't exist!" + exit $EXIT_FAILURE + fi + fi + done +} # Print a line-line message left justified in a field of 70 characters # beginning with the word "Testing". @@ -128,8 +195,7 @@ TOOLTEST() { echo $@ TOOLTEST_MAIN $@ - path=`pwd` - outfile=$path/out.$1 + outfile=$TESTDIR/out.$1 rm -f $outfile } @@ -139,9 +205,8 @@ TOOLTEST_MAIN() # Run test. TESTING $H5REPACK $@ - infile=$srcdir/testfiles/$1 - path=`pwd` - outfile=$path/out.$1 + infile=$TESTDIR/$1 + outfile=$TESTDIR/out.$1 shift $RUNSERIAL $H5REPACK_BIN "$@" $infile $outfile RET=$? @@ -158,16 +223,15 @@ TOOLTEST_MAIN() # Verifying layouts of a dataset VERIFY_LAYOUT_DSET() { - path=`pwd` - outfile=$path/out.$1 - layoutfile=$path/layout.$1 + outfile=$TESTDIR/out.$1 + layoutfile=$TESTDIR/layout.$1 dset=$2 expectlayout=$3 #--------------------------------- # check the layout from a dataset VERIFY "Layout" - $H5DUMP_BIN -d $dset -pH $outfile > $layoutfile + $RUNSERIAL $H5DUMP_BIN -d $dset -pH $outfile > $layoutfile $GREP $expectlayout $layoutfile > /dev/null if [ $? -eq 0 ]; then echo " PASSED" @@ -184,9 +248,8 @@ VERIFY_LAYOUT_DSET() # Verifying layouts from entire file VERIFY_LAYOUT_ALL() { - path=`pwd` - outfile=$path/out.$1 - layoutfile=$path/layout.$1 + outfile=$TESTDIR/out.$1 + layoutfile=$TESTDIR/layout.$1 expectlayout=$2 #--------------------------------- @@ -195,7 +258,7 @@ VERIFY_LAYOUT_ALL() VERIFY "Layout " # if CONTIGUOUS if [ $expectlayout = "CONTIGUOUS" ]; then - $H5DUMP_BIN -pH $outfile > $layoutfile + $RUNSERIAL $H5DUMP_BIN -pH $outfile > $layoutfile $GREP "COMPACT" $layoutfile > /dev/null if [ $? -eq 0 ]; then echo " FAILED" @@ -210,7 +273,7 @@ VERIFY_LAYOUT_ALL() else # if COMPACT if [ $expectlayout = "COMPACT" ]; then - $H5DUMP_BIN -pH $outfile > $layoutfile + $RUNSERIAL $H5DUMP_BIN -pH $outfile > $layoutfile $GREP "CHUNKED" $layoutfile > /dev/null if [ $? -eq 0 ]; then echo " FAILED" @@ -225,7 +288,7 @@ VERIFY_LAYOUT_ALL() else # if CHUNKED if [ $expectlayout = "CHUNKED" ]; then - $H5DUMP_BIN -pH $outfile > $layoutfile + $RUNSERIAL $H5DUMP_BIN -pH $outfile > $layoutfile $GREP "CONTIGUOUS" $layoutfile > /dev/null if [ $? -eq 0 ]; then echo " FAILED" @@ -253,9 +316,8 @@ TOOLTEST0() # Run test. TESTING $H5REPACK $@ - infile=$srcdir/testfiles/$1 - path=`pwd` - outfile=$path/out.$1 + infile=$TESTDIR/$1 + outfile=$TESTDIR/out.$1 shift $RUNSERIAL $H5REPACK_BIN -i $infile -o $outfile "$@" RET=$? @@ -270,7 +332,7 @@ TOOLTEST0() } -# same as TOOLTEST, but it uses the common testfiles at $srcdir/../testfiles/ +# same as TOOLTEST, but it uses without -i -o options # used to test the family driver, where these files reside # TOOLTEST1() @@ -278,9 +340,8 @@ TOOLTEST1() # Run test. TESTING $H5REPACK $@ - infile=$srcdir/../testfiles/$1 - path=`pwd` - outfile=$path/out.$1 + infile=$TESTDIR/$1 + outfile=$TESTDIR/out.$1 shift $RUNSERIAL $H5REPACK_BIN "$@" $infile $outfile RET=$? @@ -300,13 +361,12 @@ TOOLTESTV() { # Run test. TESTING $H5REPACK $@ - expect="$srcdir/../testfiles/$1.ddl" - actual="../testfiles/`basename $1 .ddl`.out" - actual_err="../testfiles/`basename $1 .ddl`.err" + expect="$TESTDIR/$1.ddl" + actual="$TESTDIR/`basename $1 .ddl`.out" + actual_err="$TESTDIR/`basename $1 .ddl`.err" - infile=$srcdir/testfiles/$1 - path=`pwd` - outfile=$path/out.$1 + infile=$TESTDIR/$1 + outfile=$TESTDIR/out.$1 shift $RUNSERIAL $H5REPACK_BIN "$@" $infile $outfile >$actual 2>$actual_err cp $actual $actual_sav @@ -325,6 +385,7 @@ TOOLTESTV() rm -f $actual $actual_err $actual_sav } +# This is different from $srcdir/../../bin/output_filter.sh STDOUT_FILTER() { result_file=$1 tmp_file=/tmp/h5test_tmp_$$ @@ -355,19 +416,25 @@ if test $USE_FILTER_SZIP = "yes"; then USE_FILTER_SZIP_ENCODER=`$RUNSERIAL $H5DETECTSZIP_BIN` fi +############################################################################## +### T H E T E S T S +############################################################################## +# prepare for test +COPY_TESTFILES_TO_TESTDIR + # copy files (these files have no filters) -TOOLTEST $FILE0 -TOOLTEST $FILE1 -TOOLTEST $FILE2 -TOOLTEST $FILE3 -TOOLTEST $FILE4 -TOOLTEST $FILE5 +TOOLTEST h5repack_fill.h5 +TOOLTEST h5repack_objs.h5 +TOOLTEST h5repack_attr.h5 +TOOLTEST h5repack_hlink.h5 +TOOLTEST h5repack_layout.h5 +TOOLTEST h5repack_early.h5 -# use $FILE4 to write some filters (this file has no filters) +# use h5repack_layout.h5 to write some filters (this file has no filters) # gzip with individual object -arg="$FILE4 -f dset1:GZIP=1 -l dset1:CHUNK=20x10" +arg="h5repack_layout.h5 -f dset1:GZIP=1 -l dset1:CHUNK=20x10" if test $USE_FILTER_DEFLATE != "yes" ; then SKIP $arg else @@ -375,7 +442,7 @@ else fi # gzip for all -arg="$FILE4 -f GZIP=1" +arg="h5repack_layout.h5 -f GZIP=1" if test $USE_FILTER_DEFLATE != "yes" ; then SKIP $arg else @@ -383,7 +450,7 @@ else fi # szip with individual object -arg="$FILE4 -f dset2:SZIP=8,EC -l dset2:CHUNK=20x10" +arg="h5repack_layout.h5 -f dset2:SZIP=8,EC -l dset2:CHUNK=20x10" if test $USE_FILTER_SZIP_ENCODER != "yes" -o $USE_FILTER_SZIP != "yes" ; then SKIP $arg else @@ -391,7 +458,7 @@ else fi # szip for all -arg="$FILE4 -f SZIP=8,NN" +arg="h5repack_layout.h5 -f SZIP=8,NN" if test $USE_FILTER_SZIP_ENCODER != "yes" -o $USE_FILTER_SZIP != "yes" ; then SKIP $arg else @@ -399,7 +466,7 @@ else fi # shuffle with individual object -arg="$FILE4 -f dset2:SHUF -l dset2:CHUNK=20x10" +arg="h5repack_layout.h5 -f dset2:SHUF -l dset2:CHUNK=20x10" if test $USE_FILTER_SHUFFLE != "yes" ; then SKIP $arg else @@ -408,7 +475,7 @@ fi # shuffle for all -arg="$FILE4 -f SHUF" +arg="h5repack_layout.h5 -f SHUF" if test $USE_FILTER_SHUFFLE != "yes" ; then SKIP $arg else @@ -416,7 +483,7 @@ else fi # fletcher32 with individual object -arg="$FILE4 -f dset2:FLET -l dset2:CHUNK=20x10" +arg="h5repack_layout.h5 -f dset2:FLET -l dset2:CHUNK=20x10" if test $USE_FILTER_FLETCHER32 != "yes" ; then SKIP $arg else @@ -424,7 +491,7 @@ else fi # fletcher32 for all -arg="$FILE4 -f FLET" +arg="h5repack_layout.h5 -f FLET" if test $USE_FILTER_FLETCHER32 != "yes" ; then SKIP $arg else @@ -432,7 +499,7 @@ else fi # all filters -arg="$FILE4 -f dset2:SHUF -f dset2:FLET -f dset2:SZIP=8,NN -f dset2:GZIP=1 -l dset2:CHUNK=20x10" +arg="h5repack_layout.h5 -f dset2:SHUF -f dset2:FLET -f dset2:SZIP=8,NN -f dset2:GZIP=1 -l dset2:CHUNK=20x10" if test $USE_FILTER_SZIP_ENCODER != "yes" -o $USE_FILTER_SZIP != "yes" -o $USE_FILTER_SHUFFLE != "yes" -o $USE_FILTER_FLETCHER32 != "yes" -o $USE_FILTER_DEFLATE != "yes" ; then SKIP $arg else @@ -440,7 +507,7 @@ else fi # verbose gzip with individual object -arg="$FILE11 -v -f /dset_deflate:GZIP=9" +arg="h5repack_filters.h5 -v -f /dset_deflate:GZIP=9" if test $USE_FILTER_DEFLATE != "yes" ; then SKIP $arg else @@ -452,7 +519,7 @@ fi ########################################################### # szip copy -arg="$FILE7" +arg="h5repack_szip.h5" if test $USE_FILTER_SZIP_ENCODER != "yes" -o $USE_FILTER_SZIP != "yes" ; then SKIP $arg else @@ -460,7 +527,7 @@ else fi # szip remove -arg="$FILE7 --filter=dset_szip:NONE" +arg="h5repack_szip.h5 --filter=dset_szip:NONE" if test $USE_FILTER_SZIP_ENCODER != "yes" -o $USE_FILTER_SZIP != "yes" ; then SKIP $arg else @@ -468,7 +535,7 @@ else fi # deflate copy -arg="$FILE8" +arg="h5repack_deflate.h5" if test $USE_FILTER_DEFLATE != "yes" ; then SKIP $arg else @@ -476,7 +543,7 @@ else fi # deflate remove -arg="$FILE8 -f dset_deflate:NONE" +arg="h5repack_deflate.h5 -f dset_deflate:NONE" if test $USE_FILTER_DEFLATE != "yes" ; then SKIP $arg else @@ -484,7 +551,7 @@ else fi # shuffle copy -arg="$FILE9" +arg="h5repack_shuffle.h5" if test $USE_FILTER_SHUFFLE != "yes" ; then SKIP $arg else @@ -492,7 +559,7 @@ else fi # shuffle remove -arg="$FILE9 -f dset_shuffle:NONE" +arg="h5repack_shuffle.h5 -f dset_shuffle:NONE" if test $USE_FILTER_SHUFFLE != "yes" ; then SKIP $arg else @@ -500,7 +567,7 @@ else fi # fletcher32 copy -arg="$FILE10" +arg="h5repack_fletcher.h5" if test $USE_FILTER_FLETCHER32 != "yes" ; then SKIP $arg else @@ -508,7 +575,7 @@ else fi # fletcher32 remove -arg="$FILE10 -f dset_fletcher32:NONE" +arg="h5repack_fletcher.h5 -f dset_fletcher32:NONE" if test $USE_FILTER_FLETCHER32 != "yes" ; then SKIP $arg else @@ -516,7 +583,7 @@ else fi # nbit copy -arg="$FILE12" +arg="h5repack_nbit.h5" if test $USE_FILTER_NBIT != "yes" ; then SKIP $arg else @@ -524,7 +591,7 @@ else fi # nbit remove -arg="$FILE12 -f dset_nbit:NONE" +arg="h5repack_nbit.h5 -f dset_nbit:NONE" if test $USE_FILTER_NBIT != "yes" ; then SKIP $arg else @@ -532,7 +599,7 @@ else fi # nbit add -arg="$FILE12 -f dset_int31:NBIT" +arg="h5repack_nbit.h5 -f dset_int31:NBIT" if test $USE_FILTER_NBIT != "yes" ; then SKIP $arg else @@ -540,7 +607,7 @@ else fi # scaleoffset copy -arg="$FILE13" +arg="h5repack_soffset.h5" if test $USE_FILTER_SCALEOFFSET != "yes" ; then SKIP $arg else @@ -548,7 +615,7 @@ else fi # scaleoffset add -arg="$FILE13 -f dset_none:SOFF=31,IN" +arg="h5repack_soffset.h5 -f dset_none:SOFF=31,IN" if test $USE_FILTER_SCALEOFFSET != "yes" ; then SKIP $arg else @@ -556,7 +623,7 @@ else fi # scaleoffset remove -arg="$FILE13 -f dset_scaleoffset:NONE" +arg="h5repack_soffset.h5 -f dset_scaleoffset:NONE" if test $USE_FILTER_SCALEOFFSET != "yes" ; then SKIP $arg else @@ -564,7 +631,7 @@ else fi # remove all filters -arg="$FILE11 -f NONE" +arg="h5repack_filters.h5 -f NONE" if test $USE_FILTER_FLETCHER32 != "yes" -o $USE_FILTER_DEFLATE != "yes" -o $USE_FILTER_SZIP != "yes" -o $USE_FILTER_SZIP_ENCODER != "yes" -o $USE_FILTER_SHUFFLE != "yes" -o $USE_FILTER_NBIT != "yes" -o $USE_FILTER_SCALEOFFSET != "yes" ; then SKIP $arg else @@ -573,14 +640,14 @@ fi #filter conversions -arg="$FILE8 -f dset_deflate:SZIP=8,NN" +arg="h5repack_deflate.h5 -f dset_deflate:SZIP=8,NN" if test $USE_FILTER_SZIP_ENCODER != "yes" -o $USE_FILTER_SZIP != "yes" -o $USE_FILTER_DEFLATE != "yes" ; then SKIP $arg else TOOLTEST $arg fi -arg="$FILE7 -f dset_szip:GZIP=1" +arg="h5repack_szip.h5 -f dset_szip:GZIP=1" if test $USE_FILTER_SZIP != "yes" -o $USE_FILTER_SZIP_ENCODER != "yes" -o $USE_FILTER_DEFLATE != "yes" ; then SKIP $arg else @@ -589,7 +656,7 @@ fi #limit -arg="$FILE4 -f GZIP=1 -m 1024" +arg="h5repack_layout.h5 -f GZIP=1 -m 1024" if test $USE_FILTER_DEFLATE != "yes" ; then SKIP $arg else @@ -597,7 +664,7 @@ else fi #file -arg="$FILE4 -e $srcdir/$INFO_FILE" +arg="h5repack_layout.h5 -e $TESTDIR/h5repack.info" if test $USE_FILTER_DEFLATE != "yes" ; then SKIP $arg else @@ -607,90 +674,90 @@ fi ######################################################### # layout options (these files have no filters) ######################################################### -TOOLTEST_MAIN $FILE4 --layout dset2:CHUNK=20x10 -VERIFY_LAYOUT_DSET $FILE4 dset2 CHUNKED +TOOLTEST_MAIN h5repack_layout.h5 --layout dset2:CHUNK=20x10 +VERIFY_LAYOUT_DSET h5repack_layout.h5 dset2 CHUNKED -TOOLTEST_MAIN $FILE4 -l CHUNK=20x10 -VERIFY_LAYOUT_ALL $FILE4 CHUNKED +TOOLTEST_MAIN h5repack_layout.h5 -l CHUNK=20x10 +VERIFY_LAYOUT_ALL h5repack_layout.h5 CHUNKED -TOOLTEST_MAIN $FILE4 -l dset2:CONTI -VERIFY_LAYOUT_DSET $FILE4 dset2 CONTIGUOUS +TOOLTEST_MAIN h5repack_layout.h5 -l dset2:CONTI +VERIFY_LAYOUT_DSET h5repack_layout.h5 dset2 CONTIGUOUS -TOOLTEST_MAIN $FILE4 -l CONTI -VERIFY_LAYOUT_ALL $FILE4 CONTIGUOUS +TOOLTEST_MAIN h5repack_layout.h5 -l CONTI +VERIFY_LAYOUT_ALL h5repack_layout.h5 CONTIGUOUS -TOOLTEST_MAIN $FILE4 -l dset2:COMPA -VERIFY_LAYOUT_DSET $FILE4 dset2 COMPACT +TOOLTEST_MAIN h5repack_layout.h5 -l dset2:COMPA +VERIFY_LAYOUT_DSET h5repack_layout.h5 dset2 COMPACT -TOOLTEST_MAIN $FILE4 -l COMPA -VERIFY_LAYOUT_ALL $FILE4 COMPACT +TOOLTEST_MAIN h5repack_layout.h5 -l COMPA +VERIFY_LAYOUT_ALL h5repack_layout.h5 COMPACT ################################################################ # layout conversions (file has no filters) ############################################################### -TOOLTEST_MAIN $FILE4 -l dset_compact:CONTI -VERIFY_LAYOUT_DSET $FILE4 dset_compact CONTIGUOUS +TOOLTEST_MAIN h5repack_layout.h5 -l dset_compact:CONTI +VERIFY_LAYOUT_DSET h5repack_layout.h5 dset_compact CONTIGUOUS -TOOLTEST_MAIN $FILE4 -l dset_compact:CHUNK=2x5 -VERIFY_LAYOUT_DSET $FILE4 dset_compact CHUNKED +TOOLTEST_MAIN h5repack_layout.h5 -l dset_compact:CHUNK=2x5 +VERIFY_LAYOUT_DSET h5repack_layout.h5 dset_compact CHUNKED -TOOLTEST_MAIN $FILE4 -l dset_compact:COMPA -VERIFY_LAYOUT_DSET $FILE4 dset_compact COMPACT +TOOLTEST_MAIN h5repack_layout.h5 -l dset_compact:COMPA +VERIFY_LAYOUT_DSET h5repack_layout.h5 dset_compact COMPACT -TOOLTEST_MAIN $FILE4 -l dset_contiguous:COMPA -VERIFY_LAYOUT_DSET $FILE4 dset_contiguous COMPACT +TOOLTEST_MAIN h5repack_layout.h5 -l dset_contiguous:COMPA +VERIFY_LAYOUT_DSET h5repack_layout.h5 dset_contiguous COMPACT -TOOLTEST_MAIN $FILE4 -l dset_contiguous:CHUNK=3x6 -VERIFY_LAYOUT_DSET $FILE4 dset_contiguous CHUNKED +TOOLTEST_MAIN h5repack_layout.h5 -l dset_contiguous:CHUNK=3x6 +VERIFY_LAYOUT_DSET h5repack_layout.h5 dset_contiguous CHUNKED -TOOLTEST_MAIN $FILE4 -l dset_contiguous:CONTI -VERIFY_LAYOUT_DSET $FILE4 dset_contiguous CONTIGUOUS +TOOLTEST_MAIN h5repack_layout.h5 -l dset_contiguous:CONTI +VERIFY_LAYOUT_DSET h5repack_layout.h5 dset_contiguous CONTIGUOUS -TOOLTEST_MAIN $FILE4 -l dset_chunk:COMPA -VERIFY_LAYOUT_DSET $FILE4 dset_chunk COMPACT +TOOLTEST_MAIN h5repack_layout.h5 -l dset_chunk:COMPA +VERIFY_LAYOUT_DSET h5repack_layout.h5 dset_chunk COMPACT -TOOLTEST_MAIN $FILE4 -l dset_chunk:CONTI -VERIFY_LAYOUT_DSET $FILE4 dset_chunk CONTIGUOUS +TOOLTEST_MAIN h5repack_layout.h5 -l dset_chunk:CONTI +VERIFY_LAYOUT_DSET h5repack_layout.h5 dset_chunk CONTIGUOUS -TOOLTEST_MAIN $FILE4 -l dset_chunk:CHUNK=18x13 -VERIFY_LAYOUT_DSET $FILE4 dset_chunk CHUNKED +TOOLTEST_MAIN h5repack_layout.h5 -l dset_chunk:CHUNK=18x13 +VERIFY_LAYOUT_DSET h5repack_layout.h5 dset_chunk CHUNKED # test convert small size dataset ( < 1k) to compact layout without -m -TOOLTEST_MAIN $FILE18 -l contig_small:COMPA -VERIFY_LAYOUT_DSET $FILE18 contig_small COMPACT +TOOLTEST_MAIN h5repack_layout2.h5 -l contig_small:COMPA +VERIFY_LAYOUT_DSET h5repack_layout2.h5 contig_small COMPACT -TOOLTEST_MAIN $FILE18 -l chunked_small_fixed:COMPA -VERIFY_LAYOUT_DSET $FILE18 chunked_small_fixed COMPACT +TOOLTEST_MAIN h5repack_layout2.h5 -l chunked_small_fixed:COMPA +VERIFY_LAYOUT_DSET h5repack_layout2.h5 chunked_small_fixed COMPACT # Native option # 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 +TOOLTEST h5repack_fill.h5 -n +TOOLTEST h5repack_attr.h5 -n # latest file format with long switches. use FILE4=h5repack_layout.h5 (no filters) -arg="$FILE4 --layout CHUNK=20x10 --filter GZIP=1 --minimum=10 --native --latest --compact=8 --indexed=6 --ssize=8[:dtype]" +arg="h5repack_layout.h5 --layout CHUNK=20x10 --filter GZIP=1 --minimum=10 --native --latest --compact=8 --indexed=6 --ssize=8[:dtype]" if test $USE_FILTER_DEFLATE != "yes" ; then SKIP $arg else TOOLTEST_MAIN $arg - VERIFY_LAYOUT_ALL $FILE4 CHUNKED + VERIFY_LAYOUT_ALL h5repack_layout.h5 CHUNKED fi # latest file format with short switches. use FILE4=h5repack_layout.h5 (no filters) -arg="$FILE4 -l CHUNK=20x10 -f GZIP=1 -m 10 -n -L -c 8 -d 6 -s 8[:dtype]" +arg="h5repack_layout.h5 -l CHUNK=20x10 -f GZIP=1 -m 10 -n -L -c 8 -d 6 -s 8[:dtype]" if test $USE_FILTER_DEFLATE != "yes" ; then SKIP $arg else TOOLTEST_MAIN $arg - VERIFY_LAYOUT_ALL $FILE4 CHUNKED + VERIFY_LAYOUT_ALL h5repack_layout.h5 CHUNKED fi # several global filters -arg="$FILE4 --filter GZIP=1 --filter SHUF" +arg="h5repack_layout.h5 --filter GZIP=1 --filter SHUF" if test $USE_FILTER_DEFLATE != "yes" -o $USE_FILTER_SHUFFLE != "yes" ; then SKIP $arg else @@ -699,7 +766,7 @@ fi # syntax of -i infile -o outfile # latest file format with short switches. use FILE4=h5repack_layout.h5 (no filters) -arg="$FILE4 -l CHUNK=20x10 -f GZIP=1 -m 10 -n -L -c 8 -d 6 -s 8[:dtype]" +arg="h5repack_layout.h5 -l CHUNK=20x10 -f GZIP=1 -m 10 -n -L -c 8 -d 6 -s 8[:dtype]" if test $USE_FILTER_DEFLATE != "yes" ; then SKIP $arg else @@ -707,34 +774,40 @@ else fi # add a userblock to file -arg="$FILE1 -u ublock.bin -b 2048" +arg="h5repack_objs.h5 -u ublock.bin -b 2048" TOOLTEST $arg # add alignment -arg="$FILE1 -t 1 -a 1 " +arg="h5repack_objs.h5 -t 1 -a 1 " TOOLTEST $arg # Check repacking file with old version of layout message (should get upgraded # to new version and be readable, etc.) -TOOLTEST $FILE14 +TOOLTEST h5repack_layouto.h5 # test for datum size > H5TOOLS_MALLOCSIZE -TOOLTEST $FILE1 -f GZIP=1 +TOOLTEST h5repack_objs.h5 -f GZIP=1 # Check repacking file with committed datatypes in odd configurations -TOOLTEST $FILE15 +TOOLTEST h5repack_named_dtypes.h5 # tests family driver (file is located in common testfiles folder, uses TOOLTEST1 -TOOLTEST1 $FILE16 +TOOLTEST1 tfamily%05d.h5 # test various references (bug 1814 and 1726) -TOOLTEST $FILE_REF +TOOLTEST h5repack_refs.h5 -# test attribute with various references (bug 1797) +# test attribute with various references (bug1797 / HDFFV-5932) # the references in attribute of compund or vlen datatype -# TODO: include this test when code portion is completed. -SKIP $FILE_ATTR_REF -#TOOLTEST $FILE_ATTR_REF +TOOLTEST h5repack_attr_refs.h5 + + +# Add test for memory leak in attirbute. This test is verified by CTEST. +# 1. leak from vlen string +# 2. leak from compound type without reference member +# (HDFFV-7840, ) +# Note: this test is experimental for sharing test file among tools +TOOLTEST h5diff_attr1.h5 if test $nerrors -eq 0 ; then echo "All $TESTNAME tests passed." diff --git a/tools/h5repack/h5repack_copy.c b/tools/h5repack/h5repack_copy.c index 5153cc4..55cf932 100644 --- a/tools/h5repack/h5repack_copy.c +++ b/tools/h5repack/h5repack_copy.c @@ -31,18 +31,45 @@ * macros *------------------------------------------------------------------------- */ -#define USERBLOCK_XFER_SIZE 512 /* size of buffer/# of bytes to xfer at a time when copying userblock */ +/* size of buffer/# of bytes to xfer at a time when copying userblock */ +#define USERBLOCK_XFER_SIZE 512 + +/* check H5Dread()/H5Dwrite() error, e.g. memory allocation error inside the library. */ +#define CHECK_H5DRW_ERROR(_fun, _did, _mtid, _msid, _fsid, _pid, _buf) { \ + H5E_BEGIN_TRY { \ + if(_fun(_did, _mtid, _msid, _fsid, _pid, _buf) < 0) { \ + int _err_num = 0; \ + char _msg[80]; \ + H5Ewalk2(H5E_DEFAULT, H5E_WALK_DOWNWARD, walk_error_callback, &_err_num); \ + H5Eget_msg(_err_num, NULL, _msg, 80); \ + error_msg("%s %s -- %s\n", #_fun, "failed", _msg); \ + goto error; \ + } \ + } H5E_END_TRY; \ +} + /*------------------------------------------------------------------------- * local functions *------------------------------------------------------------------------- */ +static int Get_hyperslab (hid_t dcpl_id, int rank_dset, hsize_t dims_dset[], size_t size_datum, hsize_t dims_hslab[], hsize_t * hslab_nbytes_p); 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_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 +static herr_t walk_error_callback(unsigned n, const H5E_error2_t *err_desc, void *udata); + +/* get the major number from the error stack. */ +static herr_t walk_error_callback(UNUSED unsigned n, const H5E_error2_t *err_desc, void *udata) +{ + if (err_desc) + *((int *)udata) = err_desc->maj_num; + + return 0; +} /*------------------------------------------------------------------------- * Function: copy_objects @@ -105,23 +132,23 @@ int copy_objects(const char* fnamein, goto out; } - if(!options->fs_strategy) - { - if(H5Pget_file_space(fcpl_in, &options->fs_strategy, NULL) < 0) - { - error_msg("failed to retrieve file space strategy\n"); - goto out; - } - } - - if(!options->fs_threshold) - { - if(H5Pget_file_space(fcpl_in, NULL, &options->fs_threshold) < 0) - { - error_msg("failed to retrieve file space threshold\n"); - goto out; - } - } + if(!options->fs_strategy) + { + if(H5Pget_file_space(fcpl_in, &options->fs_strategy, NULL) < 0) + { + error_msg("failed to retrieve file space strategy\n"); + goto out; + } + } + + if(!options->fs_threshold) + { + if(H5Pget_file_space(fcpl_in, NULL, &options->fs_threshold) < 0) + { + error_msg("failed to retrieve file space threshold\n"); + goto out; + } + } if(H5Pclose(fcpl_in) < 0) { @@ -322,28 +349,28 @@ int copy_objects(const char* fnamein, /* either use the FCPL already created or create a new one */ if(fcpl != H5P_DEFAULT) { - /* set file space strategy and free space threshold */ - if(H5Pset_file_space(fcpl, options->fs_strategy, options->fs_threshold) < 0) - { - error_msg("failed to set file space strategy & threshold\n"); - goto out; - } + /* set file space strategy and free space threshold */ + if(H5Pset_file_space(fcpl, options->fs_strategy, options->fs_threshold) < 0) + { + error_msg("failed to set file space strategy & threshold\n"); + goto out; + } } else { - /* create a file creation property list */ - if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) - { - error_msg("fail to create a file creation property list\n"); - goto out; - } - - /* set file space strategy and free space threshold */ - if(H5Pset_file_space(fcpl, options->fs_strategy, options->fs_threshold) < 0) - { - error_msg("failed to set file space strategy & threshold \n"); - goto out; - } + /* create a file creation property list */ + if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) + { + error_msg("fail to create a file creation property list\n"); + goto out; + } + + /* set file space strategy and free space threshold */ + if(H5Pset_file_space(fcpl, options->fs_strategy, options->fs_threshold) < 0) + { + error_msg("failed to set file space strategy & threshold \n"); + goto out; + } } /*------------------------------------------------------------------------- @@ -465,6 +492,184 @@ out: } /*------------------------------------------------------------------------- +* Function: Get_hyperslab +* +* Purpose: Calulate a hyperslab from a dataset for higher performance. +* The size of hyperslab is limitted by H5TOOLS_BUFSIZE. +* Return the hyperslab dimentions and size in byte. +* +* Return: 0 - SUCCEED, -1 FAILED +* +* Parameters: +* dcpl_id : [IN] dataset creation property. +* rank_dset : [IN] dataset rank +* dims_dset[] : [IN] dataset dimentions +* size_datum : [IN] size of a data element in byte +* dims_hslab[] : [OUT] calculated hyperslab dimentions +* * hslab_nbytes_p : [OUT] total byte of the hyperslab +* +* Programmer: Jonathan Kim +* Date: Feburary, 2012 +* Update: +* The hyperslab calucation would be depend on if the dataset is chunked +* or not. +* +* There care 3 conditions to cover: +* 1. If chunked and a chunk fits in buffer, each chunk would be a unit of +* collection and the boundary would be dataset's dims. +* 2. If chunked but a chunk doesn't fit in buffer, each data element would +* be a unit of collection and the boundary would be the chunk itself. +* 3. If not chunked, each data element would be a unit of collection and +* the boundary would be dataset's dims. +* +* The calulation starts from the last dimention (h5dump dims output). +* +* Note: +* Added for JIRA HDFFV-7862. +*-----------------------------------------*/ + +int Get_hyperslab (hid_t dcpl_id, int rank_dset, hsize_t dims_dset[], + size_t size_datum, + hsize_t dims_hslab[], hsize_t * hslab_nbytes_p) +{ + int status = 0; + int k; + H5D_layout_t dset_layout; + int rank_chunk; + hsize_t dims_chunk[H5S_MAX_RANK]; + hsize_t size_chunk=1; + hsize_t nchunk_fit; /* number of chunks that fits in hyperslab buffer (H5TOOLS_BUFSIZE) */ + hsize_t ndatum_fit; /* number of dataum that fits in hyperslab buffer (H5TOOLS_BUFSIZE) */ + hsize_t chunk_dims_map[H5S_MAX_RANK]; /* mapped chunk dimentions */ + hsize_t hs_dims_map[H5S_MAX_RANK]; /* mapped hyperslab dimentions */ + hsize_t hslab_nbytes; /* size of hyperslab in byte */ + + /* init to set as size of a data element */ + hslab_nbytes = size_datum; + + /* get layout of dataset */ + dset_layout = H5Pget_layout(dcpl_id); + + /* if dataset is chunked */ + if ( dset_layout == H5D_CHUNKED ) + { + /* get chunk dims */ + rank_chunk = H5Pget_chunk(dcpl_id, rank_dset, dims_chunk); + if (rank_chunk < 0) + { + status = -1; + goto out; + } + + for (k = rank_dset; k > 0; --k) + size_chunk *= dims_chunk[k-1]; + + /* figure out how many chunks can fit in the hyperslab buffer */ + nchunk_fit = (H5TOOLS_BUFSIZE / size_datum) / size_chunk; + + + /* 1. if a chunk fit in hyperslab buffer */ + if (nchunk_fit >= 1) + { + /* Calulate a hyperslab that contains as many chunks that can fit + * in hyperslab buffer. Hyperslab will be increased starting from + * the last dimention of the dataset (see h5dump's dims output). + * The calculation boundary is dataset dims. + * In the loop, used mapping from a datum to a chunk to figure out + * chunk based hyperslab. + */ + for (k = rank_dset; k > 0; --k) + { + /* map dataset dimentions with a chunk dims */ + chunk_dims_map[k-1]= dims_dset[k-1] / dims_chunk[k-1]; + + /* if reminder exist, increse by 1 to cover partial edge chunks */ + if (dims_dset[k-1] % dims_chunk[k-1] > 0) + chunk_dims_map[k-1]++; + + /* get mapped hyperslab dims */ + hs_dims_map[k-1] = MIN (nchunk_fit, chunk_dims_map[k-1]); + + /* prepare next round */ + nchunk_fit = nchunk_fit / chunk_dims_map[k-1]; + /* if a chunk is bigger than the rest of buffer */ + if (nchunk_fit == 0) + nchunk_fit=1; + + /* get hyperslab dimentions as unmapping to actual size */ + dims_hslab[k-1] = MIN( (hs_dims_map[k-1] * dims_chunk[k-1]), dims_dset[k-1]); + + /* calculate total size for the hyperslab */ + hslab_nbytes *= dims_hslab[k-1]; + } + } + /* 2. if a chunk is bigger than hyperslab buffer */ + else + { + /* Calulate a hyperslab that contains as many data elements that + * can fit in hyperslab buffer. Hyperslab will be increased + * starting from the last dimention of the chunk (see h5dump's dims + * output). + * The calculation boundary is a chunk dims. + */ + for (k = rank_dset; k > 0; --k) + { + ndatum_fit = H5TOOLS_BUFSIZE / hslab_nbytes; + + /* if a datum is bigger than rest of buffer */ + if ( ndatum_fit == 0) + ndatum_fit = 1; + /* get hyperslab dimentions within a chunk boundary */ + dims_hslab[k - 1] = MIN (dims_chunk[k-1], ndatum_fit); + + /* calculate total size for the hyperslab */ + hslab_nbytes *= dims_hslab[k - 1]; + + if (hslab_nbytes <= 0) + { + status = -1; + goto out; + } + } + } + } + /* 3. if dataset is not chunked */ + else + { + /* Calulate a hyperslab that contains as many data elements that can + * fit in hyperslab buffer. Hyperslab will be increased starting from + * the last dimention of the dataset (see h5dump's dims output). + * The calculation boundary is dataset dims. + */ + for (k = rank_dset; k > 0; --k) + { + ndatum_fit = H5TOOLS_BUFSIZE / hslab_nbytes; + + /* if a datum is bigger than rest of buffer */ + if ( ndatum_fit == 0) + ndatum_fit = 1; + /* get hyperslab dimentions within dataset boundary */ + dims_hslab[k - 1] = MIN(dims_dset[k - 1], ndatum_fit); + + /* calculate total size for the hyperslab */ + hslab_nbytes *= dims_hslab[k - 1]; + + if (hslab_nbytes <= 0) + { + status = -1; + goto out; + } + } + } + + /* pass out the hyperslab size*/ + *hslab_nbytes_p = hslab_nbytes; + +out: + return status; +} + +/*------------------------------------------------------------------------- * Function: do_copy_objects * * Purpose: duplicate all HDF5 objects in the file @@ -531,6 +736,30 @@ out: * * May, 1, 2008: Add a printing of the compression ratio of old size / new size * +* Feburary 2012: improve Read/Write by hyperslabs for big datasets. +* Programmer: Jonathan Kim +* +* A threshold of H5TOOLS_MALLOCSIZE 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_dataset ) +* H5Dwrite( output_dataset ) +* +* with all elements in the datasets selected. If the memory needed is greater than +* H5TOOLS_MALLOCSIZE, then the following operations are done instead: +* +* 1. figure out a hyperslab (dimentions) and size (refer to Get_hyperslab()). +* 2. Calculate the hyperslab selections as the selection is moving forward. +* Selection would be same as the hyperslab except for the remaining edge portion +* of the dataset. The code take care of the remaining portion if exist. +* *------------------------------------------------------------------------- */ @@ -547,7 +776,7 @@ int do_copy_objects(hid_t fidin, 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 */ + hid_t dcpl_in = -1; /* dataset creation property list ID */ hid_t dcpl_out = -1; /* dataset creation property list ID */ hid_t f_space_id = -1; /* file space ID */ hid_t ftype_id = -1; /* file type ID */ @@ -563,7 +792,7 @@ int do_copy_objects(hid_t fidin, int apply_s; /* flag for apply filter to small dataset sizes */ int apply_f; /* flag for apply filter to return error on H5Dcreate */ void *buf=NULL; /* buffer for raw data */ - void *sm_buf=NULL; /* buffer for raw data */ + void *hslab_buf=NULL; /* hyperslab 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 */ @@ -572,6 +801,7 @@ int do_copy_objects(hid_t fidin, int is_ref=0; htri_t is_named; + /*------------------------------------------------------------------------- * copy the suppplied object list *------------------------------------------------------------------------- @@ -592,7 +822,7 @@ int do_copy_objects(hid_t fidin, { case H5TRAV_TYPE_UNKNOWN: - assert(0); + HDassert(0); break; /*------------------------------------------------------------------------- * H5TRAV_TYPE_GROUP @@ -734,9 +964,9 @@ int do_copy_objects(hid_t fidin, goto error; if((ftype_id = H5Dget_type(dset_in)) < 0) goto error; - if((dcpl_id = H5Dget_create_plist(dset_in)) < 0) + if((dcpl_in = H5Dget_create_plist(dset_in)) < 0) goto error; - if((dcpl_out = H5Pcopy(dcpl_id)) < 0) + if((dcpl_out = H5Pcopy(dcpl_in)) < 0) goto error; if((rank = H5Sget_simple_extent_ndims(f_space_id)) < 0) goto error; @@ -769,7 +999,7 @@ int do_copy_objects(hid_t fidin, * 2) the internal filters might be turned off *------------------------------------------------------------------------- */ - if (h5tools_canreadf((travt->objs[i].name),dcpl_id)==1) + if (h5tools_canreadf((travt->objs[i].name),dcpl_in)==1) { apply_s=1; apply_f=1; @@ -808,6 +1038,11 @@ int do_copy_objects(hid_t fidin, goto error; } + /* unset the unlimimted dimensions, which cannot be applied to layout other than chunked. */ + if (options->layout_g != H5D_CHUNKED) { + H5Sset_extent_simple( f_space_id, rank, dims, NULL ); + } + /*------------------------------------------------------------------------- * create the output dataset; * disable error checking in case the dataset cannot be created with the @@ -824,7 +1059,7 @@ int do_copy_objects(hid_t fidin, 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((dset_out = H5Dcreate2(fidout, travt->objs[i].name, wtype_id, f_space_id, H5P_DEFAULT, dcpl_in, H5P_DEFAULT)) < 0) goto error; apply_f = 0; } @@ -842,11 +1077,10 @@ int do_copy_objects(hid_t fidin, buf = HDmalloc(need); if(buf != NULL) { - 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; - + /* read/write: use the macro to check error, e.g. memory allocation error inside the library. */ + CHECK_H5DRW_ERROR(H5Dread, dset_in, wtype_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); + CHECK_H5DRW_ERROR(H5Dwrite, dset_out, wtype_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); + /* Check if we have VL data in the dataset's * datatype that must be reclaimed */ if(TRUE == H5Tdetect_class(wtype_id, H5T_VLEN)) @@ -856,102 +1090,108 @@ int do_copy_objects(hid_t fidin, else /* possibly not enough memory, read/write by hyperslabs */ { size_t p_type_nbytes = msize; /*size of memory type */ - hsize_t p_nelmts = nelmts; /*total selected elmts */ + hsize_t p_nelmts = nelmts; /*total elements */ 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 hslab_dims[H5S_MAX_RANK]; /*hyperslab dims */ + hsize_t hslab_nbytes; /*bytes per hyperslab */ + hsize_t hslab_nelmts; /*elements per hyperslab*/ + hid_t hslab_space; /*hyperslab data space */ + + /* hyperslab selection info */ + hsize_t hs_sel_offset[H5S_MAX_RANK];/* selection offset */ + hsize_t hs_sel_count[H5S_MAX_RANK]; /* selection count */ + hsize_t hs_select_nelmts; /* selected elements */ hsize_t zero[8]; /*vector of zeros */ int k; + H5D_layout_t dset_layout; + hid_t dcpl_tmp = -1; /* dataset creation property list ID */ /* 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) + /* check first if writing dataset is chunked, + * if so use its chunk layout for better performance. */ + dset_layout = H5Pget_layout(dcpl_out); + if (dset_layout == H5D_CHUNKED) + dcpl_tmp = dcpl_out; /* writing dataset */ + else /* if reading dataset is chunked */ { - 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); + dset_layout = H5Pget_layout(dcpl_in); + if (dset_layout == H5D_CHUNKED) + dcpl_tmp = dcpl_in; /* reading dataset */ } - sm_buf = HDmalloc((size_t)sm_nbytes); - sm_nelmts = sm_nbytes / p_type_nbytes; - sm_space = H5Screate_simple(1, &sm_nelmts, NULL); + /* get hyperslab dims and size in byte */ + if(Get_hyperslab(dcpl_tmp, rank, dims, p_type_nbytes, hslab_dims, &hslab_nbytes) < 0) + goto error; + + hslab_buf = HDmalloc((size_t)hslab_nbytes); + + hslab_nelmts = hslab_nbytes / p_type_nbytes; + hslab_space = H5Screate_simple(1, &hslab_nelmts, NULL); - /* the stripmine loop */ - memset(hs_offset, 0, sizeof hs_offset); - memset(zero, 0, sizeof zero); + /* the hyperslab selection loop */ + HDmemset(hs_sel_offset, 0, sizeof hs_sel_offset); + HDmemset(zero, 0, sizeof zero); - for (elmtno = 0; elmtno < p_nelmts; elmtno += hs_nelmts) + for (elmtno = 0; elmtno < p_nelmts; elmtno += hs_select_nelmts) { - /* calculate the hyperslab size */ if (rank > 0) { - for (k = 0, hs_nelmts = 1; k < rank; k++) + /* calculate the hyperslab selections. The selection would be same as the hyperslab except for remaining edge portion of the dataset which is smaller then the hyperslab. + */ + for (k = 0, hs_select_nelmts = 1; k < rank; k++) { - hs_size[k] = MIN(dims[k] - hs_offset[k], sm_size[k]); - hs_nelmts *= hs_size[k]; + /* MIN() is used to get the remaining edge portion if exist. + * "dims[k] - hs_sel_offset[k]" is remaining edge portion that is smaller then the hyperslab.*/ + hs_sel_count[k] = MIN(dims[k] - hs_sel_offset[k], hslab_dims[k]); + hs_select_nelmts *= hs_sel_count[k]; } - if (H5Sselect_hyperslab(f_space_id, H5S_SELECT_SET, hs_offset, NULL, hs_size, NULL) < 0) + if (H5Sselect_hyperslab(f_space_id, H5S_SELECT_SET, hs_sel_offset, NULL, hs_sel_count, NULL) < 0) goto error; - if (H5Sselect_hyperslab(sm_space, H5S_SELECT_SET, zero, NULL, &hs_nelmts, NULL) < 0) + if (H5Sselect_hyperslab(hslab_space, H5S_SELECT_SET, zero, NULL, &hs_select_nelmts, NULL) < 0) goto error; } else { H5Sselect_all(f_space_id); - H5Sselect_all(sm_space); - hs_nelmts = 1; + H5Sselect_all(hslab_space); + hs_select_nelmts = 1; } /* rank */ - /* 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; + /* read/write: use the macro to check error, e.g. memory allocation error inside the library. */ + CHECK_H5DRW_ERROR(H5Dread, dset_in, wtype_id, hslab_space, f_space_id, H5P_DEFAULT, hslab_buf); + CHECK_H5DRW_ERROR(H5Dwrite, dset_out, wtype_id, hslab_space, f_space_id, H5P_DEFAULT, hslab_buf); /* reclaim any VL memory, if necessary */ if(vl_data) - H5Dvlen_reclaim(wtype_id, sm_space, H5P_DEFAULT, sm_buf); + H5Dvlen_reclaim(wtype_id, hslab_space, H5P_DEFAULT, hslab_buf); /* 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; + hs_sel_offset[k - 1] += hs_sel_count[k - 1]; + /* if reached the end of a dim */ + if (hs_sel_offset[k - 1] == dims[k - 1]) + hs_sel_offset[k - 1] = 0; else carry = 0; } /* k */ } /* elmtno */ - H5Sclose(sm_space); + H5Sclose(hslab_space); /* free */ - if (sm_buf!=NULL) + if (hslab_buf!=NULL) { - HDfree(sm_buf); - sm_buf=NULL; + HDfree(hslab_buf); + hslab_buf=NULL; } } /* hyperslab read */ } /* if (nelmts>0 && space_status==H5D_SPACE_STATUS_NOT_ALLOCATED) */ @@ -977,7 +1217,7 @@ int do_copy_objects(hid_t fidin, 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_in,travt->objs[i].name,ratio,0); /* print a message that the filter was not applied (in case there was a filter) @@ -1016,7 +1256,7 @@ int do_copy_objects(hid_t fidin, goto error; if (H5Tclose(wtype_id) < 0) goto error; - if (H5Pclose(dcpl_id) < 0) + if (H5Pclose(dcpl_in) < 0) goto error; if (H5Pclose(dcpl_out) < 0) goto error; @@ -1171,7 +1411,7 @@ error: H5E_BEGIN_TRY { H5Gclose(grp_in); H5Gclose(grp_out); - H5Pclose(dcpl_id); + H5Pclose(dcpl_in); H5Pclose(gcpl_in); H5Pclose(gcpl_out); H5Sclose(f_space_id); @@ -1186,8 +1426,8 @@ error: /* free */ if (buf!=NULL) HDfree(buf); - if (sm_buf!=NULL) - HDfree(sm_buf); + if (hslab_buf!=NULL) + HDfree(hslab_buf); return -1; } @@ -1317,7 +1557,7 @@ copy_user_block(const char *infile, const char *outfile, hsize_t size) int status = 0; /* Return value */ /* User block must be any power of 2 equal to 512 or greater (512, 1024, 2048, etc.) */ - assert(size > 0); + HDassert(size > 0); /* Open files */ if((infid = HDopen(infile, O_RDONLY, 0)) < 0) { @@ -1359,13 +1599,13 @@ copy_user_block(const char *infile, const char *outfile, hsize_t size) status = -1; goto done; } /* end if */ - assert(nwritten > 0); - assert(nwritten <= nbytes); + HDassert(nwritten > 0); + HDassert(nwritten <= nbytes); /* Update # of bytes left & offset in buffer */ nbytes -= nwritten; wbuf += nwritten; - assert(nbytes == 0 || wbuf < (rbuf + USERBLOCK_XFER_SIZE)); + HDassert(nbytes == 0 || wbuf < (rbuf + USERBLOCK_XFER_SIZE)); } /* end while */ /* Update size of userblock left to transfer */ diff --git a/tools/h5repack/h5repack_filters.c b/tools/h5repack/h5repack_filters.c index 213ff65..6c7bc65 100644 --- a/tools/h5repack/h5repack_filters.c +++ b/tools/h5repack/h5repack_filters.c @@ -15,15 +15,16 @@ #include "h5repack.h" #include "h5tools.h" +#include "h5tools_utils.h" /* number of members in an array */ #ifndef NELMTS -# define NELMTS(X) (sizeof(X)/sizeof(X[0])) +# define NELMTS(X) (sizeof(X)/sizeof(X[0])) #endif /* minimum of two values */ #undef MIN -#define MIN(a,b) (((a)<(b)) ? (a) : (b)) +#define MIN(a,b) (((a)<(b)) ? (a) : (b)) /*------------------------------------------------------------------------- * Function: aux_find_obj @@ -329,7 +330,7 @@ int apply_filters(const char* name, /* object name from traverse list */ size = 1; sm_size[i - 1] = MIN(dims[i - 1], size); sm_nbytes *= sm_size[i - 1]; - assert(sm_nbytes > 0); + HDassert(sm_nbytes > 0); } diff --git a/tools/h5repack/h5repack_main.c b/tools/h5repack/h5repack_main.c index 6ec1647..a630559 100644 --- a/tools/h5repack/h5repack_main.c +++ b/tools/h5repack/h5repack_main.c @@ -13,6 +13,7 @@ * access to either file, you may request a copy from help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +#include "h5tools.h" #include "h5tools_utils.h" #include "h5repack.h" @@ -106,6 +107,13 @@ int main(int argc, const char **argv) h5tools_setprogname(PROGRAMNAME); h5tools_setstatus(EXIT_SUCCESS); + /* Initialize h5tools lib */ + h5tools_init(); + + /* update hyperslab buffer size from H5TOOLS_BUFSIZE env if exist */ + if ( h5tools_getenv_update_hyperslab_bufsize() < 0) + HDexit(EXIT_FAILURE); + /* initialize options */ h5repack_init(&options, 0, 0, 0, (hsize_t)0); @@ -124,7 +132,7 @@ int main(int argc, const char **argv) { error_msg("file names cannot be the same\n"); usage(h5tools_getprogname()); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } } @@ -133,7 +141,7 @@ int main(int argc, const char **argv) { error_msg("file names missing\n"); usage(h5tools_getprogname()); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } } @@ -316,10 +324,10 @@ void parse_command_line(int argc, const char **argv, pack_opt_t* options) case 'h': usage(h5tools_getprogname()); - exit(EXIT_SUCCESS); + HDexit(EXIT_SUCCESS); case 'V': print_version(h5tools_getprogname()); - exit(EXIT_SUCCESS); + HDexit(EXIT_SUCCESS); case 'v': options->verbose = 1; break; @@ -329,7 +337,7 @@ void parse_command_line(int argc, const char **argv, pack_opt_t* options) if (h5repack_addfilter( opt_arg, options)<0) { error_msg("in parsing filter\n"); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } break; case 'l': @@ -338,18 +346,18 @@ void parse_command_line(int argc, const char **argv, pack_opt_t* options) if (h5repack_addlayout( opt_arg, options)<0) { error_msg("in parsing layout\n"); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } break; case 'm': - options->min_comp = atoi( opt_arg ); + options->min_comp = HDatoi( opt_arg ); if ((int)options->min_comp<=0) { error_msg("invalid minimum compress size <%s>\n", opt_arg ); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } break; @@ -367,7 +375,7 @@ void parse_command_line(int argc, const char **argv, pack_opt_t* options) case 'c': - options->grp_compact = atoi( opt_arg ); + options->grp_compact = HDatoi( opt_arg ); if (options->grp_compact>0) options->latest = 1; /* must use latest format */ break; @@ -375,7 +383,7 @@ void parse_command_line(int argc, const char **argv, pack_opt_t* options) case 'd': - options->grp_indexed = atoi( opt_arg ); + options->grp_indexed = HDatoi( opt_arg ); if (options->grp_indexed>0) options->latest = 1; /* must use latest format */ break; @@ -390,7 +398,7 @@ void parse_command_line(int argc, const char **argv, pack_opt_t* options) options->latest = 1; /* must use latest format */ if (msgPtr == NULL) { - ssize = atoi( opt_arg ); + ssize = HDatoi( opt_arg ); for (idx=0; idx<5; idx++) options->msg_size[idx] = ssize; } @@ -399,7 +407,7 @@ void parse_command_line(int argc, const char **argv, pack_opt_t* options) char msgType[10]; HDstrcpy(msgType, msgPtr+1); msgPtr[0] = '\0'; - ssize = atoi( opt_arg ); + ssize = HDatoi( opt_arg ); if (HDstrncmp(msgType, "dspace",6) == 0) { options->msg_size[0] = ssize; } @@ -428,26 +436,26 @@ void parse_command_line(int argc, const char **argv, pack_opt_t* options) case 'b': - options->ublock_size = (hsize_t)atol( opt_arg ); + options->ublock_size = (hsize_t)HDatol( opt_arg ); break; case 't': - options->threshold = (hsize_t)atol( opt_arg ); + options->threshold = (hsize_t)HDatol( opt_arg ); break; case 'a': - options->alignment = atol( opt_arg ); + options->alignment = HDatol( opt_arg ); if ( options->alignment < 1 ) { error_msg("invalid alignment size\n", opt_arg ); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } break; case 'S': - { + { char strategy[MAX_NC_NAME]; HDstrcpy(strategy, opt_arg); @@ -461,14 +469,14 @@ void parse_command_line(int argc, const char **argv, pack_opt_t* options) options->fs_strategy = H5F_FILE_SPACE_VFD; else { error_msg("invalid file space management strategy\n", opt_arg ); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } break; } case 'T': - options->fs_threshold = (hsize_t)atol( opt_arg ); + options->fs_threshold = (hsize_t)HDatol( opt_arg ); break; } /* switch */ @@ -482,7 +490,7 @@ void parse_command_line(int argc, const char **argv, pack_opt_t* options) { error_msg("missing file names\n"); usage(h5tools_getprogname()); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } } @@ -513,9 +521,9 @@ void read_info(const char *filename, char c; int i, rc=1; - if ((fp = fopen(filename, "r")) == (FILE *)NULL) { + if ((fp = HDfopen(filename, "r")) == (FILE *)NULL) { error_msg("cannot open options file %s\n", filename); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } /* cycle until end of file reached */ @@ -536,7 +544,7 @@ void read_info(const char *filename, while( c!=' ' ) { fscanf(fp, "%c", &c); - if (feof(fp)) break; + if (HDfeof(fp)) break; } c='0'; /* go until end */ @@ -545,14 +553,14 @@ void read_info(const char *filename, fscanf(fp, "%c", &c); comp_info[i]=c; i++; - if (feof(fp)) break; + if (HDfeof(fp)) break; if (c==10 /*eol*/) break; } comp_info[i-1]='\0'; /*cut the last " */ if (h5repack_addfilter(comp_info,options)==-1){ error_msg("could not add compression option\n"); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } } /*------------------------------------------------------------------------- @@ -566,7 +574,7 @@ void read_info(const char *filename, while( c!=' ' ) { fscanf(fp, "%c", &c); - if (feof(fp)) break; + if (HDfeof(fp)) break; } c='0'; /* go until end */ @@ -575,14 +583,14 @@ void read_info(const char *filename, fscanf(fp, "%c", &c); comp_info[i]=c; i++; - if (feof(fp)) break; + if (HDfeof(fp)) break; if (c==10 /*eol*/) break; } comp_info[i-1]='\0'; /*cut the last " */ if (h5repack_addlayout(comp_info,options)==-1){ error_msg("could not add chunck option\n"); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } } /*------------------------------------------------------------------------- @@ -591,10 +599,10 @@ void read_info(const char *filename, */ else { error_msg("bad file format for %s", filename); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } } - fclose(fp); + HDfclose(fp); return; } diff --git a/tools/h5repack/h5repack_opttable.c b/tools/h5repack/h5repack_opttable.c index 57b5fa7..d0fcff3 100644 --- a/tools/h5repack/h5repack_opttable.c +++ b/tools/h5repack/h5repack_opttable.c @@ -14,6 +14,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "h5repack.h" +#include "h5tools.h" #include "h5tools_utils.h" /*------------------------------------------------------------------------- @@ -120,7 +121,7 @@ static int aux_inctable(pack_opttbl_t *table, int n_objs ) unsigned int i; table->size += n_objs; - table->objs = (pack_info_t*)realloc(table->objs, table->size * sizeof(pack_info_t)); + table->objs = (pack_info_t*)HDrealloc(table->objs, table->size * sizeof(pack_info_t)); if (table->objs==NULL) { error_msg("not enough memory for options table\n"); return -1; @@ -147,7 +148,7 @@ int options_table_init( pack_opttbl_t **tbl ) unsigned int i; pack_opttbl_t *table; - if(NULL == (table = (pack_opttbl_t *)malloc(sizeof(pack_opttbl_t)))) + if(NULL == (table = (pack_opttbl_t *)HDmalloc(sizeof(pack_opttbl_t)))) { error_msg("not enough memory for options table\n"); return -1; @@ -155,10 +156,10 @@ int options_table_init( pack_opttbl_t **tbl ) table->size = 30; table->nelems = 0; - if(NULL == (table->objs = (pack_info_t*)malloc(table->size * sizeof(pack_info_t)))) + if(NULL == (table->objs = (pack_info_t*)HDmalloc(table->size * sizeof(pack_info_t)))) { error_msg("not enough memory for options table\n"); - free(table); + HDfree(table); return -1; } @@ -182,8 +183,8 @@ int options_table_init( pack_opttbl_t **tbl ) int options_table_free( pack_opttbl_t *table ) { - free(table->objs); - free(table); + HDfree(table->objs); + HDfree(table); return 0; } @@ -229,7 +230,7 @@ int options_add_layout( obj_list_t *obj_list, if (table->objs[i].chunk.rank>0) { error_msg("chunk information already inserted for <%s>\n",obj_list[j].obj); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } /* insert the layout info */ else diff --git a/tools/h5repack/h5repack_parse.c b/tools/h5repack/h5repack_parse.c index d3c6014..70eadd2 100644 --- a/tools/h5repack/h5repack_parse.c +++ b/tools/h5repack/h5repack_parse.c @@ -14,6 +14,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "h5repack.h" +#include "h5tools.h" #include "h5tools_utils.h" /*------------------------------------------------------------------------- @@ -52,7 +53,7 @@ obj_list_t* parse_filter(const char *str, { unsigned i, u; char c; - size_t len=strlen(str); + size_t len=HDstrlen(str); int j, m, n, k, l, end_obj=-1, no_param=0; char sobj[MAX_NC_NAME]; char scomp[10]; @@ -63,7 +64,7 @@ obj_list_t* parse_filter(const char *str, /* initialize compression info */ - memset(filt,0,sizeof(filter_info_t)); + HDmemset(filt,0,sizeof(filter_info_t)); *is_glb = 0; /* check for the end of object list and number of objects */ @@ -88,7 +89,7 @@ obj_list_t* parse_filter(const char *str, } n++; - obj_list = (obj_list_t*) malloc(n*sizeof(obj_list_t)); + obj_list = (obj_list_t*) HDmalloc(n*sizeof(obj_list_t)); if (obj_list==NULL) { error_msg("could not allocate object list\n"); @@ -105,7 +106,7 @@ obj_list_t* parse_filter(const char *str, { if ( c==',') sobj[k]='\0'; else sobj[k+1]='\0'; HDstrcpy(obj_list[n].obj,sobj); - memset(sobj,0,sizeof(sobj)); + HDmemset(sobj,0,sizeof(sobj)); n++; k=-1; } @@ -113,9 +114,9 @@ obj_list_t* parse_filter(const char *str, /* nothing after : */ if (end_obj+1==(int)len) { - if (obj_list) free(obj_list); + if (obj_list) HDfree(obj_list); error_msg("input Error: Invalid compression type in <%s>\n",str); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } @@ -151,9 +152,9 @@ obj_list_t* parse_filter(const char *str, } c = str[u]; if (!isdigit(c) && l==-1){ - if (obj_list) free(obj_list); + if (obj_list) HDfree(obj_list); error_msg("compression parameter not digit in <%s>\n",str); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } if (l==-1) stype[m]=c; @@ -173,7 +174,7 @@ obj_list_t* parse_filter(const char *str, else { error_msg("szip mask must be 'NN' or 'EC' \n"); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } @@ -211,9 +212,9 @@ obj_list_t* parse_filter(const char *str, } c = str[u]; if (!isdigit(c) && l==-1){ - if (obj_list) free(obj_list); + if (obj_list) HDfree(obj_list); error_msg("compression parameter is not a digit in <%s>\n",str); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } if (l==-1) stype[m]=c; @@ -233,7 +234,7 @@ obj_list_t* parse_filter(const char *str, else { error_msg("scale type must be 'IN' or 'DS' \n"); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } } @@ -255,9 +256,9 @@ obj_list_t* parse_filter(const char *str, { c = str[u]; if (!isdigit(c)){ - if (obj_list) free(obj_list); + if (obj_list) HDfree(obj_list); error_msg("compression parameter is not a digit in <%s>\n",str); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } stype[m]=c; } /* u */ @@ -301,9 +302,9 @@ obj_list_t* parse_filter(const char *str, filt->cd_nelmts = 1; if (no_param) { /*no more parameters, GZIP must have parameter */ - if (obj_list) free(obj_list); + if (obj_list) HDfree(obj_list); error_msg("missing compression parameter in <%s>\n",str); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } } @@ -317,9 +318,9 @@ obj_list_t* parse_filter(const char *str, filt->cd_nelmts = 2; if (no_param) { /*no more parameters, SZIP must have parameter */ - if (obj_list) free(obj_list); + if (obj_list) HDfree(obj_list); error_msg("missing compression parameter in <%s>\n",str); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } } @@ -333,9 +334,9 @@ obj_list_t* parse_filter(const char *str, filt->cd_nelmts = 0; if (m>0) { /*shuffle does not have parameter */ - if (obj_list) free(obj_list); + if (obj_list) HDfree(obj_list); error_msg("extra parameter in SHUF <%s>\n",str); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } } /*------------------------------------------------------------------------- @@ -348,9 +349,9 @@ obj_list_t* parse_filter(const char *str, filt->cd_nelmts = 0; if (m>0) { /*shuffle does not have parameter */ - if (obj_list) free(obj_list); + if (obj_list) HDfree(obj_list); error_msg("extra parameter in FLET <%s>\n",str); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } } /*------------------------------------------------------------------------- @@ -363,9 +364,9 @@ obj_list_t* parse_filter(const char *str, filt->cd_nelmts = 0; if (m>0) { /*nbit does not have parameter */ - if (obj_list) free(obj_list); + if (obj_list) HDfree(obj_list); error_msg("extra parameter in NBIT <%s>\n",str); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } } /*------------------------------------------------------------------------- @@ -378,15 +379,15 @@ obj_list_t* parse_filter(const char *str, filt->cd_nelmts = 2; if (no_param) { /*no more parameters, SOFF must have parameter */ - if (obj_list) free(obj_list); + if (obj_list) HDfree(obj_list); error_msg("missing compression parameter in <%s>\n",str); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } } else { - if (obj_list) free(obj_list); + if (obj_list) HDfree(obj_list); error_msg("invalid filter type in <%s>\n",str); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } } } /*i*/ @@ -407,9 +408,9 @@ obj_list_t* parse_filter(const char *str, case H5Z_FILTER_DEFLATE: if (filt->cd_values[0]>9 ) { - if (obj_list) free(obj_list); + if (obj_list) HDfree(obj_list); error_msg("invalid compression parameter in <%s>\n",str); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } break; @@ -422,21 +423,21 @@ obj_list_t* parse_filter(const char *str, pixels_per_block=filt->cd_values[0]; if ((pixels_per_block%2)==1) { - if (obj_list) free(obj_list); + if (obj_list) HDfree(obj_list); error_msg("pixels_per_block is not even in <%s>\n",str); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } if (pixels_per_block>H5_SZIP_MAX_PIXELS_PER_BLOCK) { - if (obj_list) free(obj_list); + if (obj_list) HDfree(obj_list); error_msg("pixels_per_block is too large in <%s>\n",str); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } if ( (HDstrcmp(smask,"NN")!=0) && (HDstrcmp(smask,"EC")!=0) ) { - if (obj_list) free(obj_list); + if (obj_list) HDfree(obj_list); error_msg("szip mask must be 'NN' or 'EC' \n"); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } break; default: @@ -479,16 +480,16 @@ obj_list_t* parse_layout(const char *str, obj_list_t* obj_list=NULL; unsigned i; char c; - size_t len=strlen(str); + size_t len=HDstrlen(str); int j, n, k, end_obj=-1, c_index; char sobj[MAX_NC_NAME]; char sdim[10]; char slayout[10]; - memset(sdim, '\0', sizeof(sdim)); - memset(sobj, '\0', sizeof(sobj)); - memset(slayout, '\0', sizeof(slayout)); + HDmemset(sdim, '\0', sizeof(sdim)); + HDmemset(sobj, '\0', sizeof(sobj)); + HDmemset(slayout, '\0', sizeof(slayout)); /* check for the end of object list and number of objects */ for ( i=0, n=0; i\n",str); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } /* get layout info */ @@ -554,7 +555,7 @@ obj_list_t* parse_layout(const char *str, pack->layout=H5D_CHUNKED; else { error_msg("in parse layout, not a valid layout in <%s>\n",str); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } } else @@ -576,9 +577,9 @@ obj_list_t* parse_layout(const char *str, if (j>(int)len) { - if (obj_list) free(obj_list); + if (obj_list) HDfree(obj_list); error_msg("in parse layout, <%s> Chunk dimensions missing\n",str); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } for ( i=j, c_index=0; i Not a valid character in <%s>\n", sdim,str); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } if ( c=='x' || i==len-1) @@ -603,10 +604,10 @@ obj_list_t* parse_layout(const char *str, k=0; pack->chunk.chunk_lengths[c_index]=atoi(sdim); if (pack->chunk.chunk_lengths[c_index]==0) { - if (obj_list) free(obj_list); + if (obj_list) HDfree(obj_list); error_msg("in parse layout, <%s> conversion to number in <%s>\n", sdim,str); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } c_index++; } @@ -621,10 +622,10 @@ obj_list_t* parse_layout(const char *str, { pack->chunk.chunk_lengths[c_index]=atoi(sdim); if (pack->chunk.chunk_lengths[c_index]==0){ - if (obj_list) free(obj_list); + if (obj_list) HDfree(obj_list); error_msg("in parse layout, <%s> conversion to number in <%s>\n", sdim,str); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } pack->chunk.rank=c_index+1; } diff --git a/tools/h5repack/h5repack_refs.c b/tools/h5repack/h5repack_refs.c index 091133e..7108491 100644 --- a/tools/h5repack/h5repack_refs.c +++ b/tools/h5repack/h5repack_refs.c @@ -27,6 +27,8 @@ static const char* MapIdToName(hid_t refobj_id,trav_table_t *travt); static int copy_refs_attr(hid_t loc_in, hid_t loc_out, pack_opt_t *options, trav_table_t *travt, hid_t fidout); +static herr_t update_ref_value(hid_t obj_id, H5R_type_t ref_type, void *ref_in, + hid_t fid_out, void *ref_out, trav_table_t *travt); /*------------------------------------------------------------------------- * Function: do_copy_refobjs @@ -178,7 +180,7 @@ int do_copy_refobjs(hid_t fidin, } /* end if */ for(u = 0; u < nelmts; u++) { H5E_BEGIN_TRY { - if((refobj_id = H5Rdereference(dset_in, H5R_OBJECT, &buf[u])) < 0) + if((refobj_id = H5Rdereference2(dset_in, H5P_DEFAULT, H5R_OBJECT, &buf[u])) < 0) continue; } H5E_END_TRY; @@ -229,7 +231,7 @@ int do_copy_refobjs(hid_t fidin, * 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 */ @@ -262,7 +264,7 @@ int do_copy_refobjs(hid_t fidin, for(u = 0; u < nelmts; u++) { H5E_BEGIN_TRY { - if((refobj_id = H5Rdereference(dset_in, H5R_DATASET_REGION, &buf[u])) < 0) + if((refobj_id = H5Rdereference2(dset_in, H5P_DEFAULT, H5R_DATASET_REGION, &buf[u])) < 0) continue; } H5E_END_TRY; @@ -325,7 +327,7 @@ int do_copy_refobjs(hid_t fidin, goto error; } /* end else */ - assert(dset_out != FAIL); + HDassert(dset_out != FAIL); /*------------------------------------------------------------------------- * copy referenced objects in attributes @@ -390,7 +392,7 @@ int do_copy_refobjs(hid_t fidin, } /* end switch */ } /* end for */ - /* Finalize (link) the stack of named datatypes (if any) + /* Finalize (link) the stack of named datatypes (if any) * This function is paired with copy_named_datatype() which is called * in copy_attr(), so need to free. */ @@ -429,6 +431,15 @@ error: * * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu * + * Modifier: xcao@hdfgroup.org, 9/12/2011 + * Update values of references(object and region) for the following types: + * 1) References, + * 2) ARRAY of reference, + * 3) VLEN of references. + * 4) COMPOUND of references. + * This function does not handle references in other complicated structures, + * such as references in nested compound datatypes. + * * Date: October, 28, 2003 * *------------------------------------------------------------------------- @@ -448,34 +459,113 @@ static int copy_refs_attr(hid_t loc_in, hid_t mtype_id = -1; /* memory data type ID */ size_t msize; /* memory size of type */ hsize_t nelmts; /* number of elements in dataset */ - int rank; /* rank of dataset */ hsize_t dims[H5S_MAX_RANK];/* dimensions of dataset */ char name[255]; H5O_info_t oinfo; /* Object info */ - int j; - unsigned u; + unsigned u, i, j; + int rank; + H5T_class_t type_class = -1; + hbool_t is_ref=0, is_ref_vlen=0, is_ref_array=0, is_ref_comp=0; + void *refbuf = NULL; + void *buf = NULL; + const char* refname; + int *ref_comp_index = NULL; + size_t *ref_comp_size = NULL; + int ref_comp_field_n = 0; + if(H5Oget_info(loc_in, &oinfo) < 0) goto error; for(u = 0; u < (unsigned)oinfo.num_attrs; u++) { - /*------------------------------------------------------------------------- - * open - *------------------------------------------------------------------------- - */ + is_ref = is_ref_vlen = is_ref_array = is_ref_comp = 0; + /* 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, 255, name) < 0) - goto error; - /* get the file datatype */ if((ftype_id = H5Aget_type(attr_id)) < 0) goto error; + type_class = H5Tget_class(ftype_id); + + if((mtype_id = h5tools_get_native_type(ftype_id)) < 0) + goto error; + + if((msize = H5Tget_size(mtype_id)) == 0) + goto error; + + is_ref = (type_class == H5T_REFERENCE); + + if (type_class == H5T_VLEN ) { + hid_t base_type = -1; + base_type = H5Tget_super(ftype_id); + is_ref_vlen = (H5Tget_class(base_type)==H5T_REFERENCE); + msize = H5Tget_size(base_type); + H5Tclose(base_type); + } + + if (type_class == H5T_ARRAY ) { + hid_t base_type = -1; + base_type = H5Tget_super(ftype_id); + is_ref_array = (H5Tget_class(base_type)==H5T_REFERENCE); + msize = H5Tget_size(base_type); + H5Tclose(base_type); + } + + if (type_class == H5T_COMPOUND) { + int nmembers = H5Tget_nmembers(ftype_id) ; + if (nmembers < 1) + goto error; + + ref_comp_index = (int *)HDmalloc(nmembers*sizeof (int)); + ref_comp_size = (size_t *)HDmalloc(nmembers*sizeof(ref_comp_size)); + ref_comp_field_n = 0; + + for (i=0; i<(unsigned)nmembers; i++) { + hid_t mtid = H5Tget_member_type( ftype_id, i ); + if ((H5Tget_class(mtid)==H5T_REFERENCE)) { + ref_comp_index[ref_comp_field_n] = i; + ref_comp_size[ref_comp_field_n] = H5Tget_size(mtid); + ref_comp_field_n++; + } + H5Tclose(mtid); + } + + /* if compound don't contain reference type member, free the above + * mallocs. Otherwise there can be memory leaks by the 'continue' + * statement below. */ + if (!ref_comp_field_n) + { + if (ref_comp_index) + { + HDfree(ref_comp_index); + ref_comp_index = NULL; + } + + if (ref_comp_size) + { + HDfree(ref_comp_size); + ref_comp_size = NULL; + } + } + } + + is_ref_comp = (ref_comp_field_n > 0); + + if (!(is_ref || is_ref_vlen || is_ref_array || is_ref_comp)) { + H5Tclose(mtype_id); + H5Tclose(ftype_id); + H5Aclose(attr_id); + continue; + } + + /* get name */ + if(H5Aget_name(attr_id, 255, name) < 0) + goto error; + /* get the dataspace handle */ if((space_id = H5Aget_space(attr_id)) < 0) goto error; @@ -490,35 +580,32 @@ static int copy_refs_attr(hid_t loc_in, *------------------------------------------------------------------------- */ nelmts = 1; - for(j = 0; j < rank; j++) + for(j = 0; j < (unsigned)rank; j++) nelmts *= dims[j]; - if((mtype_id = h5tools_get_native_type(ftype_id)) < 0) - goto error; - - if((msize = H5Tget_size(mtype_id)) == 0) + if (is_ref_array) { + unsigned array_rank = 0; + hsize_t array_size = 1; + hsize_t array_dims[H5S_MAX_RANK]; + hid_t base_type = -1; + base_type = H5Tget_super(ftype_id); + msize = H5Tget_size(base_type); + H5Tclose(base_type); + + array_rank = H5Tget_array_ndims(mtype_id); + H5Tget_array_dims2(mtype_id, array_dims); + for(j = 0; j 0) { - hid_t refobj_id; - hobj_ref_t *refbuf = NULL; - unsigned k; - const char* refname; - hobj_ref_t *buf = NULL; - - /*------------------------------------------------------------------------- - * read input to memory - *------------------------------------------------------------------------- - */ - - if (nelmts) + /* handle object references */ + if((is_ref || is_ref_array) && (H5R_OBJ_REF_BUF_SIZE==msize)) { buf = (hobj_ref_t *)HDmalloc((unsigned)(nelmts * msize)); if(buf == NULL) @@ -536,65 +623,16 @@ static int copy_refs_attr(hid_t loc_in, goto error; } /* end if */ - for(k = 0; k < nelmts; k++) + for(i = 0; i < (unsigned)nelmts; i++) { - H5E_BEGIN_TRY - { - if((refobj_id = H5Rdereference(attr_id, H5R_OBJECT, &buf[k])) < 0) - goto error; - } H5E_END_TRY; - - /* get the name. a valid name could only occur in the - * second traversal of the file - */ - if((refname = MapIdToName(refobj_id, travt)) != NULL) - { - /* create the reference */ - if(H5Rcreate(&refbuf[k], fidout, refname, H5R_OBJECT, -1) < 0) - goto error; - if(options->verbose) - printf("object <%s> reference created to <%s>\n", name, refname); - } - H5Oclose(refobj_id); + if (update_ref_value(attr_id, H5R_OBJECT, &((hobj_ref_t *)buf)[i], fidout, &((hobj_ref_t *)refbuf)[i], travt)<0) + continue; + if(options->verbose) + printf("object <%s> reference created to <%s>\n", name, refname); } /* k */ - } /*nelmts*/ - - /*------------------------------------------------------------------------- - * copy - *------------------------------------------------------------------------- - */ - 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; - - if(refbuf) - HDfree(refbuf); - if(buf) - HDfree(buf); - }/*H5T_STD_REF_OBJ*/ - - /*------------------------------------------------------------------------- - * dataset region references - *------------------------------------------------------------------------- - */ - 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 */ - const char* refname; - unsigned k; - - /*------------------------------------------------------------------------- - * read input to memory - *------------------------------------------------------------------------- - */ - if(nelmts) + }/*H5T_STD_REF_OBJ*/ + /* handle region references */ + else if((is_ref || is_ref_array) && (H5R_DSET_REG_REF_BUF_SIZE == msize)) { buf = (hdset_reg_ref_t *)HDmalloc((unsigned)(nelmts * msize)); if(buf == NULL) @@ -616,56 +654,119 @@ static int copy_refs_attr(hid_t loc_in, goto error; } /* end if */ - for(k = 0; k < nelmts; k++) + for(i = 0; i < (unsigned)nelmts; i++) { - H5E_BEGIN_TRY - { - if((refobj_id = H5Rdereference(attr_id, H5R_DATASET_REGION, &buf[k])) < 0) - continue; - } H5E_END_TRY; - - /* get the name. a valid name could only occur in the - * second traversal of the file - */ - if((refname = MapIdToName(refobj_id, travt)) != NULL) - { - hid_t region_id; /* region id of the referenced dataset */ + if (update_ref_value(attr_id, H5R_DATASET_REGION, &((hdset_reg_ref_t *)buf)[i], fidout, &((hdset_reg_ref_t *)refbuf)[i], travt)<0) + continue; + if(options->verbose) + printf("object <%s> region reference created to <%s>\n", name, refname); + } + } /* H5T_STD_REF_DSETREG */ + else if (is_ref_vlen) { + /* handle VLEN of references */ + + buf = (hvl_t *)HDmalloc((unsigned)(nelmts * sizeof(hvl_t))); + refbuf = buf; /* reuse the read buffer for write */ - if((region_id = H5Rget_region(attr_id, H5R_DATASET_REGION, &buf[k])) < 0) - goto error; + if(buf == NULL) + { + printf( "cannot read into memory\n" ); + goto error; + } /* end if */ - /* create the reference, we need the space_id */ - if(H5Rcreate(&refbuf[k], fidout, refname, H5R_DATASET_REGION, region_id) < 0) - goto error; - if(H5Sclose(region_id) < 0) - goto error; - if(options->verbose) - printf("object <%s> region reference created to <%s>\n", name, refname); - } /* end if */ - H5Oclose(refobj_id); - } /* k */ - } /*nelmts */ + if(H5Aread(attr_id, mtype_id, buf) < 0) + goto error; - /*------------------------------------------------------------------------- - * copy - *------------------------------------------------------------------------- - */ - 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) + if (H5R_OBJ_REF_BUF_SIZE==msize) { + hobj_ref_t ref_out; + for (i=0; i<(unsigned)nelmts; i++) { + hobj_ref_t *ptr = (hobj_ref_t *)((hvl_t *)buf)[i].p; + for (j=0; j<((hvl_t *)buf)[i].len; j++ ) { + if (update_ref_value(attr_id, H5R_OBJECT, &(ptr[j]), fidout, &ref_out, travt)<0) + continue; + HDmemcpy(&(ptr[j]), &ref_out, msize); + } + } /* for (i=0; inobjs; u++) { - if(travt->objs[u].type == H5O_TYPE_DATASET || + if(travt->objs[u].type == H5O_TYPE_DATASET || travt->objs[u].type == H5O_TYPE_GROUP || travt->objs[u].type == H5O_TYPE_NAMED_DATATYPE) { H5O_info_t ref_oinfo; /* Stat for the refobj id */ @@ -730,3 +842,49 @@ out: return ret; } +/*------------------------------------------------------------------------- + * Function: Update_Ref_value + * + * Purpose: Update a reference value + * + * Programmer: xcao@hdfgroup.org 9/12/2011 + * + *------------------------------------------------------------------------- + */ +static herr_t update_ref_value(hid_t obj_id, H5R_type_t ref_type, void *ref_in, + hid_t fid_out, void *ref_out, trav_table_t *travt) +{ + herr_t ret = -1; + const char* ref_obj_name; + hid_t space_id=-1, ref_obj_id=-1; + + ref_obj_id = H5Rdereference2(obj_id, H5P_DEFAULT, ref_type, ref_in); + if (ref_obj_id<0) + goto done; + + ref_obj_name = MapIdToName(ref_obj_id, travt); + if (ref_obj_name == NULL) + goto done; + + if (ref_type == H5R_DATASET_REGION) { + space_id = H5Rget_region(obj_id, H5R_DATASET_REGION, ref_in); + if (space_id < 0) + goto done; + } + + ret = H5Rcreate(ref_out, fid_out, ref_obj_name, ref_type, space_id); + + if (ret < 0) + goto done; + + ret = 0; + +done: + H5E_BEGIN_TRY { + H5Sclose(space_id); + H5Oclose(ref_obj_id); + } H5E_END_TRY; + + return ret; +} + diff --git a/tools/h5repack/h5repack_verify.c b/tools/h5repack/h5repack_verify.c index b0ab1d1..47cba5b 100644 --- a/tools/h5repack/h5repack_verify.c +++ b/tools/h5repack/h5repack_verify.c @@ -14,16 +14,17 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "h5repack.h" +#include "h5tools.h" #include "h5tools_utils.h" -static int verify_layout(hid_t pid, pack_info_t *obj); -static int verify_filters(hid_t pid, hid_t tid, int nfilters, filter_info_t *filter); - /* number of members in an array */ #ifndef NELMTS -# define NELMTS(X) (sizeof(X)/sizeof(X[0])) +# define NELMTS(X) (sizeof(X)/sizeof(X[0])) #endif +static int verify_layout(hid_t pid, pack_info_t *obj); +static int verify_filters(hid_t pid, hid_t tid, int nfilters, filter_info_t *filter); + /*------------------------------------------------------------------------- * Function: h5repack_verify @@ -301,9 +302,9 @@ error: * * Purpose: verify which layout is present in the property list DCPL_ID * - * H5D_COMPACT = 0 - * H5D_CONTIGUOUS = 1 - * H5D_CHUNKED = 2 + * H5D_COMPACT = 0 + * H5D_CONTIGUOUS = 1 + * H5D_CHUNKED = 2 * * Return: 1 has, 0 does not, -1 error * diff --git a/tools/h5repack/h5repacktst.c b/tools/h5repack/h5repacktst.c index 0567615..05eac2f 100644 --- a/tools/h5repack/h5repacktst.c +++ b/tools/h5repack/h5repacktst.c @@ -17,6 +17,7 @@ #include "h5test.h" #include "h5diff.h" #include "h5tools.h" +#include "h5tools_utils.h" #define GOERROR {H5_FAILED(); goto error;} @@ -169,15 +170,21 @@ int main (void) { pack_opt_t pack_options; diff_opt_t diff_options; - hsize_t fs_size = 0; /* free space section threshold */ - H5F_file_space_type_t fs_type = H5F_FILE_SPACE_DEFAULT; /* file space handling strategy */ + hsize_t fs_size = 0; /* free space section threshold */ + H5F_file_space_type_t fs_type = H5F_FILE_SPACE_DEFAULT; /* file space handling strategy */ #if defined (H5_HAVE_FILTER_SZIP) int szip_can_encode = 0; #endif + h5tools_setprogname(PROGRAMNAME); + h5tools_setstatus(EXIT_SUCCESS); + + /* Initialize h5tools lib */ + h5tools_init(); + /* initialize */ - memset(&diff_options, 0, sizeof (diff_opt_t)); - memset(&pack_options, 0, sizeof (pack_opt_t)); + HDmemset(&diff_options, 0, sizeof (diff_opt_t)); + HDmemset(&pack_options, 0, sizeof (pack_opt_t)); /* run tests */ puts("Testing h5repack:"); @@ -986,7 +993,7 @@ int main (void) #if defined (H5_HAVE_FILTER_SZIP) if (szip_can_encode) { - /* fs_type = H5F_FILE_SPACE_AGGR_VFD; fs_size = 3 */ + /* fs_type = H5F_FILE_SPACE_AGGR_VFD; fs_size = 3 */ if (h5repack_init (&pack_options, 0, 0, H5_INC_ENUM(H5F_file_space_type_t, fs_type), ++fs_size) < 0) GOERROR; if (h5repack(FNAME7,FNAME7OUT,&pack_options) < 0) @@ -1303,7 +1310,7 @@ int main (void) && defined (H5_HAVE_FILTER_FLETCHER32) && defined (H5_HAVE_FILTER_SHUFFLE) if (szip_can_encode) { - /* fs_type = H5F_FILE_SPACE_VFD; fs_size = 4 */ + /* fs_type = H5F_FILE_SPACE_VFD; fs_size = 4 */ if (h5repack_init (&pack_options, 0, 0, H5_INC_ENUM(H5F_file_space_type_t, fs_type), ++fs_size) < 0) GOERROR; if (h5repack_addfilter("dset_deflate:SZIP=8,NN",&pack_options) < 0) @@ -3004,31 +3011,31 @@ out: * * Purpose: create datasets with contiguous and chunked layouts: * - * contig_small: < 1k, fixed dims datspace - * chunked_small_fixed: < 1k, fixed dims dataspace + * contig_small: < 1k, fixed dims datspace + * chunked_small_fixed: < 1k, fixed dims dataspace * *------------------------------------------------------------------------- */ -#define S_DIM1 4 -#define S_DIM2 10 -#define CONTIG_S "contig_small" -#define CHUNKED_S_FIX "chunked_small_fixed" +#define S_DIM1 4 +#define S_DIM2 10 +#define CONTIG_S "contig_small" +#define CHUNKED_S_FIX "chunked_small_fixed" static int make_layout2(hid_t loc_id) { - hid_t contig_dcpl = -1; /* dataset creation property list */ + hid_t contig_dcpl = -1; /* dataset creation property list */ hid_t chunked_dcpl = -1; /* dataset creation property list */ - int i, j, n; /* Local index variables */ - int ret_value = -1; /* Return value */ - hid_t s_sid = -1; /* dataspace ID */ + int i, j, n; /* Local index variables */ + int ret_value = -1; /* Return value */ + hid_t s_sid = -1; /* dataspace ID */ - hsize_t s_dims[RANK] = {S_DIM1,S_DIM2}; /* Dataspace (< 1 k) */ - hsize_t chunk_dims[RANK] = {S_DIM1/2, S_DIM2/2}; /* Dimension sizes for chunks */ + hsize_t s_dims[RANK] = {S_DIM1,S_DIM2}; /* Dataspace (< 1 k) */ + hsize_t chunk_dims[RANK] = {S_DIM1/2, S_DIM2/2}; /* Dimension sizes for chunks */ - int s_buf[S_DIM1][S_DIM2]; /* Temporary buffer */ + int s_buf[S_DIM1][S_DIM2]; /* Temporary buffer */ for(i = n = 0; i < S_DIM1; i++) { for (j = 0; j < S_DIM2; j++) { @@ -3178,7 +3185,7 @@ int make_big(hid_t loc_id) if (H5Dwrite (did,H5T_NATIVE_SCHAR,m_sid,f_sid,H5P_DEFAULT,buf) < 0) goto out; - free(buf); + HDfree(buf); buf=NULL; /* close */ @@ -3219,8 +3226,8 @@ int make_external(hid_t loc_id) hid_t sid=-1; hid_t dcpl; int buf[2]={1,2}; - hsize_t cur_size[1]; /* data space current size */ - hsize_t max_size[1]; /* data space maximum size */ + hsize_t cur_size[1]; /* data space current size */ + hsize_t max_size[1]; /* data space maximum size */ hsize_t size; cur_size[0] = max_size[0] = 2; @@ -3303,7 +3310,7 @@ make_userblock(void) /* Write userblock data */ nwritten = HDwrite(fd, ub, (size_t)USERBLOCK_SIZE); - assert(nwritten == USERBLOCK_SIZE); + HDassert(nwritten == USERBLOCK_SIZE); /* Close file */ HDclose(fd); @@ -3367,7 +3374,7 @@ verify_userblock( const char* filename) /* Read userblock data */ nread = HDread(fd, ub, (size_t)USERBLOCK_SIZE); - assert(nread == USERBLOCK_SIZE); + HDassert(nread == USERBLOCK_SIZE); /* Verify userblock data */ for(u = 0; u < USERBLOCK_SIZE; u++) @@ -3416,7 +3423,7 @@ make_userblock_file(void) /* write userblock data */ nwritten = HDwrite(fd, ub, (size_t)USERBLOCK_SIZE); - assert(nwritten == USERBLOCK_SIZE); + HDassert(nwritten == USERBLOCK_SIZE); /* close file */ HDclose(fd); @@ -3472,7 +3479,7 @@ int write_dset_in(hid_t loc_id, /* create 1D attributes with dimension [2], 2 elements */ hsize_t dims[1]={2}; hsize_t dims1r[1]={2}; - char buf1[2][2]= {"ab","de"}; /* string */ + char buf1[2][3]= {"ab","de"}; /* string */ char buf2[2]= {1,2}; /* bitfield, opaque */ s_t buf3[2]= {{1,2},{3,4}}; /* compound */ hobj_ref_t buf4[2]; /* reference */ @@ -3486,7 +3493,7 @@ int write_dset_in(hid_t loc_id, /* create 2D attributes with dimension [3][2], 6 elements */ hsize_t dims2[2]={3,2}; hsize_t dims2r[2]={1,1}; - char buf12[6][2]= {"ab","cd","ef","gh","ij","kl"}; /* string */ + char buf12[6][3]= {"ab","cd","ef","gh","ij","kl"}; /* string */ char buf22[3][2]= {{1,2},{3,4},{5,6}}; /* bitfield, opaque */ s_t buf32[6]= {{1,2},{3,4},{5,6},{7,8},{9,10},{11,12}}; /* compound */ hobj_ref_t buf42[1][1]; /* reference */ @@ -3498,7 +3505,7 @@ int write_dset_in(hid_t loc_id, /* create 3D attributes with dimension [4][3][2], 24 elements */ hsize_t dims3[3]={4,3,2}; hsize_t dims3r[3]={1,1,1}; - char buf13[24][2]= {"ab","cd","ef","gh","ij","kl","mn","pq", + char buf13[24][3]= {"ab","cd","ef","gh","ij","kl","mn","pq", "rs","tu","vw","xz","AB","CD","EF","GH", "IJ","KL","MN","PQ","RS","TU","VW","XZ"}; /* string */ char buf23[4][3][2]; /* bitfield, opaque */ @@ -3741,7 +3748,7 @@ int write_dset_in(hid_t loc_id, H5Dclose(did); H5Tclose(tid); H5Sclose(sid); - free( dbuf ); + HDfree( dbuf ); } /*------------------------------------------------------------------------- @@ -3776,7 +3783,7 @@ int write_dset_in(hid_t loc_id, if (make_diffs) { - memset(buf12, 'z', sizeof buf12); + HDmemset(buf12, 'z', sizeof buf12); } @@ -3797,7 +3804,7 @@ int write_dset_in(hid_t loc_id, if (make_diffs) { - memset(buf22,0,sizeof buf22); + HDmemset(buf22,0,sizeof buf22); } if ((tid = H5Tcopy(H5T_STD_B8LE)) < 0) @@ -3827,7 +3834,7 @@ int write_dset_in(hid_t loc_id, if (make_diffs) { - memset(buf32,0,sizeof buf32); + HDmemset(buf32,0,sizeof buf32); } if ((tid = H5Tcreate (H5T_COMPOUND, sizeof(s_t))) < 0) @@ -3919,7 +3926,7 @@ int write_dset_in(hid_t loc_id, if (make_diffs) { - memset(buf62,0,sizeof buf62); + HDmemset(buf62,0,sizeof buf62); } @@ -3937,8 +3944,8 @@ int write_dset_in(hid_t loc_id, if(make_diffs) { - memset(buf72, 0, sizeof buf72); - memset(buf82, 0, sizeof buf82); + HDmemset(buf72, 0, sizeof buf72); + HDmemset(buf82, 0, sizeof buf82); } @@ -3978,7 +3985,7 @@ int write_dset_in(hid_t loc_id, if (make_diffs) { - memset(buf13,'z',sizeof buf13); + HDmemset(buf13,'z',sizeof buf13); } if ((tid = H5Tcopy(H5T_C_S1)) < 0) @@ -4291,9 +4298,9 @@ int make_dset_reg_ref(hid_t loc_id) out: if(wbuf) - free(wbuf); + HDfree(wbuf); if(dwbuf) - free(dwbuf); + HDfree(dwbuf); H5E_BEGIN_TRY { @@ -4345,7 +4352,7 @@ int write_attr_in(hid_t loc_id, /* create 1D attributes with dimension [2], 2 elements */ hsize_t dims[1]={2}; - char buf1[2][2]= {"ab","de"}; /* string */ + char buf1[2][3]= {"ab","de"}; /* string */ char buf2[2]= {1,2}; /* bitfield, opaque */ s_t buf3[2]= {{1,2},{3,4}}; /* compound */ hobj_ref_t buf4[2]; /* reference */ @@ -4358,7 +4365,7 @@ int write_attr_in(hid_t loc_id, /* 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 */ + char buf12[6][3]= {"ab","cd","ef","gh","ij","kl"}; /* string */ char buf22[3][2]= {{1,2},{3,4},{5,6}}; /* bitfield, opaque */ s_t buf32[6]= {{1,2},{3,4},{5,6},{7,8},{9,10},{11,12}}; /* compound */ hobj_ref_t buf42[3][2]; /* reference */ @@ -4370,7 +4377,7 @@ int write_attr_in(hid_t loc_id, /* 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", + char buf13[24][3]= {"ab","cd","ef","gh","ij","kl","mn","pq", "rs","tu","vw","xz","AB","CD","EF","GH", "IJ","KL","MN","PQ","RS","TU","VW","XZ"}; /* string */ char buf23[4][3][2]; /* bitfield, opaque */ @@ -4698,7 +4705,7 @@ int write_attr_in(hid_t loc_id, */ if (make_diffs) { - memset(buf12, 'z', sizeof buf12); + HDmemset(buf12, 'z', sizeof buf12); } /* @@ -4738,7 +4745,7 @@ int write_attr_in(hid_t loc_id, if (make_diffs) { - memset(buf22,0,sizeof buf22); + HDmemset(buf22,0,sizeof buf22); } /* @@ -4798,7 +4805,7 @@ int write_attr_in(hid_t loc_id, */ if (make_diffs) { - memset(buf32,0,sizeof buf32); + HDmemset(buf32,0,sizeof buf32); } /* @@ -4946,7 +4953,7 @@ int write_attr_in(hid_t loc_id, if (make_diffs) { - memset(buf62,0,sizeof buf62); + HDmemset(buf62,0,sizeof buf62); } /* buf62[6][3]= {{1,2,3},{4,5,6},{7,8,9},{10,11,12},{13,14,15},{16,17,18}}; @@ -5032,7 +5039,7 @@ int write_attr_in(hid_t loc_id, if (make_diffs) { - memset(buf13,'z',sizeof buf13); + HDmemset(buf13,'z',sizeof buf13); } /* @@ -6705,49 +6712,49 @@ static herr_t make_complex_attr_references(hid_t loc_id) out: /* release resources */ - if (objgid < 0) + if (objgid > 0) H5Gclose(objgid); - if (objsid < 0) + if (objsid > 0) H5Sclose(objsid); - if (objdid < 0) + if (objdid > 0) H5Dclose(objdid); - if (objtid < 0) + if (objtid > 0) H5Tclose(objtid); - if (main_gid < 0) + if (main_gid > 0) H5Gclose(main_gid); - if (main_sid < 0) + if (main_sid > 0) H5Sclose(main_sid); - if (main_did < 0) + if (main_did > 0) H5Dclose(main_did); /* comp obj ref */ - if (comp_objref_tid < 0) + if (comp_objref_tid > 0) H5Tclose(comp_objref_tid); - if (comp_objref_aid < 0) + if (comp_objref_aid > 0) H5Aclose(comp_objref_aid); - if (comp_objref_attr_sid < 0) + if (comp_objref_attr_sid > 0) H5Sclose(comp_objref_attr_sid); /* comp region ref */ - if (comp_regref_tid < 0) + if (comp_regref_tid > 0) H5Tclose(comp_regref_tid); - if (comp_regref_aid < 0) + if (comp_regref_aid > 0) H5Aclose(comp_regref_aid); - if (comp_regref_attr_sid < 0) + if (comp_regref_attr_sid > 0) H5Sclose(comp_regref_attr_sid); /* vlen obj ref */ - if (vlen_objref_attr_id < 0); - H5Aclose (vlen_objref_attr_id); - if (vlen_objref_attr_sid < 0); - H5Sclose (vlen_objref_attr_sid); - if (vlen_objref_attr_tid < 0); - H5Tclose (vlen_objref_attr_tid); + if (vlen_objref_attr_id > 0) + H5Aclose(vlen_objref_attr_id); + if (vlen_objref_attr_sid > 0) + H5Sclose(vlen_objref_attr_sid); + if (vlen_objref_attr_tid > 0) + H5Tclose(vlen_objref_attr_tid); /* vlen region ref */ - if (vlen_regref_attr_id < 0); - H5Aclose (vlen_regref_attr_id); - if (vlen_regref_attr_sid < 0); - H5Sclose (vlen_regref_attr_sid); - if (vlen_regref_attr_tid < 0); - H5Tclose (vlen_regref_attr_tid); + if (vlen_regref_attr_id > 0) + H5Aclose(vlen_regref_attr_id); + if (vlen_regref_attr_sid > 0) + H5Sclose(vlen_regref_attr_sid); + if (vlen_regref_attr_tid > 0) + H5Tclose(vlen_regref_attr_tid); return ret; } diff --git a/tools/h5repack/testfiles/h5repack_layout.h5 b/tools/h5repack/testfiles/h5repack_layout.h5 index 5772a31..2cc44b1 100644 Binary files a/tools/h5repack/testfiles/h5repack_layout.h5 and b/tools/h5repack/testfiles/h5repack_layout.h5 differ diff --git a/tools/h5repack/testh5repack_detect_szip.c b/tools/h5repack/testh5repack_detect_szip.c index 332fcc5..e91b2f7 100644 --- a/tools/h5repack/testh5repack_detect_szip.c +++ b/tools/h5repack/testh5repack_detect_szip.c @@ -16,6 +16,7 @@ #include #include "h5repack.h" #include "h5tools.h" +#include "h5tools_utils.h" #include "h5test.h" @@ -47,6 +48,9 @@ int main(void) h5tools_setprogname(PROGRAMNAME); h5tools_setstatus(EXIT_SUCCESS); + /* Initialize h5tools lib */ + h5tools_init(); + #ifdef H5_HAVE_FILTER_SZIP if (h5tools_can_encode(H5Z_FILTER_SZIP) == 1) { printf("yes\n"); diff --git a/tools/h5stat/CMakeLists.txt b/tools/h5stat/CMakeLists.txt index 86ad3ad..8c621c9 100644 --- a/tools/h5stat/CMakeLists.txt +++ b/tools/h5stat/CMakeLists.txt @@ -1,11 +1,10 @@ -cmake_minimum_required (VERSION 2.8) +cmake_minimum_required (VERSION 2.8.6) PROJECT (HDF5_TOOLS_H5STAT) #----------------------------------------------------------------------------- # Setup include Directories #----------------------------------------------------------------------------- INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib) -INCLUDE_DIRECTORIES (${HDF5_PROJECT_DIR}/test) # -------------------------------------------------------------------- # Add the h5stat executables @@ -13,6 +12,7 @@ INCLUDE_DIRECTORIES (${HDF5_PROJECT_DIR}/test) ADD_EXECUTABLE (h5stat ${HDF5_TOOLS_H5STAT_SOURCE_DIR}/h5stat.c) TARGET_NAMING (h5stat ${LIB_TYPE}) TARGET_LINK_LIBRARIES (h5stat ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) +SET_TARGET_PROPERTIES (h5stat PROPERTIES FOLDER tools) SET (H5_DEP_EXECUTABLES h5stat) @@ -29,7 +29,8 @@ IF (BUILD_TESTING) IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) ADD_EXECUTABLE (h5stat_gentest ${HDF5_TOOLS_H5STAT_SOURCE_DIR}/h5stat_gentest.c) TARGET_NAMING (h5stat_gentest ${LIB_TYPE}) - TARGET_LINK_LIBRARIES (h5stat_gentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + TARGET_LINK_LIBRARIES (h5stat_gentest ${HDF5_LIB_TARGET}) + SET_TARGET_PROPERTIES (h5stat_gentest PROPERTIES FOLDER generator/tools) #ADD_TEST (NAME h5stat_gentest COMMAND $) ENDIF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) @@ -91,8 +92,17 @@ IF (BUILD_TESTING) # If using memchecker add tests without using scripts IF (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST (NAME H5STAT-${resultfile} COMMAND $ ${ARGN}) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5STAT-${resultfile} PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + SET (last_test "H5STAT-${resultfile}") ELSE (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( + NAME H5STAT-clear-${resultfile}-objects + COMMAND ${CMAKE_COMMAND} + -E remove ${resultfile}.out ${resultfile}.out.err + ) + ADD_TEST ( NAME H5STAT-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" @@ -103,11 +113,8 @@ IF (BUILD_TESTING) -D "TEST_REFERENCE=${resultfile}.ddl" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) + SET_TESTS_PROPERTIES (H5STAT-${resultfile} PROPERTIES DEPENDS "H5STAT-clear-${resultfile}-objects") ENDIF (HDF5_ENABLE_USING_MEMCHECKER) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5STAT-${resultfile} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5STAT-${resultfile}") ENDMACRO (ADD_H5_TEST file) ############################################################################## @@ -116,8 +123,9 @@ IF (BUILD_TESTING) ############################################################################## ############################################################################## - # Remove any output file left over from previous test run - ADD_TEST ( + IF (HDF5_ENABLE_USING_MEMCHECKER) + # Remove any output file left over from previous test run + ADD_TEST ( NAME H5STAT-clearall-objects COMMAND ${CMAKE_COMMAND} -E remove @@ -149,16 +157,11 @@ IF (BUILD_TESTING) h5stat_newgrat-UG.out.err h5stat_newgrat-UA.out h5stat_newgrat-UA.out.err - ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5STAT-clearall-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5STAT-clearall-objects") - - # If using memchecker add tests without using scripts - IF (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5STAT-help COMMAND h5stat -h) - ADD_TEST (NAME H5STAT-filters COMMAND h5stat h5stat_filters.h5) + ) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5STAT-clearall-objects PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + SET (last_test "H5STAT-clearall-objects") ENDIF (HDF5_ENABLE_USING_MEMCHECKER) # Test for help flag diff --git a/tools/h5stat/Makefile.in b/tools/h5stat/Makefile.in index 4e37025..403446c 100644 --- a/tools/h5stat/Makefile.in +++ b/tools/h5stat/Makefile.in @@ -204,6 +204,7 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ +FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ @@ -224,10 +225,12 @@ H5_LONE_COLON = @H5_LONE_COLON@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ +HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ +HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ diff --git a/tools/h5stat/h5stat.c b/tools/h5stat/h5stat.c index fd21266..e206f4f 100644 --- a/tools/h5stat/h5stat.c +++ b/tools/h5stat/h5stat.c @@ -15,7 +15,7 @@ #include #include -#include "H5private.h" /* Generic Functions */ +#include "H5private.h" /* Generic Functions */ #include "h5tools.h" #include "h5tools_utils.h" #include "h5tools_ref.h" @@ -27,7 +27,7 @@ /* Parameters to control statistics gathered */ #define SIZE_SMALL_GROUPS 10 -#define SIZE_SMALL_ATTRS 10 +#define SIZE_SMALL_ATTRS 10 #define SIZE_SMALL_DSETS 10 #define SIZE_SMALL_SECTS 10 @@ -60,7 +60,7 @@ typedef struct ohdr_info_t { /* Info to pass to the iteration functions */ typedef struct iter_t { hid_t fid; /* File ID */ - hsize_t filesize; /* Size of the file */ + hsize_t filesize; /* Size of the file */ unsigned long uniq_groups; /* Number of unique groups */ unsigned long uniq_dsets; /* Number of unique datasets */ unsigned long uniq_dtypes; /* Number of unique named datatypes */ @@ -74,7 +74,7 @@ typedef struct iter_t { unsigned long *group_bins; /* Pointer to array of bins for group counts */ ohdr_info_t group_ohdr_info; /* Object header information for groups */ - hsize_t max_attrs; /* Maximum attributes from a group */ + hsize_t max_attrs; /* Maximum attributes from a group */ unsigned long num_small_attrs[SIZE_SMALL_ATTRS]; /* Size of small attributes tracked */ unsigned attr_nbins; /* Number of bins for attribute counts */ unsigned long *attr_bins; /* Pointer to array of bins for attribute counts */ @@ -99,14 +99,14 @@ typedef struct iter_t { hsize_t attrs_heap_storage_size; /* fractal heap size for attributes (1.8) */ hsize_t SM_hdr_storage_size; /* header size for SOHM table (1.8) */ hsize_t SM_index_storage_size; /* index (btree & list) size for SOHM table (1.8) */ - hsize_t SM_heap_storage_size; /* fractal heap size for SOHM table (1.8) */ - hsize_t super_size; /* superblock size */ - hsize_t super_ext_size; /* superblock extension size */ - hsize_t ublk_size; /* user block size (if exists) */ - H5F_file_space_type_t fs_strategy; /* File space management strategy */ - hsize_t fs_threshold; /* Free-space section threshold */ - hsize_t free_space; /* amount of freespace in the file */ - hsize_t free_hdr; /* size of free space manager metadata in the file */ + hsize_t SM_heap_storage_size; /* fractal heap size for SOHM table (1.8) */ + hsize_t super_size; /* superblock size */ + hsize_t super_ext_size; /* superblock extension size */ + hsize_t ublk_size; /* user block size (if exists) */ + H5F_file_space_type_t fs_strategy; /* File space management strategy */ + hsize_t fs_threshold; /* Free-space section threshold */ + hsize_t free_space; /* amount of freespace in the file */ + hsize_t free_hdr; /* size of free space manager metadata in the file */ unsigned long num_small_sects[SIZE_SMALL_SECTS]; /* Size of small free-space sections */ unsigned sect_nbins; /* Number of bins for free-space section sizes */ unsigned long *sect_bins; /* Pointer to array of bins for free-space section sizes */ @@ -120,19 +120,19 @@ typedef struct iter_t { static int display_all = TRUE; /* Enable the printing of selected statistics */ -static int display_file = FALSE; /* display file information */ -static int display_group = FALSE; /* display groups information */ -static int display_dset = FALSE; /* display datasets information */ +static int display_file = FALSE; /* display file information */ +static int display_group = FALSE; /* display groups information */ +static int display_dset = FALSE; /* display datasets information */ static int display_dset_dtype_meta = FALSE; /* display datasets' datatype information */ -static int display_attr = FALSE; /* display attributes information */ +static int display_attr = FALSE; /* display attributes information */ static int display_free_sections = FALSE; /* display free space information */ -static int display_summary = FALSE; /* display summary of file space information */ +static int display_summary = FALSE; /* display summary of file space information */ static int display_file_metadata = FALSE; /* display file space info for file's metadata */ static int display_group_metadata = FALSE; /* display file space info for groups' metadata */ static int display_dset_metadata = FALSE; /* display file space info for datasets' metadata */ -static int display_object = FALSE; /* not implemented yet */ +static int display_object = FALSE; /* not implemented yet */ /* a structure for handling the order command-line parameters come in */ struct handler_t { @@ -232,28 +232,28 @@ static void leave(int ret) { h5tools_close(); - exit(ret); + HDexit(ret); } static void usage(const char *prog) { - fflush(stdout); - fprintf(stdout, "Usage: %s [OPTIONS] file\n", prog); - fprintf(stdout, "\n"); - fprintf(stdout, " OPTIONS\n"); - fprintf(stdout, " -h, --help Print a usage message and exit\n"); - fprintf(stdout, " -V, --version Print version number and exit\n"); - fprintf(stdout, " -f, --file Print file information\n"); - fprintf(stdout, " -F, --filemetadata Print file space information for file's metadata\n"); - fprintf(stdout, " -g, --group Print group information\n"); - fprintf(stdout, " -G, --groupmetadata Print file space information for groups' metadata\n"); - fprintf(stdout, " -d, --dset Print dataset information\n"); - fprintf(stdout, " -D, --dsetmetadata Print file space information for datasets' metadata\n"); - fprintf(stdout, " -T, --dtypemetadata Print datasets' datatype information\n"); - fprintf(stdout, " -A, --attribute Print attribute information\n"); - fprintf(stdout, " -s, --freespace Print free space information\n"); - fprintf(stdout, " -S, --summary Print summary of file space information\n"); + HDfflush(stdout); + HDfprintf(stdout, "Usage: %s [OPTIONS] file\n", prog); + HDfprintf(stdout, "\n"); + HDfprintf(stdout, " OPTIONS\n"); + HDfprintf(stdout, " -h, --help Print a usage message and exit\n"); + HDfprintf(stdout, " -V, --version Print version number and exit\n"); + HDfprintf(stdout, " -f, --file Print file information\n"); + HDfprintf(stdout, " -F, --filemetadata Print file space information for file's metadata\n"); + HDfprintf(stdout, " -g, --group Print group information\n"); + HDfprintf(stdout, " -G, --groupmetadata Print file space information for groups' metadata\n"); + HDfprintf(stdout, " -d, --dset Print dataset information\n"); + HDfprintf(stdout, " -D, --dsetmetadata Print file space information for datasets' metadata\n"); + HDfprintf(stdout, " -T, --dtypemetadata Print datasets' datatype information\n"); + HDfprintf(stdout, " -A, --attribute Print attribute information\n"); + HDfprintf(stdout, " -s, --freespace Print free space information\n"); + HDfprintf(stdout, " -S, --summary Print summary of file space information\n"); } @@ -303,7 +303,7 @@ ceil_log10(unsigned long x) static herr_t attribute_stats(iter_t *iter, const H5O_info_t *oi) { - unsigned bin; /* "bin" the number of objects falls in */ + unsigned bin; /* "bin" the number of objects falls in */ /* Update dataset & attribute metadata info */ iter->attrs_btree_storage_size += oi->meta_size.attr.index_size; @@ -318,12 +318,12 @@ attribute_stats(iter_t *iter, const H5O_info_t *oi) /* Add attribute count to proper bin */ bin = ceil_log10((unsigned long)oi->num_attrs); if((bin + 1) > iter->attr_nbins) { - iter->attr_bins = (unsigned long *)realloc(iter->attr_bins, (bin + 1) * sizeof(unsigned long)); - assert(iter->attr_bins); + iter->attr_bins = (unsigned long *)HDrealloc(iter->attr_bins, (bin + 1) * sizeof(unsigned long)); + HDassert(iter->attr_bins); - /* Initialize counts for intermediate bins */ + /* Initialize counts for intermediate bins */ while(iter->attr_nbins < bin) - iter->attr_bins[iter->attr_nbins++] = 0; + iter->attr_bins[iter->attr_nbins++] = 0; iter->attr_nbins++; /* Initialize count for new bin */ @@ -351,23 +351,23 @@ attribute_stats(iter_t *iter, const H5O_info_t *oi) * Modifications: Refactored code from the walk_function * EIP, Wednesday, August 16, 2006 * - * Vailin Choi 12 July 2007 - * 1. Gathered storage info for btree and heap - * (groups and attributes) - * 2. Gathered info for attributes + * Vailin Choi 12 July 2007 + * 1. Gathered storage info for btree and heap + * (groups and attributes) + * 2. Gathered info for attributes * - * Vailin Choi 14 July 2007 - * Cast "num_objs" and "num_attrs" to size_t - * Due to the -Mbounds problem for the pgi-32 bit compiler on indexing + * Vailin Choi 14 July 2007 + * Cast "num_objs" and "num_attrs" to size_t + * Due to the -Mbounds problem for the pgi-32 bit compiler on indexing * *------------------------------------------------------------------------- */ static herr_t group_stats(iter_t *iter, const char *name, const H5O_info_t *oi) { - H5G_info_t ginfo; /* Group information */ - unsigned bin; /* "bin" the number of objects falls in */ - herr_t ret; + H5G_info_t ginfo; /* Group information */ + unsigned bin; /* "bin" the number of objects falls in */ + herr_t ret; /* Gather statistics about this type of object */ iter->uniq_groups++; @@ -378,7 +378,7 @@ group_stats(iter_t *iter, const char *name, const H5O_info_t *oi) /* Get group information */ ret = H5Gget_info_by_name(iter->fid, name, &ginfo, H5P_DEFAULT); - assert(ret >= 0); + HDassert(ret >= 0); /* Update link stats */ if(ginfo.nlinks < SIZE_SMALL_GROUPS) @@ -390,10 +390,10 @@ group_stats(iter_t *iter, const char *name, const H5O_info_t *oi) bin = ceil_log10((unsigned long)ginfo.nlinks); if((bin + 1) > iter->group_nbins) { /* Allocate more storage for info about dataset's datatype */ - iter->group_bins = (unsigned long *)realloc(iter->group_bins, (bin + 1) * sizeof(unsigned long)); - assert(iter->group_bins); + iter->group_bins = (unsigned long *)HDrealloc(iter->group_bins, (bin + 1) * sizeof(unsigned long)); + HDassert(iter->group_bins); - /* Initialize counts for intermediate bins */ + /* Initialize counts for intermediate bins */ while(iter->group_nbins < bin) iter->group_bins[iter->group_nbins++] = 0; iter->group_nbins++; @@ -410,7 +410,7 @@ group_stats(iter_t *iter, const char *name, const H5O_info_t *oi) /* Update attribute metadata info */ ret = attribute_stats(iter, oi); - assert(ret >= 0); + HDassert(ret >= 0); return 0; } /* end group_stats() */ @@ -433,22 +433,22 @@ group_stats(iter_t *iter, const char *name, const H5O_info_t *oi) static herr_t dataset_stats(iter_t *iter, const char *name, const H5O_info_t *oi) { - unsigned bin; /* "bin" the number of objects falls in */ - hid_t did; /* Dataset ID */ - hid_t sid; /* Dataspace ID */ - hid_t tid; /* Datatype ID */ - hid_t dcpl; /* Dataset creation property list ID */ - hsize_t dims[H5S_MAX_RANK];/* Dimensions of dataset */ - H5D_layout_t lout; /* Layout of dataset */ - unsigned type_found; /* Whether the dataset's datatype was */ - /* already found */ - int ndims; /* Number of dimensions of dataset */ - hsize_t storage; /* Size of dataset storage */ - unsigned u; /* Local index variable */ - int num_ext; /* Number of external files for a dataset */ - int nfltr; /* Number of filters for a dataset */ - H5Z_filter_t fltr; /* Filter identifier */ - herr_t ret; + unsigned bin; /* "bin" the number of objects falls in */ + hid_t did; /* Dataset ID */ + hid_t sid; /* Dataspace ID */ + hid_t tid; /* Datatype ID */ + hid_t dcpl; /* Dataset creation property list ID */ + hsize_t dims[H5S_MAX_RANK];/* Dimensions of dataset */ + H5D_layout_t lout; /* Layout of dataset */ + unsigned type_found; /* Whether the dataset's datatype was */ + /* already found */ + int ndims; /* Number of dimensions of dataset */ + hsize_t storage; /* Size of dataset storage */ + unsigned u; /* Local index variable */ + int num_ext; /* Number of external files for a dataset */ + int nfltr; /* Number of filters for a dataset */ + H5Z_filter_t fltr; /* Filter identifier */ + herr_t ret; /* Gather statistics about this type of object */ iter->uniq_dsets++; @@ -458,7 +458,7 @@ dataset_stats(iter_t *iter, const char *name, const H5O_info_t *oi) iter->dset_ohdr_info.free_size += oi->hdr.space.free; did = H5Dopen2(iter->fid, name, H5P_DEFAULT); - assert(did > 0); + HDassert(did > 0); /* Update dataset metadata info */ iter->datasets_index_storage_size += oi->meta_size.obj.index_size; @@ -466,22 +466,22 @@ dataset_stats(iter_t *iter, const char *name, const H5O_info_t *oi) /* Update attribute metadata info */ ret = attribute_stats(iter, oi); - assert(ret >= 0); + HDassert(ret >= 0); /* Get storage info */ storage = H5Dget_storage_size(did); /* Gather layout statistics */ dcpl = H5Dget_create_plist(did); - assert(dcpl > 0); + HDassert(dcpl > 0); lout = H5Pget_layout(dcpl); - assert(lout >= 0); + HDassert(lout >= 0); /* Object header's total size for H5D_COMPACT layout includes raw data size */ /* "storage" also includes H5D_COMPACT raw data size */ if(lout == H5D_COMPACT) - iter->dset_ohdr_info.total_size -= storage; + iter->dset_ohdr_info.total_size -= storage; /* Track the layout type for dataset */ (iter->dset_layouts[lout])++; @@ -495,14 +495,14 @@ dataset_stats(iter_t *iter, const char *name, const H5O_info_t *oi) iter->nexternal += (unsigned long)num_ext; iter->dset_external_storage_size += (unsigned long)storage; } else - iter->dset_storage_size += storage; + iter->dset_storage_size += storage; /* Gather dataspace statistics */ sid = H5Dget_space(did); - assert(sid > 0); + HDassert(sid > 0); ndims = H5Sget_simple_extent_dims(sid, dims, NULL); - assert(ndims >= 0); + HDassert(ndims >= 0); /* Check for larger rank of dataset */ if((unsigned)ndims > iter->max_dset_rank) @@ -521,8 +521,8 @@ dataset_stats(iter_t *iter, const char *name, const H5O_info_t *oi) bin = ceil_log10((unsigned long)dims[0]); if((bin + 1) > iter->dset_dim_nbins) { /* Allocate more storage for info about dataset's datatype */ - iter->dset_dim_bins = (unsigned long *)realloc(iter->dset_dim_bins, (bin + 1) * sizeof(unsigned long)); - assert(iter->dset_dim_bins); + iter->dset_dim_bins = (unsigned long *)HDrealloc(iter->dset_dim_bins, (bin + 1) * sizeof(unsigned long)); + HDassert(iter->dset_dim_bins); /* Initialize counts for intermediate bins */ while(iter->dset_dim_nbins < bin) @@ -537,11 +537,11 @@ dataset_stats(iter_t *iter, const char *name, const H5O_info_t *oi) } /* end if */ ret = H5Sclose(sid); - assert(ret >= 0); + HDassert(ret >= 0); /* Gather datatype statistics */ tid = H5Dget_type(did); - assert(tid > 0); + HDassert(tid > 0); type_found = FALSE; for(u = 0; u < iter->dset_ntypes; u++) @@ -558,12 +558,12 @@ dataset_stats(iter_t *iter, const char *name, const H5O_info_t *oi) iter->dset_ntypes++; /* Allocate more storage for info about dataset's datatype */ - iter->dset_type_info = (dtype_info_t *)realloc(iter->dset_type_info, iter->dset_ntypes * sizeof(dtype_info_t)); - assert(iter->dset_type_info); + iter->dset_type_info = (dtype_info_t *)HDrealloc(iter->dset_type_info, iter->dset_ntypes * sizeof(dtype_info_t)); + HDassert(iter->dset_type_info); /* Initialize information about datatype */ iter->dset_type_info[curr_ntype].tid = H5Tcopy(tid); - assert(iter->dset_type_info[curr_ntype].tid > 0); + HDassert(iter->dset_type_info[curr_ntype].tid > 0); iter->dset_type_info[curr_ntype].count = 1; iter->dset_type_info[curr_ntype].named = 0; @@ -576,7 +576,7 @@ dataset_stats(iter_t *iter, const char *name, const H5O_info_t *oi) (iter->dset_type_info[u].named)++; ret = H5Tclose(tid); - assert(ret >= 0); + HDassert(ret >= 0); /* Track different filters */ if((nfltr = H5Pget_nfilters(dcpl)) >= 0) { @@ -594,10 +594,10 @@ dataset_stats(iter_t *iter, const char *name, const H5O_info_t *oi) } /* endif nfltr */ ret = H5Pclose(dcpl); - assert(ret >= 0); + HDassert(ret >= 0); ret = H5Dclose(did); - assert(ret >= 0); + HDassert(ret >= 0); return 0; } /* end dataset_stats() */ @@ -628,7 +628,7 @@ datatype_stats(iter_t *iter, const H5O_info_t *oi) /* Update attribute metadata info */ ret = attribute_stats(iter, oi); - assert(ret >= 0); + HDassert(ret >= 0); return 0; } /* end datatype_stats() */ @@ -640,7 +640,7 @@ datatype_stats(iter_t *iter, const H5O_info_t *oi) * Purpose: Gather statistics about an object * * Return: Success: 0 - * Failure: -1 + * Failure: -1 * * Programmer: Quincey Koziol * Tuesday, November 6, 2007 @@ -669,7 +669,7 @@ obj_stats(const char *path, const H5O_info_t *oi, const char *already_visited, break; case H5O_TYPE_NAMED_DATATYPE: - datatype_stats(iter, oi); + datatype_stats(iter, oi); break; default: @@ -724,7 +724,7 @@ lnk_stats(const char UNUSED *path, const H5L_info_t *li, void *_iter) * Purpose: Gather statistics for free space sections in the file * * Return: Success: 0 - * Failure: -1 + * Failure: -1 * * Programmer: Vailin Choi; July 7th, 2009 * @@ -734,31 +734,31 @@ static herr_t freespace_stats(hid_t fid, iter_t *iter) { H5F_sect_info_t *sect_info = NULL; /* Free space sections */ - ssize_t nsects; /* Number of free space sections */ - size_t u; /* Local index variable */ + ssize_t nsects; /* Number of free space sections */ + size_t u; /* Local index variable */ /* Query section information */ if((nsects = H5Fget_free_sections(fid, H5FD_MEM_DEFAULT, 0, NULL)) < 0) - return(FAIL); + return(FAIL); else if(nsects) { - if(NULL == (sect_info = (H5F_sect_info_t *)calloc((size_t)nsects, sizeof(H5F_sect_info_t)))) - return(FAIL); - nsects = H5Fget_free_sections(fid, H5FD_MEM_DEFAULT, (size_t)nsects, sect_info); - assert(nsects); + if(NULL == (sect_info = (H5F_sect_info_t *)HDcalloc((size_t)nsects, sizeof(H5F_sect_info_t)))) + return(FAIL); + nsects = H5Fget_free_sections(fid, H5FD_MEM_DEFAULT, (size_t)nsects, sect_info); + HDassert(nsects); } /* end else-if */ for(u = 0; u < (size_t)nsects; u++) { - unsigned bin; /* "bin" the number of objects falls in */ + unsigned bin; /* "bin" the number of objects falls in */ - if(sect_info[u].size < SIZE_SMALL_SECTS) - (iter->num_small_sects[(size_t)sect_info[u].size])++; + if(sect_info[u].size < SIZE_SMALL_SECTS) + (iter->num_small_sects[(size_t)sect_info[u].size])++; /* Add section size to proper bin */ bin = ceil_log10((unsigned long)sect_info[u].size); if(bin >= iter->sect_nbins) { /* Allocate more storage for section info */ - iter->sect_bins = (unsigned long *)realloc(iter->sect_bins, (bin + 1) * sizeof(unsigned long)); - assert(iter->sect_bins); + iter->sect_bins = (unsigned long *)HDrealloc(iter->sect_bins, (bin + 1) * sizeof(unsigned long)); + HDassert(iter->sect_bins); /* Initialize counts for intermediate bins */ while(iter->sect_nbins < bin) @@ -792,9 +792,9 @@ freespace_stats(hid_t fid, iter_t *iter) * Saturday, August 12, 2006 * * Modifications: - * Vailin Choi; October 2009 - * Turn on display_group_metadata, display_dset_metadata - * Add 'S' & 's' for printing free space info (previous checkin) + * Vailin Choi; October 2009 + * Turn on display_group_metadata, display_dset_metadata + * Add 'S' & 's' for printing free space info (previous checkin) * *------------------------------------------------------------------------- */ @@ -802,86 +802,113 @@ static struct handler_t * parse_command_line(int argc, const char *argv[]) { int opt, i; - struct handler_t *hand; + struct handler_t *hand = NULL; /* Allocate space to hold the command line info */ - hand = (struct handler_t *)calloc((size_t)argc, sizeof(struct handler_t)); + if((hand = (struct handler_t *)HDcalloc((size_t)argc, sizeof(struct handler_t)))==NULL) { + error_msg("unable to parse command line arguments \n"); + goto error; + } /* parse command line options */ while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) { - switch ((char)opt) { - case 'h': - usage(h5tools_getprogname()); - leave(EXIT_SUCCESS); - - case 'V': - print_version(h5tools_getprogname()); - leave(EXIT_SUCCESS); - break; + switch ((char) opt) { + case 'h': + usage(h5tools_getprogname()); + h5tools_setstatus(EXIT_SUCCESS); + if (hand) { + for (i = 0; i < argc; i++) + if(hand[i].obj) { + free(hand[i].obj); + hand[i].obj=NULL; + } + + free(hand); + hand = NULL; + } + goto done; + break; - case 'F': - display_all = FALSE; - display_file_metadata = TRUE; - break; + case 'V': + print_version(h5tools_getprogname()); + h5tools_setstatus(EXIT_SUCCESS); + if (hand) { + for (i = 0; i < argc; i++) + if(hand[i].obj) { + free(hand[i].obj); + hand[i].obj=NULL; + } + + free(hand); + hand = NULL; + } + goto done; + break; - case 'f': - display_all = FALSE; - display_file = TRUE; - break; + case 'F': + display_all = FALSE; + display_file_metadata = TRUE; + break; - case 'G': - display_all = FALSE; - display_group_metadata = TRUE; - break; + case 'f': + display_all = FALSE; + display_file = TRUE; + break; - case 'g': - display_all = FALSE; - display_group = TRUE; - break; + case 'G': + display_all = FALSE; + display_group_metadata = TRUE; + break; - case 'D': - display_all = FALSE; - display_dset_metadata = TRUE; - break; + case 'g': + display_all = FALSE; + display_group = TRUE; + break; - case 'd': - display_all = FALSE; - display_dset = TRUE; - break; + case 'D': + display_all = FALSE; + display_dset_metadata = TRUE; + break; - case 'T': - display_all = FALSE; - display_dset_dtype_meta = TRUE; - break; + case 'd': + display_all = FALSE; + display_dset = TRUE; + break; - case 'A': - display_all = FALSE; - display_attr = TRUE; - break; + case 'T': + display_all = FALSE; + display_dset_dtype_meta = TRUE; + break; - case 's': - display_all = FALSE; - display_free_sections = TRUE; - break; + case 'A': + display_all = FALSE; + display_attr = TRUE; + break; - case 'S': - display_all = FALSE; - display_summary = TRUE; - break; + case 's': + display_all = FALSE; + display_free_sections = TRUE; + break; - case 'O': - display_all = FALSE; - display_object = TRUE; - for(i = 0; i < argc; i++) - if(!hand[i].obj) { - hand[i].obj = HDstrdup(opt_arg); - break; - } /* end if */ - break; + case 'S': + display_all = FALSE; + display_summary = TRUE; + break; - default: - usage(h5tools_getprogname()); - leave(EXIT_FAILURE); + case 'O': + display_all = FALSE; + display_object = TRUE; + for (i = 0; i < argc; i++) + if (!hand[i].obj) { + hand[i].obj = HDstrdup(opt_arg); + break; + } /* end if */ + break; + + default: + usage(h5tools_getprogname()); + h5tools_setstatus(EXIT_FAILURE); + goto error; } /* end switch */ } /* end while */ @@ -889,9 +916,26 @@ parse_command_line(int argc, const char *argv[]) if (argc <= opt_ind) { error_msg("missing file name\n"); usage(h5tools_getprogname()); - leave(EXIT_FAILURE); + h5tools_setstatus(EXIT_FAILURE); + goto error; } /* end if */ +done: + return hand; + +error: + if (hand) { + for (i = 0; i < argc; i++) + if(hand[i].obj) { + free(hand[i].obj); + hand[i].obj=NULL; + } + + free(hand); + hand = NULL; + } + h5tools_setstatus(EXIT_FAILURE); + return hand; } @@ -924,6 +968,45 @@ iter_init(iter_t *iter, hid_t fid) /*------------------------------------------------------------------------- + * Function: free_iter + * + * Purpose: Freee iter structure + * + * Return: Success: 0 + * + * Failure: Never fails + * + *------------------------------------------------------------------------- + */ +static herr_t +iter_free(iter_t *iter) +{ + /* Clear array of bins for group counts */ + if(iter->group_bins) + free(iter->group_bins); + iter->group_bins = NULL; + /* Clear array of bins for attribute counts */ + if(iter->attr_bins) + free(iter->attr_bins); + iter->attr_bins = NULL; + /* Clear dataset datatype information found */ + if(iter->dset_type_info) + free(iter->dset_type_info); + iter->dset_type_info = NULL; + /* Clear array of bins for dataset dimensions */ + if(iter->dset_dim_bins) + free(iter->dset_dim_bins); + iter->dset_dim_bins = NULL; + /* Clear array of bins for free-space section sizes */ + if(iter->sect_bins) + free(iter->sect_bins); + iter->sect_bins = NULL; + + return 0; +} + + +/*------------------------------------------------------------------------- * Function: print_file_info * * Purpose: Prints information about file @@ -956,6 +1039,66 @@ print_file_info(const iter_t *iter) /*------------------------------------------------------------------------- + * Function: print_file_metadata + * + * Purpose: Prints file space information for file's metadata + * + * Return: Success: 0 + * + * Failure: Never fails + * + * Programmer: Elena Pourmal + * Saturday, August 12, 2006 + * + *------------------------------------------------------------------------- + */ +static herr_t +print_file_metadata(const iter_t *iter) +{ + HDfprintf(stdout, "File space information for file metadata (in bytes):\n"); + HDfprintf(stdout, "\tSuperblock: %Hu\n", iter->super_size); + HDfprintf(stdout, "\tSuperblock extension: %Hu\n", iter->super_ext_size); + HDfprintf(stdout, "\tUser block: %Hu\n", iter->ublk_size); + + HDfprintf(stdout, "\tObject headers: (total/unused)\n"); + HDfprintf(stdout, "\t\tGroups: %Hu/%Hu\n", + iter->group_ohdr_info.total_size, + iter->group_ohdr_info.free_size); + HDfprintf(stdout, "\t\tDatasets(exclude compact data): %Hu/%Hu\n", + iter->dset_ohdr_info.total_size, + iter->dset_ohdr_info.free_size); + HDfprintf(stdout, "\t\tDatatypes: %Hu/%Hu\n", + iter->dtype_ohdr_info.total_size, + iter->dtype_ohdr_info.free_size); + + HDfprintf(stdout, "\tGroups:\n"); + HDfprintf(stdout, "\t\tB-tree/List: %Hu\n", iter->groups_btree_storage_size); + HDfprintf(stdout, "\t\tHeap: %Hu\n", iter->groups_heap_storage_size); + + HDfprintf(stdout, "\tAttributes:\n"); + HDfprintf(stdout, "\t\tB-tree/List: %Hu\n", iter->attrs_btree_storage_size); + HDfprintf(stdout, "\t\tHeap: %Hu\n", iter->attrs_heap_storage_size); + + HDfprintf(stdout, "\tChunked datasets:\n"); + HDfprintf(stdout, "\t\tIndex: %Hu\n", iter->datasets_index_storage_size); + + HDfprintf(stdout, "\tDatasets:\n"); + HDfprintf(stdout, "\t\tHeap: %Hu\n", iter->datasets_heap_storage_size); + + HDfprintf(stdout, "\tShared Messages:\n"); + HDfprintf(stdout, "\t\tHeader: %Hu\n", iter->SM_hdr_storage_size); + HDfprintf(stdout, "\t\tB-tree/List: %Hu\n", iter->SM_index_storage_size); + HDfprintf(stdout, "\t\tHeap: %Hu\n", iter->SM_heap_storage_size); + + HDfprintf(stdout, "\tFree-space managers:\n"); + HDfprintf(stdout, "\t\tHeader: %Hu\n", iter->free_hdr); + HDfprintf(stdout, "\t\tAmount of free space: %Hu\n", iter->free_space); + + return 0; +} /* print_file_metadata() */ + + +/*------------------------------------------------------------------------- * Function: print_group_info * * Purpose: Prints information about groups in the file @@ -968,9 +1111,9 @@ print_file_info(const iter_t *iter) * Saturday, August 12, 2006 * * Modifications: - * bug #1253; Oct 6th 2008; Vailin Choi - * Fixed segmentation fault: print iter->group_bins[0] when - * there is iter->group_nbins + * bug #1253; Oct 6th 2008; Vailin Choi + * Fixed segmentation fault: print iter->group_bins[0] when + * there is iter->group_nbins * *------------------------------------------------------------------------- */ @@ -1013,54 +1156,31 @@ print_group_info(const iter_t *iter) /*------------------------------------------------------------------------- - * Function: print_attr_info + * Function: print_group_metadata * - * Purpose: Prints information about attributes in the file + * Purpose: Prints file space information for groups' metadata * * Return: Success: 0 * * Failure: Never fails * - * Programmer: Vailin Choi - * July 12, 2007 - * - * Modifications: + * Programmer: Vailin Choi; October 2009 * *------------------------------------------------------------------------- */ static herr_t -print_attr_info(const iter_t *iter) +print_group_metadata(const iter_t *iter) { - unsigned long power; /* Temporary "power" for bins */ - unsigned long total; /* Total count for various statistics */ - unsigned u; /* Local index variable */ + printf("File space information for groups' metadata (in bytes):\n"); - printf("Small # of attributes:\n"); - total = 0; - for(u = 1; u < SIZE_SMALL_ATTRS; u++) { - if(iter->num_small_attrs[u] > 0) { - printf("\t# of objects with %u attributes: %lu\n", u, iter->num_small_attrs[u]); - total += iter->num_small_attrs[u]; - } /* end if */ - } /* end for */ - printf("\tTotal # of objects with small # of attributes: %lu\n", total); + HDfprintf(stdout, "\tObject headers (total/unused): %Hu/%Hu\n", + iter->group_ohdr_info.total_size, iter->group_ohdr_info.free_size); - printf("Attribute bins:\n"); - total = 0; - power = 1; - for(u = 1; u < iter->attr_nbins; u++) { - if(iter->attr_bins[u] > 0) { - printf("\t# of objects with %lu - %lu attributes: %lu\n", power, (power * 10) - 1, - iter->attr_bins[u]); - total += iter->attr_bins[u]; - } /* end if */ - power *= 10; - } /* end for */ - printf("\tTotal # of objects with attributes: %lu\n", total); - printf("\tMax. # of attributes to objects: %lu\n", (unsigned long)iter->max_attrs); + HDfprintf(stdout, "\tB-tree/List: %Hu\n", iter->groups_btree_storage_size); + HDfprintf(stdout, "\tHeap: %Hu\n", iter->groups_heap_storage_size); return 0; -} /* print_attr_info() */ +} /* print_group_metadata() */ /*------------------------------------------------------------------------- @@ -1154,6 +1274,35 @@ print_dataset_info(const iter_t *iter) /*------------------------------------------------------------------------- + * Function: print_dataset_metadata + * + * Purpose: Prints file space information for datasets' metadata + * + * Return: Success: 0 + * + * Failure: Never fails + * + * Programmer: Vailin Choi; October 2009 + * + *------------------------------------------------------------------------- + */ +static herr_t +print_dset_metadata(const iter_t *iter) +{ + printf("File space information for datasets' metadata (in bytes):\n"); + + HDfprintf(stdout, "\tObject headers (total/unused): %Hu/%Hu\n", + iter->dset_ohdr_info.total_size, iter->dset_ohdr_info.free_size); + + HDfprintf(stdout, "\tIndex for Chunked datasets: %Hu\n", + iter->datasets_index_storage_size); + HDfprintf(stdout, "\tHeap: %Hu\n", iter->datasets_heap_storage_size); + + return 0; +} /* print_dset_metadata() */ + + +/*------------------------------------------------------------------------- * Function: print_dset_dtype_meta * * Purpose: Prints datasets' datatype information @@ -1165,8 +1314,8 @@ print_dataset_info(const iter_t *iter) * Programmer: * * Modifications: - * Vailin Choi; October 2009 - * Moved from print_dataset_info() + * Vailin Choi; October 2009 + * Moved from print_dataset_info() * *------------------------------------------------------------------------- */ @@ -1178,20 +1327,20 @@ print_dset_dtype_meta(const iter_t *iter) unsigned u; /* Local index variable */ if(iter->dset_ntypes) { - printf("Dataset datatype information:\n"); - printf("\t# of unique datatypes used by datasets: %lu\n", iter->dset_ntypes); - total = 0; - for(u = 0; u < iter->dset_ntypes; u++) { - H5Tencode(iter->dset_type_info[u].tid, NULL, &dtype_size); - printf("\tDataset datatype #%u:\n", u); - printf("\t\tCount (total/named) = (%lu/%lu)\n", - iter->dset_type_info[u].count, iter->dset_type_info[u].named); - printf("\t\tSize (desc./elmt) = (%lu/%lu)\n", (unsigned long)dtype_size, - (unsigned long)H5Tget_size(iter->dset_type_info[u].tid)); - H5Tclose(iter->dset_type_info[u].tid); - total += iter->dset_type_info[u].count; - } /* end for */ - printf("\tTotal dataset datatype count: %lu\n", total); + printf("Dataset datatype information:\n"); + printf("\t# of unique datatypes used by datasets: %lu\n", iter->dset_ntypes); + total = 0; + for(u = 0; u < iter->dset_ntypes; u++) { + H5Tencode(iter->dset_type_info[u].tid, NULL, &dtype_size); + printf("\tDataset datatype #%u:\n", u); + printf("\t\tCount (total/named) = (%lu/%lu)\n", + iter->dset_type_info[u].count, iter->dset_type_info[u].named); + printf("\t\tSize (desc./elmt) = (%lu/%lu)\n", (unsigned long)dtype_size, + (unsigned long)H5Tget_size(iter->dset_type_info[u].tid)); + H5Tclose(iter->dset_type_info[u].tid); + total += iter->dset_type_info[u].count; + } /* end for */ + printf("\tTotal dataset datatype count: %lu\n", total); } return 0; @@ -1199,6 +1348,57 @@ print_dset_dtype_meta(const iter_t *iter) /*------------------------------------------------------------------------- + * Function: print_attr_info + * + * Purpose: Prints information about attributes in the file + * + * Return: Success: 0 + * + * Failure: Never fails + * + * Programmer: Vailin Choi + * July 12, 2007 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +static herr_t +print_attr_info(const iter_t *iter) +{ + unsigned long power; /* Temporary "power" for bins */ + unsigned long total; /* Total count for various statistics */ + unsigned u; /* Local index variable */ + + printf("Small # of attributes:\n"); + total = 0; + for(u = 1; u < SIZE_SMALL_ATTRS; u++) { + if(iter->num_small_attrs[u] > 0) { + printf("\t# of objects with %u attributes: %lu\n", u, iter->num_small_attrs[u]); + total += iter->num_small_attrs[u]; + } /* end if */ + } /* end for */ + printf("\tTotal # of objects with small # of attributes: %lu\n", total); + + printf("Attribute bins:\n"); + total = 0; + power = 1; + for(u = 1; u < iter->attr_nbins; u++) { + if(iter->attr_bins[u] > 0) { + printf("\t# of objects with %lu - %lu attributes: %lu\n", power, (power * 10) - 1, + iter->attr_bins[u]); + total += iter->attr_bins[u]; + } /* end if */ + power *= 10; + } /* end for */ + printf("\tTotal # of objects with attributes: %lu\n", total); + printf("\tMax. # of attributes to objects: %lu\n", (unsigned long)iter->max_attrs); + + return 0; +} /* print_attr_info() */ + + +/*------------------------------------------------------------------------- * Function: print_freespace_info * * Purpose: Prints information about free space in the file @@ -1270,42 +1470,41 @@ print_storage_summary(const iter_t *iter) HDfprintf(stdout, "File space management strategy: %s\n", FS_STRATEGY_NAME[iter->fs_strategy]); printf("Summary of file space information:\n"); total_meta = - iter->super_size + iter->super_ext_size + iter->ublk_size + - iter->group_ohdr_info.total_size + - iter->dset_ohdr_info.total_size + - iter->dtype_ohdr_info.total_size + - iter->groups_btree_storage_size + - iter->groups_heap_storage_size + - iter->attrs_btree_storage_size + - iter->attrs_heap_storage_size + - iter->datasets_index_storage_size + - iter->datasets_heap_storage_size + - iter->SM_hdr_storage_size + - iter->SM_index_storage_size + - iter->SM_heap_storage_size + - iter->free_hdr; + iter->super_size + iter->super_ext_size + iter->ublk_size + + iter->group_ohdr_info.total_size + + iter->dset_ohdr_info.total_size + + iter->dtype_ohdr_info.total_size + + iter->groups_btree_storage_size + + iter->groups_heap_storage_size + + iter->attrs_btree_storage_size + + iter->attrs_heap_storage_size + + iter->datasets_index_storage_size + + iter->datasets_heap_storage_size + + iter->SM_hdr_storage_size + + iter->SM_index_storage_size + + iter->SM_heap_storage_size + + iter->free_hdr; HDfprintf(stdout, " File metadata: %Hu bytes\n", total_meta); HDfprintf(stdout, " Raw data: %Hu bytes\n", iter->dset_storage_size); percent = ((float)iter->free_space / (float)iter->filesize) * 100; HDfprintf(stdout, " Amount/Percent of tracked free space: %Hu bytes/%3.1f%\n", - iter->free_space, percent); + iter->free_space, percent); if(iter->filesize < (total_meta+iter->dset_storage_size+iter->free_space)) { - unaccount = (total_meta + iter->dset_storage_size + iter->free_space) - iter->filesize; - HDfprintf(stdout, " ??? File has %Hu more bytes accounted for than its size! ???\n", unaccount); + unaccount = (total_meta + iter->dset_storage_size + iter->free_space) - iter->filesize; + HDfprintf(stdout, " ??? File has %Hu more bytes accounted for than its size! ???\n", unaccount); } else { - unaccount = iter->filesize - (total_meta + iter->dset_storage_size + iter->free_space); - HDfprintf(stdout, " Unaccounted space: %Hu bytes\n", unaccount); + unaccount = iter->filesize - (total_meta + iter->dset_storage_size + iter->free_space); + HDfprintf(stdout, " Unaccounted space: %Hu bytes\n", unaccount); } - HDfprintf(stdout, "Total space: %Hu bytes\n", - total_meta+iter->dset_storage_size+iter->free_space+unaccount); + HDfprintf(stdout, "Total space: %Hu bytes\n", total_meta+iter->dset_storage_size+iter->free_space+unaccount); if(iter->nexternal) - HDfprintf(stdout, "External raw data: %Hu bytes\n", iter->dset_external_storage_size); + HDfprintf(stdout, "External raw data: %Hu bytes\n", iter->dset_external_storage_size); return 0; @@ -1313,123 +1512,6 @@ print_storage_summary(const iter_t *iter) /*------------------------------------------------------------------------- - * Function: print_file_metadata - * - * Purpose: Prints file space information for file's metadata - * - * Return: Success: 0 - * - * Failure: Never fails - * - * Programmer: Elena Pourmal - * Saturday, August 12, 2006 - * - *------------------------------------------------------------------------- - */ -static herr_t -print_file_metadata(const iter_t *iter) -{ - HDfprintf(stdout, "File space information for file metadata (in bytes):\n"); - HDfprintf(stdout, "\tSuperblock: %Hu\n", iter->super_size); - HDfprintf(stdout, "\tSuperblock extension: %Hu\n", iter->super_ext_size); - HDfprintf(stdout, "\tUser block: %Hu\n", iter->ublk_size); - - HDfprintf(stdout, "\tObject headers: (total/unused)\n"); - HDfprintf(stdout, "\t\tGroups: %Hu/%Hu\n", - iter->group_ohdr_info.total_size, - iter->group_ohdr_info.free_size); - HDfprintf(stdout, "\t\tDatasets(exclude compact data): %Hu/%Hu\n", - iter->dset_ohdr_info.total_size, - iter->dset_ohdr_info.free_size); - HDfprintf(stdout, "\t\tDatatypes: %Hu/%Hu\n", - iter->dtype_ohdr_info.total_size, - iter->dtype_ohdr_info.free_size); - - HDfprintf(stdout, "\tGroups:\n"); - HDfprintf(stdout, "\t\tB-tree/List: %Hu\n", iter->groups_btree_storage_size); - HDfprintf(stdout, "\t\tHeap: %Hu\n", iter->groups_heap_storage_size); - - HDfprintf(stdout, "\tAttributes:\n"); - HDfprintf(stdout, "\t\tB-tree/List: %Hu\n", iter->attrs_btree_storage_size); - HDfprintf(stdout, "\t\tHeap: %Hu\n", iter->attrs_heap_storage_size); - - HDfprintf(stdout, "\tChunked datasets:\n"); - HDfprintf(stdout, "\t\tIndex: %Hu\n", iter->datasets_index_storage_size); - - HDfprintf(stdout, "\tDatasets:\n"); - HDfprintf(stdout, "\t\tHeap: %Hu\n", iter->datasets_heap_storage_size); - - HDfprintf(stdout, "\tShared Messages:\n"); - HDfprintf(stdout, "\t\tHeader: %Hu\n", iter->SM_hdr_storage_size); - HDfprintf(stdout, "\t\tB-tree/List: %Hu\n", iter->SM_index_storage_size); - HDfprintf(stdout, "\t\tHeap: %Hu\n", iter->SM_heap_storage_size); - - HDfprintf(stdout, "\tFree-space managers:\n"); - HDfprintf(stdout, "\t\tHeader: %Hu\n", iter->free_hdr); - HDfprintf(stdout, "\t\tAmount of free space: %Hu\n", iter->free_space); - - return 0; -} /* print_file_metadata() */ - - -/*------------------------------------------------------------------------- - * Function: print_group_metadata - * - * Purpose: Prints file space information for groups' metadata - * - * Return: Success: 0 - * - * Failure: Never fails - * - * Programmer: Vailin Choi; October 2009 - * - *------------------------------------------------------------------------- - */ -static herr_t -print_group_metadata(const iter_t *iter) -{ - printf("File space information for groups' metadata (in bytes):\n"); - - HDfprintf(stdout, "\tObject headers (total/unused): %Hu/%Hu\n", - iter->group_ohdr_info.total_size, iter->group_ohdr_info.free_size); - - HDfprintf(stdout, "\tB-tree/List: %Hu\n", iter->groups_btree_storage_size); - HDfprintf(stdout, "\tHeap: %Hu\n", iter->groups_heap_storage_size); - - return 0; -} /* print_group_metadata() */ - - -/*------------------------------------------------------------------------- - * Function: print_dataset_metadata - * - * Purpose: Prints file space information for datasets' metadata - * - * Return: Success: 0 - * - * Failure: Never fails - * - * Programmer: Vailin Choi; October 2009 - * - *------------------------------------------------------------------------- - */ -static herr_t -print_dset_metadata(const iter_t *iter) -{ - printf("File space information for datasets' metadata (in bytes):\n"); - - HDfprintf(stdout, "\tObject headers (total/unused): %Hu/%Hu\n", - iter->dset_ohdr_info.total_size, iter->dset_ohdr_info.free_size); - - HDfprintf(stdout, "\tIndex for Chunked datasets: %Hu\n", - iter->datasets_index_storage_size); - HDfprintf(stdout, "\tHeap: %Hu\n", iter->datasets_heap_storage_size); - - return 0; -} /* print_dset_metadata() */ - - -/*------------------------------------------------------------------------- * Function: print_file_statistics * * Purpose: Prints file statistics @@ -1442,9 +1524,9 @@ print_dset_metadata(const iter_t *iter) * Saturday, August 12, 2006 * * Modifications: - * Vailin Choi; October 2009 - * Activate "display_group_metadata", "dislay_dset_metadata" and - * "display_dset_dtype_info". + * Vailin Choi; October 2009 + * Activate "display_group_metadata", "dislay_dset_metadata" and + * "display_dset_dtype_info". * *------------------------------------------------------------------------- */ @@ -1455,29 +1537,29 @@ print_file_statistics(const iter_t *iter) display_file = TRUE; display_group = TRUE; display_dset = TRUE; - display_dset_dtype_meta = TRUE; + display_dset_dtype_meta = TRUE; display_attr = TRUE; - display_free_sections = TRUE; - display_summary = TRUE; + display_free_sections = TRUE; + display_summary = TRUE; display_file_metadata = TRUE; display_group_metadata = TRUE; display_dset_metadata = TRUE; } - if(display_file) print_file_info(iter); - if(display_file_metadata) print_file_metadata(iter); + if(display_file) print_file_info(iter); + if(display_file_metadata) print_file_metadata(iter); - if(display_group) print_group_info(iter); - if(!display_all && display_group_metadata) print_group_metadata(iter); + if(display_group) print_group_info(iter); + if(!display_all && display_group_metadata) print_group_metadata(iter); - if(display_dset) print_dataset_info(iter); + if(display_dset) print_dataset_info(iter); if(display_dset_dtype_meta) print_dset_dtype_meta(iter); - if(!display_all && display_dset_metadata) print_dset_metadata(iter); + if(!display_all && display_dset_metadata) print_dset_metadata(iter); - if(display_attr) print_attr_info(iter); - if(display_free_sections) print_freespace_info(iter); - if(display_summary) print_storage_summary(iter); + if(display_attr) print_attr_info(iter); + if(display_free_sections) print_freespace_info(iter); + if(display_summary) print_storage_summary(iter); } @@ -1533,12 +1615,13 @@ print_statistics(const char *name, const iter_t *iter) int main(int argc, const char *argv[]) { - iter_t iter; - const char *fname = NULL; - hid_t fid; - hid_t fcpl; - struct handler_t *hand; - H5F_info2_t finfo; + iter_t iter; + const char *fname = NULL; + hid_t fid; + hid_t fcpl; + struct handler_t *hand = NULL; + H5F_info2_t finfo; + int i; h5tools_setprogname(PROGRAMNAME); h5tools_setstatus(EXIT_SUCCESS); @@ -1548,11 +1631,10 @@ main(int argc, const char *argv[]) /* Initialize h5tools lib */ h5tools_init(); - hand = parse_command_line (argc, argv); - if(!hand) { - error_msg("unable to parse command line arguments \n"); - leave(EXIT_FAILURE); - } /* end if */ + + if((hand = parse_command_line(argc, argv))==NULL) { + goto done; + } fname = argv[opt_ind]; @@ -1561,27 +1643,28 @@ main(int argc, const char *argv[]) fid = H5Fopen(fname, H5F_ACC_RDONLY, H5P_DEFAULT); if(fid < 0) { error_msg("unable to open file \"%s\"\n", fname); - leave(EXIT_FAILURE); + h5tools_setstatus(EXIT_FAILURE); + goto done; } /* end if */ /* Initialize iter structure */ iter_init(&iter, fid); if(H5Fget_filesize(fid, &iter.filesize) < 0) - warn_msg("Unable to retrieve file size\n"); - assert(iter.filesize != 0); + warn_msg("Unable to retrieve file size\n"); + HDassert(iter.filesize != 0); /* Get storge info for file-level structures */ if(H5Fget_info2(fid, &finfo) < 0) - warn_msg("Unable to retrieve file info\n"); + warn_msg("Unable to retrieve file info\n"); else { - iter.super_size = finfo.super.super_size; - iter.super_ext_size = finfo.super.super_ext_size; - iter.SM_hdr_storage_size = finfo.sohm.hdr_size; - iter.SM_index_storage_size = finfo.sohm.msgs_info.index_size; - iter.SM_heap_storage_size = finfo.sohm.msgs_info.heap_size; - iter.free_space = finfo.free.tot_space; - iter.free_hdr = finfo.free.meta_size; + iter.super_size = finfo.super.super_size; + iter.super_ext_size = finfo.super.super_ext_size; + iter.SM_hdr_storage_size = finfo.sohm.hdr_size; + iter.SM_index_storage_size = finfo.sohm.msgs_info.index_size; + iter.SM_heap_storage_size = finfo.sohm.msgs_info.heap_size; + iter.free_space = finfo.free.tot_space; + iter.free_hdr = finfo.free.meta_size; } /* end else */ if((fcpl = H5Fget_create_plist(fid)) < 0) @@ -1592,7 +1675,7 @@ main(int argc, const char *argv[]) if(H5Pget_file_space(fcpl, &iter.fs_strategy, &iter.fs_threshold) < 0) warn_msg("Unable to retrieve file space information\n"); - assert(iter.fs_strategy != 0 && iter.fs_strategy < H5F_FILE_SPACE_NTYPES); + HDassert(iter.fs_strategy != 0 && iter.fs_strategy < H5F_FILE_SPACE_NTYPES); /* get information for free-space sections */ if(freespace_stats(fid, &iter) < 0) @@ -1605,26 +1688,39 @@ main(int argc, const char *argv[]) u = 0; while(hand[u].obj) { if (h5trav_visit(fid, hand[u].obj, TRUE, TRUE, obj_stats, lnk_stats, &iter) < 0) - warn_msg("Unable to traverse object \"%s\"\n", hand[u].obj); - else - print_statistics(hand[u].obj, &iter); + warn_msg("Unable to traverse object \"%s\"\n", hand[u].obj); + else + print_statistics(hand[u].obj, &iter); u++; } /* end while */ } /* end if */ else { if (h5trav_visit(fid, "/", TRUE, TRUE, obj_stats, lnk_stats, &iter) < 0) - warn_msg("Unable to traverse objects/links in file \"%s\"\n", fname); - else - print_statistics("/", &iter); + warn_msg("Unable to traverse objects/links in file \"%s\"\n", fname); + else + print_statistics("/", &iter); } /* end else */ - if (hand) free(hand); - - if(H5Fclose(fid) < 0) { - error_msg("unable to close file \"%s\"\n", fname); - leave(EXIT_FAILURE); +done: + if(hand) { + for (i = 0; i < argc; i++) + if(hand[i].obj) { + free(hand[i].obj); + hand[i].obj=NULL; + } + + free(hand); + hand = NULL; + + /* Free iter structure */ + iter_free(&iter); + + if(H5Fclose(fid) < 0) { + error_msg("unable to close file \"%s\"\n", fname); + h5tools_setstatus(EXIT_FAILURE); + } } - leave(EXIT_SUCCESS); + leave(h5tools_getstatus()); } diff --git a/tools/h5stat/h5stat_gentest.c b/tools/h5stat/h5stat_gentest.c index cf17195..20e78ff 100644 --- a/tools/h5stat/h5stat_gentest.c +++ b/tools/h5stat/h5stat_gentest.c @@ -47,7 +47,7 @@ static void gen_file(void) { hid_t fcpl; /* File creation property */ hid_t fapl; /* File access property */ - hid_t file; /* File id */ + hid_t file; /* File id */ hid_t gid; /* Group id */ hid_t type_id; /* Datatype id */ hid_t space_id; /* Dataspace id */ @@ -55,7 +55,7 @@ static void gen_file(void) hid_t dset_id; /* Dataset id */ char name[30]; /* Group name */ char attrname[30]; /* Attribute name */ - int ret; /* Return value */ + int ret; /* Return value */ int i; /* Local index variable */ fapl = H5Pcreate(H5P_FILE_ACCESS); diff --git a/tools/h5stat/testh5stat.sh.in b/tools/h5stat/testh5stat.sh.in index c6c377e..c4e99d7 100644 --- a/tools/h5stat/testh5stat.sh.in +++ b/tools/h5stat/testh5stat.sh.in @@ -32,6 +32,7 @@ STAT_BIN=`pwd`/$STAT # The path of the tool binary CMP='cmp -s' DIFF='diff -c' +CP='cp' nerrors=0 verbose=yes @@ -41,7 +42,79 @@ if test -z "$srcdir"; then srcdir=. fi -test -d ./testfiles || mkdir ./testfiles +# source dirs +SRC_TOOLS="$srcdir/.." +SRC_TOOLS_TESTFILES="$SRC_TOOLS/testfiles" + +# testfiles source dirs for tools +SRC_H5LS_TESTFILES="$SRC_TOOLS_TESTFILES" +SRC_H5DUMP_TESTFILES="$SRC_TOOLS_TESTFILES" +SRC_H5DIFF_TESTFILES="$SRC_TOOLS/h5diff/testfiles" +SRC_H5COPY_TESTFILES="$SRC_TOOLS/h5copy/testfiles" +SRC_H5REPACK_TESTFILES="$SRC_TOOLS/h5repack/testfiles" +SRC_H5JAM_TESTFILES="$SRC_TOOLS/h5jam/testfiles" +SRC_H5STAT_TESTFILES="$SRC_TOOLS/h5stat/testfiles" +SRC_H5IMPORT_TESTFILES="$SRC_TOOLS/h5import/testfiles" + +TESTDIR=./testfiles +test -d $TESTDIR || mkdir $TESTDIR + +###################################################################### +# test files +# -------------------------------------------------------------------- +# All the test files copy from source directory to test directory +# NOTE: Keep this framework to add/remove test files. +# Any test files from other tools can be used in this framework. +# This list are also used for checking exist. +# Comment '#' without space can be used. +# -------------------------------------------------------------------- +LIST_HDF5_TEST_FILES=" +$SRC_H5STAT_TESTFILES/h5stat_filters.h5 +$SRC_H5STAT_TESTFILES/h5stat_tsohm.h5 +$SRC_H5STAT_TESTFILES/h5stat_newgrat.h5 +" + +LIST_OTHER_TEST_FILES=" +$SRC_H5STAT_TESTFILES/h5stat_help1.ddl +$SRC_H5STAT_TESTFILES/h5stat_help2.ddl +$SRC_H5STAT_TESTFILES/h5stat_filters.ddl +$SRC_H5STAT_TESTFILES/h5stat_filters-file.ddl +$SRC_H5STAT_TESTFILES/h5stat_filters-F.ddl +$SRC_H5STAT_TESTFILES/h5stat_filters-d.ddl +$SRC_H5STAT_TESTFILES/h5stat_filters-g.ddl +$SRC_H5STAT_TESTFILES/h5stat_filters-dT.ddl +$SRC_H5STAT_TESTFILES/h5stat_filters-UD.ddl +$SRC_H5STAT_TESTFILES/h5stat_filters-UT.ddl +$SRC_H5STAT_TESTFILES/h5stat_tsohm.ddl +$SRC_H5STAT_TESTFILES/h5stat_newgrat.ddl +$SRC_H5STAT_TESTFILES/h5stat_newgrat-UG.ddl +$SRC_H5STAT_TESTFILES/h5stat_newgrat-UA.ddl +" + +# +# copy test files and expected output files from source dirs to test dir +# +COPY_TESTFILES="$LIST_HDF5_TEST_FILES $LIST_OTHER_TEST_FILES" + +COPY_TESTFILES_TO_TESTDIR() +{ + # copy test files. Used -f to make sure get a new copy + for tstfile in $COPY_TESTFILES + do + # ignore '#' comment + echo $tstfile | tr -d ' ' | grep '^#' > /dev/null + RET=$? + if [ $RET -eq 1 ]; then + if [ -a $tstfile ]; then + $CP -f $tstfile $TESTDIR + else + echo "Error: FAILED to copy $tstfile" + echo " $tstfile doesn't exist!" + exit $EXIT_FAILURE + fi + fi + done +} # Print a line-line message left justified in a field of 70 characters # beginning with the word "Testing". @@ -60,9 +133,9 @@ TESTING() { # non-zero value. # TOOLTEST() { - expect="$srcdir/testfiles/$1" - actual="./testfiles/`basename $1 .ddl`.out" - actual_err="./testfiles/`basename $1 .ddl`.err" + expect="$TESTDIR/$1" + actual="$TESTDIR/`basename $1 .ddl`.out" + actual_err="$TESTDIR/`basename $1 .ddl`.err" shift # Run test. @@ -71,7 +144,7 @@ TOOLTEST() { echo "#############################" echo "Expected output for '$STAT $@'" echo "#############################" - cd $srcdir/testfiles + cd $TESTDIR $RUNSERIAL $STAT_BIN $@ ) >$actual 2>$actual_err cat $actual_err >> $actual @@ -110,6 +183,8 @@ SKIP() { ### T H E T E S T S ### ############################################################################## ############################################################################## +# prepare for test +COPY_TESTFILES_TO_TESTDIR # Test for help flag TOOLTEST h5stat_help1.ddl -h diff --git a/tools/lib/CMakeLists.txt b/tools/lib/CMakeLists.txt index c3662f6..837a14e 100644 --- a/tools/lib/CMakeLists.txt +++ b/tools/lib/CMakeLists.txt @@ -1,11 +1,9 @@ -cmake_minimum_required (VERSION 2.8) +cmake_minimum_required (VERSION 2.8.6) PROJECT (HDF5_TOOLS_LIB) #----------------------------------------------------------------------------- # Define Sources #----------------------------------------------------------------------------- -#INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib) -#INCLUDE_DIRECTORIES (${HDF5_PROJECT_DIR}/test) SET (H5_TOOLS_LIB_SRCS ${HDF5_TOOLS_LIB_SOURCE_DIR}/h5diff.c @@ -14,6 +12,7 @@ SET (H5_TOOLS_LIB_SRCS ${HDF5_TOOLS_LIB_SOURCE_DIR}/h5diff_dset.c ${HDF5_TOOLS_LIB_SOURCE_DIR}/h5diff_util.c ${HDF5_TOOLS_LIB_SOURCE_DIR}/h5tools.c + ${HDF5_TOOLS_LIB_SOURCE_DIR}/h5tools_dump.c ${HDF5_TOOLS_LIB_SOURCE_DIR}/h5tools_filters.c ${HDF5_TOOLS_LIB_SOURCE_DIR}/h5tools_ref.c ${HDF5_TOOLS_LIB_SOURCE_DIR}/h5tools_str.c @@ -25,6 +24,7 @@ SET (H5_TOOLS_LIB_SRCS SET (H5_TOOLS_LIB_HDRS ${HDF5_TOOLS_LIB_SOURCE_DIR}/h5trav.h ${HDF5_TOOLS_LIB_SOURCE_DIR}/h5tools.h + ${HDF5_TOOLS_LIB_SOURCE_DIR}/h5tools_dump.h ${HDF5_TOOLS_LIB_SOURCE_DIR}/h5tools_utils.h ${HDF5_TOOLS_LIB_SOURCE_DIR}/h5tools_str.h ${HDF5_TOOLS_LIB_SOURCE_DIR}/h5tools_ref.h @@ -38,8 +38,9 @@ H5_SET_LIB_OPTIONS ( ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TOOLS_LIB_NAME} ${LIB_TYPE} HDF5_TOOLS_LIB_NAME_RELEASE - HDF5_TOOLS_LIB_NAME_DEBUG + HDF5_TOOLS_LIB_NAME_DEBUG ) +SET_TARGET_PROPERTIES (hdf5_tools PROPERTIES FOLDER libraries/tools) ############################################################################## ############################################################################## @@ -54,7 +55,7 @@ INSTALL ( FILES ${H5_TOOLS_LIB_HDRS} DESTINATION - ${HDF5_INSTALL_INCLUDE_DIR}/tools + ${HDF5_INSTALL_INCLUDE_DIR} COMPONENT toolsheaders ) @@ -68,7 +69,7 @@ IF (APPLE) IF (HDF5_BUILD_WITH_INSTALL_NAME) SET_TARGET_PROPERTIES(${HDF5_TOOLS_LIB_TARGET} PROPERTIES LINK_FLAGS "-current_version ${HDF5_PACKAGE_VERSION} -compatibility_version ${HDF5_PACKAGE_VERSION}" - INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib/tools" + INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib" BUILD_WITH_INSTALL_RPATH ${HDF5_BUILD_WITH_INSTALL_NAME} ) ENDIF (HDF5_BUILD_WITH_INSTALL_NAME) @@ -83,8 +84,8 @@ IF (HDF5_EXPORTED_TARGETS) ${HDF5_TOOLS_LIB_TARGET} EXPORT ${HDF5_EXPORTED_TARGETS} - LIBRARY DESTINATION ${HDF5_INSTALL_LIB_DIR}/tools COMPONENT toolslibraries - ARCHIVE DESTINATION ${HDF5_INSTALL_LIB_DIR}/tools COMPONENT toolslibraries - RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR}/tools COMPONENT toolslibraries + LIBRARY DESTINATION ${HDF5_INSTALL_LIB_DIR} COMPONENT toolslibraries + ARCHIVE DESTINATION ${HDF5_INSTALL_LIB_DIR} COMPONENT toolslibraries + RUNTIME DESTINATION ${HDF5_INSTALL_BIN_DIR} COMPONENT toolslibraries ) ENDIF (HDF5_EXPORTED_TARGETS) diff --git a/tools/lib/Makefile.am b/tools/lib/Makefile.am index 43ee863..e364b47 100644 --- a/tools/lib/Makefile.am +++ b/tools/lib/Makefile.am @@ -26,7 +26,7 @@ INCLUDES=-I$(top_srcdir)/src # This is our main target, the h5tools library. noinst_LTLIBRARIES=libh5tools.la -libh5tools_la_SOURCES=h5tools.c h5tools_str.c h5tools_utils.c h5diff.c \ +libh5tools_la_SOURCES=h5tools.c h5tools_dump.c h5tools_str.c h5tools_utils.c h5diff.c \ h5diff_array.c h5diff_attr.c h5diff_dset.c h5diff_util.c h5trav.c \ h5tools_filters.c h5tools_ref.c h5tools_type.c diff --git a/tools/lib/Makefile.in b/tools/lib/Makefile.in index ea898db..beeb42f 100644 --- a/tools/lib/Makefile.in +++ b/tools/lib/Makefile.in @@ -67,10 +67,10 @@ CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libh5tools_la_LIBADD = -am_libh5tools_la_OBJECTS = h5tools.lo h5tools_str.lo h5tools_utils.lo \ - h5diff.lo h5diff_array.lo h5diff_attr.lo h5diff_dset.lo \ - h5diff_util.lo h5trav.lo h5tools_filters.lo h5tools_ref.lo \ - h5tools_type.lo +am_libh5tools_la_OBJECTS = h5tools.lo h5tools_dump.lo h5tools_str.lo \ + h5tools_utils.lo h5diff.lo h5diff_array.lo h5diff_attr.lo \ + h5diff_dset.lo h5diff_util.lo h5trav.lo h5tools_filters.lo \ + h5tools_ref.lo h5tools_type.lo libh5tools_la_OBJECTS = $(am_libh5tools_la_OBJECTS) AM_V_lt = $(am__v_lt_$(V)) am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) @@ -174,6 +174,7 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ +FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ @@ -194,10 +195,12 @@ H5_LONE_COLON = @H5_LONE_COLON@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ +HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ +HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ @@ -393,7 +396,7 @@ INCLUDES = -I$(top_srcdir)/src # This is our main target, the h5tools library. noinst_LTLIBRARIES = libh5tools.la -libh5tools_la_SOURCES = h5tools.c h5tools_str.c h5tools_utils.c h5diff.c \ +libh5tools_la_SOURCES = h5tools.c h5tools_dump.c h5tools_str.c h5tools_utils.c h5diff.c \ h5diff_array.c h5diff_attr.c h5diff_dset.c h5diff_util.c h5trav.c \ h5tools_filters.c h5tools_ref.c h5tools_type.c @@ -487,6 +490,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/h5diff_dset.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/h5diff_util.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/h5tools.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/h5tools_dump.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/h5tools_filters.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/h5tools_ref.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/h5tools_str.Plo@am__quote@ diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c index a4d8469..c6353eb 100644 --- a/tools/lib/h5diff.c +++ b/tools/lib/h5diff.c @@ -25,11 +25,11 @@ * Debug printf macros. The prefix allows output filtering by test scripts. */ #ifdef H5DIFF_DEBUG -#define h5diffdebug(x) fprintf(stderr, "h5diff debug: " x) -#define h5diffdebug2(x1, x2) fprintf(stderr, "h5diff debug: " x1, x2) -#define h5diffdebug3(x1, x2, x3) fprintf(stderr, "h5diff debug: " x1, x2, x3) -#define h5diffdebug4(x1, x2, x3, x4) fprintf(stderr, "h5diff debug: " x1, x2, x3, x4) -#define h5diffdebug5(x1, x2, x3, x4, x5) fprintf(stderr, "h5diff debug: " x1, x2, x3, x4, x5) +#define h5diffdebug(x) HDfprintf(stderr, "h5diff debug: " x) +#define h5diffdebug2(x1, x2) HDfprintf(stderr, "h5diff debug: " x1, x2) +#define h5diffdebug3(x1, x2, x3) HDfprintf(stderr, "h5diff debug: " x1, x2, x3) +#define h5diffdebug4(x1, x2, x3, x4) HDfprintf(stderr, "h5diff debug: " x1, x2, x3, x4) +#define h5diffdebug5(x1, x2, x3, x4, x5) HDfprintf(stderr, "h5diff debug: " x1, x2, x3, x4, x5) #else #define h5diffdebug(x) #define h5diffdebug2(x1, x2) @@ -153,13 +153,13 @@ void print_manager_output(void) overflow_file = NULL; } - fflush(stdout); - memset(outBuff, 0, OUTBUFF_SIZE); + HDfflush(stdout); + HDmemset(outBuff, 0, OUTBUFF_SIZE); outBuffOffset = 0; } else if( (outBuffOffset>0) && !g_Parallel) { - fprintf(stderr, "h5diff error: outBuffOffset>0, but we're not in parallel!\n"); + HDfprintf(stderr, "h5diff error: outBuffOffset>0, but we're not in parallel!\n"); } } @@ -189,7 +189,7 @@ static void print_incoming_data(void) MPI_Iprobe(MPI_ANY_SOURCE, MPI_TAG_PRINT_DATA, MPI_COMM_WORLD, &incomingMessage, &Status); if(incomingMessage) { - memset(data, 0, PRINT_DATA_MAX_SIZE+1); + HDmemset(data, 0, PRINT_DATA_MAX_SIZE+1); MPI_Recv(data, PRINT_DATA_MAX_SIZE, MPI_CHAR, Status.MPI_SOURCE, MPI_TAG_PRINT_DATA, MPI_COMM_WORLD, &Status); printf("%s", data); @@ -274,7 +274,7 @@ static int is_exclude_path (char * path, h5trav_type_t type, diff_opt_t *options if (exclude_path_ptr->obj_type == H5TRAV_TYPE_GROUP) { ret_cmp = HDstrncmp(exclude_path_ptr->obj_path, path, - strlen(exclude_path_ptr->obj_path)); + HDstrlen(exclude_path_ptr->obj_path)); if (ret_cmp == 0) { /* check if given path belong to an excluding group, if so @@ -366,6 +366,7 @@ static void build_match_list (const char *objname1, trav_info_t *info1, const ch int path2_offset = 0; int cmp; trav_table_t *table; + size_t idx; /* init */ trav_table_init( &table ); @@ -403,6 +404,14 @@ static void build_match_list (const char *objname1, trav_info_t *info1, const ch infile[0] = 1; infile[1] = 1; trav_table_addflags(infile, path1_lp, info1->paths[curr1].type, table); + /* if the two point to the same target object, + * mark that in table */ + if (info1->paths[curr1].fileno == info2->paths[curr2].fileno && + info1->paths[curr1].objno == info2->paths[curr2].objno ) + { + idx = table->nobjs - 1; + table->objs[idx].is_same_trgobj = 1; + } } curr1++; curr2++; @@ -522,7 +531,7 @@ static herr_t trav_grp_symlinks(const char *path, const H5L_info_t *linfo, const char *ext_path; /* init linkinfo struct */ - memset(&lnk_info, 0, sizeof(h5tool_link_info_t)); + HDmemset(&lnk_info, 0, sizeof(h5tool_link_info_t)); if (!opts->follow_links) { @@ -605,7 +614,7 @@ static herr_t trav_grp_symlinks(const char *path, const H5L_info_t *linfo, done: if (lnk_info.trg_path) - HDfree(lnk_info.trg_path); + HDfree((char *)lnk_info.trg_path); return 0; } @@ -635,8 +644,8 @@ hsize_t h5diff(const char *fname1, char filenames[2][MAX_FILENAME]; hsize_t nfound = 0; int i; - //int i1, i2; - int l_ret; + int l_ret1 = -1; + int l_ret2 = -1; const char * obj1fullname = NULL; const char * obj2fullname = NULL; /* init to group type */ @@ -673,6 +682,8 @@ hsize_t h5diff(const char *fname1, if(!is_valid_options(options)) goto out; + options->cmn_objs = 1; /* eliminate warning */ + /*------------------------------------------------------------------------- * open the files first; if they are not valid, no point in continuing *------------------------------------------------------------------------- @@ -717,25 +728,25 @@ hsize_t h5diff(const char *fname1, /* make the given object1 fullpath, start with "/" */ if (HDstrncmp(objname1, "/", 1)) { - HDstrcpy(obj1fullname, "/"); - HDstrcat(obj1fullname, objname1); + HDstrcpy((char *)obj1fullname, "/"); + HDstrcat((char *)obj1fullname, objname1); } else - HDstrcpy(obj1fullname, objname1); + HDstrcpy((char *)obj1fullname, objname1); /* make the given object2 fullpath, start with "/" */ if (HDstrncmp(objname2, "/", 1)) { - HDstrcpy(obj2fullname, "/"); - HDstrcat(obj2fullname, objname2); + HDstrcpy((char *)obj2fullname, "/"); + HDstrcat((char *)obj2fullname, objname2); } else - HDstrcpy(obj2fullname, objname2); + HDstrcpy((char *)obj2fullname, objname2); /*---------------------------------------------------------- * check if obj1 is root, group, single object or symlink */ - if(!HDstrcmp(obj1fullname, "/")) + if(!HDstrcmp((char *)obj1fullname, "/")) { obj1type = H5TRAV_TYPE_GROUP; } @@ -845,12 +856,15 @@ hsize_t h5diff(const char *fname1, { /* set root group */ obj1fullname = (char*)HDcalloc(2, sizeof(char)); - HDstrcat(obj1fullname, "/"); + HDstrcat((char *)obj1fullname, "/"); obj2fullname = (char*)HDcalloc(2, sizeof(char)); - HDstrcat(obj2fullname, "/"); + HDstrcat((char *)obj2fullname, "/"); } - options->cmn_objs = 1; /* eliminate warning */ + + /* get any symbolic links info */ + l_ret1 = H5tools_get_symlink_info(file1_id, obj1fullname, &trg_linfo1, TRUE); + l_ret2 = H5tools_get_symlink_info(file2_id, obj2fullname, &trg_linfo2, TRUE); /*--------------------------------------------- * check for following symlinks @@ -864,13 +878,12 @@ hsize_t h5diff(const char *fname1, /*------------------------------- * check symbolic link (object1) */ - l_ret = H5tools_get_symlink_info(file1_id, obj1fullname, &trg_linfo1, TRUE); /* dangling link */ - if (l_ret == 0) + if (l_ret1 == 0) { if (options->no_dangle_links) { - /* gangling link is error */ + /* treat dangling link is error */ if(options->m_verbose) parallel_print("Warning: <%s> is a dangling link.\n", obj1fullname); options->err_stat = 1; @@ -880,30 +893,33 @@ hsize_t h5diff(const char *fname1, { if(options->m_verbose) parallel_print("obj1 <%s> is a dangling link.\n", obj1fullname); - nfound++; - print_found(nfound); - goto out; + if (l_ret1 != 0 || l_ret2 != 0) + { + nfound++; + print_found(nfound); + goto out; + } } } - else if(l_ret < 0) /* fail */ + else if(l_ret1 < 0) /* fail */ { parallel_print ("Object <%s> could not be found in <%s>\n", obj1fullname, fname1); options->err_stat = 1; goto out; } - else if(l_ret != 2) /* symbolic link */ + else if(l_ret1 != 2) /* symbolic link */ obj1type = trg_linfo1.trg_type; /*------------------------------- * check symbolic link (object2) */ - l_ret = H5tools_get_symlink_info(file2_id, obj2fullname, &trg_linfo2, TRUE); + /* dangling link */ - if (l_ret == 0) + if (l_ret2 == 0) { if (options->no_dangle_links) { - /* gangling link is error */ + /* treat dangling link is error */ if(options->m_verbose) parallel_print("Warning: <%s> is a dangling link.\n", obj2fullname); options->err_stat = 1; @@ -913,25 +929,44 @@ hsize_t h5diff(const char *fname1, { if(options->m_verbose) parallel_print("obj2 <%s> is a dangling link.\n", obj2fullname); - nfound++; - print_found(nfound); - goto out; + if (l_ret1 != 0 || l_ret2 != 0) + { + nfound++; + print_found(nfound); + goto out; + } } } - else if(l_ret < 0) /* fail */ + else if(l_ret2 < 0) /* fail */ { parallel_print ("Object <%s> could not be found in <%s>\n", obj2fullname, fname2); options->err_stat = 1; goto out; } - else if(l_ret != 2) /* symbolic link */ + else if(l_ret2 != 2) /* symbolic link */ obj2type = trg_linfo2.trg_type; } /* end of if follow symlinks */ + /* + * If verbose options is not used, don't need to traverse thorugh the list + * of objects in the group to display objects information, + * So use h5tools_is_obj_same() to improve performance by skipping + * comparing details of same objects. + */ + + if(!(options->m_verbose || options->m_report)) + { + /* if no danglink links */ + if ( l_ret1 > 0 && l_ret2 > 0 ) + if (h5tools_is_obj_same(file1_id,obj1fullname,file2_id,obj2fullname)!=0) + goto out; + } + /* if both obj1 and obj2 are group */ if (obj1type == H5TRAV_TYPE_GROUP && obj2type == H5TRAV_TYPE_GROUP) { + /* * traverse group1 */ @@ -971,7 +1006,7 @@ hsize_t h5diff(const char *fname1, if((HDstrlen(fname1) > MAX_FILENAME) || (HDstrlen(fname2) > MAX_FILENAME)) { - fprintf(stderr, "The parallel diff only supports path names up to %d characters\n", MAX_FILENAME); + HDfprintf(stderr, "The parallel diff only supports path names up to %d characters\n", MAX_FILENAME); MPI_Abort(MPI_COMM_WORLD, 0); } /* end if */ @@ -1021,15 +1056,15 @@ out: /* free buffers */ if (obj1fullname) - HDfree(obj1fullname); + HDfree((char *)obj1fullname); if (obj2fullname) - HDfree(obj2fullname); + HDfree((char *)obj2fullname); /* free link info buffer */ if (trg_linfo1.trg_path) - HDfree(trg_linfo1.trg_path); + HDfree((char *)trg_linfo1.trg_path); if (trg_linfo2.trg_path) - HDfree(trg_linfo2.trg_path); + HDfree((char *)trg_linfo2.trg_path); /* close */ H5E_BEGIN_TRY @@ -1079,6 +1114,8 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, char * grp2_path = ""; char * obj1_fullpath = NULL; char * obj2_fullpath = NULL; + h5trav_type_t objtype; + diff_args_t argdata; /* @@ -1086,9 +1123,9 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, * make full path */ if (HDstrcmp (grp1, "/")) - grp1_path = grp1; + grp1_path = (char *)grp1; if (HDstrcmp (grp2, "/")) - grp2_path = grp2; + grp2_path = (char *)grp2; /*------------------------------------------------------------------------- * regarding the return value of h5diff (0, no difference in files, 1 difference ) @@ -1140,7 +1177,7 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, int n; int busyTasks = 0; struct diffs_found nFoundbyWorker; - struct diff_args args; + struct diff_mpi_args args; int havePrintToken = 1; MPI_Status Status; @@ -1152,22 +1189,27 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, { if( table->objs[i].flags[0] && table->objs[i].flags[1]) { + objtype = table->objs[i].type; /* make full path for obj1 */ - obj1_fullpath = (char*)HDcalloc (strlen(grp1_path) + strlen (table->objs[i].name) + 1, sizeof (char)); + obj1_fullpath = (char*)HDcalloc (HDstrlen(grp1_path) + strlen (table->objs[i].name) + 1, sizeof (char)); HDstrcpy(obj1_fullpath, grp1_path); HDstrcat(obj1_fullpath, table->objs[i].name); /* make full path for obj2 */ - obj2_fullpath = (char*)HDcalloc (strlen(grp2_path) + strlen (table->objs[i].name) + 1, sizeof (char)); + obj2_fullpath = (char*)HDcalloc (HDstrlen(grp2_path) + strlen (table->objs[i].name) + 1, sizeof (char)); HDstrcpy(obj2_fullpath, grp2_path); HDstrcat(obj2_fullpath, table->objs[i].name); + /* Set argdata to pass other args into diff() */ + argdata.type = objtype; + argdata.is_same_trgobj = table->objs[i].is_same_trgobj; + options->cmn_objs = 1; if(!g_Parallel) { nfound += diff(file1_id, obj1_fullpath, file2_id, obj2_fullpath, - options, table->objs[i].type); + options, &argdata); } /* end if */ #ifdef H5_HAVE_PARALLEL else @@ -1191,10 +1233,12 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, MPI_Abort(MPI_COMM_WORLD, 0); } /* end if */ + /* set args struct to pass */ HDstrcpy(args.name1, obj1_fullpath); HDstrcpy(args.name2, obj2_fullpath); args.options = *options; - args.type = table->objs[i].type; + args.argdata.type = objtype; + args.argdata.is_same_trgobj = table->objs[i].is_same_trgobj; h5diffdebug2("busyTasks=%d\n", busyTasks); /* if there are any outstanding print requests, let's handle one. */ @@ -1441,7 +1485,7 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, } /* end if */ h5diffdebug("done with if block\n"); - free(workerTasks); + HDfree(workerTasks); } #endif /* H5_HAVE_PARALLEL */ @@ -1487,6 +1531,7 @@ hsize_t diff_compare(hid_t file1_id, int is_dangle_link2 = 0; const char *obj1name = obj1_name; const char *obj2name = obj2_name; + diff_args_t argdata; /* local variables for diff() */ h5trav_type_t obj1type, obj2type; @@ -1694,9 +1739,13 @@ hsize_t diff_compare(hid_t file1_id, goto out; } + /* Set argdata to pass other args into diff() */ + argdata.type = obj1type; + argdata.is_same_trgobj = 0; + nfound = diff(file1_id, obj1name, file2_id, obj2name, - options, obj1type); + options, &argdata); out: /*------------------------------- @@ -1731,9 +1780,9 @@ out: /* free link info buffer */ if (linkinfo1.trg_path) - HDfree(linkinfo1.trg_path); + HDfree((char *)linkinfo1.trg_path); if (linkinfo2.trg_path) - HDfree(linkinfo2.trg_path); + HDfree((char *)linkinfo2.trg_path); return nfound; } @@ -1751,11 +1800,16 @@ out: * * Return: Number of differences found * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * Date: May 9, 2003 - * * Programmer: Jonathan Kim * - add following links feature (Feb 11,2010) + * - Change to use diff_args_t to pass the rest of args. + * Passing through it instead of individual args provides smoother + * extensibility through its members along with MPI code update for ph5diff + * as it doesn't require interface change. + * (May 6,2011) + * + * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu + * Date: May 9, 2003 *------------------------------------------------------------------------- */ @@ -1764,7 +1818,7 @@ hsize_t diff(hid_t file1_id, hid_t file2_id, const char *path2, diff_opt_t * options, - h5trav_type_t type) + diff_args_t *argdata) { hid_t type1_id = (-1); hid_t type2_id = (-1); @@ -1773,6 +1827,7 @@ hsize_t diff(hid_t file1_id, int ret; int is_dangle_link1 = 0; int is_dangle_link2 = 0; + int is_hard_link = 0; hsize_t nfound = 0; @@ -1834,15 +1889,67 @@ hsize_t diff(hid_t file1_id, /* found dangling link */ if (is_dangle_link1 || is_dangle_link2) goto out2; + + /* + * If both points to the same target object, skip comparing details inside + * of the objects to improve performance. + * Always check for the hard links, otherwise if follow symlink option is + * specified. + * + * Perform this to match the outputs as bypassing. + */ + is_hard_link = (argdata->type == H5TRAV_TYPE_DATASET || + argdata->type == H5TRAV_TYPE_NAMED_DATATYPE || + argdata->type == H5TRAV_TYPE_GROUP); + if (options->follow_links || is_hard_link) + { + if (argdata->is_same_trgobj) + { + /* print information is only verbose option is used */ + if(options->m_verbose || options->m_report) + { + switch(argdata->type) + { + case H5TRAV_TYPE_DATASET: + do_print_objname("dataset", path1, path2, options); + break; + case H5TRAV_TYPE_NAMED_DATATYPE: + do_print_objname("datatype", path1, path2, options); + break; + case H5TRAV_TYPE_GROUP: + do_print_objname("group", path1, path2, options); + break; + case H5TRAV_TYPE_LINK: + do_print_objname("link", path1, path2, options); + break; + case H5TRAV_TYPE_UDLINK: + if(linkinfo1.linfo.type == H5L_TYPE_EXTERNAL && linkinfo2.linfo.type == H5L_TYPE_EXTERNAL) + do_print_objname("external link", path1, path2, options); + else + do_print_objname ("user defined link", path1, path2, options); + break; + default: + parallel_print("Comparison not supported: <%s> and <%s> are of type %s\n", + path1, path2, get_type(argdata->type) ); + options->not_cmp = 1; + break; + } /* switch(type)*/ + + print_found(nfound); + } /* if(options->m_verbose || options->m_report) */ + + goto out2; + } + } - switch(type) + switch(argdata->type) { /*---------------------------------------------------------------------- * H5TRAV_TYPE_DATASET *---------------------------------------------------------------------- */ case H5TRAV_TYPE_DATASET: - /* verbose (-v) and report (-r) mode */ + /* verbose (-v) and report (-r) mode */ if(options->m_verbose || options->m_report) { do_print_objname("dataset", path1, path2, options); @@ -1854,15 +1961,15 @@ hsize_t diff(hid_t file1_id, { nfound = diff_dataset(file1_id, file2_id, path1, path2, options); } - /* the rest (-c, none, ...) */ + /* the rest (-c, none, ...) */ else { nfound = diff_dataset(file1_id, file2_id, path1, path2, options); - /* print info if compatible and difference found */ - if (!options->not_cmp && nfound) + /* print info if difference found */ + if (nfound) { do_print_objname("dataset", path1, path2, options); - print_found(nfound); + print_found(nfound); } } break; @@ -1965,10 +2072,15 @@ hsize_t diff(hid_t file1_id, goto out; } + /* Renew type in argdata to pass into diff(). + * For recursive call, argdata.is_same_trgobj is already + * set from initial call, so don't reset here */ + argdata->type = linkinfo1.trg_type; + /* call self to compare target object */ nfound += diff(file1_id, path1, file2_id, path2, - options, linkinfo1.trg_type); + options, argdata); } /* always print the number of differences found in verbose mode */ @@ -2017,9 +2129,14 @@ hsize_t diff(hid_t file1_id, goto out; } + /* Renew type in argdata to pass into diff(). + * For recursive call, argdata.is_same_trgobj is already + * set from initial call, so don't reset here */ + argdata->type = linkinfo1.trg_type; + nfound = diff(file1_id, path1, file2_id, path2, - options, linkinfo1.trg_type); + options, argdata); } } /* end if */ else @@ -2050,16 +2167,16 @@ hsize_t diff(hid_t file1_id, default: if(options->m_verbose) parallel_print("Comparison not supported: <%s> and <%s> are of type %s\n", - path1, path2, get_type(type) ); + path1, path2, get_type(argdata->type) ); options->not_cmp = 1; break; } /* free link info buffer */ if (linkinfo1.trg_path) - HDfree(linkinfo1.trg_path); + HDfree((char *)linkinfo1.trg_path); if (linkinfo2.trg_path) - HDfree(linkinfo2.trg_path); + HDfree((char *)linkinfo2.trg_path); return nfound; @@ -2100,9 +2217,9 @@ out2: /* free link info buffer */ if (linkinfo1.trg_path) - HDfree(linkinfo1.trg_path); + HDfree((char *)linkinfo1.trg_path); if (linkinfo2.trg_path) - HDfree(linkinfo2.trg_path); + HDfree((char *)linkinfo2.trg_path); /* close */ /* disable error reporting */ diff --git a/tools/lib/h5diff.h b/tools/lib/h5diff.h index 19d5ed5..1ff4402 100644 --- a/tools/lib/h5diff.h +++ b/tools/lib/h5diff.h @@ -22,6 +22,16 @@ #define MAX_FILENAME 1024 /*------------------------------------------------------------------------- + * This is used to pass multiple args into diff(). + * Passing this instead of several each arg provides smoother extensibility + * through its members along with MPI code for ph5diff + * as it doesn't require interface change. + *------------------------------------------------------------------------*/ +typedef struct { + h5trav_type_t type; + hbool_t is_same_trgobj; +} diff_args_t; +/*------------------------------------------------------------------------- * command line options *------------------------------------------------------------------------- */ @@ -72,6 +82,13 @@ H5TOOLS_DLL hsize_t h5diff(const char *fname1, const char *objname2, diff_opt_t *options); +H5TOOLS_DLL hsize_t diff( hid_t file1_id, + const char *path1, + hid_t file2_id, + const char *path2, + diff_opt_t *options, + diff_args_t *argdata); + #ifdef H5_HAVE_PARALLEL H5TOOLS_DLL void phdiff_dismiss_workers(void); H5TOOLS_DLL void print_manager_output(void); @@ -101,13 +118,6 @@ hsize_t diff_datasetid( hid_t dset1_id, const char *obj2_name, diff_opt_t *options); -hsize_t diff( hid_t file1_id, - const char *path1, - hid_t file2_id, - const char *path2, - diff_opt_t *options, - h5trav_type_t type ); - hsize_t diff_compare( hid_t file1_id, const char *file1_name, const char *obj1_name, diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c index c4c8dbf..604a825 100644 --- a/tools/lib/h5diff_array.c +++ b/tools/lib/h5diff_array.c @@ -137,7 +137,7 @@ static int not_comparable; is_zero=1; \ } -# define PDIFF(a,b) ( (b>a) ? (b-a) : (a-b)) +# define PDIFF(a,b) ( (b>a) ? (b-a) : (a-b)) /*------------------------------------------------------------------------- * local prototypes @@ -186,8 +186,8 @@ static int my_isnan(dtype_t type, void *val); * XCAO, 11/10/2010 * added to improve performance for compound datasets */ -static void set_comp_members(hid_t tid, mcomp_t *members); -static void free_comp_members(mcomp_t *members); +static void get_member_types(hid_t tid, mcomp_t *members); +static void close_member_types(mcomp_t *members); @@ -234,11 +234,11 @@ hsize_t diff_array( void *_mem1, size = H5Tget_size( m_type ); type_class = H5Tget_class(m_type); - /* Fast comparison first for atomic type by memcmp(). + /* Fast comparison first for atomic type by memcmp(). * It is OK not to list non-atomic type here because it will not be caught - * by the confition, but it gives more clarity for code planning + * by the condition, but it gives more clarity for code planning */ - if (type_class != H5T_REFERENCE && + if (type_class != H5T_REFERENCE && type_class != H5T_COMPOUND && type_class != H5T_STRING && type_class != H5T_VLEN && @@ -260,7 +260,7 @@ hsize_t diff_array( void *_mem1, switch (type_class) { default: - assert(0); + HDassert(0); break; /*------------------------------------------------------------------------- @@ -269,7 +269,6 @@ hsize_t diff_array( void *_mem1, */ case H5T_FLOAT: - if (H5Tequal(m_type, H5T_NATIVE_FLOAT)) nfound=diff_float(mem1,mem2,nelmts,hyper_start,rank,dims,acc,pos,options,name1,name2,&ph); else if (H5Tequal(m_type, H5T_NATIVE_DOUBLE)) @@ -319,7 +318,7 @@ hsize_t diff_array( void *_mem1, case H5T_VLEN: case H5T_REFERENCE: HDmemset(&members, 0, sizeof (mcomp_t)); - set_comp_members(m_type, &members); + get_member_types(m_type, &members); for ( i = 0; i < nelmts; i++) { nfound+=diff_datum( @@ -339,11 +338,11 @@ hsize_t diff_array( void *_mem1, &ph, &members); if (options->n && nfound>=options->count) { - free_comp_members(&members); + close_member_types(&members); return nfound; } } /* i */ - free_comp_members(&members); + close_member_types(&members); } /* switch */ return nfound; @@ -427,11 +426,11 @@ hsize_t diff_datum(void *_mem1, type_size = H5Tget_size( m_type ); type_class = H5Tget_class(m_type); - /* Fast comparison first for atomic type by memcmp(). + /* Fast comparison first for atomic type by memcmp(). * It is OK not to list non-atomic type here because it will not be caught - * by the confition, but it gives more clarity for code planning + * by the confition, but it gives more clarity for code planning */ - if (type_class != H5T_REFERENCE && + if (type_class != H5T_REFERENCE && type_class != H5T_COMPOUND && type_class != H5T_STRING && type_class != H5T_VLEN && @@ -441,10 +440,10 @@ hsize_t diff_datum(void *_mem1, switch (H5Tget_class(m_type)) { default: - assert(0); + HDassert(0); break; case H5T_TIME: - assert(0); + HDassert(0); break; /*------------------------------------------------------------------------- @@ -513,10 +512,10 @@ hsize_t diff_datum(void *_mem1, size2 = H5Tget_size(m_type); } - /* + /* * compare for shorter string - * TODO: this code need to be improved to handle the difference - * of length of strings. + * TODO: this code need to be improved to handle the difference + * of length of strings. * For now mimic the previous way. */ if(size1 < size2) @@ -621,12 +620,43 @@ hsize_t diff_datum(void *_mem1, char enum_name1[1024]; char enum_name2[1024]; + herr_t err1; + herr_t err2; + /* disable error reporting */ H5E_BEGIN_TRY { - if ((H5Tenum_nameof(m_type, mem1, enum_name1, sizeof enum_name1) >= 0) && - (H5Tenum_nameof(m_type, mem2, enum_name2, sizeof enum_name2) >= 0)) + /* If the enum value cannot be converted to a string + * it is set to an error string for later output. + */ + err1 = H5Tenum_nameof(m_type, mem1, enum_name1, sizeof enum_name1); + if(err1 < 0) + strcpy(enum_name1, "**INVALID VALUE**"); + + err2 = H5Tenum_nameof(m_type, mem2, enum_name2, sizeof enum_name2); + if(err2 < 0) + strcpy(enum_name2, "**INVALID VALUE**"); + + if(err1 < 0 || err2 < 0) { + /* One or more bad enum values */ + + /* If the two values cannot be converted to a string + * (probably due to them being invalid enum values), + * don't attempt to convert them - just report errors. + */ + nfound += 1; + if ( print_data(options) ) + { + print_pos(ph,0,i,acc,pos,rank,dims,obj1,obj2); + parallel_print(SPACES); + parallel_print(S_FORMAT,enum_name1,enum_name2); + } + } + else + { + /* Both enum values were valid */ + if (HDstrcmp(enum_name1,enum_name2)!=0) { nfound=1; @@ -675,7 +705,7 @@ hsize_t diff_datum(void *_mem1, size = H5Tget_size(memb_type); ndims = H5Tget_array_ndims(m_type); H5Tget_array_dims2(m_type, adims); - assert(ndims >= 1 && ndims <= H5S_MAX_RANK); + HDassert(ndims >= 1 && ndims <= H5S_MAX_RANK); /* calculate the number of array elements */ for (u = 0, nelmts = 1; u err_stat = 1; @@ -843,7 +873,7 @@ hsize_t diff_datum(void *_mem1, obj2, container1_id, container2_id, - ph, NULL); + ph, members); H5Tclose(memb_type); @@ -867,9 +897,9 @@ hsize_t diff_datum(void *_mem1, { char temp1_char; char temp2_char; - assert(type_size==sizeof(char)); - memcpy(&temp1_char, mem1, sizeof(char)); - memcpy(&temp2_char, mem2, sizeof(char)); + HDassert(type_size==sizeof(char)); + HDmemcpy(&temp1_char, mem1, sizeof(char)); + HDmemcpy(&temp2_char, mem2, sizeof(char)); /* -d and !-p */ if (options->d && !options->p) { @@ -963,10 +993,10 @@ hsize_t diff_datum(void *_mem1, { unsigned char temp1_uchar; unsigned char temp2_uchar; - assert(type_size==sizeof(unsigned char)); + HDassert(type_size==sizeof(unsigned char)); - memcpy(&temp1_uchar, mem1, sizeof(unsigned char)); - memcpy(&temp2_uchar, mem2, sizeof(unsigned char)); + HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char)); + HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char)); /* -d and !-p */ if (options->d && !options->p) { @@ -1062,10 +1092,10 @@ hsize_t diff_datum(void *_mem1, { short temp1_short; short temp2_short; - assert(type_size==sizeof(short)); + HDassert(type_size==sizeof(short)); - memcpy(&temp1_short, mem1, sizeof(short)); - memcpy(&temp2_short, mem2, sizeof(short)); + HDmemcpy(&temp1_short, mem1, sizeof(short)); + HDmemcpy(&temp2_short, mem2, sizeof(short)); /* -d and !-p */ if (options->d && !options->p) { @@ -1161,10 +1191,10 @@ hsize_t diff_datum(void *_mem1, { unsigned short temp1_ushort; unsigned short temp2_ushort; - assert(type_size==sizeof(short)); + HDassert(type_size==sizeof(short)); - memcpy(&temp1_ushort, mem1, sizeof(unsigned short)); - memcpy(&temp2_ushort, mem2, sizeof(unsigned short)); + HDmemcpy(&temp1_ushort, mem1, sizeof(unsigned short)); + HDmemcpy(&temp2_ushort, mem2, sizeof(unsigned short)); /* -d and !-p */ if (options->d && !options->p) { @@ -1261,10 +1291,10 @@ hsize_t diff_datum(void *_mem1, { int temp1_int; int temp2_int; - assert(type_size==sizeof(int)); + HDassert(type_size==sizeof(int)); - memcpy(&temp1_int, mem1, sizeof(int)); - memcpy(&temp2_int, mem2, sizeof(int)); + HDmemcpy(&temp1_int, mem1, sizeof(int)); + HDmemcpy(&temp2_int, mem2, sizeof(int)); /* -d and !-p */ if (options->d && !options->p) { @@ -1359,10 +1389,10 @@ hsize_t diff_datum(void *_mem1, { unsigned int temp1_uint; unsigned int temp2_uint; - assert(type_size==sizeof(int)); + HDassert(type_size==sizeof(int)); - memcpy(&temp1_uint, mem1, sizeof(unsigned int)); - memcpy(&temp2_uint, mem2, sizeof(unsigned int)); + HDmemcpy(&temp1_uint, mem1, sizeof(unsigned int)); + HDmemcpy(&temp2_uint, mem2, sizeof(unsigned int)); /* -d and !-p */ if (options->d && !options->p) { @@ -1457,10 +1487,10 @@ hsize_t diff_datum(void *_mem1, { long temp1_long; long temp2_long; - assert(type_size==sizeof(long)); + HDassert(type_size==sizeof(long)); - memcpy(&temp1_long, mem1, sizeof(long)); - memcpy(&temp2_long, mem2, sizeof(long)); + HDmemcpy(&temp1_long, mem1, sizeof(long)); + HDmemcpy(&temp2_long, mem2, sizeof(long)); /* -d and !-p */ if (options->d && !options->p) { @@ -1557,10 +1587,10 @@ hsize_t diff_datum(void *_mem1, { unsigned long temp1_ulong; unsigned long temp2_ulong; - assert(type_size==sizeof(unsigned long)); + HDassert(type_size==sizeof(unsigned long)); - memcpy(&temp1_ulong, mem1, sizeof(unsigned long)); - memcpy(&temp2_ulong, mem2, sizeof(unsigned long)); + HDmemcpy(&temp1_ulong, mem1, sizeof(unsigned long)); + HDmemcpy(&temp2_ulong, mem2, sizeof(unsigned long)); /* -d and !-p */ if (options->d && !options->p) { @@ -1656,10 +1686,10 @@ hsize_t diff_datum(void *_mem1, { long long temp1_llong; long long temp2_llong; - assert(type_size==sizeof(long long)); + HDassert(type_size==sizeof(long long)); - memcpy(&temp1_llong, mem1, sizeof(long long)); - memcpy(&temp2_llong, mem2, sizeof(long long)); + HDmemcpy(&temp1_llong, mem1, sizeof(long long)); + HDmemcpy(&temp2_llong, mem2, sizeof(long long)); /* -d and !-p */ if (options->d && !options->p) { @@ -1754,10 +1784,10 @@ hsize_t diff_datum(void *_mem1, { unsigned long long temp1_ullong; unsigned long long temp2_ullong; - assert(type_size==sizeof(unsigned long long)); + HDassert(type_size==sizeof(unsigned long long)); - memcpy(&temp1_ullong, mem1, sizeof(unsigned long long)); - memcpy(&temp2_ullong, mem2, sizeof(unsigned long long)); + HDmemcpy(&temp1_ullong, mem1, sizeof(unsigned long long)); + HDmemcpy(&temp2_ullong, mem2, sizeof(unsigned long long)); /* -d and !-p */ if (options->d && !options->p) { @@ -1874,10 +1904,10 @@ hsize_t diff_datum(void *_mem1, int isnan1=0; int isnan2=0; - assert(type_size==sizeof(float)); + HDassert(type_size==sizeof(float)); - memcpy(&temp1_float, mem1, sizeof(float)); - memcpy(&temp2_float, mem2, sizeof(float)); + HDmemcpy(&temp1_float, mem1, sizeof(float)); + HDmemcpy(&temp2_float, mem2, sizeof(float)); /* logic for detecting NaNs is different with options -d, -p and no options */ @@ -1915,8 +1945,8 @@ hsize_t diff_datum(void *_mem1, } } - /* one is NaN, assume difference */ - else if ( isnan1==1 || isnan2==1) + /* only one is NaN, assume difference */ + else if (isnan1==1 && isnan2==0 || isnan1==0 && isnan2==1) { if ( print_data(options) ) { @@ -1978,8 +2008,8 @@ hsize_t diff_datum(void *_mem1, } } - /* one is NaN, assume difference */ - else if ( isnan1==1 || isnan2==1) + /* only one is NaN, assume difference */ + else if (isnan1==1 && isnan2==0 || isnan1==0 && isnan2==1) { if ( print_data(options) ) { @@ -2044,8 +2074,8 @@ hsize_t diff_datum(void *_mem1, } } - /* one is NaN, assume difference */ - else if ( isnan1==1 || isnan2==1) + /* only one is NaN, assume difference */ + else if (isnan1==1 && isnan2==0 || isnan1==0 && isnan2==1) { if ( print_data(options) ) { @@ -2087,10 +2117,10 @@ hsize_t diff_datum(void *_mem1, int isnan1=0; int isnan2=0; - assert(type_size==sizeof(double)); + HDassert(type_size==sizeof(double)); - memcpy(&temp1_double, mem1, sizeof(double)); - memcpy(&temp2_double, mem2, sizeof(double)); + HDmemcpy(&temp1_double, mem1, sizeof(double)); + HDmemcpy(&temp2_double, mem2, sizeof(double)); /* logic for detecting NaNs is different with options -d, -p and no options */ @@ -2100,7 +2130,6 @@ hsize_t diff_datum(void *_mem1, */ if (options->d && !options->p) { - /*------------------------------------------------------------------------- * detect NaNs *------------------------------------------------------------------------- @@ -2127,8 +2156,8 @@ hsize_t diff_datum(void *_mem1, } } - /* one is NaN, assume difference */ - else if ( isnan1==1 || isnan2==1) + /* only one is NaN, assume difference */ + else if (isnan1==1 && isnan2==0 || isnan1==0 && isnan2==1) { if ( print_data(options) ) { @@ -2192,8 +2221,8 @@ hsize_t diff_datum(void *_mem1, } } - /* one is NaN, assume difference */ - else if ( isnan1==1 || isnan2==1) + /* only one is NaN, assume difference */ + else if (isnan1==1 && isnan2==0 || isnan1==0 && isnan2==1) { if ( print_data(options) ) { @@ -2258,8 +2287,8 @@ hsize_t diff_datum(void *_mem1, } } - /* one is NaN, assume difference */ - else if ( isnan1==1 || isnan2==1) + /* only one is NaN, assume difference */ + else if (isnan1==1 && isnan2==0 || isnan1==0 && isnan2==1) { if ( print_data(options) ) { @@ -2268,7 +2297,6 @@ hsize_t diff_datum(void *_mem1, parallel_print(F_FORMAT,temp1_double,temp2_double,ABS(temp1_double-temp2_double)); } nfound++; - } } @@ -2304,10 +2332,10 @@ hsize_t diff_datum(void *_mem1, int isnan2=0; - assert(type_size==sizeof(long double)); + HDassert(type_size==sizeof(long double)); - memcpy(&temp1_double, mem1, sizeof(long double)); - memcpy(&temp2_double, mem2, sizeof(long double)); + HDmemcpy(&temp1_double, mem1, sizeof(long double)); + HDmemcpy(&temp2_double, mem2, sizeof(long double)); /* logic for detecting NaNs is different with options -d, -p and no options */ @@ -2342,8 +2370,18 @@ hsize_t diff_datum(void *_mem1, } nfound++; } - } /* NaN */ + /* only one is NaN, assume difference */ + else if (isnan1==1 && isnan2==0 || isnan1==0 && 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++; + } } /*------------------------------------------------------------------------- @@ -2397,7 +2435,18 @@ hsize_t diff_datum(void *_mem1, } } /* NaN */ - } + /* only one is NaN, assume difference */ + else if (isnan1==1 && isnan2==0 || isnan1==0 && 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++; + } + } /*------------------------------------------------------------------------- * -d and -p @@ -2451,6 +2500,17 @@ hsize_t diff_datum(void *_mem1, } } /* NaN */ + /* only one is NaN, assume difference */ + else if (isnan1==1 && isnan2==0 || isnan1==0 && 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++; + } } /*------------------------------------------------------------------------- @@ -2608,13 +2668,13 @@ hsize_t diff_region(hid_t obj1_id, */ if(nblocks1 > 0) { alloc_size = nblocks1 * ndims1 * 2 * sizeof(ptdata1[0]); - assert(alloc_size == (hsize_t)((size_t)alloc_size)); /*check for overflow*/ + HDassert(alloc_size == (hsize_t)((size_t)alloc_size)); /*check for overflow*/ - ptdata1 = malloc((size_t)alloc_size); + ptdata1 = HDmalloc((size_t)alloc_size); H5_CHECK_OVERFLOW(nblocks1, hssize_t, hsize_t); H5Sget_select_hyper_blocklist(region1_id, (hsize_t)0, (hsize_t)nblocks1, ptdata1); - ptdata2 = malloc((size_t)alloc_size); + ptdata2 = HDmalloc((size_t)alloc_size); H5_CHECK_OVERFLOW(nblocks2, hssize_t, hsize_t); H5Sget_select_hyper_blocklist(region2_id, (hsize_t)0, (hsize_t)nblocks2, ptdata2); @@ -2663,13 +2723,13 @@ hsize_t diff_region(hid_t obj1_id, */ if(npoints1 > 0) { alloc_size = npoints1 * ndims1 * sizeof(ptdata1[0]); - assert(alloc_size == (hsize_t)((size_t)alloc_size)); /*check for overflow*/ + HDassert(alloc_size == (hsize_t)((size_t)alloc_size)); /*check for overflow*/ - ptdata1 = malloc((size_t)alloc_size); + ptdata1 = HDmalloc((size_t)alloc_size); H5_CHECK_OVERFLOW(npoints1,hssize_t,hsize_t); H5Sget_select_elem_pointlist(region1_id, (hsize_t)0, (hsize_t)npoints1, ptdata1); - ptdata2 = malloc((size_t)alloc_size); + ptdata2 = HDmalloc((size_t)alloc_size); H5_CHECK_OVERFLOW(npoints1,hssize_t,hsize_t); H5Sget_select_elem_pointlist(region2_id, (hsize_t)0, (hsize_t)npoints2, ptdata2); @@ -2760,8 +2820,8 @@ hsize_t character_compare(unsigned char *mem1, unsigned char temp1_uchar; unsigned char temp2_uchar; - memcpy(&temp1_uchar, mem1, sizeof(unsigned char)); - memcpy(&temp2_uchar, mem2, sizeof(unsigned char)); + HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char)); + HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char)); if (temp1_uchar != temp2_uchar) { @@ -2809,8 +2869,8 @@ hsize_t character_compare_opt(unsigned char *mem1, double per; int both_zero; - memcpy(&temp1_uchar, mem1, sizeof(unsigned char)); - memcpy(&temp2_uchar, mem2, sizeof(unsigned char)); + HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char)); + HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char)); /* -d and !-p */ @@ -2915,8 +2975,8 @@ hsize_t diff_float(unsigned char *mem1, { for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_float, mem1, sizeof(float)); - memcpy(&temp2_float, mem2, sizeof(float)); + HDmemcpy(&temp1_float, mem1, sizeof(float)); + HDmemcpy(&temp2_float, mem2, sizeof(float)); /*------------------------------------------------------------------------- * detect NaNs @@ -2942,8 +3002,8 @@ hsize_t diff_float(unsigned char *mem1, nfound++; } } - /* one is NaN, assume difference */ - else if ( isnan1==1 || isnan2==1) + /* only one is NaN, assume difference */ + else if (isnan1==1 && isnan2==0 || isnan1==0 && isnan2==1) { if ( print_data(options) ) { @@ -2969,8 +3029,8 @@ hsize_t diff_float(unsigned char *mem1, { for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_float, mem1, sizeof(float)); - memcpy(&temp2_float, mem2, sizeof(float)); + HDmemcpy(&temp1_float, mem1, sizeof(float)); + HDmemcpy(&temp2_float, mem2, sizeof(float)); /*------------------------------------------------------------------------- * detect NaNs @@ -3014,8 +3074,8 @@ hsize_t diff_float(unsigned char *mem1, nfound++; } } - /* one is NaN, assume difference */ - else if ( isnan1==1 || isnan2==1) + /* only one is NaN, assume difference */ + else if (isnan1==1 && isnan2==0 || isnan1==0 && isnan2==1) { if ( print_data(options) ) { @@ -3042,8 +3102,8 @@ hsize_t diff_float(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_float, mem1, sizeof(float)); - memcpy(&temp2_float, mem2, sizeof(float)); + HDmemcpy(&temp1_float, mem1, sizeof(float)); + HDmemcpy(&temp2_float, mem2, sizeof(float)); /*------------------------------------------------------------------------- * detect NaNs @@ -3089,8 +3149,8 @@ hsize_t diff_float(unsigned char *mem1, } } - /* one is NaN, assume difference */ - else if ( isnan1==1 || isnan2==1) + /* only one is NaN, assume difference */ + else if (isnan1==1 && isnan2==0 || isnan1==0 && isnan2==1) { if ( print_data(options) ) { @@ -3116,8 +3176,8 @@ hsize_t diff_float(unsigned char *mem1, { for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_float, mem1, sizeof(float)); - memcpy(&temp2_float, mem2, sizeof(float)); + HDmemcpy(&temp1_float, mem1, sizeof(float)); + HDmemcpy(&temp2_float, mem2, sizeof(float)); if (equal_float(temp1_float,temp2_float,options)==FALSE) { @@ -3179,7 +3239,6 @@ hsize_t diff_double(unsigned char *mem1, int isnan1=0; int isnan2=0; - /*------------------------------------------------------------------------- * -d and !-p *------------------------------------------------------------------------- @@ -3189,8 +3248,8 @@ hsize_t diff_double(unsigned char *mem1, { for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_double, mem1, sizeof(double)); - memcpy(&temp2_double, mem2, sizeof(double)); + HDmemcpy(&temp1_double, mem1, sizeof(double)); + HDmemcpy(&temp2_double, mem2, sizeof(double)); /*------------------------------------------------------------------------- * detect NaNs @@ -3216,8 +3275,8 @@ hsize_t diff_double(unsigned char *mem1, nfound++; } } - /* one is NaN, assume difference */ - else if ( isnan1==1 || isnan2==1) + /* only one is NaN, assume difference */ + else if (isnan1==1 && isnan2==0 || isnan1==0 && isnan2==1) { if ( print_data(options) ) { @@ -3243,8 +3302,8 @@ hsize_t diff_double(unsigned char *mem1, { for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_double, mem1, sizeof(double)); - memcpy(&temp2_double, mem2, sizeof(double)); + HDmemcpy(&temp1_double, mem1, sizeof(double)); + HDmemcpy(&temp2_double, mem2, sizeof(double)); /*------------------------------------------------------------------------- * detect NaNs @@ -3288,8 +3347,8 @@ hsize_t diff_double(unsigned char *mem1, nfound++; } } - /* one is NaN, assume difference */ - else if ( isnan1==1 || isnan2==1) + /* only one is NaN, assume difference */ + else if (isnan1==1 && isnan2==0 || isnan1==0 && isnan2==1) { if ( print_data(options) ) { @@ -3316,8 +3375,8 @@ hsize_t diff_double(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_double, mem1, sizeof(double)); - memcpy(&temp2_double, mem2, sizeof(double)); + HDmemcpy(&temp1_double, mem1, sizeof(double)); + HDmemcpy(&temp2_double, mem2, sizeof(double)); /*------------------------------------------------------------------------- * detect NaNs @@ -3363,8 +3422,8 @@ hsize_t diff_double(unsigned char *mem1, } } - /* one is NaN, assume difference */ - else if ( isnan1==1 || isnan2==1) + /* only one is NaN, assume difference */ + else if (isnan1==1 && isnan2==0 || isnan1==0 && isnan2==1) { if ( print_data(options) ) { @@ -3393,8 +3452,8 @@ hsize_t diff_double(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_double, mem1, sizeof(double)); - memcpy(&temp2_double, mem2, sizeof(double)); + HDmemcpy(&temp1_double, mem1, sizeof(double)); + HDmemcpy(&temp2_double, mem2, sizeof(double)); if (equal_double(temp1_double,temp2_double,options)==FALSE) @@ -3472,8 +3531,8 @@ hsize_t diff_ldouble(unsigned char *mem1, { for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_double, mem1, sizeof(long double)); - memcpy(&temp2_double, mem2, sizeof(long double)); + HDmemcpy(&temp1_double, mem1, sizeof(long double)); + HDmemcpy(&temp2_double, mem2, sizeof(long double)); /*------------------------------------------------------------------------- * detect NaNs @@ -3499,8 +3558,8 @@ hsize_t diff_ldouble(unsigned char *mem1, nfound++; } } - /* one is NaN, assume difference */ - else if ( isnan1==1 || isnan2==1) + /* only one is NaN, assume difference */ + else if (isnan1==1 && isnan2==0 || isnan1==0 && isnan2==1) { if ( print_data(options) ) { @@ -3526,8 +3585,8 @@ hsize_t diff_ldouble(unsigned char *mem1, { for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_double, mem1, sizeof(long double)); - memcpy(&temp2_double, mem2, sizeof(long double)); + HDmemcpy(&temp1_double, mem1, sizeof(long double)); + HDmemcpy(&temp2_double, mem2, sizeof(long double)); /*------------------------------------------------------------------------- * detect NaNs @@ -3571,8 +3630,8 @@ hsize_t diff_ldouble(unsigned char *mem1, nfound++; } } - /* one is NaN, assume difference */ - else if ( isnan1==1 || isnan2==1) + /* only one is NaN, assume difference */ + else if (isnan1==1 && isnan2==0 || isnan1==0 && isnan2==1) { if ( print_data(options) ) { @@ -3599,8 +3658,8 @@ hsize_t diff_ldouble(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_double, mem1, sizeof(long double)); - memcpy(&temp2_double, mem2, sizeof(long double)); + HDmemcpy(&temp1_double, mem1, sizeof(long double)); + HDmemcpy(&temp2_double, mem2, sizeof(long double)); /*------------------------------------------------------------------------- * detect NaNs @@ -3646,8 +3705,8 @@ hsize_t diff_ldouble(unsigned char *mem1, } } - /* one is NaN, assume difference */ - else if ( isnan1==1 || isnan2==1) + /* only one is NaN, assume difference */ + else if (isnan1==1 && isnan2==0 || isnan1==0 && isnan2==1) { if ( print_data(options) ) { @@ -3676,8 +3735,8 @@ hsize_t diff_ldouble(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_double, mem1, sizeof(long double)); - memcpy(&temp2_double, mem2, sizeof(long double)); + HDmemcpy(&temp1_double, mem1, sizeof(long double)); + HDmemcpy(&temp2_double, mem2, sizeof(long double)); if (equal_ldouble(temp1_double,temp2_double,options)==FALSE) @@ -3750,8 +3809,8 @@ hsize_t diff_schar(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_char, mem1, sizeof(char)); - memcpy(&temp2_char, mem2, sizeof(char)); + HDmemcpy(&temp1_char, mem1, sizeof(char)); + HDmemcpy(&temp2_char, mem2, sizeof(char)); if (ABS(temp1_char-temp2_char) > options->delta) { @@ -3776,8 +3835,8 @@ hsize_t diff_schar(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_char, mem1, sizeof(char)); - memcpy(&temp2_char, mem2, sizeof(char)); + HDmemcpy(&temp1_char, mem1, sizeof(char)); + HDmemcpy(&temp2_char, mem2, sizeof(char)); PER(temp1_char,temp2_char); @@ -3820,8 +3879,8 @@ hsize_t diff_schar(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_char, mem1, sizeof(char)); - memcpy(&temp2_char, mem2, sizeof(char)); + HDmemcpy(&temp1_char, mem1, sizeof(char)); + HDmemcpy(&temp2_char, mem2, sizeof(char)); PER(temp1_char,temp2_char); @@ -3863,8 +3922,8 @@ hsize_t diff_schar(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_char, mem1, sizeof(char)); - memcpy(&temp2_char, mem2, sizeof(char)); + HDmemcpy(&temp1_char, mem1, sizeof(char)); + HDmemcpy(&temp2_char, mem2, sizeof(char)); if (temp1_char != temp2_char) { @@ -3927,8 +3986,8 @@ hsize_t diff_uchar(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_uchar, mem1, sizeof(unsigned char)); - memcpy(&temp2_uchar, mem2, sizeof(unsigned char)); + HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char)); + HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char)); if ( PDIFF(temp1_uchar,temp2_uchar) > options->delta) { @@ -3954,8 +4013,8 @@ hsize_t diff_uchar(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_uchar, mem1, sizeof(unsigned char)); - memcpy(&temp2_uchar, mem2, sizeof(unsigned char)); + HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char)); + HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char)); PER_UNSIGN(signed char,temp1_uchar,temp2_uchar); @@ -3998,8 +4057,8 @@ hsize_t diff_uchar(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_uchar, mem1, sizeof(unsigned char)); - memcpy(&temp2_uchar, mem2, sizeof(unsigned char)); + HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char)); + HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char)); PER_UNSIGN(signed char,temp1_uchar,temp2_uchar); @@ -4041,8 +4100,8 @@ hsize_t diff_uchar(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_uchar, mem1, sizeof(unsigned char)); - memcpy(&temp2_uchar, mem2, sizeof(unsigned char)); + HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char)); + HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char)); if (temp1_uchar != temp2_uchar) { @@ -4102,8 +4161,8 @@ hsize_t diff_short(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_short, mem1, sizeof(short)); - memcpy(&temp2_short, mem2, sizeof(short)); + HDmemcpy(&temp1_short, mem1, sizeof(short)); + HDmemcpy(&temp2_short, mem2, sizeof(short)); if (ABS(temp1_short-temp2_short) > options->delta) { @@ -4129,8 +4188,8 @@ hsize_t diff_short(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_short, mem1, sizeof(short)); - memcpy(&temp2_short, mem2, sizeof(short)); + HDmemcpy(&temp1_short, mem1, sizeof(short)); + HDmemcpy(&temp2_short, mem2, sizeof(short)); PER(temp1_short,temp2_short); @@ -4175,8 +4234,8 @@ hsize_t diff_short(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_short, mem1, sizeof(short)); - memcpy(&temp2_short, mem2, sizeof(short)); + HDmemcpy(&temp1_short, mem1, sizeof(short)); + HDmemcpy(&temp2_short, mem2, sizeof(short)); PER(temp1_short,temp2_short); @@ -4218,8 +4277,8 @@ hsize_t diff_short(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_short, mem1, sizeof(short)); - memcpy(&temp2_short, mem2, sizeof(short)); + HDmemcpy(&temp1_short, mem1, sizeof(short)); + HDmemcpy(&temp2_short, mem2, sizeof(short)); if (temp1_short != temp2_short) { @@ -4280,8 +4339,8 @@ hsize_t diff_ushort(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_ushort, mem1, sizeof(unsigned short)); - memcpy(&temp2_ushort, mem2, sizeof(unsigned short)); + HDmemcpy(&temp1_ushort, mem1, sizeof(unsigned short)); + HDmemcpy(&temp2_ushort, mem2, sizeof(unsigned short)); if ( PDIFF(temp1_ushort,temp2_ushort) > options->delta) { @@ -4307,8 +4366,8 @@ hsize_t diff_ushort(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_ushort, mem1, sizeof(unsigned short)); - memcpy(&temp2_ushort, mem2, sizeof(unsigned short)); + HDmemcpy(&temp1_ushort, mem1, sizeof(unsigned short)); + HDmemcpy(&temp2_ushort, mem2, sizeof(unsigned short)); PER_UNSIGN(signed short,temp1_ushort,temp2_ushort); @@ -4353,8 +4412,8 @@ hsize_t diff_ushort(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_ushort, mem1, sizeof(unsigned short)); - memcpy(&temp2_ushort, mem2, sizeof(unsigned short)); + HDmemcpy(&temp1_ushort, mem1, sizeof(unsigned short)); + HDmemcpy(&temp2_ushort, mem2, sizeof(unsigned short)); PER_UNSIGN(signed short,temp1_ushort,temp2_ushort); @@ -4396,8 +4455,8 @@ hsize_t diff_ushort(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_ushort, mem1, sizeof(unsigned short)); - memcpy(&temp2_ushort, mem2, sizeof(unsigned short)); + HDmemcpy(&temp1_ushort, mem1, sizeof(unsigned short)); + HDmemcpy(&temp2_ushort, mem2, sizeof(unsigned short)); if (temp1_ushort != temp2_ushort) { @@ -4459,8 +4518,8 @@ hsize_t diff_int(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_int, mem1, sizeof(int)); - memcpy(&temp2_int, mem2, sizeof(int)); + HDmemcpy(&temp1_int, mem1, sizeof(int)); + HDmemcpy(&temp2_int, mem2, sizeof(int)); if (ABS(temp1_int-temp2_int) > options->delta) { @@ -4486,8 +4545,8 @@ hsize_t diff_int(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_int, mem1, sizeof(int)); - memcpy(&temp2_int, mem2, sizeof(int)); + HDmemcpy(&temp1_int, mem1, sizeof(int)); + HDmemcpy(&temp2_int, mem2, sizeof(int)); PER(temp1_int,temp2_int); @@ -4532,8 +4591,8 @@ hsize_t diff_int(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_int, mem1, sizeof(int)); - memcpy(&temp2_int, mem2, sizeof(int)); + HDmemcpy(&temp1_int, mem1, sizeof(int)); + HDmemcpy(&temp2_int, mem2, sizeof(int)); PER(temp1_int,temp2_int); @@ -4575,8 +4634,8 @@ hsize_t diff_int(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_int, mem1, sizeof(int)); - memcpy(&temp2_int, mem2, sizeof(int)); + HDmemcpy(&temp1_int, mem1, sizeof(int)); + HDmemcpy(&temp2_int, mem2, sizeof(int)); if (temp1_int != temp2_int) { @@ -4638,8 +4697,8 @@ hsize_t diff_uint(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_uint, mem1, sizeof(unsigned int)); - memcpy(&temp2_uint, mem2, sizeof(unsigned int)); + HDmemcpy(&temp1_uint, mem1, sizeof(unsigned int)); + HDmemcpy(&temp2_uint, mem2, sizeof(unsigned int)); if ( PDIFF(temp1_uint,temp2_uint) > options->delta) { @@ -4665,8 +4724,8 @@ hsize_t diff_uint(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_uint, mem1, sizeof(unsigned int)); - memcpy(&temp2_uint, mem2, sizeof(unsigned int)); + HDmemcpy(&temp1_uint, mem1, sizeof(unsigned int)); + HDmemcpy(&temp2_uint, mem2, sizeof(unsigned int)); PER_UNSIGN(signed int,temp1_uint,temp2_uint); @@ -4710,8 +4769,8 @@ hsize_t diff_uint(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_uint, mem1, sizeof(unsigned int)); - memcpy(&temp2_uint, mem2, sizeof(unsigned int)); + HDmemcpy(&temp1_uint, mem1, sizeof(unsigned int)); + HDmemcpy(&temp2_uint, mem2, sizeof(unsigned int)); PER_UNSIGN(signed int,temp1_uint,temp2_uint); @@ -4752,8 +4811,8 @@ hsize_t diff_uint(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_uint, mem1, sizeof(unsigned int)); - memcpy(&temp2_uint, mem2, sizeof(unsigned int)); + HDmemcpy(&temp1_uint, mem1, sizeof(unsigned int)); + HDmemcpy(&temp2_uint, mem2, sizeof(unsigned int)); if (temp1_uint != temp2_uint) { @@ -4818,8 +4877,8 @@ hsize_t diff_long(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_long, mem1, sizeof(long)); - memcpy(&temp2_long, mem2, sizeof(long)); + HDmemcpy(&temp1_long, mem1, sizeof(long)); + HDmemcpy(&temp2_long, mem2, sizeof(long)); if (ABS(temp1_long-temp2_long) > options->delta) { @@ -4845,8 +4904,8 @@ hsize_t diff_long(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_long, mem1, sizeof(long)); - memcpy(&temp2_long, mem2, sizeof(long)); + HDmemcpy(&temp1_long, mem1, sizeof(long)); + HDmemcpy(&temp2_long, mem2, sizeof(long)); PER(temp1_long,temp2_long); @@ -4891,8 +4950,8 @@ hsize_t diff_long(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_long, mem1, sizeof(long)); - memcpy(&temp2_long, mem2, sizeof(long)); + HDmemcpy(&temp1_long, mem1, sizeof(long)); + HDmemcpy(&temp2_long, mem2, sizeof(long)); PER(temp1_long,temp2_long); @@ -4934,8 +4993,8 @@ hsize_t diff_long(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_long, mem1, sizeof(long)); - memcpy(&temp2_long, mem2, sizeof(long)); + HDmemcpy(&temp1_long, mem1, sizeof(long)); + HDmemcpy(&temp2_long, mem2, sizeof(long)); if (temp1_long != temp2_long) { @@ -5002,8 +5061,8 @@ hsize_t diff_ulong(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_ulong, mem1, sizeof(unsigned long)); - memcpy(&temp2_ulong, mem2, sizeof(unsigned long)); + HDmemcpy(&temp1_ulong, mem1, sizeof(unsigned long)); + HDmemcpy(&temp2_ulong, mem2, sizeof(unsigned long)); if ( PDIFF(temp1_ulong,temp2_ulong) > options->delta) { @@ -5031,8 +5090,8 @@ hsize_t diff_ulong(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_ulong, mem1, sizeof(unsigned long)); - memcpy(&temp2_ulong, mem2, sizeof(unsigned long)); + HDmemcpy(&temp1_ulong, mem1, sizeof(unsigned long)); + HDmemcpy(&temp2_ulong, mem2, sizeof(unsigned long)); PER_UNSIGN(signed long,temp1_ulong,temp2_ulong); @@ -5076,8 +5135,8 @@ hsize_t diff_ulong(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_ulong, mem1, sizeof(unsigned long)); - memcpy(&temp2_ulong, mem2, sizeof(unsigned long)); + HDmemcpy(&temp1_ulong, mem1, sizeof(unsigned long)); + HDmemcpy(&temp2_ulong, mem2, sizeof(unsigned long)); PER_UNSIGN(signed long,temp1_ulong,temp2_ulong); @@ -5118,8 +5177,8 @@ hsize_t diff_ulong(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_ulong, mem1, sizeof(unsigned long)); - memcpy(&temp2_ulong, mem2, sizeof(unsigned long)); + HDmemcpy(&temp1_ulong, mem1, sizeof(unsigned long)); + HDmemcpy(&temp2_ulong, mem2, sizeof(unsigned long)); if (temp1_ulong != temp2_ulong) { @@ -5181,8 +5240,8 @@ hsize_t diff_llong(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_llong, mem1, sizeof(long long)); - memcpy(&temp2_llong, mem2, sizeof(long long)); + HDmemcpy(&temp1_llong, mem1, sizeof(long long)); + HDmemcpy(&temp2_llong, mem2, sizeof(long long)); if (ABS( temp1_llong-temp2_llong) > options->delta) { @@ -5208,8 +5267,8 @@ hsize_t diff_llong(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_llong, mem1, sizeof(long long)); - memcpy(&temp2_llong, mem2, sizeof(long long)); + HDmemcpy(&temp1_llong, mem1, sizeof(long long)); + HDmemcpy(&temp2_llong, mem2, sizeof(long long)); PER(temp1_llong,temp2_llong); @@ -5251,8 +5310,8 @@ hsize_t diff_llong(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_llong, mem1, sizeof(long long)); - memcpy(&temp2_llong, mem2, sizeof(long long)); + HDmemcpy(&temp1_llong, mem1, sizeof(long long)); + HDmemcpy(&temp2_llong, mem2, sizeof(long long)); PER(temp1_llong,temp2_llong); @@ -5291,8 +5350,8 @@ hsize_t diff_llong(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_llong, mem1, sizeof(long long)); - memcpy(&temp2_llong, mem2, sizeof(long long)); + HDmemcpy(&temp1_llong, mem1, sizeof(long long)); + HDmemcpy(&temp2_llong, mem2, sizeof(long long)); if (temp1_llong != temp2_llong) { @@ -5355,8 +5414,8 @@ hsize_t diff_ullong(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_ullong, mem1, sizeof(unsigned long long)); - memcpy(&temp2_ullong, mem2, sizeof(unsigned long long)); + HDmemcpy(&temp1_ullong, mem1, sizeof(unsigned long long)); + HDmemcpy(&temp2_ullong, mem2, sizeof(unsigned long long)); if ( PDIFF(temp1_ullong,temp2_ullong) > (unsigned long long) options->delta) { @@ -5382,8 +5441,8 @@ hsize_t diff_ullong(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_ullong, mem1, sizeof(unsigned long long)); - memcpy(&temp2_ullong, mem2, sizeof(unsigned long long)); + HDmemcpy(&temp1_ullong, mem1, sizeof(unsigned long long)); + HDmemcpy(&temp2_ullong, mem2, sizeof(unsigned long long)); ull2float(temp1_ullong,&f1); ull2float(temp2_ullong,&f2); @@ -5427,8 +5486,8 @@ hsize_t diff_ullong(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_ullong, mem1, sizeof(unsigned long long)); - memcpy(&temp2_ullong, mem2, sizeof(unsigned long long)); + HDmemcpy(&temp1_ullong, mem1, sizeof(unsigned long long)); + HDmemcpy(&temp2_ullong, mem2, sizeof(unsigned long long)); ull2float(temp1_ullong,&f1); ull2float(temp2_ullong,&f2); @@ -5469,8 +5528,8 @@ hsize_t diff_ullong(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - memcpy(&temp1_ullong, mem1, sizeof(unsigned long long)); - memcpy(&temp2_ullong, mem2, sizeof(unsigned long long)); + HDmemcpy(&temp1_ullong, mem1, sizeof(unsigned long long)); + HDmemcpy(&temp2_ullong, mem2, sizeof(unsigned long long)); if (temp1_ullong != temp2_ullong) { @@ -5521,18 +5580,18 @@ int ull2float(unsigned long long ull_value, float *f_value) src_size = H5Tget_size(H5T_NATIVE_ULLONG); dst_size = H5Tget_size(H5T_NATIVE_FLOAT); - buf = (unsigned char*)calloc(1, MAX(src_size, dst_size)); + buf = (unsigned char*)HDcalloc(1, MAX(src_size, dst_size)); - memcpy(buf, &ull_value, src_size); + HDmemcpy(buf, &ull_value, src_size); /* do conversion */ if(H5Tconvert(H5T_NATIVE_ULLONG, H5T_NATIVE_FLOAT, 1, buf, NULL, dxpl_id)<0) goto error; - memcpy(f_value, buf, dst_size); + HDmemcpy(f_value, buf, dst_size); if(buf) - free(buf); + HDfree(buf); return 0; @@ -5541,7 +5600,7 @@ error: H5Pclose(dxpl_id); } H5E_END_TRY; if(buf) - free(buf); + HDfree(buf); return -1; } @@ -5715,13 +5774,13 @@ hbool_t equal_float(float value, float expected, diff_opt_t *options) /*------------------------------------------------------------------------- - * Function: my_isnan + * Function: my_isnan * - * Purpose: Determines whether VAL points to NaN. + * Purpose: Determines whether VAL points to NaN. * - * Return: TRUE or FALSE + * Return: TRUE or FALSE * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Monday, July 6, 1998 * * Modifications: @@ -5936,7 +5995,7 @@ void print_pos( int *ph, /* print header */ pos[i] = curr_pos/acc[i]; curr_pos -= acc[i]*pos[i]; } - assert( curr_pos == 0 ); + HDassert( curr_pos == 0 ); if ( rank > 0 ) { @@ -5989,7 +6048,7 @@ void print_char_pos( int *ph, /* print header */ pos[i] = curr_pos/acc[i]; curr_pos -= acc[i]*pos[i]; } - assert( curr_pos == 0 ); + HDassert( curr_pos == 0 ); parallel_print("[ " ); if ( rank > 0 ) @@ -6058,36 +6117,46 @@ static void h5diff_print_char(char ch) * added to improve performance for compound datasets * set up compound datatype structures. */ -static void set_comp_members(hid_t tid, mcomp_t *members) +static void get_member_types(hid_t tid, mcomp_t *members) { int i; + int tclass; if (tid <=0 || !members) return; - if (H5Tget_class(tid) != H5T_COMPOUND) - return; + tclass = H5Tget_class(tid); + if (tclass == H5T_ARRAY || tclass == H5T_VLEN) + { + hid_t base_tid = H5Tget_super(tid); + get_member_types(base_tid, members); + H5Tclose(base_tid); + } + else if (tclass == H5T_COMPOUND) + { + members->n = H5Tget_nmembers( tid ); + if (members->n <=0) + return; - members->n = H5Tget_nmembers( tid ); - if (members->n <=0) - return; + members->ids = HDcalloc(members->n, sizeof(hid_t)); + members->flags = HDcalloc(members->n, sizeof(unsigned char)); + members->offsets = HDcalloc(members->n, sizeof(size_t)); + members->m = HDcalloc(members->n, sizeof(mcomp_t *)); - members->ids = HDcalloc(members->n, sizeof(hid_t)); - members->flags = HDcalloc(members->n, sizeof(unsigned char)); - members->offsets = HDcalloc(members->n, sizeof(size_t)); - members->m = HDcalloc(members->n, sizeof(mcomp_t *)); - - for (i=0; i< members->n; i++) - { - members->ids[i] = H5Tget_member_type( tid, i ); - members->flags[i] = H5Tis_variable_str( members->ids[i] ); - members->offsets[i] = H5Tget_member_offset( tid, i ); - if (H5Tget_class( members->ids[i])==H5T_COMPOUND) - { - members->m[i] = (mcomp_t *)HDmalloc(sizeof(mcomp_t)); - set_comp_members(members->ids[i], members->m[i]); - } + for (i=0; i< members->n; i++) + { + members->ids[i] = H5Tget_member_type( tid, i ); + members->flags[i] = H5Tis_variable_str( members->ids[i] ); + members->offsets[i] = H5Tget_member_offset( tid, i ); + members->m[i] = (mcomp_t *)HDmalloc(sizeof(mcomp_t)); + HDmemset(members->m[i], 0, sizeof(mcomp_t)); + get_member_types(members->ids[i], members->m[i]); + } } + + return; + + } /*------------------------------------------------------------------------- @@ -6095,18 +6164,18 @@ static void set_comp_members(hid_t tid, mcomp_t *members) * added to improve performance for compound datasets * clean and close compound members. */ -static void free_comp_members(mcomp_t *members) +static void close_member_types(mcomp_t *members) { int i; if (!members || members->n<=0 || !members->ids) return; - for (i=0; in; i++) + for (i=0; in; i++) { - if (members->m[i]) + if (members->m[i]) { - free_comp_members(members->m[i]); + close_member_types(members->m[i]); HDfree(members->m[i]); } H5Tclose(members->ids[i]); diff --git a/tools/lib/h5diff_attr.c b/tools/lib/h5diff_attr.c index e5c5965..85cd01f 100644 --- a/tools/lib/h5diff_attr.c +++ b/tools/lib/h5diff_attr.c @@ -380,9 +380,10 @@ hsize_t diff_attr(hid_t loc1_id, *---------------------------------------------------------------------- */ - if(msize1 != msize2 || - diff_can_type(ftype1_id, ftype2_id, rank1, rank2, dims1, - dims2, NULL, NULL, name1, name2, options, 0) != 1) + /* pass dims1 and dims2 for maxdims as well since attribute's maxdims + * are always same */ + if( diff_can_type(ftype1_id, ftype2_id, rank1, rank2, dims1, dims2, + dims1, dims2, name1, name2, options, 0) != 1 ) { if(H5Tclose(ftype1_id) < 0) goto error; @@ -452,8 +453,8 @@ hsize_t diff_attr(hid_t loc1_id, nfound = diff_array(buf1, buf2, nelmts1, (hsize_t)0, rank1, dims1, options, np1, np2, mtype1_id, attr1_id, attr2_id); - /* not comparable, no display the different number */ - if(!options->not_cmp && nfound) { + /* print info if compatible and difference found */ + if(nfound) { do_print_attrname("attribute", np1, np2); print_found(nfound); } /* end if */ diff --git a/tools/lib/h5diff_dset.c b/tools/lib/h5diff_dset.c index 230e7bb..c1ed429 100644 --- a/tools/lib/h5diff_dset.c +++ b/tools/lib/h5diff_dset.c @@ -313,36 +313,38 @@ hsize_t diff_datasetid( hid_t did1, * check for different signed/unsigned types *------------------------------------------------------------------------- */ - - sign1=H5Tget_sign(m_tid1); - sign2=H5Tget_sign(m_tid2); - if ( sign1 != sign2 ) + if (can_compare) { - if ((options->m_verbose||options->m_list_not_cmp) && obj1_name && obj2_name) + sign1=H5Tget_sign(m_tid1); + sign2=H5Tget_sign(m_tid2); + if ( sign1 != sign2 ) { - 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)); + if ((options->m_verbose||options->m_list_not_cmp) && obj1_name && obj2_name) + { + parallel_print("Not comparable: <%s> has sign %s ", obj1_name, get_sign(sign1)); + parallel_print("and <%s> has sign %s\n", obj2_name, get_sign(sign2)); + } + + can_compare=0; + options->not_cmp=1; } - - can_compare=0; - options->not_cmp=1; } - + /* Check if type is either VLEN-data or VLEN-string to reclaim any * VLEN memory buffer later */ if( TRUE == h5tools_detect_vlen(m_tid1) ) vl_data = TRUE; - /*------------------------------------------------------------------------- + /*------------------------------------------------------------------------ * only attempt to compare if possible *------------------------------------------------------------------------- */ if(can_compare) /* it is possible to compare */ { - /*------------------------------------------------------------------------- + /*----------------------------------------------------------------- * get number of elements - *------------------------------------------------------------------------- + *------------------------------------------------------------------ */ nelmts1 = 1; for(i = 0; i < rank1; i++) @@ -354,9 +356,9 @@ hsize_t diff_datasetid( hid_t did1, HDassert(nelmts1 == nelmts2); - /*------------------------------------------------------------------------- + /*----------------------------------------------------------------- * "upgrade" the smaller memory size - *------------------------------------------------------------------------- + *------------------------------------------------------------------ */ if(m_size1 != m_size2) { @@ -386,11 +388,10 @@ hsize_t diff_datasetid( hid_t did1, name2 = diff_basename(obj2_name); - /*------------------------------------------------------------------------- + /*---------------------------------------------------------------- * read/compare - *------------------------------------------------------------------------- + *----------------------------------------------------------------- */ - need = (size_t)(nelmts1 * m_size1); /* bytes needed */ if(need < H5TOOLS_MALLOCSIZE) { buf1 = HDmalloc(need); @@ -408,7 +409,7 @@ hsize_t diff_datasetid( hid_t did1, options, name1, name2, m_tid1, did1, did2); /* reclaim any VL memory, if necessary */ - if(vl_data) { + if(vl_data) { H5Dvlen_reclaim(m_tid1, sid1, H5P_DEFAULT, buf1); H5Dvlen_reclaim(m_tid2, sid2, H5P_DEFAULT, buf2); } /* end if */ @@ -444,27 +445,27 @@ hsize_t diff_datasetid( hid_t did1, size = 1; sm_size[i - 1] = MIN(dims1[i - 1], size); sm_nbytes *= sm_size[i - 1]; - assert(sm_nbytes > 0); + HDassert(sm_nbytes > 0); } /* end for */ - /* malloc return code should be verified. + /* malloc return code should be verified. * If fail, need to handle the error. * This else branch should be recoded as a separate function. * Note that there are many "goto error" within this branch * that fails to address freeing other objects created here. - * E.g., sm_space. - */ - sm_buf1 = malloc((size_t)sm_nbytes); - assert(sm_buf1); - sm_buf2 = malloc((size_t)sm_nbytes); - assert(sm_buf2); + * E.g., sm_space. + */ + sm_buf1 = HDmalloc((size_t)sm_nbytes); + HDassert(sm_buf1); + sm_buf2 = HDmalloc((size_t)sm_nbytes); + HDassert(sm_buf2); 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); + HDmemset(hs_offset, 0, sizeof hs_offset); + HDmemset(zero, 0, sizeof zero); for(elmtno = 0; elmtno < p_nelmts; elmtno += hs_nelmts) { /* calculate the hyperslab size */ @@ -528,19 +529,19 @@ hsize_t diff_datasetid( hid_t did1, /* free */ if(buf1 != NULL) { - free(buf1); + HDfree(buf1); buf1 = NULL; } /* end if */ if(buf2 != NULL) { - free(buf2); + HDfree(buf2); buf2 = NULL; } /* end if */ if(sm_buf1 != NULL) { - free(sm_buf1); + HDfree(sm_buf1); sm_buf1 = NULL; } /* end if */ if(sm_buf2 != NULL) { - free(sm_buf2); + HDfree(sm_buf2); sm_buf2 = NULL; } /* end if */ @@ -562,17 +563,17 @@ error: if (buf1!=NULL) { /* reclaim any VL memory, if necessary */ - if(vl_data) + if(vl_data) H5Dvlen_reclaim(m_tid1, sid1, H5P_DEFAULT, buf1); - free(buf1); + HDfree(buf1); buf1=NULL; } if (buf2!=NULL) { /* reclaim any VL memory, if necessary */ - if(vl_data) + if(vl_data) H5Dvlen_reclaim(m_tid2, sid2, H5P_DEFAULT, buf2); - free(buf2); + HDfree(buf2); buf2=NULL; } if (sm_buf1!=NULL) @@ -580,7 +581,7 @@ error: /* reclaim any VL memory, if necessary */ if(vl_data) H5Dvlen_reclaim(m_tid1, sm_space, H5P_DEFAULT, sm_buf1); - free(sm_buf1); + HDfree(sm_buf1); sm_buf1=NULL; } if (sm_buf2!=NULL) @@ -588,7 +589,7 @@ error: /* reclaim any VL memory, if necessary */ if(vl_data) H5Dvlen_reclaim(m_tid1, sm_space, H5P_DEFAULT, sm_buf2); - free(sm_buf2); + HDfree(sm_buf2); sm_buf2=NULL; } @@ -694,7 +695,7 @@ int diff_can_type( hid_t f_tid1, /* file data type */ *------------------------------------------------------------------------- */ - assert(tclass1==tclass2); + HDassert(tclass1==tclass2); switch (tclass1) { case H5T_INTEGER: @@ -783,7 +784,7 @@ int diff_can_type( hid_t f_tid1, /* file data type */ *------------------------------------------------------------------------- */ - assert(rank1==rank2); + HDassert(rank1==rank2); for ( i=0; i 0 ) - { - - parallel_print("[" ); - for ( i = 0; i < rank-1; i++) - { - parallel_print(HSIZE_T_FORMAT, dims[i]); - parallel_print("x"); - } - - parallel_print(HSIZE_T_FORMAT, dims[rank-1]); - parallel_print("]" ); - } - else + if ( rank <= 0 ) { parallel_print("H5S_SCALAR" ); } + else + { + if (!dims) + parallel_print("dimension is NULL"); + else + { + parallel_print("["); + for ( i = 0; i < rank-1; i++) + { + parallel_print(HSIZE_T_FORMAT, dims[i]); + parallel_print("x"); + } + parallel_print(HSIZE_T_FORMAT, dims[rank-1]); + parallel_print("]" ); + } + } } @@ -180,7 +183,7 @@ diff_basename(const char *name) return NULL; /* Find the end of the base name */ - i = strlen(name); + i = HDstrlen(name); while (i>0 && '/'==name[i-1]) --i; diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c index cf83504..5e173e8 100644 --- a/tools/lib/h5tools.c +++ b/tools/lib/h5tools.c @@ -25,6 +25,7 @@ #include #include "h5tools.h" +#include "h5tools_dump.h" #include "h5tools_ref.h" #include "h5tools_utils.h" #include "H5private.h" @@ -34,220 +35,24 @@ #define ALIGN(A,Z) ((((A) + (Z) - 1) / (Z)) * (Z)) /* global variables */ +hid_t H5tools_ERR_STACK_g = 0; hid_t H5tools_ERR_CLS_g = -1; hid_t H5E_tools_g = -1; hid_t H5E_tools_min_id_g = -1; int compound_data; -FILE *rawdatastream; /* should initialize to stdout but gcc moans about it */ -int bin_output; /* binary output */ -int bin_form; /* binary form */ -int region_output; /* region output */ - -static h5tool_format_t h5tools_dataformat = { -0, /*raw */ - -"", /*fmt_raw */ -"%d", /*fmt_int */ -"%u", /*fmt_uint */ -"%hhd", /*fmt_schar */ -"%u", /*fmt_uchar */ -"%d", /*fmt_short */ -"%u", /*fmt_ushort */ -"%ld", /*fmt_long */ -"%lu", /*fmt_ulong */ -NULL, /*fmt_llong */ -NULL, /*fmt_ullong */ -"%g", /*fmt_double */ -"%g", /*fmt_float */ - -0, /*ascii */ -0, /*str_locale */ -0, /*str_repeat */ - -"[ ", /*arr_pre */ -",", /*arr_sep */ -" ]", /*arr_suf */ -1, /*arr_linebreak */ - -"", /*cmpd_name */ -",\n", /*cmpd_sep */ -"{\n", /*cmpd_pre */ -"}", /*cmpd_suf */ -"\n", /*cmpd_end */ -NULL, /* cmpd_listv */ - -", ", /*vlen_sep */ -"(", /*vlen_pre */ -")", /*vlen_suf */ -"", /*vlen_end */ - -"%s", /*elmt_fmt */ -",", /*elmt_suf1 */ -" ", /*elmt_suf2 */ - -"", /*idx_n_fmt */ -"", /*idx_sep */ -"", /*idx_fmt */ - -80, /*line_ncols *//*standard default columns */ -0, /*line_per_line */ -"", /*line_pre */ -"%s", /*line_1st */ -"%s", /*line_cont */ -"", /*line_suf */ -"", /*line_sep */ -1, /*line_multi_new */ -" ", /*line_indent */ - -1, /*skip_first */ - -1, /*obj_hidefileno */ -" "H5_PRINTF_HADDR_FMT, /*obj_format */ - -1, /*dset_hidefileno */ -"DATASET %s ", /*dset_format */ -"%s", /*dset_blockformat_pre */ -"%s", /*dset_ptformat_pre */ -"%s", /*dset_ptformat */ -1, /*array indices */ -1 /*escape non printable characters */ -}; - -static const h5tools_dump_header_t h5tools_standardformat = { -"standardformat", /*name */ -"HDF5", /*fileebgin */ -"", /*fileend */ -SUPER_BLOCK, /*bootblockbegin */ -"", /*bootblockend */ -H5_TOOLS_GROUP, /*groupbegin */ -"", /*groupend */ -H5_TOOLS_DATASET, /*datasetbegin */ -"", /*datasetend */ -ATTRIBUTE, /*attributebegin */ -"", /*attributeend */ -H5_TOOLS_DATATYPE, /*datatypebegin */ -"", /*datatypeend */ -DATASPACE, /*dataspacebegin */ -"", /*dataspaceend */ -DATA, /*databegin */ -"", /*dataend */ -SOFTLINK, /*softlinkbegin */ -"", /*softlinkend */ -EXTLINK, /*extlinkbegin */ -"", /*extlinkend */ -UDLINK, /*udlinkbegin */ -"", /*udlinkend */ -SUBSET, /*subsettingbegin */ -"", /*subsettingend */ -START, /*startbegin */ -"", /*startend */ -STRIDE, /*stridebegin */ -"", /*strideend */ -COUNT, /*countbegin */ -"", /*countend */ -BLOCK, /*blockbegin */ -"", /*blockend */ - -"{", /*fileblockbegin */ -"}", /*fileblockend */ -"{", /*bootblockblockbegin */ -"}", /*bootblockblockend */ -"{", /*groupblockbegin */ -"}", /*groupblockend */ -"{", /*datasetblockbegin */ -"}", /*datasetblockend */ -"{", /*attributeblockbegin */ -"}", /*attributeblockend */ -"", /*datatypeblockbegin */ -"", /*datatypeblockend */ -"", /*dataspaceblockbegin */ -"", /*dataspaceblockend */ -"{", /*datablockbegin */ -"}", /*datablockend */ -"{", /*softlinkblockbegin */ -"}", /*softlinkblockend */ -"{", /*extlinkblockbegin */ -"}", /*extlinkblockend */ -"{", /*udlinkblockbegin */ -"}", /*udlinkblockend */ -"{", /*strblockbegin */ -"}", /*strblockend */ -"{", /*enumblockbegin */ -"}", /*enumblockend */ -"{", /*structblockbegin */ -"}", /*structblockend */ -"{", /*vlenblockbegin */ -"}", /*vlenblockend */ -"{", /*subsettingblockbegin */ -"}", /*subsettingblockend */ -"(", /*startblockbegin */ -");", /*startblockend */ -"(", /*strideblockbegin */ -");", /*strideblockend */ -"(", /*countblockbegin */ -");", /*countblockend */ -"(", /*blockblockbegin */ -");", /*blockblockend */ - -"", /*dataspacedescriptionbegin */ -"", /*dataspacedescriptionend */ -"(", /*dataspacedimbegin */ -")", /*dataspacedimend */ -}; - -static const h5tools_dump_header_t * h5tools_dump_header_format; - -/* local prototypes */ -static int do_bin_output(FILE *stream, hid_t container, hsize_t nelmts, hid_t tid, void *_mem); -static int render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem); -static int render_bin_output_region_data_blocks(hid_t region_id, FILE *stream, - hid_t container, int ndims, hid_t type_id, hssize_t nblocks, hsize_t *ptdata); -static hbool_t render_bin_output_region_blocks(hid_t region_space, hid_t region_id, - FILE *stream, hid_t container); -static hbool_t render_bin_output_region_points(hid_t region_space, hid_t region_id, - FILE *stream, hid_t container); -static hbool_t h5tools_is_zero(const void *_mem, size_t size); - -hbool_t h5tools_render_element(FILE *stream, const h5tool_format_t *info, - h5tools_context_t *ctx/*in,out*/, - h5tools_str_t *buffer/*string into which to render */, - hsize_t *curr_pos/*total data element position*/, - size_t ncols, hsize_t local_elmt_counter/*element counter*/, - hsize_t elmt_counter); - -hbool_t h5tools_render_region_element(FILE *stream, const h5tool_format_t *info, - h5tools_context_t *ctx/*in,out*/, - h5tools_str_t *buffer/*string into which to render */, - hsize_t *curr_pos/*total data element position*/, - size_t ncols, hsize_t *ptdata, - hsize_t local_elmt_counter/*element counter*/, - hsize_t elmt_counter); - -static int h5tools_print_region_data_blocks(hid_t region_id, - FILE *stream, const h5tool_format_t *info, h5tools_context_t ctx, - h5tools_str_t *buffer/*string into which to render */, size_t ncols, - int ndims, hid_t type_id, hssize_t nblocks, hsize_t *ptdata); - -hbool_t h5tools_dump_region_data_points(hid_t region_space, hid_t region_id, - FILE *stream, const h5tool_format_t *info, - h5tools_context_t *ctx/*in,out*/, - h5tools_str_t *buffer/*string into which to render */, - hsize_t *curr_pos/*total data element position*/, - size_t ncols, hsize_t region_elmt_counter/*element counter*/, - hsize_t elmt_counter); - -int h5tools_print_region_data_points(hid_t region_space, hid_t region_id, - FILE *stream, const h5tool_format_t *info, h5tools_context_t ctx, - h5tools_str_t *buffer, size_t ncols, - int ndims, hid_t type_id, hssize_t npoints, hsize_t *ptdata); - -hbool_t h5tools_dump_region_data_blocks(hid_t region_space, hid_t region_id, - FILE *stream, const h5tool_format_t *info, - h5tools_context_t *ctx/*in,out*/, - h5tools_str_t *buffer/*string into which to render */, - hsize_t *curr_pos/*total data element position*/, - size_t ncols, hsize_t region_elmt_counter/*element counter*/, - hsize_t elmt_counter); +FILE *rawdatastream; /* should initialize to stdout but gcc moans about it */ +FILE *rawoutstream; /* should initialize to stdout but gcc moans about it */ +FILE *rawerrorstream; /* should initialize to stderr but gcc moans about it */ +int bin_output; /* binary output */ +int bin_form; /* binary form */ +int region_output; /* region output */ +int oid_output; /* oid output */ +int data_output; /* data output */ +int attr_data_output; /* attribute data output */ +int packed_bits_num; /* number of packed bits to display */ +int packed_data_offset; /* offset of packed bits to display */ +int packed_data_length; /* lengtht of packed bits to display */ +unsigned long long packed_data_mask; /* mask in which packed bits to display */ /* module-scoped variables */ static int h5tools_init_g; /* if h5tools lib has been initialized */ @@ -309,14 +114,19 @@ h5tools_init(void) if (!h5tools_init_g) { /* register the error class */ - sprintf(lib_str, "%d.%d.%d",H5_VERS_MAJOR, H5_VERS_MINOR, H5_VERS_RELEASE); - + HDsnprintf(lib_str, sizeof(lib_str), "%d.%d.%d",H5_VERS_MAJOR, H5_VERS_MINOR, H5_VERS_RELEASE); + + H5tools_ERR_STACK_g = H5Ecreate_stack(); H5TOOLS_INIT_ERROR() if (!rawdatastream) rawdatastream = stdout; + if (!rawoutstream) + rawoutstream = stdout; + if (!rawerrorstream) + rawerrorstream = stderr; - h5tools_dump_header_format = &h5tools_standardformat; + h5tools_dump_init(); h5tools_init_g++; } @@ -341,19 +151,36 @@ h5tools_init(void) void h5tools_close(void) { + H5E_auto2_t tools_func; + void *tools_edata; if (h5tools_init_g) { + H5Eget_auto2(H5tools_ERR_STACK_g, &tools_func, &tools_edata); + if(tools_func!=NULL) + H5Eprint2(H5tools_ERR_STACK_g, rawerrorstream); if (rawdatastream && rawdatastream != stdout) { if (fclose(rawdatastream)) perror("closing rawdatastream"); else rawdatastream = NULL; } + if (rawoutstream && rawoutstream != stdout) { + if (fclose(rawoutstream)) + perror("closing rawoutstream"); + else + rawoutstream = NULL; + } + if (rawerrorstream && rawerrorstream != stderr) { + if (fclose(rawerrorstream)) + perror("closing rawerrorstream"); + else + rawerrorstream = NULL; + } /* Clean up the reference path table, if it's been used */ term_ref_path_table(); H5TOOLS_CLOSE_ERROR() - + H5Eclose_stack(H5tools_ERR_STACK_g); /* Shut down the library */ H5close(); @@ -393,7 +220,7 @@ h5tools_get_fapl(hid_t fapl, const char *driver, unsigned *drivernum) /* Determine which driver the user wants to open the file with. Try * that driver. If it can't open it, then fail. */ - if (!strcmp(driver, drivernames[SEC2_IDX])) { + if (!HDstrcmp(driver, drivernames[SEC2_IDX])) { /* SEC2 driver */ if (H5Pset_fapl_sec2(new_fapl) < 0) goto error; @@ -401,7 +228,7 @@ h5tools_get_fapl(hid_t fapl, const char *driver, unsigned *drivernum) if (drivernum) *drivernum = SEC2_IDX; } - else if (!strcmp(driver, drivernames[FAMILY_IDX])) { + else if (!HDstrcmp(driver, drivernames[FAMILY_IDX])) { /* FAMILY Driver */ /* Set member size to be 0 to indicate the current first member size @@ -413,7 +240,7 @@ h5tools_get_fapl(hid_t fapl, const char *driver, unsigned *drivernum) if (drivernum) *drivernum = FAMILY_IDX; } - else if (!strcmp(driver, drivernames[SPLIT_IDX])) { + else if (!HDstrcmp(driver, drivernames[SPLIT_IDX])) { /* SPLIT Driver */ if (H5Pset_fapl_split(new_fapl, "-m.h5", H5P_DEFAULT, "-r.h5", H5P_DEFAULT) < 0) goto error; @@ -421,7 +248,7 @@ h5tools_get_fapl(hid_t fapl, const char *driver, unsigned *drivernum) if (drivernum) *drivernum = SPLIT_IDX; } - else if (!strcmp(driver, drivernames[MULTI_IDX])) { + else if (!HDstrcmp(driver, drivernames[MULTI_IDX])) { /* MULTI Driver */ if (H5Pset_fapl_multi(new_fapl, NULL, NULL, NULL, NULL, TRUE) < 0) goto error; @@ -430,7 +257,7 @@ h5tools_get_fapl(hid_t fapl, const char *driver, unsigned *drivernum) *drivernum = MULTI_IDX; #ifdef H5_HAVE_STREAM } - else if(!strcmp(driver, drivernames[STREAM_IDX])) { + else if(!HDstrcmp(driver, drivernames[STREAM_IDX])) { /* STREAM Driver */ if(H5Pset_fapl_stream(new_fapl, NULL) < 0) goto error; @@ -440,7 +267,7 @@ h5tools_get_fapl(hid_t fapl, const char *driver, unsigned *drivernum) #endif /* H5_HAVE_STREAM */ #ifdef H5_HAVE_PARALLEL } - else if(!strcmp(driver, drivernames[MPIO_IDX])) { + else if(!HDstrcmp(driver, drivernames[MPIO_IDX])) { /* MPI-I/O Driver */ /* check if MPI has been initialized. */ if(!h5tools_mpi_init_g) @@ -453,7 +280,7 @@ h5tools_get_fapl(hid_t fapl, const char *driver, unsigned *drivernum) *drivernum = MPIO_IDX; } /* end if */ } - else if (!strcmp(driver, drivernames[MPIPOSIX_IDX])) { + else if (!HDstrcmp(driver, drivernames[MPIPOSIX_IDX])) { /* MPI-I/O Driver */ /* check if MPI has been initialized. */ if(!h5tools_mpi_init_g) @@ -579,7 +406,7 @@ h5tools_fopen(const char *fname, unsigned flags, hid_t fapl, const char *driver, /* Save the driver name */ if (drivername && drivername_size) { if (fid != FAIL) { - strncpy(drivername, drivernames[drivernum], drivername_size); + HDstrncpy(drivername, drivernames[drivernum], drivername_size); drivername[drivername_size - 1] = '\0'; } else { @@ -611,7 +438,7 @@ done: *------------------------------------------------------------------------- */ static size_t -h5tools_ncols(const char *s) +h5tools_count_ncols(const char *s) { register size_t i; @@ -627,11 +454,11 @@ h5tools_ncols(const char *s) * * Purpose: Recursive check for any variable length data in given type. * - * Return: + * Return: * TRUE : type conatains any variable length data * FALSE : type doesn't contain any variable length data * Negative value: error occur - * + * * Programmer: Jonathan Kim March 18, 2011 *------------------------------------------------------------------------- */ @@ -659,7 +486,7 @@ done: * * Purpose: Recursive check for variable length string of a datatype. * - * Return: + * Return: * TRUE : type conatains any variable length string * FALSE : type doesn't contain any variable length string * Negative value: error occur @@ -737,7 +564,7 @@ done: * level before) *------------------------------------------------------------------------- */ -static void +void h5tools_simple_prefix(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx, hsize_t elmtno, int secnum) { @@ -749,14 +576,14 @@ h5tools_simple_prefix(FILE *stream, const h5tool_format_t *info, if (!ctx->need_prefix) return; - memset(&prefix, 0, sizeof(h5tools_str_t)); - memset(&str, 0, sizeof(h5tools_str_t)); + HDmemset(&prefix, 0, sizeof(h5tools_str_t)); + HDmemset(&str, 0, sizeof(h5tools_str_t)); /* Terminate previous line, if any */ if (ctx->cur_column) { - fputs(OPT(info->line_suf, ""), stream); - putc('\n', stream); - fputs(OPT(info->line_sep, ""), stream); + HDfputs(OPT(info->line_suf, ""), stream); + HDputc('\n', stream); + HDfputs(OPT(info->line_sep, ""), stream); } /* Calculate new prefix */ @@ -780,23 +607,23 @@ h5tools_simple_prefix(FILE *stream, const h5tool_format_t *info, the prefix is printed one indentation level before */ if (info->pindex) { for (i = 0; i < indentlevel - 1; i++) { - fputs(h5tools_str_fmt(&str, 0, info->line_indent), stream); + HDfputs(h5tools_str_fmt(&str, 0, info->line_indent), stream); } } if (elmtno == 0 && secnum == 0 && info->line_1st) - fputs(h5tools_str_fmt(&prefix, 0, info->line_1st), stream); + HDfputs(h5tools_str_fmt(&prefix, 0, info->line_1st), stream); else if (secnum && info->line_cont) - fputs(h5tools_str_fmt(&prefix, 0, info->line_cont), stream); + HDfputs(h5tools_str_fmt(&prefix, 0, info->line_cont), stream); else - fputs(h5tools_str_fmt(&prefix, 0, info->line_pre), stream); + HDfputs(h5tools_str_fmt(&prefix, 0, info->line_pre), stream); templength = h5tools_str_len(&prefix); for (i = 0; i < indentlevel; i++) { /*we already made the indent for the array indices case */ if (!info->pindex) { - fputs(h5tools_str_fmt(&prefix, 0, info->line_indent), stream); + HDfputs(h5tools_str_fmt(&prefix, 0, info->line_indent), stream); templength += h5tools_str_len(&prefix); } else { @@ -826,7 +653,7 @@ h5tools_simple_prefix(FILE *stream, const h5tool_format_t *info, * None *------------------------------------------------------------------------- */ -static void +void h5tools_region_simple_prefix(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx, hsize_t elmtno, hsize_t *ptdata, int secnum) { @@ -838,19 +665,18 @@ h5tools_region_simple_prefix(FILE *stream, const h5tool_format_t *info, if (!ctx->need_prefix) return; - memset(&prefix, 0, sizeof(h5tools_str_t)); - memset(&str, 0, sizeof(h5tools_str_t)); + HDmemset(&prefix, 0, sizeof(h5tools_str_t)); + HDmemset(&str, 0, sizeof(h5tools_str_t)); /* Terminate previous line, if any */ if (ctx->cur_column) { - fputs(OPT(info->line_suf, ""), stream); - putc('\n', stream); - fputs(OPT(info->line_sep, ""), stream); + HDfputs(OPT(info->line_suf, ""), stream); + HDputc('\n', stream); + HDfputs(OPT(info->line_sep, ""), stream); } /* Calculate new prefix */ - h5tools_str_region_prefix(&prefix, info, elmtno, ptdata, ctx->ndims, - ctx->p_max_idx, ctx); + h5tools_str_region_prefix(&prefix, info, elmtno, ptdata, ctx->ndims, ctx->p_max_idx, ctx); /* Write new prefix to output */ if (ctx->indent_level >= 0) { @@ -870,23 +696,23 @@ h5tools_region_simple_prefix(FILE *stream, const h5tool_format_t *info, the prefix is printed one indentation level before */ if (info->pindex) { for (i = 0; i < indentlevel - 1; i++) { - fputs(h5tools_str_fmt(&str, 0, info->line_indent), stream); + HDfputs(h5tools_str_fmt(&str, 0, info->line_indent), stream); } } if (elmtno == 0 && secnum == 0 && info->line_1st) - fputs(h5tools_str_fmt(&prefix, 0, info->line_1st), stream); + HDfputs(h5tools_str_fmt(&prefix, 0, info->line_1st), stream); else if (secnum && info->line_cont) - fputs(h5tools_str_fmt(&prefix, 0, info->line_cont), stream); + HDfputs(h5tools_str_fmt(&prefix, 0, info->line_cont), stream); else - fputs(h5tools_str_fmt(&prefix, 0, info->line_pre), stream); + HDfputs(h5tools_str_fmt(&prefix, 0, info->line_pre), stream); templength = h5tools_str_len(&prefix); for (i = 0; i < indentlevel; i++) { /*we already made the indent for the array indices case */ if (!info->pindex) { - fputs(h5tools_str_fmt(&prefix, 0, info->line_indent), stream); + HDfputs(h5tools_str_fmt(&prefix, 0, info->line_indent), stream); templength += h5tools_str_len(&prefix); } else { @@ -907,159 +733,6 @@ h5tools_region_simple_prefix(FILE *stream, const h5tool_format_t *info, /*------------------------------------------------------------------------- * Audience: Public * Chapter: H5Tools Library - * Purpose: Prints NELMTS data elements to output STREAM. - * Description: - * Prints some (NELMTS) data elements to output STREAM. The elements are - * stored in _MEM as type TYPE and are printed according to the format - * described in INFO. The CTX struct contains context information shared - * between calls to this function. The FLAGS is a bit field that - * indicates whether the data supplied in this call falls at the - * beginning or end of the total data to be printed (START_OF_DATA and - * END_OF_DATA). - * Return: - * None - * Programmer: - * Robb Matzke, Monday, April 26, 1999 - * Modifications: - * Robb Matzke, 1999-06-04 - * The `container' argument is the optional dataset for reference types. - * - * Robb Matzke, 1999-09-29 - * Understands the `per_line' property which indicates that every Nth - * element should begin a new line. - * - * Robb Matzke, LLNL, 2003-06-05 - * Do not dereference the memory for a variable-length string here. - * Deref in h5tools_str_sprint() instead so recursive types are - * handled correctly. - * - * Pedro Vicente Nunes, The HDF Group, 2005-10-19 - * pass to the prefix in h5tools_simple_prefix the total position - * instead of the current stripmine position i; this is necessary - * to print the array indices - * new field sm_pos in h5tools_context_t, the current stripmine element position - *------------------------------------------------------------------------- - */ -void -h5tools_dump_simple_data(FILE *stream, const h5tool_format_t *info, hid_t container, - h5tools_context_t *ctx/*in,out*/, unsigned flags, - hsize_t nelmts, hid_t type, void *_mem) -{ - unsigned char *mem = (unsigned char*) _mem; - hsize_t i; /*element counter */ - size_t size; /*size of each datum */ - hid_t region_space; - hid_t region_id; - hbool_t dimension_break = TRUE; - H5S_sel_type region_type; - size_t ncols = 80; /*available output width */ - h5tools_str_t buffer; /*string into which to render */ - hsize_t curr_pos; /* total data element position */ - hsize_t elmt_counter = 0;/*counts the # elements printed. - *I (ptl?) needed something that - *isn't going to get reset when a new - *line is formed. I'm going to use - *this var to count elements and - *break after we see a number equal - *to the ctx->size_last_dim. */ - - /* binary dump */ - if (bin_output) { - do_bin_output(rawdatastream, container, nelmts, type, _mem); - } /* end if */ - else { - /* setup */ - HDmemset(&buffer, 0, sizeof(h5tools_str_t)); - size = H5Tget_size(type); - - if (info->line_ncols > 0) - ncols = info->line_ncols; - - /* pass to the prefix in h5tools_simple_prefix the total position - * instead of the current stripmine position i; this is necessary - * to print the array indices - */ - curr_pos = ctx->sm_pos; - - for (i = 0; i < nelmts; i++, ctx->cur_elmt++, elmt_counter++) { - void* memref = mem + i * size; - if (region_output && H5Tequal(type, H5T_STD_REF_DSETREG)) { - char ref_name[1024]; - - /* region data */ - region_id = H5Rdereference(container, H5R_DATASET_REGION, memref); - if (region_id >= 0) { - region_space = H5Rget_region(container, H5R_DATASET_REGION, memref); - if (region_space >= 0) { - if (h5tools_is_zero(memref, H5Tget_size(type))) { - h5tools_str_append(&buffer, "NULL"); - } - else { - if(H5Rget_name(region_id, H5R_DATASET_REGION, memref, (char*) ref_name, 1024)<0) - HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Rget_name failed"); - - /* Render the region element begin */ - h5tools_str_reset(&buffer); - - h5tools_str_append(&buffer, info->dset_format, ref_name); - - dimension_break = h5tools_render_element(stdout, info, - ctx, &buffer, &curr_pos, ncols, i, elmt_counter); - - region_type = H5Sget_select_type(region_space); - if(region_type==H5S_SEL_POINTS) - /* Print point information */ - dimension_break = h5tools_dump_region_data_points( - region_space, region_id, stdout, info, ctx, - &buffer, &curr_pos, ncols, i, elmt_counter); - else if(region_type==H5S_SEL_HYPERSLABS) - /* Print block information */ - dimension_break = h5tools_dump_region_data_blocks( - region_space, region_id, stdout, info, ctx, - &buffer, &curr_pos, ncols, i, elmt_counter); - else - HERROR(H5E_tools_g, H5E_tools_min_id_g, "invalid region type"); - /* Render the region element end */ - - } /* end else to if (h5tools_is_zero(... */ - if(H5Sclose(region_space) < 0) - HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Sclose failed"); - } /* end if (region_space >= 0) */ - else - HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Rget_region failed"); - if(H5Dclose(region_id) < 0) - HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Dclose failed"); - - } /* if (region_id >= 0) */ - else - HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Rdereference failed"); - - ctx->need_prefix = TRUE; - } /* end if (region_output... */ - else { - /* Render the data element begin*/ - h5tools_str_reset(&buffer); - h5tools_str_sprint(&buffer, info, container, type, memref, ctx); - - if (i + 1 < nelmts || (flags & END_OF_DATA) == 0) - h5tools_str_append(&buffer, "%s", OPT(info->elmt_suf1, ",")); - - dimension_break = h5tools_render_element(stream, info, ctx, &buffer, - &curr_pos, ncols, i, elmt_counter); - /* Render the data element end*/ - - } - if(FALSE==dimension_break) - elmt_counter = 0; - } /* end for (i = 0; i < nelmts... */ - - h5tools_str_close(&buffer); - }/* else bin */ -} - -/*------------------------------------------------------------------------- - * Audience: Public - * Chapter: H5Tools Library * Purpose: Render an element to output STREAM. * Description: * Prints the string buffer to the output STREAM. The string is @@ -1100,9 +773,9 @@ h5tools_render_element(FILE *stream, const h5tool_format_t *info, * current location... */ if (info->line_multi_new == 1 && - (ctx->cur_column + h5tools_ncols(s) + - strlen(OPT(info->elmt_suf2, " ")) + - strlen(OPT(info->line_suf, ""))) > ncols) { + (ctx->cur_column + h5tools_count_ncols(s) + + HDstrlen(OPT(info->elmt_suf2, " ")) + + HDstrlen(OPT(info->line_suf, ""))) > ncols) { if (ctx->prev_multiline) { /* * ... and the previous element also occupied more than one @@ -1110,9 +783,9 @@ h5tools_render_element(FILE *stream, const h5tool_format_t *info, */ ctx->need_prefix = TRUE; } - else if ((ctx->prev_prefix_len + h5tools_ncols(s) + - strlen(OPT(info->elmt_suf2, " ")) + - strlen(OPT(info->line_suf, ""))) <= ncols) { + else if ((ctx->prev_prefix_len + h5tools_count_ncols(s) + + HDstrlen(OPT(info->elmt_suf2, " ")) + + HDstrlen(OPT(info->line_suf, ""))) <= ncols) { /* * ...but *could* fit on one line otherwise, then we * should end the current line and start this element on its @@ -1145,9 +818,9 @@ h5tools_render_element(FILE *stream, const h5tool_format_t *info, if (info->line_multi_new == 1 && ctx->prev_multiline && (ctx->cur_column + - h5tools_ncols(s) + - strlen(OPT(info->elmt_suf2, " ")) + - strlen(OPT(info->line_suf, ""))) > ncols) + h5tools_count_ncols(s) + + HDstrlen(OPT(info->elmt_suf2, " ")) + + HDstrlen(OPT(info->line_suf, ""))) > ncols) ctx->need_prefix = TRUE; /* @@ -1164,7 +837,7 @@ h5tools_render_element(FILE *stream, const h5tool_format_t *info, */ multiline = 0; for (secnum = 0, multiline = 0; - (section = strtok(secnum ? NULL : s, OPTIONAL_LINE_BREAK)); + (section = HDstrtok(secnum ? NULL : s, OPTIONAL_LINE_BREAK)); secnum++) { /* * If the current section plus possible suffix and end-of-line @@ -1175,9 +848,9 @@ h5tools_render_element(FILE *stream, const h5tool_format_t *info, /* * check for displaying prefix for each section */ - if ( (ctx->cur_column + strlen(section) + - strlen(OPT(info->elmt_suf2, " ")) + - strlen(OPT(info->line_suf, ""))) > ncols) + if ( (ctx->cur_column + HDstrlen(section) + + HDstrlen(OPT(info->elmt_suf2, " ")) + + HDstrlen(OPT(info->line_suf, ""))) > ncols) ctx->need_prefix = 1; /* @@ -1197,13 +870,13 @@ h5tools_render_element(FILE *stream, const h5tool_format_t *info, h5tools_simple_prefix(stream, info, ctx, *curr_pos, secnum); } else if ((local_elmt_counter || ctx->continuation) && secnum == 0) { - fputs(OPT(info->elmt_suf2, " "), stream); - ctx->cur_column += strlen(OPT(info->elmt_suf2, " ")); + HDfputs(OPT(info->elmt_suf2, " "), stream); + ctx->cur_column += HDstrlen(OPT(info->elmt_suf2, " ")); } /* Print the section */ - fputs(section, stream); - ctx->cur_column += strlen(section); + HDfputs(section, stream); + ctx->cur_column += HDstrlen(section); } ctx->prev_multiline = multiline; @@ -1254,9 +927,9 @@ h5tools_render_region_element(FILE *stream, const h5tool_format_t *info, * current location... */ if (info->line_multi_new == 1 && - (ctx->cur_column + h5tools_ncols(s) + - strlen(OPT(info->elmt_suf2, " ")) + - strlen(OPT(info->line_suf, ""))) > ncols) { + (ctx->cur_column + h5tools_count_ncols(s) + + HDstrlen(OPT(info->elmt_suf2, " ")) + + HDstrlen(OPT(info->line_suf, ""))) > ncols) { if (ctx->prev_multiline) { /* * ... and the previous element also occupied more than one @@ -1264,9 +937,9 @@ h5tools_render_region_element(FILE *stream, const h5tool_format_t *info, */ ctx->need_prefix = TRUE; } - else if ((ctx->prev_prefix_len + h5tools_ncols(s) + - strlen(OPT(info->elmt_suf2, " ")) + - strlen(OPT(info->line_suf, ""))) <= ncols) { + else if ((ctx->prev_prefix_len + h5tools_count_ncols(s) + + HDstrlen(OPT(info->elmt_suf2, " ")) + + HDstrlen(OPT(info->line_suf, ""))) <= ncols) { /* * ...but *could* fit on one line otherwise, then we * should end the current line and start this element on its @@ -1299,9 +972,9 @@ h5tools_render_region_element(FILE *stream, const h5tool_format_t *info, if (info->line_multi_new == 1 && ctx->prev_multiline && (ctx->cur_column + - h5tools_ncols(s) + - strlen(OPT(info->elmt_suf2, " ")) + - strlen(OPT(info->line_suf, ""))) > ncols) + h5tools_count_ncols(s) + + HDstrlen(OPT(info->elmt_suf2, " ")) + + HDstrlen(OPT(info->line_suf, ""))) > ncols) ctx->need_prefix = TRUE; /* @@ -1317,7 +990,7 @@ h5tools_render_region_element(FILE *stream, const h5tool_format_t *info, * one-at a time. */ multiline = 0; - for (secnum = 0, multiline = 0; (section = strtok(secnum ? NULL : s, + for (secnum = 0, multiline = 0; (section = HDstrtok(secnum ? NULL : s, OPTIONAL_LINE_BREAK)); secnum++) { /* * If the current section plus possible suffix and end-of-line @@ -1331,9 +1004,9 @@ h5tools_render_region_element(FILE *stream, const h5tool_format_t *info, */ if ((!info->skip_first || local_elmt_counter) && (ctx->cur_column + - strlen(section) + - strlen(OPT(info->elmt_suf2, " ")) + - strlen(OPT(info->line_suf, ""))) > ncols) + HDstrlen(section) + + HDstrlen(OPT(info->elmt_suf2, " ")) + + HDstrlen(OPT(info->line_suf, ""))) > ncols) ctx->need_prefix = 1; /* @@ -1353,13 +1026,13 @@ h5tools_render_region_element(FILE *stream, const h5tool_format_t *info, h5tools_region_simple_prefix(stream, info, ctx, local_elmt_counter, ptdata, secnum); } else if ((local_elmt_counter || ctx->continuation) && secnum == 0) { - fputs(OPT(info->elmt_suf2, " "), stream); - ctx->cur_column += strlen(OPT(info->elmt_suf2, " ")); + HDfputs(OPT(info->elmt_suf2, " "), stream); + ctx->cur_column += HDstrlen(OPT(info->elmt_suf2, " ")); } /* Print the section */ - fputs(section, stream); - ctx->cur_column += strlen(section); + HDfputs(section, stream); + ctx->cur_column += HDstrlen(section); } ctx->prev_multiline = multiline; @@ -1367,2287 +1040,69 @@ h5tools_render_region_element(FILE *stream, const h5tool_format_t *info, } /*------------------------------------------------------------------------- - * Audience: Public - * Chapter: H5Tools Library - * Purpose: Print the data values from a dataset referenced by region blocks. - * - * Description: - * This is a special case subfunction to print the data in a region reference of type blocks. + * Function: init_acc_pos * - * Return: - * The function returns FAIL if there was an error, otherwise SUCEED + * Purpose: initialize accumulator and matrix position * - * Parameters Description: - * h5tools_str_t *buffer is the string into which to render - * size_t ncols - * int ndims is the number of dimensions of the region element - * hssize_t nblocks is the number of blocks in the region + * Return: void *------------------------------------------------------------------------- */ -static int -h5tools_print_region_data_blocks(hid_t region_id, - FILE *stream, const h5tool_format_t *info, h5tools_context_t ctx, - h5tools_str_t *buffer/*string into which to render */, size_t ncols, - int ndims, hid_t type_id, hssize_t nblocks, hsize_t *ptdata) +void +init_acc_pos(h5tools_context_t *ctx, hsize_t *dims) { - hbool_t dimension_break = TRUE; - hsize_t *dims1 = NULL; - hsize_t *start = NULL; - hsize_t *count = NULL; - size_t numelem; - hsize_t total_size[H5S_MAX_RANK]; - hsize_t elmtno; /* elemnt index */ - unsigned int region_flags; /* buffer extent flags */ - hsize_t curr_pos; - int jndx; - size_t indx; - int type_size; - hid_t mem_space = -1; - void *region_buf = NULL; - int blkndx; - hid_t sid1 = -1; - int ret_value = SUCCEED; - - /* Get the dataspace of the dataset */ - if((sid1 = H5Dget_space(region_id)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_space failed"); + int i; - /* Allocate space for the dimension array */ - if((dims1 = (hsize_t *) HDmalloc(sizeof(hsize_t) * ndims)) == NULL) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Could not allocate buffer for dims"); + HDassert(ctx->ndims); - /* find the dimensions of each data space from the block coordinates */ - numelem = 1; - for (jndx = 0; jndx < ndims; jndx++) { - dims1[jndx] = ptdata[jndx + ndims] - ptdata[jndx] + 1; - numelem = dims1[jndx] * numelem; + ctx->acc[ctx->ndims - 1] = 1; + for (i = (ctx->ndims - 2); i >= 0; i--) { + ctx->acc[i] = ctx->acc[i + 1] * dims[i + 1]; } - - /* Create dataspace for reading buffer */ - if((mem_space = H5Screate_simple(ndims, dims1, NULL)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Screate_simple failed"); - - if((type_size = H5Tget_size(type_id)) == 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_size failed"); - - if((region_buf = HDmalloc(type_size * numelem)) == NULL) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Could not allocate region buffer"); - - /* Select (x , x , ..., x ) x (y , y , ..., y ) hyperslab for reading memory dataset */ - /* 1 2 n 1 2 n */ - if((start = (hsize_t *) HDmalloc(sizeof(hsize_t) * ndims)) == NULL) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Could not allocate buffer for start"); - - if((count = (hsize_t *) HDmalloc(sizeof(hsize_t) * ndims)) == NULL) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Could not allocate buffer for count"); - - curr_pos = 0; - for (blkndx = 0; blkndx < nblocks; blkndx++) { - ctx.ndims = ndims; - ctx.need_prefix = TRUE; - ctx.cur_elmt = 0; - for (jndx = 0; jndx < ndims; jndx++) { - start[jndx] = ptdata[jndx + blkndx * ndims * 2]; - count[jndx] = dims1[jndx]; - } - - if(H5Sselect_hyperslab(sid1, H5S_SELECT_SET, start, NULL, count, NULL) < 0) - HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Sselect_hyperslab failed"); - - if(H5Dread(region_id, type_id, mem_space, sid1, H5P_DEFAULT, region_buf) < 0) - HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Dread failed"); - - ctx.indent_level++; - if(H5Sget_simple_extent_dims(mem_space, total_size, NULL) < 0) - HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Sget_simple_extent_dims failed"); - - /* assume entire data space to be printed */ - for (indx = 0; indx < (size_t) ctx.ndims; indx++) - ctx.p_min_idx[indx] = start[indx]; - init_acc_pos(&ctx, total_size); - - /* print the data */ - region_flags = START_OF_DATA; - if (blkndx == nblocks - 1) - region_flags |= END_OF_DATA; - - for (indx = 0; indx < (size_t)ctx.ndims; indx++) - ctx.p_max_idx[indx] = dims1[indx]; - - curr_pos = 0; - ctx.sm_pos = blkndx*2*ndims; - ctx.size_last_dim = dims1[ndims-1]; - - h5tools_region_simple_prefix(stream, info, &ctx, curr_pos, ptdata, 0); - - elmtno = 0; - for (indx = 0; indx < numelem; indx++, elmtno++, ctx.cur_elmt++) { - /* Render the region data element begin */ - h5tools_str_reset(buffer); - - h5tools_str_append(buffer, "%s", indx ? OPTIONAL_LINE_BREAK "" : ""); - h5tools_str_sprint(buffer, info, region_id, type_id, - ((char*)region_buf + indx * type_size), &ctx); - - if (indx + 1 < numelem || (region_flags & END_OF_DATA) == 0) - h5tools_str_append(buffer, "%s", OPT(info->elmt_suf1, ",")); - - dimension_break = h5tools_render_region_element(stream, info, &ctx, buffer, &curr_pos, - ncols, ptdata, indx, elmtno); - /* Render the region data element end */ - - if(FALSE == dimension_break) - elmtno = 0; - } /* end for (indx = 0; indx < numelem; indx++, region_elmtno++, ctx.cur_elmt++) */ - - ctx.indent_level--; - } /* end for (blkndx = 0; blkndx < nblocks; blkndx++) */ - - done: - HDfree(start); - HDfree(count); - HDfree(region_buf); - HDfree(dims1); - - if(H5Sclose(mem_space) < 0) - HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Sclose failed"); - if(H5Sclose(sid1) < 0) - HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Sclose failed"); - - return ret_value; + for (i = 0; i < ctx->ndims; i++) + ctx->pos[i] = 0; } /*------------------------------------------------------------------------- - * Audience: Public - * Chapter: H5Tools Library - * Purpose: Print some values from a dataset referenced by region blocks. - * - * Description: - * This is a special case subfunction to dump a region reference using blocks. - * - * Return: - * The function returns False if the last dimension has been reached, otherwise True + * Function: do_bin_output * - * In/Out: - * h5tools_context_t *ctx - * hsize_t *curr_pos + * Purpose: Dump memory buffer to a binary file stream * - * Parameters Description: - * h5tools_str_t *buffer is the string into which to render - * hsize_t curr_pos is the total data element position - * size_t ncols - * hsize_t region_elmt_counter is the region element loop counter - * hsize_t elmt_count is the data element loop counter + * Return: Success: SUCCEED + * Failure: FAIL *------------------------------------------------------------------------- */ -hbool_t -h5tools_dump_region_data_blocks(hid_t region_space, hid_t region_id, - FILE *stream, const h5tool_format_t *info, - h5tools_context_t *ctx/*in,out*/, - h5tools_str_t *buffer/*string into which to render */, - hsize_t *curr_pos/*total data element position*/, - size_t ncols, hsize_t region_elmt_counter/*element counter*/, - hsize_t elmt_counter) +int +do_bin_output(FILE *stream, FILE *err_stream, hid_t container, hsize_t nelmts, hid_t tid, void *_mem) { - HERR_INIT(hbool_t, TRUE) - hbool_t dimension_break = TRUE; - hssize_t nblocks; - hsize_t alloc_size; - hsize_t *ptdata = NULL; - int ndims; - hid_t dtype; - hid_t type_id; - int i; - - if((nblocks = H5Sget_select_hyper_nblocks(region_space)) <= 0) - H5E_THROW(dimension_break, H5E_tools_min_id_g, "H5Sget_select_hyper_nblocks failed"); - - /* Print block information */ - if((ndims = H5Sget_simple_extent_ndims(region_space)) < 0) - H5E_THROW(dimension_break, H5E_tools_min_id_g, "H5Sget_simple_extent_ndims failed"); - - /* Render the region { element begin */ - h5tools_str_reset(buffer); - - h5tools_str_append(buffer, "{"); - dimension_break = h5tools_render_element(stream, info, ctx, buffer, curr_pos, ncols, region_elmt_counter, elmt_counter); - /* Render the region { element end */ - - /* Render the region datatype info and indices element begin */ - h5tools_str_reset(buffer); - - ctx->indent_level++; - ctx->need_prefix = TRUE; - h5tools_str_append(buffer, "REGION_TYPE BLOCK "); - - alloc_size = nblocks * ndims * 2 * sizeof(ptdata[0]); - assert(alloc_size == (hsize_t) ((size_t) alloc_size)); /*check for overflow*/ - if((ptdata = (hsize_t*) malloc((size_t) alloc_size)) == NULL) - HGOTO_ERROR(dimension_break, H5E_tools_min_id_g, "Could not allocate buffer for ptdata"); - - H5_CHECK_OVERFLOW(nblocks, hssize_t, hsize_t); - if(H5Sget_select_hyper_blocklist(region_space, (hsize_t) 0, (hsize_t) nblocks, ptdata) < 0) - HGOTO_ERROR(dimension_break, H5E_tools_min_id_g, "H5Rget_select_hyper_blocklist failed"); - - for (i = 0; i < nblocks; i++) { - int j; - - h5tools_str_append(buffer, info->dset_blockformat_pre, - i ? "," OPTIONAL_LINE_BREAK " " : "", (unsigned long) i); - - /* Start coordinates and opposite corner */ - for (j = 0; j < ndims; j++) - h5tools_str_append(buffer, "%s%lu", j ? "," : "(", - (unsigned long) ptdata[i * 2 * ndims + j]); - - for (j = 0; j < ndims; j++) - h5tools_str_append(buffer, "%s%lu", j ? "," : ")-(", - (unsigned long) ptdata[i * 2 * ndims + j + ndims]); - - h5tools_str_append(buffer, ")"); - } /* end for (i = 0; i < nblocks; i++) */ - - dimension_break = h5tools_render_element(stream, info, ctx, buffer, curr_pos, ncols, region_elmt_counter, elmt_counter); - /* Render the region datatype info and indices element end */ - - ctx->need_prefix = TRUE; - - if((dtype = H5Dget_type(region_id)) < 0) - HGOTO_ERROR(dimension_break, H5E_tools_min_id_g, "H5Dget_type failed"); - if((type_id = H5Tget_native_type(dtype, H5T_DIR_DEFAULT)) < 0) - HGOTO_ERROR(dimension_break, H5E_tools_min_id_g, "H5Tget_native_type failed"); - - /* Render the datatype element begin */ - h5tools_str_reset(buffer); - h5tools_str_append(buffer, "%s %s ", - h5tools_dump_header_format->datatypebegin, - h5tools_dump_header_format->datatypeblockbegin); - - h5tools_print_datatype(buffer, info, ctx, dtype); - - if (HDstrlen(h5tools_dump_header_format->datatypeblockend)) { - h5tools_str_append(buffer, "%s", h5tools_dump_header_format->datatypeblockend); - if (HDstrlen(h5tools_dump_header_format->datatypeend)) - h5tools_str_append(buffer, " "); - } - if (HDstrlen(h5tools_dump_header_format->datatypeend)) - h5tools_str_append(buffer, "%s", h5tools_dump_header_format->datatypeend); - - dimension_break = h5tools_render_element(stream, info, ctx, buffer, curr_pos, ncols, region_elmt_counter, elmt_counter); - /* Render the datatype element end */ - - ctx->need_prefix = TRUE; - - /* Render the dataspace element begin */ - h5tools_str_reset(buffer); - - ctx->need_prefix = TRUE; - h5tools_str_append(buffer, "%s ", h5tools_dump_header_format->dataspacebegin); + HERR_INIT(int, SUCCEED) + unsigned char *mem = (unsigned char*)_mem; + size_t size; /* datum size */ + hsize_t i; /* element counter */ - h5tools_print_dataspace(buffer, region_space); + if((size = H5Tget_size(tid)) == 0) + H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_size failed"); - if (HDstrlen(h5tools_dump_header_format->dataspaceblockend)) { - h5tools_str_append(buffer, "%s", h5tools_dump_header_format->dataspaceblockend); - if (HDstrlen(h5tools_dump_header_format->dataspaceend)) - h5tools_str_append(buffer, " "); + for (i = 0; i < nelmts; i++) { + if (render_bin_output(stream, container, tid, mem + i * size) < 0) { + HDfprintf(err_stream,"\nError in writing binary stream\n"); + return FAIL; + } } - if (HDstrlen(h5tools_dump_header_format->dataspaceend)) - h5tools_str_append(buffer, "%s", h5tools_dump_header_format->dataspaceblockend); - dimension_break = h5tools_render_element(stream, info, ctx, buffer, curr_pos, ncols, region_elmt_counter, elmt_counter); - /* Render the dataspace element end */ - - ctx->need_prefix = TRUE; - - /* Render the databegin element begin */ - h5tools_str_reset(buffer); - - h5tools_str_append(buffer, "%s %s ", - h5tools_dump_header_format->databegin, - h5tools_dump_header_format->datablockbegin); - - dimension_break = h5tools_render_element(stream, info, ctx, buffer, curr_pos, ncols, region_elmt_counter, elmt_counter); - /* Render the databegin element end */ - - ctx->need_prefix = TRUE; - - h5tools_print_region_data_blocks(region_id, rawdatastream, info, *ctx, - buffer, ncols, ndims, type_id, nblocks, ptdata); - - done: - free(ptdata); - - if(H5Tclose(type_id) < 0) - HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tclose failed"); - - if(H5Tclose(dtype) < 0) - HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tclose failed"); - - ctx->need_prefix = TRUE; - - /* Render the dataend element begin */ - h5tools_str_reset(buffer); - h5tools_str_append(buffer, "%s %s ", - h5tools_dump_header_format->dataend, - h5tools_dump_header_format->datablockend); - dimension_break = h5tools_render_element(stream, info, ctx, buffer, curr_pos, - ncols, region_elmt_counter, elmt_counter); - /* Render the dataend element end */ - - ctx->indent_level--; - ctx->need_prefix = TRUE; - - /* Render the region } element begin */ - h5tools_str_reset(buffer); - h5tools_str_append(buffer, "}"); - dimension_break = h5tools_render_element(stream, info, ctx, buffer, curr_pos, - ncols, region_elmt_counter, elmt_counter); - /* Render the region } element end */ - - H5_LEAVE(dimension_break) - - CATCH +CATCH return ret_value; } /*------------------------------------------------------------------------- - * Audience: Public - * Chapter: H5Tools Library - * Purpose: Print the data values from a dataset referenced by region points. - * - * Description: - * This is a special case subfunction to print the data in a region reference of type points. + * Function: render_bin_output * - * Return: - * The function returns FAIL on error, otherwise SUCCEED - * - * Parameters Description: - * h5tools_str_t *buffer is the string into which to render - * size_t ncols - * int ndims is the number of dimensions of the region element - * hssize_t npoints is the number of points in the region - *------------------------------------------------------------------------- - */ -int -h5tools_print_region_data_points(hid_t region_space, hid_t region_id, - FILE *stream, const h5tool_format_t *info, h5tools_context_t ctx, - h5tools_str_t *buffer, size_t ncols, - int ndims, hid_t type_id, hssize_t npoints, hsize_t *ptdata) -{ - hbool_t dimension_break = TRUE; - hsize_t *dims1 = NULL; - hsize_t elmtno; /* elemnt index */ - unsigned int region_flags; /* buffer extent flags */ - hsize_t curr_pos; - size_t indx; - int jndx; - int type_size; - hid_t mem_space = -1; - void *region_buf = NULL; - int ret_value = SUCCEED; - - if((type_size = H5Tget_size(type_id)) == 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_size failed"); - - if((region_buf = HDmalloc(type_size * npoints)) == NULL) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Could not allocate buffer for region"); - - /* Allocate space for the dimension array */ - if((dims1 = (hsize_t *) HDmalloc(sizeof(hsize_t) * ndims)) == NULL) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Could not allocate buffer for dims"); - - dims1[0] = npoints; - if((mem_space = H5Screate_simple(1, dims1, NULL)) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Screate_simple failed"); - - if(H5Dread(region_id, type_id, mem_space, region_space, H5P_DEFAULT, region_buf) < 0) - HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dread failed"); - - elmtno = 0; - curr_pos = 0; - for (jndx = 0; jndx < npoints; jndx++, elmtno++) { - ctx.ndims = ndims; - ctx.need_prefix = TRUE; - ctx.cur_elmt = 0; /* points are always 0 */ - - /* Render the point element begin */ - h5tools_str_reset(buffer); - - ctx.indent_level++; - - /* assume entire data space to be printed */ - for (indx = 0; indx < (size_t) ctx.ndims; indx++) - ctx.p_min_idx[indx] = 0; - if(H5Sget_simple_extent_dims(region_space, ctx.p_max_idx, NULL) < 0) - HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Sget_simple_extent_dims failed"); - - if (ctx.ndims > 0) { - ctx.size_last_dim = (int) (ctx.p_max_idx[ctx.ndims - 1]); - } - else - ctx.size_last_dim = 0; - - if (ctx.ndims > 0) - init_acc_pos(&ctx, ctx.p_max_idx); - - /* print the data */ - region_flags = START_OF_DATA; - if (jndx == npoints - 1) - region_flags |= END_OF_DATA; - - curr_pos = 0; /* points requires constant 0 */ - ctx.sm_pos = jndx * ndims; - - h5tools_region_simple_prefix(stream, info, &ctx, curr_pos, ptdata, 0); - - h5tools_str_sprint(buffer, info, region_id, type_id, - ((char*)region_buf + jndx * type_size), &ctx); - - if (jndx + 1 < npoints || (region_flags & END_OF_DATA) == 0) - h5tools_str_append(buffer, "%s", OPT(info->elmt_suf1, ",")); - - dimension_break = - h5tools_render_region_element(stream, info, &ctx, buffer, &curr_pos, - ncols, ptdata, (hsize_t)0, elmtno); - /* Render the point element end */ - - ctx.indent_level--; - if(FALSE == dimension_break) - elmtno = 0; - } /* end for (jndx = 0; jndx < npoints; jndx++, region_elmtno++) */ - - done: - HDfree(region_buf); - HDfree(dims1); - - if(H5Sclose(mem_space) < 0) - HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Sclose failed"); - - return ret_value; -} - -/*------------------------------------------------------------------------- - * Audience: Public - * Chapter: H5Tools Library - * Purpose: Print some values from a dataset referenced by region points. - * - * Description: - * This is a special case subfunction to dump a region reference using points. - * - * Return: - * The function returns False if the last dimension has been reached, otherwise True - * - * In/Out: - * h5tools_context_t *ctx - * hsize_t *curr_pos - * - * Parameters Description: - * h5tools_str_t *buffer is the string into which to render - * hsize_t curr_pos is the total data element position - * size_t ncols - * hsize_t region_elmt_counter is the region element loop counter - * hsize_t elmt_count is the data element loop counter - *------------------------------------------------------------------------- - */ -hbool_t -h5tools_dump_region_data_points(hid_t region_space, hid_t region_id, - FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx, - h5tools_str_t *buffer, hsize_t *curr_pos, size_t ncols, hsize_t region_elmt_counter, - hsize_t elmt_counter) { - HERR_INIT(hbool_t, TRUE) - hbool_t dimension_break = TRUE; - hssize_t npoints; - hsize_t alloc_size; - hsize_t *ptdata; - int ndims; - hssize_t indx; - hid_t dtype; - hid_t type_id; - - if((npoints = H5Sget_select_elem_npoints(region_space)) <= 0) - H5E_THROW(dimension_break, H5E_tools_min_id_g, "H5Sget_select_elem_npoints failed"); - - /* Allocate space for the dimension array */ - if((ndims = H5Sget_simple_extent_ndims(region_space)) < 0) - H5E_THROW(dimension_break, H5E_tools_min_id_g, "H5Sget_simple_extent_ndims failed"); - - /* Render the region { element begin */ - h5tools_str_reset(buffer); - - h5tools_str_append(buffer, "{"); - dimension_break = h5tools_render_element(stream, info, ctx, buffer, curr_pos, ncols, region_elmt_counter, elmt_counter); - /* Render the region { element end */ - - /* Render the region datatype info and indices element begin */ - h5tools_str_reset(buffer); - - ctx->indent_level++; - ctx->need_prefix = TRUE; - h5tools_str_append(buffer, "REGION_TYPE POINT "); - - alloc_size = npoints * ndims * sizeof(ptdata[0]); - assert(alloc_size == (hsize_t) ((size_t) alloc_size)); /*check for overflow*/ - if(NULL == (ptdata = (hsize_t *)HDmalloc((size_t) alloc_size))) - HGOTO_ERROR(dimension_break, H5E_tools_min_id_g, "Could not allocate buffer for ptdata"); - - H5_CHECK_OVERFLOW(npoints, hssize_t, hsize_t); - if(H5Sget_select_elem_pointlist(region_space, (hsize_t) 0, (hsize_t) npoints, ptdata) < 0) - HGOTO_ERROR(dimension_break, H5E_tools_min_id_g, "H5Sget_select_elem_pointlist failed"); - - for (indx = 0; indx < npoints; indx++) { - int loop_indx; - - h5tools_str_append(buffer, info->dset_ptformat_pre, - indx ? "," OPTIONAL_LINE_BREAK " " : "", (unsigned long) indx); - - for (loop_indx = 0; loop_indx < ndims; loop_indx++) - h5tools_str_append(buffer, "%s%lu", loop_indx ? "," : "(", - (unsigned long) (ptdata[indx * ndims + loop_indx])); - - h5tools_str_append(buffer, ")"); - } /* end for (indx = 0; indx < npoints; indx++) */ - - dimension_break = h5tools_render_element(stream, info, ctx, buffer, curr_pos, ncols, region_elmt_counter, elmt_counter); - /* Render the region datatype info and indices element end */ - - ctx->need_prefix = TRUE; - - if((dtype = H5Dget_type(region_id)) < 0) - HGOTO_ERROR(dimension_break, H5E_tools_min_id_g, "H5Dget_type failed"); - - if((type_id = H5Tget_native_type(dtype, H5T_DIR_DEFAULT)) < 0) - HGOTO_ERROR(dimension_break, H5E_tools_min_id_g, "H5Tget_native_type failed"); - - /* Render the datatype element begin */ - h5tools_str_reset(buffer); - h5tools_str_append(buffer, "%s %s ", - h5tools_dump_header_format->datatypebegin, - h5tools_dump_header_format->datatypeblockbegin); - - h5tools_print_datatype(buffer, info, ctx, dtype); - - if (HDstrlen(h5tools_dump_header_format->datatypeblockend)) { - h5tools_str_append(buffer, "%s", h5tools_dump_header_format->datatypeblockend); - if (HDstrlen(h5tools_dump_header_format->datatypeend)) - h5tools_str_append(buffer, " "); - } - if (HDstrlen(h5tools_dump_header_format->datatypeend)) - h5tools_str_append(buffer, "%s", h5tools_dump_header_format->datatypeend); - - dimension_break = h5tools_render_element(stream, info, ctx, buffer, curr_pos, ncols, region_elmt_counter, elmt_counter); - /* Render the datatype element end */ - - ctx->need_prefix = TRUE; - - /* Render the dataspace element begin */ - h5tools_str_reset(buffer); - - ctx->need_prefix = TRUE; - h5tools_str_append(buffer, "%s ", h5tools_dump_header_format->dataspacebegin); - - h5tools_print_dataspace(buffer, region_space); - - if (HDstrlen(h5tools_dump_header_format->dataspaceblockend)) { - h5tools_str_append(buffer, "%s", h5tools_dump_header_format->dataspaceblockend); - if (HDstrlen(h5tools_dump_header_format->dataspaceend)) - h5tools_str_append(buffer, " "); - } - if (HDstrlen(h5tools_dump_header_format->dataspaceend)) - h5tools_str_append(buffer, "%s", h5tools_dump_header_format->dataspaceblockend); - - dimension_break = h5tools_render_element(stream, info, ctx, buffer, curr_pos, ncols, region_elmt_counter, elmt_counter); - /* Render the dataspace element end */ - - ctx->need_prefix = TRUE; - - /* Render the databegin element begin */ - h5tools_str_reset(buffer); - - h5tools_str_append(buffer, "%s %s ", - h5tools_dump_header_format->databegin, - h5tools_dump_header_format->datablockbegin); - - dimension_break = h5tools_render_element(stream, info, ctx, buffer, curr_pos, ncols, region_elmt_counter, elmt_counter); - /* Render the databegin element end */ - - ctx->need_prefix = TRUE; - - h5tools_print_region_data_points(region_space, region_id, - rawdatastream, info, *ctx, buffer, ncols, ndims, type_id, npoints, ptdata); - - done: - free(ptdata); - - if(H5Tclose(type_id) < 0) - HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tclose failed"); - - if(H5Tclose(dtype) < 0) - HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tclose failed"); - - ctx->need_prefix = TRUE; - - /* Render the dataend element begin */ - h5tools_str_reset(buffer); - h5tools_str_append(buffer, "%s %s ", - h5tools_dump_header_format->dataend, - h5tools_dump_header_format->datablockend); - dimension_break = h5tools_render_element(stream, info, ctx, buffer, curr_pos, - ncols, region_elmt_counter, elmt_counter); - /* Render the dataend element end*/ - - ctx->indent_level--; - ctx->need_prefix = TRUE; - - /* Render the region } element begin */ - h5tools_str_reset(buffer); - h5tools_str_append(buffer, "}"); - dimension_break = h5tools_render_element(stream, info, ctx, buffer, curr_pos, - ncols, region_elmt_counter, elmt_counter); - /* Render the region } element end */ - - H5_LEAVE(dimension_break) -CATCH - return ret_value; -} - -/*------------------------------------------------------------------------- - * Audience: Public - * Chapter: H5Tools Library - * Purpose: print out the data for a subset of a dataset. - * Description: - * - * Select a hyperslab from the dataset DSET using the parameters - * specified in SSET. Dump this out to STREAM. - * - * Hyperslabs select "count" blocks of size "block", spaced "stride" elements - * from each other, starting at coordinate "start". - * - * Return: - * On success, return SUCCEED. Otherwise, the function returns FAIL. - * - * Algorithm - * - * The parameters from SSET are translated into temporary - * variables so that 1 row is printed at a time (getting the coordinate indices - * at each row). - * We define the stride, count and block to be 1 in the row dimension to achieve - * this and advance until all points are printed. - * - * The element position is obtained from the matrix according to: - * Given an index I(z,y,x) its position from the beginning of an array - * of sizes A(size_z, size_y,size_x) is given by - * Position of I(z,y,x) = index_z * size_y * size_x - * + index_y * size_x - * + index_x - * - *------------------------------------------------------------------------- - */ -static herr_t -h5tools_print_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx, - hid_t dset, hid_t p_type, struct subset_t *sset, - hid_t f_space, hsize_t hyperslab_count, - hsize_t *temp_start,/* start inside offset count loop */ - hsize_t *temp_count,/* count inside offset count loop */ - hsize_t *temp_block,/* block size used in loop */ - hsize_t *temp_stride,/* stride size used in loop */ - hsize_t *total_size,/* total size of dataset */ - unsigned int row_dim/* index of row_counter dimension */) -{ - HERR_INIT(herr_t, SUCCEED) - size_t i; /* counters */ - size_t j; /* counters */ - hsize_t zero[1] = {0}; /* vector of zeros */ - unsigned int flags; /* buffer extent flags */ - hsize_t elmtno; /* elemnt index */ - hsize_t low[H5S_MAX_RANK]; /* low bound of hyperslab */ - hsize_t high[H5S_MAX_RANK]; /* higher bound of hyperslab */ - size_t p_type_nbytes; /* size of memory type */ - hsize_t sm_size[H5S_MAX_RANK]; /* stripmine size */ - hsize_t sm_nbytes; /* bytes per stripmine */ - hssize_t ssm_nelmts; /* elements per stripmine*/ - hsize_t sm_nelmts; /* elements per stripmine*/ - unsigned char *sm_buf = NULL; /* buffer for raw data */ - hid_t sm_space = -1; /* stripmine data space */ - hsize_t size_row_block; /* size for blocks along rows */ - hsize_t row_counter = 0; - - /* VL data special information */ - unsigned int vl_data = 0; /* contains VL datatypes */ - - if ((size_t) ctx->ndims > NELMTS(sm_size)) - H5E_THROW(FAIL, H5E_tools_min_id_g, "ndims and sm_size comparision failed"); - - if (ctx->ndims > 0) - init_acc_pos(ctx, total_size); - - size_row_block = sset->block.data[row_dim]; - - /* Check if we have VL data in the dataset's datatype */ - if (h5tools_detect_vlen_str(p_type) == TRUE) - vl_data = TRUE; - if (H5Tdetect_class(p_type, H5T_VLEN) == TRUE) - vl_data = TRUE; - - /* display loop */ - for (; hyperslab_count > 0; temp_start[row_dim] += temp_stride[row_dim], hyperslab_count--) { - /* jump rows if size of block exceeded - cases where block > 1 only and stride > block */ - if (size_row_block > 1 - && row_counter == size_row_block - && sset->stride.data[row_dim] > sset->block.data[row_dim]) { - - hsize_t increase_rows = sset->stride.data[row_dim] - sset->block.data[row_dim]; - temp_start[row_dim] += increase_rows; - row_counter = 0; - } - - row_counter++; - - /* calculate the potential number of elements we're going to print */ - if(H5Sselect_hyperslab(f_space, H5S_SELECT_SET, temp_start, temp_stride, temp_count, temp_block) < 0) - H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Sselect_hyperslab failed"); - - if((ssm_nelmts = H5Sget_select_npoints(f_space)) < 0) - H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Sget_select_npoints failed"); - sm_nelmts = (hsize_t)ssm_nelmts; - - if (sm_nelmts > 0) { - /* - * determine the strip mine size and allocate a buffer. the strip mine is - * a hyperslab whose size is manageable. - */ - if((sm_nbytes = p_type_nbytes = H5Tget_size(p_type)) == 0) - H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_size failed"); - - if (ctx->ndims > 0) - for (i = ctx->ndims; i > 0; --i) { - hsize_t size = H5TOOLS_BUFSIZE / sm_nbytes; - if (size == 0) /* datum size > H5TOOLS_BUFSIZE */ - size = 1; - sm_size[i - 1] = MIN(total_size[i - 1], size); - sm_nbytes *= sm_size[i - 1]; - assert(sm_nbytes > 0); - } - - assert(sm_nbytes == (hsize_t) ((size_t) sm_nbytes)); /*check for overflow*/ - if(NULL == (sm_buf = (unsigned char *)HDmalloc((size_t) sm_nelmts * p_type_nbytes))) - H5E_THROW(FAIL, H5E_tools_min_id_g, "Could not allocate buffer for strip-mine"); - - if((sm_space = H5Screate_simple(1, &sm_nelmts, NULL)) < 0) - H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Screate_simple failed"); - - if(H5Sselect_hyperslab(sm_space, H5S_SELECT_SET, zero, NULL, &sm_nelmts, NULL) < 0) - H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Sselect_hyperslab failed"); - - /* read the data */ - if(H5Dread(dset, p_type, sm_space, f_space, H5P_DEFAULT, sm_buf) < 0) - H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Dread failed"); - - /* print the data */ - flags = START_OF_DATA; - - if (hyperslab_count == 1) - flags |= END_OF_DATA; - - for (i = 0; i < ctx->ndims; i++) - ctx->p_max_idx[i] = ctx->p_min_idx[i] + MIN(total_size[i], sm_size[i]); - - /* print array indices. get the lower bound of the hyperslab and calulate - the element position at the start of hyperslab */ - if(H5Sget_select_bounds(f_space, low, high) < 0) - H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Sget_select_bounds failed"); - - elmtno = 0; - for (i = 0; i < (size_t) ctx->ndims - 1; i++) { - hsize_t offset = 1; /* accumulation of the previous dimensions */ - for (j = i + 1; j < (size_t) ctx->ndims; j++) - offset *= total_size[j]; - elmtno += low[i] * offset; - } - elmtno += low[ctx->ndims - 1]; - - /* initialize the current stripmine position; this is necessary to print the array - indices */ - ctx->sm_pos = elmtno; - - h5tools_dump_simple_data(stream, info, dset, ctx, flags, sm_nelmts, p_type, sm_buf); - - /* Reclaim any VL memory, if necessary */ - if (vl_data) - H5Dvlen_reclaim(p_type, sm_space, H5P_DEFAULT, sm_buf); - - if(H5Sclose(sm_space) < 0) - H5E_THROW(H5E_tools_g, H5E_tools_min_id_g, "H5Sclose failed"); - if(sm_buf) - HDfree(sm_buf); - sm_buf = NULL; - } - else - H5E_THROW(SUCCEED, H5E_tools_min_id_g, "nothing to print"); - /* we need to jump to next line and update the index */ - ctx->need_prefix = 1; - - ctx->continuation++; - - } /* hyperslab_count loop */ - -CATCH - if(sm_buf) - HDfree(sm_buf); - - return ret_value; -} - -/*------------------------------------------------------------------------- - * Audience: Public - * Chapter: H5Tools Library - * Purpose: print out the data for a subset of a dataset. - * Description: - * - * Select a hyperslab from the dataset DSET using the parameters - * specified in SSET. Dump this out to STREAM. - * - * Hyperslabs select "count" blocks of size "block", spaced "stride" elements - * from each other, starting at coordinate "start". - * - * Return: - * On success, return SUCCEED. Otherwise, the function returns FAIL. - * - * Algorithm - * - * The parameters from SSET are translated into temporary - * variables so that 1 row is printed at a time (getting the coordinate indices - * at each row). - * We define the stride, count and block to be 1 in the row dimension to achieve - * this and advance until all points are printed. - * - * The element position is obtained from the matrix according to: - * Given an index I(z,y,x) its position from the beginning of an array - * of sizes A(size_z, size_y,size_x) is given by - * Position of I(z,y,x) = index_z * size_y * size_x - * + index_y * size_x - * + index_x - * - *------------------------------------------------------------------------- - */ -static herr_t -h5tools_display_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx, - hid_t dset, hid_t p_type, struct subset_t *sset, - hid_t f_space, hsize_t *total_size) -{ - size_t i; /* counters */ - hsize_t n; /* counters */ - hsize_t count; /* hyperslab count */ - hsize_t outer_count; /* offset count */ - unsigned int row_dim; /* index of row_counter dimension */ - int current_outer_dim; /* dimension for start */ - hsize_t temp_start[H5S_MAX_RANK];/* temporary start inside offset count loop */ - hsize_t max_start[H5S_MAX_RANK]; /* maximum start inside offset count loop */ - hsize_t temp_count[H5S_MAX_RANK];/* temporary count inside offset count loop */ - hsize_t temp_block[H5S_MAX_RANK];/* temporary block size used in loop */ - hsize_t temp_stride[H5S_MAX_RANK];/* temporary stride size used in loop */ - int reset_dim; - herr_t ret_value = SUCCEED; - - if (ctx->ndims == 1) - row_dim = 0; - else - row_dim = ctx->ndims - 2; - - /* get the offset count */ - outer_count = 1; - if (ctx->ndims > 2) - for (i = 0; i < (size_t) ctx->ndims - 2; i++) { - /* consider block size */ - outer_count = outer_count * sset->count.data[i] * sset->block.data[i]; - - } - - /* initialize temporary start, count and maximum start */ - for (i = 0; i < (size_t) ctx->ndims; i++) { - temp_start[i] = sset->start.data[i]; - temp_count[i] = sset->count.data[i]; - temp_block[i] = sset->block.data[i]; - temp_stride[i] = sset->stride.data[i]; - max_start[i] = 0; - } - - if (ctx->ndims > 2) { - for (i = 0; i < (size_t) ctx->ndims - 2; i++) { - max_start[i] = temp_start[i] + sset->count.data[i]; - temp_count[i] = 1; - - } - } - - /* offset loop */ - for (n = 0; n < outer_count; n++) { - /* number of read iterations in inner loop, read by rows, to match 2D display */ - if (ctx->ndims > 1) { - - /* count is the number of iterations to display all the rows, - the block size count times */ - count = sset->count.data[row_dim] * sset->block.data[row_dim]; - - /* always 1 row_counter at a time, that is a block of size 1, 1 time */ - temp_count[row_dim] = 1; - temp_block[row_dim] = 1; - - /* advance 1 row_counter at a time */ - if (sset->block.data[row_dim] > 1) - temp_stride[row_dim] = 1; - - } - /* for the 1D case */ - else { - count = 1; - } - - h5tools_print_simple_subset(stream, info, ctx, dset, p_type, sset, - f_space, count, temp_start, temp_count, - temp_block, temp_stride, total_size, row_dim); - - if (ctx->ndims > 2) { - /* dimension for start */ - current_outer_dim = (ctx->ndims - 2) - 1; - - /* set start to original from current_outer_dim up */ - for (i = current_outer_dim + 1; i < ctx->ndims; i++) { - temp_start[i] = sset->start.data[i]; - } - - /* increment start dimension */ - do { - reset_dim = 0; - temp_start[current_outer_dim]++; - if (temp_start[current_outer_dim] >= max_start[current_outer_dim]) { - temp_start[current_outer_dim] = sset->start.data[current_outer_dim]; - - /* consider block */ - if (sset->block.data[current_outer_dim] > 1) - temp_start[current_outer_dim]++; - - current_outer_dim--; - reset_dim = 1; - } - } while (current_outer_dim >= 0 && reset_dim); - - } /* ctx.ndims > 1 */ - - } /* outer_count */ - - return ret_value; -} - -/*------------------------------------------------------------------------- - * Audience: Public - * Chapter: H5Tools Library - * Purpose: Dump out a subset of a dataset. - * Description: - * - * Select a hyperslab from the dataset DSET using the parameters - * specified in SSET. Dump this out to STREAM. - * - * Hyperslabs select "count" blocks of size "block", spaced "stride" elements - * from each other, starting at coordinate "start". - * - * Return: - * On success, return SUCCEED. Otherwise, the function returns FAIL. - * - * Original programmer: - * Bill Wendling, Wednesday, March 07, 2001 - * - * Rewritten with modified algorithm by: - * Pedro Vicente, Wednesday, January 16, 2008, contributions from Quincey Koziol - * - * Algorithm - * - * In a inner loop, the parameters from SSET are translated into temporary - * variables so that 1 row is printed at a time (getting the coordinate indices - * at each row). - * We define the stride, count and block to be 1 in the row dimension to achieve - * this and advance until all points are printed. - * An outer loop for cases where dimensionality is greater than 2D is made. - * In each iteration, the 2D block is displayed in the inner loop. The remaining - * slower dimensions above the first 2 are incremented one at a time in the outer loop - * - * The element position is obtained from the matrix according to: - * Given an index I(z,y,x) its position from the beginning of an array - * of sizes A(size_z, size_y,size_x) is given by - * Position of I(z,y,x) = index_z * size_y * size_x - * + index_y * size_x - * + index_x - * - * Modifications: - * Vailin Choi; August 2010 - * Modified for h5watch to handle the printing of compound fields. - *------------------------------------------------------------------------- - */ -static herr_t -h5tools_dump_simple_subset(FILE *stream, const h5tool_format_t *info, hid_t dset, - hid_t p_type, struct subset_t *sset, int indentlevel) -{ - HERR_INIT(herr_t, SUCCEED) - int sndims; - hid_t f_space = -1; /* file data space */ - size_t i; /* counters */ - hsize_t total_size[H5S_MAX_RANK];/* total size of dataset*/ - h5tools_context_t ctx; /* print context */ - - if((f_space = H5Dget_space(dset)) < 0) - H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Dget_space failed"); - - /* - * check that everything looks okay. the dimensionality must not be too - * great and the dimensionality of the items selected for printing must - * match the dimensionality of the dataset. - */ - memset(&ctx, 0, sizeof(ctx)); - ctx.indent_level = indentlevel; - ctx.need_prefix = 1; - if((sndims = H5Sget_simple_extent_ndims(f_space)) < 0) - H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_ndims failed"); - ctx.ndims = (unsigned)sndims; - - /* assume entire data space to be printed */ - if (ctx.ndims > 0) - for (i = 0; i < (size_t) ctx.ndims; i++) - ctx.p_min_idx[i] = 0; - - if(H5Sget_simple_extent_dims(f_space, total_size, NULL) < 0) - H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_dims failed"); - ctx.size_last_dim = total_size[ctx.ndims - 1]; - - if(info->cmpd_listv) - ctx.cmpd_listv = info->cmpd_listv; - else - ctx.cmpd_listv = NULL; - - h5tools_display_simple_subset(stream, info, &ctx, dset, p_type, sset, f_space, total_size); - - /* Terminate the output */ - if (ctx.cur_column) { - fputs(OPT(info->line_suf, ""), stdout); - putc('\n', stdout); - fputs(OPT(info->line_sep, ""), stdout); - } - -CATCH - - if(f_space >= 0 && H5Sclose(f_space) < 0) - H5E_THROW(H5E_tools_g, H5E_tools_min_id_g, "H5Sclose failed"); - - return ret_value; -} - -/*------------------------------------------------------------------------- - * Audience: Public - * Chapter: H5Tools Library - * Purpose: Print some values from a dataset with a simple data space. - * Description: - * This is a special case of h5tools_dump_dset(). This function only - * intended for dumping datasets -- it does strip mining and some other - * things which are unnecessary for smaller objects such as attributes - * (to print small objects like attributes simply read the attribute and - * call h5tools_dump_simple_mem()). - * Return: - * On success, the function returns SUCCEED. Otherwise, the function - * returns FAIL. - *------------------------------------------------------------------------- - */ -static int -h5tools_dump_simple_dset(FILE *stream, const h5tool_format_t *info, - hid_t dset, hid_t p_type, int indentlevel) -{ - hid_t f_space; /* file data space */ - hsize_t elmtno; /* counter */ - size_t i; /* counter */ - int carry; /* counter carry value */ - hsize_t zero[8]; /* vector of zeros */ - unsigned int flags; /* buffer extent flags */ - hsize_t total_size[H5S_MAX_RANK]; /* total size of dataset*/ - - /* Print info */ - h5tools_context_t ctx; /* print context */ - size_t p_type_nbytes; /* size of memory type */ - hsize_t p_nelmts; /* total selected elmts */ - - /* 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*/ - unsigned char *sm_buf = NULL; /* buffer for raw data */ - 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 */ - - /* VL data special information */ - unsigned int vl_data = 0; /* contains VL datatypes */ - - f_space = H5Dget_space(dset); - - if (f_space == FAIL) - return FAIL; - - /* - * Check that everything looks okay. The dimensionality must not be too - * great and the dimensionality of the items selected for printing must - * match the dimensionality of the dataset. - */ - memset(&ctx, 0, sizeof(ctx)); - ctx.ndims = H5Sget_simple_extent_ndims(f_space); - - if ((size_t)ctx.ndims > NELMTS(sm_size)) { - H5Sclose(f_space); - return FAIL; - } - - ctx.indent_level = indentlevel; - ctx.need_prefix = 1; - - /* Assume entire data space to be printed */ - if (ctx.ndims > 0) - for (i = 0; i < (size_t)ctx.ndims; i++) - ctx.p_min_idx[i] = 0; - - H5Sget_simple_extent_dims(f_space, total_size, NULL); - - /* calculate the number of elements we're going to print */ - p_nelmts = 1; - - if (ctx.ndims > 0) { - for (i = 0; i < ctx.ndims; i++) - p_nelmts *= total_size[i]; - ctx.size_last_dim = (total_size[ctx.ndims - 1]); - } /* end if */ - else - ctx.size_last_dim = 0; - - if (p_nelmts == 0) { - /* nothing to print */ - H5Sclose(f_space); - return SUCCEED; - } - - /* Check if we have VL data in the dataset's datatype */ - if (h5tools_detect_vlen_str(p_type) == TRUE) - vl_data = TRUE; - if (H5Tdetect_class(p_type, 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 = H5Tget_size(p_type); - - if (ctx.ndims > 0) { - for (i = ctx.ndims; i > 0; --i) { - hsize_t size = H5TOOLS_BUFSIZE / sm_nbytes; - if ( size == 0) /* datum size > H5TOOLS_BUFSIZE */ - size = 1; - sm_size[i - 1] = MIN(total_size[i - 1], size); - sm_nbytes *= sm_size[i - 1]; - assert(sm_nbytes > 0); - } - } - - assert(sm_nbytes == (hsize_t)((size_t)sm_nbytes)); /*check for overflow*/ - sm_buf = (unsigned char *)HDmalloc((size_t)sm_nbytes); - - sm_nelmts = sm_nbytes / p_type_nbytes; - sm_space = H5Screate_simple(1, &sm_nelmts, NULL); - - if (ctx.ndims > 0) - init_acc_pos(&ctx, total_size); - - /* 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 (ctx.ndims > 0) { - for (i = 0, hs_nelmts = 1; i < ctx.ndims; i++) { - hs_size[i] = MIN(total_size[i] - hs_offset[i], sm_size[i]); - ctx.p_max_idx[i] = ctx.p_min_idx[i] + hs_size[i]; - hs_nelmts *= hs_size[i]; - } - - H5Sselect_hyperslab(f_space, H5S_SELECT_SET, hs_offset, NULL, hs_size, NULL); - H5Sselect_hyperslab(sm_space, H5S_SELECT_SET, zero, NULL, &hs_nelmts, NULL); - } - else { - H5Sselect_all(f_space); - H5Sselect_all(sm_space); - hs_nelmts = 1; - } - - /* Read the data */ - if (H5Dread(dset, p_type, sm_space, f_space, H5P_DEFAULT, sm_buf) < 0) { - H5Sclose(f_space); - H5Sclose(sm_space); - free(sm_buf); - return FAIL; - } - - /* Print the data */ - flags = (elmtno == 0) ? START_OF_DATA : 0; - flags |= ((elmtno + hs_nelmts) >= p_nelmts) ? END_OF_DATA : 0; - - /* initialize the current stripmine position; this is necessary to print the array - indices */ - ctx.sm_pos = elmtno; - - h5tools_dump_simple_data(stream, info, dset, &ctx, flags, hs_nelmts, p_type, sm_buf); - - /* Reclaim any VL memory, if necessary */ - if (vl_data) - H5Dvlen_reclaim(p_type, sm_space, H5P_DEFAULT, sm_buf); - - /* Calculate the next hyperslab offset */ - for (i = ctx.ndims, carry = 1; i > 0 && carry; --i) { - ctx.p_min_idx[i - 1] = ctx.p_max_idx[i - 1]; - hs_offset[i - 1] += hs_size[i - 1]; - - if (hs_offset[i - 1] == total_size[i - 1]) - hs_offset[i - 1] = 0; - else - carry = 0; - } - - ctx.continuation++; - } - - /* Terminate the output */ - if (ctx.cur_column) { - fputs(OPT(info->line_suf, ""), stream); - putc('\n', stream); - fputs(OPT(info->line_sep, ""), stream); - } - - H5Sclose(sm_space); - H5Sclose(f_space); - - HDfree(sm_buf); - - return SUCCEED; -} - -/*------------------------------------------------------------------------- - * Function: h5tools_dump_simple_mem - * - * Purpose: Print some values from memory with a simple data space. - * This is a special case of h5tools_dump_mem(). - * - * Return: Success: SUCCEED - * Failure: FAIL - * - *------------------------------------------------------------------------- - */ -static int -h5tools_dump_simple_mem(FILE *stream, const h5tool_format_t *info, hid_t obj_id, - hid_t type, hid_t space, void *mem, int indentlevel) -{ - int i; /*counters */ - hsize_t nelmts; /*total selected elmts */ - h5tools_context_t ctx; /*printing context */ - - /* - * Check that everything looks okay. The dimensionality must not be too - * great and the dimensionality of the items selected for printing must - * match the dimensionality of the dataset. - */ - memset(&ctx, 0, sizeof(ctx)); - ctx.ndims = H5Sget_simple_extent_ndims(space); - - if ((size_t) ctx.ndims > NELMTS(ctx.p_min_idx)) - return FAIL; - - ctx.indent_level = indentlevel; - ctx.need_prefix = 1; - - /* Assume entire data space to be printed */ - for (i = 0; i < ctx.ndims; i++) - ctx.p_min_idx[i] = 0; - - H5Sget_simple_extent_dims(space, ctx.p_max_idx, NULL); - - for (i = 0, nelmts = 1; ctx.ndims != 0 && i < ctx.ndims; i++) - nelmts *= ctx.p_max_idx[i] - ctx.p_min_idx[i]; - - if (nelmts == 0) - return SUCCEED; /*nothing to print*/ - if (ctx.ndims > 0) { - assert(ctx.p_max_idx[ctx.ndims - 1] == (hsize_t) ((int) ctx.p_max_idx[ctx.ndims - 1])); - ctx.size_last_dim = (int) (ctx.p_max_idx[ctx.ndims - 1]); - } /* end if */ - else - ctx.size_last_dim = 0; - - if (ctx.ndims > 0) - init_acc_pos(&ctx, ctx.p_max_idx); - - /* Print it */ - h5tools_dump_simple_data(stream, info, obj_id, &ctx, START_OF_DATA | END_OF_DATA, nelmts, type, mem); - - /* Terminate the output */ - if (ctx.cur_column) { - fputs(OPT(info->line_suf, ""), stream); - putc('\n', stream); - fputs(OPT(info->line_sep, ""), stream); - } - - return SUCCEED; -} - -/*------------------------------------------------------------------------- - * Function: h5tools_dump_dset - * - * Purpose: Print some values from a dataset DSET to the file STREAM - * after converting all types to P_TYPE (which should be a - * native type). If P_TYPE is a negative value then it will be - * computed from the dataset type using only native types. - * - * Note: This function is intended only for datasets since it does - * some things like strip mining which are unnecessary for - * smaller objects such as attributes. The easiest way to print - * small objects is to read the object into memory and call - * h5tools_dump_mem(). - * - * Return: Success: SUCCEED - * Failure: FAIL - * - * Modifications: - * Robb Matzke, 1999-06-07 - * If info->raw is set then the memory datatype will be the same - * as the file datatype. - * - * Bill Wendling, 2001-02-27 - * Renamed to ``h5tools_dump_dset'' and added the subsetting - * parameter. - * - *------------------------------------------------------------------------- - */ -int -h5tools_dump_dset(FILE *stream, const h5tool_format_t *info, hid_t dset, - hid_t _p_type, struct subset_t *sset, int indentlevel) -{ - hid_t f_space; - hid_t p_type = _p_type; - hid_t f_type; - H5S_class_t space_type; - int status = FAIL; - h5tool_format_t info_dflt; - /* Use default values */ - if (!stream) - stream = stdout; - - if (!info) { - memset(&info_dflt, 0, sizeof info_dflt); - info = &info_dflt; - } - - if (p_type < 0) { - f_type = H5Dget_type(dset); - - if (info->raw || bin_form == 1) - p_type = H5Tcopy(f_type); - else if (bin_form == 2) - p_type = h5tools_get_little_endian_type(f_type); - else if (bin_form == 3) - p_type = h5tools_get_big_endian_type(f_type); - else - p_type = h5tools_get_native_type(f_type); - - H5Tclose(f_type); - - if (p_type < 0) - goto done; - } - - /* Check the data space */ - f_space = H5Dget_space(dset); - - space_type = H5Sget_simple_extent_type(f_space); - - /* Print the data */ - if (space_type == H5S_SIMPLE || space_type == H5S_SCALAR) { - if(!sset) - status = h5tools_dump_simple_dset(rawdatastream, info, dset, p_type, indentlevel); - else - status = h5tools_dump_simple_subset(rawdatastream, info, dset, p_type, sset, indentlevel); - } - else - /* space is H5S_NULL */ - status = SUCCEED; - - /* Close the dataspace */ - H5Sclose(f_space); - -done: - if (p_type != _p_type) - H5Tclose(p_type); - - return status; -} - -/*------------------------------------------------------------------------- - * Function: h5tools_dump_mem - * - * Purpose: Displays the data contained in MEM. MEM must have the - * specified data TYPE and SPACE. Currently only simple data - * spaces are allowed and only the `all' selection. - * - * Return: Success: SUCCEED - * Failure: FAIL - * - *------------------------------------------------------------------------- - */ -int -h5tools_dump_mem(FILE *stream, const h5tool_format_t *info, hid_t obj_id, hid_t type, - hid_t space, void *mem, int indentlevel) -{ - HERR_INIT(int, SUCCEED) - h5tool_format_t info_dflt; - - /* Use default values */ - if (!stream) - stream = stdout; - - if (!info) { - memset(&info_dflt, 0, sizeof(info_dflt)); - info = &info_dflt; - } - - /* Check the data space */ - if (H5Sis_simple(space) <= 0) - H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Sis_simple failed") - - H5_LEAVE(h5tools_dump_simple_mem(stream, info, obj_id, type, space, mem, indentlevel)) - -CATCH - return ret_value; -} - -/*------------------------------------------------------------------------- - * Function: print_datatype - * - * Purpose: print the datatype. - * - * Return: void - * - * In/Out: h5tools_str_t *buffer - * h5tools_context_t *ctx - * - *------------------------------------------------------------------------- - */ -int -h5tools_print_datatype(h5tools_str_t *buffer, const h5tool_format_t *info, - h5tools_context_t *ctx, hid_t type) -{ - HERR_INIT(int, SUCCEED) - char *mname; - hid_t mtype, str_type; - int snmembers; - unsigned nmembers; - int sndims; - unsigned i; - size_t size = 0; - hsize_t dims[H5TOOLS_DUMP_MAX_RANK]; - H5T_str_t str_pad; - H5T_cset_t cset; - H5T_order_t order; - H5T_class_t type_class; - hid_t super; - hid_t tmp_type; - htri_t is_vlstr = FALSE; - const char *order_s = NULL; /* byte order string */ - H5T_sign_t sign; /* sign scheme value */ - const char *sign_s = NULL; /* sign scheme string */ - - if((type_class = H5Tget_class(type)) < 0) - H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_class failed"); - switch (type_class) { - case H5T_INTEGER: - if (H5Tequal(type, H5T_STD_I8BE) == TRUE) { - h5tools_str_append(buffer, "H5T_STD_I8BE"); - } - else if (H5Tequal(type, H5T_STD_I8LE) == TRUE) { - h5tools_str_append(buffer, "H5T_STD_I8LE"); - } - else if (H5Tequal(type, H5T_STD_I16BE) == TRUE) { - h5tools_str_append(buffer, "H5T_STD_I16BE"); - } - else if (H5Tequal(type, H5T_STD_I16LE) == TRUE) { - h5tools_str_append(buffer, "H5T_STD_I16LE"); - } - else if (H5Tequal(type, H5T_STD_I32BE) == TRUE) { - h5tools_str_append(buffer, "H5T_STD_I32BE"); - } - else if (H5Tequal(type, H5T_STD_I32LE) == TRUE) { - h5tools_str_append(buffer, "H5T_STD_I32LE"); - } - else if (H5Tequal(type, H5T_STD_I64BE) == TRUE) { - h5tools_str_append(buffer, "H5T_STD_I64BE"); - } - else if (H5Tequal(type, H5T_STD_I64LE) == TRUE) { - h5tools_str_append(buffer, "H5T_STD_I64LE"); - } - else if (H5Tequal(type, H5T_STD_U8BE) == TRUE) { - h5tools_str_append(buffer, "H5T_STD_U8BE"); - } - else if (H5Tequal(type, H5T_STD_U8LE) == TRUE) { - h5tools_str_append(buffer, "H5T_STD_U8LE"); - } - else if (H5Tequal(type, H5T_STD_U16BE) == TRUE) { - h5tools_str_append(buffer, "H5T_STD_U16BE"); - } - else if (H5Tequal(type, H5T_STD_U16LE) == TRUE) { - h5tools_str_append(buffer, "H5T_STD_U16LE"); - } - else if (H5Tequal(type, H5T_STD_U32BE) == TRUE) { - h5tools_str_append(buffer, "H5T_STD_U32BE"); - } - else if (H5Tequal(type, H5T_STD_U32LE) == TRUE) { - h5tools_str_append(buffer, "H5T_STD_U32LE"); - } - else if (H5Tequal(type, H5T_STD_U64BE) == TRUE) { - h5tools_str_append(buffer, "H5T_STD_U64BE"); - } - else if (H5Tequal(type, H5T_STD_U64LE) == TRUE) { - h5tools_str_append(buffer, "H5T_STD_U64LE"); - } - else if (H5Tequal(type, H5T_NATIVE_SCHAR) == TRUE) { - h5tools_str_append(buffer, "H5T_NATIVE_SCHAR"); - } - else if (H5Tequal(type, H5T_NATIVE_UCHAR) == TRUE) { - h5tools_str_append(buffer, "H5T_NATIVE_UCHAR"); - } - else if (H5Tequal(type, H5T_NATIVE_SHORT) == TRUE) { - h5tools_str_append(buffer, "H5T_NATIVE_SHORT"); - } - else if (H5Tequal(type, H5T_NATIVE_USHORT) == TRUE) { - h5tools_str_append(buffer, "H5T_NATIVE_USHORT"); - } - else if (H5Tequal(type, H5T_NATIVE_INT) == TRUE) { - h5tools_str_append(buffer, "H5T_NATIVE_INT"); - } - else if (H5Tequal(type, H5T_NATIVE_UINT) == TRUE) { - h5tools_str_append(buffer, "H5T_NATIVE_UINT"); - } - else if (H5Tequal(type, H5T_NATIVE_LONG) == TRUE) { - h5tools_str_append(buffer, "H5T_NATIVE_LONG"); - } - else if (H5Tequal(type, H5T_NATIVE_ULONG) == TRUE) { - h5tools_str_append(buffer, "H5T_NATIVE_ULONG"); - } - else if (H5Tequal(type, H5T_NATIVE_LLONG) == TRUE) { - h5tools_str_append(buffer, "H5T_NATIVE_LLONG"); - } - else if (H5Tequal(type, H5T_NATIVE_ULLONG) == TRUE) { - h5tools_str_append(buffer, "H5T_NATIVE_ULLONG"); - } - else { - - /* byte order */ - if (H5Tget_size(type) > 1) { - order = H5Tget_order(type); - if (H5T_ORDER_LE == order) { - order_s = " little-endian"; - } - else if (H5T_ORDER_BE == order) { - order_s = " big-endian"; - } - else if (H5T_ORDER_VAX == order) { - order_s = " mixed-endian"; - } - else { - order_s = " unknown-byte-order"; - } - } - else { - order_s = ""; - } - - /* sign */ - if ((sign = H5Tget_sign(type)) >= 0) { - if (H5T_SGN_NONE == sign) { - sign_s = " unsigned"; - } - else if (H5T_SGN_2 == sign) { - sign_s = ""; - } - else { - sign_s = " unknown-sign"; - } - } - else { - sign_s = " unknown-sign"; - } - - /* print size, order, and sign */ - h5tools_str_append(buffer, "%lu-bit%s%s integer", - (unsigned long) (8 * H5Tget_size(type)), order_s, sign_s); - } - break; - - case H5T_FLOAT: - if (H5Tequal(type, H5T_IEEE_F32BE) == TRUE) { - h5tools_str_append(buffer, "H5T_IEEE_F32BE"); - } - else if (H5Tequal(type, H5T_IEEE_F32LE) == TRUE) { - h5tools_str_append(buffer, "H5T_IEEE_F32LE"); - } - else if (H5Tequal(type, H5T_IEEE_F64BE) == TRUE) { - h5tools_str_append(buffer, "H5T_IEEE_F64BE"); - } - else if (H5Tequal(type, H5T_IEEE_F64LE) == TRUE) { - h5tools_str_append(buffer, "H5T_IEEE_F64LE"); - } - else if (H5Tequal(type, H5T_VAX_F32) == TRUE) { - h5tools_str_append(buffer, "H5T_VAX_F32"); - } - else if (H5Tequal(type, H5T_VAX_F64) == TRUE) { - h5tools_str_append(buffer, "H5T_VAX_F64"); - } - else if (H5Tequal(type, H5T_NATIVE_FLOAT) == TRUE) { - h5tools_str_append(buffer, "H5T_NATIVE_FLOAT"); - } - else if (H5Tequal(type, H5T_NATIVE_DOUBLE) == TRUE) { - h5tools_str_append(buffer, "H5T_NATIVE_DOUBLE"); -#if H5_SIZEOF_LONG_DOUBLE !=0 - } - else if (H5Tequal(type, H5T_NATIVE_LDOUBLE) == TRUE) { - h5tools_str_append(buffer, "H5T_NATIVE_LDOUBLE"); -#endif - } - else { - - /* byte order */ - if (H5Tget_size(type) > 1) { - order = H5Tget_order(type); - if (H5T_ORDER_LE == order) { - order_s = " little-endian"; - } - else if (H5T_ORDER_BE == order) { - order_s = " big-endian"; - } - else if (H5T_ORDER_VAX == order) { - order_s = " mixed-endian"; - } - else { - order_s = " unknown-byte-order"; - } - } - else { - order_s = ""; - } - - /* print size and byte order */ - h5tools_str_append(buffer, "%lu-bit%s floating-point", - (unsigned long) (8 * H5Tget_size(type)), order_s); - - } - break; - - case H5T_TIME: - h5tools_str_append(buffer, "H5T_TIME: not yet implemented"); - break; - - case H5T_STRING: - /* Make a copy of type in memory in case when TYPE is on disk, the size - * will be bigger than in memory. This makes it easier to compare - * types in memory. */ - tmp_type = H5Tcopy(type); - size = H5Tget_size(tmp_type); - str_pad = H5Tget_strpad(tmp_type); - cset = H5Tget_cset(tmp_type); - is_vlstr = H5Tis_variable_str(tmp_type); - - h5tools_str_append(buffer, "H5T_STRING %s\n", h5tools_dump_header_format->strblockbegin); - ctx->indent_level++; - - if (is_vlstr) - h5tools_str_append(buffer, "%s H5T_VARIABLE;\n", STRSIZE); - else - h5tools_str_append(buffer, "%s %d;\n", STRSIZE, (int) size); - - h5tools_str_append(buffer, "%s ", STRPAD); - if (str_pad == H5T_STR_NULLTERM) - h5tools_str_append(buffer, "H5T_STR_NULLTERM;\n"); - else if (str_pad == H5T_STR_NULLPAD) - h5tools_str_append(buffer, "H5T_STR_NULLPAD;\n"); - else if (str_pad == H5T_STR_SPACEPAD) - h5tools_str_append(buffer, "H5T_STR_SPACEPAD;\n"); - else - h5tools_str_append(buffer, "H5T_STR_ERROR;\n"); - - h5tools_str_append(buffer, "%s ", CSET); - - if (cset == H5T_CSET_ASCII) - h5tools_str_append(buffer, "H5T_CSET_ASCII;\n"); - else - h5tools_str_append(buffer, "unknown_cset;\n"); - - str_type = H5Tcopy(H5T_C_S1); - if (is_vlstr) - H5Tset_size(str_type, H5T_VARIABLE); - else - H5Tset_size(str_type, size); - H5Tset_cset(str_type, cset); - H5Tset_strpad(str_type, str_pad); - - h5tools_str_append(buffer, "%s ", CTYPE); - - /* Check C variable-length string first. Are the two types equal? */ - if (H5Tequal(tmp_type, str_type)) { - h5tools_str_append(buffer, "H5T_C_S1;\n"); - goto done; - } - - /* Change the endianness and see if they're equal. */ - order = H5Tget_order(tmp_type); - if (order == H5T_ORDER_LE) - H5Tset_order(str_type, H5T_ORDER_LE); - else if (order == H5T_ORDER_BE) - H5Tset_order(str_type, H5T_ORDER_BE); - - if (H5Tequal(tmp_type, str_type)) { - h5tools_str_append(buffer, "H5T_C_S1;\n"); - goto done; - } - - /* If not equal to C variable-length string, check Fortran type. */ - if(H5Tclose(str_type) < 0) - HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tclose failed"); - str_type = H5Tcopy(H5T_FORTRAN_S1); - - H5Tset_cset(str_type, cset); - H5Tset_size(str_type, size); - H5Tset_strpad(str_type, str_pad); - - /* Are the two types equal? */ - if (H5Tequal(tmp_type, str_type)) { - h5tools_str_append(buffer, "H5T_FORTRAN_S1;\n"); - goto done; - } - - /* Change the endianness and see if they're equal. */ - order = H5Tget_order(tmp_type); - if (order == H5T_ORDER_LE) - H5Tset_order(str_type, H5T_ORDER_LE); - else if (order == H5T_ORDER_BE) - H5Tset_order(str_type, H5T_ORDER_BE); - - if (H5Tequal(tmp_type, str_type)) { - h5tools_str_append(buffer, "H5T_FORTRAN_S1;\n"); - goto done; - } - - /* Type doesn't match any of above. */ - h5tools_str_append(buffer, "unknown_one_character_type;\n "); - - done: - if(H5Tclose(str_type) < 0) - HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tclose failed"); - if(H5Tclose(tmp_type) < 0) - HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tclose failed"); - - ctx->indent_level--; - h5tools_str_append(buffer, "%s", h5tools_dump_header_format->strblockend); - break; - - case H5T_BITFIELD: - if (H5Tequal(type, H5T_STD_B8BE) == TRUE) { - h5tools_str_append(buffer, "H5T_STD_B8BE"); - } - else if (H5Tequal(type, H5T_STD_B8LE) == TRUE) { - h5tools_str_append(buffer, "H5T_STD_B8LE"); - } - else if (H5Tequal(type, H5T_STD_B16BE) == TRUE) { - h5tools_str_append(buffer, "H5T_STD_B16BE"); - } - else if (H5Tequal(type, H5T_STD_B16LE) == TRUE) { - h5tools_str_append(buffer, "H5T_STD_B16LE"); - } - else if (H5Tequal(type, H5T_STD_B32BE) == TRUE) { - h5tools_str_append(buffer, "H5T_STD_B32BE"); - } - else if (H5Tequal(type, H5T_STD_B32LE) == TRUE) { - h5tools_str_append(buffer, "H5T_STD_B32LE"); - } - else if (H5Tequal(type, H5T_STD_B64BE) == TRUE) { - h5tools_str_append(buffer, "H5T_STD_B64BE"); - } - else if (H5Tequal(type, H5T_STD_B64LE) == TRUE) { - h5tools_str_append(buffer, "H5T_STD_B64LE"); - } - else { - h5tools_str_append(buffer, "undefined bitfield"); - } - break; - - case H5T_OPAQUE: - h5tools_str_append(buffer, "\n"); - h5tools_str_append(buffer, "H5T_OPAQUE;\n"); - h5tools_str_append(buffer, "OPAQUE_TAG \"%s\";\n", H5Tget_tag(type)); - break; - - case H5T_COMPOUND: - if((snmembers = H5Tget_nmembers(type)) < 0) - H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_nmembers failed"); - nmembers = (unsigned)snmembers; - - h5tools_str_append(buffer, "H5T_COMPOUND %s\n", h5tools_dump_header_format->structblockbegin); - - for (i = 0; i < nmembers; i++) { - mname = H5Tget_member_name(type, i); - if((mtype = H5Tget_member_type(type, i))>=0) { - if (H5Tget_class(mtype) == H5T_COMPOUND) - ctx->indent_level++; - - h5tools_print_datatype(buffer, info, ctx, mtype); - - if (H5Tget_class(mtype) == H5T_COMPOUND) - ctx->indent_level--; - - h5tools_str_append(buffer, " \"%s\";\n", mname); - if(H5Tclose(mtype) < 0) - HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tclose failed"); - } - else - HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tget_member_type failed"); - free(mname); - } - - h5tools_str_append(buffer, "%s", h5tools_dump_header_format->structblockend); - break; - - case H5T_REFERENCE: - h5tools_str_append(buffer, "H5T_REFERENCE"); - if(region_output) { - if (H5Tequal(type, H5T_STD_REF_DSETREG) == TRUE) { - h5tools_str_append(buffer, " { H5T_STD_REF_DSETREG }"); - } - else { - h5tools_str_append(buffer, " { H5T_STD_REF_OBJECT }"); - } - } - break; - - case H5T_ENUM: - if((super = H5Tget_super(type)) < 0) - H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_nmembers failed"); - - h5tools_str_append(buffer, "H5T_ENUM %s\n", h5tools_dump_header_format->enumblockbegin); - ctx->indent_level++; - - h5tools_print_datatype(buffer, info, ctx, super); - if(H5Tclose(super) < 0) - HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tclose failed"); - - h5tools_str_append(buffer, ";\n"); - h5tools_print_enum(buffer, type); - - ctx->indent_level--; - h5tools_str_append(buffer, "%s", h5tools_dump_header_format->enumblockend); - - break; - - case H5T_VLEN: - if((super = H5Tget_super(type)) < 0) - H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_nmembers failed"); - - h5tools_str_append(buffer, "H5T_VLEN %s ", h5tools_dump_header_format->vlenblockbegin); - - h5tools_print_datatype(buffer, info, ctx, super); - if(H5Tclose(super) < 0) - HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tclose failed"); - - h5tools_str_append(buffer, "%s", h5tools_dump_header_format->vlenblockend); - - break; - - case H5T_ARRAY: - h5tools_str_append(buffer, "H5T_ARRAY { "); - - /* Get array information */ - if((sndims = H5Tget_array_ndims(type)) >= 0) { - unsigned ndims = (unsigned)sndims; - - if(H5Tget_array_dims2(type, dims) >= 0) { - /* Print array dimensions */ - for (i = 0; i < ndims; i++) - h5tools_str_append(buffer, "[%d]", (int) dims[i]); - - h5tools_str_append(buffer, " "); - } - else - HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tget_array_dims2 failed"); - } - else - HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tget_array_ndims failed"); - - /* Get array base type */ - if((super = H5Tget_super(type)) >= 0) { - /* Print base type */ - h5tools_print_datatype(buffer, info, ctx, super); - /* Close array base type */ - if(H5Tclose(super) < 0) - HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tclose failed"); - } - else - HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tget_super failed"); - - h5tools_str_append(buffer, " }"); - - break; - - default: - h5tools_str_append(buffer, "unknown datatype"); - break; - } - -CATCH - return ret_value; -} - -/*------------------------------------------------------------------------- - * Function: print_dataspace - * - * Purpose: print the dataspace. - * - * Return: void - * - * In/Out: h5tools_str_t *buffer - * h5tools_context_t *ctx - * - *------------------------------------------------------------------------- - */ -int -h5tools_print_dataspace(h5tools_str_t *buffer, hid_t space) -{ - HERR_INIT(int, SUCCEED) - hsize_t size[H5TOOLS_DUMP_MAX_RANK]; - hsize_t maxsize[H5TOOLS_DUMP_MAX_RANK]; - int ndims = -1; - H5S_class_t space_type = -1; - int i; - - if((ndims = H5Sget_simple_extent_dims(space, size, maxsize)) < 0) - H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_dims failed"); - - if((space_type = H5Sget_simple_extent_type(space)) < 0) - H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_type failed"); - - switch(space_type) { - case H5S_SCALAR: - /* scalar dataspace */ - h5tools_str_append(buffer, "%s %s", h5tools_dump_header_format->dataspacedescriptionbegin, S_SCALAR); - break; - - case H5S_SIMPLE: - /* simple dataspace */ - h5tools_str_append(buffer, "%s %s { %s %" H5_PRINTF_LL_WIDTH "u", - h5tools_dump_header_format->dataspacedescriptionbegin, S_SIMPLE, - h5tools_dump_header_format->dataspacedimbegin, size[0]); - - for(i = 1; i < ndims; i++) - h5tools_str_append(buffer, ", %" H5_PRINTF_LL_WIDTH "u", size[i]); - - h5tools_str_append(buffer, " %s / ", h5tools_dump_header_format->dataspacedimend); - - if(maxsize[0] == H5S_UNLIMITED) - h5tools_str_append(buffer, "%s %s", - h5tools_dump_header_format->dataspacedimbegin, "H5S_UNLIMITED"); - else - h5tools_str_append(buffer, "%s %" H5_PRINTF_LL_WIDTH "u", - h5tools_dump_header_format->dataspacedimbegin, maxsize[0]); - - for(i = 1; i < ndims; i++) - if(maxsize[i] == H5S_UNLIMITED) - h5tools_str_append(buffer, ", %s", "H5S_UNLIMITED"); - else - h5tools_str_append(buffer, ", %" H5_PRINTF_LL_WIDTH "u", maxsize[i]); - - h5tools_str_append(buffer, " %s }", h5tools_dump_header_format->dataspacedimend); - break; - - case H5S_NULL: - /* null dataspace */ - h5tools_str_append(buffer, "%s %s", h5tools_dump_header_format->dataspacedescriptionbegin, S_NULL); - break; - - case H5S_NO_CLASS: - default: - h5tools_str_append(buffer, "%s unknown dataspace %s\n", BEGIN, END); - break; - } /* end switch */ - -CATCH - return ret_value; -} - - -/*------------------------------------------------------------------------- - * Function: print_enum - * - * Purpose: prints the enum data - * - * Return: void - * - * In/Out: h5tools_str_t *buffer - * h5tools_context_t *ctx - * - *-----------------------------------------------------------------------*/ -int -h5tools_print_enum(h5tools_str_t *buffer, hid_t type) -{ - HERR_INIT(int, SUCCEED) - char **name = NULL; /*member names */ - unsigned char *value = NULL; /*value array */ - unsigned char *copy = NULL; /*a pointer to value array */ - unsigned nmembs = 0; /*number of members */ - int nchars; /*number of output characters */ - hid_t super = -1; /*enum base integer type */ - hid_t native = -1; /*native integer datatype */ - H5T_sign_t sign_type; /*sign of value type */ - size_t type_size; /*value type size */ - size_t dst_size; /*destination value type size */ - int snmembs; - unsigned i; - - if((snmembs = H5Tget_nmembers(type)) < 0) - H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_nmembers failed"); - nmembs = (unsigned)snmembs; - assert(nmembs > 0); - - if((super = H5Tget_super(type)) < 0) - H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_super failed"); - - if((type_size = H5Tget_size(type)) <= 0) - H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_size(type) failed"); - - /* - * Determine what datatype to use for the native values. To simplify - * things we entertain three possibilities: - * 1. long long -- the largest native signed integer - * 2. unsigned long long -- the largest native unsigned integer - * 3. raw format - */ - if(type_size <= sizeof(long long)) { - dst_size = sizeof(long long); - - if((sign_type = H5Tget_sign(type))<0) - H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_sign failed"); - if(H5T_SGN_NONE == sign_type) - native = H5T_NATIVE_ULLONG; - else - native = H5T_NATIVE_LLONG; - } /* end if */ - else - dst_size = type_size; - - /* Get the names and raw values of all members */ - if(NULL == (name = (char **)HDcalloc(nmembs, sizeof(char *)))) - H5E_THROW(FAIL, H5E_tools_min_id_g, "Could not allocate buffer for member name"); - if(NULL == (value = (unsigned char *)HDcalloc(nmembs, MAX(type_size, dst_size)))) - H5E_THROW(FAIL, H5E_tools_min_id_g, "Could not allocate buffer for member value"); - - for (i = 0; i < nmembs; i++) { - name[i] = H5Tget_member_name(type, i); - if(H5Tget_member_value(type, i, value + i * type_size) < 0) - H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_member_value failed"); - } - - /* Convert values to native datatype */ - if (native > 0) - if(H5Tconvert(super, native, nmembs, value, NULL, H5P_DEFAULT) < 0) - H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Tconvert failed"); - - /* - * Sort members by increasing value - * ***not implemented yet*** - */ - - /* Print members */ - for (i = 0; i < nmembs; i++) { - h5tools_str_append(buffer, "\"%s\"", name[i]); - nchars = strlen(name[i]); - h5tools_str_append(buffer, "%*s ", MAX(0, 16 - nchars), ""); - - if (native < 0) { - size_t j; - - h5tools_str_append(buffer, "0x"); - - for (j = 0; j < dst_size; j++) - h5tools_str_append(buffer, "%02x", value[i * dst_size + j]); - } - else 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; - h5tools_str_append(buffer, "%" H5_PRINTF_LL_WIDTH "u", *((unsigned long long *) ((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; - h5tools_str_append(buffer, "%" H5_PRINTF_LL_WIDTH "d", *((long long *) ((void *) copy))); - } - - h5tools_str_append(buffer, ";\n"); - } - -CATCH - if(name) { - /* Release resources */ - for(i = 0; i < nmembs; i++) - if(name[i]) - free(name[i]); - free(name); - } /* end if */ - - if(value) - free(value); - - if(super >= 0 && H5Tclose(super) < 0) - H5E_THROW(FAIL, H5E_tools_min_id_g, "Could not close datatype's super class"); - - if(0 == nmembs) - h5tools_str_append(buffer, "\n"); - - return ret_value; -} - -/*------------------------------------------------------------------------- - * Function: dump_datatype - * - * Purpose: Dump the datatype. Datatype can be HDF5 predefined - * atomic datatype or committed/transient datatype. - * - * Return: void - * - * In/Out: h5tools_context_t *ctx - *------------------------------------------------------------------------- - */ -void -h5tools_dump_datatype(FILE *stream, const h5tool_format_t *info, - h5tools_context_t *ctx, hid_t type) -{ - size_t ncols = 80; /* available output width */ - h5tools_str_t buffer; /* string into which to render */ - hsize_t curr_pos; /* total data element position */ - hsize_t elmt_counter = 0;/* counts the # elements printed.*/ - - /* setup */ - HDmemset(&buffer, 0, sizeof(h5tools_str_t)); - - if (info->line_ncols > 0) - ncols = info->line_ncols; - - /* pass to the prefix in h5tools_simple_prefix the total position - * instead of the current stripmine position i; this is necessary - * to print the array indices - */ - curr_pos = ctx->sm_pos; - - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - /* Render the element */ - h5tools_str_reset(&buffer); - - ctx->indent_level++; - h5tools_str_append(&buffer, "%s %s ", - h5tools_dump_header_format->datatypebegin, - h5tools_dump_header_format->datatypeblockbegin); - - h5tools_print_datatype(&buffer, info, ctx, type); - - if (HDstrlen(h5tools_dump_header_format->datatypeblockend)) { - h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->datatypeblockend); - if (HDstrlen(h5tools_dump_header_format->datatypeend)) - h5tools_str_append(&buffer, " "); - } - if (HDstrlen(h5tools_dump_header_format->datatypeend)) - h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->datatypeend); - h5tools_str_append(&buffer, "\n"); - - curr_pos = h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, - ncols, elmt_counter, 0); - - ctx->need_prefix = TRUE; - ctx->indent_level--; -} - -/*------------------------------------------------------------------------- - * Function: init_acc_pos - * - * Purpose: initialize accumulator and matrix position - * - * Return: void - *------------------------------------------------------------------------- - */ -void -init_acc_pos(h5tools_context_t *ctx, hsize_t *dims) -{ - int i; - - assert(ctx->ndims); - - ctx->acc[ctx->ndims - 1] = 1; - for (i = (ctx->ndims - 2); i >= 0; i--) { - ctx->acc[i] = ctx->acc[i + 1] * dims[i + 1]; - } - for (i = 0; i < ctx->ndims; i++) - ctx->pos[i] = 0; -} - -/*------------------------------------------------------------------------- - * Function: do_bin_output - * - * Purpose: Dump memory buffer to a binary file stream - * - * Return: Success: SUCCEED - * Failure: FAIL - *------------------------------------------------------------------------- - */ -static -int do_bin_output(FILE *stream, hid_t container, hsize_t nelmts, hid_t tid, void *_mem) -{ - HERR_INIT(int, SUCCEED) - unsigned char *mem = (unsigned char*)_mem; - size_t size; /* datum size */ - hsize_t i; /* element counter */ - - if((size = H5Tget_size(tid)) == 0) - H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_size failed"); - - for (i = 0; i < nelmts; i++) { - if (render_bin_output(stream, container, tid, mem + i * size) < 0) { - printf("\nError in writing binary stream\n"); - return FAIL; - } - } - -CATCH - return ret_value; -} - -/*------------------------------------------------------------------------- - * Function: render_bin_output - * - * Purpose: Write one element of memory buffer to a binary file stream + * Purpose: Write one element of memory buffer to a binary file stream * * Return: Success: SUCCEED * Failure: FAIL *------------------------------------------------------------------------- */ -static int +int render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem) { HERR_INIT(int, SUCCEED) @@ -3671,8 +1126,8 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem) #ifdef DEBUG_H5DUMP_BIN static char fmt_llong[8], fmt_ullong[8]; if (!fmt_llong[0]) { - sprintf(fmt_llong, "%%%sd", H5_PRINTF_LL_WIDTH); - sprintf(fmt_ullong, "%%%su", H5_PRINTF_LL_WIDTH); + HDsprintf(fmt_llong, "%%%sd", H5_PRINTF_LL_WIDTH); + HDsprintf(fmt_ullong, "%%%su", H5_PRINTF_LL_WIDTH); } #endif @@ -3680,30 +1135,30 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem) H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_size failed"); if (H5Tequal(tid, H5T_NATIVE_FLOAT)) { - memcpy(&tempfloat, mem, sizeof(float)); + HDmemcpy(&tempfloat, mem, sizeof(float)); #ifdef DEBUG_H5DUMP_BIN - fprintf(stream, "%g ", tempfloat); + HDfprintf(stream, "%g ", tempfloat); #else - if (1 != fwrite(&tempfloat, size, 1, stream)) + if (1 != HDfwrite(&tempfloat, size, 1, stream)) H5E_THROW(FAIL, H5E_tools_min_id_g, "fwrite failed"); #endif } else if (H5Tequal(tid, H5T_NATIVE_DOUBLE)) { - memcpy(&tempdouble, mem, sizeof(double)); + HDmemcpy(&tempdouble, mem, sizeof(double)); #ifdef DEBUG_H5DUMP_BIN - fprintf(stream, "%g ", tempdouble); + HDfprintf(stream, "%g ", tempdouble); #else - if (1 != fwrite(&tempdouble, size, 1, stream)) + if (1 != HDfwrite(&tempdouble, size, 1, stream)) H5E_THROW(FAIL, H5E_tools_min_id_g, "fwrite failed"); #endif } #if H5_SIZEOF_LONG_DOUBLE !=0 else if (H5Tequal(tid, H5T_NATIVE_LDOUBLE)) { - memcpy(&templdouble, mem, sizeof(long double)); + HDmemcpy(&templdouble, mem, sizeof(long double)); #ifdef DEBUG_H5DUMP_BIN - fprintf(stream, "%Lf ", templdouble); + HDfprintf(stream, "%Lf ", templdouble); #else - if (1 != fwrite(&templdouble, size, 1, stream)) + if (1 != HDfwrite(&templdouble, size, 1, stream)) H5E_THROW(FAIL, H5E_tools_min_id_g, "fwrite failed"); #endif } @@ -3726,159 +1181,159 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem) H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_size failed"); } for (i = 0; i < size && (s[i] || pad != H5T_STR_NULLTERM); i++) { - memcpy(&tempuchar, &s[i], sizeof(unsigned char)); + HDmemcpy(&tempuchar, &s[i], sizeof(unsigned char)); #ifdef DEBUG_H5DUMP_BIN - fprintf(stream, "%d", tempuchar); + HDfprintf(stream, "%d", tempuchar); #else - if (1 != fwrite(&tempuchar, size, 1, stream)) + if (1 != HDfwrite(&tempuchar, size, 1, stream)) H5E_THROW(FAIL, H5E_tools_min_id_g, "fwrite failed"); #endif } /* i */ } else if (H5Tequal(tid, H5T_NATIVE_INT)) { - memcpy(&tempint, mem, sizeof(int)); + HDmemcpy(&tempint, mem, sizeof(int)); #ifdef DEBUG_H5DUMP_BIN - fprintf(stream, "%d ", tempint); + HDfprintf(stream, "%d ", tempint); #else - if (1 != fwrite(&tempint, size, 1, stream)) + if (1 != HDfwrite(&tempint, size, 1, stream)) H5E_THROW(FAIL, H5E_tools_min_id_g, "fwrite failed"); #endif } else if (H5Tequal(tid, H5T_NATIVE_UINT)) { - memcpy(&tempuint, mem, sizeof(unsigned int)); + HDmemcpy(&tempuint, mem, sizeof(unsigned int)); #ifdef DEBUG_H5DUMP_BIN - fprintf(stream, "%u ", tempuint); + HDfprintf(stream, "%u ", tempuint); #else - if (1 != fwrite(&tempuint, size, 1, stream)) + if (1 != HDfwrite(&tempuint, size, 1, stream)) H5E_THROW(FAIL, H5E_tools_min_id_g, "fwrite failed"); #endif } else if (H5Tequal(tid, H5T_NATIVE_SCHAR)) { - memcpy(&tempschar, mem, sizeof(char)); + HDmemcpy(&tempschar, mem, sizeof(char)); #ifdef DEBUG_H5DUMP_BIN - fprintf(stream, "%d ", tempschar); + HDfprintf(stream, "%d ", tempschar); #else - if (1 != fwrite(&tempschar, size, 1, stream)) + if (1 != HDfwrite(&tempschar, size, 1, stream)) H5E_THROW(FAIL, H5E_tools_min_id_g, "fwrite failed"); #endif } else if (H5Tequal(tid, H5T_NATIVE_UCHAR)) { - memcpy(&tempuchar, mem, sizeof(unsigned char)); + HDmemcpy(&tempuchar, mem, sizeof(unsigned char)); #ifdef DEBUG_H5DUMP_BIN - fprintf(stream, "%u ", tempuchar); + HDfprintf(stream, "%u ", tempuchar); #else - if (1 != fwrite(&tempuchar, size, 1, stream)) + if (1 != HDfwrite(&tempuchar, size, 1, stream)) H5E_THROW(FAIL, H5E_tools_min_id_g, "fwrite failed"); #endif } else if (H5Tequal(tid, H5T_NATIVE_SHORT)) { - memcpy(&tempshort, mem, sizeof(short)); + HDmemcpy(&tempshort, mem, sizeof(short)); #ifdef DEBUG_H5DUMP_BIN - fprintf(stream, "%d ", tempshort); + HDfprintf(stream, "%d ", tempshort); #else - if (1 != fwrite(&tempshort, size, 1, stream)) + if (1 != HDfwrite(&tempshort, size, 1, stream)) H5E_THROW(FAIL, H5E_tools_min_id_g, "fwrite failed"); #endif } else if (H5Tequal(tid, H5T_NATIVE_USHORT)) { - memcpy(&tempushort, mem, sizeof(unsigned short)); + HDmemcpy(&tempushort, mem, sizeof(unsigned short)); #ifdef DEBUG_H5DUMP_BIN - fprintf(stream, "%u ", tempushort); + HDfprintf(stream, "%u ", tempushort); #else - if (1 != fwrite(&tempushort, size, 1, stream)) + if (1 != HDfwrite(&tempushort, size, 1, stream)) H5E_THROW(FAIL, H5E_tools_min_id_g, "fwrite failed"); #endif } else if (H5Tequal(tid, H5T_NATIVE_LONG)) { - memcpy(&templong, mem, sizeof(long)); + HDmemcpy(&templong, mem, sizeof(long)); #ifdef DEBUG_H5DUMP_BIN - fprintf(stream, "%ld ", templong); + HDfprintf(stream, "%ld ", templong); #else - if (1 != fwrite(&templong, size, 1, stream)) + if (1 != HDfwrite(&templong, size, 1, stream)) H5E_THROW(FAIL, H5E_tools_min_id_g, "fwrite failed"); #endif } else if (H5Tequal(tid, H5T_NATIVE_ULONG)) { - memcpy(&tempulong, mem, sizeof(unsigned long)); + HDmemcpy(&tempulong, mem, sizeof(unsigned long)); #ifdef DEBUG_H5DUMP_BIN - fprintf(stream, "%lu ", tempulong); + HDfprintf(stream, "%lu ", tempulong); #else - if (1 != fwrite(&tempulong, size, 1, stream)) + if (1 != HDfwrite(&tempulong, size, 1, stream)) H5E_THROW(FAIL, H5E_tools_min_id_g, "fwrite failed"); #endif } else if (H5Tequal(tid, H5T_NATIVE_LLONG)) { - memcpy(&templlong, mem, sizeof(long long)); + HDmemcpy(&templlong, mem, sizeof(long long)); #ifdef DEBUG_H5DUMP_BIN - fprintf(stream, fmt_llong, templlong); + HDfprintf(stream, fmt_llong, templlong); #else - if (1 != fwrite(&templlong, size, 1, stream)) + if (1 != HDfwrite(&templlong, size, 1, stream)) H5E_THROW(FAIL, H5E_tools_min_id_g, "fwrite failed"); #endif } else if (H5Tequal(tid, H5T_NATIVE_ULLONG)) { - memcpy(&tempullong, mem, sizeof(unsigned long long)); + HDmemcpy(&tempullong, mem, sizeof(unsigned long long)); #ifdef DEBUG_H5DUMP_BIN - fprintf(stream, fmt_ullong, tempullong); + HDfprintf(stream, fmt_ullong, tempullong); #else - if (1 != fwrite(&tempullong, size, 1, stream)) + if (1 != HDfwrite(&tempullong, size, 1, stream)) H5E_THROW(FAIL, H5E_tools_min_id_g, "fwrite failed"); #endif } else if (H5Tequal(tid, H5T_NATIVE_HSSIZE)) { if (sizeof(hssize_t) == sizeof(int)) { - memcpy(&tempint, mem, sizeof(int)); + HDmemcpy(&tempint, mem, sizeof(int)); #ifdef DEBUG_H5DUMP_BIN - fprintf(stream, "%d ", tempint); + HDfprintf(stream, "%d ", tempint); #else - if (1 != fwrite(&tempint, size, 1, stream)) + if (1 != HDfwrite(&tempint, size, 1, stream)) H5E_THROW(FAIL, H5E_tools_min_id_g, "fwrite failed"); #endif } else if (sizeof(hssize_t) == sizeof(long)) { - memcpy(&templong, mem, sizeof(long)); + HDmemcpy(&templong, mem, sizeof(long)); #ifdef DEBUG_H5DUMP_BIN - fprintf(stream, "%ld ", templong); + HDfprintf(stream, "%ld ", templong); #else - if (1 != fwrite(&templong, size, 1, stream)) + if (1 != HDfwrite(&templong, size, 1, stream)) H5E_THROW(FAIL, H5E_tools_min_id_g, "fwrite failed"); #endif } else { - memcpy(&templlong, mem, sizeof(long long)); + HDmemcpy(&templlong, mem, sizeof(long long)); #ifdef DEBUG_H5DUMP_BIN - fprintf(stream, fmt_llong, templlong); + HDfprintf(stream, fmt_llong, templlong); #else - if (1 != fwrite(&templlong, size, 1, stream)) + if (1 != HDfwrite(&templlong, size, 1, stream)) H5E_THROW(FAIL, H5E_tools_min_id_g, "fwrite failed"); #endif } } else if (H5Tequal(tid, H5T_NATIVE_HSIZE)) { if (sizeof(hsize_t) == sizeof(int)) { - memcpy(&tempuint, mem, sizeof(unsigned int)); + HDmemcpy(&tempuint, mem, sizeof(unsigned int)); #ifdef DEBUG_H5DUMP_BIN - fprintf(stream, "%u ", tempuint); + HDfprintf(stream, "%u ", tempuint); #else - if (1 != fwrite(&tempuint, size, 1, stream)) + if (1 != HDfwrite(&tempuint, size, 1, stream)) H5E_THROW(FAIL, H5E_tools_min_id_g, "fwrite failed"); #endif } else if (sizeof(hsize_t) == sizeof(long)) { - memcpy(&tempulong, mem, sizeof(unsigned long)); + HDmemcpy(&tempulong, mem, sizeof(unsigned long)); #ifdef DEBUG_H5DUMP_BIN - fprintf(stream, "%lu ", tempulong); + HDfprintf(stream, "%lu ", tempulong); #else - if (1 != fwrite(&tempulong, size, 1, stream)) + if (1 != HDfwrite(&tempulong, size, 1, stream)) H5E_THROW(FAIL, H5E_tools_min_id_g, "fwrite failed"); #endif } else { - memcpy(&tempullong, mem, sizeof(unsigned long long)); + HDmemcpy(&tempullong, mem, sizeof(unsigned long long)); #ifdef DEBUG_H5DUMP_BIN - fprintf(stream, fmt_ullong, tempullong); + HDfprintf(stream, fmt_ullong, tempullong); #else - if (1 != fwrite(&tempullong, size, 1, stream)) + if (1 != HDfwrite(&tempullong, size, 1, stream)) H5E_THROW(FAIL, H5E_tools_min_id_g, "fwrite failed"); #endif } @@ -3905,18 +1360,18 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem) unsigned int i; if (1 == size) { #ifdef DEBUG_H5DUMP_BIN - fprintf(stream, "0x%02x", mem[0]); + HDfprintf(stream, "0x%02x", mem[0]); #else - if (1 != fwrite(&mem[0], size, 1, stream)) + if (1 != HDfwrite(&mem[0], size, 1, stream)) H5E_THROW(FAIL, H5E_tools_min_id_g, "fwrite failed"); #endif } else { for (i = 0; i < size; i++) { #ifdef DEBUG_H5DUMP_BIN - fprintf(stream, "%s%02x", i?":":"", mem[i]); + HDfprintf(stream, "%s%02x", i?":":"", mem[i]); #else - if (1 != fwrite(&mem[i], sizeof(char), 1, stream)) + if (1 != HDfwrite(&mem[i], sizeof(char), 1, stream)) H5E_THROW(FAIL, H5E_tools_min_id_g, "fwrite failed"); #endif } /*i*/ @@ -3932,7 +1387,7 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem) size = H5Tget_size(memb); ndims = H5Tget_array_ndims(tid); H5Tget_array_dims2(tid, dims); - assert(ndims >= 1 && ndims <= H5S_MAX_RANK); + HDassert(ndims >= 1 && ndims <= H5S_MAX_RANK); /* calculate the number of array elements */ for (k = 0, nelmts = 1; k < ndims; k++) { @@ -3974,7 +1429,7 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem) hid_t region_id, region_space; H5S_sel_type region_type; - region_id = H5Rdereference(container, H5R_DATASET_REGION, mem); + region_id = H5Rdereference2(container, H5P_DEFAULT, H5R_DATASET_REGION, mem); if (region_id >= 0) { region_space = H5Rget_region(container, H5R_DATASET_REGION, mem); if (region_space >= 0) { @@ -3995,18 +1450,18 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem) size_t i; if (1 == size) { #ifdef DEBUG_H5DUMP_BIN - fprintf(stream, "0x%02x", mem[0]); + HDfprintf(stream, "0x%02x", mem[0]); #else - if (1 != fwrite(&mem[0], size, 1, stream)) + if (1 != HDfwrite(&mem[0], size, 1, stream)) H5E_THROW(FAIL, H5E_tools_min_id_g, "fwrite failed"); #endif } else { for (i = 0; i < size; i++) { #ifdef DEBUG_H5DUMP_BIN - fprintf(stream, "%s%02x", i?":":"", mem[i]); + HDfprintf(stream, "%s%02x", i?":":"", mem[i]); #else - if (1 != fwrite(&mem[i], sizeof(char), 1, stream)) + if (1 != HDfwrite(&mem[i], sizeof(char), 1, stream)) H5E_THROW(FAIL, H5E_tools_min_id_g, "fwrite failed"); #endif } /*i*/ @@ -4030,14 +1485,15 @@ CATCH * *------------------------------------------------------------------------- */ -static int +int render_bin_output_region_data_blocks(hid_t region_id, FILE *stream, hid_t container, int ndims, hid_t type_id, hssize_t nblocks, hsize_t *ptdata) { hsize_t *dims1 = NULL; hsize_t *start = NULL; hsize_t *count = NULL; - size_t numelem; + hsize_t numelem; + hsize_t numindex; hsize_t total_size[H5S_MAX_RANK]; int jndx; int type_size; @@ -4095,10 +1551,10 @@ render_bin_output_region_data_blocks(hid_t region_id, FILE *stream, if(H5Sget_simple_extent_dims(mem_space, total_size, NULL) < 0) HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Sget_simple_extent_dims failed"); - for (jndx = 0; jndx < numelem; jndx++) { + for (numindex = 0; numindex < numelem; numindex++) { render_bin_output(stream, container, type_id, - ((char*)region_buf + jndx * type_size)); + ((char*)region_buf + numindex * type_size)); /* Render the region data element end */ } /* end for (jndx = 0; jndx < numelem; jndx++) */ } /* end for (blkndx = 0; blkndx < nblocks; blkndx++) */ @@ -4130,7 +1586,7 @@ render_bin_output_region_data_blocks(hid_t region_id, FILE *stream, * *------------------------------------------------------------------------- */ -static hbool_t +hbool_t render_bin_output_region_blocks(hid_t region_space, hid_t region_id, FILE *stream, hid_t container) { @@ -4150,8 +1606,8 @@ render_bin_output_region_blocks(hid_t region_space, hid_t region_id, H5E_THROW(FALSE, H5E_tools_min_id_g, "H5Sget_simple_extent_ndims failed"); alloc_size = nblocks * ndims * 2 * sizeof(ptdata[0]); - assert(alloc_size == (hsize_t) ((size_t) alloc_size)); /*check for overflow*/ - if((ptdata = (hsize_t*) malloc((size_t) alloc_size)) == NULL) + HDassert(alloc_size == (hsize_t) ((size_t) alloc_size)); /*check for overflow*/ + if((ptdata = (hsize_t*) HDmalloc((size_t) alloc_size)) == NULL) HGOTO_ERROR(FALSE, H5E_tools_min_id_g, "Could not allocate buffer for ptdata"); H5_CHECK_OVERFLOW(nblocks, hssize_t, hsize_t); @@ -4167,7 +1623,7 @@ render_bin_output_region_blocks(hid_t region_space, hid_t region_id, type_id, nblocks, ptdata); done: - free(ptdata); + HDfree(ptdata); if(H5Tclose(type_id) < 0) HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tclose failed"); @@ -4231,8 +1687,7 @@ render_bin_output_region_data_points(hid_t region_space, hid_t region_id, if(H5Sget_simple_extent_dims(region_space, dims1, NULL) < 0) HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Sget_simple_extent_dims failed"); - render_bin_output(stream, container, type_id, - ((char*)region_buf + jndx * type_size)); + render_bin_output(stream, container, type_id, ((char*)region_buf + jndx * type_size)); } /* end for (jndx = 0; jndx < npoints; jndx++) */ done: @@ -4258,7 +1713,7 @@ render_bin_output_region_data_points(hid_t region_space, hid_t region_id, * *------------------------------------------------------------------------- */ -static hbool_t +hbool_t render_bin_output_region_points(hid_t region_space, hid_t region_id, FILE *stream, hid_t container) { @@ -4278,7 +1733,7 @@ render_bin_output_region_points(hid_t region_space, hid_t region_id, H5E_THROW(FALSE, H5E_tools_min_id_g, "H5Sget_simple_extent_ndims failed"); alloc_size = npoints * ndims * sizeof(ptdata[0]); - assert(alloc_size == (hsize_t) ((size_t) alloc_size)); /*check for overflow*/ + HDassert(alloc_size == (hsize_t) ((size_t) alloc_size)); /*check for overflow*/ if(NULL == (ptdata = (hsize_t *)HDmalloc((size_t) alloc_size))) HGOTO_ERROR(FALSE, H5E_tools_min_id_g, "Could not allocate buffer for ptdata"); @@ -4296,7 +1751,7 @@ render_bin_output_region_points(hid_t region_space, hid_t region_id, stream, container, ndims, type_id, npoints, ptdata); done: - free(ptdata); + HDfree(ptdata); if(H5Tclose(type_id) < 0) HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tclose failed"); @@ -4317,8 +1772,8 @@ CATCH * Return: TRUE if all bytes are zero; FALSE otherwise *------------------------------------------------------------------------- */ -static -hbool_t h5tools_is_zero(const void *_mem, size_t size) +hbool_t +h5tools_is_zero(const void *_mem, size_t size) { const unsigned char *mem = (const unsigned char *) _mem; @@ -4329,3 +1784,46 @@ hbool_t h5tools_is_zero(const void *_mem, size_t size) return TRUE; } +/*------------------------------------------------------------------------- + * Function: h5tools_is_obj_same + * + * Purpose: Check if two given object IDs or link names point to the same object. + * + * Parameters: + * hid_t loc_id1: location of the first object + * char *name1: link name of the first object. + * Use "." or NULL if loc_id1 is the object to be compared. + * hid_t loc_id2: location of the second object + * char *name1: link name of the first object. + * Use "." or NULL if loc_id2 is the object to be compared. + * + * Return: TRUE if it is the same object; FALSE otherwise. + * + * Programmer: Peter Cao + * 4/27/2011 + * + *------------------------------------------------------------------------- + */ +hbool_t +h5tools_is_obj_same(hid_t loc_id1, const char *name1, + hid_t loc_id2, const char *name2) +{ + H5O_info_t oinfo1, oinfo2; + hbool_t ret_val = 0; + + if ( name1 && HDstrcmp(name1, ".")) + H5Oget_info_by_name(loc_id1, name1, &oinfo1, H5P_DEFAULT); + else + H5Oget_info(loc_id1, &oinfo1); + + if ( name2 && HDstrcmp(name2, ".")) + H5Oget_info_by_name(loc_id2, name2, &oinfo2, H5P_DEFAULT); + else + H5Oget_info(loc_id2, &oinfo2); + + if (oinfo1.fileno == oinfo2.fileno && oinfo1.addr==oinfo2.addr) + ret_val = 1; + + return ret_val; +} + diff --git a/tools/lib/h5tools.h b/tools/lib/h5tools.h index baec893..83484db 100644 --- a/tools/lib/h5tools.h +++ b/tools/lib/h5tools.h @@ -31,23 +31,6 @@ #define START_OF_DATA 0x0001 #define END_OF_DATA 0x0002 -/* - * The output functions need a temporary buffer to hold a piece of the - * dataset while it's being printed. This constant sets the limit on the - * size of that temporary buffer in bytes. For efficiency's sake, choose the - * largest value suitable for your machine (for testing use a small value). - */ -#if 1 -#define H5TOOLS_BUFSIZE (1024 * 1024) -#else -#define H5TOOLS_BUFSIZE (1024) -#endif - -/* - * Maximum size used in a call to malloc - */ -#define H5TOOLS_MALLOCSIZE (128 * 1024 * 1024) - /* format for hsize_t */ #define HSIZE_T_FORMAT "%"H5_PRINTF_LL_WIDTH"u" @@ -101,6 +84,9 @@ #define EXTERNAL_FILE "EXTERNAL_FILE" #define FILLVALUE "FILLVALUE" #define FILE_CONTENTS "FILE_CONTENTS" +#define PACKED_BITS "PACKED_BITS" +#define PACKED_OFFSET "OFFSET" +#define PACKED_LENGTH "LENGTH" #define BEGIN "{" #define END "}" @@ -341,6 +327,7 @@ typedef struct h5tool_format_t { const char *cmpd_end; const struct H5LD_memb_t **cmpd_listv; + /* * Fields associated with vlen data types. * @@ -534,14 +521,27 @@ struct subset_t { #include "h5tools_str.h" +H5TOOLS_DLLVAR h5tool_format_t h5tools_dataformat; +H5TOOLS_DLLVAR const h5tools_dump_header_t h5tools_standardformat; +H5TOOLS_DLLVAR const h5tools_dump_header_t* h5tools_dump_header_format; + #ifdef __cplusplus extern "C" { #endif +H5TOOLS_DLLVAR int packed_bits_num; /* number of packed bits to display */ +H5TOOLS_DLLVAR int packed_data_offset; /* offset of packed bits to display */ +H5TOOLS_DLLVAR int packed_data_length; /* lengtht of packed bits to display */ +H5TOOLS_DLLVAR unsigned long long packed_data_mask; /* mask in which packed bits to display */ H5TOOLS_DLLVAR FILE *rawdatastream; /* output stream for raw data */ +H5TOOLS_DLLVAR FILE *rawoutstream; /* output stream for raw output */ +H5TOOLS_DLLVAR FILE *rawerrorstream; /* output stream for raw error */ H5TOOLS_DLLVAR int bin_output; /* binary output */ H5TOOLS_DLLVAR int bin_form; /* binary form */ H5TOOLS_DLLVAR int region_output; /* region output */ +H5TOOLS_DLLVAR int oid_output; /* oid output */ +H5TOOLS_DLLVAR int data_output; /* data output */ +H5TOOLS_DLLVAR int attr_data_output; /* attribute data output */ /* Strings for output */ #define H5_TOOLS_GROUP "GROUP" @@ -549,40 +549,45 @@ H5TOOLS_DLLVAR int region_output; /* region output */ #define H5_TOOLS_DATATYPE "DATATYPE" /* Definitions of useful routines */ -H5TOOLS_DLL void h5tools_init(void); -H5TOOLS_DLL void h5tools_close(void); -H5TOOLS_DLL hid_t h5tools_fopen(const char *fname, unsigned flags, hid_t fapl, - const char *driver, char *drivername, size_t drivername_len); -H5TOOLS_DLL int h5tools_dump_dset(FILE *stream, const h5tool_format_t *info, hid_t dset, - hid_t p_typ, struct subset_t *sset, int indentlevel); -H5TOOLS_DLL int h5tools_dump_mem(FILE *stream, const h5tool_format_t *info, hid_t obj_id, - hid_t type, hid_t space, void *mem, int indentlevel); -H5TOOLS_DLL hid_t h5tools_get_native_type(hid_t type); -H5TOOLS_DLL hid_t h5tools_get_little_endian_type(hid_t type); -H5TOOLS_DLL hid_t h5tools_get_big_endian_type(hid_t type); - -H5TOOLS_DLL htri_t h5tools_detect_vlen(hid_t tid); -H5TOOLS_DLL htri_t h5tools_detect_vlen_str(hid_t tid); - -H5TOOLS_DLL void h5tools_dump_simple_data(FILE *stream, const h5tool_format_t *info, hid_t container, - h5tools_context_t *ctx/*in,out*/, unsigned flags, - hsize_t nelmts, hid_t type, void *_mem); - -H5TOOLS_DLL int h5tools_canreadf(const char* name, - hid_t dcpl_id); -H5TOOLS_DLL int h5tools_can_encode(H5Z_filter_t filtn); - -void init_acc_pos(h5tools_context_t *ctx, hsize_t *dims); -/* - * new functions needed to display region reference data - */ -void h5tools_dump_datatype(FILE *stream, const h5tool_format_t *info, - h5tools_context_t *ctx/*in,out*/, hid_t type); -int h5tools_print_dataspace(h5tools_str_t *buffer/*in,out*/, hid_t space); -int h5tools_print_datatype(h5tools_str_t *buffer/*in,out*/, - const h5tool_format_t *info, h5tools_context_t *ctx/*in,out*/, - hid_t type); -int h5tools_print_enum(h5tools_str_t *buffer/*in,out*/, hid_t type); +H5TOOLS_DLL void h5tools_init(void); +H5TOOLS_DLL void h5tools_close(void); +H5TOOLS_DLL hid_t h5tools_fopen(const char *fname, unsigned flags, hid_t fapl, + const char *driver, char *drivername, size_t drivername_len); +H5TOOLS_DLL hid_t h5tools_get_native_type(hid_t type); +H5TOOLS_DLL hid_t h5tools_get_little_endian_type(hid_t type); +H5TOOLS_DLL hid_t h5tools_get_big_endian_type(hid_t type); +H5TOOLS_DLL htri_t h5tools_detect_vlen(hid_t tid); +H5TOOLS_DLL htri_t h5tools_detect_vlen_str(hid_t tid); +H5TOOLS_DLL hbool_t h5tools_is_obj_same(hid_t loc_id1, const char *name1, hid_t loc_id2, const char *name2); +H5TOOLS_DLL void init_acc_pos(h5tools_context_t *ctx, hsize_t *dims); +H5TOOLS_DLL hbool_t h5tools_is_zero(const void *_mem, size_t size); +H5TOOLS_DLL int h5tools_canreadf(const char* name, hid_t dcpl_id); +H5TOOLS_DLL int h5tools_can_encode(H5Z_filter_t filtn); + +H5TOOLS_DLL void h5tools_simple_prefix(FILE *stream, const h5tool_format_t *info, + h5tools_context_t *ctx, hsize_t elmtno, int secnum); +H5TOOLS_DLL void h5tools_region_simple_prefix(FILE *stream, const h5tool_format_t *info, + h5tools_context_t *ctx, hsize_t elmtno, hsize_t *ptdata, int secnum); + +H5TOOLS_DLL int do_bin_output(FILE *stream, FILE *err_stream, hid_t container, hsize_t nelmts, hid_t tid, void *_mem); +H5TOOLS_DLL int render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem); +H5TOOLS_DLL int render_bin_output_region_data_blocks(hid_t region_id, FILE *stream, + hid_t container, int ndims, hid_t type_id, hssize_t nblocks, hsize_t *ptdata); +H5TOOLS_DLL hbool_t render_bin_output_region_blocks(hid_t region_space, hid_t region_id, + FILE *stream, hid_t container); +H5TOOLS_DLL hbool_t render_bin_output_region_points(hid_t region_space, hid_t region_id, + FILE *stream, hid_t container); + +H5TOOLS_DLL hbool_t h5tools_render_element(FILE *stream, const h5tool_format_t *info, + h5tools_context_t *ctx, h5tools_str_t *buffer, hsize_t *curr_pos, + size_t ncols, hsize_t local_elmt_counter, hsize_t elmt_counter); +H5TOOLS_DLL hbool_t h5tools_render_region_element(FILE *stream, const h5tool_format_t *info, + h5tools_context_t *ctx/*in,out*/, + h5tools_str_t *buffer/*string into which to render */, + hsize_t *curr_pos/*total data element position*/, + size_t ncols, hsize_t *ptdata, + hsize_t local_elmt_counter/*element counter*/, + hsize_t elmt_counter); #ifdef __cplusplus } diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c new file mode 100644 index 0000000..b54ed6a --- /dev/null +++ b/tools/lib/h5tools_dump.c @@ -0,0 +1,3919 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Programmer: Robb Matzke + * Thursday, July 23, 1998 + * + * Purpose: A library for displaying the values of a dataset in a human + * readable format. + */ + +#include +#include + +#include "h5tools.h" +#include "h5tools_dump.h" +#include "h5tools_ref.h" +#include "h5tools_utils.h" +#include "H5private.h" + +#define SANITY_CHECK + +#define ALIGN(A,Z) ((((A) + (Z) - 1) / (Z)) * (Z)) + +h5tool_format_t h5tools_dataformat = { +0, /*raw */ + +"", /*fmt_raw */ +"%d", /*fmt_int */ +"%u", /*fmt_uint */ +"%hhd", /*fmt_schar */ +"%u", /*fmt_uchar */ +"%d", /*fmt_short */ +"%u", /*fmt_ushort */ +"%ld", /*fmt_long */ +"%lu", /*fmt_ulong */ +NULL, /*fmt_llong */ +NULL, /*fmt_ullong */ +"%g", /*fmt_double */ +"%g", /*fmt_float */ + +0, /*ascii */ +0, /*str_locale */ +0, /*str_repeat */ + +"[ ", /*arr_pre */ +",", /*arr_sep */ +" ]", /*arr_suf */ +1, /*arr_linebreak */ + +"", /*cmpd_name */ +",\n", /*cmpd_sep */ +"{", /*cmpd_pre */ +"}", /*cmpd_suf */ +"\n", /*cmpd_end */ +NULL, /* cmpd_listv */ + +", ", /*vlen_sep */ +"(", /*vlen_pre */ +")", /*vlen_suf */ +"", /*vlen_end */ + +"%s", /*elmt_fmt */ +",", /*elmt_suf1 */ +" ", /*elmt_suf2 */ + +"", /*idx_n_fmt */ +"", /*idx_sep */ +"", /*idx_fmt */ + +80, /*line_ncols *//*standard default columns */ +0, /*line_per_line */ +"", /*line_pre */ +"%s", /*line_1st */ +"%s", /*line_cont */ +"", /*line_suf */ +"", /*line_sep */ +1, /*line_multi_new */ +" ", /*line_indent */ + +1, /*skip_first */ + +1, /*obj_hidefileno */ +" "H5_PRINTF_HADDR_FMT, /*obj_format */ + +1, /*dset_hidefileno */ +"DATASET %s ", /*dset_format */ +"%s", /*dset_blockformat_pre */ +"%s", /*dset_ptformat_pre */ +"%s", /*dset_ptformat */ +1, /*array indices */ +1 /*escape non printable characters */ +}; + +const h5tools_dump_header_t h5tools_standardformat = { +"standardformat", /*name */ +"HDF5", /*fileebgin */ +"", /*fileend */ +SUPER_BLOCK, /*bootblockbegin */ +"", /*bootblockend */ +H5_TOOLS_GROUP, /*groupbegin */ +"", /*groupend */ +H5_TOOLS_DATASET, /*datasetbegin */ +"", /*datasetend */ +ATTRIBUTE, /*attributebegin */ +"", /*attributeend */ +H5_TOOLS_DATATYPE, /*datatypebegin */ +"", /*datatypeend */ +DATASPACE, /*dataspacebegin */ +"", /*dataspaceend */ +DATA, /*databegin */ +"", /*dataend */ +SOFTLINK, /*softlinkbegin */ +"", /*softlinkend */ +EXTLINK, /*extlinkbegin */ +"", /*extlinkend */ +UDLINK, /*udlinkbegin */ +"", /*udlinkend */ +SUBSET, /*subsettingbegin */ +"", /*subsettingend */ +START, /*startbegin */ +"", /*startend */ +STRIDE, /*stridebegin */ +"", /*strideend */ +COUNT, /*countbegin */ +"", /*countend */ +BLOCK, /*blockbegin */ +"", /*blockend */ + +"{", /*fileblockbegin */ +"}", /*fileblockend */ +"{", /*bootblockblockbegin */ +"}", /*bootblockblockend */ +"{", /*groupblockbegin */ +"}", /*groupblockend */ +"{", /*datasetblockbegin */ +"}", /*datasetblockend */ +"{", /*attributeblockbegin */ +"}", /*attributeblockend */ +"", /*datatypeblockbegin */ +"", /*datatypeblockend */ +"", /*dataspaceblockbegin */ +"", /*dataspaceblockend */ +"{", /*datablockbegin */ +"}", /*datablockend */ +"{", /*softlinkblockbegin */ +"}", /*softlinkblockend */ +"{", /*extlinkblockbegin */ +"}", /*extlinkblockend */ +"{", /*udlinkblockbegin */ +"}", /*udlinkblockend */ +"{", /*strblockbegin */ +"}", /*strblockend */ +"{", /*enumblockbegin */ +"}", /*enumblockend */ +"{", /*structblockbegin */ +"}", /*structblockend */ +"{", /*vlenblockbegin */ +"}", /*vlenblockend */ +"{", /*subsettingblockbegin */ +"}", /*subsettingblockend */ +"(", /*startblockbegin */ +");", /*startblockend */ +"(", /*strideblockbegin */ +");", /*strideblockend */ +"(", /*countblockbegin */ +");", /*countblockend */ +"(", /*blockblockbegin */ +");", /*blockblockend */ + +"", /*dataspacedescriptionbegin */ +"", /*dataspacedescriptionend */ +"(", /*dataspacedimbegin */ +")", /*dataspacedimend */ +}; + +const h5tools_dump_header_t* h5tools_dump_header_format; +table_t *h5dump_type_table = NULL; /*type table reference for datatype dump */ + +/* local prototypes */ +static int h5tools_print_region_data_blocks(hid_t region_id, + FILE *stream, const h5tool_format_t *info, h5tools_context_t *cur_ctx, + h5tools_str_t *buffer/*string into which to render */, size_t ncols, + int ndims, hid_t type_id, hssize_t nblocks, hsize_t *ptdata); + +hbool_t h5tools_dump_region_data_points(hid_t region_space, hid_t region_id, + FILE *stream, const h5tool_format_t *info, + h5tools_context_t *ctx/*in,out*/, + h5tools_str_t *buffer/*string into which to render */, + hsize_t *curr_pos/*total data element position*/, + size_t ncols, hsize_t region_elmt_counter/*element counter*/, + hsize_t elmt_counter); + +int h5tools_print_region_data_points(hid_t region_space, hid_t region_id, + FILE *stream, const h5tool_format_t *info, h5tools_context_t *cur_ctx, + h5tools_str_t *buffer, size_t ncols, + int ndims, hid_t type_id, hssize_t npoints, hsize_t *ptdata); + +hbool_t h5tools_dump_region_data_blocks(hid_t region_space, hid_t region_id, + FILE *stream, const h5tool_format_t *info, + h5tools_context_t *ctx/*in,out*/, + h5tools_str_t *buffer/*string into which to render */, + hsize_t *curr_pos/*total data element position*/, + size_t ncols, hsize_t region_elmt_counter/*element counter*/, + hsize_t elmt_counter); +void +h5tools_dump_init(void) +{ + h5tools_dump_header_format = &h5tools_standardformat; +} + +/*------------------------------------------------------------------------- + * Audience: Public + * Chapter: H5Tools Library + * Purpose: Prints NELMTS data elements to output STREAM. + * Description: + * Prints some (NELMTS) data elements to output STREAM. The elements are + * stored in _MEM as type TYPE and are printed according to the format + * described in INFO. The CTX struct contains context information shared + * between calls to this function. The FLAGS is a bit field that + * indicates whether the data supplied in this call falls at the + * beginning or end of the total data to be printed (START_OF_DATA and + * END_OF_DATA). + * Return: Success: SUCCEED + * Failure: FAIL + * Programmer: + * Robb Matzke, Monday, April 26, 1999 + * Modifications: + * Robb Matzke, 1999-06-04 + * The `container' argument is the optional dataset for reference types. + * + * Robb Matzke, 1999-09-29 + * Understands the `per_line' property which indicates that every Nth + * element should begin a new line. + * + * Robb Matzke, LLNL, 2003-06-05 + * Do not dereference the memory for a variable-length string here. + * Deref in h5tools_str_sprint() instead so recursive types are + * handled correctly. + * + * Pedro Vicente Nunes, The HDF Group, 2005-10-19 + * pass to the prefix in h5tools_simple_prefix the total position + * instead of the current stripmine position i; this is necessary + * to print the array indices + * new field sm_pos in h5tools_context_t, the current stripmine element position + *------------------------------------------------------------------------- + */ +int +h5tools_dump_simple_data(FILE *stream, const h5tool_format_t *info, hid_t container, + h5tools_context_t *ctx/*in,out*/, unsigned flags, + hsize_t nelmts, hid_t type, void *_mem) +{ + HERR_INIT(int, SUCCEED) + unsigned char *mem = (unsigned char*) _mem; + hsize_t i; /*element counter */ + size_t size; /*size of each datum */ + hid_t region_space = -1; + hid_t region_id = -1; + hbool_t dimension_break = TRUE; + H5S_sel_type region_type; + size_t ncols = 80; /*available output width */ + h5tools_str_t buffer; /*string into which to render */ + hsize_t curr_pos = 0; /* total data element position */ + hsize_t elmt_counter = 0;/*counts the # elements printed. + *I (ptl?) needed something that + *isn't going to get reset when a new + *line is formed. I'm going to use + *this var to count elements and + *break after we see a number equal + *to the ctx->size_last_dim. */ + + /* binary dump */ + if (bin_output) { + do_bin_output(rawdatastream, rawoutstream, container, nelmts, type, _mem); + } /* end if */ + else { + /* setup */ + HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + size = H5Tget_size(type); + + if (info->line_ncols > 0) + ncols = info->line_ncols; + + /* pass to the prefix in h5tools_simple_prefix the total position + * instead of the current stripmine position i; this is necessary + * to print the array indices + */ + curr_pos = ctx->sm_pos; + + if (region_output && H5Tequal(type, H5T_STD_REF_DSETREG)) { + for (i = 0; i < nelmts; i++, ctx->cur_elmt++, elmt_counter++) { + void* memref = mem + i * size; + char ref_name[1024]; + + /* region data */ + region_id = H5Rdereference2(container, H5P_DEFAULT, H5R_DATASET_REGION, memref); + if (region_id >= 0) { + region_space = H5Rget_region(container, H5R_DATASET_REGION, memref); + if (region_space >= 0) { + if (h5tools_is_zero(memref, H5Tget_size(type))) { + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); + + /* Render the region element begin */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "NULL"); + + dimension_break = h5tools_render_element(stream, info, + ctx, &buffer, &curr_pos, ncols, i, elmt_counter); + } + else { + if(H5Rget_name(region_id, H5R_DATASET_REGION, memref, (char*) ref_name, 1024)<0) + HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Rget_name failed"); + + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, curr_pos+i, 0); + + /* Render the region element begin */ + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, info->dset_format, ref_name); + + dimension_break = h5tools_render_element(stream, info, + ctx, &buffer, &curr_pos, ncols, i, elmt_counter); + + region_type = H5Sget_select_type(region_space); + if(region_type == H5S_SEL_POINTS) + /* Print point information */ + dimension_break = h5tools_dump_region_data_points( + region_space, region_id, stream, info, ctx, + &buffer, &curr_pos, ncols, i, elmt_counter); + else if(region_type == H5S_SEL_HYPERSLABS) + /* Print block information */ + dimension_break = h5tools_dump_region_data_blocks( + region_space, region_id, stream, info, ctx, + &buffer, &curr_pos, ncols, i, elmt_counter); + else + HERROR(H5E_tools_g, H5E_tools_min_id_g, "invalid region type"); + /* Render the region element end */ + + } /* end else to if (h5tools_is_zero(... */ + if(H5Sclose(region_space) < 0) + HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Sclose failed"); + } /* end if (region_space >= 0) */ + else + HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Rget_region failed"); + if(H5Dclose(region_id) < 0) + HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Dclose failed"); + + } /* if (region_id >= 0) */ + else { + /* if (region_id < 0) - could mean that no reference was written do not throw failure */ + H5Epush2(H5tools_ERR_STACK_g, __FILE__, FUNC, __LINE__, H5tools_ERR_CLS_g, H5E_tools_g, H5E_tools_min_id_g, "H5Rdereference failed"); + } + + ctx->need_prefix = TRUE; + + if(FALSE == dimension_break) + elmt_counter = 0; + } /* end for (i = 0; i < nelmts... */ + } /* end if (region_output... */ + else { + for (i = 0; i < nelmts; i++, ctx->cur_elmt++, elmt_counter++) { + void* memref = mem + i * size; + /* Render the data element begin*/ + h5tools_str_reset(&buffer); + h5tools_str_sprint(&buffer, info, container, type, memref, ctx); + + if (i + 1 < nelmts || (flags & END_OF_DATA) == 0) + h5tools_str_append(&buffer, "%s", OPT(info->elmt_suf1, ",")); + + dimension_break = h5tools_render_element(stream, info, ctx, &buffer, + &curr_pos, ncols, i, elmt_counter); + /* Render the data element end*/ + if(FALSE == dimension_break) + elmt_counter = 0; + } /* end for (i = 0; i < nelmts... */ + } + + h5tools_str_close(&buffer); + }/* else bin */ + +CATCH + return ret_value; +} + +/*------------------------------------------------------------------------- + * Audience: Public + * Chapter: H5Tools Library + * Purpose: Print the data values from a dataset referenced by region blocks. + * + * Description: + * This is a special case subfunction to print the data in a region reference of type blocks. + * + * Return: + * The function returns FAIL if there was an error, otherwise SUCEED + * + * Parameters Description: + * h5tools_str_t *buffer is the string into which to render + * size_t ncols + * int ndims is the number of dimensions of the region element + * hssize_t nblocks is the number of blocks in the region + *------------------------------------------------------------------------- + */ +static int +h5tools_print_region_data_blocks(hid_t region_id, + FILE *stream, const h5tool_format_t *info, h5tools_context_t *cur_ctx, + h5tools_str_t *buffer/*string into which to render */, size_t ncols, + int ndims, hid_t type_id, hssize_t nblocks, hsize_t *ptdata) +{ + hbool_t dimension_break = TRUE; + hsize_t *dims1 = NULL; + hsize_t *start = NULL; + hsize_t *count = NULL; + hsize_t blkndx; + hsize_t total_size[H5S_MAX_RANK]; + hsize_t elmtno; /* elemnt index */ + hsize_t curr_pos = 0; + unsigned int region_flags; /* buffer extent flags */ + hsize_t numelem; + hsize_t numindex; + size_t jndx; + int indx; + int type_size; + int ret_value = SUCCEED; + hid_t mem_space = -1; + hid_t sid1 = -1; + h5tools_context_t ctx; + void *region_buf = NULL; + + HDassert(info); + HDassert(cur_ctx); + HDassert(buffer); + HDassert(ptdata); + + HDmemset(&ctx, 0, sizeof(ctx)); + /* Get the dataspace of the dataset */ + if((sid1 = H5Dget_space(region_id)) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_space failed"); + + /* Allocate space for the dimension array */ + if((dims1 = (hsize_t *) HDmalloc(sizeof(hsize_t) * ndims)) == NULL) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Could not allocate buffer for dims"); + + /* find the dimensions of each data space from the block coordinates */ + numelem = 1; + for (jndx = 0; jndx < ndims; jndx++) { + dims1[jndx] = ptdata[jndx + ndims] - ptdata[jndx] + 1; + numelem = dims1[jndx] * numelem; + } + + /* Create dataspace for reading buffer */ + if((mem_space = H5Screate_simple(ndims, dims1, NULL)) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Screate_simple failed"); + + if((type_size = H5Tget_size(type_id)) == 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_size failed"); + + if((region_buf = HDmalloc(type_size * numelem)) == NULL) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Could not allocate region buffer"); + + /* Select (x , x , ..., x ) x (y , y , ..., y ) hyperslab for reading memory dataset */ + /* 1 2 n 1 2 n */ + if((start = (hsize_t *) HDmalloc(sizeof(hsize_t) * ndims)) == NULL) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Could not allocate buffer for start"); + + if((count = (hsize_t *) HDmalloc(sizeof(hsize_t) * ndims)) == NULL) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Could not allocate buffer for count"); + + curr_pos = 0; + ctx.indent_level = cur_ctx->indent_level; + ctx.cur_column = cur_ctx->cur_column; + ctx.prev_multiline = cur_ctx->prev_multiline; + ctx.ndims = ndims; + for (blkndx = 0; blkndx < nblocks; blkndx++) { + ctx.need_prefix = TRUE; + ctx.cur_elmt = 0; + for (indx = 0; indx < ndims; indx++) { + start[indx] = ptdata[indx + blkndx * ndims * 2]; + count[indx] = dims1[indx]; + } + + if(H5Sselect_hyperslab(sid1, H5S_SELECT_SET, start, NULL, count, NULL) < 0) + HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Sselect_hyperslab failed"); + + if(H5Dread(region_id, type_id, mem_space, sid1, H5P_DEFAULT, region_buf) < 0) + HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Dread failed"); + + ctx.indent_level++; + if(H5Sget_simple_extent_dims(mem_space, total_size, NULL) < 0) + HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Sget_simple_extent_dims failed"); + + /* assume entire data space to be printed */ + for (indx = 0; indx < (size_t) ctx.ndims; indx++) + ctx.p_min_idx[indx] = start[indx]; + init_acc_pos(&ctx, total_size); + + /* print the data */ + region_flags = START_OF_DATA; + if (blkndx == nblocks - 1) + region_flags |= END_OF_DATA; + + for (indx = 0; indx < (size_t)ctx.ndims; indx++) + ctx.p_max_idx[indx] = dims1[indx]; + + curr_pos = 0; + ctx.sm_pos = blkndx*2*ndims; + ctx.size_last_dim = dims1[ndims-1]; + + h5tools_region_simple_prefix(stream, info, &ctx, curr_pos, ptdata, 0); + + elmtno = 0; + for (numindex = 0; numindex < numelem; numindex++, elmtno++, ctx.cur_elmt++) { + /* Render the region data element begin */ + h5tools_str_reset(buffer); + + h5tools_str_append(buffer, "%s", numindex ? OPTIONAL_LINE_BREAK "" : ""); + h5tools_str_sprint(buffer, info, region_id, type_id, + ((char*)region_buf + numindex * type_size), &ctx); + + if (numindex + 1 < numelem || (region_flags & END_OF_DATA) == 0) + h5tools_str_append(buffer, "%s", OPT(info->elmt_suf1, ",")); + + dimension_break = h5tools_render_region_element(stream, info, &ctx, buffer, &curr_pos, + ncols, ptdata, numindex, elmtno); + /* Render the region data element end */ + + if(FALSE == dimension_break) + elmtno = 0; + } /* end for (jndx = 0; jndx < numelem; jndx++, region_elmtno++, ctx.cur_elmt++) */ + + ctx.indent_level--; + } /* end for (blkndx = 0; blkndx < nblocks; blkndx++) */ + + done: + HDfree(start); + HDfree(count); + HDfree(region_buf); + HDfree(dims1); + + if(H5Sclose(mem_space) < 0) + HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Sclose failed"); + if(H5Sclose(sid1) < 0) + HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Sclose failed"); + + return ret_value; +} + +/*------------------------------------------------------------------------- + * Audience: Public + * Chapter: H5Tools Library + * Purpose: Print some values from a dataset referenced by region blocks. + * + * Description: + * This is a special case subfunction to dump a region reference using blocks. + * + * Return: + * The function returns False if the last dimension has been reached, otherwise True + * + * In/Out: + * h5tools_context_t *ctx + * hsize_t *curr_pos + * + * Parameters Description: + * h5tools_str_t *buffer is the string into which to render + * hsize_t curr_pos is the total data element position + * size_t ncols + * hsize_t region_elmt_counter is the region element loop counter + * hsize_t elmt_count is the data element loop counter + *------------------------------------------------------------------------- + */ +hbool_t +h5tools_dump_region_data_blocks(hid_t region_space, hid_t region_id, + FILE *stream, const h5tool_format_t *info, + h5tools_context_t *ctx/*in,out*/, + h5tools_str_t *buffer/*string into which to render */, + hsize_t *curr_pos/*total data element position*/, + size_t ncols, hsize_t region_elmt_counter/*element counter*/, + hsize_t elmt_counter) +{ + HERR_INIT(hbool_t, TRUE) + hbool_t dimension_break = TRUE; + hssize_t nblocks; + hsize_t alloc_size; + hsize_t *ptdata = NULL; + int ndims; + hid_t dtype = -1; + hid_t type_id = -1; + int i; + + HDassert(info); + HDassert(ctx); + HDassert(buffer); + + if((nblocks = H5Sget_select_hyper_nblocks(region_space)) <= 0) + H5E_THROW(dimension_break, H5E_tools_min_id_g, "H5Sget_select_hyper_nblocks failed"); + + /* Print block information */ + if((ndims = H5Sget_simple_extent_ndims(region_space)) < 0) + H5E_THROW(dimension_break, H5E_tools_min_id_g, "H5Sget_simple_extent_ndims failed"); + + /* Render the region { element begin */ + h5tools_str_reset(buffer); + + h5tools_str_append(buffer, "{"); + dimension_break = h5tools_render_element(stream, info, ctx, buffer, curr_pos, ncols, region_elmt_counter, elmt_counter); + /* Render the region { element end */ + + ctx->indent_level++; + ctx->need_prefix = TRUE; + + /* Render the region datatype info and indices element begin */ + h5tools_str_reset(buffer); + h5tools_str_append(buffer, "REGION_TYPE BLOCK "); + + alloc_size = nblocks * ndims * 2 * sizeof(ptdata[0]); + HDassert(alloc_size == (hsize_t) ((size_t) alloc_size)); /*check for overflow*/ + if((ptdata = (hsize_t*) HDmalloc((size_t) alloc_size)) == NULL) + HGOTO_ERROR(dimension_break, H5E_tools_min_id_g, "Could not allocate buffer for ptdata"); + + H5_CHECK_OVERFLOW(nblocks, hssize_t, hsize_t); + if(H5Sget_select_hyper_blocklist(region_space, (hsize_t) 0, (hsize_t) nblocks, ptdata) < 0) + HGOTO_ERROR(dimension_break, H5E_tools_min_id_g, "H5Rget_select_hyper_blocklist failed"); + + for (i = 0; i < nblocks; i++) { + int j; + + h5tools_str_append(buffer, info->dset_blockformat_pre, + i ? "," OPTIONAL_LINE_BREAK " " : "", (unsigned long) i); + + /* Start coordinates and opposite corner */ + for (j = 0; j < ndims; j++) + h5tools_str_append(buffer, "%s" HSIZE_T_FORMAT, j ? "," : "(", + ptdata[i * 2 * ndims + j]); + + for (j = 0; j < ndims; j++) + h5tools_str_append(buffer, "%s" HSIZE_T_FORMAT, j ? "," : ")-(", + ptdata[i * 2 * ndims + j + ndims]); + + h5tools_str_append(buffer, ")"); + } /* end for (i = 0; i < nblocks; i++) */ + + dimension_break = h5tools_render_element(stream, info, ctx, buffer, curr_pos, ncols, region_elmt_counter, elmt_counter); + /* Render the region datatype info and indices element end */ + + ctx->need_prefix = TRUE; + + if((dtype = H5Dget_type(region_id)) < 0) + HGOTO_ERROR(dimension_break, H5E_tools_min_id_g, "H5Dget_type failed"); + if((type_id = H5Tget_native_type(dtype, H5T_DIR_DEFAULT)) < 0) + HGOTO_ERROR(dimension_break, H5E_tools_min_id_g, "H5Tget_native_type failed"); + + /* Render the datatype element begin */ + h5tools_str_reset(buffer); + h5tools_str_append(buffer, "%s %s ", + h5tools_dump_header_format->datatypebegin, + h5tools_dump_header_format->datatypeblockbegin); + + ctx->indent_level++; + h5tools_print_datatype(stream, buffer, info, ctx, dtype, TRUE); + ctx->indent_level--; + + if (HDstrlen(h5tools_dump_header_format->datatypeblockend)) { + h5tools_str_append(buffer, "%s", h5tools_dump_header_format->datatypeblockend); + if (HDstrlen(h5tools_dump_header_format->datatypeend)) + h5tools_str_append(buffer, " "); + } + if (HDstrlen(h5tools_dump_header_format->datatypeend)) + h5tools_str_append(buffer, "%s", h5tools_dump_header_format->datatypeend); + + dimension_break = h5tools_render_element(stream, info, ctx, buffer, curr_pos, ncols, region_elmt_counter, elmt_counter); + /* Render the datatype element end */ + + ctx->need_prefix = TRUE; + + /* Render the dataspace element begin */ + h5tools_str_reset(buffer); + h5tools_str_append(buffer, "%s ", h5tools_dump_header_format->dataspacebegin); + + h5tools_print_dataspace(stream, buffer, info, ctx, region_space); + + if (HDstrlen(h5tools_dump_header_format->dataspaceblockend)) { + h5tools_str_append(buffer, "%s", h5tools_dump_header_format->dataspaceblockend); + if (HDstrlen(h5tools_dump_header_format->dataspaceend)) + h5tools_str_append(buffer, " "); + } + if (HDstrlen(h5tools_dump_header_format->dataspaceend)) + h5tools_str_append(buffer, "%s", h5tools_dump_header_format->dataspaceblockend); + + dimension_break = h5tools_render_element(stream, info, ctx, buffer, curr_pos, ncols, region_elmt_counter, elmt_counter); + /* Render the dataspace element end */ + + ctx->need_prefix = TRUE; + + /* Render the databegin element begin */ + h5tools_str_reset(buffer); + h5tools_str_append(buffer, "%s %s ", + h5tools_dump_header_format->databegin, + h5tools_dump_header_format->datablockbegin); + dimension_break = h5tools_render_element(stream, info, ctx, buffer, curr_pos, ncols, region_elmt_counter, elmt_counter); + /* Render the databegin element end */ + + ctx->need_prefix = TRUE; + + h5tools_print_region_data_blocks(region_id, rawdatastream, info, ctx, + buffer, ncols, ndims, type_id, nblocks, ptdata); + + done: + HDfree(ptdata); + + if(H5Tclose(type_id) < 0) + HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tclose failed"); + + if(H5Tclose(dtype) < 0) + HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tclose failed"); + + ctx->need_prefix = TRUE; + + /* Render the dataend element begin */ + h5tools_str_reset(buffer); + h5tools_str_append(buffer, "%s %s ", + h5tools_dump_header_format->dataend, + h5tools_dump_header_format->datablockend); + dimension_break = h5tools_render_element(stream, info, ctx, buffer, curr_pos, + ncols, region_elmt_counter, elmt_counter); + /* Render the dataend element end */ + + ctx->indent_level--; + ctx->need_prefix = TRUE; + + /* Render the region } element begin */ + h5tools_str_reset(buffer); + h5tools_str_append(buffer, "}"); + dimension_break = h5tools_render_element(stream, info, ctx, buffer, curr_pos, + ncols, region_elmt_counter, elmt_counter); + /* Render the region } element end */ + + H5_LEAVE(dimension_break) + + CATCH + return ret_value; +} + +/*------------------------------------------------------------------------- + * Audience: Public + * Chapter: H5Tools Library + * Purpose: Print the data values from a dataset referenced by region points. + * + * Description: + * This is a special case subfunction to print the data in a region reference of type points. + * + * Return: + * The function returns FAIL on error, otherwise SUCCEED + * + * Parameters Description: + * h5tools_str_t *buffer is the string into which to render + * size_t ncols + * int ndims is the number of dimensions of the region element + * hssize_t npoints is the number of points in the region + *------------------------------------------------------------------------- + */ +int +h5tools_print_region_data_points(hid_t region_space, hid_t region_id, + FILE *stream, const h5tool_format_t *info, h5tools_context_t *cur_ctx, + h5tools_str_t *buffer, size_t ncols, + int ndims, hid_t type_id, hssize_t npoints, hsize_t *ptdata) +{ + hbool_t dimension_break = TRUE; + hsize_t *dims1 = NULL; + hsize_t elmtno; /* elemnt index */ + hsize_t curr_pos = 0; + hsize_t total_size[H5S_MAX_RANK]; + size_t jndx; + int indx; + int type_size; + int ret_value = SUCCEED; + unsigned int region_flags; /* buffer extent flags */ + hid_t mem_space = -1; + void *region_buf = NULL; + h5tools_context_t ctx; + + HDassert(info); + HDassert(cur_ctx); + HDassert(buffer); + HDassert(ptdata); + + HDmemset(&ctx, 0, sizeof(ctx)); + /* Allocate space for the dimension array */ + if((dims1 = (hsize_t *) HDmalloc(sizeof(hsize_t) * ndims)) == NULL) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Could not allocate buffer for dims"); + + dims1[0] = npoints; + + /* Create dataspace for reading buffer */ + if((mem_space = H5Screate_simple(1, dims1, NULL)) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Screate_simple failed"); + + if((type_size = H5Tget_size(type_id)) == 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_size failed"); + + if((region_buf = HDmalloc(type_size * npoints)) == NULL) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Could not allocate buffer for region"); + + curr_pos = 0; + ctx.indent_level = cur_ctx->indent_level; + ctx.cur_column = cur_ctx->cur_column; + ctx.prev_multiline = cur_ctx->prev_multiline; + ctx.ndims = ndims; + + if(H5Dread(region_id, type_id, mem_space, region_space, H5P_DEFAULT, region_buf) < 0) + HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dread failed"); + + elmtno = 0; + for (jndx = 0; jndx < npoints; jndx++, elmtno++) { + ctx.need_prefix = TRUE; + ctx.cur_elmt = 0; /* points are always 0 */ + + ctx.indent_level++; + if(H5Sget_simple_extent_dims(mem_space, total_size, NULL) < 0) + HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Sget_simple_extent_dims failed"); + + /* assume entire data space to be printed */ + for (indx = 0; indx < (size_t) ctx.ndims; indx++) + ctx.p_min_idx[indx] = 0; + init_acc_pos(&ctx, total_size); + + /* print the data */ + region_flags = START_OF_DATA; + if (jndx == npoints - 1) + region_flags |= END_OF_DATA; + + for (indx = 0; indx < (size_t)ctx.ndims; indx++) + ctx.p_max_idx[indx] = cur_ctx->p_max_idx[indx]; + + ctx.sm_pos = jndx * ndims; + if (ctx.ndims > 0) { + ctx.size_last_dim = (int) (ctx.p_max_idx[ctx.ndims - 1]); + } + else + ctx.size_last_dim = 0; + + curr_pos = 0; /* points requires constant 0 */ + h5tools_region_simple_prefix(stream, info, &ctx, curr_pos, ptdata, 0); + + /* Render the point element begin */ + h5tools_str_reset(buffer); + + h5tools_str_append(buffer, "%s", jndx ? OPTIONAL_LINE_BREAK "" : ""); + h5tools_str_sprint(buffer, info, region_id, type_id, + ((char*)region_buf + jndx * type_size), &ctx); + + if (jndx + 1 < npoints || (region_flags & END_OF_DATA) == 0) + h5tools_str_append(buffer, "%s", OPT(info->elmt_suf1, ",")); + + dimension_break = h5tools_render_region_element(stream, info, &ctx, buffer, &curr_pos, + ncols, ptdata, (hsize_t)0, elmtno); + /* Render the point element end */ + if(FALSE == dimension_break) + elmtno = 0; + + ctx.indent_level--; + } /* end for (jndx = 0; jndx < npoints; jndx++, elmtno++) */ + + done: + HDfree(region_buf); + HDfree(dims1); + + if(H5Sclose(mem_space) < 0) + HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Sclose failed"); + + return ret_value; +} + +/*------------------------------------------------------------------------- + * Audience: Public + * Chapter: H5Tools Library + * Purpose: Print some values from a dataset referenced by region points. + * + * Description: + * This is a special case subfunction to dump a region reference using points. + * + * Return: + * The function returns False if the last dimension has been reached, otherwise True + * + * In/Out: + * h5tools_context_t *ctx + * hsize_t *curr_pos + * + * Parameters Description: + * h5tools_str_t *buffer is the string into which to render + * hsize_t curr_pos is the total data element position + * size_t ncols + * hsize_t region_elmt_counter is the region element loop counter + * hsize_t elmt_count is the data element loop counter + *------------------------------------------------------------------------- + */ +hbool_t +h5tools_dump_region_data_points(hid_t region_space, hid_t region_id, + FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx, + h5tools_str_t *buffer, hsize_t *curr_pos, size_t ncols, hsize_t region_elmt_counter, + hsize_t elmt_counter) { + HERR_INIT(hbool_t, TRUE) + hbool_t dimension_break = TRUE; + hssize_t npoints; + hsize_t alloc_size; + hsize_t *ptdata; + int ndims; + hssize_t indx; + hid_t dtype; + hid_t type_id; + + HDassert(info); + HDassert(ctx); + HDassert(buffer); + + if((npoints = H5Sget_select_elem_npoints(region_space)) <= 0) + H5E_THROW(dimension_break, H5E_tools_min_id_g, "H5Sget_select_elem_npoints failed"); + + /* Allocate space for the dimension array */ + if((ndims = H5Sget_simple_extent_ndims(region_space)) < 0) + H5E_THROW(dimension_break, H5E_tools_min_id_g, "H5Sget_simple_extent_ndims failed"); + + /* Render the region { element begin */ + h5tools_str_reset(buffer); + + h5tools_str_append(buffer, "{"); + dimension_break = h5tools_render_element(stream, info, ctx, buffer, curr_pos, ncols, region_elmt_counter, elmt_counter); + /* Render the region { element end */ + + /* Render the region datatype info and indices element begin */ + h5tools_str_reset(buffer); + + ctx->indent_level++; + ctx->need_prefix = TRUE; + h5tools_str_append(buffer, "REGION_TYPE POINT "); + + alloc_size = npoints * ndims * sizeof(ptdata[0]); + HDassert(alloc_size == (hsize_t) ((size_t) alloc_size)); /*check for overflow*/ + if(NULL == (ptdata = (hsize_t *)HDmalloc((size_t) alloc_size))) + HGOTO_ERROR(dimension_break, H5E_tools_min_id_g, "Could not allocate buffer for ptdata"); + + H5_CHECK_OVERFLOW(npoints, hssize_t, hsize_t); + if(H5Sget_select_elem_pointlist(region_space, (hsize_t) 0, (hsize_t) npoints, ptdata) < 0) + HGOTO_ERROR(dimension_break, H5E_tools_min_id_g, "H5Sget_select_elem_pointlist failed"); + + for (indx = 0; indx < npoints; indx++) { + int loop_indx; + + h5tools_str_append(buffer, info->dset_ptformat_pre, + indx ? "," OPTIONAL_LINE_BREAK " " : "", (unsigned long) indx); + + for (loop_indx = 0; loop_indx < ndims; loop_indx++) + h5tools_str_append(buffer, "%s" HSIZE_T_FORMAT, loop_indx ? "," : "(", + ptdata[indx * ndims + loop_indx]); + + h5tools_str_append(buffer, ")"); + } /* end for (indx = 0; indx < npoints; indx++) */ + + dimension_break = h5tools_render_element(stream, info, ctx, buffer, curr_pos, ncols, region_elmt_counter, elmt_counter); + /* Render the region datatype info and indices element end */ + + ctx->need_prefix = TRUE; + + if((dtype = H5Dget_type(region_id)) < 0) + HGOTO_ERROR(dimension_break, H5E_tools_min_id_g, "H5Dget_type failed"); + + if((type_id = H5Tget_native_type(dtype, H5T_DIR_DEFAULT)) < 0) + HGOTO_ERROR(dimension_break, H5E_tools_min_id_g, "H5Tget_native_type failed"); + + /* Render the datatype element begin */ + h5tools_str_reset(buffer); + h5tools_str_append(buffer, "%s %s ", + h5tools_dump_header_format->datatypebegin, + h5tools_dump_header_format->datatypeblockbegin); + + ctx->indent_level++; + h5tools_print_datatype(stream, buffer, info, ctx, dtype, TRUE); + ctx->indent_level--; + + if (HDstrlen(h5tools_dump_header_format->datatypeblockend)) { + h5tools_str_append(buffer, "%s", h5tools_dump_header_format->datatypeblockend); + if (HDstrlen(h5tools_dump_header_format->datatypeend)) + h5tools_str_append(buffer, " "); + } + if (HDstrlen(h5tools_dump_header_format->datatypeend)) + h5tools_str_append(buffer, "%s", h5tools_dump_header_format->datatypeend); + + dimension_break = h5tools_render_element(stream, info, ctx, buffer, curr_pos, ncols, region_elmt_counter, elmt_counter); + /* Render the datatype element end */ + + ctx->need_prefix = TRUE; + + /* Render the dataspace element begin */ + h5tools_str_reset(buffer); + + ctx->need_prefix = TRUE; + h5tools_str_append(buffer, "%s ", h5tools_dump_header_format->dataspacebegin); + + h5tools_print_dataspace(stream, buffer, info, ctx, region_space); + + if (HDstrlen(h5tools_dump_header_format->dataspaceblockend)) { + h5tools_str_append(buffer, "%s", h5tools_dump_header_format->dataspaceblockend); + if (HDstrlen(h5tools_dump_header_format->dataspaceend)) + h5tools_str_append(buffer, " "); + } + if (HDstrlen(h5tools_dump_header_format->dataspaceend)) + h5tools_str_append(buffer, "%s", h5tools_dump_header_format->dataspaceblockend); + + dimension_break = h5tools_render_element(stream, info, ctx, buffer, curr_pos, ncols, region_elmt_counter, elmt_counter); + /* Render the dataspace element end */ + + ctx->need_prefix = TRUE; + + /* Render the databegin element begin */ + h5tools_str_reset(buffer); + + h5tools_str_append(buffer, "%s %s ", + h5tools_dump_header_format->databegin, + h5tools_dump_header_format->datablockbegin); + + dimension_break = h5tools_render_element(stream, info, ctx, buffer, curr_pos, ncols, region_elmt_counter, elmt_counter); + + ctx->need_prefix = TRUE; + + h5tools_print_region_data_points(region_space, region_id, + rawdatastream, info, ctx, buffer, ncols, ndims, type_id, npoints, ptdata); + + done: + HDfree(ptdata); + + if(H5Tclose(type_id) < 0) + HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tclose failed"); + + if(H5Tclose(dtype) < 0) + HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tclose failed"); + + ctx->need_prefix = TRUE; + + /* Render the dataend element begin */ + h5tools_str_reset(buffer); + h5tools_str_append(buffer, "%s %s ", + h5tools_dump_header_format->dataend, + h5tools_dump_header_format->datablockend); + dimension_break = h5tools_render_element(stream, info, ctx, buffer, curr_pos, + ncols, region_elmt_counter, elmt_counter); + /* Render the dataend element end*/ + + ctx->indent_level--; + ctx->need_prefix = TRUE; + + /* Render the region } element begin */ + h5tools_str_reset(buffer); + h5tools_str_append(buffer, "}"); + dimension_break = h5tools_render_element(stream, info, ctx, buffer, curr_pos, + ncols, region_elmt_counter, elmt_counter); + /* Render the region } element end */ + + H5_LEAVE(dimension_break) +CATCH + return ret_value; +} + +/*------------------------------------------------------------------------- + * Audience: Public + * Chapter: H5Tools Library + * Purpose: print out the data for a subset of a dataset. + * Description: + * + * Select a hyperslab from the dataset DSET using the parameters + * specified in SSET. Dump this out to STREAM. + * + * Hyperslabs select "count" blocks of size "block", spaced "stride" elements + * from each other, starting at coordinate "start". + * + * Return: + * On success, return SUCCEED. Otherwise, the function returns FAIL. + * + * Algorithm + * + * The parameters from SSET are translated into temporary + * variables so that 1 row is printed at a time (getting the coordinate indices + * at each row). + * We define the stride, count and block to be 1 in the row dimension to achieve + * this and advance until all points are printed. + * + * The element position is obtained from the matrix according to: + * Given an index I(z,y,x) its position from the beginning of an array + * of sizes A(size_z, size_y,size_x) is given by + * Position of I(z,y,x) = index_z * size_y * size_x + * + index_y * size_x + * + index_x + * + *------------------------------------------------------------------------- + */ +static herr_t +h5tools_print_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx, + hid_t dset, hid_t p_type, struct subset_t *sset, + hid_t f_space, hsize_t hyperslab_count, + hsize_t *temp_start,/* start inside offset count loop */ + hsize_t *temp_count,/* count inside offset count loop */ + hsize_t *temp_block,/* block size used in loop */ + hsize_t *temp_stride,/* stride size used in loop */ + hsize_t *total_size,/* total size of dataset */ + unsigned int row_dim/* index of row_counter dimension */) +{ + HERR_INIT(herr_t, SUCCEED) + size_t i; /* counters */ + size_t j; /* counters */ + hsize_t zero[1] = {0}; /* vector of zeros */ + unsigned int flags; /* buffer extent flags */ + hsize_t elmtno; /* elemnt index */ + hsize_t low[H5S_MAX_RANK]; /* low bound of hyperslab */ + hsize_t high[H5S_MAX_RANK]; /* higher bound of hyperslab */ + size_t p_type_nbytes; /* size of memory type */ + hsize_t sm_size[H5S_MAX_RANK]; /* stripmine size */ + hsize_t sm_nbytes; /* bytes per stripmine */ + hssize_t ssm_nelmts; /* elements per stripmine*/ + hsize_t sm_nelmts; /* elements per stripmine*/ + unsigned char *sm_buf = NULL; /* buffer for raw data */ + hid_t sm_space = -1; /* stripmine data space */ + hsize_t size_row_block; /* size for blocks along rows */ + hsize_t row_counter = 0; + + /* VL data special information */ + unsigned int vl_data = 0; /* contains VL datatypes */ + + if ((size_t) ctx->ndims > NELMTS(sm_size)) + H5E_THROW(FAIL, H5E_tools_min_id_g, "ndims and sm_size comparision failed"); + + if (ctx->ndims > 0) + init_acc_pos(ctx, total_size); + + size_row_block = sset->block.data[row_dim]; + + /* Check if we have VL data in the dataset's datatype */ + if (h5tools_detect_vlen_str(p_type) == TRUE) + vl_data = TRUE; + if (H5Tdetect_class(p_type, H5T_VLEN) == TRUE) + vl_data = TRUE; + + /* display loop */ + for (; hyperslab_count > 0; temp_start[row_dim] += temp_stride[row_dim], hyperslab_count--) { + /* jump rows if size of block exceeded + cases where block > 1 only and stride > block */ + if (size_row_block > 1 + && row_counter == size_row_block + && sset->stride.data[row_dim] > sset->block.data[row_dim]) { + + hsize_t increase_rows = sset->stride.data[row_dim] - sset->block.data[row_dim]; + temp_start[row_dim] += increase_rows; + row_counter = 0; + } + + row_counter++; + + /* calculate the potential number of elements we're going to print */ + if(H5Sselect_hyperslab(f_space, H5S_SELECT_SET, temp_start, temp_stride, temp_count, temp_block) < 0) + H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Sselect_hyperslab failed"); + + if((ssm_nelmts = H5Sget_select_npoints(f_space)) < 0) + H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Sget_select_npoints failed"); + sm_nelmts = (hsize_t)ssm_nelmts; + + if (sm_nelmts > 0) { + /* + * determine the strip mine size and allocate a buffer. the strip mine is + * a hyperslab whose size is manageable. + */ + if((sm_nbytes = p_type_nbytes = H5Tget_size(p_type)) == 0) + H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_size failed"); + + if (ctx->ndims > 0) + for (i = ctx->ndims; i > 0; --i) { + hsize_t size = H5TOOLS_BUFSIZE / sm_nbytes; + if (size == 0) /* datum size > H5TOOLS_BUFSIZE */ + size = 1; + sm_size[i - 1] = MIN(total_size[i - 1], size); + sm_nbytes *= sm_size[i - 1]; + HDassert(sm_nbytes > 0); + } + + HDassert(sm_nbytes == (hsize_t) ((size_t) sm_nbytes)); /*check for overflow*/ + if(NULL == (sm_buf = (unsigned char *)HDmalloc((size_t) sm_nelmts * p_type_nbytes))) + H5E_THROW(FAIL, H5E_tools_min_id_g, "Could not allocate buffer for strip-mine"); + + if((sm_space = H5Screate_simple(1, &sm_nelmts, NULL)) < 0) + H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Screate_simple failed"); + + if(H5Sselect_hyperslab(sm_space, H5S_SELECT_SET, zero, NULL, &sm_nelmts, NULL) < 0) + H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Sselect_hyperslab failed"); + + /* read the data */ + if(H5Dread(dset, p_type, sm_space, f_space, H5P_DEFAULT, sm_buf) < 0) + H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Dread failed"); + + /* print the data */ + flags = START_OF_DATA; + + if (hyperslab_count == 1) + flags |= END_OF_DATA; + + for (i = 0; i < ctx->ndims; i++) + ctx->p_max_idx[i] = ctx->p_min_idx[i] + MIN(total_size[i], sm_size[i]); + + /* print array indices. get the lower bound of the hyperslab and calulate + the element position at the start of hyperslab */ + if(H5Sget_select_bounds(f_space, low, high) < 0) + H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Sget_select_bounds failed"); + + elmtno = 0; + for (i = 0; i < (size_t) ctx->ndims - 1; i++) { + hsize_t offset = 1; /* accumulation of the previous dimensions */ + for (j = i + 1; j < (size_t) ctx->ndims; j++) + offset *= total_size[j]; + elmtno += low[i] * offset; + } + elmtno += low[ctx->ndims - 1]; + + /* initialize the current stripmine position; this is necessary to print the array + indices */ + ctx->sm_pos = elmtno; + + ctx->need_prefix = TRUE; + + if(h5tools_dump_simple_data(stream, info, dset, ctx, flags, sm_nelmts, p_type, sm_buf) < 0) + HERROR(H5E_tools_g, H5E_tools_min_id_g, "h5tools_dump_simple_data failed"); + + /* Reclaim any VL memory, if necessary */ + if (vl_data) + H5Dvlen_reclaim(p_type, sm_space, H5P_DEFAULT, sm_buf); + + if(H5Sclose(sm_space) < 0) + H5E_THROW(H5E_tools_g, H5E_tools_min_id_g, "H5Sclose failed"); + if(sm_buf) + HDfree(sm_buf); + sm_buf = NULL; + } + else + H5E_THROW(SUCCEED, H5E_tools_min_id_g, "nothing to print"); + + ctx->continuation++; + + } /* hyperslab_count loop */ + +CATCH + if(sm_buf) + HDfree(sm_buf); + + return ret_value; +} + +/*------------------------------------------------------------------------- + * Audience: Public + * Chapter: H5Tools Library + * Purpose: print out the data for a subset of a dataset. + * Description: + * + * Select a hyperslab from the dataset DSET using the parameters + * specified in SSET. Dump this out to STREAM. + * + * Hyperslabs select "count" blocks of size "block", spaced "stride" elements + * from each other, starting at coordinate "start". + * + * Return: + * On success, return SUCCEED. Otherwise, the function returns FAIL. + * + * Algorithm + * + * The parameters from SSET are translated into temporary + * variables so that 1 row is printed at a time (getting the coordinate indices + * at each row). + * We define the stride, count and block to be 1 in the row dimension to achieve + * this and advance until all points are printed. + * + * The element position is obtained from the matrix according to: + * Given an index I(z,y,x) its position from the beginning of an array + * of sizes A(size_z, size_y,size_x) is given by + * Position of I(z,y,x) = index_z * size_y * size_x + * + index_y * size_x + * + index_x + * + *------------------------------------------------------------------------- + */ +static herr_t +h5tools_display_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx, + hid_t dset, hid_t p_type, struct subset_t *sset, + hid_t f_space, hsize_t *total_size) +{ + size_t i; /* counters */ + hsize_t n; /* counters */ + hsize_t count; /* hyperslab count */ + hsize_t outer_count; /* offset count */ + unsigned int row_dim; /* index of row_counter dimension */ + int current_outer_dim; /* dimension for start */ + hsize_t temp_start[H5S_MAX_RANK];/* temporary start inside offset count loop */ + hsize_t max_start[H5S_MAX_RANK]; /* maximum start inside offset count loop */ + hsize_t temp_count[H5S_MAX_RANK];/* temporary count inside offset count loop */ + hsize_t temp_block[H5S_MAX_RANK];/* temporary block size used in loop */ + hsize_t temp_stride[H5S_MAX_RANK];/* temporary stride size used in loop */ + int reset_dim; + herr_t ret_value = SUCCEED; + + if (ctx->ndims == 1) + row_dim = 0; + else + row_dim = ctx->ndims - 2; + + /* get the offset count */ + outer_count = 1; + if (ctx->ndims > 2) + for (i = 0; i < (size_t) ctx->ndims - 2; i++) { + /* block size is handled by containing h5tools_print_simple_subset call */ + outer_count = outer_count * sset->count.data[i]; + } + + /* initialize temporary start, count and maximum start */ + for (i = 0; i < (size_t) ctx->ndims; i++) { + temp_start[i] = sset->start.data[i]; + temp_count[i] = sset->count.data[i]; + temp_block[i] = sset->block.data[i]; + temp_stride[i] = sset->stride.data[i]; + max_start[i] = 0; + } + + if (ctx->ndims > 2) { + for (i = 0; i < (size_t) ctx->ndims - 2; i++) { + max_start[i] = temp_start[i] + sset->count.data[i]; + temp_count[i] = 1; + } + } + + /* offset loop */ + for (n = 0; n < outer_count; n++) { + /* number of read iterations in inner loop, read by rows, to match 2D display */ + if (ctx->ndims > 1) { + /* count is the number of iterations to display all the rows, + the block size count times */ + count = sset->count.data[row_dim] * sset->block.data[row_dim]; + + /* always 1 row_counter at a time, that is a block of size 1, 1 time */ + temp_count[row_dim] = 1; + temp_block[row_dim] = 1; + + /* advance 1 row_counter at a time */ + if (sset->block.data[row_dim] > 1) + temp_stride[row_dim] = 1; + } + /* for the 1D case */ + else { + count = 1; + } + + h5tools_print_simple_subset(stream, info, ctx, dset, p_type, sset, + f_space, count, temp_start, temp_count, + temp_block, temp_stride, total_size, row_dim); + + if (ctx->ndims > 2) { + /* dimension for start */ + current_outer_dim = (ctx->ndims - 2) - 1; + + /* set start to original from current_outer_dim up */ + for (i = current_outer_dim + 1; i < ctx->ndims; i++) { + temp_start[i] = sset->start.data[i]; + } + + /* increment start dimension */ + do { + reset_dim = 0; + temp_start[current_outer_dim]++; + if (temp_start[current_outer_dim] >= max_start[current_outer_dim]) { + temp_start[current_outer_dim] = sset->start.data[current_outer_dim]; + + /* consider block */ + if (sset->block.data[current_outer_dim] > 1) + temp_start[current_outer_dim]++; + + current_outer_dim--; + reset_dim = 1; + } + } while (current_outer_dim >= 0 && reset_dim); + + } /* ctx.ndims > 1 */ + + } /* outer_count */ + + return ret_value; +} + +/*------------------------------------------------------------------------- + * Audience: Public + * Chapter: H5Tools Library + * Purpose: Dump out a subset of a dataset. + * Description: + * + * Select a hyperslab from the dataset DSET using the parameters + * specified in SSET. Dump this out to STREAM. + * + * Hyperslabs select "count" blocks of size "block", spaced "stride" elements + * from each other, starting at coordinate "start". + * + * Return: + * On success, return SUCCEED. Otherwise, the function returns FAIL. + * + * Original programmer: + * Bill Wendling, Wednesday, March 07, 2001 + * + * Rewritten with modified algorithm by: + * Pedro Vicente, Wednesday, January 16, 2008, contributions from Quincey Koziol + * + * Algorithm + * + * In a inner loop, the parameters from SSET are translated into temporary + * variables so that 1 row is printed at a time (getting the coordinate indices + * at each row). + * We define the stride, count and block to be 1 in the row dimension to achieve + * this and advance until all points are printed. + * An outer loop for cases where dimensionality is greater than 2D is made. + * In each iteration, the 2D block is displayed in the inner loop. The remaining + * slower dimensions above the first 2 are incremented one at a time in the outer loop + * + * The element position is obtained from the matrix according to: + * Given an index I(z,y,x) its position from the beginning of an array + * of sizes A(size_z, size_y,size_x) is given by + * Position of I(z,y,x) = index_z * size_y * size_x + * + index_y * size_x + * + index_x + * + *------------------------------------------------------------------------- + */ +static herr_t +h5tools_dump_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx, hid_t dset, + hid_t p_type, struct subset_t *sset) +{ + HERR_INIT(herr_t, SUCCEED) + int sndims; + hid_t f_space = -1; /* file data space */ + size_t i; /* counters */ + hsize_t total_size[H5S_MAX_RANK];/* total size of dataset*/ + + if((f_space = H5Dget_space(dset)) < 0) + H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Dget_space failed"); + + if((sndims = H5Sget_simple_extent_ndims(f_space)) < 0) + H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_ndims failed"); + ctx->ndims = (unsigned)sndims; + + /* assume entire data space to be printed */ + if (ctx->ndims > 0) + for (i = 0; i < (size_t) ctx->ndims; i++) + ctx->p_min_idx[i] = 0; + + if(H5Sget_simple_extent_dims(f_space, total_size, NULL) < 0) + H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_dims failed"); + ctx->size_last_dim = total_size[ctx->ndims - 1]; + + /* Set the compound datatype field list for display */ + ctx->cmpd_listv = info->cmpd_listv; + + h5tools_display_simple_subset(stream, info, ctx, dset, p_type, sset, f_space, total_size); + +CATCH + if(f_space >= 0 && H5Sclose(f_space) < 0) + H5E_THROW(H5E_tools_g, H5E_tools_min_id_g, "H5Sclose failed"); + + return ret_value; +} + +/*------------------------------------------------------------------------- + * Audience: Public + * Chapter: H5Tools Library + * Purpose: Print some values from a dataset with a simple data space. + * Description: + * This is a special case of h5tools_dump_dset(). This function only + * intended for dumping datasets -- it does strip mining and some other + * things which are unnecessary for smaller objects such as attributes + * (to print small objects like attributes simply read the attribute and + * call h5tools_dump_simple_mem()). + * Return: + * On success, the function returns SUCCEED. Otherwise, the function + * returns FAIL. + *------------------------------------------------------------------------- + */ +static int +h5tools_dump_simple_dset(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx, + hid_t dset, hid_t p_type) +{ + HERR_INIT(herr_t, SUCCEED) + hid_t f_space = -1; /* file data space */ + hsize_t elmtno; /* counter */ + size_t i; /* counter */ + int carry; /* counter carry value */ + hsize_t zero[8]; /* vector of zeros */ + unsigned int flags; /* buffer extent flags */ + hsize_t total_size[H5S_MAX_RANK]; /* total size of dataset*/ + + /* Print info */ + size_t p_type_nbytes; /* size of memory type */ + hsize_t p_nelmts; /* total selected elmts */ + + /* 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*/ + unsigned char *sm_buf = NULL; /* buffer for raw data */ + hid_t sm_space = -1; /* 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 */ + + /* VL data special information */ + unsigned int vl_data = 0; /* contains VL datatypes */ + + f_space = H5Dget_space(dset); + + if (f_space == FAIL) + H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Dget_space failed"); + + ctx->ndims = H5Sget_simple_extent_ndims(f_space); + + if ((size_t)ctx->ndims > NELMTS(sm_size)) { + H5E_THROW(FAIL, H5E_tools_min_id_g, "ctx->ndims > NELMTS(sm_size) failed"); + } + + /* Assume entire data space to be printed */ + if (ctx->ndims > 0) + for (i = 0; i < (size_t)ctx->ndims; i++) + ctx->p_min_idx[i] = 0; + + H5Sget_simple_extent_dims(f_space, total_size, NULL); + + /* calculate the number of elements we're going to print */ + p_nelmts = 1; + + if (ctx->ndims > 0) { + for (i = 0; i < ctx->ndims; i++) + p_nelmts *= total_size[i]; + ctx->size_last_dim = (total_size[ctx->ndims - 1]); + } /* end if */ + else + ctx->size_last_dim = 0; + + if (p_nelmts == 0) { + H5_LEAVE(SUCCEED); /* nothing to print */ + } + + /* Check if we have VL data in the dataset's datatype */ + if (h5tools_detect_vlen_str(p_type) == TRUE) + vl_data = TRUE; + if (H5Tdetect_class(p_type, 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 = H5Tget_size(p_type); + + if (ctx->ndims > 0) { + for (i = ctx->ndims; i > 0; --i) { + hsize_t size = H5TOOLS_BUFSIZE / sm_nbytes; + if ( size == 0) /* datum size > H5TOOLS_BUFSIZE */ + size = 1; + sm_size[i - 1] = MIN(total_size[i - 1], size); + sm_nbytes *= sm_size[i - 1]; + HDassert(sm_nbytes > 0); + } + } + + if(!sm_nbytes) + goto done; + + HDassert(sm_nbytes == (hsize_t)((size_t)sm_nbytes)); /*check for overflow*/ + sm_buf = (unsigned char *)HDmalloc((size_t)sm_nbytes); + + sm_nelmts = sm_nbytes / p_type_nbytes; + sm_space = H5Screate_simple(1, &sm_nelmts, NULL); + + if (ctx->ndims > 0) + init_acc_pos(ctx, total_size); + + /* The stripmine loop */ + HDmemset(hs_offset, 0, sizeof hs_offset); + HDmemset(zero, 0, sizeof zero); + + for (elmtno = 0; elmtno < p_nelmts; elmtno += hs_nelmts) { + /* Calculate the hyperslab size */ + if (ctx->ndims > 0) { + for (i = 0, hs_nelmts = 1; i < ctx->ndims; i++) { + hs_size[i] = MIN(total_size[i] - hs_offset[i], sm_size[i]); + ctx->p_max_idx[i] = ctx->p_min_idx[i] + hs_size[i]; + hs_nelmts *= hs_size[i]; + } + + H5Sselect_hyperslab(f_space, H5S_SELECT_SET, hs_offset, NULL, hs_size, NULL); + H5Sselect_hyperslab(sm_space, H5S_SELECT_SET, zero, NULL, &hs_nelmts, NULL); + } + else { + H5Sselect_all(f_space); + H5Sselect_all(sm_space); + hs_nelmts = 1; + } + + /* Read the data */ + if (H5Dread(dset, p_type, sm_space, f_space, H5P_DEFAULT, sm_buf) < 0) { + H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Dread failed"); + } + + /* Print the data */ + flags = (elmtno == 0) ? START_OF_DATA : 0; + flags |= ((elmtno + hs_nelmts) >= p_nelmts) ? END_OF_DATA : 0; + + /* initialize the current stripmine position; this is necessary to print the array + indices */ + ctx->sm_pos = elmtno; + + if(h5tools_dump_simple_data(stream, info, dset, ctx, flags, hs_nelmts, p_type, sm_buf) < 0) + HERROR(H5E_tools_g, H5E_tools_min_id_g, "h5tools_dump_simple_data failed"); + + /* Reclaim any VL memory, if necessary */ + if (vl_data) + H5Dvlen_reclaim(p_type, sm_space, H5P_DEFAULT, sm_buf); + + /* Calculate the next hyperslab offset */ + for (i = ctx->ndims, carry = 1; i > 0 && carry; --i) { + ctx->p_min_idx[i - 1] = ctx->p_max_idx[i - 1]; + hs_offset[i - 1] += hs_size[i - 1]; + + if (hs_offset[i - 1] == total_size[i - 1]) + hs_offset[i - 1] = 0; + else + carry = 0; + } + + ctx->continuation++; + } + +CATCH + if(sm_buf) + HDfree(sm_buf); + +done: + if(sm_space >= 0 && H5Sclose(sm_space) < 0) + H5E_THROW(H5E_tools_g, H5E_tools_min_id_g, "H5Sclose failed"); + if(f_space >= 0 && H5Sclose(f_space) < 0) + H5E_THROW(H5E_tools_g, H5E_tools_min_id_g, "H5Sclose failed"); + + return ret_value; +} + +/*------------------------------------------------------------------------- + * Function: h5tools_dump_simple_mem + * + * Purpose: Print some values from memory with a simple data space. + * This is a special case of h5tools_dump_mem(). + * + * Return: Success: SUCCEED + * Failure: FAIL + * + *------------------------------------------------------------------------- + */ +static int +h5tools_dump_simple_mem(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx, hid_t obj_id, + hid_t type, hid_t space, void *mem) +{ + HERR_INIT(herr_t, SUCCEED) + int i; /*counters */ + hsize_t nelmts; /*total selected elmts */ + + ctx->ndims = H5Sget_simple_extent_ndims(space); + + if ((size_t) ctx->ndims > NELMTS(ctx->p_min_idx)) + H5E_THROW(FAIL, H5E_tools_min_id_g, "ctx->ndims > NELMTS(ctx->p_min_idx) failed"); + + /* Assume entire data space to be printed */ + for (i = 0; i < ctx->ndims; i++) + ctx->p_min_idx[i] = 0; + + H5Sget_simple_extent_dims(space, ctx->p_max_idx, NULL); + + for (i = 0, nelmts = 1; ctx->ndims != 0 && i < ctx->ndims; i++) + nelmts *= ctx->p_max_idx[i] - ctx->p_min_idx[i]; + + if (nelmts == 0) + H5_LEAVE(SUCCEED); /* nothing to print */ + if (ctx->ndims > 0) { + HDassert(ctx->p_max_idx[ctx->ndims - 1] == (hsize_t) ((int) ctx->p_max_idx[ctx->ndims - 1])); + ctx->size_last_dim = (int) (ctx->p_max_idx[ctx->ndims - 1]); + } /* end if */ + else + ctx->size_last_dim = 0; + + if (ctx->ndims > 0) + init_acc_pos(ctx, ctx->p_max_idx); + + if(h5tools_dump_simple_data(stream, info, obj_id, ctx, START_OF_DATA | END_OF_DATA, nelmts, type, mem) < 0) + HERROR(H5E_tools_g, H5E_tools_min_id_g, "h5tools_dump_simple_data failed"); + +CATCH + return ret_value; +} + +/*------------------------------------------------------------------------- + * Function: h5tools_dump_dset + * + * Purpose: Print some values from a dataset DSET to the file STREAM + * after converting all types to P_TYPE (which should be a + * native type). If P_TYPE is a negative value then it will be + * computed from the dataset type using only native types. + * + * Note: This function is intended only for datasets since it does + * some things like strip mining which are unnecessary for + * smaller objects such as attributes. The easiest way to print + * small objects is to read the object into memory and call + * h5tools_dump_mem(). + * + * Return: Success: SUCCEED + * Failure: FAIL + * + * Modifications: + * Robb Matzke, 1999-06-07 + * If info->raw is set then the memory datatype will be the same + * as the file datatype. + * + * Bill Wendling, 2001-02-27 + * Renamed to ``h5tools_dump_dset'' and added the subsetting + * parameter. + * + *------------------------------------------------------------------------- + */ +int +h5tools_dump_dset(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx, + hid_t dset, hid_t _p_type, struct subset_t *sset) +{ + hid_t f_space; + hid_t p_type = _p_type; + hid_t f_type; + H5S_class_t space_type; + int status = FAIL; + h5tool_format_t info_dflt; + /* Use default values */ + if (!stream) + stream = rawoutstream; + + if (!info) { + HDmemset(&info_dflt, 0, sizeof info_dflt); + info = &info_dflt; + } + + if (p_type < 0) { + f_type = H5Dget_type(dset); + + if (info->raw || bin_form == 1) + p_type = H5Tcopy(f_type); + else if (bin_form == 2) + p_type = h5tools_get_little_endian_type(f_type); + else if (bin_form == 3) + p_type = h5tools_get_big_endian_type(f_type); + else + p_type = h5tools_get_native_type(f_type); + + H5Tclose(f_type); + + if (p_type < 0) + goto done; + } + + /* Check the data space */ + f_space = H5Dget_space(dset); + + space_type = H5Sget_simple_extent_type(f_space); + + /* Print the data */ + if (space_type == H5S_SIMPLE || space_type == H5S_SCALAR) { + if(!sset) + status = h5tools_dump_simple_dset(rawdatastream, info, ctx, dset, p_type); + else + status = h5tools_dump_simple_subset(stream, info, ctx, dset, p_type, sset); + } + else + /* space is H5S_NULL */ + status = SUCCEED; + + /* Close the dataspace */ + H5Sclose(f_space); + +done: + if (p_type != _p_type) + H5Tclose(p_type); + + return status; +} + +/*------------------------------------------------------------------------- + * Function: h5tools_dump_mem + * + * Purpose: Displays the data contained in MEM. MEM must have the + * specified data TYPE and SPACE. Currently only simple data + * spaces are allowed and only the `all' selection. + * + * Return: Success: SUCCEED + * Failure: FAIL + * + *------------------------------------------------------------------------- + */ +int +h5tools_dump_mem(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx, + hid_t obj_id, hid_t type, hid_t space, void *mem) +{ + HERR_INIT(int, SUCCEED) + h5tool_format_t info_dflt; + + /* Use default values */ + if (!stream) + stream = rawoutstream; + + if (!info) { + HDmemset(&info_dflt, 0, sizeof(info_dflt)); + info = &info_dflt; + } + + /* Check the data space */ + if (H5Sis_simple(space) <= 0) + H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Sis_simple failed") + + H5_LEAVE(h5tools_dump_simple_mem(stream, info, ctx, obj_id, type, space, mem)) + +CATCH + return ret_value; +} + +/*------------------------------------------------------------------------- + * Function: print_datatype + * + * Purpose: print the datatype - do not prefix. + * + * Return: void + * + * In/Out: h5tools_str_t *buffer + * h5tools_context_t *ctx + * + *------------------------------------------------------------------------- + */ +int +h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_t *info, + h5tools_context_t *ctx, hid_t type, int object_search) +{ + HERR_INIT(int, SUCCEED) + char *mname; + hid_t mtype = -1; + hid_t str_type = -1; + hid_t super = -1; + hid_t tmp_type = -1; + int snmembers; + int sndims; + unsigned nmembers; + unsigned i; + size_t size = 0; + size_t ncols = 80; /*available output width */ + hsize_t dims[H5TOOLS_DUMP_MAX_RANK]; + hsize_t curr_pos = 0; /* total data element position */ + H5T_str_t str_pad; + H5T_cset_t cset; + H5T_order_t order; + H5T_class_t type_class; + H5T_sign_t sign; /* sign scheme value */ + htri_t is_vlstr = FALSE; + const char *sign_s = NULL; /* sign scheme string */ + const char *order_s = NULL; /* byte order string */ + + if((type_class = H5Tget_class(type)) < 0) + H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_class failed"); + if (object_search && H5Tcommitted(type) > 0) { + H5O_info_t oinfo; + obj_t *obj = NULL; /* Found object */ + + H5Oget_info(type, &oinfo); + obj = search_obj(h5dump_type_table, oinfo.addr); + + if(obj) { + if(!obj->recorded) { + h5tools_str_append(buffer,"\"/#"H5_PRINTF_HADDR_FMT"\"", obj->objno); + } + else + h5tools_str_append(buffer, "\"%s\"", obj->objname); + } + else { + error_msg("unknown committed type.\n"); + h5tools_setstatus(EXIT_FAILURE); + } + + return ret_value; + } + + if (info->line_ncols > 0) + ncols = info->line_ncols; + + switch (type_class) { + case H5T_INTEGER: + if (H5Tequal(type, H5T_STD_I8BE) == TRUE) { + h5tools_str_append(buffer, "H5T_STD_I8BE"); + } + else if (H5Tequal(type, H5T_STD_I8LE) == TRUE) { + h5tools_str_append(buffer, "H5T_STD_I8LE"); + } + else if (H5Tequal(type, H5T_STD_I16BE) == TRUE) { + h5tools_str_append(buffer, "H5T_STD_I16BE"); + } + else if (H5Tequal(type, H5T_STD_I16LE) == TRUE) { + h5tools_str_append(buffer, "H5T_STD_I16LE"); + } + else if (H5Tequal(type, H5T_STD_I32BE) == TRUE) { + h5tools_str_append(buffer, "H5T_STD_I32BE"); + } + else if (H5Tequal(type, H5T_STD_I32LE) == TRUE) { + h5tools_str_append(buffer, "H5T_STD_I32LE"); + } + else if (H5Tequal(type, H5T_STD_I64BE) == TRUE) { + h5tools_str_append(buffer, "H5T_STD_I64BE"); + } + else if (H5Tequal(type, H5T_STD_I64LE) == TRUE) { + h5tools_str_append(buffer, "H5T_STD_I64LE"); + } + else if (H5Tequal(type, H5T_STD_U8BE) == TRUE) { + h5tools_str_append(buffer, "H5T_STD_U8BE"); + } + else if (H5Tequal(type, H5T_STD_U8LE) == TRUE) { + h5tools_str_append(buffer, "H5T_STD_U8LE"); + } + else if (H5Tequal(type, H5T_STD_U16BE) == TRUE) { + h5tools_str_append(buffer, "H5T_STD_U16BE"); + } + else if (H5Tequal(type, H5T_STD_U16LE) == TRUE) { + h5tools_str_append(buffer, "H5T_STD_U16LE"); + } + else if (H5Tequal(type, H5T_STD_U32BE) == TRUE) { + h5tools_str_append(buffer, "H5T_STD_U32BE"); + } + else if (H5Tequal(type, H5T_STD_U32LE) == TRUE) { + h5tools_str_append(buffer, "H5T_STD_U32LE"); + } + else if (H5Tequal(type, H5T_STD_U64BE) == TRUE) { + h5tools_str_append(buffer, "H5T_STD_U64BE"); + } + else if (H5Tequal(type, H5T_STD_U64LE) == TRUE) { + h5tools_str_append(buffer, "H5T_STD_U64LE"); + } + else if (H5Tequal(type, H5T_NATIVE_SCHAR) == TRUE) { + h5tools_str_append(buffer, "H5T_NATIVE_SCHAR"); + } + else if (H5Tequal(type, H5T_NATIVE_UCHAR) == TRUE) { + h5tools_str_append(buffer, "H5T_NATIVE_UCHAR"); + } + else if (H5Tequal(type, H5T_NATIVE_SHORT) == TRUE) { + h5tools_str_append(buffer, "H5T_NATIVE_SHORT"); + } + else if (H5Tequal(type, H5T_NATIVE_USHORT) == TRUE) { + h5tools_str_append(buffer, "H5T_NATIVE_USHORT"); + } + else if (H5Tequal(type, H5T_NATIVE_INT) == TRUE) { + h5tools_str_append(buffer, "H5T_NATIVE_INT"); + } + else if (H5Tequal(type, H5T_NATIVE_UINT) == TRUE) { + h5tools_str_append(buffer, "H5T_NATIVE_UINT"); + } + else if (H5Tequal(type, H5T_NATIVE_LONG) == TRUE) { + h5tools_str_append(buffer, "H5T_NATIVE_LONG"); + } + else if (H5Tequal(type, H5T_NATIVE_ULONG) == TRUE) { + h5tools_str_append(buffer, "H5T_NATIVE_ULONG"); + } + else if (H5Tequal(type, H5T_NATIVE_LLONG) == TRUE) { + h5tools_str_append(buffer, "H5T_NATIVE_LLONG"); + } + else if (H5Tequal(type, H5T_NATIVE_ULLONG) == TRUE) { + h5tools_str_append(buffer, "H5T_NATIVE_ULLONG"); + } + else { + + /* byte order */ + if (H5Tget_size(type) > 1) { + order = H5Tget_order(type); + if (H5T_ORDER_LE == order) { + order_s = " little-endian"; + } + else if (H5T_ORDER_BE == order) { + order_s = " big-endian"; + } + else if (H5T_ORDER_VAX == order) { + order_s = " mixed-endian"; + } + else { + order_s = " unknown-byte-order"; + } + } + else { + order_s = ""; + } + + /* sign */ + if ((sign = H5Tget_sign(type)) >= 0) { + if (H5T_SGN_NONE == sign) { + sign_s = " unsigned"; + } + else if (H5T_SGN_2 == sign) { + sign_s = ""; + } + else { + sign_s = " unknown-sign"; + } + } + else { + sign_s = " unknown-sign"; + } + + /* print size, order, and sign */ + h5tools_str_append(buffer, "%lu-bit%s%s integer", + (unsigned long) (8 * H5Tget_size(type)), order_s, sign_s); + } + break; + + case H5T_FLOAT: + if (H5Tequal(type, H5T_IEEE_F32BE) == TRUE) { + h5tools_str_append(buffer, "H5T_IEEE_F32BE"); + } + else if (H5Tequal(type, H5T_IEEE_F32LE) == TRUE) { + h5tools_str_append(buffer, "H5T_IEEE_F32LE"); + } + else if (H5Tequal(type, H5T_IEEE_F64BE) == TRUE) { + h5tools_str_append(buffer, "H5T_IEEE_F64BE"); + } + else if (H5Tequal(type, H5T_IEEE_F64LE) == TRUE) { + h5tools_str_append(buffer, "H5T_IEEE_F64LE"); + } + else if (H5Tequal(type, H5T_VAX_F32) == TRUE) { + h5tools_str_append(buffer, "H5T_VAX_F32"); + } + else if (H5Tequal(type, H5T_VAX_F64) == TRUE) { + h5tools_str_append(buffer, "H5T_VAX_F64"); + } + else if (H5Tequal(type, H5T_NATIVE_FLOAT) == TRUE) { + h5tools_str_append(buffer, "H5T_NATIVE_FLOAT"); + } + else if (H5Tequal(type, H5T_NATIVE_DOUBLE) == TRUE) { + h5tools_str_append(buffer, "H5T_NATIVE_DOUBLE"); +#if H5_SIZEOF_LONG_DOUBLE !=0 + } + else if (H5Tequal(type, H5T_NATIVE_LDOUBLE) == TRUE) { + h5tools_str_append(buffer, "H5T_NATIVE_LDOUBLE"); +#endif + } + else { + + /* byte order */ + if (H5Tget_size(type) > 1) { + order = H5Tget_order(type); + if (H5T_ORDER_LE == order) { + order_s = " little-endian"; + } + else if (H5T_ORDER_BE == order) { + order_s = " big-endian"; + } + else if (H5T_ORDER_VAX == order) { + order_s = " mixed-endian"; + } + else { + order_s = " unknown-byte-order"; + } + } + else { + order_s = ""; + } + + /* print size and byte order */ + h5tools_str_append(buffer, "%lu-bit%s floating-point", + (unsigned long) (8 * H5Tget_size(type)), order_s); + + } + break; + + case H5T_TIME: + h5tools_str_append(buffer, "H5T_TIME: not yet implemented"); + break; + + case H5T_STRING: + /* Make a copy of type in memory in case when TYPE is on disk, the size + * will be bigger than in memory. This makes it easier to compare + * types in memory. */ + tmp_type = H5Tcopy(type); + size = H5Tget_size(tmp_type); + str_pad = H5Tget_strpad(tmp_type); + cset = H5Tget_cset(tmp_type); + is_vlstr = H5Tis_variable_str(tmp_type); + + curr_pos = ctx->cur_column; + h5tools_str_append(buffer, "H5T_STRING %s", h5tools_dump_header_format->strblockbegin); + h5tools_render_element(stream, info, ctx, buffer, &curr_pos, ncols, 0, 0); + + ctx->indent_level++; + + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, 0, 0); + + h5tools_str_reset(buffer); + + if (is_vlstr) + h5tools_str_append(buffer, "%s H5T_VARIABLE;", STRSIZE); + else + h5tools_str_append(buffer, "%s %d;", STRSIZE, (int) size); + h5tools_render_element(stream, info, ctx, buffer, &curr_pos, ncols, 0, 0); + + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, 0, 0); + + h5tools_str_reset(buffer); + + h5tools_str_append(buffer, "%s ", STRPAD); + if (str_pad == H5T_STR_NULLTERM) + h5tools_str_append(buffer, "H5T_STR_NULLTERM;"); + else if (str_pad == H5T_STR_NULLPAD) + h5tools_str_append(buffer, "H5T_STR_NULLPAD;"); + else if (str_pad == H5T_STR_SPACEPAD) + h5tools_str_append(buffer, "H5T_STR_SPACEPAD;"); + else + h5tools_str_append(buffer, "H5T_STR_ERROR;"); + h5tools_render_element(stream, info, ctx, buffer, &curr_pos, ncols, 0, 0); + + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, 0, 0); + + h5tools_str_reset(buffer); + + h5tools_str_append(buffer, "%s ", CSET); + + if (cset == H5T_CSET_ASCII) + h5tools_str_append(buffer, "H5T_CSET_ASCII;"); + else + h5tools_str_append(buffer, "unknown_cset;"); + h5tools_render_element(stream, info, ctx, buffer, &curr_pos, ncols, 0, 0); + + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, 0, 0); + + h5tools_str_reset(buffer); + + str_type = H5Tcopy(H5T_C_S1); + if (is_vlstr) + H5Tset_size(str_type, H5T_VARIABLE); + else + H5Tset_size(str_type, size); + H5Tset_cset(str_type, cset); + H5Tset_strpad(str_type, str_pad); + + h5tools_str_append(buffer, "%s ", CTYPE); + + /* Check C variable-length string first. Are the two types equal? */ + if (H5Tequal(tmp_type, str_type)) { + h5tools_str_append(buffer, "H5T_C_S1;"); + goto done; + } + + /* Change the endianness and see if they're equal. */ + order = H5Tget_order(tmp_type); + if (order == H5T_ORDER_LE) + H5Tset_order(str_type, H5T_ORDER_LE); + else if (order == H5T_ORDER_BE) + H5Tset_order(str_type, H5T_ORDER_BE); + + if (H5Tequal(tmp_type, str_type)) { + h5tools_str_append(buffer, "H5T_C_S1;"); + goto done; + } + + /* If not equal to C variable-length string, check Fortran type. */ + if(H5Tclose(str_type) < 0) + HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tclose failed"); + str_type = H5Tcopy(H5T_FORTRAN_S1); + + H5Tset_cset(str_type, cset); + H5Tset_size(str_type, size); + H5Tset_strpad(str_type, str_pad); + + /* Are the two types equal? */ + if (H5Tequal(tmp_type, str_type)) { + h5tools_str_append(buffer, "H5T_FORTRAN_S1;"); + goto done; + } + + /* Change the endianness and see if they're equal. */ + order = H5Tget_order(tmp_type); + if (order == H5T_ORDER_LE) + H5Tset_order(str_type, H5T_ORDER_LE); + else if (order == H5T_ORDER_BE) + H5Tset_order(str_type, H5T_ORDER_BE); + + if (H5Tequal(tmp_type, str_type)) { + h5tools_str_append(buffer, "H5T_FORTRAN_S1;"); + goto done; + } + + /* Type doesn't match any of above. */ + h5tools_str_append(buffer, "unknown_one_character_type;"); + + done: + h5tools_render_element(stream, info, ctx, buffer, &curr_pos, ncols, 0, 0); + ctx->indent_level--; + + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, 0, 0); + + h5tools_str_reset(buffer); + if(H5Tclose(str_type) < 0) + HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tclose failed"); + if(H5Tclose(tmp_type) < 0) + HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tclose failed"); + + h5tools_str_append(buffer, "%s", h5tools_dump_header_format->strblockend); + break; + + case H5T_BITFIELD: + if (H5Tequal(type, H5T_STD_B8BE) == TRUE) { + h5tools_str_append(buffer, "H5T_STD_B8BE"); + } + else if (H5Tequal(type, H5T_STD_B8LE) == TRUE) { + h5tools_str_append(buffer, "H5T_STD_B8LE"); + } + else if (H5Tequal(type, H5T_STD_B16BE) == TRUE) { + h5tools_str_append(buffer, "H5T_STD_B16BE"); + } + else if (H5Tequal(type, H5T_STD_B16LE) == TRUE) { + h5tools_str_append(buffer, "H5T_STD_B16LE"); + } + else if (H5Tequal(type, H5T_STD_B32BE) == TRUE) { + h5tools_str_append(buffer, "H5T_STD_B32BE"); + } + else if (H5Tequal(type, H5T_STD_B32LE) == TRUE) { + h5tools_str_append(buffer, "H5T_STD_B32LE"); + } + else if (H5Tequal(type, H5T_STD_B64BE) == TRUE) { + h5tools_str_append(buffer, "H5T_STD_B64BE"); + } + else if (H5Tequal(type, H5T_STD_B64LE) == TRUE) { + h5tools_str_append(buffer, "H5T_STD_B64LE"); + } + else { + h5tools_str_append(buffer, "undefined bitfield"); + } + break; + + case H5T_OPAQUE: + h5tools_str_append(buffer, "H5T_OPAQUE %s", h5tools_dump_header_format->structblockbegin); + h5tools_render_element(stream, info, ctx, buffer, &curr_pos, ncols, 0, 0); + ctx->indent_level++; + { + char *ttag = H5Tget_tag(type); + + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, 0, 0); + + h5tools_str_reset(buffer); + h5tools_str_append(buffer, "OPAQUE_TAG \"%s\";", ttag); + h5tools_render_element(stream, info, ctx, buffer, &curr_pos, ncols, 0, 0); + + if (ttag) + HDfree(ttag); + } + ctx->indent_level--; + + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, 0, 0); + + h5tools_str_reset(buffer); + h5tools_str_append(buffer, "%s", h5tools_dump_header_format->structblockend); + break; + + case H5T_COMPOUND: + if((snmembers = H5Tget_nmembers(type)) < 0) + H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_nmembers failed"); + nmembers = (unsigned)snmembers; + + h5tools_str_append(buffer, "H5T_COMPOUND %s", h5tools_dump_header_format->structblockbegin); + h5tools_render_element(stream, info, ctx, buffer, &curr_pos, ncols, 0, 0); + + ctx->indent_level++; + for (i = 0; i < nmembers; i++) { + mname = H5Tget_member_name(type, i); + if((mtype = H5Tget_member_type(type, i))>=0) { + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, 0, 0); + + h5tools_str_reset(buffer); + h5tools_print_datatype(stream, buffer, info, ctx, mtype, TRUE); + + h5tools_str_append(buffer, " \"%s\";", mname); + h5tools_render_element(stream, info, ctx, buffer, &curr_pos, ncols, 0, 0); + if(H5Tclose(mtype) < 0) + HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tclose failed"); + } + else + HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tget_member_type failed"); + HDfree(mname); + } + ctx->indent_level--; + + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, 0, 0); + + h5tools_str_reset(buffer); + h5tools_str_append(buffer, "%s", h5tools_dump_header_format->structblockend); + break; + + case H5T_REFERENCE: + h5tools_str_append(buffer, "H5T_REFERENCE"); + if (H5Tequal(type, H5T_STD_REF_DSETREG) == TRUE) { + h5tools_str_append(buffer, " { H5T_STD_REF_DSETREG }"); + } + else { + h5tools_str_append(buffer, " { H5T_STD_REF_OBJECT }"); + } + break; + + case H5T_ENUM: + if((super = H5Tget_super(type)) < 0) + H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_nmembers failed"); + + h5tools_str_append(buffer, "H5T_ENUM %s", h5tools_dump_header_format->enumblockbegin); + h5tools_render_element(stream, info, ctx, buffer, &curr_pos, ncols, 0, 0); + ctx->indent_level++; + + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, 0, 0); + + h5tools_str_reset(buffer); + h5tools_print_datatype(stream, buffer, info, ctx, super, TRUE); + + if(H5Tclose(super) < 0) + HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tclose failed"); + + h5tools_str_append(buffer, ";"); + h5tools_render_element(stream, info, ctx, buffer, &curr_pos, ncols, 0, 0); + + h5tools_print_enum(stream, buffer, info, ctx, type); + + ctx->indent_level--; + + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, 0, 0); + + h5tools_str_reset(buffer); + h5tools_str_append(buffer, "%s", h5tools_dump_header_format->enumblockend); + + break; + + case H5T_VLEN: + if((super = H5Tget_super(type)) < 0) + H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_nmembers failed"); + + h5tools_str_append(buffer, "H5T_VLEN %s ", h5tools_dump_header_format->vlenblockbegin); + + h5tools_print_datatype(stream, buffer, info, ctx, super, TRUE); + + if(H5Tclose(super) < 0) + HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tclose failed"); + + h5tools_str_append(buffer, "%s", h5tools_dump_header_format->vlenblockend); + + break; + + case H5T_ARRAY: + h5tools_str_append(buffer, "H5T_ARRAY { "); + + /* Get array information */ + if((sndims = H5Tget_array_ndims(type)) >= 0) { + unsigned ndims = (unsigned)sndims; + + if(H5Tget_array_dims2(type, dims) >= 0) { + /* Print array dimensions */ + for (i = 0; i < ndims; i++) + h5tools_str_append(buffer, "[" HSIZE_T_FORMAT "]", dims[i]); + + h5tools_str_append(buffer, " "); + } + else + HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tget_array_dims2 failed"); + } + else + HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tget_array_ndims failed"); + + /* Get array base type */ + if((super = H5Tget_super(type)) >= 0) { + /* Print base type */ + h5tools_print_datatype(stream, buffer, info, ctx, super, TRUE); + /* Close array base type */ + if(H5Tclose(super) < 0) + HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tclose failed"); + } + else + HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tget_super failed"); + + h5tools_str_append(buffer, " }"); + + break; + + default: + h5tools_str_append(buffer, "unknown datatype"); + break; + } + +CATCH + return ret_value; +} + +/*------------------------------------------------------------------------- + * Function: print_dataspace + * + * Purpose: print the dataspace. + * + * Return: void + * + * In/Out: h5tools_str_t *buffer + * h5tools_context_t *ctx + * + *------------------------------------------------------------------------- + */ +int +h5tools_print_dataspace(FILE *stream, h5tools_str_t *buffer, const h5tool_format_t *info, + h5tools_context_t *ctx, hid_t space) +{ + HERR_INIT(int, SUCCEED) + hsize_t size[H5TOOLS_DUMP_MAX_RANK]; + hsize_t maxsize[H5TOOLS_DUMP_MAX_RANK]; + int ndims = -1; + H5S_class_t space_type = -1; + int i; + + if((ndims = H5Sget_simple_extent_dims(space, size, maxsize)) < 0) + H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_dims failed"); + + if((space_type = H5Sget_simple_extent_type(space)) < 0) + H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_type failed"); + + switch(space_type) { + case H5S_SCALAR: + /* scalar dataspace */ + h5tools_str_append(buffer, "%s %s", h5tools_dump_header_format->dataspacedescriptionbegin, S_SCALAR); + break; + + case H5S_SIMPLE: + /* simple dataspace */ + h5tools_str_append(buffer, "%s %s { %s " HSIZE_T_FORMAT, + h5tools_dump_header_format->dataspacedescriptionbegin, S_SIMPLE, + h5tools_dump_header_format->dataspacedimbegin, size[0]); + + for(i = 1; i < ndims; i++) + h5tools_str_append(buffer, ", " HSIZE_T_FORMAT, size[i]); + + h5tools_str_append(buffer, " %s / ", h5tools_dump_header_format->dataspacedimend); + + if(maxsize[0] == H5S_UNLIMITED) + h5tools_str_append(buffer, "%s %s", + h5tools_dump_header_format->dataspacedimbegin, "H5S_UNLIMITED"); + else + h5tools_str_append(buffer, "%s " HSIZE_T_FORMAT, + h5tools_dump_header_format->dataspacedimbegin, maxsize[0]); + + for(i = 1; i < ndims; i++) + if(maxsize[i] == H5S_UNLIMITED) + h5tools_str_append(buffer, ", %s", "H5S_UNLIMITED"); + else + h5tools_str_append(buffer, ", " HSIZE_T_FORMAT, maxsize[i]); + + h5tools_str_append(buffer, " %s }", h5tools_dump_header_format->dataspacedimend); + break; + + case H5S_NULL: + /* null dataspace */ + h5tools_str_append(buffer, "%s %s", h5tools_dump_header_format->dataspacedescriptionbegin, S_NULL); + break; + + case H5S_NO_CLASS: + default: + h5tools_str_append(buffer, "%s unknown dataspace %s\n", BEGIN, END); + break; + } /* end switch */ + +CATCH + return ret_value; +} + + +/*------------------------------------------------------------------------- + * Function: print_enum + * + * Purpose: prints the enum data + * + * Return: void + * + * In/Out: h5tools_str_t *buffer + * h5tools_context_t *ctx + * + *-----------------------------------------------------------------------*/ +int +h5tools_print_enum(FILE *stream, h5tools_str_t *buffer, const h5tool_format_t *info, + h5tools_context_t *ctx, hid_t type) +{ + HERR_INIT(int, SUCCEED) + char **name = NULL; /*member names */ + unsigned char *value = NULL; /*value array */ + unsigned char *copy = NULL; /*a pointer to value array */ + unsigned i; + unsigned nmembs = 0; /*number of members */ + int snmembs; + int nchars; /*number of output characters */ + hid_t super = -1; /*enum base integer type */ + hid_t native = -1; /*native integer datatype */ + H5T_sign_t sign_type; /*sign of value type */ + size_t type_size; /*value type size */ + size_t dst_size; /*destination value type size */ + size_t ncols = 80; /*available output width */ + hsize_t curr_pos = 0; /* total data element position */ + + if (info->line_ncols > 0) + ncols = info->line_ncols; + + if((snmembs = H5Tget_nmembers(type)) < 0) + H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_nmembers failed"); + nmembs = (unsigned)snmembs; + HDassert(nmembs > 0); + + if((super = H5Tget_super(type)) < 0) + H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_super failed"); + + if((type_size = H5Tget_size(type)) <= 0) + H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_size(type) failed"); + + /* + * Determine what datatype to use for the native values. To simplify + * things we entertain three possibilities: + * 1. long long -- the largest native signed integer + * 2. unsigned long long -- the largest native unsigned integer + * 3. raw format + */ + if(type_size <= sizeof(long long)) { + dst_size = sizeof(long long); + + if((sign_type = H5Tget_sign(type))<0) + H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_sign failed"); + if(H5T_SGN_NONE == sign_type) + native = H5T_NATIVE_ULLONG; + else + native = H5T_NATIVE_LLONG; + } /* end if */ + else + dst_size = type_size; + + /* Get the names and raw values of all members */ + if(NULL == (name = (char **)HDcalloc(nmembs, sizeof(char *)))) + H5E_THROW(FAIL, H5E_tools_min_id_g, "Could not allocate buffer for member name"); + if(NULL == (value = (unsigned char *)HDcalloc(nmembs, MAX(type_size, dst_size)))) + H5E_THROW(FAIL, H5E_tools_min_id_g, "Could not allocate buffer for member value"); + + for (i = 0; i < nmembs; i++) { + name[i] = H5Tget_member_name(type, i); + if(H5Tget_member_value(type, i, value + i * type_size) < 0) + H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Tget_member_value failed"); + } + + /* Convert values to native datatype */ + if (native > 0) + if(H5Tconvert(super, native, nmembs, value, NULL, H5P_DEFAULT) < 0) + H5E_THROW(FAIL, H5E_tools_min_id_g, "H5Tconvert failed"); + + /* + * Sort members by increasing value + * ***not implemented yet*** + */ + + /* Print members */ + for (i = 0; i < nmembs; i++) { + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, 0, 0); + + h5tools_str_reset(buffer); + h5tools_str_append(buffer, "\"%s\"", name[i]); + nchars = HDstrlen(name[i]); + h5tools_str_append(buffer, "%*s ", MAX(0, 16 - nchars), ""); + + if (native < 0) { + size_t j; + + h5tools_str_append(buffer, "0x"); + + for (j = 0; j < dst_size; j++) + h5tools_str_append(buffer, "%02x", value[i * dst_size + j]); + } + else 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; + h5tools_str_append(buffer, HSIZE_T_FORMAT, *((unsigned long long *) ((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; + h5tools_str_append(buffer, "%" H5_PRINTF_LL_WIDTH "d", *((long long *) ((void *) copy))); + } + + h5tools_str_append(buffer, ";"); + h5tools_render_element(stream, info, ctx, buffer, &curr_pos, ncols, 0, 0); + } + +CATCH + if(name) { + /* Release resources */ + for(i = 0; i < nmembs; i++) + if(name[i]) + HDfree(name[i]); + HDfree(name); + } /* end if */ + + if(value) + HDfree(value); + + if(super >= 0 && H5Tclose(super) < 0) + H5E_THROW(FAIL, H5E_tools_min_id_g, "Could not close datatype's super class"); + + if(0 == nmembs) + h5tools_str_append(buffer, "\n"); + + return ret_value; +} + +/*------------------------------------------------------------------------- + * Function: dump_datatype + * + * Purpose: Dump the datatype. Datatype can be HDF5 predefined + * atomic datatype or committed/transient datatype. + * + * Return: void + * + * In/Out: h5tools_context_t *ctx + *------------------------------------------------------------------------- + */ +void +h5tools_dump_datatype(FILE *stream, const h5tool_format_t *info, + h5tools_context_t *ctx, hid_t type) +{ + h5tools_str_t buffer; /* string into which to render */ + size_t ncols = 80; /* available output width */ + hsize_t curr_pos = ctx->sm_pos; /* total data element position */ + /* pass to the prefix in h5tools_simple_prefix the total position + * instead of the current stripmine position i; this is necessary + * to print the array indices + */ + + /* setup */ + HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + + if (info->line_ncols > 0) + ncols = info->line_ncols; + + ctx->need_prefix = TRUE; + + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "%s %s ", + h5tools_dump_header_format->datatypebegin, + h5tools_dump_header_format->datatypeblockbegin); + h5tools_print_datatype(stream, &buffer, info, ctx, type, TRUE); + if (HDstrlen(h5tools_dump_header_format->datatypeblockend)) { + h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->datatypeblockend); + if (HDstrlen(h5tools_dump_header_format->datatypeend)) + h5tools_str_append(&buffer, " "); + } + if (HDstrlen(h5tools_dump_header_format->datatypeend)) + h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->datatypeend); + + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, ncols, 0, 0); + + h5tools_str_close(&buffer); +} + +/*------------------------------------------------------------------------- + * Function: dump_dataspace + * + * Purpose: Dump the dataspace. + * + * Return: void + * + * In/Out: h5tools_context_t *ctx + *------------------------------------------------------------------------- + */ +void +h5tools_dump_dataspace(FILE *stream, const h5tool_format_t *info, + h5tools_context_t *ctx, hid_t type) +{ + h5tools_str_t buffer; /* string into which to render */ + size_t ncols = 80; /* available output width */ + hsize_t curr_pos = ctx->sm_pos; /* total data element position */ + /* pass to the prefix in h5tools_simple_prefix the total position + * instead of the current stripmine position i; this is necessary + * to print the array indices + */ + + /* setup */ + HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + + if (info->line_ncols > 0) + ncols = info->line_ncols; + + ctx->need_prefix = TRUE; + + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "%s ", + h5tools_dump_header_format->dataspacebegin); + + h5tools_print_dataspace(stream, &buffer, info, ctx, type); + + if (HDstrlen(h5tools_dump_header_format->dataspaceblockend)) { + h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->dataspaceblockend); + if (HDstrlen(h5tools_dump_header_format->dataspaceend)) + h5tools_str_append(&buffer, " "); + } + if (HDstrlen(h5tools_dump_header_format->dataspaceend)) + h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->dataspaceend); + + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, ncols, 0, 0); + + h5tools_str_close(&buffer); +} + +/*------------------------------------------------------------------------- + * Function: dump_oid + * + * Purpose: Dump the oid. + * + * Return: void + * + * In/Out: h5tools_context_t *ctx + *------------------------------------------------------------------------- + */ +void +h5tools_dump_oid(FILE *stream, const h5tool_format_t *info, + h5tools_context_t *ctx, hid_t oid) +{ + h5tools_str_t buffer; /* string into which to render */ + size_t ncols = 80; /* available output width */ + hsize_t curr_pos = ctx->sm_pos; /* total data element position */ + /* pass to the prefix in h5tools_simple_prefix the total position + * instead of the current stripmine position i; this is necessary + * to print the array indices + */ + + /* setup */ + HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + + if (info->line_ncols > 0) + ncols = info->line_ncols; + + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); + + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "%s %s %d %s", OBJID, BEGIN, oid, END); + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, ncols, 0, 0); + + h5tools_str_close(&buffer); +} + + +/*------------------------------------------------------------------------- + * Function: dump_fill_value + * + * Purpose: prints the fill value + * + * Return: void + * + * Programmer: pvn + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +void +h5tools_print_fill_value(h5tools_str_t *buffer/*in,out*/, const h5tool_format_t *info, h5tools_context_t *ctx/*in,out*/, hid_t dcpl, hid_t type_id, hid_t obj_id) +{ + size_t size; + hid_t n_type; + hsize_t nelmts = 1; + void *buf = NULL; + + n_type = h5tools_get_native_type(type_id); + + size = H5Tget_size(n_type); + buf = HDmalloc(size); + + H5Pget_fill_value(dcpl, n_type, buf); + + h5tools_str_sprint(buffer, info, obj_id, n_type, buf, ctx); + + H5Tclose(n_type); + + if (buf) + HDfree (buf); +} + +/*------------------------------------------------------------------------- + * Function: dump_dcpl + * + * Purpose: prints several dataset create property list properties + * + * Return: void + * + * Modifications: pvn, March 28, 2008 + * Add a COMPRESSION ratio information for cases when filters are present + * + *------------------------------------------------------------------------- + */ +void +h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, + h5tools_context_t *ctx, hid_t dcpl_id,hid_t type_id, hid_t obj_id) +{ + int nfilters; /* number of filters */ + int rank; /* rank */ + int i; + unsigned j; + unsigned filt_flags; /* filter flags */ + unsigned cd_values[20]; /* filter client data values */ + unsigned szip_options_mask; + unsigned szip_pixels_per_block; + H5Z_filter_t filtn; /* filter identification number */ + H5D_fill_value_t fvstatus; + H5D_alloc_time_t at; + H5D_fill_time_t ft; + size_t ncols = 80; /* available output width */ + size_t cd_nelmts; /* filter client number of values */ + off_t offset; /* offset of external file */ + char f_name[256]; /* filter name */ + char name[256]; /* external file name */ + hsize_t chsize[64]; /* chunk size in elements */ + hsize_t size; /* size of external file */ + hsize_t storage_size; + hsize_t curr_pos = 0; /* total data element position */ + hsize_t elmt_counter = 0;/* counts the # elements printed.*/ + haddr_t ioffset; + h5tools_str_t buffer; /* string into which to render */ + + /* setup */ + HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + if (info->line_ncols > 0) + ncols = info->line_ncols; + + storage_size = H5Dget_storage_size(obj_id); + nfilters = H5Pget_nfilters(dcpl_id); + ioffset = H5Dget_offset(obj_id); + HDstrcpy(f_name,"\0"); + + /*------------------------------------------------------------------------- + * STORAGE_LAYOUT + *------------------------------------------------------------------------- + */ + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); + + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "%s %s", STORAGE_LAYOUT, BEGIN); + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, ncols, 0, 0); + + if(H5D_CHUNKED == H5Pget_layout(dcpl_id)) { + ctx->indent_level++; + + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); + + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "%s ", CHUNKED); + + rank = H5Pget_chunk(dcpl_id,NELMTS(chsize),chsize); + h5tools_str_append(&buffer, "%s " HSIZE_T_FORMAT, h5tools_dump_header_format->dataspacedimbegin, chsize[0]); + for(i = 1; i < rank; i++) + h5tools_str_append(&buffer, ", " HSIZE_T_FORMAT, chsize[i]); + h5tools_str_append(&buffer, " %s", h5tools_dump_header_format->dataspacedimend); + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, ncols, 0, 0); + + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); + + h5tools_str_reset(&buffer); + + /* if there are filters, print a compression ratio */ + if(nfilters) { + hsize_t dims[H5S_MAX_RANK]; + hsize_t nelmts = 1; + double ratio = 0; + int ok = 0; + + hid_t tid = H5Dget_type(obj_id); + hid_t sid = H5Dget_space(obj_id); + size_t datum_size = H5Tget_size(tid); + int ndims = H5Sget_simple_extent_dims(sid, dims, NULL); + + /* only print the compression ratio for these filters */ + 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_name), f_name, NULL); + + switch(filtn) { + case H5Z_FILTER_DEFLATE: + case H5Z_FILTER_SZIP: + case H5Z_FILTER_NBIT: + case H5Z_FILTER_SCALEOFFSET: + ok = 1; + break; + } + } + + if(ndims && ok) { + hsize_t uncomp_size; + + for(i = 0; i < ndims; i++) { + nelmts *= dims[i]; + } + uncomp_size = nelmts * datum_size; + + /* compression ratio = uncompressed size / compressed size */ + + if(storage_size != 0) + ratio = (double) uncomp_size / (double) storage_size; + + h5tools_str_append(&buffer, "SIZE " HSIZE_T_FORMAT" (%.3f:1 COMPRESSION)", storage_size, ratio); + + } + else + h5tools_str_append(&buffer, "SIZE " HSIZE_T_FORMAT, storage_size); + + H5Sclose(sid); + H5Tclose(tid); + + } + else { + h5tools_str_append(&buffer, "SIZE " HSIZE_T_FORMAT, storage_size); + } + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, ncols, 0, 0); + + ctx->indent_level--; + + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); + + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "%s",END); + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, ncols, 0, 0); + } + else if(H5D_COMPACT == H5Pget_layout(dcpl_id)) { + ctx->indent_level++; + + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); + + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "%s", COMPACT); + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, ncols, 0, 0); + + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); + + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "SIZE " HSIZE_T_FORMAT, storage_size); + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, ncols, 0, 0); + + ctx->indent_level--; + + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); + + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "%s",END); + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, ncols, 0, 0); + } + else if(H5D_CONTIGUOUS == H5Pget_layout(dcpl_id)) { + int next; + + next = H5Pget_external_count(dcpl_id); + + /*------------------------------------------------------------------------- + * EXTERNAL_FILE + *------------------------------------------------------------------------- + */ + if(next) { + ctx->indent_level++; + + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); + + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "%s", CONTIGUOUS); + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, ncols, 0, 0); + + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); + + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "%s %s", EXTERNAL, BEGIN); + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, ncols, 0, 0); + + ctx->indent_level++; + for(j = 0; j < (unsigned)next; j++) { + H5Pget_external(dcpl_id, j, sizeof(name), name, &offset, &size); + + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); + + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "FILENAME %s SIZE " HSIZE_T_FORMAT, name, size); + h5tools_str_append(&buffer, " OFFSET %ld", offset); + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, ncols, 0, 0); + } + ctx->indent_level--; + + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); + + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "%s",END); + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, ncols, 0, 0); + + ctx->indent_level--; + + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); + + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "%s",END); + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, ncols, 0, 0); + } + else { + ctx->indent_level++; + + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); + + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "%s", CONTIGUOUS); + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, ncols, 0, 0); + + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); + + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer,"SIZE " HSIZE_T_FORMAT, storage_size); + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, ncols, 0, 0); + + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); + + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer,"OFFSET "H5_PRINTF_HADDR_FMT, ioffset); + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, ncols, 0, 0); + + ctx->indent_level--; + + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); + + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "%s",END); + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, ncols, 0, 0); + } + } + /*------------------------------------------------------------------------- + * FILTERS + *------------------------------------------------------------------------- + */ + + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); + + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "%s %s", FILTERS, BEGIN); + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, ncols, 0, 0); + + ctx->indent_level++; + + if(nfilters) { + 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_name), f_name, NULL); + + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); + + h5tools_str_reset(&buffer); + switch(filtn) { + case H5Z_FILTER_DEFLATE: + h5tools_str_append(&buffer, "%s %s %s %d %s", DEFLATE, BEGIN, DEFLATE_LEVEL, cd_values[0], END); + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, ncols, 0, 0); + break; + case H5Z_FILTER_SHUFFLE: + h5tools_str_append(&buffer, "%s", SHUFFLE); + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, ncols, 0, 0); + break; + case H5Z_FILTER_FLETCHER32: + h5tools_str_append(&buffer, "%s", FLETCHER32); + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, ncols, 0, 0); + break; + case H5Z_FILTER_SZIP: + { + szip_options_mask = cd_values[0];; + szip_pixels_per_block = cd_values[1]; + + h5tools_str_append(&buffer, "%s %s",SZIP, BEGIN); + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, ncols, 0, 0); + + ctx->indent_level++; + + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); + + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "PIXELS_PER_BLOCK %d", szip_pixels_per_block); + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, ncols, 0, 0); + + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); + + h5tools_str_reset(&buffer); + if(szip_options_mask & H5_SZIP_CHIP_OPTION_MASK) + h5tools_str_append(&buffer, "MODE %s", "HARDWARE"); + else if(szip_options_mask & H5_SZIP_ALLOW_K13_OPTION_MASK) + h5tools_str_append(&buffer, "MODE %s", "K13"); + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, ncols, 0, 0); + + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); + + h5tools_str_reset(&buffer); + if(szip_options_mask & H5_SZIP_EC_OPTION_MASK) + h5tools_str_append(&buffer, "CODING %s", "ENTROPY"); + else if(szip_options_mask & H5_SZIP_NN_OPTION_MASK) + h5tools_str_append(&buffer, "CODING %s", "NEAREST NEIGHBOUR"); + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, ncols, 0, 0); + + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); + + h5tools_str_reset(&buffer); + if(szip_options_mask & H5_SZIP_LSB_OPTION_MASK) + h5tools_str_append(&buffer, "BYTE_ORDER %s", "LSB"); + else if(szip_options_mask & H5_SZIP_MSB_OPTION_MASK) + h5tools_str_append(&buffer, "BYTE_ORDER %s", "MSB"); + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, ncols, 0, 0); + + if(szip_options_mask & H5_SZIP_RAW_OPTION_MASK) { + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); + + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "HEADER %s", "RAW"); + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, ncols, 0, 0); + } + + ctx->indent_level--; + + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); + + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "%s",END); + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, ncols, 0, 0); + } + break; + case H5Z_FILTER_NBIT: + h5tools_str_append(&buffer, "%s", NBIT); + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, ncols, 0, 0); + break; + case H5Z_FILTER_SCALEOFFSET: + h5tools_str_append(&buffer, "%s %s %s %d %s", SCALEOFFSET, BEGIN, SCALEOFFSET_MINBIT, cd_values[0], END); + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, ncols, 0, 0); + break; + default: + if(H5Zfilter_avail(filtn)) + h5tools_str_append(&buffer, "%s %s", "USER_REGISTERED_FILTER", BEGIN); + else + h5tools_str_append(&buffer, "%s %s", "UNKNOWN_FILTER", BEGIN); + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, ncols, 0, 0); + + ctx->indent_level++; + + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); + + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "FILTER_ID %d", filtn); + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, ncols, 0, 0); + + if(f_name[0] != '\0') { + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); + + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "COMMENT %s", f_name); + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, ncols, 0, 0); + } + if (cd_nelmts) { + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); + + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "%s %s ","PARAMS", BEGIN); + for (j=0; jindent_level--; + + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); + + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "%s",END); + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, ncols, 0, 0); + break; + }/*switch*/ + } /*i*/ + }/*nfilters*/ + else { + + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); + + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "NONE"); + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, ncols, 0, 0); + } + ctx->indent_level--; + + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); + + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "%s",END); + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, ncols, 0, 0); + + /*------------------------------------------------------------------------- + * FILLVALUE + *------------------------------------------------------------------------- + */ + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); + + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "%s %s", FILLVALUE, BEGIN); + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, ncols, 0, 0); + + ctx->indent_level++; + + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); + + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "FILL_TIME "); + + H5Pget_fill_time(dcpl_id, &ft); + switch(ft) { + case H5D_FILL_TIME_ALLOC: + h5tools_str_append(&buffer, "%s", "H5D_FILL_TIME_ALLOC"); + break; + case H5D_FILL_TIME_NEVER: + h5tools_str_append(&buffer, "%s", "H5D_FILL_TIME_NEVER"); + break; + case H5D_FILL_TIME_IFSET: + h5tools_str_append(&buffer, "%s", "H5D_FILL_TIME_IFSET"); + break; + default: + HDassert(0); + break; + } + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, ncols, 0, 0); + + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); + + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "%s ", "VALUE "); + H5Pfill_value_defined(dcpl_id, &fvstatus); + if(fvstatus == H5D_FILL_VALUE_UNDEFINED) + h5tools_str_append(&buffer, "%s", "H5D_FILL_VALUE_UNDEFINED"); + else { + ctx->indent_level--; + h5tools_print_fill_value(&buffer, info, ctx, dcpl_id, type_id, obj_id); + ctx->indent_level++; + } + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, ncols, 0, 0); + ctx->indent_level--; + + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); + + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "%s", END); + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, ncols, 0, 0); + + /*------------------------------------------------------------------------- + * ALLOCATION_TIME + *------------------------------------------------------------------------- + */ + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); + + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "ALLOCATION_TIME %s", BEGIN); + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, ncols, 0, 0); + + ctx->indent_level++; + + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); + + h5tools_str_reset(&buffer); + H5Pget_alloc_time(dcpl_id, &at); + switch(at) { + case H5D_ALLOC_TIME_EARLY: + h5tools_str_append(&buffer, "%s", "H5D_ALLOC_TIME_EARLY"); + break; + case H5D_ALLOC_TIME_INCR: + h5tools_str_append(&buffer, "%s", "H5D_ALLOC_TIME_INCR"); + break; + case H5D_ALLOC_TIME_LATE: + h5tools_str_append(&buffer, "%s", "H5D_ALLOC_TIME_LATE"); + break; + default: + HDassert(0); + break; + } + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, ncols, 0, 0); + + ctx->indent_level--; + + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); + + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "%s", END); + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, ncols, 0, 0); + + h5tools_str_close(&buffer); +} + +/*------------------------------------------------------------------------- + * Function: dump_comment + * + * Purpose: prints the comment for the the object name + * + * Return: void + * + *------------------------------------------------------------------------- + */ +void +h5tools_dump_comment(FILE *stream, const h5tool_format_t *info, + h5tools_context_t *ctx, hid_t obj_id) +{ + char *comment = NULL; + ssize_t cmt_bufsize = -1; + size_t buf_size = 0; + size_t ncols = 80; /* available output width */ + h5tools_str_t buffer; /* string into which to render */ + hsize_t elmt_counter = 0;/* counts the # elements printed.*/ + hsize_t curr_pos = ctx->sm_pos; /* total data element position */ + /* pass to the prefix in h5tools_simple_prefix the total position + * instead of the current stripmine position i; this is necessary + * to print the array indices + */ + + /* setup */ + HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + + if (info->line_ncols > 0) + ncols = info->line_ncols; + + cmt_bufsize = H5Oget_comment(obj_id, comment, buf_size); + + /* call H5Oget_comment again with the correct value. + * If the call to H5Oget_comment returned an error, skip this block */ + if (cmt_bufsize > 0) { + comment = (char *)HDmalloc((size_t)(cmt_bufsize+1)); /* new_size including null terminator */ + if(comment) { + cmt_bufsize = H5Oget_comment(obj_id, comment, cmt_bufsize); + if(cmt_bufsize > 0) { + comment[cmt_bufsize] = '\0'; /* necessary because null char is not returned */ + + ctx->need_prefix = TRUE; + + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "COMMENT \"%s\"", comment); + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, ncols, 0, 0); + + h5tools_str_close(&buffer); + } /* end if */ + HDfree(comment); + } + } +} /* end dump_comment() */ + +/*------------------------------------------------------------------------- + * Function: dump_attribute + * + * Purpose: Dump the attribute. + * + * Return: void + * + * In/Out: h5tools_context_t *ctx + *------------------------------------------------------------------------- + */ +void +h5tools_dump_attribute(FILE *stream, const h5tool_format_t *info, + h5tools_context_t *ctx, hid_t oid, const char *attr_name, hid_t attr_id, + int display_index, int display_char) +{ + h5tools_str_t buffer; /* string into which to render */ + size_t ncols = 80; /* available output width */ + hsize_t elmt_counter = 0;/* counts the # elements printed.*/ + hsize_t curr_pos = ctx->sm_pos; /* total data element position */ + /* pass to the prefix in h5tools_simple_prefix the total position + * instead of the current stripmine position i; this is necessary + * to print the array indices + */ + + /* setup */ + HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + + if (info->line_ncols > 0) + ncols = info->line_ncols; + + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); + + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "%s \"%s\" %s", + h5tools_dump_header_format->attributebegin, attr_name, + h5tools_dump_header_format->attributeblockbegin); + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, ncols, 0, 0); + + if(attr_id < 0) { + error_msg("unable to open attribute \"%s\"\n", attr_name); + } + else { + hid_t type, space; + + ctx->indent_level++; + + type = H5Aget_type(attr_id); + h5tools_dump_datatype(stream, info, ctx, type); + + space = H5Aget_space(attr_id); + h5tools_dump_dataspace(stream, info, ctx, space); + + if(oid_output) + h5tools_dump_oid(stream, info, ctx, attr_id); + + if(data_output || attr_data_output) + h5tools_dump_data(stream, info, ctx, attr_id, FALSE, NULL, display_index, display_char); + + ctx->indent_level--; + + H5Tclose(type); + H5Sclose(space); + H5Aclose(attr_id); + } + + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, 0, 0); + + h5tools_str_reset(&buffer); + + if (HDstrlen(h5tools_dump_header_format->attributeblockend)) { + h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->attributeblockend); + if (HDstrlen(h5tools_dump_header_format->attributeend)) + h5tools_str_append(&buffer, " "); + } + if (HDstrlen(h5tools_dump_header_format->attributeend)) + h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->attributeend); + + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, ncols, 0, 0); + + h5tools_str_close(&buffer); +} + +/*------------------------------------------------------------------------- + * Function: dump_dims + * + * Purpose: Dump the dimensions handed to it in a comma separated list + * + * Return: void + * + * Programmer: Bill Wendling + * Tuesday, 27. February 2001 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +void +h5tools_print_dims(h5tools_str_t *buffer, hsize_t *s, int dims) +{ + int i; + + for (i = 0; i < dims; i++) { + h5tools_str_append(buffer, HSIZE_T_FORMAT, s[i]); + + if (i + 1 != dims) h5tools_str_append(buffer, ", "); + } +} + +/*------------------------------------------------------------------------- + * Function: print_packed_bits + * + * Purpose: Prints the packed bits offset and length + * + * Return: void + * + *------------------------------------------------------------------------- + */ +void +h5tools_print_packed_bits(h5tools_str_t *buffer, hid_t type) +{ + int packed_bits_size = 0; + + hid_t n_type = h5tools_get_native_type(type); + if(H5Tget_class(n_type)==H5T_INTEGER) { + if(H5Tequal(n_type, H5T_NATIVE_SCHAR) == TRUE) { + packed_bits_size = 8 * sizeof(char); + } + else if(H5Tequal(n_type, H5T_NATIVE_UCHAR) == TRUE) { + packed_bits_size = 8 * sizeof(unsigned char); + } + else if(H5Tequal(n_type, H5T_NATIVE_SHORT) == TRUE) { + packed_bits_size = 8 * sizeof(short); + } + else if(H5Tequal(n_type, H5T_NATIVE_USHORT) == TRUE) { + packed_bits_size = 8 * sizeof(unsigned short); + } + else if(H5Tequal(n_type, H5T_NATIVE_INT) == TRUE) { + packed_bits_size = 8 * sizeof(int); + } + else if(H5Tequal(n_type, H5T_NATIVE_UINT) == TRUE) { + packed_bits_size = 8 * sizeof(unsigned int); + } + else if(H5Tequal(n_type, H5T_NATIVE_LONG) == TRUE) { + packed_bits_size = 8 * sizeof(long); + } + else if(H5Tequal(n_type, H5T_NATIVE_ULONG) == TRUE) { + packed_bits_size = 8 * sizeof(unsigned long); + } + else if(H5Tequal(n_type, H5T_NATIVE_LLONG) == TRUE) { + packed_bits_size = 8 * sizeof(long long); + } + else if(H5Tequal(n_type, H5T_NATIVE_ULLONG) == TRUE) { + packed_bits_size = 8 * sizeof(unsigned long long); + } + else + error_msg("Packed Bit not valid for this datatype"); + } + + if ((packed_bits_size>0) && (packed_data_offset + packed_data_length) > packed_bits_size) { + error_msg("Packed Bit offset+length value(%d) too large. Max is %d\n", packed_data_offset+packed_data_length, packed_bits_size); + packed_data_mask = 0; + }; + h5tools_str_append(buffer, "%s %s=%d %s=%d", PACKED_BITS, PACKED_OFFSET, packed_data_offset, PACKED_LENGTH, packed_data_length); +} + +/*------------------------------------------------------------------------- + * Function: dump_subsetting_header + * + * Purpose: Dump the subsetting header like specified in the DDL. + * + * Return: void + * + * Programmer: Bill Wendling + * Tuesday, 27. February 2001 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +void +h5tools_dump_subsetting_header(FILE *stream, const h5tool_format_t *info, + h5tools_context_t *ctx, struct subset_t *sset, int dims) +{ + h5tools_str_t buffer; /* string into which to render */ + hsize_t curr_pos = 0; /* total data element position */ + size_t ncols = 80; /* available output width */ + + /* setup */ + HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + if (info->line_ncols > 0) + ncols = info->line_ncols; + + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, 0, 0); + + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "%s %s", h5tools_dump_header_format->subsettingbegin, h5tools_dump_header_format->subsettingblockbegin); + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, ncols, 0, 0); + + ctx->indent_level++; + + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, 0, 0); + + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "%s %s ", h5tools_dump_header_format->startbegin, h5tools_dump_header_format->startblockbegin); + h5tools_print_dims(&buffer, sset->start.data, dims); + h5tools_str_append(&buffer, "%s %s", h5tools_dump_header_format->startend, h5tools_dump_header_format->startblockend); + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, ncols, 0, 0); + + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, 0, 0); + + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "%s %s ", h5tools_dump_header_format->stridebegin, h5tools_dump_header_format->strideblockbegin); + h5tools_print_dims(&buffer, sset->stride.data, dims); + h5tools_str_append(&buffer, "%s %s", h5tools_dump_header_format->strideend, h5tools_dump_header_format->strideblockend); + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, ncols, 0, 0); + + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, 0, 0); + + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "%s %s ", h5tools_dump_header_format->countbegin, h5tools_dump_header_format->countblockbegin); + + if(sset->count.data) + h5tools_print_dims(&buffer, sset->count.data, dims); + else + h5tools_str_append(&buffer, "DEFAULT"); + + h5tools_str_append(&buffer, "%s %s", h5tools_dump_header_format->countend, h5tools_dump_header_format->countblockend); + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, ncols, 0, 0); + + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, 0, 0); + + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "%s %s ", h5tools_dump_header_format->blockbegin, h5tools_dump_header_format->blockblockbegin); + + if(sset->block.data) + h5tools_print_dims(&buffer, sset->block.data, dims); + else + h5tools_str_append(&buffer, "DEFAULT"); + + h5tools_str_append(&buffer, "%s %s", h5tools_dump_header_format->blockend, h5tools_dump_header_format->blockblockend); + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, ncols, 0, 0); + + ctx->indent_level--; + + h5tools_str_close(&buffer); +} + +/*------------------------------------------------------------------------- + * Function: dump_data + * + * Purpose: Dump attribute or dataset data + * + * Return: void + * + *------------------------------------------------------------------------- + */ +void +h5tools_dump_data(FILE *stream, const h5tool_format_t *info, + h5tools_context_t *ctx, hid_t obj_id, int obj_data, struct subset_t *sset, + int display_index, int display_char) +{ + H5S_class_t space_type; + int ndims; + int i; + hid_t space; + hid_t type; + hid_t p_type; + hsize_t size[64]; + hsize_t alloc_size; + hsize_t nelmts = 1; + int status = -1; + void *buf = NULL; + h5tools_str_t buffer; /* string into which to render */ + hsize_t curr_pos = 0; /* total data element position */ + size_t ncols = 80; /* available output width */ + h5tool_format_t string_dataformat; + h5tool_format_t outputformat; + + /* setup */ + HDmemset(&buffer, 0, sizeof(h5tools_str_t)); + if (info->line_ncols > 0) + ncols = info->line_ncols; + + outputformat = *info; + string_dataformat = *info; + /* print the matrix indices */ + string_dataformat.pindex = display_index; + + /* do not print indices for regions */ + if(obj_data) { + hid_t f_type = H5Dget_type(obj_id); + + if (H5Tequal(f_type, H5T_STD_REF_DSETREG)) { + /* For the region option, correct the display of indices */ + if (region_output) { + if (!string_dataformat.pindex) { + string_dataformat.idx_fmt = ""; + string_dataformat.idx_n_fmt = ""; + string_dataformat.idx_sep = ""; + string_dataformat.line_pre = ""; + } + } + else + string_dataformat.pindex = 0; + } + H5Tclose(f_type); + } + + if (string_dataformat.pindex) { + string_dataformat.idx_fmt = "(%s): "; + string_dataformat.idx_n_fmt = HSIZE_T_FORMAT; + string_dataformat.idx_sep = ","; + string_dataformat.line_pre = "%s"; + } + info = &string_dataformat; + + if (sset && obj_data) { + hid_t f_space = H5Dget_space(obj_id); + + h5tools_dump_subsetting_header(stream, &outputformat, ctx, sset, H5Sget_simple_extent_ndims(f_space)); + H5Sclose(f_space); + + ctx->indent_level++; + } + + ctx->need_prefix = TRUE; + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "%s %s", h5tools_dump_header_format->databegin, h5tools_dump_header_format->datablockbegin); + h5tools_render_element(stream, &outputformat, ctx, &buffer, &curr_pos, ncols, 0, 0); + + /* Print all the values. */ + if(obj_data) { + h5tools_context_t datactx = *ctx; /* print context */ + hid_t f_type = H5Dget_type(obj_id); + + if((display_char && H5Tget_size(f_type) == 1) && (H5Tget_class(f_type) == H5T_INTEGER)) { + /* + * Print 1-byte integer data as an ASCII character string + * instead of integers if the `-r' or `--string' command-line + * option was given. + * + * We don't want to modify the global dataformat, so make a + * copy of it instead. + */ + string_dataformat = *info; + string_dataformat.idx_fmt = "\""; + info = &string_dataformat; + datactx.indent_level++; + datactx.need_prefix = TRUE; + h5tools_simple_prefix(stream, info, &datactx, 0, 0); + + string_dataformat = *info; + string_dataformat.idx_fmt = "\""; + string_dataformat.line_multi_new = 1; + string_dataformat.str_repeat = 8; + string_dataformat.ascii = TRUE; + string_dataformat.elmt_suf1 = ""; + string_dataformat.elmt_suf2 = ""; + string_dataformat.line_suf = "\""; + info = &string_dataformat; + } + else + datactx.need_prefix = TRUE; + status = h5tools_dump_dset(stream, info, &datactx, obj_id, -1, sset); + if((display_char && H5Tget_size(f_type) == 1) && (H5Tget_class(f_type) == H5T_INTEGER)) { + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "\""); + h5tools_render_element(stream, &outputformat, ctx, &buffer, &curr_pos, ncols, 0, 0); + } + H5Tclose(f_type); + } + else { + h5tools_context_t datactx = *ctx; /* print context */ + /* need to call h5tools_dump_mem for the attribute data */ + space = H5Aget_space(obj_id); + space_type = H5Sget_simple_extent_type(space); + if(space_type == H5S_NULL || space_type == H5S_NO_CLASS) { + status = SUCCEED; + } + else { + /* VL data special information */ + unsigned int vl_data = 0; /* contains VL datatypes */ + + type = H5Aget_type(obj_id); + p_type = h5tools_get_native_type(type); + + ndims = H5Sget_simple_extent_dims(space, size, NULL); + + /* Check if we have VL data in the dataset's datatype */ + if (h5tools_detect_vlen_str(p_type) == TRUE) + vl_data = TRUE; + if (H5Tdetect_class(p_type, H5T_VLEN) == TRUE) + vl_data = TRUE; + + for (i = 0; i < ndims; i++) + nelmts *= size[i]; + + alloc_size = nelmts * MAX(H5Tget_size(type), H5Tget_size(p_type)); + HDassert(alloc_size == (hsize_t)((size_t)alloc_size)); /*check for overflow*/ + + if(alloc_size) { + buf = HDmalloc((size_t)alloc_size); + HDassert(buf); + + if (H5Aread(obj_id, p_type, buf) >= 0) + if (display_char && H5Tget_size(type) == 1 && H5Tget_class(type) == H5T_INTEGER) { + /* + * Print 1-byte integer data as an ASCII character string + * instead of integers if the `-r' or `--string' command-line + * option was given. + * + * We don't want to modify the global dataformat, so make a + * copy of it instead. + */ + string_dataformat = *info; + string_dataformat.idx_fmt = "\""; + info = &string_dataformat; + datactx.indent_level++; + datactx.need_prefix = TRUE; + h5tools_simple_prefix(stream, info, &datactx, 0, 0); + + string_dataformat = *info; + string_dataformat.idx_fmt = "\""; + string_dataformat.line_multi_new = 1; + string_dataformat.str_repeat = 8; + string_dataformat.ascii = TRUE; + string_dataformat.elmt_suf1 = ""; + string_dataformat.elmt_suf2 = ""; + string_dataformat.line_suf = "\""; + info = &string_dataformat; + } + else + datactx.need_prefix = TRUE; + + status = h5tools_dump_mem(stream, info, &datactx, obj_id, p_type, space, buf); + if (display_char && H5Tget_size(type) == 1 && H5Tget_class(type) == H5T_INTEGER) { + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "\""); + h5tools_render_element(stream, &outputformat, ctx, &buffer, &curr_pos, ncols, 0, 0); + } + + /* Reclaim any VL memory, if necessary */ + if (vl_data) + H5Dvlen_reclaim(p_type, space, H5P_DEFAULT, buf); + + HDfree(buf); + } + else + status = SUCCEED; + + H5Tclose(p_type); + H5Tclose(type); + } + H5Sclose(space); + } + + if (status == FAIL) { + error_msg("unable to print data\n"); + h5tools_setstatus(EXIT_FAILURE); + } + + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, &outputformat, ctx, 0, 0); + + h5tools_str_reset(&buffer); + if(HDstrlen(h5tools_dump_header_format->datablockend)) { + h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->datablockend); + if(HDstrlen(h5tools_dump_header_format->dataend)) + h5tools_str_append(&buffer, " "); + } + if(HDstrlen(h5tools_dump_header_format->dataend)) + h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->dataend); + h5tools_render_element(stream, &outputformat, ctx, &buffer, &curr_pos, ncols, 0, 0); + + if (sset && obj_data) { + ctx->indent_level--; + + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, &outputformat, ctx, 0, 0); + + h5tools_str_reset(&buffer); + if(HDstrlen(h5tools_dump_header_format->subsettingblockend)) { + h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->subsettingblockend); + if(HDstrlen(h5tools_dump_header_format->subsettingend)) + h5tools_str_append(&buffer, " "); + } + if(HDstrlen(h5tools_dump_header_format->subsettingend)) + h5tools_str_append(&buffer, "%s", h5tools_dump_header_format->subsettingend); + h5tools_render_element(stream, &outputformat, ctx, &buffer, &curr_pos, ncols, 0, 0); + } + + h5tools_str_close(&buffer); +} + diff --git a/tools/lib/h5tools_dump.h b/tools/lib/h5tools_dump.h new file mode 100644 index 0000000..55e046b --- /dev/null +++ b/tools/lib/h5tools_dump.h @@ -0,0 +1,85 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Purpose: Support h5dump functions for the various tools. + */ +#ifndef H5TOOLS_DUMP_H__ +#define H5TOOLS_DUMP_H__ + +#include "h5tools_utils.h" + +/* 3 private values: can't be set, but can be read. + Note: these are defined in H5Zprivate, they are + duplicated here. + */ +#define H5_SZIP_LSB_OPTION_MASK 8 +#define H5_SZIP_MSB_OPTION_MASK 16 +#define H5_SZIP_RAW_OPTION_MASK 128 + +#ifdef __cplusplus +extern "C" { +#endif + +H5TOOLS_DLLVAR table_t *h5dump_type_table; /*type table reference for datatype dump */ + +/* Definitions of useful routines */ +H5TOOLS_DLL void h5tools_dump_init(void); + +H5TOOLS_DLL int h5tools_dump_dset(FILE *stream, const h5tool_format_t *info, + h5tools_context_t *ctx/*in,out*/, hid_t dset, + hid_t p_typ, struct subset_t *sset); +H5TOOLS_DLL int h5tools_dump_mem(FILE *stream, const h5tool_format_t *info, + h5tools_context_t *ctx/*in,out*/, hid_t obj_id, + hid_t type, hid_t space, void *mem); +H5TOOLS_DLL int h5tools_dump_simple_data(FILE *stream, const h5tool_format_t *info, hid_t container, + h5tools_context_t *ctx/*in,out*/, unsigned flags, + hsize_t nelmts, hid_t type, void *_mem); +H5TOOLS_DLL void h5tools_dump_datatype(FILE *stream, const h5tool_format_t *info, + h5tools_context_t *ctx/*in,out*/, hid_t type); +H5TOOLS_DLL void h5tools_dump_dataspace(FILE *stream, const h5tool_format_t *info, + h5tools_context_t *ctx/*in,out*/, hid_t space); +H5TOOLS_DLL void h5tools_dump_attribute(FILE *stream, const h5tool_format_t *info, + h5tools_context_t *ctx/*in,out*/, hid_t oid, const char *attr_name, + hid_t attr_id, int display_index, int display_char); +H5TOOLS_DLL void h5tools_dump_oid(FILE *stream, const h5tool_format_t *info, + h5tools_context_t *ctx/*in,out*/, hid_t oid); +H5TOOLS_DLL void h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, + h5tools_context_t *ctx/*in,out*/, hid_t dcpl, hid_t type_id, hid_t obj_id); +H5TOOLS_DLL void h5tools_dump_comment(FILE *stream, const h5tool_format_t *info, + h5tools_context_t *ctx/*in,out*/, hid_t obj_id); +H5TOOLS_DLL void h5tools_dump_data(FILE *stream, const h5tool_format_t *info, + h5tools_context_t *ctx, hid_t obj_id, + int obj_data, struct subset_t *sset, int display_index, int display_char); + +H5TOOLS_DLL int h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer/*in,out*/, + const h5tool_format_t *info, h5tools_context_t *ctx/*in,out*/, + hid_t type, int object_search); +H5TOOLS_DLL int h5tools_print_dataspace(FILE *stream, h5tools_str_t *buffer/*in,out*/, + const h5tool_format_t *info, h5tools_context_t *ctx/*in,out*/, + hid_t space); +H5TOOLS_DLL int h5tools_print_enum(FILE *stream, h5tools_str_t *buffer/*in,out*/, + const h5tool_format_t *info, h5tools_context_t *ctx/*in,out*/, + hid_t type); +H5TOOLS_DLL void h5tools_print_fill_value(h5tools_str_t *buffer/*in,out*/, + const h5tool_format_t *info, h5tools_context_t *ctx/*in,out*/, + hid_t dcpl, hid_t type_id, hid_t obj_id); +H5TOOLS_DLL void h5tools_print_packed_bits(h5tools_str_t *buffer/*in,out*/, hid_t type); +#ifdef __cplusplus +} +#endif + +#endif /* H5TOOLS_DUMP_H__ */ + diff --git a/tools/lib/h5tools_error.h b/tools/lib/h5tools_error.h index 207218e..ae549fd 100644 --- a/tools/lib/h5tools_error.h +++ b/tools/lib/h5tools_error.h @@ -22,6 +22,7 @@ #include "H5Epublic.h" /* tools-HDF5 Error variables */ +H5TOOLS_DLLVAR hid_t H5tools_ERR_STACK_g; H5TOOLS_DLLVAR hid_t H5tools_ERR_CLS_g; H5TOOLS_DLLVAR hid_t H5E_tools_g; H5TOOLS_DLLVAR hid_t H5E_tools_min_id_g; @@ -66,7 +67,11 @@ H5TOOLS_DLLVAR hid_t H5E_tools_min_id_g; * HERROR macro, used to facilitate error reporting . The arguments are the major * error number, the minor error number, and a description of the error. */ -#define HERROR(maj_id, min_id, str) H5Epush2(H5E_DEFAULT, __FILE__, FUNC, __LINE__, H5tools_ERR_CLS_g, maj_id, min_id, str) +#define HERROR(maj_id, min_id, str) { \ + H5Epush2(H5tools_ERR_STACK_g, __FILE__, FUNC, __LINE__, H5tools_ERR_CLS_g, maj_id, min_id, str); \ + ret_value = FAIL; \ +} + /* Macro for "catching" flow of control when an error occurs. Note that the * H5_LEAVE macro won't jump back here once it's past this point. diff --git a/tools/lib/h5tools_ref.c b/tools/lib/h5tools_ref.c index 07d2a57..caf71df 100644 --- a/tools/lib/h5tools_ref.c +++ b/tools/lib/h5tools_ref.c @@ -114,7 +114,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))==NULL) + if((ref_path_table = H5SL_create(H5SL_TYPE_HADDR, NULL))==NULL) return (-1); /* Iterate over objects in this file */ diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c index 5166a80..70787df 100644 --- a/tools/lib/h5tools_str.c +++ b/tools/lib/h5tools_str.c @@ -77,8 +77,8 @@ void h5tools_str_close(h5tools_str_t *str) { if (str && str->nalloc) { - free(str->s); - memset(str, 0, sizeof(h5tools_str_t)); + HDfree(str->s); + HDmemset(str, 0, sizeof(h5tools_str_t)); } } @@ -132,18 +132,13 @@ char * h5tools_str_append(h5tools_str_t *str/*in,out*/, const char *fmt, ...) { va_list ap; - hbool_t isReallocated = FALSE; /* Make sure we have some memory into which to print */ if (!str->s || str->nalloc <= 0) { - str->nalloc = STR_INIT_LEN; - str->s = malloc(str->nalloc); - assert(str->s); - str->s[0] = '\0'; - str->len = 0; + h5tools_str_reset(str); } - if (strlen(fmt) == 0) { + if (HDstrlen(fmt) == 0) { /* nothing to print */ return str->s; } @@ -154,9 +149,9 @@ h5tools_str_append(h5tools_str_t *str/*in,out*/, const char *fmt, ...) size_t avail = str->nalloc - str->len; int nchars = -1; - va_start(ap, fmt); + HDva_start(ap, fmt); nchars = HDvsnprintf(str->s + str->len, avail, fmt, ap); - va_end(ap); + HDva_end(ap); /* Note: HDvsnprintf() behaves differently on Windows as Unix, when * buffer is smaller than source string. On Unix, this function @@ -164,17 +159,21 @@ h5tools_str_append(h5tools_str_t *str/*in,out*/, const char *fmt, ...) * buffer size with NULL at the end of the buffer. However on * Windows with the same condition, this function returns -1 and * doesn't add NULL at the end of the buffer. - * Because of this different return results, isReallocated variable + * Because of this different return results, the strlen of the new string * is used to handle when HDvsnprintf() returns -1 on Windows due * to lack of buffer size, so try one more time after realloc more * buffer size before return NULL. */ - if (nchars < 0 && isReallocated == TRUE) { + if (nchars < 0 +#ifndef H5_VSNPRINTF_WORKS + && (HDstrlen(str->s) < str->nalloc) +#endif + ) { /* failure, such as bad format */ return NULL; } - if (nchars < 0 || (size_t) nchars >= avail || (0 == nchars && (strcmp(fmt, "%s")))) { + if (nchars < 0 || (size_t) nchars >= avail || (0 == nchars && (HDstrcmp(fmt, "%s")))) { /* Truncation return value as documented by C99, or zero return value with either of the * following conditions, each of which indicates that the proper C99 return value probably * should have been positive when the format string is @@ -182,11 +181,10 @@ h5tools_str_append(h5tools_str_t *str/*in,out*/, const char *fmt, ...) * Alocate at least twice as much space and try again. */ size_t newsize = MAX(str->len + nchars + 1, 2 * str->nalloc); - assert(newsize > str->nalloc); /*overflow*/ - str->s = realloc(str->s, newsize); - assert(str->s); + HDassert(newsize > str->nalloc); /*overflow*/ + str->s = (char*)HDrealloc(str->s, newsize); + HDassert(str->s); str->nalloc = newsize; - isReallocated = TRUE; } else { /* Success */ @@ -220,8 +218,8 @@ h5tools_str_reset(h5tools_str_t *str/*in,out*/) { if (!str->s || str->nalloc <= 0) { str->nalloc = STR_INIT_LEN; - str->s = malloc(str->nalloc); - assert(str->s); + str->s = (char*)HDmalloc(str->nalloc); + HDassert(str->s); } str->s[0] = '\0'; @@ -281,21 +279,26 @@ h5tools_str_fmt(h5tools_str_t *str/*in,out*/, size_t start, const char *fmt) { char _temp[1024], *temp = _temp; + HDassert(str); + HDassert(fmt); + /* If the format string is simply "%s" then don't bother doing anything */ - if (!strcmp(fmt, "%s")) + if (!HDstrcmp(fmt, "%s")) return str->s; /* * Save the input value if there is a `%' anywhere in FMT. Otherwise * don't bother because we don't need a temporary copy. */ - if (strchr(fmt, '%')) { - if (str->len - start + 1 > sizeof(_temp)) { - temp = malloc(str->len - start + 1); - assert(temp); + if (HDstrchr(fmt, '%')) { + size_t n = sizeof(_temp); + if (str->len - start + 1 > n) { + n = str->len - start + 1; + temp = (char*)HDmalloc(n); + HDassert(temp); } - strcpy(temp, str->s + start); + HDstrncpy(temp, str->s + start, n); } /* Reset the output string and append a formatted version */ @@ -304,7 +307,7 @@ h5tools_str_fmt(h5tools_str_t *str/*in,out*/, size_t start, const char *fmt) /* Free the temp buffer if we allocated one */ if (temp != _temp) - free(temp); + HDfree(temp); return str->s; } @@ -343,7 +346,7 @@ h5tools_str_prefix(h5tools_str_t *str/*in,out*/, const h5tool_format_t *info, ctx->pos[i] = curr_pos / ctx->acc[i]; curr_pos -= ctx->acc[i] * ctx->pos[i]; } - assert(curr_pos == 0); + HDassert(curr_pos == 0); /* Print the index values */ for (i = 0; i < (size_t) ndims; i++) { @@ -397,8 +400,12 @@ h5tools_str_region_prefix(h5tools_str_t *str, const h5tool_format_t *info, p_prod[i - 1] = (max_idx[i]) * p_prod[i]; for (i = 0; i < (size_t) ndims; i++) { - ctx->pos[i] = curr_pos / p_prod[i]; - curr_pos -= p_prod[i] * ctx->pos[i]; + if(curr_pos > 0) { + ctx->pos[i] = curr_pos / p_prod[i]; + curr_pos -= p_prod[i] * ctx->pos[i]; + } + else + ctx->pos[i] = 0; ctx->pos[i] += (unsigned long) ptdata[ctx->sm_pos+i]; } @@ -454,8 +461,8 @@ h5tools_str_dump_region_blocks(h5tools_str_t *str, hid_t region, int i; alloc_size = nblocks * ndims * 2 * sizeof(ptdata[0]); - assert(alloc_size == (hsize_t) ((size_t) alloc_size)); /*check for overflow*/ - ptdata = (hsize_t *)malloc((size_t) alloc_size); + HDassert(alloc_size == (hsize_t) ((size_t) alloc_size)); /*check for overflow*/ + ptdata = (hsize_t *)HDmalloc((size_t) alloc_size); H5_CHECK_OVERFLOW(nblocks, hssize_t, hsize_t); H5Sget_select_hyper_blocklist(region, (hsize_t)0, (hsize_t)nblocks, ptdata); @@ -467,17 +474,17 @@ h5tools_str_dump_region_blocks(h5tools_str_t *str, hid_t region, /* Start coordinates and opposite corner */ for (j = 0; j < ndims; j++) - h5tools_str_append(str, "%s%lu", j ? "," : "(", - (unsigned long) ptdata[i * 2 * ndims + j]); + h5tools_str_append(str, "%s" HSIZE_T_FORMAT, j ? "," : "(", + ptdata[i * 2 * ndims + j]); for (j = 0; j < ndims; j++) - h5tools_str_append(str, "%s%lu", j ? "," : ")-(", - (unsigned long) ptdata[i * 2 * ndims + j + ndims]); + h5tools_str_append(str, "%s" HSIZE_T_FORMAT, j ? "," : ")-(", + ptdata[i * 2 * ndims + j + ndims]); h5tools_str_append(str, ")"); } - free(ptdata); + HDfree(ptdata); } /* end if (nblocks > 0) */ } @@ -515,8 +522,8 @@ h5tools_str_dump_region_points(h5tools_str_t *str, hid_t region, int i; alloc_size = npoints * ndims * sizeof(ptdata[0]); - assert(alloc_size == (hsize_t) ((size_t) alloc_size)); /*check for overflow*/ - ptdata = (hsize_t *)malloc((size_t) alloc_size); + HDassert(alloc_size == (hsize_t) ((size_t) alloc_size)); /*check for overflow*/ + ptdata = (hsize_t *)HDmalloc((size_t) alloc_size); H5_CHECK_OVERFLOW(npoints, hssize_t, hsize_t); H5Sget_select_elem_pointlist(region, (hsize_t)0, (hsize_t)npoints, ptdata); @@ -527,13 +534,13 @@ h5tools_str_dump_region_points(h5tools_str_t *str, hid_t region, (unsigned long)i); for (j = 0; j < ndims; j++) - h5tools_str_append(str, "%s%lu", j ? "," : "(", - (unsigned long) (ptdata[i * ndims + j])); + h5tools_str_append(str, "%s" HSIZE_T_FORMAT, j ? "," : "(", + (ptdata[i * ndims + j])); h5tools_str_append(str, ")"); } - free(ptdata); + HDfree(ptdata); } /* end if (npoints > 0) */ } @@ -613,6 +620,32 @@ h5tools_print_char(h5tools_str_t *str, const h5tool_format_t *info, char ch) } } } +void +h5tools_str_indent(h5tools_str_t *str, const h5tool_format_t *info, + h5tools_context_t *ctx) +{ + int i, indentlevel = 0; + + /* Write new prefix */ + if (ctx->indent_level >= 0) { + indentlevel = ctx->indent_level; + } + else { + /* + * This is because sometimes we don't print out all the header + * info for the data (like the tattr-2.ddl example). If that happens + * the ctx->indent_level is negative so we need to skip the above and + * just print out the default indent levels. + */ + indentlevel = ctx->default_indent_level; + } + + for (i = 0; i < indentlevel; i++) { + h5tools_str_append(str, "%s", OPT(info->line_indent, "")); + } + +// ctx->need_prefix = 0; +} /*------------------------------------------------------------------------- * Function: h5tools_str_sprint @@ -650,10 +683,17 @@ h5tools_print_char(h5tools_str_t *str, const h5tool_format_t *info, char ch) * * PVN, 28 March 2006 * added H5T_NATIVE_LDOUBLE case - * + * * Vailin Choi; August 2010 * Modified to handle printing of selected compound fields for h5watch. * + * Raymond Lu, 2011-09-01 + * CLANG compiler complained about the line (about 800): + * tempint = (tempint >> packed_data_offset) & packed_data_mask; + * The right shift may cause undefined behavior if PACKED_DATA_OFFSET is + * 32-bit or more. For every kind of native integers, I changed the code + * to make it zero if PACKED_DATA_OFFSET is greater than or equal to the + * size of integer. *------------------------------------------------------------------------- */ char * @@ -682,8 +722,8 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai /* Build default formats for long long types */ if (!fmt_llong[0]) { - sprintf(fmt_llong, "%%%sd", H5_PRINTF_LL_WIDTH); - sprintf(fmt_ullong, "%%%su", H5_PRINTF_LL_WIDTH); + HDsnprintf(fmt_llong, sizeof(fmt_llong), "%%%sd", H5_PRINTF_LL_WIDTH); + HDsnprintf(fmt_ullong, sizeof(fmt_ullong), "%%%su", H5_PRINTF_LL_WIDTH); } /* Append value depending on data type */ @@ -808,83 +848,153 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai } else if (H5Tequal(type, H5T_NATIVE_INT)) { HDmemcpy(&tempint, vp, sizeof(int)); + if(packed_bits_num) { + if(packed_data_offset >= 8*sizeof(int)) + tempint = 0; + else + tempint = (tempint >> packed_data_offset) & packed_data_mask; + } h5tools_str_append(str, OPT(info->fmt_int, "%d"), tempint); } else if (H5Tequal(type, H5T_NATIVE_UINT)) { HDmemcpy(&tempuint, vp, sizeof(unsigned int)); + if(packed_bits_num) { + if(packed_data_offset >= 8*sizeof(unsigned int)) + tempuint = 0; + else + tempuint = (tempuint >> packed_data_offset) & packed_data_mask; + } h5tools_str_append(str, OPT(info->fmt_uint, "%u"), tempuint); } else if (H5Tequal(type, H5T_NATIVE_SCHAR)) { - h5tools_str_append(str, OPT(info->fmt_schar, "%hhd"), *cp_vp); + signed char tempchar; + HDmemcpy(&tempchar, cp_vp, sizeof(char)); + if(packed_bits_num) { + if(packed_data_offset >= 8*sizeof(char)) + tempchar = 0; + else + tempchar = (tempchar >> packed_data_offset) & packed_data_mask; + } +#ifdef H5_VMS + h5tools_str_append(str, OPT(info->fmt_schar, "%hd"), tempchar); +#else + h5tools_str_append(str, OPT(info->fmt_schar, "%hhd"), tempchar); +#endif } else if (H5Tequal(type, H5T_NATIVE_UCHAR)) { - h5tools_str_append(str, OPT(info->fmt_uchar, "%u"), *ucp_vp); + unsigned char tempuchar; + HDmemcpy(&tempuchar, ucp_vp, sizeof(unsigned char)); + if(packed_bits_num) { + if(packed_data_offset >= 8*sizeof(unsigned char)) + tempuchar = 0; + else + tempuchar = (tempuchar >> packed_data_offset) & packed_data_mask; + } + h5tools_str_append(str, OPT(info->fmt_uchar, "%u"), tempuchar); } else if (H5Tequal(type, H5T_NATIVE_SHORT)) { short tempshort; HDmemcpy(&tempshort, vp, sizeof(short)); + if(packed_bits_num) { + if(packed_data_offset >= 8*sizeof(short)) + tempshort = 0; + else + tempshort = (tempshort >> packed_data_offset) & packed_data_mask; + } h5tools_str_append(str, OPT(info->fmt_short, "%d"), tempshort); } else if (H5Tequal(type, H5T_NATIVE_USHORT)) { unsigned short tempushort; HDmemcpy(&tempushort, vp, sizeof(unsigned short)); + if(packed_bits_num) { + if(packed_data_offset >= 8*sizeof(unsigned short)) + tempushort = 0; + else + tempushort = (tempushort >> packed_data_offset) & packed_data_mask; + } h5tools_str_append(str, OPT(info->fmt_ushort, "%u"), tempushort); } else if (H5Tequal(type, H5T_NATIVE_LONG)) { HDmemcpy(&templong, vp, sizeof(long)); + if(packed_bits_num) { + if(packed_data_offset >= 8*sizeof(long)) + templong = 0; + else + templong = (templong >> packed_data_offset) & packed_data_mask; + } h5tools_str_append(str, OPT(info->fmt_long, "%ld"), templong); } else if (H5Tequal(type, H5T_NATIVE_ULONG)) { HDmemcpy(&tempulong, vp, sizeof(unsigned long)); + if(packed_bits_num) { + if(packed_data_offset >= 8*sizeof(unsigned long)) + tempulong = 0; + else + tempulong = (tempulong >> packed_data_offset) & packed_data_mask; + } h5tools_str_append(str, OPT(info->fmt_ulong, "%lu"), tempulong); } else if (H5Tequal(type, H5T_NATIVE_LLONG)) { HDmemcpy(&templlong, vp, sizeof(long long)); + if(packed_bits_num) { + if(packed_data_offset >= 8*sizeof(long long)) + templlong = 0; + else + templlong = (templlong >> packed_data_offset) & packed_data_mask; + } h5tools_str_append(str, OPT(info->fmt_llong, fmt_llong), templlong); } else if (H5Tequal(type, H5T_NATIVE_ULLONG)) { HDmemcpy(&tempullong, vp, sizeof(unsigned long long)); + if(packed_bits_num) { + if(packed_data_offset >= 8*sizeof(unsigned long long)) + tempullong = 0; + else + tempullong = (tempullong >> packed_data_offset) & packed_data_mask; + } h5tools_str_append(str, OPT(info->fmt_ullong, fmt_ullong), tempullong); } else if (H5Tequal(type, H5T_NATIVE_HSSIZE)) { if (sizeof(hssize_t) == sizeof(int)) { - memcpy(&tempint, vp, sizeof(int)); + HDmemcpy(&tempint, vp, sizeof(int)); h5tools_str_append(str, OPT(info->fmt_int, "%d"), tempint); } else if (sizeof(hssize_t) == sizeof(long)) { - memcpy(&templong, vp, sizeof(long)); + HDmemcpy(&templong, vp, sizeof(long)); h5tools_str_append(str, OPT(info->fmt_long, "%ld"), templong); } else { - memcpy(&templlong, vp, sizeof(long long)); + HDmemcpy(&templlong, vp, sizeof(long long)); h5tools_str_append(str, OPT(info->fmt_llong, fmt_llong), templlong); } } else if (H5Tequal(type, H5T_NATIVE_HSIZE)) { if (sizeof(hsize_t) == sizeof(int)) { - memcpy(&tempuint, vp, sizeof(unsigned int)); + HDmemcpy(&tempuint, vp, sizeof(unsigned int)); h5tools_str_append(str, OPT(info->fmt_uint, "%u"), tempuint); } else if (sizeof(hsize_t) == sizeof(long)) { - memcpy(&tempulong, vp, sizeof(long)); + HDmemcpy(&tempulong, vp, sizeof(long)); h5tools_str_append(str, OPT(info->fmt_ulong, "%lu"), tempulong); } else { - memcpy(&tempullong, vp, sizeof(unsigned long long)); + HDmemcpy(&tempullong, vp, sizeof(unsigned long long)); h5tools_str_append(str, OPT(info->fmt_ullong, fmt_ullong), tempullong); } } else if (H5Tget_class(type) == H5T_COMPOUND) { if(ctx->cmpd_listv) { /* there is */ int save_indent_level; /* The indentation level */ - int i = 0, n = 0, x = 0; /* Local index variable */ + size_t curr_field; /* Current field to display */ + int i = 0, x = 0; /* Local index variable */ H5LD_memb_t **listv; /* Vector of information for */ listv = ctx->cmpd_listv; ctx->cmpd_listv = NULL; - h5tools_str_append(str, "%s", OPT(info->cmpd_pre, "{")); + + h5tools_str_append(str, "%s", OPT(info->cmpd_pre, "{")); /* * Go through the vector containing info about the comma-separated list of @@ -892,105 +1002,78 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai * put in "{", "}", ",", member name and value accordingly. */ save_indent_level = ctx->indent_level; - for(n = 0; listv[n] != NULL; n++) { - if(n) - h5tools_str_append(str, "%s", OPT(info->cmpd_sep, ", " OPTIONAL_LINE_BREAK)); - - /* See notes for RPM 2000-10-31 below (copied) */ - if (ctx->indent_level >= 0 && str->len && str->s[str->len - 1] == '\n') { - - h5tools_str_append(str, OPT(info->line_pre, ""), ""); - - for (x = 0; x < ctx->indent_level + 1; x++) - h5tools_str_append(str, "%s", OPT(info->line_indent, "")); - } - + for(curr_field = 0; listv[curr_field] != NULL; curr_field++) { + if (curr_field) + h5tools_str_append(str, "%s", OPT(info->cmpd_sep, ", "OPTIONAL_LINE_BREAK)); + else + h5tools_str_append(str, "%s", OPT(info->cmpd_end, "")); + + if(info->arr_linebreak) + h5tools_str_indent(str, info, ctx); + /* Process members of each field */ - for(i = 0; listv[n]->names[i] != NULL; i++) { - h5tools_str_append(str, OPT(info->cmpd_name, ""), listv[n]->names[i]); + for(i = 0; listv[curr_field]->names[i] != NULL; i++) { + h5tools_str_append(str, OPT(info->cmpd_name, ""), listv[curr_field]->names[i]); if(i) { ctx->indent_level++; h5tools_str_append(str, "%s", OPT(info->cmpd_pre, "{")); } } - h5tools_str_sprint(str, info, container, listv[n]->last_tid, cp_vp + listv[n]->tot_offset, ctx); + h5tools_str_sprint(str, info, container, listv[curr_field]->last_tid, cp_vp + listv[curr_field]->tot_offset, ctx); if(ctx->indent_level >= 0) for(x = ctx->indent_level; x >= 0; x--) h5tools_str_append(str, "%s", OPT(info->cmpd_suf, "}")); ctx->indent_level = save_indent_level; - } - - /* See notes for RPM 2000-10-31 below (copied) */ - h5tools_str_append(str, "%s", OPT(info->cmpd_end, "")); - - if (ctx->indent_level >= 0 && str->len && str->s[str->len - 1] == '\n') { + } - h5tools_str_append(str, OPT(info->line_pre, ""), ""); - for (x = 0; x < ctx->indent_level; x++) - h5tools_str_append(str, "%s", OPT(info->line_indent, "")); + if(info->arr_linebreak) { + h5tools_str_append(str, "%s", OPT(info->cmpd_end, "")); + h5tools_str_indent(str, info, ctx); } + h5tools_str_append(str, "%s", OPT(info->cmpd_suf, "}")); - h5tools_str_append(str, "%s", OPT(info->cmpd_suf, "}")); ctx->cmpd_listv = info->cmpd_listv; + } else { - unsigned j = 0; - - nmembs = H5Tget_nmembers(type); - h5tools_str_append(str, "%s", OPT(info->cmpd_pre, "{")); - - for (j = 0; j < nmembs; j++) { - if (j) - h5tools_str_append(str, "%s", OPT(info->cmpd_sep, ", " OPTIONAL_LINE_BREAK)); - - /* RPM 2000-10-31 - * If the previous character is a line-feed (which is true when - * h5dump is running) then insert some white space for - * indentation. Be warned that column number calculations will be - * incorrect and that object indices at the beginning of the line - * will be missing (h5dump doesn't display them anyway). */ - if (ctx->indent_level >= 0 && str->len && str->s[str->len - 1] == '\n') { - int x; - - h5tools_str_append(str, OPT(info->line_pre, ""), ""); - - for (x = 0; x < ctx->indent_level + 1; x++) - h5tools_str_append(str, "%s", OPT(info->line_indent, "")); - } - - /* The name */ - name = H5Tget_member_name(type, j); - h5tools_str_append(str, OPT(info->cmpd_name, ""), name); - free(name); - - /* The value */ - offset = H5Tget_member_offset(type, j); - memb = H5Tget_member_type(type, j); - - ctx->indent_level++; - h5tools_str_sprint(str, info, container, memb, cp_vp + offset, ctx); - ctx->indent_level--; - - H5Tclose(memb); - } - - /* RPM 2000-10-31 - * If the previous character is a line feed (which is true when - * h5dump is running) then insert some white space for indentation. - * Be warned that column number calculations will be incorrect and - * that object indices at the beginning of the line will be missing - * (h5dump doesn't display them anyway). */ - h5tools_str_append(str, "%s", OPT(info->cmpd_end, "")); - - if (ctx->indent_level >= 0 && str->len && str->s[str->len - 1] == '\n') { - int x; - - h5tools_str_append(str, OPT(info->line_pre, ""), ""); - - for (x = 0; x < ctx->indent_level; x++) - h5tools_str_append(str, "%s", OPT(info->line_indent, "")); - } - h5tools_str_append(str, "%s", OPT(info->cmpd_suf, "}")); + unsigned j; + + nmembs = H5Tget_nmembers(type); + h5tools_str_append(str, "%s", OPT(info->cmpd_pre, "{")); + + ctx->indent_level++; + + for (j = 0; j < nmembs; j++) { + if (j) + h5tools_str_append(str, "%s", OPT(info->cmpd_sep, ", "OPTIONAL_LINE_BREAK)); + else + h5tools_str_append(str, "%s", OPT(info->cmpd_end, "")); + + if(info->arr_linebreak) + h5tools_str_indent(str, info, ctx); + + /* The name */ + name = H5Tget_member_name(type, j); + h5tools_str_append(str, OPT(info->cmpd_name, ""), name); + HDfree(name); + + /* The value */ + offset = H5Tget_member_offset(type, j); + memb = H5Tget_member_type(type, j); + + h5tools_str_sprint(str, info, container, memb, cp_vp + offset, ctx); + + H5Tclose(memb); + } + ctx->indent_level--; + + + if(info->arr_linebreak) { + h5tools_str_append(str, "%s", OPT(info->cmpd_end, "")); + h5tools_str_indent(str, info, ctx); + } + h5tools_str_append(str, "%s", OPT(info->cmpd_suf, "}")); + } } else if (H5Tget_class(type) == H5T_ENUM) { @@ -1031,7 +1114,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai H5O_info_t oi; const char *path; - obj = H5Rdereference(container, H5R_OBJECT, vp); + obj = H5Rdereference2(container, H5P_DEFAULT, H5R_OBJECT, vp); H5Oget_info(obj, &oi); /* Print object type and close object */ @@ -1072,54 +1155,61 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai else if (H5Tget_class(type) == H5T_ARRAY) { int k, ndims; hsize_t i, dims[H5S_MAX_RANK], temp_nelmts; + static int is_next_arry_elmt = 0; /* Get the array's base datatype for each element */ memb = H5Tget_super(type); size = H5Tget_size(memb); ndims = H5Tget_array_ndims(type); H5Tget_array_dims2(type, dims); - assert(ndims >= 1 && ndims <= H5S_MAX_RANK); + HDassert(ndims >= 1 && ndims <= H5S_MAX_RANK); /* Calculate the number of array elements */ for (k = 0, nelmts = 1; k < ndims; k++) { temp_nelmts = nelmts; temp_nelmts *= dims[k]; - assert(temp_nelmts == (hsize_t) ((size_t) temp_nelmts)); + HDassert(temp_nelmts == (hsize_t) ((size_t) temp_nelmts)); nelmts = (size_t) temp_nelmts; } /* Print the opening bracket */ h5tools_str_append(str, "%s", OPT(info->arr_pre, "[")); + ctx->indent_level++; + for (i = 0; i < nelmts; i++) { if (i) h5tools_str_append(str, "%s", OPT(info->arr_sep, "," OPTIONAL_LINE_BREAK)); if (info->arr_linebreak && i && i % dims[ndims - 1] == 0) { - int x; - h5tools_str_append(str, "%s", "\n"); + h5tools_str_indent(str, info, ctx); - /* need to indent some more here*/ - if (ctx->indent_level >= 0) - if (!info->pindex) - h5tools_str_append(str, "%s", OPT(info->line_pre, "")); - - for (x = 0; x < ctx->indent_level + 1; x++) - h5tools_str_append(str, "%s", OPT(info->line_indent, "")); } /* end if */ - else if (i && info->arr_sep) - h5tools_str_append(str, " "); + else if (i && info->arr_sep) { + /* if next element begin, add next line with indent */ + if (is_next_arry_elmt) { + is_next_arry_elmt = 0; - ctx->indent_level++; + h5tools_str_append(str, "%s", "\n "); + h5tools_str_indent(str, info, ctx); - /* Dump the array element */ + } + /* otherwise just add space */ + else + h5tools_str_append(str, " "); + + } /* end else if */ + + /* Dump values in an array element */ + is_next_arry_elmt = 0; /* dump all values in the array element, so turn it off */ h5tools_str_sprint(str, info, container, memb, cp_vp + i * size, ctx); - - ctx->indent_level--; } /* end for */ + ctx->indent_level--; + /* Print the closing bracket */ h5tools_str_append(str, "%s", OPT(info->arr_suf, "]")); + is_next_arry_elmt = 1; /* set for begining of next array element */ H5Tclose(memb); } else if (H5Tget_class(type) == H5T_VLEN) { @@ -1200,7 +1290,7 @@ h5tools_str_sprint_region(h5tools_str_t *str, const h5tool_format_t *info, char ref_name[1024]; H5S_sel_type region_type; - obj = H5Rdereference(container, H5R_DATASET_REGION, vp); + obj = H5Rdereference2(container, H5P_DEFAULT, H5R_DATASET_REGION, vp); if (obj >= 0) { region = H5Rget_region(container, H5R_DATASET_REGION, vp); if (region >= 0) { @@ -1247,7 +1337,7 @@ static char * h5tools_escape(char *s/*in,out*/, size_t size) { register size_t i; - size_t n = strlen(s); + size_t n = HDstrlen(s); const char *escape; char octal[8]; @@ -1288,7 +1378,7 @@ h5tools_escape(char *s/*in,out*/, size_t size) break; default: if (!isprint(s[i])) { - sprintf(octal, "\\%03o", (unsigned char) s[i]); + HDsnprintf(octal, sizeof(octal), "\\%03o", (unsigned char) s[i]); escape = octal; } else { @@ -1299,14 +1389,14 @@ h5tools_escape(char *s/*in,out*/, size_t size) } if (escape) { - size_t esc_size = strlen(escape); + size_t esc_size = HDstrlen(escape); if (n + esc_size + 1 > size) /*would overflow*/ return NULL; - memmove(s + i + esc_size, s + i + 1, n - i); /*make room*/ - memcpy(s + i, escape, esc_size); /*insert*/ + HDmemmove(s + i + esc_size, s + i + 1, n - i); /*make room*/ + HDmemcpy(s + i, escape, esc_size); /*insert*/ n += esc_size - 1; /* adjust total string size */ i += esc_size; /* adjust string position */ } @@ -1340,3 +1430,52 @@ h5tools_str_is_zero(const void *_mem, size_t size) return TRUE; } + +/*------------------------------------------------------------------------- + * Function: h5tools_str_replace + * + * Purpose: replace all occurrences of substring. + * + * Return: char * + * + * Programmer: Peter Cao + * March 8, 2012 + * + * Notes: + * Applications need to call free() to free the memoery allocated for + * the return string + * + *------------------------------------------------------------------------- + */ +char * +h5tools_str_replace ( const char *string, const char *substr, const char *replacement ) +{ + char *tok = NULL; + char *newstr = NULL; + char *oldstr = NULL; + char *head = NULL; + + if ( substr == NULL || replacement == NULL ) + return strdup (string); + + newstr = strdup (string); + head = newstr; + while ( (tok = strstr ( head, substr ))){ + oldstr = newstr; + newstr = HDmalloc ( strlen ( oldstr ) - strlen ( substr ) + strlen ( replacement ) + 1 ); + + if ( newstr == NULL ){ + HDfree (oldstr); + return NULL; + } + memcpy ( newstr, oldstr, tok - oldstr ); + memcpy ( newstr + (tok - oldstr), replacement, strlen ( replacement ) ); + memcpy ( newstr + (tok - oldstr) + strlen( replacement ), tok + strlen ( substr ), strlen ( oldstr ) - strlen ( substr ) - ( tok - oldstr ) ); + memset ( newstr + strlen ( oldstr ) - strlen ( substr ) + strlen ( replacement ) , 0, 1 ); + /* move back head right after the last replacement */ + head = newstr + (tok - oldstr) + strlen( replacement ); + HDfree (oldstr); + } + + return newstr; +} diff --git a/tools/lib/h5tools_str.h b/tools/lib/h5tools_str.h index 599c7d1..38697c6 100644 --- a/tools/lib/h5tools_str.h +++ b/tools/lib/h5tools_str.h @@ -26,26 +26,28 @@ typedef struct h5tools_str_t { size_t nalloc; /*allocated size of string */ } h5tools_str_t; -extern void h5tools_str_close(h5tools_str_t *str); -extern size_t h5tools_str_len(h5tools_str_t *str); -extern char *h5tools_str_append(h5tools_str_t *str, const char *fmt, ...); -extern char *h5tools_str_reset(h5tools_str_t *str); -extern char *h5tools_str_trunc(h5tools_str_t *str, size_t size); -extern char *h5tools_str_fmt(h5tools_str_t *str, size_t start, const char *fmt); -extern char *h5tools_str_prefix(h5tools_str_t *str, const h5tool_format_t *info, +H5TOOLS_DLL void h5tools_str_close(h5tools_str_t *str); +H5TOOLS_DLL size_t h5tools_str_len(h5tools_str_t *str); +H5TOOLS_DLL char *h5tools_str_append(h5tools_str_t *str, const char *fmt, ...); +H5TOOLS_DLL char *h5tools_str_reset(h5tools_str_t *str); +H5TOOLS_DLL char *h5tools_str_trunc(h5tools_str_t *str, size_t size); +H5TOOLS_DLL char *h5tools_str_fmt(h5tools_str_t *str, size_t start, const char *fmt); +H5TOOLS_DLL char *h5tools_str_prefix(h5tools_str_t *str, const h5tool_format_t *info, hsize_t elmtno, unsigned ndims, h5tools_context_t *ctx); /* * new functions needed to display region reference data */ -extern char *h5tools_str_region_prefix(h5tools_str_t *str, const h5tool_format_t *info, +H5TOOLS_DLL char *h5tools_str_region_prefix(h5tools_str_t *str, const h5tool_format_t *info, hsize_t elmtno, hsize_t *ptdata, unsigned ndims, hsize_t max_idx[], h5tools_context_t *ctx); -extern void h5tools_str_dump_region_blocks(h5tools_str_t *, hid_t, const h5tool_format_t *); -extern void h5tools_str_dump_region_points(h5tools_str_t *, hid_t, const h5tool_format_t *); -extern void h5tools_str_sprint_region(h5tools_str_t *str, const h5tool_format_t *info, hid_t container, +H5TOOLS_DLL void h5tools_str_dump_region_blocks(h5tools_str_t *, hid_t, const h5tool_format_t *); +H5TOOLS_DLL void h5tools_str_dump_region_points(h5tools_str_t *, hid_t, const h5tool_format_t *); +H5TOOLS_DLL void h5tools_str_sprint_region(h5tools_str_t *str, const h5tool_format_t *info, hid_t container, void *vp); -extern char *h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, +H5TOOLS_DLL char *h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t container, hid_t type, void *vp, h5tools_context_t *ctx); +H5TOOLS_DLL char *h5tools_str_replace ( const char *string, const char *substr, + const char *replacement ); #endif /* H5TOOLS_STR_H__ */ diff --git a/tools/lib/h5tools_type.c b/tools/lib/h5tools_type.c index bbd1b8d..d68d3c5 100644 --- a/tools/lib/h5tools_type.c +++ b/tools/lib/h5tools_type.c @@ -66,62 +66,62 @@ h5tools_get_native_type(hid_t type) hid_t h5tools_get_little_endian_type(hid_t tid) { - hid_t p_type=-1; - H5T_class_t type_class; - size_t size; - H5T_sign_t sign; - - type_class = H5Tget_class(tid); - size = H5Tget_size(tid); - sign = H5Tget_sign(tid); - - switch( type_class ) - { - case H5T_INTEGER: - { - if ( size == 1 && sign == H5T_SGN_2) - p_type=H5Tcopy(H5T_STD_I8LE); - else if ( size == 2 && sign == H5T_SGN_2) - p_type=H5Tcopy(H5T_STD_I16LE); - else if ( size == 4 && sign == H5T_SGN_2) - p_type=H5Tcopy(H5T_STD_I32LE); - else if ( size == 8 && sign == H5T_SGN_2) - p_type=H5Tcopy(H5T_STD_I64LE); - else if ( size == 1 && sign == H5T_SGN_NONE) - p_type=H5Tcopy(H5T_STD_U8LE); - else if ( size == 2 && sign == H5T_SGN_NONE) - p_type=H5Tcopy(H5T_STD_U16LE); - else if ( size == 4 && sign == H5T_SGN_NONE) - p_type=H5Tcopy(H5T_STD_U32LE); - else if ( size == 8 && sign == H5T_SGN_NONE) - p_type=H5Tcopy(H5T_STD_U64LE); - } - break; - - case H5T_FLOAT: - if ( size == 4) - p_type=H5Tcopy(H5T_IEEE_F32LE); - else if ( size == 8) - p_type=H5Tcopy(H5T_IEEE_F64LE); - break; - - case H5T_TIME: - case H5T_BITFIELD: - case H5T_OPAQUE: - case H5T_STRING: - case H5T_COMPOUND: - case H5T_REFERENCE: - case H5T_ENUM: - case H5T_VLEN: - case H5T_ARRAY: - break; - - default: - break; - - } - - return(p_type); + hid_t p_type=-1; + H5T_class_t type_class; + size_t size; + H5T_sign_t sign; + + type_class = H5Tget_class(tid); + size = H5Tget_size(tid); + sign = H5Tget_sign(tid); + + switch( type_class ) + { + case H5T_INTEGER: + { + if ( size == 1 && sign == H5T_SGN_2) + p_type=H5Tcopy(H5T_STD_I8LE); + else if ( size == 2 && sign == H5T_SGN_2) + p_type=H5Tcopy(H5T_STD_I16LE); + else if ( size == 4 && sign == H5T_SGN_2) + p_type=H5Tcopy(H5T_STD_I32LE); + else if ( size == 8 && sign == H5T_SGN_2) + p_type=H5Tcopy(H5T_STD_I64LE); + else if ( size == 1 && sign == H5T_SGN_NONE) + p_type=H5Tcopy(H5T_STD_U8LE); + else if ( size == 2 && sign == H5T_SGN_NONE) + p_type=H5Tcopy(H5T_STD_U16LE); + else if ( size == 4 && sign == H5T_SGN_NONE) + p_type=H5Tcopy(H5T_STD_U32LE); + else if ( size == 8 && sign == H5T_SGN_NONE) + p_type=H5Tcopy(H5T_STD_U64LE); + } + break; + + case H5T_FLOAT: + if ( size == 4) + p_type=H5Tcopy(H5T_IEEE_F32LE); + else if ( size == 8) + p_type=H5Tcopy(H5T_IEEE_F64LE); + break; + + case H5T_TIME: + case H5T_BITFIELD: + case H5T_OPAQUE: + case H5T_STRING: + case H5T_COMPOUND: + case H5T_REFERENCE: + case H5T_ENUM: + case H5T_VLEN: + case H5T_ARRAY: + break; + + default: + break; + + } + + return(p_type); } @@ -143,62 +143,62 @@ h5tools_get_little_endian_type(hid_t tid) hid_t h5tools_get_big_endian_type(hid_t tid) { - hid_t p_type=-1; - H5T_class_t type_class; - size_t size; - H5T_sign_t sign; - - type_class = H5Tget_class(tid); - size = H5Tget_size(tid); - sign = H5Tget_sign(tid); - - switch( type_class ) - { - case H5T_INTEGER: - { - if ( size == 1 && sign == H5T_SGN_2) - p_type=H5Tcopy(H5T_STD_I8BE); - else if ( size == 2 && sign == H5T_SGN_2) - p_type=H5Tcopy(H5T_STD_I16BE); - else if ( size == 4 && sign == H5T_SGN_2) - p_type=H5Tcopy(H5T_STD_I32BE); - else if ( size == 8 && sign == H5T_SGN_2) - p_type=H5Tcopy(H5T_STD_I64BE); - else if ( size == 1 && sign == H5T_SGN_NONE) - p_type=H5Tcopy(H5T_STD_U8BE); - else if ( size == 2 && sign == H5T_SGN_NONE) - p_type=H5Tcopy(H5T_STD_U16BE); - else if ( size == 4 && sign == H5T_SGN_NONE) - p_type=H5Tcopy(H5T_STD_U32BE); - else if ( size == 8 && sign == H5T_SGN_NONE) - p_type=H5Tcopy(H5T_STD_U64BE); - } - break; - - case H5T_FLOAT: - if ( size == 4) - p_type=H5Tcopy(H5T_IEEE_F32BE); - else if ( size == 8) - p_type=H5Tcopy(H5T_IEEE_F64BE); - break; - - case H5T_TIME: - case H5T_BITFIELD: - case H5T_OPAQUE: - case H5T_STRING: - case H5T_COMPOUND: - case H5T_REFERENCE: - case H5T_ENUM: - case H5T_VLEN: - case H5T_ARRAY: - break; - - default: - break; - - } - - - return(p_type); + hid_t p_type=-1; + H5T_class_t type_class; + size_t size; + H5T_sign_t sign; + + type_class = H5Tget_class(tid); + size = H5Tget_size(tid); + sign = H5Tget_sign(tid); + + switch( type_class ) + { + case H5T_INTEGER: + { + if ( size == 1 && sign == H5T_SGN_2) + p_type=H5Tcopy(H5T_STD_I8BE); + else if ( size == 2 && sign == H5T_SGN_2) + p_type=H5Tcopy(H5T_STD_I16BE); + else if ( size == 4 && sign == H5T_SGN_2) + p_type=H5Tcopy(H5T_STD_I32BE); + else if ( size == 8 && sign == H5T_SGN_2) + p_type=H5Tcopy(H5T_STD_I64BE); + else if ( size == 1 && sign == H5T_SGN_NONE) + p_type=H5Tcopy(H5T_STD_U8BE); + else if ( size == 2 && sign == H5T_SGN_NONE) + p_type=H5Tcopy(H5T_STD_U16BE); + else if ( size == 4 && sign == H5T_SGN_NONE) + p_type=H5Tcopy(H5T_STD_U32BE); + else if ( size == 8 && sign == H5T_SGN_NONE) + p_type=H5Tcopy(H5T_STD_U64BE); + } + break; + + case H5T_FLOAT: + if ( size == 4) + p_type=H5Tcopy(H5T_IEEE_F32BE); + else if ( size == 8) + p_type=H5Tcopy(H5T_IEEE_F64BE); + break; + + case H5T_TIME: + case H5T_BITFIELD: + case H5T_OPAQUE: + case H5T_STRING: + case H5T_COMPOUND: + case H5T_REFERENCE: + case H5T_ENUM: + case H5T_VLEN: + case H5T_ARRAY: + break; + + default: + break; + + } + + + return(p_type); } diff --git a/tools/lib/h5tools_utils.c b/tools/lib/h5tools_utils.c index b1df66e..11ab5f3 100644 --- a/tools/lib/h5tools_utils.c +++ b/tools/lib/h5tools_utils.c @@ -28,13 +28,13 @@ #include #include +#include "h5tools.h" #include "h5tools_utils.h" #include "H5private.h" #include "h5trav.h" /* global variables */ -int nCols = 80; - +int h5tools_nCols = 80; /* ``get_option'' variables */ int opt_err = 1; /*get_option prints errors if this is on */ int opt_ind = 1; /*token pointer */ @@ -42,6 +42,18 @@ const char *opt_arg; /*flag argument (or value) */ static int h5tools_d_status = 0; static const char *h5tools_progname = "h5tools"; +/* + * The output functions need a temporary buffer to hold a piece of the + * dataset while it's being printed. This constant sets the limit on the + * size of that temporary buffer in bytes. For efficiency's sake, choose the + * largest value suitable for your machine (for testing use a small value). + */ +/* Maximum size used in a call to malloc for a dataset */ +hsize_t H5TOOLS_MALLOCSIZE = (256 * 1024 * 1024); /* 256 MB */ +/* size of hyperslab buffer when a dataset is bigger than H5TOOLS_MALLOCSIZE */ +hsize_t H5TOOLS_BUFSIZE = ( 32 * 1024 * 1024); /* 32 MB */ + + /* ``parallel_print'' variables */ unsigned char g_Parallel = 0; /*0 for serial, 1 for parallel */ char outBuff[OUTBUFF_SIZE]; @@ -68,57 +80,54 @@ static void add_obj(table_t *table, haddr_t objno, const char *objname, hbool_t */ void parallel_print(const char* format, ...) { - int bytes_written; - va_list ap; - - va_start(ap, format); + int bytes_written; + va_list ap; - if(!g_Parallel) - vprintf(format, ap); - else - { + HDva_start(ap, format); - if(overflow_file == NULL) /*no overflow has occurred yet */ - { + if(!g_Parallel) + HDvprintf(format, ap); + else { + if(overflow_file == NULL) /*no overflow has occurred yet */ { #if 0 - printf("calling HDvsnprintf: OUTBUFF_SIZE=%ld, outBuffOffset=%ld, ", (long)OUTBUFF_SIZE, (long)outBuffOffset); + printf("calling HDvsnprintf: OUTBUFF_SIZE=%ld, outBuffOffset=%ld, ", (long)OUTBUFF_SIZE, (long)outBuffOffset); #endif - bytes_written = HDvsnprintf(outBuff+outBuffOffset, OUTBUFF_SIZE-outBuffOffset, format, ap); + bytes_written = HDvsnprintf(outBuff+outBuffOffset, OUTBUFF_SIZE-outBuffOffset, format, ap); #if 0 - printf("bytes_written=%ld\n", (long)bytes_written); + printf("bytes_written=%ld\n", (long)bytes_written); #endif - va_end(ap); - va_start(ap, format); + HDva_end(ap); + HDva_start(ap, format); #if 0 - printf("Result: bytes_written=%ld, OUTBUFF_SIZE-outBuffOffset=%ld\n", (long)bytes_written, (long)OUTBUFF_SIZE-outBuffOffset); + printf("Result: bytes_written=%ld, OUTBUFF_SIZE-outBuffOffset=%ld\n", (long)bytes_written, (long)OUTBUFF_SIZE-outBuffOffset); #endif - if ((bytes_written < 0) || + if ((bytes_written < 0) || #ifdef H5_VSNPRINTF_WORKS - (bytes_written >= (OUTBUFF_SIZE-outBuffOffset)) + (bytes_written >= (OUTBUFF_SIZE-outBuffOffset)) #else - ((bytes_written+1) == (OUTBUFF_SIZE-outBuffOffset)) + ((bytes_written+1) == (OUTBUFF_SIZE-outBuffOffset)) #endif - ) - { - /* Terminate the outbuff at the end of the previous output */ - outBuff[outBuffOffset] = '\0'; - - overflow_file = HDtmpfile(); - if(overflow_file == NULL) - fprintf(stderr, "warning: could not create overflow file. Output may be truncated.\n"); - else - bytes_written = HDvfprintf(overflow_file, format, ap); - } - else - outBuffOffset += bytes_written; - } - else - bytes_written = HDvfprintf(overflow_file, format, ap); - - } - va_end(ap); + ) + { + /* Terminate the outbuff at the end of the previous output */ + outBuff[outBuffOffset] = '\0'; + + overflow_file = HDtmpfile(); + if(overflow_file == NULL) + HDfprintf(rawerrorstream, "warning: could not create overflow file. Output may be truncated.\n"); + else + bytes_written = HDvfprintf(overflow_file, format, ap); + } + else + outBuffOffset += bytes_written; + } + else + bytes_written = HDvfprintf(overflow_file, format, ap); + + } + HDva_end(ap); } @@ -142,12 +151,13 @@ error_msg(const char *fmt, ...) { va_list ap; - va_start(ap, fmt); - HDfflush(stdout); - HDfprintf(stderr, "%s error: ", h5tools_getprogname()); - HDvfprintf(stderr, fmt, ap); + HDva_start(ap, fmt); + HDfflush(rawdatastream); + HDfflush(rawoutstream); + HDfprintf(rawerrorstream, "%s error: ", h5tools_getprogname()); + HDvfprintf(rawerrorstream, fmt, ap); - va_end(ap); + HDva_end(ap); } @@ -171,11 +181,30 @@ warn_msg(const char *fmt, ...) { va_list ap; - va_start(ap, fmt); - HDfflush(stdout); - HDfprintf(stderr, "%s warning: ", h5tools_getprogname()); - HDvfprintf(stderr, fmt, ap); - va_end(ap); + HDva_start(ap, fmt); + HDfflush(rawdatastream); + HDfflush(rawoutstream); + HDfprintf(rawerrorstream, "%s warning: ", h5tools_getprogname()); + HDvfprintf(rawerrorstream, fmt, ap); + HDva_end(ap); +} + +/*------------------------------------------------------------------------- + * Function: help_ref_msg + * + * Purpose: Print a message to refer help page + * + * Return: Nothing + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +void +help_ref_msg(FILE *output) +{ + HDfprintf(output, "Try '-h' or '--help' for more information or "); + HDfprintf(output, "see the <%s> entry in the 'HDF5 Reference Manual'.\n",h5tools_getprogname()); } @@ -210,7 +239,8 @@ get_option(int argc, const char **argv, const char *opts, const struct long_opti /* check for more flag-like tokens */ if (opt_ind >= argc || argv[opt_ind][0] != '-' || argv[opt_ind][1] == '\0') { return EOF; - } else if (HDstrcmp(argv[opt_ind], "--") == 0) { + } + else if (HDstrcmp(argv[opt_ind], "--") == 0) { opt_ind++; return EOF; } @@ -236,27 +266,27 @@ get_option(int argc, const char **argv, const char *opts, const struct long_opti if (opt_ind < (argc - 1)) if (argv[opt_ind + 1][0] != '-') opt_arg = argv[++opt_ind]; - } else if (l_opts[i].has_arg == require_arg) { + } + else if (l_opts[i].has_arg == require_arg) { if (opt_err) - HDfprintf(stderr, + HDfprintf(rawerrorstream, "%s: option required for \"--%s\" flag\n", argv[0], arg); opt_opt = '?'; } - } else { + } + else { if (arg[len] == '=') { if (opt_err) - HDfprintf(stderr, + HDfprintf(rawerrorstream, "%s: no option required for \"%s\" flag\n", argv[0], arg); opt_opt = '?'; } - opt_arg = NULL; } - break; } } @@ -264,22 +294,23 @@ get_option(int argc, const char **argv, const char *opts, const struct long_opti if (l_opts[i].name == NULL) { /* exhausted all of the l_opts we have and still didn't match */ if (opt_err) - HDfprintf(stderr, "%s: unknown option \"%s\"\n", argv[0], arg); + HDfprintf(rawerrorstream, "%s: unknown option \"%s\"\n", argv[0], arg); opt_opt = '?'; } opt_ind++; sp = 1; - } else { + } + else { register char *cp; /* pointer into current token */ /* short command line option */ opt_opt = argv[opt_ind][sp]; - if (opt_opt == ':' || (cp = strchr(opts, opt_opt)) == 0) { + if (opt_opt == ':' || (cp = HDstrchr(opts, opt_opt)) == 0) { if (opt_err) - HDfprintf(stderr, "%s: unknown option \"%c\"\n", + HDfprintf(rawerrorstream, "%s: unknown option \"%c\"\n", argv[0], opt_opt); /* if no chars left in this token, move to next token */ @@ -287,7 +318,6 @@ get_option(int argc, const char **argv, const char *opts, const struct long_opti opt_ind++; sp = 1; } - return '?'; } @@ -296,48 +326,41 @@ get_option(int argc, const char **argv, const char *opts, const struct long_opti if (argv[opt_ind][sp + 1] != '\0') { /* flag value is rest of current token */ opt_arg = &argv[opt_ind++][sp + 1]; - } else if (++opt_ind >= argc) { + } + else if (++opt_ind >= argc) { if (opt_err) - HDfprintf(stderr, + HDfprintf(rawerrorstream, "%s: value expected for option \"%c\"\n", argv[0], opt_opt); opt_opt = '?'; - } else { + } + else { /* flag value is next token */ opt_arg = argv[opt_ind++]; } sp = 1; } - /* wildcard argument */ - else if (*cp == '*') - { + else if (*cp == '*') { /* check the next argument */ opt_ind++; /* we do have an extra argument, check if not last */ - if ( argv[opt_ind][0] != '-' && (opt_ind+1) < argc ) - { + if ( argv[opt_ind][0] != '-' && (opt_ind+1) < argc ) { opt_arg = argv[opt_ind++]; } - else - { + else { opt_arg = NULL; } } - - else - { + else { /* set up to look at next char in token, next time */ if (argv[opt_ind][++sp] == '\0') { /* no more in current token, so setup next token */ opt_ind++; sp = 1; - - } - opt_arg = NULL; } } @@ -363,12 +386,13 @@ get_option(int argc, const char **argv, const char *opts, const struct long_opti void indentation(int x) { - if (x < nCols) { + if (x < h5tools_nCols) { while (x-- > 0) - printf(" "); - } else { - HDfprintf(stderr, "error: the indentation exceeds the number of cols.\n"); - exit(1); + HDfprintf(rawoutstream, " "); + } + else { + HDfprintf(rawerrorstream, "error: the indentation exceeds the number of cols.\n"); + HDexit(1); } } @@ -390,7 +414,7 @@ indentation(int x) void print_version(const char *progname) { - printf("%s: Version %u.%u.%u%s%s\n", + HDfprintf(rawoutstream, "%s: Version %u.%u.%u%s%s\n", progname, H5_VERS_MAJOR, H5_VERS_MINOR, H5_VERS_RELEASE, ((char *)H5_VERS_SUBRELEASE)[0] ? "-" : "", H5_VERS_SUBRELEASE); } @@ -470,9 +494,9 @@ dump_table(char* tablename, table_t *table) { unsigned u; - printf("%s: # of entries = %d\n", tablename,table->nobjs); + HDfprintf(rawoutstream,"%s: # of entries = %d\n", tablename,table->nobjs); for (u = 0; u < table->nobjs; u++) - HDfprintf(stdout,"%a %s %d %d\n", table->objs[u].objno, + HDfprintf(rawoutstream,"%a %s %d %d\n", table->objs[u].objno, table->objs[u].objname, table->objs[u].displayed, table->objs[u].recorded); } @@ -785,10 +809,12 @@ H5tools_get_symlink_info(hid_t file_id, const char * linkpath, h5tool_link_info_ * follow object in other file */ if(link_info->linfo.type == H5L_TYPE_EXTERNAL) { - fapl = H5Pcreate(H5P_FILE_ACCESS); + if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) + goto out; if(H5Pset_fapl_sec2(fapl) < 0) goto out; - lapl = H5Pcreate(H5P_LINK_ACCESS); + if((lapl = H5Pcreate(H5P_LINK_ACCESS)) < 0) + goto out; if(H5Pset_elink_fapl(lapl, fapl) < 0) goto out; } /* end if */ @@ -869,3 +895,43 @@ int h5tools_getstatus(void) { return h5tools_d_status; } + +/*----------------------------------------------------------- + * PURPOSE : + * if environment variable H5TOOLS_BUFSIZE is set, + * update H5TOOLS_BUFSIZE and H5TOOLS_MALLOCSIZE from the env + * This can be called from each tools main() as part of initial act. + * Note: this is more of debugging purpose for now. + */ +int h5tools_getenv_update_hyperslab_bufsize(void) +{ + const char *env_str = NULL; + long hyperslab_bufsize_mb; + + /* check if environment variable is set for the hyperslab buffer size */ + if (NULL != (env_str = HDgetenv ("H5TOOLS_BUFSIZE"))) + { + errno = 0; + hyperslab_bufsize_mb = HDstrtol(env_str, (char**)NULL, 10); + if (errno != 0 || hyperslab_bufsize_mb <= 0) + { + + /* TODO: later when pubilshed + HDfprintf(rawerrorstream,"Error: Invalid environment variable \"H5TOOLS_BUFSIZE\" : %s\n", env_str); + */ + + goto error; + } + + + /* convert MB to byte */ + H5TOOLS_BUFSIZE = hyperslab_bufsize_mb * 1024 * 1024; + + H5TOOLS_MALLOCSIZE = MAX(H5TOOLS_BUFSIZE, H5TOOLS_MALLOCSIZE); + } + + + return (1); +error: + return (-1); +} diff --git a/tools/lib/h5tools_utils.h b/tools/lib/h5tools_utils.h index 88ab7ea..f30974a 100644 --- a/tools/lib/h5tools_utils.h +++ b/tools/lib/h5tools_utils.h @@ -29,9 +29,19 @@ extern "C" { #endif /* ``parallel_print'' information */ -#define PRINT_DATA_MAX_SIZE 512 -#define OUTBUFF_SIZE (PRINT_DATA_MAX_SIZE*4) - +#define PRINT_DATA_MAX_SIZE 512 +#define OUTBUFF_SIZE (PRINT_DATA_MAX_SIZE*4) + +H5TOOLS_DLLVAR int g_nTasks; +H5TOOLS_DLLVAR unsigned char g_Parallel; +H5TOOLS_DLLVAR char outBuff[]; +H5TOOLS_DLLVAR int outBuffOffset; +H5TOOLS_DLLVAR FILE * overflow_file; + +/* Maximum size used in a call to malloc for a dataset */ +H5TOOLS_DLLVAR hsize_t H5TOOLS_MALLOCSIZE; +/* size of hyperslab buffer when a dataset is bigger than H5TOOLS_MALLOCSIZE */ +H5TOOLS_DLLVAR hsize_t H5TOOLS_BUFSIZE; /* * begin get_option section */ @@ -41,7 +51,7 @@ H5TOOLS_DLLVAR const char *opt_arg; /* flag argument (or value) enum { no_arg = 0, /* doesn't take an argument */ - require_arg, /* requires an argument */ + require_arg, /* requires an argument */ optional_arg /* argument is optional */ }; @@ -52,23 +62,23 @@ enum { * the option. The long options are specified in the following way: * * struct long_options foo[] = { - * { "filename", require_arg, 'f' }, - * { "append", no_arg, 'a' }, - * { "width", require_arg, 'w' }, - * { NULL, 0, 0 } + * { "filename", require_arg, 'f' }, + * { "append", no_arg, 'a' }, + * { "width", require_arg, 'w' }, + * { NULL, 0, 0 } * }; * * Long named options can have arguments specified as either: * - * ``--param=arg'' or ``--param arg'' + * ``--param=arg'' or ``--param arg'' * * Short named options can have arguments specified as either: * - * ``-w80'' or ``-w 80'' + * ``-w80'' or ``-w 80'' * * and can have more than one short named option specified at one time: * - * -aw80 + * -aw80 * * in which case those options which expect an argument need to come at the * end. @@ -109,7 +119,7 @@ typedef struct find_objs_t { table_t *dset_table; } find_objs_t; -H5TOOLS_DLLVAR int nCols; /*max number of columns for outputting */ +H5TOOLS_DLLVAR int h5tools_nCols; /*max number of columns for outputting */ /* Definitions of useful routines */ H5TOOLS_DLL void indentation(int); @@ -117,6 +127,7 @@ H5TOOLS_DLL void print_version(const char *progname); H5TOOLS_DLL void parallel_print(const char* format, ... ); H5TOOLS_DLL void error_msg(const char *fmt, ...); H5TOOLS_DLL void warn_msg(const char *fmt, ...); +H5TOOLS_DLL void help_ref_msg(FILE *output); H5TOOLS_DLL void free_table(table_t *table); #ifdef H5DUMP_DEBUG H5TOOLS_DLL void dump_tables(find_objs_t *info) @@ -125,7 +136,7 @@ H5TOOLS_DLL herr_t init_objs(hid_t fid, find_objs_t *info, table_t **group_table table_t **dset_table, table_t **type_table); H5TOOLS_DLL obj_t *search_obj(table_t *temp, haddr_t objno); #ifndef H5_HAVE_TMPFILE -H5TOOLS_DLL FILE * tmpfile(void); +H5TOOLS_DLL FILE * tmpfile(void); #endif /************************************************************* @@ -162,9 +173,9 @@ H5TOOLS_DLL const char *h5tools_getprogname(void); H5TOOLS_DLL void h5tools_setprogname(const char*progname); H5TOOLS_DLL int h5tools_getstatus(void); H5TOOLS_DLL void h5tools_setstatus(int d_status); - +H5TOOLS_DLL int h5tools_getenv_update_hyperslab_bufsize(void); #ifdef __cplusplus } #endif -#endif /* H5TOOLS_UTILS_H__ */ +#endif /* H5TOOLS_UTILS_H__ */ diff --git a/tools/lib/h5trav.c b/tools/lib/h5trav.c index 5195261..ad8b9fe 100644 --- a/tools/lib/h5trav.c +++ b/tools/lib/h5trav.c @@ -151,7 +151,7 @@ traverse_cb(hid_t loc_id, const char *path, const H5L_info_t *linfo, size_t base_len = HDstrlen(udata->base_grp_name); size_t add_slash = base_len ? ((udata->base_grp_name)[base_len-1] != '/') : 1; - if(NULL == (new_name = HDmalloc(base_len + add_slash + HDstrlen(path) + 1))) + if(NULL == (new_name = (char*)HDmalloc(base_len + add_slash + HDstrlen(path) + 1))) return(H5_ITER_ERROR); HDstrcpy(new_name, udata->base_grp_name); if (add_slash) @@ -307,6 +307,8 @@ trav_info_add(trav_info_t *info, const char *path, h5trav_type_t obj_type) idx = info->nused++; info->paths[idx].path = HDstrdup(path); info->paths[idx].type = obj_type; + info->paths[idx].fileno = 0; + info->paths[idx].objno = HADDR_UNDEF; } /* end trav_info_add() */ @@ -327,10 +329,18 @@ int trav_info_visit_obj(const char *path, const H5O_info_t *oinfo, const char UNUSED *already_visited, void *udata) { + size_t idx; + trav_info_t *info_p; /* Add the object to the 'info' struct */ /* (object types map directly to "traversal" types) */ trav_info_add((trav_info_t *)udata, path, (h5trav_type_t)oinfo->type); + /* set object addr and fileno. These are for checking same object */ + info_p = (trav_info_t *) udata; + idx = info_p->nused - 1; + info_p->paths[idx].objno = oinfo->addr; + info_p->paths[idx].fileno = oinfo->fileno; + return(0); } /* end trav_info_visit_obj() */ @@ -656,6 +666,7 @@ trav_table_add(trav_table_t *table, new = table->nobjs++; table->objs[new].objno = oinfo ? oinfo->addr : HADDR_UNDEF; table->objs[new].flags[0] = table->objs[new].flags[1] = 0; + table->objs[new].is_same_trgobj = 0; table->objs[new].name = (char *)HDstrdup(path); table->objs[new].type = oinfo ? (h5trav_type_t)oinfo->type : H5TRAV_TYPE_LINK; table->objs[new].nlinks = 0; @@ -739,6 +750,7 @@ void trav_table_addflags(unsigned *flags, table->objs[new].objno = 0; table->objs[new].flags[0] = flags[0]; table->objs[new].flags[1] = flags[1]; + table->objs[new].is_same_trgobj = 0; table->objs[new].name = (char *)HDstrdup(name); table->objs[new].type = type; table->objs[new].nlinks = 0; @@ -883,12 +895,12 @@ trav_print_visit_lnk(const char *path, const H5L_info_t *linfo, void *udata) switch(linfo->type) { case H5L_TYPE_SOFT: if(linfo->u.val_size > 0) { - char *targbuf = HDmalloc(linfo->u.val_size + 1); + char *targbuf = (char*)HDmalloc(linfo->u.val_size + 1); HDassert(targbuf); H5Lget_val(print_udata->fid, path, targbuf, linfo->u.val_size + 1, H5P_DEFAULT); printf(" %-10s %s -> %s\n", "link", path, targbuf); - free(targbuf); + HDfree(targbuf); } /* end if */ else printf(" %-10s %s ->\n", "link", path); @@ -900,13 +912,13 @@ trav_print_visit_lnk(const char *path, const H5L_info_t *linfo, void *udata) const char *filename; const char *objname; - targbuf = HDmalloc(linfo->u.val_size + 1); - assert(targbuf); + targbuf = (char*)HDmalloc(linfo->u.val_size + 1); + HDassert(targbuf); H5Lget_val(print_udata->fid, path, targbuf, linfo->u.val_size + 1, H5P_DEFAULT); H5Lunpack_elink_val(targbuf, linfo->u.val_size, NULL, &filename, &objname); printf(" %-10s %s -> %s %s\n", "ext link", path, filename, objname); - free(targbuf); + HDfree(targbuf); } /* end if */ else printf(" %-10s %s ->\n", "ext link", path); diff --git a/tools/lib/h5trav.h b/tools/lib/h5trav.h index 8eb93fa..da8dc69 100644 --- a/tools/lib/h5trav.h +++ b/tools/lib/h5trav.h @@ -65,6 +65,8 @@ typedef struct symlink_trav_t { typedef struct trav_path_t { char *path; h5trav_type_t type; + haddr_t objno; /* object address */ + unsigned long fileno; /* File number that object is located in */ } trav_path_t; typedef struct trav_info_t { @@ -95,6 +97,7 @@ typedef struct trav_link_t { typedef struct trav_obj_t { haddr_t objno; /* object address */ unsigned flags[2]; /* h5diff.object is present or not in both files*/ + hbool_t is_same_trgobj; /* same target object? no need to compare */ char *name; /* name */ h5trav_type_t type; /* type of object */ trav_link_t *links; /* array of possible link names */ diff --git a/tools/lib/ph5diff.h b/tools/lib/ph5diff.h index 0e454c8..becbd6c 100644 --- a/tools/lib/ph5diff.h +++ b/tools/lib/ph5diff.h @@ -17,37 +17,31 @@ #define _PH5DIFF_H__ /* Send from manager to workers */ -#define MPI_TAG_ARGS 1 -#define MPI_TAG_PRINT_TOK 2 +#define MPI_TAG_ARGS 1 +#define MPI_TAG_PRINT_TOK 2 /*Sent from workers to manager */ -#define MPI_TAG_TOK_REQUEST 3 -#define MPI_TAG_DONE 4 -#define MPI_TAG_TOK_RETURN 5 -#define MPI_TAG_PRINT_DATA 6 +#define MPI_TAG_TOK_REQUEST 3 +#define MPI_TAG_DONE 4 +#define MPI_TAG_TOK_RETURN 5 +#define MPI_TAG_PRINT_DATA 6 /* Operational tags used to init and complete diff */ -#define MPI_TAG_END 7 -#define MPI_TAG_PARALLEL 8 +#define MPI_TAG_END 7 +#define MPI_TAG_PARALLEL 8 -extern int g_nTasks; -extern unsigned char g_Parallel; -extern char outBuff[]; -extern int outBuffOffset; -extern FILE * overflow_file; - -struct diff_args +struct diff_mpi_args { - char name1[256]; - char name2[256]; - h5trav_type_t type; - diff_opt_t options; + char name1[256]; + char name2[256]; + diff_opt_t options; + diff_args_t argdata; /* rest args */ }; struct diffs_found { hsize_t nfound; - int not_cmp; + int not_cmp; }; #ifdef H5_HAVE_PARALLEL diff --git a/tools/misc/CMakeLists.txt b/tools/misc/CMakeLists.txt index b4e7078..72930c9 100644 --- a/tools/misc/CMakeLists.txt +++ b/tools/misc/CMakeLists.txt @@ -1,11 +1,10 @@ -cmake_minimum_required (VERSION 2.8) +cmake_minimum_required (VERSION 2.8.6) PROJECT (HDF5_TOOLS_MISC) #----------------------------------------------------------------------------- # Setup include Directories #----------------------------------------------------------------------------- INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib) -INCLUDE_DIRECTORIES (${HDF5_PROJECT_DIR}/test) # -------------------------------------------------------------------- # Add the misc executables @@ -14,14 +13,17 @@ INCLUDE_DIRECTORIES (${HDF5_PROJECT_DIR}/test) ADD_EXECUTABLE (h5debug ${HDF5_TOOLS_MISC_SOURCE_DIR}/h5debug.c) TARGET_NAMING (h5debug ${LIB_TYPE}) TARGET_LINK_LIBRARIES (h5debug ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) +SET_TARGET_PROPERTIES (h5debug PROPERTIES FOLDER tools) ADD_EXECUTABLE (h5repart ${HDF5_TOOLS_MISC_SOURCE_DIR}/h5repart.c) TARGET_NAMING (h5repart ${LIB_TYPE}) TARGET_LINK_LIBRARIES (h5repart ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) +SET_TARGET_PROPERTIES (h5repart PROPERTIES FOLDER tools) ADD_EXECUTABLE (h5mkgrp ${HDF5_TOOLS_MISC_SOURCE_DIR}/h5mkgrp.c) TARGET_NAMING (h5mkgrp ${LIB_TYPE}) TARGET_LINK_LIBRARIES (h5mkgrp ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) +SET_TARGET_PROPERTIES (h5mkgrp PROPERTIES FOLDER tools) SET (H5_DEP_EXECUTABLES h5debug @@ -43,12 +45,14 @@ IF (BUILD_TESTING) ADD_EXECUTABLE (h5repart_gentest ${HDF5_TOOLS_MISC_SOURCE_DIR}/h5repart_gentest.c) TARGET_NAMING (h5repart_gentest ${LIB_TYPE}) TARGET_LINK_LIBRARIES (h5repart_gentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + SET_TARGET_PROPERTIES (h5repart_gentest PROPERTIES FOLDER generator/tools) #ADD_TEST (NAME h5repart_gentest COMMAND $) ENDIF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) ADD_EXECUTABLE (h5repart_test ${HDF5_TOOLS_MISC_SOURCE_DIR}/repart_test.c) TARGET_NAMING (h5repart_test ${LIB_TYPE}) TARGET_LINK_LIBRARIES (h5repart_test ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + SET_TARGET_PROPERTIES (h5repart_test PROPERTIES FOLDER tools) # -------------------------------------------------------------------- # Copy all the HDF5 files from the test directory into the source directory @@ -134,14 +138,18 @@ IF (BUILD_TESTING) ${PROJECT_BINARY_DIR}/${resultfile}.out ${PROJECT_BINARY_DIR}/${resultfile}.out.err ) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5MKGRP-clear-${resultfile}${resultoption} PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") ADD_TEST ( NAME H5MKGRP-${resultfile}${resultoption} COMMAND $ ${resultoption} ${PROJECT_BINARY_DIR}/../testfiles/${resultfile}.h5 ${ARGN} ) SET_TESTS_PROPERTIES (H5MKGRP-${resultfile}${resultoption} PROPERTIES DEPENDS H5MKGRP-clear-${resultfile}${resultoption}) + SET (last_test "H5MKGRP-${resultfile}${resultoption}") IF (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( - NAME H5MKGRP-H5LS-${resultfile}${resultoption} + NAME H5MKGRP-h5ls-${resultfile}${resultoption} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" -D "TEST_ARGS:STRING=-v;-r;../testfiles/${resultfile}.h5" @@ -152,7 +160,8 @@ IF (BUILD_TESTING) -D "TEST_REFERENCE=${resultfile}.ls" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5MKGRP-H5LS-${resultfile}${resultoption} PROPERTIES DEPENDS H5MKGRP-${resultfile}${resultoption}) + SET_TESTS_PROPERTIES (H5MKGRP-h5ls-${resultfile}${resultoption} PROPERTIES DEPENDS H5MKGRP-${resultfile}${resultoption}) + SET (last_test "H5MKGRP-h5ls-${resultfile}${resultoption}") ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) ELSE (NOT ${resultoption} STREQUAL " ") ADD_TEST ( @@ -163,14 +172,18 @@ IF (BUILD_TESTING) ${PROJECT_BINARY_DIR}/${resultfile}.out ${PROJECT_BINARY_DIR}/${resultfile}.out.err ) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5MKGRP-clear-${resultfile} PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") ADD_TEST ( NAME H5MKGRP-${resultfile} COMMAND $ ${PROJECT_BINARY_DIR}/../testfiles/${resultfile}.h5 ${ARGN} ) SET_TESTS_PROPERTIES (H5MKGRP-${resultfile} PROPERTIES DEPENDS H5MKGRP-clear-${resultfile}) + SET (last_test "H5MKGRP-${resultfile}") IF (NOT HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST ( - NAME H5MKGRP-H5LS-${resultfile} + NAME H5MKGRP-h5ls-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" -D "TEST_ARGS:STRING=-v;-r;../testfiles/${resultfile}.h5" @@ -181,7 +194,8 @@ IF (BUILD_TESTING) -D "TEST_REFERENCE=${resultfile}.ls" -P "${HDF5_RESOURCES_DIR}/runTest.cmake" ) - SET_TESTS_PROPERTIES (H5MKGRP-H5LS-${resultfile} PROPERTIES DEPENDS H5MKGRP-${resultfile}) + SET_TESTS_PROPERTIES (H5MKGRP-h5ls-${resultfile} PROPERTIES DEPENDS H5MKGRP-${resultfile}) + SET (last_test "H5MKGRP-h5ls-${resultfile}") ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDIF (NOT ${resultoption} STREQUAL " ") ENDMACRO (ADD_H5_TEST resultfile resultcode resultoption) diff --git a/tools/misc/Makefile.in b/tools/misc/Makefile.in index b761859..ce8e991 100644 --- a/tools/misc/Makefile.in +++ b/tools/misc/Makefile.in @@ -229,6 +229,7 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ +FC2003 = @FC2003@ FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ @@ -249,10 +250,12 @@ H5_LONE_COLON = @H5_LONE_COLON@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ +HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ +HDF_FORTRAN2003 = @HDF_FORTRAN2003@ HID_T = @HID_T@ HL = @HL@ HL_FOR = @HL_FOR@ diff --git a/tools/misc/h5debug.c b/tools/misc/h5debug.c index 2b3b85d..2a7d73f 100644 --- a/tools/misc/h5debug.c +++ b/tools/misc/h5debug.c @@ -62,15 +62,15 @@ /*------------------------------------------------------------------------- * Function: get_H5B2_class * - * Purpose: Determine the v2 B-tree class from the buffer read in. + * Purpose: Determine the v2 B-tree class from the buffer read in. * B-trees are debugged through the B-tree subclass. The subclass * identifier is two bytes after the B-tree signature. * - * Return: Non-NULL on success/NULL on failure + * Return: Non-NULL on success/NULL on failure * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Sep 11 2008 + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * Sep 11 2008 * *------------------------------------------------------------------------- */ @@ -130,7 +130,7 @@ get_H5B2_class(const uint8_t *sig) break; default: - fprintf(stderr, "Unknown B-tree subtype %u\n", (unsigned)(subtype)); + HDfprintf(stderr, "Unknown B-tree subtype %u\n", (unsigned)(subtype)); HDexit(4); } /* end switch */ @@ -141,15 +141,15 @@ get_H5B2_class(const uint8_t *sig) /*------------------------------------------------------------------------- * Function: get_H5EA_class * - * Purpose: Determine the extensible array class from the buffer read in. + * Purpose: Determine the extensible array class from the buffer read in. * Extensible arrays are debugged through the array subclass. * The subclass identifier is two bytes after the signature. * - * Return: Non-NULL on success/NULL on failure + * Return: Non-NULL on success/NULL on failure * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Sep 11 2008 + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * Sep 11 2008 * *------------------------------------------------------------------------- */ @@ -173,7 +173,7 @@ get_H5EA_class(const uint8_t *sig) break; default: - fprintf(stderr, "Unknown array class %u\n", (unsigned)(clsid)); + HDfprintf(stderr, "Unknown array class %u\n", (unsigned)(clsid)); HDexit(4); } /* end switch */ @@ -184,15 +184,15 @@ get_H5EA_class(const uint8_t *sig) /*------------------------------------------------------------------------- * Function: get_H5FA_class * - * Purpose: Determine the fixed array class from the buffer read in. + * Purpose: Determine the fixed array class from the buffer read in. * Extensible arrays are debugged through the array subclass. * The subclass identifier is two bytes after the signature. * - * Return: Non-NULL on success/NULL on failure + * Return: Non-NULL on success/NULL on failure * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Sep 11 2008 + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * Sep 11 2008 * *------------------------------------------------------------------------- */ @@ -216,7 +216,7 @@ get_H5FA_class(const uint8_t *sig) break; default: - fprintf(stderr, "Unknown array class %u\n", (unsigned)(clsid)); + HDfprintf(stderr, "Unknown array class %u\n", (unsigned)(clsid)); HDexit(4); } /* end switch */ @@ -242,7 +242,7 @@ get_H5FA_class(const uint8_t *sig) int main(int argc, char *argv[]) { - hid_t fid, fapl, dxpl; + hid_t fid, fapl, dxpl; H5F_t *f; haddr_t addr = 0, extra = 0, extra2 = 0, extra3 = 0, extra4 = 0; uint8_t sig[H5F_SIGNATURE_LEN]; @@ -250,13 +250,13 @@ main(int argc, char *argv[]) herr_t status = SUCCEED; if(argc == 1) { - fprintf(stderr, "Usage: %s filename [signature-addr [extra]]\n", argv[0]); - HDexit(1); + HDfprintf(stderr, "Usage: %s filename [signature-addr [extra]]\n", argv[0]); + HDexit(1); } /* end if */ /* Initialize the library */ if(H5open() < 0) { - fprintf(stderr, "cannot initialize the library\n"); + HDfprintf(stderr, "cannot initialize the library\n"); HDexit(1); } /* end if */ @@ -264,27 +264,27 @@ main(int argc, char *argv[]) * Open the file and get the file descriptor. */ if((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0) { - fprintf(stderr, "cannot create dataset transfer property list\n"); + HDfprintf(stderr, "cannot create dataset transfer property list\n"); HDexit(1); } /* end if */ if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) { - fprintf(stderr, "cannot create file access property list\n"); + HDfprintf(stderr, "cannot create file access property list\n"); HDexit(1); } /* end if */ - if(strchr(argv[1], '%')) - H5Pset_fapl_family (fapl, (hsize_t)0, H5P_DEFAULT); + if(HDstrchr(argv[1], '%')) + H5Pset_fapl_family (fapl, (hsize_t)0, H5P_DEFAULT); if((fid = H5Fopen(argv[1], H5F_ACC_RDONLY, fapl)) < 0) { - fprintf(stderr, "cannot open file\n"); + HDfprintf(stderr, "cannot open file\n"); HDexit(1); } /* end if */ if(NULL == (f = (H5F_t *)H5I_object(fid))) { - fprintf(stderr, "cannot obtain H5F_t pointer\n"); + HDfprintf(stderr, "cannot obtain H5F_t pointer\n"); HDexit(2); } /* end if */ /* Ignore metadata tags while using h5debug */ if(H5AC_ignore_tags(f) < 0) { - fprintf(stderr, "cannot ignore metadata tags\n"); + HDfprintf(stderr, "cannot ignore metadata tags\n"); HDexit(1); } @@ -307,7 +307,7 @@ main(int argc, char *argv[]) */ HDfprintf(stdout, "Reading signature at address %a (rel)\n", addr); if(H5F_block_read(f, H5FD_MEM_SUPER, addr, sizeof(sig), dxpl, sig) < 0) { - fprintf(stderr, "cannot read signature\n"); + HDfprintf(stderr, "cannot read signature\n"); HDexit(3); } if(!HDmemcmp(sig, H5F_SIGNATURE, (size_t)H5F_SIGNATURE_LEN)) { @@ -335,9 +335,9 @@ main(int argc, char *argv[]) /* Check for extra parameters */ if(extra == 0) { - fprintf(stderr, "\nWarning: Providing the group's local heap address will give more information\n"); - fprintf(stderr, "Symbol table node usage:\n"); - fprintf(stderr, "\th5debug
\n\n"); + HDfprintf(stderr, "\nWarning: Providing the group's local heap address will give more information\n"); + HDfprintf(stderr, "Symbol table node usage:\n"); + HDfprintf(stderr, "\th5debug
\n\n"); } /* end if */ status = H5G_node_debug(f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL, extra); @@ -355,9 +355,9 @@ main(int argc, char *argv[]) case H5B_SNODE_ID: /* Check for extra parameters */ if(extra == 0) { - fprintf(stderr, "\nWarning: Providing the group's local heap address will give more information\n"); - fprintf(stderr, "B-tree symbol table node usage:\n"); - fprintf(stderr, "\th5debug
\n\n"); + HDfprintf(stderr, "\nWarning: Providing the group's local heap address will give more information\n"); + HDfprintf(stderr, "B-tree symbol table node usage:\n"); + HDfprintf(stderr, "\th5debug
\n\n"); } /* end if */ status = H5G_node_debug(f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL, extra); @@ -366,9 +366,9 @@ main(int argc, char *argv[]) case H5B_CHUNK_ID: /* Check for extra parameters */ if(extra == 0) { - fprintf(stderr, "ERROR: Need number of dimensions of chunk in order to dump chunk B-tree node\n"); - fprintf(stderr, "B-tree chunked storage node usage:\n"); - fprintf(stderr, "\th5debug <# of dimensions>\n"); + HDfprintf(stderr, "ERROR: Need number of dimensions of chunk in order to dump chunk B-tree node\n"); + HDfprintf(stderr, "B-tree chunked storage node usage:\n"); + HDfprintf(stderr, "\th5debug <# of dimensions>\n"); HDexit(4); } /* end if */ @@ -377,7 +377,7 @@ main(int argc, char *argv[]) break; default: - fprintf(stderr, "Unknown B-tree subtype %u\n", (unsigned)(subtype)); + HDfprintf(stderr, "Unknown B-tree subtype %u\n", (unsigned)(subtype)); HDexit(4); } @@ -415,10 +415,10 @@ main(int argc, char *argv[]) HDexit(4); } else if(extra == 0 || extra2 == 0 || extra3 == 0) { - fprintf(stderr, "ERROR: Need v2 B-tree header address and the node's number of records and depth in order to dump internal node\n"); - fprintf(stderr, "NOTE: Leaf nodes are depth 0, the internal nodes above them are depth 1, etc.\n"); - fprintf(stderr, "v2 B-tree internal node usage:\n"); - fprintf(stderr, "\th5debug \n"); + HDfprintf(stderr, "ERROR: Need v2 B-tree header address and the node's number of records and depth in order to dump internal node\n"); + HDfprintf(stderr, "NOTE: Leaf nodes are depth 0, the internal nodes above them are depth 1, etc.\n"); + HDfprintf(stderr, "v2 B-tree internal node usage:\n"); + HDfprintf(stderr, "\th5debug \n"); HDexit(4); } /* end if */ @@ -441,9 +441,9 @@ main(int argc, char *argv[]) HDexit(4); } else if(extra == 0 || extra2 == 0) { - fprintf(stderr, "ERROR: Need v2 B-tree header address and number of records in order to dump leaf node\n"); - fprintf(stderr, "v2 B-tree leaf node usage:\n"); - fprintf(stderr, "\th5debug \n"); + HDfprintf(stderr, "ERROR: Need v2 B-tree header address and number of records in order to dump leaf node\n"); + HDfprintf(stderr, "v2 B-tree leaf node usage:\n"); + HDfprintf(stderr, "\th5debug \n"); HDexit(4); } /* end if */ @@ -462,9 +462,9 @@ main(int argc, char *argv[]) /* Check for enough valid parameters */ if(extra == 0 || extra2 == 0) { - fprintf(stderr, "ERROR: Need fractal heap header address and size of direct block in order to dump direct block\n"); - fprintf(stderr, "Fractal heap direct block usage:\n"); - fprintf(stderr, "\th5debug \n"); + HDfprintf(stderr, "ERROR: Need fractal heap header address and size of direct block in order to dump direct block\n"); + HDfprintf(stderr, "Fractal heap direct block usage:\n"); + HDfprintf(stderr, "\th5debug \n"); HDexit(4); } /* end if */ @@ -477,9 +477,9 @@ main(int argc, char *argv[]) /* Check for enough valid parameters */ if(extra == 0 || extra2 == 0) { - fprintf(stderr, "ERROR: Need fractal heap header address and number of rows in order to dump indirect block\n"); - fprintf(stderr, "Fractal heap indirect block usage:\n"); - fprintf(stderr, "\th5debug \n"); + HDfprintf(stderr, "ERROR: Need fractal heap header address and number of rows in order to dump indirect block\n"); + HDfprintf(stderr, "Fractal heap indirect block usage:\n"); + HDfprintf(stderr, "\th5debug \n"); HDexit(4); } /* end if */ @@ -499,9 +499,9 @@ main(int argc, char *argv[]) /* Check for enough valid parameters */ if(extra == 0 || extra2 == 0) { - fprintf(stderr, "ERROR: Need free space header address and client address in order to dump serialized sections\n"); - fprintf(stderr, "Free space serialized sections usage:\n"); - fprintf(stderr, "\th5debug \n"); + HDfprintf(stderr, "ERROR: Need free space header address and client address in order to dump serialized sections\n"); + HDfprintf(stderr, "Free space serialized sections usage:\n"); + HDfprintf(stderr, "\th5debug \n"); HDexit(4); } /* end if */ @@ -521,9 +521,9 @@ main(int argc, char *argv[]) /* Check for enough valid parameters */ if(extra2 == 0) { - fprintf(stderr, "ERROR: Need list format version and number of messages in order to shared message list\n"); - fprintf(stderr, "Shared message list usage:\n"); - fprintf(stderr, "\th5debug \n"); + HDfprintf(stderr, "ERROR: Need list format version and number of messages in order to shared message list\n"); + HDfprintf(stderr, "Shared message list usage:\n"); + HDfprintf(stderr, "\th5debug \n"); HDexit(4); } /* end if */ @@ -536,11 +536,11 @@ main(int argc, char *argv[]) const H5EA_class_t *cls = get_H5EA_class(sig); HDassert(cls); - /* Check for enough valid parameters */ + /* Check for enough valid parameters */ if(extra == 0) { - fprintf(stderr, "ERROR: Need object header address containing the layout message in order to dump header\n"); - fprintf(stderr, "Extensible array header block usage:\n"); - fprintf(stderr, "\th5debug \n"); + HDfprintf(stderr, "ERROR: Need object header address containing the layout message in order to dump header\n"); + HDfprintf(stderr, "Extensible array header block usage:\n"); + HDfprintf(stderr, "\th5debug \n"); HDexit(4); } /* end if */ @@ -555,9 +555,9 @@ main(int argc, char *argv[]) /* Check for enough valid parameters */ if(extra == 0 || extra2 == 0) { - fprintf(stderr, "ERROR: Need extensible array header address and object header address containing the layout message in order to dump index block\n"); - fprintf(stderr, "Extensible array index block usage:\n"); - fprintf(stderr, "\th5debug \n"); + HDfprintf(stderr, "ERROR: Need extensible array header address, super block index and object header address containing the layout message in order to dump super block\n"); + HDfprintf(stderr, "Extensible array super block usage:\n"); + HDfprintf(stderr, "\th5debug \n"); HDexit(4); } /* end if */ @@ -589,9 +589,9 @@ main(int argc, char *argv[]) /* Check for enough valid parameters */ if(extra == 0 || extra2 == 0 || extra3 == 0) { - fprintf(stderr, "ERROR: Need extensible array header address, # of elements in data block and object header address containing the layout message in order to dump data block\n"); - fprintf(stderr, "Extensible array data block usage:\n"); - fprintf(stderr, "\th5debug <# of elements in data block> <# of elements in data block> \n"); + HDfprintf(stderr, "ERROR: Need object header address containing the layout message in order to dump header\n"); + HDfprintf(stderr, "Fixed array header block usage:\n"); + HDfprintf(stderr, "\th5debug \n"); HDexit(4); } /* end if */ @@ -623,9 +623,9 @@ main(int argc, char *argv[]) /* Check for enough valid parameters */ if(extra == 0 || extra2 == 0) { - fprintf(stderr, "ERROR: Need fixed array header address and object header address containing the layout message in order to dump data block\n"); - fprintf(stderr, "fixed array data block usage:\n"); - fprintf(stderr, "\th5debug \n"); + HDfprintf(stderr, "ERROR: Need fixed array header address and object header address containing the layout message in order to dump data block\n"); + HDfprintf(stderr, "fixed array data block usage:\n"); + HDfprintf(stderr, "\th5debug \n"); HDexit(4); } /* end if */ @@ -661,13 +661,13 @@ main(int argc, char *argv[]) } HDputchar('\n'); - fprintf(stderr, "unknown signature\n"); + HDfprintf(stderr, "unknown signature\n"); HDexit(4); } /* end else */ /* Check for an error when dumping information */ if(status < 0) { - fprintf(stderr, "An error occurred!\n"); + HDfprintf(stderr, "An error occurred!\n"); H5Eprint2(H5E_DEFAULT, stderr); HDexit(5); } /* end if */ diff --git a/tools/misc/h5mkgrp.c b/tools/misc/h5mkgrp.c index 09f23ef..b4ac6f6 100644 --- a/tools/misc/h5mkgrp.c +++ b/tools/misc/h5mkgrp.c @@ -63,7 +63,7 @@ static void leave(int ret) { h5tools_close(); - exit(ret); + HDexit(ret); } /* end leave() */ @@ -81,7 +81,7 @@ leave(int ret) static void usage(void) { - fprintf(stdout, "\ + HDfprintf(stdout, "\ usage: h5mkgrp [OPTIONS] FILE GROUP...\n\ OPTIONS\n\ -h, --help Print a usage message and exit\n\ @@ -97,8 +97,8 @@ usage: h5mkgrp [OPTIONS] FILE GROUP...\n\ * * Purpose: Parses command line and sets up global variable to control output * - * Return: Success: 0 - * Failure: -1 + * Return: Success: 0 + * Failure: -1 * * Programmer: Quincey Koziol, 2/13/2007 * diff --git a/tools/misc/testh5mkgrp.sh b/tools/misc/testh5mkgrp.sh index 46264c2..7bb98cb 100644 --- a/tools/misc/testh5mkgrp.sh +++ b/tools/misc/testh5mkgrp.sh @@ -51,6 +51,9 @@ TESTING() echo "Testing $* $SPACES" |cut -c1-70 |tr -d '\012' } +# Source in the output filter function definitions. +. $srcdir/../../bin/output_filter.sh + # Print a line-line message left justified in a field of 70 characters # beginning with the word "Verifying". # @@ -97,6 +100,7 @@ H5LSTEST() { expect="$INDIR/`basename $1 .h5`.ls" actual="$OUTDIR/`basename $1 .h5`.out" + actual_sav=${actual}-sav # Stderr is included in stdout so that the diff can detect # any unexpected output from that stream too. @@ -108,6 +112,10 @@ H5LSTEST() $RUNSERIAL $H5LS_BIN $H5LS_ARGS $@ ) 2>&1 |sed 's/Modified:.*/Modified: XXXX-XX-XX XX:XX:XX XXX/' >$actual + # save actual in case it is needed later. + cp $actual $actual_sav + STDOUT_FILTER $actual + STDERR_FILTER $actual if [ ! -f $expect ]; then # Create the expect file if it doesn't yet exist. @@ -124,7 +132,7 @@ H5LSTEST() # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err + rm -f $actual $actual_sav fi } diff --git a/tools/testfiles/file_space.ddl b/tools/testfiles/file_space.ddl index 37b3922..bed5349 100644 --- a/tools/testfiles/file_space.ddl +++ b/tools/testfiles/file_space.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump -B file_space.h5' -############################# HDF5 "file_space.h5" { SUPER_BLOCK { SUPERBLOCK_VERSION 2 @@ -14,9 +11,9 @@ SUPER_BLOCK { ISTORE_K 32 FILE_SPACE_STRATEGY H5F_FILE_SPACE_AGGR_VFD FREE_SPACE_THRESHOLD 10 -} -USER_BLOCK { - USERBLOCK_SIZE 0 + USER_BLOCK { + USERBLOCK_SIZE 0 + } } GROUP "/" { } diff --git a/tools/testfiles/filter_fail.ddl b/tools/testfiles/filter_fail.ddl index 354ac0f..75534e2 100644 --- a/tools/testfiles/filter_fail.ddl +++ b/tools/testfiles/filter_fail.ddl @@ -1,13 +1,10 @@ -############################# -Expected output for 'h5dump --enable-error-stack filter_fail.h5' -############################# HDF5 "filter_fail.h5" { GROUP "/" { DATASET "dset_fail" { DATATYPE H5T_STD_I32LE DATASPACE SIMPLE { ( 10 ) / ( 10 ) } DATA { - } + } } } } @@ -24,7 +21,11 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #003: (file name) line (number) in H5D_chunk_lock(): data pipeline read failed major: Data filters minor: Filter operation failed - #004: (file name) line (number) in H5Z_pipeline(): required filter is not registered + #004: (file name) line (number) in H5Z_pipeline(): required filter 'filter_fail_test' is not registered major: Data filters minor: Read failed h5dump error: unable to print data +H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs): + #000: (file name) line (number) in h5tools_dump_simple_dset(): H5Dread failed + major: Failure in tools library + minor: error in function diff --git a/tools/testfiles/h5dump-help.txt b/tools/testfiles/h5dump-help.txt new file mode 100644 index 0000000..f04ed48 --- /dev/null +++ b/tools/testfiles/h5dump-help.txt @@ -0,0 +1,100 @@ +usage: h5dump [OPTIONS] files + OPTIONS + -h, --help Print a usage message and exit + -n, --contents Print a list of the file contents and exit + -B, --superblock Print the content of the super block + -H, --header Print the header only; no data is displayed + -A, --onlyattr Print the header and value of attributes + -i, --object-ids Print the object ids + -r, --string Print 1-byte integer datasets as ASCII + -e, --escape Escape non printing characters + -V, --version Print version number and exit + -a P, --attribute=P Print the specified attribute + -d P, --dataset=P Print the specified dataset + -y, --noindex Do not print array indices with the data + -p, --properties Print dataset filters, storage layout and fill value + -f D, --filedriver=D Specify which driver to open the file with + -g P, --group=P Print the specified group and all members + -l P, --soft-link=P Print the value(s) of the specified soft link + -o F, --output=F Output raw data into file F + -b B, --binary=B Binary file output, of form B + -t P, --datatype=P Print the specified named datatype + -w N, --width=N Set the number of columns of output. A value of 0 (zero) + sets the number of columns to the maximum (65535). + Default width is 80 columns. + -m T, --format=T Set the floating point output format + -q Q, --sort_by=Q Sort groups and attributes by index Q + -z Z, --sort_order=Z Sort groups and attributes by order Z + -M L, --packedbits=L Print packed bits as unsigned integers, using mask + format L for an integer dataset specified with + option -d. L is a list of offset,length values, + separated by commas. Offset is the beginning bit in + the data value and length is the number of bits of + the mask. + -R, --region Print dataset pointed by region references + -x, --xml Output in XML using Schema + -u, --use-dtd Output in XML using DTD + -D U, --xml-dtd=U Use the DTD or schema at U + -X S, --xml-ns=S (XML Schema) Use qualified names n the XML + ":": no namespace, default: "hdf5:" + E.g., to dump a file called `-f', use h5dump -- -f + --enable-error-stack Prints messages from the HDF5 error stack as they + occur. + --no-compact-subset Disable compact form of subsetting and allow the use + of "[" in datset names. + + Subsetting is available by using the following options with a dataset + attribute. Subsetting is done by selecting a hyperslab from the data. + Thus, the options mirror those for performing a hyperslab selection. + One of the START, COUNT, STRIDE, or BLOCK parameters are mandatory if you do subsetting. + The STRIDE, COUNT, and BLOCK parameters are optional and will default to 1 in + each dimension. START is optional and will default to 0 in each dimension. + + -s START, --start=START Offset of start of subsetting selection + -S STRIDE, --stride=STRIDE Hyperslab stride + -c COUNT, --count=COUNT Number of blocks to include in selection + -k BLOCK, --block=BLOCK Size of block in hyperslab + START, COUNT, STRIDE, and BLOCK - is a list of integers the number of which are equal to the + number of dimensions in the dataspace being queried + + D - is the file driver to use in opening the file. Acceptable values + are "sec2", "family", "split", "multi", "direct", and "stream". Without + the file driver flag, the file will be opened with each driver in + turn and in the order specified above until one driver succeeds + in opening the file. + F - is a filename. + P - is the full path from the root group to the object. + N - is an integer greater than 1. + T - is a string containing the floating point format, e.g '%.3f' + U - is a URI reference (as defined in [IETF RFC 2396], + updated by [IETF RFC 2732]) + B - is the form of binary output: NATIVE for a memory type, FILE for the + file type, LE or BE for pre-existing little or big endian types. + Must be used with -o (output file) and it is recommended that + -d (dataset) is used. B is an optional argument, defaults to NATIVE + Q - is the sort index type. It can be "creation_order" or "name" (default) + Z - is the sort order type. It can be "descending" or "ascending" (default) + + Examples: + + 1) Attribute foo of the group /bar_none in file quux.h5 + + h5dump -a /bar_none/foo quux.h5 + + 2) Selecting a subset from dataset /foo in file quux.h5 + + h5dump -d /foo -s "0,1" -S "1,1" -c "2,3" -k "2,2" quux.h5 + + 3) Saving dataset 'dset' in file quux.h5 to binary file 'out.bin' + using a little-endian type + + h5dump -d /dset -b LE -o out.bin quux.h5 + + 4) Display two packed bits (bits 0-1 and bits 4-6) in the dataset /dset + + h5dump -d /dset -M 0,1,4,3 quux.h5 + + 5) Dataset foo in files multi1.h5 multi2.h5 multi3.h5 + + h5dump -d /foo multi1.h5 multi2.h5 multi3.h5 + diff --git a/tools/testfiles/help-1.ls b/tools/testfiles/help-1.ls index e15a88b..aaba608 100644 --- a/tools/testfiles/help-1.ls +++ b/tools/testfiles/help-1.ls @@ -1,6 +1,3 @@ -############################# - output for 'h5ls -w80 -h' -############################# usage: h5ls [OPTIONS] [OBJECTS...] OPTIONS -h, -?, --help Print a usage message and exit diff --git a/tools/testfiles/help-2.ls b/tools/testfiles/help-2.ls index 7d035c0..aaba608 100644 --- a/tools/testfiles/help-2.ls +++ b/tools/testfiles/help-2.ls @@ -1,6 +1,3 @@ -############################# - output for 'h5ls -w80 -help' -############################# usage: h5ls [OPTIONS] [OBJECTS...] OPTIONS -h, -?, --help Print a usage message and exit diff --git a/tools/testfiles/help-3.ls b/tools/testfiles/help-3.ls index 8de1003..aaba608 100644 --- a/tools/testfiles/help-3.ls +++ b/tools/testfiles/help-3.ls @@ -1,6 +1,3 @@ -############################# - output for 'h5ls -w80 -?' -############################# usage: h5ls [OPTIONS] [OBJECTS...] OPTIONS -h, -?, --help Print a usage message and exit diff --git a/tools/testfiles/nosuchfile.ls b/tools/testfiles/nosuchfile.ls index 8d5855e..8c4ee42 100644 --- a/tools/testfiles/nosuchfile.ls +++ b/tools/testfiles/nosuchfile.ls @@ -1,4 +1 @@ -############################# - output for 'h5ls nosuchfile.h5' -############################# nosuchfile.h5: unable to open file diff --git a/tools/testfiles/packedbits.ddl b/tools/testfiles/packedbits.ddl index 91bd63b..1bca459 100644 --- a/tools/testfiles/packedbits.ddl +++ b/tools/testfiles/packedbits.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump packedbits.h5' -############################# HDF5 "packedbits.h5" { GROUP "/" { DATASET "DS08BITS" { diff --git a/tools/testfiles/tall-1.ddl b/tools/testfiles/tall-1.ddl index 9a72484..ae375c4 100644 --- a/tools/testfiles/tall-1.ddl +++ b/tools/testfiles/tall-1.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump tall.h5' -############################# HDF5 "tall.h5" { GROUP "/" { ATTRIBUTE "attr1" { diff --git a/tools/testfiles/tall-1.ls b/tools/testfiles/tall-1.ls index 6bdb7e7..91b89e6 100644 --- a/tools/testfiles/tall-1.ls +++ b/tools/testfiles/tall-1.ls @@ -1,5 +1,2 @@ -############################# - output for 'h5ls -w80 tall.h5' -############################# g1 Group g2 Group diff --git a/tools/testfiles/tall-2.ddl b/tools/testfiles/tall-2.ddl index 50844df..d669639 100644 --- a/tools/testfiles/tall-2.ddl +++ b/tools/testfiles/tall-2.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump --header -g /g1/g1.1 -a attr2 tall.h5' -############################# HDF5 "tall.h5" { GROUP "/g1/g1.1" { DATASET "dset1.1.1" { diff --git a/tools/testfiles/tall-2.ls b/tools/testfiles/tall-2.ls index 61b8cfb..2d3d66b 100644 --- a/tools/testfiles/tall-2.ls +++ b/tools/testfiles/tall-2.ls @@ -1,6 +1,3 @@ -############################# - output for 'h5ls -w80 -r -d tall.h5' -############################# / Group /g1 Group /g1/g1.1 Group diff --git a/tools/testfiles/tall-2A.ddl b/tools/testfiles/tall-2A.ddl index c6ff136..0ae5210 100644 --- a/tools/testfiles/tall-2A.ddl +++ b/tools/testfiles/tall-2A.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump -A tall.h5' -############################# HDF5 "tall.h5" { GROUP "/" { ATTRIBUTE "attr1" { diff --git a/tools/testfiles/tall-2A.h5.xml b/tools/testfiles/tall-2A.h5.xml index ce9df3a..d118a69 100644 --- a/tools/testfiles/tall-2A.h5.xml +++ b/tools/testfiles/tall-2A.h5.xml @@ -1,8 +1,5 @@ -############################# -Expected output for 'h5dump --xml -A tall.h5' -############################# - + @@ -17,7 +14,16 @@ Expected output for 'h5dump --xml -A tall.h5' - 97 98 99 100 101 102 103 104 105 0 + 97 + 98 + 99 + 100 + 101 + 102 + 103 + 104 + 105 + 0 @@ -35,8 +41,10 @@ Expected output for 'h5dump --xml -A tall.h5' - 0 1 - 2 3 + 0 + 1 + 2 + 3 @@ -46,9 +54,9 @@ Expected output for 'h5dump --xml -A tall.h5' - + - + @@ -75,8 +83,33 @@ Expected output for 'h5dump --xml -A tall.h5' - 49 115 116 32 97 116 116 114 105 98 117 116 101 32 111 102 32 - 100 115 101 116 49 46 49 46 49 0 + 49 + 115 + 116 + 32 + 97 + 116 + 116 + 114 + 105 + 98 + 117 + 116 + 101 + 32 + 111 + 102 + 32 + 100 + 115 + 101 + 116 + 49 + 46 + 49 + 46 + 49 + 0 @@ -93,8 +126,33 @@ Expected output for 'h5dump --xml -A tall.h5' - 50 110 100 32 97 116 116 114 105 98 117 116 101 32 111 102 32 - 100 115 101 116 49 46 49 46 49 0 + 50 + 110 + 100 + 32 + 97 + 116 + 116 + 114 + 105 + 98 + 117 + 116 + 101 + 32 + 111 + 102 + 32 + 100 + 115 + 101 + 116 + 49 + 46 + 49 + 46 + 49 + 0 @@ -106,9 +164,9 @@ Expected output for 'h5dump --xml -A tall.h5' - + - + @@ -138,9 +196,9 @@ Expected output for 'h5dump --xml -A tall.h5' - + - + @@ -161,9 +219,9 @@ Expected output for 'h5dump --xml -A tall.h5' - + - + diff --git a/tools/testfiles/tall-2B.ddl b/tools/testfiles/tall-2B.ddl index 5642d2c..dc8aab7 100644 --- a/tools/testfiles/tall-2B.ddl +++ b/tools/testfiles/tall-2B.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump -A -r tall.h5' -############################# HDF5 "tall.h5" { GROUP "/" { ATTRIBUTE "attr1" { @@ -27,14 +24,14 @@ GROUP "/" { DATATYPE H5T_STD_I8BE DATASPACE SIMPLE { ( 27 ) / ( 27 ) } DATA { - "1st attribute of dset1.1.1\000" + "1st attribute of dset1.1.1\000" } } ATTRIBUTE "attr2" { DATATYPE H5T_STD_I8BE DATASPACE SIMPLE { ( 27 ) / ( 27 ) } DATA { - "2nd attribute of dset1.1.1\000" + "2nd attribute of dset1.1.1\000" } } } diff --git a/tools/testfiles/tall-3.ddl b/tools/testfiles/tall-3.ddl index 7d8e432..1c54e6d 100644 --- a/tools/testfiles/tall-3.ddl +++ b/tools/testfiles/tall-3.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump -d /g2/dset2.1 -l /g1/g1.2/g1.2.1/slink tall.h5' -############################# HDF5 "tall.h5" { DATASET "/g2/dset2.1" { DATATYPE H5T_IEEE_F32BE diff --git a/tools/testfiles/tall-4s.ddl b/tools/testfiles/tall-4s.ddl index 71675bc..36cb659 100644 --- a/tools/testfiles/tall-4s.ddl +++ b/tools/testfiles/tall-4s.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump --dataset=/g1/g1.1/dset1.1.1 --start=1,1 --stride=2,3 --count=3,2 --block=1,1 tall.h5' -############################# HDF5 "tall.h5" { DATASET "/g1/g1.1/dset1.1.1" { DATATYPE H5T_STD_I32BE diff --git a/tools/testfiles/tall-5s.ddl b/tools/testfiles/tall-5s.ddl index 95e4d63..b35be18 100644 --- a/tools/testfiles/tall-5s.ddl +++ b/tools/testfiles/tall-5s.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump -d /g1/g1.1/dset1.1.2[0;2;10;] tall.h5' -############################# HDF5 "tall.h5" { DATASET "/g1/g1.1/dset1.1.2" { DATATYPE H5T_STD_I32BE diff --git a/tools/testfiles/tall.h5.xml b/tools/testfiles/tall.h5.xml index e8d39a4..a74ccbe 100644 --- a/tools/testfiles/tall.h5.xml +++ b/tools/testfiles/tall.h5.xml @@ -1,8 +1,5 @@ -############################# -Expected output for 'h5dump --xml tall.h5' -############################# - + @@ -17,7 +14,16 @@ Expected output for 'h5dump --xml tall.h5' - 97 98 99 100 101 102 103 104 105 0 + 97 + 98 + 99 + 100 + 101 + 102 + 103 + 104 + 105 + 0 @@ -35,8 +41,10 @@ Expected output for 'h5dump --xml tall.h5' - 0 1 - 2 3 + 0 + 1 + 2 + 3 @@ -46,9 +54,9 @@ Expected output for 'h5dump --xml tall.h5' - + - + @@ -75,8 +83,33 @@ Expected output for 'h5dump --xml tall.h5' - 49 115 116 32 97 116 116 114 105 98 117 116 101 32 111 102 32 - 100 115 101 116 49 46 49 46 49 0 + 49 + 115 + 116 + 32 + 97 + 116 + 116 + 114 + 105 + 98 + 117 + 116 + 101 + 32 + 111 + 102 + 32 + 100 + 115 + 101 + 116 + 49 + 46 + 49 + 46 + 49 + 0 @@ -93,23 +126,138 @@ Expected output for 'h5dump --xml tall.h5' - 50 110 100 32 97 116 116 114 105 98 117 116 101 32 111 102 32 - 100 115 101 116 49 46 49 46 49 0 + 50 + 110 + 100 + 32 + 97 + 116 + 116 + 114 + 105 + 98 + 117 + 116 + 101 + 32 + 111 + 102 + 32 + 100 + 115 + 101 + 116 + 49 + 46 + 49 + 46 + 49 + 0 - 0 0 0 0 0 0 0 0 0 0 - 0 1 2 3 4 5 6 7 8 9 - 0 2 4 6 8 10 12 14 16 18 - 0 3 6 9 12 15 18 21 24 27 - 0 4 8 12 16 20 24 28 32 36 - 0 5 10 15 20 25 30 35 40 45 - 0 6 12 18 24 30 36 42 48 54 - 0 7 14 21 28 35 42 49 56 63 - 0 8 16 24 32 40 48 56 64 72 - 0 9 18 27 36 45 54 63 72 81 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 0 + 2 + 4 + 6 + 8 + 10 + 12 + 14 + 16 + 18 + 0 + 3 + 6 + 9 + 12 + 15 + 18 + 21 + 24 + 27 + 0 + 4 + 8 + 12 + 16 + 20 + 24 + 28 + 32 + 36 + 0 + 5 + 10 + 15 + 20 + 25 + 30 + 35 + 40 + 45 + 0 + 6 + 12 + 18 + 24 + 30 + 36 + 42 + 48 + 54 + 0 + 7 + 14 + 21 + 28 + 35 + 42 + 49 + 56 + 63 + 0 + 8 + 16 + 24 + 32 + 40 + 48 + 56 + 64 + 72 + 0 + 9 + 18 + 27 + 36 + 45 + 54 + 63 + 72 + 81 @@ -117,9 +265,9 @@ Expected output for 'h5dump --xml tall.h5' - + - + @@ -134,7 +282,26 @@ Expected output for 'h5dump --xml tall.h5' - 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 @@ -151,9 +318,9 @@ Expected output for 'h5dump --xml tall.h5' - + - + @@ -168,7 +335,16 @@ Expected output for 'h5dump --xml tall.h5' - 1 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 + 1 + 1.1 + 1.2 + 1.3 + 1.4 + 1.5 + 1.6 + 1.7 + 1.8 + 1.9 @@ -176,9 +352,9 @@ Expected output for 'h5dump --xml tall.h5' - + - + @@ -194,9 +370,21 @@ Expected output for 'h5dump --xml tall.h5' - 0 0.1 0.2 0.3 0.4 - 0 0.2 0.4 0.6 0.8 - 0 0.3 0.6 0.9 1.2 + 0 + 0.1 + 0.2 + 0.3 + 0.4 + 0 + 0.2 + 0.4 + 0.6 + 0.8 + 0 + 0.3 + 0.6 + 0.9 + 1.2 diff --git a/tools/testfiles/tallfilters.ddl b/tools/testfiles/tallfilters.ddl index 16405b7..ac6762a 100644 --- a/tools/testfiles/tallfilters.ddl +++ b/tools/testfiles/tallfilters.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump -H -p -d all tfilters.h5' -############################# HDF5 "tfilters.h5" { DATASET "all" { DATATYPE H5T_STD_I32LE @@ -8,7 +5,7 @@ DATASET "all" { STORAGE_LAYOUT { CHUNKED ( 10, 5 ) SIZE 458 (1.747:1 COMPRESSION) - } + } FILTERS { PREPROCESSING SHUFFLE COMPRESSION SZIP { @@ -24,7 +21,7 @@ DATASET "all" { } FILLVALUE { FILL_TIME H5D_FILL_TIME_IFSET - VALUE 0 + VALUE 0 } ALLOCATION_TIME { H5D_ALLOC_TIME_INCR diff --git a/tools/testfiles/tarray1.ddl b/tools/testfiles/tarray1.ddl index 849bc67..8ff01e1 100644 --- a/tools/testfiles/tarray1.ddl +++ b/tools/testfiles/tarray1.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump tarray1.h5' -############################# HDF5 "tarray1.h5" { GROUP "/" { DATASET "Dataset1" { diff --git a/tools/testfiles/tarray1.h5.xml b/tools/testfiles/tarray1.h5.xml index cff79e3..86db36f 100644 --- a/tools/testfiles/tarray1.h5.xml +++ b/tools/testfiles/tarray1.h5.xml @@ -1,16 +1,13 @@ -############################# -Expected output for 'h5dump --xml tarray1.h5' -############################# - + - + - + @@ -30,7 +27,10 @@ Expected output for 'h5dump --xml tarray1.h5' - 0 1 2 3 10 11 12 13 20 21 22 23 30 31 32 33 + 0 1 2 3 + 10 11 12 13 + 20 21 22 23 + 30 31 32 33 diff --git a/tools/testfiles/tarray1.ls b/tools/testfiles/tarray1.ls index 60c002d..973a4e2 100644 --- a/tools/testfiles/tarray1.ls +++ b/tools/testfiles/tarray1.ls @@ -1,6 +1,3 @@ -############################# - output for 'h5ls -w80 -r -d tarray1.h5' -############################# / Group /Dataset1 Dataset {4} Data: diff --git a/tools/testfiles/tarray1_big.ddl b/tools/testfiles/tarray1_big.ddl index a19a7c3..bb06df2 100644 --- a/tools/testfiles/tarray1_big.ddl +++ b/tools/testfiles/tarray1_big.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump -R tarray1_big.h5' -############################# HDF5 "tarray1_big.h5" { GROUP "/" { DATASET "Dataset1" { diff --git a/tools/testfiles/tarray2.ddl b/tools/testfiles/tarray2.ddl index df1e0b8..5a8460a 100644 --- a/tools/testfiles/tarray2.ddl +++ b/tools/testfiles/tarray2.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump tarray2.h5' -############################# HDF5 "tarray2.h5" { GROUP "/" { DATASET "Dataset1" { diff --git a/tools/testfiles/tarray2.h5.xml b/tools/testfiles/tarray2.h5.xml index f851c18..7f89b9b 100644 --- a/tools/testfiles/tarray2.h5.xml +++ b/tools/testfiles/tarray2.h5.xml @@ -1,16 +1,13 @@ -############################# -Expected output for 'h5dump --xml tarray2.h5' -############################# - + - + - + @@ -32,54 +29,10 @@ Expected output for 'h5dump --xml tarray2.h5' - 0 1 2 3 4 - 10 11 12 13 14 - 20 21 22 23 24 - 30 31 32 33 34 - 100 101 102 103 104 - 110 111 112 113 114 - 120 121 122 123 124 - 130 131 132 133 134 - 200 201 202 203 204 - 210 211 212 213 214 - 220 221 222 223 224 - 230 231 232 233 234 - 1000 1001 1002 1003 1004 - 1010 1011 1012 1013 1014 - 1020 1021 1022 1023 1024 - 1030 1031 1032 1033 1034 - 1100 1101 1102 1103 1104 - 1110 1111 1112 1113 1114 - 1120 1121 1122 1123 1124 - 1130 1131 1132 1133 1134 - 1200 1201 1202 1203 1204 - 1210 1211 1212 1213 1214 - 1220 1221 1222 1223 1224 - 1230 1231 1232 1233 1234 - 2000 2001 2002 2003 2004 - 2010 2011 2012 2013 2014 - 2020 2021 2022 2023 2024 - 2030 2031 2032 2033 2034 - 2100 2101 2102 2103 2104 - 2110 2111 2112 2113 2114 - 2120 2121 2122 2123 2124 - 2130 2131 2132 2133 2134 - 2200 2201 2202 2203 2204 - 2210 2211 2212 2213 2214 - 2220 2221 2222 2223 2224 - 2230 2231 2232 2233 2234 - 3000 3001 3002 3003 3004 - 3010 3011 3012 3013 3014 - 3020 3021 3022 3023 3024 - 3030 3031 3032 3033 3034 - 3100 3101 3102 3103 3104 - 3110 3111 3112 3113 3114 - 3120 3121 3122 3123 3124 - 3130 3131 3132 3133 3134 - 3200 3201 3202 3203 3204 - 3210 3211 3212 3213 3214 - 3220 3221 3222 3223 3224 - 3230 3231 3232 3233 3234 + 0 1 2 3 4 10 11 12 13 14 20 21 22 23 24 30 31 32 33 34 100 101 102 103 104 110 111 112 113 114 120 121 122 123 124 130 131 132 133 134 200 201 202 203 204 210 211 212 213 214 220 221 222 223 224 230 231 232 233 234 + 1000 1001 1002 1003 1004 1010 1011 1012 1013 1014 1020 1021 1022 1023 1024 1030 1031 1032 1033 1034 1100 1101 1102 1103 1104 1110 1111 1112 1113 1114 1120 1121 1122 1123 1124 1130 1131 1132 1133 1134 1200 1201 1202 1203 1204 1210 1211 1212 1213 1214 1220 1221 1222 1223 1224 1230 1231 1232 1233 1234 + 2000 2001 2002 2003 2004 2010 2011 2012 2013 2014 2020 2021 2022 2023 2024 2030 2031 2032 2033 2034 2100 2101 2102 2103 2104 2110 2111 2112 2113 2114 2120 2121 2122 2123 2124 2130 2131 2132 2133 2134 2200 2201 2202 2203 2204 2210 2211 2212 2213 2214 2220 2221 2222 2223 2224 2230 2231 2232 2233 2234 + 3000 3001 3002 3003 3004 3010 3011 3012 3013 3014 3020 3021 3022 3023 3024 3030 3031 3032 3033 3034 3100 3101 3102 3103 3104 3110 3111 3112 3113 3114 3120 3121 3122 3123 3124 3130 3131 3132 3133 3134 3200 3201 3202 3203 3204 3210 3211 3212 3213 3214 3220 3221 3222 3223 3224 3230 3231 3232 3233 3234 diff --git a/tools/testfiles/tarray3.ddl b/tools/testfiles/tarray3.ddl index 17ceba6..63f6d32 100644 --- a/tools/testfiles/tarray3.ddl +++ b/tools/testfiles/tarray3.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump tarray3.h5' -############################# HDF5 "tarray3.h5" { GROUP "/" { DATASET "Dataset1" { @@ -12,17 +9,20 @@ GROUP "/" { 20, 21, 22, 30, 31, 32, 40, 41, 42, - 50, 51, 52 ], [ 100, 101, 102, + 50, 51, 52 ], + [ 100, 101, 102, 110, 111, 112, 120, 121, 122, 130, 131, 132, 140, 141, 142, - 150, 151, 152 ], [ 200, 201, 202, + 150, 151, 152 ], + [ 200, 201, 202, 210, 211, 212, 220, 221, 222, 230, 231, 232, 240, 241, 242, - 250, 251, 252 ], [ 300, 301, 302, + 250, 251, 252 ], + [ 300, 301, 302, 310, 311, 312, 320, 321, 322, 330, 331, 332, @@ -33,17 +33,20 @@ GROUP "/" { 1020, 1021, 1022, 1030, 1031, 1032, 1040, 1041, 1042, - 1050, 1051, 1052 ], [ 1100, 1101, 1102, + 1050, 1051, 1052 ], + [ 1100, 1101, 1102, 1110, 1111, 1112, 1120, 1121, 1122, 1130, 1131, 1132, 1140, 1141, 1142, - 1150, 1151, 1152 ], [ 1200, 1201, 1202, + 1150, 1151, 1152 ], + [ 1200, 1201, 1202, 1210, 1211, 1212, 1220, 1221, 1222, 1230, 1231, 1232, 1240, 1241, 1242, - 1250, 1251, 1252 ], [ 1300, 1301, 1302, + 1250, 1251, 1252 ], + [ 1300, 1301, 1302, 1310, 1311, 1312, 1320, 1321, 1322, 1330, 1331, 1332, @@ -54,17 +57,20 @@ GROUP "/" { 2020, 2021, 2022, 2030, 2031, 2032, 2040, 2041, 2042, - 2050, 2051, 2052 ], [ 2100, 2101, 2102, + 2050, 2051, 2052 ], + [ 2100, 2101, 2102, 2110, 2111, 2112, 2120, 2121, 2122, 2130, 2131, 2132, 2140, 2141, 2142, - 2150, 2151, 2152 ], [ 2200, 2201, 2202, + 2150, 2151, 2152 ], + [ 2200, 2201, 2202, 2210, 2211, 2212, 2220, 2221, 2222, 2230, 2231, 2232, 2240, 2241, 2242, - 2250, 2251, 2252 ], [ 2300, 2301, 2302, + 2250, 2251, 2252 ], + [ 2300, 2301, 2302, 2310, 2311, 2312, 2320, 2321, 2322, 2330, 2331, 2332, @@ -75,17 +81,20 @@ GROUP "/" { 3020, 3021, 3022, 3030, 3031, 3032, 3040, 3041, 3042, - 3050, 3051, 3052 ], [ 3100, 3101, 3102, + 3050, 3051, 3052 ], + [ 3100, 3101, 3102, 3110, 3111, 3112, 3120, 3121, 3122, 3130, 3131, 3132, 3140, 3141, 3142, - 3150, 3151, 3152 ], [ 3200, 3201, 3202, + 3150, 3151, 3152 ], + [ 3200, 3201, 3202, 3210, 3211, 3212, 3220, 3221, 3222, 3230, 3231, 3232, 3240, 3241, 3242, - 3250, 3251, 3252 ], [ 3300, 3301, 3302, + 3250, 3251, 3252 ], + [ 3300, 3301, 3302, 3310, 3311, 3312, 3320, 3321, 3322, 3330, 3331, 3332, diff --git a/tools/testfiles/tarray3.h5.xml b/tools/testfiles/tarray3.h5.xml index a620a5e..0b74db8 100644 --- a/tools/testfiles/tarray3.h5.xml +++ b/tools/testfiles/tarray3.h5.xml @@ -1,16 +1,13 @@ -############################# -Expected output for 'h5dump --xml tarray3.h5' -############################# - + - + - + @@ -36,90 +33,22 @@ Expected output for 'h5dump --xml tarray3.h5' - 0 1 2 - 10 11 12 - 20 21 22 - 30 31 32 - 40 41 42 - 50 51 52 100 101 102 - 110 111 112 - 120 121 122 - 130 131 132 - 140 141 142 - 150 151 152 200 201 202 - 210 211 212 - 220 221 222 - 230 231 232 - 240 241 242 - 250 251 252 300 301 302 - 310 311 312 - 320 321 322 - 330 331 332 - 340 341 342 - 350 351 352 - 1000 1001 1002 - 1010 1011 1012 - 1020 1021 1022 - 1030 1031 1032 - 1040 1041 1042 - 1050 1051 1052 1100 1101 1102 - 1110 1111 1112 - 1120 1121 1122 - 1130 1131 1132 - 1140 1141 1142 - 1150 1151 1152 1200 1201 1202 - 1210 1211 1212 - 1220 1221 1222 - 1230 1231 1232 - 1240 1241 1242 - 1250 1251 1252 1300 1301 1302 - 1310 1311 1312 - 1320 1321 1322 - 1330 1331 1332 - 1340 1341 1342 - 1350 1351 1352 - 2000 2001 2002 - 2010 2011 2012 - 2020 2021 2022 - 2030 2031 2032 - 2040 2041 2042 - 2050 2051 2052 2100 2101 2102 - 2110 2111 2112 - 2120 2121 2122 - 2130 2131 2132 - 2140 2141 2142 - 2150 2151 2152 2200 2201 2202 - 2210 2211 2212 - 2220 2221 2222 - 2230 2231 2232 - 2240 2241 2242 - 2250 2251 2252 2300 2301 2302 - 2310 2311 2312 - 2320 2321 2322 - 2330 2331 2332 - 2340 2341 2342 - 2350 2351 2352 - 3000 3001 3002 - 3010 3011 3012 - 3020 3021 3022 - 3030 3031 3032 - 3040 3041 3042 - 3050 3051 3052 3100 3101 3102 - 3110 3111 3112 - 3120 3121 3122 - 3130 3131 3132 - 3140 3141 3142 - 3150 3151 3152 3200 3201 3202 - 3210 3211 3212 - 3220 3221 3222 - 3230 3231 3232 - 3240 3241 3242 - 3250 3251 3252 3300 3301 3302 - 3310 3311 3312 - 3320 3321 3322 - 3330 3331 3332 - 3340 3341 3342 - 3350 3351 3352 + 0 1 2 10 11 12 20 21 22 30 31 32 40 41 42 50 51 52 + 100 101 102 110 111 112 120 121 122 130 131 132 140 141 142 150 151 152 + 200 201 202 210 211 212 220 221 222 230 231 232 240 241 242 250 251 252 + 300 301 302 310 311 312 320 321 322 330 331 332 340 341 342 350 351 352 + 1000 1001 1002 1010 1011 1012 1020 1021 1022 1030 1031 1032 1040 1041 1042 1050 1051 1052 + 1100 1101 1102 1110 1111 1112 1120 1121 1122 1130 1131 1132 1140 1141 1142 1150 1151 1152 + 1200 1201 1202 1210 1211 1212 1220 1221 1222 1230 1231 1232 1240 1241 1242 1250 1251 1252 + 1300 1301 1302 1310 1311 1312 1320 1321 1322 1330 1331 1332 1340 1341 1342 1350 1351 1352 + 2000 2001 2002 2010 2011 2012 2020 2021 2022 2030 2031 2032 2040 2041 2042 2050 2051 2052 + 2100 2101 2102 2110 2111 2112 2120 2121 2122 2130 2131 2132 2140 2141 2142 2150 2151 2152 + 2200 2201 2202 2210 2211 2212 2220 2221 2222 2230 2231 2232 2240 2241 2242 2250 2251 2252 + 2300 2301 2302 2310 2311 2312 2320 2321 2322 2330 2331 2332 2340 2341 2342 2350 2351 2352 + 3000 3001 3002 3010 3011 3012 3020 3021 3022 3030 3031 3032 3040 3041 3042 3050 3051 3052 + 3100 3101 3102 3110 3111 3112 3120 3121 3122 3130 3131 3132 3140 3141 3142 3150 3151 3152 + 3200 3201 3202 3210 3211 3212 3220 3221 3222 3230 3231 3232 3240 3241 3242 3250 3251 3252 + 3300 3301 3302 3310 3311 3312 3320 3321 3322 3330 3331 3332 3340 3341 3342 3350 3351 3352 diff --git a/tools/testfiles/tarray4.ddl b/tools/testfiles/tarray4.ddl index ebc265f..7fb310b 100644 --- a/tools/testfiles/tarray4.ddl +++ b/tools/testfiles/tarray4.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump tarray4.h5' -############################# HDF5 "tarray4.h5" { GROUP "/" { DATASET "Dataset1" { diff --git a/tools/testfiles/tarray5.ddl b/tools/testfiles/tarray5.ddl index 49eda3e..883ee09 100644 --- a/tools/testfiles/tarray5.ddl +++ b/tools/testfiles/tarray5.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump tarray5.h5' -############################# HDF5 "tarray5.h5" { GROUP "/" { DATASET "Dataset1" { @@ -13,52 +10,64 @@ GROUP "/" { (0): [ { 0, [ 0, 1, 2, 3 ] - }, { + }, + { 1, [ 2.5, 3.5, 4.5, 5.5 ] - }, { + }, + { 2, [ 5, 6, 7, 8 ] - }, { + }, + { 3, [ 7.5, 8.5, 9.5, 10.5 ] } ], (1): [ { 10, [ 10, 11, 12, 13 ] - }, { + }, + { 11, [ 12.5, 13.5, 14.5, 15.5 ] - }, { + }, + { 12, [ 15, 16, 17, 18 ] - }, { + }, + { 13, [ 17.5, 18.5, 19.5, 20.5 ] } ], (2): [ { 20, [ 20, 21, 22, 23 ] - }, { + }, + { 21, [ 22.5, 23.5, 24.5, 25.5 ] - }, { + }, + { 22, [ 25, 26, 27, 28 ] - }, { + }, + { 23, [ 27.5, 28.5, 29.5, 30.5 ] } ], (3): [ { 30, [ 30, 31, 32, 33 ] - }, { + }, + { 31, [ 32.5, 33.5, 34.5, 35.5 ] - }, { + }, + { 32, [ 35, 36, 37, 38 ] - }, { + }, + { 33, [ 37.5, 38.5, 39.5, 40.5 ] } ] diff --git a/tools/testfiles/tarray6.ddl b/tools/testfiles/tarray6.ddl index b2f95ab..5c49b0f 100644 --- a/tools/testfiles/tarray6.ddl +++ b/tools/testfiles/tarray6.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump tarray6.h5' -############################# HDF5 "tarray6.h5" { GROUP "/" { DATASET "Dataset1" { diff --git a/tools/testfiles/tarray6.h5 b/tools/testfiles/tarray6.h5 index b4af19b..7eb078c 100644 Binary files a/tools/testfiles/tarray6.h5 and b/tools/testfiles/tarray6.h5 differ diff --git a/tools/testfiles/tarray6.h5.xml b/tools/testfiles/tarray6.h5.xml index 5be8371..628a342 100644 --- a/tools/testfiles/tarray6.h5.xml +++ b/tools/testfiles/tarray6.h5.xml @@ -1,16 +1,13 @@ -############################# -Expected output for 'h5dump --xml tarray6.h5' -############################# - + - + - + @@ -34,10 +31,10 @@ Expected output for 'h5dump --xml tarray6.h5' - 0 10 11 20 21 22 30 31 32 33 - 100 101 110 111 112 120 121 122 123 130 131 132 133 134 - 200 201 202 210 211 212 213 220 221 222 223 224 230 231 232 233 234 235 - 300 301 302 303 310 311 312 313 314 320 321 322 323 324 325 330 331 332 333 334 335 336 + 0 10 11 20 21 22 30 31 32 33 + 100 101 110 111 112 120 121 122 123 130 131 132 133 134 + 200 201 202 210 211 212 213 220 221 222 223 224 230 231 232 233 234 235 + 300 301 302 303 310 311 312 313 314 320 321 322 323 324 325 330 331 332 333 334 335 336 diff --git a/tools/testfiles/tarray7.ddl b/tools/testfiles/tarray7.ddl index a205875..229d719 100644 --- a/tools/testfiles/tarray7.ddl +++ b/tools/testfiles/tarray7.ddl @@ -1,16 +1,25 @@ -############################# -Expected output for 'h5dump tarray7.h5' -############################# HDF5 "tarray7.h5" { GROUP "/" { DATASET "Dataset1" { DATATYPE H5T_ARRAY { [4] H5T_VLEN { H5T_ARRAY { [4] H5T_STD_U32LE }} } DATASPACE SIMPLE { ( 4 ) / ( 4 ) } DATA { - (0): [ ([ 0, 1, 2, 3 ]), ([ 100, 101, 102, 103 ], [ 110, 111, 112, 113 ]), ([ 200, 201, 202, 203 ], [ 210, 211, 212, 213 ], [ 220, 221, 222, 223 ]), ([ 300, 301, 302, 303 ], [ 310, 311, 312, 313 ], [ 320, 321, 322, 323 ], [ 330, 331, 332, 333 ]) ], - (1): [ ([ 1000, 1001, 1002, 1003 ], [ 1010, 1011, 1012, 1013 ]), ([ 1100, 1101, 1102, 1103 ], [ 1110, 1111, 1112, 1113 ], [ 1120, 1121, 1122, 1123 ]), ([ 1200, 1201, 1202, 1203 ], [ 1210, 1211, 1212, 1213 ], [ 1220, 1221, 1222, 1223 ], [ 1230, 1231, 1232, 1233 ]), ([ 1300, 1301, 1302, 1303 ], [ 1310, 1311, 1312, 1313 ], [ 1320, 1321, 1322, 1323 ], [ 1330, 1331, 1332, 1333 ], [ 1340, 1341, 1342, 1343 ]) ], - (2): [ ([ 2000, 2001, 2002, 2003 ], [ 2010, 2011, 2012, 2013 ], [ 2020, 2021, 2022, 2023 ]), ([ 2100, 2101, 2102, 2103 ], [ 2110, 2111, 2112, 2113 ], [ 2120, 2121, 2122, 2123 ], [ 2130, 2131, 2132, 2133 ]), ([ 2200, 2201, 2202, 2203 ], [ 2210, 2211, 2212, 2213 ], [ 2220, 2221, 2222, 2223 ], [ 2230, 2231, 2232, 2233 ], [ 2240, 2241, 2242, 2243 ]), ([ 2300, 2301, 2302, 2303 ], [ 2310, 2311, 2312, 2313 ], [ 2320, 2321, 2322, 2323 ], [ 2330, 2331, 2332, 2333 ], [ 2340, 2341, 2342, 2343 ], [ 2350, 2351, 2352, 2353 ]) ], - (3): [ ([ 3000, 3001, 3002, 3003 ], [ 3010, 3011, 3012, 3013 ], [ 3020, 3021, 3022, 3023 ], [ 3030, 3031, 3032, 3033 ]), ([ 3100, 3101, 3102, 3103 ], [ 3110, 3111, 3112, 3113 ], [ 3120, 3121, 3122, 3123 ], [ 3130, 3131, 3132, 3133 ], [ 3140, 3141, 3142, 3143 ]), ([ 3200, 3201, 3202, 3203 ], [ 3210, 3211, 3212, 3213 ], [ 3220, 3221, 3222, 3223 ], [ 3230, 3231, 3232, 3233 ], [ 3240, 3241, 3242, 3243 ], [ 3250, 3251, 3252, 3253 ]), ([ 3300, 3301, 3302, 3303 ], [ 3310, 3311, 3312, 3313 ], [ 3320, 3321, 3322, 3323 ], [ 3330, 3331, 3332, 3333 ], [ 3340, 3341, 3342, 3343 ], [ 3350, 3351, 3352, 3353 ], [ 3360, 3361, 3362, 3363 ]) ] + (0): [ ([ 0, 1, 2, 3 ]), + ([ 100, 101, 102, 103 ], [ 110, 111, 112, 113 ]), + ([ 200, 201, 202, 203 ], [ 210, 211, 212, 213 ], [ 220, 221, 222, 223 ]), + ([ 300, 301, 302, 303 ], [ 310, 311, 312, 313 ], [ 320, 321, 322, 323 ], [ 330, 331, 332, 333 ]) ], + (1): [ ([ 1000, 1001, 1002, 1003 ], [ 1010, 1011, 1012, 1013 ]), + ([ 1100, 1101, 1102, 1103 ], [ 1110, 1111, 1112, 1113 ], [ 1120, 1121, 1122, 1123 ]), + ([ 1200, 1201, 1202, 1203 ], [ 1210, 1211, 1212, 1213 ], [ 1220, 1221, 1222, 1223 ], [ 1230, 1231, 1232, 1233 ]), + ([ 1300, 1301, 1302, 1303 ], [ 1310, 1311, 1312, 1313 ], [ 1320, 1321, 1322, 1323 ], [ 1330, 1331, 1332, 1333 ], [ 1340, 1341, 1342, 1343 ]) ], + (2): [ ([ 2000, 2001, 2002, 2003 ], [ 2010, 2011, 2012, 2013 ], [ 2020, 2021, 2022, 2023 ]), + ([ 2100, 2101, 2102, 2103 ], [ 2110, 2111, 2112, 2113 ], [ 2120, 2121, 2122, 2123 ], [ 2130, 2131, 2132, 2133 ]), + ([ 2200, 2201, 2202, 2203 ], [ 2210, 2211, 2212, 2213 ], [ 2220, 2221, 2222, 2223 ], [ 2230, 2231, 2232, 2233 ], [ 2240, 2241, 2242, 2243 ]), + ([ 2300, 2301, 2302, 2303 ], [ 2310, 2311, 2312, 2313 ], [ 2320, 2321, 2322, 2323 ], [ 2330, 2331, 2332, 2333 ], [ 2340, 2341, 2342, 2343 ], [ 2350, 2351, 2352, 2353 ]) ], + (3): [ ([ 3000, 3001, 3002, 3003 ], [ 3010, 3011, 3012, 3013 ], [ 3020, 3021, 3022, 3023 ], [ 3030, 3031, 3032, 3033 ]), + ([ 3100, 3101, 3102, 3103 ], [ 3110, 3111, 3112, 3113 ], [ 3120, 3121, 3122, 3123 ], [ 3130, 3131, 3132, 3133 ], [ 3140, 3141, 3142, 3143 ]), + ([ 3200, 3201, 3202, 3203 ], [ 3210, 3211, 3212, 3213 ], [ 3220, 3221, 3222, 3223 ], [ 3230, 3231, 3232, 3233 ], [ 3240, 3241, 3242, 3243 ], [ 3250, 3251, 3252, 3253 ]), + ([ 3300, 3301, 3302, 3303 ], [ 3310, 3311, 3312, 3313 ], [ 3320, 3321, 3322, 3323 ], [ 3330, 3331, 3332, 3333 ], [ 3340, 3341, 3342, 3343 ], [ 3350, 3351, 3352, 3353 ], [ 3360, 3361, 3362, 3363 ]) ] } } } diff --git a/tools/testfiles/tarray7.h5.xml b/tools/testfiles/tarray7.h5.xml index 4fb02c4..dbf5ec5 100644 --- a/tools/testfiles/tarray7.h5.xml +++ b/tools/testfiles/tarray7.h5.xml @@ -1,16 +1,13 @@ -############################# -Expected output for 'h5dump --xml tarray7.h5' -############################# - + - + - + @@ -39,10 +36,22 @@ Expected output for 'h5dump --xml tarray7.h5' - 0 1 2 3 100 101 102 103 110 111 112 113 200 201 202 203 210 211 212 213 220 221 222 223 300 301 302 303 310 311 312 313 320 321 322 323 330 331 332 333 - 1000 1001 1002 1003 1010 1011 1012 1013 1100 1101 1102 1103 1110 1111 1112 1113 1120 1121 1122 1123 1200 1201 1202 1203 1210 1211 1212 1213 1220 1221 1222 1223 1230 1231 1232 1233 1300 1301 1302 1303 1310 1311 1312 1313 1320 1321 1322 1323 1330 1331 1332 1333 1340 1341 1342 1343 - 2000 2001 2002 2003 2010 2011 2012 2013 2020 2021 2022 2023 2100 2101 2102 2103 2110 2111 2112 2113 2120 2121 2122 2123 2130 2131 2132 2133 2200 2201 2202 2203 2210 2211 2212 2213 2220 2221 2222 2223 2230 2231 2232 2233 2240 2241 2242 2243 2300 2301 2302 2303 2310 2311 2312 2313 2320 2321 2322 2323 2330 2331 2332 2333 2340 2341 2342 2343 2350 2351 2352 2353 - 3000 3001 3002 3003 3010 3011 3012 3013 3020 3021 3022 3023 3030 3031 3032 3033 3100 3101 3102 3103 3110 3111 3112 3113 3120 3121 3122 3123 3130 3131 3132 3133 3140 3141 3142 3143 3200 3201 3202 3203 3210 3211 3212 3213 3220 3221 3222 3223 3230 3231 3232 3233 3240 3241 3242 3243 3250 3251 3252 3253 3300 3301 3302 3303 3310 3311 3312 3313 3320 3321 3322 3323 3330 3331 3332 3333 3340 3341 3342 3343 3350 3351 3352 3353 3360 3361 3362 3363 + 0 1 2 3 + 100 101 102 103 110 111 112 113 + 200 201 202 203 210 211 212 213 220 221 222 223 + 300 301 302 303 310 311 312 313 320 321 322 323 330 331 332 333 + 1000 1001 1002 1003 1010 1011 1012 1013 + 1100 1101 1102 1103 1110 1111 1112 1113 1120 1121 1122 1123 + 1200 1201 1202 1203 1210 1211 1212 1213 1220 1221 1222 1223 1230 1231 1232 1233 + 1300 1301 1302 1303 1310 1311 1312 1313 1320 1321 1322 1323 1330 1331 1332 1333 1340 1341 1342 1343 + 2000 2001 2002 2003 2010 2011 2012 2013 2020 2021 2022 2023 + 2100 2101 2102 2103 2110 2111 2112 2113 2120 2121 2122 2123 2130 2131 2132 2133 + 2200 2201 2202 2203 2210 2211 2212 2213 2220 2221 2222 2223 2230 2231 2232 2233 2240 2241 2242 2243 + 2300 2301 2302 2303 2310 2311 2312 2313 2320 2321 2322 2323 2330 2331 2332 2333 2340 2341 2342 2343 2350 2351 2352 2353 + 3000 3001 3002 3003 3010 3011 3012 3013 3020 3021 3022 3023 3030 3031 3032 3033 + 3100 3101 3102 3103 3110 3111 3112 3113 3120 3121 3122 3123 3130 3131 3132 3133 3140 3141 3142 3143 + 3200 3201 3202 3203 3210 3211 3212 3213 3220 3221 3222 3223 3230 3231 3232 3233 3240 3241 3242 3243 3250 3251 3252 3253 + 3300 3301 3302 3303 3310 3311 3312 3313 3320 3321 3322 3323 3330 3331 3332 3333 3340 3341 3342 3343 3350 3351 3352 3353 3360 3361 3362 3363 diff --git a/tools/testfiles/tarray8.ddl b/tools/testfiles/tarray8.ddl index cf9ebc3..f482901 100644 --- a/tools/testfiles/tarray8.ddl +++ b/tools/testfiles/tarray8.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump tarray8.h5' -############################# HDF5 "tarray8.h5" { GROUP "/" { DATASET "DS1" { diff --git a/tools/testfiles/tattr-1.ddl b/tools/testfiles/tattr-1.ddl index 2337fa3..b58731b 100644 --- a/tools/testfiles/tattr-1.ddl +++ b/tools/testfiles/tattr-1.ddl @@ -1,9 +1,6 @@ -############################# -Expected output for 'h5dump tattr.h5' -############################# HDF5 "tattr.h5" { GROUP "/" { - ATTRIBUTE "attr1" { + ATTRIBUTE "/attr1" { DATATYPE H5T_STD_I8BE DATASPACE SIMPLE { ( 24 ) / ( 24 ) } DATA { @@ -34,11 +31,11 @@ GROUP "/" { } ATTRIBUTE "attr5" { DATATYPE H5T_STRING { - STRSIZE 17; - STRPAD H5T_STR_NULLTERM; - CSET H5T_CSET_ASCII; - CTYPE H5T_C_S1; - } + STRSIZE 17; + STRPAD H5T_STR_NULLTERM; + CSET H5T_CSET_ASCII; + CTYPE H5T_C_S1; + } DATASPACE SCALAR DATA { (0): "string attribute" diff --git a/tools/testfiles/tattr-2.ddl b/tools/testfiles/tattr-2.ddl index 195b9ab..328b54f 100644 --- a/tools/testfiles/tattr-2.ddl +++ b/tools/testfiles/tattr-2.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump -a /attr1 --attribute /attr4 --attribute=/attr5 tattr.h5' -############################# HDF5 "tattr.h5" { ATTRIBUTE "/attr1" { DATATYPE H5T_STD_I8BE @@ -10,20 +7,20 @@ ATTRIBUTE "/attr1" { (14): 111, 111, 116, 32, 103, 114, 111, 117, 112, 0 } } -ATTRIBUTE "/attr4" { +ATTRIBUTE "attr4" { DATATYPE H5T_STD_I32BE DATASPACE SCALAR DATA { (0): 100 } } -ATTRIBUTE "/attr5" { +ATTRIBUTE "attr5" { DATATYPE H5T_STRING { - STRSIZE 17; - STRPAD H5T_STR_NULLTERM; - CSET H5T_CSET_ASCII; - CTYPE H5T_C_S1; - } + STRSIZE 17; + STRPAD H5T_STR_NULLTERM; + CSET H5T_CSET_ASCII; + CTYPE H5T_C_S1; + } DATASPACE SCALAR DATA { (0): "string attribute" diff --git a/tools/testfiles/tattr-3.ddl b/tools/testfiles/tattr-3.ddl index 98896eb..a19f69a 100644 --- a/tools/testfiles/tattr-3.ddl +++ b/tools/testfiles/tattr-3.ddl @@ -1,12 +1,16 @@ -############################# -Expected output for 'h5dump --header -a /attr2 --attribute=/attr tattr.h5' -############################# HDF5 "tattr.h5" { -ATTRIBUTE "/attr2" { +ATTRIBUTE "attr2" { DATATYPE H5T_STD_I32BE DATASPACE SIMPLE { ( 10 ) / ( 10 ) } } -ATTRIBUTE "/attr" { - } +ATTRIBUTE "attr" { } -h5dump error: unable to open attribute "/" +} +HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): + #000: (file name) line (number) in H5Aopen(): unable to load attribute info from object header for attribute: 'attr' + major: Attribute + minor: Unable to initialize object + #001: (file name) line (number) in H5O_attr_open_by_name(): can't locate attribute: 'attr' + major: Attribute + minor: Object not found +h5dump error: unable to open attribute "attr" diff --git a/tools/testfiles/tattr-4_be.ddl b/tools/testfiles/tattr-4_be.ddl new file mode 100644 index 0000000..8b8076e --- /dev/null +++ b/tools/testfiles/tattr-4_be.ddl @@ -0,0 +1,119 @@ +HDF5 "tattr4_be.h5" { +GROUP "/" { + ATTRIBUTE "attr0" { + DATATYPE H5T_STRING { + STRSIZE 4; + STRPAD H5T_STR_NULLTERM; + CSET H5T_CSET_ASCII; + CTYPE H5T_C_S1; + } + DATASPACE SCALAR + DATA { + (0): "1234" + } + } + ATTRIBUTE "attr1" { + DATATYPE H5T_STRING { + STRSIZE 4; + STRPAD H5T_STR_NULLTERM; + CSET H5T_CSET_ASCII; + CTYPE H5T_C_S1; + } + DATASPACE SCALAR + DATA { + (0): "1234" + } + } + ATTRIBUTE "attr2" { + DATATYPE H5T_STRING { + STRSIZE 4; + STRPAD H5T_STR_NULLTERM; + CSET H5T_CSET_ASCII; + CTYPE H5T_C_S1; + } + DATASPACE SCALAR + DATA { + (0): "1234" + } + } + ATTRIBUTE "attr3" { + DATATYPE H5T_STRING { + STRSIZE 4; + STRPAD H5T_STR_NULLTERM; + CSET H5T_CSET_ASCII; + CTYPE H5T_C_S1; + } + DATASPACE SCALAR + DATA { + (0): "1234" + } + } + ATTRIBUTE "attr4" { + DATATYPE H5T_STRING { + STRSIZE 4; + STRPAD H5T_STR_NULLTERM; + CSET H5T_CSET_ASCII; + CTYPE H5T_C_S1; + } + DATASPACE SCALAR + DATA { + (0): "1234" + } + } + ATTRIBUTE "attr5" { + DATATYPE H5T_STRING { + STRSIZE 4; + STRPAD H5T_STR_NULLTERM; + CSET H5T_CSET_ASCII; + CTYPE H5T_C_S1; + } + DATASPACE SCALAR + DATA { + (0): "1234" + } + } + ATTRIBUTE "attr6" { + DATATYPE H5T_STRING { + STRSIZE 4; + STRPAD H5T_STR_NULLTERM; + CSET H5T_CSET_ASCII; + CTYPE H5T_C_S1; + } + DATASPACE SCALAR + DATA { + (0): "1234" + } + } + ATTRIBUTE "attr7" { + DATATYPE H5T_STRING { + STRSIZE 4; + STRPAD H5T_STR_NULLTERM; + CSET H5T_CSET_ASCII; + CTYPE H5T_C_S1; + } + DATASPACE SCALAR + DATA { + (0): "1234" + } + } + ATTRIBUTE "attr8" { + DATATYPE H5T_STRING { + STRSIZE 4; + STRPAD H5T_STR_NULLTERM; + CSET H5T_CSET_ASCII; + CTYPE H5T_C_S1; + } + DATASPACE SCALAR + DATA { + (0): "1234" + } + } + DATASET "data" { + DATATYPE H5T_IEEE_F32BE + DATASPACE SIMPLE { ( 1 ) / ( 1 ) } + DATA { + (0): 0 + } + } +} +} diff --git a/tools/testfiles/tattr.h5 b/tools/testfiles/tattr.h5 index fd14b58..d61def5 100644 Binary files a/tools/testfiles/tattr.h5 and b/tools/testfiles/tattr.h5 differ diff --git a/tools/testfiles/tattr.h5.xml b/tools/testfiles/tattr.h5.xml index bfde477..fceea99 100644 --- a/tools/testfiles/tattr.h5.xml +++ b/tools/testfiles/tattr.h5.xml @@ -1,10 +1,7 @@ -############################# -Expected output for 'h5dump --xml tattr.h5' -############################# - + - + @@ -17,8 +14,30 @@ Expected output for 'h5dump --xml tattr.h5' - 97 116 116 114 105 98 117 116 101 32 111 102 32 114 111 111 116 32 103 - 114 111 117 112 0 + 97 + 116 + 116 + 114 + 105 + 98 + 117 + 116 + 101 + 32 + 111 + 102 + 32 + 114 + 111 + 111 + 116 + 32 + 103 + 114 + 111 + 117 + 112 + 0 @@ -35,7 +54,16 @@ Expected output for 'h5dump --xml tattr.h5' - 1 2 3 4 5 6 7 8 9 10 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 @@ -52,7 +80,16 @@ Expected output for 'h5dump --xml tattr.h5' - 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 + 0 + 0.1 + 0.2 + 0.3 + 0.4 + 0.5 + 0.6 + 0.7 + 0.8 + 0.9 diff --git a/tools/testfiles/tattr2.ls b/tools/testfiles/tattr2.ls index 0448868..3c87360 100644 --- a/tools/testfiles/tattr2.ls +++ b/tools/testfiles/tattr2.ls @@ -1,37 +1,54 @@ -############################# - output for 'h5ls -w80 -v -S tattr2.h5' -############################# Opened "tattr2.h5" with sec2 driver. dset Dataset {2/2} - Attribute: array {2} + Attribute: array {2} Type: [3] 32-bit little-endian integer Data: [1,2,3], [4,5,6] - Attribute: array2D {3, 2} + Attribute: array2D {3, 2} Type: [3] 32-bit little-endian integer Data: - (0,0) [1,2,3], [4,5,6], [7,8,9], [10,11,12], [13,14,15], [16,17,18] - Attribute: array3D {4, 3, 2} + (0,0) [1,2,3], [4,5,6], + (1,0) [7,8,9], [10,11,12], + (2,0) [13,14,15], [16,17,18] + Attribute: array3D {4, 3, 2} Type: [3] 32-bit little-endian integer Data: - (0,0,0) [1,2,3], [4,5,6], [7,8,9], [10,11,12], [13,14,15], - (0,2,1) [16,17,18], [19,20,21], [22,23,24], [25,26,27], [28,29,30], - (1,2,0) [31,32,33], [34,35,36], [37,38,39], [40,41,42], [43,44,45], - (2,1,1) [46,47,48], [49,50,51], [52,53,54], [55,56,57], [58,59,60], - (3,1,0) [61,62,63], [64,65,66], [67,68,69], [70,71,72] - Attribute: bitfield {2} + (0,0,0) [1,2,3], [4,5,6], + (0,1,0) [7,8,9], [10,11,12], + (0,2,0) [13,14,15], [16,17,18], + (1,0,0) [19,20,21], [22,23,24], + (1,1,0) [25,26,27], [28,29,30], + (1,2,0) [31,32,33], [34,35,36], + (2,0,0) [37,38,39], [40,41,42], + (2,1,0) [43,44,45], [46,47,48], + (2,2,0) [49,50,51], [52,53,54], + (3,0,0) [55,56,57], [58,59,60], + (3,1,0) [61,62,63], [64,65,66], + (3,2,0) [67,68,69], [70,71,72] + Attribute: bitfield {2} Type: 8-bit bitfield Data: 0x01, 0x02 Attribute: bitfield2D {3, 2} Type: 8-bit bitfield Data: - (0,0) 0x01, 0x02, 0x03, 0x04, 0x05, 0x06 + (0,0) 0x01, 0x02, + (1,0) 0x03, 0x04, + (2,0) 0x05, 0x06 Attribute: bitfield3D {4, 3, 2} Type: 8-bit bitfield Data: - (0,0,0) 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, - (1,2,0) 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, - (3,1,0) 0x15, 0x16, 0x17, 0x18 - Attribute: compound {2} + (0,0,0) 0x01, 0x02, + (0,1,0) 0x03, 0x04, + (0,2,0) 0x05, 0x06, + (1,0,0) 0x07, 0x08, + (1,1,0) 0x09, 0x0a, + (1,2,0) 0x0b, 0x0c, + (2,0,0) 0x0d, 0x0e, + (2,1,0) 0x0f, 0x10, + (2,2,0) 0x11, 0x12, + (3,0,0) 0x13, 0x14, + (3,1,0) 0x15, 0x16, + (3,2,0) 0x17, 0x18 + Attribute: compound {2} Type: struct { "a" +0 8-bit integer "b" +4 IEEE 64-bit little-endian float @@ -43,160 +60,264 @@ dset Dataset {2/2} "b" +4 IEEE 64-bit little-endian float } 12 bytes Data: - (0,0) {1, 2}, {3, 4}, {5, 6}, {7, 8}, {9, 10}, {11, 12} + (0,0) {1, 2}, {3, 4}, + (1,0) {5, 6}, {7, 8}, + (2,0) {9, 10}, {11, 12} Attribute: compound3D {4, 3, 2} Type: struct { "a" +0 8-bit integer "b" +4 IEEE 64-bit little-endian float } 12 bytes Data: - (0,0,0) {1, 2}, {3, 4}, {5, 6}, {7, 8}, {9, 10}, {11, 12}, {13, - (1,0,0) 14}, {15, 16}, {17, 18}, {19, 20}, {21, 22}, {23, 24}, - (2,0,0) {25, 26}, {27, 28}, {29, 30}, {31, 32}, {33, 34}, {35, 36}, - (3,0,0) {37, 38}, {39, 40}, {41, 42}, {43, 44}, {45, 46}, {47, 48} - Attribute: enum {2} + (0,0,0) {1, 2}, {3, 4}, + (0,1,0) {5, 6}, {7, 8}, + (0,2,0) {9, 10}, {11, 12}, + (1,0,0) {13, 14}, {15, 16}, + (1,1,0) {17, 18}, {19, 20}, + (1,2,0) {21, 22}, {23, 24}, + (2,0,0) {25, 26}, {27, 28}, + (2,1,0) {29, 30}, {31, 32}, + (2,2,0) {33, 34}, {35, 36}, + (3,0,0) {37, 38}, {39, 40}, + (3,1,0) {41, 42}, {43, 44}, + (3,2,0) {45, 46}, {47, 48} + Attribute: enum {2} Type: enum 32-bit little-endian integer { RED = 0 GREEN = 1 } Data: RED, RED - Attribute: enum2D {3, 2} + Attribute: enum2D {3, 2} Type: enum 32-bit little-endian integer { RED = 0 GREEN = 1 } Data: - (0,0) RED, RED, RED, RED, RED, RED - Attribute: enum3D {4, 3, 2} + (0,0) RED, RED, + (1,0) RED, RED, + (2,0) RED, RED + Attribute: enum3D {4, 3, 2} Type: enum 32-bit little-endian integer { RED = 0 GREEN = 1 } Data: - (0,0,0) RED, RED, RED, RED, RED, RED, RED, RED, RED, RED, RED, RED, - (2,0,0) RED, RED, RED, RED, RED, RED, RED, RED, RED, RED, RED, RED - Attribute: float {2} + (0,0,0) RED, RED, + (0,1,0) RED, RED, + (0,2,0) RED, RED, + (1,0,0) RED, RED, + (1,1,0) RED, RED, + (1,2,0) RED, RED, + (2,0,0) RED, RED, + (2,1,0) RED, RED, + (2,2,0) RED, RED, + (3,0,0) RED, RED, + (3,1,0) RED, RED, + (3,2,0) RED, RED + Attribute: float {2} Type: IEEE 32-bit little-endian float Data: 1, 2 - Attribute: float2D {3, 2} + Attribute: float2D {3, 2} Type: IEEE 32-bit little-endian float Data: - (0,0) 1, 2, 3, 4, 5, 6 - Attribute: float3D {4, 3, 2} + (0,0) 1, 2, + (1,0) 3, 4, + (2,0) 5, 6 + Attribute: float3D {4, 3, 2} Type: IEEE 32-bit little-endian float Data: - (0,0,0) 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, - (2,2,1) 18, 19, 20, 21, 22, 23, 24 - Attribute: integer {2} + (0,0,0) 1, 2, + (0,1,0) 3, 4, + (0,2,0) 5, 6, + (1,0,0) 7, 8, + (1,1,0) 9, 10, + (1,2,0) 11, 12, + (2,0,0) 13, 14, + (2,1,0) 15, 16, + (2,2,0) 17, 18, + (3,0,0) 19, 20, + (3,1,0) 21, 22, + (3,2,0) 23, 24 + Attribute: integer {2} Type: 32-bit little-endian integer Data: 1, 2 Attribute: integer2D {3, 2} Type: 32-bit little-endian integer Data: - (0,0) 1, 2, 3, 4, 5, 6 + (0,0) 1, 2, + (1,0) 3, 4, + (2,0) 5, 6 Attribute: integer3D {4, 3, 2} Type: 32-bit little-endian integer Data: - (0,0,0) 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, - (2,2,1) 18, 19, 20, 21, 22, 23, 24 - Attribute: opaque {2} + (0,0,0) 1, 2, + (0,1,0) 3, 4, + (0,2,0) 5, 6, + (1,0,0) 7, 8, + (1,1,0) 9, 10, + (1,2,0) 11, 12, + (2,0,0) 13, 14, + (2,1,0) 15, 16, + (2,2,0) 17, 18, + (3,0,0) 19, 20, + (3,1,0) 21, 22, + (3,2,0) 23, 24 + Attribute: opaque {2} Type: 1-byte opaque type (tag = "1-byte opaque type") Data: 0x01, 0x02 - Attribute: opaque2D {3, 2} + Attribute: opaque2D {3, 2} Type: 1-byte opaque type (tag = "1-byte opaque type") Data: - (0,0) 0x01, 0x02, 0x03, 0x04, 0x05, 0x06 - Attribute: opaque3D {4, 3, 2} + (0,0) 0x01, 0x02, + (1,0) 0x03, 0x04, + (2,0) 0x05, 0x06 + Attribute: opaque3D {4, 3, 2} Type: 1-byte opaque type (tag = "1-byte opaque type") Data: - (0,0,0) 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, - (1,2,0) 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, - (3,1,0) 0x15, 0x16, 0x17, 0x18 + (0,0,0) 0x01, 0x02, + (0,1,0) 0x03, 0x04, + (0,2,0) 0x05, 0x06, + (1,0,0) 0x07, 0x08, + (1,1,0) 0x09, 0x0a, + (1,2,0) 0x0b, 0x0c, + (2,0,0) 0x0d, 0x0e, + (2,1,0) 0x0f, 0x10, + (2,2,0) 0x11, 0x12, + (3,0,0) 0x13, 0x14, + (3,1,0) 0x15, 0x16, + (3,2,0) 0x17, 0x18 Attribute: reference {2} Type: object reference Data: DATASET-1:976, DATASET-1:976 Attribute: reference2D {3, 2} Type: object reference Data: - (0,0) DATASET-1:976, DATASET-1:976, DATASET-1:976, DATASET-1:976, + (0,0) DATASET-1:976, DATASET-1:976, + (1,0) DATASET-1:976, DATASET-1:976, (2,0) DATASET-1:976, DATASET-1:976 Attribute: reference3D {4, 3, 2} Type: object reference Data: - (0,0,0) DATASET-1:976, DATASET-1:976, DATASET-1:976, DATASET-1:976, - (0,2,0) DATASET-1:976, DATASET-1:976, DATASET-1:976, DATASET-1:976, - (1,1,0) DATASET-1:976, DATASET-1:976, DATASET-1:976, DATASET-1:976, - (2,0,0) DATASET-1:976, DATASET-1:976, DATASET-1:976, DATASET-1:976, - (2,2,0) DATASET-1:976, DATASET-1:976, DATASET-1:976, DATASET-1:976, - (3,1,0) DATASET-1:976, DATASET-1:976, DATASET-1:976, DATASET-1:976 - Attribute: string {2} + (0,0,0) DATASET-1:976, DATASET-1:976, + (0,1,0) DATASET-1:976, DATASET-1:976, + (0,2,0) DATASET-1:976, DATASET-1:976, + (1,0,0) DATASET-1:976, DATASET-1:976, + (1,1,0) DATASET-1:976, DATASET-1:976, + (1,2,0) DATASET-1:976, DATASET-1:976, + (2,0,0) DATASET-1:976, DATASET-1:976, + (2,1,0) DATASET-1:976, DATASET-1:976, + (2,2,0) DATASET-1:976, DATASET-1:976, + (3,0,0) DATASET-1:976, DATASET-1:976, + (3,1,0) DATASET-1:976, DATASET-1:976, + (3,2,0) DATASET-1:976, DATASET-1:976 + Attribute: string {2} Type: 2-byte null-terminated ASCII string Data: "ab", "de" - Attribute: string2D {3, 2} + Attribute: string2D {3, 2} Type: 2-byte null-terminated ASCII string Data: - (0,0) "ab", "cd", "ef", "gh", "ij", "kl" - Attribute: string3D {4, 3, 2} + (0,0) "ab", "cd", + (1,0) "ef", "gh", + (2,0) "ij", "kl" + Attribute: string3D {4, 3, 2} Type: 2-byte null-terminated ASCII string Data: - (0,0,0) "ab", "cd", "ef", "gh", "ij", "kl", "mn", "pq", "rs", "tu", - (1,2,0) "vw", "xz", "AB", "CD", "EF", "GH", "IJ", "KL", "MN", "PQ", - (3,1,0) "RS", "TU", "VW", "XZ" - Attribute: vlen {2} + (0,0,0) "ab", "cd", + (0,1,0) "ef", "gh", + (0,2,0) "ij", "kl", + (1,0,0) "mn", "pq", + (1,1,0) "rs", "tu", + (1,2,0) "vw", "xz", + (2,0,0) "AB", "CD", + (2,1,0) "EF", "GH", + (2,2,0) "IJ", "KL", + (3,0,0) "MN", "PQ", + (3,1,0) "RS", "TU", + (3,2,0) "VW", "XZ" + Attribute: vlen {2} Type: variable length of 32-bit little-endian integer Data: (1), (2,3) - Attribute: vlen2D {3, 2} + Attribute: vlen2D {3, 2} Type: variable length of 32-bit little-endian integer Data: - (0,0) (0), (1), (2,3), (4,5), (6,7,8), (9,10,11) - Attribute: vlen3D {4, 3, 2} + (0,0) (0), (1), + (1,0) (2,3), (4,5), + (2,0) (6,7,8), (9,10,11) + Attribute: vlen3D {4, 3, 2} Type: variable length of 32-bit little-endian integer Data: - (0,0,0) (0), (1), (2), (3), (4), (5), (6,7), (8,9), (10,11), - (1,1,1) (12,13), (14,15), (16,17), (18,19,20), (21,22,23), - (2,1,0) (24,25,26), (27,28,29), (30,31,32), (33,34,35), - (3,0,0) (36,37,38,39), (40,41,42,43), (44,45,46,47), (48,49,50,51), + (0,0,0) (0), (1), + (0,1,0) (2), (3), + (0,2,0) (4), (5), + (1,0,0) (6,7), (8,9), + (1,1,0) (10,11), (12,13), + (1,2,0) (14,15), (16,17), + (2,0,0) (18,19,20), (21,22,23), + (2,1,0) (24,25,26), (27,28,29), + (2,2,0) (30,31,32), (33,34,35), + (3,0,0) (36,37,38,39), (40,41,42,43), + (3,1,0) (44,45,46,47), (48,49,50,51), (3,2,0) (52,53,54,55), (56,57,58,59) Location: 1:976 Links: 1 Storage: 8 logical bytes, 0 allocated bytes Type: 32-bit little-endian integer g1 Group - Attribute: array {2} + Attribute: array {2} Type: [3] 32-bit little-endian integer Data: [1,2,3], [4,5,6] - Attribute: array2D {3, 2} + Attribute: array2D {3, 2} Type: [3] 32-bit little-endian integer Data: - (0,0) [1,2,3], [4,5,6], [7,8,9], [10,11,12], [13,14,15], [16,17,18] - Attribute: array3D {4, 3, 2} + (0,0) [1,2,3], [4,5,6], + (1,0) [7,8,9], [10,11,12], + (2,0) [13,14,15], [16,17,18] + Attribute: array3D {4, 3, 2} Type: [3] 32-bit little-endian integer Data: - (0,0,0) [1,2,3], [4,5,6], [7,8,9], [10,11,12], [13,14,15], - (0,2,1) [16,17,18], [19,20,21], [22,23,24], [25,26,27], [28,29,30], - (1,2,0) [31,32,33], [34,35,36], [37,38,39], [40,41,42], [43,44,45], - (2,1,1) [46,47,48], [49,50,51], [52,53,54], [55,56,57], [58,59,60], - (3,1,0) [61,62,63], [64,65,66], [67,68,69], [70,71,72] - Attribute: bitfield {2} + (0,0,0) [1,2,3], [4,5,6], + (0,1,0) [7,8,9], [10,11,12], + (0,2,0) [13,14,15], [16,17,18], + (1,0,0) [19,20,21], [22,23,24], + (1,1,0) [25,26,27], [28,29,30], + (1,2,0) [31,32,33], [34,35,36], + (2,0,0) [37,38,39], [40,41,42], + (2,1,0) [43,44,45], [46,47,48], + (2,2,0) [49,50,51], [52,53,54], + (3,0,0) [55,56,57], [58,59,60], + (3,1,0) [61,62,63], [64,65,66], + (3,2,0) [67,68,69], [70,71,72] + Attribute: bitfield {2} Type: 8-bit bitfield Data: 0x01, 0x02 Attribute: bitfield2D {3, 2} Type: 8-bit bitfield Data: - (0,0) 0x01, 0x02, 0x03, 0x04, 0x05, 0x06 + (0,0) 0x01, 0x02, + (1,0) 0x03, 0x04, + (2,0) 0x05, 0x06 Attribute: bitfield3D {4, 3, 2} Type: 8-bit bitfield Data: - (0,0,0) 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, - (1,2,0) 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, - (3,1,0) 0x15, 0x16, 0x17, 0x18 - Attribute: compound {2} + (0,0,0) 0x01, 0x02, + (0,1,0) 0x03, 0x04, + (0,2,0) 0x05, 0x06, + (1,0,0) 0x07, 0x08, + (1,1,0) 0x09, 0x0a, + (1,2,0) 0x0b, 0x0c, + (2,0,0) 0x0d, 0x0e, + (2,1,0) 0x0f, 0x10, + (2,2,0) 0x11, 0x12, + (3,0,0) 0x13, 0x14, + (3,1,0) 0x15, 0x16, + (3,2,0) 0x17, 0x18 + Attribute: compound {2} Type: struct { "a" +0 8-bit integer "b" +4 IEEE 64-bit little-endian float @@ -208,108 +329,185 @@ g1 Group "b" +4 IEEE 64-bit little-endian float } 12 bytes Data: - (0,0) {1, 2}, {3, 4}, {5, 6}, {7, 8}, {9, 10}, {11, 12} + (0,0) {1, 2}, {3, 4}, + (1,0) {5, 6}, {7, 8}, + (2,0) {9, 10}, {11, 12} Attribute: compound3D {4, 3, 2} Type: struct { "a" +0 8-bit integer "b" +4 IEEE 64-bit little-endian float } 12 bytes Data: - (0,0,0) {1, 2}, {3, 4}, {5, 6}, {7, 8}, {9, 10}, {11, 12}, {13, - (1,0,0) 14}, {15, 16}, {17, 18}, {19, 20}, {21, 22}, {23, 24}, - (2,0,0) {25, 26}, {27, 28}, {29, 30}, {31, 32}, {33, 34}, {35, 36}, - (3,0,0) {37, 38}, {39, 40}, {41, 42}, {43, 44}, {45, 46}, {47, 48} - Attribute: enum {2} + (0,0,0) {1, 2}, {3, 4}, + (0,1,0) {5, 6}, {7, 8}, + (0,2,0) {9, 10}, {11, 12}, + (1,0,0) {13, 14}, {15, 16}, + (1,1,0) {17, 18}, {19, 20}, + (1,2,0) {21, 22}, {23, 24}, + (2,0,0) {25, 26}, {27, 28}, + (2,1,0) {29, 30}, {31, 32}, + (2,2,0) {33, 34}, {35, 36}, + (3,0,0) {37, 38}, {39, 40}, + (3,1,0) {41, 42}, {43, 44}, + (3,2,0) {45, 46}, {47, 48} + Attribute: enum {2} Type: enum 32-bit little-endian integer { RED = 0 GREEN = 1 } Data: RED, RED - Attribute: enum2D {3, 2} + Attribute: enum2D {3, 2} Type: enum 32-bit little-endian integer { RED = 0 GREEN = 1 } Data: - (0,0) RED, RED, RED, RED, RED, RED - Attribute: enum3D {4, 3, 2} + (0,0) RED, RED, + (1,0) RED, RED, + (2,0) RED, RED + Attribute: enum3D {4, 3, 2} Type: enum 32-bit little-endian integer { RED = 0 GREEN = 1 } Data: - (0,0,0) RED, RED, RED, RED, RED, RED, RED, RED, RED, RED, RED, RED, - (2,0,0) RED, RED, RED, RED, RED, RED, RED, RED, RED, RED, RED, RED - Attribute: float {2} + (0,0,0) RED, RED, + (0,1,0) RED, RED, + (0,2,0) RED, RED, + (1,0,0) RED, RED, + (1,1,0) RED, RED, + (1,2,0) RED, RED, + (2,0,0) RED, RED, + (2,1,0) RED, RED, + (2,2,0) RED, RED, + (3,0,0) RED, RED, + (3,1,0) RED, RED, + (3,2,0) RED, RED + Attribute: float {2} Type: IEEE 32-bit little-endian float Data: 1, 2 - Attribute: float2D {3, 2} + Attribute: float2D {3, 2} Type: IEEE 32-bit little-endian float Data: - (0,0) 1, 2, 3, 4, 5, 6 - Attribute: float3D {4, 3, 2} + (0,0) 1, 2, + (1,0) 3, 4, + (2,0) 5, 6 + Attribute: float3D {4, 3, 2} Type: IEEE 32-bit little-endian float Data: - (0,0,0) 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, - (2,2,1) 18, 19, 20, 21, 22, 23, 24 - Attribute: integer {2} + (0,0,0) 1, 2, + (0,1,0) 3, 4, + (0,2,0) 5, 6, + (1,0,0) 7, 8, + (1,1,0) 9, 10, + (1,2,0) 11, 12, + (2,0,0) 13, 14, + (2,1,0) 15, 16, + (2,2,0) 17, 18, + (3,0,0) 19, 20, + (3,1,0) 21, 22, + (3,2,0) 23, 24 + Attribute: integer {2} Type: 32-bit little-endian integer Data: 1, 2 Attribute: integer2D {3, 2} Type: 32-bit little-endian integer Data: - (0,0) 1, 2, 3, 4, 5, 6 + (0,0) 1, 2, + (1,0) 3, 4, + (2,0) 5, 6 Attribute: integer3D {4, 3, 2} Type: 32-bit little-endian integer Data: - (0,0,0) 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, - (2,2,1) 18, 19, 20, 21, 22, 23, 24 - Attribute: opaque {2} + (0,0,0) 1, 2, + (0,1,0) 3, 4, + (0,2,0) 5, 6, + (1,0,0) 7, 8, + (1,1,0) 9, 10, + (1,2,0) 11, 12, + (2,0,0) 13, 14, + (2,1,0) 15, 16, + (2,2,0) 17, 18, + (3,0,0) 19, 20, + (3,1,0) 21, 22, + (3,2,0) 23, 24 + Attribute: opaque {2} Type: 1-byte opaque type (tag = "1-byte opaque type") Data: 0x01, 0x02 - Attribute: opaque2D {3, 2} + Attribute: opaque2D {3, 2} Type: 1-byte opaque type (tag = "1-byte opaque type") Data: - (0,0) 0x01, 0x02, 0x03, 0x04, 0x05, 0x06 - Attribute: opaque3D {4, 3, 2} + (0,0) 0x01, 0x02, + (1,0) 0x03, 0x04, + (2,0) 0x05, 0x06 + Attribute: opaque3D {4, 3, 2} Type: 1-byte opaque type (tag = "1-byte opaque type") Data: - (0,0,0) 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, - (1,2,0) 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, - (3,1,0) 0x15, 0x16, 0x17, 0x18 - Attribute: string {2} + (0,0,0) 0x01, 0x02, + (0,1,0) 0x03, 0x04, + (0,2,0) 0x05, 0x06, + (1,0,0) 0x07, 0x08, + (1,1,0) 0x09, 0x0a, + (1,2,0) 0x0b, 0x0c, + (2,0,0) 0x0d, 0x0e, + (2,1,0) 0x0f, 0x10, + (2,2,0) 0x11, 0x12, + (3,0,0) 0x13, 0x14, + (3,1,0) 0x15, 0x16, + (3,2,0) 0x17, 0x18 + Attribute: string {2} Type: 2-byte null-terminated ASCII string Data: "ab", "de" - Attribute: string2D {3, 2} + Attribute: string2D {3, 2} Type: 2-byte null-terminated ASCII string Data: - (0,0) "ab", "cd", "ef", "gh", "ij", "kl" - Attribute: string3D {4, 3, 2} + (0,0) "ab", "cd", + (1,0) "ef", "gh", + (2,0) "ij", "kl" + Attribute: string3D {4, 3, 2} Type: 2-byte null-terminated ASCII string Data: - (0,0,0) "ab", "cd", "ef", "gh", "ij", "kl", "mn", "pq", "rs", "tu", - (1,2,0) "vw", "xz", "AB", "CD", "EF", "GH", "IJ", "KL", "MN", "PQ", - (3,1,0) "RS", "TU", "VW", "XZ" - Attribute: vlen {2} + (0,0,0) "ab", "cd", + (0,1,0) "ef", "gh", + (0,2,0) "ij", "kl", + (1,0,0) "mn", "pq", + (1,1,0) "rs", "tu", + (1,2,0) "vw", "xz", + (2,0,0) "AB", "CD", + (2,1,0) "EF", "GH", + (2,2,0) "IJ", "KL", + (3,0,0) "MN", "PQ", + (3,1,0) "RS", "TU", + (3,2,0) "VW", "XZ" + Attribute: vlen {2} Type: variable length of 32-bit little-endian integer Data: (1), (2,3) - Attribute: vlen2D {3, 2} + Attribute: vlen2D {3, 2} Type: variable length of 32-bit little-endian integer Data: - (0,0) (0), (1), (2,3), (4,5), (6,7,8), (9,10,11) - Attribute: vlen3D {4, 3, 2} + (0,0) (0), (1), + (1,0) (2,3), (4,5), + (2,0) (6,7,8), (9,10,11) + Attribute: vlen3D {4, 3, 2} Type: variable length of 32-bit little-endian integer Data: - (0,0,0) (0), (1), (2), (3), (4), (5), (6,7), (8,9), (10,11), - (1,1,1) (12,13), (14,15), (16,17), (18,19,20), (21,22,23), - (2,1,0) (24,25,26), (27,28,29), (30,31,32), (33,34,35), - (3,0,0) (36,37,38,39), (40,41,42,43), (44,45,46,47), (48,49,50,51), + (0,0,0) (0), (1), + (0,1,0) (2), (3), + (0,2,0) (4), (5), + (1,0,0) (6,7), (8,9), + (1,1,0) (10,11), (12,13), + (1,2,0) (14,15), (16,17), + (2,0,0) (18,19,20), (21,22,23), + (2,1,0) (24,25,26), (27,28,29), + (2,2,0) (30,31,32), (33,34,35), + (3,0,0) (36,37,38,39), (40,41,42,43), + (3,1,0) (44,45,46,47), (48,49,50,51), (3,2,0) (52,53,54,55), (56,57,58,59) Location: 1:2176 Links: 1 diff --git a/tools/testfiles/tattr4_be.h5 b/tools/testfiles/tattr4_be.h5 new file mode 100644 index 0000000..a464ac6 Binary files /dev/null and b/tools/testfiles/tattr4_be.h5 differ diff --git a/tools/testfiles/tattrreg.ddl b/tools/testfiles/tattrreg.ddl index 989daf7..b47ab63 100644 --- a/tools/testfiles/tattrreg.ddl +++ b/tools/testfiles/tattrreg.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump tattrreg.h5' -############################# HDF5 "tattrreg.h5" { GROUP "/" { DATASET "Dataset1" { diff --git a/tools/testfiles/tattrregR.ddl b/tools/testfiles/tattrregR.ddl index 6e399c0..1c661e4 100644 --- a/tools/testfiles/tattrregR.ddl +++ b/tools/testfiles/tattrregR.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump -R tattrreg.h5' -############################# HDF5 "tattrreg.h5" { GROUP "/" { DATASET "Dataset1" { @@ -25,7 +22,7 @@ GROUP "/" { (7,2): 216, 219, 222, 225, 228, 231 (0): } (0): } - (1): DATASET /Dataset2 { + (1): DATASET /Dataset2 { (1): REGION_TYPE POINT (6,9), (2,2), (8,4), (1,6), (2,8), (1): (3,2), (0,4), (9,0), (7,1), (3,3) (1): DATATYPE H5T_STD_U8BE diff --git a/tools/testfiles/tattrreg_be.ls b/tools/testfiles/tattrreg_be.ls new file mode 100644 index 0000000..8307f35 --- /dev/null +++ b/tools/testfiles/tattrreg_be.ls @@ -0,0 +1,26 @@ +Opened "tattrreg.h5" with sec2 driver. +Dataset1 Dataset {NULL} + Attribute: Attribute1 {4} + Type: dataset region reference + Data: DSET-/Dataset2 {Blk0: (2,2)-(7,7)}, DSET-/Dataset2 {Pt0: (6,9), + Pt1: (2,2), Pt2: (8,4), Pt3: (1,6), Pt4: (2,8), Pt5: (3,2), + Pt6: (0,4), Pt7: (9,0), Pt8: (7,1), Pt9: (3,3)}, NULL, NULL + Location: 1:1400 + Links: 1 + Storage: 0 logical bytes, 0 allocated bytes + Type: 32-bit little-endian integer + Data: + +Dataset2 Dataset {10/10, 10/10} + Location: 1:800 + Links: 1 + Storage: 100 logical bytes, 100 allocated bytes, 100.00% utilization + Type: native unsigned char + Data: + (0,0) 0, 3, 6, 9, 12, 15, 18, 21, 24, 27, 30, 33, 36, 39, 42, 45, 48, + (1,7) 51, 54, 57, 60, 63, 66, 69, 72, 75, 78, 81, 84, 87, 90, 93, 96, + (3,3) 99, 102, 105, 108, 111, 114, 117, 120, 123, 126, 129, 132, 135, + (4,6) 138, 141, 144, 147, 150, 153, 156, 159, 162, 165, 168, 171, 174, + (5,9) 177, 180, 183, 186, 189, 192, 195, 198, 201, 204, 207, 210, 213, + (7,2) 216, 219, 222, 225, 228, 231, 234, 237, 240, 243, 246, 249, 252, + (8,5) 255, 2, 5, 8, 11, 14, 17, 20, 23, 26, 29, 32, 35, 38, 41 diff --git a/tools/testfiles/tattrreg_le.ls b/tools/testfiles/tattrreg_le.ls new file mode 100644 index 0000000..dd0be49 --- /dev/null +++ b/tools/testfiles/tattrreg_le.ls @@ -0,0 +1,26 @@ +Opened "tattrreg.h5" with sec2 driver. +Dataset1 Dataset {NULL} + Attribute: Attribute1 {4} + Type: dataset region reference + Data: DSET-/Dataset2 {Blk0: (2,2)-(7,7)}, DSET-/Dataset2 {Pt0: (6,9), + Pt1: (2,2), Pt2: (8,4), Pt3: (1,6), Pt4: (2,8), Pt5: (3,2), + Pt6: (0,4), Pt7: (9,0), Pt8: (7,1), Pt9: (3,3)}, NULL, NULL + Location: 1:1400 + Links: 1 + Storage: 0 logical bytes, 0 allocated bytes + Type: native int + Data: + +Dataset2 Dataset {10/10, 10/10} + Location: 1:800 + Links: 1 + Storage: 100 logical bytes, 100 allocated bytes, 100.00% utilization + Type: 8-bit unsigned integer + Data: + (0,0) 0, 3, 6, 9, 12, 15, 18, 21, 24, 27, 30, 33, 36, 39, 42, 45, 48, + (1,7) 51, 54, 57, 60, 63, 66, 69, 72, 75, 78, 81, 84, 87, 90, 93, 96, + (3,3) 99, 102, 105, 108, 111, 114, 117, 120, 123, 126, 129, 132, 135, + (4,6) 138, 141, 144, 147, 150, 153, 156, 159, 162, 165, 168, 171, 174, + (5,9) 177, 180, 183, 186, 189, 192, 195, 198, 201, 204, 207, 210, 213, + (7,2) 216, 219, 222, 225, 228, 231, 234, 237, 240, 243, 246, 249, 252, + (8,5) 255, 2, 5, 8, 11, 14, 17, 20, 23, 26, 29, 32, 35, 38, 41 diff --git a/tools/testfiles/tbigdims.ddl b/tools/testfiles/tbigdims.ddl index 21e2a43..13f2052 100644 --- a/tools/testfiles/tbigdims.ddl +++ b/tools/testfiles/tbigdims.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump -d dset4gb -s 4294967284 -c 22 tbigdims.h5' -############################# HDF5 "tbigdims.h5" { DATASET "dset4gb" { DATATYPE H5T_STD_I8LE diff --git a/tools/testfiles/tbitfields.h5.xml b/tools/testfiles/tbitfields.h5.xml index 28da284..73365f0 100644 --- a/tools/testfiles/tbitfields.h5.xml +++ b/tools/testfiles/tbitfields.h5.xml @@ -1,17 +1,14 @@ -############################# -Expected output for 'h5dump --xml tbitfields.h5' -############################# - + - + - + @@ -26,9 +23,38 @@ Expected output for 'h5dump --xml tbitfields.h5' - 0xff 0xfe 0xfd 0xfc 0xfb 0xfa 0xf9 0xf8 0xf7 0xf6 0xf5 0xf4 0xf3 - 0xf2 0xf1 0xf0 0xef 0xee 0xed 0xec 0xeb 0xea 0xe9 0xe8 0xe7 0xe6 - 0xe5 0xe4 0xe3 0xe2 0xe1 0xe0 + 0xff + 0xfe + 0xfd + 0xfc + 0xfb + 0xfa + 0xf9 + 0xf8 + 0xf7 + 0xf6 + 0xf5 + 0xf4 + 0xf3 + 0xf2 + 0xf1 + 0xf0 + 0xef + 0xee + 0xed + 0xec + 0xeb + 0xea + 0xe9 + 0xe8 + 0xe7 + 0xe6 + 0xe5 + 0xe4 + 0xe3 + 0xe2 + 0xe1 + 0xe0 @@ -36,9 +62,9 @@ Expected output for 'h5dump --xml tbitfields.h5' - + - + @@ -53,8 +79,22 @@ Expected output for 'h5dump --xml tbitfields.h5' - ff:fe fd:fc fb:fa f9:f8 f7:f6 f5:f4 f3:f2 f1:f0 ef:ee ed:ec eb:ea - e9:e8 e7:e6 e5:e4 e3:e2 e1:e0 + ff:fe + fd:fc + fb:fa + f9:f8 + f7:f6 + f5:f4 + f3:f2 + f1:f0 + ef:ee + ed:ec + eb:ea + e9:e8 + e7:e6 + e5:e4 + e3:e2 + e1:e0 diff --git a/tools/testfiles/tboot1.ddl b/tools/testfiles/tboot1.ddl index 8ffffc0..4758948 100644 --- a/tools/testfiles/tboot1.ddl +++ b/tools/testfiles/tboot1.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump -H -B -d dset tfcontents1.h5' -############################# HDF5 "tfcontents1.h5" { SUPER_BLOCK { SUPERBLOCK_VERSION 0 @@ -14,9 +11,9 @@ SUPER_BLOCK { ISTORE_K 32 FILE_SPACE_STRATEGY H5F_FILE_SPACE_ALL FREE_SPACE_THRESHOLD 1 -} -USER_BLOCK { - USERBLOCK_SIZE 0 + USER_BLOCK { + USERBLOCK_SIZE 0 + } } DATASET "dset" { DATATYPE H5T_STD_I32BE diff --git a/tools/testfiles/tboot2.ddl b/tools/testfiles/tboot2.ddl index 51250fe..d83b92b 100644 --- a/tools/testfiles/tboot2.ddl +++ b/tools/testfiles/tboot2.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump -B tfcontents2.h5' -############################# HDF5 "tfcontents2.h5" { SUPER_BLOCK { SUPERBLOCK_VERSION 0 @@ -14,9 +11,9 @@ SUPER_BLOCK { ISTORE_K 32 FILE_SPACE_STRATEGY H5F_FILE_SPACE_ALL FREE_SPACE_THRESHOLD 1 -} -USER_BLOCK { - USERBLOCK_SIZE 0 + USER_BLOCK { + USERBLOCK_SIZE 0 + } } GROUP "/" { } diff --git a/tools/testfiles/tchar1.ddl b/tools/testfiles/tchar1.ddl index cc2d838..78acaf0 100644 --- a/tools/testfiles/tchar1.ddl +++ b/tools/testfiles/tchar1.ddl @@ -1,17 +1,14 @@ -############################# -Expected output for 'h5dump -r tchar.h5' -############################# HDF5 "tchar.h5" { GROUP "/" { DATASET "Dataset1" { DATATYPE H5T_STD_I8LE DATASPACE SIMPLE { ( 308 ) / ( 308 ) } DATA { - "Four score and seven years ago our forefathers brought forth on this " - "continent a new nation, conceived in liberty and dedicated to the pro" - "position that all men are created equal. Now we are engaged in a grea" - "t civil war, testing whether that nation or any nation so conceived a" - "nd so dedicated can long endure." + "Four score and seven years ago our forefathers brought forth on th" + "is continent a new nation, conceived in liberty and dedicated to t" + "he proposition that all men are created equal. Now we are engaged " + "in a great civil war, testing whether that nation or any nation so" + " conceived and so dedicated can long endure." } } } diff --git a/tools/testfiles/tchunked.ddl b/tools/testfiles/tchunked.ddl index ba18776..b68b233 100644 --- a/tools/testfiles/tchunked.ddl +++ b/tools/testfiles/tchunked.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump -H -p -d chunked tfilters.h5' -############################# HDF5 "tfilters.h5" { DATASET "chunked" { COMMENT "This is a dataset with chunked storage" @@ -9,13 +6,13 @@ COMMENT "This is a dataset with chunked storage" STORAGE_LAYOUT { CHUNKED ( 10, 5 ) SIZE 800 - } + } FILTERS { NONE } FILLVALUE { FILL_TIME H5D_FILL_TIME_IFSET - VALUE 0 + VALUE 0 } ALLOCATION_TIME { H5D_ALLOC_TIME_INCR diff --git a/tools/testfiles/tcomp-1.ddl b/tools/testfiles/tcomp-1.ddl index 0c24dc9..f86ed16 100644 --- a/tools/testfiles/tcomp-1.ddl +++ b/tools/testfiles/tcomp-1.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump tcompound.h5' -############################# HDF5 "tcompound.h5" { GROUP "/" { DATATYPE "#6632" H5T_COMPOUND { diff --git a/tools/testfiles/tcomp-1.ls b/tools/testfiles/tcomp-1.ls index 9cfb47d..a3969bd 100644 --- a/tools/testfiles/tcomp-1.ls +++ b/tools/testfiles/tcomp-1.ls @@ -1,6 +1,3 @@ -############################# - output for 'h5ls -w80 -r -d tcompound.h5' -############################# / Group /dset1 Dataset {5} Data: diff --git a/tools/testfiles/tcomp-2.ddl b/tools/testfiles/tcomp-2.ddl index 824c753..a733a3c 100644 --- a/tools/testfiles/tcomp-2.ddl +++ b/tools/testfiles/tcomp-2.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump -t /type1 --datatype /type2 --datatype=/group1/type3 tcompound.h5' -############################# HDF5 "tcompound.h5" { DATATYPE "/type1" H5T_COMPOUND { H5T_STD_I32BE "int_name"; diff --git a/tools/testfiles/tcomp-3.ddl b/tools/testfiles/tcomp-3.ddl index 538aa08..0294220 100644 --- a/tools/testfiles/tcomp-3.ddl +++ b/tools/testfiles/tcomp-3.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump -t /#6632 -g /group2 tcompound.h5' -############################# HDF5 "tcompound.h5" { DATATYPE "/#6632" H5T_COMPOUND { H5T_STD_I32BE "int"; diff --git a/tools/testfiles/tcomp-4.ddl b/tools/testfiles/tcomp-4.ddl index 32212f0..4ab5191 100644 --- a/tools/testfiles/tcomp-4.ddl +++ b/tools/testfiles/tcomp-4.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump tcompound_complex.h5' -############################# HDF5 "tcompound_complex.h5" { GROUP "/" { DATASET "CompoundComplex" { diff --git a/tools/testfiles/tcompact.ddl b/tools/testfiles/tcompact.ddl index f970ce5..918e2eb 100644 --- a/tools/testfiles/tcompact.ddl +++ b/tools/testfiles/tcompact.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump -H -p -d compact tfilters.h5' -############################# HDF5 "tfilters.h5" { DATASET "compact" { COMMENT "This is a dataset with compact storage" @@ -15,7 +12,7 @@ COMMENT "This is a dataset with compact storage" } FILLVALUE { FILL_TIME H5D_FILL_TIME_IFSET - VALUE 0 + VALUE 0 } ALLOCATION_TIME { H5D_ALLOC_TIME_EARLY diff --git a/tools/testfiles/tcompound.h5.xml b/tools/testfiles/tcompound.h5.xml index ed255e7..10ef36e 100644 --- a/tools/testfiles/tcompound.h5.xml +++ b/tools/testfiles/tcompound.h5.xml @@ -1,8 +1,5 @@ -############################# -Expected output for 'h5dump --xml tcompound.h5' -############################# - + @@ -28,9 +25,9 @@ Expected output for 'h5dump --xml tcompound.h5' - + - + @@ -66,7 +63,11 @@ Expected output for 'h5dump --xml tcompound.h5' - 0 0 1 1 1 0.5 2 4 0.333333 3 9 0.25 4 16 0.2 + 0 0 1 + 1 1 0.5 + 2 4 0.333333 + 3 9 0.25 + 4 16 0.2 @@ -75,9 +76,9 @@ Expected output for 'h5dump --xml tcompound.h5' - + - + @@ -89,7 +90,11 @@ Expected output for 'h5dump --xml tcompound.h5' - 0 0 1 1.1 2 2.2 3 3.3 4 4.4 + 0 0 + 1 1.1 + 2 2.2 + 3 3.3 + 4 4.4 @@ -97,9 +102,9 @@ Expected output for 'h5dump --xml tcompound.h5' - + - + @@ -112,96 +117,24 @@ Expected output for 'h5dump --xml tcompound.h5' - 0 1 2 3 1 2 3 4 5 6 - 2 3 4 5 6 7 - 3 4 5 6 7 8 - 4 5 6 7 8 9 - 5 6 7 8 9 10 - 1 2 3 4 2 3 4 5 6 7 - 3 4 5 6 7 8 - 4 5 6 7 8 9 - 5 6 7 8 9 10 - 6 7 8 9 10 11 - 2 3 4 5 3 4 5 6 7 8 - 4 5 6 7 8 9 - 5 6 7 8 9 10 - 6 7 8 9 10 11 - 7 8 9 10 11 12 - 3 4 5 6 4 5 6 7 8 9 - 5 6 7 8 9 10 - 6 7 8 9 10 11 - 7 8 9 10 11 12 - 8 9 10 11 12 13 - 4 5 6 7 5 6 7 8 9 10 - 6 7 8 9 10 11 - 7 8 9 10 11 12 - 8 9 10 11 12 13 - 9 10 11 12 13 14 - 5 6 7 8 6 7 8 9 10 11 - 7 8 9 10 11 12 - 8 9 10 11 12 13 - 9 10 11 12 13 14 - 10 11 12 13 14 15 - 1 2 3 4 2 3 4 5 6 7 - 3 4 5 6 7 8 - 4 5 6 7 8 9 - 5 6 7 8 9 10 - 6 7 8 9 10 11 - 2 3 4 5 3 4 5 6 7 8 - 4 5 6 7 8 9 - 5 6 7 8 9 10 - 6 7 8 9 10 11 - 7 8 9 10 11 12 - 3 4 5 6 4 5 6 7 8 9 - 5 6 7 8 9 10 - 6 7 8 9 10 11 - 7 8 9 10 11 12 - 8 9 10 11 12 13 - 4 5 6 7 5 6 7 8 9 10 - 6 7 8 9 10 11 - 7 8 9 10 11 12 - 8 9 10 11 12 13 - 9 10 11 12 13 14 - 5 6 7 8 6 7 8 9 10 11 - 7 8 9 10 11 12 - 8 9 10 11 12 13 - 9 10 11 12 13 14 - 10 11 12 13 14 15 - 6 7 8 9 7 8 9 10 11 12 - 8 9 10 11 12 13 - 9 10 11 12 13 14 - 10 11 12 13 14 15 - 11 12 13 14 15 16 - 2 3 4 5 3 4 5 6 7 8 - 4 5 6 7 8 9 - 5 6 7 8 9 10 - 6 7 8 9 10 11 - 7 8 9 10 11 12 - 3 4 5 6 4 5 6 7 8 9 - 5 6 7 8 9 10 - 6 7 8 9 10 11 - 7 8 9 10 11 12 - 8 9 10 11 12 13 - 4 5 6 7 5 6 7 8 9 10 - 6 7 8 9 10 11 - 7 8 9 10 11 12 - 8 9 10 11 12 13 - 9 10 11 12 13 14 - 5 6 7 8 6 7 8 9 10 11 - 7 8 9 10 11 12 - 8 9 10 11 12 13 - 9 10 11 12 13 14 - 10 11 12 13 14 15 - 6 7 8 9 7 8 9 10 11 12 - 8 9 10 11 12 13 - 9 10 11 12 13 14 - 10 11 12 13 14 15 - 11 12 13 14 15 16 - 7 8 9 10 8 9 10 11 12 13 - 9 10 11 12 13 14 - 10 11 12 13 14 15 - 11 12 13 14 15 16 - 12 13 14 15 16 17 + 0 1 2 3 1 2 3 4 5 6 2 3 4 5 6 7 3 4 5 6 7 8 4 5 6 7 8 9 5 6 7 8 9 10 + 1 2 3 4 2 3 4 5 6 7 3 4 5 6 7 8 4 5 6 7 8 9 5 6 7 8 9 10 6 7 8 9 10 11 + 2 3 4 5 3 4 5 6 7 8 4 5 6 7 8 9 5 6 7 8 9 10 6 7 8 9 10 11 7 8 9 10 11 12 + 3 4 5 6 4 5 6 7 8 9 5 6 7 8 9 10 6 7 8 9 10 11 7 8 9 10 11 12 8 9 10 11 12 13 + 4 5 6 7 5 6 7 8 9 10 6 7 8 9 10 11 7 8 9 10 11 12 8 9 10 11 12 13 9 10 11 12 13 14 + 5 6 7 8 6 7 8 9 10 11 7 8 9 10 11 12 8 9 10 11 12 13 9 10 11 12 13 14 10 11 12 13 14 15 + 1 2 3 4 2 3 4 5 6 7 3 4 5 6 7 8 4 5 6 7 8 9 5 6 7 8 9 10 6 7 8 9 10 11 + 2 3 4 5 3 4 5 6 7 8 4 5 6 7 8 9 5 6 7 8 9 10 6 7 8 9 10 11 7 8 9 10 11 12 + 3 4 5 6 4 5 6 7 8 9 5 6 7 8 9 10 6 7 8 9 10 11 7 8 9 10 11 12 8 9 10 11 12 13 + 4 5 6 7 5 6 7 8 9 10 6 7 8 9 10 11 7 8 9 10 11 12 8 9 10 11 12 13 9 10 11 12 13 14 + 5 6 7 8 6 7 8 9 10 11 7 8 9 10 11 12 8 9 10 11 12 13 9 10 11 12 13 14 10 11 12 13 14 15 + 6 7 8 9 7 8 9 10 11 12 8 9 10 11 12 13 9 10 11 12 13 14 10 11 12 13 14 15 11 12 13 14 15 16 + 2 3 4 5 3 4 5 6 7 8 4 5 6 7 8 9 5 6 7 8 9 10 6 7 8 9 10 11 7 8 9 10 11 12 + 3 4 5 6 4 5 6 7 8 9 5 6 7 8 9 10 6 7 8 9 10 11 7 8 9 10 11 12 8 9 10 11 12 13 + 4 5 6 7 5 6 7 8 9 10 6 7 8 9 10 11 7 8 9 10 11 12 8 9 10 11 12 13 9 10 11 12 13 14 + 5 6 7 8 6 7 8 9 10 11 7 8 9 10 11 12 8 9 10 11 12 13 9 10 11 12 13 14 10 11 12 13 14 15 + 6 7 8 9 7 8 9 10 11 12 8 9 10 11 12 13 9 10 11 12 13 14 10 11 12 13 14 15 11 12 13 14 15 16 + 7 8 9 10 8 9 10 11 12 13 9 10 11 12 13 14 10 11 12 13 14 15 11 12 13 14 15 16 12 13 14 15 16 17 @@ -209,9 +142,9 @@ Expected output for 'h5dump --xml tcompound.h5' - + - + @@ -223,7 +156,11 @@ Expected output for 'h5dump --xml tcompound.h5' - 0 3 1 4 2 5 3 6 4 7 + 0 3 + 1 4 + 2 5 + 3 6 + 4 7 @@ -253,9 +190,9 @@ Expected output for 'h5dump --xml tcompound.h5' - + - + @@ -267,7 +204,11 @@ Expected output for 'h5dump --xml tcompound.h5' - 0 0 1 0.1 2 0.2 3 0.3 4 0.4 + 0 0 + 1 0.1 + 2 0.2 + 3 0.3 + 4 0.4 diff --git a/tools/testfiles/tcompound2.h5.xml b/tools/testfiles/tcompound2.h5.xml index 53e9312..ac139d9 100644 --- a/tools/testfiles/tcompound2.h5.xml +++ b/tools/testfiles/tcompound2.h5.xml @@ -1,8 +1,5 @@ -############################# -Expected output for 'h5dump --xml tcompound2.h5' -############################# - + @@ -34,7 +31,7 @@ Expected output for 'h5dump --xml tcompound2.h5' - + @@ -70,7 +67,12 @@ Expected output for 'h5dump --xml tcompound2.h5' - 0 0 1 1 1 0.5 2 4 0.333333 3 9 0.25 4 16 0.2 5 25 0.166667 + 0 0 1 + 1 1 0.5 + 2 4 0.333333 + 3 9 0.25 + 4 16 0.2 + 5 25 0.166667 @@ -85,7 +87,7 @@ Expected output for 'h5dump --xml tcompound2.h5' - + @@ -97,7 +99,12 @@ Expected output for 'h5dump --xml tcompound2.h5' - 0 0 1 1.1 2 2.2 3 3.3 4 4.4 5 5.5 + 0 0 + 1 1.1 + 2 2.2 + 3 3.3 + 4 4.4 + 5 5.5 @@ -111,7 +118,7 @@ Expected output for 'h5dump --xml tcompound2.h5' - + @@ -123,7 +130,12 @@ Expected output for 'h5dump --xml tcompound2.h5' - 0 0 1 1 2 2 3 3 4 4 5 5 + 0 0 + 1 1 + 2 2 + 3 3 + 4 4 + 5 5 @@ -159,7 +171,7 @@ Expected output for 'h5dump --xml tcompound2.h5' - + @@ -171,7 +183,12 @@ Expected output for 'h5dump --xml tcompound2.h5' - 0 0 1 1 2 2 3 3 4 4 5 5 + 0 0 + 1 1 + 2 2 + 3 3 + 4 4 + 5 5 diff --git a/tools/testfiles/tcompound_complex.h5.xml b/tools/testfiles/tcompound_complex.h5.xml index 99c1bff..b35193a 100644 --- a/tools/testfiles/tcompound_complex.h5.xml +++ b/tools/testfiles/tcompound_complex.h5.xml @@ -1,19 +1,16 @@ -############################# -Expected output for 'h5dump --xml tcompound_complex.h5' -############################# - + - + - - - - + + + + @@ -93,36 +90,12 @@ Expected output for 'h5dump --xml tcompound_complex.h5' - 0 "A fight is a contract that takes two people to honor." "A combative stance means that you've accepted the contract." "In which case, you deserve what you get." " -- Professor Cheng Man-ch'ing" "Hello!" 0 1 2 3 4 5 - 1 2 3 4 5 6 - 2 3 4 5 6 7 - 3 4 5 6 7 8 - 4 5 6 7 8 9 0 0 0 0 0 0 0 0 0 0 0 109 - 1 "A fight is a contract that takes two people to honor." "A combative stance means that you've accepted the contract." "In which case, you deserve what you get." " -- Professor Cheng Man-ch'ing" "Hello!" 1 2 3 4 5 6 - 2 3 4 5 6 7 - 3 4 5 6 7 8 - 4 5 6 7 8 9 - 5 6 7 8 9 10 0.96 1024.96 1024.96 1024.96 1024.96 1024.96 1024.96 1024.96 1024.96 1024.96 1024.96 109 - 2 "A fight is a contract that takes two people to honor." "A combative stance means that you've accepted the contract." "In which case, you deserve what you get." " -- Professor Cheng Man-ch'ing" "Hello!" 2 3 4 5 6 7 - 3 4 5 6 7 8 - 4 5 6 7 8 9 - 5 6 7 8 9 10 - 6 7 8 9 10 11 1.92 2049.93 2049.93 2049.93 2049.93 2049.93 2049.93 2049.93 2049.93 2049.93 2049.93 109 - 3 "A fight is a contract that takes two people to honor." "A combative stance means that you've accepted the contract." "In which case, you deserve what you get." " -- Professor Cheng Man-ch'ing" "Hello!" 3 4 5 6 7 8 - 4 5 6 7 8 9 - 5 6 7 8 9 10 - 6 7 8 9 10 11 - 7 8 9 10 11 12 2.88 3074.89 3074.89 3074.89 3074.89 3074.89 3074.89 3074.89 3074.89 3074.89 3074.89 109 - 4 "A fight is a contract that takes two people to honor." "A combative stance means that you've accepted the contract." "In which case, you deserve what you get." " -- Professor Cheng Man-ch'ing" "Hello!" 4 5 6 7 8 9 - 5 6 7 8 9 10 - 6 7 8 9 10 11 - 7 8 9 10 11 12 - 8 9 10 11 12 13 3.84 4099.85 4099.85 4099.85 4099.85 4099.85 4099.85 4099.85 4099.85 4099.85 4099.85 109 - 5 "A fight is a contract that takes two people to honor." "A combative stance means that you've accepted the contract." "In which case, you deserve what you get." " -- Professor Cheng Man-ch'ing" "Hello!" 5 6 7 8 9 10 - 6 7 8 9 10 11 - 7 8 9 10 11 12 - 8 9 10 11 12 13 - 9 10 11 12 13 14 4.8 5124.82 5124.82 5124.82 5124.82 5124.82 5124.82 5124.82 5124.82 5124.82 5124.82 109 + 0 "A fight is a contract that takes two people to honor." "A combative stance means that you've accepted the contract." "In which case, you deserve what you get." " -- Professor Cheng Man-ch'ing" "Hello!" 0 1 2 3 4 5 1 2 3 4 5 6 2 3 4 5 6 7 3 4 5 6 7 8 4 5 6 7 8 9 0 0 0 0 0 0 0 0 0 0 0 109 + 1 "A fight is a contract that takes two people to honor." "A combative stance means that you've accepted the contract." "In which case, you deserve what you get." " -- Professor Cheng Man-ch'ing" "Hello!" 1 2 3 4 5 6 2 3 4 5 6 7 3 4 5 6 7 8 4 5 6 7 8 9 5 6 7 8 9 10 0.96 1024.96 1024.96 1024.96 1024.96 1024.96 1024.96 1024.96 1024.96 1024.96 1024.96 109 + 2 "A fight is a contract that takes two people to honor." "A combative stance means that you've accepted the contract." "In which case, you deserve what you get." " -- Professor Cheng Man-ch'ing" "Hello!" 2 3 4 5 6 7 3 4 5 6 7 8 4 5 6 7 8 9 5 6 7 8 9 10 6 7 8 9 10 11 1.92 2049.93 2049.93 2049.93 2049.93 2049.93 2049.93 2049.93 2049.93 2049.93 2049.93 109 + 3 "A fight is a contract that takes two people to honor." "A combative stance means that you've accepted the contract." "In which case, you deserve what you get." " -- Professor Cheng Man-ch'ing" "Hello!" 3 4 5 6 7 8 4 5 6 7 8 9 5 6 7 8 9 10 6 7 8 9 10 11 7 8 9 10 11 12 2.88 3074.89 3074.89 3074.89 3074.89 3074.89 3074.89 3074.89 3074.89 3074.89 3074.89 109 + 4 "A fight is a contract that takes two people to honor." "A combative stance means that you've accepted the contract." "In which case, you deserve what you get." " -- Professor Cheng Man-ch'ing" "Hello!" 4 5 6 7 8 9 5 6 7 8 9 10 6 7 8 9 10 11 7 8 9 10 11 12 8 9 10 11 12 13 3.84 4099.85 4099.85 4099.85 4099.85 4099.85 4099.85 4099.85 4099.85 4099.85 4099.85 109 + 5 "A fight is a contract that takes two people to honor." "A combative stance means that you've accepted the contract." "In which case, you deserve what you get." " -- Professor Cheng Man-ch'ing" "Hello!" 5 6 7 8 9 10 6 7 8 9 10 11 7 8 9 10 11 12 8 9 10 11 12 13 9 10 11 12 13 14 4.8 5124.82 5124.82 5124.82 5124.82 5124.82 5124.82 5124.82 5124.82 5124.82 5124.82 109 diff --git a/tools/testfiles/tcontents.ddl b/tools/testfiles/tcontents.ddl index 2bb59b9..14e12d6 100644 --- a/tools/testfiles/tcontents.ddl +++ b/tools/testfiles/tcontents.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump -n tfcontents1.h5' -############################# HDF5 "tfcontents1.h5" { FILE_CONTENTS { datatype /#5616 diff --git a/tools/testfiles/tcontiguos.ddl b/tools/testfiles/tcontiguos.ddl index 2828f8c..bda7ef7 100644 --- a/tools/testfiles/tcontiguos.ddl +++ b/tools/testfiles/tcontiguos.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump -H -p -d contiguous tfilters.h5' -############################# HDF5 "tfilters.h5" { DATASET "contiguous" { COMMENT "This is a dataset with contiguous storage" @@ -16,7 +13,7 @@ COMMENT "This is a dataset with contiguous storage" } FILLVALUE { FILL_TIME H5D_FILL_TIME_IFSET - VALUE 0 + VALUE 0 } ALLOCATION_TIME { H5D_ALLOC_TIME_LATE diff --git a/tools/testfiles/tdatareg.ddl b/tools/testfiles/tdatareg.ddl index d68401f..a3831f1 100644 --- a/tools/testfiles/tdatareg.ddl +++ b/tools/testfiles/tdatareg.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump tdatareg.h5' -############################# HDF5 "tdatareg.h5" { GROUP "/" { DATASET "Dataset1" { diff --git a/tools/testfiles/tdatareg.h5.xml b/tools/testfiles/tdatareg.h5.xml index d7dfad8..327e213 100644 --- a/tools/testfiles/tdatareg.h5.xml +++ b/tools/testfiles/tdatareg.h5.xml @@ -1,16 +1,13 @@ -############################# -Expected output for 'h5dump --xml tdatareg.h5' -############################# - + - + - + @@ -34,9 +31,9 @@ Expected output for 'h5dump --xml tdatareg.h5' - + - + @@ -52,16 +49,106 @@ Expected output for 'h5dump --xml tdatareg.h5' - 0 3 6 9 12 15 18 21 24 27 - 30 33 36 39 42 45 48 51 54 57 - 60 63 66 69 72 75 78 81 84 87 - 90 93 96 99 102 105 108 111 114 117 - 120 123 126 129 132 135 138 141 144 147 - 150 153 156 159 162 165 168 171 174 177 - 180 183 186 189 192 195 198 201 204 207 - 210 213 216 219 222 225 228 231 234 237 - 240 243 246 249 252 255 2 5 8 11 - 14 17 20 23 26 29 32 35 38 41 + 0 + 3 + 6 + 9 + 12 + 15 + 18 + 21 + 24 + 27 + 30 + 33 + 36 + 39 + 42 + 45 + 48 + 51 + 54 + 57 + 60 + 63 + 66 + 69 + 72 + 75 + 78 + 81 + 84 + 87 + 90 + 93 + 96 + 99 + 102 + 105 + 108 + 111 + 114 + 117 + 120 + 123 + 126 + 129 + 132 + 135 + 138 + 141 + 144 + 147 + 150 + 153 + 156 + 159 + 162 + 165 + 168 + 171 + 174 + 177 + 180 + 183 + 186 + 189 + 192 + 195 + 198 + 201 + 204 + 207 + 210 + 213 + 216 + 219 + 222 + 225 + 228 + 231 + 234 + 237 + 240 + 243 + 246 + 249 + 252 + 255 + 2 + 5 + 8 + 11 + 14 + 17 + 20 + 23 + 26 + 29 + 32 + 35 + 38 + 41 diff --git a/tools/testfiles/tdataregR.ddl b/tools/testfiles/tdataregR.ddl index 2d962ed..aaac92c 100644 --- a/tools/testfiles/tdataregR.ddl +++ b/tools/testfiles/tdataregR.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump -R tdatareg.h5' -############################# HDF5 "tdatareg.h5" { GROUP "/" { DATASET "Dataset1" { @@ -20,7 +17,7 @@ GROUP "/" { (7,2): 216, 219, 222, 225, 228, 231 (0): } (0): } - (1): DATASET /Dataset2 { + (1): DATASET /Dataset2 { (1): REGION_TYPE POINT (6,9), (2,2), (8,4), (1,6), (2,8), (3,2), (1): (0,4), (9,0), (7,1), (3,3) (1): DATATYPE H5T_STD_U8BE diff --git a/tools/testfiles/tdataregbe.ls b/tools/testfiles/tdataregbe.ls index 47b6994..b9dd8f2 100644 --- a/tools/testfiles/tdataregbe.ls +++ b/tools/testfiles/tdataregbe.ls @@ -1,6 +1,3 @@ -############################# - output for 'h5ls -v tdatareg.h5' -############################# Opened "tdatareg.h5" with sec2 driver. Dataset1 Dataset {4/4} Location: 1:1284 diff --git a/tools/testfiles/tdataregle.ls b/tools/testfiles/tdataregle.ls index b07b274..915f371 100644 --- a/tools/testfiles/tdataregle.ls +++ b/tools/testfiles/tdataregle.ls @@ -1,6 +1,3 @@ -############################# - output for 'h5ls -v tdatareg.h5' -############################# Opened "tdatareg.h5" with sec2 driver. Dataset1 Dataset {4/4} Location: 1:1284 diff --git a/tools/testfiles/tdeflate.ddl b/tools/testfiles/tdeflate.ddl index 7f658e7..5603911 100644 --- a/tools/testfiles/tdeflate.ddl +++ b/tools/testfiles/tdeflate.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump -H -p -d deflate tfilters.h5' -############################# HDF5 "tfilters.h5" { DATASET "deflate" { DATATYPE H5T_STD_I32LE @@ -8,13 +5,13 @@ DATASET "deflate" { STORAGE_LAYOUT { CHUNKED ( 10, 5 ) SIZE 385 (2.078:1 COMPRESSION) - } + } FILTERS { COMPRESSION DEFLATE { LEVEL 9 } } FILLVALUE { FILL_TIME H5D_FILL_TIME_IFSET - VALUE 0 + VALUE 0 } ALLOCATION_TIME { H5D_ALLOC_TIME_INCR diff --git a/tools/testfiles/tdset-1.ddl b/tools/testfiles/tdset-1.ddl index 55d2a44..6b9b608 100644 --- a/tools/testfiles/tdset-1.ddl +++ b/tools/testfiles/tdset-1.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump tdset.h5' -############################# HDF5 "tdset.h5" { GROUP "/" { DATASET "dset1" { diff --git a/tools/testfiles/tdset-1.ls b/tools/testfiles/tdset-1.ls index b6e4671..130c3ef 100644 --- a/tools/testfiles/tdset-1.ls +++ b/tools/testfiles/tdset-1.ls @@ -1,6 +1,3 @@ -############################# - output for 'h5ls -w80 -r -d tdset.h5' -############################# / Group /dset1 Dataset {10, 20} Data: diff --git a/tools/testfiles/tdset-2.ddl b/tools/testfiles/tdset-2.ddl index 93c961c..2034a43 100644 --- a/tools/testfiles/tdset-2.ddl +++ b/tools/testfiles/tdset-2.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump -H -d dset1 -d /dset2 --dataset=dset3 tdset.h5' -############################# HDF5 "tdset.h5" { DATASET "dset1" { DATATYPE H5T_STD_I32BE @@ -10,7 +7,37 @@ DATASET "/dset2" { DATATYPE H5T_IEEE_F64BE DATASPACE SIMPLE { ( 30, 20 ) / ( 30, 20 ) } } -DATASET "dset3" { - } } -h5dump error: unable to open dataset "dset3" +HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): + #000: (file name) line (number) in H5Dopen2(): not found + major: Dataset + minor: Object not found + #001: (file name) line (number) in H5G_loc_find(): can't find object + major: Symbol table + minor: Object not found + #002: (file name) line (number) in H5G_traverse(): internal path traversal failed + major: Symbol table + minor: Object not found + #003: (file name) line (number) in H5G_traverse_real(): traversal operator failed + major: Symbol table + minor: Callback failed + #004: (file name) line (number) in H5G_loc_find_cb(): object 'dset3' doesn't exist + major: Symbol table + minor: Object not found +HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): + #000: (file name) line (number) in H5Lget_info(): unable to get link info + major: Symbol table + minor: Object not found + #001: (file name) line (number) in H5L_get_info(): name doesn't exist + major: Symbol table + minor: Object already exists + #002: (file name) line (number) in H5G_traverse(): internal path traversal failed + major: Symbol table + minor: Object not found + #003: (file name) line (number) in H5G_traverse_real(): traversal operator failed + major: Symbol table + minor: Callback failed + #004: (file name) line (number) in H5L_get_info_cb(): name doesn't exist + major: Symbol table + minor: Object not found +h5dump error: unable to get link info from "dset3" diff --git a/tools/testfiles/tdset-3s.ddl b/tools/testfiles/tdset-3s.ddl index 5963e90..93bdac8 100644 --- a/tools/testfiles/tdset-3s.ddl +++ b/tools/testfiles/tdset-3s.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump -d /dset1[1,1;;;] tdset.h5' -############################# HDF5 "tdset.h5" { DATASET "/dset1" { DATATYPE H5T_STD_I32BE diff --git a/tools/testfiles/tdset.h5.xml b/tools/testfiles/tdset.h5.xml index 7aedaf5..e914bf6 100644 --- a/tools/testfiles/tdset.h5.xml +++ b/tools/testfiles/tdset.h5.xml @@ -1,16 +1,13 @@ -############################# -Expected output for 'h5dump --xml tdset.h5' -############################# - + - + - + @@ -26,16 +23,206 @@ Expected output for 'h5dump --xml tdset.h5' - 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 - 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 - 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 - 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 - 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 - 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 - 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 - 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 - 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 - 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + 24 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 + 26 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 + 26 + 27 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 + 26 + 27 + 28 @@ -43,9 +230,9 @@ Expected output for 'h5dump --xml tdset.h5' - + - + @@ -61,86 +248,606 @@ Expected output for 'h5dump --xml tdset.h5' - 0 0.0001 0.0002 0.0003 0.0004 0.0005 0.0006 0.0007 0.0008 0.0009 0.001 - 0.0011 0.0012 0.0013 0.0014 0.0015 0.0016 0.0017 0.0018 0.0019 - 1 1.0001 1.0002 1.0003 1.0004 1.0005 1.0006 1.0007 1.0008 1.0009 1.001 - 1.0011 1.0012 1.0013 1.0014 1.0015 1.0016 1.0017 1.0018 1.0019 - 2 2.0001 2.0002 2.0003 2.0004 2.0005 2.0006 2.0007 2.0008 2.0009 2.001 - 2.0011 2.0012 2.0013 2.0014 2.0015 2.0016 2.0017 2.0018 2.0019 - 3 3.0001 3.0002 3.0003 3.0004 3.0005 3.0006 3.0007 3.0008 3.0009 3.001 - 3.0011 3.0012 3.0013 3.0014 3.0015 3.0016 3.0017 3.0018 3.0019 - 4 4.0001 4.0002 4.0003 4.0004 4.0005 4.0006 4.0007 4.0008 4.0009 4.001 - 4.0011 4.0012 4.0013 4.0014 4.0015 4.0016 4.0017 4.0018 4.0019 - 5 5.0001 5.0002 5.0003 5.0004 5.0005 5.0006 5.0007 5.0008 5.0009 5.001 - 5.0011 5.0012 5.0013 5.0014 5.0015 5.0016 5.0017 5.0018 5.0019 - 6 6.0001 6.0002 6.0003 6.0004 6.0005 6.0006 6.0007 6.0008 6.0009 6.001 - 6.0011 6.0012 6.0013 6.0014 6.0015 6.0016 6.0017 6.0018 6.0019 - 7 7.0001 7.0002 7.0003 7.0004 7.0005 7.0006 7.0007 7.0008 7.0009 7.001 - 7.0011 7.0012 7.0013 7.0014 7.0015 7.0016 7.0017 7.0018 7.0019 - 8 8.0001 8.0002 8.0003 8.0004 8.0005 8.0006 8.0007 8.0008 8.0009 8.001 - 8.0011 8.0012 8.0013 8.0014 8.0015 8.0016 8.0017 8.0018 8.0019 - 9 9.0001 9.0002 9.0003 9.0004 9.0005 9.0006 9.0007 9.0008 9.0009 9.001 - 9.0011 9.0012 9.0013 9.0014 9.0015 9.0016 9.0017 9.0018 9.0019 - 10 10.0001 10.0002 10.0003 10.0004 10.0005 10.0006 10.0007 10.0008 - 10.0009 10.001 10.0011 10.0012 10.0013 10.0014 10.0015 10.0016 10.0017 - 10.0018 10.0019 - 11 11.0001 11.0002 11.0003 11.0004 11.0005 11.0006 11.0007 11.0008 - 11.0009 11.001 11.0011 11.0012 11.0013 11.0014 11.0015 11.0016 11.0017 - 11.0018 11.0019 - 12 12.0001 12.0002 12.0003 12.0004 12.0005 12.0006 12.0007 12.0008 - 12.0009 12.001 12.0011 12.0012 12.0013 12.0014 12.0015 12.0016 12.0017 - 12.0018 12.0019 - 13 13.0001 13.0002 13.0003 13.0004 13.0005 13.0006 13.0007 13.0008 - 13.0009 13.001 13.0011 13.0012 13.0013 13.0014 13.0015 13.0016 13.0017 - 13.0018 13.0019 - 14 14.0001 14.0002 14.0003 14.0004 14.0005 14.0006 14.0007 14.0008 - 14.0009 14.001 14.0011 14.0012 14.0013 14.0014 14.0015 14.0016 14.0017 - 14.0018 14.0019 - 15 15.0001 15.0002 15.0003 15.0004 15.0005 15.0006 15.0007 15.0008 - 15.0009 15.001 15.0011 15.0012 15.0013 15.0014 15.0015 15.0016 15.0017 - 15.0018 15.0019 - 16 16.0001 16.0002 16.0003 16.0004 16.0005 16.0006 16.0007 16.0008 - 16.0009 16.001 16.0011 16.0012 16.0013 16.0014 16.0015 16.0016 16.0017 - 16.0018 16.0019 - 17 17.0001 17.0002 17.0003 17.0004 17.0005 17.0006 17.0007 17.0008 - 17.0009 17.001 17.0011 17.0012 17.0013 17.0014 17.0015 17.0016 17.0017 - 17.0018 17.0019 - 18 18.0001 18.0002 18.0003 18.0004 18.0005 18.0006 18.0007 18.0008 - 18.0009 18.001 18.0011 18.0012 18.0013 18.0014 18.0015 18.0016 18.0017 - 18.0018 18.0019 - 19 19.0001 19.0002 19.0003 19.0004 19.0005 19.0006 19.0007 19.0008 - 19.0009 19.001 19.0011 19.0012 19.0013 19.0014 19.0015 19.0016 19.0017 - 19.0018 19.0019 - 20 20.0001 20.0002 20.0003 20.0004 20.0005 20.0006 20.0007 20.0008 - 20.0009 20.001 20.0011 20.0012 20.0013 20.0014 20.0015 20.0016 20.0017 - 20.0018 20.0019 - 21 21.0001 21.0002 21.0003 21.0004 21.0005 21.0006 21.0007 21.0008 - 21.0009 21.001 21.0011 21.0012 21.0013 21.0014 21.0015 21.0016 21.0017 - 21.0018 21.0019 - 22 22.0001 22.0002 22.0003 22.0004 22.0005 22.0006 22.0007 22.0008 - 22.0009 22.001 22.0011 22.0012 22.0013 22.0014 22.0015 22.0016 22.0017 - 22.0018 22.0019 - 23 23.0001 23.0002 23.0003 23.0004 23.0005 23.0006 23.0007 23.0008 - 23.0009 23.001 23.0011 23.0012 23.0013 23.0014 23.0015 23.0016 23.0017 - 23.0018 23.0019 - 24 24.0001 24.0002 24.0003 24.0004 24.0005 24.0006 24.0007 24.0008 - 24.0009 24.001 24.0011 24.0012 24.0013 24.0014 24.0015 24.0016 24.0017 - 24.0018 24.0019 - 25 25.0001 25.0002 25.0003 25.0004 25.0005 25.0006 25.0007 25.0008 - 25.0009 25.001 25.0011 25.0012 25.0013 25.0014 25.0015 25.0016 25.0017 - 25.0018 25.0019 - 26 26.0001 26.0002 26.0003 26.0004 26.0005 26.0006 26.0007 26.0008 - 26.0009 26.001 26.0011 26.0012 26.0013 26.0014 26.0015 26.0016 26.0017 - 26.0018 26.0019 - 27 27.0001 27.0002 27.0003 27.0004 27.0005 27.0006 27.0007 27.0008 - 27.0009 27.001 27.0011 27.0012 27.0013 27.0014 27.0015 27.0016 27.0017 - 27.0018 27.0019 - 28 28.0001 28.0002 28.0003 28.0004 28.0005 28.0006 28.0007 28.0008 - 28.0009 28.001 28.0011 28.0012 28.0013 28.0014 28.0015 28.0016 28.0017 - 28.0018 28.0019 - 29 29.0001 29.0002 29.0003 29.0004 29.0005 29.0006 29.0007 29.0008 - 29.0009 29.001 29.0011 29.0012 29.0013 29.0014 29.0015 29.0016 29.0017 - 29.0018 29.0019 + 0 + 0.0001 + 0.0002 + 0.0003 + 0.0004 + 0.0005 + 0.0006 + 0.0007 + 0.0008 + 0.0009 + 0.001 + 0.0011 + 0.0012 + 0.0013 + 0.0014 + 0.0015 + 0.0016 + 0.0017 + 0.0018 + 0.0019 + 1 + 1.0001 + 1.0002 + 1.0003 + 1.0004 + 1.0005 + 1.0006 + 1.0007 + 1.0008 + 1.0009 + 1.001 + 1.0011 + 1.0012 + 1.0013 + 1.0014 + 1.0015 + 1.0016 + 1.0017 + 1.0018 + 1.0019 + 2 + 2.0001 + 2.0002 + 2.0003 + 2.0004 + 2.0005 + 2.0006 + 2.0007 + 2.0008 + 2.0009 + 2.001 + 2.0011 + 2.0012 + 2.0013 + 2.0014 + 2.0015 + 2.0016 + 2.0017 + 2.0018 + 2.0019 + 3 + 3.0001 + 3.0002 + 3.0003 + 3.0004 + 3.0005 + 3.0006 + 3.0007 + 3.0008 + 3.0009 + 3.001 + 3.0011 + 3.0012 + 3.0013 + 3.0014 + 3.0015 + 3.0016 + 3.0017 + 3.0018 + 3.0019 + 4 + 4.0001 + 4.0002 + 4.0003 + 4.0004 + 4.0005 + 4.0006 + 4.0007 + 4.0008 + 4.0009 + 4.001 + 4.0011 + 4.0012 + 4.0013 + 4.0014 + 4.0015 + 4.0016 + 4.0017 + 4.0018 + 4.0019 + 5 + 5.0001 + 5.0002 + 5.0003 + 5.0004 + 5.0005 + 5.0006 + 5.0007 + 5.0008 + 5.0009 + 5.001 + 5.0011 + 5.0012 + 5.0013 + 5.0014 + 5.0015 + 5.0016 + 5.0017 + 5.0018 + 5.0019 + 6 + 6.0001 + 6.0002 + 6.0003 + 6.0004 + 6.0005 + 6.0006 + 6.0007 + 6.0008 + 6.0009 + 6.001 + 6.0011 + 6.0012 + 6.0013 + 6.0014 + 6.0015 + 6.0016 + 6.0017 + 6.0018 + 6.0019 + 7 + 7.0001 + 7.0002 + 7.0003 + 7.0004 + 7.0005 + 7.0006 + 7.0007 + 7.0008 + 7.0009 + 7.001 + 7.0011 + 7.0012 + 7.0013 + 7.0014 + 7.0015 + 7.0016 + 7.0017 + 7.0018 + 7.0019 + 8 + 8.0001 + 8.0002 + 8.0003 + 8.0004 + 8.0005 + 8.0006 + 8.0007 + 8.0008 + 8.0009 + 8.001 + 8.0011 + 8.0012 + 8.0013 + 8.0014 + 8.0015 + 8.0016 + 8.0017 + 8.0018 + 8.0019 + 9 + 9.0001 + 9.0002 + 9.0003 + 9.0004 + 9.0005 + 9.0006 + 9.0007 + 9.0008 + 9.0009 + 9.001 + 9.0011 + 9.0012 + 9.0013 + 9.0014 + 9.0015 + 9.0016 + 9.0017 + 9.0018 + 9.0019 + 10 + 10.0001 + 10.0002 + 10.0003 + 10.0004 + 10.0005 + 10.0006 + 10.0007 + 10.0008 + 10.0009 + 10.001 + 10.0011 + 10.0012 + 10.0013 + 10.0014 + 10.0015 + 10.0016 + 10.0017 + 10.0018 + 10.0019 + 11 + 11.0001 + 11.0002 + 11.0003 + 11.0004 + 11.0005 + 11.0006 + 11.0007 + 11.0008 + 11.0009 + 11.001 + 11.0011 + 11.0012 + 11.0013 + 11.0014 + 11.0015 + 11.0016 + 11.0017 + 11.0018 + 11.0019 + 12 + 12.0001 + 12.0002 + 12.0003 + 12.0004 + 12.0005 + 12.0006 + 12.0007 + 12.0008 + 12.0009 + 12.001 + 12.0011 + 12.0012 + 12.0013 + 12.0014 + 12.0015 + 12.0016 + 12.0017 + 12.0018 + 12.0019 + 13 + 13.0001 + 13.0002 + 13.0003 + 13.0004 + 13.0005 + 13.0006 + 13.0007 + 13.0008 + 13.0009 + 13.001 + 13.0011 + 13.0012 + 13.0013 + 13.0014 + 13.0015 + 13.0016 + 13.0017 + 13.0018 + 13.0019 + 14 + 14.0001 + 14.0002 + 14.0003 + 14.0004 + 14.0005 + 14.0006 + 14.0007 + 14.0008 + 14.0009 + 14.001 + 14.0011 + 14.0012 + 14.0013 + 14.0014 + 14.0015 + 14.0016 + 14.0017 + 14.0018 + 14.0019 + 15 + 15.0001 + 15.0002 + 15.0003 + 15.0004 + 15.0005 + 15.0006 + 15.0007 + 15.0008 + 15.0009 + 15.001 + 15.0011 + 15.0012 + 15.0013 + 15.0014 + 15.0015 + 15.0016 + 15.0017 + 15.0018 + 15.0019 + 16 + 16.0001 + 16.0002 + 16.0003 + 16.0004 + 16.0005 + 16.0006 + 16.0007 + 16.0008 + 16.0009 + 16.001 + 16.0011 + 16.0012 + 16.0013 + 16.0014 + 16.0015 + 16.0016 + 16.0017 + 16.0018 + 16.0019 + 17 + 17.0001 + 17.0002 + 17.0003 + 17.0004 + 17.0005 + 17.0006 + 17.0007 + 17.0008 + 17.0009 + 17.001 + 17.0011 + 17.0012 + 17.0013 + 17.0014 + 17.0015 + 17.0016 + 17.0017 + 17.0018 + 17.0019 + 18 + 18.0001 + 18.0002 + 18.0003 + 18.0004 + 18.0005 + 18.0006 + 18.0007 + 18.0008 + 18.0009 + 18.001 + 18.0011 + 18.0012 + 18.0013 + 18.0014 + 18.0015 + 18.0016 + 18.0017 + 18.0018 + 18.0019 + 19 + 19.0001 + 19.0002 + 19.0003 + 19.0004 + 19.0005 + 19.0006 + 19.0007 + 19.0008 + 19.0009 + 19.001 + 19.0011 + 19.0012 + 19.0013 + 19.0014 + 19.0015 + 19.0016 + 19.0017 + 19.0018 + 19.0019 + 20 + 20.0001 + 20.0002 + 20.0003 + 20.0004 + 20.0005 + 20.0006 + 20.0007 + 20.0008 + 20.0009 + 20.001 + 20.0011 + 20.0012 + 20.0013 + 20.0014 + 20.0015 + 20.0016 + 20.0017 + 20.0018 + 20.0019 + 21 + 21.0001 + 21.0002 + 21.0003 + 21.0004 + 21.0005 + 21.0006 + 21.0007 + 21.0008 + 21.0009 + 21.001 + 21.0011 + 21.0012 + 21.0013 + 21.0014 + 21.0015 + 21.0016 + 21.0017 + 21.0018 + 21.0019 + 22 + 22.0001 + 22.0002 + 22.0003 + 22.0004 + 22.0005 + 22.0006 + 22.0007 + 22.0008 + 22.0009 + 22.001 + 22.0011 + 22.0012 + 22.0013 + 22.0014 + 22.0015 + 22.0016 + 22.0017 + 22.0018 + 22.0019 + 23 + 23.0001 + 23.0002 + 23.0003 + 23.0004 + 23.0005 + 23.0006 + 23.0007 + 23.0008 + 23.0009 + 23.001 + 23.0011 + 23.0012 + 23.0013 + 23.0014 + 23.0015 + 23.0016 + 23.0017 + 23.0018 + 23.0019 + 24 + 24.0001 + 24.0002 + 24.0003 + 24.0004 + 24.0005 + 24.0006 + 24.0007 + 24.0008 + 24.0009 + 24.001 + 24.0011 + 24.0012 + 24.0013 + 24.0014 + 24.0015 + 24.0016 + 24.0017 + 24.0018 + 24.0019 + 25 + 25.0001 + 25.0002 + 25.0003 + 25.0004 + 25.0005 + 25.0006 + 25.0007 + 25.0008 + 25.0009 + 25.001 + 25.0011 + 25.0012 + 25.0013 + 25.0014 + 25.0015 + 25.0016 + 25.0017 + 25.0018 + 25.0019 + 26 + 26.0001 + 26.0002 + 26.0003 + 26.0004 + 26.0005 + 26.0006 + 26.0007 + 26.0008 + 26.0009 + 26.001 + 26.0011 + 26.0012 + 26.0013 + 26.0014 + 26.0015 + 26.0016 + 26.0017 + 26.0018 + 26.0019 + 27 + 27.0001 + 27.0002 + 27.0003 + 27.0004 + 27.0005 + 27.0006 + 27.0007 + 27.0008 + 27.0009 + 27.001 + 27.0011 + 27.0012 + 27.0013 + 27.0014 + 27.0015 + 27.0016 + 27.0017 + 27.0018 + 27.0019 + 28 + 28.0001 + 28.0002 + 28.0003 + 28.0004 + 28.0005 + 28.0006 + 28.0007 + 28.0008 + 28.0009 + 28.001 + 28.0011 + 28.0012 + 28.0013 + 28.0014 + 28.0015 + 28.0016 + 28.0017 + 28.0018 + 28.0019 + 29 + 29.0001 + 29.0002 + 29.0003 + 29.0004 + 29.0005 + 29.0006 + 29.0007 + 29.0008 + 29.0009 + 29.001 + 29.0011 + 29.0012 + 29.0013 + 29.0014 + 29.0015 + 29.0016 + 29.0017 + 29.0018 + 29.0019 diff --git a/tools/testfiles/tdset2.h5.xml b/tools/testfiles/tdset2.h5.xml index 3bcaef0..34f43e1 100644 --- a/tools/testfiles/tdset2.h5.xml +++ b/tools/testfiles/tdset2.h5.xml @@ -1,8 +1,5 @@ -############################# -Expected output for 'h5dump --xml tdset2.h5' -############################# - + @@ -15,7 +12,7 @@ Expected output for 'h5dump --xml tdset2.h5' - + @@ -31,16 +28,206 @@ Expected output for 'h5dump --xml tdset2.h5' - 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 - 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 - 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 - 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 - 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 - 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 - 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 - 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 - 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 - 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 @@ -55,7 +242,7 @@ Expected output for 'h5dump --xml tdset2.h5' - + @@ -71,36 +258,306 @@ Expected output for 'h5dump --xml tdset2.h5' - 0 1 2 3 4 5 6 7 8 9 - 0 1 2 3 4 5 6 7 8 9 - 0 1 2 3 4 5 6 7 8 9 - 0 1 2 3 4 5 6 7 8 9 - 0 1 2 3 4 5 6 7 8 9 - 0 1 2 3 4 5 6 7 8 9 - 0 1 2 3 4 5 6 7 8 9 - 0 1 2 3 4 5 6 7 8 9 - 0 1 2 3 4 5 6 7 8 9 - 0 1 2 3 4 5 6 7 8 9 - 0 1 2 3 4 5 6 7 8 9 - 0 1 2 3 4 5 6 7 8 9 - 0 1 2 3 4 5 6 7 8 9 - 0 1 2 3 4 5 6 7 8 9 - 0 1 2 3 4 5 6 7 8 9 - 0 1 2 3 4 5 6 7 8 9 - 0 1 2 3 4 5 6 7 8 9 - 0 1 2 3 4 5 6 7 8 9 - 0 1 2 3 4 5 6 7 8 9 - 0 1 2 3 4 5 6 7 8 9 - 0 1 2 3 4 5 6 7 8 9 - 0 1 2 3 4 5 6 7 8 9 - 0 1 2 3 4 5 6 7 8 9 - 0 1 2 3 4 5 6 7 8 9 - 0 1 2 3 4 5 6 7 8 9 - 0 1 2 3 4 5 6 7 8 9 - 0 1 2 3 4 5 6 7 8 9 - 0 1 2 3 4 5 6 7 8 9 - 0 1 2 3 4 5 6 7 8 9 - 0 1 2 3 4 5 6 7 8 9 + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 diff --git a/tools/testfiles/tdset_idx.ls b/tools/testfiles/tdset_idx.ls index 4e6f3b5..daa14b2 100644 --- a/tools/testfiles/tdset_idx.ls +++ b/tools/testfiles/tdset_idx.ls @@ -1,6 +1,3 @@ -############################# - output for 'h5ls -w80 -d tdset_idx.h5' -############################# dset_btree Dataset {20/200, 10/100} Data: (0,0) 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, diff --git a/tools/testfiles/tempty-dtd-2.h5.xml b/tools/testfiles/tempty-dtd-2.h5.xml index bf5a5d2..a9b1d4f 100644 --- a/tools/testfiles/tempty-dtd-2.h5.xml +++ b/tools/testfiles/tempty-dtd-2.h5.xml @@ -1,17 +1,14 @@ -############################# -Expected output for 'h5dump --xml -u tempty.h5' -############################# - + - + - + @@ -31,7 +28,10 @@ Expected output for 'h5dump --xml -u tempty.h5' - + + + + @@ -39,9 +39,9 @@ Expected output for 'h5dump --xml -u tempty.h5' - + - + @@ -56,7 +56,10 @@ Expected output for 'h5dump --xml -u tempty.h5' - 0 0 0 0 + 0 + 0 + 0 + 0 @@ -64,9 +67,9 @@ Expected output for 'h5dump --xml -u tempty.h5' - + - + @@ -81,7 +84,10 @@ Expected output for 'h5dump --xml -u tempty.h5' - 0 0 0 0 + 0 + 0 + 0 + 0 @@ -89,9 +95,9 @@ Expected output for 'h5dump --xml -u tempty.h5' - + - + @@ -111,7 +117,10 @@ Expected output for 'h5dump --xml -u tempty.h5' - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 + 0 0 0 0 + 0 0 0 0 + 0 0 0 0 @@ -119,9 +128,9 @@ Expected output for 'h5dump --xml -u tempty.h5' - + - + @@ -157,7 +166,10 @@ Expected output for 'h5dump --xml -u tempty.h5' - 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 + 0 0 0 + 0 0 0 + 0 0 0 diff --git a/tools/testfiles/tempty-dtd-uri.h5.xml b/tools/testfiles/tempty-dtd-uri.h5.xml index 29c63bd..d3c5e81 100644 --- a/tools/testfiles/tempty-dtd-uri.h5.xml +++ b/tools/testfiles/tempty-dtd-uri.h5.xml @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump --xml --use-dtd --xml-dtd=http://somewhere.net tempty.h5' -############################# @@ -9,9 +6,9 @@ Expected output for 'h5dump --xml --use-dtd --xml-dtd=http://somewhere.net tempt - + - + @@ -31,7 +28,10 @@ Expected output for 'h5dump --xml --use-dtd --xml-dtd=http://somewhere.net tempt - + + + + @@ -39,9 +39,9 @@ Expected output for 'h5dump --xml --use-dtd --xml-dtd=http://somewhere.net tempt - + - + @@ -56,7 +56,10 @@ Expected output for 'h5dump --xml --use-dtd --xml-dtd=http://somewhere.net tempt - 0 0 0 0 + 0 + 0 + 0 + 0 @@ -64,9 +67,9 @@ Expected output for 'h5dump --xml --use-dtd --xml-dtd=http://somewhere.net tempt - + - + @@ -81,7 +84,10 @@ Expected output for 'h5dump --xml --use-dtd --xml-dtd=http://somewhere.net tempt - 0 0 0 0 + 0 + 0 + 0 + 0 @@ -89,9 +95,9 @@ Expected output for 'h5dump --xml --use-dtd --xml-dtd=http://somewhere.net tempt - + - + @@ -111,7 +117,10 @@ Expected output for 'h5dump --xml --use-dtd --xml-dtd=http://somewhere.net tempt - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 + 0 0 0 0 + 0 0 0 0 + 0 0 0 0 @@ -119,9 +128,9 @@ Expected output for 'h5dump --xml --use-dtd --xml-dtd=http://somewhere.net tempt - + - + @@ -157,7 +166,10 @@ Expected output for 'h5dump --xml --use-dtd --xml-dtd=http://somewhere.net tempt - 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 + 0 0 0 + 0 0 0 + 0 0 0 diff --git a/tools/testfiles/tempty-dtd.h5.xml b/tools/testfiles/tempty-dtd.h5.xml index 8d15505..a9b1d4f 100644 --- a/tools/testfiles/tempty-dtd.h5.xml +++ b/tools/testfiles/tempty-dtd.h5.xml @@ -1,17 +1,14 @@ -############################# -Expected output for 'h5dump --xml --use-dtd tempty.h5' -############################# - + - + - + @@ -31,7 +28,10 @@ Expected output for 'h5dump --xml --use-dtd tempty.h5' - + + + + @@ -39,9 +39,9 @@ Expected output for 'h5dump --xml --use-dtd tempty.h5' - + - + @@ -56,7 +56,10 @@ Expected output for 'h5dump --xml --use-dtd tempty.h5' - 0 0 0 0 + 0 + 0 + 0 + 0 @@ -64,9 +67,9 @@ Expected output for 'h5dump --xml --use-dtd tempty.h5' - + - + @@ -81,7 +84,10 @@ Expected output for 'h5dump --xml --use-dtd tempty.h5' - 0 0 0 0 + 0 + 0 + 0 + 0 @@ -89,9 +95,9 @@ Expected output for 'h5dump --xml --use-dtd tempty.h5' - + - + @@ -111,7 +117,10 @@ Expected output for 'h5dump --xml --use-dtd tempty.h5' - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 + 0 0 0 0 + 0 0 0 0 + 0 0 0 0 @@ -119,9 +128,9 @@ Expected output for 'h5dump --xml --use-dtd tempty.h5' - + - + @@ -157,7 +166,10 @@ Expected output for 'h5dump --xml --use-dtd tempty.h5' - 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 + 0 0 0 + 0 0 0 + 0 0 0 diff --git a/tools/testfiles/tempty-nons-2.h5.xml b/tools/testfiles/tempty-nons-2.h5.xml index c9dc971..219dbfd 100644 --- a/tools/testfiles/tempty-nons-2.h5.xml +++ b/tools/testfiles/tempty-nons-2.h5.xml @@ -1,16 +1,13 @@ -############################# -Expected output for 'h5dump --xml --xml-ns=: tempty.h5' -############################# - + - + - + @@ -30,7 +27,10 @@ Expected output for 'h5dump --xml --xml-ns=: tempty.h5' - + + + + @@ -38,9 +38,9 @@ Expected output for 'h5dump --xml --xml-ns=: tempty.h5' - + - + @@ -55,7 +55,10 @@ Expected output for 'h5dump --xml --xml-ns=: tempty.h5' - 0 0 0 0 + 0 + 0 + 0 + 0 @@ -63,9 +66,9 @@ Expected output for 'h5dump --xml --xml-ns=: tempty.h5' - + - + @@ -80,7 +83,10 @@ Expected output for 'h5dump --xml --xml-ns=: tempty.h5' - 0 0 0 0 + 0 + 0 + 0 + 0 @@ -88,9 +94,9 @@ Expected output for 'h5dump --xml --xml-ns=: tempty.h5' - + - + @@ -110,7 +116,10 @@ Expected output for 'h5dump --xml --xml-ns=: tempty.h5' - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 + 0 0 0 0 + 0 0 0 0 + 0 0 0 0 @@ -118,9 +127,9 @@ Expected output for 'h5dump --xml --xml-ns=: tempty.h5' - + - + @@ -156,7 +165,10 @@ Expected output for 'h5dump --xml --xml-ns=: tempty.h5' - 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 + 0 0 0 + 0 0 0 + 0 0 0 diff --git a/tools/testfiles/tempty-nons-uri.h5.xml b/tools/testfiles/tempty-nons-uri.h5.xml index 05471e1..032de41 100644 --- a/tools/testfiles/tempty-nons-uri.h5.xml +++ b/tools/testfiles/tempty-nons-uri.h5.xml @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump --xml --xml-ns=: --xml-dtd=http://somewhere.net tempty.h5' -############################# @@ -8,9 +5,9 @@ Expected output for 'h5dump --xml --xml-ns=: --xml-dtd=http://somewhere.net temp - + - + @@ -30,7 +27,10 @@ Expected output for 'h5dump --xml --xml-ns=: --xml-dtd=http://somewhere.net temp - + + + + @@ -38,9 +38,9 @@ Expected output for 'h5dump --xml --xml-ns=: --xml-dtd=http://somewhere.net temp - + - + @@ -55,7 +55,10 @@ Expected output for 'h5dump --xml --xml-ns=: --xml-dtd=http://somewhere.net temp - 0 0 0 0 + 0 + 0 + 0 + 0 @@ -63,9 +66,9 @@ Expected output for 'h5dump --xml --xml-ns=: --xml-dtd=http://somewhere.net temp - + - + @@ -80,7 +83,10 @@ Expected output for 'h5dump --xml --xml-ns=: --xml-dtd=http://somewhere.net temp - 0 0 0 0 + 0 + 0 + 0 + 0 @@ -88,9 +94,9 @@ Expected output for 'h5dump --xml --xml-ns=: --xml-dtd=http://somewhere.net temp - + - + @@ -110,7 +116,10 @@ Expected output for 'h5dump --xml --xml-ns=: --xml-dtd=http://somewhere.net temp - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 + 0 0 0 0 + 0 0 0 0 + 0 0 0 0 @@ -118,9 +127,9 @@ Expected output for 'h5dump --xml --xml-ns=: --xml-dtd=http://somewhere.net temp - + - + @@ -156,7 +165,10 @@ Expected output for 'h5dump --xml --xml-ns=: --xml-dtd=http://somewhere.net temp - 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 + 0 0 0 + 0 0 0 + 0 0 0 diff --git a/tools/testfiles/tempty-nons.h5.xml b/tools/testfiles/tempty-nons.h5.xml index 25536d9..219dbfd 100644 --- a/tools/testfiles/tempty-nons.h5.xml +++ b/tools/testfiles/tempty-nons.h5.xml @@ -1,16 +1,13 @@ -############################# -Expected output for 'h5dump --xml -X : tempty.h5' -############################# - + - + - + @@ -30,7 +27,10 @@ Expected output for 'h5dump --xml -X : tempty.h5' - + + + + @@ -38,9 +38,9 @@ Expected output for 'h5dump --xml -X : tempty.h5' - + - + @@ -55,7 +55,10 @@ Expected output for 'h5dump --xml -X : tempty.h5' - 0 0 0 0 + 0 + 0 + 0 + 0 @@ -63,9 +66,9 @@ Expected output for 'h5dump --xml -X : tempty.h5' - + - + @@ -80,7 +83,10 @@ Expected output for 'h5dump --xml -X : tempty.h5' - 0 0 0 0 + 0 + 0 + 0 + 0 @@ -88,9 +94,9 @@ Expected output for 'h5dump --xml -X : tempty.h5' - + - + @@ -110,7 +116,10 @@ Expected output for 'h5dump --xml -X : tempty.h5' - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 + 0 0 0 0 + 0 0 0 0 + 0 0 0 0 @@ -118,9 +127,9 @@ Expected output for 'h5dump --xml -X : tempty.h5' - + - + @@ -156,7 +165,10 @@ Expected output for 'h5dump --xml -X : tempty.h5' - 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 + 0 0 0 + 0 0 0 + 0 0 0 diff --git a/tools/testfiles/tempty-ns-2.h5.xml b/tools/testfiles/tempty-ns-2.h5.xml index 4851e5c..3476b60 100644 --- a/tools/testfiles/tempty-ns-2.h5.xml +++ b/tools/testfiles/tempty-ns-2.h5.xml @@ -1,16 +1,13 @@ -############################# -Expected output for 'h5dump --xml --xml-ns=thing: tempty.h5' -############################# - + - + - + @@ -30,7 +27,10 @@ Expected output for 'h5dump --xml --xml-ns=thing: tempty.h5' - + + + + @@ -38,9 +38,9 @@ Expected output for 'h5dump --xml --xml-ns=thing: tempty.h5' - + - + @@ -55,7 +55,10 @@ Expected output for 'h5dump --xml --xml-ns=thing: tempty.h5' - 0 0 0 0 + 0 + 0 + 0 + 0 @@ -63,9 +66,9 @@ Expected output for 'h5dump --xml --xml-ns=thing: tempty.h5' - + - + @@ -80,7 +83,10 @@ Expected output for 'h5dump --xml --xml-ns=thing: tempty.h5' - 0 0 0 0 + 0 + 0 + 0 + 0 @@ -88,9 +94,9 @@ Expected output for 'h5dump --xml --xml-ns=thing: tempty.h5' - + - + @@ -110,7 +116,10 @@ Expected output for 'h5dump --xml --xml-ns=thing: tempty.h5' - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 + 0 0 0 0 + 0 0 0 0 + 0 0 0 0 @@ -118,9 +127,9 @@ Expected output for 'h5dump --xml --xml-ns=thing: tempty.h5' - + - + @@ -156,7 +165,10 @@ Expected output for 'h5dump --xml --xml-ns=thing: tempty.h5' - 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 + 0 0 0 + 0 0 0 + 0 0 0 diff --git a/tools/testfiles/tempty-ns.h5.xml b/tools/testfiles/tempty-ns.h5.xml index 01ae896..3476b60 100644 --- a/tools/testfiles/tempty-ns.h5.xml +++ b/tools/testfiles/tempty-ns.h5.xml @@ -1,16 +1,13 @@ -############################# -Expected output for 'h5dump --xml -X thing: tempty.h5' -############################# - + - + - + @@ -30,7 +27,10 @@ Expected output for 'h5dump --xml -X thing: tempty.h5' - + + + + @@ -38,9 +38,9 @@ Expected output for 'h5dump --xml -X thing: tempty.h5' - + - + @@ -55,7 +55,10 @@ Expected output for 'h5dump --xml -X thing: tempty.h5' - 0 0 0 0 + 0 + 0 + 0 + 0 @@ -63,9 +66,9 @@ Expected output for 'h5dump --xml -X thing: tempty.h5' - + - + @@ -80,7 +83,10 @@ Expected output for 'h5dump --xml -X thing: tempty.h5' - 0 0 0 0 + 0 + 0 + 0 + 0 @@ -88,9 +94,9 @@ Expected output for 'h5dump --xml -X thing: tempty.h5' - + - + @@ -110,7 +116,10 @@ Expected output for 'h5dump --xml -X thing: tempty.h5' - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 + 0 0 0 0 + 0 0 0 0 + 0 0 0 0 @@ -118,9 +127,9 @@ Expected output for 'h5dump --xml -X thing: tempty.h5' - + - + @@ -156,7 +165,10 @@ Expected output for 'h5dump --xml -X thing: tempty.h5' - 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 + 0 0 0 + 0 0 0 + 0 0 0 diff --git a/tools/testfiles/tempty.ddl b/tools/testfiles/tempty.ddl index d6eadd2..0c24334 100644 --- a/tools/testfiles/tempty.ddl +++ b/tools/testfiles/tempty.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump tempty.h5' -############################# HDF5 "tempty.h5" { GROUP "/" { DATASET "Dataset1.0" { diff --git a/tools/testfiles/tempty.h5.xml b/tools/testfiles/tempty.h5.xml index 4ff8c95..d75bc70 100644 --- a/tools/testfiles/tempty.h5.xml +++ b/tools/testfiles/tempty.h5.xml @@ -1,16 +1,13 @@ -############################# -Expected output for 'h5dump --xml tempty.h5' -############################# - + - + - + @@ -30,7 +27,10 @@ Expected output for 'h5dump --xml tempty.h5' - + + + + @@ -38,9 +38,9 @@ Expected output for 'h5dump --xml tempty.h5' - + - + @@ -55,7 +55,10 @@ Expected output for 'h5dump --xml tempty.h5' - 0 0 0 0 + 0 + 0 + 0 + 0 @@ -63,9 +66,9 @@ Expected output for 'h5dump --xml tempty.h5' - + - + @@ -80,7 +83,10 @@ Expected output for 'h5dump --xml tempty.h5' - 0 0 0 0 + 0 + 0 + 0 + 0 @@ -88,9 +94,9 @@ Expected output for 'h5dump --xml tempty.h5' - + - + @@ -110,7 +116,10 @@ Expected output for 'h5dump --xml tempty.h5' - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 + 0 0 0 0 + 0 0 0 0 + 0 0 0 0 @@ -118,9 +127,9 @@ Expected output for 'h5dump --xml tempty.h5' - + - + @@ -156,7 +165,10 @@ Expected output for 'h5dump --xml tempty.h5' - 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 + 0 0 0 + 0 0 0 + 0 0 0 diff --git a/tools/testfiles/tempty.ls b/tools/testfiles/tempty.ls index 96ea64a..38ecb55 100644 --- a/tools/testfiles/tempty.ls +++ b/tools/testfiles/tempty.ls @@ -1,6 +1,3 @@ -############################# - output for 'h5ls -w80 -d tempty.h5' -############################# Dataset1.0 Dataset {4} Data: (0) (), (), (), () diff --git a/tools/testfiles/tenum.h5.xml b/tools/testfiles/tenum.h5.xml index d8adc1b..ecc7804 100644 --- a/tools/testfiles/tenum.h5.xml +++ b/tools/testfiles/tenum.h5.xml @@ -1,8 +1,5 @@ -############################# -Expected output for 'h5dump --xml tenum.h5' -############################# - + @@ -52,9 +49,9 @@ green - + - + @@ -65,10 +62,26 @@ green - RED GREEN\ngreen BLUE blue GREEN\ngreen WHITE \"white\" WHITE \"white\" - BLACK \'black\' GREEN\ngreen BLUE blue RED RED BLUE blue GREEN\ngreen - BLACK \'black\' WHITE \"white\" RED WHITE \"white\" GREEN\ngreen - GREEN\ngreen BLUE blue + RED + GREEN\ngreen + BLUE blue + GREEN\ngreen + WHITE \"white\" + WHITE \"white\" + BLACK \'black\' + GREEN\ngreen + BLUE blue + RED + RED + BLUE blue + GREEN\ngreen + BLACK \'black\' + WHITE \"white\" + RED + WHITE \"white\" + GREEN\ngreen + GREEN\ngreen + BLUE blue diff --git a/tools/testfiles/texternal.ddl b/tools/testfiles/texternal.ddl index 21b3b7a..279831a 100644 --- a/tools/testfiles/texternal.ddl +++ b/tools/testfiles/texternal.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump -H -p -d external tfilters.h5' -############################# HDF5 "tfilters.h5" { DATASET "external" { DATATYPE H5T_STD_I32LE @@ -17,7 +14,7 @@ DATASET "external" { } FILLVALUE { FILL_TIME H5D_FILL_TIME_IFSET - VALUE 0 + VALUE 0 } ALLOCATION_TIME { H5D_ALLOC_TIME_LATE diff --git a/tools/testfiles/textlink-1.ls b/tools/testfiles/textlink-1.ls index c159483..a49001f 100644 --- a/tools/testfiles/textlink-1.ls +++ b/tools/testfiles/textlink-1.ls @@ -1,6 +1,3 @@ -############################# - output for 'h5ls -w80 -r textlink.h5' -############################# / Group /extlink1 External Link {filename//objname} /extlink2 External Link {anotherfile//anotherobj} diff --git a/tools/testfiles/textlink.ddl b/tools/testfiles/textlink.ddl index 0a43c47..4718adb 100644 --- a/tools/testfiles/textlink.ddl +++ b/tools/testfiles/textlink.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump textlink.h5' -############################# HDF5 "textlink.h5" { GROUP "/" { EXTERNAL_LINK "extlink1" { @@ -13,3 +10,53 @@ GROUP "/" { } } } +HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): + #000: (file name) line (number) in H5Oopen(): unable to open object + major: Symbol table + minor: Can't open object + #001: (file name) line (number) in H5O_open_name(): object not found + major: Symbol table + minor: Object not found + #002: (file name) line (number) in H5G_loc_find(): can't find object + major: Symbol table + minor: Object not found + #003: (file name) line (number) in H5G_traverse(): internal path traversal failed + major: Symbol table + minor: Object not found + #004: (file name) line (number) in H5G_traverse_real(): special link traversal failed + major: Links + minor: Link traversal failure + #005: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed + major: Links + minor: Link traversal failure + #006: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + major: Symbol table + minor: Unable to find atom information (already closed?) + #007: (file name) line (number) in H5L_extern_traverse(): unable to open external file, external link file name = 'filename', temp_file_name = 'filename' + major: Links + minor: Unable to open file +HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): + #000: (file name) line (number) in H5Oopen(): unable to open object + major: Symbol table + minor: Can't open object + #001: (file name) line (number) in H5O_open_name(): object not found + major: Symbol table + minor: Object not found + #002: (file name) line (number) in H5G_loc_find(): can't find object + major: Symbol table + minor: Object not found + #003: (file name) line (number) in H5G_traverse(): internal path traversal failed + major: Symbol table + minor: Object not found + #004: (file name) line (number) in H5G_traverse_real(): special link traversal failed + major: Links + minor: Link traversal failure + #005: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed + major: Links + minor: Link traversal failure + #006: (file name) line (number) in H5G_traverse_ud(): traversal callback returned invalid ID + major: Symbol table + minor: Unable to find atom information (already closed?) + #007: (file name) line (number) in H5L_extern_traverse(): unable to open external file, external link file name = 'anotherfile', temp_file_name = 'anotherfile' + major: Links + minor: Unable to open file diff --git a/tools/testfiles/textlink.h5.xml b/tools/testfiles/textlink.h5.xml index f6666a8..f6c7ff6 100644 --- a/tools/testfiles/textlink.h5.xml +++ b/tools/testfiles/textlink.h5.xml @@ -1,8 +1,5 @@ -############################# -Expected output for 'h5dump --xml textlink.h5' -############################# - + diff --git a/tools/testfiles/textlinkfar.ddl b/tools/testfiles/textlinkfar.ddl index 4151710..32b2b49 100644 --- a/tools/testfiles/textlinkfar.ddl +++ b/tools/testfiles/textlinkfar.ddl @@ -1,12 +1,27 @@ -############################# -Expected output for 'h5dump textlinkfar.h5' -############################# HDF5 "textlinkfar.h5" { GROUP "/" { EXTERNAL_LINK "src_file" { TARGETFILE "textlinksrc.h5" TARGETPATH "/" GROUP "/" { + EXTERNAL_LINK "ext2soft_link1" { + TARGETFILE "tsoftlinks.h5" + TARGETPATH "/soft_dset1" + DATASET "/soft_dset1" { + DATATYPE H5T_STD_I32BE + DATASPACE SIMPLE { ( 4, 2 ) / ( 4, 2 ) } + DATA { + (0,0): 0, 0, + (1,0): 1, 1, + (2,0): 2, 2, + (3,0): 3, 3 + } + } + } + EXTERNAL_LINK "ext2softdangle_link1" { + TARGETFILE "tsoftlinks.h5" + TARGETPATH "/soft_dangle" + } EXTERNAL_LINK "ext_link1" { TARGETFILE "textlinktar.h5" TARGETPATH "group" @@ -51,7 +66,6 @@ GROUP "/" { TARGETFILE "textlinktar.h5" TARGETPATH "type" DATATYPE "type" H5T_STD_I32LE; - } EXTERNAL_LINK "ext_link4" { TARGETFILE "textlinktar.h5" diff --git a/tools/testfiles/textlinksrc-1-old.ls b/tools/testfiles/textlinksrc-1-old.ls index 5e81dec..ef26cc4 100644 --- a/tools/testfiles/textlinksrc-1-old.ls +++ b/tools/testfiles/textlinksrc-1-old.ls @@ -1,10 +1,11 @@ -############################# - output for 'h5ls -w80 -Er textlinksrc.h5' -############################# / Group +/ext2soft_link1 External Link {tsoftlinks.h5//soft_dset1} {Dataset {4, 2}} +/ext2softdangle_link1 External Link {tsoftlinks.h5//soft_dangle} {**NOT FOUND**} /ext_link1 External Link {textlinktar.h5//group} {Group} /ext_link1/dset Dataset {6} /ext_link1/elink_t1 External Link {textlinksrc.h5//} {Group} +/ext_link1/elink_t1/ext2soft_link1 External Link {tsoftlinks.h5//soft_dset1} {Already Visited} +/ext_link1/elink_t1/ext2softdangle_link1 External Link {tsoftlinks.h5//soft_dangle} {Already Visited} /ext_link1/elink_t1/ext_link1 External Link {textlinktar.h5//group} {Already Visited} /ext_link1/elink_t1/ext_link2 External Link {textlinktar.h5//dset} {Dataset {6}} /ext_link1/elink_t1/ext_link3 External Link {textlinktar.h5//type} {Type} diff --git a/tools/testfiles/textlinksrc-1.ls b/tools/testfiles/textlinksrc-1.ls index f39eec9..ef26cc4 100644 --- a/tools/testfiles/textlinksrc-1.ls +++ b/tools/testfiles/textlinksrc-1.ls @@ -1,10 +1,11 @@ -############################# - output for 'h5ls -w80 --follow-symlinks -r textlinksrc.h5' -############################# / Group +/ext2soft_link1 External Link {tsoftlinks.h5//soft_dset1} {Dataset {4, 2}} +/ext2softdangle_link1 External Link {tsoftlinks.h5//soft_dangle} {**NOT FOUND**} /ext_link1 External Link {textlinktar.h5//group} {Group} /ext_link1/dset Dataset {6} /ext_link1/elink_t1 External Link {textlinksrc.h5//} {Group} +/ext_link1/elink_t1/ext2soft_link1 External Link {tsoftlinks.h5//soft_dset1} {Already Visited} +/ext_link1/elink_t1/ext2softdangle_link1 External Link {tsoftlinks.h5//soft_dangle} {Already Visited} /ext_link1/elink_t1/ext_link1 External Link {textlinktar.h5//group} {Already Visited} /ext_link1/elink_t1/ext_link2 External Link {textlinktar.h5//dset} {Dataset {6}} /ext_link1/elink_t1/ext_link3 External Link {textlinktar.h5//type} {Type} diff --git a/tools/testfiles/textlinksrc-2-old.ls b/tools/testfiles/textlinksrc-2-old.ls index 403a1d2..a3044dd 100644 --- a/tools/testfiles/textlinksrc-2-old.ls +++ b/tools/testfiles/textlinksrc-2-old.ls @@ -1,6 +1,3 @@ -############################# - output for 'h5ls -w80 -Erv textlinksrc.h5/ext_link5' -############################# Opened "textlinksrc.h5" with sec2 driver. ext_link5 External Link {textlinktar.h5//empty_group} {Group Location: 5:1832 diff --git a/tools/testfiles/textlinksrc-2.ls b/tools/testfiles/textlinksrc-2.ls index 1e92f59..a3044dd 100644 --- a/tools/testfiles/textlinksrc-2.ls +++ b/tools/testfiles/textlinksrc-2.ls @@ -1,6 +1,3 @@ -############################# - output for 'h5ls -w80 --follow-symlinks -rv textlinksrc.h5/ext_link5' -############################# Opened "textlinksrc.h5" with sec2 driver. ext_link5 External Link {textlinktar.h5//empty_group} {Group Location: 5:1832 diff --git a/tools/testfiles/textlinksrc-3-old.ls b/tools/testfiles/textlinksrc-3-old.ls index a86ca32..75f3421 100644 --- a/tools/testfiles/textlinksrc-3-old.ls +++ b/tools/testfiles/textlinksrc-3-old.ls @@ -1,9 +1,8 @@ -############################# - output for 'h5ls -w80 -Er textlinksrc.h5/ext_link1' -############################# ext_link1 External Link {textlinktar.h5//group} {Group} /dset Dataset {6} /elink_t1 External Link {textlinksrc.h5//} {Group} +/elink_t1/ext2soft_link1 External Link {tsoftlinks.h5//soft_dset1} {Dataset {4, 2}} +/elink_t1/ext2softdangle_link1 External Link {tsoftlinks.h5//soft_dangle} {**NOT FOUND**} /elink_t1/ext_link1 External Link {textlinktar.h5//group} {Already Visited} /elink_t1/ext_link2 External Link {textlinktar.h5//dset} {Dataset {6}} /elink_t1/ext_link3 External Link {textlinktar.h5//type} {Type} diff --git a/tools/testfiles/textlinksrc-3.ls b/tools/testfiles/textlinksrc-3.ls index bd173f3..75f3421 100644 --- a/tools/testfiles/textlinksrc-3.ls +++ b/tools/testfiles/textlinksrc-3.ls @@ -1,9 +1,8 @@ -############################# - output for 'h5ls -w80 --follow-symlinks -r textlinksrc.h5/ext_link1' -############################# ext_link1 External Link {textlinktar.h5//group} {Group} /dset Dataset {6} /elink_t1 External Link {textlinksrc.h5//} {Group} +/elink_t1/ext2soft_link1 External Link {tsoftlinks.h5//soft_dset1} {Dataset {4, 2}} +/elink_t1/ext2softdangle_link1 External Link {tsoftlinks.h5//soft_dangle} {**NOT FOUND**} /elink_t1/ext_link1 External Link {textlinktar.h5//group} {Already Visited} /elink_t1/ext_link2 External Link {textlinktar.h5//dset} {Dataset {6}} /elink_t1/ext_link3 External Link {textlinktar.h5//type} {Type} diff --git a/tools/testfiles/textlinksrc-4.ls b/tools/testfiles/textlinksrc-4.ls index f440d9c..449830f 100644 --- a/tools/testfiles/textlinksrc-4.ls +++ b/tools/testfiles/textlinksrc-4.ls @@ -1,7 +1,6 @@ -############################# - output for 'h5ls -w80 -r textlinksrc.h5' -############################# / Group +/ext2soft_link1 External Link {tsoftlinks.h5//soft_dset1} +/ext2softdangle_link1 External Link {tsoftlinks.h5//soft_dangle} /ext_link1 External Link {textlinktar.h5//group} /ext_link2 External Link {textlinktar.h5//dset} /ext_link3 External Link {textlinktar.h5//type} diff --git a/tools/testfiles/textlinksrc-5.ls b/tools/testfiles/textlinksrc-5.ls index a1d61d7..8cba586 100644 --- a/tools/testfiles/textlinksrc-5.ls +++ b/tools/testfiles/textlinksrc-5.ls @@ -1,4 +1 @@ -############################# - output for 'h5ls -w80 -r textlinksrc.h5/ext_link1' -############################# ext_link1 External Link {textlinktar.h5//group} diff --git a/tools/testfiles/textlinksrc-6-old.ls b/tools/testfiles/textlinksrc-6-old.ls index e1b8b74..ae70721 100644 --- a/tools/testfiles/textlinksrc-6-old.ls +++ b/tools/testfiles/textlinksrc-6-old.ls @@ -1,6 +1,5 @@ -############################# - output for 'h5ls -w80 -E textlinksrc.h5' -############################# +ext2soft_link1 External Link {tsoftlinks.h5//soft_dset1} {Dataset {4, 2}} +ext2softdangle_link1 External Link {tsoftlinks.h5//soft_dangle} {**NOT FOUND**} ext_link1 External Link {textlinktar.h5//group} {Group} ext_link2 External Link {textlinktar.h5//dset} {Dataset {6}} ext_link3 External Link {textlinktar.h5//type} {Type} diff --git a/tools/testfiles/textlinksrc-6.ls b/tools/testfiles/textlinksrc-6.ls index 6cda888..ae70721 100644 --- a/tools/testfiles/textlinksrc-6.ls +++ b/tools/testfiles/textlinksrc-6.ls @@ -1,6 +1,5 @@ -############################# - output for 'h5ls -w80 --follow-symlinks textlinksrc.h5' -############################# +ext2soft_link1 External Link {tsoftlinks.h5//soft_dset1} {Dataset {4, 2}} +ext2softdangle_link1 External Link {tsoftlinks.h5//soft_dangle} {**NOT FOUND**} ext_link1 External Link {textlinktar.h5//group} {Group} ext_link2 External Link {textlinktar.h5//dset} {Dataset {6}} ext_link3 External Link {textlinktar.h5//type} {Type} diff --git a/tools/testfiles/textlinksrc-7-old.ls b/tools/testfiles/textlinksrc-7-old.ls index 9249d0c..e9a5a03 100644 --- a/tools/testfiles/textlinksrc-7-old.ls +++ b/tools/testfiles/textlinksrc-7-old.ls @@ -1,4 +1 @@ -############################# - output for 'h5ls -w80 -E textlinksrc.h5/ext_link1' -############################# ext_link1 External Link {textlinktar.h5//group} {Group} diff --git a/tools/testfiles/textlinksrc-7.ls b/tools/testfiles/textlinksrc-7.ls index 528c4c5..e9a5a03 100644 --- a/tools/testfiles/textlinksrc-7.ls +++ b/tools/testfiles/textlinksrc-7.ls @@ -1,4 +1 @@ -############################# - output for 'h5ls -w80 --follow-symlinks textlinksrc.h5/ext_link1' -############################# ext_link1 External Link {textlinktar.h5//group} {Group} diff --git a/tools/testfiles/textlinksrc-nodangle-1.ls b/tools/testfiles/textlinksrc-nodangle-1.ls index 9240761..7427e1c 100644 --- a/tools/testfiles/textlinksrc-nodangle-1.ls +++ b/tools/testfiles/textlinksrc-nodangle-1.ls @@ -1,6 +1,3 @@ -############################# - output for 'h5ls -w80 --no-dangling-links textlinksrc.h5' -############################# Error: --no-dangling-links must be used along with --follow-symlinks option! usage: h5ls [OPTIONS] [OBJECTS...] diff --git a/tools/testfiles/textlinksrc-nodangle-2.ls b/tools/testfiles/textlinksrc-nodangle-2.ls index 4713849..ae70721 100644 --- a/tools/testfiles/textlinksrc-nodangle-2.ls +++ b/tools/testfiles/textlinksrc-nodangle-2.ls @@ -1,6 +1,5 @@ -############################# - output for 'h5ls -w80 --follow-symlinks --no-dangling-links textlinksrc.h5' -############################# +ext2soft_link1 External Link {tsoftlinks.h5//soft_dset1} {Dataset {4, 2}} +ext2softdangle_link1 External Link {tsoftlinks.h5//soft_dangle} {**NOT FOUND**} ext_link1 External Link {textlinktar.h5//group} {Group} ext_link2 External Link {textlinktar.h5//dset} {Dataset {6}} ext_link3 External Link {textlinktar.h5//type} {Type} diff --git a/tools/testfiles/textlinksrc.ddl b/tools/testfiles/textlinksrc.ddl index b806c56..6ef0b44 100644 --- a/tools/testfiles/textlinksrc.ddl +++ b/tools/testfiles/textlinksrc.ddl @@ -1,8 +1,23 @@ -############################# -Expected output for 'h5dump textlinksrc.h5' -############################# HDF5 "textlinksrc.h5" { GROUP "/" { + EXTERNAL_LINK "ext2soft_link1" { + TARGETFILE "tsoftlinks.h5" + TARGETPATH "/soft_dset1" + DATASET "/soft_dset1" { + DATATYPE H5T_STD_I32BE + DATASPACE SIMPLE { ( 4, 2 ) / ( 4, 2 ) } + DATA { + (0,0): 0, 0, + (1,0): 1, 1, + (2,0): 2, 2, + (3,0): 3, 3 + } + } + } + EXTERNAL_LINK "ext2softdangle_link1" { + TARGETFILE "tsoftlinks.h5" + TARGETPATH "/soft_dangle" + } EXTERNAL_LINK "ext_link1" { TARGETFILE "textlinktar.h5" TARGETPATH "group" @@ -44,7 +59,6 @@ GROUP "/" { TARGETFILE "textlinktar.h5" TARGETPATH "type" DATATYPE "type" H5T_STD_I32LE; - } EXTERNAL_LINK "ext_link4" { TARGETFILE "textlinktar.h5" diff --git a/tools/testfiles/textlinksrc.h5 b/tools/testfiles/textlinksrc.h5 index 062acbe..4db1cc4 100644 Binary files a/tools/testfiles/textlinksrc.h5 and b/tools/testfiles/textlinksrc.h5 differ diff --git a/tools/testfiles/tfamily.ddl b/tools/testfiles/tfamily.ddl index 14e46ef..489d8a8 100644 --- a/tools/testfiles/tfamily.ddl +++ b/tools/testfiles/tfamily.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump --filedriver=family tfamily%05d.h5' -############################# HDF5 "tfamily%05d.h5" { GROUP "/" { DATASET "dset1" { diff --git a/tools/testfiles/tfill.ddl b/tools/testfiles/tfill.ddl index 14a01f3..45497fd 100644 --- a/tools/testfiles/tfill.ddl +++ b/tools/testfiles/tfill.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump -p tfvalues.h5' -############################# HDF5 "tfvalues.h5" { GROUP "/" { DATASET "fill_array" { @@ -16,7 +13,7 @@ GROUP "/" { } FILLVALUE { FILL_TIME H5D_FILL_TIME_IFSET - VALUE [ 0, 0, 0 ] + VALUE [ 0, 0, 0 ] } ALLOCATION_TIME { H5D_ALLOC_TIME_LATE @@ -42,9 +39,9 @@ GROUP "/" { FILLVALUE { FILL_TIME H5D_FILL_TIME_IFSET VALUE { - 1, - 2 - } + 1, + 2 + } } ALLOCATION_TIME { H5D_ALLOC_TIME_LATE @@ -73,7 +70,7 @@ GROUP "/" { } FILLVALUE { FILL_TIME H5D_FILL_TIME_ALLOC - VALUE -99 + VALUE -99 } ALLOCATION_TIME { H5D_ALLOC_TIME_LATE @@ -95,7 +92,7 @@ GROUP "/" { } FILLVALUE { FILL_TIME H5D_FILL_TIME_IFSET - VALUE -99 + VALUE -99 } ALLOCATION_TIME { H5D_ALLOC_TIME_LATE @@ -117,7 +114,7 @@ GROUP "/" { } FILLVALUE { FILL_TIME H5D_FILL_TIME_NEVER - VALUE -99 + VALUE -99 } ALLOCATION_TIME { H5D_ALLOC_TIME_LATE @@ -139,7 +136,7 @@ GROUP "/" { } FILLVALUE { FILL_TIME H5D_FILL_TIME_ALLOC - VALUE () + VALUE () } ALLOCATION_TIME { H5D_ALLOC_TIME_LATE @@ -161,7 +158,7 @@ GROUP "/" { } FILLVALUE { FILL_TIME H5D_FILL_TIME_IFSET - VALUE 0 + VALUE 0 } ALLOCATION_TIME { H5D_ALLOC_TIME_LATE diff --git a/tools/testfiles/tfletcher32.ddl b/tools/testfiles/tfletcher32.ddl index 9395f4a..072ef23 100644 --- a/tools/testfiles/tfletcher32.ddl +++ b/tools/testfiles/tfletcher32.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump -H -p -d fletcher32 tfilters.h5' -############################# HDF5 "tfilters.h5" { DATASET "fletcher32" { DATATYPE H5T_STD_I32LE @@ -8,13 +5,13 @@ DATASET "fletcher32" { STORAGE_LAYOUT { CHUNKED ( 10, 5 ) SIZE 816 - } + } FILTERS { CHECKSUM FLETCHER32 } FILLVALUE { FILL_TIME H5D_FILL_TIME_IFSET - VALUE 0 + VALUE 0 } ALLOCATION_TIME { H5D_ALLOC_TIME_INCR diff --git a/tools/testfiles/tfpformat.ddl b/tools/testfiles/tfpformat.ddl index 2336822..2830ad5 100644 --- a/tools/testfiles/tfpformat.ddl +++ b/tools/testfiles/tfpformat.ddl @@ -1,20 +1,27 @@ -############################# -Expected output for 'h5dump -m %.7f tfpformat.h5' -############################# HDF5 "tfpformat.h5" { GROUP "/" { DATASET "double" { DATATYPE H5T_IEEE_F64LE DATASPACE SIMPLE { ( 6 ) / ( 6 ) } DATA { - (0): -0.1234567, 0.1234567, 0.0000000, 0.0000000, 0.0000000, 0.0000000 + (0): -0.1234567, + (1): 0.1234567, + (2): 0.0000000, + (3): 0.0000000, + (4): 0.0000000, + (5): 0.0000000 } } DATASET "float" { DATATYPE H5T_IEEE_F32LE DATASPACE SIMPLE { ( 6 ) / ( 6 ) } DATA { - (0): -0.1234567, 0.1234567, 0.0000000, 0.0000000, 0.0000000, 0.0000000 + (0): -0.1234567, + (1): 0.1234567, + (2): 0.0000000, + (3): 0.0000000, + (4): 0.0000000, + (5): 0.0000000 } } } diff --git a/tools/testfiles/tfpformat.h5.xml b/tools/testfiles/tfpformat.h5.xml index 939d7b3..c2bd96f 100644 --- a/tools/testfiles/tfpformat.h5.xml +++ b/tools/testfiles/tfpformat.h5.xml @@ -1,17 +1,14 @@ -############################# -Expected output for 'h5dump -u -m %.7f tfpformat.h5' -############################# - + - + - + @@ -26,7 +23,12 @@ Expected output for 'h5dump -u -m %.7f tfpformat.h5' - -0.1234567 0.1234567 0.0000000 0.0000000 0.0000000 0.0000000 + -0.1234567 + 0.1234567 + 0.0000000 + 0.0000000 + 0.0000000 + 0.0000000 @@ -34,9 +36,9 @@ Expected output for 'h5dump -u -m %.7f tfpformat.h5' - + - + @@ -51,7 +53,12 @@ Expected output for 'h5dump -u -m %.7f tfpformat.h5' - -0.1234567 0.1234567 0.0000000 0.0000000 0.0000000 0.0000000 + -0.1234567 + 0.1234567 + 0.0000000 + 0.0000000 + 0.0000000 + 0.0000000 diff --git a/tools/testfiles/tgroup-1.ddl b/tools/testfiles/tgroup-1.ddl index d5f5eb4..4407eae 100644 --- a/tools/testfiles/tgroup-1.ddl +++ b/tools/testfiles/tgroup-1.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump tgroup.h5' -############################# HDF5 "tgroup.h5" { GROUP "/" { GROUP "g1" { diff --git a/tools/testfiles/tgroup-1.ls b/tools/testfiles/tgroup-1.ls index 04066ca..effaf5a 100644 --- a/tools/testfiles/tgroup-1.ls +++ b/tools/testfiles/tgroup-1.ls @@ -1,6 +1,3 @@ -############################# - output for 'h5ls -w80 -r -g tgroup.h5' -############################# Error: 'recursive' option not compatible with 'group info' option! usage: h5ls [OPTIONS] [OBJECTS...] diff --git a/tools/testfiles/tgroup-2.ddl b/tools/testfiles/tgroup-2.ddl index e993d35..c4af7bb 100644 --- a/tools/testfiles/tgroup-2.ddl +++ b/tools/testfiles/tgroup-2.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump --group=/g2 --group / -g /y tgroup.h5' -############################# HDF5 "tgroup.h5" { GROUP "/g2" { GROUP "g2.1" { diff --git a/tools/testfiles/tgroup-2.ls b/tools/testfiles/tgroup-2.ls index 0817d93..464d4d7 100644 --- a/tools/testfiles/tgroup-2.ls +++ b/tools/testfiles/tgroup-2.ls @@ -1,4 +1 @@ -############################# - output for 'h5ls -w80 -g tgroup.h5/g1' -############################# g1 Group diff --git a/tools/testfiles/tgroup-3.ls b/tools/testfiles/tgroup-3.ls index cfb479a..959415f 100644 --- a/tools/testfiles/tgroup-3.ls +++ b/tools/testfiles/tgroup-3.ls @@ -1,5 +1,2 @@ -############################# - output for 'h5ls -w80 tgroup.h5/g1' -############################# g1.1 Group g1.2 Group diff --git a/tools/testfiles/tgroup.h5.xml b/tools/testfiles/tgroup.h5.xml index 00f5a0b..8065165 100644 --- a/tools/testfiles/tgroup.h5.xml +++ b/tools/testfiles/tgroup.h5.xml @@ -1,8 +1,5 @@ -############################# -Expected output for 'h5dump --xml tgroup.h5' -############################# - + diff --git a/tools/testfiles/tgroup.ls b/tools/testfiles/tgroup.ls index 5e4b66d..549b166 100644 --- a/tools/testfiles/tgroup.ls +++ b/tools/testfiles/tgroup.ls @@ -1,6 +1,3 @@ -############################# - output for 'h5ls -w80 tgroup.h5' -############################# g1 Group g2 Group g3 Group diff --git a/tools/testfiles/tgrp_comments.ddl b/tools/testfiles/tgrp_comments.ddl index 460a9f0..e33f3c2 100644 --- a/tools/testfiles/tgrp_comments.ddl +++ b/tools/testfiles/tgrp_comments.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump tgrp_comments.h5' -############################# HDF5 "tgrp_comments.h5" { GROUP "/" { GROUP "g1" { diff --git a/tools/testfiles/tgrp_comments.ls b/tools/testfiles/tgrp_comments.ls index e4c7d42..c36a819 100644 --- a/tools/testfiles/tgrp_comments.ls +++ b/tools/testfiles/tgrp_comments.ls @@ -1,6 +1,3 @@ -############################# - output for 'h5ls -w80 -v -g tgrp_comments.h5/glongcomment' -############################# Opened "tgrp_comments.h5" with sec2 driver. glongcomment Group Location: 1:12424 diff --git a/tools/testfiles/thlink-1.ddl b/tools/testfiles/thlink-1.ddl index c913201..61ac6c2 100644 --- a/tools/testfiles/thlink-1.ddl +++ b/tools/testfiles/thlink-1.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump thlink.h5' -############################# HDF5 "thlink.h5" { GROUP "/" { DATASET "dset1" { diff --git a/tools/testfiles/thlink-1.ls b/tools/testfiles/thlink-1.ls index 01839bf..adcd38a 100644 --- a/tools/testfiles/thlink-1.ls +++ b/tools/testfiles/thlink-1.ls @@ -1,6 +1,3 @@ -############################# - output for 'h5ls -w80 thlink.h5' -############################# dset1 Dataset {5} g1 Group g2 Group diff --git a/tools/testfiles/thlink-2.ddl b/tools/testfiles/thlink-2.ddl index 829dbd6..c1c6367 100644 --- a/tools/testfiles/thlink-2.ddl +++ b/tools/testfiles/thlink-2.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump -d /g1/dset2 --dataset /dset1 --dataset=/g1/g1.1/dset3 thlink.h5' -############################# HDF5 "thlink.h5" { DATASET "/g1/dset2" { DATATYPE H5T_STD_I32BE diff --git a/tools/testfiles/thlink-3.ddl b/tools/testfiles/thlink-3.ddl index d4b9d39..625cf3c 100644 --- a/tools/testfiles/thlink-3.ddl +++ b/tools/testfiles/thlink-3.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump -d /g1/g1.1/dset3 --dataset /g1/dset2 --dataset=/dset1 thlink.h5' -############################# HDF5 "thlink.h5" { DATASET "/g1/g1.1/dset3" { DATATYPE H5T_STD_I32BE diff --git a/tools/testfiles/thlink-4.ddl b/tools/testfiles/thlink-4.ddl index 4a06500..026f412 100644 --- a/tools/testfiles/thlink-4.ddl +++ b/tools/testfiles/thlink-4.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump -g /g1 thlink.h5' -############################# HDF5 "thlink.h5" { GROUP "/g1" { DATASET "dset2" { diff --git a/tools/testfiles/thlink-5.ddl b/tools/testfiles/thlink-5.ddl index b5dd8ee..058e863 100644 --- a/tools/testfiles/thlink-5.ddl +++ b/tools/testfiles/thlink-5.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump -d /dset1 -g /g2 -d /g1/dset2 thlink.h5' -############################# HDF5 "thlink.h5" { DATASET "/dset1" { DATATYPE H5T_STD_I32BE diff --git a/tools/testfiles/thlink.h5.xml b/tools/testfiles/thlink.h5.xml index 19bc816..65d7f8a 100644 --- a/tools/testfiles/thlink.h5.xml +++ b/tools/testfiles/thlink.h5.xml @@ -1,16 +1,13 @@ -############################# -Expected output for 'h5dump --xml thlink.h5' -############################# - + - + - + @@ -25,7 +22,11 @@ Expected output for 'h5dump --xml thlink.h5' - 0 1 2 3 4 + 0 + 1 + 2 + 3 + 4 @@ -40,10 +41,10 @@ Expected output for 'h5dump --xml thlink.h5' - + - + diff --git a/tools/testfiles/thlinks-nodangle-1.ls b/tools/testfiles/thlinks-nodangle-1.ls index 37ba6b0..adcd38a 100644 --- a/tools/testfiles/thlinks-nodangle-1.ls +++ b/tools/testfiles/thlinks-nodangle-1.ls @@ -1,6 +1,3 @@ -############################# - output for 'h5ls -w80 --follow-symlinks --no-dangling-links thlink.h5' -############################# dset1 Dataset {5} g1 Group g2 Group diff --git a/tools/testfiles/thyperslab.ddl b/tools/testfiles/thyperslab.ddl index 733c456..2f4a118 100644 --- a/tools/testfiles/thyperslab.ddl +++ b/tools/testfiles/thyperslab.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump thyperslab.h5' -############################# HDF5 "thyperslab.h5" { GROUP "/" { DATASET "stripmine" { @@ -6341,212 +6338,212 @@ GROUP "/" { (30,4025): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, (30,4045): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, (30,4065): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (30,4085): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,8): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,29): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,50): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,71): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,92): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,113): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,133): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,153): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,173): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,193): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,213): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,233): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,253): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,273): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,293): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,313): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,333): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,353): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,373): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,393): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,413): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,433): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,453): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,473): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,493): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,513): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,533): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,553): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,573): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,593): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,613): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,633): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,653): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,673): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,693): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,713): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,733): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,753): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,773): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,793): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,813): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,833): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,853): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,873): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,893): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,913): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,933): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,953): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,973): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,993): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1013): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1033): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1053): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1073): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1093): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1113): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1133): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1153): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1173): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1193): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1213): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1233): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1253): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1273): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1293): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1313): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1333): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1353): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1373): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1393): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1413): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1433): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1453): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1473): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1493): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1513): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1533): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1553): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1573): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1593): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1613): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1633): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1653): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1673): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1693): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1713): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1733): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1753): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1773): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1793): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1813): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1833): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1853): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1873): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1893): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1913): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1933): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1953): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1973): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,1993): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2013): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2033): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2053): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2073): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2093): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2113): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2133): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2153): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2173): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2193): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2213): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2233): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2253): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2273): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2293): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2313): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2333): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2353): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2373): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2393): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2413): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2433): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2453): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2473): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2493): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2513): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2533): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2553): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2573): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2593): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2613): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2633): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2653): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2673): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2693): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2713): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2733): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2753): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2773): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2793): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2813): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2833): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2853): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2873): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2893): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2913): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2933): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2953): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2973): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,2993): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3013): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3033): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3053): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3073): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3093): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3113): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3133): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3153): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3173): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3193): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3213): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3233): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3253): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3273): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3293): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3313): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3333): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3353): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3373): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3393): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3413): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3433): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3453): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3473): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3493): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3513): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3533): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3553): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3573): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3593): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3613): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3633): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3653): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3673): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3693): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3713): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3733): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3753): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3773): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3793): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3813): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3833): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3853): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3873): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3893): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3913): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3933): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3953): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3973): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,3993): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,4013): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,4033): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,4053): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,4073): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - (31,4093): 1, 1, 1, 1 + (30,4085): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,0): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,21): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,42): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,63): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,84): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,105): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,125): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,145): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,165): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,185): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,205): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,225): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,245): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,265): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,285): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,305): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,325): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,345): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,365): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,385): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,405): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,425): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,445): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,465): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,485): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,505): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,525): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,545): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,565): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,585): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,605): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,625): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,645): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,665): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,685): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,705): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,725): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,745): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,765): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,785): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,805): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,825): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,845): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,865): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,885): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,905): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,925): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,945): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,965): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,985): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1005): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1025): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1045): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1065): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1085): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1105): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1125): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1145): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1165): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1185): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1205): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1225): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1245): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1265): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1285): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1305): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1325): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1345): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1365): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1385): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1405): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1425): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1445): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1465): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1485): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1505): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1525): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1545): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1565): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1585): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1605): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1625): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1645): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1665): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1685): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1705): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1725): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1745): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1765): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1785): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1805): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1825): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1845): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1865): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1885): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1905): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1925): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1945): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1965): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,1985): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2005): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2025): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2045): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2065): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2085): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2105): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2125): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2145): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2165): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2185): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2205): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2225): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2245): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2265): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2285): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2305): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2325): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2345): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2365): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2385): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2405): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2425): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2445): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2465): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2485): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2505): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2525): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2545): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2565): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2585): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2605): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2625): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2645): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2665): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2685): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2705): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2725): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2745): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2765): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2785): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2805): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2825): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2845): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2865): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2885): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2905): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2925): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2945): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2965): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,2985): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3005): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3025): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3045): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3065): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3085): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3105): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3125): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3145): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3165): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3185): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3205): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3225): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3245): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3265): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3285): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3305): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3325): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3345): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3365): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3385): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3405): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3425): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3445): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3465): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3485): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3505): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3525): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3545): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3565): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3585): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3605): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3625): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3645): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3665): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3685): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3705): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3725): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3745): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3765): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3785): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3805): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3825): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3845): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3865): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3885): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3905): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3925): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3945): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3965): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,3985): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,4005): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,4025): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,4045): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,4065): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + (31,4085): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } } } diff --git a/tools/testfiles/tindicesno.ddl b/tools/testfiles/tindicesno.ddl index a7ff3b0..a7b726e 100644 --- a/tools/testfiles/tindicesno.ddl +++ b/tools/testfiles/tindicesno.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump -y taindices.h5' -############################# HDF5 "taindices.h5" { GROUP "/" { DATASET "1d" { diff --git a/tools/testfiles/tindicessub1.ddl b/tools/testfiles/tindicessub1.ddl index 0173fb5..5cf4058 100644 --- a/tools/testfiles/tindicessub1.ddl +++ b/tools/testfiles/tindicessub1.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump -d 1d -s 1 -S 10 -c 2 -k 3 taindices.h5' -############################# HDF5 "taindices.h5" { DATASET "1d" { DATATYPE H5T_STD_I32LE diff --git a/tools/testfiles/tindicessub2.ddl b/tools/testfiles/tindicessub2.ddl index 0f8f720..5103b49 100644 --- a/tools/testfiles/tindicessub2.ddl +++ b/tools/testfiles/tindicessub2.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump -d 2d -s 1,2 -S 3,3 -c 3,2 -k 2,2 taindices.h5' -############################# HDF5 "taindices.h5" { DATASET "2d" { DATATYPE H5T_STD_I32LE diff --git a/tools/testfiles/tindicessub3.ddl b/tools/testfiles/tindicessub3.ddl index 1ffc016..f7fb81c 100644 --- a/tools/testfiles/tindicessub3.ddl +++ b/tools/testfiles/tindicessub3.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump -d 3d -s 0,1,2 -S 1,3,3 -c 2,2,2 -k 1,2,2 taindices.h5' -############################# HDF5 "taindices.h5" { DATASET "3d" { DATATYPE H5T_STD_I32LE diff --git a/tools/testfiles/tindicessub4.ddl b/tools/testfiles/tindicessub4.ddl index 273e396..7829875 100644 --- a/tools/testfiles/tindicessub4.ddl +++ b/tools/testfiles/tindicessub4.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump -d 4d -s 0,0,1,2 -c 2,2,3,2 -S 1,1,3,3 -k 1,1,2,2 taindices.h5' -############################# HDF5 "taindices.h5" { DATASET "4d" { DATATYPE H5T_STD_I32LE diff --git a/tools/testfiles/tindicesyes.ddl b/tools/testfiles/tindicesyes.ddl index 4a07072..9440c54 100644 --- a/tools/testfiles/tindicesyes.ddl +++ b/tools/testfiles/tindicesyes.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump taindices.h5' -############################# HDF5 "taindices.h5" { GROUP "/" { DATASET "1d" { diff --git a/tools/testfiles/tlarge_objname.ddl b/tools/testfiles/tlarge_objname.ddl index d3f0fbe..0facc43 100644 --- a/tools/testfiles/tlarge_objname.ddl +++ b/tools/testfiles/tlarge_objname.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump -w157 tlarge_objname.h5' -############################# HDF5 "tlarge_objname.h5" { GROUP "/" { GROUP "this_is_a_large_group_name" { diff --git a/tools/testfiles/tlonglinks.ddl b/tools/testfiles/tlonglinks.ddl index 9842e4d..0e57b3d 100644 --- a/tools/testfiles/tlonglinks.ddl +++ b/tools/testfiles/tlonglinks.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump tlonglinks.h5' -############################# HDF5 "tlonglinks.h5" { GROUP "/" { GROUP "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" { diff --git a/tools/testfiles/tloop-1.ddl b/tools/testfiles/tloop-1.ddl index 8313887..1f3a2fb 100644 --- a/tools/testfiles/tloop-1.ddl +++ b/tools/testfiles/tloop-1.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump tloop.h5' -############################# HDF5 "tloop.h5" { GROUP "/" { GROUP "g1" { diff --git a/tools/testfiles/tloop-1.ls b/tools/testfiles/tloop-1.ls index 22cb6c7..a68bd3b 100644 --- a/tools/testfiles/tloop-1.ls +++ b/tools/testfiles/tloop-1.ls @@ -1,6 +1,3 @@ -############################# - output for 'h5ls -w80 -r -d tloop.h5' -############################# / Group /g1 Group /g1/g1.1 Group diff --git a/tools/testfiles/tloop.h5.xml b/tools/testfiles/tloop.h5.xml index d8a5080..36e8f1b 100644 --- a/tools/testfiles/tloop.h5.xml +++ b/tools/testfiles/tloop.h5.xml @@ -1,18 +1,15 @@ -############################# -Expected output for 'h5dump --xml tloop.h5' -############################# - + - + - + diff --git a/tools/testfiles/tloop2.h5.xml b/tools/testfiles/tloop2.h5.xml index 73ac4e0..185e08b 100644 --- a/tools/testfiles/tloop2.h5.xml +++ b/tools/testfiles/tloop2.h5.xml @@ -1,8 +1,5 @@ -############################# -Expected output for 'h5dump --xml tloop2.h5' -############################# - + @@ -10,7 +7,7 @@ Expected output for 'h5dump --xml tloop2.h5' - + diff --git a/tools/testfiles/tmany.h5.xml b/tools/testfiles/tmany.h5.xml index 59b856f..8056783 100644 --- a/tools/testfiles/tmany.h5.xml +++ b/tools/testfiles/tmany.h5.xml @@ -1,8 +1,5 @@ -############################# -Expected output for 'h5dump --xml tmany.h5' -############################# - + @@ -16,7 +13,7 @@ Expected output for 'h5dump --xml tmany.h5' - + @@ -86,7 +83,16 @@ Expected output for 'h5dump --xml tmany.h5' - 97 98 99 100 101 102 103 104 105 0 + 97 + 98 + 99 + 100 + 101 + 102 + 103 + 104 + 105 + 0 @@ -104,8 +110,10 @@ Expected output for 'h5dump --xml tmany.h5' - 0 1 - 2 3 + 0 + 1 + 2 + 3 @@ -122,145 +130,28 @@ Expected output for 'h5dump --xml tmany.h5' - 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 + 0 + 0.1 + 0.2 + 0.3 + 0.4 + 0.5 + 0.6 + 0.7 + 0.8 + 0.9 - 0 1 - 0 1 - 0 1 - 0 1 - 0 1 - 0 1 - 0 1 - 0 1 0 1 - 0 1 - 0 1 - 0 1 - 0 1 - 0 1 - 0 1 - 0 1 6 7 - 6 7 - 6 7 - 6 7 - 6 7 - 6 7 - 6 7 - 6 7 - 1 2 - 1 2 - 1 2 - 1 2 - 1 2 - 1 2 - 1 2 - 1 2 1 2 - 1 2 - 1 2 - 1 2 - 1 2 - 1 2 - 1 2 - 1 2 7 8 - 7 8 - 7 8 - 7 8 - 7 8 - 7 8 - 7 8 - 7 8 - 2 3 - 2 3 - 2 3 - 2 3 - 2 3 - 2 3 - 2 3 - 2 3 2 3 - 2 3 - 2 3 - 2 3 - 2 3 - 2 3 - 2 3 - 2 3 8 9 - 8 9 - 8 9 - 8 9 - 8 9 - 8 9 - 8 9 - 8 9 - 3 4 - 3 4 - 3 4 - 3 4 - 3 4 - 3 4 - 3 4 - 3 4 3 4 - 3 4 - 3 4 - 3 4 - 3 4 - 3 4 - 3 4 - 3 4 9 10 - 9 10 - 9 10 - 9 10 - 9 10 - 9 10 - 9 10 - 9 10 - 4 5 - 4 5 - 4 5 - 4 5 - 4 5 - 4 5 - 4 5 - 4 5 4 5 - 4 5 - 4 5 - 4 5 - 4 5 - 4 5 - 4 5 - 4 5 10 11 - 10 11 - 10 11 - 10 11 - 10 11 - 10 11 - 10 11 - 10 11 - 5 6 - 5 6 - 5 6 - 5 6 - 5 6 - 5 6 - 5 6 - 5 6 5 6 - 5 6 - 5 6 - 5 6 - 5 6 - 5 6 - 5 6 - 5 6 11 12 - 11 12 - 11 12 - 11 12 - 11 12 - 11 12 - 11 12 - 11 12 + 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 6 7 6 7 6 7 6 7 6 7 6 7 6 7 6 7 + 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 7 8 7 8 7 8 7 8 7 8 7 8 7 8 7 8 + 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 8 9 8 9 8 9 8 9 8 9 8 9 8 9 8 9 + 3 4 3 4 3 4 3 4 3 4 3 4 3 4 3 4 3 4 3 4 3 4 3 4 3 4 3 4 3 4 3 4 9 10 9 10 9 10 9 10 9 10 9 10 9 10 9 10 + 4 5 4 5 4 5 4 5 4 5 4 5 4 5 4 5 4 5 4 5 4 5 4 5 4 5 4 5 4 5 4 5 10 11 10 11 10 11 10 11 10 11 10 11 10 11 10 11 + 5 6 5 6 5 6 5 6 5 6 5 6 5 6 5 6 5 6 5 6 5 6 5 6 5 6 5 6 5 6 5 6 11 12 11 12 11 12 11 12 11 12 11 12 11 12 11 12 @@ -279,9 +170,9 @@ Expected output for 'h5dump --xml tmany.h5' - + - + @@ -297,16 +188,106 @@ Expected output for 'h5dump --xml tmany.h5' - 0 1 2 3 4 5 6 7 8 9 - 0 1 2 3 4 5 6 7 8 9 - 0 1 2 3 4 5 6 7 8 9 - 0 1 2 3 4 5 6 7 8 9 - 0 1 2 3 4 5 6 7 8 9 - 0 1 2 3 4 5 6 7 8 9 - 0 1 2 3 4 5 6 7 8 9 - 0 1 2 3 4 5 6 7 8 9 - 0 1 2 3 4 5 6 7 8 9 - 0 1 2 3 4 5 6 7 8 9 + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 @@ -324,9 +305,9 @@ Expected output for 'h5dump --xml tmany.h5' - + - + @@ -342,16 +323,106 @@ Expected output for 'h5dump --xml tmany.h5' - 0 0 0 0 0 0 0 0 0 0 - 1 1 1 1 1 1 1 1 1 1 - 2 2 2 2 2 2 2 2 2 2 - 3 3 3 3 3 3 3 3 3 3 - 4 4 4 4 4 4 4 4 4 4 - 5 5 5 5 5 5 5 5 5 5 - 6 6 6 6 6 6 6 6 6 6 - 7 7 7 7 7 7 7 7 7 7 - 8 8 8 8 8 8 8 8 8 8 - 9 9 9 9 9 9 9 9 9 9 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 + 3 + 3 + 3 + 3 + 3 + 3 + 3 + 3 + 3 + 3 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 5 + 5 + 5 + 5 + 5 + 5 + 5 + 5 + 5 + 5 + 6 + 6 + 6 + 6 + 6 + 6 + 6 + 6 + 6 + 6 + 7 + 7 + 7 + 7 + 7 + 7 + 7 + 7 + 7 + 7 + 8 + 8 + 8 + 8 + 8 + 8 + 8 + 8 + 8 + 8 + 9 + 9 + 9 + 9 + 9 + 9 + 9 + 9 + 9 + 9 diff --git a/tools/testfiles/tmulti.ddl b/tools/testfiles/tmulti.ddl index 128513a..b6bf35e 100644 --- a/tools/testfiles/tmulti.ddl +++ b/tools/testfiles/tmulti.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump --filedriver=multi tmulti' -############################# HDF5 "tmulti" { GROUP "/" { DATASET "dset1" { diff --git a/tools/testfiles/tmultifile.ddl b/tools/testfiles/tmultifile.ddl new file mode 100644 index 0000000..cf94f2c --- /dev/null +++ b/tools/testfiles/tmultifile.ddl @@ -0,0 +1,42 @@ +HDF5 "tarray2.h5" { +DATASET "Dataset1" { + DATATYPE H5T_ARRAY { [3][4][5] H5T_STD_I32LE } + DATASPACE SIMPLE { ( 4 ) / ( 4 ) } +} +} +HDF5 "tarray3.h5" { +DATASET "Dataset1" { + DATATYPE H5T_ARRAY { [4] H5T_ARRAY { [6][3] H5T_STD_I32LE } } + DATASPACE SIMPLE { ( 4 ) / ( 4 ) } +} +} +HDF5 "tarray4.h5" { +DATASET "Dataset1" { + DATATYPE H5T_ARRAY { [4] H5T_COMPOUND { + H5T_STD_I32LE "i"; + H5T_IEEE_F32LE "f"; + } } + DATASPACE SIMPLE { ( 4 ) / ( 4 ) } +} +} +HDF5 "tarray5.h5" { +DATASET "Dataset1" { + DATATYPE H5T_ARRAY { [4] H5T_COMPOUND { + H5T_STD_I32LE "i"; + H5T_ARRAY { [4] H5T_IEEE_F32LE } "f"; + } } + DATASPACE SIMPLE { ( 4 ) / ( 4 ) } +} +} +HDF5 "tarray6.h5" { +DATASET "Dataset1" { + DATATYPE H5T_ARRAY { [4] H5T_VLEN { H5T_STD_U32LE} } + DATASPACE SIMPLE { ( 4 ) / ( 4 ) } +} +} +HDF5 "tarray7.h5" { +DATASET "Dataset1" { + DATATYPE H5T_ARRAY { [4] H5T_VLEN { H5T_ARRAY { [4] H5T_STD_U32LE }} } + DATASPACE SIMPLE { ( 4 ) / ( 4 ) } +} +} diff --git a/tools/testfiles/tmultifile.ls b/tools/testfiles/tmultifile.ls new file mode 100644 index 0000000..3fee937 --- /dev/null +++ b/tools/testfiles/tmultifile.ls @@ -0,0 +1,6 @@ +dset1 Dataset {5} +g1 Group +g2 Group +g3 Group, same as / +slink1 Soft Link {somevalue} +slink2 Soft Link {linkvalue} diff --git a/tools/testfiles/tname-amp.h5.xml b/tools/testfiles/tname-amp.h5.xml index b443f22..f28cdc5 100644 --- a/tools/testfiles/tname-amp.h5.xml +++ b/tools/testfiles/tname-amp.h5.xml @@ -1,8 +1,5 @@ -############################# -Expected output for 'h5dump --xml tname-amp.h5' -############################# - + @@ -17,7 +14,16 @@ Expected output for 'h5dump --xml tname-amp.h5' - 97 98 99 100 101 102 103 104 105 0 + 97 + 98 + 99 + 100 + 101 + 102 + 103 + 104 + 105 + 0 @@ -26,9 +32,9 @@ Expected output for 'h5dump --xml tname-amp.h5' - + - + @@ -44,16 +50,106 @@ Expected output for 'h5dump --xml tname-amp.h5' - 0 0 0 0 0 0 0 0 0 0 - 0 1 2 3 4 5 6 7 8 9 - 0 2 4 6 8 10 12 14 16 18 - 0 3 6 9 12 15 18 21 24 27 - 0 4 8 12 16 20 24 28 32 36 - 0 5 10 15 20 25 30 35 40 45 - 0 6 12 18 24 30 36 42 48 54 - 0 7 14 21 28 35 42 49 56 63 - 0 8 16 24 32 40 48 56 64 72 - 0 9 18 27 36 45 54 63 72 81 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 0 + 2 + 4 + 6 + 8 + 10 + 12 + 14 + 16 + 18 + 0 + 3 + 6 + 9 + 12 + 15 + 18 + 21 + 24 + 27 + 0 + 4 + 8 + 12 + 16 + 20 + 24 + 28 + 32 + 36 + 0 + 5 + 10 + 15 + 20 + 25 + 30 + 35 + 40 + 45 + 0 + 6 + 12 + 18 + 24 + 30 + 36 + 42 + 48 + 54 + 0 + 7 + 14 + 21 + 28 + 35 + 42 + 49 + 56 + 63 + 0 + 8 + 16 + 24 + 32 + 40 + 48 + 56 + 64 + 72 + 0 + 9 + 18 + 27 + 36 + 45 + 54 + 63 + 72 + 81 diff --git a/tools/testfiles/tname-apos.h5.xml b/tools/testfiles/tname-apos.h5.xml index f60fa48..2194971 100644 --- a/tools/testfiles/tname-apos.h5.xml +++ b/tools/testfiles/tname-apos.h5.xml @@ -1,8 +1,5 @@ -############################# -Expected output for 'h5dump --xml tname-apos.h5' -############################# - + @@ -17,7 +14,16 @@ Expected output for 'h5dump --xml tname-apos.h5' - 97 98 99 100 101 102 103 104 105 0 + 97 + 98 + 99 + 100 + 101 + 102 + 103 + 104 + 105 + 0 @@ -26,9 +32,9 @@ Expected output for 'h5dump --xml tname-apos.h5' - + - + @@ -44,16 +50,106 @@ Expected output for 'h5dump --xml tname-apos.h5' - 0 0 0 0 0 0 0 0 0 0 - 0 1 2 3 4 5 6 7 8 9 - 0 2 4 6 8 10 12 14 16 18 - 0 3 6 9 12 15 18 21 24 27 - 0 4 8 12 16 20 24 28 32 36 - 0 5 10 15 20 25 30 35 40 45 - 0 6 12 18 24 30 36 42 48 54 - 0 7 14 21 28 35 42 49 56 63 - 0 8 16 24 32 40 48 56 64 72 - 0 9 18 27 36 45 54 63 72 81 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 0 + 2 + 4 + 6 + 8 + 10 + 12 + 14 + 16 + 18 + 0 + 3 + 6 + 9 + 12 + 15 + 18 + 21 + 24 + 27 + 0 + 4 + 8 + 12 + 16 + 20 + 24 + 28 + 32 + 36 + 0 + 5 + 10 + 15 + 20 + 25 + 30 + 35 + 40 + 45 + 0 + 6 + 12 + 18 + 24 + 30 + 36 + 42 + 48 + 54 + 0 + 7 + 14 + 21 + 28 + 35 + 42 + 49 + 56 + 63 + 0 + 8 + 16 + 24 + 32 + 40 + 48 + 56 + 64 + 72 + 0 + 9 + 18 + 27 + 36 + 45 + 54 + 63 + 72 + 81 diff --git a/tools/testfiles/tname-gt.h5.xml b/tools/testfiles/tname-gt.h5.xml index 43d9a50..6a56587 100644 --- a/tools/testfiles/tname-gt.h5.xml +++ b/tools/testfiles/tname-gt.h5.xml @@ -1,8 +1,5 @@ -############################# -Expected output for 'h5dump --xml tname-gt.h5' -############################# - + @@ -17,7 +14,16 @@ Expected output for 'h5dump --xml tname-gt.h5' - 97 98 99 100 101 102 103 104 105 0 + 97 + 98 + 99 + 100 + 101 + 102 + 103 + 104 + 105 + 0 @@ -26,9 +32,9 @@ Expected output for 'h5dump --xml tname-gt.h5' - + - + @@ -44,16 +50,106 @@ Expected output for 'h5dump --xml tname-gt.h5' - 0 0 0 0 0 0 0 0 0 0 - 0 1 2 3 4 5 6 7 8 9 - 0 2 4 6 8 10 12 14 16 18 - 0 3 6 9 12 15 18 21 24 27 - 0 4 8 12 16 20 24 28 32 36 - 0 5 10 15 20 25 30 35 40 45 - 0 6 12 18 24 30 36 42 48 54 - 0 7 14 21 28 35 42 49 56 63 - 0 8 16 24 32 40 48 56 64 72 - 0 9 18 27 36 45 54 63 72 81 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 0 + 2 + 4 + 6 + 8 + 10 + 12 + 14 + 16 + 18 + 0 + 3 + 6 + 9 + 12 + 15 + 18 + 21 + 24 + 27 + 0 + 4 + 8 + 12 + 16 + 20 + 24 + 28 + 32 + 36 + 0 + 5 + 10 + 15 + 20 + 25 + 30 + 35 + 40 + 45 + 0 + 6 + 12 + 18 + 24 + 30 + 36 + 42 + 48 + 54 + 0 + 7 + 14 + 21 + 28 + 35 + 42 + 49 + 56 + 63 + 0 + 8 + 16 + 24 + 32 + 40 + 48 + 56 + 64 + 72 + 0 + 9 + 18 + 27 + 36 + 45 + 54 + 63 + 72 + 81 diff --git a/tools/testfiles/tname-lt.h5.xml b/tools/testfiles/tname-lt.h5.xml index 4e948c9..a6d2480 100644 --- a/tools/testfiles/tname-lt.h5.xml +++ b/tools/testfiles/tname-lt.h5.xml @@ -1,8 +1,5 @@ -############################# -Expected output for 'h5dump --xml tname-lt.h5' -############################# - + @@ -17,7 +14,16 @@ Expected output for 'h5dump --xml tname-lt.h5' - 97 98 99 100 101 102 103 104 105 0 + 97 + 98 + 99 + 100 + 101 + 102 + 103 + 104 + 105 + 0 @@ -26,9 +32,9 @@ Expected output for 'h5dump --xml tname-lt.h5' - + - + @@ -44,16 +50,106 @@ Expected output for 'h5dump --xml tname-lt.h5' - 0 0 0 0 0 0 0 0 0 0 - 0 1 2 3 4 5 6 7 8 9 - 0 2 4 6 8 10 12 14 16 18 - 0 3 6 9 12 15 18 21 24 27 - 0 4 8 12 16 20 24 28 32 36 - 0 5 10 15 20 25 30 35 40 45 - 0 6 12 18 24 30 36 42 48 54 - 0 7 14 21 28 35 42 49 56 63 - 0 8 16 24 32 40 48 56 64 72 - 0 9 18 27 36 45 54 63 72 81 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 0 + 2 + 4 + 6 + 8 + 10 + 12 + 14 + 16 + 18 + 0 + 3 + 6 + 9 + 12 + 15 + 18 + 21 + 24 + 27 + 0 + 4 + 8 + 12 + 16 + 20 + 24 + 28 + 32 + 36 + 0 + 5 + 10 + 15 + 20 + 25 + 30 + 35 + 40 + 45 + 0 + 6 + 12 + 18 + 24 + 30 + 36 + 42 + 48 + 54 + 0 + 7 + 14 + 21 + 28 + 35 + 42 + 49 + 56 + 63 + 0 + 8 + 16 + 24 + 32 + 40 + 48 + 56 + 64 + 72 + 0 + 9 + 18 + 27 + 36 + 45 + 54 + 63 + 72 + 81 diff --git a/tools/testfiles/tname-quot.h5.xml b/tools/testfiles/tname-quot.h5.xml index e148630..96ad068 100644 --- a/tools/testfiles/tname-quot.h5.xml +++ b/tools/testfiles/tname-quot.h5.xml @@ -1,8 +1,5 @@ -############################# -Expected output for 'h5dump --xml tname-quot.h5' -############################# - + @@ -17,7 +14,16 @@ Expected output for 'h5dump --xml tname-quot.h5' - 97 98 99 100 101 102 103 104 105 0 + 97 + 98 + 99 + 100 + 101 + 102 + 103 + 104 + 105 + 0 @@ -26,9 +32,9 @@ Expected output for 'h5dump --xml tname-quot.h5' - + - + @@ -44,16 +50,106 @@ Expected output for 'h5dump --xml tname-quot.h5' - 0 0 0 0 0 0 0 0 0 0 - 0 1 2 3 4 5 6 7 8 9 - 0 2 4 6 8 10 12 14 16 18 - 0 3 6 9 12 15 18 21 24 27 - 0 4 8 12 16 20 24 28 32 36 - 0 5 10 15 20 25 30 35 40 45 - 0 6 12 18 24 30 36 42 48 54 - 0 7 14 21 28 35 42 49 56 63 - 0 8 16 24 32 40 48 56 64 72 - 0 9 18 27 36 45 54 63 72 81 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 0 + 2 + 4 + 6 + 8 + 10 + 12 + 14 + 16 + 18 + 0 + 3 + 6 + 9 + 12 + 15 + 18 + 21 + 24 + 27 + 0 + 4 + 8 + 12 + 16 + 20 + 24 + 28 + 32 + 36 + 0 + 5 + 10 + 15 + 20 + 25 + 30 + 35 + 40 + 45 + 0 + 6 + 12 + 18 + 24 + 30 + 36 + 42 + 48 + 54 + 0 + 7 + 14 + 21 + 28 + 35 + 42 + 49 + 56 + 63 + 0 + 8 + 16 + 24 + 32 + 40 + 48 + 56 + 64 + 72 + 0 + 9 + 18 + 27 + 36 + 45 + 54 + 63 + 72 + 81 diff --git a/tools/testfiles/tname-sp.h5.xml b/tools/testfiles/tname-sp.h5.xml index 231d0d5..d6f8278 100644 --- a/tools/testfiles/tname-sp.h5.xml +++ b/tools/testfiles/tname-sp.h5.xml @@ -1,8 +1,5 @@ -############################# -Expected output for 'h5dump --xml tname-sp.h5' -############################# - + @@ -17,7 +14,16 @@ Expected output for 'h5dump --xml tname-sp.h5' - 97 98 99 100 101 102 103 104 105 0 + 97 + 98 + 99 + 100 + 101 + 102 + 103 + 104 + 105 + 0 @@ -26,9 +32,9 @@ Expected output for 'h5dump --xml tname-sp.h5' - + - + @@ -44,16 +50,106 @@ Expected output for 'h5dump --xml tname-sp.h5' - 0 0 0 0 0 0 0 0 0 0 - 0 1 2 3 4 5 6 7 8 9 - 0 2 4 6 8 10 12 14 16 18 - 0 3 6 9 12 15 18 21 24 27 - 0 4 8 12 16 20 24 28 32 36 - 0 5 10 15 20 25 30 35 40 45 - 0 6 12 18 24 30 36 42 48 54 - 0 7 14 21 28 35 42 49 56 63 - 0 8 16 24 32 40 48 56 64 72 - 0 9 18 27 36 45 54 63 72 81 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 0 + 2 + 4 + 6 + 8 + 10 + 12 + 14 + 16 + 18 + 0 + 3 + 6 + 9 + 12 + 15 + 18 + 21 + 24 + 27 + 0 + 4 + 8 + 12 + 16 + 20 + 24 + 28 + 32 + 36 + 0 + 5 + 10 + 15 + 20 + 25 + 30 + 35 + 40 + 45 + 0 + 6 + 12 + 18 + 24 + 30 + 36 + 42 + 48 + 54 + 0 + 7 + 14 + 21 + 28 + 35 + 42 + 49 + 56 + 63 + 0 + 8 + 16 + 24 + 32 + 40 + 48 + 56 + 64 + 72 + 0 + 9 + 18 + 27 + 36 + 45 + 54 + 63 + 72 + 81 diff --git a/tools/testfiles/tnamed_dtype_attr.ddl b/tools/testfiles/tnamed_dtype_attr.ddl index 4ef3158..7cd14ef 100644 --- a/tools/testfiles/tnamed_dtype_attr.ddl +++ b/tools/testfiles/tnamed_dtype_attr.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump tnamed_dtype_attr.h5' -############################# HDF5 "tnamed_dtype_attr.h5" { GROUP "/" { DATASET "Dataset" { @@ -25,9 +22,7 @@ GROUP "/" { (0): 8 } } - DATATYPE "Link_to_Datatype" HARDLINK "/Datatype" - GROUP "g1" { ATTRIBUTE "Attribute" { DATATYPE "/Datatype" diff --git a/tools/testfiles/tnamed_dtype_attr.h5.xml b/tools/testfiles/tnamed_dtype_attr.h5.xml index ebba88b..199211c 100644 --- a/tools/testfiles/tnamed_dtype_attr.h5.xml +++ b/tools/testfiles/tnamed_dtype_attr.h5.xml @@ -1,16 +1,13 @@ -############################# -Expected output for 'h5dump --xml tnamed_dtype_attr.h5' -############################# - + - + - + diff --git a/tools/testfiles/tnbit.ddl b/tools/testfiles/tnbit.ddl index c310592..bd32eaa 100644 --- a/tools/testfiles/tnbit.ddl +++ b/tools/testfiles/tnbit.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump -H -p -d nbit tfilters.h5' -############################# HDF5 "tfilters.h5" { DATASET "nbit" { DATATYPE 32-bit little-endian integer @@ -8,13 +5,13 @@ DATASET "nbit" { STORAGE_LAYOUT { CHUNKED ( 10, 5 ) SIZE 76 (10.526:1 COMPRESSION) - } + } FILTERS { COMPRESSION NBIT } FILLVALUE { FILL_TIME H5D_FILL_TIME_IFSET - VALUE 0 + VALUE 0 } ALLOCATION_TIME { H5D_ALLOC_TIME_INCR diff --git a/tools/testfiles/tnestcomp-1.ddl b/tools/testfiles/tnestcomp-1.ddl index e68e22d..fda9c7c 100644 --- a/tools/testfiles/tnestcomp-1.ddl +++ b/tools/testfiles/tnestcomp-1.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump tnestedcomp.h5' -############################# HDF5 "tnestedcomp.h5" { GROUP "/" { DATASET "ArrayOfStructures" { diff --git a/tools/testfiles/tnestcomp-1.ls b/tools/testfiles/tnestcomp-1.ls index 9dc193d..425d92f 100644 --- a/tools/testfiles/tnestcomp-1.ls +++ b/tools/testfiles/tnestcomp-1.ls @@ -1,6 +1,3 @@ -############################# - output for 'h5ls -w80 -r -d tnestedcomp.h5' -############################# / Group /ArrayOfStructures Dataset {10} Data: diff --git a/tools/testfiles/tnestcomp-2.ls b/tools/testfiles/tnestcomp-2.ls index be60e8d..64be630 100644 --- a/tools/testfiles/tnestcomp-2.ls +++ b/tools/testfiles/tnestcomp-2.ls @@ -1,6 +1,3 @@ -############################# - output for 'h5ls -w80 -r -d -S tnestedcomp.h5' -############################# / Group /ArrayOfStructures Dataset {10} Data: diff --git a/tools/testfiles/tnestcomp-3.ls b/tools/testfiles/tnestcomp-3.ls index 98eca8e..0a230cc 100644 --- a/tools/testfiles/tnestcomp-3.ls +++ b/tools/testfiles/tnestcomp-3.ls @@ -1,6 +1,3 @@ -############################# - output for 'h5ls -w80 -r -d -l tnestedcomp.h5' -############################# / Group /ArrayOfStructures Dataset {10} Data: diff --git a/tools/testfiles/tnestcomp-4.ls b/tools/testfiles/tnestcomp-4.ls index 6618597..d937e86 100644 --- a/tools/testfiles/tnestcomp-4.ls +++ b/tools/testfiles/tnestcomp-4.ls @@ -1,6 +1,3 @@ -############################# - output for 'h5ls -w80 -r -d -l -S tnestedcomp.h5' -############################# / Group /ArrayOfStructures Dataset {10} Data: diff --git a/tools/testfiles/tnestedcomp.h5.xml b/tools/testfiles/tnestedcomp.h5.xml index a2f928b..2cae353 100644 --- a/tools/testfiles/tnestedcomp.h5.xml +++ b/tools/testfiles/tnestedcomp.h5.xml @@ -1,16 +1,13 @@ -############################# -Expected output for 'h5dump --xml tnestedcomp.h5' -############################# - + - + - + @@ -71,11 +68,16 @@ Expected output for 'h5dump --xml tnestedcomp.h5' - 0 0 1 "A" -100 100 1 1 0.5 "B" -100 100 2 4 0.333333 "C" -100 100 - 3 9 0.25 "D" -100 100 4 16 0.2 "E" -100 100 - 5 25 0.166667 "F" -100 100 6 36 0.142857 "G" -100 100 - 7 49 0.125 "H" -100 100 8 64 0.111111 "I" -100 100 - 9 81 0.1 "J" -100 100 + 0 0 1 "A" -100 100 + 1 1 0.5 "B" -100 100 + 2 4 0.333333 "C" -100 100 + 3 9 0.25 "D" -100 100 + 4 16 0.2 "E" -100 100 + 5 25 0.166667 "F" -100 100 + 6 36 0.142857 "G" -100 100 + 7 49 0.125 "H" -100 100 + 8 64 0.111111 "I" -100 100 + 9 81 0.1 "J" -100 100 diff --git a/tools/testfiles/tno-subset.ddl b/tools/testfiles/tno-subset.ddl new file mode 100644 index 0000000..11aa264 --- /dev/null +++ b/tools/testfiles/tno-subset.ddl @@ -0,0 +1,9 @@ +HDF5 "tno-subset.h5" { +DATASET "AHFINDERDIRECT::ah_centroid_t[0] it=0 tl=0" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 1, 1 ) / ( 1, 1 ) } + DATA { + (0,0): 0 + } +} +} diff --git a/tools/testfiles/tno-subset.h5 b/tools/testfiles/tno-subset.h5 new file mode 100644 index 0000000..e6b6f57 Binary files /dev/null and b/tools/testfiles/tno-subset.h5 differ diff --git a/tools/testfiles/tnodata.h5.xml b/tools/testfiles/tnodata.h5.xml index 762475e..17b4ac9 100644 --- a/tools/testfiles/tnodata.h5.xml +++ b/tools/testfiles/tnodata.h5.xml @@ -1,16 +1,13 @@ -############################# -Expected output for 'h5dump --xml tnodata.h5' -############################# - + - + - + @@ -25,7 +22,11 @@ Expected output for 'h5dump --xml tnodata.h5' - 0 0 0 0 0 + 0 + 0 + 0 + 0 + 0 diff --git a/tools/testfiles/tnofilename-with-packed-bits.ddl b/tools/testfiles/tnofilename-with-packed-bits.ddl new file mode 100644 index 0000000..d3b12e3 --- /dev/null +++ b/tools/testfiles/tnofilename-with-packed-bits.ddl @@ -0,0 +1,101 @@ +usage: h5dump [OPTIONS] files + OPTIONS + -h, --help Print a usage message and exit + -n, --contents Print a list of the file contents and exit + -B, --superblock Print the content of the super block + -H, --header Print the header only; no data is displayed + -A, --onlyattr Print the header and value of attributes + -i, --object-ids Print the object ids + -r, --string Print 1-byte integer datasets as ASCII + -e, --escape Escape non printing characters + -V, --version Print version number and exit + -a P, --attribute=P Print the specified attribute + -d P, --dataset=P Print the specified dataset + -y, --noindex Do not print array indices with the data + -p, --properties Print dataset filters, storage layout and fill value + -f D, --filedriver=D Specify which driver to open the file with + -g P, --group=P Print the specified group and all members + -l P, --soft-link=P Print the value(s) of the specified soft link + -o F, --output=F Output raw data into file F + -b B, --binary=B Binary file output, of form B + -t P, --datatype=P Print the specified named datatype + -w N, --width=N Set the number of columns of output. A value of 0 (zero) + sets the number of columns to the maximum (65535). + Default width is 80 columns. + -m T, --format=T Set the floating point output format + -q Q, --sort_by=Q Sort groups and attributes by index Q + -z Z, --sort_order=Z Sort groups and attributes by order Z + -M L, --packedbits=L Print packed bits as unsigned integers, using mask + format L for an integer dataset specified with + option -d. L is a list of offset,length values, + separated by commas. Offset is the beginning bit in + the data value and length is the number of bits of + the mask. + -R, --region Print dataset pointed by region references + -x, --xml Output in XML using Schema + -u, --use-dtd Output in XML using DTD + -D U, --xml-dtd=U Use the DTD or schema at U + -X S, --xml-ns=S (XML Schema) Use qualified names n the XML + ":": no namespace, default: "hdf5:" + E.g., to dump a file called `-f', use h5dump -- -f + --enable-error-stack Prints messages from the HDF5 error stack as they + occur. + --no-compact-subset Disable compact form of subsetting and allow the use + of "[" in datset names. + + Subsetting is available by using the following options with a dataset + attribute. Subsetting is done by selecting a hyperslab from the data. + Thus, the options mirror those for performing a hyperslab selection. + One of the START, COUNT, STRIDE, or BLOCK parameters are mandatory if you do subsetting. + The STRIDE, COUNT, and BLOCK parameters are optional and will default to 1 in + each dimension. START is optional and will default to 0 in each dimension. + + -s START, --start=START Offset of start of subsetting selection + -S STRIDE, --stride=STRIDE Hyperslab stride + -c COUNT, --count=COUNT Number of blocks to include in selection + -k BLOCK, --block=BLOCK Size of block in hyperslab + START, COUNT, STRIDE, and BLOCK - is a list of integers the number of which are equal to the + number of dimensions in the dataspace being queried + + D - is the file driver to use in opening the file. Acceptable values + are "sec2", "family", "split", "multi", "direct", and "stream". Without + the file driver flag, the file will be opened with each driver in + turn and in the order specified above until one driver succeeds + in opening the file. + F - is a filename. + P - is the full path from the root group to the object. + N - is an integer greater than 1. + T - is a string containing the floating point format, e.g '%.3f' + U - is a URI reference (as defined in [IETF RFC 2396], + updated by [IETF RFC 2732]) + B - is the form of binary output: NATIVE for a memory type, FILE for the + file type, LE or BE for pre-existing little or big endian types. + Must be used with -o (output file) and it is recommended that + -d (dataset) is used. B is an optional argument, defaults to NATIVE + Q - is the sort index type. It can be "creation_order" or "name" (default) + Z - is the sort order type. It can be "descending" or "ascending" (default) + + Examples: + + 1) Attribute foo of the group /bar_none in file quux.h5 + + h5dump -a /bar_none/foo quux.h5 + + 2) Selecting a subset from dataset /foo in file quux.h5 + + h5dump -d /foo -s "0,1" -S "1,1" -c "2,3" -k "2,2" quux.h5 + + 3) Saving dataset 'dset' in file quux.h5 to binary file 'out.bin' + using a little-endian type + + h5dump -d /dset -b LE -o out.bin quux.h5 + + 4) Display two packed bits (bits 0-1 and bits 4-6) in the dataset /dset + + h5dump -d /dset -M 0,1,4,3 quux.h5 + + 5) Dataset foo in files multi1.h5 multi2.h5 multi3.h5 + + h5dump -d /foo multi1.h5 multi2.h5 multi3.h5 + +h5dump error: missing file name diff --git a/tools/testfiles/tnofilename.ddl b/tools/testfiles/tnofilename.ddl deleted file mode 100644 index 0e78217..0000000 --- a/tools/testfiles/tnofilename.ddl +++ /dev/null @@ -1,87 +0,0 @@ -############################# -Expected output for 'h5dump ' -############################# -usage: h5dump [OPTIONS] file - OPTIONS - -h, --help Print a usage message and exit - -n, --contents Print a list of the file contents and exit - -B, --superblock Print the content of the super block - -H, --header Print the header only; no data is displayed - -A, --onlyattr Print the header and value of attributes - -i, --object-ids Print the object ids - -r, --string Print 1-byte integer datasets as ASCII - -e, --escape Escape non printing characters - -V, --version Print version number and exit - -a P, --attribute=P Print the specified attribute - -d P, --dataset=P Print the specified dataset - -y, --noindex Do not print array indices with the data - -p, --properties Print dataset filters, storage layout and fill value - -f D, --filedriver=D Specify which driver to open the file with - -g P, --group=P Print the specified group and all members - -l P, --soft-link=P Print the value(s) of the specified soft link - -o F, --output=F Output raw data into file F - -b B, --binary=B Binary file output, of form B - -t P, --datatype=P Print the specified named datatype - -w N, --width=N Set the number of columns of output. A value of 0 (zero) - sets the number of columns to the maximum (65535). - Default width is 80 columns. - -m T, --format=T Set the floating point output format - -q Q, --sort_by=Q Sort groups and attributes by index Q - -z Z, --sort_order=Z Sort groups and attributes by order Z - -R, --region Print dataset pointed by region references - -x, --xml Output in XML using Schema - -u, --use-dtd Output in XML using DTD - -D U, --xml-dtd=U Use the DTD or schema at U - -X S, --xml-ns=S (XML Schema) Use qualified names n the XML - ":": no namespace, default: "hdf5:" - E.g., to dump a file called `-f', use h5dump -- -f - --enable-error-stack Prints messages from the HDF5 error stack as they - occur. - - Subsetting is available by using the following options with a dataset - attribute. Subsetting is done by selecting a hyperslab from the data. - Thus, the options mirror those for performing a hyperslab selection. - One of the START, COUNT, STRIDE, or BLOCK parameters are mandatory if you do subsetting. - The STRIDE, COUNT, and BLOCK parameters are optional and will default to 1 in - each dimension. START is optional and will default to 0 in each dimension. - - -s START, --start=START Offset of start of subsetting selection - -S STRIDE, --stride=STRIDE Hyperslab stride - -c COUNT, --count=COUNT Number of blocks to include in selection - -k BLOCK, --block=BLOCK Size of block in hyperslab - START, COUNT, STRIDE, and BLOCK - is a list of integers the number of which are equal to the - number of dimensions in the dataspace being queried - - D - is the file driver to use in opening the file. Acceptable values - are "sec2", "family", "split", "multi", "direct", and "stream". Without - the file driver flag, the file will be opened with each driver in - turn and in the order specified above until one driver succeeds - in opening the file. - F - is a filename. - P - is the full path from the root group to the object. - N - is an integer greater than 1. - T - is a string containing the floating point format, e.g '%.3f' - U - is a URI reference (as defined in [IETF RFC 2396], - updated by [IETF RFC 2732]) - B - is the form of binary output: NATIVE for a memory type, FILE for the - file type, LE or BE for pre-existing little or big endian types. - Must be used with -o (output file) and it is recommended that - -d (dataset) is used. B is an optional argument, defaults to NATIVE - Q - is the sort index type. It can be "creation_order" or "name" (default) - Z - is the sort order type. It can be "descending" or "ascending" (default) - - Examples: - - 1) Attribute foo of the group /bar_none in file quux.h5 - - h5dump -a /bar_none/foo quux.h5 - - 2) Selecting a subset from dataset /foo in file quux.h5 - - h5dump -d /foo -s "0,1" -S "1,1" -c "2,3" -k "2,2" quux.h5 - - 3) Saving dataset 'dset' in file quux.h5 to binary file 'out.bin' - using a little-endian type - - h5dump -d /dset -b LE -o out.bin quux.h5 - diff --git a/tools/testfiles/tnullspace.ddl b/tools/testfiles/tnullspace.ddl index 5507b08..32e208f 100644 --- a/tools/testfiles/tnullspace.ddl +++ b/tools/testfiles/tnullspace.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump tnullspace.h5' -############################# HDF5 "tnullspace.h5" { GROUP "/" { ATTRIBUTE "attr" { diff --git a/tools/testfiles/tobjref.h5.xml b/tools/testfiles/tobjref.h5.xml index 825cb27..016b298 100644 --- a/tools/testfiles/tobjref.h5.xml +++ b/tools/testfiles/tobjref.h5.xml @@ -1,16 +1,13 @@ -############################# -Expected output for 'h5dump --xml tobjref.h5' -############################# - + - + - + @@ -39,9 +36,9 @@ Expected output for 'h5dump --xml tobjref.h5' - + - + @@ -56,7 +53,10 @@ Expected output for 'h5dump --xml tobjref.h5' - 0 3 6 9 + 0 + 3 + 6 + 9 @@ -64,9 +64,9 @@ Expected output for 'h5dump --xml tobjref.h5' - + - + @@ -81,7 +81,10 @@ Expected output for 'h5dump --xml tobjref.h5' - 0 0 0 0 + 0 + 0 + 0 + 0 diff --git a/tools/testfiles/topaque.h5.xml b/tools/testfiles/topaque.h5.xml index 3f44ace..314fd23 100644 --- a/tools/testfiles/topaque.h5.xml +++ b/tools/testfiles/topaque.h5.xml @@ -1,16 +1,13 @@ -############################# -Expected output for 'h5dump --xml topaque.h5' -############################# - + - + - + diff --git a/tools/testfiles/torderattr1.ddl b/tools/testfiles/torderattr1.ddl index de3b72b..fb7fd70 100644 --- a/tools/testfiles/torderattr1.ddl +++ b/tools/testfiles/torderattr1.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump -H --sort_by=name --sort_order=ascending torderattr.h5' -############################# HDF5 "torderattr.h5" { GROUP "/" { ATTRIBUTE "a" { @@ -88,7 +85,6 @@ GROUP "/" { DATATYPE H5T_STD_U8LE DATASPACE SCALAR } - DATATYPE "tt" H5T_STD_I32LE; ATTRIBUTE "a" { DATATYPE H5T_STD_U8LE @@ -102,6 +98,5 @@ GROUP "/" { DATATYPE H5T_STD_U8LE DATASPACE SCALAR } - } } diff --git a/tools/testfiles/torderattr1.h5.xml b/tools/testfiles/torderattr1.h5.xml index 15481fc..027cd64 100644 --- a/tools/testfiles/torderattr1.h5.xml +++ b/tools/testfiles/torderattr1.h5.xml @@ -1,8 +1,5 @@ -############################# -Expected output for 'h5dump --xml -H --sort_by=name --sort_order=ascending torderattr.h5' -############################# - + @@ -47,9 +44,9 @@ Expected output for 'h5dump --xml -H --sort_by=name --sort_order=ascending torde - + - + @@ -107,9 +104,9 @@ Expected output for 'h5dump --xml -H --sort_by=name --sort_order=ascending torde - + - + diff --git a/tools/testfiles/torderattr2.ddl b/tools/testfiles/torderattr2.ddl index 3686984..dbf615b 100644 --- a/tools/testfiles/torderattr2.ddl +++ b/tools/testfiles/torderattr2.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump -H --sort_by=name --sort_order=descending torderattr.h5' -############################# HDF5 "torderattr.h5" { GROUP "/" { ATTRIBUTE "c" { @@ -28,7 +25,6 @@ GROUP "/" { DATATYPE H5T_STD_U8LE DATASPACE SCALAR } - DATATYPE "t" H5T_STD_I32LE; ATTRIBUTE "c" { DATATYPE H5T_STD_U8LE @@ -42,7 +38,6 @@ GROUP "/" { DATATYPE H5T_STD_U8LE DATASPACE SCALAR } - GROUP "gt" { ATTRIBUTE "c" { DATATYPE H5T_STD_U8LE diff --git a/tools/testfiles/torderattr2.h5.xml b/tools/testfiles/torderattr2.h5.xml index ef28140..fe441da 100644 --- a/tools/testfiles/torderattr2.h5.xml +++ b/tools/testfiles/torderattr2.h5.xml @@ -1,8 +1,5 @@ -############################# -Expected output for 'h5dump --xml -H --sort_by=name --sort_order=descending torderattr.h5' -############################# - + @@ -143,9 +140,9 @@ Expected output for 'h5dump --xml -H --sort_by=name --sort_order=descending tord - + - + @@ -203,9 +200,9 @@ Expected output for 'h5dump --xml -H --sort_by=name --sort_order=descending tord - + - + diff --git a/tools/testfiles/torderattr3.ddl b/tools/testfiles/torderattr3.ddl index 9dc027a..a2990f7 100644 --- a/tools/testfiles/torderattr3.ddl +++ b/tools/testfiles/torderattr3.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump -H --sort_by=creation_order --sort_order=ascending torderattr.h5' -############################# HDF5 "torderattr.h5" { GROUP "/" { ATTRIBUTE "a" { @@ -88,7 +85,6 @@ GROUP "/" { DATATYPE H5T_STD_U8LE DATASPACE SCALAR } - DATATYPE "tt" H5T_STD_I32LE; ATTRIBUTE "c" { DATATYPE H5T_STD_U8LE @@ -102,6 +98,5 @@ GROUP "/" { DATATYPE H5T_STD_U8LE DATASPACE SCALAR } - } } diff --git a/tools/testfiles/torderattr3.h5.xml b/tools/testfiles/torderattr3.h5.xml index e9e131a..38bbef7 100644 --- a/tools/testfiles/torderattr3.h5.xml +++ b/tools/testfiles/torderattr3.h5.xml @@ -1,8 +1,5 @@ -############################# -Expected output for 'h5dump --xml -H --sort_by=creation_order --sort_order=ascending torderattr.h5' -############################# - + @@ -47,9 +44,9 @@ Expected output for 'h5dump --xml -H --sort_by=creation_order --sort_order=ascen - + - + @@ -107,9 +104,9 @@ Expected output for 'h5dump --xml -H --sort_by=creation_order --sort_order=ascen - + - + diff --git a/tools/testfiles/torderattr4.ddl b/tools/testfiles/torderattr4.ddl index 38af25d..000a852 100644 --- a/tools/testfiles/torderattr4.ddl +++ b/tools/testfiles/torderattr4.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump -H --sort_by=creation_order --sort_order=descending torderattr.h5' -############################# HDF5 "torderattr.h5" { GROUP "/" { ATTRIBUTE "c" { @@ -28,7 +25,6 @@ GROUP "/" { DATATYPE H5T_STD_U8LE DATASPACE SCALAR } - DATATYPE "t" H5T_STD_I32LE; ATTRIBUTE "c" { DATATYPE H5T_STD_U8LE @@ -42,7 +38,6 @@ GROUP "/" { DATATYPE H5T_STD_U8LE DATASPACE SCALAR } - GROUP "gt" { ATTRIBUTE "a" { DATATYPE H5T_STD_U8LE diff --git a/tools/testfiles/torderattr4.h5.xml b/tools/testfiles/torderattr4.h5.xml index 2f4a2ed..0f90b22 100644 --- a/tools/testfiles/torderattr4.h5.xml +++ b/tools/testfiles/torderattr4.h5.xml @@ -1,8 +1,5 @@ -############################# -Expected output for 'h5dump --xml -H --sort_by=creation_order --sort_order=descending torderattr.h5' -############################# - + @@ -143,9 +140,9 @@ Expected output for 'h5dump --xml -H --sort_by=creation_order --sort_order=desce - + - + @@ -203,9 +200,9 @@ Expected output for 'h5dump --xml -H --sort_by=creation_order --sort_order=desce - + - + diff --git a/tools/testfiles/tordergr1.ddl b/tools/testfiles/tordergr1.ddl index a78fc0f..0fa74d9 100644 --- a/tools/testfiles/tordergr1.ddl +++ b/tools/testfiles/tordergr1.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump --group=1 --sort_by=creation_order --sort_order=ascending tordergr.h5' -############################# HDF5 "tordergr.h5" { GROUP "1" { GROUP "c" { diff --git a/tools/testfiles/tordergr2.ddl b/tools/testfiles/tordergr2.ddl index 4a39d22..500d99c 100644 --- a/tools/testfiles/tordergr2.ddl +++ b/tools/testfiles/tordergr2.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump --group=1 --sort_by=creation_order --sort_order=descending tordergr.h5' -############################# HDF5 "tordergr.h5" { GROUP "1" { GROUP "a" { diff --git a/tools/testfiles/tordergr3.ddl b/tools/testfiles/tordergr3.ddl index c948ccb..99e9a6b 100644 --- a/tools/testfiles/tordergr3.ddl +++ b/tools/testfiles/tordergr3.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump -g 2 -q name -z ascending tordergr.h5' -############################# HDF5 "tordergr.h5" { GROUP "2" { GROUP "a" { diff --git a/tools/testfiles/tordergr4.ddl b/tools/testfiles/tordergr4.ddl index 5f5c454..1613d9d 100644 --- a/tools/testfiles/tordergr4.ddl +++ b/tools/testfiles/tordergr4.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump -g 2 -q name -z descending tordergr.h5' -############################# HDF5 "tordergr.h5" { GROUP "2" { GROUP "c" { diff --git a/tools/testfiles/tordergr5.ddl b/tools/testfiles/tordergr5.ddl index e7854bd..0ede967 100644 --- a/tools/testfiles/tordergr5.ddl +++ b/tools/testfiles/tordergr5.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump -q creation_order tordergr.h5' -############################# HDF5 "tordergr.h5" { GROUP "/" { GROUP "2" { diff --git a/tools/testfiles/tpbitsArray.ddl b/tools/testfiles/tpbitsArray.ddl new file mode 100644 index 0000000..125abb8 --- /dev/null +++ b/tools/testfiles/tpbitsArray.ddl @@ -0,0 +1,14 @@ +HDF5 "tarray1.h5" { +DATASET "/Dataset1" { + DATATYPE H5T_ARRAY { [4] H5T_STD_I32LE } + DATASPACE SIMPLE { ( 4 ) / ( 4 ) } + PACKED_BITS OFFSET=0 LENGTH=1 + DATA { + (0): [ 0, 1, 0, 1 ], [ 0, 1, 0, 1 ], [ 0, 1, 0, 1 ], [ 0, 1, 0, 1 ] + } + PACKED_BITS OFFSET=1 LENGTH=1 + DATA { + (0): [ 0, 0, 1, 1 ], [ 1, 1, 0, 0 ], [ 0, 0, 1, 1 ], [ 1, 1, 0, 0 ] + } +} +} diff --git a/tools/testfiles/tpbitsCharLengthExceeded.ddl b/tools/testfiles/tpbitsCharLengthExceeded.ddl new file mode 100644 index 0000000..b0683a7 --- /dev/null +++ b/tools/testfiles/tpbitsCharLengthExceeded.ddl @@ -0,0 +1,18 @@ +HDF5 "packedbits.h5" { +DATASET "/DS08BITS" { + DATATYPE H5T_STD_I8LE + DATASPACE SIMPLE { ( 8, 8 ) / ( 8, 8 ) } + PACKED_BITS OFFSET=2 LENGTH=7 + DATA { + (0,0): 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0 + } +} +} +h5dump error: Packed Bit offset+length value(9) too large. Max is 8 diff --git a/tools/testfiles/tpbitsCharOffsetExceeded.ddl b/tools/testfiles/tpbitsCharOffsetExceeded.ddl new file mode 100644 index 0000000..530fa05 --- /dev/null +++ b/tools/testfiles/tpbitsCharOffsetExceeded.ddl @@ -0,0 +1,18 @@ +HDF5 "packedbits.h5" { +DATASET "/DS08BITS" { + DATATYPE H5T_STD_I8LE + DATASPACE SIMPLE { ( 8, 8 ) / ( 8, 8 ) } + PACKED_BITS OFFSET=8 LENGTH=1 + DATA { + (0,0): 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0 + } +} +} +h5dump error: Packed Bit offset+length value(9) too large. Max is 8 diff --git a/tools/testfiles/tpbitsCompound.ddl b/tools/testfiles/tpbitsCompound.ddl new file mode 100644 index 0000000..c84272a --- /dev/null +++ b/tools/testfiles/tpbitsCompound.ddl @@ -0,0 +1,66 @@ +HDF5 "tcompound.h5" { +DATASET "/dset1" { + DATATYPE H5T_COMPOUND { + H5T_STD_I32BE "a_name"; + H5T_IEEE_F32BE "b_name"; + H5T_IEEE_F64BE "c_name"; + } + DATASPACE SIMPLE { ( 5 ) / ( 5 ) } + PACKED_BITS OFFSET=0 LENGTH=1 + DATA { + (0): { + 0, + 0, + 1 + }, + (1): { + 1, + 1, + 0.5 + }, + (2): { + 0, + 4, + 0.333333 + }, + (3): { + 1, + 9, + 0.25 + }, + (4): { + 0, + 16, + 0.2 + } + } + PACKED_BITS OFFSET=1 LENGTH=1 + DATA { + (0): { + 0, + 0, + 1 + }, + (1): { + 0, + 1, + 0.5 + }, + (2): { + 1, + 4, + 0.333333 + }, + (3): { + 1, + 9, + 0.25 + }, + (4): { + 0, + 16, + 0.2 + } + } +} +} diff --git a/tools/testfiles/tpbitsIncomplete.ddl b/tools/testfiles/tpbitsIncomplete.ddl new file mode 100644 index 0000000..0da055b --- /dev/null +++ b/tools/testfiles/tpbitsIncomplete.ddl @@ -0,0 +1,101 @@ +usage: h5dump [OPTIONS] files + OPTIONS + -h, --help Print a usage message and exit + -n, --contents Print a list of the file contents and exit + -B, --superblock Print the content of the super block + -H, --header Print the header only; no data is displayed + -A, --onlyattr Print the header and value of attributes + -i, --object-ids Print the object ids + -r, --string Print 1-byte integer datasets as ASCII + -e, --escape Escape non printing characters + -V, --version Print version number and exit + -a P, --attribute=P Print the specified attribute + -d P, --dataset=P Print the specified dataset + -y, --noindex Do not print array indices with the data + -p, --properties Print dataset filters, storage layout and fill value + -f D, --filedriver=D Specify which driver to open the file with + -g P, --group=P Print the specified group and all members + -l P, --soft-link=P Print the value(s) of the specified soft link + -o F, --output=F Output raw data into file F + -b B, --binary=B Binary file output, of form B + -t P, --datatype=P Print the specified named datatype + -w N, --width=N Set the number of columns of output. A value of 0 (zero) + sets the number of columns to the maximum (65535). + Default width is 80 columns. + -m T, --format=T Set the floating point output format + -q Q, --sort_by=Q Sort groups and attributes by index Q + -z Z, --sort_order=Z Sort groups and attributes by order Z + -M L, --packedbits=L Print packed bits as unsigned integers, using mask + format L for an integer dataset specified with + option -d. L is a list of offset,length values, + separated by commas. Offset is the beginning bit in + the data value and length is the number of bits of + the mask. + -R, --region Print dataset pointed by region references + -x, --xml Output in XML using Schema + -u, --use-dtd Output in XML using DTD + -D U, --xml-dtd=U Use the DTD or schema at U + -X S, --xml-ns=S (XML Schema) Use qualified names n the XML + ":": no namespace, default: "hdf5:" + E.g., to dump a file called `-f', use h5dump -- -f + --enable-error-stack Prints messages from the HDF5 error stack as they + occur. + --no-compact-subset Disable compact form of subsetting and allow the use + of "[" in datset names. + + Subsetting is available by using the following options with a dataset + attribute. Subsetting is done by selecting a hyperslab from the data. + Thus, the options mirror those for performing a hyperslab selection. + One of the START, COUNT, STRIDE, or BLOCK parameters are mandatory if you do subsetting. + The STRIDE, COUNT, and BLOCK parameters are optional and will default to 1 in + each dimension. START is optional and will default to 0 in each dimension. + + -s START, --start=START Offset of start of subsetting selection + -S STRIDE, --stride=STRIDE Hyperslab stride + -c COUNT, --count=COUNT Number of blocks to include in selection + -k BLOCK, --block=BLOCK Size of block in hyperslab + START, COUNT, STRIDE, and BLOCK - is a list of integers the number of which are equal to the + number of dimensions in the dataspace being queried + + D - is the file driver to use in opening the file. Acceptable values + are "sec2", "family", "split", "multi", "direct", and "stream". Without + the file driver flag, the file will be opened with each driver in + turn and in the order specified above until one driver succeeds + in opening the file. + F - is a filename. + P - is the full path from the root group to the object. + N - is an integer greater than 1. + T - is a string containing the floating point format, e.g '%.3f' + U - is a URI reference (as defined in [IETF RFC 2396], + updated by [IETF RFC 2732]) + B - is the form of binary output: NATIVE for a memory type, FILE for the + file type, LE or BE for pre-existing little or big endian types. + Must be used with -o (output file) and it is recommended that + -d (dataset) is used. B is an optional argument, defaults to NATIVE + Q - is the sort index type. It can be "creation_order" or "name" (default) + Z - is the sort order type. It can be "descending" or "ascending" (default) + + Examples: + + 1) Attribute foo of the group /bar_none in file quux.h5 + + h5dump -a /bar_none/foo quux.h5 + + 2) Selecting a subset from dataset /foo in file quux.h5 + + h5dump -d /foo -s "0,1" -S "1,1" -c "2,3" -k "2,2" quux.h5 + + 3) Saving dataset 'dset' in file quux.h5 to binary file 'out.bin' + using a little-endian type + + h5dump -d /dset -b LE -o out.bin quux.h5 + + 4) Display two packed bits (bits 0-1 and bits 4-6) in the dataset /dset + + h5dump -d /dset -M 0,1,4,3 quux.h5 + + 5) Dataset foo in files multi1.h5 multi2.h5 multi3.h5 + + h5dump -d /foo multi1.h5 multi2.h5 multi3.h5 + +h5dump error: Bad mask list(0,2,2,1,0,2,2,) diff --git a/tools/testfiles/tpbitsIntLengthExceeded.ddl b/tools/testfiles/tpbitsIntLengthExceeded.ddl new file mode 100644 index 0000000..1c919cd --- /dev/null +++ b/tools/testfiles/tpbitsIntLengthExceeded.ddl @@ -0,0 +1,18 @@ +HDF5 "packedbits.h5" { +DATASET "/DS16BITS" { + DATATYPE H5T_STD_I16LE + DATASPACE SIMPLE { ( 8, 16 ) / ( 8, 16 ) } + PACKED_BITS OFFSET=10 LENGTH=7 + DATA { + (0,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } +} +} +h5dump error: Packed Bit offset+length value(17) too large. Max is 16 diff --git a/tools/testfiles/tpbitsIntOffsetExceeded.ddl b/tools/testfiles/tpbitsIntOffsetExceeded.ddl new file mode 100644 index 0000000..f3b2a8c --- /dev/null +++ b/tools/testfiles/tpbitsIntOffsetExceeded.ddl @@ -0,0 +1,18 @@ +HDF5 "packedbits.h5" { +DATASET "/DS16BITS" { + DATATYPE H5T_STD_I16LE + DATASPACE SIMPLE { ( 8, 16 ) / ( 8, 16 ) } + PACKED_BITS OFFSET=16 LENGTH=1 + DATA { + (0,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } +} +} +h5dump error: Packed Bit offset+length value(17) too large. Max is 16 diff --git a/tools/testfiles/tpbitsLengthExceeded.ddl b/tools/testfiles/tpbitsLengthExceeded.ddl new file mode 100644 index 0000000..594d70c --- /dev/null +++ b/tools/testfiles/tpbitsLengthExceeded.ddl @@ -0,0 +1,101 @@ +usage: h5dump [OPTIONS] files + OPTIONS + -h, --help Print a usage message and exit + -n, --contents Print a list of the file contents and exit + -B, --superblock Print the content of the super block + -H, --header Print the header only; no data is displayed + -A, --onlyattr Print the header and value of attributes + -i, --object-ids Print the object ids + -r, --string Print 1-byte integer datasets as ASCII + -e, --escape Escape non printing characters + -V, --version Print version number and exit + -a P, --attribute=P Print the specified attribute + -d P, --dataset=P Print the specified dataset + -y, --noindex Do not print array indices with the data + -p, --properties Print dataset filters, storage layout and fill value + -f D, --filedriver=D Specify which driver to open the file with + -g P, --group=P Print the specified group and all members + -l P, --soft-link=P Print the value(s) of the specified soft link + -o F, --output=F Output raw data into file F + -b B, --binary=B Binary file output, of form B + -t P, --datatype=P Print the specified named datatype + -w N, --width=N Set the number of columns of output. A value of 0 (zero) + sets the number of columns to the maximum (65535). + Default width is 80 columns. + -m T, --format=T Set the floating point output format + -q Q, --sort_by=Q Sort groups and attributes by index Q + -z Z, --sort_order=Z Sort groups and attributes by order Z + -M L, --packedbits=L Print packed bits as unsigned integers, using mask + format L for an integer dataset specified with + option -d. L is a list of offset,length values, + separated by commas. Offset is the beginning bit in + the data value and length is the number of bits of + the mask. + -R, --region Print dataset pointed by region references + -x, --xml Output in XML using Schema + -u, --use-dtd Output in XML using DTD + -D U, --xml-dtd=U Use the DTD or schema at U + -X S, --xml-ns=S (XML Schema) Use qualified names n the XML + ":": no namespace, default: "hdf5:" + E.g., to dump a file called `-f', use h5dump -- -f + --enable-error-stack Prints messages from the HDF5 error stack as they + occur. + --no-compact-subset Disable compact form of subsetting and allow the use + of "[" in datset names. + + Subsetting is available by using the following options with a dataset + attribute. Subsetting is done by selecting a hyperslab from the data. + Thus, the options mirror those for performing a hyperslab selection. + One of the START, COUNT, STRIDE, or BLOCK parameters are mandatory if you do subsetting. + The STRIDE, COUNT, and BLOCK parameters are optional and will default to 1 in + each dimension. START is optional and will default to 0 in each dimension. + + -s START, --start=START Offset of start of subsetting selection + -S STRIDE, --stride=STRIDE Hyperslab stride + -c COUNT, --count=COUNT Number of blocks to include in selection + -k BLOCK, --block=BLOCK Size of block in hyperslab + START, COUNT, STRIDE, and BLOCK - is a list of integers the number of which are equal to the + number of dimensions in the dataspace being queried + + D - is the file driver to use in opening the file. Acceptable values + are "sec2", "family", "split", "multi", "direct", and "stream". Without + the file driver flag, the file will be opened with each driver in + turn and in the order specified above until one driver succeeds + in opening the file. + F - is a filename. + P - is the full path from the root group to the object. + N - is an integer greater than 1. + T - is a string containing the floating point format, e.g '%.3f' + U - is a URI reference (as defined in [IETF RFC 2396], + updated by [IETF RFC 2732]) + B - is the form of binary output: NATIVE for a memory type, FILE for the + file type, LE or BE for pre-existing little or big endian types. + Must be used with -o (output file) and it is recommended that + -d (dataset) is used. B is an optional argument, defaults to NATIVE + Q - is the sort index type. It can be "creation_order" or "name" (default) + Z - is the sort order type. It can be "descending" or "ascending" (default) + + Examples: + + 1) Attribute foo of the group /bar_none in file quux.h5 + + h5dump -a /bar_none/foo quux.h5 + + 2) Selecting a subset from dataset /foo in file quux.h5 + + h5dump -d /foo -s "0,1" -S "1,1" -c "2,3" -k "2,2" quux.h5 + + 3) Saving dataset 'dset' in file quux.h5 to binary file 'out.bin' + using a little-endian type + + h5dump -d /dset -b LE -o out.bin quux.h5 + + 4) Display two packed bits (bits 0-1 and bits 4-6) in the dataset /dset + + h5dump -d /dset -M 0,1,4,3 quux.h5 + + 5) Dataset foo in files multi1.h5 multi2.h5 multi3.h5 + + h5dump -d /foo multi1.h5 multi2.h5 multi3.h5 + +h5dump error: Packed Bit offset+length value(65) too large. Max is 64 diff --git a/tools/testfiles/tpbitsLengthPositive.ddl b/tools/testfiles/tpbitsLengthPositive.ddl new file mode 100644 index 0000000..7b3b678 --- /dev/null +++ b/tools/testfiles/tpbitsLengthPositive.ddl @@ -0,0 +1,101 @@ +usage: h5dump [OPTIONS] files + OPTIONS + -h, --help Print a usage message and exit + -n, --contents Print a list of the file contents and exit + -B, --superblock Print the content of the super block + -H, --header Print the header only; no data is displayed + -A, --onlyattr Print the header and value of attributes + -i, --object-ids Print the object ids + -r, --string Print 1-byte integer datasets as ASCII + -e, --escape Escape non printing characters + -V, --version Print version number and exit + -a P, --attribute=P Print the specified attribute + -d P, --dataset=P Print the specified dataset + -y, --noindex Do not print array indices with the data + -p, --properties Print dataset filters, storage layout and fill value + -f D, --filedriver=D Specify which driver to open the file with + -g P, --group=P Print the specified group and all members + -l P, --soft-link=P Print the value(s) of the specified soft link + -o F, --output=F Output raw data into file F + -b B, --binary=B Binary file output, of form B + -t P, --datatype=P Print the specified named datatype + -w N, --width=N Set the number of columns of output. A value of 0 (zero) + sets the number of columns to the maximum (65535). + Default width is 80 columns. + -m T, --format=T Set the floating point output format + -q Q, --sort_by=Q Sort groups and attributes by index Q + -z Z, --sort_order=Z Sort groups and attributes by order Z + -M L, --packedbits=L Print packed bits as unsigned integers, using mask + format L for an integer dataset specified with + option -d. L is a list of offset,length values, + separated by commas. Offset is the beginning bit in + the data value and length is the number of bits of + the mask. + -R, --region Print dataset pointed by region references + -x, --xml Output in XML using Schema + -u, --use-dtd Output in XML using DTD + -D U, --xml-dtd=U Use the DTD or schema at U + -X S, --xml-ns=S (XML Schema) Use qualified names n the XML + ":": no namespace, default: "hdf5:" + E.g., to dump a file called `-f', use h5dump -- -f + --enable-error-stack Prints messages from the HDF5 error stack as they + occur. + --no-compact-subset Disable compact form of subsetting and allow the use + of "[" in datset names. + + Subsetting is available by using the following options with a dataset + attribute. Subsetting is done by selecting a hyperslab from the data. + Thus, the options mirror those for performing a hyperslab selection. + One of the START, COUNT, STRIDE, or BLOCK parameters are mandatory if you do subsetting. + The STRIDE, COUNT, and BLOCK parameters are optional and will default to 1 in + each dimension. START is optional and will default to 0 in each dimension. + + -s START, --start=START Offset of start of subsetting selection + -S STRIDE, --stride=STRIDE Hyperslab stride + -c COUNT, --count=COUNT Number of blocks to include in selection + -k BLOCK, --block=BLOCK Size of block in hyperslab + START, COUNT, STRIDE, and BLOCK - is a list of integers the number of which are equal to the + number of dimensions in the dataspace being queried + + D - is the file driver to use in opening the file. Acceptable values + are "sec2", "family", "split", "multi", "direct", and "stream". Without + the file driver flag, the file will be opened with each driver in + turn and in the order specified above until one driver succeeds + in opening the file. + F - is a filename. + P - is the full path from the root group to the object. + N - is an integer greater than 1. + T - is a string containing the floating point format, e.g '%.3f' + U - is a URI reference (as defined in [IETF RFC 2396], + updated by [IETF RFC 2732]) + B - is the form of binary output: NATIVE for a memory type, FILE for the + file type, LE or BE for pre-existing little or big endian types. + Must be used with -o (output file) and it is recommended that + -d (dataset) is used. B is an optional argument, defaults to NATIVE + Q - is the sort index type. It can be "creation_order" or "name" (default) + Z - is the sort order type. It can be "descending" or "ascending" (default) + + Examples: + + 1) Attribute foo of the group /bar_none in file quux.h5 + + h5dump -a /bar_none/foo quux.h5 + + 2) Selecting a subset from dataset /foo in file quux.h5 + + h5dump -d /foo -s "0,1" -S "1,1" -c "2,3" -k "2,2" quux.h5 + + 3) Saving dataset 'dset' in file quux.h5 to binary file 'out.bin' + using a little-endian type + + h5dump -d /dset -b LE -o out.bin quux.h5 + + 4) Display two packed bits (bits 0-1 and bits 4-6) in the dataset /dset + + h5dump -d /dset -M 0,1,4,3 quux.h5 + + 5) Dataset foo in files multi1.h5 multi2.h5 multi3.h5 + + h5dump -d /foo multi1.h5 multi2.h5 multi3.h5 + +h5dump error: Packed Bit length value(0) must be positive. diff --git a/tools/testfiles/tpbitsLongLengthExceeded.ddl b/tools/testfiles/tpbitsLongLengthExceeded.ddl new file mode 100644 index 0000000..812c300 --- /dev/null +++ b/tools/testfiles/tpbitsLongLengthExceeded.ddl @@ -0,0 +1,26 @@ +HDF5 "packedbits.h5" { +DATASET "/DS32BITS" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 8, 32 ) / ( 8, 32 ) } + PACKED_BITS OFFSET=26 LENGTH=7 + DATA { + (0,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (0,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } +} +} +h5dump error: Packed Bit offset+length value(33) too large. Max is 32 diff --git a/tools/testfiles/tpbitsLongOffsetExceeded.ddl b/tools/testfiles/tpbitsLongOffsetExceeded.ddl new file mode 100644 index 0000000..cbea722 --- /dev/null +++ b/tools/testfiles/tpbitsLongOffsetExceeded.ddl @@ -0,0 +1,26 @@ +HDF5 "packedbits.h5" { +DATASET "/DS32BITS" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 8, 32 ) / ( 8, 32 ) } + PACKED_BITS OFFSET=32 LENGTH=1 + DATA { + (0,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (0,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } +} +} +h5dump error: Packed Bit offset+length value(33) too large. Max is 32 diff --git a/tools/testfiles/tpbitsMax.ddl b/tools/testfiles/tpbitsMax.ddl new file mode 100644 index 0000000..e569488 --- /dev/null +++ b/tools/testfiles/tpbitsMax.ddl @@ -0,0 +1,94 @@ +HDF5 "packedbits.h5" { +DATASET "/DS08BITS" { + DATATYPE H5T_STD_I8LE + DATASPACE SIMPLE { ( 8, 8 ) / ( 8, 8 ) } + PACKED_BITS OFFSET=0 LENGTH=1 + DATA { + (0,0): 1, 0, 0, 0, 0, 0, 0, 0, + (1,0): 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=1 LENGTH=1 + DATA { + (0,0): 1, 1, 0, 0, 0, 0, 0, 0, + (1,0): 1, 0, 0, 0, 0, 0, 0, 0, + (2,0): 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=2 LENGTH=1 + DATA { + (0,0): 1, 1, 1, 0, 0, 0, 0, 0, + (1,0): 1, 1, 0, 0, 0, 0, 0, 0, + (2,0): 1, 0, 0, 0, 0, 0, 0, 0, + (3,0): 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=3 LENGTH=1 + DATA { + (0,0): 1, 1, 1, 1, 0, 0, 0, 0, + (1,0): 1, 1, 1, 0, 0, 0, 0, 0, + (2,0): 1, 1, 0, 0, 0, 0, 0, 0, + (3,0): 1, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=4 LENGTH=1 + DATA { + (0,0): 1, 1, 1, 1, 1, 0, 0, 0, + (1,0): 1, 1, 1, 1, 0, 0, 0, 0, + (2,0): 1, 1, 1, 0, 0, 0, 0, 0, + (3,0): 1, 1, 0, 0, 0, 0, 0, 0, + (4,0): 1, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=5 LENGTH=1 + DATA { + (0,0): 1, 1, 1, 1, 1, 1, 0, 0, + (1,0): 1, 1, 1, 1, 1, 0, 0, 0, + (2,0): 1, 1, 1, 1, 0, 0, 0, 0, + (3,0): 1, 1, 1, 0, 0, 0, 0, 0, + (4,0): 1, 1, 0, 0, 0, 0, 0, 0, + (5,0): 1, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=6 LENGTH=1 + DATA { + (0,0): 1, 1, 1, 1, 1, 1, 1, 0, + (1,0): 1, 1, 1, 1, 1, 1, 0, 0, + (2,0): 1, 1, 1, 1, 1, 0, 0, 0, + (3,0): 1, 1, 1, 1, 0, 0, 0, 0, + (4,0): 1, 1, 1, 0, 0, 0, 0, 0, + (5,0): 1, 1, 0, 0, 0, 0, 0, 0, + (6,0): 1, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=7 LENGTH=1 + DATA { + (0,0): 1, 1, 1, 1, 1, 1, 1, 1, + (1,0): 1, 1, 1, 1, 1, 1, 1, 0, + (2,0): 1, 1, 1, 1, 1, 1, 0, 0, + (3,0): 1, 1, 1, 1, 1, 0, 0, 0, + (4,0): 1, 1, 1, 1, 0, 0, 0, 0, + (5,0): 1, 1, 1, 0, 0, 0, 0, 0, + (6,0): 1, 1, 0, 0, 0, 0, 0, 0, + (7,0): 1, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/tpbitsMaxExceeded.ddl b/tools/testfiles/tpbitsMaxExceeded.ddl new file mode 100644 index 0000000..60bc2b1 --- /dev/null +++ b/tools/testfiles/tpbitsMaxExceeded.ddl @@ -0,0 +1,101 @@ +usage: h5dump [OPTIONS] files + OPTIONS + -h, --help Print a usage message and exit + -n, --contents Print a list of the file contents and exit + -B, --superblock Print the content of the super block + -H, --header Print the header only; no data is displayed + -A, --onlyattr Print the header and value of attributes + -i, --object-ids Print the object ids + -r, --string Print 1-byte integer datasets as ASCII + -e, --escape Escape non printing characters + -V, --version Print version number and exit + -a P, --attribute=P Print the specified attribute + -d P, --dataset=P Print the specified dataset + -y, --noindex Do not print array indices with the data + -p, --properties Print dataset filters, storage layout and fill value + -f D, --filedriver=D Specify which driver to open the file with + -g P, --group=P Print the specified group and all members + -l P, --soft-link=P Print the value(s) of the specified soft link + -o F, --output=F Output raw data into file F + -b B, --binary=B Binary file output, of form B + -t P, --datatype=P Print the specified named datatype + -w N, --width=N Set the number of columns of output. A value of 0 (zero) + sets the number of columns to the maximum (65535). + Default width is 80 columns. + -m T, --format=T Set the floating point output format + -q Q, --sort_by=Q Sort groups and attributes by index Q + -z Z, --sort_order=Z Sort groups and attributes by order Z + -M L, --packedbits=L Print packed bits as unsigned integers, using mask + format L for an integer dataset specified with + option -d. L is a list of offset,length values, + separated by commas. Offset is the beginning bit in + the data value and length is the number of bits of + the mask. + -R, --region Print dataset pointed by region references + -x, --xml Output in XML using Schema + -u, --use-dtd Output in XML using DTD + -D U, --xml-dtd=U Use the DTD or schema at U + -X S, --xml-ns=S (XML Schema) Use qualified names n the XML + ":": no namespace, default: "hdf5:" + E.g., to dump a file called `-f', use h5dump -- -f + --enable-error-stack Prints messages from the HDF5 error stack as they + occur. + --no-compact-subset Disable compact form of subsetting and allow the use + of "[" in datset names. + + Subsetting is available by using the following options with a dataset + attribute. Subsetting is done by selecting a hyperslab from the data. + Thus, the options mirror those for performing a hyperslab selection. + One of the START, COUNT, STRIDE, or BLOCK parameters are mandatory if you do subsetting. + The STRIDE, COUNT, and BLOCK parameters are optional and will default to 1 in + each dimension. START is optional and will default to 0 in each dimension. + + -s START, --start=START Offset of start of subsetting selection + -S STRIDE, --stride=STRIDE Hyperslab stride + -c COUNT, --count=COUNT Number of blocks to include in selection + -k BLOCK, --block=BLOCK Size of block in hyperslab + START, COUNT, STRIDE, and BLOCK - is a list of integers the number of which are equal to the + number of dimensions in the dataspace being queried + + D - is the file driver to use in opening the file. Acceptable values + are "sec2", "family", "split", "multi", "direct", and "stream". Without + the file driver flag, the file will be opened with each driver in + turn and in the order specified above until one driver succeeds + in opening the file. + F - is a filename. + P - is the full path from the root group to the object. + N - is an integer greater than 1. + T - is a string containing the floating point format, e.g '%.3f' + U - is a URI reference (as defined in [IETF RFC 2396], + updated by [IETF RFC 2732]) + B - is the form of binary output: NATIVE for a memory type, FILE for the + file type, LE or BE for pre-existing little or big endian types. + Must be used with -o (output file) and it is recommended that + -d (dataset) is used. B is an optional argument, defaults to NATIVE + Q - is the sort index type. It can be "creation_order" or "name" (default) + Z - is the sort order type. It can be "descending" or "ascending" (default) + + Examples: + + 1) Attribute foo of the group /bar_none in file quux.h5 + + h5dump -a /bar_none/foo quux.h5 + + 2) Selecting a subset from dataset /foo in file quux.h5 + + h5dump -d /foo -s "0,1" -S "1,1" -c "2,3" -k "2,2" quux.h5 + + 3) Saving dataset 'dset' in file quux.h5 to binary file 'out.bin' + using a little-endian type + + h5dump -d /dset -b LE -o out.bin quux.h5 + + 4) Display two packed bits (bits 0-1 and bits 4-6) in the dataset /dset + + h5dump -d /dset -M 0,1,4,3 quux.h5 + + 5) Dataset foo in files multi1.h5 multi2.h5 multi3.h5 + + h5dump -d /foo multi1.h5 multi2.h5 multi3.h5 + +h5dump error: Too many masks requested (max. 8). Mask list(0,1,0,1,1,1,2,1,3,1,4,1,5,1,6,1,7,1) diff --git a/tools/testfiles/tpbitsOffsetExceeded.ddl b/tools/testfiles/tpbitsOffsetExceeded.ddl new file mode 100644 index 0000000..5db6a91 --- /dev/null +++ b/tools/testfiles/tpbitsOffsetExceeded.ddl @@ -0,0 +1,101 @@ +usage: h5dump [OPTIONS] files + OPTIONS + -h, --help Print a usage message and exit + -n, --contents Print a list of the file contents and exit + -B, --superblock Print the content of the super block + -H, --header Print the header only; no data is displayed + -A, --onlyattr Print the header and value of attributes + -i, --object-ids Print the object ids + -r, --string Print 1-byte integer datasets as ASCII + -e, --escape Escape non printing characters + -V, --version Print version number and exit + -a P, --attribute=P Print the specified attribute + -d P, --dataset=P Print the specified dataset + -y, --noindex Do not print array indices with the data + -p, --properties Print dataset filters, storage layout and fill value + -f D, --filedriver=D Specify which driver to open the file with + -g P, --group=P Print the specified group and all members + -l P, --soft-link=P Print the value(s) of the specified soft link + -o F, --output=F Output raw data into file F + -b B, --binary=B Binary file output, of form B + -t P, --datatype=P Print the specified named datatype + -w N, --width=N Set the number of columns of output. A value of 0 (zero) + sets the number of columns to the maximum (65535). + Default width is 80 columns. + -m T, --format=T Set the floating point output format + -q Q, --sort_by=Q Sort groups and attributes by index Q + -z Z, --sort_order=Z Sort groups and attributes by order Z + -M L, --packedbits=L Print packed bits as unsigned integers, using mask + format L for an integer dataset specified with + option -d. L is a list of offset,length values, + separated by commas. Offset is the beginning bit in + the data value and length is the number of bits of + the mask. + -R, --region Print dataset pointed by region references + -x, --xml Output in XML using Schema + -u, --use-dtd Output in XML using DTD + -D U, --xml-dtd=U Use the DTD or schema at U + -X S, --xml-ns=S (XML Schema) Use qualified names n the XML + ":": no namespace, default: "hdf5:" + E.g., to dump a file called `-f', use h5dump -- -f + --enable-error-stack Prints messages from the HDF5 error stack as they + occur. + --no-compact-subset Disable compact form of subsetting and allow the use + of "[" in datset names. + + Subsetting is available by using the following options with a dataset + attribute. Subsetting is done by selecting a hyperslab from the data. + Thus, the options mirror those for performing a hyperslab selection. + One of the START, COUNT, STRIDE, or BLOCK parameters are mandatory if you do subsetting. + The STRIDE, COUNT, and BLOCK parameters are optional and will default to 1 in + each dimension. START is optional and will default to 0 in each dimension. + + -s START, --start=START Offset of start of subsetting selection + -S STRIDE, --stride=STRIDE Hyperslab stride + -c COUNT, --count=COUNT Number of blocks to include in selection + -k BLOCK, --block=BLOCK Size of block in hyperslab + START, COUNT, STRIDE, and BLOCK - is a list of integers the number of which are equal to the + number of dimensions in the dataspace being queried + + D - is the file driver to use in opening the file. Acceptable values + are "sec2", "family", "split", "multi", "direct", and "stream". Without + the file driver flag, the file will be opened with each driver in + turn and in the order specified above until one driver succeeds + in opening the file. + F - is a filename. + P - is the full path from the root group to the object. + N - is an integer greater than 1. + T - is a string containing the floating point format, e.g '%.3f' + U - is a URI reference (as defined in [IETF RFC 2396], + updated by [IETF RFC 2732]) + B - is the form of binary output: NATIVE for a memory type, FILE for the + file type, LE or BE for pre-existing little or big endian types. + Must be used with -o (output file) and it is recommended that + -d (dataset) is used. B is an optional argument, defaults to NATIVE + Q - is the sort index type. It can be "creation_order" or "name" (default) + Z - is the sort order type. It can be "descending" or "ascending" (default) + + Examples: + + 1) Attribute foo of the group /bar_none in file quux.h5 + + h5dump -a /bar_none/foo quux.h5 + + 2) Selecting a subset from dataset /foo in file quux.h5 + + h5dump -d /foo -s "0,1" -S "1,1" -c "2,3" -k "2,2" quux.h5 + + 3) Saving dataset 'dset' in file quux.h5 to binary file 'out.bin' + using a little-endian type + + h5dump -d /dset -b LE -o out.bin quux.h5 + + 4) Display two packed bits (bits 0-1 and bits 4-6) in the dataset /dset + + h5dump -d /dset -M 0,1,4,3 quux.h5 + + 5) Dataset foo in files multi1.h5 multi2.h5 multi3.h5 + + h5dump -d /foo multi1.h5 multi2.h5 multi3.h5 + +h5dump error: Packed Bit offset value(64) must be between 0 and 63 diff --git a/tools/testfiles/tpbitsOffsetNegative.ddl b/tools/testfiles/tpbitsOffsetNegative.ddl new file mode 100644 index 0000000..060fc37 --- /dev/null +++ b/tools/testfiles/tpbitsOffsetNegative.ddl @@ -0,0 +1,101 @@ +usage: h5dump [OPTIONS] files + OPTIONS + -h, --help Print a usage message and exit + -n, --contents Print a list of the file contents and exit + -B, --superblock Print the content of the super block + -H, --header Print the header only; no data is displayed + -A, --onlyattr Print the header and value of attributes + -i, --object-ids Print the object ids + -r, --string Print 1-byte integer datasets as ASCII + -e, --escape Escape non printing characters + -V, --version Print version number and exit + -a P, --attribute=P Print the specified attribute + -d P, --dataset=P Print the specified dataset + -y, --noindex Do not print array indices with the data + -p, --properties Print dataset filters, storage layout and fill value + -f D, --filedriver=D Specify which driver to open the file with + -g P, --group=P Print the specified group and all members + -l P, --soft-link=P Print the value(s) of the specified soft link + -o F, --output=F Output raw data into file F + -b B, --binary=B Binary file output, of form B + -t P, --datatype=P Print the specified named datatype + -w N, --width=N Set the number of columns of output. A value of 0 (zero) + sets the number of columns to the maximum (65535). + Default width is 80 columns. + -m T, --format=T Set the floating point output format + -q Q, --sort_by=Q Sort groups and attributes by index Q + -z Z, --sort_order=Z Sort groups and attributes by order Z + -M L, --packedbits=L Print packed bits as unsigned integers, using mask + format L for an integer dataset specified with + option -d. L is a list of offset,length values, + separated by commas. Offset is the beginning bit in + the data value and length is the number of bits of + the mask. + -R, --region Print dataset pointed by region references + -x, --xml Output in XML using Schema + -u, --use-dtd Output in XML using DTD + -D U, --xml-dtd=U Use the DTD or schema at U + -X S, --xml-ns=S (XML Schema) Use qualified names n the XML + ":": no namespace, default: "hdf5:" + E.g., to dump a file called `-f', use h5dump -- -f + --enable-error-stack Prints messages from the HDF5 error stack as they + occur. + --no-compact-subset Disable compact form of subsetting and allow the use + of "[" in datset names. + + Subsetting is available by using the following options with a dataset + attribute. Subsetting is done by selecting a hyperslab from the data. + Thus, the options mirror those for performing a hyperslab selection. + One of the START, COUNT, STRIDE, or BLOCK parameters are mandatory if you do subsetting. + The STRIDE, COUNT, and BLOCK parameters are optional and will default to 1 in + each dimension. START is optional and will default to 0 in each dimension. + + -s START, --start=START Offset of start of subsetting selection + -S STRIDE, --stride=STRIDE Hyperslab stride + -c COUNT, --count=COUNT Number of blocks to include in selection + -k BLOCK, --block=BLOCK Size of block in hyperslab + START, COUNT, STRIDE, and BLOCK - is a list of integers the number of which are equal to the + number of dimensions in the dataspace being queried + + D - is the file driver to use in opening the file. Acceptable values + are "sec2", "family", "split", "multi", "direct", and "stream". Without + the file driver flag, the file will be opened with each driver in + turn and in the order specified above until one driver succeeds + in opening the file. + F - is a filename. + P - is the full path from the root group to the object. + N - is an integer greater than 1. + T - is a string containing the floating point format, e.g '%.3f' + U - is a URI reference (as defined in [IETF RFC 2396], + updated by [IETF RFC 2732]) + B - is the form of binary output: NATIVE for a memory type, FILE for the + file type, LE or BE for pre-existing little or big endian types. + Must be used with -o (output file) and it is recommended that + -d (dataset) is used. B is an optional argument, defaults to NATIVE + Q - is the sort index type. It can be "creation_order" or "name" (default) + Z - is the sort order type. It can be "descending" or "ascending" (default) + + Examples: + + 1) Attribute foo of the group /bar_none in file quux.h5 + + h5dump -a /bar_none/foo quux.h5 + + 2) Selecting a subset from dataset /foo in file quux.h5 + + h5dump -d /foo -s "0,1" -S "1,1" -c "2,3" -k "2,2" quux.h5 + + 3) Saving dataset 'dset' in file quux.h5 to binary file 'out.bin' + using a little-endian type + + h5dump -d /dset -b LE -o out.bin quux.h5 + + 4) Display two packed bits (bits 0-1 and bits 4-6) in the dataset /dset + + h5dump -d /dset -M 0,1,4,3 quux.h5 + + 5) Dataset foo in files multi1.h5 multi2.h5 multi3.h5 + + h5dump -d /foo multi1.h5 multi2.h5 multi3.h5 + +h5dump error: Bad mask list(-1,1) diff --git a/tools/testfiles/tpbitsOverlapped.ddl b/tools/testfiles/tpbitsOverlapped.ddl new file mode 100644 index 0000000..9dcc9d2 --- /dev/null +++ b/tools/testfiles/tpbitsOverlapped.ddl @@ -0,0 +1,50 @@ +HDF5 "packedbits.h5" { +DATASET "/DS08BITS" { + DATATYPE H5T_STD_I8LE + DATASPACE SIMPLE { ( 8, 8 ) / ( 8, 8 ) } + PACKED_BITS OFFSET=0 LENGTH=1 + DATA { + (0,0): 1, 0, 0, 0, 0, 0, 0, 0, + (1,0): 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=1 LENGTH=1 + DATA { + (0,0): 1, 1, 0, 0, 0, 0, 0, 0, + (1,0): 1, 0, 0, 0, 0, 0, 0, 0, + (2,0): 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=2 LENGTH=1 + DATA { + (0,0): 1, 1, 1, 0, 0, 0, 0, 0, + (1,0): 1, 1, 0, 0, 0, 0, 0, 0, + (2,0): 1, 0, 0, 0, 0, 0, 0, 0, + (3,0): 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=0 LENGTH=3 + DATA { + (0,0): 7, 6, 4, 0, 0, 0, 0, 0, + (1,0): 6, 4, 0, 0, 0, 0, 0, 0, + (2,0): 4, 0, 0, 0, 0, 0, 0, 0, + (3,0): 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/tpbitsSigned.ddl b/tools/testfiles/tpbitsSigned.ddl new file mode 100644 index 0000000..b843388 --- /dev/null +++ b/tools/testfiles/tpbitsSigned.ddl @@ -0,0 +1,28 @@ +HDF5 "packedbits.h5" { +DATASET "/DS08BITS" { + DATATYPE H5T_STD_I8LE + DATASPACE SIMPLE { ( 8, 8 ) / ( 8, 8 ) } + PACKED_BITS OFFSET=0 LENGTH=2 + DATA { + (0,0): 3, 2, 0, 0, 0, 0, 0, 0, + (1,0): 2, 0, 0, 0, 0, 0, 0, 0, + (2,0): 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=2 LENGTH=6 + DATA { + (0,0): 63, 63, 63, 62, 60, 56, 48, 32, + (1,0): 63, 63, 62, 60, 56, 48, 32, 0, + (2,0): 63, 62, 60, 56, 48, 32, 0, 0, + (3,0): 62, 60, 56, 48, 32, 0, 0, 0, + (4,0): 60, 56, 48, 32, 0, 0, 0, 0, + (5,0): 56, 48, 32, 0, 0, 0, 0, 0, + (6,0): 48, 32, 0, 0, 0, 0, 0, 0, + (7,0): 32, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/tpbitsSigned2.ddl b/tools/testfiles/tpbitsSigned2.ddl new file mode 100644 index 0000000..932b5fd --- /dev/null +++ b/tools/testfiles/tpbitsSigned2.ddl @@ -0,0 +1,50 @@ +HDF5 "packedbits.h5" { +DATASET "/DS08BITS" { + DATATYPE H5T_STD_I8LE + DATASPACE SIMPLE { ( 8, 8 ) / ( 8, 8 ) } + PACKED_BITS OFFSET=0 LENGTH=2 + DATA { + (0,0): 3, 2, 0, 0, 0, 0, 0, 0, + (1,0): 2, 0, 0, 0, 0, 0, 0, 0, + (2,0): 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=2 LENGTH=2 + DATA { + (0,0): 3, 3, 3, 2, 0, 0, 0, 0, + (1,0): 3, 3, 2, 0, 0, 0, 0, 0, + (2,0): 3, 2, 0, 0, 0, 0, 0, 0, + (3,0): 2, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=4 LENGTH=2 + DATA { + (0,0): 3, 3, 3, 3, 3, 2, 0, 0, + (1,0): 3, 3, 3, 3, 2, 0, 0, 0, + (2,0): 3, 3, 3, 2, 0, 0, 0, 0, + (3,0): 3, 3, 2, 0, 0, 0, 0, 0, + (4,0): 3, 2, 0, 0, 0, 0, 0, 0, + (5,0): 2, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=6 LENGTH=2 + DATA { + (0,0): 3, 3, 3, 3, 3, 3, 3, 2, + (1,0): 3, 3, 3, 3, 3, 3, 2, 0, + (2,0): 3, 3, 3, 3, 3, 2, 0, 0, + (3,0): 3, 3, 3, 3, 2, 0, 0, 0, + (4,0): 3, 3, 3, 2, 0, 0, 0, 0, + (5,0): 3, 3, 2, 0, 0, 0, 0, 0, + (6,0): 3, 2, 0, 0, 0, 0, 0, 0, + (7,0): 2, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/tpbitsSigned4.ddl b/tools/testfiles/tpbitsSigned4.ddl new file mode 100644 index 0000000..9eacd83 --- /dev/null +++ b/tools/testfiles/tpbitsSigned4.ddl @@ -0,0 +1,28 @@ +HDF5 "packedbits.h5" { +DATASET "/DS08BITS" { + DATATYPE H5T_STD_I8LE + DATASPACE SIMPLE { ( 8, 8 ) / ( 8, 8 ) } + PACKED_BITS OFFSET=0 LENGTH=4 + DATA { + (0,0): 15, 14, 12, 8, 0, 0, 0, 0, + (1,0): 14, 12, 8, 0, 0, 0, 0, 0, + (2,0): 12, 8, 0, 0, 0, 0, 0, 0, + (3,0): 8, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=4 LENGTH=4 + DATA { + (0,0): 15, 15, 15, 15, 15, 14, 12, 8, + (1,0): 15, 15, 15, 15, 14, 12, 8, 0, + (2,0): 15, 15, 15, 14, 12, 8, 0, 0, + (3,0): 15, 15, 14, 12, 8, 0, 0, 0, + (4,0): 15, 14, 12, 8, 0, 0, 0, 0, + (5,0): 14, 12, 8, 0, 0, 0, 0, 0, + (6,0): 12, 8, 0, 0, 0, 0, 0, 0, + (7,0): 8, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/tpbitsSignedInt.ddl b/tools/testfiles/tpbitsSignedInt.ddl new file mode 100644 index 0000000..5c37e77 --- /dev/null +++ b/tools/testfiles/tpbitsSignedInt.ddl @@ -0,0 +1,28 @@ +HDF5 "packedbits.h5" { +DATASET "/DS16BITS" { + DATATYPE H5T_STD_I16LE + DATASPACE SIMPLE { ( 8, 16 ) / ( 8, 16 ) } + PACKED_BITS OFFSET=0 LENGTH=2 + DATA { + (0,0): 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=10 LENGTH=6 + DATA { + (0,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, + (1,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, + (2,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, + (3,0): 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, + (4,0): 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, + (5,0): 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, + (6,0): 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, 0, + (7,0): 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/tpbitsSignedInt4.ddl b/tools/testfiles/tpbitsSignedInt4.ddl new file mode 100644 index 0000000..4e9f0f6 --- /dev/null +++ b/tools/testfiles/tpbitsSignedInt4.ddl @@ -0,0 +1,50 @@ +HDF5 "packedbits.h5" { +DATASET "/DS16BITS" { + DATATYPE H5T_STD_I16LE + DATASPACE SIMPLE { ( 8, 16 ) / ( 8, 16 ) } + PACKED_BITS OFFSET=0 LENGTH=4 + DATA { + (0,0): 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=4 LENGTH=4 + DATA { + (0,0): 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=8 LENGTH=4 + DATA { + (0,0): 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, + (1,0): 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, + (2,0): 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, + (3,0): 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, + (4,0): 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=12 LENGTH=4 + DATA { + (0,0): 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, + (1,0): 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, + (2,0): 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, + (3,0): 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, + (4,0): 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, + (5,0): 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, + (6,0): 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, + (7,0): 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/tpbitsSignedInt8.ddl b/tools/testfiles/tpbitsSignedInt8.ddl new file mode 100644 index 0000000..f2d6069 --- /dev/null +++ b/tools/testfiles/tpbitsSignedInt8.ddl @@ -0,0 +1,34 @@ +HDF5 "packedbits.h5" { +DATASET "/DS16BITS" { + DATATYPE H5T_STD_I16LE + DATASPACE SIMPLE { ( 8, 16 ) / ( 8, 16 ) } + PACKED_BITS OFFSET=0 LENGTH=8 + DATA { + (0,0): 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=8 LENGTH=8 + DATA { + (0,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, + (0,13): 224, 192, 128, + (1,0): 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, + (1,13): 192, 128, 0, + (2,0): 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, + (2,13): 128, 0, 0, + (3,0): 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, + (3,14): 0, 0, + (4,0): 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, + (4,14): 0, 0, + (5,0): 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, + (5,15): 0, + (6,0): 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, + (7,0): 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/tpbitsSignedIntWhole.ddl b/tools/testfiles/tpbitsSignedIntWhole.ddl new file mode 100644 index 0000000..598c446 --- /dev/null +++ b/tools/testfiles/tpbitsSignedIntWhole.ddl @@ -0,0 +1,25 @@ +HDF5 "packedbits.h5" { +DATASET "/DS16BITS" { + DATATYPE H5T_STD_I16LE + DATASPACE SIMPLE { ( 8, 16 ) / ( 8, 16 ) } + PACKED_BITS OFFSET=0 LENGTH=16 + DATA { + (0,0): -1, -2, -4, -8, -16, -32, -64, -128, -256, -512, -1024, -2048, + (0,12): -4096, -8192, -16384, -32768, + (1,0): -2, -4, -8, -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, + (1,12): -8192, -16384, -32768, 0, + (2,0): -4, -8, -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, + (2,11): -8192, -16384, -32768, 0, 0, + (3,0): -8, -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, -8192, + (3,11): -16384, -32768, 0, 0, 0, + (4,0): -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, -8192, + (4,10): -16384, -32768, 0, 0, 0, 0, + (5,0): -32, -64, -128, -256, -512, -1024, -2048, -4096, -8192, -16384, + (5,10): -32768, 0, 0, 0, 0, 0, + (6,0): -64, -128, -256, -512, -1024, -2048, -4096, -8192, -16384, -32768, + (6,10): 0, 0, 0, 0, 0, 0, + (7,0): -128, -256, -512, -1024, -2048, -4096, -8192, -16384, -32768, 0, 0, + (7,11): 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/tpbitsSignedLong.ddl b/tools/testfiles/tpbitsSignedLong.ddl new file mode 100644 index 0000000..b3eba61 --- /dev/null +++ b/tools/testfiles/tpbitsSignedLong.ddl @@ -0,0 +1,44 @@ +HDF5 "packedbits.h5" { +DATASET "/DS32BITS" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 8, 32 ) / ( 8, 32 ) } + PACKED_BITS OFFSET=0 LENGTH=2 + DATA { + (0,0): 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (0,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=26 LENGTH=6 + DATA { + (0,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (0,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, + (1,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (1,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, + (2,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (2,17): 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, + (3,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (3,17): 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, + (4,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (4,17): 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, + (5,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (5,17): 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, + (6,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (6,17): 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, 0, + (7,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (7,17): 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/tpbitsSignedLong16.ddl b/tools/testfiles/tpbitsSignedLong16.ddl new file mode 100644 index 0000000..83fa889 --- /dev/null +++ b/tools/testfiles/tpbitsSignedLong16.ddl @@ -0,0 +1,67 @@ +HDF5 "packedbits.h5" { +DATASET "/DS32BITS" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 8, 32 ) / ( 8, 32 ) } + PACKED_BITS OFFSET=0 LENGTH=16 + DATA { + (0,0): 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, + (0,9): 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, + (0,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, + (1,9): 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, + (1,23): 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, + (2,9): 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,25): 0, 0, 0, 0, 0, 0, 0, + (3,0): 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, + (3,9): 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,26): 0, 0, 0, 0, 0, 0, + (4,0): 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, + (4,9): 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,27): 0, 0, 0, 0, 0, + (5,0): 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, + (5,9): 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,29): 0, 0, 0, + (6,0): 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, + (6,9): 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,30): 0, 0, + (7,0): 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, + (7,10): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=16 LENGTH=16 + DATA { + (0,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (0,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65534, + (0,18): 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, + (0,27): 63488, 61440, 57344, 49152, 32768, + (1,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (1,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65534, 65532, + (1,18): 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, + (1,27): 61440, 57344, 49152, 32768, 0, + (2,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (2,9): 65535, 65535, 65535, 65535, 65535, 65535, 65534, 65532, 65528, + (2,18): 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, + (2,27): 57344, 49152, 32768, 0, 0, + (3,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (3,9): 65535, 65535, 65535, 65535, 65535, 65534, 65532, 65528, 65520, + (3,18): 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, + (3,27): 49152, 32768, 0, 0, 0, + (4,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (4,9): 65535, 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, + (4,18): 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, + (4,27): 32768, 0, 0, 0, 0, + (5,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (5,9): 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, + (5,18): 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, + (5,28): 0, 0, 0, 0, + (6,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (6,9): 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, + (6,18): 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, + (6,29): 0, 0, 0, + (7,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (7,9): 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, + (7,18): 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, + (7,31): 0 + } +} +} diff --git a/tools/testfiles/tpbitsSignedLong8.ddl b/tools/testfiles/tpbitsSignedLong8.ddl new file mode 100644 index 0000000..e99b1d0 --- /dev/null +++ b/tools/testfiles/tpbitsSignedLong8.ddl @@ -0,0 +1,96 @@ +HDF5 "packedbits.h5" { +DATASET "/DS32BITS" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 8, 32 ) / ( 8, 32 ) } + PACKED_BITS OFFSET=0 LENGTH=8 + DATA { + (0,0): 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (0,17): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,18): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,18): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,19): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,20): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,20): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,21): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=8 LENGTH=8 + DATA { + (0,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, + (0,13): 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, + (1,13): 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, + (2,13): 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, + (3,14): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, + (4,14): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, + (5,15): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, + (6,16): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, + (7,16): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=16 LENGTH=8 + DATA { + (0,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + (0,13): 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, + (0,28): 0, 0, 0, 0, + (1,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + (1,13): 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, + (1,28): 0, 0, 0, 0, + (2,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + (2,13): 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, + (2,29): 0, 0, 0, + (3,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + (3,13): 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,30): 0, 0, + (4,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + (4,13): 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,30): 0, 0, + (5,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, + (5,13): 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,31): 0, + (6,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, + (6,13): 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, + (7,13): 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=24 LENGTH=8 + DATA { + (0,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + (0,13): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, + (0,26): 252, 248, 240, 224, 192, 128, + (1,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + (1,13): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, + (1,26): 248, 240, 224, 192, 128, 0, + (2,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + (2,13): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, + (2,26): 240, 224, 192, 128, 0, 0, + (3,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + (3,13): 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, + (3,26): 224, 192, 128, 0, 0, 0, + (4,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + (4,13): 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, + (4,26): 192, 128, 0, 0, 0, 0, + (5,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + (5,13): 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, + (5,26): 128, 0, 0, 0, 0, 0, + (6,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + (6,13): 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, + (6,26): 0, 0, 0, 0, 0, 0, + (7,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + (7,13): 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, + (7,27): 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/tpbitsSignedLongLong.ddl b/tools/testfiles/tpbitsSignedLongLong.ddl new file mode 100644 index 0000000..2be8a55 --- /dev/null +++ b/tools/testfiles/tpbitsSignedLongLong.ddl @@ -0,0 +1,68 @@ +HDF5 "packedbits.h5" { +DATASET "/DS64BITS" { + DATATYPE H5T_STD_I64LE + DATASPACE SIMPLE { ( 8, 64 ) / ( 8, 64 ) } + PACKED_BITS OFFSET=0 LENGTH=2 + DATA { + (0,0): 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (0,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (0,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=58 LENGTH=6 + DATA { + (0,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (0,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (0,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (0,49): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, + (1,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (1,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (1,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (1,49): 63, 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, + (2,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (2,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (2,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (2,49): 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, + (3,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (3,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (3,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (3,49): 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, + (4,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (4,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (4,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (4,49): 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, + (5,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (5,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (5,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (5,49): 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, + (6,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (6,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (6,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (6,49): 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, 0, + (7,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (7,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (7,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (7,49): 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/tpbitsSignedLongLong16.ddl b/tools/testfiles/tpbitsSignedLongLong16.ddl new file mode 100644 index 0000000..44e336d --- /dev/null +++ b/tools/testfiles/tpbitsSignedLongLong16.ddl @@ -0,0 +1,196 @@ +HDF5 "packedbits.h5" { +DATASET "/DS64BITS" { + DATATYPE H5T_STD_I64LE + DATASPACE SIMPLE { ( 8, 64 ) / ( 8, 64 ) } + PACKED_BITS OFFSET=0 LENGTH=16 + DATA { + (0,0): 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, + (0,9): 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, + (0,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (0,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, + (1,9): 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, + (1,23): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,45): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, + (2,9): 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,25): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,47): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, + (3,9): 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,26): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,48): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, + (4,9): 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,27): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,49): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, + (5,9): 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,29): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,51): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, + (6,9): 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,30): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,52): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, + (7,10): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,32): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,54): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=16 LENGTH=16 + DATA { + (0,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (0,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65534, + (0,18): 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, + (0,27): 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (0,42): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (1,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65534, 65532, + (1,18): 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, + (1,27): 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (2,9): 65535, 65535, 65535, 65535, 65535, 65535, 65534, 65532, 65528, + (2,18): 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, + (2,27): 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,45): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (3,9): 65535, 65535, 65535, 65535, 65535, 65534, 65532, 65528, 65520, + (3,18): 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, + (3,27): 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,46): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (4,9): 65535, 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, + (4,18): 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, + (4,27): 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,48): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (5,9): 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, + (5,18): 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, + (5,28): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,50): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (6,9): 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, + (6,18): 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, + (6,29): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,51): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (7,9): 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, + (7,18): 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, + (7,31): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,53): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=32 LENGTH=16 + DATA { + (0,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (0,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (0,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (0,27): 65535, 65535, 65535, 65535, 65535, 65535, 65534, 65532, 65528, + (0,36): 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, + (0,45): 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (0,63): 0, + (1,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (1,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (1,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (1,27): 65535, 65535, 65535, 65535, 65535, 65534, 65532, 65528, 65520, + (1,36): 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, + (1,45): 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (2,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (2,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (2,27): 65535, 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, + (2,36): 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, + (2,45): 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (3,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (3,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (3,27): 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, + (3,36): 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, + (3,46): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (4,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (4,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (4,27): 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, + (4,36): 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, + (4,47): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (5,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (5,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (5,27): 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, + (5,36): 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, + (5,49): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (6,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (6,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (6,27): 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, + (6,36): 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, + (6,50): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (7,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (7,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65534, + (7,27): 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, + (7,36): 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,51): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=48 LENGTH=16 + DATA { + (0,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (0,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (0,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (0,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (0,36): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (0,45): 65535, 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, + (0,54): 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, + (0,63): 32768, + (1,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (1,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (1,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (1,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (1,36): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (1,45): 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, + (1,54): 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, + (2,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (2,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (2,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (2,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (2,36): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (2,45): 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, + (2,54): 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, + (3,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (3,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (3,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (3,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (3,36): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (3,45): 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, + (3,54): 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, + (4,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (4,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (4,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (4,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (4,36): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (4,45): 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, + (4,54): 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, + (5,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (5,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (5,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (5,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (5,36): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65534, + (5,45): 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, + (5,54): 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, + (6,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (6,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (6,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (6,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (6,36): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65534, 65532, + (6,45): 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, + (6,54): 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, + (7,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (7,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (7,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (7,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (7,36): 65535, 65535, 65535, 65535, 65535, 65535, 65534, 65532, 65528, + (7,45): 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, + (7,54): 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/tpbitsSignedLongLong32.ddl b/tools/testfiles/tpbitsSignedLongLong32.ddl new file mode 100644 index 0000000..6ab4ac4 --- /dev/null +++ b/tools/testfiles/tpbitsSignedLongLong32.ddl @@ -0,0 +1,175 @@ +HDF5 "packedbits.h5" { +DATASET "/DS64BITS" { + DATATYPE H5T_STD_I64LE + DATASPACE SIMPLE { ( 8, 64 ) / ( 8, 64 ) } + PACKED_BITS OFFSET=0 LENGTH=32 + DATA { + (0,0): 4294967295, 4294967294, 4294967292, 4294967288, 4294967280, + (0,5): 4294967264, 4294967232, 4294967168, 4294967040, 4294966784, + (0,10): 4294966272, 4294965248, 4294963200, 4294959104, 4294950912, + (0,15): 4294934528, 4294901760, 4294836224, 4294705152, 4294443008, + (0,20): 4293918720, 4292870144, 4290772992, 4286578688, 4278190080, + (0,25): 4261412864, 4227858432, 4160749568, 4026531840, 3758096384, + (0,30): 3221225472, 2147483648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (0,46): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 4294967294, 4294967292, 4294967288, 4294967280, 4294967264, + (1,5): 4294967232, 4294967168, 4294967040, 4294966784, 4294966272, + (1,10): 4294965248, 4294963200, 4294959104, 4294950912, 4294934528, + (1,15): 4294901760, 4294836224, 4294705152, 4294443008, 4293918720, + (1,20): 4292870144, 4290772992, 4286578688, 4278190080, 4261412864, + (1,25): 4227858432, 4160749568, 4026531840, 3758096384, 3221225472, + (1,30): 2147483648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,49): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 4294967292, 4294967288, 4294967280, 4294967264, 4294967232, + (2,5): 4294967168, 4294967040, 4294966784, 4294966272, 4294965248, + (2,10): 4294963200, 4294959104, 4294950912, 4294934528, 4294901760, + (2,15): 4294836224, 4294705152, 4294443008, 4293918720, 4292870144, + (2,20): 4290772992, 4286578688, 4278190080, 4261412864, 4227858432, + (2,25): 4160749568, 4026531840, 3758096384, 3221225472, 2147483648, 0, 0, + (2,32): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,54): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 4294967288, 4294967280, 4294967264, 4294967232, 4294967168, + (3,5): 4294967040, 4294966784, 4294966272, 4294965248, 4294963200, + (3,10): 4294959104, 4294950912, 4294934528, 4294901760, 4294836224, + (3,15): 4294705152, 4294443008, 4293918720, 4292870144, 4290772992, + (3,20): 4286578688, 4278190080, 4261412864, 4227858432, 4160749568, + (3,25): 4026531840, 3758096384, 3221225472, 2147483648, 0, 0, 0, 0, 0, 0, + (3,35): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,57): 0, 0, 0, 0, 0, 0, 0, + (4,0): 4294967280, 4294967264, 4294967232, 4294967168, 4294967040, + (4,5): 4294966784, 4294966272, 4294965248, 4294963200, 4294959104, + (4,10): 4294950912, 4294934528, 4294901760, 4294836224, 4294705152, + (4,15): 4294443008, 4293918720, 4292870144, 4290772992, 4286578688, + (4,20): 4278190080, 4261412864, 4227858432, 4160749568, 4026531840, + (4,25): 3758096384, 3221225472, 2147483648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,38): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,60): 0, 0, 0, 0, + (5,0): 4294967264, 4294967232, 4294967168, 4294967040, 4294966784, + (5,5): 4294966272, 4294965248, 4294963200, 4294959104, 4294950912, + (5,10): 4294934528, 4294901760, 4294836224, 4294705152, 4294443008, + (5,15): 4293918720, 4292870144, 4290772992, 4286578688, 4278190080, + (5,20): 4261412864, 4227858432, 4160749568, 4026531840, 3758096384, + (5,25): 3221225472, 2147483648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,41): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,63): 0, + (6,0): 4294967232, 4294967168, 4294967040, 4294966784, 4294966272, + (6,5): 4294965248, 4294963200, 4294959104, 4294950912, 4294934528, + (6,10): 4294901760, 4294836224, 4294705152, 4294443008, 4293918720, + (6,15): 4292870144, 4290772992, 4286578688, 4278190080, 4261412864, + (6,20): 4227858432, 4160749568, 4026531840, 3758096384, 3221225472, + (6,25): 2147483648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 4294967168, 4294967040, 4294966784, 4294966272, 4294965248, + (7,5): 4294963200, 4294959104, 4294950912, 4294934528, 4294901760, + (7,10): 4294836224, 4294705152, 4294443008, 4293918720, 4292870144, + (7,15): 4290772992, 4286578688, 4278190080, 4261412864, 4227858432, + (7,20): 4160749568, 4026531840, 3758096384, 3221225472, 2147483648, 0, 0, + (7,27): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,49): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=32 LENGTH=32 + DATA { + (0,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (0,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (0,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (0,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (0,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (0,25): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (0,30): 4294967295, 4294967295, 4294967295, 4294967294, 4294967292, + (0,35): 4294967288, 4294967280, 4294967264, 4294967232, 4294967168, + (0,40): 4294967040, 4294966784, 4294966272, 4294965248, 4294963200, + (0,45): 4294959104, 4294950912, 4294934528, 4294901760, 4294836224, + (0,50): 4294705152, 4294443008, 4293918720, 4292870144, 4290772992, + (0,55): 4286578688, 4278190080, 4261412864, 4227858432, 4160749568, + (0,60): 4026531840, 3758096384, 3221225472, 2147483648, + (1,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (1,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (1,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (1,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (1,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (1,25): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (1,30): 4294967295, 4294967295, 4294967294, 4294967292, 4294967288, + (1,35): 4294967280, 4294967264, 4294967232, 4294967168, 4294967040, + (1,40): 4294966784, 4294966272, 4294965248, 4294963200, 4294959104, + (1,45): 4294950912, 4294934528, 4294901760, 4294836224, 4294705152, + (1,50): 4294443008, 4293918720, 4292870144, 4290772992, 4286578688, + (1,55): 4278190080, 4261412864, 4227858432, 4160749568, 4026531840, + (1,60): 3758096384, 3221225472, 2147483648, 0, + (2,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (2,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (2,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (2,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (2,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (2,25): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (2,30): 4294967295, 4294967294, 4294967292, 4294967288, 4294967280, + (2,35): 4294967264, 4294967232, 4294967168, 4294967040, 4294966784, + (2,40): 4294966272, 4294965248, 4294963200, 4294959104, 4294950912, + (2,45): 4294934528, 4294901760, 4294836224, 4294705152, 4294443008, + (2,50): 4293918720, 4292870144, 4290772992, 4286578688, 4278190080, + (2,55): 4261412864, 4227858432, 4160749568, 4026531840, 3758096384, + (2,60): 3221225472, 2147483648, 0, 0, + (3,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (3,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (3,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (3,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (3,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (3,25): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (3,30): 4294967294, 4294967292, 4294967288, 4294967280, 4294967264, + (3,35): 4294967232, 4294967168, 4294967040, 4294966784, 4294966272, + (3,40): 4294965248, 4294963200, 4294959104, 4294950912, 4294934528, + (3,45): 4294901760, 4294836224, 4294705152, 4294443008, 4293918720, + (3,50): 4292870144, 4290772992, 4286578688, 4278190080, 4261412864, + (3,55): 4227858432, 4160749568, 4026531840, 3758096384, 3221225472, + (3,60): 2147483648, 0, 0, 0, + (4,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (4,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (4,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (4,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (4,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (4,25): 4294967295, 4294967295, 4294967295, 4294967295, 4294967294, + (4,30): 4294967292, 4294967288, 4294967280, 4294967264, 4294967232, + (4,35): 4294967168, 4294967040, 4294966784, 4294966272, 4294965248, + (4,40): 4294963200, 4294959104, 4294950912, 4294934528, 4294901760, + (4,45): 4294836224, 4294705152, 4294443008, 4293918720, 4292870144, + (4,50): 4290772992, 4286578688, 4278190080, 4261412864, 4227858432, + (4,55): 4160749568, 4026531840, 3758096384, 3221225472, 2147483648, 0, 0, + (4,62): 0, 0, + (5,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (5,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (5,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (5,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (5,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (5,25): 4294967295, 4294967295, 4294967295, 4294967294, 4294967292, + (5,30): 4294967288, 4294967280, 4294967264, 4294967232, 4294967168, + (5,35): 4294967040, 4294966784, 4294966272, 4294965248, 4294963200, + (5,40): 4294959104, 4294950912, 4294934528, 4294901760, 4294836224, + (5,45): 4294705152, 4294443008, 4293918720, 4292870144, 4290772992, + (5,50): 4286578688, 4278190080, 4261412864, 4227858432, 4160749568, + (5,55): 4026531840, 3758096384, 3221225472, 2147483648, 0, 0, 0, 0, 0, + (6,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (6,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (6,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (6,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (6,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (6,25): 4294967295, 4294967295, 4294967294, 4294967292, 4294967288, + (6,30): 4294967280, 4294967264, 4294967232, 4294967168, 4294967040, + (6,35): 4294966784, 4294966272, 4294965248, 4294963200, 4294959104, + (6,40): 4294950912, 4294934528, 4294901760, 4294836224, 4294705152, + (6,45): 4294443008, 4293918720, 4292870144, 4290772992, 4286578688, + (6,50): 4278190080, 4261412864, 4227858432, 4160749568, 4026531840, + (6,55): 3758096384, 3221225472, 2147483648, 0, 0, 0, 0, 0, 0, + (7,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (7,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (7,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (7,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (7,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (7,25): 4294967295, 4294967294, 4294967292, 4294967288, 4294967280, + (7,30): 4294967264, 4294967232, 4294967168, 4294967040, 4294966784, + (7,35): 4294966272, 4294965248, 4294963200, 4294959104, 4294950912, + (7,40): 4294934528, 4294901760, 4294836224, 4294705152, 4294443008, + (7,45): 4293918720, 4292870144, 4290772992, 4286578688, 4278190080, + (7,50): 4261412864, 4227858432, 4160749568, 4026531840, 3758096384, + (7,55): 3221225472, 2147483648, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/tpbitsSignedLongLongWhole.ddl b/tools/testfiles/tpbitsSignedLongLongWhole.ddl new file mode 100644 index 0000000..134f3be --- /dev/null +++ b/tools/testfiles/tpbitsSignedLongLongWhole.ddl @@ -0,0 +1,121 @@ +HDF5 "packedbits.h5" { +DATASET "/DS64BITS" { + DATATYPE H5T_STD_I64LE + DATASPACE SIMPLE { ( 8, 64 ) / ( 8, 64 ) } + PACKED_BITS OFFSET=0 LENGTH=64 + DATA { + (0,0): -1, -2, -4, -8, -16, -32, -64, -128, -256, -512, -1024, -2048, + (0,12): -4096, -8192, -16384, -32768, -65536, -131072, -262144, -524288, + (0,20): -1048576, -2097152, -4194304, -8388608, -16777216, -33554432, + (0,26): -67108864, -134217728, -268435456, -536870912, -1073741824, + (0,31): -2147483648, -4294967296, -8589934592, -17179869184, -34359738368, + (0,36): -68719476736, -137438953472, -274877906944, -549755813888, + (0,40): -1099511627776, -2199023255552, -4398046511104, -8796093022208, + (0,44): -17592186044416, -35184372088832, -70368744177664, + (0,47): -140737488355328, -281474976710656, -562949953421312, + (0,50): -1125899906842624, -2251799813685248, -4503599627370496, + (0,53): -9007199254740992, -18014398509481984, -36028797018963968, + (0,56): -72057594037927936, -144115188075855872, -288230376151711744, + (0,59): -576460752303423488, -1152921504606846976, -2305843009213693952, + (0,62): -4611686018427387904, -9223372036854775808, + (1,0): -2, -4, -8, -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, + (1,12): -8192, -16384, -32768, -65536, -131072, -262144, -524288, + (1,19): -1048576, -2097152, -4194304, -8388608, -16777216, -33554432, + (1,25): -67108864, -134217728, -268435456, -536870912, -1073741824, + (1,30): -2147483648, -4294967296, -8589934592, -17179869184, -34359738368, + (1,35): -68719476736, -137438953472, -274877906944, -549755813888, + (1,39): -1099511627776, -2199023255552, -4398046511104, -8796093022208, + (1,43): -17592186044416, -35184372088832, -70368744177664, + (1,46): -140737488355328, -281474976710656, -562949953421312, + (1,49): -1125899906842624, -2251799813685248, -4503599627370496, + (1,52): -9007199254740992, -18014398509481984, -36028797018963968, + (1,55): -72057594037927936, -144115188075855872, -288230376151711744, + (1,58): -576460752303423488, -1152921504606846976, -2305843009213693952, + (1,61): -4611686018427387904, -9223372036854775808, 0, + (2,0): -4, -8, -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, + (2,11): -8192, -16384, -32768, -65536, -131072, -262144, -524288, + (2,18): -1048576, -2097152, -4194304, -8388608, -16777216, -33554432, + (2,24): -67108864, -134217728, -268435456, -536870912, -1073741824, + (2,29): -2147483648, -4294967296, -8589934592, -17179869184, -34359738368, + (2,34): -68719476736, -137438953472, -274877906944, -549755813888, + (2,38): -1099511627776, -2199023255552, -4398046511104, -8796093022208, + (2,42): -17592186044416, -35184372088832, -70368744177664, + (2,45): -140737488355328, -281474976710656, -562949953421312, + (2,48): -1125899906842624, -2251799813685248, -4503599627370496, + (2,51): -9007199254740992, -18014398509481984, -36028797018963968, + (2,54): -72057594037927936, -144115188075855872, -288230376151711744, + (2,57): -576460752303423488, -1152921504606846976, -2305843009213693952, + (2,60): -4611686018427387904, -9223372036854775808, 0, 0, + (3,0): -8, -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, -8192, + (3,11): -16384, -32768, -65536, -131072, -262144, -524288, -1048576, + (3,18): -2097152, -4194304, -8388608, -16777216, -33554432, -67108864, + (3,24): -134217728, -268435456, -536870912, -1073741824, -2147483648, + (3,29): -4294967296, -8589934592, -17179869184, -34359738368, + (3,33): -68719476736, -137438953472, -274877906944, -549755813888, + (3,37): -1099511627776, -2199023255552, -4398046511104, -8796093022208, + (3,41): -17592186044416, -35184372088832, -70368744177664, + (3,44): -140737488355328, -281474976710656, -562949953421312, + (3,47): -1125899906842624, -2251799813685248, -4503599627370496, + (3,50): -9007199254740992, -18014398509481984, -36028797018963968, + (3,53): -72057594037927936, -144115188075855872, -288230376151711744, + (3,56): -576460752303423488, -1152921504606846976, -2305843009213693952, + (3,59): -4611686018427387904, -9223372036854775808, 0, 0, 0, + (4,0): -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, -8192, + (4,10): -16384, -32768, -65536, -131072, -262144, -524288, -1048576, + (4,17): -2097152, -4194304, -8388608, -16777216, -33554432, -67108864, + (4,23): -134217728, -268435456, -536870912, -1073741824, -2147483648, + (4,28): -4294967296, -8589934592, -17179869184, -34359738368, + (4,32): -68719476736, -137438953472, -274877906944, -549755813888, + (4,36): -1099511627776, -2199023255552, -4398046511104, -8796093022208, + (4,40): -17592186044416, -35184372088832, -70368744177664, + (4,43): -140737488355328, -281474976710656, -562949953421312, + (4,46): -1125899906842624, -2251799813685248, -4503599627370496, + (4,49): -9007199254740992, -18014398509481984, -36028797018963968, + (4,52): -72057594037927936, -144115188075855872, -288230376151711744, + (4,55): -576460752303423488, -1152921504606846976, -2305843009213693952, + (4,58): -4611686018427387904, -9223372036854775808, 0, 0, 0, 0, + (5,0): -32, -64, -128, -256, -512, -1024, -2048, -4096, -8192, -16384, + (5,10): -32768, -65536, -131072, -262144, -524288, -1048576, -2097152, + (5,17): -4194304, -8388608, -16777216, -33554432, -67108864, -134217728, + (5,23): -268435456, -536870912, -1073741824, -2147483648, -4294967296, + (5,28): -8589934592, -17179869184, -34359738368, -68719476736, + (5,32): -137438953472, -274877906944, -549755813888, -1099511627776, + (5,36): -2199023255552, -4398046511104, -8796093022208, -17592186044416, + (5,40): -35184372088832, -70368744177664, -140737488355328, + (5,43): -281474976710656, -562949953421312, -1125899906842624, + (5,46): -2251799813685248, -4503599627370496, -9007199254740992, + (5,49): -18014398509481984, -36028797018963968, -72057594037927936, + (5,52): -144115188075855872, -288230376151711744, -576460752303423488, + (5,55): -1152921504606846976, -2305843009213693952, -4611686018427387904, + (5,58): -9223372036854775808, 0, 0, 0, 0, 0, + (6,0): -64, -128, -256, -512, -1024, -2048, -4096, -8192, -16384, -32768, + (6,10): -65536, -131072, -262144, -524288, -1048576, -2097152, -4194304, + (6,17): -8388608, -16777216, -33554432, -67108864, -134217728, -268435456, + (6,23): -536870912, -1073741824, -2147483648, -4294967296, -8589934592, + (6,28): -17179869184, -34359738368, -68719476736, -137438953472, + (6,32): -274877906944, -549755813888, -1099511627776, -2199023255552, + (6,36): -4398046511104, -8796093022208, -17592186044416, -35184372088832, + (6,40): -70368744177664, -140737488355328, -281474976710656, + (6,43): -562949953421312, -1125899906842624, -2251799813685248, + (6,46): -4503599627370496, -9007199254740992, -18014398509481984, + (6,49): -36028797018963968, -72057594037927936, -144115188075855872, + (6,52): -288230376151711744, -576460752303423488, -1152921504606846976, + (6,55): -2305843009213693952, -4611686018427387904, -9223372036854775808, + (6,58): 0, 0, 0, 0, 0, 0, + (7,0): -128, -256, -512, -1024, -2048, -4096, -8192, -16384, -32768, + (7,9): -65536, -131072, -262144, -524288, -1048576, -2097152, -4194304, + (7,16): -8388608, -16777216, -33554432, -67108864, -134217728, -268435456, + (7,22): -536870912, -1073741824, -2147483648, -4294967296, -8589934592, + (7,27): -17179869184, -34359738368, -68719476736, -137438953472, + (7,31): -274877906944, -549755813888, -1099511627776, -2199023255552, + (7,35): -4398046511104, -8796093022208, -17592186044416, -35184372088832, + (7,39): -70368744177664, -140737488355328, -281474976710656, + (7,42): -562949953421312, -1125899906842624, -2251799813685248, + (7,45): -4503599627370496, -9007199254740992, -18014398509481984, + (7,48): -36028797018963968, -72057594037927936, -144115188075855872, + (7,51): -288230376151711744, -576460752303423488, -1152921504606846976, + (7,54): -2305843009213693952, -4611686018427387904, -9223372036854775808, + (7,57): 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/tpbitsSignedLongLongWhole1.ddl b/tools/testfiles/tpbitsSignedLongLongWhole1.ddl new file mode 100644 index 0000000..7431670 --- /dev/null +++ b/tools/testfiles/tpbitsSignedLongLongWhole1.ddl @@ -0,0 +1,175 @@ +HDF5 "packedbits.h5" { +DATASET "/DS64BITS" { + DATATYPE H5T_STD_I64LE + DATASPACE SIMPLE { ( 8, 64 ) / ( 8, 64 ) } + PACKED_BITS OFFSET=1 LENGTH=63 + DATA { + (0,0): 9223372036854775807, 9223372036854775807, 9223372036854775806, + (0,3): 9223372036854775804, 9223372036854775800, 9223372036854775792, + (0,6): 9223372036854775776, 9223372036854775744, 9223372036854775680, + (0,9): 9223372036854775552, 9223372036854775296, 9223372036854774784, + (0,12): 9223372036854773760, 9223372036854771712, 9223372036854767616, + (0,15): 9223372036854759424, 9223372036854743040, 9223372036854710272, + (0,18): 9223372036854644736, 9223372036854513664, 9223372036854251520, + (0,21): 9223372036853727232, 9223372036852678656, 9223372036850581504, + (0,24): 9223372036846387200, 9223372036837998592, 9223372036821221376, + (0,27): 9223372036787666944, 9223372036720558080, 9223372036586340352, + (0,30): 9223372036317904896, 9223372035781033984, 9223372034707292160, + (0,33): 9223372032559808512, 9223372028264841216, 9223372019674906624, + (0,36): 9223372002495037440, 9223371968135299072, 9223371899415822336, + (0,39): 9223371761976868864, 9223371487098961920, 9223370937343148032, + (0,42): 9223369837831520256, 9223367638808264704, 9223363240761753600, + (0,45): 9223354444668731392, 9223336852482686976, 9223301668110598144, + (0,48): 9223231299366420480, 9223090561878065152, 9222809086901354496, + (0,51): 9222246136947933184, 9221120237041090560, 9218868437227405312, + (0,54): 9214364837600034816, 9205357638345293824, 9187343239835811840, + (0,57): 9151314442816847872, 9079256848778919936, 8935141660703064064, + (0,60): 8646911284551352320, 8070450532247928832, 6917529027641081856, + (0,63): 4611686018427387904, + (1,0): 9223372036854775807, 9223372036854775806, 9223372036854775804, + (1,3): 9223372036854775800, 9223372036854775792, 9223372036854775776, + (1,6): 9223372036854775744, 9223372036854775680, 9223372036854775552, + (1,9): 9223372036854775296, 9223372036854774784, 9223372036854773760, + (1,12): 9223372036854771712, 9223372036854767616, 9223372036854759424, + (1,15): 9223372036854743040, 9223372036854710272, 9223372036854644736, + (1,18): 9223372036854513664, 9223372036854251520, 9223372036853727232, + (1,21): 9223372036852678656, 9223372036850581504, 9223372036846387200, + (1,24): 9223372036837998592, 9223372036821221376, 9223372036787666944, + (1,27): 9223372036720558080, 9223372036586340352, 9223372036317904896, + (1,30): 9223372035781033984, 9223372034707292160, 9223372032559808512, + (1,33): 9223372028264841216, 9223372019674906624, 9223372002495037440, + (1,36): 9223371968135299072, 9223371899415822336, 9223371761976868864, + (1,39): 9223371487098961920, 9223370937343148032, 9223369837831520256, + (1,42): 9223367638808264704, 9223363240761753600, 9223354444668731392, + (1,45): 9223336852482686976, 9223301668110598144, 9223231299366420480, + (1,48): 9223090561878065152, 9222809086901354496, 9222246136947933184, + (1,51): 9221120237041090560, 9218868437227405312, 9214364837600034816, + (1,54): 9205357638345293824, 9187343239835811840, 9151314442816847872, + (1,57): 9079256848778919936, 8935141660703064064, 8646911284551352320, + (1,60): 8070450532247928832, 6917529027641081856, 4611686018427387904, 0, + (2,0): 9223372036854775806, 9223372036854775804, 9223372036854775800, + (2,3): 9223372036854775792, 9223372036854775776, 9223372036854775744, + (2,6): 9223372036854775680, 9223372036854775552, 9223372036854775296, + (2,9): 9223372036854774784, 9223372036854773760, 9223372036854771712, + (2,12): 9223372036854767616, 9223372036854759424, 9223372036854743040, + (2,15): 9223372036854710272, 9223372036854644736, 9223372036854513664, + (2,18): 9223372036854251520, 9223372036853727232, 9223372036852678656, + (2,21): 9223372036850581504, 9223372036846387200, 9223372036837998592, + (2,24): 9223372036821221376, 9223372036787666944, 9223372036720558080, + (2,27): 9223372036586340352, 9223372036317904896, 9223372035781033984, + (2,30): 9223372034707292160, 9223372032559808512, 9223372028264841216, + (2,33): 9223372019674906624, 9223372002495037440, 9223371968135299072, + (2,36): 9223371899415822336, 9223371761976868864, 9223371487098961920, + (2,39): 9223370937343148032, 9223369837831520256, 9223367638808264704, + (2,42): 9223363240761753600, 9223354444668731392, 9223336852482686976, + (2,45): 9223301668110598144, 9223231299366420480, 9223090561878065152, + (2,48): 9222809086901354496, 9222246136947933184, 9221120237041090560, + (2,51): 9218868437227405312, 9214364837600034816, 9205357638345293824, + (2,54): 9187343239835811840, 9151314442816847872, 9079256848778919936, + (2,57): 8935141660703064064, 8646911284551352320, 8070450532247928832, + (2,60): 6917529027641081856, 4611686018427387904, 0, 0, + (3,0): 9223372036854775804, 9223372036854775800, 9223372036854775792, + (3,3): 9223372036854775776, 9223372036854775744, 9223372036854775680, + (3,6): 9223372036854775552, 9223372036854775296, 9223372036854774784, + (3,9): 9223372036854773760, 9223372036854771712, 9223372036854767616, + (3,12): 9223372036854759424, 9223372036854743040, 9223372036854710272, + (3,15): 9223372036854644736, 9223372036854513664, 9223372036854251520, + (3,18): 9223372036853727232, 9223372036852678656, 9223372036850581504, + (3,21): 9223372036846387200, 9223372036837998592, 9223372036821221376, + (3,24): 9223372036787666944, 9223372036720558080, 9223372036586340352, + (3,27): 9223372036317904896, 9223372035781033984, 9223372034707292160, + (3,30): 9223372032559808512, 9223372028264841216, 9223372019674906624, + (3,33): 9223372002495037440, 9223371968135299072, 9223371899415822336, + (3,36): 9223371761976868864, 9223371487098961920, 9223370937343148032, + (3,39): 9223369837831520256, 9223367638808264704, 9223363240761753600, + (3,42): 9223354444668731392, 9223336852482686976, 9223301668110598144, + (3,45): 9223231299366420480, 9223090561878065152, 9222809086901354496, + (3,48): 9222246136947933184, 9221120237041090560, 9218868437227405312, + (3,51): 9214364837600034816, 9205357638345293824, 9187343239835811840, + (3,54): 9151314442816847872, 9079256848778919936, 8935141660703064064, + (3,57): 8646911284551352320, 8070450532247928832, 6917529027641081856, + (3,60): 4611686018427387904, 0, 0, 0, + (4,0): 9223372036854775800, 9223372036854775792, 9223372036854775776, + (4,3): 9223372036854775744, 9223372036854775680, 9223372036854775552, + (4,6): 9223372036854775296, 9223372036854774784, 9223372036854773760, + (4,9): 9223372036854771712, 9223372036854767616, 9223372036854759424, + (4,12): 9223372036854743040, 9223372036854710272, 9223372036854644736, + (4,15): 9223372036854513664, 9223372036854251520, 9223372036853727232, + (4,18): 9223372036852678656, 9223372036850581504, 9223372036846387200, + (4,21): 9223372036837998592, 9223372036821221376, 9223372036787666944, + (4,24): 9223372036720558080, 9223372036586340352, 9223372036317904896, + (4,27): 9223372035781033984, 9223372034707292160, 9223372032559808512, + (4,30): 9223372028264841216, 9223372019674906624, 9223372002495037440, + (4,33): 9223371968135299072, 9223371899415822336, 9223371761976868864, + (4,36): 9223371487098961920, 9223370937343148032, 9223369837831520256, + (4,39): 9223367638808264704, 9223363240761753600, 9223354444668731392, + (4,42): 9223336852482686976, 9223301668110598144, 9223231299366420480, + (4,45): 9223090561878065152, 9222809086901354496, 9222246136947933184, + (4,48): 9221120237041090560, 9218868437227405312, 9214364837600034816, + (4,51): 9205357638345293824, 9187343239835811840, 9151314442816847872, + (4,54): 9079256848778919936, 8935141660703064064, 8646911284551352320, + (4,57): 8070450532247928832, 6917529027641081856, 4611686018427387904, 0, + (4,61): 0, 0, 0, + (5,0): 9223372036854775792, 9223372036854775776, 9223372036854775744, + (5,3): 9223372036854775680, 9223372036854775552, 9223372036854775296, + (5,6): 9223372036854774784, 9223372036854773760, 9223372036854771712, + (5,9): 9223372036854767616, 9223372036854759424, 9223372036854743040, + (5,12): 9223372036854710272, 9223372036854644736, 9223372036854513664, + (5,15): 9223372036854251520, 9223372036853727232, 9223372036852678656, + (5,18): 9223372036850581504, 9223372036846387200, 9223372036837998592, + (5,21): 9223372036821221376, 9223372036787666944, 9223372036720558080, + (5,24): 9223372036586340352, 9223372036317904896, 9223372035781033984, + (5,27): 9223372034707292160, 9223372032559808512, 9223372028264841216, + (5,30): 9223372019674906624, 9223372002495037440, 9223371968135299072, + (5,33): 9223371899415822336, 9223371761976868864, 9223371487098961920, + (5,36): 9223370937343148032, 9223369837831520256, 9223367638808264704, + (5,39): 9223363240761753600, 9223354444668731392, 9223336852482686976, + (5,42): 9223301668110598144, 9223231299366420480, 9223090561878065152, + (5,45): 9222809086901354496, 9222246136947933184, 9221120237041090560, + (5,48): 9218868437227405312, 9214364837600034816, 9205357638345293824, + (5,51): 9187343239835811840, 9151314442816847872, 9079256848778919936, + (5,54): 8935141660703064064, 8646911284551352320, 8070450532247928832, + (5,57): 6917529027641081856, 4611686018427387904, 0, 0, 0, 0, 0, + (6,0): 9223372036854775776, 9223372036854775744, 9223372036854775680, + (6,3): 9223372036854775552, 9223372036854775296, 9223372036854774784, + (6,6): 9223372036854773760, 9223372036854771712, 9223372036854767616, + (6,9): 9223372036854759424, 9223372036854743040, 9223372036854710272, + (6,12): 9223372036854644736, 9223372036854513664, 9223372036854251520, + (6,15): 9223372036853727232, 9223372036852678656, 9223372036850581504, + (6,18): 9223372036846387200, 9223372036837998592, 9223372036821221376, + (6,21): 9223372036787666944, 9223372036720558080, 9223372036586340352, + (6,24): 9223372036317904896, 9223372035781033984, 9223372034707292160, + (6,27): 9223372032559808512, 9223372028264841216, 9223372019674906624, + (6,30): 9223372002495037440, 9223371968135299072, 9223371899415822336, + (6,33): 9223371761976868864, 9223371487098961920, 9223370937343148032, + (6,36): 9223369837831520256, 9223367638808264704, 9223363240761753600, + (6,39): 9223354444668731392, 9223336852482686976, 9223301668110598144, + (6,42): 9223231299366420480, 9223090561878065152, 9222809086901354496, + (6,45): 9222246136947933184, 9221120237041090560, 9218868437227405312, + (6,48): 9214364837600034816, 9205357638345293824, 9187343239835811840, + (6,51): 9151314442816847872, 9079256848778919936, 8935141660703064064, + (6,54): 8646911284551352320, 8070450532247928832, 6917529027641081856, + (6,57): 4611686018427387904, 0, 0, 0, 0, 0, 0, + (7,0): 9223372036854775744, 9223372036854775680, 9223372036854775552, + (7,3): 9223372036854775296, 9223372036854774784, 9223372036854773760, + (7,6): 9223372036854771712, 9223372036854767616, 9223372036854759424, + (7,9): 9223372036854743040, 9223372036854710272, 9223372036854644736, + (7,12): 9223372036854513664, 9223372036854251520, 9223372036853727232, + (7,15): 9223372036852678656, 9223372036850581504, 9223372036846387200, + (7,18): 9223372036837998592, 9223372036821221376, 9223372036787666944, + (7,21): 9223372036720558080, 9223372036586340352, 9223372036317904896, + (7,24): 9223372035781033984, 9223372034707292160, 9223372032559808512, + (7,27): 9223372028264841216, 9223372019674906624, 9223372002495037440, + (7,30): 9223371968135299072, 9223371899415822336, 9223371761976868864, + (7,33): 9223371487098961920, 9223370937343148032, 9223369837831520256, + (7,36): 9223367638808264704, 9223363240761753600, 9223354444668731392, + (7,39): 9223336852482686976, 9223301668110598144, 9223231299366420480, + (7,42): 9223090561878065152, 9222809086901354496, 9222246136947933184, + (7,45): 9221120237041090560, 9218868437227405312, 9214364837600034816, + (7,48): 9205357638345293824, 9187343239835811840, 9151314442816847872, + (7,51): 9079256848778919936, 8935141660703064064, 8646911284551352320, + (7,54): 8070450532247928832, 6917529027641081856, 4611686018427387904, 0, + (7,58): 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/tpbitsSignedLongLongWhole63.ddl b/tools/testfiles/tpbitsSignedLongLongWhole63.ddl new file mode 100644 index 0000000..c7cc65f --- /dev/null +++ b/tools/testfiles/tpbitsSignedLongLongWhole63.ddl @@ -0,0 +1,172 @@ +HDF5 "packedbits.h5" { +DATASET "/DS64BITS" { + DATATYPE H5T_STD_I64LE + DATASPACE SIMPLE { ( 8, 64 ) / ( 8, 64 ) } + PACKED_BITS OFFSET=0 LENGTH=63 + DATA { + (0,0): 9223372036854775807, 9223372036854775806, 9223372036854775804, + (0,3): 9223372036854775800, 9223372036854775792, 9223372036854775776, + (0,6): 9223372036854775744, 9223372036854775680, 9223372036854775552, + (0,9): 9223372036854775296, 9223372036854774784, 9223372036854773760, + (0,12): 9223372036854771712, 9223372036854767616, 9223372036854759424, + (0,15): 9223372036854743040, 9223372036854710272, 9223372036854644736, + (0,18): 9223372036854513664, 9223372036854251520, 9223372036853727232, + (0,21): 9223372036852678656, 9223372036850581504, 9223372036846387200, + (0,24): 9223372036837998592, 9223372036821221376, 9223372036787666944, + (0,27): 9223372036720558080, 9223372036586340352, 9223372036317904896, + (0,30): 9223372035781033984, 9223372034707292160, 9223372032559808512, + (0,33): 9223372028264841216, 9223372019674906624, 9223372002495037440, + (0,36): 9223371968135299072, 9223371899415822336, 9223371761976868864, + (0,39): 9223371487098961920, 9223370937343148032, 9223369837831520256, + (0,42): 9223367638808264704, 9223363240761753600, 9223354444668731392, + (0,45): 9223336852482686976, 9223301668110598144, 9223231299366420480, + (0,48): 9223090561878065152, 9222809086901354496, 9222246136947933184, + (0,51): 9221120237041090560, 9218868437227405312, 9214364837600034816, + (0,54): 9205357638345293824, 9187343239835811840, 9151314442816847872, + (0,57): 9079256848778919936, 8935141660703064064, 8646911284551352320, + (0,60): 8070450532247928832, 6917529027641081856, 4611686018427387904, 0, + (1,0): 9223372036854775806, 9223372036854775804, 9223372036854775800, + (1,3): 9223372036854775792, 9223372036854775776, 9223372036854775744, + (1,6): 9223372036854775680, 9223372036854775552, 9223372036854775296, + (1,9): 9223372036854774784, 9223372036854773760, 9223372036854771712, + (1,12): 9223372036854767616, 9223372036854759424, 9223372036854743040, + (1,15): 9223372036854710272, 9223372036854644736, 9223372036854513664, + (1,18): 9223372036854251520, 9223372036853727232, 9223372036852678656, + (1,21): 9223372036850581504, 9223372036846387200, 9223372036837998592, + (1,24): 9223372036821221376, 9223372036787666944, 9223372036720558080, + (1,27): 9223372036586340352, 9223372036317904896, 9223372035781033984, + (1,30): 9223372034707292160, 9223372032559808512, 9223372028264841216, + (1,33): 9223372019674906624, 9223372002495037440, 9223371968135299072, + (1,36): 9223371899415822336, 9223371761976868864, 9223371487098961920, + (1,39): 9223370937343148032, 9223369837831520256, 9223367638808264704, + (1,42): 9223363240761753600, 9223354444668731392, 9223336852482686976, + (1,45): 9223301668110598144, 9223231299366420480, 9223090561878065152, + (1,48): 9222809086901354496, 9222246136947933184, 9221120237041090560, + (1,51): 9218868437227405312, 9214364837600034816, 9205357638345293824, + (1,54): 9187343239835811840, 9151314442816847872, 9079256848778919936, + (1,57): 8935141660703064064, 8646911284551352320, 8070450532247928832, + (1,60): 6917529027641081856, 4611686018427387904, 0, 0, + (2,0): 9223372036854775804, 9223372036854775800, 9223372036854775792, + (2,3): 9223372036854775776, 9223372036854775744, 9223372036854775680, + (2,6): 9223372036854775552, 9223372036854775296, 9223372036854774784, + (2,9): 9223372036854773760, 9223372036854771712, 9223372036854767616, + (2,12): 9223372036854759424, 9223372036854743040, 9223372036854710272, + (2,15): 9223372036854644736, 9223372036854513664, 9223372036854251520, + (2,18): 9223372036853727232, 9223372036852678656, 9223372036850581504, + (2,21): 9223372036846387200, 9223372036837998592, 9223372036821221376, + (2,24): 9223372036787666944, 9223372036720558080, 9223372036586340352, + (2,27): 9223372036317904896, 9223372035781033984, 9223372034707292160, + (2,30): 9223372032559808512, 9223372028264841216, 9223372019674906624, + (2,33): 9223372002495037440, 9223371968135299072, 9223371899415822336, + (2,36): 9223371761976868864, 9223371487098961920, 9223370937343148032, + (2,39): 9223369837831520256, 9223367638808264704, 9223363240761753600, + (2,42): 9223354444668731392, 9223336852482686976, 9223301668110598144, + (2,45): 9223231299366420480, 9223090561878065152, 9222809086901354496, + (2,48): 9222246136947933184, 9221120237041090560, 9218868437227405312, + (2,51): 9214364837600034816, 9205357638345293824, 9187343239835811840, + (2,54): 9151314442816847872, 9079256848778919936, 8935141660703064064, + (2,57): 8646911284551352320, 8070450532247928832, 6917529027641081856, + (2,60): 4611686018427387904, 0, 0, 0, + (3,0): 9223372036854775800, 9223372036854775792, 9223372036854775776, + (3,3): 9223372036854775744, 9223372036854775680, 9223372036854775552, + (3,6): 9223372036854775296, 9223372036854774784, 9223372036854773760, + (3,9): 9223372036854771712, 9223372036854767616, 9223372036854759424, + (3,12): 9223372036854743040, 9223372036854710272, 9223372036854644736, + (3,15): 9223372036854513664, 9223372036854251520, 9223372036853727232, + (3,18): 9223372036852678656, 9223372036850581504, 9223372036846387200, + (3,21): 9223372036837998592, 9223372036821221376, 9223372036787666944, + (3,24): 9223372036720558080, 9223372036586340352, 9223372036317904896, + (3,27): 9223372035781033984, 9223372034707292160, 9223372032559808512, + (3,30): 9223372028264841216, 9223372019674906624, 9223372002495037440, + (3,33): 9223371968135299072, 9223371899415822336, 9223371761976868864, + (3,36): 9223371487098961920, 9223370937343148032, 9223369837831520256, + (3,39): 9223367638808264704, 9223363240761753600, 9223354444668731392, + (3,42): 9223336852482686976, 9223301668110598144, 9223231299366420480, + (3,45): 9223090561878065152, 9222809086901354496, 9222246136947933184, + (3,48): 9221120237041090560, 9218868437227405312, 9214364837600034816, + (3,51): 9205357638345293824, 9187343239835811840, 9151314442816847872, + (3,54): 9079256848778919936, 8935141660703064064, 8646911284551352320, + (3,57): 8070450532247928832, 6917529027641081856, 4611686018427387904, 0, + (3,61): 0, 0, 0, + (4,0): 9223372036854775792, 9223372036854775776, 9223372036854775744, + (4,3): 9223372036854775680, 9223372036854775552, 9223372036854775296, + (4,6): 9223372036854774784, 9223372036854773760, 9223372036854771712, + (4,9): 9223372036854767616, 9223372036854759424, 9223372036854743040, + (4,12): 9223372036854710272, 9223372036854644736, 9223372036854513664, + (4,15): 9223372036854251520, 9223372036853727232, 9223372036852678656, + (4,18): 9223372036850581504, 9223372036846387200, 9223372036837998592, + (4,21): 9223372036821221376, 9223372036787666944, 9223372036720558080, + (4,24): 9223372036586340352, 9223372036317904896, 9223372035781033984, + (4,27): 9223372034707292160, 9223372032559808512, 9223372028264841216, + (4,30): 9223372019674906624, 9223372002495037440, 9223371968135299072, + (4,33): 9223371899415822336, 9223371761976868864, 9223371487098961920, + (4,36): 9223370937343148032, 9223369837831520256, 9223367638808264704, + (4,39): 9223363240761753600, 9223354444668731392, 9223336852482686976, + (4,42): 9223301668110598144, 9223231299366420480, 9223090561878065152, + (4,45): 9222809086901354496, 9222246136947933184, 9221120237041090560, + (4,48): 9218868437227405312, 9214364837600034816, 9205357638345293824, + (4,51): 9187343239835811840, 9151314442816847872, 9079256848778919936, + (4,54): 8935141660703064064, 8646911284551352320, 8070450532247928832, + (4,57): 6917529027641081856, 4611686018427387904, 0, 0, 0, 0, 0, + (5,0): 9223372036854775776, 9223372036854775744, 9223372036854775680, + (5,3): 9223372036854775552, 9223372036854775296, 9223372036854774784, + (5,6): 9223372036854773760, 9223372036854771712, 9223372036854767616, + (5,9): 9223372036854759424, 9223372036854743040, 9223372036854710272, + (5,12): 9223372036854644736, 9223372036854513664, 9223372036854251520, + (5,15): 9223372036853727232, 9223372036852678656, 9223372036850581504, + (5,18): 9223372036846387200, 9223372036837998592, 9223372036821221376, + (5,21): 9223372036787666944, 9223372036720558080, 9223372036586340352, + (5,24): 9223372036317904896, 9223372035781033984, 9223372034707292160, + (5,27): 9223372032559808512, 9223372028264841216, 9223372019674906624, + (5,30): 9223372002495037440, 9223371968135299072, 9223371899415822336, + (5,33): 9223371761976868864, 9223371487098961920, 9223370937343148032, + (5,36): 9223369837831520256, 9223367638808264704, 9223363240761753600, + (5,39): 9223354444668731392, 9223336852482686976, 9223301668110598144, + (5,42): 9223231299366420480, 9223090561878065152, 9222809086901354496, + (5,45): 9222246136947933184, 9221120237041090560, 9218868437227405312, + (5,48): 9214364837600034816, 9205357638345293824, 9187343239835811840, + (5,51): 9151314442816847872, 9079256848778919936, 8935141660703064064, + (5,54): 8646911284551352320, 8070450532247928832, 6917529027641081856, + (5,57): 4611686018427387904, 0, 0, 0, 0, 0, 0, + (6,0): 9223372036854775744, 9223372036854775680, 9223372036854775552, + (6,3): 9223372036854775296, 9223372036854774784, 9223372036854773760, + (6,6): 9223372036854771712, 9223372036854767616, 9223372036854759424, + (6,9): 9223372036854743040, 9223372036854710272, 9223372036854644736, + (6,12): 9223372036854513664, 9223372036854251520, 9223372036853727232, + (6,15): 9223372036852678656, 9223372036850581504, 9223372036846387200, + (6,18): 9223372036837998592, 9223372036821221376, 9223372036787666944, + (6,21): 9223372036720558080, 9223372036586340352, 9223372036317904896, + (6,24): 9223372035781033984, 9223372034707292160, 9223372032559808512, + (6,27): 9223372028264841216, 9223372019674906624, 9223372002495037440, + (6,30): 9223371968135299072, 9223371899415822336, 9223371761976868864, + (6,33): 9223371487098961920, 9223370937343148032, 9223369837831520256, + (6,36): 9223367638808264704, 9223363240761753600, 9223354444668731392, + (6,39): 9223336852482686976, 9223301668110598144, 9223231299366420480, + (6,42): 9223090561878065152, 9222809086901354496, 9222246136947933184, + (6,45): 9221120237041090560, 9218868437227405312, 9214364837600034816, + (6,48): 9205357638345293824, 9187343239835811840, 9151314442816847872, + (6,51): 9079256848778919936, 8935141660703064064, 8646911284551352320, + (6,54): 8070450532247928832, 6917529027641081856, 4611686018427387904, 0, + (6,58): 0, 0, 0, 0, 0, 0, + (7,0): 9223372036854775680, 9223372036854775552, 9223372036854775296, + (7,3): 9223372036854774784, 9223372036854773760, 9223372036854771712, + (7,6): 9223372036854767616, 9223372036854759424, 9223372036854743040, + (7,9): 9223372036854710272, 9223372036854644736, 9223372036854513664, + (7,12): 9223372036854251520, 9223372036853727232, 9223372036852678656, + (7,15): 9223372036850581504, 9223372036846387200, 9223372036837998592, + (7,18): 9223372036821221376, 9223372036787666944, 9223372036720558080, + (7,21): 9223372036586340352, 9223372036317904896, 9223372035781033984, + (7,24): 9223372034707292160, 9223372032559808512, 9223372028264841216, + (7,27): 9223372019674906624, 9223372002495037440, 9223371968135299072, + (7,30): 9223371899415822336, 9223371761976868864, 9223371487098961920, + (7,33): 9223370937343148032, 9223369837831520256, 9223367638808264704, + (7,36): 9223363240761753600, 9223354444668731392, 9223336852482686976, + (7,39): 9223301668110598144, 9223231299366420480, 9223090561878065152, + (7,42): 9222809086901354496, 9222246136947933184, 9221120237041090560, + (7,45): 9218868437227405312, 9214364837600034816, 9205357638345293824, + (7,48): 9187343239835811840, 9151314442816847872, 9079256848778919936, + (7,51): 8935141660703064064, 8646911284551352320, 8070450532247928832, + (7,54): 6917529027641081856, 4611686018427387904, 0, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/tpbitsSignedLongWhole.ddl b/tools/testfiles/tpbitsSignedLongWhole.ddl new file mode 100644 index 0000000..e583f1d --- /dev/null +++ b/tools/testfiles/tpbitsSignedLongWhole.ddl @@ -0,0 +1,46 @@ +HDF5 "packedbits.h5" { +DATASET "/DS32BITS" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 8, 32 ) / ( 8, 32 ) } + PACKED_BITS OFFSET=0 LENGTH=32 + DATA { + (0,0): -1, -2, -4, -8, -16, -32, -64, -128, -256, -512, -1024, -2048, + (0,12): -4096, -8192, -16384, -32768, -65536, -131072, -262144, -524288, + (0,20): -1048576, -2097152, -4194304, -8388608, -16777216, -33554432, + (0,26): -67108864, -134217728, -268435456, -536870912, -1073741824, + (0,31): -2147483648, + (1,0): -2, -4, -8, -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, + (1,12): -8192, -16384, -32768, -65536, -131072, -262144, -524288, + (1,19): -1048576, -2097152, -4194304, -8388608, -16777216, -33554432, + (1,25): -67108864, -134217728, -268435456, -536870912, -1073741824, + (1,30): -2147483648, 0, + (2,0): -4, -8, -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, + (2,11): -8192, -16384, -32768, -65536, -131072, -262144, -524288, + (2,18): -1048576, -2097152, -4194304, -8388608, -16777216, -33554432, + (2,24): -67108864, -134217728, -268435456, -536870912, -1073741824, + (2,29): -2147483648, 0, 0, + (3,0): -8, -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, -8192, + (3,11): -16384, -32768, -65536, -131072, -262144, -524288, -1048576, + (3,18): -2097152, -4194304, -8388608, -16777216, -33554432, -67108864, + (3,24): -134217728, -268435456, -536870912, -1073741824, -2147483648, 0, + (3,30): 0, 0, + (4,0): -16, -32, -64, -128, -256, -512, -1024, -2048, -4096, -8192, + (4,10): -16384, -32768, -65536, -131072, -262144, -524288, -1048576, + (4,17): -2097152, -4194304, -8388608, -16777216, -33554432, -67108864, + (4,23): -134217728, -268435456, -536870912, -1073741824, -2147483648, 0, + (4,29): 0, 0, 0, + (5,0): -32, -64, -128, -256, -512, -1024, -2048, -4096, -8192, -16384, + (5,10): -32768, -65536, -131072, -262144, -524288, -1048576, -2097152, + (5,17): -4194304, -8388608, -16777216, -33554432, -67108864, -134217728, + (5,23): -268435456, -536870912, -1073741824, -2147483648, 0, 0, 0, 0, 0, + (6,0): -64, -128, -256, -512, -1024, -2048, -4096, -8192, -16384, -32768, + (6,10): -65536, -131072, -262144, -524288, -1048576, -2097152, -4194304, + (6,17): -8388608, -16777216, -33554432, -67108864, -134217728, -268435456, + (6,23): -536870912, -1073741824, -2147483648, 0, 0, 0, 0, 0, 0, + (7,0): -128, -256, -512, -1024, -2048, -4096, -8192, -16384, -32768, + (7,9): -65536, -131072, -262144, -524288, -1048576, -2097152, -4194304, + (7,16): -8388608, -16777216, -33554432, -67108864, -134217728, -268435456, + (7,22): -536870912, -1073741824, -2147483648, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/tpbitsSignedWhole.ddl b/tools/testfiles/tpbitsSignedWhole.ddl new file mode 100644 index 0000000..f044e23 --- /dev/null +++ b/tools/testfiles/tpbitsSignedWhole.ddl @@ -0,0 +1,17 @@ +HDF5 "packedbits.h5" { +DATASET "/DS08BITS" { + DATATYPE H5T_STD_I8LE + DATASPACE SIMPLE { ( 8, 8 ) / ( 8, 8 ) } + PACKED_BITS OFFSET=0 LENGTH=8 + DATA { + (0,0): -1, -2, -4, -8, -16, -32, -64, -128, + (1,0): -2, -4, -8, -16, -32, -64, -128, 0, + (2,0): -4, -8, -16, -32, -64, -128, 0, 0, + (3,0): -8, -16, -32, -64, -128, 0, 0, 0, + (4,0): -16, -32, -64, -128, 0, 0, 0, 0, + (5,0): -32, -64, -128, 0, 0, 0, 0, 0, + (6,0): -64, -128, 0, 0, 0, 0, 0, 0, + (7,0): -128, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/tpbitsUnsigned.ddl b/tools/testfiles/tpbitsUnsigned.ddl new file mode 100644 index 0000000..9e7ac50 --- /dev/null +++ b/tools/testfiles/tpbitsUnsigned.ddl @@ -0,0 +1,28 @@ +HDF5 "packedbits.h5" { +DATASET "/DU08BITS" { + DATATYPE H5T_STD_U8LE + DATASPACE SIMPLE { ( 8, 8 ) / ( 8, 8 ) } + PACKED_BITS OFFSET=0 LENGTH=2 + DATA { + (0,0): 3, 2, 0, 0, 0, 0, 0, 0, + (1,0): 2, 0, 0, 0, 0, 0, 0, 0, + (2,0): 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=2 LENGTH=6 + DATA { + (0,0): 63, 63, 63, 62, 60, 56, 48, 32, + (1,0): 63, 63, 62, 60, 56, 48, 32, 0, + (2,0): 63, 62, 60, 56, 48, 32, 0, 0, + (3,0): 62, 60, 56, 48, 32, 0, 0, 0, + (4,0): 60, 56, 48, 32, 0, 0, 0, 0, + (5,0): 56, 48, 32, 0, 0, 0, 0, 0, + (6,0): 48, 32, 0, 0, 0, 0, 0, 0, + (7,0): 32, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/tpbitsUnsigned2.ddl b/tools/testfiles/tpbitsUnsigned2.ddl new file mode 100644 index 0000000..b7e6f79 --- /dev/null +++ b/tools/testfiles/tpbitsUnsigned2.ddl @@ -0,0 +1,50 @@ +HDF5 "packedbits.h5" { +DATASET "/DU08BITS" { + DATATYPE H5T_STD_U8LE + DATASPACE SIMPLE { ( 8, 8 ) / ( 8, 8 ) } + PACKED_BITS OFFSET=0 LENGTH=2 + DATA { + (0,0): 3, 2, 0, 0, 0, 0, 0, 0, + (1,0): 2, 0, 0, 0, 0, 0, 0, 0, + (2,0): 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=2 LENGTH=2 + DATA { + (0,0): 3, 3, 3, 2, 0, 0, 0, 0, + (1,0): 3, 3, 2, 0, 0, 0, 0, 0, + (2,0): 3, 2, 0, 0, 0, 0, 0, 0, + (3,0): 2, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=4 LENGTH=2 + DATA { + (0,0): 3, 3, 3, 3, 3, 2, 0, 0, + (1,0): 3, 3, 3, 3, 2, 0, 0, 0, + (2,0): 3, 3, 3, 2, 0, 0, 0, 0, + (3,0): 3, 3, 2, 0, 0, 0, 0, 0, + (4,0): 3, 2, 0, 0, 0, 0, 0, 0, + (5,0): 2, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=6 LENGTH=2 + DATA { + (0,0): 3, 3, 3, 3, 3, 3, 3, 2, + (1,0): 3, 3, 3, 3, 3, 3, 2, 0, + (2,0): 3, 3, 3, 3, 3, 2, 0, 0, + (3,0): 3, 3, 3, 3, 2, 0, 0, 0, + (4,0): 3, 3, 3, 2, 0, 0, 0, 0, + (5,0): 3, 3, 2, 0, 0, 0, 0, 0, + (6,0): 3, 2, 0, 0, 0, 0, 0, 0, + (7,0): 2, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/tpbitsUnsigned4.ddl b/tools/testfiles/tpbitsUnsigned4.ddl new file mode 100644 index 0000000..d25d838 --- /dev/null +++ b/tools/testfiles/tpbitsUnsigned4.ddl @@ -0,0 +1,28 @@ +HDF5 "packedbits.h5" { +DATASET "/DU08BITS" { + DATATYPE H5T_STD_U8LE + DATASPACE SIMPLE { ( 8, 8 ) / ( 8, 8 ) } + PACKED_BITS OFFSET=0 LENGTH=4 + DATA { + (0,0): 15, 14, 12, 8, 0, 0, 0, 0, + (1,0): 14, 12, 8, 0, 0, 0, 0, 0, + (2,0): 12, 8, 0, 0, 0, 0, 0, 0, + (3,0): 8, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=4 LENGTH=4 + DATA { + (0,0): 15, 15, 15, 15, 15, 14, 12, 8, + (1,0): 15, 15, 15, 15, 14, 12, 8, 0, + (2,0): 15, 15, 15, 14, 12, 8, 0, 0, + (3,0): 15, 15, 14, 12, 8, 0, 0, 0, + (4,0): 15, 14, 12, 8, 0, 0, 0, 0, + (5,0): 14, 12, 8, 0, 0, 0, 0, 0, + (6,0): 12, 8, 0, 0, 0, 0, 0, 0, + (7,0): 8, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/tpbitsUnsignedInt.ddl b/tools/testfiles/tpbitsUnsignedInt.ddl new file mode 100644 index 0000000..5e0fefe --- /dev/null +++ b/tools/testfiles/tpbitsUnsignedInt.ddl @@ -0,0 +1,28 @@ +HDF5 "packedbits.h5" { +DATASET "/DU16BITS" { + DATATYPE H5T_STD_U16LE + DATASPACE SIMPLE { ( 8, 16 ) / ( 8, 16 ) } + PACKED_BITS OFFSET=0 LENGTH=2 + DATA { + (0,0): 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=10 LENGTH=6 + DATA { + (0,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, + (1,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, + (2,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, + (3,0): 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, + (4,0): 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, + (5,0): 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, + (6,0): 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, 0, + (7,0): 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/tpbitsUnsignedInt4.ddl b/tools/testfiles/tpbitsUnsignedInt4.ddl new file mode 100644 index 0000000..0d3e38f --- /dev/null +++ b/tools/testfiles/tpbitsUnsignedInt4.ddl @@ -0,0 +1,50 @@ +HDF5 "packedbits.h5" { +DATASET "/DU16BITS" { + DATATYPE H5T_STD_U16LE + DATASPACE SIMPLE { ( 8, 16 ) / ( 8, 16 ) } + PACKED_BITS OFFSET=0 LENGTH=4 + DATA { + (0,0): 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=4 LENGTH=4 + DATA { + (0,0): 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=8 LENGTH=4 + DATA { + (0,0): 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, + (1,0): 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, + (2,0): 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, + (3,0): 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, + (4,0): 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=12 LENGTH=4 + DATA { + (0,0): 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, + (1,0): 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, + (2,0): 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, + (3,0): 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, + (4,0): 15, 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, + (5,0): 15, 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, + (6,0): 15, 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, + (7,0): 15, 15, 15, 15, 15, 15, 14, 12, 8, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/tpbitsUnsignedInt8.ddl b/tools/testfiles/tpbitsUnsignedInt8.ddl new file mode 100644 index 0000000..861ed3e --- /dev/null +++ b/tools/testfiles/tpbitsUnsignedInt8.ddl @@ -0,0 +1,34 @@ +HDF5 "packedbits.h5" { +DATASET "/DU16BITS" { + DATATYPE H5T_STD_U16LE + DATASPACE SIMPLE { ( 8, 16 ) / ( 8, 16 ) } + PACKED_BITS OFFSET=0 LENGTH=8 + DATA { + (0,0): 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=8 LENGTH=8 + DATA { + (0,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, + (0,13): 224, 192, 128, + (1,0): 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, + (1,13): 192, 128, 0, + (2,0): 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, + (2,13): 128, 0, 0, + (3,0): 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, + (3,14): 0, 0, + (4,0): 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, + (4,14): 0, 0, + (5,0): 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, + (5,15): 0, + (6,0): 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, + (7,0): 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/tpbitsUnsignedIntWhole.ddl b/tools/testfiles/tpbitsUnsignedIntWhole.ddl new file mode 100644 index 0000000..c054011 --- /dev/null +++ b/tools/testfiles/tpbitsUnsignedIntWhole.ddl @@ -0,0 +1,25 @@ +HDF5 "packedbits.h5" { +DATASET "/DU16BITS" { + DATATYPE H5T_STD_U16LE + DATASPACE SIMPLE { ( 8, 16 ) / ( 8, 16 ) } + PACKED_BITS OFFSET=0 LENGTH=16 + DATA { + (0,0): 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, + (0,9): 65024, 64512, 63488, 61440, 57344, 49152, 32768, + (1,0): 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, + (1,9): 64512, 63488, 61440, 57344, 49152, 32768, 0, + (2,0): 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, + (2,9): 63488, 61440, 57344, 49152, 32768, 0, 0, + (3,0): 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, + (3,9): 61440, 57344, 49152, 32768, 0, 0, 0, + (4,0): 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, + (4,9): 57344, 49152, 32768, 0, 0, 0, 0, + (5,0): 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, + (5,9): 49152, 32768, 0, 0, 0, 0, 0, + (6,0): 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, + (6,9): 32768, 0, 0, 0, 0, 0, 0, + (7,0): 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, + (7,10): 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/tpbitsUnsignedLong.ddl b/tools/testfiles/tpbitsUnsignedLong.ddl new file mode 100644 index 0000000..9f8bcb4 --- /dev/null +++ b/tools/testfiles/tpbitsUnsignedLong.ddl @@ -0,0 +1,44 @@ +HDF5 "packedbits.h5" { +DATASET "/DU32BITS" { + DATATYPE H5T_STD_U32LE + DATASPACE SIMPLE { ( 8, 32 ) / ( 8, 32 ) } + PACKED_BITS OFFSET=0 LENGTH=2 + DATA { + (0,0): 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (0,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=26 LENGTH=6 + DATA { + (0,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (0,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, + (1,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (1,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, + (2,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (2,17): 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, + (3,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (3,17): 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, + (4,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (4,17): 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, + (5,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (5,17): 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, + (6,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (6,17): 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, 0, + (7,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (7,17): 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/tpbitsUnsignedLong16.ddl b/tools/testfiles/tpbitsUnsignedLong16.ddl new file mode 100644 index 0000000..7a1984f --- /dev/null +++ b/tools/testfiles/tpbitsUnsignedLong16.ddl @@ -0,0 +1,67 @@ +HDF5 "packedbits.h5" { +DATASET "/DU32BITS" { + DATATYPE H5T_STD_U32LE + DATASPACE SIMPLE { ( 8, 32 ) / ( 8, 32 ) } + PACKED_BITS OFFSET=0 LENGTH=16 + DATA { + (0,0): 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, + (0,9): 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, + (0,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, + (1,9): 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, + (1,23): 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, + (2,9): 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,25): 0, 0, 0, 0, 0, 0, 0, + (3,0): 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, + (3,9): 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,26): 0, 0, 0, 0, 0, 0, + (4,0): 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, + (4,9): 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,27): 0, 0, 0, 0, 0, + (5,0): 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, + (5,9): 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,29): 0, 0, 0, + (6,0): 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, + (6,9): 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,30): 0, 0, + (7,0): 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, + (7,10): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=16 LENGTH=16 + DATA { + (0,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (0,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65534, + (0,18): 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, + (0,27): 63488, 61440, 57344, 49152, 32768, + (1,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (1,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65534, 65532, + (1,18): 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, + (1,27): 61440, 57344, 49152, 32768, 0, + (2,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (2,9): 65535, 65535, 65535, 65535, 65535, 65535, 65534, 65532, 65528, + (2,18): 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, + (2,27): 57344, 49152, 32768, 0, 0, + (3,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (3,9): 65535, 65535, 65535, 65535, 65535, 65534, 65532, 65528, 65520, + (3,18): 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, + (3,27): 49152, 32768, 0, 0, 0, + (4,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (4,9): 65535, 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, + (4,18): 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, + (4,27): 32768, 0, 0, 0, 0, + (5,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (5,9): 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, + (5,18): 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, + (5,28): 0, 0, 0, 0, + (6,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (6,9): 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, + (6,18): 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, + (6,29): 0, 0, 0, + (7,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (7,9): 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, + (7,18): 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, + (7,31): 0 + } +} +} diff --git a/tools/testfiles/tpbitsUnsignedLong8.ddl b/tools/testfiles/tpbitsUnsignedLong8.ddl new file mode 100644 index 0000000..17b896c --- /dev/null +++ b/tools/testfiles/tpbitsUnsignedLong8.ddl @@ -0,0 +1,96 @@ +HDF5 "packedbits.h5" { +DATASET "/DU32BITS" { + DATATYPE H5T_STD_U32LE + DATASPACE SIMPLE { ( 8, 32 ) / ( 8, 32 ) } + PACKED_BITS OFFSET=0 LENGTH=8 + DATA { + (0,0): 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (0,17): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,18): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,18): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,19): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,20): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,20): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,21): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=8 LENGTH=8 + DATA { + (0,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, + (0,13): 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, + (1,13): 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, + (2,13): 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, + (3,14): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, + (4,14): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, + (5,15): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, + (6,16): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, + (7,16): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=16 LENGTH=8 + DATA { + (0,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + (0,13): 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, + (0,28): 0, 0, 0, 0, + (1,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + (1,13): 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, + (1,28): 0, 0, 0, 0, + (2,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + (2,13): 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, + (2,29): 0, 0, 0, + (3,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + (3,13): 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,30): 0, 0, + (4,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + (4,13): 254, 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,30): 0, 0, + (5,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, + (5,13): 252, 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,31): 0, + (6,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, + (6,13): 248, 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, + (7,13): 240, 224, 192, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=24 LENGTH=8 + DATA { + (0,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + (0,13): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, + (0,26): 252, 248, 240, 224, 192, 128, + (1,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + (1,13): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, + (1,26): 248, 240, 224, 192, 128, 0, + (2,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + (2,13): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, + (2,26): 240, 224, 192, 128, 0, 0, + (3,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + (3,13): 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, + (3,26): 224, 192, 128, 0, 0, 0, + (4,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + (4,13): 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, + (4,26): 192, 128, 0, 0, 0, 0, + (5,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + (5,13): 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, + (5,26): 128, 0, 0, 0, 0, 0, + (6,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + (6,13): 255, 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, + (6,26): 0, 0, 0, 0, 0, 0, + (7,0): 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + (7,13): 255, 255, 255, 255, 255, 254, 252, 248, 240, 224, 192, 128, 0, 0, + (7,27): 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/tpbitsUnsignedLongLong.ddl b/tools/testfiles/tpbitsUnsignedLongLong.ddl new file mode 100644 index 0000000..1cd9a6c --- /dev/null +++ b/tools/testfiles/tpbitsUnsignedLongLong.ddl @@ -0,0 +1,68 @@ +HDF5 "packedbits.h5" { +DATASET "/DU64BITS" { + DATATYPE H5T_STD_U64LE + DATASPACE SIMPLE { ( 8, 64 ) / ( 8, 64 ) } + PACKED_BITS OFFSET=0 LENGTH=2 + DATA { + (0,0): 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (0,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (0,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=58 LENGTH=6 + DATA { + (0,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (0,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (0,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (0,49): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, + (1,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (1,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (1,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (1,49): 63, 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, + (2,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (2,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (2,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (2,49): 63, 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, + (3,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (3,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (3,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (3,49): 63, 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, + (4,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (4,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (4,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (4,49): 63, 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, + (5,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (5,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (5,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (5,49): 63, 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, + (6,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (6,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (6,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (6,49): 63, 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, 0, + (7,0): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (7,17): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (7,33): 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + (7,49): 63, 63, 63, 62, 60, 56, 48, 32, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/tpbitsUnsignedLongLong16.ddl b/tools/testfiles/tpbitsUnsignedLongLong16.ddl new file mode 100644 index 0000000..f8b0189 --- /dev/null +++ b/tools/testfiles/tpbitsUnsignedLongLong16.ddl @@ -0,0 +1,196 @@ +HDF5 "packedbits.h5" { +DATASET "/DU64BITS" { + DATATYPE H5T_STD_U64LE + DATASPACE SIMPLE { ( 8, 64 ) / ( 8, 64 ) } + PACKED_BITS OFFSET=0 LENGTH=16 + DATA { + (0,0): 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, + (0,9): 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, + (0,22): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (0,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, + (1,9): 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, + (1,23): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,45): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, + (2,9): 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,25): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,47): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, + (3,9): 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,26): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,48): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, + (4,9): 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,27): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,49): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, + (5,9): 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,29): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,51): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, + (6,9): 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,30): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,52): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, + (7,10): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,32): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,54): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=16 LENGTH=16 + DATA { + (0,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (0,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65534, + (0,18): 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, + (0,27): 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (0,42): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (1,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65534, 65532, + (1,18): 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, + (1,27): 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (2,9): 65535, 65535, 65535, 65535, 65535, 65535, 65534, 65532, 65528, + (2,18): 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, + (2,27): 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,45): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (3,9): 65535, 65535, 65535, 65535, 65535, 65534, 65532, 65528, 65520, + (3,18): 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, + (3,27): 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,46): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (4,9): 65535, 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, + (4,18): 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, + (4,27): 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,48): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (5,9): 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, + (5,18): 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, + (5,28): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,50): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (6,9): 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, + (6,18): 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, + (6,29): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,51): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (7,9): 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, + (7,18): 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, + (7,31): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,53): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=32 LENGTH=16 + DATA { + (0,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (0,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (0,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (0,27): 65535, 65535, 65535, 65535, 65535, 65535, 65534, 65532, 65528, + (0,36): 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, + (0,45): 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (0,63): 0, + (1,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (1,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (1,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (1,27): 65535, 65535, 65535, 65535, 65535, 65534, 65532, 65528, 65520, + (1,36): 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, + (1,45): 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (2,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (2,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (2,27): 65535, 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, + (2,36): 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, + (2,45): 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (3,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (3,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (3,27): 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, + (3,36): 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, + (3,46): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (4,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (4,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (4,27): 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, + (4,36): 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, + (4,47): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (5,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (5,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (5,27): 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, + (5,36): 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, + (5,49): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (6,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (6,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (6,27): 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, + (6,36): 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, + (6,50): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (7,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (7,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65534, + (7,27): 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, + (7,36): 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,51): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=48 LENGTH=16 + DATA { + (0,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (0,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (0,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (0,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (0,36): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (0,45): 65535, 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, + (0,54): 65472, 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, + (0,63): 32768, + (1,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (1,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (1,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (1,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (1,36): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (1,45): 65535, 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, + (1,54): 65408, 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, + (2,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (2,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (2,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (2,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (2,36): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (2,45): 65535, 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, + (2,54): 65280, 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, + (3,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (3,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (3,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (3,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (3,36): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (3,45): 65535, 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, + (3,54): 65024, 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, + (4,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (4,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (4,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (4,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (4,36): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (4,45): 65534, 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, + (4,54): 64512, 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, + (5,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (5,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (5,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (5,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (5,36): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65534, + (5,45): 65532, 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, + (5,54): 63488, 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, + (6,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (6,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (6,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (6,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (6,36): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65534, 65532, + (6,45): 65528, 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, + (6,54): 61440, 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, + (7,0): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (7,9): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (7,18): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (7,27): 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, + (7,36): 65535, 65535, 65535, 65535, 65535, 65535, 65534, 65532, 65528, + (7,45): 65520, 65504, 65472, 65408, 65280, 65024, 64512, 63488, 61440, + (7,54): 57344, 49152, 32768, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/tpbitsUnsignedLongLong32.ddl b/tools/testfiles/tpbitsUnsignedLongLong32.ddl new file mode 100644 index 0000000..befaf5b --- /dev/null +++ b/tools/testfiles/tpbitsUnsignedLongLong32.ddl @@ -0,0 +1,175 @@ +HDF5 "packedbits.h5" { +DATASET "/DU64BITS" { + DATATYPE H5T_STD_U64LE + DATASPACE SIMPLE { ( 8, 64 ) / ( 8, 64 ) } + PACKED_BITS OFFSET=0 LENGTH=32 + DATA { + (0,0): 4294967295, 4294967294, 4294967292, 4294967288, 4294967280, + (0,5): 4294967264, 4294967232, 4294967168, 4294967040, 4294966784, + (0,10): 4294966272, 4294965248, 4294963200, 4294959104, 4294950912, + (0,15): 4294934528, 4294901760, 4294836224, 4294705152, 4294443008, + (0,20): 4293918720, 4292870144, 4290772992, 4286578688, 4278190080, + (0,25): 4261412864, 4227858432, 4160749568, 4026531840, 3758096384, + (0,30): 3221225472, 2147483648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (0,46): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,0): 4294967294, 4294967292, 4294967288, 4294967280, 4294967264, + (1,5): 4294967232, 4294967168, 4294967040, 4294966784, 4294966272, + (1,10): 4294965248, 4294963200, 4294959104, 4294950912, 4294934528, + (1,15): 4294901760, 4294836224, 4294705152, 4294443008, 4293918720, + (1,20): 4292870144, 4290772992, 4286578688, 4278190080, 4261412864, + (1,25): 4227858432, 4160749568, 4026531840, 3758096384, 3221225472, + (1,30): 2147483648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (1,49): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,0): 4294967292, 4294967288, 4294967280, 4294967264, 4294967232, + (2,5): 4294967168, 4294967040, 4294966784, 4294966272, 4294965248, + (2,10): 4294963200, 4294959104, 4294950912, 4294934528, 4294901760, + (2,15): 4294836224, 4294705152, 4294443008, 4293918720, 4292870144, + (2,20): 4290772992, 4286578688, 4278190080, 4261412864, 4227858432, + (2,25): 4160749568, 4026531840, 3758096384, 3221225472, 2147483648, 0, 0, + (2,32): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (2,54): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,0): 4294967288, 4294967280, 4294967264, 4294967232, 4294967168, + (3,5): 4294967040, 4294966784, 4294966272, 4294965248, 4294963200, + (3,10): 4294959104, 4294950912, 4294934528, 4294901760, 4294836224, + (3,15): 4294705152, 4294443008, 4293918720, 4292870144, 4290772992, + (3,20): 4286578688, 4278190080, 4261412864, 4227858432, 4160749568, + (3,25): 4026531840, 3758096384, 3221225472, 2147483648, 0, 0, 0, 0, 0, 0, + (3,35): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (3,57): 0, 0, 0, 0, 0, 0, 0, + (4,0): 4294967280, 4294967264, 4294967232, 4294967168, 4294967040, + (4,5): 4294966784, 4294966272, 4294965248, 4294963200, 4294959104, + (4,10): 4294950912, 4294934528, 4294901760, 4294836224, 4294705152, + (4,15): 4294443008, 4293918720, 4292870144, 4290772992, 4286578688, + (4,20): 4278190080, 4261412864, 4227858432, 4160749568, 4026531840, + (4,25): 3758096384, 3221225472, 2147483648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,38): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (4,60): 0, 0, 0, 0, + (5,0): 4294967264, 4294967232, 4294967168, 4294967040, 4294966784, + (5,5): 4294966272, 4294965248, 4294963200, 4294959104, 4294950912, + (5,10): 4294934528, 4294901760, 4294836224, 4294705152, 4294443008, + (5,15): 4293918720, 4292870144, 4290772992, 4286578688, 4278190080, + (5,20): 4261412864, 4227858432, 4160749568, 4026531840, 3758096384, + (5,25): 3221225472, 2147483648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,41): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (5,63): 0, + (6,0): 4294967232, 4294967168, 4294967040, 4294966784, 4294966272, + (6,5): 4294965248, 4294963200, 4294959104, 4294950912, 4294934528, + (6,10): 4294901760, 4294836224, 4294705152, 4294443008, 4293918720, + (6,15): 4292870144, 4290772992, 4286578688, 4278190080, 4261412864, + (6,20): 4227858432, 4160749568, 4026531840, 3758096384, 3221225472, + (6,25): 2147483648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (6,44): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,0): 4294967168, 4294967040, 4294966784, 4294966272, 4294965248, + (7,5): 4294963200, 4294959104, 4294950912, 4294934528, 4294901760, + (7,10): 4294836224, 4294705152, 4294443008, 4293918720, 4292870144, + (7,15): 4290772992, 4286578688, 4278190080, 4261412864, 4227858432, + (7,20): 4160749568, 4026531840, 3758096384, 3221225472, 2147483648, 0, 0, + (7,27): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + (7,49): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + } + PACKED_BITS OFFSET=32 LENGTH=32 + DATA { + (0,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (0,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (0,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (0,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (0,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (0,25): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (0,30): 4294967295, 4294967295, 4294967295, 4294967294, 4294967292, + (0,35): 4294967288, 4294967280, 4294967264, 4294967232, 4294967168, + (0,40): 4294967040, 4294966784, 4294966272, 4294965248, 4294963200, + (0,45): 4294959104, 4294950912, 4294934528, 4294901760, 4294836224, + (0,50): 4294705152, 4294443008, 4293918720, 4292870144, 4290772992, + (0,55): 4286578688, 4278190080, 4261412864, 4227858432, 4160749568, + (0,60): 4026531840, 3758096384, 3221225472, 2147483648, + (1,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (1,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (1,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (1,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (1,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (1,25): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (1,30): 4294967295, 4294967295, 4294967294, 4294967292, 4294967288, + (1,35): 4294967280, 4294967264, 4294967232, 4294967168, 4294967040, + (1,40): 4294966784, 4294966272, 4294965248, 4294963200, 4294959104, + (1,45): 4294950912, 4294934528, 4294901760, 4294836224, 4294705152, + (1,50): 4294443008, 4293918720, 4292870144, 4290772992, 4286578688, + (1,55): 4278190080, 4261412864, 4227858432, 4160749568, 4026531840, + (1,60): 3758096384, 3221225472, 2147483648, 0, + (2,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (2,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (2,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (2,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (2,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (2,25): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (2,30): 4294967295, 4294967294, 4294967292, 4294967288, 4294967280, + (2,35): 4294967264, 4294967232, 4294967168, 4294967040, 4294966784, + (2,40): 4294966272, 4294965248, 4294963200, 4294959104, 4294950912, + (2,45): 4294934528, 4294901760, 4294836224, 4294705152, 4294443008, + (2,50): 4293918720, 4292870144, 4290772992, 4286578688, 4278190080, + (2,55): 4261412864, 4227858432, 4160749568, 4026531840, 3758096384, + (2,60): 3221225472, 2147483648, 0, 0, + (3,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (3,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (3,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (3,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (3,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (3,25): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (3,30): 4294967294, 4294967292, 4294967288, 4294967280, 4294967264, + (3,35): 4294967232, 4294967168, 4294967040, 4294966784, 4294966272, + (3,40): 4294965248, 4294963200, 4294959104, 4294950912, 4294934528, + (3,45): 4294901760, 4294836224, 4294705152, 4294443008, 4293918720, + (3,50): 4292870144, 4290772992, 4286578688, 4278190080, 4261412864, + (3,55): 4227858432, 4160749568, 4026531840, 3758096384, 3221225472, + (3,60): 2147483648, 0, 0, 0, + (4,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (4,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (4,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (4,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (4,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (4,25): 4294967295, 4294967295, 4294967295, 4294967295, 4294967294, + (4,30): 4294967292, 4294967288, 4294967280, 4294967264, 4294967232, + (4,35): 4294967168, 4294967040, 4294966784, 4294966272, 4294965248, + (4,40): 4294963200, 4294959104, 4294950912, 4294934528, 4294901760, + (4,45): 4294836224, 4294705152, 4294443008, 4293918720, 4292870144, + (4,50): 4290772992, 4286578688, 4278190080, 4261412864, 4227858432, + (4,55): 4160749568, 4026531840, 3758096384, 3221225472, 2147483648, 0, 0, + (4,62): 0, 0, + (5,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (5,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (5,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (5,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (5,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (5,25): 4294967295, 4294967295, 4294967295, 4294967294, 4294967292, + (5,30): 4294967288, 4294967280, 4294967264, 4294967232, 4294967168, + (5,35): 4294967040, 4294966784, 4294966272, 4294965248, 4294963200, + (5,40): 4294959104, 4294950912, 4294934528, 4294901760, 4294836224, + (5,45): 4294705152, 4294443008, 4293918720, 4292870144, 4290772992, + (5,50): 4286578688, 4278190080, 4261412864, 4227858432, 4160749568, + (5,55): 4026531840, 3758096384, 3221225472, 2147483648, 0, 0, 0, 0, 0, + (6,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (6,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (6,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (6,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (6,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (6,25): 4294967295, 4294967295, 4294967294, 4294967292, 4294967288, + (6,30): 4294967280, 4294967264, 4294967232, 4294967168, 4294967040, + (6,35): 4294966784, 4294966272, 4294965248, 4294963200, 4294959104, + (6,40): 4294950912, 4294934528, 4294901760, 4294836224, 4294705152, + (6,45): 4294443008, 4293918720, 4292870144, 4290772992, 4286578688, + (6,50): 4278190080, 4261412864, 4227858432, 4160749568, 4026531840, + (6,55): 3758096384, 3221225472, 2147483648, 0, 0, 0, 0, 0, 0, + (7,0): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (7,5): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (7,10): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (7,15): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (7,20): 4294967295, 4294967295, 4294967295, 4294967295, 4294967295, + (7,25): 4294967295, 4294967294, 4294967292, 4294967288, 4294967280, + (7,30): 4294967264, 4294967232, 4294967168, 4294967040, 4294966784, + (7,35): 4294966272, 4294965248, 4294963200, 4294959104, 4294950912, + (7,40): 4294934528, 4294901760, 4294836224, 4294705152, 4294443008, + (7,45): 4293918720, 4292870144, 4290772992, 4286578688, 4278190080, + (7,50): 4261412864, 4227858432, 4160749568, 4026531840, 3758096384, + (7,55): 3221225472, 2147483648, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/tpbitsUnsignedLongLongWhole.ddl b/tools/testfiles/tpbitsUnsignedLongLongWhole.ddl new file mode 100644 index 0000000..27c8879 --- /dev/null +++ b/tools/testfiles/tpbitsUnsignedLongLongWhole.ddl @@ -0,0 +1,176 @@ +HDF5 "packedbits.h5" { +DATASET "/DU64BITS" { + DATATYPE H5T_STD_U64LE + DATASPACE SIMPLE { ( 8, 64 ) / ( 8, 64 ) } + PACKED_BITS OFFSET=0 LENGTH=64 + DATA { + (0,0): 18446744073709551615, 18446744073709551614, 18446744073709551612, + (0,3): 18446744073709551608, 18446744073709551600, 18446744073709551584, + (0,6): 18446744073709551552, 18446744073709551488, 18446744073709551360, + (0,9): 18446744073709551104, 18446744073709550592, 18446744073709549568, + (0,12): 18446744073709547520, 18446744073709543424, 18446744073709535232, + (0,15): 18446744073709518848, 18446744073709486080, 18446744073709420544, + (0,18): 18446744073709289472, 18446744073709027328, 18446744073708503040, + (0,21): 18446744073707454464, 18446744073705357312, 18446744073701163008, + (0,24): 18446744073692774400, 18446744073675997184, 18446744073642442752, + (0,27): 18446744073575333888, 18446744073441116160, 18446744073172680704, + (0,30): 18446744072635809792, 18446744071562067968, 18446744069414584320, + (0,33): 18446744065119617024, 18446744056529682432, 18446744039349813248, + (0,36): 18446744004990074880, 18446743936270598144, 18446743798831644672, + (0,39): 18446743523953737728, 18446742974197923840, 18446741874686296064, + (0,42): 18446739675663040512, 18446735277616529408, 18446726481523507200, + (0,45): 18446708889337462784, 18446673704965373952, 18446603336221196288, + (0,48): 18446462598732840960, 18446181123756130304, 18445618173802708992, + (0,51): 18444492273895866368, 18442240474082181120, 18437736874454810624, + (0,54): 18428729675200069632, 18410715276690587648, 18374686479671623680, + (0,57): 18302628885633695744, 18158513697557839872, 17870283321406128128, + (0,60): 17293822569102704640, 16140901064495857664, 13835058055282163712, + (0,63): 9223372036854775808, + (1,0): 18446744073709551614, 18446744073709551612, 18446744073709551608, + (1,3): 18446744073709551600, 18446744073709551584, 18446744073709551552, + (1,6): 18446744073709551488, 18446744073709551360, 18446744073709551104, + (1,9): 18446744073709550592, 18446744073709549568, 18446744073709547520, + (1,12): 18446744073709543424, 18446744073709535232, 18446744073709518848, + (1,15): 18446744073709486080, 18446744073709420544, 18446744073709289472, + (1,18): 18446744073709027328, 18446744073708503040, 18446744073707454464, + (1,21): 18446744073705357312, 18446744073701163008, 18446744073692774400, + (1,24): 18446744073675997184, 18446744073642442752, 18446744073575333888, + (1,27): 18446744073441116160, 18446744073172680704, 18446744072635809792, + (1,30): 18446744071562067968, 18446744069414584320, 18446744065119617024, + (1,33): 18446744056529682432, 18446744039349813248, 18446744004990074880, + (1,36): 18446743936270598144, 18446743798831644672, 18446743523953737728, + (1,39): 18446742974197923840, 18446741874686296064, 18446739675663040512, + (1,42): 18446735277616529408, 18446726481523507200, 18446708889337462784, + (1,45): 18446673704965373952, 18446603336221196288, 18446462598732840960, + (1,48): 18446181123756130304, 18445618173802708992, 18444492273895866368, + (1,51): 18442240474082181120, 18437736874454810624, 18428729675200069632, + (1,54): 18410715276690587648, 18374686479671623680, 18302628885633695744, + (1,57): 18158513697557839872, 17870283321406128128, 17293822569102704640, + (1,60): 16140901064495857664, 13835058055282163712, 9223372036854775808, + (1,63): 0, + (2,0): 18446744073709551612, 18446744073709551608, 18446744073709551600, + (2,3): 18446744073709551584, 18446744073709551552, 18446744073709551488, + (2,6): 18446744073709551360, 18446744073709551104, 18446744073709550592, + (2,9): 18446744073709549568, 18446744073709547520, 18446744073709543424, + (2,12): 18446744073709535232, 18446744073709518848, 18446744073709486080, + (2,15): 18446744073709420544, 18446744073709289472, 18446744073709027328, + (2,18): 18446744073708503040, 18446744073707454464, 18446744073705357312, + (2,21): 18446744073701163008, 18446744073692774400, 18446744073675997184, + (2,24): 18446744073642442752, 18446744073575333888, 18446744073441116160, + (2,27): 18446744073172680704, 18446744072635809792, 18446744071562067968, + (2,30): 18446744069414584320, 18446744065119617024, 18446744056529682432, + (2,33): 18446744039349813248, 18446744004990074880, 18446743936270598144, + (2,36): 18446743798831644672, 18446743523953737728, 18446742974197923840, + (2,39): 18446741874686296064, 18446739675663040512, 18446735277616529408, + (2,42): 18446726481523507200, 18446708889337462784, 18446673704965373952, + (2,45): 18446603336221196288, 18446462598732840960, 18446181123756130304, + (2,48): 18445618173802708992, 18444492273895866368, 18442240474082181120, + (2,51): 18437736874454810624, 18428729675200069632, 18410715276690587648, + (2,54): 18374686479671623680, 18302628885633695744, 18158513697557839872, + (2,57): 17870283321406128128, 17293822569102704640, 16140901064495857664, + (2,60): 13835058055282163712, 9223372036854775808, 0, 0, + (3,0): 18446744073709551608, 18446744073709551600, 18446744073709551584, + (3,3): 18446744073709551552, 18446744073709551488, 18446744073709551360, + (3,6): 18446744073709551104, 18446744073709550592, 18446744073709549568, + (3,9): 18446744073709547520, 18446744073709543424, 18446744073709535232, + (3,12): 18446744073709518848, 18446744073709486080, 18446744073709420544, + (3,15): 18446744073709289472, 18446744073709027328, 18446744073708503040, + (3,18): 18446744073707454464, 18446744073705357312, 18446744073701163008, + (3,21): 18446744073692774400, 18446744073675997184, 18446744073642442752, + (3,24): 18446744073575333888, 18446744073441116160, 18446744073172680704, + (3,27): 18446744072635809792, 18446744071562067968, 18446744069414584320, + (3,30): 18446744065119617024, 18446744056529682432, 18446744039349813248, + (3,33): 18446744004990074880, 18446743936270598144, 18446743798831644672, + (3,36): 18446743523953737728, 18446742974197923840, 18446741874686296064, + (3,39): 18446739675663040512, 18446735277616529408, 18446726481523507200, + (3,42): 18446708889337462784, 18446673704965373952, 18446603336221196288, + (3,45): 18446462598732840960, 18446181123756130304, 18445618173802708992, + (3,48): 18444492273895866368, 18442240474082181120, 18437736874454810624, + (3,51): 18428729675200069632, 18410715276690587648, 18374686479671623680, + (3,54): 18302628885633695744, 18158513697557839872, 17870283321406128128, + (3,57): 17293822569102704640, 16140901064495857664, 13835058055282163712, + (3,60): 9223372036854775808, 0, 0, 0, + (4,0): 18446744073709551600, 18446744073709551584, 18446744073709551552, + (4,3): 18446744073709551488, 18446744073709551360, 18446744073709551104, + (4,6): 18446744073709550592, 18446744073709549568, 18446744073709547520, + (4,9): 18446744073709543424, 18446744073709535232, 18446744073709518848, + (4,12): 18446744073709486080, 18446744073709420544, 18446744073709289472, + (4,15): 18446744073709027328, 18446744073708503040, 18446744073707454464, + (4,18): 18446744073705357312, 18446744073701163008, 18446744073692774400, + (4,21): 18446744073675997184, 18446744073642442752, 18446744073575333888, + (4,24): 18446744073441116160, 18446744073172680704, 18446744072635809792, + (4,27): 18446744071562067968, 18446744069414584320, 18446744065119617024, + (4,30): 18446744056529682432, 18446744039349813248, 18446744004990074880, + (4,33): 18446743936270598144, 18446743798831644672, 18446743523953737728, + (4,36): 18446742974197923840, 18446741874686296064, 18446739675663040512, + (4,39): 18446735277616529408, 18446726481523507200, 18446708889337462784, + (4,42): 18446673704965373952, 18446603336221196288, 18446462598732840960, + (4,45): 18446181123756130304, 18445618173802708992, 18444492273895866368, + (4,48): 18442240474082181120, 18437736874454810624, 18428729675200069632, + (4,51): 18410715276690587648, 18374686479671623680, 18302628885633695744, + (4,54): 18158513697557839872, 17870283321406128128, 17293822569102704640, + (4,57): 16140901064495857664, 13835058055282163712, 9223372036854775808, + (4,60): 0, 0, 0, 0, + (5,0): 18446744073709551584, 18446744073709551552, 18446744073709551488, + (5,3): 18446744073709551360, 18446744073709551104, 18446744073709550592, + (5,6): 18446744073709549568, 18446744073709547520, 18446744073709543424, + (5,9): 18446744073709535232, 18446744073709518848, 18446744073709486080, + (5,12): 18446744073709420544, 18446744073709289472, 18446744073709027328, + (5,15): 18446744073708503040, 18446744073707454464, 18446744073705357312, + (5,18): 18446744073701163008, 18446744073692774400, 18446744073675997184, + (5,21): 18446744073642442752, 18446744073575333888, 18446744073441116160, + (5,24): 18446744073172680704, 18446744072635809792, 18446744071562067968, + (5,27): 18446744069414584320, 18446744065119617024, 18446744056529682432, + (5,30): 18446744039349813248, 18446744004990074880, 18446743936270598144, + (5,33): 18446743798831644672, 18446743523953737728, 18446742974197923840, + (5,36): 18446741874686296064, 18446739675663040512, 18446735277616529408, + (5,39): 18446726481523507200, 18446708889337462784, 18446673704965373952, + (5,42): 18446603336221196288, 18446462598732840960, 18446181123756130304, + (5,45): 18445618173802708992, 18444492273895866368, 18442240474082181120, + (5,48): 18437736874454810624, 18428729675200069632, 18410715276690587648, + (5,51): 18374686479671623680, 18302628885633695744, 18158513697557839872, + (5,54): 17870283321406128128, 17293822569102704640, 16140901064495857664, + (5,57): 13835058055282163712, 9223372036854775808, 0, 0, 0, 0, 0, + (6,0): 18446744073709551552, 18446744073709551488, 18446744073709551360, + (6,3): 18446744073709551104, 18446744073709550592, 18446744073709549568, + (6,6): 18446744073709547520, 18446744073709543424, 18446744073709535232, + (6,9): 18446744073709518848, 18446744073709486080, 18446744073709420544, + (6,12): 18446744073709289472, 18446744073709027328, 18446744073708503040, + (6,15): 18446744073707454464, 18446744073705357312, 18446744073701163008, + (6,18): 18446744073692774400, 18446744073675997184, 18446744073642442752, + (6,21): 18446744073575333888, 18446744073441116160, 18446744073172680704, + (6,24): 18446744072635809792, 18446744071562067968, 18446744069414584320, + (6,27): 18446744065119617024, 18446744056529682432, 18446744039349813248, + (6,30): 18446744004990074880, 18446743936270598144, 18446743798831644672, + (6,33): 18446743523953737728, 18446742974197923840, 18446741874686296064, + (6,36): 18446739675663040512, 18446735277616529408, 18446726481523507200, + (6,39): 18446708889337462784, 18446673704965373952, 18446603336221196288, + (6,42): 18446462598732840960, 18446181123756130304, 18445618173802708992, + (6,45): 18444492273895866368, 18442240474082181120, 18437736874454810624, + (6,48): 18428729675200069632, 18410715276690587648, 18374686479671623680, + (6,51): 18302628885633695744, 18158513697557839872, 17870283321406128128, + (6,54): 17293822569102704640, 16140901064495857664, 13835058055282163712, + (6,57): 9223372036854775808, 0, 0, 0, 0, 0, 0, + (7,0): 18446744073709551488, 18446744073709551360, 18446744073709551104, + (7,3): 18446744073709550592, 18446744073709549568, 18446744073709547520, + (7,6): 18446744073709543424, 18446744073709535232, 18446744073709518848, + (7,9): 18446744073709486080, 18446744073709420544, 18446744073709289472, + (7,12): 18446744073709027328, 18446744073708503040, 18446744073707454464, + (7,15): 18446744073705357312, 18446744073701163008, 18446744073692774400, + (7,18): 18446744073675997184, 18446744073642442752, 18446744073575333888, + (7,21): 18446744073441116160, 18446744073172680704, 18446744072635809792, + (7,24): 18446744071562067968, 18446744069414584320, 18446744065119617024, + (7,27): 18446744056529682432, 18446744039349813248, 18446744004990074880, + (7,30): 18446743936270598144, 18446743798831644672, 18446743523953737728, + (7,33): 18446742974197923840, 18446741874686296064, 18446739675663040512, + (7,36): 18446735277616529408, 18446726481523507200, 18446708889337462784, + (7,39): 18446673704965373952, 18446603336221196288, 18446462598732840960, + (7,42): 18446181123756130304, 18445618173802708992, 18444492273895866368, + (7,45): 18442240474082181120, 18437736874454810624, 18428729675200069632, + (7,48): 18410715276690587648, 18374686479671623680, 18302628885633695744, + (7,51): 18158513697557839872, 17870283321406128128, 17293822569102704640, + (7,54): 16140901064495857664, 13835058055282163712, 9223372036854775808, + (7,57): 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/tpbitsUnsignedLongLongWhole1.ddl b/tools/testfiles/tpbitsUnsignedLongLongWhole1.ddl new file mode 100644 index 0000000..0302105 --- /dev/null +++ b/tools/testfiles/tpbitsUnsignedLongLongWhole1.ddl @@ -0,0 +1,175 @@ +HDF5 "packedbits.h5" { +DATASET "/DU64BITS" { + DATATYPE H5T_STD_U64LE + DATASPACE SIMPLE { ( 8, 64 ) / ( 8, 64 ) } + PACKED_BITS OFFSET=1 LENGTH=63 + DATA { + (0,0): 9223372036854775807, 9223372036854775807, 9223372036854775806, + (0,3): 9223372036854775804, 9223372036854775800, 9223372036854775792, + (0,6): 9223372036854775776, 9223372036854775744, 9223372036854775680, + (0,9): 9223372036854775552, 9223372036854775296, 9223372036854774784, + (0,12): 9223372036854773760, 9223372036854771712, 9223372036854767616, + (0,15): 9223372036854759424, 9223372036854743040, 9223372036854710272, + (0,18): 9223372036854644736, 9223372036854513664, 9223372036854251520, + (0,21): 9223372036853727232, 9223372036852678656, 9223372036850581504, + (0,24): 9223372036846387200, 9223372036837998592, 9223372036821221376, + (0,27): 9223372036787666944, 9223372036720558080, 9223372036586340352, + (0,30): 9223372036317904896, 9223372035781033984, 9223372034707292160, + (0,33): 9223372032559808512, 9223372028264841216, 9223372019674906624, + (0,36): 9223372002495037440, 9223371968135299072, 9223371899415822336, + (0,39): 9223371761976868864, 9223371487098961920, 9223370937343148032, + (0,42): 9223369837831520256, 9223367638808264704, 9223363240761753600, + (0,45): 9223354444668731392, 9223336852482686976, 9223301668110598144, + (0,48): 9223231299366420480, 9223090561878065152, 9222809086901354496, + (0,51): 9222246136947933184, 9221120237041090560, 9218868437227405312, + (0,54): 9214364837600034816, 9205357638345293824, 9187343239835811840, + (0,57): 9151314442816847872, 9079256848778919936, 8935141660703064064, + (0,60): 8646911284551352320, 8070450532247928832, 6917529027641081856, + (0,63): 4611686018427387904, + (1,0): 9223372036854775807, 9223372036854775806, 9223372036854775804, + (1,3): 9223372036854775800, 9223372036854775792, 9223372036854775776, + (1,6): 9223372036854775744, 9223372036854775680, 9223372036854775552, + (1,9): 9223372036854775296, 9223372036854774784, 9223372036854773760, + (1,12): 9223372036854771712, 9223372036854767616, 9223372036854759424, + (1,15): 9223372036854743040, 9223372036854710272, 9223372036854644736, + (1,18): 9223372036854513664, 9223372036854251520, 9223372036853727232, + (1,21): 9223372036852678656, 9223372036850581504, 9223372036846387200, + (1,24): 9223372036837998592, 9223372036821221376, 9223372036787666944, + (1,27): 9223372036720558080, 9223372036586340352, 9223372036317904896, + (1,30): 9223372035781033984, 9223372034707292160, 9223372032559808512, + (1,33): 9223372028264841216, 9223372019674906624, 9223372002495037440, + (1,36): 9223371968135299072, 9223371899415822336, 9223371761976868864, + (1,39): 9223371487098961920, 9223370937343148032, 9223369837831520256, + (1,42): 9223367638808264704, 9223363240761753600, 9223354444668731392, + (1,45): 9223336852482686976, 9223301668110598144, 9223231299366420480, + (1,48): 9223090561878065152, 9222809086901354496, 9222246136947933184, + (1,51): 9221120237041090560, 9218868437227405312, 9214364837600034816, + (1,54): 9205357638345293824, 9187343239835811840, 9151314442816847872, + (1,57): 9079256848778919936, 8935141660703064064, 8646911284551352320, + (1,60): 8070450532247928832, 6917529027641081856, 4611686018427387904, 0, + (2,0): 9223372036854775806, 9223372036854775804, 9223372036854775800, + (2,3): 9223372036854775792, 9223372036854775776, 9223372036854775744, + (2,6): 9223372036854775680, 9223372036854775552, 9223372036854775296, + (2,9): 9223372036854774784, 9223372036854773760, 9223372036854771712, + (2,12): 9223372036854767616, 9223372036854759424, 9223372036854743040, + (2,15): 9223372036854710272, 9223372036854644736, 9223372036854513664, + (2,18): 9223372036854251520, 9223372036853727232, 9223372036852678656, + (2,21): 9223372036850581504, 9223372036846387200, 9223372036837998592, + (2,24): 9223372036821221376, 9223372036787666944, 9223372036720558080, + (2,27): 9223372036586340352, 9223372036317904896, 9223372035781033984, + (2,30): 9223372034707292160, 9223372032559808512, 9223372028264841216, + (2,33): 9223372019674906624, 9223372002495037440, 9223371968135299072, + (2,36): 9223371899415822336, 9223371761976868864, 9223371487098961920, + (2,39): 9223370937343148032, 9223369837831520256, 9223367638808264704, + (2,42): 9223363240761753600, 9223354444668731392, 9223336852482686976, + (2,45): 9223301668110598144, 9223231299366420480, 9223090561878065152, + (2,48): 9222809086901354496, 9222246136947933184, 9221120237041090560, + (2,51): 9218868437227405312, 9214364837600034816, 9205357638345293824, + (2,54): 9187343239835811840, 9151314442816847872, 9079256848778919936, + (2,57): 8935141660703064064, 8646911284551352320, 8070450532247928832, + (2,60): 6917529027641081856, 4611686018427387904, 0, 0, + (3,0): 9223372036854775804, 9223372036854775800, 9223372036854775792, + (3,3): 9223372036854775776, 9223372036854775744, 9223372036854775680, + (3,6): 9223372036854775552, 9223372036854775296, 9223372036854774784, + (3,9): 9223372036854773760, 9223372036854771712, 9223372036854767616, + (3,12): 9223372036854759424, 9223372036854743040, 9223372036854710272, + (3,15): 9223372036854644736, 9223372036854513664, 9223372036854251520, + (3,18): 9223372036853727232, 9223372036852678656, 9223372036850581504, + (3,21): 9223372036846387200, 9223372036837998592, 9223372036821221376, + (3,24): 9223372036787666944, 9223372036720558080, 9223372036586340352, + (3,27): 9223372036317904896, 9223372035781033984, 9223372034707292160, + (3,30): 9223372032559808512, 9223372028264841216, 9223372019674906624, + (3,33): 9223372002495037440, 9223371968135299072, 9223371899415822336, + (3,36): 9223371761976868864, 9223371487098961920, 9223370937343148032, + (3,39): 9223369837831520256, 9223367638808264704, 9223363240761753600, + (3,42): 9223354444668731392, 9223336852482686976, 9223301668110598144, + (3,45): 9223231299366420480, 9223090561878065152, 9222809086901354496, + (3,48): 9222246136947933184, 9221120237041090560, 9218868437227405312, + (3,51): 9214364837600034816, 9205357638345293824, 9187343239835811840, + (3,54): 9151314442816847872, 9079256848778919936, 8935141660703064064, + (3,57): 8646911284551352320, 8070450532247928832, 6917529027641081856, + (3,60): 4611686018427387904, 0, 0, 0, + (4,0): 9223372036854775800, 9223372036854775792, 9223372036854775776, + (4,3): 9223372036854775744, 9223372036854775680, 9223372036854775552, + (4,6): 9223372036854775296, 9223372036854774784, 9223372036854773760, + (4,9): 9223372036854771712, 9223372036854767616, 9223372036854759424, + (4,12): 9223372036854743040, 9223372036854710272, 9223372036854644736, + (4,15): 9223372036854513664, 9223372036854251520, 9223372036853727232, + (4,18): 9223372036852678656, 9223372036850581504, 9223372036846387200, + (4,21): 9223372036837998592, 9223372036821221376, 9223372036787666944, + (4,24): 9223372036720558080, 9223372036586340352, 9223372036317904896, + (4,27): 9223372035781033984, 9223372034707292160, 9223372032559808512, + (4,30): 9223372028264841216, 9223372019674906624, 9223372002495037440, + (4,33): 9223371968135299072, 9223371899415822336, 9223371761976868864, + (4,36): 9223371487098961920, 9223370937343148032, 9223369837831520256, + (4,39): 9223367638808264704, 9223363240761753600, 9223354444668731392, + (4,42): 9223336852482686976, 9223301668110598144, 9223231299366420480, + (4,45): 9223090561878065152, 9222809086901354496, 9222246136947933184, + (4,48): 9221120237041090560, 9218868437227405312, 9214364837600034816, + (4,51): 9205357638345293824, 9187343239835811840, 9151314442816847872, + (4,54): 9079256848778919936, 8935141660703064064, 8646911284551352320, + (4,57): 8070450532247928832, 6917529027641081856, 4611686018427387904, 0, + (4,61): 0, 0, 0, + (5,0): 9223372036854775792, 9223372036854775776, 9223372036854775744, + (5,3): 9223372036854775680, 9223372036854775552, 9223372036854775296, + (5,6): 9223372036854774784, 9223372036854773760, 9223372036854771712, + (5,9): 9223372036854767616, 9223372036854759424, 9223372036854743040, + (5,12): 9223372036854710272, 9223372036854644736, 9223372036854513664, + (5,15): 9223372036854251520, 9223372036853727232, 9223372036852678656, + (5,18): 9223372036850581504, 9223372036846387200, 9223372036837998592, + (5,21): 9223372036821221376, 9223372036787666944, 9223372036720558080, + (5,24): 9223372036586340352, 9223372036317904896, 9223372035781033984, + (5,27): 9223372034707292160, 9223372032559808512, 9223372028264841216, + (5,30): 9223372019674906624, 9223372002495037440, 9223371968135299072, + (5,33): 9223371899415822336, 9223371761976868864, 9223371487098961920, + (5,36): 9223370937343148032, 9223369837831520256, 9223367638808264704, + (5,39): 9223363240761753600, 9223354444668731392, 9223336852482686976, + (5,42): 9223301668110598144, 9223231299366420480, 9223090561878065152, + (5,45): 9222809086901354496, 9222246136947933184, 9221120237041090560, + (5,48): 9218868437227405312, 9214364837600034816, 9205357638345293824, + (5,51): 9187343239835811840, 9151314442816847872, 9079256848778919936, + (5,54): 8935141660703064064, 8646911284551352320, 8070450532247928832, + (5,57): 6917529027641081856, 4611686018427387904, 0, 0, 0, 0, 0, + (6,0): 9223372036854775776, 9223372036854775744, 9223372036854775680, + (6,3): 9223372036854775552, 9223372036854775296, 9223372036854774784, + (6,6): 9223372036854773760, 9223372036854771712, 9223372036854767616, + (6,9): 9223372036854759424, 9223372036854743040, 9223372036854710272, + (6,12): 9223372036854644736, 9223372036854513664, 9223372036854251520, + (6,15): 9223372036853727232, 9223372036852678656, 9223372036850581504, + (6,18): 9223372036846387200, 9223372036837998592, 9223372036821221376, + (6,21): 9223372036787666944, 9223372036720558080, 9223372036586340352, + (6,24): 9223372036317904896, 9223372035781033984, 9223372034707292160, + (6,27): 9223372032559808512, 9223372028264841216, 9223372019674906624, + (6,30): 9223372002495037440, 9223371968135299072, 9223371899415822336, + (6,33): 9223371761976868864, 9223371487098961920, 9223370937343148032, + (6,36): 9223369837831520256, 9223367638808264704, 9223363240761753600, + (6,39): 9223354444668731392, 9223336852482686976, 9223301668110598144, + (6,42): 9223231299366420480, 9223090561878065152, 9222809086901354496, + (6,45): 9222246136947933184, 9221120237041090560, 9218868437227405312, + (6,48): 9214364837600034816, 9205357638345293824, 9187343239835811840, + (6,51): 9151314442816847872, 9079256848778919936, 8935141660703064064, + (6,54): 8646911284551352320, 8070450532247928832, 6917529027641081856, + (6,57): 4611686018427387904, 0, 0, 0, 0, 0, 0, + (7,0): 9223372036854775744, 9223372036854775680, 9223372036854775552, + (7,3): 9223372036854775296, 9223372036854774784, 9223372036854773760, + (7,6): 9223372036854771712, 9223372036854767616, 9223372036854759424, + (7,9): 9223372036854743040, 9223372036854710272, 9223372036854644736, + (7,12): 9223372036854513664, 9223372036854251520, 9223372036853727232, + (7,15): 9223372036852678656, 9223372036850581504, 9223372036846387200, + (7,18): 9223372036837998592, 9223372036821221376, 9223372036787666944, + (7,21): 9223372036720558080, 9223372036586340352, 9223372036317904896, + (7,24): 9223372035781033984, 9223372034707292160, 9223372032559808512, + (7,27): 9223372028264841216, 9223372019674906624, 9223372002495037440, + (7,30): 9223371968135299072, 9223371899415822336, 9223371761976868864, + (7,33): 9223371487098961920, 9223370937343148032, 9223369837831520256, + (7,36): 9223367638808264704, 9223363240761753600, 9223354444668731392, + (7,39): 9223336852482686976, 9223301668110598144, 9223231299366420480, + (7,42): 9223090561878065152, 9222809086901354496, 9222246136947933184, + (7,45): 9221120237041090560, 9218868437227405312, 9214364837600034816, + (7,48): 9205357638345293824, 9187343239835811840, 9151314442816847872, + (7,51): 9079256848778919936, 8935141660703064064, 8646911284551352320, + (7,54): 8070450532247928832, 6917529027641081856, 4611686018427387904, 0, + (7,58): 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/tpbitsUnsignedLongLongWhole63.ddl b/tools/testfiles/tpbitsUnsignedLongLongWhole63.ddl new file mode 100644 index 0000000..6a9b503 --- /dev/null +++ b/tools/testfiles/tpbitsUnsignedLongLongWhole63.ddl @@ -0,0 +1,172 @@ +HDF5 "packedbits.h5" { +DATASET "/DU64BITS" { + DATATYPE H5T_STD_U64LE + DATASPACE SIMPLE { ( 8, 64 ) / ( 8, 64 ) } + PACKED_BITS OFFSET=0 LENGTH=63 + DATA { + (0,0): 9223372036854775807, 9223372036854775806, 9223372036854775804, + (0,3): 9223372036854775800, 9223372036854775792, 9223372036854775776, + (0,6): 9223372036854775744, 9223372036854775680, 9223372036854775552, + (0,9): 9223372036854775296, 9223372036854774784, 9223372036854773760, + (0,12): 9223372036854771712, 9223372036854767616, 9223372036854759424, + (0,15): 9223372036854743040, 9223372036854710272, 9223372036854644736, + (0,18): 9223372036854513664, 9223372036854251520, 9223372036853727232, + (0,21): 9223372036852678656, 9223372036850581504, 9223372036846387200, + (0,24): 9223372036837998592, 9223372036821221376, 9223372036787666944, + (0,27): 9223372036720558080, 9223372036586340352, 9223372036317904896, + (0,30): 9223372035781033984, 9223372034707292160, 9223372032559808512, + (0,33): 9223372028264841216, 9223372019674906624, 9223372002495037440, + (0,36): 9223371968135299072, 9223371899415822336, 9223371761976868864, + (0,39): 9223371487098961920, 9223370937343148032, 9223369837831520256, + (0,42): 9223367638808264704, 9223363240761753600, 9223354444668731392, + (0,45): 9223336852482686976, 9223301668110598144, 9223231299366420480, + (0,48): 9223090561878065152, 9222809086901354496, 9222246136947933184, + (0,51): 9221120237041090560, 9218868437227405312, 9214364837600034816, + (0,54): 9205357638345293824, 9187343239835811840, 9151314442816847872, + (0,57): 9079256848778919936, 8935141660703064064, 8646911284551352320, + (0,60): 8070450532247928832, 6917529027641081856, 4611686018427387904, 0, + (1,0): 9223372036854775806, 9223372036854775804, 9223372036854775800, + (1,3): 9223372036854775792, 9223372036854775776, 9223372036854775744, + (1,6): 9223372036854775680, 9223372036854775552, 9223372036854775296, + (1,9): 9223372036854774784, 9223372036854773760, 9223372036854771712, + (1,12): 9223372036854767616, 9223372036854759424, 9223372036854743040, + (1,15): 9223372036854710272, 9223372036854644736, 9223372036854513664, + (1,18): 9223372036854251520, 9223372036853727232, 9223372036852678656, + (1,21): 9223372036850581504, 9223372036846387200, 9223372036837998592, + (1,24): 9223372036821221376, 9223372036787666944, 9223372036720558080, + (1,27): 9223372036586340352, 9223372036317904896, 9223372035781033984, + (1,30): 9223372034707292160, 9223372032559808512, 9223372028264841216, + (1,33): 9223372019674906624, 9223372002495037440, 9223371968135299072, + (1,36): 9223371899415822336, 9223371761976868864, 9223371487098961920, + (1,39): 9223370937343148032, 9223369837831520256, 9223367638808264704, + (1,42): 9223363240761753600, 9223354444668731392, 9223336852482686976, + (1,45): 9223301668110598144, 9223231299366420480, 9223090561878065152, + (1,48): 9222809086901354496, 9222246136947933184, 9221120237041090560, + (1,51): 9218868437227405312, 9214364837600034816, 9205357638345293824, + (1,54): 9187343239835811840, 9151314442816847872, 9079256848778919936, + (1,57): 8935141660703064064, 8646911284551352320, 8070450532247928832, + (1,60): 6917529027641081856, 4611686018427387904, 0, 0, + (2,0): 9223372036854775804, 9223372036854775800, 9223372036854775792, + (2,3): 9223372036854775776, 9223372036854775744, 9223372036854775680, + (2,6): 9223372036854775552, 9223372036854775296, 9223372036854774784, + (2,9): 9223372036854773760, 9223372036854771712, 9223372036854767616, + (2,12): 9223372036854759424, 9223372036854743040, 9223372036854710272, + (2,15): 9223372036854644736, 9223372036854513664, 9223372036854251520, + (2,18): 9223372036853727232, 9223372036852678656, 9223372036850581504, + (2,21): 9223372036846387200, 9223372036837998592, 9223372036821221376, + (2,24): 9223372036787666944, 9223372036720558080, 9223372036586340352, + (2,27): 9223372036317904896, 9223372035781033984, 9223372034707292160, + (2,30): 9223372032559808512, 9223372028264841216, 9223372019674906624, + (2,33): 9223372002495037440, 9223371968135299072, 9223371899415822336, + (2,36): 9223371761976868864, 9223371487098961920, 9223370937343148032, + (2,39): 9223369837831520256, 9223367638808264704, 9223363240761753600, + (2,42): 9223354444668731392, 9223336852482686976, 9223301668110598144, + (2,45): 9223231299366420480, 9223090561878065152, 9222809086901354496, + (2,48): 9222246136947933184, 9221120237041090560, 9218868437227405312, + (2,51): 9214364837600034816, 9205357638345293824, 9187343239835811840, + (2,54): 9151314442816847872, 9079256848778919936, 8935141660703064064, + (2,57): 8646911284551352320, 8070450532247928832, 6917529027641081856, + (2,60): 4611686018427387904, 0, 0, 0, + (3,0): 9223372036854775800, 9223372036854775792, 9223372036854775776, + (3,3): 9223372036854775744, 9223372036854775680, 9223372036854775552, + (3,6): 9223372036854775296, 9223372036854774784, 9223372036854773760, + (3,9): 9223372036854771712, 9223372036854767616, 9223372036854759424, + (3,12): 9223372036854743040, 9223372036854710272, 9223372036854644736, + (3,15): 9223372036854513664, 9223372036854251520, 9223372036853727232, + (3,18): 9223372036852678656, 9223372036850581504, 9223372036846387200, + (3,21): 9223372036837998592, 9223372036821221376, 9223372036787666944, + (3,24): 9223372036720558080, 9223372036586340352, 9223372036317904896, + (3,27): 9223372035781033984, 9223372034707292160, 9223372032559808512, + (3,30): 9223372028264841216, 9223372019674906624, 9223372002495037440, + (3,33): 9223371968135299072, 9223371899415822336, 9223371761976868864, + (3,36): 9223371487098961920, 9223370937343148032, 9223369837831520256, + (3,39): 9223367638808264704, 9223363240761753600, 9223354444668731392, + (3,42): 9223336852482686976, 9223301668110598144, 9223231299366420480, + (3,45): 9223090561878065152, 9222809086901354496, 9222246136947933184, + (3,48): 9221120237041090560, 9218868437227405312, 9214364837600034816, + (3,51): 9205357638345293824, 9187343239835811840, 9151314442816847872, + (3,54): 9079256848778919936, 8935141660703064064, 8646911284551352320, + (3,57): 8070450532247928832, 6917529027641081856, 4611686018427387904, 0, + (3,61): 0, 0, 0, + (4,0): 9223372036854775792, 9223372036854775776, 9223372036854775744, + (4,3): 9223372036854775680, 9223372036854775552, 9223372036854775296, + (4,6): 9223372036854774784, 9223372036854773760, 9223372036854771712, + (4,9): 9223372036854767616, 9223372036854759424, 9223372036854743040, + (4,12): 9223372036854710272, 9223372036854644736, 9223372036854513664, + (4,15): 9223372036854251520, 9223372036853727232, 9223372036852678656, + (4,18): 9223372036850581504, 9223372036846387200, 9223372036837998592, + (4,21): 9223372036821221376, 9223372036787666944, 9223372036720558080, + (4,24): 9223372036586340352, 9223372036317904896, 9223372035781033984, + (4,27): 9223372034707292160, 9223372032559808512, 9223372028264841216, + (4,30): 9223372019674906624, 9223372002495037440, 9223371968135299072, + (4,33): 9223371899415822336, 9223371761976868864, 9223371487098961920, + (4,36): 9223370937343148032, 9223369837831520256, 9223367638808264704, + (4,39): 9223363240761753600, 9223354444668731392, 9223336852482686976, + (4,42): 9223301668110598144, 9223231299366420480, 9223090561878065152, + (4,45): 9222809086901354496, 9222246136947933184, 9221120237041090560, + (4,48): 9218868437227405312, 9214364837600034816, 9205357638345293824, + (4,51): 9187343239835811840, 9151314442816847872, 9079256848778919936, + (4,54): 8935141660703064064, 8646911284551352320, 8070450532247928832, + (4,57): 6917529027641081856, 4611686018427387904, 0, 0, 0, 0, 0, + (5,0): 9223372036854775776, 9223372036854775744, 9223372036854775680, + (5,3): 9223372036854775552, 9223372036854775296, 9223372036854774784, + (5,6): 9223372036854773760, 9223372036854771712, 9223372036854767616, + (5,9): 9223372036854759424, 9223372036854743040, 9223372036854710272, + (5,12): 9223372036854644736, 9223372036854513664, 9223372036854251520, + (5,15): 9223372036853727232, 9223372036852678656, 9223372036850581504, + (5,18): 9223372036846387200, 9223372036837998592, 9223372036821221376, + (5,21): 9223372036787666944, 9223372036720558080, 9223372036586340352, + (5,24): 9223372036317904896, 9223372035781033984, 9223372034707292160, + (5,27): 9223372032559808512, 9223372028264841216, 9223372019674906624, + (5,30): 9223372002495037440, 9223371968135299072, 9223371899415822336, + (5,33): 9223371761976868864, 9223371487098961920, 9223370937343148032, + (5,36): 9223369837831520256, 9223367638808264704, 9223363240761753600, + (5,39): 9223354444668731392, 9223336852482686976, 9223301668110598144, + (5,42): 9223231299366420480, 9223090561878065152, 9222809086901354496, + (5,45): 9222246136947933184, 9221120237041090560, 9218868437227405312, + (5,48): 9214364837600034816, 9205357638345293824, 9187343239835811840, + (5,51): 9151314442816847872, 9079256848778919936, 8935141660703064064, + (5,54): 8646911284551352320, 8070450532247928832, 6917529027641081856, + (5,57): 4611686018427387904, 0, 0, 0, 0, 0, 0, + (6,0): 9223372036854775744, 9223372036854775680, 9223372036854775552, + (6,3): 9223372036854775296, 9223372036854774784, 9223372036854773760, + (6,6): 9223372036854771712, 9223372036854767616, 9223372036854759424, + (6,9): 9223372036854743040, 9223372036854710272, 9223372036854644736, + (6,12): 9223372036854513664, 9223372036854251520, 9223372036853727232, + (6,15): 9223372036852678656, 9223372036850581504, 9223372036846387200, + (6,18): 9223372036837998592, 9223372036821221376, 9223372036787666944, + (6,21): 9223372036720558080, 9223372036586340352, 9223372036317904896, + (6,24): 9223372035781033984, 9223372034707292160, 9223372032559808512, + (6,27): 9223372028264841216, 9223372019674906624, 9223372002495037440, + (6,30): 9223371968135299072, 9223371899415822336, 9223371761976868864, + (6,33): 9223371487098961920, 9223370937343148032, 9223369837831520256, + (6,36): 9223367638808264704, 9223363240761753600, 9223354444668731392, + (6,39): 9223336852482686976, 9223301668110598144, 9223231299366420480, + (6,42): 9223090561878065152, 9222809086901354496, 9222246136947933184, + (6,45): 9221120237041090560, 9218868437227405312, 9214364837600034816, + (6,48): 9205357638345293824, 9187343239835811840, 9151314442816847872, + (6,51): 9079256848778919936, 8935141660703064064, 8646911284551352320, + (6,54): 8070450532247928832, 6917529027641081856, 4611686018427387904, 0, + (6,58): 0, 0, 0, 0, 0, 0, + (7,0): 9223372036854775680, 9223372036854775552, 9223372036854775296, + (7,3): 9223372036854774784, 9223372036854773760, 9223372036854771712, + (7,6): 9223372036854767616, 9223372036854759424, 9223372036854743040, + (7,9): 9223372036854710272, 9223372036854644736, 9223372036854513664, + (7,12): 9223372036854251520, 9223372036853727232, 9223372036852678656, + (7,15): 9223372036850581504, 9223372036846387200, 9223372036837998592, + (7,18): 9223372036821221376, 9223372036787666944, 9223372036720558080, + (7,21): 9223372036586340352, 9223372036317904896, 9223372035781033984, + (7,24): 9223372034707292160, 9223372032559808512, 9223372028264841216, + (7,27): 9223372019674906624, 9223372002495037440, 9223371968135299072, + (7,30): 9223371899415822336, 9223371761976868864, 9223371487098961920, + (7,33): 9223370937343148032, 9223369837831520256, 9223367638808264704, + (7,36): 9223363240761753600, 9223354444668731392, 9223336852482686976, + (7,39): 9223301668110598144, 9223231299366420480, 9223090561878065152, + (7,42): 9222809086901354496, 9222246136947933184, 9221120237041090560, + (7,45): 9218868437227405312, 9214364837600034816, 9205357638345293824, + (7,48): 9187343239835811840, 9151314442816847872, 9079256848778919936, + (7,51): 8935141660703064064, 8646911284551352320, 8070450532247928832, + (7,54): 6917529027641081856, 4611686018427387904, 0, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/tpbitsUnsignedLongWhole.ddl b/tools/testfiles/tpbitsUnsignedLongWhole.ddl new file mode 100644 index 0000000..50ad02f --- /dev/null +++ b/tools/testfiles/tpbitsUnsignedLongWhole.ddl @@ -0,0 +1,59 @@ +HDF5 "packedbits.h5" { +DATASET "/DU32BITS" { + DATATYPE H5T_STD_U32LE + DATASPACE SIMPLE { ( 8, 32 ) / ( 8, 32 ) } + PACKED_BITS OFFSET=0 LENGTH=32 + DATA { + (0,0): 4294967295, 4294967294, 4294967292, 4294967288, 4294967280, + (0,5): 4294967264, 4294967232, 4294967168, 4294967040, 4294966784, + (0,10): 4294966272, 4294965248, 4294963200, 4294959104, 4294950912, + (0,15): 4294934528, 4294901760, 4294836224, 4294705152, 4294443008, + (0,20): 4293918720, 4292870144, 4290772992, 4286578688, 4278190080, + (0,25): 4261412864, 4227858432, 4160749568, 4026531840, 3758096384, + (0,30): 3221225472, 2147483648, + (1,0): 4294967294, 4294967292, 4294967288, 4294967280, 4294967264, + (1,5): 4294967232, 4294967168, 4294967040, 4294966784, 4294966272, + (1,10): 4294965248, 4294963200, 4294959104, 4294950912, 4294934528, + (1,15): 4294901760, 4294836224, 4294705152, 4294443008, 4293918720, + (1,20): 4292870144, 4290772992, 4286578688, 4278190080, 4261412864, + (1,25): 4227858432, 4160749568, 4026531840, 3758096384, 3221225472, + (1,30): 2147483648, 0, + (2,0): 4294967292, 4294967288, 4294967280, 4294967264, 4294967232, + (2,5): 4294967168, 4294967040, 4294966784, 4294966272, 4294965248, + (2,10): 4294963200, 4294959104, 4294950912, 4294934528, 4294901760, + (2,15): 4294836224, 4294705152, 4294443008, 4293918720, 4292870144, + (2,20): 4290772992, 4286578688, 4278190080, 4261412864, 4227858432, + (2,25): 4160749568, 4026531840, 3758096384, 3221225472, 2147483648, 0, 0, + (3,0): 4294967288, 4294967280, 4294967264, 4294967232, 4294967168, + (3,5): 4294967040, 4294966784, 4294966272, 4294965248, 4294963200, + (3,10): 4294959104, 4294950912, 4294934528, 4294901760, 4294836224, + (3,15): 4294705152, 4294443008, 4293918720, 4292870144, 4290772992, + (3,20): 4286578688, 4278190080, 4261412864, 4227858432, 4160749568, + (3,25): 4026531840, 3758096384, 3221225472, 2147483648, 0, 0, 0, + (4,0): 4294967280, 4294967264, 4294967232, 4294967168, 4294967040, + (4,5): 4294966784, 4294966272, 4294965248, 4294963200, 4294959104, + (4,10): 4294950912, 4294934528, 4294901760, 4294836224, 4294705152, + (4,15): 4294443008, 4293918720, 4292870144, 4290772992, 4286578688, + (4,20): 4278190080, 4261412864, 4227858432, 4160749568, 4026531840, + (4,25): 3758096384, 3221225472, 2147483648, 0, 0, 0, 0, + (5,0): 4294967264, 4294967232, 4294967168, 4294967040, 4294966784, + (5,5): 4294966272, 4294965248, 4294963200, 4294959104, 4294950912, + (5,10): 4294934528, 4294901760, 4294836224, 4294705152, 4294443008, + (5,15): 4293918720, 4292870144, 4290772992, 4286578688, 4278190080, + (5,20): 4261412864, 4227858432, 4160749568, 4026531840, 3758096384, + (5,25): 3221225472, 2147483648, 0, 0, 0, 0, 0, + (6,0): 4294967232, 4294967168, 4294967040, 4294966784, 4294966272, + (6,5): 4294965248, 4294963200, 4294959104, 4294950912, 4294934528, + (6,10): 4294901760, 4294836224, 4294705152, 4294443008, 4293918720, + (6,15): 4292870144, 4290772992, 4286578688, 4278190080, 4261412864, + (6,20): 4227858432, 4160749568, 4026531840, 3758096384, 3221225472, + (6,25): 2147483648, 0, 0, 0, 0, 0, 0, + (7,0): 4294967168, 4294967040, 4294966784, 4294966272, 4294965248, + (7,5): 4294963200, 4294959104, 4294950912, 4294934528, 4294901760, + (7,10): 4294836224, 4294705152, 4294443008, 4293918720, 4292870144, + (7,15): 4290772992, 4286578688, 4278190080, 4261412864, 4227858432, + (7,20): 4160749568, 4026531840, 3758096384, 3221225472, 2147483648, 0, 0, + (7,27): 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/tpbitsUnsignedWhole.ddl b/tools/testfiles/tpbitsUnsignedWhole.ddl new file mode 100644 index 0000000..7c9e736 --- /dev/null +++ b/tools/testfiles/tpbitsUnsignedWhole.ddl @@ -0,0 +1,17 @@ +HDF5 "packedbits.h5" { +DATASET "/DU08BITS" { + DATATYPE H5T_STD_U8LE + DATASPACE SIMPLE { ( 8, 8 ) / ( 8, 8 ) } + PACKED_BITS OFFSET=0 LENGTH=8 + DATA { + (0,0): 255, 254, 252, 248, 240, 224, 192, 128, + (1,0): 254, 252, 248, 240, 224, 192, 128, 0, + (2,0): 252, 248, 240, 224, 192, 128, 0, 0, + (3,0): 248, 240, 224, 192, 128, 0, 0, 0, + (4,0): 240, 224, 192, 128, 0, 0, 0, 0, + (5,0): 224, 192, 128, 0, 0, 0, 0, 0, + (6,0): 192, 128, 0, 0, 0, 0, 0, 0, + (7,0): 128, 0, 0, 0, 0, 0, 0, 0 + } +} +} diff --git a/tools/testfiles/tperror.ddl b/tools/testfiles/tperror.ddl index c7ee79d..16a7d8e 100644 --- a/tools/testfiles/tperror.ddl +++ b/tools/testfiles/tperror.ddl @@ -1,8 +1,35 @@ -############################# -Expected output for 'h5dump -p -d bogus tfcontents1.h5' -############################# HDF5 "tfcontents1.h5" { -DATASET "bogus" { - } } -h5dump error: unable to open dataset "bogus" +HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): + #000: (file name) line (number) in H5Dopen2(): not found + major: Dataset + minor: Object not found + #001: (file name) line (number) in H5G_loc_find(): can't find object + major: Symbol table + minor: Object not found + #002: (file name) line (number) in H5G_traverse(): internal path traversal failed + major: Symbol table + minor: Object not found + #003: (file name) line (number) in H5G_traverse_real(): traversal operator failed + major: Symbol table + minor: Callback failed + #004: (file name) line (number) in H5G_loc_find_cb(): object 'bogus' doesn't exist + major: Symbol table + minor: Object not found +HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): + #000: (file name) line (number) in H5Lget_info(): unable to get link info + major: Symbol table + minor: Object not found + #001: (file name) line (number) in H5L_get_info(): name doesn't exist + major: Symbol table + minor: Object already exists + #002: (file name) line (number) in H5G_traverse(): internal path traversal failed + major: Symbol table + minor: Object not found + #003: (file name) line (number) in H5G_traverse_real(): traversal operator failed + major: Symbol table + minor: Callback failed + #004: (file name) line (number) in H5L_get_info_cb(): name doesn't exist + major: Symbol table + minor: Object not found +h5dump error: unable to get link info from "bogus" diff --git a/tools/testfiles/tqmarkfile.ddl b/tools/testfiles/tqmarkfile.ddl new file mode 100644 index 0000000..e7771cb --- /dev/null +++ b/tools/testfiles/tqmarkfile.ddl @@ -0,0 +1,83 @@ +HDF5 "tarray1.h5" { +DATASET "Dataset1" { + DATATYPE H5T_ARRAY { [4] H5T_STD_I32LE } + DATASPACE SIMPLE { ( 4 ) / ( 4 ) } +} +} +HDF5 "tarray2.h5" { +DATASET "Dataset1" { + DATATYPE H5T_ARRAY { [3][4][5] H5T_STD_I32LE } + DATASPACE SIMPLE { ( 4 ) / ( 4 ) } +} +} +HDF5 "tarray3.h5" { +DATASET "Dataset1" { + DATATYPE H5T_ARRAY { [4] H5T_ARRAY { [6][3] H5T_STD_I32LE } } + DATASPACE SIMPLE { ( 4 ) / ( 4 ) } +} +} +HDF5 "tarray4.h5" { +DATASET "Dataset1" { + DATATYPE H5T_ARRAY { [4] H5T_COMPOUND { + H5T_STD_I32LE "i"; + H5T_IEEE_F32LE "f"; + } } + DATASPACE SIMPLE { ( 4 ) / ( 4 ) } +} +} +HDF5 "tarray5.h5" { +DATASET "Dataset1" { + DATATYPE H5T_ARRAY { [4] H5T_COMPOUND { + H5T_STD_I32LE "i"; + H5T_ARRAY { [4] H5T_IEEE_F32LE } "f"; + } } + DATASPACE SIMPLE { ( 4 ) / ( 4 ) } +} +} +HDF5 "tarray6.h5" { +DATASET "Dataset1" { + DATATYPE H5T_ARRAY { [4] H5T_VLEN { H5T_STD_U32LE} } + DATASPACE SIMPLE { ( 4 ) / ( 4 ) } +} +} +HDF5 "tarray7.h5" { +DATASET "Dataset1" { + DATATYPE H5T_ARRAY { [4] H5T_VLEN { H5T_ARRAY { [4] H5T_STD_U32LE }} } + DATASPACE SIMPLE { ( 4 ) / ( 4 ) } +} +} +HDF5 "tarray8.h5" { +} +HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): + #000: (file name) line (number) in H5Dopen2(): not found + major: Dataset + minor: Object not found + #001: (file name) line (number) in H5G_loc_find(): can't find object + major: Symbol table + minor: Object not found + #002: (file name) line (number) in H5G_traverse(): internal path traversal failed + major: Symbol table + minor: Object not found + #003: (file name) line (number) in H5G_traverse_real(): traversal operator failed + major: Symbol table + minor: Callback failed + #004: (file name) line (number) in H5G_loc_find_cb(): object 'Dataset1' doesn't exist + major: Symbol table + minor: Object not found +HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): + #000: (file name) line (number) in H5Lget_info(): unable to get link info + major: Symbol table + minor: Object not found + #001: (file name) line (number) in H5L_get_info(): name doesn't exist + major: Symbol table + minor: Object already exists + #002: (file name) line (number) in H5G_traverse(): internal path traversal failed + major: Symbol table + minor: Object not found + #003: (file name) line (number) in H5G_traverse_real(): traversal operator failed + major: Symbol table + minor: Callback failed + #004: (file name) line (number) in H5L_get_info_cb(): name doesn't exist + major: Symbol table + minor: Object not found +h5dump error: unable to get link info from "Dataset1" diff --git a/tools/testfiles/tref-escapes-at.h5.xml b/tools/testfiles/tref-escapes-at.h5.xml index 6d683f1..8126484 100644 --- a/tools/testfiles/tref-escapes-at.h5.xml +++ b/tools/testfiles/tref-escapes-at.h5.xml @@ -1,17 +1,14 @@ -############################# -Expected output for 'h5dump --xml tref-escapes-at.h5' -############################# - + - + - + @@ -26,7 +23,10 @@ Expected output for 'h5dump --xml tref-escapes-at.h5' - 0 0 0 0 + 0 + 0 + 0 + 0 @@ -34,9 +34,9 @@ Expected output for 'h5dump --xml tref-escapes-at.h5' - + - + @@ -51,7 +51,10 @@ Expected output for 'h5dump --xml tref-escapes-at.h5' - 0 3 6 9 + 0 + 3 + 6 + 9 @@ -59,9 +62,9 @@ Expected output for 'h5dump --xml tref-escapes-at.h5' - + - + @@ -76,7 +79,10 @@ Expected output for 'h5dump --xml tref-escapes-at.h5' - 0 0 0 0 + 0 + 0 + 0 + 0 @@ -84,9 +90,9 @@ Expected output for 'h5dump --xml tref-escapes-at.h5' - + - + @@ -101,7 +107,10 @@ Expected output for 'h5dump --xml tref-escapes-at.h5' - 0 0 0 0 + 0 + 0 + 0 + 0 @@ -109,9 +118,9 @@ Expected output for 'h5dump --xml tref-escapes-at.h5' - + - + @@ -126,7 +135,10 @@ Expected output for 'h5dump --xml tref-escapes-at.h5' - 0 0 0 0 + 0 + 0 + 0 + 0 @@ -134,9 +146,9 @@ Expected output for 'h5dump --xml tref-escapes-at.h5' - + - + @@ -151,7 +163,10 @@ Expected output for 'h5dump --xml tref-escapes-at.h5' - 0 0 0 0 + 0 + 0 + 0 + 0 @@ -159,9 +174,9 @@ Expected output for 'h5dump --xml tref-escapes-at.h5' - + - + @@ -176,7 +191,10 @@ Expected output for 'h5dump --xml tref-escapes-at.h5' - 0 0 0 0 + 0 + 0 + 0 + 0 @@ -185,9 +203,9 @@ Expected output for 'h5dump --xml tref-escapes-at.h5' - + - + @@ -213,11 +231,11 @@ Expected output for 'h5dump --xml tref-escapes-at.h5' - - - "/Group1/Dataset&amp" - - + + + "/Group1/Dataset&amp" + + @@ -232,11 +250,11 @@ Expected output for 'h5dump --xml tref-escapes-at.h5' - - - "/Group1/Dataset'apos" - - + + + "/Group1/Dataset'apos" + + @@ -251,11 +269,11 @@ Expected output for 'h5dump --xml tref-escapes-at.h5' - - - "/Group1/Dataset>gt" - - + + + "/Group1/Dataset>gt" + + @@ -270,11 +288,11 @@ Expected output for 'h5dump --xml tref-escapes-at.h5' - - - "/Group1/Dataset<lt" - - + + + "/Group1/Dataset<lt" + + @@ -289,11 +307,11 @@ Expected output for 'h5dump --xml tref-escapes-at.h5' - - - "/Group1/Dataset\"quote" - - + + + "/Group1/Dataset\"quote" + + @@ -308,11 +326,11 @@ Expected output for 'h5dump --xml tref-escapes-at.h5' - - - "/Group1/Dataset\\slash" - - + + + "/Group1/Dataset\\slash" + + @@ -327,11 +345,11 @@ Expected output for 'h5dump --xml tref-escapes-at.h5' - - - "/Group1/Dataset space" - - + + + "/Group1/Dataset space" + + diff --git a/tools/testfiles/tref-escapes.h5.xml b/tools/testfiles/tref-escapes.h5.xml index 6d43069..6c6455b 100644 --- a/tools/testfiles/tref-escapes.h5.xml +++ b/tools/testfiles/tref-escapes.h5.xml @@ -1,17 +1,14 @@ -############################# -Expected output for 'h5dump --xml tref-escapes.h5' -############################# - + - + - + @@ -26,7 +23,10 @@ Expected output for 'h5dump --xml tref-escapes.h5' - 0 0 0 0 + 0 + 0 + 0 + 0 @@ -34,9 +34,9 @@ Expected output for 'h5dump --xml tref-escapes.h5' - + - + @@ -51,7 +51,10 @@ Expected output for 'h5dump --xml tref-escapes.h5' - 0 3 6 9 + 0 + 3 + 6 + 9 @@ -59,9 +62,9 @@ Expected output for 'h5dump --xml tref-escapes.h5' - + - + @@ -76,7 +79,10 @@ Expected output for 'h5dump --xml tref-escapes.h5' - 0 0 0 0 + 0 + 0 + 0 + 0 @@ -84,9 +90,9 @@ Expected output for 'h5dump --xml tref-escapes.h5' - + - + @@ -101,7 +107,10 @@ Expected output for 'h5dump --xml tref-escapes.h5' - 0 0 0 0 + 0 + 0 + 0 + 0 @@ -109,9 +118,9 @@ Expected output for 'h5dump --xml tref-escapes.h5' - + - + @@ -126,7 +135,10 @@ Expected output for 'h5dump --xml tref-escapes.h5' - 0 0 0 0 + 0 + 0 + 0 + 0 @@ -134,9 +146,9 @@ Expected output for 'h5dump --xml tref-escapes.h5' - + - + @@ -151,7 +163,10 @@ Expected output for 'h5dump --xml tref-escapes.h5' - 0 0 0 0 + 0 + 0 + 0 + 0 @@ -159,9 +174,9 @@ Expected output for 'h5dump --xml tref-escapes.h5' - + - + @@ -176,7 +191,10 @@ Expected output for 'h5dump --xml tref-escapes.h5' - 0 0 0 0 + 0 + 0 + 0 + 0 @@ -185,9 +203,9 @@ Expected output for 'h5dump --xml tref-escapes.h5' - + - + diff --git a/tools/testfiles/tref.h5.xml b/tools/testfiles/tref.h5.xml index 8a39acf..7ff360e 100644 --- a/tools/testfiles/tref.h5.xml +++ b/tools/testfiles/tref.h5.xml @@ -1,17 +1,14 @@ -############################# -Expected output for 'h5dump --xml tref.h5' -############################# - + - + - + @@ -26,7 +23,10 @@ Expected output for 'h5dump --xml tref.h5' - 0 3 6 9 + 0 + 3 + 6 + 9 @@ -34,9 +34,9 @@ Expected output for 'h5dump --xml tref.h5' - + - + @@ -51,7 +51,10 @@ Expected output for 'h5dump --xml tref.h5' - 0 0 0 0 + 0 + 0 + 0 + 0 @@ -60,9 +63,9 @@ Expected output for 'h5dump --xml tref.h5' - + - + diff --git a/tools/testfiles/treference.ddl b/tools/testfiles/treference.ddl index b94802f..4683ce5 100644 --- a/tools/testfiles/treference.ddl +++ b/tools/testfiles/treference.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump tattr2.h5' -############################# HDF5 "tattr2.h5" { GROUP "/" { ATTRIBUTE "array" { @@ -228,10 +225,10 @@ GROUP "/" { } ATTRIBUTE "enum" { DATATYPE H5T_ENUM { - H5T_STD_I32LE; - "RED" 0; - "GREEN" 1; - } + H5T_STD_I32LE; + "RED" 0; + "GREEN" 1; + } DATASPACE SIMPLE { ( 2 ) / ( 2 ) } DATA { (0): RED, RED @@ -239,10 +236,10 @@ GROUP "/" { } ATTRIBUTE "enum2D" { DATATYPE H5T_ENUM { - H5T_STD_I32LE; - "RED" 0; - "GREEN" 1; - } + H5T_STD_I32LE; + "RED" 0; + "GREEN" 1; + } DATASPACE SIMPLE { ( 3, 2 ) / ( 3, 2 ) } DATA { (0,0): RED, RED, @@ -252,10 +249,10 @@ GROUP "/" { } ATTRIBUTE "enum3D" { DATATYPE H5T_ENUM { - H5T_STD_I32LE; - "RED" 0; - "GREEN" 1; - } + H5T_STD_I32LE; + "RED" 0; + "GREEN" 1; + } DATASPACE SIMPLE { ( 4, 3, 2 ) / ( 4, 3, 2 ) } DATA { (0,0,0): RED, RED, @@ -341,20 +338,18 @@ GROUP "/" { } } ATTRIBUTE "opaque" { - DATATYPE - H5T_OPAQUE; + DATATYPE H5T_OPAQUE { OPAQUE_TAG "1-byte opaque type"; - + } DATASPACE SIMPLE { ( 2 ) / ( 2 ) } DATA { (0): 0x01, 0x02 } } ATTRIBUTE "opaque2D" { - DATATYPE - H5T_OPAQUE; + DATATYPE H5T_OPAQUE { OPAQUE_TAG "1-byte opaque type"; - + } DATASPACE SIMPLE { ( 3, 2 ) / ( 3, 2 ) } DATA { (0,0): 0x01, 0x02, @@ -363,10 +358,9 @@ GROUP "/" { } } ATTRIBUTE "opaque3D" { - DATATYPE - H5T_OPAQUE; + DATATYPE H5T_OPAQUE { OPAQUE_TAG "1-byte opaque type"; - + } DATASPACE SIMPLE { ( 4, 3, 2 ) / ( 4, 3, 2 ) } DATA { (0,0,0): 0x01, 0x02, @@ -385,11 +379,11 @@ GROUP "/" { } ATTRIBUTE "string" { DATATYPE H5T_STRING { - STRSIZE 2; - STRPAD H5T_STR_NULLTERM; - CSET H5T_CSET_ASCII; - CTYPE H5T_C_S1; - } + STRSIZE 2; + STRPAD H5T_STR_NULLTERM; + CSET H5T_CSET_ASCII; + CTYPE H5T_C_S1; + } DATASPACE SIMPLE { ( 2 ) / ( 2 ) } DATA { (0): "ab", "de" @@ -397,11 +391,11 @@ GROUP "/" { } ATTRIBUTE "string2D" { DATATYPE H5T_STRING { - STRSIZE 2; - STRPAD H5T_STR_NULLTERM; - CSET H5T_CSET_ASCII; - CTYPE H5T_C_S1; - } + STRSIZE 2; + STRPAD H5T_STR_NULLTERM; + CSET H5T_CSET_ASCII; + CTYPE H5T_C_S1; + } DATASPACE SIMPLE { ( 3, 2 ) / ( 3, 2 ) } DATA { (0,0): "ab", "cd", @@ -411,11 +405,11 @@ GROUP "/" { } ATTRIBUTE "string3D" { DATATYPE H5T_STRING { - STRSIZE 2; - STRPAD H5T_STR_NULLTERM; - CSET H5T_CSET_ASCII; - CTYPE H5T_C_S1; - } + STRSIZE 2; + STRPAD H5T_STR_NULLTERM; + CSET H5T_CSET_ASCII; + CTYPE H5T_C_S1; + } DATASPACE SIMPLE { ( 4, 3, 2 ) / ( 4, 3, 2 ) } DATA { (0,0,0): "ab", "cd", @@ -697,10 +691,10 @@ GROUP "/" { } ATTRIBUTE "enum" { DATATYPE H5T_ENUM { - H5T_STD_I32LE; - "RED" 0; - "GREEN" 1; - } + H5T_STD_I32LE; + "RED" 0; + "GREEN" 1; + } DATASPACE SIMPLE { ( 2 ) / ( 2 ) } DATA { (0): RED, RED @@ -708,10 +702,10 @@ GROUP "/" { } ATTRIBUTE "enum2D" { DATATYPE H5T_ENUM { - H5T_STD_I32LE; - "RED" 0; - "GREEN" 1; - } + H5T_STD_I32LE; + "RED" 0; + "GREEN" 1; + } DATASPACE SIMPLE { ( 3, 2 ) / ( 3, 2 ) } DATA { (0,0): RED, RED, @@ -721,10 +715,10 @@ GROUP "/" { } ATTRIBUTE "enum3D" { DATATYPE H5T_ENUM { - H5T_STD_I32LE; - "RED" 0; - "GREEN" 1; - } + H5T_STD_I32LE; + "RED" 0; + "GREEN" 1; + } DATASPACE SIMPLE { ( 4, 3, 2 ) / ( 4, 3, 2 ) } DATA { (0,0,0): RED, RED, @@ -810,20 +804,18 @@ GROUP "/" { } } ATTRIBUTE "opaque" { - DATATYPE - H5T_OPAQUE; + DATATYPE H5T_OPAQUE { OPAQUE_TAG "1-byte opaque type"; - + } DATASPACE SIMPLE { ( 2 ) / ( 2 ) } DATA { (0): 0x01, 0x02 } } ATTRIBUTE "opaque2D" { - DATATYPE - H5T_OPAQUE; + DATATYPE H5T_OPAQUE { OPAQUE_TAG "1-byte opaque type"; - + } DATASPACE SIMPLE { ( 3, 2 ) / ( 3, 2 ) } DATA { (0,0): 0x01, 0x02, @@ -832,10 +824,9 @@ GROUP "/" { } } ATTRIBUTE "opaque3D" { - DATATYPE - H5T_OPAQUE; + DATATYPE H5T_OPAQUE { OPAQUE_TAG "1-byte opaque type"; - + } DATASPACE SIMPLE { ( 4, 3, 2 ) / ( 4, 3, 2 ) } DATA { (0,0,0): 0x01, 0x02, @@ -888,11 +879,11 @@ GROUP "/" { } ATTRIBUTE "string" { DATATYPE H5T_STRING { - STRSIZE 2; - STRPAD H5T_STR_NULLTERM; - CSET H5T_CSET_ASCII; - CTYPE H5T_C_S1; - } + STRSIZE 2; + STRPAD H5T_STR_NULLTERM; + CSET H5T_CSET_ASCII; + CTYPE H5T_C_S1; + } DATASPACE SIMPLE { ( 2 ) / ( 2 ) } DATA { (0): "ab", "de" @@ -900,11 +891,11 @@ GROUP "/" { } ATTRIBUTE "string2D" { DATATYPE H5T_STRING { - STRSIZE 2; - STRPAD H5T_STR_NULLTERM; - CSET H5T_CSET_ASCII; - CTYPE H5T_C_S1; - } + STRSIZE 2; + STRPAD H5T_STR_NULLTERM; + CSET H5T_CSET_ASCII; + CTYPE H5T_C_S1; + } DATASPACE SIMPLE { ( 3, 2 ) / ( 3, 2 ) } DATA { (0,0): "ab", "cd", @@ -914,11 +905,11 @@ GROUP "/" { } ATTRIBUTE "string3D" { DATATYPE H5T_STRING { - STRSIZE 2; - STRPAD H5T_STR_NULLTERM; - CSET H5T_CSET_ASCII; - CTYPE H5T_C_S1; - } + STRSIZE 2; + STRPAD H5T_STR_NULLTERM; + CSET H5T_CSET_ASCII; + CTYPE H5T_C_S1; + } DATASPACE SIMPLE { ( 4, 3, 2 ) / ( 4, 3, 2 ) } DATA { (0,0,0): "ab", "cd", @@ -1196,10 +1187,10 @@ GROUP "/" { } ATTRIBUTE "enum" { DATATYPE H5T_ENUM { - H5T_STD_I32LE; - "RED" 0; - "GREEN" 1; - } + H5T_STD_I32LE; + "RED" 0; + "GREEN" 1; + } DATASPACE SIMPLE { ( 2 ) / ( 2 ) } DATA { (0): RED, RED @@ -1207,10 +1198,10 @@ GROUP "/" { } ATTRIBUTE "enum2D" { DATATYPE H5T_ENUM { - H5T_STD_I32LE; - "RED" 0; - "GREEN" 1; - } + H5T_STD_I32LE; + "RED" 0; + "GREEN" 1; + } DATASPACE SIMPLE { ( 3, 2 ) / ( 3, 2 ) } DATA { (0,0): RED, RED, @@ -1220,10 +1211,10 @@ GROUP "/" { } ATTRIBUTE "enum3D" { DATATYPE H5T_ENUM { - H5T_STD_I32LE; - "RED" 0; - "GREEN" 1; - } + H5T_STD_I32LE; + "RED" 0; + "GREEN" 1; + } DATASPACE SIMPLE { ( 4, 3, 2 ) / ( 4, 3, 2 ) } DATA { (0,0,0): RED, RED, @@ -1309,20 +1300,18 @@ GROUP "/" { } } ATTRIBUTE "opaque" { - DATATYPE - H5T_OPAQUE; + DATATYPE H5T_OPAQUE { OPAQUE_TAG "1-byte opaque type"; - + } DATASPACE SIMPLE { ( 2 ) / ( 2 ) } DATA { (0): 0x01, 0x02 } } ATTRIBUTE "opaque2D" { - DATATYPE - H5T_OPAQUE; + DATATYPE H5T_OPAQUE { OPAQUE_TAG "1-byte opaque type"; - + } DATASPACE SIMPLE { ( 3, 2 ) / ( 3, 2 ) } DATA { (0,0): 0x01, 0x02, @@ -1331,10 +1320,9 @@ GROUP "/" { } } ATTRIBUTE "opaque3D" { - DATATYPE - H5T_OPAQUE; + DATATYPE H5T_OPAQUE { OPAQUE_TAG "1-byte opaque type"; - + } DATASPACE SIMPLE { ( 4, 3, 2 ) / ( 4, 3, 2 ) } DATA { (0,0,0): 0x01, 0x02, @@ -1353,11 +1341,11 @@ GROUP "/" { } ATTRIBUTE "string" { DATATYPE H5T_STRING { - STRSIZE 2; - STRPAD H5T_STR_NULLTERM; - CSET H5T_CSET_ASCII; - CTYPE H5T_C_S1; - } + STRSIZE 2; + STRPAD H5T_STR_NULLTERM; + CSET H5T_CSET_ASCII; + CTYPE H5T_C_S1; + } DATASPACE SIMPLE { ( 2 ) / ( 2 ) } DATA { (0): "ab", "de" @@ -1365,11 +1353,11 @@ GROUP "/" { } ATTRIBUTE "string2D" { DATATYPE H5T_STRING { - STRSIZE 2; - STRPAD H5T_STR_NULLTERM; - CSET H5T_CSET_ASCII; - CTYPE H5T_C_S1; - } + STRSIZE 2; + STRPAD H5T_STR_NULLTERM; + CSET H5T_CSET_ASCII; + CTYPE H5T_C_S1; + } DATASPACE SIMPLE { ( 3, 2 ) / ( 3, 2 ) } DATA { (0,0): "ab", "cd", @@ -1379,11 +1367,11 @@ GROUP "/" { } ATTRIBUTE "string3D" { DATATYPE H5T_STRING { - STRSIZE 2; - STRPAD H5T_STR_NULLTERM; - CSET H5T_CSET_ASCII; - CTYPE H5T_C_S1; - } + STRSIZE 2; + STRPAD H5T_STR_NULLTERM; + CSET H5T_CSET_ASCII; + CTYPE H5T_C_S1; + } DATASPACE SIMPLE { ( 4, 3, 2 ) / ( 4, 3, 2 ) } DATA { (0,0,0): "ab", "cd", @@ -1661,10 +1649,10 @@ GROUP "/" { } DATASET "enum" { DATATYPE H5T_ENUM { - H5T_STD_I32LE; - "RED" 0; - "GREEN" 1; - } + H5T_STD_I32LE; + "RED" 0; + "GREEN" 1; + } DATASPACE SIMPLE { ( 2 ) / ( 2 ) } DATA { (0): RED, RED @@ -1672,10 +1660,10 @@ GROUP "/" { } DATASET "enum2D" { DATATYPE H5T_ENUM { - H5T_STD_I32LE; - "RED" 0; - "GREEN" 1; - } + H5T_STD_I32LE; + "RED" 0; + "GREEN" 1; + } DATASPACE SIMPLE { ( 3, 2 ) / ( 3, 2 ) } DATA { (0,0): RED, RED, @@ -1685,10 +1673,10 @@ GROUP "/" { } DATASET "enum3D" { DATATYPE H5T_ENUM { - H5T_STD_I32LE; - "RED" 0; - "GREEN" 1; - } + H5T_STD_I32LE; + "RED" 0; + "GREEN" 1; + } DATASPACE SIMPLE { ( 4, 3, 2 ) / ( 4, 3, 2 ) } DATA { (0,0,0): RED, RED, @@ -1774,20 +1762,18 @@ GROUP "/" { } } DATASET "opaque" { - DATATYPE - H5T_OPAQUE; + DATATYPE H5T_OPAQUE { OPAQUE_TAG "1-byte opaque type"; - + } DATASPACE SIMPLE { ( 2 ) / ( 2 ) } DATA { (0): 0x01, 0x02 } } DATASET "opaque2D" { - DATATYPE - H5T_OPAQUE; + DATATYPE H5T_OPAQUE { OPAQUE_TAG "1-byte opaque type"; - + } DATASPACE SIMPLE { ( 3, 2 ) / ( 3, 2 ) } DATA { (0,0): 0x01, 0x02, @@ -1796,10 +1782,9 @@ GROUP "/" { } } DATASET "opaque3D" { - DATATYPE - H5T_OPAQUE; + DATATYPE H5T_OPAQUE { OPAQUE_TAG "1-byte opaque type"; - + } DATASPACE SIMPLE { ( 4, 3, 2 ) / ( 4, 3, 2 ) } DATA { (0,0,0): 0x01, 0x02, @@ -1852,11 +1837,11 @@ GROUP "/" { } DATASET "string" { DATATYPE H5T_STRING { - STRSIZE 2; - STRPAD H5T_STR_NULLTERM; - CSET H5T_CSET_ASCII; - CTYPE H5T_C_S1; - } + STRSIZE 2; + STRPAD H5T_STR_NULLTERM; + CSET H5T_CSET_ASCII; + CTYPE H5T_C_S1; + } DATASPACE SIMPLE { ( 2 ) / ( 2 ) } DATA { (0): "ab", "de" @@ -1864,11 +1849,11 @@ GROUP "/" { } DATASET "string2D" { DATATYPE H5T_STRING { - STRSIZE 2; - STRPAD H5T_STR_NULLTERM; - CSET H5T_CSET_ASCII; - CTYPE H5T_C_S1; - } + STRSIZE 2; + STRPAD H5T_STR_NULLTERM; + CSET H5T_CSET_ASCII; + CTYPE H5T_C_S1; + } DATASPACE SIMPLE { ( 3, 2 ) / ( 3, 2 ) } DATA { (0,0): "ab", "cd", @@ -1878,11 +1863,11 @@ GROUP "/" { } DATASET "string3D" { DATATYPE H5T_STRING { - STRSIZE 2; - STRPAD H5T_STR_NULLTERM; - CSET H5T_CSET_ASCII; - CTYPE H5T_C_S1; - } + STRSIZE 2; + STRPAD H5T_STR_NULLTERM; + CSET H5T_CSET_ASCII; + CTYPE H5T_C_S1; + } DATASPACE SIMPLE { ( 4, 3, 2 ) / ( 4, 3, 2 ) } DATA { (0,0,0): "ab", "cd", diff --git a/tools/testfiles/tsaf.ddl b/tools/testfiles/tsaf.ddl index 3825bda..fe9f864 100644 --- a/tools/testfiles/tsaf.ddl +++ b/tools/testfiles/tsaf.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump tsaf.h5' -############################# HDF5 "tsaf.h5" { GROUP "/" { DATASET ".DSL_METADATA" { diff --git a/tools/testfiles/tsaf.h5.xml b/tools/testfiles/tsaf.h5.xml index 11808e3..8da41b9 100644 --- a/tools/testfiles/tsaf.h5.xml +++ b/tools/testfiles/tsaf.h5.xml @@ -1,8 +1,5 @@ -############################# -Expected output for 'h5dump --xml tsaf.h5' -############################# - + @@ -14,7 +11,7 @@ Expected output for 'h5dump --xml tsaf.h5' - + @@ -29,281 +26,5925 @@ Expected output for 'h5dump --xml tsaf.h5' - 47 32 67 79 78 84 65 73 78 69 82 10 47 46 97 116 116 114 105 98 117 116 - 101 115 32 67 79 78 84 65 73 78 69 82 10 47 46 97 116 116 114 105 98 - 117 116 101 115 47 100 97 116 97 98 97 115 101 32 67 79 78 84 65 73 78 - 69 82 10 47 46 97 116 116 114 105 98 117 116 101 115 47 100 97 116 97 - 98 97 115 101 47 46 83 65 70 95 68 98 80 114 111 112 115 32 68 65 84 65 - 83 69 84 32 115 116 114 117 99 116 32 83 65 70 95 68 98 80 114 111 112 - 115 123 105 110 116 32 109 97 103 105 99 59 99 104 97 114 32 83 70 105 - 108 101 68 105 114 91 49 48 50 52 93 59 99 104 97 114 32 73 109 112 111 - 114 116 70 105 108 101 91 49 48 50 52 93 59 105 110 116 32 112 97 114 - 97 108 108 101 108 59 115 116 114 117 99 116 32 83 65 70 95 86 101 114 - 115 105 111 110 73 110 102 111 123 105 110 116 32 118 109 97 106 111 - 114 59 105 110 116 32 118 109 105 110 111 114 59 105 110 116 32 114 101 - 108 59 99 104 97 114 32 97 110 110 111 116 91 49 48 93 59 125 115 97 - 102 97 112 105 59 115 116 114 117 99 116 32 83 65 70 95 86 101 114 115 - 105 111 110 73 110 102 111 123 105 110 116 32 118 109 97 106 111 114 59 - 105 110 116 32 118 109 105 110 111 114 59 105 110 116 32 114 101 108 59 - 99 104 97 114 32 97 110 110 111 116 91 49 48 93 59 125 115 97 102 108 - 105 98 59 115 116 114 117 99 116 32 83 65 70 95 86 101 114 115 105 111 - 110 73 110 102 111 123 105 110 116 32 118 109 97 106 111 114 59 105 110 - 116 32 118 109 105 110 111 114 59 105 110 116 32 114 101 108 59 99 104 - 97 114 32 97 110 110 111 116 91 49 48 93 59 125 118 98 116 59 115 116 - 114 117 99 116 32 83 65 70 95 86 101 114 115 105 111 110 73 110 102 111 - 123 105 110 116 32 118 109 97 106 111 114 59 105 110 116 32 118 109 105 - 110 111 114 59 105 110 116 32 114 101 108 59 99 104 97 114 32 97 110 - 110 111 116 91 49 48 93 59 125 100 115 108 59 115 116 114 117 99 116 32 - 83 65 70 95 86 101 114 115 105 111 110 73 110 102 111 123 105 110 116 - 32 118 109 97 106 111 114 59 105 110 116 32 118 109 105 110 111 114 59 - 105 110 116 32 114 101 108 59 99 104 97 114 32 97 110 110 111 116 91 49 - 48 93 59 125 104 100 102 53 59 115 116 114 117 99 116 32 83 65 70 95 86 - 101 114 115 105 111 110 73 110 102 111 123 105 110 116 32 118 109 97 - 106 111 114 59 105 110 116 32 118 109 105 110 111 114 59 105 110 116 32 - 114 101 108 59 99 104 97 114 32 97 110 110 111 116 91 49 48 93 59 125 - 109 112 105 59 105 110 116 32 68 111 84 111 99 59 105 110 116 32 82 101 - 97 100 79 110 108 121 59 105 110 116 32 67 108 111 98 98 101 114 59 105 - 110 116 32 79 83 77 111 100 101 115 59 125 59 10 47 115 115 114 101 108 - 45 95 48 48 48 48 32 68 65 84 65 83 69 84 32 105 110 116 59 10 47 115 - 115 114 101 108 45 95 48 48 48 49 32 68 65 84 65 83 69 84 32 105 110 - 116 59 10 47 115 115 114 101 108 45 95 48 48 48 50 32 68 65 84 65 83 69 - 84 32 105 110 116 59 10 47 115 115 114 101 108 45 95 48 48 48 51 32 68 - 65 84 65 83 69 84 32 105 110 116 59 10 47 115 115 114 101 108 45 95 48 - 48 48 52 32 68 65 84 65 83 69 84 32 105 110 116 59 10 47 115 115 114 - 101 108 45 95 48 48 48 53 32 68 65 84 65 83 69 84 32 105 110 116 59 10 - 47 115 115 114 101 108 45 95 48 48 48 54 32 68 65 84 65 83 69 84 32 105 - 110 116 59 10 47 115 115 114 101 108 45 95 48 48 48 55 32 68 65 84 65 - 83 69 84 32 105 110 116 59 10 47 115 115 114 101 108 45 95 48 48 48 56 - 32 68 65 84 65 83 69 84 32 105 110 116 59 10 47 115 115 114 101 108 45 - 95 48 48 48 57 32 68 65 84 65 83 69 84 32 105 110 116 59 10 47 115 115 - 114 101 108 45 95 48 48 49 48 32 68 65 84 65 83 69 84 32 105 110 116 59 - 10 47 115 115 114 101 108 45 95 48 48 49 49 32 68 65 84 65 83 69 84 32 - 105 110 116 59 10 47 115 115 114 101 108 45 95 48 48 49 50 32 68 65 84 - 65 83 69 84 32 105 110 116 59 10 47 116 111 112 111 114 101 108 45 95 - 48 48 49 55 32 68 65 84 65 83 69 84 32 105 110 116 59 10 47 116 111 112 - 111 114 101 108 45 95 48 48 49 56 32 68 65 84 65 83 69 84 32 105 110 - 116 59 10 47 116 111 112 111 114 101 108 45 95 48 48 49 57 32 68 65 84 - 65 83 69 84 32 105 110 116 59 10 47 116 111 112 111 114 101 108 45 95 - 48 48 50 48 32 68 65 84 65 83 69 84 32 105 110 116 59 10 47 102 105 101 - 108 100 45 99 111 111 114 100 115 95 48 48 48 50 32 68 65 84 65 83 69 - 84 32 102 108 111 97 116 59 10 47 102 105 101 108 100 45 100 105 115 - 116 114 105 98 117 116 105 111 110 95 102 97 99 116 111 114 115 95 48 - 48 48 51 32 68 65 84 65 83 69 84 32 102 108 111 97 116 59 10 47 102 105 - 101 108 100 45 116 101 109 112 101 114 97 116 117 114 101 95 48 48 48 - 52 32 68 65 84 65 83 69 84 32 102 108 111 97 116 59 10 47 102 105 101 - 108 100 45 100 105 115 112 108 97 99 101 109 101 110 116 115 95 48 48 - 48 55 32 68 65 84 65 83 69 84 32 102 108 111 97 116 59 10 47 102 105 - 101 108 100 45 115 116 114 101 115 115 95 48 48 49 49 32 68 65 84 65 83 - 69 84 32 102 108 111 97 116 59 10 47 102 105 101 108 100 45 116 101 109 - 112 101 114 97 116 117 114 101 95 48 48 49 50 32 68 65 84 65 83 69 84 - 32 102 108 111 97 116 59 10 47 102 105 101 108 100 45 112 114 101 115 - 115 117 114 101 95 48 48 49 51 32 68 65 84 65 83 69 84 32 102 108 111 - 97 116 59 10 47 66 108 111 98 32 68 65 84 65 83 69 84 32 115 116 114 - 117 99 116 32 66 108 111 98 123 68 83 76 95 79 102 102 115 101 116 32 - 102 105 108 101 95 105 100 59 68 83 76 95 79 102 102 115 101 116 32 100 - 97 116 97 115 101 116 95 105 100 59 68 83 76 95 79 102 102 115 101 116 - 32 111 102 102 115 101 116 59 68 83 76 95 79 102 102 115 101 116 32 115 - 116 114 105 100 101 59 68 83 76 95 79 102 102 115 101 116 32 99 111 117 - 110 116 59 68 83 76 95 79 102 102 115 101 116 32 98 97 115 101 95 105 - 100 59 68 83 76 95 79 102 102 115 101 116 32 110 117 109 95 114 101 99 - 115 59 125 59 10 47 73 110 100 101 120 83 112 101 99 32 68 65 84 65 83 - 69 84 32 115 116 114 117 99 116 32 73 110 100 101 120 83 112 101 99 123 - 105 110 116 32 110 100 105 109 115 59 105 110 116 32 111 114 105 103 - 105 110 115 91 56 93 59 105 110 116 32 115 105 122 101 115 91 56 93 59 - 105 110 116 32 111 114 100 101 114 91 56 93 59 101 110 117 109 32 73 - 110 100 101 120 84 121 112 101 123 86 66 84 95 73 78 68 69 88 95 84 89 - 80 69 95 67 95 79 82 68 69 82 61 48 44 86 66 84 95 73 78 68 69 88 95 84 - 89 80 69 95 70 95 79 82 68 69 82 61 49 44 86 66 84 95 73 78 68 69 88 95 - 84 89 80 69 95 65 78 89 61 45 49 44 86 66 84 95 73 78 68 69 88 95 84 89 - 80 69 95 73 78 86 65 76 73 68 61 45 50 44 86 66 84 95 73 78 68 69 88 95 - 84 89 80 69 95 78 65 61 45 51 44 86 66 84 95 73 78 68 69 88 95 84 89 80 - 69 95 85 78 75 78 79 87 78 61 45 52 125 105 110 100 101 120 95 116 121 - 112 101 59 68 83 76 95 79 102 102 115 101 116 32 98 97 115 101 95 105 - 100 59 68 83 76 95 79 102 102 115 101 116 32 110 117 109 95 114 101 99 - 115 59 125 59 10 47 67 97 116 32 68 65 84 65 83 69 84 32 115 116 114 - 117 99 116 32 67 97 116 123 99 104 97 114 32 110 97 109 101 91 54 52 93 - 59 101 110 117 109 32 82 111 108 101 123 86 66 84 95 82 79 76 69 95 84 - 79 80 79 61 48 44 86 66 84 95 82 79 76 69 95 66 78 68 61 49 44 86 66 84 - 95 82 79 76 69 95 80 82 79 67 61 50 44 86 66 84 95 82 79 76 69 95 68 79 - 77 78 61 51 44 86 66 84 95 82 79 76 69 95 66 76 79 67 75 61 52 44 86 66 - 84 95 82 79 76 69 95 65 83 83 89 61 53 44 86 66 84 95 82 79 76 69 95 77 - 65 84 61 54 44 86 66 84 95 82 79 76 69 95 88 80 82 79 68 61 55 44 86 66 - 84 95 82 79 76 69 95 85 83 69 82 68 61 56 44 86 66 84 95 82 79 76 69 95 - 65 78 89 61 45 49 44 86 66 84 95 82 79 76 69 95 73 78 86 65 76 73 68 61 - 45 50 44 86 66 84 95 82 79 76 69 95 78 65 61 45 51 44 86 66 84 95 82 79 - 76 69 95 85 78 75 78 79 87 78 61 45 52 125 114 111 108 101 59 105 110 - 116 32 116 100 105 109 59 68 83 76 95 79 102 102 115 101 116 32 98 97 - 115 101 95 105 100 59 68 83 76 95 79 102 102 115 101 116 32 110 117 109 - 95 114 101 99 115 59 125 59 10 47 83 101 116 32 68 65 84 65 83 69 84 32 - 115 116 114 117 99 116 32 83 101 116 123 105 110 116 32 117 115 101 114 - 95 105 100 59 99 104 97 114 32 110 97 109 101 91 54 52 93 59 105 110 - 116 32 116 100 105 109 59 101 110 117 109 32 83 105 108 82 111 108 101 - 123 86 66 84 95 83 82 79 76 69 95 84 73 77 69 61 48 44 86 66 84 95 83 - 82 79 76 69 95 83 80 65 67 69 61 49 44 86 66 84 95 83 82 79 76 69 95 83 - 84 65 84 69 61 50 44 86 66 84 95 83 82 79 76 69 95 80 65 82 65 77 61 51 - 44 86 66 84 95 83 82 79 76 69 95 67 84 89 80 69 61 52 44 86 66 84 95 83 - 82 79 76 69 95 65 84 89 80 69 61 53 44 86 66 84 95 83 82 79 76 69 95 85 - 83 69 82 68 61 54 44 86 66 84 95 83 82 79 76 69 95 65 78 89 61 45 49 44 - 86 66 84 95 83 82 79 76 69 95 73 78 86 65 76 73 68 61 45 50 44 86 66 84 - 95 83 82 79 76 69 95 78 65 61 45 51 44 86 66 84 95 83 82 79 76 69 95 85 - 78 75 78 79 87 78 61 45 52 125 115 114 111 108 101 59 68 83 76 95 79 - 102 102 115 101 116 32 99 111 108 108 95 105 100 115 91 49 54 93 59 105 - 110 116 32 105 115 95 116 111 112 59 105 110 116 32 105 115 95 101 120 - 116 101 110 100 105 98 108 101 59 68 83 76 95 79 102 102 115 101 116 32 - 100 102 108 116 95 99 111 111 114 100 102 108 100 95 105 100 59 68 83 - 76 95 79 102 102 115 101 116 32 98 110 100 95 115 101 116 95 105 100 59 - 68 83 76 95 79 102 102 115 101 116 32 98 97 115 101 95 105 100 59 68 83 - 76 95 79 102 102 115 101 116 32 110 117 109 95 114 101 99 115 59 125 59 - 10 47 67 111 108 108 101 99 116 105 111 110 32 68 65 84 65 83 69 84 32 - 115 116 114 117 99 116 32 67 111 108 108 101 99 116 105 111 110 123 68 - 83 76 95 79 102 102 115 101 116 32 99 111 110 116 97 105 110 105 110 - 103 95 115 101 116 95 105 100 59 68 83 76 95 79 102 102 115 101 116 32 - 99 97 116 95 105 100 59 101 110 117 109 32 67 101 108 108 84 121 112 - 101 123 86 66 84 95 67 69 76 76 95 84 89 80 69 95 78 79 78 69 61 48 44 - 86 66 84 95 67 69 76 76 95 84 89 80 69 95 80 79 73 78 84 61 49 44 86 66 - 84 95 67 69 76 76 95 84 89 80 69 95 76 73 78 69 61 50 44 86 66 84 95 67 - 69 76 76 95 84 89 80 69 95 84 82 73 61 51 44 86 66 84 95 67 69 76 76 95 - 84 89 80 69 95 81 85 65 68 61 52 44 86 66 84 95 67 69 76 76 95 84 89 80 - 69 95 84 69 84 61 53 44 86 66 84 95 67 69 76 76 95 84 89 80 69 95 80 89 - 82 65 77 73 68 61 54 44 86 66 84 95 67 69 76 76 95 84 89 80 69 95 80 82 - 73 83 77 61 55 44 86 66 84 95 67 69 76 76 95 84 89 80 69 95 72 69 88 61 - 56 44 86 66 84 95 67 69 76 76 95 84 89 80 69 95 77 73 88 69 68 61 57 44 - 86 66 84 95 67 69 76 76 95 84 89 80 69 95 65 82 66 61 49 48 44 86 66 84 - 95 67 69 76 76 95 84 89 80 69 95 49 66 65 76 76 61 49 49 44 86 66 84 95 - 67 69 76 76 95 84 89 80 69 95 50 66 65 76 76 61 49 50 44 86 66 84 95 67 - 69 76 76 95 84 89 80 69 95 51 66 65 76 76 61 49 51 44 86 66 84 95 67 69 - 76 76 95 84 89 80 69 95 49 83 72 69 76 76 61 49 52 44 86 66 84 95 67 69 - 76 76 95 84 89 80 69 95 50 83 72 69 76 76 61 49 53 44 86 66 84 95 67 69 - 76 76 95 84 89 80 69 95 65 78 89 61 45 49 44 86 66 84 95 67 69 76 76 95 - 84 89 80 69 95 73 78 86 65 76 73 68 61 45 50 44 86 66 84 95 67 69 76 76 - 95 84 89 80 69 95 78 65 61 45 51 44 86 66 84 95 67 69 76 76 95 84 89 80 - 69 95 85 78 75 78 79 87 78 61 45 52 125 99 101 108 108 95 116 121 112 - 101 59 105 110 116 32 99 111 117 110 116 59 68 83 76 95 79 102 102 115 - 101 116 32 105 110 100 101 120 105 110 103 95 105 100 59 105 110 116 32 - 105 115 95 100 101 99 111 109 112 59 68 83 76 95 79 102 102 115 101 116 - 32 109 101 109 98 101 114 115 95 98 108 111 98 95 105 100 59 68 83 76 - 95 79 102 102 115 101 116 32 98 97 115 101 95 105 100 59 68 83 76 95 79 - 102 102 115 101 116 32 110 117 109 95 114 101 99 115 59 125 59 10 47 82 - 101 108 97 116 105 111 110 32 68 65 84 65 83 69 84 32 115 116 114 117 - 99 116 32 82 101 108 97 116 105 111 110 123 68 83 76 95 79 102 102 115 - 101 116 32 115 117 98 95 105 100 59 68 83 76 95 79 102 102 115 101 116 - 32 115 117 98 95 99 97 116 95 105 100 59 68 83 76 95 79 102 102 115 101 - 116 32 115 117 98 95 100 101 99 111 109 112 95 99 97 116 95 105 100 59 - 68 83 76 95 79 102 102 115 101 116 32 115 117 112 95 105 100 59 68 83 - 76 95 79 102 102 115 101 116 32 115 117 112 95 99 97 116 95 105 100 59 - 68 83 76 95 79 102 102 115 101 116 32 115 117 112 95 100 101 99 111 109 - 112 95 99 97 116 95 105 100 59 101 110 117 109 32 82 101 108 75 105 110 - 100 123 86 66 84 95 82 69 76 75 73 78 68 95 83 85 66 83 69 84 61 48 44 - 86 66 84 95 82 69 76 75 73 78 68 95 83 85 80 83 69 84 61 49 44 86 66 84 - 95 82 69 76 75 73 78 68 95 66 79 85 78 68 61 50 44 86 66 84 95 82 69 76 - 75 73 78 68 95 80 69 82 77 85 84 69 61 51 44 86 66 84 95 82 69 76 75 73 - 78 68 95 78 69 73 71 72 66 79 82 61 52 44 86 66 84 95 82 69 76 75 73 78 - 68 95 67 79 80 89 61 53 44 86 66 84 95 82 69 76 75 73 78 68 95 69 81 85 - 65 76 61 54 44 86 66 84 95 82 69 76 75 73 78 68 95 65 78 89 61 45 49 44 - 86 66 84 95 82 69 76 75 73 78 68 95 73 78 86 65 76 73 68 61 45 50 44 86 - 66 84 95 82 69 76 75 73 78 68 95 78 65 61 45 51 44 86 66 84 95 82 69 76 - 75 73 78 68 95 85 78 75 78 79 87 78 61 45 52 125 107 105 110 100 59 101 - 110 117 109 32 82 101 108 82 101 112 123 86 66 84 95 82 69 76 82 69 80 - 95 73 68 69 78 84 73 84 89 61 48 44 86 66 84 95 82 69 76 82 69 80 95 72 - 76 73 83 84 61 49 44 86 66 84 95 82 69 76 82 69 80 95 84 76 73 83 84 61 - 50 44 86 66 84 95 82 69 76 82 69 80 95 84 76 73 83 84 95 49 61 51 44 86 - 66 84 95 82 69 76 82 69 80 95 69 76 73 83 84 61 52 44 86 66 84 95 82 69 - 76 82 69 80 95 83 84 82 85 67 84 85 82 69 68 61 53 44 86 66 84 95 82 69 - 76 82 69 80 95 85 78 83 84 82 85 67 84 85 82 69 68 61 54 44 86 66 84 95 - 82 69 76 82 69 80 95 65 82 66 73 84 82 65 82 89 95 82 61 55 44 86 66 84 - 95 82 69 76 82 69 80 95 65 82 66 73 84 82 65 82 89 95 68 82 61 56 44 86 - 66 84 95 82 69 76 82 69 80 95 65 78 89 61 45 49 44 86 66 84 95 82 69 76 - 82 69 80 95 73 78 86 65 76 73 68 61 45 50 44 86 66 84 95 82 69 76 82 69 - 80 95 78 65 61 45 51 44 86 66 84 95 82 69 76 82 69 80 95 85 78 75 78 79 - 87 78 61 45 52 125 114 101 112 95 116 121 112 101 59 68 83 76 95 79 102 - 102 115 101 116 32 100 95 98 108 111 98 95 105 100 59 68 83 76 95 79 - 102 102 115 101 116 32 114 95 98 108 111 98 95 105 100 59 68 83 76 95 - 79 102 102 115 101 116 32 98 97 115 101 95 105 100 59 68 83 76 95 79 - 102 102 115 101 116 32 110 117 109 95 114 101 99 115 59 125 59 10 47 70 - 105 101 108 100 84 109 112 108 32 68 65 84 65 83 69 84 32 115 116 114 - 117 99 116 32 70 105 101 108 100 84 109 112 108 123 99 104 97 114 32 - 110 97 109 101 91 54 52 93 59 68 83 76 95 79 102 102 115 101 116 32 98 - 97 115 101 95 115 112 97 99 101 95 105 100 59 101 110 117 109 32 65 108 - 103 101 98 114 97 105 99 84 121 112 101 123 86 66 84 95 65 76 71 69 66 - 82 65 73 67 95 84 89 80 69 95 67 79 78 83 84 65 78 84 61 48 44 86 66 84 - 95 65 76 71 69 66 82 65 73 67 95 84 89 80 69 95 67 79 77 80 79 78 69 78 - 84 61 49 44 86 66 84 95 65 76 71 69 66 82 65 73 67 95 84 89 80 69 95 83 - 67 65 76 65 82 61 50 44 86 66 84 95 65 76 71 69 66 82 65 73 67 95 84 89 - 80 69 95 86 69 67 84 79 82 61 51 44 86 66 84 95 65 76 71 69 66 82 65 73 - 67 95 84 89 80 69 95 84 69 78 83 79 82 61 52 44 86 66 84 95 65 76 71 69 - 66 82 65 73 67 95 84 89 80 69 95 83 89 77 95 84 69 78 83 79 82 61 53 44 - 86 66 84 95 65 76 71 69 66 82 65 73 67 95 84 89 80 69 95 70 73 69 76 68 - 61 54 44 86 66 84 95 65 76 71 69 66 82 65 73 67 95 84 89 80 69 95 83 84 - 65 84 69 61 55 44 86 66 84 95 65 76 71 69 66 82 65 73 67 95 84 89 80 69 - 95 84 85 80 76 69 61 56 44 86 66 84 95 65 76 71 69 66 82 65 73 67 95 84 - 89 80 69 95 65 78 89 61 45 49 44 86 66 84 95 65 76 71 69 66 82 65 73 67 - 95 84 89 80 69 95 73 78 86 65 76 73 68 61 45 50 44 86 66 84 95 65 76 71 - 69 66 82 65 73 67 95 84 89 80 69 95 78 65 61 45 51 44 86 66 84 95 65 76 - 71 69 66 82 65 73 67 95 84 89 80 69 95 85 78 75 78 79 87 78 61 45 52 - 125 97 108 103 95 116 121 112 101 59 101 110 117 109 32 66 97 115 105 - 115 84 121 112 101 123 86 66 84 95 66 65 83 73 83 95 84 89 80 69 95 85 - 78 73 84 89 61 48 44 86 66 84 95 66 65 83 73 83 95 84 89 80 69 95 67 65 - 82 84 69 83 73 65 78 61 49 44 86 66 84 95 66 65 83 73 83 95 84 89 80 69 - 95 83 80 72 69 82 73 67 65 76 61 50 44 86 66 84 95 66 65 83 73 83 95 84 - 89 80 69 95 67 89 76 73 78 68 82 73 67 65 76 61 51 44 86 66 84 95 66 65 - 83 73 83 95 84 89 80 69 95 85 80 80 69 82 95 84 82 73 61 52 44 86 66 84 - 95 66 65 83 73 83 95 84 89 80 69 95 70 79 85 82 73 69 82 61 53 44 86 66 - 84 95 66 65 83 73 83 95 84 89 80 69 95 86 65 82 73 65 66 76 69 61 54 44 - 86 66 84 95 66 65 83 73 83 95 84 89 80 69 95 65 78 89 61 45 49 44 86 66 - 84 95 66 65 83 73 83 95 84 89 80 69 95 73 78 86 65 76 73 68 61 45 50 44 - 86 66 84 95 66 65 83 73 83 95 84 89 80 69 95 78 65 61 45 51 44 86 66 84 - 95 66 65 83 73 83 95 84 89 80 69 95 85 78 75 78 79 87 78 61 45 52 125 - 98 97 115 105 115 59 68 83 76 95 79 102 102 115 101 116 32 113 117 97 - 110 116 105 116 121 95 105 100 59 105 110 116 32 110 117 109 95 99 111 - 109 112 115 59 68 83 76 95 79 102 102 115 101 116 32 102 116 109 112 - 108 95 105 100 115 95 98 108 111 98 95 105 100 59 68 83 76 95 79 102 - 102 115 101 116 32 98 97 115 101 95 105 100 59 68 83 76 95 79 102 102 - 115 101 116 32 110 117 109 95 114 101 99 115 59 125 59 10 47 70 105 101 - 108 100 32 68 65 84 65 83 69 84 32 115 116 114 117 99 116 32 70 105 101 - 108 100 123 68 83 76 95 79 102 102 115 101 116 32 102 116 109 112 108 - 95 105 100 59 99 104 97 114 32 110 97 109 101 91 54 52 93 59 68 83 76 - 95 79 102 102 115 101 116 32 117 110 105 116 115 95 105 100 59 68 83 76 - 95 79 102 102 115 101 116 32 115 116 111 114 97 103 101 95 100 101 99 - 111 109 112 95 99 97 116 95 105 100 59 101 110 117 109 32 73 110 116 - 101 114 108 101 97 118 101 123 86 66 84 95 73 78 84 69 82 76 69 65 86 - 69 95 67 79 77 80 79 78 69 78 84 61 48 44 86 66 84 95 73 78 84 69 82 76 - 69 65 86 69 95 86 69 67 84 79 82 61 49 44 86 66 84 95 73 78 84 69 82 76 - 69 65 86 69 95 73 78 68 69 80 69 78 68 69 78 84 61 50 44 86 66 84 95 73 - 78 84 69 82 76 69 65 86 69 95 78 79 78 69 61 51 44 86 66 84 95 73 78 84 - 69 82 76 69 65 86 69 95 65 78 89 61 45 49 44 86 66 84 95 73 78 84 69 82 - 76 69 65 86 69 95 73 78 86 65 76 73 68 61 45 50 44 86 66 84 95 73 78 84 - 69 82 76 69 65 86 69 95 78 65 61 45 51 44 86 66 84 95 73 78 84 69 82 76 - 69 65 86 69 95 85 78 75 78 79 87 78 61 45 52 125 99 111 109 112 95 105 - 110 116 108 118 59 68 83 76 95 79 102 102 115 101 116 32 105 110 100 - 101 120 105 110 103 95 105 100 59 68 83 76 95 79 102 102 115 101 116 32 - 100 111 102 95 97 115 115 111 99 95 99 97 116 95 105 100 59 105 110 116 - 32 97 115 115 111 99 95 114 97 116 105 111 59 68 83 76 95 79 102 102 - 115 101 116 32 101 118 97 108 95 100 101 99 111 109 112 95 99 97 116 95 - 105 100 59 101 110 117 109 32 69 118 97 108 70 117 110 99 123 86 66 84 - 95 69 86 65 76 95 70 85 78 67 95 67 79 78 83 84 65 78 84 61 48 44 86 66 - 84 95 69 86 65 76 95 70 85 78 67 95 85 78 73 70 79 82 77 61 49 44 86 66 - 84 95 69 86 65 76 95 70 85 78 67 95 80 87 67 79 78 83 84 61 50 44 86 66 - 84 95 69 86 65 76 95 70 85 78 67 95 80 87 76 73 78 69 65 82 61 51 44 86 - 66 84 95 69 86 65 76 95 70 85 78 67 95 65 78 89 61 45 49 44 86 66 84 95 - 69 86 65 76 95 70 85 78 67 95 73 78 86 65 76 73 68 61 45 50 44 86 66 84 - 95 69 86 65 76 95 70 85 78 67 95 78 65 61 45 51 44 86 66 84 95 69 86 65 - 76 95 70 85 78 67 95 85 78 75 78 79 87 78 61 45 52 125 101 118 97 108 - 95 102 117 110 99 59 105 110 116 32 105 115 95 104 111 109 111 103 101 - 110 101 111 117 115 59 105 110 116 32 105 115 95 99 111 111 114 100 95 - 102 105 101 108 100 59 68 83 76 95 79 102 102 115 101 116 32 99 111 109 - 112 95 105 100 115 95 98 108 111 98 95 105 100 59 68 83 76 95 79 102 - 102 115 101 116 32 99 111 109 112 95 111 114 100 101 114 95 98 108 111 - 98 95 105 100 59 68 83 76 95 79 102 102 115 101 116 32 118 98 97 115 - 105 115 95 98 108 111 98 95 105 100 59 68 83 76 95 79 102 102 115 101 - 116 32 100 111 102 95 98 108 111 98 95 105 100 59 68 83 76 95 79 102 - 102 115 101 116 32 98 97 115 101 95 105 100 59 68 83 76 95 79 102 102 - 115 101 116 32 110 117 109 95 114 101 99 115 59 125 59 10 47 109 101 - 116 97 98 108 111 98 48 48 48 48 48 46 105 110 100 101 120 32 68 65 84 - 65 83 69 84 32 115 116 114 117 99 116 32 73 110 100 101 120 80 97 105 - 114 123 68 83 76 95 79 102 102 115 101 116 32 105 110 100 101 120 59 - 105 110 116 32 108 101 110 103 116 104 59 125 59 10 47 109 101 116 97 - 98 108 111 98 48 48 48 48 48 46 98 108 111 98 32 68 65 84 65 83 69 84 - 32 68 83 76 95 79 102 102 115 101 116 59 10 + 47 + 32 + 67 + 79 + 78 + 84 + 65 + 73 + 78 + 69 + 82 + 10 + 47 + 46 + 97 + 116 + 116 + 114 + 105 + 98 + 117 + 116 + 101 + 115 + 32 + 67 + 79 + 78 + 84 + 65 + 73 + 78 + 69 + 82 + 10 + 47 + 46 + 97 + 116 + 116 + 114 + 105 + 98 + 117 + 116 + 101 + 115 + 47 + 100 + 97 + 116 + 97 + 98 + 97 + 115 + 101 + 32 + 67 + 79 + 78 + 84 + 65 + 73 + 78 + 69 + 82 + 10 + 47 + 46 + 97 + 116 + 116 + 114 + 105 + 98 + 117 + 116 + 101 + 115 + 47 + 100 + 97 + 116 + 97 + 98 + 97 + 115 + 101 + 47 + 46 + 83 + 65 + 70 + 95 + 68 + 98 + 80 + 114 + 111 + 112 + 115 + 32 + 68 + 65 + 84 + 65 + 83 + 69 + 84 + 32 + 115 + 116 + 114 + 117 + 99 + 116 + 32 + 83 + 65 + 70 + 95 + 68 + 98 + 80 + 114 + 111 + 112 + 115 + 123 + 105 + 110 + 116 + 32 + 109 + 97 + 103 + 105 + 99 + 59 + 99 + 104 + 97 + 114 + 32 + 83 + 70 + 105 + 108 + 101 + 68 + 105 + 114 + 91 + 49 + 48 + 50 + 52 + 93 + 59 + 99 + 104 + 97 + 114 + 32 + 73 + 109 + 112 + 111 + 114 + 116 + 70 + 105 + 108 + 101 + 91 + 49 + 48 + 50 + 52 + 93 + 59 + 105 + 110 + 116 + 32 + 112 + 97 + 114 + 97 + 108 + 108 + 101 + 108 + 59 + 115 + 116 + 114 + 117 + 99 + 116 + 32 + 83 + 65 + 70 + 95 + 86 + 101 + 114 + 115 + 105 + 111 + 110 + 73 + 110 + 102 + 111 + 123 + 105 + 110 + 116 + 32 + 118 + 109 + 97 + 106 + 111 + 114 + 59 + 105 + 110 + 116 + 32 + 118 + 109 + 105 + 110 + 111 + 114 + 59 + 105 + 110 + 116 + 32 + 114 + 101 + 108 + 59 + 99 + 104 + 97 + 114 + 32 + 97 + 110 + 110 + 111 + 116 + 91 + 49 + 48 + 93 + 59 + 125 + 115 + 97 + 102 + 97 + 112 + 105 + 59 + 115 + 116 + 114 + 117 + 99 + 116 + 32 + 83 + 65 + 70 + 95 + 86 + 101 + 114 + 115 + 105 + 111 + 110 + 73 + 110 + 102 + 111 + 123 + 105 + 110 + 116 + 32 + 118 + 109 + 97 + 106 + 111 + 114 + 59 + 105 + 110 + 116 + 32 + 118 + 109 + 105 + 110 + 111 + 114 + 59 + 105 + 110 + 116 + 32 + 114 + 101 + 108 + 59 + 99 + 104 + 97 + 114 + 32 + 97 + 110 + 110 + 111 + 116 + 91 + 49 + 48 + 93 + 59 + 125 + 115 + 97 + 102 + 108 + 105 + 98 + 59 + 115 + 116 + 114 + 117 + 99 + 116 + 32 + 83 + 65 + 70 + 95 + 86 + 101 + 114 + 115 + 105 + 111 + 110 + 73 + 110 + 102 + 111 + 123 + 105 + 110 + 116 + 32 + 118 + 109 + 97 + 106 + 111 + 114 + 59 + 105 + 110 + 116 + 32 + 118 + 109 + 105 + 110 + 111 + 114 + 59 + 105 + 110 + 116 + 32 + 114 + 101 + 108 + 59 + 99 + 104 + 97 + 114 + 32 + 97 + 110 + 110 + 111 + 116 + 91 + 49 + 48 + 93 + 59 + 125 + 118 + 98 + 116 + 59 + 115 + 116 + 114 + 117 + 99 + 116 + 32 + 83 + 65 + 70 + 95 + 86 + 101 + 114 + 115 + 105 + 111 + 110 + 73 + 110 + 102 + 111 + 123 + 105 + 110 + 116 + 32 + 118 + 109 + 97 + 106 + 111 + 114 + 59 + 105 + 110 + 116 + 32 + 118 + 109 + 105 + 110 + 111 + 114 + 59 + 105 + 110 + 116 + 32 + 114 + 101 + 108 + 59 + 99 + 104 + 97 + 114 + 32 + 97 + 110 + 110 + 111 + 116 + 91 + 49 + 48 + 93 + 59 + 125 + 100 + 115 + 108 + 59 + 115 + 116 + 114 + 117 + 99 + 116 + 32 + 83 + 65 + 70 + 95 + 86 + 101 + 114 + 115 + 105 + 111 + 110 + 73 + 110 + 102 + 111 + 123 + 105 + 110 + 116 + 32 + 118 + 109 + 97 + 106 + 111 + 114 + 59 + 105 + 110 + 116 + 32 + 118 + 109 + 105 + 110 + 111 + 114 + 59 + 105 + 110 + 116 + 32 + 114 + 101 + 108 + 59 + 99 + 104 + 97 + 114 + 32 + 97 + 110 + 110 + 111 + 116 + 91 + 49 + 48 + 93 + 59 + 125 + 104 + 100 + 102 + 53 + 59 + 115 + 116 + 114 + 117 + 99 + 116 + 32 + 83 + 65 + 70 + 95 + 86 + 101 + 114 + 115 + 105 + 111 + 110 + 73 + 110 + 102 + 111 + 123 + 105 + 110 + 116 + 32 + 118 + 109 + 97 + 106 + 111 + 114 + 59 + 105 + 110 + 116 + 32 + 118 + 109 + 105 + 110 + 111 + 114 + 59 + 105 + 110 + 116 + 32 + 114 + 101 + 108 + 59 + 99 + 104 + 97 + 114 + 32 + 97 + 110 + 110 + 111 + 116 + 91 + 49 + 48 + 93 + 59 + 125 + 109 + 112 + 105 + 59 + 105 + 110 + 116 + 32 + 68 + 111 + 84 + 111 + 99 + 59 + 105 + 110 + 116 + 32 + 82 + 101 + 97 + 100 + 79 + 110 + 108 + 121 + 59 + 105 + 110 + 116 + 32 + 67 + 108 + 111 + 98 + 98 + 101 + 114 + 59 + 105 + 110 + 116 + 32 + 79 + 83 + 77 + 111 + 100 + 101 + 115 + 59 + 125 + 59 + 10 + 47 + 115 + 115 + 114 + 101 + 108 + 45 + 95 + 48 + 48 + 48 + 48 + 32 + 68 + 65 + 84 + 65 + 83 + 69 + 84 + 32 + 105 + 110 + 116 + 59 + 10 + 47 + 115 + 115 + 114 + 101 + 108 + 45 + 95 + 48 + 48 + 48 + 49 + 32 + 68 + 65 + 84 + 65 + 83 + 69 + 84 + 32 + 105 + 110 + 116 + 59 + 10 + 47 + 115 + 115 + 114 + 101 + 108 + 45 + 95 + 48 + 48 + 48 + 50 + 32 + 68 + 65 + 84 + 65 + 83 + 69 + 84 + 32 + 105 + 110 + 116 + 59 + 10 + 47 + 115 + 115 + 114 + 101 + 108 + 45 + 95 + 48 + 48 + 48 + 51 + 32 + 68 + 65 + 84 + 65 + 83 + 69 + 84 + 32 + 105 + 110 + 116 + 59 + 10 + 47 + 115 + 115 + 114 + 101 + 108 + 45 + 95 + 48 + 48 + 48 + 52 + 32 + 68 + 65 + 84 + 65 + 83 + 69 + 84 + 32 + 105 + 110 + 116 + 59 + 10 + 47 + 115 + 115 + 114 + 101 + 108 + 45 + 95 + 48 + 48 + 48 + 53 + 32 + 68 + 65 + 84 + 65 + 83 + 69 + 84 + 32 + 105 + 110 + 116 + 59 + 10 + 47 + 115 + 115 + 114 + 101 + 108 + 45 + 95 + 48 + 48 + 48 + 54 + 32 + 68 + 65 + 84 + 65 + 83 + 69 + 84 + 32 + 105 + 110 + 116 + 59 + 10 + 47 + 115 + 115 + 114 + 101 + 108 + 45 + 95 + 48 + 48 + 48 + 55 + 32 + 68 + 65 + 84 + 65 + 83 + 69 + 84 + 32 + 105 + 110 + 116 + 59 + 10 + 47 + 115 + 115 + 114 + 101 + 108 + 45 + 95 + 48 + 48 + 48 + 56 + 32 + 68 + 65 + 84 + 65 + 83 + 69 + 84 + 32 + 105 + 110 + 116 + 59 + 10 + 47 + 115 + 115 + 114 + 101 + 108 + 45 + 95 + 48 + 48 + 48 + 57 + 32 + 68 + 65 + 84 + 65 + 83 + 69 + 84 + 32 + 105 + 110 + 116 + 59 + 10 + 47 + 115 + 115 + 114 + 101 + 108 + 45 + 95 + 48 + 48 + 49 + 48 + 32 + 68 + 65 + 84 + 65 + 83 + 69 + 84 + 32 + 105 + 110 + 116 + 59 + 10 + 47 + 115 + 115 + 114 + 101 + 108 + 45 + 95 + 48 + 48 + 49 + 49 + 32 + 68 + 65 + 84 + 65 + 83 + 69 + 84 + 32 + 105 + 110 + 116 + 59 + 10 + 47 + 115 + 115 + 114 + 101 + 108 + 45 + 95 + 48 + 48 + 49 + 50 + 32 + 68 + 65 + 84 + 65 + 83 + 69 + 84 + 32 + 105 + 110 + 116 + 59 + 10 + 47 + 116 + 111 + 112 + 111 + 114 + 101 + 108 + 45 + 95 + 48 + 48 + 49 + 55 + 32 + 68 + 65 + 84 + 65 + 83 + 69 + 84 + 32 + 105 + 110 + 116 + 59 + 10 + 47 + 116 + 111 + 112 + 111 + 114 + 101 + 108 + 45 + 95 + 48 + 48 + 49 + 56 + 32 + 68 + 65 + 84 + 65 + 83 + 69 + 84 + 32 + 105 + 110 + 116 + 59 + 10 + 47 + 116 + 111 + 112 + 111 + 114 + 101 + 108 + 45 + 95 + 48 + 48 + 49 + 57 + 32 + 68 + 65 + 84 + 65 + 83 + 69 + 84 + 32 + 105 + 110 + 116 + 59 + 10 + 47 + 116 + 111 + 112 + 111 + 114 + 101 + 108 + 45 + 95 + 48 + 48 + 50 + 48 + 32 + 68 + 65 + 84 + 65 + 83 + 69 + 84 + 32 + 105 + 110 + 116 + 59 + 10 + 47 + 102 + 105 + 101 + 108 + 100 + 45 + 99 + 111 + 111 + 114 + 100 + 115 + 95 + 48 + 48 + 48 + 50 + 32 + 68 + 65 + 84 + 65 + 83 + 69 + 84 + 32 + 102 + 108 + 111 + 97 + 116 + 59 + 10 + 47 + 102 + 105 + 101 + 108 + 100 + 45 + 100 + 105 + 115 + 116 + 114 + 105 + 98 + 117 + 116 + 105 + 111 + 110 + 95 + 102 + 97 + 99 + 116 + 111 + 114 + 115 + 95 + 48 + 48 + 48 + 51 + 32 + 68 + 65 + 84 + 65 + 83 + 69 + 84 + 32 + 102 + 108 + 111 + 97 + 116 + 59 + 10 + 47 + 102 + 105 + 101 + 108 + 100 + 45 + 116 + 101 + 109 + 112 + 101 + 114 + 97 + 116 + 117 + 114 + 101 + 95 + 48 + 48 + 48 + 52 + 32 + 68 + 65 + 84 + 65 + 83 + 69 + 84 + 32 + 102 + 108 + 111 + 97 + 116 + 59 + 10 + 47 + 102 + 105 + 101 + 108 + 100 + 45 + 100 + 105 + 115 + 112 + 108 + 97 + 99 + 101 + 109 + 101 + 110 + 116 + 115 + 95 + 48 + 48 + 48 + 55 + 32 + 68 + 65 + 84 + 65 + 83 + 69 + 84 + 32 + 102 + 108 + 111 + 97 + 116 + 59 + 10 + 47 + 102 + 105 + 101 + 108 + 100 + 45 + 115 + 116 + 114 + 101 + 115 + 115 + 95 + 48 + 48 + 49 + 49 + 32 + 68 + 65 + 84 + 65 + 83 + 69 + 84 + 32 + 102 + 108 + 111 + 97 + 116 + 59 + 10 + 47 + 102 + 105 + 101 + 108 + 100 + 45 + 116 + 101 + 109 + 112 + 101 + 114 + 97 + 116 + 117 + 114 + 101 + 95 + 48 + 48 + 49 + 50 + 32 + 68 + 65 + 84 + 65 + 83 + 69 + 84 + 32 + 102 + 108 + 111 + 97 + 116 + 59 + 10 + 47 + 102 + 105 + 101 + 108 + 100 + 45 + 112 + 114 + 101 + 115 + 115 + 117 + 114 + 101 + 95 + 48 + 48 + 49 + 51 + 32 + 68 + 65 + 84 + 65 + 83 + 69 + 84 + 32 + 102 + 108 + 111 + 97 + 116 + 59 + 10 + 47 + 66 + 108 + 111 + 98 + 32 + 68 + 65 + 84 + 65 + 83 + 69 + 84 + 32 + 115 + 116 + 114 + 117 + 99 + 116 + 32 + 66 + 108 + 111 + 98 + 123 + 68 + 83 + 76 + 95 + 79 + 102 + 102 + 115 + 101 + 116 + 32 + 102 + 105 + 108 + 101 + 95 + 105 + 100 + 59 + 68 + 83 + 76 + 95 + 79 + 102 + 102 + 115 + 101 + 116 + 32 + 100 + 97 + 116 + 97 + 115 + 101 + 116 + 95 + 105 + 100 + 59 + 68 + 83 + 76 + 95 + 79 + 102 + 102 + 115 + 101 + 116 + 32 + 111 + 102 + 102 + 115 + 101 + 116 + 59 + 68 + 83 + 76 + 95 + 79 + 102 + 102 + 115 + 101 + 116 + 32 + 115 + 116 + 114 + 105 + 100 + 101 + 59 + 68 + 83 + 76 + 95 + 79 + 102 + 102 + 115 + 101 + 116 + 32 + 99 + 111 + 117 + 110 + 116 + 59 + 68 + 83 + 76 + 95 + 79 + 102 + 102 + 115 + 101 + 116 + 32 + 98 + 97 + 115 + 101 + 95 + 105 + 100 + 59 + 68 + 83 + 76 + 95 + 79 + 102 + 102 + 115 + 101 + 116 + 32 + 110 + 117 + 109 + 95 + 114 + 101 + 99 + 115 + 59 + 125 + 59 + 10 + 47 + 73 + 110 + 100 + 101 + 120 + 83 + 112 + 101 + 99 + 32 + 68 + 65 + 84 + 65 + 83 + 69 + 84 + 32 + 115 + 116 + 114 + 117 + 99 + 116 + 32 + 73 + 110 + 100 + 101 + 120 + 83 + 112 + 101 + 99 + 123 + 105 + 110 + 116 + 32 + 110 + 100 + 105 + 109 + 115 + 59 + 105 + 110 + 116 + 32 + 111 + 114 + 105 + 103 + 105 + 110 + 115 + 91 + 56 + 93 + 59 + 105 + 110 + 116 + 32 + 115 + 105 + 122 + 101 + 115 + 91 + 56 + 93 + 59 + 105 + 110 + 116 + 32 + 111 + 114 + 100 + 101 + 114 + 91 + 56 + 93 + 59 + 101 + 110 + 117 + 109 + 32 + 73 + 110 + 100 + 101 + 120 + 84 + 121 + 112 + 101 + 123 + 86 + 66 + 84 + 95 + 73 + 78 + 68 + 69 + 88 + 95 + 84 + 89 + 80 + 69 + 95 + 67 + 95 + 79 + 82 + 68 + 69 + 82 + 61 + 48 + 44 + 86 + 66 + 84 + 95 + 73 + 78 + 68 + 69 + 88 + 95 + 84 + 89 + 80 + 69 + 95 + 70 + 95 + 79 + 82 + 68 + 69 + 82 + 61 + 49 + 44 + 86 + 66 + 84 + 95 + 73 + 78 + 68 + 69 + 88 + 95 + 84 + 89 + 80 + 69 + 95 + 65 + 78 + 89 + 61 + 45 + 49 + 44 + 86 + 66 + 84 + 95 + 73 + 78 + 68 + 69 + 88 + 95 + 84 + 89 + 80 + 69 + 95 + 73 + 78 + 86 + 65 + 76 + 73 + 68 + 61 + 45 + 50 + 44 + 86 + 66 + 84 + 95 + 73 + 78 + 68 + 69 + 88 + 95 + 84 + 89 + 80 + 69 + 95 + 78 + 65 + 61 + 45 + 51 + 44 + 86 + 66 + 84 + 95 + 73 + 78 + 68 + 69 + 88 + 95 + 84 + 89 + 80 + 69 + 95 + 85 + 78 + 75 + 78 + 79 + 87 + 78 + 61 + 45 + 52 + 125 + 105 + 110 + 100 + 101 + 120 + 95 + 116 + 121 + 112 + 101 + 59 + 68 + 83 + 76 + 95 + 79 + 102 + 102 + 115 + 101 + 116 + 32 + 98 + 97 + 115 + 101 + 95 + 105 + 100 + 59 + 68 + 83 + 76 + 95 + 79 + 102 + 102 + 115 + 101 + 116 + 32 + 110 + 117 + 109 + 95 + 114 + 101 + 99 + 115 + 59 + 125 + 59 + 10 + 47 + 67 + 97 + 116 + 32 + 68 + 65 + 84 + 65 + 83 + 69 + 84 + 32 + 115 + 116 + 114 + 117 + 99 + 116 + 32 + 67 + 97 + 116 + 123 + 99 + 104 + 97 + 114 + 32 + 110 + 97 + 109 + 101 + 91 + 54 + 52 + 93 + 59 + 101 + 110 + 117 + 109 + 32 + 82 + 111 + 108 + 101 + 123 + 86 + 66 + 84 + 95 + 82 + 79 + 76 + 69 + 95 + 84 + 79 + 80 + 79 + 61 + 48 + 44 + 86 + 66 + 84 + 95 + 82 + 79 + 76 + 69 + 95 + 66 + 78 + 68 + 61 + 49 + 44 + 86 + 66 + 84 + 95 + 82 + 79 + 76 + 69 + 95 + 80 + 82 + 79 + 67 + 61 + 50 + 44 + 86 + 66 + 84 + 95 + 82 + 79 + 76 + 69 + 95 + 68 + 79 + 77 + 78 + 61 + 51 + 44 + 86 + 66 + 84 + 95 + 82 + 79 + 76 + 69 + 95 + 66 + 76 + 79 + 67 + 75 + 61 + 52 + 44 + 86 + 66 + 84 + 95 + 82 + 79 + 76 + 69 + 95 + 65 + 83 + 83 + 89 + 61 + 53 + 44 + 86 + 66 + 84 + 95 + 82 + 79 + 76 + 69 + 95 + 77 + 65 + 84 + 61 + 54 + 44 + 86 + 66 + 84 + 95 + 82 + 79 + 76 + 69 + 95 + 88 + 80 + 82 + 79 + 68 + 61 + 55 + 44 + 86 + 66 + 84 + 95 + 82 + 79 + 76 + 69 + 95 + 85 + 83 + 69 + 82 + 68 + 61 + 56 + 44 + 86 + 66 + 84 + 95 + 82 + 79 + 76 + 69 + 95 + 65 + 78 + 89 + 61 + 45 + 49 + 44 + 86 + 66 + 84 + 95 + 82 + 79 + 76 + 69 + 95 + 73 + 78 + 86 + 65 + 76 + 73 + 68 + 61 + 45 + 50 + 44 + 86 + 66 + 84 + 95 + 82 + 79 + 76 + 69 + 95 + 78 + 65 + 61 + 45 + 51 + 44 + 86 + 66 + 84 + 95 + 82 + 79 + 76 + 69 + 95 + 85 + 78 + 75 + 78 + 79 + 87 + 78 + 61 + 45 + 52 + 125 + 114 + 111 + 108 + 101 + 59 + 105 + 110 + 116 + 32 + 116 + 100 + 105 + 109 + 59 + 68 + 83 + 76 + 95 + 79 + 102 + 102 + 115 + 101 + 116 + 32 + 98 + 97 + 115 + 101 + 95 + 105 + 100 + 59 + 68 + 83 + 76 + 95 + 79 + 102 + 102 + 115 + 101 + 116 + 32 + 110 + 117 + 109 + 95 + 114 + 101 + 99 + 115 + 59 + 125 + 59 + 10 + 47 + 83 + 101 + 116 + 32 + 68 + 65 + 84 + 65 + 83 + 69 + 84 + 32 + 115 + 116 + 114 + 117 + 99 + 116 + 32 + 83 + 101 + 116 + 123 + 105 + 110 + 116 + 32 + 117 + 115 + 101 + 114 + 95 + 105 + 100 + 59 + 99 + 104 + 97 + 114 + 32 + 110 + 97 + 109 + 101 + 91 + 54 + 52 + 93 + 59 + 105 + 110 + 116 + 32 + 116 + 100 + 105 + 109 + 59 + 101 + 110 + 117 + 109 + 32 + 83 + 105 + 108 + 82 + 111 + 108 + 101 + 123 + 86 + 66 + 84 + 95 + 83 + 82 + 79 + 76 + 69 + 95 + 84 + 73 + 77 + 69 + 61 + 48 + 44 + 86 + 66 + 84 + 95 + 83 + 82 + 79 + 76 + 69 + 95 + 83 + 80 + 65 + 67 + 69 + 61 + 49 + 44 + 86 + 66 + 84 + 95 + 83 + 82 + 79 + 76 + 69 + 95 + 83 + 84 + 65 + 84 + 69 + 61 + 50 + 44 + 86 + 66 + 84 + 95 + 83 + 82 + 79 + 76 + 69 + 95 + 80 + 65 + 82 + 65 + 77 + 61 + 51 + 44 + 86 + 66 + 84 + 95 + 83 + 82 + 79 + 76 + 69 + 95 + 67 + 84 + 89 + 80 + 69 + 61 + 52 + 44 + 86 + 66 + 84 + 95 + 83 + 82 + 79 + 76 + 69 + 95 + 65 + 84 + 89 + 80 + 69 + 61 + 53 + 44 + 86 + 66 + 84 + 95 + 83 + 82 + 79 + 76 + 69 + 95 + 85 + 83 + 69 + 82 + 68 + 61 + 54 + 44 + 86 + 66 + 84 + 95 + 83 + 82 + 79 + 76 + 69 + 95 + 65 + 78 + 89 + 61 + 45 + 49 + 44 + 86 + 66 + 84 + 95 + 83 + 82 + 79 + 76 + 69 + 95 + 73 + 78 + 86 + 65 + 76 + 73 + 68 + 61 + 45 + 50 + 44 + 86 + 66 + 84 + 95 + 83 + 82 + 79 + 76 + 69 + 95 + 78 + 65 + 61 + 45 + 51 + 44 + 86 + 66 + 84 + 95 + 83 + 82 + 79 + 76 + 69 + 95 + 85 + 78 + 75 + 78 + 79 + 87 + 78 + 61 + 45 + 52 + 125 + 115 + 114 + 111 + 108 + 101 + 59 + 68 + 83 + 76 + 95 + 79 + 102 + 102 + 115 + 101 + 116 + 32 + 99 + 111 + 108 + 108 + 95 + 105 + 100 + 115 + 91 + 49 + 54 + 93 + 59 + 105 + 110 + 116 + 32 + 105 + 115 + 95 + 116 + 111 + 112 + 59 + 105 + 110 + 116 + 32 + 105 + 115 + 95 + 101 + 120 + 116 + 101 + 110 + 100 + 105 + 98 + 108 + 101 + 59 + 68 + 83 + 76 + 95 + 79 + 102 + 102 + 115 + 101 + 116 + 32 + 100 + 102 + 108 + 116 + 95 + 99 + 111 + 111 + 114 + 100 + 102 + 108 + 100 + 95 + 105 + 100 + 59 + 68 + 83 + 76 + 95 + 79 + 102 + 102 + 115 + 101 + 116 + 32 + 98 + 110 + 100 + 95 + 115 + 101 + 116 + 95 + 105 + 100 + 59 + 68 + 83 + 76 + 95 + 79 + 102 + 102 + 115 + 101 + 116 + 32 + 98 + 97 + 115 + 101 + 95 + 105 + 100 + 59 + 68 + 83 + 76 + 95 + 79 + 102 + 102 + 115 + 101 + 116 + 32 + 110 + 117 + 109 + 95 + 114 + 101 + 99 + 115 + 59 + 125 + 59 + 10 + 47 + 67 + 111 + 108 + 108 + 101 + 99 + 116 + 105 + 111 + 110 + 32 + 68 + 65 + 84 + 65 + 83 + 69 + 84 + 32 + 115 + 116 + 114 + 117 + 99 + 116 + 32 + 67 + 111 + 108 + 108 + 101 + 99 + 116 + 105 + 111 + 110 + 123 + 68 + 83 + 76 + 95 + 79 + 102 + 102 + 115 + 101 + 116 + 32 + 99 + 111 + 110 + 116 + 97 + 105 + 110 + 105 + 110 + 103 + 95 + 115 + 101 + 116 + 95 + 105 + 100 + 59 + 68 + 83 + 76 + 95 + 79 + 102 + 102 + 115 + 101 + 116 + 32 + 99 + 97 + 116 + 95 + 105 + 100 + 59 + 101 + 110 + 117 + 109 + 32 + 67 + 101 + 108 + 108 + 84 + 121 + 112 + 101 + 123 + 86 + 66 + 84 + 95 + 67 + 69 + 76 + 76 + 95 + 84 + 89 + 80 + 69 + 95 + 78 + 79 + 78 + 69 + 61 + 48 + 44 + 86 + 66 + 84 + 95 + 67 + 69 + 76 + 76 + 95 + 84 + 89 + 80 + 69 + 95 + 80 + 79 + 73 + 78 + 84 + 61 + 49 + 44 + 86 + 66 + 84 + 95 + 67 + 69 + 76 + 76 + 95 + 84 + 89 + 80 + 69 + 95 + 76 + 73 + 78 + 69 + 61 + 50 + 44 + 86 + 66 + 84 + 95 + 67 + 69 + 76 + 76 + 95 + 84 + 89 + 80 + 69 + 95 + 84 + 82 + 73 + 61 + 51 + 44 + 86 + 66 + 84 + 95 + 67 + 69 + 76 + 76 + 95 + 84 + 89 + 80 + 69 + 95 + 81 + 85 + 65 + 68 + 61 + 52 + 44 + 86 + 66 + 84 + 95 + 67 + 69 + 76 + 76 + 95 + 84 + 89 + 80 + 69 + 95 + 84 + 69 + 84 + 61 + 53 + 44 + 86 + 66 + 84 + 95 + 67 + 69 + 76 + 76 + 95 + 84 + 89 + 80 + 69 + 95 + 80 + 89 + 82 + 65 + 77 + 73 + 68 + 61 + 54 + 44 + 86 + 66 + 84 + 95 + 67 + 69 + 76 + 76 + 95 + 84 + 89 + 80 + 69 + 95 + 80 + 82 + 73 + 83 + 77 + 61 + 55 + 44 + 86 + 66 + 84 + 95 + 67 + 69 + 76 + 76 + 95 + 84 + 89 + 80 + 69 + 95 + 72 + 69 + 88 + 61 + 56 + 44 + 86 + 66 + 84 + 95 + 67 + 69 + 76 + 76 + 95 + 84 + 89 + 80 + 69 + 95 + 77 + 73 + 88 + 69 + 68 + 61 + 57 + 44 + 86 + 66 + 84 + 95 + 67 + 69 + 76 + 76 + 95 + 84 + 89 + 80 + 69 + 95 + 65 + 82 + 66 + 61 + 49 + 48 + 44 + 86 + 66 + 84 + 95 + 67 + 69 + 76 + 76 + 95 + 84 + 89 + 80 + 69 + 95 + 49 + 66 + 65 + 76 + 76 + 61 + 49 + 49 + 44 + 86 + 66 + 84 + 95 + 67 + 69 + 76 + 76 + 95 + 84 + 89 + 80 + 69 + 95 + 50 + 66 + 65 + 76 + 76 + 61 + 49 + 50 + 44 + 86 + 66 + 84 + 95 + 67 + 69 + 76 + 76 + 95 + 84 + 89 + 80 + 69 + 95 + 51 + 66 + 65 + 76 + 76 + 61 + 49 + 51 + 44 + 86 + 66 + 84 + 95 + 67 + 69 + 76 + 76 + 95 + 84 + 89 + 80 + 69 + 95 + 49 + 83 + 72 + 69 + 76 + 76 + 61 + 49 + 52 + 44 + 86 + 66 + 84 + 95 + 67 + 69 + 76 + 76 + 95 + 84 + 89 + 80 + 69 + 95 + 50 + 83 + 72 + 69 + 76 + 76 + 61 + 49 + 53 + 44 + 86 + 66 + 84 + 95 + 67 + 69 + 76 + 76 + 95 + 84 + 89 + 80 + 69 + 95 + 65 + 78 + 89 + 61 + 45 + 49 + 44 + 86 + 66 + 84 + 95 + 67 + 69 + 76 + 76 + 95 + 84 + 89 + 80 + 69 + 95 + 73 + 78 + 86 + 65 + 76 + 73 + 68 + 61 + 45 + 50 + 44 + 86 + 66 + 84 + 95 + 67 + 69 + 76 + 76 + 95 + 84 + 89 + 80 + 69 + 95 + 78 + 65 + 61 + 45 + 51 + 44 + 86 + 66 + 84 + 95 + 67 + 69 + 76 + 76 + 95 + 84 + 89 + 80 + 69 + 95 + 85 + 78 + 75 + 78 + 79 + 87 + 78 + 61 + 45 + 52 + 125 + 99 + 101 + 108 + 108 + 95 + 116 + 121 + 112 + 101 + 59 + 105 + 110 + 116 + 32 + 99 + 111 + 117 + 110 + 116 + 59 + 68 + 83 + 76 + 95 + 79 + 102 + 102 + 115 + 101 + 116 + 32 + 105 + 110 + 100 + 101 + 120 + 105 + 110 + 103 + 95 + 105 + 100 + 59 + 105 + 110 + 116 + 32 + 105 + 115 + 95 + 100 + 101 + 99 + 111 + 109 + 112 + 59 + 68 + 83 + 76 + 95 + 79 + 102 + 102 + 115 + 101 + 116 + 32 + 109 + 101 + 109 + 98 + 101 + 114 + 115 + 95 + 98 + 108 + 111 + 98 + 95 + 105 + 100 + 59 + 68 + 83 + 76 + 95 + 79 + 102 + 102 + 115 + 101 + 116 + 32 + 98 + 97 + 115 + 101 + 95 + 105 + 100 + 59 + 68 + 83 + 76 + 95 + 79 + 102 + 102 + 115 + 101 + 116 + 32 + 110 + 117 + 109 + 95 + 114 + 101 + 99 + 115 + 59 + 125 + 59 + 10 + 47 + 82 + 101 + 108 + 97 + 116 + 105 + 111 + 110 + 32 + 68 + 65 + 84 + 65 + 83 + 69 + 84 + 32 + 115 + 116 + 114 + 117 + 99 + 116 + 32 + 82 + 101 + 108 + 97 + 116 + 105 + 111 + 110 + 123 + 68 + 83 + 76 + 95 + 79 + 102 + 102 + 115 + 101 + 116 + 32 + 115 + 117 + 98 + 95 + 105 + 100 + 59 + 68 + 83 + 76 + 95 + 79 + 102 + 102 + 115 + 101 + 116 + 32 + 115 + 117 + 98 + 95 + 99 + 97 + 116 + 95 + 105 + 100 + 59 + 68 + 83 + 76 + 95 + 79 + 102 + 102 + 115 + 101 + 116 + 32 + 115 + 117 + 98 + 95 + 100 + 101 + 99 + 111 + 109 + 112 + 95 + 99 + 97 + 116 + 95 + 105 + 100 + 59 + 68 + 83 + 76 + 95 + 79 + 102 + 102 + 115 + 101 + 116 + 32 + 115 + 117 + 112 + 95 + 105 + 100 + 59 + 68 + 83 + 76 + 95 + 79 + 102 + 102 + 115 + 101 + 116 + 32 + 115 + 117 + 112 + 95 + 99 + 97 + 116 + 95 + 105 + 100 + 59 + 68 + 83 + 76 + 95 + 79 + 102 + 102 + 115 + 101 + 116 + 32 + 115 + 117 + 112 + 95 + 100 + 101 + 99 + 111 + 109 + 112 + 95 + 99 + 97 + 116 + 95 + 105 + 100 + 59 + 101 + 110 + 117 + 109 + 32 + 82 + 101 + 108 + 75 + 105 + 110 + 100 + 123 + 86 + 66 + 84 + 95 + 82 + 69 + 76 + 75 + 73 + 78 + 68 + 95 + 83 + 85 + 66 + 83 + 69 + 84 + 61 + 48 + 44 + 86 + 66 + 84 + 95 + 82 + 69 + 76 + 75 + 73 + 78 + 68 + 95 + 83 + 85 + 80 + 83 + 69 + 84 + 61 + 49 + 44 + 86 + 66 + 84 + 95 + 82 + 69 + 76 + 75 + 73 + 78 + 68 + 95 + 66 + 79 + 85 + 78 + 68 + 61 + 50 + 44 + 86 + 66 + 84 + 95 + 82 + 69 + 76 + 75 + 73 + 78 + 68 + 95 + 80 + 69 + 82 + 77 + 85 + 84 + 69 + 61 + 51 + 44 + 86 + 66 + 84 + 95 + 82 + 69 + 76 + 75 + 73 + 78 + 68 + 95 + 78 + 69 + 73 + 71 + 72 + 66 + 79 + 82 + 61 + 52 + 44 + 86 + 66 + 84 + 95 + 82 + 69 + 76 + 75 + 73 + 78 + 68 + 95 + 67 + 79 + 80 + 89 + 61 + 53 + 44 + 86 + 66 + 84 + 95 + 82 + 69 + 76 + 75 + 73 + 78 + 68 + 95 + 69 + 81 + 85 + 65 + 76 + 61 + 54 + 44 + 86 + 66 + 84 + 95 + 82 + 69 + 76 + 75 + 73 + 78 + 68 + 95 + 65 + 78 + 89 + 61 + 45 + 49 + 44 + 86 + 66 + 84 + 95 + 82 + 69 + 76 + 75 + 73 + 78 + 68 + 95 + 73 + 78 + 86 + 65 + 76 + 73 + 68 + 61 + 45 + 50 + 44 + 86 + 66 + 84 + 95 + 82 + 69 + 76 + 75 + 73 + 78 + 68 + 95 + 78 + 65 + 61 + 45 + 51 + 44 + 86 + 66 + 84 + 95 + 82 + 69 + 76 + 75 + 73 + 78 + 68 + 95 + 85 + 78 + 75 + 78 + 79 + 87 + 78 + 61 + 45 + 52 + 125 + 107 + 105 + 110 + 100 + 59 + 101 + 110 + 117 + 109 + 32 + 82 + 101 + 108 + 82 + 101 + 112 + 123 + 86 + 66 + 84 + 95 + 82 + 69 + 76 + 82 + 69 + 80 + 95 + 73 + 68 + 69 + 78 + 84 + 73 + 84 + 89 + 61 + 48 + 44 + 86 + 66 + 84 + 95 + 82 + 69 + 76 + 82 + 69 + 80 + 95 + 72 + 76 + 73 + 83 + 84 + 61 + 49 + 44 + 86 + 66 + 84 + 95 + 82 + 69 + 76 + 82 + 69 + 80 + 95 + 84 + 76 + 73 + 83 + 84 + 61 + 50 + 44 + 86 + 66 + 84 + 95 + 82 + 69 + 76 + 82 + 69 + 80 + 95 + 84 + 76 + 73 + 83 + 84 + 95 + 49 + 61 + 51 + 44 + 86 + 66 + 84 + 95 + 82 + 69 + 76 + 82 + 69 + 80 + 95 + 69 + 76 + 73 + 83 + 84 + 61 + 52 + 44 + 86 + 66 + 84 + 95 + 82 + 69 + 76 + 82 + 69 + 80 + 95 + 83 + 84 + 82 + 85 + 67 + 84 + 85 + 82 + 69 + 68 + 61 + 53 + 44 + 86 + 66 + 84 + 95 + 82 + 69 + 76 + 82 + 69 + 80 + 95 + 85 + 78 + 83 + 84 + 82 + 85 + 67 + 84 + 85 + 82 + 69 + 68 + 61 + 54 + 44 + 86 + 66 + 84 + 95 + 82 + 69 + 76 + 82 + 69 + 80 + 95 + 65 + 82 + 66 + 73 + 84 + 82 + 65 + 82 + 89 + 95 + 82 + 61 + 55 + 44 + 86 + 66 + 84 + 95 + 82 + 69 + 76 + 82 + 69 + 80 + 95 + 65 + 82 + 66 + 73 + 84 + 82 + 65 + 82 + 89 + 95 + 68 + 82 + 61 + 56 + 44 + 86 + 66 + 84 + 95 + 82 + 69 + 76 + 82 + 69 + 80 + 95 + 65 + 78 + 89 + 61 + 45 + 49 + 44 + 86 + 66 + 84 + 95 + 82 + 69 + 76 + 82 + 69 + 80 + 95 + 73 + 78 + 86 + 65 + 76 + 73 + 68 + 61 + 45 + 50 + 44 + 86 + 66 + 84 + 95 + 82 + 69 + 76 + 82 + 69 + 80 + 95 + 78 + 65 + 61 + 45 + 51 + 44 + 86 + 66 + 84 + 95 + 82 + 69 + 76 + 82 + 69 + 80 + 95 + 85 + 78 + 75 + 78 + 79 + 87 + 78 + 61 + 45 + 52 + 125 + 114 + 101 + 112 + 95 + 116 + 121 + 112 + 101 + 59 + 68 + 83 + 76 + 95 + 79 + 102 + 102 + 115 + 101 + 116 + 32 + 100 + 95 + 98 + 108 + 111 + 98 + 95 + 105 + 100 + 59 + 68 + 83 + 76 + 95 + 79 + 102 + 102 + 115 + 101 + 116 + 32 + 114 + 95 + 98 + 108 + 111 + 98 + 95 + 105 + 100 + 59 + 68 + 83 + 76 + 95 + 79 + 102 + 102 + 115 + 101 + 116 + 32 + 98 + 97 + 115 + 101 + 95 + 105 + 100 + 59 + 68 + 83 + 76 + 95 + 79 + 102 + 102 + 115 + 101 + 116 + 32 + 110 + 117 + 109 + 95 + 114 + 101 + 99 + 115 + 59 + 125 + 59 + 10 + 47 + 70 + 105 + 101 + 108 + 100 + 84 + 109 + 112 + 108 + 32 + 68 + 65 + 84 + 65 + 83 + 69 + 84 + 32 + 115 + 116 + 114 + 117 + 99 + 116 + 32 + 70 + 105 + 101 + 108 + 100 + 84 + 109 + 112 + 108 + 123 + 99 + 104 + 97 + 114 + 32 + 110 + 97 + 109 + 101 + 91 + 54 + 52 + 93 + 59 + 68 + 83 + 76 + 95 + 79 + 102 + 102 + 115 + 101 + 116 + 32 + 98 + 97 + 115 + 101 + 95 + 115 + 112 + 97 + 99 + 101 + 95 + 105 + 100 + 59 + 101 + 110 + 117 + 109 + 32 + 65 + 108 + 103 + 101 + 98 + 114 + 97 + 105 + 99 + 84 + 121 + 112 + 101 + 123 + 86 + 66 + 84 + 95 + 65 + 76 + 71 + 69 + 66 + 82 + 65 + 73 + 67 + 95 + 84 + 89 + 80 + 69 + 95 + 67 + 79 + 78 + 83 + 84 + 65 + 78 + 84 + 61 + 48 + 44 + 86 + 66 + 84 + 95 + 65 + 76 + 71 + 69 + 66 + 82 + 65 + 73 + 67 + 95 + 84 + 89 + 80 + 69 + 95 + 67 + 79 + 77 + 80 + 79 + 78 + 69 + 78 + 84 + 61 + 49 + 44 + 86 + 66 + 84 + 95 + 65 + 76 + 71 + 69 + 66 + 82 + 65 + 73 + 67 + 95 + 84 + 89 + 80 + 69 + 95 + 83 + 67 + 65 + 76 + 65 + 82 + 61 + 50 + 44 + 86 + 66 + 84 + 95 + 65 + 76 + 71 + 69 + 66 + 82 + 65 + 73 + 67 + 95 + 84 + 89 + 80 + 69 + 95 + 86 + 69 + 67 + 84 + 79 + 82 + 61 + 51 + 44 + 86 + 66 + 84 + 95 + 65 + 76 + 71 + 69 + 66 + 82 + 65 + 73 + 67 + 95 + 84 + 89 + 80 + 69 + 95 + 84 + 69 + 78 + 83 + 79 + 82 + 61 + 52 + 44 + 86 + 66 + 84 + 95 + 65 + 76 + 71 + 69 + 66 + 82 + 65 + 73 + 67 + 95 + 84 + 89 + 80 + 69 + 95 + 83 + 89 + 77 + 95 + 84 + 69 + 78 + 83 + 79 + 82 + 61 + 53 + 44 + 86 + 66 + 84 + 95 + 65 + 76 + 71 + 69 + 66 + 82 + 65 + 73 + 67 + 95 + 84 + 89 + 80 + 69 + 95 + 70 + 73 + 69 + 76 + 68 + 61 + 54 + 44 + 86 + 66 + 84 + 95 + 65 + 76 + 71 + 69 + 66 + 82 + 65 + 73 + 67 + 95 + 84 + 89 + 80 + 69 + 95 + 83 + 84 + 65 + 84 + 69 + 61 + 55 + 44 + 86 + 66 + 84 + 95 + 65 + 76 + 71 + 69 + 66 + 82 + 65 + 73 + 67 + 95 + 84 + 89 + 80 + 69 + 95 + 84 + 85 + 80 + 76 + 69 + 61 + 56 + 44 + 86 + 66 + 84 + 95 + 65 + 76 + 71 + 69 + 66 + 82 + 65 + 73 + 67 + 95 + 84 + 89 + 80 + 69 + 95 + 65 + 78 + 89 + 61 + 45 + 49 + 44 + 86 + 66 + 84 + 95 + 65 + 76 + 71 + 69 + 66 + 82 + 65 + 73 + 67 + 95 + 84 + 89 + 80 + 69 + 95 + 73 + 78 + 86 + 65 + 76 + 73 + 68 + 61 + 45 + 50 + 44 + 86 + 66 + 84 + 95 + 65 + 76 + 71 + 69 + 66 + 82 + 65 + 73 + 67 + 95 + 84 + 89 + 80 + 69 + 95 + 78 + 65 + 61 + 45 + 51 + 44 + 86 + 66 + 84 + 95 + 65 + 76 + 71 + 69 + 66 + 82 + 65 + 73 + 67 + 95 + 84 + 89 + 80 + 69 + 95 + 85 + 78 + 75 + 78 + 79 + 87 + 78 + 61 + 45 + 52 + 125 + 97 + 108 + 103 + 95 + 116 + 121 + 112 + 101 + 59 + 101 + 110 + 117 + 109 + 32 + 66 + 97 + 115 + 105 + 115 + 84 + 121 + 112 + 101 + 123 + 86 + 66 + 84 + 95 + 66 + 65 + 83 + 73 + 83 + 95 + 84 + 89 + 80 + 69 + 95 + 85 + 78 + 73 + 84 + 89 + 61 + 48 + 44 + 86 + 66 + 84 + 95 + 66 + 65 + 83 + 73 + 83 + 95 + 84 + 89 + 80 + 69 + 95 + 67 + 65 + 82 + 84 + 69 + 83 + 73 + 65 + 78 + 61 + 49 + 44 + 86 + 66 + 84 + 95 + 66 + 65 + 83 + 73 + 83 + 95 + 84 + 89 + 80 + 69 + 95 + 83 + 80 + 72 + 69 + 82 + 73 + 67 + 65 + 76 + 61 + 50 + 44 + 86 + 66 + 84 + 95 + 66 + 65 + 83 + 73 + 83 + 95 + 84 + 89 + 80 + 69 + 95 + 67 + 89 + 76 + 73 + 78 + 68 + 82 + 73 + 67 + 65 + 76 + 61 + 51 + 44 + 86 + 66 + 84 + 95 + 66 + 65 + 83 + 73 + 83 + 95 + 84 + 89 + 80 + 69 + 95 + 85 + 80 + 80 + 69 + 82 + 95 + 84 + 82 + 73 + 61 + 52 + 44 + 86 + 66 + 84 + 95 + 66 + 65 + 83 + 73 + 83 + 95 + 84 + 89 + 80 + 69 + 95 + 70 + 79 + 85 + 82 + 73 + 69 + 82 + 61 + 53 + 44 + 86 + 66 + 84 + 95 + 66 + 65 + 83 + 73 + 83 + 95 + 84 + 89 + 80 + 69 + 95 + 86 + 65 + 82 + 73 + 65 + 66 + 76 + 69 + 61 + 54 + 44 + 86 + 66 + 84 + 95 + 66 + 65 + 83 + 73 + 83 + 95 + 84 + 89 + 80 + 69 + 95 + 65 + 78 + 89 + 61 + 45 + 49 + 44 + 86 + 66 + 84 + 95 + 66 + 65 + 83 + 73 + 83 + 95 + 84 + 89 + 80 + 69 + 95 + 73 + 78 + 86 + 65 + 76 + 73 + 68 + 61 + 45 + 50 + 44 + 86 + 66 + 84 + 95 + 66 + 65 + 83 + 73 + 83 + 95 + 84 + 89 + 80 + 69 + 95 + 78 + 65 + 61 + 45 + 51 + 44 + 86 + 66 + 84 + 95 + 66 + 65 + 83 + 73 + 83 + 95 + 84 + 89 + 80 + 69 + 95 + 85 + 78 + 75 + 78 + 79 + 87 + 78 + 61 + 45 + 52 + 125 + 98 + 97 + 115 + 105 + 115 + 59 + 68 + 83 + 76 + 95 + 79 + 102 + 102 + 115 + 101 + 116 + 32 + 113 + 117 + 97 + 110 + 116 + 105 + 116 + 121 + 95 + 105 + 100 + 59 + 105 + 110 + 116 + 32 + 110 + 117 + 109 + 95 + 99 + 111 + 109 + 112 + 115 + 59 + 68 + 83 + 76 + 95 + 79 + 102 + 102 + 115 + 101 + 116 + 32 + 102 + 116 + 109 + 112 + 108 + 95 + 105 + 100 + 115 + 95 + 98 + 108 + 111 + 98 + 95 + 105 + 100 + 59 + 68 + 83 + 76 + 95 + 79 + 102 + 102 + 115 + 101 + 116 + 32 + 98 + 97 + 115 + 101 + 95 + 105 + 100 + 59 + 68 + 83 + 76 + 95 + 79 + 102 + 102 + 115 + 101 + 116 + 32 + 110 + 117 + 109 + 95 + 114 + 101 + 99 + 115 + 59 + 125 + 59 + 10 + 47 + 70 + 105 + 101 + 108 + 100 + 32 + 68 + 65 + 84 + 65 + 83 + 69 + 84 + 32 + 115 + 116 + 114 + 117 + 99 + 116 + 32 + 70 + 105 + 101 + 108 + 100 + 123 + 68 + 83 + 76 + 95 + 79 + 102 + 102 + 115 + 101 + 116 + 32 + 102 + 116 + 109 + 112 + 108 + 95 + 105 + 100 + 59 + 99 + 104 + 97 + 114 + 32 + 110 + 97 + 109 + 101 + 91 + 54 + 52 + 93 + 59 + 68 + 83 + 76 + 95 + 79 + 102 + 102 + 115 + 101 + 116 + 32 + 117 + 110 + 105 + 116 + 115 + 95 + 105 + 100 + 59 + 68 + 83 + 76 + 95 + 79 + 102 + 102 + 115 + 101 + 116 + 32 + 115 + 116 + 111 + 114 + 97 + 103 + 101 + 95 + 100 + 101 + 99 + 111 + 109 + 112 + 95 + 99 + 97 + 116 + 95 + 105 + 100 + 59 + 101 + 110 + 117 + 109 + 32 + 73 + 110 + 116 + 101 + 114 + 108 + 101 + 97 + 118 + 101 + 123 + 86 + 66 + 84 + 95 + 73 + 78 + 84 + 69 + 82 + 76 + 69 + 65 + 86 + 69 + 95 + 67 + 79 + 77 + 80 + 79 + 78 + 69 + 78 + 84 + 61 + 48 + 44 + 86 + 66 + 84 + 95 + 73 + 78 + 84 + 69 + 82 + 76 + 69 + 65 + 86 + 69 + 95 + 86 + 69 + 67 + 84 + 79 + 82 + 61 + 49 + 44 + 86 + 66 + 84 + 95 + 73 + 78 + 84 + 69 + 82 + 76 + 69 + 65 + 86 + 69 + 95 + 73 + 78 + 68 + 69 + 80 + 69 + 78 + 68 + 69 + 78 + 84 + 61 + 50 + 44 + 86 + 66 + 84 + 95 + 73 + 78 + 84 + 69 + 82 + 76 + 69 + 65 + 86 + 69 + 95 + 78 + 79 + 78 + 69 + 61 + 51 + 44 + 86 + 66 + 84 + 95 + 73 + 78 + 84 + 69 + 82 + 76 + 69 + 65 + 86 + 69 + 95 + 65 + 78 + 89 + 61 + 45 + 49 + 44 + 86 + 66 + 84 + 95 + 73 + 78 + 84 + 69 + 82 + 76 + 69 + 65 + 86 + 69 + 95 + 73 + 78 + 86 + 65 + 76 + 73 + 68 + 61 + 45 + 50 + 44 + 86 + 66 + 84 + 95 + 73 + 78 + 84 + 69 + 82 + 76 + 69 + 65 + 86 + 69 + 95 + 78 + 65 + 61 + 45 + 51 + 44 + 86 + 66 + 84 + 95 + 73 + 78 + 84 + 69 + 82 + 76 + 69 + 65 + 86 + 69 + 95 + 85 + 78 + 75 + 78 + 79 + 87 + 78 + 61 + 45 + 52 + 125 + 99 + 111 + 109 + 112 + 95 + 105 + 110 + 116 + 108 + 118 + 59 + 68 + 83 + 76 + 95 + 79 + 102 + 102 + 115 + 101 + 116 + 32 + 105 + 110 + 100 + 101 + 120 + 105 + 110 + 103 + 95 + 105 + 100 + 59 + 68 + 83 + 76 + 95 + 79 + 102 + 102 + 115 + 101 + 116 + 32 + 100 + 111 + 102 + 95 + 97 + 115 + 115 + 111 + 99 + 95 + 99 + 97 + 116 + 95 + 105 + 100 + 59 + 105 + 110 + 116 + 32 + 97 + 115 + 115 + 111 + 99 + 95 + 114 + 97 + 116 + 105 + 111 + 59 + 68 + 83 + 76 + 95 + 79 + 102 + 102 + 115 + 101 + 116 + 32 + 101 + 118 + 97 + 108 + 95 + 100 + 101 + 99 + 111 + 109 + 112 + 95 + 99 + 97 + 116 + 95 + 105 + 100 + 59 + 101 + 110 + 117 + 109 + 32 + 69 + 118 + 97 + 108 + 70 + 117 + 110 + 99 + 123 + 86 + 66 + 84 + 95 + 69 + 86 + 65 + 76 + 95 + 70 + 85 + 78 + 67 + 95 + 67 + 79 + 78 + 83 + 84 + 65 + 78 + 84 + 61 + 48 + 44 + 86 + 66 + 84 + 95 + 69 + 86 + 65 + 76 + 95 + 70 + 85 + 78 + 67 + 95 + 85 + 78 + 73 + 70 + 79 + 82 + 77 + 61 + 49 + 44 + 86 + 66 + 84 + 95 + 69 + 86 + 65 + 76 + 95 + 70 + 85 + 78 + 67 + 95 + 80 + 87 + 67 + 79 + 78 + 83 + 84 + 61 + 50 + 44 + 86 + 66 + 84 + 95 + 69 + 86 + 65 + 76 + 95 + 70 + 85 + 78 + 67 + 95 + 80 + 87 + 76 + 73 + 78 + 69 + 65 + 82 + 61 + 51 + 44 + 86 + 66 + 84 + 95 + 69 + 86 + 65 + 76 + 95 + 70 + 85 + 78 + 67 + 95 + 65 + 78 + 89 + 61 + 45 + 49 + 44 + 86 + 66 + 84 + 95 + 69 + 86 + 65 + 76 + 95 + 70 + 85 + 78 + 67 + 95 + 73 + 78 + 86 + 65 + 76 + 73 + 68 + 61 + 45 + 50 + 44 + 86 + 66 + 84 + 95 + 69 + 86 + 65 + 76 + 95 + 70 + 85 + 78 + 67 + 95 + 78 + 65 + 61 + 45 + 51 + 44 + 86 + 66 + 84 + 95 + 69 + 86 + 65 + 76 + 95 + 70 + 85 + 78 + 67 + 95 + 85 + 78 + 75 + 78 + 79 + 87 + 78 + 61 + 45 + 52 + 125 + 101 + 118 + 97 + 108 + 95 + 102 + 117 + 110 + 99 + 59 + 105 + 110 + 116 + 32 + 105 + 115 + 95 + 104 + 111 + 109 + 111 + 103 + 101 + 110 + 101 + 111 + 117 + 115 + 59 + 105 + 110 + 116 + 32 + 105 + 115 + 95 + 99 + 111 + 111 + 114 + 100 + 95 + 102 + 105 + 101 + 108 + 100 + 59 + 68 + 83 + 76 + 95 + 79 + 102 + 102 + 115 + 101 + 116 + 32 + 99 + 111 + 109 + 112 + 95 + 105 + 100 + 115 + 95 + 98 + 108 + 111 + 98 + 95 + 105 + 100 + 59 + 68 + 83 + 76 + 95 + 79 + 102 + 102 + 115 + 101 + 116 + 32 + 99 + 111 + 109 + 112 + 95 + 111 + 114 + 100 + 101 + 114 + 95 + 98 + 108 + 111 + 98 + 95 + 105 + 100 + 59 + 68 + 83 + 76 + 95 + 79 + 102 + 102 + 115 + 101 + 116 + 32 + 118 + 98 + 97 + 115 + 105 + 115 + 95 + 98 + 108 + 111 + 98 + 95 + 105 + 100 + 59 + 68 + 83 + 76 + 95 + 79 + 102 + 102 + 115 + 101 + 116 + 32 + 100 + 111 + 102 + 95 + 98 + 108 + 111 + 98 + 95 + 105 + 100 + 59 + 68 + 83 + 76 + 95 + 79 + 102 + 102 + 115 + 101 + 116 + 32 + 98 + 97 + 115 + 101 + 95 + 105 + 100 + 59 + 68 + 83 + 76 + 95 + 79 + 102 + 102 + 115 + 101 + 116 + 32 + 110 + 117 + 109 + 95 + 114 + 101 + 99 + 115 + 59 + 125 + 59 + 10 + 47 + 109 + 101 + 116 + 97 + 98 + 108 + 111 + 98 + 48 + 48 + 48 + 48 + 48 + 46 + 105 + 110 + 100 + 101 + 120 + 32 + 68 + 65 + 84 + 65 + 83 + 69 + 84 + 32 + 115 + 116 + 114 + 117 + 99 + 116 + 32 + 73 + 110 + 100 + 101 + 120 + 80 + 97 + 105 + 114 + 123 + 68 + 83 + 76 + 95 + 79 + 102 + 102 + 115 + 101 + 116 + 32 + 105 + 110 + 100 + 101 + 120 + 59 + 105 + 110 + 116 + 32 + 108 + 101 + 110 + 103 + 116 + 104 + 59 + 125 + 59 + 10 + 47 + 109 + 101 + 116 + 97 + 98 + 108 + 111 + 98 + 48 + 48 + 48 + 48 + 48 + 46 + 98 + 108 + 111 + 98 + 32 + 68 + 65 + 84 + 65 + 83 + 69 + 84 + 32 + 68 + 83 + 76 + 95 + 79 + 102 + 102 + 115 + 101 + 116 + 59 + 10 @@ -313,9 +5954,9 @@ Expected output for 'h5dump --xml tsaf.h5' - + - + @@ -606,7 +6247,7 @@ Expected output for 'h5dump --xml tsaf.h5' - + @@ -670,12 +6311,30 @@ Expected output for 'h5dump --xml tsaf.h5' - -1 1 0 1 9 0 1 -1 2 0 1 4 1 1 -1 3 0 1 7 2 1 -1 4 0 1 4 3 1 - -1 5 0 1 5 4 1 -1 6 0 1 3 5 1 -1 7 0 1 4 6 1 -1 8 0 1 1 7 1 - -1 9 0 1 10 8 1 -1 10 0 1 4 9 1 -1 11 0 1 3 10 1 -1 12 0 1 5 11 1 - -1 13 0 1 5 12 1 -1 14 0 1 16 13 1 -1 15 0 1 9 14 1 -1 16 0 1 4 15 1 - -1 17 0 1 16 16 1 -1 18 0 1 36 17 1 -1 19 0 1 5 18 1 -1 20 0 1 5 19 1 - -1 21 0 1 36 20 1 -1 22 0 1 12 21 1 -1 23 0 1 7 22 1 -1 24 0 1 2 23 1 + -1 1 0 1 9 0 1 + -1 2 0 1 4 1 1 + -1 3 0 1 7 2 1 + -1 4 0 1 4 3 1 + -1 5 0 1 5 4 1 + -1 6 0 1 3 5 1 + -1 7 0 1 4 6 1 + -1 8 0 1 1 7 1 + -1 9 0 1 10 8 1 + -1 10 0 1 4 9 1 + -1 11 0 1 3 10 1 + -1 12 0 1 5 11 1 + -1 13 0 1 5 12 1 + -1 14 0 1 16 13 1 + -1 15 0 1 9 14 1 + -1 16 0 1 4 15 1 + -1 17 0 1 16 16 1 + -1 18 0 1 36 17 1 + -1 19 0 1 5 18 1 + -1 20 0 1 5 19 1 + -1 21 0 1 36 20 1 + -1 22 0 1 12 21 1 + -1 23 0 1 7 22 1 + -1 24 0 1 2 23 1 @@ -689,7 +6348,7 @@ Expected output for 'h5dump --xml tsaf.h5' - + @@ -823,8 +6482,11 @@ Expected output for 'h5dump --xml tsaf.h5' - "nodes" TOPO 0 0 1 "elems" TOPO 2 1 1 "edges" USERD 1 2 1 - "blocks" BLOCK 2 3 1 "side_sets" USERD 1 4 1 + "nodes" TOPO 0 0 1 + "elems" TOPO 2 1 1 + "edges" USERD 1 2 1 + "blocks" BLOCK 2 3 1 + "side_sets" USERD 1 4 1 @@ -838,7 +6500,7 @@ Expected output for 'h5dump --xml tsaf.h5' - + @@ -1042,15 +6704,30 @@ Expected output for 'h5dump --xml tsaf.h5' - 0 0 POINT 18 0 0 -2 0 1 0 1 MIXED 12 1 1 -2 1 1 0 3 NONE 4 2 1 0 2 1 - 0 4 NONE 2 3 0 1 3 1 1 0 POINT 9 4 0 -2 4 1 1 1 QUAD 4 5 1 -2 5 1 - 1 3 NONE 1 6 1 2 6 1 2 0 POINT 7 7 0 -2 7 1 2 1 MIXED 4 8 1 -2 8 1 - 2 3 NONE 2 9 1 3 9 1 3 0 POINT 10 10 0 -2 10 1 3 1 QUAD 4 11 1 -2 11 1 - 3 3 NONE 1 12 1 4 12 1 4 0 POINT 3 13 0 -2 13 1 4 2 LINE 2 14 1 -2 14 1 - 5 0 POINT 5 15 0 -2 15 1 5 2 LINE 4 16 1 -2 16 1 - 6 0 POINT 5 17 1 -2 17 1 7 0 POINT 5 18 0 -2 18 1 - 7 1 TRI 3 19 1 -2 19 1 7 3 NONE 1 20 1 5 20 1 8 0 POINT 4 21 0 -2 21 1 - 8 1 QUAD 1 22 1 -2 22 1 8 3 NONE 1 23 1 6 23 1 + 0 0 POINT 18 0 0 -2 0 1 + 0 1 MIXED 12 1 1 -2 1 1 + 0 3 NONE 4 2 1 0 2 1 + 0 4 NONE 2 3 0 1 3 1 + 1 0 POINT 9 4 0 -2 4 1 + 1 1 QUAD 4 5 1 -2 5 1 + 1 3 NONE 1 6 1 2 6 1 + 2 0 POINT 7 7 0 -2 7 1 + 2 1 MIXED 4 8 1 -2 8 1 + 2 3 NONE 2 9 1 3 9 1 + 3 0 POINT 10 10 0 -2 10 1 + 3 1 QUAD 4 11 1 -2 11 1 + 3 3 NONE 1 12 1 4 12 1 + 4 0 POINT 3 13 0 -2 13 1 + 4 2 LINE 2 14 1 -2 14 1 + 5 0 POINT 5 15 0 -2 15 1 + 5 2 LINE 4 16 1 -2 16 1 + 6 0 POINT 5 17 1 -2 17 1 + 7 0 POINT 5 18 0 -2 18 1 + 7 1 TRI 3 19 1 -2 19 1 + 7 3 NONE 1 20 1 5 20 1 + 8 0 POINT 4 21 0 -2 21 1 + 8 1 QUAD 1 22 1 -2 22 1 + 8 3 NONE 1 23 1 6 23 1 @@ -1064,7 +6741,7 @@ Expected output for 'h5dump --xml tsaf.h5' - + @@ -1340,7 +7017,7 @@ Expected output for 'h5dump --xml tsaf.h5' - + @@ -1595,7 +7272,7 @@ Expected output for 'h5dump --xml tsaf.h5' - + @@ -1734,30 +7411,30 @@ Expected output for 'h5dump --xml tsaf.h5' - 1 0 0 0 0 0 0 0 0 18 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C_ORDER 0 1 - 1 0 0 0 0 0 0 0 0 12 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C_ORDER 1 1 - 1 0 0 0 0 0 0 0 0 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C_ORDER 2 1 - 1 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C_ORDER 3 1 - 1 0 0 0 0 0 0 0 0 9 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C_ORDER 4 1 - 1 0 0 0 0 0 0 0 0 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C_ORDER 5 1 - 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C_ORDER 6 1 - 1 0 0 0 0 0 0 0 0 7 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C_ORDER 7 1 - 1 0 0 0 0 0 0 0 0 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C_ORDER 8 1 - 1 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C_ORDER 9 1 - 1 0 0 0 0 0 0 0 0 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C_ORDER 10 1 - 1 0 0 0 0 0 0 0 0 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C_ORDER 11 1 - 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C_ORDER 12 1 - 1 0 0 0 0 0 0 0 0 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C_ORDER 13 1 - 1 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C_ORDER 14 1 - 1 0 0 0 0 0 0 0 0 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C_ORDER 15 1 - 1 0 0 0 0 0 0 0 0 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C_ORDER 16 1 - 1 0 0 0 0 0 0 0 0 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C_ORDER 17 1 - 1 0 0 0 0 0 0 0 0 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C_ORDER 18 1 - 1 0 0 0 0 0 0 0 0 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C_ORDER 19 1 - 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C_ORDER 20 1 - 1 0 0 0 0 0 0 0 0 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C_ORDER 21 1 - 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C_ORDER 22 1 - 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C_ORDER 23 1 + 1 0 0 0 0 0 0 0 0 18 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C_ORDER 0 1 + 1 0 0 0 0 0 0 0 0 12 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C_ORDER 1 1 + 1 0 0 0 0 0 0 0 0 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C_ORDER 2 1 + 1 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C_ORDER 3 1 + 1 0 0 0 0 0 0 0 0 9 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C_ORDER 4 1 + 1 0 0 0 0 0 0 0 0 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C_ORDER 5 1 + 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C_ORDER 6 1 + 1 0 0 0 0 0 0 0 0 7 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C_ORDER 7 1 + 1 0 0 0 0 0 0 0 0 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C_ORDER 8 1 + 1 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C_ORDER 9 1 + 1 0 0 0 0 0 0 0 0 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C_ORDER 10 1 + 1 0 0 0 0 0 0 0 0 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C_ORDER 11 1 + 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C_ORDER 12 1 + 1 0 0 0 0 0 0 0 0 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C_ORDER 13 1 + 1 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C_ORDER 14 1 + 1 0 0 0 0 0 0 0 0 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C_ORDER 15 1 + 1 0 0 0 0 0 0 0 0 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C_ORDER 16 1 + 1 0 0 0 0 0 0 0 0 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C_ORDER 17 1 + 1 0 0 0 0 0 0 0 0 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C_ORDER 18 1 + 1 0 0 0 0 0 0 0 0 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C_ORDER 19 1 + 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C_ORDER 20 1 + 1 0 0 0 0 0 0 0 0 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C_ORDER 21 1 + 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C_ORDER 22 1 + 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C_ORDER 23 1 @@ -1771,7 +7448,7 @@ Expected output for 'h5dump --xml tsaf.h5' - + @@ -2026,11 +7703,16 @@ Expected output for 'h5dump --xml tsaf.h5' - 1 0 -2 0 0 -2 EQUAL TLIST -2 0 0 1 1 1 -2 0 1 -2 EQUAL TLIST -2 1 1 1 - 2 0 -2 0 0 -2 EQUAL TLIST -2 2 2 1 2 1 -2 0 1 -2 EQUAL TLIST -2 3 3 1 - 7 0 -2 0 0 -2 EQUAL TLIST -2 4 4 1 7 1 -2 0 1 -2 EQUAL TLIST -2 5 5 1 - 8 0 -2 0 0 -2 EQUAL TLIST -2 6 6 1 8 1 -2 0 1 -2 EQUAL TLIST -2 7 7 1 - 3 0 -2 0 0 -2 EQUAL TLIST -2 8 8 1 3 1 -2 0 1 -2 EQUAL TLIST -2 9 9 1 + 1 0 -2 0 0 -2 EQUAL TLIST -2 0 0 1 + 1 1 -2 0 1 -2 EQUAL TLIST -2 1 1 1 + 2 0 -2 0 0 -2 EQUAL TLIST -2 2 2 1 + 2 1 -2 0 1 -2 EQUAL TLIST -2 3 3 1 + 7 0 -2 0 0 -2 EQUAL TLIST -2 4 4 1 + 7 1 -2 0 1 -2 EQUAL TLIST -2 5 5 1 + 8 0 -2 0 0 -2 EQUAL TLIST -2 6 6 1 + 8 1 -2 0 1 -2 EQUAL TLIST -2 7 7 1 + 3 0 -2 0 0 -2 EQUAL TLIST -2 8 8 1 + 3 1 -2 0 1 -2 EQUAL TLIST -2 9 9 1 4 0 -2 0 0 -2 EQUAL TLIST -2 10 10 1 5 0 -2 0 0 -2 EQUAL TLIST -2 11 11 1 6 0 -2 0 0 -2 EQUAL TLIST -2 12 12 1 @@ -2055,7 +7737,7 @@ Expected output for 'h5dump --xml tsaf.h5' - + @@ -2230,15 +7912,15 @@ Expected output for 'h5dump --xml tsaf.h5' - 0 "TOP_CELL" 2 SPACE 0 1 -2 2 3 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 1 0 -2 -2 0 1 - 0 "CELL_1" 2 SPACE 4 5 -2 6 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 0 0 -2 -2 1 1 - 0 "CELL_2" 2 SPACE 7 8 -2 9 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 0 0 -2 -2 2 1 - 0 "CELL_3" 2 SPACE 10 11 -2 12 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 0 0 -2 -2 3 1 - 0 "SIDE_SET_1" 1 SPACE 13 -2 14 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 0 0 -2 -2 4 1 - 0 "SIDE_SET_2" 1 SPACE 15 -2 16 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 0 0 -2 -2 5 1 - 0 "NODE_SET_1" 0 SPACE 17 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 0 0 -2 -2 6 1 - 0 "CELL_2_TRIS" 2 SPACE 18 19 -2 20 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 0 0 -2 -2 7 1 - 0 "CELL_2_QUADS" 2 SPACE 21 22 -2 23 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 0 0 -2 -2 8 1 + 0 "TOP_CELL" 2 SPACE 0 1 -2 2 3 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 1 0 -2 -2 0 1 + 0 "CELL_1" 2 SPACE 4 5 -2 6 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 0 0 -2 -2 1 1 + 0 "CELL_2" 2 SPACE 7 8 -2 9 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 0 0 -2 -2 2 1 + 0 "CELL_3" 2 SPACE 10 11 -2 12 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 0 0 -2 -2 3 1 + 0 "SIDE_SET_1" 1 SPACE 13 -2 14 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 0 0 -2 -2 4 1 + 0 "SIDE_SET_2" 1 SPACE 15 -2 16 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 0 0 -2 -2 5 1 + 0 "NODE_SET_1" 0 SPACE 17 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 0 0 -2 -2 6 1 + 0 "CELL_2_TRIS" 2 SPACE 18 19 -2 20 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 0 0 -2 -2 7 1 + 0 "CELL_2_QUADS" 2 SPACE 21 22 -2 23 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 0 0 -2 -2 8 1 @@ -2246,9 +7928,9 @@ Expected output for 'h5dump --xml tsaf.h5' - + - + @@ -2263,8 +7945,42 @@ Expected output for 'h5dump --xml tsaf.h5' - 0 4 1 4 2 4 2.5 4 0 3 1 3 2 3 2.5 3 0 2 1 2 2 2 2.5 2 0 1 2 1 2.5 1 0 0 - 2 0 2.5 0 + 0 + 4 + 1 + 4 + 2 + 4 + 2.5 + 4 + 0 + 3 + 1 + 3 + 2 + 3 + 2.5 + 3 + 0 + 2 + 1 + 2 + 2 + 2 + 2.5 + 2 + 0 + 1 + 2 + 1 + 2.5 + 1 + 0 + 0 + 2 + 0 + 2.5 + 0 @@ -2272,9 +7988,9 @@ Expected output for 'h5dump --xml tsaf.h5' - + - + @@ -2289,9 +8005,42 @@ Expected output for 'h5dump --xml tsaf.h5' - 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 - 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 - 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25 + 0.25 + 0.25 + 0.25 + 0.25 + 0.25 + 0.25 + 0.25 + 0.25 + 0.25 + 0.25 + 0.25 + 0.25 + 0.25 + 0.25 + 0.25 + 0.25 + 0.25 + 0.25 + 0.25 + 0.25 + 0.25 + 0.25 + 0.25 + 0.25 + 0.25 + 0.25 + 0.25 + 0.25 + 0.25 + 0.25 + 0.25 + 0.25 + 0.25 + 0.25 + 0.25 + 0.25 @@ -2299,9 +8048,9 @@ Expected output for 'h5dump --xml tsaf.h5' - + - + @@ -2316,7 +8065,11 @@ Expected output for 'h5dump --xml tsaf.h5' - 4 3 2 1 0 + 4 + 3 + 2 + 1 + 0 @@ -2324,9 +8077,9 @@ Expected output for 'h5dump --xml tsaf.h5' - + - + @@ -2341,7 +8094,8 @@ Expected output for 'h5dump --xml tsaf.h5' - 45 55 + 45 + 55 @@ -2349,9 +8103,9 @@ Expected output for 'h5dump --xml tsaf.h5' - + - + @@ -2366,7 +8120,18 @@ Expected output for 'h5dump --xml tsaf.h5' - 0.5 0.25 0.5 0.5 0.25 0.5 0.5 0.25 0.5 0.5 0.25 0.5 + 0.5 + 0.25 + 0.5 + 0.5 + 0.25 + 0.5 + 0.5 + 0.25 + 0.5 + 0.5 + 0.25 + 0.5 @@ -2374,9 +8139,9 @@ Expected output for 'h5dump --xml tsaf.h5' - + - + @@ -2391,7 +8156,11 @@ Expected output for 'h5dump --xml tsaf.h5' - 100 150 150 100 75 + 100 + 150 + 150 + 100 + 75 @@ -2399,9 +8168,9 @@ Expected output for 'h5dump --xml tsaf.h5' - + - + @@ -2416,7 +8185,13 @@ Expected output for 'h5dump --xml tsaf.h5' - 75 95 120 80 115 85 110 + 75 + 95 + 120 + 80 + 115 + 85 + 110 @@ -2430,7 +8205,7 @@ Expected output for 'h5dump --xml tsaf.h5' - + @@ -2445,7 +8220,25 @@ Expected output for 'h5dump --xml tsaf.h5' - 1 7 8 3 -2 -2 -2 -2 -2 -2 -2 -2 0 1 5 6 8 9 10 + 1 + 7 + 8 + 3 + -2 + -2 + -2 + -2 + -2 + -2 + -2 + -2 + 0 + 1 + 5 + 6 + 8 + 9 + 10 @@ -2459,7 +8252,7 @@ Expected output for 'h5dump --xml tsaf.h5' - + @@ -2488,7 +8281,16 @@ Expected output for 'h5dump --xml tsaf.h5' - 0 4 4 2 6 1 7 2 9 1 10 1 11 1 12 2 14 2 16 3 + 0 4 + 4 2 + 6 1 + 7 2 + 9 1 + 10 1 + 11 1 + 12 2 + 14 2 + 16 3 @@ -2496,9 +8298,9 @@ Expected output for 'h5dump --xml tsaf.h5' - + - + @@ -2513,7 +8315,15 @@ Expected output for 'h5dump --xml tsaf.h5' - 1 2 3 5 6 7 9 10 11 + 1 + 2 + 3 + 5 + 6 + 7 + 9 + 10 + 11 @@ -2521,9 +8331,9 @@ Expected output for 'h5dump --xml tsaf.h5' - + - + @@ -2538,7 +8348,10 @@ Expected output for 'h5dump --xml tsaf.h5' - 1 2 4 5 + 1 + 2 + 4 + 5 @@ -2546,9 +8359,9 @@ Expected output for 'h5dump --xml tsaf.h5' - + - + @@ -2563,7 +8376,13 @@ Expected output for 'h5dump --xml tsaf.h5' - 9 10 11 13 14 16 17 + 9 + 10 + 11 + 13 + 14 + 16 + 17 @@ -2571,9 +8390,9 @@ Expected output for 'h5dump --xml tsaf.h5' - + - + @@ -2588,7 +8407,10 @@ Expected output for 'h5dump --xml tsaf.h5' - 7 8 9 11 + 7 + 8 + 9 + 11 @@ -2596,9 +8418,9 @@ Expected output for 'h5dump --xml tsaf.h5' - + - + @@ -2613,7 +8435,11 @@ Expected output for 'h5dump --xml tsaf.h5' - 9 10 11 13 14 + 9 + 10 + 11 + 13 + 14 @@ -2621,9 +8447,9 @@ Expected output for 'h5dump --xml tsaf.h5' - + - + @@ -2638,7 +8464,9 @@ Expected output for 'h5dump --xml tsaf.h5' - 7 8 9 + 7 + 8 + 9 @@ -2646,9 +8474,9 @@ Expected output for 'h5dump --xml tsaf.h5' - + - + @@ -2663,7 +8491,10 @@ Expected output for 'h5dump --xml tsaf.h5' - 13 14 16 17 + 13 + 14 + 16 + 17 @@ -2671,9 +8502,9 @@ Expected output for 'h5dump --xml tsaf.h5' - + - + @@ -2696,9 +8527,9 @@ Expected output for 'h5dump --xml tsaf.h5' - + - + @@ -2713,7 +8544,16 @@ Expected output for 'h5dump --xml tsaf.h5' - 3 4 7 8 11 12 14 15 17 18 + 3 + 4 + 7 + 8 + 11 + 12 + 14 + 15 + 17 + 18 @@ -2721,9 +8561,9 @@ Expected output for 'h5dump --xml tsaf.h5' - + - + @@ -2738,7 +8578,10 @@ Expected output for 'h5dump --xml tsaf.h5' - 3 6 10 12 + 3 + 6 + 10 + 12 @@ -2746,9 +8589,9 @@ Expected output for 'h5dump --xml tsaf.h5' - + - + @@ -2763,7 +8606,9 @@ Expected output for 'h5dump --xml tsaf.h5' - 9 10 11 + 9 + 10 + 11 @@ -2771,9 +8616,9 @@ Expected output for 'h5dump --xml tsaf.h5' - + - + @@ -2788,7 +8633,11 @@ Expected output for 'h5dump --xml tsaf.h5' - 1 5 9 13 16 + 1 + 5 + 9 + 13 + 16 @@ -2796,9 +8645,9 @@ Expected output for 'h5dump --xml tsaf.h5' - + - + @@ -2813,7 +8662,11 @@ Expected output for 'h5dump --xml tsaf.h5' - 4 8 12 15 18 + 4 + 8 + 12 + 15 + 18 @@ -2821,9 +8674,9 @@ Expected output for 'h5dump --xml tsaf.h5' - + - + @@ -2838,7 +8691,22 @@ Expected output for 'h5dump --xml tsaf.h5' - 1 2 6 5 2 3 7 6 5 6 10 9 6 7 11 10 + 1 + 2 + 6 + 5 + 2 + 3 + 7 + 6 + 5 + 6 + 10 + 9 + 6 + 7 + 11 + 10 @@ -2846,9 +8714,9 @@ Expected output for 'h5dump --xml tsaf.h5' - + - + @@ -2863,7 +8731,15 @@ Expected output for 'h5dump --xml tsaf.h5' - 9 10 13 10 14 13 10 11 14 + 9 + 10 + 13 + 10 + 14 + 13 + 10 + 11 + 14 @@ -2871,9 +8747,9 @@ Expected output for 'h5dump --xml tsaf.h5' - + - + @@ -2888,7 +8764,10 @@ Expected output for 'h5dump --xml tsaf.h5' - 13 14 17 16 + 13 + 14 + 17 + 16 @@ -2896,9 +8775,9 @@ Expected output for 'h5dump --xml tsaf.h5' - + - + @@ -2913,7 +8792,22 @@ Expected output for 'h5dump --xml tsaf.h5' - 3 4 8 7 7 8 12 11 11 12 15 14 14 15 18 17 + 3 + 4 + 8 + 7 + 7 + 8 + 12 + 11 + 11 + 12 + 15 + 14 + 14 + 15 + 18 + 17 diff --git a/tools/testfiles/tsaf.ls b/tools/testfiles/tsaf.ls index 96d4811..c950d7d 100644 --- a/tools/testfiles/tsaf.ls +++ b/tools/testfiles/tsaf.ls @@ -1,6 +1,3 @@ -############################# - output for 'h5ls -w80 -r -d tsaf.h5' -############################# / Group /.DSL_METADATA Dataset {5919/Inf} Data: diff --git a/tools/testfiles/tscaleoffset.ddl b/tools/testfiles/tscaleoffset.ddl index 3428bfa..f1891da 100644 --- a/tools/testfiles/tscaleoffset.ddl +++ b/tools/testfiles/tscaleoffset.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump -H -p -d scaleoffset tfilters.h5' -############################# HDF5 "tfilters.h5" { DATASET "scaleoffset" { DATATYPE H5T_STD_I32LE @@ -8,13 +5,13 @@ DATASET "scaleoffset" { STORAGE_LAYOUT { CHUNKED ( 10, 5 ) SIZE 152 (5.263:1 COMPRESSION) - } + } FILTERS { COMPRESSION SCALEOFFSET { MIN BITS 4 } } FILLVALUE { FILL_TIME H5D_FILL_TIME_IFSET - VALUE 0 + VALUE 0 } ALLOCATION_TIME { H5D_ALLOC_TIME_INCR diff --git a/tools/testfiles/tshuffle.ddl b/tools/testfiles/tshuffle.ddl index 00f8e4a..cd1b5f8 100644 --- a/tools/testfiles/tshuffle.ddl +++ b/tools/testfiles/tshuffle.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump -H -p -d shuffle tfilters.h5' -############################# HDF5 "tfilters.h5" { DATASET "shuffle" { DATATYPE H5T_STD_I32LE @@ -8,13 +5,13 @@ DATASET "shuffle" { STORAGE_LAYOUT { CHUNKED ( 10, 5 ) SIZE 800 - } + } FILTERS { PREPROCESSING SHUFFLE } FILLVALUE { FILL_TIME H5D_FILL_TIME_IFSET - VALUE 0 + VALUE 0 } ALLOCATION_TIME { H5D_ALLOC_TIME_INCR diff --git a/tools/testfiles/tslink-1.ddl b/tools/testfiles/tslink-1.ddl index e0f24e0..d9df572 100644 --- a/tools/testfiles/tslink-1.ddl +++ b/tools/testfiles/tslink-1.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump tslink.h5' -############################# HDF5 "tslink.h5" { GROUP "/" { SOFTLINK "slink1" { diff --git a/tools/testfiles/tslink-1.ls b/tools/testfiles/tslink-1.ls index 6c3467a..7afc8a5 100644 --- a/tools/testfiles/tslink-1.ls +++ b/tools/testfiles/tslink-1.ls @@ -1,6 +1,3 @@ -############################# - output for 'h5ls -w80 -r tslink.h5' -############################# / Group /slink1 Soft Link {somevalue} /slink2 Soft Link {linkvalue} diff --git a/tools/testfiles/tslink-2.ddl b/tools/testfiles/tslink-2.ddl index 0672707..853c093 100644 --- a/tools/testfiles/tslink-2.ddl +++ b/tools/testfiles/tslink-2.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump -l slink2 tslink.h5' -############################# HDF5 "tslink.h5" { SOFTLINK "slink2" { LINKTARGET "linkvalue" diff --git a/tools/testfiles/tslink-D.ddl b/tools/testfiles/tslink-D.ddl new file mode 100644 index 0000000..a1d999a --- /dev/null +++ b/tools/testfiles/tslink-D.ddl @@ -0,0 +1,30 @@ +HDF5 "tslink.h5" { +SOFTLINK "/slink1" { + LINKTARGET "somevalue" +} +} +HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): + #000: (file name) line (number) in H5Dopen2(): not found + major: Dataset + minor: Object not found + #001: (file name) line (number) in H5G_loc_find(): can't find object + major: Symbol table + minor: Object not found + #002: (file name) line (number) in H5G_traverse(): internal path traversal failed + major: Symbol table + minor: Object not found + #003: (file name) line (number) in H5G_traverse_real(): special link traversal failed + major: Links + minor: Link traversal failure + #004: (file name) line (number) in H5G__traverse_special(): symbolic link traversal failed + major: Links + minor: Link traversal failure + #005: (file name) line (number) in H5G_traverse_slink(): unable to follow symbolic link + major: Symbol table + minor: Object not found + #006: (file name) line (number) in H5G_traverse_real(): traversal operator failed + major: Symbol table + minor: Callback failed + #007: (file name) line (number) in H5G_traverse_slink_cb(): component not found + major: Symbol table + minor: Object not found diff --git a/tools/testfiles/tslink.h5.xml b/tools/testfiles/tslink.h5.xml index f31f425..9d8040e 100644 --- a/tools/testfiles/tslink.h5.xml +++ b/tools/testfiles/tslink.h5.xml @@ -1,8 +1,5 @@ -############################# -Expected output for 'h5dump --xml tslink.h5' -############################# - + diff --git a/tools/testfiles/tsoftlinks-1.ls b/tools/testfiles/tsoftlinks-1.ls index fc57da9..d7d98a3 100644 --- a/tools/testfiles/tsoftlinks-1.ls +++ b/tools/testfiles/tsoftlinks-1.ls @@ -1,6 +1,3 @@ -############################# - output for 'h5ls --follow-symlinks tsoftlinks.h5' -############################# dset1 Dataset {4, 2} dset2 Dataset {4, 2} dtype Type diff --git a/tools/testfiles/tsoftlinks-2.ls b/tools/testfiles/tsoftlinks-2.ls index 3566f70..52c5265 100644 --- a/tools/testfiles/tsoftlinks-2.ls +++ b/tools/testfiles/tsoftlinks-2.ls @@ -1,6 +1,3 @@ -############################# - output for 'h5ls --follow-symlinks -r tsoftlinks.h5' -############################# / Group /dset1 Dataset {4, 2} /dset2 Dataset {4, 2} diff --git a/tools/testfiles/tsoftlinks-3.ls b/tools/testfiles/tsoftlinks-3.ls index 2face70..6b958ac 100644 --- a/tools/testfiles/tsoftlinks-3.ls +++ b/tools/testfiles/tsoftlinks-3.ls @@ -1,6 +1,3 @@ -############################# - output for 'h5ls --follow-symlinks tsoftlinks.h5/group1' -############################# soft_dangle Soft Link {not_yet} {**NOT FOUND**} soft_dset1 Soft Link {/dset1} {Dataset {4, 2}} soft_dset2 Soft Link {/dset2} {Dataset {4, 2}} diff --git a/tools/testfiles/tsoftlinks-4.ls b/tools/testfiles/tsoftlinks-4.ls index c1f4568..092d8a5 100644 --- a/tools/testfiles/tsoftlinks-4.ls +++ b/tools/testfiles/tsoftlinks-4.ls @@ -1,6 +1,3 @@ -############################# - output for 'h5ls --follow-symlinks -r tsoftlinks.h5/group1' -############################# /soft_dangle Soft Link {not_yet} {**NOT FOUND**} /soft_dset1 Soft Link {/dset1} {Dataset {4, 2}} /soft_dset2 Soft Link {/dset2} {Dataset {4, 2}} diff --git a/tools/testfiles/tsoftlinks-5.ls b/tools/testfiles/tsoftlinks-5.ls index 6e915e1..cc1f130 100644 --- a/tools/testfiles/tsoftlinks-5.ls +++ b/tools/testfiles/tsoftlinks-5.ls @@ -1,4 +1 @@ -############################# - output for 'h5ls --follow-symlinks tsoftlinks.h5/soft_dset1' -############################# soft_dset1 Soft Link {/dset1} {Dataset {4, 2}} diff --git a/tools/testfiles/tsoftlinks-nodangle-1.ls b/tools/testfiles/tsoftlinks-nodangle-1.ls index 6d639b7..d7d98a3 100644 --- a/tools/testfiles/tsoftlinks-nodangle-1.ls +++ b/tools/testfiles/tsoftlinks-nodangle-1.ls @@ -1,6 +1,3 @@ -############################# - output for 'h5ls -w80 --follow-symlinks --no-dangling-links tsoftlinks.h5' -############################# dset1 Dataset {4, 2} dset2 Dataset {4, 2} dtype Type diff --git a/tools/testfiles/tsplit_file.ddl b/tools/testfiles/tsplit_file.ddl index 691790c..9a1e22d 100644 --- a/tools/testfiles/tsplit_file.ddl +++ b/tools/testfiles/tsplit_file.ddl @@ -1,15 +1,12 @@ -############################# -Expected output for 'h5dump --filedriver=split tsplit_file' -############################# HDF5 "tsplit_file" { GROUP "/" { ATTRIBUTE "Metadata" { DATATYPE H5T_STRING { - STRSIZE 35; - STRPAD H5T_STR_NULLTERM; - CSET H5T_CSET_ASCII; - CTYPE H5T_C_S1; - } + STRSIZE 35; + STRPAD H5T_STR_NULLTERM; + CSET H5T_CSET_ASCII; + CTYPE H5T_C_S1; + } DATASPACE SIMPLE { ( 1 ) / ( 1 ) } DATA { (0): "this is some metadata on this file" diff --git a/tools/testfiles/tstarfile.ddl b/tools/testfiles/tstarfile.ddl new file mode 100644 index 0000000..77b80e0 --- /dev/null +++ b/tools/testfiles/tstarfile.ddl @@ -0,0 +1,89 @@ +HDF5 "tarray1_big.h5" { +DATASET "Dataset1" { + DATATYPE H5T_ARRAY { [1000] H5T_STD_I32LE } + DATASPACE SIMPLE { ( 2000 ) / ( 2000 ) } +} +} +HDF5 "tarray1.h5" { +DATASET "Dataset1" { + DATATYPE H5T_ARRAY { [4] H5T_STD_I32LE } + DATASPACE SIMPLE { ( 4 ) / ( 4 ) } +} +} +HDF5 "tarray2.h5" { +DATASET "Dataset1" { + DATATYPE H5T_ARRAY { [3][4][5] H5T_STD_I32LE } + DATASPACE SIMPLE { ( 4 ) / ( 4 ) } +} +} +HDF5 "tarray3.h5" { +DATASET "Dataset1" { + DATATYPE H5T_ARRAY { [4] H5T_ARRAY { [6][3] H5T_STD_I32LE } } + DATASPACE SIMPLE { ( 4 ) / ( 4 ) } +} +} +HDF5 "tarray4.h5" { +DATASET "Dataset1" { + DATATYPE H5T_ARRAY { [4] H5T_COMPOUND { + H5T_STD_I32LE "i"; + H5T_IEEE_F32LE "f"; + } } + DATASPACE SIMPLE { ( 4 ) / ( 4 ) } +} +} +HDF5 "tarray5.h5" { +DATASET "Dataset1" { + DATATYPE H5T_ARRAY { [4] H5T_COMPOUND { + H5T_STD_I32LE "i"; + H5T_ARRAY { [4] H5T_IEEE_F32LE } "f"; + } } + DATASPACE SIMPLE { ( 4 ) / ( 4 ) } +} +} +HDF5 "tarray6.h5" { +DATASET "Dataset1" { + DATATYPE H5T_ARRAY { [4] H5T_VLEN { H5T_STD_U32LE} } + DATASPACE SIMPLE { ( 4 ) / ( 4 ) } +} +} +HDF5 "tarray7.h5" { +DATASET "Dataset1" { + DATATYPE H5T_ARRAY { [4] H5T_VLEN { H5T_ARRAY { [4] H5T_STD_U32LE }} } + DATASPACE SIMPLE { ( 4 ) / ( 4 ) } +} +} +HDF5 "tarray8.h5" { +} +HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): + #000: (file name) line (number) in H5Dopen2(): not found + major: Dataset + minor: Object not found + #001: (file name) line (number) in H5G_loc_find(): can't find object + major: Symbol table + minor: Object not found + #002: (file name) line (number) in H5G_traverse(): internal path traversal failed + major: Symbol table + minor: Object not found + #003: (file name) line (number) in H5G_traverse_real(): traversal operator failed + major: Symbol table + minor: Callback failed + #004: (file name) line (number) in H5G_loc_find_cb(): object 'Dataset1' doesn't exist + major: Symbol table + minor: Object not found +HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): + #000: (file name) line (number) in H5Lget_info(): unable to get link info + major: Symbol table + minor: Object not found + #001: (file name) line (number) in H5L_get_info(): name doesn't exist + major: Symbol table + minor: Object already exists + #002: (file name) line (number) in H5G_traverse(): internal path traversal failed + major: Symbol table + minor: Object not found + #003: (file name) line (number) in H5G_traverse_real(): traversal operator failed + major: Symbol table + minor: Callback failed + #004: (file name) line (number) in H5L_get_info_cb(): name doesn't exist + major: Symbol table + minor: Object not found +h5dump error: unable to get link info from "Dataset1" diff --git a/tools/testfiles/tstr-1.ddl b/tools/testfiles/tstr-1.ddl index 099b291..e43b732 100644 --- a/tools/testfiles/tstr-1.ddl +++ b/tools/testfiles/tstr-1.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump tstr.h5' -############################# HDF5 "tstr.h5" { GROUP "/" { DATASET "comp1" { @@ -253,11 +250,11 @@ GROUP "/" { } DATASET "string1" { DATATYPE H5T_STRING { - STRSIZE 5; - STRPAD H5T_STR_NULLTERM; - CSET H5T_CSET_ASCII; - CTYPE H5T_C_S1; - } + STRSIZE 5; + STRPAD H5T_STR_NULLTERM; + CSET H5T_CSET_ASCII; + CTYPE H5T_C_S1; + } DATASPACE SIMPLE { ( 3, 4 ) / ( 3, 4 ) } DATA { (0,0): "s1", "s2", "s3", "s4", @@ -267,11 +264,11 @@ GROUP "/" { } DATASET "string2" { DATATYPE H5T_STRING { - STRSIZE 11; - STRPAD H5T_STR_SPACEPAD; - CSET H5T_CSET_ASCII; - CTYPE H5T_C_S1; - } + STRSIZE 11; + STRPAD H5T_STR_SPACEPAD; + CSET H5T_CSET_ASCII; + CTYPE H5T_C_S1; + } DATASPACE SIMPLE { ( 20 ) / ( 20 ) } DATA { (0): "ab cd ef1 ", "ab cd ef2 ", "ab cd ef3 ", "ab cd ef4 ", @@ -283,11 +280,11 @@ GROUP "/" { } DATASET "string3" { DATATYPE H5T_STRING { - STRSIZE 8; - STRPAD H5T_STR_NULLPAD; - CSET H5T_CSET_ASCII; - CTYPE H5T_C_S1; - } + STRSIZE 8; + STRPAD H5T_STR_NULLPAD; + CSET H5T_CSET_ASCII; + CTYPE H5T_C_S1; + } DATASPACE SIMPLE { ( 27 ) / ( 27 ) } DATA { (0): "abcd0\000\000\000", "abcd1\000\000\000", "abcd2\000\000\000", @@ -303,11 +300,11 @@ GROUP "/" { } DATASET "string4" { DATATYPE H5T_STRING { - STRSIZE 168; - STRPAD H5T_STR_SPACEPAD; - CSET H5T_CSET_ASCII; - CTYPE H5T_C_S1; - } + STRSIZE 168; + STRPAD H5T_STR_SPACEPAD; + CSET H5T_CSET_ASCII; + CTYPE H5T_C_S1; + } DATASPACE SIMPLE { ( 3 ) / ( 3 ) } DATA { (0): "s1234567890123456789 ", diff --git a/tools/testfiles/tstr-1.ls b/tools/testfiles/tstr-1.ls index 8a223cc..1ae4ecd 100644 --- a/tools/testfiles/tstr-1.ls +++ b/tools/testfiles/tstr-1.ls @@ -1,6 +1,3 @@ -############################# - output for 'h5ls -w80 -r -d tstr.h5' -############################# / Group /comp1 Dataset {3, 6} Data: diff --git a/tools/testfiles/tstr-2.ddl b/tools/testfiles/tstr-2.ddl index ab7cb42..26425f6 100644 --- a/tools/testfiles/tstr-2.ddl +++ b/tools/testfiles/tstr-2.ddl @@ -1,16 +1,13 @@ -############################# -Expected output for 'h5dump tstr2.h5' -############################# HDF5 "tstr2.h5" { GROUP "/" { GROUP "g1" { DATASET "dset1" { DATATYPE H5T_STRING { - STRSIZE 50; - STRPAD H5T_STR_NULLTERM; - CSET H5T_CSET_ASCII; - CTYPE H5T_C_S1; - } + STRSIZE 50; + STRPAD H5T_STR_NULLTERM; + CSET H5T_CSET_ASCII; + CTYPE H5T_C_S1; + } DATASPACE SIMPLE { ( 10 ) / ( 10 ) } DATA { (0): "This is row 0 of type H5T_STR_NULLTERM of", @@ -26,11 +23,11 @@ GROUP "/" { } ATTRIBUTE "attr1" { DATATYPE H5T_STRING { - STRSIZE 11; - STRPAD H5T_STR_NULLTERM; - CSET H5T_CSET_ASCII; - CTYPE H5T_C_S1; - } + STRSIZE 11; + STRPAD H5T_STR_NULLTERM; + CSET H5T_CSET_ASCII; + CTYPE H5T_C_S1; + } DATASPACE SIMPLE { ( 3 ) / ( 3 ) } DATA { (0): "0123456789", "abcdefghij", "ABCDEFGHIJ" @@ -41,11 +38,11 @@ GROUP "/" { GROUP "g2" { DATASET "dset2" { DATATYPE H5T_STRING { - STRSIZE 50; - STRPAD H5T_STR_NULLTERM; - CSET H5T_CSET_ASCII; - CTYPE H5T_C_S1; - } + STRSIZE 50; + STRPAD H5T_STR_NULLTERM; + CSET H5T_CSET_ASCII; + CTYPE H5T_C_S1; + } DATASPACE SIMPLE { ( 10 ) / ( 10 ) } DATA { (0): "This is row 0 of type H5T_STR_NULLTERM of string ", @@ -64,11 +61,11 @@ GROUP "/" { GROUP "g3" { DATASET "dset3" { DATATYPE H5T_STRING { - STRSIZE 50; - STRPAD H5T_STR_NULLPAD; - CSET H5T_CSET_ASCII; - CTYPE H5T_C_S1; - } + STRSIZE 50; + STRPAD H5T_STR_NULLPAD; + CSET H5T_CSET_ASCII; + CTYPE H5T_C_S1; + } DATASPACE SIMPLE { ( 10 ) / ( 10 ) } DATA { (0): "This is row 0 of type H5T_STR_NULLPAD of\000\000\000\000\000\000\000\000\000\000", @@ -87,11 +84,11 @@ GROUP "/" { GROUP "g4" { DATASET "dset4" { DATATYPE H5T_STRING { - STRSIZE 50; - STRPAD H5T_STR_NULLPAD; - CSET H5T_CSET_ASCII; - CTYPE H5T_C_S1; - } + STRSIZE 50; + STRPAD H5T_STR_NULLPAD; + CSET H5T_CSET_ASCII; + CTYPE H5T_C_S1; + } DATASPACE SIMPLE { ( 10 ) / ( 10 ) } DATA { (0): "This is row 0 of type H5T_STR_NULLPAD of string ar", @@ -110,11 +107,11 @@ GROUP "/" { GROUP "g5" { DATASET "dset5" { DATATYPE H5T_STRING { - STRSIZE 50; - STRPAD H5T_STR_SPACEPAD; - CSET H5T_CSET_ASCII; - CTYPE H5T_C_S1; - } + STRSIZE 50; + STRPAD H5T_STR_SPACEPAD; + CSET H5T_CSET_ASCII; + CTYPE H5T_C_S1; + } DATASPACE SIMPLE { ( 10 ) / ( 10 ) } DATA { (0): "This is row 0 of type H5T_STR_SPACEPAD of ", @@ -133,11 +130,11 @@ GROUP "/" { GROUP "g6" { DATASET "dset6" { DATATYPE H5T_STRING { - STRSIZE 50; - STRPAD H5T_STR_SPACEPAD; - CSET H5T_CSET_ASCII; - CTYPE H5T_C_S1; - } + STRSIZE 50; + STRPAD H5T_STR_SPACEPAD; + CSET H5T_CSET_ASCII; + CTYPE H5T_C_S1; + } DATASPACE SIMPLE { ( 10 ) / ( 10 ) } DATA { (0): "This is row 0 of type H5T_STR_SPACEPAD of string a", diff --git a/tools/testfiles/tstr.h5.xml b/tools/testfiles/tstr.h5.xml index aa429a8..d7214fd 100644 --- a/tools/testfiles/tstr.h5.xml +++ b/tools/testfiles/tstr.h5.xml @@ -1,16 +1,13 @@ -############################# -Expected output for 'h5dump --xml tstr.h5' -############################# - + - + - + @@ -52,186 +49,24 @@ Expected output for 'h5dump --xml tstr.h5' - 0 1 4 9 16 25 36 49 64 81 - 1 4 9 16 25 36 49 64 81 100 - 4 9 16 25 36 49 64 81 100 121 - 9 16 25 36 49 64 81 100 121 144 - 16 25 36 49 64 81 100 121 144 169 - 25 36 49 64 81 100 121 144 169 196 - 36 49 64 81 100 121 144 169 196 225 - 49 64 81 100 121 144 169 196 225 256 "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" - "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" - "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" - 1 4 9 16 25 36 49 64 81 100 - 4 9 16 25 36 49 64 81 100 121 - 9 16 25 36 49 64 81 100 121 144 - 16 25 36 49 64 81 100 121 144 169 - 25 36 49 64 81 100 121 144 169 196 - 36 49 64 81 100 121 144 169 196 225 - 49 64 81 100 121 144 169 196 225 256 - 64 81 100 121 144 169 196 225 256 289 "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" - "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" - "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" - 4 9 16 25 36 49 64 81 100 121 - 9 16 25 36 49 64 81 100 121 144 - 16 25 36 49 64 81 100 121 144 169 - 25 36 49 64 81 100 121 144 169 196 - 36 49 64 81 100 121 144 169 196 225 - 49 64 81 100 121 144 169 196 225 256 - 64 81 100 121 144 169 196 225 256 289 - 81 100 121 144 169 196 225 256 289 324 "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" - "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" - "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" - 9 16 25 36 49 64 81 100 121 144 - 16 25 36 49 64 81 100 121 144 169 - 25 36 49 64 81 100 121 144 169 196 - 36 49 64 81 100 121 144 169 196 225 - 49 64 81 100 121 144 169 196 225 256 - 64 81 100 121 144 169 196 225 256 289 - 81 100 121 144 169 196 225 256 289 324 - 100 121 144 169 196 225 256 289 324 361 "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" - "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" - "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" - 16 25 36 49 64 81 100 121 144 169 - 25 36 49 64 81 100 121 144 169 196 - 36 49 64 81 100 121 144 169 196 225 - 49 64 81 100 121 144 169 196 225 256 - 64 81 100 121 144 169 196 225 256 289 - 81 100 121 144 169 196 225 256 289 324 - 100 121 144 169 196 225 256 289 324 361 - 121 144 169 196 225 256 289 324 361 400 "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" - "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" - "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" - 25 36 49 64 81 100 121 144 169 196 - 36 49 64 81 100 121 144 169 196 225 - 49 64 81 100 121 144 169 196 225 256 - 64 81 100 121 144 169 196 225 256 289 - 81 100 121 144 169 196 225 256 289 324 - 100 121 144 169 196 225 256 289 324 361 - 121 144 169 196 225 256 289 324 361 400 - 144 169 196 225 256 289 324 361 400 441 "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" - "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" - "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" - 0 1 4 9 16 25 36 49 64 81 - 1 4 9 16 25 36 49 64 81 100 - 4 9 16 25 36 49 64 81 100 121 - 9 16 25 36 49 64 81 100 121 144 - 16 25 36 49 64 81 100 121 144 169 - 25 36 49 64 81 100 121 144 169 196 - 36 49 64 81 100 121 144 169 196 225 - 49 64 81 100 121 144 169 196 225 256 "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" - "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" - "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" - 1 4 9 16 25 36 49 64 81 100 - 4 9 16 25 36 49 64 81 100 121 - 9 16 25 36 49 64 81 100 121 144 - 16 25 36 49 64 81 100 121 144 169 - 25 36 49 64 81 100 121 144 169 196 - 36 49 64 81 100 121 144 169 196 225 - 49 64 81 100 121 144 169 196 225 256 - 64 81 100 121 144 169 196 225 256 289 "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" - "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" - "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" - 4 9 16 25 36 49 64 81 100 121 - 9 16 25 36 49 64 81 100 121 144 - 16 25 36 49 64 81 100 121 144 169 - 25 36 49 64 81 100 121 144 169 196 - 36 49 64 81 100 121 144 169 196 225 - 49 64 81 100 121 144 169 196 225 256 - 64 81 100 121 144 169 196 225 256 289 - 81 100 121 144 169 196 225 256 289 324 "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" - "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" - "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" - 9 16 25 36 49 64 81 100 121 144 - 16 25 36 49 64 81 100 121 144 169 - 25 36 49 64 81 100 121 144 169 196 - 36 49 64 81 100 121 144 169 196 225 - 49 64 81 100 121 144 169 196 225 256 - 64 81 100 121 144 169 196 225 256 289 - 81 100 121 144 169 196 225 256 289 324 - 100 121 144 169 196 225 256 289 324 361 "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" - "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" - "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" - 16 25 36 49 64 81 100 121 144 169 - 25 36 49 64 81 100 121 144 169 196 - 36 49 64 81 100 121 144 169 196 225 - 49 64 81 100 121 144 169 196 225 256 - 64 81 100 121 144 169 196 225 256 289 - 81 100 121 144 169 196 225 256 289 324 - 100 121 144 169 196 225 256 289 324 361 - 121 144 169 196 225 256 289 324 361 400 "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" - "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" - "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" - 25 36 49 64 81 100 121 144 169 196 - 36 49 64 81 100 121 144 169 196 225 - 49 64 81 100 121 144 169 196 225 256 - 64 81 100 121 144 169 196 225 256 289 - 81 100 121 144 169 196 225 256 289 324 - 100 121 144 169 196 225 256 289 324 361 - 121 144 169 196 225 256 289 324 361 400 - 144 169 196 225 256 289 324 361 400 441 "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" - "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" - "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" - 0 1 4 9 16 25 36 49 64 81 - 1 4 9 16 25 36 49 64 81 100 - 4 9 16 25 36 49 64 81 100 121 - 9 16 25 36 49 64 81 100 121 144 - 16 25 36 49 64 81 100 121 144 169 - 25 36 49 64 81 100 121 144 169 196 - 36 49 64 81 100 121 144 169 196 225 - 49 64 81 100 121 144 169 196 225 256 "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" - "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" - "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" - 1 4 9 16 25 36 49 64 81 100 - 4 9 16 25 36 49 64 81 100 121 - 9 16 25 36 49 64 81 100 121 144 - 16 25 36 49 64 81 100 121 144 169 - 25 36 49 64 81 100 121 144 169 196 - 36 49 64 81 100 121 144 169 196 225 - 49 64 81 100 121 144 169 196 225 256 - 64 81 100 121 144 169 196 225 256 289 "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" - "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" - "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" - 4 9 16 25 36 49 64 81 100 121 - 9 16 25 36 49 64 81 100 121 144 - 16 25 36 49 64 81 100 121 144 169 - 25 36 49 64 81 100 121 144 169 196 - 36 49 64 81 100 121 144 169 196 225 - 49 64 81 100 121 144 169 196 225 256 - 64 81 100 121 144 169 196 225 256 289 - 81 100 121 144 169 196 225 256 289 324 "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" - "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" - "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" - 9 16 25 36 49 64 81 100 121 144 - 16 25 36 49 64 81 100 121 144 169 - 25 36 49 64 81 100 121 144 169 196 - 36 49 64 81 100 121 144 169 196 225 - 49 64 81 100 121 144 169 196 225 256 - 64 81 100 121 144 169 196 225 256 289 - 81 100 121 144 169 196 225 256 289 324 - 100 121 144 169 196 225 256 289 324 361 "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" - "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" - "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" - 16 25 36 49 64 81 100 121 144 169 - 25 36 49 64 81 100 121 144 169 196 - 36 49 64 81 100 121 144 169 196 225 - 49 64 81 100 121 144 169 196 225 256 - 64 81 100 121 144 169 196 225 256 289 - 81 100 121 144 169 196 225 256 289 324 - 100 121 144 169 196 225 256 289 324 361 - 121 144 169 196 225 256 289 324 361 400 "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" - "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" - "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" - 25 36 49 64 81 100 121 144 169 196 - 36 49 64 81 100 121 144 169 196 225 - 49 64 81 100 121 144 169 196 225 256 - 64 81 100 121 144 169 196 225 256 289 - 81 100 121 144 169 196 225 256 289 324 - 100 121 144 169 196 225 256 289 324 361 - 121 144 169 196 225 256 289 324 361 400 - 144 169 196 225 256 289 324 361 400 441 "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" - "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" - "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" + 0 1 4 9 16 25 36 49 64 81 1 4 9 16 25 36 49 64 81 100 4 9 16 25 36 49 64 81 100 121 9 16 25 36 49 64 81 100 121 144 16 25 36 49 64 81 100 121 144 169 25 36 49 64 81 100 121 144 169 196 36 49 64 81 100 121 144 169 196 225 49 64 81 100 121 144 169 196 225 256 "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" + 1 4 9 16 25 36 49 64 81 100 4 9 16 25 36 49 64 81 100 121 9 16 25 36 49 64 81 100 121 144 16 25 36 49 64 81 100 121 144 169 25 36 49 64 81 100 121 144 169 196 36 49 64 81 100 121 144 169 196 225 49 64 81 100 121 144 169 196 225 256 64 81 100 121 144 169 196 225 256 289 "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" + 4 9 16 25 36 49 64 81 100 121 9 16 25 36 49 64 81 100 121 144 16 25 36 49 64 81 100 121 144 169 25 36 49 64 81 100 121 144 169 196 36 49 64 81 100 121 144 169 196 225 49 64 81 100 121 144 169 196 225 256 64 81 100 121 144 169 196 225 256 289 81 100 121 144 169 196 225 256 289 324 "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" + 9 16 25 36 49 64 81 100 121 144 16 25 36 49 64 81 100 121 144 169 25 36 49 64 81 100 121 144 169 196 36 49 64 81 100 121 144 169 196 225 49 64 81 100 121 144 169 196 225 256 64 81 100 121 144 169 196 225 256 289 81 100 121 144 169 196 225 256 289 324 100 121 144 169 196 225 256 289 324 361 "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" + 16 25 36 49 64 81 100 121 144 169 25 36 49 64 81 100 121 144 169 196 36 49 64 81 100 121 144 169 196 225 49 64 81 100 121 144 169 196 225 256 64 81 100 121 144 169 196 225 256 289 81 100 121 144 169 196 225 256 289 324 100 121 144 169 196 225 256 289 324 361 121 144 169 196 225 256 289 324 361 400 "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" + 25 36 49 64 81 100 121 144 169 196 36 49 64 81 100 121 144 169 196 225 49 64 81 100 121 144 169 196 225 256 64 81 100 121 144 169 196 225 256 289 81 100 121 144 169 196 225 256 289 324 100 121 144 169 196 225 256 289 324 361 121 144 169 196 225 256 289 324 361 400 144 169 196 225 256 289 324 361 400 441 "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" + 0 1 4 9 16 25 36 49 64 81 1 4 9 16 25 36 49 64 81 100 4 9 16 25 36 49 64 81 100 121 9 16 25 36 49 64 81 100 121 144 16 25 36 49 64 81 100 121 144 169 25 36 49 64 81 100 121 144 169 196 36 49 64 81 100 121 144 169 196 225 49 64 81 100 121 144 169 196 225 256 "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" + 1 4 9 16 25 36 49 64 81 100 4 9 16 25 36 49 64 81 100 121 9 16 25 36 49 64 81 100 121 144 16 25 36 49 64 81 100 121 144 169 25 36 49 64 81 100 121 144 169 196 36 49 64 81 100 121 144 169 196 225 49 64 81 100 121 144 169 196 225 256 64 81 100 121 144 169 196 225 256 289 "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" + 4 9 16 25 36 49 64 81 100 121 9 16 25 36 49 64 81 100 121 144 16 25 36 49 64 81 100 121 144 169 25 36 49 64 81 100 121 144 169 196 36 49 64 81 100 121 144 169 196 225 49 64 81 100 121 144 169 196 225 256 64 81 100 121 144 169 196 225 256 289 81 100 121 144 169 196 225 256 289 324 "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" + 9 16 25 36 49 64 81 100 121 144 16 25 36 49 64 81 100 121 144 169 25 36 49 64 81 100 121 144 169 196 36 49 64 81 100 121 144 169 196 225 49 64 81 100 121 144 169 196 225 256 64 81 100 121 144 169 196 225 256 289 81 100 121 144 169 196 225 256 289 324 100 121 144 169 196 225 256 289 324 361 "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" + 16 25 36 49 64 81 100 121 144 169 25 36 49 64 81 100 121 144 169 196 36 49 64 81 100 121 144 169 196 225 49 64 81 100 121 144 169 196 225 256 64 81 100 121 144 169 196 225 256 289 81 100 121 144 169 196 225 256 289 324 100 121 144 169 196 225 256 289 324 361 121 144 169 196 225 256 289 324 361 400 "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" + 25 36 49 64 81 100 121 144 169 196 36 49 64 81 100 121 144 169 196 225 49 64 81 100 121 144 169 196 225 256 64 81 100 121 144 169 196 225 256 289 81 100 121 144 169 196 225 256 289 324 100 121 144 169 196 225 256 289 324 361 121 144 169 196 225 256 289 324 361 400 144 169 196 225 256 289 324 361 400 441 "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" + 0 1 4 9 16 25 36 49 64 81 1 4 9 16 25 36 49 64 81 100 4 9 16 25 36 49 64 81 100 121 9 16 25 36 49 64 81 100 121 144 16 25 36 49 64 81 100 121 144 169 25 36 49 64 81 100 121 144 169 196 36 49 64 81 100 121 144 169 196 225 49 64 81 100 121 144 169 196 225 256 "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" + 1 4 9 16 25 36 49 64 81 100 4 9 16 25 36 49 64 81 100 121 9 16 25 36 49 64 81 100 121 144 16 25 36 49 64 81 100 121 144 169 25 36 49 64 81 100 121 144 169 196 36 49 64 81 100 121 144 169 196 225 49 64 81 100 121 144 169 196 225 256 64 81 100 121 144 169 196 225 256 289 "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" + 4 9 16 25 36 49 64 81 100 121 9 16 25 36 49 64 81 100 121 144 16 25 36 49 64 81 100 121 144 169 25 36 49 64 81 100 121 144 169 196 36 49 64 81 100 121 144 169 196 225 49 64 81 100 121 144 169 196 225 256 64 81 100 121 144 169 196 225 256 289 81 100 121 144 169 196 225 256 289 324 "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" + 9 16 25 36 49 64 81 100 121 144 16 25 36 49 64 81 100 121 144 169 25 36 49 64 81 100 121 144 169 196 36 49 64 81 100 121 144 169 196 225 49 64 81 100 121 144 169 196 225 256 64 81 100 121 144 169 196 225 256 289 81 100 121 144 169 196 225 256 289 324 100 121 144 169 196 225 256 289 324 361 "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" + 16 25 36 49 64 81 100 121 144 169 25 36 49 64 81 100 121 144 169 196 36 49 64 81 100 121 144 169 196 225 49 64 81 100 121 144 169 196 225 256 64 81 100 121 144 169 196 225 256 289 81 100 121 144 169 196 225 256 289 324 100 121 144 169 196 225 256 289 324 361 121 144 169 196 225 256 289 324 361 400 "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" + 25 36 49 64 81 100 121 144 169 196 36 49 64 81 100 121 144 169 196 225 49 64 81 100 121 144 169 196 225 256 64 81 100 121 144 169 196 225 256 289 81 100 121 144 169 196 225 256 289 324 100 121 144 169 196 225 256 289 324 361 121 144 169 196 225 256 289 324 361 400 144 169 196 225 256 289 324 361 400 441 "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" "abcdefgh12345678abcdefgh12345678" @@ -239,9 +74,9 @@ Expected output for 'h5dump --xml tstr.h5' - + - + @@ -276,9 +111,9 @@ Expected output for 'h5dump --xml tstr.h5' - + - + @@ -320,9 +155,9 @@ Expected output for 'h5dump --xml tstr.h5' - + - + @@ -371,9 +206,9 @@ Expected output for 'h5dump --xml tstr.h5' - + - + diff --git a/tools/testfiles/tstr2.h5.xml b/tools/testfiles/tstr2.h5.xml index 62283be..26758b3 100644 --- a/tools/testfiles/tstr2.h5.xml +++ b/tools/testfiles/tstr2.h5.xml @@ -1,17 +1,14 @@ -############################# -Expected output for 'h5dump --xml tstr2.h5' -############################# - + - + - + @@ -64,9 +61,9 @@ Expected output for 'h5dump --xml tstr2.h5' - + - + @@ -100,9 +97,9 @@ Expected output for 'h5dump --xml tstr2.h5' - + - + @@ -136,9 +133,9 @@ Expected output for 'h5dump --xml tstr2.h5' - + - + @@ -172,9 +169,9 @@ Expected output for 'h5dump --xml tstr2.h5' - + - + @@ -208,9 +205,9 @@ Expected output for 'h5dump --xml tstr2.h5' - + - + diff --git a/tools/testfiles/tstring-at.h5.xml b/tools/testfiles/tstring-at.h5.xml index 29e2b90..1962610 100644 --- a/tools/testfiles/tstring-at.h5.xml +++ b/tools/testfiles/tstring-at.h5.xml @@ -1,16 +1,13 @@ -############################# -Expected output for 'h5dump --xml tstring-at.h5' -############################# - + - + - + diff --git a/tools/testfiles/tstring.ddl b/tools/testfiles/tstring.ddl index 843d2aa..398bf33 100644 --- a/tools/testfiles/tstring.ddl +++ b/tools/testfiles/tstring.ddl @@ -1,15 +1,12 @@ -############################# -Expected output for 'h5dump tstr3.h5' -############################# HDF5 "tstr3.h5" { GROUP "/" { DATASET "str1" { DATATYPE H5T_STRING { - STRSIZE 73; - STRPAD H5T_STR_NULLTERM; - CSET H5T_CSET_ASCII; - CTYPE H5T_C_S1; - } + STRSIZE 73; + STRPAD H5T_STR_NULLTERM; + CSET H5T_CSET_ASCII; + CTYPE H5T_C_S1; + } DATASPACE SIMPLE { ( 1 ) / ( 1 ) } DATA { (0): "quote " backspace form feed new line @@ -19,11 +16,11 @@ GROUP "/" { } DATASET "str2" { DATATYPE H5T_STRING { - STRSIZE H5T_VARIABLE; - STRPAD H5T_STR_NULLTERM; - CSET H5T_CSET_ASCII; - CTYPE H5T_C_S1; - } + STRSIZE H5T_VARIABLE; + STRPAD H5T_STR_NULLTERM; + CSET H5T_CSET_ASCII; + CTYPE H5T_C_S1; + } DATASPACE SIMPLE { ( 4 ) / ( 4 ) } DATA { (0): "Four score and seven diff --git a/tools/testfiles/tstring.h5.xml b/tools/testfiles/tstring.h5.xml index d83ea0e..ebd0a3c 100644 --- a/tools/testfiles/tstring.h5.xml +++ b/tools/testfiles/tstring.h5.xml @@ -1,16 +1,13 @@ -############################# -Expected output for 'h5dump --xml tstring.h5' -############################# - + - + - + diff --git a/tools/testfiles/tstring2.ddl b/tools/testfiles/tstring2.ddl index c3e9844..cda2ed5 100644 --- a/tools/testfiles/tstring2.ddl +++ b/tools/testfiles/tstring2.ddl @@ -1,14 +1,11 @@ -############################# -Expected output for 'h5dump -r -d str4 tstr3.h5' -############################# HDF5 "tstr3.h5" { DATASET "str4" { DATATYPE H5T_STD_I8LE DATASPACE SIMPLE { ( 93 ) / ( 93 ) } DATA { - "Four score and seven + "Four score and seven years ago our forefathers brought fo" - "rth on this continent a new nation\000" + "rth on this continent a new nation\000" } } } diff --git a/tools/testfiles/tstringe.ddl b/tools/testfiles/tstringe.ddl index 1d96dbd..d3f5181 100644 --- a/tools/testfiles/tstringe.ddl +++ b/tools/testfiles/tstringe.ddl @@ -1,15 +1,12 @@ -############################# -Expected output for 'h5dump -e tstr3.h5' -############################# HDF5 "tstr3.h5" { GROUP "/" { DATASET "str1" { DATATYPE H5T_STRING { - STRSIZE 73; - STRPAD H5T_STR_NULLTERM; - CSET H5T_CSET_ASCII; - CTYPE H5T_C_S1; - } + STRSIZE 73; + STRPAD H5T_STR_NULLTERM; + CSET H5T_CSET_ASCII; + CTYPE H5T_C_S1; + } DATASPACE SIMPLE { ( 1 ) / ( 1 ) } DATA { (0): "quote \" backspace\b form feed\f new line\n tab\t new line\n carriage return\r" @@ -17,11 +14,11 @@ GROUP "/" { } DATASET "str2" { DATATYPE H5T_STRING { - STRSIZE H5T_VARIABLE; - STRPAD H5T_STR_NULLTERM; - CSET H5T_CSET_ASCII; - CTYPE H5T_C_S1; - } + STRSIZE H5T_VARIABLE; + STRPAD H5T_STR_NULLTERM; + CSET H5T_CSET_ASCII; + CTYPE H5T_C_S1; + } DATASPACE SIMPLE { ( 4 ) / ( 4 ) } DATA { (0): "Four score and seven\n years ago our forefathers brought forth on this continent a new nation,", diff --git a/tools/testfiles/tszip.ddl b/tools/testfiles/tszip.ddl index b9f80ca..6fdd92f 100644 --- a/tools/testfiles/tszip.ddl +++ b/tools/testfiles/tszip.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump -H -p -d szip tfilters.h5' -############################# HDF5 "tfilters.h5" { DATASET "szip" { DATATYPE H5T_STD_I32LE @@ -8,7 +5,7 @@ DATASET "szip" { STORAGE_LAYOUT { CHUNKED ( 10, 5 ) SIZE 372 (2.151:1 COMPRESSION) - } + } FILTERS { COMPRESSION SZIP { PIXELS_PER_BLOCK 4 @@ -20,7 +17,7 @@ DATASET "szip" { } FILLVALUE { FILL_TIME H5D_FILL_TIME_IFSET - VALUE 0 + VALUE 0 } ALLOCATION_TIME { H5D_ALLOC_TIME_INCR diff --git a/tools/testfiles/tudlink-1.ddl b/tools/testfiles/tudlink-1.ddl index 5f76c40..53edf6b 100644 --- a/tools/testfiles/tudlink-1.ddl +++ b/tools/testfiles/tudlink-1.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump tudlink.h5' -############################# HDF5 "tudlink.h5" { GROUP "/" { USERDEFINED_LINK "udlink1" { diff --git a/tools/testfiles/tudlink-1.ls b/tools/testfiles/tudlink-1.ls index d34ef4d..487e4bc 100644 --- a/tools/testfiles/tudlink-1.ls +++ b/tools/testfiles/tudlink-1.ls @@ -1,6 +1,3 @@ -############################# - output for 'h5ls -w80 -r tudlink.h5' -############################# / Group /udlink1 UD Link {cannot follow UD links} /udlink2 UD Link {cannot follow UD links} diff --git a/tools/testfiles/tudlink-2.ddl b/tools/testfiles/tudlink-2.ddl index 9ae3a54..7f4281a 100644 --- a/tools/testfiles/tudlink-2.ddl +++ b/tools/testfiles/tudlink-2.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump -l udlink2 tudlink.h5' -############################# HDF5 "tudlink.h5" { USERDEFINED_LINK "udlink2" { USERDEFINED_LINK "udlink2" { diff --git a/tools/testfiles/tudlink.h5.xml b/tools/testfiles/tudlink.h5.xml index bc55a83..7e57dd8 100644 --- a/tools/testfiles/tudlink.h5.xml +++ b/tools/testfiles/tudlink.h5.xml @@ -1,8 +1,5 @@ -############################# -Expected output for 'h5dump --xml tudlink.h5' -############################# - + diff --git a/tools/testfiles/tuserfilter.ddl b/tools/testfiles/tuserfilter.ddl index 5549741..07b478f 100644 --- a/tools/testfiles/tuserfilter.ddl +++ b/tools/testfiles/tuserfilter.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump -H -p -d myfilter tfilters.h5' -############################# HDF5 "tfilters.h5" { DATASET "myfilter" { DATATYPE H5T_STD_I32LE @@ -8,19 +5,20 @@ DATASET "myfilter" { STORAGE_LAYOUT { CHUNKED ( 10, 5 ) SIZE 800 - } + } FILTERS { UNKNOWN_FILTER { FILTER_ID 405 COMMENT myfilter PARAMS { 5 6 } } - FILLVALUE { - FILL_TIME H5D_FILL_TIME_IFSET - VALUE 0 - } - ALLOCATION_TIME { - H5D_ALLOC_TIME_INCR - } } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE 0 + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_INCR + } +} } diff --git a/tools/testfiles/tvldtypes1.ddl b/tools/testfiles/tvldtypes1.ddl index e798d09..1ebb915 100644 --- a/tools/testfiles/tvldtypes1.ddl +++ b/tools/testfiles/tvldtypes1.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump tvldtypes1.h5' -############################# HDF5 "tvldtypes1.h5" { GROUP "/" { DATASET "Dataset1.0" { diff --git a/tools/testfiles/tvldtypes1.h5.xml b/tools/testfiles/tvldtypes1.h5.xml index 34eb276..9c519f0 100644 --- a/tools/testfiles/tvldtypes1.h5.xml +++ b/tools/testfiles/tvldtypes1.h5.xml @@ -1,16 +1,13 @@ -############################# -Expected output for 'h5dump --xml tvldtypes1.h5' -############################# - + - + - + @@ -30,7 +27,10 @@ Expected output for 'h5dump --xml tvldtypes1.h5' - 0 10 11 20 21 22 30 31 32 33 + 0 + 10 11 + 20 21 22 + 30 31 32 33 @@ -38,9 +38,9 @@ Expected output for 'h5dump --xml tvldtypes1.h5' - + - + @@ -60,7 +60,10 @@ Expected output for 'h5dump --xml tvldtypes1.h5' - 0 10 10.1 20 20.1 20.2 30 30.1 30.2 30.3 + 0 + 10 10.1 + 20 20.1 20.2 + 30 30.1 30.2 30.3 @@ -68,9 +71,9 @@ Expected output for 'h5dump --xml tvldtypes1.h5' - + - + diff --git a/tools/testfiles/tvldtypes1.ls b/tools/testfiles/tvldtypes1.ls index 4c4c162..feb1ac6 100644 --- a/tools/testfiles/tvldtypes1.ls +++ b/tools/testfiles/tvldtypes1.ls @@ -1,6 +1,3 @@ -############################# - output for 'h5ls -w80 -r -d tvldtypes1.h5' -############################# / Group /Dataset1.0 Dataset {4} Data: diff --git a/tools/testfiles/tvldtypes2.ddl b/tools/testfiles/tvldtypes2.ddl index 855b5cd..93be862 100644 --- a/tools/testfiles/tvldtypes2.ddl +++ b/tools/testfiles/tvldtypes2.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump tvldtypes2.h5' -############################# HDF5 "tvldtypes2.h5" { GROUP "/" { DATASET "Dataset1" { diff --git a/tools/testfiles/tvldtypes2.h5.xml b/tools/testfiles/tvldtypes2.h5.xml index d7e644c..9cabfdf 100644 --- a/tools/testfiles/tvldtypes2.h5.xml +++ b/tools/testfiles/tvldtypes2.h5.xml @@ -1,16 +1,13 @@ -############################# -Expected output for 'h5dump --xml tvldtypes2.h5' -############################# - + - + - + @@ -34,7 +31,9 @@ Expected output for 'h5dump --xml tvldtypes2.h5' - 0 100 110 111 200 210 211 220 221 222 + 0 + 100 110 111 + 200 210 211 220 221 222 300 310 311 320 321 322 330 331 332 333 diff --git a/tools/testfiles/tvldtypes2be.ls b/tools/testfiles/tvldtypes2be.ls index ee84185..2f7def3 100644 --- a/tools/testfiles/tvldtypes2be.ls +++ b/tools/testfiles/tvldtypes2be.ls @@ -1,6 +1,3 @@ -############################# - output for 'h5ls -v tvldtypes1.h5' -############################# Opened "tvldtypes1.h5" with sec2 driver. Dataset1.0 Dataset {4/4} Location: 1:976 diff --git a/tools/testfiles/tvldtypes2le.ls b/tools/testfiles/tvldtypes2le.ls index 62dfa61..f99ad18 100644 --- a/tools/testfiles/tvldtypes2le.ls +++ b/tools/testfiles/tvldtypes2le.ls @@ -1,6 +1,3 @@ -############################# - output for 'h5ls -v tvldtypes1.h5' -############################# Opened "tvldtypes1.h5" with sec2 driver. Dataset1.0 Dataset {4/4} Location: 1:976 diff --git a/tools/testfiles/tvldtypes3.ddl b/tools/testfiles/tvldtypes3.ddl index 692f485..3af9268 100644 --- a/tools/testfiles/tvldtypes3.ddl +++ b/tools/testfiles/tvldtypes3.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump tvldtypes3.h5' -############################# HDF5 "tvldtypes3.h5" { GROUP "/" { DATASET "Dataset1" { diff --git a/tools/testfiles/tvldtypes3.h5.xml b/tools/testfiles/tvldtypes3.h5.xml index 627b2ca..811d536 100644 --- a/tools/testfiles/tvldtypes3.h5.xml +++ b/tools/testfiles/tvldtypes3.h5.xml @@ -1,16 +1,13 @@ -############################# -Expected output for 'h5dump --xml tvldtypes3.h5' -############################# - + - + - + @@ -50,7 +47,10 @@ Expected output for 'h5dump --xml tvldtypes3.h5' - 0 0 0 10 6.66667 10 11 20 13.3333 20 21 22 30 20 30 31 32 33 + 0 0 0 + 10 6.66667 10 11 + 20 13.3333 20 21 22 + 30 20 30 31 32 33 diff --git a/tools/testfiles/tvldtypes4.ddl b/tools/testfiles/tvldtypes4.ddl index 50ae28b..b1ca394 100644 --- a/tools/testfiles/tvldtypes4.ddl +++ b/tools/testfiles/tvldtypes4.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump tvldtypes4.h5' -############################# HDF5 "tvldtypes4.h5" { GROUP "/" { DATASET "Dataset1" { diff --git a/tools/testfiles/tvldtypes4.h5.xml b/tools/testfiles/tvldtypes4.h5.xml index de2a476..1d368ce 100644 --- a/tools/testfiles/tvldtypes4.h5.xml +++ b/tools/testfiles/tvldtypes4.h5.xml @@ -1,19 +1,16 @@ -############################# -Expected output for 'h5dump --xml tvldtypes4.h5' -############################# - + - + - - - - + + + + @@ -46,7 +43,9 @@ Expected output for 'h5dump --xml tvldtypes4.h5' - 0 0 10 6.66667 11 7 20 13.3333 21 13.6667 22 14 + 0 0 + 10 6.66667 11 7 + 20 13.3333 21 13.6667 22 14 30 20 31 20.3333 32 20.6667 33 21 diff --git a/tools/testfiles/tvldtypes5.ddl b/tools/testfiles/tvldtypes5.ddl index 57462d7..b4bf3db 100644 --- a/tools/testfiles/tvldtypes5.ddl +++ b/tools/testfiles/tvldtypes5.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump tvldtypes5.h5' -############################# HDF5 "tvldtypes5.h5" { GROUP "/" { DATASET "Dataset" { diff --git a/tools/testfiles/tvldtypes5.h5.xml b/tools/testfiles/tvldtypes5.h5.xml index 92d5f0c..d6ed774 100644 --- a/tools/testfiles/tvldtypes5.h5.xml +++ b/tools/testfiles/tvldtypes5.h5.xml @@ -1,19 +1,16 @@ -############################# -Expected output for 'h5dump --xml tvldtypes5.h5' -############################# - + - + - - - - + + + + @@ -33,7 +30,10 @@ Expected output for 'h5dump --xml tvldtypes5.h5' - 0 2 4 6 8 0 2 4 6 8 10 12 + 0 2 4 6 8 + + 0 2 4 6 8 10 12 + diff --git a/tools/testfiles/tvlstr.ddl b/tools/testfiles/tvlstr.ddl index eda8e000..dfce2eb 100644 --- a/tools/testfiles/tvlstr.ddl +++ b/tools/testfiles/tvlstr.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump tvlstr.h5' -############################# HDF5 "tvlstr.h5" { GROUP "/" { ATTRIBUTE "test_scalar" { @@ -12,11 +9,11 @@ GROUP "/" { } DATASET "Dataset1" { DATATYPE H5T_STRING { - STRSIZE H5T_VARIABLE; - STRPAD H5T_STR_NULLTERM; - CSET H5T_CSET_ASCII; - CTYPE H5T_C_S1; - } + STRSIZE H5T_VARIABLE; + STRPAD H5T_STR_NULLTERM; + CSET H5T_CSET_ASCII; + CTYPE H5T_C_S1; + } DATASPACE SIMPLE { ( 4 ) / ( 4 ) } DATA { (0): "Four score and seven years ago our forefathers brought forth on this continent a new nation,", @@ -25,11 +22,10 @@ GROUP "/" { } } DATATYPE "vl_string_type" H5T_STRING { - STRSIZE H5T_VARIABLE; - STRPAD H5T_STR_NULLPAD; - CSET H5T_CSET_ASCII; - CTYPE H5T_C_S1; - }; - + STRSIZE H5T_VARIABLE; + STRPAD H5T_STR_NULLPAD; + CSET H5T_CSET_ASCII; + CTYPE H5T_C_S1; + }; } } diff --git a/tools/testfiles/tvlstr.h5.xml b/tools/testfiles/tvlstr.h5.xml index 507f0eb..e5ec1f3 100644 --- a/tools/testfiles/tvlstr.h5.xml +++ b/tools/testfiles/tvlstr.h5.xml @@ -1,8 +1,5 @@ -############################# -Expected output for 'h5dump --xml tvlstr.h5' -############################# - + @@ -19,12 +16,12 @@ Expected output for 'h5dump --xml tvlstr.h5' - + - - - - + + + + diff --git a/tools/testfiles/tvms.ddl b/tools/testfiles/tvms.ddl index 077050b..49f3881 100644 --- a/tools/testfiles/tvms.ddl +++ b/tools/testfiles/tvms.ddl @@ -1,6 +1,3 @@ -############################# -Expected output for 'h5dump tvms.h5' -############################# HDF5 "tvms.h5" { GROUP "/" { DATASET "Array" { diff --git a/tools/testfiles/zerodim.ddl b/tools/testfiles/zerodim.ddl new file mode 100644 index 0000000..484e907 --- /dev/null +++ b/tools/testfiles/zerodim.ddl @@ -0,0 +1,16 @@ +HDF5 "zerodim.h5" { +GROUP "/" { + ATTRIBUTE "attr of 0 dimension size" { + DATATYPE H5T_STD_U32LE + DATASPACE SIMPLE { ( 0, 0 ) / ( 0, 0 ) } + DATA { + } + } + DATASET "dset of 0 dimension size" { + DATATYPE H5T_STD_I32BE + DATASPACE SIMPLE { ( 0, 0 ) / ( 0, 0 ) } + DATA { + } + } +} +} diff --git a/tools/testfiles/zerodim.h5 b/tools/testfiles/zerodim.h5 new file mode 100644 index 0000000..6939353 Binary files /dev/null and b/tools/testfiles/zerodim.h5 differ diff --git a/vms/src/h5pubconf.h b/vms/src/h5pubconf.h index b6137bc..893e46c 100644 --- a/vms/src/h5pubconf.h +++ b/vms/src/h5pubconf.h @@ -65,13 +65,13 @@ #define H5_FP_TO_ULLONG_RIGHT_MAXIMUM 1 /* Define if gettimeofday() populates the tz pointer passed in */ -/* #define H5_GETTIMEOFDAY_GIVES_TZ 1 */ +/* #undef H5_GETTIMEOFDAY_GIVES_TZ */ /* Define to 1 if you have the `alarm' function. */ #define H5_HAVE_ALARM 1 /* Define if the __attribute__(()) extension is present */ -/* #define H5_HAVE_ATTRIBUTE 1 */ +/* #undef H5_HAVE_ATTRIBUTE */ /* Define to 1 if you have the `BSDgettimeofday' function. */ /* #undef H5_HAVE_BSDGETTIMEOFDAY */ @@ -83,6 +83,9 @@ /* Define if the compiler understands the __func__ keyword */ #define H5_HAVE_C99_FUNC 1 +/* Define to 1 if you have the `clock_gettime' function. */ +#define H5_HAVE_CLOCK_GETTIME 1 + /* Define if the function stack tracing code is to be compiled in */ /* #undef H5_HAVE_CODESTACK */ @@ -103,10 +106,10 @@ /* #undef H5_HAVE_DMALLOC_H */ /* Define if library information should be embedded in the executables */ -/* #define H5_HAVE_EMBEDDED_LIBINFO 1 */ +/* #undef H5_HAVE_EMBEDDED_LIBINFO */ /* Define to 1 if you have the header file. */ -/* #define H5_HAVE_FEATURES_H 1 */ +/* #undef H5_HAVE_FEATURES_H */ /* Define if support for deflate (zlib) filter is enabled */ #define H5_HAVE_FILTER_DEFLATE 1 @@ -127,7 +130,7 @@ /* #undef H5_HAVE_FILTER_SZIP */ /* Define to 1 if you have the `fork' function. */ -/* #define H5_HAVE_FORK 1 */ +/* #undef H5_HAVE_FORK */ /* Define to 1 if you have the `frexpf' function. */ #define H5_HAVE_FREXPF 1 @@ -135,23 +138,23 @@ /* Define to 1 if you have the `frexpl' function. */ #define H5_HAVE_FREXPL 1 -/* Define to 1 if you have the `fseek64' function. */ -/* #undef H5_HAVE_FSEEK64 */ - /* Define to 1 if you have the `fseeko' function. */ #define H5_HAVE_FSEEKO 1 +/* Define to 1 if you have the `fseek64' function. */ +/* #undef H5_HAVE_FSEEKO64 */ + /* Define to 1 if you have the `fstat64' function. */ -/* #define H5_HAVE_FSTAT64 1 */ +/* #undef H5_HAVE_FSTAT64 */ /* Define to 1 if you have the `ftello' function. */ #define H5_HAVE_FTELLO 1 /* Define to 1 if you have the `ftruncate64' function. */ -/* #define H5_HAVE_FTRUNCATE64 1 */ +/* #undef H5_HAVE_FTRUNCATE64 */ /* Define if the compiler understands the __FUNCTION__ keyword */ -/* #define H5_HAVE_FUNCTION 1 */ +/* #undef H5_HAVE_FUNCTION */ /* Define to 1 if you have the `GetConsoleScreenBufferInfo' function. */ /* #undef H5_HAVE_GETCONSOLESCREENBUFFERINFO */ @@ -160,10 +163,10 @@ #define H5_HAVE_GETHOSTNAME 1 /* Define to 1 if you have the `getpwuid' function. */ -/* #define H5_HAVE_GETPWUID 1 */ +/* #undef H5_HAVE_GETPWUID */ /* Define to 1 if you have the `getrusage' function. */ -/* #define H5_HAVE_GETRUSAGE 1 */ +/* #undef H5_HAVE_GETRUSAGE */ /* Define to 1 if you have the `gettextinfo' function. */ /* #undef H5_HAVE_GETTEXTINFO */ @@ -227,16 +230,22 @@ /* #undef H5_HAVE_LIBSZ */ /* Define to 1 if you have the `z' library (-lz). */ -/* #define H5_HAVE_LIBZ 1 */ +/* #undef H5_HAVE_LIBZ */ /* Define to 1 if you have the `longjmp' function. */ #define H5_HAVE_LONGJMP 1 /* Define to 1 if you have the `lseek64' function. */ -/* #define H5_HAVE_LSEEK64 1 */ +/* #undef H5_HAVE_LSEEK64 */ /* Define to 1 if you have the `lstat' function. */ -/* #define H5_HAVE_LSTAT 1 */ +/* #undef H5_HAVE_LSTAT */ + +/* Define to 1 if you have the header file. */ +/* #undef H5_HAVE_MACH_MACH_TIME_H */ + +/* Define to 1 if you have the header file. */ +/* #undef H5_HAVE_MEMORY_H */ /* Define if we have MPE support */ /* #undef H5_HAVE_MPE */ @@ -277,6 +286,12 @@ /* Define to 1 if you have the `signal' function. */ #define H5_HAVE_SIGNAL 1 +/* Define to 1 if you have the `sigprocmask' function. */ +/* #undef H5_HAVE_SIGPROCMASK */ + +/* Define to 1 if you have the `sigsetjmp' function. */ +/* #undef H5_HAVE_SIGSETJMP */ + /* Define to 1 if you have the `snprintf' function. */ #define H5_HAVE_SNPRINTF 1 @@ -284,16 +299,16 @@ #define H5_HAVE_SRANDOM 1 /* Define to 1 if you have the `stat64' function. */ -/* #define H5_HAVE_STAT64 1 */ +/* #undef H5_HAVE_STAT64 */ /* Define if `struct stat' has the `st_blocks' field */ -/* #define H5_HAVE_STAT_ST_BLOCKS 1 */ +/* #undef H5_HAVE_STAT_ST_BLOCKS */ /* Define to 1 if you have the header file. */ #define H5_HAVE_STDDEF_H 1 /* Define to 1 if you have the header file. */ -/* #define H5_HAVE_STDINT_H 1 */ +/* #undef H5_HAVE_STDINT_H */ /* Define to 1 if you have the header file. */ #define H5_HAVE_STDLIB_H 1 @@ -311,7 +326,7 @@ /* #undef H5_HAVE_STRUCT_TEXT_INFO */ /* Define if `struct timezone' is defined */ -/* #define H5_HAVE_STRUCT_TIMEZONE 1 */ +/* #undef H5_HAVE_STRUCT_TIMEZONE */ /* Define to 1 if `tm_zone' is member of `struct tm'. */ #define H5_HAVE_STRUCT_TM_TM_ZONE 1 @@ -320,7 +335,7 @@ /* #undef H5_HAVE_STRUCT_VIDEOCONFIG */ /* Define to 1 if you have the `symlink' function. */ -/* #define H5_HAVE_SYMLINK 1 */ +/* #undef H5_HAVE_SYMLINK */ /* Define to 1 if you have the `system' function. */ #define H5_HAVE_SYSTEM 1 @@ -374,7 +389,7 @@ #define H5_HAVE_TMPFILE 1 /* Define if `tm_gmtoff' is a member of `struct tm' */ -/* #define H5_HAVE_TM_GMTOFF 1 */ +/* #undef H5_HAVE_TM_GMTOFF */ /* Define to 1 if your `struct tm' has `tm_zone'. Deprecated, use `HAVE_STRUCT_TM_TM_ZONE' instead. */ @@ -388,7 +403,7 @@ #define H5_HAVE_UNISTD_H 1 /* Define to 1 if you have the `vasprintf' function. */ -/* #define H5_HAVE_VASPRINTF 1 */ +/* #undef H5_HAVE_VASPRINTF */ /* Define to 1 if you have the `vsnprintf' function. */ #define H5_HAVE_VSNPRINTF 1 @@ -419,7 +434,7 @@ /* Define if your system can't handle converting floating-point values to long long. */ -/* #define H5_HW_FP_TO_LLONG_NOT_WORKS 1 */ +/* #undef H5_HW_FP_TO_LLONG_NOT_WORKS */ /* Define if HDF5's high-level library headers should be included in hdf5.h */ #define H5_INCLUDE_HL 1 @@ -438,6 +453,10 @@ values correctly. */ #define H5_LDOUBLE_TO_LLONG_ACCURATE 1 +/* Define if your system converts long double to (unsigned) long values with + special algorithm. */ +/* #undef H5_LDOUBLE_TO_LONG_SPECIAL */ + /* Define if your system can convert long double to unsigned int values correctly. */ #define H5_LDOUBLE_TO_UINT_ACCURATE 1 @@ -449,6 +468,10 @@ values correctly. */ #define H5_LLONG_TO_LDOUBLE_CORRECT 1 +/* Define if your system can convert (unsigned) long to long double values + with special algorithm. */ +/* #undef H5_LONG_TO_LDOUBLE_SPECIAL */ + /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define H5_LT_OBJDIR ".libs/" @@ -456,17 +479,10 @@ /* Define if the metadata trace file code is to be compiled in */ /* #undef H5_METADATA_TRACE_FILE */ -/* Define if your system can handle complicated MPI derived datatype - correctly. */ -/* #undef H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS */ - /* Define if your system's `MPI_File_set_size' function works for files over 2GB. */ /* #undef H5_MPI_FILE_SET_SIZE_BIG */ -/* Define if your system can handle special collective IO properly. */ -/* #undef H5_MPI_SPECIAL_COLLECTIVE_IO_WORKS */ - /* Define if we can violate pointer alignment restrictions */ #define H5_NO_ALIGNMENT_RESTRICTIONS 1 @@ -486,13 +502,16 @@ #define H5_PACKAGE_NAME "HDF5" /* Define to the full name and version of this package. */ -#define H5_PACKAGE_STRING "HDF5 1.9.81-FA_a5" +#define H5_PACKAGE_STRING "HDF5 1.9.111-FA_a5" /* Define to the one symbol short name of this package. */ #define H5_PACKAGE_TARNAME "hdf5" +/* Define to the home page for this package. */ +#define H5_PACKAGE_URL "" + /* Define to the version of this package. */ -#define H5_PACKAGE_VERSION "1.9.81-FA_a5" +#define H5_PACKAGE_VERSION "1.9.111-FA_a5" /* Width for printf() for type `long long' or `__int64', use `ll' */ #define H5_PRINTF_LL_WIDTH "ll" @@ -522,28 +541,28 @@ #define H5_SIZEOF_INT8_T 1 /* The size of `int_fast16_t', as computed by sizeof. */ -/* #define H5_SIZEOF_INT_FAST16_T 4 */ +/* #define H5_SIZEOF_INT_FAST16_T 0 */ /* The size of `int_fast32_t', as computed by sizeof. */ -/* #define H5_SIZEOF_INT_FAST32_T 4 */ +/* #define H5_SIZEOF_INT_FAST32_T 0 */ /* The size of `int_fast64_t', as computed by sizeof. */ -/* #define H5_SIZEOF_INT_FAST64_T 8 */ +/* #define H5_SIZEOF_INT_FAST64_T 0 */ /* The size of `int_fast8_t', as computed by sizeof. */ -/* #define H5_SIZEOF_INT_FAST8_T 1 */ +/* #define H5_SIZEOF_INT_FAST8_T 0 */ /* The size of `int_least16_t', as computed by sizeof. */ -/* #define H5_SIZEOF_INT_LEAST16_T 2 */ +/* #define H5_SIZEOF_INT_LEAST16_T 0 */ /* The size of `int_least32_t', as computed by sizeof. */ -/* #define H5_SIZEOF_INT_LEAST32_T 4 */ +/* #define H5_SIZEOF_INT_LEAST32_T 0 */ /* The size of `int_least64_t', as computed by sizeof. */ -/* #define H5_SIZEOF_INT_LEAST64_T 8 */ +/* #define H5_SIZEOF_INT_LEAST64_T 0 */ /* The size of `int_least8_t', as computed by sizeof. */ -/* #define H5_SIZEOF_INT_LEAST8_T 1 */ +/* #define H5_SIZEOF_INT_LEAST8_T 0 */ /* The size of `long', as computed by sizeof. */ #define H5_SIZEOF_LONG 4 @@ -555,11 +574,14 @@ #define H5_SIZEOF_LONG_LONG 8 /* The size of `off64_t', as computed by sizeof. */ -/* #define H5_SIZEOF_OFF64_T 8 */ +#define H5_SIZEOF_OFF64_T 0 /* The size of `off_t', as computed by sizeof. */ #define H5_SIZEOF_OFF_T 8 +/* The size of `ptrdiff_t', as computed by sizeof. */ +#define H5_SIZEOF_PTRDIFF_T 4 + /* The size of `short', as computed by sizeof. */ #define H5_SIZEOF_SHORT 2 @@ -582,28 +604,28 @@ #define H5_SIZEOF_UINT8_T 1 /* The size of `uint_fast16_t', as computed by sizeof. */ -/* #define H5_SIZEOF_UINT_FAST16_T 4 */ +/* #define H5_SIZEOF_UINT_FAST16_T 0 */ /* The size of `uint_fast32_t', as computed by sizeof. */ -/* #define H5_SIZEOF_UINT_FAST32_T 4 */ +/* #define H5_SIZEOF_UINT_FAST32_T 0 */ /* The size of `uint_fast64_t', as computed by sizeof. */ -/* #define H5_SIZEOF_UINT_FAST64_T 8 */ +/* #define H5_SIZEOF_UINT_FAST64_T 0 */ /* The size of `uint_fast8_t', as computed by sizeof. */ -/* #define H5_SIZEOF_UINT_FAST8_T 1 */ +/* #define H5_SIZEOF_UINT_FAST8_T 0 */ /* The size of `uint_least16_t', as computed by sizeof. */ -/* #define H5_SIZEOF_UINT_LEAST16_T 2 */ +/* #define H5_SIZEOF_UINT_LEAST16_T 0 */ /* The size of `uint_least32_t', as computed by sizeof. */ -/* #define H5_SIZEOF_UINT_LEAST32_T 4 */ +/* #define H5_SIZEOF_UINT_LEAST32_T 0 */ /* The size of `uint_least64_t', as computed by sizeof. */ -/* #define H5_SIZEOF_UINT_LEAST64_T 8 */ +/* #define H5_SIZEOF_UINT_LEAST64_T 0 */ /* The size of `uint_least8_t', as computed by sizeof. */ -/* #define H5_SIZEOF_UINT_LEAST8_T 1 */ +/* #define H5_SIZEOF_UINT_LEAST8_T 0 */ /* The size of `unsigned', as computed by sizeof. */ #define H5_SIZEOF_UNSIGNED 4 @@ -615,7 +637,7 @@ #define H5_STDC_HEADERS 1 /* Define if strict file format checks are enabled */ -/* #define H5_STRICT_FORMAT_CHECKS 1 */ +/* #undef H5_STRICT_FORMAT_CHECKS */ /* Define if your system supports pthread_attr_setscope(&attribute, PTHREAD_SCOPE_SYSTEM) call. */ @@ -635,6 +657,10 @@ correct precision. */ #define H5_ULLONG_TO_LDOUBLE_PRECISION 1 +/* Define if your system accurately converting unsigned long to float values. + */ +/* #undef H5_ULONG_TO_FLOAT_ACCURATE */ + /* Define if your system can accurately convert unsigned (long) long values to floating-point values. */ #define H5_ULONG_TO_FP_BOTTOM_BIT_ACCURATE 1 @@ -648,7 +674,7 @@ /* #undef H5_USING_MEMCHECKER */ /* Version number of package */ -#define H5_VERSION "1.9.81-FA_a5" +#define H5_VERSION "1.9.111-FA_a5" /* Define if vsnprintf() returns the correct value for formatted strings that don't fit into size allowed */ @@ -662,15 +688,13 @@ /* Define to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel and VAX). */ -/* #if defined AC_APPLE_UNIVERSAL_BUILD */ -/* # if defined __BIG_ENDIAN__ */ -/* # define WORDS_BIGENDIAN 1 */ -/* # endif */ -/* #else */ -/* # ifndef WORDS_BIGENDIAN */ -/* # undef WORDS_BIGENDIAN */ -/* # endif */ -/* #endif */ +/* #undef H5_WORDS_BIGENDIAN */ + +/* Number of bits in a file offset, on hosts where this is settable. */ +/* #undef H5__FILE_OFFSET_BITS */ + +/* Define for large files, on AIX-style hosts. */ +/* #undef H5__LARGE_FILES */ /* Define to empty if `const' does not conform to ANSI C. */ /* #undef H5_const */ @@ -684,6 +708,9 @@ /* Define to `long int' if does not define. */ /* #undef H5_off_t */ +/* Define to `long' if does not define. */ +/* #undef H5_ptrdiff_t */ + /* Define to `unsigned long' if does not define. */ /* #undef H5_size_t */ diff --git a/vms/src/make.com b/vms/src/make.com index 48d5fae..bd1f55c 100644 --- a/vms/src/make.com +++ b/vms/src/make.com @@ -43,15 +43,15 @@ $ cobj= "H5, H5checksum, H5dbg, H5system, H5timer, H5trace,"+- "H5EA, H5EAcache, H5EAdbg, H5EAdblkpage, H5EAdblock, H5EAhdr, H5EAiblock, H5EAint,"+- "H5EAsblock, H5EAstat, H5EAtest, H5E, H5Edeprec, H5Eint,"+- "H5FA, H5FAcache, H5FAdbg, H5FAdblkpage, H5FAdblock, H5FAhdr, H5FAstat, H5FAtest,"+- - "H5Faccum, H5F, H5Fdbg, H5Fdeprec, H5FD, H5FDcore, H5FDdirect, H5FDfamily, H5FDint, H5FDlog, "+- + "H5Faccum, H5F, H5Fcwfs, H5Fdbg, H5Fdeprec, H5FD, H5FDcore, H5FDdirect, H5FDfamily, H5FDint, H5FDlog, "+- "H5FDmpi, H5FDmpio, H5FDmpiposix, H5FDmulti, H5FDsec2, H5FDspace, H5FDstdio, H5FDwindows,"+- - "H5Ffake, H5Fio, H5FL, H5Fmount, H5Fmpi, H5FO, H5Fquery, H5FS, H5FScache, H5FSdbg, H5Fsfile,"+- - "H5FSsection, H5FSstat, H5FStest, H5Fsuper, H5Fsuper_cache, H5Ftest,"+- + "H5Fefc, H5Ffake, H5Fio, H5FL, H5Fmount, H5Fmpi, H5FO, H5Fquery, H5FS, H5FScache, H5FSdbg,"+- + "H5Fsfile, H5FSsection, H5FSstat, H5FStest, H5Fsuper, H5Fsuper_cache, H5Ftest,"+- "H5Gbtree2, H5G, H5Gcache, H5Gcompact, H5Gdense, H5Gdeprec, H5Gent, H5Gint, H5Glink, H5Gloc,"+- "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, H5HLint, H5HP, H5I, H5Itest, H5L, H5Lexternal" + "H5HG, H5HGcache, H5HGdbg, H5HGquery, H5HL, H5HLcache, H5HLdbg, H5HLint, H5HP, H5I, H5Itest, H5L, H5Lexternal" $ cobj1= "H5MFaggr, H5MF, H5MFdbg, H5MFsection, H5MM,"+- "H5MP, H5MPtest, H5Oainfo, H5Oalloc, H5Oattr, H5Oattribute, H5Obogus, H5Obtreek,"+- "H5O, H5Ocache, H5Ochunk, H5Ocont, H5Ocopy, H5Odbg, H5Odrvinfo, H5Odtype, H5Oefl, H5Ofill, H5Ofsinfo,"+- diff --git a/vms/test/H5srcdir_str.h b/vms/test/H5srcdir_str.h index faf1b03..9dfcf56 100644 --- a/vms/test/H5srcdir_str.h +++ b/vms/test/H5srcdir_str.h @@ -19,4 +19,4 @@ */ /* Set the 'srcdir' path from configure time */ -static const char *config_srcdir = "[.]"; +static const char *config_srcdir = "[-.test]"; diff --git a/vms/test/check.com b/vms/test/check.com index af64d6f..5a3c945 100644 --- a/vms/test/check.com +++ b/vms/test/check.com @@ -110,6 +110,13 @@ $ type sys$input $ run earray $ type sys$input +$! Skip this test for now because it opens the same file many times. +$! Please see Issue 7620 in Jira about it. +$! type sys$input +$! ------- Running efc ------- +$! run efc +$! type sys$input + $ type sys$input ------- Running enum ------- $ run enum diff --git a/vms/test/make.com b/vms/test/make.com index 5e46479..22479c6 100644 --- a/vms/test/make.com +++ b/vms/test/make.com @@ -152,6 +152,12 @@ $ link earray, - libh5test.olb/lib,[-.src]hdf5.olb/lib,zlib_dir:libz.olb/lib $! $ type sys$input + Creating efc test +$ ccc efc +$ link efc, - + libh5test.olb/lib,[-.src]hdf5.olb/lib,zlib_dir:libz.olb/lib +$! +$ type sys$input Creating enum test $ ccc enum $ link enum, - diff --git a/windows/proj/hdf5_hl_cpp/hdf5_hl_cpp.vcproj b/windows/proj/hdf5_hl_cpp/hdf5_hl_cpp.vcproj index 2938143..2d1bbea 100644 --- a/windows/proj/hdf5_hl_cpp/hdf5_hl_cpp.vcproj +++ b/windows/proj/hdf5_hl_cpp/hdf5_hl_cpp.vcproj @@ -1,331 +1,331 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + ProjectType="Visual C++" + Version="9.00" + Name="hdf5_hl_cpp" + ProjectGUID="{7693B383-C2CB-43FD-A428-598F73D214F7}" + TargetFrameworkVersion="131072" + > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/windows/src/H5pubconf.h b/windows/src/H5pubconf.h old mode 100755 new mode 100644 index e68c7d4..3a30f87 --- a/windows/src/H5pubconf.h +++ b/windows/src/H5pubconf.h @@ -1,24 +1,43 @@ -/* windows/src/H5pubconf.h. Adapted from generated Linux src/H5pubconf.h */ -/* src/H5config.h. Generated from H5config.h.in by configure. */ -/* src/H5config.h.in. Generated from configure.in by autoheader. */ - -/* - * Windows Specific Definitions +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* NOTE: This file is created by hand from the Linux src/H5pubconf.h file. + * Most Windows builds are handled by CMake which generates its own + * H5pubconf.h file so this file can easily get out of date. Please notify + * Dana Robinson if the settings here have issues. */ +/******************************** + * Windows Specific Definitions * + ********************************/ + /* Define if the Windows virtual file driver should be compiled */ #define H5_HAVE_WINDOWS 1 -/* Define if the Windows virtual file driver should use buffered IO functions */ -/* #undef WINDOWS_USE_STDIO */ +/* Define if on the Windows platform */ +#define H5_HAVE_WIN32_API 1 -/* Define the maximum write size for the Windows file driver. Larger writes - will be split into many writes. Safe values are 1 <= WINDOWS_MAX_BUF <= 2GB-1. */ -#define WINDOWS_MAX_BUF (1024 * 1024 * 1024) +/* Define if using a Windows compiler (i.e. Visual Studio) */ +#define H5_HAVE_VISUAL_STUDIO 1 -/* - * End of Windows Specific Definitions - */ +/*************************************** + * End of Windows Specific Definitions * + ***************************************/ + +/* Define if building universal (internal helper macro) */ +/* #undef H5_AC_APPLE_UNIVERSAL_BUILD */ /* Define if your system generates wrong code for log2 routine. */ /* #undef H5_BAD_LOG2_CODE_GENERATED */ @@ -35,7 +54,7 @@ #define H5_CXX_HAVE_OFFSETOF 1 /* Define the default virtual file driver to compile */ -#define H5_DEFAULT_VFD H5FD_WINDOWS +#define H5_DEFAULT_VFD H5FD_SEC2 /* Define if `dev_t' is a scalar */ #define H5_DEV_T_IS_SCALAR 1 @@ -68,7 +87,7 @@ /* Define if your system has right maximum convert floating-point to unsigned long long values. */ -/* #undef H5_FP_TO_ULLONG_RIGHT_MAXIMUM 1 */ +/* #undef H5_FP_TO_ULLONG_RIGHT_MAXIMUM */ /* Define if gettimeofday() populates the tz pointer passed in */ #define H5_GETTIMEOFDAY_GIVES_TZ 1 @@ -89,6 +108,9 @@ /* Define if the compiler understand the __func__ keyword */ /* #undef H5_HAVE_C99_FUNC */ +/* Define to 1 if you have the `clock_gettime' function. */ +/* #undef H5_HAVE_CLOCK_GETTIME */ + /* Define if the function stack tracing code is to be compiled in */ /* #undef H5_HAVE_CODESTACK */ @@ -108,6 +130,9 @@ /* Define to 1 if you have the header file. */ /* #undef H5_HAVE_DMALLOC_H */ +/* Define if library information should be embedded in the executables */ +/* #undef H5_HAVE_EMBEDDED_LIBINFO */ + /* Define to 1 if you have the header file. */ /* #undef H5_HAVE_FEATURES_H */ @@ -138,18 +163,24 @@ /* Define to 1 if you have the `frexpl' function. */ /* #undef H5_HAVE_FREXPL */ -/* Define to 1 if you have the `fseek64' function. */ -/* #undef H5_HAVE_FSEEK64 */ - /* Define to 1 if you have the `fseeko' function. */ /* #undef H5_HAVE_FSEEKO */ +/* Define to 1 if you have the `fseek64' function. */ +/* #undef H5_HAVE_FSEEKO64 */ + /* Define to 1 if you have the `fstat64' function. */ /* #undef H5_HAVE_FSTAT64 */ /* Define to 1 if you have the `ftello' function. */ /* #undef H5_HAVE_FTELLO */ +/* Define to 1 if you have the `ftello64' function. */ +/* #undef H5_HAVE_FTELLO64 */ + +/* Define to 1 if you have the `ftruncate64' function. */ +/* #undef H5_HAVE_FTRUNCATE64 */ + /* Define if the compiler understand the __FUNCTION__ keyword */ #define H5_HAVE_FUNCTION 1 @@ -163,7 +194,7 @@ /* #undef H5_HAVE_GETPWUID */ /* Define to 1 if you have the `getrusage' function. */ -/* #define H5_HAVE_GETRUSAGE 1 */ +/* #undef H5_HAVE_GETRUSAGE */ /* Define to 1 if you have the `gettextinfo' function. */ /* #undef H5_HAVE_GETTEXTINFO */ @@ -235,6 +266,15 @@ /* Define to 1 if you have the `lseek64' function. */ /* #undef H5_HAVE_LSEEK64 */ +/* Define to 1 if you have the `lstat' function. */ +/* #undef H5_HAVE_LSTAT */ + +/* Define to 1 if you have the header file. */ +/* #undef H5_HAVE_MACH_MACH_TIME_H */ + +/* Define to 1 if you have the header file. */ +/* #undef H5_HAVE_MEMORY_H */ + /* Define if we have MPE support */ /* #undef H5_HAVE_MPE */ @@ -268,15 +308,18 @@ /* Define to 1 if you have the `setsysinfo' function. */ /* #undef H5_HAVE_SETSYSINFO */ -/* Define to 1 if you have the `sigaction' function. */ -/* #undef H5_HAVE_SIGACTION */ - /* Define to 1 if you have the `siglongjmp' function. */ /* #undef H5_HAVE_SIGLONGJMP */ /* Define to 1 if you have the `signal' function. */ #define H5_HAVE_SIGNAL 1 +/* Define to 1 if you have the `sigprocmask' function. */ +/* #undef H5_HAVE_SIGPROCMASK */ + +/* Define to 1 if you have the `sigsetjmp' function. */ +/* #undef H5_HAVE_SIGSETJMP */ + /* Define to 1 if you have the `snprintf' function. */ /* #undef H5_HAVE_SNPRINTF */ @@ -319,6 +362,9 @@ /* Define if `struct videoconfig' is defined */ /* #undef H5_HAVE_STRUCT_VIDEOCONFIG */ +/* Define to 1 if you have the `symlink' function. */ +/* #undef H5_HAVE_SYMLINK */ + /* Define to 1 if you have the `system' function. */ #define H5_HAVE_SYSTEM 1 @@ -432,6 +478,10 @@ values correctly. */ #define H5_LDOUBLE_TO_LLONG_ACCURATE 1 +/* Define if your system converts long double to (unsigned) long values with + special algorithm. */ +/* #undef H5_LDOUBLE_TO_LONG_SPECIAL */ + /* Define if your system can convert long double to unsigned int values correctly. */ #define H5_LDOUBLE_TO_UINT_ACCURATE 1 @@ -443,6 +493,10 @@ values correctly. */ #define H5_LLONG_TO_LDOUBLE_CORRECT 1 +/* Define if your system can convert (unsigned) long to long double values + with special algorithm. */ +/* #undef H5_LONG_TO_LDOUBLE_SPECIAL */ + /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define H5_LT_OBJDIR ".libs/" @@ -450,17 +504,10 @@ /* Define if the metadata trace file code is to be compiled in */ /* #undef H5_METADATA_TRACE_FILE */ -/* Define if your system can handle complicated MPI derived datatype - correctly. */ -#define H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS 1 - /* Define if your system's `MPI_File_set_size' function works for files over 2GB. */ #define H5_MPI_FILE_SET_SIZE_BIG 1 -/* Define if your system can handle special collective IO properly. */ -#define H5_MPI_SPECIAL_COLLECTIVE_IO_WORKS 1 - /* Define if we can violate pointer alignment restrictions */ #define H5_NO_ALIGNMENT_RESTRICTIONS 1 @@ -480,13 +527,16 @@ #define H5_PACKAGE_NAME "HDF5" /* Define to the full name and version of this package. */ -#define H5_PACKAGE_STRING "HDF5 1.9.81-FA_a5" +#define H5_PACKAGE_STRING "HDF5 1.9.111-FA_a5" /* Define to the one symbol short name of this package. */ #define H5_PACKAGE_TARNAME "hdf5" +/* Define to the home page for this package. */ +#define H5_PACKAGE_URL "" + /* Define to the version of this package. */ -#define H5_PACKAGE_VERSION "1.9.81-FA_a5" +#define H5_PACKAGE_VERSION "1.9.111-FA_a5" /* Width for printf() for type `long long' or `__int64', use `ll' */ #define H5_PRINTF_LL_WIDTH "I64" @@ -554,6 +604,13 @@ /* The size of `off_t', as computed by sizeof. */ #define H5_SIZEOF_OFF_T 4 +/* The size of `ptrdiff_t', as computed by sizeof. */ +#ifndef _WIN64 +#define H5_SIZEOF_PTRDIFF_T 4 +#else +#define H5_SIZEOF_PTRDIFF_T 8 +#endif /* _WIN64 */ + /* The size of `short', as computed by sizeof. */ #define H5_SIZEOF_SHORT 2 @@ -603,6 +660,9 @@ /* The size of `uint_least8_t', as computed by sizeof. */ #define H5_SIZEOF_UINT_LEAST8_T 0 +/* The size of `unsigned', as computed by sizeof. */ +#define H5_SIZEOF_UNSIGNED 4 + /* The size of `__int64', as computed by sizeof. */ #define H5_SIZEOF___INT64 8 @@ -630,6 +690,10 @@ correct precision. */ #define H5_ULLONG_TO_LDOUBLE_PRECISION 1 +/* Define if your system accurately converting unsigned long to float values. + */ +/* #undef H5_ULONG_TO_FLOAT_ACCURATE */ + /* Define if your system can accurately convert unsigned (long) long values to floating-point values. */ /* #undef H5_ULONG_TO_FP_BOTTOM_BIT_ACCURATE */ @@ -643,7 +707,7 @@ /* #undef H5_USING_MEMCHECKER */ /* Version number of package */ -#define H5_VERSION "1.9.81-FA_a5" +#define H5_VERSION "1.9.111-FA_a5" /* Define if vsnprintf() returns the correct value for formatted strings that don't fit into size allowed */ @@ -659,6 +723,12 @@ first (like Motorola and SPARC, unlike Intel and VAX). */ /* #undef H5_WORDS_BIGENDIAN */ +/* Number of bits in a file offset, on hosts where this is settable. */ +/* #undef H5__FILE_OFFSET_BITS */ + +/* Define for large files, on AIX-style hosts. */ +/* #undef H5__LARGE_FILES */ + /* Define to empty if `const' does not conform to ANSI C. */ /* #undef H5_const */ @@ -671,8 +741,15 @@ /* Define to `long int' if does not define. */ /* #undef H5_off_t */ +/* Define to `long' if does not define. */ +/* #undef H5_ptrdiff_t */ + /* Define to `unsigned long' if does not define. */ /* #undef H5_size_t */ /* Define to `long' if does not define. */ +#ifndef _WIN64 #define H5_ssize_t long +#else +#define H5_ssize_t long long +#endif /* _WIN64 */ diff --git a/windows/tools/h5diff/testh5diff.bat b/windows/tools/h5diff/testh5diff.bat index 9b73b60..491332f 100644 --- a/windows/tools/h5diff/testh5diff.bat +++ b/windows/tools/h5diff/testh5diff.bat @@ -59,6 +59,8 @@ set srcexclude1_2=h5diff_exclude1-2.h5 set srcexclude2_1=h5diff_exclude2-1.h5 set srcexclude2_2=h5diff_exclude2-2.h5 set src_comp_vl_strs=h5diff_comp_vl_strs.h5 +set src_COMPS_ARRAY_VLEN1=compounds_array_vlen1.h5 +set src_COMPS_ARRAY_VLEN2=compounds_array_vlen2.h5 set src_ATTR_VERBOSE_LEVEL_FILE1=h5diff_attr_v_level1.h5 set src_ATTR_VERBOSE_LEVEL_FILE2=h5diff_attr_v_level2.h5 @@ -93,6 +95,8 @@ set exclude1_2=%indir%\h5diff_exclude1-2.h5 set exclude2_1=%indir%\h5diff_exclude2-1.h5 set exclude2_2=%indir%\h5diff_exclude2-2.h5 set comp_vl_strs=%indir%\h5diff_comp_vl_strs.h5 +set COMPS_ARRAY_VLEN1=%indir%\compounds_array_vlen1.h5 +set COMPS_ARRAY_VLEN2=%indir%\compounds_array_vlen2.h5 set ATTR_VERBOSE_LEVEL_FILE1=%indir%\h5diff_attr_v_level1.h5 set ATTR_VERBOSE_LEVEL_FILE2=%indir%\h5diff_attr_v_level2.h5 @@ -297,12 +301,12 @@ rem ############################################################################ call :tooltest h5diff_17.txt -v %file1% %file2% rem 1.71 test 32-bit INFINITY - call :testing %h5diff% -v %srcfile1% %srcfile1% /g1/fp19 - call :tooltest h5diff_171.txt -v %file1% %file1% /g1/fp19 + call :testing %h5diff% -v %srcfile1% %srcfile1% /g1/fp19 /g1/fp19_COPY + call :tooltest h5diff_171.txt -v %file1% %file1% /g1/fp19 /g1/fp19_COPY rem 1.72 test 64-bit INFINITY - call :testing %h5diff% -v %srcfile1% %srcfile1% /g1/fp20 - call :tooltest h5diff_172.txt -v %file1% %file1% /g1/fp20 + call :testing %h5diff% -v %srcfile1% %srcfile1% /g1/fp20 /g1/fp20_COPY + call :tooltest h5diff_172.txt -v %file1% %file1% /g1/fp20 /g1/fp20_COPY rem 1.8 quiet mode call :testing %h5diff% -q %srcfile1% %srcfile2% @@ -528,6 +532,16 @@ rem ############################################################################ call :testing %h5diff% file1.h6 file2.h6 call :tooltest h5diff_629.txt file1.h6 file2.h6 + rem ###################################################################### + rem # NaN + rem ###################################################################### + rem 6.30: test (NaN == NaN) must be true based on our documentation -- XCAO + call :testing %h5diff% -v -d "0.0001" %srcfile1% %srcfile1% g1/fp18 g1/fp18_COPY + call :tooltest h5diff_630.txt -v -d "0.0001" %file1% %file1% g1/fp18 g1/fp18_COPY + call :testing %h5diff% -v --use-system-epsilon %srcfile1% %srcfile1% g1/fp18 g1/fp18_COPY + call :tooltest h5diff_631.txt -v --use-system-epsilon %file1% %file1% g1/fp18 g1/fp18_COPY + + rem ######################################################################## rem 7. attributes rem ######################################################################## @@ -884,9 +898,9 @@ rem ############################################################################ call :tooltest h5diff_518.txt -v --follow-symlinks %grp_recurse1_ext% %grp_recurse2_ext1% /g1 - rem ############################################################################## + rem ####################################################################### rem # Exclude objects (--exclude-path) - rem ############################################################################## + rem ####################################################################### rem #------------------------------------------------- rem # Same structure, same names and different value. @@ -913,12 +927,45 @@ rem ############################################################################ call :testing %h5diff% -v --exclude-path "/dset3" %srcexclude1_1% %srcexclude1_2% /group1 call :tooltest h5diff_484.txt -v --exclude-path "/dset3" %exclude1_1% %exclude1_2% /group1 - rem ############################################################################## + rem ####################################################################### rem # diff various multiple vlen and fixed strings in a compound type dataset - rem ############################################################################## - call :testing %h5diff% -v %src_comp_vl_strs% %src_comp_vl_strs% - call :tooltest h5diff_530.txt -v %comp_vl_strs% %comp_vl_strs% + rem ####################################################################### + call :testing %h5diff% -v %src_comp_vl_strs% %src_comp_vl_strs% /group /group_copy + call :tooltest h5diff_530.txt -v %comp_vl_strs% %comp_vl_strs% /group /group_copy + + rem # ##################################################################### + rem # # Test container types (array,vlen) with multiple nested compound types + rem # # Complex compound types in dataset and attribute + rem # ##################################################################### + call :testing %h5diff% -v %src_COMPS_ARRAY_VLEN1% %src_COMPS_ARRAY_VLEN2% + call :tooltest h5diff_540.txt -v %COMPS_ARRAY_VLEN1% %COMPS_ARRAY_VLEN2% + + rem ####################################################################### + rem # Test mutually exclusive options + rem ####################################################################### + + rem ------------------------------------------------------ + rem Test with -d , -p and --use-system-epsilon. + call :testing %h5diff% -v -d 5 -p 0.05 --use-system-epsilon %srcfile1% %srcfile2% /g1/dset3 /g1/dset4 + call :tooltest h5diff_640.txt -v -d 5 -p 0.05 --use-system-epsilon %file1% %file2% /g1/dset3 /g1/dset4 + + call :testing %h5diff% -v -d 5 -p 0.05 %srcfile1% %srcfile2% /g1/dset3 /g1/dset4 + call :tooltest h5diff_641.txt -v -d 5 -p 0.05 %file1% %file2% /g1/dset3 /g1/dset4 + + call :testing %h5diff% -v -p 0.05 -d 5 %srcfile1% %srcfile2% /g1/dset3 /g1/dset4 + call :tooltest h5diff_642.txt -v -p 0.05 -d 5 %file1% %file2% /g1/dset3 /g1/dset4 + + call :testing %h5diff% -v -d 5 --use-system-epsilon %srcfile1% %srcfile2% /g1/dset3 /g1/dset4 + call :tooltest h5diff_643.txt -v -d 5 --use-system-epsilon %file1% %file2% /g1/dset3 /g1/dset4 + + call :testing %h5diff% -v --use-system-epsilon -d 5 %srcfile1% %srcfile2% /g1/dset3 /g1/dset4 + call :tooltest h5diff_644.txt -v --use-system-epsilon -d 5 %file1% %file2% /g1/dset3 /g1/dset4 + + call :testing %h5diff% -v -p 0.05 --use-system-epsilon %srcfile1% %srcfile2% /g1/dset3 /g1/dset4 + call :tooltest h5diff_645.txt -v -p 0.05 --use-system-epsilon %file1% %file2% /g1/dset3 /g1/dset4 + call :testing %h5diff% -v --use-system-epsilon -p 0.05 %srcfile1% %srcfile2% /g1/dset3 /g1/dset4 + call :tooltest h5diff_646.txt -v --use-system-epsilon -p 0.05 %file1% %file2% /g1/dset3 /g1/dset4 rem ####################################################################### rem # END diff --git a/windows/tools/h5dump/testh5dump.bat b/windows/tools/h5dump/testh5dump.bat index dff1d1f..307765c 100644 --- a/windows/tools/h5dump/testh5dump.bat +++ b/windows/tools/h5dump/testh5dump.bat @@ -410,7 +410,8 @@ rem ############################################################################ call :tooltest tall-4s.ddl --dataset=/g1/g1.1/dset1.1.1 --start=1,1 --stride=2,3 --count=3,2 --block=1,1 tall.h5 call :tooltest tall-5s.ddl -d "/g1/g1.1/dset1.1.2[0;2;10;]" tall.h5 call :tooltest tdset-3s.ddl -d "/dset1[1,1;;;]" tdset.h5 - + rem block + rem call :tooltest tdset2-1s.ddl -d "/dset1[;3,2;4,4;1,4]" tdset2.h5 rem test printing characters in ASCII instead of decimal call :tooltest tchar1.ddl -r tchar.h5 @@ -614,8 +615,84 @@ rem ############################################################################ rem test for dangling external links call :tooltest textlink.ddl textlink.h5 - - + + rem test for dataset packed bits + rem Set up xCMD to test or skip. + rem Limits: + rem Maximum number of packed bits is 8 (for now). + rem Maximum integer size is 64 (for now). + rem Maximun Offset is 63 (Maximum size - 1). + rem Maximum Offset+Length is 64 (Maximum size). + rem Tests: + rem Normal operation on both signed and unsigned int datasets. + rem Sanity check + rem Their rawdata output should be the same. + call :tooltest tpbitsSignedWhole.ddl -d /DS08BITS -M 0,8 packedbits.h5 + call :tooltest tpbitsUnsignedWhole.ddl -d /DU08BITS -M 0,8 packedbits.h5 + call :tooltest tpbitsSignedIntWhole.ddl -d /DS16BITS -M 0,16 packedbits.h5 + call :tooltest tpbitsUnsignedIntWhole.ddl -d /DU16BITS -M 0,16 packedbits.h5 + call :tooltest tpbitsSignedLongWhole.ddl -d /DS32BITS -M 0,32 packedbits.h5 + call :tooltest tpbitsUnsignedLongWhole.ddl -d /DU32BITS -M 0,32 packedbits.h5 + call :tooltest tpbitsSignedLongLongWhole.ddl -d /DS64BITS -M 0,64 packedbits.h5 + call :tooltest tpbitsUnsignedLongLongWhole.ddl -d /DU64BITS -M 0,64 packedbits.h5 + call :tooltest tpbitsSignedLongLongWhole63.ddl -d /DS64BITS -M 0,63 packedbits.h5 + call :tooltest tpbitsUnsignedLongLongWhole63.ddl -d /DU64BITS -M 0,63 packedbits.h5 + call :tooltest tpbitsSignedLongLongWhole1.ddl -d /DS64BITS -M 1,63 packedbits.h5 + call :tooltest tpbitsUnsignedLongLongWhole1.ddl -d /DU64BITS -M 1,63 packedbits.h5 + rem Half sections + call :tooltest tpbitsSigned4.ddl -d /DS08BITS -M 0,4,4,4 packedbits.h5 + call :tooltest tpbitsUnsigned4.ddl -d /DU08BITS -M 0,4,4,4 packedbits.h5 + call :tooltest tpbitsSignedInt8.ddl -d /DS16BITS -M 0,8,8,8 packedbits.h5 + call :tooltest tpbitsUnsignedInt8.ddl -d /DU16BITS -M 0,8,8,8 packedbits.h5 + call :tooltest tpbitsSignedLong16.ddl -d /DS32BITS -M 0,16,16,16 packedbits.h5 + call :tooltest tpbitsUnsignedLong16.ddl -d /DU32BITS -M 0,16,16,16 packedbits.h5 + call :tooltest tpbitsSignedLongLong32.ddl -d /DS64BITS -M 0,32,32,32 packedbits.h5 + call :tooltest tpbitsUnsignedLongLong32.ddl -d /DU64BITS -M 0,32,32,32 packedbits.h5 + rem Quarter sections + call :tooltest tpbitsSigned2.ddl -d /DS08BITS -M 0,2,2,2,4,2,6,2 packedbits.h5 + call :tooltest tpbitsUnsigned2.ddl -d /DU08BITS -M 0,2,2,2,4,2,6,2 packedbits.h5 + call :tooltest tpbitsSignedInt4.ddl -d /DS16BITS -M 0,4,4,4,8,4,12,4 packedbits.h5 + call :tooltest tpbitsUnsignedInt4.ddl -d /DU16BITS -M 0,4,4,4,8,4,12,4 packedbits.h5 + call :tooltest tpbitsSignedLong8.ddl -d /DS32BITS -M 0,8,8,8,16,8,24,8 packedbits.h5 + call :tooltest tpbitsUnsignedLong8.ddl -d /DU32BITS -M 0,8,8,8,16,8,24,8 packedbits.h5 + call :tooltest tpbitsSignedLongLong16.ddl -d /DS64BITS -M 0,16,16,16,32,16,48,16 packedbits.h5 + call :tooltest tpbitsUnsignedLongLong16.ddl -d /DU64BITS -M 0,16,16,16,32,16,48,16 packedbits.h5 + rem Begin and End + call :tooltest tpbitsSigned.ddl -d /DS08BITS -M 0,2,2,6 packedbits.h5 + call :tooltest tpbitsUnsigned.ddl -d /DU08BITS -M 0,2,2,6 packedbits.h5 + call :tooltest tpbitsSignedInt.ddl -d /DS16BITS -M 0,2,10,6 packedbits.h5 + call :tooltest tpbitsUnsignedInt.ddl -d /DU16BITS -M 0,2,10,6 packedbits.h5 + call :tooltest tpbitsSignedLong.ddl -d /DS32BITS -M 0,2,26,6 packedbits.h5 + call :tooltest tpbitsUnsignedLong.ddl -d /DU32BITS -M 0,2,26,6 packedbits.h5 + call :tooltest tpbitsSignedLongLong.ddl -d /DS64BITS -M 0,2,58,6 packedbits.h5 + call :tooltest tpbitsUnsignedLongLong.ddl -d /DU64BITS -M 0,2,58,6 packedbits.h5 + rem Overlapped packed bits. + call :tooltest tpbitsOverlapped.ddl -d /DS08BITS -M 0,1,1,1,2,1,0,3 packedbits.h5 + rem Maximum number of packed bits. + call :tooltest tpbitsMax.ddl -d /DS08BITS -M 0,1,1,1,2,1,3,1,4,1,5,1,6,1,7,1 packedbits.h5 + rem Compound type. + call :tooltest tpbitsCompound.ddl -d /dset1 -M 0,1,1,1 tcompound.h5 + rem Array type. + call :tooltest tpbitsArray.ddl -d /Dataset1 -M 0,1,1,1 tarray1.h5 + rem Test Error handling. + rem Too many packed bits requested. Max is 8 for now. + call :tooltest tpbitsMaxExceeded.ddl -d /DS08BITS -M 0,1,0,1,1,1,2,1,3,1,4,1,5,1,6,1,7,1 packedbits.h5 + rem Offset too large. Max is 7 (8-1) for now. + call :tooltest tpbitsOffsetExceeded.ddl -d /DS08BITS -M 64,1 packedbits.h5 + call :tooltest tpbitsCharOffsetExceeded.ddl -d /DS08BITS -M 8,1 packedbits.h5 + call :tooltest tpbitsIntOffsetExceeded.ddl -d /DS16BITS -M 16,1 packedbits.h5 + call :tooltest tpbitsLongOffsetExceeded.ddl -d /DS32BITS -M 32,1 packedbits.h5 + rem Bad offset, must not be negative. + call :tooltest tpbitsOffsetNegative.ddl -d /DS08BITS -M -1,1 packedbits.h5 + rem Bad length, must not be positive. + call :tooltest tpbitsLengthPositive.ddl -d /DS08BITS -M 4,0 packedbits.h5 + rem Offset+Length is too large. Max is 8 for now. + call :tooltest tpbitsLengthExceeded.ddl -d /DS08BITS -M 37,28 packedbits.h5 + call :tooltest tpbitsCharLengthExceeded.ddl -d /DS08BITS -M 2,7 packedbits.h5 + call :tooltest tpbitsIntLengthExceeded.ddl -d /DS16BITS -M 10,7 packedbits.h5 + call :tooltest tpbitsLongLengthExceeded.ddl -d /DS32BITS -M 26,7 packedbits.h5 + rem Incomplete pair of packed bits request. + call :tooltest tpbitsIncomplete.ddl -d /DS08BITS -M 0,2,2,1,0,2,2, packedbits.h5 if %nerrors% equ 0 ( echo.All %dumper% tests passed. diff --git a/windows/tools/h5import/h5importtestutil.bat b/windows/tools/h5import/h5importtestutil.bat index 9c224f5..6ac8077 100644 --- a/windows/tools/h5import/h5importtestutil.bat +++ b/windows/tools/h5import/h5importtestutil.bat @@ -22,6 +22,9 @@ rem setlocal enabledelayedexpansion pushd %~dp0 +rem srcdir is used on Unix-- define as the current directory for Windows. +set srcdir=%CD% + rem The tool name set h5import=h5import%2 rem The path of the tool binary @@ -37,9 +40,6 @@ set h5dump=..\h5dump%2\%1\h5dump%2 rem The path of the h5dump tool binary set h5dump_bin=%CD%\%h5dump% -rem source directory (this is already defined in the Linux script) -set srcdir=%CD% - rem initialize errors variables set errors=0 @@ -104,67 +104,52 @@ goto main rem On Windows, echo gives a carriage return, so we store the TESTING params rem and call TESTING from TOOLTEST. --SJW 8/27/07 set testing=ASCII I32 rank 3 - Output BE - rem call :tooltest txtin32 -c %CD%\testfiles\textin32 -o test1.h5 call :tooltest %srcdir%\testfiles\txtin16.txt -c %srcdir%\testfiles\txtin32.conf -o txtin32.h5 set testing=ASCII I16 rank 3 - Output LE - CHUNKED - extended - rem call :tooltest txtin16 -c %CD%\testfiles\textin16 -o test2.h5 call :tooltest %srcdir%\testfiles\txtin16.txt -c %srcdir%\testfiles\txtin16.conf -o txtin16.h5 set testing=ASCII I8 - rank 3 - Output I16 LE-Chunked+Extended+Compressed - rem call :tooltest txtin16 -c %CD%\testfiles\textin8 -o test3.h5 call :tooltest %srcdir%\testfiles\txtin16.txt -c %srcdir%\testfiles\txtin8.conf -o txtin8.h5 set testing=ASCII UI32 - rank 3 - Output BE - rem call :tooltest %CD%\testfiles\in1 -c %CD%\testfiles\textuin32 -o test4.h5 - call :tooltest %srcdir%\testfiles\txtuin32.txt -c %srcdir%\testfiles\txtuin32.conf -o txtuin32.h5 + call :tooltest %srcdir%\testfiles\txtin32.txt -c %srcdir%\testfiles\txtuin32.conf -o txtuin32.h5 set testing=ASCII UI16 - rank 2 - Output LE+Chunked+Compressed - rem call :tooltest %CD%\testfiles\in1 -c %CD%\testfiles\textuin16 -o test5.h5 call :tooltest %srcdir%\testfiles\txtuin32.txt -c %srcdir%\testfiles\txtuin16.conf -o txtuin16.h5 set testing=ASCII F32 - rank 3 - Output LE - rem call :tooltest %CD%\testfiles\fp1 -c %CD%\testfiles\textfp32 -o test6.h5 call :tooltest %srcdir%\testfiles\txtfp32.txt -c %srcdir%\testfiles\txtfp32.conf -o txtfp32.h5 set testing=ASCII F64 - rank 3 - Output BE + CHUNKED+Extended+Compressed - rem call :tooltest %CD%\testfiles\fp2 -c %CD%\testfiles\textfp64 -o test7.h5 call :tooltest %srcdir%\testfiles\txtfp64.txt -c %srcdir%\testfiles\txtfp64.conf -o txtfp64.h5 set testing=BINARY F64 - rank 3 - Output LE+CHUNKED+Extended+Compressed - rem call :tooltest bfp64 -c %CD%\testfiles\conbfp64 -o test8.h5 call :tooltest binfp64.bin -c %srcdir%\testfiles\binfp64.conf -o binfp64.h5 set testing=BINARY I16 - rank 3 - Output order LE + CHUNKED + extended - rem call :tooltest bin16 -c %CD%\testfiles\conbin16 -o test9.h5 call :tooltest binin16.bin -c %srcdir%\testfiles\binin16.conf -o binin16.h5 set testing=BINARY I8 - rank 3 - Output I16LE + Chunked+Extended+Compressed - rem call :tooltest bin8 -c %CD%\testfiles\conbin8 -o test10.h5 call :tooltest binin8.bin -c %srcdir%\testfiles\binin8.conf -o binin8.h5 set testing=BINARY I32 - rank 3 - Output BE + CHUNKED - rem call :tooltest bin32 -c %CD%\testfiles\conbin32 -o test11.h5 call :tooltest binin32.bin -c %srcdir%\testfiles\binin32.conf -o binin32.h5 set testing=BINARY UI16 - rank 3 - Output byte BE + CHUNKED - rem call :tooltest buin16 -c %CD%\testfiles\conbuin16 -o test12.h5 call :tooltest binuin16.bin -c %srcdir%\testfiles\binuin16.conf -o binuin16.h5 set testing=BINARY UI32 - rank 3 - Output LE + CHUNKED - rem call :tooltest buin32 -c %CD%\testfiles\conbuin32 -o test13.h5 call :tooltest binuin32.bin -c %srcdir%\testfiles\binuin32.conf -o binuin32.h5 set testing=STR - rem call :tooltest %CD%\testfiles\txtstr -c %CD%\testfiles\textstr -o teststr.h5 call :tooltest %srcdir%\testfiles\txtstr.txt -c %srcdir%\testfiles\txtstr.conf -o txtstr.h5 set testing=BINARY I8 CR LF EOF call :tooltest binin8w.bin -c %srcdir%\testfiles\binin8w.conf -o binin8w.h5 - set testing=ASCII F64 - rank 1 - INPUT-CLASS TEXTFPE - call :tooltest %srcdir%\testfiles\in64.txt -c %srcdir%\testfiles\textpfe.conf -o test15.h5 - + set testing=ASCII F64 - rank 1 - INPUT-CLASS TEXTFPE + call :tooltest %srcdir%\testfiles\textpfe64.txt -c %srcdir%\testfiles\textpfe.conf -o textpfe.h5 del /f *.txt *.bin *.h5 -- cgit v0.12